From 7c222a4211585968a92fdeb5572c351c1fdb29f5 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Wed, 26 Nov 2025 23:57:05 +0530 Subject: [PATCH 01/13] Adding v3 changes --- .DS_Store | Bin 0 -> 8196 bytes .fernignore | 94 + .gitignore | 134 +- build.gradle | 183 +- gradle/maven-publish.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 60756 -> 43764 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 41 +- gradlew.bat | 27 +- reference.md | 25097 ++++++++++++++++ sample-app/build.gradle | 19 + sample-app/src/main/java/sample/App.java | 10 + settings.gradle | 2 + .../java/com/auth0/client/HttpOptions.java | 1 - .../java/com/auth0/client/LoggingOptions.java | 2 - .../java/com/auth0/client/ProxyOptions.java | 3 +- .../java/com/auth0/client/auth/AuthAPI.java | 288 +- .../client/auth/AuthorizeUrlBuilder.java | 5 +- .../client/auth/ClientAssertionSigner.java | 2 +- .../auth0/client/auth/LogoutUrlBuilder.java | 5 +- .../client/auth/RSAClientAssertionSigner.java | 39 +- .../com/auth0/client/mgmt/ActionsClient.java | 183 + .../com/auth0/client/mgmt/ActionsEntity.java | 416 - .../auth0/client/mgmt/AsyncActionsClient.java | 188 + .../client/mgmt/AsyncBrandingClient.java | 91 + .../client/mgmt/AsyncClientGrantsClient.java | 118 + .../auth0/client/mgmt/AsyncClientsClient.java | 403 + .../client/mgmt/AsyncConnectionsClient.java | 221 + .../client/mgmt/AsyncCustomDomainsClient.java | 230 + .../mgmt/AsyncDeviceCredentialsClient.java | 86 + .../mgmt/AsyncEmailTemplatesClient.java | 105 + .../client/mgmt/AsyncEventStreamsClient.java | 132 + .../auth0/client/mgmt/AsyncFlowsClient.java | 101 + .../auth0/client/mgmt/AsyncFormsClient.java | 91 + .../auth0/client/mgmt/AsyncHooksClient.java | 140 + .../auth0/client/mgmt/AsyncJobsClient.java | 75 + .../client/mgmt/AsyncLogStreamsClient.java | 792 + .../auth0/client/mgmt/AsyncLogsClient.java | 126 + .../auth0/client/mgmt/AsyncManagementApi.java | 300 + .../mgmt/AsyncManagementApiBuilder.java | 205 + .../client/mgmt/AsyncNetworkAclsClient.java | 138 + .../client/mgmt/AsyncOrganizationsClient.java | 213 + .../auth0/client/mgmt/AsyncPromptsClient.java | 91 + .../client/mgmt/AsyncRawActionsClient.java | 718 + .../client/mgmt/AsyncRawBrandingClient.java | 214 + .../mgmt/AsyncRawClientGrantsClient.java | 446 + .../client/mgmt/AsyncRawClientsClient.java | 886 + .../mgmt/AsyncRawConnectionsClient.java | 681 + .../mgmt/AsyncRawCustomDomainsClient.java | 756 + .../mgmt/AsyncRawDeviceCredentialsClient.java | 344 + .../mgmt/AsyncRawEmailTemplatesClient.java | 435 + .../mgmt/AsyncRawEventStreamsClient.java | 641 + .../client/mgmt/AsyncRawFlowsClient.java | 500 + .../client/mgmt/AsyncRawFormsClient.java | 489 + .../client/mgmt/AsyncRawHooksClient.java | 549 + .../auth0/client/mgmt/AsyncRawJobsClient.java | 124 + .../client/mgmt/AsyncRawLogStreamsClient.java | 1171 + .../auth0/client/mgmt/AsyncRawLogsClient.java | 305 + .../mgmt/AsyncRawNetworkAclsClient.java | 632 + .../mgmt/AsyncRawOrganizationsClient.java | 653 + .../client/mgmt/AsyncRawPromptsClient.java | 215 + .../mgmt/AsyncRawRefreshTokensClient.java | 199 + .../mgmt/AsyncRawResourceServersClient.java | 548 + .../client/mgmt/AsyncRawRolesClient.java | 527 + .../client/mgmt/AsyncRawRulesClient.java | 552 + .../mgmt/AsyncRawRulesConfigsClient.java | 282 + .../AsyncRawSelfServiceProfilesClient.java | 556 + .../client/mgmt/AsyncRawSessionsClient.java | 285 + .../client/mgmt/AsyncRawStatsClient.java | 205 + .../AsyncRawSupplementalSignalsClient.java | 215 + .../client/mgmt/AsyncRawTicketsClient.java | 246 + .../AsyncRawTokenExchangeProfilesClient.java | 541 + .../client/mgmt/AsyncRawUserBlocksClient.java | 393 + .../client/mgmt/AsyncRawUserGrantsClient.java | 300 + .../client/mgmt/AsyncRawUsersClient.java | 1043 + .../client/mgmt/AsyncRefreshTokensClient.java | 55 + .../mgmt/AsyncResourceServersClient.java | 132 + .../auth0/client/mgmt/AsyncRolesClient.java | 144 + .../auth0/client/mgmt/AsyncRulesClient.java | 132 + .../client/mgmt/AsyncRulesConfigsClient.java | 77 + .../mgmt/AsyncSelfServiceProfilesClient.java | 142 + .../client/mgmt/AsyncSessionsClient.java | 69 + .../auth0/client/mgmt/AsyncStatsClient.java | 65 + .../mgmt/AsyncSupplementalSignalsClient.java | 59 + .../auth0/client/mgmt/AsyncTicketsClient.java | 71 + .../AsyncTokenExchangeProfilesClient.java | 140 + .../client/mgmt/AsyncUserBlocksClient.java | 102 + .../client/mgmt/AsyncUserGrantsClient.java | 81 + .../auth0/client/mgmt/AsyncUsersClient.java | 504 + .../client/mgmt/AttackProtectionEntity.java | 118 - .../client/mgmt/BaseManagementEntity.java | 41 - .../auth0/client/mgmt/BlacklistsEntity.java | 68 - .../com/auth0/client/mgmt/BrandingClient.java | 89 + .../com/auth0/client/mgmt/BrandingEntity.java | 107 - .../auth0/client/mgmt/ClientGrantsClient.java | 115 + .../auth0/client/mgmt/ClientGrantsEntity.java | 191 - .../com/auth0/client/mgmt/ClientsClient.java | 399 + .../com/auth0/client/mgmt/ClientsEntity.java | 296 - .../auth0/client/mgmt/ConnectionsClient.java | 219 + .../auth0/client/mgmt/ConnectionsEntity.java | 466 - .../client/mgmt/CustomDomainsClient.java | 228 + .../client/mgmt/DeviceCredentialsClient.java | 84 + .../client/mgmt/DeviceCredentialsEntity.java | 91 - .../client/mgmt/EmailProviderEntity.java | 106 - .../client/mgmt/EmailTemplatesClient.java | 103 + .../client/mgmt/EmailTemplatesEntity.java | 101 - .../auth0/client/mgmt/EventStreamsClient.java | 127 + .../com/auth0/client/mgmt/FlowsClient.java | 97 + .../com/auth0/client/mgmt/FormsClient.java | 87 + .../com/auth0/client/mgmt/GrantsEntity.java | 96 - .../com/auth0/client/mgmt/GuardianEntity.java | 263 - .../com/auth0/client/mgmt/HooksClient.java | 136 + .../com/auth0/client/mgmt/JobsClient.java | 74 + .../com/auth0/client/mgmt/JobsEntity.java | 253 - .../com/auth0/client/mgmt/KeysEntity.java | 262 - .../auth0/client/mgmt/LogEventsEntity.java | 76 - .../auth0/client/mgmt/LogStreamsClient.java | 790 + .../auth0/client/mgmt/LogStreamsEntity.java | 133 - .../com/auth0/client/mgmt/LogsClient.java | 124 + .../com/auth0/client/mgmt/ManagementAPI.java | 472 - .../com/auth0/client/mgmt/ManagementApi.java | 300 + .../client/mgmt/ManagementApiBuilder.java | 205 + .../auth0/client/mgmt/NetworkAclsClient.java | 135 + .../auth0/client/mgmt/NetworkAclsEntity.java | 152 - .../client/mgmt/OrganizationsClient.java | 210 + .../client/mgmt/OrganizationsEntity.java | 676 - .../com/auth0/client/mgmt/PromptsClient.java | 90 + .../com/auth0/client/mgmt/PromptsEntity.java | 162 - .../auth0/client/mgmt/RawActionsClient.java | 544 + .../auth0/client/mgmt/RawBrandingClient.java | 167 + .../client/mgmt/RawClientGrantsClient.java | 341 + .../auth0/client/mgmt/RawClientsClient.java | 734 + .../client/mgmt/RawConnectionsClient.java | 525 + .../client/mgmt/RawCustomDomainsClient.java | 591 + .../mgmt/RawDeviceCredentialsClient.java | 264 + .../client/mgmt/RawEmailTemplatesClient.java | 333 + .../client/mgmt/RawEventStreamsClient.java | 477 + .../com/auth0/client/mgmt/RawFlowsClient.java | 372 + .../com/auth0/client/mgmt/RawFormsClient.java | 365 + .../com/auth0/client/mgmt/RawHooksClient.java | 416 + .../com/auth0/client/mgmt/RawJobsClient.java | 95 + .../client/mgmt/RawLogStreamsClient.java | 1052 + .../com/auth0/client/mgmt/RawLogsClient.java | 246 + .../client/mgmt/RawNetworkAclsClient.java | 477 + .../client/mgmt/RawOrganizationsClient.java | 505 + .../auth0/client/mgmt/RawPromptsClient.java | 168 + .../client/mgmt/RawRefreshTokensClient.java | 151 + .../client/mgmt/RawResourceServersClient.java | 419 + .../com/auth0/client/mgmt/RawRolesClient.java | 400 + .../com/auth0/client/mgmt/RawRulesClient.java | 419 + .../client/mgmt/RawRulesConfigsClient.java | 220 + .../mgmt/RawSelfServiceProfilesClient.java | 420 + .../auth0/client/mgmt/RawSessionsClient.java | 214 + .../com/auth0/client/mgmt/RawStatsClient.java | 160 + .../mgmt/RawSupplementalSignalsClient.java | 166 + .../auth0/client/mgmt/RawTicketsClient.java | 193 + .../mgmt/RawTokenExchangeProfilesClient.java | 416 + .../client/mgmt/RawUserBlocksClient.java | 298 + .../client/mgmt/RawUserGrantsClient.java | 228 + .../com/auth0/client/mgmt/RawUsersClient.java | 844 + .../client/mgmt/RefreshTokensClient.java | 54 + .../client/mgmt/RefreshTokensEntity.java | 66 - .../com/auth0/client/mgmt/RequestBuilder.java | 75 - .../client/mgmt/ResourceServerEntity.java | 140 - .../client/mgmt/ResourceServersClient.java | 129 + .../com/auth0/client/mgmt/RolesClient.java | 141 + .../com/auth0/client/mgmt/RolesEntity.java | 280 - .../com/auth0/client/mgmt/RulesClient.java | 128 + .../auth0/client/mgmt/RulesConfigsClient.java | 76 + .../auth0/client/mgmt/RulesConfigsEntity.java | 88 - .../com/auth0/client/mgmt/RulesEntity.java | 141 - .../mgmt/SelfServiceProfilesClient.java | 138 + .../mgmt/SelfServiceProfilesEntity.java | 265 - .../com/auth0/client/mgmt/SessionsClient.java | 68 + .../com/auth0/client/mgmt/SessionsEntity.java | 89 - .../client/mgmt/SimpleTokenProvider.java | 33 - .../com/auth0/client/mgmt/StatsClient.java | 63 + .../com/auth0/client/mgmt/StatsEntity.java | 77 - .../mgmt/SupplementalSignalsClient.java | 57 + .../com/auth0/client/mgmt/TenantsEntity.java | 71 - .../com/auth0/client/mgmt/TicketsClient.java | 69 + .../com/auth0/client/mgmt/TicketsEntity.java | 70 - .../mgmt/TokenExchangeProfilesClient.java | 136 + .../com/auth0/client/mgmt/TokenProvider.java | 5 +- .../mgmt/UserAttributeProfilesEntity.java | 151 - .../auth0/client/mgmt/UserBlocksClient.java | 101 + .../auth0/client/mgmt/UserBlocksEntity.java | 104 - .../auth0/client/mgmt/UserGrantsClient.java | 78 + .../com/auth0/client/mgmt/UsersClient.java | 499 + .../com/auth0/client/mgmt/UsersEntity.java | 908 - .../mgmt/actions/AsyncExecutionsClient.java | 41 + .../actions/AsyncRawExecutionsClient.java | 126 + .../mgmt/actions/AsyncRawTriggersClient.java | 119 + .../mgmt/actions/AsyncRawVersionsClient.java | 364 + .../mgmt/actions/AsyncTriggersClient.java | 51 + .../mgmt/actions/AsyncVersionsClient.java | 97 + .../client/mgmt/actions/ExecutionsClient.java | 40 + .../mgmt/actions/RawExecutionsClient.java | 97 + .../mgmt/actions/RawTriggersClient.java | 92 + .../mgmt/actions/RawVersionsClient.java | 280 + .../client/mgmt/actions/TriggersClient.java | 50 + .../client/mgmt/actions/VersionsClient.java | 94 + .../actions/triggers/AsyncBindingsClient.java | 77 + .../triggers/AsyncRawBindingsClient.java | 264 + .../mgmt/actions/triggers/BindingsClient.java | 76 + .../actions/triggers/RawBindingsClient.java | 206 + ...ctionTriggerBindingsRequestParameters.java | 187 + .../UpdateActionBindingsRequestContent.java | 105 + .../ListActionVersionsRequestParameters.java | 187 + .../client/mgmt/anomaly/AnomalyClient.java | 23 + .../mgmt/anomaly/AsyncAnomalyClient.java | 23 + .../mgmt/anomaly/AsyncBlocksClient.java | 54 + .../mgmt/anomaly/AsyncRawBlocksClient.java | 199 + .../client/mgmt/anomaly/BlocksClient.java | 53 + .../client/mgmt/anomaly/RawBlocksClient.java | 151 + .../AsyncAttackProtectionClient.java | 39 + .../AsyncBreachedPasswordDetectionClient.java | 66 + .../AsyncBruteForceProtectionClient.java | 66 + ...yncRawBreachedPasswordDetectionClient.java | 220 + .../AsyncRawBruteForceProtectionClient.java | 217 + .../AsyncRawSuspiciousIpThrottlingClient.java | 218 + .../AsyncSuspiciousIpThrottlingClient.java | 66 + .../AttackProtectionClient.java | 38 + .../BreachedPasswordDetectionClient.java | 65 + .../BruteForceProtectionClient.java | 64 + .../RawBreachedPasswordDetectionClient.java | 172 + .../RawBruteForceProtectionClient.java | 170 + .../RawSuspiciousIpThrottlingClient.java | 172 + .../SuspiciousIpThrottlingClient.java | 65 + ...sswordDetectionSettingsRequestContent.java | 225 + ...pdateBruteForceSettingsRequestContent.java | 230 + ...eBruteForceSettingsRequestContentMode.java | 87 + ...orceSettingsRequestContentShieldsItem.java | 86 + ...ousIpThrottlingSettingsRequestContent.java | 188 + .../branding/AsyncRawTemplatesClient.java | 338 + .../mgmt/branding/AsyncRawThemesClient.java | 486 + .../mgmt/branding/AsyncTemplatesClient.java | 104 + .../mgmt/branding/AsyncThemesClient.java | 105 + .../mgmt/branding/RawTemplatesClient.java | 263 + .../client/mgmt/branding/RawThemesClient.java | 367 + .../client/mgmt/branding/TemplatesClient.java | 102 + .../client/mgmt/branding/ThemesClient.java | 103 + .../mgmt/branding/phone/AsyncPhoneClient.java | 30 + .../branding/phone/AsyncProvidersClient.java | 140 + .../phone/AsyncRawProvidersClient.java | 618 + .../phone/AsyncRawTemplatesClient.java | 665 + .../branding/phone/AsyncTemplatesClient.java | 111 + .../mgmt/branding/phone/PhoneClient.java | 30 + .../mgmt/branding/phone/ProvidersClient.java | 137 + .../branding/phone/RawProvidersClient.java | 471 + .../branding/phone/RawTemplatesClient.java | 495 + .../mgmt/branding/phone/TemplatesClient.java | 108 + ...teBrandingPhoneProviderRequestContent.java | 208 + ...tePhoneProviderSendTestRequestContent.java | 148 + .../CreatePhoneTemplateRequestContent.java | 151 + ...emplateTestNotificationRequestContent.java | 148 + ...andingPhoneProvidersRequestParameters.java | 136 + .../ListPhoneTemplatesRequestParameters.java | 136 + ...teBrandingPhoneProviderRequestContent.java | 180 + .../UpdatePhoneTemplateRequestContent.java | 127 + .../CreateBrandingThemeRequestContent.java | 252 + .../UpdateBrandingThemeRequestContent.java | 252 + .../AsyncOrganizationsClient.java | 43 + .../AsyncRawOrganizationsClient.java | 148 + .../clientgrants/OrganizationsClient.java | 41 + .../clientgrants/RawOrganizationsClient.java | 114 + ...ntGrantOrganizationsRequestParameters.java | 185 + .../mgmt/clients/AsyncConnectionsClient.java | 75 + .../mgmt/clients/AsyncCredentialsClient.java | 180 + .../clients/AsyncRawConnectionsClient.java | 189 + .../clients/AsyncRawCredentialsClient.java | 572 + .../mgmt/clients/ConnectionsClient.java | 74 + .../mgmt/clients/CredentialsClient.java | 177 + .../mgmt/clients/RawConnectionsClient.java | 154 + .../mgmt/clients/RawCredentialsClient.java | 453 + .../clients/types/ConnectionsGetRequest.java | 366 + .../PatchClientCredentialRequestContent.java | 137 + .../PostClientCredentialRequestContent.java | 363 + .../mgmt/connections/AsyncClientsClient.java | 66 + .../mgmt/connections/AsyncKeysClient.java | 68 + .../connections/AsyncRawClientsClient.java | 255 + .../mgmt/connections/AsyncRawKeysClient.java | 243 + .../AsyncRawScimConfigurationClient.java | 442 + .../mgmt/connections/AsyncRawUsersClient.java | 119 + .../AsyncScimConfigurationClient.java | 125 + .../mgmt/connections/AsyncUsersClient.java | 42 + .../mgmt/connections/ClientsClient.java | 65 + .../client/mgmt/connections/KeysClient.java | 67 + .../mgmt/connections/RawClientsClient.java | 197 + .../mgmt/connections/RawKeysClient.java | 191 + .../RawScimConfigurationClient.java | 348 + .../mgmt/connections/RawUsersClient.java | 94 + .../connections/ScimConfigurationClient.java | 123 + .../client/mgmt/connections/UsersClient.java | 41 + .../AsyncRawTokensClient.java | 284 + .../scimconfiguration/AsyncTokensClient.java | 80 + .../scimconfiguration/RawTokensClient.java | 224 + .../scimconfiguration/TokensClient.java | 79 + .../types/CreateScimTokenRequestContent.java | 166 + ...ConnectionUsersByEmailQueryParameters.java | 114 + ...ectionEnabledClientsRequestParameters.java | 185 + ...UpdateScimConfigurationRequestContent.java | 177 + .../client/mgmt/core/AsyncCustomPager.java | 164 + .../com/auth0/client/mgmt/core/BasePage.java | 38 + .../client/mgmt/core/BiDirectionalPage.java | 60 + .../auth0/client/mgmt/core/ClientOptions.java | 190 + .../auth0/client/mgmt/core/CustomPager.java | 117 + .../mgmt/core/DateTimeDeserializer.java | 55 + .../auth0/client/mgmt/core/Environment.java | 22 + .../auth0/client/mgmt/core/FileStream.java | 60 + .../mgmt/core/InputStreamRequestBody.java | 74 + .../mgmt/core/ManagementApiException.java | 73 + .../mgmt/core/ManagementApiHttpResponse.java | 37 + .../client/mgmt/core/ManagementException.java | 17 + .../auth0/client/mgmt/core/MediaTypes.java | 13 + .../com/auth0/client/mgmt/core/Nullable.java | 140 + .../mgmt/core/NullableNonemptyFilter.java | 25 + .../client/mgmt/core/OAuthTokenException.java | 44 + .../client/mgmt/core/OAuthTokenSupplier.java | 134 + .../auth0/client/mgmt/core/ObjectMappers.java | 45 + .../client/mgmt/core/OptionalNullable.java | 187 + .../client/mgmt/core/QueryStringMapper.java | 151 + .../client/mgmt/core/RequestOptions.java | 276 + .../mgmt/core/ResponseBodyInputStream.java | 45 + .../client/mgmt/core/ResponseBodyReader.java | 44 + .../client/mgmt/core/RetryInterceptor.java | 180 + .../com/auth0/client/mgmt/core/Stream.java | 302 + .../com/auth0/client/mgmt/core/Suppliers.java | 23 + .../com/auth0/client/mgmt/core/SyncPage.java | 24 + .../client/mgmt/core/SyncPagingIterable.java | 63 + .../client/mgmt/emails/AsyncEmailsClient.java | 23 + .../mgmt/emails/AsyncProviderClient.java | 304 + .../mgmt/emails/AsyncRawProviderClient.java | 631 + .../client/mgmt/emails/EmailsClient.java | 23 + .../client/mgmt/emails/ProviderClient.java | 303 + .../client/mgmt/emails/RawProviderClient.java | 528 + .../CreateEmailProviderRequestContent.java | 288 + .../GetEmailProviderRequestParameters.java | 195 + .../UpdateEmailProviderRequestContent.java | 241 + .../client/mgmt/errors/BadRequestError.java | 32 + .../client/mgmt/errors/ConflictError.java | 32 + .../mgmt/errors/ContentTooLargeError.java | 32 + .../client/mgmt/errors/ForbiddenError.java | 32 + .../mgmt/errors/InternalServerError.java | 32 + .../client/mgmt/errors/NotFoundError.java | 32 + .../mgmt/errors/PaymentRequiredError.java | 32 + .../mgmt/errors/ServiceUnavailableError.java | 32 + .../mgmt/errors/TooManyRequestsError.java | 32 + .../client/mgmt/errors/UnauthorizedError.java | 32 + .../eventstreams/AsyncDeliveriesClient.java | 53 + .../AsyncRawDeliveriesClient.java | 216 + .../AsyncRawRedeliveriesClient.java | 218 + .../eventstreams/AsyncRedeliveriesClient.java | 50 + .../mgmt/eventstreams/DeliveriesClient.java | 51 + .../eventstreams/RawDeliveriesClient.java | 167 + .../eventstreams/RawRedeliveriesClient.java | 166 + .../mgmt/eventstreams/RedeliveriesClient.java | 49 + ...teEventStreamRedeliveryRequestContent.java | 198 + ...ventStreamDeliveriesRequestParameters.java | 429 + .../client/mgmt/filter/ActionsFilter.java | 60 - .../auth0/client/mgmt/filter/BaseFilter.java | 19 - .../client/mgmt/filter/ClientFilter.java | 85 - .../mgmt/filter/ClientGrantsFilter.java | 68 - .../client/mgmt/filter/ConnectionFilter.java | 87 - .../mgmt/filter/DeviceCredentialsFilter.java | 74 - .../mgmt/filter/EnabledClientsFilter.java | 28 - .../mgmt/filter/EncryptionKeyFilter.java | 29 - .../client/mgmt/filter/FieldsFilter.java | 24 - .../client/mgmt/filter/GrantsFilter.java | 58 - .../client/mgmt/filter/InvitationsFilter.java | 58 - .../client/mgmt/filter/LogEventFilter.java | 54 - .../client/mgmt/filter/NetworkAclsFilter.java | 28 - .../OrganizationClientGrantsFilter.java | 65 - .../filter/PageBasedPaginationFilter.java | 31 - .../auth0/client/mgmt/filter/PageFilter.java | 68 - .../auth0/client/mgmt/filter/QueryFilter.java | 81 - .../mgmt/filter/ResourceServersFilter.java | 60 - .../auth0/client/mgmt/filter/RolesFilter.java | 48 - .../auth0/client/mgmt/filter/RulesFilter.java | 54 - .../filter/UserAttributeProfilesFilter.java | 17 - .../auth0/client/mgmt/filter/UserFilter.java | 82 - .../client/mgmt/filter/UsersExportFilter.java | 61 - .../mgmt/filter/UsersImportOptions.java | 64 - .../mgmt/flows/AsyncExecutionsClient.java | 67 + .../mgmt/flows/AsyncRawExecutionsClient.java | 313 + .../client/mgmt/flows/ExecutionsClient.java | 64 + .../mgmt/flows/RawExecutionsClient.java | 234 + .../flows/types/ExecutionsGetRequest.java | 131 + .../flows/types/ExecutionsListRequest.java | 184 + .../mgmt/guardian/AsyncEnrollmentsClient.java | 77 + .../mgmt/guardian/AsyncFactorsClient.java | 95 + .../mgmt/guardian/AsyncGuardianClient.java | 37 + .../mgmt/guardian/AsyncPoliciesClient.java | 80 + .../guardian/AsyncRawEnrollmentsClient.java | 289 + .../mgmt/guardian/AsyncRawFactorsClient.java | 206 + .../mgmt/guardian/AsyncRawPoliciesClient.java | 224 + .../mgmt/guardian/EnrollmentsClient.java | 76 + .../client/mgmt/guardian/FactorsClient.java | 93 + .../client/mgmt/guardian/GuardianClient.java | 37 + .../client/mgmt/guardian/PoliciesClient.java | 79 + .../mgmt/guardian/RawEnrollmentsClient.java | 224 + .../mgmt/guardian/RawFactorsClient.java | 162 + .../mgmt/guardian/RawPoliciesClient.java | 182 + .../guardian/factors/AsyncPhoneClient.java | 163 + .../factors/AsyncPushNotificationClient.java | 216 + .../guardian/factors/AsyncRawPhoneClient.java | 721 + .../AsyncRawPushNotificationClient.java | 862 + .../guardian/factors/AsyncRawSmsClient.java | 578 + .../mgmt/guardian/factors/AsyncSmsClient.java | 160 + .../mgmt/guardian/factors/PhoneClient.java | 158 + .../factors/PushNotificationClient.java | 211 + .../mgmt/guardian/factors/RawPhoneClient.java | 550 + .../factors/RawPushNotificationClient.java | 666 + .../mgmt/guardian/factors/RawSmsClient.java | 450 + .../mgmt/guardian/factors/SmsClient.java | 157 + .../guardian/factors/duo/AsyncDuoClient.java | 23 + .../factors/duo/AsyncRawSettingsClient.java | 298 + .../factors/duo/AsyncSettingsClient.java | 82 + .../mgmt/guardian/factors/duo/DuoClient.java | 23 + .../factors/duo/RawSettingsClient.java | 233 + .../guardian/factors/duo/SettingsClient.java | 80 + ...ardianFactorDuoSettingsRequestContent.java | 144 + ...ardianFactorDuoSettingsRequestContent.java | 144 + ...FactorPhoneMessageTypesRequestContent.java | 115 + ...ianFactorPhoneTemplatesRequestContent.java | 151 + ...rdianFactorSmsTemplatesRequestContent.java | 151 + ...ianFactorsProviderPhoneRequestContent.java | 105 + ...torsProviderPhoneTwilioRequestContent.java | 318 + ...roviderPushNotificationRequestContent.java | 106 + ...iderPushNotificationSnsRequestContent.java | 360 + ...rdianFactorsProviderSmsRequestContent.java | 105 + ...actorsProviderSmsTwilioRequestContent.java | 318 + ...iderPushNotificationSnsRequestContent.java | 360 + ...uardianEnrollmentTicketRequestContent.java | 323 + .../SetGuardianFactorRequestContent.java | 112 + .../mgmt/hooks/AsyncRawSecretsClient.java | 413 + .../client/mgmt/hooks/AsyncSecretsClient.java | 84 + .../client/mgmt/hooks/RawSecretsClient.java | 315 + .../client/mgmt/hooks/SecretsClient.java | 83 + .../client/mgmt/jobs/AsyncErrorsClient.java | 41 + .../mgmt/jobs/AsyncRawErrorsClient.java | 125 + .../mgmt/jobs/AsyncRawUsersExportsClient.java | 138 + .../mgmt/jobs/AsyncRawUsersImportsClient.java | 507 + .../jobs/AsyncRawVerificationEmailClient.java | 133 + .../mgmt/jobs/AsyncUsersExportsClient.java | 50 + .../mgmt/jobs/AsyncUsersImportsClient.java | 68 + .../jobs/AsyncVerificationEmailClient.java | 46 + .../auth0/client/mgmt/jobs/ErrorsClient.java | 40 + .../client/mgmt/jobs/RawErrorsClient.java | 96 + .../mgmt/jobs/RawUsersExportsClient.java | 110 + .../mgmt/jobs/RawUsersImportsClient.java | 367 + .../mgmt/jobs/RawVerificationEmailClient.java | 107 + .../client/mgmt/jobs/UsersExportsClient.java | 49 + .../client/mgmt/jobs/UsersImportsClient.java | 64 + .../mgmt/jobs/VerificationEmailClient.java | 44 + .../CreateExportUsersRequestContent.java | 190 + .../CreateImportUsersRequestContent.java | 247 + ...CreateVerificationEmailRequestContent.java | 236 + .../mgmt/jobs/types/ErrorsGetResponse.java | 100 + .../mgmt/keys/AsyncCustomSigningClient.java | 72 + .../mgmt/keys/AsyncEncryptionClient.java | 145 + .../client/mgmt/keys/AsyncKeysClient.java | 37 + .../keys/AsyncRawCustomSigningClient.java | 289 + .../mgmt/keys/AsyncRawEncryptionClient.java | 691 + .../mgmt/keys/AsyncRawSigningClient.java | 370 + .../client/mgmt/keys/AsyncSigningClient.java | 87 + .../client/mgmt/keys/CustomSigningClient.java | 71 + .../client/mgmt/keys/EncryptionClient.java | 143 + .../auth0/client/mgmt/keys/KeysClient.java | 37 + .../mgmt/keys/RawCustomSigningClient.java | 221 + .../client/mgmt/keys/RawEncryptionClient.java | 518 + .../client/mgmt/keys/RawSigningClient.java | 278 + .../auth0/client/mgmt/keys/SigningClient.java | 86 + .../CreateEncryptionKeyRequestContent.java | 103 + .../ImportEncryptionKeyRequestContent.java | 113 + .../ListEncryptionKeysRequestParameters.java | 237 + .../SetCustomSigningKeysRequestContent.java | 115 + .../AsyncClientGrantsClient.java | 63 + .../AsyncEnabledConnectionsClient.java | 132 + .../organizations/AsyncInvitationsClient.java | 97 + .../organizations/AsyncMembersClient.java | 141 + .../AsyncRawClientGrantsClient.java | 341 + .../AsyncRawEnabledConnectionsClient.java | 537 + .../AsyncRawInvitationsClient.java | 447 + .../organizations/AsyncRawMembersClient.java | 390 + .../organizations/ClientGrantsClient.java | 62 + .../EnabledConnectionsClient.java | 129 + .../mgmt/organizations/InvitationsClient.java | 96 + .../mgmt/organizations/MembersClient.java | 137 + .../organizations/RawClientGrantsClient.java | 256 + .../RawEnabledConnectionsClient.java | 415 + .../organizations/RawInvitationsClient.java | 339 + .../mgmt/organizations/RawMembersClient.java | 311 + .../members/AsyncRawRolesClient.java | 372 + .../members/AsyncRolesClient.java | 102 + .../organizations/members/RawRolesClient.java | 294 + .../organizations/members/RolesClient.java | 99 + ...OrganizationMemberRolesRequestContent.java | 113 + ...OrganizationMemberRolesRequestContent.java | 113 + ...anizationMemberRolesRequestParameters.java | 237 + ...dOrganizationConnectionRequestContent.java | 248 + ...OrganizationClientGrantRequestContent.java | 114 + ...eOrganizationInvitationRequestContent.java | 420 + ...reateOrganizationMemberRequestContent.java | 113 + ...leteOrganizationMembersRequestContent.java | 113 + ...ganizationInvitationRequestParameters.java | 196 + ...nizationClientGrantsRequestParameters.java | 418 + ...anizationConnectionsRequestParameters.java | 237 + ...anizationInvitationsRequestParameters.java | 420 + ...tOrganizationMembersRequestParameters.java | 309 + ...eOrganizationConnectionRequestContent.java | 165 + .../mgmt/prompts/AsyncCustomTextClient.java | 63 + .../mgmt/prompts/AsyncPartialsClient.java | 57 + .../prompts/AsyncRawCustomTextClient.java | 227 + .../mgmt/prompts/AsyncRawPartialsClient.java | 220 + .../mgmt/prompts/AsyncRawRenderingClient.java | 458 + .../mgmt/prompts/AsyncRenderingClient.java | 175 + .../client/mgmt/prompts/CustomTextClient.java | 61 + .../client/mgmt/prompts/PartialsClient.java | 55 + .../mgmt/prompts/RawCustomTextClient.java | 178 + .../mgmt/prompts/RawPartialsClient.java | 170 + .../mgmt/prompts/RawRenderingClient.java | 371 + .../client/mgmt/prompts/RenderingClient.java | 174 + .../types/ListAculsRequestParameters.java | 556 + .../types/UpdateAculRequestContent.java | 351 + .../mgmt/roles/AsyncPermissionsClient.java | 84 + .../mgmt/roles/AsyncRawPermissionsClient.java | 348 + .../mgmt/roles/AsyncRawUsersClient.java | 297 + .../client/mgmt/roles/AsyncUsersClient.java | 108 + .../client/mgmt/roles/PermissionsClient.java | 81 + .../mgmt/roles/RawPermissionsClient.java | 266 + .../client/mgmt/roles/RawUsersClient.java | 239 + .../auth0/client/mgmt/roles/UsersClient.java | 106 + .../AddRolePermissionsRequestContent.java | 114 + .../types/AssignRoleUsersRequestContent.java | 112 + .../DeleteRolePermissionsRequestContent.java | 115 + .../ListRolePermissionsRequestParameters.java | 237 + .../types/ListRoleUsersRequestParameters.java | 184 + .../AsyncCustomTextClient.java | 58 + .../AsyncRawCustomTextClient.java | 221 + .../AsyncRawSsoTicketClient.java | 222 + .../AsyncSsoTicketClient.java | 67 + .../selfserviceprofiles/CustomTextClient.java | 55 + .../RawCustomTextClient.java | 174 + .../RawSsoTicketClient.java | 175 + .../selfserviceprofiles/SsoTicketClient.java | 66 + ...ServiceProfileSsoTicketRequestContent.java | 288 + .../mgmt/tenants/AsyncRawSettingsClient.java | 233 + .../mgmt/tenants/AsyncSettingsClient.java | 74 + .../mgmt/tenants/AsyncTenantsClient.java | 23 + .../mgmt/tenants/RawSettingsClient.java | 183 + .../client/mgmt/tenants/SettingsClient.java | 73 + .../client/mgmt/tenants/TenantsClient.java | 23 + .../GetTenantSettingsRequestParameters.java | 196 + .../UpdateTenantSettingsRequestContent.java | 1369 + ...tingsRequestContentEnabledLocalesItem.java | 955 + .../com/auth0/client/mgmt/types/Action.java | 570 + .../auth0/client/mgmt/types/ActionBase.java | 257 + .../client/mgmt/types/ActionBinding.java | 242 + .../client/mgmt/types/ActionBindingRef.java | 124 + .../mgmt/types/ActionBindingRefTypeEnum.java | 96 + .../mgmt/types/ActionBindingTypeEnum.java | 86 + .../mgmt/types/ActionBindingWithRef.java | 191 + .../mgmt/types/ActionBuildStatusEnum.java | 124 + .../mgmt/types/ActionDeployedVersion.java | 544 + .../auth0/client/mgmt/types/ActionError.java | 140 + .../mgmt/types/ActionExecutionResult.java | 188 + .../mgmt/types/ActionExecutionStatusEnum.java | 126 + .../mgmt/types/ActionSecretRequest.java | 130 + .../mgmt/types/ActionSecretResponse.java | 131 + .../client/mgmt/types/ActionTrigger.java | 367 + .../types/ActionTriggerCompatibleTrigger.java | 135 + .../client/mgmt/types/ActionVersion.java | 544 + .../types/ActionVersionBuildStatusEnum.java | 128 + .../mgmt/types/ActionVersionDependency.java | 161 + .../client/mgmt/types/AculClientFilter.java | 124 + .../client/mgmt/types/AculDomainFilter.java | 124 + .../auth0/client/mgmt/types/AculFilters.java | 188 + .../auth0/client/mgmt/types/AculHeadTag.java | 157 + .../mgmt/types/AculHeadTagAttributes.java | 96 + .../client/mgmt/types/AculMatchTypeEnum.java | 83 + .../mgmt/types/AculOrganizationFilter.java | 124 + .../mgmt/types/AculRenderingModeEnum.java | 84 + .../mgmt/types/AculResponseContent.java | 348 + ...OrganizationConnectionResponseContent.java | 229 + ...rganizationClientGrantResponseContent.java | 251 + .../types/AuthenticationMethodTypeEnum.java | 181 + .../mgmt/types/AuthenticationTypeEnum.java | 94 + .../client/mgmt/types/BrandingColors.java | 126 + .../auth0/client/mgmt/types/BrandingFont.java | 101 + .../mgmt/types/BrandingPageBackground.java | 102 + .../mgmt/types/BrandingThemeBorders.java | 402 + .../BrandingThemeBordersButtonsStyleEnum.java | 97 + .../BrandingThemeBordersInputsStyleEnum.java | 97 + .../mgmt/types/BrandingThemeColors.java | 863 + ...dingThemeColorsCaptchaWidgetThemeEnum.java | 97 + .../mgmt/types/BrandingThemeFontBodyText.java | 145 + .../types/BrandingThemeFontButtonsText.java | 145 + .../types/BrandingThemeFontInputLabels.java | 145 + .../mgmt/types/BrandingThemeFontLinks.java | 145 + .../BrandingThemeFontLinksStyleEnum.java | 86 + .../mgmt/types/BrandingThemeFontSubtitle.java | 145 + .../mgmt/types/BrandingThemeFontTitle.java | 145 + .../client/mgmt/types/BrandingThemeFonts.java | 347 + .../types/BrandingThemePageBackground.java | 176 + ...dingThemePageBackgroundPageLayoutEnum.java | 97 + .../mgmt/types/BrandingThemeWidget.java | 234 + ...ingThemeWidgetHeaderTextAlignmentEnum.java | 97 + .../BrandingThemeWidgetLogoPositionEnum.java | 108 + ...ingThemeWidgetSocialButtonsLayoutEnum.java | 86 + ...tectionAdminNotificationFrequencyEnum.java | 109 + .../BreachedPasswordDetectionMethodEnum.java | 86 + ...DetectionPreChangePasswordShieldsEnum.java | 86 + ...sswordDetectionPreChangePasswordStage.java | 107 + ...tectionPreUserRegistrationShieldsEnum.java | 87 + ...wordDetectionPreUserRegistrationStage.java | 107 + .../BreachedPasswordDetectionShieldsEnum.java | 97 + .../types/BreachedPasswordDetectionStage.java | 122 + .../ChangePasswordTicketRequestContent.java | 363 + .../ChangePasswordTicketResponseContent.java | 114 + .../com/auth0/client/mgmt/types/Client.java | 1663 + .../client/mgmt/types/ClientAddonAws.java | 163 + .../mgmt/types/ClientAddonAzureBlob.java | 490 + .../client/mgmt/types/ClientAddonAzureSb.java | 223 + .../mgmt/types/ClientAddonEchoSign.java | 101 + .../client/mgmt/types/ClientAddonEgnyte.java | 101 + .../mgmt/types/ClientAddonFirebase.java | 224 + .../client/mgmt/types/ClientAddonLayer.java | 273 + .../client/mgmt/types/ClientAddonMscrm.java | 113 + .../mgmt/types/ClientAddonNewRelic.java | 101 + .../client/mgmt/types/ClientAddonOag.java | 59 + .../mgmt/types/ClientAddonOffice365.java | 130 + .../client/mgmt/types/ClientAddonRms.java | 113 + .../mgmt/types/ClientAddonSalesforce.java | 101 + .../mgmt/types/ClientAddonSalesforceApi.java | 194 + .../ClientAddonSalesforceSandboxApi.java | 194 + .../client/mgmt/types/ClientAddonSaml.java | 491 + .../client/mgmt/types/ClientAddonSapapi.java | 266 + .../client/mgmt/types/ClientAddonSentry.java | 130 + .../mgmt/types/ClientAddonSharePoint.java | 126 + .../ClientAddonSharePointExternalUrl.java | 98 + .../client/mgmt/types/ClientAddonSlack.java | 113 + .../mgmt/types/ClientAddonSpringCm.java | 101 + .../mgmt/types/ClientAddonSsoIntegration.java | 130 + .../client/mgmt/types/ClientAddonWams.java | 101 + .../client/mgmt/types/ClientAddonZendesk.java | 101 + .../client/mgmt/types/ClientAddonZoom.java | 101 + .../auth0/client/mgmt/types/ClientAddons.java | 887 + .../client/mgmt/types/ClientAppTypeEnum.java | 317 + .../types/ClientAuthenticationMethod.java | 148 + ...ticationMethodSelfSignedTlsClientAuth.java | 114 + ...ientAuthenticationMethodTlsClientAuth.java | 114 + .../mgmt/types/ClientComplianceLevelEnum.java | 118 + .../ClientCreateAuthenticationMethod.java | 148 + .../client/mgmt/types/ClientCredential.java | 383 + .../types/ClientCredentialAlgorithmEnum.java | 94 + .../mgmt/types/ClientCredentialTypeEnum.java | 96 + .../mgmt/types/ClientDefaultOrganization.java | 175 + .../mgmt/types/ClientEncryptionKey.java | 161 + ...entGrantOrganizationNullableUsageEnum.java | 97 + .../ClientGrantOrganizationUsageEnum.java | 97 + .../types/ClientGrantResponseContent.java | 293 + .../mgmt/types/ClientJwtConfiguration.java | 181 + .../auth0/client/mgmt/types/ClientMobile.java | 120 + .../mgmt/types/ClientMobileAndroid.java | 134 + .../client/mgmt/types/ClientMobileiOs.java | 130 + ...ClientOidcBackchannelLogoutInitiators.java | 123 + ...ntOidcBackchannelLogoutInitiatorsEnum.java | 163 + ...dcBackchannelLogoutInitiatorsModeEnum.java | 86 + .../ClientOidcBackchannelLogoutSettings.java | 131 + ...ClientOrganizationRequireBehaviorEnum.java | 97 + ...tOrganizationRequireBehaviorPatchEnum.java | 97 + .../types/ClientOrganizationUsageEnum.java | 94 + .../ClientOrganizationUsagePatchEnum.java | 97 + .../ClientRefreshTokenConfiguration.java | 360 + ...nsferAllowedAuthenticationMethodsEnum.java | 86 + .../ClientSessionTransferConfiguration.java | 265 + ...lientSessionTransferDeviceBindingEnum.java | 97 + ...ntSignedRequestObjectWithCredentialId.java | 128 + ...lientSignedRequestObjectWithPublicKey.java | 128 + .../client/mgmt/types/ClientSigningKey.java | 161 + .../ClientTokenEndpointAuthMethodEnum.java | 97 + ...ientTokenEndpointAuthMethodOrNullEnum.java | 97 + .../types/ConnectionAttributeIdentifier.java | 101 + .../mgmt/types/ConnectionAttributes.java | 143 + .../ConnectionAuthenticationMethods.java | 120 + .../mgmt/types/ConnectionCustomScripts.java | 308 + .../mgmt/types/ConnectionEnabledClient.java | 113 + .../client/mgmt/types/ConnectionForList.java | 351 + .../mgmt/types/ConnectionForOrganization.java | 247 + .../ConnectionGatewayAuthentication.java | 274 + .../ConnectionIdentifierPrecedenceEnum.java | 97 + .../types/ConnectionIdentityProviderEnum.java | 726 + .../client/mgmt/types/ConnectionKey.java | 565 + .../mgmt/types/ConnectionKeyUseEnum.java | 83 + ...ConnectionPasskeyAuthenticationMethod.java | 102 + .../ConnectionPasskeyChallengeUiEnum.java | 97 + .../mgmt/types/ConnectionPasskeyOptions.java | 158 + ...onnectionPasswordAuthenticationMethod.java | 103 + .../ConnectionPasswordComplexityOptions.java | 102 + .../ConnectionPasswordDictionaryOptions.java | 147 + .../ConnectionPasswordHistoryOptions.java | 132 + ...nnectionPasswordNoPersonalInfoOptions.java | 102 + .../types/ConnectionPasswordPolicyEnum.java | 115 + .../types/ConnectionPropertiesOptions.java | 1120 + .../ConnectionSetUserRootAttributesEnum.java | 97 + .../mgmt/types/ConnectionStrategyEnum.java | 706 + .../ConnectionUsernameValidationOptions.java | 124 + .../types/ConnectionValidationOptions.java | 129 + .../types/CreateActionRequestContent.java | 402 + .../types/CreateActionResponseContent.java | 570 + ...eBrandingPhoneProviderResponseContent.java | 379 + .../CreateBrandingThemeResponseContent.java | 287 + .../CreateClientGrantRequestContent.java | 289 + .../CreateClientGrantResponseContent.java | 293 + .../types/CreateClientRequestContent.java | 2049 ++ .../types/CreateClientResponseContent.java | 1663 + .../types/CreateConnectionRequestContent.java | 436 + .../CreateConnectionResponseContent.java | 383 + .../CreateCustomDomainRequestContent.java | 263 + .../CreateCustomDomainResponseContent.java | 384 + .../CreateEmailProviderResponseContent.java | 213 + .../CreateEmailTemplateRequestContent.java | 780 + .../CreateEmailTemplateResponseContent.java | 781 + ...ptionKeyPublicWrappingResponseContent.java | 137 + .../CreateEncryptionKeyResponseContent.java | 318 + .../mgmt/types/CreateEncryptionKeyType.java | 86 + ...CreateEventStreamActionRequestContent.java | 225 + ...eEventStreamEventBridgeRequestContent.java | 225 + ...eEventStreamRedeliveryResponseContent.java | 197 + .../CreateEventStreamResponseContent.java | 108 + ...ateEventStreamTestEventRequestContent.java | 136 + ...teEventStreamTestEventResponseContent.java | 294 + ...reateEventStreamWebHookRequestContent.java | 225 + .../mgmt/types/CreateExportUsersFields.java | 156 + .../CreateExportUsersResponseContent.java | 399 + .../mgmt/types/CreateFlowRequestContent.java | 134 + .../mgmt/types/CreateFlowResponseContent.java | 241 + .../mgmt/types/CreateFormRequestContent.java | 326 + .../mgmt/types/CreateFormResponseContent.java | 477 + ...ardianEnrollmentTicketResponseContent.java | 131 + .../mgmt/types/CreateHookRequestContent.java | 249 + .../mgmt/types/CreateHookResponseContent.java | 248 + .../CreateImportUsersResponseContent.java | 302 + .../CreateLogStreamDatadogRequestBody.java | 335 + ...CreateLogStreamEventBridgeRequestBody.java | 336 + .../CreateLogStreamEventGridRequestBody.java | 336 + .../types/CreateLogStreamHttpRequestBody.java | 335 + .../CreateLogStreamMixpanelRequestBody.java | 336 + .../types/CreateLogStreamRequestContent.java | 168 + .../types/CreateLogStreamResponseContent.java | 168 + .../CreateLogStreamSegmentRequestBody.java | 335 + .../CreateLogStreamSplunkRequestBody.java | 335 + .../types/CreateLogStreamSumoRequestBody.java | 335 + .../types/CreateNetworkAclRequestContent.java | 198 + ...OrganizationInvitationResponseContent.java | 469 + .../CreateOrganizationRequestContent.java | 296 + .../CreateOrganizationResponseContent.java | 268 + ...ePhoneProviderSendTestResponseContent.java | 131 + .../CreatePhoneTemplateResponseContent.java | 282 + ...mplateTestNotificationResponseContent.java | 104 + ...blicKeyDeviceCredentialRequestContent.java | 256 + ...licKeyDeviceCredentialResponseContent.java | 114 + .../CreateResourceServerRequestContent.java | 748 + .../CreateResourceServerResponseContent.java | 682 + .../mgmt/types/CreateRoleRequestContent.java | 157 + .../mgmt/types/CreateRoleResponseContent.java | 161 + .../mgmt/types/CreateRuleRequestContent.java | 238 + .../mgmt/types/CreateRuleResponseContent.java | 253 + ...CreateScimConfigurationRequestContent.java | 134 + ...reateScimConfigurationResponseContent.java | 332 + .../types/CreateScimTokenResponseContent.java | 225 + ...reateSelfServiceProfileRequestContent.java | 279 + ...eateSelfServiceProfileResponseContent.java | 327 + ...erviceProfileSsoTicketResponseContent.java | 103 + ...ateTokenExchangeProfileRequestContent.java | 212 + ...teTokenExchangeProfileResponseContent.java | 281 + .../client/mgmt/types/CreateTokenQuota.java | 102 + ...erAuthenticationMethodResponseContent.java | 585 + .../mgmt/types/CreateUserRequestContent.java | 814 + .../mgmt/types/CreateUserResponseContent.java | 717 + ...ableCredentialTemplateResponseContent.java | 358 + ...reateVerificationEmailResponseContent.java | 231 + .../CreatedAuthenticationMethodTypeEnum.java | 108 + ...eatedUserAuthenticationMethodTypeEnum.java | 119 + .../auth0/client/mgmt/types/CredentialId.java | 113 + .../auth0/client/mgmt/types/CustomDomain.java | 435 + .../CustomDomainCustomClientIpHeaderEnum.java | 119 + .../CustomDomainProvisioningTypeEnum.java | 86 + .../mgmt/types/CustomDomainTypeEnum.java | 85 + .../types/CustomProviderConfiguration.java | 107 + .../mgmt/types/CustomProviderCredentials.java | 59 + .../CustomProviderDeliveryMethodEnum.java | 86 + .../types/CustomSigningKeyAlgorithmEnum.java | 154 + .../mgmt/types/CustomSigningKeyCurveEnum.java | 94 + .../mgmt/types/CustomSigningKeyJwk.java | 642 + .../mgmt/types/CustomSigningKeyTypeEnum.java | 84 + .../auth0/client/mgmt/types/DailyStats.java | 253 + .../client/mgmt/types/DefaultTokenQuota.java | 120 + .../types/DeleteActionRequestParameters.java | 134 + ...erBlocksByIdentifierRequestParameters.java | 114 + ...eteUserGrantByUserIdRequestParameters.java | 114 + ...DeleteUserIdentityResponseContentItem.java | 407 + .../types/DeployActionResponseContent.java | 544 + .../DeployActionVersionRequestBodyParams.java | 103 + .../DeployActionVersionResponseContent.java | 545 + .../client/mgmt/types/DeviceCredential.java | 247 + .../mgmt/types/DeviceCredentialTypeEnum.java | 97 + .../client/mgmt/types/DomainVerification.java | 103 + .../mgmt/types/DomainVerificationMethod.java | 182 + .../DomainVerificationMethodNameEnum.java | 85 + .../client/mgmt/types/EmailAttribute.java | 175 + .../mgmt/types/EmailProviderCredentials.java | 223 + .../types/EmailProviderCredentialsSchema.java | 170 + ...lProviderCredentialsSchemaAccessKeyId.java | 165 + .../EmailProviderCredentialsSchemaApiKey.java | 156 + ...mailProviderCredentialsSchemaClientId.java | 164 + ...iderCredentialsSchemaConnectionString.java | 103 + ...mailProviderCredentialsSchemaSmtpHost.java | 189 + .../EmailProviderCredentialsSchemaThree.java | 125 + .../EmailProviderCredentialsSchemaZero.java | 114 + .../mgmt/types/EmailProviderNameEnum.java | 154 + .../mgmt/types/EmailTemplateNameEnum.java | 206 + .../client/mgmt/types/EncryptionKey.java | 317 + .../client/mgmt/types/EncryptionKeyState.java | 104 + .../client/mgmt/types/EncryptionKeyType.java | 107 + .../types/EventStreamActionConfiguration.java | 113 + .../types/EventStreamActionDestination.java | 125 + .../EventStreamActionResponseContent.java | 275 + .../mgmt/types/EventStreamBucketInterval.java | 112 + .../mgmt/types/EventStreamCloudEvent.java | 254 + .../mgmt/types/EventStreamDelivery.java | 292 + .../types/EventStreamDeliveryAttempt.java | 185 + .../EventStreamDeliveryEventTypeEnum.java | 211 + .../types/EventStreamDestinationPatch.java | 96 + .../EventStreamEventBridgeAwsRegionEnum.java | 317 + .../EventStreamEventBridgeConfiguration.java | 186 + .../EventStreamEventBridgeDestination.java | 125 + ...EventStreamEventBridgeResponseContent.java | 276 + .../mgmt/types/EventStreamEventTypeEnum.java | 207 + .../client/mgmt/types/EventStreamMetric.java | 244 + .../types/EventStreamResponseContent.java | 107 + .../mgmt/types/EventStreamStatusEnum.java | 84 + .../mgmt/types/EventStreamSubscription.java | 95 + .../types/EventStreamTestEventTypeEnum.java | 209 + ...entStreamWebhookAuthorizationResponse.java | 97 + .../types/EventStreamWebhookBasicAuth.java | 135 + .../types/EventStreamWebhookBearerAuth.java | 102 + .../EventStreamWebhookConfiguration.java | 139 + .../types/EventStreamWebhookDestination.java | 125 + .../EventStreamWebhookResponseContent.java | 275 + .../client/mgmt/types/EventStreamWindow.java | 175 + .../mgmt/types/EventStreamsCreateRequest.java | 108 + .../types/EventStreamsGetStatsRequest.java | 195 + ...ExtensibilityEmailProviderCredentials.java | 59 + .../types/FederatedConnectionTokenSet.java | 219 + .../auth0/client/mgmt/types/FlowAction.java | 371 + .../mgmt/types/FlowActionActivecampaign.java | 95 + .../FlowActionActivecampaignListContacts.java | 232 + ...ctionActivecampaignListContactsParams.java | 126 + ...FlowActionActivecampaignUpsertContact.java | 232 + ...tionActivecampaignUpsertContactParams.java | 253 + .../client/mgmt/types/FlowActionAirtable.java | 107 + .../types/FlowActionAirtableCreateRecord.java | 231 + .../FlowActionAirtableCreateRecordParams.java | 186 + .../types/FlowActionAirtableListRecords.java | 230 + .../FlowActionAirtableListRecordsParams.java | 216 + .../types/FlowActionAirtableUpdateRecord.java | 231 + .../FlowActionAirtableUpdateRecordParams.java | 211 + .../client/mgmt/types/FlowActionAuth0.java | 119 + .../mgmt/types/FlowActionAuth0CreateUser.java | 230 + .../FlowActionAuth0CreateUserParams.java | 146 + .../mgmt/types/FlowActionAuth0GetUser.java | 230 + .../types/FlowActionAuth0GetUserParams.java | 124 + .../types/FlowActionAuth0SendRequest.java | 230 + .../FlowActionAuth0SendRequestParams.java | 251 + ...lowActionAuth0SendRequestParamsMethod.java | 119 + ...owActionAuth0SendRequestParamsPayload.java | 112 + .../mgmt/types/FlowActionAuth0UpdateUser.java | 230 + .../FlowActionAuth0UpdateUserParams.java | 168 + .../types/FlowActionBigqueryInsertRows.java | 230 + .../FlowActionBigqueryInsertRowsParams.java | 185 + .../client/mgmt/types/FlowActionClearbit.java | 95 + .../types/FlowActionClearbitFindCompany.java | 230 + .../FlowActionClearbitFindCompanyParams.java | 126 + .../types/FlowActionClearbitFindPerson.java | 230 + .../FlowActionClearbitFindPersonParams.java | 126 + .../types/FlowActionEmailVerifyEmail.java | 230 + .../FlowActionEmailVerifyEmailParams.java | 135 + ...FlowActionEmailVerifyEmailParamsRules.java | 232 + .../client/mgmt/types/FlowActionFlow.java | 155 + .../types/FlowActionFlowBooleanCondition.java | 231 + .../FlowActionFlowBooleanConditionParams.java | 122 + .../mgmt/types/FlowActionFlowDelayFlow.java | 230 + .../types/FlowActionFlowDelayFlowParams.java | 135 + .../FlowActionFlowDelayFlowParamsNumber.java | 96 + .../FlowActionFlowDelayFlowParamsUnits.java | 108 + .../mgmt/types/FlowActionFlowDoNothing.java | 236 + .../types/FlowActionFlowDoNothingParams.java | 59 + .../types/FlowActionFlowErrorMessage.java | 230 + .../FlowActionFlowErrorMessageParams.java | 102 + .../mgmt/types/FlowActionFlowMapValue.java | 230 + .../types/FlowActionFlowMapValueParams.java | 164 + .../FlowActionFlowMapValueParamsFallback.java | 123 + .../FlowActionFlowMapValueParamsInput.java | 95 + .../mgmt/types/FlowActionFlowReturnJson.java | 230 + .../types/FlowActionFlowReturnJsonParams.java | 103 + ...FlowActionFlowReturnJsonParamsPayload.java | 99 + .../mgmt/types/FlowActionFlowStoreVars.java | 230 + .../types/FlowActionFlowStoreVarsParams.java | 105 + .../types/FlowActionGoogleSheetsAddRow.java | 230 + .../FlowActionGoogleSheetsAddRowParams.java | 194 + ...ActionGoogleSheetsAddRowParamsSheetId.java | 96 + .../mgmt/types/FlowActionHttpSendRequest.java | 230 + .../FlowActionHttpSendRequestParams.java | 325 + ...wActionHttpSendRequestParamsBasicAuth.java | 119 + ...ctionHttpSendRequestParamsContentType.java | 97 + ...FlowActionHttpSendRequestParamsMethod.java | 119 + ...lowActionHttpSendRequestParamsPayload.java | 112 + .../client/mgmt/types/FlowActionHubspot.java | 107 + .../types/FlowActionHubspotEnrollContact.java | 231 + .../FlowActionHubspotEnrollContactParams.java | 153 + ...nHubspotEnrollContactParamsWorkflowId.java | 96 + .../types/FlowActionHubspotGetContact.java | 230 + .../FlowActionHubspotGetContactParams.java | 125 + .../types/FlowActionHubspotUpsertContact.java | 231 + .../FlowActionHubspotUpsertContactParams.java | 162 + ...ionHubspotUpsertContactParamsProperty.java | 103 + .../client/mgmt/types/FlowActionJson.java | 107 + .../mgmt/types/FlowActionJsonCreateJson.java | 230 + .../types/FlowActionJsonCreateJsonParams.java | 105 + .../mgmt/types/FlowActionJsonParseJson.java | 230 + .../types/FlowActionJsonParseJsonParams.java | 102 + .../types/FlowActionJsonSerializeJson.java | 230 + .../FlowActionJsonSerializeJsonParams.java | 103 + ...owActionJsonSerializeJsonParamsObject.java | 99 + .../client/mgmt/types/FlowActionJwt.java | 107 + .../mgmt/types/FlowActionJwtDecodeJwt.java | 230 + .../types/FlowActionJwtDecodeJwtParams.java | 102 + .../mgmt/types/FlowActionJwtSignJwt.java | 230 + .../types/FlowActionJwtSignJwtParams.java | 257 + .../mgmt/types/FlowActionJwtVerifyJwt.java | 230 + .../types/FlowActionJwtVerifyJwtParams.java | 190 + .../FlowActionMailchimpUpsertMember.java | 231 + ...FlowActionMailchimpUpsertMemberParams.java | 151 + ...tionMailchimpUpsertMemberParamsMember.java | 162 + .../types/FlowActionMailjetSendEmail.java | 230 + .../FlowActionMailjetSendEmailParams.java | 97 + ...owActionMailjetSendEmailParamsContent.java | 103 + ...ctionMailjetSendEmailParamsTemplateId.java | 133 + .../client/mgmt/types/FlowActionOtp.java | 95 + .../mgmt/types/FlowActionOtpGenerateCode.java | 230 + .../FlowActionOtpGenerateCodeParams.java | 124 + .../mgmt/types/FlowActionOtpVerifyCode.java | 230 + .../types/FlowActionOtpVerifyCodeParams.java | 125 + .../FlowActionOtpVerifyCodeParamsCode.java | 95 + .../mgmt/types/FlowActionPipedrive.java | 107 + .../types/FlowActionPipedriveAddDeal.java | 230 + .../FlowActionPipedriveAddDealParams.java | 327 + ...nPipedriveAddDealParamsOrganizationId.java | 96 + ...wActionPipedriveAddDealParamsPersonId.java | 96 + ...owActionPipedriveAddDealParamsStageId.java | 96 + ...lowActionPipedriveAddDealParamsUserId.java | 96 + .../FlowActionPipedriveAddOrganization.java | 232 + ...wActionPipedriveAddOrganizationParams.java | 192 + ...PipedriveAddOrganizationParamsOwnerId.java | 96 + .../types/FlowActionPipedriveAddPerson.java | 230 + .../FlowActionPipedriveAddPersonParams.java | 283 + ...ipedriveAddPersonParamsOrganizationId.java | 96 + ...ActionPipedriveAddPersonParamsOwnerId.java | 96 + .../mgmt/types/FlowActionSalesforce.java | 119 + .../types/FlowActionSalesforceCreateLead.java | 231 + .../FlowActionSalesforceCreateLeadParams.java | 277 + .../types/FlowActionSalesforceGetLead.java | 230 + .../FlowActionSalesforceGetLeadParams.java | 125 + .../FlowActionSalesforceSearchLeads.java | 231 + ...FlowActionSalesforceSearchLeadsParams.java | 200 + ...alesforceSearchLeadsParamsSearchField.java | 108 + .../types/FlowActionSalesforceUpdateLead.java | 231 + .../FlowActionSalesforceUpdateLeadParams.java | 159 + .../types/FlowActionSendgridSendEmail.java | 230 + .../FlowActionSendgridSendEmailParams.java | 174 + ...owActionSendgridSendEmailParamsPerson.java | 134 + .../types/FlowActionSlackPostMessage.java | 230 + .../FlowActionSlackPostMessageParams.java | 167 + ...ctionSlackPostMessageParamsAttachment.java | 171 + ...SlackPostMessageParamsAttachmentColor.java | 97 + ...SlackPostMessageParamsAttachmentField.java | 162 + .../client/mgmt/types/FlowActionStripe.java | 155 + .../mgmt/types/FlowActionStripeAddTaxId.java | 230 + .../types/FlowActionStripeAddTaxIdParams.java | 177 + .../mgmt/types/FlowActionStripeAddress.java | 217 + .../types/FlowActionStripeCreateCustomer.java | 231 + .../FlowActionStripeCreateCustomerParams.java | 366 + .../FlowActionStripeCreatePortalSession.java | 232 + ...ActionStripeCreatePortalSessionParams.java | 162 + .../types/FlowActionStripeDeleteTaxId.java | 230 + .../FlowActionStripeDeleteTaxIdParams.java | 147 + .../types/FlowActionStripeFindCustomers.java | 230 + .../FlowActionStripeFindCustomersParams.java | 126 + .../types/FlowActionStripeGetCustomer.java | 230 + .../FlowActionStripeGetCustomerParams.java | 125 + .../mgmt/types/FlowActionStripeTaxId.java | 124 + .../types/FlowActionStripeUpdateCustomer.java | 231 + .../FlowActionStripeUpdateCustomerParams.java | 360 + .../types/FlowActionTelegramSendMessage.java | 230 + .../FlowActionTelegramSendMessageParams.java | 148 + .../client/mgmt/types/FlowActionTwilio.java | 95 + .../mgmt/types/FlowActionTwilioMakeCall.java | 230 + .../types/FlowActionTwilioMakeCallParams.java | 172 + .../mgmt/types/FlowActionTwilioSendSms.java | 230 + .../types/FlowActionTwilioSendSmsParams.java | 172 + .../types/FlowActionWhatsappSendMessage.java | 230 + .../FlowActionWhatsappSendMessageParams.java | 203 + ...ctionWhatsappSendMessageParamsPayload.java | 99 + ...owActionWhatsappSendMessageParamsType.java | 163 + .../client/mgmt/types/FlowActionXml.java | 95 + .../mgmt/types/FlowActionXmlParseXml.java | 230 + .../types/FlowActionXmlParseXmlParams.java | 102 + .../mgmt/types/FlowActionXmlSerializeXml.java | 230 + .../FlowActionXmlSerializeXmlParams.java | 103 + ...FlowActionXmlSerializeXmlParamsObject.java | 99 + .../types/FlowActionZapierTriggerWebhook.java | 231 + .../FlowActionZapierTriggerWebhookParams.java | 136 + ...ctionZapierTriggerWebhookParamsMethod.java | 97 + .../mgmt/types/FlowExecutionSummary.java | 397 + .../auth0/client/mgmt/types/FlowSummary.java | 209 + .../client/mgmt/types/FlowsListRequest.java | 356 + .../auth0/client/mgmt/types/FormBlock.java | 167 + .../client/mgmt/types/FormBlockDivider.java | 184 + .../mgmt/types/FormBlockDividerConfig.java | 95 + .../client/mgmt/types/FormBlockHtml.java | 184 + .../mgmt/types/FormBlockHtmlConfig.java | 95 + .../client/mgmt/types/FormBlockImage.java | 184 + .../mgmt/types/FormBlockImageConfig.java | 164 + .../FormBlockImageConfigPositionEnum.java | 97 + .../mgmt/types/FormBlockJumpButton.java | 176 + .../mgmt/types/FormBlockJumpButtonConfig.java | 158 + .../types/FormBlockJumpButtonConfigStyle.java | 95 + .../mgmt/types/FormBlockNextButton.java | 176 + .../mgmt/types/FormBlockNextButtonConfig.java | 102 + .../mgmt/types/FormBlockPreviousButton.java | 176 + .../types/FormBlockPreviousButtonConfig.java | 102 + .../mgmt/types/FormBlockResendButton.java | 176 + .../types/FormBlockResendButtonConfig.java | 284 + ...ckResendButtonConfigTextAlignmentEnum.java | 97 + .../client/mgmt/types/FormBlockRichText.java | 184 + .../mgmt/types/FormBlockRichTextConfig.java | 95 + .../client/mgmt/types/FormComponent.java | 107 + .../client/mgmt/types/FormEndingNode.java | 169 + .../mgmt/types/FormEndingNodeAfterSubmit.java | 95 + .../mgmt/types/FormEndingNodeRedirection.java | 133 + .../auth0/client/mgmt/types/FormField.java | 263 + .../client/mgmt/types/FormFieldBoolean.java | 300 + .../mgmt/types/FormFieldBooleanConfig.java | 120 + .../types/FormFieldBooleanConfigOptions.java | 118 + .../client/mgmt/types/FormFieldCards.java | 306 + .../mgmt/types/FormFieldCardsConfig.java | 144 + .../types/FormFieldCardsConfigOption.java | 147 + .../client/mgmt/types/FormFieldChoice.java | 306 + .../mgmt/types/FormFieldChoiceConfig.java | 144 + .../FormFieldChoiceConfigAllowOther.java | 143 + .../types/FormFieldChoiceConfigOption.java | 124 + .../client/mgmt/types/FormFieldCustom.java | 300 + .../mgmt/types/FormFieldCustomConfig.java | 210 + .../client/mgmt/types/FormFieldDate.java | 300 + .../mgmt/types/FormFieldDateConfig.java | 120 + .../types/FormFieldDateConfigFormatEnum.java | 84 + .../client/mgmt/types/FormFieldDropdown.java | 306 + .../mgmt/types/FormFieldDropdownConfig.java | 146 + .../types/FormFieldDropdownConfigOption.java | 124 + .../client/mgmt/types/FormFieldEmail.java | 306 + .../mgmt/types/FormFieldEmailConfig.java | 118 + .../client/mgmt/types/FormFieldFile.java | 306 + .../mgmt/types/FormFieldFileConfig.java | 219 + .../FormFieldFileConfigCategoryEnum.java | 119 + .../types/FormFieldFileConfigStorage.java | 103 + .../FormFieldFileConfigStorageTypeEnum.java | 86 + .../client/mgmt/types/FormFieldLegal.java | 306 + .../mgmt/types/FormFieldLegalConfig.java | 95 + .../client/mgmt/types/FormFieldNumber.java | 306 + .../mgmt/types/FormFieldNumberConfig.java | 169 + .../client/mgmt/types/FormFieldPassword.java | 300 + .../mgmt/types/FormFieldPasswordConfig.java | 249 + .../FormFieldPasswordConfigHashEnum.java | 116 + .../client/mgmt/types/FormFieldPayment.java | 300 + .../mgmt/types/FormFieldPaymentConfig.java | 220 + .../types/FormFieldPaymentConfigCharge.java | 97 + .../FormFieldPaymentConfigChargeOneOff.java | 126 + ...PaymentConfigChargeOneOffCurrencyEnum.java | 163 + ...mFieldPaymentConfigChargeOneOffOneOff.java | 128 + ...PaymentConfigChargeOneOffOneOffAmount.java | 96 + ...mFieldPaymentConfigChargeSubscription.java | 147 + .../FormFieldPaymentConfigCredentials.java | 125 + ...FormFieldPaymentConfigFieldProperties.java | 119 + .../types/FormFieldPaymentConfigFields.java | 170 + .../client/mgmt/types/FormFieldSocial.java | 306 + .../mgmt/types/FormFieldSocialConfig.java | 59 + .../auth0/client/mgmt/types/FormFieldTel.java | 305 + .../client/mgmt/types/FormFieldTelConfig.java | 219 + .../mgmt/types/FormFieldTelConfigStrings.java | 95 + .../client/mgmt/types/FormFieldText.java | 306 + .../mgmt/types/FormFieldTextConfig.java | 194 + .../auth0/client/mgmt/types/FormFieldUrl.java | 305 + .../client/mgmt/types/FormFieldUrlConfig.java | 118 + .../com/auth0/client/mgmt/types/FormFlow.java | 214 + .../client/mgmt/types/FormFlowConfig.java | 133 + .../client/mgmt/types/FormHiddenField.java | 132 + .../client/mgmt/types/FormLanguages.java | 118 + .../auth0/client/mgmt/types/FormMessages.java | 120 + .../com/auth0/client/mgmt/types/FormNode.java | 107 + .../mgmt/types/FormNodeCoordinates.java | 123 + .../client/mgmt/types/FormNodePointer.java | 96 + .../auth0/client/mgmt/types/FormRouter.java | 220 + .../client/mgmt/types/FormRouterConfig.java | 121 + .../client/mgmt/types/FormRouterRule.java | 164 + .../client/mgmt/types/FormStartNode.java | 146 + .../com/auth0/client/mgmt/types/FormStep.java | 220 + .../client/mgmt/types/FormStepConfig.java | 121 + .../auth0/client/mgmt/types/FormStyle.java | 95 + .../auth0/client/mgmt/types/FormSummary.java | 239 + .../auth0/client/mgmt/types/FormWidget.java | 107 + .../FormWidgetAuth0VerifiableCredentials.java | 301 + ...idgetAuth0VerifiableCredentialsConfig.java | 242 + .../mgmt/types/FormWidgetGMapsAddress.java | 300 + .../types/FormWidgetGMapsAddressConfig.java | 102 + .../mgmt/types/FormWidgetRecaptcha.java | 300 + .../mgmt/types/FormWidgetRecaptchaConfig.java | 124 + .../FormsRequestParametersHydrateEnum.java | 86 + .../GetActionExecutionResponseContent.java | 238 + .../mgmt/types/GetActionResponseContent.java | 570 + .../GetActionVersionResponseContent.java | 544 + .../mgmt/types/GetAculResponseContent.java | 414 + ...etBrandingDefaultThemeResponseContent.java | 287 + ...tBrandingPhoneProviderResponseContent.java | 379 + .../types/GetBrandingResponseContent.java | 181 + .../GetBrandingThemeResponseContent.java | 286 + ...swordDetectionSettingsResponseContent.java | 221 + .../GetBruteForceSettingsResponseContent.java | 230 + ...BruteForceSettingsResponseContentMode.java | 87 + ...rceSettingsResponseContentShieldsItem.java | 86 + .../GetClientCredentialResponseContent.java | 384 + .../types/GetClientRequestParameters.java | 195 + .../mgmt/types/GetClientResponseContent.java | 1663 + ...nnectionEnabledClientsResponseContent.java | 143 + .../types/GetConnectionRequestParameters.java | 195 + .../types/GetConnectionResponseContent.java | 383 + .../types/GetCustomDomainResponseContent.java | 435 + .../GetCustomSigningKeysResponseContent.java | 104 + .../types/GetDailyStatsRequestParameters.java | 193 + .../GetEmailProviderResponseContent.java | 212 + .../GetEmailTemplateResponseContent.java | 569 + .../GetEncryptionKeyResponseContent.java | 317 + ...tStreamDeliveryHistoryResponseContent.java | 294 + .../types/GetEventStreamResponseContent.java | 108 + .../GetEventStreamStatsResponseContent.java | 299 + .../GetFlowExecutionResponseContent.java | 437 + .../mgmt/types/GetFlowRequestParameters.java | 132 + .../GetFlowRequestParametersHydrateEnum.java | 86 + .../mgmt/types/GetFlowResponseContent.java | 241 + .../mgmt/types/GetFormRequestParameters.java | 132 + .../mgmt/types/GetFormResponseContent.java | 477 + .../GetGuardianEnrollmentResponseContent.java | 339 + ...rdianFactorDuoSettingsResponseContent.java | 144 + ...actorPhoneMessageTypesResponseContent.java | 105 + ...anFactorPhoneTemplatesResponseContent.java | 151 + ...dianFactorSmsTemplatesResponseContent.java | 151 + ...ianFactorsProviderApnsResponseContent.java | 177 + ...anFactorsProviderPhoneResponseContent.java | 97 + ...orsProviderPhoneTwilioResponseContent.java | 318 + ...oviderPushNotificationResponseContent.java | 98 + ...dianFactorsProviderSmsResponseContent.java | 97 + ...ctorsProviderSmsTwilioResponseContent.java | 318 + ...dianFactorsProviderSnsResponseContent.java | 360 + .../mgmt/types/GetHookRequestParameters.java | 134 + .../mgmt/types/GetHookResponseContent.java | 247 + .../types/GetJobErrorResponseContent.java | 127 + .../GetJobGenericErrorResponseContent.java | 317 + .../mgmt/types/GetJobImportUserError.java | 161 + .../mgmt/types/GetJobResponseContent.java | 496 + .../mgmt/types/GetLogResponseContent.java | 755 + .../types/GetLogStreamResponseContent.java | 168 + .../types/GetNetworkAclsResponseContent.java | 255 + .../GetOrganizationByNameResponseContent.java | 237 + ...OrganizationConnectionResponseContent.java | 229 + ...OrganizationInvitationResponseContent.java | 469 + .../types/GetOrganizationResponseContent.java | 236 + .../GetPhoneTemplateResponseContent.java | 281 + .../types/GetRefreshTokenResponseContent.java | 424 + .../GetResourceServerRequestParameters.java | 136 + .../GetResourceServerResponseContent.java | 681 + .../mgmt/types/GetRoleResponseContent.java | 161 + .../mgmt/types/GetRuleRequestParameters.java | 195 + .../mgmt/types/GetRuleResponseContent.java | 253 + ...gurationDefaultMappingResponseContent.java | 104 + .../GetScimConfigurationResponseContent.java | 332 + .../GetSelfServiceProfileResponseContent.java | 327 + .../mgmt/types/GetSessionResponseContent.java | 405 + .../types/GetSettingsResponseContent.java | 158 + .../types/GetSigningKeysResponseContent.java | 552 + ...GetSupplementalSignalsResponseContent.java | 103 + ...usIpThrottlingSettingsResponseContent.java | 186 + .../GetTenantSettingsResponseContent.java | 1289 + ...etTokenExchangeProfileResponseContent.java | 281 + .../mgmt/types/GetUniversalLoginTemplate.java | 101 + ...UniversalLoginTemplateResponseContent.java | 97 + ...erAuthenticationMethodResponseContent.java | 839 + .../mgmt/types/GetUserRequestParameters.java | 195 + .../mgmt/types/GetUserResponseContent.java | 717 + ...ableCredentialTemplateResponseContent.java | 358 + .../types/GuardianEnrollmentFactorEnum.java | 127 + .../mgmt/types/GuardianEnrollmentStatus.java | 84 + .../client/mgmt/types/GuardianFactor.java | 187 + .../mgmt/types/GuardianFactorNameEnum.java | 148 + ...rdianFactorPhoneFactorMessageTypeEnum.java | 86 + ...viderPushNotificationProviderDataEnum.java | 98 + ...uardianFactorsProviderSmsProviderEnum.java | 97 + .../com/auth0/client/mgmt/types/Hook.java | 247 + .../client/mgmt/types/HookTriggerIdEnum.java | 118 + .../client/mgmt/types/HttpCustomHeader.java | 130 + .../com/auth0/client/mgmt/types/Identity.java | 135 + .../mgmt/types/IdentityProviderEnum.java | 692 + .../ImportEncryptionKeyResponseContent.java | 318 + .../auth0/client/mgmt/types/Integration.java | 519 + .../types/IntegrationFeatureTypeEnum.java | 129 + .../client/mgmt/types/IntegrationRelease.java | 215 + .../mgmt/types/IntegrationRequiredParam.java | 357 + .../types/IntegrationRequiredParamOption.java | 130 + .../IntegrationRequiredParamTypeEnum.java | 86 + .../client/mgmt/types/IntegrationSemVer.java | 130 + .../client/mgmt/types/JobFileFormatEnum.java | 83 + ...ctionBindingsPaginatedResponseContent.java | 195 + .../ListActionTriggersResponseContent.java | 97 + ...ctionVersionsPaginatedResponseContent.java | 189 + .../ListActionsPaginatedResponseContent.java | 195 + .../types/ListActionsRequestParameters.java | 428 + ...stAculsOffsetPaginatedResponseContent.java | 189 + ...BrandingPhoneProvidersResponseContent.java | 98 + .../ListClientConnectionsResponseContent.java | 137 + ...OrganizationsPaginatedResponseContent.java | 128 + ...stClientGrantPaginatedResponseContent.java | 128 + .../ListClientGrantsRequestParameters.java | 368 + ...ClientsOffsetPaginatedResponseContent.java | 171 + .../types/ListClientsRequestParameters.java | 617 + ...onsCheckpointPaginatedResponseContent.java | 128 + .../types/ListConnectionsQueryParameters.java | 426 + ...entialsOffsetPaginatedResponseContent.java | 172 + ...istDeviceCredentialsRequestParameters.java | 548 + ...tionKeyOffsetPaginatedResponseContent.java | 195 + .../ListEventStreamsRequestParameters.java | 184 + ...lowExecutionsPaginatedResponseContent.java | 128 + ...stFlowsOffsetPaginatedResponseContent.java | 171 + ...stFormsOffsetPaginatedResponseContent.java | 171 + .../types/ListFormsRequestParameters.java | 296 + ...stHooksOffsetPaginatedResponseContent.java | 171 + .../types/ListHooksRequestParameters.java | 419 + ...ListLogOffsetPaginatedResponseContent.java | 195 + .../mgmt/types/ListLogsRequestParameters.java | 480 + ...orkAclsOffsetPaginatedResponseContent.java | 172 + .../ListNetworkAclsRequestParameters.java | 236 + ...tGrantsOffsetPaginatedResponseContent.java | 172 + ...ectionsOffsetPaginatedResponseContent.java | 172 + ...tationsOffsetPaginatedResponseContent.java | 146 + ...erRolesOffsetPaginatedResponseContent.java | 172 + ...zationMembersPaginatedResponseContent.java | 122 + ...OrganizationsPaginatedResponseContent.java | 122 + .../ListOrganizationsRequestParameters.java | 246 + .../ListPhoneTemplatesResponseContent.java | 97 + ...RefreshTokensPaginatedResponseContent.java | 128 + ...eServerOffsetPaginatedResponseContent.java | 172 + .../ListResourceServerRequestParameters.java | 358 + ...issionsOffsetPaginatedResponseContent.java | 172 + ...ListRoleUsersPaginatedResponseContent.java | 120 + ...stRolesOffsetPaginatedResponseContent.java | 171 + .../types/ListRolesRequestParameters.java | 298 + ...stRulesOffsetPaginatedResponseContent.java | 171 + .../types/ListRulesRequestParameters.java | 419 + ...rviceProfilesPaginatedResponseContent.java | 172 + ...tSelfServiceProfilesRequestParameters.java | 237 + ...stTokenExchangeProfileResponseContent.java | 129 + ...MethodsOffsetPaginatedResponseContent.java | 196 + ...erBlocksByIdentifierRequestParameters.java | 218 + ...UserBlocksByIdentifierResponseContent.java | 104 + .../ListUserBlocksRequestParameters.java | 138 + .../types/ListUserBlocksResponseContent.java | 103 + ...rGrantsOffsetPaginatedResponseContent.java | 171 + .../ListUserGrantsRequestParameters.java | 419 + ...zationsOffsetPaginatedResponseContent.java | 172 + ...issionsOffsetPaginatedResponseContent.java | 172 + ...erRolesOffsetPaginatedResponseContent.java | 171 + ...tUserSessionsPaginatedResponseContent.java | 128 + .../ListUsersByEmailRequestParameters.java | 292 + ...stUsersOffsetPaginatedResponseContent.java | 196 + .../types/ListUsersRequestParameters.java | 679 + ...tialTemplatesPaginatedResponseContent.java | 128 + .../java/com/auth0/client/mgmt/types/Log.java | 755 + .../com/auth0/client/mgmt/types/LogDate.java | 97 + .../client/mgmt/types/LogLocationInfo.java | 330 + .../client/mgmt/types/LogSecurityContext.java | 129 + .../types/LogStreamDatadogRegionEnum.java | 104 + .../types/LogStreamDatadogResponseSchema.java | 292 + .../mgmt/types/LogStreamDatadogSink.java | 136 + .../LogStreamEventBridgeResponseSchema.java | 293 + .../mgmt/types/LogStreamEventBridgeSink.java | 184 + .../LogStreamEventBridgeSinkRegionEnum.java | 295 + .../types/LogStreamEventGridRegionEnum.java | 435 + .../LogStreamEventGridResponseSchema.java | 292 + .../mgmt/types/LogStreamEventGridSink.java | 223 + .../client/mgmt/types/LogStreamFilter.java | 120 + .../types/LogStreamFilterGroupNameEnum.java | 283 + .../types/LogStreamHttpContentFormatEnum.java | 97 + .../types/LogStreamHttpResponseSchema.java | 292 + .../client/mgmt/types/LogStreamHttpSink.java | 288 + .../types/LogStreamMixpanelRegionEnum.java | 84 + .../LogStreamMixpanelResponseSchema.java | 292 + .../mgmt/types/LogStreamMixpanelSink.java | 227 + .../types/LogStreamMixpanelSinkPatch.java | 230 + .../client/mgmt/types/LogStreamPiiConfig.java | 155 + .../mgmt/types/LogStreamPiiLogFieldsEnum.java | 126 + .../mgmt/types/LogStreamPiiMethodEnum.java | 84 + .../mgmt/types/LogStreamResponseSchema.java | 167 + .../types/LogStreamSegmentResponseSchema.java | 292 + .../mgmt/types/LogStreamSegmentSink.java | 101 + .../types/LogStreamSegmentSinkWriteKey.java | 113 + .../client/mgmt/types/LogStreamSinkPatch.java | 143 + .../types/LogStreamSplunkResponseSchema.java | 292 + .../mgmt/types/LogStreamSplunkSink.java | 221 + .../mgmt/types/LogStreamStatusEnum.java | 93 + .../types/LogStreamSumoResponseSchema.java | 292 + .../client/mgmt/types/LogStreamSumoSink.java | 113 + .../mgmt/types/MdlPresentationProperties.java | 746 + .../mgmt/types/MdlPresentationRequest.java | 103 + .../MdlPresentationRequestProperties.java | 103 + .../client/mgmt/types/MfaPolicyEnum.java | 83 + .../client/mgmt/types/NativeSocialLogin.java | 143 + .../mgmt/types/NativeSocialLoginApple.java | 101 + .../mgmt/types/NativeSocialLoginFacebook.java | 101 + .../mgmt/types/NativeSocialLoginGoogle.java | 101 + .../client/mgmt/types/NetworkAclAction.java | 199 + .../client/mgmt/types/NetworkAclMatch.java | 283 + .../client/mgmt/types/NetworkAclRule.java | 190 + .../mgmt/types/NetworkAclRuleScopeEnum.java | 96 + .../types/NetworkAclsResponseContent.java | 255 + .../auth0/client/mgmt/types/OauthScope.java | 2607 ++ .../auth0/client/mgmt/types/Organization.java | 235 + .../types/OrganizationAccessLevelEnum.java | 105 + .../mgmt/types/OrganizationBranding.java | 126 + .../types/OrganizationBrandingColors.java | 147 + .../mgmt/types/OrganizationClientGrant.java | 250 + .../mgmt/types/OrganizationConnection.java | 318 + .../OrganizationConnectionInformation.java | 130 + .../types/OrganizationEnabledConnection.java | 228 + .../mgmt/types/OrganizationInvitation.java | 468 + .../types/OrganizationInvitationInvitee.java | 113 + .../types/OrganizationInvitationInviter.java | 113 + .../client/mgmt/types/OrganizationMember.java | 218 + .../mgmt/types/OrganizationMemberRole.java | 130 + .../mgmt/types/OrganizationUsageEnum.java | 94 + .../client/mgmt/types/PartialGroupsEnum.java | 147 + .../types/PartialPhoneTemplateContent.java | 124 + .../PatchClientCredentialResponseContent.java | 384 + ...tchSupplementalSignalsResponseContent.java | 103 + .../mgmt/types/PermissionRequestPayload.java | 149 + .../types/PermissionsResponsePayload.java | 195 + .../client/mgmt/types/PhoneAttribute.java | 151 + .../types/PhoneProviderConfiguration.java | 95 + .../mgmt/types/PhoneProviderCredentials.java | 95 + .../PhoneProviderDeliveryMethodEnum.java | 85 + .../mgmt/types/PhoneProviderNameEnum.java | 84 + .../mgmt/types/PhoneProviderSchemaMasked.java | 378 + .../client/mgmt/types/PhoneTemplate.java | 280 + .../client/mgmt/types/PhoneTemplateBody.java | 129 + .../mgmt/types/PhoneTemplateContent.java | 149 + .../PhoneTemplateNotificationTypeEnum.java | 119 + .../PostClientCredentialResponseContent.java | 384 + .../PreferredAuthenticationMethodEnum.java | 85 + .../client/mgmt/types/PrivateKeyJwt.java | 106 + .../mgmt/types/PromptGroupNameEnum.java | 427 + .../client/mgmt/types/PromptLanguageEnum.java | 873 + .../mgmt/types/PublicKeyCredential.java | 303 + .../PublicKeyCredentialAlgorithmEnum.java | 97 + .../client/mgmt/types/RefreshTokenDate.java | 98 + .../client/mgmt/types/RefreshTokenDevice.java | 255 + .../types/RefreshTokenExpirationTypeEnum.java | 86 + .../types/RefreshTokenResourceServer.java | 130 + .../types/RefreshTokenResponseContent.java | 424 + .../types/RefreshTokenRotationTypeEnum.java | 86 + ...erateUsersRecoveryCodeResponseContent.java | 103 + .../ResetPhoneTemplateResponseContent.java | 281 + .../client/mgmt/types/ResourceServer.java | 681 + .../ResourceServerProofOfPossession.java | 138 + ...eServerProofOfPossessionMechanismEnum.java | 86 + .../mgmt/types/ResourceServerScope.java | 156 + ...esourceServerTokenDialectResponseEnum.java | 108 + .../ResourceServerTokenDialectSchemaEnum.java | 108 + .../types/ResourceServerTokenEncryption.java | 125 + ...rceServerTokenEncryptionAlgorithmEnum.java | 97 + .../ResourceServerTokenEncryptionKey.java | 224 + .../types/RevokeUserAccessRequestContent.java | 132 + .../RevokedSigningKeysResponseContent.java | 146 + .../com/auth0/client/mgmt/types/Role.java | 161 + .../com/auth0/client/mgmt/types/RoleUser.java | 193 + .../RotateClientSecretResponseContent.java | 1663 + .../RotateConnectionKeysRequestContent.java | 97 + .../RotateConnectionKeysSigningAlgEnum.java | 108 + .../RotateConnectionsKeysResponseContent.java | 422 + .../RotateSigningKeysResponseContent.java | 146 + .../com/auth0/client/mgmt/types/Rule.java | 253 + .../auth0/client/mgmt/types/RulesConfig.java | 101 + .../client/mgmt/types/ScimMappingItem.java | 129 + .../client/mgmt/types/ScimTokenItem.java | 224 + .../mgmt/types/ScreenGroupNameEnum.java | 978 + .../mgmt/types/SearchEngineVersionsEnum.java | 94 + .../client/mgmt/types/SelfServiceProfile.java | 326 + ...SelfServiceProfileAllowedStrategyEnum.java | 152 + .../SelfServiceProfileBrandingColors.java | 102 + .../SelfServiceProfileBrandingProperties.java | 121 + ...rviceProfileSsoTicketConnectionConfig.java | 349 + ...viceProfileSsoTicketConnectionOptions.java | 226 + ...ceProfileSsoTicketDomainAliasesConfig.java | 106 + ...rofileSsoTicketDomainVerificationEnum.java | 97 + ...ceProfileSsoTicketEnabledOrganization.java | 205 + ...oTicketIdpInitiatedClientProtocolEnum.java | 98 + ...ceProfileSsoTicketIdpInitiatedOptions.java | 190 + ...iceProfileSsoTicketProvisioningConfig.java | 178 + ...ProfileSsoTicketProvisioningScopeEnum.java | 119 + .../SelfServiceProfileUserAttribute.java | 180 + .../types/SessionAuthenticationSignal.java | 155 + .../types/SessionAuthenticationSignals.java | 103 + .../mgmt/types/SessionClientMetadata.java | 101 + .../mgmt/types/SessionCookieMetadata.java | 96 + .../types/SessionCookieMetadataModeEnum.java | 86 + .../mgmt/types/SessionCookieModeEnum.java | 85 + .../mgmt/types/SessionCookieSchema.java | 102 + .../auth0/client/mgmt/types/SessionDate.java | 98 + .../mgmt/types/SessionDeviceMetadata.java | 306 + .../mgmt/types/SessionResponseContent.java | 405 + .../SetCustomSigningKeysResponseContent.java | 104 + .../types/SetEmailTemplateRequestContent.java | 780 + .../SetEmailTemplateResponseContent.java | 780 + ...rdianFactorDuoSettingsResponseContent.java | 144 + ...actorPhoneMessageTypesResponseContent.java | 105 + ...anFactorPhoneTemplatesResponseContent.java | 151 + .../SetGuardianFactorResponseContent.java | 112 + ...dianFactorSmsTemplatesResponseContent.java | 151 + ...anFactorsProviderPhoneResponseContent.java | 97 + ...orsProviderPhoneTwilioResponseContent.java | 318 + ...derPushNotificationApnsRequestContent.java | 208 + ...erPushNotificationApnsResponseContent.java | 153 + ...iderPushNotificationFcmRequestContent.java | 130 + ...erPushNotificationFcmv1RequestContent.java | 131 + ...oviderPushNotificationResponseContent.java | 98 + ...derPushNotificationSnsResponseContent.java | 360 + ...dianFactorsProviderSmsResponseContent.java | 97 + ...ctorsProviderSmsTwilioResponseContent.java | 318 + .../types/SetNetworkAclRequestContent.java | 198 + .../types/SetNetworkAclsResponseContent.java | 255 + .../types/SetRulesConfigRequestContent.java | 113 + .../types/SetRulesConfigResponseContent.java | 146 + ...erAuthenticationMethodResponseContent.java | 585 + .../types/SetUserAuthenticationMethods.java | 318 + .../mgmt/types/SigningAlgorithmEnum.java | 103 + .../auth0/client/mgmt/types/SigningKeys.java | 552 + .../client/mgmt/types/SigningKeysDate.java | 97 + .../auth0/client/mgmt/types/SignupSchema.java | 95 + .../client/mgmt/types/SignupStatusEnum.java | 93 + .../client/mgmt/types/SignupVerification.java | 95 + .../client/mgmt/types/SignupVerified.java | 120 + .../client/mgmt/types/SupportedLocales.java | 873 + .../SuspiciousIpThrottlingPreLoginStage.java | 131 + ...sIpThrottlingPreUserRegistrationStage.java | 131 + .../SuspiciousIpThrottlingShieldsEnum.java | 86 + .../types/SuspiciousIpThrottlingStage.java | 121 + .../mgmt/types/TenantOidcLogoutSettings.java | 102 + .../mgmt/types/TenantSettingsDeviceFlow.java | 126 + .../TenantSettingsDeviceFlowCharset.java | 86 + .../mgmt/types/TenantSettingsErrorPage.java | 161 + .../mgmt/types/TenantSettingsFlags.java | 1010 + .../types/TenantSettingsGuardianPage.java | 130 + .../client/mgmt/types/TenantSettingsMtls.java | 101 + .../types/TenantSettingsPasswordPage.java | 130 + .../mgmt/types/TenantSettingsSessions.java | 102 + .../mgmt/types/TestActionRequestContent.java | 105 + .../mgmt/types/TestActionResponseContent.java | 95 + .../TestCustomDomainResponseContent.java | 156 + .../TokenExchangeProfileResponseContent.java | 281 + .../TokenExchangeProfilesListRequest.java | 184 + .../auth0/client/mgmt/types/TokenQuota.java | 102 + .../types/TokenQuotaClientCredentials.java | 161 + .../mgmt/types/TokenQuotaConfiguration.java | 103 + .../types/TwilioProviderConfiguration.java | 211 + .../mgmt/types/TwilioProviderCredentials.java | 102 + .../TwilioProviderDeliveryMethodEnum.java | 86 + .../types/UniversalLoginExperienceEnum.java | 85 + .../UpdateActionBindingsResponseContent.java | 98 + .../types/UpdateActionRequestContent.java | 256 + .../types/UpdateActionResponseContent.java | 570 + .../mgmt/types/UpdateAculResponseContent.java | 348 + .../mgmt/types/UpdateBrandingColors.java | 159 + .../client/mgmt/types/UpdateBrandingFont.java | 134 + .../types/UpdateBrandingPageBackground.java | 103 + ...eBrandingPhoneProviderResponseContent.java | 379 + .../types/UpdateBrandingRequestContent.java | 304 + .../types/UpdateBrandingResponseContent.java | 181 + .../UpdateBrandingThemeResponseContent.java | 287 + ...swordDetectionSettingsResponseContent.java | 221 + ...dateBruteForceSettingsResponseContent.java | 230 + ...BruteForceSettingsResponseContentMode.java | 87 + ...rceSettingsResponseContentShieldsItem.java | 86 + .../UpdateClientGrantRequestContent.java | 225 + .../UpdateClientGrantResponseContent.java | 293 + .../types/UpdateClientRequestContent.java | 1742 ++ .../types/UpdateClientResponseContent.java | 1663 + .../mgmt/types/UpdateConnectionOptions.java | 1120 + .../types/UpdateConnectionRequestContent.java | 320 + .../UpdateConnectionResponseContent.java | 383 + .../UpdateCustomDomainRequestContent.java | 145 + .../UpdateCustomDomainResponseContent.java | 384 + .../UpdateEmailProviderResponseContent.java | 213 + .../UpdateEmailTemplateRequestContent.java | 569 + .../UpdateEmailTemplateResponseContent.java | 570 + ...edClientConnectionsRequestContentItem.java | 148 + .../UpdateEventStreamRequestContent.java | 182 + .../UpdateEventStreamResponseContent.java | 108 + .../mgmt/types/UpdateFlowRequestContent.java | 119 + .../mgmt/types/UpdateFlowResponseContent.java | 241 + .../mgmt/types/UpdateFormRequestContent.java | 425 + .../mgmt/types/UpdateFormResponseContent.java | 477 + ...rdianFactorDuoSettingsResponseContent.java | 144 + ...derPushNotificationSnsResponseContent.java | 360 + .../mgmt/types/UpdateHookRequestContent.java | 187 + .../mgmt/types/UpdateHookResponseContent.java | 248 + .../types/UpdateLogStreamRequestContent.java | 237 + .../types/UpdateLogStreamResponseContent.java | 168 + .../types/UpdateNetworkAclRequestContent.java | 181 + .../UpdateNetworkAclResponseContent.java | 255 + ...OrganizationConnectionResponseContent.java | 229 + .../UpdateOrganizationRequestContent.java | 239 + .../UpdateOrganizationResponseContent.java | 236 + .../UpdatePhoneTemplateResponseContent.java | 282 + .../UpdateResourceServerRequestContent.java | 554 + .../UpdateResourceServerResponseContent.java | 682 + .../mgmt/types/UpdateRoleRequestContent.java | 130 + .../mgmt/types/UpdateRoleResponseContent.java | 161 + .../mgmt/types/UpdateRuleRequestContent.java | 193 + .../mgmt/types/UpdateRuleResponseContent.java | 253 + ...pdateScimConfigurationResponseContent.java | 332 + ...pdateSelfServiceProfileRequestContent.java | 294 + ...dateSelfServiceProfileResponseContent.java | 327 + .../types/UpdateSettingsRequestContent.java | 222 + .../types/UpdateSettingsResponseContent.java | 158 + ...dateSupplementalSignalsRequestContent.java | 113 + ...usIpThrottlingSettingsResponseContent.java | 186 + .../UpdateTenantSettingsResponseContent.java | 1290 + ...ateTokenExchangeProfileRequestContent.java | 131 + .../client/mgmt/types/UpdateTokenQuota.java | 102 + ...eUniversalLoginTemplateRequestContent.java | 99 + ...alLoginTemplateRequestContentTemplate.java | 104 + ...erAuthenticationMethodResponseContent.java | 585 + .../mgmt/types/UpdateUserRequestContent.java | 911 + .../mgmt/types/UpdateUserResponseContent.java | 717 + ...ableCredentialTemplateResponseContent.java | 358 + .../mgmt/types/UserAuthenticationMethod.java | 838 + .../UserAuthenticationMethodProperties.java | 121 + ...serAuthenticationMethodPropertiesEnum.java | 108 + .../mgmt/types/UserBlockIdentifier.java | 161 + .../client/mgmt/types/UserDateSchema.java | 97 + .../types/UserEnrollmentAuthMethodEnum.java | 118 + .../mgmt/types/UserEnrollmentStatusEnum.java | 84 + .../auth0/client/mgmt/types/UserGrant.java | 224 + .../auth0/client/mgmt/types/UserIdEnum.java | 94 + .../auth0/client/mgmt/types/UserIdentity.java | 395 + .../mgmt/types/UserIdentityProviderEnum.java | 699 + .../client/mgmt/types/UserIdentitySchema.java | 318 + ...ListLogOffsetPaginatedResponseContent.java | 196 + .../types/UserMultifactorProviderEnum.java | 85 + .../mgmt/types/UserPermissionSchema.java | 195 + .../client/mgmt/types/UserProfileData.java | 330 + .../client/mgmt/types/UserResponseSchema.java | 717 + .../mgmt/types/UsernameAllowedTypes.java | 118 + .../client/mgmt/types/UsernameAttribute.java | 175 + .../client/mgmt/types/UsernameValidation.java | 157 + .../client/mgmt/types/UsersEnrollment.java | 351 + .../VerifiableCredentialTemplateResponse.java | 358 + .../mgmt/types/VerificationMethodEnum.java | 84 + .../VerifyCustomDomainResponseContent.java | 480 + .../VerifyEmailTicketRequestContent.java | 377 + .../VerifyEmailTicketResponseContent.java | 113 + .../AsyncAuthenticationMethodsClient.java | 162 + .../mgmt/users/AsyncAuthenticatorsClient.java | 40 + .../mgmt/users/AsyncEnrollmentsClient.java | 42 + ...ncFederatedConnectionsTokensetsClient.java | 50 + .../mgmt/users/AsyncIdentitiesClient.java | 146 + .../client/mgmt/users/AsyncLogsClient.java | 60 + .../mgmt/users/AsyncMultifactorClient.java | 56 + .../mgmt/users/AsyncOrganizationsClient.java | 52 + .../mgmt/users/AsyncPermissionsClient.java | 84 + .../AsyncRawAuthenticationMethodsClient.java | 751 + .../users/AsyncRawAuthenticatorsClient.java | 115 + .../mgmt/users/AsyncRawEnrollmentsClient.java | 128 + ...awFederatedConnectionsTokensetsClient.java | 200 + .../mgmt/users/AsyncRawIdentitiesClient.java | 315 + .../client/mgmt/users/AsyncRawLogsClient.java | 164 + .../mgmt/users/AsyncRawMultifactorClient.java | 203 + .../users/AsyncRawOrganizationsClient.java | 152 + .../mgmt/users/AsyncRawPermissionsClient.java | 348 + .../users/AsyncRawRefreshTokenClient.java | 242 + .../mgmt/users/AsyncRawRolesClient.java | 334 + .../mgmt/users/AsyncRawSessionsClient.java | 242 + .../mgmt/users/AsyncRefreshTokenClient.java | 66 + .../client/mgmt/users/AsyncRolesClient.java | 90 + .../mgmt/users/AsyncSessionsClient.java | 66 + .../users/AuthenticationMethodsClient.java | 159 + .../mgmt/users/AuthenticatorsClient.java | 39 + .../client/mgmt/users/EnrollmentsClient.java | 41 + .../FederatedConnectionsTokensetsClient.java | 49 + .../client/mgmt/users/IdentitiesClient.java | 144 + .../auth0/client/mgmt/users/LogsClient.java | 59 + .../client/mgmt/users/MultifactorClient.java | 54 + .../mgmt/users/OrganizationsClient.java | 50 + .../client/mgmt/users/PermissionsClient.java | 80 + .../users/RawAuthenticationMethodsClient.java | 572 + .../mgmt/users/RawAuthenticatorsClient.java | 90 + .../mgmt/users/RawEnrollmentsClient.java | 100 + ...awFederatedConnectionsTokensetsClient.java | 151 + .../mgmt/users/RawIdentitiesClient.java | 265 + .../client/mgmt/users/RawLogsClient.java | 130 + .../mgmt/users/RawMultifactorClient.java | 155 + .../mgmt/users/RawOrganizationsClient.java | 118 + .../mgmt/users/RawPermissionsClient.java | 266 + .../mgmt/users/RawRefreshTokenClient.java | 185 + .../client/mgmt/users/RawRolesClient.java | 261 + .../client/mgmt/users/RawSessionsClient.java | 185 + .../client/mgmt/users/RefreshTokenClient.java | 65 + .../auth0/client/mgmt/users/RolesClient.java | 87 + .../client/mgmt/users/SessionsClient.java | 64 + .../types/AssignUserRolesRequestContent.java | 112 + ...serAuthenticationMethodRequestContent.java | 462 + .../CreateUserPermissionsRequestContent.java | 115 + .../DeleteUserPermissionsRequestContent.java | 115 + .../types/DeleteUserRolesRequestContent.java | 112 + .../types/LinkUserIdentityRequestContent.java | 183 + .../ListRefreshTokensRequestParameters.java | 185 + ...uthenticationMethodsRequestParameters.java | 238 + .../types/ListUserLogsRequestParameters.java | 298 + ...istUserOrganizationsRequestParameters.java | 237 + .../ListUserPermissionsRequestParameters.java | 237 + .../types/ListUserRolesRequestParameters.java | 236 + .../ListUserSessionsRequestParameters.java | 184 + ...serAuthenticationMethodRequestContent.java | 130 + .../AsyncVerifiableCredentialsClient.java | 24 + .../VerifiableCredentialsClient.java | 24 + .../verification/AsyncRawTemplatesClient.java | 538 + .../verification/AsyncTemplatesClient.java | 125 + .../verification/AsyncVerificationClient.java | 23 + .../verification/RawTemplatesClient.java | 409 + .../verification/TemplatesClient.java | 123 + .../verification/VerificationClient.java | 23 + ...iableCredentialTemplateRequestContent.java | 254 + ...eCredentialTemplatesRequestParameters.java | 185 + ...iableCredentialTemplateRequestContent.java | 221 + .../com/auth0/exception/APIException.java | 9 +- .../PasswordStrengthErrorParser.java | 3 +- .../exception/PublicKeyProviderException.java | 2 - .../auth0/exception/RateLimitException.java | 6 +- .../auth/BackChannelAuthorizeResponse.java | 7 +- .../json/auth/BackChannelTokenResponse.java | 3 + .../auth0/json/auth/CreatedOobResponse.java | 1 - .../auth0/json/auth/CreatedOtpResponse.java | 2 - .../java/com/auth0/json/auth/CreatedUser.java | 4 + .../json/auth/PasswordlessEmailResponse.java | 2 + .../json/auth/PasswordlessSmsResponse.java | 3 + .../auth/PushedAuthorizationResponse.java | 4 +- .../java/com/auth0/json/auth/TokenHolder.java | 11 +- .../json/auth/TokenHolderDeserializer.java | 12 +- .../java/com/auth0/json/auth/UserInfo.java | 1 - src/main/java/com/auth0/json/mgmt/Page.java | 105 - .../com/auth0/json/mgmt/PageDeserializer.java | 87 - .../com/auth0/json/mgmt/actions/Action.java | 192 - .../auth0/json/mgmt/actions/ActionsPage.java | 30 - .../mgmt/actions/ActionsPageDeserializer.java | 25 - .../com/auth0/json/mgmt/actions/Binding.java | 73 - .../mgmt/actions/BindingActionReference.java | 51 - .../json/mgmt/actions/BindingUpdate.java | 54 - .../auth0/json/mgmt/actions/BindingsPage.java | 30 - .../actions/BindingsPageDeserializer.java | 25 - .../mgmt/actions/BindingsUpdateRequest.java | 37 - .../auth0/json/mgmt/actions/Dependency.java | 84 - .../com/auth0/json/mgmt/actions/Error.java | 44 - .../auth0/json/mgmt/actions/Execution.java | 75 - .../json/mgmt/actions/ExecutionResult.java | 57 - .../com/auth0/json/mgmt/actions/Secret.java | 78 - .../json/mgmt/actions/ServiceStatus.java | 24 - .../com/auth0/json/mgmt/actions/Trigger.java | 106 - .../com/auth0/json/mgmt/actions/Triggers.java | 27 - .../com/auth0/json/mgmt/actions/Version.java | 140 - .../auth0/json/mgmt/actions/VersionsPage.java | 31 - .../actions/VersionsPageDeserializer.java | 25 - .../attackprotection/BreachedPassword.java | 104 - .../BreachedPasswordStage.java | 34 - .../BreachedPasswordStageEntry.java | 36 - .../BruteForceConfiguration.java | 103 - .../json/mgmt/attackprotection/Stage.java | 52 - .../mgmt/attackprotection/StageEntry.java | 51 - .../SuspiciousIPThrottlingConfiguration.java | 86 - .../com/auth0/json/mgmt/blacklists/Token.java | 65 - .../json/mgmt/branding/BrandingColors.java | 50 - .../json/mgmt/branding/BrandingFont.java | 30 - .../json/mgmt/branding/BrandingSettings.java | 90 - .../mgmt/branding/UniversalLoginTemplate.java | 30 - .../UniversalLoginTemplateUpdate.java | 30 - .../com/auth0/json/mgmt/client/Addon.java | 35 - .../com/auth0/json/mgmt/client/Addons.java | 84 - .../com/auth0/json/mgmt/client/Android.java | 66 - .../com/auth0/json/mgmt/client/Client.java | 963 - .../client/ClientAuthenticationMethods.java | 71 - .../client/ClientDefaultOrganization.java | 57 - .../auth0/json/mgmt/client/ClientsPage.java | 27 - .../mgmt/client/ClientsPageDeserializer.java | 32 - .../auth0/json/mgmt/client/Credential.java | 208 - .../auth0/json/mgmt/client/EncryptionKey.java | 55 - .../java/com/auth0/json/mgmt/client/IOS.java | 63 - .../json/mgmt/client/JWTConfiguration.java | 99 - .../com/auth0/json/mgmt/client/Mobile.java | 63 - .../mgmt/client/OIDCBackchannelLogout.java | 36 - .../auth0/json/mgmt/client/PrivateKeyJwt.java | 38 - .../auth0/json/mgmt/client/RefreshToken.java | 176 - .../mgmt/client/SelfSignedTLSClientAuth.java | 34 - .../auth0/json/mgmt/client/SignedRequest.java | 44 - .../auth0/json/mgmt/client/SigningKey.java | 86 - .../auth0/json/mgmt/client/TLSClientAuth.java | 32 - .../json/mgmt/clientgrants/ClientGrant.java | 127 - .../mgmt/clientgrants/ClientGrantsPage.java | 27 - .../ClientGrantsPageDeserializer.java | 32 - .../auth0/json/mgmt/connections/Clients.java | 36 - .../json/mgmt/connections/Connection.java | 232 - .../json/mgmt/connections/ConnectionKeys.java | 218 - .../mgmt/connections/ConnectionsPage.java | 31 - .../ConnectionsPageDeserializer.java | 37 - .../DefaultScimMappingResponse.java | 47 - .../connections/EnabledClientRequest.java | 44 - .../connections/EnabledClientResponse.java | 52 - .../auth0/json/mgmt/connections/Mapping.java | 66 - .../json/mgmt/connections/RotateKey.java | 46 - .../connections/ScimConfigurationRequest.java | 65 - .../ScimConfigurationResponse.java | 156 - .../connections/ScimTokenBaseResponse.java | 84 - .../connections/ScimTokenCreateResponse.java | 28 - .../mgmt/connections/ScimTokenRequest.java | 48 - .../mgmt/connections/ScimTokenResponse.java | 28 - .../devicecredentials/DeviceCredentials.java | 160 - .../mgmt/emailproviders/EmailProvider.java | 133 - .../EmailProviderCredentials.java | 126 - .../mgmt/emailtemplates/EmailTemplate.java | 198 - .../com/auth0/json/mgmt/grants/Grant.java | 117 - .../auth0/json/mgmt/grants/GrantsPage.java | 27 - .../mgmt/grants/GrantsPageDeserializer.java | 32 - .../auth0/json/mgmt/guardian/Enrollment.java | 130 - .../json/mgmt/guardian/EnrollmentTicket.java | 116 - .../com/auth0/json/mgmt/guardian/Factor.java | 67 - .../json/mgmt/guardian/GuardianTemplates.java | 66 - .../json/mgmt/guardian/SNSFactorProvider.java | 96 - .../mgmt/guardian/TwilioFactorProvider.java | 89 - .../java/com/auth0/json/mgmt/jobs/Job.java | 148 - .../com/auth0/json/mgmt/jobs/JobError.java | 36 - .../auth0/json/mgmt/jobs/JobErrorDetails.java | 39 - .../com/auth0/json/mgmt/jobs/JobSummary.java | 52 - .../json/mgmt/jobs/UsersExportField.java | 39 - .../auth0/json/mgmt/keys/EncryptionKey.java | 136 - .../json/mgmt/keys/EncryptionKeysPage.java | 24 - .../keys/EncryptionKeysPageDeserializer.java | 23 - .../keys/EncryptionWrappingKeyResponse.java | 46 - .../java/com/auth0/json/mgmt/keys/Key.java | 175 - .../auth0/json/mgmt/logevents/LogEvent.java | 291 - .../json/mgmt/logevents/LogEventsPage.java | 27 - .../logevents/LogEventsPageDeserializer.java | 31 - .../auth0/json/mgmt/logstreams/LogStream.java | 144 - .../json/mgmt/logstreams/LogStreamFilter.java | 61 - .../auth0/json/mgmt/networkacls/Action.java | 108 - .../auth0/json/mgmt/networkacls/Match.java | 155 - .../json/mgmt/networkacls/NetworkAcls.java | 114 - .../mgmt/networkacls/NetworkAclsPage.java | 22 - .../NetworkAclsPageDeserializer.java | 21 - .../com/auth0/json/mgmt/networkacls/Rule.java | 84 - .../json/mgmt/organizations/Branding.java | 51 - .../auth0/json/mgmt/organizations/Colors.java | 64 - .../json/mgmt/organizations/Connection.java | 51 - .../ConnectionsPageDeserializer.java | 24 - ...ateOrganizationClientGrantRequestBody.java | 28 - .../mgmt/organizations/EnabledConnection.java | 117 - .../organizations/EnabledConnectionsPage.java | 27 - .../json/mgmt/organizations/Invitation.java | 226 - .../mgmt/organizations/InvitationsPage.java | 27 - .../InvitationsPageDeserializer.java | 25 - .../json/mgmt/organizations/Invitee.java | 34 - .../json/mgmt/organizations/Inviter.java | 34 - .../auth0/json/mgmt/organizations/Member.java | 87 - .../json/mgmt/organizations/Members.java | 38 - .../json/mgmt/organizations/MembersPage.java | 34 - .../MembersPageDeserializer.java | 31 - .../json/mgmt/organizations/Organization.java | 154 - .../OrganizationClientGrant.java | 95 - .../OrganizationClientGrantsPage.java | 27 - ...anizationClientGrantsPageDeserializer.java | 25 - .../mgmt/organizations/OrganizationsPage.java | 34 - .../OrganizationsPageDeserializer.java | 31 - .../auth0/json/mgmt/organizations/Roles.java | 36 - .../json/mgmt/permissions/Permission.java | 122 - .../mgmt/permissions/PermissionSource.java | 54 - .../mgmt/permissions/PermissionsPage.java | 23 - .../PermissionsPageDeserializer.java | 32 - .../com/auth0/json/mgmt/prompts/Prompt.java | 64 - .../auth0/json/mgmt/refreshtokens/Device.java | 64 - .../json/mgmt/refreshtokens/RefreshToken.java | 115 - .../mgmt/refreshtokens/RefreshTokensPage.java | 44 - .../mgmt/refreshtokens/ResourceServer.java | 30 - .../resourceserver/AuthorizationDetails.java | 33 - .../mgmt/resourceserver/EncryptionKey.java | 99 - .../resourceserver/ProofOfPossession.java | 54 - .../mgmt/resourceserver/ResourceServer.java | 248 - .../resourceserver/ResourceServersPage.java | 27 - .../ResourceServersPageDeserializer.java | 32 - .../auth0/json/mgmt/resourceserver/Scope.java | 41 - .../mgmt/resourceserver/TokenEncryption.java | 43 - .../java/com/auth0/json/mgmt/roles/Role.java | 72 - .../com/auth0/json/mgmt/roles/RolesPage.java | 23 - .../mgmt/roles/RolesPageDeserializer.java | 32 - .../java/com/auth0/json/mgmt/rules/Rule.java | 133 - .../auth0/json/mgmt/rules/RulesConfig.java | 56 - .../com/auth0/json/mgmt/rules/RulesPage.java | 27 - .../mgmt/rules/RulesPageDeserializer.java | 32 - .../mgmt/selfserviceprofiles/Branding.java | 46 - .../json/mgmt/selfserviceprofiles/Color.java | 43 - .../DomainAliasesConfig.java | 29 - .../EnabledOrganizations.java | 64 - .../ProvisioningConfig.java | 53 - .../SelfServiceProfile.java | 121 - .../SelfServiceProfileResponse.java | 64 - .../SelfServiceProfileResponsePage.java | 21 - ...erviceProfileResponsePageDeserializer.java | 23 - .../SsoAccessTicketRequest.java | 139 - .../SsoAccessTicketResponse.java | 41 - .../selfserviceprofiles/UserAttribute.java | 83 - .../json/mgmt/sessions/Authentication.java | 21 - .../mgmt/sessions/AuthenticationMethod.java | 39 - .../com/auth0/json/mgmt/sessions/Client.java | 19 - .../com/auth0/json/mgmt/sessions/Device.java | 64 - .../com/auth0/json/mgmt/sessions/Session.java | 106 - .../json/mgmt/sessions/SessionsPage.java | 44 - .../com/auth0/json/mgmt/stats/DailyStats.java | 44 - .../com/auth0/json/mgmt/tenants/Clients.java | 35 - .../json/mgmt/tenants/DefaultTokenQuota.java | 59 - .../mgmt/tenants/ErrorPageCustomization.java | 56 - .../com/auth0/json/mgmt/tenants/Mtls.java | 34 - .../json/mgmt/tenants/Organizations.java | 34 - .../json/mgmt/tenants/PageCustomization.java | 57 - .../json/mgmt/tenants/SessionCookie.java | 26 - .../com/auth0/json/mgmt/tenants/Tenant.java | 437 - .../tickets/EmailVerificationIdentity.java | 52 - .../mgmt/tickets/EmailVerificationTicket.java | 123 - .../mgmt/tickets/PasswordChangeTicket.java | 169 - .../mgmt/tokenquota/ClientCredentials.java | 81 - .../json/mgmt/tokenquota/TokenQuota.java | 32 - .../ListUserAttributeProfileTemplate.java | 32 - .../userAttributeProfiles/OidcMapping.java | 34 - .../StrategyOverridesUserAttributes.java | 73 - .../StrategyOverridesUserId.java | 72 - .../UserAttributeProfile.java | 84 - .../UserAttributeProfilePage.java | 26 - .../UserAttributeProfilePageDeserializer.java | 28 - .../UserAttributeProfileTemplate.java | 71 - .../userAttributeProfiles/UserAttributes.java | 174 - .../mgmt/userAttributeProfiles/UserId.java | 93 - .../json/mgmt/userblocks/BlockDetails.java | 26 - .../json/mgmt/userblocks/UserBlocks.java | 29 - .../com/auth0/json/mgmt/users/Identity.java | 71 - .../auth0/json/mgmt/users/ProfileData.java | 85 - .../auth0/json/mgmt/users/RecoveryCode.java | 19 - .../java/com/auth0/json/mgmt/users/User.java | 569 - .../com/auth0/json/mgmt/users/UsersPage.java | 34 - .../mgmt/users/UsersPageDeserializer.java | 37 - .../authenticationmethods/AuthMethod.java | 23 - .../AuthenticationMethod.java | 290 - .../AuthenticationMethodsPage.java | 34 - ...AuthenticationMethodsPageDeserializer.java | 32 - src/main/java/com/auth0/net/BaseRequest.java | 36 +- .../java/com/auth0/net/EmptyBodyRequest.java | 10 +- .../com/auth0/net/EmptyBodyVoidRequest.java | 13 +- .../java/com/auth0/net/FormBodyRequest.java | 20 +- .../java/com/auth0/net/MultipartRequest.java | 22 +- .../com/auth0/net/RateLimitInterceptor.java | 16 +- src/main/java/com/auth0/net/Request.java | 1 - .../java/com/auth0/net/SignUpRequest.java | 4 +- src/main/java/com/auth0/net/Telemetry.java | 6 +- .../com/auth0/net/TelemetryInterceptor.java | 3 +- .../java/com/auth0/net/TokenQuotaBucket.java | 2 - src/main/java/com/auth0/net/TokenRequest.java | 3 +- src/main/java/com/auth0/net/VoidRequest.java | 4 +- .../com/auth0/net/client/Auth0HttpClient.java | 1 - .../auth0/net/client/Auth0HttpRequest.java | 6 +- .../auth0/net/client/Auth0HttpResponse.java | 6 +- .../net/client/Auth0MultipartRequestBody.java | 4 +- .../auth0/net/client/DefaultHttpClient.java | 54 +- .../java/com/auth0/net/client/HttpMethod.java | 8 +- src/main/java/com/auth0/utils/Asserts.java | 4 +- .../auth0/utils/HttpResponseHeadersUtils.java | 10 +- .../utils/tokens/HS256SignatureVerifier.java | 1 - .../auth0/utils/tokens/IdTokenVerifier.java | 53 +- .../auth0/utils/tokens/PublicKeyProvider.java | 1 - .../utils/tokens/RS256SignatureVerifier.java | 4 +- .../auth0/utils/tokens/SignatureVerifier.java | 7 +- src/test/java/com/auth0/AssertsUtil.java | 20 - .../com/auth0/client/HttpOptionsTest.java | 80 - .../java/com/auth0/client/MockServer.java | 312 - .../auth0/client/RecordedRequestMatcher.java | 155 - .../java/com/auth0/client/UrlMatcher.java | 155 - .../com/auth0/client/auth/AuthAPITest.java | 2388 -- .../client/auth/AuthorizeUrlBuilderTest.java | 242 - .../client/auth/LogoutUrlBuilderTest.java | 100 - .../auth/RSAClientAssertionSignerTest.java | 151 - .../auth0/client/mgmt/ActionsEntityTest.java | 535 - .../mgmt/ActionsExecutionsWireTest.java | 121 + .../mgmt/ActionsTriggersBindingsWireTest.java | 181 + .../client/mgmt/ActionsTriggersWireTest.java | 126 + .../client/mgmt/ActionsVersionsWireTest.java | 308 + .../auth0/client/mgmt/ActionsWireTest.java | 844 + .../client/mgmt/AnomalyBlocksWireTest.java | 76 + ...tionBreachedPasswordDetectionWireTest.java | 232 + ...rotectionBruteForceProtectionWireTest.java | 209 + .../mgmt/AttackProtectionEntityTest.java | 241 - ...tectionSuspiciousIpThrottlingWireTest.java | 226 + .../auth0/client/mgmt/BaseMgmtEntityTest.java | 24 - .../client/mgmt/BlacklistsEntityTest.java | 81 - .../auth0/client/mgmt/BrandingEntityTest.java | 133 - .../mgmt/BrandingPhoneProvidersWireTest.java | 499 + .../mgmt/BrandingPhoneTemplatesWireTest.java | 575 + .../mgmt/BrandingTemplatesWireTest.java | 151 + .../client/mgmt/BrandingThemesWireTest.java | 942 + .../auth0/client/mgmt/BrandingWireTest.java | 207 + .../client/mgmt/ClientGrantsEntityTest.java | 348 - .../ClientGrantsOrganizationsWireTest.java | 86 + .../client/mgmt/ClientGrantsWireTest.java | 287 + .../mgmt/ClientsConnectionsWireTest.java | 88 + .../mgmt/ClientsCredentialsWireTest.java | 383 + .../auth0/client/mgmt/ClientsEntityTest.java | 507 - .../auth0/client/mgmt/ClientsWireTest.java | 1596 + .../mgmt/ConnectionsClientsWireTest.java | 132 + .../client/mgmt/ConnectionsEntityTest.java | 717 - .../client/mgmt/ConnectionsKeysWireTest.java | 184 + ...ctionsScimConfigurationTokensWireTest.java | 218 + .../ConnectionsScimConfigurationWireTest.java | 359 + .../client/mgmt/ConnectionsUsersWireTest.java | 74 + .../client/mgmt/ConnectionsWireTest.java | 381 + .../client/mgmt/CustomDomainsWireTest.java | 505 + .../mgmt/DeviceCredentialsEntityTest.java | 179 - .../mgmt/DeviceCredentialsWireTest.java | 185 + .../mgmt/DynamicTokenManagementTest.java | 400 + .../client/mgmt/EmailProviderEntityTest.java | 122 - .../client/mgmt/EmailTemplatesEntityTest.java | 129 - .../client/mgmt/EmailTemplatesWireTest.java | 396 + .../client/mgmt/EmailsProviderWireTest.java | 340 + .../mgmt/EventStreamsDeliveriesWireTest.java | 211 + .../EventStreamsRedeliveriesWireTest.java | 159 + .../client/mgmt/EventStreamsWireTest.java | 628 + .../client/mgmt/FlowsExecutionsWireTest.java | 156 + .../com/auth0/client/mgmt/FlowsWireTest.java | 365 + .../com/auth0/client/mgmt/FormsWireTest.java | 499 + .../auth0/client/mgmt/GrantsEntityTest.java | 155 - .../mgmt/GuardianEnrollmentsWireTest.java | 206 + .../auth0/client/mgmt/GuardianEntityTest.java | 402 - .../GuardianFactorsDuoSettingsWireTest.java | 268 + .../mgmt/GuardianFactorsPhoneWireTest.java | 597 + ...ardianFactorsPushNotificationWireTest.java | 703 + .../mgmt/GuardianFactorsSmsWireTest.java | 471 + .../client/mgmt/GuardianFactorsWireTest.java | 191 + .../client/mgmt/GuardianPoliciesWireTest.java | 176 + .../client/mgmt/HooksSecretsWireTest.java | 226 + .../com/auth0/client/mgmt/HooksWireTest.java | 344 + .../com/auth0/client/mgmt/JobsEntityTest.java | 545 - .../auth0/client/mgmt/JobsErrorsWireTest.java | 113 + .../client/mgmt/JobsUsersExportsWireTest.java | 153 + .../mgmt/JobsVerificationEmailWireTest.java | 144 + .../com/auth0/client/mgmt/JobsWireTest.java | 118 + .../mgmt/KeysCustomSigningWireTest.java | 252 + .../client/mgmt/KeysEncryptionWireTest.java | 396 + .../com/auth0/client/mgmt/KeysEntityTest.java | 265 - .../client/mgmt/KeysSigningWireTest.java | 273 + .../client/mgmt/LogEventsEntityTest.java | 191 - .../client/mgmt/LogStreamsEntityTest.java | 209 - .../auth0/client/mgmt/LogStreamsWireTest.java | 450 + .../com/auth0/client/mgmt/LogsWireTest.java | 173 + .../auth0/client/mgmt/ManagementAPITest.java | 310 - .../client/mgmt/NetworkAclsEntityTest.java | 235 - .../client/mgmt/NetworkAclsWireTest.java | 588 + .../client/mgmt/OAuthTokenSupplierTest.java | 158 + .../client/mgmt/OrganizationEntityTest.java | 1321 - .../OrganizationsClientGrantsWireTest.java | 192 + ...ganizationsEnabledConnectionsWireTest.java | 342 + .../OrganizationsInvitationsWireTest.java | 307 + .../OrganizationsMembersRolesWireTest.java | 184 + .../mgmt/OrganizationsMembersWireTest.java | 179 + .../client/mgmt/OrganizationsWireTest.java | 443 + .../mgmt/PromptsCustomTextWireTest.java | 150 + .../auth0/client/mgmt/PromptsEntityTest.java | 191 - .../client/mgmt/PromptsPartialsWireTest.java | 146 + .../client/mgmt/PromptsRenderingWireTest.java | 280 + .../auth0/client/mgmt/PromptsWireTest.java | 195 + .../client/mgmt/RefreshTokensEntityTest.java | 61 - .../client/mgmt/RefreshTokensWireTest.java | 140 + .../client/mgmt/ResourceServerEntityTest.java | 214 - .../client/mgmt/ResourceServersWireTest.java | 425 + .../auth0/client/mgmt/RolesEntityTest.java | 481 - .../client/mgmt/RolesPermissionsWireTest.java | 201 + .../auth0/client/mgmt/RolesUsersWireTest.java | 132 + .../com/auth0/client/mgmt/RolesWireTest.java | 309 + .../client/mgmt/RulesConfigsEntityTest.java | 104 - .../client/mgmt/RulesConfigsWireTest.java | 189 + .../auth0/client/mgmt/RulesEntityTest.java | 206 - .../com/auth0/client/mgmt/RulesWireTest.java | 336 + ...SelfServiceProfilesCustomTextWireTest.java | 181 + .../mgmt/SelfServiceProfilesEntityTest.java | 321 - .../SelfServiceProfilesSsoTicketWireTest.java | 146 + .../mgmt/SelfServiceProfilesWireTest.java | 371 + .../auth0/client/mgmt/SessionsEntityTest.java | 81 - .../auth0/client/mgmt/SessionsWireTest.java | 155 + .../client/mgmt/SimpleTokenProviderTest.java | 32 - .../auth0/client/mgmt/StatsEntityTest.java | 101 - .../com/auth0/client/mgmt/StatsWireTest.java | 165 + .../com/auth0/client/mgmt/StreamTest.java | 97 + .../mgmt/SupplementalSignalsWireTest.java | 180 + .../auth0/client/mgmt/TenantsEntityTest.java | 116 - .../client/mgmt/TenantsSettingsWireTest.java | 390 + .../com/auth0/client/mgmt/TestClient.java | 11 + .../auth0/client/mgmt/TicketsEntityTest.java | 80 - .../auth0/client/mgmt/TicketsWireTest.java | 210 + .../mgmt/TokenExchangeProfilesWireTest.java | 289 + .../mgmt/UserAttributeProfilesEntityTest.java | 302 - .../client/mgmt/UserBlocksEntityTest.java | 107 - .../auth0/client/mgmt/UserBlocksWireTest.java | 205 + .../auth0/client/mgmt/UserGrantsWireTest.java | 109 + .../UsersAuthenticationMethodsWireTest.java | 490 + .../mgmt/UsersAuthenticatorsWireTest.java | 67 + .../client/mgmt/UsersEnrollmentsWireTest.java | 120 + .../auth0/client/mgmt/UsersEntityTest.java | 1507 - ...FederatedConnectionsTokensetsWireTest.java | 127 + .../client/mgmt/UsersIdentitiesWireTest.java | 231 + .../auth0/client/mgmt/UsersLogsWireTest.java | 88 + .../client/mgmt/UsersMultifactorWireTest.java | 77 + .../mgmt/UsersOrganizationsWireTest.java | 87 + .../client/mgmt/UsersPermissionsWireTest.java | 201 + .../mgmt/UsersRefreshTokenWireTest.java | 95 + .../auth0/client/mgmt/UsersRolesWireTest.java | 178 + .../client/mgmt/UsersSessionsWireTest.java | 95 + .../com/auth0/client/mgmt/UsersWireTest.java | 604 + ...dentialsVerificationTemplatesWireTest.java | 378 + .../mgmt/core/QueryStringMapperTest.java | 339 + .../client/mgmt/filter/ActionsFilterTest.java | 35 - .../mgmt/filter/ClientGrantsFilterTest.java | 57 - .../mgmt/filter/ConnectionFilterTest.java | 76 - .../filter/DeviceCredentialsFilterTest.java | 85 - .../client/mgmt/filter/FieldFilterTest.java | 39 - .../client/mgmt/filter/GrantsFilterTest.java | 57 - .../mgmt/filter/LogEventFilterTest.java | 86 - .../filter/PageBasedPaginationFilterTest.java | 39 - .../client/mgmt/filter/PageFilterTest.java | 47 - .../client/mgmt/filter/QueryFilterTest.java | 93 - .../filter/ResourceServersFilterTest.java | 38 - .../client/mgmt/filter/RoleFilterTest.java | 48 - .../client/mgmt/filter/RulesFilterTest.java | 67 - .../client/mgmt/filter/UserFilterTest.java | 99 - .../mgmt/filter/UsersExportFilterTest.java | 75 - .../mgmt/filter/UsersImportOptionsTest.java | 54 - .../com/auth0/exception/APIExceptionTest.java | 269 - src/test/java/com/auth0/json/JsonMatcher.java | 136 - src/test/java/com/auth0/json/JsonTest.java | 43 - .../auth0/json/ObjectMapperProviderTest.java | 16 - .../com/auth0/json/auth/CreatedUserTest.java | 64 - .../auth/PasswordlessEmailResponseTest.java | 24 - .../auth/PasswordlessSmsResponseTest.java | 24 - .../com/auth0/json/auth/TokenHolderTest.java | 83 - .../com/auth0/json/auth/UserInfoTest.java | 46 - .../com/auth0/json/mgmt/ClientGrantTest.java | 56 - .../com/auth0/json/mgmt/DailyStatsTest.java | 22 - .../json/mgmt/DeviceCredentialsTest.java | 51 - .../auth0/json/mgmt/EmailTemplateTest.java | 58 - .../java/com/auth0/json/mgmt/GrantTest.java | 52 - .../auth0/json/mgmt/ResourceServerTest.java | 107 - .../java/com/auth0/json/mgmt/RoleTest.java | 45 - .../java/com/auth0/json/mgmt/RuleTest.java | 50 - .../com/auth0/json/mgmt/RulesConfigTest.java | 41 - .../java/com/auth0/json/mgmt/ScopeTest.java | 31 - .../java/com/auth0/json/mgmt/TokenTest.java | 35 - .../auth0/json/mgmt/actions/ActionTest.java | 158 - .../json/mgmt/actions/ActionsPageTest.java | 111 - .../json/mgmt/actions/BindingsPageTest.java | 111 - .../actions/BindingsUpdateRequestTest.java | 52 - .../json/mgmt/actions/ExecutionTest.java | 73 - .../auth0/json/mgmt/actions/TriggersTest.java | 50 - .../auth0/json/mgmt/actions/VersionTest.java | 135 - .../json/mgmt/actions/VersionsPageTest.java | 75 - .../BreachedPasswordTest.java | 56 - .../BruteForceConfigurationTest.java | 60 - ...spiciousIPThrottlingConfigurationTest.java | 86 - .../com/auth0/json/mgmt/client/AddonTest.java | 39 - .../auth0/json/mgmt/client/AddonsTest.java | 47 - .../auth0/json/mgmt/client/AndroidTest.java | 37 - .../auth0/json/mgmt/client/ClientTest.java | 398 - .../json/mgmt/client/CredentialTest.java | 63 - .../json/mgmt/client/EncryptionKeyTest.java | 37 - .../com/auth0/json/mgmt/client/IOSTest.java | 34 - .../mgmt/client/JWTConfigurationTest.java | 50 - .../auth0/json/mgmt/client/MobileTest.java | 35 - .../json/mgmt/client/RefreshTokenTest.java | 50 - .../json/mgmt/client/SigningKeyTest.java | 35 - .../mgmt/connections/ConnectionKeysTest.java | 66 - .../json/mgmt/connections/ConnectionTest.java | 80 - .../connections/EnabledClientRequestTest.java | 23 - .../EnabledClientResponseTest.java | 40 - .../json/mgmt/connections/RotateKeyTest.java | 35 - .../ScimConfigurationRequestTest.java | 51 - .../ScimConfigurationResponseTest.java | 66 - .../ScimTokenBaseResponseTest.java | 56 - .../ScimTokenCreateResponseTest.java | 48 - .../connections/ScimTokenRequestTest.java | 44 - .../connections/ScimTokenResponseTest.java | 60 - .../EmailProviderCredentialsTest.java | 55 - .../emailproviders/EmailProviderTest.java | 46 - .../json/mgmt/guardian/EnrollmentTest.java | 29 - .../mgmt/guardian/EnrollmentTicketTest.java | 53 - .../auth0/json/mgmt/guardian/FactorTest.java | 33 - .../mgmt/guardian/GuardianTemplatesTest.java | 33 - .../mgmt/guardian/SNSFactorProviderTest.java | 54 - .../guardian/TwilioFactorProviderTest.java | 95 - .../json/mgmt/jobs/JobErrorDetailsTest.java | 41 - .../com/auth0/json/mgmt/jobs/JobTest.java | 50 - .../json/mgmt/jobs/UsersExportFieldTest.java | 36 - .../json/mgmt/keys/EncryptionKeyTest.java | 70 - .../mgmt/keys/EncryptionKeysPageTest.java | 94 - .../EncryptionWrappingKeyResponseTest.java | 49 - .../com/auth0/json/mgmt/keys/KeyTest.java | 65 - .../json/mgmt/logevents/LogEventTest.java | 72 - .../mgmt/logevents/LogEventsPageTest.java | 39 - .../json/mgmt/logstreams/LogStreamsTest.java | 98 - .../mgmt/networkacls/NetworkAclsPageTest.java | 115 - .../mgmt/networkacls/NetworkAclsTest.java | 54 - .../EnabledConnectionsPageTest.java | 83 - .../organizations/EnabledConnectionsTest.java | 59 - .../mgmt/organizations/InvitationTest.java | 83 - .../organizations/InvitationsPageTest.java | 108 - .../mgmt/organizations/MembersPageTest.java | 117 - .../json/mgmt/organizations/MembersTest.java | 52 - .../OrganizationClientGrantTest.java | 48 - .../OrganizationClientGrantsPageTest.java | 71 - .../organizations/OrganizationsPageTest.java | 182 - .../mgmt/organizations/OrganizationsTest.java | 107 - .../permissions/PermissionSourceTest.java | 24 - .../json/mgmt/permissions/PermissionTest.java | 47 - .../mgmt/permissions/PermissionsPageTest.java | 39 - .../mgmt/refreshtokens/RefreshTokenTest.java | 82 - .../refreshtokens/RefreshTokensPageTest.java | 161 - .../SelfServiceProfileResponsePageTest.java | 173 - .../SelfServiceProfileResponseTest.java | 73 - .../SelfServiceProfileTest.java | 62 - .../SsoAccessTicketRequestTest.java | 88 - .../SsoAccessTicketResponseTest.java | 31 - .../auth0/json/mgmt/sessions/SessionTest.java | 91 - .../json/mgmt/sessions/SessionsPageTest.java | 121 - .../tenants/ErrorPageCustomizationTest.java | 42 - .../mgmt/tenants/PageCustomizationTest.java | 36 - .../auth0/json/mgmt/tenants/TenantTest.java | 159 - .../tickets/EmailVerificationTicketTest.java | 65 - .../tickets/PasswordChangeTicketTest.java | 87 - .../ListUserAttributeProfileTemplateTest.java | 144 - .../UserAttributeProfileTemplateTest.java | 132 - .../UserAttributeProfileTest.java | 132 - .../mgmt/userblocks/BlockDetailsTest.java | 22 - .../json/mgmt/userblocks/UserBlocksTest.java | 21 - .../auth0/json/mgmt/users/IdentityTest.java | 27 - .../json/mgmt/users/ProfileDataTest.java | 31 - .../json/mgmt/users/RecoveryCodeTest.java | 21 - .../com/auth0/json/mgmt/users/UserTest.java | 147 - .../auth0/json/mgmt/users/UsersPageTest.java | 67 - .../AuthenticationMethodTest.java | 94 - .../java/com/auth0/net/BaseRequestTest.java | 507 - .../com/auth0/net/EmptyBodyRequestTest.java | 68 - .../auth0/net/EmptyBodyVoidRequestTest.java | 53 - .../com/auth0/net/FormBodyRequestTest.java | 91 - .../com/auth0/net/MultipartRequestTest.java | 458 - .../auth0/net/RateLimitInterceptorTest.java | 198 - .../java/com/auth0/net/SignUpRequestTest.java | 65 - .../auth0/net/TelemetryInterceptorTest.java | 128 - .../java/com/auth0/net/TelemetryTest.java | 99 - .../java/com/auth0/net/TokenRequestTest.java | 88 - .../java/com/auth0/net/VoidRequestTest.java | 64 - .../net/client/Auth0HttpRequestTest.java | 26 - .../net/client/Auth0HttpResponseTest.java | 26 - .../net/client/DefaultHttpClientTest.java | 944 - .../auth0/net/client/multipart/FilePart.java | 21 - .../net/client/multipart/KeyValuePart.java | 20 - .../multipart/RecordedMultipartRequest.java | 101 - .../java/com/auth0/utils/AssertsTest.java | 73 - .../utils/HttpResponseHeadersUtilsTest.java | 119 - .../utils/tokens/IdTokenVerifierTest.java | 664 - .../utils/tokens/SignatureVerifierTest.java | 189 - src/test/resources/{mgmt => }/action.json | 0 .../{mgmt => }/action_execution.json | 0 .../{mgmt => }/action_trigger_bindings.json | 0 .../resources/{mgmt => }/action_triggers.json | 0 .../resources/{mgmt => }/action_version.json | 0 .../{mgmt => }/action_versions_list.json | 0 .../resources/{mgmt => }/actions_list.json | 0 .../{mgmt => }/active_users_count.json | 0 .../auth/add_oob_authenticator_response.json | 8 - .../auth/add_otp_authenticator_response.json | 6 - .../auth/back_channel_authorize_response.json | 5 - .../back_channel_login_status_response.json | 6 - src/test/resources/auth/error_plaintext.json | 1 - .../auth/error_with_description.json | 6 - ...with_description_and_extra_properties.json | 5 - src/test/resources/auth/error_with_error.json | 3 - .../auth/error_with_error_description.json | 4 - .../auth/list_authenticators_response.json | 26 - .../auth/mfa_challenge_request_response.json | 5 - .../auth/password_strength_error_none.json | 85 - .../auth/password_strength_error_some.json | 85 - .../resources/auth/passwordless_email.json | 5 - src/test/resources/auth/passwordless_sms.json | 6 - .../auth/pushed_authorization_response.json | 4 - src/test/resources/auth/reset_password.json | 1 - src/test/resources/auth/rsa_private_key.pem | 28 - src/test/resources/auth/rsa_public_key.pem | 9 - src/test/resources/auth/sign_up.json | 5 - src/test/resources/auth/sign_up_username.json | 7 - src/test/resources/auth/tokens.json | 7 - src/test/resources/auth/user_info.json | 20 - .../authenticator_method_by_id.json | 0 .../authenticator_method_create.json | 0 .../{mgmt => }/authenticator_method_list.json | 0 .../authenticator_method_paged_list.json | 0 .../authenticator_method_update.json | 0 .../authenticator_method_update_by_id.json | 0 .../{mgmt => }/blacklisted_tokens_list.json | 0 .../{mgmt => }/branding_login_template.json | 0 .../{mgmt => }/branding_settings.json | 0 .../breached_password_settings.json | 0 .../{mgmt => }/brute_force_configuration.json | 0 src/test/resources/{mgmt => }/client.json | 0 .../{mgmt => }/client_credential.json | 0 .../{mgmt => }/client_credential_list.json | 0 .../resources/{mgmt => }/client_grant.json | 0 .../{mgmt => }/client_grants_list.json | 0 .../{mgmt => }/client_grants_paged_list.json | 0 .../resources/{mgmt => }/clients_list.json | 0 .../{mgmt => }/clients_paged_list.json | 0 src/test/resources/{mgmt => }/connection.json | 0 .../resources/{mgmt => }/connection_key.json | 0 .../connection_scim_configuration.json | 0 .../{mgmt => }/connection_scim_token.json | 0 .../{mgmt => }/connection_scim_tokens.json | 0 .../{mgmt => }/connections_list.json | 0 .../{mgmt => }/connections_paged_list.json | 0 .../{mgmt => }/custom_text_prompt.json | 0 .../{mgmt => }/daily_stats_list.json | 0 ...default_connection_scim_configuration.json | 0 .../{mgmt => }/device_credentials.json | 0 .../{mgmt => }/device_credentials_list.json | 0 .../resources/{mgmt => }/email_provider.json | 0 .../resources/{mgmt => }/email_template.json | 0 .../{mgmt => }/email_verification_ticket.json | 0 src/test/resources/{mgmt => }/empty_list.json | 0 .../enabled_clients_for_connection.json | 0 .../resources/{mgmt => }/encryption_key.json | 0 .../{mgmt => }/encryption_keys_list.json | 0 .../{mgmt => }/error_with_message.json | 0 src/test/resources/{mgmt => }/event_log.json | 0 .../resources/{mgmt => }/event_logs_list.json | 0 .../{mgmt => }/event_logs_paged_list.json | 0 .../resources/{mgmt => }/grants_list.json | 0 .../{mgmt => }/grants_paged_list.json | 0 ...guardian_authentication_policies_list.json | 0 .../{mgmt => }/guardian_enrollment.json | 0 .../guardian_enrollment_ticket.json | 0 .../{mgmt => }/guardian_enrollments_list.json | 0 .../resources/{mgmt => }/guardian_factor.json | 0 .../{mgmt => }/guardian_factors_list.json | 0 .../guardian_sns_factor_provider.json | 0 .../guardian_sns_factor_provider_empty.json | 0 .../{mgmt => }/guardian_templates.json | 0 ...guardian_twilio_factor_provider_empty.json | 0 ...dian_twilio_factor_provider_with_from.json | 0 ...r_provider_with_messaging_service_sid.json | 0 .../resources/{mgmt => }/identities_list.json | 0 src/test/resources/{mgmt => }/invitation.json | 0 .../{mgmt => }/invitations_list.json | 0 .../{mgmt => }/invitations_paged_list.json | 0 src/test/resources/{mgmt => }/job.json | 0 .../{mgmt => }/job_error_details.json | 0 .../{mgmt => }/job_post_users_exports.json | 0 .../{mgmt => }/job_post_users_imports.json | 0 .../job_post_users_imports_input.json | 0 .../job_post_verification_email.json | 0 src/test/resources/{mgmt => }/key.json | 0 src/test/resources/{mgmt => }/key_list.json | 0 src/test/resources/{mgmt => }/key_revoke.json | 0 src/test/resources/{mgmt => }/key_rotate.json | 0 src/test/resources/keys/bad-public-rsa.pem | 9 - src/test/resources/keys/public-rsa.pem | 9 - src/test/resources/{mgmt => }/log_stream.json | 0 .../{mgmt => }/log_streams_list.json | 0 .../mgmt/user_attribute_profile.json | 30 - .../mgmt/user_attribute_profile_template.json | 33 - ...user_attribute_profile_templates_list.json | 39 - .../mgmt/user_attribute_profiles_list.json | 95 - .../org.mockito.plugins.MockMaker | 1 - .../{mgmt => }/multipart_sample.json | 0 .../resources/{mgmt => }/network_acls.json | 0 .../{mgmt => }/network_acls_list.json | 0 .../resources/{mgmt => }/organization.json | 0 .../{mgmt => }/organization_client_grant.json | 0 .../organization_client_grants.json | 0 ...organization_client_grants_paged_list.json | 0 .../{mgmt => }/organization_connection.json | 0 .../organization_connections_list.json | 0 .../organization_connections_paged_list.json | 0 .../organization_member_roles_list.json | 0 .../organization_member_roles_paged_list.json | 0 ...ization_members_checkpoint_paged_list.json | 0 .../{mgmt => }/organization_members_list.json | 0 .../organization_members_paged_list.json | 0 .../organizations_checkpoint_paged_list.json | 0 .../{mgmt => }/organizations_list.json | 0 .../{mgmt => }/organizations_paged_list.json | 0 .../resources/{mgmt => }/partials_prompt.json | 0 .../{mgmt => }/password_change_ticket.json | 0 src/test/resources/{mgmt => }/prompt.json | 0 .../{mgmt => }/rate_limit_error.json | 0 .../resources/{mgmt => }/recovery_code.json | 0 .../resources/{mgmt => }/refresh_token.json | 0 .../resources/{mgmt => }/resource_server.json | 0 .../{mgmt => }/resource_servers_list.json | 0 .../resource_servers_paged_list.json | 0 src/test/resources/{mgmt => }/role.json | 0 .../{mgmt => }/role_permissions_list.json | 0 .../role_permissions_paged_list.json | 0 .../role_users_checkpoint_paged_list.json | 0 .../resources/{mgmt => }/role_users_list.json | 0 .../{mgmt => }/role_users_paged_list.json | 0 src/test/resources/{mgmt => }/roles_list.json | 0 .../{mgmt => }/roles_paged_list.json | 0 src/test/resources/{mgmt => }/rotate_key.json | 0 src/test/resources/{mgmt => }/rule.json | 0 .../resources/{mgmt => }/rules_config.json | 0 .../{mgmt => }/rules_configs_list.json | 0 src/test/resources/{mgmt => }/rules_list.json | 0 .../{mgmt => }/rules_paged_list.json | 0 src/test/resources/{mgmt => }/scope.json | 0 .../{mgmt => }/self_service_profile.json | 0 .../self_service_profile_custom_text.json | 0 .../self_service_profile_response.json | 0 .../self_service_profile_sso_ticket.json | 0 ...lf_service_profile_sso_ticket_request.json | 0 .../self_service_profiles_list.json | 0 src/test/resources/{mgmt => }/session.json | 0 ...uspicious_ip_throttling_configuration.json | 0 src/test/resources/{mgmt => }/tenant.json | 0 src/test/resources/{mgmt => }/user.json | 0 .../resources/{mgmt => }/user_blocks.json | 0 .../user_permissions_paged_list.json | 0 .../{mgmt => }/user_refresh_tokens.json | 0 .../{mgmt => }/user_roles_paged_list.json | 0 .../resources/{mgmt => }/user_sessions.json | 0 src/test/resources/{mgmt => }/users_list.json | 0 .../{mgmt => }/users_paged_list.json | 0 v3_MIGRATION_GUIDE.md | 369 + 2374 files changed, 402846 insertions(+), 52614 deletions(-) create mode 100644 .DS_Store create mode 100644 .fernignore create mode 100644 reference.md create mode 100644 sample-app/build.gradle create mode 100644 sample-app/src/main/java/sample/App.java create mode 100644 src/main/java/com/auth0/client/mgmt/ActionsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ActionsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncActionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncBrandingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncDeviceCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncEmailTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncFormsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncHooksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncJobsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncLogStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncManagementApiBuilder.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncNetworkAclsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncPromptsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawBrandingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawEmailTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawFormsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawHooksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawJobsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawLogStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawPromptsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawRulesConfigsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawSupplementalSignalsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawTicketsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawUserGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRulesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRulesConfigsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncSelfServiceProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncStatsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncSupplementalSignalsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncTicketsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncUserBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncUserGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/AttackProtectionEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/BaseManagementEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/BlacklistsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/BrandingClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/BrandingEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/ClientsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ClientsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/ConnectionsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/DeviceCredentialsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/DeviceCredentialsEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/EmailProviderEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/EmailTemplatesClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/EmailTemplatesEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/EventStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/FlowsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/FormsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/GrantsEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/GuardianEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/HooksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/JobsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/JobsEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/KeysEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/LogEventsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/LogStreamsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/LogStreamsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/LogsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ManagementAPI.java create mode 100644 src/main/java/com/auth0/client/mgmt/ManagementApi.java create mode 100644 src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java create mode 100644 src/main/java/com/auth0/client/mgmt/NetworkAclsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/NetworkAclsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/OrganizationsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/OrganizationsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/PromptsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/PromptsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawActionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawBrandingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawEmailTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawFlowsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawFormsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawHooksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawJobsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawLogStreamsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawPromptsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawRulesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawRulesConfigsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawStatsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawSupplementalSignalsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawTicketsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/RefreshTokensEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/RequestBuilder.java delete mode 100644 src/main/java/com/auth0/client/mgmt/ResourceServerEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/ResourceServersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RolesClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/RolesEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/RulesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RulesConfigsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/RulesConfigsEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/RulesEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/SelfServiceProfilesClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/SelfServiceProfilesEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/SessionsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/SessionsEntity.java delete mode 100644 src/main/java/com/auth0/client/mgmt/SimpleTokenProvider.java create mode 100644 src/main/java/com/auth0/client/mgmt/StatsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/StatsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/SupplementalSignalsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/TenantsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/TicketsClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/TicketsEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/UserAttributeProfilesEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/UserBlocksClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/UserBlocksEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/UserGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/UsersClient.java delete mode 100644 src/main/java/com/auth0/client/mgmt/UsersEntity.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncRawExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncRawTriggersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncTriggersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/AsyncVersionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/ExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/RawExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/RawTriggersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/RawVersionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/TriggersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/VersionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncBindingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/BindingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/RawBindingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/AnomalyClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/AsyncAnomalyClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/AsyncBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/AsyncRawBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/BlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/anomaly/RawBlocksClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBreachedPasswordDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBruteForceProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBreachedPasswordDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBruteForceProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawSuspiciousIpThrottlingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncSuspiciousIpThrottlingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/BreachedPasswordDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/BruteForceProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/RawBreachedPasswordDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/RawBruteForceProtectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/RawSuspiciousIpThrottlingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/SuspiciousIpThrottlingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/AsyncRawThemesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/AsyncThemesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/RawThemesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/ThemesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/AsyncPhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/AsyncProvidersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/AsyncTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/PhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/ProvidersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/RawProvidersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/TemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/clientgrants/AsyncOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clientgrants/OrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clientgrants/RawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/AsyncConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/AsyncCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/AsyncRawCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/ConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/CredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/RawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/RawCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncKeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncRawKeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncRawScimConfigurationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncRawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncScimConfigurationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/KeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/RawKeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/RawScimConfigurationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/RawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/ScimConfigurationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/UsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncRawTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/RawTokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/TokensClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/BasePage.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/BiDirectionalPage.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ClientOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/CustomPager.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/DateTimeDeserializer.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/Environment.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/FileStream.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/InputStreamRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ManagementApiException.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ManagementApiHttpResponse.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ManagementException.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/MediaTypes.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/Nullable.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/NullableNonemptyFilter.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ObjectMappers.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/OptionalNullable.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/RequestOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ResponseBodyInputStream.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/ResponseBodyReader.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/RetryInterceptor.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/Stream.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/Suppliers.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/SyncPage.java create mode 100644 src/main/java/com/auth0/client/mgmt/core/SyncPagingIterable.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/AsyncEmailsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/AsyncProviderClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/EmailsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/ProviderClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/RawProviderClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/ConflictError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java create mode 100644 src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/AsyncDeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawRedeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRedeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/DeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/RawRedeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/RedeliveriesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/ActionsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/BaseFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/EnabledClientsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/EncryptionKeyFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/GrantsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/InvitationsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/NetworkAclsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/OrganizationClientGrantsFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/PageFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/ResourceServersFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/RolesFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/RulesFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/UserAttributeProfilesFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/UserFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/UsersExportFilter.java delete mode 100644 src/main/java/com/auth0/client/mgmt/filter/UsersImportOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/AsyncExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/ExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/RawExecutionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncRawFactorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/RawFactorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawSmsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncSmsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/RawSmsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/SmsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncDuoClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncRawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/DuoClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/RawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/SettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncErrorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncRawErrorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersExportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersImportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncRawVerificationEmailClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersExportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersImportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/AsyncVerificationEmailClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/ErrorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/RawErrorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/RawUsersExportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/RawUsersImportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/RawVerificationEmailClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/UsersExportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/UsersImportsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/VerificationEmailClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncCustomSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncEncryptionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncKeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncRawCustomSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncRawSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/AsyncSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/CustomSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/EncryptionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/KeysClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/RawCustomSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/RawEncryptionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/RawSigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/SigningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncEnabledConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncInvitationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncMembersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncRawInvitationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncRawMembersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/ClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/EnabledConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/InvitationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/MembersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/RolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncPartialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncRawCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncRawPartialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/CustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/PartialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/RawCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/RawPartialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/AsyncPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/PermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/UsersClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawSsoTicketClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncSsoTicketClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawSsoTicketClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/SsoTicketClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/AsyncSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/AsyncTenantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/RawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/SettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/TenantsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Action.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBase.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBinding.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionError.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionVersion.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculFilters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingColors.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingFont.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Client.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSlack.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAddons.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientCredential.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientMobile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSegmentRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CredentialId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomDomain.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DailyStats.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainVerification.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaAccessKeyId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeAwsRegionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamSubscription.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBasicAuth.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamsGetStatsRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowAction.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContacts.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsUnits.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothing.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsInput.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVars.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsTemplateId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedrive.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsPersonId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsStageId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsUserId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPerson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOwnerId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforce.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsType.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowSummary.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlock.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormComponent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormField.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOff.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffCurrencyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOff.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOffAmount.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeSubscription.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldText.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFlow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormLanguages.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormMessages.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormNode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormRouter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormStartNode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormStep.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormStyle.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormSummary.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidget.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEventStreamStatsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetNetworkAclsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Hook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Identity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Integration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Log.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogDate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OauthScope.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Organization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneProviderCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneProviderDeliveryMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneProviderNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneProviderSchemaMasked.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Role.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RoleUser.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Rule.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/RulesConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionDate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SigningKeys.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SignupSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SignupVerification.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SignupVerified.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TokenQuota.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPhoneProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFlowRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContentTemplate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserGrant.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserIdentity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserProfileData.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticationMethodsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticatorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncFederatedConnectionsTokensetsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncMultifactorClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticatorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawFederatedConnectionsTokensetsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawMultifactorClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawRefreshTokenClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRefreshTokenClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AuthenticationMethodsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AuthenticatorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/EnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/FederatedConnectionsTokensetsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/LogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/MultifactorClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/OrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/PermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawAuthenticatorsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawEnrollmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawFederatedConnectionsTokensetsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawMultifactorClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RefreshTokenClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RolesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/SessionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/AsyncVerifiableCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/VerifiableCredentialsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncVerificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/RawTemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/TemplatesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/VerificationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java delete mode 100644 src/main/java/com/auth0/json/mgmt/Page.java delete mode 100644 src/main/java/com/auth0/json/mgmt/PageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Action.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/ActionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/ActionsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Binding.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/BindingActionReference.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/BindingUpdate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/BindingsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/BindingsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/BindingsUpdateRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Dependency.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Error.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Execution.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/ExecutionResult.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Secret.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/ServiceStatus.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Trigger.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Triggers.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/Version.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/VersionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/actions/VersionsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPassword.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStageEntry.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/BruteForceConfiguration.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/Stage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/StageEntry.java delete mode 100644 src/main/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfiguration.java delete mode 100644 src/main/java/com/auth0/json/mgmt/blacklists/Token.java delete mode 100644 src/main/java/com/auth0/json/mgmt/branding/BrandingColors.java delete mode 100644 src/main/java/com/auth0/json/mgmt/branding/BrandingFont.java delete mode 100644 src/main/java/com/auth0/json/mgmt/branding/BrandingSettings.java delete mode 100644 src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplateUpdate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Addon.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Addons.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Android.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Client.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/ClientAuthenticationMethods.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/ClientDefaultOrganization.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/ClientsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/ClientsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Credential.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/EncryptionKey.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/IOS.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/JWTConfiguration.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/Mobile.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/OIDCBackchannelLogout.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/PrivateKeyJwt.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/RefreshToken.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/SelfSignedTLSClientAuth.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/SignedRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/SigningKey.java delete mode 100644 src/main/java/com/auth0/json/mgmt/client/TLSClientAuth.java delete mode 100644 src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrant.java delete mode 100644 src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/Clients.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/Connection.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ConnectionKeys.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ConnectionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ConnectionsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/DefaultScimMappingResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/EnabledClientRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/EnabledClientResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/Mapping.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/RotateKey.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimTokenRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/connections/ScimTokenResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/devicecredentials/DeviceCredentials.java delete mode 100644 src/main/java/com/auth0/json/mgmt/emailproviders/EmailProvider.java delete mode 100644 src/main/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentials.java delete mode 100644 src/main/java/com/auth0/json/mgmt/emailtemplates/EmailTemplate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/grants/Grant.java delete mode 100644 src/main/java/com/auth0/json/mgmt/grants/GrantsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/grants/GrantsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/EnrollmentTicket.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/Factor.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/GuardianTemplates.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/SNSFactorProvider.java delete mode 100644 src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java delete mode 100644 src/main/java/com/auth0/json/mgmt/jobs/Job.java delete mode 100644 src/main/java/com/auth0/json/mgmt/jobs/JobError.java delete mode 100644 src/main/java/com/auth0/json/mgmt/jobs/JobErrorDetails.java delete mode 100644 src/main/java/com/auth0/json/mgmt/jobs/JobSummary.java delete mode 100644 src/main/java/com/auth0/json/mgmt/jobs/UsersExportField.java delete mode 100644 src/main/java/com/auth0/json/mgmt/keys/EncryptionKey.java delete mode 100644 src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/keys/Key.java delete mode 100644 src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java delete mode 100644 src/main/java/com/auth0/json/mgmt/logevents/LogEventsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/logevents/LogEventsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/logstreams/LogStream.java delete mode 100644 src/main/java/com/auth0/json/mgmt/logstreams/LogStreamFilter.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/Action.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/Match.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/NetworkAcls.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/networkacls/Rule.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Branding.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Colors.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Connection.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/ConnectionsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/CreateOrganizationClientGrantRequestBody.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Invitation.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/InvitationsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/InvitationsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Invitee.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Inviter.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Member.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Members.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/MembersPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/MembersPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Organization.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrant.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/organizations/Roles.java delete mode 100644 src/main/java/com/auth0/json/mgmt/permissions/Permission.java delete mode 100644 src/main/java/com/auth0/json/mgmt/permissions/PermissionSource.java delete mode 100644 src/main/java/com/auth0/json/mgmt/permissions/PermissionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/permissions/PermissionsPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/prompts/Prompt.java delete mode 100644 src/main/java/com/auth0/json/mgmt/refreshtokens/Device.java delete mode 100644 src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshToken.java delete mode 100644 src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/refreshtokens/ResourceServer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/AuthorizationDetails.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/EncryptionKey.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/ProofOfPossession.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/Scope.java delete mode 100644 src/main/java/com/auth0/json/mgmt/resourceserver/TokenEncryption.java delete mode 100644 src/main/java/com/auth0/json/mgmt/roles/Role.java delete mode 100644 src/main/java/com/auth0/json/mgmt/roles/RolesPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/roles/RolesPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/rules/Rule.java delete mode 100644 src/main/java/com/auth0/json/mgmt/rules/RulesConfig.java delete mode 100644 src/main/java/com/auth0/json/mgmt/rules/RulesPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/rules/RulesPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Branding.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Color.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/DomainAliasesConfig.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/EnabledOrganizations.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/ProvisioningConfig.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfile.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequest.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponse.java delete mode 100644 src/main/java/com/auth0/json/mgmt/selfserviceprofiles/UserAttribute.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/Authentication.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/AuthenticationMethod.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/Client.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/Device.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/Session.java delete mode 100644 src/main/java/com/auth0/json/mgmt/sessions/SessionsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/stats/DailyStats.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/Clients.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/DefaultTokenQuota.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/ErrorPageCustomization.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/Mtls.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/Organizations.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/PageCustomization.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/SessionCookie.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tenants/Tenant.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationIdentity.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationTicket.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tickets/PasswordChangeTicket.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tokenquota/ClientCredentials.java delete mode 100644 src/main/java/com/auth0/json/mgmt/tokenquota/TokenQuota.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/OidcMapping.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserAttributes.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserId.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfile.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplate.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributes.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserId.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userblocks/BlockDetails.java delete mode 100644 src/main/java/com/auth0/json/mgmt/userblocks/UserBlocks.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/Identity.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/ProfileData.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/RecoveryCode.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/User.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/UsersPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/UsersPageDeserializer.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthMethod.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethod.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPage.java delete mode 100644 src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPageDeserializer.java delete mode 100644 src/test/java/com/auth0/AssertsUtil.java delete mode 100644 src/test/java/com/auth0/client/HttpOptionsTest.java delete mode 100644 src/test/java/com/auth0/client/MockServer.java delete mode 100644 src/test/java/com/auth0/client/RecordedRequestMatcher.java delete mode 100644 src/test/java/com/auth0/client/UrlMatcher.java delete mode 100644 src/test/java/com/auth0/client/auth/AuthAPITest.java delete mode 100644 src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java delete mode 100644 src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java delete mode 100644 src/test/java/com/auth0/client/auth/RSAClientAssertionSignerTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ActionsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ActionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/BaseMgmtEntityTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/BrandingEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/BrandingWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ClientsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/EmailTemplatesEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/FlowsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/FormsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/HooksWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/JobsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/JobsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/KeysEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/LogStreamsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/LogsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ManagementAPITest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/NetworkAclsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/PromptsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/PromptsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/RefreshTokensEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/ResourceServerEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/RolesEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RolesWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/RulesEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RulesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/SessionsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/SessionsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/SimpleTokenProviderTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/StatsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/StatsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/StreamTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/TestClient.java delete mode 100644 src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/TicketsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/UserAttributeProfilesEntityTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/UsersEntityTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/core/QueryStringMapperTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/ActionsFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java delete mode 100644 src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java delete mode 100644 src/test/java/com/auth0/exception/APIExceptionTest.java delete mode 100644 src/test/java/com/auth0/json/JsonMatcher.java delete mode 100644 src/test/java/com/auth0/json/JsonTest.java delete mode 100644 src/test/java/com/auth0/json/ObjectMapperProviderTest.java delete mode 100644 src/test/java/com/auth0/json/auth/CreatedUserTest.java delete mode 100644 src/test/java/com/auth0/json/auth/PasswordlessEmailResponseTest.java delete mode 100644 src/test/java/com/auth0/json/auth/PasswordlessSmsResponseTest.java delete mode 100644 src/test/java/com/auth0/json/auth/TokenHolderTest.java delete mode 100644 src/test/java/com/auth0/json/auth/UserInfoTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/ClientGrantTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/DailyStatsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/DeviceCredentialsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/EmailTemplateTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/GrantTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/ResourceServerTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/RoleTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/RuleTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/RulesConfigTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/ScopeTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/TokenTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/ActionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/ActionsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/BindingsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/BindingsUpdateRequestTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/ExecutionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/TriggersTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/VersionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/actions/VersionsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/attackprotection/BruteForceConfigurationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfigurationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/AddonTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/AddonsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/AndroidTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/ClientTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/CredentialTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/EncryptionKeyTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/IOSTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/JWTConfigurationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/MobileTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/RefreshTokenTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/client/SigningKeyTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ConnectionKeysTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ConnectionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/EnabledClientRequestTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/EnabledClientResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/RotateKeyTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationRequestTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimTokenRequestTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/connections/ScimTokenResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentialsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTicketTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/FactorTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/GuardianTemplatesTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/SNSFactorProviderTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/jobs/JobErrorDetailsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/jobs/JobTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/jobs/UsersExportFieldTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/keys/EncryptionKeyTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/keys/EncryptionKeysPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/keys/KeyTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/logevents/LogEventsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/logstreams/LogStreamsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/InvitationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/InvitationsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/MembersPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/MembersTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/OrganizationsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/organizations/OrganizationsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/permissions/PermissionSourceTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/permissions/PermissionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/permissions/PermissionsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokenTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequestTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponseTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/sessions/SessionTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/sessions/SessionsPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/tenants/ErrorPageCustomizationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/tenants/PageCustomizationTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/tenants/TenantTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/tickets/EmailVerificationTicketTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplateTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplateTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/userblocks/BlockDetailsTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/userblocks/UserBlocksTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/IdentityTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/ProfileDataTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/RecoveryCodeTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/UserTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/UsersPageTest.java delete mode 100644 src/test/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodTest.java delete mode 100644 src/test/java/com/auth0/net/BaseRequestTest.java delete mode 100644 src/test/java/com/auth0/net/EmptyBodyRequestTest.java delete mode 100644 src/test/java/com/auth0/net/EmptyBodyVoidRequestTest.java delete mode 100644 src/test/java/com/auth0/net/FormBodyRequestTest.java delete mode 100644 src/test/java/com/auth0/net/MultipartRequestTest.java delete mode 100644 src/test/java/com/auth0/net/RateLimitInterceptorTest.java delete mode 100644 src/test/java/com/auth0/net/SignUpRequestTest.java delete mode 100644 src/test/java/com/auth0/net/TelemetryInterceptorTest.java delete mode 100644 src/test/java/com/auth0/net/TelemetryTest.java delete mode 100644 src/test/java/com/auth0/net/TokenRequestTest.java delete mode 100644 src/test/java/com/auth0/net/VoidRequestTest.java delete mode 100644 src/test/java/com/auth0/net/client/Auth0HttpRequestTest.java delete mode 100644 src/test/java/com/auth0/net/client/Auth0HttpResponseTest.java delete mode 100644 src/test/java/com/auth0/net/client/DefaultHttpClientTest.java delete mode 100644 src/test/java/com/auth0/net/client/multipart/FilePart.java delete mode 100644 src/test/java/com/auth0/net/client/multipart/KeyValuePart.java delete mode 100644 src/test/java/com/auth0/net/client/multipart/RecordedMultipartRequest.java delete mode 100644 src/test/java/com/auth0/utils/AssertsTest.java delete mode 100644 src/test/java/com/auth0/utils/HttpResponseHeadersUtilsTest.java delete mode 100644 src/test/java/com/auth0/utils/tokens/IdTokenVerifierTest.java delete mode 100644 src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java rename src/test/resources/{mgmt => }/action.json (100%) rename src/test/resources/{mgmt => }/action_execution.json (100%) rename src/test/resources/{mgmt => }/action_trigger_bindings.json (100%) rename src/test/resources/{mgmt => }/action_triggers.json (100%) rename src/test/resources/{mgmt => }/action_version.json (100%) rename src/test/resources/{mgmt => }/action_versions_list.json (100%) rename src/test/resources/{mgmt => }/actions_list.json (100%) rename src/test/resources/{mgmt => }/active_users_count.json (100%) delete mode 100644 src/test/resources/auth/add_oob_authenticator_response.json delete mode 100644 src/test/resources/auth/add_otp_authenticator_response.json delete mode 100644 src/test/resources/auth/back_channel_authorize_response.json delete mode 100644 src/test/resources/auth/back_channel_login_status_response.json delete mode 100644 src/test/resources/auth/error_plaintext.json delete mode 100644 src/test/resources/auth/error_with_description.json delete mode 100644 src/test/resources/auth/error_with_description_and_extra_properties.json delete mode 100644 src/test/resources/auth/error_with_error.json delete mode 100644 src/test/resources/auth/error_with_error_description.json delete mode 100644 src/test/resources/auth/list_authenticators_response.json delete mode 100644 src/test/resources/auth/mfa_challenge_request_response.json delete mode 100644 src/test/resources/auth/password_strength_error_none.json delete mode 100644 src/test/resources/auth/password_strength_error_some.json delete mode 100644 src/test/resources/auth/passwordless_email.json delete mode 100644 src/test/resources/auth/passwordless_sms.json delete mode 100644 src/test/resources/auth/pushed_authorization_response.json delete mode 100644 src/test/resources/auth/reset_password.json delete mode 100644 src/test/resources/auth/rsa_private_key.pem delete mode 100644 src/test/resources/auth/rsa_public_key.pem delete mode 100644 src/test/resources/auth/sign_up.json delete mode 100644 src/test/resources/auth/sign_up_username.json delete mode 100644 src/test/resources/auth/tokens.json delete mode 100644 src/test/resources/auth/user_info.json rename src/test/resources/{mgmt => }/authenticator_method_by_id.json (100%) rename src/test/resources/{mgmt => }/authenticator_method_create.json (100%) rename src/test/resources/{mgmt => }/authenticator_method_list.json (100%) rename src/test/resources/{mgmt => }/authenticator_method_paged_list.json (100%) rename src/test/resources/{mgmt => }/authenticator_method_update.json (100%) rename src/test/resources/{mgmt => }/authenticator_method_update_by_id.json (100%) rename src/test/resources/{mgmt => }/blacklisted_tokens_list.json (100%) rename src/test/resources/{mgmt => }/branding_login_template.json (100%) rename src/test/resources/{mgmt => }/branding_settings.json (100%) rename src/test/resources/{mgmt => }/breached_password_settings.json (100%) rename src/test/resources/{mgmt => }/brute_force_configuration.json (100%) rename src/test/resources/{mgmt => }/client.json (100%) rename src/test/resources/{mgmt => }/client_credential.json (100%) rename src/test/resources/{mgmt => }/client_credential_list.json (100%) rename src/test/resources/{mgmt => }/client_grant.json (100%) rename src/test/resources/{mgmt => }/client_grants_list.json (100%) rename src/test/resources/{mgmt => }/client_grants_paged_list.json (100%) rename src/test/resources/{mgmt => }/clients_list.json (100%) rename src/test/resources/{mgmt => }/clients_paged_list.json (100%) rename src/test/resources/{mgmt => }/connection.json (100%) rename src/test/resources/{mgmt => }/connection_key.json (100%) rename src/test/resources/{mgmt => }/connection_scim_configuration.json (100%) rename src/test/resources/{mgmt => }/connection_scim_token.json (100%) rename src/test/resources/{mgmt => }/connection_scim_tokens.json (100%) rename src/test/resources/{mgmt => }/connections_list.json (100%) rename src/test/resources/{mgmt => }/connections_paged_list.json (100%) rename src/test/resources/{mgmt => }/custom_text_prompt.json (100%) rename src/test/resources/{mgmt => }/daily_stats_list.json (100%) rename src/test/resources/{mgmt => }/default_connection_scim_configuration.json (100%) rename src/test/resources/{mgmt => }/device_credentials.json (100%) rename src/test/resources/{mgmt => }/device_credentials_list.json (100%) rename src/test/resources/{mgmt => }/email_provider.json (100%) rename src/test/resources/{mgmt => }/email_template.json (100%) rename src/test/resources/{mgmt => }/email_verification_ticket.json (100%) rename src/test/resources/{mgmt => }/empty_list.json (100%) rename src/test/resources/{mgmt => }/enabled_clients_for_connection.json (100%) rename src/test/resources/{mgmt => }/encryption_key.json (100%) rename src/test/resources/{mgmt => }/encryption_keys_list.json (100%) rename src/test/resources/{mgmt => }/error_with_message.json (100%) rename src/test/resources/{mgmt => }/event_log.json (100%) rename src/test/resources/{mgmt => }/event_logs_list.json (100%) rename src/test/resources/{mgmt => }/event_logs_paged_list.json (100%) rename src/test/resources/{mgmt => }/grants_list.json (100%) rename src/test/resources/{mgmt => }/grants_paged_list.json (100%) rename src/test/resources/{mgmt => }/guardian_authentication_policies_list.json (100%) rename src/test/resources/{mgmt => }/guardian_enrollment.json (100%) rename src/test/resources/{mgmt => }/guardian_enrollment_ticket.json (100%) rename src/test/resources/{mgmt => }/guardian_enrollments_list.json (100%) rename src/test/resources/{mgmt => }/guardian_factor.json (100%) rename src/test/resources/{mgmt => }/guardian_factors_list.json (100%) rename src/test/resources/{mgmt => }/guardian_sns_factor_provider.json (100%) rename src/test/resources/{mgmt => }/guardian_sns_factor_provider_empty.json (100%) rename src/test/resources/{mgmt => }/guardian_templates.json (100%) rename src/test/resources/{mgmt => }/guardian_twilio_factor_provider_empty.json (100%) rename src/test/resources/{mgmt => }/guardian_twilio_factor_provider_with_from.json (100%) rename src/test/resources/{mgmt => }/guardian_twilio_factor_provider_with_messaging_service_sid.json (100%) rename src/test/resources/{mgmt => }/identities_list.json (100%) rename src/test/resources/{mgmt => }/invitation.json (100%) rename src/test/resources/{mgmt => }/invitations_list.json (100%) rename src/test/resources/{mgmt => }/invitations_paged_list.json (100%) rename src/test/resources/{mgmt => }/job.json (100%) rename src/test/resources/{mgmt => }/job_error_details.json (100%) rename src/test/resources/{mgmt => }/job_post_users_exports.json (100%) rename src/test/resources/{mgmt => }/job_post_users_imports.json (100%) rename src/test/resources/{mgmt => }/job_post_users_imports_input.json (100%) rename src/test/resources/{mgmt => }/job_post_verification_email.json (100%) rename src/test/resources/{mgmt => }/key.json (100%) rename src/test/resources/{mgmt => }/key_list.json (100%) rename src/test/resources/{mgmt => }/key_revoke.json (100%) rename src/test/resources/{mgmt => }/key_rotate.json (100%) delete mode 100644 src/test/resources/keys/bad-public-rsa.pem delete mode 100644 src/test/resources/keys/public-rsa.pem rename src/test/resources/{mgmt => }/log_stream.json (100%) rename src/test/resources/{mgmt => }/log_streams_list.json (100%) delete mode 100644 src/test/resources/mgmt/user_attribute_profile.json delete mode 100644 src/test/resources/mgmt/user_attribute_profile_template.json delete mode 100644 src/test/resources/mgmt/user_attribute_profile_templates_list.json delete mode 100644 src/test/resources/mgmt/user_attribute_profiles_list.json delete mode 100644 src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker rename src/test/resources/{mgmt => }/multipart_sample.json (100%) rename src/test/resources/{mgmt => }/network_acls.json (100%) rename src/test/resources/{mgmt => }/network_acls_list.json (100%) rename src/test/resources/{mgmt => }/organization.json (100%) rename src/test/resources/{mgmt => }/organization_client_grant.json (100%) rename src/test/resources/{mgmt => }/organization_client_grants.json (100%) rename src/test/resources/{mgmt => }/organization_client_grants_paged_list.json (100%) rename src/test/resources/{mgmt => }/organization_connection.json (100%) rename src/test/resources/{mgmt => }/organization_connections_list.json (100%) rename src/test/resources/{mgmt => }/organization_connections_paged_list.json (100%) rename src/test/resources/{mgmt => }/organization_member_roles_list.json (100%) rename src/test/resources/{mgmt => }/organization_member_roles_paged_list.json (100%) rename src/test/resources/{mgmt => }/organization_members_checkpoint_paged_list.json (100%) rename src/test/resources/{mgmt => }/organization_members_list.json (100%) rename src/test/resources/{mgmt => }/organization_members_paged_list.json (100%) rename src/test/resources/{mgmt => }/organizations_checkpoint_paged_list.json (100%) rename src/test/resources/{mgmt => }/organizations_list.json (100%) rename src/test/resources/{mgmt => }/organizations_paged_list.json (100%) rename src/test/resources/{mgmt => }/partials_prompt.json (100%) rename src/test/resources/{mgmt => }/password_change_ticket.json (100%) rename src/test/resources/{mgmt => }/prompt.json (100%) rename src/test/resources/{mgmt => }/rate_limit_error.json (100%) rename src/test/resources/{mgmt => }/recovery_code.json (100%) rename src/test/resources/{mgmt => }/refresh_token.json (100%) rename src/test/resources/{mgmt => }/resource_server.json (100%) rename src/test/resources/{mgmt => }/resource_servers_list.json (100%) rename src/test/resources/{mgmt => }/resource_servers_paged_list.json (100%) rename src/test/resources/{mgmt => }/role.json (100%) rename src/test/resources/{mgmt => }/role_permissions_list.json (100%) rename src/test/resources/{mgmt => }/role_permissions_paged_list.json (100%) rename src/test/resources/{mgmt => }/role_users_checkpoint_paged_list.json (100%) rename src/test/resources/{mgmt => }/role_users_list.json (100%) rename src/test/resources/{mgmt => }/role_users_paged_list.json (100%) rename src/test/resources/{mgmt => }/roles_list.json (100%) rename src/test/resources/{mgmt => }/roles_paged_list.json (100%) rename src/test/resources/{mgmt => }/rotate_key.json (100%) rename src/test/resources/{mgmt => }/rule.json (100%) rename src/test/resources/{mgmt => }/rules_config.json (100%) rename src/test/resources/{mgmt => }/rules_configs_list.json (100%) rename src/test/resources/{mgmt => }/rules_list.json (100%) rename src/test/resources/{mgmt => }/rules_paged_list.json (100%) rename src/test/resources/{mgmt => }/scope.json (100%) rename src/test/resources/{mgmt => }/self_service_profile.json (100%) rename src/test/resources/{mgmt => }/self_service_profile_custom_text.json (100%) rename src/test/resources/{mgmt => }/self_service_profile_response.json (100%) rename src/test/resources/{mgmt => }/self_service_profile_sso_ticket.json (100%) rename src/test/resources/{mgmt => }/self_service_profile_sso_ticket_request.json (100%) rename src/test/resources/{mgmt => }/self_service_profiles_list.json (100%) rename src/test/resources/{mgmt => }/session.json (100%) rename src/test/resources/{mgmt => }/suspicious_ip_throttling_configuration.json (100%) rename src/test/resources/{mgmt => }/tenant.json (100%) rename src/test/resources/{mgmt => }/user.json (100%) rename src/test/resources/{mgmt => }/user_blocks.json (100%) rename src/test/resources/{mgmt => }/user_permissions_paged_list.json (100%) rename src/test/resources/{mgmt => }/user_refresh_tokens.json (100%) rename src/test/resources/{mgmt => }/user_roles_paged_list.json (100%) rename src/test/resources/{mgmt => }/user_sessions.json (100%) rename src/test/resources/{mgmt => }/users_list.json (100%) rename src/test/resources/{mgmt => }/users_paged_list.json (100%) create mode 100644 v3_MIGRATION_GUIDE.md diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..636b9669d2f733b03ff65e104e2d901bfd45b22b GIT binary patch literal 8196 zcmeHM%We}f6g^HWT1dr9Aa#Q@KR^oN2SPg|h*a8&0AdH3BxMnc!fCaz6 zzaa53tl(VR4W1-L>IPA9E!oH8+;i`pV<)a%0A_d6dkky?*kl#FU1zhR$mdd*O3jbl zBO3C79vV2t7#;Ssr~;~hDxeCe0;<5jr~vnDDVrDU`|eY1RRLAtzf?eeA0k%4rpK8> z`_sY39s!8!9JYmho&zi=^4Rn^b7-mb=}r&EQ;k1j7)R&lk(d*k9%l|69mdgNd}QNK zD8@!7FS6z^O^4d50;<5W0&;fWLW&7KAgi3;GxS?o-c7SSrHy>8zOpuc+QOdj_V64} zae!w?u#ZDx0|WG`Jo8|ISEuz`@?PMGtOV_qtWOK9YxA3hrOeEaKiT$*ZkFbGMjPA- zoiOZ(mlZkNKCz?(eH7K?YsU+&H!2=JR;~F`z?VRxdexc{Q(lgg3oH>fWNlEE7R5~{ zZ5v6|+R7PP-=&Z(O8=74U$J*c);m7GW&5ejbUdhjNz@$7mI8&erQyt`;(#^b0p?;oY7s$bOzYL8_JgPyEEW( z!RJ^emvx8YOUh$ADkDSkI!wE;uW({*VzRrQJtR*&9N7hVN^aMWbZAlH1dk}zDS1=N z4YND&+4+2bXFhF@hgm+9B`oiApWG*08kb%!wQpp9o=Zw!;!Ya73lnw!7eTbB0#`_Z zHJ9tQod1)H@BgpR8)>SlfGTiV1Y?D7%odsZo8H*;tyY$|^U@Ol0Z bL-r$@3a9CD=8z*SdJ$k{&_)&bs|x%Am*yA8 literal 0 HcmV?d00001 diff --git a/.fernignore b/.fernignore new file mode 100644 index 000000000..7a0eb63b9 --- /dev/null +++ b/.fernignore @@ -0,0 +1,94 @@ +# Specify files that shouldn't be modified by Fern + +# README should not be overwritten as it combines both SDKs +README.md + +# Examples and Migration Guide from auth0-real +EXAMPLES.md +v3_MIGRATION_GUIDE.md + +# Legacy management API from auth0-real +src/main/java/com/auth0/client/legacy/ + +# Authentication API (manually maintained from auth0-real) +src/main/java/com/auth0/client/auth/ +src/test/java/com/auth0/client/auth/ + +# Supporting packages from auth0-real +src/main/java/com/auth0/net/ +src/main/java/com/auth0/exception/ +src/main/java/com/auth0/utils/ +src/main/java/com/auth0/json/auth/ +src/main/java/com/auth0/json/mgmt/ +src/main/java/com/auth0/json/ObjectMapperProvider.java + +# Client options from auth0-real +src/main/java/com/auth0/client/HttpOptions.java +src/main/java/com/auth0/client/ProxyOptions.java +src/main/java/com/auth0/client/LoggingOptions.java + +# TokenProvider interface (shared between Fern-generated Management API and auth0-provided Authentication API) +src/main/java/com/auth0/client/mgmt/TokenProvider.java + +# Test infrastructure from auth0-real +src/test/java/com/auth0/net/ +src/test/java/com/auth0/exception/ +src/test/java/com/auth0/utils/ +src/test/java/com/auth0/json/ +src/test/resources/ +src/test/resources/auth/ +src/test/resources/keys/ +src/test/resources/mgmt/ +src/test/resources/mockito-extensions/ +src/test/java/com/auth0/client/legacy/ + +# Custom client builder and examples +src/main/java/com/auth0/client/Auth0ClientBuilder.java +src/main/java/com/auth0/client/ClientCredentialsTokenProvider.java +src/main/java/com/auth0/client/ManagementApiWithTokenProvider.java +src/main/java/com/auth0/client/TokenProvider.java +src/main/java/com/auth0/client/interceptors/ + +# Custom OAuth client credentials support +src/main/java/com/auth0/client/mgmt/core/RequestOptions.java +src/main/java/com/auth0/client/mgmt/core/ClientOptions.java +src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java +src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java + +# Custom tests +src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java +src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java + +# TEMPORARY: Wire tests with changes from generation +src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java +src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java +src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java +src/test/java/com/auth0/client/mgmt/StreamTest.java + +# TEMPORARY: Fixed query string mapper +src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java + +# TEMPORARY: Fixed to handle array response when include_totals is not set +src/main/java/com/auth0/client/mgmt/RawClientsClient.java +src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java + +# Configuration files from auth0-real +.codecov.yml +.editorconfig +.semgrepignore +.shiprc +.snyk +.version +opslevel.yml + +# GitHub workflows +.github/ + +# Build files and configs +gradle/ +gradlew +gradlew.bat +gradle.properties +settings.gradle +build.gradle +sample-app/ diff --git a/.gitignore b/.gitignore index c4a5be0b0..0d7e64f77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,122 +1,24 @@ -bin/ - -# Created by https://www.gitignore.io/api/java,gradle,osx,windows,intellij+iml - -### OSX ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon -# Thumbnails -._* -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Java ### *.class - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - - -### Gradle ### +.project .gradle -/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -# End of https://www.gitignore.io/api/java,gradle,osx,windows - - -### Intellij+iml ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/workspace.xml -.idea/tasks.xml - -# Sensitive or high-churn files: -.idea/ - -# Gradle: -.idea/gradle.xml -.idea/libraries - -# Mongo Explorer plugin: -.idea/mongoSettings.xml - -## File-based project format: -*.iws - -### Intellij+iml Patch ### -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - +? +.classpath +.checkstyle +.settings +.node +build + +# IntelliJ *.iml -modules.xml -.idea/misc.xml *.ipr -/out/ +*.iws +.idea/ +out/ -# End of https://www.gitignore.io/api/intellij+iml +# Eclipse/IntelliJ APT +generated_src/ +generated_testSrc/ +generated/ -# NetBeans IDE files -/.nb-gradle/ \ No newline at end of file +bin +build diff --git a/build.gradle b/build.gradle index 0cf814cb5..4585d933f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,160 +1,71 @@ -buildscript { - repositories { - jcenter() - } - - dependencies { - // https://github.com/melix/japicmp-gradle-plugin/issues/36 - classpath 'com.google.guava:guava:31.1-jre' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0" - } -} - - plugins { - id 'java' - id 'jacoco' - id 'me.champeau.gradle.japicmp' version '0.2.9' - id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' + id 'java-library' + id 'maven-publish' + id 'com.diffplug.spotless' version '6.11.0' + id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' } repositories { - mavenCentral() + mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/releases/' + } } -apply from: rootProject.file('gradle/versioning.gradle') - -version = getVersionFromFile() -group = GROUP -logger.lifecycle("Using version ${version} for ${name} group $group") - -jacocoTestReport { - reports { - xml.enabled = true - html.enabled = true - } +dependencies { + // Core dependencies + api 'com.squareup.okhttp3:okhttp:5.2.1' + api 'com.fasterxml.jackson.core:jackson-databind:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2' + + // Dependencies for legacy management code from auth0-real + implementation 'com.squareup.okhttp3:logging-interceptor:5.2.1' + implementation 'com.auth0:java-jwt:4.4.0' + implementation 'com.auth0:jwks-rsa:0.22.1' + implementation 'net.jodah:failsafe:2.4.4' + + // Test dependencies + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testImplementation 'org.mockito:mockito-core:4.11.0' + testImplementation 'com.squareup.okhttp3:mockwebserver:5.2.1' + testImplementation 'org.hamcrest:hamcrest:2.2' } java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } -} - -compileJava { - sourceCompatibility '1.8' - targetCompatibility '1.8' - - options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked" << "-Werror" -} - -compileTestJava { - options.compilerArgs << "-Xlint:deprecation" << "-Werror" + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } } -import me.champeau.gradle.japicmp.JapicmpTask - -project.afterEvaluate { - - def versions = project.ext.testInJavaVersions - for (pluginJavaTestVersion in versions) { - def taskName = "testInJava-${pluginJavaTestVersion}" - tasks.register(taskName, Test) { - def versionToUse = taskName.split("-").getAt(1) as Integer - description = "Runs unit tests on Java version ${versionToUse}." - project.logger.quiet("Test will be running in ${versionToUse}") - group = 'verification' - javaLauncher.set(javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of(versionToUse) - }) - shouldRunAfter(tasks.named('test')) - } - tasks.named('check') { - dependsOn(taskName) - } - } +sourceCompatibility = 1.8 +targetCompatibility = 1.8 - project.configure(project) { - def baselineVersion = project.ext.baselineCompareVersion - task('apiDiff', type: JapicmpTask, dependsOn: 'jar') { - oldClasspath = files(getBaselineJar(project, baselineVersion)) - newClasspath = files(jar.archiveFile) - onlyModified = true - failOnModification = true - ignoreMissingClasses = true - htmlOutputFile = file("$buildDir/reports/apiDiff/apiDiff.html") - txtOutputFile = file("$buildDir/reports/apiDiff/apiDiff.txt") - doLast { - project.logger.quiet("Comparing against baseline version ${baselineVersion}") - } - } - } +tasks.withType(Javadoc) { + failOnError false + options.addStringOption('Xdoclint:none', '-quiet') } -private static File getBaselineJar(Project project, String baselineVersion) { - // Use detached configuration: https://github.com/square/okhttp/blob/master/build.gradle#L270 - def group = project.group - try { - def baseline = "${project.group}:${project.name}:$baselineVersion" - project.group = 'virtual_group_for_japicmp' - def dependency = project.dependencies.create(baseline + "@jar") - return project.configurations.detachedConfiguration(dependency).files.find { - it.name == "${project.name}-${baselineVersion}.jar" - } - } finally { - project.group = group +spotless { + java { + palantirJavaFormat() } } -test { - testLogging { - events "skipped", "failed" - exceptionFormat "short" - } - useJUnitPlatform() -} +//java { +// withSourcesJar() +// withJavadocJar() +//} -ext { - okhttpVersion = '4.12.0' - hamcrestVersion = '2.2' - jupiterVersion = '5.9.3' - baselineCompareVersion = '2.0.0' - testInJavaVersions = [8, 11, 17, 21] +test { + useJUnitPlatform() + testLogging { + showStandardStreams = true + } } -dependencies { - // TODO remove direct dependency when OkHttp 4.12.0 is released - implementation ("com.squareup.okhttp3:okhttp:${okhttpVersion}") { - exclude group: 'com.squareup.okhttp3', module: 'okio' - exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib' - exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8' - } - implementation "com.squareup.okio:okio:3.5.0" - - implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0" - - implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}" - implementation "com.fasterxml.jackson.core:jackson-databind:2.15.0" - implementation "com.auth0:java-jwt:4.4.0" - implementation "net.jodah:failsafe:2.4.4" - - testImplementation "org.mockito:mockito-core:4.8.1" - testImplementation "com.squareup.okhttp3:mockwebserver:${okhttpVersion}" - testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}" - testImplementation "org.junit.jupiter:junit-jupiter-api:${jupiterVersion}" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}" - - // Override MockWebServer's junit transitive dependency to latest v4 - constraints { - testImplementation( group: 'junit', name: 'junit'){ - version{ - strictly "[4.13.2]" - } - } - } -} apply from: rootProject.file('gradle/maven-publish.gradle') diff --git a/gradle/maven-publish.gradle b/gradle/maven-publish.gradle index e458d769b..0b16478d5 100644 --- a/gradle/maven-publish.gradle +++ b/gradle/maven-publish.gradle @@ -35,7 +35,7 @@ publishing { groupId = GROUP artifactId = POM_ARTIFACT_ID - version = getVersionName() + version = project.version pom { name = POM_NAME diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f090a2944b7473328c07c9755baa3196..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch literal 43764 zcma&OWmKeVvL#I6?i3D%6z=Zs?ofE*?rw#G$eqJB ziT4y8-Y@s9rkH0Tz>ll(^xkcTl)CY?rS&9VNd66Yc)g^6)JcWaY(5$5gt z8gr3SBXUTN;~cBgz&})qX%#!Fxom2Yau_`&8)+6aSN7YY+pS410rRUU*>J}qL0TnJ zRxt*7QeUqTh8j)Q&iavh<}L+$Jqz))<`IfKussVk%%Ah-Ti?Eo0hQH!rK%K=#EAw0 zwq@@~XNUXRnv8$;zv<6rCRJ6fPD^hfrh;0K?n z=p!u^3xOgWZ%f3+?+>H)9+w^$Tn1e;?UpVMJb!!;f)`6f&4|8mr+g)^@x>_rvnL0< zvD0Hu_N>$(Li7|Jgu0mRh&MV+<}`~Wi*+avM01E)Jtg=)-vViQKax!GeDc!xv$^mL z{#OVBA$U{(Zr8~Xm|cP@odkHC*1R8z6hcLY#N@3E-A8XEvpt066+3t9L_6Zg6j@9Q zj$$%~yO-OS6PUVrM2s)(T4#6=JpI_@Uz+!6=GdyVU?`!F=d;8#ZB@(5g7$A0(`eqY z8_i@3w$0*es5mrSjhW*qzrl!_LQWs4?VfLmo1Sd@Ztt53+etwzAT^8ow_*7Jp`Y|l z*UgSEwvxq+FYO!O*aLf-PinZYne7Ib6ny3u>MjQz=((r3NTEeU4=-i0LBq3H-VJH< z^>1RE3_JwrclUn9vb7HcGUaFRA0QHcnE;6)hnkp%lY1UII#WPAv?-;c?YH}LWB8Nl z{sx-@Z;QxWh9fX8SxLZk8;kMFlGD3Jc^QZVL4nO)1I$zQwvwM&_!kW+LMf&lApv#< zur|EyC|U@5OQuph$TC_ZU`{!vJp`13e9alaR0Dbn5ikLFH7>eIz4QbV|C=%7)F=qo z_>M&5N)d)7G(A%c>}UCrW!Ql_6_A{?R7&CL`;!KOb3 z8Z=$YkV-IF;c7zs{3-WDEFJzuakFbd*4LWd<_kBE8~BFcv}js_2OowRNzWCtCQ6&k z{&~Me92$m*@e0ANcWKuz)?YjB*VoSTx??-3Cc0l2U!X^;Bv@m87eKHukAljrD54R+ zE;@_w4NPe1>3`i5Qy*3^E9x#VB6?}v=~qIprrrd5|DFkg;v5ixo0IsBmik8=Y;zv2 z%Bcf%NE$a44bk^`i4VwDLTbX=q@j9;JWT9JncQ!+Y%2&HHk@1~*L8-{ZpY?(-a9J-1~<1ltr9i~D9`P{XTIFWA6IG8c4;6bFw*lzU-{+?b&%OcIoCiw00n>A1ra zFPE$y@>ebbZlf(sN_iWBzQKDV zmmaLX#zK!@ZdvCANfwV}9@2O&w)!5gSgQzHdk2Q`jG6KD7S+1R5&F)j6QTD^=hq&7 zHUW+r^da^%V(h(wonR(j?BOiC!;y=%nJvz?*aW&5E87qq;2z`EI(f zBJNNSMFF9U{sR-af5{IY&AtoGcoG)Iq-S^v{7+t0>7N(KRoPj;+2N5;9o_nxIGjJ@ z7bYQK)bX)vEhy~VL%N6g^NE@D5VtV+Q8U2%{ji_=6+i^G%xeskEhH>Sqr194PJ$fB zu1y^){?9Vkg(FY2h)3ZHrw0Z<@;(gd_dtF#6y_;Iwi{yX$?asr?0N0_B*CifEi7<6 zq`?OdQjCYbhVcg+7MSgIM|pJRu~`g?g3x?Tl+V}#$It`iD1j+!x+!;wS0+2e>#g?Z z*EA^k7W{jO1r^K~cD#5pamp+o@8&yw6;%b|uiT?{Wa=4+9<}aXWUuL#ZwN1a;lQod zW{pxWCYGXdEq9qAmvAB904}?97=re$>!I%wxPV#|f#@A*Y=qa%zHlDv^yWbR03%V0 zprLP+b(#fBqxI%FiF*-n8HtH6$8f(P6!H3V^ysgd8de-N(@|K!A< z^qP}jp(RaM9kQ(^K(U8O84?D)aU(g?1S8iWwe)gqpHCaFlJxb*ilr{KTnu4_@5{K- z)n=CCeCrPHO0WHz)dDtkbZfUfVBd?53}K>C5*-wC4hpDN8cGk3lu-ypq+EYpb_2H; z%vP4@&+c2p;thaTs$dc^1CDGlPG@A;yGR5@$UEqk6p58qpw#7lc<+W(WR;(vr(D>W z#(K$vE#uBkT=*q&uaZwzz=P5mjiee6>!lV?c}QIX%ZdkO1dHg>Fa#xcGT6~}1*2m9 zkc7l3ItD6Ie~o_aFjI$Ri=C!8uF4!Ky7iG9QTrxVbsQroi|r)SAon#*B*{}TB-?=@ z8~jJs;_R2iDd!$+n$%X6FO&PYS{YhDAS+U2o4su9x~1+U3z7YN5o0qUK&|g^klZ6X zj_vrM5SUTnz5`*}Hyts9ADwLu#x_L=nv$Z0`HqN`Zo=V>OQI)fh01n~*a%01%cx%0 z4LTFVjmW+ipVQv5rYcn3;d2o4qunWUY!p+?s~X~(ost@WR@r@EuDOSs8*MT4fiP>! zkfo^!PWJJ1MHgKS2D_hc?Bs?isSDO61>ebl$U*9*QY(b=i&rp3@3GV@z>KzcZOxip z^dzA~44;R~cnhWz7s$$v?_8y-k!DZys}Q?4IkSyR!)C0j$(Gm|t#e3|QAOFaV2}36 z?dPNY;@I=FaCwylc_;~kXlZsk$_eLkNb~TIl8QQ`mmH&$*zwwR8zHU*sId)rxHu*K z;yZWa8UmCwju%aSNLwD5fBl^b0Ux1%q8YR*uG`53Mi<`5uA^Dc6Ync)J3N7;zQ*75)hf%a@{$H+%S?SGT)ks60)?6j$ zspl|4Ad6@%-r1t*$tT(en!gIXTUDcsj?28ZEzz)dH)SV3bZ+pjMaW0oc~rOPZP@g! zb9E+ndeVO_Ib9c_>{)`01^`ZS198 z)(t=+{Azi11$eu%aU7jbwuQrO`vLOixuh~%4z@mKr_Oc;F%Uq01fA)^W&y+g16e?rkLhTxV!EqC%2}sx_1u7IBq|}Be&7WI z4I<;1-9tJsI&pQIhj>FPkQV9{(m!wYYV@i5h?A0#BN2wqlEwNDIq06|^2oYVa7<~h zI_OLan0Do*4R5P=a3H9`s5*>xU}_PSztg`+2mv)|3nIy=5#Z$%+@tZnr> zLcTI!Mxa`PY7%{;KW~!=;*t)R_sl<^b>eNO@w#fEt(tPMg_jpJpW$q_DoUlkY|uo> z0-1{ouA#;t%spf*7VjkK&$QrvwUERKt^Sdo)5@?qAP)>}Y!h4(JQ!7{wIdkA+|)bv z&8hBwoX4v|+fie}iTslaBX^i*TjwO}f{V)8*!dMmRPi%XAWc8<_IqK1jUsApk)+~R zNFTCD-h>M5Y{qTQ&0#j@I@tmXGj%rzhTW5%Bkh&sSc=$Fv;M@1y!zvYG5P2(2|(&W zlcbR1{--rJ&s!rB{G-sX5^PaM@3EqWVz_y9cwLR9xMig&9gq(voeI)W&{d6j1jh&< zARXi&APWE1FQWh7eoZjuP z;vdgX>zep^{{2%hem;e*gDJhK1Hj12nBLIJoL<=0+8SVEBx7!4Ea+hBY;A1gBwvY<)tj~T=H`^?3>zeWWm|LAwo*S4Z%bDVUe z6r)CH1H!(>OH#MXFJ2V(U(qxD{4Px2`8qfFLG+=a;B^~Te_Z!r3RO%Oc#ZAHKQxV5 zRYXxZ9T2A%NVJIu5Pu7!Mj>t%YDO$T@M=RR(~mi%sv(YXVl`yMLD;+WZ{vG9(@P#e zMo}ZiK^7^h6TV%cG+;jhJ0s>h&VERs=tuZz^Tlu~%d{ZHtq6hX$V9h)Bw|jVCMudd zwZ5l7In8NT)qEPGF$VSKg&fb0%R2RnUnqa){)V(X(s0U zkCdVZe6wy{+_WhZh3qLp245Y2RR$@g-!9PjJ&4~0cFSHMUn=>dapv)hy}|y91ZWTV zCh=z*!S3_?`$&-eZ6xIXUq8RGl9oK0BJw*TdU6A`LJqX9eS3X@F)g$jLkBWFscPhR zpCv8#KeAc^y>>Y$k^=r|K(DTC}T$0#jQBOwB#@`P6~*IuW_8JxCG}J4va{ zsZzt}tt+cv7=l&CEuVtjD6G2~_Meh%p4RGuY?hSt?(sreO_F}8r7Kp$qQdvCdZnDQ zxzc*qchE*E2=WK)^oRNa>Ttj`fpvF-JZ5tu5>X1xw)J@1!IqWjq)ESBG?J|ez`-Tc zi5a}GZx|w-h%5lNDE_3ho0hEXMoaofo#Z;$8|2;EDF&*L+e$u}K=u?pb;dv$SXeQM zD-~7P0i_`Wk$#YP$=hw3UVU+=^@Kuy$>6?~gIXx636jh{PHly_a2xNYe1l60`|y!7 z(u%;ILuW0DDJ)2%y`Zc~hOALnj1~txJtcdD#o4BCT68+8gZe`=^te6H_egxY#nZH&P*)hgYaoJ^qtmpeea`35Fw)cy!w@c#v6E29co8&D9CTCl%^GV|X;SpneSXzV~LXyRn-@K0Df z{tK-nDWA!q38M1~`xUIt_(MO^R(yNY#9@es9RQbY@Ia*xHhD&=k^T+ zJi@j2I|WcgW=PuAc>hs`(&CvgjL2a9Rx zCbZyUpi8NWUOi@S%t+Su4|r&UoU|ze9SVe7p@f1GBkrjkkq)T}X%Qo1g!SQ{O{P?m z-OfGyyWta+UCXH+-+(D^%kw#A1-U;?9129at7MeCCzC{DNgO zeSqsV>W^NIfTO~4({c}KUiuoH8A*J!Cb0*sp*w-Bg@YfBIPZFH!M}C=S=S7PLLcIG zs7K77g~W)~^|+mx9onzMm0qh(f~OsDTzVmRtz=aZTllgR zGUn~_5hw_k&rll<4G=G+`^Xlnw;jNYDJz@bE?|r866F2hA9v0-8=JO3g}IHB#b`hy zA42a0>{0L7CcabSD+F7?pGbS1KMvT{@1_@k!_+Ki|5~EMGt7T%u=79F)8xEiL5!EJ zzuxQ`NBliCoJMJdwu|);zRCD<5Sf?Y>U$trQ-;xj6!s5&w=9E7)%pZ+1Nh&8nCCwM zv5>Ket%I?cxr3vVva`YeR?dGxbG@pi{H#8@kFEf0Jq6~K4>kt26*bxv=P&jyE#e$| zDJB_~imk^-z|o!2njF2hL*|7sHCnzluhJjwLQGDmC)Y9 zr9ZN`s)uCd^XDvn)VirMgW~qfn1~SaN^7vcX#K1G`==UGaDVVx$0BQnubhX|{e z^i0}>k-;BP#Szk{cFjO{2x~LjK{^Upqd&<+03_iMLp0$!6_$@TbX>8U-f*-w-ew1?`CtD_0y_Lo|PfKi52p?`5$Jzx0E8`M0 zNIb?#!K$mM4X%`Ry_yhG5k@*+n4||2!~*+&pYLh~{`~o(W|o64^NrjP?-1Lgu?iK^ zTX6u3?#$?R?N!{599vg>G8RGHw)Hx&=|g4599y}mXNpM{EPKKXB&+m?==R3GsIq?G zL5fH={=zawB(sMlDBJ+{dgb)Vx3pu>L=mDV0{r1Qs{0Pn%TpopH{m(By4;{FBvi{I z$}x!Iw~MJOL~&)p93SDIfP3x%ROjg}X{Sme#hiJ&Yk&a;iR}V|n%PriZBY8SX2*;6 z4hdb^&h;Xz%)BDACY5AUsV!($lib4>11UmcgXKWpzRL8r2Srl*9Y(1uBQsY&hO&uv znDNff0tpHlLISam?o(lOp#CmFdH<6HmA0{UwfU#Y{8M+7od8b8|B|7ZYR9f<#+V|ZSaCQvI$~es~g(Pv{2&m_rKSB2QQ zMvT}$?Ll>V+!9Xh5^iy3?UG;dF-zh~RL#++roOCsW^cZ&({6q|?Jt6`?S8=16Y{oH zp50I7r1AC1(#{b`Aq5cw>ypNggHKM9vBx!W$eYIzD!4KbLsZGr2o8>g<@inmS3*>J zx8oG((8f!ei|M@JZB`p7+n<Q}?>h249<`7xJ?u}_n;Gq(&km#1ULN87CeTO~FY zS_Ty}0TgQhV zOh3T7{{x&LSYGQfKR1PDIkP!WnfC1$l+fs@Di+d4O=eVKeF~2fq#1<8hEvpwuqcaH z4A8u~r^gnY3u6}zj*RHjk{AHhrrDqaj?|6GaVJbV%o-nATw}ASFr!f`Oz|u_QPkR# z0mDudY1dZRlk@TyQ?%Eti=$_WNFtLpSx9=S^be{wXINp%MU?a`F66LNU<c;0&ngifmP9i;bj6&hdGMW^Kf8e6ZDXbQD&$QAAMo;OQ)G zW(qlHh;}!ZP)JKEjm$VZjTs@hk&4{?@+NADuYrr!R^cJzU{kGc1yB?;7mIyAWwhbeA_l_lw-iDVi7wcFurf5 z#Uw)A@a9fOf{D}AWE%<`s1L_AwpZ?F!Vac$LYkp<#A!!`XKaDC{A%)~K#5z6>Hv@V zBEqF(D5?@6r3Pwj$^krpPDCjB+UOszqUS;b2n>&iAFcw<*im2(b3|5u6SK!n9Sg4I z0KLcwA6{Mq?p%t>aW0W!PQ>iUeYvNjdKYqII!CE7SsS&Rj)eIw-K4jtI?II+0IdGq z2WT|L3RL?;GtGgt1LWfI4Ka`9dbZXc$TMJ~8#Juv@K^1RJN@yzdLS8$AJ(>g!U9`# zx}qr7JWlU+&m)VG*Se;rGisutS%!6yybi%B`bv|9rjS(xOUIvbNz5qtvC$_JYY+c& za*3*2$RUH8p%pSq>48xR)4qsp!Q7BEiJ*`^>^6INRbC@>+2q9?x(h0bpc>GaNFi$K zPH$6!#(~{8@0QZk=)QnM#I=bDx5vTvjm$f4K}%*s+((H2>tUTf==$wqyoI`oxI7>C z&>5fe)Yg)SmT)eA(|j@JYR1M%KixxC-Eceknf-;N=jJTwKvk#@|J^&5H0c+%KxHUI z6dQbwwVx3p?X<_VRVb2fStH?HH zFR@Mp=qX%#L3XL)+$PXKV|o|#DpHAoqvj6uQKe@M-mnhCSou7Dj4YuO6^*V`m)1lf z;)@e%1!Qg$10w8uEmz{ENb$^%u}B;J7sDd zump}onoD#!l=agcBR)iG!3AF0-63%@`K9G(CzKrm$VJ{v7^O9Ps7Zej|3m= zVXlR&yW6=Y%mD30G@|tf=yC7-#L!16Q=dq&@beWgaIL40k0n% z)QHrp2Jck#evLMM1RGt3WvQ936ZC9vEje0nFMfvmOHVI+&okB_K|l-;|4vW;qk>n~ z+|kk8#`K?x`q>`(f6A${wfw9Cx(^)~tX7<#TpxR#zYG2P+FY~mG{tnEkv~d6oUQA+ z&hNTL=~Y@rF`v-RZlts$nb$3(OL1&@Y11hhL9+zUb6)SP!;CD)^GUtUpCHBE`j1te zAGud@miCVFLk$fjsrcpjsadP__yj9iEZUW{Ll7PPi<$R;m1o!&Xdl~R_v0;oDX2z^!&8}zNGA}iYG|k zmehMd1%?R)u6R#<)B)1oe9TgYH5-CqUT8N7K-A-dm3hbm_W21p%8)H{O)xUlBVb+iUR}-v5dFaCyfSd zC6Bd7=N4A@+Bna=!-l|*_(nWGDpoyU>nH=}IOrLfS+-d40&(Wo*dDB9nQiA2Tse$R z;uq{`X7LLzP)%Y9aHa4YQ%H?htkWd3Owv&UYbr5NUDAH^<l@Z0Cx%`N+B*i!!1u>D8%;Qt1$ zE5O0{-`9gdDxZ!`0m}ywH!;c{oBfL-(BH<&SQ~smbcobU!j49O^f4&IIYh~f+hK*M zZwTp%{ZSAhMFj1qFaOA+3)p^gnXH^=)`NTYgTu!CLpEV2NF=~-`(}7p^Eof=@VUbd z_9U|8qF7Rueg&$qpSSkN%%%DpbV?8E8ivu@ensI0toJ7Eas^jyFReQ1JeY9plb^{m z&eQO)qPLZQ6O;FTr*aJq=$cMN)QlQO@G&%z?BKUs1&I^`lq>=QLODwa`(mFGC`0H< zOlc*|N?B5&!U6BuJvkL?s1&nsi$*5cCv7^j_*l&$-sBmRS85UIrE--7eD8Gr3^+o? zqG-Yl4S&E;>H>k^a0GdUI(|n1`ws@)1%sq2XBdK`mqrNq_b4N{#VpouCXLzNvjoFv zo9wMQ6l0+FT+?%N(ka*;%m~(?338bu32v26!{r)|w8J`EL|t$}TA4q_FJRX5 zCPa{hc_I(7TGE#@rO-(!$1H3N-C0{R$J=yPCXCtGk{4>=*B56JdXU9cQVwB`6~cQZ zf^qK21x_d>X%dT!!)CJQ3mlHA@ z{Prkgfs6=Tz%63$6Zr8CO0Ak3A)Cv#@BVKr&aiKG7RYxY$Yx>Bj#3gJk*~Ps-jc1l z;4nltQwwT4@Z)}Pb!3xM?+EW0qEKA)sqzw~!C6wd^{03-9aGf3Jmt=}w-*!yXupLf z;)>-7uvWN4Unn8b4kfIza-X=x*e4n5pU`HtgpFFd))s$C@#d>aUl3helLom+RYb&g zI7A9GXLRZPl}iQS*d$Azxg-VgcUr*lpLnbPKUV{QI|bsG{8bLG<%CF( zMoS4pRDtLVYOWG^@ox^h8xL~afW_9DcE#^1eEC1SVSb1BfDi^@g?#f6e%v~Aw>@w- zIY0k+2lGWNV|aA*e#`U3=+oBDmGeInfcL)>*!w|*;mWiKNG6wP6AW4-4imN!W)!hE zA02~S1*@Q`fD*+qX@f3!2yJX&6FsEfPditB%TWo3=HA;T3o2IrjS@9SSxv%{{7&4_ zdS#r4OU41~GYMiib#z#O;zohNbhJknrPPZS6sN$%HB=jUnlCO_w5Gw5EeE@KV>soy z2EZ?Y|4RQDDjt5y!WBlZ(8M)|HP<0YyG|D%RqD+K#e7-##o3IZxS^wQ5{Kbzb6h(i z#(wZ|^ei>8`%ta*!2tJzwMv+IFHLF`zTU8E^Mu!R*45_=ccqI};Zbyxw@U%a#2}%f zF>q?SrUa_a4H9l+uW8JHh2Oob>NyUwG=QH~-^ZebU*R@67DcXdz2{HVB4#@edz?B< z5!rQH3O0>A&ylROO%G^fimV*LX7>!%re{_Sm6N>S{+GW1LCnGImHRoF@csnFzn@P0 zM=jld0z%oz;j=>c7mMwzq$B^2mae7NiG}%>(wtmsDXkWk{?BeMpTrIt3Mizq?vRsf zi_WjNp+61uV(%gEU-Vf0;>~vcDhe(dzWdaf#4mH3o^v{0EWhj?E?$5v02sV@xL0l4 zX0_IMFtQ44PfWBbPYN#}qxa%=J%dlR{O!KyZvk^g5s?sTNycWYPJ^FK(nl3k?z-5t z39#hKrdO7V(@!TU)LAPY&ngnZ1MzLEeEiZznn7e-jLCy8LO zu^7_#z*%I-BjS#Pg-;zKWWqX-+Ly$T!4`vTe5ZOV0j?TJVA*2?*=82^GVlZIuH%9s zXiV&(T(QGHHah=s&7e|6y?g+XxZGmK55`wGV>@1U)Th&=JTgJq>4mI&Av2C z)w+kRoj_dA!;SfTfkgMPO>7Dw6&1*Hi1q?54Yng`JO&q->^CX21^PrU^JU#CJ_qhV zSG>afB%>2fx<~g8p=P8Yzxqc}s@>>{g7}F!;lCXvF#RV)^fyYb_)iKVCz1xEq=fJ| z0a7DMCK*FuP=NM*5h;*D`R4y$6cpW-E&-i{v`x=Jbk_xSn@2T3q!3HoAOB`@5Vg6) z{PW|@9o!e;v1jZ2{=Uw6S6o{g82x6g=k!)cFSC*oemHaVjg?VpEmtUuD2_J^A~$4* z3O7HsbA6wxw{TP5Kk)(Vm?gKo+_}11vbo{Tp_5x79P~#F)ahQXT)tSH5;;14?s)On zel1J>1x>+7;g1Iz2FRpnYz;sD0wG9Q!vuzE9yKi3@4a9Nh1!GGN?hA)!mZEnnHh&i zf?#ZEN2sFbf~kV;>K3UNj1&vFhc^sxgj8FCL4v>EOYL?2uuT`0eDH}R zmtUJMxVrV5H{L53hu3#qaWLUa#5zY?f5ozIn|PkMWNP%n zWB5!B0LZB0kLw$k39=!akkE9Q>F4j+q434jB4VmslQ;$ zKiO#FZ`p|dKS716jpcvR{QJkSNfDVhr2%~eHrW;fU45>>snr*S8Vik-5eN5k*c2Mp zyxvX&_cFbB6lODXznHHT|rsURe2!swomtrqc~w5 zymTM8!w`1{04CBprR!_F{5LB+2_SOuZN{b*!J~1ZiPpP-M;);!ce!rOPDLtgR@Ie1 zPreuqm4!H)hYePcW1WZ0Fyaqe%l}F~Orr)~+;mkS&pOhP5Ebb`cnUt!X_QhP4_4p( z8YKQCDKGIy>?WIFm3-}Br2-N`T&FOi?t)$hjphB9wOhBXU#Hb+zm&We_-O)s(wc`2 z8?VsvU;J>Ju7n}uUb3s1yPx_F*|FlAi=Ge=-kN?1;`~6szP%$3B0|8Sqp%ebM)F8v zADFrbeT0cgE>M0DMV@_Ze*GHM>q}wWMzt|GYC%}r{OXRG3Ij&<+nx9;4jE${Fj_r* z`{z1AW_6Myd)i6e0E-h&m{{CvzH=Xg!&(bLYgRMO_YVd8JU7W+7MuGWNE=4@OvP9+ zxi^vqS@5%+#gf*Z@RVyU9N1sO-(rY$24LGsg1>w>s6ST^@)|D9>cT50maXLUD{Fzf zt~tp{OSTEKg3ZSQyQQ5r51){%=?xlZ54*t1;Ow)zLe3i?8tD8YyY^k%M)e`V*r+vL zPqUf&m)U+zxps+NprxMHF{QSxv}>lE{JZETNk1&F+R~bp{_T$dbXL2UGnB|hgh*p4h$clt#6;NO~>zuyY@C-MD@)JCc5XrYOt`wW7! z_ti2hhZBMJNbn0O-uTxl_b6Hm313^fG@e;RrhIUK9@# z+DHGv_Ow$%S8D%RB}`doJjJy*aOa5mGHVHz0e0>>O_%+^56?IkA5eN+L1BVCp4~m=1eeL zb;#G!#^5G%6Mw}r1KnaKsLvJB%HZL)!3OxT{k$Yo-XrJ?|7{s4!H+S2o?N|^Z z)+?IE9H7h~Vxn5hTis^3wHYuOU84+bWd)cUKuHapq=&}WV#OxHpLab`NpwHm8LmOo zjri+!k;7j_?FP##CpM+pOVx*0wExEex z@`#)K<-ZrGyArK;a%Km`^+We|eT+#MygHOT6lXBmz`8|lyZOwL1+b+?Z$0OhMEp3R z&J=iRERpv~TC=p2-BYLC*?4 zxvPs9V@g=JT0>zky5Poj=fW_M!c)Xxz1<=&_ZcL=LMZJqlnO1P^xwGGW*Z+yTBvbV z-IFe6;(k1@$1;tS>{%pXZ_7w+i?N4A2=TXnGf=YhePg8bH8M|Lk-->+w8Y+FjZ;L=wSGwxfA`gqSn)f(XNuSm>6Y z@|#e-)I(PQ^G@N`%|_DZSb4_pkaEF0!-nqY+t#pyA>{9^*I-zw4SYA1_z2Bs$XGUZbGA;VeMo%CezHK0lO={L%G)dI-+8w?r9iexdoB{?l zbJ}C?huIhWXBVs7oo{!$lOTlvCLZ_KN1N+XJGuG$rh<^eUQIqcI7^pmqhBSaOKNRq zrx~w^?9C?*&rNwP_SPYmo;J-#!G|{`$JZK7DxsM3N^8iR4vvn>E4MU&Oe1DKJvLc~ zCT>KLZ1;t@My zRj_2hI^61T&LIz)S!+AQIV23n1>ng+LUvzv;xu!4;wpqb#EZz;F)BLUzT;8UA1x*6vJ zicB!3Mj03s*kGV{g`fpC?V^s(=JG-k1EMHbkdP4P*1^8p_TqO|;!Zr%GuP$8KLxuf z=pv*H;kzd;P|2`JmBt~h6|GxdU~@weK5O=X&5~w$HpfO}@l-T7@vTCxVOwCkoPQv8 z@aV_)I5HQtfs7^X=C03zYmH4m0S!V@JINm6#(JmZRHBD?T!m^DdiZJrhKpBcur2u1 zf9e4%k$$vcFopK5!CC`;ww(CKL~}mlxK_Pv!cOsFgVkNIghA2Au@)t6;Y3*2gK=5d z?|@1a)-(sQ%uFOmJ7v2iG&l&m^u&^6DJM#XzCrF%r>{2XKyxLD2rgWBD;i(!e4InDQBDg==^z;AzT2z~OmV0!?Z z0S9pX$+E;w3WN;v&NYT=+G8hf=6w0E1$0AOr61}eOvE8W1jX%>&Mjo7&!ulawgzLH zbcb+IF(s^3aj12WSi#pzIpijJJzkP?JzRawnxmNDSUR#7!29vHULCE<3Aa#be}ie~d|!V+ z%l~s9Odo$G&fH!t!+`rUT0T9DulF!Yq&BfQWFZV1L9D($r4H(}Gnf6k3^wa7g5|Ws zj7%d`!3(0bb55yhC6@Q{?H|2os{_F%o=;-h{@Yyyn*V7?{s%Grvpe!H^kl6tF4Zf5 z{Jv1~yZ*iIWL_9C*8pBMQArfJJ0d9Df6Kl#wa}7Xa#Ef_5B7=X}DzbQXVPfCwTO@9+@;A^Ti6il_C>g?A-GFwA0#U;t4;wOm-4oS})h z5&on>NAu67O?YCQr%7XIzY%LS4bha9*e*4bU4{lGCUmO2UQ2U)QOqClLo61Kx~3dI zmV3*(P6F_Tr-oP%x!0kTnnT?Ep5j;_IQ^pTRp=e8dmJtI4YgWd0}+b2=ATkOhgpXe z;jmw+FBLE}UIs4!&HflFr4)vMFOJ19W4f2^W(=2)F%TAL)+=F>IE$=e=@j-*bFLSg z)wf|uFQu+!=N-UzSef62u0-C8Zc7 zo6@F)c+nZA{H|+~7i$DCU0pL{0Ye|fKLuV^w!0Y^tT$isu%i1Iw&N|tX3kwFKJN(M zXS`k9js66o$r)x?TWL}Kxl`wUDUpwFx(w4Yk%49;$sgVvT~n8AgfG~HUcDt1TRo^s zdla@6heJB@JV z!vK;BUMznhzGK6PVtj0)GB=zTv6)Q9Yt@l#fv7>wKovLobMV-+(8)NJmyF8R zcB|_K7=FJGGn^X@JdFaat0uhKjp3>k#^&xE_}6NYNG?kgTp>2Iu?ElUjt4~E-?`Du z?mDCS9wbuS%fU?5BU@Ijx>1HG*N?gIP+<~xE4u=>H`8o((cS5M6@_OK%jSjFHirQK zN9@~NXFx*jS{<|bgSpC|SAnA@I)+GB=2W|JJChLI_mx+-J(mSJ!b)uUom6nH0#2^(L@JBlV#t zLl?j54s`Y3vE^c_3^Hl0TGu*tw_n?@HyO@ZrENxA+^!)OvUX28gDSF*xFtQzM$A+O zCG=n#6~r|3zt=8%GuG} z<#VCZ%2?3Q(Ad#Y7GMJ~{U3>E{5e@z6+rgZLX{Cxk^p-7dip^d29;2N1_mm4QkASo z-L`GWWPCq$uCo;X_BmGIpJFBlhl<8~EG{vOD1o|X$aB9KPhWO_cKiU*$HWEgtf=fn zsO%9bp~D2c@?*K9jVN@_vhR03>M_8h!_~%aN!Cnr?s-!;U3SVfmhRwk11A^8Ns`@KeE}+ zN$H}a1U6E;*j5&~Og!xHdfK5M<~xka)x-0N)K_&e7AjMz`toDzasH+^1bZlC!n()crk9kg@$(Y{wdKvbuUd04N^8}t1iOgsKF zGa%%XWx@WoVaNC1!|&{5ZbkopFre-Lu(LCE5HWZBoE#W@er9W<>R=^oYxBvypN#x3 zq#LC8&q)GFP=5^-bpHj?LW=)-g+3_)Ylps!3^YQ{9~O9&K)xgy zMkCWaApU-MI~e^cV{Je75Qr7eF%&_H)BvfyKL=gIA>;OSq(y z052BFz3E(Prg~09>|_Z@!qj}@;8yxnw+#Ej0?Rk<y}4ghbD569B{9hSFr*^ygZ zr6j7P#gtZh6tMk6?4V$*Jgz+#&ug;yOr>=qdI#9U&^am2qoh4Jy}H2%a|#Fs{E(5r z%!ijh;VuGA6)W)cJZx+;9Bp1LMUzN~x_8lQ#D3+sL{be-Jyeo@@dv7XguJ&S5vrH` z>QxOMWn7N-T!D@1(@4>ZlL^y5>m#0!HKovs12GRav4z!>p(1~xok8+_{| z#Ae4{9#NLh#Vj2&JuIn5$d6t@__`o}umFo(n0QxUtd2GKCyE+erwXY?`cm*h&^9*8 zJ+8x6fRZI-e$CRygofIQN^dWysCxgkyr{(_oBwwSRxZora1(%(aC!5BTtj^+YuevI zx?)H#(xlALUp6QJ!=l9N__$cxBZ5p&7;qD3PsXRFVd<({Kh+mShFWJNpy`N@ab7?9 zv5=klvCJ4bx|-pvOO2-+G)6O?$&)ncA#Urze2rlBfp#htudhx-NeRnJ@u%^_bfw4o z4|{b8SkPV3b>Wera1W(+N@p9H>dc6{cnkh-sgr?e%(YkWvK+0YXVwk0=d`)}*47*B z5JGkEdVix!w7-<%r0JF~`ZMMPe;f0EQHuYHxya`puazyph*ZSb1mJAt^k4549BfS; zK7~T&lRb=W{s&t`DJ$B}s-eH1&&-wEOH1KWsKn0a(ZI+G!v&W4A*cl>qAvUv6pbUR z#(f#EKV8~hk&8oayBz4vaswc(?qw1vn`yC zZQDl2PCB-&Uu@g9ZQHhO+v(W0bNig{-k0;;`+wM@#@J)8r?qOYs#&vUna8ILxN7S{ zp1s41KnR8miQJtJtOr|+qk}wrLt+N*z#5o`TmD1)E&QD(Vh&pjZJ_J*0!8dy_ z>^=@v=J)C`x&gjqAYu`}t^S=DFCtc0MkBU2zf|69?xW`Ck~(6zLD)gSE{7n~6w8j_ zoH&~$ED2k5-yRa0!r8fMRy z;QjBYUaUnpd}mf%iVFPR%Dg9!d>g`01m~>2s))`W|5!kc+_&Y>wD@@C9%>-lE`WB0 zOIf%FVD^cj#2hCkFgi-fgzIfOi+ya)MZK@IZhHT5FVEaSbv-oDDs0W)pA0&^nM0TW zmgJmd7b1R7b0a`UwWJYZXp4AJPteYLH>@M|xZFKwm!t3D3&q~av?i)WvAKHE{RqpD{{%OhYkK?47}+}` zrR2(Iv9bhVa;cDzJ%6ntcSbx7v7J@Y4x&+eWSKZ*eR7_=CVIUSB$^lfYe@g+p|LD{ zPSpQmxx@b$%d!05|H}WzBT4_cq?@~dvy<7s&QWtieJ9)hd4)$SZz}#H2UTi$CkFWW|I)v_-NjuH!VypONC=1`A=rm_jfzQ8Fu~1r8i{q-+S_j$ z#u^t&Xnfi5tZtl@^!fUJhx@~Cg0*vXMK}D{>|$#T*+mj(J_@c{jXBF|rm4-8%Z2o! z2z0o(4%8KljCm^>6HDK!{jI7p+RAPcty_~GZ~R_+=+UzZ0qzOwD=;YeZt*?3%UGdr z`c|BPE;yUbnyARUl&XWSNJ<+uRt%!xPF&K;(l$^JcA_CMH6)FZt{>6ah$|(9$2fc~ z=CD00uHM{qv;{Zk9FR0~u|3|Eiqv9?z2#^GqylT5>6JNZwKqKBzzQpKU2_pmtD;CT zi%Ktau!Y2Tldfu&b0UgmF(SSBID)15*r08eoUe#bT_K-G4VecJL2Pa=6D1K6({zj6 za(2Z{r!FY5W^y{qZ}08+h9f>EKd&PN90f}Sc0ejf%kB4+f#T8Q1=Pj=~#pi$U zp#5rMR%W25>k?<$;$x72pkLibu1N|jX4cWjD3q^Pk3js!uK6h7!dlvw24crL|MZs_ zb%Y%?Fyp0bY0HkG^XyS76Ts*|Giw{31LR~+WU5NejqfPr73Rp!xQ1mLgq@mdWncLy z%8}|nzS4P&`^;zAR-&nm5f;D-%yNQPwq4N7&yULM8bkttkD)hVU>h>t47`{8?n2&4 zjEfL}UEagLUYwdx0sB2QXGeRmL?sZ%J!XM`$@ODc2!y|2#7hys=b$LrGbvvjx`Iqi z&RDDm3YBrlKhl`O@%%&rhLWZ*ABFz2nHu7k~3@e4)kO3%$=?GEFUcCF=6-1n!x^vmu+Ai*amgXH+Rknl6U>#9w;A} zn2xanZSDu`4%%x}+~FG{Wbi1jo@wqBc5(5Xl~d0KW(^Iu(U3>WB@-(&vn_PJt9{1`e9Iic@+{VPc`vP776L*viP{wYB2Iff8hB%E3|o zGMOu)tJX!`qJ}ZPzq7>=`*9TmETN7xwU;^AmFZ-ckZjV5B2T09pYliaqGFY|X#E-8 z20b>y?(r-Fn5*WZ-GsK}4WM>@TTqsxvSYWL6>18q8Q`~JO1{vLND2wg@58OaU!EvT z1|o+f1mVXz2EKAbL!Q=QWQKDZpV|jznuJ}@-)1&cdo z^&~b4Mx{*1gurlH;Vhk5g_cM&6LOHS2 zRkLfO#HabR1JD4Vc2t828dCUG#DL}f5QDSBg?o)IYYi@_xVwR2w_ntlpAW0NWk$F1 z$If?*lP&Ka1oWfl!)1c3fl`g*lMW3JOn#)R1+tfwrs`aiFUgz3;XIJ>{QFxLCkK30 zNS-)#DON3yb!7LBHQJ$)4y%TN82DC2-9tOIqzhZ27@WY^<6}vXCWcR5iN{LN8{0u9 zNXayqD=G|e?O^*ms*4P?G%o@J1tN9_76e}E#66mr89%W_&w4n66~R;X_vWD(oArwj z4CpY`)_mH2FvDuxgT+akffhX0b_slJJ*?Jn3O3~moqu2Fs1oL*>7m=oVek2bnprnW zixkaIFU%+3XhNA@@9hyhFwqsH2bM|`P?G>i<-gy>NflhrN{$9?LZ1ynSE_Mj0rADF zhOz4FnK}wpLmQuV zgO4_Oz9GBu_NN>cPLA=`SP^$gxAnj;WjJnBi%Q1zg`*^cG;Q)#3Gv@c^j6L{arv>- zAW%8WrSAVY1sj$=umcAf#ZgC8UGZGoamK}hR7j6}i8#np8ruUlvgQ$j+AQglFsQQq zOjyHf22pxh9+h#n$21&$h?2uq0>C9P?P=Juw0|;oE~c$H{#RGfa>| zj)Iv&uOnaf@foiBJ}_;zyPHcZt1U~nOcNB{)og8Btv+;f@PIT*xz$x!G?u0Di$lo7 zOugtQ$Wx|C($fyJTZE1JvR~i7LP{ zbdIwqYghQAJi9p}V&$=*2Azev$6K@pyblphgpv8^9bN!?V}{BkC!o#bl&AP!3DAjM zmWFsvn2fKWCfjcAQmE+=c3Y7j@#7|{;;0f~PIodmq*;W9Fiak|gil6$w3%b_Pr6K_ zJEG@&!J%DgBZJDCMn^7mk`JV0&l07Bt`1ymM|;a)MOWz*bh2#d{i?SDe9IcHs7 zjCrnyQ*Y5GzIt}>`bD91o#~5H?4_nckAgotN{2%!?wsSl|LVmJht$uhGa+HiH>;av z8c?mcMYM7;mvWr6noUR{)gE!=i7cZUY7e;HXa221KkRoc2UB>s$Y(k%NzTSEr>W(u z<(4mcc)4rB_&bPzX*1?*ra%VF}P1nwiP5cykJ&W{!OTlz&Td0pOkVp+wc z@k=-Hg=()hNg=Q!Ub%`BONH{ z_=ZFgetj@)NvppAK2>8r!KAgi>#%*7;O-o9MOOfQjV-n@BX6;Xw;I`%HBkk20v`qoVd0)}L6_49y1IhR z_OS}+eto}OPVRn*?UHC{eGyFU7JkPz!+gX4P>?h3QOwGS63fv4D1*no^6PveUeE5% zlehjv_3_^j^C({a2&RSoVlOn71D8WwMu9@Nb@=E_>1R*ve3`#TF(NA0?d9IR_tm=P zOP-x;gS*vtyE1Cm zG0L?2nRUFj#aLr-R1fX*$sXhad)~xdA*=hF3zPZhha<2O$Ps+F07w*3#MTe?)T8|A!P!v+a|ot{|^$q(TX`35O{WI0RbU zCj?hgOv=Z)xV?F`@HKI11IKtT^ocP78cqHU!YS@cHI@{fPD?YXL)?sD~9thOAv4JM|K8OlQhPXgnevF=F7GKD2#sZW*d za}ma31wLm81IZxX(W#A9mBvLZr|PoLnP>S4BhpK8{YV_}C|p<)4#yO{#ISbco92^3 zv&kCE(q9Wi;9%7>>PQ!zSkM%qqqLZW7O`VXvcj;WcJ`2~v?ZTYB@$Q&^CTfvy?1r^ z;Cdi+PTtmQwHX_7Kz?r#1>D zS5lWU(Mw_$B&`ZPmqxpIvK<~fbXq?x20k1~9az-Q!uR78mCgRj*eQ>zh3c$W}>^+w^dIr-u{@s30J=)1zF8?Wn|H`GS<=>Om|DjzC{}Jt?{!fSJe*@$H zg>wFnlT)k#T?LslW zu$^7Uy~$SQ21cE?3Ijl+bLfuH^U5P^$@~*UY#|_`uvAIe(+wD2eF}z_y!pvomuVO; zS^9fbdv)pcm-B@CW|Upm<7s|0+$@@<&*>$a{aW+oJ%f+VMO<#wa)7n|JL5egEgoBv zl$BY(NQjE0#*nv=!kMnp&{2Le#30b)Ql2e!VkPLK*+{jv77H7)xG7&=aPHL7LK9ER z5lfHxBI5O{-3S?GU4X6$yVk>lFn;ApnwZybdC-GAvaznGW-lScIls-P?Km2mF>%B2 zkcrXTk+__hj-3f48U%|jX9*|Ps41U_cd>2QW81Lz9}%`mTDIhE)jYI$q$ma7Y-`>% z8=u+Oftgcj%~TU}3nP8&h7k+}$D-CCgS~wtWvM|UU77r^pUw3YCV80Ou*+bH0!mf0 zxzUq4ed6y>oYFz7+l18PGGzhB^pqSt)si=9M>~0(Bx9*5r~W7sa#w+_1TSj3Jn9mW zMuG9BxN=}4645Cpa#SVKjFst;9UUY@O<|wpnZk$kE+to^4!?0@?Cwr3(>!NjYbu?x z1!U-?0_O?k!NdM^-rIQ8p)%?M+2xkhltt*|l=%z2WFJhme7*2xD~@zk#`dQR$6Lmd zb3LOD4fdt$Cq>?1<%&Y^wTWX=eHQ49Xl_lFUA(YQYHGHhd}@!VpYHHm=(1-O=yfK#kKe|2Xc*9}?BDFN zD7FJM-AjVi)T~OG)hpSWqH>vlb41V#^G2B_EvYlWhDB{Z;Q9-0)ja(O+By`31=biA zG&Fs#5!%_mHi|E4Nm$;vVQ!*>=_F;ZC=1DTPB#CICS5fL2T3XmzyHu?bI;m7D4@#; ztr~;dGYwb?m^VebuULtS4lkC_7>KCS)F@)0OdxZIFZp@FM_pHnJes8YOvwB|++#G( z&dm*OP^cz95Wi15vh`Q+yB>R{8zqEhz5of>Po$9LNE{xS<)lg2*roP*sQ}3r3t<}; zPbDl{lk{pox~2(XY5=qg0z!W-x^PJ`VVtz$git7?)!h>`91&&hESZy1KCJ2nS^yMH z!=Q$eTyRi68rKxdDsdt+%J_&lapa{ds^HV9Ngp^YDvtq&-Xp}60B_w@Ma>_1TTC;^ zpbe!#gH}#fFLkNo#|`jcn?5LeUYto%==XBk6Ik0kc4$6Z+L3x^4=M6OI1=z5u#M%0 z0E`kevJEpJjvvN>+g`?gtnbo$@p4VumliZV3Z%CfXXB&wPS^5C+7of2tyVkMwNWBiTE2 z8CdPu3i{*vR-I(NY5syRR}I1TJOV@DJy-Xmvxn^IInF>Tx2e)eE9jVSz69$6T`M9-&om!T+I znia!ZWJRB28o_srWlAxtz4VVft8)cYloIoVF=pL zugnk@vFLXQ_^7;%hn9x;Vq?lzg7%CQR^c#S)Oc-8d=q_!2ZVH764V z!wDKSgP}BrVV6SfCLZnYe-7f;igDs9t+K*rbMAKsp9L$Kh<6Z;e7;xxced zn=FGY<}CUz31a2G}$Q(`_r~75PzM4l_({Hg&b@d8&jC}B?2<+ed`f#qMEWi z`gm!STV9E4sLaQX+sp5Nu9*;9g12naf5?=P9p@H@f}dxYprH+3ju)uDFt^V{G0APn zS;16Dk{*fm6&BCg#2vo?7cbkkI4R`S9SSEJ=#KBk3rl69SxnCnS#{*$!^T9UUmO#&XXKjHKBqLdt^3yVvu8yn|{ zZ#%1CP)8t-PAz(+_g?xyq;C2<9<5Yy<~C74Iw(y>uUL$+$mp(DRcCWbCKiGCZw@?_ zdomfp+C5xt;j5L@VfhF*xvZdXwA5pcdsG>G<8II-|1dhAgzS&KArcb0BD4ZZ#WfiEY{hkCq5%z9@f|!EwTm;UEjKJsUo696V>h zy##eXYX}GUu%t{Gql8vVZKkNhQeQ4C%n|RmxL4ee5$cgwlU+?V7a?(jI#&3wid+Kz5+x^G!bb#$q>QpR#BZ}Xo5UW^ zD&I`;?(a}Oys7-`I^|AkN?{XLZNa{@27Dv^s4pGowuyhHuXc zuctKG2x0{WCvg_sGN^n9myJ}&FXyGmUQnW7fR$=bj$AHR88-q$D!*8MNB{YvTTEyS zn22f@WMdvg5~o_2wkjItJN@?mDZ9UUlat2zCh(zVE=dGi$rjXF7&}*sxac^%HFD`Y zTM5D3u5x**{bW!68DL1A!s&$2XG@ytB~dX-?BF9U@XZABO`a|LM1X3HWCllgl0+uL z04S*PX$%|^WAq%jkzp~%9HyYIF{Ym?k)j3nMwPZ=hlCg9!G+t>tf0o|J2%t1 ztC+`((dUplgm3`+0JN~}&FRRJ3?l*>Y&TfjS>!ShS`*MwO{WIbAZR#<%M|4c4^dY8 z{Rh;-!qhY=dz5JthbWoovLY~jNaw>%tS4gHVlt5epV8ekXm#==Po$)}mh^u*cE>q7*kvX&gq)(AHoItMYH6^s6f(deNw%}1=7O~bTHSj1rm2|Cq+3M z93djjdomWCTCYu!3Slx2bZVy#CWDozNedIHbqa|otsUl+ut?>a;}OqPfQA05Yim_2 zs@^BjPoFHOYNc6VbNaR5QZfSMh2S*`BGwcHMM(1@w{-4jVqE8Eu0Bi%d!E*^Rj?cR z7qgxkINXZR)K^=fh{pc0DCKtrydVbVILI>@Y0!Jm>x-xM!gu%dehm?cC6ok_msDVA*J#{75%4IZt}X|tIVPReZS#aCvuHkZxc zHVMtUhT(wp09+w9j9eRqz~LtuSNi2rQx_QgQ(}jBt7NqyT&ma61ldD(s9x%@q~PQl zp6N*?=N$BtvjQ_xIT{+vhb1>{pM0Arde0!X-y))A4znDrVx8yrP3B1(7bKPE5jR@5 zwpzwT4cu~_qUG#zYMZ_!2Tkl9zP>M%cy>9Y(@&VoB84#%>amTAH{(hL4cDYt!^{8L z645F>BWO6QaFJ-{C-i|-d%j7#&7)$X7pv#%9J6da#9FB5KyDhkA+~)G0^87!^}AP>XaCSScr;kL;Z%RSPD2CgoJ;gpYT5&6NUK$86$T?jRH=w8nI9Z534O?5fk{kd z`(-t$8W|#$3>xoMfXvV^-A(Q~$8SKDE^!T;J+rQXP71XZ(kCCbP%bAQ1|%$%Ov9_a zyC`QP3uPvFoBqr_+$HenHklqyIr>PU_Fk5$2C+0eYy^~7U&(!B&&P2%7#mBUhM!z> z_B$Ko?{Pf6?)gpYs~N*y%-3!1>o-4;@1Zz9VQHh)j5U1aL-Hyu@1d?X;jtDBNk*vMXPn@ z+u@wxHN*{uHR!*g*4Xo&w;5A+=Pf9w#PeZ^x@UD?iQ&${K2c}UQgLRik-rKM#Y5rdDphdcNTF~cCX&9ViRP}`>L)QA4zNXeG)KXFzSDa6 zd^St;inY6J_i=5mcGTx4_^Ys`M3l%Q==f>{8S1LEHn{y(kbxn5g1ezt4CELqy)~TV6{;VW>O9?5^ ztcoxHRa0jQY7>wwHWcxA-BCwzsP>63Kt&3fy*n#Cha687CQurXaRQnf5wc9o8v7Rw zNwGr2fac;Wr-Ldehn7tF^(-gPJwPt@VR1f;AmKgxN&YPL;j=0^xKM{!wuU|^mh3NE zy35quf}MeL!PU;|{OW_x$TBothLylT-J>_x6p}B_jW1L>k)ps6n%7Rh z96mPkJIM0QFNYUM2H}YF5bs%@Chs6#pEnloQhEl?J-)es!(SoJpEPoMTdgA14-#mC zghayD-DJWtUu`TD8?4mR)w5E`^EHbsz2EjH5aQLYRcF{l7_Q5?CEEvzDo(zjh|BKg z3aJl_n#j&eFHsUw4~lxqnr!6NL*se)6H=A+T1e3xUJGQrd}oSPwSy5+$tt{2t5J5@(lFxl43amsARG74iyNC}uuS zd2$=(r6RdamdGx^eatX@F2D8?U23tDpR+Os?0Gq2&^dF+$9wiWf?=mDWfjo4LfRwL zI#SRV9iSz>XCSgEj!cW&9H-njJopYiYuq|2w<5R2!nZ27DyvU4UDrHpoNQZiGPkp@ z1$h4H46Zn~eqdj$pWrv;*t!rTYTfZ1_bdkZmVVIRC21YeU$iS-*XMNK`#p8Z_DJx| zk3Jssf^XP7v0X?MWFO{rACltn$^~q(M9rMYoVxG$15N;nP)A98k^m3CJx8>6}NrUd@wp-E#$Q0uUDQT5GoiK_R{ z<{`g;8s>UFLpbga#DAf%qbfi`WN1J@6IA~R!YBT}qp%V-j!ybkR{uY0X|x)gmzE0J z&)=eHPjBxJvrZSOmt|)hC+kIMI;qgOnuL3mbNR0g^<%|>9x7>{}>a2qYSZAGPt4it?8 zNcLc!Gy0>$jaU?}ZWxK78hbhzE+etM`67*-*x4DN>1_&{@5t7_c*n(qz>&K{Y?10s zXsw2&nQev#SUSd|D8w7ZD2>E<%g^; zV{yE_O}gq?Q|zL|jdqB^zcx7vo(^})QW?QKacx$yR zhG|XH|8$vDZNIfuxr-sYFR{^csEI*IM#_gd;9*C+SysUFejP0{{z7@P?1+&_o6=7V|EJLQun^XEMS)w(=@eMi5&bbH*a0f;iC~2J74V2DZIlLUHD&>mlug5+v z6xBN~8-ovZylyH&gG#ptYsNlT?-tzOh%V#Y33zlsJ{AIju`CjIgf$@gr8}JugRq^c zAVQ3;&uGaVlVw}SUSWnTkH_6DISN&k2QLMBe9YU=sA+WiX@z)FoSYX`^k@B!j;ZeC zf&**P?HQG6Rk98hZ*ozn6iS-dG}V>jQhb3?4NJB*2F?6N7Nd;EOOo;xR7acylLaLy z9)^lykX39d@8@I~iEVar4jmjjLWhR0d=EB@%I;FZM$rykBNN~jf>#WbH4U{MqhhF6 zU??@fSO~4EbU4MaeQ_UXQcFyO*Rae|VAPLYMJEU`Q_Q_%s2*>$#S^)&7er+&`9L=1 z4q4ao07Z2Vsa%(nP!kJ590YmvrWg+YrgXYs_lv&B5EcoD`%uL79WyYA$0>>qi6ov7 z%`ia~J^_l{p39EY zv>>b}Qs8vxsu&WcXEt8B#FD%L%ZpcVtY!rqVTHe;$p9rbb5O{^rFMB>auLn-^;s+-&P1#h~mf~YLg$8M9 zZ4#87;e-Y6x6QO<{McUzhy(%*6| z)`D~A(TJ$>+0H+mct(jfgL4x%^oC^T#u(bL)`E2tBI#V1kSikAWmOOYrO~#-cc_8! zCe|@1&mN2{*ceeiBldHCdrURk4>V}79_*TVP3aCyV*5n@jiNbOm+~EQ_}1#->_tI@ zqXv+jj2#8xJtW508rzFrYcJxoek@iW6SR@1%a%Bux&;>25%`j3UI`0DaUr7l79`B1 zqqUARhW1^h6=)6?;@v>xrZNM;t}{yY3P@|L}ey@gG( z9r{}WoYN(9TW&dE2dEJIXkyHA4&pU6ki=rx&l2{DLGbVmg4%3Dlfvn!GB>EVaY_%3+Df{fBiqJV>~Xf8A0aqUjgpa} zoF8YXO&^_x*Ej}nw-$-F@(ddB>%RWoPUj?p8U{t0=n>gAI83y<9Ce@Q#3&(soJ{64 z37@Vij1}5fmzAuIUnXX`EYe;!H-yTVTmhAy;y8VZeB#vD{vw9~P#DiFiKQ|kWwGFZ z=jK;JX*A;Jr{#x?n8XUOLS;C%f|zj-7vXtlf_DtP7bpurBeX%Hjwr z4lI-2TdFpzkjgiv!8Vfv`=SP+s=^i3+N~1ELNWUbH|ytVu>EyPN_3(4TM^QE1swRo zoV7Y_g)a>28+hZG0e7g%@2^s>pzR4^fzR-El}ARTmtu!zjZLuX%>#OoU3}|rFjJg} zQ2TmaygxJ#sbHVyiA5KE+yH0LREWr%^C*yR|@gM$nK2P zo}M}PV0v))uJh&33N>#aU376@ZH79u(Yw`EQ2hM3SJs9f99+cO6_pNW$j$L-CtAfe zYfM)ccwD!P%LiBk!eCD?fHCGvgMQ%Q2oT_gmf?OY=A>&PaZQOq4eT=lwbaf}33LCH zFD|)lu{K7$8n9gX#w4~URjZxWm@wlH%oL#G|I~Fb-v^0L0TWu+`B+ZG!yII)w05DU z>GO?n(TN+B=>HdxVDSlIH76pta$_LhbBg;eZ`M7OGcqt||qi zogS72W1IN%=)5JCyOHWoFP7pOFK0L*OAh=i%&VW&4^LF@R;+K)t^S!96?}^+5QBIs zjJNTCh)?)4k^H^g1&jc>gysM`y^8Rm3qsvkr$9AeWwYpa$b22=yAd1t<*{ zaowSEFP+{y?Ob}8&cwfqoy4Pb9IA~VnM3u!trIK$&&0Op#Ql4j>(EW?UNUv#*iH1$ z^j>+W{afcd`{e&`-A{g}{JnIzYib)!T56IT@YEs{4|`sMpW3c8@UCoIJv`XsAw!XC z34|Il$LpW}CIHFC5e*)}00I5{%OL*WZRGzC0?_}-9{#ue?-ug^ zLE|uv-~6xnSs_2_&CN9{9vyc!Xgtn36_g^wI0C4s0s^;8+p?|mm;Odt3`2ZjwtK;l zfd6j)*Fr#53>C6Y8(N5?$H0ma;BCF3HCjUs7rpb2Kf*x3Xcj#O8mvs#&33i+McX zQpBxD8!O{5Y8D&0*QjD=Yhl9%M0)&_vk}bmN_Ud^BPN;H=U^bn&(csl-pkA+GyY0Z zKV7sU_4n;}uR78ouo8O%g*V;79KY?3d>k6%gpcmQsKk&@Vkw9yna_3asGt`0Hmj59 z%0yiF*`jXhByBI9QsD=+>big5{)BGe&+U2gAARGe3ID)xrid~QN_{I>k}@tzL!Md_ z&=7>TWciblF@EMC3t4-WX{?!m!G6$M$1S?NzF*2KHMP3Go4=#ZHkeIv{eEd;s-yD# z_jU^Ba06TZqvV|Yd;Z_sN%$X=!T+&?#p+OQIHS%!LO`Hx0q_Y0MyGYFNoM{W;&@0@ zLM^!X4KhdtsET5G<0+|q0oqVXMW~-7LW9Bg}=E$YtNh1#1D^6Mz(V9?2g~I1( zoz9Cz=8Hw98zVLwC2AQvp@pBeKyidn6Xu0-1SY1((^Hu*-!HxFUPs)yJ+i`^BC>PC zjwd0mygOVK#d2pRC9LxqGc6;Ui>f{YW9Bvb>33bp^NcnZoH~w9(lM5@JiIlfa-6|k ziy31UoMN%fvQfhi8^T+=yrP{QEyb-jK~>$A4SZT-N56NYEbpvO&yUme&pWKs3^94D zH{oXnUTb3T@H+RgzML*lejx`WAyw*?K7B-I(VJx($2!NXYm%3`=F~TbLv3H<{>D?A zJo-FDYdSA-(Y%;4KUP2SpHKAIcv9-ld(UEJE7=TKp|Gryn;72?0LHqAN^fk6%8PCW z{g_-t)G5uCIf0I`*F0ZNl)Z>))MaLMpXgqWgj-y;R+@A+AzDjsTqw2Mo9ULKA3c70 z!7SOkMtZb+MStH>9MnvNV0G;pwSW9HgP+`tg}e{ij0H6Zt5zJ7iw`hEnvye!XbA@!~#%vIkzowCOvq5I5@$3wtc*w2R$7!$*?}vg4;eDyJ_1=ixJuEp3pUS27W?qq(P^8$_lU!mRChT}ctvZz4p!X^ zOSp|JOAi~f?UkwH#9k{0smZ7-#=lK6X3OFEMl7%)WIcHb=#ZN$L=aD`#DZKOG4p4r zwlQ~XDZ`R-RbF&hZZhu3(67kggsM-F4Y_tI^PH8PMJRcs7NS9ogF+?bZB*fcpJ z=LTM4W=N9yepVvTj&Hu~0?*vR1HgtEvf8w%Q;U0^`2@e8{SwgX5d(cQ|1(!|i$km! zvY03MK}j`sff;*-%mN~ST>xU$6Bu?*Hm%l@0dk;j@%>}jsgDcQ)Hn*UfuThz9(ww_ zasV`rSrp_^bp-0sx>i35FzJwA!d6cZ5#5#nr@GcPEjNnFHIrtUYm1^Z$;{d&{hQV9 z6EfFHaIS}46p^5I-D_EcwwzUUuO}mqRh&T7r9sfw`)G^Q%oHxEs~+XoM?8e*{-&!7 z7$m$lg9t9KP9282eke608^Q2E%H-xm|oJ8=*SyEo} z@&;TQ3K)jgspgKHyGiKVMCz>xmC=H5Fy3!=TP)-R3|&1S-B)!6q50wfLHKM@7Bq6E z44CY%G;GY>tC`~yh!qv~YdXw! zSkquvYNs6k1r7>Eza?Vkkxo6XRS$W7EzL&A`o>=$HXgBp{L(i^$}t`NcnAxzbH8Ht z2!;`bhKIh`f1hIFcI5bHI=ueKdzmB9)!z$s-BT4ItyY|NaA_+o=jO%MU5as9 zc2)aLP>N%u>wlaXTK!p)r?+~)L+0eCGb5{8WIk7K52$nufnQ+m8YF+GQc&{^(zh-$ z#wyWV*Zh@d!b(WwXqvfhQX)^aoHTBkc;4ossV3&Ut*k>AI|m+{#kh4B!`3*<)EJVj zwrxK>99v^k4&Y&`Awm>|exo}NvewV%E+@vOc>5>%H#BK9uaE2$vje zWYM5fKuOTtn96B_2~~!xJPIcXF>E_;yO8AwpJ4)V`Hht#wbO3Ung~@c%%=FX4)q+9 z99#>VC2!4l`~0WHs9FI$Nz+abUq# zz`Of97})Su=^rGp2S$)7N3rQCj#0%2YO<R&p>$<#lgXcUj=4H_{oAYiT3 z44*xDn-$wEzRw7#@6aD)EGO$0{!C5Z^7#yl1o;k0PhN=aVUQu~eTQ^Xy{z8Ow6tk83 z4{5xe%(hx)%nD&|e*6sTWH`4W&U!Jae#U4TnICheJmsw{l|CH?UA{a6?2GNgpZLyzU2UlFu1ZVwlALmh_DOs03J^Cjh1im`E3?9&zvNmg(MuMw&0^Lu$(#CJ*q6DjlKsY-RMJ^8yIY|{SQZ*9~CH|u9L z`R78^r=EbbR*_>5?-)I+$6i}G)%mN(`!X72KaV(MNUP7Nv3MS9S|Pe!%N2AeOt5zG zVJ;jI4HZ$W->Ai_4X+`9c(~m=@ek*m`ZQbv3ryI-AD#AH=`x$~WeW~M{Js57(K7(v ze5`};LG|%C_tmd>bkufMWmAo&B+DT9ZV~h(4jg0>^aeAqL`PEUzJJtI8W1M!bQWpv zvN(d}E1@nlYa!L!!A*RN!(Q3F%J?5PvQ0udu?q-T)j3JKV~NL>KRb~w-lWc685uS6 z=S#aR&B8Sc8>cGJ!!--?kwsJTUUm`Jk?7`H z7PrO~xgBrSW2_tTlCq1LH8*!o?pj?qxy8}(=r_;G18POrFh#;buWR0qU24+XUaVZ0 z?(sXcr@-YqvkCmHr{U2oPogHL{r#3r49TeR<{SJX1pcUqyWPrkYz^X8#QW~?F)R5i z>p^!i<;qM8Nf{-fd6!_&V*e_9qP6q(s<--&1Ttj01j0w>bXY7y1W*%Auu&p|XSOH=)V7Bd4fUKh&T1)@cvqhuD-d=?w}O zjI%i(f|thk0Go*!d7D%0^ztBfE*V=(ZIN84f5HU}T9?ulmEYzT5usi=DeuI*d|;M~ zp_=Cx^!4k#=m_qSPBr5EK~E?3J{dWWPH&oCcNepYVqL?nh4D5ynfWip$m*YlZ8r^Z zuFEUL-nW!3qjRCLIWPT0x)FDL7>Yt7@8dA?R2kF@WE>ysMY+)lTsgNM#3VbXVGL}F z1O(>q>2a+_`6r5Xv$NZAnp=Kgnr3)cL(^=8ypEeOf3q8(HGe@7Tt59;yFl||w|mnO zHDxg2G3z8=(6wjj9kbcEY@Z0iOd7Gq5GiPS5% z*sF1J<#daxDV2Z8H>wxOF<;yKzMeTaSOp_|XkS9Sfn6Mpe9UBi1cSTieGG5$O;ZLIIJ60Y>SN4vC?=yE_CWlo(EEE$e4j?z&^FM%kNmRtlbEL^dPPgvs9sbK5fGw*r@ z+!EU@u$T8!nZh?Fdf_qk$VuHk^yVw`h`_#KoS*N%epIIOfQUy_&V}VWDGp3tplMbf z5Se1sJUC$7N0F1-9jdV2mmGK{-}fu|Nv;12jDy0<-kf^AmkDnu6j~TPWOgy1MT68|D z=4=50jVbUKdKaQgD`eWGr3I&^<6uhkjz$YwItY8%Yp9{z4-{6g{73<_b*@XJ4Nm3-3z z?BW3{aY_ccRjb@W1)i5nLg|7BnWS!B`_Uo9CWaE`Ij327QH?i)9A}4Ug4wmxVVa^b z-4+m%-wwOl7cKH7+=x&nrCrbEC)Q$fpg&V83#uEH;C=GNMz`ps@^RxK%T*8%OPnC` z{WO~J%nxYJ`x|N%?&i7?;{_8t^jM&=50HlaOQj8fS}_`moH$c;vI<|cruPFnpT8yU zS%rPOCUSd5Zdb(zwk`hqwTQn)*&n)uYsP*F_(~xEWq}C= zv30kFmZFwJZ@ELVX3?$dXQh|icO7UrL*_5G=I^xXjImz`ZPp>?g#tf(ej~KaIU0algsG!IS09;>?MvqGg#c{i+}qY|{P8W~O%#>|gFd z<1dr$-oxyRGN17yZo1OwLnzwYs0|;IS_nymNB0IlSzPQ%-r`?T=;_XQ^~&#}b|AB} zkNbN5uB?-sUB-T5QLlg%Uk3)uHB;>VIzGe9_J9 zaeISkQm!v(9d(0ML^b9fR^sfHFlH?7Mvddt37OuR{|O0{uv)(&-6<87W4 zyO>s!=cPgP3O&7xxU5DlIPw_o3O>6o6Qb?JWs3qw#p3sBc3g$?Dx zi(6D+DYgV;GrUis-CL%Qe{nvZnwaVXmbhH(|GFh|Q)k=1uvA$I@1DXI7bKlQ@8D6P zS?(*?><>)G49q0wr;NajpxP4W2G)kHl6^=Z>hrNEI4Mwd_$O6$1dXF;Q#hE(-eeW6 zz03GJF%Wl?HO=_ztv5*zRlcU~{+{k%#N59mgm~eK>P!QZ6E?#Cu^2)+K8m@ySvZ*5 z|HDT}BkF@3!l(0%75G=1u2hETXEj!^1Z$!)!lyGXlWD!_vqGE$Z)#cUVBqlORW>0^ zDjyVTxwKHKG|0}j-`;!R-p>}qQfBl(?($7pP<+Y8QE#M8SCDq~k<+>Q^Zf@cT_WdX3~BSe z+|KK|7OL5Hm5(NFP~j>Ct3*$wi0n0!xl=(C61`q&cec@mFlH(sy%+RH<=s)8aAPN`SfJdkAQjdv82G5iRdv8 zh{9wHUZaniSEpslXl^_ODh}mypC?b*9FzLjb~H@3DFSe;D(A-K3t3eOTB(m~I6C;(-lKAvit(70k`%@+O*Ztdz;}|_TS~B?Tpmi=QKC^m_ z2YpEaT3iiz*;T~ap1yiA)a`dKMwu`^UhIUeltNQ1Yjo=q@bI@&3zH?rVUg=IxLy-ni zyxDu%-Fr{H6owTjZU2O5>nDb=q&Jz_TjeSq%!2m40x&U6w~GQ({quPL73IsJS;f`$ zsuhioqCBj(gJ>2hoo)Gou7(WP*pX)f=Y=!=k!&1K?EYY%jJ~X&DnK{^saPQK<1BJ z_A`_{%ZozcB(3w$z^To^6d|XuT@=X~wtW!+{4ID@N{AB~J6AL5vuY>JwvWCNFKsKh zd}@>q@_WV#QZ&UJ0#?X(pXR!oyXOEG3rqzHbCzGLONDb042i$})fM@XF)uSP(DHUc z^&{|$*xe{cs?Gp8=B%RY3L7#$ve$?TWh>MZdxF1zH1v}1z+$Ov#G7?%D)bBCyDe*% zSeKSpETC2V1){II>@UwJi>4uBN+iAx+82E~gb|Cr&8E^i&)A!uv-g?jzH99wU}8+# z$nh>yvb;TwZmS@7LrvuCu_d0-WxFNI&C7%sWuTL%YU!l|I1{|->=dlOeHOCtUO#zkS3ESO8LHV4hTdQL5EdV zuWD33fFPH}HPrW^s$Qn1Xgp&AT6<-He{{4%eIu3rN=iK|9mURdKXfB&Q?qGok%!cs ze53UP{Z!TO-Y@q2;;k2avA3`lm4OoN4@S*k=UA)7H;qZ`d8`XaYFCv?Ba+uGW@r5v z&&{nf(24WSBOhc7!qF^@0cz;XcUynNaj6w2349;s!K{KVqs5yS{ z7VubS`2OzT^5#1~6Tt^RTvt9-J|D2F>y~>2;jeF>g`hx5l%B3H=aLExQihuYngzlnBTYOTHJQMzl>kwqN5JYs)Ej zblA@ntkUS~xi+}y6|(81helS}Q~&VB37qyV|S3Y=><^1wh%msQM?fz z<58MX(=|PSUKCF#)dbhR%D&xgCD?$aR0qen+wpp6 zst}vX18!Be96TD??j1HsHTUx(a&@F?=gT`Q$oJFFyrh^;zgz!(NlAHGn0cJy@us=w zNhC#l5G;H}+>49Nsh12=ZPO2r*2OBQe5kpb&1?*PIBFitK8}FUfb~S-#hKfF0o#&d z#3aPkB$9scYku&kA6{0xHnBV#&Wei5J>5T-XX-gUXEPo+9b7WL=*XESc(3BshL`aj zXp}QIp*40}oWJt*l043e8_5;H5PI5c)U&IEw5dF(4zjX0y_lk9 zAp@!mK>WUqHo)-jop=DoK>&no>kAD=^qIE7qis&_*4~ z6q^EF$D@R~3_xseCG>Ikb6Gfofb$g|75PPyyZN&tiRxqovo_k zO|HA|sgy#B<32gyU9x^&)H$1jvw@qp+1b(eGAb)O%O!&pyX@^nQd^9BQ4{(F8<}|A zhF&)xusQhtoXOOhic=8#Xtt5&slLia3c*a?dIeczyTbC#>FTfiLST57nc3@Y#v_Eg#VUv zT8cKH#f3=1PNj!Oroz_MAR*pow%Y0*6YCYmUy^7`^r|j23Q~^*TW#cU7CHf0eAD_0 zEWEVddxFgQ7=!nEBQ|ibaScslvhuUk^*%b#QUNrEB{3PG@uTxNwW}Bs4$nS9wc(~O zG7Iq>aMsYkcr!9#A;HNsJrwTDYkK8ikdj{M;N$sN6BqJ<8~z>T20{J8Z2rRUuH7~3 z=tgS`AgxbBOMg87UT4Lwge`*Y=01Dvk>)^{Iu+n6fuVX4%}>?3czOGR$0 zpp*wp>bsFFSV`V;r_m+TZns$ZprIi`OUMhe^cLE$2O+pP3nP!YB$ry}2THx2QJs3< za1;>d-AggCarrQ>&Z!d@;mW+!q6eXhb&`GbzUDSxpl8AJ#Cm#tuc)_xh(2NV=5XMs zrf_ozRYO$NkC=pKFX5OH8v1>0i9Z$ec`~Mf+_jQ68spn(CJwclDhEEkH2Qw;${J$clv__nUjn5jA0wCLEnu1j;v!0vB>Ri6m9`;R{JMS%^)4FC zU0Z44+u$I$w=Bj|iu4DT5h~sS`C*zbmX?@-crY}E+hy>}2~C0Nn(EKk@5^qO4@l@! z6O0lr%tzGC`D^)8xU3FnMZVm0kX1sBWhaQyzVoXFWwr%Ny?=2M{5s#5i7fTu3gEkG zc{(Pr$v=;`Y#&`y*J}#M9ux>0?xu!`$9cUKm#Bdd_&S#LPTS?ZPV6zN6>W6JTS~-LfjL{mB=b(KMk3 z2HjBSlJeyUVqDd=Mt!=hpYsvby2GL&3~zm;0{^nZJq+4vb?5HH4wufvr}IX42sHeK zm@x?HN$8TsTavXs)tLDFJtY9b)y~Tl@7z4^I8oUQq4JckH@~CVQ;FoK(+e0XAM>1O z(ei}h?)JQp>)d=6ng-BZF1Z5hsAKW@mXq+hU?r8I(*%`tnIIOXw7V6ZK(T9RFJJe@ zZS!aC+p)Gf2Ujc=a6hx4!A1Th%YH!Lb^xpI!Eu` zmJO{9rw){B1Ql18d%F%da+Tbu1()?o(zT7StYqK6_w`e+fjXq5L^y(0 z09QA6H4oFj59c2wR~{~>jUoDzDdKz}5#onYPJRwa`SUO)Pd4)?(ENBaFVLJr6Kvz= zhTtXqbx09C1z~~iZt;g^9_2nCZ{};-b4dQJbv8HsWHXPVg^@(*!@xycp#R?a|L!+` zY5w))JWV`Gls(=}shH0#r*;~>_+-P5Qc978+QUd>J%`fyn{*TsiG-dWMiJXNgwBaT zJ=wgYFt+1ACW)XwtNx)Q9tA2LPoB&DkL16P)ERWQlY4%Y`-5aM9mZ{eKPUgI!~J3Z zkMd5A_p&v?V-o-6TUa8BndiX?ooviev(DKw=*bBVOW|=zps9=Yl|-R5@yJe*BPzN}a0mUsLn{4LfjB_oxpv(mwq# zSY*%E{iB)sNvWfzg-B!R!|+x(Q|b@>{-~cFvdDHA{F2sFGA5QGiIWy#3?P2JIpPKg6ncI^)dvqe`_|N=8@00IL3?^hro$gg*4VI_WAaTyVM5Foj~O|-84 z$;06hMwt*rV;^8iB z1~&0XWpYJmG?Ts^K9PC62H*`G}xom%S%yq|xvG~FIfP=9*f zZoDRJBm*Y0aId=qJ?7dyb)6)JGWGwe)MHeNSzhi)Ko6J<-m@v=a%NsP537lHe0R* z`If4$aaBA#S=w!2z&m>{lpTy^Lm^mg*3?M&7HFv}7K6x*cukLIGX;bQG|QWdn{%_6 zHnwBKr84#B7Z+AnBXa16a?or^R?+>$4`}{*a_>IhbjvyTtWkHw)|ay)ahWUd-qq$~ zMbh6roVsj;_qnC-R{G+Cy6bApVOinSU-;(DxUEl!i2)1EeQ9`hrfqj(nKI7?Z>Xur zoJz-a`PxkYit1HEbv|jy%~DO^13J-ut986EEG=66S}D3!L}Efp;Bez~7tNq{QsUMm zh9~(HYg1pA*=37C0}n4g&bFbQ+?-h-W}onYeE{q;cIy%eZK9wZjSwGvT+&Cgv z?~{9p(;bY_1+k|wkt_|N!@J~aoY@|U_RGoWX<;p{Nu*D*&_phw`8jYkMNpRTWx1H* z>J-Mi_!`M468#5Aix$$u1M@rJEIOc?k^QBc?T(#=n&*5eS#u*Y)?L8Ha$9wRWdH^3D4|Ps)Y?m0q~SiKiSfEkJ!=^`lJ(%W3o|CZ zSrZL-Xxc{OrmsQD&s~zPfNJOpSZUl%V8tdG%ei}lQkM+z@-4etFPR>GOH9+Y_F<3=~SXln9Kb-o~f>2a6Xz@AS3cn^;c_>lUwlK(n>z?A>NbC z`Ud8^aQy>wy=$)w;JZzA)_*Y$Z5hU=KAG&htLw1Uh00yE!|Nu{EZkch zY9O6x7Y??>!7pUNME*d!=R#s)ghr|R#41l!c?~=3CS8&zr6*aA7n9*)*PWBV2w+&I zpW1-9fr3j{VTcls1>ua}F*bbju_Xq%^v;-W~paSqlf zolj*dt`BBjHI)H9{zrkBo=B%>8}4jeBO~kWqO!~Thi!I1H(in=n^fS%nuL=X2+s!p}HfTU#NBGiwEBF^^tKU zbhhv+0dE-sbK$>J#t-J!B$TMgN@Wh5wTtK2BG}4BGfsZOoRUS#G8Cxv|6EI*n&Xxq zt{&OxCC+BNqz$9b0WM7_PyBJEVObHFh%%`~!@MNZlo*oXDCwDcFwT~Rls!aApL<)^ zbBftGKKBRhB!{?fX@l2_y~%ygNFfF(XJzHh#?`WlSL{1lKT*gJM zs>bd^H9NCxqxn(IOky5k-wALFowQr(gw%|`0991u#9jXQh?4l|l>pd6a&rx|v=fPJ z1mutj{YzpJ_gsClbWFk(G}bSlFi-6@mwoQh-XeD*j@~huW4(8ub%^I|azA)h2t#yG z7e_V_<4jlM3D(I+qX}yEtqj)cpzN*oCdYHa!nm%0t^wHm)EmFP*|FMw!tb@&`G-u~ zK)=Sf6z+BiTAI}}i{*_Ac$ffr*Wrv$F7_0gJkjx;@)XjYSh`RjAgrCck`x!zP>Ifu z&%he4P|S)H*(9oB4uvH67^0}I-_ye_!w)u3v2+EY>eD3#8QR24<;7?*hj8k~rS)~7 zSXs5ww)T(0eHSp$hEIBnW|Iun<_i`}VE0Nc$|-R}wlSIs5pV{g_Dar(Zz<4X3`W?K z6&CAIl4U(Qk-tTcK{|zYF6QG5ArrEB!;5s?tW7 zrE3hcFY&k)+)e{+YOJ0X2uDE_hd2{|m_dC}kgEKqiE9Q^A-+>2UonB+L@v3$9?AYw zVQv?X*pK;X4Ovc6Ev5Gbg{{Eu*7{N3#0@9oMI~}KnObQE#Y{&3mM4`w%wN+xrKYgD zB-ay0Q}m{QI;iY`s1Z^NqIkjrTlf`B)B#MajZ#9u41oRBC1oM1vq0i|F59> z#StM@bHt|#`2)cpl_rWB($DNJ3Lap}QM-+A$3pe}NyP(@+i1>o^fe-oxX#Bt`mcQc zb?pD4W%#ep|3%CHAYnr*^M6Czg>~L4?l16H1OozM{P*en298b+`i4$|w$|4AHbzqB zHpYUsHZET$Z0ztC;U+0*+amF!@PI%^oUIZy{`L{%O^i{Xk}X0&nl)n~tVEpcAJSJ} zverw15zP1P-O8h9nd!&hj$zuwjg?DoxYIw{jWM zW5_pj+wFy8Tsa9g<7Qa21WaV&;ejoYflRKcz?#fSH_)@*QVlN2l4(QNk| z4aPnv&mrS&0|6NHq05XQw$J^RR9T{3SOcMKCXIR1iSf+xJ0E_Wv?jEc*I#ZPzyJN2 zUG0UOXHl+PikM*&g$U@g+KbG-RY>uaIl&DEtw_Q=FYq?etc!;hEC_}UX{eyh%dw2V zTTSlap&5>PY{6I#(6`j-9`D&I#|YPP8a;(sOzgeKDWsLa!i-$frD>zr-oid!Hf&yS z!i^cr&7tN}OOGmX2)`8k?Tn!!4=tz~3hCTq_9CdiV!NIblUDxHh(FJ$zs)B2(t5@u z-`^RA1ShrLCkg0)OhfoM;4Z{&oZmAec$qV@ zGQ(7(!CBk<5;Ar%DLJ0p0!ResC#U<+3i<|vib1?{5gCebG7$F7URKZXuX-2WgF>YJ^i zMhHDBsh9PDU8dlZ$yJKtc6JA#y!y$57%sE>4Nt+wF1lfNIWyA`=hF=9Gj%sRwi@vd z%2eVV3y&dvAgyuJ=eNJR+*080dbO_t@BFJO<@&#yqTK&+xc|FRR;p;KVk@J3$S{p` zGaMj6isho#%m)?pOG^G0mzOAw0z?!AEMsv=0T>WWcE>??WS=fII$t$(^PDPMU(P>o z_*0s^W#|x)%tx8jIgZY~A2yG;US0m2ZOQt6yJqW@XNY_>_R7(Nxb8Ged6BdYW6{prd!|zuX$@Q2o6Ona8zzYC1u!+2!Y$Jc9a;wy+pXt}o6~Bu1oF1c zp7Y|SBTNi@=I(K%A60PMjM#sfH$y*c{xUgeSpi#HB`?|`!Tb&-qJ3;vxS!TIzuTZs-&%#bAkAyw9m4PJgvey zM5?up*b}eDEY+#@tKec)-c(#QF0P?MRlD1+7%Yk*jW;)`f;0a-ZJ6CQA?E%>i2Dt7T9?s|9ZF|KP4;CNWvaVKZ+Qeut;Jith_y{v*Ny6Co6!8MZx;Wgo z=qAi%&S;8J{iyD&>3CLCQdTX*$+Rx1AwA*D_J^0>suTgBMBb=*hefV+Ars#mmr+YsI3#!F@Xc1t4F-gB@6aoyT+5O(qMz*zG<9Qq*f0w^V!03rpr*-WLH}; zfM{xSPJeu6D(%8HU%0GEa%waFHE$G?FH^kMS-&I3)ycx|iv{T6Wx}9$$D&6{%1N_8 z_CLw)_9+O4&u94##vI9b-HHm_95m)fa??q07`DniVjAy`t7;)4NpeyAY(aAk(+T_O z1om+b5K2g_B&b2DCTK<>SE$Ode1DopAi)xaJjU>**AJK3hZrnhEQ9E`2=|HHe<^tv z63e(bn#fMWuz>4erc47}!J>U58%<&N<6AOAewyzNTqi7hJc|X{782&cM zHZYclNbBwU6673=!ClmxMfkC$(CykGR@10F!zN1Se83LR&a~$Ht&>~43OX22mt7tcZUpa;9@q}KDX3O&Ugp6< zLZLfIMO5;pTee1vNyVC$FGxzK2f>0Z-6hM82zKg44nWo|n}$Zk6&;5ry3`(JFEX$q zK&KivAe${e^5ZGc3a9hOt|!UOE&OocpVryE$Y4sPcs4rJ>>Kbi2_subQ9($2VN(3o zb~tEzMsHaBmBtaHAyES+d3A(qURgiskSSwUc9CfJ@99&MKp2sooSYZu+-0t0+L*!I zYagjOlPgx|lep9tiU%ts&McF6b0VE57%E0Ho%2oi?=Ks+5%aj#au^OBwNwhec zta6QAeQI^V!dF1C)>RHAmB`HnxyqWx?td@4sd15zPd*Fc9hpDXP23kbBenBxGeD$k z;%0VBQEJ-C)&dTAw_yW@k0u?IUk*NrkJ)(XEeI z9Y>6Vel>#s_v@=@0<{4A{pl=9cQ&Iah0iD0H`q)7NeCIRz8zx;! z^OO;1+IqoQNak&pV`qKW+K0^Hqp!~gSohcyS)?^P`JNZXw@gc6{A3OLZ?@1Uc^I2v z+X!^R*HCm3{7JPq{8*Tn>5;B|X7n4QQ0Bs79uTU%nbqOJh`nX(BVj!#f;#J+WZxx4 z_yM&1Y`2XzhfqkIMO7tB3raJKQS+H5F%o83bM+hxbQ zeeJm=Dvix$2j|b4?mDacb67v-1^lTp${z=jc1=j~QD>7c*@+1?py>%Kj%Ejp7Y-!? z8iYRUlGVrQPandAaxFfks53@2EC#0)%mrnmGRn&>=$H$S8q|kE_iWko4`^vCS2aWg z#!`RHUGyOt*k?bBYu3*j3u0gB#v(3tsije zgIuNNWNtrOkx@Pzs;A9un+2LX!zw+p3_NX^Sh09HZAf>m8l@O*rXy_82aWT$Q>iyy zqO7Of)D=wcSn!0+467&!Hl))eff=$aneB?R!YykdKW@k^_uR!+Q1tR)+IJb`-6=jj zymzA>Sv4>Z&g&WWu#|~GcP7qP&m*w-S$)7Xr;(duqCTe7p8H3k5>Y-n8438+%^9~K z3r^LIT_K{i7DgEJjIocw_6d0!<;wKT`X;&vv+&msmhAAnIe!OTdybPctzcEzBy88_ zWO{6i4YT%e4^WQZB)KHCvA(0tS zHu_Bg+6Ko%a9~$EjRB90`P(2~6uI@SFibxct{H#o&y40MdiXblu@VFXbhz>Nko;7R z70Ntmm-FePqhb%9gL+7U8@(ch|JfH5Fm)5${8|`Lef>LttM_iww6LW2X61ldBmG0z zax3y)njFe>j*T{i0s8D4=L>X^j0)({R5lMGVS#7(2C9@AxL&C-lZQx~czI7Iv+{%1 z2hEG>RzX4S8x3v#9sgGAnPzptM)g&LB}@%E>fy0vGSa(&q0ch|=ncKjNrK z`jA~jObJhrJ^ri|-)J^HUyeZXz~XkBp$VhcTEcTdc#a2EUOGVX?@mYx#Vy*!qO$Jv zQ4rgOJ~M*o-_Wptam=~krnmG*p^j!JAqoQ%+YsDFW7Cc9M%YPiBOrVcD^RY>m9Pd< zu}#9M?K{+;UIO!D9qOpq9yxUquQRmQNMo0pT`@$pVt=rMvyX)ph(-CCJLvUJy71DI zBk7oc7)-%ngdj~s@76Yse3L^gV0 z2==qfp&Q~L(+%RHP0n}+xH#k(hPRx(!AdBM$JCfJ5*C=K3ts>P?@@SZ_+{U2qFZb>4kZ{Go37{# zSQc+-dq*a-Vy4?taS&{Ht|MLRiS)Sn14JOONyXqPNnpq&2y~)6wEG0oNy>qvod$FF z`9o&?&6uZjhZ4_*5qWVrEfu(>_n2Xi2{@Gz9MZ8!YmjYvIMasE9yVQL10NBrTCczq zcTY1q^PF2l!Eraguf{+PtHV3=2A?Cu&NN&a8V(y;q(^_mFc6)%Yfn&X&~Pq zU1?qCj^LF(EQB1F`8NxNjyV%fde}dEa(Hx=r7$~ts2dzDwyi6ByBAIx$NllB4%K=O z$AHz1<2bTUb>(MCVPpK(E9wlLElo(aSd(Os)^Raum`d(g9Vd_+Bf&V;l=@mM=cC>) z)9b0enb)u_7V!!E_bl>u5nf&Rl|2r=2F3rHMdb7y9E}}F82^$Rf+P8%dKnOeKh1vs zhH^P*4Ydr^$)$h@4KVzxrHyy#cKmWEa9P5DJ|- zG;!Qi35Tp7XNj60=$!S6U#!(${6hyh7d4q=pF{`0t|N^|L^d8pD{O9@tF~W;#Je*P z&ah%W!KOIN;SyAEhAeTafJ4uEL`(RtnovM+cb(O#>xQnk?dzAjG^~4$dFn^<@-Na3 z395;wBnS{t*H;Jef2eE!2}u5Ns{AHj>WYZDgQJt8v%x?9{MXqJsGP|l%OiZqQ1aB! z%E=*Ig`(!tHh>}4_z5IMpg{49UvD*Pp9!pxt_gdAW%sIf3k6CTycOT1McPl=_#0?8 zVjz8Hj*Vy9c5-krd-{BQ{6Xy|P$6LJvMuX$* zA+@I_66_ET5l2&gk9n4$1M3LN8(yEViRx&mtd#LD}AqEs?RW=xKC(OCWH;~>(X6h!uDxXIPH06xh z*`F4cVlbDP`A)-fzf>MuScYsmq&1LUMGaQ3bRm6i7OsJ|%uhTDT zlvZA1M}nz*SalJWNT|`dBm1$xlaA>CCiQ zK`xD-RuEn>-`Z?M{1%@wewf#8?F|(@1e0+T4>nmlSRrNK5f)BJ2H*$q(H>zGD0>eL zQ!tl_Wk)k*e6v^m*{~A;@6+JGeWU-q9>?+L_#UNT%G?4&BnOgvm9@o7l?ov~XL+et zbGT)|G7)KAeqb=wHSPk+J1bdg7N3$vp(ekjI1D9V$G5Cj!=R2w=3*4!z*J-r-cyeb zd(i2KmX!|Lhey!snRw z?#$Gu%S^SQEKt&kep)up#j&9}e+3=JJBS(s>MH+|=R(`8xK{mmndWo_r`-w1#SeRD&YtAJ#GiVI*TkQZ}&aq<+bU2+coU3!jCI6E+Ad_xFW*ghnZ$q zAoF*i&3n1j#?B8x;kjSJD${1jdRB;)R*)Ao!9bd|C7{;iqDo|T&>KSh6*hCD!rwv= zyK#F@2+cv3=|S1Kef(E6Niv8kyLVLX&e=U;{0x{$tDfShqkjUME>f8d(5nzSkY6@! z^-0>DM)wa&%m#UF1F?zR`8Y3X#tA!*7Q$P3lZJ%*KNlrk_uaPkxw~ zxZ1qlE;Zo;nb@!SMazSjM>;34ROOoygo%SF);LL>rRonWwR>bmSd1XD^~sGSu$Gg# zFZ`|yKU0%!v07dz^v(tY%;So(e`o{ZYTX`hm;@b0%8|H>VW`*cr8R%3n|ehw2`(9B+V72`>SY}9^8oh$En80mZK9T4abVG*to;E z1_S6bgDOW?!Oy1LwYy=w3q~KKdbNtyH#d24PFjX)KYMY93{3-mPP-H>@M-_>N~DDu zENh~reh?JBAK=TFN-SfDfT^=+{w4ea2KNWXq2Y<;?(gf(FgVp8Zp-oEjKzB%2Iqj;48GmY3h=bcdYJ}~&4tS`Q1sb=^emaW$IC$|R+r-8V- zf0$gGE(CS_n4s>oicVk)MfvVg#I>iDvf~Ov8bk}sSxluG!6#^Z_zhB&U^`eIi1@j( z^CK$z^stBHtaDDHxn+R;3u+>Lil^}fj?7eaGB z&5nl^STqcaBxI@v>%zG|j))G(rVa4aY=B@^2{TFkW~YP!8!9TG#(-nOf^^X-%m9{Z zCC?iC`G-^RcBSCuk=Z`(FaUUe?hf3{0C>>$?Vs z`2Uud9M+T&KB6o4o9kvdi^Q=Bw!asPdxbe#W-Oaa#_NP(qpyF@bVxv5D5))srkU#m zj_KA+#7sqDn*Ipf!F5Byco4HOSd!Ui$l94|IbW%Ny(s1>f4|Mv^#NfB31N~kya9!k zWCGL-$0ZQztBate^fd>R!hXY_N9ZjYp3V~4_V z#eB)Kjr8yW=+oG)BuNdZG?jaZlw+l_ma8aET(s+-x+=F-t#Qoiuu1i`^x8Sj>b^U} zs^z<()YMFP7CmjUC@M=&lA5W7t&cxTlzJAts*%PBDAPuqcV5o7HEnqjif_7xGt)F% zGx2b4w{@!tE)$p=l3&?Bf#`+!-RLOleeRk3 z7#pF|w@6_sBmn1nECqdunmG^}pr5(ZJQVvAt$6p3H(16~;vO>?sTE`Y+mq5YP&PBo zvq!7#W$Gewy`;%6o^!Dtjz~x)T}Bdk*BS#=EY=ODD&B=V6TD2z^hj1m5^d6s)D*wk zu$z~D7QuZ2b?5`p)E8e2_L38v3WE{V`bVk;6fl#o2`) z99JsWhh?$oVRn@$S#)uK&8DL8>An0&S<%V8hnGD7Z^;Y(%6;^9!7kDQ5bjR_V+~wp zfx4m3z6CWmmZ<8gDGUyg3>t8wgJ5NkkiEm^(sedCicP^&3D%}6LtIUq>mXCAt{9eF zNXL$kGcoUTf_Lhm`t;hD-SE)m=iBnxRU(NyL}f6~1uH)`K!hmYZjLI%H}AmEF5RZt z06$wn63GHnApHXZZJ}s^s)j9(BM6e*7IBK6Bq(!)d~zR#rbxK9NVIlgquoMq z=eGZ9NR!SEqP6=9UQg#@!rtbbSBUM#ynF);zKX+|!Zm}*{H z+j=d?aZ2!?@EL7C~%B?6ouCKLnO$uWn;Y6Xz zX8dSwj732u(o*U3F$F=7xwxm>E-B+SVZH;O-4XPuPkLSt_?S0)lb7EEg)Mglk0#eS z9@jl(OnH4juMxY+*r03VDfPx_IM!Lmc(5hOI;`?d37f>jPP$?9jQQIQU@i4vuG6MagEoJrQ=RD7xt@8E;c zeGV*+Pt+t$@pt!|McETOE$9k=_C!70uhwRS9X#b%ZK z%q(TIUXSS^F0`4Cx?Rk07C6wI4!UVPeI~-fxY6`YH$kABdOuiRtl73MqG|~AzZ@iL&^s?24iS;RK_pdlWkhcF z@Wv-Om(Aealfg)D^adlXh9Nvf~Uf@y;g3Y)i(YP zEXDnb1V}1pJT5ZWyw=1i+0fni9yINurD=EqH^ciOwLUGi)C%Da)tyt=zq2P7pV5-G zR7!oq28-Fgn5pW|nlu^b!S1Z#r7!Wtr{5J5PQ>pd+2P7RSD?>(U7-|Y z7ZQ5lhYIl_IF<9?T9^IPK<(Hp;l5bl5tF9>X-zG14_7PfsA>6<$~A338iYRT{a@r_ zuXBaT=`T5x3=s&3=RYx6NgG>No4?5KFBVjE(swfcivcIpPQFx5l+O;fiGsOrl5teR z_Cm+;PW}O0Dwe_(4Z@XZ)O0W-v2X><&L*<~*q3dg;bQW3g7)a#3KiQP>+qj|qo*Hk z?57>f2?f@`=Fj^nkDKeRkN2d$Z@2eNKpHo}ksj-$`QKb6n?*$^*%Fb3_Kbf1(*W9K>{L$mud2WHJ=j0^=g30Xhg8$#g^?36`p1fm;;1@0Lrx+8t`?vN0ZorM zSW?rhjCE8$C|@p^sXdx z|NOHHg+fL;HIlqyLp~SSdIF`TnSHehNCU9t89yr@)FY<~hu+X`tjg(aSVae$wDG*C zq$nY(Y494R)hD!i1|IIyP*&PD_c2FPgeY)&mX1qujB1VHPG9`yFQpLFVQ0>EKS@Bp zAfP5`C(sWGLI?AC{XEjLKR4FVNw(4+9b?kba95ukgR1H?w<8F7)G+6&(zUhIE5Ef% z=fFkL3QKA~M@h{nzjRq!Y_t!%U66#L8!(2-GgFxkD1=JRRqk=n%G(yHKn%^&$dW>; zSjAcjETMz1%205se$iH_)ZCpfg_LwvnsZQAUCS#^FExp8O4CrJb6>JquNV@qPq~3A zZ<6dOU#6|8+fcgiA#~MDmcpIEaUO02L5#T$HV0$EMD94HT_eXLZ2Zi&(! z&5E>%&|FZ`)CN10tM%tLSPD*~r#--K(H-CZqIOb99_;m|D5wdgJ<1iOJz@h2Zkq?} z%8_KXb&hf=2Wza(Wgc;3v3TN*;HTU*q2?#z&tLn_U0Nt!y>Oo>+2T)He6%XuP;fgn z-G!#h$Y2`9>Jtf}hbVrm6D70|ERzLAU>3zoWhJmjWfgM^))T+2u$~5>HF9jQDkrXR z=IzX36)V75PrFjkQ%TO+iqKGCQ-DDXbaE;C#}!-CoWQx&v*vHfyI>$HNRbpvm<`O( zlx9NBWD6_e&J%Ous4yp~s6)Ghni!I6)0W;9(9$y1wWu`$gs<$9Mcf$L*piP zPR0Av*2%ul`W;?-1_-5Zy0~}?`e@Y5A&0H!^ApyVTT}BiOm4GeFo$_oPlDEyeGBbh z1h3q&Dx~GmUS|3@4V36&$2uO8!Yp&^pD7J5&TN{?xphf*-js1fP?B|`>p_K>lh{ij zP(?H%e}AIP?_i^f&Li=FDSQ`2_NWxL+BB=nQr=$ zHojMlXNGauvvwPU>ZLq!`bX-5F4jBJ&So{kE5+ms9UEYD{66!|k~3vsP+mE}x!>%P za98bAU0!h0&ka4EoiDvBM#CP#dRNdXJcb*(%=<(g+M@<)DZ!@v1V>;54En?igcHR2 zhubQMq}VSOK)onqHfczM7YA@s=9*ow;k;8)&?J3@0JiGcP! zP#00KZ1t)GyZeRJ=f0^gc+58lc4Qh*S7RqPIC6GugG1gXe$LIQMRCo8cHf^qXgAa2 z`}t>u2Cq1CbSEpLr~E=c7~=Qkc9-vLE%(v9N*&HF`(d~(0`iukl5aQ9u4rUvc8%m) zr2GwZN4!s;{SB87lJB;veebPmqE}tSpT>+`t?<457Q9iV$th%i__Z1kOMAswFldD6 ztbOvO337S5o#ZZgN2G99_AVqPv!?Gmt3pzgD+Hp3QPQ`9qJ(g=kjvD+fUSS3upJn! zqoG7acIKEFRX~S}3|{EWT$kdz#zrDlJU(rPkxjws_iyLKU8+v|*oS_W*-guAb&Pj1 z35Z`3z<&Jb@2Mwz=KXucNYdY#SNO$tcVFr9KdKm|%^e-TXzs6M`PBper%ajkrIyUe zp$vVxVs9*>Vp4_1NC~Zg)WOCPmOxI1V34QlG4!aSFOH{QqSVq1^1)- z0P!Z?tT&E-ll(pwf0?=F=yOzik=@nh1Clxr9}Vij89z)ePDSCYAqw?lVI?v?+&*zH z)p$CScFI8rrwId~`}9YWPFu0cW1Sf@vRELs&cbntRU6QfPK-SO*mqu|u~}8AJ!Q$z znzu}50O=YbjwKCuSVBs6&CZR#0FTu)3{}qJJYX(>QPr4$RqWiwX3NT~;>cLn*_&1H zaKpIW)JVJ>b{uo2oq>oQt3y=zJjb%fU@wLqM{SyaC6x2snMx-}ivfU<1- znu1Lh;i$3Tf$Kh5Uk))G!D1UhE8pvx&nO~w^fG)BC&L!_hQk%^p`Kp@F{cz>80W&T ziOK=Sq3fdRu*V0=S53rcIfWFazI}Twj63CG(jOB;$*b`*#B9uEnBM`hDk*EwSRdwP8?5T?xGUKs=5N83XsR*)a4|ijz|c{4tIU+4j^A5C<#5 z*$c_d=5ml~%pGxw#?*q9N7aRwPux5EyqHVkdJO=5J>84!X6P>DS8PTTz>7C#FO?k#edkntG+fJk8ZMn?pmJSO@`x-QHq;7^h6GEXLXo1TCNhH z8ZDH{*NLAjo3WM`xeb=X{((uv3H(8&r8fJJg_uSs_%hOH%JDD?hu*2NvWGYD+j)&` zz#_1%O1wF^o5ryt?O0n;`lHbzp0wQ?rcbW(F1+h7_EZZ9{>rePvLAPVZ_R|n@;b$;UchU=0j<6k8G9QuQf@76oiE*4 zXOLQ&n3$NR#p4<5NJMVC*S);5x2)eRbaAM%VxWu9ohlT;pGEk7;002enCbQ>2r-us z3#bpXP9g|mE`65VrN`+3mC)M(eMj~~eOf)do<@l+fMiTR)XO}422*1SL{wyY(%oMpBgJagtiDf zz>O6(m;};>Hi=t8o{DVC@YigqS(Qh+ix3Rwa9aliH}a}IlOCW1@?%h_bRbq-W{KHF z%Vo?-j@{Xi@=~Lz5uZP27==UGE15|g^0gzD|3x)SCEXrx`*MP^FDLl%pOi~~Il;dc z^hrwp9sYeT7iZ)-ajKy@{a`kr0-5*_!XfBpXwEcFGJ;%kV$0Nx;apKrur zJN2J~CAv{Zjj%FolyurtW8RaFmpn&zKJWL>(0;;+q(%(Hx!GMW4AcfP0YJ*Vz!F4g z!ZhMyj$BdXL@MlF%KeInmPCt~9&A!;cRw)W!Hi@0DY(GD_f?jeV{=s=cJ6e}JktJw zQORnxxj3mBxfrH=x{`_^Z1ddDh}L#V7i}$njUFRVwOX?qOTKjfPMBO4y(WiU<)epb zvB9L=%jW#*SL|Nd_G?E*_h1^M-$PG6Pc_&QqF0O-FIOpa4)PAEPsyvB)GKasmBoEt z?_Q2~QCYGH+hW31x-B=@5_AN870vY#KB~3a*&{I=f);3Kv7q4Q7s)0)gVYx2#Iz9g(F2;=+Iy4 z6KI^8GJ6D@%tpS^8boU}zpi=+(5GfIR)35PzrbuXeL1Y1N%JK7PG|^2k3qIqHfX;G zQ}~JZ-UWx|60P5?d1e;AHx!_;#PG%d=^X(AR%i`l0jSpYOpXoKFW~7ip7|xvN;2^? zsYC9fanpO7rO=V7+KXqVc;Q5z%Bj})xHVrgoR04sA2 zl~DAwv=!(()DvH*=lyhIlU^hBkA0$e*7&fJpB0|oB7)rqGK#5##2T`@_I^|O2x4GO z;xh6ROcV<9>?e0)MI(y++$-ksV;G;Xe`lh76T#Htuia+(UrIXrf9?

L(tZ$0BqX1>24?V$S+&kLZ`AodQ4_)P#Q3*4xg8}lMV-FLwC*cN$< zt65Rf%7z41u^i=P*qO8>JqXPrinQFapR7qHAtp~&RZ85$>ob|Js;GS^y;S{XnGiBc zGa4IGvDl?x%gY`vNhv8wgZnP#UYI-w*^4YCZnxkF85@ldepk$&$#3EAhrJY0U)lR{F6sM3SONV^+$;Zx8BD&Eku3K zKNLZyBni3)pGzU0;n(X@1fX8wYGKYMpLmCu{N5-}epPDxClPFK#A@02WM3!myN%bkF z|GJ4GZ}3sL{3{qXemy+#Uk{4>Kf8v11;f8I&c76+B&AQ8udd<8gU7+BeWC`akUU~U zgXoxie>MS@rBoyY8O8Tc&8id!w+_ooxcr!1?#rc$-|SBBtH6S?)1e#P#S?jFZ8u-Bs&k`yLqW|{j+%c#A4AQ>+tj$Y z^CZajspu$F%73E68Lw5q7IVREED9r1Ijsg#@DzH>wKseye>hjsk^{n0g?3+gs@7`i zHx+-!sjLx^fS;fY!ERBU+Q zVJ!e0hJH%P)z!y%1^ZyG0>PN@5W~SV%f>}c?$H8r;Sy-ui>aruVTY=bHe}$e zi&Q4&XK!qT7-XjCrDaufT@>ieQ&4G(SShUob0Q>Gznep9fR783jGuUynAqc6$pYX; z7*O@@JW>O6lKIk0G00xsm|=*UVTQBB`u1f=6wGAj%nHK_;Aqmfa!eAykDmi-@u%6~ z;*c!pS1@V8r@IX9j&rW&d*}wpNs96O2Ute>%yt{yv>k!6zfT6pru{F1M3P z2WN1JDYqoTB#(`kE{H676QOoX`cnqHl1Yaru)>8Ky~VU{)r#{&s86Vz5X)v15ULHA zAZDb{99+s~qI6;-dQ5DBjHJP@GYTwn;Dv&9kE<0R!d z8tf1oq$kO`_sV(NHOSbMwr=To4r^X$`sBW4$gWUov|WY?xccQJN}1DOL|GEaD_!@& z15p?Pj+>7d`@LvNIu9*^hPN)pwcv|akvYYq)ks%`G>!+!pW{-iXPZsRp8 z35LR;DhseQKWYSD`%gO&k$Dj6_6q#vjWA}rZcWtQr=Xn*)kJ9kacA=esi*I<)1>w^ zO_+E>QvjP)qiSZg9M|GNeLtO2D7xT6vsj`88sd!94j^AqxFLi}@w9!Y*?nwWARE0P znuI_7A-saQ+%?MFA$gttMV-NAR^#tjl_e{R$N8t2NbOlX373>e7Ox=l=;y#;M7asp zRCz*CLnrm$esvSb5{T<$6CjY zmZ(i{Rs_<#pWW>(HPaaYj`%YqBra=Ey3R21O7vUbzOkJJO?V`4-D*u4$Me0Bx$K(lYo`JO}gnC zx`V}a7m-hLU9Xvb@K2ymioF)vj12<*^oAqRuG_4u%(ah?+go%$kOpfb`T96P+L$4> zQ#S+sA%VbH&mD1k5Ak7^^dZoC>`1L%i>ZXmooA!%GI)b+$D&ziKrb)a=-ds9xk#~& z7)3iem6I|r5+ZrTRe_W861x8JpD`DDIYZNm{$baw+$)X^Jtjnl0xlBgdnNY}x%5za zkQ8E6T<^$sKBPtL4(1zi_Rd(tVth*3Xs!ulflX+70?gb&jRTnI8l+*Aj9{|d%qLZ+ z>~V9Z;)`8-lds*Zgs~z1?Fg?Po7|FDl(Ce<*c^2=lFQ~ahwh6rqSjtM5+$GT>3WZW zj;u~w9xwAhOc<kF}~`CJ68 z?(S5vNJa;kriPlim33{N5`C{9?NWhzsna_~^|K2k4xz1`xcui*LXL-1#Y}Hi9`Oo!zQ>x-kgAX4LrPz63uZ+?uG*84@PKq-KgQlMNRwz=6Yes) zY}>YN+qP}nwr$(CZQFjUOI=-6J$2^XGvC~EZ+vrqWaOXB$k?%Suf5k=4>AveC1aJ! ziaW4IS%F$_Babi)kA8Y&u4F7E%99OPtm=vzw$$ zEz#9rvn`Iot_z-r3MtV>k)YvErZ<^Oa${`2>MYYODSr6?QZu+be-~MBjwPGdMvGd!b!elsdi4% z`37W*8+OGulab8YM?`KjJ8e+jM(tqLKSS@=jimq3)Ea2EB%88L8CaM+aG7;27b?5` z4zuUWBr)f)k2o&xg{iZ$IQkJ+SK>lpq4GEacu~eOW4yNFLU!Kgc{w4&D$4ecm0f}~ zTTzquRW@`f0}|IILl`!1P+;69g^upiPA6F{)U8)muWHzexRenBU$E^9X-uIY2%&1w z_=#5*(nmxJ9zF%styBwivi)?#KMG96-H@hD-H_&EZiRNsfk7mjBq{L%!E;Sqn!mVX*}kXhwH6eh;b42eD!*~upVG@ z#smUqz$ICm!Y8wY53gJeS|Iuard0=;k5i5Z_hSIs6tr)R4n*r*rE`>38Pw&lkv{_r!jNN=;#?WbMj|l>cU(9trCq; z%nN~r^y7!kH^GPOf3R}?dDhO=v^3BeP5hF|%4GNQYBSwz;x({21i4OQY->1G=KFyu z&6d`f2tT9Yl_Z8YACZaJ#v#-(gcyeqXMhYGXb=t>)M@fFa8tHp2x;ODX=Ap@a5I=U z0G80^$N0G4=U(>W%mrrThl0DjyQ-_I>+1Tdd_AuB3qpYAqY54upwa3}owa|x5iQ^1 zEf|iTZxKNGRpI>34EwkIQ2zHDEZ=(J@lRaOH>F|2Z%V_t56Km$PUYu^xA5#5Uj4I4RGqHD56xT%H{+P8Ag>e_3pN$4m8n>i%OyJFPNWaEnJ4McUZPa1QmOh?t8~n& z&RulPCors8wUaqMHECG=IhB(-tU2XvHP6#NrLVyKG%Ee*mQ5Ps%wW?mcnriTVRc4J`2YVM>$ixSF2Xi+Wn(RUZnV?mJ?GRdw%lhZ+t&3s7g!~g{%m&i<6 z5{ib-<==DYG93I(yhyv4jp*y3#*WNuDUf6`vTM%c&hiayf(%=x@4$kJ!W4MtYcE#1 zHM?3xw63;L%x3drtd?jot!8u3qeqctceX3m;tWetK+>~q7Be$h>n6riK(5@ujLgRS zvOym)k+VAtyV^mF)$29Y`nw&ijdg~jYpkx%*^ z8dz`C*g=I?;clyi5|!27e2AuSa$&%UyR(J3W!A=ZgHF9OuKA34I-1U~pyD!KuRkjA zbkN!?MfQOeN>DUPBxoy5IX}@vw`EEB->q!)8fRl_mqUVuRu|C@KD-;yl=yKc=ZT0% zB$fMwcC|HE*0f8+PVlWHi>M`zfsA(NQFET?LrM^pPcw`cK+Mo0%8*x8@65=CS_^$cG{GZQ#xv($7J z??R$P)nPLodI;P!IC3eEYEHh7TV@opr#*)6A-;EU2XuogHvC;;k1aI8asq7ovoP!* z?x%UoPrZjj<&&aWpsbr>J$Er-7!E(BmOyEv!-mbGQGeJm-U2J>74>o5x`1l;)+P&~ z>}f^=Rx(ZQ2bm+YE0u=ZYrAV@apyt=v1wb?R@`i_g64YyAwcOUl=C!i>=Lzb$`tjv zOO-P#A+)t-JbbotGMT}arNhJmmGl-lyUpMn=2UacVZxmiG!s!6H39@~&uVokS zG=5qWhfW-WOI9g4!R$n7!|ViL!|v3G?GN6HR0Pt_L5*>D#FEj5wM1DScz4Jv@Sxnl zB@MPPmdI{(2D?;*wd>3#tjAirmUnQoZrVv`xM3hARuJksF(Q)wd4P$88fGYOT1p6U z`AHSN!`St}}UMBT9o7i|G`r$ zrB=s$qV3d6$W9@?L!pl0lf%)xs%1ko^=QY$ty-57=55PvP(^6E7cc zGJ*>m2=;fOj?F~yBf@K@9qwX0hA803Xw+b0m}+#a(>RyR8}*Y<4b+kpp|OS+!whP( zH`v{%s>jsQI9rd$*vm)EkwOm#W_-rLTHcZRek)>AtF+~<(did)*oR1|&~1|e36d-d zgtm5cv1O0oqgWC%Et@P4Vhm}Ndl(Y#C^MD03g#PH-TFy+7!Osv1z^UWS9@%JhswEq~6kSr2DITo59+; ze=ZC}i2Q?CJ~Iyu?vn|=9iKV>4j8KbxhE4&!@SQ^dVa-gK@YfS9xT(0kpW*EDjYUkoj! zE49{7H&E}k%5(>sM4uGY)Q*&3>{aitqdNnRJkbOmD5Mp5rv-hxzOn80QsG=HJ_atI-EaP69cacR)Uvh{G5dTpYG7d zbtmRMq@Sexey)||UpnZ?;g_KMZq4IDCy5}@u!5&B^-=6yyY{}e4Hh3ee!ZWtL*s?G zxG(A!<9o!CL+q?u_utltPMk+hn?N2@?}xU0KlYg?Jco{Yf@|mSGC<(Zj^yHCvhmyx z?OxOYoxbptDK()tsJ42VzXdINAMWL$0Gcw?G(g8TMB)Khw_|v9`_ql#pRd2i*?CZl z7k1b!jQB=9-V@h%;Cnl7EKi;Y^&NhU0mWEcj8B|3L30Ku#-9389Q+(Yet0r$F=+3p z6AKOMAIi|OHyzlHZtOm73}|ntKtFaXF2Fy|M!gOh^L4^62kGUoWS1i{9gsds_GWBc zLw|TaLP64z3z9?=R2|T6Xh2W4_F*$cq>MtXMOy&=IPIJ`;!Tw?PqvI2b*U1)25^<2 zU_ZPoxg_V0tngA0J+mm?3;OYw{i2Zb4x}NedZug!>EoN3DC{1i)Z{Z4m*(y{ov2%- zk(w>+scOO}MN!exSc`TN)!B=NUX`zThWO~M*ohqq;J2hx9h9}|s#?@eR!=F{QTrq~ zTcY|>azkCe$|Q0XFUdpFT=lTcyW##i;-e{}ORB4D?t@SfqGo_cS z->?^rh$<&n9DL!CF+h?LMZRi)qju!meugvxX*&jfD!^1XB3?E?HnwHP8$;uX{Rvp# zh|)hM>XDv$ZGg=$1{+_bA~u-vXqlw6NH=nkpyWE0u}LQjF-3NhATL@9rRxMnpO%f7 z)EhZf{PF|mKIMFxnC?*78(}{Y)}iztV12}_OXffJ;ta!fcFIVjdchyHxH=t%ci`Xd zX2AUB?%?poD6Zv*&BA!6c5S#|xn~DK01#XvjT!w!;&`lDXSJT4_j$}!qSPrb37vc{ z9^NfC%QvPu@vlxaZ;mIbn-VHA6miwi8qJ~V;pTZkKqqOii<1Cs}0i?uUIss;hM4dKq^1O35y?Yp=l4i zf{M!@QHH~rJ&X~8uATV><23zZUbs-J^3}$IvV_ANLS08>k`Td7aU_S1sLsfi*C-m1 z-e#S%UGs4E!;CeBT@9}aaI)qR-6NU@kvS#0r`g&UWg?fC7|b^_HyCE!8}nyh^~o@< zpm7PDFs9yxp+byMS(JWm$NeL?DNrMCNE!I^ko-*csB+dsf4GAq{=6sfyf4wb>?v1v zmb`F*bN1KUx-`ra1+TJ37bXNP%`-Fd`vVQFTwWpX@;s(%nDQa#oWhgk#mYlY*!d>( zE&!|ySF!mIyfING+#%RDY3IBH_fW$}6~1%!G`suHub1kP@&DoAd5~7J55;5_noPI6eLf{t;@9Kf<{aO0`1WNKd?<)C-|?C?)3s z>wEq@8=I$Wc~Mt$o;g++5qR+(6wt9GI~pyrDJ%c?gPZe)owvy^J2S=+M^ z&WhIE`g;;J^xQLVeCtf7b%Dg#Z2gq9hp_%g)-%_`y*zb; zn9`f`mUPN-Ts&fFo(aNTsXPA|J!TJ{0hZp0^;MYHLOcD=r_~~^ymS8KLCSeU3;^QzJNqS z5{5rEAv#l(X?bvwxpU;2%pQftF`YFgrD1jt2^~Mt^~G>T*}A$yZc@(k9orlCGv&|1 zWWvVgiJsCAtamuAYT~nzs?TQFt<1LSEx!@e0~@yd6$b5!Zm(FpBl;(Cn>2vF?k zOm#TTjFwd2D-CyA!mqR^?#Uwm{NBemP>(pHmM}9;;8`c&+_o3#E5m)JzfwN?(f-a4 zyd%xZc^oQx3XT?vcCqCX&Qrk~nu;fxs@JUoyVoi5fqpi&bUhQ2y!Ok2pzsFR(M(|U zw3E+kH_zmTRQ9dUMZWRE%Zakiwc+lgv7Z%|YO9YxAy`y28`Aw;WU6HXBgU7fl@dnt z-fFBV)}H-gqP!1;V@Je$WcbYre|dRdp{xt!7sL3Eoa%IA`5CAA%;Wq8PktwPdULo! z8!sB}Qt8#jH9Sh}QiUtEPZ6H0b*7qEKGJ%ITZ|vH)5Q^2m<7o3#Z>AKc%z7_u`rXA zqrCy{-{8;9>dfllLu$^M5L z-hXs))h*qz%~ActwkIA(qOVBZl2v4lwbM>9l70Y`+T*elINFqt#>OaVWoja8RMsep z6Or3f=oBnA3vDbn*+HNZP?8LsH2MY)x%c13@(XfuGR}R?Nu<|07{$+Lc3$Uv^I!MQ z>6qWgd-=aG2Y^24g4{Bw9ueOR)(9h`scImD=86dD+MnSN4$6 z^U*o_mE-6Rk~Dp!ANp#5RE9n*LG(Vg`1)g6!(XtDzsov$Dvz|Gv1WU68J$CkshQhS zCrc|cdkW~UK}5NeaWj^F4MSgFM+@fJd{|LLM)}_O<{rj z+?*Lm?owq?IzC%U%9EBga~h-cJbIu=#C}XuWN>OLrc%M@Gu~kFEYUi4EC6l#PR2JS zQUkGKrrS#6H7}2l0F@S11DP`@pih0WRkRJl#F;u{c&ZC{^$Z+_*lB)r)-bPgRFE;* zl)@hK4`tEP=P=il02x7-C7p%l=B`vkYjw?YhdJU9!P!jcmY$OtC^12w?vy3<<=tlY zUwHJ_0lgWN9vf>1%WACBD{UT)1qHQSE2%z|JHvP{#INr13jM}oYv_5#xsnv9`)UAO zuwgyV4YZ;O)eSc3(mka6=aRohi!HH@I#xq7kng?Acdg7S4vDJb6cI5fw?2z%3yR+| zU5v@Hm}vy;${cBp&@D=HQ9j7NcFaOYL zj-wV=eYF{|XTkFNM2uz&T8uH~;)^Zo!=KP)EVyH6s9l1~4m}N%XzPpduPg|h-&lL` zAXspR0YMOKd2yO)eMFFJ4?sQ&!`dF&!|niH*!^*Ml##o0M(0*uK9&yzekFi$+mP9s z>W9d%Jb)PtVi&-Ha!o~Iyh@KRuKpQ@)I~L*d`{O8!kRObjO7=n+Gp36fe!66neh+7 zW*l^0tTKjLLzr`x4`_8&on?mjW-PzheTNox8Hg7Nt@*SbE-%kP2hWYmHu#Fn@Q^J(SsPUz*|EgOoZ6byg3ew88UGdZ>9B2Tq=jF72ZaR=4u%1A6Vm{O#?@dD!(#tmR;eP(Fu z{$0O%=Vmua7=Gjr8nY%>ul?w=FJ76O2js&17W_iq2*tb!i{pt#`qZB#im9Rl>?t?0c zicIC}et_4d+CpVPx)i4~$u6N-QX3H77ez z?ZdvXifFk|*F8~L(W$OWM~r`pSk5}#F?j_5u$Obu9lDWIknO^AGu+Blk7!9Sb;NjS zncZA?qtASdNtzQ>z7N871IsPAk^CC?iIL}+{K|F@BuG2>qQ;_RUYV#>hHO(HUPpk@ z(bn~4|F_jiZi}Sad;_7`#4}EmD<1EiIxa48QjUuR?rC}^HRocq`OQPM@aHVKP9E#q zy%6bmHygCpIddPjE}q_DPC`VH_2m;Eey&ZH)E6xGeStOK7H)#+9y!%-Hm|QF6w#A( zIC0Yw%9j$s-#odxG~C*^MZ?M<+&WJ+@?B_QPUyTg9DJGtQN#NIC&-XddRsf3n^AL6 zT@P|H;PvN;ZpL0iv$bRb7|J{0o!Hq+S>_NrH4@coZtBJu#g8#CbR7|#?6uxi8d+$g z87apN>EciJZ`%Zv2**_uiET9Vk{pny&My;+WfGDw4EVL#B!Wiw&M|A8f1A@ z(yFQS6jfbH{b8Z-S7D2?Ixl`j0{+ZnpT=;KzVMLW{B$`N?Gw^Fl0H6lT61%T2AU**!sX0u?|I(yoy&Xveg7XBL&+>n6jd1##6d>TxE*Vj=8lWiG$4=u{1UbAa5QD>5_ z;Te^42v7K6Mmu4IWT6Rnm>oxrl~b<~^e3vbj-GCdHLIB_>59}Ya+~OF68NiH=?}2o zP(X7EN=quQn&)fK>M&kqF|<_*H`}c zk=+x)GU>{Af#vx&s?`UKUsz})g^Pc&?Ka@t5$n$bqf6{r1>#mWx6Ep>9|A}VmWRnowVo`OyCr^fHsf# zQjQ3Ttp7y#iQY8l`zEUW)(@gGQdt(~rkxlkefskT(t%@i8=|p1Y9Dc5bc+z#n$s13 zGJk|V0+&Ekh(F};PJzQKKo+FG@KV8a<$gmNSD;7rd_nRdc%?9)p!|B-@P~kxQG}~B zi|{0}@}zKC(rlFUYp*dO1RuvPC^DQOkX4<+EwvBAC{IZQdYxoq1Za!MW7%p7gGr=j zzWnAq%)^O2$eItftC#TTSArUyL$U54-O7e|)4_7%Q^2tZ^0-d&3J1}qCzR4dWX!)4 zzIEKjgnYgMus^>6uw4Jm8ga6>GBtMjpNRJ6CP~W=37~||gMo_p@GA@#-3)+cVYnU> zE5=Y4kzl+EbEh%dhQokB{gqNDqx%5*qBusWV%!iprn$S!;oN_6E3?0+umADVs4ako z?P+t?m?};gev9JXQ#Q&KBpzkHPde_CGu-y z<{}RRAx=xlv#mVi+Ibrgx~ujW$h{?zPfhz)Kp7kmYS&_|97b&H&1;J-mzrBWAvY} zh8-I8hl_RK2+nnf&}!W0P+>5?#?7>npshe<1~&l_xqKd0_>dl_^RMRq@-Myz&|TKZBj1=Q()) zF{dBjv5)h=&Z)Aevx}+i|7=R9rG^Di!sa)sZCl&ctX4&LScQ-kMncgO(9o6W6)yd< z@Rk!vkja*X_N3H=BavGoR0@u0<}m-7|2v!0+2h~S2Q&a=lTH91OJsvms2MT~ zY=c@LO5i`mLpBd(vh|)I&^A3TQLtr>w=zoyzTd=^f@TPu&+*2MtqE$Avf>l>}V|3-8Fp2hzo3y<)hr_|NO(&oSD z!vEjTWBxbKTiShVl-U{n*B3#)3a8$`{~Pk}J@elZ=>Pqp|MQ}jrGv7KrNcjW%TN_< zZz8kG{#}XoeWf7qY?D)L)8?Q-b@Na&>i=)(@uNo zr;cH98T3$Iau8Hn*@vXi{A@YehxDE2zX~o+RY`)6-X{8~hMpc#C`|8y> zU8Mnv5A0dNCf{Ims*|l-^ z(MRp{qoGohB34|ggDI*p!Aw|MFyJ|v+<+E3brfrI)|+l3W~CQLPbnF@G0)P~Ly!1TJLp}xh8uW`Q+RB-v`MRYZ9Gam3cM%{ zb4Cb*f)0deR~wtNb*8w-LlIF>kc7DAv>T0D(a3@l`k4TFnrO+g9XH7;nYOHxjc4lq zMmaW6qpgAgy)MckYMhl?>sq;-1E)-1llUneeA!ya9KM$)DaNGu57Z5aE>=VST$#vb zFo=uRHr$0M{-ha>h(D_boS4zId;3B|Tpqo|?B?Z@I?G(?&Iei+-{9L_A9=h=Qfn-U z1wIUnQe9!z%_j$F_{rf&`ZFSott09gY~qrf@g3O=Y>vzAnXCyL!@(BqWa)Zqt!#_k zfZHuwS52|&&)aK;CHq9V-t9qt0au{$#6c*R#e5n3rje0hic7c7m{kW$p(_`wB=Gw7 z4k`1Hi;Mc@yA7dp@r~?@rfw)TkjAW++|pkfOG}0N|2guek}j8Zen(!+@7?qt_7ndX zB=BG6WJ31#F3#Vk3=aQr8T)3`{=p9nBHlKzE0I@v`{vJ}h8pd6vby&VgFhzH|q;=aonunAXL6G2y(X^CtAhWr*jI zGjpY@raZDQkg*aMq}Ni6cRF z{oWv}5`nhSAv>usX}m^GHt`f(t8@zHc?K|y5Zi=4G*UG1Sza{$Dpj%X8 zzEXaKT5N6F5j4J|w#qlZP!zS7BT)9b+!ZSJdToqJts1c!)fwih4d31vfb{}W)EgcA zH2pZ^8_k$9+WD2n`6q5XbOy8>3pcYH9 z07eUB+p}YD@AH!}p!iKv><2QF-Y^&xx^PAc1F13A{nUeCDg&{hnix#FiO!fe(^&%Qcux!h znu*S!s$&nnkeotYsDthh1dq(iQrE|#f_=xVgfiiL&-5eAcC-> z5L0l|DVEM$#ulf{bj+Y~7iD)j<~O8CYM8GW)dQGq)!mck)FqoL^X zwNdZb3->hFrbHFm?hLvut-*uK?zXn3q1z|UX{RZ;-WiLoOjnle!xs+W0-8D)kjU#R z+S|A^HkRg$Ij%N4v~k`jyHffKaC~=wg=9)V5h=|kLQ@;^W!o2^K+xG&2n`XCd>OY5Ydi= zgHH=lgy++erK8&+YeTl7VNyVm9-GfONlSlVb3)V9NW5tT!cJ8d7X)!b-$fb!s76{t z@d=Vg-5K_sqHA@Zx-L_}wVnc@L@GL9_K~Zl(h5@AR#FAiKad8~KeWCo@mgXIQ#~u{ zgYFwNz}2b6Vu@CP0XoqJ+dm8px(5W5-Jpis97F`+KM)TuP*X8H@zwiVKDKGVp59pI zifNHZr|B+PG|7|Y<*tqap0CvG7tbR1R>jn70t1X`XJixiMVcHf%Ez*=xm1(CrTSDt z0cle!+{8*Ja&EOZ4@$qhBuKQ$U95Q%rc7tg$VRhk?3=pE&n+T3upZg^ZJc9~c2es% zh7>+|mrmA-p&v}|OtxqmHIBgUxL~^0+cpfkSK2mhh+4b=^F1Xgd2)}U*Yp+H?ls#z zrLxWg_hm}AfK2XYWr!rzW4g;+^^&bW%LmbtRai9f3PjU${r@n`JThy-cphbcwn)rq9{A$Ht`lmYKxOacy z6v2R(?gHhD5@&kB-Eg?4!hAoD7~(h>(R!s1c1Hx#s9vGPePUR|of32bS`J5U5w{F) z>0<^ktO2UHg<0{oxkdOQ;}coZDQph8p6ruj*_?uqURCMTac;>T#v+l1Tc~%^k-Vd@ zkc5y35jVNc49vZpZx;gG$h{%yslDI%Lqga1&&;mN{Ush1c7p>7e-(zp}6E7f-XmJb4nhk zb8zS+{IVbL$QVF8pf8}~kQ|dHJAEATmmnrb_wLG}-yHe>W|A&Y|;muy-d^t^<&)g5SJfaTH@P1%euONny=mxo+C z4N&w#biWY41r8k~468tvuYVh&XN&d#%QtIf9;iVXfWY)#j=l`&B~lqDT@28+Y!0E+MkfC}}H*#(WKKdJJq=O$vNYCb(ZG@p{fJgu;h z21oHQ(14?LeT>n5)s;uD@5&ohU!@wX8w*lB6i@GEH0pM>YTG+RAIWZD;4#F1&F%Jp zXZUml2sH0!lYJT?&sA!qwez6cXzJEd(1ZC~kT5kZSp7(@=H2$Azb_*W&6aA|9iwCL zdX7Q=42;@dspHDwYE?miGX#L^3xD&%BI&fN9^;`v4OjQXPBaBmOF1;#C)8XA(WFlH zycro;DS2?(G&6wkr6rqC>rqDv3nfGw3hmN_9Al>TgvmGsL8_hXx09};l9Ow@)F5@y z#VH5WigLDwZE4nh^7&@g{1FV^UZ%_LJ-s<{HN*2R$OPg@R~Z`c-ET*2}XB@9xvAjrK&hS=f|R8Gr9 zr|0TGOsI7RD+4+2{ZiwdVD@2zmg~g@^D--YL;6UYGSM8i$NbQr4!c7T9rg!8;TM0E zT#@?&S=t>GQm)*ua|?TLT2ktj#`|R<_*FAkOu2Pz$wEc%-=Y9V*$&dg+wIei3b*O8 z2|m$!jJG!J!ZGbbIa!(Af~oSyZV+~M1qGvelMzPNE_%5?c2>;MeeG2^N?JDKjFYCy z7SbPWH-$cWF9~fX%9~v99L!G(wi!PFp>rB!9xj7=Cv|F+7CsGNwY0Q_J%FID%C^CBZQfJ9K(HK%k31j~e#&?hQ zNuD6gRkVckU)v+53-fc} z7ZCzYN-5RG4H7;>>Hg?LU9&5_aua?A0)0dpew1#MMlu)LHe(M;OHjHIUl7|%%)YPo z0cBk;AOY00%Fe6heoN*$(b<)Cd#^8Iu;-2v@>cE-OB$icUF9EEoaC&q8z9}jMTT2I z8`9;jT%z0;dy4!8U;GW{i`)3!c6&oWY`J3669C!tM<5nQFFrFRglU8f)5Op$GtR-3 zn!+SPCw|04sv?%YZ(a7#L?vsdr7ss@WKAw&A*}-1S|9~cL%uA+E~>N6QklFE>8W|% zyX-qAUGTY1hQ-+um`2|&ji0cY*(qN!zp{YpDO-r>jPk*yuVSay<)cUt`t@&FPF_&$ zcHwu1(SQ`I-l8~vYyUxm@D1UEdFJ$f5Sw^HPH7b!9 zzYT3gKMF((N(v0#4f_jPfVZ=ApN^jQJe-X$`A?X+vWjLn_%31KXE*}5_}d8 zw_B1+a#6T1?>M{ronLbHIlEsMf93muJ7AH5h%;i99<~JX^;EAgEB1uHralD*!aJ@F zV2ruuFe9i2Q1C?^^kmVy921eb=tLDD43@-AgL^rQ3IO9%+vi_&R2^dpr}x{bCVPej z7G0-0o64uyWNtr*loIvslyo0%)KSDDKjfThe0hcqs)(C-MH1>bNGBDRTW~scy_{w} zp^aq8Qb!h9Lwielq%C1b8=?Z=&U)ST&PHbS)8Xzjh2DF?d{iAv)Eh)wsUnf>UtXN( zL7=$%YrZ#|^c{MYmhn!zV#t*(jdmYdCpwqpZ{v&L8KIuKn`@IIZfp!uo}c;7J57N` zAxyZ-uA4=Gzl~Ovycz%MW9ZL7N+nRo&1cfNn9(1H5eM;V_4Z_qVann7F>5f>%{rf= zPBZFaV@_Sobl?Fy&KXyzFDV*FIdhS5`Uc~S^Gjo)aiTHgn#<0C=9o-a-}@}xDor;D zZyZ|fvf;+=3MZd>SR1F^F`RJEZo+|MdyJYQAEauKu%WDol~ayrGU3zzbHKsnHKZ*z zFiwUkL@DZ>!*x05ql&EBq@_Vqv83&?@~q5?lVmffQZ+V-=qL+!u4Xs2Z2zdCQ3U7B&QR9_Iggy} z(om{Y9eU;IPe`+p1ifLx-XWh?wI)xU9ik+m#g&pGdB5Bi<`PR*?92lE0+TkRuXI)z z5LP!N2+tTc%cB6B1F-!fj#}>S!vnpgVU~3!*U1ej^)vjUH4s-bd^%B=ItQqDCGbrEzNQi(dJ`J}-U=2{7-d zK8k^Rlq2N#0G?9&1?HSle2vlkj^KWSBYTwx`2?9TU_DX#J+f+qLiZCqY1TXHFxXZqYMuD@RU$TgcnCC{_(vwZ-*uX)~go#%PK z@}2Km_5aQ~(<3cXeJN6|F8X_1@L%@xTzs}$_*E|a^_URF_qcF;Pfhoe?FTFwvjm1o z8onf@OY@jC2tVcMaZS;|T!Ks(wOgPpRzRnFS-^RZ4E!9dsnj9sFt609a|jJbb1Dt@ z<=Gal2jDEupxUSwWu6zp<<&RnAA;d&4gKVG0iu6g(DsST(4)z6R)zDpfaQ}v{5ARt zyhwvMtF%b-YazR5XLz+oh=mn;y-Mf2a8>7?2v8qX;19y?b>Z5laGHvzH;Nu9S`B8} zI)qN$GbXIQ1VL3lnof^6TS~rvPVg4V?Dl2Bb*K2z4E{5vy<(@@K_cN@U>R!>aUIRnb zL*)=787*cs#zb31zBC49x$`=fkQbMAef)L2$dR{)6BAz!t5U_B#1zZG`^neKSS22oJ#5B=gl%U=WeqL9REF2g zZnfCb0?quf?Ztj$VXvDSWoK`0L=Zxem2q}!XWLoT-kYMOx)!7fcgT35uC~0pySEme z`{wGWTkGr7>+Kb^n;W?BZH6ZP(9tQX%-7zF>vc2}LuWDI(9kh1G#7B99r4x6;_-V+k&c{nPUrR zAXJGRiMe~aup{0qzmLNjS_BC4cB#sXjckx{%_c&^xy{M61xEb>KW_AG5VFXUOjAG4 z^>Qlm9A#1N{4snY=(AmWzatb!ngqiqPbBZ7>Uhb3)dTkSGcL#&SH>iMO-IJBPua`u zo)LWZ>=NZLr758j{%(|uQuZ)pXq_4c!!>s|aDM9#`~1bzK3J1^^D#<2bNCccH7~-X}Ggi!pIIF>uFx%aPARGQsnC8ZQc8lrQ5o~smqOg>Ti^GNme94*w z)JZy{_{#$jxGQ&`M z!OMvZMHR>8*^>eS%o*6hJwn!l8VOOjZQJvh)@tnHVW&*GYPuxqXw}%M!(f-SQf`=L z5;=5w2;%82VMH6Xi&-K3W)o&K^+vJCepWZ-rW%+Dc6X3(){z$@4zjYxQ|}8UIojeC zYZpQ1dU{fy=oTr<4VX?$q)LP}IUmpiez^O&N3E_qPpchGTi5ZM6-2ScWlQq%V&R2Euz zO|Q0Hx>lY1Q1cW5xHv5!0OGU~PVEqSuy#fD72d#O`N!C;o=m+YioGu-wH2k6!t<~K zSr`E=W9)!g==~x9VV~-8{4ZN9{~-A9zJpRe%NGg$+MDuI-dH|b@BD)~>pPCGUNNzY zMDg||0@XGQgw`YCt5C&A{_+J}mvV9Wg{6V%2n#YSRN{AP#PY?1FF1#|vO_%e+#`|2*~wGAJaeRX6=IzFNeWhz6gJc8+(03Ph4y6ELAm=AkN7TOgMUEw*N{= z_)EIDQx5q22oUR+_b*tazu9+pX|n1c*IB-}{DqIj z-?E|ks{o3AGRNb;+iKcHkZvYJvFsW&83RAPs1Oh@IWy%l#5x2oUP6ZCtv+b|q>jsf zZ_9XO;V!>n`UxH1LvH8)L4?8raIvasEhkpQoJ`%!5rBs!0Tu(s_D{`4opB;57)pkX z4$A^8CsD3U5*!|bHIEqsn~{q+Ddj$ME@Gq4JXtgVz&7l{Ok!@?EA{B3P~NAqb9)4? zkQo30A^EbHfQ@87G5&EQTd`frrwL)&Yw?%-W@uy^Gn23%j?Y!Iea2xw<-f;esq zf%w5WN@E1}zyXtYv}}`U^B>W`>XPmdLj%4{P298|SisrE;7HvXX;A}Ffi8B#3Lr;1 zHt6zVb`8{#+e$*k?w8|O{Uh|&AG}|DG1PFo1i?Y*cQm$ZwtGcVgMwtBUDa{~L1KT-{jET4w60>{KZ27vXrHJ;fW{6| z=|Y4!&UX020wU1>1iRgB@Q#m~1^Z^9CG1LqDhYBrnx%IEdIty z!46iOoKlKs)c}newDG)rWUikD%j`)p z_w9Ph&e40=(2eBy;T!}*1p1f1SAUDP9iWy^u^Ubdj21Kn{46;GR+hwLO=4D11@c~V zI8x&(D({K~Df2E)Nx_yQvYfh4;MbMJ@Z}=Dt3_>iim~QZ*hZIlEs0mEb z_54+&*?wMD`2#vsQRN3KvoT>hWofI_Vf(^C1ff-Ike@h@saEf7g}<9T`W;HAne-Nd z>RR+&SP35w)xKn8^U$7))PsM!jKwYZ*RzEcG-OlTrX3}9a{q%#Un5E5W{{hp>w~;` zGky+3(vJvQyGwBo`tCpmo0mo((?nM8vf9aXrrY1Ve}~TuVkB(zeds^jEfI}xGBCM2 zL1|#tycSaWCurP+0MiActG3LCas@_@tao@(R1ANlwB$4K53egNE_;!&(%@Qo$>h`^1S_!hN6 z)vZtG$8fN!|BXBJ=SI>e(LAU(y(i*PHvgQ2llulxS8>qsimv7yL}0q_E5WiAz7)(f zC(ahFvG8&HN9+6^jGyLHM~$)7auppeWh_^zKk&C_MQ~8;N??OlyH~azgz5fe^>~7F zl3HnPN3z-kN)I$4@`CLCMQx3sG~V8hPS^}XDXZrQA>}mQPw%7&!sd(Pp^P=tgp-s^ zjl}1-KRPNWXgV_K^HkP__SR`S-|OF0bR-N5>I%ODj&1JUeAQ3$9i;B~$S6}*^tK?= z**%aCiH7y?xdY?{LgVP}S0HOh%0%LI$wRx;$T|~Y8R)Vdwa}kGWv8?SJVm^>r6+%I z#lj1aR94{@MP;t-scEYQWc#xFA30^}?|BeX*W#9OL;Q9#WqaaM546j5j29((^_8Nu z4uq}ESLr~r*O7E7$D{!k9W>`!SLoyA53i9QwRB{!pHe8um|aDE`Cg0O*{jmor)^t)3`>V>SWN-2VJcFmj^1?~tT=JrP`fVh*t zXHarp=8HEcR#vFe+1a%XXuK+)oFs`GDD}#Z+TJ}Ri`FvKO@ek2ayn}yaOi%(8p%2$ zpEu)v0Jym@f}U|-;}CbR=9{#<^z28PzkkTNvyKvJDZe+^VS2bES3N@Jq!-*}{oQlz z@8bgC_KnDnT4}d#&Cpr!%Yb?E!brx0!eVOw~;lLwUoz#Np%d$o%9scc3&zPm`%G((Le|6o1 zM(VhOw)!f84zG^)tZ1?Egv)d8cdNi+T${=5kV+j;Wf%2{3g@FHp^Gf*qO0q!u$=m9 zCaY`4mRqJ;FTH5`a$affE5dJrk~k`HTP_7nGTY@B9o9vvnbytaID;^b=Tzp7Q#DmD zC(XEN)Ktn39z5|G!wsVNnHi) z%^q94!lL|hF`IijA^9NR0F$@h7k5R^ljOW(;Td9grRN0Mb)l_l7##{2nPQ@?;VjXv zaLZG}yuf$r$<79rVPpXg?6iiieX|r#&`p#Con2i%S8*8F}(E) zI5E6c3tG*<;m~6>!&H!GJ6zEuhH7mkAzovdhLy;)q z{H2*8I^Pb}xC4s^6Y}6bJvMu=8>g&I)7!N!5QG$xseeU#CC?ZM-TbjsHwHgDGrsD= z{%f;@Sod+Ch66Ko2WF~;Ty)v>&x^aovCbCbD7>qF*!?BXmOV3(s|nxsb*Lx_2lpB7 zokUnzrk;P=T-&kUHO}td+Zdj!3n&NR?K~cRU zAXU!DCp?51{J4w^`cV#ye}(`SQhGQkkMu}O3M*BWt4UsC^jCFUy;wTINYmhD$AT;4 z?Xd{HaJjP`raZ39qAm;%beDbrLpbRf(mkKbANan7XsL>_pE2oo^$TgdidjRP!5-`% zv0d!|iKN$c0(T|L0C~XD0aS8t{*&#LnhE;1Kb<9&=c2B+9JeLvJr*AyyRh%@jHej=AetOMSlz^=!kxX>>B{2B1uIrQyfd8KjJ+DBy!h)~*(!|&L4^Q_07SQ~E zcemVP`{9CwFvPFu7pyVGCLhH?LhEVb2{7U+Z_>o25#+3<|8%1T^5dh}*4(kfJGry} zm%r#hU+__Z;;*4fMrX=Bkc@7|v^*B;HAl0((IBPPii%X9+u3DDF6%bI&6?Eu$8&aWVqHIM7mK6?Uvq$1|(-T|)IV<>e?!(rY zqkmO1MRaLeTR=)io(0GVtQT@s6rN%C6;nS3@eu;P#ry4q;^O@1ZKCJyp_Jo)Ty^QW z+vweTx_DLm{P-XSBj~Sl<%_b^$=}odJ!S2wAcxenmzFGX1t&Qp8Vxz2VT`uQsQYtdn&_0xVivIcxZ_hnrRtwq4cZSj1c-SG9 z7vHBCA=fd0O1<4*=lu$6pn~_pVKyL@ztw1swbZi0B?spLo56ZKu5;7ZeUml1Ws1?u zqMf1p{5myAzeX$lAi{jIUqo1g4!zWLMm9cfWcnw`k6*BR^?$2(&yW?>w;G$EmTA@a z6?y#K$C~ZT8+v{87n5Dm&H6Pb_EQ@V0IWmG9cG=O;(;5aMWWrIPzz4Q`mhK;qQp~a z+BbQrEQ+w{SeiuG-~Po5f=^EvlouB@_|4xQXH@A~KgpFHrwu%dwuCR)=B&C(y6J4J zvoGk9;lLs9%iA-IJGU#RgnZZR+@{5lYl8(e1h6&>Vc_mvg0d@);X zji4T|n#lB!>pfL|8tQYkw?U2bD`W{na&;*|znjmalA&f;*U++_aBYerq;&C8Kw7mI z7tsG*?7*5j&dU)Lje;^{D_h`%(dK|pB*A*1(Jj)w^mZ9HB|vGLkF1GEFhu&rH=r=8 zMxO42e{Si6$m+Zj`_mXb&w5Q(i|Yxyg?juUrY}78uo@~3v84|8dfgbPd0iQJRdMj< zncCNGdMEcsxu#o#B5+XD{tsg*;j-eF8`mp~K8O1J!Z0+>0=7O=4M}E?)H)ENE;P*F z$Ox?ril_^p0g7xhDUf(q652l|562VFlC8^r8?lQv;TMvn+*8I}&+hIQYh2 z1}uQQaag&!-+DZ@|C+C$bN6W;S-Z@)d1|en+XGvjbOxCa-qAF*LA=6s(Jg+g;82f$ z(Vb)8I)AH@cdjGFAR5Rqd0wiNCu!xtqWbcTx&5kslzTb^7A78~Xzw1($UV6S^VWiP zFd{Rimd-0CZC_Bu(WxBFW7+k{cOW7DxBBkJdJ;VsJ4Z@lERQr%3eVv&$%)b%<~ zCl^Y4NgO}js@u{|o~KTgH}>!* z_iDNqX2(As7T0xivMH|3SC1ivm8Q}6Ffcd7owUKN5lHAtzMM4<0v+ykUT!QiowO;`@%JGv+K$bBx@*S7C8GJVqQ_K>12}M`f_Ys=S zKFh}HM9#6Izb$Y{wYzItTy+l5U2oL%boCJn?R3?jP@n$zSIwlmyGq30Cw4QBO|14` zW5c);AN*J3&eMFAk$SR~2k|&+&Bc$e>s%c{`?d~85S-UWjA>DS5+;UKZ}5oVa5O(N zqqc@>)nee)+4MUjH?FGv%hm2{IlIF-QX}ym-7ok4Z9{V+ZHVZQl$A*x!(q%<2~iVv znUa+BX35&lCb#9VE-~Y^W_f;Xhl%vgjwdjzMy$FsSIj&ok}L+X`4>J=9BkN&nu^E*gbhj3(+D>C4E z@Fwq_=N)^bKFSHTzZk?-gNU$@l}r}dwGyh_fNi=9b|n}J>&;G!lzilbWF4B}BBq4f zYIOl?b)PSh#XTPp4IS5ZR_2C!E)Z`zH0OW%4;&~z7UAyA-X|sh9@~>cQW^COA9hV4 zXcA6qUo9P{bW1_2`eo6%hgbN%(G-F1xTvq!sc?4wN6Q4`e9Hku zFwvlAcRY?6h^Fj$R8zCNEDq8`=uZB8D-xn)tA<^bFFy}4$vA}Xq0jAsv1&5!h!yRA zU()KLJya5MQ`q&LKdH#fwq&(bNFS{sKlEh_{N%{XCGO+po#(+WCLmKW6&5iOHny>g z3*VFN?mx!16V5{zyuMWDVP8U*|BGT$(%IO|)?EF|OI*sq&RovH!N%=>i_c?K*A>>k zyg1+~++zY4Q)J;VWN0axhoIKx;l&G$gvj(#go^pZskEVj8^}is3Jw26LzYYVos0HX zRPvmK$dVxM8(Tc?pHFe0Z3uq){{#OK3i-ra#@+;*=ui8)y6hsRv z4Fxx1c1+fr!VI{L3DFMwXKrfl#Q8hfP@ajgEau&QMCxd{g#!T^;ATXW)nUg&$-n25 zruy3V!!;{?OTobo|0GAxe`Acn3GV@W=&n;~&9 zQM>NWW~R@OYORkJAo+eq1!4vzmf9K%plR4(tB@TR&FSbDoRgJ8qVcH#;7lQub*nq&?Z>7WM=oeEVjkaG zT#f)=o!M2DO5hLR+op>t0CixJCIeXH*+z{-XS|%jx)y(j&}Wo|3!l7{o)HU3m7LYyhv*xF&tq z%IN7N;D4raue&&hm0xM=`qv`+TK@;_xAcGKuK(2|75~ar2Yw)geNLSmVxV@x89bQu zpViVKKnlkwjS&&c|-X6`~xdnh}Ps)Hs z4VbUL^{XNLf7_|Oi>tA%?SG5zax}esF*FH3d(JH^Gvr7Rp*n=t7frH!U;!y1gJB^i zY_M$KL_}mW&XKaDEi9K-wZR|q*L32&m+2n_8lq$xRznJ7p8}V>w+d@?uB!eS3#u<} zIaqi!b!w}a2;_BfUUhGMy#4dPx>)_>yZ`ai?Rk`}d0>~ce-PfY-b?Csd(28yX22L% zI7XI>OjIHYTk_@Xk;Gu^F52^Gn6E1&+?4MxDS2G_#PQ&yXPXP^<-p|2nLTb@AAQEY zI*UQ9Pmm{Kat}wuazpjSyXCdnrD&|C1c5DIb1TnzF}f4KIV6D)CJ!?&l&{T)e4U%3HTSYqsQ zo@zWB1o}ceQSV)<4G<)jM|@@YpL+XHuWsr5AYh^Q{K=wSV99D~4RRU52FufmMBMmd z_H}L#qe(}|I9ZyPRD6kT>Ivj&2Y?qVZq<4bG_co_DP`sE*_Xw8D;+7QR$Uq(rr+u> z8bHUWbV19i#)@@G4bCco@Xb<8u~wVDz9S`#k@ciJtlu@uP1U0X?yov8v9U3VOig2t zL9?n$P3=1U_Emi$#slR>N5wH-=J&T=EdUHA}_Z zZIl3nvMP*AZS9{cDqFanrA~S5BqxtNm9tlu;^`)3X&V4tMAkJ4gEIPl= zoV!Gyx0N{3DpD@)pv^iS*dl2FwANu;1;%EDl}JQ7MbxLMAp>)UwNwe{=V}O-5C*>F zu?Ny+F64jZn<+fKjF01}8h5H_3pey|;%bI;SFg$w8;IC<8l|3#Lz2;mNNik6sVTG3 z+Su^rIE#40C4a-587$U~%KedEEw1%r6wdvoMwpmlXH$xPnNQN#f%Z7|p)nC>WsuO= z4zyqapLS<8(UJ~Qi9d|dQijb_xhA2)v>la)<1md5s^R1N&PiuA$^k|A<+2C?OiHbj z>Bn$~t)>Y(Zb`8hW7q9xQ=s>Rv81V+UiuZJc<23HplI88isqRCId89fb`Kt|CxVIg znWcwprwXnotO>3s&Oypkte^9yJjlUVVxSe%_xlzmje|mYOVPH^vjA=?6xd0vaj0Oz zwJ4OJNiFdnHJX3rw&inskjryukl`*fRQ#SMod5J|KroJRsVXa5_$q7whSQ{gOi*s0 z1LeCy|JBWRsDPn7jCb4s(p|JZiZ8+*ExC@Vj)MF|*Vp{B(ziccSn`G1Br9bV(v!C2 z6#?eqpJBc9o@lJ#^p-`-=`4i&wFe>2)nlPK1p9yPFzJCzBQbpkcR>={YtamIw)3nt z(QEF;+)4`>8^_LU)_Q3 zC5_7lgi_6y>U%m)m@}Ku4C}=l^J=<<7c;99ec3p{aR+v=diuJR7uZi%aQv$oP?dn?@6Yu_+*^>T0ptf(oobdL;6)N-I!TO`zg^Xbv3#L0I~sn@WGk-^SmPh5>W+LB<+1PU}AKa?FCWF|qMNELOgdxR{ zbqE7@jVe+FklzdcD$!(A$&}}H*HQFTJ+AOrJYnhh}Yvta(B zQ_bW4Rr;R~&6PAKwgLWXS{Bnln(vUI+~g#kl{r+_zbngT`Y3`^Qf=!PxN4IYX#iW4 zucW7@LLJA9Zh3(rj~&SyN_pjO8H&)|(v%!BnMWySBJV=eSkB3YSTCyIeJ{i;(oc%_hk{$_l;v>nWSB)oVeg+blh=HB5JSlG_r7@P z3q;aFoZjD_qS@zygYqCn=;Zxjo!?NK!%J$ z52lOP`8G3feEj+HTp@Tnn9X~nG=;tS+z}u{mQX_J0kxtr)O30YD%oo)L@wy`jpQYM z@M>Me=95k1p*FW~rHiV1CIfVc{K8r|#Kt(ApkXKsDG$_>76UGNhHExFCw#Ky9*B-z zNq2ga*xax!HMf_|Vp-86r{;~YgQKqu7%szk8$hpvi_2I`OVbG1doP(`gn}=W<8%Gn z%81#&WjkH4GV;4u43EtSW>K_Ta3Zj!XF?;SO3V#q=<=>Tc^@?A`i;&`-cYj|;^ zEo#Jl5zSr~_V-4}y8pnufXLa80vZY4z2ko7fj>DR)#z=wWuS1$$W!L?(y}YC+yQ|G z@L&`2upy3f>~*IquAjkVNU>}c10(fq#HdbK$~Q3l6|=@-eBbo>B9(6xV`*)sae58*f zym~RRVx;xoCG3`JV`xo z!lFw)=t2Hy)e!IFs?0~7osWk(d%^wxq&>_XD4+U#y&-VF%4z?XH^i4w`TxpF{`XhZ z%G}iEzf!T(l>g;W9<~K+)$g!{UvhW{E0Lis(S^%I8OF&%kr!gJ&fMOpM=&=Aj@wuL zBX?*6i51Qb$uhkwkFYkaD_UDE+)rh1c;(&Y=B$3)J&iJfQSx!1NGgPtK!$c9OtJuu zX(pV$bfuJpRR|K(dp@^j}i&HeJOh@|7lWo8^$*o~Xqo z5Sb+!EtJ&e@6F+h&+_1ETbg7LfP5GZjvIUIN3ibCOldAv z)>YdO|NH$x7AC8dr=<2ekiY1%fN*r~e5h6Yaw<{XIErujKV~tiyrvV_DV0AzEknC- zR^xKM3i<1UkvqBj3C{wDvytOd+YtDSGu!gEMg+!&|8BQrT*|p)(dwQLEy+ zMtMzij3zo40)CA!BKZF~yWg?#lWhqD3@qR)gh~D{uZaJO;{OWV8XZ_)J@r3=)T|kt zUS1pXr6-`!Z}w2QR7nP%d?ecf90;K_7C3d!UZ`N(TZoWNN^Q~RjVhQG{Y<%E1PpV^4 z-m-K+$A~-+VDABs^Q@U*)YvhY4Znn2^w>732H?NRK(5QSS$V@D7yz2BVX4)f5A04~$WbxGOam22>t&uD)JB8-~yiQW6ik;FGblY_I>SvB_z2?PS z*Qm&qbKI{H1V@YGWzpx`!v)WeLT02};JJo*#f$a*FH?IIad-^(;9XC#YTWN6;Z6+S zm4O1KH=#V@FJw7Pha0!9Vb%ZIM$)a`VRMoiN&C|$YA3~ZC*8ayZRY^fyuP6$n%2IU z$#XceYZeqLTXw(m$_z|33I$B4k~NZO>pP6)H_}R{E$i%USGy{l{-jOE;%CloYPEU+ zRFxOn4;7lIOh!7abb23YKD+_-?O z0FP9otcAh+oSj;=f#$&*ExUHpd&e#bSF%#8*&ItcL2H$Sa)?pt0Xtf+t)z$_u^wZi z44oE}r4kIZGy3!Mc8q$B&6JqtnHZ>Znn!Zh@6rgIu|yU+zG8q`q9%B18|T|oN3zMq z`l&D;U!OL~%>vo&q0>Y==~zLiCZk4v%s_7!9DxQ~id1LLE93gf*gg&2$|hB#j8;?3 z5v4S;oM6rT{Y;I+#FdmNw z){d%tNM<<#GN%n9ox7B=3#;u7unZ~tLB_vRZ52a&2=IM)2VkXm=L+Iqq~uk#Dug|x z>S84e+A7EiOY5lj*!q?6HDkNh~0g;0Jy(al!ZHHDtur9T$y-~)94HelX1NHjXWIM7UAe}$?jiz z9?P4`I0JM=G5K{3_%2jPLC^_Mlw?-kYYgb7`qGa3@dn|^1fRMwiyM@Ch z;CB&o7&&?c5e>h`IM;Wnha0QKnEp=$hA8TJgR-07N~U5(>9vJzeoFsSRBkDq=x(YgEMpb=l4TDD`2 zwVJpWGTA_u7}?ecW7s6%rUs&NXD3+n;jB86`X?8(l3MBo6)PdakI6V6a}22{)8ilT zM~T*mU}__xSy|6XSrJ^%lDAR3Lft%+yxC|ZUvSO_nqMX!_ul3;R#*{~4DA=h$bP)%8Yv9X zyp><|e8=_ttI}ZAwOd#dlnSjck#6%273{E$kJuCGu=I@O)&6ID{nWF5@gLb16sj|&Sb~+du4e4O_%_o`Ix4NRrAsyr1_}MuP94s>de8cH-OUkVPk3+K z&jW)It9QiU-ti~AuJkL`XMca8Oh4$SyJ=`-5WU<{cIh+XVH#e4d&zive_UHC!pN>W z3TB;Mn5i)9Qn)#6@lo4QpI3jFYc0~+jS)4AFz8fVC;lD^+idw^S~Qhq>Tg(!3$yLD zzktzoFrU@6s4wwCMz}edpF5i5Q1IMmEJQHzp(LAt)pgN3&O!&d?3W@6U4)I^2V{;- z6A(?zd93hS*uQmnh4T)nHnE{wVhh(=MMD(h(P4+^p83Om6t<*cUW>l(qJzr%5vp@K zN27ka(L{JX=1~e2^)F^i=TYj&;<7jyUUR2Bek^A8+3Up*&Xwc{)1nRR5CT8vG>ExV zHnF3UqXJOAno_?bnhCX-&kwI~Ti8t4`n0%Up>!U`ZvK^w2+0Cs-b9%w%4`$+To|k= zKtgc&l}P`*8IS>8DOe?EB84^kx4BQp3<7P{Pq}&p%xF_81pg!l2|u=&I{AuUgmF5n zJQCTLv}%}xbFGYtKfbba{CBo)lWW%Z>i(_NvLhoQZ*5-@2l&x>e+I~0Nld3UI9tdL zRzu8}i;X!h8LHVvN?C+|M81e>Jr38%&*9LYQec9Ax>?NN+9(_>XSRv&6hlCYB`>Qm z1&ygi{Y()OU4@D_jd_-7vDILR{>o|7-k)Sjdxkjgvi{@S>6GqiF|o`*Otr;P)kLHN zZkpts;0zw_6;?f(@4S1FN=m!4^mv~W+lJA`&7RH%2$)49z0A+8@0BCHtj|yH--AEL z0tW6G%X-+J+5a{5*WKaM0QDznf;V?L5&uQw+yegDNDP`hA;0XPYc6e0;Xv6|i|^F2WB)Z$LR|HR4 zTQsRAby9(^Z@yATyOgcfQw7cKyr^3Tz7lc7+JEwwzA7)|2x+PtEb>nD(tpxJQm)Kn zW9K_*r!L%~N*vS8<5T=iv|o!zTe9k_2jC_j*7ik^M_ zaf%k{WX{-;0*`t`G!&`eW;gChVXnJ-Rn)To8vW-?>>a%QU1v`ZC=U)f8iA@%JG0mZ zDqH;~mgBnrCP~1II<=V9;EBL)J+xzCoiRBaeH&J6rL!{4zIY8tZka?_FBeQeNO3q6 zyG_alW54Ba&wQf{&F1v-r1R6ID)PTsqjIBc+5MHkcW5Fnvi~{-FjKe)t1bl}Y;z@< z=!%zvpRua>>t_x}^}z0<7MI!H2v6|XAyR9!t50q-A)xk0nflgF4*OQlCGK==4S|wc zRMsSscNhRzHMBU8TdcHN!q^I}x0iXJ%uehac|Zs_B$p@CnF)HeXPpB_Za}F{<@6-4 zl%kml@}kHQ(ypD8FsPJ2=14xXJE|b20RUIgs!2|R3>LUMGF6X*B_I|$`Qg=;zm7C z{mEDy9dTmPbued7mlO@phdmAmJ7p@GR1bjCkMw6*G7#4+`k>fk1czdJUB!e@Q(~6# zwo%@p@V5RL0ABU2LH7Asq^quDUho@H>eTZH9f*no9fY0T zD_-9px3e}A!>>kv5wk91%C9R1J_Nh!*&Kk$J3KNxC}c_@zlgpJZ+5L)Nw|^p=2ue}CJtm;uj*Iqr)K})kA$xtNUEvX;4!Px*^&9T_`IN{D z{6~QY=Nau6EzpvufB^hflc#XIsSq0Y9(nf$d~6ZwK}fal92)fr%T3=q{0mP-EyP_G z)UR5h@IX}3Qll2b0oCAcBF>b*@Etu*aTLPU<%C>KoOrk=x?pN!#f_Og-w+;xbFgjQ zXp`et%lDBBh~OcFnMKMUoox0YwBNy`N0q~bSPh@+enQ=4RUw1) zpovN`QoV>vZ#5LvC;cl|6jPr}O5tu!Ipoyib8iXqy}TeJ;4+_7r<1kV0v5?Kv>fYp zg>9L`;XwXa&W7-jf|9~uP2iyF5`5AJ`Q~p4eBU$MCC00`rcSF>`&0fbd^_eqR+}mK z4n*PMMa&FOcc)vTUR zlDUAn-mh`ahi_`f`=39JYTNVjsTa_Y3b1GOIi)6dY)D}xeshB0T8Eov5%UhWd1)u}kjEQ|LDo{tqKKrYIfVz~@dp!! zMOnah@vp)%_-jDTUG09l+;{CkDCH|Q{NqX*uHa1YxFShy*1+;J`gywKaz|2Q{lG8x zP?KBur`}r`!WLKXY_K;C8$EWG>jY3UIh{+BLv0=2)KH%P}6xE2kg)%(-uA6lC?u8}{K(#P*c zE9C8t*u%j2r_{;Rpe1A{9nNXU;b_N0vNgyK!EZVut~}+R2rcbsHilqsOviYh-pYX= zHw@53nlmwYI5W5KP>&`dBZe0Jn?nAdC^HY1wlR6$u^PbpB#AS&5L6zqrXN&7*N2Q` z+Rae1EwS)H=aVSIkr8Ek^1jy2iS2o7mqm~Mr&g5=jjt7VxwglQ^`h#Mx+x2v|9ZAwE$i_9918MjJxTMr?n!bZ6n$}y11u8I9COTU`Z$Fi z!AeAQLMw^gp_{+0QTEJrhL424pVDp%wpku~XRlD3iv{vQ!lAf!_jyqd_h}+Tr1XG| z`*FT*NbPqvHCUsYAkFnM`@l4u_QH&bszpUK#M~XLJt{%?00GXY?u_{gj3Hvs!=N(I z(=AuWPijyoU!r?aFTsa8pLB&cx}$*%;K$e*XqF{~*rA-qn)h^!(-;e}O#B$|S~c+U zN4vyOK0vmtx$5K!?g*+J@G1NmlEI=pyZXZ69tAv=@`t%ag_Hk{LP~OH9iE)I= zaJ69b4kuCkV0V zo(M0#>phpQ_)@j;h%m{-a*LGi(72TP)ws2w*@4|C-3+;=5DmC4s7Lp95%n%@Ko zfdr3-a7m*dys9iIci$A=4NPJ`HfJ;hujLgU)ZRuJI`n;Pw|yksu!#LQnJ#dJysgNb z@@qwR^wrk(jbq4H?d!lNyy72~Dnn87KxsgQ!)|*m(DRM+eC$wh7KnS-mho3|KE)7h zK3k;qZ;K1Lj6uEXLYUYi)1FN}F@-xJ z@@3Hb84sl|j{4$3J}aTY@cbX@pzB_qM~APljrjju6P0tY{C@ zpUCOz_NFmALMv1*blCcwUD3?U6tYs+N%cmJ98D%3)%)Xu^uvzF zS5O!sc#X6?EwsYkvPo6A%O8&y8sCCQH<%f2togVwW&{M;PR!a(ZT_A+jVAbf{@5kL zB@Z(hb$3U{T_}SKA_CoQVU-;j>2J=L#lZ~aQCFg-d<9rzs$_gO&d5N6eFSc z1ml8)P*FSi+k@!^M9nDWR5e@ATD8oxtDu=36Iv2!;dZzidIS(PCtEuXAtlBb1;H%Z zwnC^Ek*D)EX4#Q>R$$WA2sxC_t(!!6Tr?C#@{3}n{<^o;9id1RA&-Pig1e-2B1XpG zliNjgmd3c&%A}s>qf{_j#!Z`fu0xIwm4L0)OF=u(OEmp;bLCIaZX$&J_^Z%4Sq4GZ zPn6sV_#+6pJmDN_lx@1;Zw6Md_p0w9h6mHtzpuIEwNn>OnuRSC2=>fP^Hqgc)xu^4 z<3!s`cORHJh#?!nKI`Et7{3C27+EuH)Gw1f)aoP|B3y?fuVfvpYYmmukx0ya-)TQX zR{ggy5cNf4X|g)nl#jC9p>7|09_S7>1D2GTRBUTW zAkQ=JMRogZqG#v;^=11O6@rPPwvJkr{bW-Qg8`q8GoD#K`&Y+S#%&B>SGRL>;ZunM@49!}Uy zN|bBCJ%sO;@3wl0>0gbl3L@1^O60ONObz8ZI7nder>(udj-jt`;yj^nTQ$L9`OU9W zX4alF#$|GiR47%x@s&LV>2Sz2R6?;2R~5k6V>)nz!o_*1Y!$p>BC5&?hJg_MiE6UBy>RkVZj`9UWbRkN-Hk!S`=BS3t3uyX6)7SF#)71*}`~Ogz z1rap5H6~dhBJ83;q-Y<5V35C2&F^JI-it(=5D#v!fAi9p#UwV~2tZQI+W(Dv?1t9? zfh*xpxxO{-(VGB>!Q&0%^YW_F!@aZS#ucP|YaD#>wd1Fv&Z*SR&mc;asi}1G) z_H>`!akh-Zxq9#io(7%;a$)w+{QH)Y$?UK1Dt^4)up!Szcxnu}kn$0afcfJL#IL+S z5gF_Y30j;{lNrG6m~$Ay?)*V9fZuU@3=kd40=LhazjFrau>(Y>SJNtOz>8x_X-BlA zIpl{i>OarVGj1v(4?^1`R}aQB&WCRQzS~;7R{tDZG=HhgrW@B`W|#cdyj%YBky)P= zpxuOZkW>S6%q7U{VsB#G(^FMsH5QuGXhb(sY+!-R8Bmv6Sx3WzSW<1MPPN1!&PurYky(@`bP9tz z52}LH9Q?+FF5jR6-;|+GVdRA!qtd;}*-h&iIw3Tq3qF9sDIb1FFxGbo&fbG5n8$3F zyY&PWL{ys^dTO}oZ#@sIX^BKW*bon=;te9j5k+T%wJ zNJtoN1~YVj4~YRrlZl)b&kJqp+Z`DqT!la$x&&IxgOQw#yZd-nBP3!7FijBXD|IsU8Zl^ zc6?MKpJQ+7ka|tZQLfchD$PD|;K(9FiLE|eUZX#EZxhG!S-63C$jWX1Yd!6-Yxi-u zjULIr|0-Q%D9jz}IF~S%>0(jOqZ(Ln<$9PxiySr&2Oic7vb<8q=46)Ln%Z|<*z5&> z3f~Zw@m;vR(bESB<=Jqkxn(=#hQw42l(7)h`vMQQTttz9XW6^|^8EK7qhju4r_c*b zJIi`)MB$w@9epwdIfnEBR+?~);yd6C(LeMC& zn&&N*?-g&BBJcV;8&UoZi4Lmxcj16ojlxR~zMrf=O_^i1wGb9X-0@6_rpjPYemIin zmJb+;lHe;Yp=8G)Q(L1bzH*}I>}uAqhj4;g)PlvD9_e_ScR{Ipq|$8NvAvLD8MYr}xl=bU~)f%B3E>r3Bu9_t|ThF3C5~BdOve zEbk^r&r#PT&?^V1cb{72yEWH}TXEE}w>t!cY~rA+hNOTK8FAtIEoszp!qqptS&;r$ zaYV-NX96-h$6aR@1xz6_E0^N49mU)-v#bwtGJm)ibygzJ8!7|WIrcb`$XH~^!a#s& z{Db-0IOTFq#9!^j!n_F}#Z_nX{YzBK8XLPVmc&X`fT7!@$U-@2KM9soGbmOSAmqV z{nr$L^MBo_u^Joyf0E^=eo{Rt0{{e$IFA(#*kP@SQd6lWT2-#>` zP1)7_@IO!9lk>Zt?#CU?cuhiLF&)+XEM9B)cS(gvQT!X3`wL*{fArTS;Ak`J<84du zALKPz4}3nlG8Fo^MH0L|oK2-4xIY!~Oux~1sw!+It)&D3p;+N8AgqKI`ld6v71wy8I!eP0o~=RVcFQR2Gr(eP_JbSytoQ$Yt}l*4r@A8Me94y z8cTDWhqlq^qoAhbOzGBXv^Wa4vUz$(7B!mX`T=x_ueKRRDfg&Uc-e1+z4x$jyW_Pm zp?U;-R#xt^Z8Ev~`m`iL4*c#65Nn)q#=Y0l1AuD&+{|8-Gsij3LUZXpM0Bx0u7WWm zH|%yE@-#XEph2}-$-thl+S;__ciBxSSzHveP%~v}5I%u!z_l_KoW{KRx2=eB33umE zIYFtu^5=wGU`Jab8#}cnYry@9p5UE#U|VVvx_4l49JQ;jQdp(uw=$^A$EA$LM%vmE zvdEOaIcp5qX8wX{mYf0;#51~imYYPn4=k&#DsKTxo{_Mg*;S495?OBY?#gv=edYC* z^O@-sd-qa+U24xvcbL0@C7_6o!$`)sVr-jSJE4XQUQ$?L7}2(}Eixqv;L8AdJAVqc zq}RPgpnDb@E_;?6K58r3h4-!4rT4Ab#rLHLX?eMOfluJk=3i1@Gt1i#iA=O`M0@x! z(HtJP9BMHXEzuD93m|B&woj0g6T?f#^)>J>|I4C5?Gam>n9!8CT%~aT;=oco5d6U8 zMXl(=W;$ND_8+DD*?|5bJ!;8ebESXMUKBAf7YBwNVJibGaJ*(2G`F%wx)grqVPjudiaq^Kl&g$8A2 zWMxMr@_$c}d+;_B`#kUX-t|4VKH&_f^^EP0&=DPLW)H)UzBG%%Tra*5 z%$kyZe3I&S#gfie^z5)!twG={3Cuh)FdeA!Kj<-9** zvT*5%Tb`|QbE!iW-XcOuy39>D3oe6x{>&<#E$o8Ac|j)wq#kQzz|ATd=Z0K!p2$QE zPu?jL8Lb^y3_CQE{*}sTDe!2!dtlFjq&YLY@2#4>XS`}v#PLrpvc4*@q^O{mmnr5D zmyJq~t?8>FWU5vZdE(%4cuZuao0GNjp3~Dt*SLaxI#g_u>hu@k&9Ho*#CZP~lFJHj z(e!SYlLigyc?&5-YxlE{uuk$9b&l6d`uIlpg_z15dPo*iU&|Khx2*A5Fp;8iK_bdP z?T6|^7@lcx2j0T@x>X7|kuuBSB7<^zeY~R~4McconTxA2flHC0_jFxmSTv-~?zVT| zG_|yDqa9lkF*B6_{j=T>=M8r<0s;@z#h)3BQ4NLl@`Xr__o7;~M&dL3J8fP&zLfDfy z);ckcTev{@OUlZ`bCo(-3? z1u1xD`PKgSg?RqeVVsF<1SLF;XYA@Bsa&cY!I48ZJn1V<3d!?s=St?TLo zC0cNr`qD*M#s6f~X>SCNVkva^9A2ZP>CoJ9bvgXe_c}WdX-)pHM5m7O zrHt#g$F0AO+nGA;7dSJ?)|Mo~cf{z2L)Rz!`fpi73Zv)H=a5K)*$5sf_IZypi($P5 zsPwUc4~P-J1@^3C6-r9{V-u0Z&Sl7vNfmuMY4yy*cL>_)BmQF!8Om9Dej%cHxbIzA zhtV0d{=%cr?;bpBPjt@4w=#<>k5ee=TiWAXM2~tUGfm z$s&!Dm0R^V$}fOR*B^kGaipi~rx~A2cS0;t&khV1a4u38*XRUP~f za!rZMtay8bsLt6yFYl@>-y^31(*P!L^^s@mslZy(SMsv9bVoX`O#yBgEcjCmGpyc* zeH$Dw6vB5P*;jor+JOX@;6K#+xc)Z9B8M=x2a@Wx-{snPGpRmOC$zpsqW*JCh@M2Y z#K+M(>=#d^>Of9C`))h<=Bsy)6zaMJ&x-t%&+UcpLjV`jo4R2025 zXaG8EA!0lQa)|dx-@{O)qP6`$rhCkoQqZ`^SW8g-kOwrwsK8 z3ms*AIcyj}-1x&A&vSq{r=QMyp3CHdWH35!sad#!Sm>^|-|afB+Q;|Iq@LFgqIp#Z zD1%H+3I?6RGnk&IFo|u+E0dCxXz4yI^1i!QTu7uvIEH>i3rR{srcST`LIRwdV1P;W z+%AN1NIf@xxvVLiSX`8ILA8MzNqE&7>%jMzGt9wm78bo9<;h*W84i29^w!>V>{N+S zd`5Zmz^G;f=icvoOZfK5#1ctx*~UwD=ab4DGQXehQ!XYnak*dee%YN$_ZPL%KZuz$ zD;$PpT;HM^$KwtQm@7uvT`i6>Hae1CoRVM2)NL<2-k2PiX=eAx+-6j#JI?M}(tuBW zkF%jjLR)O`gI2fcPBxF^HeI|DWwQWHVR!;;{BXXHskxh8F@BMDn`oEi-NHt;CLymW z=KSv5)3dyzec0T5B*`g-MQ<;gz=nIWKUi9ko<|4I(-E0k$QncH>E4l z**1w&#={&zv4Tvhgz#c29`m|;lU-jmaXFMC11 z*dlXDMEOG>VoLMc>!rApwOu2prKSi*!w%`yzGmS+k(zm*CsLK*wv{S_0WX^8A-rKy zbk^Gf_92^7iB_uUF)EE+ET4d|X|>d&mdN?x@vxKAQk`O+r4Qdu>XGy(a(19g;=jU} zFX{O*_NG>!$@jh!U369Lnc+D~qch3uT+_Amyi}*k#LAAwh}k8IPK5a-WZ81ufD>l> z$4cF}GSz>ce`3FAic}6W4Z7m9KGO?(eWqi@L|5Hq0@L|&2flN1PVl}XgQ2q*_n2s3 zt5KtowNkTYB5b;SVuoXA@i5irXO)A&%7?V`1@HGCB&)Wgk+l|^XXChq;u(nyPB}b3 zY>m5jkxpZgi)zfbgv&ec4Zqdvm+D<?Im*mXweS9H+V>)zF#Zp3)bhl$PbISY{5=_z!8&*Jv~NYtI-g!>fDs zmvL5O^U%!^VaKA9gvKw|5?-jk>~%CVGvctKmP$kpnpfN{D8@X*Aazi$txfa%vd-|E z>kYmV66W!lNekJPom29LdZ%(I+ZLZYTXzTg*to~m?7vp%{V<~>H+2}PQ?PPAq`36R z<%wR8v6UkS>Wt#hzGk#44W<%9S=nBfB);6clKwnxY}T*w21Qc3_?IJ@4gYzC7s;WP zVQNI(M=S=JT#xsZy7G`cR(BP9*je0bfeN8JN5~zY(DDs0t{LpHOIbN);?T-69Pf3R zSNe*&p2%AwXHL>__g+xd4Hlc_vu<25H?(`nafS%)3UPP7_4;gk-9ckt8SJRTv5v0M z_Hww`qPudL?ajIR&X*;$y-`<)6dxx1U~5eGS13CB!lX;3w7n&lDDiArbAhSycd}+b zya_3p@A`$kQy;|NJZ~s44Hqo7Hwt}X86NK=(ey>lgWTtGL6k@Gy;PbO!M%1~Wcn2k zUFP|*5d>t-X*RU8g%>|(wwj*~#l4z^Aatf^DWd1Wj#Q*AY0D^V@sC`M zjJc6qXu0I7Y*2;;gGu!plAFzG=J;1%eIOdn zQA>J&e05UN*7I5@yRhK|lbBSfJ+5Uq;!&HV@xfPZrgD}kE*1DSq^=%{o%|LChhl#0 zlMb<^a6ixzpd{kNZr|3jTGeEzuo}-eLT-)Q$#b{!vKx8Tg}swCni>{#%vDY$Ww$84 zew3c9BBovqb}_&BRo#^!G(1Eg((BScRZ}C)Oz?y`T5wOrv);)b^4XR8 zhJo7+<^7)qB>I;46!GySzdneZ>n_E1oWZY;kf94#)s)kWjuJN1c+wbVoNQcmnv}{> zN0pF+Sl3E}UQ$}slSZeLJrwT>Sr}#V(dVaezCQl2|4LN`7L7v&siYR|r7M(*JYfR$ zst3=YaDw$FSc{g}KHO&QiKxuhEzF{f%RJLKe3p*7=oo`WNP)M(9X1zIQPP0XHhY3c znrP{$4#Ol$A0s|4S7Gx2L23dv*Gv2o;h((XVn+9+$qvm}s%zi6nI-_s6?mG! zj{DV;qesJb&owKeEK?=J>UcAlYckA7Sl+I&IN=yasrZOkejir*kE@SN`fk<8Fgx*$ zy&fE6?}G)d_N`){P~U@1jRVA|2*69)KSe_}!~?+`Yb{Y=O~_+@!j<&oVQQMnhoIRU zA0CyF1OFfkK44n*JD~!2!SCPM;PRSk%1XL=0&rz00wxPs&-_eapJy#$h!eqY%nS0{ z!aGg58JIJPF3_ci%n)QSVpa2H`vIe$RD43;#IRfDV&Ibit z+?>HW4{2wOfC6Fw)}4x}i1maDxcE1qi@BS*qcxD2gE@h3#4cgU*D-&3z7D|tVZWt= z-Cy2+*Cm@P4GN_TPUtaVyVesbVDazF@)j8VJ4>XZv!f%}&eO1SvIgr}4`A*3#vat< z_MoByL(qW6L7SFZ#|Gc1fFN)L2PxY+{B8tJp+pxRyz*87)vXR}*=&ahXjBlQKguuf zX6x<<6fQulE^C*KH8~W%ptpaC0l?b=_{~*U4?5Vt;dgM4t_{&UZ1C2j?b>b+5}{IF_CUyvz-@QZPMlJ)r_tS$9kH%RPv#2_nMb zRLj5;chJ72*U`Z@Dqt4$@_+k$%|8m(HqLG!qT4P^DdfvGf&){gKnGCX#H0!;W=AGP zbA&Z`-__a)VTS}kKFjWGk z%|>yE?t*EJ!qeQ%dPk$;xIQ+P0;()PCBDgjJm6Buj{f^awNoVx+9<|lg3%-$G(*f) zll6oOkN|yamn1uyl2*N-lnqRI1cvs_JxLTeahEK=THV$Sz*gQhKNb*p0fNoda#-&F zB-qJgW^g}!TtM|0bS2QZekW7_tKu%GcJ!4?lObt0z_$mZ4rbQ0o=^curCs3bJK6sq z9fu-aW-l#>z~ca(B;4yv;2RZ?tGYAU)^)Kz{L|4oPj zdOf_?de|#yS)p2v8-N||+XL=O*%3+y)oI(HbM)Ds?q8~HPzIP(vs*G`iddbWq}! z(2!VjP&{Z1w+%eUq^ /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -133,22 +133,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,16 +200,20 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 53a6b238d..5eed7ee84 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/reference.md b/reference.md new file mode 100644 index 000000000..1c055ffb1 --- /dev/null +++ b/reference.md @@ -0,0 +1,25097 @@ +# Reference +## Actions +

client.actions.list() -> SyncPagingIterable<Action> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all actions. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().list( + ListActionsRequestParameters + .builder() + .triggerId("triggerId") + .actionName("actionName") + .deployed(true) + .page(1) + .perPage(1) + .installed(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**triggerId:** `Optional` — An actions extensibility point. + +
+
+ +
+
+ +**actionName:** `Optional` — The name of the action to retrieve. + +
+
+ +
+
+ +**deployed:** `Optional` — Optional filter to only retrieve actions that are deployed. + +
+
+ +
+
+ +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — The maximum number of results to be returned by the server in single response. 20 by default + +
+
+ +
+
+ +**installed:** `Optional` — Optional. When true, return only installed actions. When false, return only custom actions. Returns all actions by default. + +
+
+
+
+ + +
+
+
+ +
client.actions.create(request) -> CreateActionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().create( + CreateActionRequestContent + .builder() + .name("name") + .supportedTriggers( + Arrays.asList( + ActionTrigger + .builder() + .id("id") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of an action. + +
+
+ +
+
+ +**supportedTriggers:** `List` — The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + +
+
+ +
+
+ +**code:** `Optional` — The source code of the action. + +
+
+ +
+
+ +**dependencies:** `Optional>` — The list of third party npm modules, and their versions, that this action depends on. + +
+
+ +
+
+ +**runtime:** `Optional` — The Node runtime. For example: `node12`, defaults to `node12` + +
+
+ +
+
+ +**secrets:** `Optional>` — The list of secrets that are included in an action or a version of an action. + +
+
+ +
+
+ +**deploy:** `Optional` — True if the action should be deployed after creation. + +
+
+
+
+ + +
+
+
+ +
client.actions.get(id) -> GetActionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve an action by its ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the action to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.actions.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().delete( + "id", + DeleteActionRequestParameters + .builder() + .force(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the action to delete. + +
+
+ +
+
+ +**force:** `Optional` — Force action deletion detaching bindings + +
+
+
+
+ + +
+
+
+ +
client.actions.update(id, request) -> UpdateActionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().update( + "id", + UpdateActionRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the action to update. + +
+
+ +
+
+ +**name:** `Optional` — The name of an action. + +
+
+ +
+
+ +**supportedTriggers:** `Optional>` — The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + +
+
+ +
+
+ +**code:** `Optional` — The source code of the action. + +
+
+ +
+
+ +**dependencies:** `Optional>` — The list of third party npm modules, and their versions, that this action depends on. + +
+
+ +
+
+ +**runtime:** `Optional` — The Node runtime. For example: `node12`, defaults to `node12` + +
+
+ +
+
+ +**secrets:** `Optional>` — The list of secrets that are included in an action or a version of an action. + +
+
+
+
+ + +
+
+
+ +
client.actions.deploy(id) -> DeployActionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().deploy("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of an action. + +
+
+
+
+ + +
+
+
+ +
client.actions.test(id, request) -> TestActionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().test( + "id", + TestActionRequestContent + .builder() + .payload( + new HashMap() {{ + put("key", "value"); + }} + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the action to test. + +
+
+ +
+
+ +**payload:** `Map` + +
+
+
+
+ + +
+
+
+ +## Branding +
client.branding.get() -> GetBrandingResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve branding settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.branding.update(request) -> UpdateBrandingResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update branding settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().update( + UpdateBrandingRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**colors:** `Optional` + +
+
+ +
+
+ +**faviconUrl:** `Optional` — URL for the favicon. Must use HTTPS. + +
+
+ +
+
+ +**logoUrl:** `Optional` — URL for the logo. Must use HTTPS. + +
+
+ +
+
+ +**font:** `Optional` + +
+
+
+
+ + +
+
+
+ +## ClientGrants +
client.clientGrants.list() -> SyncPagingIterable<ClientGrantResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of client grants, including the scopes associated with the application/API pair. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clientGrants().list( + ListClientGrantsRequestParameters + .builder() + .from("from") + .take(1) + .audience("audience") + .clientId("client_id") + .allowAnyOrganization(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**audience:** `Optional` — Optional filter on audience. + +
+
+ +
+
+ +**clientId:** `Optional` — Optional filter on client_id. + +
+
+ +
+
+ +**allowAnyOrganization:** `Optional` — Optional filter on allow_any_organization. + +
+
+
+
+ + +
+
+
+ +
client.clientGrants.create(request) -> CreateClientGrantResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a client grant for a machine-to-machine login flow. To learn more, read Client Credential Flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clientGrants().create( + CreateClientGrantRequestContent + .builder() + .clientId("client_id") + .audience("audience") + .scope( + Arrays.asList("scope") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**audience:** `String` — The audience (API identifier) of this client grant + +
+
+ +
+
+ +**organizationUsage:** `Optional` + +
+
+ +
+
+ +**allowAnyOrganization:** `Optional` — If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + +
+
+ +
+
+ +**scope:** `List` — Scopes allowed for this client grant. + +
+
+
+
+ + +
+
+
+ +
client.clientGrants.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete the Client Credential Flow from your machine-to-machine application. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clientGrants().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client grant to delete. + +
+
+
+
+ + +
+
+
+ +
client.clientGrants.update(id, request) -> UpdateClientGrantResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a client grant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clientGrants().update( + "id", + UpdateClientGrantRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client grant to update. + +
+
+ +
+
+ +**scope:** `Optional>` — Scopes allowed for this client grant. + +
+
+ +
+
+ +**organizationUsage:** `Optional` + +
+
+ +
+
+ +**allowAnyOrganization:** `Optional` — Controls allowing any organization to be used with this grant + +
+
+
+
+ + +
+
+
+ +## Clients +
client.clients.list() -> SyncPagingIterable<Client> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. +For more information, read Applications in Auth0 and Single Sign-On. + +
    +
  • + The following can be retrieved with any scope: + client_id, app_type, name, and description. +
  • +
  • + The following properties can only be retrieved with the read:clients or + read:client_keys scope: + callbacks, oidc_logout, allowed_origins, + web_origins, tenant, global, config_route, + callback_url_template, jwt_configuration, + jwt_configuration.lifetime_in_seconds, jwt_configuration.secret_encoded, + jwt_configuration.scopes, jwt_configuration.alg, api_type, + logo_uri, allowed_clients, owners, custom_login_page, + custom_login_page_off, sso, addons, form_template, + custom_login_page_codeview, resource_servers, client_metadata, + mobile, mobile.android, mobile.ios, allowed_logout_urls, + token_endpoint_auth_method, is_first_party, oidc_conformant, + is_token_endpoint_ip_header_trusted, initiate_login_uri, grant_types, + refresh_token, refresh_token.rotation_type, refresh_token.expiration_type, + refresh_token.leeway, refresh_token.token_lifetime, refresh_token.policies, organization_usage, + organization_require_behavior. +
  • +
  • + The following properties can only be retrieved with the + read:client_keys or read:client_credentials scope: + encryption_key, encryption_key.pub, encryption_key.cert, + client_secret, client_authentication_methods and signing_key. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().list( + ListClientsRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .page(1) + .perPage(1) + .includeTotals(true) + .isGlobal(true) + .isFirstParty(true) + .appType("app_type") + .q("q") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Default value is 50, maximum value is 100 + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**isGlobal:** `Optional` — Optional filter on the global client parameter. + +
+
+ +
+
+ +**isFirstParty:** `Optional` — Optional filter on whether or not a client is a first-party client. + +
+
+ +
+
+ +**appType:** `Optional` — Optional filter by a comma-separated list of application types. + +
+
+ +
+
+ +**q:** `Optional` — Advanced Query in Lucene syntax.
Permitted Queries:
  • client_grant.organization_id:{organization_id}
  • client_grant.allow_any_organization:true
Additional Restrictions:
  • Cannot be used in combination with other filters
  • Requires use of the from and take paging parameters (checkpoint paginatinon)
  • Reduced rate limits apply. See Rate Limit Configurations
Note: Recent updates may not be immediately reflected in query results + +
+
+
+
+ + +
+
+
+ +
client.clients.create(request) -> CreateClientResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new client (application or SSO integration). For more information, read Create Applications +API Endpoints for Single Sign-On. + +Notes: +- We recommend leaving the `client_secret` parameter unspecified to allow the generation of a safe secret. +- The client_authentication_methods and token_endpoint_auth_method properties are mutually exclusive. Use +client_authentication_methods to configure the client with Private Key JWT authentication method. Otherwise, use token_endpoint_auth_method +to configure the client with client secret (basic or post) or with no authentication method (none). +- When using client_authentication_methods to configure the client with Private Key JWT authentication method, specify fully defined credentials. +These credentials will be automatically enabled for Private Key JWT authentication on the client. +- To configure client_authentication_methods, the create:client_credentials scope is required. +- To configure client_authentication_methods, the property jwt_configuration.alg must be set to RS256. + +
SSO Integrations created via this endpoint will accept login requests and share user profile information.
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().create( + CreateClientRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Name of this client (min length: 1 character, does not allow `<` or `>`). + +
+
+ +
+
+ +**description:** `Optional` — Free text description of this client (max length: 140 characters). + +
+
+ +
+
+ +**logoUri:** `Optional` — URL of the logo to display for this client. Recommended size is 150x150 pixels. + +
+
+ +
+
+ +**callbacks:** `Optional>` — Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + +
+
+ +
+
+ +**oidcLogout:** `Optional` + +
+
+ +
+
+ +**oidcBackchannelLogout:** `Optional` + +
+
+ +
+
+ +**sessionTransfer:** `Optional` + +
+
+ +
+
+ +**allowedOrigins:** `Optional>` — Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + +
+
+ +
+
+ +**webOrigins:** `Optional>` — Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode. + +
+
+ +
+
+ +**clientAliases:** `Optional>` — List of audiences/realms for SAML protocol. Used by the wsfed addon. + +
+
+ +
+
+ +**allowedClients:** `Optional>` — List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + +
+
+ +
+
+ +**allowedLogoutUrls:** `Optional>` — Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + +
+
+ +
+
+ +**grantTypes:** `Optional>` — List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, and `urn:ietf:params:oauth:grant-type:device_code`. + +
+
+ +
+
+ +**tokenEndpointAuthMethod:** `Optional` + +
+
+ +
+
+ +**appType:** `Optional` + +
+
+ +
+
+ +**isFirstParty:** `Optional` — Whether this client a first party client or not + +
+
+ +
+
+ +**oidcConformant:** `Optional` — Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false). + +
+
+ +
+
+ +**jwtConfiguration:** `Optional` + +
+
+ +
+
+ +**encryptionKey:** `Optional` + +
+
+ +
+
+ +**sso:** `Optional` — Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + +
+
+ +
+
+ +**crossOriginAuthentication:** `Optional` — Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + +
+
+ +
+
+ +**crossOriginLoc:** `Optional` — URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + +
+
+ +
+
+ +**ssoDisabled:** `Optional` — true to disable Single Sign On, false otherwise (default: false) + +
+
+ +
+
+ +**customLoginPageOn:** `Optional` — true if the custom login page is to be used, false otherwise. Defaults to true + +
+
+ +
+
+ +**customLoginPage:** `Optional` — The content (HTML, CSS, JS) of the custom login page. + +
+
+ +
+
+ +**customLoginPagePreview:** `Optional` — The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + +
+
+ +
+
+ +**formTemplate:** `Optional` — HTML form template to be used for WS-Federation. + +
+
+ +
+
+ +**addons:** `Optional` + +
+
+ +
+
+ +**clientMetadata:** `Optional>` + +
+
+ +
+
+ +**mobile:** `Optional` + +
+
+ +
+
+ +**initiateLoginUri:** `Optional` — Initiate login uri, must be https + +
+
+ +
+
+ +**nativeSocialLogin:** `Optional` + +
+
+ +
+
+ +**refreshToken:** `Optional` + +
+
+ +
+
+ +**defaultOrganization:** `Optional` + +
+
+ +
+
+ +**organizationUsage:** `Optional` + +
+
+ +
+
+ +**organizationRequireBehavior:** `Optional` + +
+
+ +
+
+ +**clientAuthenticationMethods:** `Optional` + +
+
+ +
+
+ +**requirePushedAuthorizationRequests:** `Optional` — Makes the use of Pushed Authorization Requests mandatory for this client + +
+
+ +
+
+ +**requireProofOfPossession:** `Optional` — Makes the use of Proof-of-Possession mandatory for this client + +
+
+ +
+
+ +**signedRequestObject:** `Optional` + +
+
+ +
+
+ +**complianceLevel:** `Optional` + +
+
+ +
+
+ +**parRequestExpiry:** `Optional` — Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+ +
+
+ +**resourceServerIdentifier:** `Optional` — The identifier of the resource server that this client is linked to. + +
+
+
+
+ + +
+
+
+ +
client.clients.get(id) -> GetClientResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. +For more information, read Applications in Auth0 and Single Sign-On. +
    +
  • + The following properties can be retrieved with any of the scopes: + client_id, app_type, name, and description. +
  • +
  • + The following properties can only be retrieved with the read:clients or + read:client_keys scopes: + callbacks, oidc_logout, allowed_origins, + web_origins, tenant, global, config_route, + callback_url_template, jwt_configuration, + jwt_configuration.lifetime_in_seconds, jwt_configuration.secret_encoded, + jwt_configuration.scopes, jwt_configuration.alg, api_type, + logo_uri, allowed_clients, owners, custom_login_page, + custom_login_page_off, sso, addons, form_template, + custom_login_page_codeview, resource_servers, client_metadata, + mobile, mobile.android, mobile.ios, allowed_logout_urls, + token_endpoint_auth_method, is_first_party, oidc_conformant, + is_token_endpoint_ip_header_trusted, initiate_login_uri, grant_types, + refresh_token, refresh_token.rotation_type, refresh_token.expiration_type, + refresh_token.leeway, refresh_token.token_lifetime, refresh_token.policies, organization_usage, + organization_require_behavior. +
  • +
  • + The following properties can only be retrieved with the read:client_keys or read:client_credentials scopes: + encryption_key, encryption_key.pub, encryption_key.cert, + client_secret, client_authentication_methods and signing_key. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().get( + "id", + GetClientRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.clients.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a client and related configuration (rules, connections, etc). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client to delete. + +
+
+
+
+ + +
+
+
+ +
client.clients.update(id, request) -> UpdateClientResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a client's settings. For more information, read Applications in Auth0 and Single Sign-On. + +Notes: +- The `client_secret` and `signing_key` attributes can only be updated with the `update:client_keys` scope. +- The client_authentication_methods and token_endpoint_auth_method properties are mutually exclusive. Use client_authentication_methods to configure the client with Private Key JWT authentication method. Otherwise, use token_endpoint_auth_method to configure the client with client secret (basic or post) or with no authentication method (none). +- When using client_authentication_methods to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client. +- To configure client_authentication_methods, the update:client_credentials scope is required. +- To configure client_authentication_methods, the property jwt_configuration.alg must be set to RS256. +- To change a client's is_first_party property to false, the organization_usage and organization_require_behavior properties must be unset. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().update( + "id", + UpdateClientRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client to update. + +
+
+ +
+
+ +**name:** `Optional` — The name of the client. Must contain at least one character. Does not allow '<' or '>'. + +
+
+ +
+
+ +**description:** `Optional` — Free text description of the purpose of the Client. (Max character length: 140) + +
+
+ +
+
+ +**clientSecret:** `Optional` — The secret used to sign tokens for the client + +
+
+ +
+
+ +**logoUri:** `Optional` — The URL of the client logo (recommended size: 150x150) + +
+
+ +
+
+ +**callbacks:** `Optional>` — A set of URLs that are valid to call back from Auth0 when authenticating users + +
+
+ +
+
+ +**oidcLogout:** `Optional` + +
+
+ +
+
+ +**oidcBackchannelLogout:** `Optional` + +
+
+ +
+
+ +**sessionTransfer:** `Optional` + +
+
+ +
+
+ +**allowedOrigins:** `Optional>` — A set of URLs that represents valid origins for CORS + +
+
+ +
+
+ +**webOrigins:** `Optional>` — A set of URLs that represents valid web origins for use with web message response mode + +
+
+ +
+
+ +**grantTypes:** `Optional>` — A set of grant types that the client is authorized to use. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, and `urn:ietf:params:oauth:grant-type:device_code`. + +
+
+ +
+
+ +**clientAliases:** `Optional>` — List of audiences for SAML protocol + +
+
+ +
+
+ +**allowedClients:** `Optional>` — Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients + +
+
+ +
+
+ +**allowedLogoutUrls:** `Optional>` — URLs that are valid to redirect to after logout from Auth0. + +
+
+ +
+
+ +**jwtConfiguration:** `Optional` + +
+
+ +
+
+ +**encryptionKey:** `Optional` + +
+
+ +
+
+ +**sso:** `Optional` — true to use Auth0 instead of the IdP to do Single Sign On, false otherwise (default: false) + +
+
+ +
+
+ +**crossOriginAuthentication:** `Optional` — true if this client can be used to make cross-origin authentication requests, false otherwise if cross origin is disabled + +
+
+ +
+
+ +**crossOriginLoc:** `Optional` — URL for the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + +
+
+ +
+
+ +**ssoDisabled:** `Optional` — true to disable Single Sign On, false otherwise (default: false) + +
+
+ +
+
+ +**customLoginPageOn:** `Optional` — true if the custom login page is to be used, false otherwise. + +
+
+ +
+
+ +**tokenEndpointAuthMethod:** `Optional` + +
+
+ +
+
+ +**appType:** `Optional` + +
+
+ +
+
+ +**isFirstParty:** `Optional` — Whether this client a first party client or not + +
+
+ +
+
+ +**oidcConformant:** `Optional` — Whether this client will conform to strict OIDC specifications + +
+
+ +
+
+ +**customLoginPage:** `Optional` — The content (HTML, CSS, JS) of the custom login page + +
+
+ +
+
+ +**customLoginPagePreview:** `Optional` + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+ +
+
+ +**formTemplate:** `Optional` — Form template for WS-Federation protocol + +
+
+ +
+
+ +**addons:** `Optional` + +
+
+ +
+
+ +**clientMetadata:** `Optional>` + +
+
+ +
+
+ +**mobile:** `Optional` + +
+
+ +
+
+ +**initiateLoginUri:** `Optional` — Initiate login uri, must be https + +
+
+ +
+
+ +**nativeSocialLogin:** `Optional` + +
+
+ +
+
+ +**refreshToken:** `Optional` + +
+
+ +
+
+ +**defaultOrganization:** `Optional` + +
+
+ +
+
+ +**organizationUsage:** `Optional` + +
+
+ +
+
+ +**organizationRequireBehavior:** `Optional` + +
+
+ +
+
+ +**clientAuthenticationMethods:** `Optional` + +
+
+ +
+
+ +**requirePushedAuthorizationRequests:** `Optional` — Makes the use of Pushed Authorization Requests mandatory for this client + +
+
+ +
+
+ +**requireProofOfPossession:** `Optional` — Makes the use of Proof-of-Possession mandatory for this client + +
+
+ +
+
+ +**signedRequestObject:** `Optional` + +
+
+ +
+
+ +**complianceLevel:** `Optional` + +
+
+ +
+
+ +**parRequestExpiry:** `Optional` — Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + +
+
+
+
+ + +
+
+
+ +
client.clients.rotateSecret(id) -> RotateClientSecretResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Rotate a client secret. + +This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded. + +For more information, read Rotate Client Secrets. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().rotateSecret("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client that will rotate secrets. + +
+
+
+
+ + +
+
+
+ +## Connections +
client.connections.list() -> SyncPagingIterable<ConnectionForList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + +This endpoint supports two types of pagination: +
    +
  • Offset pagination
  • +
  • Checkpoint pagination
  • +
+ +Checkpoint pagination must be used if you need to retrieve more than 1000 connections. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().list( + ListConnectionsQueryParameters + .builder() + .from("from") + .take(1) + .name("name") + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies + +
+
+ +
+
+ +**name:** `Optional` — Provide the name of the connection to retrieve + +
+
+ +
+
+ +**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + +
+
+ +
+
+ +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) + +
+
+
+
+ + +
+
+
+ +
client.connections.create(request) -> CreateConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new connection according to the JSON object received in body.
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().create( + CreateConnectionRequestContent + .builder() + .name("name") + .strategy(ConnectionIdentityProviderEnum.AD) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128 + +
+
+ +
+
+ +**displayName:** `Optional` — Connection name used in the new universal login experience + +
+
+ +
+
+ +**strategy:** `ConnectionIdentityProviderEnum` + +
+
+ +
+
+ +**options:** `Optional` + +
+
+ +
+
+ +**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients. + +
+
+ +
+
+ +**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) + +
+
+ +
+
+ +**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) + +
+
+ +
+
+ +**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + +
+
+ +
+
+ +**metadata:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.connections.get(id) -> GetConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details for a specified connection along with options that can be used for identity provider configuration. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().get( + "id", + GetConnectionRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to retrieve + +
+
+ +
+
+ +**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + +
+
+ +
+
+ +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) + +
+
+
+
+ + +
+
+
+ +
client.connections.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to delete + +
+
+
+
+ + +
+
+
+ +
client.connections.update(id, request) -> UpdateConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update details for a specific connection, including option properties for identity provider configuration. + +Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().update( + "id", + UpdateConnectionRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to update + +
+
+ +
+
+ +**displayName:** `Optional` — The connection name used in the new universal login experience. If display_name is not included in the request, the field will be overwritten with the name value. + +
+
+ +
+
+ +**options:** `Optional` + +
+
+ +
+
+ +**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients. + +
+
+ +
+
+ +**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) + +
+
+ +
+
+ +**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) + +
+
+ +
+
+ +**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + +
+
+ +
+
+ +**metadata:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.connections.checkStatus(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().checkStatus("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the connection to check + +
+
+
+
+ + +
+
+
+ +## CustomDomains +
client.customDomains.list() -> List<CustomDomain> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details on custom domains. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.customDomains.create(request) -> CreateCustomDomainResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new custom domain. + +Note: The custom domain will need to be verified before it will accept +requests. + +Optional attributes that can be updated: + +- custom_client_ip_header +- tls_policy + + +TLS Policies: + +- recommended - for modern usage this includes TLS 1.2 only +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().create( + CreateCustomDomainRequestContent + .builder() + .domain("domain") + .type(CustomDomainProvisioningTypeEnum.AUTH0MANAGED_CERTS) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**domain:** `String` — Domain name. + +
+
+ +
+
+ +**type:** `CustomDomainProvisioningTypeEnum` + +
+
+ +
+
+ +**verificationMethod:** `Optional` + +
+
+ +
+
+ +**tlsPolicy:** `Optional` + +
+
+ +
+
+ +**customClientIpHeader:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.customDomains.get(id) -> GetCustomDomainResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a custom domain configuration and status. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the custom domain to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.customDomains.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a custom domain and stop serving requests for it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the custom domain to delete. + +
+
+
+
+ + +
+
+
+ +
client.customDomains.update(id, request) -> UpdateCustomDomainResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a custom domain. + +These are the attributes that can be updated: + +- custom_client_ip_header +- tls_policy + +
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to +send should be: +
{ "custom_client_ip_header": "cf-connecting-ip" }
+ +
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: +
{ "tls_policy": "recommended" }
+ + +TLS Policies: + +- recommended - for modern usage this includes TLS 1.2 only + + +Some considerations: + +- The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. +- The compatible TLS policy is no longer supported. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().update( + "id", + UpdateCustomDomainRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the custom domain to update + +
+
+ +
+
+ +**tlsPolicy:** `Optional` + +
+
+ +
+
+ +**customClientIpHeader:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.customDomains.test(id) -> TestCustomDomainResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Run the test process on a custom domain. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().test("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the custom domain to test. + +
+
+
+
+ + +
+
+
+ +
client.customDomains.verify(id) -> VerifyCustomDomainResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Run the verification process on a custom domain. + +Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + +For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + +Learn more about verifying custom domains that use Auth0 Managed certificates. +Learn more about verifying custom domains that use Self Managed certificates. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().verify("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the custom domain to verify. + +
+
+
+
+ + +
+
+
+ +## DeviceCredentials +
client.deviceCredentials.list() -> SyncPagingIterable<DeviceCredential> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve device credential information (public_key, refresh_token, or rotating_refresh_token) associated with a specific user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.deviceCredentials().list( + ListDeviceCredentialsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .fields("fields") + .includeFields(true) + .userId("user_id") + .clientId("client_id") + .type(DeviceCredentialTypeEnum.PUBLIC_KEY) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. There is a maximum of 1000 results allowed from this endpoint. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+ +
+
+ +**userId:** `Optional` — user_id of the devices to retrieve. + +
+
+ +
+
+ +**clientId:** `Optional` — client_id of the devices to retrieve. + +
+
+ +
+
+ +**type:** `Optional` — Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. The property will default to `refresh_token` when paging is requested + +
+
+
+
+ + +
+
+
+ +
client.deviceCredentials.createPublicKey(request) -> CreatePublicKeyDeviceCredentialResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a device credential public key to manage refresh token rotation for a given user_id. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + +When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read Signing Keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.deviceCredentials().createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent + .builder() + .deviceName("device_name") + .type("public_key") + .value("value") + .deviceId("device_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**deviceName:** `String` — Name for this device easily recognized by owner. + +
+
+ +
+
+ +**type:** `String` + +
+
+ +
+
+ +**value:** `String` — Base64 encoded string containing the credential. + +
+
+ +
+
+ +**deviceId:** `String` — Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor. + +
+
+ +
+
+ +**clientId:** `Optional` — client_id of the client (application) this credential is for. + +
+
+
+
+ + +
+
+
+ +
client.deviceCredentials.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Permanently delete a device credential (such as a refresh token or public key) with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.deviceCredentials().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the credential to delete. + +
+
+
+
+ + +
+
+
+ +## EmailTemplates +
client.emailTemplates.create(request) -> CreateEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an email template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emailTemplates().create( + CreateEmailTemplateRequestContent + .builder() + .template(EmailTemplateNameEnum.VERIFY_EMAIL) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**template:** `EmailTemplateNameEnum` + +
+
+ +
+
+ +**body:** `Optional` — Body of the email template. + +
+
+ +
+
+ +**from:** `Optional` — Senders `from` email address. + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL to redirect the user to after a successful action. + +
+
+ +
+
+ +**subject:** `Optional` — Subject line of the email. + +
+
+ +
+
+ +**syntax:** `Optional` — Syntax of the template body. + +
+
+ +
+
+ +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. + +
+
+ +
+
+ +**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). + +
+
+
+
+ + +
+
+
+ +
client.emailTemplates.get(templateName) -> GetEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve an email template by pre-defined name. These names are `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, and `async_approval`. The names `change_password`, and `password_reset` are also supported for legacy scenarios. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). + +
+
+
+
+ + +
+
+
+ +
client.emailTemplates.set(templateName, request) -> SetEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an email template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emailTemplates().set( + EmailTemplateNameEnum.VERIFY_EMAIL, + SetEmailTemplateRequestContent + .builder() + .template(EmailTemplateNameEnum.VERIFY_EMAIL) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). + +
+
+ +
+
+ +**template:** `EmailTemplateNameEnum` + +
+
+ +
+
+ +**body:** `Optional` — Body of the email template. + +
+
+ +
+
+ +**from:** `Optional` — Senders `from` email address. + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL to redirect the user to after a successful action. + +
+
+ +
+
+ +**subject:** `Optional` — Subject line of the email. + +
+
+ +
+
+ +**syntax:** `Optional` — Syntax of the template body. + +
+
+ +
+
+ +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. + +
+
+ +
+
+ +**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). + +
+
+
+
+ + +
+
+
+ +
client.emailTemplates.update(templateName, request) -> UpdateEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify an email template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emailTemplates().update( + EmailTemplateNameEnum.VERIFY_EMAIL, + UpdateEmailTemplateRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). + +
+
+ +
+
+ +**template:** `Optional` + +
+
+ +
+
+ +**body:** `Optional` — Body of the email template. + +
+
+ +
+
+ +**from:** `Optional` — Senders `from` email address. + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL to redirect the user to after a successful action. + +
+
+ +
+
+ +**subject:** `Optional` — Subject line of the email. + +
+
+ +
+
+ +**syntax:** `Optional` — Syntax of the template body. + +
+
+ +
+
+ +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. + +
+
+ +
+
+ +**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). + +
+
+
+
+ + +
+
+
+ +## EventStreams +
client.eventStreams.list() -> List<EventStreamResponseContent> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().list( + ListEventStreamsRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.create(request) -> CreateEventStreamResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().create( + EventStreamsCreateRequest.of( + CreateEventStreamWebHookRequestContent + .builder() + .destination( + EventStreamWebhookDestination + .builder() + .type("webhook") + .configuration( + EventStreamWebhookConfiguration + .builder() + .webhookEndpoint("webhook_endpoint") + .webhookAuthorization( + EventStreamWebhookAuthorizationResponse.of( + EventStreamWebhookBasicAuth + .builder() + .method("basic") + .username("username") + .build() + ) + ) + .build() + ) + .build() + ) + .build() + ) +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EventStreamsCreateRequest` + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.get(id) -> GetEventStreamResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.update(id, request) -> UpdateEventStreamResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().update( + "id", + UpdateEventStreamRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**name:** `Optional` — Name of the event stream. + +
+
+ +
+
+ +**subscriptions:** `Optional>` — List of event types subscribed to in this stream. + +
+
+ +
+
+ +**destination:** `Optional` + +
+
+ +
+
+ +**status:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.getStats(id) -> GetEventStreamStatsResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().getStats( + "id", + EventStreamsGetStatsRequest + .builder() + .dateFrom("date_from") + .dateTo("date_to") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**dateFrom:** `Optional` — The RFC3339 start date for the stats query. + +
+
+ +
+
+ +**dateTo:** `Optional` — The RFC3339 end date for the stats query. + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.test(id, request) -> CreateEventStreamTestEventResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().test( + "id", + CreateEventStreamTestEventRequestContent + .builder() + .eventType(EventStreamTestEventTypeEnum.USER_CREATED) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**eventType:** `EventStreamTestEventTypeEnum` + +
+
+ +
+
+ +**data:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## Flows +
client.flows.list() -> SyncPagingIterable<FlowSummary> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().list( + FlowsListRequest + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .synchronous(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**hydrate:** `Optional` — hydration param + +
+
+ +
+
+ +**synchronous:** `Optional` — flag to filter by sync/async flows + +
+
+
+
+ + +
+
+
+ +
client.flows.create(request) -> CreateFlowResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().create( + CreateFlowRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**actions:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.flows.get(id) -> GetFlowResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().get( + "id", + GetFlowRequestParameters + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Flow identifier + +
+
+ +
+
+ +**hydrate:** `Optional` — hydration param + +
+
+
+
+ + +
+
+
+ +
client.flows.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Flow id + +
+
+
+
+ + +
+
+
+ +
client.flows.update(id, request) -> UpdateFlowResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().update( + "id", + UpdateFlowRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Flow identifier + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**actions:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## Forms +
client.forms.list() -> SyncPagingIterable<FormSummary> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.forms().list( + ListFormsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**hydrate:** `Optional` — Query parameter to hydrate the response with additional data + +
+
+
+
+ + +
+
+
+ +
client.forms.create(request) -> CreateFormResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.forms().create( + CreateFormRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**messages:** `Optional` + +
+
+ +
+
+ +**languages:** `Optional` + +
+
+ +
+
+ +**translations:** `Optional>` + +
+
+ +
+
+ +**nodes:** `Optional>` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**ending:** `Optional` + +
+
+ +
+
+ +**style:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.forms.get(id) -> GetFormResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.forms().get( + "id", + GetFormRequestParameters + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the form to retrieve. + +
+
+ +
+
+ +**hydrate:** `Optional` — Query parameter to hydrate the response with additional data + +
+
+
+
+ + +
+
+
+ +
client.forms.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.forms().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the form to delete. + +
+
+
+
+ + +
+
+
+ +
client.forms.update(id, request) -> UpdateFormResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.forms().update( + "id", + UpdateFormRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the form to update. + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**messages:** `Optional` + +
+
+ +
+
+ +**languages:** `Optional` + +
+
+ +
+
+ +**translations:** `Optional>` + +
+
+ +
+
+ +**nodes:** `Optional>` + +
+
+ +
+
+ +**start:** `Optional` + +
+
+ +
+
+ +**ending:** `Optional` + +
+
+ +
+
+ +**style:** `Optional` + +
+
+
+
+ + +
+
+
+ +## UserGrants +
client.userGrants.list() -> SyncPagingIterable<UserGrant> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the grants associated with your account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userGrants().list( + ListUserGrantsRequestParameters + .builder() + .perPage(1) + .page(1) + .includeTotals(true) + .userId("user_id") + .clientId("client_id") + .audience("audience") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**userId:** `Optional` — user_id of the grants to retrieve. + +
+
+ +
+
+ +**clientId:** `Optional` — client_id of the grants to retrieve. + +
+
+ +
+
+ +**audience:** `Optional` — audience of the grants to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.userGrants.deleteByUserId() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a grant associated with your account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userGrants().deleteByUserId( + DeleteUserGrantByUserIdRequestParameters + .builder() + .userId("user_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — user_id of the grant to delete. + +
+
+
+
+ + +
+
+
+ +
client.userGrants.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a grant associated with your account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userGrants().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the grant to delete. + +
+
+
+
+ + +
+
+
+ +## Hooks +
client.hooks.list() -> SyncPagingIterable<Hook> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all hooks. Accepts a list of fields to include or exclude in the result. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().list( + ListHooksRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .enabled(true) + .fields("fields") + .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**enabled:** `Optional` — Optional filter on whether a hook is enabled (true) or disabled (false). + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**triggerId:** `Optional` — Retrieves hooks that match the trigger + +
+
+
+
+ + +
+
+
+ +
client.hooks.create(request) -> CreateHookResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new hook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().create( + CreateHookRequestContent + .builder() + .name("name") + .script("script") + .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Name of this hook. + +
+
+ +
+
+ +**script:** `String` — Code to be executed when this hook runs. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). + +
+
+ +
+
+ +**dependencies:** `Optional>` + +
+
+ +
+
+ +**triggerId:** `HookTriggerIdEnum` + +
+
+
+
+ + +
+
+
+ +
client.hooks.get(id) -> GetHookResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a hook by its ID. Accepts a list of fields to include in the result. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().get( + "id", + GetHookRequestParameters + .builder() + .fields("fields") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. + +
+
+
+
+ + +
+
+
+ +
client.hooks.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a hook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to delete. + +
+
+
+
+ + +
+
+
+ +
client.hooks.update(id, request) -> UpdateHookResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing hook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().update( + "id", + UpdateHookRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to update. + +
+
+ +
+
+ +**name:** `Optional` — Name of this hook. + +
+
+ +
+
+ +**script:** `Optional` — Code to be executed when this hook runs. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). + +
+
+ +
+
+ +**dependencies:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## Jobs +
client.jobs.get(id) -> GetJobResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a job. Useful to check its status. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the job. + +
+
+
+
+ + +
+
+
+ +## LogStreams +
client.logStreams.list() -> List<LogStreamResponseSchema> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details on log streams. +
Sample Response
[{
+	"id": "string",
+	"name": "string",
+	"type": "eventbridge",
+	"status": "active|paused|suspended",
+	"sink": {
+		"awsAccountId": "string",
+		"awsRegion": "string",
+		"awsPartnerEventSource": "string"
+	}
+}, {
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active|paused|suspended",
+	"sink": {
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpContentType": "string",
+		"httpEndpoint": "string",
+		"httpAuthorization": "string"
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "eventgrid",
+	"status": "active|paused|suspended",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string",
+		"azurePartnerTopic": "string"
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active|paused|suspended",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active|paused|suspended",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "datadog",
+	"status": "active|paused|suspended",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+}]
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.logStreams.create(request) -> CreateLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a log stream. +
Log Stream Types
The type of log stream being created determines the properties required in the sink payload. +
HTTP Stream
For an http Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "http",
+	"sink": {
+		"httpEndpoint": "string",
+		"httpContentType": "string",
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpAuthorization": "string"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active",
+	"sink": {
+		"httpEndpoint": "string",
+		"httpContentType": "string",
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpAuthorization": "string"
+	}
+}
+
Amazon EventBridge Stream
For an eventbridge Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "eventbridge",
+	"sink": {
+		"awsRegion": "string",
+		"awsAccountId": "string"
+	}
+}
+The response will include an additional field awsPartnerEventSource in the sink:
{
+	"id": "string",
+	"name": "string",
+	"type": "eventbridge",
+	"status": "active",
+	"sink": {
+		"awsAccountId": "string",
+		"awsRegion": "string",
+		"awsPartnerEventSource": "string"
+	}
+}
+
Azure Event Grid Stream
For an Azure Event Grid Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "eventgrid",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string",
+		"azurePartnerTopic": "string"
+	}
+}
+
Datadog Stream
For a Datadog Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "datadog",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "datadog",
+	"status": "active",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+}
+
Splunk Stream
For a Splunk Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "splunk",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+}
+
Sumo Logic Stream
For a Sumo Logic Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "sumo",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+}
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().create( + CreateLogStreamRequestContent.of( + CreateLogStreamHttpRequestBody + .builder() + .type("http") + .sink( + LogStreamHttpSink + .builder() + .httpEndpoint("httpEndpoint") + .build() + ) + .build() + ) +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateLogStreamRequestContent` + +
+
+
+
+ + +
+
+
+ +
client.logStreams.get(id) -> GetLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a log stream configuration and status. +
Sample responses
Amazon EventBridge Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "eventbridge",
+	"status": "active|paused|suspended",
+	"sink": {
+		"awsAccountId": "string",
+		"awsRegion": "string",
+		"awsPartnerEventSource": "string"
+	}
+}
HTTP Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active|paused|suspended",
+	"sink": {
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpContentType": "string",
+		"httpEndpoint": "string",
+		"httpAuthorization": "string"
+	}
+}
Datadog Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "datadog",
+	"status": "active|paused|suspended",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+
+}
Mixpanel
+ + Request:
{
+	  "name": "string",
+	  "type": "mixpanel",
+	  "sink": {
+		"mixpanelRegion": "string", // "us" | "eu",
+		"mixpanelProjectId": "string",
+		"mixpanelServiceAccountUsername": "string",
+		"mixpanelServiceAccountPassword": "string"
+	  }
+	} 
+ + + Response:
{
+		"id": "string",
+		"name": "string",
+		"type": "mixpanel",
+		"status": "active",
+		"sink": {
+		  "mixpanelRegion": "string", // "us" | "eu",
+		  "mixpanelProjectId": "string",
+		  "mixpanelServiceAccountUsername": "string",
+		  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+		}
+	  } 
+ +
Segment
+ + Request:
 {
+	  "name": "string",
+	  "type": "segment",
+	  "sink": {
+		"segmentWriteKey": "string"
+	  }
+	}
+ + Response:
{
+	  "id": "string",
+	  "name": "string",
+	  "type": "segment",
+	  "status": "active",
+	  "sink": {
+		"segmentWriteKey": "string"
+	  }
+	} 
+ +
Splunk Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active|paused|suspended",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+}
Sumo Logic Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active|paused|suspended",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+}
Status
The status of a log stream maybe any of the following: +1. active - Stream is currently enabled. +2. paused - Stream is currently user disabled and will not attempt log delivery. +3. suspended - Stream is currently disabled because of errors and will not attempt log delivery. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to get + +
+
+
+
+ + +
+
+
+ +
client.logStreams.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a log stream. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to delete + +
+
+
+
+ + +
+
+
+ +
client.logStreams.update(id, request) -> UpdateLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a log stream. +

Examples of how to use the PATCH endpoint.

The following fields may be updated in a PATCH operation:
  • name
  • status
  • sink
Note: For log streams of type eventbridge and eventgrid, updating the sink is not permitted. +
Update the status of a log stream
{
+	"status": "active|paused"
+}
+
Update the name of a log stream
{
+	"name": "string"
+}
+
Update the sink properties of a stream of type http
{
+  "sink": {
+    "httpEndpoint": "string",
+    "httpContentType": "string",
+    "httpContentFormat": "JSONARRAY|JSONLINES",
+    "httpAuthorization": "string"
+  }
+}
+
Update the sink properties of a stream of type datadog
{
+  "sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+  }
+}
+
Update the sink properties of a stream of type splunk
{
+  "sink": {
+    "splunkDomain": "string",
+    "splunkToken": "string",
+    "splunkPort": "string",
+    "splunkSecure": "boolean"
+  }
+}
+
Update the sink properties of a stream of type sumo
{
+  "sink": {
+    "sumoSourceAddress": "string"
+  }
+}
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().update( + "id", + UpdateLogStreamRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to get + +
+
+ +
+
+ +**name:** `Optional` — log stream name + +
+
+ +
+
+ +**status:** `Optional` + +
+
+ +
+
+ +**isPriority:** `Optional` — True for priority log streams, false for non-priority + +
+
+ +
+
+ +**filters:** `Optional>` — Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + +
+
+ +
+
+ +**piiConfig:** `Optional` + +
+
+ +
+
+ +**sink:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Logs +
client.logs.list() -> SyncPagingIterable<Log> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + +Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + +For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + +
To set custom search criteria, use the following parameters:
+ +
    +
  • q: Search Criteria using Query String Syntax
  • +
  • page: Page index of the results to return. First page is 0.
  • +
  • per_page: Number of results per page.
  • +
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • +
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • +
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • +
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • +
+ +For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + +Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + +
To search from a checkpoint log ID, use the following parameters:
+
    +
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • +
  • take: Number of entries to retrieve when using the from parameter.
  • +
+ +Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().list( + ListLogsRequestParameters + .builder() + .page(1) + .perPage(1) + .sort("sort") + .fields("fields") + .includeFields(true) + .includeTotals(true) + .q("q") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Paging is disabled if parameter not sent. Default: 50. Max value: 100 + +
+
+ +
+
+ +**sort:** `Optional` — Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1 + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false) + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results as an array when false (default). Return results inside an object that also contains a total result count when true. + +
+
+ +
+
+ +**q:** `Optional` — Query in Lucene query string syntax. + +
+
+
+
+ + +
+
+
+ +
client.logs.get(id) -> GetLogResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve an individual log event. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — log_id of the log to retrieve. + +
+
+
+
+ + +
+
+
+ +## NetworkAcls +
client.networkAcls.list() -> SyncPagingIterable<NetworkAclsResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all access control list entries for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().list( + ListNetworkAclsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — The amount of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.create(request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().create( + CreateNetworkAclRequestContent + .builder() + .description("description") + .active(true) + .priority(1.1) + .rule( + NetworkAclRule + .builder() + .action( + NetworkAclAction + .builder() + .build() + ) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**active:** `Boolean` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `NetworkAclRule` + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.get(id) -> GetNetworkAclsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific access control list entry for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the access control list to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.set(id, request) -> SetNetworkAclsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().set( + "id", + SetNetworkAclRequestContent + .builder() + .description("description") + .active(true) + .priority(1.1) + .rule( + NetworkAclRule + .builder() + .action( + NetworkAclAction + .builder() + .build() + ) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to update. + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**active:** `Boolean` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `NetworkAclRule` + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to delete + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.update(id, request) -> UpdateNetworkAclResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().update( + "id", + UpdateNetworkAclRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to update. + +
+
+ +
+
+ +**description:** `Optional` + +
+
+ +
+
+ +**active:** `Optional` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Optional` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Organizations +
client.organizations.list() -> SyncPagingIterable<Organization> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + +This endpoint supports two types of pagination: +
    +
  • Offset pagination
  • +
  • Checkpoint pagination
  • +
+ +Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total number of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().list( + ListOrganizationsRequestParameters + .builder() + .from("from") + .take(1) + .sort("sort") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1. We currently support sorting by the following fields: name, display_name and created_at. + +
+
+
+
+ + +
+
+
+ +
client.organizations.create(request) -> CreateOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review Create Your First Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().create( + CreateOrganizationRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of this organization. + +
+
+ +
+
+ +**displayName:** `Optional` — Friendly name of this organization. + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>` + +
+
+ +
+
+ +**enabledConnections:** `Optional>` — Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed) + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.organizations.getByName(name) -> GetOrganizationByNameResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Organization specified by name. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().getByName("name"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — name of the organization to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.organizations.get(id) -> GetOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Organization specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the organization to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.organizations.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove an Organization from your tenant. This action cannot be undone. + +Note: Members are automatically disassociated from an Organization when it is deleted. However, this action does not delete these users from your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.update(id, request) -> UpdateOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the details of a specific Organization, such as name and display name, branding options, and metadata. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().update( + "id", + UpdateOrganizationRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the organization to update. + +
+
+ +
+
+ +**displayName:** `Optional` — Friendly name of this organization. + +
+
+ +
+
+ +**name:** `Optional` — The name of this organization. + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>` + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Prompts +
client.prompts.getSettings() -> GetSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().getSettings(); +``` +
+
+
+
+ + +
+
+
+ +
client.prompts.updateSettings(request) -> UpdateSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().updateSettings( + UpdateSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**universalLoginExperience:** `Optional` + +
+
+ +
+
+ +**identifierFirst:** `Optional` — Whether identifier first is enabled or not + +
+
+ +
+
+ +**webauthnPlatformFirstFactor:** `Optional` — Use WebAuthn with Device Biometrics as the first authentication factor + +
+
+
+
+ + +
+
+
+ +## RefreshTokens +
client.refreshTokens.get(id) -> GetRefreshTokenResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve refresh token information. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.refreshTokens().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID refresh token to retrieve + +
+
+
+
+ + +
+
+
+ +
client.refreshTokens.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a refresh token by its ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.refreshTokens().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the refresh token to delete. + +
+
+
+
+ + +
+
+
+ +## ResourceServers +
client.resourceServers.list() -> SyncPagingIterable<ResourceServer> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all APIs associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().list( + ListResourceServerRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifiers:** `Optional` — An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../resource-servers?identifiers=id1&identifiers=id2 + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.create(request) -> CreateResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read APIs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().create( + CreateResourceServerRequestContent + .builder() + .identifier("identifier") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. + +
+
+ +
+
+ +**identifier:** `String` — Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + +
+
+ +
+
+ +**scopes:** `Optional>` — List of permissions (scopes) that this API uses. + +
+
+ +
+
+ +**signingAlg:** `Optional` + +
+
+ +
+
+ +**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). + +
+
+ +
+
+ +**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + +
+
+ +
+
+ +**tokenDialect:** `Optional` + +
+
+ +
+
+ +**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). + +
+
+ +
+
+ +**enforcePolicies:** `Optional` — Whether to enforce authorization policies (true) or to ignore them (false). + +
+
+ +
+
+ +**tokenEncryption:** `Optional` + +
+
+ +
+
+ +**consentPolicy:** `Optional` + +
+
+ +
+
+ +**authorizationDetails:** `Optional>` + +
+
+ +
+
+ +**proofOfPossession:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.get(id) -> GetResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve API details with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().get( + "id", + GetResourceServerRequestParameters + .builder() + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or audience of the resource server to retrieve. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an existing API by ID. For more information, read API Settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or the audience of the resource server to delete. + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.update(id, request) -> UpdateResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Change an existing API setting by resource server ID. For more information, read API Settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().update( + "id", + UpdateResourceServerRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or audience of the resource server to update. + +
+
+ +
+
+ +**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. + +
+
+ +
+
+ +**scopes:** `Optional>` — List of permissions (scopes) that this API uses. + +
+
+ +
+
+ +**signingAlg:** `Optional` + +
+
+ +
+
+ +**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). + +
+
+ +
+
+ +**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). + +
+
+ +
+
+ +**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + +
+
+ +
+
+ +**tokenDialect:** `Optional` + +
+
+ +
+
+ +**enforcePolicies:** `Optional` — Whether authorization policies are enforced (true) or not enforced (false). + +
+
+ +
+
+ +**tokenEncryption:** `Optional` + +
+
+ +
+
+ +**consentPolicy:** `Optional` + +
+
+ +
+
+ +**authorizationDetails:** `Optional>` + +
+
+ +
+
+ +**proofOfPossession:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Roles +
client.roles.list() -> SyncPagingIterable<Role> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of user roles created in your tenant. + +Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().list( + ListRolesRequestParameters + .builder() + .perPage(1) + .page(1) + .includeTotals(true) + .nameFilter("name_filter") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**nameFilter:** `Optional` — Optional filter on name (case-insensitive). + +
+
+
+
+ + +
+
+
+ +
client.roles.create(request) -> CreateRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a user role for Role-Based Access Control. + +Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().create( + CreateRoleRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Name of the role. + +
+
+ +
+
+ +**description:** `Optional` — Description of the role. + +
+
+
+
+ + +
+
+
+ +
client.roles.get(id) -> GetRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a specific user role specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.roles.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to delete. + +
+
+
+
+ + +
+
+
+ +
client.roles.update(id, request) -> UpdateRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the details of a specific user role specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().update( + "id", + UpdateRoleRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to update. + +
+
+ +
+
+ +**name:** `Optional` — Name of this role. + +
+
+ +
+
+ +**description:** `Optional` — Description of this role. + +
+
+
+
+ + +
+
+
+ +## Rules +
client.rules.list() -> SyncPagingIterable<Rule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().list( + ListRulesRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .enabled(true) + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**enabled:** `Optional` — Optional filter on whether a rule is enabled (true) or disabled (false). + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.rules.create(request) -> CreateRuleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new rule. + +Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().create( + CreateRuleRequestContent + .builder() + .name("name") + .script("script") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Name of this rule. + +
+
+ +
+
+ +**script:** `String` — Code to be executed when this rule runs. + +
+
+ +
+
+ +**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false). + +
+
+
+
+ + +
+
+
+ +
client.rules.get(id) -> GetRuleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve rule details. Accepts a list of fields to include or exclude in the result. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().get( + "id", + GetRuleRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the rule to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.rules.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a rule. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the rule to delete. + +
+
+
+
+ + +
+
+
+ +
client.rules.update(id, request) -> UpdateRuleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing rule. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().update( + "id", + UpdateRuleRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the rule to retrieve. + +
+
+ +
+
+ +**script:** `Optional` — Code to be executed when this rule runs. + +
+
+ +
+
+ +**name:** `Optional` — Name of this rule. + +
+
+ +
+
+ +**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false). + +
+
+
+
+ + +
+
+
+ +## RulesConfigs +
client.rulesConfigs.list() -> List<RulesConfig> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve rules config variable keys. + + Note: For security, config variable values cannot be retrieved outside rule execution. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rulesConfigs().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.rulesConfigs.set(key, request) -> SetRulesConfigResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Sets a rules config variable. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rulesConfigs().set( + "key", + SetRulesConfigRequestContent + .builder() + .value("value") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**key:** `String` — Key of the rules config variable to set (max length: 127 characters). + +
+
+ +
+
+ +**value:** `String` — Value for a rules config variable. + +
+
+
+
+ + +
+
+
+ +
client.rulesConfigs.delete(key) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a rules config variable identified by its key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rulesConfigs().delete("key"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**key:** `String` — Key of the rules config variable to delete. + +
+
+
+
+ + +
+
+
+ +## SelfServiceProfiles +
client.selfServiceProfiles.list() -> SyncPagingIterable<SelfServiceProfile> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves self-service profiles. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().list( + ListSelfServiceProfilesRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.create(request) -> CreateSelfServiceProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a self-service profile. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().create( + CreateSelfServiceProfileRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of the self-service Profile. + +
+
+ +
+
+ +**description:** `Optional` — The description of the self-service Profile. + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`] + +
+
+ +
+
+ +**userAttributes:** `Optional>` — List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.get(id) -> GetSelfServiceProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a self-service profile by Id. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile to retrieve + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a self-service profile by Id. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile to delete + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.update(id, request) -> UpdateSelfServiceProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a self-service profile. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().update( + "id", + UpdateSelfServiceProfileRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile to update + +
+
+ +
+
+ +**name:** `Optional` — The name of the self-service Profile. + +
+
+ +
+
+ +**description:** `Optional` + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`] + +
+
+ +
+
+ +**userAttributes:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## Sessions +
client.sessions.get(id) -> GetSessionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve session information. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.sessions().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of session to retrieve + +
+
+
+
+ + +
+
+
+ +
client.sessions.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a session by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.sessions().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the session to delete. + +
+
+
+
+ + +
+
+
+ +
client.sessions.revoke(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Revokes a session by ID and all associated refresh tokens. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.sessions().revoke("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the session to revoke. + +
+
+
+
+ + +
+
+
+ +## Stats +
client.stats.getActiveUsersCount() -> Double +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the number of active users that logged in during the last 30 days. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.stats().getActiveUsersCount(); +``` +
+
+
+
+ + +
+
+
+ +
client.stats.getDaily() -> List<DailyStats> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.stats().getDaily( + GetDailyStatsRequestParameters + .builder() + .from("from") + .to("to") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional first day of the date range (inclusive) in YYYYMMDD format. + +
+
+ +
+
+ +**to:** `Optional` — Optional last day of the date range (inclusive) in YYYYMMDD format. + +
+
+
+
+ + +
+
+
+ +## SupplementalSignals +
client.supplementalSignals.get() -> GetSupplementalSignalsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the supplemental signals configuration for a tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.supplementalSignals().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.supplementalSignals.patch(request) -> PatchSupplementalSignalsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the supplemental signals configuration for a tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.supplementalSignals().patch( + UpdateSupplementalSignalsRequestContent + .builder() + .akamaiEnabled(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**akamaiEnabled:** `Boolean` — Indicates if incoming Akamai Headers should be processed + +
+
+
+
+ + +
+
+
+ +## Tickets +
client.tickets.verifyEmail(request) -> VerifyEmailTicketResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tickets().verifyEmail( + VerifyEmailTicketRequestContent + .builder() + .userId("user_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. + +
+
+ +
+
+ +**userId:** `String` — user_id of for whom the ticket should be created. + +
+
+ +
+
+ +**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. + +
+
+ +
+
+ +**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + +
+
+ +
+
+ +**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + +
+
+ +
+
+ +**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + +
+
+ +
+
+ +**identity:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.tickets.changePassword(request) -> ChangePasswordTicketResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + +Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tickets().changePassword( + ChangePasswordTicketRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. + +
+
+ +
+
+ +**userId:** `Optional` — user_id of for whom the ticket should be created. + +
+
+ +
+
+ +**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. + +
+
+ +
+
+ +**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + +
+
+ +
+
+ +**connectionId:** `Optional` — ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. + +
+
+ +
+
+ +**email:** `Optional` — Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id. + +
+
+ +
+
+ +**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + +
+
+ +
+
+ +**markEmailAsVerified:** `Optional` — Whether to set the email_verified attribute to true (true) or whether it should not be updated (false). + +
+
+ +
+
+ +**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + +
+
+
+
+ + +
+
+
+ +## TokenExchangeProfiles +
client.tokenExchangeProfiles.list() -> SyncPagingIterable<TokenExchangeProfileResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of all Token Exchange Profiles available in your tenant. + +This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenExchangeProfiles().list( + TokenExchangeProfilesListRequest + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.tokenExchangeProfiles.create(request) -> CreateTokenExchangeProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new Token Exchange Profile within your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenExchangeProfiles().create( + CreateTokenExchangeProfileRequestContent + .builder() + .name("name") + .subjectTokenType("subject_token_type") + .actionId("action_id") + .type("custom_authentication") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Friendly name of this profile. + +
+
+ +
+
+ +**subjectTokenType:** `String` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + +
+
+ +
+
+ +**actionId:** `String` — The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + +
+
+ +
+
+ +**type:** `String` + +
+
+
+
+ + +
+
+
+ +
client.tokenExchangeProfiles.get(id) -> GetTokenExchangeProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Token Exchange Profile specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenExchangeProfiles().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the Token Exchange Profile to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.tokenExchangeProfiles.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a Token Exchange Profile within your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenExchangeProfiles().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the Token Exchange Profile to delete. + +
+
+
+
+ + +
+
+
+ +
client.tokenExchangeProfiles.update(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a Token Exchange Profile within your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tokenExchangeProfiles().update( + "id", + UpdateTokenExchangeProfileRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the Token Exchange Profile to update. + +
+
+ +
+
+ +**name:** `Optional` — Friendly name of this profile. + +
+
+ +
+
+ +**subjectTokenType:** `Optional` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + +
+
+
+
+ + +
+
+
+ +## UserBlocks +
client.userBlocks.listByIdentifier() -> ListUserBlocksByIdentifierResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all Brute-force Protection blocks for a user with the given identifier (username, phone number, or email). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userBlocks().listByIdentifier( + ListUserBlocksByIdentifierRequestParameters + .builder() + .identifier("identifier") + .considerBruteForceEnablement(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifier:** `String` — Should be any of a username, phone number, or email. + +
+
+ +
+
+ +**considerBruteForceEnablement:** `Optional` + + + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. + + +
+
+
+
+ + +
+
+
+ +
client.userBlocks.deleteByIdentifier() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all Brute-force Protection blocks for the user with the given identifier (username, phone number, or email). + +Note: This endpoint does not unblock users that were blocked by a tenant administrator. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userBlocks().deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters + .builder() + .identifier("identifier") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifier:** `String` — Should be any of a username, phone number, or email. + +
+
+
+
+ + +
+
+
+ +
client.userBlocks.list(id) -> ListUserBlocksResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all Brute-force Protection blocks for the user with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userBlocks().list( + "id", + ListUserBlocksRequestParameters + .builder() + .considerBruteForceEnablement(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — user_id of the user blocks to retrieve. + +
+
+ +
+
+ +**considerBruteForceEnablement:** `Optional` + + + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. + + +
+
+
+
+ + +
+
+
+ +
client.userBlocks.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all Brute-force Protection blocks for the user with the given ID. + +Note: This endpoint does not unblock users that were blocked by a tenant administrator. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.userBlocks().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The user_id of the user to update. + +
+
+
+
+ + +
+
+
+ +## Users +
client.users.list() -> SyncPagingIterable<UserResponseSchema> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of users. It is possible to: + +- Specify a search criteria for users +- Sort the users to be returned +- Select the fields to be returned +- Specify the number of users to retrieve per page and the page index + +The q query parameter can be used to get users that match the specified criteria using query string syntax. + +Learn more about searching for users. + +Read about best practices when working with the API endpoints for retrieving users. + +Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().list( + ListUsersRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .sort("sort") + .connection("connection") + .fields("fields") + .includeFields(true) + .q("q") + .searchEngine(SearchEngineVersionsEnum.V1) + .primaryOrder(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1 + +
+
+ +
+
+ +**connection:** `Optional` — Connection filter. Only applies when using search_engine=v1. To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name" + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+ +
+
+ +**q:** `Optional` — Query in Lucene query string syntax. Some query types cannot be used on metadata fields, for details see Searchable Fields. + +
+
+ +
+
+ +**searchEngine:** `Optional` — The version of the search engine + +
+
+ +
+
+ +**primaryOrder:** `Optional` — If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. + +
+
+
+
+ + +
+
+
+ +
client.users.create(request) -> CreateUserResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new user for a given database or passwordless connection. + +Note: connection is required but other parameters such as email and password are dependent upon the type of connection. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().create( + CreateUserRequestContent + .builder() + .connection("connection") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**email:** `Optional` — The user's email. + +
+
+ +
+
+ +**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation). + +
+
+ +
+
+ +**userMetadata:** `Optional>` + +
+
+ +
+
+ +**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false). + +
+
+ +
+
+ +**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if `email_verified` is false or not specified + +
+
+ +
+
+ +**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false). + +
+
+ +
+
+ +**appMetadata:** `Optional>` + +
+
+ +
+
+ +**givenName:** `Optional` — The user's given name(s). + +
+
+ +
+
+ +**familyName:** `Optional` — The user's family name(s). + +
+
+ +
+
+ +**name:** `Optional` — The user's full name. + +
+
+ +
+
+ +**nickname:** `Optional` — The user's nickname. + +
+
+ +
+
+ +**picture:** `Optional` — A URI pointing to the user's picture. + +
+
+ +
+
+ +**userId:** `Optional` — The external user's id provided by the identity provider. + +
+
+ +
+
+ +**connection:** `String` — Name of the connection this user should be created in. + +
+
+ +
+
+ +**password:** `Optional` — Initial password for this user. Only valid for auth0 connection strategy. + +
+
+ +
+
+ +**verifyEmail:** `Optional` — Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter. + +
+
+ +
+
+ +**username:** `Optional` — The user's username. Only valid if the connection requires a username. + +
+
+
+
+ + +
+
+
+ +
client.users.listUsersByEmail() -> List<UserResponseSchema> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + +For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com. + +Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().listUsersByEmail( + ListUsersByEmailRequestParameters + .builder() + .email("email") + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). Defaults to true. + +
+
+ +
+
+ +**email:** `String` — Email address to search for (case-sensitive). + +
+
+
+
+ + +
+
+
+ +
client.users.get(id) -> GetUserResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().get( + "id", + GetUserRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.users.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to delete. + +
+
+
+
+ + +
+
+
+ +
client.users.update(id, request) -> UpdateUserResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a user. + +These are the attributes that can be updated at the root level: + +
    +
  • app_metadata
  • +
  • blocked
  • +
  • email
  • +
  • email_verified
  • +
  • family_name
  • +
  • given_name
  • +
  • name
  • +
  • nickname
  • +
  • password
  • +
  • phone_number
  • +
  • phone_verified
  • +
  • picture
  • +
  • username
  • +
  • user_metadata
  • +
  • verify_email
  • +
+ +Some considerations: +
    +
  • The properties of the new object will replace the old ones.
  • +
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • +
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • +
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • +
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • +
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • +
  • Supported attributes can be unset by supplying null as the value.
  • +
+ +
Updating a field (non-metadata property)
+To mark the email address of a user as verified, the body to send should be: +
{ "email_verified": true }
+ +
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: +
{ "user_metadata" : { "profileCode": 1479 } }
+ +To add the field addresses the body to send should be: +
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ +The modified object ends up with the following user_metadata property:
{
+  "user_metadata": {
+    "profileCode": 1479,
+    "addresses": { "work_address": "100 Industrial Way" }
+  }
+}
+ +
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: +
{
+  "user_metadata": {
+    "addresses": {
+      "work_address": "100 Industrial Way",
+      "home_address": "742 Evergreen Terrace"
+    }
+  }
+}
+ +The modified object ends up with the following user_metadata property: +
{
+  "user_metadata": {
+    "profileCode": 1479,
+    "addresses": {
+      "work_address": "100 Industrial Way",
+      "home_address": "742 Evergreen Terrace"
+    }
+  }
+}
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().update( + "id", + UpdateUserRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to update. + +
+
+ +
+
+ +**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false). + +
+
+ +
+
+ +**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). If set to false the user will not receive a verification email unless `verify_email` is set to true. + +
+
+ +
+
+ +**email:** `Optional` — Email address of this user. + +
+
+ +
+
+ +**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation). + +
+
+ +
+
+ +**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false). + +
+
+ +
+
+ +**userMetadata:** `Optional>` + +
+
+ +
+
+ +**appMetadata:** `Optional>` + +
+
+ +
+
+ +**givenName:** `Optional` — Given name/first name/forename of this user. + +
+
+ +
+
+ +**familyName:** `Optional` — Family name/last name/surname of this user. + +
+
+ +
+
+ +**name:** `Optional` — Name of this user. + +
+
+ +
+
+ +**nickname:** `Optional` — Preferred nickname or alias of this user. + +
+
+ +
+
+ +**picture:** `Optional` — URL to picture, photo, or avatar of this user. + +
+
+ +
+
+ +**verifyEmail:** `Optional` — Whether this user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter. + +
+
+ +
+
+ +**verifyPhoneNumber:** `Optional` — Whether this user will receive a text after changing the phone number (true) or no text (false). Only valid when changing phone number for SMS connections. + +
+
+ +
+
+ +**password:** `Optional` — New password for this user. Only valid for database connections. + +
+
+ +
+
+ +**connection:** `Optional` — Name of the connection to target for this user update. + +
+
+ +
+
+ +**clientId:** `Optional` — Auth0 client ID. Only valid when updating email address. + +
+
+ +
+
+ +**username:** `Optional` — The user's username. Only valid if the connection requires a username. + +
+
+
+
+ + +
+
+
+ +
client.users.regenerateRecoveryCode(id) -> RegenerateUsersRecoveryCodeResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().regenerateRecoveryCode("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to regenerate a multi-factor authentication recovery code for. + +
+
+
+
+ + +
+
+
+ +
client.users.revokeAccess(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Revokes selected resources related to a user (sessions, refresh tokens, ...). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().revokeAccess( + "id", + RevokeUserAccessRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user. + +
+
+ +
+
+ +**sessionId:** `Optional` — ID of the session to revoke. + +
+
+ +
+
+ +**preserveRefreshTokens:** `Optional` — Whether to preserve the refresh tokens associated with the session. + +
+
+
+
+ + +
+
+
+ +## Actions Versions +
client.actions.versions.list(actionId) -> SyncPagingIterable<ActionVersion> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().versions().list( + "actionId", + ListActionVersionsRequestParameters + .builder() + .page(1) + .perPage(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**actionId:** `String` — The ID of the action. + +
+
+ +
+
+ +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — This field specify the maximum number of results to be returned by the server. 20 by default + +
+
+
+
+ + +
+
+
+ +
client.actions.versions.get(actionId, id) -> GetActionVersionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().versions().get("actionId", "id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**actionId:** `String` — The ID of the action. + +
+
+ +
+
+ +**id:** `String` — The ID of the action version. + +
+
+
+
+ + +
+
+
+ +
client.actions.versions.deploy(actionId, id, request) -> DeployActionVersionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().versions().deploy( + "actionId", + "id", + Optional.empty() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**actionId:** `String` — The ID of an action. + +
+
+ +
+
+ +**id:** `String` — The ID of an action version. + +
+
+ +
+
+ +**request:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Actions Executions +
client.actions.executions.get(id) -> GetActionExecutionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().executions().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the execution to retrieve. + +
+
+
+
+ + +
+
+
+ +## Actions Triggers +
client.actions.triggers.list() -> ListActionTriggersResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().triggers().list(); +``` +
+
+
+
+ + +
+
+
+ +## Actions Triggers Bindings +
client.actions.triggers.bindings.list(triggerId) -> SyncPagingIterable<ActionBinding> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().triggers().bindings().list( + "triggerId", + ListActionTriggerBindingsRequestParameters + .builder() + .page(1) + .perPage(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**triggerId:** `String` — An actions extensibility point. + +
+
+ +
+
+ +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — The maximum number of results to be returned in a single request. 20 by default + +
+
+
+
+ + +
+
+
+ +
client.actions.triggers.bindings.updateMany(triggerId, request) -> UpdateActionBindingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.actions().triggers().bindings().updateMany( + "triggerId", + UpdateActionBindingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**triggerId:** `String` — An actions extensibility point. + +
+
+ +
+
+ +**bindings:** `Optional>` — The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed. + +
+
+
+
+ + +
+
+
+ +## Anomaly Blocks +
client.anomaly.blocks.checkIp(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Check if the given IP address is blocked via the Suspicious IP Throttling due to multiple suspicious attempts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.anomaly().blocks().checkIp("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — IP address to check. + +
+
+
+
+ + +
+
+
+ +
client.anomaly.blocks.unblockIp(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove a block imposed by Suspicious IP Throttling for the given IP address. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.anomaly().blocks().unblockIp("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — IP address to unblock. + +
+
+
+
+ + +
+
+
+ +## AttackProtection BreachedPasswordDetection +
client.attackProtection.breachedPasswordDetection.get() -> GetBreachedPasswordDetectionSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the Breached Password Detection configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().breachedPasswordDetection().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.attackProtection.breachedPasswordDetection.update(request) -> UpdateBreachedPasswordDetectionSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update details of the Breached Password Detection configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().breachedPasswordDetection().update( + UpdateBreachedPasswordDetectionSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enabled:** `Optional` — Whether or not breached password detection is active. + +
+
+ +
+
+ +**shields:** `Optional>` + +Action to take when a breached password is detected during a login. + Possible values: block, user_notification, admin_notification. + +
+
+ +
+
+ +**adminNotificationFrequency:** `Optional>` + +When "admin_notification" is enabled, determines how often email notifications are sent. + Possible values: immediately, daily, weekly, monthly. + +
+
+ +
+
+ +**method:** `Optional` + +
+
+ +
+
+ +**stage:** `Optional` + +
+
+
+
+ + +
+
+
+ +## AttackProtection BruteForceProtection +
client.attackProtection.bruteForceProtection.get() -> GetBruteForceSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the Brute-force Protection configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().bruteForceProtection().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.attackProtection.bruteForceProtection.update(request) -> UpdateBruteForceSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the Brute-force Protection configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().bruteForceProtection().update( + UpdateBruteForceSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enabled:** `Optional` — Whether or not brute force attack protections are active. + +
+
+ +
+
+ +**shields:** `Optional>` + +Action to take when a brute force protection threshold is violated. + Possible values: block, user_notification. + +
+
+ +
+
+ +**allowlist:** `Optional>` — List of trusted IP addresses that will not have attack protection enforced against them. + +
+
+ +
+
+ +**mode:** `Optional` + +Account Lockout: Determines whether or not IP address is used when counting failed attempts. + Possible values: count_per_identifier_and_ip, count_per_identifier. + +
+
+ +
+
+ +**maxAttempts:** `Optional` — Maximum number of unsuccessful attempts. + +
+
+
+
+ + +
+
+
+ +## AttackProtection SuspiciousIpThrottling +
client.attackProtection.suspiciousIpThrottling.get() -> GetSuspiciousIpThrottlingSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the Suspicious IP Throttling configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().suspiciousIpThrottling().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.attackProtection.suspiciousIpThrottling.update(request) -> UpdateSuspiciousIpThrottlingSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the details of the Suspicious IP Throttling configuration of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.attackProtection().suspiciousIpThrottling().update( + UpdateSuspiciousIpThrottlingSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enabled:** `Optional` — Whether or not suspicious IP throttling attack protections are active. + +
+
+ +
+
+ +**shields:** `Optional>` + +Action to take when a suspicious IP throttling threshold is violated. + Possible values: block, admin_notification. + +
+
+ +
+
+ +**allowlist:** `Optional>` + +
+
+ +
+
+ +**stage:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Branding Templates +
client.branding.templates.getUniversalLogin() -> GetUniversalLoginTemplateResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().templates().getUniversalLogin(); +``` +
+
+
+
+ + +
+
+
+ +
client.branding.templates.updateUniversalLogin(request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the Universal Login branding template. + +

When content-type header is set to application/json, the expected body must be JSON:

+
+{
+  "template": "<!DOCTYPE html><html><head>{%- auth0:head -%}</head><body>{%- auth0:widget -%}</body></html>"
+}
+
+ +

+ When content-type header is set to text/html, the expected body must be the HTML template: +

+
+<!DOCTYPE html>
+<code>
+  <html>
+    <head>
+     {%- auth0:head -%}
+    </head>
+    <body>
+      {%- auth0:widget -%}
+    </body>
+  </html>
+</code>
+
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().templates().updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent.of("string") +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UpdateUniversalLoginTemplateRequestContent` + +
+
+
+
+ + +
+
+
+ +
client.branding.templates.deleteUniversalLogin() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().templates().deleteUniversalLogin(); +``` +
+
+
+
+ + +
+
+
+ +## Branding Themes +
client.branding.themes.create(request) -> CreateBrandingThemeResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create branding theme. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().themes().create( + CreateBrandingThemeRequestContent + .builder() + .borders( + BrandingThemeBorders + .builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build() + ) + .colors( + BrandingThemeColors + .builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build() + ) + .fonts( + BrandingThemeFonts + .builder() + .bodyText( + BrandingThemeFontBodyText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .buttonsText( + BrandingThemeFontButtonsText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .fontUrl("font_url") + .inputLabels( + BrandingThemeFontInputLabels + .builder() + .bold(true) + .size(1.1) + .build() + ) + .links( + BrandingThemeFontLinks + .builder() + .bold(true) + .size(1.1) + .build() + ) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle( + BrandingThemeFontSubtitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .title( + BrandingThemeFontTitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .build() + ) + .pageBackground( + BrandingThemePageBackground + .builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build() + ) + .widget( + BrandingThemeWidget + .builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**borders:** `BrandingThemeBorders` + +
+
+ +
+
+ +**colors:** `BrandingThemeColors` + +
+
+ +
+
+ +**displayName:** `Optional` — Display Name + +
+
+ +
+
+ +**fonts:** `BrandingThemeFonts` + +
+
+ +
+
+ +**pageBackground:** `BrandingThemePageBackground` + +
+
+ +
+
+ +**widget:** `BrandingThemeWidget` + +
+
+
+
+ + +
+
+
+ +
client.branding.themes.getDefault() -> GetBrandingDefaultThemeResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve default branding theme. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().themes().getDefault(); +``` +
+
+
+
+ + +
+
+
+ +
client.branding.themes.get(themeId) -> GetBrandingThemeResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve branding theme. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().themes().get("themeId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**themeId:** `String` — The ID of the theme + +
+
+
+
+ + +
+
+
+ +
client.branding.themes.delete(themeId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete branding theme. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().themes().delete("themeId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**themeId:** `String` — The ID of the theme + +
+
+
+
+ + +
+
+
+ +
client.branding.themes.update(themeId, request) -> UpdateBrandingThemeResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update branding theme. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().themes().update( + "themeId", + UpdateBrandingThemeRequestContent + .builder() + .borders( + BrandingThemeBorders + .builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build() + ) + .colors( + BrandingThemeColors + .builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build() + ) + .fonts( + BrandingThemeFonts + .builder() + .bodyText( + BrandingThemeFontBodyText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .buttonsText( + BrandingThemeFontButtonsText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .fontUrl("font_url") + .inputLabels( + BrandingThemeFontInputLabels + .builder() + .bold(true) + .size(1.1) + .build() + ) + .links( + BrandingThemeFontLinks + .builder() + .bold(true) + .size(1.1) + .build() + ) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle( + BrandingThemeFontSubtitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .title( + BrandingThemeFontTitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .build() + ) + .pageBackground( + BrandingThemePageBackground + .builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build() + ) + .widget( + BrandingThemeWidget + .builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**themeId:** `String` — The ID of the theme + +
+
+ +
+
+ +**borders:** `BrandingThemeBorders` + +
+
+ +
+
+ +**colors:** `BrandingThemeColors` + +
+
+ +
+
+ +**displayName:** `Optional` — Display Name + +
+
+ +
+
+ +**fonts:** `BrandingThemeFonts` + +
+
+ +
+
+ +**pageBackground:** `BrandingThemePageBackground` + +
+
+ +
+
+ +**widget:** `BrandingThemeWidget` + +
+
+
+
+ + +
+
+
+ +## Branding Phone Providers +
client.branding.phone.providers.list() -> ListBrandingPhoneProvidersResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().list( + ListBrandingPhoneProvidersRequestParameters + .builder() + .disabled(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.providers.create(request) -> CreateBrandingPhoneProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a phone provider. +The credentials object requires different properties depending on the phone provider (which is specified using the name property). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().create( + CreateBrandingPhoneProviderRequestContent + .builder() + .name(PhoneProviderNameEnum.TWILIO) + .credentials( + PhoneProviderCredentials.of( + TwilioProviderCredentials + .builder() + .authToken("auth_token") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `PhoneProviderNameEnum` + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). + +
+
+ +
+
+ +**configuration:** `Optional` + +
+
+ +
+
+ +**credentials:** `PhoneProviderCredentials` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.providers.get(id) -> GetBrandingPhoneProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve phone provider details. A list of fields to include or exclude may also be specified. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.providers.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete the configured phone provider. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.providers.update(id, request) -> UpdateBrandingPhoneProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a phone provider. +The credentials object requires different properties depending on the phone provider (which is specified using the name property). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().update( + "id", + UpdateBrandingPhoneProviderRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). + +
+
+ +
+
+ +**credentials:** `Optional` + +
+
+ +
+
+ +**configuration:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.providers.test(id, request) -> CreatePhoneProviderSendTestResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().providers().test( + "id", + CreatePhoneProviderSendTestRequestContent + .builder() + .to("to") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**to:** `String` — The recipient phone number to receive a given notification. + +
+
+ +
+
+ +**deliveryMethod:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Branding Phone Templates +
client.branding.phone.templates.list() -> ListPhoneTemplatesResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().list( + ListPhoneTemplatesRequestParameters + .builder() + .disabled(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.create(request) -> CreatePhoneTemplateResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().create( + CreatePhoneTemplateRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**type:** `Optional` + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). + +
+
+ +
+
+ +**content:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.get(id) -> GetPhoneTemplateResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.update(id, request) -> UpdatePhoneTemplateResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().update( + "id", + UpdatePhoneTemplateRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**content:** `Optional` + +
+
+ +
+
+ +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.reset(id, request) -> ResetPhoneTemplateResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().reset("id", new +HashMap() {{put("key", "value"); +}}); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**request:** `Object` + +
+
+
+
+ + +
+
+
+ +
client.branding.phone.templates.test(id, request) -> CreatePhoneTemplateTestNotificationResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.branding().phone().templates().test( + "id", + CreatePhoneTemplateTestNotificationRequestContent + .builder() + .to("to") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**to:** `String` — Destination of the testing phone notification + +
+
+ +
+
+ +**deliveryMethod:** `Optional` + +
+
+
+
+ + +
+
+
+ +## ClientGrants Organizations +
client.clientGrants.organizations.list(id) -> SyncPagingIterable<Organization> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clientGrants().organizations().list( + "id", + ListClientGrantOrganizationsRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client grant + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +## Clients Credentials +
client.clients.credentials.list(clientId) -> List<ClientCredential> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the details of a client credential. + +Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().credentials().list("client_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+
+
+ + +
+
+
+ +
client.clients.credentials.create(clientId, request) -> PostClientCredentialResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + +
Public Key
Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests. + +Sample:
{
+  "credential_type": "public_key",
+  "name": "string",
+  "pem": "string",
+  "alg": "RS256",
+  "parse_expiry_from_cert": false,
+  "expires_at": "2022-12-31T23:59:59Z"
+}
+
Certificate (CA-signed & self-signed)
Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN. + +CA-signed Certificate Sample (pem):
{
+  "credential_type": "x509_cert",
+  "name": "string",
+  "pem": "string"
+}
CA-signed Certificate Sample (subject_dn):
{
+  "credential_type": "cert_subject_dn",
+  "name": "string",
+  "subject_dn": "string"
+}
Self-signed Certificate Sample:
{
+  "credential_type": "cert_subject_dn",
+  "name": "string",
+  "pem": "string"
+}
+ +The credential will be created but not yet enabled for use until you set the corresponding properties in the client: + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().credentials().create( + "client_id", + PostClientCredentialRequestContent + .builder() + .credentialType(ClientCredentialTypeEnum.PUBLIC_KEY) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialType:** `ClientCredentialTypeEnum` + +
+
+ +
+
+ +**name:** `Optional` — Friendly name for a credential. + +
+
+ +
+
+ +**subjectDn:** `Optional` — Subject Distinguished Name. Mutually exclusive with `pem` property. Applies to `cert_subject_dn` credential type. + +
+
+ +
+
+ +**pem:** `Optional` — PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped. + +
+
+ +
+
+ +**alg:** `Optional` + +
+
+ +
+
+ +**parseExpiryFromCert:** `Optional` — Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to `public_key` credential type. + +
+
+ +
+
+ +**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to `public_key` credential type. + +
+
+
+
+ + +
+
+
+ +
client.clients.credentials.get(clientId, credentialId) -> GetClientCredentialResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the details of a client credential. + +Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().credentials().get("client_id", "credential_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential. + +
+
+
+
+ + +
+
+
+ +
client.clients.credentials.delete(clientId, credentialId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().credentials().delete("client_id", "credential_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential to delete. + +
+
+
+
+ + +
+
+
+ +
client.clients.credentials.update(clientId, credentialId, request) -> PatchClientCredentialResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().credentials().update( + "client_id", + "credential_id", + PatchClientCredentialRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential. + +
+
+ +
+
+ +**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential. + +
+
+
+
+ + +
+
+
+ +## Clients Connections +
client.clients.connections.get(id) -> SyncPagingIterable<ConnectionForList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all connections that are enabled for the specified Application, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. +
    +
  • + This endpoint requires the read:connections scope and any one of read:clients or read:client_summary. +
  • +
  • + Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.clients().connections().get( + "id", + ConnectionsGetRequest + .builder() + .from("from") + .take(1) + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client for which to retrieve enabled connections. + +
+
+ +
+
+ +**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + +
+
+ +
+
+ +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) + +
+
+
+
+ + +
+
+
+ +## Connections Clients +
client.connections.clients.get(id) -> SyncPagingIterable<ConnectionEnabledClient> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all clients that have the specified connection enabled. + +Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().clients().get( + "id", + GetConnectionEnabledClientsRequestParameters + .builder() + .take(1) + .from("from") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection for which enabled clients are to be retrieved + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+
+
+ + +
+
+
+ +
client.connections.clients.update(id, request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().clients().update( + "id", + Arrays.asList( + UpdateEnabledClientConnectionsRequestContentItem + .builder() + .clientId("client_id") + .status(true) + .build() + ) +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to modify + +
+
+ +
+
+ +**request:** `List` + +
+
+
+
+ + +
+
+
+ +## Connections Keys +
client.connections.keys.get(id) -> List<ConnectionKey> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the connection keys for the Okta or OIDC connection strategy. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().keys().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the connection + +
+
+
+
+ + +
+
+
+ +
client.connections.keys.rotate(id, request) -> RotateConnectionsKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Rotates the connection keys for the Okta or OIDC connection strategies. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().keys().rotate( + "id", + Optional.empty() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the connection + +
+
+ +
+
+ +**request:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Connections ScimConfiguration +
client.connections.scimConfiguration.get(id) -> GetScimConfigurationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a scim configuration by its connectionId. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to retrieve its SCIM configuration + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.create(id, request) -> CreateScimConfigurationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a scim configuration for a connection. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().create( + "id", + Optional.empty() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to create its SCIM configuration + +
+
+ +
+
+ +**request:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a scim configuration by its connectionId. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to delete its SCIM configuration + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.update(id, request) -> UpdateScimConfigurationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a scim configuration by its connectionId. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().update( + "id", + UpdateScimConfigurationRequestContent + .builder() + .userIdAttribute("user_id_attribute") + .mapping( + Arrays.asList( + ScimMappingItem + .builder() + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to update its SCIM configuration + +
+
+ +
+
+ +**userIdAttribute:** `String` — User ID attribute for generating unique user ids + +
+
+ +
+
+ +**mapping:** `List` — The mapping between auth0 and SCIM + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.getDefaultMapping(id) -> GetScimConfigurationDefaultMappingResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a scim configuration's default mapping by its connectionId. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().getDefaultMapping("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to retrieve its default SCIM mapping + +
+
+
+
+ + +
+
+
+ +## Connections Users +
client.connections.users.deleteByEmail(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().users().deleteByEmail( + "id", + DeleteConnectionUsersByEmailQueryParameters + .builder() + .email("email") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection (currently only database connections are supported) + +
+
+ +
+
+ +**email:** `String` — The email of the user to delete + +
+
+
+
+ + +
+
+
+ +## Connections ScimConfiguration Tokens +
client.connections.scimConfiguration.tokens.get(id) -> List<ScimTokenItem> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves all scim tokens by its connection id. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().tokens().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to retrieve its SCIM configuration + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.tokens.create(id, request) -> CreateScimTokenResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a scim token for a scim client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().tokens().create( + "id", + CreateScimTokenRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the connection to create its SCIM token + +
+
+ +
+
+ +**scopes:** `Optional>` — The scopes of the scim token + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Lifetime of the token in seconds. Must be greater than 900 + +
+
+
+
+ + +
+
+
+ +
client.connections.scimConfiguration.tokens.delete(id, tokenId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a scim token by its connection id and tokenId. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.connections().scimConfiguration().tokens().delete("id", "tokenId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The connection id that owns the SCIM token to delete + +
+
+ +
+
+ +**tokenId:** `String` — The id of the scim token to delete + +
+
+
+
+ + +
+
+
+ +## Emails Provider +
client.emails.provider.get() -> GetEmailProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the email provider configuration in your tenant. A list of fields to include or exclude may also be specified. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emails().provider().get( + GetEmailProviderRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve `name` and `enabled`. Additional fields available include `credentials`, `default_from_address`, and `settings`. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.emails.provider.create(request) -> CreateEmailProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an email provider. The credentials object +requires different properties depending on the email provider (which is specified using the name property): +
    +
  • mandrill requires api_key
  • +
  • sendgrid requires api_key
  • +
  • + sparkpost requires api_key. Optionally, set region to eu to use + the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in + North America. eu or null are the only valid values for region. +
  • +
  • + mailgun requires api_key and domain. Optionally, set region to + eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or + null are the only valid values for region. +
  • +
  • ses requires accessKeyId, secretAccessKey, and region
  • +
  • + smtp requires smtp_host, smtp_port, smtp_user, and + smtp_pass +
  • +
+Depending on the type of provider it is possible to specify settings object with different configuration +options, which will be used when sending an email: +
    +
  • + smtp provider, settings may contain headers object. +
      +
    • + When using AWS SES SMTP host, you may provide a name of configuration set in + X-SES-Configuration-Set header. Value must be a string. +
    • +
    • + When using Sparkpost host, you may provide value for + X-MSYS_API header. Value must be an object. +
    • +
    +
  • +
  • + for ses provider, settings may contain message object, where you can provide + a name of configuration set in configuration_set_name property. Value must be a string. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emails().provider().create( + CreateEmailProviderRequestContent + .builder() + .name(EmailProviderNameEnum.MAILGUN) + .credentials( + EmailProviderCredentialsSchema.of( + EmailProviderCredentialsSchemaZero + .builder() + .apiKey("api_key") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `EmailProviderNameEnum` + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false). + +
+
+ +
+
+ +**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. + +
+
+ +
+
+ +**credentials:** `EmailProviderCredentialsSchema` + +
+
+ +
+
+ +**settings:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.emails.provider.delete() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete the email provider. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emails().provider().delete(); +``` +
+
+
+
+ + +
+
+
+ +
client.emails.provider.update(request) -> UpdateEmailProviderResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an email provider. The credentials object +requires different properties depending on the email provider (which is specified using the name property): +
    +
  • mandrill requires api_key
  • +
  • sendgrid requires api_key
  • +
  • + sparkpost requires api_key. Optionally, set region to eu to use + the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in + North America. eu or null are the only valid values for region. +
  • +
  • + mailgun requires api_key and domain. Optionally, set region to + eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or + null are the only valid values for region. +
  • +
  • ses requires accessKeyId, secretAccessKey, and region
  • +
  • + smtp requires smtp_host, smtp_port, smtp_user, and + smtp_pass +
  • +
+Depending on the type of provider it is possible to specify settings object with different configuration +options, which will be used when sending an email: +
    +
  • + smtp provider, settings may contain headers object. +
      +
    • + When using AWS SES SMTP host, you may provide a name of configuration set in + X-SES-Configuration-Set header. Value must be a string. +
    • +
    • + When using Sparkpost host, you may provide value for + X-MSYS_API header. Value must be an object. +
    • +
    + for ses provider, settings may contain message object, where you can provide + a name of configuration set in configuration_set_name property. Value must be a string. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.emails().provider().update( + UpdateEmailProviderRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false). + +
+
+ +
+
+ +**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. + +
+
+ +
+
+ +**credentials:** `Optional` + +
+
+ +
+
+ +**settings:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## EventStreams Deliveries +
client.eventStreams.deliveries.list(id) -> List<EventStreamDelivery> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().deliveries().list( + "id", + ListEventStreamDeliveriesRequestParameters + .builder() + .statuses("statuses") + .eventTypes("event_types") + .dateFrom("date_from") + .dateTo("date_to") + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**statuses:** `Optional` — Comma-separated list of statuses by which to filter + +
+
+ +
+
+ +**eventTypes:** `Optional` — Comma-separated list of event types by which to filter + +
+
+ +
+
+ +**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. + +
+
+ +
+
+ +**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.deliveries.getHistory(id, eventId) -> GetEventStreamDeliveryHistoryResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().deliveries().getHistory("id", "event_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**eventId:** `String` — Unique identifier for the event + +
+
+
+
+ + +
+
+
+ +## EventStreams Redeliveries +
client.eventStreams.redeliveries.create(id, request) -> CreateEventStreamRedeliveryResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().redeliveries().create( + "id", + CreateEventStreamRedeliveryRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. + +
+
+ +
+
+ +**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + +
+
+ +
+
+ +**statuses:** `Optional>` — Filter by status + +
+
+ +
+
+ +**eventTypes:** `Optional>` — Filter by event type + +
+
+
+
+ + +
+
+
+ +
client.eventStreams.redeliveries.createById(id, eventId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.eventStreams().redeliveries().createById("id", "event_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**eventId:** `String` — Unique identifier for the event + +
+
+
+
+ + +
+
+
+ +## Flows Executions +
client.flows.executions.list(flowId) -> SyncPagingIterable<FlowExecutionSummary> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().executions().list( + "flow_id", + ExecutionsListRequest + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flowId:** `String` — Flow id + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.flows.executions.get(flowId, executionId) -> GetFlowExecutionResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().executions().get( + "flow_id", + "execution_id", + ExecutionsGetRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flowId:** `String` — Flow id + +
+
+ +
+
+ +**executionId:** `String` — Flow execution id + +
+
+ +
+
+ +**hydrate:** `Optional` — Hydration param + +
+
+
+
+ + +
+
+
+ +
client.flows.executions.delete(flowId, executionId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.flows().executions().delete("flow_id", "execution_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flowId:** `String` — Flows id + +
+
+ +
+
+ +**executionId:** `String` — Flow execution identifier + +
+
+
+
+ + +
+
+
+ +## Guardian Enrollments +
client.guardian.enrollments.createTicket(request) -> CreateGuardianEnrollmentTicketResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. +Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
+ +Note: Users cannot enroll in Email as a factor through custom enrollment tickets. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().enrollments().createTicket( + CreateGuardianEnrollmentTicketRequestContent + .builder() + .userId("user_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — user_id for the enrollment ticket + +
+
+ +
+
+ +**email:** `Optional` — alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address + +
+
+ +
+
+ +**sendMail:** `Optional` — Send an email to the user to start the enrollment + +
+
+ +
+
+ +**emailLocale:** `Optional` — Optional. Specify the locale of the enrollment email. Used with send_email. + +
+
+ +
+
+ +**factor:** `Optional` + +
+
+ +
+
+ +**allowMultipleEnrollments:** `Optional` — Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.
Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages. + +
+
+
+
+ + +
+
+
+ +
client.guardian.enrollments.get(id) -> GetGuardianEnrollmentResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().enrollments().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the enrollment to be retrieve. + +
+
+
+
+ + +
+
+
+ +
client.guardian.enrollments.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().enrollments().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the enrollment to be deleted. + +
+
+
+
+ + +
+
+
+ +## Guardian Factors +
client.guardian.factors.list() -> List<GuardianFactor> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all multi-factor authentication factors associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.set(name, request) -> SetGuardianFactorResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().set( + GuardianFactorNameEnum.PUSH_NOTIFICATION, + SetGuardianFactorRequestContent + .builder() + .enabled(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `GuardianFactorNameEnum` — Factor name. Can be `sms`, `push-notification`, `email`, `duo` `otp` `webauthn-roaming`, `webauthn-platform`, or `recovery-code`. + +
+
+ +
+
+ +**enabled:** `Boolean` — Whether this factor is enabled (true) or disabled (false). + +
+
+
+
+ + +
+
+
+ +## Guardian Policies +
client.guardian.policies.list() -> List<MfaPolicyEnum> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the multi-factor authentication (MFA) policies configured for your tenant. + +The following policies are supported: +
    +
  • all-applications policy prompts with MFA for all logins.
  • +
  • confidence-score policy prompts with MFA only for low confidence logins.
  • +
+ +Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().policies().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.policies.set(request) -> List<MfaPolicyEnum> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set multi-factor authentication (MFA) policies for your tenant. + +The following policies are supported: +
    +
  • all-applications policy prompts with MFA for all logins.
  • +
  • confidence-score policy prompts with MFA only for low confidence logins.
  • +
+ +Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().policies().set( + Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS) +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `List` + +
+
+
+
+ + +
+
+
+ +## Guardian Factors Phone +
client.guardian.factors.phone.getMessageTypes() -> GetGuardianFactorPhoneMessageTypesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().getMessageTypes(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.setMessageTypes(request) -> SetGuardianFactorPhoneMessageTypesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replace the list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent + .builder() + .messageTypes( + Arrays.asList(GuardianFactorPhoneFactorMessageTypeEnum.SMS) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**messageTypes:** `List` — The list of phone factors to enable on the tenant. Can include `sms` and `voice`. + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.getTwilioProvider() -> GetGuardianFactorsProviderPhoneTwilioResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review Configure SMS and Voice Notifications for MFA. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().getTwilioProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.setTwilioProvider(request) -> SetGuardianFactorsProviderPhoneTwilioResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review Configure SMS and Voice Notifications for MFA. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — From number + +
+
+ +
+
+ +**messagingServiceSid:** `Optional` — Copilot SID + +
+
+ +
+
+ +**authToken:** `Optional` — Twilio Authentication token + +
+
+ +
+
+ +**sid:** `Optional` — Twilio SID + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.getSelectedProvider() -> GetGuardianFactorsProviderPhoneResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the multi-factor authentication phone provider configured for your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().getSelectedProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.setProvider(request) -> SetGuardianFactorsProviderPhoneResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().setProvider( + SetGuardianFactorsProviderPhoneRequestContent + .builder() + .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**provider:** `GuardianFactorsProviderSmsProviderEnum` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.getTemplates() -> GetGuardianFactorPhoneTemplatesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().getTemplates(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.setTemplates(request) -> SetGuardianFactorPhoneTemplatesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Customize the messages sent to complete phone enrollment and verification (subscription required). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent + .builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number. + +
+
+ +
+
+ +**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account. + +
+
+
+
+ + +
+
+
+ +## Guardian Factors PushNotification +
client.guardian.factors.pushNotification.getApnsProvider() -> GetGuardianFactorsProviderApnsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().getApnsProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.setApnsProvider(request) -> SetGuardianFactorsProviderPushNotificationApnsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SetGuardianFactorsProviderPushNotificationApnsRequestContent` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.setFcmProvider(request) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SetGuardianFactorsProviderPushNotificationFcmRequestContent` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.setFcmv1Provider(request) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SetGuardianFactorsProviderPushNotificationFcmv1RequestContent` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.getSnsProvider() -> GetGuardianFactorsProviderSnsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().getSnsProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.setSnsProvider(request) -> SetGuardianFactorsProviderPushNotificationSnsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Configure the AWS SNS push notification provider configuration (subscription required). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**awsAccessKeyId:** `Optional` + +
+
+ +
+
+ +**awsSecretAccessKey:** `Optional` + +
+
+ +
+
+ +**awsRegion:** `Optional` + +
+
+ +
+
+ +**snsApnsPlatformApplicationArn:** `Optional` + +
+
+ +
+
+ +**snsGcmPlatformApplicationArn:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.updateSnsProvider(request) -> UpdateGuardianFactorsProviderPushNotificationSnsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Configure the AWS SNS push notification provider configuration (subscription required). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**awsAccessKeyId:** `Optional` + +
+
+ +
+
+ +**awsSecretAccessKey:** `Optional` + +
+
+ +
+
+ +**awsRegion:** `Optional` + +
+
+ +
+
+ +**snsApnsPlatformApplicationArn:** `Optional` + +
+
+ +
+
+ +**snsGcmPlatformApplicationArn:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.getSelectedProvider() -> GetGuardianFactorsProviderPushNotificationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().getSelectedProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.pushNotification.setProvider(request) -> SetGuardianFactorsProviderPushNotificationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().pushNotification().setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent + .builder() + .provider(GuardianFactorsProviderPushNotificationProviderDataEnum.GUARDIAN) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**provider:** `GuardianFactorsProviderPushNotificationProviderDataEnum` + +
+
+
+
+ + +
+
+
+ +## Guardian Factors Sms +
client.guardian.factors.sms.getTwilioProvider() -> GetGuardianFactorsProviderSmsTwilioResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the Twilio SMS provider configuration (subscription required). + + A new endpoint is available to retrieve the Twilio configuration related to phone factors (phone Twilio configuration). It has the same payload as this one. Please use it instead. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().getTwilioProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.sms.setTwilioProvider(request) -> SetGuardianFactorsProviderSmsTwilioResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint has been deprecated. To complete this action, use the Update Twilio phone configuration endpoint. + + Previous functionality: Update the Twilio SMS provider configuration. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — From number + +
+
+ +
+
+ +**messagingServiceSid:** `Optional` — Copilot SID + +
+
+ +
+
+ +**authToken:** `Optional` — Twilio Authentication token + +
+
+ +
+
+ +**sid:** `Optional` — Twilio SID + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.sms.getSelectedProvider() -> GetGuardianFactorsProviderSmsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint has been deprecated. To complete this action, use the Retrieve phone configuration endpoint instead. + + Previous functionality: Retrieve details for the multi-factor authentication SMS provider configured for your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().getSelectedProvider(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.sms.setProvider(request) -> SetGuardianFactorsProviderSmsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint has been deprecated. To complete this action, use the Update phone configuration endpoint instead. + + Previous functionality: Update the multi-factor authentication SMS provider configuration in your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().setProvider( + SetGuardianFactorsProviderSmsRequestContent + .builder() + .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**provider:** `GuardianFactorsProviderSmsProviderEnum` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.sms.getTemplates() -> GetGuardianFactorSmsTemplatesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint has been deprecated. To complete this action, use the Retrieve enrollment and verification phone templates endpoint instead. + + Previous function: Retrieve details of SMS enrollment and verification templates configured for your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().getTemplates(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.sms.setTemplates(request) -> SetGuardianFactorSmsTemplatesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint has been deprecated. To complete this action, use the Update enrollment and verification phone templates endpoint instead. + + Previous functionality: Customize the messages sent to complete SMS enrollment and verification. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().sms().setTemplates( + SetGuardianFactorSmsTemplatesRequestContent + .builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number. + +
+
+ +
+
+ +**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account. + +
+
+
+
+ + +
+
+
+ +## Guardian Factors Duo Settings +
client.guardian.factors.duo.settings.get() -> GetGuardianFactorDuoSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves the DUO account and factor configuration. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().duo().settings().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.duo.settings.set(request) -> SetGuardianFactorDuoSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set the DUO account configuration and other properties specific to this factor. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().duo().settings().set( + SetGuardianFactorDuoSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**ikey:** `Optional` + +
+
+ +
+
+ +**skey:** `Optional` + +
+
+ +
+
+ +**host:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.duo.settings.update(request) -> UpdateGuardianFactorDuoSettingsResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().duo().settings().update( + UpdateGuardianFactorDuoSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**ikey:** `Optional` + +
+
+ +
+
+ +**skey:** `Optional` + +
+
+ +
+
+ +**host:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Hooks Secrets +
client.hooks.secrets.get(id) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a hook's secrets by the ID of the hook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().secrets().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to retrieve secrets from. + +
+
+
+
+ + +
+
+
+ +
client.hooks.secrets.create(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().secrets().create( + "id", + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the hook to retrieve + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +
client.hooks.secrets.delete(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().secrets().delete( + "id", + Arrays.asList("string") +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook whose secrets to delete. + +
+
+ +
+
+ +**request:** `List` + +
+
+
+
+ + +
+
+
+ +
client.hooks.secrets.update(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().secrets().update( + "id", + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook whose secrets to update. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +## Jobs UsersExports +
client.jobs.usersExports.create(request) -> CreateExportUsersResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Export all users to a file via a long-running job. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().usersExports().create( + CreateExportUsersRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**connectionId:** `Optional` — connection_id of the connection from which users will be exported. + +
+
+ +
+
+ +**format:** `Optional` + +
+
+ +
+
+ +**limit:** `Optional` — Limit the number of records. + +
+
+ +
+
+ +**fields:** `Optional>` — List of fields to be included in the CSV. Defaults to a predefined set of fields. + +
+
+
+
+ + +
+
+
+ +## Jobs UsersImports +
client.jobs.usersImports.create(request) -> CreateImportUsersResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Import users from a formatted file into a connection via a long-running job. When importing users, with or without upsert, the `email_verified` is set to `false` when the email address is added or updated. Users must verify their email address. To avoid this behavior, set `email_verified` to `true` in the imported data. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().usersImports().create( + CreateImportUsersRequestContent + .builder() + .connectionId("connection_id") + .build() +); +``` +
+
+
+
+ + +
+
+
+ +## Jobs VerificationEmail +
client.jobs.verificationEmail.create(request) -> CreateVerificationEmailResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Send an email to the specified user that asks them to click a link to verify their email address. + +Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().verificationEmail().create( + CreateVerificationEmailRequestContent + .builder() + .userId("user_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — user_id of the user to send the verification email to. + +
+
+ +
+
+ +**clientId:** `Optional` — client_id of the client (application). If no value provided, the global Client ID will be used. + +
+
+ +
+
+ +**identity:** `Optional` + +
+
+ +
+
+ +**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + +
+
+
+
+ + +
+
+
+ +## Jobs Errors +
client.jobs.errors.get(id) -> ErrorsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve error details of a failed job. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().errors().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the job. + +
+
+
+
+ + +
+
+
+ +## Keys CustomSigning +
client.keys.customSigning.get() -> GetCustomSigningKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get entire jwks representation of custom signing keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().customSigning().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.keys.customSigning.set(request) -> SetCustomSigningKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or replace entire jwks representation of custom signing keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().customSigning().set( + SetCustomSigningKeysRequestContent + .builder() + .keys( + Arrays.asList( + CustomSigningKeyJwk + .builder() + .kty(CustomSigningKeyTypeEnum.EC) + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**keys:** `List` — An array of custom public signing keys. + +
+
+
+
+ + +
+
+
+ +
client.keys.customSigning.delete() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete entire jwks representation of custom signing keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().customSigning().delete(); +``` +
+
+
+
+ + +
+
+
+ +## Keys Encryption +
client.keys.encryption.list() -> SyncPagingIterable<EncryptionKey> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all the encryption keys associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().list( + ListEncryptionKeysRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Default value is 50, maximum value is 100. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.create(request) -> CreateEncryptionKeyResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create the new, pre-activated encryption key, without the key material. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().create( + CreateEncryptionKeyRequestContent + .builder() + .type(CreateEncryptionKeyType.CUSTOMER_PROVIDED_ROOT_KEY) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**type:** `CreateEncryptionKeyType` + +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.rekey() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Perform rekeying operation on the key hierarchy. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().rekey(); +``` +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.get(kid) -> GetEncryptionKeyResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the encryption key with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().get("kid"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Encryption key ID + +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.import_(kid, request) -> ImportEncryptionKeyResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Import wrapped key material and activate encryption key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().import_( + "kid", + ImportEncryptionKeyRequestContent + .builder() + .wrappedKey("wrapped_key") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Encryption key ID + +
+
+ +
+
+ +**wrappedKey:** `String` — Base64 encoded ciphertext of key material wrapped by public wrapping key. + +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.delete(kid) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete the custom provided encryption key with the given ID and move back to using native encryption key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().delete("kid"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Encryption key ID + +
+
+
+
+ + +
+
+
+ +
client.keys.encryption.createPublicWrappingKey(kid) -> CreateEncryptionKeyPublicWrappingResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create the public wrapping key to wrap your own encryption key material. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().encryption().createPublicWrappingKey("kid"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Encryption key ID + +
+
+
+
+ + +
+
+
+ +## Keys Signing +
client.keys.signing.list() -> List<SigningKeys> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all the application signing keys associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().signing().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.keys.signing.rotate() -> RotateSigningKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Rotate the application signing key of your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().signing().rotate(); +``` +
+
+
+
+ + +
+
+
+ +
client.keys.signing.get(kid) -> GetSigningKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the application signing key with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().signing().get("kid"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Key id of the key to retrieve + +
+
+
+
+ + +
+
+
+ +
client.keys.signing.revoke(kid) -> RevokedSigningKeysResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Revoke the application signing key with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.keys().signing().revoke("kid"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Key id of the key to revoke + +
+
+
+
+ + +
+
+
+ +## Organizations ClientGrants +
client.organizations.clientGrants.list(id) -> SyncPagingIterable<OrganizationClientGrant> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().clientGrants().list( + "id", + ListOrganizationClientGrantsRequestParameters + .builder() + .audience("audience") + .clientId("client_id") + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**audience:** `Optional` — Optional filter on audience of the client grant. + +
+
+ +
+
+ +**clientId:** `Optional` — Optional filter on client_id of the client grant. + +
+
+ +
+
+ +**grantIds:** `Optional` — Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../client-grants?grant_ids=id1&grant_ids=id2 + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.organizations.clientGrants.create(id, request) -> AssociateOrganizationClientGrantResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().clientGrants().create( + "id", + AssociateOrganizationClientGrantRequestContent + .builder() + .grantId("grant_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**grantId:** `String` — A Client Grant ID to add to the organization. + +
+
+
+
+ + +
+
+
+ +
client.organizations.clientGrants.delete(id, grantId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().clientGrants().delete("id", "grant_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**grantId:** `String` — The Client Grant ID to remove from the organization + +
+
+
+
+ + +
+
+
+ +## Organizations EnabledConnections +
client.organizations.enabledConnections.list(id) -> SyncPagingIterable<OrganizationConnection> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().enabledConnections().list( + "id", + ListOrganizationConnectionsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.organizations.enabledConnections.add(id, request) -> AddOrganizationConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + +Connections represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().enabledConnections().add( + "id", + AddOrganizationConnectionRequestContent + .builder() + .connectionId("connection_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Single connection ID to add to the organization. + +
+
+ +
+
+ +**assignMembershipOnLogin:** `Optional` — When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + +
+
+ +
+
+ +**isSignupEnabled:** `Optional` — Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + +
+
+ +
+
+ +**showAsButton:** `Optional` — Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + +
+
+
+
+ + +
+
+
+ +
client.organizations.enabledConnections.get(id, connectionId) -> GetOrganizationConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().enabledConnections().get("id", "connectionId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.enabledConnections.delete(id, connectionId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + +Note: This action does not remove the connection from your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().enabledConnections().delete("id", "connectionId"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.enabledConnections.update(id, connectionId, request) -> UpdateOrganizationConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the details of a specific connection currently enabled for an Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().enabledConnections().update( + "id", + "connectionId", + UpdateOrganizationConnectionRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+ +
+
+ +**assignMembershipOnLogin:** `Optional` — When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + +
+
+ +
+
+ +**isSignupEnabled:** `Optional` — Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + +
+
+ +
+
+ +**showAsButton:** `Optional` — Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + +
+
+
+
+ + +
+
+
+ +## Organizations Invitations +
client.organizations.invitations.list(id) -> SyncPagingIterable<OrganizationInvitation> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review Invite Organization Members. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().invitations().list( + "id", + ListOrganizationInvitationsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .fields("fields") + .includeFields(true) + .sort("sort") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — When true, return results inside an object that also contains the start and limit. When false (default), a direct array of results is returned. We do not yet support returning the total invitations count. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). Defaults to true. + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1. + +
+
+
+
+ + +
+
+
+ +
client.organizations.invitations.create(id, request) -> CreateOrganizationInvitationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review Invite Organization Members. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().invitations().create( + "id", + CreateOrganizationInvitationRequestContent + .builder() + .inviter( + OrganizationInvitationInviter + .builder() + .name("name") + .build() + ) + .invitee( + OrganizationInvitationInvitee + .builder() + .email("email") + .build() + ) + .clientId("client_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**inviter:** `OrganizationInvitationInviter` + +
+
+ +
+
+ +**invitee:** `OrganizationInvitationInvitee` + +
+
+ +
+
+ +**clientId:** `String` — Auth0 client ID. Used to resolve the application's login initiation endpoint. + +
+
+ +
+
+ +**connectionId:** `Optional` — The id of the connection to force invitee to authenticate with. + +
+
+ +
+
+ +**appMetadata:** `Optional>` + +
+
+ +
+
+ +**userMetadata:** `Optional>` + +
+
+ +
+
+ +**ttlSec:** `Optional` — Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days). + +
+
+ +
+
+ +**roles:** `Optional>` — List of roles IDs to associated with the user. + +
+
+ +
+
+ +**sendInvitationEmail:** `Optional` — Whether the user will receive an invitation email (true) or no email (false), true by default + +
+
+
+
+ + +
+
+
+ +
client.organizations.invitations.get(id, invitationId) -> GetOrganizationInvitationResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().invitations().get( + "id", + "invitation_id", + GetOrganizationInvitationRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**invitationId:** `String` — The id of the user invitation. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). Defaults to true. + +
+
+
+
+ + +
+
+
+ +
client.organizations.invitations.delete(id, invitationId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().invitations().delete("id", "invitation_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**invitationId:** `String` — The id of the user invitation. + +
+
+
+
+ + +
+
+
+ +## Organizations Members +
client.organizations.members.list(id) -> SyncPagingIterable<OrganizationMember> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List organization members. +This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + +
    +
  • + Use the fields parameter to optionally define the specific member details retrieved. If fields is left blank, all fields (except roles) are returned. +
  • +
  • + Member roles are not sent by default. Use fields=roles to retrieve the roles assigned to each listed member. To use this parameter, you must include the read:organization_member_roles scope in the token. +
  • +
+ +This endpoint supports two types of pagination: + +- Offset pagination +- Checkpoint pagination + +Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the from parameter. If there are more results, a next value will be included in the response. You can use this for subsequent API calls. When next is no longer included in the response, this indicates there are no more pages remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().list( + "id", + ListOrganizationMembersRequestParameters + .builder() + .from("from") + .take(1) + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.organizations.members.create(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set one or more existing users as members of a specific Organization. + +To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can invite them to create an account, manually create them through the Auth0 Dashboard, or use the Management API. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().create( + "id", + CreateOrganizationMemberRequestContent + .builder() + .members( + Arrays.asList("members") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**members:** `List` — List of user IDs to add to the organization as members. + +
+
+
+
+ + +
+
+
+ +
client.organizations.members.delete(id, request) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().delete( + "id", + DeleteOrganizationMembersRequestContent + .builder() + .members( + Arrays.asList("members") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**members:** `List` — List of user IDs to remove from the organization. + +
+
+
+
+ + +
+
+
+ +## Organizations Members Roles +
client.organizations.members.roles.list(id, userId) -> SyncPagingIterable<Role> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + +Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().roles().list( + "id", + "user_id", + ListOrganizationMemberRolesRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**userId:** `String` — ID of the user to associate roles with. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.organizations.members.roles.assign(id, userId, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more roles to a user to determine their access for a specific Organization. + +Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().roles().assign( + "id", + "user_id", + AssignOrganizationMemberRolesRequestContent + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**userId:** `String` — ID of the user to associate roles with. + +
+
+ +
+
+ +**roles:** `List` — List of roles IDs to associated with the user. + +
+
+
+
+ + +
+
+
+ +
client.organizations.members.roles.delete(id, userId, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove one or more Organization-specific roles from a given user. + +Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().members().roles().delete( + "id", + "user_id", + DeleteOrganizationMemberRolesRequestContent + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**userId:** `String` — User ID of the organization member to remove roles from. + +
+
+ +
+
+ +**roles:** `List` — List of roles IDs associated with the organization member to remove. + +
+
+
+
+ + +
+
+
+ +## Prompts Rendering +
client.prompts.rendering.list() -> SyncPagingIterable<AculResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get render setting configurations for all screens. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().rendering().list( + ListAculsRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .page(1) + .perPage(1) + .includeTotals(true) + .prompt("prompt") + .screen("screen") + .renderingMode(AculRenderingModeEnum.ADVANCED) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (default: true) or excluded (false). + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Maximum value is 100, default value is 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total configuration count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**prompt:** `Optional` — Name of the prompt to filter by + +
+
+ +
+
+ +**screen:** `Optional` — Name of the screen to filter by + +
+
+ +
+
+ +**renderingMode:** `Optional` — Rendering mode to filter by + +
+
+
+
+ + +
+
+
+ +
client.prompts.rendering.get(prompt, screen) -> GetAculResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get render settings for a screen. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().rendering().get(PromptGroupNameEnum.LOGIN, ScreenGroupNameEnum.LOGIN); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PromptGroupNameEnum` — Name of the prompt + +
+
+ +
+
+ +**screen:** `ScreenGroupNameEnum` — Name of the screen + +
+
+
+
+ + +
+
+
+ +
client.prompts.rendering.update(prompt, screen, request) -> UpdateAculResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Learn more about configuring render settings for advanced customization. + +

+ Example head_tags array. See our documentation on using Liquid variables within head tags. +

+
{
+  "head_tags": [
+    {
+      "tag": "script",
+      "attributes": {
+        "defer": true,
+        "src": "URL_TO_ASSET",
+        "async": true,
+        "integrity": [
+          "ASSET_SHA"
+        ]
+      }
+    },
+    {
+      "tag": "link",
+      "attributes": {
+        "href": "URL_TO_ASSET",
+        "rel": "stylesheet"
+      }
+    }
+  ]
+}
+
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().rendering().update( + PromptGroupNameEnum.LOGIN, + ScreenGroupNameEnum.LOGIN, + UpdateAculRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PromptGroupNameEnum` — Name of the prompt + +
+
+ +
+
+ +**screen:** `ScreenGroupNameEnum` — Name of the screen + +
+
+ +
+
+ +**renderingMode:** `Optional` + +
+
+ +
+
+ +**contextConfiguration:** `Optional>` — Context values to make available + +
+
+ +
+
+ +**defaultHeadTagsDisabled:** `Optional` — Override Universal Login default head tags + +
+
+ +
+
+ +**headTags:** `Optional>` — An array of head tags + +
+
+ +
+
+ +**filters:** `Optional` + +
+
+ +
+
+ +**usePageTemplate:** `Optional` — Use page template with ACUL + +
+
+
+
+ + +
+
+
+ +## Prompts CustomText +
client.prompts.customText.get(prompt, language) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve custom text for a specific prompt and language. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().customText().get(PromptGroupNameEnum.LOGIN, PromptLanguageEnum.AM); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PromptGroupNameEnum` — Name of the prompt. + +
+
+ +
+
+ +**language:** `PromptLanguageEnum` — Language to update. + +
+
+
+
+ + +
+
+
+ +
client.prompts.customText.set(prompt, language, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set custom text for a specific prompt. Existing texts will be overwritten. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().customText().set( + PromptGroupNameEnum.LOGIN, + PromptLanguageEnum.AM, + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PromptGroupNameEnum` — Name of the prompt. + +
+
+ +
+
+ +**language:** `PromptLanguageEnum` — Language to update. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +## Prompts Partials +
client.prompts.partials.get(prompt) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get template partials for a prompt +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().partials().get(PartialGroupsEnum.LOGIN); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PartialGroupsEnum` — Name of the prompt. + +
+
+
+
+ + +
+
+
+ +
client.prompts.partials.set(prompt, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set template partials for a prompt +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().partials().set( + PartialGroupsEnum.LOGIN, + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PartialGroupsEnum` — Name of the prompt. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +## Roles Permissions +
client.roles.permissions.list(id) -> SyncPagingIterable<PermissionsResponsePayload> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().permissions().list( + "id", + ListRolePermissionsRequestParameters + .builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to list granted permissions. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.roles.permissions.add(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add one or more permissions to a specified user role. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().permissions().add( + "id", + AddRolePermissionsRequestContent + .builder() + .permissions( + Arrays.asList( + PermissionRequestPayload + .builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to add permissions to. + +
+
+ +
+
+ +**permissions:** `List` — array of resource_server_identifier, permission_name pairs. + +
+
+
+
+ + +
+
+
+ +
client.roles.permissions.delete(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove one or more permissions from a specified user role. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().permissions().delete( + "id", + DeleteRolePermissionsRequestContent + .builder() + .permissions( + Arrays.asList( + PermissionRequestPayload + .builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to remove permissions from. + +
+
+ +
+
+ +**permissions:** `List` — array of resource_server_identifier, permission_name pairs. + +
+
+
+
+ + +
+
+
+ +## Roles Users +
client.roles.users.list(id) -> SyncPagingIterable<RoleUser> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. + +This endpoint supports two types of pagination: +
    +
  • Offset pagination
  • +
  • Checkpoint pagination
  • +
+ +Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().users().list( + "id", + ListRoleUsersRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to retrieve a list of users associated with. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.roles.users.assign(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. + +Note: New roles cannot be created through this action. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().users().assign( + "id", + AssignRoleUsersRequestContent + .builder() + .users( + Arrays.asList("users") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to assign users to. + +
+
+ +
+
+ +**users:** `List` — user_id's of the users to assign the role to. + +
+
+
+
+ + +
+
+
+ +## SelfServiceProfiles CustomText +
client.selfServiceProfiles.customText.list(id, language, page) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().customText().list("id", "en", "get-started"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile. + +
+
+ +
+
+ +**language:** `String` — The language of the custom text. + +
+
+ +
+
+ +**page:** `String` — The page where the custom text is shown. + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.customText.set(id, language, page, request) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().customText().set( + "id", + "en", + "get-started", + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile. + +
+
+ +
+
+ +**language:** `String` — The language of the custom text. + +
+
+ +
+
+ +**page:** `String` — The page where the custom text is shown. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +## SelfServiceProfiles SsoTicket +
client.selfServiceProfiles.ssoTicket.create(id, request) -> CreateSelfServiceProfileSsoTicketResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().ssoTicket().create( + "id", + CreateSelfServiceProfileSsoTicketRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the self-service profile to retrieve + +
+
+ +
+
+ +**connectionId:** `Optional` — If provided, this will allow editing of the provided connection during the SSO Flow + +
+
+ +
+
+ +**connectionConfig:** `Optional` + +
+
+ +
+
+ +**enabledClients:** `Optional>` — List of client_ids that the connection will be enabled for. + +
+
+ +
+
+ +**enabledOrganizations:** `Optional>` — List of organizations that the connection will be enabled for. + +
+
+ +
+
+ +**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + +
+
+ +
+
+ +**domainAliasesConfig:** `Optional` + +
+
+ +
+
+ +**provisioningConfig:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.selfServiceProfiles.ssoTicket.revoke(profileId, id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required. +Clients should treat these `202` responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.selfServiceProfiles().ssoTicket().revoke("profileId", "id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**profileId:** `String` — The id of the self-service profile + +
+
+ +
+
+ +**id:** `String` — The id of the ticket to revoke + +
+
+
+
+ + +
+
+
+ +## Tenants Settings +
client.tenants.settings.get() -> GetTenantSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve tenant settings. A list of fields to include or exclude may also be specified. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().settings().get( + GetTenantSettingsRequestParameters + .builder() + .fields("fields") + .includeFields(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.tenants.settings.update(request) -> UpdateTenantSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update settings for a tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.tenants().settings().update( + UpdateTenantSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**changePassword:** `Optional` + +
+
+ +
+
+ +**deviceFlow:** `Optional` + +
+
+ +
+
+ +**guardianMfaPage:** `Optional` + +
+
+ +
+
+ +**defaultAudience:** `Optional` — Default audience for API Authorization. + +
+
+ +
+
+ +**defaultDirectory:** `Optional` — Name of connection used for password grants at the `/token` endpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. + +
+
+ +
+
+ +**errorPage:** `Optional` + +
+
+ +
+
+ +**defaultTokenQuota:** `Optional` + +
+
+ +
+
+ +**flags:** `Optional` + +
+
+ +
+
+ +**friendlyName:** `Optional` — Friendly name for this tenant. + +
+
+ +
+
+ +**pictureUrl:** `Optional` — URL of logo to be shown for this tenant (recommended size: 150x150) + +
+
+ +
+
+ +**supportEmail:** `Optional` — End-user support email. + +
+
+ +
+
+ +**supportUrl:** `Optional` — End-user support url. + +
+
+ +
+
+ +**allowedLogoutUrls:** `Optional>` — URLs that are valid to redirect to after logout from Auth0. + +
+
+ +
+
+ +**sessionLifetime:** `Optional` — Number of hours a session will stay valid. + +
+
+ +
+
+ +**idleSessionLifetime:** `Optional` — Number of hours for which a session can be inactive before the user must log in again. + +
+
+ +
+
+ +**ephemeralSessionLifetime:** `Optional` — Number of hours an ephemeral (non-persistent) session will stay valid. + +
+
+ +
+
+ +**idleEphemeralSessionLifetime:** `Optional` — Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again. + +
+
+ +
+
+ +**sandboxVersion:** `Optional` — Selected sandbox version for the extensibility environment + +
+
+ +
+
+ +**legacySandboxVersion:** `Optional` — Selected legacy sandbox version for the extensibility environment + +
+
+ +
+
+ +**defaultRedirectionUri:** `Optional` — The default absolute redirection uri, must be https + +
+
+ +
+
+ +**enabledLocales:** `Optional>` — Supported locales for the user interface + +
+
+ +
+
+ +**sessionCookie:** `Optional` + +
+
+ +
+
+ +**sessions:** `Optional` + +
+
+ +
+
+ +**oidcLogout:** `Optional` + +
+
+ +
+
+ +**customizeMfaInPostloginAction:** `Optional` — Whether to enable flexible factors for MFA in the PostLogin action + +
+
+ +
+
+ +**allowOrganizationNameInAuthenticationApi:** `Optional` — Whether to accept an organization name instead of an ID on auth endpoints + +
+
+ +
+
+ +**acrValuesSupported:** `Optional>` — Supported ACR values + +
+
+ +
+
+ +**mtls:** `Optional` + +
+
+ +
+
+ +**pushedAuthorizationRequestsSupported:** `Optional` — Enables the use of Pushed Authorization Requests + +
+
+ +
+
+ +**authorizationResponseIssParameterSupported:** `Optional` — Supports iss parameter in authorization responses + +
+
+
+
+ + +
+
+
+ +## Users AuthenticationMethods +
client.users.authenticationMethods.list(id) -> SyncPagingIterable<UserAuthenticationMethod> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of authentication methods associated with a specified user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().list( + "id", + ListUserAuthenticationMethodsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. Default is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Default is 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.create(id, request) -> CreateUserAuthenticationMethodResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().create( + "id", + CreateUserAuthenticationMethodRequestContent + .builder() + .type(CreatedUserAuthenticationMethodTypeEnum.PHONE) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user to whom the new authentication method will be assigned. + +
+
+ +
+
+ +**type:** `CreatedUserAuthenticationMethodTypeEnum` + +
+
+ +
+
+ +**name:** `Optional` — A human-readable label to identify the authentication method. + +
+
+ +
+
+ +**totpSecret:** `Optional` — Base32 encoded secret for TOTP generation. + +
+
+ +
+
+ +**phoneNumber:** `Optional` — Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + +
+
+ +
+
+ +**email:** `Optional` — Applies to email authentication methods only. The email address used to send verification messages. + +
+
+ +
+
+ +**preferredAuthenticationMethod:** `Optional` + +
+
+ +
+
+ +**keyId:** `Optional` — Applies to webauthn authentication methods only. The id of the credential. + +
+
+ +
+
+ +**publicKey:** `Optional` — Applies to webauthn authentication methods only. The public key. + +
+
+ +
+
+ +**relyingPartyIdentifier:** `Optional` — Applies to webauthn authentication methods only. The relying party identifier. + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.set(id, request) -> List<SetUserAuthenticationMethodResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replace the specified user authentication methods with supplied values. + + Note: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user’s existing settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().set( + "id", + Arrays.asList( + SetUserAuthenticationMethods + .builder() + .type(AuthenticationTypeEnum.PHONE) + .build() + ) +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+ +
+
+ +**request:** `List` + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.deleteAll(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().deleteAll("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.get(id, authenticationMethodId) -> GetUserAuthenticationMethodResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().get("id", "authentication_method_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+ +
+
+ +**authenticationMethodId:** `String` — The ID of the authentication methods in question. + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.delete(id, authenticationMethodId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().delete("id", "authentication_method_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+ +
+
+ +**authenticationMethodId:** `String` — The ID of the authentication method to delete. + +
+
+
+
+ + +
+
+
+ +
client.users.authenticationMethods.update(id, authenticationMethodId, request) -> UpdateUserAuthenticationMethodResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticationMethods().update( + "id", + "authentication_method_id", + UpdateUserAuthenticationMethodRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the user in question. + +
+
+ +
+
+ +**authenticationMethodId:** `String` — The ID of the authentication method to update. + +
+
+ +
+
+ +**name:** `Optional` — A human-readable label to identify the authentication method. + +
+
+ +
+
+ +**preferredAuthenticationMethod:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Users Authenticators +
client.users.authenticators.deleteAll(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().authenticators().deleteAll("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to delete. + +
+
+
+
+ + +
+
+
+ +## Users Enrollments +
client.users.enrollments.get(id) -> List<UsersEnrollment> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().enrollments().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to list enrollments for. + +
+
+
+
+ + +
+
+
+ +## Users FederatedConnectionsTokensets +
client.users.federatedConnectionsTokensets.list(id) -> List<FederatedConnectionTokenSet> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List active federated connections tokensets for a provided user +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().federatedConnectionsTokensets().list("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — User identifier + +
+
+
+
+ + +
+
+
+ +
client.users.federatedConnectionsTokensets.delete(id, tokensetId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().federatedConnectionsTokensets().delete("id", "tokenset_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Id of the user that owns the tokenset + +
+
+ +
+
+ +**tokensetId:** `String` — The tokenset id + +
+
+
+
+ + +
+
+
+ +## Users Identities +
client.users.identities.link(id, request) -> List<UserIdentity> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + +Note: There are two ways of invoking the endpoint: + +
    +
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: +
    +      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    +      Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    +      {
    +        "link_with": "SECONDARY_ACCOUNT_JWT"
    +      }
    +    
    + In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. +
  • +
  • With a token generated by the API V2 containing the update:users scope: +
    +    POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    +    Authorization: "Bearer YOUR_API_V2_TOKEN"
    +    {
    +      "provider": "SECONDARY_ACCOUNT_PROVIDER",
    +      "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    +      "user_id": "SECONDARY_ACCOUNT_USER_ID"
    +    }
    +    
    + In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. +
  • +
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().identities().link( + "id", + LinkUserIdentityRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the primary user account to link a second user account to. + +
+
+ +
+
+ +**provider:** `Optional` + +
+
+ +
+
+ +**connectionId:** `Optional` — connection_id of the secondary user account being linked when more than one `auth0` database provider exists. + +
+
+ +
+
+ +**userId:** `Optional` + +
+
+ +
+
+ +**linkWith:** `Optional` — JWT for the secondary account being linked. If sending this parameter, `provider`, `user_id`, and `connection_id` must not be sent. + +
+
+
+
+ + +
+
+
+ +
client.users.identities.delete(id, provider, userId) -> List<DeleteUserIdentityResponseContentItem> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + +Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().identities().delete("id", UserIdentityProviderEnum.AD, "user_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the primary user account. + +
+
+ +
+
+ +**provider:** `UserIdentityProviderEnum` — Identity provider name of the secondary linked account (e.g. `google-oauth2`). + +
+
+ +
+
+ +**userId:** `String` — ID of the secondary linked account (e.g. `123456789081523216417` part after the `|` in `google-oauth2|123456789081523216417`). + +
+
+
+
+ + +
+
+
+ +## Users Logs +
client.users.logs.list(id) -> SyncPagingIterable<Log> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve log events for a specific user. + +Note: For more information on all possible event types, their respective acronyms and descriptions, see Log Event Type Codes. + +For more information on the list of fields that can be used in `sort`, see Searchable Fields. + +Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().logs().list( + "id", + ListUserLogsRequestParameters + .builder() + .page(1) + .perPage(1) + .sort("sort") + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user of the logs to retrieve + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Paging is disabled if parameter not sent. + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use `fieldname:1` for ascending order and `fieldname:-1` for descending. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +## Users Multifactor +
client.users.multifactor.invalidateRememberBrowser(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Invalidate all remembered browsers across all authentication factors for a user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().multifactor().invalidateRememberBrowser("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to invalidate all remembered browsers and authentication factors for. + +
+
+
+
+ + +
+
+
+ +
client.users.multifactor.deleteProvider(id, provider) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().multifactor().deleteProvider("id", UserMultifactorProviderEnum.DUO); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to remove a multifactor configuration from. + +
+
+ +
+
+ +**provider:** `UserMultifactorProviderEnum` — The multi-factor provider. Supported values 'duo' or 'google-authenticator' + +
+
+
+
+ + +
+
+
+ +## Users Organizations +
client.users.organizations.list(id) -> SyncPagingIterable<Organization> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().organizations().list( + "id", + ListUserOrganizationsRequestParameters + .builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to retrieve the organizations for. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +## Users Permissions +
client.users.permissions.list(id) -> SyncPagingIterable<UserPermissionSchema> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all permissions associated with the user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().permissions().list( + "id", + ListUserPermissionsRequestParameters + .builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to retrieve the permissions for. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.users.permissions.create(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign permissions to a user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().permissions().create( + "id", + CreateUserPermissionsRequestContent + .builder() + .permissions( + Arrays.asList( + PermissionRequestPayload + .builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to assign permissions to. + +
+
+ +
+
+ +**permissions:** `List` — List of permissions to add to this user. + +
+
+
+
+ + +
+
+
+ +
client.users.permissions.delete(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove permissions from a user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().permissions().delete( + "id", + DeleteUserPermissionsRequestContent + .builder() + .permissions( + Arrays.asList( + PermissionRequestPayload + .builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to remove permissions from. + +
+
+ +
+
+ +**permissions:** `List` — List of permissions to remove from this user. + +
+
+
+
+ + +
+
+
+ +## Users Roles +
client.users.roles.list(id) -> SyncPagingIterable<Role> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of all user roles currently assigned to a user. + +Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().roles().list( + "id", + ListUserRolesRequestParameters + .builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to list roles for. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.users.roles.assign(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. + +Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().roles().assign( + "id", + AssignUserRolesRequestContent + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to associate roles with. + +
+
+ +
+
+ +**roles:** `List` — List of roles IDs to associated with the user. + +
+
+
+
+ + +
+
+
+ +
client.users.roles.delete(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove one or more specified user roles assigned to a user. + +Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().roles().delete( + "id", + DeleteUserRolesRequestContent + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to remove roles from. + +
+
+ +
+
+ +**roles:** `List` — List of roles IDs to remove from the user. + +
+
+
+
+ + +
+
+
+ +## Users RefreshToken +
client.users.refreshToken.list(userId) -> SyncPagingIterable<RefreshTokenResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details for a user's refresh tokens. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().refreshToken().list( + "user_id", + ListRefreshTokensRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — ID of the user to get refresh tokens for + +
+
+ +
+
+ +**from:** `Optional` — An optional cursor from which to start the selection (exclusive). + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.users.refreshToken.delete(userId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete all refresh tokens for a user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().refreshToken().delete("user_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — ID of the user to get remove refresh tokens for + +
+
+
+
+ + +
+
+
+ +## Users Sessions +
client.users.sessions.list(userId) -> SyncPagingIterable<SessionResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details for a user's sessions. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().sessions().list( + "user_id", + ListUserSessionsRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — ID of the user to get sessions for + +
+
+ +
+
+ +**from:** `Optional` — An optional cursor from which to start the selection (exclusive). + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.users.sessions.delete(userId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete all sessions for a user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().sessions().delete("user_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `String` — ID of the user to get sessions for + +
+
+
+
+ + +
+
+
+ +## VerifiableCredentials Verification Templates +
client.verifiableCredentials.verification.templates.list() -> SyncPagingIterable<VerifiableCredentialTemplateResponse> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List a verifiable credential templates. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.verifiableCredentials().verification().templates().list( + ListVerifiableCredentialTemplatesRequestParameters + .builder() + .from("from") + .take(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.verifiableCredentials.verification.templates.create(request) -> CreateVerifiableCredentialTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a verifiable credential template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.verifiableCredentials().verification().templates().create( + CreateVerifiableCredentialTemplateRequestContent + .builder() + .name("name") + .type("type") + .dialect("dialect") + .presentation( + MdlPresentationRequest + .builder() + .orgIso1801351MDl( + MdlPresentationRequestProperties + .builder() + .orgIso1801351( + MdlPresentationProperties + .builder() + .build() + ) + .build() + ) + .build() + ) + .wellKnownTrustedIssuers("well_known_trusted_issuers") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**type:** `String` + +
+
+ +
+
+ +**dialect:** `String` + +
+
+ +
+
+ +**presentation:** `MdlPresentationRequest` + +
+
+ +
+
+ +**customCertificateAuthority:** `Optional` + +
+
+ +
+
+ +**wellKnownTrustedIssuers:** `String` + +
+
+
+
+ + +
+
+
+ +
client.verifiableCredentials.verification.templates.get(id) -> GetVerifiableCredentialTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a verifiable credential template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.verifiableCredentials().verification().templates().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the template to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.verifiableCredentials.verification.templates.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a verifiable credential template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.verifiableCredentials().verification().templates().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the template to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.verifiableCredentials.verification.templates.update(id, request) -> UpdateVerifiableCredentialTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a verifiable credential template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.verifiableCredentials().verification().templates().update( + "id", + UpdateVerifiableCredentialTemplateRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the template to retrieve. + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**type:** `Optional` + +
+
+ +
+
+ +**dialect:** `Optional` + +
+
+ +
+
+ +**presentation:** `Optional` + +
+
+ +
+
+ +**wellKnownTrustedIssuers:** `Optional` + +
+
+ +
+
+ +**version:** `Optional` + +
+
+
+
+ + +
+
+
diff --git a/sample-app/build.gradle b/sample-app/build.gradle new file mode 100644 index 000000000..4ee8f227b --- /dev/null +++ b/sample-app/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java-library' +} + +repositories { + mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/releases/' + } +} + +dependencies { + implementation rootProject +} + + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + diff --git a/sample-app/src/main/java/sample/App.java b/sample-app/src/main/java/sample/App.java new file mode 100644 index 000000000..a2948490d --- /dev/null +++ b/sample-app/src/main/java/sample/App.java @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +package sample; + +public final class App { + +} + diff --git a/settings.gradle b/settings.gradle index a32c80c43..ef07c3f10 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,4 +4,6 @@ pluginManagement { } } +include 'sample-app' + rootProject.name = 'auth0' diff --git a/src/main/java/com/auth0/client/HttpOptions.java b/src/main/java/com/auth0/client/HttpOptions.java index 186f5ee14..cf2cb481f 100644 --- a/src/main/java/com/auth0/client/HttpOptions.java +++ b/src/main/java/com/auth0/client/HttpOptions.java @@ -33,7 +33,6 @@ public void setProxyOptions(ProxyOptions proxyOptions) { this.proxyOptions = proxyOptions; } - /** * @return the connect timeout, in seconds */ diff --git a/src/main/java/com/auth0/client/LoggingOptions.java b/src/main/java/com/auth0/client/LoggingOptions.java index 5396ea520..c0ef54b71 100644 --- a/src/main/java/com/auth0/client/LoggingOptions.java +++ b/src/main/java/com/auth0/client/LoggingOptions.java @@ -1,7 +1,6 @@ package com.auth0.client; import com.auth0.utils.Asserts; - import java.util.Collections; import java.util.Set; @@ -73,5 +72,4 @@ public Set getHeadersToRedact() { public void setHeadersToRedact(Set headersToRedact) { this.headersToRedact = headersToRedact; } - } diff --git a/src/main/java/com/auth0/client/ProxyOptions.java b/src/main/java/com/auth0/client/ProxyOptions.java index 53247518a..7a78f7aaa 100644 --- a/src/main/java/com/auth0/client/ProxyOptions.java +++ b/src/main/java/com/auth0/client/ProxyOptions.java @@ -1,9 +1,8 @@ package com.auth0.client; import com.auth0.utils.Asserts; -import okhttp3.Credentials; - import java.net.Proxy; +import okhttp3.Credentials; /** * Used to configure Java Proxy-related configurations. diff --git a/src/main/java/com/auth0/client/auth/AuthAPI.java b/src/main/java/com/auth0/client/auth/AuthAPI.java index 6486727ee..7dcc74016 100644 --- a/src/main/java/com/auth0/client/auth/AuthAPI.java +++ b/src/main/java/com/auth0/client/auth/AuthAPI.java @@ -1,7 +1,7 @@ package com.auth0.client.auth; -import com.auth0.client.mgmt.ManagementAPI; -import com.auth0.json.ObjectMapperProvider; +import static com.auth0.json.ObjectMapperProvider.getMapper; + import com.auth0.json.auth.*; import com.auth0.net.*; import com.auth0.net.client.Auth0HttpClient; @@ -10,16 +10,13 @@ import com.auth0.utils.Asserts; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import org.jetbrains.annotations.TestOnly; - import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; - -import static com.auth0.json.ObjectMapperProvider.getMapper; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import org.jetbrains.annotations.TestOnly; /** * Class that provides an implementation of of the Authentication and Authorization API methods defined by the @@ -131,7 +128,8 @@ public static AuthAPI.Builder newBuilder(String domain, String clientId, String * @param clientAssertionSigner the {@code ClientAssertionSigner} used to create the signed client assertion. * @return a Builder for further configuration. */ - public static AuthAPI.Builder newBuilder(String domain, String clientId, ClientAssertionSigner clientAssertionSigner) { + public static AuthAPI.Builder newBuilder( + String domain, String clientId, ClientAssertionSigner clientAssertionSigner) { return new AuthAPI.Builder(domain, clientId).withClientAssertionSigner(clientAssertionSigner); } @@ -146,7 +144,12 @@ public static AuthAPI.Builder newBuilder(String domain, String clientId) { return new AuthAPI.Builder(domain, clientId); } - private AuthAPI(String domain, String clientId, String clientSecret, ClientAssertionSigner clientAssertionSigner, Auth0HttpClient httpClient) { + private AuthAPI( + String domain, + String clientId, + String clientSecret, + ClientAssertionSigner clientAssertionSigner, + Auth0HttpClient httpClient) { Asserts.assertNotNull(domain, "domain"); Asserts.assertNotNull(clientId, "client id"); Asserts.assertNotNull(httpClient, "Http client"); @@ -161,7 +164,6 @@ private AuthAPI(String domain, String clientId, String clientSecret, ClientAsser this.client = httpClient; } - /** * Given a set of options, it creates a new instance of the {@link OkHttpClient} * configuring them according to their availability. @@ -173,14 +175,14 @@ private AuthAPI(String domain, String clientId, String clientSecret, ClientAsser private static Auth0HttpClient buildNetworkingClient(com.auth0.client.HttpOptions options) { Asserts.assertNotNull(options, "Http options"); return DefaultHttpClient.newBuilder() - .withLogging(options.getLoggingOptions()) - .withMaxRetries(options.getManagementAPIMaxRetries()) - .withMaxRequests(options.getMaxRequests()) - .withMaxRequestsPerHost(options.getMaxRequestsPerHost()) - .withProxy(options.getProxyOptions()) - .withConnectTimeout(options.getConnectTimeout()) - .withReadTimeout(options.getReadTimeout()) - .build(); + .withLogging(options.getLoggingOptions()) + .withMaxRetries(options.getManagementAPIMaxRetries()) + .withMaxRequests(options.getMaxRequests()) + .withMaxRequestsPerHost(options.getMaxRequestsPerHost()) + .withProxy(options.getProxyOptions()) + .withConnectTimeout(options.getConnectTimeout()) + .withReadTimeout(options.getReadTimeout()) + .build(); } @TestOnly @@ -225,40 +227,42 @@ public AuthorizeUrlBuilder authorizeUrl(String redirectUri) { return AuthorizeUrlBuilder.newInstance(baseUrl, clientId, redirectUri); } - public Request authorizeBackChannel(String scope, String bindingMessage, Map loginHint) { + public Request authorizeBackChannel( + String scope, String bindingMessage, Map loginHint) { return authorizeBackChannel(scope, bindingMessage, loginHint, null, null); } - public Request authorizeBackChannel(String scope, String bindingMessage, Map loginHint, String audience, Integer requestExpiry) { + public Request authorizeBackChannel( + String scope, + String bindingMessage, + Map loginHint, + String audience, + Integer requestExpiry) { Asserts.assertNotNull(scope, "scope"); Asserts.assertNotNull(bindingMessage, "binding message"); Asserts.assertNotNull(loginHint, "login hint"); - String url = baseUrl - .newBuilder() - .addPathSegment("bc-authorize") - .build() - .toString(); + String url = baseUrl.newBuilder().addPathSegment("bc-authorize").build().toString(); - FormBodyRequest request = new FormBodyRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); + FormBodyRequest request = new FormBodyRequest<>( + client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_CLIENT_ID, clientId); addClientAuthentication(request, false); request.addParameter("scope", scope); request.addParameter("binding_message", bindingMessage); - if(Objects.nonNull(audience)){ + if (Objects.nonNull(audience)) { request.addParameter(KEY_AUDIENCE, audience); } - if(Objects.nonNull(requestExpiry)){ + if (Objects.nonNull(requestExpiry)) { request.addParameter("requested_expiry", requestExpiry); } try { String loginHintJson = getMapper().writeValueAsString(loginHint); request.addParameter("login_hint", loginHintJson); - } - catch (JsonProcessingException e) { + } catch (JsonProcessingException e) { throw new IllegalArgumentException("'loginHint' must be a map that can be serialized to JSON", e); } return request; @@ -270,7 +274,8 @@ public Request getBackChannelLoginStatus(String authRe String url = getTokenUrl(); - FormBodyRequest request = new FormBodyRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); + FormBodyRequest request = new FormBodyRequest<>( + client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_CLIENT_ID, clientId); addClientAuthentication(request, false); @@ -289,13 +294,12 @@ public Request getBackChannelLoginStatus(String authRe */ public String authorizeUrlWithPAR(String requestUri) { Asserts.assertNotNull(requestUri, "request uri"); - return baseUrl - .newBuilder() - .addPathSegment("authorize") - .addQueryParameter("client_id", clientId) - .addQueryParameter("request_uri", requestUri) - .build() - .toString(); + return baseUrl.newBuilder() + .addPathSegment("authorize") + .addQueryParameter("client_id", clientId) + .addQueryParameter("request_uri", requestUri) + .build() + .toString(); } /** @@ -308,13 +312,12 @@ public String authorizeUrlWithPAR(String requestUri) { */ public String authorizeUrlWithJAR(String request) { Asserts.assertNotNull(request, "request"); - return baseUrl - .newBuilder() - .addPathSegment("authorize") - .addQueryParameter("client_id", clientId) - .addQueryParameter("request", request) - .build() - .toString(); + return baseUrl.newBuilder() + .addPathSegment("authorize") + .addQueryParameter("client_id", clientId) + .addQueryParameter("request", request) + .build() + .toString(); } /** @@ -326,7 +329,8 @@ public String authorizeUrlWithJAR(String request) { * @see RFC 9126 * @return a request to execute. */ - public Request pushedAuthorizationRequest(String redirectUri, String responseType, Map params) { + public Request pushedAuthorizationRequest( + String redirectUri, String responseType, Map params) { return pushedAuthorizationRequest(redirectUri, responseType, params, null); } @@ -343,17 +347,18 @@ public Request pushedAuthorizationRequest(String re * @see Authorization Code Flow with Rich Authorization Requests (RAR) * @return a request to execute. */ - public Request pushedAuthorizationRequest(String redirectUri, String responseType, Map params, List> authorizationDetails) { + public Request pushedAuthorizationRequest( + String redirectUri, + String responseType, + Map params, + List> authorizationDetails) { Asserts.assertValidUrl(redirectUri, "redirect uri"); Asserts.assertNotNull(responseType, "response type"); - String url = baseUrl - .newBuilder() - .addPathSegments("oauth/par") - .build() - .toString(); + String url = baseUrl.newBuilder().addPathSegments("oauth/par").build().toString(); - FormBodyRequest request = new FormBodyRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); + FormBodyRequest request = new FormBodyRequest<>( + client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter("client_id", clientId); request.addParameter("redirect_uri", redirectUri); request.addParameter("response_type", responseType); @@ -369,7 +374,8 @@ public Request pushedAuthorizationRequest(String re request.addParameter("authorization_details", authDetailsJson); } } catch (JsonProcessingException e) { - throw new IllegalArgumentException("'authorizationDetails' must be a list that can be serialized to JSON", e); + throw new IllegalArgumentException( + "'authorizationDetails' must be a list that can be serialized to JSON", e); } return request; } @@ -391,7 +397,7 @@ public Request pushedAuthorizationRequestWithJAR(St * Builds a request to make a Pushed Authorization Request (PAR) with JWT-Secured Authorization Requests (JAR), to receive a {@code request_uri} to send to the {@code /authorize} endpoint. * @param request The signed JWT containing the authorization parameters as claims. * @param authorizationDetails A list of maps representing the value of the (optional) {@code authorization_details} parameter, used to perform Rich Authorization Requests. The list will be serialized to JSON and sent on the request. - * @see #pushedAuthorizationRequestWithJAR(String) + * @see #pushedAuthorizationRequestWithJAR(String) * @see Authorization Code Flow with PAR and JAR * @see Authorization Code Flow with Rich Authorization Requests (RAR) * @see RFC 9101 @@ -399,16 +405,14 @@ public Request pushedAuthorizationRequestWithJAR(St * @see RFC 9396 * @return a request to execute. */ - public Request pushedAuthorizationRequestWithJAR(String request, List> authorizationDetails) { + public Request pushedAuthorizationRequestWithJAR( + String request, List> authorizationDetails) { Asserts.assertNotNull(request, "request"); - String url = baseUrl - .newBuilder() - .addPathSegments("oauth/par") - .build() - .toString(); + String url = baseUrl.newBuilder().addPathSegments("oauth/par").build().toString(); - FormBodyRequest req = new FormBodyRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); + FormBodyRequest req = new FormBodyRequest<>( + client, null, url, HttpMethod.POST, new TypeReference() {}); req.addParameter("client_id", clientId); req.addParameter("request", request); if (Objects.nonNull(this.clientSecret)) { @@ -421,7 +425,8 @@ public Request pushedAuthorizationRequestWithJAR(St req.addParameter("authorization_details", authDetailsJson); } } catch (JsonProcessingException e) { - throw new IllegalArgumentException("'authorizationDetails' must be a list that can be serialized to JSON", e); + throw new IllegalArgumentException( + "'authorizationDetails' must be a list that can be serialized to JSON", e); } return req; } @@ -449,7 +454,6 @@ public LogoutUrlBuilder logoutUrl(String returnToUrl, boolean setClientId) { return LogoutUrlBuilder.newInstance(baseUrl, clientId, returnToUrl, setClientId); } - /** * Request the user information related to the access token. * i.e.: @@ -470,13 +474,9 @@ public LogoutUrlBuilder logoutUrl(String returnToUrl, boolean setClientId) { public Request userInfo(String accessToken) { Asserts.assertNotNull(accessToken, "access token"); - String url = baseUrl - .newBuilder() - .addPathSegment("userinfo") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.GET, new TypeReference() { - }); + String url = baseUrl.newBuilder().addPathSegment("userinfo").build().toString(); + BaseRequest request = + new BaseRequest<>(client, null, url, HttpMethod.GET, new TypeReference() {}); request.addHeader("Authorization", "Bearer " + accessToken); return request; } @@ -553,12 +553,11 @@ public Request resetPassword(String clientId, String email, String connect Asserts.assertNotNull(email, "email"); Asserts.assertNotNull(connection, "connection"); - String url = baseUrl - .newBuilder() - .addPathSegment(PATH_DBCONNECTIONS) - .addPathSegment("change_password") - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment(PATH_DBCONNECTIONS) + .addPathSegment("change_password") + .build() + .toString(); VoidRequest request = new VoidRequest(client, null, url, HttpMethod.POST); request.addParameter(KEY_CLIENT_ID, clientId); request.addParameter(KEY_EMAIL, email); @@ -724,8 +723,7 @@ public SignUpRequest signUp(String email, char[] password, String connection) { Asserts.assertNotNull(password, "password"); Asserts.assertNotNull(connection, "connection"); - String url = baseUrl - .newBuilder() + String url = baseUrl.newBuilder() .addPathSegment(PATH_DBCONNECTIONS) .addPathSegment("signup") .build() @@ -992,8 +990,7 @@ public TokenRequest requestToken(String audience, String org) { public Request revokeToken(String refreshToken) { Asserts.assertNotNull(refreshToken, "refresh token"); - String url = baseUrl - .newBuilder() + String url = baseUrl.newBuilder() .addPathSegment(PATH_OAUTH) .addPathSegment(PATH_REVOKE) .build() @@ -1005,7 +1002,6 @@ public Request revokeToken(String refreshToken) { return request; } - /** * Creates a request to renew the authentication and get fresh new credentials using a valid Refresh Token and the * {@code refresh_token} grant. @@ -1141,15 +1137,14 @@ public BaseRequest startPasswordlessEmailFlow(String Asserts.assertNotNull(email, "email"); Asserts.assertNotNull(type, "type"); - String url = baseUrl - .newBuilder() + String url = baseUrl.newBuilder() .addPathSegment(PATH_PASSWORDLESS) .addPathSegment(PATH_START) .build() .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() { - }); + BaseRequest request = new BaseRequest<>( + client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_CLIENT_ID, clientId); request.addParameter(KEY_CONNECTION, "email"); request.addParameter(KEY_EMAIL, email); @@ -1183,15 +1178,14 @@ public BaseRequest startPasswordlessEmailFlow(String public BaseRequest startPasswordlessSmsFlow(String phoneNumber) { Asserts.assertNotNull(phoneNumber, "phoneNumber"); - String url = baseUrl - .newBuilder() + String url = baseUrl.newBuilder() .addPathSegment(PATH_PASSWORDLESS) .addPathSegment(PATH_START) .build() .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() { - }); + BaseRequest request = + new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_CLIENT_ID, clientId); request.addParameter(KEY_CONNECTION, "sms"); request.addParameter("phone_number", phoneNumber); @@ -1331,18 +1325,18 @@ public TokenRequest exchangeMfaRecoveryCode(String mfaToken, char[] recoveryCode * @return a Request to execute. * @see Challenge Request API documentation */ - public Request mfaChallengeRequest(String mfaToken, String challengeType, String authenticatorId) { + public Request mfaChallengeRequest( + String mfaToken, String challengeType, String authenticatorId) { Asserts.assertNotNull(mfaToken, "mfa token"); - String url = baseUrl - .newBuilder() - .addPathSegment("mfa") - .addPathSegment("challenge") - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment("mfa") + .addPathSegment("challenge") + .build() + .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() { - }); + BaseRequest request = + new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_MFA_TOKEN, mfaToken); request.addParameter(KEY_CLIENT_ID, clientId); @@ -1378,15 +1372,14 @@ public Request mfaChallengeRequest(String mfaToken, String public Request addOtpAuthenticator(String mfaToken) { Asserts.assertNotNull(mfaToken, "mfa token"); - String url = baseUrl - .newBuilder() - .addPathSegment("mfa") - .addPathSegment("associate") - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment("mfa") + .addPathSegment("associate") + .build() + .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() { - }); + BaseRequest request = + new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter("authenticator_types", Collections.singletonList("otp")); request.addParameter(KEY_CLIENT_ID, clientId); @@ -1395,17 +1388,15 @@ public Request addOtpAuthenticator(String mfaToken) { return request; } - private BaseRequest createBaseOobRequest(String mfaToken, List oobChannels) { - String url = baseUrl - .newBuilder() - .addPathSegment("mfa") - .addPathSegment("associate") - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment("mfa") + .addPathSegment("associate") + .build() + .toString(); - BaseRequest request = new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() { - }); + BaseRequest request = + new BaseRequest<>(client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter("authenticator_types", Collections.singletonList("oob")); request.addParameter("oob_channels", oobChannels); @@ -1439,7 +1430,8 @@ private BaseRequest createBaseOobRequest(String mfaToken, Li * @deprecated Use {@linkplain #addOobAuthenticator(String, List, String, String)} instead. */ @Deprecated - public Request addOobAuthenticator(String mfaToken, List oobChannels, String phoneNumber) { + public Request addOobAuthenticator( + String mfaToken, List oobChannels, String phoneNumber) { Asserts.assertNotNull(mfaToken, "mfa token"); Asserts.assertNotNull(oobChannels, "OOB channels"); if (oobChannels.contains("sms") || oobChannels.contains("voice")) { @@ -1477,7 +1469,8 @@ public Request addOobAuthenticator(String mfaToken, ListEnroll with SMS or voice */ - public Request addOobAuthenticator(String mfaToken, List oobChannels, String phoneNumber, String emailAddress) { + public Request addOobAuthenticator( + String mfaToken, List oobChannels, String phoneNumber, String emailAddress) { Asserts.assertNotNull(mfaToken, "mfa token"); Asserts.assertNotNull(oobChannels, "OOB channels"); if (oobChannels.contains("sms") || oobChannels.contains("voice")) { @@ -1520,15 +1513,14 @@ public Request addOobAuthenticator(String mfaToken, List> listAuthenticators(String accessToken) { Asserts.assertNotNull(accessToken, "access token"); - String url = baseUrl - .newBuilder() - .addPathSegment("mfa") - .addPathSegment("authenticators") - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment("mfa") + .addPathSegment("authenticators") + .build() + .toString(); - BaseRequest> request = new BaseRequest<>(client, null, url, HttpMethod.GET, new TypeReference>() { - }); + BaseRequest> request = + new BaseRequest<>(client, null, url, HttpMethod.GET, new TypeReference>() {}); request.addHeader("Authorization", "Bearer " + accessToken); return request; @@ -1559,13 +1551,12 @@ public Request deleteAuthenticator(String accessToken, String authenticato Asserts.assertNotNull(accessToken, "access token"); Asserts.assertNotNull(authenticatorId, "authenticator id"); - String url = baseUrl - .newBuilder() - .addPathSegment("mfa") - .addPathSegment("authenticators") - .addPathSegment(authenticatorId) - .build() - .toString(); + String url = baseUrl.newBuilder() + .addPathSegment("mfa") + .addPathSegment("authenticators") + .addPathSegment(authenticatorId) + .build() + .toString(); VoidRequest request = new VoidRequest(client, null, url, HttpMethod.DELETE); request.addHeader("Authorization", "Bearer " + accessToken); @@ -1586,28 +1577,29 @@ private TokenRequest exchangeCode(String code, String redirectUri, boolean secre } private String getTokenUrl() { - return baseUrl - .newBuilder() - .addPathSegment(PATH_OAUTH) - .addPathSegment(PATH_TOKEN) - .build() - .toString(); + return baseUrl.newBuilder() + .addPathSegment(PATH_OAUTH) + .addPathSegment(PATH_TOKEN) + .build() + .toString(); } private void addClientAuthentication(BaseRequest request, boolean required) { if (required && (this.clientSecret == null && this.clientAssertionSigner == null)) { - throw new IllegalStateException("A client secret or client assertion signing key is required for this operation"); + throw new IllegalStateException( + "A client secret or client assertion signing key is required for this operation"); } if (Objects.nonNull(this.clientAssertionSigner)) { - request.addParameter(KEY_CLIENT_ASSERTION, this.clientAssertionSigner.createSignedClientAssertion(clientId, baseUrl.toString(), clientId)); + request.addParameter( + KEY_CLIENT_ASSERTION, + this.clientAssertionSigner.createSignedClientAssertion(clientId, baseUrl.toString(), clientId)); request.addParameter(KEY_CLIENT_ASSERTION_TYPE, "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"); } else if (Objects.nonNull(this.clientSecret)) { request.addParameter(KEY_CLIENT_SECRET, clientSecret); } } - /** * Builder for {@link AuthAPI} API client instances. */ @@ -1660,8 +1652,14 @@ public Builder withHttpClient(Auth0HttpClient httpClient) { * @return the configured {@code AuthAPI} instance. */ public AuthAPI build() { - return new AuthAPI(domain, clientId, clientSecret, clientAssertionSigner, - Objects.nonNull(httpClient) ? httpClient : DefaultHttpClient.newBuilder().build()); + return new AuthAPI( + domain, + clientId, + clientSecret, + clientAssertionSigner, + Objects.nonNull(httpClient) + ? httpClient + : DefaultHttpClient.newBuilder().build()); } } } diff --git a/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java b/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java index 1ce833a5f..23cd5f96b 100644 --- a/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java +++ b/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java @@ -1,11 +1,10 @@ package com.auth0.client.auth; -import okhttp3.HttpUrl; +import static com.auth0.utils.Asserts.assertNotNull; import java.util.HashMap; import java.util.Map; - -import static com.auth0.utils.Asserts.assertNotNull; +import okhttp3.HttpUrl; /** * Class that provides the methods to generate a valid Auth0 Authorize Url. It's based on the https://auth0.com/docs/api/authentication#social docs. diff --git a/src/main/java/com/auth0/client/auth/ClientAssertionSigner.java b/src/main/java/com/auth0/client/auth/ClientAssertionSigner.java index 679c061f4..798252f41 100644 --- a/src/main/java/com/auth0/client/auth/ClientAssertionSigner.java +++ b/src/main/java/com/auth0/client/auth/ClientAssertionSigner.java @@ -13,7 +13,7 @@ public interface ClientAssertionSigner { * @param issuer the Issuer. This MUST contain the client_id of the OAuth Client. * @param audience the audience that identifies the Authorization Server as an intended audience. * @param subject the Subject. This MUST contain the client_id of the OAuth Client. - + * * @return a signed JWT representing the client assertion. */ String createSignedClientAssertion(String issuer, String audience, String subject); diff --git a/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java b/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java index cd10eaffa..0c571536c 100644 --- a/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java +++ b/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java @@ -1,11 +1,10 @@ package com.auth0.client.auth; -import okhttp3.HttpUrl; +import static com.auth0.utils.Asserts.assertNotNull; import java.util.HashMap; import java.util.Map; - -import static com.auth0.utils.Asserts.assertNotNull; +import okhttp3.HttpUrl; /** * Class that provides the methods to generate a valid Auth0 Logout Url. It's based on the https://auth0.com/docs/api/authentication#logout docs. diff --git a/src/main/java/com/auth0/client/auth/RSAClientAssertionSigner.java b/src/main/java/com/auth0/client/auth/RSAClientAssertionSigner.java index 657c69f72..6ecd3691b 100644 --- a/src/main/java/com/auth0/client/auth/RSAClientAssertionSigner.java +++ b/src/main/java/com/auth0/client/auth/RSAClientAssertionSigner.java @@ -6,11 +6,10 @@ import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTCreationException; import com.auth0.utils.Asserts; -import org.jetbrains.annotations.TestOnly; - import java.security.interfaces.RSAPrivateKey; import java.time.Instant; import java.util.UUID; +import org.jetbrains.annotations.TestOnly; /** * An implementation of {@linkplain ClientAssertionSigner} for RSA-signed client assertions. @@ -20,14 +19,13 @@ public class RSAClientAssertionSigner implements ClientAssertionSigner { private final RSAPrivateKey assertionSigningKey; private final RSASigningAlgorithm assertionSigningAlgorithm; - /** * Creates a new instance. - * + * * @param assertionSigningKey the private key used to sign the assertion. Must not be null. * @param assertionSigningAlgorithm The RSA algorithm used to sign the assertion. Must not be null. - * - * @see #RSAClientAssertionSigner(RSAPrivateKey) + * + * @see #RSAClientAssertionSigner(RSAPrivateKey) */ public RSAClientAssertionSigner(RSAPrivateKey assertionSigningKey, RSASigningAlgorithm assertionSigningAlgorithm) { Asserts.assertNotNull(assertionSigningKey, "assertion signing key"); @@ -39,10 +37,10 @@ public RSAClientAssertionSigner(RSAPrivateKey assertionSigningKey, RSASigningAlg /** * Creates a new instance using the RSA256 signing algorithm. - * + * * @param assertionSigningKey the private key used to sign the assertion. Must not be null. - * - * @see #RSAClientAssertionSigner(RSAPrivateKey, RSASigningAlgorithm) + * + * @see #RSAClientAssertionSigner(RSAPrivateKey, RSASigningAlgorithm) */ public RSAClientAssertionSigner(RSAPrivateKey assertionSigningKey) { this(assertionSigningKey, RSASigningAlgorithm.RSA256); @@ -52,28 +50,33 @@ public RSAClientAssertionSigner(RSAPrivateKey assertionSigningKey) { public String createSignedClientAssertion(String issuer, String audience, String subject) { Instant now = Instant.now(); JWTCreator.Builder builder = JWT.create() - .withIssuer(issuer) - .withAudience(audience) - .withSubject(subject) - .withIssuedAt(now) - .withExpiresAt(now.plusSeconds(180)) - .withClaim("jti", UUID.randomUUID().toString()); + .withIssuer(issuer) + .withAudience(audience) + .withSubject(subject) + .withIssuedAt(now) + .withExpiresAt(now.plusSeconds(180)) + .withClaim("jti", UUID.randomUUID().toString()); switch (assertionSigningAlgorithm) { case RSA256: try { return builder.sign(Algorithm.RSA256(null, assertionSigningKey)); } catch (JWTCreationException exception) { - throw new ClientAssertionSigningException("Error creating the JWT used for client assertion using the RSA256 signing algorithm", exception); + throw new ClientAssertionSigningException( + "Error creating the JWT used for client assertion using the RSA256 signing algorithm", + exception); } case RSA384: try { return builder.sign(Algorithm.RSA384(null, assertionSigningKey)); } catch (JWTCreationException exception) { - throw new ClientAssertionSigningException("Error creating the JWT used for client assertion using the RSA384 signing algorithm", exception); + throw new ClientAssertionSigningException( + "Error creating the JWT used for client assertion using the RSA384 signing algorithm", + exception); } default: - throw new ClientAssertionSigningException("Error creating the JWT used for client assertion. Unknown algorithm."); + throw new ClientAssertionSigningException( + "Error creating the JWT used for client assertion. Unknown algorithm."); } } diff --git a/src/main/java/com/auth0/client/mgmt/ActionsClient.java b/src/main/java/com/auth0/client/mgmt/ActionsClient.java new file mode 100644 index 000000000..1e10c4af3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ActionsClient.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.actions.ExecutionsClient; +import com.auth0.client.mgmt.actions.TriggersClient; +import com.auth0.client.mgmt.actions.VersionsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Action; +import com.auth0.client.mgmt.types.CreateActionRequestContent; +import com.auth0.client.mgmt.types.CreateActionResponseContent; +import com.auth0.client.mgmt.types.DeleteActionRequestParameters; +import com.auth0.client.mgmt.types.DeployActionResponseContent; +import com.auth0.client.mgmt.types.GetActionResponseContent; +import com.auth0.client.mgmt.types.ListActionsRequestParameters; +import com.auth0.client.mgmt.types.TestActionRequestContent; +import com.auth0.client.mgmt.types.TestActionResponseContent; +import com.auth0.client.mgmt.types.UpdateActionRequestContent; +import com.auth0.client.mgmt.types.UpdateActionResponseContent; +import java.util.function.Supplier; + +public class ActionsClient { + protected final ClientOptions clientOptions; + + private final RawActionsClient rawClient; + + protected final Supplier versionsClient; + + protected final Supplier executionsClient; + + protected final Supplier triggersClient; + + public ActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawActionsClient(clientOptions); + this.versionsClient = Suppliers.memoize(() -> new VersionsClient(clientOptions)); + this.executionsClient = Suppliers.memoize(() -> new ExecutionsClient(clientOptions)); + this.triggersClient = Suppliers.memoize(() -> new TriggersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all actions. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve all actions. + */ + public SyncPagingIterable list(ListActionsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve all actions. + */ + public SyncPagingIterable list(ListActionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CreateActionResponseContent create(CreateActionRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CreateActionResponseContent create(CreateActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve an action by its ID. + */ + public GetActionResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve an action by its ID. + */ + public GetActionResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public void delete(String id, DeleteActionRequestParameters request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public void delete(String id, DeleteActionRequestParameters request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public UpdateActionResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public UpdateActionResponseContent update(String id, UpdateActionRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public UpdateActionResponseContent update( + String id, UpdateActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public DeployActionResponseContent deploy(String id) { + return this.rawClient.deploy(id).body(); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public DeployActionResponseContent deploy(String id, RequestOptions requestOptions) { + return this.rawClient.deploy(id, requestOptions).body(); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public TestActionResponseContent test(String id, TestActionRequestContent request) { + return this.rawClient.test(id, request).body(); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public TestActionResponseContent test(String id, TestActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).body(); + } + + public VersionsClient versions() { + return this.versionsClient.get(); + } + + public ExecutionsClient executions() { + return this.executionsClient.get(); + } + + public TriggersClient triggers() { + return this.triggersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ActionsEntity.java b/src/main/java/com/auth0/client/mgmt/ActionsEntity.java deleted file mode 100644 index 18499058c..000000000 --- a/src/main/java/com/auth0/client/mgmt/ActionsEntity.java +++ /dev/null @@ -1,416 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ActionsFilter; -import com.auth0.client.mgmt.filter.BaseFilter; -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.json.mgmt.actions.*; -import com.auth0.net.EmptyBodyRequest; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.net.client.HttpRequestBody; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Actions methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Actions - * - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class ActionsEntity extends BaseManagementEntity { - - private final static String ACTIONS_BASE_PATH = "api/v2/actions"; - private final static String ACTIONS_PATH = "actions"; - private final static String TRIGGERS_PATH = "triggers"; - private final static String DEPLOY_PATH = "deploy"; - private final static String VERSIONS_PATH = "versions"; - private final static String EXECUTIONS_PATH = "executions"; - private final static String BINDINGS_PATH = "bindings"; - - ActionsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Create an action. A token with {@code create:actions} scope is required. - * - * @param action the action to create - * @return a request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/post_action - */ - public Request create(Action action) { - Asserts.assertNotNull(action, "action"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH); - - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - - request.setBody(action); - return request; - } - - /** - * Get an action. A token with {@code read:actions} scope is required. - * - * @param actionId the ID of the action to retrieve - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_action - */ - public Request get(String actionId) { - Asserts.assertNotNull(actionId, "action ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete an action and all of its associated versions. An action must be unbound from all triggers before it can - * be deleted. A token with {@code delete:action} scope is required. - * - * @param actionId the ID of the action to delete. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/delete_action - */ - public Request delete(String actionId) { - return delete(actionId, false); - } - - /** - * Delete an action and all of its associated versions. A token with {@code delete:action} scope is required. - * - * @param actionId the ID of the action to delete. - * @param force whether to force the action deletion even if it is bound to triggers. - * @return a request to execute. - * - * https://auth0.com/docs/api/management/v2#!/Actions/get_triggers - */ - public Request delete(String actionId, boolean force) { - Asserts.assertNotNull(actionId, "action ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .addQueryParameter("force", String.valueOf(force)) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Get the set of triggers currently available. A trigger is an extensibility point to which actions can be bound. - * A token with {@code read:actions} scope is required. - * - * @return a request to execute. - */ - public Request getTriggers() { - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(TRIGGERS_PATH) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user - * flows until the action is deployed. Requires a token with {@code update:actions} scope. - * - * @param actionId the ID of the action to update. - * @param action the updated action. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/patch_action - */ - public Request update(String actionId, Action action) { - Asserts.assertNotNull(actionId, "action ID"); - Asserts.assertNotNull(action, "action"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - - request.setBody(action); - return request; - } - - /** - * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is - * currently bound to a trigger, then the system will begin executing the newly deployed version of the action - * immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. - * Requires a token with {@code create:actions}. - * - * @param actionId the ID of the action to deploy. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/post_deploy_action - */ - public Request deploy(String actionId) { - Asserts.assertNotNull(actionId, "action ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .addPathSegment(DEPLOY_PATH) - .build() - .toString(); - - return new EmptyBodyRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } - - /** - * Retrieve a specific version of an action. An action version is created whenever - * an action is deployed. An action version is immutable, once created. Requires a token with {@code read:actions} scope. - * - * @param actionId the ID of the action for which to retrieve the version. - * @param actionVersionId the ID of the specific version to retrieve. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_action_version - */ - public Request getVersion(String actionId, String actionVersionId) { - Asserts.assertNotNull(actionId, "action ID"); - Asserts.assertNotNull(actionVersionId, "action version ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .addPathSegment(VERSIONS_PATH) - .addPathSegment(actionVersionId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed - * action version that is identical to the specified version. If this action is currently bound to a trigger, the - * system will begin executing the newly-created version immediately. - * - * @param actionId the ID of the action - * @param actionVersionId the ID of the action version to roll-back to - * @return a request to be executed - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/post_deploy_draft_version - */ - public Request rollBackToVersion(String actionId, String actionVersionId) { - Asserts.assertNotNull(actionId, "action ID"); - Asserts.assertNotNull(actionVersionId, "action version ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .addPathSegment(VERSIONS_PATH) - .addPathSegment(actionVersionId) - .addPathSegment(DEPLOY_PATH) - .build() - .toString(); - - // Needed to successfully call the roll-back endpoint until DXEX-1738 is resolved. - - return new EmptyObjectRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } - - /** - * Retrieve information about a specific execution of an action. Relevant execution IDs will be included in tenant logs - * generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. - * Requires a token with {@code read:actions} scope. - * - * @param executionId The ID of the execution to retrieve. - * @return a request to be executed. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_execution - */ - public Request getExecution(String executionId) { - Asserts.assertNotNull(executionId, "execution ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(EXECUTIONS_PATH) - .addPathSegment(executionId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get all actions. Requires a token with {@code read:actions} scope. - * - * @param filter an optional filter to apply to the request. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_actions - */ - public Request list(ActionsFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Retrieve all of an action's versions. An action version is created whenever - * an action is deployed. An action version is immutable, once created. - * Requires a token with {@code read:actions} scope. - * - * @param actionId the ID of the action to retrieve versions for. - * @param filter an optional pagination filter. Note that all available pagination parameters may be available for - * this endpoint. See the referenced API documentation for supported parameters. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_action_versions - */ - public Request getVersions(String actionId, PageFilter filter) { - Asserts.assertNotNull(actionId, "action ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(ACTIONS_PATH) - .addPathSegment(actionId) - .addPathSegment(VERSIONS_PATH); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be - * attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned - * reflects the order in which they will be executed during the appropriate flow. - * Requires a token with {@code read:actions}. - * - * @param triggerId The trigger ID for which to get its action bindings. - * @param filter an optional pagination filter. Note that all available pagination parameters may be available for - * this endpoint. See the referenced API documentation for supported parameters. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/get_bindings - */ - public Request getTriggerBindings(String triggerId, PageFilter filter) { - Asserts.assertNotNull(triggerId, "trigger ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(TRIGGERS_PATH) - .addPathSegment(triggerId) - .addPathSegment(BINDINGS_PATH); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be - * attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are - * provided will determine the order in which they are executed. - * Requires a token with {@code update:actions} scope. - * - * @param triggerId the ID of the trigger for which to update its bindings. - * @param bindingsUpdateRequest the bindings update request body. - * @return a request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/Actions/patch_bindings - */ - public Request updateTriggerBindings(String triggerId, BindingsUpdateRequest bindingsUpdateRequest) { - Asserts.assertNotNull(triggerId, "trigger ID"); - Asserts.assertNotNull(bindingsUpdateRequest, "request body"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ACTIONS_BASE_PATH) - .addPathSegment(TRIGGERS_PATH) - .addPathSegment(triggerId) - .addPathSegment(BINDINGS_PATH) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - - request.setBody(bindingsUpdateRequest); - return request; - } - - private void applyFilter(BaseFilter filter, HttpUrl.Builder builder) { - if (filter != null) { - filter.getAsMap().forEach((k, v) -> builder.addQueryParameter(k, String.valueOf(v))); - } - } - - // Temporary request implementation to send an empty json object on the request body. - private static class EmptyObjectRequest extends EmptyBodyRequest { - EmptyObjectRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { - super(client, tokenProvider, url, method, tType); - } - - @Override - protected HttpRequestBody createRequestBody() { - return HttpRequestBody.create("application/json", "{}".getBytes()); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncActionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncActionsClient.java new file mode 100644 index 000000000..d0844495f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncActionsClient.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.actions.AsyncExecutionsClient; +import com.auth0.client.mgmt.actions.AsyncTriggersClient; +import com.auth0.client.mgmt.actions.AsyncVersionsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Action; +import com.auth0.client.mgmt.types.CreateActionRequestContent; +import com.auth0.client.mgmt.types.CreateActionResponseContent; +import com.auth0.client.mgmt.types.DeleteActionRequestParameters; +import com.auth0.client.mgmt.types.DeployActionResponseContent; +import com.auth0.client.mgmt.types.GetActionResponseContent; +import com.auth0.client.mgmt.types.ListActionsRequestParameters; +import com.auth0.client.mgmt.types.TestActionRequestContent; +import com.auth0.client.mgmt.types.TestActionResponseContent; +import com.auth0.client.mgmt.types.UpdateActionRequestContent; +import com.auth0.client.mgmt.types.UpdateActionResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawActionsClient rawClient; + + protected final Supplier versionsClient; + + protected final Supplier executionsClient; + + protected final Supplier triggersClient; + + public AsyncActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawActionsClient(clientOptions); + this.versionsClient = Suppliers.memoize(() -> new AsyncVersionsClient(clientOptions)); + this.executionsClient = Suppliers.memoize(() -> new AsyncExecutionsClient(clientOptions)); + this.triggersClient = Suppliers.memoize(() -> new AsyncTriggersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all actions. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve all actions. + */ + public CompletableFuture> list(ListActionsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve all actions. + */ + public CompletableFuture> list( + ListActionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CompletableFuture create(CreateActionRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CompletableFuture create( + CreateActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve an action by its ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve an action by its ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture delete(String id, DeleteActionRequestParameters request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture delete( + String id, DeleteActionRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture update(String id, UpdateActionRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture update( + String id, UpdateActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public CompletableFuture deploy(String id) { + return this.rawClient.deploy(id).thenApply(response -> response.body()); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public CompletableFuture deploy(String id, RequestOptions requestOptions) { + return this.rawClient.deploy(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public CompletableFuture test(String id, TestActionRequestContent request) { + return this.rawClient.test(id, request).thenApply(response -> response.body()); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public CompletableFuture test( + String id, TestActionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncVersionsClient versions() { + return this.versionsClient.get(); + } + + public AsyncExecutionsClient executions() { + return this.executionsClient.get(); + } + + public AsyncTriggersClient triggers() { + return this.triggersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncBrandingClient.java b/src/main/java/com/auth0/client/mgmt/AsyncBrandingClient.java new file mode 100644 index 000000000..410492bbc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncBrandingClient.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.branding.AsyncTemplatesClient; +import com.auth0.client.mgmt.branding.AsyncThemesClient; +import com.auth0.client.mgmt.branding.phone.AsyncPhoneClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.GetBrandingResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingRequestContent; +import com.auth0.client.mgmt.types.UpdateBrandingResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncBrandingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBrandingClient rawClient; + + protected final Supplier templatesClient; + + protected final Supplier themesClient; + + protected final Supplier phoneClient; + + public AsyncBrandingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBrandingClient(clientOptions); + this.templatesClient = Suppliers.memoize(() -> new AsyncTemplatesClient(clientOptions)); + this.themesClient = Suppliers.memoize(() -> new AsyncThemesClient(clientOptions)); + this.phoneClient = Suppliers.memoize(() -> new AsyncPhoneClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBrandingClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve branding settings. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve branding settings. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update branding settings. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update branding settings. + */ + public CompletableFuture update(UpdateBrandingRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update branding settings. + */ + public CompletableFuture update( + UpdateBrandingRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncTemplatesClient templates() { + return this.templatesClient.get(); + } + + public AsyncThemesClient themes() { + return this.themesClient.get(); + } + + public AsyncPhoneClient phone() { + return this.phoneClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java new file mode 100644 index 000000000..6595e1ca1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clientgrants.AsyncOrganizationsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; +import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.UpdateClientGrantRequestContent; +import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncClientGrantsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawClientGrantsClient rawClient; + + protected final Supplier organizationsClient; + + public AsyncClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawClientGrantsClient(clientOptions); + this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawClientGrantsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture> list( + ListClientGrantsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture> list( + ListClientGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture create(CreateClientGrantRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture create( + CreateClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a client grant. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a client grant. + */ + public CompletableFuture update( + String id, UpdateClientGrantRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a client grant. + */ + public CompletableFuture update( + String id, UpdateClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncOrganizationsClient organizations() { + return this.organizationsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncClientsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncClientsClient.java new file mode 100644 index 000000000..24bec4614 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncClientsClient.java @@ -0,0 +1,403 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clients.AsyncConnectionsClient; +import com.auth0.client.mgmt.clients.AsyncCredentialsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Client; +import com.auth0.client.mgmt.types.CreateClientRequestContent; +import com.auth0.client.mgmt.types.CreateClientResponseContent; +import com.auth0.client.mgmt.types.GetClientRequestParameters; +import com.auth0.client.mgmt.types.GetClientResponseContent; +import com.auth0.client.mgmt.types.ListClientsRequestParameters; +import com.auth0.client.mgmt.types.RotateClientSecretResponseContent; +import com.auth0.client.mgmt.types.UpdateClientRequestContent; +import com.auth0.client.mgmt.types.UpdateClientResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncClientsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawClientsClient rawClient; + + protected final Supplier credentialsClient; + + protected final Supplier connectionsClient; + + public AsyncClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawClientsClient(clientOptions); + this.credentialsClient = Suppliers.memoize(() -> new AsyncCredentialsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new AsyncConnectionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawClientsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> list(ListClientsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> list( + ListClientsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CompletableFuture create(CreateClientRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CompletableFuture create( + CreateClientRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture get(String id, GetClientRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture get( + String id, GetClientRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture update(String id, UpdateClientRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture update( + String id, UpdateClientRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public CompletableFuture rotateSecret(String id) { + return this.rawClient.rotateSecret(id).thenApply(response -> response.body()); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public CompletableFuture rotateSecret(String id, RequestOptions requestOptions) { + return this.rawClient.rotateSecret(id, requestOptions).thenApply(response -> response.body()); + } + + public AsyncCredentialsClient credentials() { + return this.credentialsClient.get(); + } + + public AsyncConnectionsClient connections() { + return this.connectionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java new file mode 100644 index 000000000..29b197c35 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.AsyncClientsClient; +import com.auth0.client.mgmt.connections.AsyncKeysClient; +import com.auth0.client.mgmt.connections.AsyncScimConfigurationClient; +import com.auth0.client.mgmt.connections.AsyncUsersClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.CreateConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionResponseContent; +import com.auth0.client.mgmt.types.GetConnectionRequestParameters; +import com.auth0.client.mgmt.types.GetConnectionResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsQueryParameters; +import com.auth0.client.mgmt.types.UpdateConnectionRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncConnectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectionsClient rawClient; + + protected final Supplier clientsClient; + + protected final Supplier keysClient; + + protected final Supplier scimConfigurationClient; + + protected final Supplier usersClient; + + public AsyncConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectionsClient(clientOptions); + this.clientsClient = Suppliers.memoize(() -> new AsyncClientsClient(clientOptions)); + this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions)); + this.scimConfigurationClient = Suppliers.memoize(() -> new AsyncScimConfigurationClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list(ListConnectionsQueryParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list( + ListConnectionsQueryParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CompletableFuture create(CreateConnectionRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CompletableFuture create( + CreateConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture get(String id, GetConnectionRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture get( + String id, GetConnectionRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture update( + String id, UpdateConnectionRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture update( + String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public CompletableFuture checkStatus(String id) { + return this.rawClient.checkStatus(id).thenApply(response -> response.body()); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public CompletableFuture checkStatus(String id, RequestOptions requestOptions) { + return this.rawClient.checkStatus(id, requestOptions).thenApply(response -> response.body()); + } + + public AsyncClientsClient clients() { + return this.clientsClient.get(); + } + + public AsyncKeysClient keys() { + return this.keysClient.get(); + } + + public AsyncScimConfigurationClient scimConfiguration() { + return this.scimConfigurationClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java new file mode 100644 index 000000000..09953ce2d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.CustomDomain; +import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.VerifyCustomDomainResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomDomainsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomDomainsClient rawClient; + + public AsyncCustomDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomDomainsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomDomainsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CompletableFuture create(CreateCustomDomainRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CompletableFuture create( + CreateCustomDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture update( + String id, UpdateCustomDomainRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture update( + String id, UpdateCustomDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Run the test process on a custom domain. + */ + public CompletableFuture test(String id) { + return this.rawClient.test(id).thenApply(response -> response.body()); + } + + /** + * Run the test process on a custom domain. + */ + public CompletableFuture test(String id, RequestOptions requestOptions) { + return this.rawClient.test(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public CompletableFuture verify(String id) { + return this.rawClient.verify(id).thenApply(response -> response.body()); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public CompletableFuture verify(String id, RequestOptions requestOptions) { + return this.rawClient.verify(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncDeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncDeviceCredentialsClient.java new file mode 100644 index 000000000..42608db48 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncDeviceCredentialsClient.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; +import com.auth0.client.mgmt.types.DeviceCredential; +import com.auth0.client.mgmt.types.ListDeviceCredentialsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeviceCredentialsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeviceCredentialsClient rawClient; + + public AsyncDeviceCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeviceCredentialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeviceCredentialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture> list( + ListDeviceCredentialsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture> list( + ListDeviceCredentialsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CompletableFuture createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request) { + return this.rawClient.createPublicKey(request).thenApply(response -> response.body()); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CompletableFuture createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request, RequestOptions requestOptions) { + return this.rawClient.createPublicKey(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncEmailTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncEmailTemplatesClient.java new file mode 100644 index 000000000..7fbcf2397 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncEmailTemplatesClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.CreateEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.EmailTemplateNameEnum; +import com.auth0.client.mgmt.types.GetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.SetEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.SetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmailTemplatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmailTemplatesClient rawClient; + + public AsyncEmailTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmailTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmailTemplatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Create an email template. + */ + public CompletableFuture create(CreateEmailTemplateRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create an email template. + */ + public CompletableFuture create( + CreateEmailTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public CompletableFuture get(EmailTemplateNameEnum templateName) { + return this.rawClient.get(templateName).thenApply(response -> response.body()); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public CompletableFuture get( + EmailTemplateNameEnum templateName, RequestOptions requestOptions) { + return this.rawClient.get(templateName, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update an email template. + */ + public CompletableFuture set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request) { + return this.rawClient.set(templateName, request).thenApply(response -> response.body()); + } + + /** + * Update an email template. + */ + public CompletableFuture set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(templateName, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify an email template. + */ + public CompletableFuture update(EmailTemplateNameEnum templateName) { + return this.rawClient.update(templateName).thenApply(response -> response.body()); + } + + /** + * Modify an email template. + */ + public CompletableFuture update( + EmailTemplateNameEnum templateName, UpdateEmailTemplateRequestContent request) { + return this.rawClient.update(templateName, request).thenApply(response -> response.body()); + } + + /** + * Modify an email template. + */ + public CompletableFuture update( + EmailTemplateNameEnum templateName, + UpdateEmailTemplateRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(templateName, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java new file mode 100644 index 000000000..4f48bd803 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.eventstreams.AsyncDeliveriesClient; +import com.auth0.client.mgmt.eventstreams.AsyncRedeliveriesClient; +import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; +import com.auth0.client.mgmt.types.EventStreamResponseContent; +import com.auth0.client.mgmt.types.EventStreamsCreateRequest; +import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; +import com.auth0.client.mgmt.types.GetEventStreamResponseContent; +import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; +import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncEventStreamsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEventStreamsClient rawClient; + + protected final Supplier deliveriesClient; + + protected final Supplier redeliveriesClient; + + public AsyncEventStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEventStreamsClient(clientOptions); + this.deliveriesClient = Suppliers.memoize(() -> new AsyncDeliveriesClient(clientOptions)); + this.redeliveriesClient = Suppliers.memoize(() -> new AsyncRedeliveriesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEventStreamsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture> list(ListEventStreamsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + ListEventStreamsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create(EventStreamsCreateRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + EventStreamsCreateRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateEventStreamRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateEventStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getStats(String id) { + return this.rawClient.getStats(id).thenApply(response -> response.body()); + } + + public CompletableFuture getStats( + String id, EventStreamsGetStatsRequest request) { + return this.rawClient.getStats(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture getStats( + String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { + return this.rawClient.getStats(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreateEventStreamTestEventRequestContent request) { + return this.rawClient.test(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreateEventStreamTestEventRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncDeliveriesClient deliveries() { + return this.deliveriesClient.get(); + } + + public AsyncRedeliveriesClient redeliveries() { + return this.redeliveriesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java new file mode 100644 index 000000000..df28e6c56 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.AsyncExecutionsClient; +import com.auth0.client.mgmt.types.CreateFlowRequestContent; +import com.auth0.client.mgmt.types.CreateFlowResponseContent; +import com.auth0.client.mgmt.types.FlowSummary; +import com.auth0.client.mgmt.types.FlowsListRequest; +import com.auth0.client.mgmt.types.GetFlowRequestParameters; +import com.auth0.client.mgmt.types.GetFlowResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowRequestContent; +import com.auth0.client.mgmt.types.UpdateFlowResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncFlowsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFlowsClient rawClient; + + protected final Supplier executionsClient; + + public AsyncFlowsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFlowsClient(clientOptions); + this.executionsClient = Suppliers.memoize(() -> new AsyncExecutionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFlowsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture> list(FlowsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + FlowsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create(CreateFlowRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreateFlowRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, GetFlowRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, GetFlowRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id, UpdateFlowRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateFlowRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncExecutionsClient executions() { + return this.executionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncFormsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncFormsClient.java new file mode 100644 index 000000000..5a99a34d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncFormsClient.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateFormRequestContent; +import com.auth0.client.mgmt.types.CreateFormResponseContent; +import com.auth0.client.mgmt.types.FormSummary; +import com.auth0.client.mgmt.types.GetFormRequestParameters; +import com.auth0.client.mgmt.types.GetFormResponseContent; +import com.auth0.client.mgmt.types.ListFormsRequestParameters; +import com.auth0.client.mgmt.types.UpdateFormRequestContent; +import com.auth0.client.mgmt.types.UpdateFormResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncFormsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFormsClient rawClient; + + public AsyncFormsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFormsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFormsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture> list(ListFormsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + ListFormsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create(CreateFormRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreateFormRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, GetFormRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, GetFormRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id, UpdateFormRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateFormRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncHooksClient.java b/src/main/java/com/auth0/client/mgmt/AsyncHooksClient.java new file mode 100644 index 000000000..10589d7bc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncHooksClient.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.hooks.AsyncSecretsClient; +import com.auth0.client.mgmt.types.CreateHookRequestContent; +import com.auth0.client.mgmt.types.CreateHookResponseContent; +import com.auth0.client.mgmt.types.GetHookRequestParameters; +import com.auth0.client.mgmt.types.GetHookResponseContent; +import com.auth0.client.mgmt.types.Hook; +import com.auth0.client.mgmt.types.ListHooksRequestParameters; +import com.auth0.client.mgmt.types.UpdateHookRequestContent; +import com.auth0.client.mgmt.types.UpdateHookResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncHooksClient { + protected final ClientOptions clientOptions; + + private final AsyncRawHooksClient rawClient; + + protected final Supplier secretsClient; + + public AsyncHooksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawHooksClient(clientOptions); + this.secretsClient = Suppliers.memoize(() -> new AsyncSecretsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawHooksClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> list(ListHooksRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> list( + ListHooksRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new hook. + */ + public CompletableFuture create(CreateHookRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new hook. + */ + public CompletableFuture create( + CreateHookRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture get(String id, GetHookRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture get( + String id, GetHookRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a hook. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a hook. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update an existing hook. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update an existing hook. + */ + public CompletableFuture update(String id, UpdateHookRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update an existing hook. + */ + public CompletableFuture update( + String id, UpdateHookRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncSecretsClient secrets() { + return this.secretsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncJobsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncJobsClient.java new file mode 100644 index 000000000..8f6728f9a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncJobsClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.jobs.AsyncErrorsClient; +import com.auth0.client.mgmt.jobs.AsyncUsersExportsClient; +import com.auth0.client.mgmt.jobs.AsyncUsersImportsClient; +import com.auth0.client.mgmt.jobs.AsyncVerificationEmailClient; +import com.auth0.client.mgmt.types.GetJobResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncJobsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawJobsClient rawClient; + + protected final Supplier usersExportsClient; + + protected final Supplier usersImportsClient; + + protected final Supplier verificationEmailClient; + + protected final Supplier errorsClient; + + public AsyncJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawJobsClient(clientOptions); + this.usersExportsClient = Suppliers.memoize(() -> new AsyncUsersExportsClient(clientOptions)); + this.usersImportsClient = Suppliers.memoize(() -> new AsyncUsersImportsClient(clientOptions)); + this.verificationEmailClient = Suppliers.memoize(() -> new AsyncVerificationEmailClient(clientOptions)); + this.errorsClient = Suppliers.memoize(() -> new AsyncErrorsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawJobsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves a job. Useful to check its status. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieves a job. Useful to check its status. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public AsyncUsersExportsClient usersExports() { + return this.usersExportsClient.get(); + } + + public AsyncUsersImportsClient usersImports() { + return this.usersImportsClient.get(); + } + + public AsyncVerificationEmailClient verificationEmail() { + return this.verificationEmailClient.get(); + } + + public AsyncErrorsClient errors() { + return this.errorsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncLogStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncLogStreamsClient.java new file mode 100644 index 000000000..529385924 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncLogStreamsClient.java @@ -0,0 +1,792 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateLogStreamRequestContent; +import com.auth0.client.mgmt.types.CreateLogStreamResponseContent; +import com.auth0.client.mgmt.types.GetLogStreamResponseContent; +import com.auth0.client.mgmt.types.LogStreamResponseSchema; +import com.auth0.client.mgmt.types.UpdateLogStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateLogStreamResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncLogStreamsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLogStreamsClient rawClient; + + public AsyncLogStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLogStreamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLogStreamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CompletableFuture create(CreateLogStreamRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CompletableFuture create( + CreateLogStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a log stream. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a log stream. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture update(String id, UpdateLogStreamRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture update( + String id, UpdateLogStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java new file mode 100644 index 000000000..ba75398c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.GetLogResponseContent; +import com.auth0.client.mgmt.types.ListLogsRequestParameters; +import com.auth0.client.mgmt.types.Log; +import java.util.concurrent.CompletableFuture; + +public class AsyncLogsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLogsClient rawClient; + + public AsyncLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLogsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLogsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture> list(ListLogsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture> list( + ListLogsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve an individual log event. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve an individual log event. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java new file mode 100644 index 000000000..1bc137f5c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.anomaly.AsyncAnomalyClient; +import com.auth0.client.mgmt.attackprotection.AsyncAttackProtectionClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.emails.AsyncEmailsClient; +import com.auth0.client.mgmt.guardian.AsyncGuardianClient; +import com.auth0.client.mgmt.keys.AsyncKeysClient; +import com.auth0.client.mgmt.tenants.AsyncTenantsClient; +import com.auth0.client.mgmt.verifiablecredentials.AsyncVerifiableCredentialsClient; +import java.util.function.Supplier; + +public class AsyncManagementApi { + protected final ClientOptions clientOptions; + + protected final Supplier actionsClient; + + protected final Supplier brandingClient; + + protected final Supplier clientGrantsClient; + + protected final Supplier clientsClient; + + protected final Supplier connectionsClient; + + protected final Supplier customDomainsClient; + + protected final Supplier deviceCredentialsClient; + + protected final Supplier emailTemplatesClient; + + protected final Supplier eventStreamsClient; + + protected final Supplier flowsClient; + + protected final Supplier formsClient; + + protected final Supplier userGrantsClient; + + protected final Supplier hooksClient; + + protected final Supplier jobsClient; + + protected final Supplier logStreamsClient; + + protected final Supplier logsClient; + + protected final Supplier networkAclsClient; + + protected final Supplier organizationsClient; + + protected final Supplier promptsClient; + + protected final Supplier refreshTokensClient; + + protected final Supplier resourceServersClient; + + protected final Supplier rolesClient; + + protected final Supplier rulesClient; + + protected final Supplier rulesConfigsClient; + + protected final Supplier selfServiceProfilesClient; + + protected final Supplier sessionsClient; + + protected final Supplier statsClient; + + protected final Supplier supplementalSignalsClient; + + protected final Supplier ticketsClient; + + protected final Supplier tokenExchangeProfilesClient; + + protected final Supplier userBlocksClient; + + protected final Supplier usersClient; + + protected final Supplier anomalyClient; + + protected final Supplier attackProtectionClient; + + protected final Supplier emailsClient; + + protected final Supplier guardianClient; + + protected final Supplier keysClient; + + protected final Supplier tenantsClient; + + protected final Supplier verifiableCredentialsClient; + + public AsyncManagementApi(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.actionsClient = Suppliers.memoize(() -> new AsyncActionsClient(clientOptions)); + this.brandingClient = Suppliers.memoize(() -> new AsyncBrandingClient(clientOptions)); + this.clientGrantsClient = Suppliers.memoize(() -> new AsyncClientGrantsClient(clientOptions)); + this.clientsClient = Suppliers.memoize(() -> new AsyncClientsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new AsyncConnectionsClient(clientOptions)); + this.customDomainsClient = Suppliers.memoize(() -> new AsyncCustomDomainsClient(clientOptions)); + this.deviceCredentialsClient = Suppliers.memoize(() -> new AsyncDeviceCredentialsClient(clientOptions)); + this.emailTemplatesClient = Suppliers.memoize(() -> new AsyncEmailTemplatesClient(clientOptions)); + this.eventStreamsClient = Suppliers.memoize(() -> new AsyncEventStreamsClient(clientOptions)); + this.flowsClient = Suppliers.memoize(() -> new AsyncFlowsClient(clientOptions)); + this.formsClient = Suppliers.memoize(() -> new AsyncFormsClient(clientOptions)); + this.userGrantsClient = Suppliers.memoize(() -> new AsyncUserGrantsClient(clientOptions)); + this.hooksClient = Suppliers.memoize(() -> new AsyncHooksClient(clientOptions)); + this.jobsClient = Suppliers.memoize(() -> new AsyncJobsClient(clientOptions)); + this.logStreamsClient = Suppliers.memoize(() -> new AsyncLogStreamsClient(clientOptions)); + this.logsClient = Suppliers.memoize(() -> new AsyncLogsClient(clientOptions)); + this.networkAclsClient = Suppliers.memoize(() -> new AsyncNetworkAclsClient(clientOptions)); + this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); + this.promptsClient = Suppliers.memoize(() -> new AsyncPromptsClient(clientOptions)); + this.refreshTokensClient = Suppliers.memoize(() -> new AsyncRefreshTokensClient(clientOptions)); + this.resourceServersClient = Suppliers.memoize(() -> new AsyncResourceServersClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); + this.rulesClient = Suppliers.memoize(() -> new AsyncRulesClient(clientOptions)); + this.rulesConfigsClient = Suppliers.memoize(() -> new AsyncRulesConfigsClient(clientOptions)); + this.selfServiceProfilesClient = Suppliers.memoize(() -> new AsyncSelfServiceProfilesClient(clientOptions)); + this.sessionsClient = Suppliers.memoize(() -> new AsyncSessionsClient(clientOptions)); + this.statsClient = Suppliers.memoize(() -> new AsyncStatsClient(clientOptions)); + this.supplementalSignalsClient = Suppliers.memoize(() -> new AsyncSupplementalSignalsClient(clientOptions)); + this.ticketsClient = Suppliers.memoize(() -> new AsyncTicketsClient(clientOptions)); + this.tokenExchangeProfilesClient = Suppliers.memoize(() -> new AsyncTokenExchangeProfilesClient(clientOptions)); + this.userBlocksClient = Suppliers.memoize(() -> new AsyncUserBlocksClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.anomalyClient = Suppliers.memoize(() -> new AsyncAnomalyClient(clientOptions)); + this.attackProtectionClient = Suppliers.memoize(() -> new AsyncAttackProtectionClient(clientOptions)); + this.emailsClient = Suppliers.memoize(() -> new AsyncEmailsClient(clientOptions)); + this.guardianClient = Suppliers.memoize(() -> new AsyncGuardianClient(clientOptions)); + this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions)); + this.tenantsClient = Suppliers.memoize(() -> new AsyncTenantsClient(clientOptions)); + this.verifiableCredentialsClient = Suppliers.memoize(() -> new AsyncVerifiableCredentialsClient(clientOptions)); + } + + public AsyncActionsClient actions() { + return this.actionsClient.get(); + } + + public AsyncBrandingClient branding() { + return this.brandingClient.get(); + } + + public AsyncClientGrantsClient clientGrants() { + return this.clientGrantsClient.get(); + } + + public AsyncClientsClient clients() { + return this.clientsClient.get(); + } + + public AsyncConnectionsClient connections() { + return this.connectionsClient.get(); + } + + public AsyncCustomDomainsClient customDomains() { + return this.customDomainsClient.get(); + } + + public AsyncDeviceCredentialsClient deviceCredentials() { + return this.deviceCredentialsClient.get(); + } + + public AsyncEmailTemplatesClient emailTemplates() { + return this.emailTemplatesClient.get(); + } + + public AsyncEventStreamsClient eventStreams() { + return this.eventStreamsClient.get(); + } + + public AsyncFlowsClient flows() { + return this.flowsClient.get(); + } + + public AsyncFormsClient forms() { + return this.formsClient.get(); + } + + public AsyncUserGrantsClient userGrants() { + return this.userGrantsClient.get(); + } + + public AsyncHooksClient hooks() { + return this.hooksClient.get(); + } + + public AsyncJobsClient jobs() { + return this.jobsClient.get(); + } + + public AsyncLogStreamsClient logStreams() { + return this.logStreamsClient.get(); + } + + public AsyncLogsClient logs() { + return this.logsClient.get(); + } + + public AsyncNetworkAclsClient networkAcls() { + return this.networkAclsClient.get(); + } + + public AsyncOrganizationsClient organizations() { + return this.organizationsClient.get(); + } + + public AsyncPromptsClient prompts() { + return this.promptsClient.get(); + } + + public AsyncRefreshTokensClient refreshTokens() { + return this.refreshTokensClient.get(); + } + + public AsyncResourceServersClient resourceServers() { + return this.resourceServersClient.get(); + } + + public AsyncRolesClient roles() { + return this.rolesClient.get(); + } + + public AsyncRulesClient rules() { + return this.rulesClient.get(); + } + + public AsyncRulesConfigsClient rulesConfigs() { + return this.rulesConfigsClient.get(); + } + + public AsyncSelfServiceProfilesClient selfServiceProfiles() { + return this.selfServiceProfilesClient.get(); + } + + public AsyncSessionsClient sessions() { + return this.sessionsClient.get(); + } + + public AsyncStatsClient stats() { + return this.statsClient.get(); + } + + public AsyncSupplementalSignalsClient supplementalSignals() { + return this.supplementalSignalsClient.get(); + } + + public AsyncTicketsClient tickets() { + return this.ticketsClient.get(); + } + + public AsyncTokenExchangeProfilesClient tokenExchangeProfiles() { + return this.tokenExchangeProfilesClient.get(); + } + + public AsyncUserBlocksClient userBlocks() { + return this.userBlocksClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncAnomalyClient anomaly() { + return this.anomalyClient.get(); + } + + public AsyncAttackProtectionClient attackProtection() { + return this.attackProtectionClient.get(); + } + + public AsyncEmailsClient emails() { + return this.emailsClient.get(); + } + + public AsyncGuardianClient guardian() { + return this.guardianClient.get(); + } + + public AsyncKeysClient keys() { + return this.keysClient.get(); + } + + public AsyncTenantsClient tenants() { + return this.tenantsClient.get(); + } + + public AsyncVerifiableCredentialsClient verifiableCredentials() { + return this.verifiableCredentialsClient.get(); + } + + public static AsyncManagementApiBuilder builder() { + return new AsyncManagementApiBuilder(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncManagementApiBuilder.java b/src/main/java/com/auth0/client/mgmt/AsyncManagementApiBuilder.java new file mode 100644 index 000000000..d6af5f882 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncManagementApiBuilder.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Environment; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import okhttp3.OkHttpClient; + +public class AsyncManagementApiBuilder { + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); + + private final Map customHeaders = new HashMap<>(); + + private String token = null; + + private Environment environment = Environment.DEFAULT; + + private OkHttpClient httpClient; + + /** + * Sets token + */ + public AsyncManagementApiBuilder token(String token) { + this.token = token; + return this; + } + + public AsyncManagementApiBuilder environment(Environment environment) { + this.environment = environment; + return this; + } + + public AsyncManagementApiBuilder url(String url) { + this.environment = Environment.custom(url); + return this; + } + + /** + * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. + */ + public AsyncManagementApiBuilder timeout(int timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + /** + * Sets the maximum number of retries for the client. Defaults to 2 retries. + */ + public AsyncManagementApiBuilder maxRetries(int maxRetries) { + this.maxRetries = Optional.of(maxRetries); + return this; + } + + /** + * Sets the underlying OkHttp client + */ + public AsyncManagementApiBuilder httpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Add a custom header to be sent with all requests. + * For headers that need to be computed dynamically or conditionally, use the setAdditional() method override instead. + * + * @param name The header name + * @param value The header value + * @return This builder for method chaining + */ + public AsyncManagementApiBuilder addHeader(String name, String value) { + this.customHeaders.put(name, value); + return this; + } + + protected ClientOptions buildClientOptions() { + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + for (Map.Entry header : this.customHeaders.entrySet()) { + builder.addHeader(header.getKey(), header.getValue()); + } + setAdditional(builder); + return builder.build(); + } + + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.token != null) { + builder.addHeader("Authorization", "Bearer " + this.token); + } + } + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public AsyncManagementApi build() { + if (token == null) { + throw new RuntimeException("Please provide token"); + } + validateConfiguration(); + return new AsyncManagementApi(buildClientOptions()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncNetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncNetworkAclsClient.java new file mode 100644 index 000000000..ce4023d31 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncNetworkAclsClient.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsRequestParameters; +import com.auth0.client.mgmt.types.NetworkAclsResponseContent; +import com.auth0.client.mgmt.types.SetNetworkAclRequestContent; +import com.auth0.client.mgmt.types.SetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncNetworkAclsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawNetworkAclsClient rawClient; + + public AsyncNetworkAclsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawNetworkAclsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawNetworkAclsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture> list( + ListNetworkAclsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture> list( + ListNetworkAclsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new access control list for your client. + */ + public CompletableFuture create(CreateNetworkAclRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new access control list for your client. + */ + public CompletableFuture create(CreateNetworkAclRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific access control list entry for your client. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Get a specific access control list entry for your client. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture set(String id, SetNetworkAclRequestContent request) { + return this.rawClient.set(id, request).thenApply(response -> response.body()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture set( + String id, SetNetworkAclRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete existing access control list for your client. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete existing access control list for your client. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture update( + String id, UpdateNetworkAclRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture update( + String id, UpdateNetworkAclRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java new file mode 100644 index 000000000..605d3cab8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.AsyncClientGrantsClient; +import com.auth0.client.mgmt.organizations.AsyncEnabledConnectionsClient; +import com.auth0.client.mgmt.organizations.AsyncInvitationsClient; +import com.auth0.client.mgmt.organizations.AsyncMembersClient; +import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationByNameResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; +import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncOrganizationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOrganizationsClient rawClient; + + protected final Supplier clientGrantsClient; + + protected final Supplier enabledConnectionsClient; + + protected final Supplier invitationsClient; + + protected final Supplier membersClient; + + public AsyncOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOrganizationsClient(clientOptions); + this.clientGrantsClient = Suppliers.memoize(() -> new AsyncClientGrantsClient(clientOptions)); + this.enabledConnectionsClient = Suppliers.memoize(() -> new AsyncEnabledConnectionsClient(clientOptions)); + this.invitationsClient = Suppliers.memoize(() -> new AsyncInvitationsClient(clientOptions)); + this.membersClient = Suppliers.memoize(() -> new AsyncMembersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list(ListOrganizationsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list( + ListOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CompletableFuture create(CreateOrganizationRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CompletableFuture create( + CreateOrganizationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public CompletableFuture getByName(String name) { + return this.rawClient.getByName(name).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public CompletableFuture getByName( + String name, RequestOptions requestOptions) { + return this.rawClient.getByName(name, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture update( + String id, UpdateOrganizationRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture update( + String id, UpdateOrganizationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncClientGrantsClient clientGrants() { + return this.clientGrantsClient.get(); + } + + public AsyncEnabledConnectionsClient enabledConnections() { + return this.enabledConnectionsClient.get(); + } + + public AsyncInvitationsClient invitations() { + return this.invitationsClient.get(); + } + + public AsyncMembersClient members() { + return this.membersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncPromptsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncPromptsClient.java new file mode 100644 index 000000000..fc6d9bdf7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncPromptsClient.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.prompts.AsyncCustomTextClient; +import com.auth0.client.mgmt.prompts.AsyncPartialsClient; +import com.auth0.client.mgmt.prompts.AsyncRenderingClient; +import com.auth0.client.mgmt.types.GetSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSettingsRequestContent; +import com.auth0.client.mgmt.types.UpdateSettingsResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncPromptsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPromptsClient rawClient; + + protected final Supplier renderingClient; + + protected final Supplier customTextClient; + + protected final Supplier partialsClient; + + public AsyncPromptsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPromptsClient(clientOptions); + this.renderingClient = Suppliers.memoize(() -> new AsyncRenderingClient(clientOptions)); + this.customTextClient = Suppliers.memoize(() -> new AsyncCustomTextClient(clientOptions)); + this.partialsClient = Suppliers.memoize(() -> new AsyncPartialsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPromptsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture getSettings() { + return this.rawClient.getSettings().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture getSettings(RequestOptions requestOptions) { + return this.rawClient.getSettings(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture updateSettings() { + return this.rawClient.updateSettings().thenApply(response -> response.body()); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture updateSettings(UpdateSettingsRequestContent request) { + return this.rawClient.updateSettings(request).thenApply(response -> response.body()); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture updateSettings( + UpdateSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateSettings(request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncRenderingClient rendering() { + return this.renderingClient.get(); + } + + public AsyncCustomTextClient customText() { + return this.customTextClient.get(); + } + + public AsyncPartialsClient partials() { + return this.partialsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java new file mode 100644 index 000000000..38e4ae7e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java @@ -0,0 +1,718 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Action; +import com.auth0.client.mgmt.types.CreateActionRequestContent; +import com.auth0.client.mgmt.types.CreateActionResponseContent; +import com.auth0.client.mgmt.types.DeleteActionRequestParameters; +import com.auth0.client.mgmt.types.DeployActionResponseContent; +import com.auth0.client.mgmt.types.GetActionResponseContent; +import com.auth0.client.mgmt.types.ListActionsPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListActionsRequestParameters; +import com.auth0.client.mgmt.types.TestActionRequestContent; +import com.auth0.client.mgmt.types.TestActionResponseContent; +import com.auth0.client.mgmt.types.UpdateActionRequestContent; +import com.auth0.client.mgmt.types.UpdateActionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all actions. + */ + public CompletableFuture>> list() { + return list(ListActionsRequestParameters.builder().build()); + } + + /** + * Retrieve all actions. + */ + public CompletableFuture>> list( + ListActionsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve all actions. + */ + public CompletableFuture>> list( + ListActionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions"); + QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "actionName", request.getActionName(), false); + QueryStringMapper.addQueryParameter(httpUrl, "deployed", request.getDeployed(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "installed", request.getInstalled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionsPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListActionsRequestParameters nextRequest = ListActionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getActions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CompletableFuture> create( + CreateActionRequestContent request) { + return create(request, null); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public CompletableFuture> create( + CreateActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateActionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve an action by its ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve an action by its ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetActionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture> delete(String id) { + return delete(id, DeleteActionRequestParameters.builder().build()); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture> delete(String id, DeleteActionRequestParameters request) { + return delete(id, request, null); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public CompletableFuture> delete( + String id, DeleteActionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "force", request.getForce(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateActionRequestContent.builder().build()); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture> update( + String id, UpdateActionRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public CompletableFuture> update( + String id, UpdateActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateActionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public CompletableFuture> deploy(String id) { + return deploy(id, null); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public CompletableFuture> deploy( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .addPathSegments("deploy") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeployActionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public CompletableFuture> test( + String id, TestActionRequestContent request) { + return test(id, request, null); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public CompletableFuture> test( + String id, TestActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .addPathSegments("test") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, TestActionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawBrandingClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawBrandingClient.java new file mode 100644 index 000000000..09c82ac52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawBrandingClient.java @@ -0,0 +1,214 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBrandingResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingRequestContent; +import com.auth0.client.mgmt.types.UpdateBrandingResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBrandingClient { + protected final ClientOptions clientOptions; + + public AsyncRawBrandingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve branding settings. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Retrieve branding settings. + */ + public CompletableFuture> get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update branding settings. + */ + public CompletableFuture> update() { + return update(UpdateBrandingRequestContent.builder().build()); + } + + /** + * Update branding settings. + */ + public CompletableFuture> update( + UpdateBrandingRequestContent request) { + return update(request, null); + } + + /** + * Update branding settings. + */ + public CompletableFuture> update( + UpdateBrandingRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBrandingResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java new file mode 100644 index 000000000..37ce81a4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java @@ -0,0 +1,446 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; +import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.UpdateClientGrantRequestContent; +import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawClientGrantsClient { + protected final ClientOptions clientOptions; + + public AsyncRawClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture>> list() { + return list(ListClientGrantsRequestParameters.builder().build()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture>> list( + ListClientGrantsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public CompletableFuture>> list( + ListClientGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "allow_any_organization", request.getAllowAnyOrganization(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientGrantPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientGrantPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListClientGrantsRequestParameters nextRequest = ListClientGrantsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getClientGrants().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> create( + CreateClientGrantRequestContent request) { + return create(request, null); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> create( + CreateClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateClientGrantResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a client grant. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateClientGrantRequestContent.builder().build()); + } + + /** + * Update a client grant. + */ + public CompletableFuture> update( + String id, UpdateClientGrantRequestContent request) { + return update(id, request, null); + } + + /** + * Update a client grant. + */ + public CompletableFuture> update( + String id, UpdateClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateClientGrantResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java new file mode 100644 index 000000000..c9830f723 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java @@ -0,0 +1,886 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Client; +import com.auth0.client.mgmt.types.CreateClientRequestContent; +import com.auth0.client.mgmt.types.CreateClientResponseContent; +import com.auth0.client.mgmt.types.GetClientRequestParameters; +import com.auth0.client.mgmt.types.GetClientResponseContent; +import com.auth0.client.mgmt.types.ListClientsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListClientsRequestParameters; +import com.auth0.client.mgmt.types.RotateClientSecretResponseContent; +import com.auth0.client.mgmt.types.UpdateClientRequestContent; +import com.auth0.client.mgmt.types.UpdateClientResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawClientsClient { + protected final ClientOptions clientOptions; + + public AsyncRawClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture>> list() { + return list(ListClientsRequestParameters.builder().build()); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture>> list( + ListClientsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture>> list( + ListClientsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "is_global", request.getIsGlobal(), false); + QueryStringMapper.addQueryParameter(httpUrl, "is_first_party", request.getIsFirstParty(), false); + QueryStringMapper.addQueryParameter(httpUrl, "app_type", request.getAppType(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + JsonNode node = ObjectMappers.JSON_MAPPER.readTree(responseBodyString); + ListClientsOffsetPaginatedResponseContent parsedResponse; + if (node.isArray()) { + List clients = + ObjectMappers.JSON_MAPPER.convertValue(node, new TypeReference>() {}); + parsedResponse = ListClientsOffsetPaginatedResponseContent.builder() + .clients(clients) + .build(); + } else { + parsedResponse = ObjectMappers.JSON_MAPPER.convertValue( + node, ListClientsOffsetPaginatedResponseContent.class); + } + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListClientsRequestParameters nextRequest = ListClientsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getClients().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CompletableFuture> create( + CreateClientRequestContent request) { + return create(request, null); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CompletableFuture> create( + CreateClientRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateClientResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> get(String id) { + return get(id, GetClientRequestParameters.builder().build()); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> get( + String id, GetClientRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public CompletableFuture> get( + String id, GetClientRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetClientResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture> update(String id) { + return update(id, UpdateClientRequestContent.builder().build()); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture> update( + String id, UpdateClientRequestContent request) { + return update(id, request, null); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public CompletableFuture> update( + String id, UpdateClientRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateClientResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public CompletableFuture> rotateSecret(String id) { + return rotateSecret(id, null); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public CompletableFuture> rotateSecret( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .addPathSegments("rotate-secret") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RotateClientSecretResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java new file mode 100644 index 000000000..32ddd2f50 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java @@ -0,0 +1,681 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.CreateConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionResponseContent; +import com.auth0.client.mgmt.types.GetConnectionRequestParameters; +import com.auth0.client.mgmt.types.GetConnectionResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsCheckpointPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsQueryParameters; +import com.auth0.client.mgmt.types.UpdateConnectionRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConnectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list() { + return list(ListConnectionsQueryParameters.builder().build()); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + ListConnectionsQueryParameters request) { + return list(request, null); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + ListConnectionsQueryParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "name", request.getName(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getStrategy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "strategy", request.getStrategy().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListConnectionsCheckpointPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionsCheckpointPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListConnectionsQueryParameters nextRequest = ListConnectionsQueryParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getConnections().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CompletableFuture> create( + CreateConnectionRequestContent request) { + return create(request, null); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CompletableFuture> create( + CreateConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture> get(String id) { + return get(id, GetConnectionRequestParameters.builder().build()); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture> get( + String id, GetConnectionRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public CompletableFuture> get( + String id, GetConnectionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture> update(String id) { + return update(id, UpdateConnectionRequestContent.builder().build()); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture> update( + String id, UpdateConnectionRequestContent request) { + return update(id, request, null); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public CompletableFuture> update( + String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public CompletableFuture> checkStatus(String id) { + return checkStatus(id, null); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public CompletableFuture> checkStatus(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("status") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java new file mode 100644 index 000000000..0855f2a83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java @@ -0,0 +1,756 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.CustomDomain; +import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.VerifyCustomDomainResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomDomainsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CompletableFuture> create( + CreateCustomDomainRequestContent request) { + return create(request, null); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CompletableFuture> create( + CreateCustomDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateCustomDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a custom domain configuration and status. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetCustomDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture> update(String id) { + return update(id, UpdateCustomDomainRequestContent.builder().build()); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture> update( + String id, UpdateCustomDomainRequestContent request) { + return update(id, request, null); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public CompletableFuture> update( + String id, UpdateCustomDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateCustomDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Run the test process on a custom domain. + */ + public CompletableFuture> test(String id) { + return test(id, null); + } + + /** + * Run the test process on a custom domain. + */ + public CompletableFuture> test( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .addPathSegments("test") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, TestCustomDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public CompletableFuture> verify(String id) { + return verify(id, null); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public CompletableFuture> verify( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .addPathSegments("verify") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, VerifyCustomDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java new file mode 100644 index 000000000..7cb2d0ee6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java @@ -0,0 +1,344 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; +import com.auth0.client.mgmt.types.DeviceCredential; +import com.auth0.client.mgmt.types.ListDeviceCredentialsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListDeviceCredentialsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeviceCredentialsClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeviceCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture>> list() { + return list(ListDeviceCredentialsRequestParameters.builder().build()); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture>> list( + ListDeviceCredentialsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public CompletableFuture>> list( + ListDeviceCredentialsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "type", request.getType(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListDeviceCredentialsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListDeviceCredentialsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListDeviceCredentialsRequestParameters nextRequest = + ListDeviceCredentialsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getDeviceCredentials().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CompletableFuture> createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request) { + return createPublicKey(request, null); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CompletableFuture> createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePublicKeyDeviceCredentialResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawEmailTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawEmailTemplatesClient.java new file mode 100644 index 000000000..d5cdc01ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawEmailTemplatesClient.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.CreateEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.EmailTemplateNameEnum; +import com.auth0.client.mgmt.types.GetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.SetEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.SetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmailTemplatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmailTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create an email template. + */ + public CompletableFuture> create( + CreateEmailTemplateRequestContent request) { + return create(request, null); + } + + /** + * Create an email template. + */ + public CompletableFuture> create( + CreateEmailTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEmailTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public CompletableFuture> get( + EmailTemplateNameEnum templateName) { + return get(templateName, null); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public CompletableFuture> get( + EmailTemplateNameEnum templateName, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEmailTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update an email template. + */ + public CompletableFuture> set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request) { + return set(templateName, request, null); + } + + /** + * Update an email template. + */ + public CompletableFuture> set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetEmailTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify an email template. + */ + public CompletableFuture> update( + EmailTemplateNameEnum templateName) { + return update(templateName, UpdateEmailTemplateRequestContent.builder().build()); + } + + /** + * Modify an email template. + */ + public CompletableFuture> update( + EmailTemplateNameEnum templateName, UpdateEmailTemplateRequestContent request) { + return update(templateName, request, null); + } + + /** + * Modify an email template. + */ + public CompletableFuture> update( + EmailTemplateNameEnum templateName, + UpdateEmailTemplateRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateEmailTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java new file mode 100644 index 000000000..88de49a79 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java @@ -0,0 +1,641 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; +import com.auth0.client.mgmt.types.EventStreamResponseContent; +import com.auth0.client.mgmt.types.EventStreamsCreateRequest; +import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; +import com.auth0.client.mgmt.types.GetEventStreamResponseContent; +import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; +import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEventStreamsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEventStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list() { + return list(ListEventStreamsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + ListEventStreamsRequestParameters request) { + return list(request, null); + } + + public CompletableFuture>> list( + ListEventStreamsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + EventStreamsCreateRequest request) { + return create(request, null); + } + + public CompletableFuture> create( + EventStreamsCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEventStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, null); + } + + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEventStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update(String id) { + return update(id, UpdateEventStreamRequestContent.builder().build()); + } + + public CompletableFuture> update( + String id, UpdateEventStreamRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdateEventStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateEventStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> getStats(String id) { + return getStats(id, EventStreamsGetStatsRequest.builder().build()); + } + + public CompletableFuture> getStats( + String id, EventStreamsGetStatsRequest request) { + return getStats(id, request, null); + } + + public CompletableFuture> getStats( + String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("stats"); + QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEventStreamStatsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> test( + String id, CreateEventStreamTestEventRequestContent request) { + return test(id, request, null); + } + + public CompletableFuture> test( + String id, CreateEventStreamTestEventRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("test") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEventStreamTestEventResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java new file mode 100644 index 000000000..8536b5af1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java @@ -0,0 +1,500 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateFlowRequestContent; +import com.auth0.client.mgmt.types.CreateFlowResponseContent; +import com.auth0.client.mgmt.types.FlowSummary; +import com.auth0.client.mgmt.types.FlowsListRequest; +import com.auth0.client.mgmt.types.GetFlowRequestParameters; +import com.auth0.client.mgmt.types.GetFlowResponseContent; +import com.auth0.client.mgmt.types.ListFlowsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowRequestContent; +import com.auth0.client.mgmt.types.UpdateFlowResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFlowsClient { + protected final ClientOptions clientOptions; + + public AsyncRawFlowsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list() { + return list(FlowsListRequest.builder().build()); + } + + public CompletableFuture>> list( + FlowsListRequest request) { + return list(request, null); + } + + public CompletableFuture>> list( + FlowsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "synchronous", request.getSynchronous(), false); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFlowsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + FlowsListRequest nextRequest = FlowsListRequest.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getFlows().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + CreateFlowRequestContent request) { + return create(request, null); + } + + public CompletableFuture> create( + CreateFlowRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateFlowResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, GetFlowRequestParameters.builder().build()); + } + + public CompletableFuture> get( + String id, GetFlowRequestParameters request) { + return get(id, request, null); + } + + public CompletableFuture> get( + String id, GetFlowRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetFlowResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update(String id) { + return update(id, UpdateFlowRequestContent.builder().build()); + } + + public CompletableFuture> update( + String id, UpdateFlowRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdateFlowRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateFlowResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawFormsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawFormsClient.java new file mode 100644 index 000000000..4b1eed51c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawFormsClient.java @@ -0,0 +1,489 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateFormRequestContent; +import com.auth0.client.mgmt.types.CreateFormResponseContent; +import com.auth0.client.mgmt.types.FormSummary; +import com.auth0.client.mgmt.types.GetFormRequestParameters; +import com.auth0.client.mgmt.types.GetFormResponseContent; +import com.auth0.client.mgmt.types.ListFormsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListFormsRequestParameters; +import com.auth0.client.mgmt.types.UpdateFormRequestContent; +import com.auth0.client.mgmt.types.UpdateFormResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFormsClient { + protected final ClientOptions clientOptions; + + public AsyncRawFormsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list() { + return list(ListFormsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + ListFormsRequestParameters request) { + return list(request, null); + } + + public CompletableFuture>> list( + ListFormsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFormsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFormsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListFormsRequestParameters nextRequest = ListFormsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getForms().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + CreateFormRequestContent request) { + return create(request, null); + } + + public CompletableFuture> create( + CreateFormRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateFormResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, GetFormRequestParameters.builder().build()); + } + + public CompletableFuture> get( + String id, GetFormRequestParameters request) { + return get(id, request, null); + } + + public CompletableFuture> get( + String id, GetFormRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetFormResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update(String id) { + return update(id, UpdateFormRequestContent.builder().build()); + } + + public CompletableFuture> update( + String id, UpdateFormRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdateFormRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateFormResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawHooksClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawHooksClient.java new file mode 100644 index 000000000..e298bf7b8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawHooksClient.java @@ -0,0 +1,549 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateHookRequestContent; +import com.auth0.client.mgmt.types.CreateHookResponseContent; +import com.auth0.client.mgmt.types.GetHookRequestParameters; +import com.auth0.client.mgmt.types.GetHookResponseContent; +import com.auth0.client.mgmt.types.Hook; +import com.auth0.client.mgmt.types.ListHooksOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListHooksRequestParameters; +import com.auth0.client.mgmt.types.UpdateHookRequestContent; +import com.auth0.client.mgmt.types.UpdateHookResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawHooksClient { + protected final ClientOptions clientOptions; + + public AsyncRawHooksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture>> list() { + return list(ListHooksRequestParameters.builder().build()); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture>> list( + ListHooksRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture>> list( + ListHooksRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListHooksOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListHooksOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListHooksRequestParameters nextRequest = ListHooksRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getHooks().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new hook. + */ + public CompletableFuture> create( + CreateHookRequestContent request) { + return create(request, null); + } + + /** + * Create a new hook. + */ + public CompletableFuture> create( + CreateHookRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateHookResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture> get(String id) { + return get(id, GetHookRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture> get( + String id, GetHookRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public CompletableFuture> get( + String id, GetHookRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetHookResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a hook. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a hook. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update an existing hook. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateHookRequestContent.builder().build()); + } + + /** + * Update an existing hook. + */ + public CompletableFuture> update( + String id, UpdateHookRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing hook. + */ + public CompletableFuture> update( + String id, UpdateHookRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateHookResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawJobsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawJobsClient.java new file mode 100644 index 000000000..11807f637 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawJobsClient.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetJobResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawJobsClient { + protected final ClientOptions clientOptions; + + public AsyncRawJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves a job. Useful to check its status. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieves a job. Useful to check its status. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetJobResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawLogStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawLogStreamsClient.java new file mode 100644 index 000000000..aa7e7964c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawLogStreamsClient.java @@ -0,0 +1,1171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateLogStreamRequestContent; +import com.auth0.client.mgmt.types.CreateLogStreamResponseContent; +import com.auth0.client.mgmt.types.GetLogStreamResponseContent; +import com.auth0.client.mgmt.types.LogStreamResponseSchema; +import com.auth0.client.mgmt.types.UpdateLogStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateLogStreamResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLogStreamsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLogStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public CompletableFuture>> list( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CompletableFuture> create( + CreateLogStreamRequestContent request) { + return create(request, null); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CompletableFuture> create( + CreateLogStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateLogStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetLogStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a log stream. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a log stream. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture> update(String id) { + return update(id, UpdateLogStreamRequestContent.builder().build()); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture> update( + String id, UpdateLogStreamRequestContent request) { + return update(id, request, null); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public CompletableFuture> update( + String id, UpdateLogStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateLogStreamResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java new file mode 100644 index 000000000..bf9d0bbde --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java @@ -0,0 +1,305 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetLogResponseContent; +import com.auth0.client.mgmt.types.ListLogOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListLogsRequestParameters; +import com.auth0.client.mgmt.types.Log; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLogsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture>> list() { + return list(ListLogsRequestParameters.builder().build()); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture>> list( + ListLogsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public CompletableFuture>> list( + ListLogsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("logs"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListLogOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListLogOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListLogsRequestParameters nextRequest = ListLogsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getLogs().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve an individual log event. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve an individual log event. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("logs") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetLogResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java new file mode 100644 index 000000000..df1c5621c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java @@ -0,0 +1,632 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsRequestParameters; +import com.auth0.client.mgmt.types.NetworkAclsResponseContent; +import com.auth0.client.mgmt.types.SetNetworkAclRequestContent; +import com.auth0.client.mgmt.types.SetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawNetworkAclsClient { + protected final ClientOptions clientOptions; + + public AsyncRawNetworkAclsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture>> list() { + return list(ListNetworkAclsRequestParameters.builder().build()); + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture>> list( + ListNetworkAclsRequestParameters request) { + return list(request, null); + } + + /** + * Get all access control list entries for your client. + */ + public CompletableFuture>> list( + ListNetworkAclsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListNetworkAclsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListNetworkAclsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListNetworkAclsRequestParameters nextRequest = ListNetworkAclsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getNetworkAcls().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new access control list for your client. + */ + public CompletableFuture> create(CreateNetworkAclRequestContent request) { + return create(request, null); + } + + /** + * Create a new access control list for your client. + */ + public CompletableFuture> create( + CreateNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific access control list entry for your client. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Get a specific access control list entry for your client. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetNetworkAclsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture> set( + String id, SetNetworkAclRequestContent request) { + return set(id, request, null); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture> set( + String id, SetNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetNetworkAclsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete existing access control list for your client. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete existing access control list for your client. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateNetworkAclRequestContent.builder().build()); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture> update( + String id, UpdateNetworkAclRequestContent request) { + return update(id, request, null); + } + + /** + * Update existing access control list for your client. + */ + public CompletableFuture> update( + String id, UpdateNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateNetworkAclResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java new file mode 100644 index 000000000..350827c57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java @@ -0,0 +1,653 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationByNameResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; +import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOrganizationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list() { + return list(ListOrganizationsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + ListOrganizationsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + ListOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationsRequestParameters nextRequest = ListOrganizationsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getOrganizations().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CompletableFuture> create( + CreateOrganizationRequestContent request) { + return create(request, null); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CompletableFuture> create( + CreateOrganizationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public CompletableFuture> getByName(String name) { + return getByName(name, null); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public CompletableFuture> getByName( + String name, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations/name") + .addPathSegment(name) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationByNameResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateOrganizationRequestContent.builder().build()); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture> update( + String id, UpdateOrganizationRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public CompletableFuture> update( + String id, UpdateOrganizationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawPromptsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawPromptsClient.java new file mode 100644 index 000000000..64279e606 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawPromptsClient.java @@ -0,0 +1,215 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSettingsRequestContent; +import com.auth0.client.mgmt.types.UpdateSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPromptsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPromptsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture> getSettings() { + return getSettings(null); + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture> getSettings( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture> updateSettings() { + return updateSettings(UpdateSettingsRequestContent.builder().build()); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture> updateSettings( + UpdateSettingsRequestContent request) { + return updateSettings(request, null); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public CompletableFuture> updateSettings( + UpdateSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java new file mode 100644 index 000000000..7692e210a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRefreshTokensClient { + protected final ClientOptions clientOptions; + + public AsyncRawRefreshTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve refresh token information. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve refresh token information. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetRefreshTokenResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a refresh token by its ID. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a refresh token by its ID. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java new file mode 100644 index 000000000..c7bb5836c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java @@ -0,0 +1,548 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; +import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; +import com.auth0.client.mgmt.types.GetResourceServerRequestParameters; +import com.auth0.client.mgmt.types.GetResourceServerResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerRequestParameters; +import com.auth0.client.mgmt.types.ResourceServer; +import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; +import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawResourceServersClient { + protected final ClientOptions clientOptions; + + public AsyncRawResourceServersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture>> list() { + return list(ListResourceServerRequestParameters.builder().build()); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture>> list( + ListResourceServerRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture>> list( + ListResourceServerRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getIdentifiers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "identifiers", request.getIdentifiers().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListResourceServerOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListResourceServerOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListResourceServerRequestParameters nextRequest = ListResourceServerRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getResourceServers().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CompletableFuture> create( + CreateResourceServerRequestContent request) { + return create(request, null); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CompletableFuture> create( + CreateResourceServerRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateResourceServerResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture> get(String id) { + return get(id, GetResourceServerRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture> get( + String id, GetResourceServerRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture> get( + String id, GetResourceServerRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetResourceServerResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateResourceServerRequestContent.builder().build()); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture> update( + String id, UpdateResourceServerRequestContent request) { + return update(id, request, null); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture> update( + String id, UpdateResourceServerRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateResourceServerResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java new file mode 100644 index 000000000..478d560ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java @@ -0,0 +1,527 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateRoleRequestContent; +import com.auth0.client.mgmt.types.CreateRoleResponseContent; +import com.auth0.client.mgmt.types.GetRoleResponseContent; +import com.auth0.client.mgmt.types.ListRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.UpdateRoleRequestContent; +import com.auth0.client.mgmt.types.UpdateRoleResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRolesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture>> list() { + return list(ListRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture>> list( + ListRolesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture>> list( + ListRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "name_filter", request.getNameFilter(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRolesOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRolesOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListRolesRequestParameters nextRequest = ListRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CompletableFuture> create( + CreateRoleRequestContent request) { + return create(request, null); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CompletableFuture> create( + CreateRoleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateRoleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetRoleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateRoleRequestContent.builder().build()); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture> update( + String id, UpdateRoleRequestContent request) { + return update(id, request, null); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture> update( + String id, UpdateRoleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRoleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java new file mode 100644 index 000000000..bcbe783b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java @@ -0,0 +1,552 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateRuleRequestContent; +import com.auth0.client.mgmt.types.CreateRuleResponseContent; +import com.auth0.client.mgmt.types.GetRuleRequestParameters; +import com.auth0.client.mgmt.types.GetRuleResponseContent; +import com.auth0.client.mgmt.types.ListRulesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRulesRequestParameters; +import com.auth0.client.mgmt.types.Rule; +import com.auth0.client.mgmt.types.UpdateRuleRequestContent; +import com.auth0.client.mgmt.types.UpdateRuleResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRulesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRulesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture>> list() { + return list(ListRulesRequestParameters.builder().build()); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture>> list( + ListRulesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture>> list( + ListRulesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRulesOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRulesOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListRulesRequestParameters nextRequest = ListRulesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRules().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CompletableFuture> create( + CreateRuleRequestContent request) { + return create(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CompletableFuture> create( + CreateRuleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateRuleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> get(String id) { + return get(id, GetRuleRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> get( + String id, GetRuleRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture> get( + String id, GetRuleRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetRuleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a rule. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a rule. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update an existing rule. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateRuleRequestContent.builder().build()); + } + + /** + * Update an existing rule. + */ + public CompletableFuture> update( + String id, UpdateRuleRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing rule. + */ + public CompletableFuture> update( + String id, UpdateRuleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRuleResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRulesConfigsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesConfigsClient.java new file mode 100644 index 000000000..8e748ce1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesConfigsClient.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.RulesConfig; +import com.auth0.client.mgmt.types.SetRulesConfigRequestContent; +import com.auth0.client.mgmt.types.SetRulesConfigResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRulesConfigsClient { + protected final ClientOptions clientOptions; + + public AsyncRawRulesConfigsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Sets a rules config variable. + */ + public CompletableFuture> set( + String key, SetRulesConfigRequestContent request) { + return set(key, request, null); + } + + /** + * Sets a rules config variable. + */ + public CompletableFuture> set( + String key, SetRulesConfigRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .addPathSegment(key) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetRulesConfigResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a rules config variable identified by its key. + */ + public CompletableFuture> delete(String key) { + return delete(key, null); + } + + /** + * Delete a rules config variable identified by its key. + */ + public CompletableFuture> delete(String key, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .addPathSegment(key) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java new file mode 100644 index 000000000..301e66a21 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java @@ -0,0 +1,556 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.GetSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesRequestParameters; +import com.auth0.client.mgmt.types.SelfServiceProfile; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSelfServiceProfilesClient { + protected final ClientOptions clientOptions; + + public AsyncRawSelfServiceProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture>> list() { + return list(ListSelfServiceProfilesRequestParameters.builder().build()); + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture>> list( + ListSelfServiceProfilesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture>> list( + ListSelfServiceProfilesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListSelfServiceProfilesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListSelfServiceProfilesPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListSelfServiceProfilesRequestParameters nextRequest = + ListSelfServiceProfilesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getSelfServiceProfiles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a self-service profile. + */ + public CompletableFuture> create( + CreateSelfServiceProfileRequestContent request) { + return create(request, null); + } + + /** + * Creates a self-service profile. + */ + public CompletableFuture> create( + CreateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateSelfServiceProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves a self-service profile by Id. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieves a self-service profile by Id. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSelfServiceProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes a self-service profile by Id. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Deletes a self-service profile by Id. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateSelfServiceProfileRequestContent.builder().build()); + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture> update( + String id, UpdateSelfServiceProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture> update( + String id, UpdateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSelfServiceProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawSessionsClient.java new file mode 100644 index 000000000..e33e2300a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawSessionsClient.java @@ -0,0 +1,285 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSessionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve session information. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve session information. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSessionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a session by ID. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a session by ID. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public CompletableFuture> revoke(String id) { + return revoke(id, null); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public CompletableFuture> revoke(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java new file mode 100644 index 000000000..d5e39b46c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DailyStats; +import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawStatsClient { + protected final ClientOptions clientOptions; + + public AsyncRawStatsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public CompletableFuture> getActiveUsersCount() { + return getActiveUsersCount(null); + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public CompletableFuture> getActiveUsersCount(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("stats/active-users") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, double.class), response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture>> getDaily() { + return getDaily(GetDailyStatsRequestParameters.builder().build()); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture>> getDaily( + GetDailyStatsRequestParameters request) { + return getDaily(request, null); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture>> getDaily( + GetDailyStatsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("stats/daily"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawSupplementalSignalsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawSupplementalSignalsClient.java new file mode 100644 index 000000000..c2336bc33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawSupplementalSignalsClient.java @@ -0,0 +1,215 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.PatchSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.UpdateSupplementalSignalsRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSupplementalSignalsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSupplementalSignalsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("supplemental-signals") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSupplementalSignalsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public CompletableFuture> patch( + UpdateSupplementalSignalsRequestContent request) { + return patch(request, null); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public CompletableFuture> patch( + UpdateSupplementalSignalsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("supplemental-signals") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PatchSupplementalSignalsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawTicketsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawTicketsClient.java new file mode 100644 index 000000000..10e1c2b1f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawTicketsClient.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ChangePasswordTicketRequestContent; +import com.auth0.client.mgmt.types.ChangePasswordTicketResponseContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketRequestContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTicketsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public CompletableFuture> verifyEmail( + VerifyEmailTicketRequestContent request) { + return verifyEmail(request, null); + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public CompletableFuture> verifyEmail( + VerifyEmailTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tickets/email-verification") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, VerifyEmailTicketResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture> changePassword() { + return changePassword(ChangePasswordTicketRequestContent.builder().build()); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture> changePassword( + ChangePasswordTicketRequestContent request) { + return changePassword(request, null); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture> changePassword( + ChangePasswordTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tickets/password-change") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ChangePasswordTicketResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java new file mode 100644 index 000000000..df2565f7c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java @@ -0,0 +1,541 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.GetTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.ListTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfilesListRequest; +import com.auth0.client.mgmt.types.UpdateTokenExchangeProfileRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTokenExchangeProfilesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTokenExchangeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> + list() { + return list(TokenExchangeProfilesListRequest.builder().build()); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + TokenExchangeProfilesListRequest request) { + return list(request, null); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + TokenExchangeProfilesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListTokenExchangeProfileResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListTokenExchangeProfileResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + TokenExchangeProfilesListRequest nextRequest = TokenExchangeProfilesListRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTokenExchangeProfiles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CompletableFuture> create( + CreateTokenExchangeProfileRequestContent request) { + return create(request, null); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CompletableFuture> create( + CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateTokenExchangeProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetTokenExchangeProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateTokenExchangeProfileRequestContent.builder().build()); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture> update( + String id, UpdateTokenExchangeProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture> update( + String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java new file mode 100644 index 000000000..de09e52d8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; +import com.auth0.client.mgmt.types.ListUserBlocksRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUserBlocksClient { + protected final ClientOptions clientOptions; + + public AsyncRawUserBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public CompletableFuture> listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request) { + return listByIdentifier(request, null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public CompletableFuture> listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks"); + QueryStringMapper.addQueryParameter(httpUrl, "identifier", request.getIdentifier(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserBlocksByIdentifierResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture> deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters request) { + return deleteByIdentifier(request, null); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture> deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks"); + QueryStringMapper.addQueryParameter(httpUrl, "identifier", request.getIdentifier(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture> list(String id) { + return list(id, ListUserBlocksRequestParameters.builder().build()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture> list( + String id, ListUserBlocksRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture> list( + String id, ListUserBlocksRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks") + .addPathSegment(id); + QueryStringMapper.addQueryParameter( + httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserBlocksResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUserGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUserGrantsClient.java new file mode 100644 index 000000000..d17cc4936 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUserGrantsClient.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; +import com.auth0.client.mgmt.types.ListUserGrantsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; +import com.auth0.client.mgmt.types.UserGrant; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUserGrantsClient { + protected final ClientOptions clientOptions; + + public AsyncRawUserGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture>> list() { + return list(ListUserGrantsRequestParameters.builder().build()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture>> list( + ListUserGrantsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture>> list( + ListUserGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserGrantsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserGrantsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserGrantsRequestParameters nextRequest = ListUserGrantsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getGrants().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture> deleteByUserId( + DeleteUserGrantByUserIdRequestParameters request) { + return deleteByUserId(request, null); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture> deleteByUserId( + DeleteUserGrantByUserIdRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants"); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java new file mode 100644 index 000000000..37e631f1e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java @@ -0,0 +1,1043 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.ServiceUnavailableError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.GetUserRequestParameters; +import com.auth0.client.mgmt.types.GetUserResponseContent; +import com.auth0.client.mgmt.types.ListUsersByEmailRequestParameters; +import com.auth0.client.mgmt.types.ListUsersOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; +import com.auth0.client.mgmt.types.RegenerateUsersRecoveryCodeResponseContent; +import com.auth0.client.mgmt.types.RevokeUserAccessRequestContent; +import com.auth0.client.mgmt.types.UpdateUserRequestContent; +import com.auth0.client.mgmt.types.UpdateUserResponseContent; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture>> list() { + return list(ListUsersRequestParameters.builder().build()); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture>> list( + ListUsersRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture>> list( + ListUsersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "connection", request.getConnection(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + QueryStringMapper.addQueryParameter(httpUrl, "search_engine", request.getSearchEngine(), false); + QueryStringMapper.addQueryParameter(httpUrl, "primary_order", request.getPrimaryOrder(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUsersOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUsersOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUsersRequestParameters nextRequest = ListUsersRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getUsers().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CompletableFuture> create( + CreateUserRequestContent request) { + return create(request, null); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CompletableFuture> create( + CreateUserRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateUserResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public CompletableFuture>> listUsersByEmail( + ListUsersByEmailRequestParameters request) { + return listUsersByEmail(request, null); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public CompletableFuture>> listUsersByEmail( + ListUsersByEmailRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users-by-email"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture> get(String id) { + return get(id, GetUserRequestParameters.builder().build()); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture> get( + String id, GetUserRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture> get( + String id, GetUserRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetUserResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture> update(String id) { + return update(id, UpdateUserRequestContent.builder().build()); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture> update( + String id, UpdateUserRequestContent request) { + return update(id, request, null); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture> update( + String id, UpdateUserRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateUserResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public CompletableFuture> + regenerateRecoveryCode(String id) { + return regenerateRecoveryCode(id, null); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public CompletableFuture> + regenerateRecoveryCode(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("recovery-code-regeneration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RegenerateUsersRecoveryCodeResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture> revokeAccess(String id) { + return revokeAccess(id, RevokeUserAccessRequestContent.builder().build()); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture> revokeAccess( + String id, RevokeUserAccessRequestContent request) { + return revokeAccess(id, request, null); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture> revokeAccess( + String id, RevokeUserAccessRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("revoke-access") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java new file mode 100644 index 000000000..89c3ee0e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncRefreshTokensClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRefreshTokensClient rawClient; + + public AsyncRefreshTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRefreshTokensClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRefreshTokensClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve refresh token information. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve refresh token information. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a refresh token by its ID. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a refresh token by its ID. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java new file mode 100644 index 000000000..accaa9fc0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; +import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; +import com.auth0.client.mgmt.types.GetResourceServerRequestParameters; +import com.auth0.client.mgmt.types.GetResourceServerResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerRequestParameters; +import com.auth0.client.mgmt.types.ResourceServer; +import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; +import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncResourceServersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawResourceServersClient rawClient; + + public AsyncResourceServersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawResourceServersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawResourceServersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture> list(ListResourceServerRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public CompletableFuture> list( + ListResourceServerRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CompletableFuture create(CreateResourceServerRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CompletableFuture create( + CreateResourceServerRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture get( + String id, GetResourceServerRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public CompletableFuture get( + String id, GetResourceServerRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture update( + String id, UpdateResourceServerRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public CompletableFuture update( + String id, UpdateResourceServerRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java new file mode 100644 index 000000000..ee391ea85 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.AsyncPermissionsClient; +import com.auth0.client.mgmt.roles.AsyncUsersClient; +import com.auth0.client.mgmt.types.CreateRoleRequestContent; +import com.auth0.client.mgmt.types.CreateRoleResponseContent; +import com.auth0.client.mgmt.types.GetRoleResponseContent; +import com.auth0.client.mgmt.types.ListRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.UpdateRoleRequestContent; +import com.auth0.client.mgmt.types.UpdateRoleResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncRolesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRolesClient rawClient; + + protected final Supplier permissionsClient; + + protected final Supplier usersClient; + + public AsyncRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRolesClient(clientOptions); + this.permissionsClient = Suppliers.memoize(() -> new AsyncPermissionsClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture> list(ListRolesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public CompletableFuture> list( + ListRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CompletableFuture create(CreateRoleRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CompletableFuture create( + CreateRoleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture update(String id, UpdateRoleRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public CompletableFuture update( + String id, UpdateRoleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncPermissionsClient permissions() { + return this.permissionsClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRulesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRulesClient.java new file mode 100644 index 000000000..1fa40c455 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRulesClient.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRuleRequestContent; +import com.auth0.client.mgmt.types.CreateRuleResponseContent; +import com.auth0.client.mgmt.types.GetRuleRequestParameters; +import com.auth0.client.mgmt.types.GetRuleResponseContent; +import com.auth0.client.mgmt.types.ListRulesRequestParameters; +import com.auth0.client.mgmt.types.Rule; +import com.auth0.client.mgmt.types.UpdateRuleRequestContent; +import com.auth0.client.mgmt.types.UpdateRuleResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncRulesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRulesClient rawClient; + + public AsyncRulesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRulesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRulesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture> list(ListRulesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public CompletableFuture> list( + ListRulesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CompletableFuture create(CreateRuleRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CompletableFuture create( + CreateRuleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture get(String id, GetRuleRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public CompletableFuture get( + String id, GetRuleRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a rule. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a rule. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update an existing rule. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update an existing rule. + */ + public CompletableFuture update(String id, UpdateRuleRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update an existing rule. + */ + public CompletableFuture update( + String id, UpdateRuleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRulesConfigsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRulesConfigsClient.java new file mode 100644 index 000000000..65d9d3c51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRulesConfigsClient.java @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.RulesConfig; +import com.auth0.client.mgmt.types.SetRulesConfigRequestContent; +import com.auth0.client.mgmt.types.SetRulesConfigResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncRulesConfigsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRulesConfigsClient rawClient; + + public AsyncRulesConfigsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRulesConfigsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRulesConfigsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Sets a rules config variable. + */ + public CompletableFuture set(String key, SetRulesConfigRequestContent request) { + return this.rawClient.set(key, request).thenApply(response -> response.body()); + } + + /** + * Sets a rules config variable. + */ + public CompletableFuture set( + String key, SetRulesConfigRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(key, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a rules config variable identified by its key. + */ + public CompletableFuture delete(String key) { + return this.rawClient.delete(key).thenApply(response -> response.body()); + } + + /** + * Delete a rules config variable identified by its key. + */ + public CompletableFuture delete(String key, RequestOptions requestOptions) { + return this.rawClient.delete(key, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncSelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncSelfServiceProfilesClient.java new file mode 100644 index 000000000..a90876d0d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncSelfServiceProfilesClient.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.selfserviceprofiles.AsyncCustomTextClient; +import com.auth0.client.mgmt.selfserviceprofiles.AsyncSsoTicketClient; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.GetSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesRequestParameters; +import com.auth0.client.mgmt.types.SelfServiceProfile; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncSelfServiceProfilesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSelfServiceProfilesClient rawClient; + + protected final Supplier customTextClient; + + protected final Supplier ssoTicketClient; + + public AsyncSelfServiceProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSelfServiceProfilesClient(clientOptions); + this.customTextClient = Suppliers.memoize(() -> new AsyncCustomTextClient(clientOptions)); + this.ssoTicketClient = Suppliers.memoize(() -> new AsyncSsoTicketClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSelfServiceProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture> list( + ListSelfServiceProfilesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieves self-service profiles. + */ + public CompletableFuture> list( + ListSelfServiceProfilesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a self-service profile. + */ + public CompletableFuture create( + CreateSelfServiceProfileRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a self-service profile. + */ + public CompletableFuture create( + CreateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves a self-service profile by Id. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieves a self-service profile by Id. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes a self-service profile by Id. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Deletes a self-service profile by Id. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture update( + String id, UpdateSelfServiceProfileRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a self-service profile. + */ + public CompletableFuture update( + String id, UpdateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncCustomTextClient customText() { + return this.customTextClient.get(); + } + + public AsyncSsoTicketClient ssoTicket() { + return this.ssoTicketClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java new file mode 100644 index 000000000..249462cbf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSessionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSessionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSessionsClient rawClient; + + public AsyncSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve session information. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve session information. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a session by ID. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a session by ID. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public CompletableFuture revoke(String id) { + return this.rawClient.revoke(id).thenApply(response -> response.body()); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public CompletableFuture revoke(String id, RequestOptions requestOptions) { + return this.rawClient.revoke(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncStatsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncStatsClient.java new file mode 100644 index 000000000..2104cba7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncStatsClient.java @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DailyStats; +import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncStatsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawStatsClient rawClient; + + public AsyncStatsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawStatsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawStatsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public CompletableFuture getActiveUsersCount() { + return this.rawClient.getActiveUsersCount().thenApply(response -> response.body()); + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public CompletableFuture getActiveUsersCount(RequestOptions requestOptions) { + return this.rawClient.getActiveUsersCount(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture> getDaily() { + return this.rawClient.getDaily().thenApply(response -> response.body()); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture> getDaily(GetDailyStatsRequestParameters request) { + return this.rawClient.getDaily(request).thenApply(response -> response.body()); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public CompletableFuture> getDaily( + GetDailyStatsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.getDaily(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncSupplementalSignalsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncSupplementalSignalsClient.java new file mode 100644 index 000000000..b4e20c250 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncSupplementalSignalsClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.PatchSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.UpdateSupplementalSignalsRequestContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSupplementalSignalsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSupplementalSignalsClient rawClient; + + public AsyncSupplementalSignalsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSupplementalSignalsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSupplementalSignalsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public CompletableFuture patch( + UpdateSupplementalSignalsRequestContent request) { + return this.rawClient.patch(request).thenApply(response -> response.body()); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public CompletableFuture patch( + UpdateSupplementalSignalsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.patch(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncTicketsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncTicketsClient.java new file mode 100644 index 000000000..17fd197e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncTicketsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ChangePasswordTicketRequestContent; +import com.auth0.client.mgmt.types.ChangePasswordTicketResponseContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketRequestContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncTicketsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTicketsClient rawClient; + + public AsyncTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTicketsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTicketsClient withRawResponse() { + return this.rawClient; + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public CompletableFuture verifyEmail(VerifyEmailTicketRequestContent request) { + return this.rawClient.verifyEmail(request).thenApply(response -> response.body()); + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public CompletableFuture verifyEmail( + VerifyEmailTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.verifyEmail(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture changePassword() { + return this.rawClient.changePassword().thenApply(response -> response.body()); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture changePassword( + ChangePasswordTicketRequestContent request) { + return this.rawClient.changePassword(request).thenApply(response -> response.body()); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public CompletableFuture changePassword( + ChangePasswordTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.changePassword(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java new file mode 100644 index 000000000..197d72827 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.GetTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfilesListRequest; +import com.auth0.client.mgmt.types.UpdateTokenExchangeProfileRequestContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncTokenExchangeProfilesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTokenExchangeProfilesClient rawClient; + + public AsyncTokenExchangeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTokenExchangeProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTokenExchangeProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list( + TokenExchangeProfilesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list( + TokenExchangeProfilesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CompletableFuture create( + CreateTokenExchangeProfileRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CompletableFuture create( + CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture update(String id, UpdateTokenExchangeProfileRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public CompletableFuture update( + String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUserBlocksClient.java new file mode 100644 index 000000000..1b1c7b9d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncUserBlocksClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; +import com.auth0.client.mgmt.types.ListUserBlocksRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncUserBlocksClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUserBlocksClient rawClient; + + public AsyncUserBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUserBlocksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUserBlocksClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public CompletableFuture listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request) { + return this.rawClient.listByIdentifier(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public CompletableFuture listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.listByIdentifier(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture deleteByIdentifier(DeleteUserBlocksByIdentifierRequestParameters request) { + return this.rawClient.deleteByIdentifier(request).thenApply(response -> response.body()); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.deleteByIdentifier(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture list(String id, ListUserBlocksRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public CompletableFuture list( + String id, ListUserBlocksRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUserGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUserGrantsClient.java new file mode 100644 index 000000000..3a3e21bf0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncUserGrantsClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; +import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; +import com.auth0.client.mgmt.types.UserGrant; +import java.util.concurrent.CompletableFuture; + +public class AsyncUserGrantsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUserGrantsClient rawClient; + + public AsyncUserGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUserGrantsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUserGrantsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture> list(ListUserGrantsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public CompletableFuture> list( + ListUserGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture deleteByUserId(DeleteUserGrantByUserIdRequestParameters request) { + return this.rawClient.deleteByUserId(request).thenApply(response -> response.body()); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture deleteByUserId( + DeleteUserGrantByUserIdRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.deleteByUserId(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a grant associated with your account. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java new file mode 100644 index 000000000..3aa9a841b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java @@ -0,0 +1,504 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.GetUserRequestParameters; +import com.auth0.client.mgmt.types.GetUserResponseContent; +import com.auth0.client.mgmt.types.ListUsersByEmailRequestParameters; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; +import com.auth0.client.mgmt.types.RegenerateUsersRecoveryCodeResponseContent; +import com.auth0.client.mgmt.types.RevokeUserAccessRequestContent; +import com.auth0.client.mgmt.types.UpdateUserRequestContent; +import com.auth0.client.mgmt.types.UpdateUserResponseContent; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.users.AsyncAuthenticationMethodsClient; +import com.auth0.client.mgmt.users.AsyncAuthenticatorsClient; +import com.auth0.client.mgmt.users.AsyncEnrollmentsClient; +import com.auth0.client.mgmt.users.AsyncFederatedConnectionsTokensetsClient; +import com.auth0.client.mgmt.users.AsyncIdentitiesClient; +import com.auth0.client.mgmt.users.AsyncLogsClient; +import com.auth0.client.mgmt.users.AsyncMultifactorClient; +import com.auth0.client.mgmt.users.AsyncOrganizationsClient; +import com.auth0.client.mgmt.users.AsyncPermissionsClient; +import com.auth0.client.mgmt.users.AsyncRefreshTokenClient; +import com.auth0.client.mgmt.users.AsyncRolesClient; +import com.auth0.client.mgmt.users.AsyncSessionsClient; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + protected final Supplier authenticationMethodsClient; + + protected final Supplier authenticatorsClient; + + protected final Supplier enrollmentsClient; + + protected final Supplier federatedConnectionsTokensetsClient; + + protected final Supplier identitiesClient; + + protected final Supplier logsClient; + + protected final Supplier multifactorClient; + + protected final Supplier organizationsClient; + + protected final Supplier permissionsClient; + + protected final Supplier rolesClient; + + protected final Supplier refreshTokenClient; + + protected final Supplier sessionsClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + this.authenticationMethodsClient = Suppliers.memoize(() -> new AsyncAuthenticationMethodsClient(clientOptions)); + this.authenticatorsClient = Suppliers.memoize(() -> new AsyncAuthenticatorsClient(clientOptions)); + this.enrollmentsClient = Suppliers.memoize(() -> new AsyncEnrollmentsClient(clientOptions)); + this.federatedConnectionsTokensetsClient = + Suppliers.memoize(() -> new AsyncFederatedConnectionsTokensetsClient(clientOptions)); + this.identitiesClient = Suppliers.memoize(() -> new AsyncIdentitiesClient(clientOptions)); + this.logsClient = Suppliers.memoize(() -> new AsyncLogsClient(clientOptions)); + this.multifactorClient = Suppliers.memoize(() -> new AsyncMultifactorClient(clientOptions)); + this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); + this.permissionsClient = Suppliers.memoize(() -> new AsyncPermissionsClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); + this.refreshTokenClient = Suppliers.memoize(() -> new AsyncRefreshTokenClient(clientOptions)); + this.sessionsClient = Suppliers.memoize(() -> new AsyncSessionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture> list(ListUsersRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public CompletableFuture> list( + ListUsersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CompletableFuture create(CreateUserRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CompletableFuture create( + CreateUserRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public CompletableFuture> listUsersByEmail(ListUsersByEmailRequestParameters request) { + return this.rawClient.listUsersByEmail(request).thenApply(response -> response.body()); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public CompletableFuture> listUsersByEmail( + ListUsersByEmailRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.listUsersByEmail(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture get(String id, GetUserRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public CompletableFuture get( + String id, GetUserRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture update(String id, UpdateUserRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public CompletableFuture update( + String id, UpdateUserRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public CompletableFuture regenerateRecoveryCode(String id) { + return this.rawClient.regenerateRecoveryCode(id).thenApply(response -> response.body()); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public CompletableFuture regenerateRecoveryCode( + String id, RequestOptions requestOptions) { + return this.rawClient.regenerateRecoveryCode(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture revokeAccess(String id) { + return this.rawClient.revokeAccess(id).thenApply(response -> response.body()); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture revokeAccess(String id, RevokeUserAccessRequestContent request) { + return this.rawClient.revokeAccess(id, request).thenApply(response -> response.body()); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public CompletableFuture revokeAccess( + String id, RevokeUserAccessRequestContent request, RequestOptions requestOptions) { + return this.rawClient.revokeAccess(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncAuthenticationMethodsClient authenticationMethods() { + return this.authenticationMethodsClient.get(); + } + + public AsyncAuthenticatorsClient authenticators() { + return this.authenticatorsClient.get(); + } + + public AsyncEnrollmentsClient enrollments() { + return this.enrollmentsClient.get(); + } + + public AsyncFederatedConnectionsTokensetsClient federatedConnectionsTokensets() { + return this.federatedConnectionsTokensetsClient.get(); + } + + public AsyncIdentitiesClient identities() { + return this.identitiesClient.get(); + } + + public AsyncLogsClient logs() { + return this.logsClient.get(); + } + + public AsyncMultifactorClient multifactor() { + return this.multifactorClient.get(); + } + + public AsyncOrganizationsClient organizations() { + return this.organizationsClient.get(); + } + + public AsyncPermissionsClient permissions() { + return this.permissionsClient.get(); + } + + public AsyncRolesClient roles() { + return this.rolesClient.get(); + } + + public AsyncRefreshTokenClient refreshToken() { + return this.refreshTokenClient.get(); + } + + public AsyncSessionsClient sessions() { + return this.sessionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AttackProtectionEntity.java b/src/main/java/com/auth0/client/mgmt/AttackProtectionEntity.java deleted file mode 100644 index ee96a1ad9..000000000 --- a/src/main/java/com/auth0/client/mgmt/AttackProtectionEntity.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.attackprotection.BreachedPassword; -import com.auth0.json.mgmt.attackprotection.BruteForceConfiguration; -import com.auth0.json.mgmt.attackprotection.SuspiciousIPThrottlingConfiguration; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Attack Protection methods of the Management API as defined in - * @see ManagementAPI - */ -public class AttackProtectionEntity extends BaseManagementEntity { - AttackProtectionEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Gets the breached password detection settings. - * @return the breached password detection settings. - * @see - */ - public Request getBreachedPasswordSettings() { - return request( - HttpMethod.GET, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/breached-password-detection") - - ); - } - - /** - * Update the breached password detection settings. - * @param breachedPassword the updated breached password detection settings. - * @return the updated breached password detection settings. - * @see - */ - public Request updateBreachedPasswordSettings(BreachedPassword breachedPassword) { - Asserts.assertNotNull(breachedPassword, "breached password"); - - return request( - HttpMethod.PATCH, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/breached-password-detection") - .withBody(breachedPassword) - ); - } - - /** - * Gets the brute force configuration - * @return the brute force configuration - * @see - */ - public Request getBruteForceConfiguration() { - return request( - HttpMethod.GET, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/brute-force-protection") - ); - } - - /** - * Update the brute force configuration - * @param configuration the updated brute force configuration - * @return the updated brute force configuration - * @see - */ - public Request updateBruteForceConfiguration(BruteForceConfiguration configuration) { - Asserts.assertNotNull(configuration, "configuration"); - - return request( - HttpMethod.PATCH, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/brute-force-protection") - .withBody(configuration) - ); - } - - /** - * Gets the suspicious IP throttling configuration - * @return the suspicious IP throttling configuration - * @see - */ - public Request getSuspiciousIPThrottlingConfiguration() { - return request( - HttpMethod.GET, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/suspicious-ip-throttling") - ); - } - - /** - * Update the suspicious IP throttling configuration - * @param configuration the updated suspicious IP throttling configuration - * @return the updated suspicious IP throttling configuration - * @see - */ - public Request updateSuspiciousIPThrottlingConfiguration(SuspiciousIPThrottlingConfiguration configuration) { - Asserts.assertNotNull(configuration, "configuration"); - - return request( - HttpMethod.PATCH, - new TypeReference() {}, - (builder) -> builder - .withPathSegments("api/v2/attack-protection/suspicious-ip-throttling") - .withBody(configuration) - ); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/BaseManagementEntity.java b/src/main/java/com/auth0/client/mgmt/BaseManagementEntity.java deleted file mode 100644 index 0ee987e59..000000000 --- a/src/main/java/com/auth0/client/mgmt/BaseManagementEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.function.Consumer; - -abstract class BaseManagementEntity { - protected final Auth0HttpClient client; - protected final HttpUrl baseUrl; - protected final TokenProvider tokenProvider; - - BaseManagementEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - this.client = client; - this.baseUrl = baseUrl; - this.tokenProvider = tokenProvider; - } - - protected Request voidRequest(HttpMethod method, Consumer> customizer) { - return customizeRequest( - new RequestBuilder<>(client, tokenProvider, method, baseUrl, new TypeReference() { - }), - customizer - ); - } - - protected Request request(HttpMethod method, TypeReference target, Consumer> customizer) { - return customizeRequest( - new RequestBuilder<>(client, tokenProvider, method, baseUrl, target), - customizer - ); - } - - private Request customizeRequest(RequestBuilder builder, Consumer> customizer) { - customizer.accept(builder); - return builder.build(); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/BlacklistsEntity.java b/src/main/java/com/auth0/client/mgmt/BlacklistsEntity.java deleted file mode 100644 index 6ae2e20b6..000000000 --- a/src/main/java/com/auth0/client/mgmt/BlacklistsEntity.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.blacklists.Token; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; - -/** - * Class that provides an implementation of the Blacklists methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Blacklists - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class BlacklistsEntity extends BaseManagementEntity { - - BlacklistsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Blacklisted Tokens with a given audience. A token with scope blacklist:tokens is needed. - * See https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens. - * - * @param audience the token audience (aud). - * @return a Request to execute. - */ - public Request> getBlacklist(String audience) { - Asserts.assertNotNull(audience, "audience"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/blacklists/tokens") - .addQueryParameter("aud", audience) - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Add a Token to the Blacklist. A token with scope blacklist:tokens is needed. - * See https://auth0.com/docs/api/management/v2#!/Blacklists/post_tokens. - * - * @param token the token to blacklist. - * @return a Request to execute. - */ - public Request blacklistToken(Token token) { - Asserts.assertNotNull(token, "token"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/blacklists/tokens") - .build() - .toString(); - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.POST); - request.setBody(token); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/BrandingClient.java b/src/main/java/com/auth0/client/mgmt/BrandingClient.java new file mode 100644 index 000000000..90b5792f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/BrandingClient.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.branding.TemplatesClient; +import com.auth0.client.mgmt.branding.ThemesClient; +import com.auth0.client.mgmt.branding.phone.PhoneClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.GetBrandingResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingRequestContent; +import com.auth0.client.mgmt.types.UpdateBrandingResponseContent; +import java.util.function.Supplier; + +public class BrandingClient { + protected final ClientOptions clientOptions; + + private final RawBrandingClient rawClient; + + protected final Supplier templatesClient; + + protected final Supplier themesClient; + + protected final Supplier phoneClient; + + public BrandingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBrandingClient(clientOptions); + this.templatesClient = Suppliers.memoize(() -> new TemplatesClient(clientOptions)); + this.themesClient = Suppliers.memoize(() -> new ThemesClient(clientOptions)); + this.phoneClient = Suppliers.memoize(() -> new PhoneClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBrandingClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve branding settings. + */ + public GetBrandingResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve branding settings. + */ + public GetBrandingResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update branding settings. + */ + public UpdateBrandingResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update branding settings. + */ + public UpdateBrandingResponseContent update(UpdateBrandingRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update branding settings. + */ + public UpdateBrandingResponseContent update(UpdateBrandingRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } + + public TemplatesClient templates() { + return this.templatesClient.get(); + } + + public ThemesClient themes() { + return this.themesClient.get(); + } + + public PhoneClient phone() { + return this.phoneClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/BrandingEntity.java b/src/main/java/com/auth0/client/mgmt/BrandingEntity.java deleted file mode 100644 index 5ed229be5..000000000 --- a/src/main/java/com/auth0/client/mgmt/BrandingEntity.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.branding.BrandingSettings; -import com.auth0.json.mgmt.branding.UniversalLoginTemplate; -import com.auth0.json.mgmt.branding.UniversalLoginTemplateUpdate; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Branding methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Branding - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class BrandingEntity extends BaseManagementEntity { - - BrandingEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Requests the branding settings for this tenant. - * See https://auth0.com/docs/api/management/v2#!/Branding/get_branding - * - * @return a Request to execute. - */ - public Request getBrandingSettings() { - return request( - HttpMethod.GET, - new TypeReference() { - }, - (builder) -> builder.withPathSegments("api/v2/branding") - ); - } - - /** - * Update the branding settings for this tenant. - * See https://auth0.com/docs/api/management/v2#!/Branding/patch_branding - * - * @param settings the new branding settings. - * @return a Request to execute. - */ - public Request updateBrandingSettings(BrandingSettings settings) { - Asserts.assertNotNull(settings, "settings"); - - return request( - HttpMethod.PATCH, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/branding") - .withBody(settings) - ); - } - - - /** - * Gets the template for the universal login page. - * See https://auth0.com/docs/api/management/v2#!/Branding/get_universal_login - * - * @return a Request to execute. - */ - public Request getUniversalLoginTemplate() { - return request( - HttpMethod.GET, - new TypeReference() { - }, - (builder) -> builder.withPathSegments("api/v2/branding/templates/universal-login") - ); - } - - /** - * Delete the template for the universal login page. - * See https://auth0.com/docs/api/management/v2#!/Branding/delete_universal_login - * - * @return a Request to execute. - */ - public Request deleteUniversalLoginTemplate() { - return voidRequest( - HttpMethod.DELETE, - (builder) -> builder.withPathSegments("api/v2/branding/templates/universal-login") - ); - } - - /** - * Sets the template for the universal login page. - * See https://auth0.com/docs/api/management/v2#!/Branding/put_universal_login - * - * @return a Request to execute. - */ - public Request setUniversalLoginTemplate(UniversalLoginTemplateUpdate template) { - Asserts.assertNotNull(template, "template"); - - return voidRequest( - HttpMethod.PUT, - (builder) -> builder - .withPathSegments("api/v2/branding/templates/universal-login") - .withBody(template) - ); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java new file mode 100644 index 000000000..dbc5aa1ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clientgrants.OrganizationsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; +import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.UpdateClientGrantRequestContent; +import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; +import java.util.function.Supplier; + +public class ClientGrantsClient { + protected final ClientOptions clientOptions; + + private final RawClientGrantsClient rawClient; + + protected final Supplier organizationsClient; + + public ClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawClientGrantsClient(clientOptions); + this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawClientGrantsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public SyncPagingIterable list(ListClientGrantsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public SyncPagingIterable list( + ListClientGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CreateClientGrantResponseContent create(CreateClientGrantRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CreateClientGrantResponseContent create( + CreateClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a client grant. + */ + public UpdateClientGrantResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a client grant. + */ + public UpdateClientGrantResponseContent update(String id, UpdateClientGrantRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a client grant. + */ + public UpdateClientGrantResponseContent update( + String id, UpdateClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public OrganizationsClient organizations() { + return this.organizationsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java b/src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java deleted file mode 100644 index 99fd5f011..000000000 --- a/src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ClientGrantsFilter; -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.json.mgmt.clientgrants.ClientGrant; -import com.auth0.json.mgmt.clientgrants.ClientGrantsPage; -import com.auth0.json.mgmt.organizations.OrganizationsPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Client Grants methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Client_Grants - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class ClientGrantsEntity extends BaseManagementEntity { - - ClientGrantsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Client Grants. A token with scope read:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants - * - * @param filter the filter to use. Can be null - * @return a Request to execute. - */ - public Request list(ClientGrantsFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/client-grants"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a Client Grant. A token with scope create:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/post_client_grants - * - * @param clientId the application's client id to associate this grant with. - * @param audience the audience of the grant. - * @param scope the scope to grant. - * @return a Request to execute. - */ - public Request create(String clientId, String audience, String[] scope) { - return create(clientId, audience, scope, null, null); - } - - /** - * Create a Client Grant. A token with scope create:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/post_client_grants - * - * @param clientId the application's client id to associate this grant with. - * @param audience the audience of the grant. - * @param scope the scope to grant. - * @param orgUsage Defines whether organizations can be used with client credentials exchanges for this grant. (defaults to deny when not defined) - * @param allowAnyOrg If true, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. - * @return a Request to execute. - */ - public Request create(String clientId, String audience, String[] scope, String orgUsage, Boolean allowAnyOrg) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(audience, "audience"); - Asserts.assertNotNull(scope, "scope"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/client-grants") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.addParameter("client_id", clientId); - request.addParameter("audience", audience); - request.addParameter("scope", scope); - if (orgUsage != null && !orgUsage.trim().isEmpty()) { - request.addParameter("organization_usage", orgUsage); - } - if (allowAnyOrg != null) { - request.addParameter("allow_any_organization", allowAnyOrg); - } - return request; - } - - /** - * Delete an existing Client Grant. A token with scope delete:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/delete_client_grants_by_id - * - * @param clientGrantId the client grant id. - * @return a Request to execute. - */ - public Request delete(String clientGrantId) { - Asserts.assertNotNull(clientGrantId, "client grant id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/client-grants") - .addPathSegment(clientGrantId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Client Grant. A token with scope update:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/patch_client_grants_by_id - * - * @param clientGrantId the client grant id. - * @param scope the scope to grant. - * @return a Request to execute. - */ - public Request update(String clientGrantId, String[] scope) { - return update(clientGrantId, scope, null, null); - } - - /** - * Update an existing Client Grant. A token with scope update:client_grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Client_Grants/patch_client_grants_by_id - * - * @param clientGrantId the client grant id. - * @param scope the scope to grant. - * @param orgUsage Defines whether organizations can be used with client credentials exchanges for this grant. (defaults to deny when not defined) - * @param allowAnyOrg If true, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. - * @return a Request to execute. - */ - public Request update(String clientGrantId, String[] scope, String orgUsage, Boolean allowAnyOrg) { - Asserts.assertNotNull(clientGrantId, "client grant id"); - Asserts.assertNotNull(scope, "scope"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/client-grants") - .addPathSegment(clientGrantId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.addParameter("scope", scope); - if (orgUsage != null && !orgUsage.trim().isEmpty()) { - request.addParameter("organization_usage", orgUsage); - } - if (allowAnyOrg != null) { - request.addParameter("allow_any_organization", allowAnyOrg); - } - return request; - } - - /** - * Returns the organizations associated with this client grant. A token with scope {@code read:organization_client_grants} is required. - * @param clientGrantId the client grant ID. - * @param filter an optional filter to limit results. - * @return a request to execute. - */ - public Request listOrganizations(String clientGrantId, PageFilter filter) { - Asserts.assertNotNull(clientGrantId, "client grant ID"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/client-grants") - .addPathSegment(clientGrantId) - .addPathSegment("organizations"); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ClientsClient.java b/src/main/java/com/auth0/client/mgmt/ClientsClient.java new file mode 100644 index 000000000..2e8759ea3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ClientsClient.java @@ -0,0 +1,399 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clients.ConnectionsClient; +import com.auth0.client.mgmt.clients.CredentialsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Client; +import com.auth0.client.mgmt.types.CreateClientRequestContent; +import com.auth0.client.mgmt.types.CreateClientResponseContent; +import com.auth0.client.mgmt.types.GetClientRequestParameters; +import com.auth0.client.mgmt.types.GetClientResponseContent; +import com.auth0.client.mgmt.types.ListClientsRequestParameters; +import com.auth0.client.mgmt.types.RotateClientSecretResponseContent; +import com.auth0.client.mgmt.types.UpdateClientRequestContent; +import com.auth0.client.mgmt.types.UpdateClientResponseContent; +import java.util.function.Supplier; + +public class ClientsClient { + protected final ClientOptions clientOptions; + + private final RawClientsClient rawClient; + + protected final Supplier credentialsClient; + + protected final Supplier connectionsClient; + + public ClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawClientsClient(clientOptions); + this.credentialsClient = Suppliers.memoize(() -> new CredentialsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawClientsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public SyncPagingIterable list(ListClientsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public SyncPagingIterable list(ListClientsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CreateClientResponseContent create(CreateClientRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public CreateClientResponseContent create(CreateClientRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public GetClientResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public GetClientResponseContent get(String id, GetClientRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public GetClientResponseContent get(String id, GetClientRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public UpdateClientResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public UpdateClientResponseContent update(String id, UpdateClientRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public UpdateClientResponseContent update( + String id, UpdateClientRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public RotateClientSecretResponseContent rotateSecret(String id) { + return this.rawClient.rotateSecret(id).body(); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public RotateClientSecretResponseContent rotateSecret(String id, RequestOptions requestOptions) { + return this.rawClient.rotateSecret(id, requestOptions).body(); + } + + public CredentialsClient credentials() { + return this.credentialsClient.get(); + } + + public ConnectionsClient connections() { + return this.connectionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ClientsEntity.java b/src/main/java/com/auth0/client/mgmt/ClientsEntity.java deleted file mode 100644 index e44fab74c..000000000 --- a/src/main/java/com/auth0/client/mgmt/ClientsEntity.java +++ /dev/null @@ -1,296 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ClientFilter; -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.client.Client; -import com.auth0.json.mgmt.client.ClientsPage; -import com.auth0.json.mgmt.client.Credential; -import com.auth0.net.EmptyBodyRequest; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Application methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Clients - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class ClientsEntity extends BaseManagementEntity { - - ClientsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Applications. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope. - * See https://auth0.com/docs/api/management/v2#!/Clients/get_clients - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request list(ClientFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request an Application. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope. - * See https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id - * - * @param clientId the application's client id. - * @return a Request to execute. - */ - public Request get(String clientId) { - Asserts.assertNotNull(clientId, "client id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request an Application. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope. - * See https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id - * - * @param clientId the application's client id. - * @param filter optional filter to restrict fields (to be included/excluded in response) - * @return a Request to execute. - */ - public Request get(String clientId, FieldsFilter filter) { - Asserts.assertNotNull(clientId, "client id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a new Application. A token with scope create:clients is needed. - * See https://auth0.com/docs/api/management/v2#!/Clients/post_clients - * - * @param client the application data to set. - * @return a Request to execute. - */ - public Request create(Client client) { - Asserts.assertNotNull(client, "client"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(client); - return request; - } - - /** - * Delete an existing Application. A token with scope delete:clients is needed. - * See https://auth0.com/docs/api/management/v2#!/Clients/delete_clients_by_id - * - * @param clientId the application's client id. - * @return a Request to execute. - */ - public Request delete(String clientId) { - Asserts.assertNotNull(clientId, "client id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Application. A token with scope update:clients is needed. If you also need to update the client_secret and encryption_key attributes the token must have update:client_keys scope. - * See https://auth0.com/docs/api/management/v2#!/Clients/patch_clients_by_id - * - * @param clientId the application's client id. - * @param client the application data to set. - * @return a Request to execute. - */ - public Request update(String clientId, Client client) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(client, "client"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(client); - return request; - } - - /** - * Rotates an Application's client secret. A token with scope update:client_keys is needed. Note that the generated secret is NOT base64 encoded. - * See https://auth0.com/docs/api/management/v2#!/Clients/post_rotate_secret - * - * @param clientId the application's client id. - * @return a Request to execute. - */ - public Request rotateSecret(String clientId) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(client, "client"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("rotate-secret") - .build() - .toString(); - return new EmptyBodyRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } - - /** - * Creates an Application's client credential. A token with scope {@code create:client_credentials} is required. - * - * @param clientId the application's client id. - * @param credential the credential to create. - * @return a Request to execute. - */ - public Request createCredential(String clientId, Credential credential) { - Asserts.assertNotNull(clientId, "client id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("credentials") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(credential); - return request; - } - - /** - * Get the client credentials associated with this application. A token with scope {@code read:client_credentials} is required. - * @param clientId the ID of the application - * @return a request to execute. - */ - public Request> listCredentials(String clientId) { - Asserts.assertNotNull(clientId, "client id"); - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("credentials").build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Get a client credentials object. A token with scope {@code read:client_credentials} is required. - * @param clientId the ID of the application. - * @param credentialId the ID of the credential to retrieve. - * @return a request to execute. - */ - public Request getCredential(String clientId, String credentialId) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(credentialId, "credential id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("credentials") - .addPathSegment(credentialId) - .build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Deletes a client credential. A token with scope {@code } is required. - * @param clientId the ID of the application. - * @param credentialId the ID of the credential to delete - * @return a request to execute. - */ - public Request deleteCredential(String clientId, String credentialId) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(credentialId, "credential id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("credentials") - .addPathSegment(credentialId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing client credential. A token with scope update:client_credentials is needed. - * See https://auth0.com/docs/api/management/v2/clients/patch-credentials-by-credential-id - * - * @param clientId the application's client id. - * @param credentialId the ID of the credential. - * @param credential the credential to update. - * @return a Request to execute. - */ - public Request updateCredential(String clientId, String credentialId, Credential credential) { - Asserts.assertNotNull(clientId, "client id"); - Asserts.assertNotNull(credentialId, "credential id"); - Asserts.assertNotNull(credential, "credential"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/clients") - .addPathSegment(clientId) - .addPathSegment("credentials") - .addPathSegment(credentialId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(credential); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java new file mode 100644 index 000000000..e6117738f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.ClientsClient; +import com.auth0.client.mgmt.connections.KeysClient; +import com.auth0.client.mgmt.connections.ScimConfigurationClient; +import com.auth0.client.mgmt.connections.UsersClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.CreateConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionResponseContent; +import com.auth0.client.mgmt.types.GetConnectionRequestParameters; +import com.auth0.client.mgmt.types.GetConnectionResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsQueryParameters; +import com.auth0.client.mgmt.types.UpdateConnectionRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionResponseContent; +import java.util.function.Supplier; + +public class ConnectionsClient { + protected final ClientOptions clientOptions; + + private final RawConnectionsClient rawClient; + + protected final Supplier clientsClient; + + protected final Supplier keysClient; + + protected final Supplier scimConfigurationClient; + + protected final Supplier usersClient; + + public ConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectionsClient(clientOptions); + this.clientsClient = Suppliers.memoize(() -> new ClientsClient(clientOptions)); + this.keysClient = Suppliers.memoize(() -> new KeysClient(clientOptions)); + this.scimConfigurationClient = Suppliers.memoize(() -> new ScimConfigurationClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list(ListConnectionsQueryParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list( + ListConnectionsQueryParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CreateConnectionResponseContent create(CreateConnectionRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public CreateConnectionResponseContent create( + CreateConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public GetConnectionResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public GetConnectionResponseContent get(String id, GetConnectionRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public GetConnectionResponseContent get( + String id, GetConnectionRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public UpdateConnectionResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public UpdateConnectionResponseContent update(String id, UpdateConnectionRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public UpdateConnectionResponseContent update( + String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public void checkStatus(String id) { + this.rawClient.checkStatus(id).body(); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public void checkStatus(String id, RequestOptions requestOptions) { + this.rawClient.checkStatus(id, requestOptions).body(); + } + + public ClientsClient clients() { + return this.clientsClient.get(); + } + + public KeysClient keys() { + return this.keysClient.get(); + } + + public ScimConfigurationClient scimConfiguration() { + return this.scimConfigurationClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java b/src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java deleted file mode 100644 index 8e8a1b7c9..000000000 --- a/src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java +++ /dev/null @@ -1,466 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ConnectionFilter; -import com.auth0.client.mgmt.filter.EnabledClientsFilter; -import com.auth0.json.mgmt.connections.*; -import com.auth0.net.BaseRequest; -import com.auth0.net.EmptyBodyRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Connections methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Connections - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class ConnectionsEntity extends BaseManagementEntity { - - ConnectionsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - - /** - * Request all the ConnectionsEntity. A token with scope read:connections is needed. - * See https://auth0.com/docs/api/management/v2#!/Connections/get_connections - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request listAll(ConnectionFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - - /** - * Request a Connection. A token with scope read:connections is needed. - * See https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id - * - * @param connectionId the id of the connection to retrieve. - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request get(String connectionId, ConnectionFilter filter) { - Asserts.assertNotNull(connectionId, "connection id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a Connection. A token with scope create:connections is needed. - * See https://auth0.com/docs/api/management/v2#!/Connections/post_connections - * - * @param connection the connection data to set. - * @return a Request to execute. - */ - public Request create(Connection connection) { - Asserts.assertNotNull(connection, "connection"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(connection); - return request; - } - - /** - * Delete an existing Connection. A token with scope delete:connections is needed. - * See https://auth0.com/docs/api/management/v2#!/Connections/delete_connections_by_id - * - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request delete(String connectionId) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Connection. A token with scope update:connections is needed. Note that if the 'options' value is present it will override all the 'options' values that currently exist. - * See https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id - * - * @param connectionId the connection id. - * @param connection the connection data to set. It can't include name or strategy. - * @return a Request to execute. - */ - public Request update(String connectionId, Connection connection) { - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(connection, "connection"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(connection); - return request; - } - - /** - * Delete an existing User from the given Database Connection. A token with scope delete:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Connections/delete_users_by_email - * - * @param connectionId the connection id where the user is stored. - * @param email the email of the user to delete. - * @return a Request to execute. - */ - public Request deleteUser(String connectionId, String email) { - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(email, "email"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("users") - .addQueryParameter("email", email) - .build() - .toString(); - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Get the Connections Scim Configuration. - * A token with scope read:scim_config is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/get-scim-configuration - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request getScimConfiguration( String connectionId) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("scim-configuration") - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete the Connections Scim Configuration. - * A token with scope delete:scim_config is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/delete-scim-configuration - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request deleteScimConfiguration(String connectionId) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("scim-configuration") - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update the Connections Scim Configuration. - * A token with scope update:scim_config is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/patch-scim-configuration - * @param connectionId the connection id. - * @param scimConfigurationRequest the scim configuration request. - * @return a Request to execute. - */ - public Request updateScimConfiguration(String connectionId, ScimConfigurationRequest scimConfigurationRequest){ - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(scimConfigurationRequest, "scim configuration request"); - Asserts.assertNotNull(scimConfigurationRequest.getUserIdAttribute(), "user id attribute"); - Asserts.assertNotNull(scimConfigurationRequest.getMapping(), "mapping"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("scim-configuration") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(scimConfigurationRequest); - return request; - } - - /** - * Create the Connections Scim Configuration. - * A token with scope create:scim_config is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/post-scim-configuration - * @param connectionId the connection id. - * @param request the scim configuration request. - * @return a Request to execute. - */ - public Request createScimConfiguration(String connectionId, ScimConfigurationRequest request){ - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("scim-configuration") - .build() - .toString(); - - BaseRequest baseRequest = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - baseRequest.setBody(request); - return baseRequest; - } - - /** - * Get the Scim Configuration default mapping by its connection Id. - * A token with scope read:scim_config is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/get-default-mapping - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request getDefaultScimConfiguration(String connectionId){ - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("scim-configuration") - .addPathSegment("default-mapping") - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get the Connections Scim Tokens. - * A token with scope read:scim_token is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/get-scim-tokens - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request> getScimToken(String connectionId){ - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("scim-configuration/tokens") - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Create a Connections Scim Token. - * A token with scope create:scim_token is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/post-scim-token - * @param connectionId the connection id. - * @param scimTokenRequest the scim token request. - * @return a Request to execute. - */ - public Request createScimToken(String connectionId, ScimTokenRequest scimTokenRequest){ - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(scimTokenRequest, "scim token request"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("scim-configuration/tokens") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(scimTokenRequest); - return request; - } - - /** - * Delete a Connections Scim Token. - * A token with scope delete:scim_token is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/delete-tokens-by-token-id - * @param connectionId the connection id. - * @param tokenId the token id. - * @return a Request to execute. - */ - public Request deleteScimToken(String connectionId, String tokenId){ - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(tokenId, "token id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("scim-configuration/tokens") - .addPathSegment(tokenId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Check the Connection Status. - * A token with scope read:connections is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/get-status - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request checkConnectionStatus(String connectionId){ - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("status") - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.GET); - } - - /** - * Get the enabled clients for a connection. - * A token with scope read:connections is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/get-connection-clients - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request getEnabledClients(String connectionId, EnabledClientsFilter filter) { - Asserts.assertNotNull(connectionId, "connection id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("clients"); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update the enabled clients for a connection. - * A token with scope update:connections is needed. - * @see https://auth0.com/docs/api/management/v2#!/connections/patch-clients - * - * @param connectionId the connection id. - * @param enabledClientRequests the enabled client request to set. - * @return a Request to execute. - */ - public Request updateEnabledClients(String connectionId, List enabledClientRequests){ - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotEmpty(enabledClientRequests, "enabled client Request"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("clients") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.PATCH); - request.setBody(enabledClientRequests); - return request; - } - - /** - * Get the Connection Keys. - * A token with scope read:connections_keys is needed. - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request> getKeys(String connectionId) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegment("keys") - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** * Rotate the Connection Keys. - * A token with scope create:connections_keys and update:connections_keys is needed. - * @param connectionId the connection id. - * @return a Request to execute. - */ - public Request rotateKey(String connectionId) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/connections") - .addPathSegment(connectionId) - .addPathSegments("keys/rotate") - .build() - .toString(); - - return new EmptyBodyRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() {}); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java new file mode 100644 index 000000000..5eed00085 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.CustomDomain; +import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.VerifyCustomDomainResponseContent; +import java.util.List; + +public class CustomDomainsClient { + protected final ClientOptions clientOptions; + + private final RawCustomDomainsClient rawClient; + + public CustomDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomDomainsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomDomainsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CreateCustomDomainResponseContent create(CreateCustomDomainRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public CreateCustomDomainResponseContent create( + CreateCustomDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public GetCustomDomainResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public GetCustomDomainResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public UpdateCustomDomainResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public UpdateCustomDomainResponseContent update(String id, UpdateCustomDomainRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public UpdateCustomDomainResponseContent update( + String id, UpdateCustomDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Run the test process on a custom domain. + */ + public TestCustomDomainResponseContent test(String id) { + return this.rawClient.test(id).body(); + } + + /** + * Run the test process on a custom domain. + */ + public TestCustomDomainResponseContent test(String id, RequestOptions requestOptions) { + return this.rawClient.test(id, requestOptions).body(); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public VerifyCustomDomainResponseContent verify(String id) { + return this.rawClient.verify(id).body(); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public VerifyCustomDomainResponseContent verify(String id, RequestOptions requestOptions) { + return this.rawClient.verify(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/DeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/DeviceCredentialsClient.java new file mode 100644 index 000000000..7bca7c738 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/DeviceCredentialsClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; +import com.auth0.client.mgmt.types.DeviceCredential; +import com.auth0.client.mgmt.types.ListDeviceCredentialsRequestParameters; + +public class DeviceCredentialsClient { + protected final ClientOptions clientOptions; + + private final RawDeviceCredentialsClient rawClient; + + public DeviceCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeviceCredentialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeviceCredentialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public SyncPagingIterable list(ListDeviceCredentialsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public SyncPagingIterable list( + ListDeviceCredentialsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CreatePublicKeyDeviceCredentialResponseContent createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request) { + return this.rawClient.createPublicKey(request).body(); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public CreatePublicKeyDeviceCredentialResponseContent createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request, RequestOptions requestOptions) { + return this.rawClient.createPublicKey(request, requestOptions).body(); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/DeviceCredentialsEntity.java b/src/main/java/com/auth0/client/mgmt/DeviceCredentialsEntity.java deleted file mode 100644 index f235c586b..000000000 --- a/src/main/java/com/auth0/client/mgmt/DeviceCredentialsEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.DeviceCredentialsFilter; -import com.auth0.json.mgmt.devicecredentials.DeviceCredentials; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Device Credentials methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Device_Credentials - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class DeviceCredentialsEntity extends BaseManagementEntity { - - DeviceCredentialsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Device Credentials. A token with scope read:device_credentials is needed. - * See https://auth0.com/docs/api/management/v2#!/Device_Credentials/get_device_credentials - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request> list(DeviceCredentialsFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/device-credentials"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Create a Device Credentials. A token with scope create:current_user_device_credentials is needed. - * See https://auth0.com/docs/api/management/v2#!/Device_Credentials/post_device_credentials - * - * @param deviceCredentials the device credentials data to set. - * @return a Request to execute. - */ - public Request create(DeviceCredentials deviceCredentials) { - Asserts.assertNotNull(deviceCredentials, "device credentials"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/device-credentials") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(deviceCredentials); - return request; - } - - /** - * Delete an existing Device Credentials. A token with scope delete:device_credentials is needed. - * See https://auth0.com/docs/api/management/v2#!/Device_Credentials/post_device_credentials - * - * @param deviceCredentialsId the device credentials id - * @return a Request to execute. - */ - public Request delete(String deviceCredentialsId) { - Asserts.assertNotNull(deviceCredentialsId, "device credentials id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/device-credentials") - .addPathSegment(deviceCredentialsId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/EmailProviderEntity.java b/src/main/java/com/auth0/client/mgmt/EmailProviderEntity.java deleted file mode 100644 index b221d410e..000000000 --- a/src/main/java/com/auth0/client/mgmt/EmailProviderEntity.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.emailproviders.EmailProvider; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -/** - * Class that provides an implementation of the Emails methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Emails - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class EmailProviderEntity extends BaseManagementEntity { - EmailProviderEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the Email Provider. A token with scope read:email_provider is needed. - * See https://auth0.com/docs/api/management/v2#!/Emails/get_provider - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request get(FieldsFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/emails/provider"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Setup the Email Provider. A token with scope create:email_provider is needed. - * See https://auth0.com/docs/api/management/v2#!/Emails/post_provider - * - * @param emailProvider the email provider data to set - * @return a Request to execute. - */ - public Request setup(EmailProvider emailProvider) { - Asserts.assertNotNull(emailProvider, "email provider"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/emails/provider") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(emailProvider); - return request; - } - - /** - * Delete the existing Email Provider. A token with scope delete:email_provider is needed. - * See https://auth0.com/docs/api/management/v2#!/Emails/delete_provider - * - * @return a Request to execute. - */ - public Request delete() { - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/emails/provider") - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update the existing Email Provider. A token with scope update:email_provider is needed. - * See https://auth0.com/docs/api/management/v2#!/Emails/patch_provider - * - * @param emailProvider the email provider data to set. - * @return a Request to execute. - */ - public Request update(EmailProvider emailProvider) { - Asserts.assertNotNull(emailProvider, "email provider"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/emails/provider") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(emailProvider); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/EmailTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/EmailTemplatesClient.java new file mode 100644 index 000000000..cda139182 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/EmailTemplatesClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.CreateEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.EmailTemplateNameEnum; +import com.auth0.client.mgmt.types.GetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.SetEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.SetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateResponseContent; + +public class EmailTemplatesClient { + protected final ClientOptions clientOptions; + + private final RawEmailTemplatesClient rawClient; + + public EmailTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmailTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmailTemplatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Create an email template. + */ + public CreateEmailTemplateResponseContent create(CreateEmailTemplateRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create an email template. + */ + public CreateEmailTemplateResponseContent create( + CreateEmailTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public GetEmailTemplateResponseContent get(EmailTemplateNameEnum templateName) { + return this.rawClient.get(templateName).body(); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public GetEmailTemplateResponseContent get(EmailTemplateNameEnum templateName, RequestOptions requestOptions) { + return this.rawClient.get(templateName, requestOptions).body(); + } + + /** + * Update an email template. + */ + public SetEmailTemplateResponseContent set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request) { + return this.rawClient.set(templateName, request).body(); + } + + /** + * Update an email template. + */ + public SetEmailTemplateResponseContent set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(templateName, request, requestOptions).body(); + } + + /** + * Modify an email template. + */ + public UpdateEmailTemplateResponseContent update(EmailTemplateNameEnum templateName) { + return this.rawClient.update(templateName).body(); + } + + /** + * Modify an email template. + */ + public UpdateEmailTemplateResponseContent update( + EmailTemplateNameEnum templateName, UpdateEmailTemplateRequestContent request) { + return this.rawClient.update(templateName, request).body(); + } + + /** + * Modify an email template. + */ + public UpdateEmailTemplateResponseContent update( + EmailTemplateNameEnum templateName, + UpdateEmailTemplateRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(templateName, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/EmailTemplatesEntity.java b/src/main/java/com/auth0/client/mgmt/EmailTemplatesEntity.java deleted file mode 100644 index 6ab3943db..000000000 --- a/src/main/java/com/auth0/client/mgmt/EmailTemplatesEntity.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.emailtemplates.EmailTemplate; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Email Templates methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Email_Templates - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings({"WeakerAccess", "unused"}) -public class EmailTemplatesEntity extends BaseManagementEntity { - - public static final String TEMPLATE_VERIFY_EMAIL = "verify_email"; - public static final String TEMPLATE_RESET_EMAIL = "reset_email"; - public static final String TEMPLATE_WELCOME_EMAIL = "welcome_email"; - public static final String TEMPLATE_BLOCKED_ACCOUNT = "blocked_account"; - public static final String TEMPLATE_STOLEN_CREDENTIALS = "stolen_credentials"; - public static final String TEMPLATE_ENROLLMENT_EMAIL = "enrollment_email"; - public static final String TEMPLATE_CHANGE_PASSWORD = "change_password"; - public static final String TEMPLATE_PASSWORD_RESET = "password_reset"; - public static final String TEMPLATE_MFA_OOB_CODE = "mfa_oob_code"; - public static final String TEMPLATE_VERIFY_EMAIL_BY_CODE = "verify_email_by_code"; - public static final String TEMPLATE_RESET_EMAIL_BY_CODE = "reset_email_by_code"; - public static final String TEMPLATE_USER_INVITATION = "user_invitation"; - - EmailTemplatesEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the Email Templates. A token with scope read:email_templates is needed. - * See https://auth0.com/docs/api/management/v2#!/Email_Templates/get_email_templates_by_templateName - * - * @param templateName the template name to request. You can use any of the constants defined in {@link EmailTemplatesEntity} - * @return a Request to execute. - */ - public Request get(String templateName) { - Asserts.assertNotNull(templateName, "template name"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/email-templates") - .addPathSegment(templateName); - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create an Email Template. A token with scope create:email_templates is needed. - * See https://auth0.com/docs/api/management/v2#!/Email_Templates/post_email_templates - * - * @param template the template data to set - * @return a Request to execute. - */ - public Request create(EmailTemplate template) { - Asserts.assertNotNull(template, "template"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/email-templates") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(template); - return request; - } - - /** - * Patches the existing Email Template. A token with scope update:email_templates is needed. - * See https://auth0.com/docs/api/management/v2#!/Email_Templates/patch_email_templates_by_templateName - * - * @param templateName the name of the template to update. You can use any of the constants defined in {@link EmailTemplatesEntity} - * @param template the email template data to set. - * @return a Request to execute. - */ - public Request update(String templateName, EmailTemplate template) { - Asserts.assertNotNull(templateName, "template name"); - Asserts.assertNotNull(template, "template"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/email-templates") - .addPathSegment(templateName) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(template); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java new file mode 100644 index 000000000..1c36c3491 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.eventstreams.DeliveriesClient; +import com.auth0.client.mgmt.eventstreams.RedeliveriesClient; +import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; +import com.auth0.client.mgmt.types.EventStreamResponseContent; +import com.auth0.client.mgmt.types.EventStreamsCreateRequest; +import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; +import com.auth0.client.mgmt.types.GetEventStreamResponseContent; +import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; +import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; +import java.util.List; +import java.util.function.Supplier; + +public class EventStreamsClient { + protected final ClientOptions clientOptions; + + private final RawEventStreamsClient rawClient; + + protected final Supplier deliveriesClient; + + protected final Supplier redeliveriesClient; + + public EventStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEventStreamsClient(clientOptions); + this.deliveriesClient = Suppliers.memoize(() -> new DeliveriesClient(clientOptions)); + this.redeliveriesClient = Suppliers.memoize(() -> new RedeliveriesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEventStreamsClient withRawResponse() { + return this.rawClient; + } + + public List list() { + return this.rawClient.list().body(); + } + + public List list(ListEventStreamsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + public List list( + ListEventStreamsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreateEventStreamResponseContent create(EventStreamsCreateRequest request) { + return this.rawClient.create(request).body(); + } + + public CreateEventStreamResponseContent create(EventStreamsCreateRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetEventStreamResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetEventStreamResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdateEventStreamResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + public UpdateEventStreamResponseContent update(String id, UpdateEventStreamRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdateEventStreamResponseContent update( + String id, UpdateEventStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public GetEventStreamStatsResponseContent getStats(String id) { + return this.rawClient.getStats(id).body(); + } + + public GetEventStreamStatsResponseContent getStats(String id, EventStreamsGetStatsRequest request) { + return this.rawClient.getStats(id, request).body(); + } + + public GetEventStreamStatsResponseContent getStats( + String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { + return this.rawClient.getStats(id, request, requestOptions).body(); + } + + public CreateEventStreamTestEventResponseContent test(String id, CreateEventStreamTestEventRequestContent request) { + return this.rawClient.test(id, request).body(); + } + + public CreateEventStreamTestEventResponseContent test( + String id, CreateEventStreamTestEventRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).body(); + } + + public DeliveriesClient deliveries() { + return this.deliveriesClient.get(); + } + + public RedeliveriesClient redeliveries() { + return this.redeliveriesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/FlowsClient.java b/src/main/java/com/auth0/client/mgmt/FlowsClient.java new file mode 100644 index 000000000..4b2fa3778 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/FlowsClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.ExecutionsClient; +import com.auth0.client.mgmt.types.CreateFlowRequestContent; +import com.auth0.client.mgmt.types.CreateFlowResponseContent; +import com.auth0.client.mgmt.types.FlowSummary; +import com.auth0.client.mgmt.types.FlowsListRequest; +import com.auth0.client.mgmt.types.GetFlowRequestParameters; +import com.auth0.client.mgmt.types.GetFlowResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowRequestContent; +import com.auth0.client.mgmt.types.UpdateFlowResponseContent; +import java.util.function.Supplier; + +public class FlowsClient { + protected final ClientOptions clientOptions; + + private final RawFlowsClient rawClient; + + protected final Supplier executionsClient; + + public FlowsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFlowsClient(clientOptions); + this.executionsClient = Suppliers.memoize(() -> new ExecutionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFlowsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + public SyncPagingIterable list(FlowsListRequest request) { + return this.rawClient.list(request).body(); + } + + public SyncPagingIterable list(FlowsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreateFlowResponseContent create(CreateFlowRequestContent request) { + return this.rawClient.create(request).body(); + } + + public CreateFlowResponseContent create(CreateFlowRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetFlowResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetFlowResponseContent get(String id, GetFlowRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + public GetFlowResponseContent get(String id, GetFlowRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdateFlowResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + public UpdateFlowResponseContent update(String id, UpdateFlowRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdateFlowResponseContent update( + String id, UpdateFlowRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public ExecutionsClient executions() { + return this.executionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/FormsClient.java b/src/main/java/com/auth0/client/mgmt/FormsClient.java new file mode 100644 index 000000000..de9e6b84f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/FormsClient.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateFormRequestContent; +import com.auth0.client.mgmt.types.CreateFormResponseContent; +import com.auth0.client.mgmt.types.FormSummary; +import com.auth0.client.mgmt.types.GetFormRequestParameters; +import com.auth0.client.mgmt.types.GetFormResponseContent; +import com.auth0.client.mgmt.types.ListFormsRequestParameters; +import com.auth0.client.mgmt.types.UpdateFormRequestContent; +import com.auth0.client.mgmt.types.UpdateFormResponseContent; + +public class FormsClient { + protected final ClientOptions clientOptions; + + private final RawFormsClient rawClient; + + public FormsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFormsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFormsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + public SyncPagingIterable list(ListFormsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + public SyncPagingIterable list(ListFormsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreateFormResponseContent create(CreateFormRequestContent request) { + return this.rawClient.create(request).body(); + } + + public CreateFormResponseContent create(CreateFormRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetFormResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetFormResponseContent get(String id, GetFormRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + public GetFormResponseContent get(String id, GetFormRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdateFormResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + public UpdateFormResponseContent update(String id, UpdateFormRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdateFormResponseContent update( + String id, UpdateFormRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/GrantsEntity.java b/src/main/java/com/auth0/client/mgmt/GrantsEntity.java deleted file mode 100644 index 5e0b6c45c..000000000 --- a/src/main/java/com/auth0/client/mgmt/GrantsEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.GrantsFilter; -import com.auth0.json.mgmt.grants.Grant; -import com.auth0.json.mgmt.grants.GrantsPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Grants methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Grants/ - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class GrantsEntity extends BaseManagementEntity { - - GrantsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all Grants. A token with scope read:grants is needed - * See https://auth0.com/docs/api/management/v2#!/Grants/get_grants - * - * @param userId The user id of the grants to retrieve - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request list(String userId, GrantsFilter filter) { - Asserts.assertNotNull(userId, "user id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/grants") - .addQueryParameter("user_id", userId); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete an existing Grant. A token with scope delete:grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id
- * - * @param grantId The id of the grant to delete. - * @return a Request to execute. - */ - public Request delete(String grantId) { - Asserts.assertNotNull(grantId, "grant id"); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/grants") - .addPathSegment(grantId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Deletes all Grants of a given user. A token with scope delete:grants is needed. - * See https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id
- * - * @param userId The id of the user whose grants are deleted. - * @return a Request to execute. - */ - public Request deleteAll(String userId) { - Asserts.assertNotNull(userId, "user id"); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/grants") - .addQueryParameter("user_id", userId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/GuardianEntity.java b/src/main/java/com/auth0/client/mgmt/GuardianEntity.java deleted file mode 100644 index 18474bb5c..000000000 --- a/src/main/java/com/auth0/client/mgmt/GuardianEntity.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.guardian.*; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; - -/** - * Class that provides an implementation of the Guardian methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Guardian - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class GuardianEntity extends BaseManagementEntity { - - GuardianEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Create a Guardian Enrollment Ticket. A token with scope create:guardian_enrollment_tickets is needed. - * - * @param enrollmentTicket the enrollment ticket data to set. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request createEnrollmentTicket(EnrollmentTicket enrollmentTicket) { - Asserts.assertNotNull(enrollmentTicket, "enrollment ticket"); - - return request( - HttpMethod.POST, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/enrollments/ticket") - .withBody(enrollmentTicket) - ); - } - - /** - * Delete an existing Guardian Enrollment. A token with scope delete:guardian_enrollments is needed. - * - * @param enrollmentId the id of the enrollment to retrieve. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request deleteEnrollment(String enrollmentId) { - Asserts.assertNotNull(enrollmentId, "enrollment id"); - - return voidRequest( - HttpMethod.DELETE, - (builder) -> builder.withPathSegments("api/v2/guardian/enrollments").withPathSegments(enrollmentId) - ); - } - - /** - * Request the Guardian SMS enrollment and verification templates. - * A token with scope read:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request getTemplates() { - return request( - HttpMethod.GET, - new TypeReference() { - }, - (builder) -> builder.withPathSegments("api/v2/guardian/factors/sms/templates") - ); - } - - /** - * Updates the existing Guardian SMS enrollment and verification templates. - * A token with scope update:guardian_factors is needed. - * - * @param guardianTemplates the templates data to set. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request updateTemplates(GuardianTemplates guardianTemplates) { - Asserts.assertNotNull(guardianTemplates, "guardian templates"); - - return request( - HttpMethod.PUT, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/factors/sms/templates") - .withBody(guardianTemplates) - ); - } - - /** - * Request all the Guardian Factors. A token with scope read:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request> listFactors() { - return request( - HttpMethod.GET, - new TypeReference>() { - }, - (builder) -> builder.withPathSegments("api/v2/guardian/factors") - ); - } - - /** - * Update an existing Guardian Factor. A token with scope update:guardian_factors is needed. - * - * @param name the name of the Factor to update. - * @param enabled whether to enable or disable the Factor. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request updateFactor(String name, Boolean enabled) { - Asserts.assertNotNull(name, "name"); - Asserts.assertNotNull(enabled, "enabled"); - - return request( - HttpMethod.PUT, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/factors").withPathSegments(name) - .withParameter("enabled", enabled) - ); - } - - /** - * Request Guardian's Twilio SMS Factor Provider settings. A token with scope read:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request getTwilioFactorProvider() { - return request( - HttpMethod.GET, - new TypeReference() { - }, - (builder) -> builder.withPathSegments("api/v2/guardian/factors/sms/providers/twilio") - ); - } - - /** - * Update Guardian's Twilio SMS Factor Provider. A token with scope update:guardian_factors is needed. - * - * @param provider the provider data to set. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request updateTwilioFactorProvider(TwilioFactorProvider provider) { - Asserts.assertNotNull(provider, "provider"); - - return request( - HttpMethod.PUT, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/factors/sms/providers/twilio") - .withBody(provider) - ); - } - - /** - * Reset Guardian's Twilio SMS Factor Provider to the defaults. - * A token with scope update:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request resetTwilioFactorProvider() { - return updateTwilioFactorProvider(new TwilioFactorProvider(null, null, null, null)); - } - - /** - * Request Guardian's SNS push-notification Factor Provider. A token with scope read:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request getSNSFactorProvider() { - return request( - HttpMethod.GET, - new TypeReference() { - }, - (builder) -> builder.withPathSegments("api/v2/guardian/factors/push-notification/providers/sns") - ); - } - - /** - * Update Guardian's SNS push-notification Factor Provider. A token with scope update:guardian_factors is needed. - * - * @param provider the provider data to set. - * @return a Request to execute. - * @see Management API2 docs - */ - public Request updateSNSFactorProvider(SNSFactorProvider provider) { - Asserts.assertNotNull(provider, "provider"); - - return request( - HttpMethod.PUT, - new TypeReference() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/factors/push-notification/providers/sns") - .withBody(provider) - ); - } - - /** - * Reset Guardian's SNS push-notification Factor Provider to the defaults. - * A token with scope update:guardian_factors is needed. - * - * @return a Request to execute. - * @see Management API2 docs - */ - public Request resetSNSFactorProvider() { - return updateSNSFactorProvider(new SNSFactorProvider(null, null, null, null, null)); - } - - /** - * Get Guardian's MFA authentication policies. A token with scope read:mfa_policies is needed. - * - * @return a Request to execute - * @see Management API2 docs - */ - public Request> getAuthenticationPolicies() { - return request( - HttpMethod.GET, - new TypeReference>() { - }, - (builder) -> builder.withPathSegments("api/v2/guardian/policies") - ); - } - - /** - * Updates Guardian's MFA authentication policies. A token with scope update:mfa_policies is needed. - * - * @param policies the list of MFA policies to enable - * @return a Request to execute - * @see Management API2 docs - */ - public Request> updateAuthenticationPolicies(List policies) { - Asserts.assertNotNull(policies, "policies"); - - return request( - HttpMethod.PUT, - new TypeReference>() { - }, - (builder) -> builder - .withPathSegments("api/v2/guardian/policies") - .withBody(policies) - ); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/HooksClient.java b/src/main/java/com/auth0/client/mgmt/HooksClient.java new file mode 100644 index 000000000..523dee184 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/HooksClient.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.hooks.SecretsClient; +import com.auth0.client.mgmt.types.CreateHookRequestContent; +import com.auth0.client.mgmt.types.CreateHookResponseContent; +import com.auth0.client.mgmt.types.GetHookRequestParameters; +import com.auth0.client.mgmt.types.GetHookResponseContent; +import com.auth0.client.mgmt.types.Hook; +import com.auth0.client.mgmt.types.ListHooksRequestParameters; +import com.auth0.client.mgmt.types.UpdateHookRequestContent; +import com.auth0.client.mgmt.types.UpdateHookResponseContent; +import java.util.function.Supplier; + +public class HooksClient { + protected final ClientOptions clientOptions; + + private final RawHooksClient rawClient; + + protected final Supplier secretsClient; + + public HooksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawHooksClient(clientOptions); + this.secretsClient = Suppliers.memoize(() -> new SecretsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawHooksClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public SyncPagingIterable list(ListHooksRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public SyncPagingIterable list(ListHooksRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new hook. + */ + public CreateHookResponseContent create(CreateHookRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new hook. + */ + public CreateHookResponseContent create(CreateHookRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public GetHookResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public GetHookResponseContent get(String id, GetHookRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public GetHookResponseContent get(String id, GetHookRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Delete a hook. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a hook. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update an existing hook. + */ + public UpdateHookResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update an existing hook. + */ + public UpdateHookResponseContent update(String id, UpdateHookRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update an existing hook. + */ + public UpdateHookResponseContent update( + String id, UpdateHookRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public SecretsClient secrets() { + return this.secretsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/JobsClient.java b/src/main/java/com/auth0/client/mgmt/JobsClient.java new file mode 100644 index 000000000..0faa13e22 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/JobsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.jobs.ErrorsClient; +import com.auth0.client.mgmt.jobs.UsersExportsClient; +import com.auth0.client.mgmt.jobs.UsersImportsClient; +import com.auth0.client.mgmt.jobs.VerificationEmailClient; +import com.auth0.client.mgmt.types.GetJobResponseContent; +import java.util.function.Supplier; + +public class JobsClient { + protected final ClientOptions clientOptions; + + private final RawJobsClient rawClient; + + protected final Supplier usersExportsClient; + + protected final Supplier usersImportsClient; + + protected final Supplier verificationEmailClient; + + protected final Supplier errorsClient; + + public JobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawJobsClient(clientOptions); + this.usersExportsClient = Suppliers.memoize(() -> new UsersExportsClient(clientOptions)); + this.usersImportsClient = Suppliers.memoize(() -> new UsersImportsClient(clientOptions)); + this.verificationEmailClient = Suppliers.memoize(() -> new VerificationEmailClient(clientOptions)); + this.errorsClient = Suppliers.memoize(() -> new ErrorsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawJobsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves a job. Useful to check its status. + */ + public GetJobResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieves a job. Useful to check its status. + */ + public GetJobResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public UsersExportsClient usersExports() { + return this.usersExportsClient.get(); + } + + public UsersImportsClient usersImports() { + return this.usersImportsClient.get(); + } + + public VerificationEmailClient verificationEmail() { + return this.verificationEmailClient.get(); + } + + public ErrorsClient errors() { + return this.errorsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/JobsEntity.java b/src/main/java/com/auth0/client/mgmt/JobsEntity.java deleted file mode 100644 index 7de6ed373..000000000 --- a/src/main/java/com/auth0/client/mgmt/JobsEntity.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.UsersExportFilter; -import com.auth0.client.mgmt.filter.UsersImportOptions; -import com.auth0.json.mgmt.tickets.EmailVerificationIdentity; -import com.auth0.json.mgmt.jobs.Job; -import com.auth0.json.mgmt.jobs.JobErrorDetails; -import com.auth0.net.BaseRequest; -import com.auth0.net.MultipartRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.Auth0HttpResponse; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Jobs methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Jobs - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class JobsEntity extends BaseManagementEntity { - - JobsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request a Job. A token with scope create:users is needed. - * See GET Jobs by ID. - * - * @param jobId the id of the job to retrieve. - * @return a Request to execute. - */ - public Request get(String jobId) { - Asserts.assertNotNull(jobId, "job id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs") - .addPathSegment(jobId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get error details of a failed job. A token with scope create:users is needed. - * See GET Job Errors. - * - * @param jobId the id of the job to retrieve. - * @return a Request to execute. - */ - public Request> getErrorDetails(String jobId) { - Asserts.assertNotNull(jobId, "job id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs") - .addPathSegment(jobId) - .addPathSegment("errors") - .build() - .toString(); - - TypeReference> jobErrorDetailsListType = new TypeReference>() { - }; - return new BaseRequest>(client, tokenProvider, url, HttpMethod.GET, jobErrorDetailsListType) { - @Override - protected List readResponseBody(Auth0HttpResponse response) throws IOException { - if (response.getBody() == null || response.getBody().length() == 0) { - return Collections.emptyList(); - } - return super.readResponseBody(response); - } - }; - } - - /** - * Sends an Email Verification. A token with scope update:users is needed. - * See POST Verification Email. - * - * @param userId The user_id of the user to whom the email will be sent. - * @param clientId The id of the client, if not provided the global one will be used. - * - * @return a Request to execute. - * - * @see JobsEntity#sendVerificationEmail(String, String, EmailVerificationIdentity) - */ - public Request sendVerificationEmail(String userId, String clientId) { - return sendVerificationEmail(userId, clientId, null); - } - - /** - * Sends an Email Verification. A token with scope update:users is needed. - * See POST Verification Email. - * - * @param userId The user_id of the user to whom the email will be sent. - * @param clientId The id of the client, if not provided the global one will be used. - * @param emailVerificationIdentity The identity of the user. Required to verify primary identities when using social, enterprise, or passwordless connections. It is also required to verify secondary identities. - * - * @return a Request to execute. - * - * @see JobsEntity#sendVerificationEmail(String, String) - */ - public Request sendVerificationEmail(String userId, String clientId, EmailVerificationIdentity emailVerificationIdentity) { - return sendVerificationEmail(userId, clientId, emailVerificationIdentity, null); - } - - /** - * Sends an Email Verification. A token with scope update:users is needed. - * See POST Verification Email. - * - * @param userId The user_id of the user to whom the email will be sent. - * @param clientId The id of the client, if not provided the global one will be used. - * @param emailVerificationIdentity The identity of the user. Required to verify primary identities when using social, enterprise, or passwordless connections. It is also required to verify secondary identities. - * @param orgId The organization ID. If provided, the organization_id and organization_name will be included as query arguments in the link back to the application. - * - * @return a Request to execute. - * - * @see JobsEntity#sendVerificationEmail(String, String) - */ - public Request sendVerificationEmail(String userId, String clientId, EmailVerificationIdentity emailVerificationIdentity, String orgId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs/verification-email") - .build() - .toString(); - - Map requestBody = new HashMap<>(); - requestBody.put("user_id", userId); - if (clientId != null && !clientId.isEmpty()) { - requestBody.put("client_id", clientId); - } - if (orgId != null && !orgId.isEmpty()) { - requestBody.put("organization_id", orgId); - } - if (emailVerificationIdentity != null) { - Asserts.assertNotNull(emailVerificationIdentity.getProvider(), "identity provider"); - Asserts.assertNotNull(emailVerificationIdentity.getUserId(), "identity user id"); - requestBody.put("identity", emailVerificationIdentity); - } - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(requestBody); - return request; - } - - /** - * @deprecated Use {@link #exportUsers(UsersExportFilter)} instead. - * - * Requests a Users Exports job. A token with scope read:users is needed. - * See POST Users Exports. - * See Bulk User Exports. - * - * @param connectionId The id of the connection to export the users from. - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - @Deprecated - public Request exportUsers(String connectionId, UsersExportFilter filter) { - Asserts.assertNotNull(connectionId, "connection id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs/users-exports") - .build() - .toString(); - - Map requestBody = new HashMap<>(); - requestBody.put("connection_id", connectionId); - if (filter != null) { - requestBody.putAll(filter.getAsMap()); - } - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(requestBody); - return request; - } - - /** - * Requests a Users Exports job. A token with scope read:users is needed. - * See POST Users Exports. - * See Bulk User Exports. - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request exportUsers(UsersExportFilter filter) { - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs/users-exports") - .build() - .toString(); - - Map requestBody = new HashMap<>(); - if (filter != null) { - requestBody.putAll(filter.getAsMap()); - } - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(requestBody); - return request; - } - - /** - * Requests a Users Imports job. A token with scope write:users is needed. - * See POST User Imports. - * See Bulk User Imports. - * - * @param connectionId The id of the connection to import the users to. - * @param users The users file. Must have an array with the users' information in JSON format. - * @param options Optional parameters to set. Can be null. - * @return a Request to execute. - */ - public Request importUsers(String connectionId, File users, UsersImportOptions options) { - Asserts.assertNotNull(connectionId, "connection id"); - Asserts.assertNotNull(users, "users file"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/jobs/users-imports") - .build() - .toString(); - - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - if (options != null) { - for (Map.Entry e : options.getAsMap().entrySet()) { - request.addPart(e.getKey(), String.valueOf(e.getValue())); - } - } - request.addPart("connection_id", connectionId); - request.addPart("users", users, "text/json"); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/KeysEntity.java b/src/main/java/com/auth0/client/mgmt/KeysEntity.java deleted file mode 100644 index 65c7db8f5..000000000 --- a/src/main/java/com/auth0/client/mgmt/KeysEntity.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.EncryptionKeyFilter; -import com.auth0.json.mgmt.keys.EncryptionKey; -import com.auth0.json.mgmt.keys.EncryptionKeysPage; -import com.auth0.json.mgmt.keys.EncryptionWrappingKeyResponse; -import com.auth0.json.mgmt.keys.Key; -import com.auth0.net.EmptyBodyRequest; -import com.auth0.net.BaseRequest; -import com.auth0.net.EmptyBodyVoidRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Keys methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Keys - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class KeysEntity extends BaseManagementEntity { - - KeysEntity(Auth0HttpClient client, HttpUrl baseUrl, - TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all Application Signing Keys. - * A token with read:signing_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/get_signing_keys - * - * @return a Request to execute - */ - public Request> list() { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/keys/signing"); - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - - /** - * Request an Application Signing Key. A token with scope read:signing_keys is needed. - * See https://auth0.com/docs/api/management/v2#!/Keys/get_signing_key - * - * @param kid the id of the Application Signing Key to retrieve. - * @return a Request to execute. - */ - public Request get(String kid) { - Asserts.assertNotNull(kid, "kid"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/signing") - .addPathSegment(kid); - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Rotate the Application Signing Key. - * A token with scope create:signing_keys and update:signing_keys is needed. - * See https://auth0.com/docs/api/management/v2#!/Keys/post_signing_keys - * - * @return a Request to execute. - */ - public Request rotate() { - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/signing/rotate") - .build() - .toString(); - return new EmptyBodyRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } - - /** - * Revoke an Application Signing Key. - * A token with scope update:signing_keys is needed. - * See https://auth0.com/docs/api/management/v2#!/Keys/put_signing_keys - * - * @param kid the id of the Application Signing Key to revoke. - * @return a Request to execute. - */ - public Request revoke(String kid) { - Asserts.assertNotNull(kid, "kid"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/signing/") - .addPathSegment(kid) - .addPathSegment("revoke") - .build() - .toString(); - return new EmptyBodyRequest<>(this.client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - } - - /** - * Perform rekeying operation on the key hierarchy. - * A token with scope create:encryption_keys and update:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/post-encryption-rekey - * @return a Request to execute. - */ - public Request postEncryptionRekey(){ - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption/rekey") - .build() - .toString(); - - return new EmptyBodyVoidRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() {}); - } - - /** - * Get all encryption keys. - * A token with scope read:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/get-encryption-keys - * @param filter Filter to apply. Use null to get all encryption keys. - * @return a Request to execute. - */ - public Request listEncryptionKeys(EncryptionKeyFilter filter){ - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption"); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get the encryption key with the given kid. - * A token with scope read:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/get-encryption-key - * @param kid Encryption key ID - * @return A Request to execute - */ - public Request getEncryptionKey(String kid){ - Asserts.assertNotNull(kid, "kid"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption") - .addPathSegment(kid) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a new encryption key. - * A token with scope create:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/post-encryption - * @param type key type - * @return a Request to execute. - */ - public Request createEncryptionKey(String type) { - Asserts.assertNotNull(type, "type"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - - request.addParameter("type", type); - return request; - } - - /** - * Import an encryption key. - * A token with scope update:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/post-encryption-key - * @param wrappedKey Base64 encoded ciphertext of key material wrapped by public wrapping key. - * @param kid Encryption key ID - * @return A Request to execute - */ - public Request importEncryptionKey(String wrappedKey, String kid) { - Asserts.assertNotNull(wrappedKey, "wrappedKey"); - Asserts.assertNotNull(kid, "kid"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption") - .addPathSegment(kid) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - - request.addParameter("wrapped_key", wrappedKey); - return request; - } - - /** - * Delete the encryption key with the given kid. - * A token with scope delete:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/delete-encryption-key - * @param kid Encryption key ID - * @return a Request to execute. - */ - public Request deleteEncryptionKey(String kid) { - Asserts.assertNotNull(kid, "kid"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption") - .addPathSegment(kid) - .build() - .toString(); - - return new EmptyBodyVoidRequest<>(client, tokenProvider, url, HttpMethod.DELETE, new TypeReference() { - }); - } - - /** - * Create a new encryption wrapping key. - * A token with scope create:encryption_keys is needed - * See https://auth0.com/docs/api/management/v2#!/Keys/post-encryption-wrapping-key - * @param kid Encryption key ID - * @return a Request to execute. - */ - public Request createEncryptionWrappingKey(String kid) { - Asserts.assertNotNull(kid, "kid"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/keys/encryption") - .addPathSegment(kid) - .addPathSegment("wrapping-key") - .build() - .toString(); - - return new EmptyBodyRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/LogEventsEntity.java b/src/main/java/com/auth0/client/mgmt/LogEventsEntity.java deleted file mode 100644 index bf58361b1..000000000 --- a/src/main/java/com/auth0/client/mgmt/LogEventsEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.LogEventFilter; -import com.auth0.json.mgmt.logevents.LogEvent; -import com.auth0.json.mgmt.logevents.LogEventsPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -import static com.auth0.client.mgmt.filter.QueryFilter.KEY_QUERY; - -/** - * Class that provides an implementation of the Events methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Logs - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class LogEventsEntity extends BaseManagementEntity { - - LogEventsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Log Events. A token with scope read:logs is needed. - * See https://auth0.com/docs/api/management/v2#!/Logs/get_logs - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request list(LogEventFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/logs"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - if (KEY_QUERY.equals(e.getKey())) { - builder.addEncodedQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } else { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request a Log Event. A token with scope read:logs is needed. - * See https://auth0.com/docs/api/management/v2#!/Logs/get_logs_by_id - * - * @param logEventId the id of the connection to retrieve. - * @return a Request to execute. - */ - public Request get(String logEventId) { - Asserts.assertNotNull(logEventId, "log event id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/logs") - .addPathSegment(logEventId) - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/LogStreamsClient.java b/src/main/java/com/auth0/client/mgmt/LogStreamsClient.java new file mode 100644 index 000000000..45907a75f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/LogStreamsClient.java @@ -0,0 +1,790 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateLogStreamRequestContent; +import com.auth0.client.mgmt.types.CreateLogStreamResponseContent; +import com.auth0.client.mgmt.types.GetLogStreamResponseContent; +import com.auth0.client.mgmt.types.LogStreamResponseSchema; +import com.auth0.client.mgmt.types.UpdateLogStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateLogStreamResponseContent; +import java.util.List; + +public class LogStreamsClient { + protected final ClientOptions clientOptions; + + private final RawLogStreamsClient rawClient; + + public LogStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLogStreamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLogStreamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CreateLogStreamResponseContent create(CreateLogStreamRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public CreateLogStreamResponseContent create(CreateLogStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public GetLogStreamResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public GetLogStreamResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a log stream. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a log stream. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public UpdateLogStreamResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public UpdateLogStreamResponseContent update(String id, UpdateLogStreamRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public UpdateLogStreamResponseContent update( + String id, UpdateLogStreamRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/LogStreamsEntity.java b/src/main/java/com/auth0/client/mgmt/LogStreamsEntity.java deleted file mode 100644 index 2bc444148..000000000 --- a/src/main/java/com/auth0/client/mgmt/LogStreamsEntity.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.logstreams.LogStream; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; - -/** - * Class that provides an implementation of the Log Streams methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Log_Streams - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class LogStreamsEntity extends BaseManagementEntity { - - private final static String LOG_STREAMS_PATH = "api/v2/log-streams"; - - LogStreamsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Creates a request to get all Log Streams. - * See the API Documentation for more information. - * - * @return the request to execute. - */ - public Request> list() { - String url = baseUrl - .newBuilder() - .addPathSegments(LOG_STREAMS_PATH) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Creates a request to get a single Log Stream by its ID. - * See the API Documentation for more information. - * - * @param logStreamId The ID of the Log Stream to retrieve. - * @return the request to execute. - */ - public Request get(String logStreamId) { - Asserts.assertNotNull(logStreamId, "log stream id"); - - String url = baseUrl - .newBuilder() - .addPathSegments(LOG_STREAMS_PATH) - .addPathSegment(logStreamId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Creates a request to create a Log Stream. - * See the API Documentation for more information. - * - * @param logStream The {@linkplain LogStream} to create. - * @return the request to execute. - */ - public Request create(LogStream logStream) { - Asserts.assertNotNull(logStream, "log stream"); - - String url = baseUrl - .newBuilder() - .addPathSegments(LOG_STREAMS_PATH) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference(){}); - request.setBody(logStream); - return request; - } - - /** - * Creates a request to update a Log Stream. - * See the API Documentation for more information. - * - * @param logStreamId The ID of the Log Stream to update. - * @param logStream The {@linkplain LogStream} to update. - * @return the request to execute. - */ - public Request update(String logStreamId, LogStream logStream) { - Asserts.assertNotNull(logStreamId, "log stream id"); - Asserts.assertNotNull(logStream, "log stream"); - - String url = baseUrl - .newBuilder() - .addPathSegments(LOG_STREAMS_PATH) - .addPathSegment(logStreamId) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference(){ - }); - request.setBody(logStream); - return request; - } - - /** - * Creates a request to delete a Log Stream. - * See the API Documentation for more information. - * - * @param logStreamId The ID of the Log Stream to delete. - * @return the request to execute. - */ - public Request delete(String logStreamId) { - Asserts.assertNotNull(logStreamId, "log stream id"); - - String url = baseUrl - .newBuilder() - .addPathSegments(LOG_STREAMS_PATH) - .addPathSegment(logStreamId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/LogsClient.java b/src/main/java/com/auth0/client/mgmt/LogsClient.java new file mode 100644 index 000000000..4111ffced --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/LogsClient.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.GetLogResponseContent; +import com.auth0.client.mgmt.types.ListLogsRequestParameters; +import com.auth0.client.mgmt.types.Log; + +public class LogsClient { + protected final ClientOptions clientOptions; + + private final RawLogsClient rawClient; + + public LogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLogsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLogsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public SyncPagingIterable list(ListLogsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public SyncPagingIterable list(ListLogsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Retrieve an individual log event. + */ + public GetLogResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve an individual log event. + */ + public GetLogResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ManagementAPI.java b/src/main/java/com/auth0/client/mgmt/ManagementAPI.java deleted file mode 100644 index 5105aee65..000000000 --- a/src/main/java/com/auth0/client/mgmt/ManagementAPI.java +++ /dev/null @@ -1,472 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.utils.Asserts; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import org.jetbrains.annotations.TestOnly; - -/** - * Class that provides an implementation of the Management API methods defined in https://auth0.com/docs/api/management/v2. - * To begin create an instance of {@link #ManagementAPI(String, String)} using the tenant domain and API token. - *

- * This class is not entirely thread-safe: - * A new immutable {@link OkHttpClient} instance is being created with each instantiation, not sharing the thread pool - * with any prior existing client instance. - */ -@SuppressWarnings("WeakerAccess") -public class ManagementAPI { - - private final HttpUrl baseUrl; - private TokenProvider tokenProvider; - private final Auth0HttpClient client; - - /** - * Create an instance with the given tenant's domain and API token. - * In addition, accepts an {@link com.auth0.client.HttpOptions} that will be used to configure the networking client. - * See the Management API section in the readme or visit https://auth0.com/docs/api/management/v2/tokens - * to learn how to obtain a token. - * - * @deprecated Use the {@link Builder} to configure and create instances. - * - * @param domain the tenant's domain. - * @param apiToken the token to authenticate the calls with. - * @param options configuration options for this client instance. - * @see #ManagementAPI(String, String) - */ - @Deprecated - @SuppressWarnings("baz") - public ManagementAPI(String domain, String apiToken, com.auth0.client.HttpOptions options) { - this(domain, SimpleTokenProvider.create(apiToken), buildNetworkingClient(options)); - } - - /** - * Create an instance with the given tenant's domain and API token. - * See the Management API section in the readme or visit https://auth0.com/docs/api/management/v2/tokens - * to learn how to obtain a token. - * - * @deprecated Use the {@link Builder} to configure and create instances. - * - * @param domain the tenant's domain. - * @param apiToken the token to authenticate the calls with. - */ - @Deprecated - public ManagementAPI(String domain, String apiToken) { - this(domain, SimpleTokenProvider.create(apiToken), DefaultHttpClient.newBuilder().build()); - } - - /** - * Instantiate a new {@link Builder} to configure and build a new ManagementAPI client. - * - * @param domain the tenant's domain. Must be a non-null valid HTTPS domain. - * @param apiToken the token to use when making API requests to the Auth0 Management API. - * @return a Builder for further configuration. - */ - public static ManagementAPI.Builder newBuilder(String domain, String apiToken) { - return new ManagementAPI.Builder(domain, apiToken); - } - - /** - * Instantiate a new {@link Builder} to configure and build a new ManagementAPI client. - * - * @param domain the tenant's domain. Must be a non-null valid HTTPS domain. - * @param tokenProvider the API Token provider to use when making requests. - * @return a Builder for further configuration. - */ - public static ManagementAPI.Builder newBuilder(String domain, TokenProvider tokenProvider) { - return new ManagementAPI.Builder(domain, tokenProvider); - } - - private ManagementAPI(String domain, TokenProvider tokenProvider, Auth0HttpClient httpClient) { - Asserts.assertNotNull(domain, "domain"); - Asserts.assertNotNull(tokenProvider, "token provider"); - - this.baseUrl = createBaseUrl(domain); - if (baseUrl == null) { - throw new IllegalArgumentException("The domain had an invalid format and couldn't be parsed as an URL."); - } - this.tokenProvider = tokenProvider; - this.client = httpClient; - } - - /** - * Given a set of options, it creates a new instance of the {@link OkHttpClient} - * configuring them according to their availability. - * - * @param options the options to set to the client. - * @return a new networking client instance configured as requested. - */ - @SuppressWarnings("deprecation") - private static DefaultHttpClient buildNetworkingClient(com.auth0.client.HttpOptions options) { - Asserts.assertNotNull(options, "Http options"); - return DefaultHttpClient.newBuilder() - .withLogging(options.getLoggingOptions()) - .withMaxRetries(options.getManagementAPIMaxRetries()) - .withMaxRequests(options.getMaxRequests()) - .withMaxRequestsPerHost(options.getMaxRequestsPerHost()) - .withProxy(options.getProxyOptions()) - .withConnectTimeout(options.getConnectTimeout()) - .withReadTimeout(options.getReadTimeout()) - .build(); - } - - /** - * Update the API token to use on new calls. This is useful when the token is about to expire or already has. - * Please note you'll need to obtain the corresponding entity again for this to apply. e.g. call {@link #clients()} again. - * See the Management API section in the readme or visit https://auth0.com/docs/api/management/v2/tokens to learn how to obtain a token. - * - * @param apiToken the token to authenticate the calls with. - */ - public void setApiToken(String apiToken) { - Asserts.assertNotNull(apiToken, "api token"); - this.tokenProvider = SimpleTokenProvider.create(apiToken); - } - - @TestOnly - Auth0HttpClient getHttpClient() { - return this.client; - } - - //Visible for testing - HttpUrl getBaseUrl() { - return baseUrl; - } - - private HttpUrl createBaseUrl(String domain) { - String url = domain; - if (!domain.startsWith("https://") && !domain.startsWith("http://")) { - url = "https://" + domain; - } - return HttpUrl.parse(url); - } - - /** - * Getter for the Branding entity. - * - * @return the Branding entity. - */ - public BrandingEntity branding() { - return new BrandingEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Client Grants entity. - * - * @return the Client Grants entity. - */ - public ClientGrantsEntity clientGrants() { - return new ClientGrantsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Applications entity. - * - * @return the Applications entity. - */ - public ClientsEntity clients() { - return new ClientsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Connections entity. - * - * @return the Connections entity. - */ - public ConnectionsEntity connections() { - return new ConnectionsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Device Credentials entity. - * - * @return the Device Credentials entity. - */ - public DeviceCredentialsEntity deviceCredentials() { - return new DeviceCredentialsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Grants entity. - * - * @return the Grants entity. - */ - public GrantsEntity grants() { - return new GrantsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Log Events entity. - * - * @return the Log Events entity. - */ - public LogEventsEntity logEvents() { - return new LogEventsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Log Streams entity. - * - * @return the Log Streams entity. - */ - public LogStreamsEntity logStreams() { - return new LogStreamsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Rules entity. - * - * @return the Rules entity. - */ - public RulesEntity rules() { - return new RulesEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Rules Configs entity. - * - * @return the Rules Configs entity. - */ - public RulesConfigsEntity rulesConfigs() { - return new RulesConfigsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the User Blocks entity. - * - * @return the User Blocks entity. - */ - public UserBlocksEntity userBlocks() { - return new UserBlocksEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Users entity. - * - * @return the Users entity. - */ - public UsersEntity users() { - return new UsersEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Blacklists entity. - * - * @return the Blacklists entity. - */ - public BlacklistsEntity blacklists() { - return new BlacklistsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Email Templates entity. - * - * @return the Email Templates entity. - */ - public EmailTemplatesEntity emailTemplates() { - return new EmailTemplatesEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Email Provider entity. - * - * @return the Email Provider entity. - */ - public EmailProviderEntity emailProvider() { - return new EmailProviderEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Guardian entity. - * - * @return the Guardian entity. - */ - public GuardianEntity guardian() { - return new GuardianEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Stats entity. - * - * @return the Stats entity. - */ - public StatsEntity stats() { - return new StatsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Tenants entity. - * - * @return the Tenants entity. - */ - public TenantsEntity tenants() { - return new TenantsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Tickets entity. - * - * @return the Tickets entity. - */ - public TicketsEntity tickets() { - return new TicketsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Resource Servers entity. - * - * @return the Resource Servers entity. - */ - public ResourceServerEntity resourceServers() { - return new ResourceServerEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Jobs entity. - * - * @return the Jobs entity. - */ - public JobsEntity jobs() { - return new JobsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Roles entity. - * - * @return the Roles entity. - */ - public RolesEntity roles() { - return new RolesEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Organizations entity. - * - * @return the Organizations entity. - */ - public OrganizationsEntity organizations() { - return new OrganizationsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Actions entity. - * - * @return the Actions entity. - */ - public ActionsEntity actions() { - return new ActionsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Attack Protection Entity - * - * @return the Attack Protection Entity - */ - public AttackProtectionEntity attackProtection() { - return new AttackProtectionEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Keys Entity - * - * @return the Keys Entity - */ - public KeysEntity keys() { - return new KeysEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the RefreshTokens Entity - * @return the RefreshTokens Entity - */ - public RefreshTokensEntity refreshTokens() { - return new RefreshTokensEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Sessions Entity - * @return the Sessions Entity - */ - public SessionsEntity sessions() { - return new SessionsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Prompts Entity - * @return the Prompts Entity - */ - public PromptsEntity prompts() { - return new PromptsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the SelfServiceProfiles Entity - * @return the SelfServiceProfiles Entity - */ - public SelfServiceProfilesEntity selfServiceProfiles() { - return new SelfServiceProfilesEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the Network Acls Entity - * @return the Network Acls Entity - */ - public NetworkAclsEntity networkAcls() { - return new NetworkAclsEntity(client, baseUrl, tokenProvider); - } - - /** - * Getter for the User Attribute Profiles Entity - * @return the User Attribute Profiles Entity - */ - public UserAttributeProfilesEntity userAttributeProfiles() { - return new UserAttributeProfilesEntity(client, baseUrl, tokenProvider); - } - - /** - * Builder for {@link ManagementAPI} API client instances. - */ - public static class Builder { - private final String domain; - private final TokenProvider tokenProvider; - private Auth0HttpClient httpClient = DefaultHttpClient.newBuilder().build(); - - /** - * Create a new Builder - * @param domain the domain of the tenant. - * @param apiToken the API token used to make requests to the Auth0 Management API. - */ - public Builder(String domain, String apiToken) { - this(domain, SimpleTokenProvider.create(apiToken)); - } - - /** - * Create a new Builder - * @param domain the domain of the tenant. - * @param tokenProvider the API Token provider to use when making requests. - */ - public Builder(String domain, TokenProvider tokenProvider) { - this.domain = domain; - this.tokenProvider = tokenProvider; - } - - /** - * Configure the client with an {@link Auth0HttpClient}. - * @param httpClient the HTTP client to use when making requests. - * @return the builder instance. - * @see DefaultHttpClient - */ - public Builder withHttpClient(Auth0HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /** - * Build a {@link ManagementAPI} instance using this builder's configuration. - * @return the configured {@code ManagementAPI} instance. - */ - public ManagementAPI build() { - return new ManagementAPI(domain, tokenProvider, httpClient); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ManagementApi.java b/src/main/java/com/auth0/client/mgmt/ManagementApi.java new file mode 100644 index 000000000..fdad4667b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ManagementApi.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.anomaly.AnomalyClient; +import com.auth0.client.mgmt.attackprotection.AttackProtectionClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.emails.EmailsClient; +import com.auth0.client.mgmt.guardian.GuardianClient; +import com.auth0.client.mgmt.keys.KeysClient; +import com.auth0.client.mgmt.tenants.TenantsClient; +import com.auth0.client.mgmt.verifiablecredentials.VerifiableCredentialsClient; +import java.util.function.Supplier; + +public class ManagementApi { + protected final ClientOptions clientOptions; + + protected final Supplier actionsClient; + + protected final Supplier brandingClient; + + protected final Supplier clientGrantsClient; + + protected final Supplier clientsClient; + + protected final Supplier connectionsClient; + + protected final Supplier customDomainsClient; + + protected final Supplier deviceCredentialsClient; + + protected final Supplier emailTemplatesClient; + + protected final Supplier eventStreamsClient; + + protected final Supplier flowsClient; + + protected final Supplier formsClient; + + protected final Supplier userGrantsClient; + + protected final Supplier hooksClient; + + protected final Supplier jobsClient; + + protected final Supplier logStreamsClient; + + protected final Supplier logsClient; + + protected final Supplier networkAclsClient; + + protected final Supplier organizationsClient; + + protected final Supplier promptsClient; + + protected final Supplier refreshTokensClient; + + protected final Supplier resourceServersClient; + + protected final Supplier rolesClient; + + protected final Supplier rulesClient; + + protected final Supplier rulesConfigsClient; + + protected final Supplier selfServiceProfilesClient; + + protected final Supplier sessionsClient; + + protected final Supplier statsClient; + + protected final Supplier supplementalSignalsClient; + + protected final Supplier ticketsClient; + + protected final Supplier tokenExchangeProfilesClient; + + protected final Supplier userBlocksClient; + + protected final Supplier usersClient; + + protected final Supplier anomalyClient; + + protected final Supplier attackProtectionClient; + + protected final Supplier emailsClient; + + protected final Supplier guardianClient; + + protected final Supplier keysClient; + + protected final Supplier tenantsClient; + + protected final Supplier verifiableCredentialsClient; + + public ManagementApi(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.actionsClient = Suppliers.memoize(() -> new ActionsClient(clientOptions)); + this.brandingClient = Suppliers.memoize(() -> new BrandingClient(clientOptions)); + this.clientGrantsClient = Suppliers.memoize(() -> new ClientGrantsClient(clientOptions)); + this.clientsClient = Suppliers.memoize(() -> new ClientsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions)); + this.customDomainsClient = Suppliers.memoize(() -> new CustomDomainsClient(clientOptions)); + this.deviceCredentialsClient = Suppliers.memoize(() -> new DeviceCredentialsClient(clientOptions)); + this.emailTemplatesClient = Suppliers.memoize(() -> new EmailTemplatesClient(clientOptions)); + this.eventStreamsClient = Suppliers.memoize(() -> new EventStreamsClient(clientOptions)); + this.flowsClient = Suppliers.memoize(() -> new FlowsClient(clientOptions)); + this.formsClient = Suppliers.memoize(() -> new FormsClient(clientOptions)); + this.userGrantsClient = Suppliers.memoize(() -> new UserGrantsClient(clientOptions)); + this.hooksClient = Suppliers.memoize(() -> new HooksClient(clientOptions)); + this.jobsClient = Suppliers.memoize(() -> new JobsClient(clientOptions)); + this.logStreamsClient = Suppliers.memoize(() -> new LogStreamsClient(clientOptions)); + this.logsClient = Suppliers.memoize(() -> new LogsClient(clientOptions)); + this.networkAclsClient = Suppliers.memoize(() -> new NetworkAclsClient(clientOptions)); + this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); + this.promptsClient = Suppliers.memoize(() -> new PromptsClient(clientOptions)); + this.refreshTokensClient = Suppliers.memoize(() -> new RefreshTokensClient(clientOptions)); + this.resourceServersClient = Suppliers.memoize(() -> new ResourceServersClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); + this.rulesClient = Suppliers.memoize(() -> new RulesClient(clientOptions)); + this.rulesConfigsClient = Suppliers.memoize(() -> new RulesConfigsClient(clientOptions)); + this.selfServiceProfilesClient = Suppliers.memoize(() -> new SelfServiceProfilesClient(clientOptions)); + this.sessionsClient = Suppliers.memoize(() -> new SessionsClient(clientOptions)); + this.statsClient = Suppliers.memoize(() -> new StatsClient(clientOptions)); + this.supplementalSignalsClient = Suppliers.memoize(() -> new SupplementalSignalsClient(clientOptions)); + this.ticketsClient = Suppliers.memoize(() -> new TicketsClient(clientOptions)); + this.tokenExchangeProfilesClient = Suppliers.memoize(() -> new TokenExchangeProfilesClient(clientOptions)); + this.userBlocksClient = Suppliers.memoize(() -> new UserBlocksClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + this.anomalyClient = Suppliers.memoize(() -> new AnomalyClient(clientOptions)); + this.attackProtectionClient = Suppliers.memoize(() -> new AttackProtectionClient(clientOptions)); + this.emailsClient = Suppliers.memoize(() -> new EmailsClient(clientOptions)); + this.guardianClient = Suppliers.memoize(() -> new GuardianClient(clientOptions)); + this.keysClient = Suppliers.memoize(() -> new KeysClient(clientOptions)); + this.tenantsClient = Suppliers.memoize(() -> new TenantsClient(clientOptions)); + this.verifiableCredentialsClient = Suppliers.memoize(() -> new VerifiableCredentialsClient(clientOptions)); + } + + public ActionsClient actions() { + return this.actionsClient.get(); + } + + public BrandingClient branding() { + return this.brandingClient.get(); + } + + public ClientGrantsClient clientGrants() { + return this.clientGrantsClient.get(); + } + + public ClientsClient clients() { + return this.clientsClient.get(); + } + + public ConnectionsClient connections() { + return this.connectionsClient.get(); + } + + public CustomDomainsClient customDomains() { + return this.customDomainsClient.get(); + } + + public DeviceCredentialsClient deviceCredentials() { + return this.deviceCredentialsClient.get(); + } + + public EmailTemplatesClient emailTemplates() { + return this.emailTemplatesClient.get(); + } + + public EventStreamsClient eventStreams() { + return this.eventStreamsClient.get(); + } + + public FlowsClient flows() { + return this.flowsClient.get(); + } + + public FormsClient forms() { + return this.formsClient.get(); + } + + public UserGrantsClient userGrants() { + return this.userGrantsClient.get(); + } + + public HooksClient hooks() { + return this.hooksClient.get(); + } + + public JobsClient jobs() { + return this.jobsClient.get(); + } + + public LogStreamsClient logStreams() { + return this.logStreamsClient.get(); + } + + public LogsClient logs() { + return this.logsClient.get(); + } + + public NetworkAclsClient networkAcls() { + return this.networkAclsClient.get(); + } + + public OrganizationsClient organizations() { + return this.organizationsClient.get(); + } + + public PromptsClient prompts() { + return this.promptsClient.get(); + } + + public RefreshTokensClient refreshTokens() { + return this.refreshTokensClient.get(); + } + + public ResourceServersClient resourceServers() { + return this.resourceServersClient.get(); + } + + public RolesClient roles() { + return this.rolesClient.get(); + } + + public RulesClient rules() { + return this.rulesClient.get(); + } + + public RulesConfigsClient rulesConfigs() { + return this.rulesConfigsClient.get(); + } + + public SelfServiceProfilesClient selfServiceProfiles() { + return this.selfServiceProfilesClient.get(); + } + + public SessionsClient sessions() { + return this.sessionsClient.get(); + } + + public StatsClient stats() { + return this.statsClient.get(); + } + + public SupplementalSignalsClient supplementalSignals() { + return this.supplementalSignalsClient.get(); + } + + public TicketsClient tickets() { + return this.ticketsClient.get(); + } + + public TokenExchangeProfilesClient tokenExchangeProfiles() { + return this.tokenExchangeProfilesClient.get(); + } + + public UserBlocksClient userBlocks() { + return this.userBlocksClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public AnomalyClient anomaly() { + return this.anomalyClient.get(); + } + + public AttackProtectionClient attackProtection() { + return this.attackProtectionClient.get(); + } + + public EmailsClient emails() { + return this.emailsClient.get(); + } + + public GuardianClient guardian() { + return this.guardianClient.get(); + } + + public KeysClient keys() { + return this.keysClient.get(); + } + + public TenantsClient tenants() { + return this.tenantsClient.get(); + } + + public VerifiableCredentialsClient verifiableCredentials() { + return this.verifiableCredentialsClient.get(); + } + + public static ManagementApiBuilder builder() { + return new ManagementApiBuilder(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java b/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java new file mode 100644 index 000000000..59a059857 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Environment; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import okhttp3.OkHttpClient; + +public class ManagementApiBuilder { + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); + + private final Map customHeaders = new HashMap<>(); + + private String token = null; + + private Environment environment = Environment.DEFAULT; + + private OkHttpClient httpClient; + + /** + * Sets token + */ + public ManagementApiBuilder token(String token) { + this.token = token; + return this; + } + + public ManagementApiBuilder environment(Environment environment) { + this.environment = environment; + return this; + } + + public ManagementApiBuilder url(String url) { + this.environment = Environment.custom(url); + return this; + } + + /** + * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. + */ + public ManagementApiBuilder timeout(int timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + /** + * Sets the maximum number of retries for the client. Defaults to 2 retries. + */ + public ManagementApiBuilder maxRetries(int maxRetries) { + this.maxRetries = Optional.of(maxRetries); + return this; + } + + /** + * Sets the underlying OkHttp client + */ + public ManagementApiBuilder httpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Add a custom header to be sent with all requests. + * For headers that need to be computed dynamically or conditionally, use the setAdditional() method override instead. + * + * @param name The header name + * @param value The header value + * @return This builder for method chaining + */ + public ManagementApiBuilder addHeader(String name, String value) { + this.customHeaders.put(name, value); + return this; + } + + protected ClientOptions buildClientOptions() { + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + for (Map.Entry header : this.customHeaders.entrySet()) { + builder.addHeader(header.getKey(), header.getValue()); + } + setAdditional(builder); + return builder.build(); + } + + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *

{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.token != null) { + builder.addHeader("Authorization", "Bearer " + this.token); + } + } + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public ManagementApi build() { + if (token == null) { + throw new RuntimeException("Please provide token"); + } + validateConfiguration(); + return new ManagementApi(buildClientOptions()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/NetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/NetworkAclsClient.java new file mode 100644 index 000000000..c812f3c33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/NetworkAclsClient.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsRequestParameters; +import com.auth0.client.mgmt.types.NetworkAclsResponseContent; +import com.auth0.client.mgmt.types.SetNetworkAclRequestContent; +import com.auth0.client.mgmt.types.SetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclResponseContent; + +public class NetworkAclsClient { + protected final ClientOptions clientOptions; + + private final RawNetworkAclsClient rawClient; + + public NetworkAclsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawNetworkAclsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawNetworkAclsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all access control list entries for your client. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get all access control list entries for your client. + */ + public SyncPagingIterable list(ListNetworkAclsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Get all access control list entries for your client. + */ + public SyncPagingIterable list( + ListNetworkAclsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new access control list for your client. + */ + public void create(CreateNetworkAclRequestContent request) { + this.rawClient.create(request).body(); + } + + /** + * Create a new access control list for your client. + */ + public void create(CreateNetworkAclRequestContent request, RequestOptions requestOptions) { + this.rawClient.create(request, requestOptions).body(); + } + + /** + * Get a specific access control list entry for your client. + */ + public GetNetworkAclsResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Get a specific access control list entry for your client. + */ + public GetNetworkAclsResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Update existing access control list for your client. + */ + public SetNetworkAclsResponseContent set(String id, SetNetworkAclRequestContent request) { + return this.rawClient.set(id, request).body(); + } + + /** + * Update existing access control list for your client. + */ + public SetNetworkAclsResponseContent set( + String id, SetNetworkAclRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(id, request, requestOptions).body(); + } + + /** + * Delete existing access control list for your client. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete existing access control list for your client. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update existing access control list for your client. + */ + public UpdateNetworkAclResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update existing access control list for your client. + */ + public UpdateNetworkAclResponseContent update(String id, UpdateNetworkAclRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update existing access control list for your client. + */ + public UpdateNetworkAclResponseContent update( + String id, UpdateNetworkAclRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/NetworkAclsEntity.java b/src/main/java/com/auth0/client/mgmt/NetworkAclsEntity.java deleted file mode 100644 index d0d8818c3..000000000 --- a/src/main/java/com/auth0/client/mgmt/NetworkAclsEntity.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.NetworkAclsFilter; -import com.auth0.json.mgmt.networkacls.NetworkAcls; -import com.auth0.json.mgmt.networkacls.NetworkAclsPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -public class NetworkAclsEntity extends BaseManagementEntity { - - private final static String ORGS_PATH = "api/v2/network-acls"; - - NetworkAclsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Lists all Network ACLs for the Auth0 tenant. - * This method allows you to filter the results using the provided {@link NetworkAclsFilter}. - * A token with scope read:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/get-network-acls - * @param filter the filter to apply to the request, can be null. - * @return a Request that can be executed to retrieve a page of Network ACLs. - */ - public Request list(NetworkAclsFilter filter) { - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference(){ - }); - } - - /** - * Creates a new Network ACL for the Auth0 tenant. - * A token with scope create:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/post-network-acls - * @param networkAcls the Network ACL to create. - * @return a Request that can be executed to create the Network ACL. - */ - public Request create(NetworkAcls networkAcls) { - Asserts.assertNotNull(networkAcls, "network acls"); - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .build().toString(); - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference(){}); - request.setBody(networkAcls); - return request; - } - - /** - * Get a Network ACL by its ID. - * A token with scope read:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/get-network-acls-by-id - * @param id the ID of the Network ACL to delete. - * @return a Request that can be executed to delete the Network ACL. - */ - public Request get(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference(){}); - } - - /** - * Deletes a Network ACL by its ID. - * A token with scope delete:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/delete-network-acls-by-id - * @param id the ID of the Network ACL to delete. - * @return a Request that can be executed to delete the Network ACL. - */ - public Request delete(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Updates a Network ACL by its ID. - * A token with scope update:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/put-network-acls-by-id - * @param id the ID of the Network ACL to update. - * @param networkAcls the Network ACL to update. - * @return a Request that can be executed to update the Network ACL. - */ - public Request update(String id, NetworkAcls networkAcls) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(networkAcls, "network acls"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - request.setBody(networkAcls); - return request; - } - - /** - * Partially updates a Network ACL by its ID. - * A token with scope update:network_acls is needed. - * - * @see https://auth0.com/docs/api/management/v2#!/network-acls/patch-network-acls-by-id - * @param id the ID of the Network ACL to update. - * @param networkAcls the Network ACL to update. - * @return a Request that can be executed to partially update the Network ACL. - */ - public Request patch(String id, NetworkAcls networkAcls) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(networkAcls); - return request; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java new file mode 100644 index 000000000..a7fa6e91b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.ClientGrantsClient; +import com.auth0.client.mgmt.organizations.EnabledConnectionsClient; +import com.auth0.client.mgmt.organizations.InvitationsClient; +import com.auth0.client.mgmt.organizations.MembersClient; +import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationByNameResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; +import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; +import java.util.function.Supplier; + +public class OrganizationsClient { + protected final ClientOptions clientOptions; + + private final RawOrganizationsClient rawClient; + + protected final Supplier clientGrantsClient; + + protected final Supplier enabledConnectionsClient; + + protected final Supplier invitationsClient; + + protected final Supplier membersClient; + + public OrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOrganizationsClient(clientOptions); + this.clientGrantsClient = Suppliers.memoize(() -> new ClientGrantsClient(clientOptions)); + this.enabledConnectionsClient = Suppliers.memoize(() -> new EnabledConnectionsClient(clientOptions)); + this.invitationsClient = Suppliers.memoize(() -> new InvitationsClient(clientOptions)); + this.membersClient = Suppliers.memoize(() -> new MembersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list(ListOrganizationsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list( + ListOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CreateOrganizationResponseContent create(CreateOrganizationRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public CreateOrganizationResponseContent create( + CreateOrganizationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public GetOrganizationByNameResponseContent getByName(String name) { + return this.rawClient.getByName(name).body(); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public GetOrganizationByNameResponseContent getByName(String name, RequestOptions requestOptions) { + return this.rawClient.getByName(name, requestOptions).body(); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public GetOrganizationResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public GetOrganizationResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public UpdateOrganizationResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public UpdateOrganizationResponseContent update(String id, UpdateOrganizationRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public UpdateOrganizationResponseContent update( + String id, UpdateOrganizationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public ClientGrantsClient clientGrants() { + return this.clientGrantsClient.get(); + } + + public EnabledConnectionsClient enabledConnections() { + return this.enabledConnectionsClient.get(); + } + + public InvitationsClient invitations() { + return this.invitationsClient.get(); + } + + public MembersClient members() { + return this.membersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationsEntity.java b/src/main/java/com/auth0/client/mgmt/OrganizationsEntity.java deleted file mode 100644 index dcb9f3ed1..000000000 --- a/src/main/java/com/auth0/client/mgmt/OrganizationsEntity.java +++ /dev/null @@ -1,676 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.*; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.organizations.*; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -/** - * Class that provides an implementation of the Organization endpoints of the Management API. - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class OrganizationsEntity extends BaseManagementEntity { - - private final static String ORGS_PATH = "api/v2/organizations"; - - OrganizationsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - // Organizations Entity - - /** - * Get all organizations. A token with {@code read:organizations} scope is required. - * - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations - */ - public Request list(PageFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get an organization. A token with {@code read:organizations} scope is required. - * - * @param orgId the ID of the organization to retrieve - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations_by_id - */ - public Request get(String orgId) { - Asserts.assertNotNull(orgId, "organization ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get an organization. A token with {@code read:organizations} scope is required. - * - * @param orgName the name of the organization to retrieve - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_name_by_name - */ - public Request getByName(String orgName) { - Asserts.assertNotNull(orgName, "organization name"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment("name") - .addPathSegment(orgName) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create an organization. A token with {@code create:organizations} scope is required. - * - * @param organization the organization to create - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/post_organizations - */ - public Request create(Organization organization) { - Asserts.assertNotNull(organization, "organization"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - - request.setBody(organization); - return request; - } - - /** - * Update an organization. A token with {@code update:organizations} scope is required. - * - * @param orgId the ID of the organization to update - * @param organization the updated organization - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/patch_organizations_by_id - */ - public Request update(String orgId, Organization organization) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(organization, "organization"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - - request.setBody(organization); - return request; - } - - /** - * Delete an organization. A token with {@code delete:organizations} scope is required. - * - * @param orgId the ID of the organization to delete - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/delete_organizations_by_id - */ - public Request delete(String orgId) { - Asserts.assertNotNull(orgId, "organization ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - // Organization members - - /** - * Get the members of an organization. A token with {@code read:organization_members} scope is required. - * - * @param orgId the ID of the organization - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_members - */ - public Request getMembers(String orgId, PageFilter filter) { - return getMembers(orgId, filter, null); - } - - /** - * Get the members of an organization. A token with {@code read:organization_members} scope is required. - *
- * Member roles are not sent by default. Supply a {@linkplain FieldsFilter} that includes "roles" (and {@code includeFields = true} to retrieve the roles assigned to each listed member. To include the roles in the response, you must include the {@code read:organization_member_roles} scope in the token. - * - * @param orgId the ID of the organization - * @param pageFilter an optional pagination filter - * @param fieldsFilter an optional fields filter. If null, all fields (except roles) are returned. - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_members - */ - public Request getMembers(String orgId, PageFilter pageFilter, FieldsFilter fieldsFilter) { - Asserts.assertNotNull(orgId, "organization ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members"); - - applyFilter(pageFilter, builder); - applyFilter(fieldsFilter, builder); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Add members to an organization. A token with {@code create:organization_members} scope is required. - * - * @param orgId the ID of the organization - * @param members The members to add - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/post_members - */ - public Request addMembers(String orgId, Members members) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(members, "members"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.POST); - request.setBody(members); - return request; - } - - /** - * Delete members from an organization. A token with {@code delete:organization_members} scope is required. - * - * @param orgId the ID of the organization - * @param members The members to remove - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/delete_members - */ - public Request deleteMembers(String orgId, Members members) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(members, "members"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - request.setBody(members); - return request; - } - - // Organization connections - - /** - * Get the connections of an organization. A token with {@code read:organization_connections} scope is required. - * - * @param orgId the ID of the organization - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_enabled_connections - */ - public Request getConnections(String orgId, PageFilter filter) { - Asserts.assertNotNull(orgId, "organization ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("enabled_connections"); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get an organization's connection. - * - * @param orgId the ID of the organization - * @param connectionId the ID of the connection - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_enabled_connections_by_connectionId - */ - public Request getConnection(String orgId, String connectionId) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(connectionId, "connection ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("enabled_connections") - .addPathSegment(connectionId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Add a connection to an organization. A token with {@code create:organization_connections} scope is required. - * - * @param orgId the ID of the organization - * @param connection The connection to add - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/post_enabled_connections - */ - public Request addConnection(String orgId, EnabledConnection connection) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(connection, "connection"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("enabled_connections") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(connection); - return request; - } - - /** - * Delete a connection from an organization. A token with {@code delete:organization_connections} scope is required. - * - * @param orgId the ID of the organization - * @param connectionId the ID of the connection to delete - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/delete_enabled_connections_by_connectionId - */ - public Request deleteConnection(String orgId, String connectionId) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(connectionId, "connection ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("enabled_connections") - .addPathSegment(connectionId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update a connection of an organization. A token with {@code update:organization_connections} scope is required. - * - * @param orgId the ID of the organization - * @param connectionId the ID of the connection to update - * @param connection the connection to update - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/patch_enabled_connections_by_connectionId - */ - public Request updateConnection(String orgId, String connectionId, EnabledConnection connection) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(connectionId, "connection ID"); - Asserts.assertNotNull(connection, "connection"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("enabled_connections") - .addPathSegment(connectionId) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(connection); - return request; - } - - // Org roles - - /** - * Get the roles for a member of an organization. A token with {@code read:organization_members} scope is required. - * - * @param orgId the ID of the organization - * @param userId the ID of the user - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_organization_member_roles - */ - public Request getRoles(String orgId, String userId, PageFilter filter) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(userId, "user ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members") - .addPathSegment(userId) - .addPathSegment("roles"); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Add roles for a member of an organization. A token with {@code create:organization_member_roles} scope is required. - * - * @param orgId the ID of the organization - * @param userId the ID of the user - * @param roles the roles to add - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/post_organization_member_roles - */ - public Request addRoles(String orgId, String userId, Roles roles) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(roles, "roles"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members") - .addPathSegment(userId) - .addPathSegment("roles") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.POST); - request.setBody(roles); - return request; - } - - /** - * Delete roles from a member of an organization. A token with {@code delete:organization_member_roles} scope is required. - * - * @param orgId the ID of the organization - * @param userId the ID of the user - * @param roles the roles to delete - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/delete_organization_member_roles - */ - public Request deleteRoles(String orgId, String userId, Roles roles) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(roles, "roles"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("members") - .addPathSegment(userId) - .addPathSegment("roles") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - request.setBody(roles); - return request; - } - - // Organization invitations - - /** - * Create an invitation. A token with {@code create:organization_invitations} scope is required. - * - * @param orgId the ID of the organization - * @param invitation the invitation to create - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/post_invitations - */ - public Request createInvitation(String orgId, Invitation invitation) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(invitation, "invitation"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("invitations") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(invitation); - return request; - - } - - /** - * Get an invitation. A token with {@code read:organization_invitations} scope is required. - * - * @param orgId the ID of the organization - * @param invitationId the ID of the invitation - * @param filter an optional result filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_invitations_by_invitation_id - */ - public Request getInvitation(String orgId, String invitationId, FieldsFilter filter) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(invitationId, "invitation ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("invitations") - .addPathSegment(invitationId); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Gets all invitations for an organization. A token with {@code read:organization_invitations} scope is required. - * - * @param orgId the ID of the organization - * @param filter an optional result filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/get_invitations - */ - public Request getInvitations(String orgId, InvitationsFilter filter) { - Asserts.assertNotNull(orgId, "organization ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("invitations"); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete an invitation. A token with {@code delete:organization_invitations`} scope is required. - * - * @param orgId the ID of the organization - * @param invitationId the ID of the invitation to delete - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Organizations/delete_invitations_by_invitation_id - */ - public Request deleteInvitation(String orgId, String invitationId) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(invitationId, "invitation ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("invitations") - .addPathSegment(invitationId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Get the client grants associated with this organization. A token with scope {@code read:organization_client_grants} is required. - * @param orgId the organization ID. - * @param filter an optional filter to refine results. - * @return a request to execute. - */ - public Request listClientGrants(String orgId, OrganizationClientGrantsFilter filter) { - Asserts.assertNotNull(orgId, "organization ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegments(orgId) - .addPathSegment("client-grants"); - - applyFilter(filter, builder); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() {}); - } - - /** - * Associate a client grant with an organization. A token with scope {@code create:organization_client_grants} is required. - * @param orgId the organization ID. - * @param addOrganizationClientGrantRequestBody the body of the request containing information about the client grant to associate. - * @return a request to execute. - */ - public Request addClientGrant(String orgId, CreateOrganizationClientGrantRequestBody addOrganizationClientGrantRequestBody) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(addOrganizationClientGrantRequestBody, "client grant"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("client-grants") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() {}); - request.setBody(addOrganizationClientGrantRequestBody); - return request; - } - - /** - * Remove a client grant from an organization. A token with scope {@code delete:organization_client_grants} is required. - * @param orgId the organization ID. - * @param grantId the client grant ID. - * @return a request to execute. - */ - public Request deleteClientGrant(String orgId, String grantId) { - Asserts.assertNotNull(orgId, "organization ID"); - Asserts.assertNotNull(grantId, "client grant ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(orgId) - .addPathSegment("client-grants") - .addPathSegment(grantId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - private void applyFilter(BaseFilter filter, HttpUrl.Builder builder) { - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/PromptsClient.java b/src/main/java/com/auth0/client/mgmt/PromptsClient.java new file mode 100644 index 000000000..2b0f9ae14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/PromptsClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.prompts.CustomTextClient; +import com.auth0.client.mgmt.prompts.PartialsClient; +import com.auth0.client.mgmt.prompts.RenderingClient; +import com.auth0.client.mgmt.types.GetSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSettingsRequestContent; +import com.auth0.client.mgmt.types.UpdateSettingsResponseContent; +import java.util.function.Supplier; + +public class PromptsClient { + protected final ClientOptions clientOptions; + + private final RawPromptsClient rawClient; + + protected final Supplier renderingClient; + + protected final Supplier customTextClient; + + protected final Supplier partialsClient; + + public PromptsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPromptsClient(clientOptions); + this.renderingClient = Suppliers.memoize(() -> new RenderingClient(clientOptions)); + this.customTextClient = Suppliers.memoize(() -> new CustomTextClient(clientOptions)); + this.partialsClient = Suppliers.memoize(() -> new PartialsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPromptsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public GetSettingsResponseContent getSettings() { + return this.rawClient.getSettings().body(); + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public GetSettingsResponseContent getSettings(RequestOptions requestOptions) { + return this.rawClient.getSettings(requestOptions).body(); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public UpdateSettingsResponseContent updateSettings() { + return this.rawClient.updateSettings().body(); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public UpdateSettingsResponseContent updateSettings(UpdateSettingsRequestContent request) { + return this.rawClient.updateSettings(request).body(); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public UpdateSettingsResponseContent updateSettings( + UpdateSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateSettings(request, requestOptions).body(); + } + + public RenderingClient rendering() { + return this.renderingClient.get(); + } + + public CustomTextClient customText() { + return this.customTextClient.get(); + } + + public PartialsClient partials() { + return this.partialsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/PromptsEntity.java b/src/main/java/com/auth0/client/mgmt/PromptsEntity.java deleted file mode 100644 index 3c26546e5..000000000 --- a/src/main/java/com/auth0/client/mgmt/PromptsEntity.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.prompts.Prompt; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -public class PromptsEntity extends BaseManagementEntity { - - private final static String ORGS_PATH = "api/v2/prompts"; - - PromptsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Get the prompt. - * A token with {@code read:prompts} scope is required. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/get-prompts - */ - public Request getPrompt() { - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH); - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update the prompt. - * A token with {@code update:prompts} scope is required. - * @param prompt the prompt to update. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/patch-prompts - */ - public Request updatePrompt(Prompt prompt) { - Asserts.assertNotNull(prompt, "prompt"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH); - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - - request.setBody(prompt); - return request; - } - - /** - * Get the custom text for specific prompt and language. - * A token with {@code read:prompts} scope is required. - * @param prompt the prompt name. - * @param language the language. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/get-custom-text-by-language - */ - public Request getCustomText(String prompt, String language) { - Asserts.assertNotNull(prompt, "prompt"); - Asserts.assertNotNull(language, "language"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(prompt) - .addPathSegment("custom-text") - .addPathSegment(language); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Set the custom text for specific prompt and language. - * A token with {@code update:prompts} scope is required. - * @param prompt the prompt name. - * @param language the language. - * @param customText the custom text. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/put-custom-text-by-language - */ - public Request setCustomText(String prompt, String language, Object customText) { - Asserts.assertNotNull(prompt, "prompt"); - Asserts.assertNotNull(language, "language"); - Asserts.assertNotNull(customText, "customText"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(prompt) - .addPathSegment("custom-text") - .addPathSegment(language); - - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - - request.setBody(customText); - return request; - } - - /** - * Get the partials for specific prompt. - * A token with {@code read:prompts} scope is required. - * @param prompt the prompt name. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/get-partials - */ - public Request getPartialsPrompt(String prompt) { - Asserts.assertNotNull(prompt, "prompt"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(prompt) - .addPathSegment("partials"); - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Set the partials for specific prompt. - * A token with {@code read:prompts} scope is required. - * @param prompt the prompt name. - * @param partials the partials. - * @return a Request to execute. - * - * @see https://auth0.com/docs/api/management/v2#!/prompts/put-partials - */ - public Request setPartialsPrompt(String prompt, Object partials) { - Asserts.assertNotNull(prompt, "prompt"); - Asserts.assertNotNull(partials, "partials"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(prompt) - .addPathSegment("partials"); - - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - - request.setBody(partials); - return request; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/RawActionsClient.java b/src/main/java/com/auth0/client/mgmt/RawActionsClient.java new file mode 100644 index 000000000..eaed26c01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawActionsClient.java @@ -0,0 +1,544 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Action; +import com.auth0.client.mgmt.types.CreateActionRequestContent; +import com.auth0.client.mgmt.types.CreateActionResponseContent; +import com.auth0.client.mgmt.types.DeleteActionRequestParameters; +import com.auth0.client.mgmt.types.DeployActionResponseContent; +import com.auth0.client.mgmt.types.GetActionResponseContent; +import com.auth0.client.mgmt.types.ListActionsPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListActionsRequestParameters; +import com.auth0.client.mgmt.types.TestActionRequestContent; +import com.auth0.client.mgmt.types.TestActionResponseContent; +import com.auth0.client.mgmt.types.UpdateActionRequestContent; +import com.auth0.client.mgmt.types.UpdateActionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawActionsClient { + protected final ClientOptions clientOptions; + + public RawActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all actions. + */ + public ManagementApiHttpResponse> list() { + return list(ListActionsRequestParameters.builder().build()); + } + + /** + * Retrieve all actions. + */ + public ManagementApiHttpResponse> list(ListActionsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve all actions. + */ + public ManagementApiHttpResponse> list( + ListActionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions"); + QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "actionName", request.getActionName(), false); + QueryStringMapper.addQueryParameter(httpUrl, "deployed", request.getDeployed(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "installed", request.getInstalled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionsPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListActionsRequestParameters nextRequest = ListActionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getActions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public ManagementApiHttpResponse create(CreateActionRequestContent request) { + return create(request, null); + } + + /** + * Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow. + */ + public ManagementApiHttpResponse create( + CreateActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateActionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve an action by its ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve an action by its ID. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetActionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, DeleteActionRequestParameters.builder().build()); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public ManagementApiHttpResponse delete(String id, DeleteActionRequestParameters request) { + return delete(id, request, null); + } + + /** + * Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. + */ + public ManagementApiHttpResponse delete( + String id, DeleteActionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "force", request.getForce(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateActionRequestContent.builder().build()); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public ManagementApiHttpResponse update( + String id, UpdateActionRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed. + */ + public ManagementApiHttpResponse update( + String id, UpdateActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateActionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public ManagementApiHttpResponse deploy(String id) { + return deploy(id, null); + } + + /** + * Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow. + */ + public ManagementApiHttpResponse deploy(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .addPathSegments("deploy") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeployActionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public ManagementApiHttpResponse test(String id, TestActionRequestContent request) { + return test(id, request, null); + } + + /** + * Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected. + */ + public ManagementApiHttpResponse test( + String id, TestActionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(id) + .addPathSegments("test") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TestActionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawBrandingClient.java b/src/main/java/com/auth0/client/mgmt/RawBrandingClient.java new file mode 100644 index 000000000..443ce6889 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawBrandingClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBrandingResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingRequestContent; +import com.auth0.client.mgmt.types.UpdateBrandingResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBrandingClient { + protected final ClientOptions clientOptions; + + public RawBrandingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve branding settings. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Retrieve branding settings. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetBrandingResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update branding settings. + */ + public ManagementApiHttpResponse update() { + return update(UpdateBrandingRequestContent.builder().build()); + } + + /** + * Update branding settings. + */ + public ManagementApiHttpResponse update(UpdateBrandingRequestContent request) { + return update(request, null); + } + + /** + * Update branding settings. + */ + public ManagementApiHttpResponse update( + UpdateBrandingRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateBrandingResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java new file mode 100644 index 000000000..4c902ffb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; +import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.UpdateClientGrantRequestContent; +import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawClientGrantsClient { + protected final ClientOptions clientOptions; + + public RawClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public ManagementApiHttpResponse> list() { + return list(ListClientGrantsRequestParameters.builder().build()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public ManagementApiHttpResponse> list( + ListClientGrantsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + */ + public ManagementApiHttpResponse> list( + ListClientGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "allow_any_organization", request.getAllowAnyOrganization(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientGrantPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientGrantPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListClientGrantsRequestParameters nextRequest = ListClientGrantsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getClientGrants().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse create(CreateClientGrantRequestContent request) { + return create(request, null); + } + + /** + * Create a client grant for a machine-to-machine login flow. To learn more, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse create( + CreateClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateClientGrantResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete the <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a> from your machine-to-machine application. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a client grant. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateClientGrantRequestContent.builder().build()); + } + + /** + * Update a client grant. + */ + public ManagementApiHttpResponse update( + String id, UpdateClientGrantRequestContent request) { + return update(id, request, null); + } + + /** + * Update a client grant. + */ + public ManagementApiHttpResponse update( + String id, UpdateClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateClientGrantResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawClientsClient.java b/src/main/java/com/auth0/client/mgmt/RawClientsClient.java new file mode 100644 index 000000000..7d65da57f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawClientsClient.java @@ -0,0 +1,734 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Client; +import com.auth0.client.mgmt.types.CreateClientRequestContent; +import com.auth0.client.mgmt.types.CreateClientResponseContent; +import com.auth0.client.mgmt.types.GetClientRequestParameters; +import com.auth0.client.mgmt.types.GetClientResponseContent; +import com.auth0.client.mgmt.types.ListClientsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListClientsRequestParameters; +import com.auth0.client.mgmt.types.RotateClientSecretResponseContent; +import com.auth0.client.mgmt.types.UpdateClientRequestContent; +import com.auth0.client.mgmt.types.UpdateClientResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawClientsClient { + protected final ClientOptions clientOptions; + + public RawClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> list() { + return list(ListClientsRequestParameters.builder().build()); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> list(ListClientsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following can be retrieved with any scope: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scope: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the + * <code>read:client_keys</code> or <code>read:client_credentials</code> scope: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> list( + ListClientsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "is_global", request.getIsGlobal(), false); + QueryStringMapper.addQueryParameter(httpUrl, "is_first_party", request.getIsFirstParty(), false); + QueryStringMapper.addQueryParameter(httpUrl, "app_type", request.getAppType(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + JsonNode node = ObjectMappers.JSON_MAPPER.readTree(responseBodyString); + ListClientsOffsetPaginatedResponseContent parsedResponse; + if (node.isArray()) { + List clients = + ObjectMappers.JSON_MAPPER.convertValue(node, new TypeReference>() {}); + parsedResponse = ListClientsOffsetPaginatedResponseContent.builder() + .clients(clients) + .build(); + } else { + parsedResponse = ObjectMappers.JSON_MAPPER.convertValue( + node, ListClientsOffsetPaginatedResponseContent.class); + } + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListClientsRequestParameters nextRequest = ListClientsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getClients().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public ManagementApiHttpResponse create(CreateClientRequestContent request) { + return create(request, null); + } + + /** + * Create a new client (application or SSO integration). For more information, read <a href="https://www.auth0.com/docs/get-started/auth0-overview/create-applications">Create Applications</a> + * <a href="https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on>">API Endpoints for Single Sign-On</a>. + *

Notes:

+ *
    + *
  • We recommend leaving the client_secret parameter unspecified to allow the generation of a safe secret.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use + * <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> + * to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, specify fully defined credentials. + * These credentials will be automatically enabled for Private Key JWT authentication on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>create:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
+ *

<div class="alert alert-warning">SSO Integrations created via this endpoint will accept login requests and share user profile information.</div>

+ */ + public ManagementApiHttpResponse create( + CreateClientRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateClientResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetClientRequestParameters.builder().build()); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse get(String id, GetClientRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified. + * For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

<ul> + * <li> + * The following properties can be retrieved with any of the scopes: + * <code>client_id</code>, <code>app_type</code>, <code>name</code>, and <code>description</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:clients</code> or + * <code>read:client_keys</code> scopes: + * <code>callbacks</code>, <code>oidc_logout</code>, <code>allowed_origins</code>, + * <code>web_origins</code>, <code>tenant</code>, <code>global</code>, <code>config_route</code>, + * <code>callback_url_template</code>, <code>jwt_configuration</code>, + * <code>jwt_configuration.lifetime_in_seconds</code>, <code>jwt_configuration.secret_encoded</code>, + * <code>jwt_configuration.scopes</code>, <code>jwt_configuration.alg</code>, <code>api_type</code>, + * <code>logo_uri</code>, <code>allowed_clients</code>, <code>owners</code>, <code>custom_login_page</code>, + * <code>custom_login_page_off</code>, <code>sso</code>, <code>addons</code>, <code>form_template</code>, + * <code>custom_login_page_codeview</code>, <code>resource_servers</code>, <code>client_metadata</code>, + * <code>mobile</code>, <code>mobile.android</code>, <code>mobile.ios</code>, <code>allowed_logout_urls</code>, + * <code>token_endpoint_auth_method</code>, <code>is_first_party</code>, <code>oidc_conformant</code>, + * <code>is_token_endpoint_ip_header_trusted</code>, <code>initiate_login_uri</code>, <code>grant_types</code>, + * <code>refresh_token</code>, <code>refresh_token.rotation_type</code>, <code>refresh_token.expiration_type</code>, + * <code>refresh_token.leeway</code>, <code>refresh_token.token_lifetime</code>, <code>refresh_token.policies</code>, <code>organization_usage</code>, + * <code>organization_require_behavior</code>. + * </li> + * <li> + * The following properties can only be retrieved with the <code>read:client_keys</code> or <code>read:client_credentials</code> scopes: + * <code>encryption_key</code>, <code>encryption_key.pub</code>, <code>encryption_key.cert</code>, + * <code>client_secret</code>, <code>client_authentication_methods</code> and <code>signing_key</code>. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse get( + String id, GetClientRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetClientResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a client and related configuration (rules, connections, etc). + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateClientRequestContent.builder().build()); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public ManagementApiHttpResponse update( + String id, UpdateClientRequestContent request) { + return update(id, request, null); + } + + /** + * Updates a client's settings. For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>. + *

Notes:

+ *
    + *
  • The client_secret and signing_key attributes can only be updated with the update:client_keys scope.
  • + *
  • The <code>client_authentication_methods</code> and <code>token_endpoint_auth_method</code> properties are mutually exclusive. Use <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method. Otherwise, use <code>token_endpoint_auth_method</code> to configure the client with client secret (basic or post) or with no authentication method (none).
  • + *
  • When using <code>client_authentication_methods</code> to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
  • + *
  • To configure <code>client_authentication_methods</code>, the <code>update:client_credentials</code> scope is required.
  • + *
  • To configure <code>client_authentication_methods</code>, the property <code>jwt_configuration.alg</code> must be set to RS256.
  • + *
  • To change a client's <code>is_first_party</code> property to <code>false</code>, the <code>organization_usage</code> and <code>organization_require_behavior</code> properties must be unset.
  • + *
+ */ + public ManagementApiHttpResponse update( + String id, UpdateClientRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateClientResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public ManagementApiHttpResponse rotateSecret(String id) { + return rotateSecret(id, null); + } + + /** + * Rotate a client secret. + *

This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

+ *

For more information, read <a href="https://www.auth0.com/docs/get-started/applications/rotate-client-secret">Rotate Client Secrets</a>.

+ */ + public ManagementApiHttpResponse rotateSecret( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .addPathSegments("rotate-secret") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RotateClientSecretResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java new file mode 100644 index 000000000..19eb96d41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java @@ -0,0 +1,525 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.CreateConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionResponseContent; +import com.auth0.client.mgmt.types.GetConnectionRequestParameters; +import com.auth0.client.mgmt.types.GetConnectionResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsCheckpointPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsQueryParameters; +import com.auth0.client.mgmt.types.UpdateConnectionRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectionsClient { + protected final ClientOptions clientOptions; + + public RawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list() { + return list(ListConnectionsQueryParameters.builder().build()); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + ListConnectionsQueryParameters request) { + return list(request, null); + } + + /** + * Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + ListConnectionsQueryParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "name", request.getName(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getStrategy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "strategy", request.getStrategy().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListConnectionsCheckpointPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionsCheckpointPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListConnectionsQueryParameters nextRequest = ListConnectionsQueryParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getConnections().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public ManagementApiHttpResponse create(CreateConnectionRequestContent request) { + return create(request, null); + } + + /** + * Creates a new connection according to the JSON object received in <code>body</code>.<br/> + */ + public ManagementApiHttpResponse create( + CreateConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetConnectionRequestParameters.builder().build()); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public ManagementApiHttpResponse get( + String id, GetConnectionRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration. + */ + public ManagementApiHttpResponse get( + String id, GetConnectionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Removes a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateConnectionRequestContent.builder().build()); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public ManagementApiHttpResponse update( + String id, UpdateConnectionRequestContent request) { + return update(id, request, null); + } + + /** + * Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration. + *

<b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ */ + public ManagementApiHttpResponse update( + String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public ManagementApiHttpResponse checkStatus(String id) { + return checkStatus(id, null); + } + + /** + * Retrieves the status of an ad/ldap connection referenced by its <code>ID</code>. <code>200 OK</code> http status code response is returned when the connection is online, otherwise a <code>404</code> status code is returned along with an error message + */ + public ManagementApiHttpResponse checkStatus(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("status") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java new file mode 100644 index 000000000..16d134937 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java @@ -0,0 +1,591 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.CustomDomain; +import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.VerifyCustomDomainResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomDomainsClient { + protected final ClientOptions clientOptions; + + public RawCustomDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public ManagementApiHttpResponse create( + CreateCustomDomainRequestContent request) { + return create(request, null); + } + + /** + * Create a new custom domain. + *

Note: The custom domain will need to be verified before it will accept + * requests.

+ *

Optional attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ */ + public ManagementApiHttpResponse create( + CreateCustomDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateCustomDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a custom domain configuration and status. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve a custom domain configuration and status. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetCustomDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a custom domain and stop serving requests for it. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateCustomDomainRequestContent.builder().build()); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public ManagementApiHttpResponse update( + String id, UpdateCustomDomainRequestContent request) { + return update(id, request, null); + } + + /** + * Update a custom domain. + *

These are the attributes that can be updated:

+ *
    + *
  • custom_client_ip_header
  • + *
  • tls_policy
  • + *
+ *

<h5>Updating CUSTOM_CLIENT_IP_HEADER for a custom domain</h5>To update the <code>custom_client_ip_header</code> for a domain, the body to + * send should be: + * <pre><code>{ "custom_client_ip_header": "cf-connecting-ip" }</code></pre>

+ *

<h5>Updating TLS_POLICY for a custom domain</h5>To update the <code>tls_policy</code> for a domain, the body to send should be: + * <pre><code>{ "tls_policy": "recommended" }</code></pre>

+ *

TLS Policies:

+ *
    + *
  • recommended - for modern usage this includes TLS 1.2 only
  • + *
+ *

Some considerations:

+ *
    + *
  • The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
  • + *
  • The <code>compatible</code> TLS policy is no longer supported.
  • + *
+ */ + public ManagementApiHttpResponse update( + String id, UpdateCustomDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateCustomDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Run the test process on a custom domain. + */ + public ManagementApiHttpResponse test(String id) { + return test(id, null); + } + + /** + * Run the test process on a custom domain. + */ + public ManagementApiHttpResponse test(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .addPathSegments("test") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TestCustomDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public ManagementApiHttpResponse verify(String id) { + return verify(id, null); + } + + /** + * Run the verification process on a custom domain. + *

Note: Check the <code>status</code> field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.

+ *

For <code>self_managed_certs</code>, when the custom domain is verified for the first time, the response will also include the <code>cname_api_key</code> which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.

+ *

<a href="https://auth0.com/docs/custom-domains#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Auth0 Managed certificates. + * <a href="https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership">Learn more</a> about verifying custom domains that use Self Managed certificates.

+ */ + public ManagementApiHttpResponse verify( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("custom-domains") + .addPathSegment(id) + .addPathSegments("verify") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, VerifyCustomDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java new file mode 100644 index 000000000..91afb578e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; +import com.auth0.client.mgmt.types.DeviceCredential; +import com.auth0.client.mgmt.types.ListDeviceCredentialsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListDeviceCredentialsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeviceCredentialsClient { + protected final ClientOptions clientOptions; + + public RawDeviceCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public ManagementApiHttpResponse> list() { + return list(ListDeviceCredentialsRequestParameters.builder().build()); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public ManagementApiHttpResponse> list( + ListDeviceCredentialsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve device credential information (<code>public_key</code>, <code>refresh_token</code>, or <code>rotating_refresh_token</code>) associated with a specific user. + */ + public ManagementApiHttpResponse> list( + ListDeviceCredentialsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "type", request.getType(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListDeviceCredentialsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListDeviceCredentialsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListDeviceCredentialsRequestParameters nextRequest = ListDeviceCredentialsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getDeviceCredentials().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public ManagementApiHttpResponse createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request) { + return createPublicKey(request, null); + } + + /** + * Create a device credential public key to manage refresh token rotation for a given <code>user_id</code>. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + *

When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read <a href="https://auth0.com/docs/get-started/tenant-settings/signing-keys"> Signing Keys</a>.

+ */ + public ManagementApiHttpResponse createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePublicKeyDeviceCredentialResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Permanently delete a device credential (such as a refresh token or public key) with the given ID. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("device-credentials") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawEmailTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/RawEmailTemplatesClient.java new file mode 100644 index 000000000..3e8c47f32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawEmailTemplatesClient.java @@ -0,0 +1,333 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.CreateEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.EmailTemplateNameEnum; +import com.auth0.client.mgmt.types.GetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.SetEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.SetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmailTemplatesClient { + protected final ClientOptions clientOptions; + + public RawEmailTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create an email template. + */ + public ManagementApiHttpResponse create( + CreateEmailTemplateRequestContent request) { + return create(request, null); + } + + /** + * Create an email template. + */ + public ManagementApiHttpResponse create( + CreateEmailTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEmailTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public ManagementApiHttpResponse get(EmailTemplateNameEnum templateName) { + return get(templateName, null); + } + + /** + * Retrieve an email template by pre-defined name. These names are verify_email, verify_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, and async_approval. The names change_password, and password_reset are also supported for legacy scenarios. + */ + public ManagementApiHttpResponse get( + EmailTemplateNameEnum templateName, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetEmailTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update an email template. + */ + public ManagementApiHttpResponse set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request) { + return set(templateName, request, null); + } + + /** + * Update an email template. + */ + public ManagementApiHttpResponse set( + EmailTemplateNameEnum templateName, SetEmailTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SetEmailTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify an email template. + */ + public ManagementApiHttpResponse update(EmailTemplateNameEnum templateName) { + return update(templateName, UpdateEmailTemplateRequestContent.builder().build()); + } + + /** + * Modify an email template. + */ + public ManagementApiHttpResponse update( + EmailTemplateNameEnum templateName, UpdateEmailTemplateRequestContent request) { + return update(templateName, request, null); + } + + /** + * Modify an email template. + */ + public ManagementApiHttpResponse update( + EmailTemplateNameEnum templateName, + UpdateEmailTemplateRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("email-templates") + .addPathSegment(templateName.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateEmailTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java new file mode 100644 index 000000000..2c3524b0e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; +import com.auth0.client.mgmt.types.EventStreamResponseContent; +import com.auth0.client.mgmt.types.EventStreamsCreateRequest; +import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; +import com.auth0.client.mgmt.types.GetEventStreamResponseContent; +import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; +import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEventStreamsClient { + protected final ClientOptions clientOptions; + + public RawEventStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list() { + return list(ListEventStreamsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list(ListEventStreamsRequestParameters request) { + return list(request, null); + } + + public ManagementApiHttpResponse> list( + ListEventStreamsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create(EventStreamsCreateRequest request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + EventStreamsCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateEventStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetEventStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateEventStreamRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update( + String id, UpdateEventStreamRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, UpdateEventStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateEventStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse getStats(String id) { + return getStats(id, EventStreamsGetStatsRequest.builder().build()); + } + + public ManagementApiHttpResponse getStats( + String id, EventStreamsGetStatsRequest request) { + return getStats(id, request, null); + } + + public ManagementApiHttpResponse getStats( + String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("stats"); + QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEventStreamStatsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse test( + String id, CreateEventStreamTestEventRequestContent request) { + return test(id, request, null); + } + + public ManagementApiHttpResponse test( + String id, CreateEventStreamTestEventRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("test") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEventStreamTestEventResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java b/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java new file mode 100644 index 000000000..d51337ba9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateFlowRequestContent; +import com.auth0.client.mgmt.types.CreateFlowResponseContent; +import com.auth0.client.mgmt.types.FlowSummary; +import com.auth0.client.mgmt.types.FlowsListRequest; +import com.auth0.client.mgmt.types.GetFlowRequestParameters; +import com.auth0.client.mgmt.types.GetFlowResponseContent; +import com.auth0.client.mgmt.types.ListFlowsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowRequestContent; +import com.auth0.client.mgmt.types.UpdateFlowResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFlowsClient { + protected final ClientOptions clientOptions; + + public RawFlowsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list() { + return list(FlowsListRequest.builder().build()); + } + + public ManagementApiHttpResponse> list(FlowsListRequest request) { + return list(request, null); + } + + public ManagementApiHttpResponse> list( + FlowsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "synchronous", request.getSynchronous(), false); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFlowsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + FlowsListRequest nextRequest = FlowsListRequest.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getFlows().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create(CreateFlowRequestContent request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + CreateFlowRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateFlowResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, GetFlowRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse get(String id, GetFlowRequestParameters request) { + return get(id, request, null); + } + + public ManagementApiHttpResponse get( + String id, GetFlowRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetFlowResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateFlowRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update(String id, UpdateFlowRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, UpdateFlowRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateFlowResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawFormsClient.java b/src/main/java/com/auth0/client/mgmt/RawFormsClient.java new file mode 100644 index 000000000..2ffeb21c5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawFormsClient.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateFormRequestContent; +import com.auth0.client.mgmt.types.CreateFormResponseContent; +import com.auth0.client.mgmt.types.FormSummary; +import com.auth0.client.mgmt.types.GetFormRequestParameters; +import com.auth0.client.mgmt.types.GetFormResponseContent; +import com.auth0.client.mgmt.types.ListFormsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListFormsRequestParameters; +import com.auth0.client.mgmt.types.UpdateFormRequestContent; +import com.auth0.client.mgmt.types.UpdateFormResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFormsClient { + protected final ClientOptions clientOptions; + + public RawFormsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list() { + return list(ListFormsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list(ListFormsRequestParameters request) { + return list(request, null); + } + + public ManagementApiHttpResponse> list( + ListFormsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFormsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFormsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListFormsRequestParameters nextRequest = ListFormsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getForms().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create(CreateFormRequestContent request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + CreateFormRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateFormResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, GetFormRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse get(String id, GetFormRequestParameters request) { + return get(id, request, null); + } + + public ManagementApiHttpResponse get( + String id, GetFormRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetFormResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateFormRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update(String id, UpdateFormRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, UpdateFormRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("forms") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateFormResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawHooksClient.java b/src/main/java/com/auth0/client/mgmt/RawHooksClient.java new file mode 100644 index 000000000..d987bd366 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawHooksClient.java @@ -0,0 +1,416 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateHookRequestContent; +import com.auth0.client.mgmt.types.CreateHookResponseContent; +import com.auth0.client.mgmt.types.GetHookRequestParameters; +import com.auth0.client.mgmt.types.GetHookResponseContent; +import com.auth0.client.mgmt.types.Hook; +import com.auth0.client.mgmt.types.ListHooksOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListHooksRequestParameters; +import com.auth0.client.mgmt.types.UpdateHookRequestContent; +import com.auth0.client.mgmt.types.UpdateHookResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawHooksClient { + protected final ClientOptions clientOptions; + + public RawHooksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse> list() { + return list(ListHooksRequestParameters.builder().build()); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse> list(ListHooksRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse> list( + ListHooksRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListHooksOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListHooksOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListHooksRequestParameters nextRequest = ListHooksRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getHooks().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new hook. + */ + public ManagementApiHttpResponse create(CreateHookRequestContent request) { + return create(request, null); + } + + /** + * Create a new hook. + */ + public ManagementApiHttpResponse create( + CreateHookRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateHookResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetHookRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public ManagementApiHttpResponse get(String id, GetHookRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. + */ + public ManagementApiHttpResponse get( + String id, GetHookRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetHookResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a hook. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a hook. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update an existing hook. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateHookRequestContent.builder().build()); + } + + /** + * Update an existing hook. + */ + public ManagementApiHttpResponse update(String id, UpdateHookRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing hook. + */ + public ManagementApiHttpResponse update( + String id, UpdateHookRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateHookResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawJobsClient.java b/src/main/java/com/auth0/client/mgmt/RawJobsClient.java new file mode 100644 index 000000000..65b0c8df7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawJobsClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetJobResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawJobsClient { + protected final ClientOptions clientOptions; + + public RawJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves a job. Useful to check its status. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieves a job. Useful to check its status. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetJobResponseContent.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawLogStreamsClient.java b/src/main/java/com/auth0/client/mgmt/RawLogStreamsClient.java new file mode 100644 index 000000000..08fdd83d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawLogStreamsClient.java @@ -0,0 +1,1052 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateLogStreamRequestContent; +import com.auth0.client.mgmt.types.CreateLogStreamResponseContent; +import com.auth0.client.mgmt.types.GetLogStreamResponseContent; +import com.auth0.client.mgmt.types.LogStreamResponseSchema; +import com.auth0.client.mgmt.types.UpdateLogStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateLogStreamResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLogStreamsClient { + protected final ClientOptions clientOptions; + + public RawLogStreamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/logs/streams">log streams</a>. + *

<h5>Sample Response</h5><pre><code>[{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }, { + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "eventgrid", + * "status": "active|paused|suspended", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }, + * { + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }]</code></pre>

+ */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse create(CreateLogStreamRequestContent request) { + return create(request, null); + } + + /** + * Create a log stream. + *

<h5>Log Stream Types</h5> The <code>type</code> of log stream being created determines the properties required in the <code>sink</code> payload. + * <h5>HTTP Stream</h5> For an <code>http</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "http", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Amazon EventBridge Stream</h5> For an <code>eventbridge</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventbridge", + * "sink": { + * "awsRegion": "string", + * "awsAccountId": "string" + * } + * }</code></pre> + * The response will include an additional field <code>awsPartnerEventSource</code> in the <code>sink</code>: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> + * <h5>Azure Event Grid Stream</h5> For an <code>Azure Event Grid</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "eventgrid", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active", + * "sink": { + * "azureSubscriptionId": "string", + * "azureResourceGroup": "string", + * "azureRegion": "string", + * "azurePartnerTopic": "string" + * } + * }</code></pre> + * <h5>Datadog Stream</h5> For a <code>Datadog</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "datadog", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Splunk Stream</h5> For a <code>Splunk</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "splunk", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Sumo Logic Stream</h5> For a <code>Sumo Logic</code> Stream, the <code>sink</code> properties are listed in the payload below + * Request: <pre><code>{ + * "name": "string", + * "type": "sumo", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> + * Response: <pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse create( + CreateLogStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateLogStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve a log stream configuration and status. + *

<h5>Sample responses</h5><h5>Amazon EventBridge Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "eventbridge", + * "status": "active|paused|suspended", + * "sink": { + * "awsAccountId": "string", + * "awsRegion": "string", + * "awsPartnerEventSource": "string" + * } + * }</code></pre> <h5>HTTP Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "http", + * "status": "active|paused|suspended", + * "sink": { + * "httpContentFormat": "JSONLINES|JSONARRAY", + * "httpContentType": "string", + * "httpEndpoint": "string", + * "httpAuthorization": "string" + * } + * }</code></pre> <h5>Datadog Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "datadog", + * "status": "active|paused|suspended", + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * }

+ *

}</code></pre><h5>Mixpanel</h5>

+ *
Request: <pre><code>{
+     *   "name": "string",
+     *   "type": "mixpanel",
+     *   "sink": {
+     * 	"mixpanelRegion": "string", // "us" | "eu",
+     * 	"mixpanelProjectId": "string",
+     * 	"mixpanelServiceAccountUsername": "string",
+     * 	"mixpanelServiceAccountPassword": "string"
+     *   }
+     * } </code></pre>
+     *
+     *
+     * Response: <pre><code>{
+     * 	"id": "string",
+     * 	"name": "string",
+     * 	"type": "mixpanel",
+     * 	"status": "active",
+     * 	"sink": {
+     * 	  "mixpanelRegion": "string", // "us" | "eu",
+     * 	  "mixpanelProjectId": "string",
+     * 	  "mixpanelServiceAccountUsername": "string",
+     * 	  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+     * 	}
+     *   } </code></pre>
+     *
+     * <h5>Segment</h5>
+     *
+     * Request: <pre><code> {
+     *   "name": "string",
+     *   "type": "segment",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * }</code></pre>
+     *
+     * Response: <pre><code>{
+     *   "id": "string",
+     *   "name": "string",
+     *   "type": "segment",
+     *   "status": "active",
+     *   "sink": {
+     * 	"segmentWriteKey": "string"
+     *   }
+     * } </code></pre>
+     * 
+ *

<h5>Splunk Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "splunk", + * "status": "active|paused|suspended", + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> <h5>Sumo Logic Log Stream</h5><pre><code>{ + * "id": "string", + * "name": "string", + * "type": "sumo", + * "status": "active|paused|suspended", + * "sink": { + * "sumoSourceAddress": "string", + * } + * }</code></pre> <h5>Status</h5> The <code>status</code> of a log stream maybe any of the following: + * 1. <code>active</code> - Stream is currently enabled. + * 2. <code>paused</code> - Stream is currently user disabled and will not attempt log delivery. + * 3. <code>suspended</code> - Stream is currently disabled because of errors and will not attempt log delivery.

+ */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetLogStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a log stream. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a log stream. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateLogStreamRequestContent.builder().build()); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update( + String id, UpdateLogStreamRequestContent request) { + return update(id, request, null); + } + + /** + * Update a log stream. + *

<h4>Examples of how to use the PATCH endpoint.</h4> The following fields may be updated in a PATCH operation: <ul><li>name</li><li>status</li><li>sink</li></ul> Note: For log streams of type <code>eventbridge</code> and <code>eventgrid</code>, updating the <code>sink</code> is not permitted. + * <h5>Update the status of a log stream</h5><pre><code>{ + * "status": "active|paused" + * }</code></pre> + * <h5>Update the name of a log stream</h5><pre><code>{ + * "name": "string" + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>http</code></h5><pre><code>{ + * "sink": { + * "httpEndpoint": "string", + * "httpContentType": "string", + * "httpContentFormat": "JSONARRAY|JSONLINES", + * "httpAuthorization": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>datadog</code></h5><pre><code>{ + * "sink": { + * "datadogRegion": "string", + * "datadogApiKey": "string" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>splunk</code></h5><pre><code>{ + * "sink": { + * "splunkDomain": "string", + * "splunkToken": "string", + * "splunkPort": "string", + * "splunkSecure": "boolean" + * } + * }</code></pre> + * <h5>Update the sink properties of a stream of type <code>sumo</code></h5><pre><code>{ + * "sink": { + * "sumoSourceAddress": "string" + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update( + String id, UpdateLogStreamRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("log-streams") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateLogStreamResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawLogsClient.java b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java new file mode 100644 index 000000000..e3c6a5b18 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetLogResponseContent; +import com.auth0.client.mgmt.types.ListLogOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListLogsRequestParameters; +import com.auth0.client.mgmt.types.Log; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLogsClient { + protected final ClientOptions clientOptions; + + public RawLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public ManagementApiHttpResponse> list() { + return list(ListLogsRequestParameters.builder().build()); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public ManagementApiHttpResponse> list(ListLogsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + *

Set custom search criteria using the <code>q</code> parameter, or search from a specific log ID (<i>"search from checkpoint"</i>).

+ *

For more information on all possible event types, their respective acronyms, and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

<h5>To set custom search criteria, use the following parameters:</h5>

+ *

<ul> + * <li><b>q:</b> Search Criteria using <a href="https://auth0.com/docs/logs/log-search-query-syntax">Query String Syntax</a></li> + * <li><b>page:</b> Page index of the results to return. First page is 0.</li> + * <li><b>per_page:</b> Number of results per page.</li> + * <li><b>sort:</b> Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`</li> + * <li><b>fields:</b> Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.</li> + * <li><b>include_fields:</b> Whether specified fields are to be included (true) or excluded (false).</li> + * <li><b>include_totals:</b> Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). <b>Deprecated:</b> this field is deprecated and should be removed from use. See <a href="https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination">Search Engine V3 Breaking Changes</a></li> + * </ul>

+ *

For more information on the list of fields that can be used in <code>fields</code> and <code>sort</code>, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint">get logs by checkpoint method</a>.

+ *

<h5>To search from a checkpoint log ID, use the following parameters:</h5> + * <ul> + * <li><b>from:</b> Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the <code>take</code> parameter. If you use <code>from</code> at the same time as <code>q</code>, <code>from</code> takes precedence and <code>q</code> is ignored.</li> + * <li><b>take:</b> Number of entries to retrieve when using the <code>from</code> parameter.</li> + * </ul>

+ *

<strong>Important:</strong> When fetching logs from a checkpoint log ID, any parameter other than <code>from</code> and <code>take</code> will be ignored, and date ordering is not guaranteed.

+ */ + public ManagementApiHttpResponse> list( + ListLogsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("logs"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListLogOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListLogOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListLogsRequestParameters nextRequest = ListLogsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getLogs().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve an individual log event. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve an individual log event. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("logs") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetLogResponseContent.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java new file mode 100644 index 000000000..002706c58 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsRequestParameters; +import com.auth0.client.mgmt.types.NetworkAclsResponseContent; +import com.auth0.client.mgmt.types.SetNetworkAclRequestContent; +import com.auth0.client.mgmt.types.SetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawNetworkAclsClient { + protected final ClientOptions clientOptions; + + public RawNetworkAclsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all access control list entries for your client. + */ + public ManagementApiHttpResponse> list() { + return list(ListNetworkAclsRequestParameters.builder().build()); + } + + /** + * Get all access control list entries for your client. + */ + public ManagementApiHttpResponse> list( + ListNetworkAclsRequestParameters request) { + return list(request, null); + } + + /** + * Get all access control list entries for your client. + */ + public ManagementApiHttpResponse> list( + ListNetworkAclsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListNetworkAclsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListNetworkAclsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListNetworkAclsRequestParameters nextRequest = ListNetworkAclsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getNetworkAcls().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new access control list for your client. + */ + public ManagementApiHttpResponse create(CreateNetworkAclRequestContent request) { + return create(request, null); + } + + /** + * Create a new access control list for your client. + */ + public ManagementApiHttpResponse create( + CreateNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific access control list entry for your client. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Get a specific access control list entry for your client. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetNetworkAclsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update existing access control list for your client. + */ + public ManagementApiHttpResponse set( + String id, SetNetworkAclRequestContent request) { + return set(id, request, null); + } + + /** + * Update existing access control list for your client. + */ + public ManagementApiHttpResponse set( + String id, SetNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SetNetworkAclsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete existing access control list for your client. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete existing access control list for your client. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update existing access control list for your client. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateNetworkAclRequestContent.builder().build()); + } + + /** + * Update existing access control list for your client. + */ + public ManagementApiHttpResponse update( + String id, UpdateNetworkAclRequestContent request) { + return update(id, request, null); + } + + /** + * Update existing access control list for your client. + */ + public ManagementApiHttpResponse update( + String id, UpdateNetworkAclRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("network-acls") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateNetworkAclResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java new file mode 100644 index 000000000..f743210c4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationByNameResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; +import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOrganizationsClient { + protected final ClientOptions clientOptions; + + public RawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list() { + return list(ListOrganizationsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + ListOrganizationsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total number of entries to retrieve when using the <code>from</code> parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + ListOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationsRequestParameters nextRequest = ListOrganizationsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getOrganizations().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public ManagementApiHttpResponse create( + CreateOrganizationRequestContent request) { + return create(request, null); + } + + /** + * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review <a href="https://auth0.com/docs/manage-users/organizations/create-first-organization">Create Your First Organization</a>. + */ + public ManagementApiHttpResponse create( + CreateOrganizationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public ManagementApiHttpResponse getByName(String name) { + return getByName(name, null); + } + + /** + * Retrieve details about a single Organization specified by name. + */ + public ManagementApiHttpResponse getByName( + String name, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations/name") + .addPathSegment(name) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationByNameResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Organization specified by ID. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetOrganizationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Remove an Organization from your tenant. This action cannot be undone. + *

<b>Note</b>: Members are automatically disassociated from an Organization when it is deleted. However, this action does <b>not</b> delete these users from your tenant.

+ */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateOrganizationRequestContent.builder().build()); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public ManagementApiHttpResponse update( + String id, UpdateOrganizationRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations">Organization</a>, such as name and display name, branding options, and metadata. + */ + public ManagementApiHttpResponse update( + String id, UpdateOrganizationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawPromptsClient.java b/src/main/java/com/auth0/client/mgmt/RawPromptsClient.java new file mode 100644 index 000000000..502a1d946 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawPromptsClient.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSettingsRequestContent; +import com.auth0.client.mgmt.types.UpdateSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPromptsClient { + protected final ClientOptions clientOptions; + + public RawPromptsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public ManagementApiHttpResponse getSettings() { + return getSettings(null); + } + + /** + * Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public ManagementApiHttpResponse getSettings(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public ManagementApiHttpResponse updateSettings() { + return updateSettings(UpdateSettingsRequestContent.builder().build()); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public ManagementApiHttpResponse updateSettings( + UpdateSettingsRequestContent request) { + return updateSettings(request, null); + } + + /** + * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features. + */ + public ManagementApiHttpResponse updateSettings( + UpdateSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java new file mode 100644 index 000000000..d9a850f2c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRefreshTokensClient { + protected final ClientOptions clientOptions; + + public RawRefreshTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve refresh token information. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve refresh token information. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetRefreshTokenResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a refresh token by its ID. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a refresh token by its ID. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java new file mode 100644 index 000000000..c8904a599 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; +import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; +import com.auth0.client.mgmt.types.GetResourceServerRequestParameters; +import com.auth0.client.mgmt.types.GetResourceServerResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerRequestParameters; +import com.auth0.client.mgmt.types.ResourceServer; +import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; +import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawResourceServersClient { + protected final ClientOptions clientOptions; + + public RawResourceServersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public ManagementApiHttpResponse> list() { + return list(ListResourceServerRequestParameters.builder().build()); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public ManagementApiHttpResponse> list( + ListResourceServerRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public ManagementApiHttpResponse> list( + ListResourceServerRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getIdentifiers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "identifiers", request.getIdentifiers().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListResourceServerOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListResourceServerOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListResourceServerRequestParameters nextRequest = ListResourceServerRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getResourceServers().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public ManagementApiHttpResponse create( + CreateResourceServerRequestContent request) { + return create(request, null); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public ManagementApiHttpResponse create( + CreateResourceServerRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateResourceServerResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetResourceServerRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public ManagementApiHttpResponse get( + String id, GetResourceServerRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public ManagementApiHttpResponse get( + String id, GetResourceServerRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetResourceServerResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateResourceServerRequestContent.builder().build()); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public ManagementApiHttpResponse update( + String id, UpdateResourceServerRequestContent request) { + return update(id, request, null); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public ManagementApiHttpResponse update( + String id, UpdateResourceServerRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("resource-servers") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateResourceServerResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java new file mode 100644 index 000000000..1c4371205 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java @@ -0,0 +1,400 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateRoleRequestContent; +import com.auth0.client.mgmt.types.CreateRoleResponseContent; +import com.auth0.client.mgmt.types.GetRoleResponseContent; +import com.auth0.client.mgmt.types.ListRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.UpdateRoleRequestContent; +import com.auth0.client.mgmt.types.UpdateRoleResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRolesClient { + protected final ClientOptions clientOptions; + + public RawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public ManagementApiHttpResponse> list() { + return list(ListRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public ManagementApiHttpResponse> list(ListRolesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public ManagementApiHttpResponse> list( + ListRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "name_filter", request.getNameFilter(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRolesOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRolesOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListRolesRequestParameters nextRequest = ListRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public ManagementApiHttpResponse create(CreateRoleRequestContent request) { + return create(request, null); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public ManagementApiHttpResponse create( + CreateRoleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateRoleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetRoleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateRoleRequestContent.builder().build()); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public ManagementApiHttpResponse update(String id, UpdateRoleRequestContent request) { + return update(id, request, null); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public ManagementApiHttpResponse update( + String id, UpdateRoleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateRoleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawRulesClient.java b/src/main/java/com/auth0/client/mgmt/RawRulesClient.java new file mode 100644 index 000000000..ccc35606b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawRulesClient.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateRuleRequestContent; +import com.auth0.client.mgmt.types.CreateRuleResponseContent; +import com.auth0.client.mgmt.types.GetRuleRequestParameters; +import com.auth0.client.mgmt.types.GetRuleResponseContent; +import com.auth0.client.mgmt.types.ListRulesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRulesRequestParameters; +import com.auth0.client.mgmt.types.Rule; +import com.auth0.client.mgmt.types.UpdateRuleRequestContent; +import com.auth0.client.mgmt.types.UpdateRuleResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRulesClient { + protected final ClientOptions clientOptions; + + public RawRulesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public ManagementApiHttpResponse> list() { + return list(ListRulesRequestParameters.builder().build()); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public ManagementApiHttpResponse> list(ListRulesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public ManagementApiHttpResponse> list( + ListRulesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRulesOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRulesOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListRulesRequestParameters nextRequest = ListRulesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRules().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public ManagementApiHttpResponse create(CreateRuleRequestContent request) { + return create(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public ManagementApiHttpResponse create( + CreateRuleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateRuleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetRuleRequestParameters.builder().build()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse get(String id, GetRuleRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public ManagementApiHttpResponse get( + String id, GetRuleRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetRuleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a rule. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a rule. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update an existing rule. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateRuleRequestContent.builder().build()); + } + + /** + * Update an existing rule. + */ + public ManagementApiHttpResponse update(String id, UpdateRuleRequestContent request) { + return update(id, request, null); + } + + /** + * Update an existing rule. + */ + public ManagementApiHttpResponse update( + String id, UpdateRuleRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateRuleResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawRulesConfigsClient.java b/src/main/java/com/auth0/client/mgmt/RawRulesConfigsClient.java new file mode 100644 index 000000000..46750c43e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawRulesConfigsClient.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.RulesConfig; +import com.auth0.client.mgmt.types.SetRulesConfigRequestContent; +import com.auth0.client.mgmt.types.SetRulesConfigResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRulesConfigsClient { + protected final ClientOptions clientOptions; + + public RawRulesConfigsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Sets a rules config variable. + */ + public ManagementApiHttpResponse set( + String key, SetRulesConfigRequestContent request) { + return set(key, request, null); + } + + /** + * Sets a rules config variable. + */ + public ManagementApiHttpResponse set( + String key, SetRulesConfigRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .addPathSegment(key) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SetRulesConfigResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a rules config variable identified by its key. + */ + public ManagementApiHttpResponse delete(String key) { + return delete(key, null); + } + + /** + * Delete a rules config variable identified by its key. + */ + public ManagementApiHttpResponse delete(String key, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rules-configs") + .addPathSegment(key) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java new file mode 100644 index 000000000..2437a132d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java @@ -0,0 +1,420 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.GetSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesRequestParameters; +import com.auth0.client.mgmt.types.SelfServiceProfile; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSelfServiceProfilesClient { + protected final ClientOptions clientOptions; + + public RawSelfServiceProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves self-service profiles. + */ + public ManagementApiHttpResponse> list() { + return list(ListSelfServiceProfilesRequestParameters.builder().build()); + } + + /** + * Retrieves self-service profiles. + */ + public ManagementApiHttpResponse> list( + ListSelfServiceProfilesRequestParameters request) { + return list(request, null); + } + + /** + * Retrieves self-service profiles. + */ + public ManagementApiHttpResponse> list( + ListSelfServiceProfilesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListSelfServiceProfilesPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListSelfServiceProfilesPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListSelfServiceProfilesRequestParameters nextRequest = + ListSelfServiceProfilesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getSelfServiceProfiles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Creates a self-service profile. + */ + public ManagementApiHttpResponse create( + CreateSelfServiceProfileRequestContent request) { + return create(request, null); + } + + /** + * Creates a self-service profile. + */ + public ManagementApiHttpResponse create( + CreateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateSelfServiceProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves a self-service profile by Id. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieves a self-service profile by Id. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSelfServiceProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Deletes a self-service profile by Id. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Deletes a self-service profile by Id. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Updates a self-service profile. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateSelfServiceProfileRequestContent.builder().build()); + } + + /** + * Updates a self-service profile. + */ + public ManagementApiHttpResponse update( + String id, UpdateSelfServiceProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Updates a self-service profile. + */ + public ManagementApiHttpResponse update( + String id, UpdateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSelfServiceProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java new file mode 100644 index 000000000..6f5a6badd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java @@ -0,0 +1,214 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSessionsClient { + protected final ClientOptions clientOptions; + + public RawSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve session information. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve session information. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetSessionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a session by ID. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a session by ID. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public ManagementApiHttpResponse revoke(String id) { + return revoke(id, null); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public ManagementApiHttpResponse revoke(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawStatsClient.java b/src/main/java/com/auth0/client/mgmt/RawStatsClient.java new file mode 100644 index 000000000..527b79764 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawStatsClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DailyStats; +import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawStatsClient { + protected final ClientOptions clientOptions; + + public RawStatsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public ManagementApiHttpResponse getActiveUsersCount() { + return getActiveUsersCount(null); + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public ManagementApiHttpResponse getActiveUsersCount(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("stats/active-users") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, double.class), response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public ManagementApiHttpResponse> getDaily() { + return getDaily(GetDailyStatsRequestParameters.builder().build()); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public ManagementApiHttpResponse> getDaily(GetDailyStatsRequestParameters request) { + return getDaily(request, null); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public ManagementApiHttpResponse> getDaily( + GetDailyStatsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("stats/daily"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawSupplementalSignalsClient.java b/src/main/java/com/auth0/client/mgmt/RawSupplementalSignalsClient.java new file mode 100644 index 000000000..a3a24d23a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawSupplementalSignalsClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.PatchSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.UpdateSupplementalSignalsRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSupplementalSignalsClient { + protected final ClientOptions clientOptions; + + public RawSupplementalSignalsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("supplemental-signals") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSupplementalSignalsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public ManagementApiHttpResponse patch( + UpdateSupplementalSignalsRequestContent request) { + return patch(request, null); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public ManagementApiHttpResponse patch( + UpdateSupplementalSignalsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("supplemental-signals") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PatchSupplementalSignalsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawTicketsClient.java b/src/main/java/com/auth0/client/mgmt/RawTicketsClient.java new file mode 100644 index 000000000..6befa0530 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawTicketsClient.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ChangePasswordTicketRequestContent; +import com.auth0.client.mgmt.types.ChangePasswordTicketResponseContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketRequestContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTicketsClient { + protected final ClientOptions clientOptions; + + public RawTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public ManagementApiHttpResponse verifyEmail( + VerifyEmailTicketRequestContent request) { + return verifyEmail(request, null); + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public ManagementApiHttpResponse verifyEmail( + VerifyEmailTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tickets/email-verification") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VerifyEmailTicketResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ManagementApiHttpResponse changePassword() { + return changePassword(ChangePasswordTicketRequestContent.builder().build()); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ManagementApiHttpResponse changePassword( + ChangePasswordTicketRequestContent request) { + return changePassword(request, null); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ManagementApiHttpResponse changePassword( + ChangePasswordTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tickets/password-change") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ChangePasswordTicketResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java new file mode 100644 index 000000000..560994601 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java @@ -0,0 +1,416 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.GetTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.ListTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfilesListRequest; +import com.auth0.client.mgmt.types.UpdateTokenExchangeProfileRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTokenExchangeProfilesClient { + protected final ClientOptions clientOptions; + + public RawTokenExchangeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list() { + return list(TokenExchangeProfilesListRequest.builder().build()); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + TokenExchangeProfilesListRequest request) { + return list(request, null); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + TokenExchangeProfilesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListTokenExchangeProfileResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListTokenExchangeProfileResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + TokenExchangeProfilesListRequest nextRequest = TokenExchangeProfilesListRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTokenExchangeProfiles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse create( + CreateTokenExchangeProfileRequestContent request) { + return create(request, null); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse create( + CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateTokenExchangeProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetTokenExchangeProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateTokenExchangeProfileRequestContent.builder().build()); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse update(String id, UpdateTokenExchangeProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public ManagementApiHttpResponse update( + String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("token-exchange-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java new file mode 100644 index 000000000..1f08c7554 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; +import com.auth0.client.mgmt.types.ListUserBlocksRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUserBlocksClient { + protected final ClientOptions clientOptions; + + public RawUserBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public ManagementApiHttpResponse listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request) { + return listByIdentifier(request, null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public ManagementApiHttpResponse listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks"); + QueryStringMapper.addQueryParameter(httpUrl, "identifier", request.getIdentifier(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserBlocksByIdentifierResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public ManagementApiHttpResponse deleteByIdentifier(DeleteUserBlocksByIdentifierRequestParameters request) { + return deleteByIdentifier(request, null); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public ManagementApiHttpResponse deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks"); + QueryStringMapper.addQueryParameter(httpUrl, "identifier", request.getIdentifier(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ManagementApiHttpResponse list(String id) { + return list(id, ListUserBlocksRequestParameters.builder().build()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ManagementApiHttpResponse list( + String id, ListUserBlocksRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ManagementApiHttpResponse list( + String id, ListUserBlocksRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks") + .addPathSegment(id); + QueryStringMapper.addQueryParameter( + httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListUserBlocksResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-blocks") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java b/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java new file mode 100644 index 000000000..3bc16af29 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; +import com.auth0.client.mgmt.types.ListUserGrantsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; +import com.auth0.client.mgmt.types.UserGrant; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUserGrantsClient { + protected final ClientOptions clientOptions; + + public RawUserGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public ManagementApiHttpResponse> list() { + return list(ListUserGrantsRequestParameters.builder().build()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public ManagementApiHttpResponse> list(ListUserGrantsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public ManagementApiHttpResponse> list( + ListUserGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserGrantsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserGrantsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserGrantsRequestParameters nextRequest = ListUserGrantsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getGrants().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a grant associated with your account. + */ + public ManagementApiHttpResponse deleteByUserId(DeleteUserGrantByUserIdRequestParameters request) { + return deleteByUserId(request, null); + } + + /** + * Delete a grant associated with your account. + */ + public ManagementApiHttpResponse deleteByUserId( + DeleteUserGrantByUserIdRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants"); + QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a grant associated with your account. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a grant associated with your account. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("grants") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java new file mode 100644 index 000000000..972898d33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java @@ -0,0 +1,844 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.ServiceUnavailableError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.GetUserRequestParameters; +import com.auth0.client.mgmt.types.GetUserResponseContent; +import com.auth0.client.mgmt.types.ListUsersByEmailRequestParameters; +import com.auth0.client.mgmt.types.ListUsersOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; +import com.auth0.client.mgmt.types.RegenerateUsersRecoveryCodeResponseContent; +import com.auth0.client.mgmt.types.RevokeUserAccessRequestContent; +import com.auth0.client.mgmt.types.UpdateUserRequestContent; +import com.auth0.client.mgmt.types.UpdateUserResponseContent; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public ManagementApiHttpResponse> list() { + return list(ListUsersRequestParameters.builder().build()); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public ManagementApiHttpResponse> list(ListUsersRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public ManagementApiHttpResponse> list( + ListUsersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "connection", request.getConnection(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + QueryStringMapper.addQueryParameter(httpUrl, "search_engine", request.getSearchEngine(), false); + QueryStringMapper.addQueryParameter(httpUrl, "primary_order", request.getPrimaryOrder(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUsersOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUsersOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUsersRequestParameters nextRequest = ListUsersRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getUsers().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public ManagementApiHttpResponse create(CreateUserRequestContent request) { + return create(request, null); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public ManagementApiHttpResponse create( + CreateUserRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateUserResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public ManagementApiHttpResponse> listUsersByEmail( + ListUsersByEmailRequestParameters request) { + return listUsersByEmail(request, null); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public ManagementApiHttpResponse> listUsersByEmail( + ListUsersByEmailRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users-by-email"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, GetUserRequestParameters.builder().build()); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public ManagementApiHttpResponse get(String id, GetUserRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public ManagementApiHttpResponse get( + String id, GetUserRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetUserResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateUserRequestContent.builder().build()); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update(String id, UpdateUserRequestContent request) { + return update(id, request, null); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public ManagementApiHttpResponse update( + String id, UpdateUserRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateUserResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public ManagementApiHttpResponse regenerateRecoveryCode(String id) { + return regenerateRecoveryCode(id, null); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public ManagementApiHttpResponse regenerateRecoveryCode( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("recovery-code-regeneration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RegenerateUsersRecoveryCodeResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public ManagementApiHttpResponse revokeAccess(String id) { + return revokeAccess(id, RevokeUserAccessRequestContent.builder().build()); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public ManagementApiHttpResponse revokeAccess(String id, RevokeUserAccessRequestContent request) { + return revokeAccess(id, request, null); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public ManagementApiHttpResponse revokeAccess( + String id, RevokeUserAccessRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("revoke-access") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java new file mode 100644 index 000000000..03c975c3d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; + +public class RefreshTokensClient { + protected final ClientOptions clientOptions; + + private final RawRefreshTokensClient rawClient; + + public RefreshTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRefreshTokensClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRefreshTokensClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve refresh token information. + */ + public GetRefreshTokenResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve refresh token information. + */ + public GetRefreshTokenResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a refresh token by its ID. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a refresh token by its ID. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RefreshTokensEntity.java b/src/main/java/com/auth0/client/mgmt/RefreshTokensEntity.java deleted file mode 100644 index 6911aef2e..000000000 --- a/src/main/java/com/auth0/client/mgmt/RefreshTokensEntity.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.refreshtokens.RefreshToken; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Refresh Tokens methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Refresh_Tokens - *

- * This class is not thread-safe. - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class RefreshTokensEntity extends BaseManagementEntity{ - - RefreshTokensEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the refresh token for a given refresh token ID. - * A token with scope {@code read:refresh_tokens} is needed. - * See https://auth0.com/docs/api/management/v2/refresh-tokens/get-refresh-token - * @param refreshTokenId the refresh token ID. - * @return a Request to execute. - */ - public Request get(String refreshTokenId){ - Asserts.assertNotNull(refreshTokenId, "refresh token ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/refresh-tokens") - .addPathSegment(refreshTokenId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete the refresh token for a given refresh token ID. - * * A token with scope {@code delete:refresh_tokens} is needed. - * See https://auth0.com/docs/api/management/v2/refresh-tokens/delete-refresh-token - * @param refreshTokenId the refresh token ID. - * @return a Request to execute. - */ - public Request delete(String refreshTokenId){ - Asserts.assertNotNull(refreshTokenId, "refresh token ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/refresh-tokens") - .addPathSegment(refreshTokenId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/RequestBuilder.java b/src/main/java/com/auth0/client/mgmt/RequestBuilder.java deleted file mode 100644 index 2f8c0f3d0..000000000 --- a/src/main/java/com/auth0/client/mgmt/RequestBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.Map; - -class RequestBuilder { - private final Auth0HttpClient client; - private final TokenProvider tokenProvider; - private final HttpMethod method; - private final HttpUrl.Builder url; - private final TypeReference target; - - @Nullable - private Object body = null; - private final Map headers = new HashMap<>(); - private final Map parameters = new HashMap<>(); - - public RequestBuilder(Auth0HttpClient client, TokenProvider tokenProvider, HttpMethod method, HttpUrl baseUrl, TypeReference target) { - this.client = client; - this.tokenProvider = tokenProvider; - this.method = method; - this.url = baseUrl.newBuilder(); - this.target = target; - } - - public RequestBuilder withHeader(String name, String value) { - this.headers.put(name, value); - return this; - } - - public RequestBuilder withParameter(String name, Object value) { - this.parameters.put(name, value); - return this; - } - - public RequestBuilder withBody(Object body) { - this.body = body; - return this; - } - - public RequestBuilder withPathSegments(String path) { - url.addPathSegments(path); - return this; - } - - @SuppressWarnings("unchecked") - public Request build() { - BaseRequest request; - - final String url = this.url.build().toString(); - if ("java.lang.Void".equals(target.getType().getTypeName())) { - request = (BaseRequest) new VoidRequest(client, tokenProvider, url, method); - } else { - request = new BaseRequest<>(client, tokenProvider, url, method, target); - } - - if (body != null) { - request.setBody(body); - } - - headers.forEach(request::addHeader); - parameters.forEach(request::addParameter); - - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ResourceServerEntity.java b/src/main/java/com/auth0/client/mgmt/ResourceServerEntity.java deleted file mode 100644 index b9c271f0e..000000000 --- a/src/main/java/com/auth0/client/mgmt/ResourceServerEntity.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ResourceServersFilter; -import com.auth0.json.mgmt.resourceserver.ResourceServer; -import com.auth0.json.mgmt.resourceserver.ResourceServersPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Resource Server methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Resource_Servers - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class ResourceServerEntity extends BaseManagementEntity { - - ResourceServerEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Creates request to fetch all resource servers. - * See API documentation - * - * @param filter the filter to use. Can be null. - * @return request to execute - */ - public Request list(ResourceServersFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/resource-servers"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, - new TypeReference() { - }); - } - - /** - * Cretes request for fetching single resource server by it's ID. - * See API documentation - * - * @param resourceServerIdOrIdentifier {@link ResourceServer#id} or {@link ResourceServer#identifier} (audience) field - * @return request to execute - */ - public Request get(String resourceServerIdOrIdentifier) { - Asserts.assertNotNull(resourceServerIdOrIdentifier, "Resource server ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/resource-servers") - .addPathSegment(resourceServerIdOrIdentifier); - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, - new TypeReference() { - }); - } - - /** - * Cretes request for creation resource server - * See API documentation - * - * @param resourceServer resource server body - * @return request to execute - */ - public Request create(ResourceServer resourceServer) { - Asserts.assertNotNull(resourceServer, "Resource server"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/resource-servers"); - - String url = builder.build().toString(); - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, - new TypeReference() { - }); - request.setBody(resourceServer); - return request; - } - - /** - * Creates request for delete resource server by it's ID - * See API documentation - * - * @param resourceServerId {@link ResourceServer#id} field - * @return request to execute - */ - public Request delete(String resourceServerId) { - Asserts.assertNotNull(resourceServerId, "Resource server ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/resource-servers") - .addPathSegment(resourceServerId); - - String url = builder.build().toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Creates request for partial update of resource server. All null fields stay not changed. - * See API documentation - * - * @param resourceServerId {@link ResourceServer#id} field - * @param resourceServer {@link ResourceServer} body - * @return request to execute - */ - public Request update(String resourceServerId, ResourceServer resourceServer) { - Asserts.assertNotNull(resourceServerId, "resourceServerId"); - Asserts.assertNotNull(resourceServer, "resourceServer"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/resource-servers") - .addPathSegment(resourceServerId); - - String url = builder.build().toString(); - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, - new TypeReference() { - }); - request.setBody(resourceServer); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java new file mode 100644 index 000000000..7aad20870 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; +import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; +import com.auth0.client.mgmt.types.GetResourceServerRequestParameters; +import com.auth0.client.mgmt.types.GetResourceServerResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerRequestParameters; +import com.auth0.client.mgmt.types.ResourceServer; +import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; +import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; + +public class ResourceServersClient { + protected final ClientOptions clientOptions; + + private final RawResourceServersClient rawClient; + + public ResourceServersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawResourceServersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawResourceServersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public SyncPagingIterable list(ListResourceServerRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve details of all APIs associated with your tenant. + */ + public SyncPagingIterable list( + ListResourceServerRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CreateResourceServerResponseContent create(CreateResourceServerRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read <a href="https://www.auth0.com/docs/get-started/apis"> APIs</a>. + */ + public CreateResourceServerResponseContent create( + CreateResourceServerRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public GetResourceServerResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public GetResourceServerResponseContent get(String id, GetResourceServerRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/apis">API</a> details with the given ID. + */ + public GetResourceServerResponseContent get( + String id, GetResourceServerRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete an existing API by ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public UpdateResourceServerResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public UpdateResourceServerResponseContent update(String id, UpdateResourceServerRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Change an existing API setting by resource server ID. For more information, read <a href="https://www.auth0.com/docs/get-started/apis/api-settings">API Settings</a>. + */ + public UpdateResourceServerResponseContent update( + String id, UpdateResourceServerRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RolesClient.java b/src/main/java/com/auth0/client/mgmt/RolesClient.java new file mode 100644 index 000000000..09f7a1a83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RolesClient.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.PermissionsClient; +import com.auth0.client.mgmt.roles.UsersClient; +import com.auth0.client.mgmt.types.CreateRoleRequestContent; +import com.auth0.client.mgmt.types.CreateRoleResponseContent; +import com.auth0.client.mgmt.types.GetRoleResponseContent; +import com.auth0.client.mgmt.types.ListRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.UpdateRoleRequestContent; +import com.auth0.client.mgmt.types.UpdateRoleResponseContent; +import java.util.function.Supplier; + +public class RolesClient { + protected final ClientOptions clientOptions; + + private final RawRolesClient rawClient; + + protected final Supplier permissionsClient; + + protected final Supplier usersClient; + + public RolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRolesClient(clientOptions); + this.permissionsClient = Suppliers.memoize(() -> new PermissionsClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public SyncPagingIterable list(ListRolesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve detailed list of user roles created in your tenant. + *

<b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

+ */ + public SyncPagingIterable list(ListRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CreateRoleResponseContent create(CreateRoleRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

+ */ + public CreateRoleResponseContent create(CreateRoleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public GetRoleResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public GetRoleResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public UpdateRoleResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public UpdateRoleResponseContent update(String id, UpdateRoleRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. + */ + public UpdateRoleResponseContent update( + String id, UpdateRoleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public PermissionsClient permissions() { + return this.permissionsClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RolesEntity.java b/src/main/java/com/auth0/client/mgmt/RolesEntity.java deleted file mode 100644 index 69edd7a5c..000000000 --- a/src/main/java/com/auth0/client/mgmt/RolesEntity.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.client.mgmt.filter.RolesFilter; -import com.auth0.json.mgmt.permissions.Permission; -import com.auth0.json.mgmt.permissions.PermissionsPage; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Roles methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Roles/ - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -public class RolesEntity extends BaseManagementEntity { - - RolesEntity(Auth0HttpClient client, HttpUrl baseUrl, - TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all Roles created by this tenant that can be assigned to a given user or user group. - * A token with read:roles is needed - * See https://auth0.com/docs/api/management/v2#!/Roles/get_roles - * - * @param filter optional filtering and pagination criteria - * @return a Request to execute - */ - public Request list(RolesFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() {}); - } - - /** - * Get a single role created by this tenant that can be assigned to a given user or user group. - * A token with scope read:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/get_roles_by_id - * - * @param roleId the id of the user to retrieve. - * @return a Request to execute. - */ - public Request get(String roleId) { - Asserts.assertNotNull(roleId, "role id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId); - - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() {}); - } - - - /** - * Create a Role. - * A token with scope create:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/post_roles - * - * @param role the role data to set - * @return a Request to execute. - */ - public Request create(Role role) { - Asserts.assertNotNull(role, "role"); - - String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() {}); - request.setBody(role); - return request; - } - - /** - * Delete an existing Role. - * A token with scope delete:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/delete_roles_by_id - * - * @param roleId The id of the role to delete. - * @return a Request to execute. - */ - public Request delete(String roleId) { - Asserts.assertNotNull(roleId, "role id"); - - final String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .build() - .toString(); - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Role. - * A token with scope update:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/patch_roles_by_id - * - * @param roleId the role id - * @param role the role data to set. It can't include id. - * @return a Request to execute. - */ - public Request update(String roleId, Role role) { - Asserts.assertNotNull(roleId, "role id"); - Asserts.assertNotNull(role, "role"); - - String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() {}); - request.setBody(role); - return request; - } - - /** - * Lists the users that have been associated with a given role. - * A token with scope read:users and read:roles is needed. - * - * See https://auth0.com/docs/api/management/v2#!/Roles/get_role_user - * - * @param roleId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listUsers(String roleId, PageFilter filter) { - Asserts.assertNotNull(roleId, "role id"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .addEncodedPathSegment("users"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() {}); - } - - /** - * Assign users to a role. - * A token with update:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/post_role_users - * - * @param roleId the role id - * @param userIds a list of user ids to assign to the role - * @return a Request to execute. - */ - public Request assignUsers(String roleId, List userIds) { - Asserts.assertNotNull(roleId, "role id"); - Asserts.assertNotEmpty(userIds, "user ids"); - - Map> body = new HashMap<>(); - body.put("users", userIds); - - String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .addEncodedPathSegment("users") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.POST); - request.setBody(body); - return request; - } - - /** - * Get the permissions associated to the role. - * A token with read:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/get_permissions - * - * @param roleId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listPermissions(String roleId, PageFilter filter) { - Asserts.assertNotNull(roleId, "role id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .addEncodedPathSegment("permissions"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() {}); - } - - /** - * Un-associate permissions from a role. - * A token with update:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/delete_role_permission_assignment - * - * @param roleId the role id - * @param permissions a list of permission objects to un-associate from the role - * @return a Request to execute - */ - public Request removePermissions(String roleId, List permissions) { - Asserts.assertNotNull(roleId, "role id"); - Asserts.assertNotEmpty(permissions, "permissions"); - - Map> body = new HashMap<>(); - body.put("permissions", permissions); - - final String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .addEncodedPathSegment("permissions") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - request.setBody(body); - return request; - } - - /** - * Associate permissions with a role. Only the `permission_name` and - * `resource_server_identifier` Permission attributes should be specified. - * A token with update:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Roles/post_role_permission_assignment - * - * @param roleId the role id - * @param permissions a list of permission objects to associate to the role - * @return a Request to execute - */ - public Request addPermissions(String roleId, List permissions) { - Asserts.assertNotNull(roleId, "role id"); - Asserts.assertNotEmpty(permissions, "permissions"); - - Map> body = new HashMap<>(); - body.put("permissions", permissions); - - final String url = baseUrl - .newBuilder() - .addEncodedPathSegments("api/v2/roles") - .addEncodedPathSegment(roleId) - .addEncodedPathSegment("permissions") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.POST); - request.setBody(body); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/RulesClient.java b/src/main/java/com/auth0/client/mgmt/RulesClient.java new file mode 100644 index 000000000..9e9c9af7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RulesClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRuleRequestContent; +import com.auth0.client.mgmt.types.CreateRuleResponseContent; +import com.auth0.client.mgmt.types.GetRuleRequestParameters; +import com.auth0.client.mgmt.types.GetRuleResponseContent; +import com.auth0.client.mgmt.types.ListRulesRequestParameters; +import com.auth0.client.mgmt.types.Rule; +import com.auth0.client.mgmt.types.UpdateRuleRequestContent; +import com.auth0.client.mgmt.types.UpdateRuleResponseContent; + +public class RulesClient { + protected final ClientOptions clientOptions; + + private final RawRulesClient rawClient; + + public RulesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRulesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRulesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public SyncPagingIterable list(ListRulesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. + */ + public SyncPagingIterable list(ListRulesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CreateRuleResponseContent create(CreateRuleRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. + *

Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted.

+ */ + public CreateRuleResponseContent create(CreateRuleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public GetRuleResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public GetRuleResponseContent get(String id, GetRuleRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. + */ + public GetRuleResponseContent get(String id, GetRuleRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Delete a rule. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a rule. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update an existing rule. + */ + public UpdateRuleResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update an existing rule. + */ + public UpdateRuleResponseContent update(String id, UpdateRuleRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update an existing rule. + */ + public UpdateRuleResponseContent update( + String id, UpdateRuleRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RulesConfigsClient.java b/src/main/java/com/auth0/client/mgmt/RulesConfigsClient.java new file mode 100644 index 000000000..dfc8a3186 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RulesConfigsClient.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.RulesConfig; +import com.auth0.client.mgmt.types.SetRulesConfigRequestContent; +import com.auth0.client.mgmt.types.SetRulesConfigResponseContent; +import java.util.List; + +public class RulesConfigsClient { + protected final ClientOptions clientOptions; + + private final RawRulesConfigsClient rawClient; + + public RulesConfigsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRulesConfigsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRulesConfigsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve rules config variable keys. + *
Note: For security, config variable values cannot be retrieved outside rule execution.
+     * 
+ */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Sets a rules config variable. + */ + public SetRulesConfigResponseContent set(String key, SetRulesConfigRequestContent request) { + return this.rawClient.set(key, request).body(); + } + + /** + * Sets a rules config variable. + */ + public SetRulesConfigResponseContent set( + String key, SetRulesConfigRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(key, request, requestOptions).body(); + } + + /** + * Delete a rules config variable identified by its key. + */ + public void delete(String key) { + this.rawClient.delete(key).body(); + } + + /** + * Delete a rules config variable identified by its key. + */ + public void delete(String key, RequestOptions requestOptions) { + this.rawClient.delete(key, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RulesConfigsEntity.java b/src/main/java/com/auth0/client/mgmt/RulesConfigsEntity.java deleted file mode 100644 index ac4c740b5..000000000 --- a/src/main/java/com/auth0/client/mgmt/RulesConfigsEntity.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.rules.RulesConfig; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; - -/** - * Class that provides an implementation of the Rules Configs methods of the Management API as defined in See https://auth0.com/docs/api/management/v2#!/Rules_Configs/ - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class RulesConfigsEntity extends BaseManagementEntity { - - RulesConfigsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Rules Configs. A token with scope read:rules_configs is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules_Configs/get_rules_configs - *

- * Note: For security, config variable values cannot be retrieved outside rule execution. - * - * @return a Request to execute. - */ - public Request> list() { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules-configs"); - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Delete an existing Rules Config. A token with scope delete:rules_configs is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules_Configs/delete_rules_configs_by_key - * - * @param rulesConfigKey the rules config key - * @return a Request to execute. - */ - public Request delete(String rulesConfigKey) { - Asserts.assertNotNull(rulesConfigKey, "rules config key"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules-configs") - .addPathSegment(rulesConfigKey) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Rules Config. A token with scope update:rules_configs is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules_Configs/put_rules_configs_by_key - * - * @param rulesConfigKey the rules config key - * @param rulesConfig the rules config data to set. It can't include key. - * @return a Request to execute. - */ - public Request update(String rulesConfigKey, RulesConfig rulesConfig) { - Asserts.assertNotNull(rulesConfigKey, "rules config key"); - Asserts.assertNotNull(rulesConfig, "rules config"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules-configs") - .addPathSegment(rulesConfigKey) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - request.setBody(rulesConfig); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/RulesEntity.java b/src/main/java/com/auth0/client/mgmt/RulesEntity.java deleted file mode 100644 index 4cf81843f..000000000 --- a/src/main/java/com/auth0/client/mgmt/RulesEntity.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.RulesFilter; -import com.auth0.json.mgmt.rules.Rule; -import com.auth0.json.mgmt.rules.RulesPage; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.List; -import java.util.Map; - -/** - * Class that provides an implementation of the Rules methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Rules - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class RulesEntity extends BaseManagementEntity { - - RulesEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Rules. A token with scope read:rules is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules/get_rules - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request listAll(RulesFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request a Rule. A token with scope read:rules is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules/get_rules_by_id - * - * @param ruleId the id of the rule to retrieve. - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request get(String ruleId, RulesFilter filter) { - Asserts.assertNotNull(ruleId, "rule id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules") - .addPathSegment(ruleId); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a Rule. A token with scope create:rules is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules/post_rules - * - * @param rule the rule data to set - * @return a Request to execute. - */ - public Request create(Rule rule) { - Asserts.assertNotNull(rule, "rule"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(rule); - return request; - } - - /** - * Delete an existing Rule. A token with scope delete:rules is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules/delete_rules_by_id - * - * @param ruleId the rule id - * @return a Request to execute. - */ - public Request delete(String ruleId) { - Asserts.assertNotNull(ruleId, "rule id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules") - .addPathSegment(ruleId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing Rule. A token with scope update:rules is needed. - * See https://auth0.com/docs/api/management/v2#!/Rules/patch_rules_by_id - * - * @param ruleId the rule id - * @param rule the rule data to set. It can't include id. - * @return a Request to execute. - */ - public Request update(String ruleId, Rule rule) { - Asserts.assertNotNull(ruleId, "rule id"); - Asserts.assertNotNull(rule, "rule"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/rules") - .addPathSegment(ruleId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(rule); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesClient.java new file mode 100644 index 000000000..bf2791125 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesClient.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.selfserviceprofiles.CustomTextClient; +import com.auth0.client.mgmt.selfserviceprofiles.SsoTicketClient; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.GetSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesRequestParameters; +import com.auth0.client.mgmt.types.SelfServiceProfile; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileResponseContent; +import java.util.function.Supplier; + +public class SelfServiceProfilesClient { + protected final ClientOptions clientOptions; + + private final RawSelfServiceProfilesClient rawClient; + + protected final Supplier customTextClient; + + protected final Supplier ssoTicketClient; + + public SelfServiceProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSelfServiceProfilesClient(clientOptions); + this.customTextClient = Suppliers.memoize(() -> new CustomTextClient(clientOptions)); + this.ssoTicketClient = Suppliers.memoize(() -> new SsoTicketClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSelfServiceProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves self-service profiles. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieves self-service profiles. + */ + public SyncPagingIterable list(ListSelfServiceProfilesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieves self-service profiles. + */ + public SyncPagingIterable list( + ListSelfServiceProfilesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a self-service profile. + */ + public CreateSelfServiceProfileResponseContent create(CreateSelfServiceProfileRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a self-service profile. + */ + public CreateSelfServiceProfileResponseContent create( + CreateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieves a self-service profile by Id. + */ + public GetSelfServiceProfileResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieves a self-service profile by Id. + */ + public GetSelfServiceProfileResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Deletes a self-service profile by Id. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Deletes a self-service profile by Id. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Updates a self-service profile. + */ + public UpdateSelfServiceProfileResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Updates a self-service profile. + */ + public UpdateSelfServiceProfileResponseContent update(String id, UpdateSelfServiceProfileRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Updates a self-service profile. + */ + public UpdateSelfServiceProfileResponseContent update( + String id, UpdateSelfServiceProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public CustomTextClient customText() { + return this.customTextClient.get(); + } + + public SsoTicketClient ssoTicket() { + return this.ssoTicketClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesEntity.java b/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesEntity.java deleted file mode 100644 index 38d9373b3..000000000 --- a/src/main/java/com/auth0/client/mgmt/SelfServiceProfilesEntity.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.auth.AuthAPI; -import com.auth0.client.mgmt.filter.PageBasedPaginationFilter; -import com.auth0.json.mgmt.selfserviceprofiles.*; -import com.auth0.net.*; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -public class SelfServiceProfilesEntity extends BaseManagementEntity { - - private final static String ORGS_PATH = "api/v2/self-service-profiles"; - - SelfServiceProfilesEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the list of self-service profiles. - * A token with {@code read:self_service_profiles} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/get-self-service-profiles - * @param pageFilter the pagination filter to apply. Can be null to use the default values. - * @return a Request to execute. - */ - public Request get(PageBasedPaginationFilter pageFilter) { - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH); - - if (pageFilter != null) { - for (Map.Entry e : pageFilter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a new self-service profile. - * A token with {@code create:self_service_profiles} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/post-self-service-profiles - * @param selfServiceProfile the self-service profile to create. - * @return a Request to execute. - */ - public Request create(SelfServiceProfile selfServiceProfile) { - Asserts.assertNotNull(selfServiceProfile, "self service profile"); - Asserts.assertNotNull(selfServiceProfile.getName(), "name"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(selfServiceProfile); - return request; - } - - /** - * Request the self-service profile with the given ID. - * A token with {@code read:self_service_profiles} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/get-self-service-profiles-by-id - * @param id the self-service profile ID. - * @return a Request to execute. - */ - public Request getById(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build() - .toString(); - - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete the self-service profile with the given ID. - * A token with {@code delete:self_service_profiles} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/delete-self-service-profiles-by-id - * @param id the self-service profile ID. - * @return a Request to execute. - */ - public Request delete(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build() - .toString(); - - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update the self-service profile with the given ID. - * A token with {@code update:self_service_profiles} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/patch-self-service-profiles-by-id - * @param selfServiceProfile the self-service profile to update. - * @param id the self-service profile ID. - * @return a Request to execute. - */ - public Request update(SelfServiceProfile selfServiceProfile, String id) { - Asserts.assertNotNull(selfServiceProfile, "self service profile"); - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(selfServiceProfile); - return request; - } - - /** - * Get the custom text for specific self-service profile and language. - * A token with {@code read:self_service_profile_custom_texts} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/get-self-service-profile-custom-text - * @param id the self-service profile ID. - * @param language the language. - * @param page the page. - * @return a Request to execute. - */ - public Request getCustomText(String id, String language, String page) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(language, "language"); - Asserts.assertNotNull(page, "page"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .addPathSegment("custom-text") - .addPathSegment(language) - .addPathSegment(page); - - String url = builder.build().toString(); - - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Set the custom text for specific self-service profile and language. - * A token with {@code update:self_service_profile_custom_texts} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/put-self-service-profile-custom-text - * @param id the self-service profile ID. - * @param language the language. - * @param page the page. - * @param customText the custom text. - * @return a Request to execute. - */ - public Request setCustomText(String id, String language, String page, Object customText) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(language, "language"); - Asserts.assertNotNull(page, "page"); - Asserts.assertNotNull(customText, "custom text"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .addPathSegment("custom-text") - .addPathSegment(language) - .addPathSegment(page); - - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PUT, new TypeReference() { - }); - request.setBody(customText); - return request; - } - - /** - * Create a new SSO access ticket. - * A token with {@code create:sso_access_tickets} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/post-sso-ticket - * @param id the self-service profile ID. - * @param requestBody the payload. - * @return a Request to execute. - */ - public Request createSsoAccessTicket(String id, SsoAccessTicketRequest requestBody) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(requestBody, "request body"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .addPathSegment("sso-ticket"); - - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(requestBody); - return request; - } - - - /** - * Create a new SSO access ticket. - * A token with {@code create:sso_access_tickets} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/post-sso-ticket - * @param id the self-service profile ID. - * @param payload the payload. - * @return a Request to execute. - * - * @deprecated Use {@link #createSsoAccessTicket(String, SsoAccessTicketRequest)} to create sso access ticket. - */ - @Deprecated - public Request createSsoAccessTicket(String id, Object payload) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(payload, "payload"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .addPathSegment("sso-ticket"); - String url = builder.build().toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(payload); - return request; - } - - /** - * Revoke an SSO ticket. - * A token with {@code delete:sso_access_tickets} scope is needed - * @see https://auth0.com/docs/api/management/v2#!/self-service-profiles/post-revoke - * @param id the self-service profile ID. - * @param ticketId the ticket ID. - * @return a Request to execute. - */ - public Request revokeSsoTicket(String id, String ticketId) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(ticketId, "ticket id"); - - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .addPathSegment("sso-ticket") - .addPathSegment(ticketId) - .addPathSegment("revoke"); - - String url = builder.build().toString(); - - return new EmptyBodyVoidRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/SessionsClient.java b/src/main/java/com/auth0/client/mgmt/SessionsClient.java new file mode 100644 index 000000000..9816fc79f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/SessionsClient.java @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSessionResponseContent; + +public class SessionsClient { + protected final ClientOptions clientOptions; + + private final RawSessionsClient rawClient; + + public SessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve session information. + */ + public GetSessionResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve session information. + */ + public GetSessionResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a session by ID. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a session by ID. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public void revoke(String id) { + this.rawClient.revoke(id).body(); + } + + /** + * Revokes a session by ID and all associated refresh tokens. + */ + public void revoke(String id, RequestOptions requestOptions) { + this.rawClient.revoke(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/SessionsEntity.java b/src/main/java/com/auth0/client/mgmt/SessionsEntity.java deleted file mode 100644 index ae701dac9..000000000 --- a/src/main/java/com/auth0/client/mgmt/SessionsEntity.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.sessions.Session; -import com.auth0.net.BaseRequest; -import com.auth0.net.EmptyBodyVoidRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - - -/** - * Class that provides an implementation of the Sessions methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Sessions - *

- * This class is not thread-safe. - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class SessionsEntity extends BaseManagementEntity{ - - SessionsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the session for a given session ID. - * A token with scope {@code read:sessions} is needed. - * See https://auth0.com/docs/api/management/v2/sessions/get-session - * @param sessionId the session ID. - * @return a Request to execute. - */ - public Request get(String sessionId){ - Asserts.assertNotNull(sessionId, "session ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/sessions") - .addPathSegment(sessionId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete the session for a given session ID. - * A token with scope {@code delete:sessions} is needed. - * See https://auth0.com/docs/api/management/v2/sessions/delete-session - * @param sessionId the session ID. - * @return a Request to execute. - */ - public Request delete(String sessionId){ - Asserts.assertNotNull(sessionId, "session ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/sessions") - .addPathSegment(sessionId) - .build() - .toString(); - - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Revoke the session for a given session ID. - * A token with scope {@code delete:sessions}, {@code delete:refresh_tokens} is needed. - * See https://auth0.com/docs/api/management/v2/sessions/revoke-session - * @param sessionId the session ID. - * @return a Request to execute. - */ - public Request revoke(String sessionId){ - Asserts.assertNotNull(sessionId, "session ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/sessions") - .addPathSegment(sessionId) - .addPathSegment("revoke") - .build() - .toString(); - - return new EmptyBodyVoidRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() {}); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/SimpleTokenProvider.java b/src/main/java/com/auth0/client/mgmt/SimpleTokenProvider.java deleted file mode 100644 index d398ee429..000000000 --- a/src/main/java/com/auth0/client/mgmt/SimpleTokenProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.utils.Asserts; - -import java.util.concurrent.CompletableFuture; - -/** - * An implementation of {@link TokenProvider} that simply returns the token it is configured with. Tokens will not be renewed; - * consumers are responsible for renewing the token when needed and then calling {@link ManagementAPI#setApiToken(String)} with the - * new token. - */ -public class SimpleTokenProvider implements TokenProvider { - private final String apiToken; - - public static SimpleTokenProvider create(String apiToken) { - return new SimpleTokenProvider(apiToken); - } - - @Override - public String getToken() { - return apiToken; - } - - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.supplyAsync(() -> apiToken); - } - - private SimpleTokenProvider(String apiToken) { - Asserts.assertNotNull(apiToken, "api token"); - this.apiToken = apiToken; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/StatsClient.java b/src/main/java/com/auth0/client/mgmt/StatsClient.java new file mode 100644 index 000000000..7b32b9d3b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/StatsClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DailyStats; +import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; +import java.util.List; + +public class StatsClient { + protected final ClientOptions clientOptions; + + private final RawStatsClient rawClient; + + public StatsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawStatsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawStatsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public double getActiveUsersCount() { + return this.rawClient.getActiveUsersCount().body(); + } + + /** + * Retrieve the number of active users that logged in during the last 30 days. + */ + public double getActiveUsersCount(RequestOptions requestOptions) { + return this.rawClient.getActiveUsersCount(requestOptions).body(); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public List getDaily() { + return this.rawClient.getDaily().body(); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public List getDaily(GetDailyStatsRequestParameters request) { + return this.rawClient.getDaily(request).body(); + } + + /** + * Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. + */ + public List getDaily(GetDailyStatsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.getDaily(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/StatsEntity.java b/src/main/java/com/auth0/client/mgmt/StatsEntity.java deleted file mode 100644 index 193e82468..000000000 --- a/src/main/java/com/auth0/client/mgmt/StatsEntity.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.stats.DailyStats; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -/** - * Class that provides an implementation of the Stats methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Stats - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class StatsEntity extends BaseManagementEntity { - - StatsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the Active Users Count (logged in during the last 30 days). A token with scope read:stats is needed. - * See https://auth0.com/docs/api/management/v2#!/Stats/get_active_users - * - * @return a Request to execute. - */ - public Request getActiveUsersCount() { - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/stats/active-users") - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request the Daily Stats for a given period. A token with scope read:stats is needed. - * See https://auth0.com/docs/api/management/v2#!/Stats/get_daily - * - * @param from the first day of the period (inclusive). Time is not taken into account. - * @param to the last day of the period (inclusive). Time is not taken into account. - * @return a Request to execute. - */ - public Request> getDailyStats(Date from, Date to) { - Asserts.assertNotNull(from, "date from"); - Asserts.assertNotNull(to, "date to"); - - String dateFrom = formatDate(from); - String dateTo = formatDate(to); - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/stats/daily") - .addQueryParameter("from", dateFrom) - .addQueryParameter("to", dateTo) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - protected String formatDate(Date date) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - return sdf.format(date); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/SupplementalSignalsClient.java b/src/main/java/com/auth0/client/mgmt/SupplementalSignalsClient.java new file mode 100644 index 000000000..5396f7906 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/SupplementalSignalsClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.PatchSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.UpdateSupplementalSignalsRequestContent; + +public class SupplementalSignalsClient { + protected final ClientOptions clientOptions; + + private final RawSupplementalSignalsClient rawClient; + + public SupplementalSignalsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSupplementalSignalsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSupplementalSignalsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public GetSupplementalSignalsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Get the supplemental signals configuration for a tenant. + */ + public GetSupplementalSignalsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public PatchSupplementalSignalsResponseContent patch(UpdateSupplementalSignalsRequestContent request) { + return this.rawClient.patch(request).body(); + } + + /** + * Update the supplemental signals configuration for a tenant. + */ + public PatchSupplementalSignalsResponseContent patch( + UpdateSupplementalSignalsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.patch(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/TenantsEntity.java b/src/main/java/com/auth0/client/mgmt/TenantsEntity.java deleted file mode 100644 index af6c790cf..000000000 --- a/src/main/java/com/auth0/client/mgmt/TenantsEntity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.tenants.Tenant; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.Map; - -/** - * Class that provides an implementation of the Tenant Settings methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Tenants - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class TenantsEntity extends BaseManagementEntity { - - TenantsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request the Tenant Settings. A token with scope read:tenant_settings is needed. - * See https://auth0.com/docs/api/management/v2#!/Tenants/get_settings - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request get(FieldsFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/tenants/settings"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update the Tenant Settings. A token with scope update:tenant_settings is needed. - * See https://auth0.com/docs/api/management/v2#!/Tenants/patch_settings - * - * @param tenant the tenant data to set. - * @return a Request to execute. - */ - public Request update(Tenant tenant) { - Asserts.assertNotNull(tenant, "tenant"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/tenants/settings") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(tenant); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/TicketsClient.java b/src/main/java/com/auth0/client/mgmt/TicketsClient.java new file mode 100644 index 000000000..66dadb125 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/TicketsClient.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ChangePasswordTicketRequestContent; +import com.auth0.client.mgmt.types.ChangePasswordTicketResponseContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketRequestContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketResponseContent; + +public class TicketsClient { + protected final ClientOptions clientOptions; + + private final RawTicketsClient rawClient; + + public TicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTicketsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTicketsClient withRawResponse() { + return this.rawClient; + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public VerifyEmailTicketResponseContent verifyEmail(VerifyEmailTicketRequestContent request) { + return this.rawClient.verifyEmail(request).body(); + } + + /** + * Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. + */ + public VerifyEmailTicketResponseContent verifyEmail( + VerifyEmailTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.verifyEmail(request, requestOptions).body(); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ChangePasswordTicketResponseContent changePassword() { + return this.rawClient.changePassword().body(); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ChangePasswordTicketResponseContent changePassword(ChangePasswordTicketRequestContent request) { + return this.rawClient.changePassword(request).body(); + } + + /** + * Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + *

Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.

+ */ + public ChangePasswordTicketResponseContent changePassword( + ChangePasswordTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.changePassword(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/TicketsEntity.java b/src/main/java/com/auth0/client/mgmt/TicketsEntity.java deleted file mode 100644 index 698a8787b..000000000 --- a/src/main/java/com/auth0/client/mgmt/TicketsEntity.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.tickets.EmailVerificationTicket; -import com.auth0.json.mgmt.tickets.PasswordChangeTicket; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the Tickets methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Tickets - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class TicketsEntity extends BaseManagementEntity { - - TicketsEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Create an Email Verification Ticket. A token with scope create:user_tickets is needed. - * See https://auth0.com/docs/api/management/v2#!/Tickets/post_email_verification - * - * @param emailVerificationTicket the email verification ticket data to set. - * @return a Request to execute. - */ - public Request requestEmailVerification(EmailVerificationTicket emailVerificationTicket) { - Asserts.assertNotNull(emailVerificationTicket, "email verification ticket"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/tickets/email-verification") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(emailVerificationTicket); - return request; - } - - /** - * Create a Password Change Ticket. A token with scope create:user_tickets is needed. - * See https://auth0.com/docs/api/management/v2#!/Tickets/post_password_change - * - * @param passwordChangeTicket the password change ticket data to set. - * @return a Request to execute. - */ - public Request requestPasswordChange(PasswordChangeTicket passwordChangeTicket) { - Asserts.assertNotNull(passwordChangeTicket, "password change ticket"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/tickets/password-change") - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(passwordChangeTicket); - return request; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java new file mode 100644 index 000000000..b57d91f23 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.GetTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfilesListRequest; +import com.auth0.client.mgmt.types.UpdateTokenExchangeProfileRequestContent; + +public class TokenExchangeProfilesClient { + protected final ClientOptions clientOptions; + + private final RawTokenExchangeProfilesClient rawClient; + + public TokenExchangeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTokenExchangeProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTokenExchangeProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list(TokenExchangeProfilesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list( + TokenExchangeProfilesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CreateTokenExchangeProfileResponseContent create(CreateTokenExchangeProfileRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new Token Exchange Profile within your tenant. + */ + public CreateTokenExchangeProfileResponseContent create( + CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public GetTokenExchangeProfileResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details about a single Token Exchange Profile specified by ID. + */ + public GetTokenExchangeProfileResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a Token Exchange Profile within your tenant. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public void update(String id) { + this.rawClient.update(id).body(); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public void update(String id, UpdateTokenExchangeProfileRequestContent request) { + this.rawClient.update(id, request).body(); + } + + /** + * Update a Token Exchange Profile within your tenant. + */ + public void update(String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { + this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/TokenProvider.java b/src/main/java/com/auth0/client/mgmt/TokenProvider.java index 63c1b98c6..8fbe2b122 100644 --- a/src/main/java/com/auth0/client/mgmt/TokenProvider.java +++ b/src/main/java/com/auth0/client/mgmt/TokenProvider.java @@ -1,7 +1,6 @@ package com.auth0.client.mgmt; import com.auth0.exception.Auth0Exception; - import java.util.concurrent.CompletableFuture; /** @@ -11,14 +10,14 @@ public interface TokenProvider { /** - * Responsible for obtaining a token for use with the {@link ManagementAPI} client for synchronous requests. + * Responsible for obtaining a token for use with the Management API client for synchronous requests. * @return the token required when making requests to the Auth0 Management API. * @throws Auth0Exception if the token cannot be retrieved. */ String getToken() throws Auth0Exception; /** - * Responsible for obtaining a token for use with the {@link ManagementAPI} client for asynchronous requests. + * Responsible for obtaining a token for use with the Management API client for asynchronous requests. * @return a {@link CompletableFuture} with the token required when making requests to the Auth0 Management API. */ CompletableFuture getTokenAsync(); diff --git a/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesEntity.java b/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesEntity.java deleted file mode 100644 index 053f89877..000000000 --- a/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesEntity.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.UserAttributeProfilesFilter; -import com.auth0.json.mgmt.userAttributeProfiles.*; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -public class UserAttributeProfilesEntity extends BaseManagementEntity { - - private final static String ORGS_PATH = "api/v2/user-attribute-profiles"; - - UserAttributeProfilesEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Get a user attribute profile by its ID. A token with {@code read:user_attribute_profiles} scope is required. - * @param id the ID of the user attribute profile to retrieve. - * @return a Request to execute. - */ - public Request get(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get all user attribute profiles. A token with {@code read:user_attribute_profiles} scope is required. - * - * @param filter an optional pagination filter - * @return a Request to execute - * - */ - public Request getAll(UserAttributeProfilesFilter filter) { - HttpUrl.Builder builder = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH); - - if (filter != null) { - filter.getAsMap().forEach((k, v) -> builder.addQueryParameter(k, String.valueOf(v))); - } - - String url = builder.build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Update a user attribute profile. A token with {@code update:user_attribute_profiles} scope is required. - * - * @param userAttributeProfile the user attribute profile to update. - * @return a Request to execute. - */ - public Request update(String id, UserAttributeProfile userAttributeProfile) { - Asserts.assertNotNull(id, "id"); - Asserts.assertNotNull(userAttributeProfile, "userAttributeProfile"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id) - .build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - - request.setBody(userAttributeProfile); - return request; - } - - /** - * Create a new user attribute profile. A token with {@code create:user_attribute_profiles} scope is required. - * @param userAttributeProfile the user attribute profile to create. - * @return a Request to execute. - */ - public Request create(UserAttributeProfile userAttributeProfile) { - Asserts.assertNotNull(userAttributeProfile.getName(), "name"); - Asserts.assertNotNull(userAttributeProfile.getUserAttributes(), "userAttributes"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .build().toString(); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - - request.setBody(userAttributeProfile); - return request; - } - - /** - * Delete a user attribute profile by its ID. A token with {@code delete:user_attribute_profiles} scope is required. - * @param id the ID of the user attribute profile to delete. - * @return a Request to execute. - */ - public Request delete(String id) { - Asserts.assertNotNull(id, "id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment(id); - - String url = builder.build().toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Get a user attribute profile template by its ID. A token with {@code read:user_attribute_profiles} scope is required. - * @param id the ID of the user attribute profile template to retrieve. - * @return a Request to execute. - */ - public Request getTemplate(String id) { - Asserts.assertNotNull(id, "id"); - - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment("templates") - .addPathSegment(id) - .build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get all user attribute profile templates. A token with {@code read:user_attribute_profiles} scope is required. - * - * @return a Request to execute - */ - public Request getAllTemplates() { - String url = baseUrl.newBuilder() - .addPathSegments(ORGS_PATH) - .addPathSegment("templates") - .build().toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/UserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/UserBlocksClient.java new file mode 100644 index 000000000..4c3e3421b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/UserBlocksClient.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; +import com.auth0.client.mgmt.types.ListUserBlocksRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksResponseContent; + +public class UserBlocksClient { + protected final ClientOptions clientOptions; + + private final RawUserBlocksClient rawClient; + + public UserBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUserBlocksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUserBlocksClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public ListUserBlocksByIdentifierResponseContent listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request) { + return this.rawClient.listByIdentifier(request).body(); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for a user with the given identifier (username, phone number, or email). + */ + public ListUserBlocksByIdentifierResponseContent listByIdentifier( + ListUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.listByIdentifier(request, requestOptions).body(); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public void deleteByIdentifier(DeleteUserBlocksByIdentifierRequestParameters request) { + this.rawClient.deleteByIdentifier(request).body(); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given identifier (username, phone number, or email). + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public void deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters request, RequestOptions requestOptions) { + this.rawClient.deleteByIdentifier(request, requestOptions).body(); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ListUserBlocksResponseContent list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ListUserBlocksResponseContent list(String id, ListUserBlocksRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + */ + public ListUserBlocksResponseContent list( + String id, ListUserBlocksRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Remove all <a href="https://auth0.com/docs/secure/attack-protection/brute-force-protection">Brute-force Protection</a> blocks for the user with the given ID. + *

Note: This endpoint does not unblock users that were <a href="https://auth0.com/docs/user-profile#block-and-unblock-a-user">blocked by a tenant administrator</a>.

+ */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/UserBlocksEntity.java b/src/main/java/com/auth0/client/mgmt/UserBlocksEntity.java deleted file mode 100644 index d85260942..000000000 --- a/src/main/java/com/auth0/client/mgmt/UserBlocksEntity.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.userblocks.UserBlocks; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -/** - * Class that provides an implementation of the User Blocks methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/User_Blocks - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class UserBlocksEntity extends BaseManagementEntity { - - UserBlocksEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the User Blocks for a given identifier. A token with scope read:users is needed. - * See https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks - * - * @param identifier the identifier. Either a username, phone_number, or email. - * @return a Request to execute. - */ - public Request getByIdentifier(String identifier) { - Asserts.assertNotNull(identifier, "identifier"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/user-blocks") - .addQueryParameter("identifier", identifier) - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete any existing User Blocks for a given identifier. A token with scope update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks - * - * @param identifier the identifier. Either a username, phone_number, or email. - * @return a Request to execute. - */ - public Request deleteByIdentifier(String identifier) { - Asserts.assertNotNull(identifier, "identifier"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/user-blocks") - .addQueryParameter("identifier", identifier) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Request all the User Blocks. A token with scope read:users is needed. - * See https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks_by_id - * - * @param userId the user id. - * @return a Request to execute. - */ - public Request get(String userId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/user-blocks") - .addPathSegment(userId) - .build() - .toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete any existing User Blocks. A token with scope update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks_by_id - * - * @param userId the user id. - * @return a Request to execute. - */ - public Request delete(String userId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/user-blocks") - .addPathSegment(userId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/UserGrantsClient.java b/src/main/java/com/auth0/client/mgmt/UserGrantsClient.java new file mode 100644 index 000000000..ede7274cd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/UserGrantsClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; +import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; +import com.auth0.client.mgmt.types.UserGrant; + +public class UserGrantsClient { + protected final ClientOptions clientOptions; + + private final RawUserGrantsClient rawClient; + + public UserGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUserGrantsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUserGrantsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public SyncPagingIterable list(ListUserGrantsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/api-auth/which-oauth-flow-to-use">grants</a> associated with your account. + */ + public SyncPagingIterable list(ListUserGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Delete a grant associated with your account. + */ + public void deleteByUserId(DeleteUserGrantByUserIdRequestParameters request) { + this.rawClient.deleteByUserId(request).body(); + } + + /** + * Delete a grant associated with your account. + */ + public void deleteByUserId(DeleteUserGrantByUserIdRequestParameters request, RequestOptions requestOptions) { + this.rawClient.deleteByUserId(request, requestOptions).body(); + } + + /** + * Delete a grant associated with your account. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a grant associated with your account. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/UsersClient.java b/src/main/java/com/auth0/client/mgmt/UsersClient.java new file mode 100644 index 000000000..996207b2a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/UsersClient.java @@ -0,0 +1,499 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.GetUserRequestParameters; +import com.auth0.client.mgmt.types.GetUserResponseContent; +import com.auth0.client.mgmt.types.ListUsersByEmailRequestParameters; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; +import com.auth0.client.mgmt.types.RegenerateUsersRecoveryCodeResponseContent; +import com.auth0.client.mgmt.types.RevokeUserAccessRequestContent; +import com.auth0.client.mgmt.types.UpdateUserRequestContent; +import com.auth0.client.mgmt.types.UpdateUserResponseContent; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.users.AuthenticationMethodsClient; +import com.auth0.client.mgmt.users.AuthenticatorsClient; +import com.auth0.client.mgmt.users.EnrollmentsClient; +import com.auth0.client.mgmt.users.FederatedConnectionsTokensetsClient; +import com.auth0.client.mgmt.users.IdentitiesClient; +import com.auth0.client.mgmt.users.LogsClient; +import com.auth0.client.mgmt.users.MultifactorClient; +import com.auth0.client.mgmt.users.OrganizationsClient; +import com.auth0.client.mgmt.users.PermissionsClient; +import com.auth0.client.mgmt.users.RefreshTokenClient; +import com.auth0.client.mgmt.users.RolesClient; +import com.auth0.client.mgmt.users.SessionsClient; +import java.util.List; +import java.util.function.Supplier; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + protected final Supplier authenticationMethodsClient; + + protected final Supplier authenticatorsClient; + + protected final Supplier enrollmentsClient; + + protected final Supplier federatedConnectionsTokensetsClient; + + protected final Supplier identitiesClient; + + protected final Supplier logsClient; + + protected final Supplier multifactorClient; + + protected final Supplier organizationsClient; + + protected final Supplier permissionsClient; + + protected final Supplier rolesClient; + + protected final Supplier refreshTokenClient; + + protected final Supplier sessionsClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + this.authenticationMethodsClient = Suppliers.memoize(() -> new AuthenticationMethodsClient(clientOptions)); + this.authenticatorsClient = Suppliers.memoize(() -> new AuthenticatorsClient(clientOptions)); + this.enrollmentsClient = Suppliers.memoize(() -> new EnrollmentsClient(clientOptions)); + this.federatedConnectionsTokensetsClient = + Suppliers.memoize(() -> new FederatedConnectionsTokensetsClient(clientOptions)); + this.identitiesClient = Suppliers.memoize(() -> new IdentitiesClient(clientOptions)); + this.logsClient = Suppliers.memoize(() -> new LogsClient(clientOptions)); + this.multifactorClient = Suppliers.memoize(() -> new MultifactorClient(clientOptions)); + this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); + this.permissionsClient = Suppliers.memoize(() -> new PermissionsClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); + this.refreshTokenClient = Suppliers.memoize(() -> new RefreshTokenClient(clientOptions)); + this.sessionsClient = Suppliers.memoize(() -> new SessionsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of users. It is possible to: + *

    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public SyncPagingIterable list(ListUsersRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve details of users. It is possible to: + *
    + *
  • Specify a search criteria for users
  • + *
  • Sort the users to be returned
  • + *
  • Select the fields to be returned
  • + *
  • Specify the number of users to retrieve per page and the page index
  • + *
+ *

<!-- only v3 is available -->

+ *

The <code>q</code> query parameter can be used to get users that match the specified criteria <a href="https://auth0.com/docs/users/search/v3/query-syntax">using query string syntax.</a>

+ *

<a href="https://auth0.com/docs/users/search/v3">Learn more about searching for users.</a>

+ *

Read about <a href="https://auth0.com/docs/users/search/best-practices">best practices</a> when working with the API endpoints for retrieving users.

+ *

Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the <a href="https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports">export job</a>, or the <a href="https://auth0.com/docs/extensions/user-import-export">User Import / Export</a> extension.

+ */ + public SyncPagingIterable list( + ListUsersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CreateUserResponseContent create(CreateUserRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a new user for a given <a href="https://auth0.com/docs/connections/database">database</a> or <a href="https://auth0.com/docs/connections/passwordless">passwordless</a> connection. + *

Note: <code>connection</code> is required but other parameters such as <code>email</code> and <code>password</code> are dependent upon the type of connection.

+ */ + public CreateUserResponseContent create(CreateUserRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public List listUsersByEmail(ListUsersByEmailRequestParameters request) { + return this.rawClient.listUsersByEmail(request).body(); + } + + /** + * Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + *

For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com.

+ *

Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.

+ */ + public List listUsersByEmail( + ListUsersByEmailRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.listUsersByEmail(request, requestOptions).body(); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public GetUserResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public GetUserResponseContent get(String id, GetUserRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see <a href="https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint">Retrieve Users with the Get Users Endpoint</a>. + */ + public GetUserResponseContent get(String id, GetUserRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see <a href="https://auth0.com/docs/manage-users/user-accounts/delete-users">Delete Users</a>. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public UpdateUserResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public UpdateUserResponseContent update(String id, UpdateUserRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a user. + *

These are the attributes that can be updated at the root level:

+ *

<ul> + * <li>app_metadata</li> + * <li>blocked</li> + * <li>email</li> + * <li>email_verified</li> + * <li>family_name</li> + * <li>given_name</li> + * <li>name</li> + * <li>nickname</li> + * <li>password</li> + * <li>phone_number</li> + * <li>phone_verified</li> + * <li>picture</li> + * <li>username</li> + * <li>user_metadata</li> + * <li>verify_email</li> + * </ul>

+ *

Some considerations:

+ *

<ul> + * <li>The properties of the new object will replace the old ones.</li> + * <li>The metadata fields are an exception to this rule (<code>user_metadata</code> and <code>app_metadata</code>). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.</li> + * <li>If you are updating <code>email</code>, <code>email_verified</code>, <code>phone_number</code>, <code>phone_verified</code>, <code>username</code> or <code>password</code> of a secondary identity, you need to specify the <code>connection</code> property too.</li> + * <li>If you are updating <code>email</code> or <code>phone_number</code> you can specify, optionally, the <code>client_id</code> property.</li> + * <li>Updating <code>email_verified</code> is not supported for enterprise and passwordless sms connections.</li> + * <li>Updating the <code>blocked</code> to <code>false</code> does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.</li> + * <li>Supported attributes can be unset by supplying <code>null</code> as the value.</li> + * </ul>

+ *

<h5>Updating a field (non-metadata property)</h5> + * To mark the email address of a user as verified, the body to send should be: + * <pre><code>{ "email_verified": true }</code></pre>

+ *

<h5>Updating a user metadata root property</h5>Let's assume that our test user has the following <code>user_metadata</code>: + * <pre><code>{ "user_metadata" : { "profileCode": 1479 } }</code></pre>

+ *

To add the field <code>addresses</code> the body to send should be:

+ *

<pre><code>{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { "work_address": "100 Industrial Way" } + * } + * }</code></pre>

+ *

<h5>Updating an inner user metadata property</h5>If there's existing user metadata to which we want to add <code>"home_address": "742 Evergreen Terrace"</code> (using the <code>addresses</code> property) we should send the whole <code>addresses</code> object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: + * <pre><code>{ + * "user_metadata": { + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ *

The modified object ends up with the following <code>user_metadata</code> property:

+ *

<pre><code>{ + * "user_metadata": { + * "profileCode": 1479, + * "addresses": { + * "work_address": "100 Industrial Way", + * "home_address": "742 Evergreen Terrace" + * } + * } + * }</code></pre>

+ */ + public UpdateUserResponseContent update( + String id, UpdateUserRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public RegenerateUsersRecoveryCodeResponseContent regenerateRecoveryCode(String id) { + return this.rawClient.regenerateRecoveryCode(id).body(); + } + + /** + * Remove an existing multi-factor authentication (MFA) <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">recovery code</a> and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + */ + public RegenerateUsersRecoveryCodeResponseContent regenerateRecoveryCode(String id, RequestOptions requestOptions) { + return this.rawClient.regenerateRecoveryCode(id, requestOptions).body(); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public void revokeAccess(String id) { + this.rawClient.revokeAccess(id).body(); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public void revokeAccess(String id, RevokeUserAccessRequestContent request) { + this.rawClient.revokeAccess(id, request).body(); + } + + /** + * Revokes selected resources related to a user (sessions, refresh tokens, ...). + */ + public void revokeAccess(String id, RevokeUserAccessRequestContent request, RequestOptions requestOptions) { + this.rawClient.revokeAccess(id, request, requestOptions).body(); + } + + public AuthenticationMethodsClient authenticationMethods() { + return this.authenticationMethodsClient.get(); + } + + public AuthenticatorsClient authenticators() { + return this.authenticatorsClient.get(); + } + + public EnrollmentsClient enrollments() { + return this.enrollmentsClient.get(); + } + + public FederatedConnectionsTokensetsClient federatedConnectionsTokensets() { + return this.federatedConnectionsTokensetsClient.get(); + } + + public IdentitiesClient identities() { + return this.identitiesClient.get(); + } + + public LogsClient logs() { + return this.logsClient.get(); + } + + public MultifactorClient multifactor() { + return this.multifactorClient.get(); + } + + public OrganizationsClient organizations() { + return this.organizationsClient.get(); + } + + public PermissionsClient permissions() { + return this.permissionsClient.get(); + } + + public RolesClient roles() { + return this.rolesClient.get(); + } + + public RefreshTokenClient refreshToken() { + return this.refreshTokenClient.get(); + } + + public SessionsClient sessions() { + return this.sessionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/UsersEntity.java b/src/main/java/com/auth0/client/mgmt/UsersEntity.java deleted file mode 100644 index 66b00e616..000000000 --- a/src/main/java/com/auth0/client/mgmt/UsersEntity.java +++ /dev/null @@ -1,908 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.*; -import com.auth0.json.mgmt.users.authenticationmethods.AuthenticationMethod; -import com.auth0.json.mgmt.users.authenticationmethods.AuthenticationMethodsPage; -import com.auth0.json.mgmt.permissions.Permission; -import com.auth0.json.mgmt.permissions.PermissionsPage; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.guardian.Enrollment; -import com.auth0.json.mgmt.logevents.LogEventsPage; -import com.auth0.json.mgmt.organizations.OrganizationsPage; -import com.auth0.json.mgmt.users.Identity; -import com.auth0.json.mgmt.users.RecoveryCode; -import com.auth0.json.mgmt.users.User; -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.json.mgmt.refreshtokens.RefreshTokensPage; -import com.auth0.json.mgmt.sessions.SessionsPage; -import com.auth0.net.EmptyBodyRequest; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.VoidRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.utils.Asserts; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.HttpUrl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.auth0.client.mgmt.filter.QueryFilter.KEY_QUERY; - -/** - * Class that provides an implementation of the Users methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Users and https://auth0.com/docs/api/management/v2#!/Users_By_Email - *

- * This class is not thread-safe. - * - * @see ManagementAPI - */ -@SuppressWarnings("WeakerAccess") -public class UsersEntity extends BaseManagementEntity { - - UsersEntity(Auth0HttpClient client, HttpUrl baseUrl, TokenProvider tokenProvider) { - super(client, baseUrl, tokenProvider); - } - - /** - * Request all the Users that match a given email. - * A token with scope read:users is needed. - * If you want the identities.access_token property to be included, you will also need the scope read:user_idp_tokens. - * See https://auth0.com/docs/api/management/v2#!/Users_By_Email/get_users_by_email - * - * @param email the email of the users to look up. - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request> listByEmail(String email, FieldsFilter filter) { - Asserts.assertNotNull(email, "email"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users-by-email"); - builder.addQueryParameter("email", email); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Request all the Users. - * A token with scope read:users is needed. - * If you want the identities.access_token property to be included, you will also need the scope read:user_idp_tokens. - * See https://auth0.com/docs/api/management/v2#!/Users/get_users - * - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request list(UserFilter filter) { - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users"); - encodeAndAddQueryParam(builder, filter); - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Request a User. - * A token with scope read:users is needed. - * If you want the identities.access_token property to be included, you will also need the scope read:user_idp_tokens. - * See https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id - * - * @param userId the id of the user to retrieve. - * @param filter the filter to use. Can be null. - * @return a Request to execute. - */ - public Request get(String userId, UserFilter filter) { - Asserts.assertNotNull(userId, "user id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create a User. - * A token with scope create:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/post_users - * - * @param user the user data to set - * @return a Request to execute. - */ - public Request create(User user) { - Asserts.assertNotNull(user, "user"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(user); - return request; - } - - /** - * Delete an existing User. - * A token with scope delete:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/delete_users_by_id - * - * @param userId the user id - * @return a Request to execute. - */ - public Request delete(String userId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Update an existing User. - * A token with scope update:users is needed. - * If you're updating app_metadata you'll also need update:users_app_metadata scope. - * See https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id - * - * @param userId the user id - * @param user the user data to set. It can't include id. - * @return a Request to execute. - */ - public Request update(String userId, User user) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotNull(user, "user"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(user); - return request; - } - - /** - * Retreive the first confirmed enrollment, or a pending enrollment if none are confirmed. - * A token with scope read:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/get_enrollments - * - * @param userId the id of the user to retrieve. - * @return a Request to execute. - */ - public Request> getEnrollments(String userId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("enrollments") - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference>() { - }); - } - - /** - * Request all the Events Log for a given User. - * A token with scope read:logs is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/get_logs_by_user - * - * @param userId the id of the user to retrieve. - * @param filter the filter to use. - * @return a Request to execute. - */ - public Request getLogEvents(String userId, LogEventFilter filter) { - Asserts.assertNotNull(userId, "user id"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("logs"); - - encodeAndAddQueryParam(builder, filter); - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete all an user's authenticators. - * A token with scope delete:guardian_enrollments is needed. - * - * See API docs - * - * @param userId the user id - * @return a Request to execute. - */ - public Request deleteAllAuthenticators(String userId) { - - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authenticators") - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Delete an existing User's Multifactor Provider. - * A token with scope update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/delete_multifactor_by_provider - * - * @param userId the user id - * @param provider the multifactor provider - * @return a Request to execute. - */ - public Request deleteMultifactorProvider(String userId, String provider) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotNull(provider, "provider"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("multifactor") - .addPathSegment(provider) - .build() - .toString(); - return new VoidRequest(client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Rotates a User's Guardian recovery code. - * A token with scope update:users is needed. - * - * @param userId the user id - * @return a Request to execute. - * @see Management API2 docs - */ - public Request rotateRecoveryCode(String userId) { - Asserts.assertNotNull(userId, "user id"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("recovery-code-regeneration") - .build() - .toString(); - - return new EmptyBodyRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - } - - /** - * Links two User's Identities. - * A token with scope update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/post_identities - * - * @param primaryUserId the primary identity's user id - * @param secondaryUserId the secondary identity's user id - * @param provider the provider name of the secondary identity. - * @param connectionId the connection id of the secondary account being linked, useful if the provider is 'auth0' and you have several connections. Can be null. - * @return a Request to execute. - */ - public Request> linkIdentity(String primaryUserId, String secondaryUserId, String provider, String connectionId) { - Asserts.assertNotNull(primaryUserId, "primary user id"); - Asserts.assertNotNull(secondaryUserId, "secondary user id"); - Asserts.assertNotNull(provider, "provider"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(primaryUserId) - .addPathSegment("identities") - .build() - .toString(); - - BaseRequest> request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference>() { - }); - request.addParameter("provider", provider); - request.addParameter("user_id", secondaryUserId); - if (connectionId != null) { - request.addParameter("connection_id", connectionId); - } - return request; - } - - /** - * A token with scope update:current_user_identities is needed. - * It only works for the user the access token represents. - * See https://auth0.com/docs/api/management/v2#!/Users/post_identities - * - * @param primaryUserId the primary identity's user id associated with the access token this client was configured with. - * @param secondaryIdToken the user ID token representing the identity to link with the current user - * @return a Request to execute. - */ - public Request> linkIdentity(String primaryUserId, String secondaryIdToken) { - Asserts.assertNotNull(primaryUserId, "primary user id"); - Asserts.assertNotNull(secondaryIdToken, "secondary id token"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(primaryUserId) - .addPathSegment("identities") - .build() - .toString(); - - BaseRequest> request = new BaseRequest<>(client, tokenProvider, url, HttpMethod.POST, new TypeReference>() { - }); - request.addParameter("link_with", secondaryIdToken); - - return request; - } - - /** - * Un-links two User's Identities. - * A token with scope update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/delete_provider_by_user_id - * - * @param primaryUserId the primary identity's user id - * @param secondaryUserId the secondary identity's user id - * @param provider the provider name of the secondary identity. - * @return a Request to execute. - */ - public Request> unlinkIdentity(String primaryUserId, String secondaryUserId, String provider) { - Asserts.assertNotNull(primaryUserId, "primary user id"); - Asserts.assertNotNull(secondaryUserId, "secondary user id"); - Asserts.assertNotNull(provider, "provider"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(primaryUserId) - .addPathSegment("identities") - .addPathSegment(provider) - .addPathSegment(secondaryUserId) - .build() - .toString(); - - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.DELETE, new TypeReference>() { - }); - } - - /** - * Invalidate all remembered browsers across all authentication factors for a user. - * A token with scope {@code update:users} is required. - * - * @param userId the ID of the user to invalidate all remembered browsers and authentication factors for. - * @see Invalidate all remembered browsers. - */ - public Request invalidateRememberedBrowsers(String userId) { - Asserts.assertNotNull(userId, "user ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegments("multifactor/actions/invalidate-remember-browser") - .build() - .toString(); - - VoidRequest request = new VoidRequest(client, tokenProvider, url, HttpMethod.POST); - request.setBody(""); - return request; - } - - /** - * Get the permissions associated to the user. - * A token with read:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/get_permissions - * - * @param userId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listPermissions(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user id"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("permissions"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - - /** - * Remove permissions from a user. - * A token with update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/delete_permissions - * - * @param userId the user id - * @param permissions a list of permission objects to remove from the user - * @return a Request to execute - */ - public Request removePermissions(String userId, List permissions) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotEmpty(permissions, "permissions"); - - Map> body = new HashMap<>(); - body.put("permissions", permissions); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("permissions") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - request.setBody(body); - return request; - } - - /** - * Assign permissions to a user. - * A token with update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/post_permissions - * - * @param userId the user id - * @param permissions a list of permission objects to assign to the user - * @return a Request to execute - */ - public Request addPermissions(String userId, List permissions) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotEmpty(permissions, "permissions"); - - Map> body = new HashMap<>(); - body.put("permissions", permissions); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("permissions") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.POST); - request.setBody(body); - return request; - } - - /** - * Get the roles associated with a user. - * A token with read:users and read:roles is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/get_user_roles - * - * @param userId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listRoles(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user id"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("roles"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - - /** - * Remove roles from a user. - * A token with update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/delete_user_roles - * - * @param userId the user id - * @param roleIds a list of role ids to remove from the user - * @return a Request to execute - */ - public Request removeRoles(String userId, List roleIds) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotEmpty(roleIds, "role ids"); - - Map> body = new HashMap<>(); - body.put("roles", roleIds); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("roles") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - request.setBody(body); - return request; - } - - /** - * Assign roles to a user. - * A token with update:users is needed. - * See https://auth0.com/docs/api/management/v2#!/Users/post_user_roles - * - * @param userId the user id - * @param roleIds a list of role ids to assign to the user - * @return a Request to execute - */ - public Request addRoles(String userId, List roleIds) { - Asserts.assertNotNull(userId, "user id"); - Asserts.assertNotEmpty(roleIds, "role ids"); - - Map> body = new HashMap<>(); - body.put("roles", roleIds); - - final String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("roles") - .build() - .toString(); - VoidRequest request = new VoidRequest(this.client, tokenProvider, url, HttpMethod.POST); - request.setBody(body); - return request; - } - - /** - * Get the organizations a user belongs to. - * A token with {@code read:users} and {@code read:organizations} is required. - * - * @param userId the user ID - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Users/get_organizations - */ - public Request getOrganizations(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("organizations"); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Get the authentication methods of the user. - * A token with {@code read:authentication_methods} is required. - * - * @param userId the user ID - * @param filter an optional pagination filter - * @return a Request to execute - * - * @see https://auth0.com/docs/api/management/v2#!/Users/get_authentication_methods - */ - public Request getAuthenticationMethods(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user ID"); - - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods"); - - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Create an authentication method for a given user. - * A token with scope {@code create:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2#!/Users/post_authentication_methods - * - * @param userId the user to add authentication method to - * @param authenticationMethod the authentication method to be created - * @return a Request to execute. - */ - public Request createAuthenticationMethods(String userId, AuthenticationMethod authenticationMethod) { - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(authenticationMethod, "authentication methods"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .build() - .toString(); - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.POST, new TypeReference() { - }); - request.setBody(authenticationMethod); - return request; - } - - /** - * Updates an authentication method for a given user. - * A token with scope {@code update:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2#!/Users/put_authentication_methods - * - * @param userId the user to update authentication method - * @param authenticationMethods the list of authentication method information to be updated - * @return a Request to execute. - */ - public Request> updateAuthenticationMethods(String userId, List authenticationMethods) { - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(authenticationMethods, "authentication methods"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .build() - .toString(); - BaseRequest> request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PUT, new TypeReference>() { - }); - request.setBody(authenticationMethods); - return request; - } - - /** - * Gets an authentication method by ID. - * A token with scope {@code read:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2#!/Users/get_authentication_methods_by_authentication_method_id - * - * @param userId the user to get authentication method for - * @param authenticationMethodId the authentication method to be fetched - * @return a Request to execute. - */ - public Request getAuthenticationMethodById(String userId, String authenticationMethodId) { - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(authenticationMethodId, "authentication method ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .addPathSegment(authenticationMethodId) - .build() - .toString(); - - return new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Deletes an authentication method by ID. - * A token with scope {@code delete:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2#!/Users/delete_authentication_methods_by_authentication_method_id - * - * @param userId the user to delete the authentication method for - * @param authenticationMethodId the authentication method to be deleted - * @return a Request to execute. - */ - public Request deleteAuthenticationMethodById(String userId, String authenticationMethodId) { - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(authenticationMethodId, "authentication method ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .addPathSegment(authenticationMethodId) - .build() - .toString(); - - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Deletes all authentication methods for the given user. - * A token with scope {@code delete:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2/users/delete-authentication-methods - * - * @param userId the user to delete the authentication method for - * @return a Request to execute. - */ - public Request deleteAllAuthenticationMethods(String userId) { - Asserts.assertNotNull(userId, "user ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .build() - .toString(); - - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - /** - * Updates an authentication method. - * A token with scope {@code update:authentication_methods} is needed. - * @see https://auth0.com/docs/api/management/v2#!/Users/patch_authentication_methods_by_authentication_method_id - * - * @param userId the user to delete the authentication method for - * @param authenticationMethodId the authentication method to be deleted - * @param authenticationMethod the information to be updated - * @return a Request to execute. - */ - public Request updateAuthenticationMethodById(String userId, String authenticationMethodId, AuthenticationMethod authenticationMethod) { - Asserts.assertNotNull(userId, "user ID"); - Asserts.assertNotNull(authenticationMethodId, "authentication method ID"); - Asserts.assertNotNull(authenticationMethod, "authentication method"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("authentication-methods") - .addPathSegment(authenticationMethodId) - .build() - .toString(); - - BaseRequest request = new BaseRequest<>(this.client, tokenProvider, url, HttpMethod.PATCH, new TypeReference() { - }); - request.setBody(authenticationMethod); - return request; - } - - /** - * Get refresh tokens for a user - * A token with {@code read:refresh_tokens} is needed. - * See https://auth0.com/docs/api/management/v2/users/get-refresh-tokens-for-user - * - * @param userId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listRefreshTokens(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user ID"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("refresh-tokens"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete all refresh tokens for a user. - * A token with scope {@code delete:refresh_tokens} is needed. - * See https://auth0.com/docs/api/management/v2/users/delete-refresh-tokens-for-user - * - * @param userId the user to delete the refresh tokens for - * @return a Request to execute. - */ - public Request deleteRefreshTokens(String userId) { - Asserts.assertNotNull(userId, "user ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("refresh-tokens") - .build() - .toString(); - - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - - /** - * Get sessions for user - * A token with {@code read:sessions} is needed. - * See https://auth0.com/docs/api/management/v2/users/get-sessions-for-user - * - * @param userId the role id - * @param filter an optional pagination filter - * @return a Request to execute - */ - public Request listSessions(String userId, PageFilter filter) { - Asserts.assertNotNull(userId, "user ID"); - HttpUrl.Builder builder = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("sessions"); - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - String url = builder.build().toString(); - return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference() { - }); - } - - /** - * Delete sessions for user - * A token with scope {@code delete:sessions} is needed. - * See https://auth0.com/docs/api/management/v2/users/delete-sessions-for-user - * - * @param userId the user to delete the sessions for - * @return a Request to execute. - */ - public Request deleteSessions(String userId) { - Asserts.assertNotNull(userId, "user ID"); - - String url = baseUrl - .newBuilder() - .addPathSegments("api/v2/users") - .addPathSegment(userId) - .addPathSegment("sessions") - .build() - .toString(); - - return new VoidRequest(this.client, tokenProvider, url, HttpMethod.DELETE); - } - - private static void encodeAndAddQueryParam(HttpUrl.Builder builder, BaseFilter filter) { - if (filter != null) { - for (Map.Entry e : filter.getAsMap().entrySet()) { - if (KEY_QUERY.equals(e.getKey())) { - builder.addEncodedQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } else { - builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue())); - } - } - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncExecutionsClient.java new file mode 100644 index 000000000..7ec189a7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncExecutionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetActionExecutionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncExecutionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawExecutionsClient rawClient; + + public AsyncExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawExecutionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawExecutionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncRawExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawExecutionsClient.java new file mode 100644 index 000000000..509f6c7e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawExecutionsClient.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetActionExecutionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawExecutionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/executions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetActionExecutionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncRawTriggersClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawTriggersClient.java new file mode 100644 index 000000000..ae37d61ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawTriggersClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListActionTriggersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTriggersClient { + protected final ClientOptions clientOptions; + + public AsyncRawTriggersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public CompletableFuture> list() { + return list(null); + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public CompletableFuture> list( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionTriggersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java new file mode 100644 index 000000000..c2da1d670 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java @@ -0,0 +1,364 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ActionVersion; +import com.auth0.client.mgmt.types.DeployActionVersionRequestBodyParams; +import com.auth0.client.mgmt.types.DeployActionVersionResponseContent; +import com.auth0.client.mgmt.types.GetActionVersionResponseContent; +import com.auth0.client.mgmt.types.ListActionVersionsPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawVersionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawVersionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture>> list(String actionId) { + return list(actionId, ListActionVersionsRequestParameters.builder().build()); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture>> list( + String actionId, ListActionVersionsRequestParameters request) { + return list(actionId, request, null); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture>> list( + String actionId, ListActionVersionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionVersionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionVersionsPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListActionVersionsRequestParameters nextRequest = ListActionVersionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getVersions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(actionId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture> get( + String actionId, String id) { + return get(actionId, id, null); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture> get( + String actionId, String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetActionVersionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture> deploy( + String actionId, String id) { + return deploy(actionId, id, OptionalNullable.absent()); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture> deploy( + String actionId, String id, OptionalNullable request) { + return deploy(actionId, id, request, null); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture> deploy( + String actionId, + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions") + .addPathSegment(id) + .addPathSegments("deploy") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeployActionVersionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncTriggersClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncTriggersClient.java new file mode 100644 index 000000000..adad679c5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncTriggersClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.triggers.AsyncBindingsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.ListActionTriggersResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncTriggersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTriggersClient rawClient; + + protected final Supplier bindingsClient; + + public AsyncTriggersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTriggersClient(clientOptions); + this.bindingsClient = Suppliers.memoize(() -> new AsyncBindingsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTriggersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public CompletableFuture list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + public AsyncBindingsClient bindings() { + return this.bindingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncVersionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncVersionsClient.java new file mode 100644 index 000000000..ca61677c8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncVersionsClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionVersion; +import com.auth0.client.mgmt.types.DeployActionVersionRequestBodyParams; +import com.auth0.client.mgmt.types.DeployActionVersionResponseContent; +import com.auth0.client.mgmt.types.GetActionVersionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncVersionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawVersionsClient rawClient; + + public AsyncVersionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawVersionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawVersionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture> list(String actionId) { + return this.rawClient.list(actionId).thenApply(response -> response.body()); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture> list( + String actionId, ListActionVersionsRequestParameters request) { + return this.rawClient.list(actionId, request).thenApply(response -> response.body()); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture> list( + String actionId, ListActionVersionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(actionId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture get(String actionId, String id) { + return this.rawClient.get(actionId, id).thenApply(response -> response.body()); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public CompletableFuture get( + String actionId, String id, RequestOptions requestOptions) { + return this.rawClient.get(actionId, id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture deploy(String actionId, String id) { + return this.rawClient.deploy(actionId, id).thenApply(response -> response.body()); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture deploy( + String actionId, String id, OptionalNullable request) { + return this.rawClient.deploy(actionId, id, request).thenApply(response -> response.body()); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public CompletableFuture deploy( + String actionId, + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.deploy(actionId, id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/ExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/ExecutionsClient.java new file mode 100644 index 000000000..e1c31bf52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/ExecutionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetActionExecutionResponseContent; + +public class ExecutionsClient { + protected final ClientOptions clientOptions; + + private final RawExecutionsClient rawClient; + + public ExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawExecutionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawExecutionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public GetActionExecutionResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public GetActionExecutionResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/RawExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/RawExecutionsClient.java new file mode 100644 index 000000000..08eef45f4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/RawExecutionsClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetActionExecutionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawExecutionsClient { + protected final ClientOptions clientOptions; + + public RawExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/executions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetActionExecutionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/RawTriggersClient.java b/src/main/java/com/auth0/client/mgmt/actions/RawTriggersClient.java new file mode 100644 index 000000000..66437cc7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/RawTriggersClient.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListActionTriggersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTriggersClient { + protected final ClientOptions clientOptions; + + public RawTriggersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public ManagementApiHttpResponse list() { + return list(null); + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public ManagementApiHttpResponse list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionTriggersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/RawVersionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/RawVersionsClient.java new file mode 100644 index 000000000..c2837815b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/RawVersionsClient.java @@ -0,0 +1,280 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ActionVersion; +import com.auth0.client.mgmt.types.DeployActionVersionRequestBodyParams; +import com.auth0.client.mgmt.types.DeployActionVersionResponseContent; +import com.auth0.client.mgmt.types.GetActionVersionResponseContent; +import com.auth0.client.mgmt.types.ListActionVersionsPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawVersionsClient { + protected final ClientOptions clientOptions; + + public RawVersionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public ManagementApiHttpResponse> list(String actionId) { + return list(actionId, ListActionVersionsRequestParameters.builder().build()); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public ManagementApiHttpResponse> list( + String actionId, ListActionVersionsRequestParameters request) { + return list(actionId, request, null); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public ManagementApiHttpResponse> list( + String actionId, ListActionVersionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionVersionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionVersionsPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListActionVersionsRequestParameters nextRequest = ListActionVersionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getVersions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(actionId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public ManagementApiHttpResponse get(String actionId, String id) { + return get(actionId, id, null); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public ManagementApiHttpResponse get( + String actionId, String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetActionVersionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public ManagementApiHttpResponse deploy(String actionId, String id) { + return deploy(actionId, id, OptionalNullable.absent()); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public ManagementApiHttpResponse deploy( + String actionId, String id, OptionalNullable request) { + return deploy(actionId, id, request, null); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public ManagementApiHttpResponse deploy( + String actionId, + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/actions") + .addPathSegment(actionId) + .addPathSegments("versions") + .addPathSegment(id) + .addPathSegments("deploy") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeployActionVersionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/TriggersClient.java b/src/main/java/com/auth0/client/mgmt/actions/TriggersClient.java new file mode 100644 index 000000000..c2c83fcd2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/TriggersClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.triggers.BindingsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.ListActionTriggersResponseContent; +import java.util.function.Supplier; + +public class TriggersClient { + protected final ClientOptions clientOptions; + + private final RawTriggersClient rawClient; + + protected final Supplier bindingsClient; + + public TriggersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTriggersClient(clientOptions); + this.bindingsClient = Suppliers.memoize(() -> new BindingsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTriggersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public ListActionTriggersResponseContent list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. + */ + public ListActionTriggersResponseContent list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + public BindingsClient bindings() { + return this.bindingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/VersionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/VersionsClient.java new file mode 100644 index 000000000..5dec0e07d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/VersionsClient.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions; + +import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionVersion; +import com.auth0.client.mgmt.types.DeployActionVersionRequestBodyParams; +import com.auth0.client.mgmt.types.DeployActionVersionResponseContent; +import com.auth0.client.mgmt.types.GetActionVersionResponseContent; + +public class VersionsClient { + protected final ClientOptions clientOptions; + + private final RawVersionsClient rawClient; + + public VersionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawVersionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawVersionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public SyncPagingIterable list(String actionId) { + return this.rawClient.list(actionId).body(); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public SyncPagingIterable list(String actionId, ListActionVersionsRequestParameters request) { + return this.rawClient.list(actionId, request).body(); + } + + /** + * Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public SyncPagingIterable list( + String actionId, ListActionVersionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(actionId, request, requestOptions).body(); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public GetActionVersionResponseContent get(String actionId, String id) { + return this.rawClient.get(actionId, id).body(); + } + + /** + * Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. + */ + public GetActionVersionResponseContent get(String actionId, String id, RequestOptions requestOptions) { + return this.rawClient.get(actionId, id, requestOptions).body(); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public DeployActionVersionResponseContent deploy(String actionId, String id) { + return this.rawClient.deploy(actionId, id).body(); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public DeployActionVersionResponseContent deploy( + String actionId, String id, OptionalNullable request) { + return this.rawClient.deploy(actionId, id, request).body(); + } + + /** + * Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. + */ + public DeployActionVersionResponseContent deploy( + String actionId, + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.deploy(actionId, id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncBindingsClient.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncBindingsClient.java new file mode 100644 index 000000000..db6d66bc4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncBindingsClient.java @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers; + +import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; +import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionBinding; +import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncBindingsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBindingsClient rawClient; + + public AsyncBindingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBindingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBindingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture> list(String triggerId) { + return this.rawClient.list(triggerId).thenApply(response -> response.body()); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture> list( + String triggerId, ListActionTriggerBindingsRequestParameters request) { + return this.rawClient.list(triggerId, request).thenApply(response -> response.body()); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture> list( + String triggerId, ListActionTriggerBindingsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(triggerId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture updateMany(String triggerId) { + return this.rawClient.updateMany(triggerId).thenApply(response -> response.body()); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture updateMany( + String triggerId, UpdateActionBindingsRequestContent request) { + return this.rawClient.updateMany(triggerId, request).thenApply(response -> response.body()); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture updateMany( + String triggerId, UpdateActionBindingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateMany(triggerId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java new file mode 100644 index 000000000..560a6e952 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers; + +import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; +import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ActionBinding; +import com.auth0.client.mgmt.types.ListActionBindingsPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBindingsClient { + protected final ClientOptions clientOptions; + + public AsyncRawBindingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture>> list(String triggerId) { + return list( + triggerId, ListActionTriggerBindingsRequestParameters.builder().build()); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture>> list( + String triggerId, ListActionTriggerBindingsRequestParameters request) { + return list(triggerId, request, null); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public CompletableFuture>> list( + String triggerId, ListActionTriggerBindingsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .addPathSegment(triggerId) + .addPathSegments("bindings"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionBindingsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionBindingsPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListActionTriggerBindingsRequestParameters nextRequest = + ListActionTriggerBindingsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getBindings().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(triggerId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture> updateMany( + String triggerId) { + return updateMany( + triggerId, UpdateActionBindingsRequestContent.builder().build()); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture> updateMany( + String triggerId, UpdateActionBindingsRequestContent request) { + return updateMany(triggerId, request, null); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public CompletableFuture> updateMany( + String triggerId, UpdateActionBindingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .addPathSegment(triggerId) + .addPathSegments("bindings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateActionBindingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/BindingsClient.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/BindingsClient.java new file mode 100644 index 000000000..0c1f45ec3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/BindingsClient.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers; + +import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; +import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionBinding; +import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; + +public class BindingsClient { + protected final ClientOptions clientOptions; + + private final RawBindingsClient rawClient; + + public BindingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBindingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBindingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public SyncPagingIterable list(String triggerId) { + return this.rawClient.list(triggerId).body(); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public SyncPagingIterable list( + String triggerId, ListActionTriggerBindingsRequestParameters request) { + return this.rawClient.list(triggerId, request).body(); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public SyncPagingIterable list( + String triggerId, ListActionTriggerBindingsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(triggerId, request, requestOptions).body(); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public UpdateActionBindingsResponseContent updateMany(String triggerId) { + return this.rawClient.updateMany(triggerId).body(); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public UpdateActionBindingsResponseContent updateMany( + String triggerId, UpdateActionBindingsRequestContent request) { + return this.rawClient.updateMany(triggerId, request).body(); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public UpdateActionBindingsResponseContent updateMany( + String triggerId, UpdateActionBindingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateMany(triggerId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/RawBindingsClient.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/RawBindingsClient.java new file mode 100644 index 000000000..56e908995 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/RawBindingsClient.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers; + +import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; +import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ActionBinding; +import com.auth0.client.mgmt.types.ListActionBindingsPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBindingsClient { + protected final ClientOptions clientOptions; + + public RawBindingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public ManagementApiHttpResponse> list(String triggerId) { + return list( + triggerId, ListActionTriggerBindingsRequestParameters.builder().build()); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public ManagementApiHttpResponse> list( + String triggerId, ListActionTriggerBindingsRequestParameters request) { + return list(triggerId, request, null); + } + + /** + * Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. + */ + public ManagementApiHttpResponse> list( + String triggerId, ListActionTriggerBindingsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .addPathSegment(triggerId) + .addPathSegments("bindings"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListActionBindingsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListActionBindingsPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListActionTriggerBindingsRequestParameters nextRequest = + ListActionTriggerBindingsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getBindings().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(triggerId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public ManagementApiHttpResponse updateMany(String triggerId) { + return updateMany( + triggerId, UpdateActionBindingsRequestContent.builder().build()); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public ManagementApiHttpResponse updateMany( + String triggerId, UpdateActionBindingsRequestContent request) { + return updateMany(triggerId, request, null); + } + + /** + * Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. + */ + public ManagementApiHttpResponse updateMany( + String triggerId, UpdateActionBindingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("actions/triggers") + .addPathSegment(triggerId) + .addPathSegments("bindings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateActionBindingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java new file mode 100644 index 000000000..da6c71732 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionTriggerBindingsRequestParameters.Builder.class) +public final class ListActionTriggerBindingsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final Map additionalProperties; + + private ListActionTriggerBindingsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Use this field to request a specific page of the list results. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return The maximum number of results to be returned in a single request. 20 by default + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionTriggerBindingsRequestParameters + && equalTo((ListActionTriggerBindingsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionTriggerBindingsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionTriggerBindingsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + return this; + } + + /** + *

Use this field to request a specific page of the list results.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

The maximum number of results to be returned in a single request. 20 by default

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + public ListActionTriggerBindingsRequestParameters build() { + return new ListActionTriggerBindingsRequestParameters(page, perPage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java new file mode 100644 index 000000000..c65556ba6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.triggers.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ActionBindingWithRef; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateActionBindingsRequestContent.Builder.class) +public final class UpdateActionBindingsRequestContent { + private final Optional> bindings; + + private final Map additionalProperties; + + private UpdateActionBindingsRequestContent( + Optional> bindings, Map additionalProperties) { + this.bindings = bindings; + this.additionalProperties = additionalProperties; + } + + /** + * @return The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed. + */ + @JsonProperty("bindings") + public Optional> getBindings() { + return bindings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateActionBindingsRequestContent + && equalTo((UpdateActionBindingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateActionBindingsRequestContent other) { + return bindings.equals(other.bindings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bindings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> bindings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateActionBindingsRequestContent other) { + bindings(other.getBindings()); + return this; + } + + /** + *

The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed.

+ */ + @JsonSetter(value = "bindings", nulls = Nulls.SKIP) + public Builder bindings(Optional> bindings) { + this.bindings = bindings; + return this; + } + + public Builder bindings(List bindings) { + this.bindings = Optional.ofNullable(bindings); + return this; + } + + public UpdateActionBindingsRequestContent build() { + return new UpdateActionBindingsRequestContent(bindings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java new file mode 100644 index 000000000..fe08671be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.actions.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionVersionsRequestParameters.Builder.class) +public final class ListActionVersionsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final Map additionalProperties; + + private ListActionVersionsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Use this field to request a specific page of the list results. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return This field specify the maximum number of results to be returned by the server. 20 by default + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionVersionsRequestParameters + && equalTo((ListActionVersionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionVersionsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionVersionsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + return this; + } + + /** + *

Use this field to request a specific page of the list results.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

This field specify the maximum number of results to be returned by the server. 20 by default

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + public ListActionVersionsRequestParameters build() { + return new ListActionVersionsRequestParameters(page, perPage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/AnomalyClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/AnomalyClient.java new file mode 100644 index 000000000..40f371b17 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/AnomalyClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AnomalyClient { + protected final ClientOptions clientOptions; + + protected final Supplier blocksClient; + + public AnomalyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.blocksClient = Suppliers.memoize(() -> new BlocksClient(clientOptions)); + } + + public BlocksClient blocks() { + return this.blocksClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/AsyncAnomalyClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncAnomalyClient.java new file mode 100644 index 000000000..61cda0658 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncAnomalyClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncAnomalyClient { + protected final ClientOptions clientOptions; + + protected final Supplier blocksClient; + + public AsyncAnomalyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.blocksClient = Suppliers.memoize(() -> new AsyncBlocksClient(clientOptions)); + } + + public AsyncBlocksClient blocks() { + return this.blocksClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/AsyncBlocksClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncBlocksClient.java new file mode 100644 index 000000000..06f784726 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncBlocksClient.java @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncBlocksClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBlocksClient rawClient; + + public AsyncBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBlocksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBlocksClient withRawResponse() { + return this.rawClient; + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public CompletableFuture checkIp(String id) { + return this.rawClient.checkIp(id).thenApply(response -> response.body()); + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public CompletableFuture checkIp(String id, RequestOptions requestOptions) { + return this.rawClient.checkIp(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public CompletableFuture unblockIp(String id) { + return this.rawClient.unblockIp(id).thenApply(response -> response.body()); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public CompletableFuture unblockIp(String id, RequestOptions requestOptions) { + return this.rawClient.unblockIp(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/AsyncRawBlocksClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncRawBlocksClient.java new file mode 100644 index 000000000..bf00da071 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/AsyncRawBlocksClient.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBlocksClient { + protected final ClientOptions clientOptions; + + public AsyncRawBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public CompletableFuture> checkIp(String id) { + return checkIp(id, null); + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public CompletableFuture> checkIp(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("anomaly/blocks/ips") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public CompletableFuture> unblockIp(String id) { + return unblockIp(id, null); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public CompletableFuture> unblockIp(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("anomaly/blocks/ips") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/BlocksClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/BlocksClient.java new file mode 100644 index 000000000..314e48ad2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/BlocksClient.java @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; + +public class BlocksClient { + protected final ClientOptions clientOptions; + + private final RawBlocksClient rawClient; + + public BlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBlocksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBlocksClient withRawResponse() { + return this.rawClient; + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public void checkIp(String id) { + this.rawClient.checkIp(id).body(); + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public void checkIp(String id, RequestOptions requestOptions) { + this.rawClient.checkIp(id, requestOptions).body(); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public void unblockIp(String id) { + this.rawClient.unblockIp(id).body(); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public void unblockIp(String id, RequestOptions requestOptions) { + this.rawClient.unblockIp(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/anomaly/RawBlocksClient.java b/src/main/java/com/auth0/client/mgmt/anomaly/RawBlocksClient.java new file mode 100644 index 000000000..c712fc492 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/anomaly/RawBlocksClient.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.anomaly; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBlocksClient { + protected final ClientOptions clientOptions; + + public RawBlocksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public ManagementApiHttpResponse checkIp(String id) { + return checkIp(id, null); + } + + /** + * Check if the given IP address is blocked via the <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> due to multiple suspicious attempts. + */ + public ManagementApiHttpResponse checkIp(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("anomaly/blocks/ips") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public ManagementApiHttpResponse unblockIp(String id) { + return unblockIp(id, null); + } + + /** + * Remove a block imposed by <a href="https://auth0.com/docs/configure/attack-protection/suspicious-ip-throttling">Suspicious IP Throttling</a> for the given IP address. + */ + public ManagementApiHttpResponse unblockIp(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("anomaly/blocks/ips") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java new file mode 100644 index 000000000..df5acd946 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncAttackProtectionClient { + protected final ClientOptions clientOptions; + + protected final Supplier breachedPasswordDetectionClient; + + protected final Supplier bruteForceProtectionClient; + + protected final Supplier suspiciousIpThrottlingClient; + + public AsyncAttackProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.breachedPasswordDetectionClient = + Suppliers.memoize(() -> new AsyncBreachedPasswordDetectionClient(clientOptions)); + this.bruteForceProtectionClient = Suppliers.memoize(() -> new AsyncBruteForceProtectionClient(clientOptions)); + this.suspiciousIpThrottlingClient = + Suppliers.memoize(() -> new AsyncSuspiciousIpThrottlingClient(clientOptions)); + } + + public AsyncBreachedPasswordDetectionClient breachedPasswordDetection() { + return this.breachedPasswordDetectionClient.get(); + } + + public AsyncBruteForceProtectionClient bruteForceProtection() { + return this.bruteForceProtectionClient.get(); + } + + public AsyncSuspiciousIpThrottlingClient suspiciousIpThrottling() { + return this.suspiciousIpThrottlingClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBreachedPasswordDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBreachedPasswordDetectionClient.java new file mode 100644 index 000000000..ddb5d75cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBreachedPasswordDetectionClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBreachedPasswordDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBreachedPasswordDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBreachedPasswordDetectionSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncBreachedPasswordDetectionClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBreachedPasswordDetectionClient rawClient; + + public AsyncBreachedPasswordDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBreachedPasswordDetectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBreachedPasswordDetectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBreachedPasswordDetectionSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBreachedPasswordDetectionSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBruteForceProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBruteForceProtectionClient.java new file mode 100644 index 000000000..4a54b4d7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBruteForceProtectionClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBruteForceSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBruteForceSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBruteForceSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncBruteForceProtectionClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBruteForceProtectionClient rawClient; + + public AsyncBruteForceProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBruteForceProtectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBruteForceProtectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBruteForceSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBruteForceSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBreachedPasswordDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBreachedPasswordDetectionClient.java new file mode 100644 index 000000000..c65c2610b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBreachedPasswordDetectionClient.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBreachedPasswordDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBreachedPasswordDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBreachedPasswordDetectionSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBreachedPasswordDetectionClient { + protected final ClientOptions clientOptions; + + public AsyncRawBreachedPasswordDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/breached-password-detection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBreachedPasswordDetectionSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture> + update() { + return update( + UpdateBreachedPasswordDetectionSettingsRequestContent.builder().build()); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBreachedPasswordDetectionSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBreachedPasswordDetectionSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/breached-password-detection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateBreachedPasswordDetectionSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBruteForceProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBruteForceProtectionClient.java new file mode 100644 index 000000000..1f84ba98c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBruteForceProtectionClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBruteForceSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBruteForceSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBruteForceSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBruteForceProtectionClient { + protected final ClientOptions clientOptions; + + public AsyncRawBruteForceProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/brute-force-protection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBruteForceSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture> update() { + return update(UpdateBruteForceSettingsRequestContent.builder().build()); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBruteForceSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBruteForceSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/brute-force-protection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBruteForceSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawSuspiciousIpThrottlingClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawSuspiciousIpThrottlingClient.java new file mode 100644 index 000000000..d303ebe71 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawSuspiciousIpThrottlingClient.java @@ -0,0 +1,218 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateSuspiciousIpThrottlingSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSuspiciousIpThrottlingSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSuspiciousIpThrottlingSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSuspiciousIpThrottlingClient { + protected final ClientOptions clientOptions; + + public AsyncRawSuspiciousIpThrottlingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/suspicious-ip-throttling") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSuspiciousIpThrottlingSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture> update() { + return update( + UpdateSuspiciousIpThrottlingSettingsRequestContent.builder().build()); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture> update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture> update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/suspicious-ip-throttling") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSuspiciousIpThrottlingSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncSuspiciousIpThrottlingClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncSuspiciousIpThrottlingClient.java new file mode 100644 index 000000000..ffe8ab679 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncSuspiciousIpThrottlingClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateSuspiciousIpThrottlingSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSuspiciousIpThrottlingSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSuspiciousIpThrottlingSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSuspiciousIpThrottlingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSuspiciousIpThrottlingClient rawClient; + + public AsyncSuspiciousIpThrottlingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSuspiciousIpThrottlingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSuspiciousIpThrottlingClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public CompletableFuture update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java new file mode 100644 index 000000000..5d4a81c20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AttackProtectionClient { + protected final ClientOptions clientOptions; + + protected final Supplier breachedPasswordDetectionClient; + + protected final Supplier bruteForceProtectionClient; + + protected final Supplier suspiciousIpThrottlingClient; + + public AttackProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.breachedPasswordDetectionClient = + Suppliers.memoize(() -> new BreachedPasswordDetectionClient(clientOptions)); + this.bruteForceProtectionClient = Suppliers.memoize(() -> new BruteForceProtectionClient(clientOptions)); + this.suspiciousIpThrottlingClient = Suppliers.memoize(() -> new SuspiciousIpThrottlingClient(clientOptions)); + } + + public BreachedPasswordDetectionClient breachedPasswordDetection() { + return this.breachedPasswordDetectionClient.get(); + } + + public BruteForceProtectionClient bruteForceProtection() { + return this.bruteForceProtectionClient.get(); + } + + public SuspiciousIpThrottlingClient suspiciousIpThrottling() { + return this.suspiciousIpThrottlingClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/BreachedPasswordDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/BreachedPasswordDetectionClient.java new file mode 100644 index 000000000..a2746f1ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/BreachedPasswordDetectionClient.java @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBreachedPasswordDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBreachedPasswordDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBreachedPasswordDetectionSettingsResponseContent; + +public class BreachedPasswordDetectionClient { + protected final ClientOptions clientOptions; + + private final RawBreachedPasswordDetectionClient rawClient; + + public BreachedPasswordDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBreachedPasswordDetectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBreachedPasswordDetectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public GetBreachedPasswordDetectionSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public GetBreachedPasswordDetectionSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public UpdateBreachedPasswordDetectionSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public UpdateBreachedPasswordDetectionSettingsResponseContent update( + UpdateBreachedPasswordDetectionSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public UpdateBreachedPasswordDetectionSettingsResponseContent update( + UpdateBreachedPasswordDetectionSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/BruteForceProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/BruteForceProtectionClient.java new file mode 100644 index 000000000..be1c4a722 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/BruteForceProtectionClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBruteForceSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBruteForceSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBruteForceSettingsResponseContent; + +public class BruteForceProtectionClient { + protected final ClientOptions clientOptions; + + private final RawBruteForceProtectionClient rawClient; + + public BruteForceProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBruteForceProtectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBruteForceProtectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public GetBruteForceSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public GetBruteForceSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public UpdateBruteForceSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public UpdateBruteForceSettingsResponseContent update(UpdateBruteForceSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public UpdateBruteForceSettingsResponseContent update( + UpdateBruteForceSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/RawBreachedPasswordDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBreachedPasswordDetectionClient.java new file mode 100644 index 000000000..7839a7ff7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBreachedPasswordDetectionClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBreachedPasswordDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBreachedPasswordDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBreachedPasswordDetectionSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBreachedPasswordDetectionClient { + protected final ClientOptions clientOptions; + + public RawBreachedPasswordDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Retrieve details of the Breached Password Detection configuration of your tenant. + */ + public ManagementApiHttpResponse get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/breached-password-detection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBreachedPasswordDetectionSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update() { + return update( + UpdateBreachedPasswordDetectionSettingsRequestContent.builder().build()); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBreachedPasswordDetectionSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update details of the Breached Password Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBreachedPasswordDetectionSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/breached-password-detection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBreachedPasswordDetectionSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/RawBruteForceProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBruteForceProtectionClient.java new file mode 100644 index 000000000..935f9de72 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBruteForceProtectionClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBruteForceSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBruteForceSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBruteForceSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBruteForceProtectionClient { + protected final ClientOptions clientOptions; + + public RawBruteForceProtectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Retrieve details of the Brute-force Protection configuration of your tenant. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/brute-force-protection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBruteForceSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public ManagementApiHttpResponse update() { + return update(UpdateBruteForceSettingsRequestContent.builder().build()); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBruteForceSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the Brute-force Protection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBruteForceSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/brute-force-protection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBruteForceSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/RawSuspiciousIpThrottlingClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/RawSuspiciousIpThrottlingClient.java new file mode 100644 index 000000000..d1ce48e46 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/RawSuspiciousIpThrottlingClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateSuspiciousIpThrottlingSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSuspiciousIpThrottlingSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSuspiciousIpThrottlingSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSuspiciousIpThrottlingClient { + protected final ClientOptions clientOptions; + + public RawSuspiciousIpThrottlingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public ManagementApiHttpResponse get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/suspicious-ip-throttling") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSuspiciousIpThrottlingSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public ManagementApiHttpResponse update() { + return update( + UpdateSuspiciousIpThrottlingSettingsRequestContent.builder().build()); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/suspicious-ip-throttling") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSuspiciousIpThrottlingSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/SuspiciousIpThrottlingClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/SuspiciousIpThrottlingClient.java new file mode 100644 index 000000000..d9243811d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/SuspiciousIpThrottlingClient.java @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateSuspiciousIpThrottlingSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSuspiciousIpThrottlingSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSuspiciousIpThrottlingSettingsResponseContent; + +public class SuspiciousIpThrottlingClient { + protected final ClientOptions clientOptions; + + private final RawSuspiciousIpThrottlingClient rawClient; + + public SuspiciousIpThrottlingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSuspiciousIpThrottlingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSuspiciousIpThrottlingClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public GetSuspiciousIpThrottlingSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve details of the Suspicious IP Throttling configuration of your tenant. + */ + public GetSuspiciousIpThrottlingSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public UpdateSuspiciousIpThrottlingSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public UpdateSuspiciousIpThrottlingSettingsResponseContent update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update the details of the Suspicious IP Throttling configuration of your tenant. + */ + public UpdateSuspiciousIpThrottlingSettingsResponseContent update( + UpdateSuspiciousIpThrottlingSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java new file mode 100644 index 000000000..ddd475caa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.BreachedPasswordDetectionAdminNotificationFrequencyEnum; +import com.auth0.client.mgmt.types.BreachedPasswordDetectionMethodEnum; +import com.auth0.client.mgmt.types.BreachedPasswordDetectionShieldsEnum; +import com.auth0.client.mgmt.types.BreachedPasswordDetectionStage; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBreachedPasswordDetectionSettingsRequestContent.Builder.class) +public final class UpdateBreachedPasswordDetectionSettingsRequestContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> adminNotificationFrequency; + + private final Optional method; + + private final Optional stage; + + private final Map additionalProperties; + + private UpdateBreachedPasswordDetectionSettingsRequestContent( + Optional enabled, + Optional> shields, + Optional> adminNotificationFrequency, + Optional method, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.adminNotificationFrequency = adminNotificationFrequency; + this.method = method; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not breached password detection is active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>. + */ + @JsonProperty("admin_notification_frequency") + public Optional> getAdminNotificationFrequency() { + return adminNotificationFrequency; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBreachedPasswordDetectionSettingsRequestContent + && equalTo((UpdateBreachedPasswordDetectionSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBreachedPasswordDetectionSettingsRequestContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && adminNotificationFrequency.equals(other.adminNotificationFrequency) + && method.equals(other.method) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> adminNotificationFrequency = + Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBreachedPasswordDetectionSettingsRequestContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + adminNotificationFrequency(other.getAdminNotificationFrequency()); + method(other.getMethod()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not breached password detection is active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>.

+ */ + @JsonSetter(value = "admin_notification_frequency", nulls = Nulls.SKIP) + public Builder adminNotificationFrequency( + Optional> adminNotificationFrequency) { + this.adminNotificationFrequency = adminNotificationFrequency; + return this; + } + + public Builder adminNotificationFrequency( + List adminNotificationFrequency) { + this.adminNotificationFrequency = Optional.ofNullable(adminNotificationFrequency); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(BreachedPasswordDetectionMethodEnum method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(BreachedPasswordDetectionStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public UpdateBreachedPasswordDetectionSettingsRequestContent build() { + return new UpdateBreachedPasswordDetectionSettingsRequestContent( + enabled, shields, adminNotificationFrequency, method, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java new file mode 100644 index 000000000..4607f414e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBruteForceSettingsRequestContent.Builder.class) +public final class UpdateBruteForceSettingsRequestContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional mode; + + private final Optional maxAttempts; + + private final Map additionalProperties; + + private UpdateBruteForceSettingsRequestContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional mode, + Optional maxAttempts, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.mode = mode; + this.maxAttempts = maxAttempts; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not brute force attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return List of trusted IP addresses that will not have attack protection enforced against them. + */ + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + /** + * @return Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>. + */ + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + + /** + * @return Maximum number of unsuccessful attempts. + */ + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBruteForceSettingsRequestContent + && equalTo((UpdateBruteForceSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBruteForceSettingsRequestContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && mode.equals(other.mode) + && maxAttempts.equals(other.maxAttempts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional mode = Optional.empty(); + + private Optional maxAttempts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBruteForceSettingsRequestContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + mode(other.getMode()); + maxAttempts(other.getMaxAttempts()); + return this; + } + + /** + *

Whether or not brute force attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

List of trusted IP addresses that will not have attack protection enforced against them.

+ */ + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + /** + *

Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>.

+ */ + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(UpdateBruteForceSettingsRequestContentMode mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + /** + *

Maximum number of unsuccessful attempts.

+ */ + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public Builder maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + public Builder maxAttempts(Integer maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + public UpdateBruteForceSettingsRequestContent build() { + return new UpdateBruteForceSettingsRequestContent( + enabled, shields, allowlist, mode, maxAttempts, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java new file mode 100644 index 000000000..556a5e295 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateBruteForceSettingsRequestContentMode { + public static final UpdateBruteForceSettingsRequestContentMode COUNT_PER_IDENTIFIER = + new UpdateBruteForceSettingsRequestContentMode(Value.COUNT_PER_IDENTIFIER, "count_per_identifier"); + + public static final UpdateBruteForceSettingsRequestContentMode COUNT_PER_IDENTIFIER_AND_IP = + new UpdateBruteForceSettingsRequestContentMode( + Value.COUNT_PER_IDENTIFIER_AND_IP, "count_per_identifier_and_ip"); + + private final Value value; + + private final String string; + + UpdateBruteForceSettingsRequestContentMode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateBruteForceSettingsRequestContentMode + && this.string.equals(((UpdateBruteForceSettingsRequestContentMode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COUNT_PER_IDENTIFIER: + return visitor.visitCountPerIdentifier(); + case COUNT_PER_IDENTIFIER_AND_IP: + return visitor.visitCountPerIdentifierAndIp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateBruteForceSettingsRequestContentMode valueOf(String value) { + switch (value) { + case "count_per_identifier": + return COUNT_PER_IDENTIFIER; + case "count_per_identifier_and_ip": + return COUNT_PER_IDENTIFIER_AND_IP; + default: + return new UpdateBruteForceSettingsRequestContentMode(Value.UNKNOWN, value); + } + } + + public enum Value { + COUNT_PER_IDENTIFIER_AND_IP, + + COUNT_PER_IDENTIFIER, + + UNKNOWN + } + + public interface Visitor { + T visitCountPerIdentifierAndIp(); + + T visitCountPerIdentifier(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java new file mode 100644 index 000000000..4d77f09f9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateBruteForceSettingsRequestContentShieldsItem { + public static final UpdateBruteForceSettingsRequestContentShieldsItem BLOCK = + new UpdateBruteForceSettingsRequestContentShieldsItem(Value.BLOCK, "block"); + + public static final UpdateBruteForceSettingsRequestContentShieldsItem USER_NOTIFICATION = + new UpdateBruteForceSettingsRequestContentShieldsItem(Value.USER_NOTIFICATION, "user_notification"); + + private final Value value; + + private final String string; + + UpdateBruteForceSettingsRequestContentShieldsItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateBruteForceSettingsRequestContentShieldsItem + && this.string.equals(((UpdateBruteForceSettingsRequestContentShieldsItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case USER_NOTIFICATION: + return visitor.visitUserNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateBruteForceSettingsRequestContentShieldsItem valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "user_notification": + return USER_NOTIFICATION; + default: + return new UpdateBruteForceSettingsRequestContentShieldsItem(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + USER_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitUserNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java new file mode 100644 index 000000000..de916780f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.SuspiciousIpThrottlingShieldsEnum; +import com.auth0.client.mgmt.types.SuspiciousIpThrottlingStage; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSuspiciousIpThrottlingSettingsRequestContent.Builder.class) +public final class UpdateSuspiciousIpThrottlingSettingsRequestContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional stage; + + private final Map additionalProperties; + + private UpdateSuspiciousIpThrottlingSettingsRequestContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not suspicious IP throttling attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSuspiciousIpThrottlingSettingsRequestContent + && equalTo((UpdateSuspiciousIpThrottlingSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsRequestContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSuspiciousIpThrottlingSettingsRequestContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not suspicious IP throttling attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(SuspiciousIpThrottlingStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public UpdateSuspiciousIpThrottlingSettingsRequestContent build() { + return new UpdateSuspiciousIpThrottlingSettingsRequestContent( + enabled, shields, allowlist, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java new file mode 100644 index 000000000..2de627f9c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.PaymentRequiredError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetUniversalLoginTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUniversalLoginTemplateRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTemplatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> getUniversalLogin() { + return getUniversalLogin(null); + } + + public CompletableFuture> getUniversalLogin( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUniversalLoginTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public CompletableFuture> updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent request) { + return updateUniversalLogin(request, null); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public CompletableFuture> updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> deleteUniversalLogin() { + return deleteUniversalLogin(null); + } + + public CompletableFuture> deleteUniversalLogin(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawThemesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawThemesClient.java new file mode 100644 index 000000000..618a45b5e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawThemesClient.java @@ -0,0 +1,486 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.branding.types.CreateBrandingThemeRequestContent; +import com.auth0.client.mgmt.branding.types.UpdateBrandingThemeRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingDefaultThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingThemeResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawThemesClient { + protected final ClientOptions clientOptions; + + public AsyncRawThemesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create branding theme. + */ + public CompletableFuture> create( + CreateBrandingThemeRequestContent request) { + return create(request, null); + } + + /** + * Create branding theme. + */ + public CompletableFuture> create( + CreateBrandingThemeRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateBrandingThemeResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve default branding theme. + */ + public CompletableFuture> getDefault() { + return getDefault(null); + } + + /** + * Retrieve default branding theme. + */ + public CompletableFuture> getDefault( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes/default") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingDefaultThemeResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve branding theme. + */ + public CompletableFuture> get(String themeId) { + return get(themeId, null); + } + + /** + * Retrieve branding theme. + */ + public CompletableFuture> get( + String themeId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingThemeResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete branding theme. + */ + public CompletableFuture> delete(String themeId) { + return delete(themeId, null); + } + + /** + * Delete branding theme. + */ + public CompletableFuture> delete(String themeId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update branding theme. + */ + public CompletableFuture> update( + String themeId, UpdateBrandingThemeRequestContent request) { + return update(themeId, request, null); + } + + /** + * Update branding theme. + */ + public CompletableFuture> update( + String themeId, UpdateBrandingThemeRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBrandingThemeResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java new file mode 100644 index 000000000..0f5f5ef94 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetUniversalLoginTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUniversalLoginTemplateRequestContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncTemplatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTemplatesClient rawClient; + + public AsyncTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTemplatesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture getUniversalLogin() { + return this.rawClient.getUniversalLogin().thenApply(response -> response.body()); + } + + public CompletableFuture getUniversalLogin( + RequestOptions requestOptions) { + return this.rawClient.getUniversalLogin(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public CompletableFuture updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { + return this.rawClient.updateUniversalLogin(request).thenApply(response -> response.body()); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public CompletableFuture updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateUniversalLogin(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture deleteUniversalLogin() { + return this.rawClient.deleteUniversalLogin().thenApply(response -> response.body()); + } + + public CompletableFuture deleteUniversalLogin(RequestOptions requestOptions) { + return this.rawClient.deleteUniversalLogin(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncThemesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncThemesClient.java new file mode 100644 index 000000000..4625a2d9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncThemesClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.branding.types.CreateBrandingThemeRequestContent; +import com.auth0.client.mgmt.branding.types.UpdateBrandingThemeRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingDefaultThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingThemeResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncThemesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawThemesClient rawClient; + + public AsyncThemesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawThemesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawThemesClient withRawResponse() { + return this.rawClient; + } + + /** + * Create branding theme. + */ + public CompletableFuture create(CreateBrandingThemeRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create branding theme. + */ + public CompletableFuture create( + CreateBrandingThemeRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve default branding theme. + */ + public CompletableFuture getDefault() { + return this.rawClient.getDefault().thenApply(response -> response.body()); + } + + /** + * Retrieve default branding theme. + */ + public CompletableFuture getDefault(RequestOptions requestOptions) { + return this.rawClient.getDefault(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve branding theme. + */ + public CompletableFuture get(String themeId) { + return this.rawClient.get(themeId).thenApply(response -> response.body()); + } + + /** + * Retrieve branding theme. + */ + public CompletableFuture get(String themeId, RequestOptions requestOptions) { + return this.rawClient.get(themeId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete branding theme. + */ + public CompletableFuture delete(String themeId) { + return this.rawClient.delete(themeId).thenApply(response -> response.body()); + } + + /** + * Delete branding theme. + */ + public CompletableFuture delete(String themeId, RequestOptions requestOptions) { + return this.rawClient.delete(themeId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update branding theme. + */ + public CompletableFuture update( + String themeId, UpdateBrandingThemeRequestContent request) { + return this.rawClient.update(themeId, request).thenApply(response -> response.body()); + } + + /** + * Update branding theme. + */ + public CompletableFuture update( + String themeId, UpdateBrandingThemeRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(themeId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java new file mode 100644 index 000000000..d97ce2a77 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.PaymentRequiredError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetUniversalLoginTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUniversalLoginTemplateRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTemplatesClient { + protected final ClientOptions clientOptions; + + public RawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse getUniversalLogin() { + return getUniversalLogin(null); + } + + public ManagementApiHttpResponse getUniversalLogin( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUniversalLoginTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public ManagementApiHttpResponse updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { + return updateUniversalLogin(request, null); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public ManagementApiHttpResponse updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse deleteUniversalLogin() { + return deleteUniversalLogin(null); + } + + public ManagementApiHttpResponse deleteUniversalLogin(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/templates/universal-login") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/RawThemesClient.java b/src/main/java/com/auth0/client/mgmt/branding/RawThemesClient.java new file mode 100644 index 000000000..a16997d17 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/RawThemesClient.java @@ -0,0 +1,367 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.branding.types.CreateBrandingThemeRequestContent; +import com.auth0.client.mgmt.branding.types.UpdateBrandingThemeRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingDefaultThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingThemeResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawThemesClient { + protected final ClientOptions clientOptions; + + public RawThemesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create branding theme. + */ + public ManagementApiHttpResponse create( + CreateBrandingThemeRequestContent request) { + return create(request, null); + } + + /** + * Create branding theme. + */ + public ManagementApiHttpResponse create( + CreateBrandingThemeRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateBrandingThemeResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve default branding theme. + */ + public ManagementApiHttpResponse getDefault() { + return getDefault(null); + } + + /** + * Retrieve default branding theme. + */ + public ManagementApiHttpResponse getDefault(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes/default") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingDefaultThemeResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve branding theme. + */ + public ManagementApiHttpResponse get(String themeId) { + return get(themeId, null); + } + + /** + * Retrieve branding theme. + */ + public ManagementApiHttpResponse get( + String themeId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetBrandingThemeResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete branding theme. + */ + public ManagementApiHttpResponse delete(String themeId) { + return delete(themeId, null); + } + + /** + * Delete branding theme. + */ + public ManagementApiHttpResponse delete(String themeId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update branding theme. + */ + public ManagementApiHttpResponse update( + String themeId, UpdateBrandingThemeRequestContent request) { + return update(themeId, request, null); + } + + /** + * Update branding theme. + */ + public ManagementApiHttpResponse update( + String themeId, UpdateBrandingThemeRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/themes") + .addPathSegment(themeId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBrandingThemeResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java new file mode 100644 index 000000000..fcfd5cb76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetUniversalLoginTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUniversalLoginTemplateRequestContent; + +public class TemplatesClient { + protected final ClientOptions clientOptions; + + private final RawTemplatesClient rawClient; + + public TemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTemplatesClient withRawResponse() { + return this.rawClient; + } + + public GetUniversalLoginTemplateResponseContent getUniversalLogin() { + return this.rawClient.getUniversalLogin().body(); + } + + public GetUniversalLoginTemplateResponseContent getUniversalLogin(RequestOptions requestOptions) { + return this.rawClient.getUniversalLogin(requestOptions).body(); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public void updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { + this.rawClient.updateUniversalLogin(request).body(); + } + + /** + * Update the Universal Login branding template. + *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + * <pre> + * { + * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * } + * </pre>

+ *

<p> + * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * </p> + * <pre> + * &lt!DOCTYPE html&gt; + * &lt;code&gt; + * &lt;html&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; + * &lt;/code&gt; + * </pre>

+ */ + public void updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { + this.rawClient.updateUniversalLogin(request, requestOptions).body(); + } + + public void deleteUniversalLogin() { + this.rawClient.deleteUniversalLogin().body(); + } + + public void deleteUniversalLogin(RequestOptions requestOptions) { + this.rawClient.deleteUniversalLogin(requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/ThemesClient.java b/src/main/java/com/auth0/client/mgmt/branding/ThemesClient.java new file mode 100644 index 000000000..a1e1c3312 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/ThemesClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding; + +import com.auth0.client.mgmt.branding.types.CreateBrandingThemeRequestContent; +import com.auth0.client.mgmt.branding.types.UpdateBrandingThemeRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingDefaultThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingThemeResponseContent; + +public class ThemesClient { + protected final ClientOptions clientOptions; + + private final RawThemesClient rawClient; + + public ThemesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawThemesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawThemesClient withRawResponse() { + return this.rawClient; + } + + /** + * Create branding theme. + */ + public CreateBrandingThemeResponseContent create(CreateBrandingThemeRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create branding theme. + */ + public CreateBrandingThemeResponseContent create( + CreateBrandingThemeRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve default branding theme. + */ + public GetBrandingDefaultThemeResponseContent getDefault() { + return this.rawClient.getDefault().body(); + } + + /** + * Retrieve default branding theme. + */ + public GetBrandingDefaultThemeResponseContent getDefault(RequestOptions requestOptions) { + return this.rawClient.getDefault(requestOptions).body(); + } + + /** + * Retrieve branding theme. + */ + public GetBrandingThemeResponseContent get(String themeId) { + return this.rawClient.get(themeId).body(); + } + + /** + * Retrieve branding theme. + */ + public GetBrandingThemeResponseContent get(String themeId, RequestOptions requestOptions) { + return this.rawClient.get(themeId, requestOptions).body(); + } + + /** + * Delete branding theme. + */ + public void delete(String themeId) { + this.rawClient.delete(themeId).body(); + } + + /** + * Delete branding theme. + */ + public void delete(String themeId, RequestOptions requestOptions) { + this.rawClient.delete(themeId, requestOptions).body(); + } + + /** + * Update branding theme. + */ + public UpdateBrandingThemeResponseContent update(String themeId, UpdateBrandingThemeRequestContent request) { + return this.rawClient.update(themeId, request).body(); + } + + /** + * Update branding theme. + */ + public UpdateBrandingThemeResponseContent update( + String themeId, UpdateBrandingThemeRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(themeId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncPhoneClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncPhoneClient.java new file mode 100644 index 000000000..91aead55c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncPhoneClient.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncPhoneClient { + protected final ClientOptions clientOptions; + + protected final Supplier providersClient; + + protected final Supplier templatesClient; + + public AsyncPhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.providersClient = Suppliers.memoize(() -> new AsyncProvidersClient(clientOptions)); + this.templatesClient = Suppliers.memoize(() -> new AsyncTemplatesClient(clientOptions)); + } + + public AsyncProvidersClient providers() { + return this.providersClient.get(); + } + + public AsyncTemplatesClient templates() { + return this.templatesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncProvidersClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncProvidersClient.java new file mode 100644 index 000000000..2c88e697d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncProvidersClient.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneProviderSendTestRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; +import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.ListBrandingPhoneProvidersResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingPhoneProviderResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncProvidersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawProvidersClient rawClient; + + public AsyncProvidersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawProvidersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawProvidersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture list( + ListBrandingPhoneProvidersRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture list( + ListBrandingPhoneProvidersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture create( + CreateBrandingPhoneProviderRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture create( + CreateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete the configured phone provider. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete the configured phone provider. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture update( + String id, UpdateBrandingPhoneProviderRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture update( + String id, UpdateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreatePhoneProviderSendTestRequestContent request) { + return this.rawClient.test(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreatePhoneProviderSendTestRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java new file mode 100644 index 000000000..d05a88591 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java @@ -0,0 +1,618 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneProviderSendTestRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; +import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.ListBrandingPhoneProvidersResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingPhoneProviderResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawProvidersClient { + protected final ClientOptions clientOptions; + + public AsyncRawProvidersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> list() { + return list(ListBrandingPhoneProvidersRequestParameters.builder().build()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> list( + ListBrandingPhoneProvidersRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> list( + ListBrandingPhoneProvidersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers"); + QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListBrandingPhoneProvidersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture> create( + CreateBrandingPhoneProviderRequestContent request) { + return create(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture> create( + CreateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateBrandingPhoneProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingPhoneProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete the configured phone provider. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete the configured phone provider. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture> update(String id) { + return update(id, UpdateBrandingPhoneProviderRequestContent.builder().build()); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture> update( + String id, UpdateBrandingPhoneProviderRequestContent request) { + return update(id, request, null); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CompletableFuture> update( + String id, UpdateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBrandingPhoneProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> test( + String id, CreatePhoneProviderSendTestRequestContent request) { + return test(id, request, null); + } + + public CompletableFuture> test( + String id, CreatePhoneProviderSendTestRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .addPathSegments("try") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneProviderSendTestResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawTemplatesClient.java new file mode 100644 index 000000000..a0a2910a6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawTemplatesClient.java @@ -0,0 +1,665 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateTestNotificationRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; +import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.ListPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.ResetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdatePhoneTemplateResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTemplatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> list() { + return list(ListPhoneTemplatesRequestParameters.builder().build()); + } + + public CompletableFuture> list( + ListPhoneTemplatesRequestParameters request) { + return list(request, null); + } + + public CompletableFuture> list( + ListPhoneTemplatesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates"); + QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListPhoneTemplatesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create() { + return create(CreatePhoneTemplateRequestContent.builder().build()); + } + + public CompletableFuture> create( + CreatePhoneTemplateRequestContent request) { + return create(request, null); + } + + public CompletableFuture> create( + CreatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, null); + } + + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetPhoneTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update(String id) { + return update(id, UpdatePhoneTemplateRequestContent.builder().build()); + } + + public CompletableFuture> update( + String id, UpdatePhoneTemplateRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdatePhoneTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> reset( + String id, Object request) { + return reset(id, request, null); + } + + public CompletableFuture> reset( + String id, Object request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .addPathSegments("reset") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ResetPhoneTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> test( + String id, CreatePhoneTemplateTestNotificationRequestContent request) { + return test(id, request, null); + } + + public CompletableFuture> test( + String id, CreatePhoneTemplateTestNotificationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .addPathSegments("try") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneTemplateTestNotificationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncTemplatesClient.java new file mode 100644 index 000000000..0f57afb71 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncTemplatesClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateTestNotificationRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; +import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.ListPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.ResetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdatePhoneTemplateResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncTemplatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTemplatesClient rawClient; + + public AsyncTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTemplatesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture list(ListPhoneTemplatesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture list( + ListPhoneTemplatesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + public CompletableFuture create(CreatePhoneTemplateRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdatePhoneTemplateRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture reset(String id, Object request) { + return this.rawClient.reset(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture reset( + String id, Object request, RequestOptions requestOptions) { + return this.rawClient.reset(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreatePhoneTemplateTestNotificationRequestContent request) { + return this.rawClient.test(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture test( + String id, CreatePhoneTemplateTestNotificationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/PhoneClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/PhoneClient.java new file mode 100644 index 000000000..e9cee2da4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/PhoneClient.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class PhoneClient { + protected final ClientOptions clientOptions; + + protected final Supplier providersClient; + + protected final Supplier templatesClient; + + public PhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.providersClient = Suppliers.memoize(() -> new ProvidersClient(clientOptions)); + this.templatesClient = Suppliers.memoize(() -> new TemplatesClient(clientOptions)); + } + + public ProvidersClient providers() { + return this.providersClient.get(); + } + + public TemplatesClient templates() { + return this.templatesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/ProvidersClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/ProvidersClient.java new file mode 100644 index 000000000..c762a0b4c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/ProvidersClient.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneProviderSendTestRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; +import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.ListBrandingPhoneProvidersResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingPhoneProviderResponseContent; + +public class ProvidersClient { + protected final ClientOptions clientOptions; + + private final RawProvidersClient rawClient; + + public ProvidersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawProvidersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawProvidersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ListBrandingPhoneProvidersResponseContent list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ListBrandingPhoneProvidersResponseContent list(ListBrandingPhoneProvidersRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ListBrandingPhoneProvidersResponseContent list( + ListBrandingPhoneProvidersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CreateBrandingPhoneProviderResponseContent create(CreateBrandingPhoneProviderRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public CreateBrandingPhoneProviderResponseContent create( + CreateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public GetBrandingPhoneProviderResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public GetBrandingPhoneProviderResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete the configured phone provider. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete the configured phone provider. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public UpdateBrandingPhoneProviderResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public UpdateBrandingPhoneProviderResponseContent update( + String id, UpdateBrandingPhoneProviderRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public UpdateBrandingPhoneProviderResponseContent update( + String id, UpdateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public CreatePhoneProviderSendTestResponseContent test( + String id, CreatePhoneProviderSendTestRequestContent request) { + return this.rawClient.test(id, request).body(); + } + + public CreatePhoneProviderSendTestResponseContent test( + String id, CreatePhoneProviderSendTestRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/RawProvidersClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/RawProvidersClient.java new file mode 100644 index 000000000..ba5f33227 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/RawProvidersClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneProviderSendTestRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; +import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.ListBrandingPhoneProvidersResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingPhoneProviderResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawProvidersClient { + protected final ClientOptions clientOptions; + + public RawProvidersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse list() { + return list(ListBrandingPhoneProvidersRequestParameters.builder().build()); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse list( + ListBrandingPhoneProvidersRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone providers</a> details set for a Tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse list( + ListBrandingPhoneProvidersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers"); + QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListBrandingPhoneProvidersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public ManagementApiHttpResponse create( + CreateBrandingPhoneProviderRequestContent request) { + return create(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public ManagementApiHttpResponse create( + CreateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateBrandingPhoneProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a> details. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBrandingPhoneProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete the configured phone provider. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete the configured phone provider. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateBrandingPhoneProviderRequestContent.builder().build()); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public ManagementApiHttpResponse update( + String id, UpdateBrandingPhoneProviderRequestContent request) { + return update(id, request, null); + } + + /** + * Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>. + * The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property). + */ + public ManagementApiHttpResponse update( + String id, UpdateBrandingPhoneProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBrandingPhoneProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse test( + String id, CreatePhoneProviderSendTestRequestContent request) { + return test(id, request, null); + } + + public ManagementApiHttpResponse test( + String id, CreatePhoneProviderSendTestRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/providers") + .addPathSegment(id) + .addPathSegments("try") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneProviderSendTestResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java new file mode 100644 index 000000000..e6d18b9e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java @@ -0,0 +1,495 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateTestNotificationRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; +import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.ListPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.ResetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdatePhoneTemplateResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTemplatesClient { + protected final ClientOptions clientOptions; + + public RawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse list() { + return list(ListPhoneTemplatesRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse list( + ListPhoneTemplatesRequestParameters request) { + return list(request, null); + } + + public ManagementApiHttpResponse list( + ListPhoneTemplatesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates"); + QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListPhoneTemplatesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create() { + return create(CreatePhoneTemplateRequestContent.builder().build()); + } + + public ManagementApiHttpResponse create( + CreatePhoneTemplateRequestContent request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + CreatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetPhoneTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update(String id) { + return update(id, UpdatePhoneTemplateRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update( + String id, UpdatePhoneTemplateRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, UpdatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdatePhoneTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse reset(String id, Object request) { + return reset(id, request, null); + } + + public ManagementApiHttpResponse reset( + String id, Object request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .addPathSegments("reset") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ResetPhoneTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse test( + String id, CreatePhoneTemplateTestNotificationRequestContent request) { + return test(id, request, null); + } + + public ManagementApiHttpResponse test( + String id, CreatePhoneTemplateTestNotificationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("branding/phone/templates") + .addPathSegment(id) + .addPathSegments("try") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreatePhoneTemplateTestNotificationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/TemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/TemplatesClient.java new file mode 100644 index 000000000..ced259322 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/TemplatesClient.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone; + +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateTestNotificationRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; +import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.ListPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.ResetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdatePhoneTemplateResponseContent; + +public class TemplatesClient { + protected final ClientOptions clientOptions; + + private final RawTemplatesClient rawClient; + + public TemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTemplatesClient withRawResponse() { + return this.rawClient; + } + + public ListPhoneTemplatesResponseContent list() { + return this.rawClient.list().body(); + } + + public ListPhoneTemplatesResponseContent list(ListPhoneTemplatesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + public ListPhoneTemplatesResponseContent list( + ListPhoneTemplatesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreatePhoneTemplateResponseContent create() { + return this.rawClient.create().body(); + } + + public CreatePhoneTemplateResponseContent create(CreatePhoneTemplateRequestContent request) { + return this.rawClient.create(request).body(); + } + + public CreatePhoneTemplateResponseContent create( + CreatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetPhoneTemplateResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetPhoneTemplateResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdatePhoneTemplateResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + public UpdatePhoneTemplateResponseContent update(String id, UpdatePhoneTemplateRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdatePhoneTemplateResponseContent update( + String id, UpdatePhoneTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + public ResetPhoneTemplateResponseContent reset(String id, Object request) { + return this.rawClient.reset(id, request).body(); + } + + public ResetPhoneTemplateResponseContent reset(String id, Object request, RequestOptions requestOptions) { + return this.rawClient.reset(id, request, requestOptions).body(); + } + + public CreatePhoneTemplateTestNotificationResponseContent test( + String id, CreatePhoneTemplateTestNotificationRequestContent request) { + return this.rawClient.test(id, request).body(); + } + + public CreatePhoneTemplateTestNotificationResponseContent test( + String id, CreatePhoneTemplateTestNotificationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.test(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java new file mode 100644 index 000000000..070e85106 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java @@ -0,0 +1,208 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PhoneProviderConfiguration; +import com.auth0.client.mgmt.types.PhoneProviderCredentials; +import com.auth0.client.mgmt.types.PhoneProviderNameEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateBrandingPhoneProviderRequestContent.Builder.class) +public final class CreateBrandingPhoneProviderRequestContent { + private final PhoneProviderNameEnum name; + + private final Optional disabled; + + private final Optional configuration; + + private final PhoneProviderCredentials credentials; + + private final Map additionalProperties; + + private CreateBrandingPhoneProviderRequestContent( + PhoneProviderNameEnum name, + Optional disabled, + Optional configuration, + PhoneProviderCredentials credentials, + Map additionalProperties) { + this.name = name; + this.disabled = disabled; + this.configuration = configuration; + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public PhoneProviderNameEnum getName() { + return name; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + @JsonProperty("credentials") + public PhoneProviderCredentials getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateBrandingPhoneProviderRequestContent + && equalTo((CreateBrandingPhoneProviderRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateBrandingPhoneProviderRequestContent other) { + return name.equals(other.name) + && disabled.equals(other.disabled) + && configuration.equals(other.configuration) + && credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.disabled, this.configuration, this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CredentialsStage name(@NotNull PhoneProviderNameEnum name); + + Builder from(CreateBrandingPhoneProviderRequestContent other); + } + + public interface CredentialsStage { + _FinalStage credentials(@NotNull PhoneProviderCredentials credentials); + } + + public interface _FinalStage { + CreateBrandingPhoneProviderRequestContent build(); + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(Optional disabled); + + _FinalStage disabled(Boolean disabled); + + _FinalStage configuration(Optional configuration); + + _FinalStage configuration(PhoneProviderConfiguration configuration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CredentialsStage, _FinalStage { + private PhoneProviderNameEnum name; + + private PhoneProviderCredentials credentials; + + private Optional configuration = Optional.empty(); + + private Optional disabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateBrandingPhoneProviderRequestContent other) { + name(other.getName()); + disabled(other.getDisabled()); + configuration(other.getConfiguration()); + credentials(other.getCredentials()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CredentialsStage name(@NotNull PhoneProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("credentials") + public _FinalStage credentials(@NotNull PhoneProviderCredentials credentials) { + this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public _FinalStage configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @java.lang.Override + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public _FinalStage disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public CreateBrandingPhoneProviderRequestContent build() { + return new CreateBrandingPhoneProviderRequestContent( + name, disabled, configuration, credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java new file mode 100644 index 000000000..ebbbd5cce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PhoneProviderDeliveryMethodEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneProviderSendTestRequestContent.Builder.class) +public final class CreatePhoneProviderSendTestRequestContent { + private final String to; + + private final Optional deliveryMethod; + + private final Map additionalProperties; + + private CreatePhoneProviderSendTestRequestContent( + String to, + Optional deliveryMethod, + Map additionalProperties) { + this.to = to; + this.deliveryMethod = deliveryMethod; + this.additionalProperties = additionalProperties; + } + + /** + * @return The recipient phone number to receive a given notification. + */ + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("delivery_method") + public Optional getDeliveryMethod() { + return deliveryMethod; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneProviderSendTestRequestContent + && equalTo((CreatePhoneProviderSendTestRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneProviderSendTestRequestContent other) { + return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.to, this.deliveryMethod); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ToStage builder() { + return new Builder(); + } + + public interface ToStage { + /** + *

The recipient phone number to receive a given notification.

+ */ + _FinalStage to(@NotNull String to); + + Builder from(CreatePhoneProviderSendTestRequestContent other); + } + + public interface _FinalStage { + CreatePhoneProviderSendTestRequestContent build(); + + _FinalStage deliveryMethod(Optional deliveryMethod); + + _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ToStage, _FinalStage { + private String to; + + private Optional deliveryMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePhoneProviderSendTestRequestContent other) { + to(other.getTo()); + deliveryMethod(other.getDeliveryMethod()); + return this; + } + + /** + *

The recipient phone number to receive a given notification.

+ *

The recipient phone number to receive a given notification.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("to") + public _FinalStage to(@NotNull String to) { + this.to = Objects.requireNonNull(to, "to must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { + this.deliveryMethod = Optional.ofNullable(deliveryMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) + public _FinalStage deliveryMethod(Optional deliveryMethod) { + this.deliveryMethod = deliveryMethod; + return this; + } + + @java.lang.Override + public CreatePhoneProviderSendTestRequestContent build() { + return new CreatePhoneProviderSendTestRequestContent(to, deliveryMethod, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java new file mode 100644 index 000000000..2d9f5467d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PhoneTemplateContent; +import com.auth0.client.mgmt.types.PhoneTemplateNotificationTypeEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneTemplateRequestContent.Builder.class) +public final class CreatePhoneTemplateRequestContent { + private final Optional type; + + private final Optional disabled; + + private final Optional content; + + private final Map additionalProperties; + + private CreatePhoneTemplateRequestContent( + Optional type, + Optional disabled, + Optional content, + Map additionalProperties) { + this.type = type; + this.disabled = disabled; + this.content = content; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("content") + public Optional getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneTemplateRequestContent && equalTo((CreatePhoneTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneTemplateRequestContent other) { + return type.equals(other.type) && disabled.equals(other.disabled) && content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.disabled, this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional content = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreatePhoneTemplateRequestContent other) { + type(other.getType()); + disabled(other.getDisabled()); + content(other.getContent()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PhoneTemplateNotificationTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public Builder disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(PhoneTemplateContent content) { + this.content = Optional.ofNullable(content); + return this; + } + + public CreatePhoneTemplateRequestContent build() { + return new CreatePhoneTemplateRequestContent(type, disabled, content, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java new file mode 100644 index 000000000..7cb0e906b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PhoneProviderDeliveryMethodEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneTemplateTestNotificationRequestContent.Builder.class) +public final class CreatePhoneTemplateTestNotificationRequestContent { + private final String to; + + private final Optional deliveryMethod; + + private final Map additionalProperties; + + private CreatePhoneTemplateTestNotificationRequestContent( + String to, + Optional deliveryMethod, + Map additionalProperties) { + this.to = to; + this.deliveryMethod = deliveryMethod; + this.additionalProperties = additionalProperties; + } + + /** + * @return Destination of the testing phone notification + */ + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("delivery_method") + public Optional getDeliveryMethod() { + return deliveryMethod; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneTemplateTestNotificationRequestContent + && equalTo((CreatePhoneTemplateTestNotificationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneTemplateTestNotificationRequestContent other) { + return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.to, this.deliveryMethod); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ToStage builder() { + return new Builder(); + } + + public interface ToStage { + /** + *

Destination of the testing phone notification

+ */ + _FinalStage to(@NotNull String to); + + Builder from(CreatePhoneTemplateTestNotificationRequestContent other); + } + + public interface _FinalStage { + CreatePhoneTemplateTestNotificationRequestContent build(); + + _FinalStage deliveryMethod(Optional deliveryMethod); + + _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ToStage, _FinalStage { + private String to; + + private Optional deliveryMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePhoneTemplateTestNotificationRequestContent other) { + to(other.getTo()); + deliveryMethod(other.getDeliveryMethod()); + return this; + } + + /** + *

Destination of the testing phone notification

+ *

Destination of the testing phone notification

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("to") + public _FinalStage to(@NotNull String to) { + this.to = Objects.requireNonNull(to, "to must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { + this.deliveryMethod = Optional.ofNullable(deliveryMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) + public _FinalStage deliveryMethod(Optional deliveryMethod) { + this.deliveryMethod = deliveryMethod; + return this; + } + + @java.lang.Override + public CreatePhoneTemplateTestNotificationRequestContent build() { + return new CreatePhoneTemplateTestNotificationRequestContent(to, deliveryMethod, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java new file mode 100644 index 000000000..4546bbb2e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListBrandingPhoneProvidersRequestParameters.Builder.class) +public final class ListBrandingPhoneProvidersRequestParameters { + private final OptionalNullable disabled; + + private final Map additionalProperties; + + private ListBrandingPhoneProvidersRequestParameters( + OptionalNullable disabled, Map additionalProperties) { + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + public OptionalNullable getDisabled() { + if (disabled == null) { + return OptionalNullable.absent(); + } + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private OptionalNullable _getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListBrandingPhoneProvidersRequestParameters + && equalTo((ListBrandingPhoneProvidersRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListBrandingPhoneProvidersRequestParameters other) { + return disabled.equals(other.disabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable disabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListBrandingPhoneProvidersRequestParameters other) { + disabled(other.getDisabled()); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public Builder disabled(@Nullable OptionalNullable disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = OptionalNullable.of(disabled); + return this; + } + + public Builder disabled(Optional disabled) { + if (disabled.isPresent()) { + this.disabled = OptionalNullable.of(disabled.get()); + } else { + this.disabled = OptionalNullable.absent(); + } + return this; + } + + public Builder disabled(com.auth0.client.mgmt.core.Nullable disabled) { + if (disabled.isNull()) { + this.disabled = OptionalNullable.ofNull(); + } else if (disabled.isEmpty()) { + this.disabled = OptionalNullable.absent(); + } else { + this.disabled = OptionalNullable.of(disabled.get()); + } + return this; + } + + public ListBrandingPhoneProvidersRequestParameters build() { + return new ListBrandingPhoneProvidersRequestParameters(disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java new file mode 100644 index 000000000..a2186347a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListPhoneTemplatesRequestParameters.Builder.class) +public final class ListPhoneTemplatesRequestParameters { + private final OptionalNullable disabled; + + private final Map additionalProperties; + + private ListPhoneTemplatesRequestParameters( + OptionalNullable disabled, Map additionalProperties) { + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + public OptionalNullable getDisabled() { + if (disabled == null) { + return OptionalNullable.absent(); + } + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private OptionalNullable _getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListPhoneTemplatesRequestParameters + && equalTo((ListPhoneTemplatesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListPhoneTemplatesRequestParameters other) { + return disabled.equals(other.disabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable disabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListPhoneTemplatesRequestParameters other) { + disabled(other.getDisabled()); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public Builder disabled(@Nullable OptionalNullable disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = OptionalNullable.of(disabled); + return this; + } + + public Builder disabled(Optional disabled) { + if (disabled.isPresent()) { + this.disabled = OptionalNullable.of(disabled.get()); + } else { + this.disabled = OptionalNullable.absent(); + } + return this; + } + + public Builder disabled(com.auth0.client.mgmt.core.Nullable disabled) { + if (disabled.isNull()) { + this.disabled = OptionalNullable.ofNull(); + } else if (disabled.isEmpty()) { + this.disabled = OptionalNullable.absent(); + } else { + this.disabled = OptionalNullable.of(disabled.get()); + } + return this; + } + + public ListPhoneTemplatesRequestParameters build() { + return new ListPhoneTemplatesRequestParameters(disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java new file mode 100644 index 000000000..bf8583d48 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PhoneProviderConfiguration; +import com.auth0.client.mgmt.types.PhoneProviderCredentials; +import com.auth0.client.mgmt.types.PhoneProviderNameEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingPhoneProviderRequestContent.Builder.class) +public final class UpdateBrandingPhoneProviderRequestContent { + private final Optional name; + + private final Optional disabled; + + private final Optional credentials; + + private final Optional configuration; + + private final Map additionalProperties; + + private UpdateBrandingPhoneProviderRequestContent( + Optional name, + Optional disabled, + Optional credentials, + Optional configuration, + Map additionalProperties) { + this.name = name; + this.disabled = disabled; + this.credentials = credentials; + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingPhoneProviderRequestContent + && equalTo((UpdateBrandingPhoneProviderRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingPhoneProviderRequestContent other) { + return name.equals(other.name) + && disabled.equals(other.disabled) + && credentials.equals(other.credentials) + && configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.disabled, this.credentials, this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional credentials = Optional.empty(); + + private Optional configuration = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBrandingPhoneProviderRequestContent other) { + name(other.getName()); + disabled(other.getDisabled()); + credentials(other.getCredentials()); + configuration(other.getConfiguration()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(PhoneProviderNameEnum name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public Builder disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(PhoneProviderCredentials credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public Builder configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + public Builder configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + public UpdateBrandingPhoneProviderRequestContent build() { + return new UpdateBrandingPhoneProviderRequestContent( + name, disabled, credentials, configuration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java new file mode 100644 index 000000000..3e19fd8f5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.phone.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PartialPhoneTemplateContent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdatePhoneTemplateRequestContent.Builder.class) +public final class UpdatePhoneTemplateRequestContent { + private final Optional content; + + private final Optional disabled; + + private final Map additionalProperties; + + private UpdatePhoneTemplateRequestContent( + Optional content, + Optional disabled, + Map additionalProperties) { + this.content = content; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdatePhoneTemplateRequestContent && equalTo((UpdatePhoneTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdatePhoneTemplateRequestContent other) { + return content.equals(other.content) && disabled.equals(other.disabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.content, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional content = Optional.empty(); + + private Optional disabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdatePhoneTemplateRequestContent other) { + content(other.getContent()); + disabled(other.getDisabled()); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(PartialPhoneTemplateContent content) { + this.content = Optional.ofNullable(content); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public Builder disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + public UpdatePhoneTemplateRequestContent build() { + return new UpdatePhoneTemplateRequestContent(content, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java new file mode 100644 index 000000000..ccf342554 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java @@ -0,0 +1,252 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.BrandingThemeBorders; +import com.auth0.client.mgmt.types.BrandingThemeColors; +import com.auth0.client.mgmt.types.BrandingThemeFonts; +import com.auth0.client.mgmt.types.BrandingThemePageBackground; +import com.auth0.client.mgmt.types.BrandingThemeWidget; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateBrandingThemeRequestContent.Builder.class) +public final class CreateBrandingThemeRequestContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final Optional displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private CreateBrandingThemeRequestContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + Optional displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateBrandingThemeRequestContent && equalTo((CreateBrandingThemeRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateBrandingThemeRequestContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(CreateBrandingThemeRequestContent other); + } + + public interface ColorsStage { + FontsStage colors(@NotNull BrandingThemeColors colors); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + CreateBrandingThemeRequestContent build(); + + /** + *

Display Name

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, ColorsStage, FontsStage, PageBackgroundStage, WidgetStage, _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private BrandingThemeWidget widget; + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateBrandingThemeRequestContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public FontsStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + /** + *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Display Name

+ */ + @java.lang.Override + @JsonSetter(value = "displayName", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public CreateBrandingThemeRequestContent build() { + return new CreateBrandingThemeRequestContent( + borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java new file mode 100644 index 000000000..385409f0b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java @@ -0,0 +1,252 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.branding.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.BrandingThemeBorders; +import com.auth0.client.mgmt.types.BrandingThemeColors; +import com.auth0.client.mgmt.types.BrandingThemeFonts; +import com.auth0.client.mgmt.types.BrandingThemePageBackground; +import com.auth0.client.mgmt.types.BrandingThemeWidget; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingThemeRequestContent.Builder.class) +public final class UpdateBrandingThemeRequestContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final Optional displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private UpdateBrandingThemeRequestContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + Optional displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingThemeRequestContent && equalTo((UpdateBrandingThemeRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingThemeRequestContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(UpdateBrandingThemeRequestContent other); + } + + public interface ColorsStage { + FontsStage colors(@NotNull BrandingThemeColors colors); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + UpdateBrandingThemeRequestContent build(); + + /** + *

Display Name

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, ColorsStage, FontsStage, PageBackgroundStage, WidgetStage, _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private BrandingThemeWidget widget; + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateBrandingThemeRequestContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public FontsStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + /** + *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Display Name

+ */ + @java.lang.Override + @JsonSetter(value = "displayName", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public UpdateBrandingThemeRequestContent build() { + return new UpdateBrandingThemeRequestContent( + borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncOrganizationsClient.java new file mode 100644 index 000000000..5d0796fdd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncOrganizationsClient.java @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clientgrants; + +import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; +import java.util.concurrent.CompletableFuture; + +public class AsyncOrganizationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOrganizationsClient rawClient; + + public AsyncOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOrganizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListClientGrantOrganizationsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListClientGrantOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java new file mode 100644 index 000000000..ff0490f09 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clientgrants; + +import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListClientGrantOrganizationsPaginatedResponseContent; +import com.auth0.client.mgmt.types.Organization; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOrganizationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list(String id) { + return list(id, ListClientGrantOrganizationsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + String id, ListClientGrantOrganizationsRequestParameters request) { + return list(id, request, null); + } + + public CompletableFuture>> list( + String id, ListClientGrantOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientGrantOrganizationsPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientGrantOrganizationsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListClientGrantOrganizationsRequestParameters nextRequest = + ListClientGrantOrganizationsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getOrganizations().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/clientgrants/OrganizationsClient.java new file mode 100644 index 000000000..a89f02ae5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/OrganizationsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clientgrants; + +import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; + +public class OrganizationsClient { + protected final ClientOptions clientOptions; + + private final RawOrganizationsClient rawClient; + + public OrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOrganizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + public SyncPagingIterable list(String id, ListClientGrantOrganizationsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + public SyncPagingIterable list( + String id, ListClientGrantOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/clientgrants/RawOrganizationsClient.java new file mode 100644 index 000000000..b269a68ec --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/RawOrganizationsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clientgrants; + +import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListClientGrantOrganizationsPaginatedResponseContent; +import com.auth0.client.mgmt.types.Organization; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOrganizationsClient { + protected final ClientOptions clientOptions; + + public RawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list(String id) { + return list(id, ListClientGrantOrganizationsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list( + String id, ListClientGrantOrganizationsRequestParameters request) { + return list(id, request, null); + } + + public ManagementApiHttpResponse> list( + String id, ListClientGrantOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client-grants") + .addPathSegment(id) + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientGrantOrganizationsPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientGrantOrganizationsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListClientGrantOrganizationsRequestParameters nextRequest = + ListClientGrantOrganizationsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getOrganizations().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java new file mode 100644 index 000000000..265a509fe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clientgrants.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientGrantOrganizationsRequestParameters.Builder.class) +public final class ListClientGrantOrganizationsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListClientGrantOrganizationsRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientGrantOrganizationsRequestParameters + && equalTo((ListClientGrantOrganizationsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientGrantOrganizationsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientGrantOrganizationsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListClientGrantOrganizationsRequestParameters build() { + return new ListClientGrantOrganizationsRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/clients/AsyncConnectionsClient.java new file mode 100644 index 000000000..57aec09a9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/AsyncConnectionsClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; +import java.util.concurrent.CompletableFuture; + +public class AsyncConnectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectionsClient rawClient; + + public AsyncConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture> get(String id, ConnectionsGetRequest request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture> get( + String id, ConnectionsGetRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/AsyncCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/clients/AsyncCredentialsClient.java new file mode 100644 index 000000000..cf5d698b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/AsyncCredentialsClient.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.PatchClientCredentialRequestContent; +import com.auth0.client.mgmt.clients.types.PostClientCredentialRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ClientCredential; +import com.auth0.client.mgmt.types.GetClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PatchClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PostClientCredentialResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncCredentialsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCredentialsClient rawClient; + + public AsyncCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCredentialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCredentialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture> list(String clientId) { + return this.rawClient.list(clientId).thenApply(response -> response.body()); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture> list(String clientId, RequestOptions requestOptions) { + return this.rawClient.list(clientId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public CompletableFuture create( + String clientId, PostClientCredentialRequestContent request) { + return this.rawClient.create(clientId, request).thenApply(response -> response.body()); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public CompletableFuture create( + String clientId, PostClientCredentialRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(clientId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture get(String clientId, String credentialId) { + return this.rawClient.get(clientId, credentialId).thenApply(response -> response.body()); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture get( + String clientId, String credentialId, RequestOptions requestOptions) { + return this.rawClient.get(clientId, credentialId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture delete(String clientId, String credentialId) { + return this.rawClient.delete(clientId, credentialId).thenApply(response -> response.body()); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture delete(String clientId, String credentialId, RequestOptions requestOptions) { + return this.rawClient.delete(clientId, credentialId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture update(String clientId, String credentialId) { + return this.rawClient.update(clientId, credentialId).thenApply(response -> response.body()); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture update( + String clientId, String credentialId, PatchClientCredentialRequestContent request) { + return this.rawClient.update(clientId, credentialId, request).thenApply(response -> response.body()); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture update( + String clientId, + String credentialId, + PatchClientCredentialRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(clientId, credentialId, request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java new file mode 100644 index 000000000..b11a0f861 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.ListClientConnectionsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConnectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture>> get(String id) { + return get(id, ConnectionsGetRequest.builder().build()); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture>> get( + String id, ConnectionsGetRequest request) { + return get(id, request, null); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public CompletableFuture>> get( + String id, ConnectionsGetRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getStrategy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "strategy", request.getStrategy().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientConnectionsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientConnectionsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ConnectionsGetRequest nextRequest = ConnectionsGetRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getConnections(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return get(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/AsyncRawCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawCredentialsClient.java new file mode 100644 index 000000000..796e86051 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawCredentialsClient.java @@ -0,0 +1,572 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.PatchClientCredentialRequestContent; +import com.auth0.client.mgmt.clients.types.PostClientCredentialRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ClientCredential; +import com.auth0.client.mgmt.types.GetClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PatchClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PostClientCredentialResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCredentialsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture>> list(String clientId) { + return list(clientId, null); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture>> list( + String clientId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public CompletableFuture> create( + String clientId, PostClientCredentialRequestContent request) { + return create(clientId, request, null); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public CompletableFuture> create( + String clientId, PostClientCredentialRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PostClientCredentialResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture> get( + String clientId, String credentialId) { + return get(clientId, credentialId, null); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public CompletableFuture> get( + String clientId, String credentialId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetClientCredentialResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> delete(String clientId, String credentialId) { + return delete(clientId, credentialId, null); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> delete( + String clientId, String credentialId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> update( + String clientId, String credentialId) { + return update( + clientId, + credentialId, + PatchClientCredentialRequestContent.builder().build()); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> update( + String clientId, String credentialId, PatchClientCredentialRequestContent request) { + return update(clientId, credentialId, request, null); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public CompletableFuture> update( + String clientId, + String credentialId, + PatchClientCredentialRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PatchClientCredentialResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/clients/ConnectionsClient.java new file mode 100644 index 000000000..3182774c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/ConnectionsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; + +public class ConnectionsClient { + protected final ClientOptions clientOptions; + + private final RawConnectionsClient rawClient; + + public ConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public SyncPagingIterable get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public SyncPagingIterable get(String id, ConnectionsGetRequest request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public SyncPagingIterable get( + String id, ConnectionsGetRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/CredentialsClient.java b/src/main/java/com/auth0/client/mgmt/clients/CredentialsClient.java new file mode 100644 index 000000000..577201989 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/CredentialsClient.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.PatchClientCredentialRequestContent; +import com.auth0.client.mgmt.clients.types.PostClientCredentialRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ClientCredential; +import com.auth0.client.mgmt.types.GetClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PatchClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PostClientCredentialResponseContent; +import java.util.List; + +public class CredentialsClient { + protected final ClientOptions clientOptions; + + private final RawCredentialsClient rawClient; + + public CredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCredentialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCredentialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public List list(String clientId) { + return this.rawClient.list(clientId).body(); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public List list(String clientId, RequestOptions requestOptions) { + return this.rawClient.list(clientId, requestOptions).body(); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public PostClientCredentialResponseContent create(String clientId, PostClientCredentialRequestContent request) { + return this.rawClient.create(clientId, request).body(); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public PostClientCredentialResponseContent create( + String clientId, PostClientCredentialRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(clientId, request, requestOptions).body(); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public GetClientCredentialResponseContent get(String clientId, String credentialId) { + return this.rawClient.get(clientId, credentialId).body(); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public GetClientCredentialResponseContent get(String clientId, String credentialId, RequestOptions requestOptions) { + return this.rawClient.get(clientId, credentialId, requestOptions).body(); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public void delete(String clientId, String credentialId) { + this.rawClient.delete(clientId, credentialId).body(); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public void delete(String clientId, String credentialId, RequestOptions requestOptions) { + this.rawClient.delete(clientId, credentialId, requestOptions).body(); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public PatchClientCredentialResponseContent update(String clientId, String credentialId) { + return this.rawClient.update(clientId, credentialId).body(); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public PatchClientCredentialResponseContent update( + String clientId, String credentialId, PatchClientCredentialRequestContent request) { + return this.rawClient.update(clientId, credentialId, request).body(); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public PatchClientCredentialResponseContent update( + String clientId, + String credentialId, + PatchClientCredentialRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(clientId, credentialId, request, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/clients/RawConnectionsClient.java new file mode 100644 index 000000000..d94013712 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/RawConnectionsClient.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.ListClientConnectionsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectionsClient { + protected final ClientOptions clientOptions; + + public RawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> get(String id) { + return get(id, ConnectionsGetRequest.builder().build()); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> get( + String id, ConnectionsGetRequest request) { + return get(id, request, null); + } + + /** + * Retrieve all connections that are enabled for the specified <a href="https://www.auth0.com/docs/get-started/applications"> Application</a>, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. + *

<ul> + * <li> + * This endpoint requires the <code>read:connections</code> scope and any one of <code>read:clients</code> or <code>read:client_summary</code>. + * </li> + * <li> + * <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> get( + String id, ConnectionsGetRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(id) + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (request.getStrategy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "strategy", request.getStrategy().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListClientConnectionsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientConnectionsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ConnectionsGetRequest nextRequest = ConnectionsGetRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getConnections(); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> get( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/RawCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/clients/RawCredentialsClient.java new file mode 100644 index 000000000..fdeb4b0ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/RawCredentialsClient.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients; + +import com.auth0.client.mgmt.clients.types.PatchClientCredentialRequestContent; +import com.auth0.client.mgmt.clients.types.PostClientCredentialRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ClientCredential; +import com.auth0.client.mgmt.types.GetClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PatchClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PostClientCredentialResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCredentialsClient { + protected final ClientOptions clientOptions; + + public RawCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public ManagementApiHttpResponse> list(String clientId) { + return list(clientId, null); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public ManagementApiHttpResponse> list(String clientId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public ManagementApiHttpResponse create( + String clientId, PostClientCredentialRequestContent request) { + return create(clientId, request, null); + } + + /** + * Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. + *

<h5>Public Key</h5>Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

+ *

Sample: <pre><code>{ + * "credential_type": "public_key", + * "name": "string", + * "pem": "string", + * "alg": "RS256", + * "parse_expiry_from_cert": false, + * "expires_at": "2022-12-31T23:59:59Z" + * }</code></pre>

+ *

<h5>Certificate (CA-signed & self-signed)</h5>Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

+ *

CA-signed Certificate Sample (pem): <pre><code>{ + * "credential_type": "x509_cert", + * "name": "string", + * "pem": "string" + * }</code></pre>CA-signed Certificate Sample (subject_dn): <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "subject_dn": "string" + * }</code></pre>Self-signed Certificate Sample: <pre><code>{ + * "credential_type": "cert_subject_dn", + * "name": "string", + * "pem": "string" + * }</code></pre>

+ *

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

+ *

<ul> + * <li>To enable the credential for Private Key JWT or mTLS authentication methods, set the <code>client_authentication_methods</code> property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-private-key-jwt">Configure Private Key JWT Authentication</a> and <a href="https://auth0.com/docs/get-started/applications/configure-mtls">Configure mTLS Authentication</a></li> + * <li>To enable the credential for JWT-secured Authorization requests, set the <code>signed_request_object</code>property on the client. For more information, read <a href="https://auth0.com/docs/get-started/applications/configure-jar">Configure JWT-secured Authorization Requests (JAR)</a></li> + * </ul>

+ */ + public ManagementApiHttpResponse create( + String clientId, PostClientCredentialRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PostClientCredentialResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public ManagementApiHttpResponse get(String clientId, String credentialId) { + return get(clientId, credentialId, null); + } + + /** + * Get the details of a client credential. + *

<b>Important</b>: To enable credentials to be used for a client authentication method, set the <code>client_authentication_methods</code> property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the <code>signed_request_object</code> property on the client.

+ */ + public ManagementApiHttpResponse get( + String clientId, String credentialId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetClientCredentialResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse delete(String clientId, String credentialId) { + return delete(clientId, credentialId, null); + } + + /** + * Delete a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse delete(String clientId, String credentialId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse update( + String clientId, String credentialId) { + return update( + clientId, + credentialId, + PatchClientCredentialRequestContent.builder().build()); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse update( + String clientId, String credentialId, PatchClientCredentialRequestContent request) { + return update(clientId, credentialId, request, null); + } + + /** + * Change a client credential you previously created. May be enabled or disabled. For more information, read <a href="https://www.auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow">Client Credential Flow</a>. + */ + public ManagementApiHttpResponse update( + String clientId, + String credentialId, + PatchClientCredentialRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("clients") + .addPathSegment(clientId) + .addPathSegments("credentials") + .addPathSegment(credentialId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PatchClientCredentialResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java new file mode 100644 index 000000000..59a09f896 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java @@ -0,0 +1,366 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.ConnectionStrategyEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionsGetRequest.Builder.class) +public final class ConnectionsGetRequest { + private final Optional> strategy; + + private final OptionalNullable from; + + private final OptionalNullable take; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private ConnectionsGetRequest( + Optional> strategy, + OptionalNullable from, + OptionalNullable take, + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.strategy = strategy; + this.from = from; + this.take = take; + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Provide strategies to only retrieve connections with such strategies + */ + @JsonIgnore + public Optional> getStrategy() { + if (strategy == null) { + return Optional.empty(); + } + return strategy; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return <code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>) + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("strategy") + private Optional> _getStrategy() { + return strategy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionsGetRequest && equalTo((ConnectionsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionsGetRequest other) { + return strategy.equals(other.strategy) + && from.equals(other.from) + && take.equals(other.take) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.strategy, this.from, this.take, this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> strategy = Optional.empty(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionsGetRequest other) { + strategy(other.getStrategy()); + from(other.getFrom()); + take(other.getTake()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Provide strategies to only retrieve connections with such strategies

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(@Nullable Optional> strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(List strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + public Builder strategy(com.auth0.client.mgmt.core.Nullable> strategy) { + if (strategy.isNull()) { + this.strategy = null; + } else if (strategy.isEmpty()) { + this.strategy = Optional.empty(); + } else { + this.strategy = Optional.of(strategy.get()); + } + return this; + } + + public Builder strategy(ConnectionStrategyEnum strategy) { + this.strategy = Optional.of(Collections.singletonList(strategy)); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

<code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>)

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public ConnectionsGetRequest build() { + return new ConnectionsGetRequest(strategy, from, take, fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java new file mode 100644 index 000000000..170fe0ac7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchClientCredentialRequestContent.Builder.class) +public final class PatchClientCredentialRequestContent { + private final OptionalNullable expiresAt; + + private final Map additionalProperties; + + private PatchClientCredentialRequestContent( + OptionalNullable expiresAt, Map additionalProperties) { + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("expires_at") + public OptionalNullable getExpiresAt() { + if (expiresAt == null) { + return OptionalNullable.absent(); + } + return expiresAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("expires_at") + private OptionalNullable _getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchClientCredentialRequestContent + && equalTo((PatchClientCredentialRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchClientCredentialRequestContent other) { + return expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable expiresAt = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchClientCredentialRequestContent other) { + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(@Nullable OptionalNullable expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = OptionalNullable.of(expiresAt); + return this; + } + + public Builder expiresAt(Optional expiresAt) { + if (expiresAt.isPresent()) { + this.expiresAt = OptionalNullable.of(expiresAt.get()); + } else { + this.expiresAt = OptionalNullable.absent(); + } + return this; + } + + public Builder expiresAt(com.auth0.client.mgmt.core.Nullable expiresAt) { + if (expiresAt.isNull()) { + this.expiresAt = OptionalNullable.ofNull(); + } else if (expiresAt.isEmpty()) { + this.expiresAt = OptionalNullable.absent(); + } else { + this.expiresAt = OptionalNullable.of(expiresAt.get()); + } + return this; + } + + public PatchClientCredentialRequestContent build() { + return new PatchClientCredentialRequestContent(expiresAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java new file mode 100644 index 000000000..42aea8adf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java @@ -0,0 +1,363 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.clients.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ClientCredentialTypeEnum; +import com.auth0.client.mgmt.types.PublicKeyCredentialAlgorithmEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PostClientCredentialRequestContent.Builder.class) +public final class PostClientCredentialRequestContent { + private final ClientCredentialTypeEnum credentialType; + + private final Optional name; + + private final Optional subjectDn; + + private final Optional pem; + + private final Optional alg; + + private final Optional parseExpiryFromCert; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private PostClientCredentialRequestContent( + ClientCredentialTypeEnum credentialType, + Optional name, + Optional subjectDn, + Optional pem, + Optional alg, + Optional parseExpiryFromCert, + Optional expiresAt, + Map additionalProperties) { + this.credentialType = credentialType; + this.name = name; + this.subjectDn = subjectDn; + this.pem = pem; + this.alg = alg; + this.parseExpiryFromCert = parseExpiryFromCert; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credential_type") + public ClientCredentialTypeEnum getCredentialType() { + return credentialType; + } + + /** + * @return Friendly name for a credential. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type. + */ + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + /** + * @return PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped. + */ + @JsonProperty("pem") + public Optional getPem() { + return pem; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + /** + * @return Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type. + */ + @JsonProperty("parse_expiry_from_cert") + public Optional getParseExpiryFromCert() { + return parseExpiryFromCert; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PostClientCredentialRequestContent + && equalTo((PostClientCredentialRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PostClientCredentialRequestContent other) { + return credentialType.equals(other.credentialType) + && name.equals(other.name) + && subjectDn.equals(other.subjectDn) + && pem.equals(other.pem) + && alg.equals(other.alg) + && parseExpiryFromCert.equals(other.parseExpiryFromCert) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.credentialType, + this.name, + this.subjectDn, + this.pem, + this.alg, + this.parseExpiryFromCert, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CredentialTypeStage builder() { + return new Builder(); + } + + public interface CredentialTypeStage { + _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialType); + + Builder from(PostClientCredentialRequestContent other); + } + + public interface _FinalStage { + PostClientCredentialRequestContent build(); + + /** + *

Friendly name for a credential.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

+ */ + _FinalStage subjectDn(Optional subjectDn); + + _FinalStage subjectDn(String subjectDn); + + /** + *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ */ + _FinalStage pem(Optional pem); + + _FinalStage pem(String pem); + + _FinalStage alg(Optional alg); + + _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg); + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ */ + _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert); + + _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert); + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ */ + _FinalStage expiresAt(Optional expiresAt); + + _FinalStage expiresAt(OffsetDateTime expiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CredentialTypeStage, _FinalStage { + private ClientCredentialTypeEnum credentialType; + + private Optional expiresAt = Optional.empty(); + + private Optional parseExpiryFromCert = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional pem = Optional.empty(); + + private Optional subjectDn = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PostClientCredentialRequestContent other) { + credentialType(other.getCredentialType()); + name(other.getName()); + subjectDn(other.getSubjectDn()); + pem(other.getPem()); + alg(other.getAlg()); + parseExpiryFromCert(other.getParseExpiryFromCert()); + expiresAt(other.getExpiresAt()); + return this; + } + + @java.lang.Override + @JsonSetter("credential_type") + public _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialType) { + this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ */ + @java.lang.Override + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public _FinalStage expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { + this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); + return this; + } + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ */ + @java.lang.Override + @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) + public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { + this.parseExpiryFromCert = parseExpiryFromCert; + return this; + } + + @java.lang.Override + public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public _FinalStage alg(Optional alg) { + this.alg = alg; + return this; + } + + /** + *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage pem(String pem) { + this.pem = Optional.ofNullable(pem); + return this; + } + + /** + *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ */ + @java.lang.Override + @JsonSetter(value = "pem", nulls = Nulls.SKIP) + public _FinalStage pem(Optional pem) { + this.pem = pem; + return this; + } + + /** + *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + /** + *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

+ */ + @java.lang.Override + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public _FinalStage subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + /** + *

Friendly name for a credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name for a credential.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public PostClientCredentialRequestContent build() { + return new PostClientCredentialRequestContent( + credentialType, name, subjectDn, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java new file mode 100644 index 000000000..acef15c08 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionEnabledClient; +import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncClientsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawClientsClient rawClient; + + public AsyncClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawClientsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawClientsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture> get( + String id, GetConnectionEnabledClientsRequestParameters request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture> get( + String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id, List request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, List request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncKeysClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncKeysClient.java new file mode 100644 index 000000000..6bfc0677d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncKeysClient.java @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ConnectionKey; +import com.auth0.client.mgmt.types.RotateConnectionKeysRequestContent; +import com.auth0.client.mgmt.types.RotateConnectionsKeysResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncKeysClient { + protected final ClientOptions clientOptions; + + private final AsyncRawKeysClient rawClient; + + public AsyncKeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawKeysClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawKeysClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture rotate(String id) { + return this.rawClient.rotate(id).thenApply(response -> response.body()); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture rotate( + String id, OptionalNullable request) { + return this.rawClient.rotate(id, request).thenApply(response -> response.body()); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture rotate( + String id, OptionalNullable request, RequestOptions requestOptions) { + return this.rawClient.rotate(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java new file mode 100644 index 000000000..fd45f1733 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionEnabledClient; +import com.auth0.client.mgmt.types.GetConnectionEnabledClientsResponseContent; +import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawClientsClient { + protected final ClientOptions clientOptions; + + public AsyncRawClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture>> get(String id) { + return get(id, GetConnectionEnabledClientsRequestParameters.builder().build()); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture>> get( + String id, GetConnectionEnabledClientsRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public CompletableFuture>> get( + String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("clients"); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + GetConnectionEnabledClientsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionEnabledClientsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + GetConnectionEnabledClientsRequestParameters nextRequest = + GetConnectionEnabledClientsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getClients(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return get(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update( + String id, List request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("clients") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawKeysClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawKeysClient.java new file mode 100644 index 000000000..6e6eab192 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawKeysClient.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionKey; +import com.auth0.client.mgmt.types.RotateConnectionKeysRequestContent; +import com.auth0.client.mgmt.types.RotateConnectionsKeysResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawKeysClient { + protected final ClientOptions clientOptions; + + public AsyncRawKeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public CompletableFuture>> get(String id) { + return get(id, null); + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public CompletableFuture>> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("keys") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture> rotate(String id) { + return rotate(id, OptionalNullable.absent()); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture> rotate( + String id, OptionalNullable request) { + return rotate(id, request, null); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public CompletableFuture> rotate( + String id, OptionalNullable request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("keys") + .addPathSegments("rotate") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RotateConnectionsKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawScimConfigurationClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawScimConfigurationClient.java new file mode 100644 index 000000000..b87582b13 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawScimConfigurationClient.java @@ -0,0 +1,442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.UpdateScimConfigurationRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.types.CreateScimConfigurationRequestContent; +import com.auth0.client.mgmt.types.CreateScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.UpdateScimConfigurationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScimConfigurationClient { + protected final ClientOptions clientOptions; + + public AsyncRawScimConfigurationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetScimConfigurationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture> create(String id) { + return create(id, OptionalNullable.absent()); + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture> create( + String id, OptionalNullable request) { + return create(id, request, null); + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture> create( + String id, OptionalNullable request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateScimConfigurationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> update( + String id, UpdateScimConfigurationRequestContent request) { + return update(id, request, null); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture> update( + String id, UpdateScimConfigurationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateScimConfigurationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public CompletableFuture> + getDefaultMapping(String id) { + return getDefaultMapping(id, null); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public CompletableFuture> + getDefaultMapping(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("default-mapping") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetScimConfigurationDefaultMappingResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawUsersClient.java new file mode 100644 index 000000000..8c1f46ff5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawUsersClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.DeleteConnectionUsersByEmailQueryParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public CompletableFuture> deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request) { + return deleteByEmail(id, request, null); + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public CompletableFuture> deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncScimConfigurationClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncScimConfigurationClient.java new file mode 100644 index 000000000..25033a5d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncScimConfigurationClient.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.scimconfiguration.AsyncTokensClient; +import com.auth0.client.mgmt.connections.types.UpdateScimConfigurationRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.CreateScimConfigurationRequestContent; +import com.auth0.client.mgmt.types.CreateScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.UpdateScimConfigurationResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncScimConfigurationClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScimConfigurationClient rawClient; + + protected final Supplier tokensClient; + + public AsyncScimConfigurationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScimConfigurationClient(clientOptions); + this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScimConfigurationClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture create( + String id, OptionalNullable request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Create a scim configuration for a connection. + */ + public CompletableFuture create( + String id, OptionalNullable request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture update( + String id, UpdateScimConfigurationRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public CompletableFuture update( + String id, UpdateScimConfigurationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public CompletableFuture getDefaultMapping(String id) { + return this.rawClient.getDefaultMapping(id).thenApply(response -> response.body()); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public CompletableFuture getDefaultMapping( + String id, RequestOptions requestOptions) { + return this.rawClient.getDefaultMapping(id, requestOptions).thenApply(response -> response.body()); + } + + public AsyncTokensClient tokens() { + return this.tokensClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncUsersClient.java new file mode 100644 index 000000000..753552b4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncUsersClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.DeleteConnectionUsersByEmailQueryParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public CompletableFuture deleteByEmail(String id, DeleteConnectionUsersByEmailQueryParameters request) { + return this.rawClient.deleteByEmail(id, request).thenApply(response -> response.body()); + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public CompletableFuture deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request, RequestOptions requestOptions) { + return this.rawClient.deleteByEmail(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java new file mode 100644 index 000000000..3cde8a29f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionEnabledClient; +import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; +import java.util.List; + +public class ClientsClient { + protected final ClientOptions clientOptions; + + private final RawClientsClient rawClient; + + public ClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawClientsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawClientsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public SyncPagingIterable get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public SyncPagingIterable get( + String id, GetConnectionEnabledClientsRequestParameters request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public SyncPagingIterable get( + String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + public void update(String id, List request) { + this.rawClient.update(id, request).body(); + } + + public void update( + String id, List request, RequestOptions requestOptions) { + this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/KeysClient.java b/src/main/java/com/auth0/client/mgmt/connections/KeysClient.java new file mode 100644 index 000000000..248b5a68c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/KeysClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.ConnectionKey; +import com.auth0.client.mgmt.types.RotateConnectionKeysRequestContent; +import com.auth0.client.mgmt.types.RotateConnectionsKeysResponseContent; +import java.util.List; + +public class KeysClient { + protected final ClientOptions clientOptions; + + private final RawKeysClient rawClient; + + public KeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawKeysClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawKeysClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public List get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public List get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public RotateConnectionsKeysResponseContent rotate(String id) { + return this.rawClient.rotate(id).body(); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public RotateConnectionsKeysResponseContent rotate( + String id, OptionalNullable request) { + return this.rawClient.rotate(id, request).body(); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public RotateConnectionsKeysResponseContent rotate( + String id, OptionalNullable request, RequestOptions requestOptions) { + return this.rawClient.rotate(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java new file mode 100644 index 000000000..d47362dc2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java @@ -0,0 +1,197 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionEnabledClient; +import com.auth0.client.mgmt.types.GetConnectionEnabledClientsResponseContent; +import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawClientsClient { + protected final ClientOptions clientOptions; + + public RawClientsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public ManagementApiHttpResponse> get(String id) { + return get(id, GetConnectionEnabledClientsRequestParameters.builder().build()); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public ManagementApiHttpResponse> get( + String id, GetConnectionEnabledClientsRequestParameters request) { + return get(id, request, null); + } + + /** + * Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled. + *

<b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.

+ */ + public ManagementApiHttpResponse> get( + String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("clients"); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + GetConnectionEnabledClientsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionEnabledClientsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + GetConnectionEnabledClientsRequestParameters nextRequest = + GetConnectionEnabledClientsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getClients(); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> get( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update( + String id, List request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("clients") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawKeysClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawKeysClient.java new file mode 100644 index 000000000..379455dad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/RawKeysClient.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionKey; +import com.auth0.client.mgmt.types.RotateConnectionKeysRequestContent; +import com.auth0.client.mgmt.types.RotateConnectionsKeysResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawKeysClient { + protected final ClientOptions clientOptions; + + public RawKeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public ManagementApiHttpResponse> get(String id) { + return get(id, null); + } + + /** + * Gets the connection keys for the Okta or OIDC connection strategy. + */ + public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("keys") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public ManagementApiHttpResponse rotate(String id) { + return rotate(id, OptionalNullable.absent()); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public ManagementApiHttpResponse rotate( + String id, OptionalNullable request) { + return rotate(id, request, null); + } + + /** + * Rotates the connection keys for the Okta or OIDC connection strategies. + */ + public ManagementApiHttpResponse rotate( + String id, OptionalNullable request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("keys") + .addPathSegments("rotate") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RotateConnectionsKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawScimConfigurationClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawScimConfigurationClient.java new file mode 100644 index 000000000..bc2d8ecc6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/RawScimConfigurationClient.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.UpdateScimConfigurationRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.types.CreateScimConfigurationRequestContent; +import com.auth0.client.mgmt.types.CreateScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.UpdateScimConfigurationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScimConfigurationClient { + protected final ClientOptions clientOptions; + + public RawScimConfigurationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetScimConfigurationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a scim configuration for a connection. + */ + public ManagementApiHttpResponse create(String id) { + return create(id, OptionalNullable.absent()); + } + + /** + * Create a scim configuration for a connection. + */ + public ManagementApiHttpResponse create( + String id, OptionalNullable request) { + return create(id, request, null); + } + + /** + * Create a scim configuration for a connection. + */ + public ManagementApiHttpResponse create( + String id, OptionalNullable request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateScimConfigurationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse update( + String id, UpdateScimConfigurationRequestContent request) { + return update(id, request, null); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse update( + String id, UpdateScimConfigurationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateScimConfigurationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse getDefaultMapping(String id) { + return getDefaultMapping(id, null); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public ManagementApiHttpResponse getDefaultMapping( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("default-mapping") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetScimConfigurationDefaultMappingResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawUsersClient.java new file mode 100644 index 000000000..40d1bba27 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/RawUsersClient.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.DeleteConnectionUsersByEmailQueryParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public ManagementApiHttpResponse deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request) { + return deleteByEmail(id, request, null); + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public ManagementApiHttpResponse deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/ScimConfigurationClient.java b/src/main/java/com/auth0/client/mgmt/connections/ScimConfigurationClient.java new file mode 100644 index 000000000..f4b9bd602 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/ScimConfigurationClient.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.scimconfiguration.TokensClient; +import com.auth0.client.mgmt.connections.types.UpdateScimConfigurationRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.CreateScimConfigurationRequestContent; +import com.auth0.client.mgmt.types.CreateScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.UpdateScimConfigurationResponseContent; +import java.util.function.Supplier; + +public class ScimConfigurationClient { + protected final ClientOptions clientOptions; + + private final RawScimConfigurationClient rawClient; + + protected final Supplier tokensClient; + + public ScimConfigurationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScimConfigurationClient(clientOptions); + this.tokensClient = Suppliers.memoize(() -> new TokensClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScimConfigurationClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public GetScimConfigurationResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieves a scim configuration by its <code>connectionId</code>. + */ + public GetScimConfigurationResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Create a scim configuration for a connection. + */ + public CreateScimConfigurationResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + /** + * Create a scim configuration for a connection. + */ + public CreateScimConfigurationResponseContent create( + String id, OptionalNullable request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Create a scim configuration for a connection. + */ + public CreateScimConfigurationResponseContent create( + String id, OptionalNullable request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Deletes a scim configuration by its <code>connectionId</code>. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public UpdateScimConfigurationResponseContent update(String id, UpdateScimConfigurationRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a scim configuration by its <code>connectionId</code>. + */ + public UpdateScimConfigurationResponseContent update( + String id, UpdateScimConfigurationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public GetScimConfigurationDefaultMappingResponseContent getDefaultMapping(String id) { + return this.rawClient.getDefaultMapping(id).body(); + } + + /** + * Retrieves a scim configuration's default mapping by its <code>connectionId</code>. + */ + public GetScimConfigurationDefaultMappingResponseContent getDefaultMapping( + String id, RequestOptions requestOptions) { + return this.rawClient.getDefaultMapping(id, requestOptions).body(); + } + + public TokensClient tokens() { + return this.tokensClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/UsersClient.java b/src/main/java/com/auth0/client/mgmt/connections/UsersClient.java new file mode 100644 index 000000000..e644ca0dd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/UsersClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.types.DeleteConnectionUsersByEmailQueryParameters; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public void deleteByEmail(String id, DeleteConnectionUsersByEmailQueryParameters request) { + this.rawClient.deleteByEmail(id, request).body(); + } + + /** + * Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. + */ + public void deleteByEmail( + String id, DeleteConnectionUsersByEmailQueryParameters request, RequestOptions requestOptions) { + this.rawClient.deleteByEmail(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncRawTokensClient.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncRawTokensClient.java new file mode 100644 index 000000000..7a5153496 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncRawTokensClient.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.scimconfiguration; + +import com.auth0.client.mgmt.connections.scimconfiguration.types.CreateScimTokenRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.types.CreateScimTokenResponseContent; +import com.auth0.client.mgmt.types.ScimTokenItem; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTokensClient { + protected final ClientOptions clientOptions; + + public AsyncRawTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public CompletableFuture>> get(String id) { + return get(id, null); + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public CompletableFuture>> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("tokens") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture> create(String id) { + return create(id, CreateScimTokenRequestContent.builder().build()); + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture> create( + String id, CreateScimTokenRequestContent request) { + return create(id, request, null); + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture> create( + String id, CreateScimTokenRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("tokens") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateScimTokenResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public CompletableFuture> delete(String id, String tokenId) { + return delete(id, tokenId, null); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public CompletableFuture> delete( + String id, String tokenId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration/tokens") + .addPathSegment(tokenId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncTokensClient.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncTokensClient.java new file mode 100644 index 000000000..5f3857162 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/AsyncTokensClient.java @@ -0,0 +1,80 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.scimconfiguration; + +import com.auth0.client.mgmt.connections.scimconfiguration.types.CreateScimTokenRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateScimTokenResponseContent; +import com.auth0.client.mgmt.types.ScimTokenItem; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncTokensClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTokensClient rawClient; + + public AsyncTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTokensClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTokensClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture create(String id, CreateScimTokenRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Create a scim token for a scim client. + */ + public CompletableFuture create( + String id, CreateScimTokenRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public CompletableFuture delete(String id, String tokenId) { + return this.rawClient.delete(id, tokenId).thenApply(response -> response.body()); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public CompletableFuture delete(String id, String tokenId, RequestOptions requestOptions) { + return this.rawClient.delete(id, tokenId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/RawTokensClient.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/RawTokensClient.java new file mode 100644 index 000000000..3d7541e32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/RawTokensClient.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.scimconfiguration; + +import com.auth0.client.mgmt.connections.scimconfiguration.types.CreateScimTokenRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.types.CreateScimTokenResponseContent; +import com.auth0.client.mgmt.types.ScimTokenItem; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTokensClient { + protected final ClientOptions clientOptions; + + public RawTokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public ManagementApiHttpResponse> get(String id) { + return get(id, null); + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("tokens") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a scim token for a scim client. + */ + public ManagementApiHttpResponse create(String id) { + return create(id, CreateScimTokenRequestContent.builder().build()); + } + + /** + * Create a scim token for a scim client. + */ + public ManagementApiHttpResponse create( + String id, CreateScimTokenRequestContent request) { + return create(id, request, null); + } + + /** + * Create a scim token for a scim client. + */ + public ManagementApiHttpResponse create( + String id, CreateScimTokenRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration") + .addPathSegments("tokens") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateScimTokenResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public ManagementApiHttpResponse delete(String id, String tokenId) { + return delete(id, tokenId, null); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public ManagementApiHttpResponse delete(String id, String tokenId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("scim-configuration/tokens") + .addPathSegment(tokenId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/TokensClient.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/TokensClient.java new file mode 100644 index 000000000..8db9256aa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/TokensClient.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.scimconfiguration; + +import com.auth0.client.mgmt.connections.scimconfiguration.types.CreateScimTokenRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateScimTokenResponseContent; +import com.auth0.client.mgmt.types.ScimTokenItem; +import java.util.List; + +public class TokensClient { + protected final ClientOptions clientOptions; + + private final RawTokensClient rawClient; + + public TokensClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTokensClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTokensClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public List get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieves all scim tokens by its connection <code>id</code>. + */ + public List get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Create a scim token for a scim client. + */ + public CreateScimTokenResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + /** + * Create a scim token for a scim client. + */ + public CreateScimTokenResponseContent create(String id, CreateScimTokenRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Create a scim token for a scim client. + */ + public CreateScimTokenResponseContent create( + String id, CreateScimTokenRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public void delete(String id, String tokenId) { + this.rawClient.delete(id, tokenId).body(); + } + + /** + * Deletes a scim token by its connection <code>id</code> and <code>tokenId</code>. + */ + public void delete(String id, String tokenId, RequestOptions requestOptions) { + this.rawClient.delete(id, tokenId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java new file mode 100644 index 000000000..dadd47f4f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.scimconfiguration.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateScimTokenRequestContent.Builder.class) +public final class CreateScimTokenRequestContent { + private final Optional> scopes; + + private final OptionalNullable tokenLifetime; + + private final Map additionalProperties; + + private CreateScimTokenRequestContent( + Optional> scopes, + OptionalNullable tokenLifetime, + Map additionalProperties) { + this.scopes = scopes; + this.tokenLifetime = tokenLifetime; + this.additionalProperties = additionalProperties; + } + + /** + * @return The scopes of the scim token + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + /** + * @return Lifetime of the token in seconds. Must be greater than 900 + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime") + public OptionalNullable getTokenLifetime() { + if (tokenLifetime == null) { + return OptionalNullable.absent(); + } + return tokenLifetime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime") + private OptionalNullable _getTokenLifetime() { + return tokenLifetime; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateScimTokenRequestContent && equalTo((CreateScimTokenRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateScimTokenRequestContent other) { + return scopes.equals(other.scopes) && tokenLifetime.equals(other.tokenLifetime); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.scopes, this.tokenLifetime); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> scopes = Optional.empty(); + + private OptionalNullable tokenLifetime = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateScimTokenRequestContent other) { + scopes(other.getScopes()); + tokenLifetime(other.getTokenLifetime()); + return this; + } + + /** + *

The scopes of the scim token

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + *

Lifetime of the token in seconds. Must be greater than 900

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(@Nullable OptionalNullable tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = OptionalNullable.of(tokenLifetime); + return this; + } + + public Builder tokenLifetime(Optional tokenLifetime) { + if (tokenLifetime.isPresent()) { + this.tokenLifetime = OptionalNullable.of(tokenLifetime.get()); + } else { + this.tokenLifetime = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenLifetime(com.auth0.client.mgmt.core.Nullable tokenLifetime) { + if (tokenLifetime.isNull()) { + this.tokenLifetime = OptionalNullable.ofNull(); + } else if (tokenLifetime.isEmpty()) { + this.tokenLifetime = OptionalNullable.absent(); + } else { + this.tokenLifetime = OptionalNullable.of(tokenLifetime.get()); + } + return this; + } + + public CreateScimTokenRequestContent build() { + return new CreateScimTokenRequestContent(scopes, tokenLifetime, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java new file mode 100644 index 000000000..b211900f5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteConnectionUsersByEmailQueryParameters.Builder.class) +public final class DeleteConnectionUsersByEmailQueryParameters { + private final String email; + + private final Map additionalProperties; + + private DeleteConnectionUsersByEmailQueryParameters(String email, Map additionalProperties) { + this.email = email; + this.additionalProperties = additionalProperties; + } + + /** + * @return The email of the user to delete + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteConnectionUsersByEmailQueryParameters + && equalTo((DeleteConnectionUsersByEmailQueryParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteConnectionUsersByEmailQueryParameters other) { + return email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + /** + *

The email of the user to delete

+ */ + _FinalStage email(@NotNull String email); + + Builder from(DeleteConnectionUsersByEmailQueryParameters other); + } + + public interface _FinalStage { + DeleteConnectionUsersByEmailQueryParameters build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeleteConnectionUsersByEmailQueryParameters other) { + email(other.getEmail()); + return this; + } + + /** + *

The email of the user to delete

+ *

The email of the user to delete

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public DeleteConnectionUsersByEmailQueryParameters build() { + return new DeleteConnectionUsersByEmailQueryParameters(email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java new file mode 100644 index 000000000..5a8350257 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionEnabledClientsRequestParameters.Builder.class) +public final class GetConnectionEnabledClientsRequestParameters { + private final OptionalNullable take; + + private final OptionalNullable from; + + private final Map additionalProperties; + + private GetConnectionEnabledClientsRequestParameters( + OptionalNullable take, OptionalNullable from, Map additionalProperties) { + this.take = take; + this.from = from; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionEnabledClientsRequestParameters + && equalTo((GetConnectionEnabledClientsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionEnabledClientsRequestParameters other) { + return take.equals(other.take) && from.equals(other.from); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.take, this.from); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionEnabledClientsRequestParameters other) { + take(other.getTake()); + from(other.getFrom()); + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@org.jetbrains.annotations.Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + public GetConnectionEnabledClientsRequestParameters build() { + return new GetConnectionEnabledClientsRequestParameters(take, from, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java new file mode 100644 index 000000000..cea97bfcb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ScimMappingItem; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateScimConfigurationRequestContent.Builder.class) +public final class UpdateScimConfigurationRequestContent { + private final String userIdAttribute; + + private final List mapping; + + private final Map additionalProperties; + + private UpdateScimConfigurationRequestContent( + String userIdAttribute, List mapping, Map additionalProperties) { + this.userIdAttribute = userIdAttribute; + this.mapping = mapping; + this.additionalProperties = additionalProperties; + } + + /** + * @return User ID attribute for generating unique user ids + */ + @JsonProperty("user_id_attribute") + public String getUserIdAttribute() { + return userIdAttribute; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public List getMapping() { + return mapping; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateScimConfigurationRequestContent + && equalTo((UpdateScimConfigurationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateScimConfigurationRequestContent other) { + return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdAttribute, this.mapping); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdAttributeStage builder() { + return new Builder(); + } + + public interface UserIdAttributeStage { + /** + *

User ID attribute for generating unique user ids

+ */ + _FinalStage userIdAttribute(@NotNull String userIdAttribute); + + Builder from(UpdateScimConfigurationRequestContent other); + } + + public interface _FinalStage { + UpdateScimConfigurationRequestContent build(); + + /** + *

The mapping between auth0 and SCIM

+ */ + _FinalStage mapping(List mapping); + + _FinalStage addMapping(ScimMappingItem mapping); + + _FinalStage addAllMapping(List mapping); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdAttributeStage, _FinalStage { + private String userIdAttribute; + + private List mapping = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateScimConfigurationRequestContent other) { + userIdAttribute(other.getUserIdAttribute()); + mapping(other.getMapping()); + return this; + } + + /** + *

User ID attribute for generating unique user ids

+ *

User ID attribute for generating unique user ids

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id_attribute") + public _FinalStage userIdAttribute(@NotNull String userIdAttribute) { + this.userIdAttribute = Objects.requireNonNull(userIdAttribute, "userIdAttribute must not be null"); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllMapping(List mapping) { + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addMapping(ScimMappingItem mapping) { + this.mapping.add(mapping); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @java.lang.Override + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public _FinalStage mapping(List mapping) { + this.mapping.clear(); + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + @java.lang.Override + public UpdateScimConfigurationRequestContent build() { + return new UpdateScimConfigurationRequestContent(userIdAttribute, mapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java b/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java new file mode 100644 index 000000000..f6c78663e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +/** + * Skeleton implementation for custom asynchronous bidirectional pagination. + * + * THIS CLASS MUST BE IMPLEMENTED BY THE USER. + * + * This file is added to .fernignore and will not be regenerated. + * Replace this skeleton implementation with your custom async pagination logic + * that handles your API's specific pagination structure (e.g., HATEOAS links). + * + * Example implementation for HATEOAS-style async pagination: + *
{@code
+ * public class AsyncCustomPager implements BiDirectionalPage {
+ *     private final List items;
+ *     private final String nextUrl;
+ *     private final String previousUrl;
+ *     private final AsyncHttpClient client;
+ *
+ *     public AsyncCustomPager(Response response, AsyncHttpClient client, ...) {
+ *         this.items = response.getData();
+ *         this.nextUrl = response.getLinks().getNext();
+ *         this.previousUrl = response.getLinks().getPrevious();
+ *         // ... store other needed context
+ *     }
+ *
+ *     @Override
+ *     public boolean hasNext() {
+ *         return nextUrl != null;
+ *     }
+ *
+ *     @Override
+ *     public CompletableFuture> nextPageAsync() {
+ *         if (!hasNext()) {
+ *             CompletableFuture> future = new CompletableFuture<>();
+ *             future.completeExceptionally(new NoSuchElementException("No next page available"));
+ *             return future;
+ *         }
+ *         // Make async HTTP request to nextUrl
+ *         return client.getAsync(nextUrl)
+ *             .thenApply(response -> new AsyncCustomPager<>(response, client, ...));
+ *     }
+ *
+ *     // ... implement other methods
+ * }
+ * }
+ * + * @param The type of items in the page + */ +public class AsyncCustomPager implements BiDirectionalPage { + + /** + * Create an AsyncCustomPager from an initial response. + * + * @param initialResponse The first page response from the API + * @param client The async HTTP client to use for subsequent requests + * @param requestOptions Request options for authentication, headers, etc. + * @return A CompletableFuture containing the new AsyncCustomPager instance + */ + public static CompletableFuture> createAsync( + Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) { + throw new UnsupportedOperationException("AsyncCustomPager must be implemented. " + + "Please implement this class in core/AsyncCustomPager.java to define your async pagination logic. " + + "This file has been added to .fernignore and will not be overwritten. " + + "See the class documentation for implementation examples."); + } + + @Override + public boolean hasNext() { + throw new UnsupportedOperationException("AsyncCustomPager.hasNext() must be implemented. " + + "This method should return true if a next page is available."); + } + + @Override + public boolean hasPrevious() { + throw new UnsupportedOperationException("AsyncCustomPager.hasPrevious() must be implemented. " + + "This method should return true if a previous page is available."); + } + + /** + * Asynchronously fetch the next page. + * + * @return A CompletableFuture that completes with the next page + * @throws java.util.NoSuchElementException if no next page exists (wrapped in CompletableFuture) + */ + public CompletableFuture> nextPageAsync() { + CompletableFuture> future = new CompletableFuture<>(); + future.completeExceptionally( + new UnsupportedOperationException("AsyncCustomPager.nextPageAsync() must be implemented. " + + "This method should asynchronously fetch and return the next page of results.")); + return future; + } + + /** + * Asynchronously fetch the previous page. + * + * @return A CompletableFuture that completes with the previous page + * @throws java.util.NoSuchElementException if no previous page exists (wrapped in CompletableFuture) + */ + public CompletableFuture> previousPageAsync() { + CompletableFuture> future = new CompletableFuture<>(); + future.completeExceptionally( + new UnsupportedOperationException("AsyncCustomPager.previousPageAsync() must be implemented. " + + "This method should asynchronously fetch and return the previous page of results.")); + return future; + } + + @Override + public BiDirectionalPage nextPage() throws IOException { + throw new UnsupportedOperationException("AsyncCustomPager.nextPage() must be implemented. " + + "Consider using nextPageAsync() for async operations, or implement synchronous blocking version."); + } + + @Override + public BiDirectionalPage previousPage() throws IOException { + throw new UnsupportedOperationException( + "AsyncCustomPager.previousPage() must be implemented. " + + "Consider using previousPageAsync() for async operations, or implement synchronous blocking version."); + } + + @Override + public List getItems() { + throw new UnsupportedOperationException("AsyncCustomPager.getItems() must be implemented. " + + "This method should return the items in the current page."); + } + + @Override + public Optional getResponse() { + throw new UnsupportedOperationException("AsyncCustomPager.getResponse() must be implemented. " + + "This method should return the full response object for accessing pagination metadata."); + } + + /** + * Asynchronously iterate through all pages starting from current. + * Returns a CompletableFuture that completes with all items from all pages. + * + * @return CompletableFuture containing all items across all pages + */ + public CompletableFuture> getAllItemsAsync() { + throw new UnsupportedOperationException("AsyncCustomPager.getAllItemsAsync() must be implemented. " + + "This method should asynchronously fetch all pages and return all items."); + } + + /** + * Process each page asynchronously as it arrives. + * + * @param pageProcessor Function to process each page + * @return CompletableFuture that completes when all pages are processed + */ + public CompletableFuture forEachPageAsync( + java.util.function.Function, CompletionStage> pageProcessor) { + throw new UnsupportedOperationException("AsyncCustomPager.forEachPageAsync() must be implemented. " + + "This method should asynchronously process each page with the given function."); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/BasePage.java b/src/main/java/com/auth0/client/mgmt/core/BasePage.java new file mode 100644 index 000000000..c212dbc7c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/BasePage.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.List; +import java.util.Optional; + +public abstract class BasePage { + private final boolean hasNext; + private final List items; + private final Object response; + + public BasePage(boolean hasNext, List items, Object response) { + this.hasNext = hasNext; + this.items = items; + this.response = response; + } + + public boolean hasNext() { + return !items.isEmpty() && hasNext; + } + + public List getItems() { + return items; + } + + /** + * Returns the full response object for accessing pagination metadata like cursor tokens. + * + * @return Optional containing the response, or empty if unavailable + */ + public Optional getResponse() { + @SuppressWarnings("unchecked") + R typedResponse = (R) response; + return Optional.ofNullable(typedResponse); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/BiDirectionalPage.java b/src/main/java/com/auth0/client/mgmt/core/BiDirectionalPage.java new file mode 100644 index 000000000..8f61f3a42 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/BiDirectionalPage.java @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.List; + +/** + * Interface for pages that support bidirectional pagination (both forward and backward navigation). + * This is used for custom pagination scenarios where the API provides both next and previous page links. + * + * @param The type of items in the page + */ +public interface BiDirectionalPage { + /** + * Returns whether there is a next page available. + * + * @return true if next page exists and can be fetched + */ + boolean hasNext(); + + /** + * Returns whether there is a previous page available. + * + * @return true if previous page exists and can be fetched + */ + boolean hasPrevious(); + + /** + * Fetches and returns the next page. + * + * @return the next page + * @throws java.util.NoSuchElementException if no next page exists + * @throws java.io.IOException if the HTTP request fails + */ + BiDirectionalPage nextPage() throws java.io.IOException; + + /** + * Fetches and returns the previous page. + * + * @return the previous page + * @throws java.util.NoSuchElementException if no previous page exists + * @throws java.io.IOException if the HTTP request fails + */ + BiDirectionalPage previousPage() throws java.io.IOException; + + /** + * Returns the items in the current page. + * + * @return list of items in this page + */ + List getItems(); + + /** + * Returns the full response object for accessing pagination metadata. + * + * @return Optional containing the response, or empty if unavailable + */ + java.util.Optional getResponse(); +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ClientOptions.java b/src/main/java/com/auth0/client/mgmt/core/ClientOptions.java new file mode 100644 index 000000000..e1f7e84b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ClientOptions.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import okhttp3.OkHttpClient; + +public final class ClientOptions { + private final Environment environment; + + private final Map headers; + + private final Map> headerSuppliers; + + private final OkHttpClient httpClient; + + private final int timeout; + + private final int maxRetries; + + private ClientOptions( + Environment environment, + Map headers, + Map> headerSuppliers, + OkHttpClient httpClient, + int timeout, + int maxRetries) { + this.environment = environment; + this.headers = new HashMap<>(); + this.headers.putAll(headers); + this.headers.putAll(new HashMap() { + { + put("X-Fern-Language", "JAVA"); + put("X-Fern-SDK-Name", "com.auth0.fern:api-sdk"); + put("X-Fern-SDK-Version", "0.0.938"); + } + }); + this.headerSuppliers = headerSuppliers; + this.httpClient = httpClient; + this.timeout = timeout; + this.maxRetries = maxRetries; + } + + public Environment environment() { + return this.environment; + } + + public Map headers(RequestOptions requestOptions) { + Map values = new HashMap<>(this.headers); + headerSuppliers.forEach((key, supplier) -> { + values.put(key, supplier.get()); + }); + if (requestOptions != null) { + values.putAll(requestOptions.getHeaders()); + } + return values; + } + + public int timeout(RequestOptions requestOptions) { + if (requestOptions == null) { + return this.timeout; + } + return requestOptions.getTimeout().orElse(this.timeout); + } + + public OkHttpClient httpClient() { + return this.httpClient; + } + + public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { + if (requestOptions == null) { + return this.httpClient; + } + return this.httpClient + .newBuilder() + .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + } + + public int maxRetries() { + return this.maxRetries; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Environment environment; + + private final Map headers = new HashMap<>(); + + private final Map> headerSuppliers = new HashMap<>(); + + private int maxRetries = 2; + + private Optional timeout = Optional.empty(); + + private OkHttpClient httpClient = null; + + public Builder environment(Environment environment) { + this.environment = environment; + return this; + } + + public Builder addHeader(String key, String value) { + this.headers.put(key, value); + return this; + } + + public Builder addHeader(String key, Supplier value) { + this.headerSuppliers.put(key, value); + return this; + } + + /** + * Override the timeout in seconds. Defaults to 60 seconds. + */ + public Builder timeout(int timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + /** + * Override the timeout in seconds. Defaults to 60 seconds. + */ + public Builder timeout(Optional timeout) { + this.timeout = timeout; + return this; + } + + /** + * Override the maximum number of retries. Defaults to 2 retries. + */ + public Builder maxRetries(int maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + public Builder httpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + public ClientOptions build() { + OkHttpClient.Builder httpClientBuilder = + this.httpClient != null ? this.httpClient.newBuilder() : new OkHttpClient.Builder(); + + if (this.httpClient != null) { + timeout.ifPresent(timeout -> httpClientBuilder + .callTimeout(timeout, TimeUnit.SECONDS) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS)); + } else { + httpClientBuilder + .callTimeout(this.timeout.orElse(60), TimeUnit.SECONDS) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS) + .addInterceptor(new RetryInterceptor(this.maxRetries)); + } + + this.httpClient = httpClientBuilder.build(); + this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000); + + return new ClientOptions( + environment, headers, headerSuppliers, httpClient, this.timeout.get(), this.maxRetries); + } + + /** + * Create a new Builder initialized with values from an existing ClientOptions + */ + public static Builder from(ClientOptions clientOptions) { + Builder builder = new Builder(); + builder.environment = clientOptions.environment(); + builder.timeout = Optional.of(clientOptions.timeout(null)); + builder.httpClient = clientOptions.httpClient(); + return builder; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/CustomPager.java b/src/main/java/com/auth0/client/mgmt/core/CustomPager.java new file mode 100644 index 000000000..ce2dc205c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/CustomPager.java @@ -0,0 +1,117 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; + +/** + * Skeleton implementation for custom bidirectional pagination. + * + * THIS CLASS MUST BE IMPLEMENTED BY THE USER. + * + * This file is added to .fernignore and will not be regenerated. + * Replace this skeleton implementation with your custom pagination logic + * that handles your API's specific pagination structure (e.g., HATEOAS links). + * + * Example implementation for HATEOAS-style pagination: + *
{@code
+ * public class CustomPager implements BiDirectionalPage, Iterable {
+ *     private final List items;
+ *     private final String nextUrl;
+ *     private final String previousUrl;
+ *     private final OkHttpClient client;
+ *     private final TypeReference> responseType;
+ *
+ *     public CustomPager(Response response, OkHttpClient client, ...) {
+ *         this.items = response.getData();
+ *         this.nextUrl = response.getLinks().getNext();
+ *         this.previousUrl = response.getLinks().getPrevious();
+ *         // ... store other needed context
+ *     }
+ *
+ *     @Override
+ *     public boolean hasNext() {
+ *         return nextUrl != null;
+ *     }
+ *
+ *     @Override
+ *     public CustomPager nextPage() throws IOException {
+ *         if (!hasNext()) {
+ *             throw new NoSuchElementException("No next page available");
+ *         }
+ *         // Make HTTP request to nextUrl
+ *         // Parse response
+ *         // Return new CustomPager instance
+ *     }
+ *
+ *     // ... implement other methods
+ * }
+ * }
+ * + * @param The type of items in the page + */ +public class CustomPager implements BiDirectionalPage, Iterable { + + /** + * Create a CustomPager from an initial response. + * + * @param initialResponse The first page response from the API + * @param client The HTTP client to use for subsequent requests + * @param requestOptions Request options for authentication, headers, etc. + * @return A new CustomPager instance + * @throws IOException if the request fails + */ + public static CustomPager create(Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) + throws IOException { + throw new UnsupportedOperationException("CustomPager must be implemented. " + + "Please implement this class in core/CustomPager.java to define your pagination logic. " + + "This file has been added to .fernignore and will not be overwritten. " + + "See the class documentation for implementation examples."); + } + + @Override + public boolean hasNext() { + throw new UnsupportedOperationException("CustomPager.hasNext() must be implemented. " + + "This method should return true if a next page is available."); + } + + @Override + public boolean hasPrevious() { + throw new UnsupportedOperationException("CustomPager.hasPrevious() must be implemented. " + + "This method should return true if a previous page is available."); + } + + @Override + public BiDirectionalPage nextPage() throws IOException { + throw new UnsupportedOperationException("CustomPager.nextPage() must be implemented. " + + "This method should fetch and return the next page of results."); + } + + @Override + public BiDirectionalPage previousPage() throws IOException { + throw new UnsupportedOperationException("CustomPager.previousPage() must be implemented. " + + "This method should fetch and return the previous page of results."); + } + + @Override + public List getItems() { + throw new UnsupportedOperationException("CustomPager.getItems() must be implemented. " + + "This method should return the items in the current page."); + } + + @Override + public Optional getResponse() { + throw new UnsupportedOperationException("CustomPager.getResponse() must be implemented. " + + "This method should return the full response object for accessing pagination metadata."); + } + + @Override + public Iterator iterator() { + throw new UnsupportedOperationException("CustomPager.iterator() must be implemented. " + + "This method should return an iterator that traverses all items across all pages."); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/DateTimeDeserializer.java b/src/main/java/com/auth0/client/mgmt/core/DateTimeDeserializer.java new file mode 100644 index 000000000..bee373689 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/DateTimeDeserializer.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.module.SimpleModule; +import java.io.IOException; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalQueries; + +/** + * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. + */ +class DateTimeDeserializer extends JsonDeserializer { + private static final SimpleModule MODULE; + + static { + MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); + } + + /** + * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. + * + * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. + */ + public static SimpleModule getModule() { + return MODULE; + } + + @Override + public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { + JsonToken token = parser.currentToken(); + if (token == JsonToken.VALUE_NUMBER_INT) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); + } else { + TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( + parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); + + if (temporal.query(TemporalQueries.offset()) == null) { + return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); + } else { + return OffsetDateTime.from(temporal); + } + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/Environment.java b/src/main/java/com/auth0/client/mgmt/core/Environment.java new file mode 100644 index 000000000..d69f0ce4c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/Environment.java @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +public final class Environment { + public static final Environment DEFAULT = new Environment("https://%7BTENANT%7D.auth0.com/api/v2"); + + private final String url; + + private Environment(String url) { + this.url = url; + } + + public String getUrl() { + return this.url; + } + + public static Environment custom(String url) { + return new Environment(url); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/FileStream.java b/src/main/java/com/auth0/client/mgmt/core/FileStream.java new file mode 100644 index 000000000..7d60f50a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/FileStream.java @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.InputStream; +import java.util.Objects; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a file stream with associated metadata for file uploads. + */ +public class FileStream { + private final InputStream inputStream; + private final String fileName; + private final MediaType contentType; + + /** + * Constructs a FileStream with the given input stream and optional metadata. + * + * @param inputStream The input stream of the file content. Must not be null. + * @param fileName The name of the file, or null if unknown. + * @param contentType The MIME type of the file content, or null if unknown. + * @throws NullPointerException if inputStream is null + */ + public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { + this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); + this.fileName = fileName; + this.contentType = contentType; + } + + public FileStream(InputStream inputStream) { + this(inputStream, null, null); + } + + public InputStream getInputStream() { + return inputStream; + } + + @Nullable + public String getFileName() { + return fileName; + } + + @Nullable + public MediaType getContentType() { + return contentType; + } + + /** + * Creates a RequestBody suitable for use with OkHttp client. + * + * @return A RequestBody instance representing this file stream. + */ + public RequestBody toRequestBody() { + return new InputStreamRequestBody(contentType, inputStream); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/InputStreamRequestBody.java b/src/main/java/com/auth0/client/mgmt/core/InputStreamRequestBody.java new file mode 100644 index 000000000..a8c4be629 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/InputStreamRequestBody.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okio.BufferedSink; +import okio.Okio; +import okio.Source; +import org.jetbrains.annotations.Nullable; + +/** + * A custom implementation of OkHttp's RequestBody that wraps an InputStream. + * This class allows streaming of data from an InputStream directly to an HTTP request body, + * which is useful for file uploads or sending large amounts of data without loading it all into memory. + */ +public class InputStreamRequestBody extends RequestBody { + private final InputStream inputStream; + private final MediaType contentType; + + /** + * Constructs an InputStreamRequestBody with the specified content type and input stream. + * + * @param contentType the MediaType of the content, or null if not known + * @param inputStream the InputStream containing the data to be sent + * @throws NullPointerException if inputStream is null + */ + public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { + this.contentType = contentType; + this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); + } + + /** + * Returns the content type of this request body. + * + * @return the MediaType of the content, or null if not specified + */ + @Nullable + @Override + public MediaType contentType() { + return contentType; + } + + /** + * Returns the content length of this request body, if known. + * This method attempts to determine the length using the InputStream's available() method, + * which may not always accurately reflect the total length of the stream. + * + * @return the content length, or -1 if the length is unknown + * @throws IOException if an I/O error occurs + */ + @Override + public long contentLength() throws IOException { + return inputStream.available() == 0 ? -1 : inputStream.available(); + } + + /** + * Writes the content of the InputStream to the given BufferedSink. + * This method is responsible for transferring the data from the InputStream to the network request. + * + * @param sink the BufferedSink to write the content to + * @throws IOException if an I/O error occurs during writing + */ + @Override + public void writeTo(BufferedSink sink) throws IOException { + try (Source source = Okio.source(inputStream)) { + sink.writeAll(source); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ManagementApiException.java b/src/main/java/com/auth0/client/mgmt/core/ManagementApiException.java new file mode 100644 index 000000000..967f3a372 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ManagementApiException.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.Response; + +/** + * This exception type will be thrown for any non-2XX API responses. + */ +public class ManagementApiException extends ManagementException { + /** + * The error code of the response that triggered the exception. + */ + private final int statusCode; + + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + private final Map> headers; + + public ManagementApiException(String message, int statusCode, Object body) { + super(message); + this.statusCode = statusCode; + this.body = body; + this.headers = new HashMap<>(); + } + + public ManagementApiException(String message, int statusCode, Object body, Response rawResponse) { + super(message); + this.statusCode = statusCode; + this.body = body; + this.headers = new HashMap<>(); + rawResponse.headers().forEach(header -> { + String key = header.component1(); + String value = header.component2(); + this.headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); + }); + } + + /** + * @return the statusCode + */ + public int statusCode() { + return this.statusCode; + } + + /** + * @return the body + */ + public Object body() { + return this.body; + } + + /** + * @return the headers + */ + public Map> headers() { + return this.headers; + } + + @Override + public String toString() { + return "ManagementApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + + ObjectMappers.stringify(body) + "}"; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ManagementApiHttpResponse.java b/src/main/java/com/auth0/client/mgmt/core/ManagementApiHttpResponse.java new file mode 100644 index 000000000..3e5b6755b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ManagementApiHttpResponse.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.Response; + +public final class ManagementApiHttpResponse { + + private final T body; + + private final Map> headers; + + public ManagementApiHttpResponse(T body, Response rawResponse) { + this.body = body; + + Map> headers = new HashMap<>(); + rawResponse.headers().forEach(header -> { + String key = header.component1(); + String value = header.component2(); + headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); + }); + this.headers = headers; + } + + public T body() { + return this.body; + } + + public Map> headers() { + return headers; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ManagementException.java b/src/main/java/com/auth0/client/mgmt/core/ManagementException.java new file mode 100644 index 000000000..f663f4803 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ManagementException.java @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +/** + * This class serves as the base exception for all errors in the SDK. + */ +public class ManagementException extends RuntimeException { + public ManagementException(String message) { + super(message); + } + + public ManagementException(String message, Exception e) { + super(message, e); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/MediaTypes.java b/src/main/java/com/auth0/client/mgmt/core/MediaTypes.java new file mode 100644 index 000000000..ced1fd0ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/MediaTypes.java @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import okhttp3.MediaType; + +public final class MediaTypes { + + public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); + + private MediaTypes() {} +} diff --git a/src/main/java/com/auth0/client/mgmt/core/Nullable.java b/src/main/java/com/auth0/client/mgmt/core/Nullable.java new file mode 100644 index 000000000..789d4de38 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/Nullable.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.Optional; +import java.util.function.Function; + +public final class Nullable { + + private final Either, Null> value; + + private Nullable() { + this.value = Either.left(Optional.empty()); + } + + private Nullable(T value) { + if (value == null) { + this.value = Either.right(Null.INSTANCE); + } else { + this.value = Either.left(Optional.of(value)); + } + } + + public static Nullable ofNull() { + return new Nullable<>(null); + } + + public static Nullable of(T value) { + return new Nullable<>(value); + } + + public static Nullable empty() { + return new Nullable<>(); + } + + public static Nullable ofOptional(Optional value) { + if (value.isPresent()) { + return of(value.get()); + } else { + return empty(); + } + } + + public boolean isNull() { + return this.value.isRight(); + } + + public boolean isEmpty() { + return this.value.isLeft() && !this.value.getLeft().isPresent(); + } + + public T get() { + if (this.isNull()) { + return null; + } + + return this.value.getLeft().get(); + } + + public Nullable map(Function mapper) { + if (this.isNull()) { + return Nullable.ofNull(); + } + + return Nullable.ofOptional(this.value.getLeft().map(mapper)); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof Nullable)) { + return false; + } + + if (((Nullable) other).isNull() && this.isNull()) { + return true; + } + + return this.value.getLeft().equals(((Nullable) other).value.getLeft()); + } + + private static final class Either { + private L left = null; + private R right = null; + + private Either(L left, R right) { + if (left != null && right != null) { + throw new IllegalArgumentException("Left and right argument cannot both be non-null."); + } + + if (left == null && right == null) { + throw new IllegalArgumentException("Left and right argument cannot both be null."); + } + + if (left != null) { + this.left = left; + } + + if (right != null) { + this.right = right; + } + } + + public static Either left(L left) { + return new Either<>(left, null); + } + + public static Either right(R right) { + return new Either<>(null, right); + } + + public boolean isLeft() { + return this.left != null; + } + + public boolean isRight() { + return this.right != null; + } + + public L getLeft() { + if (!this.isLeft()) { + throw new IllegalArgumentException("Cannot get left from right Either."); + } + return this.left; + } + + public R getRight() { + if (!this.isRight()) { + throw new IllegalArgumentException("Cannot get right from left Either."); + } + return this.right; + } + } + + private static final class Null { + private static final Null INSTANCE = new Null(); + + private Null() {} + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/NullableNonemptyFilter.java b/src/main/java/com/auth0/client/mgmt/core/NullableNonemptyFilter.java new file mode 100644 index 000000000..b0a0f8776 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/NullableNonemptyFilter.java @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.Optional; + +public final class NullableNonemptyFilter { + @Override + public boolean equals(Object o) { + boolean isOptionalEmpty = isOptionalEmpty(o); + + return isOptionalEmpty; + } + + private boolean isOptionalEmpty(Object o) { + if (o instanceof Optional) { + return !((Optional) o).isPresent(); + } + if (o instanceof OptionalNullable) { + return ((OptionalNullable) o).isAbsent(); + } + return false; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java b/src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java new file mode 100644 index 000000000..8ad1a1486 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java @@ -0,0 +1,44 @@ +package com.auth0.client.mgmt.core; + +/** + * Exception thrown when OAuth token fetching fails. + * + *

This exception is thrown when there are issues obtaining an access token + * using the OAuth 2.0 client credentials flow, such as: + *

    + *
  • Invalid client credentials
  • + *
  • Network connectivity issues
  • + *
  • Auth0 service unavailability
  • + *
  • Invalid audience or base URL
  • + *
+ */ +public class OAuthTokenException extends RuntimeException { + + /** + * Creates a new OAuth token exception with the specified message. + * + * @param message The error message + */ + public OAuthTokenException(String message) { + super(message); + } + + /** + * Creates a new OAuth token exception with the specified message and cause. + * + * @param message The error message + * @param cause The underlying cause + */ + public OAuthTokenException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new OAuth token exception with the specified cause. + * + * @param cause The underlying cause + */ + public OAuthTokenException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java b/src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java new file mode 100644 index 000000000..11dc988a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java @@ -0,0 +1,134 @@ +/** + * OAuth token supplier for fetching and caching access tokens using client credentials. + * + * This class handles the OAuth 2.0 client credentials flow to obtain access tokens + * from Auth0. Tokens are cached and automatically refreshed when they expire. + */ +package com.auth0.client.mgmt.core; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import okhttp3.*; + +public class OAuthTokenSupplier implements java.util.function.Supplier { + private static final MediaType JSON = MediaType.get("application/json; charset=utf-8"); + private static final long BUFFER_SECONDS = 120; + + // Shared HTTP client for all OAuth token requests to avoid resource leaks + private static final OkHttpClient SHARED_HTTP_CLIENT = + new OkHttpClient.Builder().callTimeout(30, TimeUnit.SECONDS).build(); + + private final String clientId; + private final String clientSecret; + private final String tokenUrl; + private final String audience; + + private volatile String accessToken; + private volatile Instant expiresAt; + + /** + * Creates a new OAuth token supplier. + * + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @param baseUrl The Auth0 base URL (e.g., "https://your-domain.auth0.com") + * @param audience The API audience. If null, defaults to baseUrl + "/api/v2/" + * @throws IllegalArgumentException if baseUrl is null or empty + */ + public OAuthTokenSupplier(String clientId, String clientSecret, String baseUrl, String audience) { + if (baseUrl == null || baseUrl.trim().isEmpty()) { + throw new IllegalArgumentException("baseUrl cannot be null or empty"); + } + + this.clientId = clientId; + this.clientSecret = clientSecret; + + String normalizedBaseUrl = baseUrl.replaceAll("/+$", ""); + this.tokenUrl = normalizedBaseUrl + "/oauth/token"; + this.audience = audience != null ? audience : normalizedBaseUrl + "/api/v2/"; + this.expiresAt = Instant.now(); + } + + /** + * Gets an access token, fetching a new one if the cached token has expired. + * + * @return A valid Bearer token string (without "Bearer " prefix) + * @throws OAuthTokenException if token fetching fails due to network issues, + * invalid credentials, or Auth0 service problems + */ + @Override + public String get() { + if (accessToken == null || Instant.now().isAfter(expiresAt)) { + synchronized (this) { + if (accessToken == null || Instant.now().isAfter(expiresAt)) { + fetchToken(); + } + } + } + return accessToken; + } + + /** + * Fetches a new access token from Auth0. + * + * @throws OAuthTokenException if token fetching fails + */ + private void fetchToken() { + try { + Map requestData = new HashMap<>(); + requestData.put("client_id", clientId); + requestData.put("client_secret", clientSecret); + requestData.put("audience", audience); + requestData.put("grant_type", "client_credentials"); + + String requestBody = ObjectMappers.JSON_MAPPER.writeValueAsString(requestData); + + Request request = new Request.Builder() + .url(tokenUrl) + .post(RequestBody.create(requestBody, JSON)) + .addHeader("Content-Type", "application/json") + .build(); + + try (Response response = SHARED_HTTP_CLIENT.newCall(request).execute()) { + if (!response.isSuccessful()) { + throw new OAuthTokenException( + "Failed to fetch OAuth token: HTTP " + response.code() + " - " + response.message()); + } + + String responseBody = response.body() != null ? response.body().string() : "{}"; + TokenResponse tokenResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody, TokenResponse.class); + + if (tokenResponse.accessToken == null || tokenResponse.accessToken.isEmpty()) { + throw new OAuthTokenException("OAuth token response did not contain an access token"); + } + + this.accessToken = tokenResponse.accessToken; + this.expiresAt = Instant.now() + .plusSeconds(tokenResponse.expiresIn != null ? tokenResponse.expiresIn : 86400) + .minusSeconds(BUFFER_SECONDS); + } + } catch (IOException e) { + throw new OAuthTokenException("Failed to fetch OAuth token due to network error", e); + } + } + + /** + * Response from Auth0 token endpoint. + */ + @JsonIgnoreProperties(ignoreUnknown = true) + private static class TokenResponse { + @JsonProperty("access_token") + String accessToken; + + @JsonProperty("expires_in") + Integer expiresIn; + + @JsonProperty("token_type") + String tokenType; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ObjectMappers.java b/src/main/java/com/auth0/client/mgmt/core/ObjectMappers.java new file mode 100644 index 000000000..10d06b6bc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ObjectMappers.java @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.io.IOException; + +public final class ObjectMappers { + public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() + .addModule(new Jdk8Module()) + .addModule(new JavaTimeModule()) + .addModule(DateTimeDeserializer.getModule()) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .build(); + + private ObjectMappers() {} + + public static String stringify(Object o) { + try { + return JSON_MAPPER + .setSerializationInclusion(JsonInclude.Include.ALWAYS) + .writerWithDefaultPrettyPrinter() + .writeValueAsString(o); + } catch (IOException e) { + return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); + } + } + + public static Object parseErrorBody(String responseBodyString) { + try { + return JSON_MAPPER.readValue(responseBodyString, Object.class); + } catch (JsonProcessingException ignored) { + return responseBodyString; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/OptionalNullable.java b/src/main/java/com/auth0/client/mgmt/core/OptionalNullable.java new file mode 100644 index 000000000..4ddd536f8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/OptionalNullable.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Function; + +/** + * An optional wrapper type that supports null values, distinguishing between: + * - ABSENT: field not present (e.g., not included in request) + * - NULL: field explicitly set to null + * - PRESENT: field has a non-null value + * + * This is useful for partial updates, JSON Merge Patch (RFC 7396), and any API + * that needs to differentiate between "not specified" and "set to null". + * + * Use this for optional> types where null is a valid value. + * For regular optional types (where null is not valid), use Optional instead. + */ +public final class OptionalNullable { + + private enum State { + ABSENT, + NULL, + PRESENT + } + + private final State state; + private final T value; + + private OptionalNullable(State state, T value) { + this.state = state; + this.value = value; + } + + /** + * Creates an absent OptionalNullable (field not present). + */ + public static OptionalNullable absent() { + return new OptionalNullable<>(State.ABSENT, null); + } + + /** + * Creates a null OptionalNullable (field explicitly set to null). + */ + public static OptionalNullable ofNull() { + return new OptionalNullable<>(State.NULL, null); + } + + /** + * Creates an OptionalNullable with a value. + */ + public static OptionalNullable of(T value) { + Objects.requireNonNull(value, "Use ofNull() for null values"); + return new OptionalNullable<>(State.PRESENT, value); + } + + /** + * Creates an OptionalNullable from a nullable value. + */ + @JsonCreator + public static OptionalNullable ofNullable(T value) { + return value == null ? ofNull() : of(value); + } + + /** + * Returns true if the field was absent from the request. + */ + public boolean isAbsent() { + return state == State.ABSENT; + } + + /** + * Returns true if the field was explicitly set to null. + */ + public boolean isNull() { + return state == State.NULL; + } + + /** + * Returns true if the field has a value. + */ + public boolean isPresent() { + return state == State.PRESENT; + } + + /** + * Returns true if the field was present in the request (either null or with a value). + */ + public boolean wasSpecified() { + return state != State.ABSENT; + } + + /** + * Gets the value if present, throws if absent or null. + */ + public T get() { + if (state != State.PRESENT) { + throw new IllegalStateException("Cannot get value from " + state + " OptionalNullable"); + } + return value; + } + + /** + * Gets the value if present or explicitly null, throws if absent. + * This is useful for update operations where null is a valid value to set. + */ + public T getValueOrNull() { + if (state == State.ABSENT) { + throw new IllegalStateException("No value set"); + } + return value; // Returns the actual value if PRESENT, or null if NULL + } + + /** + * Gets the value if present, returns null if explicitly set to null, or returns the provided default if absent. + */ + public T orElse(T defaultValue) { + if (state == State.PRESENT) return value; + if (state == State.NULL) return null; + return defaultValue; + } + + /** + * Converts to an Optional, returning empty for both absent and null states. + */ + public Optional toOptional() { + return state == State.PRESENT ? Optional.of(value) : Optional.empty(); + } + + /** + * Maps the value if present, preserving absent and null states. + */ + public OptionalNullable map(Function mapper) { + if (state == State.PRESENT) { + return OptionalNullable.of(mapper.apply(value)); + } else if (state == State.NULL) { + return OptionalNullable.ofNull(); + } else { + return OptionalNullable.absent(); + } + } + + /** + * For JSON serialization - serialize the actual value or null. + * Absent values should be handled by @JsonInclude(JsonInclude.Include.CUSTOM) + */ + @JsonValue + public Object getJsonValue() { + if (state == State.ABSENT) { + // Should not be serialized - handled by custom inclusion + throw new IllegalStateException("Absent values should not be serialized"); + } + return state == State.NULL ? null : value; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + OptionalNullable that = (OptionalNullable) o; + return state == that.state && Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(state, value); + } + + @Override + public String toString() { + switch (state) { + case ABSENT: + return "OptionalNullable.absent()"; + case NULL: + return "OptionalNullable.ofNull()"; + case PRESENT: + return "OptionalNullable.of(" + value + ")"; + default: + throw new IllegalStateException("Unknown state: " + state); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java b/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java new file mode 100644 index 000000000..82c608579 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import okhttp3.HttpUrl; +import okhttp3.MultipartBody; + +public class QueryStringMapper { + + private static final ObjectMapper MAPPER = ObjectMappers.JSON_MAPPER; + + public static void addQueryParameter(HttpUrl.Builder httpUrl, String key, Object value, boolean arraysAsRepeats) { + + if (value instanceof OptionalNullable) { + OptionalNullable opt = (OptionalNullable) value; + if (!opt.isPresent()) { + return; + } + value = opt.get(); + } + + JsonNode valueNode = MAPPER.valueToTree(value); + + List> flat; + if (valueNode.isObject()) { + flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); + } else if (valueNode.isArray()) { + flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); + } else { + if (valueNode.isTextual()) { + httpUrl.addQueryParameter(key, valueNode.textValue()); + } else { + httpUrl.addQueryParameter(key, valueNode.toString()); + } + return; + } + + for (Map.Entry field : flat) { + if (field.getValue().isTextual()) { + httpUrl.addQueryParameter(key + field.getKey(), field.getValue().textValue()); + } else { + httpUrl.addQueryParameter(key + field.getKey(), field.getValue().toString()); + } + } + } + + public static void addFormDataPart( + MultipartBody.Builder multipartBody, String key, Object value, boolean arraysAsRepeats) { + JsonNode valueNode = MAPPER.valueToTree(value); + + List> flat; + if (valueNode.isObject()) { + flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); + } else if (valueNode.isArray()) { + flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); + } else { + if (valueNode.isTextual()) { + multipartBody.addFormDataPart(key, valueNode.textValue()); + } else { + multipartBody.addFormDataPart(key, valueNode.toString()); + } + return; + } + + for (Map.Entry field : flat) { + if (field.getValue().isTextual()) { + multipartBody.addFormDataPart( + key + field.getKey(), field.getValue().textValue()); + } else { + multipartBody.addFormDataPart( + key + field.getKey(), field.getValue().toString()); + } + } + } + + public static List> flattenObject(ObjectNode object, boolean arraysAsRepeats) { + List> flat = new ArrayList<>(); + + Iterator> fields = object.fields(); + while (fields.hasNext()) { + Map.Entry field = fields.next(); + + String key = "[" + field.getKey() + "]"; + + if (field.getValue().isObject()) { + List> flatField = + flattenObject((ObjectNode) field.getValue(), arraysAsRepeats); + addAll(flat, flatField, key); + } else if (field.getValue().isArray()) { + List> flatField = + flattenArray((ArrayNode) field.getValue(), key, arraysAsRepeats); + addAll(flat, flatField, ""); + } else { + flat.add(new AbstractMap.SimpleEntry<>(key, field.getValue())); + } + } + + return flat; + } + + private static List> flattenArray( + ArrayNode array, String key, boolean arraysAsRepeats) { + List> flat = new ArrayList<>(); + + Iterator elements = array.elements(); + + int index = 0; + while (elements.hasNext()) { + JsonNode element = elements.next(); + + String indexKey = key + "[" + index + "]"; + + if (arraysAsRepeats) { + indexKey = key; + } + + if (element.isObject()) { + List> flatField = flattenObject((ObjectNode) element, arraysAsRepeats); + addAll(flat, flatField, indexKey); + } else if (element.isArray()) { + List> flatField = flattenArray((ArrayNode) element, "", arraysAsRepeats); + addAll(flat, flatField, indexKey); + } else { + flat.add(new AbstractMap.SimpleEntry<>(indexKey, element)); + } + + index++; + } + + return flat; + } + + private static void addAll( + List> target, List> source, String prefix) { + for (Map.Entry entry : source) { + Map.Entry entryToAdd = + new AbstractMap.SimpleEntry<>(prefix + entry.getKey(), entry.getValue()); + target.add(entryToAdd); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/RequestOptions.java b/src/main/java/com/auth0/client/mgmt/core/RequestOptions.java new file mode 100644 index 000000000..735186a1f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/RequestOptions.java @@ -0,0 +1,276 @@ +/** + * This file was auto-generated by Fern from our API Definition. + * + * MODIFIED: Added support for per-request OAuth client credentials. + * This allows overriding OAuth credentials on a per-request basis. + */ +package com.auth0.client.mgmt.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +public final class RequestOptions { + private final String token; + + private final Optional timeout; + + private final TimeUnit timeoutTimeUnit; + + private final Map headers; + + private final Map> headerSuppliers; + + // Per-request OAuth credentials + private final String clientId; + + private final String clientSecret; + + private final String audience; + + private final String baseUrl; + + // Cached token supplier for per-request credentials (lazily initialized) + private transient volatile OAuthTokenSupplier cachedTokenSupplier; + + private RequestOptions( + String token, + Optional timeout, + TimeUnit timeoutTimeUnit, + Map headers, + Map> headerSuppliers, + String clientId, + String clientSecret, + String audience, + String baseUrl) { + this.token = token; + this.timeout = timeout; + this.timeoutTimeUnit = timeoutTimeUnit; + this.headers = headers; + this.headerSuppliers = headerSuppliers; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.audience = audience; + this.baseUrl = baseUrl; + } + + public Optional getTimeout() { + return timeout; + } + + public TimeUnit getTimeoutTimeUnit() { + return timeoutTimeUnit; + } + + /** + * Returns the client ID for per-request OAuth credentials, if set. + */ + public String getClientId() { + return clientId; + } + + /** + * Returns the client secret for per-request OAuth credentials, if set. + */ + public String getClientSecret() { + return clientSecret; + } + + /** + * Returns the audience for per-request OAuth credentials, if set. + */ + public String getAudience() { + return audience; + } + + /** + * Checks if per-request OAuth credentials have been configured. + */ + public boolean hasClientCredentials() { + return clientId != null && clientSecret != null; + } + + /** + * Gets the base URL for per-request OAuth token fetching. + */ + public String getBaseUrl() { + return baseUrl; + } + + /** + * Gets the HTTP headers for this request. + * + *

Note: When per-request OAuth credentials are configured, this method will + * automatically fetch an access token (blocking network call). Tokens are cached and reused. + * + * @return Map of HTTP header names to values + * @throws OAuthTokenException if OAuth token fetching fails + */ + public Map getHeaders() { + Map headers = new HashMap<>(); + + if (hasClientCredentials() && baseUrl != null) { + if (cachedTokenSupplier == null) { + synchronized (this) { + if (cachedTokenSupplier == null) { + cachedTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, baseUrl, audience); + } + } + } + headers.put("Authorization", "Bearer " + cachedTokenSupplier.get()); + } else if (this.token != null) { + headers.put("Authorization", "Bearer " + this.token); + } + + headers.putAll(this.headers); + this.headerSuppliers.forEach((key, supplier) -> { + headers.put(key, supplier.get()); + }); + return headers; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String token = null; + + private Optional timeout = Optional.empty(); + + private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; + + private final Map headers = new HashMap<>(); + + private final Map> headerSuppliers = new HashMap<>(); + + private String clientId = null; + + private String clientSecret = null; + + private String audience = null; + + private String baseUrl = null; + + public Builder token(String token) { + this.token = token; + return this; + } + + /** + * Sets the base URL for OAuth token requests. + * This is required when using per-request client credentials. + * + * @param baseUrl The Auth0 base URL (e.g., "https://your-domain.auth0.com") + * @return This builder for method chaining + */ + public Builder baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Sets OAuth client credentials for this request only. + * This overrides any client-level authentication and fetches a new token + * using the provided credentials. + * + * Useful for multi-tenant scenarios where different requests need different OAuth tokens. + * + * Note: You must also call baseUrl() to specify where to fetch the token from. + * + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @return This builder for method chaining + */ + public Builder clientCredentials(String clientId, String clientSecret) { + this.clientId = clientId; + this.clientSecret = clientSecret; + return this; + } + + /** + * Sets OAuth client credentials with a custom audience for this request only. + * + * Note: You must also call baseUrl() to specify where to fetch the token from. + * + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @param audience The custom audience for the token request + * @return This builder for method chaining + */ + public Builder clientCredentialsWithAudience(String clientId, String clientSecret, String audience) { + this.clientId = clientId; + this.clientSecret = clientSecret; + this.audience = audience; + return this; + } + + public Builder timeout(Integer timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { + this.timeout = Optional.of(timeout); + this.timeoutTimeUnit = timeoutTimeUnit; + return this; + } + + public Builder addHeader(String key, String value) { + this.headers.put(key, value); + return this; + } + + public Builder addHeader(String key, Supplier value) { + this.headerSuppliers.put(key, value); + return this; + } + + public RequestOptions build() { + return new RequestOptions( + token, + timeout, + timeoutTimeUnit, + headers, + headerSuppliers, + clientId, + clientSecret, + audience, + baseUrl); + } + } + + /** + * Convenience method to create RequestOptions with client credentials. + * + * @param baseUrl The Auth0 base URL (e.g., "https://your-domain.auth0.com") + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @return RequestOptions configured with the provided credentials + */ + public static RequestOptions withClientCredentials(String baseUrl, String clientId, String clientSecret) { + return builder() + .baseUrl(baseUrl) + .clientCredentials(clientId, clientSecret) + .build(); + } + + /** + * Convenience method to create RequestOptions with client credentials and custom audience. + * + * @param baseUrl The Auth0 base URL (e.g., "https://your-domain.auth0.com") + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @param audience The custom audience for the token request + * @return RequestOptions configured with the provided credentials and audience + */ + public static RequestOptions withClientCredentialsAndAudience( + String baseUrl, String clientId, String clientSecret, String audience) { + return builder() + .baseUrl(baseUrl) + .clientCredentialsWithAudience(clientId, clientSecret, audience) + .build(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ResponseBodyInputStream.java b/src/main/java/com/auth0/client/mgmt/core/ResponseBodyInputStream.java new file mode 100644 index 000000000..49db4ff6b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ResponseBodyInputStream.java @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.FilterInputStream; +import java.io.IOException; +import okhttp3.Response; + +/** + * A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the + * OkHttp Response object is properly closed when the stream is closed. + * + * This class extends FilterInputStream and takes an OkHttp Response object as a parameter. + * It retrieves the InputStream from the Response and overrides the close method to close + * both the InputStream and the Response object, ensuring proper resource management and preventing + * premature closure of the underlying HTTP connection. + */ +public class ResponseBodyInputStream extends FilterInputStream { + private final Response response; + + /** + * Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp + * Response object. + * + * @param response the OkHttp Response object from which the InputStream is retrieved + * @throws IOException if an I/O error occurs while retrieving the InputStream + */ + public ResponseBodyInputStream(Response response) throws IOException { + super(response.body().byteStream()); + this.response = response; + } + + /** + * Closes the InputStream and the associated OkHttp Response object. This ensures that the + * underlying HTTP connection is properly closed after the stream is no longer needed. + * + * @throws IOException if an I/O error occurs + */ + @Override + public void close() throws IOException { + super.close(); + response.close(); // Ensure the response is closed when the stream is closed + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/ResponseBodyReader.java b/src/main/java/com/auth0/client/mgmt/core/ResponseBodyReader.java new file mode 100644 index 000000000..7eff702df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/ResponseBodyReader.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.FilterReader; +import java.io.IOException; +import okhttp3.Response; + +/** + * A custom Reader that wraps the Reader from the OkHttp Response and ensures that the + * OkHttp Response object is properly closed when the reader is closed. + * + * This class extends FilterReader and takes an OkHttp Response object as a parameter. + * It retrieves the Reader from the Response and overrides the close method to close + * both the Reader and the Response object, ensuring proper resource management and preventing + * premature closure of the underlying HTTP connection. + */ +public class ResponseBodyReader extends FilterReader { + private final Response response; + + /** + * Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. + * + * @param response the OkHttp Response object from which the Reader is retrieved + * @throws IOException if an I/O error occurs while retrieving the Reader + */ + public ResponseBodyReader(Response response) throws IOException { + super(response.body().charStream()); + this.response = response; + } + + /** + * Closes the Reader and the associated OkHttp Response object. This ensures that the + * underlying HTTP connection is properly closed after the reader is no longer needed. + * + * @throws IOException if an I/O error occurs + */ + @Override + public void close() throws IOException { + super.close(); + response.close(); // Ensure the response is closed when the reader is closed + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/RetryInterceptor.java b/src/main/java/com/auth0/client/mgmt/core/RetryInterceptor.java new file mode 100644 index 000000000..17f2fbacf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/RetryInterceptor.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.IOException; +import java.time.Duration; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.Optional; +import java.util.Random; +import okhttp3.Interceptor; +import okhttp3.Response; + +public class RetryInterceptor implements Interceptor { + + private static final Duration INITIAL_RETRY_DELAY = Duration.ofMillis(1000); + private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000); + private static final double JITTER_FACTOR = 0.2; + + private final ExponentialBackoff backoff; + private final Random random = new Random(); + + public RetryInterceptor(int maxRetries) { + this.backoff = new ExponentialBackoff(maxRetries); + } + + @Override + public Response intercept(Chain chain) throws IOException { + Response response = chain.proceed(chain.request()); + + if (shouldRetry(response.code())) { + return retryChain(response, chain); + } + + return response; + } + + private Response retryChain(Response response, Chain chain) throws IOException { + Optional nextBackoff = this.backoff.nextBackoff(response); + while (nextBackoff.isPresent()) { + try { + Thread.sleep(nextBackoff.get().toMillis()); + } catch (InterruptedException e) { + throw new IOException("Interrupted while trying request", e); + } + response.close(); + response = chain.proceed(chain.request()); + if (shouldRetry(response.code())) { + nextBackoff = this.backoff.nextBackoff(response); + } else { + return response; + } + } + + return response; + } + + /** + * Calculates the retry delay from response headers, with fallback to exponential backoff. + * Priority: Retry-After > X-RateLimit-Reset > Exponential Backoff + */ + private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) { + // Check for Retry-After header first (RFC 7231), with no jitter + String retryAfter = response.header("Retry-After"); + if (retryAfter != null) { + // Parse as number of seconds... + Optional secondsDelay = tryParseLong(retryAfter) + .map(seconds -> seconds * 1000) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (secondsDelay.isPresent()) { + return secondsDelay.get(); + } + + // ...or as an HTTP date; both are valid + Optional dateDelay = tryParseHttpDate(retryAfter) + .map(resetTime -> resetTime.toInstant().toEpochMilli() - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (dateDelay.isPresent()) { + return dateDelay.get(); + } + } + + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter + String rateLimitReset = response.header("X-RateLimit-Reset"); + if (rateLimitReset != null) { + // Assume Unix timestamp in epoch seconds + Optional rateLimitDelay = tryParseLong(rateLimitReset) + .map(resetTimeSeconds -> (resetTimeSeconds * 1000) - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(this::addPositiveJitter) + .map(Duration::ofMillis); + if (rateLimitDelay.isPresent()) { + return rateLimitDelay.get(); + } + } + + // Fall back to exponential backoff, with symmetric jitter + long baseDelay = INITIAL_RETRY_DELAY.toMillis() * (1L << retryAttempt); // 2^retryAttempt + long cappedDelay = Math.min(baseDelay, MAX_RETRY_DELAY.toMillis()); + return Duration.ofMillis(addSymmetricJitter(cappedDelay)); + } + + /** + * Attempts to parse a string as a long, returning empty Optional on failure. + */ + private Optional tryParseLong(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(Long.parseLong(value)); + } catch (NumberFormatException e) { + return Optional.empty(); + } + } + + /** + * Attempts to parse a string as an HTTP date (RFC 1123), returning empty Optional on failure. + */ + private Optional tryParseHttpDate(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(ZonedDateTime.parse(value, DateTimeFormatter.RFC_1123_DATE_TIME)); + } catch (DateTimeParseException e) { + return Optional.empty(); + } + } + + /** + * Adds positive jitter (100-120% of original value) to prevent thundering herd. + * Used for X-RateLimit-Reset header delays. + */ + private long addPositiveJitter(long delayMs) { + double jitterMultiplier = 1.0 + (random.nextDouble() * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + + /** + * Adds symmetric jitter (90-110% of original value) to prevent thundering herd. + * Used for exponential backoff delays. + */ + private long addSymmetricJitter(long delayMs) { + double jitterMultiplier = 1.0 + ((random.nextDouble() - 0.5) * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + + private static boolean shouldRetry(int statusCode) { + return statusCode == 408 || statusCode == 429 || statusCode >= 500; + } + + private final class ExponentialBackoff { + + private final int maxNumRetries; + + private int retryNumber = 0; + + ExponentialBackoff(int maxNumRetries) { + this.maxNumRetries = maxNumRetries; + } + + public Optional nextBackoff(Response response) { + if (retryNumber >= maxNumRetries) { + return Optional.empty(); + } + + Duration delay = getRetryDelayFromHeaders(response, retryNumber); + retryNumber += 1; + return Optional.of(delay); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/Stream.java b/src/main/java/com/auth0/client/mgmt/core/Stream.java new file mode 100644 index 000000000..c2d438973 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/Stream.java @@ -0,0 +1,302 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.io.Closeable; +import java.io.IOException; +import java.io.Reader; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Scanner; + +/** + * The {@code Stream} class implements {@link Iterable} to provide a simple mechanism for reading and parsing + * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. + *

+ * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a + * {@code Scanner} to block during iteration if the next object is not available. + * Iterable stream for parsing JSON and Server-Sent Events (SSE) data. + * Supports both newline-delimited JSON and SSE with optional stream termination. + * + * @param The type of objects in the stream. + */ +public final class Stream implements Iterable, Closeable { + + private static final String NEWLINE = "\n"; + private static final String DATA_PREFIX = "data:"; + + public enum StreamType { + JSON, + SSE + } + + private final Class valueType; + private final Scanner scanner; + private final StreamType streamType; + private final String messageTerminator; + private final String streamTerminator; + private final Reader sseReader; + private boolean isClosed = false; + + /** + * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. + * + * @param valueType The class of the objects in the stream. + * @param reader The reader that provides the streamed data. + * @param delimiter The delimiter used to separate elements in the stream. + */ + public Stream(Class valueType, Reader reader, String delimiter) { + this.valueType = valueType; + this.scanner = new Scanner(reader).useDelimiter(delimiter); + this.streamType = StreamType.JSON; + this.messageTerminator = delimiter; + this.streamTerminator = null; + this.sseReader = null; + } + + private Stream(Class valueType, StreamType type, Reader reader, String terminator) { + this.valueType = valueType; + this.streamType = type; + if (type == StreamType.JSON) { + this.scanner = new Scanner(reader).useDelimiter(terminator); + this.messageTerminator = terminator; + this.streamTerminator = null; + this.sseReader = null; + } else { + this.scanner = null; + this.messageTerminator = NEWLINE; + this.streamTerminator = terminator; + this.sseReader = reader; + } + } + + public static Stream fromJson(Class valueType, Reader reader, String delimiter) { + return new Stream<>(valueType, reader, delimiter); + } + + public static Stream fromJson(Class valueType, Reader reader) { + return new Stream<>(valueType, reader, NEWLINE); + } + + public static Stream fromSse(Class valueType, Reader sseReader) { + return new Stream<>(valueType, StreamType.SSE, sseReader, null); + } + + public static Stream fromSse(Class valueType, Reader sseReader, String streamTerminator) { + return new Stream<>(valueType, StreamType.SSE, sseReader, streamTerminator); + } + + @Override + public void close() throws IOException { + if (!isClosed) { + isClosed = true; + if (scanner != null) { + scanner.close(); + } + if (sseReader != null) { + sseReader.close(); + } + } + } + + private boolean isStreamClosed() { + return isClosed; + } + + /** + * Returns an iterator over the elements in this stream that blocks during iteration when the next object is + * not yet available. + * + * @return An iterator that can be used to traverse the elements in the stream. + */ + @Override + public Iterator iterator() { + if (streamType == StreamType.SSE) { + return new SSEIterator(); + } else { + return new JsonIterator(); + } + } + + private final class JsonIterator implements Iterator { + + /** + * Returns {@code true} if there are more elements in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return {@code true} if there are more elements, {@code false} otherwise. + */ + @Override + public boolean hasNext() { + if (isStreamClosed()) { + return false; + } + return scanner.hasNext(); + } + + /** + * Returns the next element in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return The next element in the stream. + * @throws NoSuchElementException If there are no more elements in the stream. + */ + @Override + public T next() { + if (isStreamClosed()) { + throw new NoSuchElementException("Stream is closed"); + } + + if (!scanner.hasNext()) { + throw new NoSuchElementException(); + } else { + try { + T parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(scanner.next().trim(), valueType); + return parsedResponse; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + } + + private final class SSEIterator implements Iterator { + private Scanner sseScanner; + private T nextItem; + private boolean hasNextItem = false; + private boolean endOfStream = false; + private StringBuilder eventDataBuffer = new StringBuilder(); + private String currentEventType = null; + + private SSEIterator() { + if (sseReader != null && !isStreamClosed()) { + this.sseScanner = new Scanner(sseReader); + } else { + this.endOfStream = true; + } + } + + @Override + public boolean hasNext() { + if (isStreamClosed() || endOfStream) { + return false; + } + + if (hasNextItem) { + return true; + } + + return readNextMessage(); + } + + @Override + public T next() { + if (!hasNext()) { + throw new NoSuchElementException("No more elements in stream"); + } + + T result = nextItem; + nextItem = null; + hasNextItem = false; + return result; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + private boolean readNextMessage() { + if (sseScanner == null || isStreamClosed()) { + endOfStream = true; + return false; + } + + try { + while (sseScanner.hasNextLine()) { + String line = sseScanner.nextLine(); + + if (line.trim().isEmpty()) { + if (eventDataBuffer.length() > 0) { + try { + nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType); + hasNextItem = true; + eventDataBuffer.setLength(0); + currentEventType = null; + return true; + } catch (Exception parseEx) { + System.err.println("Failed to parse SSE event: " + parseEx.getMessage()); + eventDataBuffer.setLength(0); + currentEventType = null; + continue; + } + } + continue; + } + + if (line.startsWith(DATA_PREFIX)) { + String dataContent = line.substring(DATA_PREFIX.length()); + if (dataContent.startsWith(" ")) { + dataContent = dataContent.substring(1); + } + + if (eventDataBuffer.length() == 0 + && streamTerminator != null + && dataContent.trim().equals(streamTerminator)) { + endOfStream = true; + return false; + } + + if (eventDataBuffer.length() > 0) { + eventDataBuffer.append('\n'); + } + eventDataBuffer.append(dataContent); + } else if (line.startsWith("event:")) { + String eventValue = line.length() > 6 ? line.substring(6) : ""; + if (eventValue.startsWith(" ")) { + eventValue = eventValue.substring(1); + } + currentEventType = eventValue; + } else if (line.startsWith("id:")) { + // Event ID field (ignored) + } else if (line.startsWith("retry:")) { + // Retry field (ignored) + } else if (line.startsWith(":")) { + // Comment line (ignored) + } + } + + if (eventDataBuffer.length() > 0) { + try { + nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType); + hasNextItem = true; + eventDataBuffer.setLength(0); + currentEventType = null; + return true; + } catch (Exception parseEx) { + System.err.println("Failed to parse final SSE event: " + parseEx.getMessage()); + eventDataBuffer.setLength(0); + currentEventType = null; + } + } + + endOfStream = true; + return false; + + } catch (Exception e) { + System.err.println("Failed to parse SSE stream: " + e.getMessage()); + endOfStream = true; + return false; + } + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/Suppliers.java b/src/main/java/com/auth0/client/mgmt/core/Suppliers.java new file mode 100644 index 000000000..29e113889 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/Suppliers.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +public final class Suppliers { + private Suppliers() {} + + public static Supplier memoize(Supplier delegate) { + AtomicReference value = new AtomicReference<>(); + return () -> { + T val = value.get(); + if (val == null) { + val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur); + } + return val; + }; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/SyncPage.java b/src/main/java/com/auth0/client/mgmt/core/SyncPage.java new file mode 100644 index 000000000..25a8d1bf9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/SyncPage.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.List; +import java.util.NoSuchElementException; +import java.util.function.Supplier; + +public class SyncPage extends BasePage { + protected final Supplier> nextSupplier; + + public SyncPage(boolean hasNext, List items, Object response, Supplier> nextSupplier) { + super(hasNext, items, response); + this.nextSupplier = nextSupplier; + } + + public SyncPage nextPage() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return nextSupplier.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/core/SyncPagingIterable.java b/src/main/java/com/auth0/client/mgmt/core/SyncPagingIterable.java new file mode 100644 index 000000000..bc3dc871e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/core/SyncPagingIterable.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.function.Supplier; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +public class SyncPagingIterable extends SyncPage implements Iterable { + + public SyncPagingIterable( + boolean hasNext, List items, Object response, Supplier> getNext) { + super(hasNext, items, response, getNext); + } + + public SyncPagingIterable( + boolean hasNext, Optional> items, Object response, Supplier> getNext) { + super(hasNext, items.orElse(new ArrayList<>()), response, getNext); + } + + public Stream streamItems() { + return StreamSupport.stream(this.spliterator(), false); + } + + @Override + public Iterator iterator() { + return new Iterator() { + private Iterator itemsIterator = getItems().iterator(); + private SyncPage currentPage = SyncPagingIterable.this; + + @Override + public boolean hasNext() { + if (itemsIterator.hasNext()) { + return true; + } + if (currentPage.hasNext()) { + advancePage(); + return itemsIterator.hasNext(); + } + return false; + } + + @Override + public T next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return itemsIterator.next(); + } + + private void advancePage() { + currentPage = currentPage.nextPage(); + itemsIterator = currentPage.getItems().iterator(); + } + }; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/AsyncEmailsClient.java b/src/main/java/com/auth0/client/mgmt/emails/AsyncEmailsClient.java new file mode 100644 index 000000000..3bc022a98 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/AsyncEmailsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncEmailsClient { + protected final ClientOptions clientOptions; + + protected final Supplier providerClient; + + public AsyncEmailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.providerClient = Suppliers.memoize(() -> new AsyncProviderClient(clientOptions)); + } + + public AsyncProviderClient provider() { + return this.providerClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/AsyncProviderClient.java b/src/main/java/com/auth0/client/mgmt/emails/AsyncProviderClient.java new file mode 100644 index 000000000..4b10e0607 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/AsyncProviderClient.java @@ -0,0 +1,304 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; +import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; +import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; +import com.auth0.client.mgmt.types.CreateEmailProviderResponseContent; +import com.auth0.client.mgmt.types.GetEmailProviderResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailProviderResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncProviderClient { + protected final ClientOptions clientOptions; + + private final AsyncRawProviderClient rawClient; + + public AsyncProviderClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawProviderClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawProviderClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get(GetEmailProviderRequestParameters request) { + return this.rawClient.get(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get( + GetEmailProviderRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture create(CreateEmailProviderRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture create( + CreateEmailProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete the email provider. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete the email provider. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture update(UpdateEmailProviderRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture update( + UpdateEmailProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java b/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java new file mode 100644 index 000000000..516865c90 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java @@ -0,0 +1,631 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; +import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; +import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEmailProviderResponseContent; +import com.auth0.client.mgmt.types.GetEmailProviderResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailProviderResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawProviderClient { + protected final ClientOptions clientOptions; + + public AsyncRawProviderClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get() { + return get(GetEmailProviderRequestParameters.builder().build()); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get( + GetEmailProviderRequestParameters request) { + return get(request, null); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get( + GetEmailProviderRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEmailProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture> create( + CreateEmailProviderRequestContent request) { + return create(request, null); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture> create( + CreateEmailProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEmailProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete the email provider. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete the email provider. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture> update() { + return update(UpdateEmailProviderRequestContent.builder().build()); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture> update( + UpdateEmailProviderRequestContent request) { + return update(request, null); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CompletableFuture> update( + UpdateEmailProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateEmailProviderResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/EmailsClient.java b/src/main/java/com/auth0/client/mgmt/emails/EmailsClient.java new file mode 100644 index 000000000..63af4d1d7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/EmailsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class EmailsClient { + protected final ClientOptions clientOptions; + + protected final Supplier providerClient; + + public EmailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.providerClient = Suppliers.memoize(() -> new ProviderClient(clientOptions)); + } + + public ProviderClient provider() { + return this.providerClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/ProviderClient.java b/src/main/java/com/auth0/client/mgmt/emails/ProviderClient.java new file mode 100644 index 000000000..b4003e0a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/ProviderClient.java @@ -0,0 +1,303 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; +import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; +import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; +import com.auth0.client.mgmt.types.CreateEmailProviderResponseContent; +import com.auth0.client.mgmt.types.GetEmailProviderResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailProviderResponseContent; + +public class ProviderClient { + protected final ClientOptions clientOptions; + + private final RawProviderClient rawClient; + + public ProviderClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawProviderClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawProviderClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public GetEmailProviderResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public GetEmailProviderResponseContent get(GetEmailProviderRequestParameters request) { + return this.rawClient.get(request).body(); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public GetEmailProviderResponseContent get( + GetEmailProviderRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(request, requestOptions).body(); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CreateEmailProviderResponseContent create(CreateEmailProviderRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public CreateEmailProviderResponseContent create( + CreateEmailProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Delete the email provider. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete the email provider. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public UpdateEmailProviderResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public UpdateEmailProviderResponseContent update(UpdateEmailProviderRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public UpdateEmailProviderResponseContent update( + UpdateEmailProviderRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/RawProviderClient.java b/src/main/java/com/auth0/client/mgmt/emails/RawProviderClient.java new file mode 100644 index 000000000..4629c6c84 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/RawProviderClient.java @@ -0,0 +1,528 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; +import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; +import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateEmailProviderResponseContent; +import com.auth0.client.mgmt.types.GetEmailProviderResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailProviderResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawProviderClient { + protected final ClientOptions clientOptions; + + public RawProviderClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get() { + return get(GetEmailProviderRequestParameters.builder().build()); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get(GetEmailProviderRequestParameters request) { + return get(request, null); + } + + /** + * Retrieve details of the <a href="https://auth0.com/docs/customize/email/smtp-email-providers">email provider configuration</a> in your tenant. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get( + GetEmailProviderRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetEmailProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse create( + CreateEmailProviderRequestContent request) { + return create(request, null); + } + + /** + * Create an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * </li> + * <li> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse create( + CreateEmailProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEmailProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete the email provider. + */ + public ManagementApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete the email provider. + */ + public ManagementApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse update() { + return update(UpdateEmailProviderRequestContent.builder().build()); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse update( + UpdateEmailProviderRequestContent request) { + return update(request, null); + } + + /** + * Update an <a href="https://auth0.com/docs/email/providers">email provider</a>. The <code>credentials</code> object + * requires different properties depending on the email provider (which is specified using the <code>name</code> property): + *

<ul> + * <li><code>mandrill</code> requires <code>api_key</code></li> + * <li><code>sendgrid</code> requires <code>api_key</code></li> + * <li> + * <code>sparkpost</code> requires <code>api_key</code>. Optionally, set <code>region</code> to <code>eu</code> to use + * the SparkPost service hosted in Western Europe; set to <code>null</code> to use the SparkPost service hosted in + * North America. <code>eu</code> or <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li> + * <code>mailgun</code> requires <code>api_key</code> and <code>domain</code>. Optionally, set <code>region</code> to + * <code>eu</code> to use the Mailgun service hosted in Europe; set to <code>null</code> otherwise. <code>eu</code> or + * <code>null</code> are the only valid values for <code>region</code>. + * </li> + * <li><code>ses</code> requires <code>accessKeyId</code>, <code>secretAccessKey</code>, and <code>region</code></li> + * <li> + * <code>smtp</code> requires <code>smtp_host</code>, <code>smtp_port</code>, <code>smtp_user</code>, and + * <code>smtp_pass</code> + * </li> + * </ul> + * Depending on the type of provider it is possible to specify <code>settings</code> object with different configuration + * options, which will be used when sending an email: + * <ul> + * <li> + * <code>smtp</code> provider, <code>settings</code> may contain <code>headers</code> object. + * <ul> + * <li> + * When using AWS SES SMTP host, you may provide a name of configuration set in + * <code>X-SES-Configuration-Set</code> header. Value must be a string. + * </li> + * <li> + * When using Sparkpost host, you may provide value for + * <code>X-MSYS_API</code> header. Value must be an object. + * </li> + * </ul> + * for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide + * a name of configuration set in <code>configuration_set_name</code> property. Value must be a string. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse update( + UpdateEmailProviderRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("emails/provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateEmailProviderResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java new file mode 100644 index 000000000..556c5738a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java @@ -0,0 +1,288 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.EmailProviderCredentialsSchema; +import com.auth0.client.mgmt.types.EmailProviderNameEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEmailProviderRequestContent.Builder.class) +public final class CreateEmailProviderRequestContent { + private final EmailProviderNameEnum name; + + private final Optional enabled; + + private final Optional defaultFromAddress; + + private final EmailProviderCredentialsSchema credentials; + + private final OptionalNullable> settings; + + private final Map additionalProperties; + + private CreateEmailProviderRequestContent( + EmailProviderNameEnum name, + Optional enabled, + Optional defaultFromAddress, + EmailProviderCredentialsSchema credentials, + OptionalNullable> settings, + Map additionalProperties) { + this.name = name; + this.enabled = enabled; + this.defaultFromAddress = defaultFromAddress; + this.credentials = credentials; + this.settings = settings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public EmailProviderNameEnum getName() { + return name; + } + + /** + * @return Whether the provider is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Email address to use as "from" when no other address specified. + */ + @JsonProperty("default_from_address") + public Optional getDefaultFromAddress() { + return defaultFromAddress; + } + + @JsonProperty("credentials") + public EmailProviderCredentialsSchema getCredentials() { + return credentials; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("settings") + public OptionalNullable> getSettings() { + if (settings == null) { + return OptionalNullable.absent(); + } + return settings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("settings") + private OptionalNullable> _getSettings() { + return settings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEmailProviderRequestContent && equalTo((CreateEmailProviderRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEmailProviderRequestContent other) { + return name.equals(other.name) + && enabled.equals(other.enabled) + && defaultFromAddress.equals(other.defaultFromAddress) + && credentials.equals(other.credentials) + && settings.equals(other.settings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CredentialsStage name(@NotNull EmailProviderNameEnum name); + + Builder from(CreateEmailProviderRequestContent other); + } + + public interface CredentialsStage { + _FinalStage credentials(@NotNull EmailProviderCredentialsSchema credentials); + } + + public interface _FinalStage { + CreateEmailProviderRequestContent build(); + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(Boolean enabled); + + /** + *

Email address to use as "from" when no other address specified.

+ */ + _FinalStage defaultFromAddress(Optional defaultFromAddress); + + _FinalStage defaultFromAddress(String defaultFromAddress); + + _FinalStage settings(@Nullable OptionalNullable> settings); + + _FinalStage settings(Map settings); + + _FinalStage settings(Optional> settings); + + _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CredentialsStage, _FinalStage { + private EmailProviderNameEnum name; + + private EmailProviderCredentialsSchema credentials; + + private OptionalNullable> settings = OptionalNullable.absent(); + + private Optional defaultFromAddress = Optional.empty(); + + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEmailProviderRequestContent other) { + name(other.getName()); + enabled(other.getEnabled()); + defaultFromAddress(other.getDefaultFromAddress()); + credentials(other.getCredentials()); + settings(other.getSettings()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CredentialsStage name(@NotNull EmailProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("credentials") + public _FinalStage credentials(@NotNull EmailProviderCredentialsSchema credentials) { + this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings) { + if (settings.isNull()) { + this.settings = OptionalNullable.ofNull(); + } else if (settings.isEmpty()) { + this.settings = OptionalNullable.absent(); + } else { + this.settings = OptionalNullable.of(settings.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage settings(Optional> settings) { + if (settings.isPresent()) { + this.settings = OptionalNullable.of(settings.get()); + } else { + this.settings = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage settings(Map settings) { + this.settings = OptionalNullable.of(settings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "settings", nulls = Nulls.SKIP) + public _FinalStage settings(@Nullable OptionalNullable> settings) { + this.settings = settings; + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultFromAddress(String defaultFromAddress) { + this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ */ + @java.lang.Override + @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) + public _FinalStage defaultFromAddress(Optional defaultFromAddress) { + this.defaultFromAddress = defaultFromAddress; + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + @java.lang.Override + public CreateEmailProviderRequestContent build() { + return new CreateEmailProviderRequestContent( + name, enabled, defaultFromAddress, credentials, settings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java new file mode 100644 index 000000000..df18ed7be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEmailProviderRequestParameters.Builder.class) +public final class GetEmailProviderRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetEmailProviderRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve name and enabled. Additional fields available include credentials, default_from_address, and settings. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEmailProviderRequestParameters && equalTo((GetEmailProviderRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEmailProviderRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetEmailProviderRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve name and enabled. Additional fields available include credentials, default_from_address, and settings.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetEmailProviderRequestParameters build() { + return new GetEmailProviderRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java new file mode 100644 index 000000000..54dd8275c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.emails.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.EmailProviderCredentialsSchema; +import com.auth0.client.mgmt.types.EmailProviderNameEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEmailProviderRequestContent.Builder.class) +public final class UpdateEmailProviderRequestContent { + private final Optional name; + + private final Optional enabled; + + private final Optional defaultFromAddress; + + private final Optional credentials; + + private final OptionalNullable> settings; + + private final Map additionalProperties; + + private UpdateEmailProviderRequestContent( + Optional name, + Optional enabled, + Optional defaultFromAddress, + Optional credentials, + OptionalNullable> settings, + Map additionalProperties) { + this.name = name; + this.enabled = enabled; + this.defaultFromAddress = defaultFromAddress; + this.credentials = credentials; + this.settings = settings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the provider is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Email address to use as "from" when no other address specified. + */ + @JsonProperty("default_from_address") + public Optional getDefaultFromAddress() { + return defaultFromAddress; + } + + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("settings") + public OptionalNullable> getSettings() { + if (settings == null) { + return OptionalNullable.absent(); + } + return settings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("settings") + private OptionalNullable> _getSettings() { + return settings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEmailProviderRequestContent && equalTo((UpdateEmailProviderRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEmailProviderRequestContent other) { + return name.equals(other.name) + && enabled.equals(other.enabled) + && defaultFromAddress.equals(other.defaultFromAddress) + && credentials.equals(other.credentials) + && settings.equals(other.settings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional defaultFromAddress = Optional.empty(); + + private Optional credentials = Optional.empty(); + + private OptionalNullable> settings = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateEmailProviderRequestContent other) { + name(other.getName()); + enabled(other.getEnabled()); + defaultFromAddress(other.getDefaultFromAddress()); + credentials(other.getCredentials()); + settings(other.getSettings()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(EmailProviderNameEnum name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ */ + @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) + public Builder defaultFromAddress(Optional defaultFromAddress) { + this.defaultFromAddress = defaultFromAddress; + return this; + } + + public Builder defaultFromAddress(String defaultFromAddress) { + this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(EmailProviderCredentialsSchema credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + @JsonSetter(value = "settings", nulls = Nulls.SKIP) + public Builder settings(@Nullable OptionalNullable> settings) { + this.settings = settings; + return this; + } + + public Builder settings(Map settings) { + this.settings = OptionalNullable.of(settings); + return this; + } + + public Builder settings(Optional> settings) { + if (settings.isPresent()) { + this.settings = OptionalNullable.of(settings.get()); + } else { + this.settings = OptionalNullable.absent(); + } + return this; + } + + public Builder settings(com.auth0.client.mgmt.core.Nullable> settings) { + if (settings.isNull()) { + this.settings = OptionalNullable.ofNull(); + } else if (settings.isEmpty()) { + this.settings = OptionalNullable.absent(); + } else { + this.settings = OptionalNullable.of(settings.get()); + } + return this; + } + + public UpdateEmailProviderRequestContent build() { + return new UpdateEmailProviderRequestContent( + name, enabled, defaultFromAddress, credentials, settings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java new file mode 100644 index 000000000..5998d5628 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class BadRequestError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public BadRequestError(Object body) { + super("BadRequestError", 400, body); + this.body = body; + } + + public BadRequestError(Object body, Response rawResponse) { + super("BadRequestError", 400, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java new file mode 100644 index 000000000..53940ac20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class ConflictError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public ConflictError(Object body) { + super("ConflictError", 409, body); + this.body = body; + } + + public ConflictError(Object body, Response rawResponse) { + super("ConflictError", 409, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java new file mode 100644 index 000000000..0b56d4a30 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class ContentTooLargeError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public ContentTooLargeError(Object body) { + super("ContentTooLargeError", 413, body); + this.body = body; + } + + public ContentTooLargeError(Object body, Response rawResponse) { + super("ContentTooLargeError", 413, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java new file mode 100644 index 000000000..6648b7af1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class ForbiddenError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public ForbiddenError(Object body) { + super("ForbiddenError", 403, body); + this.body = body; + } + + public ForbiddenError(Object body, Response rawResponse) { + super("ForbiddenError", 403, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java new file mode 100644 index 000000000..bbe615ac0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class InternalServerError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public InternalServerError(Object body) { + super("InternalServerError", 500, body); + this.body = body; + } + + public InternalServerError(Object body, Response rawResponse) { + super("InternalServerError", 500, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java new file mode 100644 index 000000000..e3b072d83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class NotFoundError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public NotFoundError(Object body) { + super("NotFoundError", 404, body); + this.body = body; + } + + public NotFoundError(Object body, Response rawResponse) { + super("NotFoundError", 404, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java new file mode 100644 index 000000000..7cef21310 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class PaymentRequiredError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public PaymentRequiredError(Object body) { + super("PaymentRequiredError", 402, body); + this.body = body; + } + + public PaymentRequiredError(Object body, Response rawResponse) { + super("PaymentRequiredError", 402, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java new file mode 100644 index 000000000..30f466141 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class ServiceUnavailableError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public ServiceUnavailableError(Object body) { + super("ServiceUnavailableError", 503, body); + this.body = body; + } + + public ServiceUnavailableError(Object body, Response rawResponse) { + super("ServiceUnavailableError", 503, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java new file mode 100644 index 000000000..cae04a023 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class TooManyRequestsError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public TooManyRequestsError(Object body) { + super("TooManyRequestsError", 429, body); + this.body = body; + } + + public TooManyRequestsError(Object body, Response rawResponse) { + super("TooManyRequestsError", 429, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java new file mode 100644 index 000000000..a766ae2d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.errors; + +import com.auth0.client.mgmt.core.ManagementApiException; +import okhttp3.Response; + +public final class UnauthorizedError extends ManagementApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public UnauthorizedError(Object body) { + super("UnauthorizedError", 401, body); + this.body = body; + } + + public UnauthorizedError(Object body, Response rawResponse) { + super("UnauthorizedError", 401, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncDeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncDeliveriesClient.java new file mode 100644 index 000000000..342ff8d23 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncDeliveriesClient.java @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; +import com.auth0.client.mgmt.types.EventStreamDelivery; +import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeliveriesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeliveriesClient rawClient; + + public AsyncDeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeliveriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeliveriesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListEventStreamDeliveriesRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListEventStreamDeliveriesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getHistory(String id, String eventId) { + return this.rawClient.getHistory(id, eventId).thenApply(response -> response.body()); + } + + public CompletableFuture getHistory( + String id, String eventId, RequestOptions requestOptions) { + return this.rawClient.getHistory(id, eventId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java new file mode 100644 index 000000000..f9f72e797 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; +import com.auth0.client.mgmt.types.EventStreamDelivery; +import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeliveriesClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list(String id) { + return list(id, ListEventStreamDeliveriesRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + String id, ListEventStreamDeliveriesRequestParameters request) { + return list(id, request, null); + } + + public CompletableFuture>> list( + String id, ListEventStreamDeliveriesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("deliveries"); + QueryStringMapper.addQueryParameter(httpUrl, "statuses", request.getStatuses(), false); + QueryStringMapper.addQueryParameter(httpUrl, "event_types", request.getEventTypes(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> getHistory( + String id, String eventId) { + return getHistory(id, eventId, null); + } + + public CompletableFuture> getHistory( + String id, String eventId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("deliveries") + .addPathSegment(eventId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEventStreamDeliveryHistoryResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawRedeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawRedeliveriesClient.java new file mode 100644 index 000000000..870028b5b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawRedeliveriesClient.java @@ -0,0 +1,218 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.eventstreams.types.CreateEventStreamRedeliveryRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamRedeliveryResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRedeliveriesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRedeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> create(String id) { + return create(id, CreateEventStreamRedeliveryRequestContent.builder().build()); + } + + public CompletableFuture> create( + String id, CreateEventStreamRedeliveryRequestContent request) { + return create(id, request, null); + } + + public CompletableFuture> create( + String id, CreateEventStreamRedeliveryRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("redeliver") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEventStreamRedeliveryResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> createById(String id, String eventId) { + return createById(id, eventId, null); + } + + public CompletableFuture> createById( + String id, String eventId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("redeliver") + .addPathSegment(eventId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRedeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRedeliveriesClient.java new file mode 100644 index 000000000..b9ae128e5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRedeliveriesClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.eventstreams.types.CreateEventStreamRedeliveryRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamRedeliveryResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncRedeliveriesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRedeliveriesClient rawClient; + + public AsyncRedeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRedeliveriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRedeliveriesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, CreateEventStreamRedeliveryRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, CreateEventStreamRedeliveryRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture createById(String id, String eventId) { + return this.rawClient.createById(id, eventId).thenApply(response -> response.body()); + } + + public CompletableFuture createById(String id, String eventId, RequestOptions requestOptions) { + return this.rawClient.createById(id, eventId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/DeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/DeliveriesClient.java new file mode 100644 index 000000000..e4447c2d6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/DeliveriesClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; +import com.auth0.client.mgmt.types.EventStreamDelivery; +import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; +import java.util.List; + +public class DeliveriesClient { + protected final ClientOptions clientOptions; + + private final RawDeliveriesClient rawClient; + + public DeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeliveriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeliveriesClient withRawResponse() { + return this.rawClient; + } + + public List list(String id) { + return this.rawClient.list(id).body(); + } + + public List list(String id, ListEventStreamDeliveriesRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + public List list( + String id, ListEventStreamDeliveriesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + public GetEventStreamDeliveryHistoryResponseContent getHistory(String id, String eventId) { + return this.rawClient.getHistory(id, eventId).body(); + } + + public GetEventStreamDeliveryHistoryResponseContent getHistory( + String id, String eventId, RequestOptions requestOptions) { + return this.rawClient.getHistory(id, eventId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java new file mode 100644 index 000000000..9f2e82ef4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; +import com.auth0.client.mgmt.types.EventStreamDelivery; +import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeliveriesClient { + protected final ClientOptions clientOptions; + + public RawDeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list(String id) { + return list(id, ListEventStreamDeliveriesRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list( + String id, ListEventStreamDeliveriesRequestParameters request) { + return list(id, request, null); + } + + public ManagementApiHttpResponse> list( + String id, ListEventStreamDeliveriesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("deliveries"); + QueryStringMapper.addQueryParameter(httpUrl, "statuses", request.getStatuses(), false); + QueryStringMapper.addQueryParameter(httpUrl, "event_types", request.getEventTypes(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse getHistory( + String id, String eventId) { + return getHistory(id, eventId, null); + } + + public ManagementApiHttpResponse getHistory( + String id, String eventId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("deliveries") + .addPathSegment(eventId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEventStreamDeliveryHistoryResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/RawRedeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/RawRedeliveriesClient.java new file mode 100644 index 000000000..251d36d88 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/RawRedeliveriesClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.eventstreams.types.CreateEventStreamRedeliveryRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamRedeliveryResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRedeliveriesClient { + protected final ClientOptions clientOptions; + + public RawRedeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse create(String id) { + return create(id, CreateEventStreamRedeliveryRequestContent.builder().build()); + } + + public ManagementApiHttpResponse create( + String id, CreateEventStreamRedeliveryRequestContent request) { + return create(id, request, null); + } + + public ManagementApiHttpResponse create( + String id, CreateEventStreamRedeliveryRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("redeliver") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEventStreamRedeliveryResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse createById(String id, String eventId) { + return createById(id, eventId, null); + } + + public ManagementApiHttpResponse createById(String id, String eventId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("event-streams") + .addPathSegment(id) + .addPathSegments("redeliver") + .addPathSegment(eventId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/RedeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/RedeliveriesClient.java new file mode 100644 index 000000000..3ab86d00e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/RedeliveriesClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.eventstreams.types.CreateEventStreamRedeliveryRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamRedeliveryResponseContent; + +public class RedeliveriesClient { + protected final ClientOptions clientOptions; + + private final RawRedeliveriesClient rawClient; + + public RedeliveriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRedeliveriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRedeliveriesClient withRawResponse() { + return this.rawClient; + } + + public CreateEventStreamRedeliveryResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + public CreateEventStreamRedeliveryResponseContent create( + String id, CreateEventStreamRedeliveryRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + public CreateEventStreamRedeliveryResponseContent create( + String id, CreateEventStreamRedeliveryRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + public void createById(String id, String eventId) { + this.rawClient.createById(id, eventId).body(); + } + + public void createById(String id, String eventId, RequestOptions requestOptions) { + this.rawClient.createById(id, eventId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java new file mode 100644 index 000000000..a076ccb1c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.EventStreamEventTypeEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamRedeliveryRequestContent.Builder.class) +public final class CreateEventStreamRedeliveryRequestContent { + private final Optional dateFrom; + + private final Optional dateTo; + + private final Optional> statuses; + + private final Optional> eventTypes; + + private final Map additionalProperties; + + private CreateEventStreamRedeliveryRequestContent( + Optional dateFrom, + Optional dateTo, + Optional> statuses, + Optional> eventTypes, + Map additionalProperties) { + this.dateFrom = dateFrom; + this.dateTo = dateTo; + this.statuses = statuses; + this.eventTypes = eventTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. + */ + @JsonProperty("date_from") + public Optional getDateFrom() { + return dateFrom; + } + + /** + * @return An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + */ + @JsonProperty("date_to") + public Optional getDateTo() { + return dateTo; + } + + /** + * @return Filter by status + */ + @JsonProperty("statuses") + public Optional> getStatuses() { + return statuses; + } + + /** + * @return Filter by event type + */ + @JsonProperty("event_types") + public Optional> getEventTypes() { + return eventTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamRedeliveryRequestContent + && equalTo((CreateEventStreamRedeliveryRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamRedeliveryRequestContent other) { + return dateFrom.equals(other.dateFrom) + && dateTo.equals(other.dateTo) + && statuses.equals(other.statuses) + && eventTypes.equals(other.eventTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional dateFrom = Optional.empty(); + + private Optional dateTo = Optional.empty(); + + private Optional> statuses = Optional.empty(); + + private Optional> eventTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateEventStreamRedeliveryRequestContent other) { + dateFrom(other.getDateFrom()); + dateTo(other.getDateTo()); + statuses(other.getStatuses()); + eventTypes(other.getEventTypes()); + return this; + } + + /** + *

An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_from", nulls = Nulls.SKIP) + public Builder dateFrom(Optional dateFrom) { + this.dateFrom = dateFrom; + return this; + } + + public Builder dateFrom(OffsetDateTime dateFrom) { + this.dateFrom = Optional.ofNullable(dateFrom); + return this; + } + + /** + *

An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_to", nulls = Nulls.SKIP) + public Builder dateTo(Optional dateTo) { + this.dateTo = dateTo; + return this; + } + + public Builder dateTo(OffsetDateTime dateTo) { + this.dateTo = Optional.ofNullable(dateTo); + return this; + } + + /** + *

Filter by status

+ */ + @JsonSetter(value = "statuses", nulls = Nulls.SKIP) + public Builder statuses(Optional> statuses) { + this.statuses = statuses; + return this; + } + + public Builder statuses(List statuses) { + this.statuses = Optional.ofNullable(statuses); + return this; + } + + /** + *

Filter by event type

+ */ + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public Builder eventTypes(Optional> eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder eventTypes(List eventTypes) { + this.eventTypes = Optional.ofNullable(eventTypes); + return this; + } + + public CreateEventStreamRedeliveryRequestContent build() { + return new CreateEventStreamRedeliveryRequestContent( + dateFrom, dateTo, statuses, eventTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java new file mode 100644 index 000000000..02389dd4a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java @@ -0,0 +1,429 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.eventstreams.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListEventStreamDeliveriesRequestParameters.Builder.class) +public final class ListEventStreamDeliveriesRequestParameters { + private final OptionalNullable statuses; + + private final OptionalNullable eventTypes; + + private final OptionalNullable dateFrom; + + private final OptionalNullable dateTo; + + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListEventStreamDeliveriesRequestParameters( + OptionalNullable statuses, + OptionalNullable eventTypes, + OptionalNullable dateFrom, + OptionalNullable dateTo, + OptionalNullable from, + OptionalNullable take, + Map additionalProperties) { + this.statuses = statuses; + this.eventTypes = eventTypes; + this.dateFrom = dateFrom; + this.dateTo = dateTo; + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of statuses by which to filter + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("statuses") + public OptionalNullable getStatuses() { + if (statuses == null) { + return OptionalNullable.absent(); + } + return statuses; + } + + /** + * @return Comma-separated list of event types by which to filter + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("event_types") + public OptionalNullable getEventTypes() { + if (eventTypes == null) { + return OptionalNullable.absent(); + } + return eventTypes; + } + + /** + * @return An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_from") + public OptionalNullable getDateFrom() { + if (dateFrom == null) { + return OptionalNullable.absent(); + } + return dateFrom; + } + + /** + * @return An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_to") + public OptionalNullable getDateTo() { + if (dateTo == null) { + return OptionalNullable.absent(); + } + return dateTo; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("statuses") + private OptionalNullable _getStatuses() { + return statuses; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("event_types") + private OptionalNullable _getEventTypes() { + return eventTypes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_from") + private OptionalNullable _getDateFrom() { + return dateFrom; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_to") + private OptionalNullable _getDateTo() { + return dateTo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListEventStreamDeliveriesRequestParameters + && equalTo((ListEventStreamDeliveriesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListEventStreamDeliveriesRequestParameters other) { + return statuses.equals(other.statuses) + && eventTypes.equals(other.eventTypes) + && dateFrom.equals(other.dateFrom) + && dateTo.equals(other.dateTo) + && from.equals(other.from) + && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.statuses, this.eventTypes, this.dateFrom, this.dateTo, this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable statuses = OptionalNullable.absent(); + + private OptionalNullable eventTypes = OptionalNullable.absent(); + + private OptionalNullable dateFrom = OptionalNullable.absent(); + + private OptionalNullable dateTo = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListEventStreamDeliveriesRequestParameters other) { + statuses(other.getStatuses()); + eventTypes(other.getEventTypes()); + dateFrom(other.getDateFrom()); + dateTo(other.getDateTo()); + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Comma-separated list of statuses by which to filter

+ */ + @JsonSetter(value = "statuses", nulls = Nulls.SKIP) + public Builder statuses(@Nullable OptionalNullable statuses) { + this.statuses = statuses; + return this; + } + + public Builder statuses(String statuses) { + this.statuses = OptionalNullable.of(statuses); + return this; + } + + public Builder statuses(Optional statuses) { + if (statuses.isPresent()) { + this.statuses = OptionalNullable.of(statuses.get()); + } else { + this.statuses = OptionalNullable.absent(); + } + return this; + } + + public Builder statuses(com.auth0.client.mgmt.core.Nullable statuses) { + if (statuses.isNull()) { + this.statuses = OptionalNullable.ofNull(); + } else if (statuses.isEmpty()) { + this.statuses = OptionalNullable.absent(); + } else { + this.statuses = OptionalNullable.of(statuses.get()); + } + return this; + } + + /** + *

Comma-separated list of event types by which to filter

+ */ + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public Builder eventTypes(@Nullable OptionalNullable eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder eventTypes(String eventTypes) { + this.eventTypes = OptionalNullable.of(eventTypes); + return this; + } + + public Builder eventTypes(Optional eventTypes) { + if (eventTypes.isPresent()) { + this.eventTypes = OptionalNullable.of(eventTypes.get()); + } else { + this.eventTypes = OptionalNullable.absent(); + } + return this; + } + + public Builder eventTypes(com.auth0.client.mgmt.core.Nullable eventTypes) { + if (eventTypes.isNull()) { + this.eventTypes = OptionalNullable.ofNull(); + } else if (eventTypes.isEmpty()) { + this.eventTypes = OptionalNullable.absent(); + } else { + this.eventTypes = OptionalNullable.of(eventTypes.get()); + } + return this; + } + + /** + *

An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_from", nulls = Nulls.SKIP) + public Builder dateFrom(@Nullable OptionalNullable dateFrom) { + this.dateFrom = dateFrom; + return this; + } + + public Builder dateFrom(String dateFrom) { + this.dateFrom = OptionalNullable.of(dateFrom); + return this; + } + + public Builder dateFrom(Optional dateFrom) { + if (dateFrom.isPresent()) { + this.dateFrom = OptionalNullable.of(dateFrom.get()); + } else { + this.dateFrom = OptionalNullable.absent(); + } + return this; + } + + public Builder dateFrom(com.auth0.client.mgmt.core.Nullable dateFrom) { + if (dateFrom.isNull()) { + this.dateFrom = OptionalNullable.ofNull(); + } else if (dateFrom.isEmpty()) { + this.dateFrom = OptionalNullable.absent(); + } else { + this.dateFrom = OptionalNullable.of(dateFrom.get()); + } + return this; + } + + /** + *

An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_to", nulls = Nulls.SKIP) + public Builder dateTo(@Nullable OptionalNullable dateTo) { + this.dateTo = dateTo; + return this; + } + + public Builder dateTo(String dateTo) { + this.dateTo = OptionalNullable.of(dateTo); + return this; + } + + public Builder dateTo(Optional dateTo) { + if (dateTo.isPresent()) { + this.dateTo = OptionalNullable.of(dateTo.get()); + } else { + this.dateTo = OptionalNullable.absent(); + } + return this; + } + + public Builder dateTo(com.auth0.client.mgmt.core.Nullable dateTo) { + if (dateTo.isNull()) { + this.dateTo = OptionalNullable.ofNull(); + } else if (dateTo.isEmpty()) { + this.dateTo = OptionalNullable.absent(); + } else { + this.dateTo = OptionalNullable.of(dateTo.get()); + } + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListEventStreamDeliveriesRequestParameters build() { + return new ListEventStreamDeliveriesRequestParameters( + statuses, eventTypes, dateFrom, dateTo, from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/filter/ActionsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/ActionsFilter.java deleted file mode 100644 index 8b5e05595..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/ActionsFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Used to filter the results when getting all actions. - * @see com.auth0.client.mgmt.ActionsEntity#list(ActionsFilter) - */ -public class ActionsFilter extends BaseFilter { - - /** - * Filters the result by a trigger ID - * @param triggerId the trigger ID to filter the results by - * @return this filter instance - */ - public ActionsFilter withTriggerId(String triggerId) { - parameters.put("triggerId", triggerId); - return this; - } - - /** - * Filters the result by the name of an action - * @param actionName the name of the action to filter by - * @return this filter instance - */ - public ActionsFilter withActionName(String actionName) { - parameters.put("actionName", actionName); - return this; - } - - /** - * Filters the result by its deployment status - * @param deployed when {@code true}, only deployed actions will be returned - * @return this filter instance - */ - public ActionsFilter withDeployed(Boolean deployed) { - parameters.put("deployed", deployed); - return this; - } - - /** - * Filters the result by its installation status - * @param installed when {@code true}, only installed actions will be returned - * @return this filter instance - */ - public ActionsFilter withInstalled(Boolean installed) { - parameters.put("installed", installed); - return this; - } - - /** - * Filter by page - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public ActionsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/BaseFilter.java b/src/main/java/com/auth0/client/mgmt/filter/BaseFilter.java deleted file mode 100644 index c70c9fe27..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/BaseFilter.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import java.util.HashMap; -import java.util.Map; - -/** - * Base class that keeps the parameters that each filter requires. - *

- * This class is not thread-safe: - * It makes use of {@link HashMap} for storing the parameters. Make sure to not call the builder methods - * from a different or un-synchronized thread. - */ -public abstract class BaseFilter { - protected final Map parameters = new HashMap<>(); - - public Map getAsMap() { - return parameters; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java b/src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java deleted file mode 100644 index 0ce98687b..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Clients endpoint. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class ClientFilter extends FieldsFilter { - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public ClientFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public ClientFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Filter by global clients - * - * @param isGlobal whether the client should or not be global - * @return this filter instance - */ - public ClientFilter withIsGlobal(boolean isGlobal) { - parameters.put("is_global", isGlobal); - return this; - } - - /** - * Filter by first party clients - * - * @param isFirstParty whether the client should or not be first party - * @return this filter instance - */ - public ClientFilter withIsFirstParty(boolean isFirstParty) { - parameters.put("is_first_party", isFirstParty); - return this; - } - - /** - * Filter by application type - * - * @param appType A comma separated list of application types used to filter the returned clients (native, spa, regular_web, non_interactive) - * @return this filter instance - */ - public ClientFilter withAppType(String appType) { - parameters.put("app_type", appType); - return this; - } - - @Override - public ClientFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - /** - * Filter by custom query - * - * @param query the query string using Lucene query syntax - * @return this filter instance - */ - public ClientFilter withQuery(String query) { - parameters.put("q", query); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java deleted file mode 100644 index 15da9b9e3..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Client Grants endpoint. Related to the {@link com.auth0.client.mgmt.ClientGrantsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class ClientGrantsFilter extends BaseFilter { - - /** - * Filter by client id - * - * @param clientId only retrieve items with this client id. - * @return this filter instance - */ - public ClientGrantsFilter withClientId(String clientId) { - parameters.put("client_id", clientId); - return this; - } - - /** - * Filter by audience - * - * @param audience only retrieve the item with this audience. - * @return this filter instance - */ - public ClientGrantsFilter withAudience(String audience) { - parameters.put("audience", audience); - return this; - } - - /** - * Filter by {@code allow_any_organization} - * @param allowAnyOrganization only retrieve items with the {@code allow_any_organization} value specfied. - * @return this filter instance. - */ - public ClientGrantsFilter withAllowAnyOrganization(Boolean allowAnyOrganization) { - parameters.put("allow_any_organization", allowAnyOrganization); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public ClientGrantsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public ClientGrantsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java b/src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java deleted file mode 100644 index d1a160f8f..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/ConnectionFilter.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Connections endpoint. Related to the {@link com.auth0.client.mgmt.ConnectionsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class ConnectionFilter extends FieldsFilter { - - /** - * Filter by strategy - * - * @param strategy only retrieve items with this strategy. - * @return this filter instance - */ - public ConnectionFilter withStrategy(String strategy) { - parameters.put("strategy", strategy); - return this; - } - - /** - * Filter by name - * - * @param name only retrieve the item with this name. - * @return this filter instance - */ - public ConnectionFilter withName(String name) { - parameters.put("name", name); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public ConnectionFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary. - * Warning: Can only be used with {@link com.auth0.client.mgmt.ConnectionsEntity#listAll(ConnectionFilter)} - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public ConnectionFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - @Override - public ConnectionFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - /** - * Include the {@code from} parameter to specify where to start the page selection. Only applicable for endpoints that - * support checkpoint pagination. - * @param from the ID from which to start selection. This can be obtained from the {@code next} field returned from - * a checkpoint-paginated result. - * @return this filter instance. - */ - public ConnectionFilter withFrom(String from) { - parameters.put("from", from); - return this; - } - - /** - * Include the {@code take} parameter to specify the amount of results to return per page. Only applicable for endpoints that - * support checkpoint pagination. - * @param take the amount of entries to retrieve per page. - * @return this filter instance. - */ - public ConnectionFilter withTake(int take) { - parameters.put("take", take); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilter.java deleted file mode 100644 index 1e3a96748..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilter.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Device Credentials endpoint. Related to the {@link com.auth0.client.mgmt.DeviceCredentialsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class DeviceCredentialsFilter extends FieldsFilter { - - /** - * Filter by user id - * - * @param userId only retrieve items with this user id. - * @return this filter instance. - */ - public DeviceCredentialsFilter withUserId(String userId) { - parameters.put("user_id", userId); - return this; - } - - /** - * Filter by application's client id - * - * @param clientId only retrieve items with this client id. - * @return this filter instance. - */ - public DeviceCredentialsFilter withClientId(String clientId) { - parameters.put("client_id", clientId); - return this; - } - - /** - * Filter by type - * - * @param type only retrieve items with this type. - * @return this filter instance. - */ - public DeviceCredentialsFilter withType(String type) { - parameters.put("type", type); - return this; - } - - @Override - public DeviceCredentialsFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public DeviceCredentialsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public DeviceCredentialsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/EnabledClientsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/EnabledClientsFilter.java deleted file mode 100644 index 65cea8a04..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/EnabledClientsFilter.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.client.mgmt.filter; - -public class EnabledClientsFilter extends BaseFilter { - /** - * Include the {@code from} parameter to specify where to start the page selection. Only applicable for endpoints that - * support checkpoint pagination. - * - * @param from the ID from which to start selection. This can be obtained from the {@code next} field returned from - * a checkpoint-paginated result. - * @return this filter instance. - */ - public EnabledClientsFilter withFrom(String from) { - parameters.put("from", from); - return this; - } - - /** - * Include the {@code take} parameter to specify the amount of results to return per page. Only applicable for endpoints that - * support checkpoint pagination. - * - * @param take the amount of entries to retrieve per page. - * @return this filter instance. - */ - public EnabledClientsFilter withTake(int take) { - parameters.put("take", take); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/EncryptionKeyFilter.java b/src/main/java/com/auth0/client/mgmt/filter/EncryptionKeyFilter.java deleted file mode 100644 index 2d9b18ff7..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/EncryptionKeyFilter.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.auth0.client.mgmt.filter; - -public class EncryptionKeyFilter extends BaseFilter { - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public EncryptionKeyFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public EncryptionKeyFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java deleted file mode 100644 index ceedc85c0..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling an Auth0 endpoint. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class FieldsFilter extends BaseFilter { - - /** - * Only retrieve certain fields from the item. - * - * @param fields a list of comma separated fields to retrieve. - * @param includeFields whether to include or exclude in the response the fields that were given. - * @return this filter instance - */ - public FieldsFilter withFields(String fields, boolean includeFields) { - parameters.put("fields", fields); - parameters.put("include_fields", includeFields); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/GrantsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/GrantsFilter.java deleted file mode 100644 index dadaad348..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/GrantsFilter.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Grants endpoint. Related to the {@link com.auth0.client.mgmt.GrantsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class GrantsFilter extends BaseFilter { - - /** - * Filter by client id - * - * @param clientId only retrieve items with this client id. - * @return this filter instance - */ - public GrantsFilter withClientId(String clientId) { - parameters.put("client_id", clientId); - return this; - } - - /** - * Filter by audience - * - * @param audience only retrieve the item with this audience. - * @return this filter instance - */ - public GrantsFilter withAudience(String audience) { - parameters.put("audience", audience); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public GrantsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public GrantsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/InvitationsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/InvitationsFilter.java deleted file mode 100644 index 6ac8b0160..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/InvitationsFilter.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when fetching invitations. Related to the {@linkplain com.auth0.client.mgmt.OrganizationsEntity}. - *

- * This class is not thread-safe. - */ -public class InvitationsFilter extends BaseFilter { - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public InvitationsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public InvitationsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Only retrieve certain fields from the item. - * - * @param fields a list of comma separated fields to retrieve. - * @param includeFields whether to include or exclude in the response the fields that were given. - * @return this filter instance - */ - public InvitationsFilter withFields(String fields, boolean includeFields) { - parameters.put("fields", fields); - parameters.put("include_fields", includeFields); - return this; - } - - /** - * Sort the query - * - * @param sort the field to use for sorting. Use 'field:order' where order is 1 for ascending and -1 for descending. - * @return this filter instance - */ - public InvitationsFilter withSort(String sort) { - parameters.put("sort", sort); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java b/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java deleted file mode 100644 index 195874b10..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Logs endpoint. Related to the {@link com.auth0.client.mgmt.LogEventsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class LogEventFilter extends QueryFilter { - - /** - * Filter by checkpoint - * - * @param from the log event id to start retrieving logs from. - * @param take the limit of items to retrieve. - * @return this filter instance - */ - public LogEventFilter withCheckpoint(String from, int take) { - parameters.put("from", from); - parameters.put("take", take); - return this; - } - - @Override - public LogEventFilter withTotals(boolean includeTotals) { - super.withTotals(includeTotals); - return this; - } - - @Override - public LogEventFilter withQuery(String query) { - super.withQuery(query); - return this; - } - - @Override - public LogEventFilter withSort(String sort) { - super.withSort(sort); - return this; - } - - @Override - public LogEventFilter withPage(int pageNumber, int amountPerPage) { - super.withPage(pageNumber, amountPerPage); - return this; - } - - @Override - public LogEventFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/NetworkAclsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/NetworkAclsFilter.java deleted file mode 100644 index c17624ddf..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/NetworkAclsFilter.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.client.mgmt.filter; - -public class NetworkAclsFilter extends BaseFilter { - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public NetworkAclsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public NetworkAclsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/OrganizationClientGrantsFilter.java b/src/main/java/com/auth0/client/mgmt/filter/OrganizationClientGrantsFilter.java deleted file mode 100644 index 5230a4145..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/OrganizationClientGrantsFilter.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when listing the client grants associated with an organization. - * Related to the {@link com.auth0.client.mgmt.OrganizationsEntity} entity. - */ -public class OrganizationClientGrantsFilter extends BaseFilter { - - /** - * Filter by client id - * - * @param clientId only retrieve items with this client id. - * @return this filter instance - */ - public OrganizationClientGrantsFilter withClientId(String clientId) { - parameters.put("client_id", clientId); - return this; - } - - /** - * Filter by audience - * - * @param audience only retrieve the item with this audience. - * @return this filter instance - */ - public OrganizationClientGrantsFilter withAudience(String audience) { - parameters.put("audience", audience); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public OrganizationClientGrantsFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public OrganizationClientGrantsFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Filter by grant IDs - * - * @param grantIds comma-separated list of grant IDs to filter results on. - * @return this filter instance - */ - public OrganizationClientGrantsFilter withGrantIds(String grantIds) { - parameters.put("grant_ids", grantIds); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilter.java b/src/main/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilter.java deleted file mode 100644 index a11b69b83..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class that represents a filter to be used when requesting a list of items with pagination. - */ -public class PageBasedPaginationFilter extends BaseFilter{ - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public PageBasedPaginationFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public PageBasedPaginationFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/PageFilter.java b/src/main/java/com/auth0/client/mgmt/filter/PageFilter.java deleted file mode 100644 index 15204c76c..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/PageFilter.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling an endpoint that supports Pagination. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class PageFilter extends BaseFilter { - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public PageFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public PageFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Include the {@code from} parameter to specify where to start the page selection. Only applicable for endpoints that - * support checkpoint pagination. - *

- * Note: If this or the {@linkplain PageFilter#withTake(int)} is specified, any offset paging parameters set - * via {@linkplain PageFilter#withPage(int, int)} or {@linkplain PageFilter#withTotals(boolean)} will be disregarded - * by the API. - *

- * @param from the ID from which to start selection. This can be obtained from the {@code next} field returned from - * a checkpoint-paginated result. - * @return this filter instance. - */ - public PageFilter withFrom(String from) { - parameters.put("from", from); - return this; - } - - /** - * Include the {@code take} parameter to specify the amount of results to return per page. Only applicable for endpoints that - * support checkpoint pagination. - *

- * Note: If this or the {@linkplain PageFilter#withFrom(String)} is specified, any offset paging parameters set - * via {@linkplain PageFilter#withPage(int, int)} or {@linkplain PageFilter#withTotals(boolean)} will be disregarded - * by the API. - *

- * @param take the amount of entries to retrieve per page. - * @return this filter instance. - */ - public PageFilter withTake(int take) { - parameters.put("take", take); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java b/src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java deleted file mode 100644 index 604e8c5f2..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; - -/** - * Class used to filter the results received when calling endpoints that accept a Query. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class QueryFilter extends FieldsFilter { - - public static final String KEY_QUERY = "q"; - - /** - * Filter by a query - * - * @param query the query expression to use - * @return this filter instance - */ - public QueryFilter withQuery(String query) { - try { - String encodedQuery = urlEncode(query); - parameters.put(KEY_QUERY, encodedQuery); - return this; - } catch (UnsupportedEncodingException ex) { - //"Every implementation of the Java platform is required to support the following standard charsets [...]: UTF-8" - //cf. https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html - throw new IllegalStateException("UTF-8 encoding not supported by current Java platform implementation.", ex); - } - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public QueryFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Sort the query - * - * @param sort the field to use for sorting. Use 'field:order' where order is 1 for ascending and -1 for descending. - * @return this filter instance - */ - public QueryFilter withSort(String sort) { - parameters.put("sort", sort); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public QueryFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - @Override - public QueryFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - //Visible for testing - String urlEncode(String query) throws UnsupportedEncodingException { - return URLEncoder.encode(query, "UTF-8"); - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/ResourceServersFilter.java b/src/main/java/com/auth0/client/mgmt/filter/ResourceServersFilter.java deleted file mode 100644 index ddf81dafb..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/ResourceServersFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Resource Servers endpoint. Related to the {@link com.auth0.client.mgmt.ResourceServerEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class ResourceServersFilter extends BaseFilter { - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public ResourceServersFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public ResourceServersFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Filter by specific identifier IDs (i.e. audience) - * - * @param identifiers the identifier IDs to filter by - * @return this filter instance - */ - public ResourceServersFilter withIdentifiers(String identifiers) { - parameters.put("identifiers", identifiers); - return this; - } - - /** - * Filter by checkpoint pagination support - * - * @param from the starting index identifier - * @param take the number of items to retrieve - * @return this filter instance - */ - public ResourceServersFilter withCheckpointPagination(String from, int take) { - parameters.put("from", from); - parameters.put("take", take); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/RolesFilter.java b/src/main/java/com/auth0/client/mgmt/filter/RolesFilter.java deleted file mode 100644 index a0d42760e..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/RolesFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Grants endpoint. Related to the {@link com.auth0.client.mgmt.RolesEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class RolesFilter extends PageFilter { - - /** - * Filter by name - * - * @param name only retrieve items with this name. - * @return this filter instance - */ - public RolesFilter withName(String name) { - parameters.put("name_filter", name); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - @Override - public RolesFilter withPage(int pageNumber, int amountPerPage) { - super.withPage(pageNumber, amountPerPage); - return this; - } - - /** - * Include the query summary - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - @Override - public RolesFilter withTotals(boolean includeTotals) { - super.withTotals(includeTotals); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/RulesFilter.java b/src/main/java/com/auth0/client/mgmt/filter/RulesFilter.java deleted file mode 100644 index 7e1210ef1..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/RulesFilter.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Rules endpoint. Related to the {@link com.auth0.client.mgmt.RulesEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class RulesFilter extends FieldsFilter { - - /** - * Filter by enabled value - * - * @param enabled only retrieve items that are enabled or disabled. - * @return this filter instance. - */ - public RulesFilter withEnabled(boolean enabled) { - parameters.put("enabled", enabled); - return this; - } - - @Override - public RulesFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - /** - * Include the query summary - * Warning: Can only be used with {@link com.auth0.client.mgmt.RulesEntity#listAll(RulesFilter)} - * - * @param includeTotals whether to include or not the query summary. - * @return this filter instance - */ - public RulesFilter withTotals(boolean includeTotals) { - parameters.put("include_totals", includeTotals); - return this; - } - - /** - * Filter by page - * - * @param pageNumber the page number to retrieve. - * @param amountPerPage the amount of items per page to retrieve. - * @return this filter instance - */ - public RulesFilter withPage(int pageNumber, int amountPerPage) { - parameters.put("page", pageNumber); - parameters.put("per_page", amountPerPage); - return this; - } - -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/UserAttributeProfilesFilter.java b/src/main/java/com/auth0/client/mgmt/filter/UserAttributeProfilesFilter.java deleted file mode 100644 index 5822105d1..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/UserAttributeProfilesFilter.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.auth0.client.mgmt.filter; - -public class UserAttributeProfilesFilter extends BaseFilter { - - /** - * Filter by checkpoint pagination support - * - * @param from the starting index identifier - * @param take the number of items to retrieve - * @return this filter instance - */ - public UserAttributeProfilesFilter withCheckpointPagination(String from, int take) { - parameters.put("from", from); - parameters.put("take", take); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/UserFilter.java b/src/main/java/com/auth0/client/mgmt/filter/UserFilter.java deleted file mode 100644 index 51995c4eb..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/UserFilter.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to filter the results received when calling the Users endpoint. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -public class UserFilter extends QueryFilter { - - /** - * Creates a new instance using the latest search engine version. - *

- * Since version 1.12.0 this SDK no longer specifies a search engine version by default. If you need to use - * a version different than the latest one, please set it explicitly by calling {@link #withSearchEngine(String)}. - * See the latest user search doc: https://auth0.com/docs/users/search/ - */ - public UserFilter() { - } - - @Override - public UserFilter withTotals(boolean includeTotals) { - super.withTotals(includeTotals); - return this; - } - - /** - * Selects which Search Engine version to use when querying for users. - *

- * See the latest user search doc: https://auth0.com/docs/users/search/ - * - * @param searchEngineVersion the search engine version to use on queries. - * @return this filter instance - */ - public UserFilter withSearchEngine(String searchEngineVersion) { - parameters.put("search_engine", searchEngineVersion); - return this; - } - - /** - * Filter by a query - * - * @param query the query expression to use following the syntax defined at https://auth0.com/docs/users/search/v3/query-syntax - * @return this filter instance - */ - @Override - public UserFilter withQuery(String query) { - super.withQuery(query); - return this; - } - - @Override - public UserFilter withSort(String sort) { - super.withSort(sort); - return this; - } - - @Override - public UserFilter withPage(int pageNumber, int amountPerPage) { - super.withPage(pageNumber, amountPerPage); - return this; - } - - @Override - public UserFilter withFields(String fields, boolean includeFields) { - super.withFields(fields, includeFields); - return this; - } - - /** - * Connection filter. Only applies when using search_engine=v1. - * To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name" - * - * @param connection connection to be filtered with - * @return this filter instance - */ - public UserFilter withConnection(String connection) { - parameters.put("connection", connection); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/UsersExportFilter.java b/src/main/java/com/auth0/client/mgmt/filter/UsersExportFilter.java deleted file mode 100644 index 94d9508a7..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/UsersExportFilter.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import com.auth0.json.mgmt.jobs.UsersExportField; - -import java.util.List; - -/** - * Class used to filter the results received when a Users Exports Job is completed. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -@SuppressWarnings("UnusedReturnValue") -public class UsersExportFilter extends BaseFilter { - - /** - * Changes the output format of the exports file - * - * @param format the format of the exports file. Typically 'csv' or 'json'. - * @return this filter instance - */ - public UsersExportFilter withFormat(String format) { - parameters.put("format", format); - return this; - } - - /** - * Limits the amount of results - * - * @param limit the amount of results to include - * @return this filter instance - */ - public UsersExportFilter withLimit(int limit) { - parameters.put("limit", limit); - return this; - } - - /** - * Selects the fields to include in each user export - * - * @param fields the list of fields to include in each user export - * @return this filter instance - */ - public UsersExportFilter withFields(List fields) { - parameters.put("fields", fields); - return this; - } - - /** - * ID for the connection from which you want to export users - * - * @param connectionId ID for the connection - * @see Locate the Connection ID or Name - * @return this filter instance - */ - public UsersExportFilter withConnectionId(String connectionId) { - parameters.put("connection_id", connectionId); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/filter/UsersImportOptions.java b/src/main/java/com/auth0/client/mgmt/filter/UsersImportOptions.java deleted file mode 100644 index 1a9c40086..000000000 --- a/src/main/java/com/auth0/client/mgmt/filter/UsersImportOptions.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.client.mgmt.filter; - -/** - * Class used to change the behavior of a Users Imports Job. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - *

- * This class is not thread-safe. - * - * @see BaseFilter - */ -@SuppressWarnings("UnusedReturnValue") -public class UsersImportOptions extends BaseFilter { - - /** - * When set to true, sends a completion email to all tenant owners when the import job is finished. - * If you do not want emails sent, you must explicitly set this parameter to false. - * - * @param sendCompletionEmail whether to send a completion email to all tenant owners when the import - * job is finished. Defaults to true. - * @return this filter instance - */ - public UsersImportOptions withSendCompletionEmail(boolean sendCompletionEmail) { - parameters.put("send_completion_email", sendCompletionEmail); - return this; - } - - /** - * Sets an optional user-defined string that can be used to correlate multiple jobs. - * - * @param externalId the external ID to use. - * @return this filter instance - */ - public UsersImportOptions withExternalId(String externalId) { - parameters.put("external_id", externalId); - return this; - } - - /** - * When set to false, pre-existing users that match on email address, user ID, or username will fail. - * When set to true, pre-existing users that match on any of these fields will be updated, but only - * with upsertable attributes. For a list of user profile fields that can be upserted during import, - * see the following article. - *

- * https://auth0.com/docs/users/references/user-profile-structure#user-profile-attributes - * - * @param upsert Whether to update users if they already exist (true) or to ignore them (false). Defaults to false. - * @return this filter instance - */ - public UsersImportOptions withUpsert(boolean upsert) { - parameters.put("upsert", upsert); - return this; - } - - /** - * ID for the connection from which you want to export users - * - * @param connectionId ID for the connection - * @see Locate the Connection ID or Name - * @return this filter instance - */ - public UsersImportOptions withConnectionId(String connectionId) { - parameters.put("connection_id", connectionId); - return this; - } -} diff --git a/src/main/java/com/auth0/client/mgmt/flows/AsyncExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/AsyncExecutionsClient.java new file mode 100644 index 000000000..dc037e42b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/AsyncExecutionsClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; +import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; +import com.auth0.client.mgmt.types.FlowExecutionSummary; +import com.auth0.client.mgmt.types.GetFlowExecutionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncExecutionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawExecutionsClient rawClient; + + public AsyncExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawExecutionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawExecutionsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list(String flowId) { + return this.rawClient.list(flowId).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String flowId, ExecutionsListRequest request) { + return this.rawClient.list(flowId, request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String flowId, ExecutionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(flowId, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String flowId, String executionId) { + return this.rawClient.get(flowId, executionId).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String flowId, String executionId, ExecutionsGetRequest request) { + return this.rawClient.get(flowId, executionId, request).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String flowId, String executionId, ExecutionsGetRequest request, RequestOptions requestOptions) { + return this.rawClient.get(flowId, executionId, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String flowId, String executionId) { + return this.rawClient.delete(flowId, executionId).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String flowId, String executionId, RequestOptions requestOptions) { + return this.rawClient.delete(flowId, executionId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java new file mode 100644 index 000000000..4a08f8698 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java @@ -0,0 +1,313 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; +import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; +import com.auth0.client.mgmt.types.FlowExecutionSummary; +import com.auth0.client.mgmt.types.GetFlowExecutionResponseContent; +import com.auth0.client.mgmt.types.ListFlowExecutionsPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawExecutionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list(String flowId) { + return list(flowId, ExecutionsListRequest.builder().build()); + } + + public CompletableFuture>> list( + String flowId, ExecutionsListRequest request) { + return list(flowId, request, null); + } + + public CompletableFuture>> list( + String flowId, ExecutionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowExecutionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFlowExecutionsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ExecutionsListRequest nextRequest = ExecutionsListRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getExecutions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(flowId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get( + String flowId, String executionId) { + return get(flowId, executionId, ExecutionsGetRequest.builder().build()); + } + + public CompletableFuture> get( + String flowId, String executionId, ExecutionsGetRequest request) { + return get(flowId, executionId, request, null); + } + + public CompletableFuture> get( + String flowId, String executionId, ExecutionsGetRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions") + .addPathSegment(executionId); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetFlowExecutionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String flowId, String executionId) { + return delete(flowId, executionId, null); + } + + public CompletableFuture> delete( + String flowId, String executionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions") + .addPathSegment(executionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/ExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/ExecutionsClient.java new file mode 100644 index 000000000..a384af34e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/ExecutionsClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; +import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; +import com.auth0.client.mgmt.types.FlowExecutionSummary; +import com.auth0.client.mgmt.types.GetFlowExecutionResponseContent; + +public class ExecutionsClient { + protected final ClientOptions clientOptions; + + private final RawExecutionsClient rawClient; + + public ExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawExecutionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawExecutionsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list(String flowId) { + return this.rawClient.list(flowId).body(); + } + + public SyncPagingIterable list(String flowId, ExecutionsListRequest request) { + return this.rawClient.list(flowId, request).body(); + } + + public SyncPagingIterable list( + String flowId, ExecutionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(flowId, request, requestOptions).body(); + } + + public GetFlowExecutionResponseContent get(String flowId, String executionId) { + return this.rawClient.get(flowId, executionId).body(); + } + + public GetFlowExecutionResponseContent get(String flowId, String executionId, ExecutionsGetRequest request) { + return this.rawClient.get(flowId, executionId, request).body(); + } + + public GetFlowExecutionResponseContent get( + String flowId, String executionId, ExecutionsGetRequest request, RequestOptions requestOptions) { + return this.rawClient.get(flowId, executionId, request, requestOptions).body(); + } + + public void delete(String flowId, String executionId) { + this.rawClient.delete(flowId, executionId).body(); + } + + public void delete(String flowId, String executionId, RequestOptions requestOptions) { + this.rawClient.delete(flowId, executionId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/RawExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/RawExecutionsClient.java new file mode 100644 index 000000000..e6bf5912a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/RawExecutionsClient.java @@ -0,0 +1,234 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; +import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; +import com.auth0.client.mgmt.types.FlowExecutionSummary; +import com.auth0.client.mgmt.types.GetFlowExecutionResponseContent; +import com.auth0.client.mgmt.types.ListFlowExecutionsPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawExecutionsClient { + protected final ClientOptions clientOptions; + + public RawExecutionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list(String flowId) { + return list(flowId, ExecutionsListRequest.builder().build()); + } + + public ManagementApiHttpResponse> list( + String flowId, ExecutionsListRequest request) { + return list(flowId, request, null); + } + + public ManagementApiHttpResponse> list( + String flowId, ExecutionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowExecutionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFlowExecutionsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ExecutionsListRequest nextRequest = ExecutionsListRequest.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getExecutions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + flowId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String flowId, String executionId) { + return get(flowId, executionId, ExecutionsGetRequest.builder().build()); + } + + public ManagementApiHttpResponse get( + String flowId, String executionId, ExecutionsGetRequest request) { + return get(flowId, executionId, request, null); + } + + public ManagementApiHttpResponse get( + String flowId, String executionId, ExecutionsGetRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions") + .addPathSegment(executionId); + if (request.getHydrate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "hydrate", request.getHydrate().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetFlowExecutionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String flowId, String executionId) { + return delete(flowId, executionId, null); + } + + public ManagementApiHttpResponse delete(String flowId, String executionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows") + .addPathSegment(flowId) + .addPathSegments("executions") + .addPathSegment(executionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java new file mode 100644 index 000000000..63b190892 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExecutionsGetRequest.Builder.class) +public final class ExecutionsGetRequest { + private final Optional> hydrate; + + private final Map additionalProperties; + + private ExecutionsGetRequest(Optional> hydrate, Map additionalProperties) { + this.hydrate = hydrate; + this.additionalProperties = additionalProperties; + } + + /** + * @return Hydration param + */ + @JsonIgnore + public Optional> getHydrate() { + if (hydrate == null) { + return Optional.empty(); + } + return hydrate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hydrate") + private Optional> _getHydrate() { + return hydrate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExecutionsGetRequest && equalTo((ExecutionsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExecutionsGetRequest other) { + return hydrate.equals(other.hydrate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hydrate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hydrate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExecutionsGetRequest other) { + hydrate(other.getHydrate()); + return this; + } + + /** + *

Hydration param

+ */ + @JsonSetter(value = "hydrate", nulls = Nulls.SKIP) + public Builder hydrate(@Nullable Optional> hydrate) { + this.hydrate = hydrate; + return this; + } + + public Builder hydrate(List hydrate) { + this.hydrate = Optional.ofNullable(hydrate); + return this; + } + + public Builder hydrate(com.auth0.client.mgmt.core.Nullable> hydrate) { + if (hydrate.isNull()) { + this.hydrate = null; + } else if (hydrate.isEmpty()) { + this.hydrate = Optional.empty(); + } else { + this.hydrate = Optional.of(hydrate.get()); + } + return this; + } + + public Builder hydrate(String hydrate) { + this.hydrate = Optional.of(Collections.singletonList(hydrate)); + return this; + } + + public ExecutionsGetRequest build() { + return new ExecutionsGetRequest(hydrate, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java new file mode 100644 index 000000000..ffe193ed8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExecutionsListRequest.Builder.class) +public final class ExecutionsListRequest { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ExecutionsListRequest( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExecutionsListRequest && equalTo((ExecutionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExecutionsListRequest other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExecutionsListRequest other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ExecutionsListRequest build() { + return new ExecutionsListRequest(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java new file mode 100644 index 000000000..2df1eda7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.types.CreateGuardianEnrollmentTicketRequestContent; +import com.auth0.client.mgmt.types.CreateGuardianEnrollmentTicketResponseContent; +import com.auth0.client.mgmt.types.GetGuardianEnrollmentResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncEnrollmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEnrollmentsClient rawClient; + + public AsyncEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEnrollmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEnrollmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CompletableFuture createTicket( + CreateGuardianEnrollmentTicketRequestContent request) { + return this.rawClient.createTicket(request).thenApply(response -> response.body()); + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CompletableFuture createTicket( + CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.createTicket(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java new file mode 100644 index 000000000..bc95ff62f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.guardian.factors.AsyncPhoneClient; +import com.auth0.client.mgmt.guardian.factors.AsyncPushNotificationClient; +import com.auth0.client.mgmt.guardian.factors.AsyncSmsClient; +import com.auth0.client.mgmt.guardian.factors.duo.AsyncDuoClient; +import com.auth0.client.mgmt.guardian.types.SetGuardianFactorRequestContent; +import com.auth0.client.mgmt.types.GuardianFactor; +import com.auth0.client.mgmt.types.GuardianFactorNameEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorResponseContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncFactorsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFactorsClient rawClient; + + protected final Supplier phoneClient; + + protected final Supplier pushNotificationClient; + + protected final Supplier smsClient; + + protected final Supplier duoClient; + + public AsyncFactorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFactorsClient(clientOptions); + this.phoneClient = Suppliers.memoize(() -> new AsyncPhoneClient(clientOptions)); + this.pushNotificationClient = Suppliers.memoize(() -> new AsyncPushNotificationClient(clientOptions)); + this.smsClient = Suppliers.memoize(() -> new AsyncSmsClient(clientOptions)); + this.duoClient = Suppliers.memoize(() -> new AsyncDuoClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFactorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public CompletableFuture set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request) { + return this.rawClient.set(name, request).thenApply(response -> response.body()); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public CompletableFuture set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(name, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncPhoneClient phone() { + return this.phoneClient.get(); + } + + public AsyncPushNotificationClient pushNotification() { + return this.pushNotificationClient.get(); + } + + public AsyncSmsClient sms() { + return this.smsClient.get(); + } + + public AsyncDuoClient duo() { + return this.duoClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java new file mode 100644 index 000000000..ce7f4ca9b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncGuardianClient { + protected final ClientOptions clientOptions; + + protected final Supplier enrollmentsClient; + + protected final Supplier factorsClient; + + protected final Supplier policiesClient; + + public AsyncGuardianClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.enrollmentsClient = Suppliers.memoize(() -> new AsyncEnrollmentsClient(clientOptions)); + this.factorsClient = Suppliers.memoize(() -> new AsyncFactorsClient(clientOptions)); + this.policiesClient = Suppliers.memoize(() -> new AsyncPoliciesClient(clientOptions)); + } + + public AsyncEnrollmentsClient enrollments() { + return this.enrollmentsClient.get(); + } + + public AsyncFactorsClient factors() { + return this.factorsClient.get(); + } + + public AsyncPoliciesClient policies() { + return this.policiesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java new file mode 100644 index 000000000..1ea9b5c01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java @@ -0,0 +1,80 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.MfaPolicyEnum; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncPoliciesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPoliciesClient rawClient; + + public AsyncPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPoliciesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPoliciesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture> set(List request) { + return this.rawClient.set(request).thenApply(response -> response.body()); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture> set(List request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java new file mode 100644 index 000000000..3981a5b82 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java @@ -0,0 +1,289 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.types.CreateGuardianEnrollmentTicketRequestContent; +import com.auth0.client.mgmt.types.CreateGuardianEnrollmentTicketResponseContent; +import com.auth0.client.mgmt.types.GetGuardianEnrollmentResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEnrollmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CompletableFuture> createTicket( + CreateGuardianEnrollmentTicketRequestContent request) { + return createTicket(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CompletableFuture> createTicket( + CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments/ticket") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateGuardianEnrollmentTicketResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianEnrollmentResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawFactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawFactorsClient.java new file mode 100644 index 000000000..62dfea126 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawFactorsClient.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.types.SetGuardianFactorRequestContent; +import com.auth0.client.mgmt.types.GuardianFactor; +import com.auth0.client.mgmt.types.GuardianFactorNameEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFactorsClient { + protected final ClientOptions clientOptions; + + public AsyncRawFactorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public CompletableFuture> set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request) { + return set(name, request, null); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public CompletableFuture> set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors") + .addPathSegment(name.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java new file mode 100644 index 000000000..a9f0ad1b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.MfaPolicyEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPoliciesClient { + protected final ClientOptions clientOptions; + + public AsyncRawPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/policies") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture>> set(List request) { + return set(request, null); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public CompletableFuture>> set( + List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/policies") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java new file mode 100644 index 000000000..d68f7d4c5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.types.CreateGuardianEnrollmentTicketRequestContent; +import com.auth0.client.mgmt.types.CreateGuardianEnrollmentTicketResponseContent; +import com.auth0.client.mgmt.types.GetGuardianEnrollmentResponseContent; + +public class EnrollmentsClient { + protected final ClientOptions clientOptions; + + private final RawEnrollmentsClient rawClient; + + public EnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEnrollmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEnrollmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CreateGuardianEnrollmentTicketResponseContent createTicket( + CreateGuardianEnrollmentTicketRequestContent request) { + return this.rawClient.createTicket(request).body(); + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public CreateGuardianEnrollmentTicketResponseContent createTicket( + CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.createTicket(request, requestOptions).body(); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public GetGuardianEnrollmentResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public GetGuardianEnrollmentResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java new file mode 100644 index 000000000..d9f4c4927 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.guardian.factors.PhoneClient; +import com.auth0.client.mgmt.guardian.factors.PushNotificationClient; +import com.auth0.client.mgmt.guardian.factors.SmsClient; +import com.auth0.client.mgmt.guardian.factors.duo.DuoClient; +import com.auth0.client.mgmt.guardian.types.SetGuardianFactorRequestContent; +import com.auth0.client.mgmt.types.GuardianFactor; +import com.auth0.client.mgmt.types.GuardianFactorNameEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorResponseContent; +import java.util.List; +import java.util.function.Supplier; + +public class FactorsClient { + protected final ClientOptions clientOptions; + + private final RawFactorsClient rawClient; + + protected final Supplier phoneClient; + + protected final Supplier pushNotificationClient; + + protected final Supplier smsClient; + + protected final Supplier duoClient; + + public FactorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFactorsClient(clientOptions); + this.phoneClient = Suppliers.memoize(() -> new PhoneClient(clientOptions)); + this.pushNotificationClient = Suppliers.memoize(() -> new PushNotificationClient(clientOptions)); + this.smsClient = Suppliers.memoize(() -> new SmsClient(clientOptions)); + this.duoClient = Suppliers.memoize(() -> new DuoClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFactorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public SetGuardianFactorResponseContent set(GuardianFactorNameEnum name, SetGuardianFactorRequestContent request) { + return this.rawClient.set(name, request).body(); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public SetGuardianFactorResponseContent set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(name, request, requestOptions).body(); + } + + public PhoneClient phone() { + return this.phoneClient.get(); + } + + public PushNotificationClient pushNotification() { + return this.pushNotificationClient.get(); + } + + public SmsClient sms() { + return this.smsClient.get(); + } + + public DuoClient duo() { + return this.duoClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java b/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java new file mode 100644 index 000000000..0850d1d09 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class GuardianClient { + protected final ClientOptions clientOptions; + + protected final Supplier enrollmentsClient; + + protected final Supplier factorsClient; + + protected final Supplier policiesClient; + + public GuardianClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.enrollmentsClient = Suppliers.memoize(() -> new EnrollmentsClient(clientOptions)); + this.factorsClient = Suppliers.memoize(() -> new FactorsClient(clientOptions)); + this.policiesClient = Suppliers.memoize(() -> new PoliciesClient(clientOptions)); + } + + public EnrollmentsClient enrollments() { + return this.enrollmentsClient.get(); + } + + public FactorsClient factors() { + return this.factorsClient.get(); + } + + public PoliciesClient policies() { + return this.policiesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java new file mode 100644 index 000000000..df16a5110 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.MfaPolicyEnum; +import java.util.List; + +public class PoliciesClient { + protected final ClientOptions clientOptions; + + private final RawPoliciesClient rawClient; + + public PoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPoliciesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPoliciesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public List set(List request) { + return this.rawClient.set(request).body(); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public List set(List request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java new file mode 100644 index 000000000..1e4712778 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.types.CreateGuardianEnrollmentTicketRequestContent; +import com.auth0.client.mgmt.types.CreateGuardianEnrollmentTicketResponseContent; +import com.auth0.client.mgmt.types.GetGuardianEnrollmentResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEnrollmentsClient { + protected final ClientOptions clientOptions; + + public RawEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public ManagementApiHttpResponse createTicket( + CreateGuardianEnrollmentTicketRequestContent request) { + return createTicket(request, null); + } + + /** + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket, to a given user. + * Create a <a href="https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets">multi-factor authentication (MFA) enrollment ticket</a>, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.<br/> + *

Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

+ */ + public ManagementApiHttpResponse createTicket( + CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments/ticket") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateGuardianEnrollmentTicketResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianEnrollmentResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa">Reset User Multi-Factor Authentication and Recovery Codes</a>. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/enrollments") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/RawFactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/RawFactorsClient.java new file mode 100644 index 000000000..8924c6714 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/RawFactorsClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.types.SetGuardianFactorRequestContent; +import com.auth0.client.mgmt.types.GuardianFactor; +import com.auth0.client.mgmt.types.GuardianFactorNameEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFactorsClient { + protected final ClientOptions clientOptions; + + public RawFactorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve details of all <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication factors</a> associated with your tenant. + */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public ManagementApiHttpResponse set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request) { + return set(name, request, null); + } + + /** + * Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. + */ + public ManagementApiHttpResponse set( + GuardianFactorNameEnum name, SetGuardianFactorRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors") + .addPathSegment(name.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SetGuardianFactorResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java new file mode 100644 index 000000000..ec7b75cf0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.MfaPolicyEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPoliciesClient { + protected final ClientOptions clientOptions; + + public RawPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/policies") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public ManagementApiHttpResponse> set(List request) { + return set(request, null); + } + + /** + * Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant. + *

The following policies are supported:

+ *

<ul> + * <li><code>all-applications</code> policy prompts with MFA for all logins.</li> + * <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li> + * </ul>

+ *

<b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.

+ */ + public ManagementApiHttpResponse> set( + List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/policies") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java new file mode 100644 index 000000000..3c395b10d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncPhoneClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPhoneClient rawClient; + + public AsyncPhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPhoneClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPhoneClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture getMessageTypes() { + return this.rawClient.getMessageTypes().thenApply(response -> response.body()); + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture getMessageTypes( + RequestOptions requestOptions) { + return this.rawClient.getMessageTypes(requestOptions).thenApply(response -> response.body()); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request) { + return this.rawClient.setMessageTypes(request).thenApply(response -> response.body()); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setMessageTypes(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture getTwilioProvider() { + return this.rawClient.getTwilioProvider().thenApply(response -> response.body()); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture getTwilioProvider( + RequestOptions requestOptions) { + return this.rawClient.getTwilioProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture setTwilioProvider() { + return this.rawClient.setTwilioProvider().thenApply(response -> response.body()); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request) { + return this.rawClient.setTwilioProvider(request).thenApply(response -> response.body()); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTwilioProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public CompletableFuture getSelectedProvider() { + return this.rawClient.getSelectedProvider().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public CompletableFuture getSelectedProvider( + RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture setProvider( + SetGuardianFactorsProviderPhoneRequestContent request) { + return this.rawClient.setProvider(request).thenApply(response -> response.body()); + } + + public CompletableFuture setProvider( + SetGuardianFactorsProviderPhoneRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public CompletableFuture getTemplates() { + return this.rawClient.getTemplates().thenApply(response -> response.body()); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public CompletableFuture getTemplates( + RequestOptions requestOptions) { + return this.rawClient.getTemplates(requestOptions).thenApply(response -> response.body()); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public CompletableFuture setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request) { + return this.rawClient.setTemplates(request).thenApply(response -> response.body()); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public CompletableFuture setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTemplates(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java new file mode 100644 index 000000000..350559533 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AsyncPushNotificationClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPushNotificationClient rawClient; + + public AsyncPushNotificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPushNotificationClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPushNotificationClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture getApnsProvider() { + return this.rawClient.getApnsProvider().thenApply(response -> response.body()); + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture getApnsProvider( + RequestOptions requestOptions) { + return this.rawClient.getApnsProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture setApnsProvider() { + return this.rawClient.setApnsProvider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return this.rawClient.setApnsProvider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setApnsProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> setFcmProvider() { + return this.rawClient.setFcmProvider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return this.rawClient.setFcmProvider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setFcmProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> setFcmv1Provider() { + return this.rawClient.setFcmv1Provider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return this.rawClient.setFcmv1Provider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + return this.rawClient.setFcmv1Provider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture getSnsProvider() { + return this.rawClient.getSnsProvider().thenApply(response -> response.body()); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture getSnsProvider( + RequestOptions requestOptions) { + return this.rawClient.getSnsProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture setSnsProvider() { + return this.rawClient.setSnsProvider().thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return this.rawClient.setSnsProvider(request).thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setSnsProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture updateSnsProvider() { + return this.rawClient.updateSnsProvider().thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return this.rawClient.updateSnsProvider(request).thenApply(response -> response.body()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateSnsProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture getSelectedProvider() { + return this.rawClient.getSelectedProvider().thenApply(response -> response.body()); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture getSelectedProvider( + RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request) { + return this.rawClient.setProvider(request).thenApply(response -> response.body()); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java new file mode 100644 index 000000000..69bd75112 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java @@ -0,0 +1,721 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPhoneClient { + protected final ClientOptions clientOptions; + + public AsyncRawPhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture> + getMessageTypes() { + return getMessageTypes(null); + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture> + getMessageTypes(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/message-types") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorPhoneMessageTypesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture> + setMessageTypes(SetGuardianFactorPhoneMessageTypesRequestContent request) { + return setMessageTypes(request, null); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public CompletableFuture> + setMessageTypes(SetGuardianFactorPhoneMessageTypesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/message-types") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorPhoneMessageTypesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture> + getTwilioProvider() { + return getTwilioProvider(null); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture> + getTwilioProvider(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/providers/twilio") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderPhoneTwilioResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture> + setTwilioProvider() { + return setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent.builder().build()); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture> + setTwilioProvider(SetGuardianFactorsProviderPhoneTwilioRequestContent request) { + return setTwilioProvider(request, null); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public CompletableFuture> + setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/providers/twilio") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPhoneTwilioResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public CompletableFuture> + getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public CompletableFuture> + getSelectedProvider(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderPhoneResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> setProvider( + SetGuardianFactorsProviderPhoneRequestContent request) { + return setProvider(request, null); + } + + public CompletableFuture> setProvider( + SetGuardianFactorsProviderPhoneRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPhoneResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public CompletableFuture> getTemplates() { + return getTemplates(null); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public CompletableFuture> getTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorPhoneTemplatesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public CompletableFuture> setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request) { + return setTemplates(request, null); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public CompletableFuture> setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorPhoneTemplatesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java new file mode 100644 index 000000000..92b66930d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java @@ -0,0 +1,862 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPushNotificationClient { + protected final ClientOptions clientOptions; + + public AsyncRawPushNotificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture> + getApnsProvider() { + return getApnsProvider(null); + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture> getApnsProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderApnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture> + setApnsProvider() { + return setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture> + setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return setApnsProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture> + setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> + future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + SetGuardianFactorsProviderPushNotificationApnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> setFcmProvider() { + return setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return setFcmProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcm") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> setFcmv1Provider() { + return setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return setFcmv1Provider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcmv1") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> getSnsProvider() { + return getSnsProvider(null); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> getSnsProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + setSnsProvider() { + return setSnsProvider(SetGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + setSnsProvider(SetGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return setSnsProvider(request, null); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> + future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + SetGuardianFactorsProviderPushNotificationSnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + updateSnsProvider() { + return updateSnsProvider(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + updateSnsProvider(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return updateSnsProvider(request, null); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public CompletableFuture> + updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> + future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> + getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> + getSelectedProvider(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + GetGuardianFactorsProviderPushNotificationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> + setProvider(SetGuardianFactorsProviderPushNotificationRequestContent request) { + return setProvider(request, null); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public CompletableFuture> + setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + SetGuardianFactorsProviderPushNotificationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawSmsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawSmsClient.java new file mode 100644 index 000000000..d9bab8e3c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawSmsClient.java @@ -0,0 +1,578 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorSmsTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsTwilioResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSmsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSmsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public CompletableFuture> + getTwilioProvider() { + return getTwilioProvider(null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public CompletableFuture> + getTwilioProvider(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/providers/twilio") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSmsTwilioResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture> + setTwilioProvider() { + return setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent.builder().build()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture> + setTwilioProvider(SetGuardianFactorsProviderSmsTwilioRequestContent request) { + return setTwilioProvider(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture> + setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/providers/twilio") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderSmsTwilioResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public CompletableFuture> + getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public CompletableFuture> + getSelectedProvider(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSmsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public CompletableFuture> setProvider( + SetGuardianFactorsProviderSmsRequestContent request) { + return setProvider(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public CompletableFuture> setProvider( + SetGuardianFactorsProviderSmsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderSmsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public CompletableFuture> getTemplates() { + return getTemplates(null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public CompletableFuture> getTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorSmsTemplatesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public CompletableFuture> setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request) { + return setTemplates(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public CompletableFuture> setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorSmsTemplatesResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncSmsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncSmsClient.java new file mode 100644 index 000000000..cfff6df6b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncSmsClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorSmsTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsTwilioResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSmsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSmsClient rawClient; + + public AsyncSmsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSmsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSmsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public CompletableFuture getTwilioProvider() { + return this.rawClient.getTwilioProvider().thenApply(response -> response.body()); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public CompletableFuture getTwilioProvider( + RequestOptions requestOptions) { + return this.rawClient.getTwilioProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture setTwilioProvider() { + return this.rawClient.setTwilioProvider().thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request) { + return this.rawClient.setTwilioProvider(request).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public CompletableFuture setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTwilioProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public CompletableFuture getSelectedProvider() { + return this.rawClient.getSelectedProvider().thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public CompletableFuture getSelectedProvider( + RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public CompletableFuture setProvider( + SetGuardianFactorsProviderSmsRequestContent request) { + return this.rawClient.setProvider(request).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public CompletableFuture setProvider( + SetGuardianFactorsProviderSmsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public CompletableFuture getTemplates() { + return this.rawClient.getTemplates().thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public CompletableFuture getTemplates(RequestOptions requestOptions) { + return this.rawClient.getTemplates(requestOptions).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public CompletableFuture setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request) { + return this.rawClient.setTemplates(request).thenApply(response -> response.body()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public CompletableFuture setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTemplates(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java new file mode 100644 index 000000000..0bbe2445e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent; + +public class PhoneClient { + protected final ClientOptions clientOptions; + + private final RawPhoneClient rawClient; + + public PhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPhoneClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPhoneClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public GetGuardianFactorPhoneMessageTypesResponseContent getMessageTypes() { + return this.rawClient.getMessageTypes().body(); + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public GetGuardianFactorPhoneMessageTypesResponseContent getMessageTypes(RequestOptions requestOptions) { + return this.rawClient.getMessageTypes(requestOptions).body(); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public SetGuardianFactorPhoneMessageTypesResponseContent setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request) { + return this.rawClient.setMessageTypes(request).body(); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public SetGuardianFactorPhoneMessageTypesResponseContent setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setMessageTypes(request, requestOptions).body(); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderPhoneTwilioResponseContent getTwilioProvider() { + return this.rawClient.getTwilioProvider().body(); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderPhoneTwilioResponseContent getTwilioProvider(RequestOptions requestOptions) { + return this.rawClient.getTwilioProvider(requestOptions).body(); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public SetGuardianFactorsProviderPhoneTwilioResponseContent setTwilioProvider() { + return this.rawClient.setTwilioProvider().body(); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public SetGuardianFactorsProviderPhoneTwilioResponseContent setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request) { + return this.rawClient.setTwilioProvider(request).body(); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public SetGuardianFactorsProviderPhoneTwilioResponseContent setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTwilioProvider(request, requestOptions).body(); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public GetGuardianFactorsProviderPhoneResponseContent getSelectedProvider() { + return this.rawClient.getSelectedProvider().body(); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public GetGuardianFactorsProviderPhoneResponseContent getSelectedProvider(RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).body(); + } + + public SetGuardianFactorsProviderPhoneResponseContent setProvider( + SetGuardianFactorsProviderPhoneRequestContent request) { + return this.rawClient.setProvider(request).body(); + } + + public SetGuardianFactorsProviderPhoneResponseContent setProvider( + SetGuardianFactorsProviderPhoneRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).body(); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public GetGuardianFactorPhoneTemplatesResponseContent getTemplates() { + return this.rawClient.getTemplates().body(); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public GetGuardianFactorPhoneTemplatesResponseContent getTemplates(RequestOptions requestOptions) { + return this.rawClient.getTemplates(requestOptions).body(); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public SetGuardianFactorPhoneTemplatesResponseContent setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request) { + return this.rawClient.setTemplates(request).body(); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public SetGuardianFactorPhoneTemplatesResponseContent setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTemplates(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java new file mode 100644 index 000000000..a790e49e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; +import java.util.Map; + +public class PushNotificationClient { + protected final ClientOptions clientOptions; + + private final RawPushNotificationClient rawClient; + + public PushNotificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPushNotificationClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPushNotificationClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public GetGuardianFactorsProviderApnsResponseContent getApnsProvider() { + return this.rawClient.getApnsProvider().body(); + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public GetGuardianFactorsProviderApnsResponseContent getApnsProvider(RequestOptions requestOptions) { + return this.rawClient.getApnsProvider(requestOptions).body(); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider() { + return this.rawClient.setApnsProvider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return this.rawClient.setApnsProvider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setApnsProvider(request, requestOptions).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map setFcmProvider() { + return this.rawClient.setFcmProvider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return this.rawClient.setFcmProvider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setFcmProvider(request, requestOptions).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map setFcmv1Provider() { + return this.rawClient.setFcmv1Provider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return this.rawClient.setFcmv1Provider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + return this.rawClient.setFcmv1Provider(request, requestOptions).body(); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderSnsResponseContent getSnsProvider() { + return this.rawClient.getSnsProvider().body(); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderSnsResponseContent getSnsProvider(RequestOptions requestOptions) { + return this.rawClient.getSnsProvider(requestOptions).body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public SetGuardianFactorsProviderPushNotificationSnsResponseContent setSnsProvider() { + return this.rawClient.setSnsProvider().body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public SetGuardianFactorsProviderPushNotificationSnsResponseContent setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return this.rawClient.setSnsProvider(request).body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public SetGuardianFactorsProviderPushNotificationSnsResponseContent setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setSnsProvider(request, requestOptions).body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public UpdateGuardianFactorsProviderPushNotificationSnsResponseContent updateSnsProvider() { + return this.rawClient.updateSnsProvider().body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public UpdateGuardianFactorsProviderPushNotificationSnsResponseContent updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return this.rawClient.updateSnsProvider(request).body(); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public UpdateGuardianFactorsProviderPushNotificationSnsResponseContent updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateSnsProvider(request, requestOptions).body(); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderPushNotificationResponseContent getSelectedProvider() { + return this.rawClient.getSelectedProvider().body(); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public GetGuardianFactorsProviderPushNotificationResponseContent getSelectedProvider( + RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).body(); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public SetGuardianFactorsProviderPushNotificationResponseContent setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request) { + return this.rawClient.setProvider(request).body(); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public SetGuardianFactorsProviderPushNotificationResponseContent setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java new file mode 100644 index 000000000..3977ed15a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java @@ -0,0 +1,550 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPhoneClient { + protected final ClientOptions clientOptions; + + public RawPhoneClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public ManagementApiHttpResponse getMessageTypes() { + return getMessageTypes(null); + } + + /** + * Retrieve list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public ManagementApiHttpResponse getMessageTypes( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/message-types") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorPhoneMessageTypesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public ManagementApiHttpResponse setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request) { + return setMessageTypes(request, null); + } + + /** + * Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant. + */ + public ManagementApiHttpResponse setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/message-types") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorPhoneMessageTypesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getTwilioProvider() { + return getTwilioProvider(null); + } + + /** + * Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getTwilioProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/providers/twilio") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderPhoneTwilioResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public ManagementApiHttpResponse setTwilioProvider() { + return setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent.builder().build()); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public ManagementApiHttpResponse setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request) { + return setTwilioProvider(request, null); + } + + /** + * Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>. + */ + public ManagementApiHttpResponse setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/providers/twilio") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPhoneTwilioResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public ManagementApiHttpResponse getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * Retrieve details of the multi-factor authentication phone provider configured for your tenant. + */ + public ManagementApiHttpResponse getSelectedProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderPhoneResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderPhoneRequestContent request) { + return setProvider(request, null); + } + + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderPhoneRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPhoneResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public ManagementApiHttpResponse getTemplates() { + return getTemplates(null); + } + + /** + * Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. + */ + public ManagementApiHttpResponse getTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorPhoneTemplatesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public ManagementApiHttpResponse setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request) { + return setTemplates(request, null); + } + + /** + * Customize the messages sent to complete phone enrollment and verification (subscription required). + */ + public ManagementApiHttpResponse setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/phone/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorPhoneTemplatesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java new file mode 100644 index 000000000..baab4c98b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java @@ -0,0 +1,666 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPushNotificationClient { + protected final ClientOptions clientOptions; + + public RawPushNotificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse getApnsProvider() { + return getApnsProvider(null); + } + + /** + * Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse getApnsProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderApnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse setApnsProvider() { + return setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return setApnsProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse setApnsProvider( + SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + SetGuardianFactorsProviderPushNotificationApnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmProvider() { + return setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return setFcmProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmProvider( + SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcm") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmv1Provider() { + return setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return setFcmv1Provider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcmv1") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getSnsProvider() { + return getSnsProvider(null); + } + + /** + * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getSnsProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse setSnsProvider() { + return setSnsProvider(SetGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return setSnsProvider(request, null); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPushNotificationSnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse + updateSnsProvider() { + return updateSnsProvider(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request) { + return updateSnsProvider(request, null); + } + + /** + * Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required). + */ + public ManagementApiHttpResponse updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/sns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse getSelectedProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderPushNotificationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request) { + return setProvider(request, null); + } + + /** + * Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. + */ + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderPushNotificationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawSmsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawSmsClient.java new file mode 100644 index 000000000..e925d117c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawSmsClient.java @@ -0,0 +1,450 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorSmsTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsTwilioResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSmsClient { + protected final ClientOptions clientOptions; + + public RawSmsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public ManagementApiHttpResponse getTwilioProvider() { + return getTwilioProvider(null); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public ManagementApiHttpResponse getTwilioProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/providers/twilio") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSmsTwilioResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public ManagementApiHttpResponse setTwilioProvider() { + return setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent.builder().build()); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public ManagementApiHttpResponse setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request) { + return setTwilioProvider(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public ManagementApiHttpResponse setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/providers/twilio") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderSmsTwilioResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public ManagementApiHttpResponse getSelectedProvider() { + return getSelectedProvider(null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public ManagementApiHttpResponse getSelectedProvider( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/selected-provider") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorsProviderSmsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderSmsRequestContent request) { + return setProvider(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public ManagementApiHttpResponse setProvider( + SetGuardianFactorsProviderSmsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/selected-provider") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorsProviderSmsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public ManagementApiHttpResponse getTemplates() { + return getTemplates(null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public ManagementApiHttpResponse getTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorSmsTemplatesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public ManagementApiHttpResponse setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request) { + return setTemplates(request, null); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public ManagementApiHttpResponse setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/sms/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorSmsTemplatesResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/SmsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/SmsClient.java new file mode 100644 index 000000000..5963a5de3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/SmsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorSmsTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsTwilioResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsTwilioResponseContent; + +public class SmsClient { + protected final ClientOptions clientOptions; + + private final RawSmsClient rawClient; + + public SmsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSmsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSmsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public GetGuardianFactorsProviderSmsTwilioResponseContent getTwilioProvider() { + return this.rawClient.getTwilioProvider().body(); + } + + /** + * Retrieve the <a href="https://auth0.com/docs/multifactor-authentication/twilio-configuration">Twilio SMS provider configuration</a> (subscription required). + *
A new endpoint is available to retrieve the Twilio configuration related to phone factors (<a href='https://auth0.com/docs/api/management/v2/#!/Guardian/get_twilio'>phone Twilio configuration</a>). It has the same payload as this one. Please use it instead.
+     * 
+ */ + public GetGuardianFactorsProviderSmsTwilioResponseContent getTwilioProvider(RequestOptions requestOptions) { + return this.rawClient.getTwilioProvider(requestOptions).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public SetGuardianFactorsProviderSmsTwilioResponseContent setTwilioProvider() { + return this.rawClient.setTwilioProvider().body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public SetGuardianFactorsProviderSmsTwilioResponseContent setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request) { + return this.rawClient.setTwilioProvider(request).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-twilio">Update Twilio phone configuration</a> endpoint. + *
<b>Previous functionality</b>: Update the Twilio SMS provider configuration.
+     * 
+ */ + public SetGuardianFactorsProviderSmsTwilioResponseContent setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTwilioProvider(request, requestOptions).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public GetGuardianFactorsProviderSmsResponseContent getSelectedProvider() { + return this.rawClient.getSelectedProvider().body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-phone-providers">Retrieve phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
+     * 
+ */ + public GetGuardianFactorsProviderSmsResponseContent getSelectedProvider(RequestOptions requestOptions) { + return this.rawClient.getSelectedProvider(requestOptions).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public SetGuardianFactorsProviderSmsResponseContent setProvider( + SetGuardianFactorsProviderSmsRequestContent request) { + return this.rawClient.setProvider(request).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-phone-providers">Update phone configuration</a> endpoint instead. + *
<b>Previous functionality</b>: Update the multi-factor authentication SMS provider configuration in your tenant.
+     * 
+ */ + public SetGuardianFactorsProviderSmsResponseContent setProvider( + SetGuardianFactorsProviderSmsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setProvider(request, requestOptions).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public GetGuardianFactorSmsTemplatesResponseContent getTemplates() { + return this.rawClient.getTemplates().body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/get-factor-phone-templates">Retrieve enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous function</b>: Retrieve details of SMS enrollment and verification templates configured for your tenant.
+     * 
+ */ + public GetGuardianFactorSmsTemplatesResponseContent getTemplates(RequestOptions requestOptions) { + return this.rawClient.getTemplates(requestOptions).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public SetGuardianFactorSmsTemplatesResponseContent setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request) { + return this.rawClient.setTemplates(request).body(); + } + + /** + * This endpoint has been deprecated. To complete this action, use the <a href="https://auth0.com/docs/api/management/v2/guardian/put-factor-phone-templates">Update enrollment and verification phone templates</a> endpoint instead. + *
<b>Previous functionality</b>: Customize the messages sent to complete SMS enrollment and verification.
+     * 
+ */ + public SetGuardianFactorSmsTemplatesResponseContent setTemplates( + SetGuardianFactorSmsTemplatesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.setTemplates(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncDuoClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncDuoClient.java new file mode 100644 index 000000000..28fa68e40 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncDuoClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncDuoClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public AsyncDuoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new AsyncSettingsClient(clientOptions)); + } + + public AsyncSettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncRawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncRawSettingsClient.java new file mode 100644 index 000000000..48d8f0434 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncRawSettingsClient.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.duo.types.SetGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.guardian.factors.duo.types.UpdateGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorDuoSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSettingsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorDuoSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture> set() { + return set(SetGuardianFactorDuoSettingsRequestContent.builder().build()); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture> set( + SetGuardianFactorDuoSettingsRequestContent request) { + return set(request, null); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture> set( + SetGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorDuoSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update() { + return update(UpdateGuardianFactorDuoSettingsRequestContent.builder().build()); + } + + public CompletableFuture> update( + UpdateGuardianFactorDuoSettingsRequestContent request) { + return update(request, null); + } + + public CompletableFuture> update( + UpdateGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateGuardianFactorDuoSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncSettingsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncSettingsClient.java new file mode 100644 index 000000000..dd1d36dbc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/AsyncSettingsClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.duo.types.SetGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.guardian.factors.duo.types.UpdateGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorDuoSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSettingsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSettingsClient rawClient; + + public AsyncSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSettingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture set() { + return this.rawClient.set().thenApply(response -> response.body()); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture set( + SetGuardianFactorDuoSettingsRequestContent request) { + return this.rawClient.set(request).thenApply(response -> response.body()); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public CompletableFuture set( + SetGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + public CompletableFuture update( + UpdateGuardianFactorDuoSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + UpdateGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/DuoClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/DuoClient.java new file mode 100644 index 000000000..7305cbbff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/DuoClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class DuoClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public DuoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new SettingsClient(clientOptions)); + } + + public SettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/RawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/RawSettingsClient.java new file mode 100644 index 000000000..421dd9a52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/RawSettingsClient.java @@ -0,0 +1,233 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.duo.types.SetGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.guardian.factors.duo.types.UpdateGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorDuoSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSettingsClient { + protected final ClientOptions clientOptions; + + public RawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetGuardianFactorDuoSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public ManagementApiHttpResponse set() { + return set(SetGuardianFactorDuoSettingsRequestContent.builder().build()); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public ManagementApiHttpResponse set( + SetGuardianFactorDuoSettingsRequestContent request) { + return set(request, null); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public ManagementApiHttpResponse set( + SetGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetGuardianFactorDuoSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update() { + return update(UpdateGuardianFactorDuoSettingsRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update( + UpdateGuardianFactorDuoSettingsRequestContent request) { + return update(request, null); + } + + public ManagementApiHttpResponse update( + UpdateGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/duo/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateGuardianFactorDuoSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/SettingsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/SettingsClient.java new file mode 100644 index 000000000..043252cdf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/SettingsClient.java @@ -0,0 +1,80 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.duo.types.SetGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.guardian.factors.duo.types.UpdateGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorDuoSettingsResponseContent; + +public class SettingsClient { + protected final ClientOptions clientOptions; + + private final RawSettingsClient rawClient; + + public SettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSettingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public GetGuardianFactorDuoSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieves the DUO account and factor configuration. + */ + public GetGuardianFactorDuoSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public SetGuardianFactorDuoSettingsResponseContent set() { + return this.rawClient.set().body(); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public SetGuardianFactorDuoSettingsResponseContent set(SetGuardianFactorDuoSettingsRequestContent request) { + return this.rawClient.set(request).body(); + } + + /** + * Set the DUO account configuration and other properties specific to this factor. + */ + public SetGuardianFactorDuoSettingsResponseContent set( + SetGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).body(); + } + + public UpdateGuardianFactorDuoSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + public UpdateGuardianFactorDuoSettingsResponseContent update( + UpdateGuardianFactorDuoSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + public UpdateGuardianFactorDuoSettingsResponseContent update( + UpdateGuardianFactorDuoSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java new file mode 100644 index 000000000..b830c8788 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorDuoSettingsRequestContent.Builder.class) +public final class SetGuardianFactorDuoSettingsRequestContent { + private final Optional ikey; + + private final Optional skey; + + private final Optional host; + + private final Map additionalProperties; + + private SetGuardianFactorDuoSettingsRequestContent( + Optional ikey, + Optional skey, + Optional host, + Map additionalProperties) { + this.ikey = ikey; + this.skey = skey; + this.host = host; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ikey") + public Optional getIkey() { + return ikey; + } + + @JsonProperty("skey") + public Optional getSkey() { + return skey; + } + + @JsonProperty("host") + public Optional getHost() { + return host; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorDuoSettingsRequestContent + && equalTo((SetGuardianFactorDuoSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorDuoSettingsRequestContent other) { + return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ikey, this.skey, this.host); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ikey = Optional.empty(); + + private Optional skey = Optional.empty(); + + private Optional host = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorDuoSettingsRequestContent other) { + ikey(other.getIkey()); + skey(other.getSkey()); + host(other.getHost()); + return this; + } + + @JsonSetter(value = "ikey", nulls = Nulls.SKIP) + public Builder ikey(Optional ikey) { + this.ikey = ikey; + return this; + } + + public Builder ikey(String ikey) { + this.ikey = Optional.ofNullable(ikey); + return this; + } + + @JsonSetter(value = "skey", nulls = Nulls.SKIP) + public Builder skey(Optional skey) { + this.skey = skey; + return this; + } + + public Builder skey(String skey) { + this.skey = Optional.ofNullable(skey); + return this; + } + + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + public SetGuardianFactorDuoSettingsRequestContent build() { + return new SetGuardianFactorDuoSettingsRequestContent(ikey, skey, host, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java new file mode 100644 index 000000000..aac1ee029 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.duo.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorDuoSettingsRequestContent.Builder.class) +public final class UpdateGuardianFactorDuoSettingsRequestContent { + private final Optional ikey; + + private final Optional skey; + + private final Optional host; + + private final Map additionalProperties; + + private UpdateGuardianFactorDuoSettingsRequestContent( + Optional ikey, + Optional skey, + Optional host, + Map additionalProperties) { + this.ikey = ikey; + this.skey = skey; + this.host = host; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ikey") + public Optional getIkey() { + return ikey; + } + + @JsonProperty("skey") + public Optional getSkey() { + return skey; + } + + @JsonProperty("host") + public Optional getHost() { + return host; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorDuoSettingsRequestContent + && equalTo((UpdateGuardianFactorDuoSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorDuoSettingsRequestContent other) { + return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ikey, this.skey, this.host); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ikey = Optional.empty(); + + private Optional skey = Optional.empty(); + + private Optional host = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorDuoSettingsRequestContent other) { + ikey(other.getIkey()); + skey(other.getSkey()); + host(other.getHost()); + return this; + } + + @JsonSetter(value = "ikey", nulls = Nulls.SKIP) + public Builder ikey(Optional ikey) { + this.ikey = ikey; + return this; + } + + public Builder ikey(String ikey) { + this.ikey = Optional.ofNullable(ikey); + return this; + } + + @JsonSetter(value = "skey", nulls = Nulls.SKIP) + public Builder skey(Optional skey) { + this.skey = skey; + return this; + } + + public Builder skey(String skey) { + this.skey = Optional.ofNullable(skey); + return this; + } + + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + public UpdateGuardianFactorDuoSettingsRequestContent build() { + return new UpdateGuardianFactorDuoSettingsRequestContent(ikey, skey, host, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java new file mode 100644 index 000000000..09209a2db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GuardianFactorPhoneFactorMessageTypeEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorPhoneMessageTypesRequestContent.Builder.class) +public final class SetGuardianFactorPhoneMessageTypesRequestContent { + private final List messageTypes; + + private final Map additionalProperties; + + private SetGuardianFactorPhoneMessageTypesRequestContent( + List messageTypes, Map additionalProperties) { + this.messageTypes = messageTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The list of phone factors to enable on the tenant. Can include sms and voice. + */ + @JsonProperty("message_types") + public List getMessageTypes() { + return messageTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorPhoneMessageTypesRequestContent + && equalTo((SetGuardianFactorPhoneMessageTypesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorPhoneMessageTypesRequestContent other) { + return messageTypes.equals(other.messageTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.messageTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List messageTypes = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorPhoneMessageTypesRequestContent other) { + messageTypes(other.getMessageTypes()); + return this; + } + + /** + *

The list of phone factors to enable on the tenant. Can include sms and voice.

+ */ + @JsonSetter(value = "message_types", nulls = Nulls.SKIP) + public Builder messageTypes(List messageTypes) { + this.messageTypes.clear(); + if (messageTypes != null) { + this.messageTypes.addAll(messageTypes); + } + return this; + } + + public Builder addMessageTypes(GuardianFactorPhoneFactorMessageTypeEnum messageTypes) { + this.messageTypes.add(messageTypes); + return this; + } + + public Builder addAllMessageTypes(List messageTypes) { + if (messageTypes != null) { + this.messageTypes.addAll(messageTypes); + } + return this; + } + + public SetGuardianFactorPhoneMessageTypesRequestContent build() { + return new SetGuardianFactorPhoneMessageTypesRequestContent(messageTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java new file mode 100644 index 000000000..8dd8996bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorPhoneTemplatesRequestContent.Builder.class) +public final class SetGuardianFactorPhoneTemplatesRequestContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private SetGuardianFactorPhoneTemplatesRequestContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorPhoneTemplatesRequestContent + && equalTo((SetGuardianFactorPhoneTemplatesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorPhoneTemplatesRequestContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(SetGuardianFactorPhoneTemplatesRequestContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + SetGuardianFactorPhoneTemplatesRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorPhoneTemplatesRequestContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorPhoneTemplatesRequestContent build() { + return new SetGuardianFactorPhoneTemplatesRequestContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java new file mode 100644 index 000000000..f11acb96f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorSmsTemplatesRequestContent.Builder.class) +public final class SetGuardianFactorSmsTemplatesRequestContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private SetGuardianFactorSmsTemplatesRequestContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorSmsTemplatesRequestContent + && equalTo((SetGuardianFactorSmsTemplatesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorSmsTemplatesRequestContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(SetGuardianFactorSmsTemplatesRequestContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + SetGuardianFactorSmsTemplatesRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorSmsTemplatesRequestContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorSmsTemplatesRequestContent build() { + return new SetGuardianFactorSmsTemplatesRequestContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java new file mode 100644 index 000000000..db7494815 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GuardianFactorsProviderSmsProviderEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPhoneRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPhoneRequestContent { + private final GuardianFactorsProviderSmsProviderEnum provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPhoneRequestContent( + GuardianFactorsProviderSmsProviderEnum provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public GuardianFactorsProviderSmsProviderEnum getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPhoneRequestContent + && equalTo((SetGuardianFactorsProviderPhoneRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPhoneRequestContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderStage builder() { + return new Builder(); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider); + + Builder from(SetGuardianFactorsProviderPhoneRequestContent other); + } + + public interface _FinalStage { + SetGuardianFactorsProviderPhoneRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderStage, _FinalStage { + private GuardianFactorsProviderSmsProviderEnum provider; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorsProviderPhoneRequestContent other) { + provider(other.getProvider()); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorsProviderPhoneRequestContent build() { + return new SetGuardianFactorsProviderPhoneRequestContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java new file mode 100644 index 000000000..fd52ad20f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPhoneTwilioRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPhoneTwilioRequestContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPhoneTwilioRequestContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPhoneTwilioRequestContent + && equalTo((SetGuardianFactorsProviderPhoneTwilioRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioRequestContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPhoneTwilioRequestContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public SetGuardianFactorsProviderPhoneTwilioRequestContent build() { + return new SetGuardianFactorsProviderPhoneTwilioRequestContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java new file mode 100644 index 000000000..2c04c266d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GuardianFactorsProviderPushNotificationProviderDataEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationRequestContent { + private final GuardianFactorsProviderPushNotificationProviderDataEnum provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationRequestContent( + GuardianFactorsProviderPushNotificationProviderDataEnum provider, + Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public GuardianFactorsProviderPushNotificationProviderDataEnum getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationRequestContent + && equalTo((SetGuardianFactorsProviderPushNotificationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationRequestContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderStage builder() { + return new Builder(); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull GuardianFactorsProviderPushNotificationProviderDataEnum provider); + + Builder from(SetGuardianFactorsProviderPushNotificationRequestContent other); + } + + public interface _FinalStage { + SetGuardianFactorsProviderPushNotificationRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderStage, _FinalStage { + private GuardianFactorsProviderPushNotificationProviderDataEnum provider; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorsProviderPushNotificationRequestContent other) { + provider(other.getProvider()); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull GuardianFactorsProviderPushNotificationProviderDataEnum provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorsProviderPushNotificationRequestContent build() { + return new SetGuardianFactorsProviderPushNotificationRequestContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java new file mode 100644 index 000000000..badfad30f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationSnsRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationSnsRequestContent { + private final OptionalNullable awsAccessKeyId; + + private final OptionalNullable awsSecretAccessKey; + + private final OptionalNullable awsRegion; + + private final OptionalNullable snsApnsPlatformApplicationArn; + + private final OptionalNullable snsGcmPlatformApplicationArn; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationSnsRequestContent( + OptionalNullable awsAccessKeyId, + OptionalNullable awsSecretAccessKey, + OptionalNullable awsRegion, + OptionalNullable snsApnsPlatformApplicationArn, + OptionalNullable snsGcmPlatformApplicationArn, + Map additionalProperties) { + this.awsAccessKeyId = awsAccessKeyId; + this.awsSecretAccessKey = awsSecretAccessKey; + this.awsRegion = awsRegion; + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + public OptionalNullable getAwsAccessKeyId() { + if (awsAccessKeyId == null) { + return OptionalNullable.absent(); + } + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + public OptionalNullable getAwsSecretAccessKey() { + if (awsSecretAccessKey == null) { + return OptionalNullable.absent(); + } + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + public OptionalNullable getAwsRegion() { + if (awsRegion == null) { + return OptionalNullable.absent(); + } + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + public OptionalNullable getSnsApnsPlatformApplicationArn() { + if (snsApnsPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + public OptionalNullable getSnsGcmPlatformApplicationArn() { + if (snsGcmPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsGcmPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + private OptionalNullable _getAwsAccessKeyId() { + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + private OptionalNullable _getAwsSecretAccessKey() { + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + private OptionalNullable _getAwsRegion() { + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + private OptionalNullable _getSnsApnsPlatformApplicationArn() { + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + private OptionalNullable _getSnsGcmPlatformApplicationArn() { + return snsGcmPlatformApplicationArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationSnsRequestContent + && equalTo((SetGuardianFactorsProviderPushNotificationSnsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsRequestContent other) { + return awsAccessKeyId.equals(other.awsAccessKeyId) + && awsSecretAccessKey.equals(other.awsSecretAccessKey) + && awsRegion.equals(other.awsRegion) + && snsApnsPlatformApplicationArn.equals(other.snsApnsPlatformApplicationArn) + && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.awsRegion, + this.snsApnsPlatformApplicationArn, + this.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable awsAccessKeyId = OptionalNullable.absent(); + + private OptionalNullable awsSecretAccessKey = OptionalNullable.absent(); + + private OptionalNullable awsRegion = OptionalNullable.absent(); + + private OptionalNullable snsApnsPlatformApplicationArn = OptionalNullable.absent(); + + private OptionalNullable snsGcmPlatformApplicationArn = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationSnsRequestContent other) { + awsAccessKeyId(other.getAwsAccessKeyId()); + awsSecretAccessKey(other.getAwsSecretAccessKey()); + awsRegion(other.getAwsRegion()); + snsApnsPlatformApplicationArn(other.getSnsApnsPlatformApplicationArn()); + snsGcmPlatformApplicationArn(other.getSnsGcmPlatformApplicationArn()); + return this; + } + + @JsonSetter(value = "aws_access_key_id", nulls = Nulls.SKIP) + public Builder awsAccessKeyId(@Nullable OptionalNullable awsAccessKeyId) { + this.awsAccessKeyId = awsAccessKeyId; + return this; + } + + public Builder awsAccessKeyId(String awsAccessKeyId) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId); + return this; + } + + public Builder awsAccessKeyId(Optional awsAccessKeyId) { + if (awsAccessKeyId.isPresent()) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } else { + this.awsAccessKeyId = OptionalNullable.absent(); + } + return this; + } + + public Builder awsAccessKeyId(com.auth0.client.mgmt.core.Nullable awsAccessKeyId) { + if (awsAccessKeyId.isNull()) { + this.awsAccessKeyId = OptionalNullable.ofNull(); + } else if (awsAccessKeyId.isEmpty()) { + this.awsAccessKeyId = OptionalNullable.absent(); + } else { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } + return this; + } + + @JsonSetter(value = "aws_secret_access_key", nulls = Nulls.SKIP) + public Builder awsSecretAccessKey(@Nullable OptionalNullable awsSecretAccessKey) { + this.awsSecretAccessKey = awsSecretAccessKey; + return this; + } + + public Builder awsSecretAccessKey(String awsSecretAccessKey) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey); + return this; + } + + public Builder awsSecretAccessKey(Optional awsSecretAccessKey) { + if (awsSecretAccessKey.isPresent()) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } else { + this.awsSecretAccessKey = OptionalNullable.absent(); + } + return this; + } + + public Builder awsSecretAccessKey(com.auth0.client.mgmt.core.Nullable awsSecretAccessKey) { + if (awsSecretAccessKey.isNull()) { + this.awsSecretAccessKey = OptionalNullable.ofNull(); + } else if (awsSecretAccessKey.isEmpty()) { + this.awsSecretAccessKey = OptionalNullable.absent(); + } else { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } + return this; + } + + @JsonSetter(value = "aws_region", nulls = Nulls.SKIP) + public Builder awsRegion(@Nullable OptionalNullable awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + public Builder awsRegion(String awsRegion) { + this.awsRegion = OptionalNullable.of(awsRegion); + return this; + } + + public Builder awsRegion(Optional awsRegion) { + if (awsRegion.isPresent()) { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } else { + this.awsRegion = OptionalNullable.absent(); + } + return this; + } + + public Builder awsRegion(com.auth0.client.mgmt.core.Nullable awsRegion) { + if (awsRegion.isNull()) { + this.awsRegion = OptionalNullable.ofNull(); + } else if (awsRegion.isEmpty()) { + this.awsRegion = OptionalNullable.absent(); + } else { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } + return this; + } + + @JsonSetter(value = "sns_apns_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsApnsPlatformApplicationArn(@Nullable OptionalNullable snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + return this; + } + + public Builder snsApnsPlatformApplicationArn(String snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn); + return this; + } + + public Builder snsApnsPlatformApplicationArn(Optional snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isPresent()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsApnsPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isNull()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsApnsPlatformApplicationArn.isEmpty()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } + return this; + } + + @JsonSetter(value = "sns_gcm_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsGcmPlatformApplicationArn(@Nullable OptionalNullable snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + return this; + } + + public Builder snsGcmPlatformApplicationArn(String snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn); + return this; + } + + public Builder snsGcmPlatformApplicationArn(Optional snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isPresent()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsGcmPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isNull()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsGcmPlatformApplicationArn.isEmpty()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationSnsRequestContent build() { + return new SetGuardianFactorsProviderPushNotificationSnsRequestContent( + awsAccessKeyId, + awsSecretAccessKey, + awsRegion, + snsApnsPlatformApplicationArn, + snsGcmPlatformApplicationArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java new file mode 100644 index 000000000..7d041b21f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GuardianFactorsProviderSmsProviderEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderSmsRequestContent.Builder.class) +public final class SetGuardianFactorsProviderSmsRequestContent { + private final GuardianFactorsProviderSmsProviderEnum provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderSmsRequestContent( + GuardianFactorsProviderSmsProviderEnum provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public GuardianFactorsProviderSmsProviderEnum getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderSmsRequestContent + && equalTo((SetGuardianFactorsProviderSmsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderSmsRequestContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderStage builder() { + return new Builder(); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider); + + Builder from(SetGuardianFactorsProviderSmsRequestContent other); + } + + public interface _FinalStage { + SetGuardianFactorsProviderSmsRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderStage, _FinalStage { + private GuardianFactorsProviderSmsProviderEnum provider; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorsProviderSmsRequestContent other) { + provider(other.getProvider()); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorsProviderSmsRequestContent build() { + return new SetGuardianFactorsProviderSmsRequestContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java new file mode 100644 index 000000000..df428ac9b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderSmsTwilioRequestContent.Builder.class) +public final class SetGuardianFactorsProviderSmsTwilioRequestContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderSmsTwilioRequestContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderSmsTwilioRequestContent + && equalTo((SetGuardianFactorsProviderSmsTwilioRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderSmsTwilioRequestContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderSmsTwilioRequestContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public SetGuardianFactorsProviderSmsTwilioRequestContent build() { + return new SetGuardianFactorsProviderSmsTwilioRequestContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java new file mode 100644 index 000000000..1b2f29eed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationSnsRequestContent { + private final OptionalNullable awsAccessKeyId; + + private final OptionalNullable awsSecretAccessKey; + + private final OptionalNullable awsRegion; + + private final OptionalNullable snsApnsPlatformApplicationArn; + + private final OptionalNullable snsGcmPlatformApplicationArn; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationSnsRequestContent( + OptionalNullable awsAccessKeyId, + OptionalNullable awsSecretAccessKey, + OptionalNullable awsRegion, + OptionalNullable snsApnsPlatformApplicationArn, + OptionalNullable snsGcmPlatformApplicationArn, + Map additionalProperties) { + this.awsAccessKeyId = awsAccessKeyId; + this.awsSecretAccessKey = awsSecretAccessKey; + this.awsRegion = awsRegion; + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + public OptionalNullable getAwsAccessKeyId() { + if (awsAccessKeyId == null) { + return OptionalNullable.absent(); + } + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + public OptionalNullable getAwsSecretAccessKey() { + if (awsSecretAccessKey == null) { + return OptionalNullable.absent(); + } + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + public OptionalNullable getAwsRegion() { + if (awsRegion == null) { + return OptionalNullable.absent(); + } + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + public OptionalNullable getSnsApnsPlatformApplicationArn() { + if (snsApnsPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + public OptionalNullable getSnsGcmPlatformApplicationArn() { + if (snsGcmPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsGcmPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + private OptionalNullable _getAwsAccessKeyId() { + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + private OptionalNullable _getAwsSecretAccessKey() { + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + private OptionalNullable _getAwsRegion() { + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + private OptionalNullable _getSnsApnsPlatformApplicationArn() { + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + private OptionalNullable _getSnsGcmPlatformApplicationArn() { + return snsGcmPlatformApplicationArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsRequestContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationSnsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent other) { + return awsAccessKeyId.equals(other.awsAccessKeyId) + && awsSecretAccessKey.equals(other.awsSecretAccessKey) + && awsRegion.equals(other.awsRegion) + && snsApnsPlatformApplicationArn.equals(other.snsApnsPlatformApplicationArn) + && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.awsRegion, + this.snsApnsPlatformApplicationArn, + this.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable awsAccessKeyId = OptionalNullable.absent(); + + private OptionalNullable awsSecretAccessKey = OptionalNullable.absent(); + + private OptionalNullable awsRegion = OptionalNullable.absent(); + + private OptionalNullable snsApnsPlatformApplicationArn = OptionalNullable.absent(); + + private OptionalNullable snsGcmPlatformApplicationArn = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent other) { + awsAccessKeyId(other.getAwsAccessKeyId()); + awsSecretAccessKey(other.getAwsSecretAccessKey()); + awsRegion(other.getAwsRegion()); + snsApnsPlatformApplicationArn(other.getSnsApnsPlatformApplicationArn()); + snsGcmPlatformApplicationArn(other.getSnsGcmPlatformApplicationArn()); + return this; + } + + @JsonSetter(value = "aws_access_key_id", nulls = Nulls.SKIP) + public Builder awsAccessKeyId(@Nullable OptionalNullable awsAccessKeyId) { + this.awsAccessKeyId = awsAccessKeyId; + return this; + } + + public Builder awsAccessKeyId(String awsAccessKeyId) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId); + return this; + } + + public Builder awsAccessKeyId(Optional awsAccessKeyId) { + if (awsAccessKeyId.isPresent()) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } else { + this.awsAccessKeyId = OptionalNullable.absent(); + } + return this; + } + + public Builder awsAccessKeyId(com.auth0.client.mgmt.core.Nullable awsAccessKeyId) { + if (awsAccessKeyId.isNull()) { + this.awsAccessKeyId = OptionalNullable.ofNull(); + } else if (awsAccessKeyId.isEmpty()) { + this.awsAccessKeyId = OptionalNullable.absent(); + } else { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } + return this; + } + + @JsonSetter(value = "aws_secret_access_key", nulls = Nulls.SKIP) + public Builder awsSecretAccessKey(@Nullable OptionalNullable awsSecretAccessKey) { + this.awsSecretAccessKey = awsSecretAccessKey; + return this; + } + + public Builder awsSecretAccessKey(String awsSecretAccessKey) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey); + return this; + } + + public Builder awsSecretAccessKey(Optional awsSecretAccessKey) { + if (awsSecretAccessKey.isPresent()) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } else { + this.awsSecretAccessKey = OptionalNullable.absent(); + } + return this; + } + + public Builder awsSecretAccessKey(com.auth0.client.mgmt.core.Nullable awsSecretAccessKey) { + if (awsSecretAccessKey.isNull()) { + this.awsSecretAccessKey = OptionalNullable.ofNull(); + } else if (awsSecretAccessKey.isEmpty()) { + this.awsSecretAccessKey = OptionalNullable.absent(); + } else { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } + return this; + } + + @JsonSetter(value = "aws_region", nulls = Nulls.SKIP) + public Builder awsRegion(@Nullable OptionalNullable awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + public Builder awsRegion(String awsRegion) { + this.awsRegion = OptionalNullable.of(awsRegion); + return this; + } + + public Builder awsRegion(Optional awsRegion) { + if (awsRegion.isPresent()) { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } else { + this.awsRegion = OptionalNullable.absent(); + } + return this; + } + + public Builder awsRegion(com.auth0.client.mgmt.core.Nullable awsRegion) { + if (awsRegion.isNull()) { + this.awsRegion = OptionalNullable.ofNull(); + } else if (awsRegion.isEmpty()) { + this.awsRegion = OptionalNullable.absent(); + } else { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } + return this; + } + + @JsonSetter(value = "sns_apns_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsApnsPlatformApplicationArn(@Nullable OptionalNullable snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + return this; + } + + public Builder snsApnsPlatformApplicationArn(String snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn); + return this; + } + + public Builder snsApnsPlatformApplicationArn(Optional snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isPresent()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsApnsPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isNull()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsApnsPlatformApplicationArn.isEmpty()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } + return this; + } + + @JsonSetter(value = "sns_gcm_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsGcmPlatformApplicationArn(@Nullable OptionalNullable snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + return this; + } + + public Builder snsGcmPlatformApplicationArn(String snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn); + return this; + } + + public Builder snsGcmPlatformApplicationArn(Optional snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isPresent()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsGcmPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isNull()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsGcmPlatformApplicationArn.isEmpty()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationSnsRequestContent build() { + return new UpdateGuardianFactorsProviderPushNotificationSnsRequestContent( + awsAccessKeyId, + awsSecretAccessKey, + awsRegion, + snsApnsPlatformApplicationArn, + snsGcmPlatformApplicationArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java new file mode 100644 index 000000000..680a9edde --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java @@ -0,0 +1,323 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GuardianEnrollmentFactorEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateGuardianEnrollmentTicketRequestContent.Builder.class) +public final class CreateGuardianEnrollmentTicketRequestContent { + private final String userId; + + private final Optional email; + + private final Optional sendMail; + + private final Optional emailLocale; + + private final Optional factor; + + private final Optional allowMultipleEnrollments; + + private final Map additionalProperties; + + private CreateGuardianEnrollmentTicketRequestContent( + String userId, + Optional email, + Optional sendMail, + Optional emailLocale, + Optional factor, + Optional allowMultipleEnrollments, + Map additionalProperties) { + this.userId = userId; + this.email = email; + this.sendMail = sendMail; + this.emailLocale = emailLocale; + this.factor = factor; + this.allowMultipleEnrollments = allowMultipleEnrollments; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id for the enrollment ticket + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + /** + * @return alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Send an email to the user to start the enrollment + */ + @JsonProperty("send_mail") + public Optional getSendMail() { + return sendMail; + } + + /** + * @return Optional. Specify the locale of the enrollment email. Used with send_email. + */ + @JsonProperty("email_locale") + public Optional getEmailLocale() { + return emailLocale; + } + + @JsonProperty("factor") + public Optional getFactor() { + return factor; + } + + /** + * @return Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages. + */ + @JsonProperty("allow_multiple_enrollments") + public Optional getAllowMultipleEnrollments() { + return allowMultipleEnrollments; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateGuardianEnrollmentTicketRequestContent + && equalTo((CreateGuardianEnrollmentTicketRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateGuardianEnrollmentTicketRequestContent other) { + return userId.equals(other.userId) + && email.equals(other.email) + && sendMail.equals(other.sendMail) + && emailLocale.equals(other.emailLocale) + && factor.equals(other.factor) + && allowMultipleEnrollments.equals(other.allowMultipleEnrollments); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userId, this.email, this.sendMail, this.emailLocale, this.factor, this.allowMultipleEnrollments); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id for the enrollment ticket

+ */ + _FinalStage userId(@NotNull String userId); + + Builder from(CreateGuardianEnrollmentTicketRequestContent other); + } + + public interface _FinalStage { + CreateGuardianEnrollmentTicketRequestContent build(); + + /** + *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + /** + *

Send an email to the user to start the enrollment

+ */ + _FinalStage sendMail(Optional sendMail); + + _FinalStage sendMail(Boolean sendMail); + + /** + *

Optional. Specify the locale of the enrollment email. Used with send_email.

+ */ + _FinalStage emailLocale(Optional emailLocale); + + _FinalStage emailLocale(String emailLocale); + + _FinalStage factor(Optional factor); + + _FinalStage factor(GuardianEnrollmentFactorEnum factor); + + /** + *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

+ */ + _FinalStage allowMultipleEnrollments(Optional allowMultipleEnrollments); + + _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, _FinalStage { + private String userId; + + private Optional allowMultipleEnrollments = Optional.empty(); + + private Optional factor = Optional.empty(); + + private Optional emailLocale = Optional.empty(); + + private Optional sendMail = Optional.empty(); + + private Optional email = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateGuardianEnrollmentTicketRequestContent other) { + userId(other.getUserId()); + email(other.getEmail()); + sendMail(other.getSendMail()); + emailLocale(other.getEmailLocale()); + factor(other.getFactor()); + allowMultipleEnrollments(other.getAllowMultipleEnrollments()); + return this; + } + + /** + *

user_id for the enrollment ticket

+ *

user_id for the enrollment ticket

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + /** + *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments) { + this.allowMultipleEnrollments = Optional.ofNullable(allowMultipleEnrollments); + return this; + } + + /** + *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

+ */ + @java.lang.Override + @JsonSetter(value = "allow_multiple_enrollments", nulls = Nulls.SKIP) + public _FinalStage allowMultipleEnrollments(Optional allowMultipleEnrollments) { + this.allowMultipleEnrollments = allowMultipleEnrollments; + return this; + } + + @java.lang.Override + public _FinalStage factor(GuardianEnrollmentFactorEnum factor) { + this.factor = Optional.ofNullable(factor); + return this; + } + + @java.lang.Override + @JsonSetter(value = "factor", nulls = Nulls.SKIP) + public _FinalStage factor(Optional factor) { + this.factor = factor; + return this; + } + + /** + *

Optional. Specify the locale of the enrollment email. Used with send_email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage emailLocale(String emailLocale) { + this.emailLocale = Optional.ofNullable(emailLocale); + return this; + } + + /** + *

Optional. Specify the locale of the enrollment email. Used with send_email.

+ */ + @java.lang.Override + @JsonSetter(value = "email_locale", nulls = Nulls.SKIP) + public _FinalStage emailLocale(Optional emailLocale) { + this.emailLocale = emailLocale; + return this; + } + + /** + *

Send an email to the user to start the enrollment

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sendMail(Boolean sendMail) { + this.sendMail = Optional.ofNullable(sendMail); + return this; + } + + /** + *

Send an email to the user to start the enrollment

+ */ + @java.lang.Override + @JsonSetter(value = "send_mail", nulls = Nulls.SKIP) + public _FinalStage sendMail(Optional sendMail) { + this.sendMail = sendMail; + return this; + } + + /** + *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public CreateGuardianEnrollmentTicketRequestContent build() { + return new CreateGuardianEnrollmentTicketRequestContent( + userId, email, sendMail, emailLocale, factor, allowMultipleEnrollments, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java new file mode 100644 index 000000000..1f50447d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorRequestContent.Builder.class) +public final class SetGuardianFactorRequestContent { + private final boolean enabled; + + private final Map additionalProperties; + + private SetGuardianFactorRequestContent(boolean enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether this factor is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorRequestContent && equalTo((SetGuardianFactorRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorRequestContent other) { + return enabled == other.enabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether this factor is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(SetGuardianFactorRequestContent other); + } + + public interface _FinalStage { + SetGuardianFactorRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorRequestContent other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Whether this factor is enabled (true) or disabled (false).

+ *

Whether this factor is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @java.lang.Override + public SetGuardianFactorRequestContent build() { + return new SetGuardianFactorRequestContent(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java new file mode 100644 index 000000000..6583f6ba5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java @@ -0,0 +1,413 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.hooks; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSecretsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSecretsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public CompletableFuture>> get(String id) { + return get(id, null); + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public CompletableFuture>> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public CompletableFuture> create(String id, Map request) { + return create(id, request, null); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public CompletableFuture> create( + String id, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public CompletableFuture> delete(String id, List request) { + return delete(id, request, null); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public CompletableFuture> delete( + String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public CompletableFuture> update(String id, Map request) { + return update(id, request, null); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public CompletableFuture> update( + String id, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java new file mode 100644 index 000000000..fd5c1611a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.hooks; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AsyncSecretsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSecretsClient rawClient; + + public AsyncSecretsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSecretsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSecretsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public CompletableFuture create(String id, Map request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public CompletableFuture create(String id, Map request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public CompletableFuture delete(String id, List request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public CompletableFuture delete(String id, List request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public CompletableFuture update(String id, Map request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public CompletableFuture update(String id, Map request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java new file mode 100644 index 000000000..3ea5342f2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.hooks; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSecretsClient { + protected final ClientOptions clientOptions; + + public RawSecretsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public ManagementApiHttpResponse> get(String id) { + return get(id, null); + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public ManagementApiHttpResponse create(String id, Map request) { + return create(id, request, null); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public ManagementApiHttpResponse create( + String id, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public ManagementApiHttpResponse delete(String id, List request) { + return delete(id, request, null); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public ManagementApiHttpResponse delete(String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public ManagementApiHttpResponse update(String id, Map request) { + return update(id, request, null); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public ManagementApiHttpResponse update( + String id, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hooks") + .addPathSegment(id) + .addPathSegments("secrets") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java new file mode 100644 index 000000000..a35e20289 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.hooks; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.List; +import java.util.Map; + +public class SecretsClient { + protected final ClientOptions clientOptions; + + private final RawSecretsClient rawClient; + + public SecretsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSecretsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSecretsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public Map get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve a hook's secrets by the ID of the hook. + */ + public Map get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public void create(String id, Map request) { + this.rawClient.create(id, request).body(); + } + + /** + * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. + */ + public void create(String id, Map request, RequestOptions requestOptions) { + this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public void delete(String id, List request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. + */ + public void delete(String id, List request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public void update(String id, Map request) { + this.rawClient.update(id, request).body(); + } + + /** + * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. + */ + public void update(String id, Map request, RequestOptions requestOptions) { + this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncErrorsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncErrorsClient.java new file mode 100644 index 000000000..55043ca49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncErrorsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.ErrorsGetResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncErrorsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawErrorsClient rawClient; + + public AsyncErrorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawErrorsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawErrorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve error details of a failed job. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve error details of a failed job. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawErrorsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawErrorsClient.java new file mode 100644 index 000000000..03417da76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawErrorsClient.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.ErrorsGetResponse; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawErrorsClient { + protected final ClientOptions clientOptions; + + public AsyncRawErrorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve error details of a failed job. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve error details of a failed job. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs") + .addPathSegment(id) + .addPathSegments("errors") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorsGetResponse.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersExportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersExportsClient.java new file mode 100644 index 000000000..ed62d74e1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersExportsClient.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateExportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateExportUsersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersExportsClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersExportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture> create() { + return create(CreateExportUsersRequestContent.builder().build()); + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture> create( + CreateExportUsersRequestContent request) { + return create(request, null); + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture> create( + CreateExportUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-exports") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateExportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersImportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersImportsClient.java new file mode 100644 index 000000000..9ec3608d5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawUsersImportsClient.java @@ -0,0 +1,507 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.FileStream; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ContentTooLargeError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateImportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateImportUsersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersImportsClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersImportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CompletableFuture> create( + File users, CreateImportUsersRequestContent request) { + return create(users, request, null); + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CompletableFuture> create( + File users, CreateImportUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + try { + String usersMimeType = Files.probeContentType(users.toPath()); + MediaType usersMimeTypeMediaType = usersMimeType != null ? MediaType.parse(usersMimeType) : null; + multipartBodyBuilder.addFormDataPart( + "users", users.getName(), RequestBody.create(users, usersMimeTypeMediaType)); + multipartBodyBuilder.addFormDataPart( + "connection_id", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getConnectionId())); + if (request.getUpsert().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "upsert", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getUpsert().get())); + } + if (request.getExternalId().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "external_id", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getExternalId().get())); + } + if (request.getSendCompletionEmail().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "send_completion_email", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getSendCompletionEmail().get())); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl) + .method("POST", multipartBodyBuilder.build()) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateImportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 413: + future.completeExceptionally(new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + InputStream stream, String filename) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateImportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 413: + future.completeExceptionally(new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + InputStream stream, String filename, MediaType mediaType) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateImportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 413: + future.completeExceptionally(new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + InputStream stream, String filename, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateImportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 413: + future.completeExceptionally(new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + InputStream stream, String filename, MediaType mediaType, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateImportUsersResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 413: + future.completeExceptionally(new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawVerificationEmailClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawVerificationEmailClient.java new file mode 100644 index 000000000..067880b49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncRawVerificationEmailClient.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateVerificationEmailRequestContent; +import com.auth0.client.mgmt.types.CreateVerificationEmailResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawVerificationEmailClient { + protected final ClientOptions clientOptions; + + public AsyncRawVerificationEmailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CompletableFuture> create( + CreateVerificationEmailRequestContent request) { + return create(request, null); + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CompletableFuture> create( + CreateVerificationEmailRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/verification-email") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateVerificationEmailResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersExportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersExportsClient.java new file mode 100644 index 000000000..048fc7282 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersExportsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateExportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateExportUsersResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersExportsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersExportsClient rawClient; + + public AsyncUsersExportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersExportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersExportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture create(CreateExportUsersRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Export all users to a file via a long-running job. + */ + public CompletableFuture create( + CreateExportUsersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersImportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersImportsClient.java new file mode 100644 index 000000000..3e5e32661 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncUsersImportsClient.java @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateImportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateImportUsersResponseContent; +import java.io.File; +import java.io.InputStream; +import java.util.concurrent.CompletableFuture; +import okhttp3.MediaType; + +public class AsyncUsersImportsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersImportsClient rawClient; + + public AsyncUsersImportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersImportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersImportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CompletableFuture create( + File users, CreateImportUsersRequestContent request) { + return this.rawClient.create(users, request).thenApply(response -> response.body()); + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CompletableFuture create( + File users, CreateImportUsersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(users, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create(InputStream stream, String filename) { + return this.rawClient.create(stream, filename).thenApply(response -> response.body()); + } + + public CompletableFuture create( + InputStream stream, String filename, MediaType mediaType) { + return this.rawClient.create(stream, filename, mediaType).thenApply(response -> response.body()); + } + + public CompletableFuture create( + InputStream stream, String filename, RequestOptions requestOptions) { + return this.rawClient.create(stream, filename, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create( + InputStream stream, String filename, MediaType mediaType, RequestOptions requestOptions) { + return this.rawClient + .create(stream, filename, mediaType, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/AsyncVerificationEmailClient.java b/src/main/java/com/auth0/client/mgmt/jobs/AsyncVerificationEmailClient.java new file mode 100644 index 000000000..5533d81c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/AsyncVerificationEmailClient.java @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateVerificationEmailRequestContent; +import com.auth0.client.mgmt.types.CreateVerificationEmailResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncVerificationEmailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawVerificationEmailClient rawClient; + + public AsyncVerificationEmailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawVerificationEmailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawVerificationEmailClient withRawResponse() { + return this.rawClient; + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CompletableFuture create( + CreateVerificationEmailRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CompletableFuture create( + CreateVerificationEmailRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/ErrorsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/ErrorsClient.java new file mode 100644 index 000000000..bde7f5fd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/ErrorsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.ErrorsGetResponse; + +public class ErrorsClient { + protected final ClientOptions clientOptions; + + private final RawErrorsClient rawClient; + + public ErrorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawErrorsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawErrorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve error details of a failed job. + */ + public ErrorsGetResponse get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve error details of a failed job. + */ + public ErrorsGetResponse get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/RawErrorsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/RawErrorsClient.java new file mode 100644 index 000000000..0c939a325 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/RawErrorsClient.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.ErrorsGetResponse; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawErrorsClient { + protected final ClientOptions clientOptions; + + public RawErrorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve error details of a failed job. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve error details of a failed job. + */ + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs") + .addPathSegment(id) + .addPathSegments("errors") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorsGetResponse.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/RawUsersExportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/RawUsersExportsClient.java new file mode 100644 index 000000000..31e18ab67 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/RawUsersExportsClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateExportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateExportUsersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersExportsClient { + protected final ClientOptions clientOptions; + + public RawUsersExportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Export all users to a file via a long-running job. + */ + public ManagementApiHttpResponse create() { + return create(CreateExportUsersRequestContent.builder().build()); + } + + /** + * Export all users to a file via a long-running job. + */ + public ManagementApiHttpResponse create(CreateExportUsersRequestContent request) { + return create(request, null); + } + + /** + * Export all users to a file via a long-running job. + */ + public ManagementApiHttpResponse create( + CreateExportUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-exports") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateExportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/RawUsersImportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/RawUsersImportsClient.java new file mode 100644 index 000000000..15d463e8c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/RawUsersImportsClient.java @@ -0,0 +1,367 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.FileStream; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ContentTooLargeError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.InternalServerError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateImportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateImportUsersResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersImportsClient { + protected final ClientOptions clientOptions; + + public RawUsersImportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public ManagementApiHttpResponse create( + File users, CreateImportUsersRequestContent request) { + return create(users, request, null); + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public ManagementApiHttpResponse create( + File users, CreateImportUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + try { + String usersMimeType = Files.probeContentType(users.toPath()); + MediaType usersMimeTypeMediaType = usersMimeType != null ? MediaType.parse(usersMimeType) : null; + multipartBodyBuilder.addFormDataPart( + "users", users.getName(), RequestBody.create(users, usersMimeTypeMediaType)); + multipartBodyBuilder.addFormDataPart( + "connection_id", ObjectMappers.JSON_MAPPER.writeValueAsString(request.getConnectionId())); + if (request.getUpsert().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "upsert", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getUpsert().get())); + } + if (request.getExternalId().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "external_id", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getExternalId().get())); + } + if (request.getSendCompletionEmail().isPresent()) { + multipartBodyBuilder.addFormDataPart( + "send_completion_email", + ObjectMappers.JSON_MAPPER.writeValueAsString( + request.getSendCompletionEmail().get())); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl) + .method("POST", multipartBodyBuilder.build()) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateImportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 413: + throw new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create(InputStream stream, String filename) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateImportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 413: + throw new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + InputStream stream, String filename, MediaType mediaType) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateImportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 413: + throw new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + InputStream stream, String filename, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateImportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 413: + throw new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + InputStream stream, String filename, MediaType mediaType, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/users-imports") + .build(); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("users", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateImportUsersResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 413: + throw new ContentTooLargeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/RawVerificationEmailClient.java b/src/main/java/com/auth0/client/mgmt/jobs/RawVerificationEmailClient.java new file mode 100644 index 000000000..f795154ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/RawVerificationEmailClient.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.jobs.types.CreateVerificationEmailRequestContent; +import com.auth0.client.mgmt.types.CreateVerificationEmailResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawVerificationEmailClient { + protected final ClientOptions clientOptions; + + public RawVerificationEmailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public ManagementApiHttpResponse create( + CreateVerificationEmailRequestContent request) { + return create(request, null); + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public ManagementApiHttpResponse create( + CreateVerificationEmailRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("jobs/verification-email") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateVerificationEmailResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/UsersExportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/UsersExportsClient.java new file mode 100644 index 000000000..1599e2ce5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/UsersExportsClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateExportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateExportUsersResponseContent; + +public class UsersExportsClient { + protected final ClientOptions clientOptions; + + private final RawUsersExportsClient rawClient; + + public UsersExportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersExportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersExportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Export all users to a file via a long-running job. + */ + public CreateExportUsersResponseContent create() { + return this.rawClient.create().body(); + } + + /** + * Export all users to a file via a long-running job. + */ + public CreateExportUsersResponseContent create(CreateExportUsersRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Export all users to a file via a long-running job. + */ + public CreateExportUsersResponseContent create( + CreateExportUsersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/UsersImportsClient.java b/src/main/java/com/auth0/client/mgmt/jobs/UsersImportsClient.java new file mode 100644 index 000000000..19cd59ea9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/UsersImportsClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateImportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateImportUsersResponseContent; +import java.io.File; +import java.io.InputStream; +import okhttp3.MediaType; + +public class UsersImportsClient { + protected final ClientOptions clientOptions; + + private final RawUsersImportsClient rawClient; + + public UsersImportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersImportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersImportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CreateImportUsersResponseContent create(File users, CreateImportUsersRequestContent request) { + return this.rawClient.create(users, request).body(); + } + + /** + * Import users from a <a href="https://auth0.com/docs/users/references/bulk-import-database-schema-examples">formatted file</a> into a connection via a long-running job. When importing users, with or without upsert, the email_verified is set to false when the email address is added or updated. Users must verify their email address. To avoid this behavior, set email_verified to true in the imported data. + */ + public CreateImportUsersResponseContent create( + File users, CreateImportUsersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(users, request, requestOptions).body(); + } + + public CreateImportUsersResponseContent create(InputStream stream, String filename) { + return this.rawClient.create(stream, filename).body(); + } + + public CreateImportUsersResponseContent create(InputStream stream, String filename, MediaType mediaType) { + return this.rawClient.create(stream, filename, mediaType).body(); + } + + public CreateImportUsersResponseContent create(InputStream stream, String filename, RequestOptions requestOptions) { + return this.rawClient.create(stream, filename, requestOptions).body(); + } + + public CreateImportUsersResponseContent create( + InputStream stream, String filename, MediaType mediaType, RequestOptions requestOptions) { + return this.rawClient + .create(stream, filename, mediaType, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/VerificationEmailClient.java b/src/main/java/com/auth0/client/mgmt/jobs/VerificationEmailClient.java new file mode 100644 index 000000000..d00c8a7be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/VerificationEmailClient.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.jobs.types.CreateVerificationEmailRequestContent; +import com.auth0.client.mgmt.types.CreateVerificationEmailResponseContent; + +public class VerificationEmailClient { + protected final ClientOptions clientOptions; + + private final RawVerificationEmailClient rawClient; + + public VerificationEmailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawVerificationEmailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawVerificationEmailClient withRawResponse() { + return this.rawClient; + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CreateVerificationEmailResponseContent create(CreateVerificationEmailRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Send an email to the specified user that asks them to click a link to <a href="https://auth0.com/docs/email/custom#verification-email">verify their email address</a>. + *

Note: You must have the Status toggle enabled for the verification email template for the email to be sent.

+ */ + public CreateVerificationEmailResponseContent create( + CreateVerificationEmailRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java new file mode 100644 index 000000000..363375c59 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateExportUsersFields; +import com.auth0.client.mgmt.types.JobFileFormatEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateExportUsersRequestContent.Builder.class) +public final class CreateExportUsersRequestContent { + private final Optional connectionId; + + private final Optional format; + + private final Optional limit; + + private final Optional> fields; + + private final Map additionalProperties; + + private CreateExportUsersRequestContent( + Optional connectionId, + Optional format, + Optional limit, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.format = format; + this.limit = limit; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + /** + * @return connection_id of the connection from which users will be exported. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + /** + * @return Limit the number of records. + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return List of fields to be included in the CSV. Defaults to a predefined set of fields. + */ + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateExportUsersRequestContent && equalTo((CreateExportUsersRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateExportUsersRequestContent other) { + return connectionId.equals(other.connectionId) + && format.equals(other.format) + && limit.equals(other.limit) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.format, this.limit, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional format = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional> fields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateExportUsersRequestContent other) { + connectionId(other.getConnectionId()); + format(other.getFormat()); + limit(other.getLimit()); + fields(other.getFields()); + return this; + } + + /** + *

connection_id of the connection from which users will be exported.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public Builder format(Optional format) { + this.format = format; + return this; + } + + public Builder format(JobFileFormatEnum format) { + this.format = Optional.ofNullable(format); + return this; + } + + /** + *

Limit the number of records.

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(Optional> fields) { + this.fields = fields; + return this; + } + + public Builder fields(List fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + public CreateExportUsersRequestContent build() { + return new CreateExportUsersRequestContent(connectionId, format, limit, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java new file mode 100644 index 000000000..ef399ab4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateImportUsersRequestContent.Builder.class) +public final class CreateImportUsersRequestContent { + private final String connectionId; + + private final Optional upsert; + + private final Optional externalId; + + private final Optional sendCompletionEmail; + + private final Map additionalProperties; + + private CreateImportUsersRequestContent( + String connectionId, + Optional upsert, + Optional externalId, + Optional sendCompletionEmail, + Map additionalProperties) { + this.connectionId = connectionId; + this.upsert = upsert; + this.externalId = externalId; + this.sendCompletionEmail = sendCompletionEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return connection_id of the connection to which users will be imported. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return Whether to update users if they already exist (true) or to ignore them (false). + */ + @JsonProperty("upsert") + public Optional getUpsert() { + return upsert; + } + + /** + * @return Customer-defined ID. + */ + @JsonProperty("external_id") + public Optional getExternalId() { + return externalId; + } + + /** + * @return Whether to send a completion email to all tenant owners when the job is finished (true) or not (false). + */ + @JsonProperty("send_completion_email") + public Optional getSendCompletionEmail() { + return sendCompletionEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateImportUsersRequestContent && equalTo((CreateImportUsersRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateImportUsersRequestContent other) { + return connectionId.equals(other.connectionId) + && upsert.equals(other.upsert) + && externalId.equals(other.externalId) + && sendCompletionEmail.equals(other.sendCompletionEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.upsert, this.externalId, this.sendCompletionEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

connection_id of the connection to which users will be imported.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(CreateImportUsersRequestContent other); + } + + public interface _FinalStage { + CreateImportUsersRequestContent build(); + + /** + *

Whether to update users if they already exist (true) or to ignore them (false).

+ */ + _FinalStage upsert(Optional upsert); + + _FinalStage upsert(Boolean upsert); + + /** + *

Customer-defined ID.

+ */ + _FinalStage externalId(Optional externalId); + + _FinalStage externalId(String externalId); + + /** + *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

+ */ + _FinalStage sendCompletionEmail(Optional sendCompletionEmail); + + _FinalStage sendCompletionEmail(Boolean sendCompletionEmail); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional sendCompletionEmail = Optional.empty(); + + private Optional externalId = Optional.empty(); + + private Optional upsert = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateImportUsersRequestContent other) { + connectionId(other.getConnectionId()); + upsert(other.getUpsert()); + externalId(other.getExternalId()); + sendCompletionEmail(other.getSendCompletionEmail()); + return this; + } + + /** + *

connection_id of the connection to which users will be imported.

+ *

connection_id of the connection to which users will be imported.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sendCompletionEmail(Boolean sendCompletionEmail) { + this.sendCompletionEmail = Optional.ofNullable(sendCompletionEmail); + return this; + } + + /** + *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "send_completion_email", nulls = Nulls.SKIP) + public _FinalStage sendCompletionEmail(Optional sendCompletionEmail) { + this.sendCompletionEmail = sendCompletionEmail; + return this; + } + + /** + *

Customer-defined ID.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage externalId(String externalId) { + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + *

Customer-defined ID.

+ */ + @java.lang.Override + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public _FinalStage externalId(Optional externalId) { + this.externalId = externalId; + return this; + } + + /** + *

Whether to update users if they already exist (true) or to ignore them (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage upsert(Boolean upsert) { + this.upsert = Optional.ofNullable(upsert); + return this; + } + + /** + *

Whether to update users if they already exist (true) or to ignore them (false).

+ */ + @java.lang.Override + @JsonSetter(value = "upsert", nulls = Nulls.SKIP) + public _FinalStage upsert(Optional upsert) { + this.upsert = upsert; + return this; + } + + @java.lang.Override + public CreateImportUsersRequestContent build() { + return new CreateImportUsersRequestContent( + connectionId, upsert, externalId, sendCompletionEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java new file mode 100644 index 000000000..2aefa6c31 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.Identity; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateVerificationEmailRequestContent.Builder.class) +public final class CreateVerificationEmailRequestContent { + private final String userId; + + private final Optional clientId; + + private final Optional identity; + + private final Optional organizationId; + + private final Map additionalProperties; + + private CreateVerificationEmailRequestContent( + String userId, + Optional clientId, + Optional identity, + Optional organizationId, + Map additionalProperties) { + this.userId = userId; + this.clientId = clientId; + this.identity = identity; + this.organizationId = organizationId; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id of the user to send the verification email to. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + /** + * @return client_id of the client (application). If no value provided, the global Client ID will be used. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("identity") + public Optional getIdentity() { + return identity; + } + + /** + * @return (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateVerificationEmailRequestContent + && equalTo((CreateVerificationEmailRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateVerificationEmailRequestContent other) { + return userId.equals(other.userId) + && clientId.equals(other.clientId) + && identity.equals(other.identity) + && organizationId.equals(other.organizationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userId, this.clientId, this.identity, this.organizationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id of the user to send the verification email to.

+ */ + _FinalStage userId(@NotNull String userId); + + Builder from(CreateVerificationEmailRequestContent other); + } + + public interface _FinalStage { + CreateVerificationEmailRequestContent build(); + + /** + *

client_id of the client (application). If no value provided, the global Client ID will be used.

+ */ + _FinalStage clientId(Optional clientId); + + _FinalStage clientId(String clientId); + + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ */ + _FinalStage organizationId(Optional organizationId); + + _FinalStage organizationId(String organizationId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, _FinalStage { + private String userId; + + private Optional organizationId = Optional.empty(); + + private Optional identity = Optional.empty(); + + private Optional clientId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateVerificationEmailRequestContent other) { + userId(other.getUserId()); + clientId(other.getClientId()); + identity(other.getIdentity()); + organizationId(other.getOrganizationId()); + return this; + } + + /** + *

user_id of the user to send the verification email to.

+ *

user_id of the user to send the verification email to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public _FinalStage organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + + /** + *

client_id of the client (application). If no value provided, the global Client ID will be used.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

client_id of the client (application). If no value provided, the global Client ID will be used.

+ */ + @java.lang.Override + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public _FinalStage clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + @java.lang.Override + public CreateVerificationEmailRequestContent build() { + return new CreateVerificationEmailRequestContent( + userId, clientId, identity, organizationId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java new file mode 100644 index 000000000..234a856c7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.jobs.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetJobErrorResponseContent; +import com.auth0.client.mgmt.types.GetJobGenericErrorResponseContent; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = ErrorsGetResponse.Deserializer.class) +public final class ErrorsGetResponse { + private final Object value; + + private final int type; + + private ErrorsGetResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((List) this.value); + } else if (this.type == 1) { + return visitor.visit((GetJobGenericErrorResponseContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorsGetResponse && equalTo((ErrorsGetResponse) other); + } + + private boolean equalTo(ErrorsGetResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ErrorsGetResponse of(List value) { + return new ErrorsGetResponse(value, 0); + } + + public static ErrorsGetResponse of(GetJobGenericErrorResponseContent value) { + return new ErrorsGetResponse(value, 1); + } + + public interface Visitor { + T visit(List value); + + T visit(GetJobGenericErrorResponseContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ErrorsGetResponse.class); + } + + @java.lang.Override + public ErrorsGetResponse deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, GetJobGenericErrorResponseContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncCustomSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncCustomSigningClient.java new file mode 100644 index 000000000..66e2a00be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncCustomSigningClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.keys.types.SetCustomSigningKeysRequestContent; +import com.auth0.client.mgmt.types.GetCustomSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SetCustomSigningKeysResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomSigningClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomSigningClient rawClient; + + public AsyncCustomSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomSigningClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomSigningClient withRawResponse() { + return this.rawClient; + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public CompletableFuture set(SetCustomSigningKeysRequestContent request) { + return this.rawClient.set(request).thenApply(response -> response.body()); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public CompletableFuture set( + SetCustomSigningKeysRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncEncryptionClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncEncryptionClient.java new file mode 100644 index 000000000..fab4f4f50 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncEncryptionClient.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ListEncryptionKeysRequestParameters; +import com.auth0.client.mgmt.types.CreateEncryptionKeyPublicWrappingResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.EncryptionKey; +import com.auth0.client.mgmt.types.GetEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ImportEncryptionKeyResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncEncryptionClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEncryptionClient rawClient; + + public AsyncEncryptionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEncryptionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEncryptionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture> list(ListEncryptionKeysRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture> list( + ListEncryptionKeysRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CompletableFuture create(CreateEncryptionKeyRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CompletableFuture create( + CreateEncryptionKeyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public CompletableFuture rekey() { + return this.rawClient.rekey().thenApply(response -> response.body()); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public CompletableFuture rekey(RequestOptions requestOptions) { + return this.rawClient.rekey(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public CompletableFuture get(String kid) { + return this.rawClient.get(kid).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public CompletableFuture get(String kid, RequestOptions requestOptions) { + return this.rawClient.get(kid, requestOptions).thenApply(response -> response.body()); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public CompletableFuture import_( + String kid, ImportEncryptionKeyRequestContent request) { + return this.rawClient.import_(kid, request).thenApply(response -> response.body()); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public CompletableFuture import_( + String kid, ImportEncryptionKeyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.import_(kid, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public CompletableFuture delete(String kid) { + return this.rawClient.delete(kid).thenApply(response -> response.body()); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public CompletableFuture delete(String kid, RequestOptions requestOptions) { + return this.rawClient.delete(kid, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CompletableFuture createPublicWrappingKey(String kid) { + return this.rawClient.createPublicWrappingKey(kid).thenApply(response -> response.body()); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CompletableFuture createPublicWrappingKey( + String kid, RequestOptions requestOptions) { + return this.rawClient.createPublicWrappingKey(kid, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncKeysClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncKeysClient.java new file mode 100644 index 000000000..8823269ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncKeysClient.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncKeysClient { + protected final ClientOptions clientOptions; + + protected final Supplier customSigningClient; + + protected final Supplier encryptionClient; + + protected final Supplier signingClient; + + public AsyncKeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.customSigningClient = Suppliers.memoize(() -> new AsyncCustomSigningClient(clientOptions)); + this.encryptionClient = Suppliers.memoize(() -> new AsyncEncryptionClient(clientOptions)); + this.signingClient = Suppliers.memoize(() -> new AsyncSigningClient(clientOptions)); + } + + public AsyncCustomSigningClient customSigning() { + return this.customSigningClient.get(); + } + + public AsyncEncryptionClient encryption() { + return this.encryptionClient.get(); + } + + public AsyncSigningClient signing() { + return this.signingClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncRawCustomSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawCustomSigningClient.java new file mode 100644 index 000000000..0d30c22b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawCustomSigningClient.java @@ -0,0 +1,289 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.keys.types.SetCustomSigningKeysRequestContent; +import com.auth0.client.mgmt.types.GetCustomSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SetCustomSigningKeysResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomSigningClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetCustomSigningKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public CompletableFuture> set( + SetCustomSigningKeysRequestContent request) { + return set(request, null); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public CompletableFuture> set( + SetCustomSigningKeysRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetCustomSigningKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java new file mode 100644 index 000000000..c0babe613 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java @@ -0,0 +1,691 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ListEncryptionKeysRequestParameters; +import com.auth0.client.mgmt.types.CreateEncryptionKeyPublicWrappingResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.EncryptionKey; +import com.auth0.client.mgmt.types.GetEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ImportEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ListEncryptionKeyOffsetPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEncryptionClient { + protected final ClientOptions clientOptions; + + public AsyncRawEncryptionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture>> list() { + return list(ListEncryptionKeysRequestParameters.builder().build()); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture>> list( + ListEncryptionKeysRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public CompletableFuture>> list( + ListEncryptionKeysRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListEncryptionKeyOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListEncryptionKeyOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListEncryptionKeysRequestParameters nextRequest = ListEncryptionKeysRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getKeys().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CompletableFuture> create( + CreateEncryptionKeyRequestContent request) { + return create(request, null); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CompletableFuture> create( + CreateEncryptionKeyRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEncryptionKeyResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public CompletableFuture> rekey() { + return rekey(null); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public CompletableFuture> rekey(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption/rekey") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public CompletableFuture> get(String kid) { + return get(kid, null); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public CompletableFuture> get( + String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetEncryptionKeyResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Import wrapped key material and activate encryption key. + */ + public CompletableFuture> import_( + String kid, ImportEncryptionKeyRequestContent request) { + return import_(kid, request, null); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public CompletableFuture> import_( + String kid, ImportEncryptionKeyRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ImportEncryptionKeyResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public CompletableFuture> delete(String kid) { + return delete(kid, null); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public CompletableFuture> delete(String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CompletableFuture> + createPublicWrappingKey(String kid) { + return createPublicWrappingKey(kid, null); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CompletableFuture> + createPublicWrappingKey(String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .addPathSegments("wrapping-key") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEncryptionKeyPublicWrappingResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncRawSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawSigningClient.java new file mode 100644 index 000000000..56f3529a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawSigningClient.java @@ -0,0 +1,370 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RevokedSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RotateSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SigningKeys; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSigningClient { + protected final ClientOptions clientOptions; + + public AsyncRawSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Rotate the application signing key of your tenant. + */ + public CompletableFuture> rotate() { + return rotate(null); + } + + /** + * Rotate the application signing key of your tenant. + */ + public CompletableFuture> rotate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing/rotate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RotateSigningKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public CompletableFuture> get(String kid) { + return get(kid, null); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public CompletableFuture> get( + String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetSigningKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Revoke the application signing key with the given ID. + */ + public CompletableFuture> revoke(String kid) { + return revoke(kid, null); + } + + /** + * Revoke the application signing key with the given ID. + */ + public CompletableFuture> revoke( + String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .addPathSegment(kid) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RevokedSigningKeysResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncSigningClient.java new file mode 100644 index 000000000..f5cedffd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncSigningClient.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RevokedSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RotateSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SigningKeys; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncSigningClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSigningClient rawClient; + + public AsyncSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSigningClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSigningClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Rotate the application signing key of your tenant. + */ + public CompletableFuture rotate() { + return this.rawClient.rotate().thenApply(response -> response.body()); + } + + /** + * Rotate the application signing key of your tenant. + */ + public CompletableFuture rotate(RequestOptions requestOptions) { + return this.rawClient.rotate(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public CompletableFuture get(String kid) { + return this.rawClient.get(kid).thenApply(response -> response.body()); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public CompletableFuture get(String kid, RequestOptions requestOptions) { + return this.rawClient.get(kid, requestOptions).thenApply(response -> response.body()); + } + + /** + * Revoke the application signing key with the given ID. + */ + public CompletableFuture revoke(String kid) { + return this.rawClient.revoke(kid).thenApply(response -> response.body()); + } + + /** + * Revoke the application signing key with the given ID. + */ + public CompletableFuture revoke(String kid, RequestOptions requestOptions) { + return this.rawClient.revoke(kid, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/CustomSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/CustomSigningClient.java new file mode 100644 index 000000000..eb3b4981f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/CustomSigningClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.keys.types.SetCustomSigningKeysRequestContent; +import com.auth0.client.mgmt.types.GetCustomSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SetCustomSigningKeysResponseContent; + +public class CustomSigningClient { + protected final ClientOptions clientOptions; + + private final RawCustomSigningClient rawClient; + + public CustomSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomSigningClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomSigningClient withRawResponse() { + return this.rawClient; + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public GetCustomSigningKeysResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public GetCustomSigningKeysResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public SetCustomSigningKeysResponseContent set(SetCustomSigningKeysRequestContent request) { + return this.rawClient.set(request).body(); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public SetCustomSigningKeysResponseContent set( + SetCustomSigningKeysRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).body(); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/EncryptionClient.java b/src/main/java/com/auth0/client/mgmt/keys/EncryptionClient.java new file mode 100644 index 000000000..0830d6d7d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/EncryptionClient.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ListEncryptionKeysRequestParameters; +import com.auth0.client.mgmt.types.CreateEncryptionKeyPublicWrappingResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.EncryptionKey; +import com.auth0.client.mgmt.types.GetEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ImportEncryptionKeyResponseContent; + +public class EncryptionClient { + protected final ClientOptions clientOptions; + + private final RawEncryptionClient rawClient; + + public EncryptionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEncryptionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEncryptionClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public SyncPagingIterable list(ListEncryptionKeysRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public SyncPagingIterable list( + ListEncryptionKeysRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CreateEncryptionKeyResponseContent create(CreateEncryptionKeyRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public CreateEncryptionKeyResponseContent create( + CreateEncryptionKeyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public void rekey() { + this.rawClient.rekey().body(); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public void rekey(RequestOptions requestOptions) { + this.rawClient.rekey(requestOptions).body(); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public GetEncryptionKeyResponseContent get(String kid) { + return this.rawClient.get(kid).body(); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public GetEncryptionKeyResponseContent get(String kid, RequestOptions requestOptions) { + return this.rawClient.get(kid, requestOptions).body(); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public ImportEncryptionKeyResponseContent import_(String kid, ImportEncryptionKeyRequestContent request) { + return this.rawClient.import_(kid, request).body(); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public ImportEncryptionKeyResponseContent import_( + String kid, ImportEncryptionKeyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.import_(kid, request, requestOptions).body(); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public void delete(String kid) { + this.rawClient.delete(kid).body(); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public void delete(String kid, RequestOptions requestOptions) { + this.rawClient.delete(kid, requestOptions).body(); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CreateEncryptionKeyPublicWrappingResponseContent createPublicWrappingKey(String kid) { + return this.rawClient.createPublicWrappingKey(kid).body(); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public CreateEncryptionKeyPublicWrappingResponseContent createPublicWrappingKey( + String kid, RequestOptions requestOptions) { + return this.rawClient.createPublicWrappingKey(kid, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/KeysClient.java b/src/main/java/com/auth0/client/mgmt/keys/KeysClient.java new file mode 100644 index 000000000..df7f643c8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/KeysClient.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class KeysClient { + protected final ClientOptions clientOptions; + + protected final Supplier customSigningClient; + + protected final Supplier encryptionClient; + + protected final Supplier signingClient; + + public KeysClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.customSigningClient = Suppliers.memoize(() -> new CustomSigningClient(clientOptions)); + this.encryptionClient = Suppliers.memoize(() -> new EncryptionClient(clientOptions)); + this.signingClient = Suppliers.memoize(() -> new SigningClient(clientOptions)); + } + + public CustomSigningClient customSigning() { + return this.customSigningClient.get(); + } + + public EncryptionClient encryption() { + return this.encryptionClient.get(); + } + + public SigningClient signing() { + return this.signingClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/RawCustomSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/RawCustomSigningClient.java new file mode 100644 index 000000000..6def929b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/RawCustomSigningClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.keys.types.SetCustomSigningKeysRequestContent; +import com.auth0.client.mgmt.types.GetCustomSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SetCustomSigningKeysResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomSigningClient { + protected final ClientOptions clientOptions; + + public RawCustomSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Get entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetCustomSigningKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse set( + SetCustomSigningKeysRequestContent request) { + return set(request, null); + } + + /** + * Create or replace entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse set( + SetCustomSigningKeysRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SetCustomSigningKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete entire jwks representation of custom signing keys. + */ + public ManagementApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/custom-signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/RawEncryptionClient.java b/src/main/java/com/auth0/client/mgmt/keys/RawEncryptionClient.java new file mode 100644 index 000000000..7fc811aae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/RawEncryptionClient.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ListEncryptionKeysRequestParameters; +import com.auth0.client.mgmt.types.CreateEncryptionKeyPublicWrappingResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.EncryptionKey; +import com.auth0.client.mgmt.types.GetEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ImportEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ListEncryptionKeyOffsetPaginatedResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEncryptionClient { + protected final ClientOptions clientOptions; + + public RawEncryptionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public ManagementApiHttpResponse> list() { + return list(ListEncryptionKeysRequestParameters.builder().build()); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public ManagementApiHttpResponse> list( + ListEncryptionKeysRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details of all the encryption keys associated with your tenant. + */ + public ManagementApiHttpResponse> list( + ListEncryptionKeysRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListEncryptionKeyOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListEncryptionKeyOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListEncryptionKeysRequestParameters nextRequest = ListEncryptionKeysRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getKeys().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public ManagementApiHttpResponse create( + CreateEncryptionKeyRequestContent request) { + return create(request, null); + } + + /** + * Create the new, pre-activated encryption key, without the key material. + */ + public ManagementApiHttpResponse create( + CreateEncryptionKeyRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEncryptionKeyResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public ManagementApiHttpResponse rekey() { + return rekey(null); + } + + /** + * Perform rekeying operation on the key hierarchy. + */ + public ManagementApiHttpResponse rekey(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption/rekey") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public ManagementApiHttpResponse get(String kid) { + return get(kid, null); + } + + /** + * Retrieve details of the encryption key with the given ID. + */ + public ManagementApiHttpResponse get(String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetEncryptionKeyResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Import wrapped key material and activate encryption key. + */ + public ManagementApiHttpResponse import_( + String kid, ImportEncryptionKeyRequestContent request) { + return import_(kid, request, null); + } + + /** + * Import wrapped key material and activate encryption key. + */ + public ManagementApiHttpResponse import_( + String kid, ImportEncryptionKeyRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ImportEncryptionKeyResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public ManagementApiHttpResponse delete(String kid) { + return delete(kid, null); + } + + /** + * Delete the custom provided encryption key with the given ID and move back to using native encryption key. + */ + public ManagementApiHttpResponse delete(String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public ManagementApiHttpResponse createPublicWrappingKey( + String kid) { + return createPublicWrappingKey(kid, null); + } + + /** + * Create the public wrapping key to wrap your own encryption key material. + */ + public ManagementApiHttpResponse createPublicWrappingKey( + String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/encryption") + .addPathSegment(kid) + .addPathSegments("wrapping-key") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateEncryptionKeyPublicWrappingResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/RawSigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/RawSigningClient.java new file mode 100644 index 000000000..378745dd8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/RawSigningClient.java @@ -0,0 +1,278 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RevokedSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RotateSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SigningKeys; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSigningClient { + protected final ClientOptions clientOptions; + + public RawSigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public ManagementApiHttpResponse> list() { + return list(null); + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Rotate the application signing key of your tenant. + */ + public ManagementApiHttpResponse rotate() { + return rotate(null); + } + + /** + * Rotate the application signing key of your tenant. + */ + public ManagementApiHttpResponse rotate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing/rotate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RotateSigningKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public ManagementApiHttpResponse get(String kid) { + return get(kid, null); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public ManagementApiHttpResponse get(String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .addPathSegment(kid) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetSigningKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Revoke the application signing key with the given ID. + */ + public ManagementApiHttpResponse revoke(String kid) { + return revoke(kid, null); + } + + /** + * Revoke the application signing key with the given ID. + */ + public ManagementApiHttpResponse revoke( + String kid, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("keys/signing") + .addPathSegment(kid) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, RevokedSigningKeysResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/SigningClient.java b/src/main/java/com/auth0/client/mgmt/keys/SigningClient.java new file mode 100644 index 000000000..007648645 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/SigningClient.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RevokedSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RotateSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SigningKeys; +import java.util.List; + +public class SigningClient { + protected final ClientOptions clientOptions; + + private final RawSigningClient rawClient; + + public SigningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSigningClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSigningClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve details of all the application signing keys associated with your tenant. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Rotate the application signing key of your tenant. + */ + public RotateSigningKeysResponseContent rotate() { + return this.rawClient.rotate().body(); + } + + /** + * Rotate the application signing key of your tenant. + */ + public RotateSigningKeysResponseContent rotate(RequestOptions requestOptions) { + return this.rawClient.rotate(requestOptions).body(); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public GetSigningKeysResponseContent get(String kid) { + return this.rawClient.get(kid).body(); + } + + /** + * Retrieve details of the application signing key with the given ID. + */ + public GetSigningKeysResponseContent get(String kid, RequestOptions requestOptions) { + return this.rawClient.get(kid, requestOptions).body(); + } + + /** + * Revoke the application signing key with the given ID. + */ + public RevokedSigningKeysResponseContent revoke(String kid) { + return this.rawClient.revoke(kid).body(); + } + + /** + * Revoke the application signing key with the given ID. + */ + public RevokedSigningKeysResponseContent revoke(String kid, RequestOptions requestOptions) { + return this.rawClient.revoke(kid, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java new file mode 100644 index 000000000..980fad36a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateEncryptionKeyType; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEncryptionKeyRequestContent.Builder.class) +public final class CreateEncryptionKeyRequestContent { + private final CreateEncryptionKeyType type; + + private final Map additionalProperties; + + private CreateEncryptionKeyRequestContent(CreateEncryptionKeyType type, Map additionalProperties) { + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public CreateEncryptionKeyType getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEncryptionKeyRequestContent && equalTo((CreateEncryptionKeyRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEncryptionKeyRequestContent other) { + return type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull CreateEncryptionKeyType type); + + Builder from(CreateEncryptionKeyRequestContent other); + } + + public interface _FinalStage { + CreateEncryptionKeyRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CreateEncryptionKeyType type; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEncryptionKeyRequestContent other) { + type(other.getType()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CreateEncryptionKeyType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public CreateEncryptionKeyRequestContent build() { + return new CreateEncryptionKeyRequestContent(type, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java new file mode 100644 index 000000000..d87c5b36d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ImportEncryptionKeyRequestContent.Builder.class) +public final class ImportEncryptionKeyRequestContent { + private final String wrappedKey; + + private final Map additionalProperties; + + private ImportEncryptionKeyRequestContent(String wrappedKey, Map additionalProperties) { + this.wrappedKey = wrappedKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64 encoded ciphertext of key material wrapped by public wrapping key. + */ + @JsonProperty("wrapped_key") + public String getWrappedKey() { + return wrappedKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ImportEncryptionKeyRequestContent && equalTo((ImportEncryptionKeyRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ImportEncryptionKeyRequestContent other) { + return wrappedKey.equals(other.wrappedKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.wrappedKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WrappedKeyStage builder() { + return new Builder(); + } + + public interface WrappedKeyStage { + /** + *

Base64 encoded ciphertext of key material wrapped by public wrapping key.

+ */ + _FinalStage wrappedKey(@NotNull String wrappedKey); + + Builder from(ImportEncryptionKeyRequestContent other); + } + + public interface _FinalStage { + ImportEncryptionKeyRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WrappedKeyStage, _FinalStage { + private String wrappedKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ImportEncryptionKeyRequestContent other) { + wrappedKey(other.getWrappedKey()); + return this; + } + + /** + *

Base64 encoded ciphertext of key material wrapped by public wrapping key.

+ *

Base64 encoded ciphertext of key material wrapped by public wrapping key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("wrapped_key") + public _FinalStage wrappedKey(@NotNull String wrappedKey) { + this.wrappedKey = Objects.requireNonNull(wrappedKey, "wrappedKey must not be null"); + return this; + } + + @java.lang.Override + public ImportEncryptionKeyRequestContent build() { + return new ImportEncryptionKeyRequestContent(wrappedKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java new file mode 100644 index 000000000..17f70c33b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListEncryptionKeysRequestParameters.Builder.class) +public final class ListEncryptionKeysRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListEncryptionKeysRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Default value is 50, maximum value is 100. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListEncryptionKeysRequestParameters + && equalTo((ListEncryptionKeysRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListEncryptionKeysRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListEncryptionKeysRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Default value is 50, maximum value is 100.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListEncryptionKeysRequestParameters build() { + return new ListEncryptionKeysRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java new file mode 100644 index 000000000..78249d6b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.keys.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CustomSigningKeyJwk; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetCustomSigningKeysRequestContent.Builder.class) +public final class SetCustomSigningKeysRequestContent { + private final List keys; + + private final Map additionalProperties; + + private SetCustomSigningKeysRequestContent( + List keys, Map additionalProperties) { + this.keys = keys; + this.additionalProperties = additionalProperties; + } + + /** + * @return An array of custom public signing keys. + */ + @JsonProperty("keys") + public List getKeys() { + return keys; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetCustomSigningKeysRequestContent + && equalTo((SetCustomSigningKeysRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetCustomSigningKeysRequestContent other) { + return keys.equals(other.keys); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.keys); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List keys = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetCustomSigningKeysRequestContent other) { + keys(other.getKeys()); + return this; + } + + /** + *

An array of custom public signing keys.

+ */ + @JsonSetter(value = "keys", nulls = Nulls.SKIP) + public Builder keys(List keys) { + this.keys.clear(); + if (keys != null) { + this.keys.addAll(keys); + } + return this; + } + + public Builder addKeys(CustomSigningKeyJwk keys) { + this.keys.add(keys); + return this; + } + + public Builder addAllKeys(List keys) { + if (keys != null) { + this.keys.addAll(keys); + } + return this; + } + + public SetCustomSigningKeysRequestContent build() { + return new SetCustomSigningKeysRequestContent(keys, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncClientGrantsClient.java new file mode 100644 index 000000000..780a65c64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncClientGrantsClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.AssociateOrganizationClientGrantResponseContent; +import com.auth0.client.mgmt.types.OrganizationClientGrant; +import java.util.concurrent.CompletableFuture; + +public class AsyncClientGrantsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawClientGrantsClient rawClient; + + public AsyncClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawClientGrantsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawClientGrantsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListOrganizationClientGrantsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListOrganizationClientGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, AssociateOrganizationClientGrantRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, AssociateOrganizationClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String grantId) { + return this.rawClient.delete(id, grantId).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String grantId, RequestOptions requestOptions) { + return this.rawClient.delete(id, grantId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncEnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncEnabledConnectionsClient.java new file mode 100644 index 000000000..bfc2e0378 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncEnabledConnectionsClient.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.types.AddOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationConnection; +import com.auth0.client.mgmt.types.UpdateOrganizationConnectionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncEnabledConnectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEnabledConnectionsClient rawClient; + + public AsyncEnabledConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEnabledConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEnabledConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture> list( + String id, ListOrganizationConnectionsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture> list( + String id, ListOrganizationConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public CompletableFuture add( + String id, AddOrganizationConnectionRequestContent request) { + return this.rawClient.add(id, request).thenApply(response -> response.body()); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public CompletableFuture add( + String id, AddOrganizationConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.add(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture get(String id, String connectionId) { + return this.rawClient.get(id, connectionId).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture get( + String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.get(id, connectionId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public CompletableFuture delete(String id, String connectionId) { + return this.rawClient.delete(id, connectionId).thenApply(response -> response.body()); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public CompletableFuture delete(String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.delete(id, connectionId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture update(String id, String connectionId) { + return this.rawClient.update(id, connectionId).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture update( + String id, String connectionId, UpdateOrganizationConnectionRequestContent request) { + return this.rawClient.update(id, connectionId, request).thenApply(response -> response.body()); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncInvitationsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncInvitationsClient.java new file mode 100644 index 000000000..e1e81ab65 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncInvitationsClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; +import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationInvitationsRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.OrganizationInvitation; +import java.util.concurrent.CompletableFuture; + +public class AsyncInvitationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawInvitationsClient rawClient; + + public AsyncInvitationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawInvitationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawInvitationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture> list( + String id, ListOrganizationInvitationsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture> list( + String id, ListOrganizationInvitationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture create( + String id, CreateOrganizationInvitationRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture create( + String id, CreateOrganizationInvitationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, String invitationId) { + return this.rawClient.get(id, invitationId).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, String invitationId, GetOrganizationInvitationRequestParameters request) { + return this.rawClient.get(id, invitationId, request).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, + String invitationId, + GetOrganizationInvitationRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.get(id, invitationId, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String invitationId) { + return this.rawClient.delete(id, invitationId).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String invitationId, RequestOptions requestOptions) { + return this.rawClient.delete(id, invitationId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncMembersClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncMembersClient.java new file mode 100644 index 000000000..31c2ebc5c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncMembersClient.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.members.AsyncRolesClient; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; +import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationMembersRequestParameters; +import com.auth0.client.mgmt.types.OrganizationMember; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncMembersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawMembersClient rawClient; + + protected final Supplier rolesClient; + + public AsyncMembersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawMembersClient(clientOptions); + this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawMembersClient withRawResponse() { + return this.rawClient; + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture> list( + String id, ListOrganizationMembersRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture> list( + String id, ListOrganizationMembersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public CompletableFuture create(String id, CreateOrganizationMemberRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public CompletableFuture create( + String id, CreateOrganizationMemberRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, DeleteOrganizationMembersRequestContent request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture delete( + String id, DeleteOrganizationMembersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncRolesClient roles() { + return this.rolesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java new file mode 100644 index 000000000..2a214fd54 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.AssociateOrganizationClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationClientGrantsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationClientGrant; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawClientGrantsClient { + protected final ClientOptions clientOptions; + + public AsyncRawClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list(String id) { + return list(id, ListOrganizationClientGrantsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + String id, ListOrganizationClientGrantsRequestParameters request) { + return list(id, request, null); + } + + public CompletableFuture>> list( + String id, ListOrganizationClientGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants"); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + if (request.getGrantIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "grant_ids", request.getGrantIds().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationClientGrantsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListOrganizationClientGrantsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListOrganizationClientGrantsRequestParameters nextRequest = + ListOrganizationClientGrantsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getClientGrants().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + String id, AssociateOrganizationClientGrantRequestContent request) { + return create(id, request, null); + } + + public CompletableFuture> create( + String id, AssociateOrganizationClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AssociateOrganizationClientGrantResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id, String grantId) { + return delete(id, grantId, null); + } + + public CompletableFuture> delete( + String id, String grantId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants") + .addPathSegment(grantId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java new file mode 100644 index 000000000..122846215 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java @@ -0,0 +1,537 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.types.AddOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationConnection; +import com.auth0.client.mgmt.types.UpdateOrganizationConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEnabledConnectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEnabledConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture>> list(String id) { + return list(id, ListOrganizationConnectionsRequestParameters.builder().build()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture>> list( + String id, ListOrganizationConnectionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture>> list( + String id, ListOrganizationConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListOrganizationConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListOrganizationConnectionsRequestParameters nextRequest = + ListOrganizationConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getEnabledConnections().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public CompletableFuture> add( + String id, AddOrganizationConnectionRequestContent request) { + return add(id, request, null); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public CompletableFuture> add( + String id, AddOrganizationConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AddOrganizationConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture> get( + String id, String connectionId) { + return get(id, connectionId, null); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public CompletableFuture> get( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public CompletableFuture> delete(String id, String connectionId) { + return delete(id, connectionId, null); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public CompletableFuture> delete( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture> update( + String id, String connectionId) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestContent.builder().build()); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture> update( + String id, String connectionId, UpdateOrganizationConnectionRequestContent request) { + return update(id, connectionId, request, null); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public CompletableFuture> update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawInvitationsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawInvitationsClient.java new file mode 100644 index 000000000..8b54ac1fc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawInvitationsClient.java @@ -0,0 +1,447 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; +import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationInvitationsRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationInvitationsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationInvitation; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawInvitationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawInvitationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture>> list(String id) { + return list(id, ListOrganizationInvitationsRequestParameters.builder().build()); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture>> list( + String id, ListOrganizationInvitationsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture>> list( + String id, ListOrganizationInvitationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationInvitationsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListOrganizationInvitationsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListOrganizationInvitationsRequestParameters nextRequest = + ListOrganizationInvitationsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getInvitations().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture> create( + String id, CreateOrganizationInvitationRequestContent request) { + return create(id, request, null); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CompletableFuture> create( + String id, CreateOrganizationInvitationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationInvitationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get( + String id, String invitationId) { + return get( + id, + invitationId, + GetOrganizationInvitationRequestParameters.builder().build()); + } + + public CompletableFuture> get( + String id, String invitationId, GetOrganizationInvitationRequestParameters request) { + return get(id, invitationId, request, null); + } + + public CompletableFuture> get( + String id, + String invitationId, + GetOrganizationInvitationRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .addPathSegment(invitationId); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationInvitationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id, String invitationId) { + return delete(id, invitationId, null); + } + + public CompletableFuture> delete( + String id, String invitationId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .addPathSegment(invitationId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawMembersClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawMembersClient.java new file mode 100644 index 000000000..1d299cd70 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawMembersClient.java @@ -0,0 +1,390 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; +import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationMembersRequestParameters; +import com.auth0.client.mgmt.types.ListOrganizationMembersPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationMember; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawMembersClient { + protected final ClientOptions clientOptions; + + public AsyncRawMembersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture>> list(String id) { + return list(id, ListOrganizationMembersRequestParameters.builder().build()); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture>> list( + String id, ListOrganizationMembersRequestParameters request) { + return list(id, request, null); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public CompletableFuture>> list( + String id, ListOrganizationMembersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationMembersPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationMembersPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationMembersRequestParameters nextRequest = + ListOrganizationMembersRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getMembers().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public CompletableFuture> create( + String id, CreateOrganizationMemberRequestContent request) { + return create(id, request, null); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public CompletableFuture> create( + String id, CreateOrganizationMemberRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete( + String id, DeleteOrganizationMembersRequestContent request) { + return delete(id, request, null); + } + + public CompletableFuture> delete( + String id, DeleteOrganizationMembersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/ClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/ClientGrantsClient.java new file mode 100644 index 000000000..00c485c11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/ClientGrantsClient.java @@ -0,0 +1,62 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.AssociateOrganizationClientGrantResponseContent; +import com.auth0.client.mgmt.types.OrganizationClientGrant; + +public class ClientGrantsClient { + protected final ClientOptions clientOptions; + + private final RawClientGrantsClient rawClient; + + public ClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawClientGrantsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawClientGrantsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + public SyncPagingIterable list( + String id, ListOrganizationClientGrantsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + public SyncPagingIterable list( + String id, ListOrganizationClientGrantsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + public AssociateOrganizationClientGrantResponseContent create( + String id, AssociateOrganizationClientGrantRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + public AssociateOrganizationClientGrantResponseContent create( + String id, AssociateOrganizationClientGrantRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + public void delete(String id, String grantId) { + this.rawClient.delete(id, grantId).body(); + } + + public void delete(String id, String grantId, RequestOptions requestOptions) { + this.rawClient.delete(id, grantId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/EnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/EnabledConnectionsClient.java new file mode 100644 index 000000000..cf3da245b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/EnabledConnectionsClient.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.types.AddOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationConnection; +import com.auth0.client.mgmt.types.UpdateOrganizationConnectionResponseContent; + +public class EnabledConnectionsClient { + protected final ClientOptions clientOptions; + + private final RawEnabledConnectionsClient rawClient; + + public EnabledConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEnabledConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEnabledConnectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public SyncPagingIterable list( + String id, ListOrganizationConnectionsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public SyncPagingIterable list( + String id, ListOrganizationConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public AddOrganizationConnectionResponseContent add(String id, AddOrganizationConnectionRequestContent request) { + return this.rawClient.add(id, request).body(); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public AddOrganizationConnectionResponseContent add( + String id, AddOrganizationConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.add(id, request, requestOptions).body(); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public GetOrganizationConnectionResponseContent get(String id, String connectionId) { + return this.rawClient.get(id, connectionId).body(); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public GetOrganizationConnectionResponseContent get(String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.get(id, connectionId, requestOptions).body(); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public void delete(String id, String connectionId) { + this.rawClient.delete(id, connectionId).body(); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public void delete(String id, String connectionId, RequestOptions requestOptions) { + this.rawClient.delete(id, connectionId, requestOptions).body(); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public UpdateOrganizationConnectionResponseContent update(String id, String connectionId) { + return this.rawClient.update(id, connectionId).body(); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public UpdateOrganizationConnectionResponseContent update( + String id, String connectionId, UpdateOrganizationConnectionRequestContent request) { + return this.rawClient.update(id, connectionId, request).body(); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public UpdateOrganizationConnectionResponseContent update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/InvitationsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/InvitationsClient.java new file mode 100644 index 000000000..9f2280f6e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/InvitationsClient.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; +import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationInvitationsRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.OrganizationInvitation; + +public class InvitationsClient { + protected final ClientOptions clientOptions; + + private final RawInvitationsClient rawClient; + + public InvitationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawInvitationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawInvitationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public SyncPagingIterable list( + String id, ListOrganizationInvitationsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public SyncPagingIterable list( + String id, ListOrganizationInvitationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CreateOrganizationInvitationResponseContent create( + String id, CreateOrganizationInvitationRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public CreateOrganizationInvitationResponseContent create( + String id, CreateOrganizationInvitationRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + public GetOrganizationInvitationResponseContent get(String id, String invitationId) { + return this.rawClient.get(id, invitationId).body(); + } + + public GetOrganizationInvitationResponseContent get( + String id, String invitationId, GetOrganizationInvitationRequestParameters request) { + return this.rawClient.get(id, invitationId, request).body(); + } + + public GetOrganizationInvitationResponseContent get( + String id, + String invitationId, + GetOrganizationInvitationRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.get(id, invitationId, request, requestOptions).body(); + } + + public void delete(String id, String invitationId) { + this.rawClient.delete(id, invitationId).body(); + } + + public void delete(String id, String invitationId, RequestOptions requestOptions) { + this.rawClient.delete(id, invitationId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/MembersClient.java b/src/main/java/com/auth0/client/mgmt/organizations/MembersClient.java new file mode 100644 index 000000000..ec7fc62c8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/MembersClient.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.members.RolesClient; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; +import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationMembersRequestParameters; +import com.auth0.client.mgmt.types.OrganizationMember; +import java.util.function.Supplier; + +public class MembersClient { + protected final ClientOptions clientOptions; + + private final RawMembersClient rawClient; + + protected final Supplier rolesClient; + + public MembersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawMembersClient(clientOptions); + this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawMembersClient withRawResponse() { + return this.rawClient; + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public SyncPagingIterable list(String id, ListOrganizationMembersRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public SyncPagingIterable list( + String id, ListOrganizationMembersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public void create(String id, CreateOrganizationMemberRequestContent request) { + this.rawClient.create(id, request).body(); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public void create(String id, CreateOrganizationMemberRequestContent request, RequestOptions requestOptions) { + this.rawClient.create(id, request, requestOptions).body(); + } + + public void delete(String id, DeleteOrganizationMembersRequestContent request) { + this.rawClient.delete(id, request).body(); + } + + public void delete(String id, DeleteOrganizationMembersRequestContent request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } + + public RolesClient roles() { + return this.rolesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java new file mode 100644 index 000000000..dad55df57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java @@ -0,0 +1,256 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.AssociateOrganizationClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationClientGrantsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationClientGrant; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawClientGrantsClient { + protected final ClientOptions clientOptions; + + public RawClientGrantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list(String id) { + return list(id, ListOrganizationClientGrantsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list( + String id, ListOrganizationClientGrantsRequestParameters request) { + return list(id, request, null); + } + + public ManagementApiHttpResponse> list( + String id, ListOrganizationClientGrantsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants"); + QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + if (request.getGrantIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "grant_ids", request.getGrantIds().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationClientGrantsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationClientGrantsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListOrganizationClientGrantsRequestParameters nextRequest = + ListOrganizationClientGrantsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getClientGrants().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + String id, AssociateOrganizationClientGrantRequestContent request) { + return create(id, request, null); + } + + public ManagementApiHttpResponse create( + String id, AssociateOrganizationClientGrantRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AssociateOrganizationClientGrantResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id, String grantId) { + return delete(id, grantId, null); + } + + public ManagementApiHttpResponse delete(String id, String grantId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("client-grants") + .addPathSegment(grantId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java new file mode 100644 index 000000000..174c23e7a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java @@ -0,0 +1,415 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.types.AddOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationConnection; +import com.auth0.client.mgmt.types.UpdateOrganizationConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEnabledConnectionsClient { + protected final ClientOptions clientOptions; + + public RawEnabledConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListOrganizationConnectionsRequestParameters.builder().build()); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationConnectionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListOrganizationConnectionsRequestParameters nextRequest = + ListOrganizationConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getEnabledConnections().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public ManagementApiHttpResponse add( + String id, AddOrganizationConnectionRequestContent request) { + return add(id, request, null); + } + + /** + * Enable a specific connection for a given Organization. To enable a connection, it must already exist within your tenant; connections cannot be created through this action. + *

<a href="https://auth0.com/docs/authenticate/identity-providers">Connections</a> represent the relationship between Auth0 and a source of users. Available types of connections include database, enterprise, and social.

+ */ + public ManagementApiHttpResponse add( + String id, AddOrganizationConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AddOrganizationConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public ManagementApiHttpResponse get(String id, String connectionId) { + return get(id, connectionId, null); + } + + /** + * Retrieve details about a specific connection currently enabled for an Organization. Information returned includes details such as connection ID, name, strategy, and whether the connection automatically grants membership upon login. + */ + public ManagementApiHttpResponse get( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public ManagementApiHttpResponse delete(String id, String connectionId) { + return delete(id, connectionId, null); + } + + /** + * Disable a specific connection for an Organization. Once disabled, Organization members can no longer use that connection to authenticate. + *

<b>Note</b>: This action does not remove the connection from your tenant.

+ */ + public ManagementApiHttpResponse delete(String id, String connectionId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public ManagementApiHttpResponse update( + String id, String connectionId) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestContent.builder().build()); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public ManagementApiHttpResponse update( + String id, String connectionId, UpdateOrganizationConnectionRequestContent request) { + return update(id, connectionId, request, null); + } + + /** + * Modify the details of a specific connection currently enabled for an Organization. + */ + public ManagementApiHttpResponse update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("enabled_connections") + .addPathSegment(connectionId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java new file mode 100644 index 000000000..5646108f9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java @@ -0,0 +1,339 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; +import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationInvitationsRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationInvitationsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationInvitation; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawInvitationsClient { + protected final ClientOptions clientOptions; + + public RawInvitationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListOrganizationInvitationsRequestParameters.builder().build()); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationInvitationsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve a detailed list of invitations sent to users for a specific Organization. The list includes details such as inviter and invitee information, invitation URLs, and dates of creation and expiration. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationInvitationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationInvitationsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationInvitationsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListOrganizationInvitationsRequestParameters nextRequest = + ListOrganizationInvitationsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getInvitations().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public ManagementApiHttpResponse create( + String id, CreateOrganizationInvitationRequestContent request) { + return create(id, request, null); + } + + /** + * Create a user invitation for a specific Organization. Upon creation, the listed user receives an email inviting them to join the Organization. To learn more about Organization invitations, review <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">Invite Organization Members</a>. + */ + public ManagementApiHttpResponse create( + String id, CreateOrganizationInvitationRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationInvitationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id, String invitationId) { + return get( + id, + invitationId, + GetOrganizationInvitationRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse get( + String id, String invitationId, GetOrganizationInvitationRequestParameters request) { + return get(id, invitationId, request, null); + } + + public ManagementApiHttpResponse get( + String id, + String invitationId, + GetOrganizationInvitationRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .addPathSegment(invitationId); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationInvitationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id, String invitationId) { + return delete(id, invitationId, null); + } + + public ManagementApiHttpResponse delete(String id, String invitationId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("invitations") + .addPathSegment(invitationId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java new file mode 100644 index 000000000..cfba23170 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java @@ -0,0 +1,311 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; +import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationMembersRequestParameters; +import com.auth0.client.mgmt.types.ListOrganizationMembersPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationMember; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawMembersClient { + protected final ClientOptions clientOptions; + + public RawMembersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListOrganizationMembersRequestParameters.builder().build()); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationMembersRequestParameters request) { + return list(id, request, null); + } + + /** + * List organization members. + * This endpoint is subject to eventual consistency. New users may not be immediately included in the response and deleted users may not be immediately removed from it. + *

<ul> + * <li> + * Use the <code>fields</code> parameter to optionally define the specific member details retrieved. If <code>fields</code> is left blank, all fields (except roles) are returned. + * </li> + * <li> + * Member roles are not sent by default. Use <code>fields=roles</code> to retrieve the roles assigned to each listed member. To use this parameter, you must include the <code>read:organization_member_roles</code> scope in the token. + * </li> + * </ul>

+ *

This endpoint supports two types of pagination:

+ *
    + *
  • Offset pagination
  • + *
  • Checkpoint pagination
  • + *
+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter. If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.

+ */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationMembersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationMembersPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationMembersPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationMembersRequestParameters nextRequest = + ListOrganizationMembersRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getMembers().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public ManagementApiHttpResponse create(String id, CreateOrganizationMemberRequestContent request) { + return create(id, request, null); + } + + /** + * Set one or more existing users as members of a specific <a href="https://auth0.com/docs/manage-users/organizations">Organization</a>. + *

To add a user to an Organization through this action, the user must already exist in your tenant. If a user does not yet exist, you can <a href="https://auth0.com/docs/manage-users/organizations/configure-organizations/invite-members">invite them to create an account</a>, manually create them through the Auth0 Dashboard, or use the Management API.

+ */ + public ManagementApiHttpResponse create( + String id, CreateOrganizationMemberRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id, DeleteOrganizationMembersRequestContent request) { + return delete(id, request, null); + } + + public ManagementApiHttpResponse delete( + String id, DeleteOrganizationMembersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java new file mode 100644 index 000000000..9396f1acb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.ListOrganizationMemberRolesRequestParameters; +import com.auth0.client.mgmt.types.ListOrganizationMemberRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRolesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture>> list(String id, String userId) { + return list( + id, + userId, + ListOrganizationMemberRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture>> list( + String id, String userId, ListOrganizationMemberRolesRequestParameters request) { + return list(id, userId, request, null); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture>> list( + String id, + String userId, + ListOrganizationMemberRolesRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationMemberRolesOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListOrganizationMemberRolesOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListOrganizationMemberRolesRequestParameters nextRequest = + ListOrganizationMemberRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, userId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public CompletableFuture> assign( + String id, String userId, AssignOrganizationMemberRolesRequestContent request) { + return assign(id, userId, request, null); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public CompletableFuture> assign( + String id, + String userId, + AssignOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public CompletableFuture> delete( + String id, String userId, DeleteOrganizationMemberRolesRequestContent request) { + return delete(id, userId, request, null); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public CompletableFuture> delete( + String id, + String userId, + DeleteOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRolesClient.java new file mode 100644 index 000000000..c04b4ad9d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRolesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.ListOrganizationMemberRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import java.util.concurrent.CompletableFuture; + +public class AsyncRolesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRolesClient rawClient; + + public AsyncRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture> list(String id, String userId) { + return this.rawClient.list(id, userId).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture> list( + String id, String userId, ListOrganizationMemberRolesRequestParameters request) { + return this.rawClient.list(id, userId, request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public CompletableFuture> list( + String id, + String userId, + ListOrganizationMemberRolesRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.list(id, userId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public CompletableFuture assign( + String id, String userId, AssignOrganizationMemberRolesRequestContent request) { + return this.rawClient.assign(id, userId, request).thenApply(response -> response.body()); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public CompletableFuture assign( + String id, + String userId, + AssignOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.assign(id, userId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public CompletableFuture delete( + String id, String userId, DeleteOrganizationMemberRolesRequestContent request) { + return this.rawClient.delete(id, userId, request).thenApply(response -> response.body()); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public CompletableFuture delete( + String id, + String userId, + DeleteOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.delete(id, userId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java new file mode 100644 index 000000000..69394c79e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.ListOrganizationMemberRolesRequestParameters; +import com.auth0.client.mgmt.types.ListOrganizationMemberRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRolesClient { + protected final ClientOptions clientOptions; + + public RawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public ManagementApiHttpResponse> list(String id, String userId) { + return list( + id, + userId, + ListOrganizationMemberRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public ManagementApiHttpResponse> list( + String id, String userId, ListOrganizationMemberRolesRequestParameters request) { + return list(id, userId, request, null); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public ManagementApiHttpResponse> list( + String id, + String userId, + ListOrganizationMemberRolesRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationMemberRolesOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationMemberRolesOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListOrganizationMemberRolesRequestParameters nextRequest = + ListOrganizationMemberRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, userId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public ManagementApiHttpResponse assign( + String id, String userId, AssignOrganizationMemberRolesRequestContent request) { + return assign(id, userId, request, null); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public ManagementApiHttpResponse assign( + String id, + String userId, + AssignOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public ManagementApiHttpResponse delete( + String id, String userId, DeleteOrganizationMemberRolesRequestContent request) { + return delete(id, userId, request, null); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public ManagementApiHttpResponse delete( + String id, + String userId, + DeleteOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("members") + .addPathSegment(userId) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/RolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/RolesClient.java new file mode 100644 index 000000000..7dfd2bb18 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/RolesClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.ListOrganizationMemberRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; + +public class RolesClient { + protected final ClientOptions clientOptions; + + private final RawRolesClient rawClient; + + public RolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public SyncPagingIterable list(String id, String userId) { + return this.rawClient.list(id, userId).body(); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public SyncPagingIterable list( + String id, String userId, ListOrganizationMemberRolesRequestParameters request) { + return this.rawClient.list(id, userId, request).body(); + } + + /** + * Retrieve detailed list of roles assigned to a given user within the context of a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

+ */ + public SyncPagingIterable list( + String id, + String userId, + ListOrganizationMemberRolesRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.list(id, userId, request, requestOptions).body(); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public void assign(String id, String userId, AssignOrganizationMemberRolesRequestContent request) { + this.rawClient.assign(id, userId, request).body(); + } + + /** + * Assign one or more <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> to a user to determine their access for a specific Organization. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

+ */ + public void assign( + String id, + String userId, + AssignOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + this.rawClient.assign(id, userId, request, requestOptions).body(); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public void delete(String id, String userId, DeleteOrganizationMemberRolesRequestContent request) { + this.rawClient.delete(id, userId, request).body(); + } + + /** + * Remove one or more Organization-specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">roles</a> from a given user. + *

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

+ */ + public void delete( + String id, + String userId, + DeleteOrganizationMemberRolesRequestContent request, + RequestOptions requestOptions) { + this.rawClient.delete(id, userId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java new file mode 100644 index 000000000..69687c67c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssignOrganizationMemberRolesRequestContent.Builder.class) +public final class AssignOrganizationMemberRolesRequestContent { + private final List roles; + + private final Map additionalProperties; + + private AssignOrganizationMemberRolesRequestContent(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssignOrganizationMemberRolesRequestContent + && equalTo((AssignOrganizationMemberRolesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssignOrganizationMemberRolesRequestContent other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssignOrganizationMemberRolesRequestContent other) { + roles(other.getRoles()); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public AssignOrganizationMemberRolesRequestContent build() { + return new AssignOrganizationMemberRolesRequestContent(roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java new file mode 100644 index 000000000..cdf4036f7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteOrganizationMemberRolesRequestContent.Builder.class) +public final class DeleteOrganizationMemberRolesRequestContent { + private final List roles; + + private final Map additionalProperties; + + private DeleteOrganizationMemberRolesRequestContent(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of roles IDs associated with the organization member to remove. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteOrganizationMemberRolesRequestContent + && equalTo((DeleteOrganizationMemberRolesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteOrganizationMemberRolesRequestContent other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteOrganizationMemberRolesRequestContent other) { + roles(other.getRoles()); + return this; + } + + /** + *

List of roles IDs associated with the organization member to remove.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public DeleteOrganizationMemberRolesRequestContent build() { + return new DeleteOrganizationMemberRolesRequestContent(roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java new file mode 100644 index 000000000..62ab7f2a5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.members.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationMemberRolesRequestParameters.Builder.class) +public final class ListOrganizationMemberRolesRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListOrganizationMemberRolesRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationMemberRolesRequestParameters + && equalTo((ListOrganizationMemberRolesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationMemberRolesRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationMemberRolesRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListOrganizationMemberRolesRequestParameters build() { + return new ListOrganizationMemberRolesRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java new file mode 100644 index 000000000..01aa3b991 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java @@ -0,0 +1,248 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AddOrganizationConnectionRequestContent.Builder.class) +public final class AddOrganizationConnectionRequestContent { + private final String connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional isSignupEnabled; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private AddOrganizationConnectionRequestContent( + String connectionId, + Optional assignMembershipOnLogin, + Optional isSignupEnabled, + Optional showAsButton, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.isSignupEnabled = isSignupEnabled; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + /** + * @return Single connection ID to add to the organization. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddOrganizationConnectionRequestContent + && equalTo((AddOrganizationConnectionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddOrganizationConnectionRequestContent other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && isSignupEnabled.equals(other.isSignupEnabled) + && showAsButton.equals(other.showAsButton); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Single connection ID to add to the organization.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(AddOrganizationConnectionRequestContent other); + } + + public interface _FinalStage { + AddOrganizationConnectionRequestContent build(); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AddOrganizationConnectionRequestContent other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + isSignupEnabled(other.getIsSignupEnabled()); + showAsButton(other.getShowAsButton()); + return this; + } + + /** + *

Single connection ID to add to the organization.

+ *

Single connection ID to add to the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + @java.lang.Override + public AddOrganizationConnectionRequestContent build() { + return new AddOrganizationConnectionRequestContent( + connectionId, assignMembershipOnLogin, isSignupEnabled, showAsButton, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java new file mode 100644 index 000000000..2a3717228 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssociateOrganizationClientGrantRequestContent.Builder.class) +public final class AssociateOrganizationClientGrantRequestContent { + private final String grantId; + + private final Map additionalProperties; + + private AssociateOrganizationClientGrantRequestContent(String grantId, Map additionalProperties) { + this.grantId = grantId; + this.additionalProperties = additionalProperties; + } + + /** + * @return A Client Grant ID to add to the organization. + */ + @JsonProperty("grant_id") + public String getGrantId() { + return grantId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociateOrganizationClientGrantRequestContent + && equalTo((AssociateOrganizationClientGrantRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssociateOrganizationClientGrantRequestContent other) { + return grantId.equals(other.grantId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.grantId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static GrantIdStage builder() { + return new Builder(); + } + + public interface GrantIdStage { + /** + *

A Client Grant ID to add to the organization.

+ */ + _FinalStage grantId(@NotNull String grantId); + + Builder from(AssociateOrganizationClientGrantRequestContent other); + } + + public interface _FinalStage { + AssociateOrganizationClientGrantRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements GrantIdStage, _FinalStage { + private String grantId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AssociateOrganizationClientGrantRequestContent other) { + grantId(other.getGrantId()); + return this; + } + + /** + *

A Client Grant ID to add to the organization.

+ *

A Client Grant ID to add to the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("grant_id") + public _FinalStage grantId(@NotNull String grantId) { + this.grantId = Objects.requireNonNull(grantId, "grantId must not be null"); + return this; + } + + @java.lang.Override + public AssociateOrganizationClientGrantRequestContent build() { + return new AssociateOrganizationClientGrantRequestContent(grantId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java new file mode 100644 index 000000000..e1fc23bc4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java @@ -0,0 +1,420 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.OrganizationInvitationInvitee; +import com.auth0.client.mgmt.types.OrganizationInvitationInviter; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationInvitationRequestContent.Builder.class) +public final class CreateOrganizationInvitationRequestContent { + private final OrganizationInvitationInviter inviter; + + private final OrganizationInvitationInvitee invitee; + + private final String clientId; + + private final Optional connectionId; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional ttlSec; + + private final Optional> roles; + + private final Optional sendInvitationEmail; + + private final Map additionalProperties; + + private CreateOrganizationInvitationRequestContent( + OrganizationInvitationInviter inviter, + OrganizationInvitationInvitee invitee, + String clientId, + Optional connectionId, + Optional> appMetadata, + Optional> userMetadata, + Optional ttlSec, + Optional> roles, + Optional sendInvitationEmail, + Map additionalProperties) { + this.inviter = inviter; + this.invitee = invitee; + this.clientId = clientId; + this.connectionId = connectionId; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.ttlSec = ttlSec; + this.roles = roles; + this.sendInvitationEmail = sendInvitationEmail; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("inviter") + public OrganizationInvitationInviter getInviter() { + return inviter; + } + + @JsonProperty("invitee") + public OrganizationInvitationInvitee getInvitee() { + return invitee; + } + + /** + * @return Auth0 client ID. Used to resolve the application's login initiation endpoint. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return The id of the connection to force invitee to authenticate with. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days). + */ + @JsonProperty("ttl_sec") + public Optional getTtlSec() { + return ttlSec; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + /** + * @return Whether the user will receive an invitation email (true) or no email (false), true by default + */ + @JsonProperty("send_invitation_email") + public Optional getSendInvitationEmail() { + return sendInvitationEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationInvitationRequestContent + && equalTo((CreateOrganizationInvitationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationInvitationRequestContent other) { + return inviter.equals(other.inviter) + && invitee.equals(other.invitee) + && clientId.equals(other.clientId) + && connectionId.equals(other.connectionId) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && ttlSec.equals(other.ttlSec) + && roles.equals(other.roles) + && sendInvitationEmail.equals(other.sendInvitationEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.inviter, + this.invitee, + this.clientId, + this.connectionId, + this.appMetadata, + this.userMetadata, + this.ttlSec, + this.roles, + this.sendInvitationEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static InviterStage builder() { + return new Builder(); + } + + public interface InviterStage { + InviteeStage inviter(@NotNull OrganizationInvitationInviter inviter); + + Builder from(CreateOrganizationInvitationRequestContent other); + } + + public interface InviteeStage { + ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee); + } + + public interface ClientIdStage { + /** + *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ */ + _FinalStage clientId(@NotNull String clientId); + } + + public interface _FinalStage { + CreateOrganizationInvitationRequestContent build(); + + /** + *

The id of the connection to force invitee to authenticate with.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + + _FinalStage appMetadata(Optional> appMetadata); + + _FinalStage appMetadata(Map appMetadata); + + _FinalStage userMetadata(Optional> userMetadata); + + _FinalStage userMetadata(Map userMetadata); + + /** + *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

+ */ + _FinalStage ttlSec(Optional ttlSec); + + _FinalStage ttlSec(Integer ttlSec); + + /** + *

List of roles IDs to associated with the user.

+ */ + _FinalStage roles(Optional> roles); + + _FinalStage roles(List roles); + + /** + *

Whether the user will receive an invitation email (true) or no email (false), true by default

+ */ + _FinalStage sendInvitationEmail(Optional sendInvitationEmail); + + _FinalStage sendInvitationEmail(Boolean sendInvitationEmail); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements InviterStage, InviteeStage, ClientIdStage, _FinalStage { + private OrganizationInvitationInviter inviter; + + private OrganizationInvitationInvitee invitee; + + private String clientId; + + private Optional sendInvitationEmail = Optional.empty(); + + private Optional> roles = Optional.empty(); + + private Optional ttlSec = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOrganizationInvitationRequestContent other) { + inviter(other.getInviter()); + invitee(other.getInvitee()); + clientId(other.getClientId()); + connectionId(other.getConnectionId()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + ttlSec(other.getTtlSec()); + roles(other.getRoles()); + sendInvitationEmail(other.getSendInvitationEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("inviter") + public InviteeStage inviter(@NotNull OrganizationInvitationInviter inviter) { + this.inviter = Objects.requireNonNull(inviter, "inviter must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("invitee") + public ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee) { + this.invitee = Objects.requireNonNull(invitee, "invitee must not be null"); + return this; + } + + /** + *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

Whether the user will receive an invitation email (true) or no email (false), true by default

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sendInvitationEmail(Boolean sendInvitationEmail) { + this.sendInvitationEmail = Optional.ofNullable(sendInvitationEmail); + return this; + } + + /** + *

Whether the user will receive an invitation email (true) or no email (false), true by default

+ */ + @java.lang.Override + @JsonSetter(value = "send_invitation_email", nulls = Nulls.SKIP) + public _FinalStage sendInvitationEmail(Optional sendInvitationEmail) { + this.sendInvitationEmail = sendInvitationEmail; + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @java.lang.Override + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public _FinalStage roles(Optional> roles) { + this.roles = roles; + return this; + } + + /** + *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage ttlSec(Integer ttlSec) { + this.ttlSec = Optional.ofNullable(ttlSec); + return this; + } + + /** + *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

+ */ + @java.lang.Override + @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) + public _FinalStage ttlSec(Optional ttlSec) { + this.ttlSec = ttlSec; + return this; + } + + @java.lang.Override + public _FinalStage userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public _FinalStage userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + @java.lang.Override + public _FinalStage appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public _FinalStage appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + /** + *

The id of the connection to force invitee to authenticate with.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

The id of the connection to force invitee to authenticate with.

+ */ + @java.lang.Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + @java.lang.Override + public CreateOrganizationInvitationRequestContent build() { + return new CreateOrganizationInvitationRequestContent( + inviter, + invitee, + clientId, + connectionId, + appMetadata, + userMetadata, + ttlSec, + roles, + sendInvitationEmail, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java new file mode 100644 index 000000000..2fc0bfa7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationMemberRequestContent.Builder.class) +public final class CreateOrganizationMemberRequestContent { + private final List members; + + private final Map additionalProperties; + + private CreateOrganizationMemberRequestContent(List members, Map additionalProperties) { + this.members = members; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of user IDs to add to the organization as members. + */ + @JsonProperty("members") + public List getMembers() { + return members; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationMemberRequestContent + && equalTo((CreateOrganizationMemberRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationMemberRequestContent other) { + return members.equals(other.members); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.members); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List members = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateOrganizationMemberRequestContent other) { + members(other.getMembers()); + return this; + } + + /** + *

List of user IDs to add to the organization as members.

+ */ + @JsonSetter(value = "members", nulls = Nulls.SKIP) + public Builder members(List members) { + this.members.clear(); + if (members != null) { + this.members.addAll(members); + } + return this; + } + + public Builder addMembers(String members) { + this.members.add(members); + return this; + } + + public Builder addAllMembers(List members) { + if (members != null) { + this.members.addAll(members); + } + return this; + } + + public CreateOrganizationMemberRequestContent build() { + return new CreateOrganizationMemberRequestContent(members, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java new file mode 100644 index 000000000..107e0da29 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteOrganizationMembersRequestContent.Builder.class) +public final class DeleteOrganizationMembersRequestContent { + private final List members; + + private final Map additionalProperties; + + private DeleteOrganizationMembersRequestContent(List members, Map additionalProperties) { + this.members = members; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of user IDs to remove from the organization. + */ + @JsonProperty("members") + public List getMembers() { + return members; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteOrganizationMembersRequestContent + && equalTo((DeleteOrganizationMembersRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteOrganizationMembersRequestContent other) { + return members.equals(other.members); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.members); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List members = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteOrganizationMembersRequestContent other) { + members(other.getMembers()); + return this; + } + + /** + *

List of user IDs to remove from the organization.

+ */ + @JsonSetter(value = "members", nulls = Nulls.SKIP) + public Builder members(List members) { + this.members.clear(); + if (members != null) { + this.members.addAll(members); + } + return this; + } + + public Builder addMembers(String members) { + this.members.add(members); + return this; + } + + public Builder addAllMembers(List members) { + if (members != null) { + this.members.addAll(members); + } + return this; + } + + public DeleteOrganizationMembersRequestContent build() { + return new DeleteOrganizationMembersRequestContent(members, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java new file mode 100644 index 000000000..3fa65613f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationInvitationRequestParameters.Builder.class) +public final class GetOrganizationInvitationRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetOrganizationInvitationRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). Defaults to true. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationInvitationRequestParameters + && equalTo((GetOrganizationInvitationRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationInvitationRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOrganizationInvitationRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetOrganizationInvitationRequestParameters build() { + return new GetOrganizationInvitationRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java new file mode 100644 index 000000000..38d7edf5b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java @@ -0,0 +1,418 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationClientGrantsRequestParameters.Builder.class) +public final class ListOrganizationClientGrantsRequestParameters { + private final Optional> grantIds; + + private final OptionalNullable audience; + + private final OptionalNullable clientId; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListOrganizationClientGrantsRequestParameters( + Optional> grantIds, + OptionalNullable audience, + OptionalNullable clientId, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.grantIds = grantIds; + this.audience = audience; + this.clientId = clientId; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).<br /><b>e.g.</b> <i>../client-grants?grant_ids=id1&grant_ids=id2</i> + */ + @JsonIgnore + public Optional> getGrantIds() { + if (grantIds == null) { + return Optional.empty(); + } + return grantIds; + } + + /** + * @return Optional filter on audience of the client grant. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + public OptionalNullable getAudience() { + if (audience == null) { + return OptionalNullable.absent(); + } + return audience; + } + + /** + * @return Optional filter on client_id of the client grant. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("grant_ids") + private Optional> _getGrantIds() { + return grantIds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + private OptionalNullable _getAudience() { + return audience; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationClientGrantsRequestParameters + && equalTo((ListOrganizationClientGrantsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationClientGrantsRequestParameters other) { + return grantIds.equals(other.grantIds) + && audience.equals(other.audience) + && clientId.equals(other.clientId) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.grantIds, this.audience, this.clientId, this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> grantIds = Optional.empty(); + + private OptionalNullable audience = OptionalNullable.absent(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationClientGrantsRequestParameters other) { + grantIds(other.getGrantIds()); + audience(other.getAudience()); + clientId(other.getClientId()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).<br /><b>e.g.</b> <i>../client-grants?grant_ids=id1&grant_ids=id2</i>

+ */ + @JsonSetter(value = "grant_ids", nulls = Nulls.SKIP) + public Builder grantIds(@Nullable Optional> grantIds) { + this.grantIds = grantIds; + return this; + } + + public Builder grantIds(List grantIds) { + this.grantIds = Optional.ofNullable(grantIds); + return this; + } + + public Builder grantIds(com.auth0.client.mgmt.core.Nullable> grantIds) { + if (grantIds.isNull()) { + this.grantIds = null; + } else if (grantIds.isEmpty()) { + this.grantIds = Optional.empty(); + } else { + this.grantIds = Optional.of(grantIds.get()); + } + return this; + } + + public Builder grantIds(String grantIds) { + this.grantIds = Optional.of(Collections.singletonList(grantIds)); + return this; + } + + /** + *

Optional filter on audience of the client grant.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(@Nullable OptionalNullable audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = OptionalNullable.of(audience); + return this; + } + + public Builder audience(Optional audience) { + if (audience.isPresent()) { + this.audience = OptionalNullable.of(audience.get()); + } else { + this.audience = OptionalNullable.absent(); + } + return this; + } + + public Builder audience(com.auth0.client.mgmt.core.Nullable audience) { + if (audience.isNull()) { + this.audience = OptionalNullable.ofNull(); + } else if (audience.isEmpty()) { + this.audience = OptionalNullable.absent(); + } else { + this.audience = OptionalNullable.of(audience.get()); + } + return this; + } + + /** + *

Optional filter on client_id of the client grant.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListOrganizationClientGrantsRequestParameters build() { + return new ListOrganizationClientGrantsRequestParameters( + grantIds, audience, clientId, page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java new file mode 100644 index 000000000..76a4e4ca7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationConnectionsRequestParameters.Builder.class) +public final class ListOrganizationConnectionsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListOrganizationConnectionsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationConnectionsRequestParameters + && equalTo((ListOrganizationConnectionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationConnectionsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationConnectionsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListOrganizationConnectionsRequestParameters build() { + return new ListOrganizationConnectionsRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java new file mode 100644 index 000000000..e216f160a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java @@ -0,0 +1,420 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationInvitationsRequestParameters.Builder.class) +public final class ListOrganizationInvitationsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable sort; + + private final Map additionalProperties; + + private ListOrganizationInvitationsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable sort, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.fields = fields; + this.includeFields = includeFields; + this.sort = sort; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return When true, return results inside an object that also contains the start and limit. When false (default), a direct array of results is returned. We do not yet support returning the total invitations count. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). Defaults to true. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationInvitationsRequestParameters + && equalTo((ListOrganizationInvitationsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationInvitationsRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && sort.equals(other.sort); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals, this.fields, this.includeFields, this.sort); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationInvitationsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + sort(other.getSort()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

When true, return results inside an object that also contains the start and limit. When false (default), a direct array of results is returned. We do not yet support returning the total invitations count.

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + public ListOrganizationInvitationsRequestParameters build() { + return new ListOrganizationInvitationsRequestParameters( + page, perPage, includeTotals, fields, includeFields, sort, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java new file mode 100644 index 000000000..4c9a985ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java @@ -0,0 +1,309 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationMembersRequestParameters.Builder.class) +public final class ListOrganizationMembersRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private ListOrganizationMembersRequestParameters( + OptionalNullable from, + OptionalNullable take, + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.from = from; + this.take = take; + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationMembersRequestParameters + && equalTo((ListOrganizationMembersRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationMembersRequestParameters other) { + return from.equals(other.from) + && take.equals(other.take) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take, this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationMembersRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public ListOrganizationMembersRequestParameters build() { + return new ListOrganizationMembersRequestParameters( + from, take, fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java new file mode 100644 index 000000000..ee5ef19d8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationConnectionRequestContent.Builder.class) +public final class UpdateOrganizationConnectionRequestContent { + private final Optional assignMembershipOnLogin; + + private final Optional isSignupEnabled; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private UpdateOrganizationConnectionRequestContent( + Optional assignMembershipOnLogin, + Optional isSignupEnabled, + Optional showAsButton, + Map additionalProperties) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.isSignupEnabled = isSignupEnabled; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationConnectionRequestContent + && equalTo((UpdateOrganizationConnectionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationConnectionRequestContent other) { + return assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && isSignupEnabled.equals(other.isSignupEnabled) + && showAsButton.equals(other.showAsButton); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationConnectionRequestContent other) { + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + isSignupEnabled(other.getIsSignupEnabled()); + showAsButton(other.getShowAsButton()); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + public UpdateOrganizationConnectionRequestContent build() { + return new UpdateOrganizationConnectionRequestContent( + assignMembershipOnLogin, isSignupEnabled, showAsButton, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncCustomTextClient.java new file mode 100644 index 000000000..5063f6321 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncCustomTextClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.PromptLanguageEnum; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomTextClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomTextClient rawClient; + + public AsyncCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomTextClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomTextClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public CompletableFuture> get(PromptGroupNameEnum prompt, PromptLanguageEnum language) { + return this.rawClient.get(prompt, language).thenApply(response -> response.body()); + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public CompletableFuture> get( + PromptGroupNameEnum prompt, PromptLanguageEnum language, RequestOptions requestOptions) { + return this.rawClient.get(prompt, language, requestOptions).thenApply(response -> response.body()); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public CompletableFuture set( + PromptGroupNameEnum prompt, PromptLanguageEnum language, Map request) { + return this.rawClient.set(prompt, language, request).thenApply(response -> response.body()); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public CompletableFuture set( + PromptGroupNameEnum prompt, + PromptLanguageEnum language, + Map request, + RequestOptions requestOptions) { + return this.rawClient.set(prompt, language, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncPartialsClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncPartialsClient.java new file mode 100644 index 000000000..f55727f33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncPartialsClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.PartialGroupsEnum; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AsyncPartialsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPartialsClient rawClient; + + public AsyncPartialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPartialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPartialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get template partials for a prompt + */ + public CompletableFuture> get(PartialGroupsEnum prompt) { + return this.rawClient.get(prompt).thenApply(response -> response.body()); + } + + /** + * Get template partials for a prompt + */ + public CompletableFuture> get(PartialGroupsEnum prompt, RequestOptions requestOptions) { + return this.rawClient.get(prompt, requestOptions).thenApply(response -> response.body()); + } + + /** + * Set template partials for a prompt + */ + public CompletableFuture set(PartialGroupsEnum prompt, Map request) { + return this.rawClient.set(prompt, request).thenApply(response -> response.body()); + } + + /** + * Set template partials for a prompt + */ + public CompletableFuture set( + PartialGroupsEnum prompt, Map request, RequestOptions requestOptions) { + return this.rawClient.set(prompt, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawCustomTextClient.java new file mode 100644 index 000000000..ca0c1277a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawCustomTextClient.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.PromptLanguageEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomTextClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public CompletableFuture>> get( + PromptGroupNameEnum prompt, PromptLanguageEnum language) { + return get(prompt, language, null); + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public CompletableFuture>> get( + PromptGroupNameEnum prompt, PromptLanguageEnum language, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("custom-text") + .addPathSegment(language.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public CompletableFuture> set( + PromptGroupNameEnum prompt, PromptLanguageEnum language, Map request) { + return set(prompt, language, request, null); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public CompletableFuture> set( + PromptGroupNameEnum prompt, + PromptLanguageEnum language, + Map request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("custom-text") + .addPathSegment(language.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawPartialsClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawPartialsClient.java new file mode 100644 index 000000000..5767e8a1d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawPartialsClient.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.PartialGroupsEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPartialsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPartialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get template partials for a prompt + */ + public CompletableFuture>> get(PartialGroupsEnum prompt) { + return get(prompt, null); + } + + /** + * Get template partials for a prompt + */ + public CompletableFuture>> get( + PartialGroupsEnum prompt, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("partials") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Set template partials for a prompt + */ + public CompletableFuture> set( + PartialGroupsEnum prompt, Map request) { + return set(prompt, request, null); + } + + /** + * Set template partials for a prompt + */ + public CompletableFuture> set( + PartialGroupsEnum prompt, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("partials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java new file mode 100644 index 000000000..ac1436180 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java @@ -0,0 +1,458 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.PaymentRequiredError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; +import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.GetAculResponseContent; +import com.auth0.client.mgmt.types.ListAculsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.ScreenGroupNameEnum; +import com.auth0.client.mgmt.types.UpdateAculResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRenderingClient { + protected final ClientOptions clientOptions; + + public AsyncRawRenderingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture>> list() { + return list(ListAculsRequestParameters.builder().build()); + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture>> list( + ListAculsRequestParameters request) { + return list(request, null); + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture>> list( + ListAculsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts/rendering"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "prompt", request.getPrompt(), false); + QueryStringMapper.addQueryParameter(httpUrl, "screen", request.getScreen(), false); + QueryStringMapper.addQueryParameter(httpUrl, "rendering_mode", request.getRenderingMode(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListAculsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListAculsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListAculsRequestParameters nextRequest = ListAculsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getConfigs().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get render settings for a screen. + */ + public CompletableFuture> get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return get(prompt, screen, null); + } + + /** + * Get render settings for a screen. + */ + public CompletableFuture> get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("screen") + .addPathSegment(screen.toString()) + .addPathSegments("rendering") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAculResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture> update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return update(prompt, screen, UpdateAculRequestContent.builder().build()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture> update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { + return update(prompt, screen, request, null); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture> update( + PromptGroupNameEnum prompt, + ScreenGroupNameEnum screen, + UpdateAculRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("screen") + .addPathSegment(screen.toString()) + .addPathSegments("rendering") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateAculResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java new file mode 100644 index 000000000..49059fe9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; +import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.GetAculResponseContent; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.ScreenGroupNameEnum; +import com.auth0.client.mgmt.types.UpdateAculResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncRenderingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRenderingClient rawClient; + + public AsyncRenderingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRenderingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRenderingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture> list(ListAculsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get render setting configurations for all screens. + */ + public CompletableFuture> list( + ListAculsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get render settings for a screen. + */ + public CompletableFuture get(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return this.rawClient.get(prompt, screen).thenApply(response -> response.body()); + } + + /** + * Get render settings for a screen. + */ + public CompletableFuture get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { + return this.rawClient.get(prompt, screen, requestOptions).thenApply(response -> response.body()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return this.rawClient.update(prompt, screen).thenApply(response -> response.body()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { + return this.rawClient.update(prompt, screen, request).thenApply(response -> response.body()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public CompletableFuture update( + PromptGroupNameEnum prompt, + ScreenGroupNameEnum screen, + UpdateAculRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(prompt, screen, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/CustomTextClient.java b/src/main/java/com/auth0/client/mgmt/prompts/CustomTextClient.java new file mode 100644 index 000000000..feed169cd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/CustomTextClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.PromptLanguageEnum; +import java.util.Map; + +public class CustomTextClient { + protected final ClientOptions clientOptions; + + private final RawCustomTextClient rawClient; + + public CustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomTextClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomTextClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public Map get(PromptGroupNameEnum prompt, PromptLanguageEnum language) { + return this.rawClient.get(prompt, language).body(); + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public Map get( + PromptGroupNameEnum prompt, PromptLanguageEnum language, RequestOptions requestOptions) { + return this.rawClient.get(prompt, language, requestOptions).body(); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public void set(PromptGroupNameEnum prompt, PromptLanguageEnum language, Map request) { + this.rawClient.set(prompt, language, request).body(); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public void set( + PromptGroupNameEnum prompt, + PromptLanguageEnum language, + Map request, + RequestOptions requestOptions) { + this.rawClient.set(prompt, language, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/PartialsClient.java b/src/main/java/com/auth0/client/mgmt/prompts/PartialsClient.java new file mode 100644 index 000000000..387ef1d0b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/PartialsClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.PartialGroupsEnum; +import java.util.Map; + +public class PartialsClient { + protected final ClientOptions clientOptions; + + private final RawPartialsClient rawClient; + + public PartialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPartialsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPartialsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get template partials for a prompt + */ + public Map get(PartialGroupsEnum prompt) { + return this.rawClient.get(prompt).body(); + } + + /** + * Get template partials for a prompt + */ + public Map get(PartialGroupsEnum prompt, RequestOptions requestOptions) { + return this.rawClient.get(prompt, requestOptions).body(); + } + + /** + * Set template partials for a prompt + */ + public void set(PartialGroupsEnum prompt, Map request) { + this.rawClient.set(prompt, request).body(); + } + + /** + * Set template partials for a prompt + */ + public void set(PartialGroupsEnum prompt, Map request, RequestOptions requestOptions) { + this.rawClient.set(prompt, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RawCustomTextClient.java new file mode 100644 index 000000000..d177e3c69 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/RawCustomTextClient.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.PromptLanguageEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomTextClient { + protected final ClientOptions clientOptions; + + public RawCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public ManagementApiHttpResponse> get(PromptGroupNameEnum prompt, PromptLanguageEnum language) { + return get(prompt, language, null); + } + + /** + * Retrieve custom text for a specific prompt and language. + */ + public ManagementApiHttpResponse> get( + PromptGroupNameEnum prompt, PromptLanguageEnum language, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("custom-text") + .addPathSegment(language.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public ManagementApiHttpResponse set( + PromptGroupNameEnum prompt, PromptLanguageEnum language, Map request) { + return set(prompt, language, request, null); + } + + /** + * Set custom text for a specific prompt. Existing texts will be overwritten. + */ + public ManagementApiHttpResponse set( + PromptGroupNameEnum prompt, + PromptLanguageEnum language, + Map request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("custom-text") + .addPathSegment(language.toString()) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RawPartialsClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RawPartialsClient.java new file mode 100644 index 000000000..2d11561ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/RawPartialsClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.PartialGroupsEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPartialsClient { + protected final ClientOptions clientOptions; + + public RawPartialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get template partials for a prompt + */ + public ManagementApiHttpResponse> get(PartialGroupsEnum prompt) { + return get(prompt, null); + } + + /** + * Get template partials for a prompt + */ + public ManagementApiHttpResponse> get(PartialGroupsEnum prompt, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("partials") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Set template partials for a prompt + */ + public ManagementApiHttpResponse set(PartialGroupsEnum prompt, Map request) { + return set(prompt, request, null); + } + + /** + * Set template partials for a prompt + */ + public ManagementApiHttpResponse set( + PartialGroupsEnum prompt, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("partials") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java new file mode 100644 index 000000000..6e9f7dc88 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.PaymentRequiredError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; +import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.GetAculResponseContent; +import com.auth0.client.mgmt.types.ListAculsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.ScreenGroupNameEnum; +import com.auth0.client.mgmt.types.UpdateAculResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRenderingClient { + protected final ClientOptions clientOptions; + + public RawRenderingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get render setting configurations for all screens. + */ + public ManagementApiHttpResponse> list() { + return list(ListAculsRequestParameters.builder().build()); + } + + /** + * Get render setting configurations for all screens. + */ + public ManagementApiHttpResponse> list(ListAculsRequestParameters request) { + return list(request, null); + } + + /** + * Get render setting configurations for all screens. + */ + public ManagementApiHttpResponse> list( + ListAculsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts/rendering"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "prompt", request.getPrompt(), false); + QueryStringMapper.addQueryParameter(httpUrl, "screen", request.getScreen(), false); + QueryStringMapper.addQueryParameter(httpUrl, "rendering_mode", request.getRenderingMode(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListAculsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListAculsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListAculsRequestParameters nextRequest = ListAculsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getConfigs().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Get render settings for a screen. + */ + public ManagementApiHttpResponse get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return get(prompt, screen, null); + } + + /** + * Get render settings for a screen. + */ + public ManagementApiHttpResponse get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("screen") + .addPathSegment(screen.toString()) + .addPathSegments("rendering") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAculResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public ManagementApiHttpResponse update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return update(prompt, screen, UpdateAculRequestContent.builder().build()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public ManagementApiHttpResponse update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { + return update(prompt, screen, request, null); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public ManagementApiHttpResponse update( + PromptGroupNameEnum prompt, + ScreenGroupNameEnum screen, + UpdateAculRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts") + .addPathSegment(prompt.toString()) + .addPathSegments("screen") + .addPathSegment(screen.toString()) + .addPathSegments("rendering") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateAculResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java new file mode 100644 index 000000000..b5e4718de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; +import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.GetAculResponseContent; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.ScreenGroupNameEnum; +import com.auth0.client.mgmt.types.UpdateAculResponseContent; + +public class RenderingClient { + protected final ClientOptions clientOptions; + + private final RawRenderingClient rawClient; + + public RenderingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRenderingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRenderingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get render setting configurations for all screens. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get render setting configurations for all screens. + */ + public SyncPagingIterable list(ListAculsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Get render setting configurations for all screens. + */ + public SyncPagingIterable list( + ListAculsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get render settings for a screen. + */ + public GetAculResponseContent get(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return this.rawClient.get(prompt, screen).body(); + } + + /** + * Get render settings for a screen. + */ + public GetAculResponseContent get( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { + return this.rawClient.get(prompt, screen, requestOptions).body(); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public UpdateAculResponseContent update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { + return this.rawClient.update(prompt, screen).body(); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public UpdateAculResponseContent update( + PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { + return this.rawClient.update(prompt, screen, request).body(); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + *

<p> + * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. + * </p> + * <pre>{ + * "head_tags": [ + * { + * "tag": "script", + * "attributes": { + * "defer": true, + * "src": "URL_TO_ASSET", + * "async": true, + * "integrity": [ + * "ASSET_SHA" + * ] + * } + * }, + * { + * "tag": "link", + * "attributes": { + * "href": "URL_TO_ASSET", + * "rel": "stylesheet" + * } + * } + * ] + * } + * </pre>

+ */ + public UpdateAculResponseContent update( + PromptGroupNameEnum prompt, + ScreenGroupNameEnum screen, + UpdateAculRequestContent request, + RequestOptions requestOptions) { + return this.rawClient.update(prompt, screen, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java new file mode 100644 index 000000000..051ffc54c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java @@ -0,0 +1,556 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.AculRenderingModeEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListAculsRequestParameters.Builder.class) +public final class ListAculsRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable prompt; + + private final OptionalNullable screen; + + private final OptionalNullable renderingMode; + + private final Map additionalProperties; + + private ListAculsRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable prompt, + OptionalNullable screen, + OptionalNullable renderingMode, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.prompt = prompt; + this.screen = screen; + this.renderingMode = renderingMode; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (default: true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Maximum value is 100, default value is 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total configuration count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Name of the prompt to filter by + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("prompt") + public OptionalNullable getPrompt() { + if (prompt == null) { + return OptionalNullable.absent(); + } + return prompt; + } + + /** + * @return Name of the screen to filter by + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("screen") + public OptionalNullable getScreen() { + if (screen == null) { + return OptionalNullable.absent(); + } + return screen; + } + + /** + * @return Rendering mode to filter by + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rendering_mode") + public OptionalNullable getRenderingMode() { + if (renderingMode == null) { + return OptionalNullable.absent(); + } + return renderingMode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("prompt") + private OptionalNullable _getPrompt() { + return prompt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("screen") + private OptionalNullable _getScreen() { + return screen; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rendering_mode") + private OptionalNullable _getRenderingMode() { + return renderingMode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListAculsRequestParameters && equalTo((ListAculsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListAculsRequestParameters other) { + return fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && prompt.equals(other.prompt) + && screen.equals(other.screen) + && renderingMode.equals(other.renderingMode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.fields, + this.includeFields, + this.page, + this.perPage, + this.includeTotals, + this.prompt, + this.screen, + this.renderingMode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable prompt = OptionalNullable.absent(); + + private OptionalNullable screen = OptionalNullable.absent(); + + private OptionalNullable renderingMode = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListAculsRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + prompt(other.getPrompt()); + screen(other.getScreen()); + renderingMode(other.getRenderingMode()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (default: true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Maximum value is 100, default value is 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total configuration count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Name of the prompt to filter by

+ */ + @JsonSetter(value = "prompt", nulls = Nulls.SKIP) + public Builder prompt(@Nullable OptionalNullable prompt) { + this.prompt = prompt; + return this; + } + + public Builder prompt(String prompt) { + this.prompt = OptionalNullable.of(prompt); + return this; + } + + public Builder prompt(Optional prompt) { + if (prompt.isPresent()) { + this.prompt = OptionalNullable.of(prompt.get()); + } else { + this.prompt = OptionalNullable.absent(); + } + return this; + } + + public Builder prompt(com.auth0.client.mgmt.core.Nullable prompt) { + if (prompt.isNull()) { + this.prompt = OptionalNullable.ofNull(); + } else if (prompt.isEmpty()) { + this.prompt = OptionalNullable.absent(); + } else { + this.prompt = OptionalNullable.of(prompt.get()); + } + return this; + } + + /** + *

Name of the screen to filter by

+ */ + @JsonSetter(value = "screen", nulls = Nulls.SKIP) + public Builder screen(@Nullable OptionalNullable screen) { + this.screen = screen; + return this; + } + + public Builder screen(String screen) { + this.screen = OptionalNullable.of(screen); + return this; + } + + public Builder screen(Optional screen) { + if (screen.isPresent()) { + this.screen = OptionalNullable.of(screen.get()); + } else { + this.screen = OptionalNullable.absent(); + } + return this; + } + + public Builder screen(com.auth0.client.mgmt.core.Nullable screen) { + if (screen.isNull()) { + this.screen = OptionalNullable.ofNull(); + } else if (screen.isEmpty()) { + this.screen = OptionalNullable.absent(); + } else { + this.screen = OptionalNullable.of(screen.get()); + } + return this; + } + + /** + *

Rendering mode to filter by

+ */ + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public Builder renderingMode(@Nullable OptionalNullable renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + public Builder renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = OptionalNullable.of(renderingMode); + return this; + } + + public Builder renderingMode(Optional renderingMode) { + if (renderingMode.isPresent()) { + this.renderingMode = OptionalNullable.of(renderingMode.get()); + } else { + this.renderingMode = OptionalNullable.absent(); + } + return this; + } + + public Builder renderingMode(com.auth0.client.mgmt.core.Nullable renderingMode) { + if (renderingMode.isNull()) { + this.renderingMode = OptionalNullable.ofNull(); + } else if (renderingMode.isEmpty()) { + this.renderingMode = OptionalNullable.absent(); + } else { + this.renderingMode = OptionalNullable.of(renderingMode.get()); + } + return this; + } + + public ListAculsRequestParameters build() { + return new ListAculsRequestParameters( + fields, + includeFields, + page, + perPage, + includeTotals, + prompt, + screen, + renderingMode, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java new file mode 100644 index 000000000..20ba571c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.AculFilters; +import com.auth0.client.mgmt.types.AculHeadTag; +import com.auth0.client.mgmt.types.AculRenderingModeEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAculRequestContent.Builder.class) +public final class UpdateAculRequestContent { + private final Optional renderingMode; + + private final Optional> contextConfiguration; + + private final OptionalNullable defaultHeadTagsDisabled; + + private final Optional> headTags; + + private final OptionalNullable filters; + + private final OptionalNullable usePageTemplate; + + private final Map additionalProperties; + + private UpdateAculRequestContent( + Optional renderingMode, + Optional> contextConfiguration, + OptionalNullable defaultHeadTagsDisabled, + Optional> headTags, + OptionalNullable filters, + OptionalNullable usePageTemplate, + Map additionalProperties) { + this.renderingMode = renderingMode; + this.contextConfiguration = contextConfiguration; + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.headTags = headTags; + this.filters = filters; + this.usePageTemplate = usePageTemplate; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rendering_mode") + public Optional getRenderingMode() { + return renderingMode; + } + + /** + * @return Context values to make available + */ + @JsonProperty("context_configuration") + public Optional> getContextConfiguration() { + return contextConfiguration; + } + + /** + * @return Override Universal Login default head tags + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + public OptionalNullable getDefaultHeadTagsDisabled() { + if (defaultHeadTagsDisabled == null) { + return OptionalNullable.absent(); + } + return defaultHeadTagsDisabled; + } + + /** + * @return An array of head tags + */ + @JsonProperty("head_tags") + public Optional> getHeadTags() { + return headTags; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + public OptionalNullable getFilters() { + if (filters == null) { + return OptionalNullable.absent(); + } + return filters; + } + + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + private OptionalNullable _getDefaultHeadTagsDisabled() { + return defaultHeadTagsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + private OptionalNullable _getUsePageTemplate() { + return usePageTemplate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAculRequestContent && equalTo((UpdateAculRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAculRequestContent other) { + return renderingMode.equals(other.renderingMode) + && contextConfiguration.equals(other.contextConfiguration) + && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && headTags.equals(other.headTags) + && filters.equals(other.filters) + && usePageTemplate.equals(other.usePageTemplate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.renderingMode, + this.contextConfiguration, + this.defaultHeadTagsDisabled, + this.headTags, + this.filters, + this.usePageTemplate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional renderingMode = Optional.empty(); + + private Optional> contextConfiguration = Optional.empty(); + + private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + + private Optional> headTags = Optional.empty(); + + private OptionalNullable filters = OptionalNullable.absent(); + + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateAculRequestContent other) { + renderingMode(other.getRenderingMode()); + contextConfiguration(other.getContextConfiguration()); + defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + headTags(other.getHeadTags()); + filters(other.getFilters()); + usePageTemplate(other.getUsePageTemplate()); + return this; + } + + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public Builder renderingMode(Optional renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + public Builder renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = Optional.ofNullable(renderingMode); + return this; + } + + /** + *

Context values to make available

+ */ + @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) + public Builder contextConfiguration(Optional> contextConfiguration) { + this.contextConfiguration = contextConfiguration; + return this; + } + + public Builder contextConfiguration(List contextConfiguration) { + this.contextConfiguration = Optional.ofNullable(contextConfiguration); + return this; + } + + /** + *

Override Universal Login default head tags

+ */ + @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) + public Builder defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + return this; + } + + public Builder defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled); + return this; + } + + public Builder defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isPresent()) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isNull()) { + this.defaultHeadTagsDisabled = OptionalNullable.ofNull(); + } else if (defaultHeadTagsDisabled.isEmpty()) { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } + return this; + } + + /** + *

An array of head tags

+ */ + @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) + public Builder headTags(Optional> headTags) { + this.headTags = headTags; + return this; + } + + public Builder headTags(List headTags) { + this.headTags = Optional.ofNullable(headTags); + return this; + } + + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(@Nullable OptionalNullable filters) { + this.filters = filters; + return this; + } + + public Builder filters(AculFilters filters) { + this.filters = OptionalNullable.of(filters); + return this; + } + + public Builder filters(Optional filters) { + if (filters.isPresent()) { + this.filters = OptionalNullable.of(filters.get()); + } else { + this.filters = OptionalNullable.absent(); + } + return this; + } + + public Builder filters(com.auth0.client.mgmt.core.Nullable filters) { + if (filters.isNull()) { + this.filters = OptionalNullable.ofNull(); + } else if (filters.isEmpty()) { + this.filters = OptionalNullable.absent(); + } else { + this.filters = OptionalNullable.of(filters.get()); + } + return this; + } + + /** + *

Use page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + + public UpdateAculRequestContent build() { + return new UpdateAculRequestContent( + renderingMode, + contextConfiguration, + defaultHeadTagsDisabled, + headTags, + filters, + usePageTemplate, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncPermissionsClient.java new file mode 100644 index 000000000..4c9bbab90 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncPermissionsClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.ListRolePermissionsRequestParameters; +import com.auth0.client.mgmt.types.PermissionsResponsePayload; +import java.util.concurrent.CompletableFuture; + +public class AsyncPermissionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPermissionsClient rawClient; + + public AsyncPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPermissionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPermissionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture> list( + String id, ListRolePermissionsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture> list( + String id, ListRolePermissionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public CompletableFuture add(String id, AddRolePermissionsRequestContent request) { + return this.rawClient.add(id, request).thenApply(response -> response.body()); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public CompletableFuture add( + String id, AddRolePermissionsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.add(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public CompletableFuture delete(String id, DeleteRolePermissionsRequestContent request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public CompletableFuture delete( + String id, DeleteRolePermissionsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java new file mode 100644 index 000000000..1dbf41ab4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.ListRolePermissionsRequestParameters; +import com.auth0.client.mgmt.types.ListRolePermissionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.PermissionsResponsePayload; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPermissionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture>> list( + String id) { + return list(id, ListRolePermissionsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture>> list( + String id, ListRolePermissionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public CompletableFuture>> list( + String id, ListRolePermissionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRolePermissionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRolePermissionsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListRolePermissionsRequestParameters nextRequest = + ListRolePermissionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getPermissions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public CompletableFuture> add(String id, AddRolePermissionsRequestContent request) { + return add(id, request, null); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public CompletableFuture> add( + String id, AddRolePermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public CompletableFuture> delete( + String id, DeleteRolePermissionsRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public CompletableFuture> delete( + String id, DeleteRolePermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java new file mode 100644 index 000000000..fd185ce51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java @@ -0,0 +1,297 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; +import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; +import com.auth0.client.mgmt.types.ListRoleUsersPaginatedResponseContent; +import com.auth0.client.mgmt.types.RoleUser; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list(String id) { + return list(id, ListRoleUsersRequestParameters.builder().build()); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + String id, ListRoleUsersRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture>> list( + String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRoleUsersPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRoleUsersPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRoleUsersRequestParameters nextRequest = ListRoleUsersRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getUsers().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public CompletableFuture> assign(String id, AssignRoleUsersRequestContent request) { + return assign(id, request, null); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public CompletableFuture> assign( + String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java new file mode 100644 index 000000000..4e55dcd99 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; +import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; +import com.auth0.client.mgmt.types.RoleUser; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list(String id, ListRoleUsersRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public CompletableFuture> list( + String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public CompletableFuture assign(String id, AssignRoleUsersRequestContent request) { + return this.rawClient.assign(id, request).thenApply(response -> response.body()); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public CompletableFuture assign( + String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { + return this.rawClient.assign(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/PermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/PermissionsClient.java new file mode 100644 index 000000000..760e9b771 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/PermissionsClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.ListRolePermissionsRequestParameters; +import com.auth0.client.mgmt.types.PermissionsResponsePayload; + +public class PermissionsClient { + protected final ClientOptions clientOptions; + + private final RawPermissionsClient rawClient; + + public PermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPermissionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPermissionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public SyncPagingIterable list( + String id, ListRolePermissionsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public SyncPagingIterable list( + String id, ListRolePermissionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public void add(String id, AddRolePermissionsRequestContent request) { + this.rawClient.add(id, request).body(); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public void add(String id, AddRolePermissionsRequestContent request, RequestOptions requestOptions) { + this.rawClient.add(id, request, requestOptions).body(); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public void delete(String id, DeleteRolePermissionsRequestContent request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public void delete(String id, DeleteRolePermissionsRequestContent request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java new file mode 100644 index 000000000..09454934a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.ListRolePermissionsRequestParameters; +import com.auth0.client.mgmt.types.ListRolePermissionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.PermissionsResponsePayload; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPermissionsClient { + protected final ClientOptions clientOptions; + + public RawPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListRolePermissionsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public ManagementApiHttpResponse> list( + String id, ListRolePermissionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list (name, description, resource server) of permissions granted by a specified user role. + */ + public ManagementApiHttpResponse> list( + String id, ListRolePermissionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRolePermissionsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRolePermissionsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListRolePermissionsRequestParameters nextRequest = ListRolePermissionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getPermissions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public ManagementApiHttpResponse add(String id, AddRolePermissionsRequestContent request) { + return add(id, request, null); + } + + /** + * Add one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> to a specified user role. + */ + public ManagementApiHttpResponse add( + String id, AddRolePermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public ManagementApiHttpResponse delete(String id, DeleteRolePermissionsRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove one or more <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions">permissions</a> from a specified user role. + */ + public ManagementApiHttpResponse delete( + String id, DeleteRolePermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java new file mode 100644 index 000000000..36228295c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; +import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; +import com.auth0.client.mgmt.types.ListRoleUsersPaginatedResponseContent; +import com.auth0.client.mgmt.types.RoleUser; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListRoleUsersRequestParameters.builder().build()); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + String id, ListRoleUsersRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public ManagementApiHttpResponse> list( + String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("users"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRoleUsersPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRoleUsersPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRoleUsersRequestParameters nextRequest = ListRoleUsersRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getUsers().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public ManagementApiHttpResponse assign(String id, AssignRoleUsersRequestContent request) { + return assign(id, request, null); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public ManagementApiHttpResponse assign( + String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("roles") + .addPathSegment(id) + .addPathSegments("users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java new file mode 100644 index 000000000..ef6849e83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; +import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; +import com.auth0.client.mgmt.types.RoleUser; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list(String id, ListRoleUsersRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve list of users associated with a specific role. For Dashboard instructions, review <a href="https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles">View Users Assigned to Roles</a>. + *

This endpoint supports two types of pagination:

+ *

<ul> + * <li>Offset pagination</li> + * <li>Checkpoint pagination</li> + * </ul>

+ *

Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

+ *

<h2>Checkpoint Pagination</h2>

+ *

To search by checkpoint, use the following parameters:

+ *

<ul> + * <li><code>from</code>: Optional id from which to start selection.</li> + * <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> + * </ul>

+ *

<b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.

+ */ + public SyncPagingIterable list( + String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public void assign(String id, AssignRoleUsersRequestContent request) { + this.rawClient.assign(id, request).body(); + } + + /** + * Assign one or more users to an existing user role. To learn more, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action.

+ */ + public void assign(String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { + this.rawClient.assign(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java new file mode 100644 index 000000000..f8856de96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AddRolePermissionsRequestContent.Builder.class) +public final class AddRolePermissionsRequestContent { + private final List permissions; + + private final Map additionalProperties; + + private AddRolePermissionsRequestContent( + List permissions, Map additionalProperties) { + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + /** + * @return array of resource_server_identifier, permission_name pairs. + */ + @JsonProperty("permissions") + public List getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddRolePermissionsRequestContent && equalTo((AddRolePermissionsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddRolePermissionsRequestContent other) { + return permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List permissions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AddRolePermissionsRequestContent other) { + permissions(other.getPermissions()); + return this; + } + + /** + *

array of resource_server_identifier, permission_name pairs.

+ */ + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(List permissions) { + this.permissions.clear(); + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public Builder addPermissions(PermissionRequestPayload permissions) { + this.permissions.add(permissions); + return this; + } + + public Builder addAllPermissions(List permissions) { + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public AddRolePermissionsRequestContent build() { + return new AddRolePermissionsRequestContent(permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java new file mode 100644 index 000000000..c91daef11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssignRoleUsersRequestContent.Builder.class) +public final class AssignRoleUsersRequestContent { + private final List users; + + private final Map additionalProperties; + + private AssignRoleUsersRequestContent(List users, Map additionalProperties) { + this.users = users; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id's of the users to assign the role to. + */ + @JsonProperty("users") + public List getUsers() { + return users; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssignRoleUsersRequestContent && equalTo((AssignRoleUsersRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssignRoleUsersRequestContent other) { + return users.equals(other.users); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.users); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List users = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssignRoleUsersRequestContent other) { + users(other.getUsers()); + return this; + } + + /** + *

user_id's of the users to assign the role to.

+ */ + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(List users) { + this.users.clear(); + if (users != null) { + this.users.addAll(users); + } + return this; + } + + public Builder addUsers(String users) { + this.users.add(users); + return this; + } + + public Builder addAllUsers(List users) { + if (users != null) { + this.users.addAll(users); + } + return this; + } + + public AssignRoleUsersRequestContent build() { + return new AssignRoleUsersRequestContent(users, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java new file mode 100644 index 000000000..c611cacf3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteRolePermissionsRequestContent.Builder.class) +public final class DeleteRolePermissionsRequestContent { + private final List permissions; + + private final Map additionalProperties; + + private DeleteRolePermissionsRequestContent( + List permissions, Map additionalProperties) { + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + /** + * @return array of resource_server_identifier, permission_name pairs. + */ + @JsonProperty("permissions") + public List getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteRolePermissionsRequestContent + && equalTo((DeleteRolePermissionsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteRolePermissionsRequestContent other) { + return permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List permissions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteRolePermissionsRequestContent other) { + permissions(other.getPermissions()); + return this; + } + + /** + *

array of resource_server_identifier, permission_name pairs.

+ */ + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(List permissions) { + this.permissions.clear(); + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public Builder addPermissions(PermissionRequestPayload permissions) { + this.permissions.add(permissions); + return this; + } + + public Builder addAllPermissions(List permissions) { + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public DeleteRolePermissionsRequestContent build() { + return new DeleteRolePermissionsRequestContent(permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java new file mode 100644 index 000000000..e6d4a73b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRolePermissionsRequestParameters.Builder.class) +public final class ListRolePermissionsRequestParameters { + private final OptionalNullable perPage; + + private final OptionalNullable page; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListRolePermissionsRequestParameters( + OptionalNullable perPage, + OptionalNullable page, + OptionalNullable includeTotals, + Map additionalProperties) { + this.perPage = perPage; + this.page = page; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRolePermissionsRequestParameters + && equalTo((ListRolePermissionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRolePermissionsRequestParameters other) { + return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.perPage, this.page, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRolePermissionsRequestParameters other) { + perPage(other.getPerPage()); + page(other.getPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListRolePermissionsRequestParameters build() { + return new ListRolePermissionsRequestParameters(perPage, page, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java new file mode 100644 index 000000000..15b28d60a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.roles.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRoleUsersRequestParameters.Builder.class) +public final class ListRoleUsersRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListRoleUsersRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRoleUsersRequestParameters && equalTo((ListRoleUsersRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRoleUsersRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRoleUsersRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListRoleUsersRequestParameters build() { + return new ListRoleUsersRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java new file mode 100644 index 000000000..0addf816c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomTextClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomTextClient rawClient; + + public AsyncCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomTextClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomTextClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture> list(String id, String language, String page) { + return this.rawClient.list(id, language, page).thenApply(response -> response.body()); + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture> list( + String id, String language, String page, RequestOptions requestOptions) { + return this.rawClient.list(id, language, page, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture> set( + String id, String language, String page, Map request) { + return this.rawClient.set(id, language, page, request).thenApply(response -> response.body()); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { + return this.rawClient.set(id, language, page, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java new file mode 100644 index 000000000..3d317a9a9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomTextClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture>> list( + String id, String language, String page) { + return list(id, language, page, null); + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture>> list( + String id, String language, String page, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("custom-text") + .addPathSegment(language) + .addPathSegment(page) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture>> set( + String id, String language, String page, Map request) { + return set(id, language, page, request, null); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public CompletableFuture>> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("custom-text") + .addPathSegment(language) + .addPathSegment(page) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawSsoTicketClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawSsoTicketClient.java new file mode 100644 index 000000000..fbcaf4f45 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawSsoTicketClient.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.selfserviceprofiles.types.CreateSelfServiceProfileSsoTicketRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileSsoTicketResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSsoTicketClient { + protected final ClientOptions clientOptions; + + public AsyncRawSsoTicketClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture> create( + String id) { + return create( + id, CreateSelfServiceProfileSsoTicketRequestContent.builder().build()); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture> create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request) { + return create(id, request, null); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture> create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("sso-ticket") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateSelfServiceProfileSsoTicketResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public CompletableFuture> revoke(String profileId, String id) { + return revoke(profileId, id, null); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public CompletableFuture> revoke( + String profileId, String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(profileId) + .addPathSegments("sso-ticket") + .addPathSegment(id) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncSsoTicketClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncSsoTicketClient.java new file mode 100644 index 000000000..ddcac596e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncSsoTicketClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.selfserviceprofiles.types.CreateSelfServiceProfileSsoTicketRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileSsoTicketResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSsoTicketClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSsoTicketClient rawClient; + + public AsyncSsoTicketClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSsoTicketClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSsoTicketClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CompletableFuture create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public CompletableFuture revoke(String profileId, String id) { + return this.rawClient.revoke(profileId, id).thenApply(response -> response.body()); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public CompletableFuture revoke(String profileId, String id, RequestOptions requestOptions) { + return this.rawClient.revoke(profileId, id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java new file mode 100644 index 000000000..b7530e865 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.Map; + +public class CustomTextClient { + protected final ClientOptions clientOptions; + + private final RawCustomTextClient rawClient; + + public CustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomTextClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomTextClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public Map list(String id, String language, String page) { + return this.rawClient.list(id, language, page).body(); + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public Map list(String id, String language, String page, RequestOptions requestOptions) { + return this.rawClient.list(id, language, page, requestOptions).body(); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public Map set(String id, String language, String page, Map request) { + return this.rawClient.set(id, language, page, request).body(); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public Map set( + String id, String language, String page, Map request, RequestOptions requestOptions) { + return this.rawClient.set(id, language, page, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java new file mode 100644 index 000000000..3ea0e6f01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomTextClient { + protected final ClientOptions clientOptions; + + public RawCustomTextClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public ManagementApiHttpResponse> list(String id, String language, String page) { + return list(id, language, page, null); + } + + /** + * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public ManagementApiHttpResponse> list( + String id, String language, String page, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("custom-text") + .addPathSegment(language) + .addPathSegment(page) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public ManagementApiHttpResponse> set( + String id, String language, String page, Map request) { + return set(id, language, page, request, null); + } + + /** + * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. + */ + public ManagementApiHttpResponse> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("custom-text") + .addPathSegment(language) + .addPathSegment(page) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawSsoTicketClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawSsoTicketClient.java new file mode 100644 index 000000000..0d5cbed7e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawSsoTicketClient.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.selfserviceprofiles.types.CreateSelfServiceProfileSsoTicketRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileSsoTicketResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSsoTicketClient { + protected final ClientOptions clientOptions; + + public RawSsoTicketClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public ManagementApiHttpResponse create(String id) { + return create( + id, CreateSelfServiceProfileSsoTicketRequestContent.builder().build()); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public ManagementApiHttpResponse create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request) { + return create(id, request, null); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public ManagementApiHttpResponse create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(id) + .addPathSegments("sso-ticket") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateSelfServiceProfileSsoTicketResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public ManagementApiHttpResponse revoke(String profileId, String id) { + return revoke(profileId, id, null); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public ManagementApiHttpResponse revoke(String profileId, String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("self-service-profiles") + .addPathSegment(profileId) + .addPathSegments("sso-ticket") + .addPathSegment(id) + .addPathSegments("revoke") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/SsoTicketClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/SsoTicketClient.java new file mode 100644 index 000000000..d6dabe9a1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/SsoTicketClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.selfserviceprofiles.types.CreateSelfServiceProfileSsoTicketRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileSsoTicketResponseContent; + +public class SsoTicketClient { + protected final ClientOptions clientOptions; + + private final RawSsoTicketClient rawClient; + + public SsoTicketClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSsoTicketClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSsoTicketClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CreateSelfServiceProfileSsoTicketResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CreateSelfServiceProfileSsoTicketResponseContent create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile. + */ + public CreateSelfServiceProfileSsoTicketResponseContent create( + String id, CreateSelfServiceProfileSsoTicketRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public void revoke(String profileId, String id) { + this.rawClient.revoke(profileId, id).body(); + } + + /** + * Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a 202 Accepted response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a 202 Accepted response is also returned, signaling that no further action is required. + * Clients should treat these 202 responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found. + */ + public void revoke(String profileId, String id, RequestOptions requestOptions) { + this.rawClient.revoke(profileId, id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java new file mode 100644 index 000000000..78a4a9579 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java @@ -0,0 +1,288 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.selfserviceprofiles.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.SelfServiceProfileSsoTicketConnectionConfig; +import com.auth0.client.mgmt.types.SelfServiceProfileSsoTicketDomainAliasesConfig; +import com.auth0.client.mgmt.types.SelfServiceProfileSsoTicketEnabledOrganization; +import com.auth0.client.mgmt.types.SelfServiceProfileSsoTicketProvisioningConfig; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSelfServiceProfileSsoTicketRequestContent.Builder.class) +public final class CreateSelfServiceProfileSsoTicketRequestContent { + private final Optional connectionId; + + private final Optional connectionConfig; + + private final Optional> enabledClients; + + private final Optional> enabledOrganizations; + + private final Optional ttlSec; + + private final Optional domainAliasesConfig; + + private final Optional provisioningConfig; + + private final Map additionalProperties; + + private CreateSelfServiceProfileSsoTicketRequestContent( + Optional connectionId, + Optional connectionConfig, + Optional> enabledClients, + Optional> enabledOrganizations, + Optional ttlSec, + Optional domainAliasesConfig, + Optional provisioningConfig, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionConfig = connectionConfig; + this.enabledClients = enabledClients; + this.enabledOrganizations = enabledOrganizations; + this.ttlSec = ttlSec; + this.domainAliasesConfig = domainAliasesConfig; + this.provisioningConfig = provisioningConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, this will allow editing of the provided connection during the SSO Flow + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + /** + * @return List of client_ids that the connection will be enabled for. + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return List of organizations that the connection will be enabled for. + */ + @JsonProperty("enabled_organizations") + public Optional> getEnabledOrganizations() { + return enabledOrganizations; + } + + /** + * @return Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + */ + @JsonProperty("ttl_sec") + public Optional getTtlSec() { + return ttlSec; + } + + @JsonProperty("domain_aliases_config") + public Optional getDomainAliasesConfig() { + return domainAliasesConfig; + } + + @JsonProperty("provisioning_config") + public Optional getProvisioningConfig() { + return provisioningConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSelfServiceProfileSsoTicketRequestContent + && equalTo((CreateSelfServiceProfileSsoTicketRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSelfServiceProfileSsoTicketRequestContent other) { + return connectionId.equals(other.connectionId) + && connectionConfig.equals(other.connectionConfig) + && enabledClients.equals(other.enabledClients) + && enabledOrganizations.equals(other.enabledOrganizations) + && ttlSec.equals(other.ttlSec) + && domainAliasesConfig.equals(other.domainAliasesConfig) + && provisioningConfig.equals(other.provisioningConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionConfig, + this.enabledClients, + this.enabledOrganizations, + this.ttlSec, + this.domainAliasesConfig, + this.provisioningConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional> enabledOrganizations = Optional.empty(); + + private Optional ttlSec = Optional.empty(); + + private Optional domainAliasesConfig = Optional.empty(); + + private Optional provisioningConfig = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSelfServiceProfileSsoTicketRequestContent other) { + connectionId(other.getConnectionId()); + connectionConfig(other.getConnectionConfig()); + enabledClients(other.getEnabledClients()); + enabledOrganizations(other.getEnabledOrganizations()); + ttlSec(other.getTtlSec()); + domainAliasesConfig(other.getDomainAliasesConfig()); + provisioningConfig(other.getProvisioningConfig()); + return this; + } + + /** + *

If provided, this will allow editing of the provided connection during the SSO Flow

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(SelfServiceProfileSsoTicketConnectionConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + /** + *

List of client_ids that the connection will be enabled for.

+ */ + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

List of organizations that the connection will be enabled for.

+ */ + @JsonSetter(value = "enabled_organizations", nulls = Nulls.SKIP) + public Builder enabledOrganizations( + Optional> enabledOrganizations) { + this.enabledOrganizations = enabledOrganizations; + return this; + } + + public Builder enabledOrganizations(List enabledOrganizations) { + this.enabledOrganizations = Optional.ofNullable(enabledOrganizations); + return this; + } + + /** + *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

+ */ + @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) + public Builder ttlSec(Optional ttlSec) { + this.ttlSec = ttlSec; + return this; + } + + public Builder ttlSec(Integer ttlSec) { + this.ttlSec = Optional.ofNullable(ttlSec); + return this; + } + + @JsonSetter(value = "domain_aliases_config", nulls = Nulls.SKIP) + public Builder domainAliasesConfig( + Optional domainAliasesConfig) { + this.domainAliasesConfig = domainAliasesConfig; + return this; + } + + public Builder domainAliasesConfig(SelfServiceProfileSsoTicketDomainAliasesConfig domainAliasesConfig) { + this.domainAliasesConfig = Optional.ofNullable(domainAliasesConfig); + return this; + } + + @JsonSetter(value = "provisioning_config", nulls = Nulls.SKIP) + public Builder provisioningConfig(Optional provisioningConfig) { + this.provisioningConfig = provisioningConfig; + return this; + } + + public Builder provisioningConfig(SelfServiceProfileSsoTicketProvisioningConfig provisioningConfig) { + this.provisioningConfig = Optional.ofNullable(provisioningConfig); + return this; + } + + public CreateSelfServiceProfileSsoTicketRequestContent build() { + return new CreateSelfServiceProfileSsoTicketRequestContent( + connectionId, + connectionConfig, + enabledClients, + enabledOrganizations, + ttlSec, + domainAliasesConfig, + provisioningConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java new file mode 100644 index 000000000..a4b4f314a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java @@ -0,0 +1,233 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; +import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; +import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateTenantSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSettingsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get() { + return get(GetTenantSettingsRequestParameters.builder().build()); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get( + GetTenantSettingsRequestParameters request) { + return get(request, null); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture> get( + GetTenantSettingsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tenants/settings"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetTenantSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture> update() { + return update(UpdateTenantSettingsRequestContent.builder().build()); + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture> update( + UpdateTenantSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture> update( + UpdateTenantSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tenants/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateTenantSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/AsyncSettingsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/AsyncSettingsClient.java new file mode 100644 index 000000000..5a6ccbd39 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/AsyncSettingsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; +import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; +import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateTenantSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSettingsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSettingsClient rawClient; + + public AsyncSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSettingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get(GetTenantSettingsRequestParameters request) { + return this.rawClient.get(request).thenApply(response -> response.body()); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public CompletableFuture get( + GetTenantSettingsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture update(UpdateTenantSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update settings for a tenant. + */ + public CompletableFuture update( + UpdateTenantSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/AsyncTenantsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/AsyncTenantsClient.java new file mode 100644 index 000000000..ee247dd1f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/AsyncTenantsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncTenantsClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public AsyncTenantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new AsyncSettingsClient(clientOptions)); + } + + public AsyncSettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/RawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/RawSettingsClient.java new file mode 100644 index 000000000..fe4a41bc7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/RawSettingsClient.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; +import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; +import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateTenantSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSettingsClient { + protected final ClientOptions clientOptions; + + public RawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get() { + return get(GetTenantSettingsRequestParameters.builder().build()); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get(GetTenantSettingsRequestParameters request) { + return get(request, null); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public ManagementApiHttpResponse get( + GetTenantSettingsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tenants/settings"); + QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTenantSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update settings for a tenant. + */ + public ManagementApiHttpResponse update() { + return update(UpdateTenantSettingsRequestContent.builder().build()); + } + + /** + * Update settings for a tenant. + */ + public ManagementApiHttpResponse update( + UpdateTenantSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update settings for a tenant. + */ + public ManagementApiHttpResponse update( + UpdateTenantSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("tenants/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateTenantSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/SettingsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/SettingsClient.java new file mode 100644 index 000000000..fe89bda7e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/SettingsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; +import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; +import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateTenantSettingsResponseContent; + +public class SettingsClient { + protected final ClientOptions clientOptions; + + private final RawSettingsClient rawClient; + + public SettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSettingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public GetTenantSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public GetTenantSettingsResponseContent get(GetTenantSettingsRequestParameters request) { + return this.rawClient.get(request).body(); + } + + /** + * Retrieve tenant settings. A list of fields to include or exclude may also be specified. + */ + public GetTenantSettingsResponseContent get( + GetTenantSettingsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.get(request, requestOptions).body(); + } + + /** + * Update settings for a tenant. + */ + public UpdateTenantSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update settings for a tenant. + */ + public UpdateTenantSettingsResponseContent update(UpdateTenantSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update settings for a tenant. + */ + public UpdateTenantSettingsResponseContent update( + UpdateTenantSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/TenantsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/TenantsClient.java new file mode 100644 index 000000000..489803a17 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/TenantsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class TenantsClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public TenantsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new SettingsClient(clientOptions)); + } + + public SettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java new file mode 100644 index 000000000..d4967a56a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetTenantSettingsRequestParameters.Builder.class) +public final class GetTenantSettingsRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetTenantSettingsRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetTenantSettingsRequestParameters + && equalTo((GetTenantSettingsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetTenantSettingsRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetTenantSettingsRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetTenantSettingsRequestParameters build() { + return new GetTenantSettingsRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java new file mode 100644 index 000000000..af4c04cfd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java @@ -0,0 +1,1369 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.DefaultTokenQuota; +import com.auth0.client.mgmt.types.SessionCookieSchema; +import com.auth0.client.mgmt.types.TenantOidcLogoutSettings; +import com.auth0.client.mgmt.types.TenantSettingsDeviceFlow; +import com.auth0.client.mgmt.types.TenantSettingsErrorPage; +import com.auth0.client.mgmt.types.TenantSettingsFlags; +import com.auth0.client.mgmt.types.TenantSettingsGuardianPage; +import com.auth0.client.mgmt.types.TenantSettingsMtls; +import com.auth0.client.mgmt.types.TenantSettingsPasswordPage; +import com.auth0.client.mgmt.types.TenantSettingsSessions; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateTenantSettingsRequestContent.Builder.class) +public final class UpdateTenantSettingsRequestContent { + private final OptionalNullable changePassword; + + private final OptionalNullable deviceFlow; + + private final OptionalNullable guardianMfaPage; + + private final Optional defaultAudience; + + private final Optional defaultDirectory; + + private final OptionalNullable errorPage; + + private final OptionalNullable defaultTokenQuota; + + private final Optional flags; + + private final Optional friendlyName; + + private final Optional pictureUrl; + + private final Optional supportEmail; + + private final Optional supportUrl; + + private final Optional> allowedLogoutUrls; + + private final Optional sessionLifetime; + + private final Optional idleSessionLifetime; + + private final Optional ephemeralSessionLifetime; + + private final Optional idleEphemeralSessionLifetime; + + private final Optional sandboxVersion; + + private final Optional legacySandboxVersion; + + private final Optional defaultRedirectionUri; + + private final Optional> enabledLocales; + + private final OptionalNullable sessionCookie; + + private final OptionalNullable sessions; + + private final Optional oidcLogout; + + private final OptionalNullable customizeMfaInPostloginAction; + + private final OptionalNullable allowOrganizationNameInAuthenticationApi; + + private final Optional> acrValuesSupported; + + private final OptionalNullable mtls; + + private final OptionalNullable pushedAuthorizationRequestsSupported; + + private final OptionalNullable authorizationResponseIssParameterSupported; + + private final Map additionalProperties; + + private UpdateTenantSettingsRequestContent( + OptionalNullable changePassword, + OptionalNullable deviceFlow, + OptionalNullable guardianMfaPage, + Optional defaultAudience, + Optional defaultDirectory, + OptionalNullable errorPage, + OptionalNullable defaultTokenQuota, + Optional flags, + Optional friendlyName, + Optional pictureUrl, + Optional supportEmail, + Optional supportUrl, + Optional> allowedLogoutUrls, + Optional sessionLifetime, + Optional idleSessionLifetime, + Optional ephemeralSessionLifetime, + Optional idleEphemeralSessionLifetime, + Optional sandboxVersion, + Optional legacySandboxVersion, + Optional defaultRedirectionUri, + Optional> enabledLocales, + OptionalNullable sessionCookie, + OptionalNullable sessions, + Optional oidcLogout, + OptionalNullable customizeMfaInPostloginAction, + OptionalNullable allowOrganizationNameInAuthenticationApi, + Optional> acrValuesSupported, + OptionalNullable mtls, + OptionalNullable pushedAuthorizationRequestsSupported, + OptionalNullable authorizationResponseIssParameterSupported, + Map additionalProperties) { + this.changePassword = changePassword; + this.deviceFlow = deviceFlow; + this.guardianMfaPage = guardianMfaPage; + this.defaultAudience = defaultAudience; + this.defaultDirectory = defaultDirectory; + this.errorPage = errorPage; + this.defaultTokenQuota = defaultTokenQuota; + this.flags = flags; + this.friendlyName = friendlyName; + this.pictureUrl = pictureUrl; + this.supportEmail = supportEmail; + this.supportUrl = supportUrl; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionLifetime = sessionLifetime; + this.idleSessionLifetime = idleSessionLifetime; + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + this.sandboxVersion = sandboxVersion; + this.legacySandboxVersion = legacySandboxVersion; + this.defaultRedirectionUri = defaultRedirectionUri; + this.enabledLocales = enabledLocales; + this.sessionCookie = sessionCookie; + this.sessions = sessions; + this.oidcLogout = oidcLogout; + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + this.acrValuesSupported = acrValuesSupported; + this.mtls = mtls; + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + public OptionalNullable getChangePassword() { + if (changePassword == null) { + return OptionalNullable.absent(); + } + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + public OptionalNullable getDeviceFlow() { + if (deviceFlow == null) { + return OptionalNullable.absent(); + } + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + public OptionalNullable getGuardianMfaPage() { + if (guardianMfaPage == null) { + return OptionalNullable.absent(); + } + return guardianMfaPage; + } + + /** + * @return Default audience for API Authorization. + */ + @JsonProperty("default_audience") + public Optional getDefaultAudience() { + return defaultAudience; + } + + /** + * @return Name of connection used for password grants at the /token endpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. + */ + @JsonProperty("default_directory") + public Optional getDefaultDirectory() { + return defaultDirectory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + public OptionalNullable getErrorPage() { + if (errorPage == null) { + return OptionalNullable.absent(); + } + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + public OptionalNullable getDefaultTokenQuota() { + if (defaultTokenQuota == null) { + return OptionalNullable.absent(); + } + return defaultTokenQuota; + } + + @JsonProperty("flags") + public Optional getFlags() { + return flags; + } + + /** + * @return Friendly name for this tenant. + */ + @JsonProperty("friendly_name") + public Optional getFriendlyName() { + return friendlyName; + } + + /** + * @return URL of logo to be shown for this tenant (recommended size: 150x150) + */ + @JsonProperty("picture_url") + public Optional getPictureUrl() { + return pictureUrl; + } + + /** + * @return End-user support email. + */ + @JsonProperty("support_email") + public Optional getSupportEmail() { + return supportEmail; + } + + /** + * @return End-user support url. + */ + @JsonProperty("support_url") + public Optional getSupportUrl() { + return supportUrl; + } + + /** + * @return URLs that are valid to redirect to after logout from Auth0. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + /** + * @return Number of hours a session will stay valid. + */ + @JsonProperty("session_lifetime") + public Optional getSessionLifetime() { + return sessionLifetime; + } + + /** + * @return Number of hours for which a session can be inactive before the user must log in again. + */ + @JsonProperty("idle_session_lifetime") + public Optional getIdleSessionLifetime() { + return idleSessionLifetime; + } + + /** + * @return Number of hours an ephemeral (non-persistent) session will stay valid. + */ + @JsonProperty("ephemeral_session_lifetime") + public Optional getEphemeralSessionLifetime() { + return ephemeralSessionLifetime; + } + + /** + * @return Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again. + */ + @JsonProperty("idle_ephemeral_session_lifetime") + public Optional getIdleEphemeralSessionLifetime() { + return idleEphemeralSessionLifetime; + } + + /** + * @return Selected sandbox version for the extensibility environment + */ + @JsonProperty("sandbox_version") + public Optional getSandboxVersion() { + return sandboxVersion; + } + + /** + * @return Selected legacy sandbox version for the extensibility environment + */ + @JsonProperty("legacy_sandbox_version") + public Optional getLegacySandboxVersion() { + return legacySandboxVersion; + } + + /** + * @return The default absolute redirection uri, must be https + */ + @JsonProperty("default_redirection_uri") + public Optional getDefaultRedirectionUri() { + return defaultRedirectionUri; + } + + /** + * @return Supported locales for the user interface + */ + @JsonProperty("enabled_locales") + public Optional> getEnabledLocales() { + return enabledLocales; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + public OptionalNullable getSessionCookie() { + if (sessionCookie == null) { + return OptionalNullable.absent(); + } + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + public OptionalNullable getSessions() { + if (sessions == null) { + return OptionalNullable.absent(); + } + return sessions; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return Whether to enable flexible factors for MFA in the PostLogin action + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("customize_mfa_in_postlogin_action") + public OptionalNullable getCustomizeMfaInPostloginAction() { + if (customizeMfaInPostloginAction == null) { + return OptionalNullable.absent(); + } + return customizeMfaInPostloginAction; + } + + /** + * @return Whether to accept an organization name instead of an ID on auth endpoints + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_organization_name_in_authentication_api") + public OptionalNullable getAllowOrganizationNameInAuthenticationApi() { + if (allowOrganizationNameInAuthenticationApi == null) { + return OptionalNullable.absent(); + } + return allowOrganizationNameInAuthenticationApi; + } + + /** + * @return Supported ACR values + */ + @JsonProperty("acr_values_supported") + public Optional> getAcrValuesSupported() { + return acrValuesSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + public OptionalNullable getMtls() { + if (mtls == null) { + return OptionalNullable.absent(); + } + return mtls; + } + + /** + * @return Enables the use of Pushed Authorization Requests + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pushed_authorization_requests_supported") + public OptionalNullable getPushedAuthorizationRequestsSupported() { + if (pushedAuthorizationRequestsSupported == null) { + return OptionalNullable.absent(); + } + return pushedAuthorizationRequestsSupported; + } + + /** + * @return Supports iss parameter in authorization responses + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + public OptionalNullable getAuthorizationResponseIssParameterSupported() { + if (authorizationResponseIssParameterSupported == null) { + return OptionalNullable.absent(); + } + return authorizationResponseIssParameterSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + private OptionalNullable _getChangePassword() { + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + private OptionalNullable _getDeviceFlow() { + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + private OptionalNullable _getGuardianMfaPage() { + return guardianMfaPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + private OptionalNullable _getErrorPage() { + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + private OptionalNullable _getDefaultTokenQuota() { + return defaultTokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + private OptionalNullable _getSessionCookie() { + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + private OptionalNullable _getSessions() { + return sessions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("customize_mfa_in_postlogin_action") + private OptionalNullable _getCustomizeMfaInPostloginAction() { + return customizeMfaInPostloginAction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_organization_name_in_authentication_api") + private OptionalNullable _getAllowOrganizationNameInAuthenticationApi() { + return allowOrganizationNameInAuthenticationApi; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + private OptionalNullable _getMtls() { + return mtls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pushed_authorization_requests_supported") + private OptionalNullable _getPushedAuthorizationRequestsSupported() { + return pushedAuthorizationRequestsSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + private OptionalNullable _getAuthorizationResponseIssParameterSupported() { + return authorizationResponseIssParameterSupported; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateTenantSettingsRequestContent + && equalTo((UpdateTenantSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateTenantSettingsRequestContent other) { + return changePassword.equals(other.changePassword) + && deviceFlow.equals(other.deviceFlow) + && guardianMfaPage.equals(other.guardianMfaPage) + && defaultAudience.equals(other.defaultAudience) + && defaultDirectory.equals(other.defaultDirectory) + && errorPage.equals(other.errorPage) + && defaultTokenQuota.equals(other.defaultTokenQuota) + && flags.equals(other.flags) + && friendlyName.equals(other.friendlyName) + && pictureUrl.equals(other.pictureUrl) + && supportEmail.equals(other.supportEmail) + && supportUrl.equals(other.supportUrl) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionLifetime.equals(other.sessionLifetime) + && idleSessionLifetime.equals(other.idleSessionLifetime) + && ephemeralSessionLifetime.equals(other.ephemeralSessionLifetime) + && idleEphemeralSessionLifetime.equals(other.idleEphemeralSessionLifetime) + && sandboxVersion.equals(other.sandboxVersion) + && legacySandboxVersion.equals(other.legacySandboxVersion) + && defaultRedirectionUri.equals(other.defaultRedirectionUri) + && enabledLocales.equals(other.enabledLocales) + && sessionCookie.equals(other.sessionCookie) + && sessions.equals(other.sessions) + && oidcLogout.equals(other.oidcLogout) + && customizeMfaInPostloginAction.equals(other.customizeMfaInPostloginAction) + && allowOrganizationNameInAuthenticationApi.equals(other.allowOrganizationNameInAuthenticationApi) + && acrValuesSupported.equals(other.acrValuesSupported) + && mtls.equals(other.mtls) + && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.changePassword, + this.deviceFlow, + this.guardianMfaPage, + this.defaultAudience, + this.defaultDirectory, + this.errorPage, + this.defaultTokenQuota, + this.flags, + this.friendlyName, + this.pictureUrl, + this.supportEmail, + this.supportUrl, + this.allowedLogoutUrls, + this.sessionLifetime, + this.idleSessionLifetime, + this.ephemeralSessionLifetime, + this.idleEphemeralSessionLifetime, + this.sandboxVersion, + this.legacySandboxVersion, + this.defaultRedirectionUri, + this.enabledLocales, + this.sessionCookie, + this.sessions, + this.oidcLogout, + this.customizeMfaInPostloginAction, + this.allowOrganizationNameInAuthenticationApi, + this.acrValuesSupported, + this.mtls, + this.pushedAuthorizationRequestsSupported, + this.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable changePassword = OptionalNullable.absent(); + + private OptionalNullable deviceFlow = OptionalNullable.absent(); + + private OptionalNullable guardianMfaPage = OptionalNullable.absent(); + + private Optional defaultAudience = Optional.empty(); + + private Optional defaultDirectory = Optional.empty(); + + private OptionalNullable errorPage = OptionalNullable.absent(); + + private OptionalNullable defaultTokenQuota = OptionalNullable.absent(); + + private Optional flags = Optional.empty(); + + private Optional friendlyName = Optional.empty(); + + private Optional pictureUrl = Optional.empty(); + + private Optional supportEmail = Optional.empty(); + + private Optional supportUrl = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private Optional sessionLifetime = Optional.empty(); + + private Optional idleSessionLifetime = Optional.empty(); + + private Optional ephemeralSessionLifetime = Optional.empty(); + + private Optional idleEphemeralSessionLifetime = Optional.empty(); + + private Optional sandboxVersion = Optional.empty(); + + private Optional legacySandboxVersion = Optional.empty(); + + private Optional defaultRedirectionUri = Optional.empty(); + + private Optional> enabledLocales = Optional.empty(); + + private OptionalNullable sessionCookie = OptionalNullable.absent(); + + private OptionalNullable sessions = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private OptionalNullable customizeMfaInPostloginAction = OptionalNullable.absent(); + + private OptionalNullable allowOrganizationNameInAuthenticationApi = OptionalNullable.absent(); + + private Optional> acrValuesSupported = Optional.empty(); + + private OptionalNullable mtls = OptionalNullable.absent(); + + private OptionalNullable pushedAuthorizationRequestsSupported = OptionalNullable.absent(); + + private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateTenantSettingsRequestContent other) { + changePassword(other.getChangePassword()); + deviceFlow(other.getDeviceFlow()); + guardianMfaPage(other.getGuardianMfaPage()); + defaultAudience(other.getDefaultAudience()); + defaultDirectory(other.getDefaultDirectory()); + errorPage(other.getErrorPage()); + defaultTokenQuota(other.getDefaultTokenQuota()); + flags(other.getFlags()); + friendlyName(other.getFriendlyName()); + pictureUrl(other.getPictureUrl()); + supportEmail(other.getSupportEmail()); + supportUrl(other.getSupportUrl()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionLifetime(other.getSessionLifetime()); + idleSessionLifetime(other.getIdleSessionLifetime()); + ephemeralSessionLifetime(other.getEphemeralSessionLifetime()); + idleEphemeralSessionLifetime(other.getIdleEphemeralSessionLifetime()); + sandboxVersion(other.getSandboxVersion()); + legacySandboxVersion(other.getLegacySandboxVersion()); + defaultRedirectionUri(other.getDefaultRedirectionUri()); + enabledLocales(other.getEnabledLocales()); + sessionCookie(other.getSessionCookie()); + sessions(other.getSessions()); + oidcLogout(other.getOidcLogout()); + customizeMfaInPostloginAction(other.getCustomizeMfaInPostloginAction()); + allowOrganizationNameInAuthenticationApi(other.getAllowOrganizationNameInAuthenticationApi()); + acrValuesSupported(other.getAcrValuesSupported()); + mtls(other.getMtls()); + pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); + authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + return this; + } + + @JsonSetter(value = "change_password", nulls = Nulls.SKIP) + public Builder changePassword(@Nullable OptionalNullable changePassword) { + this.changePassword = changePassword; + return this; + } + + public Builder changePassword(TenantSettingsPasswordPage changePassword) { + this.changePassword = OptionalNullable.of(changePassword); + return this; + } + + public Builder changePassword(Optional changePassword) { + if (changePassword.isPresent()) { + this.changePassword = OptionalNullable.of(changePassword.get()); + } else { + this.changePassword = OptionalNullable.absent(); + } + return this; + } + + public Builder changePassword(com.auth0.client.mgmt.core.Nullable changePassword) { + if (changePassword.isNull()) { + this.changePassword = OptionalNullable.ofNull(); + } else if (changePassword.isEmpty()) { + this.changePassword = OptionalNullable.absent(); + } else { + this.changePassword = OptionalNullable.of(changePassword.get()); + } + return this; + } + + @JsonSetter(value = "device_flow", nulls = Nulls.SKIP) + public Builder deviceFlow(@Nullable OptionalNullable deviceFlow) { + this.deviceFlow = deviceFlow; + return this; + } + + public Builder deviceFlow(TenantSettingsDeviceFlow deviceFlow) { + this.deviceFlow = OptionalNullable.of(deviceFlow); + return this; + } + + public Builder deviceFlow(Optional deviceFlow) { + if (deviceFlow.isPresent()) { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } else { + this.deviceFlow = OptionalNullable.absent(); + } + return this; + } + + public Builder deviceFlow(com.auth0.client.mgmt.core.Nullable deviceFlow) { + if (deviceFlow.isNull()) { + this.deviceFlow = OptionalNullable.ofNull(); + } else if (deviceFlow.isEmpty()) { + this.deviceFlow = OptionalNullable.absent(); + } else { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } + return this; + } + + @JsonSetter(value = "guardian_mfa_page", nulls = Nulls.SKIP) + public Builder guardianMfaPage(@Nullable OptionalNullable guardianMfaPage) { + this.guardianMfaPage = guardianMfaPage; + return this; + } + + public Builder guardianMfaPage(TenantSettingsGuardianPage guardianMfaPage) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage); + return this; + } + + public Builder guardianMfaPage(Optional guardianMfaPage) { + if (guardianMfaPage.isPresent()) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } else { + this.guardianMfaPage = OptionalNullable.absent(); + } + return this; + } + + public Builder guardianMfaPage( + com.auth0.client.mgmt.core.Nullable guardianMfaPage) { + if (guardianMfaPage.isNull()) { + this.guardianMfaPage = OptionalNullable.ofNull(); + } else if (guardianMfaPage.isEmpty()) { + this.guardianMfaPage = OptionalNullable.absent(); + } else { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } + return this; + } + + /** + *

Default audience for API Authorization.

+ */ + @JsonSetter(value = "default_audience", nulls = Nulls.SKIP) + public Builder defaultAudience(Optional defaultAudience) { + this.defaultAudience = defaultAudience; + return this; + } + + public Builder defaultAudience(String defaultAudience) { + this.defaultAudience = Optional.ofNullable(defaultAudience); + return this; + } + + /** + *

Name of connection used for password grants at the /token endpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS.

+ */ + @JsonSetter(value = "default_directory", nulls = Nulls.SKIP) + public Builder defaultDirectory(Optional defaultDirectory) { + this.defaultDirectory = defaultDirectory; + return this; + } + + public Builder defaultDirectory(String defaultDirectory) { + this.defaultDirectory = Optional.ofNullable(defaultDirectory); + return this; + } + + @JsonSetter(value = "error_page", nulls = Nulls.SKIP) + public Builder errorPage(@Nullable OptionalNullable errorPage) { + this.errorPage = errorPage; + return this; + } + + public Builder errorPage(TenantSettingsErrorPage errorPage) { + this.errorPage = OptionalNullable.of(errorPage); + return this; + } + + public Builder errorPage(Optional errorPage) { + if (errorPage.isPresent()) { + this.errorPage = OptionalNullable.of(errorPage.get()); + } else { + this.errorPage = OptionalNullable.absent(); + } + return this; + } + + public Builder errorPage(com.auth0.client.mgmt.core.Nullable errorPage) { + if (errorPage.isNull()) { + this.errorPage = OptionalNullable.ofNull(); + } else if (errorPage.isEmpty()) { + this.errorPage = OptionalNullable.absent(); + } else { + this.errorPage = OptionalNullable.of(errorPage.get()); + } + return this; + } + + @JsonSetter(value = "default_token_quota", nulls = Nulls.SKIP) + public Builder defaultTokenQuota(@Nullable OptionalNullable defaultTokenQuota) { + this.defaultTokenQuota = defaultTokenQuota; + return this; + } + + public Builder defaultTokenQuota(DefaultTokenQuota defaultTokenQuota) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota); + return this; + } + + public Builder defaultTokenQuota(Optional defaultTokenQuota) { + if (defaultTokenQuota.isPresent()) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } else { + this.defaultTokenQuota = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultTokenQuota(com.auth0.client.mgmt.core.Nullable defaultTokenQuota) { + if (defaultTokenQuota.isNull()) { + this.defaultTokenQuota = OptionalNullable.ofNull(); + } else if (defaultTokenQuota.isEmpty()) { + this.defaultTokenQuota = OptionalNullable.absent(); + } else { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } + return this; + } + + @JsonSetter(value = "flags", nulls = Nulls.SKIP) + public Builder flags(Optional flags) { + this.flags = flags; + return this; + } + + public Builder flags(TenantSettingsFlags flags) { + this.flags = Optional.ofNullable(flags); + return this; + } + + /** + *

Friendly name for this tenant.

+ */ + @JsonSetter(value = "friendly_name", nulls = Nulls.SKIP) + public Builder friendlyName(Optional friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + public Builder friendlyName(String friendlyName) { + this.friendlyName = Optional.ofNullable(friendlyName); + return this; + } + + /** + *

URL of logo to be shown for this tenant (recommended size: 150x150)

+ */ + @JsonSetter(value = "picture_url", nulls = Nulls.SKIP) + public Builder pictureUrl(Optional pictureUrl) { + this.pictureUrl = pictureUrl; + return this; + } + + public Builder pictureUrl(String pictureUrl) { + this.pictureUrl = Optional.ofNullable(pictureUrl); + return this; + } + + /** + *

End-user support email.

+ */ + @JsonSetter(value = "support_email", nulls = Nulls.SKIP) + public Builder supportEmail(Optional supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + public Builder supportEmail(String supportEmail) { + this.supportEmail = Optional.ofNullable(supportEmail); + return this; + } + + /** + *

End-user support url.

+ */ + @JsonSetter(value = "support_url", nulls = Nulls.SKIP) + public Builder supportUrl(Optional supportUrl) { + this.supportUrl = supportUrl; + return this; + } + + public Builder supportUrl(String supportUrl) { + this.supportUrl = Optional.ofNullable(supportUrl); + return this; + } + + /** + *

URLs that are valid to redirect to after logout from Auth0.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + /** + *

Number of hours a session will stay valid.

+ */ + @JsonSetter(value = "session_lifetime", nulls = Nulls.SKIP) + public Builder sessionLifetime(Optional sessionLifetime) { + this.sessionLifetime = sessionLifetime; + return this; + } + + public Builder sessionLifetime(Integer sessionLifetime) { + this.sessionLifetime = Optional.ofNullable(sessionLifetime); + return this; + } + + /** + *

Number of hours for which a session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_session_lifetime", nulls = Nulls.SKIP) + public Builder idleSessionLifetime(Optional idleSessionLifetime) { + this.idleSessionLifetime = idleSessionLifetime; + return this; + } + + public Builder idleSessionLifetime(Integer idleSessionLifetime) { + this.idleSessionLifetime = Optional.ofNullable(idleSessionLifetime); + return this; + } + + /** + *

Number of hours an ephemeral (non-persistent) session will stay valid.

+ */ + @JsonSetter(value = "ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder ephemeralSessionLifetime(Optional ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + return this; + } + + public Builder ephemeralSessionLifetime(Integer ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = Optional.ofNullable(ephemeralSessionLifetime); + return this; + } + + /** + *

Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder idleEphemeralSessionLifetime(Optional idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + return this; + } + + public Builder idleEphemeralSessionLifetime(Integer idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = Optional.ofNullable(idleEphemeralSessionLifetime); + return this; + } + + /** + *

Selected sandbox version for the extensibility environment

+ */ + @JsonSetter(value = "sandbox_version", nulls = Nulls.SKIP) + public Builder sandboxVersion(Optional sandboxVersion) { + this.sandboxVersion = sandboxVersion; + return this; + } + + public Builder sandboxVersion(String sandboxVersion) { + this.sandboxVersion = Optional.ofNullable(sandboxVersion); + return this; + } + + /** + *

Selected legacy sandbox version for the extensibility environment

+ */ + @JsonSetter(value = "legacy_sandbox_version", nulls = Nulls.SKIP) + public Builder legacySandboxVersion(Optional legacySandboxVersion) { + this.legacySandboxVersion = legacySandboxVersion; + return this; + } + + public Builder legacySandboxVersion(String legacySandboxVersion) { + this.legacySandboxVersion = Optional.ofNullable(legacySandboxVersion); + return this; + } + + /** + *

The default absolute redirection uri, must be https

+ */ + @JsonSetter(value = "default_redirection_uri", nulls = Nulls.SKIP) + public Builder defaultRedirectionUri(Optional defaultRedirectionUri) { + this.defaultRedirectionUri = defaultRedirectionUri; + return this; + } + + public Builder defaultRedirectionUri(String defaultRedirectionUri) { + this.defaultRedirectionUri = Optional.ofNullable(defaultRedirectionUri); + return this; + } + + /** + *

Supported locales for the user interface

+ */ + @JsonSetter(value = "enabled_locales", nulls = Nulls.SKIP) + public Builder enabledLocales( + Optional> enabledLocales) { + this.enabledLocales = enabledLocales; + return this; + } + + public Builder enabledLocales(List enabledLocales) { + this.enabledLocales = Optional.ofNullable(enabledLocales); + return this; + } + + @JsonSetter(value = "session_cookie", nulls = Nulls.SKIP) + public Builder sessionCookie(@Nullable OptionalNullable sessionCookie) { + this.sessionCookie = sessionCookie; + return this; + } + + public Builder sessionCookie(SessionCookieSchema sessionCookie) { + this.sessionCookie = OptionalNullable.of(sessionCookie); + return this; + } + + public Builder sessionCookie(Optional sessionCookie) { + if (sessionCookie.isPresent()) { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } else { + this.sessionCookie = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionCookie(com.auth0.client.mgmt.core.Nullable sessionCookie) { + if (sessionCookie.isNull()) { + this.sessionCookie = OptionalNullable.ofNull(); + } else if (sessionCookie.isEmpty()) { + this.sessionCookie = OptionalNullable.absent(); + } else { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } + return this; + } + + @JsonSetter(value = "sessions", nulls = Nulls.SKIP) + public Builder sessions(@Nullable OptionalNullable sessions) { + this.sessions = sessions; + return this; + } + + public Builder sessions(TenantSettingsSessions sessions) { + this.sessions = OptionalNullable.of(sessions); + return this; + } + + public Builder sessions(Optional sessions) { + if (sessions.isPresent()) { + this.sessions = OptionalNullable.of(sessions.get()); + } else { + this.sessions = OptionalNullable.absent(); + } + return this; + } + + public Builder sessions(com.auth0.client.mgmt.core.Nullable sessions) { + if (sessions.isNull()) { + this.sessions = OptionalNullable.ofNull(); + } else if (sessions.isEmpty()) { + this.sessions = OptionalNullable.absent(); + } else { + this.sessions = OptionalNullable.of(sessions.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(TenantOidcLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

Whether to enable flexible factors for MFA in the PostLogin action

+ */ + @JsonSetter(value = "customize_mfa_in_postlogin_action", nulls = Nulls.SKIP) + public Builder customizeMfaInPostloginAction( + @Nullable OptionalNullable customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + return this; + } + + public Builder customizeMfaInPostloginAction(Boolean customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = OptionalNullable.of(customizeMfaInPostloginAction); + return this; + } + + public Builder customizeMfaInPostloginAction(Optional customizeMfaInPostloginAction) { + if (customizeMfaInPostloginAction.isPresent()) { + this.customizeMfaInPostloginAction = OptionalNullable.of(customizeMfaInPostloginAction.get()); + } else { + this.customizeMfaInPostloginAction = OptionalNullable.absent(); + } + return this; + } + + public Builder customizeMfaInPostloginAction( + com.auth0.client.mgmt.core.Nullable customizeMfaInPostloginAction) { + if (customizeMfaInPostloginAction.isNull()) { + this.customizeMfaInPostloginAction = OptionalNullable.ofNull(); + } else if (customizeMfaInPostloginAction.isEmpty()) { + this.customizeMfaInPostloginAction = OptionalNullable.absent(); + } else { + this.customizeMfaInPostloginAction = OptionalNullable.of(customizeMfaInPostloginAction.get()); + } + return this; + } + + /** + *

Whether to accept an organization name instead of an ID on auth endpoints

+ */ + @JsonSetter(value = "allow_organization_name_in_authentication_api", nulls = Nulls.SKIP) + public Builder allowOrganizationNameInAuthenticationApi( + @Nullable OptionalNullable allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + return this; + } + + public Builder allowOrganizationNameInAuthenticationApi(Boolean allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = + OptionalNullable.of(allowOrganizationNameInAuthenticationApi); + return this; + } + + public Builder allowOrganizationNameInAuthenticationApi( + Optional allowOrganizationNameInAuthenticationApi) { + if (allowOrganizationNameInAuthenticationApi.isPresent()) { + this.allowOrganizationNameInAuthenticationApi = + OptionalNullable.of(allowOrganizationNameInAuthenticationApi.get()); + } else { + this.allowOrganizationNameInAuthenticationApi = OptionalNullable.absent(); + } + return this; + } + + public Builder allowOrganizationNameInAuthenticationApi( + com.auth0.client.mgmt.core.Nullable allowOrganizationNameInAuthenticationApi) { + if (allowOrganizationNameInAuthenticationApi.isNull()) { + this.allowOrganizationNameInAuthenticationApi = OptionalNullable.ofNull(); + } else if (allowOrganizationNameInAuthenticationApi.isEmpty()) { + this.allowOrganizationNameInAuthenticationApi = OptionalNullable.absent(); + } else { + this.allowOrganizationNameInAuthenticationApi = + OptionalNullable.of(allowOrganizationNameInAuthenticationApi.get()); + } + return this; + } + + /** + *

Supported ACR values

+ */ + @JsonSetter(value = "acr_values_supported", nulls = Nulls.SKIP) + public Builder acrValuesSupported(Optional> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + return this; + } + + public Builder acrValuesSupported(List acrValuesSupported) { + this.acrValuesSupported = Optional.ofNullable(acrValuesSupported); + return this; + } + + @JsonSetter(value = "mtls", nulls = Nulls.SKIP) + public Builder mtls(@Nullable OptionalNullable mtls) { + this.mtls = mtls; + return this; + } + + public Builder mtls(TenantSettingsMtls mtls) { + this.mtls = OptionalNullable.of(mtls); + return this; + } + + public Builder mtls(Optional mtls) { + if (mtls.isPresent()) { + this.mtls = OptionalNullable.of(mtls.get()); + } else { + this.mtls = OptionalNullable.absent(); + } + return this; + } + + public Builder mtls(com.auth0.client.mgmt.core.Nullable mtls) { + if (mtls.isNull()) { + this.mtls = OptionalNullable.ofNull(); + } else if (mtls.isEmpty()) { + this.mtls = OptionalNullable.absent(); + } else { + this.mtls = OptionalNullable.of(mtls.get()); + } + return this; + } + + /** + *

Enables the use of Pushed Authorization Requests

+ */ + @JsonSetter(value = "pushed_authorization_requests_supported", nulls = Nulls.SKIP) + public Builder pushedAuthorizationRequestsSupported( + @Nullable OptionalNullable pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + return this; + } + + public Builder pushedAuthorizationRequestsSupported(Boolean pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = OptionalNullable.of(pushedAuthorizationRequestsSupported); + return this; + } + + public Builder pushedAuthorizationRequestsSupported(Optional pushedAuthorizationRequestsSupported) { + if (pushedAuthorizationRequestsSupported.isPresent()) { + this.pushedAuthorizationRequestsSupported = + OptionalNullable.of(pushedAuthorizationRequestsSupported.get()); + } else { + this.pushedAuthorizationRequestsSupported = OptionalNullable.absent(); + } + return this; + } + + public Builder pushedAuthorizationRequestsSupported( + com.auth0.client.mgmt.core.Nullable pushedAuthorizationRequestsSupported) { + if (pushedAuthorizationRequestsSupported.isNull()) { + this.pushedAuthorizationRequestsSupported = OptionalNullable.ofNull(); + } else if (pushedAuthorizationRequestsSupported.isEmpty()) { + this.pushedAuthorizationRequestsSupported = OptionalNullable.absent(); + } else { + this.pushedAuthorizationRequestsSupported = + OptionalNullable.of(pushedAuthorizationRequestsSupported.get()); + } + return this; + } + + /** + *

Supports iss parameter in authorization responses

+ */ + @JsonSetter(value = "authorization_response_iss_parameter_supported", nulls = Nulls.SKIP) + public Builder authorizationResponseIssParameterSupported( + @Nullable OptionalNullable authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + return this; + } + + public Builder authorizationResponseIssParameterSupported(Boolean authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported); + return this; + } + + public Builder authorizationResponseIssParameterSupported( + Optional authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isPresent()) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } else { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } + return this; + } + + public Builder authorizationResponseIssParameterSupported( + com.auth0.client.mgmt.core.Nullable authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isNull()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.ofNull(); + } else if (authorizationResponseIssParameterSupported.isEmpty()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } else { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } + return this; + } + + public UpdateTenantSettingsRequestContent build() { + return new UpdateTenantSettingsRequestContent( + changePassword, + deviceFlow, + guardianMfaPage, + defaultAudience, + defaultDirectory, + errorPage, + defaultTokenQuota, + flags, + friendlyName, + pictureUrl, + supportEmail, + supportUrl, + allowedLogoutUrls, + sessionLifetime, + idleSessionLifetime, + ephemeralSessionLifetime, + idleEphemeralSessionLifetime, + sandboxVersion, + legacySandboxVersion, + defaultRedirectionUri, + enabledLocales, + sessionCookie, + sessions, + oidcLogout, + customizeMfaInPostloginAction, + allowOrganizationNameInAuthenticationApi, + acrValuesSupported, + mtls, + pushedAuthorizationRequestsSupported, + authorizationResponseIssParameterSupported, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java new file mode 100644 index 000000000..e224ebbda --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java @@ -0,0 +1,955 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.tenants.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateTenantSettingsRequestContentEnabledLocalesItem { + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem AZ = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.AZ, "az"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem MK = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.MK, "mk"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem CA_ES = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.CA_ES, "ca-ES"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ML = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ML, "ml"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem TR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.TR, "tr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem GU = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.GU, "gu"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ES_AR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ES_AR, "es-AR"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ID = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ID, "id"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem CNR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.CNR, "cnr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem MN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.MN, "mn"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem FI = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.FI, "fi"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem PL = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.PL, "pl"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem EN_CA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.EN_CA, "en-CA"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem AR_EG = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.AR_EG, "ar-EG"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem MR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.MR, "mr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem MS = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.MS, "ms"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem PT_PT = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.PT_PT, "pt-PT"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SK = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SK, "sk"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SL = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SL, "sl"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem CS = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.CS, "cs"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem UR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.UR, "ur"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem HU = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.HU, "hu"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem TE = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.TE, "te"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ZH_CN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ZH_CN, "zh-CN"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem AR_SA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.AR_SA, "ar-SA"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SO = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SO, "so"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem FR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.FR, "fr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem NO = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.NO, "no"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ZH_TW = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ZH_TW, "zh-TW"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem AR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.AR, "ar"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem PT = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.PT, "pt"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem MY = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.MY, "my"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SQ = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SQ, "sq"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem HY = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.HY, "hy"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem FR_FR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.FR_FR, "fr-FR"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem CY = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.CY, "cy"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem PA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.PA, "pa"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem KA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.KA, "ka"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem IS = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.IS, "is"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem FA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.FA, "fa"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem BN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.BN, "bn"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem PT_BR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.PT_BR, "pt-BR"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SW = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SW, "sw"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem HI = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.HI, "hi"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem EN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.EN, "en"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem NB = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.NB, "nb"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem DA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.DA, "da"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem LT = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.LT, "lt"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem BS = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.BS, "bs"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ES_MX = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ES_MX, "es-MX"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem LV = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.LV, "lv"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem RO = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.RO, "ro"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem UK = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.UK, "uk"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem DE = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.DE, "de"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ES = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ES, "es"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem KK = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.KK, "kk"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ET = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ET, "et"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem TA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.TA, "ta"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem HR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.HR, "hr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem KN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.KN, "kn"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ZGH = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ZGH, "zgh"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem AM = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.AM, "am"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem JA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.JA, "ja"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem KO = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.KO, "ko"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem RU = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.RU, "ru"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem NL = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.NL, "nl"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem VI = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.VI, "vi"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem BG = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.BG, "bg"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem NN = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.NN, "nn"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem GL_ES = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.GL_ES, "gl-ES"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem TH = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.TH, "th"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SR = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SR, "sr"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ES419 = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ES419, "es-419"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem HE = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.HE, "he"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem ZH_HK = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.ZH_HK, "zh-HK"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem EU_ES = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.EU_ES, "eu-ES"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem TL = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.TL, "tl"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem IT = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.IT, "it"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem SV = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.SV, "sv"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem FR_CA = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.FR_CA, "fr-CA"); + + public static final UpdateTenantSettingsRequestContentEnabledLocalesItem EL = + new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.EL, "el"); + + private final Value value; + + private final String string; + + UpdateTenantSettingsRequestContentEnabledLocalesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateTenantSettingsRequestContentEnabledLocalesItem + && this.string.equals(((UpdateTenantSettingsRequestContentEnabledLocalesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AZ: + return visitor.visitAz(); + case MK: + return visitor.visitMk(); + case CA_ES: + return visitor.visitCaEs(); + case ML: + return visitor.visitMl(); + case TR: + return visitor.visitTr(); + case GU: + return visitor.visitGu(); + case ES_AR: + return visitor.visitEsAr(); + case ID: + return visitor.visitId(); + case CNR: + return visitor.visitCnr(); + case MN: + return visitor.visitMn(); + case FI: + return visitor.visitFi(); + case PL: + return visitor.visitPl(); + case EN_CA: + return visitor.visitEnCa(); + case AR_EG: + return visitor.visitArEg(); + case MR: + return visitor.visitMr(); + case MS: + return visitor.visitMs(); + case PT_PT: + return visitor.visitPtPt(); + case SK: + return visitor.visitSk(); + case SL: + return visitor.visitSl(); + case CS: + return visitor.visitCs(); + case UR: + return visitor.visitUr(); + case HU: + return visitor.visitHu(); + case TE: + return visitor.visitTe(); + case ZH_CN: + return visitor.visitZhCn(); + case AR_SA: + return visitor.visitArSa(); + case SO: + return visitor.visitSo(); + case FR: + return visitor.visitFr(); + case NO: + return visitor.visitNo(); + case ZH_TW: + return visitor.visitZhTw(); + case AR: + return visitor.visitAr(); + case PT: + return visitor.visitPt(); + case MY: + return visitor.visitMy(); + case SQ: + return visitor.visitSq(); + case HY: + return visitor.visitHy(); + case FR_FR: + return visitor.visitFrFr(); + case CY: + return visitor.visitCy(); + case PA: + return visitor.visitPa(); + case KA: + return visitor.visitKa(); + case IS: + return visitor.visitIs(); + case FA: + return visitor.visitFa(); + case BN: + return visitor.visitBn(); + case PT_BR: + return visitor.visitPtBr(); + case SW: + return visitor.visitSw(); + case HI: + return visitor.visitHi(); + case EN: + return visitor.visitEn(); + case NB: + return visitor.visitNb(); + case DA: + return visitor.visitDa(); + case LT: + return visitor.visitLt(); + case BS: + return visitor.visitBs(); + case ES_MX: + return visitor.visitEsMx(); + case LV: + return visitor.visitLv(); + case RO: + return visitor.visitRo(); + case UK: + return visitor.visitUk(); + case DE: + return visitor.visitDe(); + case ES: + return visitor.visitEs(); + case KK: + return visitor.visitKk(); + case ET: + return visitor.visitEt(); + case TA: + return visitor.visitTa(); + case HR: + return visitor.visitHr(); + case KN: + return visitor.visitKn(); + case ZGH: + return visitor.visitZgh(); + case AM: + return visitor.visitAm(); + case JA: + return visitor.visitJa(); + case KO: + return visitor.visitKo(); + case RU: + return visitor.visitRu(); + case NL: + return visitor.visitNl(); + case VI: + return visitor.visitVi(); + case BG: + return visitor.visitBg(); + case NN: + return visitor.visitNn(); + case GL_ES: + return visitor.visitGlEs(); + case TH: + return visitor.visitTh(); + case SR: + return visitor.visitSr(); + case ES419: + return visitor.visitEs419(); + case HE: + return visitor.visitHe(); + case ZH_HK: + return visitor.visitZhHk(); + case EU_ES: + return visitor.visitEuEs(); + case TL: + return visitor.visitTl(); + case IT: + return visitor.visitIt(); + case SV: + return visitor.visitSv(); + case FR_CA: + return visitor.visitFrCa(); + case EL: + return visitor.visitEl(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateTenantSettingsRequestContentEnabledLocalesItem valueOf(String value) { + switch (value) { + case "az": + return AZ; + case "mk": + return MK; + case "ca-ES": + return CA_ES; + case "ml": + return ML; + case "tr": + return TR; + case "gu": + return GU; + case "es-AR": + return ES_AR; + case "id": + return ID; + case "cnr": + return CNR; + case "mn": + return MN; + case "fi": + return FI; + case "pl": + return PL; + case "en-CA": + return EN_CA; + case "ar-EG": + return AR_EG; + case "mr": + return MR; + case "ms": + return MS; + case "pt-PT": + return PT_PT; + case "sk": + return SK; + case "sl": + return SL; + case "cs": + return CS; + case "ur": + return UR; + case "hu": + return HU; + case "te": + return TE; + case "zh-CN": + return ZH_CN; + case "ar-SA": + return AR_SA; + case "so": + return SO; + case "fr": + return FR; + case "no": + return NO; + case "zh-TW": + return ZH_TW; + case "ar": + return AR; + case "pt": + return PT; + case "my": + return MY; + case "sq": + return SQ; + case "hy": + return HY; + case "fr-FR": + return FR_FR; + case "cy": + return CY; + case "pa": + return PA; + case "ka": + return KA; + case "is": + return IS; + case "fa": + return FA; + case "bn": + return BN; + case "pt-BR": + return PT_BR; + case "sw": + return SW; + case "hi": + return HI; + case "en": + return EN; + case "nb": + return NB; + case "da": + return DA; + case "lt": + return LT; + case "bs": + return BS; + case "es-MX": + return ES_MX; + case "lv": + return LV; + case "ro": + return RO; + case "uk": + return UK; + case "de": + return DE; + case "es": + return ES; + case "kk": + return KK; + case "et": + return ET; + case "ta": + return TA; + case "hr": + return HR; + case "kn": + return KN; + case "zgh": + return ZGH; + case "am": + return AM; + case "ja": + return JA; + case "ko": + return KO; + case "ru": + return RU; + case "nl": + return NL; + case "vi": + return VI; + case "bg": + return BG; + case "nn": + return NN; + case "gl-ES": + return GL_ES; + case "th": + return TH; + case "sr": + return SR; + case "es-419": + return ES419; + case "he": + return HE; + case "zh-HK": + return ZH_HK; + case "eu-ES": + return EU_ES; + case "tl": + return TL; + case "it": + return IT; + case "sv": + return SV; + case "fr-CA": + return FR_CA; + case "el": + return EL; + default: + return new UpdateTenantSettingsRequestContentEnabledLocalesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + AM, + + AR, + + AR_EG, + + AR_SA, + + AZ, + + BG, + + BN, + + BS, + + CA_ES, + + CNR, + + CS, + + CY, + + DA, + + DE, + + EL, + + EN, + + EN_CA, + + ES, + + ES419, + + ES_AR, + + ES_MX, + + ET, + + EU_ES, + + FA, + + FI, + + FR, + + FR_CA, + + FR_FR, + + GL_ES, + + GU, + + HE, + + HI, + + HR, + + HU, + + HY, + + ID, + + IS, + + IT, + + JA, + + KA, + + KK, + + KN, + + KO, + + LT, + + LV, + + MK, + + ML, + + MN, + + MR, + + MS, + + MY, + + NB, + + NL, + + NN, + + NO, + + PA, + + PL, + + PT, + + PT_BR, + + PT_PT, + + RO, + + RU, + + SK, + + SL, + + SO, + + SQ, + + SR, + + SV, + + SW, + + TA, + + TE, + + TH, + + TL, + + TR, + + UK, + + UR, + + VI, + + ZGH, + + ZH_CN, + + ZH_HK, + + ZH_TW, + + UNKNOWN + } + + public interface Visitor { + T visitAm(); + + T visitAr(); + + T visitArEg(); + + T visitArSa(); + + T visitAz(); + + T visitBg(); + + T visitBn(); + + T visitBs(); + + T visitCaEs(); + + T visitCnr(); + + T visitCs(); + + T visitCy(); + + T visitDa(); + + T visitDe(); + + T visitEl(); + + T visitEn(); + + T visitEnCa(); + + T visitEs(); + + T visitEs419(); + + T visitEsAr(); + + T visitEsMx(); + + T visitEt(); + + T visitEuEs(); + + T visitFa(); + + T visitFi(); + + T visitFr(); + + T visitFrCa(); + + T visitFrFr(); + + T visitGlEs(); + + T visitGu(); + + T visitHe(); + + T visitHi(); + + T visitHr(); + + T visitHu(); + + T visitHy(); + + T visitId(); + + T visitIs(); + + T visitIt(); + + T visitJa(); + + T visitKa(); + + T visitKk(); + + T visitKn(); + + T visitKo(); + + T visitLt(); + + T visitLv(); + + T visitMk(); + + T visitMl(); + + T visitMn(); + + T visitMr(); + + T visitMs(); + + T visitMy(); + + T visitNb(); + + T visitNl(); + + T visitNn(); + + T visitNo(); + + T visitPa(); + + T visitPl(); + + T visitPt(); + + T visitPtBr(); + + T visitPtPt(); + + T visitRo(); + + T visitRu(); + + T visitSk(); + + T visitSl(); + + T visitSo(); + + T visitSq(); + + T visitSr(); + + T visitSv(); + + T visitSw(); + + T visitTa(); + + T visitTe(); + + T visitTh(); + + T visitTl(); + + T visitTr(); + + T visitUk(); + + T visitUr(); + + T visitVi(); + + T visitZgh(); + + T visitZhCn(); + + T visitZhHk(); + + T visitZhTw(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Action.java b/src/main/java/com/auth0/client/mgmt/types/Action.java new file mode 100644 index 000000000..139750fcd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Action.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Action.Builder.class) +public final class Action { + private final Optional id; + + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional allChangesDeployed; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional deployedVersion; + + private final Optional installedIntegrationId; + + private final Optional integration; + + private final Optional status; + + private final Optional builtAt; + + private final Optional deploy; + + private final Map additionalProperties; + + private Action( + Optional id, + Optional name, + Optional> supportedTriggers, + Optional allChangesDeployed, + Optional createdAt, + Optional updatedAt, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Optional deployedVersion, + Optional installedIntegrationId, + Optional integration, + Optional status, + Optional builtAt, + Optional deploy, + Map additionalProperties) { + this.id = id; + this.name = name; + this.supportedTriggers = supportedTriggers; + this.allChangesDeployed = allChangesDeployed; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.deployedVersion = deployedVersion; + this.installedIntegrationId = installedIntegrationId; + this.integration = integration; + this.status = status; + this.builtAt = builtAt; + this.deploy = deploy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the action. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return True if all of an Action's contents have been deployed. + */ + @JsonProperty("all_changes_deployed") + public Optional getAllChangesDeployed() { + return allChangesDeployed; + } + + /** + * @return The time when this action was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this action was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("deployed_version") + public Optional getDeployedVersion() { + return deployedVersion; + } + + /** + * @return installed_integration_id is the fk reference to the InstalledIntegration entity. + */ + @JsonProperty("installed_integration_id") + public Optional getInstalledIntegrationId() { + return installedIntegrationId; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The time when this action was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return True if the action should be deployed after creation. + */ + @JsonProperty("deploy") + public Optional getDeploy() { + return deploy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Action && equalTo((Action) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Action other) { + return id.equals(other.id) + && name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && allChangesDeployed.equals(other.allChangesDeployed) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && deployedVersion.equals(other.deployedVersion) + && installedIntegrationId.equals(other.installedIntegrationId) + && integration.equals(other.integration) + && status.equals(other.status) + && builtAt.equals(other.builtAt) + && deploy.equals(other.deploy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.supportedTriggers, + this.allChangesDeployed, + this.createdAt, + this.updatedAt, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.deployedVersion, + this.installedIntegrationId, + this.integration, + this.status, + this.builtAt, + this.deploy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional allChangesDeployed = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional deployedVersion = Optional.empty(); + + private Optional installedIntegrationId = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional deploy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Action other) { + id(other.getId()); + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + allChangesDeployed(other.getAllChangesDeployed()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + deployedVersion(other.getDeployedVersion()); + installedIntegrationId(other.getInstalledIntegrationId()); + integration(other.getIntegration()); + status(other.getStatus()); + builtAt(other.getBuiltAt()); + deploy(other.getDeploy()); + return this; + } + + /** + *

The unique ID of the action.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

True if all of an Action's contents have been deployed.

+ */ + @JsonSetter(value = "all_changes_deployed", nulls = Nulls.SKIP) + public Builder allChangesDeployed(Optional allChangesDeployed) { + this.allChangesDeployed = allChangesDeployed; + return this; + } + + public Builder allChangesDeployed(Boolean allChangesDeployed) { + this.allChangesDeployed = Optional.ofNullable(allChangesDeployed); + return this; + } + + /** + *

The time when this action was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this action was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The source code of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "deployed_version", nulls = Nulls.SKIP) + public Builder deployedVersion(Optional deployedVersion) { + this.deployedVersion = deployedVersion; + return this; + } + + public Builder deployedVersion(ActionDeployedVersion deployedVersion) { + this.deployedVersion = Optional.ofNullable(deployedVersion); + return this; + } + + /** + *

installed_integration_id is the fk reference to the InstalledIntegration entity.

+ */ + @JsonSetter(value = "installed_integration_id", nulls = Nulls.SKIP) + public Builder installedIntegrationId(Optional installedIntegrationId) { + this.installedIntegrationId = installedIntegrationId; + return this; + } + + public Builder installedIntegrationId(String installedIntegrationId) { + this.installedIntegrationId = Optional.ofNullable(installedIntegrationId); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(Integration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The time when this action was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ */ + @JsonSetter(value = "deploy", nulls = Nulls.SKIP) + public Builder deploy(Optional deploy) { + this.deploy = deploy; + return this; + } + + public Builder deploy(Boolean deploy) { + this.deploy = Optional.ofNullable(deploy); + return this; + } + + public Action build() { + return new Action( + id, + name, + supportedTriggers, + allChangesDeployed, + createdAt, + updatedAt, + code, + dependencies, + runtime, + secrets, + deployedVersion, + installedIntegrationId, + integration, + status, + builtAt, + deploy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBase.java b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java new file mode 100644 index 000000000..5a4f5c3e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java @@ -0,0 +1,257 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionBase.Builder.class) +public final class ActionBase { + private final Optional id; + + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional allChangesDeployed; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private ActionBase( + Optional id, + Optional name, + Optional> supportedTriggers, + Optional allChangesDeployed, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.supportedTriggers = supportedTriggers; + this.allChangesDeployed = allChangesDeployed; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the action. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return True if all of an Action's contents have been deployed. + */ + @JsonProperty("all_changes_deployed") + public Optional getAllChangesDeployed() { + return allChangesDeployed; + } + + /** + * @return The time when this action was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this action was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionBase && equalTo((ActionBase) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionBase other) { + return id.equals(other.id) + && name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && allChangesDeployed.equals(other.allChangesDeployed) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.supportedTriggers, this.allChangesDeployed, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional allChangesDeployed = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionBase other) { + id(other.getId()); + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + allChangesDeployed(other.getAllChangesDeployed()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The unique ID of the action.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

True if all of an Action's contents have been deployed.

+ */ + @JsonSetter(value = "all_changes_deployed", nulls = Nulls.SKIP) + public Builder allChangesDeployed(Optional allChangesDeployed) { + this.allChangesDeployed = allChangesDeployed; + return this; + } + + public Builder allChangesDeployed(Boolean allChangesDeployed) { + this.allChangesDeployed = Optional.ofNullable(allChangesDeployed); + return this; + } + + /** + *

The time when this action was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this action was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public ActionBase build() { + return new ActionBase( + id, name, supportedTriggers, allChangesDeployed, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java new file mode 100644 index 000000000..54cde00d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionBinding.Builder.class) +public final class ActionBinding { + private final Optional id; + + private final Optional triggerId; + + private final Optional displayName; + + private final Optional action; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private ActionBinding( + Optional id, + Optional triggerId, + Optional displayName, + Optional action, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.triggerId = triggerId; + this.displayName = displayName; + this.action = action; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of this binding. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("trigger_id") + public Optional getTriggerId() { + return triggerId; + } + + /** + * @return The name of the binding. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when the binding was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when the binding was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionBinding && equalTo((ActionBinding) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionBinding other) { + return id.equals(other.id) + && triggerId.equals(other.triggerId) + && displayName.equals(other.displayName) + && action.equals(other.action) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.triggerId, this.displayName, this.action, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional triggerId = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionBinding other) { + id(other.getId()); + triggerId(other.getTriggerId()); + displayName(other.getDisplayName()); + action(other.getAction()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The unique ID of this binding.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "trigger_id", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + /** + *

The name of the binding.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(Action action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when the binding was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when the binding was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public ActionBinding build() { + return new ActionBinding(id, triggerId, displayName, action, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java new file mode 100644 index 000000000..3be4a031d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionBindingRef.Builder.class) +public final class ActionBindingRef { + private final Optional type; + + private final Optional value; + + private final Map additionalProperties; + + private ActionBindingRef( + Optional type, Optional value, Map additionalProperties) { + this.type = type; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The id or name of an action that is being bound to a trigger. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionBindingRef && equalTo((ActionBindingRef) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionBindingRef other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionBindingRef other) { + type(other.getType()); + value(other.getValue()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ActionBindingRefTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The id or name of an action that is being bound to a trigger.

+ */ + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + public ActionBindingRef build() { + return new ActionBindingRef(type, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java new file mode 100644 index 000000000..85c0fc20b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionBindingRefTypeEnum { + public static final ActionBindingRefTypeEnum BINDING_ID = + new ActionBindingRefTypeEnum(Value.BINDING_ID, "binding_id"); + + public static final ActionBindingRefTypeEnum ACTION_NAME = + new ActionBindingRefTypeEnum(Value.ACTION_NAME, "action_name"); + + public static final ActionBindingRefTypeEnum ACTION_ID = new ActionBindingRefTypeEnum(Value.ACTION_ID, "action_id"); + + private final Value value; + + private final String string; + + ActionBindingRefTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ActionBindingRefTypeEnum + && this.string.equals(((ActionBindingRefTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BINDING_ID: + return visitor.visitBindingId(); + case ACTION_NAME: + return visitor.visitActionName(); + case ACTION_ID: + return visitor.visitActionId(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionBindingRefTypeEnum valueOf(String value) { + switch (value) { + case "binding_id": + return BINDING_ID; + case "action_name": + return ACTION_NAME; + case "action_id": + return ACTION_ID; + default: + return new ActionBindingRefTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BINDING_ID, + + ACTION_ID, + + ACTION_NAME, + + UNKNOWN + } + + public interface Visitor { + T visitBindingId(); + + T visitActionId(); + + T visitActionName(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java new file mode 100644 index 000000000..f1495c76a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionBindingTypeEnum { + public static final ActionBindingTypeEnum TRIGGER_BOUND = + new ActionBindingTypeEnum(Value.TRIGGER_BOUND, "trigger-bound"); + + public static final ActionBindingTypeEnum ENTITY_BOUND = + new ActionBindingTypeEnum(Value.ENTITY_BOUND, "entity-bound"); + + private final Value value; + + private final String string; + + ActionBindingTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ActionBindingTypeEnum + && this.string.equals(((ActionBindingTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TRIGGER_BOUND: + return visitor.visitTriggerBound(); + case ENTITY_BOUND: + return visitor.visitEntityBound(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionBindingTypeEnum valueOf(String value) { + switch (value) { + case "trigger-bound": + return TRIGGER_BOUND; + case "entity-bound": + return ENTITY_BOUND; + default: + return new ActionBindingTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TRIGGER_BOUND, + + ENTITY_BOUND, + + UNKNOWN + } + + public interface Visitor { + T visitTriggerBound(); + + T visitEntityBound(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java new file mode 100644 index 000000000..530a28018 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionBindingWithRef.Builder.class) +public final class ActionBindingWithRef { + private final ActionBindingRef ref; + + private final Optional displayName; + + private final Optional> secrets; + + private final Map additionalProperties; + + private ActionBindingWithRef( + ActionBindingRef ref, + Optional displayName, + Optional> secrets, + Map additionalProperties) { + this.ref = ref; + this.displayName = displayName; + this.secrets = secrets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ref") + public ActionBindingRef getRef() { + return ref; + } + + /** + * @return The name of the binding. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionBindingWithRef && equalTo((ActionBindingWithRef) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionBindingWithRef other) { + return ref.equals(other.ref) && displayName.equals(other.displayName) && secrets.equals(other.secrets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ref, this.displayName, this.secrets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RefStage builder() { + return new Builder(); + } + + public interface RefStage { + _FinalStage ref(@NotNull ActionBindingRef ref); + + Builder from(ActionBindingWithRef other); + } + + public interface _FinalStage { + ActionBindingWithRef build(); + + /** + *

The name of the binding.

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + _FinalStage secrets(Optional> secrets); + + _FinalStage secrets(List secrets); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RefStage, _FinalStage { + private ActionBindingRef ref; + + private Optional> secrets = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionBindingWithRef other) { + ref(other.getRef()); + displayName(other.getDisplayName()); + secrets(other.getSecrets()); + return this; + } + + @java.lang.Override + @JsonSetter("ref") + public _FinalStage ref(@NotNull ActionBindingRef ref) { + this.ref = Objects.requireNonNull(ref, "ref must not be null"); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @java.lang.Override + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public _FinalStage secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + /** + *

The name of the binding.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

The name of the binding.

+ */ + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public ActionBindingWithRef build() { + return new ActionBindingWithRef(ref, displayName, secrets, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java new file mode 100644 index 000000000..6370c3f4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionBuildStatusEnum { + public static final ActionBuildStatusEnum FAILED = new ActionBuildStatusEnum(Value.FAILED, "failed"); + + public static final ActionBuildStatusEnum PENDING = new ActionBuildStatusEnum(Value.PENDING, "pending"); + + public static final ActionBuildStatusEnum BUILT = new ActionBuildStatusEnum(Value.BUILT, "built"); + + public static final ActionBuildStatusEnum BUILDING = new ActionBuildStatusEnum(Value.BUILDING, "building"); + + public static final ActionBuildStatusEnum PACKAGED = new ActionBuildStatusEnum(Value.PACKAGED, "packaged"); + + public static final ActionBuildStatusEnum RETRYING = new ActionBuildStatusEnum(Value.RETRYING, "retrying"); + + private final Value value; + + private final String string; + + ActionBuildStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ActionBuildStatusEnum + && this.string.equals(((ActionBuildStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case BUILT: + return visitor.visitBuilt(); + case BUILDING: + return visitor.visitBuilding(); + case PACKAGED: + return visitor.visitPackaged(); + case RETRYING: + return visitor.visitRetrying(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionBuildStatusEnum valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "built": + return BUILT; + case "building": + return BUILDING; + case "packaged": + return PACKAGED; + case "retrying": + return RETRYING; + default: + return new ActionBuildStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + BUILDING, + + PACKAGED, + + BUILT, + + RETRYING, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitBuilding(); + + T visitPackaged(); + + T visitBuilt(); + + T visitRetrying(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java new file mode 100644 index 000000000..a64202a33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java @@ -0,0 +1,544 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionDeployedVersion.Builder.class) +public final class ActionDeployedVersion { + private final Optional id; + + private final Optional actionId; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional deployed; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional status; + + private final Optional number; + + private final Optional> errors; + + private final Optional action; + + private final Optional builtAt; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> supportedTriggers; + + private final Map additionalProperties; + + private ActionDeployedVersion( + Optional id, + Optional actionId, + Optional code, + Optional> dependencies, + Optional deployed, + Optional runtime, + Optional> secrets, + Optional status, + Optional number, + Optional> errors, + Optional action, + Optional builtAt, + Optional createdAt, + Optional updatedAt, + Optional> supportedTriggers, + Map additionalProperties) { + this.id = id; + this.actionId = actionId; + this.code = code; + this.dependencies = dependencies; + this.deployed = deployed; + this.runtime = runtime; + this.secrets = secrets; + this.status = status; + this.number = number; + this.errors = errors; + this.action = action; + this.builtAt = builtAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.supportedTriggers = supportedTriggers; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique id of an action version. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The id of the action to which this version belongs. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + /** + * @return The source code of this specific version of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this specific version depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return Indicates if this speciic version is the currently one deployed. + */ + @JsonProperty("deployed") + public Optional getDeployed() { + return deployed; + } + + /** + * @return The Node runtime. For example: node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The index of this version in list of versions for the action. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return Any errors that occurred while the version was being built. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when this version was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return The time when this version was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The list of triggers that this version supports. At this time, a version can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionDeployedVersion && equalTo((ActionDeployedVersion) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionDeployedVersion other) { + return id.equals(other.id) + && actionId.equals(other.actionId) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && deployed.equals(other.deployed) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && status.equals(other.status) + && number.equals(other.number) + && errors.equals(other.errors) + && action.equals(other.action) + && builtAt.equals(other.builtAt) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && supportedTriggers.equals(other.supportedTriggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.actionId, + this.code, + this.dependencies, + this.deployed, + this.runtime, + this.secrets, + this.status, + this.number, + this.errors, + this.action, + this.builtAt, + this.createdAt, + this.updatedAt, + this.supportedTriggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional deployed = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionDeployedVersion other) { + id(other.getId()); + actionId(other.getActionId()); + code(other.getCode()); + dependencies(other.getDependencies()); + deployed(other.getDeployed()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + status(other.getStatus()); + number(other.getNumber()); + errors(other.getErrors()); + action(other.getAction()); + builtAt(other.getBuiltAt()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + supportedTriggers(other.getSupportedTriggers()); + return this; + } + + /** + *

The unique id of an action version.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The id of the action to which this version belongs.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + /** + *

The source code of this specific version of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this specific version depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

Indicates if this speciic version is the currently one deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(Optional deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = Optional.ofNullable(deployed); + return this; + } + + /** + *

The Node runtime. For example: node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionVersionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The index of this version in list of versions for the action.

+ */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(Double number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

Any errors that occurred while the version was being built.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(ActionBase action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when this version was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

The time when this version was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The list of triggers that this version supports. At this time, a version can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + public ActionDeployedVersion build() { + return new ActionDeployedVersion( + id, + actionId, + code, + dependencies, + deployed, + runtime, + secrets, + status, + number, + errors, + action, + builtAt, + createdAt, + updatedAt, + supportedTriggers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionError.java b/src/main/java/com/auth0/client/mgmt/types/ActionError.java new file mode 100644 index 000000000..490a8520c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionError.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionError.Builder.class) +public final class ActionError { + private final Optional id; + + private final Optional msg; + + private final Optional url; + + private final Map additionalProperties; + + private ActionError( + Optional id, Optional msg, Optional url, Map additionalProperties) { + this.id = id; + this.msg = msg; + this.url = url; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("msg") + public Optional getMsg() { + return msg; + } + + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionError && equalTo((ActionError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionError other) { + return id.equals(other.id) && msg.equals(other.msg) && url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.msg, this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional msg = Optional.empty(); + + private Optional url = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionError other) { + id(other.getId()); + msg(other.getMsg()); + url(other.getUrl()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "msg", nulls = Nulls.SKIP) + public Builder msg(Optional msg) { + this.msg = msg; + return this; + } + + public Builder msg(String msg) { + this.msg = Optional.ofNullable(msg); + return this; + } + + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + public ActionError build() { + return new ActionError(id, msg, url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java new file mode 100644 index 000000000..a7e149c1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionExecutionResult.Builder.class) +public final class ActionExecutionResult { + private final Optional actionName; + + private final Optional error; + + private final Optional startedAt; + + private final Optional endedAt; + + private final Map additionalProperties; + + private ActionExecutionResult( + Optional actionName, + Optional error, + Optional startedAt, + Optional endedAt, + Map additionalProperties) { + this.actionName = actionName; + this.error = error; + this.startedAt = startedAt; + this.endedAt = endedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the action that was executed. + */ + @JsonProperty("action_name") + public Optional getActionName() { + return actionName; + } + + @JsonProperty("error") + public Optional getError() { + return error; + } + + /** + * @return The time when the action was started. + */ + @JsonProperty("started_at") + public Optional getStartedAt() { + return startedAt; + } + + /** + * @return The time when the action finished executing. + */ + @JsonProperty("ended_at") + public Optional getEndedAt() { + return endedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionExecutionResult && equalTo((ActionExecutionResult) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionExecutionResult other) { + return actionName.equals(other.actionName) + && error.equals(other.error) + && startedAt.equals(other.startedAt) + && endedAt.equals(other.endedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionName, this.error, this.startedAt, this.endedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional actionName = Optional.empty(); + + private Optional error = Optional.empty(); + + private Optional startedAt = Optional.empty(); + + private Optional endedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionExecutionResult other) { + actionName(other.getActionName()); + error(other.getError()); + startedAt(other.getStartedAt()); + endedAt(other.getEndedAt()); + return this; + } + + /** + *

The name of the action that was executed.

+ */ + @JsonSetter(value = "action_name", nulls = Nulls.SKIP) + public Builder actionName(Optional actionName) { + this.actionName = actionName; + return this; + } + + public Builder actionName(String actionName) { + this.actionName = Optional.ofNullable(actionName); + return this; + } + + @JsonSetter(value = "error", nulls = Nulls.SKIP) + public Builder error(Optional error) { + this.error = error; + return this; + } + + public Builder error(ActionError error) { + this.error = Optional.ofNullable(error); + return this; + } + + /** + *

The time when the action was started.

+ */ + @JsonSetter(value = "started_at", nulls = Nulls.SKIP) + public Builder startedAt(Optional startedAt) { + this.startedAt = startedAt; + return this; + } + + public Builder startedAt(OffsetDateTime startedAt) { + this.startedAt = Optional.ofNullable(startedAt); + return this; + } + + /** + *

The time when the action finished executing.

+ */ + @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) + public Builder endedAt(Optional endedAt) { + this.endedAt = endedAt; + return this; + } + + public Builder endedAt(OffsetDateTime endedAt) { + this.endedAt = Optional.ofNullable(endedAt); + return this; + } + + public ActionExecutionResult build() { + return new ActionExecutionResult(actionName, error, startedAt, endedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java new file mode 100644 index 000000000..180a710c3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionExecutionStatusEnum { + public static final ActionExecutionStatusEnum PARTIAL = new ActionExecutionStatusEnum(Value.PARTIAL, "partial"); + + public static final ActionExecutionStatusEnum UNSPECIFIED = + new ActionExecutionStatusEnum(Value.UNSPECIFIED, "unspecified"); + + public static final ActionExecutionStatusEnum FINAL = new ActionExecutionStatusEnum(Value.FINAL, "final"); + + public static final ActionExecutionStatusEnum PENDING = new ActionExecutionStatusEnum(Value.PENDING, "pending"); + + public static final ActionExecutionStatusEnum CANCELED = new ActionExecutionStatusEnum(Value.CANCELED, "canceled"); + + public static final ActionExecutionStatusEnum SUSPENDED = + new ActionExecutionStatusEnum(Value.SUSPENDED, "suspended"); + + private final Value value; + + private final String string; + + ActionExecutionStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ActionExecutionStatusEnum + && this.string.equals(((ActionExecutionStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARTIAL: + return visitor.visitPartial(); + case UNSPECIFIED: + return visitor.visitUnspecified(); + case FINAL: + return visitor.visitFinal(); + case PENDING: + return visitor.visitPending(); + case CANCELED: + return visitor.visitCanceled(); + case SUSPENDED: + return visitor.visitSuspended(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionExecutionStatusEnum valueOf(String value) { + switch (value) { + case "partial": + return PARTIAL; + case "unspecified": + return UNSPECIFIED; + case "final": + return FINAL; + case "pending": + return PENDING; + case "canceled": + return CANCELED; + case "suspended": + return SUSPENDED; + default: + return new ActionExecutionStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + UNSPECIFIED, + + PENDING, + + FINAL, + + PARTIAL, + + CANCELED, + + SUSPENDED, + + UNKNOWN + } + + public interface Visitor { + T visitUnspecified(); + + T visitPending(); + + T visitFinal(); + + T visitPartial(); + + T visitCanceled(); + + T visitSuspended(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java new file mode 100644 index 000000000..0e2f8be7c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionSecretRequest.Builder.class) +public final class ActionSecretRequest { + private final Optional name; + + private final Optional value; + + private final Map additionalProperties; + + private ActionSecretRequest( + Optional name, Optional value, Map additionalProperties) { + this.name = name; + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the particular secret, e.g. API_KEY. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The value of the particular secret, e.g. secret123. A secret's value can only be set upon creation. A secret's value will never be returned by the API. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionSecretRequest && equalTo((ActionSecretRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionSecretRequest other) { + return name.equals(other.name) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionSecretRequest other) { + name(other.getName()); + value(other.getValue()); + return this; + } + + /** + *

The name of the particular secret, e.g. API_KEY.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The value of the particular secret, e.g. secret123. A secret's value can only be set upon creation. A secret's value will never be returned by the API.

+ */ + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + public ActionSecretRequest build() { + return new ActionSecretRequest(name, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java new file mode 100644 index 000000000..a90411457 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionSecretResponse.Builder.class) +public final class ActionSecretResponse { + private final Optional name; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private ActionSecretResponse( + Optional name, Optional updatedAt, Map additionalProperties) { + this.name = name; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the particular secret, e.g. API_KEY. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The time when the secret was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionSecretResponse && equalTo((ActionSecretResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionSecretResponse other) { + return name.equals(other.name) && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionSecretResponse other) { + name(other.getName()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The name of the particular secret, e.g. API_KEY.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The time when the secret was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public ActionSecretResponse build() { + return new ActionSecretResponse(name, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java new file mode 100644 index 000000000..f904a3396 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java @@ -0,0 +1,367 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionTrigger.Builder.class) +public final class ActionTrigger { + private final String id; + + private final Optional version; + + private final Optional status; + + private final Optional> runtimes; + + private final Optional defaultRuntime; + + private final Optional> compatibleTriggers; + + private final Optional bindingPolicy; + + private final Map additionalProperties; + + private ActionTrigger( + String id, + Optional version, + Optional status, + Optional> runtimes, + Optional defaultRuntime, + Optional> compatibleTriggers, + Optional bindingPolicy, + Map additionalProperties) { + this.id = id; + this.version = version; + this.status = status; + this.runtimes = runtimes; + this.defaultRuntime = defaultRuntime; + this.compatibleTriggers = compatibleTriggers; + this.bindingPolicy = bindingPolicy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The version of a trigger. v1, v2, etc. + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return status points to the trigger status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return runtimes supported by this trigger. + */ + @JsonProperty("runtimes") + public Optional> getRuntimes() { + return runtimes; + } + + /** + * @return Runtime that will be used when none is specified when creating an action. + */ + @JsonProperty("default_runtime") + public Optional getDefaultRuntime() { + return defaultRuntime; + } + + /** + * @return compatible_triggers informs which other trigger supports the same event and api. + */ + @JsonProperty("compatible_triggers") + public Optional> getCompatibleTriggers() { + return compatibleTriggers; + } + + @JsonProperty("binding_policy") + public Optional getBindingPolicy() { + return bindingPolicy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionTrigger && equalTo((ActionTrigger) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionTrigger other) { + return id.equals(other.id) + && version.equals(other.version) + && status.equals(other.status) + && runtimes.equals(other.runtimes) + && defaultRuntime.equals(other.defaultRuntime) + && compatibleTriggers.equals(other.compatibleTriggers) + && bindingPolicy.equals(other.bindingPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.version, + this.status, + this.runtimes, + this.defaultRuntime, + this.compatibleTriggers, + this.bindingPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(ActionTrigger other); + } + + public interface _FinalStage { + ActionTrigger build(); + + /** + *

The version of a trigger. v1, v2, etc.

+ */ + _FinalStage version(Optional version); + + _FinalStage version(String version); + + /** + *

status points to the trigger status.

+ */ + _FinalStage status(Optional status); + + _FinalStage status(String status); + + /** + *

runtimes supported by this trigger.

+ */ + _FinalStage runtimes(Optional> runtimes); + + _FinalStage runtimes(List runtimes); + + /** + *

Runtime that will be used when none is specified when creating an action.

+ */ + _FinalStage defaultRuntime(Optional defaultRuntime); + + _FinalStage defaultRuntime(String defaultRuntime); + + /** + *

compatible_triggers informs which other trigger supports the same event and api.

+ */ + _FinalStage compatibleTriggers(Optional> compatibleTriggers); + + _FinalStage compatibleTriggers(List compatibleTriggers); + + _FinalStage bindingPolicy(Optional bindingPolicy); + + _FinalStage bindingPolicy(ActionBindingTypeEnum bindingPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional bindingPolicy = Optional.empty(); + + private Optional> compatibleTriggers = Optional.empty(); + + private Optional defaultRuntime = Optional.empty(); + + private Optional> runtimes = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionTrigger other) { + id(other.getId()); + version(other.getVersion()); + status(other.getStatus()); + runtimes(other.getRuntimes()); + defaultRuntime(other.getDefaultRuntime()); + compatibleTriggers(other.getCompatibleTriggers()); + bindingPolicy(other.getBindingPolicy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage bindingPolicy(ActionBindingTypeEnum bindingPolicy) { + this.bindingPolicy = Optional.ofNullable(bindingPolicy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "binding_policy", nulls = Nulls.SKIP) + public _FinalStage bindingPolicy(Optional bindingPolicy) { + this.bindingPolicy = bindingPolicy; + return this; + } + + /** + *

compatible_triggers informs which other trigger supports the same event and api.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage compatibleTriggers(List compatibleTriggers) { + this.compatibleTriggers = Optional.ofNullable(compatibleTriggers); + return this; + } + + /** + *

compatible_triggers informs which other trigger supports the same event and api.

+ */ + @java.lang.Override + @JsonSetter(value = "compatible_triggers", nulls = Nulls.SKIP) + public _FinalStage compatibleTriggers(Optional> compatibleTriggers) { + this.compatibleTriggers = compatibleTriggers; + return this; + } + + /** + *

Runtime that will be used when none is specified when creating an action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultRuntime(String defaultRuntime) { + this.defaultRuntime = Optional.ofNullable(defaultRuntime); + return this; + } + + /** + *

Runtime that will be used when none is specified when creating an action.

+ */ + @java.lang.Override + @JsonSetter(value = "default_runtime", nulls = Nulls.SKIP) + public _FinalStage defaultRuntime(Optional defaultRuntime) { + this.defaultRuntime = defaultRuntime; + return this; + } + + /** + *

runtimes supported by this trigger.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runtimes(List runtimes) { + this.runtimes = Optional.ofNullable(runtimes); + return this; + } + + /** + *

runtimes supported by this trigger.

+ */ + @java.lang.Override + @JsonSetter(value = "runtimes", nulls = Nulls.SKIP) + public _FinalStage runtimes(Optional> runtimes) { + this.runtimes = runtimes; + return this; + } + + /** + *

status points to the trigger status.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

status points to the trigger status.

+ */ + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

The version of a trigger. v1, v2, etc.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(String version) { + this.version = Optional.ofNullable(version); + return this; + } + + /** + *

The version of a trigger. v1, v2, etc.

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public ActionTrigger build() { + return new ActionTrigger( + id, + version, + status, + runtimes, + defaultRuntime, + compatibleTriggers, + bindingPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java new file mode 100644 index 000000000..bb8740e73 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionTriggerCompatibleTrigger.Builder.class) +public final class ActionTriggerCompatibleTrigger { + private final String id; + + private final String version; + + private final Map additionalProperties; + + private ActionTriggerCompatibleTrigger(String id, String version, Map additionalProperties) { + this.id = id; + this.version = version; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The version of a trigger. v1, v2, etc. + */ + @JsonProperty("version") + public String getVersion() { + return version; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionTriggerCompatibleTrigger && equalTo((ActionTriggerCompatibleTrigger) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionTriggerCompatibleTrigger other) { + return id.equals(other.id) && version.equals(other.version); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.version); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + VersionStage id(@NotNull String id); + + Builder from(ActionTriggerCompatibleTrigger other); + } + + public interface VersionStage { + /** + *

The version of a trigger. v1, v2, etc.

+ */ + _FinalStage version(@NotNull String version); + } + + public interface _FinalStage { + ActionTriggerCompatibleTrigger build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, VersionStage, _FinalStage { + private String id; + + private String version; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionTriggerCompatibleTrigger other) { + id(other.getId()); + version(other.getVersion()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public VersionStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The version of a trigger. v1, v2, etc.

+ *

The version of a trigger. v1, v2, etc.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("version") + public _FinalStage version(@NotNull String version) { + this.version = Objects.requireNonNull(version, "version must not be null"); + return this; + } + + @java.lang.Override + public ActionTriggerCompatibleTrigger build() { + return new ActionTriggerCompatibleTrigger(id, version, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java new file mode 100644 index 000000000..e0b68281d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java @@ -0,0 +1,544 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionVersion.Builder.class) +public final class ActionVersion { + private final Optional id; + + private final Optional actionId; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional deployed; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional status; + + private final Optional number; + + private final Optional> errors; + + private final Optional action; + + private final Optional builtAt; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> supportedTriggers; + + private final Map additionalProperties; + + private ActionVersion( + Optional id, + Optional actionId, + Optional code, + Optional> dependencies, + Optional deployed, + Optional runtime, + Optional> secrets, + Optional status, + Optional number, + Optional> errors, + Optional action, + Optional builtAt, + Optional createdAt, + Optional updatedAt, + Optional> supportedTriggers, + Map additionalProperties) { + this.id = id; + this.actionId = actionId; + this.code = code; + this.dependencies = dependencies; + this.deployed = deployed; + this.runtime = runtime; + this.secrets = secrets; + this.status = status; + this.number = number; + this.errors = errors; + this.action = action; + this.builtAt = builtAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.supportedTriggers = supportedTriggers; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique id of an action version. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The id of the action to which this version belongs. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + /** + * @return The source code of this specific version of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this specific version depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return Indicates if this speciic version is the currently one deployed. + */ + @JsonProperty("deployed") + public Optional getDeployed() { + return deployed; + } + + /** + * @return The Node runtime. For example: node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The index of this version in list of versions for the action. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return Any errors that occurred while the version was being built. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when this version was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return The time when this version was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The list of triggers that this version supports. At this time, a version can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionVersion && equalTo((ActionVersion) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionVersion other) { + return id.equals(other.id) + && actionId.equals(other.actionId) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && deployed.equals(other.deployed) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && status.equals(other.status) + && number.equals(other.number) + && errors.equals(other.errors) + && action.equals(other.action) + && builtAt.equals(other.builtAt) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && supportedTriggers.equals(other.supportedTriggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.actionId, + this.code, + this.dependencies, + this.deployed, + this.runtime, + this.secrets, + this.status, + this.number, + this.errors, + this.action, + this.builtAt, + this.createdAt, + this.updatedAt, + this.supportedTriggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional deployed = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionVersion other) { + id(other.getId()); + actionId(other.getActionId()); + code(other.getCode()); + dependencies(other.getDependencies()); + deployed(other.getDeployed()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + status(other.getStatus()); + number(other.getNumber()); + errors(other.getErrors()); + action(other.getAction()); + builtAt(other.getBuiltAt()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + supportedTriggers(other.getSupportedTriggers()); + return this; + } + + /** + *

The unique id of an action version.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The id of the action to which this version belongs.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + /** + *

The source code of this specific version of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this specific version depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

Indicates if this speciic version is the currently one deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(Optional deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = Optional.ofNullable(deployed); + return this; + } + + /** + *

The Node runtime. For example: node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionVersionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The index of this version in list of versions for the action.

+ */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(Double number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

Any errors that occurred while the version was being built.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(ActionBase action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when this version was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

The time when this version was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The list of triggers that this version supports. At this time, a version can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + public ActionVersion build() { + return new ActionVersion( + id, + actionId, + code, + dependencies, + deployed, + runtime, + secrets, + status, + number, + errors, + action, + builtAt, + createdAt, + updatedAt, + supportedTriggers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java new file mode 100644 index 000000000..6a9f5c51e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionVersionBuildStatusEnum { + public static final ActionVersionBuildStatusEnum FAILED = new ActionVersionBuildStatusEnum(Value.FAILED, "failed"); + + public static final ActionVersionBuildStatusEnum PENDING = + new ActionVersionBuildStatusEnum(Value.PENDING, "pending"); + + public static final ActionVersionBuildStatusEnum BUILT = new ActionVersionBuildStatusEnum(Value.BUILT, "built"); + + public static final ActionVersionBuildStatusEnum BUILDING = + new ActionVersionBuildStatusEnum(Value.BUILDING, "building"); + + public static final ActionVersionBuildStatusEnum PACKAGED = + new ActionVersionBuildStatusEnum(Value.PACKAGED, "packaged"); + + public static final ActionVersionBuildStatusEnum RETRYING = + new ActionVersionBuildStatusEnum(Value.RETRYING, "retrying"); + + private final Value value; + + private final String string; + + ActionVersionBuildStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ActionVersionBuildStatusEnum + && this.string.equals(((ActionVersionBuildStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case BUILT: + return visitor.visitBuilt(); + case BUILDING: + return visitor.visitBuilding(); + case PACKAGED: + return visitor.visitPackaged(); + case RETRYING: + return visitor.visitRetrying(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionVersionBuildStatusEnum valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "built": + return BUILT; + case "building": + return BUILDING; + case "packaged": + return PACKAGED; + case "retrying": + return RETRYING; + default: + return new ActionVersionBuildStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + BUILDING, + + PACKAGED, + + BUILT, + + RETRYING, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitBuilding(); + + T visitPackaged(); + + T visitBuilt(); + + T visitRetrying(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java new file mode 100644 index 000000000..d61c7e1bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionVersionDependency.Builder.class) +public final class ActionVersionDependency { + private final Optional name; + + private final Optional version; + + private final Optional registryUrl; + + private final Map additionalProperties; + + private ActionVersionDependency( + Optional name, + Optional version, + Optional registryUrl, + Map additionalProperties) { + this.name = name; + this.version = version; + this.registryUrl = registryUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return name is the name of the npm module, e.g. lodash + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return description is the version of the npm module, e.g. 4.17.1 + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return registry_url is an optional value used primarily for private npm registries. + */ + @JsonProperty("registry_url") + public Optional getRegistryUrl() { + return registryUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionVersionDependency && equalTo((ActionVersionDependency) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionVersionDependency other) { + return name.equals(other.name) && version.equals(other.version) && registryUrl.equals(other.registryUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.version, this.registryUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional version = Optional.empty(); + + private Optional registryUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionVersionDependency other) { + name(other.getName()); + version(other.getVersion()); + registryUrl(other.getRegistryUrl()); + return this; + } + + /** + *

name is the name of the npm module, e.g. lodash

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

description is the version of the npm module, e.g. 4.17.1

+ */ + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public Builder version(Optional version) { + this.version = version; + return this; + } + + public Builder version(String version) { + this.version = Optional.ofNullable(version); + return this; + } + + /** + *

registry_url is an optional value used primarily for private npm registries.

+ */ + @JsonSetter(value = "registry_url", nulls = Nulls.SKIP) + public Builder registryUrl(Optional registryUrl) { + this.registryUrl = registryUrl; + return this; + } + + public Builder registryUrl(String registryUrl) { + this.registryUrl = Optional.ofNullable(registryUrl); + return this; + } + + public ActionVersionDependency build() { + return new ActionVersionDependency(name, version, registryUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java new file mode 100644 index 000000000..cf82c6e3b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculClientFilter.Builder.class) +public final class AculClientFilter { + private final Optional id; + + private final Optional> metadata; + + private final Map additionalProperties; + + private AculClientFilter( + Optional id, Optional> metadata, Map additionalProperties) { + this.id = id; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return Client ID + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculClientFilter && equalTo((AculClientFilter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculClientFilter other) { + return id.equals(other.id) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculClientFilter other) { + id(other.getId()); + metadata(other.getMetadata()); + return this; + } + + /** + *

Client ID

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AculClientFilter build() { + return new AculClientFilter(id, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java new file mode 100644 index 000000000..22ca393c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculDomainFilter.Builder.class) +public final class AculDomainFilter { + private final Optional id; + + private final Optional> metadata; + + private final Map additionalProperties; + + private AculDomainFilter( + Optional id, Optional> metadata, Map additionalProperties) { + this.id = id; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return Domain ID + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculDomainFilter && equalTo((AculDomainFilter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculDomainFilter other) { + return id.equals(other.id) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculDomainFilter other) { + id(other.getId()); + metadata(other.getMetadata()); + return this; + } + + /** + *

Domain ID

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AculDomainFilter build() { + return new AculDomainFilter(id, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculFilters.java b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java new file mode 100644 index 000000000..17818338d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculFilters.Builder.class) +public final class AculFilters { + private final Optional matchType; + + private final Optional> clients; + + private final Optional> organizations; + + private final Optional> domains; + + private final Map additionalProperties; + + private AculFilters( + Optional matchType, + Optional> clients, + Optional> organizations, + Optional> domains, + Map additionalProperties) { + this.matchType = matchType; + this.clients = clients; + this.organizations = organizations; + this.domains = domains; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("match_type") + public Optional getMatchType() { + return matchType; + } + + /** + * @return Clients filter + */ + @JsonProperty("clients") + public Optional> getClients() { + return clients; + } + + /** + * @return Organizations filter + */ + @JsonProperty("organizations") + public Optional> getOrganizations() { + return organizations; + } + + /** + * @return Domains filter + */ + @JsonProperty("domains") + public Optional> getDomains() { + return domains; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculFilters && equalTo((AculFilters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculFilters other) { + return matchType.equals(other.matchType) + && clients.equals(other.clients) + && organizations.equals(other.organizations) + && domains.equals(other.domains); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.matchType, this.clients, this.organizations, this.domains); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional matchType = Optional.empty(); + + private Optional> clients = Optional.empty(); + + private Optional> organizations = Optional.empty(); + + private Optional> domains = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculFilters other) { + matchType(other.getMatchType()); + clients(other.getClients()); + organizations(other.getOrganizations()); + domains(other.getDomains()); + return this; + } + + @JsonSetter(value = "match_type", nulls = Nulls.SKIP) + public Builder matchType(Optional matchType) { + this.matchType = matchType; + return this; + } + + public Builder matchType(AculMatchTypeEnum matchType) { + this.matchType = Optional.ofNullable(matchType); + return this; + } + + /** + *

Clients filter

+ */ + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional> clients) { + this.clients = clients; + return this; + } + + public Builder clients(List clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + /** + *

Organizations filter

+ */ + @JsonSetter(value = "organizations", nulls = Nulls.SKIP) + public Builder organizations(Optional> organizations) { + this.organizations = organizations; + return this; + } + + public Builder organizations(List organizations) { + this.organizations = Optional.ofNullable(organizations); + return this; + } + + /** + *

Domains filter

+ */ + @JsonSetter(value = "domains", nulls = Nulls.SKIP) + public Builder domains(Optional> domains) { + this.domains = domains; + return this; + } + + public Builder domains(List domains) { + this.domains = Optional.ofNullable(domains); + return this; + } + + public AculFilters build() { + return new AculFilters(matchType, clients, organizations, domains, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java new file mode 100644 index 000000000..222e3e8fe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculHeadTag.Builder.class) +public final class AculHeadTag { + private final Optional tag; + + private final Optional attributes; + + private final Optional content; + + private final Map additionalProperties; + + private AculHeadTag( + Optional tag, + Optional attributes, + Optional content, + Map additionalProperties) { + this.tag = tag; + this.attributes = attributes; + this.content = content; + this.additionalProperties = additionalProperties; + } + + /** + * @return Any HTML element valid for use in the head tag + */ + @JsonProperty("tag") + public Optional getTag() { + return tag; + } + + @JsonProperty("attributes") + public Optional getAttributes() { + return attributes; + } + + /** + * @return Text/content within the opening and closing tags of the element. + * See <a href="https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens">documentation</a> on using context variables + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculHeadTag && equalTo((AculHeadTag) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculHeadTag other) { + return tag.equals(other.tag) && attributes.equals(other.attributes) && content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tag, this.attributes, this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tag = Optional.empty(); + + private Optional attributes = Optional.empty(); + + private Optional content = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculHeadTag other) { + tag(other.getTag()); + attributes(other.getAttributes()); + content(other.getContent()); + return this; + } + + /** + *

Any HTML element valid for use in the head tag

+ */ + @JsonSetter(value = "tag", nulls = Nulls.SKIP) + public Builder tag(Optional tag) { + this.tag = tag; + return this; + } + + public Builder tag(String tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(AculHeadTagAttributes attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + /** + *

Text/content within the opening and closing tags of the element. + * See <a href="https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens">documentation</a> on using context variables

+ */ + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + public AculHeadTag build() { + return new AculHeadTag(tag, attributes, content, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java b/src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java new file mode 100644 index 000000000..6981db849 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculHeadTagAttributes.Builder.class) +public final class AculHeadTagAttributes { + private final Optional> integrity; + + private final Map additionalProperties; + + private AculHeadTagAttributes(Optional> integrity, Map additionalProperties) { + this.integrity = integrity; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integrity") + public Optional> getIntegrity() { + return integrity; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculHeadTagAttributes && equalTo((AculHeadTagAttributes) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculHeadTagAttributes other) { + return integrity.equals(other.integrity); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integrity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> integrity = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculHeadTagAttributes other) { + integrity(other.getIntegrity()); + return this; + } + + @JsonSetter(value = "integrity", nulls = Nulls.SKIP) + public Builder integrity(Optional> integrity) { + this.integrity = integrity; + return this; + } + + public Builder integrity(List integrity) { + this.integrity = Optional.ofNullable(integrity); + return this; + } + + public AculHeadTagAttributes build() { + return new AculHeadTagAttributes(integrity, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java new file mode 100644 index 000000000..2166f0615 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AculMatchTypeEnum { + public static final AculMatchTypeEnum EXCLUDES_ANY = new AculMatchTypeEnum(Value.EXCLUDES_ANY, "excludes_any"); + + public static final AculMatchTypeEnum INCLUDES_ANY = new AculMatchTypeEnum(Value.INCLUDES_ANY, "includes_any"); + + private final Value value; + + private final String string; + + AculMatchTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AculMatchTypeEnum && this.string.equals(((AculMatchTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EXCLUDES_ANY: + return visitor.visitExcludesAny(); + case INCLUDES_ANY: + return visitor.visitIncludesAny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AculMatchTypeEnum valueOf(String value) { + switch (value) { + case "excludes_any": + return EXCLUDES_ANY; + case "includes_any": + return INCLUDES_ANY; + default: + return new AculMatchTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + INCLUDES_ANY, + + EXCLUDES_ANY, + + UNKNOWN + } + + public interface Visitor { + T visitIncludesAny(); + + T visitExcludesAny(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java new file mode 100644 index 000000000..bba8502f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculOrganizationFilter.Builder.class) +public final class AculOrganizationFilter { + private final Optional id; + + private final Optional> metadata; + + private final Map additionalProperties; + + private AculOrganizationFilter( + Optional id, Optional> metadata, Map additionalProperties) { + this.id = id; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization ID + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculOrganizationFilter && equalTo((AculOrganizationFilter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculOrganizationFilter other) { + return id.equals(other.id) && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculOrganizationFilter other) { + id(other.getId()); + metadata(other.getMetadata()); + return this; + } + + /** + *

Organization ID

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AculOrganizationFilter build() { + return new AculOrganizationFilter(id, metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java new file mode 100644 index 000000000..4bd2304b5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AculRenderingModeEnum { + public static final AculRenderingModeEnum ADVANCED = new AculRenderingModeEnum(Value.ADVANCED, "advanced"); + + public static final AculRenderingModeEnum STANDARD = new AculRenderingModeEnum(Value.STANDARD, "standard"); + + private final Value value; + + private final String string; + + AculRenderingModeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AculRenderingModeEnum + && this.string.equals(((AculRenderingModeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ADVANCED: + return visitor.visitAdvanced(); + case STANDARD: + return visitor.visitStandard(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AculRenderingModeEnum valueOf(String value) { + switch (value) { + case "advanced": + return ADVANCED; + case "standard": + return STANDARD; + default: + return new AculRenderingModeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ADVANCED, + + STANDARD, + + UNKNOWN + } + + public interface Visitor { + T visitAdvanced(); + + T visitStandard(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java new file mode 100644 index 000000000..308c819b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculResponseContent.Builder.class) +public final class AculResponseContent { + private final Optional renderingMode; + + private final Optional> contextConfiguration; + + private final OptionalNullable defaultHeadTagsDisabled; + + private final Optional> headTags; + + private final OptionalNullable filters; + + private final OptionalNullable usePageTemplate; + + private final Map additionalProperties; + + private AculResponseContent( + Optional renderingMode, + Optional> contextConfiguration, + OptionalNullable defaultHeadTagsDisabled, + Optional> headTags, + OptionalNullable filters, + OptionalNullable usePageTemplate, + Map additionalProperties) { + this.renderingMode = renderingMode; + this.contextConfiguration = contextConfiguration; + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.headTags = headTags; + this.filters = filters; + this.usePageTemplate = usePageTemplate; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rendering_mode") + public Optional getRenderingMode() { + return renderingMode; + } + + /** + * @return Context values to make available + */ + @JsonProperty("context_configuration") + public Optional> getContextConfiguration() { + return contextConfiguration; + } + + /** + * @return Override Universal Login default head tags + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + public OptionalNullable getDefaultHeadTagsDisabled() { + if (defaultHeadTagsDisabled == null) { + return OptionalNullable.absent(); + } + return defaultHeadTagsDisabled; + } + + /** + * @return An array of head tags + */ + @JsonProperty("head_tags") + public Optional> getHeadTags() { + return headTags; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + public OptionalNullable getFilters() { + if (filters == null) { + return OptionalNullable.absent(); + } + return filters; + } + + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + private OptionalNullable _getDefaultHeadTagsDisabled() { + return defaultHeadTagsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + private OptionalNullable _getUsePageTemplate() { + return usePageTemplate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculResponseContent && equalTo((AculResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculResponseContent other) { + return renderingMode.equals(other.renderingMode) + && contextConfiguration.equals(other.contextConfiguration) + && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && headTags.equals(other.headTags) + && filters.equals(other.filters) + && usePageTemplate.equals(other.usePageTemplate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.renderingMode, + this.contextConfiguration, + this.defaultHeadTagsDisabled, + this.headTags, + this.filters, + this.usePageTemplate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional renderingMode = Optional.empty(); + + private Optional> contextConfiguration = Optional.empty(); + + private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + + private Optional> headTags = Optional.empty(); + + private OptionalNullable filters = OptionalNullable.absent(); + + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculResponseContent other) { + renderingMode(other.getRenderingMode()); + contextConfiguration(other.getContextConfiguration()); + defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + headTags(other.getHeadTags()); + filters(other.getFilters()); + usePageTemplate(other.getUsePageTemplate()); + return this; + } + + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public Builder renderingMode(Optional renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + public Builder renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = Optional.ofNullable(renderingMode); + return this; + } + + /** + *

Context values to make available

+ */ + @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) + public Builder contextConfiguration(Optional> contextConfiguration) { + this.contextConfiguration = contextConfiguration; + return this; + } + + public Builder contextConfiguration(List contextConfiguration) { + this.contextConfiguration = Optional.ofNullable(contextConfiguration); + return this; + } + + /** + *

Override Universal Login default head tags

+ */ + @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) + public Builder defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + return this; + } + + public Builder defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled); + return this; + } + + public Builder defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isPresent()) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isNull()) { + this.defaultHeadTagsDisabled = OptionalNullable.ofNull(); + } else if (defaultHeadTagsDisabled.isEmpty()) { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } + return this; + } + + /** + *

An array of head tags

+ */ + @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) + public Builder headTags(Optional> headTags) { + this.headTags = headTags; + return this; + } + + public Builder headTags(List headTags) { + this.headTags = Optional.ofNullable(headTags); + return this; + } + + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(@Nullable OptionalNullable filters) { + this.filters = filters; + return this; + } + + public Builder filters(AculFilters filters) { + this.filters = OptionalNullable.of(filters); + return this; + } + + public Builder filters(Optional filters) { + if (filters.isPresent()) { + this.filters = OptionalNullable.of(filters.get()); + } else { + this.filters = OptionalNullable.absent(); + } + return this; + } + + public Builder filters(com.auth0.client.mgmt.core.Nullable filters) { + if (filters.isNull()) { + this.filters = OptionalNullable.ofNull(); + } else if (filters.isEmpty()) { + this.filters = OptionalNullable.absent(); + } else { + this.filters = OptionalNullable.of(filters.get()); + } + return this; + } + + /** + *

Use page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + + public AculResponseContent build() { + return new AculResponseContent( + renderingMode, + contextConfiguration, + defaultHeadTagsDisabled, + headTags, + filters, + usePageTemplate, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java new file mode 100644 index 000000000..b8d28eec8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java @@ -0,0 +1,229 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AddOrganizationConnectionResponseContent.Builder.class) +public final class AddOrganizationConnectionResponseContent { + private final Optional connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional connection; + + private final Map additionalProperties; + + private AddOrganizationConnectionResponseContent( + Optional connectionId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional connection, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddOrganizationConnectionResponseContent + && equalTo((AddOrganizationConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddOrganizationConnectionResponseContent other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AddOrganizationConnectionResponseContent other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + connection(other.getConnection()); + return this; + } + + /** + *

ID of the connection.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public AddOrganizationConnectionResponseContent build() { + return new AddOrganizationConnectionResponseContent( + connectionId, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + connection, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java new file mode 100644 index 000000000..170d20fbb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java @@ -0,0 +1,251 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssociateOrganizationClientGrantResponseContent.Builder.class) +public final class AssociateOrganizationClientGrantResponseContent { + private final Optional id; + + private final Optional clientId; + + private final Optional audience; + + private final Optional> scope; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final Map additionalProperties; + + private AssociateOrganizationClientGrantResponseContent( + Optional id, + Optional clientId, + Optional audience, + Optional> scope, + Optional organizationUsage, + Optional allowAnyOrganization, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.audience = audience; + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociateOrganizationClientGrantResponseContent + && equalTo((AssociateOrganizationClientGrantResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssociateOrganizationClientGrantResponseContent other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && audience.equals(other.audience) + && scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private Optional allowAnyOrganization = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssociateOrganizationClientGrantResponseContent other) { + id(other.getId()); + clientId(other.getClientId()); + audience(other.getAudience()); + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + return this; + } + + /** + *

ID of the client grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The audience (API identifier) of this client grant

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(OrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + public AssociateOrganizationClientGrantResponseContent build() { + return new AssociateOrganizationClientGrantResponseContent( + id, clientId, audience, scope, organizationUsage, allowAnyOrganization, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java new file mode 100644 index 000000000..57756fa60 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AuthenticationMethodTypeEnum { + public static final AuthenticationMethodTypeEnum TOTP = new AuthenticationMethodTypeEnum(Value.TOTP, "totp"); + + public static final AuthenticationMethodTypeEnum EMAIL = new AuthenticationMethodTypeEnum(Value.EMAIL, "email"); + + public static final AuthenticationMethodTypeEnum PASSKEY = + new AuthenticationMethodTypeEnum(Value.PASSKEY, "passkey"); + + public static final AuthenticationMethodTypeEnum PASSWORD = + new AuthenticationMethodTypeEnum(Value.PASSWORD, "password"); + + public static final AuthenticationMethodTypeEnum WEBAUTHN_PLATFORM = + new AuthenticationMethodTypeEnum(Value.WEBAUTHN_PLATFORM, "webauthn-platform"); + + public static final AuthenticationMethodTypeEnum GUARDIAN = + new AuthenticationMethodTypeEnum(Value.GUARDIAN, "guardian"); + + public static final AuthenticationMethodTypeEnum PHONE = new AuthenticationMethodTypeEnum(Value.PHONE, "phone"); + + public static final AuthenticationMethodTypeEnum EMAIL_VERIFICATION = + new AuthenticationMethodTypeEnum(Value.EMAIL_VERIFICATION, "email-verification"); + + public static final AuthenticationMethodTypeEnum PUSH = new AuthenticationMethodTypeEnum(Value.PUSH, "push"); + + public static final AuthenticationMethodTypeEnum WEBAUTHN_ROAMING = + new AuthenticationMethodTypeEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + public static final AuthenticationMethodTypeEnum RECOVERY_CODE = + new AuthenticationMethodTypeEnum(Value.RECOVERY_CODE, "recovery-code"); + + private final Value value; + + private final String string; + + AuthenticationMethodTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AuthenticationMethodTypeEnum + && this.string.equals(((AuthenticationMethodTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TOTP: + return visitor.visitTotp(); + case EMAIL: + return visitor.visitEmail(); + case PASSKEY: + return visitor.visitPasskey(); + case PASSWORD: + return visitor.visitPassword(); + case WEBAUTHN_PLATFORM: + return visitor.visitWebauthnPlatform(); + case GUARDIAN: + return visitor.visitGuardian(); + case PHONE: + return visitor.visitPhone(); + case EMAIL_VERIFICATION: + return visitor.visitEmailVerification(); + case PUSH: + return visitor.visitPush(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case RECOVERY_CODE: + return visitor.visitRecoveryCode(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AuthenticationMethodTypeEnum valueOf(String value) { + switch (value) { + case "totp": + return TOTP; + case "email": + return EMAIL; + case "passkey": + return PASSKEY; + case "password": + return PASSWORD; + case "webauthn-platform": + return WEBAUTHN_PLATFORM; + case "guardian": + return GUARDIAN; + case "phone": + return PHONE; + case "email-verification": + return EMAIL_VERIFICATION; + case "push": + return PUSH; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + case "recovery-code": + return RECOVERY_CODE; + default: + return new AuthenticationMethodTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RECOVERY_CODE, + + TOTP, + + PUSH, + + PHONE, + + EMAIL, + + EMAIL_VERIFICATION, + + WEBAUTHN_ROAMING, + + WEBAUTHN_PLATFORM, + + GUARDIAN, + + PASSKEY, + + PASSWORD, + + UNKNOWN + } + + public interface Visitor { + T visitRecoveryCode(); + + T visitTotp(); + + T visitPush(); + + T visitPhone(); + + T visitEmail(); + + T visitEmailVerification(); + + T visitWebauthnRoaming(); + + T visitWebauthnPlatform(); + + T visitGuardian(); + + T visitPasskey(); + + T visitPassword(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java new file mode 100644 index 000000000..432c4403f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AuthenticationTypeEnum { + public static final AuthenticationTypeEnum EMAIL = new AuthenticationTypeEnum(Value.EMAIL, "email"); + + public static final AuthenticationTypeEnum TOTP = new AuthenticationTypeEnum(Value.TOTP, "totp"); + + public static final AuthenticationTypeEnum PHONE = new AuthenticationTypeEnum(Value.PHONE, "phone"); + + private final Value value; + + private final String string; + + AuthenticationTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AuthenticationTypeEnum + && this.string.equals(((AuthenticationTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case TOTP: + return visitor.visitTotp(); + case PHONE: + return visitor.visitPhone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AuthenticationTypeEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "totp": + return TOTP; + case "phone": + return PHONE; + default: + return new AuthenticationTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PHONE, + + EMAIL, + + TOTP, + + UNKNOWN + } + + public interface Visitor { + T visitPhone(); + + T visitEmail(); + + T visitTotp(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java new file mode 100644 index 000000000..b8c8027b1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingColors.Builder.class) +public final class BrandingColors { + private final Optional primary; + + private final Optional pageBackground; + + private final Map additionalProperties; + + private BrandingColors( + Optional primary, + Optional pageBackground, + Map additionalProperties) { + this.primary = primary; + this.pageBackground = pageBackground; + this.additionalProperties = additionalProperties; + } + + /** + * @return Accent color. + */ + @JsonProperty("primary") + public Optional getPrimary() { + return primary; + } + + @JsonProperty("page_background") + public Optional getPageBackground() { + return pageBackground; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingColors && equalTo((BrandingColors) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingColors other) { + return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.primary, this.pageBackground); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional primary = Optional.empty(); + + private Optional pageBackground = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BrandingColors other) { + primary(other.getPrimary()); + pageBackground(other.getPageBackground()); + return this; + } + + /** + *

Accent color.

+ */ + @JsonSetter(value = "primary", nulls = Nulls.SKIP) + public Builder primary(Optional primary) { + this.primary = primary; + return this; + } + + public Builder primary(String primary) { + this.primary = Optional.ofNullable(primary); + return this; + } + + @JsonSetter(value = "page_background", nulls = Nulls.SKIP) + public Builder pageBackground(Optional pageBackground) { + this.pageBackground = pageBackground; + return this; + } + + public Builder pageBackground(BrandingPageBackground pageBackground) { + this.pageBackground = Optional.ofNullable(pageBackground); + return this; + } + + public BrandingColors build() { + return new BrandingColors(primary, pageBackground, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java new file mode 100644 index 000000000..4aae99c01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingFont.Builder.class) +public final class BrandingFont { + private final Optional url; + + private final Map additionalProperties; + + private BrandingFont(Optional url, Map additionalProperties) { + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL for the custom font. The URL must point to a font file and not a stylesheet. Must use HTTPS. + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingFont && equalTo((BrandingFont) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingFont other) { + return url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional url = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BrandingFont other) { + url(other.getUrl()); + return this; + } + + /** + *

URL for the custom font. The URL must point to a font file and not a stylesheet. Must use HTTPS.

+ */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + public BrandingFont build() { + return new BrandingFont(url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java new file mode 100644 index 000000000..d8e3bf912 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = BrandingPageBackground.Deserializer.class) +public final class BrandingPageBackground { + private final Object value; + + private final int type; + + private BrandingPageBackground(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visitOptionalNullableString((OptionalNullable) this.value); + } else if (this.type == 1) { + return visitor.visitOptionalNullableMapOfStringToUnknown( + (OptionalNullable>) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingPageBackground && equalTo((BrandingPageBackground) other); + } + + private boolean equalTo(BrandingPageBackground other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static BrandingPageBackground ofOptionalNullableString(OptionalNullable value) { + return new BrandingPageBackground(value, 0); + } + + public static BrandingPageBackground ofOptionalNullableMapOfStringToUnknown( + OptionalNullable> value) { + return new BrandingPageBackground(value, 1); + } + + public interface Visitor { + T visitOptionalNullableString(OptionalNullable value); + + T visitOptionalNullableMapOfStringToUnknown(OptionalNullable> value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BrandingPageBackground.class); + } + + @java.lang.Override + public BrandingPageBackground deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return ofOptionalNullableString(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return ofOptionalNullableMapOfStringToUnknown(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java new file mode 100644 index 000000000..ef00067ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java @@ -0,0 +1,402 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeBorders.Builder.class) +public final class BrandingThemeBorders { + private final double buttonBorderRadius; + + private final double buttonBorderWeight; + + private final BrandingThemeBordersButtonsStyleEnum buttonsStyle; + + private final double inputBorderRadius; + + private final double inputBorderWeight; + + private final BrandingThemeBordersInputsStyleEnum inputsStyle; + + private final boolean showWidgetShadow; + + private final double widgetBorderWeight; + + private final double widgetCornerRadius; + + private final Map additionalProperties; + + private BrandingThemeBorders( + double buttonBorderRadius, + double buttonBorderWeight, + BrandingThemeBordersButtonsStyleEnum buttonsStyle, + double inputBorderRadius, + double inputBorderWeight, + BrandingThemeBordersInputsStyleEnum inputsStyle, + boolean showWidgetShadow, + double widgetBorderWeight, + double widgetCornerRadius, + Map additionalProperties) { + this.buttonBorderRadius = buttonBorderRadius; + this.buttonBorderWeight = buttonBorderWeight; + this.buttonsStyle = buttonsStyle; + this.inputBorderRadius = inputBorderRadius; + this.inputBorderWeight = inputBorderWeight; + this.inputsStyle = inputsStyle; + this.showWidgetShadow = showWidgetShadow; + this.widgetBorderWeight = widgetBorderWeight; + this.widgetCornerRadius = widgetCornerRadius; + this.additionalProperties = additionalProperties; + } + + /** + * @return Button border radius + */ + @JsonProperty("button_border_radius") + public double getButtonBorderRadius() { + return buttonBorderRadius; + } + + /** + * @return Button border weight + */ + @JsonProperty("button_border_weight") + public double getButtonBorderWeight() { + return buttonBorderWeight; + } + + @JsonProperty("buttons_style") + public BrandingThemeBordersButtonsStyleEnum getButtonsStyle() { + return buttonsStyle; + } + + /** + * @return Input border radius + */ + @JsonProperty("input_border_radius") + public double getInputBorderRadius() { + return inputBorderRadius; + } + + /** + * @return Input border weight + */ + @JsonProperty("input_border_weight") + public double getInputBorderWeight() { + return inputBorderWeight; + } + + @JsonProperty("inputs_style") + public BrandingThemeBordersInputsStyleEnum getInputsStyle() { + return inputsStyle; + } + + /** + * @return Show widget shadow + */ + @JsonProperty("show_widget_shadow") + public boolean getShowWidgetShadow() { + return showWidgetShadow; + } + + /** + * @return Widget border weight + */ + @JsonProperty("widget_border_weight") + public double getWidgetBorderWeight() { + return widgetBorderWeight; + } + + /** + * @return Widget corner radius + */ + @JsonProperty("widget_corner_radius") + public double getWidgetCornerRadius() { + return widgetCornerRadius; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeBorders && equalTo((BrandingThemeBorders) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeBorders other) { + return buttonBorderRadius == other.buttonBorderRadius + && buttonBorderWeight == other.buttonBorderWeight + && buttonsStyle.equals(other.buttonsStyle) + && inputBorderRadius == other.inputBorderRadius + && inputBorderWeight == other.inputBorderWeight + && inputsStyle.equals(other.inputsStyle) + && showWidgetShadow == other.showWidgetShadow + && widgetBorderWeight == other.widgetBorderWeight + && widgetCornerRadius == other.widgetCornerRadius; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.buttonBorderRadius, + this.buttonBorderWeight, + this.buttonsStyle, + this.inputBorderRadius, + this.inputBorderWeight, + this.inputsStyle, + this.showWidgetShadow, + this.widgetBorderWeight, + this.widgetCornerRadius); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ButtonBorderRadiusStage builder() { + return new Builder(); + } + + public interface ButtonBorderRadiusStage { + /** + *

Button border radius

+ */ + ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius); + + Builder from(BrandingThemeBorders other); + } + + public interface ButtonBorderWeightStage { + /** + *

Button border weight

+ */ + ButtonsStyleStage buttonBorderWeight(double buttonBorderWeight); + } + + public interface ButtonsStyleStage { + InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsStyleEnum buttonsStyle); + } + + public interface InputBorderRadiusStage { + /** + *

Input border radius

+ */ + InputBorderWeightStage inputBorderRadius(double inputBorderRadius); + } + + public interface InputBorderWeightStage { + /** + *

Input border weight

+ */ + InputsStyleStage inputBorderWeight(double inputBorderWeight); + } + + public interface InputsStyleStage { + ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyleEnum inputsStyle); + } + + public interface ShowWidgetShadowStage { + /** + *

Show widget shadow

+ */ + WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow); + } + + public interface WidgetBorderWeightStage { + /** + *

Widget border weight

+ */ + WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight); + } + + public interface WidgetCornerRadiusStage { + /** + *

Widget corner radius

+ */ + _FinalStage widgetCornerRadius(double widgetCornerRadius); + } + + public interface _FinalStage { + BrandingThemeBorders build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ButtonBorderRadiusStage, + ButtonBorderWeightStage, + ButtonsStyleStage, + InputBorderRadiusStage, + InputBorderWeightStage, + InputsStyleStage, + ShowWidgetShadowStage, + WidgetBorderWeightStage, + WidgetCornerRadiusStage, + _FinalStage { + private double buttonBorderRadius; + + private double buttonBorderWeight; + + private BrandingThemeBordersButtonsStyleEnum buttonsStyle; + + private double inputBorderRadius; + + private double inputBorderWeight; + + private BrandingThemeBordersInputsStyleEnum inputsStyle; + + private boolean showWidgetShadow; + + private double widgetBorderWeight; + + private double widgetCornerRadius; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeBorders other) { + buttonBorderRadius(other.getButtonBorderRadius()); + buttonBorderWeight(other.getButtonBorderWeight()); + buttonsStyle(other.getButtonsStyle()); + inputBorderRadius(other.getInputBorderRadius()); + inputBorderWeight(other.getInputBorderWeight()); + inputsStyle(other.getInputsStyle()); + showWidgetShadow(other.getShowWidgetShadow()); + widgetBorderWeight(other.getWidgetBorderWeight()); + widgetCornerRadius(other.getWidgetCornerRadius()); + return this; + } + + /** + *

Button border radius

+ *

Button border radius

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("button_border_radius") + public ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius) { + this.buttonBorderRadius = buttonBorderRadius; + return this; + } + + /** + *

Button border weight

+ *

Button border weight

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("button_border_weight") + public ButtonsStyleStage buttonBorderWeight(double buttonBorderWeight) { + this.buttonBorderWeight = buttonBorderWeight; + return this; + } + + @java.lang.Override + @JsonSetter("buttons_style") + public InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsStyleEnum buttonsStyle) { + this.buttonsStyle = Objects.requireNonNull(buttonsStyle, "buttonsStyle must not be null"); + return this; + } + + /** + *

Input border radius

+ *

Input border radius

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_border_radius") + public InputBorderWeightStage inputBorderRadius(double inputBorderRadius) { + this.inputBorderRadius = inputBorderRadius; + return this; + } + + /** + *

Input border weight

+ *

Input border weight

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_border_weight") + public InputsStyleStage inputBorderWeight(double inputBorderWeight) { + this.inputBorderWeight = inputBorderWeight; + return this; + } + + @java.lang.Override + @JsonSetter("inputs_style") + public ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyleEnum inputsStyle) { + this.inputsStyle = Objects.requireNonNull(inputsStyle, "inputsStyle must not be null"); + return this; + } + + /** + *

Show widget shadow

+ *

Show widget shadow

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("show_widget_shadow") + public WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow) { + this.showWidgetShadow = showWidgetShadow; + return this; + } + + /** + *

Widget border weight

+ *

Widget border weight

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("widget_border_weight") + public WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight) { + this.widgetBorderWeight = widgetBorderWeight; + return this; + } + + /** + *

Widget corner radius

+ *

Widget corner radius

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("widget_corner_radius") + public _FinalStage widgetCornerRadius(double widgetCornerRadius) { + this.widgetCornerRadius = widgetCornerRadius; + return this; + } + + @java.lang.Override + public BrandingThemeBorders build() { + return new BrandingThemeBorders( + buttonBorderRadius, + buttonBorderWeight, + buttonsStyle, + inputBorderRadius, + inputBorderWeight, + inputsStyle, + showWidgetShadow, + widgetBorderWeight, + widgetCornerRadius, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java new file mode 100644 index 000000000..0b79c632a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeBordersButtonsStyleEnum { + public static final BrandingThemeBordersButtonsStyleEnum SHARP = + new BrandingThemeBordersButtonsStyleEnum(Value.SHARP, "sharp"); + + public static final BrandingThemeBordersButtonsStyleEnum ROUNDED = + new BrandingThemeBordersButtonsStyleEnum(Value.ROUNDED, "rounded"); + + public static final BrandingThemeBordersButtonsStyleEnum PILL = + new BrandingThemeBordersButtonsStyleEnum(Value.PILL, "pill"); + + private final Value value; + + private final String string; + + BrandingThemeBordersButtonsStyleEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeBordersButtonsStyleEnum + && this.string.equals(((BrandingThemeBordersButtonsStyleEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHARP: + return visitor.visitSharp(); + case ROUNDED: + return visitor.visitRounded(); + case PILL: + return visitor.visitPill(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeBordersButtonsStyleEnum valueOf(String value) { + switch (value) { + case "sharp": + return SHARP; + case "rounded": + return ROUNDED; + case "pill": + return PILL; + default: + return new BrandingThemeBordersButtonsStyleEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PILL, + + ROUNDED, + + SHARP, + + UNKNOWN + } + + public interface Visitor { + T visitPill(); + + T visitRounded(); + + T visitSharp(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java new file mode 100644 index 000000000..f100e8fe6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeBordersInputsStyleEnum { + public static final BrandingThemeBordersInputsStyleEnum SHARP = + new BrandingThemeBordersInputsStyleEnum(Value.SHARP, "sharp"); + + public static final BrandingThemeBordersInputsStyleEnum ROUNDED = + new BrandingThemeBordersInputsStyleEnum(Value.ROUNDED, "rounded"); + + public static final BrandingThemeBordersInputsStyleEnum PILL = + new BrandingThemeBordersInputsStyleEnum(Value.PILL, "pill"); + + private final Value value; + + private final String string; + + BrandingThemeBordersInputsStyleEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeBordersInputsStyleEnum + && this.string.equals(((BrandingThemeBordersInputsStyleEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHARP: + return visitor.visitSharp(); + case ROUNDED: + return visitor.visitRounded(); + case PILL: + return visitor.visitPill(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeBordersInputsStyleEnum valueOf(String value) { + switch (value) { + case "sharp": + return SHARP; + case "rounded": + return ROUNDED; + case "pill": + return PILL; + default: + return new BrandingThemeBordersInputsStyleEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PILL, + + ROUNDED, + + SHARP, + + UNKNOWN + } + + public interface Visitor { + T visitPill(); + + T visitRounded(); + + T visitSharp(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java new file mode 100644 index 000000000..141a2ce34 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java @@ -0,0 +1,863 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeColors.Builder.class) +public final class BrandingThemeColors { + private final Optional baseFocusColor; + + private final Optional baseHoverColor; + + private final String bodyText; + + private final Optional captchaWidgetTheme; + + private final String error; + + private final String header; + + private final String icons; + + private final String inputBackground; + + private final String inputBorder; + + private final String inputFilledText; + + private final String inputLabelsPlaceholders; + + private final String linksFocusedComponents; + + private final String primaryButton; + + private final String primaryButtonLabel; + + private final Optional readOnlyBackground; + + private final String secondaryButtonBorder; + + private final String secondaryButtonLabel; + + private final String success; + + private final String widgetBackground; + + private final String widgetBorder; + + private final Map additionalProperties; + + private BrandingThemeColors( + Optional baseFocusColor, + Optional baseHoverColor, + String bodyText, + Optional captchaWidgetTheme, + String error, + String header, + String icons, + String inputBackground, + String inputBorder, + String inputFilledText, + String inputLabelsPlaceholders, + String linksFocusedComponents, + String primaryButton, + String primaryButtonLabel, + Optional readOnlyBackground, + String secondaryButtonBorder, + String secondaryButtonLabel, + String success, + String widgetBackground, + String widgetBorder, + Map additionalProperties) { + this.baseFocusColor = baseFocusColor; + this.baseHoverColor = baseHoverColor; + this.bodyText = bodyText; + this.captchaWidgetTheme = captchaWidgetTheme; + this.error = error; + this.header = header; + this.icons = icons; + this.inputBackground = inputBackground; + this.inputBorder = inputBorder; + this.inputFilledText = inputFilledText; + this.inputLabelsPlaceholders = inputLabelsPlaceholders; + this.linksFocusedComponents = linksFocusedComponents; + this.primaryButton = primaryButton; + this.primaryButtonLabel = primaryButtonLabel; + this.readOnlyBackground = readOnlyBackground; + this.secondaryButtonBorder = secondaryButtonBorder; + this.secondaryButtonLabel = secondaryButtonLabel; + this.success = success; + this.widgetBackground = widgetBackground; + this.widgetBorder = widgetBorder; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base Focus Color + */ + @JsonProperty("base_focus_color") + public Optional getBaseFocusColor() { + return baseFocusColor; + } + + /** + * @return Base Hover Color + */ + @JsonProperty("base_hover_color") + public Optional getBaseHoverColor() { + return baseHoverColor; + } + + /** + * @return Body text + */ + @JsonProperty("body_text") + public String getBodyText() { + return bodyText; + } + + @JsonProperty("captcha_widget_theme") + public Optional getCaptchaWidgetTheme() { + return captchaWidgetTheme; + } + + /** + * @return Error + */ + @JsonProperty("error") + public String getError() { + return error; + } + + /** + * @return Header + */ + @JsonProperty("header") + public String getHeader() { + return header; + } + + /** + * @return Icons + */ + @JsonProperty("icons") + public String getIcons() { + return icons; + } + + /** + * @return Input background + */ + @JsonProperty("input_background") + public String getInputBackground() { + return inputBackground; + } + + /** + * @return Input border + */ + @JsonProperty("input_border") + public String getInputBorder() { + return inputBorder; + } + + /** + * @return Input filled text + */ + @JsonProperty("input_filled_text") + public String getInputFilledText() { + return inputFilledText; + } + + /** + * @return Input labels & placeholders + */ + @JsonProperty("input_labels_placeholders") + public String getInputLabelsPlaceholders() { + return inputLabelsPlaceholders; + } + + /** + * @return Links & focused components + */ + @JsonProperty("links_focused_components") + public String getLinksFocusedComponents() { + return linksFocusedComponents; + } + + /** + * @return Primary button + */ + @JsonProperty("primary_button") + public String getPrimaryButton() { + return primaryButton; + } + + /** + * @return Primary button label + */ + @JsonProperty("primary_button_label") + public String getPrimaryButtonLabel() { + return primaryButtonLabel; + } + + /** + * @return Read only background + */ + @JsonProperty("read_only_background") + public Optional getReadOnlyBackground() { + return readOnlyBackground; + } + + /** + * @return Secondary button border + */ + @JsonProperty("secondary_button_border") + public String getSecondaryButtonBorder() { + return secondaryButtonBorder; + } + + /** + * @return Secondary button label + */ + @JsonProperty("secondary_button_label") + public String getSecondaryButtonLabel() { + return secondaryButtonLabel; + } + + /** + * @return Success + */ + @JsonProperty("success") + public String getSuccess() { + return success; + } + + /** + * @return Widget background + */ + @JsonProperty("widget_background") + public String getWidgetBackground() { + return widgetBackground; + } + + /** + * @return Widget border + */ + @JsonProperty("widget_border") + public String getWidgetBorder() { + return widgetBorder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeColors && equalTo((BrandingThemeColors) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeColors other) { + return baseFocusColor.equals(other.baseFocusColor) + && baseHoverColor.equals(other.baseHoverColor) + && bodyText.equals(other.bodyText) + && captchaWidgetTheme.equals(other.captchaWidgetTheme) + && error.equals(other.error) + && header.equals(other.header) + && icons.equals(other.icons) + && inputBackground.equals(other.inputBackground) + && inputBorder.equals(other.inputBorder) + && inputFilledText.equals(other.inputFilledText) + && inputLabelsPlaceholders.equals(other.inputLabelsPlaceholders) + && linksFocusedComponents.equals(other.linksFocusedComponents) + && primaryButton.equals(other.primaryButton) + && primaryButtonLabel.equals(other.primaryButtonLabel) + && readOnlyBackground.equals(other.readOnlyBackground) + && secondaryButtonBorder.equals(other.secondaryButtonBorder) + && secondaryButtonLabel.equals(other.secondaryButtonLabel) + && success.equals(other.success) + && widgetBackground.equals(other.widgetBackground) + && widgetBorder.equals(other.widgetBorder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.baseFocusColor, + this.baseHoverColor, + this.bodyText, + this.captchaWidgetTheme, + this.error, + this.header, + this.icons, + this.inputBackground, + this.inputBorder, + this.inputFilledText, + this.inputLabelsPlaceholders, + this.linksFocusedComponents, + this.primaryButton, + this.primaryButtonLabel, + this.readOnlyBackground, + this.secondaryButtonBorder, + this.secondaryButtonLabel, + this.success, + this.widgetBackground, + this.widgetBorder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyTextStage builder() { + return new Builder(); + } + + public interface BodyTextStage { + /** + *

Body text

+ */ + ErrorStage bodyText(@NotNull String bodyText); + + Builder from(BrandingThemeColors other); + } + + public interface ErrorStage { + /** + *

Error

+ */ + HeaderStage error(@NotNull String error); + } + + public interface HeaderStage { + /** + *

Header

+ */ + IconsStage header(@NotNull String header); + } + + public interface IconsStage { + /** + *

Icons

+ */ + InputBackgroundStage icons(@NotNull String icons); + } + + public interface InputBackgroundStage { + /** + *

Input background

+ */ + InputBorderStage inputBackground(@NotNull String inputBackground); + } + + public interface InputBorderStage { + /** + *

Input border

+ */ + InputFilledTextStage inputBorder(@NotNull String inputBorder); + } + + public interface InputFilledTextStage { + /** + *

Input filled text

+ */ + InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledText); + } + + public interface InputLabelsPlaceholdersStage { + /** + *

Input labels & placeholders

+ */ + LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String inputLabelsPlaceholders); + } + + public interface LinksFocusedComponentsStage { + /** + *

Links & focused components

+ */ + PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedComponents); + } + + public interface PrimaryButtonStage { + /** + *

Primary button

+ */ + PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton); + } + + public interface PrimaryButtonLabelStage { + /** + *

Primary button label

+ */ + SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButtonLabel); + } + + public interface SecondaryButtonBorderStage { + /** + *

Secondary button border

+ */ + SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondaryButtonBorder); + } + + public interface SecondaryButtonLabelStage { + /** + *

Secondary button label

+ */ + SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel); + } + + public interface SuccessStage { + /** + *

Success

+ */ + WidgetBackgroundStage success(@NotNull String success); + } + + public interface WidgetBackgroundStage { + /** + *

Widget background

+ */ + WidgetBorderStage widgetBackground(@NotNull String widgetBackground); + } + + public interface WidgetBorderStage { + /** + *

Widget border

+ */ + _FinalStage widgetBorder(@NotNull String widgetBorder); + } + + public interface _FinalStage { + BrandingThemeColors build(); + + /** + *

Base Focus Color

+ */ + _FinalStage baseFocusColor(Optional baseFocusColor); + + _FinalStage baseFocusColor(String baseFocusColor); + + /** + *

Base Hover Color

+ */ + _FinalStage baseHoverColor(Optional baseHoverColor); + + _FinalStage baseHoverColor(String baseHoverColor); + + _FinalStage captchaWidgetTheme(Optional captchaWidgetTheme); + + _FinalStage captchaWidgetTheme(BrandingThemeColorsCaptchaWidgetThemeEnum captchaWidgetTheme); + + /** + *

Read only background

+ */ + _FinalStage readOnlyBackground(Optional readOnlyBackground); + + _FinalStage readOnlyBackground(String readOnlyBackground); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BodyTextStage, + ErrorStage, + HeaderStage, + IconsStage, + InputBackgroundStage, + InputBorderStage, + InputFilledTextStage, + InputLabelsPlaceholdersStage, + LinksFocusedComponentsStage, + PrimaryButtonStage, + PrimaryButtonLabelStage, + SecondaryButtonBorderStage, + SecondaryButtonLabelStage, + SuccessStage, + WidgetBackgroundStage, + WidgetBorderStage, + _FinalStage { + private String bodyText; + + private String error; + + private String header; + + private String icons; + + private String inputBackground; + + private String inputBorder; + + private String inputFilledText; + + private String inputLabelsPlaceholders; + + private String linksFocusedComponents; + + private String primaryButton; + + private String primaryButtonLabel; + + private String secondaryButtonBorder; + + private String secondaryButtonLabel; + + private String success; + + private String widgetBackground; + + private String widgetBorder; + + private Optional readOnlyBackground = Optional.empty(); + + private Optional captchaWidgetTheme = Optional.empty(); + + private Optional baseHoverColor = Optional.empty(); + + private Optional baseFocusColor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeColors other) { + baseFocusColor(other.getBaseFocusColor()); + baseHoverColor(other.getBaseHoverColor()); + bodyText(other.getBodyText()); + captchaWidgetTheme(other.getCaptchaWidgetTheme()); + error(other.getError()); + header(other.getHeader()); + icons(other.getIcons()); + inputBackground(other.getInputBackground()); + inputBorder(other.getInputBorder()); + inputFilledText(other.getInputFilledText()); + inputLabelsPlaceholders(other.getInputLabelsPlaceholders()); + linksFocusedComponents(other.getLinksFocusedComponents()); + primaryButton(other.getPrimaryButton()); + primaryButtonLabel(other.getPrimaryButtonLabel()); + readOnlyBackground(other.getReadOnlyBackground()); + secondaryButtonBorder(other.getSecondaryButtonBorder()); + secondaryButtonLabel(other.getSecondaryButtonLabel()); + success(other.getSuccess()); + widgetBackground(other.getWidgetBackground()); + widgetBorder(other.getWidgetBorder()); + return this; + } + + /** + *

Body text

+ *

Body text

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("body_text") + public ErrorStage bodyText(@NotNull String bodyText) { + this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); + return this; + } + + /** + *

Error

+ *

Error

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("error") + public HeaderStage error(@NotNull String error) { + this.error = Objects.requireNonNull(error, "error must not be null"); + return this; + } + + /** + *

Header

+ *

Header

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("header") + public IconsStage header(@NotNull String header) { + this.header = Objects.requireNonNull(header, "header must not be null"); + return this; + } + + /** + *

Icons

+ *

Icons

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("icons") + public InputBackgroundStage icons(@NotNull String icons) { + this.icons = Objects.requireNonNull(icons, "icons must not be null"); + return this; + } + + /** + *

Input background

+ *

Input background

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_background") + public InputBorderStage inputBackground(@NotNull String inputBackground) { + this.inputBackground = Objects.requireNonNull(inputBackground, "inputBackground must not be null"); + return this; + } + + /** + *

Input border

+ *

Input border

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_border") + public InputFilledTextStage inputBorder(@NotNull String inputBorder) { + this.inputBorder = Objects.requireNonNull(inputBorder, "inputBorder must not be null"); + return this; + } + + /** + *

Input filled text

+ *

Input filled text

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_filled_text") + public InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledText) { + this.inputFilledText = Objects.requireNonNull(inputFilledText, "inputFilledText must not be null"); + return this; + } + + /** + *

Input labels & placeholders

+ *

Input labels & placeholders

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("input_labels_placeholders") + public LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String inputLabelsPlaceholders) { + this.inputLabelsPlaceholders = + Objects.requireNonNull(inputLabelsPlaceholders, "inputLabelsPlaceholders must not be null"); + return this; + } + + /** + *

Links & focused components

+ *

Links & focused components

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("links_focused_components") + public PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedComponents) { + this.linksFocusedComponents = + Objects.requireNonNull(linksFocusedComponents, "linksFocusedComponents must not be null"); + return this; + } + + /** + *

Primary button

+ *

Primary button

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary_button") + public PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton) { + this.primaryButton = Objects.requireNonNull(primaryButton, "primaryButton must not be null"); + return this; + } + + /** + *

Primary button label

+ *

Primary button label

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary_button_label") + public SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButtonLabel) { + this.primaryButtonLabel = Objects.requireNonNull(primaryButtonLabel, "primaryButtonLabel must not be null"); + return this; + } + + /** + *

Secondary button border

+ *

Secondary button border

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("secondary_button_border") + public SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondaryButtonBorder) { + this.secondaryButtonBorder = + Objects.requireNonNull(secondaryButtonBorder, "secondaryButtonBorder must not be null"); + return this; + } + + /** + *

Secondary button label

+ *

Secondary button label

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("secondary_button_label") + public SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel) { + this.secondaryButtonLabel = + Objects.requireNonNull(secondaryButtonLabel, "secondaryButtonLabel must not be null"); + return this; + } + + /** + *

Success

+ *

Success

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("success") + public WidgetBackgroundStage success(@NotNull String success) { + this.success = Objects.requireNonNull(success, "success must not be null"); + return this; + } + + /** + *

Widget background

+ *

Widget background

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("widget_background") + public WidgetBorderStage widgetBackground(@NotNull String widgetBackground) { + this.widgetBackground = Objects.requireNonNull(widgetBackground, "widgetBackground must not be null"); + return this; + } + + /** + *

Widget border

+ *

Widget border

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("widget_border") + public _FinalStage widgetBorder(@NotNull String widgetBorder) { + this.widgetBorder = Objects.requireNonNull(widgetBorder, "widgetBorder must not be null"); + return this; + } + + /** + *

Read only background

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage readOnlyBackground(String readOnlyBackground) { + this.readOnlyBackground = Optional.ofNullable(readOnlyBackground); + return this; + } + + /** + *

Read only background

+ */ + @java.lang.Override + @JsonSetter(value = "read_only_background", nulls = Nulls.SKIP) + public _FinalStage readOnlyBackground(Optional readOnlyBackground) { + this.readOnlyBackground = readOnlyBackground; + return this; + } + + @java.lang.Override + public _FinalStage captchaWidgetTheme(BrandingThemeColorsCaptchaWidgetThemeEnum captchaWidgetTheme) { + this.captchaWidgetTheme = Optional.ofNullable(captchaWidgetTheme); + return this; + } + + @java.lang.Override + @JsonSetter(value = "captcha_widget_theme", nulls = Nulls.SKIP) + public _FinalStage captchaWidgetTheme(Optional captchaWidgetTheme) { + this.captchaWidgetTheme = captchaWidgetTheme; + return this; + } + + /** + *

Base Hover Color

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseHoverColor(String baseHoverColor) { + this.baseHoverColor = Optional.ofNullable(baseHoverColor); + return this; + } + + /** + *

Base Hover Color

+ */ + @java.lang.Override + @JsonSetter(value = "base_hover_color", nulls = Nulls.SKIP) + public _FinalStage baseHoverColor(Optional baseHoverColor) { + this.baseHoverColor = baseHoverColor; + return this; + } + + /** + *

Base Focus Color

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseFocusColor(String baseFocusColor) { + this.baseFocusColor = Optional.ofNullable(baseFocusColor); + return this; + } + + /** + *

Base Focus Color

+ */ + @java.lang.Override + @JsonSetter(value = "base_focus_color", nulls = Nulls.SKIP) + public _FinalStage baseFocusColor(Optional baseFocusColor) { + this.baseFocusColor = baseFocusColor; + return this; + } + + @java.lang.Override + public BrandingThemeColors build() { + return new BrandingThemeColors( + baseFocusColor, + baseHoverColor, + bodyText, + captchaWidgetTheme, + error, + header, + icons, + inputBackground, + inputBorder, + inputFilledText, + inputLabelsPlaceholders, + linksFocusedComponents, + primaryButton, + primaryButtonLabel, + readOnlyBackground, + secondaryButtonBorder, + secondaryButtonLabel, + success, + widgetBackground, + widgetBorder, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java new file mode 100644 index 000000000..2fe77ddab --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeColorsCaptchaWidgetThemeEnum { + public static final BrandingThemeColorsCaptchaWidgetThemeEnum AUTO = + new BrandingThemeColorsCaptchaWidgetThemeEnum(Value.AUTO, "auto"); + + public static final BrandingThemeColorsCaptchaWidgetThemeEnum LIGHT = + new BrandingThemeColorsCaptchaWidgetThemeEnum(Value.LIGHT, "light"); + + public static final BrandingThemeColorsCaptchaWidgetThemeEnum DARK = + new BrandingThemeColorsCaptchaWidgetThemeEnum(Value.DARK, "dark"); + + private final Value value; + + private final String string; + + BrandingThemeColorsCaptchaWidgetThemeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeColorsCaptchaWidgetThemeEnum + && this.string.equals(((BrandingThemeColorsCaptchaWidgetThemeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case LIGHT: + return visitor.visitLight(); + case DARK: + return visitor.visitDark(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeColorsCaptchaWidgetThemeEnum valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "light": + return LIGHT; + case "dark": + return DARK; + default: + return new BrandingThemeColorsCaptchaWidgetThemeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + DARK, + + LIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitDark(); + + T visitLight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java new file mode 100644 index 000000000..8f8c99d0d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontBodyText.Builder.class) +public final class BrandingThemeFontBodyText { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontBodyText(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Body text bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Body text size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontBodyText && equalTo((BrandingThemeFontBodyText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontBodyText other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Body text bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontBodyText other); + } + + public interface SizeStage { + /** + *

Body text size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontBodyText build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontBodyText other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Body text bold

+ *

Body text bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Body text size

+ *

Body text size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontBodyText build() { + return new BrandingThemeFontBodyText(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java new file mode 100644 index 000000000..71b1c2355 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontButtonsText.Builder.class) +public final class BrandingThemeFontButtonsText { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontButtonsText(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Buttons text bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Buttons text size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontButtonsText && equalTo((BrandingThemeFontButtonsText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontButtonsText other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Buttons text bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontButtonsText other); + } + + public interface SizeStage { + /** + *

Buttons text size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontButtonsText build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontButtonsText other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Buttons text bold

+ *

Buttons text bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Buttons text size

+ *

Buttons text size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontButtonsText build() { + return new BrandingThemeFontButtonsText(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java new file mode 100644 index 000000000..b29399903 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontInputLabels.Builder.class) +public final class BrandingThemeFontInputLabels { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontInputLabels(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Input Labels bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Input Labels size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontInputLabels && equalTo((BrandingThemeFontInputLabels) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontInputLabels other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Input Labels bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontInputLabels other); + } + + public interface SizeStage { + /** + *

Input Labels size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontInputLabels build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontInputLabels other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Input Labels bold

+ *

Input Labels bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Input Labels size

+ *

Input Labels size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontInputLabels build() { + return new BrandingThemeFontInputLabels(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java new file mode 100644 index 000000000..2d0535c8f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontLinks.Builder.class) +public final class BrandingThemeFontLinks { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontLinks(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Links bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Links size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontLinks && equalTo((BrandingThemeFontLinks) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontLinks other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Links bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontLinks other); + } + + public interface SizeStage { + /** + *

Links size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontLinks build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontLinks other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Links bold

+ *

Links bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Links size

+ *

Links size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontLinks build() { + return new BrandingThemeFontLinks(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java new file mode 100644 index 000000000..ff7178577 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeFontLinksStyleEnum { + public static final BrandingThemeFontLinksStyleEnum NORMAL = + new BrandingThemeFontLinksStyleEnum(Value.NORMAL, "normal"); + + public static final BrandingThemeFontLinksStyleEnum UNDERLINED = + new BrandingThemeFontLinksStyleEnum(Value.UNDERLINED, "underlined"); + + private final Value value; + + private final String string; + + BrandingThemeFontLinksStyleEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeFontLinksStyleEnum + && this.string.equals(((BrandingThemeFontLinksStyleEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NORMAL: + return visitor.visitNormal(); + case UNDERLINED: + return visitor.visitUnderlined(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeFontLinksStyleEnum valueOf(String value) { + switch (value) { + case "normal": + return NORMAL; + case "underlined": + return UNDERLINED; + default: + return new BrandingThemeFontLinksStyleEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NORMAL, + + UNDERLINED, + + UNKNOWN + } + + public interface Visitor { + T visitNormal(); + + T visitUnderlined(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java new file mode 100644 index 000000000..a665fc7d0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontSubtitle.Builder.class) +public final class BrandingThemeFontSubtitle { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontSubtitle(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Subtitle bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Subtitle size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontSubtitle && equalTo((BrandingThemeFontSubtitle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontSubtitle other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Subtitle bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontSubtitle other); + } + + public interface SizeStage { + /** + *

Subtitle size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontSubtitle build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontSubtitle other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Subtitle bold

+ *

Subtitle bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Subtitle size

+ *

Subtitle size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontSubtitle build() { + return new BrandingThemeFontSubtitle(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java new file mode 100644 index 000000000..3e39a7c76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFontTitle.Builder.class) +public final class BrandingThemeFontTitle { + private final boolean bold; + + private final double size; + + private final Map additionalProperties; + + private BrandingThemeFontTitle(boolean bold, double size, Map additionalProperties) { + this.bold = bold; + this.size = size; + this.additionalProperties = additionalProperties; + } + + /** + * @return Title bold + */ + @JsonProperty("bold") + public boolean getBold() { + return bold; + } + + /** + * @return Title size + */ + @JsonProperty("size") + public double getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFontTitle && equalTo((BrandingThemeFontTitle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFontTitle other) { + return bold == other.bold && size == other.size; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bold, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BoldStage builder() { + return new Builder(); + } + + public interface BoldStage { + /** + *

Title bold

+ */ + SizeStage bold(boolean bold); + + Builder from(BrandingThemeFontTitle other); + } + + public interface SizeStage { + /** + *

Title size

+ */ + _FinalStage size(double size); + } + + public interface _FinalStage { + BrandingThemeFontTitle build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BoldStage, SizeStage, _FinalStage { + private boolean bold; + + private double size; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFontTitle other) { + bold(other.getBold()); + size(other.getSize()); + return this; + } + + /** + *

Title bold

+ *

Title bold

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("bold") + public SizeStage bold(boolean bold) { + this.bold = bold; + return this; + } + + /** + *

Title size

+ *

Title size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("size") + public _FinalStage size(double size) { + this.size = size; + return this; + } + + @java.lang.Override + public BrandingThemeFontTitle build() { + return new BrandingThemeFontTitle(bold, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java new file mode 100644 index 000000000..675546673 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java @@ -0,0 +1,347 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeFonts.Builder.class) +public final class BrandingThemeFonts { + private final BrandingThemeFontBodyText bodyText; + + private final BrandingThemeFontButtonsText buttonsText; + + private final String fontUrl; + + private final BrandingThemeFontInputLabels inputLabels; + + private final BrandingThemeFontLinks links; + + private final BrandingThemeFontLinksStyleEnum linksStyle; + + private final double referenceTextSize; + + private final BrandingThemeFontSubtitle subtitle; + + private final BrandingThemeFontTitle title; + + private final Map additionalProperties; + + private BrandingThemeFonts( + BrandingThemeFontBodyText bodyText, + BrandingThemeFontButtonsText buttonsText, + String fontUrl, + BrandingThemeFontInputLabels inputLabels, + BrandingThemeFontLinks links, + BrandingThemeFontLinksStyleEnum linksStyle, + double referenceTextSize, + BrandingThemeFontSubtitle subtitle, + BrandingThemeFontTitle title, + Map additionalProperties) { + this.bodyText = bodyText; + this.buttonsText = buttonsText; + this.fontUrl = fontUrl; + this.inputLabels = inputLabels; + this.links = links; + this.linksStyle = linksStyle; + this.referenceTextSize = referenceTextSize; + this.subtitle = subtitle; + this.title = title; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body_text") + public BrandingThemeFontBodyText getBodyText() { + return bodyText; + } + + @JsonProperty("buttons_text") + public BrandingThemeFontButtonsText getButtonsText() { + return buttonsText; + } + + /** + * @return Font URL + */ + @JsonProperty("font_url") + public String getFontUrl() { + return fontUrl; + } + + @JsonProperty("input_labels") + public BrandingThemeFontInputLabels getInputLabels() { + return inputLabels; + } + + @JsonProperty("links") + public BrandingThemeFontLinks getLinks() { + return links; + } + + @JsonProperty("links_style") + public BrandingThemeFontLinksStyleEnum getLinksStyle() { + return linksStyle; + } + + /** + * @return Reference text size + */ + @JsonProperty("reference_text_size") + public double getReferenceTextSize() { + return referenceTextSize; + } + + @JsonProperty("subtitle") + public BrandingThemeFontSubtitle getSubtitle() { + return subtitle; + } + + @JsonProperty("title") + public BrandingThemeFontTitle getTitle() { + return title; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeFonts && equalTo((BrandingThemeFonts) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeFonts other) { + return bodyText.equals(other.bodyText) + && buttonsText.equals(other.buttonsText) + && fontUrl.equals(other.fontUrl) + && inputLabels.equals(other.inputLabels) + && links.equals(other.links) + && linksStyle.equals(other.linksStyle) + && referenceTextSize == other.referenceTextSize + && subtitle.equals(other.subtitle) + && title.equals(other.title); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.bodyText, + this.buttonsText, + this.fontUrl, + this.inputLabels, + this.links, + this.linksStyle, + this.referenceTextSize, + this.subtitle, + this.title); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyTextStage builder() { + return new Builder(); + } + + public interface BodyTextStage { + ButtonsTextStage bodyText(@NotNull BrandingThemeFontBodyText bodyText); + + Builder from(BrandingThemeFonts other); + } + + public interface ButtonsTextStage { + FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsText); + } + + public interface FontUrlStage { + /** + *

Font URL

+ */ + InputLabelsStage fontUrl(@NotNull String fontUrl); + } + + public interface InputLabelsStage { + LinksStage inputLabels(@NotNull BrandingThemeFontInputLabels inputLabels); + } + + public interface LinksStage { + LinksStyleStage links(@NotNull BrandingThemeFontLinks links); + } + + public interface LinksStyleStage { + ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnum linksStyle); + } + + public interface ReferenceTextSizeStage { + /** + *

Reference text size

+ */ + SubtitleStage referenceTextSize(double referenceTextSize); + } + + public interface SubtitleStage { + TitleStage subtitle(@NotNull BrandingThemeFontSubtitle subtitle); + } + + public interface TitleStage { + _FinalStage title(@NotNull BrandingThemeFontTitle title); + } + + public interface _FinalStage { + BrandingThemeFonts build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BodyTextStage, + ButtonsTextStage, + FontUrlStage, + InputLabelsStage, + LinksStage, + LinksStyleStage, + ReferenceTextSizeStage, + SubtitleStage, + TitleStage, + _FinalStage { + private BrandingThemeFontBodyText bodyText; + + private BrandingThemeFontButtonsText buttonsText; + + private String fontUrl; + + private BrandingThemeFontInputLabels inputLabels; + + private BrandingThemeFontLinks links; + + private BrandingThemeFontLinksStyleEnum linksStyle; + + private double referenceTextSize; + + private BrandingThemeFontSubtitle subtitle; + + private BrandingThemeFontTitle title; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeFonts other) { + bodyText(other.getBodyText()); + buttonsText(other.getButtonsText()); + fontUrl(other.getFontUrl()); + inputLabels(other.getInputLabels()); + links(other.getLinks()); + linksStyle(other.getLinksStyle()); + referenceTextSize(other.getReferenceTextSize()); + subtitle(other.getSubtitle()); + title(other.getTitle()); + return this; + } + + @java.lang.Override + @JsonSetter("body_text") + public ButtonsTextStage bodyText(@NotNull BrandingThemeFontBodyText bodyText) { + this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("buttons_text") + public FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsText) { + this.buttonsText = Objects.requireNonNull(buttonsText, "buttonsText must not be null"); + return this; + } + + /** + *

Font URL

+ *

Font URL

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("font_url") + public InputLabelsStage fontUrl(@NotNull String fontUrl) { + this.fontUrl = Objects.requireNonNull(fontUrl, "fontUrl must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("input_labels") + public LinksStage inputLabels(@NotNull BrandingThemeFontInputLabels inputLabels) { + this.inputLabels = Objects.requireNonNull(inputLabels, "inputLabels must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("links") + public LinksStyleStage links(@NotNull BrandingThemeFontLinks links) { + this.links = Objects.requireNonNull(links, "links must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("links_style") + public ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnum linksStyle) { + this.linksStyle = Objects.requireNonNull(linksStyle, "linksStyle must not be null"); + return this; + } + + /** + *

Reference text size

+ *

Reference text size

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("reference_text_size") + public SubtitleStage referenceTextSize(double referenceTextSize) { + this.referenceTextSize = referenceTextSize; + return this; + } + + @java.lang.Override + @JsonSetter("subtitle") + public TitleStage subtitle(@NotNull BrandingThemeFontSubtitle subtitle) { + this.subtitle = Objects.requireNonNull(subtitle, "subtitle must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public _FinalStage title(@NotNull BrandingThemeFontTitle title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + @java.lang.Override + public BrandingThemeFonts build() { + return new BrandingThemeFonts( + bodyText, + buttonsText, + fontUrl, + inputLabels, + links, + linksStyle, + referenceTextSize, + subtitle, + title, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java new file mode 100644 index 000000000..d3f95c3c6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemePageBackground.Builder.class) +public final class BrandingThemePageBackground { + private final String backgroundColor; + + private final String backgroundImageUrl; + + private final BrandingThemePageBackgroundPageLayoutEnum pageLayout; + + private final Map additionalProperties; + + private BrandingThemePageBackground( + String backgroundColor, + String backgroundImageUrl, + BrandingThemePageBackgroundPageLayoutEnum pageLayout, + Map additionalProperties) { + this.backgroundColor = backgroundColor; + this.backgroundImageUrl = backgroundImageUrl; + this.pageLayout = pageLayout; + this.additionalProperties = additionalProperties; + } + + /** + * @return Background color + */ + @JsonProperty("background_color") + public String getBackgroundColor() { + return backgroundColor; + } + + /** + * @return Background image url + */ + @JsonProperty("background_image_url") + public String getBackgroundImageUrl() { + return backgroundImageUrl; + } + + @JsonProperty("page_layout") + public BrandingThemePageBackgroundPageLayoutEnum getPageLayout() { + return pageLayout; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemePageBackground && equalTo((BrandingThemePageBackground) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemePageBackground other) { + return backgroundColor.equals(other.backgroundColor) + && backgroundImageUrl.equals(other.backgroundImageUrl) + && pageLayout.equals(other.pageLayout); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.backgroundColor, this.backgroundImageUrl, this.pageLayout); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BackgroundColorStage builder() { + return new Builder(); + } + + public interface BackgroundColorStage { + /** + *

Background color

+ */ + BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor); + + Builder from(BrandingThemePageBackground other); + } + + public interface BackgroundImageUrlStage { + /** + *

Background image url

+ */ + PageLayoutStage backgroundImageUrl(@NotNull String backgroundImageUrl); + } + + public interface PageLayoutStage { + _FinalStage pageLayout(@NotNull BrandingThemePageBackgroundPageLayoutEnum pageLayout); + } + + public interface _FinalStage { + BrandingThemePageBackground build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BackgroundColorStage, BackgroundImageUrlStage, PageLayoutStage, _FinalStage { + private String backgroundColor; + + private String backgroundImageUrl; + + private BrandingThemePageBackgroundPageLayoutEnum pageLayout; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemePageBackground other) { + backgroundColor(other.getBackgroundColor()); + backgroundImageUrl(other.getBackgroundImageUrl()); + pageLayout(other.getPageLayout()); + return this; + } + + /** + *

Background color

+ *

Background color

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("background_color") + public BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor) { + this.backgroundColor = Objects.requireNonNull(backgroundColor, "backgroundColor must not be null"); + return this; + } + + /** + *

Background image url

+ *

Background image url

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("background_image_url") + public PageLayoutStage backgroundImageUrl(@NotNull String backgroundImageUrl) { + this.backgroundImageUrl = Objects.requireNonNull(backgroundImageUrl, "backgroundImageUrl must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_layout") + public _FinalStage pageLayout(@NotNull BrandingThemePageBackgroundPageLayoutEnum pageLayout) { + this.pageLayout = Objects.requireNonNull(pageLayout, "pageLayout must not be null"); + return this; + } + + @java.lang.Override + public BrandingThemePageBackground build() { + return new BrandingThemePageBackground( + backgroundColor, backgroundImageUrl, pageLayout, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java new file mode 100644 index 000000000..ac0e87288 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemePageBackgroundPageLayoutEnum { + public static final BrandingThemePageBackgroundPageLayoutEnum LEFT = + new BrandingThemePageBackgroundPageLayoutEnum(Value.LEFT, "left"); + + public static final BrandingThemePageBackgroundPageLayoutEnum RIGHT = + new BrandingThemePageBackgroundPageLayoutEnum(Value.RIGHT, "right"); + + public static final BrandingThemePageBackgroundPageLayoutEnum CENTER = + new BrandingThemePageBackgroundPageLayoutEnum(Value.CENTER, "center"); + + private final Value value; + + private final String string; + + BrandingThemePageBackgroundPageLayoutEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemePageBackgroundPageLayoutEnum + && this.string.equals(((BrandingThemePageBackgroundPageLayoutEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LEFT: + return visitor.visitLeft(); + case RIGHT: + return visitor.visitRight(); + case CENTER: + return visitor.visitCenter(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemePageBackgroundPageLayoutEnum valueOf(String value) { + switch (value) { + case "left": + return LEFT; + case "right": + return RIGHT; + case "center": + return CENTER; + default: + return new BrandingThemePageBackgroundPageLayoutEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CENTER, + + LEFT, + + RIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitCenter(); + + T visitLeft(); + + T visitRight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java new file mode 100644 index 000000000..199927eab --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java @@ -0,0 +1,234 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BrandingThemeWidget.Builder.class) +public final class BrandingThemeWidget { + private final BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment; + + private final double logoHeight; + + private final BrandingThemeWidgetLogoPositionEnum logoPosition; + + private final String logoUrl; + + private final BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout; + + private final Map additionalProperties; + + private BrandingThemeWidget( + BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment, + double logoHeight, + BrandingThemeWidgetLogoPositionEnum logoPosition, + String logoUrl, + BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout, + Map additionalProperties) { + this.headerTextAlignment = headerTextAlignment; + this.logoHeight = logoHeight; + this.logoPosition = logoPosition; + this.logoUrl = logoUrl; + this.socialButtonsLayout = socialButtonsLayout; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("header_text_alignment") + public BrandingThemeWidgetHeaderTextAlignmentEnum getHeaderTextAlignment() { + return headerTextAlignment; + } + + /** + * @return Logo height + */ + @JsonProperty("logo_height") + public double getLogoHeight() { + return logoHeight; + } + + @JsonProperty("logo_position") + public BrandingThemeWidgetLogoPositionEnum getLogoPosition() { + return logoPosition; + } + + /** + * @return Logo url + */ + @JsonProperty("logo_url") + public String getLogoUrl() { + return logoUrl; + } + + @JsonProperty("social_buttons_layout") + public BrandingThemeWidgetSocialButtonsLayoutEnum getSocialButtonsLayout() { + return socialButtonsLayout; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BrandingThemeWidget && equalTo((BrandingThemeWidget) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BrandingThemeWidget other) { + return headerTextAlignment.equals(other.headerTextAlignment) + && logoHeight == other.logoHeight + && logoPosition.equals(other.logoPosition) + && logoUrl.equals(other.logoUrl) + && socialButtonsLayout.equals(other.socialButtonsLayout); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.headerTextAlignment, this.logoHeight, this.logoPosition, this.logoUrl, this.socialButtonsLayout); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HeaderTextAlignmentStage builder() { + return new Builder(); + } + + public interface HeaderTextAlignmentStage { + LogoHeightStage headerTextAlignment(@NotNull BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment); + + Builder from(BrandingThemeWidget other); + } + + public interface LogoHeightStage { + /** + *

Logo height

+ */ + LogoPositionStage logoHeight(double logoHeight); + } + + public interface LogoPositionStage { + LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum logoPosition); + } + + public interface LogoUrlStage { + /** + *

Logo url

+ */ + SocialButtonsLayoutStage logoUrl(@NotNull String logoUrl); + } + + public interface SocialButtonsLayoutStage { + _FinalStage socialButtonsLayout(@NotNull BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout); + } + + public interface _FinalStage { + BrandingThemeWidget build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HeaderTextAlignmentStage, + LogoHeightStage, + LogoPositionStage, + LogoUrlStage, + SocialButtonsLayoutStage, + _FinalStage { + private BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment; + + private double logoHeight; + + private BrandingThemeWidgetLogoPositionEnum logoPosition; + + private String logoUrl; + + private BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BrandingThemeWidget other) { + headerTextAlignment(other.getHeaderTextAlignment()); + logoHeight(other.getLogoHeight()); + logoPosition(other.getLogoPosition()); + logoUrl(other.getLogoUrl()); + socialButtonsLayout(other.getSocialButtonsLayout()); + return this; + } + + @java.lang.Override + @JsonSetter("header_text_alignment") + public LogoHeightStage headerTextAlignment( + @NotNull BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment) { + this.headerTextAlignment = + Objects.requireNonNull(headerTextAlignment, "headerTextAlignment must not be null"); + return this; + } + + /** + *

Logo height

+ *

Logo height

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("logo_height") + public LogoPositionStage logoHeight(double logoHeight) { + this.logoHeight = logoHeight; + return this; + } + + @java.lang.Override + @JsonSetter("logo_position") + public LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum logoPosition) { + this.logoPosition = Objects.requireNonNull(logoPosition, "logoPosition must not be null"); + return this; + } + + /** + *

Logo url

+ *

Logo url

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("logo_url") + public SocialButtonsLayoutStage logoUrl(@NotNull String logoUrl) { + this.logoUrl = Objects.requireNonNull(logoUrl, "logoUrl must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("social_buttons_layout") + public _FinalStage socialButtonsLayout( + @NotNull BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout) { + this.socialButtonsLayout = + Objects.requireNonNull(socialButtonsLayout, "socialButtonsLayout must not be null"); + return this; + } + + @java.lang.Override + public BrandingThemeWidget build() { + return new BrandingThemeWidget( + headerTextAlignment, logoHeight, logoPosition, logoUrl, socialButtonsLayout, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java new file mode 100644 index 000000000..10afdefac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeWidgetHeaderTextAlignmentEnum { + public static final BrandingThemeWidgetHeaderTextAlignmentEnum LEFT = + new BrandingThemeWidgetHeaderTextAlignmentEnum(Value.LEFT, "left"); + + public static final BrandingThemeWidgetHeaderTextAlignmentEnum RIGHT = + new BrandingThemeWidgetHeaderTextAlignmentEnum(Value.RIGHT, "right"); + + public static final BrandingThemeWidgetHeaderTextAlignmentEnum CENTER = + new BrandingThemeWidgetHeaderTextAlignmentEnum(Value.CENTER, "center"); + + private final Value value; + + private final String string; + + BrandingThemeWidgetHeaderTextAlignmentEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeWidgetHeaderTextAlignmentEnum + && this.string.equals(((BrandingThemeWidgetHeaderTextAlignmentEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LEFT: + return visitor.visitLeft(); + case RIGHT: + return visitor.visitRight(); + case CENTER: + return visitor.visitCenter(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeWidgetHeaderTextAlignmentEnum valueOf(String value) { + switch (value) { + case "left": + return LEFT; + case "right": + return RIGHT; + case "center": + return CENTER; + default: + return new BrandingThemeWidgetHeaderTextAlignmentEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CENTER, + + LEFT, + + RIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitCenter(); + + T visitLeft(); + + T visitRight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java new file mode 100644 index 000000000..bb576015f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeWidgetLogoPositionEnum { + public static final BrandingThemeWidgetLogoPositionEnum LEFT = + new BrandingThemeWidgetLogoPositionEnum(Value.LEFT, "left"); + + public static final BrandingThemeWidgetLogoPositionEnum RIGHT = + new BrandingThemeWidgetLogoPositionEnum(Value.RIGHT, "right"); + + public static final BrandingThemeWidgetLogoPositionEnum CENTER = + new BrandingThemeWidgetLogoPositionEnum(Value.CENTER, "center"); + + public static final BrandingThemeWidgetLogoPositionEnum NONE = + new BrandingThemeWidgetLogoPositionEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + BrandingThemeWidgetLogoPositionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeWidgetLogoPositionEnum + && this.string.equals(((BrandingThemeWidgetLogoPositionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LEFT: + return visitor.visitLeft(); + case RIGHT: + return visitor.visitRight(); + case CENTER: + return visitor.visitCenter(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeWidgetLogoPositionEnum valueOf(String value) { + switch (value) { + case "left": + return LEFT; + case "right": + return RIGHT; + case "center": + return CENTER; + case "none": + return NONE; + default: + return new BrandingThemeWidgetLogoPositionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CENTER, + + LEFT, + + NONE, + + RIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitCenter(); + + T visitLeft(); + + T visitNone(); + + T visitRight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java new file mode 100644 index 000000000..376714c06 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BrandingThemeWidgetSocialButtonsLayoutEnum { + public static final BrandingThemeWidgetSocialButtonsLayoutEnum BOTTOM = + new BrandingThemeWidgetSocialButtonsLayoutEnum(Value.BOTTOM, "bottom"); + + public static final BrandingThemeWidgetSocialButtonsLayoutEnum TOP = + new BrandingThemeWidgetSocialButtonsLayoutEnum(Value.TOP, "top"); + + private final Value value; + + private final String string; + + BrandingThemeWidgetSocialButtonsLayoutEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BrandingThemeWidgetSocialButtonsLayoutEnum + && this.string.equals(((BrandingThemeWidgetSocialButtonsLayoutEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BOTTOM: + return visitor.visitBottom(); + case TOP: + return visitor.visitTop(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BrandingThemeWidgetSocialButtonsLayoutEnum valueOf(String value) { + switch (value) { + case "bottom": + return BOTTOM; + case "top": + return TOP; + default: + return new BrandingThemeWidgetSocialButtonsLayoutEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BOTTOM, + + TOP, + + UNKNOWN + } + + public interface Visitor { + T visitBottom(); + + T visitTop(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java new file mode 100644 index 000000000..2ad53e7c4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BreachedPasswordDetectionAdminNotificationFrequencyEnum { + public static final BreachedPasswordDetectionAdminNotificationFrequencyEnum IMMEDIATELY = + new BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value.IMMEDIATELY, "immediately"); + + public static final BreachedPasswordDetectionAdminNotificationFrequencyEnum MONTHLY = + new BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value.MONTHLY, "monthly"); + + public static final BreachedPasswordDetectionAdminNotificationFrequencyEnum DAILY = + new BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value.DAILY, "daily"); + + public static final BreachedPasswordDetectionAdminNotificationFrequencyEnum WEEKLY = + new BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value.WEEKLY, "weekly"); + + private final Value value; + + private final String string; + + BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BreachedPasswordDetectionAdminNotificationFrequencyEnum + && this.string.equals( + ((BreachedPasswordDetectionAdminNotificationFrequencyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IMMEDIATELY: + return visitor.visitImmediately(); + case MONTHLY: + return visitor.visitMonthly(); + case DAILY: + return visitor.visitDaily(); + case WEEKLY: + return visitor.visitWeekly(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BreachedPasswordDetectionAdminNotificationFrequencyEnum valueOf(String value) { + switch (value) { + case "immediately": + return IMMEDIATELY; + case "monthly": + return MONTHLY; + case "daily": + return DAILY; + case "weekly": + return WEEKLY; + default: + return new BreachedPasswordDetectionAdminNotificationFrequencyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + IMMEDIATELY, + + DAILY, + + WEEKLY, + + MONTHLY, + + UNKNOWN + } + + public interface Visitor { + T visitImmediately(); + + T visitDaily(); + + T visitWeekly(); + + T visitMonthly(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java new file mode 100644 index 000000000..ba87e9cc5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BreachedPasswordDetectionMethodEnum { + public static final BreachedPasswordDetectionMethodEnum STANDARD = + new BreachedPasswordDetectionMethodEnum(Value.STANDARD, "standard"); + + public static final BreachedPasswordDetectionMethodEnum ENHANCED = + new BreachedPasswordDetectionMethodEnum(Value.ENHANCED, "enhanced"); + + private final Value value; + + private final String string; + + BreachedPasswordDetectionMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BreachedPasswordDetectionMethodEnum + && this.string.equals(((BreachedPasswordDetectionMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STANDARD: + return visitor.visitStandard(); + case ENHANCED: + return visitor.visitEnhanced(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BreachedPasswordDetectionMethodEnum valueOf(String value) { + switch (value) { + case "standard": + return STANDARD; + case "enhanced": + return ENHANCED; + default: + return new BreachedPasswordDetectionMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + STANDARD, + + ENHANCED, + + UNKNOWN + } + + public interface Visitor { + T visitStandard(); + + T visitEnhanced(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java new file mode 100644 index 000000000..cdb88a9fa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BreachedPasswordDetectionPreChangePasswordShieldsEnum { + public static final BreachedPasswordDetectionPreChangePasswordShieldsEnum BLOCK = + new BreachedPasswordDetectionPreChangePasswordShieldsEnum(Value.BLOCK, "block"); + + public static final BreachedPasswordDetectionPreChangePasswordShieldsEnum ADMIN_NOTIFICATION = + new BreachedPasswordDetectionPreChangePasswordShieldsEnum(Value.ADMIN_NOTIFICATION, "admin_notification"); + + private final Value value; + + private final String string; + + BreachedPasswordDetectionPreChangePasswordShieldsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BreachedPasswordDetectionPreChangePasswordShieldsEnum + && this.string.equals(((BreachedPasswordDetectionPreChangePasswordShieldsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case ADMIN_NOTIFICATION: + return visitor.visitAdminNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BreachedPasswordDetectionPreChangePasswordShieldsEnum valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "admin_notification": + return ADMIN_NOTIFICATION; + default: + return new BreachedPasswordDetectionPreChangePasswordShieldsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + ADMIN_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitAdminNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java new file mode 100644 index 000000000..e53ada446 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BreachedPasswordDetectionPreChangePasswordStage.Builder.class) +public final class BreachedPasswordDetectionPreChangePasswordStage { + private final Optional> shields; + + private final Map additionalProperties; + + private BreachedPasswordDetectionPreChangePasswordStage( + Optional> shields, + Map additionalProperties) { + this.shields = shields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Action to take when a breached password is detected during a password reset. + * Possible values: <code>block</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BreachedPasswordDetectionPreChangePasswordStage + && equalTo((BreachedPasswordDetectionPreChangePasswordStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BreachedPasswordDetectionPreChangePasswordStage other) { + return shields.equals(other.shields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.shields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> shields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BreachedPasswordDetectionPreChangePasswordStage other) { + shields(other.getShields()); + return this; + } + + /** + *

Action to take when a breached password is detected during a password reset. + * Possible values: <code>block</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + public BreachedPasswordDetectionPreChangePasswordStage build() { + return new BreachedPasswordDetectionPreChangePasswordStage(shields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java new file mode 100644 index 000000000..8cf2aa464 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BreachedPasswordDetectionPreUserRegistrationShieldsEnum { + public static final BreachedPasswordDetectionPreUserRegistrationShieldsEnum BLOCK = + new BreachedPasswordDetectionPreUserRegistrationShieldsEnum(Value.BLOCK, "block"); + + public static final BreachedPasswordDetectionPreUserRegistrationShieldsEnum ADMIN_NOTIFICATION = + new BreachedPasswordDetectionPreUserRegistrationShieldsEnum(Value.ADMIN_NOTIFICATION, "admin_notification"); + + private final Value value; + + private final String string; + + BreachedPasswordDetectionPreUserRegistrationShieldsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BreachedPasswordDetectionPreUserRegistrationShieldsEnum + && this.string.equals( + ((BreachedPasswordDetectionPreUserRegistrationShieldsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case ADMIN_NOTIFICATION: + return visitor.visitAdminNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BreachedPasswordDetectionPreUserRegistrationShieldsEnum valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "admin_notification": + return ADMIN_NOTIFICATION; + default: + return new BreachedPasswordDetectionPreUserRegistrationShieldsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + ADMIN_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitAdminNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java new file mode 100644 index 000000000..27b56006d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BreachedPasswordDetectionPreUserRegistrationStage.Builder.class) +public final class BreachedPasswordDetectionPreUserRegistrationStage { + private final Optional> shields; + + private final Map additionalProperties; + + private BreachedPasswordDetectionPreUserRegistrationStage( + Optional> shields, + Map additionalProperties) { + this.shields = shields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Action to take when a breached password is detected during a signup. + * Possible values: <code>block</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BreachedPasswordDetectionPreUserRegistrationStage + && equalTo((BreachedPasswordDetectionPreUserRegistrationStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BreachedPasswordDetectionPreUserRegistrationStage other) { + return shields.equals(other.shields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.shields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> shields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BreachedPasswordDetectionPreUserRegistrationStage other) { + shields(other.getShields()); + return this; + } + + /** + *

Action to take when a breached password is detected during a signup. + * Possible values: <code>block</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + public BreachedPasswordDetectionPreUserRegistrationStage build() { + return new BreachedPasswordDetectionPreUserRegistrationStage(shields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java new file mode 100644 index 000000000..4b24df30e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BreachedPasswordDetectionShieldsEnum { + public static final BreachedPasswordDetectionShieldsEnum BLOCK = + new BreachedPasswordDetectionShieldsEnum(Value.BLOCK, "block"); + + public static final BreachedPasswordDetectionShieldsEnum USER_NOTIFICATION = + new BreachedPasswordDetectionShieldsEnum(Value.USER_NOTIFICATION, "user_notification"); + + public static final BreachedPasswordDetectionShieldsEnum ADMIN_NOTIFICATION = + new BreachedPasswordDetectionShieldsEnum(Value.ADMIN_NOTIFICATION, "admin_notification"); + + private final Value value; + + private final String string; + + BreachedPasswordDetectionShieldsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BreachedPasswordDetectionShieldsEnum + && this.string.equals(((BreachedPasswordDetectionShieldsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case USER_NOTIFICATION: + return visitor.visitUserNotification(); + case ADMIN_NOTIFICATION: + return visitor.visitAdminNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BreachedPasswordDetectionShieldsEnum valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "user_notification": + return USER_NOTIFICATION; + case "admin_notification": + return ADMIN_NOTIFICATION; + default: + return new BreachedPasswordDetectionShieldsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + USER_NOTIFICATION, + + ADMIN_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitUserNotification(); + + T visitAdminNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java new file mode 100644 index 000000000..c8fae44dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BreachedPasswordDetectionStage.Builder.class) +public final class BreachedPasswordDetectionStage { + private final Optional preUserRegistration; + + private final Optional preChangePassword; + + private final Map additionalProperties; + + private BreachedPasswordDetectionStage( + Optional preUserRegistration, + Optional preChangePassword, + Map additionalProperties) { + this.preUserRegistration = preUserRegistration; + this.preChangePassword = preChangePassword; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pre-user-registration") + public Optional getPreUserRegistration() { + return preUserRegistration; + } + + @JsonProperty("pre-change-password") + public Optional getPreChangePassword() { + return preChangePassword; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BreachedPasswordDetectionStage && equalTo((BreachedPasswordDetectionStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BreachedPasswordDetectionStage other) { + return preUserRegistration.equals(other.preUserRegistration) + && preChangePassword.equals(other.preChangePassword); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.preUserRegistration, this.preChangePassword); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional preUserRegistration = Optional.empty(); + + private Optional preChangePassword = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BreachedPasswordDetectionStage other) { + preUserRegistration(other.getPreUserRegistration()); + preChangePassword(other.getPreChangePassword()); + return this; + } + + @JsonSetter(value = "pre-user-registration", nulls = Nulls.SKIP) + public Builder preUserRegistration( + Optional preUserRegistration) { + this.preUserRegistration = preUserRegistration; + return this; + } + + public Builder preUserRegistration(BreachedPasswordDetectionPreUserRegistrationStage preUserRegistration) { + this.preUserRegistration = Optional.ofNullable(preUserRegistration); + return this; + } + + @JsonSetter(value = "pre-change-password", nulls = Nulls.SKIP) + public Builder preChangePassword(Optional preChangePassword) { + this.preChangePassword = preChangePassword; + return this; + } + + public Builder preChangePassword(BreachedPasswordDetectionPreChangePasswordStage preChangePassword) { + this.preChangePassword = Optional.ofNullable(preChangePassword); + return this; + } + + public BreachedPasswordDetectionStage build() { + return new BreachedPasswordDetectionStage(preUserRegistration, preChangePassword, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java new file mode 100644 index 000000000..a59f02344 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java @@ -0,0 +1,363 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ChangePasswordTicketRequestContent.Builder.class) +public final class ChangePasswordTicketRequestContent { + private final Optional resultUrl; + + private final Optional userId; + + private final Optional clientId; + + private final Optional organizationId; + + private final Optional connectionId; + + private final Optional email; + + private final Optional ttlSec; + + private final Optional markEmailAsVerified; + + private final Optional includeEmailInRedirect; + + private final Map additionalProperties; + + private ChangePasswordTicketRequestContent( + Optional resultUrl, + Optional userId, + Optional clientId, + Optional organizationId, + Optional connectionId, + Optional email, + Optional ttlSec, + Optional markEmailAsVerified, + Optional includeEmailInRedirect, + Map additionalProperties) { + this.resultUrl = resultUrl; + this.userId = userId; + this.clientId = clientId; + this.organizationId = organizationId; + this.connectionId = connectionId; + this.email = email; + this.ttlSec = ttlSec; + this.markEmailAsVerified = markEmailAsVerified; + this.includeEmailInRedirect = includeEmailInRedirect; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. + */ + @JsonProperty("result_url") + public Optional getResultUrl() { + return resultUrl; + } + + /** + * @return user_id of for whom the ticket should be created. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + /** + * @return ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + */ + @JsonProperty("ttl_sec") + public Optional getTtlSec() { + return ttlSec; + } + + /** + * @return Whether to set the email_verified attribute to true (true) or whether it should not be updated (false). + */ + @JsonProperty("mark_email_as_verified") + public Optional getMarkEmailAsVerified() { + return markEmailAsVerified; + } + + /** + * @return Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ChangePasswordTicketRequestContent + && equalTo((ChangePasswordTicketRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ChangePasswordTicketRequestContent other) { + return resultUrl.equals(other.resultUrl) + && userId.equals(other.userId) + && clientId.equals(other.clientId) + && organizationId.equals(other.organizationId) + && connectionId.equals(other.connectionId) + && email.equals(other.email) + && ttlSec.equals(other.ttlSec) + && markEmailAsVerified.equals(other.markEmailAsVerified) + && includeEmailInRedirect.equals(other.includeEmailInRedirect); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.resultUrl, + this.userId, + this.clientId, + this.organizationId, + this.connectionId, + this.email, + this.ttlSec, + this.markEmailAsVerified, + this.includeEmailInRedirect); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional resultUrl = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional ttlSec = Optional.empty(); + + private Optional markEmailAsVerified = Optional.empty(); + + private Optional includeEmailInRedirect = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ChangePasswordTicketRequestContent other) { + resultUrl(other.getResultUrl()); + userId(other.getUserId()); + clientId(other.getClientId()); + organizationId(other.getOrganizationId()); + connectionId(other.getConnectionId()); + email(other.getEmail()); + ttlSec(other.getTtlSec()); + markEmailAsVerified(other.getMarkEmailAsVerified()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + return this; + } + + /** + *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

+ */ + @JsonSetter(value = "result_url", nulls = Nulls.SKIP) + public Builder resultUrl(Optional resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + public Builder resultUrl(String resultUrl) { + this.resultUrl = Optional.ofNullable(resultUrl); + return this; + } + + /** + *

user_id of for whom the ticket should be created.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + /** + *

ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

+ */ + @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) + public Builder ttlSec(Optional ttlSec) { + this.ttlSec = ttlSec; + return this; + } + + public Builder ttlSec(Integer ttlSec) { + this.ttlSec = Optional.ofNullable(ttlSec); + return this; + } + + /** + *

Whether to set the email_verified attribute to true (true) or whether it should not be updated (false).

+ */ + @JsonSetter(value = "mark_email_as_verified", nulls = Nulls.SKIP) + public Builder markEmailAsVerified(Optional markEmailAsVerified) { + this.markEmailAsVerified = markEmailAsVerified; + return this; + } + + public Builder markEmailAsVerified(Boolean markEmailAsVerified) { + this.markEmailAsVerified = Optional.ofNullable(markEmailAsVerified); + return this; + } + + /** + *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

+ */ + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public Builder includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + public Builder includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + public ChangePasswordTicketRequestContent build() { + return new ChangePasswordTicketRequestContent( + resultUrl, + userId, + clientId, + organizationId, + connectionId, + email, + ttlSec, + markEmailAsVerified, + includeEmailInRedirect, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java new file mode 100644 index 000000000..c9075bfd5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ChangePasswordTicketResponseContent.Builder.class) +public final class ChangePasswordTicketResponseContent { + private final String ticket; + + private final Map additionalProperties; + + private ChangePasswordTicketResponseContent(String ticket, Map additionalProperties) { + this.ticket = ticket; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL representing the ticket. + */ + @JsonProperty("ticket") + public String getTicket() { + return ticket; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ChangePasswordTicketResponseContent + && equalTo((ChangePasswordTicketResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ChangePasswordTicketResponseContent other) { + return ticket.equals(other.ticket); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ticket); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TicketStage builder() { + return new Builder(); + } + + public interface TicketStage { + /** + *

URL representing the ticket.

+ */ + _FinalStage ticket(@NotNull String ticket); + + Builder from(ChangePasswordTicketResponseContent other); + } + + public interface _FinalStage { + ChangePasswordTicketResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TicketStage, _FinalStage { + private String ticket; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ChangePasswordTicketResponseContent other) { + ticket(other.getTicket()); + return this; + } + + /** + *

URL representing the ticket.

+ *

URL representing the ticket.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("ticket") + public _FinalStage ticket(@NotNull String ticket) { + this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); + return this; + } + + @java.lang.Override + public ChangePasswordTicketResponseContent build() { + return new ChangePasswordTicketResponseContent(ticket, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Client.java b/src/main/java/com/auth0/client/mgmt/types/Client.java new file mode 100644 index 000000000..b4f63d8d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Client.java @@ -0,0 +1,1663 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Client.Builder.class) +public final class Client { + private final Optional clientId; + + private final Optional tenant; + + private final Optional name; + + private final Optional description; + + private final Optional global; + + private final Optional clientSecret; + + private final Optional appType; + + private final Optional logoUri; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional> callbacks; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final OptionalNullable sessionTransfer; + + private final Optional oidcLogout; + + private final Optional> grantTypes; + + private final Optional jwtConfiguration; + + private final Optional> signingKeys; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional ssoDisabled; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional tokenEndpointAuthMethod; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private Client( + Optional clientId, + Optional tenant, + Optional name, + Optional description, + Optional global, + Optional clientSecret, + Optional appType, + Optional logoUri, + Optional isFirstParty, + Optional oidcConformant, + Optional> callbacks, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + OptionalNullable sessionTransfer, + Optional oidcLogout, + Optional> grantTypes, + Optional jwtConfiguration, + Optional> signingKeys, + OptionalNullable encryptionKey, + Optional sso, + Optional ssoDisabled, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional tokenEndpointAuthMethod, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Map additionalProperties) { + this.clientId = clientId; + this.tenant = tenant; + this.name = name; + this.description = description; + this.global = global; + this.clientSecret = clientSecret; + this.appType = appType; + this.logoUri = logoUri; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.callbacks = callbacks; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionTransfer = sessionTransfer; + this.oidcLogout = oidcLogout; + this.grantTypes = grantTypes; + this.jwtConfiguration = jwtConfiguration; + this.signingKeys = signingKeys; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.ssoDisabled = ssoDisabled; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the tenant this client belongs to. + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). + */ + @JsonProperty("global") + public Optional getGlobal() { + return global; + } + + /** + * @return Client secret (which you must not make public). + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. + */ + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Whether this client a first party client (true) or not (false). + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonProperty("signing_keys") + public Optional> getSigningKeys() { + return signingKeys; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether Single Sign On is disabled (true) or enabled (true). Defaults to true. + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return Whether a custom login page is to be used (true) or the default provided login page (false). + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Client && equalTo((Client) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Client other) { + return clientId.equals(other.clientId) + && tenant.equals(other.tenant) + && name.equals(other.name) + && description.equals(other.description) + && global.equals(other.global) + && clientSecret.equals(other.clientSecret) + && appType.equals(other.appType) + && logoUri.equals(other.logoUri) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && callbacks.equals(other.callbacks) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionTransfer.equals(other.sessionTransfer) + && oidcLogout.equals(other.oidcLogout) + && grantTypes.equals(other.grantTypes) + && jwtConfiguration.equals(other.jwtConfiguration) + && signingKeys.equals(other.signingKeys) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && ssoDisabled.equals(other.ssoDisabled) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.tenant, + this.name, + this.description, + this.global, + this.clientSecret, + this.appType, + this.logoUri, + this.isFirstParty, + this.oidcConformant, + this.callbacks, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.sessionTransfer, + this.oidcLogout, + this.grantTypes, + this.jwtConfiguration, + this.signingKeys, + this.encryptionKey, + this.sso, + this.ssoDisabled, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.tokenEndpointAuthMethod, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional global = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional> signingKeys = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private Optional organizationUsage = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Client other) { + clientId(other.getClientId()); + tenant(other.getTenant()); + name(other.getName()); + description(other.getDescription()); + global(other.getGlobal()); + clientSecret(other.getClientSecret()); + appType(other.getAppType()); + logoUri(other.getLogoUri()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + callbacks(other.getCallbacks()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionTransfer(other.getSessionTransfer()); + oidcLogout(other.getOidcLogout()); + grantTypes(other.getGrantTypes()); + jwtConfiguration(other.getJwtConfiguration()); + signingKeys(other.getSigningKeys()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + ssoDisabled(other.getSsoDisabled()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

ID of this client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the tenant this client belongs to.

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).

+ */ + @JsonSetter(value = "global", nulls = Nulls.SKIP) + public Builder global(Optional global) { + this.global = global; + return this; + } + + public Builder global(Boolean global) { + this.global = Optional.ofNullable(global); + return this; + } + + /** + *

Client secret (which you must not make public).

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

Whether this client a first party client (true) or not (false).

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "signing_keys", nulls = Nulls.SKIP) + public Builder signingKeys(Optional> signingKeys) { + this.signingKeys = signingKeys; + return this; + } + + public Builder signingKeys(List signingKeys) { + this.signingKeys = Optional.ofNullable(signingKeys); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Whether Single Sign On is disabled (true) or enabled (true). Defaults to true.

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

Whether a custom login page is to be used (true) or the default provided login page (false).

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public Client build() { + return new Client( + clientId, + tenant, + name, + description, + global, + clientSecret, + appType, + logoUri, + isFirstParty, + oidcConformant, + callbacks, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + sessionTransfer, + oidcLogout, + grantTypes, + jwtConfiguration, + signingKeys, + encryptionKey, + sso, + ssoDisabled, + crossOriginAuthentication, + crossOriginLoc, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + tokenEndpointAuthMethod, + clientMetadata, + mobile, + initiateLoginUri, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java new file mode 100644 index 000000000..828f875ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonAws.Builder.class) +public final class ClientAddonAws { + private final Optional principal; + + private final Optional role; + + private final Optional lifetimeInSeconds; + + private final Map additionalProperties; + + private ClientAddonAws( + Optional principal, + Optional role, + Optional lifetimeInSeconds, + Map additionalProperties) { + this.principal = principal; + this.role = role; + this.lifetimeInSeconds = lifetimeInSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS principal ARN, e.g. arn:aws:iam::010616021751:saml-provider/idpname + */ + @JsonProperty("principal") + public Optional getPrincipal() { + return principal; + } + + /** + * @return AWS role ARN, e.g. arn:aws:iam::010616021751:role/foo + */ + @JsonProperty("role") + public Optional getRole() { + return role; + } + + /** + * @return AWS token lifetime in seconds + */ + @JsonProperty("lifetime_in_seconds") + public Optional getLifetimeInSeconds() { + return lifetimeInSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonAws && equalTo((ClientAddonAws) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonAws other) { + return principal.equals(other.principal) + && role.equals(other.role) + && lifetimeInSeconds.equals(other.lifetimeInSeconds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.principal, this.role, this.lifetimeInSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional principal = Optional.empty(); + + private Optional role = Optional.empty(); + + private Optional lifetimeInSeconds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonAws other) { + principal(other.getPrincipal()); + role(other.getRole()); + lifetimeInSeconds(other.getLifetimeInSeconds()); + return this; + } + + /** + *

AWS principal ARN, e.g. arn:aws:iam::010616021751:saml-provider/idpname

+ */ + @JsonSetter(value = "principal", nulls = Nulls.SKIP) + public Builder principal(Optional principal) { + this.principal = principal; + return this; + } + + public Builder principal(String principal) { + this.principal = Optional.ofNullable(principal); + return this; + } + + /** + *

AWS role ARN, e.g. arn:aws:iam::010616021751:role/foo

+ */ + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public Builder role(Optional role) { + this.role = role; + return this; + } + + public Builder role(String role) { + this.role = Optional.ofNullable(role); + return this; + } + + /** + *

AWS token lifetime in seconds

+ */ + @JsonSetter(value = "lifetime_in_seconds", nulls = Nulls.SKIP) + public Builder lifetimeInSeconds(Optional lifetimeInSeconds) { + this.lifetimeInSeconds = lifetimeInSeconds; + return this; + } + + public Builder lifetimeInSeconds(Integer lifetimeInSeconds) { + this.lifetimeInSeconds = Optional.ofNullable(lifetimeInSeconds); + return this; + } + + public ClientAddonAws build() { + return new ClientAddonAws(principal, role, lifetimeInSeconds, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java new file mode 100644 index 000000000..c194cdf5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java @@ -0,0 +1,490 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonAzureBlob.Builder.class) +public final class ClientAddonAzureBlob { + private final Optional accountName; + + private final Optional storageAccessKey; + + private final Optional containerName; + + private final Optional blobName; + + private final Optional expiration; + + private final Optional signedIdentifier; + + private final Optional blobRead; + + private final Optional blobWrite; + + private final Optional blobDelete; + + private final Optional containerRead; + + private final Optional containerWrite; + + private final Optional containerDelete; + + private final Optional containerList; + + private final Map additionalProperties; + + private ClientAddonAzureBlob( + Optional accountName, + Optional storageAccessKey, + Optional containerName, + Optional blobName, + Optional expiration, + Optional signedIdentifier, + Optional blobRead, + Optional blobWrite, + Optional blobDelete, + Optional containerRead, + Optional containerWrite, + Optional containerDelete, + Optional containerList, + Map additionalProperties) { + this.accountName = accountName; + this.storageAccessKey = storageAccessKey; + this.containerName = containerName; + this.blobName = blobName; + this.expiration = expiration; + this.signedIdentifier = signedIdentifier; + this.blobRead = blobRead; + this.blobWrite = blobWrite; + this.blobDelete = blobDelete; + this.containerRead = containerRead; + this.containerWrite = containerWrite; + this.containerDelete = containerDelete; + this.containerList = containerList; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your Azure storage account name. Usually first segment in your Azure storage URL. e.g. https://acme-org.blob.core.windows.net would be the account name acme-org. + */ + @JsonProperty("accountName") + public Optional getAccountName() { + return accountName; + } + + /** + * @return Access key associated with this storage account. + */ + @JsonProperty("storageAccessKey") + public Optional getStorageAccessKey() { + return storageAccessKey; + } + + /** + * @return Container to request a token for. e.g. my-container. + */ + @JsonProperty("containerName") + public Optional getContainerName() { + return containerName; + } + + /** + * @return Entity to request a token for. e.g. my-blob. If blank the computed SAS will apply to the entire storage container. + */ + @JsonProperty("blobName") + public Optional getBlobName() { + return blobName; + } + + /** + * @return Expiration in minutes for the generated token (default of 5 minutes). + */ + @JsonProperty("expiration") + public Optional getExpiration() { + return expiration; + } + + /** + * @return Shared access policy identifier defined in your storage account resource. + */ + @JsonProperty("signedIdentifier") + public Optional getSignedIdentifier() { + return signedIdentifier; + } + + /** + * @return Indicates if the issued token has permission to read the content, properties, metadata and block list. Use the blob as the source of a copy operation. + */ + @JsonProperty("blob_read") + public Optional getBlobRead() { + return blobRead; + } + + /** + * @return Indicates if the issued token has permission to create or write content, properties, metadata, or block list. Snapshot or lease the blob. Resize the blob (page blob only). Use the blob as the destination of a copy operation within the same account. + */ + @JsonProperty("blob_write") + public Optional getBlobWrite() { + return blobWrite; + } + + /** + * @return Indicates if the issued token has permission to delete the blob. + */ + @JsonProperty("blob_delete") + public Optional getBlobDelete() { + return blobDelete; + } + + /** + * @return Indicates if the issued token has permission to read the content, properties, metadata or block list of any blob in the container. Use any blob in the container as the source of a copy operation + */ + @JsonProperty("container_read") + public Optional getContainerRead() { + return containerRead; + } + + /** + * @return Indicates that for any blob in the container if the issued token has permission to create or write content, properties, metadata, or block list. Snapshot or lease the blob. Resize the blob (page blob only). Use the blob as the destination of a copy operation within the same account. + */ + @JsonProperty("container_write") + public Optional getContainerWrite() { + return containerWrite; + } + + /** + * @return Indicates if issued token has permission to delete any blob in the container. + */ + @JsonProperty("container_delete") + public Optional getContainerDelete() { + return containerDelete; + } + + /** + * @return Indicates if the issued token has permission to list blobs in the container. + */ + @JsonProperty("container_list") + public Optional getContainerList() { + return containerList; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonAzureBlob && equalTo((ClientAddonAzureBlob) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonAzureBlob other) { + return accountName.equals(other.accountName) + && storageAccessKey.equals(other.storageAccessKey) + && containerName.equals(other.containerName) + && blobName.equals(other.blobName) + && expiration.equals(other.expiration) + && signedIdentifier.equals(other.signedIdentifier) + && blobRead.equals(other.blobRead) + && blobWrite.equals(other.blobWrite) + && blobDelete.equals(other.blobDelete) + && containerRead.equals(other.containerRead) + && containerWrite.equals(other.containerWrite) + && containerDelete.equals(other.containerDelete) + && containerList.equals(other.containerList); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountName, + this.storageAccessKey, + this.containerName, + this.blobName, + this.expiration, + this.signedIdentifier, + this.blobRead, + this.blobWrite, + this.blobDelete, + this.containerRead, + this.containerWrite, + this.containerDelete, + this.containerList); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountName = Optional.empty(); + + private Optional storageAccessKey = Optional.empty(); + + private Optional containerName = Optional.empty(); + + private Optional blobName = Optional.empty(); + + private Optional expiration = Optional.empty(); + + private Optional signedIdentifier = Optional.empty(); + + private Optional blobRead = Optional.empty(); + + private Optional blobWrite = Optional.empty(); + + private Optional blobDelete = Optional.empty(); + + private Optional containerRead = Optional.empty(); + + private Optional containerWrite = Optional.empty(); + + private Optional containerDelete = Optional.empty(); + + private Optional containerList = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonAzureBlob other) { + accountName(other.getAccountName()); + storageAccessKey(other.getStorageAccessKey()); + containerName(other.getContainerName()); + blobName(other.getBlobName()); + expiration(other.getExpiration()); + signedIdentifier(other.getSignedIdentifier()); + blobRead(other.getBlobRead()); + blobWrite(other.getBlobWrite()); + blobDelete(other.getBlobDelete()); + containerRead(other.getContainerRead()); + containerWrite(other.getContainerWrite()); + containerDelete(other.getContainerDelete()); + containerList(other.getContainerList()); + return this; + } + + /** + *

Your Azure storage account name. Usually first segment in your Azure storage URL. e.g. https://acme-org.blob.core.windows.net would be the account name acme-org.

+ */ + @JsonSetter(value = "accountName", nulls = Nulls.SKIP) + public Builder accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + public Builder accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + *

Access key associated with this storage account.

+ */ + @JsonSetter(value = "storageAccessKey", nulls = Nulls.SKIP) + public Builder storageAccessKey(Optional storageAccessKey) { + this.storageAccessKey = storageAccessKey; + return this; + } + + public Builder storageAccessKey(String storageAccessKey) { + this.storageAccessKey = Optional.ofNullable(storageAccessKey); + return this; + } + + /** + *

Container to request a token for. e.g. my-container.

+ */ + @JsonSetter(value = "containerName", nulls = Nulls.SKIP) + public Builder containerName(Optional containerName) { + this.containerName = containerName; + return this; + } + + public Builder containerName(String containerName) { + this.containerName = Optional.ofNullable(containerName); + return this; + } + + /** + *

Entity to request a token for. e.g. my-blob. If blank the computed SAS will apply to the entire storage container.

+ */ + @JsonSetter(value = "blobName", nulls = Nulls.SKIP) + public Builder blobName(Optional blobName) { + this.blobName = blobName; + return this; + } + + public Builder blobName(String blobName) { + this.blobName = Optional.ofNullable(blobName); + return this; + } + + /** + *

Expiration in minutes for the generated token (default of 5 minutes).

+ */ + @JsonSetter(value = "expiration", nulls = Nulls.SKIP) + public Builder expiration(Optional expiration) { + this.expiration = expiration; + return this; + } + + public Builder expiration(Integer expiration) { + this.expiration = Optional.ofNullable(expiration); + return this; + } + + /** + *

Shared access policy identifier defined in your storage account resource.

+ */ + @JsonSetter(value = "signedIdentifier", nulls = Nulls.SKIP) + public Builder signedIdentifier(Optional signedIdentifier) { + this.signedIdentifier = signedIdentifier; + return this; + } + + public Builder signedIdentifier(String signedIdentifier) { + this.signedIdentifier = Optional.ofNullable(signedIdentifier); + return this; + } + + /** + *

Indicates if the issued token has permission to read the content, properties, metadata and block list. Use the blob as the source of a copy operation.

+ */ + @JsonSetter(value = "blob_read", nulls = Nulls.SKIP) + public Builder blobRead(Optional blobRead) { + this.blobRead = blobRead; + return this; + } + + public Builder blobRead(Boolean blobRead) { + this.blobRead = Optional.ofNullable(blobRead); + return this; + } + + /** + *

Indicates if the issued token has permission to create or write content, properties, metadata, or block list. Snapshot or lease the blob. Resize the blob (page blob only). Use the blob as the destination of a copy operation within the same account.

+ */ + @JsonSetter(value = "blob_write", nulls = Nulls.SKIP) + public Builder blobWrite(Optional blobWrite) { + this.blobWrite = blobWrite; + return this; + } + + public Builder blobWrite(Boolean blobWrite) { + this.blobWrite = Optional.ofNullable(blobWrite); + return this; + } + + /** + *

Indicates if the issued token has permission to delete the blob.

+ */ + @JsonSetter(value = "blob_delete", nulls = Nulls.SKIP) + public Builder blobDelete(Optional blobDelete) { + this.blobDelete = blobDelete; + return this; + } + + public Builder blobDelete(Boolean blobDelete) { + this.blobDelete = Optional.ofNullable(blobDelete); + return this; + } + + /** + *

Indicates if the issued token has permission to read the content, properties, metadata or block list of any blob in the container. Use any blob in the container as the source of a copy operation

+ */ + @JsonSetter(value = "container_read", nulls = Nulls.SKIP) + public Builder containerRead(Optional containerRead) { + this.containerRead = containerRead; + return this; + } + + public Builder containerRead(Boolean containerRead) { + this.containerRead = Optional.ofNullable(containerRead); + return this; + } + + /** + *

Indicates that for any blob in the container if the issued token has permission to create or write content, properties, metadata, or block list. Snapshot or lease the blob. Resize the blob (page blob only). Use the blob as the destination of a copy operation within the same account.

+ */ + @JsonSetter(value = "container_write", nulls = Nulls.SKIP) + public Builder containerWrite(Optional containerWrite) { + this.containerWrite = containerWrite; + return this; + } + + public Builder containerWrite(Boolean containerWrite) { + this.containerWrite = Optional.ofNullable(containerWrite); + return this; + } + + /** + *

Indicates if issued token has permission to delete any blob in the container.

+ */ + @JsonSetter(value = "container_delete", nulls = Nulls.SKIP) + public Builder containerDelete(Optional containerDelete) { + this.containerDelete = containerDelete; + return this; + } + + public Builder containerDelete(Boolean containerDelete) { + this.containerDelete = Optional.ofNullable(containerDelete); + return this; + } + + /** + *

Indicates if the issued token has permission to list blobs in the container.

+ */ + @JsonSetter(value = "container_list", nulls = Nulls.SKIP) + public Builder containerList(Optional containerList) { + this.containerList = containerList; + return this; + } + + public Builder containerList(Boolean containerList) { + this.containerList = Optional.ofNullable(containerList); + return this; + } + + public ClientAddonAzureBlob build() { + return new ClientAddonAzureBlob( + accountName, + storageAccessKey, + containerName, + blobName, + expiration, + signedIdentifier, + blobRead, + blobWrite, + blobDelete, + containerRead, + containerWrite, + containerDelete, + containerList, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java new file mode 100644 index 000000000..c1cc286e7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java @@ -0,0 +1,223 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonAzureSb.Builder.class) +public final class ClientAddonAzureSb { + private final Optional namespace; + + private final Optional sasKeyName; + + private final Optional sasKey; + + private final Optional entityPath; + + private final Optional expiration; + + private final Map additionalProperties; + + private ClientAddonAzureSb( + Optional namespace, + Optional sasKeyName, + Optional sasKey, + Optional entityPath, + Optional expiration, + Map additionalProperties) { + this.namespace = namespace; + this.sasKeyName = sasKeyName; + this.sasKey = sasKey; + this.entityPath = entityPath; + this.expiration = expiration; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your Azure Service Bus namespace. Usually the first segment of your Service Bus URL (e.g. https://acme-org.servicebus.windows.net would be acme-org). + */ + @JsonProperty("namespace") + public Optional getNamespace() { + return namespace; + } + + /** + * @return Your shared access policy name defined in your Service Bus entity. + */ + @JsonProperty("sasKeyName") + public Optional getSasKeyName() { + return sasKeyName; + } + + /** + * @return Primary Key associated with your shared access policy. + */ + @JsonProperty("sasKey") + public Optional getSasKey() { + return sasKey; + } + + /** + * @return Entity you want to request a token for. e.g. my-queue.' + */ + @JsonProperty("entityPath") + public Optional getEntityPath() { + return entityPath; + } + + /** + * @return Optional expiration in minutes for the generated token. Defaults to 5 minutes. + */ + @JsonProperty("expiration") + public Optional getExpiration() { + return expiration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonAzureSb && equalTo((ClientAddonAzureSb) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonAzureSb other) { + return namespace.equals(other.namespace) + && sasKeyName.equals(other.sasKeyName) + && sasKey.equals(other.sasKey) + && entityPath.equals(other.entityPath) + && expiration.equals(other.expiration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.namespace, this.sasKeyName, this.sasKey, this.entityPath, this.expiration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional namespace = Optional.empty(); + + private Optional sasKeyName = Optional.empty(); + + private Optional sasKey = Optional.empty(); + + private Optional entityPath = Optional.empty(); + + private Optional expiration = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonAzureSb other) { + namespace(other.getNamespace()); + sasKeyName(other.getSasKeyName()); + sasKey(other.getSasKey()); + entityPath(other.getEntityPath()); + expiration(other.getExpiration()); + return this; + } + + /** + *

Your Azure Service Bus namespace. Usually the first segment of your Service Bus URL (e.g. https://acme-org.servicebus.windows.net would be acme-org).

+ */ + @JsonSetter(value = "namespace", nulls = Nulls.SKIP) + public Builder namespace(Optional namespace) { + this.namespace = namespace; + return this; + } + + public Builder namespace(String namespace) { + this.namespace = Optional.ofNullable(namespace); + return this; + } + + /** + *

Your shared access policy name defined in your Service Bus entity.

+ */ + @JsonSetter(value = "sasKeyName", nulls = Nulls.SKIP) + public Builder sasKeyName(Optional sasKeyName) { + this.sasKeyName = sasKeyName; + return this; + } + + public Builder sasKeyName(String sasKeyName) { + this.sasKeyName = Optional.ofNullable(sasKeyName); + return this; + } + + /** + *

Primary Key associated with your shared access policy.

+ */ + @JsonSetter(value = "sasKey", nulls = Nulls.SKIP) + public Builder sasKey(Optional sasKey) { + this.sasKey = sasKey; + return this; + } + + public Builder sasKey(String sasKey) { + this.sasKey = Optional.ofNullable(sasKey); + return this; + } + + /** + *

Entity you want to request a token for. e.g. my-queue.'

+ */ + @JsonSetter(value = "entityPath", nulls = Nulls.SKIP) + public Builder entityPath(Optional entityPath) { + this.entityPath = entityPath; + return this; + } + + public Builder entityPath(String entityPath) { + this.entityPath = Optional.ofNullable(entityPath); + return this; + } + + /** + *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

+ */ + @JsonSetter(value = "expiration", nulls = Nulls.SKIP) + public Builder expiration(Optional expiration) { + this.expiration = expiration; + return this; + } + + public Builder expiration(Integer expiration) { + this.expiration = Optional.ofNullable(expiration); + return this; + } + + public ClientAddonAzureSb build() { + return new ClientAddonAzureSb(namespace, sasKeyName, sasKey, entityPath, expiration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java new file mode 100644 index 000000000..d014bbe1d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonEchoSign.Builder.class) +public final class ClientAddonEchoSign { + private final Optional domain; + + private final Map additionalProperties; + + private ClientAddonEchoSign(Optional domain, Map additionalProperties) { + this.domain = domain; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your custom domain found in your EchoSign URL. e.g. https://acme-org.echosign.com would be acme-org. + */ + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonEchoSign && equalTo((ClientAddonEchoSign) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonEchoSign other) { + return domain.equals(other.domain); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.domain); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional domain = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonEchoSign other) { + domain(other.getDomain()); + return this; + } + + /** + *

Your custom domain found in your EchoSign URL. e.g. https://acme-org.echosign.com would be acme-org.

+ */ + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public Builder domain(Optional domain) { + this.domain = domain; + return this; + } + + public Builder domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + public ClientAddonEchoSign build() { + return new ClientAddonEchoSign(domain, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java new file mode 100644 index 000000000..9388bb1b4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonEgnyte.Builder.class) +public final class ClientAddonEgnyte { + private final Optional domain; + + private final Map additionalProperties; + + private ClientAddonEgnyte(Optional domain, Map additionalProperties) { + this.domain = domain; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your custom domain found in your Egnyte URL. e.g. https://acme-org.egnyte.com would be acme-org. + */ + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonEgnyte && equalTo((ClientAddonEgnyte) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonEgnyte other) { + return domain.equals(other.domain); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.domain); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional domain = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonEgnyte other) { + domain(other.getDomain()); + return this; + } + + /** + *

Your custom domain found in your Egnyte URL. e.g. https://acme-org.egnyte.com would be acme-org.

+ */ + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public Builder domain(Optional domain) { + this.domain = domain; + return this; + } + + public Builder domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + public ClientAddonEgnyte build() { + return new ClientAddonEgnyte(domain, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java new file mode 100644 index 000000000..12fa19d6b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonFirebase.Builder.class) +public final class ClientAddonFirebase { + private final Optional secret; + + private final Optional privateKeyId; + + private final Optional privateKey; + + private final Optional clientEmail; + + private final Optional lifetimeInSeconds; + + private final Map additionalProperties; + + private ClientAddonFirebase( + Optional secret, + Optional privateKeyId, + Optional privateKey, + Optional clientEmail, + Optional lifetimeInSeconds, + Map additionalProperties) { + this.secret = secret; + this.privateKeyId = privateKeyId; + this.privateKey = privateKey; + this.clientEmail = clientEmail; + this.lifetimeInSeconds = lifetimeInSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return Google Firebase Secret. (SDK 2 only). + */ + @JsonProperty("secret") + public Optional getSecret() { + return secret; + } + + /** + * @return Optional ID of the private key to obtain kid header in the issued token (SDK v3+ tokens only). + */ + @JsonProperty("private_key_id") + public Optional getPrivateKeyId() { + return privateKeyId; + } + + /** + * @return Private Key for signing the token (SDK v3+ tokens only). + */ + @JsonProperty("private_key") + public Optional getPrivateKey() { + return privateKey; + } + + /** + * @return ID of the Service Account you have created (shown as client_email in the generated JSON file, SDK v3+ tokens only). + */ + @JsonProperty("client_email") + public Optional getClientEmail() { + return clientEmail; + } + + /** + * @return Optional expiration in seconds for the generated token. Defaults to 3600 seconds (SDK v3+ tokens only). + */ + @JsonProperty("lifetime_in_seconds") + public Optional getLifetimeInSeconds() { + return lifetimeInSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonFirebase && equalTo((ClientAddonFirebase) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonFirebase other) { + return secret.equals(other.secret) + && privateKeyId.equals(other.privateKeyId) + && privateKey.equals(other.privateKey) + && clientEmail.equals(other.clientEmail) + && lifetimeInSeconds.equals(other.lifetimeInSeconds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.secret, this.privateKeyId, this.privateKey, this.clientEmail, this.lifetimeInSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional secret = Optional.empty(); + + private Optional privateKeyId = Optional.empty(); + + private Optional privateKey = Optional.empty(); + + private Optional clientEmail = Optional.empty(); + + private Optional lifetimeInSeconds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonFirebase other) { + secret(other.getSecret()); + privateKeyId(other.getPrivateKeyId()); + privateKey(other.getPrivateKey()); + clientEmail(other.getClientEmail()); + lifetimeInSeconds(other.getLifetimeInSeconds()); + return this; + } + + /** + *

Google Firebase Secret. (SDK 2 only).

+ */ + @JsonSetter(value = "secret", nulls = Nulls.SKIP) + public Builder secret(Optional secret) { + this.secret = secret; + return this; + } + + public Builder secret(String secret) { + this.secret = Optional.ofNullable(secret); + return this; + } + + /** + *

Optional ID of the private key to obtain kid header in the issued token (SDK v3+ tokens only).

+ */ + @JsonSetter(value = "private_key_id", nulls = Nulls.SKIP) + public Builder privateKeyId(Optional privateKeyId) { + this.privateKeyId = privateKeyId; + return this; + } + + public Builder privateKeyId(String privateKeyId) { + this.privateKeyId = Optional.ofNullable(privateKeyId); + return this; + } + + /** + *

Private Key for signing the token (SDK v3+ tokens only).

+ */ + @JsonSetter(value = "private_key", nulls = Nulls.SKIP) + public Builder privateKey(Optional privateKey) { + this.privateKey = privateKey; + return this; + } + + public Builder privateKey(String privateKey) { + this.privateKey = Optional.ofNullable(privateKey); + return this; + } + + /** + *

ID of the Service Account you have created (shown as client_email in the generated JSON file, SDK v3+ tokens only).

+ */ + @JsonSetter(value = "client_email", nulls = Nulls.SKIP) + public Builder clientEmail(Optional clientEmail) { + this.clientEmail = clientEmail; + return this; + } + + public Builder clientEmail(String clientEmail) { + this.clientEmail = Optional.ofNullable(clientEmail); + return this; + } + + /** + *

Optional expiration in seconds for the generated token. Defaults to 3600 seconds (SDK v3+ tokens only).

+ */ + @JsonSetter(value = "lifetime_in_seconds", nulls = Nulls.SKIP) + public Builder lifetimeInSeconds(Optional lifetimeInSeconds) { + this.lifetimeInSeconds = lifetimeInSeconds; + return this; + } + + public Builder lifetimeInSeconds(Integer lifetimeInSeconds) { + this.lifetimeInSeconds = Optional.ofNullable(lifetimeInSeconds); + return this; + } + + public ClientAddonFirebase build() { + return new ClientAddonFirebase( + secret, privateKeyId, privateKey, clientEmail, lifetimeInSeconds, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java new file mode 100644 index 000000000..afd68b398 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonLayer.Builder.class) +public final class ClientAddonLayer { + private final String providerId; + + private final String keyId; + + private final String privateKey; + + private final Optional principal; + + private final Optional expiration; + + private final Map additionalProperties; + + private ClientAddonLayer( + String providerId, + String keyId, + String privateKey, + Optional principal, + Optional expiration, + Map additionalProperties) { + this.providerId = providerId; + this.keyId = keyId; + this.privateKey = privateKey; + this.principal = principal; + this.expiration = expiration; + this.additionalProperties = additionalProperties; + } + + /** + * @return Provider ID of your Layer account + */ + @JsonProperty("providerId") + public String getProviderId() { + return providerId; + } + + /** + * @return Authentication Key identifier used to sign the Layer token. + */ + @JsonProperty("keyId") + public String getKeyId() { + return keyId; + } + + /** + * @return Private key for signing the Layer token. + */ + @JsonProperty("privateKey") + public String getPrivateKey() { + return privateKey; + } + + /** + * @return Name of the property used as the unique user id in Layer. If not specified user_id is used. + */ + @JsonProperty("principal") + public Optional getPrincipal() { + return principal; + } + + /** + * @return Optional expiration in minutes for the generated token. Defaults to 5 minutes. + */ + @JsonProperty("expiration") + public Optional getExpiration() { + return expiration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonLayer && equalTo((ClientAddonLayer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonLayer other) { + return providerId.equals(other.providerId) + && keyId.equals(other.keyId) + && privateKey.equals(other.privateKey) + && principal.equals(other.principal) + && expiration.equals(other.expiration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.providerId, this.keyId, this.privateKey, this.principal, this.expiration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderIdStage builder() { + return new Builder(); + } + + public interface ProviderIdStage { + /** + *

Provider ID of your Layer account

+ */ + KeyIdStage providerId(@NotNull String providerId); + + Builder from(ClientAddonLayer other); + } + + public interface KeyIdStage { + /** + *

Authentication Key identifier used to sign the Layer token.

+ */ + PrivateKeyStage keyId(@NotNull String keyId); + } + + public interface PrivateKeyStage { + /** + *

Private key for signing the Layer token.

+ */ + _FinalStage privateKey(@NotNull String privateKey); + } + + public interface _FinalStage { + ClientAddonLayer build(); + + /** + *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

+ */ + _FinalStage principal(Optional principal); + + _FinalStage principal(String principal); + + /** + *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

+ */ + _FinalStage expiration(Optional expiration); + + _FinalStage expiration(Integer expiration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderIdStage, KeyIdStage, PrivateKeyStage, _FinalStage { + private String providerId; + + private String keyId; + + private String privateKey; + + private Optional expiration = Optional.empty(); + + private Optional principal = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientAddonLayer other) { + providerId(other.getProviderId()); + keyId(other.getKeyId()); + privateKey(other.getPrivateKey()); + principal(other.getPrincipal()); + expiration(other.getExpiration()); + return this; + } + + /** + *

Provider ID of your Layer account

+ *

Provider ID of your Layer account

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("providerId") + public KeyIdStage providerId(@NotNull String providerId) { + this.providerId = Objects.requireNonNull(providerId, "providerId must not be null"); + return this; + } + + /** + *

Authentication Key identifier used to sign the Layer token.

+ *

Authentication Key identifier used to sign the Layer token.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("keyId") + public PrivateKeyStage keyId(@NotNull String keyId) { + this.keyId = Objects.requireNonNull(keyId, "keyId must not be null"); + return this; + } + + /** + *

Private key for signing the Layer token.

+ *

Private key for signing the Layer token.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("privateKey") + public _FinalStage privateKey(@NotNull String privateKey) { + this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); + return this; + } + + /** + *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expiration(Integer expiration) { + this.expiration = Optional.ofNullable(expiration); + return this; + } + + /** + *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

+ */ + @java.lang.Override + @JsonSetter(value = "expiration", nulls = Nulls.SKIP) + public _FinalStage expiration(Optional expiration) { + this.expiration = expiration; + return this; + } + + /** + *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage principal(String principal) { + this.principal = Optional.ofNullable(principal); + return this; + } + + /** + *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

+ */ + @java.lang.Override + @JsonSetter(value = "principal", nulls = Nulls.SKIP) + public _FinalStage principal(Optional principal) { + this.principal = principal; + return this; + } + + @java.lang.Override + public ClientAddonLayer build() { + return new ClientAddonLayer(providerId, keyId, privateKey, principal, expiration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java new file mode 100644 index 000000000..b611cd19e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonMscrm.Builder.class) +public final class ClientAddonMscrm { + private final String url; + + private final Map additionalProperties; + + private ClientAddonMscrm(String url, Map additionalProperties) { + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return Microsoft Dynamics CRM application URL. + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonMscrm && equalTo((ClientAddonMscrm) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonMscrm other) { + return url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + /** + *

Microsoft Dynamics CRM application URL.

+ */ + _FinalStage url(@NotNull String url); + + Builder from(ClientAddonMscrm other); + } + + public interface _FinalStage { + ClientAddonMscrm build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, _FinalStage { + private String url; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientAddonMscrm other) { + url(other.getUrl()); + return this; + } + + /** + *

Microsoft Dynamics CRM application URL.

+ *

Microsoft Dynamics CRM application URL.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("url") + public _FinalStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @java.lang.Override + public ClientAddonMscrm build() { + return new ClientAddonMscrm(url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java new file mode 100644 index 000000000..0d939500d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonNewRelic.Builder.class) +public final class ClientAddonNewRelic { + private final Optional account; + + private final Map additionalProperties; + + private ClientAddonNewRelic(Optional account, Map additionalProperties) { + this.account = account; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your New Relic Account ID found in your New Relic URL after the /accounts/ path. e.g. https://rpm.newrelic.com/accounts/123456/query would be 123456. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonNewRelic && equalTo((ClientAddonNewRelic) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonNewRelic other) { + return account.equals(other.account); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.account); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional account = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonNewRelic other) { + account(other.getAccount()); + return this; + } + + /** + *

Your New Relic Account ID found in your New Relic URL after the /accounts/ path. e.g. https://rpm.newrelic.com/accounts/123456/query would be 123456.

+ */ + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + public ClientAddonNewRelic build() { + return new ClientAddonNewRelic(account, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java new file mode 100644 index 000000000..5e4fdd6e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonOag.Builder.class) +public final class ClientAddonOag { + private final Map additionalProperties; + + private ClientAddonOag(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonOag; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonOag other) { + return this; + } + + public ClientAddonOag build() { + return new ClientAddonOag(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java new file mode 100644 index 000000000..e88081415 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonOffice365.Builder.class) +public final class ClientAddonOffice365 { + private final Optional domain; + + private final Optional connection; + + private final Map additionalProperties; + + private ClientAddonOffice365( + Optional domain, Optional connection, Map additionalProperties) { + this.domain = domain; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your Office 365 domain name. e.g. acme-org.com. + */ + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + /** + * @return Optional Auth0 database connection for testing an already-configured Office 365 tenant. + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonOffice365 && equalTo((ClientAddonOffice365) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonOffice365 other) { + return domain.equals(other.domain) && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.domain, this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional domain = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonOffice365 other) { + domain(other.getDomain()); + connection(other.getConnection()); + return this; + } + + /** + *

Your Office 365 domain name. e.g. acme-org.com.

+ */ + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public Builder domain(Optional domain) { + this.domain = domain; + return this; + } + + public Builder domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + *

Optional Auth0 database connection for testing an already-configured Office 365 tenant.

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public ClientAddonOffice365 build() { + return new ClientAddonOffice365(domain, connection, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java new file mode 100644 index 000000000..64ed5c72a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonRms.Builder.class) +public final class ClientAddonRms { + private final String url; + + private final Map additionalProperties; + + private ClientAddonRms(String url, Map additionalProperties) { + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it. + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonRms && equalTo((ClientAddonRms) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonRms other) { + return url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + /** + *

URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it.

+ */ + _FinalStage url(@NotNull String url); + + Builder from(ClientAddonRms other); + } + + public interface _FinalStage { + ClientAddonRms build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, _FinalStage { + private String url; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientAddonRms other) { + url(other.getUrl()); + return this; + } + + /** + *

URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it.

+ *

URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("url") + public _FinalStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @java.lang.Override + public ClientAddonRms build() { + return new ClientAddonRms(url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java new file mode 100644 index 000000000..466a4b580 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSalesforce.Builder.class) +public final class ClientAddonSalesforce { + private final Optional entityId; + + private final Map additionalProperties; + + private ClientAddonSalesforce(Optional entityId, Map additionalProperties) { + this.entityId = entityId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Arbitrary logical URL that identifies the Saleforce resource. e.g. https://acme-org.com. + */ + @JsonProperty("entity_id") + public Optional getEntityId() { + return entityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSalesforce && equalTo((ClientAddonSalesforce) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSalesforce other) { + return entityId.equals(other.entityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.entityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional entityId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSalesforce other) { + entityId(other.getEntityId()); + return this; + } + + /** + *

Arbitrary logical URL that identifies the Saleforce resource. e.g. https://acme-org.com.

+ */ + @JsonSetter(value = "entity_id", nulls = Nulls.SKIP) + public Builder entityId(Optional entityId) { + this.entityId = entityId; + return this; + } + + public Builder entityId(String entityId) { + this.entityId = Optional.ofNullable(entityId); + return this; + } + + public ClientAddonSalesforce build() { + return new ClientAddonSalesforce(entityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java new file mode 100644 index 000000000..ad2557fff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSalesforceApi.Builder.class) +public final class ClientAddonSalesforceApi { + private final Optional clientid; + + private final Optional principal; + + private final Optional communityName; + + private final Optional communityUrlSection; + + private final Map additionalProperties; + + private ClientAddonSalesforceApi( + Optional clientid, + Optional principal, + Optional communityName, + Optional communityUrlSection, + Map additionalProperties) { + this.clientid = clientid; + this.principal = principal; + this.communityName = communityName; + this.communityUrlSection = communityUrlSection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Consumer Key assigned by Salesforce to the Connected App. + */ + @JsonProperty("clientid") + public Optional getClientid() { + return clientid; + } + + /** + * @return Name of the property in the user object that maps to a Salesforce username. e.g. email. + */ + @JsonProperty("principal") + public Optional getPrincipal() { + return principal; + } + + /** + * @return Community name. + */ + @JsonProperty("communityName") + public Optional getCommunityName() { + return communityName; + } + + /** + * @return Community url section. + */ + @JsonProperty("community_url_section") + public Optional getCommunityUrlSection() { + return communityUrlSection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSalesforceApi && equalTo((ClientAddonSalesforceApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSalesforceApi other) { + return clientid.equals(other.clientid) + && principal.equals(other.principal) + && communityName.equals(other.communityName) + && communityUrlSection.equals(other.communityUrlSection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientid = Optional.empty(); + + private Optional principal = Optional.empty(); + + private Optional communityName = Optional.empty(); + + private Optional communityUrlSection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSalesforceApi other) { + clientid(other.getClientid()); + principal(other.getPrincipal()); + communityName(other.getCommunityName()); + communityUrlSection(other.getCommunityUrlSection()); + return this; + } + + /** + *

Consumer Key assigned by Salesforce to the Connected App.

+ */ + @JsonSetter(value = "clientid", nulls = Nulls.SKIP) + public Builder clientid(Optional clientid) { + this.clientid = clientid; + return this; + } + + public Builder clientid(String clientid) { + this.clientid = Optional.ofNullable(clientid); + return this; + } + + /** + *

Name of the property in the user object that maps to a Salesforce username. e.g. email.

+ */ + @JsonSetter(value = "principal", nulls = Nulls.SKIP) + public Builder principal(Optional principal) { + this.principal = principal; + return this; + } + + public Builder principal(String principal) { + this.principal = Optional.ofNullable(principal); + return this; + } + + /** + *

Community name.

+ */ + @JsonSetter(value = "communityName", nulls = Nulls.SKIP) + public Builder communityName(Optional communityName) { + this.communityName = communityName; + return this; + } + + public Builder communityName(String communityName) { + this.communityName = Optional.ofNullable(communityName); + return this; + } + + /** + *

Community url section.

+ */ + @JsonSetter(value = "community_url_section", nulls = Nulls.SKIP) + public Builder communityUrlSection(Optional communityUrlSection) { + this.communityUrlSection = communityUrlSection; + return this; + } + + public Builder communityUrlSection(String communityUrlSection) { + this.communityUrlSection = Optional.ofNullable(communityUrlSection); + return this; + } + + public ClientAddonSalesforceApi build() { + return new ClientAddonSalesforceApi( + clientid, principal, communityName, communityUrlSection, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java new file mode 100644 index 000000000..1f331b506 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSalesforceSandboxApi.Builder.class) +public final class ClientAddonSalesforceSandboxApi { + private final Optional clientid; + + private final Optional principal; + + private final Optional communityName; + + private final Optional communityUrlSection; + + private final Map additionalProperties; + + private ClientAddonSalesforceSandboxApi( + Optional clientid, + Optional principal, + Optional communityName, + Optional communityUrlSection, + Map additionalProperties) { + this.clientid = clientid; + this.principal = principal; + this.communityName = communityName; + this.communityUrlSection = communityUrlSection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Consumer Key assigned by Salesforce to the Connected App. + */ + @JsonProperty("clientid") + public Optional getClientid() { + return clientid; + } + + /** + * @return Name of the property in the user object that maps to a Salesforce username. e.g. email. + */ + @JsonProperty("principal") + public Optional getPrincipal() { + return principal; + } + + /** + * @return Community name. + */ + @JsonProperty("communityName") + public Optional getCommunityName() { + return communityName; + } + + /** + * @return Community url section. + */ + @JsonProperty("community_url_section") + public Optional getCommunityUrlSection() { + return communityUrlSection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSalesforceSandboxApi && equalTo((ClientAddonSalesforceSandboxApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSalesforceSandboxApi other) { + return clientid.equals(other.clientid) + && principal.equals(other.principal) + && communityName.equals(other.communityName) + && communityUrlSection.equals(other.communityUrlSection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientid = Optional.empty(); + + private Optional principal = Optional.empty(); + + private Optional communityName = Optional.empty(); + + private Optional communityUrlSection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSalesforceSandboxApi other) { + clientid(other.getClientid()); + principal(other.getPrincipal()); + communityName(other.getCommunityName()); + communityUrlSection(other.getCommunityUrlSection()); + return this; + } + + /** + *

Consumer Key assigned by Salesforce to the Connected App.

+ */ + @JsonSetter(value = "clientid", nulls = Nulls.SKIP) + public Builder clientid(Optional clientid) { + this.clientid = clientid; + return this; + } + + public Builder clientid(String clientid) { + this.clientid = Optional.ofNullable(clientid); + return this; + } + + /** + *

Name of the property in the user object that maps to a Salesforce username. e.g. email.

+ */ + @JsonSetter(value = "principal", nulls = Nulls.SKIP) + public Builder principal(Optional principal) { + this.principal = principal; + return this; + } + + public Builder principal(String principal) { + this.principal = Optional.ofNullable(principal); + return this; + } + + /** + *

Community name.

+ */ + @JsonSetter(value = "communityName", nulls = Nulls.SKIP) + public Builder communityName(Optional communityName) { + this.communityName = communityName; + return this; + } + + public Builder communityName(String communityName) { + this.communityName = Optional.ofNullable(communityName); + return this; + } + + /** + *

Community url section.

+ */ + @JsonSetter(value = "community_url_section", nulls = Nulls.SKIP) + public Builder communityUrlSection(Optional communityUrlSection) { + this.communityUrlSection = communityUrlSection; + return this; + } + + public Builder communityUrlSection(String communityUrlSection) { + this.communityUrlSection = Optional.ofNullable(communityUrlSection); + return this; + } + + public ClientAddonSalesforceSandboxApi build() { + return new ClientAddonSalesforceSandboxApi( + clientid, principal, communityName, communityUrlSection, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java new file mode 100644 index 000000000..819d7512f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSaml.Builder.class) +public final class ClientAddonSaml { + private final Optional> mappings; + + private final Optional audience; + + private final Optional recipient; + + private final Optional createUpnClaim; + + private final Optional mapUnknownClaimsAsIs; + + private final Optional passthroughClaimsWithNoMapping; + + private final Optional mapIdentities; + + private final Optional signatureAlgorithm; + + private final Optional digestAlgorithm; + + private final Optional issuer; + + private final Optional destination; + + private final Optional lifetimeInSeconds; + + private final Optional signResponse; + + private final Optional nameIdentifierFormat; + + private final Optional> nameIdentifierProbes; + + private final Optional authnContextClassRef; + + private final Map additionalProperties; + + private ClientAddonSaml( + Optional> mappings, + Optional audience, + Optional recipient, + Optional createUpnClaim, + Optional mapUnknownClaimsAsIs, + Optional passthroughClaimsWithNoMapping, + Optional mapIdentities, + Optional signatureAlgorithm, + Optional digestAlgorithm, + Optional issuer, + Optional destination, + Optional lifetimeInSeconds, + Optional signResponse, + Optional nameIdentifierFormat, + Optional> nameIdentifierProbes, + Optional authnContextClassRef, + Map additionalProperties) { + this.mappings = mappings; + this.audience = audience; + this.recipient = recipient; + this.createUpnClaim = createUpnClaim; + this.mapUnknownClaimsAsIs = mapUnknownClaimsAsIs; + this.passthroughClaimsWithNoMapping = passthroughClaimsWithNoMapping; + this.mapIdentities = mapIdentities; + this.signatureAlgorithm = signatureAlgorithm; + this.digestAlgorithm = digestAlgorithm; + this.issuer = issuer; + this.destination = destination; + this.lifetimeInSeconds = lifetimeInSeconds; + this.signResponse = signResponse; + this.nameIdentifierFormat = nameIdentifierFormat; + this.nameIdentifierProbes = nameIdentifierProbes; + this.authnContextClassRef = authnContextClassRef; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mappings") + public Optional> getMappings() { + return mappings; + } + + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + @JsonProperty("recipient") + public Optional getRecipient() { + return recipient; + } + + @JsonProperty("createUpnClaim") + public Optional getCreateUpnClaim() { + return createUpnClaim; + } + + @JsonProperty("mapUnknownClaimsAsIs") + public Optional getMapUnknownClaimsAsIs() { + return mapUnknownClaimsAsIs; + } + + @JsonProperty("passthroughClaimsWithNoMapping") + public Optional getPassthroughClaimsWithNoMapping() { + return passthroughClaimsWithNoMapping; + } + + @JsonProperty("mapIdentities") + public Optional getMapIdentities() { + return mapIdentities; + } + + @JsonProperty("signatureAlgorithm") + public Optional getSignatureAlgorithm() { + return signatureAlgorithm; + } + + @JsonProperty("digestAlgorithm") + public Optional getDigestAlgorithm() { + return digestAlgorithm; + } + + @JsonProperty("issuer") + public Optional getIssuer() { + return issuer; + } + + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @JsonProperty("lifetimeInSeconds") + public Optional getLifetimeInSeconds() { + return lifetimeInSeconds; + } + + @JsonProperty("signResponse") + public Optional getSignResponse() { + return signResponse; + } + + @JsonProperty("nameIdentifierFormat") + public Optional getNameIdentifierFormat() { + return nameIdentifierFormat; + } + + @JsonProperty("nameIdentifierProbes") + public Optional> getNameIdentifierProbes() { + return nameIdentifierProbes; + } + + @JsonProperty("authnContextClassRef") + public Optional getAuthnContextClassRef() { + return authnContextClassRef; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSaml && equalTo((ClientAddonSaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSaml other) { + return mappings.equals(other.mappings) + && audience.equals(other.audience) + && recipient.equals(other.recipient) + && createUpnClaim.equals(other.createUpnClaim) + && mapUnknownClaimsAsIs.equals(other.mapUnknownClaimsAsIs) + && passthroughClaimsWithNoMapping.equals(other.passthroughClaimsWithNoMapping) + && mapIdentities.equals(other.mapIdentities) + && signatureAlgorithm.equals(other.signatureAlgorithm) + && digestAlgorithm.equals(other.digestAlgorithm) + && issuer.equals(other.issuer) + && destination.equals(other.destination) + && lifetimeInSeconds.equals(other.lifetimeInSeconds) + && signResponse.equals(other.signResponse) + && nameIdentifierFormat.equals(other.nameIdentifierFormat) + && nameIdentifierProbes.equals(other.nameIdentifierProbes) + && authnContextClassRef.equals(other.authnContextClassRef); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.mappings, + this.audience, + this.recipient, + this.createUpnClaim, + this.mapUnknownClaimsAsIs, + this.passthroughClaimsWithNoMapping, + this.mapIdentities, + this.signatureAlgorithm, + this.digestAlgorithm, + this.issuer, + this.destination, + this.lifetimeInSeconds, + this.signResponse, + this.nameIdentifierFormat, + this.nameIdentifierProbes, + this.authnContextClassRef); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> mappings = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional recipient = Optional.empty(); + + private Optional createUpnClaim = Optional.empty(); + + private Optional mapUnknownClaimsAsIs = Optional.empty(); + + private Optional passthroughClaimsWithNoMapping = Optional.empty(); + + private Optional mapIdentities = Optional.empty(); + + private Optional signatureAlgorithm = Optional.empty(); + + private Optional digestAlgorithm = Optional.empty(); + + private Optional issuer = Optional.empty(); + + private Optional destination = Optional.empty(); + + private Optional lifetimeInSeconds = Optional.empty(); + + private Optional signResponse = Optional.empty(); + + private Optional nameIdentifierFormat = Optional.empty(); + + private Optional> nameIdentifierProbes = Optional.empty(); + + private Optional authnContextClassRef = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSaml other) { + mappings(other.getMappings()); + audience(other.getAudience()); + recipient(other.getRecipient()); + createUpnClaim(other.getCreateUpnClaim()); + mapUnknownClaimsAsIs(other.getMapUnknownClaimsAsIs()); + passthroughClaimsWithNoMapping(other.getPassthroughClaimsWithNoMapping()); + mapIdentities(other.getMapIdentities()); + signatureAlgorithm(other.getSignatureAlgorithm()); + digestAlgorithm(other.getDigestAlgorithm()); + issuer(other.getIssuer()); + destination(other.getDestination()); + lifetimeInSeconds(other.getLifetimeInSeconds()); + signResponse(other.getSignResponse()); + nameIdentifierFormat(other.getNameIdentifierFormat()); + nameIdentifierProbes(other.getNameIdentifierProbes()); + authnContextClassRef(other.getAuthnContextClassRef()); + return this; + } + + @JsonSetter(value = "mappings", nulls = Nulls.SKIP) + public Builder mappings(Optional> mappings) { + this.mappings = mappings; + return this; + } + + public Builder mappings(Map mappings) { + this.mappings = Optional.ofNullable(mappings); + return this; + } + + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + @JsonSetter(value = "recipient", nulls = Nulls.SKIP) + public Builder recipient(Optional recipient) { + this.recipient = recipient; + return this; + } + + public Builder recipient(String recipient) { + this.recipient = Optional.ofNullable(recipient); + return this; + } + + @JsonSetter(value = "createUpnClaim", nulls = Nulls.SKIP) + public Builder createUpnClaim(Optional createUpnClaim) { + this.createUpnClaim = createUpnClaim; + return this; + } + + public Builder createUpnClaim(Boolean createUpnClaim) { + this.createUpnClaim = Optional.ofNullable(createUpnClaim); + return this; + } + + @JsonSetter(value = "mapUnknownClaimsAsIs", nulls = Nulls.SKIP) + public Builder mapUnknownClaimsAsIs(Optional mapUnknownClaimsAsIs) { + this.mapUnknownClaimsAsIs = mapUnknownClaimsAsIs; + return this; + } + + public Builder mapUnknownClaimsAsIs(Boolean mapUnknownClaimsAsIs) { + this.mapUnknownClaimsAsIs = Optional.ofNullable(mapUnknownClaimsAsIs); + return this; + } + + @JsonSetter(value = "passthroughClaimsWithNoMapping", nulls = Nulls.SKIP) + public Builder passthroughClaimsWithNoMapping(Optional passthroughClaimsWithNoMapping) { + this.passthroughClaimsWithNoMapping = passthroughClaimsWithNoMapping; + return this; + } + + public Builder passthroughClaimsWithNoMapping(Boolean passthroughClaimsWithNoMapping) { + this.passthroughClaimsWithNoMapping = Optional.ofNullable(passthroughClaimsWithNoMapping); + return this; + } + + @JsonSetter(value = "mapIdentities", nulls = Nulls.SKIP) + public Builder mapIdentities(Optional mapIdentities) { + this.mapIdentities = mapIdentities; + return this; + } + + public Builder mapIdentities(Boolean mapIdentities) { + this.mapIdentities = Optional.ofNullable(mapIdentities); + return this; + } + + @JsonSetter(value = "signatureAlgorithm", nulls = Nulls.SKIP) + public Builder signatureAlgorithm(Optional signatureAlgorithm) { + this.signatureAlgorithm = signatureAlgorithm; + return this; + } + + public Builder signatureAlgorithm(String signatureAlgorithm) { + this.signatureAlgorithm = Optional.ofNullable(signatureAlgorithm); + return this; + } + + @JsonSetter(value = "digestAlgorithm", nulls = Nulls.SKIP) + public Builder digestAlgorithm(Optional digestAlgorithm) { + this.digestAlgorithm = digestAlgorithm; + return this; + } + + public Builder digestAlgorithm(String digestAlgorithm) { + this.digestAlgorithm = Optional.ofNullable(digestAlgorithm); + return this; + } + + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public Builder issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + public Builder issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(String destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "lifetimeInSeconds", nulls = Nulls.SKIP) + public Builder lifetimeInSeconds(Optional lifetimeInSeconds) { + this.lifetimeInSeconds = lifetimeInSeconds; + return this; + } + + public Builder lifetimeInSeconds(Integer lifetimeInSeconds) { + this.lifetimeInSeconds = Optional.ofNullable(lifetimeInSeconds); + return this; + } + + @JsonSetter(value = "signResponse", nulls = Nulls.SKIP) + public Builder signResponse(Optional signResponse) { + this.signResponse = signResponse; + return this; + } + + public Builder signResponse(Boolean signResponse) { + this.signResponse = Optional.ofNullable(signResponse); + return this; + } + + @JsonSetter(value = "nameIdentifierFormat", nulls = Nulls.SKIP) + public Builder nameIdentifierFormat(Optional nameIdentifierFormat) { + this.nameIdentifierFormat = nameIdentifierFormat; + return this; + } + + public Builder nameIdentifierFormat(String nameIdentifierFormat) { + this.nameIdentifierFormat = Optional.ofNullable(nameIdentifierFormat); + return this; + } + + @JsonSetter(value = "nameIdentifierProbes", nulls = Nulls.SKIP) + public Builder nameIdentifierProbes(Optional> nameIdentifierProbes) { + this.nameIdentifierProbes = nameIdentifierProbes; + return this; + } + + public Builder nameIdentifierProbes(List nameIdentifierProbes) { + this.nameIdentifierProbes = Optional.ofNullable(nameIdentifierProbes); + return this; + } + + @JsonSetter(value = "authnContextClassRef", nulls = Nulls.SKIP) + public Builder authnContextClassRef(Optional authnContextClassRef) { + this.authnContextClassRef = authnContextClassRef; + return this; + } + + public Builder authnContextClassRef(String authnContextClassRef) { + this.authnContextClassRef = Optional.ofNullable(authnContextClassRef); + return this; + } + + public ClientAddonSaml build() { + return new ClientAddonSaml( + mappings, + audience, + recipient, + createUpnClaim, + mapUnknownClaimsAsIs, + passthroughClaimsWithNoMapping, + mapIdentities, + signatureAlgorithm, + digestAlgorithm, + issuer, + destination, + lifetimeInSeconds, + signResponse, + nameIdentifierFormat, + nameIdentifierProbes, + authnContextClassRef, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java new file mode 100644 index 000000000..22970031e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSapapi.Builder.class) +public final class ClientAddonSapapi { + private final Optional clientid; + + private final Optional usernameAttribute; + + private final Optional tokenEndpointUrl; + + private final Optional scope; + + private final Optional servicePassword; + + private final Optional nameIdentifierFormat; + + private final Map additionalProperties; + + private ClientAddonSapapi( + Optional clientid, + Optional usernameAttribute, + Optional tokenEndpointUrl, + Optional scope, + Optional servicePassword, + Optional nameIdentifierFormat, + Map additionalProperties) { + this.clientid = clientid; + this.usernameAttribute = usernameAttribute; + this.tokenEndpointUrl = tokenEndpointUrl; + this.scope = scope; + this.servicePassword = servicePassword; + this.nameIdentifierFormat = nameIdentifierFormat; + this.additionalProperties = additionalProperties; + } + + /** + * @return If activated in the OAuth 2.0 client configuration (transaction SOAUTH2) the SAML attribute client_id must be set and equal the client_id form parameter of the access token request. + */ + @JsonProperty("clientid") + public Optional getClientid() { + return clientid; + } + + /** + * @return Name of the property in the user object that maps to a SAP username. e.g. email. + */ + @JsonProperty("usernameAttribute") + public Optional getUsernameAttribute() { + return usernameAttribute; + } + + /** + * @return Your SAP OData server OAuth2 token endpoint URL. + */ + @JsonProperty("tokenEndpointUrl") + public Optional getTokenEndpointUrl() { + return tokenEndpointUrl; + } + + /** + * @return Requested scope for SAP APIs. + */ + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + /** + * @return Service account password to use to authenticate API calls to the token endpoint. + */ + @JsonProperty("servicePassword") + public Optional getServicePassword() { + return servicePassword; + } + + /** + * @return NameID element of the Subject which can be used to express the user's identity. Defaults to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified. + */ + @JsonProperty("nameIdentifierFormat") + public Optional getNameIdentifierFormat() { + return nameIdentifierFormat; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSapapi && equalTo((ClientAddonSapapi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSapapi other) { + return clientid.equals(other.clientid) + && usernameAttribute.equals(other.usernameAttribute) + && tokenEndpointUrl.equals(other.tokenEndpointUrl) + && scope.equals(other.scope) + && servicePassword.equals(other.servicePassword) + && nameIdentifierFormat.equals(other.nameIdentifierFormat); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientid, + this.usernameAttribute, + this.tokenEndpointUrl, + this.scope, + this.servicePassword, + this.nameIdentifierFormat); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientid = Optional.empty(); + + private Optional usernameAttribute = Optional.empty(); + + private Optional tokenEndpointUrl = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional servicePassword = Optional.empty(); + + private Optional nameIdentifierFormat = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSapapi other) { + clientid(other.getClientid()); + usernameAttribute(other.getUsernameAttribute()); + tokenEndpointUrl(other.getTokenEndpointUrl()); + scope(other.getScope()); + servicePassword(other.getServicePassword()); + nameIdentifierFormat(other.getNameIdentifierFormat()); + return this; + } + + /** + *

If activated in the OAuth 2.0 client configuration (transaction SOAUTH2) the SAML attribute client_id must be set and equal the client_id form parameter of the access token request.

+ */ + @JsonSetter(value = "clientid", nulls = Nulls.SKIP) + public Builder clientid(Optional clientid) { + this.clientid = clientid; + return this; + } + + public Builder clientid(String clientid) { + this.clientid = Optional.ofNullable(clientid); + return this; + } + + /** + *

Name of the property in the user object that maps to a SAP username. e.g. email.

+ */ + @JsonSetter(value = "usernameAttribute", nulls = Nulls.SKIP) + public Builder usernameAttribute(Optional usernameAttribute) { + this.usernameAttribute = usernameAttribute; + return this; + } + + public Builder usernameAttribute(String usernameAttribute) { + this.usernameAttribute = Optional.ofNullable(usernameAttribute); + return this; + } + + /** + *

Your SAP OData server OAuth2 token endpoint URL.

+ */ + @JsonSetter(value = "tokenEndpointUrl", nulls = Nulls.SKIP) + public Builder tokenEndpointUrl(Optional tokenEndpointUrl) { + this.tokenEndpointUrl = tokenEndpointUrl; + return this; + } + + public Builder tokenEndpointUrl(String tokenEndpointUrl) { + this.tokenEndpointUrl = Optional.ofNullable(tokenEndpointUrl); + return this; + } + + /** + *

Requested scope for SAP APIs.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + /** + *

Service account password to use to authenticate API calls to the token endpoint.

+ */ + @JsonSetter(value = "servicePassword", nulls = Nulls.SKIP) + public Builder servicePassword(Optional servicePassword) { + this.servicePassword = servicePassword; + return this; + } + + public Builder servicePassword(String servicePassword) { + this.servicePassword = Optional.ofNullable(servicePassword); + return this; + } + + /** + *

NameID element of the Subject which can be used to express the user's identity. Defaults to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified.

+ */ + @JsonSetter(value = "nameIdentifierFormat", nulls = Nulls.SKIP) + public Builder nameIdentifierFormat(Optional nameIdentifierFormat) { + this.nameIdentifierFormat = nameIdentifierFormat; + return this; + } + + public Builder nameIdentifierFormat(String nameIdentifierFormat) { + this.nameIdentifierFormat = Optional.ofNullable(nameIdentifierFormat); + return this; + } + + public ClientAddonSapapi build() { + return new ClientAddonSapapi( + clientid, + usernameAttribute, + tokenEndpointUrl, + scope, + servicePassword, + nameIdentifierFormat, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java new file mode 100644 index 000000000..074a04fe4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSentry.Builder.class) +public final class ClientAddonSentry { + private final Optional orgSlug; + + private final Optional baseUrl; + + private final Map additionalProperties; + + private ClientAddonSentry( + Optional orgSlug, Optional baseUrl, Map additionalProperties) { + this.orgSlug = orgSlug; + this.baseUrl = baseUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return Generated slug for your Sentry organization. Found in your Sentry URL. e.g. https://sentry.acme.com/acme-org/ would be acme-org. + */ + @JsonProperty("org_slug") + public Optional getOrgSlug() { + return orgSlug; + } + + /** + * @return URL prefix only if running Sentry Community Edition, otherwise leave should be blank. + */ + @JsonProperty("base_url") + public Optional getBaseUrl() { + return baseUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSentry && equalTo((ClientAddonSentry) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSentry other) { + return orgSlug.equals(other.orgSlug) && baseUrl.equals(other.baseUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.orgSlug, this.baseUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional orgSlug = Optional.empty(); + + private Optional baseUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSentry other) { + orgSlug(other.getOrgSlug()); + baseUrl(other.getBaseUrl()); + return this; + } + + /** + *

Generated slug for your Sentry organization. Found in your Sentry URL. e.g. https://sentry.acme.com/acme-org/ would be acme-org.

+ */ + @JsonSetter(value = "org_slug", nulls = Nulls.SKIP) + public Builder orgSlug(Optional orgSlug) { + this.orgSlug = orgSlug; + return this; + } + + public Builder orgSlug(String orgSlug) { + this.orgSlug = Optional.ofNullable(orgSlug); + return this; + } + + /** + *

URL prefix only if running Sentry Community Edition, otherwise leave should be blank.

+ */ + @JsonSetter(value = "base_url", nulls = Nulls.SKIP) + public Builder baseUrl(Optional baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + public Builder baseUrl(String baseUrl) { + this.baseUrl = Optional.ofNullable(baseUrl); + return this; + } + + public ClientAddonSentry build() { + return new ClientAddonSentry(orgSlug, baseUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java new file mode 100644 index 000000000..721234415 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSharePoint.Builder.class) +public final class ClientAddonSharePoint { + private final Optional url; + + private final Optional externalUrl; + + private final Map additionalProperties; + + private ClientAddonSharePoint( + Optional url, + Optional externalUrl, + Map additionalProperties) { + this.url = url; + this.externalUrl = externalUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return Internal SharePoint application URL. + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + @JsonProperty("external_url") + public Optional getExternalUrl() { + return externalUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSharePoint && equalTo((ClientAddonSharePoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSharePoint other) { + return url.equals(other.url) && externalUrl.equals(other.externalUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.externalUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional url = Optional.empty(); + + private Optional externalUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSharePoint other) { + url(other.getUrl()); + externalUrl(other.getExternalUrl()); + return this; + } + + /** + *

Internal SharePoint application URL.

+ */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + @JsonSetter(value = "external_url", nulls = Nulls.SKIP) + public Builder externalUrl(Optional externalUrl) { + this.externalUrl = externalUrl; + return this; + } + + public Builder externalUrl(ClientAddonSharePointExternalUrl externalUrl) { + this.externalUrl = Optional.ofNullable(externalUrl); + return this; + } + + public ClientAddonSharePoint build() { + return new ClientAddonSharePoint(url, externalUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java new file mode 100644 index 000000000..10ef211d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = ClientAddonSharePointExternalUrl.Deserializer.class) +public final class ClientAddonSharePointExternalUrl { + private final Object value; + + private final int type; + + private ClientAddonSharePointExternalUrl(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((List) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSharePointExternalUrl && equalTo((ClientAddonSharePointExternalUrl) other); + } + + private boolean equalTo(ClientAddonSharePointExternalUrl other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ClientAddonSharePointExternalUrl of(List value) { + return new ClientAddonSharePointExternalUrl(value, 0); + } + + public static ClientAddonSharePointExternalUrl of(String value) { + return new ClientAddonSharePointExternalUrl(value, 1); + } + + public interface Visitor { + T visit(List value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ClientAddonSharePointExternalUrl.class); + } + + @java.lang.Override + public ClientAddonSharePointExternalUrl deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSlack.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSlack.java new file mode 100644 index 000000000..281cdedb7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSlack.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSlack.Builder.class) +public final class ClientAddonSlack { + private final String team; + + private final Map additionalProperties; + + private ClientAddonSlack(String team, Map additionalProperties) { + this.team = team; + this.additionalProperties = additionalProperties; + } + + /** + * @return Slack team name. + */ + @JsonProperty("team") + public String getTeam() { + return team; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSlack && equalTo((ClientAddonSlack) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSlack other) { + return team.equals(other.team); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.team); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TeamStage builder() { + return new Builder(); + } + + public interface TeamStage { + /** + *

Slack team name.

+ */ + _FinalStage team(@NotNull String team); + + Builder from(ClientAddonSlack other); + } + + public interface _FinalStage { + ClientAddonSlack build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TeamStage, _FinalStage { + private String team; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientAddonSlack other) { + team(other.getTeam()); + return this; + } + + /** + *

Slack team name.

+ *

Slack team name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("team") + public _FinalStage team(@NotNull String team) { + this.team = Objects.requireNonNull(team, "team must not be null"); + return this; + } + + @java.lang.Override + public ClientAddonSlack build() { + return new ClientAddonSlack(team, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java new file mode 100644 index 000000000..006352f1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSpringCm.Builder.class) +public final class ClientAddonSpringCm { + private final Optional acsurl; + + private final Map additionalProperties; + + private ClientAddonSpringCm(Optional acsurl, Map additionalProperties) { + this.acsurl = acsurl; + this.additionalProperties = additionalProperties; + } + + /** + * @return SpringCM ACS URL, e.g. https://na11.springcm.com/atlas/sso/SSOEndpoint.ashx. + */ + @JsonProperty("acsurl") + public Optional getAcsurl() { + return acsurl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSpringCm && equalTo((ClientAddonSpringCm) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSpringCm other) { + return acsurl.equals(other.acsurl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsurl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional acsurl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSpringCm other) { + acsurl(other.getAcsurl()); + return this; + } + + /** + *

SpringCM ACS URL, e.g. https://na11.springcm.com/atlas/sso/SSOEndpoint.ashx.

+ */ + @JsonSetter(value = "acsurl", nulls = Nulls.SKIP) + public Builder acsurl(Optional acsurl) { + this.acsurl = acsurl; + return this; + } + + public Builder acsurl(String acsurl) { + this.acsurl = Optional.ofNullable(acsurl); + return this; + } + + public ClientAddonSpringCm build() { + return new ClientAddonSpringCm(acsurl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java new file mode 100644 index 000000000..41c6a40e5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonSsoIntegration.Builder.class) +public final class ClientAddonSsoIntegration { + private final Optional name; + + private final Optional version; + + private final Map additionalProperties; + + private ClientAddonSsoIntegration( + Optional name, Optional version, Map additionalProperties) { + this.name = name; + this.version = version; + this.additionalProperties = additionalProperties; + } + + /** + * @return SSO integration name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return SSO integration version installed + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonSsoIntegration && equalTo((ClientAddonSsoIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonSsoIntegration other) { + return name.equals(other.name) && version.equals(other.version); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.version); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonSsoIntegration other) { + name(other.getName()); + version(other.getVersion()); + return this; + } + + /** + *

SSO integration name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

SSO integration version installed

+ */ + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public Builder version(Optional version) { + this.version = version; + return this; + } + + public Builder version(String version) { + this.version = Optional.ofNullable(version); + return this; + } + + public ClientAddonSsoIntegration build() { + return new ClientAddonSsoIntegration(name, version, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java new file mode 100644 index 000000000..f42f26c3c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonWams.Builder.class) +public final class ClientAddonWams { + private final Optional masterkey; + + private final Map additionalProperties; + + private ClientAddonWams(Optional masterkey, Map additionalProperties) { + this.masterkey = masterkey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your master key for Windows Azure Mobile Services. + */ + @JsonProperty("masterkey") + public Optional getMasterkey() { + return masterkey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonWams && equalTo((ClientAddonWams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonWams other) { + return masterkey.equals(other.masterkey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.masterkey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional masterkey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonWams other) { + masterkey(other.getMasterkey()); + return this; + } + + /** + *

Your master key for Windows Azure Mobile Services.

+ */ + @JsonSetter(value = "masterkey", nulls = Nulls.SKIP) + public Builder masterkey(Optional masterkey) { + this.masterkey = masterkey; + return this; + } + + public Builder masterkey(String masterkey) { + this.masterkey = Optional.ofNullable(masterkey); + return this; + } + + public ClientAddonWams build() { + return new ClientAddonWams(masterkey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java new file mode 100644 index 000000000..820a210e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonZendesk.Builder.class) +public final class ClientAddonZendesk { + private final Optional accountName; + + private final Map additionalProperties; + + private ClientAddonZendesk(Optional accountName, Map additionalProperties) { + this.accountName = accountName; + this.additionalProperties = additionalProperties; + } + + /** + * @return Zendesk account name usually first segment in your Zendesk URL. e.g. https://acme-org.zendesk.com would be acme-org. + */ + @JsonProperty("accountName") + public Optional getAccountName() { + return accountName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonZendesk && equalTo((ClientAddonZendesk) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonZendesk other) { + return accountName.equals(other.accountName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonZendesk other) { + accountName(other.getAccountName()); + return this; + } + + /** + *

Zendesk account name usually first segment in your Zendesk URL. e.g. https://acme-org.zendesk.com would be acme-org.

+ */ + @JsonSetter(value = "accountName", nulls = Nulls.SKIP) + public Builder accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + public Builder accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + public ClientAddonZendesk build() { + return new ClientAddonZendesk(accountName, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java new file mode 100644 index 000000000..b7227fb21 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddonZoom.Builder.class) +public final class ClientAddonZoom { + private final Optional account; + + private final Map additionalProperties; + + private ClientAddonZoom(Optional account, Map additionalProperties) { + this.account = account; + this.additionalProperties = additionalProperties; + } + + /** + * @return Zoom account name usually first segment of your Zoom URL, e.g. https://acme-org.zoom.us would be acme-org. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddonZoom && equalTo((ClientAddonZoom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddonZoom other) { + return account.equals(other.account); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.account); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional account = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddonZoom other) { + account(other.getAccount()); + return this; + } + + /** + *

Zoom account name usually first segment of your Zoom URL, e.g. https://acme-org.zoom.us would be acme-org.

+ */ + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + public ClientAddonZoom build() { + return new ClientAddonZoom(account, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java new file mode 100644 index 000000000..ef0a3f3cb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java @@ -0,0 +1,887 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAddons.Builder.class) +public final class ClientAddons { + private final Optional aws; + + private final Optional azureBlob; + + private final Optional azureSb; + + private final Optional rms; + + private final Optional mscrm; + + private final Optional slack; + + private final Optional sentry; + + private final Optional> box; + + private final Optional> cloudbees; + + private final Optional> concur; + + private final Optional> dropbox; + + private final Optional echosign; + + private final Optional egnyte; + + private final Optional firebase; + + private final Optional newrelic; + + private final Optional office365; + + private final Optional salesforce; + + private final Optional salesforceApi; + + private final Optional salesforceSandboxApi; + + private final Optional samlp; + + private final Optional layer; + + private final Optional sapApi; + + private final Optional sharepoint; + + private final Optional springcm; + + private final Optional wams; + + private final Optional> wsfed; + + private final Optional zendesk; + + private final Optional zoom; + + private final Optional ssoIntegration; + + private final OptionalNullable oag; + + private final Map additionalProperties; + + private ClientAddons( + Optional aws, + Optional azureBlob, + Optional azureSb, + Optional rms, + Optional mscrm, + Optional slack, + Optional sentry, + Optional> box, + Optional> cloudbees, + Optional> concur, + Optional> dropbox, + Optional echosign, + Optional egnyte, + Optional firebase, + Optional newrelic, + Optional office365, + Optional salesforce, + Optional salesforceApi, + Optional salesforceSandboxApi, + Optional samlp, + Optional layer, + Optional sapApi, + Optional sharepoint, + Optional springcm, + Optional wams, + Optional> wsfed, + Optional zendesk, + Optional zoom, + Optional ssoIntegration, + OptionalNullable oag, + Map additionalProperties) { + this.aws = aws; + this.azureBlob = azureBlob; + this.azureSb = azureSb; + this.rms = rms; + this.mscrm = mscrm; + this.slack = slack; + this.sentry = sentry; + this.box = box; + this.cloudbees = cloudbees; + this.concur = concur; + this.dropbox = dropbox; + this.echosign = echosign; + this.egnyte = egnyte; + this.firebase = firebase; + this.newrelic = newrelic; + this.office365 = office365; + this.salesforce = salesforce; + this.salesforceApi = salesforceApi; + this.salesforceSandboxApi = salesforceSandboxApi; + this.samlp = samlp; + this.layer = layer; + this.sapApi = sapApi; + this.sharepoint = sharepoint; + this.springcm = springcm; + this.wams = wams; + this.wsfed = wsfed; + this.zendesk = zendesk; + this.zoom = zoom; + this.ssoIntegration = ssoIntegration; + this.oag = oag; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("aws") + public Optional getAws() { + return aws; + } + + @JsonProperty("azure_blob") + public Optional getAzureBlob() { + return azureBlob; + } + + @JsonProperty("azure_sb") + public Optional getAzureSb() { + return azureSb; + } + + @JsonProperty("rms") + public Optional getRms() { + return rms; + } + + @JsonProperty("mscrm") + public Optional getMscrm() { + return mscrm; + } + + @JsonProperty("slack") + public Optional getSlack() { + return slack; + } + + @JsonProperty("sentry") + public Optional getSentry() { + return sentry; + } + + @JsonProperty("box") + public Optional> getBox() { + return box; + } + + @JsonProperty("cloudbees") + public Optional> getCloudbees() { + return cloudbees; + } + + @JsonProperty("concur") + public Optional> getConcur() { + return concur; + } + + @JsonProperty("dropbox") + public Optional> getDropbox() { + return dropbox; + } + + @JsonProperty("echosign") + public Optional getEchosign() { + return echosign; + } + + @JsonProperty("egnyte") + public Optional getEgnyte() { + return egnyte; + } + + @JsonProperty("firebase") + public Optional getFirebase() { + return firebase; + } + + @JsonProperty("newrelic") + public Optional getNewrelic() { + return newrelic; + } + + @JsonProperty("office365") + public Optional getOffice365() { + return office365; + } + + @JsonProperty("salesforce") + public Optional getSalesforce() { + return salesforce; + } + + @JsonProperty("salesforce_api") + public Optional getSalesforceApi() { + return salesforceApi; + } + + @JsonProperty("salesforce_sandbox_api") + public Optional getSalesforceSandboxApi() { + return salesforceSandboxApi; + } + + @JsonProperty("samlp") + public Optional getSamlp() { + return samlp; + } + + @JsonProperty("layer") + public Optional getLayer() { + return layer; + } + + @JsonProperty("sap_api") + public Optional getSapApi() { + return sapApi; + } + + @JsonProperty("sharepoint") + public Optional getSharepoint() { + return sharepoint; + } + + @JsonProperty("springcm") + public Optional getSpringcm() { + return springcm; + } + + @JsonProperty("wams") + public Optional getWams() { + return wams; + } + + @JsonProperty("wsfed") + public Optional> getWsfed() { + return wsfed; + } + + @JsonProperty("zendesk") + public Optional getZendesk() { + return zendesk; + } + + @JsonProperty("zoom") + public Optional getZoom() { + return zoom; + } + + @JsonProperty("sso_integration") + public Optional getSsoIntegration() { + return ssoIntegration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("oag") + public OptionalNullable getOag() { + if (oag == null) { + return OptionalNullable.absent(); + } + return oag; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("oag") + private OptionalNullable _getOag() { + return oag; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAddons && equalTo((ClientAddons) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAddons other) { + return aws.equals(other.aws) + && azureBlob.equals(other.azureBlob) + && azureSb.equals(other.azureSb) + && rms.equals(other.rms) + && mscrm.equals(other.mscrm) + && slack.equals(other.slack) + && sentry.equals(other.sentry) + && box.equals(other.box) + && cloudbees.equals(other.cloudbees) + && concur.equals(other.concur) + && dropbox.equals(other.dropbox) + && echosign.equals(other.echosign) + && egnyte.equals(other.egnyte) + && firebase.equals(other.firebase) + && newrelic.equals(other.newrelic) + && office365.equals(other.office365) + && salesforce.equals(other.salesforce) + && salesforceApi.equals(other.salesforceApi) + && salesforceSandboxApi.equals(other.salesforceSandboxApi) + && samlp.equals(other.samlp) + && layer.equals(other.layer) + && sapApi.equals(other.sapApi) + && sharepoint.equals(other.sharepoint) + && springcm.equals(other.springcm) + && wams.equals(other.wams) + && wsfed.equals(other.wsfed) + && zendesk.equals(other.zendesk) + && zoom.equals(other.zoom) + && ssoIntegration.equals(other.ssoIntegration) + && oag.equals(other.oag); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.aws, + this.azureBlob, + this.azureSb, + this.rms, + this.mscrm, + this.slack, + this.sentry, + this.box, + this.cloudbees, + this.concur, + this.dropbox, + this.echosign, + this.egnyte, + this.firebase, + this.newrelic, + this.office365, + this.salesforce, + this.salesforceApi, + this.salesforceSandboxApi, + this.samlp, + this.layer, + this.sapApi, + this.sharepoint, + this.springcm, + this.wams, + this.wsfed, + this.zendesk, + this.zoom, + this.ssoIntegration, + this.oag); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional aws = Optional.empty(); + + private Optional azureBlob = Optional.empty(); + + private Optional azureSb = Optional.empty(); + + private Optional rms = Optional.empty(); + + private Optional mscrm = Optional.empty(); + + private Optional slack = Optional.empty(); + + private Optional sentry = Optional.empty(); + + private Optional> box = Optional.empty(); + + private Optional> cloudbees = Optional.empty(); + + private Optional> concur = Optional.empty(); + + private Optional> dropbox = Optional.empty(); + + private Optional echosign = Optional.empty(); + + private Optional egnyte = Optional.empty(); + + private Optional firebase = Optional.empty(); + + private Optional newrelic = Optional.empty(); + + private Optional office365 = Optional.empty(); + + private Optional salesforce = Optional.empty(); + + private Optional salesforceApi = Optional.empty(); + + private Optional salesforceSandboxApi = Optional.empty(); + + private Optional samlp = Optional.empty(); + + private Optional layer = Optional.empty(); + + private Optional sapApi = Optional.empty(); + + private Optional sharepoint = Optional.empty(); + + private Optional springcm = Optional.empty(); + + private Optional wams = Optional.empty(); + + private Optional> wsfed = Optional.empty(); + + private Optional zendesk = Optional.empty(); + + private Optional zoom = Optional.empty(); + + private Optional ssoIntegration = Optional.empty(); + + private OptionalNullable oag = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAddons other) { + aws(other.getAws()); + azureBlob(other.getAzureBlob()); + azureSb(other.getAzureSb()); + rms(other.getRms()); + mscrm(other.getMscrm()); + slack(other.getSlack()); + sentry(other.getSentry()); + box(other.getBox()); + cloudbees(other.getCloudbees()); + concur(other.getConcur()); + dropbox(other.getDropbox()); + echosign(other.getEchosign()); + egnyte(other.getEgnyte()); + firebase(other.getFirebase()); + newrelic(other.getNewrelic()); + office365(other.getOffice365()); + salesforce(other.getSalesforce()); + salesforceApi(other.getSalesforceApi()); + salesforceSandboxApi(other.getSalesforceSandboxApi()); + samlp(other.getSamlp()); + layer(other.getLayer()); + sapApi(other.getSapApi()); + sharepoint(other.getSharepoint()); + springcm(other.getSpringcm()); + wams(other.getWams()); + wsfed(other.getWsfed()); + zendesk(other.getZendesk()); + zoom(other.getZoom()); + ssoIntegration(other.getSsoIntegration()); + oag(other.getOag()); + return this; + } + + @JsonSetter(value = "aws", nulls = Nulls.SKIP) + public Builder aws(Optional aws) { + this.aws = aws; + return this; + } + + public Builder aws(ClientAddonAws aws) { + this.aws = Optional.ofNullable(aws); + return this; + } + + @JsonSetter(value = "azure_blob", nulls = Nulls.SKIP) + public Builder azureBlob(Optional azureBlob) { + this.azureBlob = azureBlob; + return this; + } + + public Builder azureBlob(ClientAddonAzureBlob azureBlob) { + this.azureBlob = Optional.ofNullable(azureBlob); + return this; + } + + @JsonSetter(value = "azure_sb", nulls = Nulls.SKIP) + public Builder azureSb(Optional azureSb) { + this.azureSb = azureSb; + return this; + } + + public Builder azureSb(ClientAddonAzureSb azureSb) { + this.azureSb = Optional.ofNullable(azureSb); + return this; + } + + @JsonSetter(value = "rms", nulls = Nulls.SKIP) + public Builder rms(Optional rms) { + this.rms = rms; + return this; + } + + public Builder rms(ClientAddonRms rms) { + this.rms = Optional.ofNullable(rms); + return this; + } + + @JsonSetter(value = "mscrm", nulls = Nulls.SKIP) + public Builder mscrm(Optional mscrm) { + this.mscrm = mscrm; + return this; + } + + public Builder mscrm(ClientAddonMscrm mscrm) { + this.mscrm = Optional.ofNullable(mscrm); + return this; + } + + @JsonSetter(value = "slack", nulls = Nulls.SKIP) + public Builder slack(Optional slack) { + this.slack = slack; + return this; + } + + public Builder slack(ClientAddonSlack slack) { + this.slack = Optional.ofNullable(slack); + return this; + } + + @JsonSetter(value = "sentry", nulls = Nulls.SKIP) + public Builder sentry(Optional sentry) { + this.sentry = sentry; + return this; + } + + public Builder sentry(ClientAddonSentry sentry) { + this.sentry = Optional.ofNullable(sentry); + return this; + } + + @JsonSetter(value = "box", nulls = Nulls.SKIP) + public Builder box(Optional> box) { + this.box = box; + return this; + } + + public Builder box(Map box) { + this.box = Optional.ofNullable(box); + return this; + } + + @JsonSetter(value = "cloudbees", nulls = Nulls.SKIP) + public Builder cloudbees(Optional> cloudbees) { + this.cloudbees = cloudbees; + return this; + } + + public Builder cloudbees(Map cloudbees) { + this.cloudbees = Optional.ofNullable(cloudbees); + return this; + } + + @JsonSetter(value = "concur", nulls = Nulls.SKIP) + public Builder concur(Optional> concur) { + this.concur = concur; + return this; + } + + public Builder concur(Map concur) { + this.concur = Optional.ofNullable(concur); + return this; + } + + @JsonSetter(value = "dropbox", nulls = Nulls.SKIP) + public Builder dropbox(Optional> dropbox) { + this.dropbox = dropbox; + return this; + } + + public Builder dropbox(Map dropbox) { + this.dropbox = Optional.ofNullable(dropbox); + return this; + } + + @JsonSetter(value = "echosign", nulls = Nulls.SKIP) + public Builder echosign(Optional echosign) { + this.echosign = echosign; + return this; + } + + public Builder echosign(ClientAddonEchoSign echosign) { + this.echosign = Optional.ofNullable(echosign); + return this; + } + + @JsonSetter(value = "egnyte", nulls = Nulls.SKIP) + public Builder egnyte(Optional egnyte) { + this.egnyte = egnyte; + return this; + } + + public Builder egnyte(ClientAddonEgnyte egnyte) { + this.egnyte = Optional.ofNullable(egnyte); + return this; + } + + @JsonSetter(value = "firebase", nulls = Nulls.SKIP) + public Builder firebase(Optional firebase) { + this.firebase = firebase; + return this; + } + + public Builder firebase(ClientAddonFirebase firebase) { + this.firebase = Optional.ofNullable(firebase); + return this; + } + + @JsonSetter(value = "newrelic", nulls = Nulls.SKIP) + public Builder newrelic(Optional newrelic) { + this.newrelic = newrelic; + return this; + } + + public Builder newrelic(ClientAddonNewRelic newrelic) { + this.newrelic = Optional.ofNullable(newrelic); + return this; + } + + @JsonSetter(value = "office365", nulls = Nulls.SKIP) + public Builder office365(Optional office365) { + this.office365 = office365; + return this; + } + + public Builder office365(ClientAddonOffice365 office365) { + this.office365 = Optional.ofNullable(office365); + return this; + } + + @JsonSetter(value = "salesforce", nulls = Nulls.SKIP) + public Builder salesforce(Optional salesforce) { + this.salesforce = salesforce; + return this; + } + + public Builder salesforce(ClientAddonSalesforce salesforce) { + this.salesforce = Optional.ofNullable(salesforce); + return this; + } + + @JsonSetter(value = "salesforce_api", nulls = Nulls.SKIP) + public Builder salesforceApi(Optional salesforceApi) { + this.salesforceApi = salesforceApi; + return this; + } + + public Builder salesforceApi(ClientAddonSalesforceApi salesforceApi) { + this.salesforceApi = Optional.ofNullable(salesforceApi); + return this; + } + + @JsonSetter(value = "salesforce_sandbox_api", nulls = Nulls.SKIP) + public Builder salesforceSandboxApi(Optional salesforceSandboxApi) { + this.salesforceSandboxApi = salesforceSandboxApi; + return this; + } + + public Builder salesforceSandboxApi(ClientAddonSalesforceSandboxApi salesforceSandboxApi) { + this.salesforceSandboxApi = Optional.ofNullable(salesforceSandboxApi); + return this; + } + + @JsonSetter(value = "samlp", nulls = Nulls.SKIP) + public Builder samlp(Optional samlp) { + this.samlp = samlp; + return this; + } + + public Builder samlp(ClientAddonSaml samlp) { + this.samlp = Optional.ofNullable(samlp); + return this; + } + + @JsonSetter(value = "layer", nulls = Nulls.SKIP) + public Builder layer(Optional layer) { + this.layer = layer; + return this; + } + + public Builder layer(ClientAddonLayer layer) { + this.layer = Optional.ofNullable(layer); + return this; + } + + @JsonSetter(value = "sap_api", nulls = Nulls.SKIP) + public Builder sapApi(Optional sapApi) { + this.sapApi = sapApi; + return this; + } + + public Builder sapApi(ClientAddonSapapi sapApi) { + this.sapApi = Optional.ofNullable(sapApi); + return this; + } + + @JsonSetter(value = "sharepoint", nulls = Nulls.SKIP) + public Builder sharepoint(Optional sharepoint) { + this.sharepoint = sharepoint; + return this; + } + + public Builder sharepoint(ClientAddonSharePoint sharepoint) { + this.sharepoint = Optional.ofNullable(sharepoint); + return this; + } + + @JsonSetter(value = "springcm", nulls = Nulls.SKIP) + public Builder springcm(Optional springcm) { + this.springcm = springcm; + return this; + } + + public Builder springcm(ClientAddonSpringCm springcm) { + this.springcm = Optional.ofNullable(springcm); + return this; + } + + @JsonSetter(value = "wams", nulls = Nulls.SKIP) + public Builder wams(Optional wams) { + this.wams = wams; + return this; + } + + public Builder wams(ClientAddonWams wams) { + this.wams = Optional.ofNullable(wams); + return this; + } + + @JsonSetter(value = "wsfed", nulls = Nulls.SKIP) + public Builder wsfed(Optional> wsfed) { + this.wsfed = wsfed; + return this; + } + + public Builder wsfed(Map wsfed) { + this.wsfed = Optional.ofNullable(wsfed); + return this; + } + + @JsonSetter(value = "zendesk", nulls = Nulls.SKIP) + public Builder zendesk(Optional zendesk) { + this.zendesk = zendesk; + return this; + } + + public Builder zendesk(ClientAddonZendesk zendesk) { + this.zendesk = Optional.ofNullable(zendesk); + return this; + } + + @JsonSetter(value = "zoom", nulls = Nulls.SKIP) + public Builder zoom(Optional zoom) { + this.zoom = zoom; + return this; + } + + public Builder zoom(ClientAddonZoom zoom) { + this.zoom = Optional.ofNullable(zoom); + return this; + } + + @JsonSetter(value = "sso_integration", nulls = Nulls.SKIP) + public Builder ssoIntegration(Optional ssoIntegration) { + this.ssoIntegration = ssoIntegration; + return this; + } + + public Builder ssoIntegration(ClientAddonSsoIntegration ssoIntegration) { + this.ssoIntegration = Optional.ofNullable(ssoIntegration); + return this; + } + + @JsonSetter(value = "oag", nulls = Nulls.SKIP) + public Builder oag(@Nullable OptionalNullable oag) { + this.oag = oag; + return this; + } + + public Builder oag(ClientAddonOag oag) { + this.oag = OptionalNullable.of(oag); + return this; + } + + public Builder oag(Optional oag) { + if (oag.isPresent()) { + this.oag = OptionalNullable.of(oag.get()); + } else { + this.oag = OptionalNullable.absent(); + } + return this; + } + + public Builder oag(com.auth0.client.mgmt.core.Nullable oag) { + if (oag.isNull()) { + this.oag = OptionalNullable.ofNull(); + } else if (oag.isEmpty()) { + this.oag = OptionalNullable.absent(); + } else { + this.oag = OptionalNullable.of(oag.get()); + } + return this; + } + + public ClientAddons build() { + return new ClientAddons( + aws, + azureBlob, + azureSb, + rms, + mscrm, + slack, + sentry, + box, + cloudbees, + concur, + dropbox, + echosign, + egnyte, + firebase, + newrelic, + office365, + salesforce, + salesforceApi, + salesforceSandboxApi, + samlp, + layer, + sapApi, + sharepoint, + springcm, + wams, + wsfed, + zendesk, + zoom, + ssoIntegration, + oag, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java new file mode 100644 index 000000000..7a4ebeb98 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientAppTypeEnum { + public static final ClientAppTypeEnum DROPBOX = new ClientAppTypeEnum(Value.DROPBOX, "dropbox"); + + public static final ClientAppTypeEnum REGULAR_WEB = new ClientAppTypeEnum(Value.REGULAR_WEB, "regular_web"); + + public static final ClientAppTypeEnum NEWRELIC = new ClientAppTypeEnum(Value.NEWRELIC, "newrelic"); + + public static final ClientAppTypeEnum NATIVE = new ClientAppTypeEnum(Value.NATIVE, "native"); + + public static final ClientAppTypeEnum SPA = new ClientAppTypeEnum(Value.SPA, "spa"); + + public static final ClientAppTypeEnum SPRINGCM = new ClientAppTypeEnum(Value.SPRINGCM, "springcm"); + + public static final ClientAppTypeEnum SHAREPOINT = new ClientAppTypeEnum(Value.SHAREPOINT, "sharepoint"); + + public static final ClientAppTypeEnum EGNYTE = new ClientAppTypeEnum(Value.EGNYTE, "egnyte"); + + public static final ClientAppTypeEnum ZENDESK = new ClientAppTypeEnum(Value.ZENDESK, "zendesk"); + + public static final ClientAppTypeEnum NON_INTERACTIVE = + new ClientAppTypeEnum(Value.NON_INTERACTIVE, "non_interactive"); + + public static final ClientAppTypeEnum SLACK = new ClientAppTypeEnum(Value.SLACK, "slack"); + + public static final ClientAppTypeEnum SENTRY = new ClientAppTypeEnum(Value.SENTRY, "sentry"); + + public static final ClientAppTypeEnum EXPRESS_CONFIGURATION = + new ClientAppTypeEnum(Value.EXPRESS_CONFIGURATION, "express_configuration"); + + public static final ClientAppTypeEnum SSO_INTEGRATION = + new ClientAppTypeEnum(Value.SSO_INTEGRATION, "sso_integration"); + + public static final ClientAppTypeEnum ECHOSIGN = new ClientAppTypeEnum(Value.ECHOSIGN, "echosign"); + + public static final ClientAppTypeEnum BOX = new ClientAppTypeEnum(Value.BOX, "box"); + + public static final ClientAppTypeEnum RMS = new ClientAppTypeEnum(Value.RMS, "rms"); + + public static final ClientAppTypeEnum CLOUDBEES = new ClientAppTypeEnum(Value.CLOUDBEES, "cloudbees"); + + public static final ClientAppTypeEnum SALESFORCE = new ClientAppTypeEnum(Value.SALESFORCE, "salesforce"); + + public static final ClientAppTypeEnum CONCUR = new ClientAppTypeEnum(Value.CONCUR, "concur"); + + public static final ClientAppTypeEnum RESOURCE_SERVER = + new ClientAppTypeEnum(Value.RESOURCE_SERVER, "resource_server"); + + public static final ClientAppTypeEnum ZOOM = new ClientAppTypeEnum(Value.ZOOM, "zoom"); + + public static final ClientAppTypeEnum MSCRM = new ClientAppTypeEnum(Value.MSCRM, "mscrm"); + + public static final ClientAppTypeEnum OAG = new ClientAppTypeEnum(Value.OAG, "oag"); + + public static final ClientAppTypeEnum OFFICE365 = new ClientAppTypeEnum(Value.OFFICE365, "office365"); + + private final Value value; + + private final String string; + + ClientAppTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientAppTypeEnum && this.string.equals(((ClientAppTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DROPBOX: + return visitor.visitDropbox(); + case REGULAR_WEB: + return visitor.visitRegularWeb(); + case NEWRELIC: + return visitor.visitNewrelic(); + case NATIVE: + return visitor.visitNative(); + case SPA: + return visitor.visitSpa(); + case SPRINGCM: + return visitor.visitSpringcm(); + case SHAREPOINT: + return visitor.visitSharepoint(); + case EGNYTE: + return visitor.visitEgnyte(); + case ZENDESK: + return visitor.visitZendesk(); + case NON_INTERACTIVE: + return visitor.visitNonInteractive(); + case SLACK: + return visitor.visitSlack(); + case SENTRY: + return visitor.visitSentry(); + case EXPRESS_CONFIGURATION: + return visitor.visitExpressConfiguration(); + case SSO_INTEGRATION: + return visitor.visitSsoIntegration(); + case ECHOSIGN: + return visitor.visitEchosign(); + case BOX: + return visitor.visitBox(); + case RMS: + return visitor.visitRms(); + case CLOUDBEES: + return visitor.visitCloudbees(); + case SALESFORCE: + return visitor.visitSalesforce(); + case CONCUR: + return visitor.visitConcur(); + case RESOURCE_SERVER: + return visitor.visitResourceServer(); + case ZOOM: + return visitor.visitZoom(); + case MSCRM: + return visitor.visitMscrm(); + case OAG: + return visitor.visitOag(); + case OFFICE365: + return visitor.visitOffice365(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientAppTypeEnum valueOf(String value) { + switch (value) { + case "dropbox": + return DROPBOX; + case "regular_web": + return REGULAR_WEB; + case "newrelic": + return NEWRELIC; + case "native": + return NATIVE; + case "spa": + return SPA; + case "springcm": + return SPRINGCM; + case "sharepoint": + return SHAREPOINT; + case "egnyte": + return EGNYTE; + case "zendesk": + return ZENDESK; + case "non_interactive": + return NON_INTERACTIVE; + case "slack": + return SLACK; + case "sentry": + return SENTRY; + case "express_configuration": + return EXPRESS_CONFIGURATION; + case "sso_integration": + return SSO_INTEGRATION; + case "echosign": + return ECHOSIGN; + case "box": + return BOX; + case "rms": + return RMS; + case "cloudbees": + return CLOUDBEES; + case "salesforce": + return SALESFORCE; + case "concur": + return CONCUR; + case "resource_server": + return RESOURCE_SERVER; + case "zoom": + return ZOOM; + case "mscrm": + return MSCRM; + case "oag": + return OAG; + case "office365": + return OFFICE365; + default: + return new ClientAppTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NATIVE, + + SPA, + + REGULAR_WEB, + + NON_INTERACTIVE, + + RESOURCE_SERVER, + + EXPRESS_CONFIGURATION, + + RMS, + + BOX, + + CLOUDBEES, + + CONCUR, + + DROPBOX, + + MSCRM, + + ECHOSIGN, + + EGNYTE, + + NEWRELIC, + + OFFICE365, + + SALESFORCE, + + SENTRY, + + SHAREPOINT, + + SLACK, + + SPRINGCM, + + ZENDESK, + + ZOOM, + + SSO_INTEGRATION, + + OAG, + + UNKNOWN + } + + public interface Visitor { + T visitNative(); + + T visitSpa(); + + T visitRegularWeb(); + + T visitNonInteractive(); + + T visitResourceServer(); + + T visitExpressConfiguration(); + + T visitRms(); + + T visitBox(); + + T visitCloudbees(); + + T visitConcur(); + + T visitDropbox(); + + T visitMscrm(); + + T visitEchosign(); + + T visitEgnyte(); + + T visitNewrelic(); + + T visitOffice365(); + + T visitSalesforce(); + + T visitSentry(); + + T visitSharepoint(); + + T visitSlack(); + + T visitSpringcm(); + + T visitZendesk(); + + T visitZoom(); + + T visitSsoIntegration(); + + T visitOag(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java new file mode 100644 index 000000000..05ccd5fb2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAuthenticationMethod.Builder.class) +public final class ClientAuthenticationMethod { + private final Optional privateKeyJwt; + + private final Optional tlsClientAuth; + + private final Optional selfSignedTlsClientAuth; + + private final Map additionalProperties; + + private ClientAuthenticationMethod( + Optional privateKeyJwt, + Optional tlsClientAuth, + Optional selfSignedTlsClientAuth, + Map additionalProperties) { + this.privateKeyJwt = privateKeyJwt; + this.tlsClientAuth = tlsClientAuth; + this.selfSignedTlsClientAuth = selfSignedTlsClientAuth; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("private_key_jwt") + public Optional getPrivateKeyJwt() { + return privateKeyJwt; + } + + @JsonProperty("tls_client_auth") + public Optional getTlsClientAuth() { + return tlsClientAuth; + } + + @JsonProperty("self_signed_tls_client_auth") + public Optional getSelfSignedTlsClientAuth() { + return selfSignedTlsClientAuth; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAuthenticationMethod && equalTo((ClientAuthenticationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAuthenticationMethod other) { + return privateKeyJwt.equals(other.privateKeyJwt) + && tlsClientAuth.equals(other.tlsClientAuth) + && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional privateKeyJwt = Optional.empty(); + + private Optional tlsClientAuth = Optional.empty(); + + private Optional selfSignedTlsClientAuth = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAuthenticationMethod other) { + privateKeyJwt(other.getPrivateKeyJwt()); + tlsClientAuth(other.getTlsClientAuth()); + selfSignedTlsClientAuth(other.getSelfSignedTlsClientAuth()); + return this; + } + + @JsonSetter(value = "private_key_jwt", nulls = Nulls.SKIP) + public Builder privateKeyJwt(Optional privateKeyJwt) { + this.privateKeyJwt = privateKeyJwt; + return this; + } + + public Builder privateKeyJwt(PrivateKeyJwt privateKeyJwt) { + this.privateKeyJwt = Optional.ofNullable(privateKeyJwt); + return this; + } + + @JsonSetter(value = "tls_client_auth", nulls = Nulls.SKIP) + public Builder tlsClientAuth(Optional tlsClientAuth) { + this.tlsClientAuth = tlsClientAuth; + return this; + } + + public Builder tlsClientAuth(ClientAuthenticationMethodTlsClientAuth tlsClientAuth) { + this.tlsClientAuth = Optional.ofNullable(tlsClientAuth); + return this; + } + + @JsonSetter(value = "self_signed_tls_client_auth", nulls = Nulls.SKIP) + public Builder selfSignedTlsClientAuth( + Optional selfSignedTlsClientAuth) { + this.selfSignedTlsClientAuth = selfSignedTlsClientAuth; + return this; + } + + public Builder selfSignedTlsClientAuth( + ClientAuthenticationMethodSelfSignedTlsClientAuth selfSignedTlsClientAuth) { + this.selfSignedTlsClientAuth = Optional.ofNullable(selfSignedTlsClientAuth); + return this; + } + + public ClientAuthenticationMethod build() { + return new ClientAuthenticationMethod( + privateKeyJwt, tlsClientAuth, selfSignedTlsClientAuth, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java new file mode 100644 index 000000000..458d19414 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAuthenticationMethodSelfSignedTlsClientAuth.Builder.class) +public final class ClientAuthenticationMethodSelfSignedTlsClientAuth { + private final List credentials; + + private final Map additionalProperties; + + private ClientAuthenticationMethodSelfSignedTlsClientAuth( + List credentials, Map additionalProperties) { + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return A list of unique and previously created credential IDs enabled on the client for mTLS authentication utilizing self-signed certificate. + */ + @JsonProperty("credentials") + public List getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAuthenticationMethodSelfSignedTlsClientAuth + && equalTo((ClientAuthenticationMethodSelfSignedTlsClientAuth) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAuthenticationMethodSelfSignedTlsClientAuth other) { + return credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List credentials = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAuthenticationMethodSelfSignedTlsClientAuth other) { + credentials(other.getCredentials()); + return this; + } + + /** + *

A list of unique and previously created credential IDs enabled on the client for mTLS authentication utilizing self-signed certificate.

+ */ + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(List credentials) { + this.credentials.clear(); + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public Builder addCredentials(CredentialId credentials) { + this.credentials.add(credentials); + return this; + } + + public Builder addAllCredentials(List credentials) { + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public ClientAuthenticationMethodSelfSignedTlsClientAuth build() { + return new ClientAuthenticationMethodSelfSignedTlsClientAuth(credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java new file mode 100644 index 000000000..bdaff2ec0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientAuthenticationMethodTlsClientAuth.Builder.class) +public final class ClientAuthenticationMethodTlsClientAuth { + private final List credentials; + + private final Map additionalProperties; + + private ClientAuthenticationMethodTlsClientAuth( + List credentials, Map additionalProperties) { + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return A list of unique and previously created credential IDs enabled on the client for CA-based mTLS authentication. + */ + @JsonProperty("credentials") + public List getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientAuthenticationMethodTlsClientAuth + && equalTo((ClientAuthenticationMethodTlsClientAuth) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientAuthenticationMethodTlsClientAuth other) { + return credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List credentials = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientAuthenticationMethodTlsClientAuth other) { + credentials(other.getCredentials()); + return this; + } + + /** + *

A list of unique and previously created credential IDs enabled on the client for CA-based mTLS authentication.

+ */ + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(List credentials) { + this.credentials.clear(); + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public Builder addCredentials(CredentialId credentials) { + this.credentials.add(credentials); + return this; + } + + public Builder addAllCredentials(List credentials) { + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public ClientAuthenticationMethodTlsClientAuth build() { + return new ClientAuthenticationMethodTlsClientAuth(credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java new file mode 100644 index 000000000..92861c601 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientComplianceLevelEnum { + public static final ClientComplianceLevelEnum FAPI1ADV_MTLS_PAR = + new ClientComplianceLevelEnum(Value.FAPI1ADV_MTLS_PAR, "fapi1_adv_mtls_par"); + + public static final ClientComplianceLevelEnum FAPI2SP_PKJ_MTLS = + new ClientComplianceLevelEnum(Value.FAPI2SP_PKJ_MTLS, "fapi2_sp_pkj_mtls"); + + public static final ClientComplianceLevelEnum FAPI2SP_MTLS_MTLS = + new ClientComplianceLevelEnum(Value.FAPI2SP_MTLS_MTLS, "fapi2_sp_mtls_mtls"); + + public static final ClientComplianceLevelEnum NONE = new ClientComplianceLevelEnum(Value.NONE, "none"); + + public static final ClientComplianceLevelEnum FAPI1ADV_PKJ_PAR = + new ClientComplianceLevelEnum(Value.FAPI1ADV_PKJ_PAR, "fapi1_adv_pkj_par"); + + private final Value value; + + private final String string; + + ClientComplianceLevelEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientComplianceLevelEnum + && this.string.equals(((ClientComplianceLevelEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAPI1ADV_MTLS_PAR: + return visitor.visitFapi1AdvMtlsPar(); + case FAPI2SP_PKJ_MTLS: + return visitor.visitFapi2SpPkjMtls(); + case FAPI2SP_MTLS_MTLS: + return visitor.visitFapi2SpMtlsMtls(); + case NONE: + return visitor.visitNone(); + case FAPI1ADV_PKJ_PAR: + return visitor.visitFapi1AdvPkjPar(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientComplianceLevelEnum valueOf(String value) { + switch (value) { + case "fapi1_adv_mtls_par": + return FAPI1ADV_MTLS_PAR; + case "fapi2_sp_pkj_mtls": + return FAPI2SP_PKJ_MTLS; + case "fapi2_sp_mtls_mtls": + return FAPI2SP_MTLS_MTLS; + case "none": + return NONE; + case "fapi1_adv_pkj_par": + return FAPI1ADV_PKJ_PAR; + default: + return new ClientComplianceLevelEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + FAPI1ADV_PKJ_PAR, + + FAPI1ADV_MTLS_PAR, + + FAPI2SP_PKJ_MTLS, + + FAPI2SP_MTLS_MTLS, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitFapi1AdvPkjPar(); + + T visitFapi1AdvMtlsPar(); + + T visitFapi2SpPkjMtls(); + + T visitFapi2SpMtlsMtls(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java new file mode 100644 index 000000000..c8b4ccada --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientCreateAuthenticationMethod.Builder.class) +public final class ClientCreateAuthenticationMethod { + private final Optional privateKeyJwt; + + private final Optional tlsClientAuth; + + private final Optional selfSignedTlsClientAuth; + + private final Map additionalProperties; + + private ClientCreateAuthenticationMethod( + Optional privateKeyJwt, + Optional tlsClientAuth, + Optional selfSignedTlsClientAuth, + Map additionalProperties) { + this.privateKeyJwt = privateKeyJwt; + this.tlsClientAuth = tlsClientAuth; + this.selfSignedTlsClientAuth = selfSignedTlsClientAuth; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("private_key_jwt") + public Optional getPrivateKeyJwt() { + return privateKeyJwt; + } + + @JsonProperty("tls_client_auth") + public Optional getTlsClientAuth() { + return tlsClientAuth; + } + + @JsonProperty("self_signed_tls_client_auth") + public Optional getSelfSignedTlsClientAuth() { + return selfSignedTlsClientAuth; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientCreateAuthenticationMethod && equalTo((ClientCreateAuthenticationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientCreateAuthenticationMethod other) { + return privateKeyJwt.equals(other.privateKeyJwt) + && tlsClientAuth.equals(other.tlsClientAuth) + && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional privateKeyJwt = Optional.empty(); + + private Optional tlsClientAuth = Optional.empty(); + + private Optional selfSignedTlsClientAuth = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientCreateAuthenticationMethod other) { + privateKeyJwt(other.getPrivateKeyJwt()); + tlsClientAuth(other.getTlsClientAuth()); + selfSignedTlsClientAuth(other.getSelfSignedTlsClientAuth()); + return this; + } + + @JsonSetter(value = "private_key_jwt", nulls = Nulls.SKIP) + public Builder privateKeyJwt(Optional privateKeyJwt) { + this.privateKeyJwt = privateKeyJwt; + return this; + } + + public Builder privateKeyJwt(PrivateKeyJwt privateKeyJwt) { + this.privateKeyJwt = Optional.ofNullable(privateKeyJwt); + return this; + } + + @JsonSetter(value = "tls_client_auth", nulls = Nulls.SKIP) + public Builder tlsClientAuth(Optional tlsClientAuth) { + this.tlsClientAuth = tlsClientAuth; + return this; + } + + public Builder tlsClientAuth(ClientAuthenticationMethodTlsClientAuth tlsClientAuth) { + this.tlsClientAuth = Optional.ofNullable(tlsClientAuth); + return this; + } + + @JsonSetter(value = "self_signed_tls_client_auth", nulls = Nulls.SKIP) + public Builder selfSignedTlsClientAuth( + Optional selfSignedTlsClientAuth) { + this.selfSignedTlsClientAuth = selfSignedTlsClientAuth; + return this; + } + + public Builder selfSignedTlsClientAuth( + ClientAuthenticationMethodSelfSignedTlsClientAuth selfSignedTlsClientAuth) { + this.selfSignedTlsClientAuth = Optional.ofNullable(selfSignedTlsClientAuth); + return this; + } + + public ClientCreateAuthenticationMethod build() { + return new ClientCreateAuthenticationMethod( + privateKeyJwt, tlsClientAuth, selfSignedTlsClientAuth, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java new file mode 100644 index 000000000..342b3fcfe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientCredential.Builder.class) +public final class ClientCredential { + private final Optional id; + + private final Optional name; + + private final Optional kid; + + private final Optional alg; + + private final Optional credentialType; + + private final Optional subjectDn; + + private final Optional thumbprintSha256; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private ClientCredential( + Optional id, + Optional name, + Optional kid, + Optional alg, + Optional credentialType, + Optional subjectDn, + Optional thumbprintSha256, + Optional createdAt, + Optional updatedAt, + Optional expiresAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.kid = kid; + this.alg = alg; + this.credentialType = credentialType; + this.subjectDn = subjectDn; + this.thumbprintSha256 = thumbprintSha256; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the credential. Generated on creation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name given to the credential by the user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The key identifier of the credential, generated on creation. + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + @JsonProperty("credential_type") + public Optional getCredentialType() { + return credentialType; + } + + /** + * @return The X509 certificate's Subject Distinguished Name + */ + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + /** + * @return The X509 certificate's SHA256 thumbprint + */ + @JsonProperty("thumbprint_sha256") + public Optional getThumbprintSha256() { + return thumbprintSha256; + } + + /** + * @return The ISO 8601 formatted date the credential was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date the credential was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientCredential && equalTo((ClientCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientCredential other) { + return id.equals(other.id) + && name.equals(other.name) + && kid.equals(other.kid) + && alg.equals(other.alg) + && credentialType.equals(other.credentialType) + && subjectDn.equals(other.subjectDn) + && thumbprintSha256.equals(other.thumbprintSha256) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.kid, + this.alg, + this.credentialType, + this.subjectDn, + this.thumbprintSha256, + this.createdAt, + this.updatedAt, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional kid = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional credentialType = Optional.empty(); + + private Optional subjectDn = Optional.empty(); + + private Optional thumbprintSha256 = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientCredential other) { + id(other.getId()); + name(other.getName()); + kid(other.getKid()); + alg(other.getAlg()); + credentialType(other.getCredentialType()); + subjectDn(other.getSubjectDn()); + thumbprintSha256(other.getThumbprintSha256()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

ID of the credential. Generated on creation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name given to the credential by the user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The key identifier of the credential, generated on creation.

+ */ + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public Builder kid(Optional kid) { + this.kid = kid; + return this; + } + + public Builder kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public Builder alg(Optional alg) { + this.alg = alg; + return this; + } + + public Builder alg(ClientCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @JsonSetter(value = "credential_type", nulls = Nulls.SKIP) + public Builder credentialType(Optional credentialType) { + this.credentialType = credentialType; + return this; + } + + public Builder credentialType(ClientCredentialTypeEnum credentialType) { + this.credentialType = Optional.ofNullable(credentialType); + return this; + } + + /** + *

The X509 certificate's Subject Distinguished Name

+ */ + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public Builder subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + public Builder subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + /** + *

The X509 certificate's SHA256 thumbprint

+ */ + @JsonSetter(value = "thumbprint_sha256", nulls = Nulls.SKIP) + public Builder thumbprintSha256(Optional thumbprintSha256) { + this.thumbprintSha256 = thumbprintSha256; + return this; + } + + public Builder thumbprintSha256(String thumbprintSha256) { + this.thumbprintSha256 = Optional.ofNullable(thumbprintSha256); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public ClientCredential build() { + return new ClientCredential( + id, + name, + kid, + alg, + credentialType, + subjectDn, + thumbprintSha256, + createdAt, + updatedAt, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java new file mode 100644 index 000000000..93630fa34 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientCredentialAlgorithmEnum { + public static final ClientCredentialAlgorithmEnum PS256 = new ClientCredentialAlgorithmEnum(Value.PS256, "PS256"); + + public static final ClientCredentialAlgorithmEnum RS256 = new ClientCredentialAlgorithmEnum(Value.RS256, "RS256"); + + public static final ClientCredentialAlgorithmEnum RS384 = new ClientCredentialAlgorithmEnum(Value.RS384, "RS384"); + + private final Value value; + + private final String string; + + ClientCredentialAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientCredentialAlgorithmEnum + && this.string.equals(((ClientCredentialAlgorithmEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PS256: + return visitor.visitPs256(); + case RS256: + return visitor.visitRs256(); + case RS384: + return visitor.visitRs384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientCredentialAlgorithmEnum valueOf(String value) { + switch (value) { + case "PS256": + return PS256; + case "RS256": + return RS256; + case "RS384": + return RS384; + default: + return new ClientCredentialAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RS256, + + RS384, + + PS256, + + UNKNOWN + } + + public interface Visitor { + T visitRs256(); + + T visitRs384(); + + T visitPs256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java new file mode 100644 index 000000000..ab30a486b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientCredentialTypeEnum { + public static final ClientCredentialTypeEnum CERT_SUBJECT_DN = + new ClientCredentialTypeEnum(Value.CERT_SUBJECT_DN, "cert_subject_dn"); + + public static final ClientCredentialTypeEnum PUBLIC_KEY = + new ClientCredentialTypeEnum(Value.PUBLIC_KEY, "public_key"); + + public static final ClientCredentialTypeEnum X509CERT = new ClientCredentialTypeEnum(Value.X509CERT, "x509_cert"); + + private final Value value; + + private final String string; + + ClientCredentialTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientCredentialTypeEnum + && this.string.equals(((ClientCredentialTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CERT_SUBJECT_DN: + return visitor.visitCertSubjectDn(); + case PUBLIC_KEY: + return visitor.visitPublicKey(); + case X509CERT: + return visitor.visitX509Cert(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientCredentialTypeEnum valueOf(String value) { + switch (value) { + case "cert_subject_dn": + return CERT_SUBJECT_DN; + case "public_key": + return PUBLIC_KEY; + case "x509_cert": + return X509CERT; + default: + return new ClientCredentialTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PUBLIC_KEY, + + CERT_SUBJECT_DN, + + X509CERT, + + UNKNOWN + } + + public interface Visitor { + T visitPublicKey(); + + T visitCertSubjectDn(); + + T visitX509Cert(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java new file mode 100644 index 000000000..326ed6259 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientDefaultOrganization.Builder.class) +public final class ClientDefaultOrganization { + private final String organizationId; + + private final List flows; + + private final Map additionalProperties; + + private ClientDefaultOrganization( + String organizationId, List flows, Map additionalProperties) { + this.organizationId = organizationId; + this.flows = flows; + this.additionalProperties = additionalProperties; + } + + /** + * @return The default Organization ID to be used + */ + @JsonProperty("organization_id") + public String getOrganizationId() { + return organizationId; + } + + /** + * @return The default Organization usage + */ + @JsonProperty("flows") + public List getFlows() { + return flows; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientDefaultOrganization && equalTo((ClientDefaultOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientDefaultOrganization other) { + return organizationId.equals(other.organizationId) && flows.equals(other.flows); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationId, this.flows); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OrganizationIdStage builder() { + return new Builder(); + } + + public interface OrganizationIdStage { + /** + *

The default Organization ID to be used

+ */ + _FinalStage organizationId(@NotNull String organizationId); + + Builder from(ClientDefaultOrganization other); + } + + public interface _FinalStage { + ClientDefaultOrganization build(); + + /** + *

The default Organization usage

+ */ + _FinalStage flows(List flows); + + _FinalStage addFlows(String flows); + + _FinalStage addAllFlows(List flows); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OrganizationIdStage, _FinalStage { + private String organizationId; + + private List flows = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientDefaultOrganization other) { + organizationId(other.getOrganizationId()); + flows(other.getFlows()); + return this; + } + + /** + *

The default Organization ID to be used

+ *

The default Organization ID to be used

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("organization_id") + public _FinalStage organizationId(@NotNull String organizationId) { + this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); + return this; + } + + /** + *

The default Organization usage

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllFlows(List flows) { + if (flows != null) { + this.flows.addAll(flows); + } + return this; + } + + /** + *

The default Organization usage

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addFlows(String flows) { + this.flows.add(flows); + return this; + } + + /** + *

The default Organization usage

+ */ + @java.lang.Override + @JsonSetter(value = "flows", nulls = Nulls.SKIP) + public _FinalStage flows(List flows) { + this.flows.clear(); + if (flows != null) { + this.flows.addAll(flows); + } + return this; + } + + @java.lang.Override + public ClientDefaultOrganization build() { + return new ClientDefaultOrganization(organizationId, flows, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java new file mode 100644 index 000000000..e50045c53 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientEncryptionKey.Builder.class) +public final class ClientEncryptionKey { + private final Optional pub; + + private final Optional cert; + + private final Optional subject; + + private final Map additionalProperties; + + private ClientEncryptionKey( + Optional pub, + Optional cert, + Optional subject, + Map additionalProperties) { + this.pub = pub; + this.cert = cert; + this.subject = subject; + this.additionalProperties = additionalProperties; + } + + /** + * @return Encryption Public RSA Key. + */ + @JsonProperty("pub") + public Optional getPub() { + return pub; + } + + /** + * @return Encryption certificate for public key in X.509 (.CER) format. + */ + @JsonProperty("cert") + public Optional getCert() { + return cert; + } + + /** + * @return Encryption certificate name for this certificate in the format /CN={domain}. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientEncryptionKey && equalTo((ClientEncryptionKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientEncryptionKey other) { + return pub.equals(other.pub) && cert.equals(other.cert) && subject.equals(other.subject); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pub, this.cert, this.subject); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pub = Optional.empty(); + + private Optional cert = Optional.empty(); + + private Optional subject = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientEncryptionKey other) { + pub(other.getPub()); + cert(other.getCert()); + subject(other.getSubject()); + return this; + } + + /** + *

Encryption Public RSA Key.

+ */ + @JsonSetter(value = "pub", nulls = Nulls.SKIP) + public Builder pub(Optional pub) { + this.pub = pub; + return this; + } + + public Builder pub(String pub) { + this.pub = Optional.ofNullable(pub); + return this; + } + + /** + *

Encryption certificate for public key in X.509 (.CER) format.

+ */ + @JsonSetter(value = "cert", nulls = Nulls.SKIP) + public Builder cert(Optional cert) { + this.cert = cert; + return this; + } + + public Builder cert(String cert) { + this.cert = Optional.ofNullable(cert); + return this; + } + + /** + *

Encryption certificate name for this certificate in the format /CN={domain}.

+ */ + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + public ClientEncryptionKey build() { + return new ClientEncryptionKey(pub, cert, subject, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java new file mode 100644 index 000000000..fc5c9c0ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientGrantOrganizationNullableUsageEnum { + public static final ClientGrantOrganizationNullableUsageEnum ALLOW = + new ClientGrantOrganizationNullableUsageEnum(Value.ALLOW, "allow"); + + public static final ClientGrantOrganizationNullableUsageEnum REQUIRE = + new ClientGrantOrganizationNullableUsageEnum(Value.REQUIRE, "require"); + + public static final ClientGrantOrganizationNullableUsageEnum DENY = + new ClientGrantOrganizationNullableUsageEnum(Value.DENY, "deny"); + + private final Value value; + + private final String string; + + ClientGrantOrganizationNullableUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientGrantOrganizationNullableUsageEnum + && this.string.equals(((ClientGrantOrganizationNullableUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case REQUIRE: + return visitor.visitRequire(); + case DENY: + return visitor.visitDeny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientGrantOrganizationNullableUsageEnum valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + case "require": + return REQUIRE; + case "deny": + return DENY; + default: + return new ClientGrantOrganizationNullableUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY, + + ALLOW, + + REQUIRE, + + UNKNOWN + } + + public interface Visitor { + T visitDeny(); + + T visitAllow(); + + T visitRequire(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java new file mode 100644 index 000000000..c8b268c8d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientGrantOrganizationUsageEnum { + public static final ClientGrantOrganizationUsageEnum ALLOW = + new ClientGrantOrganizationUsageEnum(Value.ALLOW, "allow"); + + public static final ClientGrantOrganizationUsageEnum REQUIRE = + new ClientGrantOrganizationUsageEnum(Value.REQUIRE, "require"); + + public static final ClientGrantOrganizationUsageEnum DENY = + new ClientGrantOrganizationUsageEnum(Value.DENY, "deny"); + + private final Value value; + + private final String string; + + ClientGrantOrganizationUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientGrantOrganizationUsageEnum + && this.string.equals(((ClientGrantOrganizationUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case REQUIRE: + return visitor.visitRequire(); + case DENY: + return visitor.visitDeny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientGrantOrganizationUsageEnum valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + case "require": + return REQUIRE; + case "deny": + return DENY; + default: + return new ClientGrantOrganizationUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY, + + ALLOW, + + REQUIRE, + + UNKNOWN + } + + public interface Visitor { + T visitDeny(); + + T visitAllow(); + + T visitRequire(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java new file mode 100644 index 000000000..3e891efcc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java @@ -0,0 +1,293 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientGrantResponseContent.Builder.class) +public final class ClientGrantResponseContent { + private final Optional id; + + private final Optional clientId; + + private final Optional audience; + + private final Optional> scope; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final Optional isSystem; + + private final Map additionalProperties; + + private ClientGrantResponseContent( + Optional id, + Optional clientId, + Optional audience, + Optional> scope, + Optional organizationUsage, + Optional allowAnyOrganization, + Optional isSystem, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.audience = audience; + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.isSystem = isSystem; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + /** + * @return If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly. + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientGrantResponseContent && equalTo((ClientGrantResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientGrantResponseContent other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && audience.equals(other.audience) + && scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization) + && isSystem.equals(other.isSystem); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.clientId, + this.audience, + this.scope, + this.organizationUsage, + this.allowAnyOrganization, + this.isSystem); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private Optional allowAnyOrganization = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientGrantResponseContent other) { + id(other.getId()); + clientId(other.getClientId()); + audience(other.getAudience()); + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + isSystem(other.getIsSystem()); + return this; + } + + /** + *

ID of the client grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The audience (API identifier) of this client grant.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + /** + *

If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + public ClientGrantResponseContent build() { + return new ClientGrantResponseContent( + id, + clientId, + audience, + scope, + organizationUsage, + allowAnyOrganization, + isSystem, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java new file mode 100644 index 000000000..8659fa47a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientJwtConfiguration.Builder.class) +public final class ClientJwtConfiguration { + private final Optional lifetimeInSeconds; + + private final Optional secretEncoded; + + private final Optional> scopes; + + private final Optional alg; + + private final Map additionalProperties; + + private ClientJwtConfiguration( + Optional lifetimeInSeconds, + Optional secretEncoded, + Optional> scopes, + Optional alg, + Map additionalProperties) { + this.lifetimeInSeconds = lifetimeInSeconds; + this.secretEncoded = secretEncoded; + this.scopes = scopes; + this.alg = alg; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of seconds the JWT will be valid for (affects exp claim). + */ + @JsonProperty("lifetime_in_seconds") + public Optional getLifetimeInSeconds() { + return lifetimeInSeconds; + } + + /** + * @return Whether the client secret is base64 encoded (true) or unencoded (false). + */ + @JsonProperty("secret_encoded") + public Optional getSecretEncoded() { + return secretEncoded; + } + + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientJwtConfiguration && equalTo((ClientJwtConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientJwtConfiguration other) { + return lifetimeInSeconds.equals(other.lifetimeInSeconds) + && secretEncoded.equals(other.secretEncoded) + && scopes.equals(other.scopes) + && alg.equals(other.alg); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.lifetimeInSeconds, this.secretEncoded, this.scopes, this.alg); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional lifetimeInSeconds = Optional.empty(); + + private Optional secretEncoded = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional alg = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientJwtConfiguration other) { + lifetimeInSeconds(other.getLifetimeInSeconds()); + secretEncoded(other.getSecretEncoded()); + scopes(other.getScopes()); + alg(other.getAlg()); + return this; + } + + /** + *

Number of seconds the JWT will be valid for (affects exp claim).

+ */ + @JsonSetter(value = "lifetime_in_seconds", nulls = Nulls.SKIP) + public Builder lifetimeInSeconds(Optional lifetimeInSeconds) { + this.lifetimeInSeconds = lifetimeInSeconds; + return this; + } + + public Builder lifetimeInSeconds(Integer lifetimeInSeconds) { + this.lifetimeInSeconds = Optional.ofNullable(lifetimeInSeconds); + return this; + } + + /** + *

Whether the client secret is base64 encoded (true) or unencoded (false).

+ */ + @JsonSetter(value = "secret_encoded", nulls = Nulls.SKIP) + public Builder secretEncoded(Optional secretEncoded) { + this.secretEncoded = secretEncoded; + return this; + } + + public Builder secretEncoded(Boolean secretEncoded) { + this.secretEncoded = Optional.ofNullable(secretEncoded); + return this; + } + + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(Map scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public Builder alg(Optional alg) { + this.alg = alg; + return this; + } + + public Builder alg(SigningAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + public ClientJwtConfiguration build() { + return new ClientJwtConfiguration(lifetimeInSeconds, secretEncoded, scopes, alg, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java new file mode 100644 index 000000000..a62211571 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientMobile.Builder.class) +public final class ClientMobile { + private final Optional android; + + private final Optional ios; + + private final Map additionalProperties; + + private ClientMobile( + Optional android, + Optional ios, + Map additionalProperties) { + this.android = android; + this.ios = ios; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("android") + public Optional getAndroid() { + return android; + } + + @JsonProperty("ios") + public Optional getIos() { + return ios; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientMobile && equalTo((ClientMobile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientMobile other) { + return android.equals(other.android) && ios.equals(other.ios); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.android, this.ios); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional android = Optional.empty(); + + private Optional ios = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientMobile other) { + android(other.getAndroid()); + ios(other.getIos()); + return this; + } + + @JsonSetter(value = "android", nulls = Nulls.SKIP) + public Builder android(Optional android) { + this.android = android; + return this; + } + + public Builder android(ClientMobileAndroid android) { + this.android = Optional.ofNullable(android); + return this; + } + + @JsonSetter(value = "ios", nulls = Nulls.SKIP) + public Builder ios(Optional ios) { + this.ios = ios; + return this; + } + + public Builder ios(ClientMobileiOs ios) { + this.ios = Optional.ofNullable(ios); + return this; + } + + public ClientMobile build() { + return new ClientMobile(android, ios, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java new file mode 100644 index 000000000..94c21d350 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientMobileAndroid.Builder.class) +public final class ClientMobileAndroid { + private final Optional appPackageName; + + private final Optional> sha256CertFingerprints; + + private final Map additionalProperties; + + private ClientMobileAndroid( + Optional appPackageName, + Optional> sha256CertFingerprints, + Map additionalProperties) { + this.appPackageName = appPackageName; + this.sha256CertFingerprints = sha256CertFingerprints; + this.additionalProperties = additionalProperties; + } + + /** + * @return App package name found in AndroidManifest.xml. + */ + @JsonProperty("app_package_name") + public Optional getAppPackageName() { + return appPackageName; + } + + /** + * @return SHA256 fingerprints of the app's signing certificate. Multiple fingerprints can be used to support different versions of your app, such as debug and production builds. + */ + @JsonProperty("sha256_cert_fingerprints") + public Optional> getSha256CertFingerprints() { + return sha256CertFingerprints; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientMobileAndroid && equalTo((ClientMobileAndroid) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientMobileAndroid other) { + return appPackageName.equals(other.appPackageName) + && sha256CertFingerprints.equals(other.sha256CertFingerprints); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.appPackageName, this.sha256CertFingerprints); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional appPackageName = Optional.empty(); + + private Optional> sha256CertFingerprints = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientMobileAndroid other) { + appPackageName(other.getAppPackageName()); + sha256CertFingerprints(other.getSha256CertFingerprints()); + return this; + } + + /** + *

App package name found in AndroidManifest.xml.

+ */ + @JsonSetter(value = "app_package_name", nulls = Nulls.SKIP) + public Builder appPackageName(Optional appPackageName) { + this.appPackageName = appPackageName; + return this; + } + + public Builder appPackageName(String appPackageName) { + this.appPackageName = Optional.ofNullable(appPackageName); + return this; + } + + /** + *

SHA256 fingerprints of the app's signing certificate. Multiple fingerprints can be used to support different versions of your app, such as debug and production builds.

+ */ + @JsonSetter(value = "sha256_cert_fingerprints", nulls = Nulls.SKIP) + public Builder sha256CertFingerprints(Optional> sha256CertFingerprints) { + this.sha256CertFingerprints = sha256CertFingerprints; + return this; + } + + public Builder sha256CertFingerprints(List sha256CertFingerprints) { + this.sha256CertFingerprints = Optional.ofNullable(sha256CertFingerprints); + return this; + } + + public ClientMobileAndroid build() { + return new ClientMobileAndroid(appPackageName, sha256CertFingerprints, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java new file mode 100644 index 000000000..f8de2b1f8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientMobileiOs.Builder.class) +public final class ClientMobileiOs { + private final Optional teamId; + + private final Optional appBundleIdentifier; + + private final Map additionalProperties; + + private ClientMobileiOs( + Optional teamId, Optional appBundleIdentifier, Map additionalProperties) { + this.teamId = teamId; + this.appBundleIdentifier = appBundleIdentifier; + this.additionalProperties = additionalProperties; + } + + /** + * @return Identifier assigned to the Apple account that signs and uploads the app to the store. + */ + @JsonProperty("team_id") + public Optional getTeamId() { + return teamId; + } + + /** + * @return Assigned by developer to the app as its unique identifier inside the store. Usually this is a reverse domain plus the app name, e.g. com.you.MyApp. + */ + @JsonProperty("app_bundle_identifier") + public Optional getAppBundleIdentifier() { + return appBundleIdentifier; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientMobileiOs && equalTo((ClientMobileiOs) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientMobileiOs other) { + return teamId.equals(other.teamId) && appBundleIdentifier.equals(other.appBundleIdentifier); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.teamId, this.appBundleIdentifier); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional teamId = Optional.empty(); + + private Optional appBundleIdentifier = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientMobileiOs other) { + teamId(other.getTeamId()); + appBundleIdentifier(other.getAppBundleIdentifier()); + return this; + } + + /** + *

Identifier assigned to the Apple account that signs and uploads the app to the store.

+ */ + @JsonSetter(value = "team_id", nulls = Nulls.SKIP) + public Builder teamId(Optional teamId) { + this.teamId = teamId; + return this; + } + + public Builder teamId(String teamId) { + this.teamId = Optional.ofNullable(teamId); + return this; + } + + /** + *

Assigned by developer to the app as its unique identifier inside the store. Usually this is a reverse domain plus the app name, e.g. com.you.MyApp.

+ */ + @JsonSetter(value = "app_bundle_identifier", nulls = Nulls.SKIP) + public Builder appBundleIdentifier(Optional appBundleIdentifier) { + this.appBundleIdentifier = appBundleIdentifier; + return this; + } + + public Builder appBundleIdentifier(String appBundleIdentifier) { + this.appBundleIdentifier = Optional.ofNullable(appBundleIdentifier); + return this; + } + + public ClientMobileiOs build() { + return new ClientMobileiOs(teamId, appBundleIdentifier, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java new file mode 100644 index 000000000..1b2dcd6dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientOidcBackchannelLogoutInitiators.Builder.class) +public final class ClientOidcBackchannelLogoutInitiators { + private final Optional mode; + + private final Optional> selectedInitiators; + + private final Map additionalProperties; + + private ClientOidcBackchannelLogoutInitiators( + Optional mode, + Optional> selectedInitiators, + Map additionalProperties) { + this.mode = mode; + this.selectedInitiators = selectedInitiators; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + + @JsonProperty("selected_initiators") + public Optional> getSelectedInitiators() { + return selectedInitiators; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientOidcBackchannelLogoutInitiators + && equalTo((ClientOidcBackchannelLogoutInitiators) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientOidcBackchannelLogoutInitiators other) { + return mode.equals(other.mode) && selectedInitiators.equals(other.selectedInitiators); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mode, this.selectedInitiators); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional mode = Optional.empty(); + + private Optional> selectedInitiators = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientOidcBackchannelLogoutInitiators other) { + mode(other.getMode()); + selectedInitiators(other.getSelectedInitiators()); + return this; + } + + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(ClientOidcBackchannelLogoutInitiatorsModeEnum mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + @JsonSetter(value = "selected_initiators", nulls = Nulls.SKIP) + public Builder selectedInitiators( + Optional> selectedInitiators) { + this.selectedInitiators = selectedInitiators; + return this; + } + + public Builder selectedInitiators(List selectedInitiators) { + this.selectedInitiators = Optional.ofNullable(selectedInitiators); + return this; + } + + public ClientOidcBackchannelLogoutInitiators build() { + return new ClientOidcBackchannelLogoutInitiators(mode, selectedInitiators, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java new file mode 100644 index 000000000..06bdb72fb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOidcBackchannelLogoutInitiatorsEnum { + public static final ClientOidcBackchannelLogoutInitiatorsEnum EMAIL_IDENTIFIER_CHANGED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.EMAIL_IDENTIFIER_CHANGED, "email-identifier-changed"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum MFA_PHONE_UNENROLLED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.MFA_PHONE_UNENROLLED, "mfa-phone-unenrolled"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum ACCOUNT_DELETED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.ACCOUNT_DELETED, "account-deleted"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum SESSION_EXPIRED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.SESSION_EXPIRED, "session-expired"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum ACCOUNT_DEACTIVATED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.ACCOUNT_DEACTIVATED, "account-deactivated"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum PASSWORD_CHANGED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.PASSWORD_CHANGED, "password-changed"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum RP_LOGOUT = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.RP_LOGOUT, "rp-logout"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum IDP_LOGOUT = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.IDP_LOGOUT, "idp-logout"); + + public static final ClientOidcBackchannelLogoutInitiatorsEnum SESSION_REVOKED = + new ClientOidcBackchannelLogoutInitiatorsEnum(Value.SESSION_REVOKED, "session-revoked"); + + private final Value value; + + private final String string; + + ClientOidcBackchannelLogoutInitiatorsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOidcBackchannelLogoutInitiatorsEnum + && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL_IDENTIFIER_CHANGED: + return visitor.visitEmailIdentifierChanged(); + case MFA_PHONE_UNENROLLED: + return visitor.visitMfaPhoneUnenrolled(); + case ACCOUNT_DELETED: + return visitor.visitAccountDeleted(); + case SESSION_EXPIRED: + return visitor.visitSessionExpired(); + case ACCOUNT_DEACTIVATED: + return visitor.visitAccountDeactivated(); + case PASSWORD_CHANGED: + return visitor.visitPasswordChanged(); + case RP_LOGOUT: + return visitor.visitRpLogout(); + case IDP_LOGOUT: + return visitor.visitIdpLogout(); + case SESSION_REVOKED: + return visitor.visitSessionRevoked(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOidcBackchannelLogoutInitiatorsEnum valueOf(String value) { + switch (value) { + case "email-identifier-changed": + return EMAIL_IDENTIFIER_CHANGED; + case "mfa-phone-unenrolled": + return MFA_PHONE_UNENROLLED; + case "account-deleted": + return ACCOUNT_DELETED; + case "session-expired": + return SESSION_EXPIRED; + case "account-deactivated": + return ACCOUNT_DEACTIVATED; + case "password-changed": + return PASSWORD_CHANGED; + case "rp-logout": + return RP_LOGOUT; + case "idp-logout": + return IDP_LOGOUT; + case "session-revoked": + return SESSION_REVOKED; + default: + return new ClientOidcBackchannelLogoutInitiatorsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RP_LOGOUT, + + IDP_LOGOUT, + + PASSWORD_CHANGED, + + SESSION_EXPIRED, + + SESSION_REVOKED, + + ACCOUNT_DELETED, + + EMAIL_IDENTIFIER_CHANGED, + + MFA_PHONE_UNENROLLED, + + ACCOUNT_DEACTIVATED, + + UNKNOWN + } + + public interface Visitor { + T visitRpLogout(); + + T visitIdpLogout(); + + T visitPasswordChanged(); + + T visitSessionExpired(); + + T visitSessionRevoked(); + + T visitAccountDeleted(); + + T visitEmailIdentifierChanged(); + + T visitMfaPhoneUnenrolled(); + + T visitAccountDeactivated(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java new file mode 100644 index 000000000..37f9ae572 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOidcBackchannelLogoutInitiatorsModeEnum { + public static final ClientOidcBackchannelLogoutInitiatorsModeEnum ALL = + new ClientOidcBackchannelLogoutInitiatorsModeEnum(Value.ALL, "all"); + + public static final ClientOidcBackchannelLogoutInitiatorsModeEnum CUSTOM = + new ClientOidcBackchannelLogoutInitiatorsModeEnum(Value.CUSTOM, "custom"); + + private final Value value; + + private final String string; + + ClientOidcBackchannelLogoutInitiatorsModeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOidcBackchannelLogoutInitiatorsModeEnum + && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsModeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALL: + return visitor.visitAll(); + case CUSTOM: + return visitor.visitCustom(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOidcBackchannelLogoutInitiatorsModeEnum valueOf(String value) { + switch (value) { + case "all": + return ALL; + case "custom": + return CUSTOM; + default: + return new ClientOidcBackchannelLogoutInitiatorsModeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CUSTOM, + + ALL, + + UNKNOWN + } + + public interface Visitor { + T visitCustom(); + + T visitAll(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java new file mode 100644 index 000000000..6795bed38 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientOidcBackchannelLogoutSettings.Builder.class) +public final class ClientOidcBackchannelLogoutSettings { + private final Optional> backchannelLogoutUrls; + + private final Optional backchannelLogoutInitiators; + + private final Map additionalProperties; + + private ClientOidcBackchannelLogoutSettings( + Optional> backchannelLogoutUrls, + Optional backchannelLogoutInitiators, + Map additionalProperties) { + this.backchannelLogoutUrls = backchannelLogoutUrls; + this.backchannelLogoutInitiators = backchannelLogoutInitiators; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed. + */ + @JsonProperty("backchannel_logout_urls") + public Optional> getBackchannelLogoutUrls() { + return backchannelLogoutUrls; + } + + @JsonProperty("backchannel_logout_initiators") + public Optional getBackchannelLogoutInitiators() { + return backchannelLogoutInitiators; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientOidcBackchannelLogoutSettings + && equalTo((ClientOidcBackchannelLogoutSettings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientOidcBackchannelLogoutSettings other) { + return backchannelLogoutUrls.equals(other.backchannelLogoutUrls) + && backchannelLogoutInitiators.equals(other.backchannelLogoutInitiators); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.backchannelLogoutUrls, this.backchannelLogoutInitiators); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> backchannelLogoutUrls = Optional.empty(); + + private Optional backchannelLogoutInitiators = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientOidcBackchannelLogoutSettings other) { + backchannelLogoutUrls(other.getBackchannelLogoutUrls()); + backchannelLogoutInitiators(other.getBackchannelLogoutInitiators()); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed.

+ */ + @JsonSetter(value = "backchannel_logout_urls", nulls = Nulls.SKIP) + public Builder backchannelLogoutUrls(Optional> backchannelLogoutUrls) { + this.backchannelLogoutUrls = backchannelLogoutUrls; + return this; + } + + public Builder backchannelLogoutUrls(List backchannelLogoutUrls) { + this.backchannelLogoutUrls = Optional.ofNullable(backchannelLogoutUrls); + return this; + } + + @JsonSetter(value = "backchannel_logout_initiators", nulls = Nulls.SKIP) + public Builder backchannelLogoutInitiators( + Optional backchannelLogoutInitiators) { + this.backchannelLogoutInitiators = backchannelLogoutInitiators; + return this; + } + + public Builder backchannelLogoutInitiators(ClientOidcBackchannelLogoutInitiators backchannelLogoutInitiators) { + this.backchannelLogoutInitiators = Optional.ofNullable(backchannelLogoutInitiators); + return this; + } + + public ClientOidcBackchannelLogoutSettings build() { + return new ClientOidcBackchannelLogoutSettings( + backchannelLogoutUrls, backchannelLogoutInitiators, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java new file mode 100644 index 000000000..6d1316e7a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOrganizationRequireBehaviorEnum { + public static final ClientOrganizationRequireBehaviorEnum POST_LOGIN_PROMPT = + new ClientOrganizationRequireBehaviorEnum(Value.POST_LOGIN_PROMPT, "post_login_prompt"); + + public static final ClientOrganizationRequireBehaviorEnum PRE_LOGIN_PROMPT = + new ClientOrganizationRequireBehaviorEnum(Value.PRE_LOGIN_PROMPT, "pre_login_prompt"); + + public static final ClientOrganizationRequireBehaviorEnum NO_PROMPT = + new ClientOrganizationRequireBehaviorEnum(Value.NO_PROMPT, "no_prompt"); + + private final Value value; + + private final String string; + + ClientOrganizationRequireBehaviorEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOrganizationRequireBehaviorEnum + && this.string.equals(((ClientOrganizationRequireBehaviorEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POST_LOGIN_PROMPT: + return visitor.visitPostLoginPrompt(); + case PRE_LOGIN_PROMPT: + return visitor.visitPreLoginPrompt(); + case NO_PROMPT: + return visitor.visitNoPrompt(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOrganizationRequireBehaviorEnum valueOf(String value) { + switch (value) { + case "post_login_prompt": + return POST_LOGIN_PROMPT; + case "pre_login_prompt": + return PRE_LOGIN_PROMPT; + case "no_prompt": + return NO_PROMPT; + default: + return new ClientOrganizationRequireBehaviorEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NO_PROMPT, + + PRE_LOGIN_PROMPT, + + POST_LOGIN_PROMPT, + + UNKNOWN + } + + public interface Visitor { + T visitNoPrompt(); + + T visitPreLoginPrompt(); + + T visitPostLoginPrompt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java new file mode 100644 index 000000000..da61ba589 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOrganizationRequireBehaviorPatchEnum { + public static final ClientOrganizationRequireBehaviorPatchEnum POST_LOGIN_PROMPT = + new ClientOrganizationRequireBehaviorPatchEnum(Value.POST_LOGIN_PROMPT, "post_login_prompt"); + + public static final ClientOrganizationRequireBehaviorPatchEnum PRE_LOGIN_PROMPT = + new ClientOrganizationRequireBehaviorPatchEnum(Value.PRE_LOGIN_PROMPT, "pre_login_prompt"); + + public static final ClientOrganizationRequireBehaviorPatchEnum NO_PROMPT = + new ClientOrganizationRequireBehaviorPatchEnum(Value.NO_PROMPT, "no_prompt"); + + private final Value value; + + private final String string; + + ClientOrganizationRequireBehaviorPatchEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOrganizationRequireBehaviorPatchEnum + && this.string.equals(((ClientOrganizationRequireBehaviorPatchEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POST_LOGIN_PROMPT: + return visitor.visitPostLoginPrompt(); + case PRE_LOGIN_PROMPT: + return visitor.visitPreLoginPrompt(); + case NO_PROMPT: + return visitor.visitNoPrompt(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOrganizationRequireBehaviorPatchEnum valueOf(String value) { + switch (value) { + case "post_login_prompt": + return POST_LOGIN_PROMPT; + case "pre_login_prompt": + return PRE_LOGIN_PROMPT; + case "no_prompt": + return NO_PROMPT; + default: + return new ClientOrganizationRequireBehaviorPatchEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NO_PROMPT, + + PRE_LOGIN_PROMPT, + + POST_LOGIN_PROMPT, + + UNKNOWN + } + + public interface Visitor { + T visitNoPrompt(); + + T visitPreLoginPrompt(); + + T visitPostLoginPrompt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java new file mode 100644 index 000000000..9acde5a7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOrganizationUsageEnum { + public static final ClientOrganizationUsageEnum ALLOW = new ClientOrganizationUsageEnum(Value.ALLOW, "allow"); + + public static final ClientOrganizationUsageEnum REQUIRE = new ClientOrganizationUsageEnum(Value.REQUIRE, "require"); + + public static final ClientOrganizationUsageEnum DENY = new ClientOrganizationUsageEnum(Value.DENY, "deny"); + + private final Value value; + + private final String string; + + ClientOrganizationUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOrganizationUsageEnum + && this.string.equals(((ClientOrganizationUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case REQUIRE: + return visitor.visitRequire(); + case DENY: + return visitor.visitDeny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOrganizationUsageEnum valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + case "require": + return REQUIRE; + case "deny": + return DENY; + default: + return new ClientOrganizationUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY, + + ALLOW, + + REQUIRE, + + UNKNOWN + } + + public interface Visitor { + T visitDeny(); + + T visitAllow(); + + T visitRequire(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java new file mode 100644 index 000000000..912b7a224 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOrganizationUsagePatchEnum { + public static final ClientOrganizationUsagePatchEnum ALLOW = + new ClientOrganizationUsagePatchEnum(Value.ALLOW, "allow"); + + public static final ClientOrganizationUsagePatchEnum REQUIRE = + new ClientOrganizationUsagePatchEnum(Value.REQUIRE, "require"); + + public static final ClientOrganizationUsagePatchEnum DENY = + new ClientOrganizationUsagePatchEnum(Value.DENY, "deny"); + + private final Value value; + + private final String string; + + ClientOrganizationUsagePatchEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOrganizationUsagePatchEnum + && this.string.equals(((ClientOrganizationUsagePatchEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case REQUIRE: + return visitor.visitRequire(); + case DENY: + return visitor.visitDeny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOrganizationUsagePatchEnum valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + case "require": + return REQUIRE; + case "deny": + return DENY; + default: + return new ClientOrganizationUsagePatchEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY, + + ALLOW, + + REQUIRE, + + UNKNOWN + } + + public interface Visitor { + T visitDeny(); + + T visitAllow(); + + T visitRequire(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java new file mode 100644 index 000000000..6b58c59c6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientRefreshTokenConfiguration.Builder.class) +public final class ClientRefreshTokenConfiguration { + private final RefreshTokenRotationTypeEnum rotationType; + + private final RefreshTokenExpirationTypeEnum expirationType; + + private final Optional leeway; + + private final Optional tokenLifetime; + + private final Optional infiniteTokenLifetime; + + private final Optional idleTokenLifetime; + + private final Optional infiniteIdleTokenLifetime; + + private final Map additionalProperties; + + private ClientRefreshTokenConfiguration( + RefreshTokenRotationTypeEnum rotationType, + RefreshTokenExpirationTypeEnum expirationType, + Optional leeway, + Optional tokenLifetime, + Optional infiniteTokenLifetime, + Optional idleTokenLifetime, + Optional infiniteIdleTokenLifetime, + Map additionalProperties) { + this.rotationType = rotationType; + this.expirationType = expirationType; + this.leeway = leeway; + this.tokenLifetime = tokenLifetime; + this.infiniteTokenLifetime = infiniteTokenLifetime; + this.idleTokenLifetime = idleTokenLifetime; + this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rotation_type") + public RefreshTokenRotationTypeEnum getRotationType() { + return rotationType; + } + + @JsonProperty("expiration_type") + public RefreshTokenExpirationTypeEnum getExpirationType() { + return expirationType; + } + + /** + * @return Period in seconds where the previous refresh token can be exchanged without triggering breach detection + */ + @JsonProperty("leeway") + public Optional getLeeway() { + return leeway; + } + + /** + * @return Period (in seconds) for which refresh tokens will remain valid + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values) + */ + @JsonProperty("infinite_token_lifetime") + public Optional getInfiniteTokenLifetime() { + return infiniteTokenLifetime; + } + + /** + * @return Period (in seconds) for which refresh tokens will remain valid without use + */ + @JsonProperty("idle_token_lifetime") + public Optional getIdleTokenLifetime() { + return idleTokenLifetime; + } + + /** + * @return Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values) + */ + @JsonProperty("infinite_idle_token_lifetime") + public Optional getInfiniteIdleTokenLifetime() { + return infiniteIdleTokenLifetime; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientRefreshTokenConfiguration && equalTo((ClientRefreshTokenConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientRefreshTokenConfiguration other) { + return rotationType.equals(other.rotationType) + && expirationType.equals(other.expirationType) + && leeway.equals(other.leeway) + && tokenLifetime.equals(other.tokenLifetime) + && infiniteTokenLifetime.equals(other.infiniteTokenLifetime) + && idleTokenLifetime.equals(other.idleTokenLifetime) + && infiniteIdleTokenLifetime.equals(other.infiniteIdleTokenLifetime); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.rotationType, + this.expirationType, + this.leeway, + this.tokenLifetime, + this.infiniteTokenLifetime, + this.idleTokenLifetime, + this.infiniteIdleTokenLifetime); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RotationTypeStage builder() { + return new Builder(); + } + + public interface RotationTypeStage { + ExpirationTypeStage rotationType(@NotNull RefreshTokenRotationTypeEnum rotationType); + + Builder from(ClientRefreshTokenConfiguration other); + } + + public interface ExpirationTypeStage { + _FinalStage expirationType(@NotNull RefreshTokenExpirationTypeEnum expirationType); + } + + public interface _FinalStage { + ClientRefreshTokenConfiguration build(); + + /** + *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

+ */ + _FinalStage leeway(Optional leeway); + + _FinalStage leeway(Integer leeway); + + /** + *

Period (in seconds) for which refresh tokens will remain valid

+ */ + _FinalStage tokenLifetime(Optional tokenLifetime); + + _FinalStage tokenLifetime(Integer tokenLifetime); + + /** + *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

+ */ + _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime); + + _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime); + + /** + *

Period (in seconds) for which refresh tokens will remain valid without use

+ */ + _FinalStage idleTokenLifetime(Optional idleTokenLifetime); + + _FinalStage idleTokenLifetime(Integer idleTokenLifetime); + + /** + *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

+ */ + _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleTokenLifetime); + + _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RotationTypeStage, ExpirationTypeStage, _FinalStage { + private RefreshTokenRotationTypeEnum rotationType; + + private RefreshTokenExpirationTypeEnum expirationType; + + private Optional infiniteIdleTokenLifetime = Optional.empty(); + + private Optional idleTokenLifetime = Optional.empty(); + + private Optional infiniteTokenLifetime = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional leeway = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientRefreshTokenConfiguration other) { + rotationType(other.getRotationType()); + expirationType(other.getExpirationType()); + leeway(other.getLeeway()); + tokenLifetime(other.getTokenLifetime()); + infiniteTokenLifetime(other.getInfiniteTokenLifetime()); + idleTokenLifetime(other.getIdleTokenLifetime()); + infiniteIdleTokenLifetime(other.getInfiniteIdleTokenLifetime()); + return this; + } + + @java.lang.Override + @JsonSetter("rotation_type") + public ExpirationTypeStage rotationType(@NotNull RefreshTokenRotationTypeEnum rotationType) { + this.rotationType = Objects.requireNonNull(rotationType, "rotationType must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("expiration_type") + public _FinalStage expirationType(@NotNull RefreshTokenExpirationTypeEnum expirationType) { + this.expirationType = Objects.requireNonNull(expirationType, "expirationType must not be null"); + return this; + } + + /** + *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) { + this.infiniteIdleTokenLifetime = Optional.ofNullable(infiniteIdleTokenLifetime); + return this; + } + + /** + *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

+ */ + @java.lang.Override + @JsonSetter(value = "infinite_idle_token_lifetime", nulls = Nulls.SKIP) + public _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleTokenLifetime) { + this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; + return this; + } + + /** + *

Period (in seconds) for which refresh tokens will remain valid without use

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage idleTokenLifetime(Integer idleTokenLifetime) { + this.idleTokenLifetime = Optional.ofNullable(idleTokenLifetime); + return this; + } + + /** + *

Period (in seconds) for which refresh tokens will remain valid without use

+ */ + @java.lang.Override + @JsonSetter(value = "idle_token_lifetime", nulls = Nulls.SKIP) + public _FinalStage idleTokenLifetime(Optional idleTokenLifetime) { + this.idleTokenLifetime = idleTokenLifetime; + return this; + } + + /** + *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime) { + this.infiniteTokenLifetime = Optional.ofNullable(infiniteTokenLifetime); + return this; + } + + /** + *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

+ */ + @java.lang.Override + @JsonSetter(value = "infinite_token_lifetime", nulls = Nulls.SKIP) + public _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime) { + this.infiniteTokenLifetime = infiniteTokenLifetime; + return this; + } + + /** + *

Period (in seconds) for which refresh tokens will remain valid

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Period (in seconds) for which refresh tokens will remain valid

+ */ + @java.lang.Override + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public _FinalStage tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + /** + *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage leeway(Integer leeway) { + this.leeway = Optional.ofNullable(leeway); + return this; + } + + /** + *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

+ */ + @java.lang.Override + @JsonSetter(value = "leeway", nulls = Nulls.SKIP) + public _FinalStage leeway(Optional leeway) { + this.leeway = leeway; + return this; + } + + @java.lang.Override + public ClientRefreshTokenConfiguration build() { + return new ClientRefreshTokenConfiguration( + rotationType, + expirationType, + leeway, + tokenLifetime, + infiniteTokenLifetime, + idleTokenLifetime, + infiniteIdleTokenLifetime, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java new file mode 100644 index 000000000..edb3e0e5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientSessionTransferAllowedAuthenticationMethodsEnum { + public static final ClientSessionTransferAllowedAuthenticationMethodsEnum QUERY = + new ClientSessionTransferAllowedAuthenticationMethodsEnum(Value.QUERY, "query"); + + public static final ClientSessionTransferAllowedAuthenticationMethodsEnum COOKIE = + new ClientSessionTransferAllowedAuthenticationMethodsEnum(Value.COOKIE, "cookie"); + + private final Value value; + + private final String string; + + ClientSessionTransferAllowedAuthenticationMethodsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientSessionTransferAllowedAuthenticationMethodsEnum + && this.string.equals(((ClientSessionTransferAllowedAuthenticationMethodsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case QUERY: + return visitor.visitQuery(); + case COOKIE: + return visitor.visitCookie(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientSessionTransferAllowedAuthenticationMethodsEnum valueOf(String value) { + switch (value) { + case "query": + return QUERY; + case "cookie": + return COOKIE; + default: + return new ClientSessionTransferAllowedAuthenticationMethodsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + COOKIE, + + QUERY, + + UNKNOWN + } + + public interface Visitor { + T visitCookie(); + + T visitQuery(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java new file mode 100644 index 000000000..8dcdd20f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientSessionTransferConfiguration.Builder.class) +public final class ClientSessionTransferConfiguration { + private final Optional canCreateSessionTransferToken; + + private final Optional> allowedAuthenticationMethods; + + private final Optional enforceDeviceBinding; + + private final Optional allowRefreshToken; + + private final Optional enforceOnlineRefreshTokens; + + private final Optional enforceCascadeRevocation; + + private final Map additionalProperties; + + private ClientSessionTransferConfiguration( + Optional canCreateSessionTransferToken, + Optional> allowedAuthenticationMethods, + Optional enforceDeviceBinding, + Optional allowRefreshToken, + Optional enforceOnlineRefreshTokens, + Optional enforceCascadeRevocation, + Map additionalProperties) { + this.canCreateSessionTransferToken = canCreateSessionTransferToken; + this.allowedAuthenticationMethods = allowedAuthenticationMethods; + this.enforceDeviceBinding = enforceDeviceBinding; + this.allowRefreshToken = allowRefreshToken; + this.enforceOnlineRefreshTokens = enforceOnlineRefreshTokens; + this.enforceCascadeRevocation = enforceCascadeRevocation; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates whether an app can issue a session_token through Token Exchange. If set to 'false', the app will not be able to issue a session_token. + */ + @JsonProperty("can_create_session_transfer_token") + public Optional getCanCreateSessionTransferToken() { + return canCreateSessionTransferToken; + } + + /** + * @return Indicates whether an app can create a session from a session_token received via indicated methods. + */ + @JsonProperty("allowed_authentication_methods") + public Optional> getAllowedAuthenticationMethods() { + return allowedAuthenticationMethods; + } + + @JsonProperty("enforce_device_binding") + public Optional getEnforceDeviceBinding() { + return enforceDeviceBinding; + } + + /** + * @return Indicates whether Refresh Tokens are allowed to be issued when authenticating with a session_transfer_token. + */ + @JsonProperty("allow_refresh_token") + public Optional getAllowRefreshToken() { + return allowRefreshToken; + } + + /** + * @return Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are. + */ + @JsonProperty("enforce_online_refresh_tokens") + public Optional getEnforceOnlineRefreshTokens() { + return enforceOnlineRefreshTokens; + } + + /** + * @return Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities. + */ + @JsonProperty("enforce_cascade_revocation") + public Optional getEnforceCascadeRevocation() { + return enforceCascadeRevocation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionTransferConfiguration + && equalTo((ClientSessionTransferConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionTransferConfiguration other) { + return canCreateSessionTransferToken.equals(other.canCreateSessionTransferToken) + && allowedAuthenticationMethods.equals(other.allowedAuthenticationMethods) + && enforceDeviceBinding.equals(other.enforceDeviceBinding) + && allowRefreshToken.equals(other.allowRefreshToken) + && enforceOnlineRefreshTokens.equals(other.enforceOnlineRefreshTokens) + && enforceCascadeRevocation.equals(other.enforceCascadeRevocation); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.canCreateSessionTransferToken, + this.allowedAuthenticationMethods, + this.enforceDeviceBinding, + this.allowRefreshToken, + this.enforceOnlineRefreshTokens, + this.enforceCascadeRevocation); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional canCreateSessionTransferToken = Optional.empty(); + + private Optional> allowedAuthenticationMethods = + Optional.empty(); + + private Optional enforceDeviceBinding = Optional.empty(); + + private Optional allowRefreshToken = Optional.empty(); + + private Optional enforceOnlineRefreshTokens = Optional.empty(); + + private Optional enforceCascadeRevocation = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSessionTransferConfiguration other) { + canCreateSessionTransferToken(other.getCanCreateSessionTransferToken()); + allowedAuthenticationMethods(other.getAllowedAuthenticationMethods()); + enforceDeviceBinding(other.getEnforceDeviceBinding()); + allowRefreshToken(other.getAllowRefreshToken()); + enforceOnlineRefreshTokens(other.getEnforceOnlineRefreshTokens()); + enforceCascadeRevocation(other.getEnforceCascadeRevocation()); + return this; + } + + /** + *

Indicates whether an app can issue a session_token through Token Exchange. If set to 'false', the app will not be able to issue a session_token.

+ */ + @JsonSetter(value = "can_create_session_transfer_token", nulls = Nulls.SKIP) + public Builder canCreateSessionTransferToken(Optional canCreateSessionTransferToken) { + this.canCreateSessionTransferToken = canCreateSessionTransferToken; + return this; + } + + public Builder canCreateSessionTransferToken(Boolean canCreateSessionTransferToken) { + this.canCreateSessionTransferToken = Optional.ofNullable(canCreateSessionTransferToken); + return this; + } + + /** + *

Indicates whether an app can create a session from a session_token received via indicated methods.

+ */ + @JsonSetter(value = "allowed_authentication_methods", nulls = Nulls.SKIP) + public Builder allowedAuthenticationMethods( + Optional> allowedAuthenticationMethods) { + this.allowedAuthenticationMethods = allowedAuthenticationMethods; + return this; + } + + public Builder allowedAuthenticationMethods( + List allowedAuthenticationMethods) { + this.allowedAuthenticationMethods = Optional.ofNullable(allowedAuthenticationMethods); + return this; + } + + @JsonSetter(value = "enforce_device_binding", nulls = Nulls.SKIP) + public Builder enforceDeviceBinding(Optional enforceDeviceBinding) { + this.enforceDeviceBinding = enforceDeviceBinding; + return this; + } + + public Builder enforceDeviceBinding(ClientSessionTransferDeviceBindingEnum enforceDeviceBinding) { + this.enforceDeviceBinding = Optional.ofNullable(enforceDeviceBinding); + return this; + } + + /** + *

Indicates whether Refresh Tokens are allowed to be issued when authenticating with a session_transfer_token.

+ */ + @JsonSetter(value = "allow_refresh_token", nulls = Nulls.SKIP) + public Builder allowRefreshToken(Optional allowRefreshToken) { + this.allowRefreshToken = allowRefreshToken; + return this; + } + + public Builder allowRefreshToken(Boolean allowRefreshToken) { + this.allowRefreshToken = Optional.ofNullable(allowRefreshToken); + return this; + } + + /** + *

Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are.

+ */ + @JsonSetter(value = "enforce_online_refresh_tokens", nulls = Nulls.SKIP) + public Builder enforceOnlineRefreshTokens(Optional enforceOnlineRefreshTokens) { + this.enforceOnlineRefreshTokens = enforceOnlineRefreshTokens; + return this; + } + + public Builder enforceOnlineRefreshTokens(Boolean enforceOnlineRefreshTokens) { + this.enforceOnlineRefreshTokens = Optional.ofNullable(enforceOnlineRefreshTokens); + return this; + } + + /** + *

Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities.

+ */ + @JsonSetter(value = "enforce_cascade_revocation", nulls = Nulls.SKIP) + public Builder enforceCascadeRevocation(Optional enforceCascadeRevocation) { + this.enforceCascadeRevocation = enforceCascadeRevocation; + return this; + } + + public Builder enforceCascadeRevocation(Boolean enforceCascadeRevocation) { + this.enforceCascadeRevocation = Optional.ofNullable(enforceCascadeRevocation); + return this; + } + + public ClientSessionTransferConfiguration build() { + return new ClientSessionTransferConfiguration( + canCreateSessionTransferToken, + allowedAuthenticationMethods, + enforceDeviceBinding, + allowRefreshToken, + enforceOnlineRefreshTokens, + enforceCascadeRevocation, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java new file mode 100644 index 000000000..bb2238bb7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientSessionTransferDeviceBindingEnum { + public static final ClientSessionTransferDeviceBindingEnum ASN = + new ClientSessionTransferDeviceBindingEnum(Value.ASN, "asn"); + + public static final ClientSessionTransferDeviceBindingEnum NONE = + new ClientSessionTransferDeviceBindingEnum(Value.NONE, "none"); + + public static final ClientSessionTransferDeviceBindingEnum IP = + new ClientSessionTransferDeviceBindingEnum(Value.IP, "ip"); + + private final Value value; + + private final String string; + + ClientSessionTransferDeviceBindingEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientSessionTransferDeviceBindingEnum + && this.string.equals(((ClientSessionTransferDeviceBindingEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ASN: + return visitor.visitAsn(); + case NONE: + return visitor.visitNone(); + case IP: + return visitor.visitIp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientSessionTransferDeviceBindingEnum valueOf(String value) { + switch (value) { + case "asn": + return ASN; + case "none": + return NONE; + case "ip": + return IP; + default: + return new ClientSessionTransferDeviceBindingEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + IP, + + ASN, + + NONE, + + UNKNOWN + } + + public interface Visitor { + T visitIp(); + + T visitAsn(); + + T visitNone(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java new file mode 100644 index 000000000..4a7ed6e2b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientSignedRequestObjectWithCredentialId.Builder.class) +public final class ClientSignedRequestObjectWithCredentialId { + private final Optional required; + + private final Optional> credentials; + + private final Map additionalProperties; + + private ClientSignedRequestObjectWithCredentialId( + Optional required, + Optional> credentials, + Map additionalProperties) { + this.required = required; + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates whether the JAR requests are mandatory + */ + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("credentials") + public Optional> getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSignedRequestObjectWithCredentialId + && equalTo((ClientSignedRequestObjectWithCredentialId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSignedRequestObjectWithCredentialId other) { + return required.equals(other.required) && credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.required, this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional required = Optional.empty(); + + private Optional> credentials = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSignedRequestObjectWithCredentialId other) { + required(other.getRequired()); + credentials(other.getCredentials()); + return this; + } + + /** + *

Indicates whether the JAR requests are mandatory

+ */ + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public Builder required(Optional required) { + this.required = required; + return this; + } + + public Builder required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional> credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(List credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + public ClientSignedRequestObjectWithCredentialId build() { + return new ClientSignedRequestObjectWithCredentialId(required, credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java new file mode 100644 index 000000000..d95362a49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientSignedRequestObjectWithPublicKey.Builder.class) +public final class ClientSignedRequestObjectWithPublicKey { + private final Optional required; + + private final Optional> credentials; + + private final Map additionalProperties; + + private ClientSignedRequestObjectWithPublicKey( + Optional required, + Optional> credentials, + Map additionalProperties) { + this.required = required; + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates whether the JAR requests are mandatory + */ + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("credentials") + public Optional> getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSignedRequestObjectWithPublicKey + && equalTo((ClientSignedRequestObjectWithPublicKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSignedRequestObjectWithPublicKey other) { + return required.equals(other.required) && credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.required, this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional required = Optional.empty(); + + private Optional> credentials = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSignedRequestObjectWithPublicKey other) { + required(other.getRequired()); + credentials(other.getCredentials()); + return this; + } + + /** + *

Indicates whether the JAR requests are mandatory

+ */ + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public Builder required(Optional required) { + this.required = required; + return this; + } + + public Builder required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional> credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(List credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + public ClientSignedRequestObjectWithPublicKey build() { + return new ClientSignedRequestObjectWithPublicKey(required, credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java new file mode 100644 index 000000000..7b78cfcfc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientSigningKey.Builder.class) +public final class ClientSigningKey { + private final Optional pkcs7; + + private final Optional cert; + + private final Optional subject; + + private final Map additionalProperties; + + private ClientSigningKey( + Optional pkcs7, + Optional cert, + Optional subject, + Map additionalProperties) { + this.pkcs7 = pkcs7; + this.cert = cert; + this.subject = subject; + this.additionalProperties = additionalProperties; + } + + /** + * @return Signing certificate public key and chain in PKCS#7 (.P7B) format. + */ + @JsonProperty("pkcs7") + public Optional getPkcs7() { + return pkcs7; + } + + /** + * @return Signing certificate public key in X.509 (.CER) format. + */ + @JsonProperty("cert") + public Optional getCert() { + return cert; + } + + /** + * @return Subject name for this certificate in the format /CN={domain}. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSigningKey && equalTo((ClientSigningKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSigningKey other) { + return pkcs7.equals(other.pkcs7) && cert.equals(other.cert) && subject.equals(other.subject); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pkcs7, this.cert, this.subject); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pkcs7 = Optional.empty(); + + private Optional cert = Optional.empty(); + + private Optional subject = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSigningKey other) { + pkcs7(other.getPkcs7()); + cert(other.getCert()); + subject(other.getSubject()); + return this; + } + + /** + *

Signing certificate public key and chain in PKCS#7 (.P7B) format.

+ */ + @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) + public Builder pkcs7(Optional pkcs7) { + this.pkcs7 = pkcs7; + return this; + } + + public Builder pkcs7(String pkcs7) { + this.pkcs7 = Optional.ofNullable(pkcs7); + return this; + } + + /** + *

Signing certificate public key in X.509 (.CER) format.

+ */ + @JsonSetter(value = "cert", nulls = Nulls.SKIP) + public Builder cert(Optional cert) { + this.cert = cert; + return this; + } + + public Builder cert(String cert) { + this.cert = Optional.ofNullable(cert); + return this; + } + + /** + *

Subject name for this certificate in the format /CN={domain}.

+ */ + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + public ClientSigningKey build() { + return new ClientSigningKey(pkcs7, cert, subject, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java new file mode 100644 index 000000000..7b1d0adb1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientTokenEndpointAuthMethodEnum { + public static final ClientTokenEndpointAuthMethodEnum CLIENT_SECRET_BASIC = + new ClientTokenEndpointAuthMethodEnum(Value.CLIENT_SECRET_BASIC, "client_secret_basic"); + + public static final ClientTokenEndpointAuthMethodEnum CLIENT_SECRET_POST = + new ClientTokenEndpointAuthMethodEnum(Value.CLIENT_SECRET_POST, "client_secret_post"); + + public static final ClientTokenEndpointAuthMethodEnum NONE = + new ClientTokenEndpointAuthMethodEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + ClientTokenEndpointAuthMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientTokenEndpointAuthMethodEnum + && this.string.equals(((ClientTokenEndpointAuthMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLIENT_SECRET_BASIC: + return visitor.visitClientSecretBasic(); + case CLIENT_SECRET_POST: + return visitor.visitClientSecretPost(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientTokenEndpointAuthMethodEnum valueOf(String value) { + switch (value) { + case "client_secret_basic": + return CLIENT_SECRET_BASIC; + case "client_secret_post": + return CLIENT_SECRET_POST; + case "none": + return NONE; + default: + return new ClientTokenEndpointAuthMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + CLIENT_SECRET_POST, + + CLIENT_SECRET_BASIC, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitClientSecretPost(); + + T visitClientSecretBasic(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java new file mode 100644 index 000000000..22e9d1ba4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientTokenEndpointAuthMethodOrNullEnum { + public static final ClientTokenEndpointAuthMethodOrNullEnum CLIENT_SECRET_BASIC = + new ClientTokenEndpointAuthMethodOrNullEnum(Value.CLIENT_SECRET_BASIC, "client_secret_basic"); + + public static final ClientTokenEndpointAuthMethodOrNullEnum CLIENT_SECRET_POST = + new ClientTokenEndpointAuthMethodOrNullEnum(Value.CLIENT_SECRET_POST, "client_secret_post"); + + public static final ClientTokenEndpointAuthMethodOrNullEnum NONE = + new ClientTokenEndpointAuthMethodOrNullEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + ClientTokenEndpointAuthMethodOrNullEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientTokenEndpointAuthMethodOrNullEnum + && this.string.equals(((ClientTokenEndpointAuthMethodOrNullEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLIENT_SECRET_BASIC: + return visitor.visitClientSecretBasic(); + case CLIENT_SECRET_POST: + return visitor.visitClientSecretPost(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientTokenEndpointAuthMethodOrNullEnum valueOf(String value) { + switch (value) { + case "client_secret_basic": + return CLIENT_SECRET_BASIC; + case "client_secret_post": + return CLIENT_SECRET_POST; + case "none": + return NONE; + default: + return new ClientTokenEndpointAuthMethodOrNullEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + CLIENT_SECRET_POST, + + CLIENT_SECRET_BASIC, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitClientSecretPost(); + + T visitClientSecretBasic(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java new file mode 100644 index 000000000..e424b5a32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAttributeIdentifier.Builder.class) +public final class ConnectionAttributeIdentifier { + private final Optional active; + + private final Map additionalProperties; + + private ConnectionAttributeIdentifier(Optional active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines if the attribute is used for identification + */ + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAttributeIdentifier && equalTo((ConnectionAttributeIdentifier) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAttributeIdentifier other) { + return active.equals(other.active); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.active); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional active = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionAttributeIdentifier other) { + active(other.getActive()); + return this; + } + + /** + *

Determines if the attribute is used for identification

+ */ + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + public ConnectionAttributeIdentifier build() { + return new ConnectionAttributeIdentifier(active, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java new file mode 100644 index 000000000..7d4ac34b4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAttributes.Builder.class) +public final class ConnectionAttributes { + private final Optional email; + + private final Optional phoneNumber; + + private final Optional username; + + private final Map additionalProperties; + + private ConnectionAttributes( + Optional email, + Optional phoneNumber, + Optional username, + Map additionalProperties) { + this.email = email; + this.phoneNumber = phoneNumber; + this.username = username; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAttributes && equalTo((ConnectionAttributes) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAttributes other) { + return email.equals(other.email) && phoneNumber.equals(other.phoneNumber) && username.equals(other.username); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.email, this.phoneNumber, this.username); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional username = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionAttributes other) { + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + username(other.getUsername()); + return this; + } + + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(EmailAttribute email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(PhoneAttribute phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(UsernameAttribute username) { + this.username = Optional.ofNullable(username); + return this; + } + + public ConnectionAttributes build() { + return new ConnectionAttributes(email, phoneNumber, username, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java new file mode 100644 index 000000000..bb46df26b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAuthenticationMethods.Builder.class) +public final class ConnectionAuthenticationMethods { + private final Optional password; + + private final Optional passkey; + + private final Map additionalProperties; + + private ConnectionAuthenticationMethods( + Optional password, + Optional passkey, + Map additionalProperties) { + this.password = password; + this.passkey = passkey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("password") + public Optional getPassword() { + return password; + } + + @JsonProperty("passkey") + public Optional getPasskey() { + return passkey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAuthenticationMethods && equalTo((ConnectionAuthenticationMethods) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAuthenticationMethods other) { + return password.equals(other.password) && passkey.equals(other.passkey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.password, this.passkey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional password = Optional.empty(); + + private Optional passkey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionAuthenticationMethods other) { + password(other.getPassword()); + passkey(other.getPasskey()); + return this; + } + + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public Builder password(Optional password) { + this.password = password; + return this; + } + + public Builder password(ConnectionPasswordAuthenticationMethod password) { + this.password = Optional.ofNullable(password); + return this; + } + + @JsonSetter(value = "passkey", nulls = Nulls.SKIP) + public Builder passkey(Optional passkey) { + this.passkey = passkey; + return this; + } + + public Builder passkey(ConnectionPasskeyAuthenticationMethod passkey) { + this.passkey = Optional.ofNullable(passkey); + return this; + } + + public ConnectionAuthenticationMethods build() { + return new ConnectionAuthenticationMethods(password, passkey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java new file mode 100644 index 000000000..db2a3e6c5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java @@ -0,0 +1,308 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionCustomScripts.Builder.class) +public final class ConnectionCustomScripts { + private final Optional login; + + private final Optional getUser; + + private final Optional delete; + + private final Optional changePassword; + + private final Optional verify; + + private final Optional create; + + private final Optional changeUsername; + + private final Optional changeEmail; + + private final Optional changePhoneNumber; + + private final Map additionalProperties; + + private ConnectionCustomScripts( + Optional login, + Optional getUser, + Optional delete, + Optional changePassword, + Optional verify, + Optional create, + Optional changeUsername, + Optional changeEmail, + Optional changePhoneNumber, + Map additionalProperties) { + this.login = login; + this.getUser = getUser; + this.delete = delete; + this.changePassword = changePassword; + this.verify = verify; + this.create = create; + this.changeUsername = changeUsername; + this.changeEmail = changeEmail; + this.changePhoneNumber = changePhoneNumber; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("login") + public Optional getLogin() { + return login; + } + + @JsonProperty("get_user") + public Optional getGetUser() { + return getUser; + } + + @JsonProperty("delete") + public Optional getDelete() { + return delete; + } + + @JsonProperty("change_password") + public Optional getChangePassword() { + return changePassword; + } + + @JsonProperty("verify") + public Optional getVerify() { + return verify; + } + + @JsonProperty("create") + public Optional getCreate() { + return create; + } + + @JsonProperty("change_username") + public Optional getChangeUsername() { + return changeUsername; + } + + @JsonProperty("change_email") + public Optional getChangeEmail() { + return changeEmail; + } + + @JsonProperty("change_phone_number") + public Optional getChangePhoneNumber() { + return changePhoneNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionCustomScripts && equalTo((ConnectionCustomScripts) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionCustomScripts other) { + return login.equals(other.login) + && getUser.equals(other.getUser) + && delete.equals(other.delete) + && changePassword.equals(other.changePassword) + && verify.equals(other.verify) + && create.equals(other.create) + && changeUsername.equals(other.changeUsername) + && changeEmail.equals(other.changeEmail) + && changePhoneNumber.equals(other.changePhoneNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.login, + this.getUser, + this.delete, + this.changePassword, + this.verify, + this.create, + this.changeUsername, + this.changeEmail, + this.changePhoneNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional login = Optional.empty(); + + private Optional getUser = Optional.empty(); + + private Optional delete = Optional.empty(); + + private Optional changePassword = Optional.empty(); + + private Optional verify = Optional.empty(); + + private Optional create = Optional.empty(); + + private Optional changeUsername = Optional.empty(); + + private Optional changeEmail = Optional.empty(); + + private Optional changePhoneNumber = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionCustomScripts other) { + login(other.getLogin()); + getUser(other.getGetUser()); + delete(other.getDelete()); + changePassword(other.getChangePassword()); + verify(other.getVerify()); + create(other.getCreate()); + changeUsername(other.getChangeUsername()); + changeEmail(other.getChangeEmail()); + changePhoneNumber(other.getChangePhoneNumber()); + return this; + } + + @JsonSetter(value = "login", nulls = Nulls.SKIP) + public Builder login(Optional login) { + this.login = login; + return this; + } + + public Builder login(String login) { + this.login = Optional.ofNullable(login); + return this; + } + + @JsonSetter(value = "get_user", nulls = Nulls.SKIP) + public Builder getUser(Optional getUser) { + this.getUser = getUser; + return this; + } + + public Builder getUser(String getUser) { + this.getUser = Optional.ofNullable(getUser); + return this; + } + + @JsonSetter(value = "delete", nulls = Nulls.SKIP) + public Builder delete(Optional delete) { + this.delete = delete; + return this; + } + + public Builder delete(String delete) { + this.delete = Optional.ofNullable(delete); + return this; + } + + @JsonSetter(value = "change_password", nulls = Nulls.SKIP) + public Builder changePassword(Optional changePassword) { + this.changePassword = changePassword; + return this; + } + + public Builder changePassword(String changePassword) { + this.changePassword = Optional.ofNullable(changePassword); + return this; + } + + @JsonSetter(value = "verify", nulls = Nulls.SKIP) + public Builder verify(Optional verify) { + this.verify = verify; + return this; + } + + public Builder verify(String verify) { + this.verify = Optional.ofNullable(verify); + return this; + } + + @JsonSetter(value = "create", nulls = Nulls.SKIP) + public Builder create(Optional create) { + this.create = create; + return this; + } + + public Builder create(String create) { + this.create = Optional.ofNullable(create); + return this; + } + + @JsonSetter(value = "change_username", nulls = Nulls.SKIP) + public Builder changeUsername(Optional changeUsername) { + this.changeUsername = changeUsername; + return this; + } + + public Builder changeUsername(String changeUsername) { + this.changeUsername = Optional.ofNullable(changeUsername); + return this; + } + + @JsonSetter(value = "change_email", nulls = Nulls.SKIP) + public Builder changeEmail(Optional changeEmail) { + this.changeEmail = changeEmail; + return this; + } + + public Builder changeEmail(String changeEmail) { + this.changeEmail = Optional.ofNullable(changeEmail); + return this; + } + + @JsonSetter(value = "change_phone_number", nulls = Nulls.SKIP) + public Builder changePhoneNumber(Optional changePhoneNumber) { + this.changePhoneNumber = changePhoneNumber; + return this; + } + + public Builder changePhoneNumber(String changePhoneNumber) { + this.changePhoneNumber = Optional.ofNullable(changePhoneNumber); + return this; + } + + public ConnectionCustomScripts build() { + return new ConnectionCustomScripts( + login, + getUser, + delete, + changePassword, + verify, + create, + changeUsername, + changeEmail, + changePhoneNumber, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java new file mode 100644 index 000000000..a2c363c11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionEnabledClient.Builder.class) +public final class ConnectionEnabledClient { + private final String clientId; + + private final Map additionalProperties; + + private ConnectionEnabledClient(String clientId, Map additionalProperties) { + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The client id + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionEnabledClient && equalTo((ConnectionEnabledClient) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionEnabledClient other) { + return clientId.equals(other.clientId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The client id

+ */ + _FinalStage clientId(@NotNull String clientId); + + Builder from(ConnectionEnabledClient other); + } + + public interface _FinalStage { + ConnectionEnabledClient build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionEnabledClient other) { + clientId(other.getClientId()); + return this; + } + + /** + *

The client id

+ *

The client id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @java.lang.Override + public ConnectionEnabledClient build() { + return new ConnectionEnabledClient(clientId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java new file mode 100644 index 000000000..a1a2c6f79 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionForList.Builder.class) +public final class ConnectionForList { + private final Optional name; + + private final Optional displayName; + + private final Optional> options; + + private final Optional id; + + private final Optional strategy; + + private final Optional> realms; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> metadata; + + private final Map additionalProperties; + + private ConnectionForList( + Optional name, + Optional displayName, + Optional> options, + Optional id, + Optional strategy, + Optional> realms, + Optional isDomainConnection, + Optional showAsButton, + Optional> metadata, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.options = options; + this.id = id; + this.strategy = strategy; + this.realms = realms; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Connection name used in login screen + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The type of the connection, related to the identity provider + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + /** + * @return True if the connection is domain level + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionForList && equalTo((ConnectionForList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionForList other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && options.equals(other.options) + && id.equals(other.id) + && strategy.equals(other.strategy) + && realms.equals(other.realms) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.displayName, + this.options, + this.id, + this.strategy, + this.realms, + this.isDomainConnection, + this.showAsButton, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionForList other) { + name(other.getName()); + displayName(other.getDisplayName()); + options(other.getOptions()); + id(other.getId()); + strategy(other.getStrategy()); + realms(other.getRealms()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The name of the connection

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Connection name used in login screen

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The type of the connection, related to the identity provider

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + /** + *

True if the connection is domain level

+ */ + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public ConnectionForList build() { + return new ConnectionForList( + name, + displayName, + options, + id, + strategy, + realms, + isDomainConnection, + showAsButton, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java new file mode 100644 index 000000000..918f3e7ab --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionForOrganization.Builder.class) +public final class ConnectionForOrganization { + private final String connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Map additionalProperties; + + private ConnectionForOrganization( + String connectionId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionForOrganization && equalTo((ConnectionForOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionForOrganization other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.showAsButton, this.isSignupEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

ID of the connection.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(ConnectionForOrganization other); + } + + public interface _FinalStage { + ConnectionForOrganization build(); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionForOrganization other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + return this; + } + + /** + *

ID of the connection.

+ *

ID of the connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + @java.lang.Override + public ConnectionForOrganization build() { + return new ConnectionForOrganization( + connectionId, assignMembershipOnLogin, showAsButton, isSignupEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java new file mode 100644 index 000000000..cdde507d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java @@ -0,0 +1,274 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionGatewayAuthentication.Builder.class) +public final class ConnectionGatewayAuthentication { + private final String method; + + private final Optional subject; + + private final String audience; + + private final String secret; + + private final Optional secretBase64Encoded; + + private final Map additionalProperties; + + private ConnectionGatewayAuthentication( + String method, + Optional subject, + String audience, + String secret, + Optional secretBase64Encoded, + Map additionalProperties) { + this.method = method; + this.subject = subject; + this.audience = audience; + this.secret = secret; + this.secretBase64Encoded = secretBase64Encoded; + this.additionalProperties = additionalProperties; + } + + /** + * @return The Authorization header type. + */ + @JsonProperty("method") + public String getMethod() { + return method; + } + + /** + * @return The subject to be added to the JWT payload. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The audience to be added to the JWT payload. + */ + @JsonProperty("audience") + public String getAudience() { + return audience; + } + + /** + * @return The secret to be used for signing tokens. + */ + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + /** + * @return Set to true if the provided secret is base64 encoded. + */ + @JsonProperty("secret_base64_encoded") + public Optional getSecretBase64Encoded() { + return secretBase64Encoded; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionGatewayAuthentication && equalTo((ConnectionGatewayAuthentication) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionGatewayAuthentication other) { + return method.equals(other.method) + && subject.equals(other.subject) + && audience.equals(other.audience) + && secret.equals(other.secret) + && secretBase64Encoded.equals(other.secretBase64Encoded); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.subject, this.audience, this.secret, this.secretBase64Encoded); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + /** + *

The Authorization header type.

+ */ + AudienceStage method(@NotNull String method); + + Builder from(ConnectionGatewayAuthentication other); + } + + public interface AudienceStage { + /** + *

The audience to be added to the JWT payload.

+ */ + SecretStage audience(@NotNull String audience); + } + + public interface SecretStage { + /** + *

The secret to be used for signing tokens.

+ */ + _FinalStage secret(@NotNull String secret); + } + + public interface _FinalStage { + ConnectionGatewayAuthentication build(); + + /** + *

The subject to be added to the JWT payload.

+ */ + _FinalStage subject(Optional subject); + + _FinalStage subject(String subject); + + /** + *

Set to true if the provided secret is base64 encoded.

+ */ + _FinalStage secretBase64Encoded(Optional secretBase64Encoded); + + _FinalStage secretBase64Encoded(Boolean secretBase64Encoded); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, AudienceStage, SecretStage, _FinalStage { + private String method; + + private String audience; + + private String secret; + + private Optional secretBase64Encoded = Optional.empty(); + + private Optional subject = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionGatewayAuthentication other) { + method(other.getMethod()); + subject(other.getSubject()); + audience(other.getAudience()); + secret(other.getSecret()); + secretBase64Encoded(other.getSecretBase64Encoded()); + return this; + } + + /** + *

The Authorization header type.

+ *

The Authorization header type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("method") + public AudienceStage method(@NotNull String method) { + this.method = Objects.requireNonNull(method, "method must not be null"); + return this; + } + + /** + *

The audience to be added to the JWT payload.

+ *

The audience to be added to the JWT payload.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("audience") + public SecretStage audience(@NotNull String audience) { + this.audience = Objects.requireNonNull(audience, "audience must not be null"); + return this; + } + + /** + *

The secret to be used for signing tokens.

+ *

The secret to be used for signing tokens.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("secret") + public _FinalStage secret(@NotNull String secret) { + this.secret = Objects.requireNonNull(secret, "secret must not be null"); + return this; + } + + /** + *

Set to true if the provided secret is base64 encoded.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secretBase64Encoded(Boolean secretBase64Encoded) { + this.secretBase64Encoded = Optional.ofNullable(secretBase64Encoded); + return this; + } + + /** + *

Set to true if the provided secret is base64 encoded.

+ */ + @java.lang.Override + @JsonSetter(value = "secret_base64_encoded", nulls = Nulls.SKIP) + public _FinalStage secretBase64Encoded(Optional secretBase64Encoded) { + this.secretBase64Encoded = secretBase64Encoded; + return this; + } + + /** + *

The subject to be added to the JWT payload.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + /** + *

The subject to be added to the JWT payload.

+ */ + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(Optional subject) { + this.subject = subject; + return this; + } + + @java.lang.Override + public ConnectionGatewayAuthentication build() { + return new ConnectionGatewayAuthentication( + method, subject, audience, secret, secretBase64Encoded, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java new file mode 100644 index 000000000..a84b60bf2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionIdentifierPrecedenceEnum { + public static final ConnectionIdentifierPrecedenceEnum EMAIL = + new ConnectionIdentifierPrecedenceEnum(Value.EMAIL, "email"); + + public static final ConnectionIdentifierPrecedenceEnum PHONE_NUMBER = + new ConnectionIdentifierPrecedenceEnum(Value.PHONE_NUMBER, "phone_number"); + + public static final ConnectionIdentifierPrecedenceEnum USERNAME = + new ConnectionIdentifierPrecedenceEnum(Value.USERNAME, "username"); + + private final Value value; + + private final String string; + + ConnectionIdentifierPrecedenceEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionIdentifierPrecedenceEnum + && this.string.equals(((ConnectionIdentifierPrecedenceEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case PHONE_NUMBER: + return visitor.visitPhoneNumber(); + case USERNAME: + return visitor.visitUsername(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionIdentifierPrecedenceEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "phone_number": + return PHONE_NUMBER; + case "username": + return USERNAME; + default: + return new ConnectionIdentifierPrecedenceEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EMAIL, + + PHONE_NUMBER, + + USERNAME, + + UNKNOWN + } + + public interface Visitor { + T visitEmail(); + + T visitPhoneNumber(); + + T visitUsername(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java new file mode 100644 index 000000000..cefd9fdc0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java @@ -0,0 +1,726 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionIdentityProviderEnum { + public static final ConnectionIdentityProviderEnum SHOP = new ConnectionIdentityProviderEnum(Value.SHOP, "shop"); + + public static final ConnectionIdentityProviderEnum AUTH0OIDC = + new ConnectionIdentityProviderEnum(Value.AUTH0OIDC, "auth0-oidc"); + + public static final ConnectionIdentityProviderEnum DWOLLA = + new ConnectionIdentityProviderEnum(Value.DWOLLA, "dwolla"); + + public static final ConnectionIdentityProviderEnum FLICKR = + new ConnectionIdentityProviderEnum(Value.FLICKR, "flickr"); + + public static final ConnectionIdentityProviderEnum OKTA = new ConnectionIdentityProviderEnum(Value.OKTA, "okta"); + + public static final ConnectionIdentityProviderEnum PLANNINGCENTER = + new ConnectionIdentityProviderEnum(Value.PLANNINGCENTER, "planningcenter"); + + public static final ConnectionIdentityProviderEnum GOOGLE_OAUTH2 = + new ConnectionIdentityProviderEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); + + public static final ConnectionIdentityProviderEnum AUTH0 = new ConnectionIdentityProviderEnum(Value.AUTH0, "auth0"); + + public static final ConnectionIdentityProviderEnum EXACT = new ConnectionIdentityProviderEnum(Value.EXACT, "exact"); + + public static final ConnectionIdentityProviderEnum WORDPRESS = + new ConnectionIdentityProviderEnum(Value.WORDPRESS, "wordpress"); + + public static final ConnectionIdentityProviderEnum FITBIT = + new ConnectionIdentityProviderEnum(Value.FITBIT, "fitbit"); + + public static final ConnectionIdentityProviderEnum EVERNOTE = + new ConnectionIdentityProviderEnum(Value.EVERNOTE, "evernote"); + + public static final ConnectionIdentityProviderEnum SHAREPOINT = + new ConnectionIdentityProviderEnum(Value.SHAREPOINT, "sharepoint"); + + public static final ConnectionIdentityProviderEnum SHOPIFY = + new ConnectionIdentityProviderEnum(Value.SHOPIFY, "shopify"); + + public static final ConnectionIdentityProviderEnum SALESFORCE_SANDBOX = + new ConnectionIdentityProviderEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); + + public static final ConnectionIdentityProviderEnum MIICARD = + new ConnectionIdentityProviderEnum(Value.MIICARD, "miicard"); + + public static final ConnectionIdentityProviderEnum FACEBOOK = + new ConnectionIdentityProviderEnum(Value.FACEBOOK, "facebook"); + + public static final ConnectionIdentityProviderEnum OAUTH1 = + new ConnectionIdentityProviderEnum(Value.OAUTH1, "oauth1"); + + public static final ConnectionIdentityProviderEnum APPLE = new ConnectionIdentityProviderEnum(Value.APPLE, "apple"); + + public static final ConnectionIdentityProviderEnum UNTAPPD = + new ConnectionIdentityProviderEnum(Value.UNTAPPD, "untappd"); + + public static final ConnectionIdentityProviderEnum AMAZON = + new ConnectionIdentityProviderEnum(Value.AMAZON, "amazon"); + + public static final ConnectionIdentityProviderEnum LINE = new ConnectionIdentityProviderEnum(Value.LINE, "line"); + + public static final ConnectionIdentityProviderEnum BITBUCKET = + new ConnectionIdentityProviderEnum(Value.BITBUCKET, "bitbucket"); + + public static final ConnectionIdentityProviderEnum GITHUB = + new ConnectionIdentityProviderEnum(Value.GITHUB, "github"); + + public static final ConnectionIdentityProviderEnum SALESFORCE = + new ConnectionIdentityProviderEnum(Value.SALESFORCE, "salesforce"); + + public static final ConnectionIdentityProviderEnum OFFICE365 = + new ConnectionIdentityProviderEnum(Value.OFFICE365, "office365"); + + public static final ConnectionIdentityProviderEnum SMS = new ConnectionIdentityProviderEnum(Value.SMS, "sms"); + + public static final ConnectionIdentityProviderEnum AOL = new ConnectionIdentityProviderEnum(Value.AOL, "aol"); + + public static final ConnectionIdentityProviderEnum TWITTER = + new ConnectionIdentityProviderEnum(Value.TWITTER, "twitter"); + + public static final ConnectionIdentityProviderEnum WINDOWSLIVE = + new ConnectionIdentityProviderEnum(Value.WINDOWSLIVE, "windowslive"); + + public static final ConnectionIdentityProviderEnum YANDEX = + new ConnectionIdentityProviderEnum(Value.YANDEX, "yandex"); + + public static final ConnectionIdentityProviderEnum AD = new ConnectionIdentityProviderEnum(Value.AD, "ad"); + + public static final ConnectionIdentityProviderEnum BAIDU = new ConnectionIdentityProviderEnum(Value.BAIDU, "baidu"); + + public static final ConnectionIdentityProviderEnum BITLY = new ConnectionIdentityProviderEnum(Value.BITLY, "bitly"); + + public static final ConnectionIdentityProviderEnum PAYPAL_SANDBOX = + new ConnectionIdentityProviderEnum(Value.PAYPAL_SANDBOX, "paypal-sandbox"); + + public static final ConnectionIdentityProviderEnum RENREN = + new ConnectionIdentityProviderEnum(Value.RENREN, "renren"); + + public static final ConnectionIdentityProviderEnum SAMLP = new ConnectionIdentityProviderEnum(Value.SAMLP, "samlp"); + + public static final ConnectionIdentityProviderEnum DROPBOX = + new ConnectionIdentityProviderEnum(Value.DROPBOX, "dropbox"); + + public static final ConnectionIdentityProviderEnum VKONTAKTE = + new ConnectionIdentityProviderEnum(Value.VKONTAKTE, "vkontakte"); + + public static final ConnectionIdentityProviderEnum PINGFEDERATE = + new ConnectionIdentityProviderEnum(Value.PINGFEDERATE, "pingfederate"); + + public static final ConnectionIdentityProviderEnum INSTAGRAM = + new ConnectionIdentityProviderEnum(Value.INSTAGRAM, "instagram"); + + public static final ConnectionIdentityProviderEnum THIRTYSEVENSIGNALS = + new ConnectionIdentityProviderEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); + + public static final ConnectionIdentityProviderEnum WAAD = new ConnectionIdentityProviderEnum(Value.WAAD, "waad"); + + public static final ConnectionIdentityProviderEnum THECITY_SANDBOX = + new ConnectionIdentityProviderEnum(Value.THECITY_SANDBOX, "thecity-sandbox"); + + public static final ConnectionIdentityProviderEnum OIDC = new ConnectionIdentityProviderEnum(Value.OIDC, "oidc"); + + public static final ConnectionIdentityProviderEnum YAMMER = + new ConnectionIdentityProviderEnum(Value.YAMMER, "yammer"); + + public static final ConnectionIdentityProviderEnum EVERNOTE_SANDBOX = + new ConnectionIdentityProviderEnum(Value.EVERNOTE_SANDBOX, "evernote-sandbox"); + + public static final ConnectionIdentityProviderEnum SALESFORCE_COMMUNITY = + new ConnectionIdentityProviderEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); + + public static final ConnectionIdentityProviderEnum DACCOUNT = + new ConnectionIdentityProviderEnum(Value.DACCOUNT, "daccount"); + + public static final ConnectionIdentityProviderEnum SOUNDCLOUD = + new ConnectionIdentityProviderEnum(Value.SOUNDCLOUD, "soundcloud"); + + public static final ConnectionIdentityProviderEnum OAUTH2 = + new ConnectionIdentityProviderEnum(Value.OAUTH2, "oauth2"); + + public static final ConnectionIdentityProviderEnum BOX = new ConnectionIdentityProviderEnum(Value.BOX, "box"); + + public static final ConnectionIdentityProviderEnum IP = new ConnectionIdentityProviderEnum(Value.IP, "ip"); + + public static final ConnectionIdentityProviderEnum ADFS = new ConnectionIdentityProviderEnum(Value.ADFS, "adfs"); + + public static final ConnectionIdentityProviderEnum EMAIL = new ConnectionIdentityProviderEnum(Value.EMAIL, "email"); + + public static final ConnectionIdentityProviderEnum CUSTOM = + new ConnectionIdentityProviderEnum(Value.CUSTOM, "custom"); + + public static final ConnectionIdentityProviderEnum YAHOO = new ConnectionIdentityProviderEnum(Value.YAHOO, "yahoo"); + + public static final ConnectionIdentityProviderEnum WEIBO = new ConnectionIdentityProviderEnum(Value.WEIBO, "weibo"); + + public static final ConnectionIdentityProviderEnum GOOGLE_APPS = + new ConnectionIdentityProviderEnum(Value.GOOGLE_APPS, "google-apps"); + + public static final ConnectionIdentityProviderEnum PAYPAL = + new ConnectionIdentityProviderEnum(Value.PAYPAL, "paypal"); + + public static final ConnectionIdentityProviderEnum LINKEDIN = + new ConnectionIdentityProviderEnum(Value.LINKEDIN, "linkedin"); + + public static final ConnectionIdentityProviderEnum THECITY = + new ConnectionIdentityProviderEnum(Value.THECITY, "thecity"); + + private final Value value; + + private final String string; + + ConnectionIdentityProviderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionIdentityProviderEnum + && this.string.equals(((ConnectionIdentityProviderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHOP: + return visitor.visitShop(); + case AUTH0OIDC: + return visitor.visitAuth0Oidc(); + case DWOLLA: + return visitor.visitDwolla(); + case FLICKR: + return visitor.visitFlickr(); + case OKTA: + return visitor.visitOkta(); + case PLANNINGCENTER: + return visitor.visitPlanningcenter(); + case GOOGLE_OAUTH2: + return visitor.visitGoogleOauth2(); + case AUTH0: + return visitor.visitAuth0(); + case EXACT: + return visitor.visitExact(); + case WORDPRESS: + return visitor.visitWordpress(); + case FITBIT: + return visitor.visitFitbit(); + case EVERNOTE: + return visitor.visitEvernote(); + case SHAREPOINT: + return visitor.visitSharepoint(); + case SHOPIFY: + return visitor.visitShopify(); + case SALESFORCE_SANDBOX: + return visitor.visitSalesforceSandbox(); + case MIICARD: + return visitor.visitMiicard(); + case FACEBOOK: + return visitor.visitFacebook(); + case OAUTH1: + return visitor.visitOauth1(); + case APPLE: + return visitor.visitApple(); + case UNTAPPD: + return visitor.visitUntappd(); + case AMAZON: + return visitor.visitAmazon(); + case LINE: + return visitor.visitLine(); + case BITBUCKET: + return visitor.visitBitbucket(); + case GITHUB: + return visitor.visitGithub(); + case SALESFORCE: + return visitor.visitSalesforce(); + case OFFICE365: + return visitor.visitOffice365(); + case SMS: + return visitor.visitSms(); + case AOL: + return visitor.visitAol(); + case TWITTER: + return visitor.visitTwitter(); + case WINDOWSLIVE: + return visitor.visitWindowslive(); + case YANDEX: + return visitor.visitYandex(); + case AD: + return visitor.visitAd(); + case BAIDU: + return visitor.visitBaidu(); + case BITLY: + return visitor.visitBitly(); + case PAYPAL_SANDBOX: + return visitor.visitPaypalSandbox(); + case RENREN: + return visitor.visitRenren(); + case SAMLP: + return visitor.visitSamlp(); + case DROPBOX: + return visitor.visitDropbox(); + case VKONTAKTE: + return visitor.visitVkontakte(); + case PINGFEDERATE: + return visitor.visitPingfederate(); + case INSTAGRAM: + return visitor.visitInstagram(); + case THIRTYSEVENSIGNALS: + return visitor.visitThirtysevensignals(); + case WAAD: + return visitor.visitWaad(); + case THECITY_SANDBOX: + return visitor.visitThecitySandbox(); + case OIDC: + return visitor.visitOidc(); + case YAMMER: + return visitor.visitYammer(); + case EVERNOTE_SANDBOX: + return visitor.visitEvernoteSandbox(); + case SALESFORCE_COMMUNITY: + return visitor.visitSalesforceCommunity(); + case DACCOUNT: + return visitor.visitDaccount(); + case SOUNDCLOUD: + return visitor.visitSoundcloud(); + case OAUTH2: + return visitor.visitOauth2(); + case BOX: + return visitor.visitBox(); + case IP: + return visitor.visitIp(); + case ADFS: + return visitor.visitAdfs(); + case EMAIL: + return visitor.visitEmail(); + case CUSTOM: + return visitor.visitCustom(); + case YAHOO: + return visitor.visitYahoo(); + case WEIBO: + return visitor.visitWeibo(); + case GOOGLE_APPS: + return visitor.visitGoogleApps(); + case PAYPAL: + return visitor.visitPaypal(); + case LINKEDIN: + return visitor.visitLinkedin(); + case THECITY: + return visitor.visitThecity(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionIdentityProviderEnum valueOf(String value) { + switch (value) { + case "shop": + return SHOP; + case "auth0-oidc": + return AUTH0OIDC; + case "dwolla": + return DWOLLA; + case "flickr": + return FLICKR; + case "okta": + return OKTA; + case "planningcenter": + return PLANNINGCENTER; + case "google-oauth2": + return GOOGLE_OAUTH2; + case "auth0": + return AUTH0; + case "exact": + return EXACT; + case "wordpress": + return WORDPRESS; + case "fitbit": + return FITBIT; + case "evernote": + return EVERNOTE; + case "sharepoint": + return SHAREPOINT; + case "shopify": + return SHOPIFY; + case "salesforce-sandbox": + return SALESFORCE_SANDBOX; + case "miicard": + return MIICARD; + case "facebook": + return FACEBOOK; + case "oauth1": + return OAUTH1; + case "apple": + return APPLE; + case "untappd": + return UNTAPPD; + case "amazon": + return AMAZON; + case "line": + return LINE; + case "bitbucket": + return BITBUCKET; + case "github": + return GITHUB; + case "salesforce": + return SALESFORCE; + case "office365": + return OFFICE365; + case "sms": + return SMS; + case "aol": + return AOL; + case "twitter": + return TWITTER; + case "windowslive": + return WINDOWSLIVE; + case "yandex": + return YANDEX; + case "ad": + return AD; + case "baidu": + return BAIDU; + case "bitly": + return BITLY; + case "paypal-sandbox": + return PAYPAL_SANDBOX; + case "renren": + return RENREN; + case "samlp": + return SAMLP; + case "dropbox": + return DROPBOX; + case "vkontakte": + return VKONTAKTE; + case "pingfederate": + return PINGFEDERATE; + case "instagram": + return INSTAGRAM; + case "thirtysevensignals": + return THIRTYSEVENSIGNALS; + case "waad": + return WAAD; + case "thecity-sandbox": + return THECITY_SANDBOX; + case "oidc": + return OIDC; + case "yammer": + return YAMMER; + case "evernote-sandbox": + return EVERNOTE_SANDBOX; + case "salesforce-community": + return SALESFORCE_COMMUNITY; + case "daccount": + return DACCOUNT; + case "soundcloud": + return SOUNDCLOUD; + case "oauth2": + return OAUTH2; + case "box": + return BOX; + case "ip": + return IP; + case "adfs": + return ADFS; + case "email": + return EMAIL; + case "custom": + return CUSTOM; + case "yahoo": + return YAHOO; + case "weibo": + return WEIBO; + case "google-apps": + return GOOGLE_APPS; + case "paypal": + return PAYPAL; + case "linkedin": + return LINKEDIN; + case "thecity": + return THECITY; + default: + return new ConnectionIdentityProviderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AD, + + ADFS, + + AMAZON, + + APPLE, + + DROPBOX, + + BITBUCKET, + + AOL, + + AUTH0OIDC, + + AUTH0, + + BAIDU, + + BITLY, + + BOX, + + CUSTOM, + + DACCOUNT, + + DWOLLA, + + EMAIL, + + EVERNOTE_SANDBOX, + + EVERNOTE, + + EXACT, + + FACEBOOK, + + FITBIT, + + FLICKR, + + GITHUB, + + GOOGLE_APPS, + + GOOGLE_OAUTH2, + + INSTAGRAM, + + IP, + + LINE, + + LINKEDIN, + + MIICARD, + + OAUTH1, + + OAUTH2, + + OFFICE365, + + OIDC, + + OKTA, + + PAYPAL, + + PAYPAL_SANDBOX, + + PINGFEDERATE, + + PLANNINGCENTER, + + RENREN, + + SALESFORCE_COMMUNITY, + + SALESFORCE_SANDBOX, + + SALESFORCE, + + SAMLP, + + SHAREPOINT, + + SHOPIFY, + + SHOP, + + SMS, + + SOUNDCLOUD, + + THECITY_SANDBOX, + + THECITY, + + THIRTYSEVENSIGNALS, + + TWITTER, + + UNTAPPD, + + VKONTAKTE, + + WAAD, + + WEIBO, + + WINDOWSLIVE, + + WORDPRESS, + + YAHOO, + + YAMMER, + + YANDEX, + + UNKNOWN + } + + public interface Visitor { + T visitAd(); + + T visitAdfs(); + + T visitAmazon(); + + T visitApple(); + + T visitDropbox(); + + T visitBitbucket(); + + T visitAol(); + + T visitAuth0Oidc(); + + T visitAuth0(); + + T visitBaidu(); + + T visitBitly(); + + T visitBox(); + + T visitCustom(); + + T visitDaccount(); + + T visitDwolla(); + + T visitEmail(); + + T visitEvernoteSandbox(); + + T visitEvernote(); + + T visitExact(); + + T visitFacebook(); + + T visitFitbit(); + + T visitFlickr(); + + T visitGithub(); + + T visitGoogleApps(); + + T visitGoogleOauth2(); + + T visitInstagram(); + + T visitIp(); + + T visitLine(); + + T visitLinkedin(); + + T visitMiicard(); + + T visitOauth1(); + + T visitOauth2(); + + T visitOffice365(); + + T visitOidc(); + + T visitOkta(); + + T visitPaypal(); + + T visitPaypalSandbox(); + + T visitPingfederate(); + + T visitPlanningcenter(); + + T visitRenren(); + + T visitSalesforceCommunity(); + + T visitSalesforceSandbox(); + + T visitSalesforce(); + + T visitSamlp(); + + T visitSharepoint(); + + T visitShopify(); + + T visitShop(); + + T visitSms(); + + T visitSoundcloud(); + + T visitThecitySandbox(); + + T visitThecity(); + + T visitThirtysevensignals(); + + T visitTwitter(); + + T visitUntappd(); + + T visitVkontakte(); + + T visitWaad(); + + T visitWeibo(); + + T visitWindowslive(); + + T visitWordpress(); + + T visitYahoo(); + + T visitYammer(); + + T visitYandex(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java new file mode 100644 index 000000000..5a806f424 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java @@ -0,0 +1,565 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionKey.Builder.class) +public final class ConnectionKey { + private final String kid; + + private final String cert; + + private final Optional pkcs; + + private final Optional current; + + private final Optional next; + + private final Optional previous; + + private final Optional currentSince; + + private final String fingerprint; + + private final String thumbprint; + + private final Optional algorithm; + + private final Optional keyUse; + + private final Optional subjectDn; + + private final Map additionalProperties; + + private ConnectionKey( + String kid, + String cert, + Optional pkcs, + Optional current, + Optional next, + Optional previous, + Optional currentSince, + String fingerprint, + String thumbprint, + Optional algorithm, + Optional keyUse, + Optional subjectDn, + Map additionalProperties) { + this.kid = kid; + this.cert = cert; + this.pkcs = pkcs; + this.current = current; + this.next = next; + this.previous = previous; + this.currentSince = currentSince; + this.fingerprint = fingerprint; + this.thumbprint = thumbprint; + this.algorithm = algorithm; + this.keyUse = keyUse; + this.subjectDn = subjectDn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The key id of the signing key + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + /** + * @return The public certificate of the signing key + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return The public certificate of the signing key in pkcs7 format + */ + @JsonProperty("pkcs") + public Optional getPkcs() { + return pkcs; + } + + /** + * @return True if the key is the the current key + */ + @JsonProperty("current") + public Optional getCurrent() { + return current; + } + + /** + * @return True if the key is the the next key + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + /** + * @return True if the key is the the previous key + */ + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + /** + * @return The date and time when the key became the current key + */ + @JsonProperty("current_since") + public Optional getCurrentSince() { + return currentSince; + } + + /** + * @return The cert fingerprint + */ + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + /** + * @return The cert thumbprint + */ + @JsonProperty("thumbprint") + public String getThumbprint() { + return thumbprint; + } + + /** + * @return Signing key algorithm + */ + @JsonProperty("algorithm") + public Optional getAlgorithm() { + return algorithm; + } + + @JsonProperty("key_use") + public Optional getKeyUse() { + return keyUse; + } + + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionKey && equalTo((ConnectionKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionKey other) { + return kid.equals(other.kid) + && cert.equals(other.cert) + && pkcs.equals(other.pkcs) + && current.equals(other.current) + && next.equals(other.next) + && previous.equals(other.previous) + && currentSince.equals(other.currentSince) + && fingerprint.equals(other.fingerprint) + && thumbprint.equals(other.thumbprint) + && algorithm.equals(other.algorithm) + && keyUse.equals(other.keyUse) + && subjectDn.equals(other.subjectDn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, + this.cert, + this.pkcs, + this.current, + this.next, + this.previous, + this.currentSince, + this.fingerprint, + this.thumbprint, + this.algorithm, + this.keyUse, + this.subjectDn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

The key id of the signing key

+ */ + CertStage kid(@NotNull String kid); + + Builder from(ConnectionKey other); + } + + public interface CertStage { + /** + *

The public certificate of the signing key

+ */ + FingerprintStage cert(@NotNull String cert); + } + + public interface FingerprintStage { + /** + *

The cert fingerprint

+ */ + ThumbprintStage fingerprint(@NotNull String fingerprint); + } + + public interface ThumbprintStage { + /** + *

The cert thumbprint

+ */ + _FinalStage thumbprint(@NotNull String thumbprint); + } + + public interface _FinalStage { + ConnectionKey build(); + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + _FinalStage pkcs(Optional pkcs); + + _FinalStage pkcs(String pkcs); + + /** + *

True if the key is the the current key

+ */ + _FinalStage current(Optional current); + + _FinalStage current(Boolean current); + + /** + *

True if the key is the the next key

+ */ + _FinalStage next(Optional next); + + _FinalStage next(Boolean next); + + /** + *

True if the key is the the previous key

+ */ + _FinalStage previous(Optional previous); + + _FinalStage previous(Boolean previous); + + /** + *

The date and time when the key became the current key

+ */ + _FinalStage currentSince(Optional currentSince); + + _FinalStage currentSince(String currentSince); + + /** + *

Signing key algorithm

+ */ + _FinalStage algorithm(Optional algorithm); + + _FinalStage algorithm(String algorithm); + + _FinalStage keyUse(Optional keyUse); + + _FinalStage keyUse(ConnectionKeyUseEnum keyUse); + + _FinalStage subjectDn(Optional subjectDn); + + _FinalStage subjectDn(String subjectDn); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KidStage, CertStage, FingerprintStage, ThumbprintStage, _FinalStage { + private String kid; + + private String cert; + + private String fingerprint; + + private String thumbprint; + + private Optional subjectDn = Optional.empty(); + + private Optional keyUse = Optional.empty(); + + private Optional algorithm = Optional.empty(); + + private Optional currentSince = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional next = Optional.empty(); + + private Optional current = Optional.empty(); + + private Optional pkcs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionKey other) { + kid(other.getKid()); + cert(other.getCert()); + pkcs(other.getPkcs()); + current(other.getCurrent()); + next(other.getNext()); + previous(other.getPrevious()); + currentSince(other.getCurrentSince()); + fingerprint(other.getFingerprint()); + thumbprint(other.getThumbprint()); + algorithm(other.getAlgorithm()); + keyUse(other.getKeyUse()); + subjectDn(other.getSubjectDn()); + return this; + } + + /** + *

The key id of the signing key

+ *

The key id of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public CertStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + /** + *

The public certificate of the signing key

+ *

The public certificate of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public FingerprintStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

The cert fingerprint

+ *

The cert fingerprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("fingerprint") + public ThumbprintStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The cert thumbprint

+ *

The cert thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("thumbprint") + public _FinalStage thumbprint(@NotNull String thumbprint) { + this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public _FinalStage subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + @java.lang.Override + public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { + this.keyUse = Optional.ofNullable(keyUse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key_use", nulls = Nulls.SKIP) + public _FinalStage keyUse(Optional keyUse) { + this.keyUse = keyUse; + return this; + } + + /** + *

Signing key algorithm

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage algorithm(String algorithm) { + this.algorithm = Optional.ofNullable(algorithm); + return this; + } + + /** + *

Signing key algorithm

+ */ + @java.lang.Override + @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) + public _FinalStage algorithm(Optional algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + *

The date and time when the key became the current key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage currentSince(String currentSince) { + this.currentSince = Optional.ofNullable(currentSince); + return this; + } + + /** + *

The date and time when the key became the current key

+ */ + @java.lang.Override + @JsonSetter(value = "current_since", nulls = Nulls.SKIP) + public _FinalStage currentSince(Optional currentSince) { + this.currentSince = currentSince; + return this; + } + + /** + *

True if the key is the the previous key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage previous(Boolean previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + /** + *

True if the key is the the previous key

+ */ + @java.lang.Override + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public _FinalStage previous(Optional previous) { + this.previous = previous; + return this; + } + + /** + *

True if the key is the the next key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage next(Boolean next) { + this.next = Optional.ofNullable(next); + return this; + } + + /** + *

True if the key is the the next key

+ */ + @java.lang.Override + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public _FinalStage next(Optional next) { + this.next = next; + return this; + } + + /** + *

True if the key is the the current key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage current(Boolean current) { + this.current = Optional.ofNullable(current); + return this; + } + + /** + *

True if the key is the the current key

+ */ + @java.lang.Override + @JsonSetter(value = "current", nulls = Nulls.SKIP) + public _FinalStage current(Optional current) { + this.current = current; + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage pkcs(String pkcs) { + this.pkcs = Optional.ofNullable(pkcs); + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + @java.lang.Override + @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) + public _FinalStage pkcs(Optional pkcs) { + this.pkcs = pkcs; + return this; + } + + @java.lang.Override + public ConnectionKey build() { + return new ConnectionKey( + kid, + cert, + pkcs, + current, + next, + previous, + currentSince, + fingerprint, + thumbprint, + algorithm, + keyUse, + subjectDn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java new file mode 100644 index 000000000..25c229547 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionKeyUseEnum { + public static final ConnectionKeyUseEnum SIGNING = new ConnectionKeyUseEnum(Value.SIGNING, "signing"); + + public static final ConnectionKeyUseEnum ENCRYPTION = new ConnectionKeyUseEnum(Value.ENCRYPTION, "encryption"); + + private final Value value; + + private final String string; + + ConnectionKeyUseEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionKeyUseEnum && this.string.equals(((ConnectionKeyUseEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SIGNING: + return visitor.visitSigning(); + case ENCRYPTION: + return visitor.visitEncryption(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionKeyUseEnum valueOf(String value) { + switch (value) { + case "signing": + return SIGNING; + case "encryption": + return ENCRYPTION; + default: + return new ConnectionKeyUseEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ENCRYPTION, + + SIGNING, + + UNKNOWN + } + + public interface Visitor { + T visitEncryption(); + + T visitSigning(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java new file mode 100644 index 000000000..21fd81bb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasskeyAuthenticationMethod.Builder.class) +public final class ConnectionPasskeyAuthenticationMethod { + private final Optional enabled; + + private final Map additionalProperties; + + private ConnectionPasskeyAuthenticationMethod(Optional enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines whether passkeys are enabled + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasskeyAuthenticationMethod + && equalTo((ConnectionPasskeyAuthenticationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasskeyAuthenticationMethod other) { + return enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionPasskeyAuthenticationMethod other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Determines whether passkeys are enabled

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public ConnectionPasskeyAuthenticationMethod build() { + return new ConnectionPasskeyAuthenticationMethod(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java new file mode 100644 index 000000000..231afea06 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionPasskeyChallengeUiEnum { + public static final ConnectionPasskeyChallengeUiEnum AUTOFILL = + new ConnectionPasskeyChallengeUiEnum(Value.AUTOFILL, "autofill"); + + public static final ConnectionPasskeyChallengeUiEnum BOTH = + new ConnectionPasskeyChallengeUiEnum(Value.BOTH, "both"); + + public static final ConnectionPasskeyChallengeUiEnum BUTTON = + new ConnectionPasskeyChallengeUiEnum(Value.BUTTON, "button"); + + private final Value value; + + private final String string; + + ConnectionPasskeyChallengeUiEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionPasskeyChallengeUiEnum + && this.string.equals(((ConnectionPasskeyChallengeUiEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTOFILL: + return visitor.visitAutofill(); + case BOTH: + return visitor.visitBoth(); + case BUTTON: + return visitor.visitButton(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionPasskeyChallengeUiEnum valueOf(String value) { + switch (value) { + case "autofill": + return AUTOFILL; + case "both": + return BOTH; + case "button": + return BUTTON; + default: + return new ConnectionPasskeyChallengeUiEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BOTH, + + AUTOFILL, + + BUTTON, + + UNKNOWN + } + + public interface Visitor { + T visitBoth(); + + T visitAutofill(); + + T visitButton(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java new file mode 100644 index 000000000..11308fbe0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasskeyOptions.Builder.class) +public final class ConnectionPasskeyOptions { + private final Optional challengeUi; + + private final Optional progressiveEnrollmentEnabled; + + private final Optional localEnrollmentEnabled; + + private final Map additionalProperties; + + private ConnectionPasskeyOptions( + Optional challengeUi, + Optional progressiveEnrollmentEnabled, + Optional localEnrollmentEnabled, + Map additionalProperties) { + this.challengeUi = challengeUi; + this.progressiveEnrollmentEnabled = progressiveEnrollmentEnabled; + this.localEnrollmentEnabled = localEnrollmentEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("challenge_ui") + public Optional getChallengeUi() { + return challengeUi; + } + + /** + * @return Enables or disables progressive enrollment of passkeys for the connection. + */ + @JsonProperty("progressive_enrollment_enabled") + public Optional getProgressiveEnrollmentEnabled() { + return progressiveEnrollmentEnabled; + } + + /** + * @return Enables or disables enrollment prompt for local passkey when user authenticates using a cross-device passkey for the connection. + */ + @JsonProperty("local_enrollment_enabled") + public Optional getLocalEnrollmentEnabled() { + return localEnrollmentEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasskeyOptions && equalTo((ConnectionPasskeyOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasskeyOptions other) { + return challengeUi.equals(other.challengeUi) + && progressiveEnrollmentEnabled.equals(other.progressiveEnrollmentEnabled) + && localEnrollmentEnabled.equals(other.localEnrollmentEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.challengeUi, this.progressiveEnrollmentEnabled, this.localEnrollmentEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional challengeUi = Optional.empty(); + + private Optional progressiveEnrollmentEnabled = Optional.empty(); + + private Optional localEnrollmentEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionPasskeyOptions other) { + challengeUi(other.getChallengeUi()); + progressiveEnrollmentEnabled(other.getProgressiveEnrollmentEnabled()); + localEnrollmentEnabled(other.getLocalEnrollmentEnabled()); + return this; + } + + @JsonSetter(value = "challenge_ui", nulls = Nulls.SKIP) + public Builder challengeUi(Optional challengeUi) { + this.challengeUi = challengeUi; + return this; + } + + public Builder challengeUi(ConnectionPasskeyChallengeUiEnum challengeUi) { + this.challengeUi = Optional.ofNullable(challengeUi); + return this; + } + + /** + *

Enables or disables progressive enrollment of passkeys for the connection.

+ */ + @JsonSetter(value = "progressive_enrollment_enabled", nulls = Nulls.SKIP) + public Builder progressiveEnrollmentEnabled(Optional progressiveEnrollmentEnabled) { + this.progressiveEnrollmentEnabled = progressiveEnrollmentEnabled; + return this; + } + + public Builder progressiveEnrollmentEnabled(Boolean progressiveEnrollmentEnabled) { + this.progressiveEnrollmentEnabled = Optional.ofNullable(progressiveEnrollmentEnabled); + return this; + } + + /** + *

Enables or disables enrollment prompt for local passkey when user authenticates using a cross-device passkey for the connection.

+ */ + @JsonSetter(value = "local_enrollment_enabled", nulls = Nulls.SKIP) + public Builder localEnrollmentEnabled(Optional localEnrollmentEnabled) { + this.localEnrollmentEnabled = localEnrollmentEnabled; + return this; + } + + public Builder localEnrollmentEnabled(Boolean localEnrollmentEnabled) { + this.localEnrollmentEnabled = Optional.ofNullable(localEnrollmentEnabled); + return this; + } + + public ConnectionPasskeyOptions build() { + return new ConnectionPasskeyOptions( + challengeUi, progressiveEnrollmentEnabled, localEnrollmentEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java new file mode 100644 index 000000000..086e23295 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasswordAuthenticationMethod.Builder.class) +public final class ConnectionPasswordAuthenticationMethod { + private final Optional enabled; + + private final Map additionalProperties; + + private ConnectionPasswordAuthenticationMethod( + Optional enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines whether passwords are enabled + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasswordAuthenticationMethod + && equalTo((ConnectionPasswordAuthenticationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasswordAuthenticationMethod other) { + return enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionPasswordAuthenticationMethod other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Determines whether passwords are enabled

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public ConnectionPasswordAuthenticationMethod build() { + return new ConnectionPasswordAuthenticationMethod(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java new file mode 100644 index 000000000..f2734810c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasswordComplexityOptions.Builder.class) +public final class ConnectionPasswordComplexityOptions { + private final Optional minLength; + + private final Map additionalProperties; + + private ConnectionPasswordComplexityOptions(Optional minLength, Map additionalProperties) { + this.minLength = minLength; + this.additionalProperties = additionalProperties; + } + + /** + * @return Minimum password length + */ + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasswordComplexityOptions + && equalTo((ConnectionPasswordComplexityOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasswordComplexityOptions other) { + return minLength.equals(other.minLength); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.minLength); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional minLength = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionPasswordComplexityOptions other) { + minLength(other.getMinLength()); + return this; + } + + /** + *

Minimum password length

+ */ + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public Builder minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + public Builder minLength(Integer minLength) { + this.minLength = Optional.ofNullable(minLength); + return this; + } + + public ConnectionPasswordComplexityOptions build() { + return new ConnectionPasswordComplexityOptions(minLength, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java new file mode 100644 index 000000000..1abe74805 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasswordDictionaryOptions.Builder.class) +public final class ConnectionPasswordDictionaryOptions { + private final boolean enable; + + private final Optional> dictionary; + + private final Map additionalProperties; + + private ConnectionPasswordDictionaryOptions( + boolean enable, Optional> dictionary, Map additionalProperties) { + this.enable = enable; + this.dictionary = dictionary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enable") + public boolean getEnable() { + return enable; + } + + /** + * @return Custom Password Dictionary. An array of up to 200 entries. + */ + @JsonProperty("dictionary") + public Optional> getDictionary() { + return dictionary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasswordDictionaryOptions + && equalTo((ConnectionPasswordDictionaryOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasswordDictionaryOptions other) { + return enable == other.enable && dictionary.equals(other.dictionary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enable, this.dictionary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnableStage builder() { + return new Builder(); + } + + public interface EnableStage { + _FinalStage enable(boolean enable); + + Builder from(ConnectionPasswordDictionaryOptions other); + } + + public interface _FinalStage { + ConnectionPasswordDictionaryOptions build(); + + /** + *

Custom Password Dictionary. An array of up to 200 entries.

+ */ + _FinalStage dictionary(Optional> dictionary); + + _FinalStage dictionary(List dictionary); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnableStage, _FinalStage { + private boolean enable; + + private Optional> dictionary = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionPasswordDictionaryOptions other) { + enable(other.getEnable()); + dictionary(other.getDictionary()); + return this; + } + + @java.lang.Override + @JsonSetter("enable") + public _FinalStage enable(boolean enable) { + this.enable = enable; + return this; + } + + /** + *

Custom Password Dictionary. An array of up to 200 entries.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage dictionary(List dictionary) { + this.dictionary = Optional.ofNullable(dictionary); + return this; + } + + /** + *

Custom Password Dictionary. An array of up to 200 entries.

+ */ + @java.lang.Override + @JsonSetter(value = "dictionary", nulls = Nulls.SKIP) + public _FinalStage dictionary(Optional> dictionary) { + this.dictionary = dictionary; + return this; + } + + @java.lang.Override + public ConnectionPasswordDictionaryOptions build() { + return new ConnectionPasswordDictionaryOptions(enable, dictionary, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java new file mode 100644 index 000000000..a5ea8bb03 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasswordHistoryOptions.Builder.class) +public final class ConnectionPasswordHistoryOptions { + private final boolean enable; + + private final Optional size; + + private final Map additionalProperties; + + private ConnectionPasswordHistoryOptions( + boolean enable, Optional size, Map additionalProperties) { + this.enable = enable; + this.size = size; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enable") + public boolean getEnable() { + return enable; + } + + @JsonProperty("size") + public Optional getSize() { + return size; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasswordHistoryOptions && equalTo((ConnectionPasswordHistoryOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasswordHistoryOptions other) { + return enable == other.enable && size.equals(other.size); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enable, this.size); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnableStage builder() { + return new Builder(); + } + + public interface EnableStage { + _FinalStage enable(boolean enable); + + Builder from(ConnectionPasswordHistoryOptions other); + } + + public interface _FinalStage { + ConnectionPasswordHistoryOptions build(); + + _FinalStage size(Optional size); + + _FinalStage size(Integer size); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnableStage, _FinalStage { + private boolean enable; + + private Optional size = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionPasswordHistoryOptions other) { + enable(other.getEnable()); + size(other.getSize()); + return this; + } + + @java.lang.Override + @JsonSetter("enable") + public _FinalStage enable(boolean enable) { + this.enable = enable; + return this; + } + + @java.lang.Override + public _FinalStage size(Integer size) { + this.size = Optional.ofNullable(size); + return this; + } + + @java.lang.Override + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public _FinalStage size(Optional size) { + this.size = size; + return this; + } + + @java.lang.Override + public ConnectionPasswordHistoryOptions build() { + return new ConnectionPasswordHistoryOptions(enable, size, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java new file mode 100644 index 000000000..ea52d475b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPasswordNoPersonalInfoOptions.Builder.class) +public final class ConnectionPasswordNoPersonalInfoOptions { + private final boolean enable; + + private final Map additionalProperties; + + private ConnectionPasswordNoPersonalInfoOptions(boolean enable, Map additionalProperties) { + this.enable = enable; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enable") + public boolean getEnable() { + return enable; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPasswordNoPersonalInfoOptions + && equalTo((ConnectionPasswordNoPersonalInfoOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPasswordNoPersonalInfoOptions other) { + return enable == other.enable; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enable); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnableStage builder() { + return new Builder(); + } + + public interface EnableStage { + _FinalStage enable(boolean enable); + + Builder from(ConnectionPasswordNoPersonalInfoOptions other); + } + + public interface _FinalStage { + ConnectionPasswordNoPersonalInfoOptions build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnableStage, _FinalStage { + private boolean enable; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionPasswordNoPersonalInfoOptions other) { + enable(other.getEnable()); + return this; + } + + @java.lang.Override + @JsonSetter("enable") + public _FinalStage enable(boolean enable) { + this.enable = enable; + return this; + } + + @java.lang.Override + public ConnectionPasswordNoPersonalInfoOptions build() { + return new ConnectionPasswordNoPersonalInfoOptions(enable, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java new file mode 100644 index 000000000..c9d9a7fbf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionPasswordPolicyEnum { + public static final ConnectionPasswordPolicyEnum FAIR = new ConnectionPasswordPolicyEnum(Value.FAIR, "fair"); + + public static final ConnectionPasswordPolicyEnum LOW = new ConnectionPasswordPolicyEnum(Value.LOW, "low"); + + public static final ConnectionPasswordPolicyEnum EXCELLENT = + new ConnectionPasswordPolicyEnum(Value.EXCELLENT, "excellent"); + + public static final ConnectionPasswordPolicyEnum GOOD = new ConnectionPasswordPolicyEnum(Value.GOOD, "good"); + + public static final ConnectionPasswordPolicyEnum NONE = new ConnectionPasswordPolicyEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + ConnectionPasswordPolicyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionPasswordPolicyEnum + && this.string.equals(((ConnectionPasswordPolicyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAIR: + return visitor.visitFair(); + case LOW: + return visitor.visitLow(); + case EXCELLENT: + return visitor.visitExcellent(); + case GOOD: + return visitor.visitGood(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionPasswordPolicyEnum valueOf(String value) { + switch (value) { + case "fair": + return FAIR; + case "low": + return LOW; + case "excellent": + return EXCELLENT; + case "good": + return GOOD; + case "none": + return NONE; + default: + return new ConnectionPasswordPolicyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + LOW, + + FAIR, + + GOOD, + + EXCELLENT, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitLow(); + + T visitFair(); + + T visitGood(); + + T visitExcellent(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java new file mode 100644 index 000000000..d8c113473 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java @@ -0,0 +1,1120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionPropertiesOptions.Builder.class) +public final class ConnectionPropertiesOptions { + private final OptionalNullable validation; + + private final Optional> nonPersistentAttrs; + + private final Optional> precedence; + + private final Optional attributes; + + private final Optional enableScriptContext; + + private final Optional enabledDatabaseCustomization; + + private final Optional importMode; + + private final Optional customScripts; + + private final OptionalNullable authenticationMethods; + + private final OptionalNullable passkeyOptions; + + private final OptionalNullable passwordPolicy; + + private final OptionalNullable passwordComplexityOptions; + + private final OptionalNullable passwordHistory; + + private final OptionalNullable passwordNoPersonalInfo; + + private final OptionalNullable passwordDictionary; + + private final Optional apiEnableUsers; + + private final Optional basicProfile; + + private final Optional extAdmin; + + private final Optional extIsSuspended; + + private final Optional extAgreedTerms; + + private final Optional extGroups; + + private final Optional extAssignedPlans; + + private final Optional extProfile; + + private final Optional disableSelfServiceChangePassword; + + private final OptionalNullable> upstreamParams; + + private final Optional setUserRootAttributes; + + private final OptionalNullable gatewayAuthentication; + + private final Map additionalProperties; + + private ConnectionPropertiesOptions( + OptionalNullable validation, + Optional> nonPersistentAttrs, + Optional> precedence, + Optional attributes, + Optional enableScriptContext, + Optional enabledDatabaseCustomization, + Optional importMode, + Optional customScripts, + OptionalNullable authenticationMethods, + OptionalNullable passkeyOptions, + OptionalNullable passwordPolicy, + OptionalNullable passwordComplexityOptions, + OptionalNullable passwordHistory, + OptionalNullable passwordNoPersonalInfo, + OptionalNullable passwordDictionary, + Optional apiEnableUsers, + Optional basicProfile, + Optional extAdmin, + Optional extIsSuspended, + Optional extAgreedTerms, + Optional extGroups, + Optional extAssignedPlans, + Optional extProfile, + Optional disableSelfServiceChangePassword, + OptionalNullable> upstreamParams, + Optional setUserRootAttributes, + OptionalNullable gatewayAuthentication, + Map additionalProperties) { + this.validation = validation; + this.nonPersistentAttrs = nonPersistentAttrs; + this.precedence = precedence; + this.attributes = attributes; + this.enableScriptContext = enableScriptContext; + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + this.importMode = importMode; + this.customScripts = customScripts; + this.authenticationMethods = authenticationMethods; + this.passkeyOptions = passkeyOptions; + this.passwordPolicy = passwordPolicy; + this.passwordComplexityOptions = passwordComplexityOptions; + this.passwordHistory = passwordHistory; + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + this.passwordDictionary = passwordDictionary; + this.apiEnableUsers = apiEnableUsers; + this.basicProfile = basicProfile; + this.extAdmin = extAdmin; + this.extIsSuspended = extIsSuspended; + this.extAgreedTerms = extAgreedTerms; + this.extGroups = extGroups; + this.extAssignedPlans = extAssignedPlans; + this.extProfile = extProfile; + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + this.upstreamParams = upstreamParams; + this.setUserRootAttributes = setUserRootAttributes; + this.gatewayAuthentication = gatewayAuthentication; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + public OptionalNullable getValidation() { + if (validation == null) { + return OptionalNullable.absent(); + } + return validation; + } + + /** + * @return An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist) + */ + @JsonProperty("non_persistent_attrs") + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + /** + * @return Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used. + */ + @JsonProperty("precedence") + public Optional> getPrecedence() { + return precedence; + } + + @JsonProperty("attributes") + public Optional getAttributes() { + return attributes; + } + + @JsonProperty("enable_script_context") + public Optional getEnableScriptContext() { + return enableScriptContext; + } + + /** + * @return Set to true to use a legacy user store + */ + @JsonProperty("enabledDatabaseCustomization") + public Optional getEnabledDatabaseCustomization() { + return enabledDatabaseCustomization; + } + + /** + * @return Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store + */ + @JsonProperty("import_mode") + public Optional getImportMode() { + return importMode; + } + + @JsonProperty("customScripts") + public Optional getCustomScripts() { + return customScripts; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + public OptionalNullable getAuthenticationMethods() { + if (authenticationMethods == null) { + return OptionalNullable.absent(); + } + return authenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + public OptionalNullable getPasskeyOptions() { + if (passkeyOptions == null) { + return OptionalNullable.absent(); + } + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + public OptionalNullable getPasswordPolicy() { + if (passwordPolicy == null) { + return OptionalNullable.absent(); + } + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + public OptionalNullable getPasswordComplexityOptions() { + if (passwordComplexityOptions == null) { + return OptionalNullable.absent(); + } + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + public OptionalNullable getPasswordHistory() { + if (passwordHistory == null) { + return OptionalNullable.absent(); + } + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + public OptionalNullable getPasswordNoPersonalInfo() { + if (passwordNoPersonalInfo == null) { + return OptionalNullable.absent(); + } + return passwordNoPersonalInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + public OptionalNullable getPasswordDictionary() { + if (passwordDictionary == null) { + return OptionalNullable.absent(); + } + return passwordDictionary; + } + + @JsonProperty("api_enable_users") + public Optional getApiEnableUsers() { + return apiEnableUsers; + } + + @JsonProperty("basic_profile") + public Optional getBasicProfile() { + return basicProfile; + } + + @JsonProperty("ext_admin") + public Optional getExtAdmin() { + return extAdmin; + } + + @JsonProperty("ext_is_suspended") + public Optional getExtIsSuspended() { + return extIsSuspended; + } + + @JsonProperty("ext_agreed_terms") + public Optional getExtAgreedTerms() { + return extAgreedTerms; + } + + @JsonProperty("ext_groups") + public Optional getExtGroups() { + return extGroups; + } + + @JsonProperty("ext_assigned_plans") + public Optional getExtAssignedPlans() { + return extAssignedPlans; + } + + @JsonProperty("ext_profile") + public Optional getExtProfile() { + return extProfile; + } + + @JsonProperty("disable_self_service_change_password") + public Optional getDisableSelfServiceChangePassword() { + return disableSelfServiceChangePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gateway_authentication") + public OptionalNullable getGatewayAuthentication() { + if (gatewayAuthentication == null) { + return OptionalNullable.absent(); + } + return gatewayAuthentication; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + private OptionalNullable _getValidation() { + return validation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + private OptionalNullable _getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + private OptionalNullable _getPasskeyOptions() { + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + private OptionalNullable _getPasswordPolicy() { + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + private OptionalNullable _getPasswordComplexityOptions() { + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + private OptionalNullable _getPasswordHistory() { + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + private OptionalNullable _getPasswordNoPersonalInfo() { + return passwordNoPersonalInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + private OptionalNullable _getPasswordDictionary() { + return passwordDictionary; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable> _getUpstreamParams() { + return upstreamParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gateway_authentication") + private OptionalNullable _getGatewayAuthentication() { + return gatewayAuthentication; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionPropertiesOptions && equalTo((ConnectionPropertiesOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionPropertiesOptions other) { + return validation.equals(other.validation) + && nonPersistentAttrs.equals(other.nonPersistentAttrs) + && precedence.equals(other.precedence) + && attributes.equals(other.attributes) + && enableScriptContext.equals(other.enableScriptContext) + && enabledDatabaseCustomization.equals(other.enabledDatabaseCustomization) + && importMode.equals(other.importMode) + && customScripts.equals(other.customScripts) + && authenticationMethods.equals(other.authenticationMethods) + && passkeyOptions.equals(other.passkeyOptions) + && passwordPolicy.equals(other.passwordPolicy) + && passwordComplexityOptions.equals(other.passwordComplexityOptions) + && passwordHistory.equals(other.passwordHistory) + && passwordNoPersonalInfo.equals(other.passwordNoPersonalInfo) + && passwordDictionary.equals(other.passwordDictionary) + && apiEnableUsers.equals(other.apiEnableUsers) + && basicProfile.equals(other.basicProfile) + && extAdmin.equals(other.extAdmin) + && extIsSuspended.equals(other.extIsSuspended) + && extAgreedTerms.equals(other.extAgreedTerms) + && extGroups.equals(other.extGroups) + && extAssignedPlans.equals(other.extAssignedPlans) + && extProfile.equals(other.extProfile) + && disableSelfServiceChangePassword.equals(other.disableSelfServiceChangePassword) + && upstreamParams.equals(other.upstreamParams) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && gatewayAuthentication.equals(other.gatewayAuthentication); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.validation, + this.nonPersistentAttrs, + this.precedence, + this.attributes, + this.enableScriptContext, + this.enabledDatabaseCustomization, + this.importMode, + this.customScripts, + this.authenticationMethods, + this.passkeyOptions, + this.passwordPolicy, + this.passwordComplexityOptions, + this.passwordHistory, + this.passwordNoPersonalInfo, + this.passwordDictionary, + this.apiEnableUsers, + this.basicProfile, + this.extAdmin, + this.extIsSuspended, + this.extAgreedTerms, + this.extGroups, + this.extAssignedPlans, + this.extProfile, + this.disableSelfServiceChangePassword, + this.upstreamParams, + this.setUserRootAttributes, + this.gatewayAuthentication); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable validation = OptionalNullable.absent(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional> precedence = Optional.empty(); + + private Optional attributes = Optional.empty(); + + private Optional enableScriptContext = Optional.empty(); + + private Optional enabledDatabaseCustomization = Optional.empty(); + + private Optional importMode = Optional.empty(); + + private Optional customScripts = Optional.empty(); + + private OptionalNullable authenticationMethods = OptionalNullable.absent(); + + private OptionalNullable passkeyOptions = OptionalNullable.absent(); + + private OptionalNullable passwordPolicy = OptionalNullable.absent(); + + private OptionalNullable passwordComplexityOptions = + OptionalNullable.absent(); + + private OptionalNullable passwordHistory = OptionalNullable.absent(); + + private OptionalNullable passwordNoPersonalInfo = + OptionalNullable.absent(); + + private OptionalNullable passwordDictionary = OptionalNullable.absent(); + + private Optional apiEnableUsers = Optional.empty(); + + private Optional basicProfile = Optional.empty(); + + private Optional extAdmin = Optional.empty(); + + private Optional extIsSuspended = Optional.empty(); + + private Optional extAgreedTerms = Optional.empty(); + + private Optional extGroups = Optional.empty(); + + private Optional extAssignedPlans = Optional.empty(); + + private Optional extProfile = Optional.empty(); + + private Optional disableSelfServiceChangePassword = Optional.empty(); + + private OptionalNullable> upstreamParams = OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + private OptionalNullable gatewayAuthentication = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionPropertiesOptions other) { + validation(other.getValidation()); + nonPersistentAttrs(other.getNonPersistentAttrs()); + precedence(other.getPrecedence()); + attributes(other.getAttributes()); + enableScriptContext(other.getEnableScriptContext()); + enabledDatabaseCustomization(other.getEnabledDatabaseCustomization()); + importMode(other.getImportMode()); + customScripts(other.getCustomScripts()); + authenticationMethods(other.getAuthenticationMethods()); + passkeyOptions(other.getPasskeyOptions()); + passwordPolicy(other.getPasswordPolicy()); + passwordComplexityOptions(other.getPasswordComplexityOptions()); + passwordHistory(other.getPasswordHistory()); + passwordNoPersonalInfo(other.getPasswordNoPersonalInfo()); + passwordDictionary(other.getPasswordDictionary()); + apiEnableUsers(other.getApiEnableUsers()); + basicProfile(other.getBasicProfile()); + extAdmin(other.getExtAdmin()); + extIsSuspended(other.getExtIsSuspended()); + extAgreedTerms(other.getExtAgreedTerms()); + extGroups(other.getExtGroups()); + extAssignedPlans(other.getExtAssignedPlans()); + extProfile(other.getExtProfile()); + disableSelfServiceChangePassword(other.getDisableSelfServiceChangePassword()); + upstreamParams(other.getUpstreamParams()); + setUserRootAttributes(other.getSetUserRootAttributes()); + gatewayAuthentication(other.getGatewayAuthentication()); + return this; + } + + @JsonSetter(value = "validation", nulls = Nulls.SKIP) + public Builder validation(@Nullable OptionalNullable validation) { + this.validation = validation; + return this; + } + + public Builder validation(ConnectionValidationOptions validation) { + this.validation = OptionalNullable.of(validation); + return this; + } + + public Builder validation(Optional validation) { + if (validation.isPresent()) { + this.validation = OptionalNullable.of(validation.get()); + } else { + this.validation = OptionalNullable.absent(); + } + return this; + } + + public Builder validation(com.auth0.client.mgmt.core.Nullable validation) { + if (validation.isNull()) { + this.validation = OptionalNullable.ofNull(); + } else if (validation.isEmpty()) { + this.validation = OptionalNullable.absent(); + } else { + this.validation = OptionalNullable.of(validation.get()); + } + return this; + } + + /** + *

An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist)

+ */ + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + /** + *

Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used.

+ */ + @JsonSetter(value = "precedence", nulls = Nulls.SKIP) + public Builder precedence(Optional> precedence) { + this.precedence = precedence; + return this; + } + + public Builder precedence(List precedence) { + this.precedence = Optional.ofNullable(precedence); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(ConnectionAttributes attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + @JsonSetter(value = "enable_script_context", nulls = Nulls.SKIP) + public Builder enableScriptContext(Optional enableScriptContext) { + this.enableScriptContext = enableScriptContext; + return this; + } + + public Builder enableScriptContext(Boolean enableScriptContext) { + this.enableScriptContext = Optional.ofNullable(enableScriptContext); + return this; + } + + /** + *

Set to true to use a legacy user store

+ */ + @JsonSetter(value = "enabledDatabaseCustomization", nulls = Nulls.SKIP) + public Builder enabledDatabaseCustomization(Optional enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + return this; + } + + public Builder enabledDatabaseCustomization(Boolean enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = Optional.ofNullable(enabledDatabaseCustomization); + return this; + } + + /** + *

Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store

+ */ + @JsonSetter(value = "import_mode", nulls = Nulls.SKIP) + public Builder importMode(Optional importMode) { + this.importMode = importMode; + return this; + } + + public Builder importMode(Boolean importMode) { + this.importMode = Optional.ofNullable(importMode); + return this; + } + + @JsonSetter(value = "customScripts", nulls = Nulls.SKIP) + public Builder customScripts(Optional customScripts) { + this.customScripts = customScripts; + return this; + } + + public Builder customScripts(ConnectionCustomScripts customScripts) { + this.customScripts = Optional.ofNullable(customScripts); + return this; + } + + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public Builder authenticationMethods( + @Nullable OptionalNullable authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + public Builder authenticationMethods(ConnectionAuthenticationMethods authenticationMethods) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods); + return this; + } + + public Builder authenticationMethods(Optional authenticationMethods) { + if (authenticationMethods.isPresent()) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } else { + this.authenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder authenticationMethods( + com.auth0.client.mgmt.core.Nullable authenticationMethods) { + if (authenticationMethods.isNull()) { + this.authenticationMethods = OptionalNullable.ofNull(); + } else if (authenticationMethods.isEmpty()) { + this.authenticationMethods = OptionalNullable.absent(); + } else { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } + return this; + } + + @JsonSetter(value = "passkey_options", nulls = Nulls.SKIP) + public Builder passkeyOptions(@Nullable OptionalNullable passkeyOptions) { + this.passkeyOptions = passkeyOptions; + return this; + } + + public Builder passkeyOptions(ConnectionPasskeyOptions passkeyOptions) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions); + return this; + } + + public Builder passkeyOptions(Optional passkeyOptions) { + if (passkeyOptions.isPresent()) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } else { + this.passkeyOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passkeyOptions(com.auth0.client.mgmt.core.Nullable passkeyOptions) { + if (passkeyOptions.isNull()) { + this.passkeyOptions = OptionalNullable.ofNull(); + } else if (passkeyOptions.isEmpty()) { + this.passkeyOptions = OptionalNullable.absent(); + } else { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } + return this; + } + + @JsonSetter(value = "passwordPolicy", nulls = Nulls.SKIP) + public Builder passwordPolicy(@Nullable OptionalNullable passwordPolicy) { + this.passwordPolicy = passwordPolicy; + return this; + } + + public Builder passwordPolicy(ConnectionPasswordPolicyEnum passwordPolicy) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy); + return this; + } + + public Builder passwordPolicy(Optional passwordPolicy) { + if (passwordPolicy.isPresent()) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } else { + this.passwordPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordPolicy( + com.auth0.client.mgmt.core.Nullable passwordPolicy) { + if (passwordPolicy.isNull()) { + this.passwordPolicy = OptionalNullable.ofNull(); + } else if (passwordPolicy.isEmpty()) { + this.passwordPolicy = OptionalNullable.absent(); + } else { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } + return this; + } + + @JsonSetter(value = "password_complexity_options", nulls = Nulls.SKIP) + public Builder passwordComplexityOptions( + @Nullable OptionalNullable passwordComplexityOptions) { + this.passwordComplexityOptions = passwordComplexityOptions; + return this; + } + + public Builder passwordComplexityOptions(ConnectionPasswordComplexityOptions passwordComplexityOptions) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions); + return this; + } + + public Builder passwordComplexityOptions( + Optional passwordComplexityOptions) { + if (passwordComplexityOptions.isPresent()) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } else { + this.passwordComplexityOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordComplexityOptions( + com.auth0.client.mgmt.core.Nullable passwordComplexityOptions) { + if (passwordComplexityOptions.isNull()) { + this.passwordComplexityOptions = OptionalNullable.ofNull(); + } else if (passwordComplexityOptions.isEmpty()) { + this.passwordComplexityOptions = OptionalNullable.absent(); + } else { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } + return this; + } + + @JsonSetter(value = "password_history", nulls = Nulls.SKIP) + public Builder passwordHistory(@Nullable OptionalNullable passwordHistory) { + this.passwordHistory = passwordHistory; + return this; + } + + public Builder passwordHistory(ConnectionPasswordHistoryOptions passwordHistory) { + this.passwordHistory = OptionalNullable.of(passwordHistory); + return this; + } + + public Builder passwordHistory(Optional passwordHistory) { + if (passwordHistory.isPresent()) { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } else { + this.passwordHistory = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordHistory( + com.auth0.client.mgmt.core.Nullable passwordHistory) { + if (passwordHistory.isNull()) { + this.passwordHistory = OptionalNullable.ofNull(); + } else if (passwordHistory.isEmpty()) { + this.passwordHistory = OptionalNullable.absent(); + } else { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } + return this; + } + + @JsonSetter(value = "password_no_personal_info", nulls = Nulls.SKIP) + public Builder passwordNoPersonalInfo( + @Nullable OptionalNullable passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + return this; + } + + public Builder passwordNoPersonalInfo(ConnectionPasswordNoPersonalInfoOptions passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo); + return this; + } + + public Builder passwordNoPersonalInfo( + Optional passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isPresent()) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } else { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordNoPersonalInfo( + com.auth0.client.mgmt.core.Nullable passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isNull()) { + this.passwordNoPersonalInfo = OptionalNullable.ofNull(); + } else if (passwordNoPersonalInfo.isEmpty()) { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } else { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } + return this; + } + + @JsonSetter(value = "password_dictionary", nulls = Nulls.SKIP) + public Builder passwordDictionary( + @Nullable OptionalNullable passwordDictionary) { + this.passwordDictionary = passwordDictionary; + return this; + } + + public Builder passwordDictionary(ConnectionPasswordDictionaryOptions passwordDictionary) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary); + return this; + } + + public Builder passwordDictionary(Optional passwordDictionary) { + if (passwordDictionary.isPresent()) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } else { + this.passwordDictionary = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordDictionary( + com.auth0.client.mgmt.core.Nullable passwordDictionary) { + if (passwordDictionary.isNull()) { + this.passwordDictionary = OptionalNullable.ofNull(); + } else if (passwordDictionary.isEmpty()) { + this.passwordDictionary = OptionalNullable.absent(); + } else { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } + return this; + } + + @JsonSetter(value = "api_enable_users", nulls = Nulls.SKIP) + public Builder apiEnableUsers(Optional apiEnableUsers) { + this.apiEnableUsers = apiEnableUsers; + return this; + } + + public Builder apiEnableUsers(Boolean apiEnableUsers) { + this.apiEnableUsers = Optional.ofNullable(apiEnableUsers); + return this; + } + + @JsonSetter(value = "basic_profile", nulls = Nulls.SKIP) + public Builder basicProfile(Optional basicProfile) { + this.basicProfile = basicProfile; + return this; + } + + public Builder basicProfile(Boolean basicProfile) { + this.basicProfile = Optional.ofNullable(basicProfile); + return this; + } + + @JsonSetter(value = "ext_admin", nulls = Nulls.SKIP) + public Builder extAdmin(Optional extAdmin) { + this.extAdmin = extAdmin; + return this; + } + + public Builder extAdmin(Boolean extAdmin) { + this.extAdmin = Optional.ofNullable(extAdmin); + return this; + } + + @JsonSetter(value = "ext_is_suspended", nulls = Nulls.SKIP) + public Builder extIsSuspended(Optional extIsSuspended) { + this.extIsSuspended = extIsSuspended; + return this; + } + + public Builder extIsSuspended(Boolean extIsSuspended) { + this.extIsSuspended = Optional.ofNullable(extIsSuspended); + return this; + } + + @JsonSetter(value = "ext_agreed_terms", nulls = Nulls.SKIP) + public Builder extAgreedTerms(Optional extAgreedTerms) { + this.extAgreedTerms = extAgreedTerms; + return this; + } + + public Builder extAgreedTerms(Boolean extAgreedTerms) { + this.extAgreedTerms = Optional.ofNullable(extAgreedTerms); + return this; + } + + @JsonSetter(value = "ext_groups", nulls = Nulls.SKIP) + public Builder extGroups(Optional extGroups) { + this.extGroups = extGroups; + return this; + } + + public Builder extGroups(Boolean extGroups) { + this.extGroups = Optional.ofNullable(extGroups); + return this; + } + + @JsonSetter(value = "ext_assigned_plans", nulls = Nulls.SKIP) + public Builder extAssignedPlans(Optional extAssignedPlans) { + this.extAssignedPlans = extAssignedPlans; + return this; + } + + public Builder extAssignedPlans(Boolean extAssignedPlans) { + this.extAssignedPlans = Optional.ofNullable(extAssignedPlans); + return this; + } + + @JsonSetter(value = "ext_profile", nulls = Nulls.SKIP) + public Builder extProfile(Optional extProfile) { + this.extProfile = extProfile; + return this; + } + + public Builder extProfile(Boolean extProfile) { + this.extProfile = Optional.ofNullable(extProfile); + return this; + } + + @JsonSetter(value = "disable_self_service_change_password", nulls = Nulls.SKIP) + public Builder disableSelfServiceChangePassword(Optional disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + return this; + } + + public Builder disableSelfServiceChangePassword(Boolean disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = Optional.ofNullable(disableSelfServiceChangePassword); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams(@Nullable OptionalNullable> upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams(Map upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams(Optional> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams(com.auth0.client.mgmt.core.Nullable> upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @JsonSetter(value = "gateway_authentication", nulls = Nulls.SKIP) + public Builder gatewayAuthentication( + @Nullable OptionalNullable gatewayAuthentication) { + this.gatewayAuthentication = gatewayAuthentication; + return this; + } + + public Builder gatewayAuthentication(ConnectionGatewayAuthentication gatewayAuthentication) { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication); + return this; + } + + public Builder gatewayAuthentication(Optional gatewayAuthentication) { + if (gatewayAuthentication.isPresent()) { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication.get()); + } else { + this.gatewayAuthentication = OptionalNullable.absent(); + } + return this; + } + + public Builder gatewayAuthentication( + com.auth0.client.mgmt.core.Nullable gatewayAuthentication) { + if (gatewayAuthentication.isNull()) { + this.gatewayAuthentication = OptionalNullable.ofNull(); + } else if (gatewayAuthentication.isEmpty()) { + this.gatewayAuthentication = OptionalNullable.absent(); + } else { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication.get()); + } + return this; + } + + public ConnectionPropertiesOptions build() { + return new ConnectionPropertiesOptions( + validation, + nonPersistentAttrs, + precedence, + attributes, + enableScriptContext, + enabledDatabaseCustomization, + importMode, + customScripts, + authenticationMethods, + passkeyOptions, + passwordPolicy, + passwordComplexityOptions, + passwordHistory, + passwordNoPersonalInfo, + passwordDictionary, + apiEnableUsers, + basicProfile, + extAdmin, + extIsSuspended, + extAgreedTerms, + extGroups, + extAssignedPlans, + extProfile, + disableSelfServiceChangePassword, + upstreamParams, + setUserRootAttributes, + gatewayAuthentication, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java new file mode 100644 index 000000000..71cb22fa1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionSetUserRootAttributesEnum { + public static final ConnectionSetUserRootAttributesEnum NEVER_ON_LOGIN = + new ConnectionSetUserRootAttributesEnum(Value.NEVER_ON_LOGIN, "never_on_login"); + + public static final ConnectionSetUserRootAttributesEnum ON_EACH_LOGIN = + new ConnectionSetUserRootAttributesEnum(Value.ON_EACH_LOGIN, "on_each_login"); + + public static final ConnectionSetUserRootAttributesEnum ON_FIRST_LOGIN = + new ConnectionSetUserRootAttributesEnum(Value.ON_FIRST_LOGIN, "on_first_login"); + + private final Value value; + + private final String string; + + ConnectionSetUserRootAttributesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionSetUserRootAttributesEnum + && this.string.equals(((ConnectionSetUserRootAttributesEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NEVER_ON_LOGIN: + return visitor.visitNeverOnLogin(); + case ON_EACH_LOGIN: + return visitor.visitOnEachLogin(); + case ON_FIRST_LOGIN: + return visitor.visitOnFirstLogin(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionSetUserRootAttributesEnum valueOf(String value) { + switch (value) { + case "never_on_login": + return NEVER_ON_LOGIN; + case "on_each_login": + return ON_EACH_LOGIN; + case "on_first_login": + return ON_FIRST_LOGIN; + default: + return new ConnectionSetUserRootAttributesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ON_EACH_LOGIN, + + ON_FIRST_LOGIN, + + NEVER_ON_LOGIN, + + UNKNOWN + } + + public interface Visitor { + T visitOnEachLogin(); + + T visitOnFirstLogin(); + + T visitNeverOnLogin(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java new file mode 100644 index 000000000..a69407be8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java @@ -0,0 +1,706 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionStrategyEnum { + public static final ConnectionStrategyEnum SHOP = new ConnectionStrategyEnum(Value.SHOP, "shop"); + + public static final ConnectionStrategyEnum AUTH0OIDC = new ConnectionStrategyEnum(Value.AUTH0OIDC, "auth0-oidc"); + + public static final ConnectionStrategyEnum DWOLLA = new ConnectionStrategyEnum(Value.DWOLLA, "dwolla"); + + public static final ConnectionStrategyEnum FLICKR = new ConnectionStrategyEnum(Value.FLICKR, "flickr"); + + public static final ConnectionStrategyEnum OKTA = new ConnectionStrategyEnum(Value.OKTA, "okta"); + + public static final ConnectionStrategyEnum PLANNINGCENTER = + new ConnectionStrategyEnum(Value.PLANNINGCENTER, "planningcenter"); + + public static final ConnectionStrategyEnum GOOGLE_OAUTH2 = + new ConnectionStrategyEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); + + public static final ConnectionStrategyEnum AUTH0 = new ConnectionStrategyEnum(Value.AUTH0, "auth0"); + + public static final ConnectionStrategyEnum EXACT = new ConnectionStrategyEnum(Value.EXACT, "exact"); + + public static final ConnectionStrategyEnum WORDPRESS = new ConnectionStrategyEnum(Value.WORDPRESS, "wordpress"); + + public static final ConnectionStrategyEnum FITBIT = new ConnectionStrategyEnum(Value.FITBIT, "fitbit"); + + public static final ConnectionStrategyEnum EVERNOTE = new ConnectionStrategyEnum(Value.EVERNOTE, "evernote"); + + public static final ConnectionStrategyEnum SHAREPOINT = new ConnectionStrategyEnum(Value.SHAREPOINT, "sharepoint"); + + public static final ConnectionStrategyEnum SHOPIFY = new ConnectionStrategyEnum(Value.SHOPIFY, "shopify"); + + public static final ConnectionStrategyEnum SALESFORCE_SANDBOX = + new ConnectionStrategyEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); + + public static final ConnectionStrategyEnum MIICARD = new ConnectionStrategyEnum(Value.MIICARD, "miicard"); + + public static final ConnectionStrategyEnum FACEBOOK = new ConnectionStrategyEnum(Value.FACEBOOK, "facebook"); + + public static final ConnectionStrategyEnum OAUTH1 = new ConnectionStrategyEnum(Value.OAUTH1, "oauth1"); + + public static final ConnectionStrategyEnum APPLE = new ConnectionStrategyEnum(Value.APPLE, "apple"); + + public static final ConnectionStrategyEnum UNTAPPD = new ConnectionStrategyEnum(Value.UNTAPPD, "untappd"); + + public static final ConnectionStrategyEnum AMAZON = new ConnectionStrategyEnum(Value.AMAZON, "amazon"); + + public static final ConnectionStrategyEnum LINE = new ConnectionStrategyEnum(Value.LINE, "line"); + + public static final ConnectionStrategyEnum BITBUCKET = new ConnectionStrategyEnum(Value.BITBUCKET, "bitbucket"); + + public static final ConnectionStrategyEnum GITHUB = new ConnectionStrategyEnum(Value.GITHUB, "github"); + + public static final ConnectionStrategyEnum SALESFORCE = new ConnectionStrategyEnum(Value.SALESFORCE, "salesforce"); + + public static final ConnectionStrategyEnum OFFICE365 = new ConnectionStrategyEnum(Value.OFFICE365, "office365"); + + public static final ConnectionStrategyEnum SMS = new ConnectionStrategyEnum(Value.SMS, "sms"); + + public static final ConnectionStrategyEnum AOL = new ConnectionStrategyEnum(Value.AOL, "aol"); + + public static final ConnectionStrategyEnum TWITTER = new ConnectionStrategyEnum(Value.TWITTER, "twitter"); + + public static final ConnectionStrategyEnum WINDOWSLIVE = + new ConnectionStrategyEnum(Value.WINDOWSLIVE, "windowslive"); + + public static final ConnectionStrategyEnum YANDEX = new ConnectionStrategyEnum(Value.YANDEX, "yandex"); + + public static final ConnectionStrategyEnum AD = new ConnectionStrategyEnum(Value.AD, "ad"); + + public static final ConnectionStrategyEnum BAIDU = new ConnectionStrategyEnum(Value.BAIDU, "baidu"); + + public static final ConnectionStrategyEnum BITLY = new ConnectionStrategyEnum(Value.BITLY, "bitly"); + + public static final ConnectionStrategyEnum PAYPAL_SANDBOX = + new ConnectionStrategyEnum(Value.PAYPAL_SANDBOX, "paypal-sandbox"); + + public static final ConnectionStrategyEnum RENREN = new ConnectionStrategyEnum(Value.RENREN, "renren"); + + public static final ConnectionStrategyEnum SAMLP = new ConnectionStrategyEnum(Value.SAMLP, "samlp"); + + public static final ConnectionStrategyEnum DROPBOX = new ConnectionStrategyEnum(Value.DROPBOX, "dropbox"); + + public static final ConnectionStrategyEnum VKONTAKTE = new ConnectionStrategyEnum(Value.VKONTAKTE, "vkontakte"); + + public static final ConnectionStrategyEnum AUTH0ADLDAP = + new ConnectionStrategyEnum(Value.AUTH0ADLDAP, "auth0-adldap"); + + public static final ConnectionStrategyEnum PINGFEDERATE = + new ConnectionStrategyEnum(Value.PINGFEDERATE, "pingfederate"); + + public static final ConnectionStrategyEnum INSTAGRAM = new ConnectionStrategyEnum(Value.INSTAGRAM, "instagram"); + + public static final ConnectionStrategyEnum THIRTYSEVENSIGNALS = + new ConnectionStrategyEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); + + public static final ConnectionStrategyEnum WAAD = new ConnectionStrategyEnum(Value.WAAD, "waad"); + + public static final ConnectionStrategyEnum THECITY_SANDBOX = + new ConnectionStrategyEnum(Value.THECITY_SANDBOX, "thecity-sandbox"); + + public static final ConnectionStrategyEnum OIDC = new ConnectionStrategyEnum(Value.OIDC, "oidc"); + + public static final ConnectionStrategyEnum YAMMER = new ConnectionStrategyEnum(Value.YAMMER, "yammer"); + + public static final ConnectionStrategyEnum EVERNOTE_SANDBOX = + new ConnectionStrategyEnum(Value.EVERNOTE_SANDBOX, "evernote-sandbox"); + + public static final ConnectionStrategyEnum SALESFORCE_COMMUNITY = + new ConnectionStrategyEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); + + public static final ConnectionStrategyEnum DACCOUNT = new ConnectionStrategyEnum(Value.DACCOUNT, "daccount"); + + public static final ConnectionStrategyEnum SOUNDCLOUD = new ConnectionStrategyEnum(Value.SOUNDCLOUD, "soundcloud"); + + public static final ConnectionStrategyEnum OAUTH2 = new ConnectionStrategyEnum(Value.OAUTH2, "oauth2"); + + public static final ConnectionStrategyEnum BOX = new ConnectionStrategyEnum(Value.BOX, "box"); + + public static final ConnectionStrategyEnum IP = new ConnectionStrategyEnum(Value.IP, "ip"); + + public static final ConnectionStrategyEnum ADFS = new ConnectionStrategyEnum(Value.ADFS, "adfs"); + + public static final ConnectionStrategyEnum EMAIL = new ConnectionStrategyEnum(Value.EMAIL, "email"); + + public static final ConnectionStrategyEnum CUSTOM = new ConnectionStrategyEnum(Value.CUSTOM, "custom"); + + public static final ConnectionStrategyEnum YAHOO = new ConnectionStrategyEnum(Value.YAHOO, "yahoo"); + + public static final ConnectionStrategyEnum WEIBO = new ConnectionStrategyEnum(Value.WEIBO, "weibo"); + + public static final ConnectionStrategyEnum GOOGLE_APPS = + new ConnectionStrategyEnum(Value.GOOGLE_APPS, "google-apps"); + + public static final ConnectionStrategyEnum PAYPAL = new ConnectionStrategyEnum(Value.PAYPAL, "paypal"); + + public static final ConnectionStrategyEnum LINKEDIN = new ConnectionStrategyEnum(Value.LINKEDIN, "linkedin"); + + public static final ConnectionStrategyEnum THECITY = new ConnectionStrategyEnum(Value.THECITY, "thecity"); + + private final Value value; + + private final String string; + + ConnectionStrategyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionStrategyEnum + && this.string.equals(((ConnectionStrategyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHOP: + return visitor.visitShop(); + case AUTH0OIDC: + return visitor.visitAuth0Oidc(); + case DWOLLA: + return visitor.visitDwolla(); + case FLICKR: + return visitor.visitFlickr(); + case OKTA: + return visitor.visitOkta(); + case PLANNINGCENTER: + return visitor.visitPlanningcenter(); + case GOOGLE_OAUTH2: + return visitor.visitGoogleOauth2(); + case AUTH0: + return visitor.visitAuth0(); + case EXACT: + return visitor.visitExact(); + case WORDPRESS: + return visitor.visitWordpress(); + case FITBIT: + return visitor.visitFitbit(); + case EVERNOTE: + return visitor.visitEvernote(); + case SHAREPOINT: + return visitor.visitSharepoint(); + case SHOPIFY: + return visitor.visitShopify(); + case SALESFORCE_SANDBOX: + return visitor.visitSalesforceSandbox(); + case MIICARD: + return visitor.visitMiicard(); + case FACEBOOK: + return visitor.visitFacebook(); + case OAUTH1: + return visitor.visitOauth1(); + case APPLE: + return visitor.visitApple(); + case UNTAPPD: + return visitor.visitUntappd(); + case AMAZON: + return visitor.visitAmazon(); + case LINE: + return visitor.visitLine(); + case BITBUCKET: + return visitor.visitBitbucket(); + case GITHUB: + return visitor.visitGithub(); + case SALESFORCE: + return visitor.visitSalesforce(); + case OFFICE365: + return visitor.visitOffice365(); + case SMS: + return visitor.visitSms(); + case AOL: + return visitor.visitAol(); + case TWITTER: + return visitor.visitTwitter(); + case WINDOWSLIVE: + return visitor.visitWindowslive(); + case YANDEX: + return visitor.visitYandex(); + case AD: + return visitor.visitAd(); + case BAIDU: + return visitor.visitBaidu(); + case BITLY: + return visitor.visitBitly(); + case PAYPAL_SANDBOX: + return visitor.visitPaypalSandbox(); + case RENREN: + return visitor.visitRenren(); + case SAMLP: + return visitor.visitSamlp(); + case DROPBOX: + return visitor.visitDropbox(); + case VKONTAKTE: + return visitor.visitVkontakte(); + case AUTH0ADLDAP: + return visitor.visitAuth0Adldap(); + case PINGFEDERATE: + return visitor.visitPingfederate(); + case INSTAGRAM: + return visitor.visitInstagram(); + case THIRTYSEVENSIGNALS: + return visitor.visitThirtysevensignals(); + case WAAD: + return visitor.visitWaad(); + case THECITY_SANDBOX: + return visitor.visitThecitySandbox(); + case OIDC: + return visitor.visitOidc(); + case YAMMER: + return visitor.visitYammer(); + case EVERNOTE_SANDBOX: + return visitor.visitEvernoteSandbox(); + case SALESFORCE_COMMUNITY: + return visitor.visitSalesforceCommunity(); + case DACCOUNT: + return visitor.visitDaccount(); + case SOUNDCLOUD: + return visitor.visitSoundcloud(); + case OAUTH2: + return visitor.visitOauth2(); + case BOX: + return visitor.visitBox(); + case IP: + return visitor.visitIp(); + case ADFS: + return visitor.visitAdfs(); + case EMAIL: + return visitor.visitEmail(); + case CUSTOM: + return visitor.visitCustom(); + case YAHOO: + return visitor.visitYahoo(); + case WEIBO: + return visitor.visitWeibo(); + case GOOGLE_APPS: + return visitor.visitGoogleApps(); + case PAYPAL: + return visitor.visitPaypal(); + case LINKEDIN: + return visitor.visitLinkedin(); + case THECITY: + return visitor.visitThecity(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionStrategyEnum valueOf(String value) { + switch (value) { + case "shop": + return SHOP; + case "auth0-oidc": + return AUTH0OIDC; + case "dwolla": + return DWOLLA; + case "flickr": + return FLICKR; + case "okta": + return OKTA; + case "planningcenter": + return PLANNINGCENTER; + case "google-oauth2": + return GOOGLE_OAUTH2; + case "auth0": + return AUTH0; + case "exact": + return EXACT; + case "wordpress": + return WORDPRESS; + case "fitbit": + return FITBIT; + case "evernote": + return EVERNOTE; + case "sharepoint": + return SHAREPOINT; + case "shopify": + return SHOPIFY; + case "salesforce-sandbox": + return SALESFORCE_SANDBOX; + case "miicard": + return MIICARD; + case "facebook": + return FACEBOOK; + case "oauth1": + return OAUTH1; + case "apple": + return APPLE; + case "untappd": + return UNTAPPD; + case "amazon": + return AMAZON; + case "line": + return LINE; + case "bitbucket": + return BITBUCKET; + case "github": + return GITHUB; + case "salesforce": + return SALESFORCE; + case "office365": + return OFFICE365; + case "sms": + return SMS; + case "aol": + return AOL; + case "twitter": + return TWITTER; + case "windowslive": + return WINDOWSLIVE; + case "yandex": + return YANDEX; + case "ad": + return AD; + case "baidu": + return BAIDU; + case "bitly": + return BITLY; + case "paypal-sandbox": + return PAYPAL_SANDBOX; + case "renren": + return RENREN; + case "samlp": + return SAMLP; + case "dropbox": + return DROPBOX; + case "vkontakte": + return VKONTAKTE; + case "auth0-adldap": + return AUTH0ADLDAP; + case "pingfederate": + return PINGFEDERATE; + case "instagram": + return INSTAGRAM; + case "thirtysevensignals": + return THIRTYSEVENSIGNALS; + case "waad": + return WAAD; + case "thecity-sandbox": + return THECITY_SANDBOX; + case "oidc": + return OIDC; + case "yammer": + return YAMMER; + case "evernote-sandbox": + return EVERNOTE_SANDBOX; + case "salesforce-community": + return SALESFORCE_COMMUNITY; + case "daccount": + return DACCOUNT; + case "soundcloud": + return SOUNDCLOUD; + case "oauth2": + return OAUTH2; + case "box": + return BOX; + case "ip": + return IP; + case "adfs": + return ADFS; + case "email": + return EMAIL; + case "custom": + return CUSTOM; + case "yahoo": + return YAHOO; + case "weibo": + return WEIBO; + case "google-apps": + return GOOGLE_APPS; + case "paypal": + return PAYPAL; + case "linkedin": + return LINKEDIN; + case "thecity": + return THECITY; + default: + return new ConnectionStrategyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AD, + + ADFS, + + AMAZON, + + APPLE, + + DROPBOX, + + BITBUCKET, + + AOL, + + AUTH0OIDC, + + AUTH0, + + BAIDU, + + BITLY, + + BOX, + + CUSTOM, + + DACCOUNT, + + DWOLLA, + + EMAIL, + + EVERNOTE_SANDBOX, + + EVERNOTE, + + EXACT, + + FACEBOOK, + + FITBIT, + + FLICKR, + + GITHUB, + + GOOGLE_APPS, + + GOOGLE_OAUTH2, + + INSTAGRAM, + + IP, + + LINE, + + LINKEDIN, + + MIICARD, + + OAUTH1, + + OAUTH2, + + OFFICE365, + + OIDC, + + OKTA, + + PAYPAL, + + PAYPAL_SANDBOX, + + PINGFEDERATE, + + PLANNINGCENTER, + + RENREN, + + SALESFORCE_COMMUNITY, + + SALESFORCE_SANDBOX, + + SALESFORCE, + + SAMLP, + + SHAREPOINT, + + SHOPIFY, + + SHOP, + + SMS, + + SOUNDCLOUD, + + THECITY_SANDBOX, + + THECITY, + + THIRTYSEVENSIGNALS, + + TWITTER, + + UNTAPPD, + + VKONTAKTE, + + WAAD, + + WEIBO, + + WINDOWSLIVE, + + WORDPRESS, + + YAHOO, + + YAMMER, + + YANDEX, + + AUTH0ADLDAP, + + UNKNOWN + } + + public interface Visitor { + T visitAd(); + + T visitAdfs(); + + T visitAmazon(); + + T visitApple(); + + T visitDropbox(); + + T visitBitbucket(); + + T visitAol(); + + T visitAuth0Oidc(); + + T visitAuth0(); + + T visitBaidu(); + + T visitBitly(); + + T visitBox(); + + T visitCustom(); + + T visitDaccount(); + + T visitDwolla(); + + T visitEmail(); + + T visitEvernoteSandbox(); + + T visitEvernote(); + + T visitExact(); + + T visitFacebook(); + + T visitFitbit(); + + T visitFlickr(); + + T visitGithub(); + + T visitGoogleApps(); + + T visitGoogleOauth2(); + + T visitInstagram(); + + T visitIp(); + + T visitLine(); + + T visitLinkedin(); + + T visitMiicard(); + + T visitOauth1(); + + T visitOauth2(); + + T visitOffice365(); + + T visitOidc(); + + T visitOkta(); + + T visitPaypal(); + + T visitPaypalSandbox(); + + T visitPingfederate(); + + T visitPlanningcenter(); + + T visitRenren(); + + T visitSalesforceCommunity(); + + T visitSalesforceSandbox(); + + T visitSalesforce(); + + T visitSamlp(); + + T visitSharepoint(); + + T visitShopify(); + + T visitShop(); + + T visitSms(); + + T visitSoundcloud(); + + T visitThecitySandbox(); + + T visitThecity(); + + T visitThirtysevensignals(); + + T visitTwitter(); + + T visitUntappd(); + + T visitVkontakte(); + + T visitWaad(); + + T visitWeibo(); + + T visitWindowslive(); + + T visitWordpress(); + + T visitYahoo(); + + T visitYammer(); + + T visitYandex(); + + T visitAuth0Adldap(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java new file mode 100644 index 000000000..07586413b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionUsernameValidationOptions.Builder.class) +public final class ConnectionUsernameValidationOptions { + private final int min; + + private final int max; + + private final Map additionalProperties; + + private ConnectionUsernameValidationOptions(int min, int max, Map additionalProperties) { + this.min = min; + this.max = max; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("min") + public int getMin() { + return min; + } + + @JsonProperty("max") + public int getMax() { + return max; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionUsernameValidationOptions + && equalTo((ConnectionUsernameValidationOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionUsernameValidationOptions other) { + return min == other.min && max == other.max; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.min, this.max); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MinStage builder() { + return new Builder(); + } + + public interface MinStage { + MaxStage min(int min); + + Builder from(ConnectionUsernameValidationOptions other); + } + + public interface MaxStage { + _FinalStage max(int max); + } + + public interface _FinalStage { + ConnectionUsernameValidationOptions build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MinStage, MaxStage, _FinalStage { + private int min; + + private int max; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionUsernameValidationOptions other) { + min(other.getMin()); + max(other.getMax()); + return this; + } + + @java.lang.Override + @JsonSetter("min") + public MaxStage min(int min) { + this.min = min; + return this; + } + + @java.lang.Override + @JsonSetter("max") + public _FinalStage max(int max) { + this.max = max; + return this; + } + + @java.lang.Override + public ConnectionUsernameValidationOptions build() { + return new ConnectionUsernameValidationOptions(min, max, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java new file mode 100644 index 000000000..e95610f27 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionValidationOptions.Builder.class) +public final class ConnectionValidationOptions { + private final OptionalNullable username; + + private final Map additionalProperties; + + private ConnectionValidationOptions( + OptionalNullable username, Map additionalProperties) { + this.username = username; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + public OptionalNullable getUsername() { + if (username == null) { + return OptionalNullable.absent(); + } + return username; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + private OptionalNullable _getUsername() { + return username; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionValidationOptions && equalTo((ConnectionValidationOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionValidationOptions other) { + return username.equals(other.username); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.username); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable username = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionValidationOptions other) { + username(other.getUsername()); + return this; + } + + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(@Nullable OptionalNullable username) { + this.username = username; + return this; + } + + public Builder username(ConnectionUsernameValidationOptions username) { + this.username = OptionalNullable.of(username); + return this; + } + + public Builder username(Optional username) { + if (username.isPresent()) { + this.username = OptionalNullable.of(username.get()); + } else { + this.username = OptionalNullable.absent(); + } + return this; + } + + public Builder username(com.auth0.client.mgmt.core.Nullable username) { + if (username.isNull()) { + this.username = OptionalNullable.ofNull(); + } else if (username.isEmpty()) { + this.username = OptionalNullable.absent(); + } else { + this.username = OptionalNullable.of(username.get()); + } + return this; + } + + public ConnectionValidationOptions build() { + return new ConnectionValidationOptions(username, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java new file mode 100644 index 000000000..4fe6d97ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java @@ -0,0 +1,402 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateActionRequestContent.Builder.class) +public final class CreateActionRequestContent { + private final String name; + + private final List supportedTriggers; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional deploy; + + private final Map additionalProperties; + + private CreateActionRequestContent( + String name, + List supportedTriggers, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Optional deploy, + Map additionalProperties) { + this.name = name; + this.supportedTriggers = supportedTriggers; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.deploy = deploy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public List getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + /** + * @return True if the action should be deployed after creation. + */ + @JsonProperty("deploy") + public Optional getDeploy() { + return deploy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateActionRequestContent && equalTo((CreateActionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateActionRequestContent other) { + return name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && deploy.equals(other.deploy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.supportedTriggers, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.deploy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The name of an action.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateActionRequestContent other); + } + + public interface _FinalStage { + CreateActionRequestContent build(); + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + _FinalStage supportedTriggers(List supportedTriggers); + + _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers); + + _FinalStage addAllSupportedTriggers(List supportedTriggers); + + /** + *

The source code of the action.

+ */ + _FinalStage code(Optional code); + + _FinalStage code(String code); + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + _FinalStage dependencies(Optional> dependencies); + + _FinalStage dependencies(List dependencies); + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + _FinalStage runtime(Optional runtime); + + _FinalStage runtime(String runtime); + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + _FinalStage secrets(Optional> secrets); + + _FinalStage secrets(List secrets); + + /** + *

True if the action should be deployed after creation.

+ */ + _FinalStage deploy(Optional deploy); + + _FinalStage deploy(Boolean deploy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional deploy = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional code = Optional.empty(); + + private List supportedTriggers = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateActionRequestContent other) { + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + deploy(other.getDeploy()); + return this; + } + + /** + *

The name of an action.

+ *

The name of an action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage deploy(Boolean deploy) { + this.deploy = Optional.ofNullable(deploy); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ */ + @java.lang.Override + @JsonSetter(value = "deploy", nulls = Nulls.SKIP) + public _FinalStage deploy(Optional deploy) { + this.deploy = deploy; + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @java.lang.Override + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public _FinalStage secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @java.lang.Override + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public _FinalStage runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @java.lang.Override + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public _FinalStage dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + *

The source code of the action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The source code of the action.

+ */ + @java.lang.Override + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public _FinalStage code(Optional code) { + this.code = code; + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllSupportedTriggers(List supportedTriggers) { + if (supportedTriggers != null) { + this.supportedTriggers.addAll(supportedTriggers); + } + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers) { + this.supportedTriggers.add(supportedTriggers); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @java.lang.Override + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public _FinalStage supportedTriggers(List supportedTriggers) { + this.supportedTriggers.clear(); + if (supportedTriggers != null) { + this.supportedTriggers.addAll(supportedTriggers); + } + return this; + } + + @java.lang.Override + public CreateActionRequestContent build() { + return new CreateActionRequestContent( + name, supportedTriggers, code, dependencies, runtime, secrets, deploy, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java new file mode 100644 index 000000000..81fa44501 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateActionResponseContent.Builder.class) +public final class CreateActionResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional allChangesDeployed; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional deployedVersion; + + private final Optional installedIntegrationId; + + private final Optional integration; + + private final Optional status; + + private final Optional builtAt; + + private final Optional deploy; + + private final Map additionalProperties; + + private CreateActionResponseContent( + Optional id, + Optional name, + Optional> supportedTriggers, + Optional allChangesDeployed, + Optional createdAt, + Optional updatedAt, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Optional deployedVersion, + Optional installedIntegrationId, + Optional integration, + Optional status, + Optional builtAt, + Optional deploy, + Map additionalProperties) { + this.id = id; + this.name = name; + this.supportedTriggers = supportedTriggers; + this.allChangesDeployed = allChangesDeployed; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.deployedVersion = deployedVersion; + this.installedIntegrationId = installedIntegrationId; + this.integration = integration; + this.status = status; + this.builtAt = builtAt; + this.deploy = deploy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the action. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return True if all of an Action's contents have been deployed. + */ + @JsonProperty("all_changes_deployed") + public Optional getAllChangesDeployed() { + return allChangesDeployed; + } + + /** + * @return The time when this action was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this action was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("deployed_version") + public Optional getDeployedVersion() { + return deployedVersion; + } + + /** + * @return installed_integration_id is the fk reference to the InstalledIntegration entity. + */ + @JsonProperty("installed_integration_id") + public Optional getInstalledIntegrationId() { + return installedIntegrationId; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The time when this action was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return True if the action should be deployed after creation. + */ + @JsonProperty("deploy") + public Optional getDeploy() { + return deploy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateActionResponseContent && equalTo((CreateActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateActionResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && allChangesDeployed.equals(other.allChangesDeployed) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && deployedVersion.equals(other.deployedVersion) + && installedIntegrationId.equals(other.installedIntegrationId) + && integration.equals(other.integration) + && status.equals(other.status) + && builtAt.equals(other.builtAt) + && deploy.equals(other.deploy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.supportedTriggers, + this.allChangesDeployed, + this.createdAt, + this.updatedAt, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.deployedVersion, + this.installedIntegrationId, + this.integration, + this.status, + this.builtAt, + this.deploy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional allChangesDeployed = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional deployedVersion = Optional.empty(); + + private Optional installedIntegrationId = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional deploy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateActionResponseContent other) { + id(other.getId()); + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + allChangesDeployed(other.getAllChangesDeployed()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + deployedVersion(other.getDeployedVersion()); + installedIntegrationId(other.getInstalledIntegrationId()); + integration(other.getIntegration()); + status(other.getStatus()); + builtAt(other.getBuiltAt()); + deploy(other.getDeploy()); + return this; + } + + /** + *

The unique ID of the action.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

True if all of an Action's contents have been deployed.

+ */ + @JsonSetter(value = "all_changes_deployed", nulls = Nulls.SKIP) + public Builder allChangesDeployed(Optional allChangesDeployed) { + this.allChangesDeployed = allChangesDeployed; + return this; + } + + public Builder allChangesDeployed(Boolean allChangesDeployed) { + this.allChangesDeployed = Optional.ofNullable(allChangesDeployed); + return this; + } + + /** + *

The time when this action was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this action was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The source code of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "deployed_version", nulls = Nulls.SKIP) + public Builder deployedVersion(Optional deployedVersion) { + this.deployedVersion = deployedVersion; + return this; + } + + public Builder deployedVersion(ActionDeployedVersion deployedVersion) { + this.deployedVersion = Optional.ofNullable(deployedVersion); + return this; + } + + /** + *

installed_integration_id is the fk reference to the InstalledIntegration entity.

+ */ + @JsonSetter(value = "installed_integration_id", nulls = Nulls.SKIP) + public Builder installedIntegrationId(Optional installedIntegrationId) { + this.installedIntegrationId = installedIntegrationId; + return this; + } + + public Builder installedIntegrationId(String installedIntegrationId) { + this.installedIntegrationId = Optional.ofNullable(installedIntegrationId); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(Integration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The time when this action was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ */ + @JsonSetter(value = "deploy", nulls = Nulls.SKIP) + public Builder deploy(Optional deploy) { + this.deploy = deploy; + return this; + } + + public Builder deploy(Boolean deploy) { + this.deploy = Optional.ofNullable(deploy); + return this; + } + + public CreateActionResponseContent build() { + return new CreateActionResponseContent( + id, + name, + supportedTriggers, + allChangesDeployed, + createdAt, + updatedAt, + code, + dependencies, + runtime, + secrets, + deployedVersion, + installedIntegrationId, + integration, + status, + builtAt, + deploy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java new file mode 100644 index 000000000..43f197694 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateBrandingPhoneProviderResponseContent.Builder.class) +public final class CreateBrandingPhoneProviderResponseContent { + private final Optional id; + + private final Optional tenant; + + private final PhoneProviderNameEnum name; + + private final Optional channel; + + private final Optional disabled; + + private final Optional configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private CreateBrandingPhoneProviderResponseContent( + Optional id, + Optional tenant, + PhoneProviderNameEnum name, + Optional channel, + Optional disabled, + Optional configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.tenant = tenant; + this.name = name; + this.channel = channel; + this.disabled = disabled; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the tenant + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("name") + public PhoneProviderNameEnum getName() { + return name; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + /** + * @return The provider's creation date and time in ISO 8601 format + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time of the last update to the provider in ISO 8601 format + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateBrandingPhoneProviderResponseContent + && equalTo((CreateBrandingPhoneProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateBrandingPhoneProviderResponseContent other) { + return id.equals(other.id) + && tenant.equals(other.tenant) + && name.equals(other.name) + && channel.equals(other.channel) + && disabled.equals(other.disabled) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.tenant, + this.name, + this.channel, + this.disabled, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull PhoneProviderNameEnum name); + + Builder from(CreateBrandingPhoneProviderResponseContent other); + } + + public interface _FinalStage { + CreateBrandingPhoneProviderResponseContent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

The name of the tenant

+ */ + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(Optional disabled); + + _FinalStage disabled(Boolean disabled); + + _FinalStage configuration(Optional configuration); + + _FinalStage configuration(PhoneProviderConfiguration configuration); + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private PhoneProviderNameEnum name; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional configuration = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional channel = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateBrandingPhoneProviderResponseContent other) { + id(other.getId()); + tenant(other.getTenant()); + name(other.getName()); + channel(other.getChannel()); + disabled(other.getDisabled()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull PhoneProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public _FinalStage updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public _FinalStage configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public _FinalStage configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @java.lang.Override + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public _FinalStage disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + /** + *

The name of the tenant

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

The name of the tenant

+ */ + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public CreateBrandingPhoneProviderResponseContent build() { + return new CreateBrandingPhoneProviderResponseContent( + id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java new file mode 100644 index 000000000..10eca3e8f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateBrandingThemeResponseContent.Builder.class) +public final class CreateBrandingThemeResponseContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final String displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final String themeId; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private CreateBrandingThemeResponseContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + String displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + String themeId, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.themeId = themeId; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + /** + * @return Theme Id + */ + @JsonProperty("themeId") + public String getThemeId() { + return themeId; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateBrandingThemeResponseContent + && equalTo((CreateBrandingThemeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateBrandingThemeResponseContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && themeId.equals(other.themeId) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.borders, + this.colors, + this.displayName, + this.fonts, + this.pageBackground, + this.themeId, + this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(CreateBrandingThemeResponseContent other); + } + + public interface ColorsStage { + DisplayNameStage colors(@NotNull BrandingThemeColors colors); + } + + public interface DisplayNameStage { + /** + *

Display Name

+ */ + FontsStage displayName(@NotNull String displayName); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface ThemeIdStage { + /** + *

Theme Id

+ */ + WidgetStage themeId(@NotNull String themeId); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + CreateBrandingThemeResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, + ColorsStage, + DisplayNameStage, + FontsStage, + PageBackgroundStage, + ThemeIdStage, + WidgetStage, + _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private String displayName; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private String themeId; + + private BrandingThemeWidget widget; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateBrandingThemeResponseContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + themeId(other.getThemeId()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + /** + *

Display Name

+ *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayName") + public FontsStage displayName(@NotNull String displayName) { + this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + /** + *

Theme Id

+ *

Theme Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("themeId") + public WidgetStage themeId(@NotNull String themeId) { + this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + @java.lang.Override + public CreateBrandingThemeResponseContent build() { + return new CreateBrandingThemeResponseContent( + borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java new file mode 100644 index 000000000..e80e17856 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java @@ -0,0 +1,289 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateClientGrantRequestContent.Builder.class) +public final class CreateClientGrantRequestContent { + private final String clientId; + + private final String audience; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final List scope; + + private final Map additionalProperties; + + private CreateClientGrantRequestContent( + String clientId, + String audience, + Optional organizationUsage, + Optional allowAnyOrganization, + List scope, + Map additionalProperties) { + this.clientId = clientId; + this.audience = audience; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.scope = scope; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant + */ + @JsonProperty("audience") + public String getAudience() { + return audience; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public List getScope() { + return scope; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateClientGrantRequestContent && equalTo((CreateClientGrantRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateClientGrantRequestContent other) { + return clientId.equals(other.clientId) + && audience.equals(other.audience) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization) + && scope.equals(other.scope); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, this.audience, this.organizationUsage, this.allowAnyOrganization, this.scope); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

ID of the client.

+ */ + AudienceStage clientId(@NotNull String clientId); + + Builder from(CreateClientGrantRequestContent other); + } + + public interface AudienceStage { + /** + *

The audience (API identifier) of this client grant

+ */ + _FinalStage audience(@NotNull String audience); + } + + public interface _FinalStage { + CreateClientGrantRequestContent build(); + + _FinalStage organizationUsage(Optional organizationUsage); + + _FinalStage organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage); + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + _FinalStage allowAnyOrganization(Optional allowAnyOrganization); + + _FinalStage allowAnyOrganization(Boolean allowAnyOrganization); + + /** + *

Scopes allowed for this client grant.

+ */ + _FinalStage scope(List scope); + + _FinalStage addScope(String scope); + + _FinalStage addAllScope(List scope); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, AudienceStage, _FinalStage { + private String clientId; + + private String audience; + + private List scope = new ArrayList<>(); + + private Optional allowAnyOrganization = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateClientGrantRequestContent other) { + clientId(other.getClientId()); + audience(other.getAudience()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + scope(other.getScope()); + return this; + } + + /** + *

ID of the client.

+ *

ID of the client.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public AudienceStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

The audience (API identifier) of this client grant

+ *

The audience (API identifier) of this client grant

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("audience") + public _FinalStage audience(@NotNull String audience) { + this.audience = Objects.requireNonNull(audience, "audience must not be null"); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllScope(List scope) { + if (scope != null) { + this.scope.addAll(scope); + } + return this; + } + + /** + *

Scopes allowed for this client grant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addScope(String scope) { + this.scope.add(scope); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @java.lang.Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(List scope) { + this.scope.clear(); + if (scope != null) { + this.scope.addAll(scope); + } + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @java.lang.Override + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public _FinalStage allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + @java.lang.Override + public _FinalStage organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public _FinalStage organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + @java.lang.Override + public CreateClientGrantRequestContent build() { + return new CreateClientGrantRequestContent( + clientId, audience, organizationUsage, allowAnyOrganization, scope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java new file mode 100644 index 000000000..cf1445b38 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java @@ -0,0 +1,293 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateClientGrantResponseContent.Builder.class) +public final class CreateClientGrantResponseContent { + private final Optional id; + + private final Optional clientId; + + private final Optional audience; + + private final Optional> scope; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final Optional isSystem; + + private final Map additionalProperties; + + private CreateClientGrantResponseContent( + Optional id, + Optional clientId, + Optional audience, + Optional> scope, + Optional organizationUsage, + Optional allowAnyOrganization, + Optional isSystem, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.audience = audience; + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.isSystem = isSystem; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + /** + * @return If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly. + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateClientGrantResponseContent && equalTo((CreateClientGrantResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateClientGrantResponseContent other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && audience.equals(other.audience) + && scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization) + && isSystem.equals(other.isSystem); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.clientId, + this.audience, + this.scope, + this.organizationUsage, + this.allowAnyOrganization, + this.isSystem); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private Optional allowAnyOrganization = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateClientGrantResponseContent other) { + id(other.getId()); + clientId(other.getClientId()); + audience(other.getAudience()); + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + isSystem(other.getIsSystem()); + return this; + } + + /** + *

ID of the client grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The audience (API identifier) of this client grant.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + /** + *

If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + public CreateClientGrantResponseContent build() { + return new CreateClientGrantResponseContent( + id, + clientId, + audience, + scope, + organizationUsage, + allowAnyOrganization, + isSystem, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java new file mode 100644 index 000000000..a9bfe0069 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java @@ -0,0 +1,2049 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateClientRequestContent.Builder.class) +public final class CreateClientRequestContent { + private final String name; + + private final Optional description; + + private final Optional logoUri; + + private final Optional> callbacks; + + private final Optional oidcLogout; + + private final Optional oidcBackchannelLogout; + + private final OptionalNullable sessionTransfer; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final Optional> grantTypes; + + private final Optional tokenEndpointAuthMethod; + + private final Optional appType; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional jwtConfiguration; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional ssoDisabled; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final Optional nativeSocialLogin; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final Optional clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Optional resourceServerIdentifier; + + private final Map additionalProperties; + + private CreateClientRequestContent( + String name, + Optional description, + Optional logoUri, + Optional> callbacks, + Optional oidcLogout, + Optional oidcBackchannelLogout, + OptionalNullable sessionTransfer, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + Optional> grantTypes, + Optional tokenEndpointAuthMethod, + Optional appType, + Optional isFirstParty, + Optional oidcConformant, + Optional jwtConfiguration, + OptionalNullable encryptionKey, + Optional sso, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional ssoDisabled, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + Optional nativeSocialLogin, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + Optional clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Optional resourceServerIdentifier, + Map additionalProperties) { + this.name = name; + this.description = description; + this.logoUri = logoUri; + this.callbacks = callbacks; + this.oidcLogout = oidcLogout; + this.oidcBackchannelLogout = oidcBackchannelLogout; + this.sessionTransfer = sessionTransfer; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.grantTypes = grantTypes; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.appType = appType; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.jwtConfiguration = jwtConfiguration; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.ssoDisabled = ssoDisabled; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.nativeSocialLogin = nativeSocialLogin; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.resourceServerIdentifier = resourceServerIdentifier; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + @JsonProperty("oidc_backchannel_logout") + public Optional getOidcBackchannelLogout() { + return oidcBackchannelLogout; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return Whether this client a first party client or not + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>) + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return <code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code> + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonProperty("native_social_login") + public Optional getNativeSocialLogin() { + return nativeSocialLogin; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonProperty("client_authentication_methods") + public Optional getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateClientRequestContent && equalTo((CreateClientRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateClientRequestContent other) { + return name.equals(other.name) + && description.equals(other.description) + && logoUri.equals(other.logoUri) + && callbacks.equals(other.callbacks) + && oidcLogout.equals(other.oidcLogout) + && oidcBackchannelLogout.equals(other.oidcBackchannelLogout) + && sessionTransfer.equals(other.sessionTransfer) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && grantTypes.equals(other.grantTypes) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && appType.equals(other.appType) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && jwtConfiguration.equals(other.jwtConfiguration) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && ssoDisabled.equals(other.ssoDisabled) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && nativeSocialLogin.equals(other.nativeSocialLogin) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota) + && resourceServerIdentifier.equals(other.resourceServerIdentifier); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.description, + this.logoUri, + this.callbacks, + this.oidcLogout, + this.oidcBackchannelLogout, + this.sessionTransfer, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.grantTypes, + this.tokenEndpointAuthMethod, + this.appType, + this.isFirstParty, + this.oidcConformant, + this.jwtConfiguration, + this.encryptionKey, + this.sso, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.ssoDisabled, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.nativeSocialLogin, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota, + this.resourceServerIdentifier); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateClientRequestContent other); + } + + public interface _FinalStage { + CreateClientRequestContent build(); + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + _FinalStage logoUri(Optional logoUri); + + _FinalStage logoUri(String logoUri); + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + _FinalStage callbacks(Optional> callbacks); + + _FinalStage callbacks(List callbacks); + + _FinalStage oidcLogout(Optional oidcLogout); + + _FinalStage oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout); + + _FinalStage oidcBackchannelLogout(Optional oidcBackchannelLogout); + + _FinalStage oidcBackchannelLogout(ClientOidcBackchannelLogoutSettings oidcBackchannelLogout); + + _FinalStage sessionTransfer(@Nullable OptionalNullable sessionTransfer); + + _FinalStage sessionTransfer(ClientSessionTransferConfiguration sessionTransfer); + + _FinalStage sessionTransfer(Optional sessionTransfer); + + _FinalStage sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer); + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + _FinalStage allowedOrigins(Optional> allowedOrigins); + + _FinalStage allowedOrigins(List allowedOrigins); + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + _FinalStage webOrigins(Optional> webOrigins); + + _FinalStage webOrigins(List webOrigins); + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + _FinalStage clientAliases(Optional> clientAliases); + + _FinalStage clientAliases(List clientAliases); + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + _FinalStage allowedClients(Optional> allowedClients); + + _FinalStage allowedClients(List allowedClients); + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls); + + _FinalStage allowedLogoutUrls(List allowedLogoutUrls); + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + _FinalStage grantTypes(Optional> grantTypes); + + _FinalStage grantTypes(List grantTypes); + + _FinalStage tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod); + + _FinalStage appType(Optional appType); + + _FinalStage appType(ClientAppTypeEnum appType); + + /** + *

Whether this client a first party client or not

+ */ + _FinalStage isFirstParty(Optional isFirstParty); + + _FinalStage isFirstParty(Boolean isFirstParty); + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + _FinalStage oidcConformant(Optional oidcConformant); + + _FinalStage oidcConformant(Boolean oidcConformant); + + _FinalStage jwtConfiguration(Optional jwtConfiguration); + + _FinalStage jwtConfiguration(ClientJwtConfiguration jwtConfiguration); + + _FinalStage encryptionKey(@Nullable OptionalNullable encryptionKey); + + _FinalStage encryptionKey(ClientEncryptionKey encryptionKey); + + _FinalStage encryptionKey(Optional encryptionKey); + + _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey); + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + _FinalStage sso(Optional sso); + + _FinalStage sso(Boolean sso); + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + _FinalStage crossOriginAuthentication(Optional crossOriginAuthentication); + + _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication); + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + _FinalStage crossOriginLoc(Optional crossOriginLoc); + + _FinalStage crossOriginLoc(String crossOriginLoc); + + /** + *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

+ */ + _FinalStage ssoDisabled(Optional ssoDisabled); + + _FinalStage ssoDisabled(Boolean ssoDisabled); + + /** + *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

+ */ + _FinalStage customLoginPageOn(Optional customLoginPageOn); + + _FinalStage customLoginPageOn(Boolean customLoginPageOn); + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + _FinalStage customLoginPage(Optional customLoginPage); + + _FinalStage customLoginPage(String customLoginPage); + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + _FinalStage customLoginPagePreview(Optional customLoginPagePreview); + + _FinalStage customLoginPagePreview(String customLoginPagePreview); + + /** + *

HTML form template to be used for WS-Federation.

+ */ + _FinalStage formTemplate(Optional formTemplate); + + _FinalStage formTemplate(String formTemplate); + + _FinalStage addons(Optional addons); + + _FinalStage addons(ClientAddons addons); + + _FinalStage clientMetadata(Optional> clientMetadata); + + _FinalStage clientMetadata(Map clientMetadata); + + _FinalStage mobile(Optional mobile); + + _FinalStage mobile(ClientMobile mobile); + + /** + *

Initiate login uri, must be https

+ */ + _FinalStage initiateLoginUri(Optional initiateLoginUri); + + _FinalStage initiateLoginUri(String initiateLoginUri); + + _FinalStage nativeSocialLogin(Optional nativeSocialLogin); + + _FinalStage nativeSocialLogin(NativeSocialLogin nativeSocialLogin); + + _FinalStage refreshToken(@Nullable OptionalNullable refreshToken); + + _FinalStage refreshToken(ClientRefreshTokenConfiguration refreshToken); + + _FinalStage refreshToken(Optional refreshToken); + + _FinalStage refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken); + + _FinalStage defaultOrganization(@Nullable OptionalNullable defaultOrganization); + + _FinalStage defaultOrganization(ClientDefaultOrganization defaultOrganization); + + _FinalStage defaultOrganization(Optional defaultOrganization); + + _FinalStage defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization); + + _FinalStage organizationUsage(Optional organizationUsage); + + _FinalStage organizationUsage(ClientOrganizationUsageEnum organizationUsage); + + _FinalStage organizationRequireBehavior( + Optional organizationRequireBehavior); + + _FinalStage organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior); + + _FinalStage clientAuthenticationMethods(Optional clientAuthenticationMethods); + + _FinalStage clientAuthenticationMethods(ClientCreateAuthenticationMethod clientAuthenticationMethods); + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + _FinalStage requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests); + + _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests); + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + _FinalStage requireProofOfPossession(Optional requireProofOfPossession); + + _FinalStage requireProofOfPossession(Boolean requireProofOfPossession); + + _FinalStage signedRequestObject(Optional signedRequestObject); + + _FinalStage signedRequestObject(ClientSignedRequestObjectWithPublicKey signedRequestObject); + + _FinalStage complianceLevel(@Nullable OptionalNullable complianceLevel); + + _FinalStage complianceLevel(ClientComplianceLevelEnum complianceLevel); + + _FinalStage complianceLevel(Optional complianceLevel); + + _FinalStage complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel); + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + _FinalStage parRequestExpiry(@Nullable OptionalNullable parRequestExpiry); + + _FinalStage parRequestExpiry(Integer parRequestExpiry); + + _FinalStage parRequestExpiry(Optional parRequestExpiry); + + _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry); + + _FinalStage tokenQuota(Optional tokenQuota); + + _FinalStage tokenQuota(CreateTokenQuota tokenQuota); + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + _FinalStage resourceServerIdentifier(Optional resourceServerIdentifier); + + _FinalStage resourceServerIdentifier(String resourceServerIdentifier); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private Optional signedRequestObject = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional clientAuthenticationMethods = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private Optional nativeSocialLogin = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional sso = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcBackchannelLogout = Optional.empty(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateClientRequestContent other) { + name(other.getName()); + description(other.getDescription()); + logoUri(other.getLogoUri()); + callbacks(other.getCallbacks()); + oidcLogout(other.getOidcLogout()); + oidcBackchannelLogout(other.getOidcBackchannelLogout()); + sessionTransfer(other.getSessionTransfer()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + grantTypes(other.getGrantTypes()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + appType(other.getAppType()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + jwtConfiguration(other.getJwtConfiguration()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + ssoDisabled(other.getSsoDisabled()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + nativeSocialLogin(other.getNativeSocialLogin()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ *

Name of this client (min length: 1 character, does not allow < or >).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @java.lang.Override + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public _FinalStage resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + @java.lang.Override + public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public _FinalStage tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @java.lang.Override + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public _FinalStage parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + @java.lang.Override + public _FinalStage complianceLevel( + com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public _FinalStage complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + @java.lang.Override + public _FinalStage signedRequestObject(ClientSignedRequestObjectWithPublicKey signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @java.lang.Override + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public _FinalStage signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @java.lang.Override + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public _FinalStage requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @java.lang.Override + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public _FinalStage requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + @java.lang.Override + public _FinalStage clientAuthenticationMethods(ClientCreateAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = Optional.ofNullable(clientAuthenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public _FinalStage clientAuthenticationMethods( + Optional clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + @java.lang.Override + public _FinalStage organizationRequireBehavior( + ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public _FinalStage organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + @java.lang.Override + public _FinalStage organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public _FinalStage organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + @java.lang.Override + public _FinalStage defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + @java.lang.Override + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public _FinalStage defaultOrganization( + @Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + @java.lang.Override + public _FinalStage refreshToken( + com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + @java.lang.Override + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public _FinalStage refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + @java.lang.Override + public _FinalStage nativeSocialLogin(NativeSocialLogin nativeSocialLogin) { + this.nativeSocialLogin = Optional.ofNullable(nativeSocialLogin); + return this; + } + + @java.lang.Override + @JsonSetter(value = "native_social_login", nulls = Nulls.SKIP) + public _FinalStage nativeSocialLogin(Optional nativeSocialLogin) { + this.nativeSocialLogin = nativeSocialLogin; + return this; + } + + /** + *

Initiate login uri, must be https

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @java.lang.Override + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public _FinalStage initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + @java.lang.Override + public _FinalStage mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public _FinalStage mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + @java.lang.Override + public _FinalStage clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public _FinalStage clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + @java.lang.Override + public _FinalStage addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @java.lang.Override + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public _FinalStage addons(Optional addons) { + this.addons = addons; + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @java.lang.Override + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public _FinalStage formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @java.lang.Override + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public _FinalStage customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @java.lang.Override + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public _FinalStage customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + /** + *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

+ */ + @java.lang.Override + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public _FinalStage customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + /** + *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

+ */ + @java.lang.Override + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public _FinalStage ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @java.lang.Override + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public _FinalStage crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @java.lang.Override + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public _FinalStage crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @java.lang.Override + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public _FinalStage sso(Optional sso) { + this.sso = sso; + return this; + } + + @java.lang.Override + public _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public _FinalStage encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + @java.lang.Override + public _FinalStage jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public _FinalStage jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @java.lang.Override + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public _FinalStage oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + /** + *

Whether this client a first party client or not

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client a first party client or not

+ */ + @java.lang.Override + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public _FinalStage isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + @java.lang.Override + public _FinalStage appType(ClientAppTypeEnum appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public _FinalStage appType(Optional appType) { + this.appType = appType; + return this; + } + + @java.lang.Override + public _FinalStage tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthMethod( + Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @java.lang.Override + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public _FinalStage grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @java.lang.Override + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @java.lang.Override + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public _FinalStage allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @java.lang.Override + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public _FinalStage clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @java.lang.Override + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public _FinalStage webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @java.lang.Override + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public _FinalStage allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + @java.lang.Override + public _FinalStage sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + @java.lang.Override + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public _FinalStage sessionTransfer( + @Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + @java.lang.Override + public _FinalStage oidcBackchannelLogout(ClientOidcBackchannelLogoutSettings oidcBackchannelLogout) { + this.oidcBackchannelLogout = Optional.ofNullable(oidcBackchannelLogout); + return this; + } + + @java.lang.Override + @JsonSetter(value = "oidc_backchannel_logout", nulls = Nulls.SKIP) + public _FinalStage oidcBackchannelLogout(Optional oidcBackchannelLogout) { + this.oidcBackchannelLogout = oidcBackchannelLogout; + return this; + } + + @java.lang.Override + public _FinalStage oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + @java.lang.Override + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public _FinalStage oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @java.lang.Override + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public _FinalStage callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @java.lang.Override + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public _FinalStage logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CreateClientRequestContent build() { + return new CreateClientRequestContent( + name, + description, + logoUri, + callbacks, + oidcLogout, + oidcBackchannelLogout, + sessionTransfer, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + grantTypes, + tokenEndpointAuthMethod, + appType, + isFirstParty, + oidcConformant, + jwtConfiguration, + encryptionKey, + sso, + crossOriginAuthentication, + crossOriginLoc, + ssoDisabled, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + clientMetadata, + mobile, + initiateLoginUri, + nativeSocialLogin, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + resourceServerIdentifier, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java new file mode 100644 index 000000000..3a29b128b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java @@ -0,0 +1,1663 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateClientResponseContent.Builder.class) +public final class CreateClientResponseContent { + private final Optional clientId; + + private final Optional tenant; + + private final Optional name; + + private final Optional description; + + private final Optional global; + + private final Optional clientSecret; + + private final Optional appType; + + private final Optional logoUri; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional> callbacks; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final OptionalNullable sessionTransfer; + + private final Optional oidcLogout; + + private final Optional> grantTypes; + + private final Optional jwtConfiguration; + + private final Optional> signingKeys; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional ssoDisabled; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional tokenEndpointAuthMethod; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private CreateClientResponseContent( + Optional clientId, + Optional tenant, + Optional name, + Optional description, + Optional global, + Optional clientSecret, + Optional appType, + Optional logoUri, + Optional isFirstParty, + Optional oidcConformant, + Optional> callbacks, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + OptionalNullable sessionTransfer, + Optional oidcLogout, + Optional> grantTypes, + Optional jwtConfiguration, + Optional> signingKeys, + OptionalNullable encryptionKey, + Optional sso, + Optional ssoDisabled, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional tokenEndpointAuthMethod, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Map additionalProperties) { + this.clientId = clientId; + this.tenant = tenant; + this.name = name; + this.description = description; + this.global = global; + this.clientSecret = clientSecret; + this.appType = appType; + this.logoUri = logoUri; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.callbacks = callbacks; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionTransfer = sessionTransfer; + this.oidcLogout = oidcLogout; + this.grantTypes = grantTypes; + this.jwtConfiguration = jwtConfiguration; + this.signingKeys = signingKeys; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.ssoDisabled = ssoDisabled; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the tenant this client belongs to. + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). + */ + @JsonProperty("global") + public Optional getGlobal() { + return global; + } + + /** + * @return Client secret (which you must not make public). + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. + */ + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Whether this client a first party client (true) or not (false). + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonProperty("signing_keys") + public Optional> getSigningKeys() { + return signingKeys; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether Single Sign On is disabled (true) or enabled (true). Defaults to true. + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return Whether a custom login page is to be used (true) or the default provided login page (false). + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateClientResponseContent && equalTo((CreateClientResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateClientResponseContent other) { + return clientId.equals(other.clientId) + && tenant.equals(other.tenant) + && name.equals(other.name) + && description.equals(other.description) + && global.equals(other.global) + && clientSecret.equals(other.clientSecret) + && appType.equals(other.appType) + && logoUri.equals(other.logoUri) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && callbacks.equals(other.callbacks) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionTransfer.equals(other.sessionTransfer) + && oidcLogout.equals(other.oidcLogout) + && grantTypes.equals(other.grantTypes) + && jwtConfiguration.equals(other.jwtConfiguration) + && signingKeys.equals(other.signingKeys) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && ssoDisabled.equals(other.ssoDisabled) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.tenant, + this.name, + this.description, + this.global, + this.clientSecret, + this.appType, + this.logoUri, + this.isFirstParty, + this.oidcConformant, + this.callbacks, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.sessionTransfer, + this.oidcLogout, + this.grantTypes, + this.jwtConfiguration, + this.signingKeys, + this.encryptionKey, + this.sso, + this.ssoDisabled, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.tokenEndpointAuthMethod, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional global = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional> signingKeys = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private Optional organizationUsage = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateClientResponseContent other) { + clientId(other.getClientId()); + tenant(other.getTenant()); + name(other.getName()); + description(other.getDescription()); + global(other.getGlobal()); + clientSecret(other.getClientSecret()); + appType(other.getAppType()); + logoUri(other.getLogoUri()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + callbacks(other.getCallbacks()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionTransfer(other.getSessionTransfer()); + oidcLogout(other.getOidcLogout()); + grantTypes(other.getGrantTypes()); + jwtConfiguration(other.getJwtConfiguration()); + signingKeys(other.getSigningKeys()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + ssoDisabled(other.getSsoDisabled()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

ID of this client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the tenant this client belongs to.

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).

+ */ + @JsonSetter(value = "global", nulls = Nulls.SKIP) + public Builder global(Optional global) { + this.global = global; + return this; + } + + public Builder global(Boolean global) { + this.global = Optional.ofNullable(global); + return this; + } + + /** + *

Client secret (which you must not make public).

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

Whether this client a first party client (true) or not (false).

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "signing_keys", nulls = Nulls.SKIP) + public Builder signingKeys(Optional> signingKeys) { + this.signingKeys = signingKeys; + return this; + } + + public Builder signingKeys(List signingKeys) { + this.signingKeys = Optional.ofNullable(signingKeys); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Whether Single Sign On is disabled (true) or enabled (true). Defaults to true.

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

Whether a custom login page is to be used (true) or the default provided login page (false).

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public CreateClientResponseContent build() { + return new CreateClientResponseContent( + clientId, + tenant, + name, + description, + global, + clientSecret, + appType, + logoUri, + isFirstParty, + oidcConformant, + callbacks, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + sessionTransfer, + oidcLogout, + grantTypes, + jwtConfiguration, + signingKeys, + encryptionKey, + sso, + ssoDisabled, + crossOriginAuthentication, + crossOriginLoc, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + tokenEndpointAuthMethod, + clientMetadata, + mobile, + initiateLoginUri, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java new file mode 100644 index 000000000..26348d2ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java @@ -0,0 +1,436 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContent.Builder.class) +public final class CreateConnectionRequestContent { + private final String name; + + private final Optional displayName; + + private final ConnectionIdentityProviderEnum strategy; + + private final Optional options; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> realms; + + private final Optional> metadata; + + private final Map additionalProperties; + + private CreateConnectionRequestContent( + String name, + Optional displayName, + ConnectionIdentityProviderEnum strategy, + Optional options, + Optional> enabledClients, + Optional isDomainConnection, + Optional showAsButton, + Optional> realms, + Optional> metadata, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.strategy = strategy; + this.options = options; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.realms = realms; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128 + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Connection name used in the new universal login experience + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("strategy") + public ConnectionIdentityProviderEnum getStrategy() { + return strategy; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + /** + * @return DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients. + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return <code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.) + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.) + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContent && equalTo((CreateConnectionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContent other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && strategy.equals(other.strategy) + && options.equals(other.options) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && realms.equals(other.realms) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.displayName, + this.strategy, + this.options, + this.enabledClients, + this.isDomainConnection, + this.showAsButton, + this.realms, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128

+ */ + StrategyStage name(@NotNull String name); + + Builder from(CreateConnectionRequestContent other); + } + + public interface StrategyStage { + _FinalStage strategy(@NotNull ConnectionIdentityProviderEnum strategy); + } + + public interface _FinalStage { + CreateConnectionRequestContent build(); + + /** + *

Connection name used in the new universal login experience

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage options(Optional options); + + _FinalStage options(ConnectionPropertiesOptions options); + + /** + *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

+ */ + _FinalStage enabledClients(Optional> enabledClients); + + _FinalStage enabledClients(List enabledClients); + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ */ + _FinalStage isDomainConnection(Optional isDomainConnection); + + _FinalStage isDomainConnection(Boolean isDomainConnection); + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + _FinalStage realms(Optional> realms); + + _FinalStage realms(List realms); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, StrategyStage, _FinalStage { + private String name; + + private ConnectionIdentityProviderEnum strategy; + + private Optional> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional options = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateConnectionRequestContent other) { + name(other.getName()); + displayName(other.getDisplayName()); + strategy(other.getStrategy()); + options(other.getOptions()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + realms(other.getRealms()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128

+ *

The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public StrategyStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("strategy") + public _FinalStage strategy(@NotNull ConnectionIdentityProviderEnum strategy) { + this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @java.lang.Override + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public _FinalStage realms(Optional> realms) { + this.realms = realms; + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ */ + @java.lang.Override + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public _FinalStage isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + /** + *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

+ */ + @java.lang.Override + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public _FinalStage enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + @java.lang.Override + public _FinalStage options(ConnectionPropertiesOptions options) { + this.options = Optional.ofNullable(options); + return this; + } + + @java.lang.Override + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public _FinalStage options(Optional options) { + this.options = options; + return this; + } + + /** + *

Connection name used in the new universal login experience

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Connection name used in the new universal login experience

+ */ + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public CreateConnectionRequestContent build() { + return new CreateConnectionRequestContent( + name, + displayName, + strategy, + options, + enabledClients, + isDomainConnection, + showAsButton, + realms, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java new file mode 100644 index 000000000..027081345 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionResponseContent.Builder.class) +public final class CreateConnectionResponseContent { + private final Optional name; + + private final Optional displayName; + + private final Optional> options; + + private final Optional id; + + private final Optional strategy; + + private final Optional> realms; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> metadata; + + private final Map additionalProperties; + + private CreateConnectionResponseContent( + Optional name, + Optional displayName, + Optional> options, + Optional id, + Optional strategy, + Optional> realms, + Optional> enabledClients, + Optional isDomainConnection, + Optional showAsButton, + Optional> metadata, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.options = options; + this.id = id; + this.strategy = strategy; + this.realms = realms; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Connection name used in login screen + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The type of the connection, related to the identity provider + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + /** + * @return DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return True if the connection is domain level + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionResponseContent && equalTo((CreateConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionResponseContent other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && options.equals(other.options) + && id.equals(other.id) + && strategy.equals(other.strategy) + && realms.equals(other.realms) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.displayName, + this.options, + this.id, + this.strategy, + this.realms, + this.enabledClients, + this.isDomainConnection, + this.showAsButton, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionResponseContent other) { + name(other.getName()); + displayName(other.getDisplayName()); + options(other.getOptions()); + id(other.getId()); + strategy(other.getStrategy()); + realms(other.getRealms()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The name of the connection

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Connection name used in login screen

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The type of the connection, related to the identity provider

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + /** + *

DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled

+ */ + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

True if the connection is domain level

+ */ + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public CreateConnectionResponseContent build() { + return new CreateConnectionResponseContent( + name, + displayName, + options, + id, + strategy, + realms, + enabledClients, + isDomainConnection, + showAsButton, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java new file mode 100644 index 000000000..36e4c4047 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateCustomDomainRequestContent.Builder.class) +public final class CreateCustomDomainRequestContent { + private final String domain; + + private final CustomDomainProvisioningTypeEnum type; + + private final Optional verificationMethod; + + private final Optional tlsPolicy; + + private final OptionalNullable customClientIpHeader; + + private final Map additionalProperties; + + private CreateCustomDomainRequestContent( + String domain, + CustomDomainProvisioningTypeEnum type, + Optional verificationMethod, + Optional tlsPolicy, + OptionalNullable customClientIpHeader, + Map additionalProperties) { + this.domain = domain; + this.type = type; + this.verificationMethod = verificationMethod; + this.tlsPolicy = tlsPolicy; + this.customClientIpHeader = customClientIpHeader; + this.additionalProperties = additionalProperties; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("type") + public CustomDomainProvisioningTypeEnum getType() { + return type; + } + + @JsonProperty("verification_method") + public Optional getVerificationMethod() { + return verificationMethod; + } + + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateCustomDomainRequestContent && equalTo((CreateCustomDomainRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateCustomDomainRequestContent other) { + return domain.equals(other.domain) + && type.equals(other.type) + && verificationMethod.equals(other.verificationMethod) + && tlsPolicy.equals(other.tlsPolicy) + && customClientIpHeader.equals(other.customClientIpHeader); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.domain, this.type, this.verificationMethod, this.tlsPolicy, this.customClientIpHeader); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DomainStage builder() { + return new Builder(); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + TypeStage domain(@NotNull String domain); + + Builder from(CreateCustomDomainRequestContent other); + } + + public interface TypeStage { + _FinalStage type(@NotNull CustomDomainProvisioningTypeEnum type); + } + + public interface _FinalStage { + CreateCustomDomainRequestContent build(); + + _FinalStage verificationMethod(Optional verificationMethod); + + _FinalStage verificationMethod(String verificationMethod); + + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage customClientIpHeader(OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(CustomDomainCustomClientIpHeaderEnum customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(Nullable customClientIpHeader); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DomainStage, TypeStage, _FinalStage { + private String domain; + + private CustomDomainProvisioningTypeEnum type; + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + private Optional tlsPolicy = Optional.empty(); + + private Optional verificationMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateCustomDomainRequestContent other) { + domain(other.getDomain()); + type(other.getType()); + verificationMethod(other.getVerificationMethod()); + tlsPolicy(other.getTlsPolicy()); + customClientIpHeader(other.getCustomClientIpHeader()); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public TypeStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CustomDomainProvisioningTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage customClientIpHeader(Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage customClientIpHeader(CustomDomainCustomClientIpHeaderEnum customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader( + OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + @java.lang.Override + public _FinalStage verificationMethod(String verificationMethod) { + this.verificationMethod = Optional.ofNullable(verificationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "verification_method", nulls = Nulls.SKIP) + public _FinalStage verificationMethod(Optional verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + + @java.lang.Override + public CreateCustomDomainRequestContent build() { + return new CreateCustomDomainRequestContent( + domain, type, verificationMethod, tlsPolicy, customClientIpHeader, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java new file mode 100644 index 000000000..ec3c41056 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateCustomDomainResponseContent.Builder.class) +public final class CreateCustomDomainResponseContent { + private final String customDomainId; + + private final String domain; + + private final boolean primary; + + private final CustomDomainTypeEnum type; + + private final DomainVerification verification; + + private final OptionalNullable customClientIpHeader; + + private final Optional tlsPolicy; + + private final Map additionalProperties; + + private CreateCustomDomainResponseContent( + String customDomainId, + String domain, + boolean primary, + CustomDomainTypeEnum type, + DomainVerification verification, + OptionalNullable customClientIpHeader, + Optional tlsPolicy, + Map additionalProperties) { + this.customDomainId = customDomainId; + this.domain = domain; + this.primary = primary; + this.type = type; + this.verification = verification; + this.customClientIpHeader = customClientIpHeader; + this.tlsPolicy = tlsPolicy; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the custom domain. + */ + @JsonProperty("custom_domain_id") + public String getCustomDomainId() { + return customDomainId; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + /** + * @return Whether this is a primary domain (true) or not (false). + */ + @JsonProperty("primary") + public boolean getPrimary() { + return primary; + } + + @JsonProperty("type") + public CustomDomainTypeEnum getType() { + return type; + } + + @JsonProperty("verification") + public DomainVerification getVerification() { + return verification; + } + + /** + * @return The HTTP header to fetch the client's IP address + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + if (customClientIpHeader == null) { + return OptionalNullable.absent(); + } + return customClientIpHeader; + } + + /** + * @return The TLS version policy + */ + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + private OptionalNullable _getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateCustomDomainResponseContent && equalTo((CreateCustomDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateCustomDomainResponseContent other) { + return customDomainId.equals(other.customDomainId) + && domain.equals(other.domain) + && primary == other.primary + && type.equals(other.type) + && verification.equals(other.verification) + && customClientIpHeader.equals(other.customClientIpHeader) + && tlsPolicy.equals(other.tlsPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customDomainId, + this.domain, + this.primary, + this.type, + this.verification, + this.customClientIpHeader, + this.tlsPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CustomDomainIdStage builder() { + return new Builder(); + } + + public interface CustomDomainIdStage { + /** + *

ID of the custom domain.

+ */ + DomainStage customDomainId(@NotNull String customDomainId); + + Builder from(CreateCustomDomainResponseContent other); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + PrimaryStage domain(@NotNull String domain); + } + + public interface PrimaryStage { + /** + *

Whether this is a primary domain (true) or not (false).

+ */ + TypeStage primary(boolean primary); + } + + public interface TypeStage { + VerificationStage type(@NotNull CustomDomainTypeEnum type); + } + + public interface VerificationStage { + _FinalStage verification(@NotNull DomainVerification verification); + } + + public interface _FinalStage { + CreateCustomDomainResponseContent build(); + + /** + *

The HTTP header to fetch the client's IP address

+ */ + _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(String customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader); + + /** + *

The TLS version policy

+ */ + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, VerificationStage, _FinalStage { + private String customDomainId; + + private String domain; + + private boolean primary; + + private CustomDomainTypeEnum type; + + private DomainVerification verification; + + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateCustomDomainResponseContent other) { + customDomainId(other.getCustomDomainId()); + domain(other.getDomain()); + primary(other.getPrimary()); + type(other.getType()); + verification(other.getVerification()); + customClientIpHeader(other.getCustomClientIpHeader()); + tlsPolicy(other.getTlsPolicy()); + return this; + } + + /** + *

ID of the custom domain.

+ *

ID of the custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("custom_domain_id") + public DomainStage customDomainId(@NotNull String customDomainId) { + this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public PrimaryStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + /** + *

Whether this is a primary domain (true) or not (false).

+ *

Whether this is a primary domain (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public TypeStage primary(boolean primary) { + this.primary = primary; + return this; + } + + @java.lang.Override + @JsonSetter("type") + public VerificationStage type(@NotNull CustomDomainTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("verification") + public _FinalStage verification(@NotNull DomainVerification verification) { + this.verification = Objects.requireNonNull(verification, "verification must not be null"); + return this; + } + + /** + *

The TLS version policy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + /** + *

The TLS version policy

+ */ + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(String customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ */ + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public CreateCustomDomainResponseContent build() { + return new CreateCustomDomainResponseContent( + customDomainId, + domain, + primary, + type, + verification, + customClientIpHeader, + tlsPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java new file mode 100644 index 000000000..25db1c9d6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEmailProviderResponseContent.Builder.class) +public final class CreateEmailProviderResponseContent { + private final Optional name; + + private final Optional enabled; + + private final Optional defaultFromAddress; + + private final Optional credentials; + + private final Optional> settings; + + private final Map additionalProperties; + + private CreateEmailProviderResponseContent( + Optional name, + Optional enabled, + Optional defaultFromAddress, + Optional credentials, + Optional> settings, + Map additionalProperties) { + this.name = name; + this.enabled = enabled; + this.defaultFromAddress = defaultFromAddress; + this.credentials = credentials; + this.settings = settings; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the provider is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Email address to use as "from" when no other address specified. + */ + @JsonProperty("default_from_address") + public Optional getDefaultFromAddress() { + return defaultFromAddress; + } + + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @JsonProperty("settings") + public Optional> getSettings() { + return settings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEmailProviderResponseContent + && equalTo((CreateEmailProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEmailProviderResponseContent other) { + return name.equals(other.name) + && enabled.equals(other.enabled) + && defaultFromAddress.equals(other.defaultFromAddress) + && credentials.equals(other.credentials) + && settings.equals(other.settings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional defaultFromAddress = Optional.empty(); + + private Optional credentials = Optional.empty(); + + private Optional> settings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateEmailProviderResponseContent other) { + name(other.getName()); + enabled(other.getEnabled()); + defaultFromAddress(other.getDefaultFromAddress()); + credentials(other.getCredentials()); + settings(other.getSettings()); + return this; + } + + /** + *

Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ */ + @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) + public Builder defaultFromAddress(Optional defaultFromAddress) { + this.defaultFromAddress = defaultFromAddress; + return this; + } + + public Builder defaultFromAddress(String defaultFromAddress) { + this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(EmailProviderCredentials credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + @JsonSetter(value = "settings", nulls = Nulls.SKIP) + public Builder settings(Optional> settings) { + this.settings = settings; + return this; + } + + public Builder settings(Map settings) { + this.settings = Optional.ofNullable(settings); + return this; + } + + public CreateEmailProviderResponseContent build() { + return new CreateEmailProviderResponseContent( + name, enabled, defaultFromAddress, credentials, settings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java new file mode 100644 index 000000000..646bb455c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java @@ -0,0 +1,780 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEmailTemplateRequestContent.Builder.class) +public final class CreateEmailTemplateRequestContent { + private final EmailTemplateNameEnum template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private CreateEmailTemplateRequestContent( + EmailTemplateNameEnum template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public EmailTemplateNameEnum getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEmailTemplateRequestContent && equalTo((CreateEmailTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEmailTemplateRequestContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateStage builder() { + return new Builder(); + } + + public interface TemplateStage { + _FinalStage template(@NotNull EmailTemplateNameEnum template); + + Builder from(CreateEmailTemplateRequestContent other); + } + + public interface _FinalStage { + CreateEmailTemplateRequestContent build(); + + /** + *

Body of the email template.

+ */ + _FinalStage body(@Nullable OptionalNullable body); + + _FinalStage body(String body); + + _FinalStage body(Optional body); + + _FinalStage body(com.auth0.client.mgmt.core.Nullable body); + + /** + *

Senders from email address.

+ */ + _FinalStage from(@Nullable OptionalNullable from); + + _FinalStage from(String from); + + _FinalStage from(Optional from); + + _FinalStage from(com.auth0.client.mgmt.core.Nullable from); + + /** + *

URL to redirect the user to after a successful action.

+ */ + _FinalStage resultUrl(@Nullable OptionalNullable resultUrl); + + _FinalStage resultUrl(String resultUrl); + + _FinalStage resultUrl(Optional resultUrl); + + _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl); + + /** + *

Subject line of the email.

+ */ + _FinalStage subject(@Nullable OptionalNullable subject); + + _FinalStage subject(String subject); + + _FinalStage subject(Optional subject); + + _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject); + + /** + *

Syntax of the template body.

+ */ + _FinalStage syntax(@Nullable OptionalNullable syntax); + + _FinalStage syntax(String syntax); + + _FinalStage syntax(Optional syntax); + + _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax); + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds); + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect); + + _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect); + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(@Nullable OptionalNullable enabled); + + _FinalStage enabled(Boolean enabled); + + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateStage, _FinalStage { + private EmailTemplateNameEnum template; + + private OptionalNullable enabled = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable body = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEmailTemplateRequestContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @java.lang.Override + @JsonSetter("template") + public _FinalStage template(@NotNull EmailTemplateNameEnum template) { + this.template = Objects.requireNonNull(template, "template must not be null"); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @java.lang.Override + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @java.lang.Override + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + /** + *

Syntax of the template body.

+ */ + @java.lang.Override + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public _FinalStage syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + /** + *

Subject line of the email.

+ */ + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @java.lang.Override + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + /** + *

Senders from email address.

+ */ + @java.lang.Override + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public _FinalStage from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + /** + *

Body of the email template.

+ */ + @java.lang.Override + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public _FinalStage body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + @java.lang.Override + public CreateEmailTemplateRequestContent build() { + return new CreateEmailTemplateRequestContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java new file mode 100644 index 000000000..3eac25b69 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java @@ -0,0 +1,781 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEmailTemplateResponseContent.Builder.class) +public final class CreateEmailTemplateResponseContent { + private final EmailTemplateNameEnum template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private CreateEmailTemplateResponseContent( + EmailTemplateNameEnum template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public EmailTemplateNameEnum getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEmailTemplateResponseContent + && equalTo((CreateEmailTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEmailTemplateResponseContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateStage builder() { + return new Builder(); + } + + public interface TemplateStage { + _FinalStage template(@NotNull EmailTemplateNameEnum template); + + Builder from(CreateEmailTemplateResponseContent other); + } + + public interface _FinalStage { + CreateEmailTemplateResponseContent build(); + + /** + *

Body of the email template.

+ */ + _FinalStage body(@Nullable OptionalNullable body); + + _FinalStage body(String body); + + _FinalStage body(Optional body); + + _FinalStage body(com.auth0.client.mgmt.core.Nullable body); + + /** + *

Senders from email address.

+ */ + _FinalStage from(@Nullable OptionalNullable from); + + _FinalStage from(String from); + + _FinalStage from(Optional from); + + _FinalStage from(com.auth0.client.mgmt.core.Nullable from); + + /** + *

URL to redirect the user to after a successful action.

+ */ + _FinalStage resultUrl(@Nullable OptionalNullable resultUrl); + + _FinalStage resultUrl(String resultUrl); + + _FinalStage resultUrl(Optional resultUrl); + + _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl); + + /** + *

Subject line of the email.

+ */ + _FinalStage subject(@Nullable OptionalNullable subject); + + _FinalStage subject(String subject); + + _FinalStage subject(Optional subject); + + _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject); + + /** + *

Syntax of the template body.

+ */ + _FinalStage syntax(@Nullable OptionalNullable syntax); + + _FinalStage syntax(String syntax); + + _FinalStage syntax(Optional syntax); + + _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax); + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds); + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect); + + _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect); + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(@Nullable OptionalNullable enabled); + + _FinalStage enabled(Boolean enabled); + + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateStage, _FinalStage { + private EmailTemplateNameEnum template; + + private OptionalNullable enabled = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable body = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEmailTemplateResponseContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @java.lang.Override + @JsonSetter("template") + public _FinalStage template(@NotNull EmailTemplateNameEnum template) { + this.template = Objects.requireNonNull(template, "template must not be null"); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @java.lang.Override + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @java.lang.Override + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + /** + *

Syntax of the template body.

+ */ + @java.lang.Override + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public _FinalStage syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + /** + *

Subject line of the email.

+ */ + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @java.lang.Override + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + /** + *

Senders from email address.

+ */ + @java.lang.Override + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public _FinalStage from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + /** + *

Body of the email template.

+ */ + @java.lang.Override + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public _FinalStage body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + @java.lang.Override + public CreateEmailTemplateResponseContent build() { + return new CreateEmailTemplateResponseContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java new file mode 100644 index 000000000..51f55216c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEncryptionKeyPublicWrappingResponseContent.Builder.class) +public final class CreateEncryptionKeyPublicWrappingResponseContent { + private final String publicKey; + + private final String algorithm; + + private final Map additionalProperties; + + private CreateEncryptionKeyPublicWrappingResponseContent( + String publicKey, String algorithm, Map additionalProperties) { + this.publicKey = publicKey; + this.algorithm = algorithm; + this.additionalProperties = additionalProperties; + } + + /** + * @return Public wrapping key in PEM format + */ + @JsonProperty("public_key") + public String getPublicKey() { + return publicKey; + } + + @JsonProperty("algorithm") + public String getAlgorithm() { + return algorithm; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEncryptionKeyPublicWrappingResponseContent + && equalTo((CreateEncryptionKeyPublicWrappingResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEncryptionKeyPublicWrappingResponseContent other) { + return publicKey.equals(other.publicKey) && algorithm.equals(other.algorithm); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.publicKey, this.algorithm); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PublicKeyStage builder() { + return new Builder(); + } + + public interface PublicKeyStage { + /** + *

Public wrapping key in PEM format

+ */ + AlgorithmStage publicKey(@NotNull String publicKey); + + Builder from(CreateEncryptionKeyPublicWrappingResponseContent other); + } + + public interface AlgorithmStage { + _FinalStage algorithm(@NotNull String algorithm); + } + + public interface _FinalStage { + CreateEncryptionKeyPublicWrappingResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PublicKeyStage, AlgorithmStage, _FinalStage { + private String publicKey; + + private String algorithm; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEncryptionKeyPublicWrappingResponseContent other) { + publicKey(other.getPublicKey()); + algorithm(other.getAlgorithm()); + return this; + } + + /** + *

Public wrapping key in PEM format

+ *

Public wrapping key in PEM format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("public_key") + public AlgorithmStage publicKey(@NotNull String publicKey) { + this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("algorithm") + public _FinalStage algorithm(@NotNull String algorithm) { + this.algorithm = Objects.requireNonNull(algorithm, "algorithm must not be null"); + return this; + } + + @java.lang.Override + public CreateEncryptionKeyPublicWrappingResponseContent build() { + return new CreateEncryptionKeyPublicWrappingResponseContent(publicKey, algorithm, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java new file mode 100644 index 000000000..6b43e7290 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEncryptionKeyResponseContent.Builder.class) +public final class CreateEncryptionKeyResponseContent { + private final String kid; + + private final EncryptionKeyType type; + + private final EncryptionKeyState state; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final String parentKid; + + private final Optional publicKey; + + private final Map additionalProperties; + + private CreateEncryptionKeyResponseContent( + String kid, + EncryptionKeyType type, + EncryptionKeyState state, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + String parentKid, + Optional publicKey, + Map additionalProperties) { + this.kid = kid; + this.type = type; + this.state = state; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.parentKid = parentKid; + this.publicKey = publicKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key ID + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @JsonProperty("type") + public EncryptionKeyType getType() { + return type; + } + + @JsonProperty("state") + public EncryptionKeyState getState() { + return state; + } + + /** + * @return Key creation timestamp + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Key update timestamp + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return ID of parent wrapping key + */ + @JsonProperty("parent_kid") + public String getParentKid() { + return parentKid; + } + + /** + * @return Public key in PEM format + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEncryptionKeyResponseContent + && equalTo((CreateEncryptionKeyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEncryptionKeyResponseContent other) { + return kid.equals(other.kid) + && type.equals(other.type) + && state.equals(other.state) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && parentKid.equals(other.parentKid) + && publicKey.equals(other.publicKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

Key ID

+ */ + TypeStage kid(@NotNull String kid); + + Builder from(CreateEncryptionKeyResponseContent other); + } + + public interface TypeStage { + StateStage type(@NotNull EncryptionKeyType type); + } + + public interface StateStage { + CreatedAtStage state(@NotNull EncryptionKeyState state); + } + + public interface CreatedAtStage { + /** + *

Key creation timestamp

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

Key update timestamp

+ */ + ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface ParentKidStage { + /** + *

ID of parent wrapping key

+ */ + _FinalStage parentKid(@NotNull String parentKid); + } + + public interface _FinalStage { + CreateEncryptionKeyResponseContent build(); + + /** + *

Public key in PEM format

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements KidStage, TypeStage, StateStage, CreatedAtStage, UpdatedAtStage, ParentKidStage, _FinalStage { + private String kid; + + private EncryptionKeyType type; + + private EncryptionKeyState state; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String parentKid; + + private Optional publicKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEncryptionKeyResponseContent other) { + kid(other.getKid()); + type(other.getType()); + state(other.getState()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + parentKid(other.getParentKid()); + publicKey(other.getPublicKey()); + return this; + } + + /** + *

Key ID

+ *

Key ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public TypeStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public StateStage type(@NotNull EncryptionKeyType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("state") + public CreatedAtStage state(@NotNull EncryptionKeyState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + /** + *

Key creation timestamp

+ *

Key creation timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Key update timestamp

+ *

Key update timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

ID of parent wrapping key

+ *

ID of parent wrapping key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parent_kid") + public _FinalStage parentKid(@NotNull String parentKid) { + this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); + return this; + } + + /** + *

Public key in PEM format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Public key in PEM format

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + @java.lang.Override + public CreateEncryptionKeyResponseContent build() { + return new CreateEncryptionKeyResponseContent( + kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java new file mode 100644 index 000000000..8391b512d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateEncryptionKeyType { + public static final CreateEncryptionKeyType CUSTOMER_PROVIDED_ROOT_KEY = + new CreateEncryptionKeyType(Value.CUSTOMER_PROVIDED_ROOT_KEY, "customer-provided-root-key"); + + public static final CreateEncryptionKeyType TENANT_ENCRYPTION_KEY = + new CreateEncryptionKeyType(Value.TENANT_ENCRYPTION_KEY, "tenant-encryption-key"); + + private final Value value; + + private final String string; + + CreateEncryptionKeyType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateEncryptionKeyType + && this.string.equals(((CreateEncryptionKeyType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER_PROVIDED_ROOT_KEY: + return visitor.visitCustomerProvidedRootKey(); + case TENANT_ENCRYPTION_KEY: + return visitor.visitTenantEncryptionKey(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateEncryptionKeyType valueOf(String value) { + switch (value) { + case "customer-provided-root-key": + return CUSTOMER_PROVIDED_ROOT_KEY; + case "tenant-encryption-key": + return TENANT_ENCRYPTION_KEY; + default: + return new CreateEncryptionKeyType(Value.UNKNOWN, value); + } + } + + public enum Value { + CUSTOMER_PROVIDED_ROOT_KEY, + + TENANT_ENCRYPTION_KEY, + + UNKNOWN + } + + public interface Visitor { + T visitCustomerProvidedRootKey(); + + T visitTenantEncryptionKey(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java new file mode 100644 index 000000000..b415797bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamActionRequestContent.Builder.class) +public final class CreateEventStreamActionRequestContent { + private final Optional name; + + private final Optional> subscriptions; + + private final EventStreamActionDestination destination; + + private final Optional status; + + private final Map additionalProperties; + + private CreateEventStreamActionRequestContent( + Optional name, + Optional> subscriptions, + EventStreamActionDestination destination, + Optional status, + Map additionalProperties) { + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public EventStreamActionDestination getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamActionRequestContent + && equalTo((CreateEventStreamActionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamActionRequestContent other) { + return name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subscriptions, this.destination, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DestinationStage builder() { + return new Builder(); + } + + public interface DestinationStage { + _FinalStage destination(@NotNull EventStreamActionDestination destination); + + Builder from(CreateEventStreamActionRequestContent other); + } + + public interface _FinalStage { + CreateEventStreamActionRequestContent build(); + + /** + *

Name of the event stream.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

List of event types subscribed to in this stream.

+ */ + _FinalStage subscriptions(Optional> subscriptions); + + _FinalStage subscriptions(List subscriptions); + + _FinalStage status(Optional status); + + _FinalStage status(EventStreamStatusEnum status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DestinationStage, _FinalStage { + private EventStreamActionDestination destination; + + private Optional status = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEventStreamActionRequestContent other) { + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + return this; + } + + @java.lang.Override + @JsonSetter("destination") + public _FinalStage destination(@NotNull EventStreamActionDestination destination) { + this.destination = Objects.requireNonNull(destination, "destination must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @java.lang.Override + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public _FinalStage subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + *

Name of the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Name of the event stream.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateEventStreamActionRequestContent build() { + return new CreateEventStreamActionRequestContent( + name, subscriptions, destination, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java new file mode 100644 index 000000000..08b37a544 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamEventBridgeRequestContent.Builder.class) +public final class CreateEventStreamEventBridgeRequestContent { + private final Optional name; + + private final Optional> subscriptions; + + private final EventStreamEventBridgeDestination destination; + + private final Optional status; + + private final Map additionalProperties; + + private CreateEventStreamEventBridgeRequestContent( + Optional name, + Optional> subscriptions, + EventStreamEventBridgeDestination destination, + Optional status, + Map additionalProperties) { + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public EventStreamEventBridgeDestination getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamEventBridgeRequestContent + && equalTo((CreateEventStreamEventBridgeRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamEventBridgeRequestContent other) { + return name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subscriptions, this.destination, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DestinationStage builder() { + return new Builder(); + } + + public interface DestinationStage { + _FinalStage destination(@NotNull EventStreamEventBridgeDestination destination); + + Builder from(CreateEventStreamEventBridgeRequestContent other); + } + + public interface _FinalStage { + CreateEventStreamEventBridgeRequestContent build(); + + /** + *

Name of the event stream.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

List of event types subscribed to in this stream.

+ */ + _FinalStage subscriptions(Optional> subscriptions); + + _FinalStage subscriptions(List subscriptions); + + _FinalStage status(Optional status); + + _FinalStage status(EventStreamStatusEnum status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DestinationStage, _FinalStage { + private EventStreamEventBridgeDestination destination; + + private Optional status = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEventStreamEventBridgeRequestContent other) { + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + return this; + } + + @java.lang.Override + @JsonSetter("destination") + public _FinalStage destination(@NotNull EventStreamEventBridgeDestination destination) { + this.destination = Objects.requireNonNull(destination, "destination must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @java.lang.Override + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public _FinalStage subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + *

Name of the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Name of the event stream.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateEventStreamEventBridgeRequestContent build() { + return new CreateEventStreamEventBridgeRequestContent( + name, subscriptions, destination, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java new file mode 100644 index 000000000..3885fbcfc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java @@ -0,0 +1,197 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamRedeliveryResponseContent.Builder.class) +public final class CreateEventStreamRedeliveryResponseContent { + private final Optional dateFrom; + + private final Optional dateTo; + + private final Optional> statuses; + + private final Optional> eventTypes; + + private final Map additionalProperties; + + private CreateEventStreamRedeliveryResponseContent( + Optional dateFrom, + Optional dateTo, + Optional> statuses, + Optional> eventTypes, + Map additionalProperties) { + this.dateFrom = dateFrom; + this.dateTo = dateTo; + this.statuses = statuses; + this.eventTypes = eventTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. + */ + @JsonProperty("date_from") + public Optional getDateFrom() { + return dateFrom; + } + + /** + * @return An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + */ + @JsonProperty("date_to") + public Optional getDateTo() { + return dateTo; + } + + /** + * @return Filter by status + */ + @JsonProperty("statuses") + public Optional> getStatuses() { + return statuses; + } + + /** + * @return Filter by event type + */ + @JsonProperty("event_types") + public Optional> getEventTypes() { + return eventTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamRedeliveryResponseContent + && equalTo((CreateEventStreamRedeliveryResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamRedeliveryResponseContent other) { + return dateFrom.equals(other.dateFrom) + && dateTo.equals(other.dateTo) + && statuses.equals(other.statuses) + && eventTypes.equals(other.eventTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional dateFrom = Optional.empty(); + + private Optional dateTo = Optional.empty(); + + private Optional> statuses = Optional.empty(); + + private Optional> eventTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateEventStreamRedeliveryResponseContent other) { + dateFrom(other.getDateFrom()); + dateTo(other.getDateTo()); + statuses(other.getStatuses()); + eventTypes(other.getEventTypes()); + return this; + } + + /** + *

An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_from", nulls = Nulls.SKIP) + public Builder dateFrom(Optional dateFrom) { + this.dateFrom = dateFrom; + return this; + } + + public Builder dateFrom(OffsetDateTime dateFrom) { + this.dateFrom = Optional.ofNullable(dateFrom); + return this; + } + + /** + *

An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision.

+ */ + @JsonSetter(value = "date_to", nulls = Nulls.SKIP) + public Builder dateTo(Optional dateTo) { + this.dateTo = dateTo; + return this; + } + + public Builder dateTo(OffsetDateTime dateTo) { + this.dateTo = Optional.ofNullable(dateTo); + return this; + } + + /** + *

Filter by status

+ */ + @JsonSetter(value = "statuses", nulls = Nulls.SKIP) + public Builder statuses(Optional> statuses) { + this.statuses = statuses; + return this; + } + + public Builder statuses(List statuses) { + this.statuses = Optional.ofNullable(statuses); + return this; + } + + /** + *

Filter by event type

+ */ + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public Builder eventTypes(Optional> eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder eventTypes(List eventTypes) { + this.eventTypes = Optional.ofNullable(eventTypes); + return this; + } + + public CreateEventStreamRedeliveryResponseContent build() { + return new CreateEventStreamRedeliveryResponseContent( + dateFrom, dateTo, statuses, eventTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java new file mode 100644 index 000000000..e8a0edb1b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateEventStreamResponseContent.Deserializer.class) +public final class CreateEventStreamResponseContent { + private final Object value; + + private final int type; + + private CreateEventStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookResponseContent) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamEventBridgeResponseContent) this.value); + } else if (this.type == 2) { + return visitor.visit((EventStreamActionResponseContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamResponseContent && equalTo((CreateEventStreamResponseContent) other); + } + + private boolean equalTo(CreateEventStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateEventStreamResponseContent of(EventStreamWebhookResponseContent value) { + return new CreateEventStreamResponseContent(value, 0); + } + + public static CreateEventStreamResponseContent of(EventStreamEventBridgeResponseContent value) { + return new CreateEventStreamResponseContent(value, 1); + } + + public static CreateEventStreamResponseContent of(EventStreamActionResponseContent value) { + return new CreateEventStreamResponseContent(value, 2); + } + + public interface Visitor { + T visit(EventStreamWebhookResponseContent value); + + T visit(EventStreamEventBridgeResponseContent value); + + T visit(EventStreamActionResponseContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateEventStreamResponseContent.class); + } + + @java.lang.Override + public CreateEventStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamEventBridgeResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamActionResponseContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventRequestContent.java new file mode 100644 index 000000000..0909fa7f5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventRequestContent.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamTestEventRequestContent.Builder.class) +public final class CreateEventStreamTestEventRequestContent { + private final EventStreamTestEventTypeEnum eventType; + + private final Optional> data; + + private final Map additionalProperties; + + private CreateEventStreamTestEventRequestContent( + EventStreamTestEventTypeEnum eventType, + Optional> data, + Map additionalProperties) { + this.eventType = eventType; + this.data = data; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event_type") + public EventStreamTestEventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("data") + public Optional> getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamTestEventRequestContent + && equalTo((CreateEventStreamTestEventRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamTestEventRequestContent other) { + return eventType.equals(other.eventType) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.eventType, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventTypeStage builder() { + return new Builder(); + } + + public interface EventTypeStage { + _FinalStage eventType(@NotNull EventStreamTestEventTypeEnum eventType); + + Builder from(CreateEventStreamTestEventRequestContent other); + } + + public interface _FinalStage { + CreateEventStreamTestEventRequestContent build(); + + _FinalStage data(Optional> data); + + _FinalStage data(Map data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventTypeStage, _FinalStage { + private EventStreamTestEventTypeEnum eventType; + + private Optional> data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEventStreamTestEventRequestContent other) { + eventType(other.getEventType()); + data(other.getData()); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public _FinalStage eventType(@NotNull EventStreamTestEventTypeEnum eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage data(Map data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional> data) { + this.data = data; + return this; + } + + @java.lang.Override + public CreateEventStreamTestEventRequestContent build() { + return new CreateEventStreamTestEventRequestContent(eventType, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java new file mode 100644 index 000000000..bfdea88f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamTestEventResponseContent.Builder.class) +public final class CreateEventStreamTestEventResponseContent { + private final String id; + + private final String eventStreamId; + + private final String status; + + private final EventStreamDeliveryEventTypeEnum eventType; + + private final List attempts; + + private final Optional event; + + private final Map additionalProperties; + + private CreateEventStreamTestEventResponseContent( + String id, + String eventStreamId, + String status, + EventStreamDeliveryEventTypeEnum eventType, + List attempts, + Optional event, + Map additionalProperties) { + this.id = id; + this.eventStreamId = eventStreamId; + this.status = status; + this.eventType = eventType; + this.attempts = attempts; + this.event = event; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the delivery + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("event_stream_id") + public String getEventStreamId() { + return eventStreamId; + } + + @JsonProperty("status") + public String getStatus() { + return status; + } + + @JsonProperty("event_type") + public EventStreamDeliveryEventTypeEnum getEventType() { + return eventType; + } + + /** + * @return Results of delivery attempts + */ + @JsonProperty("attempts") + public List getAttempts() { + return attempts; + } + + @JsonProperty("event") + public Optional getEvent() { + return event; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamTestEventResponseContent + && equalTo((CreateEventStreamTestEventResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamTestEventResponseContent other) { + return id.equals(other.id) + && eventStreamId.equals(other.eventStreamId) + && status.equals(other.status) + && eventType.equals(other.eventType) + && attempts.equals(other.attempts) + && event.equals(other.event); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Unique identifier for the delivery

+ */ + EventStreamIdStage id(@NotNull String id); + + Builder from(CreateEventStreamTestEventResponseContent other); + } + + public interface EventStreamIdStage { + /** + *

Unique identifier for the event stream.

+ */ + StatusStage eventStreamId(@NotNull String eventStreamId); + } + + public interface StatusStage { + EventTypeStage status(@NotNull String status); + } + + public interface EventTypeStage { + _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType); + } + + public interface _FinalStage { + CreateEventStreamTestEventResponseContent build(); + + /** + *

Results of delivery attempts

+ */ + _FinalStage attempts(List attempts); + + _FinalStage addAttempts(EventStreamDeliveryAttempt attempts); + + _FinalStage addAllAttempts(List attempts); + + _FinalStage event(Optional event); + + _FinalStage event(EventStreamCloudEvent event); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, EventStreamIdStage, StatusStage, EventTypeStage, _FinalStage { + private String id; + + private String eventStreamId; + + private String status; + + private EventStreamDeliveryEventTypeEnum eventType; + + private Optional event = Optional.empty(); + + private List attempts = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEventStreamTestEventResponseContent other) { + id(other.getId()); + eventStreamId(other.getEventStreamId()); + status(other.getStatus()); + eventType(other.getEventType()); + attempts(other.getAttempts()); + event(other.getEvent()); + return this; + } + + /** + *

Unique identifier for the delivery

+ *

Unique identifier for the delivery

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public EventStreamIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Unique identifier for the event stream.

+ *

Unique identifier for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_stream_id") + public StatusStage eventStreamId(@NotNull String eventStreamId) { + this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EventTypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage event(EventStreamCloudEvent event) { + this.event = Optional.ofNullable(event); + return this; + } + + @java.lang.Override + @JsonSetter(value = "event", nulls = Nulls.SKIP) + public _FinalStage event(Optional event) { + this.event = event; + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllAttempts(List attempts) { + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { + this.attempts.add(attempts); + return this; + } + + /** + *

Results of delivery attempts

+ */ + @java.lang.Override + @JsonSetter(value = "attempts", nulls = Nulls.SKIP) + public _FinalStage attempts(List attempts) { + this.attempts.clear(); + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + @java.lang.Override + public CreateEventStreamTestEventResponseContent build() { + return new CreateEventStreamTestEventResponseContent( + id, eventStreamId, status, eventType, attempts, event, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java new file mode 100644 index 000000000..c0ef573bb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateEventStreamWebHookRequestContent.Builder.class) +public final class CreateEventStreamWebHookRequestContent { + private final Optional name; + + private final Optional> subscriptions; + + private final EventStreamWebhookDestination destination; + + private final Optional status; + + private final Map additionalProperties; + + private CreateEventStreamWebHookRequestContent( + Optional name, + Optional> subscriptions, + EventStreamWebhookDestination destination, + Optional status, + Map additionalProperties) { + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public EventStreamWebhookDestination getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateEventStreamWebHookRequestContent + && equalTo((CreateEventStreamWebHookRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateEventStreamWebHookRequestContent other) { + return name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subscriptions, this.destination, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DestinationStage builder() { + return new Builder(); + } + + public interface DestinationStage { + _FinalStage destination(@NotNull EventStreamWebhookDestination destination); + + Builder from(CreateEventStreamWebHookRequestContent other); + } + + public interface _FinalStage { + CreateEventStreamWebHookRequestContent build(); + + /** + *

Name of the event stream.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

List of event types subscribed to in this stream.

+ */ + _FinalStage subscriptions(Optional> subscriptions); + + _FinalStage subscriptions(List subscriptions); + + _FinalStage status(Optional status); + + _FinalStage status(EventStreamStatusEnum status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DestinationStage, _FinalStage { + private EventStreamWebhookDestination destination; + + private Optional status = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateEventStreamWebHookRequestContent other) { + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + return this; + } + + @java.lang.Override + @JsonSetter("destination") + public _FinalStage destination(@NotNull EventStreamWebhookDestination destination) { + this.destination = Objects.requireNonNull(destination, "destination must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @java.lang.Override + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public _FinalStage subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + *

Name of the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Name of the event stream.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateEventStreamWebHookRequestContent build() { + return new CreateEventStreamWebHookRequestContent( + name, subscriptions, destination, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java new file mode 100644 index 000000000..48ebd22df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateExportUsersFields.Builder.class) +public final class CreateExportUsersFields { + private final String name; + + private final Optional exportAs; + + private final Map additionalProperties; + + private CreateExportUsersFields(String name, Optional exportAs, Map additionalProperties) { + this.name = name; + this.exportAs = exportAs; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the field in the profile. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Title of the column in the exported CSV. + */ + @JsonProperty("export_as") + public Optional getExportAs() { + return exportAs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateExportUsersFields && equalTo((CreateExportUsersFields) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateExportUsersFields other) { + return name.equals(other.name) && exportAs.equals(other.exportAs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.exportAs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of the field in the profile.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateExportUsersFields other); + } + + public interface _FinalStage { + CreateExportUsersFields build(); + + /** + *

Title of the column in the exported CSV.

+ */ + _FinalStage exportAs(Optional exportAs); + + _FinalStage exportAs(String exportAs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional exportAs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateExportUsersFields other) { + name(other.getName()); + exportAs(other.getExportAs()); + return this; + } + + /** + *

Name of the field in the profile.

+ *

Name of the field in the profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Title of the column in the exported CSV.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage exportAs(String exportAs) { + this.exportAs = Optional.ofNullable(exportAs); + return this; + } + + /** + *

Title of the column in the exported CSV.

+ */ + @java.lang.Override + @JsonSetter(value = "export_as", nulls = Nulls.SKIP) + public _FinalStage exportAs(Optional exportAs) { + this.exportAs = exportAs; + return this; + } + + @java.lang.Override + public CreateExportUsersFields build() { + return new CreateExportUsersFields(name, exportAs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java new file mode 100644 index 000000000..ab3539c98 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java @@ -0,0 +1,399 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateExportUsersResponseContent.Builder.class) +public final class CreateExportUsersResponseContent { + private final String status; + + private final String type; + + private final Optional createdAt; + + private final String id; + + private final Optional connectionId; + + private final Optional format; + + private final Optional limit; + + private final Optional> fields; + + private final Map additionalProperties; + + private CreateExportUsersResponseContent( + String status, + String type, + Optional createdAt, + String id, + Optional connectionId, + Optional format, + Optional limit, + Optional> fields, + Map additionalProperties) { + this.status = status; + this.type = type; + this.createdAt = createdAt; + this.id = id; + this.connectionId = connectionId; + this.format = format; + this.limit = limit; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of this job. + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Type of job this is. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return When this job was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return ID of this job. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return connection_id of the connection from which users will be exported. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + /** + * @return Limit the number of records. + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return List of fields to be included in the CSV. Defaults to a predefined set of fields. + */ + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateExportUsersResponseContent && equalTo((CreateExportUsersResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateExportUsersResponseContent other) { + return status.equals(other.status) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && id.equals(other.id) + && connectionId.equals(other.connectionId) + && format.equals(other.format) + && limit.equals(other.limit) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.status, + this.type, + this.createdAt, + this.id, + this.connectionId, + this.format, + this.limit, + this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + *

Status of this job.

+ */ + TypeStage status(@NotNull String status); + + Builder from(CreateExportUsersResponseContent other); + } + + public interface TypeStage { + /** + *

Type of job this is.

+ */ + IdStage type(@NotNull String type); + } + + public interface IdStage { + /** + *

ID of this job.

+ */ + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + CreateExportUsersResponseContent build(); + + /** + *

When this job was created.

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(String createdAt); + + /** + *

connection_id of the connection from which users will be exported.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + + _FinalStage format(Optional format); + + _FinalStage format(JobFileFormatEnum format); + + /** + *

Limit the number of records.

+ */ + _FinalStage limit(Optional limit); + + _FinalStage limit(Integer limit); + + /** + *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

+ */ + _FinalStage fields(Optional> fields); + + _FinalStage fields(List fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, TypeStage, IdStage, _FinalStage { + private String status; + + private String type; + + private String id; + + private Optional> fields = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional format = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateExportUsersResponseContent other) { + status(other.getStatus()); + type(other.getType()); + createdAt(other.getCreatedAt()); + id(other.getId()); + connectionId(other.getConnectionId()); + format(other.getFormat()); + limit(other.getLimit()); + fields(other.getFields()); + return this; + } + + /** + *

Status of this job.

+ *

Status of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Type of job this is.

+ *

Type of job this is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public IdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

ID of this job.

+ *

ID of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fields(List fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + /** + *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

+ */ + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + /** + *

Limit the number of records.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

Limit the number of records.

+ */ + @java.lang.Override + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public _FinalStage limit(Optional limit) { + this.limit = limit; + return this; + } + + @java.lang.Override + public _FinalStage format(JobFileFormatEnum format) { + this.format = Optional.ofNullable(format); + return this; + } + + @java.lang.Override + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public _FinalStage format(Optional format) { + this.format = format; + return this; + } + + /** + *

connection_id of the connection from which users will be exported.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

connection_id of the connection from which users will be exported.

+ */ + @java.lang.Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + *

When this job was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

When this job was created.

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public CreateExportUsersResponseContent build() { + return new CreateExportUsersResponseContent( + status, type, createdAt, id, connectionId, format, limit, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java new file mode 100644 index 000000000..929af5f34 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowRequestContent.Builder.class) +public final class CreateFlowRequestContent { + private final String name; + + private final Optional> actions; + + private final Map additionalProperties; + + private CreateFlowRequestContent( + String name, Optional> actions, Map additionalProperties) { + this.name = name; + this.actions = actions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowRequestContent && equalTo((CreateFlowRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowRequestContent other) { + return name.equals(other.name) && actions.equals(other.actions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.actions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(CreateFlowRequestContent other); + } + + public interface _FinalStage { + CreateFlowRequestContent build(); + + _FinalStage actions(Optional> actions); + + _FinalStage actions(List actions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFlowRequestContent other) { + name(other.getName()); + actions(other.getActions()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public _FinalStage actions(Optional> actions) { + this.actions = actions; + return this; + } + + @java.lang.Override + public CreateFlowRequestContent build() { + return new CreateFlowRequestContent(name, actions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java new file mode 100644 index 000000000..eabb8c199 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowResponseContent.Builder.class) +public final class CreateFlowResponseContent { + private final String id; + + private final String name; + + private final Optional> actions; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional executedAt; + + private final Map additionalProperties; + + private CreateFlowResponseContent( + String id, + String name, + Optional> actions, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional executedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.actions = actions; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.executedAt = executedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("executed_at") + public Optional getExecutedAt() { + return executedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowResponseContent && equalTo((CreateFlowResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && actions.equals(other.actions) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && executedAt.equals(other.executedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(CreateFlowResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + CreateFlowResponseContent build(); + + _FinalStage actions(Optional> actions); + + _FinalStage actions(List actions); + + _FinalStage executedAt(Optional executedAt); + + _FinalStage executedAt(String executedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional executedAt = Optional.empty(); + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFlowResponseContent other) { + id(other.getId()); + name(other.getName()); + actions(other.getActions()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + executedAt(other.getExecutedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage executedAt(String executedAt) { + this.executedAt = Optional.ofNullable(executedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) + public _FinalStage executedAt(Optional executedAt) { + this.executedAt = executedAt; + return this; + } + + @java.lang.Override + public _FinalStage actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public _FinalStage actions(Optional> actions) { + this.actions = actions; + return this; + } + + @java.lang.Override + public CreateFlowResponseContent build() { + return new CreateFlowResponseContent( + id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java new file mode 100644 index 000000000..e608526f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java @@ -0,0 +1,326 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFormRequestContent.Builder.class) +public final class CreateFormRequestContent { + private final String name; + + private final Optional messages; + + private final Optional languages; + + private final Optional> translations; + + private final Optional> nodes; + + private final Optional start; + + private final Optional ending; + + private final Optional style; + + private final Map additionalProperties; + + private CreateFormRequestContent( + String name, + Optional messages, + Optional languages, + Optional> translations, + Optional> nodes, + Optional start, + Optional ending, + Optional style, + Map additionalProperties) { + this.name = name; + this.messages = messages; + this.languages = languages; + this.translations = translations; + this.nodes = nodes; + this.start = start; + this.ending = ending; + this.style = style; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("messages") + public Optional getMessages() { + return messages; + } + + @JsonProperty("languages") + public Optional getLanguages() { + return languages; + } + + @JsonProperty("translations") + public Optional> getTranslations() { + return translations; + } + + @JsonProperty("nodes") + public Optional> getNodes() { + return nodes; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("ending") + public Optional getEnding() { + return ending; + } + + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFormRequestContent && equalTo((CreateFormRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFormRequestContent other) { + return name.equals(other.name) + && messages.equals(other.messages) + && languages.equals(other.languages) + && translations.equals(other.translations) + && nodes.equals(other.nodes) + && start.equals(other.start) + && ending.equals(other.ending) + && style.equals(other.style); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.messages, + this.languages, + this.translations, + this.nodes, + this.start, + this.ending, + this.style); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(CreateFormRequestContent other); + } + + public interface _FinalStage { + CreateFormRequestContent build(); + + _FinalStage messages(Optional messages); + + _FinalStage messages(FormMessages messages); + + _FinalStage languages(Optional languages); + + _FinalStage languages(FormLanguages languages); + + _FinalStage translations(Optional> translations); + + _FinalStage translations(Map translations); + + _FinalStage nodes(Optional> nodes); + + _FinalStage nodes(List nodes); + + _FinalStage start(Optional start); + + _FinalStage start(FormStartNode start); + + _FinalStage ending(Optional ending); + + _FinalStage ending(FormEndingNode ending); + + _FinalStage style(Optional style); + + _FinalStage style(FormStyle style); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional style = Optional.empty(); + + private Optional ending = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional> nodes = Optional.empty(); + + private Optional> translations = Optional.empty(); + + private Optional languages = Optional.empty(); + + private Optional messages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFormRequestContent other) { + name(other.getName()); + messages(other.getMessages()); + languages(other.getLanguages()); + translations(other.getTranslations()); + nodes(other.getNodes()); + start(other.getStart()); + ending(other.getEnding()); + style(other.getStyle()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage style(FormStyle style) { + this.style = Optional.ofNullable(style); + return this; + } + + @java.lang.Override + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public _FinalStage style(Optional style) { + this.style = style; + return this; + } + + @java.lang.Override + public _FinalStage ending(FormEndingNode ending) { + this.ending = Optional.ofNullable(ending); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ending", nulls = Nulls.SKIP) + public _FinalStage ending(Optional ending) { + this.ending = ending; + return this; + } + + @java.lang.Override + public _FinalStage start(FormStartNode start) { + this.start = Optional.ofNullable(start); + return this; + } + + @java.lang.Override + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public _FinalStage start(Optional start) { + this.start = start; + return this; + } + + @java.lang.Override + public _FinalStage nodes(List nodes) { + this.nodes = Optional.ofNullable(nodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nodes", nulls = Nulls.SKIP) + public _FinalStage nodes(Optional> nodes) { + this.nodes = nodes; + return this; + } + + @java.lang.Override + public _FinalStage translations(Map translations) { + this.translations = Optional.ofNullable(translations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "translations", nulls = Nulls.SKIP) + public _FinalStage translations(Optional> translations) { + this.translations = translations; + return this; + } + + @java.lang.Override + public _FinalStage languages(FormLanguages languages) { + this.languages = Optional.ofNullable(languages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "languages", nulls = Nulls.SKIP) + public _FinalStage languages(Optional languages) { + this.languages = languages; + return this; + } + + @java.lang.Override + public _FinalStage messages(FormMessages messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public _FinalStage messages(Optional messages) { + this.messages = messages; + return this; + } + + @java.lang.Override + public CreateFormRequestContent build() { + return new CreateFormRequestContent( + name, messages, languages, translations, nodes, start, ending, style, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java new file mode 100644 index 000000000..70b36ca87 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFormResponseContent.Builder.class) +public final class CreateFormResponseContent { + private final String id; + + private final String name; + + private final Optional messages; + + private final Optional languages; + + private final Optional> translations; + + private final Optional> nodes; + + private final Optional start; + + private final Optional ending; + + private final Optional style; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional embeddedAt; + + private final Optional submittedAt; + + private final Map additionalProperties; + + private CreateFormResponseContent( + String id, + String name, + Optional messages, + Optional languages, + Optional> translations, + Optional> nodes, + Optional start, + Optional ending, + Optional style, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional embeddedAt, + Optional submittedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.messages = messages; + this.languages = languages; + this.translations = translations; + this.nodes = nodes; + this.start = start; + this.ending = ending; + this.style = style; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.embeddedAt = embeddedAt; + this.submittedAt = submittedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("messages") + public Optional getMessages() { + return messages; + } + + @JsonProperty("languages") + public Optional getLanguages() { + return languages; + } + + @JsonProperty("translations") + public Optional> getTranslations() { + return translations; + } + + @JsonProperty("nodes") + public Optional> getNodes() { + return nodes; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("ending") + public Optional getEnding() { + return ending; + } + + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("embedded_at") + public Optional getEmbeddedAt() { + return embeddedAt; + } + + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFormResponseContent && equalTo((CreateFormResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFormResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && messages.equals(other.messages) + && languages.equals(other.languages) + && translations.equals(other.translations) + && nodes.equals(other.nodes) + && start.equals(other.start) + && ending.equals(other.ending) + && style.equals(other.style) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && embeddedAt.equals(other.embeddedAt) + && submittedAt.equals(other.submittedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.messages, + this.languages, + this.translations, + this.nodes, + this.start, + this.ending, + this.style, + this.createdAt, + this.updatedAt, + this.embeddedAt, + this.submittedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(CreateFormResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + CreateFormResponseContent build(); + + _FinalStage messages(Optional messages); + + _FinalStage messages(FormMessages messages); + + _FinalStage languages(Optional languages); + + _FinalStage languages(FormLanguages languages); + + _FinalStage translations(Optional> translations); + + _FinalStage translations(Map translations); + + _FinalStage nodes(Optional> nodes); + + _FinalStage nodes(List nodes); + + _FinalStage start(Optional start); + + _FinalStage start(FormStartNode start); + + _FinalStage ending(Optional ending); + + _FinalStage ending(FormEndingNode ending); + + _FinalStage style(Optional style); + + _FinalStage style(FormStyle style); + + _FinalStage embeddedAt(Optional embeddedAt); + + _FinalStage embeddedAt(String embeddedAt); + + _FinalStage submittedAt(Optional submittedAt); + + _FinalStage submittedAt(String submittedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional submittedAt = Optional.empty(); + + private Optional embeddedAt = Optional.empty(); + + private Optional style = Optional.empty(); + + private Optional ending = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional> nodes = Optional.empty(); + + private Optional> translations = Optional.empty(); + + private Optional languages = Optional.empty(); + + private Optional messages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFormResponseContent other) { + id(other.getId()); + name(other.getName()); + messages(other.getMessages()); + languages(other.getLanguages()); + translations(other.getTranslations()); + nodes(other.getNodes()); + start(other.getStart()); + ending(other.getEnding()); + style(other.getStyle()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + embeddedAt(other.getEmbeddedAt()); + submittedAt(other.getSubmittedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage submittedAt(String submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) + public _FinalStage submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + @java.lang.Override + public _FinalStage embeddedAt(String embeddedAt) { + this.embeddedAt = Optional.ofNullable(embeddedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) + public _FinalStage embeddedAt(Optional embeddedAt) { + this.embeddedAt = embeddedAt; + return this; + } + + @java.lang.Override + public _FinalStage style(FormStyle style) { + this.style = Optional.ofNullable(style); + return this; + } + + @java.lang.Override + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public _FinalStage style(Optional style) { + this.style = style; + return this; + } + + @java.lang.Override + public _FinalStage ending(FormEndingNode ending) { + this.ending = Optional.ofNullable(ending); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ending", nulls = Nulls.SKIP) + public _FinalStage ending(Optional ending) { + this.ending = ending; + return this; + } + + @java.lang.Override + public _FinalStage start(FormStartNode start) { + this.start = Optional.ofNullable(start); + return this; + } + + @java.lang.Override + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public _FinalStage start(Optional start) { + this.start = start; + return this; + } + + @java.lang.Override + public _FinalStage nodes(List nodes) { + this.nodes = Optional.ofNullable(nodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nodes", nulls = Nulls.SKIP) + public _FinalStage nodes(Optional> nodes) { + this.nodes = nodes; + return this; + } + + @java.lang.Override + public _FinalStage translations(Map translations) { + this.translations = Optional.ofNullable(translations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "translations", nulls = Nulls.SKIP) + public _FinalStage translations(Optional> translations) { + this.translations = translations; + return this; + } + + @java.lang.Override + public _FinalStage languages(FormLanguages languages) { + this.languages = Optional.ofNullable(languages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "languages", nulls = Nulls.SKIP) + public _FinalStage languages(Optional languages) { + this.languages = languages; + return this; + } + + @java.lang.Override + public _FinalStage messages(FormMessages messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public _FinalStage messages(Optional messages) { + this.messages = messages; + return this; + } + + @java.lang.Override + public CreateFormResponseContent build() { + return new CreateFormResponseContent( + id, + name, + messages, + languages, + translations, + nodes, + start, + ending, + style, + createdAt, + updatedAt, + embeddedAt, + submittedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java new file mode 100644 index 000000000..709085672 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateGuardianEnrollmentTicketResponseContent.Builder.class) +public final class CreateGuardianEnrollmentTicketResponseContent { + private final Optional ticketId; + + private final Optional ticketUrl; + + private final Map additionalProperties; + + private CreateGuardianEnrollmentTicketResponseContent( + Optional ticketId, Optional ticketUrl, Map additionalProperties) { + this.ticketId = ticketId; + this.ticketUrl = ticketUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ticket_id used to identify the enrollment + */ + @JsonProperty("ticket_id") + public Optional getTicketId() { + return ticketId; + } + + /** + * @return The url you can use to start enrollment + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateGuardianEnrollmentTicketResponseContent + && equalTo((CreateGuardianEnrollmentTicketResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateGuardianEnrollmentTicketResponseContent other) { + return ticketId.equals(other.ticketId) && ticketUrl.equals(other.ticketUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ticketId, this.ticketUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ticketId = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateGuardianEnrollmentTicketResponseContent other) { + ticketId(other.getTicketId()); + ticketUrl(other.getTicketUrl()); + return this; + } + + /** + *

The ticket_id used to identify the enrollment

+ */ + @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) + public Builder ticketId(Optional ticketId) { + this.ticketId = ticketId; + return this; + } + + public Builder ticketId(String ticketId) { + this.ticketId = Optional.ofNullable(ticketId); + return this; + } + + /** + *

The url you can use to start enrollment

+ */ + @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + public CreateGuardianEnrollmentTicketResponseContent build() { + return new CreateGuardianEnrollmentTicketResponseContent(ticketId, ticketUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java new file mode 100644 index 000000000..5bcabe8a0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateHookRequestContent.Builder.class) +public final class CreateHookRequestContent { + private final String name; + + private final String script; + + private final Optional enabled; + + private final Optional> dependencies; + + private final HookTriggerIdEnum triggerId; + + private final Map additionalProperties; + + private CreateHookRequestContent( + String name, + String script, + Optional enabled, + Optional> dependencies, + HookTriggerIdEnum triggerId, + Map additionalProperties) { + this.name = name; + this.script = script; + this.enabled = enabled; + this.dependencies = dependencies; + this.triggerId = triggerId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public String getScript() { + return script; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @JsonProperty("triggerId") + public HookTriggerIdEnum getTriggerId() { + return triggerId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateHookRequestContent && equalTo((CreateHookRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateHookRequestContent other) { + return name.equals(other.name) + && script.equals(other.script) + && enabled.equals(other.enabled) + && dependencies.equals(other.dependencies) + && triggerId.equals(other.triggerId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.script, this.enabled, this.dependencies, this.triggerId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of this hook.

+ */ + ScriptStage name(@NotNull String name); + + Builder from(CreateHookRequestContent other); + } + + public interface ScriptStage { + /** + *

Code to be executed when this hook runs.

+ */ + TriggerIdStage script(@NotNull String script); + } + + public interface TriggerIdStage { + _FinalStage triggerId(@NotNull HookTriggerIdEnum triggerId); + } + + public interface _FinalStage { + CreateHookRequestContent build(); + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(Boolean enabled); + + _FinalStage dependencies(Optional> dependencies); + + _FinalStage dependencies(Map dependencies); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, ScriptStage, TriggerIdStage, _FinalStage { + private String name; + + private String script; + + private HookTriggerIdEnum triggerId; + + private Optional> dependencies = Optional.empty(); + + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateHookRequestContent other) { + name(other.getName()); + script(other.getScript()); + enabled(other.getEnabled()); + dependencies(other.getDependencies()); + triggerId(other.getTriggerId()); + return this; + } + + /** + *

Name of this hook.

+ *

Name of this hook.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public ScriptStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ *

Code to be executed when this hook runs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("script") + public TriggerIdStage script(@NotNull String script) { + this.script = Objects.requireNonNull(script, "script must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("triggerId") + public _FinalStage triggerId(@NotNull HookTriggerIdEnum triggerId) { + this.triggerId = Objects.requireNonNull(triggerId, "triggerId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public _FinalStage dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + @java.lang.Override + public CreateHookRequestContent build() { + return new CreateHookRequestContent(name, script, enabled, dependencies, triggerId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java new file mode 100644 index 000000000..43c85c54d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java @@ -0,0 +1,248 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateHookResponseContent.Builder.class) +public final class CreateHookResponseContent { + private final Optional triggerId; + + private final Optional id; + + private final Optional name; + + private final Optional enabled; + + private final Optional script; + + private final Optional> dependencies; + + private final Map additionalProperties; + + private CreateHookResponseContent( + Optional triggerId, + Optional id, + Optional name, + Optional enabled, + Optional script, + Optional> dependencies, + Map additionalProperties) { + this.triggerId = triggerId; + this.id = id; + this.name = name; + this.enabled = enabled; + this.script = script; + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + /** + * @return Trigger ID + */ + @JsonProperty("triggerId") + public Optional getTriggerId() { + return triggerId; + } + + /** + * @return ID of this hook. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateHookResponseContent && equalTo((CreateHookResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateHookResponseContent other) { + return triggerId.equals(other.triggerId) + && id.equals(other.id) + && name.equals(other.name) + && enabled.equals(other.enabled) + && script.equals(other.script) + && dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional triggerId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateHookResponseContent other) { + triggerId(other.getTriggerId()); + id(other.getId()); + name(other.getName()); + enabled(other.getEnabled()); + script(other.getScript()); + dependencies(other.getDependencies()); + return this; + } + + /** + *

Trigger ID

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + /** + *

ID of this hook.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this hook.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public CreateHookResponseContent build() { + return new CreateHookResponseContent( + triggerId, id, name, enabled, script, dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java new file mode 100644 index 000000000..f74fce543 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java @@ -0,0 +1,302 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateImportUsersResponseContent.Builder.class) +public final class CreateImportUsersResponseContent { + private final String status; + + private final String type; + + private final String createdAt; + + private final String id; + + private final String connectionId; + + private final Optional externalId; + + private final Map additionalProperties; + + private CreateImportUsersResponseContent( + String status, + String type, + String createdAt, + String id, + String connectionId, + Optional externalId, + Map additionalProperties) { + this.status = status; + this.type = type; + this.createdAt = createdAt; + this.id = id; + this.connectionId = connectionId; + this.externalId = externalId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of this job. + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Type of job this is. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return When this job was created. + */ + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + /** + * @return ID of this job. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return connection_id of the connection to which users will be imported. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return Customer-defined ID. + */ + @JsonProperty("external_id") + public Optional getExternalId() { + return externalId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateImportUsersResponseContent && equalTo((CreateImportUsersResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateImportUsersResponseContent other) { + return status.equals(other.status) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && id.equals(other.id) + && connectionId.equals(other.connectionId) + && externalId.equals(other.externalId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.externalId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + *

Status of this job.

+ */ + TypeStage status(@NotNull String status); + + Builder from(CreateImportUsersResponseContent other); + } + + public interface TypeStage { + /** + *

Type of job this is.

+ */ + CreatedAtStage type(@NotNull String type); + } + + public interface CreatedAtStage { + /** + *

When this job was created.

+ */ + IdStage createdAt(@NotNull String createdAt); + } + + public interface IdStage { + /** + *

ID of this job.

+ */ + ConnectionIdStage id(@NotNull String id); + } + + public interface ConnectionIdStage { + /** + *

connection_id of the connection to which users will be imported.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + } + + public interface _FinalStage { + CreateImportUsersResponseContent build(); + + /** + *

Customer-defined ID.

+ */ + _FinalStage externalId(Optional externalId); + + _FinalStage externalId(String externalId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements StatusStage, TypeStage, CreatedAtStage, IdStage, ConnectionIdStage, _FinalStage { + private String status; + + private String type; + + private String createdAt; + + private String id; + + private String connectionId; + + private Optional externalId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateImportUsersResponseContent other) { + status(other.getStatus()); + type(other.getType()); + createdAt(other.getCreatedAt()); + id(other.getId()); + connectionId(other.getConnectionId()); + externalId(other.getExternalId()); + return this; + } + + /** + *

Status of this job.

+ *

Status of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Type of job this is.

+ *

Type of job this is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public CreatedAtStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

When this job was created.

+ *

When this job was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public IdStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

ID of this job.

+ *

ID of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ConnectionIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

connection_id of the connection to which users will be imported.

+ *

connection_id of the connection to which users will be imported.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

Customer-defined ID.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage externalId(String externalId) { + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + *

Customer-defined ID.

+ */ + @java.lang.Override + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public _FinalStage externalId(Optional externalId) { + this.externalId = externalId; + return this; + } + + @java.lang.Override + public CreateImportUsersResponseContent build() { + return new CreateImportUsersResponseContent( + status, type, createdAt, id, connectionId, externalId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java new file mode 100644 index 000000000..5beac4614 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamDatadogRequestBody.Builder.class) +public final class CreateLogStreamDatadogRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamDatadogSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamDatadogRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamDatadogSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamDatadogSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamDatadogRequestBody && equalTo((CreateLogStreamDatadogRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamDatadogRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamDatadogRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamDatadogSink sink); + } + + public interface _FinalStage { + CreateLogStreamDatadogRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamDatadogSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamDatadogRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamDatadogSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamDatadogRequestBody build() { + return new CreateLogStreamDatadogRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java new file mode 100644 index 000000000..e291a4bd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamEventBridgeRequestBody.Builder.class) +public final class CreateLogStreamEventBridgeRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamEventBridgeSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamEventBridgeRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamEventBridgeSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamEventBridgeSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamEventBridgeRequestBody + && equalTo((CreateLogStreamEventBridgeRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamEventBridgeRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamEventBridgeRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamEventBridgeSink sink); + } + + public interface _FinalStage { + CreateLogStreamEventBridgeRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamEventBridgeSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamEventBridgeRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamEventBridgeSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamEventBridgeRequestBody build() { + return new CreateLogStreamEventBridgeRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java new file mode 100644 index 000000000..d71fc53eb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamEventGridRequestBody.Builder.class) +public final class CreateLogStreamEventGridRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamEventGridSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamEventGridRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamEventGridSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamEventGridSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamEventGridRequestBody + && equalTo((CreateLogStreamEventGridRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamEventGridRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamEventGridRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamEventGridSink sink); + } + + public interface _FinalStage { + CreateLogStreamEventGridRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamEventGridSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamEventGridRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamEventGridSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamEventGridRequestBody build() { + return new CreateLogStreamEventGridRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java new file mode 100644 index 000000000..55eb0e982 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamHttpRequestBody.Builder.class) +public final class CreateLogStreamHttpRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamHttpSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamHttpRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamHttpSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamHttpSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamHttpRequestBody && equalTo((CreateLogStreamHttpRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamHttpRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamHttpRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamHttpSink sink); + } + + public interface _FinalStage { + CreateLogStreamHttpRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamHttpSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamHttpRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamHttpSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamHttpRequestBody build() { + return new CreateLogStreamHttpRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java new file mode 100644 index 000000000..03713fb22 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamMixpanelRequestBody.Builder.class) +public final class CreateLogStreamMixpanelRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamMixpanelSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamMixpanelRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamMixpanelSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamMixpanelSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamMixpanelRequestBody + && equalTo((CreateLogStreamMixpanelRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamMixpanelRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamMixpanelRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamMixpanelSink sink); + } + + public interface _FinalStage { + CreateLogStreamMixpanelRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamMixpanelSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamMixpanelRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamMixpanelSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamMixpanelRequestBody build() { + return new CreateLogStreamMixpanelRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java new file mode 100644 index 000000000..00e507c5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateLogStreamRequestContent.Deserializer.class) +public final class CreateLogStreamRequestContent { + private final Object value; + + private final int type; + + private CreateLogStreamRequestContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateLogStreamHttpRequestBody) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateLogStreamEventBridgeRequestBody) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateLogStreamEventGridRequestBody) this.value); + } else if (this.type == 3) { + return visitor.visit((CreateLogStreamDatadogRequestBody) this.value); + } else if (this.type == 4) { + return visitor.visit((CreateLogStreamSplunkRequestBody) this.value); + } else if (this.type == 5) { + return visitor.visit((CreateLogStreamSumoRequestBody) this.value); + } else if (this.type == 6) { + return visitor.visit((CreateLogStreamSegmentRequestBody) this.value); + } else if (this.type == 7) { + return visitor.visit((CreateLogStreamMixpanelRequestBody) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamRequestContent && equalTo((CreateLogStreamRequestContent) other); + } + + private boolean equalTo(CreateLogStreamRequestContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamHttpRequestBody value) { + return new CreateLogStreamRequestContent(value, 0); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamEventBridgeRequestBody value) { + return new CreateLogStreamRequestContent(value, 1); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamEventGridRequestBody value) { + return new CreateLogStreamRequestContent(value, 2); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamDatadogRequestBody value) { + return new CreateLogStreamRequestContent(value, 3); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamSplunkRequestBody value) { + return new CreateLogStreamRequestContent(value, 4); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamSumoRequestBody value) { + return new CreateLogStreamRequestContent(value, 5); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamSegmentRequestBody value) { + return new CreateLogStreamRequestContent(value, 6); + } + + public static CreateLogStreamRequestContent of(CreateLogStreamMixpanelRequestBody value) { + return new CreateLogStreamRequestContent(value, 7); + } + + public interface Visitor { + T visit(CreateLogStreamHttpRequestBody value); + + T visit(CreateLogStreamEventBridgeRequestBody value); + + T visit(CreateLogStreamEventGridRequestBody value); + + T visit(CreateLogStreamDatadogRequestBody value); + + T visit(CreateLogStreamSplunkRequestBody value); + + T visit(CreateLogStreamSumoRequestBody value); + + T visit(CreateLogStreamSegmentRequestBody value); + + T visit(CreateLogStreamMixpanelRequestBody value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateLogStreamRequestContent.class); + } + + @java.lang.Override + public CreateLogStreamRequestContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamHttpRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamEventBridgeRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamEventGridRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamDatadogRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamSplunkRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamSumoRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamSegmentRequestBody.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateLogStreamMixpanelRequestBody.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamResponseContent.java new file mode 100644 index 000000000..6dfc8c398 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamResponseContent.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateLogStreamResponseContent.Deserializer.class) +public final class CreateLogStreamResponseContent { + private final Object value; + + private final int type; + + private CreateLogStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LogStreamHttpResponseSchema) this.value); + } else if (this.type == 1) { + return visitor.visit((LogStreamEventBridgeResponseSchema) this.value); + } else if (this.type == 2) { + return visitor.visit((LogStreamEventGridResponseSchema) this.value); + } else if (this.type == 3) { + return visitor.visit((LogStreamDatadogResponseSchema) this.value); + } else if (this.type == 4) { + return visitor.visit((LogStreamSplunkResponseSchema) this.value); + } else if (this.type == 5) { + return visitor.visit((LogStreamSumoResponseSchema) this.value); + } else if (this.type == 6) { + return visitor.visit((LogStreamSegmentResponseSchema) this.value); + } else if (this.type == 7) { + return visitor.visit((LogStreamMixpanelResponseSchema) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamResponseContent && equalTo((CreateLogStreamResponseContent) other); + } + + private boolean equalTo(CreateLogStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateLogStreamResponseContent of(LogStreamHttpResponseSchema value) { + return new CreateLogStreamResponseContent(value, 0); + } + + public static CreateLogStreamResponseContent of(LogStreamEventBridgeResponseSchema value) { + return new CreateLogStreamResponseContent(value, 1); + } + + public static CreateLogStreamResponseContent of(LogStreamEventGridResponseSchema value) { + return new CreateLogStreamResponseContent(value, 2); + } + + public static CreateLogStreamResponseContent of(LogStreamDatadogResponseSchema value) { + return new CreateLogStreamResponseContent(value, 3); + } + + public static CreateLogStreamResponseContent of(LogStreamSplunkResponseSchema value) { + return new CreateLogStreamResponseContent(value, 4); + } + + public static CreateLogStreamResponseContent of(LogStreamSumoResponseSchema value) { + return new CreateLogStreamResponseContent(value, 5); + } + + public static CreateLogStreamResponseContent of(LogStreamSegmentResponseSchema value) { + return new CreateLogStreamResponseContent(value, 6); + } + + public static CreateLogStreamResponseContent of(LogStreamMixpanelResponseSchema value) { + return new CreateLogStreamResponseContent(value, 7); + } + + public interface Visitor { + T visit(LogStreamHttpResponseSchema value); + + T visit(LogStreamEventBridgeResponseSchema value); + + T visit(LogStreamEventGridResponseSchema value); + + T visit(LogStreamDatadogResponseSchema value); + + T visit(LogStreamSplunkResponseSchema value); + + T visit(LogStreamSumoResponseSchema value); + + T visit(LogStreamSegmentResponseSchema value); + + T visit(LogStreamMixpanelResponseSchema value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateLogStreamResponseContent.class); + } + + @java.lang.Override + public CreateLogStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamHttpResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventBridgeResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventGridResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamDatadogResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSplunkResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSumoResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSegmentResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamMixpanelResponseSchema.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSegmentRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSegmentRequestBody.java new file mode 100644 index 000000000..d9ce92cc2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSegmentRequestBody.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamSegmentRequestBody.Builder.class) +public final class CreateLogStreamSegmentRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamSegmentSinkWriteKey sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamSegmentRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamSegmentSinkWriteKey sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamSegmentSinkWriteKey getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamSegmentRequestBody && equalTo((CreateLogStreamSegmentRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamSegmentRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamSegmentRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink); + } + + public interface _FinalStage { + CreateLogStreamSegmentRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamSegmentSinkWriteKey sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamSegmentRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamSegmentRequestBody build() { + return new CreateLogStreamSegmentRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java new file mode 100644 index 000000000..e43f99ad0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamSplunkRequestBody.Builder.class) +public final class CreateLogStreamSplunkRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamSplunkSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamSplunkRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamSplunkSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamSplunkSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamSplunkRequestBody && equalTo((CreateLogStreamSplunkRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamSplunkRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamSplunkRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamSplunkSink sink); + } + + public interface _FinalStage { + CreateLogStreamSplunkRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamSplunkSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamSplunkRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamSplunkSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamSplunkRequestBody build() { + return new CreateLogStreamSplunkRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java new file mode 100644 index 000000000..a6bcc06a3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateLogStreamSumoRequestBody.Builder.class) +public final class CreateLogStreamSumoRequestBody { + private final Optional name; + + private final String type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final LogStreamSumoSink sink; + + private final Optional startFrom; + + private final Map additionalProperties; + + private CreateLogStreamSumoRequestBody( + Optional name, + String type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + LogStreamSumoSink sink, + Optional startFrom, + Map additionalProperties) { + this.name = name; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.startFrom = startFrom; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public LogStreamSumoSink getSink() { + return sink; + } + + /** + * @return The optional datetime (ISO 8601) to start streaming logs from + */ + @JsonProperty("startFrom") + public Optional getStartFrom() { + return startFrom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateLogStreamSumoRequestBody && equalTo((CreateLogStreamSumoRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateLogStreamSumoRequestBody other) { + return name.equals(other.name) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink) + && startFrom.equals(other.startFrom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SinkStage type(@NotNull String type); + + Builder from(CreateLogStreamSumoRequestBody other); + } + + public interface SinkStage { + _FinalStage sink(@NotNull LogStreamSumoSink sink); + } + + public interface _FinalStage { + CreateLogStreamSumoRequestBody build(); + + /** + *

log stream name

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

True for priority log streams, false for non-priority

+ */ + _FinalStage isPriority(Optional isPriority); + + _FinalStage isPriority(Boolean isPriority); + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + _FinalStage filters(Optional> filters); + + _FinalStage filters(List filters); + + _FinalStage piiConfig(Optional piiConfig); + + _FinalStage piiConfig(LogStreamPiiConfig piiConfig); + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + _FinalStage startFrom(Optional startFrom); + + _FinalStage startFrom(String startFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SinkStage, _FinalStage { + private String type; + + private LogStreamSumoSink sink; + + private Optional startFrom = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateLogStreamSumoRequestBody other) { + name(other.getName()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + startFrom(other.getStartFrom()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public SinkStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sink") + public _FinalStage sink(@NotNull LogStreamSumoSink sink) { + this.sink = Objects.requireNonNull(sink, "sink must not be null"); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startFrom(String startFrom) { + this.startFrom = Optional.ofNullable(startFrom); + return this; + } + + /** + *

The optional datetime (ISO 8601) to start streaming logs from

+ */ + @java.lang.Override + @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) + public _FinalStage startFrom(Optional startFrom) { + this.startFrom = startFrom; + return this; + } + + @java.lang.Override + public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public _FinalStage piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @java.lang.Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(Optional> filters) { + this.filters = filters; + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @java.lang.Override + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public _FinalStage isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + /** + *

log stream name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

log stream name

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateLogStreamSumoRequestBody build() { + return new CreateLogStreamSumoRequestBody( + name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java new file mode 100644 index 000000000..992ec4de3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateNetworkAclRequestContent.Builder.class) +public final class CreateNetworkAclRequestContent { + private final String description; + + private final boolean active; + + private final double priority; + + private final NetworkAclRule rule; + + private final Map additionalProperties; + + private CreateNetworkAclRequestContent( + String description, + boolean active, + double priority, + NetworkAclRule rule, + Map additionalProperties) { + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Indicates whether or not this access control list is actively being used + */ + @JsonProperty("active") + public boolean getActive() { + return active; + } + + /** + * @return Indicates the order in which the ACL will be evaluated relative to other ACL rules. + */ + @JsonProperty("priority") + public double getPriority() { + return priority; + } + + @JsonProperty("rule") + public NetworkAclRule getRule() { + return rule; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateNetworkAclRequestContent && equalTo((CreateNetworkAclRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateNetworkAclRequestContent other) { + return description.equals(other.description) + && active == other.active + && priority == other.priority + && rule.equals(other.rule); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.description, this.active, this.priority, this.rule); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DescriptionStage builder() { + return new Builder(); + } + + public interface DescriptionStage { + ActiveStage description(@NotNull String description); + + Builder from(CreateNetworkAclRequestContent other); + } + + public interface ActiveStage { + /** + *

Indicates whether or not this access control list is actively being used

+ */ + PriorityStage active(boolean active); + } + + public interface PriorityStage { + /** + *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ */ + RuleStage priority(double priority); + } + + public interface RuleStage { + _FinalStage rule(@NotNull NetworkAclRule rule); + } + + public interface _FinalStage { + CreateNetworkAclRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DescriptionStage, ActiveStage, PriorityStage, RuleStage, _FinalStage { + private String description; + + private boolean active; + + private double priority; + + private NetworkAclRule rule; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateNetworkAclRequestContent other) { + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + return this; + } + + @java.lang.Override + @JsonSetter("description") + public ActiveStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Indicates whether or not this access control list is actively being used

+ *

Indicates whether or not this access control list is actively being used

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("active") + public PriorityStage active(boolean active) { + this.active = active; + return this; + } + + /** + *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("priority") + public RuleStage priority(double priority) { + this.priority = priority; + return this; + } + + @java.lang.Override + @JsonSetter("rule") + public _FinalStage rule(@NotNull NetworkAclRule rule) { + this.rule = Objects.requireNonNull(rule, "rule must not be null"); + return this; + } + + @java.lang.Override + public CreateNetworkAclRequestContent build() { + return new CreateNetworkAclRequestContent(description, active, priority, rule, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java new file mode 100644 index 000000000..1c4ca998c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java @@ -0,0 +1,469 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationInvitationResponseContent.Builder.class) +public final class CreateOrganizationInvitationResponseContent { + private final Optional id; + + private final Optional organizationId; + + private final Optional inviter; + + private final Optional invitee; + + private final Optional invitationUrl; + + private final Optional createdAt; + + private final Optional expiresAt; + + private final Optional clientId; + + private final Optional connectionId; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional> roles; + + private final Optional ticketId; + + private final Map additionalProperties; + + private CreateOrganizationInvitationResponseContent( + Optional id, + Optional organizationId, + Optional inviter, + Optional invitee, + Optional invitationUrl, + Optional createdAt, + Optional expiresAt, + Optional clientId, + Optional connectionId, + Optional> appMetadata, + Optional> userMetadata, + Optional> roles, + Optional ticketId, + Map additionalProperties) { + this.id = id; + this.organizationId = organizationId; + this.inviter = inviter; + this.invitee = invitee; + this.invitationUrl = invitationUrl; + this.createdAt = createdAt; + this.expiresAt = expiresAt; + this.clientId = clientId; + this.connectionId = connectionId; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.roles = roles; + this.ticketId = ticketId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the user invitation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @JsonProperty("inviter") + public Optional getInviter() { + return inviter; + } + + @JsonProperty("invitee") + public Optional getInvitee() { + return invitee; + } + + /** + * @return The invitation url to be send to the invitee. + */ + @JsonProperty("invitation_url") + public Optional getInvitationUrl() { + return invitationUrl; + } + + /** + * @return The ISO 8601 formatted timestamp representing the creation time of the invitation. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted timestamp representing the expiration time of the invitation. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + /** + * @return Auth0 client ID. Used to resolve the application's login initiation endpoint. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The id of the connection to force invitee to authenticate with. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + /** + * @return The id of the invitation ticket + */ + @JsonProperty("ticket_id") + public Optional getTicketId() { + return ticketId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationInvitationResponseContent + && equalTo((CreateOrganizationInvitationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationInvitationResponseContent other) { + return id.equals(other.id) + && organizationId.equals(other.organizationId) + && inviter.equals(other.inviter) + && invitee.equals(other.invitee) + && invitationUrl.equals(other.invitationUrl) + && createdAt.equals(other.createdAt) + && expiresAt.equals(other.expiresAt) + && clientId.equals(other.clientId) + && connectionId.equals(other.connectionId) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && roles.equals(other.roles) + && ticketId.equals(other.ticketId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.organizationId, + this.inviter, + this.invitee, + this.invitationUrl, + this.createdAt, + this.expiresAt, + this.clientId, + this.connectionId, + this.appMetadata, + this.userMetadata, + this.roles, + this.ticketId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional inviter = Optional.empty(); + + private Optional invitee = Optional.empty(); + + private Optional invitationUrl = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional> roles = Optional.empty(); + + private Optional ticketId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateOrganizationInvitationResponseContent other) { + id(other.getId()); + organizationId(other.getOrganizationId()); + inviter(other.getInviter()); + invitee(other.getInvitee()); + invitationUrl(other.getInvitationUrl()); + createdAt(other.getCreatedAt()); + expiresAt(other.getExpiresAt()); + clientId(other.getClientId()); + connectionId(other.getConnectionId()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + roles(other.getRoles()); + ticketId(other.getTicketId()); + return this; + } + + /** + *

The id of the user invitation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + @JsonSetter(value = "inviter", nulls = Nulls.SKIP) + public Builder inviter(Optional inviter) { + this.inviter = inviter; + return this; + } + + public Builder inviter(OrganizationInvitationInviter inviter) { + this.inviter = Optional.ofNullable(inviter); + return this; + } + + @JsonSetter(value = "invitee", nulls = Nulls.SKIP) + public Builder invitee(Optional invitee) { + this.invitee = invitee; + return this; + } + + public Builder invitee(OrganizationInvitationInvitee invitee) { + this.invitee = Optional.ofNullable(invitee); + return this; + } + + /** + *

The invitation url to be send to the invitee.

+ */ + @JsonSetter(value = "invitation_url", nulls = Nulls.SKIP) + public Builder invitationUrl(Optional invitationUrl) { + this.invitationUrl = invitationUrl; + return this; + } + + public Builder invitationUrl(String invitationUrl) { + this.invitationUrl = Optional.ofNullable(invitationUrl); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the creation time of the invitation.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the expiration time of the invitation.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The id of the connection to force invitee to authenticate with.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + *

The id of the invitation ticket

+ */ + @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) + public Builder ticketId(Optional ticketId) { + this.ticketId = ticketId; + return this; + } + + public Builder ticketId(String ticketId) { + this.ticketId = Optional.ofNullable(ticketId); + return this; + } + + public CreateOrganizationInvitationResponseContent build() { + return new CreateOrganizationInvitationResponseContent( + id, + organizationId, + inviter, + invitee, + invitationUrl, + createdAt, + expiresAt, + clientId, + connectionId, + appMetadata, + userMetadata, + roles, + ticketId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java new file mode 100644 index 000000000..a3cef4032 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java @@ -0,0 +1,296 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationRequestContent.Builder.class) +public final class CreateOrganizationRequestContent { + private final String name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional> enabledConnections; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private CreateOrganizationRequestContent( + String name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional> enabledConnections, + Optional tokenQuota, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.enabledConnections = enabledConnections; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + /** + * @return Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed) + */ + @JsonProperty("enabled_connections") + public Optional> getEnabledConnections() { + return enabledConnections; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationRequestContent && equalTo((CreateOrganizationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationRequestContent other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && enabledConnections.equals(other.enabledConnections) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.displayName, this.branding, this.metadata, this.enabledConnections, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The name of this organization.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateOrganizationRequestContent other); + } + + public interface _FinalStage { + CreateOrganizationRequestContent build(); + + /** + *

Friendly name of this organization.

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage branding(Optional branding); + + _FinalStage branding(OrganizationBranding branding); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + + /** + *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

+ */ + _FinalStage enabledConnections(Optional> enabledConnections); + + _FinalStage enabledConnections(List enabledConnections); + + _FinalStage tokenQuota(Optional tokenQuota); + + _FinalStage tokenQuota(CreateTokenQuota tokenQuota); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional tokenQuota = Optional.empty(); + + private Optional> enabledConnections = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOrganizationRequestContent other) { + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + enabledConnections(other.getEnabledConnections()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

The name of this organization.

+ *

The name of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public _FinalStage tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + /** + *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabledConnections(List enabledConnections) { + this.enabledConnections = Optional.ofNullable(enabledConnections); + return this; + } + + /** + *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

+ */ + @java.lang.Override + @JsonSetter(value = "enabled_connections", nulls = Nulls.SKIP) + public _FinalStage enabledConnections(Optional> enabledConnections) { + this.enabledConnections = enabledConnections; + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + @java.lang.Override + public _FinalStage branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public _FinalStage branding(Optional branding) { + this.branding = branding; + return this; + } + + /** + *

Friendly name of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public CreateOrganizationRequestContent build() { + return new CreateOrganizationRequestContent( + name, displayName, branding, metadata, enabledConnections, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java new file mode 100644 index 000000000..f12b9994c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationResponseContent.Builder.class) +public final class CreateOrganizationResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional tokenQuota; + + private final Optional> enabledConnections; + + private final Map additionalProperties; + + private CreateOrganizationResponseContent( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional tokenQuota, + Optional> enabledConnections, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.enabledConnections = enabledConnections; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonProperty("enabled_connections") + public Optional> getEnabledConnections() { + return enabledConnections; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationResponseContent && equalTo((CreateOrganizationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota) + && enabledConnections.equals(other.enabledConnections); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.displayName, + this.branding, + this.metadata, + this.tokenQuota, + this.enabledConnections); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + private Optional> enabledConnections = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateOrganizationResponseContent other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + enabledConnections(other.getEnabledConnections()); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + @JsonSetter(value = "enabled_connections", nulls = Nulls.SKIP) + public Builder enabledConnections(Optional> enabledConnections) { + this.enabledConnections = enabledConnections; + return this; + } + + public Builder enabledConnections(List enabledConnections) { + this.enabledConnections = Optional.ofNullable(enabledConnections); + return this; + } + + public CreateOrganizationResponseContent build() { + return new CreateOrganizationResponseContent( + id, name, displayName, branding, metadata, tokenQuota, enabledConnections, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java new file mode 100644 index 000000000..0f46dfd8e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneProviderSendTestResponseContent.Builder.class) +public final class CreatePhoneProviderSendTestResponseContent { + private final Optional code; + + private final Optional message; + + private final Map additionalProperties; + + private CreatePhoneProviderSendTestResponseContent( + Optional code, Optional message, Map additionalProperties) { + this.code = code; + this.message = message; + this.additionalProperties = additionalProperties; + } + + /** + * @return The status code of the operation. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The description of the operation status. + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneProviderSendTestResponseContent + && equalTo((CreatePhoneProviderSendTestResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneProviderSendTestResponseContent other) { + return code.equals(other.code) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.code, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreatePhoneProviderSendTestResponseContent other) { + code(other.getCode()); + message(other.getMessage()); + return this; + } + + /** + *

The status code of the operation.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(Double code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The description of the operation status.

+ */ + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public Builder message(Optional message) { + this.message = message; + return this; + } + + public Builder message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + public CreatePhoneProviderSendTestResponseContent build() { + return new CreatePhoneProviderSendTestResponseContent(code, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java new file mode 100644 index 000000000..ae6277c28 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneTemplateResponseContent.Builder.class) +public final class CreatePhoneTemplateResponseContent { + private final String id; + + private final Optional channel; + + private final Optional customizable; + + private final Optional tenant; + + private final PhoneTemplateContent content; + + private final PhoneTemplateNotificationTypeEnum type; + + private final boolean disabled; + + private final Map additionalProperties; + + private CreatePhoneTemplateResponseContent( + String id, + Optional channel, + Optional customizable, + Optional tenant, + PhoneTemplateContent content, + PhoneTemplateNotificationTypeEnum type, + boolean disabled, + Map additionalProperties) { + this.id = id; + this.channel = channel; + this.customizable = customizable; + this.tenant = tenant; + this.content = content; + this.type = type; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + @JsonProperty("customizable") + public Optional getCustomizable() { + return customizable; + } + + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("content") + public PhoneTemplateContent getContent() { + return content; + } + + @JsonProperty("type") + public PhoneTemplateNotificationTypeEnum getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public boolean getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneTemplateResponseContent + && equalTo((CreatePhoneTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneTemplateResponseContent other) { + return id.equals(other.id) + && channel.equals(other.channel) + && customizable.equals(other.customizable) + && tenant.equals(other.tenant) + && content.equals(other.content) + && type.equals(other.type) + && disabled == other.disabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ContentStage id(@NotNull String id); + + Builder from(CreatePhoneTemplateResponseContent other); + } + + public interface ContentStage { + TypeStage content(@NotNull PhoneTemplateContent content); + } + + public interface TypeStage { + DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type); + } + + public interface DisabledStage { + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(boolean disabled); + } + + public interface _FinalStage { + CreatePhoneTemplateResponseContent build(); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + _FinalStage customizable(Optional customizable); + + _FinalStage customizable(Boolean customizable); + + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ContentStage, TypeStage, DisabledStage, _FinalStage { + private String id; + + private PhoneTemplateContent content; + + private PhoneTemplateNotificationTypeEnum type; + + private boolean disabled; + + private Optional tenant = Optional.empty(); + + private Optional customizable = Optional.empty(); + + private Optional channel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePhoneTemplateResponseContent other) { + id(other.getId()); + channel(other.getChannel()); + customizable(other.getCustomizable()); + tenant(other.getTenant()); + content(other.getContent()); + type(other.getType()); + disabled(other.getDisabled()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ContentStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public TypeStage content(@NotNull PhoneTemplateContent content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ *

Whether the template is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("disabled") + public _FinalStage disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage customizable(Boolean customizable) { + this.customizable = Optional.ofNullable(customizable); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customizable", nulls = Nulls.SKIP) + public _FinalStage customizable(Optional customizable) { + this.customizable = customizable; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + @java.lang.Override + public CreatePhoneTemplateResponseContent build() { + return new CreatePhoneTemplateResponseContent( + id, channel, customizable, tenant, content, type, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java new file mode 100644 index 000000000..217c9314f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePhoneTemplateTestNotificationResponseContent.Builder.class) +public final class CreatePhoneTemplateTestNotificationResponseContent { + private final String message; + + private final Map additionalProperties; + + private CreatePhoneTemplateTestNotificationResponseContent( + String message, Map additionalProperties) { + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePhoneTemplateTestNotificationResponseContent + && equalTo((CreatePhoneTemplateTestNotificationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePhoneTemplateTestNotificationResponseContent other) { + return message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MessageStage builder() { + return new Builder(); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + + Builder from(CreatePhoneTemplateTestNotificationResponseContent other); + } + + public interface _FinalStage { + CreatePhoneTemplateTestNotificationResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MessageStage, _FinalStage { + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePhoneTemplateTestNotificationResponseContent other) { + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public CreatePhoneTemplateTestNotificationResponseContent build() { + return new CreatePhoneTemplateTestNotificationResponseContent(message, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java new file mode 100644 index 000000000..5d223913e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java @@ -0,0 +1,256 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePublicKeyDeviceCredentialRequestContent.Builder.class) +public final class CreatePublicKeyDeviceCredentialRequestContent { + private final String deviceName; + + private final String type; + + private final String value; + + private final String deviceId; + + private final Optional clientId; + + private final Map additionalProperties; + + private CreatePublicKeyDeviceCredentialRequestContent( + String deviceName, + String type, + String value, + String deviceId, + Optional clientId, + Map additionalProperties) { + this.deviceName = deviceName; + this.type = type; + this.value = value; + this.deviceId = deviceId; + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name for this device easily recognized by owner. + */ + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return Base64 encoded string containing the credential. + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + /** + * @return Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>. + */ + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + /** + * @return client_id of the client (application) this credential is for. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePublicKeyDeviceCredentialRequestContent + && equalTo((CreatePublicKeyDeviceCredentialRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePublicKeyDeviceCredentialRequestContent other) { + return deviceName.equals(other.deviceName) + && type.equals(other.type) + && value.equals(other.value) + && deviceId.equals(other.deviceId) + && clientId.equals(other.clientId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceName, this.type, this.value, this.deviceId, this.clientId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceNameStage builder() { + return new Builder(); + } + + public interface DeviceNameStage { + /** + *

Name for this device easily recognized by owner.

+ */ + TypeStage deviceName(@NotNull String deviceName); + + Builder from(CreatePublicKeyDeviceCredentialRequestContent other); + } + + public interface TypeStage { + ValueStage type(@NotNull String type); + } + + public interface ValueStage { + /** + *

Base64 encoded string containing the credential.

+ */ + DeviceIdStage value(@NotNull String value); + } + + public interface DeviceIdStage { + /** + *

Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>.

+ */ + _FinalStage deviceId(@NotNull String deviceId); + } + + public interface _FinalStage { + CreatePublicKeyDeviceCredentialRequestContent build(); + + /** + *

client_id of the client (application) this credential is for.

+ */ + _FinalStage clientId(Optional clientId); + + _FinalStage clientId(String clientId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceNameStage, TypeStage, ValueStage, DeviceIdStage, _FinalStage { + private String deviceName; + + private String type; + + private String value; + + private String deviceId; + + private Optional clientId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePublicKeyDeviceCredentialRequestContent other) { + deviceName(other.getDeviceName()); + type(other.getType()); + value(other.getValue()); + deviceId(other.getDeviceId()); + clientId(other.getClientId()); + return this; + } + + /** + *

Name for this device easily recognized by owner.

+ *

Name for this device easily recognized by owner.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("device_name") + public TypeStage deviceName(@NotNull String deviceName) { + this.deviceName = Objects.requireNonNull(deviceName, "deviceName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ValueStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Base64 encoded string containing the credential.

+ *

Base64 encoded string containing the credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("value") + public DeviceIdStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + /** + *

Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>.

+ *

Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(@NotNull String deviceId) { + this.deviceId = Objects.requireNonNull(deviceId, "deviceId must not be null"); + return this; + } + + /** + *

client_id of the client (application) this credential is for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

client_id of the client (application) this credential is for.

+ */ + @java.lang.Override + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public _FinalStage clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + @java.lang.Override + public CreatePublicKeyDeviceCredentialRequestContent build() { + return new CreatePublicKeyDeviceCredentialRequestContent( + deviceName, type, value, deviceId, clientId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java new file mode 100644 index 000000000..7287d4940 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreatePublicKeyDeviceCredentialResponseContent.Builder.class) +public final class CreatePublicKeyDeviceCredentialResponseContent { + private final String id; + + private final Map additionalProperties; + + private CreatePublicKeyDeviceCredentialResponseContent(String id, Map additionalProperties) { + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return The credential's identifier + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreatePublicKeyDeviceCredentialResponseContent + && equalTo((CreatePublicKeyDeviceCredentialResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreatePublicKeyDeviceCredentialResponseContent other) { + return id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The credential's identifier

+ */ + _FinalStage id(@NotNull String id); + + Builder from(CreatePublicKeyDeviceCredentialResponseContent other); + } + + public interface _FinalStage { + CreatePublicKeyDeviceCredentialResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreatePublicKeyDeviceCredentialResponseContent other) { + id(other.getId()); + return this; + } + + /** + *

The credential's identifier

+ *

The credential's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public CreatePublicKeyDeviceCredentialResponseContent build() { + return new CreatePublicKeyDeviceCredentialResponseContent(id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java new file mode 100644 index 000000000..ab49444c2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java @@ -0,0 +1,748 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateResourceServerRequestContent.Builder.class) +public final class CreateResourceServerRequestContent { + private final Optional name; + + private final String identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional allowOfflineAccess; + + private final Optional tokenLifetime; + + private final Optional tokenDialect; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional enforcePolicies; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private CreateResourceServerRequestContent( + Optional name, + String identifier, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional allowOfflineAccess, + Optional tokenLifetime, + Optional tokenDialect, + Optional skipConsentForVerifiableFirstPartyClients, + Optional enforcePolicies, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.name = name; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.allowOfflineAccess = allowOfflineAccess; + this.tokenLifetime = tokenLifetime; + this.tokenDialect = tokenDialect; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.enforcePolicies = enforcePolicies; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public String getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Whether to enforce authorization policies (true) or to ignore them (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateResourceServerRequestContent + && equalTo((CreateResourceServerRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateResourceServerRequestContent other) { + return name.equals(other.name) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && tokenLifetime.equals(other.tokenLifetime) + && tokenDialect.equals(other.tokenDialect) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && enforcePolicies.equals(other.enforcePolicies) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.identifier, + this.scopes, + this.signingAlg, + this.signingSecret, + this.allowOfflineAccess, + this.tokenLifetime, + this.tokenDialect, + this.skipConsentForVerifiableFirstPartyClients, + this.enforcePolicies, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdentifierStage builder() { + return new Builder(); + } + + public interface IdentifierStage { + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ */ + _FinalStage identifier(@NotNull String identifier); + + Builder from(CreateResourceServerRequestContent other); + } + + public interface _FinalStage { + CreateResourceServerRequestContent build(); + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

List of permissions (scopes) that this API uses.

+ */ + _FinalStage scopes(Optional> scopes); + + _FinalStage scopes(List scopes); + + _FinalStage signingAlg(Optional signingAlg); + + _FinalStage signingAlg(SigningAlgorithmEnum signingAlg); + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + _FinalStage signingSecret(Optional signingSecret); + + _FinalStage signingSecret(String signingSecret); + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + _FinalStage allowOfflineAccess(Optional allowOfflineAccess); + + _FinalStage allowOfflineAccess(Boolean allowOfflineAccess); + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + _FinalStage tokenLifetime(Optional tokenLifetime); + + _FinalStage tokenLifetime(Integer tokenLifetime); + + _FinalStage tokenDialect(Optional tokenDialect); + + _FinalStage tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect); + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + _FinalStage skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients); + + _FinalStage skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients); + + /** + *

Whether to enforce authorization policies (true) or to ignore them (false).

+ */ + _FinalStage enforcePolicies(Optional enforcePolicies); + + _FinalStage enforcePolicies(Boolean enforcePolicies); + + _FinalStage tokenEncryption(@Nullable OptionalNullable tokenEncryption); + + _FinalStage tokenEncryption(ResourceServerTokenEncryption tokenEncryption); + + _FinalStage tokenEncryption(Optional tokenEncryption); + + _FinalStage tokenEncryption(com.auth0.client.mgmt.core.Nullable tokenEncryption); + + _FinalStage consentPolicy(@Nullable OptionalNullable consentPolicy); + + _FinalStage consentPolicy(String consentPolicy); + + _FinalStage consentPolicy(Optional consentPolicy); + + _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy); + + _FinalStage authorizationDetails(Optional> authorizationDetails); + + _FinalStage authorizationDetails(List authorizationDetails); + + _FinalStage proofOfPossession(@Nullable OptionalNullable proofOfPossession); + + _FinalStage proofOfPossession(ResourceServerProofOfPossession proofOfPossession); + + _FinalStage proofOfPossession(Optional proofOfPossession); + + _FinalStage proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdentifierStage, _FinalStage { + private String identifier; + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateResourceServerRequestContent other) { + name(other.getName()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + allowOfflineAccess(other.getAllowOfflineAccess()); + tokenLifetime(other.getTokenLifetime()); + tokenDialect(other.getTokenDialect()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + enforcePolicies(other.getEnforcePolicies()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("identifier") + public _FinalStage identifier(@NotNull String identifier) { + this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + @java.lang.Override + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public _FinalStage proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + @java.lang.Override + public _FinalStage authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public _FinalStage authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + @java.lang.Override + public _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public _FinalStage consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + @java.lang.Override + public _FinalStage tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public _FinalStage tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + /** + *

Whether to enforce authorization policies (true) or to ignore them (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + /** + *

Whether to enforce authorization policies (true) or to ignore them (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public _FinalStage enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage skipConsentForVerifiableFirstPartyClients( + Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public _FinalStage skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + @java.lang.Override + public _FinalStage tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @java.lang.Override + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public _FinalStage tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @java.lang.Override + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public _FinalStage tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public _FinalStage allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @java.lang.Override + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public _FinalStage signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + @java.lang.Override + public _FinalStage signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public _FinalStage signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @java.lang.Override + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public _FinalStage scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateResourceServerRequestContent build() { + return new CreateResourceServerRequestContent( + name, + identifier, + scopes, + signingAlg, + signingSecret, + allowOfflineAccess, + tokenLifetime, + tokenDialect, + skipConsentForVerifiableFirstPartyClients, + enforcePolicies, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java new file mode 100644 index 000000000..95db4b863 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java @@ -0,0 +1,682 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateResourceServerResponseContent.Builder.class) +public final class CreateResourceServerResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional isSystem; + + private final Optional identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional allowOfflineAccess; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional tokenLifetime; + + private final Optional tokenLifetimeForWeb; + + private final Optional enforcePolicies; + + private final Optional tokenDialect; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private CreateResourceServerResponseContent( + Optional id, + Optional name, + Optional isSystem, + Optional identifier, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional allowOfflineAccess, + Optional skipConsentForVerifiableFirstPartyClients, + Optional tokenLifetime, + Optional tokenLifetimeForWeb, + Optional enforcePolicies, + Optional tokenDialect, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.id = id; + this.name = name; + this.isSystem = isSystem; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.allowOfflineAccess = allowOfflineAccess; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + this.enforcePolicies = enforcePolicies; + this.tokenDialect = tokenDialect; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the API (resource server). + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this is an Auth0 system API (true) or a custom API (false). + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value. + */ + @JsonProperty("token_lifetime_for_web") + public Optional getTokenLifetimeForWeb() { + return tokenLifetimeForWeb; + } + + /** + * @return Whether authorization polices are enforced (true) or unenforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateResourceServerResponseContent + && equalTo((CreateResourceServerResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateResourceServerResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && isSystem.equals(other.isSystem) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) + && enforcePolicies.equals(other.enforcePolicies) + && tokenDialect.equals(other.tokenDialect) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.isSystem, + this.identifier, + this.scopes, + this.signingAlg, + this.signingSecret, + this.allowOfflineAccess, + this.skipConsentForVerifiableFirstPartyClients, + this.tokenLifetime, + this.tokenLifetimeForWeb, + this.enforcePolicies, + this.tokenDialect, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenLifetimeForWeb = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateResourceServerResponseContent other) { + id(other.getId()); + name(other.getName()); + isSystem(other.getIsSystem()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + allowOfflineAccess(other.getAllowOfflineAccess()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); + enforcePolicies(other.getEnforcePolicies()); + tokenDialect(other.getTokenDialect()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

ID of the API (resource server).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this is an Auth0 system API (true) or a custom API (false).

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public Builder signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + public Builder signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public Builder allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + public Builder allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public Builder skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + public Builder skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value.

+ */ + @JsonSetter(value = "token_lifetime_for_web", nulls = Nulls.SKIP) + public Builder tokenLifetimeForWeb(Optional tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + return this; + } + + public Builder tokenLifetimeForWeb(Integer tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = Optional.ofNullable(tokenLifetimeForWeb); + return this; + } + + /** + *

Whether authorization polices are enforced (true) or unenforced (false).

+ */ + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public Builder enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + public Builder enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectResponseEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + public CreateResourceServerResponseContent build() { + return new CreateResourceServerResponseContent( + id, + name, + isSystem, + identifier, + scopes, + signingAlg, + signingSecret, + allowOfflineAccess, + skipConsentForVerifiableFirstPartyClients, + tokenLifetime, + tokenLifetimeForWeb, + enforcePolicies, + tokenDialect, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java new file mode 100644 index 000000000..3af2f35e5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateRoleRequestContent.Builder.class) +public final class CreateRoleRequestContent { + private final String name; + + private final Optional description; + + private final Map additionalProperties; + + private CreateRoleRequestContent( + String name, Optional description, Map additionalProperties) { + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the role. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Description of the role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRoleRequestContent && equalTo((CreateRoleRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRoleRequestContent other) { + return name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of the role.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateRoleRequestContent other); + } + + public interface _FinalStage { + CreateRoleRequestContent build(); + + /** + *

Description of the role.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateRoleRequestContent other) { + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

Name of the role.

+ *

Name of the role.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Description of the role.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Description of the role.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CreateRoleRequestContent build() { + return new CreateRoleRequestContent(name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java new file mode 100644 index 000000000..63cb8d6cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateRoleResponseContent.Builder.class) +public final class CreateRoleResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Map additionalProperties; + + private CreateRoleResponseContent( + Optional id, + Optional name, + Optional description, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this role. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of this role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRoleResponseContent && equalTo((CreateRoleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRoleResponseContent other) { + return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateRoleResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

ID for this role.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Description of this role.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public CreateRoleResponseContent build() { + return new CreateRoleResponseContent(id, name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java new file mode 100644 index 000000000..7726d91f6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateRuleRequestContent.Builder.class) +public final class CreateRuleRequestContent { + private final String name; + + private final String script; + + private final Optional order; + + private final Optional enabled; + + private final Map additionalProperties; + + private CreateRuleRequestContent( + String name, + String script, + Optional order, + Optional enabled, + Map additionalProperties) { + this.name = name; + this.script = script; + this.order = order; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public String getScript() { + return script; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRuleRequestContent && equalTo((CreateRuleRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRuleRequestContent other) { + return name.equals(other.name) + && script.equals(other.script) + && order.equals(other.order) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.script, this.order, this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of this rule.

+ */ + ScriptStage name(@NotNull String name); + + Builder from(CreateRuleRequestContent other); + } + + public interface ScriptStage { + /** + *

Code to be executed when this rule runs.

+ */ + _FinalStage script(@NotNull String script); + } + + public interface _FinalStage { + CreateRuleRequestContent build(); + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + _FinalStage order(Optional order); + + _FinalStage order(Double order); + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(Boolean enabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, ScriptStage, _FinalStage { + private String name; + + private String script; + + private Optional enabled = Optional.empty(); + + private Optional order = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateRuleRequestContent other) { + name(other.getName()); + script(other.getScript()); + order(other.getOrder()); + enabled(other.getEnabled()); + return this; + } + + /** + *

Name of this rule.

+ *

Name of this rule.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public ScriptStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ *

Code to be executed when this rule runs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("script") + public _FinalStage script(@NotNull String script) { + this.script = Objects.requireNonNull(script, "script must not be null"); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @java.lang.Override + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public _FinalStage order(Optional order) { + this.order = order; + return this; + } + + @java.lang.Override + public CreateRuleRequestContent build() { + return new CreateRuleRequestContent(name, script, order, enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java new file mode 100644 index 000000000..5b3dc4157 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateRuleResponseContent.Builder.class) +public final class CreateRuleResponseContent { + private final Optional name; + + private final Optional id; + + private final Optional enabled; + + private final Optional script; + + private final Optional order; + + private final Optional stage; + + private final Map additionalProperties; + + private CreateRuleResponseContent( + Optional name, + Optional id, + Optional enabled, + Optional script, + Optional order, + Optional stage, + Map additionalProperties) { + this.name = name; + this.id = id; + this.enabled = enabled; + this.script = script; + this.order = order; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return ID of this rule. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Execution stage of this rule. Can be login_success, login_failure, or pre_authorize. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRuleResponseContent && equalTo((CreateRuleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRuleResponseContent other) { + return name.equals(other.name) + && id.equals(other.id) + && enabled.equals(other.enabled) + && script.equals(other.script) + && order.equals(other.order) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional order = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateRuleResponseContent other) { + name(other.getName()); + id(other.getId()); + enabled(other.getEnabled()); + script(other.getScript()); + order(other.getOrder()); + stage(other.getStage()); + return this; + } + + /** + *

Name of this rule.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

ID of this rule.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Execution stage of this rule. Can be login_success, login_failure, or pre_authorize.

+ */ + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(String stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public CreateRuleResponseContent build() { + return new CreateRuleResponseContent(name, id, enabled, script, order, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java new file mode 100644 index 000000000..bc9639641 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateScimConfigurationRequestContent.Builder.class) +public final class CreateScimConfigurationRequestContent { + private final Optional userIdAttribute; + + private final Optional> mapping; + + private final Map additionalProperties; + + private CreateScimConfigurationRequestContent( + Optional userIdAttribute, + Optional> mapping, + Map additionalProperties) { + this.userIdAttribute = userIdAttribute; + this.mapping = mapping; + this.additionalProperties = additionalProperties; + } + + /** + * @return User ID attribute for generating unique user ids + */ + @JsonProperty("user_id_attribute") + public Optional getUserIdAttribute() { + return userIdAttribute; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateScimConfigurationRequestContent + && equalTo((CreateScimConfigurationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateScimConfigurationRequestContent other) { + return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdAttribute, this.mapping); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userIdAttribute = Optional.empty(); + + private Optional> mapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateScimConfigurationRequestContent other) { + userIdAttribute(other.getUserIdAttribute()); + mapping(other.getMapping()); + return this; + } + + /** + *

User ID attribute for generating unique user ids

+ */ + @JsonSetter(value = "user_id_attribute", nulls = Nulls.SKIP) + public Builder userIdAttribute(Optional userIdAttribute) { + this.userIdAttribute = userIdAttribute; + return this; + } + + public Builder userIdAttribute(String userIdAttribute) { + this.userIdAttribute = Optional.ofNullable(userIdAttribute); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + public CreateScimConfigurationRequestContent build() { + return new CreateScimConfigurationRequestContent(userIdAttribute, mapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java new file mode 100644 index 000000000..d9e4761b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateScimConfigurationResponseContent.Builder.class) +public final class CreateScimConfigurationResponseContent { + private final Optional connectionId; + + private final Optional connectionName; + + private final Optional strategy; + + private final Optional tenantName; + + private final Optional userIdAttribute; + + private final Optional> mapping; + + private final Optional createdAt; + + private final Optional updatedOn; + + private final Map additionalProperties; + + private CreateScimConfigurationResponseContent( + Optional connectionId, + Optional connectionName, + Optional strategy, + Optional tenantName, + Optional userIdAttribute, + Optional> mapping, + Optional createdAt, + Optional updatedOn, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.tenantName = tenantName; + this.userIdAttribute = userIdAttribute; + this.mapping = mapping; + this.createdAt = createdAt; + this.updatedOn = updatedOn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_name") + public Optional getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return The tenant's name + */ + @JsonProperty("tenant_name") + public Optional getTenantName() { + return tenantName; + } + + /** + * @return User ID attribute for generating unique user ids + */ + @JsonProperty("user_id_attribute") + public Optional getUserIdAttribute() { + return userIdAttribute; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + /** + * @return The Date Time Scim Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The Date Time Scim Configuration was last updated + */ + @JsonProperty("updated_on") + public Optional getUpdatedOn() { + return updatedOn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateScimConfigurationResponseContent + && equalTo((CreateScimConfigurationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateScimConfigurationResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && tenantName.equals(other.tenantName) + && userIdAttribute.equals(other.userIdAttribute) + && mapping.equals(other.mapping) + && createdAt.equals(other.createdAt) + && updatedOn.equals(other.updatedOn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.tenantName, + this.userIdAttribute, + this.mapping, + this.createdAt, + this.updatedOn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional connectionName = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional tenantName = Optional.empty(); + + private Optional userIdAttribute = Optional.empty(); + + private Optional> mapping = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedOn = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateScimConfigurationResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + tenantName(other.getTenantName()); + userIdAttribute(other.getUserIdAttribute()); + mapping(other.getMapping()); + createdAt(other.getCreatedAt()); + updatedOn(other.getUpdatedOn()); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_name", nulls = Nulls.SKIP) + public Builder connectionName(Optional connectionName) { + this.connectionName = connectionName; + return this; + } + + public Builder connectionName(String connectionName) { + this.connectionName = Optional.ofNullable(connectionName); + return this; + } + + /** + *

The connection's strategy

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

The tenant's name

+ */ + @JsonSetter(value = "tenant_name", nulls = Nulls.SKIP) + public Builder tenantName(Optional tenantName) { + this.tenantName = tenantName; + return this; + } + + public Builder tenantName(String tenantName) { + this.tenantName = Optional.ofNullable(tenantName); + return this; + } + + /** + *

User ID attribute for generating unique user ids

+ */ + @JsonSetter(value = "user_id_attribute", nulls = Nulls.SKIP) + public Builder userIdAttribute(Optional userIdAttribute) { + this.userIdAttribute = userIdAttribute; + return this; + } + + public Builder userIdAttribute(String userIdAttribute) { + this.userIdAttribute = Optional.ofNullable(userIdAttribute); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + /** + *

The Date Time Scim Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The Date Time Scim Configuration was last updated

+ */ + @JsonSetter(value = "updated_on", nulls = Nulls.SKIP) + public Builder updatedOn(Optional updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + public Builder updatedOn(String updatedOn) { + this.updatedOn = Optional.ofNullable(updatedOn); + return this; + } + + public CreateScimConfigurationResponseContent build() { + return new CreateScimConfigurationResponseContent( + connectionId, + connectionName, + strategy, + tenantName, + userIdAttribute, + mapping, + createdAt, + updatedOn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java new file mode 100644 index 000000000..8eaff6e57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateScimTokenResponseContent.Builder.class) +public final class CreateScimTokenResponseContent { + private final Optional tokenId; + + private final Optional token; + + private final Optional> scopes; + + private final Optional createdAt; + + private final Optional validUntil; + + private final Map additionalProperties; + + private CreateScimTokenResponseContent( + Optional tokenId, + Optional token, + Optional> scopes, + Optional createdAt, + Optional validUntil, + Map additionalProperties) { + this.tokenId = tokenId; + this.token = token; + this.scopes = scopes; + this.createdAt = createdAt; + this.validUntil = validUntil; + this.additionalProperties = additionalProperties; + } + + /** + * @return The token's identifier + */ + @JsonProperty("token_id") + public Optional getTokenId() { + return tokenId; + } + + /** + * @return The scim client's token + */ + @JsonProperty("token") + public Optional getToken() { + return token; + } + + /** + * @return The scopes of the scim token + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + /** + * @return The token's created at timestamp + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The token's valid until at timestamp + */ + @JsonProperty("valid_until") + public Optional getValidUntil() { + return validUntil; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateScimTokenResponseContent && equalTo((CreateScimTokenResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateScimTokenResponseContent other) { + return tokenId.equals(other.tokenId) + && token.equals(other.token) + && scopes.equals(other.scopes) + && createdAt.equals(other.createdAt) + && validUntil.equals(other.validUntil); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tokenId, this.token, this.scopes, this.createdAt, this.validUntil); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tokenId = Optional.empty(); + + private Optional token = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional validUntil = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateScimTokenResponseContent other) { + tokenId(other.getTokenId()); + token(other.getToken()); + scopes(other.getScopes()); + createdAt(other.getCreatedAt()); + validUntil(other.getValidUntil()); + return this; + } + + /** + *

The token's identifier

+ */ + @JsonSetter(value = "token_id", nulls = Nulls.SKIP) + public Builder tokenId(Optional tokenId) { + this.tokenId = tokenId; + return this; + } + + public Builder tokenId(String tokenId) { + this.tokenId = Optional.ofNullable(tokenId); + return this; + } + + /** + *

The scim client's token

+ */ + @JsonSetter(value = "token", nulls = Nulls.SKIP) + public Builder token(Optional token) { + this.token = token; + return this; + } + + public Builder token(String token) { + this.token = Optional.ofNullable(token); + return this; + } + + /** + *

The scopes of the scim token

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + *

The token's created at timestamp

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The token's valid until at timestamp

+ */ + @JsonSetter(value = "valid_until", nulls = Nulls.SKIP) + public Builder validUntil(Optional validUntil) { + this.validUntil = validUntil; + return this; + } + + public Builder validUntil(String validUntil) { + this.validUntil = Optional.ofNullable(validUntil); + return this; + } + + public CreateScimTokenResponseContent build() { + return new CreateScimTokenResponseContent( + tokenId, token, scopes, createdAt, validUntil, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java new file mode 100644 index 000000000..208a9659a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java @@ -0,0 +1,279 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSelfServiceProfileRequestContent.Builder.class) +public final class CreateSelfServiceProfileRequestContent { + private final String name; + + private final Optional description; + + private final Optional branding; + + private final Optional> allowedStrategies; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private CreateSelfServiceProfileRequestContent( + String name, + Optional description, + Optional branding, + Optional> allowedStrategies, + Optional> userAttributes, + Map additionalProperties) { + this.name = name; + this.description = description; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The description of the self-service Profile. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + /** + * @return List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + */ + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSelfServiceProfileRequestContent + && equalTo((CreateSelfServiceProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSelfServiceProfileRequestContent other) { + return name.equals(other.name) + && description.equals(other.description) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies) + && userAttributes.equals(other.userAttributes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.branding, this.allowedStrategies, this.userAttributes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The name of the self-service Profile.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(CreateSelfServiceProfileRequestContent other); + } + + public interface _FinalStage { + CreateSelfServiceProfileRequestContent build(); + + /** + *

The description of the self-service Profile.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage branding(Optional branding); + + _FinalStage branding(SelfServiceProfileBrandingProperties branding); + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + _FinalStage allowedStrategies(Optional> allowedStrategies); + + _FinalStage allowedStrategies(List allowedStrategies); + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + _FinalStage userAttributes(Optional> userAttributes); + + _FinalStage userAttributes(List userAttributes); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> userAttributes = Optional.empty(); + + private Optional> allowedStrategies = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateSelfServiceProfileRequestContent other) { + name(other.getName()); + description(other.getDescription()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + userAttributes(other.getUserAttributes()); + return this; + } + + /** + *

The name of the self-service Profile.

+ *

The name of the self-service Profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userAttributes(List userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + @java.lang.Override + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public _FinalStage userAttributes(Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @java.lang.Override + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public _FinalStage allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + @java.lang.Override + public _FinalStage branding(SelfServiceProfileBrandingProperties branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public _FinalStage branding(Optional branding) { + this.branding = branding; + return this; + } + + /** + *

The description of the self-service Profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

The description of the self-service Profile.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CreateSelfServiceProfileRequestContent build() { + return new CreateSelfServiceProfileRequestContent( + name, description, branding, allowedStrategies, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java new file mode 100644 index 000000000..427743b99 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java @@ -0,0 +1,327 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSelfServiceProfileResponseContent.Builder.class) +public final class CreateSelfServiceProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Optional> userAttributes; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional branding; + + private final Optional> allowedStrategies; + + private final Map additionalProperties; + + private CreateSelfServiceProfileResponseContent( + Optional id, + Optional name, + Optional description, + Optional> userAttributes, + Optional createdAt, + Optional updatedAt, + Optional branding, + Optional> allowedStrategies, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.userAttributes = userAttributes; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the self-service Profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the self-service Profile. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + */ + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + /** + * @return The time when this self-service Profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this self-service Profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSelfServiceProfileResponseContent + && equalTo((CreateSelfServiceProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSelfServiceProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && description.equals(other.description) + && userAttributes.equals(other.userAttributes) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.description, + this.userAttributes, + this.createdAt, + this.updatedAt, + this.branding, + this.allowedStrategies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> userAttributes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> allowedStrategies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSelfServiceProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + userAttributes(other.getUserAttributes()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + return this; + } + + /** + *

The unique ID of the self-service Profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the self-service Profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The description of the self-service Profile.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes(Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes(List userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + /** + *

The time when this self-service Profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this self-service Profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(SelfServiceProfileBrandingProperties branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public Builder allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + public Builder allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + public CreateSelfServiceProfileResponseContent build() { + return new CreateSelfServiceProfileResponseContent( + id, + name, + description, + userAttributes, + createdAt, + updatedAt, + branding, + allowedStrategies, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java new file mode 100644 index 000000000..3258ba8b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSelfServiceProfileSsoTicketResponseContent.Builder.class) +public final class CreateSelfServiceProfileSsoTicketResponseContent { + private final Optional ticket; + + private final Map additionalProperties; + + private CreateSelfServiceProfileSsoTicketResponseContent( + Optional ticket, Map additionalProperties) { + this.ticket = ticket; + this.additionalProperties = additionalProperties; + } + + /** + * @return The URL for the created ticket. + */ + @JsonProperty("ticket") + public Optional getTicket() { + return ticket; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSelfServiceProfileSsoTicketResponseContent + && equalTo((CreateSelfServiceProfileSsoTicketResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSelfServiceProfileSsoTicketResponseContent other) { + return ticket.equals(other.ticket); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ticket); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ticket = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSelfServiceProfileSsoTicketResponseContent other) { + ticket(other.getTicket()); + return this; + } + + /** + *

The URL for the created ticket.

+ */ + @JsonSetter(value = "ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(String ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + public CreateSelfServiceProfileSsoTicketResponseContent build() { + return new CreateSelfServiceProfileSsoTicketResponseContent(ticket, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java new file mode 100644 index 000000000..cecd7729b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTokenExchangeProfileRequestContent.Builder.class) +public final class CreateTokenExchangeProfileRequestContent { + private final String name; + + private final String subjectTokenType; + + private final String actionId; + + private final String type; + + private final Map additionalProperties; + + private CreateTokenExchangeProfileRequestContent( + String name, + String subjectTokenType, + String actionId, + String type, + Map additionalProperties) { + this.name = name; + this.subjectTokenType = subjectTokenType; + this.actionId = actionId; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return Friendly name of this profile. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + */ + @JsonProperty("subject_token_type") + public String getSubjectTokenType() { + return subjectTokenType; + } + + /** + * @return The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + */ + @JsonProperty("action_id") + public String getActionId() { + return actionId; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTokenExchangeProfileRequestContent + && equalTo((CreateTokenExchangeProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTokenExchangeProfileRequestContent other) { + return name.equals(other.name) + && subjectTokenType.equals(other.subjectTokenType) + && actionId.equals(other.actionId) + && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subjectTokenType, this.actionId, this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Friendly name of this profile.

+ */ + SubjectTokenTypeStage name(@NotNull String name); + + Builder from(CreateTokenExchangeProfileRequestContent other); + } + + public interface SubjectTokenTypeStage { + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ */ + ActionIdStage subjectTokenType(@NotNull String subjectTokenType); + } + + public interface ActionIdStage { + /** + *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ */ + TypeStage actionId(@NotNull String actionId); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + CreateTokenExchangeProfileRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, SubjectTokenTypeStage, ActionIdStage, TypeStage, _FinalStage { + private String name; + + private String subjectTokenType; + + private String actionId; + + private String type; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTokenExchangeProfileRequestContent other) { + name(other.getName()); + subjectTokenType(other.getSubjectTokenType()); + actionId(other.getActionId()); + type(other.getType()); + return this; + } + + /** + *

Friendly name of this profile.

+ *

Friendly name of this profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public SubjectTokenTypeStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("subject_token_type") + public ActionIdStage subjectTokenType(@NotNull String subjectTokenType) { + this.subjectTokenType = Objects.requireNonNull(subjectTokenType, "subjectTokenType must not be null"); + return this; + } + + /** + *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_id") + public TypeStage actionId(@NotNull String actionId) { + this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public CreateTokenExchangeProfileRequestContent build() { + return new CreateTokenExchangeProfileRequestContent( + name, subjectTokenType, actionId, type, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java new file mode 100644 index 000000000..5f3fd2c6c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTokenExchangeProfileResponseContent.Builder.class) +public final class CreateTokenExchangeProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional subjectTokenType; + + private final Optional actionId; + + private final Optional type; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private CreateTokenExchangeProfileResponseContent( + Optional id, + Optional name, + Optional subjectTokenType, + Optional actionId, + Optional type, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subjectTokenType = subjectTokenType; + this.actionId = actionId; + this.type = type; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the token exchange profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name of this profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + */ + @JsonProperty("subject_token_type") + public Optional getSubjectTokenType() { + return subjectTokenType; + } + + /** + * @return The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The time when this profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTokenExchangeProfileResponseContent + && equalTo((CreateTokenExchangeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTokenExchangeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subjectTokenType.equals(other.subjectTokenType) + && actionId.equals(other.actionId) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional subjectTokenType = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateTokenExchangeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + subjectTokenType(other.getSubjectTokenType()); + actionId(other.getActionId()); + type(other.getType()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The unique ID of the token exchange profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name of this profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ */ + @JsonSetter(value = "subject_token_type", nulls = Nulls.SKIP) + public Builder subjectTokenType(Optional subjectTokenType) { + this.subjectTokenType = subjectTokenType; + return this; + } + + public Builder subjectTokenType(String subjectTokenType) { + this.subjectTokenType = Optional.ofNullable(subjectTokenType); + return this; + } + + /** + *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The time when this profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public CreateTokenExchangeProfileResponseContent build() { + return new CreateTokenExchangeProfileResponseContent( + id, name, subjectTokenType, actionId, type, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java new file mode 100644 index 000000000..6e97155ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTokenQuota.Builder.class) +public final class CreateTokenQuota { + private final TokenQuotaClientCredentials clientCredentials; + + private final Map additionalProperties; + + private CreateTokenQuota(TokenQuotaClientCredentials clientCredentials, Map additionalProperties) { + this.clientCredentials = clientCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_credentials") + public TokenQuotaClientCredentials getClientCredentials() { + return clientCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTokenQuota && equalTo((CreateTokenQuota) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTokenQuota other) { + return clientCredentials.equals(other.clientCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientCredentialsStage builder() { + return new Builder(); + } + + public interface ClientCredentialsStage { + _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials); + + Builder from(CreateTokenQuota other); + } + + public interface _FinalStage { + CreateTokenQuota build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientCredentialsStage, _FinalStage { + private TokenQuotaClientCredentials clientCredentials; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTokenQuota other) { + clientCredentials(other.getClientCredentials()); + return this; + } + + @java.lang.Override + @JsonSetter("client_credentials") + public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { + this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); + return this; + } + + @java.lang.Override + public CreateTokenQuota build() { + return new CreateTokenQuota(clientCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java new file mode 100644 index 000000000..70d53ec80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserAuthenticationMethodResponseContent.Builder.class) +public final class CreateUserAuthenticationMethodResponseContent { + private final Optional id; + + private final CreatedUserAuthenticationMethodTypeEnum type; + + private final Optional name; + + private final Optional totpSecret; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional> authenticationMethods; + + private final Optional preferredAuthenticationMethod; + + private final Optional keyId; + + private final Optional publicKey; + + private final Optional relyingPartyIdentifier; + + private final Optional createdAt; + + private final Map additionalProperties; + + private CreateUserAuthenticationMethodResponseContent( + Optional id, + CreatedUserAuthenticationMethodTypeEnum type, + Optional name, + Optional totpSecret, + Optional phoneNumber, + Optional email, + Optional> authenticationMethods, + Optional preferredAuthenticationMethod, + Optional keyId, + Optional publicKey, + Optional relyingPartyIdentifier, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.type = type; + this.name = name; + this.totpSecret = totpSecret; + this.phoneNumber = phoneNumber; + this.email = email; + this.authenticationMethods = authenticationMethods; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.keyId = keyId; + this.publicKey = publicKey; + this.relyingPartyIdentifier = relyingPartyIdentifier; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the newly created authentication method (automatically generated by the application) + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("type") + public CreatedUserAuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return A human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Base32 encoded secret for TOTP generation + */ + @JsonProperty("totp_secret") + public Optional getTotpSecret() { + return totpSecret; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("authentication_methods") + public Optional> getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return Applies to webauthn authenticators only. The id of the credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authenticators only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Applies to webauthn authenticators only. The relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + /** + * @return Authentication method creation date + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserAuthenticationMethodResponseContent + && equalTo((CreateUserAuthenticationMethodResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserAuthenticationMethodResponseContent other) { + return id.equals(other.id) + && type.equals(other.type) + && name.equals(other.name) + && totpSecret.equals(other.totpSecret) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && authenticationMethods.equals(other.authenticationMethods) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.type, + this.name, + this.totpSecret, + this.phoneNumber, + this.email, + this.authenticationMethods, + this.preferredAuthenticationMethod, + this.keyId, + this.publicKey, + this.relyingPartyIdentifier, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type); + + Builder from(CreateUserAuthenticationMethodResponseContent other); + } + + public interface _FinalStage { + CreateUserAuthenticationMethodResponseContent build(); + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

A human-readable label to identify the authentication method.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Base32 encoded secret for TOTP generation

+ */ + _FinalStage totpSecret(Optional totpSecret); + + _FinalStage totpSecret(String totpSecret); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage authenticationMethods(Optional> authenticationMethods); + + _FinalStage authenticationMethods(List authenticationMethods); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authenticators only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); + + /** + *

Authentication method creation date

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CreatedUserAuthenticationMethodTypeEnum type; + + private Optional createdAt = Optional.empty(); + + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional> authenticationMethods = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional totpSecret = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateUserAuthenticationMethodResponseContent other) { + id(other.getId()); + type(other.getType()); + name(other.getName()); + totpSecret(other.getTotpSecret()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + authenticationMethods(other.getAuthenticationMethods()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); + createdAt(other.getCreatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Authentication method creation date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Authentication method creation date

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ */ + @java.lang.Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to webauthn authenticators only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authenticators only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public _FinalStage authenticationMethods(List authenticationMethods) { + this.authenticationMethods = Optional.ofNullable(authenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public _FinalStage authenticationMethods( + Optional> authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage totpSecret(String totpSecret) { + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ */ + @java.lang.Override + @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) + public _FinalStage totpSecret(Optional totpSecret) { + this.totpSecret = totpSecret; + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public CreateUserAuthenticationMethodResponseContent build() { + return new CreateUserAuthenticationMethodResponseContent( + id, + type, + name, + totpSecret, + phoneNumber, + email, + authenticationMethods, + preferredAuthenticationMethod, + keyId, + publicKey, + relyingPartyIdentifier, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java new file mode 100644 index 000000000..fa39b1afa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java @@ -0,0 +1,814 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserRequestContent.Builder.class) +public final class CreateUserRequestContent { + private final Optional email; + + private final Optional phoneNumber; + + private final Optional> userMetadata; + + private final Optional blocked; + + private final Optional emailVerified; + + private final Optional phoneVerified; + + private final Optional> appMetadata; + + private final Optional givenName; + + private final Optional familyName; + + private final Optional name; + + private final Optional nickname; + + private final Optional picture; + + private final Optional userId; + + private final String connection; + + private final Optional password; + + private final Optional verifyEmail; + + private final Optional username; + + private final Map additionalProperties; + + private CreateUserRequestContent( + Optional email, + Optional phoneNumber, + Optional> userMetadata, + Optional blocked, + Optional emailVerified, + Optional phoneVerified, + Optional> appMetadata, + Optional givenName, + Optional familyName, + Optional name, + Optional nickname, + Optional picture, + Optional userId, + String connection, + Optional password, + Optional verifyEmail, + Optional username, + Map additionalProperties) { + this.email = email; + this.phoneNumber = phoneNumber; + this.userMetadata = userMetadata; + this.blocked = blocked; + this.emailVerified = emailVerified; + this.phoneVerified = phoneVerified; + this.appMetadata = appMetadata; + this.givenName = givenName; + this.familyName = familyName; + this.name = name; + this.nickname = nickname; + this.picture = picture; + this.userId = userId; + this.connection = connection; + this.password = password; + this.verifyEmail = verifyEmail; + this.username = username; + this.additionalProperties = additionalProperties; + } + + /** + * @return The user's email. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return The user's phone number (following the E.164 recommendation). + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return Whether this user was blocked by an administrator (true) or not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + /** + * @return The user's given name(s). + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return The user's family name(s). + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + /** + * @return The user's full name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The user's nickname. + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return A URI pointing to the user's picture. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return The external user's id provided by the identity provider. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Name of the connection this user should be created in. + */ + @JsonProperty("connection") + public String getConnection() { + return connection; + } + + /** + * @return Initial password for this user. Only valid for auth0 connection strategy. + */ + @JsonProperty("password") + public Optional getPassword() { + return password; + } + + /** + * @return Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter. + */ + @JsonProperty("verify_email") + public Optional getVerifyEmail() { + return verifyEmail; + } + + /** + * @return The user's username. Only valid if the connection requires a username. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserRequestContent && equalTo((CreateUserRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserRequestContent other) { + return email.equals(other.email) + && phoneNumber.equals(other.phoneNumber) + && userMetadata.equals(other.userMetadata) + && blocked.equals(other.blocked) + && emailVerified.equals(other.emailVerified) + && phoneVerified.equals(other.phoneVerified) + && appMetadata.equals(other.appMetadata) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName) + && name.equals(other.name) + && nickname.equals(other.nickname) + && picture.equals(other.picture) + && userId.equals(other.userId) + && connection.equals(other.connection) + && password.equals(other.password) + && verifyEmail.equals(other.verifyEmail) + && username.equals(other.username); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.email, + this.phoneNumber, + this.userMetadata, + this.blocked, + this.emailVerified, + this.phoneVerified, + this.appMetadata, + this.givenName, + this.familyName, + this.name, + this.nickname, + this.picture, + this.userId, + this.connection, + this.password, + this.verifyEmail, + this.username); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionStage builder() { + return new Builder(); + } + + public interface ConnectionStage { + /** + *

Name of the connection this user should be created in.

+ */ + _FinalStage connection(@NotNull String connection); + + Builder from(CreateUserRequestContent other); + } + + public interface _FinalStage { + CreateUserRequestContent build(); + + /** + *

The user's email.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + /** + *

The user's phone number (following the E.164 recommendation).

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage userMetadata(Optional> userMetadata); + + _FinalStage userMetadata(Map userMetadata); + + /** + *

Whether this user was blocked by an administrator (true) or not (false).

+ */ + _FinalStage blocked(Optional blocked); + + _FinalStage blocked(Boolean blocked); + + /** + *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

+ */ + _FinalStage emailVerified(Optional emailVerified); + + _FinalStage emailVerified(Boolean emailVerified); + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + _FinalStage phoneVerified(Optional phoneVerified); + + _FinalStage phoneVerified(Boolean phoneVerified); + + _FinalStage appMetadata(Optional> appMetadata); + + _FinalStage appMetadata(Map appMetadata); + + /** + *

The user's given name(s).

+ */ + _FinalStage givenName(Optional givenName); + + _FinalStage givenName(String givenName); + + /** + *

The user's family name(s).

+ */ + _FinalStage familyName(Optional familyName); + + _FinalStage familyName(String familyName); + + /** + *

The user's full name.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

The user's nickname.

+ */ + _FinalStage nickname(Optional nickname); + + _FinalStage nickname(String nickname); + + /** + *

A URI pointing to the user's picture.

+ */ + _FinalStage picture(Optional picture); + + _FinalStage picture(String picture); + + /** + *

The external user's id provided by the identity provider.

+ */ + _FinalStage userId(Optional userId); + + _FinalStage userId(String userId); + + /** + *

Initial password for this user. Only valid for auth0 connection strategy.

+ */ + _FinalStage password(Optional password); + + _FinalStage password(String password); + + /** + *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

+ */ + _FinalStage verifyEmail(Optional verifyEmail); + + _FinalStage verifyEmail(Boolean verifyEmail); + + /** + *

The user's username. Only valid if the connection requires a username.

+ */ + _FinalStage username(Optional username); + + _FinalStage username(String username); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionStage, _FinalStage { + private String connection; + + private Optional username = Optional.empty(); + + private Optional verifyEmail = Optional.empty(); + + private Optional password = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional nickname = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional familyName = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional blocked = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional email = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateUserRequestContent other) { + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + userMetadata(other.getUserMetadata()); + blocked(other.getBlocked()); + emailVerified(other.getEmailVerified()); + phoneVerified(other.getPhoneVerified()); + appMetadata(other.getAppMetadata()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + name(other.getName()); + nickname(other.getNickname()); + picture(other.getPicture()); + userId(other.getUserId()); + connection(other.getConnection()); + password(other.getPassword()); + verifyEmail(other.getVerifyEmail()); + username(other.getUsername()); + return this; + } + + /** + *

Name of the connection this user should be created in.

+ *

Name of the connection this user should be created in.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection") + public _FinalStage connection(@NotNull String connection) { + this.connection = Objects.requireNonNull(connection, "connection must not be null"); + return this; + } + + /** + *

The user's username. Only valid if the connection requires a username.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

The user's username. Only valid if the connection requires a username.

+ */ + @java.lang.Override + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public _FinalStage username(Optional username) { + this.username = username; + return this; + } + + /** + *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage verifyEmail(Boolean verifyEmail) { + this.verifyEmail = Optional.ofNullable(verifyEmail); + return this; + } + + /** + *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

+ */ + @java.lang.Override + @JsonSetter(value = "verify_email", nulls = Nulls.SKIP) + public _FinalStage verifyEmail(Optional verifyEmail) { + this.verifyEmail = verifyEmail; + return this; + } + + /** + *

Initial password for this user. Only valid for auth0 connection strategy.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage password(String password) { + this.password = Optional.ofNullable(password); + return this; + } + + /** + *

Initial password for this user. Only valid for auth0 connection strategy.

+ */ + @java.lang.Override + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public _FinalStage password(Optional password) { + this.password = password; + return this; + } + + /** + *

The external user's id provided by the identity provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

The external user's id provided by the identity provider.

+ */ + @java.lang.Override + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public _FinalStage userId(Optional userId) { + this.userId = userId; + return this; + } + + /** + *

A URI pointing to the user's picture.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

A URI pointing to the user's picture.

+ */ + @java.lang.Override + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public _FinalStage picture(Optional picture) { + this.picture = picture; + return this; + } + + /** + *

The user's nickname.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nickname(String nickname) { + this.nickname = Optional.ofNullable(nickname); + return this; + } + + /** + *

The user's nickname.

+ */ + @java.lang.Override + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public _FinalStage nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + /** + *

The user's full name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The user's full name.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The user's family name(s).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + /** + *

The user's family name(s).

+ */ + @java.lang.Override + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public _FinalStage familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + /** + *

The user's given name(s).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

The user's given name(s).

+ */ + @java.lang.Override + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public _FinalStage givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + @java.lang.Override + public _FinalStage appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public _FinalStage appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public _FinalStage phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

+ */ + @java.lang.Override + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public _FinalStage emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public _FinalStage blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + @java.lang.Override + public _FinalStage userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public _FinalStage userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + /** + *

The user's phone number (following the E.164 recommendation).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

The user's phone number (following the E.164 recommendation).

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

The user's email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

The user's email.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public CreateUserRequestContent build() { + return new CreateUserRequestContent( + email, + phoneNumber, + userMetadata, + blocked, + emailVerified, + phoneVerified, + appMetadata, + givenName, + familyName, + name, + nickname, + picture, + userId, + connection, + password, + verifyEmail, + username, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java new file mode 100644 index 000000000..ce01f5312 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java @@ -0,0 +1,717 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserResponseContent.Builder.class) +public final class CreateUserResponseContent { + private final Optional userId; + + private final Optional email; + + private final Optional emailVerified; + + private final Optional username; + + private final Optional phoneNumber; + + private final Optional phoneVerified; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> identities; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional picture; + + private final Optional name; + + private final Optional nickname; + + private final Optional> multifactor; + + private final Optional lastIp; + + private final Optional lastLogin; + + private final Optional loginsCount; + + private final Optional blocked; + + private final Optional givenName; + + private final Optional familyName; + + private final Map additionalProperties; + + private CreateUserResponseContent( + Optional userId, + Optional email, + Optional emailVerified, + Optional username, + Optional phoneNumber, + Optional phoneVerified, + Optional createdAt, + Optional updatedAt, + Optional> identities, + Optional> appMetadata, + Optional> userMetadata, + Optional picture, + Optional name, + Optional nickname, + Optional> multifactor, + Optional lastIp, + Optional lastLogin, + Optional loginsCount, + Optional blocked, + Optional givenName, + Optional familyName, + Map additionalProperties) { + this.userId = userId; + this.email = email; + this.emailVerified = emailVerified; + this.username = username; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.identities = identities; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.picture = picture; + this.name = name; + this.nickname = nickname; + this.multifactor = multifactor; + this.lastIp = lastIp; + this.lastLogin = lastLogin; + this.loginsCount = loginsCount; + this.blocked = blocked; + this.givenName = givenName; + this.familyName = familyName; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Username of this user. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Array of user identity objects when accounts are linked. + */ + @JsonProperty("identities") + public Optional> getIdentities() { + return identities; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return URL to picture, photo, or avatar of this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Preferred nickname or alias of this user. + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return List of multi-factor authentication providers with which this user has enrolled. + */ + @JsonProperty("multifactor") + public Optional> getMultifactor() { + return multifactor; + } + + /** + * @return Last IP address from which this user logged in. + */ + @JsonProperty("last_ip") + public Optional getLastIp() { + return lastIp; + } + + @JsonProperty("last_login") + public Optional getLastLogin() { + return lastLogin; + } + + /** + * @return Total number of logins this user has performed. + */ + @JsonProperty("logins_count") + public Optional getLoginsCount() { + return loginsCount; + } + + /** + * @return Whether this user was blocked by an administrator (true) or is not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserResponseContent && equalTo((CreateUserResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserResponseContent other) { + return userId.equals(other.userId) + && email.equals(other.email) + && emailVerified.equals(other.emailVerified) + && username.equals(other.username) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && identities.equals(other.identities) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && picture.equals(other.picture) + && name.equals(other.name) + && nickname.equals(other.nickname) + && multifactor.equals(other.multifactor) + && lastIp.equals(other.lastIp) + && lastLogin.equals(other.lastLogin) + && loginsCount.equals(other.loginsCount) + && blocked.equals(other.blocked) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userId, + this.email, + this.emailVerified, + this.username, + this.phoneNumber, + this.phoneVerified, + this.createdAt, + this.updatedAt, + this.identities, + this.appMetadata, + this.userMetadata, + this.picture, + this.name, + this.nickname, + this.multifactor, + this.lastIp, + this.lastLogin, + this.loginsCount, + this.blocked, + this.givenName, + this.familyName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> identities = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional nickname = Optional.empty(); + + private Optional> multifactor = Optional.empty(); + + private Optional lastIp = Optional.empty(); + + private Optional lastLogin = Optional.empty(); + + private Optional loginsCount = Optional.empty(); + + private Optional blocked = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional familyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateUserResponseContent other) { + userId(other.getUserId()); + email(other.getEmail()); + emailVerified(other.getEmailVerified()); + username(other.getUsername()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + identities(other.getIdentities()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + picture(other.getPicture()); + name(other.getName()); + nickname(other.getNickname()); + multifactor(other.getMultifactor()); + lastIp(other.getLastIp()); + lastLogin(other.getLastLogin()); + loginsCount(other.getLoginsCount()); + blocked(other.getBlocked()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Username of this user.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(UserDateSchema createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(UserDateSchema updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Array of user identity objects when accounts are linked.

+ */ + @JsonSetter(value = "identities", nulls = Nulls.SKIP) + public Builder identities(Optional> identities) { + this.identities = identities; + return this; + } + + public Builder identities(List identities) { + this.identities = Optional.ofNullable(identities); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

URL to picture, photo, or avatar of this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Preferred nickname or alias of this user.

+ */ + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public Builder nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = Optional.ofNullable(nickname); + return this; + } + + /** + *

List of multi-factor authentication providers with which this user has enrolled.

+ */ + @JsonSetter(value = "multifactor", nulls = Nulls.SKIP) + public Builder multifactor(Optional> multifactor) { + this.multifactor = multifactor; + return this; + } + + public Builder multifactor(List multifactor) { + this.multifactor = Optional.ofNullable(multifactor); + return this; + } + + /** + *

Last IP address from which this user logged in.

+ */ + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(Optional lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = Optional.ofNullable(lastIp); + return this; + } + + @JsonSetter(value = "last_login", nulls = Nulls.SKIP) + public Builder lastLogin(Optional lastLogin) { + this.lastLogin = lastLogin; + return this; + } + + public Builder lastLogin(UserDateSchema lastLogin) { + this.lastLogin = Optional.ofNullable(lastLogin); + return this; + } + + /** + *

Total number of logins this user has performed.

+ */ + @JsonSetter(value = "logins_count", nulls = Nulls.SKIP) + public Builder loginsCount(Optional loginsCount) { + this.loginsCount = loginsCount; + return this; + } + + public Builder loginsCount(Integer loginsCount) { + this.loginsCount = Optional.ofNullable(loginsCount); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or is not (false).

+ */ + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public Builder blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + public Builder blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + public CreateUserResponseContent build() { + return new CreateUserResponseContent( + userId, + email, + emailVerified, + username, + phoneNumber, + phoneVerified, + createdAt, + updatedAt, + identities, + appMetadata, + userMetadata, + picture, + name, + nickname, + multifactor, + lastIp, + lastLogin, + loginsCount, + blocked, + givenName, + familyName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java new file mode 100644 index 000000000..5457f0768 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateVerifiableCredentialTemplateResponseContent.Builder.class) +public final class CreateVerifiableCredentialTemplateResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional type; + + private final Optional dialect; + + private final Optional presentation; + + private final Optional customCertificateAuthority; + + private final Optional wellKnownTrustedIssuers; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private CreateVerifiableCredentialTemplateResponseContent( + Optional id, + Optional name, + Optional type, + Optional dialect, + Optional presentation, + Optional customCertificateAuthority, + Optional wellKnownTrustedIssuers, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.customCertificateAuthority = customCertificateAuthority; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the template. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The type of the template. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The dialect of the template. + */ + @JsonProperty("dialect") + public Optional getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public Optional getPresentation() { + return presentation; + } + + /** + * @return The custom certificate authority. + */ + @JsonProperty("custom_certificate_authority") + public Optional getCustomCertificateAuthority() { + return customCertificateAuthority; + } + + /** + * @return The well-known trusted issuers, comma separated. + */ + @JsonProperty("well_known_trusted_issuers") + public Optional getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateVerifiableCredentialTemplateResponseContent + && equalTo((CreateVerifiableCredentialTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateVerifiableCredentialTemplateResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && customCertificateAuthority.equals(other.customCertificateAuthority) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.type, + this.dialect, + this.presentation, + this.customCertificateAuthority, + this.wellKnownTrustedIssuers, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional dialect = Optional.empty(); + + private Optional presentation = Optional.empty(); + + private Optional customCertificateAuthority = Optional.empty(); + + private Optional wellKnownTrustedIssuers = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateVerifiableCredentialTemplateResponseContent other) { + id(other.getId()); + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + customCertificateAuthority(other.getCustomCertificateAuthority()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the template.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The type of the template.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The dialect of the template.

+ */ + @JsonSetter(value = "dialect", nulls = Nulls.SKIP) + public Builder dialect(Optional dialect) { + this.dialect = dialect; + return this; + } + + public Builder dialect(String dialect) { + this.dialect = Optional.ofNullable(dialect); + return this; + } + + @JsonSetter(value = "presentation", nulls = Nulls.SKIP) + public Builder presentation(Optional presentation) { + this.presentation = presentation; + return this; + } + + public Builder presentation(MdlPresentationRequest presentation) { + this.presentation = Optional.ofNullable(presentation); + return this; + } + + /** + *

The custom certificate authority.

+ */ + @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) + public Builder customCertificateAuthority(Optional customCertificateAuthority) { + this.customCertificateAuthority = customCertificateAuthority; + return this; + } + + public Builder customCertificateAuthority(String customCertificateAuthority) { + this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); + return this; + } + + /** + *

The well-known trusted issuers, comma separated.

+ */ + @JsonSetter(value = "well_known_trusted_issuers", nulls = Nulls.SKIP) + public Builder wellKnownTrustedIssuers(Optional wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + return this; + } + + public Builder wellKnownTrustedIssuers(String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = Optional.ofNullable(wellKnownTrustedIssuers); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public CreateVerifiableCredentialTemplateResponseContent build() { + return new CreateVerifiableCredentialTemplateResponseContent( + id, + name, + type, + dialect, + presentation, + customCertificateAuthority, + wellKnownTrustedIssuers, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java new file mode 100644 index 000000000..423b6f53f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateVerificationEmailResponseContent.Builder.class) +public final class CreateVerificationEmailResponseContent { + private final String status; + + private final String type; + + private final Optional createdAt; + + private final String id; + + private final Map additionalProperties; + + private CreateVerificationEmailResponseContent( + String status, + String type, + Optional createdAt, + String id, + Map additionalProperties) { + this.status = status; + this.type = type; + this.createdAt = createdAt; + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of this job. + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Type of job this is. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return When this job was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return ID of this job. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateVerificationEmailResponseContent + && equalTo((CreateVerificationEmailResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateVerificationEmailResponseContent other) { + return status.equals(other.status) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.type, this.createdAt, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + *

Status of this job.

+ */ + TypeStage status(@NotNull String status); + + Builder from(CreateVerificationEmailResponseContent other); + } + + public interface TypeStage { + /** + *

Type of job this is.

+ */ + IdStage type(@NotNull String type); + } + + public interface IdStage { + /** + *

ID of this job.

+ */ + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + CreateVerificationEmailResponseContent build(); + + /** + *

When this job was created.

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(String createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, TypeStage, IdStage, _FinalStage { + private String status; + + private String type; + + private String id; + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateVerificationEmailResponseContent other) { + status(other.getStatus()); + type(other.getType()); + createdAt(other.getCreatedAt()); + id(other.getId()); + return this; + } + + /** + *

Status of this job.

+ *

Status of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Type of job this is.

+ *

Type of job this is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public IdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

ID of this job.

+ *

ID of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

When this job was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

When this job was created.

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public CreateVerificationEmailResponseContent build() { + return new CreateVerificationEmailResponseContent(status, type, createdAt, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java new file mode 100644 index 000000000..06f30e70d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreatedAuthenticationMethodTypeEnum { + public static final CreatedAuthenticationMethodTypeEnum EMAIL = + new CreatedAuthenticationMethodTypeEnum(Value.EMAIL, "email"); + + public static final CreatedAuthenticationMethodTypeEnum TOTP = + new CreatedAuthenticationMethodTypeEnum(Value.TOTP, "totp"); + + public static final CreatedAuthenticationMethodTypeEnum PHONE = + new CreatedAuthenticationMethodTypeEnum(Value.PHONE, "phone"); + + public static final CreatedAuthenticationMethodTypeEnum WEBAUTHN_ROAMING = + new CreatedAuthenticationMethodTypeEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + private final Value value; + + private final String string; + + CreatedAuthenticationMethodTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreatedAuthenticationMethodTypeEnum + && this.string.equals(((CreatedAuthenticationMethodTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case TOTP: + return visitor.visitTotp(); + case PHONE: + return visitor.visitPhone(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreatedAuthenticationMethodTypeEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "totp": + return TOTP; + case "phone": + return PHONE; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + default: + return new CreatedAuthenticationMethodTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PHONE, + + EMAIL, + + TOTP, + + WEBAUTHN_ROAMING, + + UNKNOWN + } + + public interface Visitor { + T visitPhone(); + + T visitEmail(); + + T visitTotp(); + + T visitWebauthnRoaming(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java new file mode 100644 index 000000000..2cb6a0feb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreatedUserAuthenticationMethodTypeEnum { + public static final CreatedUserAuthenticationMethodTypeEnum EMAIL = + new CreatedUserAuthenticationMethodTypeEnum(Value.EMAIL, "email"); + + public static final CreatedUserAuthenticationMethodTypeEnum TOTP = + new CreatedUserAuthenticationMethodTypeEnum(Value.TOTP, "totp"); + + public static final CreatedUserAuthenticationMethodTypeEnum PASSKEY = + new CreatedUserAuthenticationMethodTypeEnum(Value.PASSKEY, "passkey"); + + public static final CreatedUserAuthenticationMethodTypeEnum PHONE = + new CreatedUserAuthenticationMethodTypeEnum(Value.PHONE, "phone"); + + public static final CreatedUserAuthenticationMethodTypeEnum WEBAUTHN_ROAMING = + new CreatedUserAuthenticationMethodTypeEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + private final Value value; + + private final String string; + + CreatedUserAuthenticationMethodTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreatedUserAuthenticationMethodTypeEnum + && this.string.equals(((CreatedUserAuthenticationMethodTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case TOTP: + return visitor.visitTotp(); + case PASSKEY: + return visitor.visitPasskey(); + case PHONE: + return visitor.visitPhone(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreatedUserAuthenticationMethodTypeEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "totp": + return TOTP; + case "passkey": + return PASSKEY; + case "phone": + return PHONE; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + default: + return new CreatedUserAuthenticationMethodTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PHONE, + + EMAIL, + + TOTP, + + WEBAUTHN_ROAMING, + + PASSKEY, + + UNKNOWN + } + + public interface Visitor { + T visitPhone(); + + T visitEmail(); + + T visitTotp(); + + T visitWebauthnRoaming(); + + T visitPasskey(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CredentialId.java b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java new file mode 100644 index 000000000..f50986cde --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CredentialId.Builder.class) +public final class CredentialId { + private final String id; + + private final Map additionalProperties; + + private CredentialId(String id, Map additionalProperties) { + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return Credential ID + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialId && equalTo((CredentialId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialId other) { + return id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Credential ID

+ */ + _FinalStage id(@NotNull String id); + + Builder from(CredentialId other); + } + + public interface _FinalStage { + CredentialId build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialId other) { + id(other.getId()); + return this; + } + + /** + *

Credential ID

+ *

Credential ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public CredentialId build() { + return new CredentialId(id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java new file mode 100644 index 000000000..3f1bd28c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomDomain.Builder.class) +public final class CustomDomain { + private final String customDomainId; + + private final String domain; + + private final boolean primary; + + private final CustomDomainTypeEnum type; + + private final Optional originDomainName; + + private final Optional verification; + + private final OptionalNullable customClientIpHeader; + + private final Optional tlsPolicy; + + private final Map additionalProperties; + + private CustomDomain( + String customDomainId, + String domain, + boolean primary, + CustomDomainTypeEnum type, + Optional originDomainName, + Optional verification, + OptionalNullable customClientIpHeader, + Optional tlsPolicy, + Map additionalProperties) { + this.customDomainId = customDomainId; + this.domain = domain; + this.primary = primary; + this.type = type; + this.originDomainName = originDomainName; + this.verification = verification; + this.customClientIpHeader = customClientIpHeader; + this.tlsPolicy = tlsPolicy; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the custom domain. + */ + @JsonProperty("custom_domain_id") + public String getCustomDomainId() { + return customDomainId; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + /** + * @return Whether this is a primary domain (true) or not (false). + */ + @JsonProperty("primary") + public boolean getPrimary() { + return primary; + } + + @JsonProperty("type") + public CustomDomainTypeEnum getType() { + return type; + } + + /** + * @return Intermediate address. + */ + @JsonProperty("origin_domain_name") + public Optional getOriginDomainName() { + return originDomainName; + } + + @JsonProperty("verification") + public Optional getVerification() { + return verification; + } + + /** + * @return The HTTP header to fetch the client's IP address + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + if (customClientIpHeader == null) { + return OptionalNullable.absent(); + } + return customClientIpHeader; + } + + /** + * @return The TLS version policy + */ + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + private OptionalNullable _getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomDomain && equalTo((CustomDomain) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomDomain other) { + return customDomainId.equals(other.customDomainId) + && domain.equals(other.domain) + && primary == other.primary + && type.equals(other.type) + && originDomainName.equals(other.originDomainName) + && verification.equals(other.verification) + && customClientIpHeader.equals(other.customClientIpHeader) + && tlsPolicy.equals(other.tlsPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customDomainId, + this.domain, + this.primary, + this.type, + this.originDomainName, + this.verification, + this.customClientIpHeader, + this.tlsPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CustomDomainIdStage builder() { + return new Builder(); + } + + public interface CustomDomainIdStage { + /** + *

ID of the custom domain.

+ */ + DomainStage customDomainId(@NotNull String customDomainId); + + Builder from(CustomDomain other); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + PrimaryStage domain(@NotNull String domain); + } + + public interface PrimaryStage { + /** + *

Whether this is a primary domain (true) or not (false).

+ */ + TypeStage primary(boolean primary); + } + + public interface TypeStage { + _FinalStage type(@NotNull CustomDomainTypeEnum type); + } + + public interface _FinalStage { + CustomDomain build(); + + /** + *

Intermediate address.

+ */ + _FinalStage originDomainName(Optional originDomainName); + + _FinalStage originDomainName(String originDomainName); + + _FinalStage verification(Optional verification); + + _FinalStage verification(DomainVerification verification); + + /** + *

The HTTP header to fetch the client's IP address

+ */ + _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(String customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader); + + /** + *

The TLS version policy

+ */ + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + private String customDomainId; + + private String domain; + + private boolean primary; + + private CustomDomainTypeEnum type; + + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + private Optional verification = Optional.empty(); + + private Optional originDomainName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomDomain other) { + customDomainId(other.getCustomDomainId()); + domain(other.getDomain()); + primary(other.getPrimary()); + type(other.getType()); + originDomainName(other.getOriginDomainName()); + verification(other.getVerification()); + customClientIpHeader(other.getCustomClientIpHeader()); + tlsPolicy(other.getTlsPolicy()); + return this; + } + + /** + *

ID of the custom domain.

+ *

ID of the custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("custom_domain_id") + public DomainStage customDomainId(@NotNull String customDomainId) { + this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public PrimaryStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + /** + *

Whether this is a primary domain (true) or not (false).

+ *

Whether this is a primary domain (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public TypeStage primary(boolean primary) { + this.primary = primary; + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CustomDomainTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

The TLS version policy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + /** + *

The TLS version policy

+ */ + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(String customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ */ + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public _FinalStage verification(DomainVerification verification) { + this.verification = Optional.ofNullable(verification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "verification", nulls = Nulls.SKIP) + public _FinalStage verification(Optional verification) { + this.verification = verification; + return this; + } + + /** + *

Intermediate address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originDomainName(String originDomainName) { + this.originDomainName = Optional.ofNullable(originDomainName); + return this; + } + + /** + *

Intermediate address.

+ */ + @java.lang.Override + @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) + public _FinalStage originDomainName(Optional originDomainName) { + this.originDomainName = originDomainName; + return this; + } + + @java.lang.Override + public CustomDomain build() { + return new CustomDomain( + customDomainId, + domain, + primary, + type, + originDomainName, + verification, + customClientIpHeader, + tlsPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java new file mode 100644 index 000000000..0325fd72d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomDomainCustomClientIpHeaderEnum { + public static final CustomDomainCustomClientIpHeaderEnum TRUE_CLIENT_IP = + new CustomDomainCustomClientIpHeaderEnum(Value.TRUE_CLIENT_IP, "true-client-ip"); + + public static final CustomDomainCustomClientIpHeaderEnum X_AZURE_CLIENTIP = + new CustomDomainCustomClientIpHeaderEnum(Value.X_AZURE_CLIENTIP, "x-azure-clientip"); + + public static final CustomDomainCustomClientIpHeaderEnum EMPTY = + new CustomDomainCustomClientIpHeaderEnum(Value.EMPTY, ""); + + public static final CustomDomainCustomClientIpHeaderEnum X_FORWARDED_FOR = + new CustomDomainCustomClientIpHeaderEnum(Value.X_FORWARDED_FOR, "x-forwarded-for"); + + public static final CustomDomainCustomClientIpHeaderEnum CF_CONNECTING_IP = + new CustomDomainCustomClientIpHeaderEnum(Value.CF_CONNECTING_IP, "cf-connecting-ip"); + + private final Value value; + + private final String string; + + CustomDomainCustomClientIpHeaderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomDomainCustomClientIpHeaderEnum + && this.string.equals(((CustomDomainCustomClientIpHeaderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TRUE_CLIENT_IP: + return visitor.visitTrueClientIp(); + case X_AZURE_CLIENTIP: + return visitor.visitXAzureClientip(); + case EMPTY: + return visitor.visitEmpty(); + case X_FORWARDED_FOR: + return visitor.visitXForwardedFor(); + case CF_CONNECTING_IP: + return visitor.visitCfConnectingIp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomDomainCustomClientIpHeaderEnum valueOf(String value) { + switch (value) { + case "true-client-ip": + return TRUE_CLIENT_IP; + case "x-azure-clientip": + return X_AZURE_CLIENTIP; + case "": + return EMPTY; + case "x-forwarded-for": + return X_FORWARDED_FOR; + case "cf-connecting-ip": + return CF_CONNECTING_IP; + default: + return new CustomDomainCustomClientIpHeaderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TRUE_CLIENT_IP, + + CF_CONNECTING_IP, + + X_FORWARDED_FOR, + + X_AZURE_CLIENTIP, + + EMPTY, + + UNKNOWN + } + + public interface Visitor { + T visitTrueClientIp(); + + T visitCfConnectingIp(); + + T visitXForwardedFor(); + + T visitXAzureClientip(); + + T visitEmpty(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java new file mode 100644 index 000000000..10ea63a75 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomDomainProvisioningTypeEnum { + public static final CustomDomainProvisioningTypeEnum SELF_MANAGED_CERTS = + new CustomDomainProvisioningTypeEnum(Value.SELF_MANAGED_CERTS, "self_managed_certs"); + + public static final CustomDomainProvisioningTypeEnum AUTH0MANAGED_CERTS = + new CustomDomainProvisioningTypeEnum(Value.AUTH0MANAGED_CERTS, "auth0_managed_certs"); + + private final Value value; + + private final String string; + + CustomDomainProvisioningTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomDomainProvisioningTypeEnum + && this.string.equals(((CustomDomainProvisioningTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SELF_MANAGED_CERTS: + return visitor.visitSelfManagedCerts(); + case AUTH0MANAGED_CERTS: + return visitor.visitAuth0ManagedCerts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomDomainProvisioningTypeEnum valueOf(String value) { + switch (value) { + case "self_managed_certs": + return SELF_MANAGED_CERTS; + case "auth0_managed_certs": + return AUTH0MANAGED_CERTS; + default: + return new CustomDomainProvisioningTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTH0MANAGED_CERTS, + + SELF_MANAGED_CERTS, + + UNKNOWN + } + + public interface Visitor { + T visitAuth0ManagedCerts(); + + T visitSelfManagedCerts(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java new file mode 100644 index 000000000..1300052c1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomDomainTypeEnum { + public static final CustomDomainTypeEnum SELF_MANAGED_CERTS = + new CustomDomainTypeEnum(Value.SELF_MANAGED_CERTS, "self_managed_certs"); + + public static final CustomDomainTypeEnum AUTH0MANAGED_CERTS = + new CustomDomainTypeEnum(Value.AUTH0MANAGED_CERTS, "auth0_managed_certs"); + + private final Value value; + + private final String string; + + CustomDomainTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomDomainTypeEnum && this.string.equals(((CustomDomainTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SELF_MANAGED_CERTS: + return visitor.visitSelfManagedCerts(); + case AUTH0MANAGED_CERTS: + return visitor.visitAuth0ManagedCerts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomDomainTypeEnum valueOf(String value) { + switch (value) { + case "self_managed_certs": + return SELF_MANAGED_CERTS; + case "auth0_managed_certs": + return AUTH0MANAGED_CERTS; + default: + return new CustomDomainTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTH0MANAGED_CERTS, + + SELF_MANAGED_CERTS, + + UNKNOWN + } + + public interface Visitor { + T visitAuth0ManagedCerts(); + + T visitSelfManagedCerts(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java new file mode 100644 index 000000000..bdf32df78 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomProviderConfiguration.Builder.class) +public final class CustomProviderConfiguration { + private final List deliveryMethods; + + private final Map additionalProperties; + + private CustomProviderConfiguration( + List deliveryMethods, Map additionalProperties) { + this.deliveryMethods = deliveryMethods; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("delivery_methods") + public List getDeliveryMethods() { + return deliveryMethods; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomProviderConfiguration && equalTo((CustomProviderConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomProviderConfiguration other) { + return deliveryMethods.equals(other.deliveryMethods); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deliveryMethods); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List deliveryMethods = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomProviderConfiguration other) { + deliveryMethods(other.getDeliveryMethods()); + return this; + } + + @JsonSetter(value = "delivery_methods", nulls = Nulls.SKIP) + public Builder deliveryMethods(List deliveryMethods) { + this.deliveryMethods.clear(); + if (deliveryMethods != null) { + this.deliveryMethods.addAll(deliveryMethods); + } + return this; + } + + public Builder addDeliveryMethods(CustomProviderDeliveryMethodEnum deliveryMethods) { + this.deliveryMethods.add(deliveryMethods); + return this; + } + + public Builder addAllDeliveryMethods(List deliveryMethods) { + if (deliveryMethods != null) { + this.deliveryMethods.addAll(deliveryMethods); + } + return this; + } + + public CustomProviderConfiguration build() { + return new CustomProviderConfiguration(deliveryMethods, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java new file mode 100644 index 000000000..5a718e799 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomProviderCredentials.Builder.class) +public final class CustomProviderCredentials { + private final Map additionalProperties; + + private CustomProviderCredentials(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomProviderCredentials; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomProviderCredentials other) { + return this; + } + + public CustomProviderCredentials build() { + return new CustomProviderCredentials(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java new file mode 100644 index 000000000..50271acca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomProviderDeliveryMethodEnum { + public static final CustomProviderDeliveryMethodEnum TEXT = + new CustomProviderDeliveryMethodEnum(Value.TEXT, "text"); + + public static final CustomProviderDeliveryMethodEnum VOICE = + new CustomProviderDeliveryMethodEnum(Value.VOICE, "voice"); + + private final Value value; + + private final String string; + + CustomProviderDeliveryMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomProviderDeliveryMethodEnum + && this.string.equals(((CustomProviderDeliveryMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TEXT: + return visitor.visitText(); + case VOICE: + return visitor.visitVoice(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomProviderDeliveryMethodEnum valueOf(String value) { + switch (value) { + case "text": + return TEXT; + case "voice": + return VOICE; + default: + return new CustomProviderDeliveryMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TEXT, + + VOICE, + + UNKNOWN + } + + public interface Visitor { + T visitText(); + + T visitVoice(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java new file mode 100644 index 000000000..e9709e539 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomSigningKeyAlgorithmEnum { + public static final CustomSigningKeyAlgorithmEnum RS512 = new CustomSigningKeyAlgorithmEnum(Value.RS512, "RS512"); + + public static final CustomSigningKeyAlgorithmEnum ES256 = new CustomSigningKeyAlgorithmEnum(Value.ES256, "ES256"); + + public static final CustomSigningKeyAlgorithmEnum PS256 = new CustomSigningKeyAlgorithmEnum(Value.PS256, "PS256"); + + public static final CustomSigningKeyAlgorithmEnum ES384 = new CustomSigningKeyAlgorithmEnum(Value.ES384, "ES384"); + + public static final CustomSigningKeyAlgorithmEnum PS384 = new CustomSigningKeyAlgorithmEnum(Value.PS384, "PS384"); + + public static final CustomSigningKeyAlgorithmEnum ES512 = new CustomSigningKeyAlgorithmEnum(Value.ES512, "ES512"); + + public static final CustomSigningKeyAlgorithmEnum PS512 = new CustomSigningKeyAlgorithmEnum(Value.PS512, "PS512"); + + public static final CustomSigningKeyAlgorithmEnum RS256 = new CustomSigningKeyAlgorithmEnum(Value.RS256, "RS256"); + + public static final CustomSigningKeyAlgorithmEnum RS384 = new CustomSigningKeyAlgorithmEnum(Value.RS384, "RS384"); + + private final Value value; + + private final String string; + + CustomSigningKeyAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomSigningKeyAlgorithmEnum + && this.string.equals(((CustomSigningKeyAlgorithmEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case ES256: + return visitor.visitEs256(); + case PS256: + return visitor.visitPs256(); + case ES384: + return visitor.visitEs384(); + case PS384: + return visitor.visitPs384(); + case ES512: + return visitor.visitEs512(); + case PS512: + return visitor.visitPs512(); + case RS256: + return visitor.visitRs256(); + case RS384: + return visitor.visitRs384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomSigningKeyAlgorithmEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "ES256": + return ES256; + case "PS256": + return PS256; + case "ES384": + return ES384; + case "PS384": + return PS384; + case "ES512": + return ES512; + case "PS512": + return PS512; + case "RS256": + return RS256; + case "RS384": + return RS384; + default: + return new CustomSigningKeyAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RS256, + + RS384, + + RS512, + + ES256, + + ES384, + + ES512, + + PS256, + + PS384, + + PS512, + + UNKNOWN + } + + public interface Visitor { + T visitRs256(); + + T visitRs384(); + + T visitRs512(); + + T visitEs256(); + + T visitEs384(); + + T visitEs512(); + + T visitPs256(); + + T visitPs384(); + + T visitPs512(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java new file mode 100644 index 000000000..bfb12f6d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomSigningKeyCurveEnum { + public static final CustomSigningKeyCurveEnum P521 = new CustomSigningKeyCurveEnum(Value.P521, "P-521"); + + public static final CustomSigningKeyCurveEnum P256 = new CustomSigningKeyCurveEnum(Value.P256, "P-256"); + + public static final CustomSigningKeyCurveEnum P384 = new CustomSigningKeyCurveEnum(Value.P384, "P-384"); + + private final Value value; + + private final String string; + + CustomSigningKeyCurveEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomSigningKeyCurveEnum + && this.string.equals(((CustomSigningKeyCurveEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case P521: + return visitor.visitP521(); + case P256: + return visitor.visitP256(); + case P384: + return visitor.visitP384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomSigningKeyCurveEnum valueOf(String value) { + switch (value) { + case "P-521": + return P521; + case "P-256": + return P256; + case "P-384": + return P384; + default: + return new CustomSigningKeyCurveEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + P256, + + P384, + + P521, + + UNKNOWN + } + + public interface Visitor { + T visitP256(); + + T visitP384(); + + T visitP521(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java new file mode 100644 index 000000000..324e03784 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java @@ -0,0 +1,642 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomSigningKeyJwk.Builder.class) +public final class CustomSigningKeyJwk { + private final CustomSigningKeyTypeEnum kty; + + private final Optional kid; + + private final Optional use; + + private final Optional> keyOps; + + private final Optional alg; + + private final Optional n; + + private final Optional e; + + private final Optional crv; + + private final Optional x; + + private final Optional y; + + private final Optional x5U; + + private final Optional> x5C; + + private final Optional x5T; + + private final Optional x5TS256; + + private final Map additionalProperties; + + private CustomSigningKeyJwk( + CustomSigningKeyTypeEnum kty, + Optional kid, + Optional use, + Optional> keyOps, + Optional alg, + Optional n, + Optional e, + Optional crv, + Optional x, + Optional y, + Optional x5U, + Optional> x5C, + Optional x5T, + Optional x5TS256, + Map additionalProperties) { + this.kty = kty; + this.kid = kid; + this.use = use; + this.keyOps = keyOps; + this.alg = alg; + this.n = n; + this.e = e; + this.crv = crv; + this.x = x; + this.y = y; + this.x5U = x5U; + this.x5C = x5C; + this.x5T = x5T; + this.x5TS256 = x5TS256; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("kty") + public CustomSigningKeyTypeEnum getKty() { + return kty; + } + + /** + * @return Key identifier + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + @JsonProperty("use") + public Optional getUse() { + return use; + } + + /** + * @return Key operations + */ + @JsonProperty("key_ops") + public Optional> getKeyOps() { + return keyOps; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + /** + * @return Key modulus + */ + @JsonProperty("n") + public Optional getN() { + return n; + } + + /** + * @return Key exponent + */ + @JsonProperty("e") + public Optional getE() { + return e; + } + + @JsonProperty("crv") + public Optional getCrv() { + return crv; + } + + /** + * @return X coordinate + */ + @JsonProperty("x") + public Optional getX() { + return x; + } + + /** + * @return Y coordinate + */ + @JsonProperty("y") + public Optional getY() { + return y; + } + + /** + * @return X.509 URL + */ + @JsonProperty("x5u") + public Optional getX5U() { + return x5U; + } + + /** + * @return X.509 certificate chain + */ + @JsonProperty("x5c") + public Optional> getX5C() { + return x5C; + } + + /** + * @return X.509 certificate SHA-1 thumbprint + */ + @JsonProperty("x5t") + public Optional getX5T() { + return x5T; + } + + /** + * @return X.509 certificate SHA-256 thumbprint + */ + @JsonProperty("x5t#S256") + public Optional getX5TS256() { + return x5TS256; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomSigningKeyJwk && equalTo((CustomSigningKeyJwk) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomSigningKeyJwk other) { + return kty.equals(other.kty) + && kid.equals(other.kid) + && use.equals(other.use) + && keyOps.equals(other.keyOps) + && alg.equals(other.alg) + && n.equals(other.n) + && e.equals(other.e) + && crv.equals(other.crv) + && x.equals(other.x) + && y.equals(other.y) + && x5U.equals(other.x5U) + && x5C.equals(other.x5C) + && x5T.equals(other.x5T) + && x5TS256.equals(other.x5TS256); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kty, + this.kid, + this.use, + this.keyOps, + this.alg, + this.n, + this.e, + this.crv, + this.x, + this.y, + this.x5U, + this.x5C, + this.x5T, + this.x5TS256); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KtyStage builder() { + return new Builder(); + } + + public interface KtyStage { + _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty); + + Builder from(CustomSigningKeyJwk other); + } + + public interface _FinalStage { + CustomSigningKeyJwk build(); + + /** + *

Key identifier

+ */ + _FinalStage kid(Optional kid); + + _FinalStage kid(String kid); + + _FinalStage use(Optional use); + + _FinalStage use(String use); + + /** + *

Key operations

+ */ + _FinalStage keyOps(Optional> keyOps); + + _FinalStage keyOps(List keyOps); + + _FinalStage alg(Optional alg); + + _FinalStage alg(CustomSigningKeyAlgorithmEnum alg); + + /** + *

Key modulus

+ */ + _FinalStage n(Optional n); + + _FinalStage n(String n); + + /** + *

Key exponent

+ */ + _FinalStage e(Optional e); + + _FinalStage e(String e); + + _FinalStage crv(Optional crv); + + _FinalStage crv(CustomSigningKeyCurveEnum crv); + + /** + *

X coordinate

+ */ + _FinalStage x(Optional x); + + _FinalStage x(String x); + + /** + *

Y coordinate

+ */ + _FinalStage y(Optional y); + + _FinalStage y(String y); + + /** + *

X.509 URL

+ */ + _FinalStage x5U(Optional x5U); + + _FinalStage x5U(String x5U); + + /** + *

X.509 certificate chain

+ */ + _FinalStage x5C(Optional> x5C); + + _FinalStage x5C(List x5C); + + /** + *

X.509 certificate SHA-1 thumbprint

+ */ + _FinalStage x5T(Optional x5T); + + _FinalStage x5T(String x5T); + + /** + *

X.509 certificate SHA-256 thumbprint

+ */ + _FinalStage x5TS256(Optional x5TS256); + + _FinalStage x5TS256(String x5TS256); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KtyStage, _FinalStage { + private CustomSigningKeyTypeEnum kty; + + private Optional x5TS256 = Optional.empty(); + + private Optional x5T = Optional.empty(); + + private Optional> x5C = Optional.empty(); + + private Optional x5U = Optional.empty(); + + private Optional y = Optional.empty(); + + private Optional x = Optional.empty(); + + private Optional crv = Optional.empty(); + + private Optional e = Optional.empty(); + + private Optional n = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional> keyOps = Optional.empty(); + + private Optional use = Optional.empty(); + + private Optional kid = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CustomSigningKeyJwk other) { + kty(other.getKty()); + kid(other.getKid()); + use(other.getUse()); + keyOps(other.getKeyOps()); + alg(other.getAlg()); + n(other.getN()); + e(other.getE()); + crv(other.getCrv()); + x(other.getX()); + y(other.getY()); + x5U(other.getX5U()); + x5C(other.getX5C()); + x5T(other.getX5T()); + x5TS256(other.getX5TS256()); + return this; + } + + @java.lang.Override + @JsonSetter("kty") + public _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty) { + this.kty = Objects.requireNonNull(kty, "kty must not be null"); + return this; + } + + /** + *

X.509 certificate SHA-256 thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage x5TS256(String x5TS256) { + this.x5TS256 = Optional.ofNullable(x5TS256); + return this; + } + + /** + *

X.509 certificate SHA-256 thumbprint

+ */ + @java.lang.Override + @JsonSetter(value = "x5t#S256", nulls = Nulls.SKIP) + public _FinalStage x5TS256(Optional x5TS256) { + this.x5TS256 = x5TS256; + return this; + } + + /** + *

X.509 certificate SHA-1 thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage x5T(String x5T) { + this.x5T = Optional.ofNullable(x5T); + return this; + } + + /** + *

X.509 certificate SHA-1 thumbprint

+ */ + @java.lang.Override + @JsonSetter(value = "x5t", nulls = Nulls.SKIP) + public _FinalStage x5T(Optional x5T) { + this.x5T = x5T; + return this; + } + + /** + *

X.509 certificate chain

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage x5C(List x5C) { + this.x5C = Optional.ofNullable(x5C); + return this; + } + + /** + *

X.509 certificate chain

+ */ + @java.lang.Override + @JsonSetter(value = "x5c", nulls = Nulls.SKIP) + public _FinalStage x5C(Optional> x5C) { + this.x5C = x5C; + return this; + } + + /** + *

X.509 URL

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage x5U(String x5U) { + this.x5U = Optional.ofNullable(x5U); + return this; + } + + /** + *

X.509 URL

+ */ + @java.lang.Override + @JsonSetter(value = "x5u", nulls = Nulls.SKIP) + public _FinalStage x5U(Optional x5U) { + this.x5U = x5U; + return this; + } + + /** + *

Y coordinate

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage y(String y) { + this.y = Optional.ofNullable(y); + return this; + } + + /** + *

Y coordinate

+ */ + @java.lang.Override + @JsonSetter(value = "y", nulls = Nulls.SKIP) + public _FinalStage y(Optional y) { + this.y = y; + return this; + } + + /** + *

X coordinate

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage x(String x) { + this.x = Optional.ofNullable(x); + return this; + } + + /** + *

X coordinate

+ */ + @java.lang.Override + @JsonSetter(value = "x", nulls = Nulls.SKIP) + public _FinalStage x(Optional x) { + this.x = x; + return this; + } + + @java.lang.Override + public _FinalStage crv(CustomSigningKeyCurveEnum crv) { + this.crv = Optional.ofNullable(crv); + return this; + } + + @java.lang.Override + @JsonSetter(value = "crv", nulls = Nulls.SKIP) + public _FinalStage crv(Optional crv) { + this.crv = crv; + return this; + } + + /** + *

Key exponent

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage e(String e) { + this.e = Optional.ofNullable(e); + return this; + } + + /** + *

Key exponent

+ */ + @java.lang.Override + @JsonSetter(value = "e", nulls = Nulls.SKIP) + public _FinalStage e(Optional e) { + this.e = e; + return this; + } + + /** + *

Key modulus

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage n(String n) { + this.n = Optional.ofNullable(n); + return this; + } + + /** + *

Key modulus

+ */ + @java.lang.Override + @JsonSetter(value = "n", nulls = Nulls.SKIP) + public _FinalStage n(Optional n) { + this.n = n; + return this; + } + + @java.lang.Override + public _FinalStage alg(CustomSigningKeyAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public _FinalStage alg(Optional alg) { + this.alg = alg; + return this; + } + + /** + *

Key operations

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyOps(List keyOps) { + this.keyOps = Optional.ofNullable(keyOps); + return this; + } + + /** + *

Key operations

+ */ + @java.lang.Override + @JsonSetter(value = "key_ops", nulls = Nulls.SKIP) + public _FinalStage keyOps(Optional> keyOps) { + this.keyOps = keyOps; + return this; + } + + @java.lang.Override + public _FinalStage use(String use) { + this.use = Optional.ofNullable(use); + return this; + } + + @java.lang.Override + @JsonSetter(value = "use", nulls = Nulls.SKIP) + public _FinalStage use(Optional use) { + this.use = use; + return this; + } + + /** + *

Key identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + /** + *

Key identifier

+ */ + @java.lang.Override + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public _FinalStage kid(Optional kid) { + this.kid = kid; + return this; + } + + @java.lang.Override + public CustomSigningKeyJwk build() { + return new CustomSigningKeyJwk( + kty, kid, use, keyOps, alg, n, e, crv, x, y, x5U, x5C, x5T, x5TS256, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java new file mode 100644 index 000000000..c5436f6bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomSigningKeyTypeEnum { + public static final CustomSigningKeyTypeEnum EC = new CustomSigningKeyTypeEnum(Value.EC, "EC"); + + public static final CustomSigningKeyTypeEnum RSA = new CustomSigningKeyTypeEnum(Value.RSA, "RSA"); + + private final Value value; + + private final String string; + + CustomSigningKeyTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomSigningKeyTypeEnum + && this.string.equals(((CustomSigningKeyTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EC: + return visitor.visitEc(); + case RSA: + return visitor.visitRsa(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomSigningKeyTypeEnum valueOf(String value) { + switch (value) { + case "EC": + return EC; + case "RSA": + return RSA; + default: + return new CustomSigningKeyTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EC, + + RSA, + + UNKNOWN + } + + public interface Visitor { + T visitEc(); + + T visitRsa(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DailyStats.java b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java new file mode 100644 index 000000000..9a9419276 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DailyStats.Builder.class) +public final class DailyStats { + private final Optional date; + + private final Optional logins; + + private final Optional signups; + + private final Optional leakedPasswords; + + private final Optional updatedAt; + + private final Optional createdAt; + + private final Map additionalProperties; + + private DailyStats( + Optional date, + Optional logins, + Optional signups, + Optional leakedPasswords, + Optional updatedAt, + Optional createdAt, + Map additionalProperties) { + this.date = date; + this.logins = logins; + this.signups = signups; + this.leakedPasswords = leakedPasswords; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Date these events occurred in ISO 8601 format. + */ + @JsonProperty("date") + public Optional getDate() { + return date; + } + + /** + * @return Number of logins on this date. + */ + @JsonProperty("logins") + public Optional getLogins() { + return logins; + } + + /** + * @return Number of signups on this date. + */ + @JsonProperty("signups") + public Optional getSignups() { + return signups; + } + + /** + * @return Number of breached-password detections on this date (subscription required). + */ + @JsonProperty("leaked_passwords") + public Optional getLeakedPasswords() { + return leakedPasswords; + } + + /** + * @return Date and time this stats entry was last updated in ISO 8601 format. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Approximate date and time the first event occurred in ISO 8601 format. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DailyStats && equalTo((DailyStats) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DailyStats other) { + return date.equals(other.date) + && logins.equals(other.logins) + && signups.equals(other.signups) + && leakedPasswords.equals(other.leakedPasswords) + && updatedAt.equals(other.updatedAt) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.date, this.logins, this.signups, this.leakedPasswords, this.updatedAt, this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional date = Optional.empty(); + + private Optional logins = Optional.empty(); + + private Optional signups = Optional.empty(); + + private Optional leakedPasswords = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DailyStats other) { + date(other.getDate()); + logins(other.getLogins()); + signups(other.getSignups()); + leakedPasswords(other.getLeakedPasswords()); + updatedAt(other.getUpdatedAt()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Date these events occurred in ISO 8601 format.

+ */ + @JsonSetter(value = "date", nulls = Nulls.SKIP) + public Builder date(Optional date) { + this.date = date; + return this; + } + + public Builder date(String date) { + this.date = Optional.ofNullable(date); + return this; + } + + /** + *

Number of logins on this date.

+ */ + @JsonSetter(value = "logins", nulls = Nulls.SKIP) + public Builder logins(Optional logins) { + this.logins = logins; + return this; + } + + public Builder logins(Integer logins) { + this.logins = Optional.ofNullable(logins); + return this; + } + + /** + *

Number of signups on this date.

+ */ + @JsonSetter(value = "signups", nulls = Nulls.SKIP) + public Builder signups(Optional signups) { + this.signups = signups; + return this; + } + + public Builder signups(Integer signups) { + this.signups = Optional.ofNullable(signups); + return this; + } + + /** + *

Number of breached-password detections on this date (subscription required).

+ */ + @JsonSetter(value = "leaked_passwords", nulls = Nulls.SKIP) + public Builder leakedPasswords(Optional leakedPasswords) { + this.leakedPasswords = leakedPasswords; + return this; + } + + public Builder leakedPasswords(Integer leakedPasswords) { + this.leakedPasswords = Optional.ofNullable(leakedPasswords); + return this; + } + + /** + *

Date and time this stats entry was last updated in ISO 8601 format.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(String updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Approximate date and time the first event occurred in ISO 8601 format.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + public DailyStats build() { + return new DailyStats(date, logins, signups, leakedPasswords, updatedAt, createdAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java new file mode 100644 index 000000000..588640ef6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DefaultTokenQuota.Builder.class) +public final class DefaultTokenQuota { + private final Optional clients; + + private final Optional organizations; + + private final Map additionalProperties; + + private DefaultTokenQuota( + Optional clients, + Optional organizations, + Map additionalProperties) { + this.clients = clients; + this.organizations = organizations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("clients") + public Optional getClients() { + return clients; + } + + @JsonProperty("organizations") + public Optional getOrganizations() { + return organizations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DefaultTokenQuota && equalTo((DefaultTokenQuota) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DefaultTokenQuota other) { + return clients.equals(other.clients) && organizations.equals(other.organizations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clients, this.organizations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clients = Optional.empty(); + + private Optional organizations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DefaultTokenQuota other) { + clients(other.getClients()); + organizations(other.getOrganizations()); + return this; + } + + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional clients) { + this.clients = clients; + return this; + } + + public Builder clients(TokenQuotaConfiguration clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + @JsonSetter(value = "organizations", nulls = Nulls.SKIP) + public Builder organizations(Optional organizations) { + this.organizations = organizations; + return this; + } + + public Builder organizations(TokenQuotaConfiguration organizations) { + this.organizations = Optional.ofNullable(organizations); + return this; + } + + public DefaultTokenQuota build() { + return new DefaultTokenQuota(clients, organizations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java new file mode 100644 index 000000000..5f1777c0f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteActionRequestParameters.Builder.class) +public final class DeleteActionRequestParameters { + private final OptionalNullable force; + + private final Map additionalProperties; + + private DeleteActionRequestParameters(OptionalNullable force, Map additionalProperties) { + this.force = force; + this.additionalProperties = additionalProperties; + } + + /** + * @return Force action deletion detaching bindings + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("force") + public OptionalNullable getForce() { + if (force == null) { + return OptionalNullable.absent(); + } + return force; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("force") + private OptionalNullable _getForce() { + return force; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteActionRequestParameters && equalTo((DeleteActionRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteActionRequestParameters other) { + return force.equals(other.force); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.force); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable force = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteActionRequestParameters other) { + force(other.getForce()); + return this; + } + + /** + *

Force action deletion detaching bindings

+ */ + @JsonSetter(value = "force", nulls = Nulls.SKIP) + public Builder force(@Nullable OptionalNullable force) { + this.force = force; + return this; + } + + public Builder force(Boolean force) { + this.force = OptionalNullable.of(force); + return this; + } + + public Builder force(Optional force) { + if (force.isPresent()) { + this.force = OptionalNullable.of(force.get()); + } else { + this.force = OptionalNullable.absent(); + } + return this; + } + + public Builder force(com.auth0.client.mgmt.core.Nullable force) { + if (force.isNull()) { + this.force = OptionalNullable.ofNull(); + } else if (force.isEmpty()) { + this.force = OptionalNullable.absent(); + } else { + this.force = OptionalNullable.of(force.get()); + } + return this; + } + + public DeleteActionRequestParameters build() { + return new DeleteActionRequestParameters(force, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java new file mode 100644 index 000000000..3a5d3b645 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteUserBlocksByIdentifierRequestParameters.Builder.class) +public final class DeleteUserBlocksByIdentifierRequestParameters { + private final String identifier; + + private final Map additionalProperties; + + private DeleteUserBlocksByIdentifierRequestParameters(String identifier, Map additionalProperties) { + this.identifier = identifier; + this.additionalProperties = additionalProperties; + } + + /** + * @return Should be any of a username, phone number, or email. + */ + @JsonProperty("identifier") + public String getIdentifier() { + return identifier; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteUserBlocksByIdentifierRequestParameters + && equalTo((DeleteUserBlocksByIdentifierRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteUserBlocksByIdentifierRequestParameters other) { + return identifier.equals(other.identifier); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdentifierStage builder() { + return new Builder(); + } + + public interface IdentifierStage { + /** + *

Should be any of a username, phone number, or email.

+ */ + _FinalStage identifier(@NotNull String identifier); + + Builder from(DeleteUserBlocksByIdentifierRequestParameters other); + } + + public interface _FinalStage { + DeleteUserBlocksByIdentifierRequestParameters build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdentifierStage, _FinalStage { + private String identifier; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeleteUserBlocksByIdentifierRequestParameters other) { + identifier(other.getIdentifier()); + return this; + } + + /** + *

Should be any of a username, phone number, or email.

+ *

Should be any of a username, phone number, or email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("identifier") + public _FinalStage identifier(@NotNull String identifier) { + this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); + return this; + } + + @java.lang.Override + public DeleteUserBlocksByIdentifierRequestParameters build() { + return new DeleteUserBlocksByIdentifierRequestParameters(identifier, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java new file mode 100644 index 000000000..4f2c23fe2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteUserGrantByUserIdRequestParameters.Builder.class) +public final class DeleteUserGrantByUserIdRequestParameters { + private final String userId; + + private final Map additionalProperties; + + private DeleteUserGrantByUserIdRequestParameters(String userId, Map additionalProperties) { + this.userId = userId; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id of the grant to delete. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteUserGrantByUserIdRequestParameters + && equalTo((DeleteUserGrantByUserIdRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteUserGrantByUserIdRequestParameters other) { + return userId.equals(other.userId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id of the grant to delete.

+ */ + _FinalStage userId(@NotNull String userId); + + Builder from(DeleteUserGrantByUserIdRequestParameters other); + } + + public interface _FinalStage { + DeleteUserGrantByUserIdRequestParameters build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, _FinalStage { + private String userId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeleteUserGrantByUserIdRequestParameters other) { + userId(other.getUserId()); + return this; + } + + /** + *

user_id of the grant to delete.

+ *

user_id of the grant to delete.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @java.lang.Override + public DeleteUserGrantByUserIdRequestParameters build() { + return new DeleteUserGrantByUserIdRequestParameters(userId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java new file mode 100644 index 000000000..becb6c2ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteUserIdentityResponseContentItem.Builder.class) +public final class DeleteUserIdentityResponseContentItem { + private final String connection; + + private final String userId; + + private final String provider; + + private final Optional isSocial; + + private final Optional accessToken; + + private final Optional accessTokenSecret; + + private final Optional refreshToken; + + private final Optional profileData; + + private final Map additionalProperties; + + private DeleteUserIdentityResponseContentItem( + String connection, + String userId, + String provider, + Optional isSocial, + Optional accessToken, + Optional accessTokenSecret, + Optional refreshToken, + Optional profileData, + Map additionalProperties) { + this.connection = connection; + this.userId = userId; + this.provider = provider; + this.isSocial = isSocial; + this.accessToken = accessToken; + this.accessTokenSecret = accessTokenSecret; + this.refreshToken = refreshToken; + this.profileData = profileData; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection for the identity. + */ + @JsonProperty("connection") + public String getConnection() { + return connection; + } + + /** + * @return The unique identifier for the user for the identity. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + /** + * @return The type of identity provider. + */ + @JsonProperty("provider") + public String getProvider() { + return provider; + } + + /** + * @return <code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise + */ + @JsonProperty("isSocial") + public Optional getIsSocial() { + return isSocial; + } + + /** + * @return IDP access token returned only if scope read:user_idp_tokens is defined + */ + @JsonProperty("access_token") + public Optional getAccessToken() { + return accessToken; + } + + /** + * @return IDP access token secret returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("access_token_secret") + public Optional getAccessTokenSecret() { + return accessTokenSecret; + } + + /** + * @return IDP refresh token returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("refresh_token") + public Optional getRefreshToken() { + return refreshToken; + } + + @JsonProperty("profileData") + public Optional getProfileData() { + return profileData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteUserIdentityResponseContentItem + && equalTo((DeleteUserIdentityResponseContentItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteUserIdentityResponseContentItem other) { + return connection.equals(other.connection) + && userId.equals(other.userId) + && provider.equals(other.provider) + && isSocial.equals(other.isSocial) + && accessToken.equals(other.accessToken) + && accessTokenSecret.equals(other.accessTokenSecret) + && refreshToken.equals(other.refreshToken) + && profileData.equals(other.profileData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connection, + this.userId, + this.provider, + this.isSocial, + this.accessToken, + this.accessTokenSecret, + this.refreshToken, + this.profileData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionStage builder() { + return new Builder(); + } + + public interface ConnectionStage { + /** + *

The name of the connection for the identity.

+ */ + UserIdStage connection(@NotNull String connection); + + Builder from(DeleteUserIdentityResponseContentItem other); + } + + public interface UserIdStage { + /** + *

The unique identifier for the user for the identity.

+ */ + ProviderStage userId(@NotNull String userId); + } + + public interface ProviderStage { + /** + *

The type of identity provider.

+ */ + _FinalStage provider(@NotNull String provider); + } + + public interface _FinalStage { + DeleteUserIdentityResponseContentItem build(); + + /** + *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

+ */ + _FinalStage isSocial(Optional isSocial); + + _FinalStage isSocial(Boolean isSocial); + + /** + *

IDP access token returned only if scope read:user_idp_tokens is defined

+ */ + _FinalStage accessToken(Optional accessToken); + + _FinalStage accessToken(String accessToken); + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ */ + _FinalStage accessTokenSecret(Optional accessTokenSecret); + + _FinalStage accessTokenSecret(String accessTokenSecret); + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ */ + _FinalStage refreshToken(Optional refreshToken); + + _FinalStage refreshToken(String refreshToken); + + _FinalStage profileData(Optional profileData); + + _FinalStage profileData(UserProfileData profileData); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionStage, UserIdStage, ProviderStage, _FinalStage { + private String connection; + + private String userId; + + private String provider; + + private Optional profileData = Optional.empty(); + + private Optional refreshToken = Optional.empty(); + + private Optional accessTokenSecret = Optional.empty(); + + private Optional accessToken = Optional.empty(); + + private Optional isSocial = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeleteUserIdentityResponseContentItem other) { + connection(other.getConnection()); + userId(other.getUserId()); + provider(other.getProvider()); + isSocial(other.getIsSocial()); + accessToken(other.getAccessToken()); + accessTokenSecret(other.getAccessTokenSecret()); + refreshToken(other.getRefreshToken()); + profileData(other.getProfileData()); + return this; + } + + /** + *

The name of the connection for the identity.

+ *

The name of the connection for the identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection") + public UserIdStage connection(@NotNull String connection) { + this.connection = Objects.requireNonNull(connection, "connection must not be null"); + return this; + } + + /** + *

The unique identifier for the user for the identity.

+ *

The unique identifier for the user for the identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public ProviderStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + /** + *

The type of identity provider.

+ *

The type of identity provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull String provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage profileData(UserProfileData profileData) { + this.profileData = Optional.ofNullable(profileData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "profileData", nulls = Nulls.SKIP) + public _FinalStage profileData(Optional profileData) { + this.profileData = profileData; + return this; + } + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage refreshToken(String refreshToken) { + this.refreshToken = Optional.ofNullable(refreshToken); + return this; + } + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ */ + @java.lang.Override + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public _FinalStage refreshToken(Optional refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessTokenSecret(String accessTokenSecret) { + this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); + return this; + } + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ */ + @java.lang.Override + @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) + public _FinalStage accessTokenSecret(Optional accessTokenSecret) { + this.accessTokenSecret = accessTokenSecret; + return this; + } + + /** + *

IDP access token returned only if scope read:user_idp_tokens is defined

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessToken(String accessToken) { + this.accessToken = Optional.ofNullable(accessToken); + return this; + } + + /** + *

IDP access token returned only if scope read:user_idp_tokens is defined

+ */ + @java.lang.Override + @JsonSetter(value = "access_token", nulls = Nulls.SKIP) + public _FinalStage accessToken(Optional accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSocial(Boolean isSocial) { + this.isSocial = Optional.ofNullable(isSocial); + return this; + } + + /** + *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

+ */ + @java.lang.Override + @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) + public _FinalStage isSocial(Optional isSocial) { + this.isSocial = isSocial; + return this; + } + + @java.lang.Override + public DeleteUserIdentityResponseContentItem build() { + return new DeleteUserIdentityResponseContentItem( + connection, + userId, + provider, + isSocial, + accessToken, + accessTokenSecret, + refreshToken, + profileData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java new file mode 100644 index 000000000..e1e24fac8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java @@ -0,0 +1,544 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeployActionResponseContent.Builder.class) +public final class DeployActionResponseContent { + private final Optional id; + + private final Optional actionId; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional deployed; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional status; + + private final Optional number; + + private final Optional> errors; + + private final Optional action; + + private final Optional builtAt; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> supportedTriggers; + + private final Map additionalProperties; + + private DeployActionResponseContent( + Optional id, + Optional actionId, + Optional code, + Optional> dependencies, + Optional deployed, + Optional runtime, + Optional> secrets, + Optional status, + Optional number, + Optional> errors, + Optional action, + Optional builtAt, + Optional createdAt, + Optional updatedAt, + Optional> supportedTriggers, + Map additionalProperties) { + this.id = id; + this.actionId = actionId; + this.code = code; + this.dependencies = dependencies; + this.deployed = deployed; + this.runtime = runtime; + this.secrets = secrets; + this.status = status; + this.number = number; + this.errors = errors; + this.action = action; + this.builtAt = builtAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.supportedTriggers = supportedTriggers; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique id of an action version. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The id of the action to which this version belongs. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + /** + * @return The source code of this specific version of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this specific version depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return Indicates if this speciic version is the currently one deployed. + */ + @JsonProperty("deployed") + public Optional getDeployed() { + return deployed; + } + + /** + * @return The Node runtime. For example: node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The index of this version in list of versions for the action. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return Any errors that occurred while the version was being built. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when this version was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return The time when this version was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The list of triggers that this version supports. At this time, a version can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeployActionResponseContent && equalTo((DeployActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeployActionResponseContent other) { + return id.equals(other.id) + && actionId.equals(other.actionId) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && deployed.equals(other.deployed) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && status.equals(other.status) + && number.equals(other.number) + && errors.equals(other.errors) + && action.equals(other.action) + && builtAt.equals(other.builtAt) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && supportedTriggers.equals(other.supportedTriggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.actionId, + this.code, + this.dependencies, + this.deployed, + this.runtime, + this.secrets, + this.status, + this.number, + this.errors, + this.action, + this.builtAt, + this.createdAt, + this.updatedAt, + this.supportedTriggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional deployed = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeployActionResponseContent other) { + id(other.getId()); + actionId(other.getActionId()); + code(other.getCode()); + dependencies(other.getDependencies()); + deployed(other.getDeployed()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + status(other.getStatus()); + number(other.getNumber()); + errors(other.getErrors()); + action(other.getAction()); + builtAt(other.getBuiltAt()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + supportedTriggers(other.getSupportedTriggers()); + return this; + } + + /** + *

The unique id of an action version.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The id of the action to which this version belongs.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + /** + *

The source code of this specific version of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this specific version depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

Indicates if this speciic version is the currently one deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(Optional deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = Optional.ofNullable(deployed); + return this; + } + + /** + *

The Node runtime. For example: node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionVersionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The index of this version in list of versions for the action.

+ */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(Double number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

Any errors that occurred while the version was being built.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(ActionBase action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when this version was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

The time when this version was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The list of triggers that this version supports. At this time, a version can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + public DeployActionResponseContent build() { + return new DeployActionResponseContent( + id, + actionId, + code, + dependencies, + deployed, + runtime, + secrets, + status, + number, + errors, + action, + builtAt, + createdAt, + updatedAt, + supportedTriggers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java new file mode 100644 index 000000000..13bba7690 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeployActionVersionRequestBodyParams.Builder.class) +public final class DeployActionVersionRequestBodyParams { + private final Optional updateDraft; + + private final Map additionalProperties; + + private DeployActionVersionRequestBodyParams( + Optional updateDraft, Map additionalProperties) { + this.updateDraft = updateDraft; + this.additionalProperties = additionalProperties; + } + + /** + * @return True if the draft of the action should be updated with the reverted version. + */ + @JsonProperty("update_draft") + public Optional getUpdateDraft() { + return updateDraft; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeployActionVersionRequestBodyParams + && equalTo((DeployActionVersionRequestBodyParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeployActionVersionRequestBodyParams other) { + return updateDraft.equals(other.updateDraft); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.updateDraft); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional updateDraft = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeployActionVersionRequestBodyParams other) { + updateDraft(other.getUpdateDraft()); + return this; + } + + /** + *

True if the draft of the action should be updated with the reverted version.

+ */ + @JsonSetter(value = "update_draft", nulls = Nulls.SKIP) + public Builder updateDraft(Optional updateDraft) { + this.updateDraft = updateDraft; + return this; + } + + public Builder updateDraft(Boolean updateDraft) { + this.updateDraft = Optional.ofNullable(updateDraft); + return this; + } + + public DeployActionVersionRequestBodyParams build() { + return new DeployActionVersionRequestBodyParams(updateDraft, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java new file mode 100644 index 000000000..dd38f3580 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java @@ -0,0 +1,545 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeployActionVersionResponseContent.Builder.class) +public final class DeployActionVersionResponseContent { + private final Optional id; + + private final Optional actionId; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional deployed; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional status; + + private final Optional number; + + private final Optional> errors; + + private final Optional action; + + private final Optional builtAt; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> supportedTriggers; + + private final Map additionalProperties; + + private DeployActionVersionResponseContent( + Optional id, + Optional actionId, + Optional code, + Optional> dependencies, + Optional deployed, + Optional runtime, + Optional> secrets, + Optional status, + Optional number, + Optional> errors, + Optional action, + Optional builtAt, + Optional createdAt, + Optional updatedAt, + Optional> supportedTriggers, + Map additionalProperties) { + this.id = id; + this.actionId = actionId; + this.code = code; + this.dependencies = dependencies; + this.deployed = deployed; + this.runtime = runtime; + this.secrets = secrets; + this.status = status; + this.number = number; + this.errors = errors; + this.action = action; + this.builtAt = builtAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.supportedTriggers = supportedTriggers; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique id of an action version. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The id of the action to which this version belongs. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + /** + * @return The source code of this specific version of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this specific version depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return Indicates if this speciic version is the currently one deployed. + */ + @JsonProperty("deployed") + public Optional getDeployed() { + return deployed; + } + + /** + * @return The Node runtime. For example: node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The index of this version in list of versions for the action. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return Any errors that occurred while the version was being built. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when this version was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return The time when this version was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The list of triggers that this version supports. At this time, a version can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeployActionVersionResponseContent + && equalTo((DeployActionVersionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeployActionVersionResponseContent other) { + return id.equals(other.id) + && actionId.equals(other.actionId) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && deployed.equals(other.deployed) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && status.equals(other.status) + && number.equals(other.number) + && errors.equals(other.errors) + && action.equals(other.action) + && builtAt.equals(other.builtAt) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && supportedTriggers.equals(other.supportedTriggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.actionId, + this.code, + this.dependencies, + this.deployed, + this.runtime, + this.secrets, + this.status, + this.number, + this.errors, + this.action, + this.builtAt, + this.createdAt, + this.updatedAt, + this.supportedTriggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional deployed = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeployActionVersionResponseContent other) { + id(other.getId()); + actionId(other.getActionId()); + code(other.getCode()); + dependencies(other.getDependencies()); + deployed(other.getDeployed()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + status(other.getStatus()); + number(other.getNumber()); + errors(other.getErrors()); + action(other.getAction()); + builtAt(other.getBuiltAt()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + supportedTriggers(other.getSupportedTriggers()); + return this; + } + + /** + *

The unique id of an action version.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The id of the action to which this version belongs.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + /** + *

The source code of this specific version of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this specific version depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

Indicates if this speciic version is the currently one deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(Optional deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = Optional.ofNullable(deployed); + return this; + } + + /** + *

The Node runtime. For example: node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionVersionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The index of this version in list of versions for the action.

+ */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(Double number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

Any errors that occurred while the version was being built.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(ActionBase action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when this version was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

The time when this version was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The list of triggers that this version supports. At this time, a version can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + public DeployActionVersionResponseContent build() { + return new DeployActionVersionResponseContent( + id, + actionId, + code, + dependencies, + deployed, + runtime, + secrets, + status, + number, + errors, + action, + builtAt, + createdAt, + updatedAt, + supportedTriggers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java new file mode 100644 index 000000000..43b299cd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeviceCredential.Builder.class) +public final class DeviceCredential { + private final Optional id; + + private final Optional deviceName; + + private final Optional deviceId; + + private final Optional type; + + private final Optional userId; + + private final Optional clientId; + + private final Map additionalProperties; + + private DeviceCredential( + Optional id, + Optional deviceName, + Optional deviceId, + Optional type, + Optional userId, + Optional clientId, + Map additionalProperties) { + this.id = id; + this.deviceName = deviceName; + this.deviceId = deviceId; + this.type = type; + this.userId = userId; + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this device. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return User agent for this device + */ + @JsonProperty("device_name") + public Optional getDeviceName() { + return deviceName; + } + + /** + * @return Unique identifier for the device. NOTE: This field is generally not populated for refresh_tokens and rotating_refresh_tokens + */ + @JsonProperty("device_id") + public Optional getDeviceId() { + return deviceId; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return user_id this credential is associated with. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return client_id of the client (application) this credential is for. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeviceCredential && equalTo((DeviceCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeviceCredential other) { + return id.equals(other.id) + && deviceName.equals(other.deviceName) + && deviceId.equals(other.deviceId) + && type.equals(other.type) + && userId.equals(other.userId) + && clientId.equals(other.clientId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.deviceName, this.deviceId, this.type, this.userId, this.clientId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional deviceName = Optional.empty(); + + private Optional deviceId = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeviceCredential other) { + id(other.getId()); + deviceName(other.getDeviceName()); + deviceId(other.getDeviceId()); + type(other.getType()); + userId(other.getUserId()); + clientId(other.getClientId()); + return this; + } + + /** + *

ID of this device.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

User agent for this device

+ */ + @JsonSetter(value = "device_name", nulls = Nulls.SKIP) + public Builder deviceName(Optional deviceName) { + this.deviceName = deviceName; + return this; + } + + public Builder deviceName(String deviceName) { + this.deviceName = Optional.ofNullable(deviceName); + return this; + } + + /** + *

Unique identifier for the device. NOTE: This field is generally not populated for refresh_tokens and rotating_refresh_tokens

+ */ + @JsonSetter(value = "device_id", nulls = Nulls.SKIP) + public Builder deviceId(Optional deviceId) { + this.deviceId = deviceId; + return this; + } + + public Builder deviceId(String deviceId) { + this.deviceId = Optional.ofNullable(deviceId); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(DeviceCredentialTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

user_id this credential is associated with.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

client_id of the client (application) this credential is for.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + public DeviceCredential build() { + return new DeviceCredential(id, deviceName, deviceId, type, userId, clientId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java new file mode 100644 index 000000000..10fe7a1ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DeviceCredentialTypeEnum { + public static final DeviceCredentialTypeEnum REFRESH_TOKEN = + new DeviceCredentialTypeEnum(Value.REFRESH_TOKEN, "refresh_token"); + + public static final DeviceCredentialTypeEnum ROTATING_REFRESH_TOKEN = + new DeviceCredentialTypeEnum(Value.ROTATING_REFRESH_TOKEN, "rotating_refresh_token"); + + public static final DeviceCredentialTypeEnum PUBLIC_KEY = + new DeviceCredentialTypeEnum(Value.PUBLIC_KEY, "public_key"); + + private final Value value; + + private final String string; + + DeviceCredentialTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DeviceCredentialTypeEnum + && this.string.equals(((DeviceCredentialTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REFRESH_TOKEN: + return visitor.visitRefreshToken(); + case ROTATING_REFRESH_TOKEN: + return visitor.visitRotatingRefreshToken(); + case PUBLIC_KEY: + return visitor.visitPublicKey(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DeviceCredentialTypeEnum valueOf(String value) { + switch (value) { + case "refresh_token": + return REFRESH_TOKEN; + case "rotating_refresh_token": + return ROTATING_REFRESH_TOKEN; + case "public_key": + return PUBLIC_KEY; + default: + return new DeviceCredentialTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PUBLIC_KEY, + + REFRESH_TOKEN, + + ROTATING_REFRESH_TOKEN, + + UNKNOWN + } + + public interface Visitor { + T visitPublicKey(); + + T visitRefreshToken(); + + T visitRotatingRefreshToken(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java new file mode 100644 index 000000000..e11b88b77 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DomainVerification.Builder.class) +public final class DomainVerification { + private final Optional> methods; + + private final Map additionalProperties; + + private DomainVerification( + Optional> methods, Map additionalProperties) { + this.methods = methods; + this.additionalProperties = additionalProperties; + } + + /** + * @return Domain verification methods. + */ + @JsonProperty("methods") + public Optional> getMethods() { + return methods; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DomainVerification && equalTo((DomainVerification) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DomainVerification other) { + return methods.equals(other.methods); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.methods); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> methods = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DomainVerification other) { + methods(other.getMethods()); + return this; + } + + /** + *

Domain verification methods.

+ */ + @JsonSetter(value = "methods", nulls = Nulls.SKIP) + public Builder methods(Optional> methods) { + this.methods = methods; + return this; + } + + public Builder methods(List methods) { + this.methods = Optional.ofNullable(methods); + return this; + } + + public DomainVerification build() { + return new DomainVerification(methods, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java new file mode 100644 index 000000000..d34982711 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DomainVerificationMethod.Builder.class) +public final class DomainVerificationMethod { + private final DomainVerificationMethodNameEnum name; + + private final String record; + + private final Optional domain; + + private final Map additionalProperties; + + private DomainVerificationMethod( + DomainVerificationMethodNameEnum name, + String record, + Optional domain, + Map additionalProperties) { + this.name = name; + this.record = record; + this.domain = domain; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DomainVerificationMethodNameEnum getName() { + return name; + } + + /** + * @return Value used to verify the domain. + */ + @JsonProperty("record") + public String getRecord() { + return record; + } + + /** + * @return The name of the txt record for verification + */ + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DomainVerificationMethod && equalTo((DomainVerificationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DomainVerificationMethod other) { + return name.equals(other.name) && record.equals(other.record) && domain.equals(other.domain); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.record, this.domain); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + RecordStage name(@NotNull DomainVerificationMethodNameEnum name); + + Builder from(DomainVerificationMethod other); + } + + public interface RecordStage { + /** + *

Value used to verify the domain.

+ */ + _FinalStage record(@NotNull String record); + } + + public interface _FinalStage { + DomainVerificationMethod build(); + + /** + *

The name of the txt record for verification

+ */ + _FinalStage domain(Optional domain); + + _FinalStage domain(String domain); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, RecordStage, _FinalStage { + private DomainVerificationMethodNameEnum name; + + private String record; + + private Optional domain = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DomainVerificationMethod other) { + name(other.getName()); + record(other.getRecord()); + domain(other.getDomain()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public RecordStage name(@NotNull DomainVerificationMethodNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Value used to verify the domain.

+ *

Value used to verify the domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("record") + public _FinalStage record(@NotNull String record) { + this.record = Objects.requireNonNull(record, "record must not be null"); + return this; + } + + /** + *

The name of the txt record for verification

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + *

The name of the txt record for verification

+ */ + @java.lang.Override + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public _FinalStage domain(Optional domain) { + this.domain = domain; + return this; + } + + @java.lang.Override + public DomainVerificationMethod build() { + return new DomainVerificationMethod(name, record, domain, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java new file mode 100644 index 000000000..f41d37983 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DomainVerificationMethodNameEnum { + public static final DomainVerificationMethodNameEnum CNAME = + new DomainVerificationMethodNameEnum(Value.CNAME, "cname"); + + public static final DomainVerificationMethodNameEnum TXT = new DomainVerificationMethodNameEnum(Value.TXT, "txt"); + + private final Value value; + + private final String string; + + DomainVerificationMethodNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DomainVerificationMethodNameEnum + && this.string.equals(((DomainVerificationMethodNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CNAME: + return visitor.visitCname(); + case TXT: + return visitor.visitTxt(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DomainVerificationMethodNameEnum valueOf(String value) { + switch (value) { + case "cname": + return CNAME; + case "txt": + return TXT; + default: + return new DomainVerificationMethodNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CNAME, + + TXT, + + UNKNOWN + } + + public interface Visitor { + T visitCname(); + + T visitTxt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java new file mode 100644 index 000000000..5a0df3b96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailAttribute.Builder.class) +public final class EmailAttribute { + private final Optional identifier; + + private final Optional profileRequired; + + private final Optional verificationMethod; + + private final Optional signup; + + private final Map additionalProperties; + + private EmailAttribute( + Optional identifier, + Optional profileRequired, + Optional verificationMethod, + Optional signup, + Map additionalProperties) { + this.identifier = identifier; + this.profileRequired = profileRequired; + this.verificationMethod = verificationMethod; + this.signup = signup; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return Determines if property should be required for users + */ + @JsonProperty("profile_required") + public Optional getProfileRequired() { + return profileRequired; + } + + @JsonProperty("verification_method") + public Optional getVerificationMethod() { + return verificationMethod; + } + + @JsonProperty("signup") + public Optional getSignup() { + return signup; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailAttribute && equalTo((EmailAttribute) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailAttribute other) { + return identifier.equals(other.identifier) + && profileRequired.equals(other.profileRequired) + && verificationMethod.equals(other.verificationMethod) + && signup.equals(other.signup); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier, this.profileRequired, this.verificationMethod, this.signup); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional identifier = Optional.empty(); + + private Optional profileRequired = Optional.empty(); + + private Optional verificationMethod = Optional.empty(); + + private Optional signup = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailAttribute other) { + identifier(other.getIdentifier()); + profileRequired(other.getProfileRequired()); + verificationMethod(other.getVerificationMethod()); + signup(other.getSignup()); + return this; + } + + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(ConnectionAttributeIdentifier identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

Determines if property should be required for users

+ */ + @JsonSetter(value = "profile_required", nulls = Nulls.SKIP) + public Builder profileRequired(Optional profileRequired) { + this.profileRequired = profileRequired; + return this; + } + + public Builder profileRequired(Boolean profileRequired) { + this.profileRequired = Optional.ofNullable(profileRequired); + return this; + } + + @JsonSetter(value = "verification_method", nulls = Nulls.SKIP) + public Builder verificationMethod(Optional verificationMethod) { + this.verificationMethod = verificationMethod; + return this; + } + + public Builder verificationMethod(VerificationMethodEnum verificationMethod) { + this.verificationMethod = Optional.ofNullable(verificationMethod); + return this; + } + + @JsonSetter(value = "signup", nulls = Nulls.SKIP) + public Builder signup(Optional signup) { + this.signup = signup; + return this; + } + + public Builder signup(SignupVerified signup) { + this.signup = Optional.ofNullable(signup); + return this; + } + + public EmailAttribute build() { + return new EmailAttribute(identifier, profileRequired, verificationMethod, signup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java new file mode 100644 index 000000000..2de5fba4f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java @@ -0,0 +1,223 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentials.Builder.class) +public final class EmailProviderCredentials { + private final Optional apiUser; + + private final Optional region; + + private final Optional smtpHost; + + private final Optional smtpPort; + + private final Optional smtpUser; + + private final Map additionalProperties; + + private EmailProviderCredentials( + Optional apiUser, + Optional region, + Optional smtpHost, + Optional smtpPort, + Optional smtpUser, + Map additionalProperties) { + this.apiUser = apiUser; + this.region = region; + this.smtpHost = smtpHost; + this.smtpPort = smtpPort; + this.smtpUser = smtpUser; + this.additionalProperties = additionalProperties; + } + + /** + * @return API User. + */ + @JsonProperty("api_user") + public Optional getApiUser() { + return apiUser; + } + + /** + * @return AWS or SparkPost region. + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return SMTP host. + */ + @JsonProperty("smtp_host") + public Optional getSmtpHost() { + return smtpHost; + } + + /** + * @return SMTP port. + */ + @JsonProperty("smtp_port") + public Optional getSmtpPort() { + return smtpPort; + } + + /** + * @return SMTP username. + */ + @JsonProperty("smtp_user") + public Optional getSmtpUser() { + return smtpUser; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentials && equalTo((EmailProviderCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentials other) { + return apiUser.equals(other.apiUser) + && region.equals(other.region) + && smtpHost.equals(other.smtpHost) + && smtpPort.equals(other.smtpPort) + && smtpUser.equals(other.smtpUser); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiUser, this.region, this.smtpHost, this.smtpPort, this.smtpUser); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional apiUser = Optional.empty(); + + private Optional region = Optional.empty(); + + private Optional smtpHost = Optional.empty(); + + private Optional smtpPort = Optional.empty(); + + private Optional smtpUser = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentials other) { + apiUser(other.getApiUser()); + region(other.getRegion()); + smtpHost(other.getSmtpHost()); + smtpPort(other.getSmtpPort()); + smtpUser(other.getSmtpUser()); + return this; + } + + /** + *

API User.

+ */ + @JsonSetter(value = "api_user", nulls = Nulls.SKIP) + public Builder apiUser(Optional apiUser) { + this.apiUser = apiUser; + return this; + } + + public Builder apiUser(String apiUser) { + this.apiUser = Optional.ofNullable(apiUser); + return this; + } + + /** + *

AWS or SparkPost region.

+ */ + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(String region) { + this.region = Optional.ofNullable(region); + return this; + } + + /** + *

SMTP host.

+ */ + @JsonSetter(value = "smtp_host", nulls = Nulls.SKIP) + public Builder smtpHost(Optional smtpHost) { + this.smtpHost = smtpHost; + return this; + } + + public Builder smtpHost(String smtpHost) { + this.smtpHost = Optional.ofNullable(smtpHost); + return this; + } + + /** + *

SMTP port.

+ */ + @JsonSetter(value = "smtp_port", nulls = Nulls.SKIP) + public Builder smtpPort(Optional smtpPort) { + this.smtpPort = smtpPort; + return this; + } + + public Builder smtpPort(Integer smtpPort) { + this.smtpPort = Optional.ofNullable(smtpPort); + return this; + } + + /** + *

SMTP username.

+ */ + @JsonSetter(value = "smtp_user", nulls = Nulls.SKIP) + public Builder smtpUser(Optional smtpUser) { + this.smtpUser = smtpUser; + return this; + } + + public Builder smtpUser(String smtpUser) { + this.smtpUser = Optional.ofNullable(smtpUser); + return this; + } + + public EmailProviderCredentials build() { + return new EmailProviderCredentials(apiUser, region, smtpHost, smtpPort, smtpUser, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java new file mode 100644 index 000000000..2ab98a41f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmailProviderCredentialsSchema.Deserializer.class) +public final class EmailProviderCredentialsSchema { + private final Object value; + + private final int type; + + private EmailProviderCredentialsSchema(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EmailProviderCredentialsSchemaZero) this.value); + } else if (this.type == 1) { + return visitor.visit((EmailProviderCredentialsSchemaAccessKeyId) this.value); + } else if (this.type == 2) { + return visitor.visit((EmailProviderCredentialsSchemaSmtpHost) this.value); + } else if (this.type == 3) { + return visitor.visit((EmailProviderCredentialsSchemaThree) this.value); + } else if (this.type == 4) { + return visitor.visit((EmailProviderCredentialsSchemaApiKey) this.value); + } else if (this.type == 5) { + return visitor.visit((EmailProviderCredentialsSchemaConnectionString) this.value); + } else if (this.type == 6) { + return visitor.visit((EmailProviderCredentialsSchemaClientId) this.value); + } else if (this.type == 7) { + return visitor.visit((ExtensibilityEmailProviderCredentials) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchema && equalTo((EmailProviderCredentialsSchema) other); + } + + private boolean equalTo(EmailProviderCredentialsSchema other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaZero value) { + return new EmailProviderCredentialsSchema(value, 0); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaAccessKeyId value) { + return new EmailProviderCredentialsSchema(value, 1); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaSmtpHost value) { + return new EmailProviderCredentialsSchema(value, 2); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaThree value) { + return new EmailProviderCredentialsSchema(value, 3); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaApiKey value) { + return new EmailProviderCredentialsSchema(value, 4); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaConnectionString value) { + return new EmailProviderCredentialsSchema(value, 5); + } + + public static EmailProviderCredentialsSchema of(EmailProviderCredentialsSchemaClientId value) { + return new EmailProviderCredentialsSchema(value, 6); + } + + public static EmailProviderCredentialsSchema of(ExtensibilityEmailProviderCredentials value) { + return new EmailProviderCredentialsSchema(value, 7); + } + + public interface Visitor { + T visit(EmailProviderCredentialsSchemaZero value); + + T visit(EmailProviderCredentialsSchemaAccessKeyId value); + + T visit(EmailProviderCredentialsSchemaSmtpHost value); + + T visit(EmailProviderCredentialsSchemaThree value); + + T visit(EmailProviderCredentialsSchemaApiKey value); + + T visit(EmailProviderCredentialsSchemaConnectionString value); + + T visit(EmailProviderCredentialsSchemaClientId value); + + T visit(ExtensibilityEmailProviderCredentials value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmailProviderCredentialsSchema.class); + } + + @java.lang.Override + public EmailProviderCredentialsSchema deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaZero.class)); + } catch (RuntimeException e) { + } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaAccessKeyId.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaSmtpHost.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaThree.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, EmailProviderCredentialsSchemaConnectionString.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailProviderCredentialsSchemaClientId.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ExtensibilityEmailProviderCredentials.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaAccessKeyId.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaAccessKeyId.java new file mode 100644 index 000000000..aeb41ba39 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaAccessKeyId.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaAccessKeyId.Builder.class) +public final class EmailProviderCredentialsSchemaAccessKeyId { + private final Optional accessKeyId; + + private final Optional secretAccessKey; + + private final Optional region; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaAccessKeyId( + Optional accessKeyId, + Optional secretAccessKey, + Optional region, + Map additionalProperties) { + this.accessKeyId = accessKeyId; + this.secretAccessKey = secretAccessKey; + this.region = region; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS Access Key ID. + */ + @JsonProperty("accessKeyId") + public Optional getAccessKeyId() { + return accessKeyId; + } + + /** + * @return AWS Secret Access Key. + */ + @JsonProperty("secretAccessKey") + public Optional getSecretAccessKey() { + return secretAccessKey; + } + + /** + * @return AWS region. + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaAccessKeyId + && equalTo((EmailProviderCredentialsSchemaAccessKeyId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaAccessKeyId other) { + return accessKeyId.equals(other.accessKeyId) + && secretAccessKey.equals(other.secretAccessKey) + && region.equals(other.region); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accessKeyId, this.secretAccessKey, this.region); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accessKeyId = Optional.empty(); + + private Optional secretAccessKey = Optional.empty(); + + private Optional region = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaAccessKeyId other) { + accessKeyId(other.getAccessKeyId()); + secretAccessKey(other.getSecretAccessKey()); + region(other.getRegion()); + return this; + } + + /** + *

AWS Access Key ID.

+ */ + @JsonSetter(value = "accessKeyId", nulls = Nulls.SKIP) + public Builder accessKeyId(Optional accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + public Builder accessKeyId(String accessKeyId) { + this.accessKeyId = Optional.ofNullable(accessKeyId); + return this; + } + + /** + *

AWS Secret Access Key.

+ */ + @JsonSetter(value = "secretAccessKey", nulls = Nulls.SKIP) + public Builder secretAccessKey(Optional secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + public Builder secretAccessKey(String secretAccessKey) { + this.secretAccessKey = Optional.ofNullable(secretAccessKey); + return this; + } + + /** + *

AWS region.

+ */ + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(String region) { + this.region = Optional.ofNullable(region); + return this; + } + + public EmailProviderCredentialsSchemaAccessKeyId build() { + return new EmailProviderCredentialsSchemaAccessKeyId( + accessKeyId, secretAccessKey, region, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java new file mode 100644 index 000000000..ffd466404 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaApiKey.Builder.class) +public final class EmailProviderCredentialsSchemaApiKey { + private final Optional apiKey; + + private final Optional domain; + + private final Optional region; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaApiKey( + Optional apiKey, + Optional domain, + Optional region, + Map additionalProperties) { + this.apiKey = apiKey; + this.domain = domain; + this.region = region; + this.additionalProperties = additionalProperties; + } + + /** + * @return API Key + */ + @JsonProperty("api_key") + public Optional getApiKey() { + return apiKey; + } + + /** + * @return Domain + */ + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaApiKey + && equalTo((EmailProviderCredentialsSchemaApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaApiKey other) { + return apiKey.equals(other.apiKey) && domain.equals(other.domain) && region.equals(other.region); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.domain, this.region); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional apiKey = Optional.empty(); + + private Optional domain = Optional.empty(); + + private Optional region = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaApiKey other) { + apiKey(other.getApiKey()); + domain(other.getDomain()); + region(other.getRegion()); + return this; + } + + /** + *

API Key

+ */ + @JsonSetter(value = "api_key", nulls = Nulls.SKIP) + public Builder apiKey(Optional apiKey) { + this.apiKey = apiKey; + return this; + } + + public Builder apiKey(String apiKey) { + this.apiKey = Optional.ofNullable(apiKey); + return this; + } + + /** + *

Domain

+ */ + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public Builder domain(Optional domain) { + this.domain = domain; + return this; + } + + public Builder domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(String region) { + this.region = Optional.ofNullable(region); + return this; + } + + public EmailProviderCredentialsSchemaApiKey build() { + return new EmailProviderCredentialsSchemaApiKey(apiKey, domain, region, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java new file mode 100644 index 000000000..afd69f78a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaClientId.Builder.class) +public final class EmailProviderCredentialsSchemaClientId { + private final Optional tenantId; + + private final Optional clientId; + + private final Optional clientSecret; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaClientId( + Optional tenantId, + Optional clientId, + Optional clientSecret, + Map additionalProperties) { + this.tenantId = tenantId; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.additionalProperties = additionalProperties; + } + + /** + * @return Microsoft 365 Tenant ID. + */ + @JsonProperty("tenantId") + public Optional getTenantId() { + return tenantId; + } + + /** + * @return Microsoft 365 Client ID. + */ + @JsonProperty("clientId") + public Optional getClientId() { + return clientId; + } + + /** + * @return Microsoft 365 Client Secret. + */ + @JsonProperty("clientSecret") + public Optional getClientSecret() { + return clientSecret; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaClientId + && equalTo((EmailProviderCredentialsSchemaClientId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaClientId other) { + return tenantId.equals(other.tenantId) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tenantId, this.clientId, this.clientSecret); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tenantId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaClientId other) { + tenantId(other.getTenantId()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + return this; + } + + /** + *

Microsoft 365 Tenant ID.

+ */ + @JsonSetter(value = "tenantId", nulls = Nulls.SKIP) + public Builder tenantId(Optional tenantId) { + this.tenantId = tenantId; + return this; + } + + public Builder tenantId(String tenantId) { + this.tenantId = Optional.ofNullable(tenantId); + return this; + } + + /** + *

Microsoft 365 Client ID.

+ */ + @JsonSetter(value = "clientId", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Microsoft 365 Client Secret.

+ */ + @JsonSetter(value = "clientSecret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + public EmailProviderCredentialsSchemaClientId build() { + return new EmailProviderCredentialsSchemaClientId(tenantId, clientId, clientSecret, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java new file mode 100644 index 000000000..92c4c9bfe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaConnectionString.Builder.class) +public final class EmailProviderCredentialsSchemaConnectionString { + private final Optional connectionString; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaConnectionString( + Optional connectionString, Map additionalProperties) { + this.connectionString = connectionString; + this.additionalProperties = additionalProperties; + } + + /** + * @return Azure Communication Services Connection String. + */ + @JsonProperty("connectionString") + public Optional getConnectionString() { + return connectionString; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaConnectionString + && equalTo((EmailProviderCredentialsSchemaConnectionString) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaConnectionString other) { + return connectionString.equals(other.connectionString); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionString); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionString = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaConnectionString other) { + connectionString(other.getConnectionString()); + return this; + } + + /** + *

Azure Communication Services Connection String.

+ */ + @JsonSetter(value = "connectionString", nulls = Nulls.SKIP) + public Builder connectionString(Optional connectionString) { + this.connectionString = connectionString; + return this; + } + + public Builder connectionString(String connectionString) { + this.connectionString = Optional.ofNullable(connectionString); + return this; + } + + public EmailProviderCredentialsSchemaConnectionString build() { + return new EmailProviderCredentialsSchemaConnectionString(connectionString, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java new file mode 100644 index 000000000..e32a7d5c8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaSmtpHost.Builder.class) +public final class EmailProviderCredentialsSchemaSmtpHost { + private final Optional smtpHost; + + private final Optional smtpPort; + + private final Optional smtpUser; + + private final Optional smtpPass; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaSmtpHost( + Optional smtpHost, + Optional smtpPort, + Optional smtpUser, + Optional smtpPass, + Map additionalProperties) { + this.smtpHost = smtpHost; + this.smtpPort = smtpPort; + this.smtpUser = smtpUser; + this.smtpPass = smtpPass; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("smtp_host") + public Optional getSmtpHost() { + return smtpHost; + } + + /** + * @return SMTP port. + */ + @JsonProperty("smtp_port") + public Optional getSmtpPort() { + return smtpPort; + } + + /** + * @return SMTP username. + */ + @JsonProperty("smtp_user") + public Optional getSmtpUser() { + return smtpUser; + } + + /** + * @return SMTP password. + */ + @JsonProperty("smtp_pass") + public Optional getSmtpPass() { + return smtpPass; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaSmtpHost + && equalTo((EmailProviderCredentialsSchemaSmtpHost) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaSmtpHost other) { + return smtpHost.equals(other.smtpHost) + && smtpPort.equals(other.smtpPort) + && smtpUser.equals(other.smtpUser) + && smtpPass.equals(other.smtpPass); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.smtpHost, this.smtpPort, this.smtpUser, this.smtpPass); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional smtpHost = Optional.empty(); + + private Optional smtpPort = Optional.empty(); + + private Optional smtpUser = Optional.empty(); + + private Optional smtpPass = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaSmtpHost other) { + smtpHost(other.getSmtpHost()); + smtpPort(other.getSmtpPort()); + smtpUser(other.getSmtpUser()); + smtpPass(other.getSmtpPass()); + return this; + } + + @JsonSetter(value = "smtp_host", nulls = Nulls.SKIP) + public Builder smtpHost(Optional smtpHost) { + this.smtpHost = smtpHost; + return this; + } + + public Builder smtpHost(String smtpHost) { + this.smtpHost = Optional.ofNullable(smtpHost); + return this; + } + + /** + *

SMTP port.

+ */ + @JsonSetter(value = "smtp_port", nulls = Nulls.SKIP) + public Builder smtpPort(Optional smtpPort) { + this.smtpPort = smtpPort; + return this; + } + + public Builder smtpPort(Integer smtpPort) { + this.smtpPort = Optional.ofNullable(smtpPort); + return this; + } + + /** + *

SMTP username.

+ */ + @JsonSetter(value = "smtp_user", nulls = Nulls.SKIP) + public Builder smtpUser(Optional smtpUser) { + this.smtpUser = smtpUser; + return this; + } + + public Builder smtpUser(String smtpUser) { + this.smtpUser = Optional.ofNullable(smtpUser); + return this; + } + + /** + *

SMTP password.

+ */ + @JsonSetter(value = "smtp_pass", nulls = Nulls.SKIP) + public Builder smtpPass(Optional smtpPass) { + this.smtpPass = smtpPass; + return this; + } + + public Builder smtpPass(String smtpPass) { + this.smtpPass = Optional.ofNullable(smtpPass); + return this; + } + + public EmailProviderCredentialsSchemaSmtpHost build() { + return new EmailProviderCredentialsSchemaSmtpHost( + smtpHost, smtpPort, smtpUser, smtpPass, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java new file mode 100644 index 000000000..6bb0d8525 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaThree.Builder.class) +public final class EmailProviderCredentialsSchemaThree { + private final Optional apiKey; + + private final Optional region; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaThree( + Optional apiKey, Optional region, Map additionalProperties) { + this.apiKey = apiKey; + this.region = region; + this.additionalProperties = additionalProperties; + } + + /** + * @return API Key + */ + @JsonProperty("api_key") + public Optional getApiKey() { + return apiKey; + } + + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaThree + && equalTo((EmailProviderCredentialsSchemaThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaThree other) { + return apiKey.equals(other.apiKey) && region.equals(other.region); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey, this.region); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional apiKey = Optional.empty(); + + private Optional region = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailProviderCredentialsSchemaThree other) { + apiKey(other.getApiKey()); + region(other.getRegion()); + return this; + } + + /** + *

API Key

+ */ + @JsonSetter(value = "api_key", nulls = Nulls.SKIP) + public Builder apiKey(Optional apiKey) { + this.apiKey = apiKey; + return this; + } + + public Builder apiKey(String apiKey) { + this.apiKey = Optional.ofNullable(apiKey); + return this; + } + + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public Builder region(Optional region) { + this.region = region; + return this; + } + + public Builder region(String region) { + this.region = Optional.ofNullable(region); + return this; + } + + public EmailProviderCredentialsSchemaThree build() { + return new EmailProviderCredentialsSchemaThree(apiKey, region, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java new file mode 100644 index 000000000..330800496 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailProviderCredentialsSchemaZero.Builder.class) +public final class EmailProviderCredentialsSchemaZero { + private final String apiKey; + + private final Map additionalProperties; + + private EmailProviderCredentialsSchemaZero(String apiKey, Map additionalProperties) { + this.apiKey = apiKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return API Key + */ + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailProviderCredentialsSchemaZero + && equalTo((EmailProviderCredentialsSchemaZero) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailProviderCredentialsSchemaZero other) { + return apiKey.equals(other.apiKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + /** + *

API Key

+ */ + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(EmailProviderCredentialsSchemaZero other); + } + + public interface _FinalStage { + EmailProviderCredentialsSchemaZero build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EmailProviderCredentialsSchemaZero other) { + apiKey(other.getApiKey()); + return this; + } + + /** + *

API Key

+ *

API Key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("api_key") + public _FinalStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @java.lang.Override + public EmailProviderCredentialsSchemaZero build() { + return new EmailProviderCredentialsSchemaZero(apiKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java new file mode 100644 index 000000000..3adaf39e7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EmailProviderNameEnum { + public static final EmailProviderNameEnum MAILGUN = new EmailProviderNameEnum(Value.MAILGUN, "mailgun"); + + public static final EmailProviderNameEnum SES = new EmailProviderNameEnum(Value.SES, "ses"); + + public static final EmailProviderNameEnum MS365 = new EmailProviderNameEnum(Value.MS365, "ms365"); + + public static final EmailProviderNameEnum CUSTOM = new EmailProviderNameEnum(Value.CUSTOM, "custom"); + + public static final EmailProviderNameEnum SPARKPOST = new EmailProviderNameEnum(Value.SPARKPOST, "sparkpost"); + + public static final EmailProviderNameEnum AZURE_CS = new EmailProviderNameEnum(Value.AZURE_CS, "azure_cs"); + + public static final EmailProviderNameEnum SMTP = new EmailProviderNameEnum(Value.SMTP, "smtp"); + + public static final EmailProviderNameEnum MANDRILL = new EmailProviderNameEnum(Value.MANDRILL, "mandrill"); + + public static final EmailProviderNameEnum SENDGRID = new EmailProviderNameEnum(Value.SENDGRID, "sendgrid"); + + private final Value value; + + private final String string; + + EmailProviderNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EmailProviderNameEnum + && this.string.equals(((EmailProviderNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MAILGUN: + return visitor.visitMailgun(); + case SES: + return visitor.visitSes(); + case MS365: + return visitor.visitMs365(); + case CUSTOM: + return visitor.visitCustom(); + case SPARKPOST: + return visitor.visitSparkpost(); + case AZURE_CS: + return visitor.visitAzureCs(); + case SMTP: + return visitor.visitSmtp(); + case MANDRILL: + return visitor.visitMandrill(); + case SENDGRID: + return visitor.visitSendgrid(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EmailProviderNameEnum valueOf(String value) { + switch (value) { + case "mailgun": + return MAILGUN; + case "ses": + return SES; + case "ms365": + return MS365; + case "custom": + return CUSTOM; + case "sparkpost": + return SPARKPOST; + case "azure_cs": + return AZURE_CS; + case "smtp": + return SMTP; + case "mandrill": + return MANDRILL; + case "sendgrid": + return SENDGRID; + default: + return new EmailProviderNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + MAILGUN, + + MANDRILL, + + SENDGRID, + + SES, + + SPARKPOST, + + SMTP, + + AZURE_CS, + + MS365, + + CUSTOM, + + UNKNOWN + } + + public interface Visitor { + T visitMailgun(); + + T visitMandrill(); + + T visitSendgrid(); + + T visitSes(); + + T visitSparkpost(); + + T visitSmtp(); + + T visitAzureCs(); + + T visitMs365(); + + T visitCustom(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java new file mode 100644 index 000000000..cde3175c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EmailTemplateNameEnum { + public static final EmailTemplateNameEnum RESET_EMAIL_BY_CODE = + new EmailTemplateNameEnum(Value.RESET_EMAIL_BY_CODE, "reset_email_by_code"); + + public static final EmailTemplateNameEnum CHANGE_PASSWORD = + new EmailTemplateNameEnum(Value.CHANGE_PASSWORD, "change_password"); + + public static final EmailTemplateNameEnum STOLEN_CREDENTIALS = + new EmailTemplateNameEnum(Value.STOLEN_CREDENTIALS, "stolen_credentials"); + + public static final EmailTemplateNameEnum USER_INVITATION = + new EmailTemplateNameEnum(Value.USER_INVITATION, "user_invitation"); + + public static final EmailTemplateNameEnum BLOCKED_ACCOUNT = + new EmailTemplateNameEnum(Value.BLOCKED_ACCOUNT, "blocked_account"); + + public static final EmailTemplateNameEnum ENROLLMENT_EMAIL = + new EmailTemplateNameEnum(Value.ENROLLMENT_EMAIL, "enrollment_email"); + + public static final EmailTemplateNameEnum PASSWORD_RESET = + new EmailTemplateNameEnum(Value.PASSWORD_RESET, "password_reset"); + + public static final EmailTemplateNameEnum VERIFY_EMAIL = + new EmailTemplateNameEnum(Value.VERIFY_EMAIL, "verify_email"); + + public static final EmailTemplateNameEnum WELCOME_EMAIL = + new EmailTemplateNameEnum(Value.WELCOME_EMAIL, "welcome_email"); + + public static final EmailTemplateNameEnum VERIFY_EMAIL_BY_CODE = + new EmailTemplateNameEnum(Value.VERIFY_EMAIL_BY_CODE, "verify_email_by_code"); + + public static final EmailTemplateNameEnum MFA_OOB_CODE = + new EmailTemplateNameEnum(Value.MFA_OOB_CODE, "mfa_oob_code"); + + public static final EmailTemplateNameEnum ASYNC_APPROVAL = + new EmailTemplateNameEnum(Value.ASYNC_APPROVAL, "async_approval"); + + public static final EmailTemplateNameEnum RESET_EMAIL = new EmailTemplateNameEnum(Value.RESET_EMAIL, "reset_email"); + + private final Value value; + + private final String string; + + EmailTemplateNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EmailTemplateNameEnum + && this.string.equals(((EmailTemplateNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RESET_EMAIL_BY_CODE: + return visitor.visitResetEmailByCode(); + case CHANGE_PASSWORD: + return visitor.visitChangePassword(); + case STOLEN_CREDENTIALS: + return visitor.visitStolenCredentials(); + case USER_INVITATION: + return visitor.visitUserInvitation(); + case BLOCKED_ACCOUNT: + return visitor.visitBlockedAccount(); + case ENROLLMENT_EMAIL: + return visitor.visitEnrollmentEmail(); + case PASSWORD_RESET: + return visitor.visitPasswordReset(); + case VERIFY_EMAIL: + return visitor.visitVerifyEmail(); + case WELCOME_EMAIL: + return visitor.visitWelcomeEmail(); + case VERIFY_EMAIL_BY_CODE: + return visitor.visitVerifyEmailByCode(); + case MFA_OOB_CODE: + return visitor.visitMfaOobCode(); + case ASYNC_APPROVAL: + return visitor.visitAsyncApproval(); + case RESET_EMAIL: + return visitor.visitResetEmail(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EmailTemplateNameEnum valueOf(String value) { + switch (value) { + case "reset_email_by_code": + return RESET_EMAIL_BY_CODE; + case "change_password": + return CHANGE_PASSWORD; + case "stolen_credentials": + return STOLEN_CREDENTIALS; + case "user_invitation": + return USER_INVITATION; + case "blocked_account": + return BLOCKED_ACCOUNT; + case "enrollment_email": + return ENROLLMENT_EMAIL; + case "password_reset": + return PASSWORD_RESET; + case "verify_email": + return VERIFY_EMAIL; + case "welcome_email": + return WELCOME_EMAIL; + case "verify_email_by_code": + return VERIFY_EMAIL_BY_CODE; + case "mfa_oob_code": + return MFA_OOB_CODE; + case "async_approval": + return ASYNC_APPROVAL; + case "reset_email": + return RESET_EMAIL; + default: + return new EmailTemplateNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + VERIFY_EMAIL, + + VERIFY_EMAIL_BY_CODE, + + RESET_EMAIL, + + RESET_EMAIL_BY_CODE, + + WELCOME_EMAIL, + + BLOCKED_ACCOUNT, + + STOLEN_CREDENTIALS, + + ENROLLMENT_EMAIL, + + MFA_OOB_CODE, + + USER_INVITATION, + + CHANGE_PASSWORD, + + PASSWORD_RESET, + + ASYNC_APPROVAL, + + UNKNOWN + } + + public interface Visitor { + T visitVerifyEmail(); + + T visitVerifyEmailByCode(); + + T visitResetEmail(); + + T visitResetEmailByCode(); + + T visitWelcomeEmail(); + + T visitBlockedAccount(); + + T visitStolenCredentials(); + + T visitEnrollmentEmail(); + + T visitMfaOobCode(); + + T visitUserInvitation(); + + T visitChangePassword(); + + T visitPasswordReset(); + + T visitAsyncApproval(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java new file mode 100644 index 000000000..98b0a4c6e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EncryptionKey.Builder.class) +public final class EncryptionKey { + private final String kid; + + private final EncryptionKeyType type; + + private final EncryptionKeyState state; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final String parentKid; + + private final Optional publicKey; + + private final Map additionalProperties; + + private EncryptionKey( + String kid, + EncryptionKeyType type, + EncryptionKeyState state, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + String parentKid, + Optional publicKey, + Map additionalProperties) { + this.kid = kid; + this.type = type; + this.state = state; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.parentKid = parentKid; + this.publicKey = publicKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key ID + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @JsonProperty("type") + public EncryptionKeyType getType() { + return type; + } + + @JsonProperty("state") + public EncryptionKeyState getState() { + return state; + } + + /** + * @return Key creation timestamp + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Key update timestamp + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return ID of parent wrapping key + */ + @JsonProperty("parent_kid") + public String getParentKid() { + return parentKid; + } + + /** + * @return Public key in PEM format + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EncryptionKey && equalTo((EncryptionKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EncryptionKey other) { + return kid.equals(other.kid) + && type.equals(other.type) + && state.equals(other.state) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && parentKid.equals(other.parentKid) + && publicKey.equals(other.publicKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

Key ID

+ */ + TypeStage kid(@NotNull String kid); + + Builder from(EncryptionKey other); + } + + public interface TypeStage { + StateStage type(@NotNull EncryptionKeyType type); + } + + public interface StateStage { + CreatedAtStage state(@NotNull EncryptionKeyState state); + } + + public interface CreatedAtStage { + /** + *

Key creation timestamp

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

Key update timestamp

+ */ + ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface ParentKidStage { + /** + *

ID of parent wrapping key

+ */ + _FinalStage parentKid(@NotNull String parentKid); + } + + public interface _FinalStage { + EncryptionKey build(); + + /** + *

Public key in PEM format

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements KidStage, TypeStage, StateStage, CreatedAtStage, UpdatedAtStage, ParentKidStage, _FinalStage { + private String kid; + + private EncryptionKeyType type; + + private EncryptionKeyState state; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String parentKid; + + private Optional publicKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EncryptionKey other) { + kid(other.getKid()); + type(other.getType()); + state(other.getState()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + parentKid(other.getParentKid()); + publicKey(other.getPublicKey()); + return this; + } + + /** + *

Key ID

+ *

Key ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public TypeStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public StateStage type(@NotNull EncryptionKeyType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("state") + public CreatedAtStage state(@NotNull EncryptionKeyState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + /** + *

Key creation timestamp

+ *

Key creation timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Key update timestamp

+ *

Key update timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

ID of parent wrapping key

+ *

ID of parent wrapping key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parent_kid") + public _FinalStage parentKid(@NotNull String parentKid) { + this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); + return this; + } + + /** + *

Public key in PEM format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Public key in PEM format

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + @java.lang.Override + public EncryptionKey build() { + return new EncryptionKey( + kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java new file mode 100644 index 000000000..50b5ab6a8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EncryptionKeyState { + public static final EncryptionKeyState DESTROYED = new EncryptionKeyState(Value.DESTROYED, "destroyed"); + + public static final EncryptionKeyState PRE_ACTIVATION = + new EncryptionKeyState(Value.PRE_ACTIVATION, "pre-activation"); + + public static final EncryptionKeyState DEACTIVATED = new EncryptionKeyState(Value.DEACTIVATED, "deactivated"); + + public static final EncryptionKeyState ACTIVE = new EncryptionKeyState(Value.ACTIVE, "active"); + + private final Value value; + + private final String string; + + EncryptionKeyState(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EncryptionKeyState && this.string.equals(((EncryptionKeyState) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DESTROYED: + return visitor.visitDestroyed(); + case PRE_ACTIVATION: + return visitor.visitPreActivation(); + case DEACTIVATED: + return visitor.visitDeactivated(); + case ACTIVE: + return visitor.visitActive(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EncryptionKeyState valueOf(String value) { + switch (value) { + case "destroyed": + return DESTROYED; + case "pre-activation": + return PRE_ACTIVATION; + case "deactivated": + return DEACTIVATED; + case "active": + return ACTIVE; + default: + return new EncryptionKeyState(Value.UNKNOWN, value); + } + } + + public enum Value { + PRE_ACTIVATION, + + ACTIVE, + + DEACTIVATED, + + DESTROYED, + + UNKNOWN + } + + public interface Visitor { + T visitPreActivation(); + + T visitActive(); + + T visitDeactivated(); + + T visitDestroyed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java new file mode 100644 index 000000000..6eaa7164b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EncryptionKeyType { + public static final EncryptionKeyType ENVIRONMENT_ROOT_KEY = + new EncryptionKeyType(Value.ENVIRONMENT_ROOT_KEY, "environment-root-key"); + + public static final EncryptionKeyType CUSTOMER_PROVIDED_ROOT_KEY = + new EncryptionKeyType(Value.CUSTOMER_PROVIDED_ROOT_KEY, "customer-provided-root-key"); + + public static final EncryptionKeyType TENANT_MASTER_KEY = + new EncryptionKeyType(Value.TENANT_MASTER_KEY, "tenant-master-key"); + + public static final EncryptionKeyType TENANT_ENCRYPTION_KEY = + new EncryptionKeyType(Value.TENANT_ENCRYPTION_KEY, "tenant-encryption-key"); + + private final Value value; + + private final String string; + + EncryptionKeyType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EncryptionKeyType && this.string.equals(((EncryptionKeyType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENVIRONMENT_ROOT_KEY: + return visitor.visitEnvironmentRootKey(); + case CUSTOMER_PROVIDED_ROOT_KEY: + return visitor.visitCustomerProvidedRootKey(); + case TENANT_MASTER_KEY: + return visitor.visitTenantMasterKey(); + case TENANT_ENCRYPTION_KEY: + return visitor.visitTenantEncryptionKey(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EncryptionKeyType valueOf(String value) { + switch (value) { + case "environment-root-key": + return ENVIRONMENT_ROOT_KEY; + case "customer-provided-root-key": + return CUSTOMER_PROVIDED_ROOT_KEY; + case "tenant-master-key": + return TENANT_MASTER_KEY; + case "tenant-encryption-key": + return TENANT_ENCRYPTION_KEY; + default: + return new EncryptionKeyType(Value.UNKNOWN, value); + } + } + + public enum Value { + CUSTOMER_PROVIDED_ROOT_KEY, + + ENVIRONMENT_ROOT_KEY, + + TENANT_MASTER_KEY, + + TENANT_ENCRYPTION_KEY, + + UNKNOWN + } + + public interface Visitor { + T visitCustomerProvidedRootKey(); + + T visitEnvironmentRootKey(); + + T visitTenantMasterKey(); + + T visitTenantEncryptionKey(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java new file mode 100644 index 000000000..daaeb1ecb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamActionConfiguration.Builder.class) +public final class EventStreamActionConfiguration { + private final String actionId; + + private final Map additionalProperties; + + private EventStreamActionConfiguration(String actionId, Map additionalProperties) { + this.actionId = actionId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Action ID for the action destination. + */ + @JsonProperty("action_id") + public String getActionId() { + return actionId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamActionConfiguration && equalTo((EventStreamActionConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamActionConfiguration other) { + return actionId.equals(other.actionId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionIdStage builder() { + return new Builder(); + } + + public interface ActionIdStage { + /** + *

Action ID for the action destination.

+ */ + _FinalStage actionId(@NotNull String actionId); + + Builder from(EventStreamActionConfiguration other); + } + + public interface _FinalStage { + EventStreamActionConfiguration build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionIdStage, _FinalStage { + private String actionId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamActionConfiguration other) { + actionId(other.getActionId()); + return this; + } + + /** + *

Action ID for the action destination.

+ *

Action ID for the action destination.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_id") + public _FinalStage actionId(@NotNull String actionId) { + this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); + return this; + } + + @java.lang.Override + public EventStreamActionConfiguration build() { + return new EventStreamActionConfiguration(actionId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java new file mode 100644 index 000000000..9e8f5e045 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamActionDestination.Builder.class) +public final class EventStreamActionDestination { + private final String type; + + private final EventStreamActionConfiguration configuration; + + private final Map additionalProperties; + + private EventStreamActionDestination( + String type, EventStreamActionConfiguration configuration, Map additionalProperties) { + this.type = type; + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("configuration") + public EventStreamActionConfiguration getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamActionDestination && equalTo((EventStreamActionDestination) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamActionDestination other) { + return type.equals(other.type) && configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ConfigurationStage type(@NotNull String type); + + Builder from(EventStreamActionDestination other); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull EventStreamActionConfiguration configuration); + } + + public interface _FinalStage { + EventStreamActionDestination build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ConfigurationStage, _FinalStage { + private String type; + + private EventStreamActionConfiguration configuration; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamActionDestination other) { + type(other.getType()); + configuration(other.getConfiguration()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigurationStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("configuration") + public _FinalStage configuration(@NotNull EventStreamActionConfiguration configuration) { + this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); + return this; + } + + @java.lang.Override + public EventStreamActionDestination build() { + return new EventStreamActionDestination(type, configuration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java new file mode 100644 index 000000000..a79e68339 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamActionResponseContent.Builder.class) +public final class EventStreamActionResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> subscriptions; + + private final Optional destination; + + private final Optional status; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private EventStreamActionResponseContent( + Optional id, + Optional name, + Optional> subscriptions, + Optional destination, + Optional status, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Timestamp when the event stream was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return Timestamp when the event stream was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamActionResponseContent && equalTo((EventStreamActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamActionResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional destination = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamActionResponseContent other) { + id(other.getId()); + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

Unique identifier for the event stream.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of the event stream.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public Builder subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public Builder subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(EventStreamActionDestination destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Timestamp when the event stream was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Timestamp when the event stream was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public EventStreamActionResponseContent build() { + return new EventStreamActionResponseContent( + id, name, subscriptions, destination, status, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java new file mode 100644 index 000000000..74c7e1bd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamBucketInterval.Builder.class) +public final class EventStreamBucketInterval { + private final int scaleFactor; + + private final Map additionalProperties; + + private EventStreamBucketInterval(int scaleFactor, Map additionalProperties) { + this.scaleFactor = scaleFactor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Time interval in seconds for each bucket. + */ + @JsonProperty("scale_factor") + public int getScaleFactor() { + return scaleFactor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamBucketInterval && equalTo((EventStreamBucketInterval) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamBucketInterval other) { + return scaleFactor == other.scaleFactor; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.scaleFactor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ScaleFactorStage builder() { + return new Builder(); + } + + public interface ScaleFactorStage { + /** + *

Time interval in seconds for each bucket.

+ */ + _FinalStage scaleFactor(int scaleFactor); + + Builder from(EventStreamBucketInterval other); + } + + public interface _FinalStage { + EventStreamBucketInterval build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ScaleFactorStage, _FinalStage { + private int scaleFactor; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamBucketInterval other) { + scaleFactor(other.getScaleFactor()); + return this; + } + + /** + *

Time interval in seconds for each bucket.

+ *

Time interval in seconds for each bucket.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("scale_factor") + public _FinalStage scaleFactor(int scaleFactor) { + this.scaleFactor = scaleFactor; + return this; + } + + @java.lang.Override + public EventStreamBucketInterval build() { + return new EventStreamBucketInterval(scaleFactor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java new file mode 100644 index 000000000..1bc25e7b7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamCloudEvent.Builder.class) +public final class EventStreamCloudEvent { + private final Optional id; + + private final Optional source; + + private final Optional specversion; + + private final Optional type; + + private final Optional time; + + private final Optional data; + + private final Map additionalProperties; + + private EventStreamCloudEvent( + Optional id, + Optional source, + Optional specversion, + Optional type, + Optional time, + Optional data, + Map additionalProperties) { + this.id = id; + this.source = source; + this.specversion = specversion; + this.type = type; + this.time = time; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the event + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Where the event originated + */ + @JsonProperty("source") + public Optional getSource() { + return source; + } + + /** + * @return Version of CloudEvents spec + */ + @JsonProperty("specversion") + public Optional getSpecversion() { + return specversion; + } + + /** + * @return Type of the event (e.g., user.created) + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Timestamp at which the event was generated + */ + @JsonProperty("time") + public Optional getTime() { + return time; + } + + /** + * @return Event contents encoded as a string. + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamCloudEvent && equalTo((EventStreamCloudEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamCloudEvent other) { + return id.equals(other.id) + && source.equals(other.source) + && specversion.equals(other.specversion) + && type.equals(other.type) + && time.equals(other.time) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.source, this.specversion, this.type, this.time, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional source = Optional.empty(); + + private Optional specversion = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional time = Optional.empty(); + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamCloudEvent other) { + id(other.getId()); + source(other.getSource()); + specversion(other.getSpecversion()); + type(other.getType()); + time(other.getTime()); + data(other.getData()); + return this; + } + + /** + *

Unique identifier for the event

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Where the event originated

+ */ + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public Builder source(Optional source) { + this.source = source; + return this; + } + + public Builder source(String source) { + this.source = Optional.ofNullable(source); + return this; + } + + /** + *

Version of CloudEvents spec

+ */ + @JsonSetter(value = "specversion", nulls = Nulls.SKIP) + public Builder specversion(Optional specversion) { + this.specversion = specversion; + return this; + } + + public Builder specversion(String specversion) { + this.specversion = Optional.ofNullable(specversion); + return this; + } + + /** + *

Type of the event (e.g., user.created)

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

Timestamp at which the event was generated

+ */ + @JsonSetter(value = "time", nulls = Nulls.SKIP) + public Builder time(Optional time) { + this.time = time; + return this; + } + + public Builder time(OffsetDateTime time) { + this.time = Optional.ofNullable(time); + return this; + } + + /** + *

Event contents encoded as a string.

+ */ + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public Builder data(Optional data) { + this.data = data; + return this; + } + + public Builder data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + public EventStreamCloudEvent build() { + return new EventStreamCloudEvent(id, source, specversion, type, time, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java new file mode 100644 index 000000000..a776201db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamDelivery.Builder.class) +public final class EventStreamDelivery { + private final String id; + + private final String eventStreamId; + + private final String status; + + private final EventStreamDeliveryEventTypeEnum eventType; + + private final List attempts; + + private final Optional event; + + private final Map additionalProperties; + + private EventStreamDelivery( + String id, + String eventStreamId, + String status, + EventStreamDeliveryEventTypeEnum eventType, + List attempts, + Optional event, + Map additionalProperties) { + this.id = id; + this.eventStreamId = eventStreamId; + this.status = status; + this.eventType = eventType; + this.attempts = attempts; + this.event = event; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the delivery + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("event_stream_id") + public String getEventStreamId() { + return eventStreamId; + } + + @JsonProperty("status") + public String getStatus() { + return status; + } + + @JsonProperty("event_type") + public EventStreamDeliveryEventTypeEnum getEventType() { + return eventType; + } + + /** + * @return Results of delivery attempts + */ + @JsonProperty("attempts") + public List getAttempts() { + return attempts; + } + + @JsonProperty("event") + public Optional getEvent() { + return event; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamDelivery && equalTo((EventStreamDelivery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamDelivery other) { + return id.equals(other.id) + && eventStreamId.equals(other.eventStreamId) + && status.equals(other.status) + && eventType.equals(other.eventType) + && attempts.equals(other.attempts) + && event.equals(other.event); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Unique identifier for the delivery

+ */ + EventStreamIdStage id(@NotNull String id); + + Builder from(EventStreamDelivery other); + } + + public interface EventStreamIdStage { + /** + *

Unique identifier for the event stream.

+ */ + StatusStage eventStreamId(@NotNull String eventStreamId); + } + + public interface StatusStage { + EventTypeStage status(@NotNull String status); + } + + public interface EventTypeStage { + _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType); + } + + public interface _FinalStage { + EventStreamDelivery build(); + + /** + *

Results of delivery attempts

+ */ + _FinalStage attempts(List attempts); + + _FinalStage addAttempts(EventStreamDeliveryAttempt attempts); + + _FinalStage addAllAttempts(List attempts); + + _FinalStage event(Optional event); + + _FinalStage event(EventStreamCloudEvent event); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, EventStreamIdStage, StatusStage, EventTypeStage, _FinalStage { + private String id; + + private String eventStreamId; + + private String status; + + private EventStreamDeliveryEventTypeEnum eventType; + + private Optional event = Optional.empty(); + + private List attempts = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamDelivery other) { + id(other.getId()); + eventStreamId(other.getEventStreamId()); + status(other.getStatus()); + eventType(other.getEventType()); + attempts(other.getAttempts()); + event(other.getEvent()); + return this; + } + + /** + *

Unique identifier for the delivery

+ *

Unique identifier for the delivery

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public EventStreamIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Unique identifier for the event stream.

+ *

Unique identifier for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_stream_id") + public StatusStage eventStreamId(@NotNull String eventStreamId) { + this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EventTypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage event(EventStreamCloudEvent event) { + this.event = Optional.ofNullable(event); + return this; + } + + @java.lang.Override + @JsonSetter(value = "event", nulls = Nulls.SKIP) + public _FinalStage event(Optional event) { + this.event = event; + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllAttempts(List attempts) { + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { + this.attempts.add(attempts); + return this; + } + + /** + *

Results of delivery attempts

+ */ + @java.lang.Override + @JsonSetter(value = "attempts", nulls = Nulls.SKIP) + public _FinalStage attempts(List attempts) { + this.attempts.clear(); + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + @java.lang.Override + public EventStreamDelivery build() { + return new EventStreamDelivery(id, eventStreamId, status, eventType, attempts, event, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java new file mode 100644 index 000000000..9b421de2c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamDeliveryAttempt.Builder.class) +public final class EventStreamDeliveryAttempt { + private final String status; + + private final OffsetDateTime timestamp; + + private final Optional errorMessage; + + private final Map additionalProperties; + + private EventStreamDeliveryAttempt( + String status, + OffsetDateTime timestamp, + Optional errorMessage, + Map additionalProperties) { + this.status = status; + this.timestamp = timestamp; + this.errorMessage = errorMessage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Timestamp of delivery attempt + */ + @JsonProperty("timestamp") + public OffsetDateTime getTimestamp() { + return timestamp; + } + + /** + * @return Delivery error message, if applicable + */ + @JsonProperty("error_message") + public Optional getErrorMessage() { + return errorMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamDeliveryAttempt && equalTo((EventStreamDeliveryAttempt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamDeliveryAttempt other) { + return status.equals(other.status) + && timestamp.equals(other.timestamp) + && errorMessage.equals(other.errorMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.timestamp, this.errorMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + TimestampStage status(@NotNull String status); + + Builder from(EventStreamDeliveryAttempt other); + } + + public interface TimestampStage { + /** + *

Timestamp of delivery attempt

+ */ + _FinalStage timestamp(@NotNull OffsetDateTime timestamp); + } + + public interface _FinalStage { + EventStreamDeliveryAttempt build(); + + /** + *

Delivery error message, if applicable

+ */ + _FinalStage errorMessage(Optional errorMessage); + + _FinalStage errorMessage(String errorMessage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, TimestampStage, _FinalStage { + private String status; + + private OffsetDateTime timestamp; + + private Optional errorMessage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamDeliveryAttempt other) { + status(other.getStatus()); + timestamp(other.getTimestamp()); + errorMessage(other.getErrorMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public TimestampStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Timestamp of delivery attempt

+ *

Timestamp of delivery attempt

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("timestamp") + public _FinalStage timestamp(@NotNull OffsetDateTime timestamp) { + this.timestamp = Objects.requireNonNull(timestamp, "timestamp must not be null"); + return this; + } + + /** + *

Delivery error message, if applicable

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage errorMessage(String errorMessage) { + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + *

Delivery error message, if applicable

+ */ + @java.lang.Override + @JsonSetter(value = "error_message", nulls = Nulls.SKIP) + public _FinalStage errorMessage(Optional errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + @java.lang.Override + public EventStreamDeliveryAttempt build() { + return new EventStreamDeliveryAttempt(status, timestamp, errorMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java new file mode 100644 index 000000000..bdbd999c3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventStreamDeliveryEventTypeEnum { + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_CONNECTION_ADDED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); + + public static final EventStreamDeliveryEventTypeEnum USER_DELETED = + new EventStreamDeliveryEventTypeEnum(Value.USER_DELETED, "user.deleted"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_CONNECTION_UPDATED = + new EventStreamDeliveryEventTypeEnum( + Value.ORGANIZATION_CONNECTION_UPDATED, "organization.connection.updated"); + + public static final EventStreamDeliveryEventTypeEnum USER_UPDATED = + new EventStreamDeliveryEventTypeEnum(Value.USER_UPDATED, "user.updated"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_CREATED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_CREATED, "organization.created"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_MEMBER_DELETED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_MEMBER_DELETED, "organization.member.deleted"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_UPDATED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + + public static final EventStreamDeliveryEventTypeEnum USER_CREATED = + new EventStreamDeliveryEventTypeEnum(Value.USER_CREATED, "user.created"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_CONNECTION_REMOVED = + new EventStreamDeliveryEventTypeEnum( + Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = + new EventStreamDeliveryEventTypeEnum( + Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_DELETED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_DELETED, "organization.deleted"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_MEMBER_ADDED = + new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_MEMBER_ADDED, "organization.member.added"); + + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_MEMBER_ROLE_DELETED = + new EventStreamDeliveryEventTypeEnum( + Value.ORGANIZATION_MEMBER_ROLE_DELETED, "organization.member.role.deleted"); + + private final Value value; + + private final String string; + + EventStreamDeliveryEventTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventStreamDeliveryEventTypeEnum + && this.string.equals(((EventStreamDeliveryEventTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ORGANIZATION_CONNECTION_ADDED: + return visitor.visitOrganizationConnectionAdded(); + case USER_DELETED: + return visitor.visitUserDeleted(); + case ORGANIZATION_CONNECTION_UPDATED: + return visitor.visitOrganizationConnectionUpdated(); + case USER_UPDATED: + return visitor.visitUserUpdated(); + case ORGANIZATION_CREATED: + return visitor.visitOrganizationCreated(); + case ORGANIZATION_MEMBER_DELETED: + return visitor.visitOrganizationMemberDeleted(); + case ORGANIZATION_UPDATED: + return visitor.visitOrganizationUpdated(); + case USER_CREATED: + return visitor.visitUserCreated(); + case ORGANIZATION_CONNECTION_REMOVED: + return visitor.visitOrganizationConnectionRemoved(); + case ORGANIZATION_MEMBER_ROLE_ASSIGNED: + return visitor.visitOrganizationMemberRoleAssigned(); + case ORGANIZATION_DELETED: + return visitor.visitOrganizationDeleted(); + case ORGANIZATION_MEMBER_ADDED: + return visitor.visitOrganizationMemberAdded(); + case ORGANIZATION_MEMBER_ROLE_DELETED: + return visitor.visitOrganizationMemberRoleDeleted(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventStreamDeliveryEventTypeEnum valueOf(String value) { + switch (value) { + case "organization.connection.added": + return ORGANIZATION_CONNECTION_ADDED; + case "user.deleted": + return USER_DELETED; + case "organization.connection.updated": + return ORGANIZATION_CONNECTION_UPDATED; + case "user.updated": + return USER_UPDATED; + case "organization.created": + return ORGANIZATION_CREATED; + case "organization.member.deleted": + return ORGANIZATION_MEMBER_DELETED; + case "organization.updated": + return ORGANIZATION_UPDATED; + case "user.created": + return USER_CREATED; + case "organization.connection.removed": + return ORGANIZATION_CONNECTION_REMOVED; + case "organization.member.role.assigned": + return ORGANIZATION_MEMBER_ROLE_ASSIGNED; + case "organization.deleted": + return ORGANIZATION_DELETED; + case "organization.member.added": + return ORGANIZATION_MEMBER_ADDED; + case "organization.member.role.deleted": + return ORGANIZATION_MEMBER_ROLE_DELETED; + default: + return new EventStreamDeliveryEventTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + USER_CREATED, + + USER_DELETED, + + USER_UPDATED, + + ORGANIZATION_CREATED, + + ORGANIZATION_UPDATED, + + ORGANIZATION_DELETED, + + ORGANIZATION_MEMBER_ADDED, + + ORGANIZATION_MEMBER_DELETED, + + ORGANIZATION_MEMBER_ROLE_ASSIGNED, + + ORGANIZATION_MEMBER_ROLE_DELETED, + + ORGANIZATION_CONNECTION_ADDED, + + ORGANIZATION_CONNECTION_UPDATED, + + ORGANIZATION_CONNECTION_REMOVED, + + UNKNOWN + } + + public interface Visitor { + T visitUserCreated(); + + T visitUserDeleted(); + + T visitUserUpdated(); + + T visitOrganizationCreated(); + + T visitOrganizationUpdated(); + + T visitOrganizationDeleted(); + + T visitOrganizationMemberAdded(); + + T visitOrganizationMemberDeleted(); + + T visitOrganizationMemberRoleAssigned(); + + T visitOrganizationMemberRoleDeleted(); + + T visitOrganizationConnectionAdded(); + + T visitOrganizationConnectionUpdated(); + + T visitOrganizationConnectionRemoved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java new file mode 100644 index 000000000..f764532ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EventStreamDestinationPatch.Deserializer.class) +public final class EventStreamDestinationPatch { + private final Object value; + + private final int type; + + private EventStreamDestinationPatch(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookDestination) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamActionDestination) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamDestinationPatch && equalTo((EventStreamDestinationPatch) other); + } + + private boolean equalTo(EventStreamDestinationPatch other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EventStreamDestinationPatch of(EventStreamWebhookDestination value) { + return new EventStreamDestinationPatch(value, 0); + } + + public static EventStreamDestinationPatch of(EventStreamActionDestination value) { + return new EventStreamDestinationPatch(value, 1); + } + + public interface Visitor { + T visit(EventStreamWebhookDestination value); + + T visit(EventStreamActionDestination value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EventStreamDestinationPatch.class); + } + + @java.lang.Override + public EventStreamDestinationPatch deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookDestination.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamActionDestination.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeAwsRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeAwsRegionEnum.java new file mode 100644 index 000000000..dcf96609f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeAwsRegionEnum.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventStreamEventBridgeAwsRegionEnum { + public static final EventStreamEventBridgeAwsRegionEnum AP_NORTHEAST2 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_NORTHEAST2, "ap-northeast-2"); + + public static final EventStreamEventBridgeAwsRegionEnum CN_NORTHWEST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.CN_NORTHWEST1, "cn-northwest-1"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_SOUTHEAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_SOUTHEAST1, "ap-southeast-1"); + + public static final EventStreamEventBridgeAwsRegionEnum ME_SOUTH1 = + new EventStreamEventBridgeAwsRegionEnum(Value.ME_SOUTH1, "me-south-1"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_NORTHEAST3 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_NORTHEAST3, "ap-northeast-3"); + + public static final EventStreamEventBridgeAwsRegionEnum US_EAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_EAST1, "us-east-1"); + + public static final EventStreamEventBridgeAwsRegionEnum SA_EAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.SA_EAST1, "sa-east-1"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_NORTHEAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_NORTHEAST1, "ap-northeast-1"); + + public static final EventStreamEventBridgeAwsRegionEnum US_GOV_EAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_GOV_EAST1, "us-gov-east-1"); + + public static final EventStreamEventBridgeAwsRegionEnum US_EAST2 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_EAST2, "us-east-2"); + + public static final EventStreamEventBridgeAwsRegionEnum CN_NORTH1 = + new EventStreamEventBridgeAwsRegionEnum(Value.CN_NORTH1, "cn-north-1"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_SOUTH1 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_SOUTH1, "ap-south-1"); + + public static final EventStreamEventBridgeAwsRegionEnum CA_CENTRAL1 = + new EventStreamEventBridgeAwsRegionEnum(Value.CA_CENTRAL1, "ca-central-1"); + + public static final EventStreamEventBridgeAwsRegionEnum EU_NORTH1 = + new EventStreamEventBridgeAwsRegionEnum(Value.EU_NORTH1, "eu-north-1"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_EAST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_EAST1, "ap-east-1"); + + public static final EventStreamEventBridgeAwsRegionEnum US_GOV_WEST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_GOV_WEST1, "us-gov-west-1"); + + public static final EventStreamEventBridgeAwsRegionEnum US_WEST2 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_WEST2, "us-west-2"); + + public static final EventStreamEventBridgeAwsRegionEnum EU_WEST3 = + new EventStreamEventBridgeAwsRegionEnum(Value.EU_WEST3, "eu-west-3"); + + public static final EventStreamEventBridgeAwsRegionEnum EU_WEST2 = + new EventStreamEventBridgeAwsRegionEnum(Value.EU_WEST2, "eu-west-2"); + + public static final EventStreamEventBridgeAwsRegionEnum AP_SOUTHEAST2 = + new EventStreamEventBridgeAwsRegionEnum(Value.AP_SOUTHEAST2, "ap-southeast-2"); + + public static final EventStreamEventBridgeAwsRegionEnum EU_CENTRAL1 = + new EventStreamEventBridgeAwsRegionEnum(Value.EU_CENTRAL1, "eu-central-1"); + + public static final EventStreamEventBridgeAwsRegionEnum US_WEST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.US_WEST1, "us-west-1"); + + public static final EventStreamEventBridgeAwsRegionEnum EU_WEST1 = + new EventStreamEventBridgeAwsRegionEnum(Value.EU_WEST1, "eu-west-1"); + + private final Value value; + + private final String string; + + EventStreamEventBridgeAwsRegionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventStreamEventBridgeAwsRegionEnum + && this.string.equals(((EventStreamEventBridgeAwsRegionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AP_NORTHEAST2: + return visitor.visitApNortheast2(); + case CN_NORTHWEST1: + return visitor.visitCnNorthwest1(); + case AP_SOUTHEAST1: + return visitor.visitApSoutheast1(); + case ME_SOUTH1: + return visitor.visitMeSouth1(); + case AP_NORTHEAST3: + return visitor.visitApNortheast3(); + case US_EAST1: + return visitor.visitUsEast1(); + case SA_EAST1: + return visitor.visitSaEast1(); + case AP_NORTHEAST1: + return visitor.visitApNortheast1(); + case US_GOV_EAST1: + return visitor.visitUsGovEast1(); + case US_EAST2: + return visitor.visitUsEast2(); + case CN_NORTH1: + return visitor.visitCnNorth1(); + case AP_SOUTH1: + return visitor.visitApSouth1(); + case CA_CENTRAL1: + return visitor.visitCaCentral1(); + case EU_NORTH1: + return visitor.visitEuNorth1(); + case AP_EAST1: + return visitor.visitApEast1(); + case US_GOV_WEST1: + return visitor.visitUsGovWest1(); + case US_WEST2: + return visitor.visitUsWest2(); + case EU_WEST3: + return visitor.visitEuWest3(); + case EU_WEST2: + return visitor.visitEuWest2(); + case AP_SOUTHEAST2: + return visitor.visitApSoutheast2(); + case EU_CENTRAL1: + return visitor.visitEuCentral1(); + case US_WEST1: + return visitor.visitUsWest1(); + case EU_WEST1: + return visitor.visitEuWest1(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventStreamEventBridgeAwsRegionEnum valueOf(String value) { + switch (value) { + case "ap-northeast-2": + return AP_NORTHEAST2; + case "cn-northwest-1": + return CN_NORTHWEST1; + case "ap-southeast-1": + return AP_SOUTHEAST1; + case "me-south-1": + return ME_SOUTH1; + case "ap-northeast-3": + return AP_NORTHEAST3; + case "us-east-1": + return US_EAST1; + case "sa-east-1": + return SA_EAST1; + case "ap-northeast-1": + return AP_NORTHEAST1; + case "us-gov-east-1": + return US_GOV_EAST1; + case "us-east-2": + return US_EAST2; + case "cn-north-1": + return CN_NORTH1; + case "ap-south-1": + return AP_SOUTH1; + case "ca-central-1": + return CA_CENTRAL1; + case "eu-north-1": + return EU_NORTH1; + case "ap-east-1": + return AP_EAST1; + case "us-gov-west-1": + return US_GOV_WEST1; + case "us-west-2": + return US_WEST2; + case "eu-west-3": + return EU_WEST3; + case "eu-west-2": + return EU_WEST2; + case "ap-southeast-2": + return AP_SOUTHEAST2; + case "eu-central-1": + return EU_CENTRAL1; + case "us-west-1": + return US_WEST1; + case "eu-west-1": + return EU_WEST1; + default: + return new EventStreamEventBridgeAwsRegionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AP_EAST1, + + AP_NORTHEAST1, + + AP_NORTHEAST2, + + AP_NORTHEAST3, + + AP_SOUTH1, + + AP_SOUTHEAST1, + + AP_SOUTHEAST2, + + CA_CENTRAL1, + + CN_NORTH1, + + CN_NORTHWEST1, + + EU_CENTRAL1, + + EU_NORTH1, + + EU_WEST1, + + EU_WEST2, + + EU_WEST3, + + ME_SOUTH1, + + SA_EAST1, + + US_GOV_EAST1, + + US_GOV_WEST1, + + US_EAST1, + + US_EAST2, + + US_WEST1, + + US_WEST2, + + UNKNOWN + } + + public interface Visitor { + T visitApEast1(); + + T visitApNortheast1(); + + T visitApNortheast2(); + + T visitApNortheast3(); + + T visitApSouth1(); + + T visitApSoutheast1(); + + T visitApSoutheast2(); + + T visitCaCentral1(); + + T visitCnNorth1(); + + T visitCnNorthwest1(); + + T visitEuCentral1(); + + T visitEuNorth1(); + + T visitEuWest1(); + + T visitEuWest2(); + + T visitEuWest3(); + + T visitMeSouth1(); + + T visitSaEast1(); + + T visitUsGovEast1(); + + T visitUsGovWest1(); + + T visitUsEast1(); + + T visitUsEast2(); + + T visitUsWest1(); + + T visitUsWest2(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java new file mode 100644 index 000000000..5605c44ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java @@ -0,0 +1,186 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamEventBridgeConfiguration.Builder.class) +public final class EventStreamEventBridgeConfiguration { + private final String awsAccountId; + + private final EventStreamEventBridgeAwsRegionEnum awsRegion; + + private final Optional awsPartnerEventSource; + + private final Map additionalProperties; + + private EventStreamEventBridgeConfiguration( + String awsAccountId, + EventStreamEventBridgeAwsRegionEnum awsRegion, + Optional awsPartnerEventSource, + Map additionalProperties) { + this.awsAccountId = awsAccountId; + this.awsRegion = awsRegion; + this.awsPartnerEventSource = awsPartnerEventSource; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS Account ID for EventBridge destination. + */ + @JsonProperty("aws_account_id") + public String getAwsAccountId() { + return awsAccountId; + } + + @JsonProperty("aws_region") + public EventStreamEventBridgeAwsRegionEnum getAwsRegion() { + return awsRegion; + } + + /** + * @return AWS Partner Event Source for EventBridge destination. + */ + @JsonProperty("aws_partner_event_source") + public Optional getAwsPartnerEventSource() { + return awsPartnerEventSource; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamEventBridgeConfiguration + && equalTo((EventStreamEventBridgeConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamEventBridgeConfiguration other) { + return awsAccountId.equals(other.awsAccountId) + && awsRegion.equals(other.awsRegion) + && awsPartnerEventSource.equals(other.awsPartnerEventSource); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AwsAccountIdStage builder() { + return new Builder(); + } + + public interface AwsAccountIdStage { + /** + *

AWS Account ID for EventBridge destination.

+ */ + AwsRegionStage awsAccountId(@NotNull String awsAccountId); + + Builder from(EventStreamEventBridgeConfiguration other); + } + + public interface AwsRegionStage { + _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsRegion); + } + + public interface _FinalStage { + EventStreamEventBridgeConfiguration build(); + + /** + *

AWS Partner Event Source for EventBridge destination.

+ */ + _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource); + + _FinalStage awsPartnerEventSource(String awsPartnerEventSource); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AwsAccountIdStage, AwsRegionStage, _FinalStage { + private String awsAccountId; + + private EventStreamEventBridgeAwsRegionEnum awsRegion; + + private Optional awsPartnerEventSource = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamEventBridgeConfiguration other) { + awsAccountId(other.getAwsAccountId()); + awsRegion(other.getAwsRegion()); + awsPartnerEventSource(other.getAwsPartnerEventSource()); + return this; + } + + /** + *

AWS Account ID for EventBridge destination.

+ *

AWS Account ID for EventBridge destination.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("aws_account_id") + public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { + this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("aws_region") + public _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsRegion) { + this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); + return this; + } + + /** + *

AWS Partner Event Source for EventBridge destination.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { + this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); + return this; + } + + /** + *

AWS Partner Event Source for EventBridge destination.

+ */ + @java.lang.Override + @JsonSetter(value = "aws_partner_event_source", nulls = Nulls.SKIP) + public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { + this.awsPartnerEventSource = awsPartnerEventSource; + return this; + } + + @java.lang.Override + public EventStreamEventBridgeConfiguration build() { + return new EventStreamEventBridgeConfiguration( + awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java new file mode 100644 index 000000000..bba2fc35c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamEventBridgeDestination.Builder.class) +public final class EventStreamEventBridgeDestination { + private final String type; + + private final EventStreamEventBridgeConfiguration configuration; + + private final Map additionalProperties; + + private EventStreamEventBridgeDestination( + String type, EventStreamEventBridgeConfiguration configuration, Map additionalProperties) { + this.type = type; + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("configuration") + public EventStreamEventBridgeConfiguration getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamEventBridgeDestination && equalTo((EventStreamEventBridgeDestination) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamEventBridgeDestination other) { + return type.equals(other.type) && configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ConfigurationStage type(@NotNull String type); + + Builder from(EventStreamEventBridgeDestination other); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull EventStreamEventBridgeConfiguration configuration); + } + + public interface _FinalStage { + EventStreamEventBridgeDestination build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ConfigurationStage, _FinalStage { + private String type; + + private EventStreamEventBridgeConfiguration configuration; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamEventBridgeDestination other) { + type(other.getType()); + configuration(other.getConfiguration()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigurationStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("configuration") + public _FinalStage configuration(@NotNull EventStreamEventBridgeConfiguration configuration) { + this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); + return this; + } + + @java.lang.Override + public EventStreamEventBridgeDestination build() { + return new EventStreamEventBridgeDestination(type, configuration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java new file mode 100644 index 000000000..9735a2d13 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java @@ -0,0 +1,276 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamEventBridgeResponseContent.Builder.class) +public final class EventStreamEventBridgeResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> subscriptions; + + private final Optional destination; + + private final Optional status; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private EventStreamEventBridgeResponseContent( + Optional id, + Optional name, + Optional> subscriptions, + Optional destination, + Optional status, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Timestamp when the event stream was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return Timestamp when the event stream was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamEventBridgeResponseContent + && equalTo((EventStreamEventBridgeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamEventBridgeResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional destination = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamEventBridgeResponseContent other) { + id(other.getId()); + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

Unique identifier for the event stream.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of the event stream.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public Builder subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public Builder subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(EventStreamEventBridgeDestination destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Timestamp when the event stream was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Timestamp when the event stream was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public EventStreamEventBridgeResponseContent build() { + return new EventStreamEventBridgeResponseContent( + id, name, subscriptions, destination, status, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java new file mode 100644 index 000000000..065cc8f06 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java @@ -0,0 +1,207 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventStreamEventTypeEnum { + public static final EventStreamEventTypeEnum ORGANIZATION_CONNECTION_ADDED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); + + public static final EventStreamEventTypeEnum USER_DELETED = + new EventStreamEventTypeEnum(Value.USER_DELETED, "user.deleted"); + + public static final EventStreamEventTypeEnum ORGANIZATION_CONNECTION_UPDATED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_CONNECTION_UPDATED, "organization.connection.updated"); + + public static final EventStreamEventTypeEnum USER_UPDATED = + new EventStreamEventTypeEnum(Value.USER_UPDATED, "user.updated"); + + public static final EventStreamEventTypeEnum ORGANIZATION_CREATED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_CREATED, "organization.created"); + + public static final EventStreamEventTypeEnum ORGANIZATION_MEMBER_DELETED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_MEMBER_DELETED, "organization.member.deleted"); + + public static final EventStreamEventTypeEnum ORGANIZATION_UPDATED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + + public static final EventStreamEventTypeEnum USER_CREATED = + new EventStreamEventTypeEnum(Value.USER_CREATED, "user.created"); + + public static final EventStreamEventTypeEnum ORGANIZATION_CONNECTION_REMOVED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + + public static final EventStreamEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); + + public static final EventStreamEventTypeEnum ORGANIZATION_DELETED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_DELETED, "organization.deleted"); + + public static final EventStreamEventTypeEnum ORGANIZATION_MEMBER_ADDED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_MEMBER_ADDED, "organization.member.added"); + + public static final EventStreamEventTypeEnum ORGANIZATION_MEMBER_ROLE_DELETED = + new EventStreamEventTypeEnum(Value.ORGANIZATION_MEMBER_ROLE_DELETED, "organization.member.role.deleted"); + + private final Value value; + + private final String string; + + EventStreamEventTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventStreamEventTypeEnum + && this.string.equals(((EventStreamEventTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ORGANIZATION_CONNECTION_ADDED: + return visitor.visitOrganizationConnectionAdded(); + case USER_DELETED: + return visitor.visitUserDeleted(); + case ORGANIZATION_CONNECTION_UPDATED: + return visitor.visitOrganizationConnectionUpdated(); + case USER_UPDATED: + return visitor.visitUserUpdated(); + case ORGANIZATION_CREATED: + return visitor.visitOrganizationCreated(); + case ORGANIZATION_MEMBER_DELETED: + return visitor.visitOrganizationMemberDeleted(); + case ORGANIZATION_UPDATED: + return visitor.visitOrganizationUpdated(); + case USER_CREATED: + return visitor.visitUserCreated(); + case ORGANIZATION_CONNECTION_REMOVED: + return visitor.visitOrganizationConnectionRemoved(); + case ORGANIZATION_MEMBER_ROLE_ASSIGNED: + return visitor.visitOrganizationMemberRoleAssigned(); + case ORGANIZATION_DELETED: + return visitor.visitOrganizationDeleted(); + case ORGANIZATION_MEMBER_ADDED: + return visitor.visitOrganizationMemberAdded(); + case ORGANIZATION_MEMBER_ROLE_DELETED: + return visitor.visitOrganizationMemberRoleDeleted(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventStreamEventTypeEnum valueOf(String value) { + switch (value) { + case "organization.connection.added": + return ORGANIZATION_CONNECTION_ADDED; + case "user.deleted": + return USER_DELETED; + case "organization.connection.updated": + return ORGANIZATION_CONNECTION_UPDATED; + case "user.updated": + return USER_UPDATED; + case "organization.created": + return ORGANIZATION_CREATED; + case "organization.member.deleted": + return ORGANIZATION_MEMBER_DELETED; + case "organization.updated": + return ORGANIZATION_UPDATED; + case "user.created": + return USER_CREATED; + case "organization.connection.removed": + return ORGANIZATION_CONNECTION_REMOVED; + case "organization.member.role.assigned": + return ORGANIZATION_MEMBER_ROLE_ASSIGNED; + case "organization.deleted": + return ORGANIZATION_DELETED; + case "organization.member.added": + return ORGANIZATION_MEMBER_ADDED; + case "organization.member.role.deleted": + return ORGANIZATION_MEMBER_ROLE_DELETED; + default: + return new EventStreamEventTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + USER_CREATED, + + USER_DELETED, + + USER_UPDATED, + + ORGANIZATION_CREATED, + + ORGANIZATION_UPDATED, + + ORGANIZATION_DELETED, + + ORGANIZATION_MEMBER_ADDED, + + ORGANIZATION_MEMBER_DELETED, + + ORGANIZATION_MEMBER_ROLE_ASSIGNED, + + ORGANIZATION_MEMBER_ROLE_DELETED, + + ORGANIZATION_CONNECTION_ADDED, + + ORGANIZATION_CONNECTION_UPDATED, + + ORGANIZATION_CONNECTION_REMOVED, + + UNKNOWN + } + + public interface Visitor { + T visitUserCreated(); + + T visitUserDeleted(); + + T visitUserUpdated(); + + T visitOrganizationCreated(); + + T visitOrganizationUpdated(); + + T visitOrganizationDeleted(); + + T visitOrganizationMemberAdded(); + + T visitOrganizationMemberDeleted(); + + T visitOrganizationMemberRoleAssigned(); + + T visitOrganizationMemberRoleDeleted(); + + T visitOrganizationConnectionAdded(); + + T visitOrganizationConnectionUpdated(); + + T visitOrganizationConnectionRemoved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java new file mode 100644 index 000000000..05fefa352 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java @@ -0,0 +1,244 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamMetric.Builder.class) +public final class EventStreamMetric { + private final String name; + + private final double windowTotal; + + private final String type; + + private final List data; + + private final Map additionalProperties; + + private EventStreamMetric( + String name, double windowTotal, String type, List data, Map additionalProperties) { + this.name = name; + this.windowTotal = windowTotal; + this.type = type; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the metric. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Total count for the entire window. + */ + @JsonProperty("window_total") + public double getWindowTotal() { + return windowTotal; + } + + /** + * @return Type of metric. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return Array of metric values for each bucket. + */ + @JsonProperty("data") + public List getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamMetric && equalTo((EventStreamMetric) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamMetric other) { + return name.equals(other.name) + && windowTotal == other.windowTotal + && type.equals(other.type) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.windowTotal, this.type, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Name of the metric.

+ */ + WindowTotalStage name(@NotNull String name); + + Builder from(EventStreamMetric other); + } + + public interface WindowTotalStage { + /** + *

Total count for the entire window.

+ */ + TypeStage windowTotal(double windowTotal); + } + + public interface TypeStage { + /** + *

Type of metric.

+ */ + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + EventStreamMetric build(); + + /** + *

Array of metric values for each bucket.

+ */ + _FinalStage data(List data); + + _FinalStage addData(Double data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, WindowTotalStage, TypeStage, _FinalStage { + private String name; + + private double windowTotal; + + private String type; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamMetric other) { + name(other.getName()); + windowTotal(other.getWindowTotal()); + type(other.getType()); + data(other.getData()); + return this; + } + + /** + *

Name of the metric.

+ *

Name of the metric.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public WindowTotalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Total count for the entire window.

+ *

Total count for the entire window.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("window_total") + public TypeStage windowTotal(double windowTotal) { + this.windowTotal = windowTotal; + return this; + } + + /** + *

Type of metric.

+ *

Type of metric.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Array of metric values for each bucket.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + /** + *

Array of metric values for each bucket.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addData(Double data) { + this.data.add(data); + return this; + } + + /** + *

Array of metric values for each bucket.

+ */ + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public EventStreamMetric build() { + return new EventStreamMetric(name, windowTotal, type, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java new file mode 100644 index 000000000..65879e17e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EventStreamResponseContent.Deserializer.class) +public final class EventStreamResponseContent { + private final Object value; + + private final int type; + + private EventStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookResponseContent) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamEventBridgeResponseContent) this.value); + } else if (this.type == 2) { + return visitor.visit((EventStreamActionResponseContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamResponseContent && equalTo((EventStreamResponseContent) other); + } + + private boolean equalTo(EventStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EventStreamResponseContent of(EventStreamWebhookResponseContent value) { + return new EventStreamResponseContent(value, 0); + } + + public static EventStreamResponseContent of(EventStreamEventBridgeResponseContent value) { + return new EventStreamResponseContent(value, 1); + } + + public static EventStreamResponseContent of(EventStreamActionResponseContent value) { + return new EventStreamResponseContent(value, 2); + } + + public interface Visitor { + T visit(EventStreamWebhookResponseContent value); + + T visit(EventStreamEventBridgeResponseContent value); + + T visit(EventStreamActionResponseContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EventStreamResponseContent.class); + } + + @java.lang.Override + public EventStreamResponseContent deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamEventBridgeResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamActionResponseContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamStatusEnum.java new file mode 100644 index 000000000..e19364e54 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamStatusEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventStreamStatusEnum { + public static final EventStreamStatusEnum ENABLED = new EventStreamStatusEnum(Value.ENABLED, "enabled"); + + public static final EventStreamStatusEnum DISABLED = new EventStreamStatusEnum(Value.DISABLED, "disabled"); + + private final Value value; + + private final String string; + + EventStreamStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventStreamStatusEnum + && this.string.equals(((EventStreamStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENABLED: + return visitor.visitEnabled(); + case DISABLED: + return visitor.visitDisabled(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventStreamStatusEnum valueOf(String value) { + switch (value) { + case "enabled": + return ENABLED; + case "disabled": + return DISABLED; + default: + return new EventStreamStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ENABLED, + + DISABLED, + + UNKNOWN + } + + public interface Visitor { + T visitEnabled(); + + T visitDisabled(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamSubscription.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamSubscription.java new file mode 100644 index 000000000..9e50268e8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamSubscription.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamSubscription.Builder.class) +public final class EventStreamSubscription { + private final Optional eventType; + + private final Map additionalProperties; + + private EventStreamSubscription(Optional eventType, Map additionalProperties) { + this.eventType = eventType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamSubscription && equalTo((EventStreamSubscription) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamSubscription other) { + return eventType.equals(other.eventType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.eventType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional eventType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamSubscription other) { + eventType(other.getEventType()); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + public EventStreamSubscription build() { + return new EventStreamSubscription(eventType, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java new file mode 100644 index 000000000..78fd65ccf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventStreamTestEventTypeEnum { + public static final EventStreamTestEventTypeEnum ORGANIZATION_CONNECTION_ADDED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); + + public static final EventStreamTestEventTypeEnum USER_DELETED = + new EventStreamTestEventTypeEnum(Value.USER_DELETED, "user.deleted"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_CONNECTION_UPDATED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CONNECTION_UPDATED, "organization.connection.updated"); + + public static final EventStreamTestEventTypeEnum USER_UPDATED = + new EventStreamTestEventTypeEnum(Value.USER_UPDATED, "user.updated"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_CREATED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CREATED, "organization.created"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_MEMBER_DELETED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_MEMBER_DELETED, "organization.member.deleted"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_UPDATED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + + public static final EventStreamTestEventTypeEnum USER_CREATED = + new EventStreamTestEventTypeEnum(Value.USER_CREATED, "user.created"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_CONNECTION_REMOVED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = + new EventStreamTestEventTypeEnum( + Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_DELETED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_DELETED, "organization.deleted"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_MEMBER_ADDED = + new EventStreamTestEventTypeEnum(Value.ORGANIZATION_MEMBER_ADDED, "organization.member.added"); + + public static final EventStreamTestEventTypeEnum ORGANIZATION_MEMBER_ROLE_DELETED = + new EventStreamTestEventTypeEnum( + Value.ORGANIZATION_MEMBER_ROLE_DELETED, "organization.member.role.deleted"); + + private final Value value; + + private final String string; + + EventStreamTestEventTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventStreamTestEventTypeEnum + && this.string.equals(((EventStreamTestEventTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ORGANIZATION_CONNECTION_ADDED: + return visitor.visitOrganizationConnectionAdded(); + case USER_DELETED: + return visitor.visitUserDeleted(); + case ORGANIZATION_CONNECTION_UPDATED: + return visitor.visitOrganizationConnectionUpdated(); + case USER_UPDATED: + return visitor.visitUserUpdated(); + case ORGANIZATION_CREATED: + return visitor.visitOrganizationCreated(); + case ORGANIZATION_MEMBER_DELETED: + return visitor.visitOrganizationMemberDeleted(); + case ORGANIZATION_UPDATED: + return visitor.visitOrganizationUpdated(); + case USER_CREATED: + return visitor.visitUserCreated(); + case ORGANIZATION_CONNECTION_REMOVED: + return visitor.visitOrganizationConnectionRemoved(); + case ORGANIZATION_MEMBER_ROLE_ASSIGNED: + return visitor.visitOrganizationMemberRoleAssigned(); + case ORGANIZATION_DELETED: + return visitor.visitOrganizationDeleted(); + case ORGANIZATION_MEMBER_ADDED: + return visitor.visitOrganizationMemberAdded(); + case ORGANIZATION_MEMBER_ROLE_DELETED: + return visitor.visitOrganizationMemberRoleDeleted(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventStreamTestEventTypeEnum valueOf(String value) { + switch (value) { + case "organization.connection.added": + return ORGANIZATION_CONNECTION_ADDED; + case "user.deleted": + return USER_DELETED; + case "organization.connection.updated": + return ORGANIZATION_CONNECTION_UPDATED; + case "user.updated": + return USER_UPDATED; + case "organization.created": + return ORGANIZATION_CREATED; + case "organization.member.deleted": + return ORGANIZATION_MEMBER_DELETED; + case "organization.updated": + return ORGANIZATION_UPDATED; + case "user.created": + return USER_CREATED; + case "organization.connection.removed": + return ORGANIZATION_CONNECTION_REMOVED; + case "organization.member.role.assigned": + return ORGANIZATION_MEMBER_ROLE_ASSIGNED; + case "organization.deleted": + return ORGANIZATION_DELETED; + case "organization.member.added": + return ORGANIZATION_MEMBER_ADDED; + case "organization.member.role.deleted": + return ORGANIZATION_MEMBER_ROLE_DELETED; + default: + return new EventStreamTestEventTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + USER_CREATED, + + USER_DELETED, + + USER_UPDATED, + + ORGANIZATION_CREATED, + + ORGANIZATION_UPDATED, + + ORGANIZATION_DELETED, + + ORGANIZATION_MEMBER_ADDED, + + ORGANIZATION_MEMBER_DELETED, + + ORGANIZATION_MEMBER_ROLE_ASSIGNED, + + ORGANIZATION_MEMBER_ROLE_DELETED, + + ORGANIZATION_CONNECTION_ADDED, + + ORGANIZATION_CONNECTION_UPDATED, + + ORGANIZATION_CONNECTION_REMOVED, + + UNKNOWN + } + + public interface Visitor { + T visitUserCreated(); + + T visitUserDeleted(); + + T visitUserUpdated(); + + T visitOrganizationCreated(); + + T visitOrganizationUpdated(); + + T visitOrganizationDeleted(); + + T visitOrganizationMemberAdded(); + + T visitOrganizationMemberDeleted(); + + T visitOrganizationMemberRoleAssigned(); + + T visitOrganizationMemberRoleDeleted(); + + T visitOrganizationConnectionAdded(); + + T visitOrganizationConnectionUpdated(); + + T visitOrganizationConnectionRemoved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java new file mode 100644 index 000000000..67ba0e358 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EventStreamWebhookAuthorizationResponse.Deserializer.class) +public final class EventStreamWebhookAuthorizationResponse { + private final Object value; + + private final int type; + + private EventStreamWebhookAuthorizationResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookBasicAuth) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamWebhookBearerAuth) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookAuthorizationResponse + && equalTo((EventStreamWebhookAuthorizationResponse) other); + } + + private boolean equalTo(EventStreamWebhookAuthorizationResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EventStreamWebhookAuthorizationResponse of(EventStreamWebhookBasicAuth value) { + return new EventStreamWebhookAuthorizationResponse(value, 0); + } + + public static EventStreamWebhookAuthorizationResponse of(EventStreamWebhookBearerAuth value) { + return new EventStreamWebhookAuthorizationResponse(value, 1); + } + + public interface Visitor { + T visit(EventStreamWebhookBasicAuth value); + + T visit(EventStreamWebhookBearerAuth value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EventStreamWebhookAuthorizationResponse.class); + } + + @java.lang.Override + public EventStreamWebhookAuthorizationResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookBasicAuth.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookBearerAuth.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBasicAuth.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBasicAuth.java new file mode 100644 index 000000000..9790edea7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBasicAuth.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWebhookBasicAuth.Builder.class) +public final class EventStreamWebhookBasicAuth { + private final String method; + + private final String username; + + private final Map additionalProperties; + + private EventStreamWebhookBasicAuth(String method, String username, Map additionalProperties) { + this.method = method; + this.username = username; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + /** + * @return Username + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookBasicAuth && equalTo((EventStreamWebhookBasicAuth) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWebhookBasicAuth other) { + return method.equals(other.method) && username.equals(other.username); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.username); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UsernameStage method(@NotNull String method); + + Builder from(EventStreamWebhookBasicAuth other); + } + + public interface UsernameStage { + /** + *

Username

+ */ + _FinalStage username(@NotNull String username); + } + + public interface _FinalStage { + EventStreamWebhookBasicAuth build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UsernameStage, _FinalStage { + private String method; + + private String username; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamWebhookBasicAuth other) { + method(other.getMethod()); + username(other.getUsername()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UsernameStage method(@NotNull String method) { + this.method = Objects.requireNonNull(method, "method must not be null"); + return this; + } + + /** + *

Username

+ *

Username

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("username") + public _FinalStage username(@NotNull String username) { + this.username = Objects.requireNonNull(username, "username must not be null"); + return this; + } + + @java.lang.Override + public EventStreamWebhookBasicAuth build() { + return new EventStreamWebhookBasicAuth(method, username, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java new file mode 100644 index 000000000..59ae34454 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWebhookBearerAuth.Builder.class) +public final class EventStreamWebhookBearerAuth { + private final String method; + + private final Map additionalProperties; + + private EventStreamWebhookBearerAuth(String method, Map additionalProperties) { + this.method = method; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookBearerAuth && equalTo((EventStreamWebhookBearerAuth) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWebhookBearerAuth other) { + return method.equals(other.method); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + _FinalStage method(@NotNull String method); + + Builder from(EventStreamWebhookBearerAuth other); + } + + public interface _FinalStage { + EventStreamWebhookBearerAuth build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, _FinalStage { + private String method; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamWebhookBearerAuth other) { + method(other.getMethod()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public _FinalStage method(@NotNull String method) { + this.method = Objects.requireNonNull(method, "method must not be null"); + return this; + } + + @java.lang.Override + public EventStreamWebhookBearerAuth build() { + return new EventStreamWebhookBearerAuth(method, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java new file mode 100644 index 000000000..a3dafb72d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java @@ -0,0 +1,139 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWebhookConfiguration.Builder.class) +public final class EventStreamWebhookConfiguration { + private final String webhookEndpoint; + + private final EventStreamWebhookAuthorizationResponse webhookAuthorization; + + private final Map additionalProperties; + + private EventStreamWebhookConfiguration( + String webhookEndpoint, + EventStreamWebhookAuthorizationResponse webhookAuthorization, + Map additionalProperties) { + this.webhookEndpoint = webhookEndpoint; + this.webhookAuthorization = webhookAuthorization; + this.additionalProperties = additionalProperties; + } + + /** + * @return Target HTTP endpoint URL. + */ + @JsonProperty("webhook_endpoint") + public String getWebhookEndpoint() { + return webhookEndpoint; + } + + @JsonProperty("webhook_authorization") + public EventStreamWebhookAuthorizationResponse getWebhookAuthorization() { + return webhookAuthorization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookConfiguration && equalTo((EventStreamWebhookConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWebhookConfiguration other) { + return webhookEndpoint.equals(other.webhookEndpoint) && webhookAuthorization.equals(other.webhookAuthorization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.webhookEndpoint, this.webhookAuthorization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WebhookEndpointStage builder() { + return new Builder(); + } + + public interface WebhookEndpointStage { + /** + *

Target HTTP endpoint URL.

+ */ + WebhookAuthorizationStage webhookEndpoint(@NotNull String webhookEndpoint); + + Builder from(EventStreamWebhookConfiguration other); + } + + public interface WebhookAuthorizationStage { + _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorizationResponse webhookAuthorization); + } + + public interface _FinalStage { + EventStreamWebhookConfiguration build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WebhookEndpointStage, WebhookAuthorizationStage, _FinalStage { + private String webhookEndpoint; + + private EventStreamWebhookAuthorizationResponse webhookAuthorization; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamWebhookConfiguration other) { + webhookEndpoint(other.getWebhookEndpoint()); + webhookAuthorization(other.getWebhookAuthorization()); + return this; + } + + /** + *

Target HTTP endpoint URL.

+ *

Target HTTP endpoint URL.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("webhook_endpoint") + public WebhookAuthorizationStage webhookEndpoint(@NotNull String webhookEndpoint) { + this.webhookEndpoint = Objects.requireNonNull(webhookEndpoint, "webhookEndpoint must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("webhook_authorization") + public _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorizationResponse webhookAuthorization) { + this.webhookAuthorization = + Objects.requireNonNull(webhookAuthorization, "webhookAuthorization must not be null"); + return this; + } + + @java.lang.Override + public EventStreamWebhookConfiguration build() { + return new EventStreamWebhookConfiguration(webhookEndpoint, webhookAuthorization, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java new file mode 100644 index 000000000..85e8bb0ba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWebhookDestination.Builder.class) +public final class EventStreamWebhookDestination { + private final String type; + + private final EventStreamWebhookConfiguration configuration; + + private final Map additionalProperties; + + private EventStreamWebhookDestination( + String type, EventStreamWebhookConfiguration configuration, Map additionalProperties) { + this.type = type; + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("configuration") + public EventStreamWebhookConfiguration getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookDestination && equalTo((EventStreamWebhookDestination) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWebhookDestination other) { + return type.equals(other.type) && configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ConfigurationStage type(@NotNull String type); + + Builder from(EventStreamWebhookDestination other); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull EventStreamWebhookConfiguration configuration); + } + + public interface _FinalStage { + EventStreamWebhookDestination build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ConfigurationStage, _FinalStage { + private String type; + + private EventStreamWebhookConfiguration configuration; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamWebhookDestination other) { + type(other.getType()); + configuration(other.getConfiguration()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigurationStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("configuration") + public _FinalStage configuration(@NotNull EventStreamWebhookConfiguration configuration) { + this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); + return this; + } + + @java.lang.Override + public EventStreamWebhookDestination build() { + return new EventStreamWebhookDestination(type, configuration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java new file mode 100644 index 000000000..f21a19b20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWebhookResponseContent.Builder.class) +public final class EventStreamWebhookResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> subscriptions; + + private final Optional destination; + + private final Optional status; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private EventStreamWebhookResponseContent( + Optional id, + Optional name, + Optional> subscriptions, + Optional destination, + Optional status, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Timestamp when the event stream was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return Timestamp when the event stream was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWebhookResponseContent && equalTo((EventStreamWebhookResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWebhookResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional destination = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamWebhookResponseContent other) { + id(other.getId()); + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

Unique identifier for the event stream.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of the event stream.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public Builder subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public Builder subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(EventStreamWebhookDestination destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Timestamp when the event stream was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Timestamp when the event stream was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public EventStreamWebhookResponseContent build() { + return new EventStreamWebhookResponseContent( + id, name, subscriptions, destination, status, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java new file mode 100644 index 000000000..f816d58e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamWindow.Builder.class) +public final class EventStreamWindow { + private final OffsetDateTime dateFrom; + + private final OffsetDateTime dateTo; + + private final EventStreamBucketInterval bucketInterval; + + private final Map additionalProperties; + + private EventStreamWindow( + OffsetDateTime dateFrom, + OffsetDateTime dateTo, + EventStreamBucketInterval bucketInterval, + Map additionalProperties) { + this.dateFrom = dateFrom; + this.dateTo = dateTo; + this.bucketInterval = bucketInterval; + this.additionalProperties = additionalProperties; + } + + /** + * @return Start date of the time window. + */ + @JsonProperty("date_from") + public OffsetDateTime getDateFrom() { + return dateFrom; + } + + /** + * @return End date of the time window. + */ + @JsonProperty("date_to") + public OffsetDateTime getDateTo() { + return dateTo; + } + + @JsonProperty("bucket_interval") + public EventStreamBucketInterval getBucketInterval() { + return bucketInterval; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamWindow && equalTo((EventStreamWindow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamWindow other) { + return dateFrom.equals(other.dateFrom) + && dateTo.equals(other.dateTo) + && bucketInterval.equals(other.bucketInterval); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.dateFrom, this.dateTo, this.bucketInterval); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DateFromStage builder() { + return new Builder(); + } + + public interface DateFromStage { + /** + *

Start date of the time window.

+ */ + DateToStage dateFrom(@NotNull OffsetDateTime dateFrom); + + Builder from(EventStreamWindow other); + } + + public interface DateToStage { + /** + *

End date of the time window.

+ */ + BucketIntervalStage dateTo(@NotNull OffsetDateTime dateTo); + } + + public interface BucketIntervalStage { + _FinalStage bucketInterval(@NotNull EventStreamBucketInterval bucketInterval); + } + + public interface _FinalStage { + EventStreamWindow build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DateFromStage, DateToStage, BucketIntervalStage, _FinalStage { + private OffsetDateTime dateFrom; + + private OffsetDateTime dateTo; + + private EventStreamBucketInterval bucketInterval; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EventStreamWindow other) { + dateFrom(other.getDateFrom()); + dateTo(other.getDateTo()); + bucketInterval(other.getBucketInterval()); + return this; + } + + /** + *

Start date of the time window.

+ *

Start date of the time window.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("date_from") + public DateToStage dateFrom(@NotNull OffsetDateTime dateFrom) { + this.dateFrom = Objects.requireNonNull(dateFrom, "dateFrom must not be null"); + return this; + } + + /** + *

End date of the time window.

+ *

End date of the time window.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("date_to") + public BucketIntervalStage dateTo(@NotNull OffsetDateTime dateTo) { + this.dateTo = Objects.requireNonNull(dateTo, "dateTo must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("bucket_interval") + public _FinalStage bucketInterval(@NotNull EventStreamBucketInterval bucketInterval) { + this.bucketInterval = Objects.requireNonNull(bucketInterval, "bucketInterval must not be null"); + return this; + } + + @java.lang.Override + public EventStreamWindow build() { + return new EventStreamWindow(dateFrom, dateTo, bucketInterval, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java new file mode 100644 index 000000000..3af8d30e1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EventStreamsCreateRequest.Deserializer.class) +public final class EventStreamsCreateRequest { + private final Object value; + + private final int type; + + private EventStreamsCreateRequest(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateEventStreamWebHookRequestContent) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateEventStreamEventBridgeRequestContent) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateEventStreamActionRequestContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamsCreateRequest && equalTo((EventStreamsCreateRequest) other); + } + + private boolean equalTo(EventStreamsCreateRequest other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EventStreamsCreateRequest of(CreateEventStreamWebHookRequestContent value) { + return new EventStreamsCreateRequest(value, 0); + } + + public static EventStreamsCreateRequest of(CreateEventStreamEventBridgeRequestContent value) { + return new EventStreamsCreateRequest(value, 1); + } + + public static EventStreamsCreateRequest of(CreateEventStreamActionRequestContent value) { + return new EventStreamsCreateRequest(value, 2); + } + + public interface Visitor { + T visit(CreateEventStreamWebHookRequestContent value); + + T visit(CreateEventStreamEventBridgeRequestContent value); + + T visit(CreateEventStreamActionRequestContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EventStreamsCreateRequest.class); + } + + @java.lang.Override + public EventStreamsCreateRequest deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateEventStreamWebHookRequestContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateEventStreamEventBridgeRequestContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateEventStreamActionRequestContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamsGetStatsRequest.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamsGetStatsRequest.java new file mode 100644 index 000000000..34caa18b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamsGetStatsRequest.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventStreamsGetStatsRequest.Builder.class) +public final class EventStreamsGetStatsRequest { + private final OptionalNullable dateFrom; + + private final OptionalNullable dateTo; + + private final Map additionalProperties; + + private EventStreamsGetStatsRequest( + OptionalNullable dateFrom, + OptionalNullable dateTo, + Map additionalProperties) { + this.dateFrom = dateFrom; + this.dateTo = dateTo; + this.additionalProperties = additionalProperties; + } + + /** + * @return The RFC3339 start date for the stats query. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_from") + public OptionalNullable getDateFrom() { + if (dateFrom == null) { + return OptionalNullable.absent(); + } + return dateFrom; + } + + /** + * @return The RFC3339 end date for the stats query. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_to") + public OptionalNullable getDateTo() { + if (dateTo == null) { + return OptionalNullable.absent(); + } + return dateTo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_from") + private OptionalNullable _getDateFrom() { + return dateFrom; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_to") + private OptionalNullable _getDateTo() { + return dateTo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventStreamsGetStatsRequest && equalTo((EventStreamsGetStatsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventStreamsGetStatsRequest other) { + return dateFrom.equals(other.dateFrom) && dateTo.equals(other.dateTo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.dateFrom, this.dateTo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable dateFrom = OptionalNullable.absent(); + + private OptionalNullable dateTo = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventStreamsGetStatsRequest other) { + dateFrom(other.getDateFrom()); + dateTo(other.getDateTo()); + return this; + } + + /** + *

The RFC3339 start date for the stats query.

+ */ + @JsonSetter(value = "date_from", nulls = Nulls.SKIP) + public Builder dateFrom(@Nullable OptionalNullable dateFrom) { + this.dateFrom = dateFrom; + return this; + } + + public Builder dateFrom(String dateFrom) { + this.dateFrom = OptionalNullable.of(dateFrom); + return this; + } + + public Builder dateFrom(Optional dateFrom) { + if (dateFrom.isPresent()) { + this.dateFrom = OptionalNullable.of(dateFrom.get()); + } else { + this.dateFrom = OptionalNullable.absent(); + } + return this; + } + + public Builder dateFrom(com.auth0.client.mgmt.core.Nullable dateFrom) { + if (dateFrom.isNull()) { + this.dateFrom = OptionalNullable.ofNull(); + } else if (dateFrom.isEmpty()) { + this.dateFrom = OptionalNullable.absent(); + } else { + this.dateFrom = OptionalNullable.of(dateFrom.get()); + } + return this; + } + + /** + *

The RFC3339 end date for the stats query.

+ */ + @JsonSetter(value = "date_to", nulls = Nulls.SKIP) + public Builder dateTo(@Nullable OptionalNullable dateTo) { + this.dateTo = dateTo; + return this; + } + + public Builder dateTo(String dateTo) { + this.dateTo = OptionalNullable.of(dateTo); + return this; + } + + public Builder dateTo(Optional dateTo) { + if (dateTo.isPresent()) { + this.dateTo = OptionalNullable.of(dateTo.get()); + } else { + this.dateTo = OptionalNullable.absent(); + } + return this; + } + + public Builder dateTo(com.auth0.client.mgmt.core.Nullable dateTo) { + if (dateTo.isNull()) { + this.dateTo = OptionalNullable.ofNull(); + } else if (dateTo.isEmpty()) { + this.dateTo = OptionalNullable.absent(); + } else { + this.dateTo = OptionalNullable.of(dateTo.get()); + } + return this; + } + + public EventStreamsGetStatsRequest build() { + return new EventStreamsGetStatsRequest(dateFrom, dateTo, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java new file mode 100644 index 000000000..6997e2fa5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExtensibilityEmailProviderCredentials.Builder.class) +public final class ExtensibilityEmailProviderCredentials { + private final Map additionalProperties; + + private ExtensibilityEmailProviderCredentials(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExtensibilityEmailProviderCredentials; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExtensibilityEmailProviderCredentials other) { + return this; + } + + public ExtensibilityEmailProviderCredentials build() { + return new ExtensibilityEmailProviderCredentials(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java new file mode 100644 index 000000000..a80969430 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FederatedConnectionTokenSet.Builder.class) +public final class FederatedConnectionTokenSet { + private final Optional id; + + private final Optional connection; + + private final Optional scope; + + private final Optional expiresAt; + + private final Optional issuedAt; + + private final Optional lastUsedAt; + + private final Map additionalProperties; + + private FederatedConnectionTokenSet( + Optional id, + Optional connection, + Optional scope, + Optional expiresAt, + Optional issuedAt, + Optional lastUsedAt, + Map additionalProperties) { + this.id = id; + this.connection = connection; + this.scope = scope; + this.expiresAt = expiresAt; + this.issuedAt = issuedAt; + this.lastUsedAt = lastUsedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("issued_at") + public Optional getIssuedAt() { + return issuedAt; + } + + @JsonProperty("last_used_at") + public Optional getLastUsedAt() { + return lastUsedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FederatedConnectionTokenSet && equalTo((FederatedConnectionTokenSet) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FederatedConnectionTokenSet other) { + return id.equals(other.id) + && connection.equals(other.connection) + && scope.equals(other.scope) + && expiresAt.equals(other.expiresAt) + && issuedAt.equals(other.issuedAt) + && lastUsedAt.equals(other.lastUsedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.connection, this.scope, this.expiresAt, this.issuedAt, this.lastUsedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional connection = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional issuedAt = Optional.empty(); + + private Optional lastUsedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FederatedConnectionTokenSet other) { + id(other.getId()); + connection(other.getConnection()); + scope(other.getScope()); + expiresAt(other.getExpiresAt()); + issuedAt(other.getIssuedAt()); + lastUsedAt(other.getLastUsedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "issued_at", nulls = Nulls.SKIP) + public Builder issuedAt(Optional issuedAt) { + this.issuedAt = issuedAt; + return this; + } + + public Builder issuedAt(OffsetDateTime issuedAt) { + this.issuedAt = Optional.ofNullable(issuedAt); + return this; + } + + @JsonSetter(value = "last_used_at", nulls = Nulls.SKIP) + public Builder lastUsedAt(Optional lastUsedAt) { + this.lastUsedAt = lastUsedAt; + return this; + } + + public Builder lastUsedAt(OffsetDateTime lastUsedAt) { + this.lastUsedAt = Optional.ofNullable(lastUsedAt); + return this; + } + + public FederatedConnectionTokenSet build() { + return new FederatedConnectionTokenSet( + id, connection, scope, expiresAt, issuedAt, lastUsedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowAction.java b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java new file mode 100644 index 000000000..35d21213e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowAction.Deserializer.class) +public final class FlowAction { + private final Object value; + + private final int type; + + private FlowAction(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionActivecampaign) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionAirtable) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionAuth0) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowActionBigqueryInsertRows) this.value); + } else if (this.type == 4) { + return visitor.visit((FlowActionClearbit) this.value); + } else if (this.type == 5) { + return visitor.visit((FlowActionEmailVerifyEmail) this.value); + } else if (this.type == 6) { + return visitor.visit((FlowActionFlow) this.value); + } else if (this.type == 7) { + return visitor.visit((FlowActionGoogleSheetsAddRow) this.value); + } else if (this.type == 8) { + return visitor.visit((FlowActionHttpSendRequest) this.value); + } else if (this.type == 9) { + return visitor.visit((FlowActionHubspot) this.value); + } else if (this.type == 10) { + return visitor.visit((FlowActionJson) this.value); + } else if (this.type == 11) { + return visitor.visit((FlowActionJwt) this.value); + } else if (this.type == 12) { + return visitor.visit((FlowActionMailchimpUpsertMember) this.value); + } else if (this.type == 13) { + return visitor.visit((FlowActionMailjetSendEmail) this.value); + } else if (this.type == 14) { + return visitor.visit((FlowActionOtp) this.value); + } else if (this.type == 15) { + return visitor.visit((FlowActionPipedrive) this.value); + } else if (this.type == 16) { + return visitor.visit((FlowActionSalesforce) this.value); + } else if (this.type == 17) { + return visitor.visit((FlowActionSendgridSendEmail) this.value); + } else if (this.type == 18) { + return visitor.visit((FlowActionSlackPostMessage) this.value); + } else if (this.type == 19) { + return visitor.visit((FlowActionStripe) this.value); + } else if (this.type == 20) { + return visitor.visit((FlowActionTelegramSendMessage) this.value); + } else if (this.type == 21) { + return visitor.visit((FlowActionTwilio) this.value); + } else if (this.type == 22) { + return visitor.visit((FlowActionWhatsappSendMessage) this.value); + } else if (this.type == 23) { + return visitor.visit((FlowActionXml) this.value); + } else if (this.type == 24) { + return visitor.visit((FlowActionZapierTriggerWebhook) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowAction && equalTo((FlowAction) other); + } + + private boolean equalTo(FlowAction other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowAction of(FlowActionActivecampaign value) { + return new FlowAction(value, 0); + } + + public static FlowAction of(FlowActionAirtable value) { + return new FlowAction(value, 1); + } + + public static FlowAction of(FlowActionAuth0 value) { + return new FlowAction(value, 2); + } + + public static FlowAction of(FlowActionBigqueryInsertRows value) { + return new FlowAction(value, 3); + } + + public static FlowAction of(FlowActionClearbit value) { + return new FlowAction(value, 4); + } + + public static FlowAction of(FlowActionEmailVerifyEmail value) { + return new FlowAction(value, 5); + } + + public static FlowAction of(FlowActionFlow value) { + return new FlowAction(value, 6); + } + + public static FlowAction of(FlowActionGoogleSheetsAddRow value) { + return new FlowAction(value, 7); + } + + public static FlowAction of(FlowActionHttpSendRequest value) { + return new FlowAction(value, 8); + } + + public static FlowAction of(FlowActionHubspot value) { + return new FlowAction(value, 9); + } + + public static FlowAction of(FlowActionJson value) { + return new FlowAction(value, 10); + } + + public static FlowAction of(FlowActionJwt value) { + return new FlowAction(value, 11); + } + + public static FlowAction of(FlowActionMailchimpUpsertMember value) { + return new FlowAction(value, 12); + } + + public static FlowAction of(FlowActionMailjetSendEmail value) { + return new FlowAction(value, 13); + } + + public static FlowAction of(FlowActionOtp value) { + return new FlowAction(value, 14); + } + + public static FlowAction of(FlowActionPipedrive value) { + return new FlowAction(value, 15); + } + + public static FlowAction of(FlowActionSalesforce value) { + return new FlowAction(value, 16); + } + + public static FlowAction of(FlowActionSendgridSendEmail value) { + return new FlowAction(value, 17); + } + + public static FlowAction of(FlowActionSlackPostMessage value) { + return new FlowAction(value, 18); + } + + public static FlowAction of(FlowActionStripe value) { + return new FlowAction(value, 19); + } + + public static FlowAction of(FlowActionTelegramSendMessage value) { + return new FlowAction(value, 20); + } + + public static FlowAction of(FlowActionTwilio value) { + return new FlowAction(value, 21); + } + + public static FlowAction of(FlowActionWhatsappSendMessage value) { + return new FlowAction(value, 22); + } + + public static FlowAction of(FlowActionXml value) { + return new FlowAction(value, 23); + } + + public static FlowAction of(FlowActionZapierTriggerWebhook value) { + return new FlowAction(value, 24); + } + + public interface Visitor { + T visit(FlowActionActivecampaign value); + + T visit(FlowActionAirtable value); + + T visit(FlowActionAuth0 value); + + T visit(FlowActionBigqueryInsertRows value); + + T visit(FlowActionClearbit value); + + T visit(FlowActionEmailVerifyEmail value); + + T visit(FlowActionFlow value); + + T visit(FlowActionGoogleSheetsAddRow value); + + T visit(FlowActionHttpSendRequest value); + + T visit(FlowActionHubspot value); + + T visit(FlowActionJson value); + + T visit(FlowActionJwt value); + + T visit(FlowActionMailchimpUpsertMember value); + + T visit(FlowActionMailjetSendEmail value); + + T visit(FlowActionOtp value); + + T visit(FlowActionPipedrive value); + + T visit(FlowActionSalesforce value); + + T visit(FlowActionSendgridSendEmail value); + + T visit(FlowActionSlackPostMessage value); + + T visit(FlowActionStripe value); + + T visit(FlowActionTelegramSendMessage value); + + T visit(FlowActionTwilio value); + + T visit(FlowActionWhatsappSendMessage value); + + T visit(FlowActionXml value); + + T visit(FlowActionZapierTriggerWebhook value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowAction.class); + } + + @java.lang.Override + public FlowAction deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionActivecampaign.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAirtable.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionBigqueryInsertRows.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionClearbit.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionEmailVerifyEmail.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlow.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionGoogleSheetsAddRow.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionHttpSendRequest.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionHubspot.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJson.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionMailchimpUpsertMember.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionMailjetSendEmail.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionOtp.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionPipedrive.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSalesforce.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSendgridSendEmail.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSlackPostMessage.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripe.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionTelegramSendMessage.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionTwilio.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionWhatsappSendMessage.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionXml.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionZapierTriggerWebhook.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java new file mode 100644 index 000000000..06a370898 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionActivecampaign.Deserializer.class) +public final class FlowActionActivecampaign { + private final Object value; + + private final int type; + + private FlowActionActivecampaign(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionActivecampaignListContacts) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionActivecampaignUpsertContact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionActivecampaign && equalTo((FlowActionActivecampaign) other); + } + + private boolean equalTo(FlowActionActivecampaign other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionActivecampaign of(FlowActionActivecampaignListContacts value) { + return new FlowActionActivecampaign(value, 0); + } + + public static FlowActionActivecampaign of(FlowActionActivecampaignUpsertContact value) { + return new FlowActionActivecampaign(value, 1); + } + + public interface Visitor { + T visit(FlowActionActivecampaignListContacts value); + + T visit(FlowActionActivecampaignUpsertContact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionActivecampaign.class); + } + + @java.lang.Override + public FlowActionActivecampaign deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionActivecampaignListContacts.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionActivecampaignUpsertContact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContacts.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContacts.java new file mode 100644 index 000000000..91bef632c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContacts.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionActivecampaignListContacts.Builder.class) +public final class FlowActionActivecampaignListContacts { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionActivecampaignListContactsParams params; + + private final Map additionalProperties; + + private FlowActionActivecampaignListContacts( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionActivecampaignListContactsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "ACTIVECAMPAIGN"; + } + + @JsonProperty("action") + public String getAction() { + return "LIST_CONTACTS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionActivecampaignListContactsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionActivecampaignListContacts + && equalTo((FlowActionActivecampaignListContacts) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionActivecampaignListContacts other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionActivecampaignListContacts other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionActivecampaignListContactsParams params); + } + + public interface _FinalStage { + FlowActionActivecampaignListContacts build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionActivecampaignListContactsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionActivecampaignListContacts other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionActivecampaignListContactsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionActivecampaignListContacts build() { + return new FlowActionActivecampaignListContacts( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java new file mode 100644 index 000000000..92b6b2466 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionActivecampaignListContactsParams.Builder.class) +public final class FlowActionActivecampaignListContactsParams { + private final String connectionId; + + private final String email; + + private final Map additionalProperties; + + private FlowActionActivecampaignListContactsParams( + String connectionId, String email, Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionActivecampaignListContactsParams + && equalTo((FlowActionActivecampaignListContactsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionActivecampaignListContactsParams other) { + return connectionId.equals(other.connectionId) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionActivecampaignListContactsParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionActivecampaignListContactsParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionActivecampaignListContactsParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public FlowActionActivecampaignListContactsParams build() { + return new FlowActionActivecampaignListContactsParams(connectionId, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java new file mode 100644 index 000000000..cbc6d5089 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionActivecampaignUpsertContact.Builder.class) +public final class FlowActionActivecampaignUpsertContact { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionActivecampaignUpsertContactParams params; + + private final Map additionalProperties; + + private FlowActionActivecampaignUpsertContact( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionActivecampaignUpsertContactParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "ACTIVECAMPAIGN"; + } + + @JsonProperty("action") + public String getAction() { + return "UPSERT_CONTACT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionActivecampaignUpsertContactParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionActivecampaignUpsertContact + && equalTo((FlowActionActivecampaignUpsertContact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionActivecampaignUpsertContact other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionActivecampaignUpsertContact other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionActivecampaignUpsertContactParams params); + } + + public interface _FinalStage { + FlowActionActivecampaignUpsertContact build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionActivecampaignUpsertContactParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionActivecampaignUpsertContact other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionActivecampaignUpsertContactParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionActivecampaignUpsertContact build() { + return new FlowActionActivecampaignUpsertContact( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java new file mode 100644 index 000000000..756f1d32e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionActivecampaignUpsertContactParams.Builder.class) +public final class FlowActionActivecampaignUpsertContactParams { + private final String connectionId; + + private final String email; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional phone; + + private final Optional> customFields; + + private final Map additionalProperties; + + private FlowActionActivecampaignUpsertContactParams( + String connectionId, + String email, + Optional firstName, + Optional lastName, + Optional phone, + Optional> customFields, + Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + this.phone = phone; + this.customFields = customFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + @JsonProperty("phone") + public Optional getPhone() { + return phone; + } + + @JsonProperty("custom_fields") + public Optional> getCustomFields() { + return customFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionActivecampaignUpsertContactParams + && equalTo((FlowActionActivecampaignUpsertContactParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionActivecampaignUpsertContactParams other) { + return connectionId.equals(other.connectionId) + && email.equals(other.email) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && phone.equals(other.phone) + && customFields.equals(other.customFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, this.email, this.firstName, this.lastName, this.phone, this.customFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionActivecampaignUpsertContactParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionActivecampaignUpsertContactParams build(); + + _FinalStage firstName(Optional firstName); + + _FinalStage firstName(String firstName); + + _FinalStage lastName(Optional lastName); + + _FinalStage lastName(String lastName); + + _FinalStage phone(Optional phone); + + _FinalStage phone(String phone); + + _FinalStage customFields(Optional> customFields); + + _FinalStage customFields(Map customFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + private Optional> customFields = Optional.empty(); + + private Optional phone = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional firstName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionActivecampaignUpsertContactParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + phone(other.getPhone()); + customFields(other.getCustomFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage customFields(Map customFields) { + this.customFields = Optional.ofNullable(customFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_fields", nulls = Nulls.SKIP) + public _FinalStage customFields(Optional> customFields) { + this.customFields = customFields; + return this; + } + + @java.lang.Override + public _FinalStage phone(String phone) { + this.phone = Optional.ofNullable(phone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone", nulls = Nulls.SKIP) + public _FinalStage phone(Optional phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + public _FinalStage lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public _FinalStage lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + @java.lang.Override + public _FinalStage firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public _FinalStage firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + @java.lang.Override + public FlowActionActivecampaignUpsertContactParams build() { + return new FlowActionActivecampaignUpsertContactParams( + connectionId, email, firstName, lastName, phone, customFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java new file mode 100644 index 000000000..c7d701ea4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionAirtable.Deserializer.class) +public final class FlowActionAirtable { + private final Object value; + + private final int type; + + private FlowActionAirtable(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionAirtableCreateRecord) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionAirtableListRecords) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionAirtableUpdateRecord) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtable && equalTo((FlowActionAirtable) other); + } + + private boolean equalTo(FlowActionAirtable other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionAirtable of(FlowActionAirtableCreateRecord value) { + return new FlowActionAirtable(value, 0); + } + + public static FlowActionAirtable of(FlowActionAirtableListRecords value) { + return new FlowActionAirtable(value, 1); + } + + public static FlowActionAirtable of(FlowActionAirtableUpdateRecord value) { + return new FlowActionAirtable(value, 2); + } + + public interface Visitor { + T visit(FlowActionAirtableCreateRecord value); + + T visit(FlowActionAirtableListRecords value); + + T visit(FlowActionAirtableUpdateRecord value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionAirtable.class); + } + + @java.lang.Override + public FlowActionAirtable deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAirtableCreateRecord.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAirtableListRecords.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAirtableUpdateRecord.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java new file mode 100644 index 000000000..7bbf26861 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableCreateRecord.Builder.class) +public final class FlowActionAirtableCreateRecord { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAirtableCreateRecordParams params; + + private final Map additionalProperties; + + private FlowActionAirtableCreateRecord( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAirtableCreateRecordParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AIRTABLE"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_RECORD"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAirtableCreateRecordParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableCreateRecord && equalTo((FlowActionAirtableCreateRecord) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableCreateRecord other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAirtableCreateRecord other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAirtableCreateRecordParams params); + } + + public interface _FinalStage { + FlowActionAirtableCreateRecord build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAirtableCreateRecordParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableCreateRecord other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAirtableCreateRecordParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAirtableCreateRecord build() { + return new FlowActionAirtableCreateRecord( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java new file mode 100644 index 000000000..1b77ec248 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java @@ -0,0 +1,186 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableCreateRecordParams.Builder.class) +public final class FlowActionAirtableCreateRecordParams { + private final String connectionId; + + private final String baseId; + + private final String tableName; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionAirtableCreateRecordParams( + String connectionId, + String baseId, + String tableName, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.baseId = baseId; + this.tableName = tableName; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("base_id") + public String getBaseId() { + return baseId; + } + + @JsonProperty("table_name") + public String getTableName() { + return tableName; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableCreateRecordParams + && equalTo((FlowActionAirtableCreateRecordParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableCreateRecordParams other) { + return connectionId.equals(other.connectionId) + && baseId.equals(other.baseId) + && tableName.equals(other.tableName) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.baseId, this.tableName, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + BaseIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAirtableCreateRecordParams other); + } + + public interface BaseIdStage { + TableNameStage baseId(@NotNull String baseId); + } + + public interface TableNameStage { + _FinalStage tableName(@NotNull String tableName); + } + + public interface _FinalStage { + FlowActionAirtableCreateRecordParams build(); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(Map fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, BaseIdStage, TableNameStage, _FinalStage { + private String connectionId; + + private String baseId; + + private String tableName; + + private Optional> fields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableCreateRecordParams other) { + connectionId(other.getConnectionId()); + baseId(other.getBaseId()); + tableName(other.getTableName()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public BaseIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("base_id") + public TableNameStage baseId(@NotNull String baseId) { + this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("table_name") + public _FinalStage tableName(@NotNull String tableName) { + this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Map fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public FlowActionAirtableCreateRecordParams build() { + return new FlowActionAirtableCreateRecordParams( + connectionId, baseId, tableName, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java new file mode 100644 index 000000000..22c909c64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableListRecords.Builder.class) +public final class FlowActionAirtableListRecords { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAirtableListRecordsParams params; + + private final Map additionalProperties; + + private FlowActionAirtableListRecords( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAirtableListRecordsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AIRTABLE"; + } + + @JsonProperty("action") + public String getAction() { + return "LIST_RECORDS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAirtableListRecordsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableListRecords && equalTo((FlowActionAirtableListRecords) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableListRecords other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAirtableListRecords other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAirtableListRecordsParams params); + } + + public interface _FinalStage { + FlowActionAirtableListRecords build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAirtableListRecordsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableListRecords other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAirtableListRecordsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAirtableListRecords build() { + return new FlowActionAirtableListRecords(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java new file mode 100644 index 000000000..cf5310d9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableListRecordsParams.Builder.class) +public final class FlowActionAirtableListRecordsParams { + private final String connectionId; + + private final String baseId; + + private final String tableName; + + private final Optional query; + + private final Optional view; + + private final Map additionalProperties; + + private FlowActionAirtableListRecordsParams( + String connectionId, + String baseId, + String tableName, + Optional query, + Optional view, + Map additionalProperties) { + this.connectionId = connectionId; + this.baseId = baseId; + this.tableName = tableName; + this.query = query; + this.view = view; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("base_id") + public String getBaseId() { + return baseId; + } + + @JsonProperty("table_name") + public String getTableName() { + return tableName; + } + + @JsonProperty("query") + public Optional getQuery() { + return query; + } + + @JsonProperty("view") + public Optional getView() { + return view; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableListRecordsParams + && equalTo((FlowActionAirtableListRecordsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableListRecordsParams other) { + return connectionId.equals(other.connectionId) + && baseId.equals(other.baseId) + && tableName.equals(other.tableName) + && query.equals(other.query) + && view.equals(other.view); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.baseId, this.tableName, this.query, this.view); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + BaseIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAirtableListRecordsParams other); + } + + public interface BaseIdStage { + TableNameStage baseId(@NotNull String baseId); + } + + public interface TableNameStage { + _FinalStage tableName(@NotNull String tableName); + } + + public interface _FinalStage { + FlowActionAirtableListRecordsParams build(); + + _FinalStage query(Optional query); + + _FinalStage query(String query); + + _FinalStage view(Optional view); + + _FinalStage view(String view); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, BaseIdStage, TableNameStage, _FinalStage { + private String connectionId; + + private String baseId; + + private String tableName; + + private Optional view = Optional.empty(); + + private Optional query = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableListRecordsParams other) { + connectionId(other.getConnectionId()); + baseId(other.getBaseId()); + tableName(other.getTableName()); + query(other.getQuery()); + view(other.getView()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public BaseIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("base_id") + public TableNameStage baseId(@NotNull String baseId) { + this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("table_name") + public _FinalStage tableName(@NotNull String tableName) { + this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage view(String view) { + this.view = Optional.ofNullable(view); + return this; + } + + @java.lang.Override + @JsonSetter(value = "view", nulls = Nulls.SKIP) + public _FinalStage view(Optional view) { + this.view = view; + return this; + } + + @java.lang.Override + public _FinalStage query(String query) { + this.query = Optional.ofNullable(query); + return this; + } + + @java.lang.Override + @JsonSetter(value = "query", nulls = Nulls.SKIP) + public _FinalStage query(Optional query) { + this.query = query; + return this; + } + + @java.lang.Override + public FlowActionAirtableListRecordsParams build() { + return new FlowActionAirtableListRecordsParams( + connectionId, baseId, tableName, query, view, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java new file mode 100644 index 000000000..5552a1253 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableUpdateRecord.Builder.class) +public final class FlowActionAirtableUpdateRecord { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAirtableUpdateRecordParams params; + + private final Map additionalProperties; + + private FlowActionAirtableUpdateRecord( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAirtableUpdateRecordParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AIRTABLE"; + } + + @JsonProperty("action") + public String getAction() { + return "UPDATE_RECORD"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAirtableUpdateRecordParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableUpdateRecord && equalTo((FlowActionAirtableUpdateRecord) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableUpdateRecord other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAirtableUpdateRecord other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAirtableUpdateRecordParams params); + } + + public interface _FinalStage { + FlowActionAirtableUpdateRecord build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAirtableUpdateRecordParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableUpdateRecord other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAirtableUpdateRecordParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAirtableUpdateRecord build() { + return new FlowActionAirtableUpdateRecord( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java new file mode 100644 index 000000000..cc9e72e32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAirtableUpdateRecordParams.Builder.class) +public final class FlowActionAirtableUpdateRecordParams { + private final String connectionId; + + private final String baseId; + + private final String tableName; + + private final String recordId; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionAirtableUpdateRecordParams( + String connectionId, + String baseId, + String tableName, + String recordId, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.baseId = baseId; + this.tableName = tableName; + this.recordId = recordId; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("base_id") + public String getBaseId() { + return baseId; + } + + @JsonProperty("table_name") + public String getTableName() { + return tableName; + } + + @JsonProperty("record_id") + public String getRecordId() { + return recordId; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAirtableUpdateRecordParams + && equalTo((FlowActionAirtableUpdateRecordParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAirtableUpdateRecordParams other) { + return connectionId.equals(other.connectionId) + && baseId.equals(other.baseId) + && tableName.equals(other.tableName) + && recordId.equals(other.recordId) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.baseId, this.tableName, this.recordId, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + BaseIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAirtableUpdateRecordParams other); + } + + public interface BaseIdStage { + TableNameStage baseId(@NotNull String baseId); + } + + public interface TableNameStage { + RecordIdStage tableName(@NotNull String tableName); + } + + public interface RecordIdStage { + _FinalStage recordId(@NotNull String recordId); + } + + public interface _FinalStage { + FlowActionAirtableUpdateRecordParams build(); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(Map fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, BaseIdStage, TableNameStage, RecordIdStage, _FinalStage { + private String connectionId; + + private String baseId; + + private String tableName; + + private String recordId; + + private Optional> fields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAirtableUpdateRecordParams other) { + connectionId(other.getConnectionId()); + baseId(other.getBaseId()); + tableName(other.getTableName()); + recordId(other.getRecordId()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public BaseIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("base_id") + public TableNameStage baseId(@NotNull String baseId) { + this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("table_name") + public RecordIdStage tableName(@NotNull String tableName) { + this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("record_id") + public _FinalStage recordId(@NotNull String recordId) { + this.recordId = Objects.requireNonNull(recordId, "recordId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Map fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public FlowActionAirtableUpdateRecordParams build() { + return new FlowActionAirtableUpdateRecordParams( + connectionId, baseId, tableName, recordId, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java new file mode 100644 index 000000000..ac26ddf3a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionAuth0.Deserializer.class) +public final class FlowActionAuth0 { + private final Object value; + + private final int type; + + private FlowActionAuth0(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionAuth0CreateUser) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionAuth0GetUser) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionAuth0UpdateUser) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowActionAuth0SendRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0 && equalTo((FlowActionAuth0) other); + } + + private boolean equalTo(FlowActionAuth0 other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionAuth0 of(FlowActionAuth0CreateUser value) { + return new FlowActionAuth0(value, 0); + } + + public static FlowActionAuth0 of(FlowActionAuth0GetUser value) { + return new FlowActionAuth0(value, 1); + } + + public static FlowActionAuth0 of(FlowActionAuth0UpdateUser value) { + return new FlowActionAuth0(value, 2); + } + + public static FlowActionAuth0 of(FlowActionAuth0SendRequest value) { + return new FlowActionAuth0(value, 3); + } + + public interface Visitor { + T visit(FlowActionAuth0CreateUser value); + + T visit(FlowActionAuth0GetUser value); + + T visit(FlowActionAuth0UpdateUser value); + + T visit(FlowActionAuth0SendRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionAuth0.class); + } + + @java.lang.Override + public FlowActionAuth0 deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0CreateUser.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0GetUser.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0UpdateUser.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0SendRequest.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java new file mode 100644 index 000000000..3b812faf4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0CreateUser.Builder.class) +public final class FlowActionAuth0CreateUser { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAuth0CreateUserParams params; + + private final Map additionalProperties; + + private FlowActionAuth0CreateUser( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAuth0CreateUserParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AUTH0"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_USER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAuth0CreateUserParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0CreateUser && equalTo((FlowActionAuth0CreateUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0CreateUser other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAuth0CreateUser other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAuth0CreateUserParams params); + } + + public interface _FinalStage { + FlowActionAuth0CreateUser build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAuth0CreateUserParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0CreateUser other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAuth0CreateUserParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAuth0CreateUser build() { + return new FlowActionAuth0CreateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java new file mode 100644 index 000000000..adee48f44 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0CreateUserParams.Builder.class) +public final class FlowActionAuth0CreateUserParams { + private final String connectionId; + + private final Map payload; + + private final Map additionalProperties; + + private FlowActionAuth0CreateUserParams( + String connectionId, Map payload, Map additionalProperties) { + this.connectionId = connectionId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("payload") + public Map getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0CreateUserParams && equalTo((FlowActionAuth0CreateUserParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0CreateUserParams other) { + return connectionId.equals(other.connectionId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAuth0CreateUserParams other); + } + + public interface _FinalStage { + FlowActionAuth0CreateUserParams build(); + + _FinalStage payload(Map payload); + + _FinalStage putAllPayload(Map payload); + + _FinalStage payload(String key, Object value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Map payload = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0CreateUserParams other) { + connectionId(other.getConnectionId()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage payload(String key, Object value) { + this.payload.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllPayload(Map payload) { + if (payload != null) { + this.payload.putAll(payload); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Map payload) { + this.payload.clear(); + if (payload != null) { + this.payload.putAll(payload); + } + return this; + } + + @java.lang.Override + public FlowActionAuth0CreateUserParams build() { + return new FlowActionAuth0CreateUserParams(connectionId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java new file mode 100644 index 000000000..cb3818a12 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0GetUser.Builder.class) +public final class FlowActionAuth0GetUser { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAuth0GetUserParams params; + + private final Map additionalProperties; + + private FlowActionAuth0GetUser( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAuth0GetUserParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AUTH0"; + } + + @JsonProperty("action") + public String getAction() { + return "GET_USER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAuth0GetUserParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0GetUser && equalTo((FlowActionAuth0GetUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0GetUser other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAuth0GetUser other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAuth0GetUserParams params); + } + + public interface _FinalStage { + FlowActionAuth0GetUser build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAuth0GetUserParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0GetUser other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAuth0GetUserParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAuth0GetUser build() { + return new FlowActionAuth0GetUser(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java new file mode 100644 index 000000000..6daecbc64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0GetUserParams.Builder.class) +public final class FlowActionAuth0GetUserParams { + private final String connectionId; + + private final String userId; + + private final Map additionalProperties; + + private FlowActionAuth0GetUserParams(String connectionId, String userId, Map additionalProperties) { + this.connectionId = connectionId; + this.userId = userId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0GetUserParams && equalTo((FlowActionAuth0GetUserParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0GetUserParams other) { + return connectionId.equals(other.connectionId) && userId.equals(other.userId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.userId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + UserIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAuth0GetUserParams other); + } + + public interface UserIdStage { + _FinalStage userId(@NotNull String userId); + } + + public interface _FinalStage { + FlowActionAuth0GetUserParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, UserIdStage, _FinalStage { + private String connectionId; + + private String userId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0GetUserParams other) { + connectionId(other.getConnectionId()); + userId(other.getUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public UserIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @java.lang.Override + public FlowActionAuth0GetUserParams build() { + return new FlowActionAuth0GetUserParams(connectionId, userId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java new file mode 100644 index 000000000..661c1e180 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0SendRequest.Builder.class) +public final class FlowActionAuth0SendRequest { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAuth0SendRequestParams params; + + private final Map additionalProperties; + + private FlowActionAuth0SendRequest( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAuth0SendRequestParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AUTH0"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_REQUEST"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAuth0SendRequestParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendRequest && equalTo((FlowActionAuth0SendRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0SendRequest other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAuth0SendRequest other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAuth0SendRequestParams params); + } + + public interface _FinalStage { + FlowActionAuth0SendRequest build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAuth0SendRequestParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0SendRequest other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAuth0SendRequestParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAuth0SendRequest build() { + return new FlowActionAuth0SendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java new file mode 100644 index 000000000..b0e7f15e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java @@ -0,0 +1,251 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0SendRequestParams.Builder.class) +public final class FlowActionAuth0SendRequestParams { + private final String connectionId; + + private final String pathname; + + private final Optional method; + + private final Optional> headers; + + private final Optional> params; + + private final Optional payload; + + private final Map additionalProperties; + + private FlowActionAuth0SendRequestParams( + String connectionId, + String pathname, + Optional method, + Optional> headers, + Optional> params, + Optional payload, + Map additionalProperties) { + this.connectionId = connectionId; + this.pathname = pathname; + this.method = method; + this.headers = headers; + this.params = params; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("pathname") + public String getPathname() { + return pathname; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("params") + public Optional> getParams() { + return params; + } + + @JsonProperty("payload") + public Optional getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendRequestParams && equalTo((FlowActionAuth0SendRequestParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0SendRequestParams other) { + return connectionId.equals(other.connectionId) + && pathname.equals(other.pathname) + && method.equals(other.method) + && headers.equals(other.headers) + && params.equals(other.params) + && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.pathname, this.method, this.headers, this.params, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + PathnameStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAuth0SendRequestParams other); + } + + public interface PathnameStage { + _FinalStage pathname(@NotNull String pathname); + } + + public interface _FinalStage { + FlowActionAuth0SendRequestParams build(); + + _FinalStage method(Optional method); + + _FinalStage method(FlowActionAuth0SendRequestParamsMethod method); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage params(Optional> params); + + _FinalStage params(Map params); + + _FinalStage payload(Optional payload); + + _FinalStage payload(FlowActionAuth0SendRequestParamsPayload payload); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, PathnameStage, _FinalStage { + private String connectionId; + + private String pathname; + + private Optional payload = Optional.empty(); + + private Optional> params = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional method = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0SendRequestParams other) { + connectionId(other.getConnectionId()); + pathname(other.getPathname()); + method(other.getMethod()); + headers(other.getHeaders()); + params(other.getParams()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public PathnameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("pathname") + public _FinalStage pathname(@NotNull String pathname) { + this.pathname = Objects.requireNonNull(pathname, "pathname must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage payload(FlowActionAuth0SendRequestParamsPayload payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Optional payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public _FinalStage params(Map params) { + this.params = Optional.ofNullable(params); + return this; + } + + @java.lang.Override + @JsonSetter(value = "params", nulls = Nulls.SKIP) + public _FinalStage params(Optional> params) { + this.params = params; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage method(FlowActionAuth0SendRequestParamsMethod method) { + this.method = Optional.ofNullable(method); + return this; + } + + @java.lang.Override + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public _FinalStage method(Optional method) { + this.method = method; + return this; + } + + @java.lang.Override + public FlowActionAuth0SendRequestParams build() { + return new FlowActionAuth0SendRequestParams( + connectionId, pathname, method, headers, params, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java new file mode 100644 index 000000000..56bd83eb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionAuth0SendRequestParamsMethod { + public static final FlowActionAuth0SendRequestParamsMethod PATCH = + new FlowActionAuth0SendRequestParamsMethod(Value.PATCH, "PATCH"); + + public static final FlowActionAuth0SendRequestParamsMethod DELETE = + new FlowActionAuth0SendRequestParamsMethod(Value.DELETE, "DELETE"); + + public static final FlowActionAuth0SendRequestParamsMethod GET = + new FlowActionAuth0SendRequestParamsMethod(Value.GET, "GET"); + + public static final FlowActionAuth0SendRequestParamsMethod PUT = + new FlowActionAuth0SendRequestParamsMethod(Value.PUT, "PUT"); + + public static final FlowActionAuth0SendRequestParamsMethod POST = + new FlowActionAuth0SendRequestParamsMethod(Value.POST, "POST"); + + private final Value value; + + private final String string; + + FlowActionAuth0SendRequestParamsMethod(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionAuth0SendRequestParamsMethod + && this.string.equals(((FlowActionAuth0SendRequestParamsMethod) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PATCH: + return visitor.visitPatch(); + case DELETE: + return visitor.visitDelete(); + case GET: + return visitor.visitGet(); + case PUT: + return visitor.visitPut(); + case POST: + return visitor.visitPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionAuth0SendRequestParamsMethod valueOf(String value) { + switch (value) { + case "PATCH": + return PATCH; + case "DELETE": + return DELETE; + case "GET": + return GET; + case "PUT": + return PUT; + case "POST": + return POST; + default: + return new FlowActionAuth0SendRequestParamsMethod(Value.UNKNOWN, value); + } + } + + public enum Value { + GET, + + POST, + + PUT, + + PATCH, + + DELETE, + + UNKNOWN + } + + public interface Visitor { + T visitGet(); + + T visitPost(); + + T visitPut(); + + T visitPatch(); + + T visitDelete(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java new file mode 100644 index 000000000..c88b6c5ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionAuth0SendRequestParamsPayload.Deserializer.class) +public final class FlowActionAuth0SendRequestParamsPayload { + private final Object value; + + private final int type; + + private FlowActionAuth0SendRequestParamsPayload(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } else if (this.type == 2) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendRequestParamsPayload + && equalTo((FlowActionAuth0SendRequestParamsPayload) other); + } + + private boolean equalTo(FlowActionAuth0SendRequestParamsPayload other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionAuth0SendRequestParamsPayload of(String value) { + return new FlowActionAuth0SendRequestParamsPayload(value, 0); + } + + public static FlowActionAuth0SendRequestParamsPayload of(List value) { + return new FlowActionAuth0SendRequestParamsPayload(value, 1); + } + + public static FlowActionAuth0SendRequestParamsPayload of(Map value) { + return new FlowActionAuth0SendRequestParamsPayload(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionAuth0SendRequestParamsPayload.class); + } + + @java.lang.Override + public FlowActionAuth0SendRequestParamsPayload deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java new file mode 100644 index 000000000..de7e23136 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0UpdateUser.Builder.class) +public final class FlowActionAuth0UpdateUser { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAuth0UpdateUserParams params; + + private final Map additionalProperties; + + private FlowActionAuth0UpdateUser( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAuth0UpdateUserParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AUTH0"; + } + + @JsonProperty("action") + public String getAction() { + return "UPDATE_USER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAuth0UpdateUserParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0UpdateUser && equalTo((FlowActionAuth0UpdateUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0UpdateUser other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAuth0UpdateUser other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAuth0UpdateUserParams params); + } + + public interface _FinalStage { + FlowActionAuth0UpdateUser build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAuth0UpdateUserParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0UpdateUser other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAuth0UpdateUserParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionAuth0UpdateUser build() { + return new FlowActionAuth0UpdateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java new file mode 100644 index 000000000..3d81255d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0UpdateUserParams.Builder.class) +public final class FlowActionAuth0UpdateUserParams { + private final String connectionId; + + private final String userId; + + private final Map changes; + + private final Map additionalProperties; + + private FlowActionAuth0UpdateUserParams( + String connectionId, String userId, Map changes, Map additionalProperties) { + this.connectionId = connectionId; + this.userId = userId; + this.changes = changes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + @JsonProperty("changes") + public Map getChanges() { + return changes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0UpdateUserParams && equalTo((FlowActionAuth0UpdateUserParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0UpdateUserParams other) { + return connectionId.equals(other.connectionId) && userId.equals(other.userId) && changes.equals(other.changes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.userId, this.changes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + UserIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionAuth0UpdateUserParams other); + } + + public interface UserIdStage { + _FinalStage userId(@NotNull String userId); + } + + public interface _FinalStage { + FlowActionAuth0UpdateUserParams build(); + + _FinalStage changes(Map changes); + + _FinalStage putAllChanges(Map changes); + + _FinalStage changes(String key, Object value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, UserIdStage, _FinalStage { + private String connectionId; + + private String userId; + + private Map changes = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionAuth0UpdateUserParams other) { + connectionId(other.getConnectionId()); + userId(other.getUserId()); + changes(other.getChanges()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public UserIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage changes(String key, Object value) { + this.changes.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllChanges(Map changes) { + if (changes != null) { + this.changes.putAll(changes); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "changes", nulls = Nulls.SKIP) + public _FinalStage changes(Map changes) { + this.changes.clear(); + if (changes != null) { + this.changes.putAll(changes); + } + return this; + } + + @java.lang.Override + public FlowActionAuth0UpdateUserParams build() { + return new FlowActionAuth0UpdateUserParams(connectionId, userId, changes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java new file mode 100644 index 000000000..2a291b96a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionBigqueryInsertRows.Builder.class) +public final class FlowActionBigqueryInsertRows { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionBigqueryInsertRowsParams params; + + private final Map additionalProperties; + + private FlowActionBigqueryInsertRows( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionBigqueryInsertRowsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "BIGQUERY"; + } + + @JsonProperty("action") + public String getAction() { + return "INSERT_ROWS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionBigqueryInsertRowsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionBigqueryInsertRows && equalTo((FlowActionBigqueryInsertRows) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionBigqueryInsertRows other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionBigqueryInsertRows other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionBigqueryInsertRowsParams params); + } + + public interface _FinalStage { + FlowActionBigqueryInsertRows build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionBigqueryInsertRowsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionBigqueryInsertRows other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionBigqueryInsertRowsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionBigqueryInsertRows build() { + return new FlowActionBigqueryInsertRows(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java new file mode 100644 index 000000000..1dd56cd7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionBigqueryInsertRowsParams.Builder.class) +public final class FlowActionBigqueryInsertRowsParams { + private final String connectionId; + + private final String datasetId; + + private final String tableId; + + private final Optional> data; + + private final Map additionalProperties; + + private FlowActionBigqueryInsertRowsParams( + String connectionId, + String datasetId, + String tableId, + Optional> data, + Map additionalProperties) { + this.connectionId = connectionId; + this.datasetId = datasetId; + this.tableId = tableId; + this.data = data; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("dataset_id") + public String getDatasetId() { + return datasetId; + } + + @JsonProperty("table_id") + public String getTableId() { + return tableId; + } + + @JsonProperty("data") + public Optional> getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionBigqueryInsertRowsParams + && equalTo((FlowActionBigqueryInsertRowsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionBigqueryInsertRowsParams other) { + return connectionId.equals(other.connectionId) + && datasetId.equals(other.datasetId) + && tableId.equals(other.tableId) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.datasetId, this.tableId, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + DatasetIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionBigqueryInsertRowsParams other); + } + + public interface DatasetIdStage { + TableIdStage datasetId(@NotNull String datasetId); + } + + public interface TableIdStage { + _FinalStage tableId(@NotNull String tableId); + } + + public interface _FinalStage { + FlowActionBigqueryInsertRowsParams build(); + + _FinalStage data(Optional> data); + + _FinalStage data(Map data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, DatasetIdStage, TableIdStage, _FinalStage { + private String connectionId; + + private String datasetId; + + private String tableId; + + private Optional> data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionBigqueryInsertRowsParams other) { + connectionId(other.getConnectionId()); + datasetId(other.getDatasetId()); + tableId(other.getTableId()); + data(other.getData()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public DatasetIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("dataset_id") + public TableIdStage datasetId(@NotNull String datasetId) { + this.datasetId = Objects.requireNonNull(datasetId, "datasetId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("table_id") + public _FinalStage tableId(@NotNull String tableId) { + this.tableId = Objects.requireNonNull(tableId, "tableId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage data(Map data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional> data) { + this.data = data; + return this; + } + + @java.lang.Override + public FlowActionBigqueryInsertRowsParams build() { + return new FlowActionBigqueryInsertRowsParams(connectionId, datasetId, tableId, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java new file mode 100644 index 000000000..1cc990a3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionClearbit.Deserializer.class) +public final class FlowActionClearbit { + private final Object value; + + private final int type; + + private FlowActionClearbit(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionClearbitFindPerson) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionClearbitFindCompany) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionClearbit && equalTo((FlowActionClearbit) other); + } + + private boolean equalTo(FlowActionClearbit other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionClearbit of(FlowActionClearbitFindPerson value) { + return new FlowActionClearbit(value, 0); + } + + public static FlowActionClearbit of(FlowActionClearbitFindCompany value) { + return new FlowActionClearbit(value, 1); + } + + public interface Visitor { + T visit(FlowActionClearbitFindPerson value); + + T visit(FlowActionClearbitFindCompany value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionClearbit.class); + } + + @java.lang.Override + public FlowActionClearbit deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionClearbitFindPerson.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionClearbitFindCompany.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java new file mode 100644 index 000000000..32dbae7f7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionClearbitFindCompany.Builder.class) +public final class FlowActionClearbitFindCompany { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionClearbitFindCompanyParams params; + + private final Map additionalProperties; + + private FlowActionClearbitFindCompany( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionClearbitFindCompanyParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "CLEARBIT"; + } + + @JsonProperty("action") + public String getAction() { + return "FIND_COMPANY"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionClearbitFindCompanyParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionClearbitFindCompany && equalTo((FlowActionClearbitFindCompany) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionClearbitFindCompany other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionClearbitFindCompany other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionClearbitFindCompanyParams params); + } + + public interface _FinalStage { + FlowActionClearbitFindCompany build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionClearbitFindCompanyParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionClearbitFindCompany other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionClearbitFindCompanyParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionClearbitFindCompany build() { + return new FlowActionClearbitFindCompany(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java new file mode 100644 index 000000000..de83605e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionClearbitFindCompanyParams.Builder.class) +public final class FlowActionClearbitFindCompanyParams { + private final String connectionId; + + private final String domain; + + private final Map additionalProperties; + + private FlowActionClearbitFindCompanyParams( + String connectionId, String domain, Map additionalProperties) { + this.connectionId = connectionId; + this.domain = domain; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionClearbitFindCompanyParams + && equalTo((FlowActionClearbitFindCompanyParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionClearbitFindCompanyParams other) { + return connectionId.equals(other.connectionId) && domain.equals(other.domain); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.domain); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + DomainStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionClearbitFindCompanyParams other); + } + + public interface DomainStage { + _FinalStage domain(@NotNull String domain); + } + + public interface _FinalStage { + FlowActionClearbitFindCompanyParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, DomainStage, _FinalStage { + private String connectionId; + + private String domain; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionClearbitFindCompanyParams other) { + connectionId(other.getConnectionId()); + domain(other.getDomain()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public DomainStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("domain") + public _FinalStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @java.lang.Override + public FlowActionClearbitFindCompanyParams build() { + return new FlowActionClearbitFindCompanyParams(connectionId, domain, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java new file mode 100644 index 000000000..ed02098c2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionClearbitFindPerson.Builder.class) +public final class FlowActionClearbitFindPerson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionClearbitFindPersonParams params; + + private final Map additionalProperties; + + private FlowActionClearbitFindPerson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionClearbitFindPersonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "CLEARBIT"; + } + + @JsonProperty("action") + public String getAction() { + return "FIND_PERSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionClearbitFindPersonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionClearbitFindPerson && equalTo((FlowActionClearbitFindPerson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionClearbitFindPerson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionClearbitFindPerson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionClearbitFindPersonParams params); + } + + public interface _FinalStage { + FlowActionClearbitFindPerson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionClearbitFindPersonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionClearbitFindPerson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionClearbitFindPersonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionClearbitFindPerson build() { + return new FlowActionClearbitFindPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java new file mode 100644 index 000000000..8c4cb50f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionClearbitFindPersonParams.Builder.class) +public final class FlowActionClearbitFindPersonParams { + private final String connectionId; + + private final String email; + + private final Map additionalProperties; + + private FlowActionClearbitFindPersonParams( + String connectionId, String email, Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionClearbitFindPersonParams + && equalTo((FlowActionClearbitFindPersonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionClearbitFindPersonParams other) { + return connectionId.equals(other.connectionId) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionClearbitFindPersonParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionClearbitFindPersonParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionClearbitFindPersonParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public FlowActionClearbitFindPersonParams build() { + return new FlowActionClearbitFindPersonParams(connectionId, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java new file mode 100644 index 000000000..d4c2ebbc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionEmailVerifyEmail.Builder.class) +public final class FlowActionEmailVerifyEmail { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionEmailVerifyEmailParams params; + + private final Map additionalProperties; + + private FlowActionEmailVerifyEmail( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionEmailVerifyEmailParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "EMAIL"; + } + + @JsonProperty("action") + public String getAction() { + return "VERIFY_EMAIL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionEmailVerifyEmailParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionEmailVerifyEmail && equalTo((FlowActionEmailVerifyEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionEmailVerifyEmail other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionEmailVerifyEmail other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionEmailVerifyEmailParams params); + } + + public interface _FinalStage { + FlowActionEmailVerifyEmail build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionEmailVerifyEmailParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionEmailVerifyEmail other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionEmailVerifyEmailParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionEmailVerifyEmail build() { + return new FlowActionEmailVerifyEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java new file mode 100644 index 000000000..8a1714450 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionEmailVerifyEmailParams.Builder.class) +public final class FlowActionEmailVerifyEmailParams { + private final String email; + + private final Optional rules; + + private final Map additionalProperties; + + private FlowActionEmailVerifyEmailParams( + String email, + Optional rules, + Map additionalProperties) { + this.email = email; + this.rules = rules; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonProperty("rules") + public Optional getRules() { + return rules; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionEmailVerifyEmailParams && equalTo((FlowActionEmailVerifyEmailParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionEmailVerifyEmailParams other) { + return email.equals(other.email) && rules.equals(other.rules); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.email, this.rules); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + + Builder from(FlowActionEmailVerifyEmailParams other); + } + + public interface _FinalStage { + FlowActionEmailVerifyEmailParams build(); + + _FinalStage rules(Optional rules); + + _FinalStage rules(FlowActionEmailVerifyEmailParamsRules rules); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + private Optional rules = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionEmailVerifyEmailParams other) { + email(other.getEmail()); + rules(other.getRules()); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage rules(FlowActionEmailVerifyEmailParamsRules rules) { + this.rules = Optional.ofNullable(rules); + return this; + } + + @java.lang.Override + @JsonSetter(value = "rules", nulls = Nulls.SKIP) + public _FinalStage rules(Optional rules) { + this.rules = rules; + return this; + } + + @java.lang.Override + public FlowActionEmailVerifyEmailParams build() { + return new FlowActionEmailVerifyEmailParams(email, rules, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java new file mode 100644 index 000000000..77655741d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionEmailVerifyEmailParamsRules.Builder.class) +public final class FlowActionEmailVerifyEmailParamsRules { + private final Optional requireMxRecord; + + private final Optional blockAliases; + + private final Optional blockFreeEmails; + + private final Optional blockDisposableEmails; + + private final Optional> blocklist; + + private final Optional> allowlist; + + private final Map additionalProperties; + + private FlowActionEmailVerifyEmailParamsRules( + Optional requireMxRecord, + Optional blockAliases, + Optional blockFreeEmails, + Optional blockDisposableEmails, + Optional> blocklist, + Optional> allowlist, + Map additionalProperties) { + this.requireMxRecord = requireMxRecord; + this.blockAliases = blockAliases; + this.blockFreeEmails = blockFreeEmails; + this.blockDisposableEmails = blockDisposableEmails; + this.blocklist = blocklist; + this.allowlist = allowlist; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("require_mx_record") + public Optional getRequireMxRecord() { + return requireMxRecord; + } + + @JsonProperty("block_aliases") + public Optional getBlockAliases() { + return blockAliases; + } + + @JsonProperty("block_free_emails") + public Optional getBlockFreeEmails() { + return blockFreeEmails; + } + + @JsonProperty("block_disposable_emails") + public Optional getBlockDisposableEmails() { + return blockDisposableEmails; + } + + @JsonProperty("blocklist") + public Optional> getBlocklist() { + return blocklist; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionEmailVerifyEmailParamsRules + && equalTo((FlowActionEmailVerifyEmailParamsRules) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionEmailVerifyEmailParamsRules other) { + return requireMxRecord.equals(other.requireMxRecord) + && blockAliases.equals(other.blockAliases) + && blockFreeEmails.equals(other.blockFreeEmails) + && blockDisposableEmails.equals(other.blockDisposableEmails) + && blocklist.equals(other.blocklist) + && allowlist.equals(other.allowlist); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requireMxRecord, + this.blockAliases, + this.blockFreeEmails, + this.blockDisposableEmails, + this.blocklist, + this.allowlist); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional requireMxRecord = Optional.empty(); + + private Optional blockAliases = Optional.empty(); + + private Optional blockFreeEmails = Optional.empty(); + + private Optional blockDisposableEmails = Optional.empty(); + + private Optional> blocklist = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionEmailVerifyEmailParamsRules other) { + requireMxRecord(other.getRequireMxRecord()); + blockAliases(other.getBlockAliases()); + blockFreeEmails(other.getBlockFreeEmails()); + blockDisposableEmails(other.getBlockDisposableEmails()); + blocklist(other.getBlocklist()); + allowlist(other.getAllowlist()); + return this; + } + + @JsonSetter(value = "require_mx_record", nulls = Nulls.SKIP) + public Builder requireMxRecord(Optional requireMxRecord) { + this.requireMxRecord = requireMxRecord; + return this; + } + + public Builder requireMxRecord(Boolean requireMxRecord) { + this.requireMxRecord = Optional.ofNullable(requireMxRecord); + return this; + } + + @JsonSetter(value = "block_aliases", nulls = Nulls.SKIP) + public Builder blockAliases(Optional blockAliases) { + this.blockAliases = blockAliases; + return this; + } + + public Builder blockAliases(Boolean blockAliases) { + this.blockAliases = Optional.ofNullable(blockAliases); + return this; + } + + @JsonSetter(value = "block_free_emails", nulls = Nulls.SKIP) + public Builder blockFreeEmails(Optional blockFreeEmails) { + this.blockFreeEmails = blockFreeEmails; + return this; + } + + public Builder blockFreeEmails(Boolean blockFreeEmails) { + this.blockFreeEmails = Optional.ofNullable(blockFreeEmails); + return this; + } + + @JsonSetter(value = "block_disposable_emails", nulls = Nulls.SKIP) + public Builder blockDisposableEmails(Optional blockDisposableEmails) { + this.blockDisposableEmails = blockDisposableEmails; + return this; + } + + public Builder blockDisposableEmails(Boolean blockDisposableEmails) { + this.blockDisposableEmails = Optional.ofNullable(blockDisposableEmails); + return this; + } + + @JsonSetter(value = "blocklist", nulls = Nulls.SKIP) + public Builder blocklist(Optional> blocklist) { + this.blocklist = blocklist; + return this; + } + + public Builder blocklist(List blocklist) { + this.blocklist = Optional.ofNullable(blocklist); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + public FlowActionEmailVerifyEmailParamsRules build() { + return new FlowActionEmailVerifyEmailParamsRules( + requireMxRecord, + blockAliases, + blockFreeEmails, + blockDisposableEmails, + blocklist, + allowlist, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java new file mode 100644 index 000000000..1b493a483 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionFlow.Deserializer.class) +public final class FlowActionFlow { + private final Object value; + + private final int type; + + private FlowActionFlow(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionFlowBooleanCondition) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionFlowDelayFlow) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionFlowDoNothing) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowActionFlowErrorMessage) this.value); + } else if (this.type == 4) { + return visitor.visit((FlowActionFlowMapValue) this.value); + } else if (this.type == 5) { + return visitor.visit((FlowActionFlowReturnJson) this.value); + } else if (this.type == 6) { + return visitor.visit((FlowActionFlowStoreVars) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlow && equalTo((FlowActionFlow) other); + } + + private boolean equalTo(FlowActionFlow other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionFlow of(FlowActionFlowBooleanCondition value) { + return new FlowActionFlow(value, 0); + } + + public static FlowActionFlow of(FlowActionFlowDelayFlow value) { + return new FlowActionFlow(value, 1); + } + + public static FlowActionFlow of(FlowActionFlowDoNothing value) { + return new FlowActionFlow(value, 2); + } + + public static FlowActionFlow of(FlowActionFlowErrorMessage value) { + return new FlowActionFlow(value, 3); + } + + public static FlowActionFlow of(FlowActionFlowMapValue value) { + return new FlowActionFlow(value, 4); + } + + public static FlowActionFlow of(FlowActionFlowReturnJson value) { + return new FlowActionFlow(value, 5); + } + + public static FlowActionFlow of(FlowActionFlowStoreVars value) { + return new FlowActionFlow(value, 6); + } + + public interface Visitor { + T visit(FlowActionFlowBooleanCondition value); + + T visit(FlowActionFlowDelayFlow value); + + T visit(FlowActionFlowDoNothing value); + + T visit(FlowActionFlowErrorMessage value); + + T visit(FlowActionFlowMapValue value); + + T visit(FlowActionFlowReturnJson value); + + T visit(FlowActionFlowStoreVars value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionFlow.class); + } + + @java.lang.Override + public FlowActionFlow deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowBooleanCondition.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowDelayFlow.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowDoNothing.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowErrorMessage.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowMapValue.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowReturnJson.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionFlowStoreVars.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java new file mode 100644 index 000000000..d89b71bf6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowBooleanCondition.Builder.class) +public final class FlowActionFlowBooleanCondition { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowBooleanConditionParams params; + + private final Map additionalProperties; + + private FlowActionFlowBooleanCondition( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowBooleanConditionParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "BOOLEAN_CONDITION"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowBooleanConditionParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowBooleanCondition && equalTo((FlowActionFlowBooleanCondition) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowBooleanCondition other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowBooleanCondition other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowBooleanConditionParams params); + } + + public interface _FinalStage { + FlowActionFlowBooleanCondition build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowBooleanConditionParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowBooleanCondition other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowBooleanConditionParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowBooleanCondition build() { + return new FlowActionFlowBooleanCondition( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java new file mode 100644 index 000000000..43db6943a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowBooleanConditionParams.Builder.class) +public final class FlowActionFlowBooleanConditionParams { + private final Optional> then; + + private final Optional> else_; + + private final Map additionalProperties; + + private FlowActionFlowBooleanConditionParams( + Optional> then, + Optional> else_, + Map additionalProperties) { + this.then = then; + this.else_ = else_; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("then") + public Optional> getThen() { + return then; + } + + @JsonProperty("else") + public Optional> getElse() { + return else_; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowBooleanConditionParams + && equalTo((FlowActionFlowBooleanConditionParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowBooleanConditionParams other) { + return then.equals(other.then) && else_.equals(other.else_); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.then, this.else_); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> then = Optional.empty(); + + private Optional> else_ = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionFlowBooleanConditionParams other) { + then(other.getThen()); + else_(other.getElse()); + return this; + } + + @JsonSetter(value = "then", nulls = Nulls.SKIP) + public Builder then(Optional> then) { + this.then = then; + return this; + } + + public Builder then(List then) { + this.then = Optional.ofNullable(then); + return this; + } + + @JsonSetter(value = "else", nulls = Nulls.SKIP) + public Builder else_(Optional> else_) { + this.else_ = else_; + return this; + } + + public Builder else_(List else_) { + this.else_ = Optional.ofNullable(else_); + return this; + } + + public FlowActionFlowBooleanConditionParams build() { + return new FlowActionFlowBooleanConditionParams(then, else_, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java new file mode 100644 index 000000000..412f9030a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowDelayFlow.Builder.class) +public final class FlowActionFlowDelayFlow { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowDelayFlowParams params; + + private final Map additionalProperties; + + private FlowActionFlowDelayFlow( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowDelayFlowParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "DELAY_FLOW"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowDelayFlowParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowDelayFlow && equalTo((FlowActionFlowDelayFlow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowDelayFlow other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowDelayFlow other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowDelayFlowParams params); + } + + public interface _FinalStage { + FlowActionFlowDelayFlow build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowDelayFlowParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowDelayFlow other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowDelayFlowParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowDelayFlow build() { + return new FlowActionFlowDelayFlow(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java new file mode 100644 index 000000000..ba1cb36c2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowDelayFlowParams.Builder.class) +public final class FlowActionFlowDelayFlowParams { + private final FlowActionFlowDelayFlowParamsNumber number; + + private final Optional units; + + private final Map additionalProperties; + + private FlowActionFlowDelayFlowParams( + FlowActionFlowDelayFlowParamsNumber number, + Optional units, + Map additionalProperties) { + this.number = number; + this.units = units; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("number") + public FlowActionFlowDelayFlowParamsNumber getNumber() { + return number; + } + + @JsonProperty("units") + public Optional getUnits() { + return units; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowDelayFlowParams && equalTo((FlowActionFlowDelayFlowParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowDelayFlowParams other) { + return number.equals(other.number) && units.equals(other.units); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.number, this.units); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NumberStage builder() { + return new Builder(); + } + + public interface NumberStage { + _FinalStage number(@NotNull FlowActionFlowDelayFlowParamsNumber number); + + Builder from(FlowActionFlowDelayFlowParams other); + } + + public interface _FinalStage { + FlowActionFlowDelayFlowParams build(); + + _FinalStage units(Optional units); + + _FinalStage units(FlowActionFlowDelayFlowParamsUnits units); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NumberStage, _FinalStage { + private FlowActionFlowDelayFlowParamsNumber number; + + private Optional units = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowDelayFlowParams other) { + number(other.getNumber()); + units(other.getUnits()); + return this; + } + + @java.lang.Override + @JsonSetter("number") + public _FinalStage number(@NotNull FlowActionFlowDelayFlowParamsNumber number) { + this.number = Objects.requireNonNull(number, "number must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage units(FlowActionFlowDelayFlowParamsUnits units) { + this.units = Optional.ofNullable(units); + return this; + } + + @java.lang.Override + @JsonSetter(value = "units", nulls = Nulls.SKIP) + public _FinalStage units(Optional units) { + this.units = units; + return this; + } + + @java.lang.Override + public FlowActionFlowDelayFlowParams build() { + return new FlowActionFlowDelayFlowParams(number, units, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java new file mode 100644 index 000000000..b552f5158 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionFlowDelayFlowParamsNumber.Deserializer.class) +public final class FlowActionFlowDelayFlowParamsNumber { + private final Object value; + + private final int type; + + private FlowActionFlowDelayFlowParamsNumber(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowDelayFlowParamsNumber + && equalTo((FlowActionFlowDelayFlowParamsNumber) other); + } + + private boolean equalTo(FlowActionFlowDelayFlowParamsNumber other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionFlowDelayFlowParamsNumber of(int value) { + return new FlowActionFlowDelayFlowParamsNumber(value, 0); + } + + public static FlowActionFlowDelayFlowParamsNumber of(String value) { + return new FlowActionFlowDelayFlowParamsNumber(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionFlowDelayFlowParamsNumber.class); + } + + @java.lang.Override + public FlowActionFlowDelayFlowParamsNumber deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsUnits.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsUnits.java new file mode 100644 index 000000000..d64396682 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsUnits.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionFlowDelayFlowParamsUnits { + public static final FlowActionFlowDelayFlowParamsUnits SECONDS = + new FlowActionFlowDelayFlowParamsUnits(Value.SECONDS, "SECONDS"); + + public static final FlowActionFlowDelayFlowParamsUnits MINUTES = + new FlowActionFlowDelayFlowParamsUnits(Value.MINUTES, "MINUTES"); + + public static final FlowActionFlowDelayFlowParamsUnits DAYS = + new FlowActionFlowDelayFlowParamsUnits(Value.DAYS, "DAYS"); + + public static final FlowActionFlowDelayFlowParamsUnits HOURS = + new FlowActionFlowDelayFlowParamsUnits(Value.HOURS, "HOURS"); + + private final Value value; + + private final String string; + + FlowActionFlowDelayFlowParamsUnits(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionFlowDelayFlowParamsUnits + && this.string.equals(((FlowActionFlowDelayFlowParamsUnits) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SECONDS: + return visitor.visitSeconds(); + case MINUTES: + return visitor.visitMinutes(); + case DAYS: + return visitor.visitDays(); + case HOURS: + return visitor.visitHours(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionFlowDelayFlowParamsUnits valueOf(String value) { + switch (value) { + case "SECONDS": + return SECONDS; + case "MINUTES": + return MINUTES; + case "DAYS": + return DAYS; + case "HOURS": + return HOURS; + default: + return new FlowActionFlowDelayFlowParamsUnits(Value.UNKNOWN, value); + } + } + + public enum Value { + SECONDS, + + MINUTES, + + HOURS, + + DAYS, + + UNKNOWN + } + + public interface Visitor { + T visitSeconds(); + + T visitMinutes(); + + T visitHours(); + + T visitDays(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothing.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothing.java new file mode 100644 index 000000000..67817a7f2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothing.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowDoNothing.Builder.class) +public final class FlowActionFlowDoNothing { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final Optional params; + + private final Map additionalProperties; + + private FlowActionFlowDoNothing( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + Optional params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "DO_NOTHING"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public Optional getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowDoNothing && equalTo((FlowActionFlowDoNothing) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowDoNothing other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(FlowActionFlowDoNothing other); + } + + public interface _FinalStage { + FlowActionFlowDoNothing build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + + _FinalStage params(Optional params); + + _FinalStage params(FlowActionFlowDoNothingParams params); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional params = Optional.empty(); + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowDoNothing other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage params(FlowActionFlowDoNothingParams params) { + this.params = Optional.ofNullable(params); + return this; + } + + @java.lang.Override + @JsonSetter(value = "params", nulls = Nulls.SKIP) + public _FinalStage params(Optional params) { + this.params = params; + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowDoNothing build() { + return new FlowActionFlowDoNothing(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java new file mode 100644 index 000000000..35a08cb41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowDoNothingParams.Builder.class) +public final class FlowActionFlowDoNothingParams { + private final Map additionalProperties; + + private FlowActionFlowDoNothingParams(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowDoNothingParams; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionFlowDoNothingParams other) { + return this; + } + + public FlowActionFlowDoNothingParams build() { + return new FlowActionFlowDoNothingParams(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java new file mode 100644 index 000000000..21366736d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowErrorMessage.Builder.class) +public final class FlowActionFlowErrorMessage { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowErrorMessageParams params; + + private final Map additionalProperties; + + private FlowActionFlowErrorMessage( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowErrorMessageParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "ERROR_MESSAGE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowErrorMessageParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowErrorMessage && equalTo((FlowActionFlowErrorMessage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowErrorMessage other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowErrorMessage other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowErrorMessageParams params); + } + + public interface _FinalStage { + FlowActionFlowErrorMessage build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowErrorMessageParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowErrorMessage other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowErrorMessageParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowErrorMessage build() { + return new FlowActionFlowErrorMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java new file mode 100644 index 000000000..0628fae3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowErrorMessageParams.Builder.class) +public final class FlowActionFlowErrorMessageParams { + private final String message; + + private final Map additionalProperties; + + private FlowActionFlowErrorMessageParams(String message, Map additionalProperties) { + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowErrorMessageParams && equalTo((FlowActionFlowErrorMessageParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowErrorMessageParams other) { + return message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MessageStage builder() { + return new Builder(); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + + Builder from(FlowActionFlowErrorMessageParams other); + } + + public interface _FinalStage { + FlowActionFlowErrorMessageParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MessageStage, _FinalStage { + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowErrorMessageParams other) { + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public FlowActionFlowErrorMessageParams build() { + return new FlowActionFlowErrorMessageParams(message, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java new file mode 100644 index 000000000..1f179c174 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowMapValue.Builder.class) +public final class FlowActionFlowMapValue { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowMapValueParams params; + + private final Map additionalProperties; + + private FlowActionFlowMapValue( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowMapValueParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "MAP_VALUE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowMapValueParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowMapValue && equalTo((FlowActionFlowMapValue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowMapValue other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowMapValue other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowMapValueParams params); + } + + public interface _FinalStage { + FlowActionFlowMapValue build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowMapValueParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowMapValue other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowMapValueParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowMapValue build() { + return new FlowActionFlowMapValue(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java new file mode 100644 index 000000000..850feaf73 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowMapValueParams.Builder.class) +public final class FlowActionFlowMapValueParams { + private final FlowActionFlowMapValueParamsInput input; + + private final Optional> cases; + + private final Optional fallback; + + private final Map additionalProperties; + + private FlowActionFlowMapValueParams( + FlowActionFlowMapValueParamsInput input, + Optional> cases, + Optional fallback, + Map additionalProperties) { + this.input = input; + this.cases = cases; + this.fallback = fallback; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("input") + public FlowActionFlowMapValueParamsInput getInput() { + return input; + } + + @JsonProperty("cases") + public Optional> getCases() { + return cases; + } + + @JsonProperty("fallback") + public Optional getFallback() { + return fallback; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowMapValueParams && equalTo((FlowActionFlowMapValueParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowMapValueParams other) { + return input.equals(other.input) && cases.equals(other.cases) && fallback.equals(other.fallback); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.input, this.cases, this.fallback); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static InputStage builder() { + return new Builder(); + } + + public interface InputStage { + _FinalStage input(@NotNull FlowActionFlowMapValueParamsInput input); + + Builder from(FlowActionFlowMapValueParams other); + } + + public interface _FinalStage { + FlowActionFlowMapValueParams build(); + + _FinalStage cases(Optional> cases); + + _FinalStage cases(Map cases); + + _FinalStage fallback(Optional fallback); + + _FinalStage fallback(FlowActionFlowMapValueParamsFallback fallback); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements InputStage, _FinalStage { + private FlowActionFlowMapValueParamsInput input; + + private Optional fallback = Optional.empty(); + + private Optional> cases = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowMapValueParams other) { + input(other.getInput()); + cases(other.getCases()); + fallback(other.getFallback()); + return this; + } + + @java.lang.Override + @JsonSetter("input") + public _FinalStage input(@NotNull FlowActionFlowMapValueParamsInput input) { + this.input = Objects.requireNonNull(input, "input must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fallback(FlowActionFlowMapValueParamsFallback fallback) { + this.fallback = Optional.ofNullable(fallback); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fallback", nulls = Nulls.SKIP) + public _FinalStage fallback(Optional fallback) { + this.fallback = fallback; + return this; + } + + @java.lang.Override + public _FinalStage cases(Map cases) { + this.cases = Optional.ofNullable(cases); + return this; + } + + @java.lang.Override + @JsonSetter(value = "cases", nulls = Nulls.SKIP) + public _FinalStage cases(Optional> cases) { + this.cases = cases; + return this; + } + + @java.lang.Override + public FlowActionFlowMapValueParams build() { + return new FlowActionFlowMapValueParams(input, cases, fallback, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java new file mode 100644 index 000000000..48a01b9d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionFlowMapValueParamsFallback.Deserializer.class) +public final class FlowActionFlowMapValueParamsFallback { + private final Object value; + + private final int type; + + private FlowActionFlowMapValueParamsFallback(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } else if (this.type == 2) { + return visitor.visit((Map) this.value); + } else if (this.type == 3) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowMapValueParamsFallback + && equalTo((FlowActionFlowMapValueParamsFallback) other); + } + + private boolean equalTo(FlowActionFlowMapValueParamsFallback other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionFlowMapValueParamsFallback of(String value) { + return new FlowActionFlowMapValueParamsFallback(value, 0); + } + + public static FlowActionFlowMapValueParamsFallback of(double value) { + return new FlowActionFlowMapValueParamsFallback(value, 1); + } + + public static FlowActionFlowMapValueParamsFallback of(Map value) { + return new FlowActionFlowMapValueParamsFallback(value, 2); + } + + public static FlowActionFlowMapValueParamsFallback of(List value) { + return new FlowActionFlowMapValueParamsFallback(value, 3); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + + T visit(Map value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionFlowMapValueParamsFallback.class); + } + + @java.lang.Override + public FlowActionFlowMapValueParamsFallback deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsInput.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsInput.java new file mode 100644 index 000000000..da6cdaaba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsInput.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionFlowMapValueParamsInput.Deserializer.class) +public final class FlowActionFlowMapValueParamsInput { + private final Object value; + + private final int type; + + private FlowActionFlowMapValueParamsInput(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowMapValueParamsInput && equalTo((FlowActionFlowMapValueParamsInput) other); + } + + private boolean equalTo(FlowActionFlowMapValueParamsInput other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionFlowMapValueParamsInput of(String value) { + return new FlowActionFlowMapValueParamsInput(value, 0); + } + + public static FlowActionFlowMapValueParamsInput of(double value) { + return new FlowActionFlowMapValueParamsInput(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionFlowMapValueParamsInput.class); + } + + @java.lang.Override + public FlowActionFlowMapValueParamsInput deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJson.java new file mode 100644 index 000000000..53dab7fa4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowReturnJson.Builder.class) +public final class FlowActionFlowReturnJson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowReturnJsonParams params; + + private final Map additionalProperties; + + private FlowActionFlowReturnJson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowReturnJsonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "RETURN_JSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowReturnJsonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowReturnJson && equalTo((FlowActionFlowReturnJson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowReturnJson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowReturnJson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowReturnJsonParams params); + } + + public interface _FinalStage { + FlowActionFlowReturnJson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowReturnJsonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowReturnJson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowReturnJsonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowReturnJson build() { + return new FlowActionFlowReturnJson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java new file mode 100644 index 000000000..c80f080fe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowReturnJsonParams.Builder.class) +public final class FlowActionFlowReturnJsonParams { + private final FlowActionFlowReturnJsonParamsPayload payload; + + private final Map additionalProperties; + + private FlowActionFlowReturnJsonParams( + FlowActionFlowReturnJsonParamsPayload payload, Map additionalProperties) { + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("payload") + public FlowActionFlowReturnJsonParamsPayload getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowReturnJsonParams && equalTo((FlowActionFlowReturnJsonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowReturnJsonParams other) { + return payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PayloadStage builder() { + return new Builder(); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull FlowActionFlowReturnJsonParamsPayload payload); + + Builder from(FlowActionFlowReturnJsonParams other); + } + + public interface _FinalStage { + FlowActionFlowReturnJsonParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PayloadStage, _FinalStage { + private FlowActionFlowReturnJsonParamsPayload payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowReturnJsonParams other) { + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull FlowActionFlowReturnJsonParamsPayload payload) { + this.payload = Objects.requireNonNull(payload, "payload must not be null"); + return this; + } + + @java.lang.Override + public FlowActionFlowReturnJsonParams build() { + return new FlowActionFlowReturnJsonParams(payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java new file mode 100644 index 000000000..098c68e40 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionFlowReturnJsonParamsPayload.Deserializer.class) +public final class FlowActionFlowReturnJsonParamsPayload { + private final Object value; + + private final int type; + + private FlowActionFlowReturnJsonParamsPayload(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((Map) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowReturnJsonParamsPayload + && equalTo((FlowActionFlowReturnJsonParamsPayload) other); + } + + private boolean equalTo(FlowActionFlowReturnJsonParamsPayload other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionFlowReturnJsonParamsPayload of(Map value) { + return new FlowActionFlowReturnJsonParamsPayload(value, 0); + } + + public static FlowActionFlowReturnJsonParamsPayload of(String value) { + return new FlowActionFlowReturnJsonParamsPayload(value, 1); + } + + public interface Visitor { + T visit(Map value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionFlowReturnJsonParamsPayload.class); + } + + @java.lang.Override + public FlowActionFlowReturnJsonParamsPayload deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVars.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVars.java new file mode 100644 index 000000000..1ae11bb5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVars.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowStoreVars.Builder.class) +public final class FlowActionFlowStoreVars { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionFlowStoreVarsParams params; + + private final Map additionalProperties; + + private FlowActionFlowStoreVars( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionFlowStoreVarsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "FLOW"; + } + + @JsonProperty("action") + public String getAction() { + return "STORE_VARS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionFlowStoreVarsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowStoreVars && equalTo((FlowActionFlowStoreVars) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowStoreVars other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionFlowStoreVars other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionFlowStoreVarsParams params); + } + + public interface _FinalStage { + FlowActionFlowStoreVars build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionFlowStoreVarsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionFlowStoreVars other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionFlowStoreVarsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionFlowStoreVars build() { + return new FlowActionFlowStoreVars(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java new file mode 100644 index 000000000..41ccaa29f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionFlowStoreVarsParams.Builder.class) +public final class FlowActionFlowStoreVarsParams { + private final Map vars; + + private final Map additionalProperties; + + private FlowActionFlowStoreVarsParams(Map vars, Map additionalProperties) { + this.vars = vars; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("vars") + public Map getVars() { + return vars; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionFlowStoreVarsParams && equalTo((FlowActionFlowStoreVarsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionFlowStoreVarsParams other) { + return vars.equals(other.vars); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.vars); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map vars = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionFlowStoreVarsParams other) { + vars(other.getVars()); + return this; + } + + @JsonSetter(value = "vars", nulls = Nulls.SKIP) + public Builder vars(Map vars) { + this.vars.clear(); + if (vars != null) { + this.vars.putAll(vars); + } + return this; + } + + public Builder putAllVars(Map vars) { + if (vars != null) { + this.vars.putAll(vars); + } + return this; + } + + public Builder vars(String key, Object value) { + this.vars.put(key, value); + return this; + } + + public FlowActionFlowStoreVarsParams build() { + return new FlowActionFlowStoreVarsParams(vars, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java new file mode 100644 index 000000000..1f2612825 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionGoogleSheetsAddRow.Builder.class) +public final class FlowActionGoogleSheetsAddRow { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionGoogleSheetsAddRowParams params; + + private final Map additionalProperties; + + private FlowActionGoogleSheetsAddRow( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionGoogleSheetsAddRowParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "GOOGLE_SHEETS"; + } + + @JsonProperty("action") + public String getAction() { + return "ADD_ROW"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionGoogleSheetsAddRowParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionGoogleSheetsAddRow && equalTo((FlowActionGoogleSheetsAddRow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionGoogleSheetsAddRow other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionGoogleSheetsAddRow other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionGoogleSheetsAddRowParams params); + } + + public interface _FinalStage { + FlowActionGoogleSheetsAddRow build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionGoogleSheetsAddRowParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionGoogleSheetsAddRow other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionGoogleSheetsAddRowParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionGoogleSheetsAddRow build() { + return new FlowActionGoogleSheetsAddRow(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java new file mode 100644 index 000000000..38924b194 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionGoogleSheetsAddRowParams.Builder.class) +public final class FlowActionGoogleSheetsAddRowParams { + private final String connectionId; + + private final String spreadsheetId; + + private final Optional sheetId; + + private final Optional>> values; + + private final Map additionalProperties; + + private FlowActionGoogleSheetsAddRowParams( + String connectionId, + String spreadsheetId, + Optional sheetId, + Optional>> values, + Map additionalProperties) { + this.connectionId = connectionId; + this.spreadsheetId = spreadsheetId; + this.sheetId = sheetId; + this.values = values; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("spreadsheet_id") + public String getSpreadsheetId() { + return spreadsheetId; + } + + @JsonProperty("sheet_id") + public Optional getSheetId() { + return sheetId; + } + + @JsonProperty("values") + public Optional>> getValues() { + return values; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionGoogleSheetsAddRowParams + && equalTo((FlowActionGoogleSheetsAddRowParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionGoogleSheetsAddRowParams other) { + return connectionId.equals(other.connectionId) + && spreadsheetId.equals(other.spreadsheetId) + && sheetId.equals(other.sheetId) + && values.equals(other.values); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.spreadsheetId, this.sheetId, this.values); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + SpreadsheetIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionGoogleSheetsAddRowParams other); + } + + public interface SpreadsheetIdStage { + _FinalStage spreadsheetId(@NotNull String spreadsheetId); + } + + public interface _FinalStage { + FlowActionGoogleSheetsAddRowParams build(); + + _FinalStage sheetId(Optional sheetId); + + _FinalStage sheetId(FlowActionGoogleSheetsAddRowParamsSheetId sheetId); + + _FinalStage values(Optional>> values); + + _FinalStage values(List> values); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, SpreadsheetIdStage, _FinalStage { + private String connectionId; + + private String spreadsheetId; + + private Optional>> values = Optional.empty(); + + private Optional sheetId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionGoogleSheetsAddRowParams other) { + connectionId(other.getConnectionId()); + spreadsheetId(other.getSpreadsheetId()); + sheetId(other.getSheetId()); + values(other.getValues()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public SpreadsheetIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("spreadsheet_id") + public _FinalStage spreadsheetId(@NotNull String spreadsheetId) { + this.spreadsheetId = Objects.requireNonNull(spreadsheetId, "spreadsheetId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage values(List> values) { + this.values = Optional.ofNullable(values); + return this; + } + + @java.lang.Override + @JsonSetter(value = "values", nulls = Nulls.SKIP) + public _FinalStage values(Optional>> values) { + this.values = values; + return this; + } + + @java.lang.Override + public _FinalStage sheetId(FlowActionGoogleSheetsAddRowParamsSheetId sheetId) { + this.sheetId = Optional.ofNullable(sheetId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sheet_id", nulls = Nulls.SKIP) + public _FinalStage sheetId(Optional sheetId) { + this.sheetId = sheetId; + return this; + } + + @java.lang.Override + public FlowActionGoogleSheetsAddRowParams build() { + return new FlowActionGoogleSheetsAddRowParams( + connectionId, spreadsheetId, sheetId, values, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java new file mode 100644 index 000000000..f7e4f5065 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionGoogleSheetsAddRowParamsSheetId.Deserializer.class) +public final class FlowActionGoogleSheetsAddRowParamsSheetId { + private final Object value; + + private final int type; + + private FlowActionGoogleSheetsAddRowParamsSheetId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionGoogleSheetsAddRowParamsSheetId + && equalTo((FlowActionGoogleSheetsAddRowParamsSheetId) other); + } + + private boolean equalTo(FlowActionGoogleSheetsAddRowParamsSheetId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionGoogleSheetsAddRowParamsSheetId of(int value) { + return new FlowActionGoogleSheetsAddRowParamsSheetId(value, 0); + } + + public static FlowActionGoogleSheetsAddRowParamsSheetId of(String value) { + return new FlowActionGoogleSheetsAddRowParamsSheetId(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionGoogleSheetsAddRowParamsSheetId.class); + } + + @java.lang.Override + public FlowActionGoogleSheetsAddRowParamsSheetId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequest.java new file mode 100644 index 000000000..1f21ad8b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHttpSendRequest.Builder.class) +public final class FlowActionHttpSendRequest { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionHttpSendRequestParams params; + + private final Map additionalProperties; + + private FlowActionHttpSendRequest( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionHttpSendRequestParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "HTTP"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_REQUEST"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionHttpSendRequestParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHttpSendRequest && equalTo((FlowActionHttpSendRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHttpSendRequest other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionHttpSendRequest other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionHttpSendRequestParams params); + } + + public interface _FinalStage { + FlowActionHttpSendRequest build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionHttpSendRequestParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHttpSendRequest other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionHttpSendRequestParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionHttpSendRequest build() { + return new FlowActionHttpSendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java new file mode 100644 index 000000000..34b03b5e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java @@ -0,0 +1,325 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHttpSendRequestParams.Builder.class) +public final class FlowActionHttpSendRequestParams { + private final Optional connectionId; + + private final String url; + + private final Optional method; + + private final Optional> headers; + + private final Optional basic; + + private final Optional> params; + + private final Optional payload; + + private final Optional contentType; + + private final Map additionalProperties; + + private FlowActionHttpSendRequestParams( + Optional connectionId, + String url, + Optional method, + Optional> headers, + Optional basic, + Optional> params, + Optional payload, + Optional contentType, + Map additionalProperties) { + this.connectionId = connectionId; + this.url = url; + this.method = method; + this.headers = headers; + this.basic = basic; + this.params = params; + this.payload = payload; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("basic") + public Optional getBasic() { + return basic; + } + + @JsonProperty("params") + public Optional> getParams() { + return params; + } + + @JsonProperty("payload") + public Optional getPayload() { + return payload; + } + + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHttpSendRequestParams && equalTo((FlowActionHttpSendRequestParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHttpSendRequestParams other) { + return connectionId.equals(other.connectionId) + && url.equals(other.url) + && method.equals(other.method) + && headers.equals(other.headers) + && basic.equals(other.basic) + && params.equals(other.params) + && payload.equals(other.payload) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.url, + this.method, + this.headers, + this.basic, + this.params, + this.payload, + this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + _FinalStage url(@NotNull String url); + + Builder from(FlowActionHttpSendRequestParams other); + } + + public interface _FinalStage { + FlowActionHttpSendRequestParams build(); + + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + + _FinalStage method(Optional method); + + _FinalStage method(FlowActionHttpSendRequestParamsMethod method); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage basic(Optional basic); + + _FinalStage basic(FlowActionHttpSendRequestParamsBasicAuth basic); + + _FinalStage params(Optional> params); + + _FinalStage params(Map params); + + _FinalStage payload(Optional payload); + + _FinalStage payload(FlowActionHttpSendRequestParamsPayload payload); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(FlowActionHttpSendRequestParamsContentType contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, _FinalStage { + private String url; + + private Optional contentType = Optional.empty(); + + private Optional payload = Optional.empty(); + + private Optional> params = Optional.empty(); + + private Optional basic = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHttpSendRequestParams other) { + connectionId(other.getConnectionId()); + url(other.getUrl()); + method(other.getMethod()); + headers(other.getHeaders()); + basic(other.getBasic()); + params(other.getParams()); + payload(other.getPayload()); + contentType(other.getContentType()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public _FinalStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage contentType(FlowActionHttpSendRequestParamsContentType contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + @java.lang.Override + public _FinalStage payload(FlowActionHttpSendRequestParamsPayload payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Optional payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public _FinalStage params(Map params) { + this.params = Optional.ofNullable(params); + return this; + } + + @java.lang.Override + @JsonSetter(value = "params", nulls = Nulls.SKIP) + public _FinalStage params(Optional> params) { + this.params = params; + return this; + } + + @java.lang.Override + public _FinalStage basic(FlowActionHttpSendRequestParamsBasicAuth basic) { + this.basic = Optional.ofNullable(basic); + return this; + } + + @java.lang.Override + @JsonSetter(value = "basic", nulls = Nulls.SKIP) + public _FinalStage basic(Optional basic) { + this.basic = basic; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage method(FlowActionHttpSendRequestParamsMethod method) { + this.method = Optional.ofNullable(method); + return this; + } + + @java.lang.Override + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public _FinalStage method(Optional method) { + this.method = method; + return this; + } + + @java.lang.Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + @java.lang.Override + public FlowActionHttpSendRequestParams build() { + return new FlowActionHttpSendRequestParams( + connectionId, url, method, headers, basic, params, payload, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java new file mode 100644 index 000000000..fae9be90b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHttpSendRequestParamsBasicAuth.Builder.class) +public final class FlowActionHttpSendRequestParamsBasicAuth { + private final Optional username; + + private final Optional password; + + private final Map additionalProperties; + + private FlowActionHttpSendRequestParamsBasicAuth( + Optional username, Optional password, Map additionalProperties) { + this.username = username; + this.password = password; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + @JsonProperty("password") + public Optional getPassword() { + return password; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHttpSendRequestParamsBasicAuth + && equalTo((FlowActionHttpSendRequestParamsBasicAuth) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHttpSendRequestParamsBasicAuth other) { + return username.equals(other.username) && password.equals(other.password); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.username, this.password); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional username = Optional.empty(); + + private Optional password = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionHttpSendRequestParamsBasicAuth other) { + username(other.getUsername()); + password(other.getPassword()); + return this; + } + + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public Builder password(Optional password) { + this.password = password; + return this; + } + + public Builder password(String password) { + this.password = Optional.ofNullable(password); + return this; + } + + public FlowActionHttpSendRequestParamsBasicAuth build() { + return new FlowActionHttpSendRequestParamsBasicAuth(username, password, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java new file mode 100644 index 000000000..f612ad7a8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionHttpSendRequestParamsContentType { + public static final FlowActionHttpSendRequestParamsContentType FORM = + new FlowActionHttpSendRequestParamsContentType(Value.FORM, "FORM"); + + public static final FlowActionHttpSendRequestParamsContentType XML = + new FlowActionHttpSendRequestParamsContentType(Value.XML, "XML"); + + public static final FlowActionHttpSendRequestParamsContentType JSON = + new FlowActionHttpSendRequestParamsContentType(Value.JSON, "JSON"); + + private final Value value; + + private final String string; + + FlowActionHttpSendRequestParamsContentType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionHttpSendRequestParamsContentType + && this.string.equals(((FlowActionHttpSendRequestParamsContentType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FORM: + return visitor.visitForm(); + case XML: + return visitor.visitXml(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionHttpSendRequestParamsContentType valueOf(String value) { + switch (value) { + case "FORM": + return FORM; + case "XML": + return XML; + case "JSON": + return JSON; + default: + return new FlowActionHttpSendRequestParamsContentType(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + FORM, + + XML, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitForm(); + + T visitXml(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java new file mode 100644 index 000000000..63fda3fa3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionHttpSendRequestParamsMethod { + public static final FlowActionHttpSendRequestParamsMethod PATCH = + new FlowActionHttpSendRequestParamsMethod(Value.PATCH, "PATCH"); + + public static final FlowActionHttpSendRequestParamsMethod DELETE = + new FlowActionHttpSendRequestParamsMethod(Value.DELETE, "DELETE"); + + public static final FlowActionHttpSendRequestParamsMethod GET = + new FlowActionHttpSendRequestParamsMethod(Value.GET, "GET"); + + public static final FlowActionHttpSendRequestParamsMethod PUT = + new FlowActionHttpSendRequestParamsMethod(Value.PUT, "PUT"); + + public static final FlowActionHttpSendRequestParamsMethod POST = + new FlowActionHttpSendRequestParamsMethod(Value.POST, "POST"); + + private final Value value; + + private final String string; + + FlowActionHttpSendRequestParamsMethod(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionHttpSendRequestParamsMethod + && this.string.equals(((FlowActionHttpSendRequestParamsMethod) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PATCH: + return visitor.visitPatch(); + case DELETE: + return visitor.visitDelete(); + case GET: + return visitor.visitGet(); + case PUT: + return visitor.visitPut(); + case POST: + return visitor.visitPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionHttpSendRequestParamsMethod valueOf(String value) { + switch (value) { + case "PATCH": + return PATCH; + case "DELETE": + return DELETE; + case "GET": + return GET; + case "PUT": + return PUT; + case "POST": + return POST; + default: + return new FlowActionHttpSendRequestParamsMethod(Value.UNKNOWN, value); + } + } + + public enum Value { + GET, + + POST, + + PUT, + + PATCH, + + DELETE, + + UNKNOWN + } + + public interface Visitor { + T visitGet(); + + T visitPost(); + + T visitPut(); + + T visitPatch(); + + T visitDelete(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java new file mode 100644 index 000000000..1e96478b4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionHttpSendRequestParamsPayload.Deserializer.class) +public final class FlowActionHttpSendRequestParamsPayload { + private final Object value; + + private final int type; + + private FlowActionHttpSendRequestParamsPayload(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } else if (this.type == 2) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHttpSendRequestParamsPayload + && equalTo((FlowActionHttpSendRequestParamsPayload) other); + } + + private boolean equalTo(FlowActionHttpSendRequestParamsPayload other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionHttpSendRequestParamsPayload of(String value) { + return new FlowActionHttpSendRequestParamsPayload(value, 0); + } + + public static FlowActionHttpSendRequestParamsPayload of(List value) { + return new FlowActionHttpSendRequestParamsPayload(value, 1); + } + + public static FlowActionHttpSendRequestParamsPayload of(Map value) { + return new FlowActionHttpSendRequestParamsPayload(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionHttpSendRequestParamsPayload.class); + } + + @java.lang.Override + public FlowActionHttpSendRequestParamsPayload deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java new file mode 100644 index 000000000..769407858 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionHubspot.Deserializer.class) +public final class FlowActionHubspot { + private final Object value; + + private final int type; + + private FlowActionHubspot(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionHubspotEnrollContact) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionHubspotGetContact) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionHubspotUpsertContact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspot && equalTo((FlowActionHubspot) other); + } + + private boolean equalTo(FlowActionHubspot other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionHubspot of(FlowActionHubspotEnrollContact value) { + return new FlowActionHubspot(value, 0); + } + + public static FlowActionHubspot of(FlowActionHubspotGetContact value) { + return new FlowActionHubspot(value, 1); + } + + public static FlowActionHubspot of(FlowActionHubspotUpsertContact value) { + return new FlowActionHubspot(value, 2); + } + + public interface Visitor { + T visit(FlowActionHubspotEnrollContact value); + + T visit(FlowActionHubspotGetContact value); + + T visit(FlowActionHubspotUpsertContact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionHubspot.class); + } + + @java.lang.Override + public FlowActionHubspot deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionHubspotEnrollContact.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionHubspotGetContact.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionHubspotUpsertContact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java new file mode 100644 index 000000000..b688e5d73 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotEnrollContact.Builder.class) +public final class FlowActionHubspotEnrollContact { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionHubspotEnrollContactParams params; + + private final Map additionalProperties; + + private FlowActionHubspotEnrollContact( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionHubspotEnrollContactParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "HUBSPOT"; + } + + @JsonProperty("action") + public String getAction() { + return "ENROLL_CONTACT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionHubspotEnrollContactParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotEnrollContact && equalTo((FlowActionHubspotEnrollContact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotEnrollContact other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionHubspotEnrollContact other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionHubspotEnrollContactParams params); + } + + public interface _FinalStage { + FlowActionHubspotEnrollContact build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionHubspotEnrollContactParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotEnrollContact other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionHubspotEnrollContactParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionHubspotEnrollContact build() { + return new FlowActionHubspotEnrollContact( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java new file mode 100644 index 000000000..aa2769440 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotEnrollContactParams.Builder.class) +public final class FlowActionHubspotEnrollContactParams { + private final String connectionId; + + private final String email; + + private final FlowActionHubspotEnrollContactParamsWorkflowId workflowId; + + private final Map additionalProperties; + + private FlowActionHubspotEnrollContactParams( + String connectionId, + String email, + FlowActionHubspotEnrollContactParamsWorkflowId workflowId, + Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.workflowId = workflowId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonProperty("workflow_id") + public FlowActionHubspotEnrollContactParamsWorkflowId getWorkflowId() { + return workflowId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotEnrollContactParams + && equalTo((FlowActionHubspotEnrollContactParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotEnrollContactParams other) { + return connectionId.equals(other.connectionId) + && email.equals(other.email) + && workflowId.equals(other.workflowId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email, this.workflowId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionHubspotEnrollContactParams other); + } + + public interface EmailStage { + WorkflowIdStage email(@NotNull String email); + } + + public interface WorkflowIdStage { + _FinalStage workflowId(@NotNull FlowActionHubspotEnrollContactParamsWorkflowId workflowId); + } + + public interface _FinalStage { + FlowActionHubspotEnrollContactParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, WorkflowIdStage, _FinalStage { + private String connectionId; + + private String email; + + private FlowActionHubspotEnrollContactParamsWorkflowId workflowId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotEnrollContactParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + workflowId(other.getWorkflowId()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public WorkflowIdStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("workflow_id") + public _FinalStage workflowId(@NotNull FlowActionHubspotEnrollContactParamsWorkflowId workflowId) { + this.workflowId = Objects.requireNonNull(workflowId, "workflowId must not be null"); + return this; + } + + @java.lang.Override + public FlowActionHubspotEnrollContactParams build() { + return new FlowActionHubspotEnrollContactParams(connectionId, email, workflowId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java new file mode 100644 index 000000000..bcd188307 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionHubspotEnrollContactParamsWorkflowId.Deserializer.class) +public final class FlowActionHubspotEnrollContactParamsWorkflowId { + private final Object value; + + private final int type; + + private FlowActionHubspotEnrollContactParamsWorkflowId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((int) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotEnrollContactParamsWorkflowId + && equalTo((FlowActionHubspotEnrollContactParamsWorkflowId) other); + } + + private boolean equalTo(FlowActionHubspotEnrollContactParamsWorkflowId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionHubspotEnrollContactParamsWorkflowId of(String value) { + return new FlowActionHubspotEnrollContactParamsWorkflowId(value, 0); + } + + public static FlowActionHubspotEnrollContactParamsWorkflowId of(int value) { + return new FlowActionHubspotEnrollContactParamsWorkflowId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(int value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionHubspotEnrollContactParamsWorkflowId.class); + } + + @java.lang.Override + public FlowActionHubspotEnrollContactParamsWorkflowId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Integer) { + return of((Integer) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContact.java new file mode 100644 index 000000000..90b1bf063 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContact.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotGetContact.Builder.class) +public final class FlowActionHubspotGetContact { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionHubspotGetContactParams params; + + private final Map additionalProperties; + + private FlowActionHubspotGetContact( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionHubspotGetContactParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "HUBSPOT"; + } + + @JsonProperty("action") + public String getAction() { + return "GET_CONTACT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionHubspotGetContactParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotGetContact && equalTo((FlowActionHubspotGetContact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotGetContact other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionHubspotGetContact other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionHubspotGetContactParams params); + } + + public interface _FinalStage { + FlowActionHubspotGetContact build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionHubspotGetContactParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotGetContact other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionHubspotGetContactParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionHubspotGetContact build() { + return new FlowActionHubspotGetContact(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java new file mode 100644 index 000000000..40b575938 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotGetContactParams.Builder.class) +public final class FlowActionHubspotGetContactParams { + private final String connectionId; + + private final String email; + + private final Map additionalProperties; + + private FlowActionHubspotGetContactParams( + String connectionId, String email, Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotGetContactParams && equalTo((FlowActionHubspotGetContactParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotGetContactParams other) { + return connectionId.equals(other.connectionId) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionHubspotGetContactParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionHubspotGetContactParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotGetContactParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public FlowActionHubspotGetContactParams build() { + return new FlowActionHubspotGetContactParams(connectionId, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java new file mode 100644 index 000000000..2b51e4da8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotUpsertContact.Builder.class) +public final class FlowActionHubspotUpsertContact { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionHubspotUpsertContactParams params; + + private final Map additionalProperties; + + private FlowActionHubspotUpsertContact( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionHubspotUpsertContactParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "HUBSPOT"; + } + + @JsonProperty("action") + public String getAction() { + return "UPSERT_CONTACT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionHubspotUpsertContactParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotUpsertContact && equalTo((FlowActionHubspotUpsertContact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotUpsertContact other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionHubspotUpsertContact other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionHubspotUpsertContactParams params); + } + + public interface _FinalStage { + FlowActionHubspotUpsertContact build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionHubspotUpsertContactParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotUpsertContact other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionHubspotUpsertContactParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionHubspotUpsertContact build() { + return new FlowActionHubspotUpsertContact( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java new file mode 100644 index 000000000..8546cd868 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotUpsertContactParams.Builder.class) +public final class FlowActionHubspotUpsertContactParams { + private final String connectionId; + + private final String email; + + private final Optional> properties; + + private final Map additionalProperties; + + private FlowActionHubspotUpsertContactParams( + String connectionId, + String email, + Optional> properties, + Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.properties = properties; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonProperty("properties") + public Optional> getProperties() { + return properties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotUpsertContactParams + && equalTo((FlowActionHubspotUpsertContactParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotUpsertContactParams other) { + return connectionId.equals(other.connectionId) + && email.equals(other.email) + && properties.equals(other.properties); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email, this.properties); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionHubspotUpsertContactParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionHubspotUpsertContactParams build(); + + _FinalStage properties(Optional> properties); + + _FinalStage properties(List properties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + private Optional> properties = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotUpsertContactParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + properties(other.getProperties()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage properties(List properties) { + this.properties = Optional.ofNullable(properties); + return this; + } + + @java.lang.Override + @JsonSetter(value = "properties", nulls = Nulls.SKIP) + public _FinalStage properties(Optional> properties) { + this.properties = properties; + return this; + } + + @java.lang.Override + public FlowActionHubspotUpsertContactParams build() { + return new FlowActionHubspotUpsertContactParams(connectionId, email, properties, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java new file mode 100644 index 000000000..bb07959cb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionHubspotUpsertContactParamsProperty.Builder.class) +public final class FlowActionHubspotUpsertContactParamsProperty { + private final String property; + + private final Map additionalProperties; + + private FlowActionHubspotUpsertContactParamsProperty(String property, Map additionalProperties) { + this.property = property; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("property") + public String getProperty() { + return property; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHubspotUpsertContactParamsProperty + && equalTo((FlowActionHubspotUpsertContactParamsProperty) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionHubspotUpsertContactParamsProperty other) { + return property.equals(other.property); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.property); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PropertyStage builder() { + return new Builder(); + } + + public interface PropertyStage { + _FinalStage property(@NotNull String property); + + Builder from(FlowActionHubspotUpsertContactParamsProperty other); + } + + public interface _FinalStage { + FlowActionHubspotUpsertContactParamsProperty build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PropertyStage, _FinalStage { + private String property; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionHubspotUpsertContactParamsProperty other) { + property(other.getProperty()); + return this; + } + + @java.lang.Override + @JsonSetter("property") + public _FinalStage property(@NotNull String property) { + this.property = Objects.requireNonNull(property, "property must not be null"); + return this; + } + + @java.lang.Override + public FlowActionHubspotUpsertContactParamsProperty build() { + return new FlowActionHubspotUpsertContactParamsProperty(property, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java new file mode 100644 index 000000000..5d6e9ce3a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionJson.Deserializer.class) +public final class FlowActionJson { + private final Object value; + + private final int type; + + private FlowActionJson(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionJsonCreateJson) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionJsonParseJson) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionJsonSerializeJson) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJson && equalTo((FlowActionJson) other); + } + + private boolean equalTo(FlowActionJson other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionJson of(FlowActionJsonCreateJson value) { + return new FlowActionJson(value, 0); + } + + public static FlowActionJson of(FlowActionJsonParseJson value) { + return new FlowActionJson(value, 1); + } + + public static FlowActionJson of(FlowActionJsonSerializeJson value) { + return new FlowActionJson(value, 2); + } + + public interface Visitor { + T visit(FlowActionJsonCreateJson value); + + T visit(FlowActionJsonParseJson value); + + T visit(FlowActionJsonSerializeJson value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionJson.class); + } + + @java.lang.Override + public FlowActionJson deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJsonCreateJson.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJsonParseJson.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJsonSerializeJson.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java new file mode 100644 index 000000000..0f8951b2f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonCreateJson.Builder.class) +public final class FlowActionJsonCreateJson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJsonCreateJsonParams params; + + private final Map additionalProperties; + + private FlowActionJsonCreateJson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJsonCreateJsonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JSON"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_JSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJsonCreateJsonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonCreateJson && equalTo((FlowActionJsonCreateJson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonCreateJson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJsonCreateJson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJsonCreateJsonParams params); + } + + public interface _FinalStage { + FlowActionJsonCreateJson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJsonCreateJsonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJsonCreateJson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJsonCreateJsonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJsonCreateJson build() { + return new FlowActionJsonCreateJson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java new file mode 100644 index 000000000..0bd6dd71b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonCreateJsonParams.Builder.class) +public final class FlowActionJsonCreateJsonParams { + private final Map object; + + private final Map additionalProperties; + + private FlowActionJsonCreateJsonParams(Map object, Map additionalProperties) { + this.object = object; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public Map getObject() { + return object; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonCreateJsonParams && equalTo((FlowActionJsonCreateJsonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonCreateJsonParams other) { + return object.equals(other.object); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map object = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionJsonCreateJsonParams other) { + object(other.getObject()); + return this; + } + + @JsonSetter(value = "object", nulls = Nulls.SKIP) + public Builder object(Map object) { + this.object.clear(); + if (object != null) { + this.object.putAll(object); + } + return this; + } + + public Builder putAllObject(Map object) { + if (object != null) { + this.object.putAll(object); + } + return this; + } + + public Builder object(String key, Object value) { + this.object.put(key, value); + return this; + } + + public FlowActionJsonCreateJsonParams build() { + return new FlowActionJsonCreateJsonParams(object, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java new file mode 100644 index 000000000..aee15d7f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonParseJson.Builder.class) +public final class FlowActionJsonParseJson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJsonParseJsonParams params; + + private final Map additionalProperties; + + private FlowActionJsonParseJson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJsonParseJsonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JSON"; + } + + @JsonProperty("action") + public String getAction() { + return "PARSE_JSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJsonParseJsonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonParseJson && equalTo((FlowActionJsonParseJson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonParseJson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJsonParseJson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJsonParseJsonParams params); + } + + public interface _FinalStage { + FlowActionJsonParseJson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJsonParseJsonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJsonParseJson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJsonParseJsonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJsonParseJson build() { + return new FlowActionJsonParseJson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java new file mode 100644 index 000000000..6f743bdff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonParseJsonParams.Builder.class) +public final class FlowActionJsonParseJsonParams { + private final String json; + + private final Map additionalProperties; + + private FlowActionJsonParseJsonParams(String json, Map additionalProperties) { + this.json = json; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("json") + public String getJson() { + return json; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonParseJsonParams && equalTo((FlowActionJsonParseJsonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonParseJsonParams other) { + return json.equals(other.json); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.json); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static JsonStage builder() { + return new Builder(); + } + + public interface JsonStage { + _FinalStage json(@NotNull String json); + + Builder from(FlowActionJsonParseJsonParams other); + } + + public interface _FinalStage { + FlowActionJsonParseJsonParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements JsonStage, _FinalStage { + private String json; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJsonParseJsonParams other) { + json(other.getJson()); + return this; + } + + @java.lang.Override + @JsonSetter("json") + public _FinalStage json(@NotNull String json) { + this.json = Objects.requireNonNull(json, "json must not be null"); + return this; + } + + @java.lang.Override + public FlowActionJsonParseJsonParams build() { + return new FlowActionJsonParseJsonParams(json, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java new file mode 100644 index 000000000..bf71ecfe0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonSerializeJson.Builder.class) +public final class FlowActionJsonSerializeJson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJsonSerializeJsonParams params; + + private final Map additionalProperties; + + private FlowActionJsonSerializeJson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJsonSerializeJsonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JSON"; + } + + @JsonProperty("action") + public String getAction() { + return "SERIALIZE_JSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJsonSerializeJsonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonSerializeJson && equalTo((FlowActionJsonSerializeJson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonSerializeJson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJsonSerializeJson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJsonSerializeJsonParams params); + } + + public interface _FinalStage { + FlowActionJsonSerializeJson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJsonSerializeJsonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJsonSerializeJson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJsonSerializeJsonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJsonSerializeJson build() { + return new FlowActionJsonSerializeJson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java new file mode 100644 index 000000000..2bea64bc7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJsonSerializeJsonParams.Builder.class) +public final class FlowActionJsonSerializeJsonParams { + private final FlowActionJsonSerializeJsonParamsObject object; + + private final Map additionalProperties; + + private FlowActionJsonSerializeJsonParams( + FlowActionJsonSerializeJsonParamsObject object, Map additionalProperties) { + this.object = object; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public FlowActionJsonSerializeJsonParamsObject getObject() { + return object; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonSerializeJsonParams && equalTo((FlowActionJsonSerializeJsonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJsonSerializeJsonParams other) { + return object.equals(other.object); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + _FinalStage object(@NotNull FlowActionJsonSerializeJsonParamsObject object); + + Builder from(FlowActionJsonSerializeJsonParams other); + } + + public interface _FinalStage { + FlowActionJsonSerializeJsonParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, _FinalStage { + private FlowActionJsonSerializeJsonParamsObject object; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJsonSerializeJsonParams other) { + object(other.getObject()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public _FinalStage object(@NotNull FlowActionJsonSerializeJsonParamsObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + public FlowActionJsonSerializeJsonParams build() { + return new FlowActionJsonSerializeJsonParams(object, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java new file mode 100644 index 000000000..9c541d00d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionJsonSerializeJsonParamsObject.Deserializer.class) +public final class FlowActionJsonSerializeJsonParamsObject { + private final Object value; + + private final int type; + + private FlowActionJsonSerializeJsonParamsObject(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJsonSerializeJsonParamsObject + && equalTo((FlowActionJsonSerializeJsonParamsObject) other); + } + + private boolean equalTo(FlowActionJsonSerializeJsonParamsObject other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionJsonSerializeJsonParamsObject of(String value) { + return new FlowActionJsonSerializeJsonParamsObject(value, 0); + } + + public static FlowActionJsonSerializeJsonParamsObject of(Map value) { + return new FlowActionJsonSerializeJsonParamsObject(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionJsonSerializeJsonParamsObject.class); + } + + @java.lang.Override + public FlowActionJsonSerializeJsonParamsObject deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwt.java new file mode 100644 index 000000000..171c06498 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwt.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionJwt.Deserializer.class) +public final class FlowActionJwt { + private final Object value; + + private final int type; + + private FlowActionJwt(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionJwtDecodeJwt) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionJwtSignJwt) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionJwtVerifyJwt) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwt && equalTo((FlowActionJwt) other); + } + + private boolean equalTo(FlowActionJwt other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionJwt of(FlowActionJwtDecodeJwt value) { + return new FlowActionJwt(value, 0); + } + + public static FlowActionJwt of(FlowActionJwtSignJwt value) { + return new FlowActionJwt(value, 1); + } + + public static FlowActionJwt of(FlowActionJwtVerifyJwt value) { + return new FlowActionJwt(value, 2); + } + + public interface Visitor { + T visit(FlowActionJwtDecodeJwt value); + + T visit(FlowActionJwtSignJwt value); + + T visit(FlowActionJwtVerifyJwt value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionJwt.class); + } + + @java.lang.Override + public FlowActionJwt deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJwtDecodeJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJwtSignJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionJwtVerifyJwt.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java new file mode 100644 index 000000000..38f602e1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtDecodeJwt.Builder.class) +public final class FlowActionJwtDecodeJwt { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJwtDecodeJwtParams params; + + private final Map additionalProperties; + + private FlowActionJwtDecodeJwt( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJwtDecodeJwtParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JWT"; + } + + @JsonProperty("action") + public String getAction() { + return "DECODE_JWT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJwtDecodeJwtParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtDecodeJwt && equalTo((FlowActionJwtDecodeJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtDecodeJwt other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJwtDecodeJwt other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJwtDecodeJwtParams params); + } + + public interface _FinalStage { + FlowActionJwtDecodeJwt build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJwtDecodeJwtParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtDecodeJwt other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJwtDecodeJwtParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJwtDecodeJwt build() { + return new FlowActionJwtDecodeJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java new file mode 100644 index 000000000..22f6e8c87 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtDecodeJwtParams.Builder.class) +public final class FlowActionJwtDecodeJwtParams { + private final String token; + + private final Map additionalProperties; + + private FlowActionJwtDecodeJwtParams(String token, Map additionalProperties) { + this.token = token; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("token") + public String getToken() { + return token; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtDecodeJwtParams && equalTo((FlowActionJwtDecodeJwtParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtDecodeJwtParams other) { + return token.equals(other.token); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.token); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TokenStage builder() { + return new Builder(); + } + + public interface TokenStage { + _FinalStage token(@NotNull String token); + + Builder from(FlowActionJwtDecodeJwtParams other); + } + + public interface _FinalStage { + FlowActionJwtDecodeJwtParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TokenStage, _FinalStage { + private String token; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtDecodeJwtParams other) { + token(other.getToken()); + return this; + } + + @java.lang.Override + @JsonSetter("token") + public _FinalStage token(@NotNull String token) { + this.token = Objects.requireNonNull(token, "token must not be null"); + return this; + } + + @java.lang.Override + public FlowActionJwtDecodeJwtParams build() { + return new FlowActionJwtDecodeJwtParams(token, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java new file mode 100644 index 000000000..632957aa5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtSignJwt.Builder.class) +public final class FlowActionJwtSignJwt { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJwtSignJwtParams params; + + private final Map additionalProperties; + + private FlowActionJwtSignJwt( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJwtSignJwtParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JWT"; + } + + @JsonProperty("action") + public String getAction() { + return "SIGN_JWT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJwtSignJwtParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtSignJwt && equalTo((FlowActionJwtSignJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtSignJwt other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJwtSignJwt other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJwtSignJwtParams params); + } + + public interface _FinalStage { + FlowActionJwtSignJwt build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJwtSignJwtParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtSignJwt other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJwtSignJwtParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJwtSignJwt build() { + return new FlowActionJwtSignJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java new file mode 100644 index 000000000..5ad501846 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java @@ -0,0 +1,257 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtSignJwtParams.Builder.class) +public final class FlowActionJwtSignJwtParams { + private final String connectionId; + + private final Optional> payload; + + private final Optional subject; + + private final Optional issuer; + + private final Optional audience; + + private final Optional expiresIn; + + private final Map additionalProperties; + + private FlowActionJwtSignJwtParams( + String connectionId, + Optional> payload, + Optional subject, + Optional issuer, + Optional audience, + Optional expiresIn, + Map additionalProperties) { + this.connectionId = connectionId; + this.payload = payload; + this.subject = subject; + this.issuer = issuer; + this.audience = audience; + this.expiresIn = expiresIn; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("payload") + public Optional> getPayload() { + return payload; + } + + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + @JsonProperty("issuer") + public Optional getIssuer() { + return issuer; + } + + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + @JsonProperty("expires_in") + public Optional getExpiresIn() { + return expiresIn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtSignJwtParams && equalTo((FlowActionJwtSignJwtParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtSignJwtParams other) { + return connectionId.equals(other.connectionId) + && payload.equals(other.payload) + && subject.equals(other.subject) + && issuer.equals(other.issuer) + && audience.equals(other.audience) + && expiresIn.equals(other.expiresIn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.payload, this.subject, this.issuer, this.audience, this.expiresIn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionJwtSignJwtParams other); + } + + public interface _FinalStage { + FlowActionJwtSignJwtParams build(); + + _FinalStage payload(Optional> payload); + + _FinalStage payload(Map payload); + + _FinalStage subject(Optional subject); + + _FinalStage subject(String subject); + + _FinalStage issuer(Optional issuer); + + _FinalStage issuer(String issuer); + + _FinalStage audience(Optional audience); + + _FinalStage audience(String audience); + + _FinalStage expiresIn(Optional expiresIn); + + _FinalStage expiresIn(String expiresIn); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional expiresIn = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional issuer = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional> payload = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtSignJwtParams other) { + connectionId(other.getConnectionId()); + payload(other.getPayload()); + subject(other.getSubject()); + issuer(other.getIssuer()); + audience(other.getAudience()); + expiresIn(other.getExpiresIn()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage expiresIn(String expiresIn) { + this.expiresIn = Optional.ofNullable(expiresIn); + return this; + } + + @java.lang.Override + @JsonSetter(value = "expires_in", nulls = Nulls.SKIP) + public _FinalStage expiresIn(Optional expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + @java.lang.Override + public _FinalStage audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + @java.lang.Override + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public _FinalStage audience(Optional audience) { + this.audience = audience; + return this; + } + + @java.lang.Override + public _FinalStage issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @java.lang.Override + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public _FinalStage issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(Optional subject) { + this.subject = subject; + return this; + } + + @java.lang.Override + public _FinalStage payload(Map payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Optional> payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public FlowActionJwtSignJwtParams build() { + return new FlowActionJwtSignJwtParams( + connectionId, payload, subject, issuer, audience, expiresIn, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java new file mode 100644 index 000000000..85e31f3db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtVerifyJwt.Builder.class) +public final class FlowActionJwtVerifyJwt { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionJwtVerifyJwtParams params; + + private final Map additionalProperties; + + private FlowActionJwtVerifyJwt( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionJwtVerifyJwtParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "JWT"; + } + + @JsonProperty("action") + public String getAction() { + return "VERIFY_JWT"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionJwtVerifyJwtParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtVerifyJwt && equalTo((FlowActionJwtVerifyJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtVerifyJwt other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionJwtVerifyJwt other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionJwtVerifyJwtParams params); + } + + public interface _FinalStage { + FlowActionJwtVerifyJwt build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionJwtVerifyJwtParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtVerifyJwt other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionJwtVerifyJwtParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionJwtVerifyJwt build() { + return new FlowActionJwtVerifyJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java new file mode 100644 index 000000000..07475c20d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionJwtVerifyJwtParams.Builder.class) +public final class FlowActionJwtVerifyJwtParams { + private final String connectionId; + + private final String token; + + private final Optional audience; + + private final Optional issuer; + + private final Map additionalProperties; + + private FlowActionJwtVerifyJwtParams( + String connectionId, + String token, + Optional audience, + Optional issuer, + Map additionalProperties) { + this.connectionId = connectionId; + this.token = token; + this.audience = audience; + this.issuer = issuer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("token") + public String getToken() { + return token; + } + + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + @JsonProperty("issuer") + public Optional getIssuer() { + return issuer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionJwtVerifyJwtParams && equalTo((FlowActionJwtVerifyJwtParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionJwtVerifyJwtParams other) { + return connectionId.equals(other.connectionId) + && token.equals(other.token) + && audience.equals(other.audience) + && issuer.equals(other.issuer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.token, this.audience, this.issuer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + TokenStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionJwtVerifyJwtParams other); + } + + public interface TokenStage { + _FinalStage token(@NotNull String token); + } + + public interface _FinalStage { + FlowActionJwtVerifyJwtParams build(); + + _FinalStage audience(Optional audience); + + _FinalStage audience(String audience); + + _FinalStage issuer(Optional issuer); + + _FinalStage issuer(String issuer); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, TokenStage, _FinalStage { + private String connectionId; + + private String token; + + private Optional issuer = Optional.empty(); + + private Optional audience = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionJwtVerifyJwtParams other) { + connectionId(other.getConnectionId()); + token(other.getToken()); + audience(other.getAudience()); + issuer(other.getIssuer()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public TokenStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("token") + public _FinalStage token(@NotNull String token) { + this.token = Objects.requireNonNull(token, "token must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @java.lang.Override + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public _FinalStage issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + @java.lang.Override + public _FinalStage audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + @java.lang.Override + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public _FinalStage audience(Optional audience) { + this.audience = audience; + return this; + } + + @java.lang.Override + public FlowActionJwtVerifyJwtParams build() { + return new FlowActionJwtVerifyJwtParams(connectionId, token, audience, issuer, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java new file mode 100644 index 000000000..bce1f293c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailchimpUpsertMember.Builder.class) +public final class FlowActionMailchimpUpsertMember { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionMailchimpUpsertMemberParams params; + + private final Map additionalProperties; + + private FlowActionMailchimpUpsertMember( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionMailchimpUpsertMemberParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "MAILCHIMP"; + } + + @JsonProperty("action") + public String getAction() { + return "UPSERT_MEMBER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionMailchimpUpsertMemberParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailchimpUpsertMember && equalTo((FlowActionMailchimpUpsertMember) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailchimpUpsertMember other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionMailchimpUpsertMember other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionMailchimpUpsertMemberParams params); + } + + public interface _FinalStage { + FlowActionMailchimpUpsertMember build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionMailchimpUpsertMemberParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailchimpUpsertMember other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionMailchimpUpsertMemberParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionMailchimpUpsertMember build() { + return new FlowActionMailchimpUpsertMember( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java new file mode 100644 index 000000000..c4bc155d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailchimpUpsertMemberParams.Builder.class) +public final class FlowActionMailchimpUpsertMemberParams { + private final String connectionId; + + private final String listId; + + private final FlowActionMailchimpUpsertMemberParamsMember member; + + private final Map additionalProperties; + + private FlowActionMailchimpUpsertMemberParams( + String connectionId, + String listId, + FlowActionMailchimpUpsertMemberParamsMember member, + Map additionalProperties) { + this.connectionId = connectionId; + this.listId = listId; + this.member = member; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("list_id") + public String getListId() { + return listId; + } + + @JsonProperty("member") + public FlowActionMailchimpUpsertMemberParamsMember getMember() { + return member; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailchimpUpsertMemberParams + && equalTo((FlowActionMailchimpUpsertMemberParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailchimpUpsertMemberParams other) { + return connectionId.equals(other.connectionId) && listId.equals(other.listId) && member.equals(other.member); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.listId, this.member); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + ListIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionMailchimpUpsertMemberParams other); + } + + public interface ListIdStage { + MemberStage listId(@NotNull String listId); + } + + public interface MemberStage { + _FinalStage member(@NotNull FlowActionMailchimpUpsertMemberParamsMember member); + } + + public interface _FinalStage { + FlowActionMailchimpUpsertMemberParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, ListIdStage, MemberStage, _FinalStage { + private String connectionId; + + private String listId; + + private FlowActionMailchimpUpsertMemberParamsMember member; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailchimpUpsertMemberParams other) { + connectionId(other.getConnectionId()); + listId(other.getListId()); + member(other.getMember()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public ListIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("list_id") + public MemberStage listId(@NotNull String listId) { + this.listId = Objects.requireNonNull(listId, "listId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("member") + public _FinalStage member(@NotNull FlowActionMailchimpUpsertMemberParamsMember member) { + this.member = Objects.requireNonNull(member, "member must not be null"); + return this; + } + + @java.lang.Override + public FlowActionMailchimpUpsertMemberParams build() { + return new FlowActionMailchimpUpsertMemberParams(connectionId, listId, member, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java new file mode 100644 index 000000000..e69b9a8de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailchimpUpsertMemberParamsMember.Builder.class) +public final class FlowActionMailchimpUpsertMemberParamsMember { + private final String emailAddress; + + private final String statusIfNew; + + private final Optional> mergeFields; + + private final Map additionalProperties; + + private FlowActionMailchimpUpsertMemberParamsMember( + String emailAddress, + String statusIfNew, + Optional> mergeFields, + Map additionalProperties) { + this.emailAddress = emailAddress; + this.statusIfNew = statusIfNew; + this.mergeFields = mergeFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("email_address") + public String getEmailAddress() { + return emailAddress; + } + + @JsonProperty("status_if_new") + public String getStatusIfNew() { + return statusIfNew; + } + + @JsonProperty("merge_fields") + public Optional> getMergeFields() { + return mergeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailchimpUpsertMemberParamsMember + && equalTo((FlowActionMailchimpUpsertMemberParamsMember) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailchimpUpsertMemberParamsMember other) { + return emailAddress.equals(other.emailAddress) + && statusIfNew.equals(other.statusIfNew) + && mergeFields.equals(other.mergeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.emailAddress, this.statusIfNew, this.mergeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailAddressStage builder() { + return new Builder(); + } + + public interface EmailAddressStage { + StatusIfNewStage emailAddress(@NotNull String emailAddress); + + Builder from(FlowActionMailchimpUpsertMemberParamsMember other); + } + + public interface StatusIfNewStage { + _FinalStage statusIfNew(@NotNull String statusIfNew); + } + + public interface _FinalStage { + FlowActionMailchimpUpsertMemberParamsMember build(); + + _FinalStage mergeFields(Optional> mergeFields); + + _FinalStage mergeFields(Map mergeFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailAddressStage, StatusIfNewStage, _FinalStage { + private String emailAddress; + + private String statusIfNew; + + private Optional> mergeFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailchimpUpsertMemberParamsMember other) { + emailAddress(other.getEmailAddress()); + statusIfNew(other.getStatusIfNew()); + mergeFields(other.getMergeFields()); + return this; + } + + @java.lang.Override + @JsonSetter("email_address") + public StatusIfNewStage emailAddress(@NotNull String emailAddress) { + this.emailAddress = Objects.requireNonNull(emailAddress, "emailAddress must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status_if_new") + public _FinalStage statusIfNew(@NotNull String statusIfNew) { + this.statusIfNew = Objects.requireNonNull(statusIfNew, "statusIfNew must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage mergeFields(Map mergeFields) { + this.mergeFields = Optional.ofNullable(mergeFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "merge_fields", nulls = Nulls.SKIP) + public _FinalStage mergeFields(Optional> mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + @java.lang.Override + public FlowActionMailchimpUpsertMemberParamsMember build() { + return new FlowActionMailchimpUpsertMemberParamsMember( + emailAddress, statusIfNew, mergeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java new file mode 100644 index 000000000..9c0a997bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailjetSendEmail.Builder.class) +public final class FlowActionMailjetSendEmail { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionMailjetSendEmailParams params; + + private final Map additionalProperties; + + private FlowActionMailjetSendEmail( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionMailjetSendEmailParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "MAILJET"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_EMAIL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionMailjetSendEmailParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailjetSendEmail && equalTo((FlowActionMailjetSendEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailjetSendEmail other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionMailjetSendEmail other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionMailjetSendEmailParams params); + } + + public interface _FinalStage { + FlowActionMailjetSendEmail build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionMailjetSendEmailParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailjetSendEmail other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionMailjetSendEmailParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionMailjetSendEmail build() { + return new FlowActionMailjetSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java new file mode 100644 index 000000000..405efb196 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionMailjetSendEmailParams.Deserializer.class) +public final class FlowActionMailjetSendEmailParams { + private final Object value; + + private final int type; + + private FlowActionMailjetSendEmailParams(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionMailjetSendEmailParamsContent) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionMailjetSendEmailParamsTemplateId) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailjetSendEmailParams && equalTo((FlowActionMailjetSendEmailParams) other); + } + + private boolean equalTo(FlowActionMailjetSendEmailParams other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionMailjetSendEmailParams of(FlowActionMailjetSendEmailParamsContent value) { + return new FlowActionMailjetSendEmailParams(value, 0); + } + + public static FlowActionMailjetSendEmailParams of(FlowActionMailjetSendEmailParamsTemplateId value) { + return new FlowActionMailjetSendEmailParams(value, 1); + } + + public interface Visitor { + T visit(FlowActionMailjetSendEmailParamsContent value); + + T visit(FlowActionMailjetSendEmailParamsTemplateId value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionMailjetSendEmailParams.class); + } + + @java.lang.Override + public FlowActionMailjetSendEmailParams deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionMailjetSendEmailParamsContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, FlowActionMailjetSendEmailParamsTemplateId.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsContent.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsContent.java new file mode 100644 index 000000000..a6babc079 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailjetSendEmailParamsContent.Builder.class) +public final class FlowActionMailjetSendEmailParamsContent { + private final String content; + + private final Map additionalProperties; + + private FlowActionMailjetSendEmailParamsContent(String content, Map additionalProperties) { + this.content = content; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("content") + public String getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailjetSendEmailParamsContent + && equalTo((FlowActionMailjetSendEmailParamsContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailjetSendEmailParamsContent other) { + return content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ContentStage builder() { + return new Builder(); + } + + public interface ContentStage { + _FinalStage content(@NotNull String content); + + Builder from(FlowActionMailjetSendEmailParamsContent other); + } + + public interface _FinalStage { + FlowActionMailjetSendEmailParamsContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ContentStage, _FinalStage { + private String content; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailjetSendEmailParamsContent other) { + content(other.getContent()); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public _FinalStage content(@NotNull String content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + public FlowActionMailjetSendEmailParamsContent build() { + return new FlowActionMailjetSendEmailParamsContent(content, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsTemplateId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsTemplateId.java new file mode 100644 index 000000000..271928a04 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParamsTemplateId.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionMailjetSendEmailParamsTemplateId.Builder.class) +public final class FlowActionMailjetSendEmailParamsTemplateId { + private final int templateId; + + private final Optional> variables; + + private final Map additionalProperties; + + private FlowActionMailjetSendEmailParamsTemplateId( + int templateId, Optional> variables, Map additionalProperties) { + this.templateId = templateId; + this.variables = variables; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template_id") + public int getTemplateId() { + return templateId; + } + + @JsonProperty("variables") + public Optional> getVariables() { + return variables; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionMailjetSendEmailParamsTemplateId + && equalTo((FlowActionMailjetSendEmailParamsTemplateId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionMailjetSendEmailParamsTemplateId other) { + return templateId == other.templateId && variables.equals(other.variables); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.templateId, this.variables); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateIdStage builder() { + return new Builder(); + } + + public interface TemplateIdStage { + _FinalStage templateId(int templateId); + + Builder from(FlowActionMailjetSendEmailParamsTemplateId other); + } + + public interface _FinalStage { + FlowActionMailjetSendEmailParamsTemplateId build(); + + _FinalStage variables(Optional> variables); + + _FinalStage variables(Map variables); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateIdStage, _FinalStage { + private int templateId; + + private Optional> variables = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionMailjetSendEmailParamsTemplateId other) { + templateId(other.getTemplateId()); + variables(other.getVariables()); + return this; + } + + @java.lang.Override + @JsonSetter("template_id") + public _FinalStage templateId(int templateId) { + this.templateId = templateId; + return this; + } + + @java.lang.Override + public _FinalStage variables(Map variables) { + this.variables = Optional.ofNullable(variables); + return this; + } + + @java.lang.Override + @JsonSetter(value = "variables", nulls = Nulls.SKIP) + public _FinalStage variables(Optional> variables) { + this.variables = variables; + return this; + } + + @java.lang.Override + public FlowActionMailjetSendEmailParamsTemplateId build() { + return new FlowActionMailjetSendEmailParamsTemplateId(templateId, variables, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java new file mode 100644 index 000000000..11e628e90 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionOtp.Deserializer.class) +public final class FlowActionOtp { + private final Object value; + + private final int type; + + private FlowActionOtp(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionOtpGenerateCode) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionOtpVerifyCode) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtp && equalTo((FlowActionOtp) other); + } + + private boolean equalTo(FlowActionOtp other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionOtp of(FlowActionOtpGenerateCode value) { + return new FlowActionOtp(value, 0); + } + + public static FlowActionOtp of(FlowActionOtpVerifyCode value) { + return new FlowActionOtp(value, 1); + } + + public interface Visitor { + T visit(FlowActionOtpGenerateCode value); + + T visit(FlowActionOtpVerifyCode value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionOtp.class); + } + + @java.lang.Override + public FlowActionOtp deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionOtpGenerateCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionOtpVerifyCode.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java new file mode 100644 index 000000000..f147bd7cc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionOtpGenerateCode.Builder.class) +public final class FlowActionOtpGenerateCode { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionOtpGenerateCodeParams params; + + private final Map additionalProperties; + + private FlowActionOtpGenerateCode( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionOtpGenerateCodeParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "OTP"; + } + + @JsonProperty("action") + public String getAction() { + return "GENERATE_CODE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionOtpGenerateCodeParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtpGenerateCode && equalTo((FlowActionOtpGenerateCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionOtpGenerateCode other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionOtpGenerateCode other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionOtpGenerateCodeParams params); + } + + public interface _FinalStage { + FlowActionOtpGenerateCode build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionOtpGenerateCodeParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionOtpGenerateCode other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionOtpGenerateCodeParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionOtpGenerateCode build() { + return new FlowActionOtpGenerateCode(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java new file mode 100644 index 000000000..dde8d51e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionOtpGenerateCodeParams.Builder.class) +public final class FlowActionOtpGenerateCodeParams { + private final String reference; + + private final int length; + + private final Map additionalProperties; + + private FlowActionOtpGenerateCodeParams(String reference, int length, Map additionalProperties) { + this.reference = reference; + this.length = length; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reference") + public String getReference() { + return reference; + } + + @JsonProperty("length") + public int getLength() { + return length; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtpGenerateCodeParams && equalTo((FlowActionOtpGenerateCodeParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionOtpGenerateCodeParams other) { + return reference.equals(other.reference) && length == other.length; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reference, this.length); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReferenceStage builder() { + return new Builder(); + } + + public interface ReferenceStage { + LengthStage reference(@NotNull String reference); + + Builder from(FlowActionOtpGenerateCodeParams other); + } + + public interface LengthStage { + _FinalStage length(int length); + } + + public interface _FinalStage { + FlowActionOtpGenerateCodeParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReferenceStage, LengthStage, _FinalStage { + private String reference; + + private int length; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionOtpGenerateCodeParams other) { + reference(other.getReference()); + length(other.getLength()); + return this; + } + + @java.lang.Override + @JsonSetter("reference") + public LengthStage reference(@NotNull String reference) { + this.reference = Objects.requireNonNull(reference, "reference must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("length") + public _FinalStage length(int length) { + this.length = length; + return this; + } + + @java.lang.Override + public FlowActionOtpGenerateCodeParams build() { + return new FlowActionOtpGenerateCodeParams(reference, length, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java new file mode 100644 index 000000000..5582a1ccd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionOtpVerifyCode.Builder.class) +public final class FlowActionOtpVerifyCode { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionOtpVerifyCodeParams params; + + private final Map additionalProperties; + + private FlowActionOtpVerifyCode( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionOtpVerifyCodeParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "OTP"; + } + + @JsonProperty("action") + public String getAction() { + return "VERIFY_CODE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionOtpVerifyCodeParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtpVerifyCode && equalTo((FlowActionOtpVerifyCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionOtpVerifyCode other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionOtpVerifyCode other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionOtpVerifyCodeParams params); + } + + public interface _FinalStage { + FlowActionOtpVerifyCode build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionOtpVerifyCodeParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionOtpVerifyCode other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionOtpVerifyCodeParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionOtpVerifyCode build() { + return new FlowActionOtpVerifyCode(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java new file mode 100644 index 000000000..c1640f8df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionOtpVerifyCodeParams.Builder.class) +public final class FlowActionOtpVerifyCodeParams { + private final String reference; + + private final FlowActionOtpVerifyCodeParamsCode code; + + private final Map additionalProperties; + + private FlowActionOtpVerifyCodeParams( + String reference, FlowActionOtpVerifyCodeParamsCode code, Map additionalProperties) { + this.reference = reference; + this.code = code; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reference") + public String getReference() { + return reference; + } + + @JsonProperty("code") + public FlowActionOtpVerifyCodeParamsCode getCode() { + return code; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtpVerifyCodeParams && equalTo((FlowActionOtpVerifyCodeParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionOtpVerifyCodeParams other) { + return reference.equals(other.reference) && code.equals(other.code); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reference, this.code); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReferenceStage builder() { + return new Builder(); + } + + public interface ReferenceStage { + CodeStage reference(@NotNull String reference); + + Builder from(FlowActionOtpVerifyCodeParams other); + } + + public interface CodeStage { + _FinalStage code(@NotNull FlowActionOtpVerifyCodeParamsCode code); + } + + public interface _FinalStage { + FlowActionOtpVerifyCodeParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReferenceStage, CodeStage, _FinalStage { + private String reference; + + private FlowActionOtpVerifyCodeParamsCode code; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionOtpVerifyCodeParams other) { + reference(other.getReference()); + code(other.getCode()); + return this; + } + + @java.lang.Override + @JsonSetter("reference") + public CodeStage reference(@NotNull String reference) { + this.reference = Objects.requireNonNull(reference, "reference must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public _FinalStage code(@NotNull FlowActionOtpVerifyCodeParamsCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + public FlowActionOtpVerifyCodeParams build() { + return new FlowActionOtpVerifyCodeParams(reference, code, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java new file mode 100644 index 000000000..2f215ddef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionOtpVerifyCodeParamsCode.Deserializer.class) +public final class FlowActionOtpVerifyCodeParamsCode { + private final Object value; + + private final int type; + + private FlowActionOtpVerifyCodeParamsCode(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionOtpVerifyCodeParamsCode && equalTo((FlowActionOtpVerifyCodeParamsCode) other); + } + + private boolean equalTo(FlowActionOtpVerifyCodeParamsCode other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionOtpVerifyCodeParamsCode of(int value) { + return new FlowActionOtpVerifyCodeParamsCode(value, 0); + } + + public static FlowActionOtpVerifyCodeParamsCode of(String value) { + return new FlowActionOtpVerifyCodeParamsCode(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionOtpVerifyCodeParamsCode.class); + } + + @java.lang.Override + public FlowActionOtpVerifyCodeParamsCode deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedrive.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedrive.java new file mode 100644 index 000000000..b6dcef663 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedrive.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedrive.Deserializer.class) +public final class FlowActionPipedrive { + private final Object value; + + private final int type; + + private FlowActionPipedrive(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionPipedriveAddDeal) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionPipedriveAddOrganization) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionPipedriveAddPerson) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedrive && equalTo((FlowActionPipedrive) other); + } + + private boolean equalTo(FlowActionPipedrive other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedrive of(FlowActionPipedriveAddDeal value) { + return new FlowActionPipedrive(value, 0); + } + + public static FlowActionPipedrive of(FlowActionPipedriveAddOrganization value) { + return new FlowActionPipedrive(value, 1); + } + + public static FlowActionPipedrive of(FlowActionPipedriveAddPerson value) { + return new FlowActionPipedrive(value, 2); + } + + public interface Visitor { + T visit(FlowActionPipedriveAddDeal value); + + T visit(FlowActionPipedriveAddOrganization value); + + T visit(FlowActionPipedriveAddPerson value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedrive.class); + } + + @java.lang.Override + public FlowActionPipedrive deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionPipedriveAddDeal.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionPipedriveAddOrganization.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionPipedriveAddPerson.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java new file mode 100644 index 000000000..9d561c2e5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddDeal.Builder.class) +public final class FlowActionPipedriveAddDeal { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionPipedriveAddDealParams params; + + private final Map additionalProperties; + + private FlowActionPipedriveAddDeal( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionPipedriveAddDealParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "PIPEDRIVE"; + } + + @JsonProperty("action") + public String getAction() { + return "ADD_DEAL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionPipedriveAddDealParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDeal && equalTo((FlowActionPipedriveAddDeal) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddDeal other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionPipedriveAddDeal other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionPipedriveAddDealParams params); + } + + public interface _FinalStage { + FlowActionPipedriveAddDeal build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionPipedriveAddDealParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddDeal other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionPipedriveAddDealParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddDeal build() { + return new FlowActionPipedriveAddDeal(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java new file mode 100644 index 000000000..86d44f911 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java @@ -0,0 +1,327 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddDealParams.Builder.class) +public final class FlowActionPipedriveAddDealParams { + private final String connectionId; + + private final String title; + + private final Optional value; + + private final Optional userId; + + private final Optional personId; + + private final Optional organizationId; + + private final Optional stageId; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionPipedriveAddDealParams( + String connectionId, + String title, + Optional value, + Optional userId, + Optional personId, + Optional organizationId, + Optional stageId, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.title = title; + this.value = value; + this.userId = userId; + this.personId = personId; + this.organizationId = organizationId; + this.stageId = stageId; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("person_id") + public Optional getPersonId() { + return personId; + } + + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @JsonProperty("stage_id") + public Optional getStageId() { + return stageId; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDealParams && equalTo((FlowActionPipedriveAddDealParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddDealParams other) { + return connectionId.equals(other.connectionId) + && title.equals(other.title) + && value.equals(other.value) + && userId.equals(other.userId) + && personId.equals(other.personId) + && organizationId.equals(other.organizationId) + && stageId.equals(other.stageId) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.title, + this.value, + this.userId, + this.personId, + this.organizationId, + this.stageId, + this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + TitleStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionPipedriveAddDealParams other); + } + + public interface TitleStage { + _FinalStage title(@NotNull String title); + } + + public interface _FinalStage { + FlowActionPipedriveAddDealParams build(); + + _FinalStage value(Optional value); + + _FinalStage value(String value); + + _FinalStage userId(Optional userId); + + _FinalStage userId(FlowActionPipedriveAddDealParamsUserId userId); + + _FinalStage personId(Optional personId); + + _FinalStage personId(FlowActionPipedriveAddDealParamsPersonId personId); + + _FinalStage organizationId(Optional organizationId); + + _FinalStage organizationId(FlowActionPipedriveAddDealParamsOrganizationId organizationId); + + _FinalStage stageId(Optional stageId); + + _FinalStage stageId(FlowActionPipedriveAddDealParamsStageId stageId); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(Map fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, TitleStage, _FinalStage { + private String connectionId; + + private String title; + + private Optional> fields = Optional.empty(); + + private Optional stageId = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional personId = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddDealParams other) { + connectionId(other.getConnectionId()); + title(other.getTitle()); + value(other.getValue()); + userId(other.getUserId()); + personId(other.getPersonId()); + organizationId(other.getOrganizationId()); + stageId(other.getStageId()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public TitleStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public _FinalStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Map fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public _FinalStage stageId(FlowActionPipedriveAddDealParamsStageId stageId) { + this.stageId = Optional.ofNullable(stageId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "stage_id", nulls = Nulls.SKIP) + public _FinalStage stageId(Optional stageId) { + this.stageId = stageId; + return this; + } + + @java.lang.Override + public _FinalStage organizationId(FlowActionPipedriveAddDealParamsOrganizationId organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public _FinalStage organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + @java.lang.Override + public _FinalStage personId(FlowActionPipedriveAddDealParamsPersonId personId) { + this.personId = Optional.ofNullable(personId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "person_id", nulls = Nulls.SKIP) + public _FinalStage personId(Optional personId) { + this.personId = personId; + return this; + } + + @java.lang.Override + public _FinalStage userId(FlowActionPipedriveAddDealParamsUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public _FinalStage userId(Optional userId) { + this.userId = userId; + return this; + } + + @java.lang.Override + public _FinalStage value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddDealParams build() { + return new FlowActionPipedriveAddDealParams( + connectionId, + title, + value, + userId, + personId, + organizationId, + stageId, + fields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java new file mode 100644 index 000000000..a54e34bdd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddDealParamsOrganizationId.Deserializer.class) +public final class FlowActionPipedriveAddDealParamsOrganizationId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddDealParamsOrganizationId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDealParamsOrganizationId + && equalTo((FlowActionPipedriveAddDealParamsOrganizationId) other); + } + + private boolean equalTo(FlowActionPipedriveAddDealParamsOrganizationId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddDealParamsOrganizationId of(String value) { + return new FlowActionPipedriveAddDealParamsOrganizationId(value, 0); + } + + public static FlowActionPipedriveAddDealParamsOrganizationId of(double value) { + return new FlowActionPipedriveAddDealParamsOrganizationId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddDealParamsOrganizationId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddDealParamsOrganizationId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsPersonId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsPersonId.java new file mode 100644 index 000000000..1a7820d8a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsPersonId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddDealParamsPersonId.Deserializer.class) +public final class FlowActionPipedriveAddDealParamsPersonId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddDealParamsPersonId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDealParamsPersonId + && equalTo((FlowActionPipedriveAddDealParamsPersonId) other); + } + + private boolean equalTo(FlowActionPipedriveAddDealParamsPersonId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddDealParamsPersonId of(String value) { + return new FlowActionPipedriveAddDealParamsPersonId(value, 0); + } + + public static FlowActionPipedriveAddDealParamsPersonId of(double value) { + return new FlowActionPipedriveAddDealParamsPersonId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddDealParamsPersonId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddDealParamsPersonId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsStageId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsStageId.java new file mode 100644 index 000000000..1cf4da94d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsStageId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddDealParamsStageId.Deserializer.class) +public final class FlowActionPipedriveAddDealParamsStageId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddDealParamsStageId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDealParamsStageId + && equalTo((FlowActionPipedriveAddDealParamsStageId) other); + } + + private boolean equalTo(FlowActionPipedriveAddDealParamsStageId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddDealParamsStageId of(String value) { + return new FlowActionPipedriveAddDealParamsStageId(value, 0); + } + + public static FlowActionPipedriveAddDealParamsStageId of(double value) { + return new FlowActionPipedriveAddDealParamsStageId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddDealParamsStageId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddDealParamsStageId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsUserId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsUserId.java new file mode 100644 index 000000000..851d65915 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsUserId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddDealParamsUserId.Deserializer.class) +public final class FlowActionPipedriveAddDealParamsUserId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddDealParamsUserId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddDealParamsUserId + && equalTo((FlowActionPipedriveAddDealParamsUserId) other); + } + + private boolean equalTo(FlowActionPipedriveAddDealParamsUserId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddDealParamsUserId of(String value) { + return new FlowActionPipedriveAddDealParamsUserId(value, 0); + } + + public static FlowActionPipedriveAddDealParamsUserId of(double value) { + return new FlowActionPipedriveAddDealParamsUserId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddDealParamsUserId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddDealParamsUserId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganization.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganization.java new file mode 100644 index 000000000..55eb613e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganization.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddOrganization.Builder.class) +public final class FlowActionPipedriveAddOrganization { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionPipedriveAddOrganizationParams params; + + private final Map additionalProperties; + + private FlowActionPipedriveAddOrganization( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionPipedriveAddOrganizationParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "PIPEDRIVE"; + } + + @JsonProperty("action") + public String getAction() { + return "ADD_ORGANIZATION"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionPipedriveAddOrganizationParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddOrganization + && equalTo((FlowActionPipedriveAddOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddOrganization other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionPipedriveAddOrganization other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionPipedriveAddOrganizationParams params); + } + + public interface _FinalStage { + FlowActionPipedriveAddOrganization build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionPipedriveAddOrganizationParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddOrganization other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionPipedriveAddOrganizationParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddOrganization build() { + return new FlowActionPipedriveAddOrganization( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java new file mode 100644 index 000000000..cd4e79869 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java @@ -0,0 +1,192 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddOrganizationParams.Builder.class) +public final class FlowActionPipedriveAddOrganizationParams { + private final String connectionId; + + private final String name; + + private final Optional ownerId; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionPipedriveAddOrganizationParams( + String connectionId, + String name, + Optional ownerId, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.name = name; + this.ownerId = ownerId; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("owner_id") + public Optional getOwnerId() { + return ownerId; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddOrganizationParams + && equalTo((FlowActionPipedriveAddOrganizationParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddOrganizationParams other) { + return connectionId.equals(other.connectionId) + && name.equals(other.name) + && ownerId.equals(other.ownerId) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.name, this.ownerId, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + NameStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionPipedriveAddOrganizationParams other); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + } + + public interface _FinalStage { + FlowActionPipedriveAddOrganizationParams build(); + + _FinalStage ownerId(Optional ownerId); + + _FinalStage ownerId(FlowActionPipedriveAddOrganizationParamsOwnerId ownerId); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(Map fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, NameStage, _FinalStage { + private String connectionId; + + private String name; + + private Optional> fields = Optional.empty(); + + private Optional ownerId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddOrganizationParams other) { + connectionId(other.getConnectionId()); + name(other.getName()); + ownerId(other.getOwnerId()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public NameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Map fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public _FinalStage ownerId(FlowActionPipedriveAddOrganizationParamsOwnerId ownerId) { + this.ownerId = Optional.ofNullable(ownerId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) + public _FinalStage ownerId(Optional ownerId) { + this.ownerId = ownerId; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddOrganizationParams build() { + return new FlowActionPipedriveAddOrganizationParams( + connectionId, name, ownerId, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java new file mode 100644 index 000000000..b194e4aef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddOrganizationParamsOwnerId.Deserializer.class) +public final class FlowActionPipedriveAddOrganizationParamsOwnerId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddOrganizationParamsOwnerId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddOrganizationParamsOwnerId + && equalTo((FlowActionPipedriveAddOrganizationParamsOwnerId) other); + } + + private boolean equalTo(FlowActionPipedriveAddOrganizationParamsOwnerId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddOrganizationParamsOwnerId of(String value) { + return new FlowActionPipedriveAddOrganizationParamsOwnerId(value, 0); + } + + public static FlowActionPipedriveAddOrganizationParamsOwnerId of(double value) { + return new FlowActionPipedriveAddOrganizationParamsOwnerId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddOrganizationParamsOwnerId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddOrganizationParamsOwnerId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPerson.java new file mode 100644 index 000000000..142fdeaa4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPerson.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddPerson.Builder.class) +public final class FlowActionPipedriveAddPerson { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionPipedriveAddPersonParams params; + + private final Map additionalProperties; + + private FlowActionPipedriveAddPerson( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionPipedriveAddPersonParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "PIPEDRIVE"; + } + + @JsonProperty("action") + public String getAction() { + return "ADD_PERSON"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionPipedriveAddPersonParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddPerson && equalTo((FlowActionPipedriveAddPerson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddPerson other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionPipedriveAddPerson other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionPipedriveAddPersonParams params); + } + + public interface _FinalStage { + FlowActionPipedriveAddPerson build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionPipedriveAddPersonParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddPerson other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionPipedriveAddPersonParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddPerson build() { + return new FlowActionPipedriveAddPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java new file mode 100644 index 000000000..27226c9ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionPipedriveAddPersonParams.Builder.class) +public final class FlowActionPipedriveAddPersonParams { + private final String connectionId; + + private final String name; + + private final Optional email; + + private final Optional phone; + + private final Optional ownerId; + + private final Optional organizationId; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionPipedriveAddPersonParams( + String connectionId, + String name, + Optional email, + Optional phone, + Optional ownerId, + Optional organizationId, + Optional> fields, + Map additionalProperties) { + this.connectionId = connectionId; + this.name = name; + this.email = email; + this.phone = phone; + this.ownerId = ownerId; + this.organizationId = organizationId; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone") + public Optional getPhone() { + return phone; + } + + @JsonProperty("owner_id") + public Optional getOwnerId() { + return ownerId; + } + + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddPersonParams + && equalTo((FlowActionPipedriveAddPersonParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionPipedriveAddPersonParams other) { + return connectionId.equals(other.connectionId) + && name.equals(other.name) + && email.equals(other.email) + && phone.equals(other.phone) + && ownerId.equals(other.ownerId) + && organizationId.equals(other.organizationId) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, this.name, this.email, this.phone, this.ownerId, this.organizationId, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + NameStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionPipedriveAddPersonParams other); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + } + + public interface _FinalStage { + FlowActionPipedriveAddPersonParams build(); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phone(Optional phone); + + _FinalStage phone(String phone); + + _FinalStage ownerId(Optional ownerId); + + _FinalStage ownerId(FlowActionPipedriveAddPersonParamsOwnerId ownerId); + + _FinalStage organizationId(Optional organizationId); + + _FinalStage organizationId(FlowActionPipedriveAddPersonParamsOrganizationId organizationId); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(Map fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, NameStage, _FinalStage { + private String connectionId; + + private String name; + + private Optional> fields = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional ownerId = Optional.empty(); + + private Optional phone = Optional.empty(); + + private Optional email = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionPipedriveAddPersonParams other) { + connectionId(other.getConnectionId()); + name(other.getName()); + email(other.getEmail()); + phone(other.getPhone()); + ownerId(other.getOwnerId()); + organizationId(other.getOrganizationId()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public NameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Map fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public _FinalStage organizationId(FlowActionPipedriveAddPersonParamsOrganizationId organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public _FinalStage organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + @java.lang.Override + public _FinalStage ownerId(FlowActionPipedriveAddPersonParamsOwnerId ownerId) { + this.ownerId = Optional.ofNullable(ownerId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) + public _FinalStage ownerId(Optional ownerId) { + this.ownerId = ownerId; + return this; + } + + @java.lang.Override + public _FinalStage phone(String phone) { + this.phone = Optional.ofNullable(phone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone", nulls = Nulls.SKIP) + public _FinalStage phone(Optional phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public FlowActionPipedriveAddPersonParams build() { + return new FlowActionPipedriveAddPersonParams( + connectionId, name, email, phone, ownerId, organizationId, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java new file mode 100644 index 000000000..2a6aae3b7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddPersonParamsOrganizationId.Deserializer.class) +public final class FlowActionPipedriveAddPersonParamsOrganizationId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddPersonParamsOrganizationId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddPersonParamsOrganizationId + && equalTo((FlowActionPipedriveAddPersonParamsOrganizationId) other); + } + + private boolean equalTo(FlowActionPipedriveAddPersonParamsOrganizationId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddPersonParamsOrganizationId of(String value) { + return new FlowActionPipedriveAddPersonParamsOrganizationId(value, 0); + } + + public static FlowActionPipedriveAddPersonParamsOrganizationId of(double value) { + return new FlowActionPipedriveAddPersonParamsOrganizationId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddPersonParamsOrganizationId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddPersonParamsOrganizationId deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOwnerId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOwnerId.java new file mode 100644 index 000000000..ac8340d2a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOwnerId.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionPipedriveAddPersonParamsOwnerId.Deserializer.class) +public final class FlowActionPipedriveAddPersonParamsOwnerId { + private final Object value; + + private final int type; + + private FlowActionPipedriveAddPersonParamsOwnerId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionPipedriveAddPersonParamsOwnerId + && equalTo((FlowActionPipedriveAddPersonParamsOwnerId) other); + } + + private boolean equalTo(FlowActionPipedriveAddPersonParamsOwnerId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionPipedriveAddPersonParamsOwnerId of(String value) { + return new FlowActionPipedriveAddPersonParamsOwnerId(value, 0); + } + + public static FlowActionPipedriveAddPersonParamsOwnerId of(double value) { + return new FlowActionPipedriveAddPersonParamsOwnerId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionPipedriveAddPersonParamsOwnerId.class); + } + + @java.lang.Override + public FlowActionPipedriveAddPersonParamsOwnerId deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforce.java new file mode 100644 index 000000000..c26e43cca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforce.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionSalesforce.Deserializer.class) +public final class FlowActionSalesforce { + private final Object value; + + private final int type; + + private FlowActionSalesforce(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionSalesforceCreateLead) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionSalesforceGetLead) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionSalesforceSearchLeads) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowActionSalesforceUpdateLead) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforce && equalTo((FlowActionSalesforce) other); + } + + private boolean equalTo(FlowActionSalesforce other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionSalesforce of(FlowActionSalesforceCreateLead value) { + return new FlowActionSalesforce(value, 0); + } + + public static FlowActionSalesforce of(FlowActionSalesforceGetLead value) { + return new FlowActionSalesforce(value, 1); + } + + public static FlowActionSalesforce of(FlowActionSalesforceSearchLeads value) { + return new FlowActionSalesforce(value, 2); + } + + public static FlowActionSalesforce of(FlowActionSalesforceUpdateLead value) { + return new FlowActionSalesforce(value, 3); + } + + public interface Visitor { + T visit(FlowActionSalesforceCreateLead value); + + T visit(FlowActionSalesforceGetLead value); + + T visit(FlowActionSalesforceSearchLeads value); + + T visit(FlowActionSalesforceUpdateLead value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionSalesforce.class); + } + + @java.lang.Override + public FlowActionSalesforce deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSalesforceCreateLead.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSalesforceGetLead.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSalesforceSearchLeads.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionSalesforceUpdateLead.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java new file mode 100644 index 000000000..72fa7df7a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceCreateLead.Builder.class) +public final class FlowActionSalesforceCreateLead { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSalesforceCreateLeadParams params; + + private final Map additionalProperties; + + private FlowActionSalesforceCreateLead( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSalesforceCreateLeadParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SALESFORCE"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_LEAD"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSalesforceCreateLeadParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceCreateLead && equalTo((FlowActionSalesforceCreateLead) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceCreateLead other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSalesforceCreateLead other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSalesforceCreateLeadParams params); + } + + public interface _FinalStage { + FlowActionSalesforceCreateLead build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSalesforceCreateLeadParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceCreateLead other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSalesforceCreateLeadParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSalesforceCreateLead build() { + return new FlowActionSalesforceCreateLead( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java new file mode 100644 index 000000000..65a1ab1e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceCreateLeadParams.Builder.class) +public final class FlowActionSalesforceCreateLeadParams { + private final String connectionId; + + private final Optional firstName; + + private final String lastName; + + private final String company; + + private final Optional email; + + private final Optional phone; + + private final Optional> payload; + + private final Map additionalProperties; + + private FlowActionSalesforceCreateLeadParams( + String connectionId, + Optional firstName, + String lastName, + String company, + Optional email, + Optional phone, + Optional> payload, + Map additionalProperties) { + this.connectionId = connectionId; + this.firstName = firstName; + this.lastName = lastName; + this.company = company; + this.email = email; + this.phone = phone; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + @JsonProperty("last_name") + public String getLastName() { + return lastName; + } + + @JsonProperty("company") + public String getCompany() { + return company; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone") + public Optional getPhone() { + return phone; + } + + @JsonProperty("payload") + public Optional> getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceCreateLeadParams + && equalTo((FlowActionSalesforceCreateLeadParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceCreateLeadParams other) { + return connectionId.equals(other.connectionId) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && company.equals(other.company) + && email.equals(other.email) + && phone.equals(other.phone) + && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, this.firstName, this.lastName, this.company, this.email, this.phone, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + LastNameStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSalesforceCreateLeadParams other); + } + + public interface LastNameStage { + CompanyStage lastName(@NotNull String lastName); + } + + public interface CompanyStage { + _FinalStage company(@NotNull String company); + } + + public interface _FinalStage { + FlowActionSalesforceCreateLeadParams build(); + + _FinalStage firstName(Optional firstName); + + _FinalStage firstName(String firstName); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phone(Optional phone); + + _FinalStage phone(String phone); + + _FinalStage payload(Optional> payload); + + _FinalStage payload(Map payload); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, LastNameStage, CompanyStage, _FinalStage { + private String connectionId; + + private String lastName; + + private String company; + + private Optional> payload = Optional.empty(); + + private Optional phone = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional firstName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceCreateLeadParams other) { + connectionId(other.getConnectionId()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + company(other.getCompany()); + email(other.getEmail()); + phone(other.getPhone()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public LastNameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("last_name") + public CompanyStage lastName(@NotNull String lastName) { + this.lastName = Objects.requireNonNull(lastName, "lastName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("company") + public _FinalStage company(@NotNull String company) { + this.company = Objects.requireNonNull(company, "company must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage payload(Map payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Optional> payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public _FinalStage phone(String phone) { + this.phone = Optional.ofNullable(phone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone", nulls = Nulls.SKIP) + public _FinalStage phone(Optional phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public _FinalStage firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + @java.lang.Override + public FlowActionSalesforceCreateLeadParams build() { + return new FlowActionSalesforceCreateLeadParams( + connectionId, firstName, lastName, company, email, phone, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java new file mode 100644 index 000000000..c2d1c8a14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceGetLead.Builder.class) +public final class FlowActionSalesforceGetLead { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSalesforceGetLeadParams params; + + private final Map additionalProperties; + + private FlowActionSalesforceGetLead( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSalesforceGetLeadParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SALESFORCE"; + } + + @JsonProperty("action") + public String getAction() { + return "GET_LEAD"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSalesforceGetLeadParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceGetLead && equalTo((FlowActionSalesforceGetLead) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceGetLead other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSalesforceGetLead other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSalesforceGetLeadParams params); + } + + public interface _FinalStage { + FlowActionSalesforceGetLead build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSalesforceGetLeadParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceGetLead other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSalesforceGetLeadParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSalesforceGetLead build() { + return new FlowActionSalesforceGetLead(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java new file mode 100644 index 000000000..e6cd077ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceGetLeadParams.Builder.class) +public final class FlowActionSalesforceGetLeadParams { + private final String connectionId; + + private final String leadId; + + private final Map additionalProperties; + + private FlowActionSalesforceGetLeadParams( + String connectionId, String leadId, Map additionalProperties) { + this.connectionId = connectionId; + this.leadId = leadId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("lead_id") + public String getLeadId() { + return leadId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceGetLeadParams && equalTo((FlowActionSalesforceGetLeadParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceGetLeadParams other) { + return connectionId.equals(other.connectionId) && leadId.equals(other.leadId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.leadId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + LeadIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSalesforceGetLeadParams other); + } + + public interface LeadIdStage { + _FinalStage leadId(@NotNull String leadId); + } + + public interface _FinalStage { + FlowActionSalesforceGetLeadParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, LeadIdStage, _FinalStage { + private String connectionId; + + private String leadId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceGetLeadParams other) { + connectionId(other.getConnectionId()); + leadId(other.getLeadId()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public LeadIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("lead_id") + public _FinalStage leadId(@NotNull String leadId) { + this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); + return this; + } + + @java.lang.Override + public FlowActionSalesforceGetLeadParams build() { + return new FlowActionSalesforceGetLeadParams(connectionId, leadId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java new file mode 100644 index 000000000..76a9ea2b5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceSearchLeads.Builder.class) +public final class FlowActionSalesforceSearchLeads { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSalesforceSearchLeadsParams params; + + private final Map additionalProperties; + + private FlowActionSalesforceSearchLeads( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSalesforceSearchLeadsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SALESFORCE"; + } + + @JsonProperty("action") + public String getAction() { + return "SEARCH_LEADS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSalesforceSearchLeadsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceSearchLeads && equalTo((FlowActionSalesforceSearchLeads) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceSearchLeads other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSalesforceSearchLeads other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSalesforceSearchLeadsParams params); + } + + public interface _FinalStage { + FlowActionSalesforceSearchLeads build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSalesforceSearchLeadsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceSearchLeads other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSalesforceSearchLeadsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSalesforceSearchLeads build() { + return new FlowActionSalesforceSearchLeads( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java new file mode 100644 index 000000000..aedef7c4f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceSearchLeadsParams.Builder.class) +public final class FlowActionSalesforceSearchLeadsParams { + private final String connectionId; + + private final FlowActionSalesforceSearchLeadsParamsSearchField searchField; + + private final String searchValue; + + private final List leadFields; + + private final Map additionalProperties; + + private FlowActionSalesforceSearchLeadsParams( + String connectionId, + FlowActionSalesforceSearchLeadsParamsSearchField searchField, + String searchValue, + List leadFields, + Map additionalProperties) { + this.connectionId = connectionId; + this.searchField = searchField; + this.searchValue = searchValue; + this.leadFields = leadFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("search_field") + public FlowActionSalesforceSearchLeadsParamsSearchField getSearchField() { + return searchField; + } + + @JsonProperty("search_value") + public String getSearchValue() { + return searchValue; + } + + @JsonProperty("lead_fields") + public List getLeadFields() { + return leadFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceSearchLeadsParams + && equalTo((FlowActionSalesforceSearchLeadsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceSearchLeadsParams other) { + return connectionId.equals(other.connectionId) + && searchField.equals(other.searchField) + && searchValue.equals(other.searchValue) + && leadFields.equals(other.leadFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.searchField, this.searchValue, this.leadFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + SearchFieldStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSalesforceSearchLeadsParams other); + } + + public interface SearchFieldStage { + SearchValueStage searchField(@NotNull FlowActionSalesforceSearchLeadsParamsSearchField searchField); + } + + public interface SearchValueStage { + _FinalStage searchValue(@NotNull String searchValue); + } + + public interface _FinalStage { + FlowActionSalesforceSearchLeadsParams build(); + + _FinalStage leadFields(List leadFields); + + _FinalStage addLeadFields(String leadFields); + + _FinalStage addAllLeadFields(List leadFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, SearchFieldStage, SearchValueStage, _FinalStage { + private String connectionId; + + private FlowActionSalesforceSearchLeadsParamsSearchField searchField; + + private String searchValue; + + private List leadFields = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceSearchLeadsParams other) { + connectionId(other.getConnectionId()); + searchField(other.getSearchField()); + searchValue(other.getSearchValue()); + leadFields(other.getLeadFields()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public SearchFieldStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("search_field") + public SearchValueStage searchField(@NotNull FlowActionSalesforceSearchLeadsParamsSearchField searchField) { + this.searchField = Objects.requireNonNull(searchField, "searchField must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("search_value") + public _FinalStage searchValue(@NotNull String searchValue) { + this.searchValue = Objects.requireNonNull(searchValue, "searchValue must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllLeadFields(List leadFields) { + if (leadFields != null) { + this.leadFields.addAll(leadFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addLeadFields(String leadFields) { + this.leadFields.add(leadFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "lead_fields", nulls = Nulls.SKIP) + public _FinalStage leadFields(List leadFields) { + this.leadFields.clear(); + if (leadFields != null) { + this.leadFields.addAll(leadFields); + } + return this; + } + + @java.lang.Override + public FlowActionSalesforceSearchLeadsParams build() { + return new FlowActionSalesforceSearchLeadsParams( + connectionId, searchField, searchValue, leadFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java new file mode 100644 index 000000000..e0a4c7c75 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionSalesforceSearchLeadsParamsSearchField { + public static final FlowActionSalesforceSearchLeadsParamsSearchField EMAIL = + new FlowActionSalesforceSearchLeadsParamsSearchField(Value.EMAIL, "email"); + + public static final FlowActionSalesforceSearchLeadsParamsSearchField ALL = + new FlowActionSalesforceSearchLeadsParamsSearchField(Value.ALL, "all"); + + public static final FlowActionSalesforceSearchLeadsParamsSearchField PHONE = + new FlowActionSalesforceSearchLeadsParamsSearchField(Value.PHONE, "phone"); + + public static final FlowActionSalesforceSearchLeadsParamsSearchField NAME = + new FlowActionSalesforceSearchLeadsParamsSearchField(Value.NAME, "name"); + + private final Value value; + + private final String string; + + FlowActionSalesforceSearchLeadsParamsSearchField(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionSalesforceSearchLeadsParamsSearchField + && this.string.equals(((FlowActionSalesforceSearchLeadsParamsSearchField) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case ALL: + return visitor.visitAll(); + case PHONE: + return visitor.visitPhone(); + case NAME: + return visitor.visitName(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionSalesforceSearchLeadsParamsSearchField valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "all": + return ALL; + case "phone": + return PHONE; + case "name": + return NAME; + default: + return new FlowActionSalesforceSearchLeadsParamsSearchField(Value.UNKNOWN, value); + } + } + + public enum Value { + EMAIL, + + NAME, + + PHONE, + + ALL, + + UNKNOWN + } + + public interface Visitor { + T visitEmail(); + + T visitName(); + + T visitPhone(); + + T visitAll(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java new file mode 100644 index 000000000..e1a6bca9a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceUpdateLead.Builder.class) +public final class FlowActionSalesforceUpdateLead { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSalesforceUpdateLeadParams params; + + private final Map additionalProperties; + + private FlowActionSalesforceUpdateLead( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSalesforceUpdateLeadParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SALESFORCE"; + } + + @JsonProperty("action") + public String getAction() { + return "UPDATE_LEAD"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSalesforceUpdateLeadParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceUpdateLead && equalTo((FlowActionSalesforceUpdateLead) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceUpdateLead other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSalesforceUpdateLead other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSalesforceUpdateLeadParams params); + } + + public interface _FinalStage { + FlowActionSalesforceUpdateLead build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSalesforceUpdateLeadParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceUpdateLead other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSalesforceUpdateLeadParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSalesforceUpdateLead build() { + return new FlowActionSalesforceUpdateLead( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java new file mode 100644 index 000000000..1cbcaf10a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSalesforceUpdateLeadParams.Builder.class) +public final class FlowActionSalesforceUpdateLeadParams { + private final String connectionId; + + private final String leadId; + + private final Optional> payload; + + private final Map additionalProperties; + + private FlowActionSalesforceUpdateLeadParams( + String connectionId, + String leadId, + Optional> payload, + Map additionalProperties) { + this.connectionId = connectionId; + this.leadId = leadId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("lead_id") + public String getLeadId() { + return leadId; + } + + @JsonProperty("payload") + public Optional> getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSalesforceUpdateLeadParams + && equalTo((FlowActionSalesforceUpdateLeadParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSalesforceUpdateLeadParams other) { + return connectionId.equals(other.connectionId) && leadId.equals(other.leadId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.leadId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + LeadIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSalesforceUpdateLeadParams other); + } + + public interface LeadIdStage { + _FinalStage leadId(@NotNull String leadId); + } + + public interface _FinalStage { + FlowActionSalesforceUpdateLeadParams build(); + + _FinalStage payload(Optional> payload); + + _FinalStage payload(Map payload); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, LeadIdStage, _FinalStage { + private String connectionId; + + private String leadId; + + private Optional> payload = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSalesforceUpdateLeadParams other) { + connectionId(other.getConnectionId()); + leadId(other.getLeadId()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public LeadIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("lead_id") + public _FinalStage leadId(@NotNull String leadId) { + this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage payload(Map payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public _FinalStage payload(Optional> payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public FlowActionSalesforceUpdateLeadParams build() { + return new FlowActionSalesforceUpdateLeadParams(connectionId, leadId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java new file mode 100644 index 000000000..742b08315 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSendgridSendEmail.Builder.class) +public final class FlowActionSendgridSendEmail { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSendgridSendEmailParams params; + + private final Map additionalProperties; + + private FlowActionSendgridSendEmail( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSendgridSendEmailParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SENDGRID"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_EMAIL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSendgridSendEmailParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSendgridSendEmail && equalTo((FlowActionSendgridSendEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSendgridSendEmail other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSendgridSendEmail other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSendgridSendEmailParams params); + } + + public interface _FinalStage { + FlowActionSendgridSendEmail build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSendgridSendEmailParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSendgridSendEmail other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSendgridSendEmailParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSendgridSendEmail build() { + return new FlowActionSendgridSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java new file mode 100644 index 000000000..6fed0ff60 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSendgridSendEmailParams.Builder.class) +public final class FlowActionSendgridSendEmailParams { + private final String connectionId; + + private final FlowActionSendgridSendEmailParamsPerson from; + + private final List personalizations; + + private final Map additionalProperties; + + private FlowActionSendgridSendEmailParams( + String connectionId, + FlowActionSendgridSendEmailParamsPerson from, + List personalizations, + Map additionalProperties) { + this.connectionId = connectionId; + this.from = from; + this.personalizations = personalizations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("from") + public FlowActionSendgridSendEmailParamsPerson getFrom() { + return from; + } + + @JsonProperty("personalizations") + public List getPersonalizations() { + return personalizations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSendgridSendEmailParams && equalTo((FlowActionSendgridSendEmailParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSendgridSendEmailParams other) { + return connectionId.equals(other.connectionId) + && from.equals(other.from) + && personalizations.equals(other.personalizations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.from, this.personalizations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + FromStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSendgridSendEmailParams other); + } + + public interface FromStage { + _FinalStage from(@NotNull FlowActionSendgridSendEmailParamsPerson from); + } + + public interface _FinalStage { + FlowActionSendgridSendEmailParams build(); + + _FinalStage personalizations(List personalizations); + + _FinalStage addPersonalizations(Object personalizations); + + _FinalStage addAllPersonalizations(List personalizations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, FromStage, _FinalStage { + private String connectionId; + + private FlowActionSendgridSendEmailParamsPerson from; + + private List personalizations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSendgridSendEmailParams other) { + connectionId(other.getConnectionId()); + from(other.getFrom()); + personalizations(other.getPersonalizations()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public FromStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("from") + public _FinalStage from(@NotNull FlowActionSendgridSendEmailParamsPerson from) { + this.from = Objects.requireNonNull(from, "from must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllPersonalizations(List personalizations) { + if (personalizations != null) { + this.personalizations.addAll(personalizations); + } + return this; + } + + @java.lang.Override + public _FinalStage addPersonalizations(Object personalizations) { + this.personalizations.add(personalizations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "personalizations", nulls = Nulls.SKIP) + public _FinalStage personalizations(List personalizations) { + this.personalizations.clear(); + if (personalizations != null) { + this.personalizations.addAll(personalizations); + } + return this; + } + + @java.lang.Override + public FlowActionSendgridSendEmailParams build() { + return new FlowActionSendgridSendEmailParams(connectionId, from, personalizations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java new file mode 100644 index 000000000..17c898bcd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSendgridSendEmailParamsPerson.Builder.class) +public final class FlowActionSendgridSendEmailParamsPerson { + private final Optional name; + + private final String email; + + private final Map additionalProperties; + + private FlowActionSendgridSendEmailParamsPerson( + Optional name, String email, Map additionalProperties) { + this.name = name; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSendgridSendEmailParamsPerson + && equalTo((FlowActionSendgridSendEmailParamsPerson) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSendgridSendEmailParamsPerson other) { + return name.equals(other.name) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + + Builder from(FlowActionSendgridSendEmailParamsPerson other); + } + + public interface _FinalStage { + FlowActionSendgridSendEmailParamsPerson build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSendgridSendEmailParamsPerson other) { + name(other.getName()); + email(other.getEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public FlowActionSendgridSendEmailParamsPerson build() { + return new FlowActionSendgridSendEmailParamsPerson(name, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java new file mode 100644 index 000000000..ef3240398 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSlackPostMessage.Builder.class) +public final class FlowActionSlackPostMessage { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionSlackPostMessageParams params; + + private final Map additionalProperties; + + private FlowActionSlackPostMessage( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionSlackPostMessageParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "SLACK"; + } + + @JsonProperty("action") + public String getAction() { + return "POST_MESSAGE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionSlackPostMessageParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSlackPostMessage && equalTo((FlowActionSlackPostMessage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSlackPostMessage other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionSlackPostMessage other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionSlackPostMessageParams params); + } + + public interface _FinalStage { + FlowActionSlackPostMessage build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionSlackPostMessageParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSlackPostMessage other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionSlackPostMessageParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionSlackPostMessage build() { + return new FlowActionSlackPostMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java new file mode 100644 index 000000000..06aa70c05 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSlackPostMessageParams.Builder.class) +public final class FlowActionSlackPostMessageParams { + private final String connectionId; + + private final Optional text; + + private final Optional> attachments; + + private final Map additionalProperties; + + private FlowActionSlackPostMessageParams( + String connectionId, + Optional text, + Optional> attachments, + Map additionalProperties) { + this.connectionId = connectionId; + this.text = text; + this.attachments = attachments; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("text") + public Optional getText() { + return text; + } + + @JsonProperty("attachments") + public Optional> getAttachments() { + return attachments; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSlackPostMessageParams && equalTo((FlowActionSlackPostMessageParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSlackPostMessageParams other) { + return connectionId.equals(other.connectionId) + && text.equals(other.text) + && attachments.equals(other.attachments); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.text, this.attachments); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionSlackPostMessageParams other); + } + + public interface _FinalStage { + FlowActionSlackPostMessageParams build(); + + _FinalStage text(Optional text); + + _FinalStage text(String text); + + _FinalStage attachments(Optional> attachments); + + _FinalStage attachments(List attachments); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional> attachments = Optional.empty(); + + private Optional text = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSlackPostMessageParams other) { + connectionId(other.getConnectionId()); + text(other.getText()); + attachments(other.getAttachments()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage attachments(List attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + @java.lang.Override + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public _FinalStage attachments(Optional> attachments) { + this.attachments = attachments; + return this; + } + + @java.lang.Override + public _FinalStage text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + @java.lang.Override + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public _FinalStage text(Optional text) { + this.text = text; + return this; + } + + @java.lang.Override + public FlowActionSlackPostMessageParams build() { + return new FlowActionSlackPostMessageParams(connectionId, text, attachments, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java new file mode 100644 index 000000000..ab9ae9bad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSlackPostMessageParamsAttachment.Builder.class) +public final class FlowActionSlackPostMessageParamsAttachment { + private final Optional color; + + private final Optional pretext; + + private final Optional text; + + private final Optional> fields; + + private final Map additionalProperties; + + private FlowActionSlackPostMessageParamsAttachment( + Optional color, + Optional pretext, + Optional text, + Optional> fields, + Map additionalProperties) { + this.color = color; + this.pretext = pretext; + this.text = text; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("pretext") + public Optional getPretext() { + return pretext; + } + + @JsonProperty("text") + public Optional getText() { + return text; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSlackPostMessageParamsAttachment + && equalTo((FlowActionSlackPostMessageParamsAttachment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSlackPostMessageParamsAttachment other) { + return color.equals(other.color) + && pretext.equals(other.pretext) + && text.equals(other.text) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.color, this.pretext, this.text, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional color = Optional.empty(); + + private Optional pretext = Optional.empty(); + + private Optional text = Optional.empty(); + + private Optional> fields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionSlackPostMessageParamsAttachment other) { + color(other.getColor()); + pretext(other.getPretext()); + text(other.getText()); + fields(other.getFields()); + return this; + } + + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public Builder color(Optional color) { + this.color = color; + return this; + } + + public Builder color(FlowActionSlackPostMessageParamsAttachmentColor color) { + this.color = Optional.ofNullable(color); + return this; + } + + @JsonSetter(value = "pretext", nulls = Nulls.SKIP) + public Builder pretext(Optional pretext) { + this.pretext = pretext; + return this; + } + + public Builder pretext(String pretext) { + this.pretext = Optional.ofNullable(pretext); + return this; + } + + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public Builder text(Optional text) { + this.text = text; + return this; + } + + public Builder text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(Optional> fields) { + this.fields = fields; + return this; + } + + public Builder fields(List fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + public FlowActionSlackPostMessageParamsAttachment build() { + return new FlowActionSlackPostMessageParamsAttachment(color, pretext, text, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java new file mode 100644 index 000000000..842a7764b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionSlackPostMessageParamsAttachmentColor { + public static final FlowActionSlackPostMessageParamsAttachmentColor DANGER = + new FlowActionSlackPostMessageParamsAttachmentColor(Value.DANGER, "DANGER"); + + public static final FlowActionSlackPostMessageParamsAttachmentColor GOOD = + new FlowActionSlackPostMessageParamsAttachmentColor(Value.GOOD, "GOOD"); + + public static final FlowActionSlackPostMessageParamsAttachmentColor WARNING = + new FlowActionSlackPostMessageParamsAttachmentColor(Value.WARNING, "WARNING"); + + private final Value value; + + private final String string; + + FlowActionSlackPostMessageParamsAttachmentColor(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionSlackPostMessageParamsAttachmentColor + && this.string.equals(((FlowActionSlackPostMessageParamsAttachmentColor) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DANGER: + return visitor.visitDanger(); + case GOOD: + return visitor.visitGood(); + case WARNING: + return visitor.visitWarning(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionSlackPostMessageParamsAttachmentColor valueOf(String value) { + switch (value) { + case "DANGER": + return DANGER; + case "GOOD": + return GOOD; + case "WARNING": + return WARNING; + default: + return new FlowActionSlackPostMessageParamsAttachmentColor(Value.UNKNOWN, value); + } + } + + public enum Value { + GOOD, + + WARNING, + + DANGER, + + UNKNOWN + } + + public interface Visitor { + T visitGood(); + + T visitWarning(); + + T visitDanger(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java new file mode 100644 index 000000000..51cacf5ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionSlackPostMessageParamsAttachmentField.Builder.class) +public final class FlowActionSlackPostMessageParamsAttachmentField { + private final String title; + + private final Optional value; + + private final Optional short_; + + private final Map additionalProperties; + + private FlowActionSlackPostMessageParamsAttachmentField( + String title, Optional value, Optional short_, Map additionalProperties) { + this.title = title; + this.value = value; + this.short_ = short_; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @JsonProperty("short") + public Optional getShort() { + return short_; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionSlackPostMessageParamsAttachmentField + && equalTo((FlowActionSlackPostMessageParamsAttachmentField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionSlackPostMessageParamsAttachmentField other) { + return title.equals(other.title) && value.equals(other.value) && short_.equals(other.short_); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.title, this.value, this.short_); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + _FinalStage title(@NotNull String title); + + Builder from(FlowActionSlackPostMessageParamsAttachmentField other); + } + + public interface _FinalStage { + FlowActionSlackPostMessageParamsAttachmentField build(); + + _FinalStage value(Optional value); + + _FinalStage value(String value); + + _FinalStage short_(Optional short_); + + _FinalStage short_(Boolean short_); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, _FinalStage { + private String title; + + private Optional short_ = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionSlackPostMessageParamsAttachmentField other) { + title(other.getTitle()); + value(other.getValue()); + short_(other.getShort()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public _FinalStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage short_(Boolean short_) { + this.short_ = Optional.ofNullable(short_); + return this; + } + + @java.lang.Override + @JsonSetter(value = "short", nulls = Nulls.SKIP) + public _FinalStage short_(Optional short_) { + this.short_ = short_; + return this; + } + + @java.lang.Override + public _FinalStage value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public FlowActionSlackPostMessageParamsAttachmentField build() { + return new FlowActionSlackPostMessageParamsAttachmentField(title, value, short_, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java new file mode 100644 index 000000000..6496bccf0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionStripe.Deserializer.class) +public final class FlowActionStripe { + private final Object value; + + private final int type; + + private FlowActionStripe(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionStripeAddTaxId) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionStripeCreateCustomer) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowActionStripeCreatePortalSession) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowActionStripeDeleteTaxId) this.value); + } else if (this.type == 4) { + return visitor.visit((FlowActionStripeFindCustomers) this.value); + } else if (this.type == 5) { + return visitor.visit((FlowActionStripeGetCustomer) this.value); + } else if (this.type == 6) { + return visitor.visit((FlowActionStripeUpdateCustomer) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripe && equalTo((FlowActionStripe) other); + } + + private boolean equalTo(FlowActionStripe other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionStripe of(FlowActionStripeAddTaxId value) { + return new FlowActionStripe(value, 0); + } + + public static FlowActionStripe of(FlowActionStripeCreateCustomer value) { + return new FlowActionStripe(value, 1); + } + + public static FlowActionStripe of(FlowActionStripeCreatePortalSession value) { + return new FlowActionStripe(value, 2); + } + + public static FlowActionStripe of(FlowActionStripeDeleteTaxId value) { + return new FlowActionStripe(value, 3); + } + + public static FlowActionStripe of(FlowActionStripeFindCustomers value) { + return new FlowActionStripe(value, 4); + } + + public static FlowActionStripe of(FlowActionStripeGetCustomer value) { + return new FlowActionStripe(value, 5); + } + + public static FlowActionStripe of(FlowActionStripeUpdateCustomer value) { + return new FlowActionStripe(value, 6); + } + + public interface Visitor { + T visit(FlowActionStripeAddTaxId value); + + T visit(FlowActionStripeCreateCustomer value); + + T visit(FlowActionStripeCreatePortalSession value); + + T visit(FlowActionStripeDeleteTaxId value); + + T visit(FlowActionStripeFindCustomers value); + + T visit(FlowActionStripeGetCustomer value); + + T visit(FlowActionStripeUpdateCustomer value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionStripe.class); + } + + @java.lang.Override + public FlowActionStripe deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeAddTaxId.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeCreateCustomer.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeCreatePortalSession.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeDeleteTaxId.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeFindCustomers.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeGetCustomer.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionStripeUpdateCustomer.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java new file mode 100644 index 000000000..f98da2789 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeAddTaxId.Builder.class) +public final class FlowActionStripeAddTaxId { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeAddTaxIdParams params; + + private final Map additionalProperties; + + private FlowActionStripeAddTaxId( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeAddTaxIdParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "ADD_TAX_ID"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeAddTaxIdParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeAddTaxId && equalTo((FlowActionStripeAddTaxId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeAddTaxId other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeAddTaxId other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeAddTaxIdParams params); + } + + public interface _FinalStage { + FlowActionStripeAddTaxId build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeAddTaxIdParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeAddTaxId other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeAddTaxIdParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeAddTaxId build() { + return new FlowActionStripeAddTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java new file mode 100644 index 000000000..dd86ca001 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeAddTaxIdParams.Builder.class) +public final class FlowActionStripeAddTaxIdParams { + private final String connectionId; + + private final String customerId; + + private final String type; + + private final String value; + + private final Map additionalProperties; + + private FlowActionStripeAddTaxIdParams( + String connectionId, + String customerId, + String type, + String value, + Map additionalProperties) { + this.connectionId = connectionId; + this.customerId = customerId; + this.type = type; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("customer_id") + public String getCustomerId() { + return customerId; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeAddTaxIdParams && equalTo((FlowActionStripeAddTaxIdParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeAddTaxIdParams other) { + return connectionId.equals(other.connectionId) + && customerId.equals(other.customerId) + && type.equals(other.type) + && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.customerId, this.type, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + CustomerIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeAddTaxIdParams other); + } + + public interface CustomerIdStage { + TypeStage customerId(@NotNull String customerId); + } + + public interface TypeStage { + ValueStage type(@NotNull String type); + } + + public interface ValueStage { + _FinalStage value(@NotNull String value); + } + + public interface _FinalStage { + FlowActionStripeAddTaxIdParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, CustomerIdStage, TypeStage, ValueStage, _FinalStage { + private String connectionId; + + private String customerId; + + private String type; + + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeAddTaxIdParams other) { + connectionId(other.getConnectionId()); + customerId(other.getCustomerId()); + type(other.getType()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public CustomerIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("customer_id") + public TypeStage customerId(@NotNull String customerId) { + this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ValueStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public FlowActionStripeAddTaxIdParams build() { + return new FlowActionStripeAddTaxIdParams(connectionId, customerId, type, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java new file mode 100644 index 000000000..f4eabdc3b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeAddress.Builder.class) +public final class FlowActionStripeAddress { + private final Optional line1; + + private final Optional line2; + + private final Optional postalCode; + + private final Optional city; + + private final Optional state; + + private final Optional country; + + private final Map additionalProperties; + + private FlowActionStripeAddress( + Optional line1, + Optional line2, + Optional postalCode, + Optional city, + Optional state, + Optional country, + Map additionalProperties) { + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.city = city; + this.state = state; + this.country = country; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("line1") + public Optional getLine1() { + return line1; + } + + @JsonProperty("line2") + public Optional getLine2() { + return line2; + } + + @JsonProperty("postalCode") + public Optional getPostalCode() { + return postalCode; + } + + @JsonProperty("city") + public Optional getCity() { + return city; + } + + @JsonProperty("state") + public Optional getState() { + return state; + } + + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeAddress && equalTo((FlowActionStripeAddress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeAddress other) { + return line1.equals(other.line1) + && line2.equals(other.line2) + && postalCode.equals(other.postalCode) + && city.equals(other.city) + && state.equals(other.state) + && country.equals(other.country); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.line1, this.line2, this.postalCode, this.city, this.state, this.country); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional line1 = Optional.empty(); + + private Optional line2 = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional state = Optional.empty(); + + private Optional country = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowActionStripeAddress other) { + line1(other.getLine1()); + line2(other.getLine2()); + postalCode(other.getPostalCode()); + city(other.getCity()); + state(other.getState()); + country(other.getCountry()); + return this; + } + + @JsonSetter(value = "line1", nulls = Nulls.SKIP) + public Builder line1(Optional line1) { + this.line1 = line1; + return this; + } + + public Builder line1(String line1) { + this.line1 = Optional.ofNullable(line1); + return this; + } + + @JsonSetter(value = "line2", nulls = Nulls.SKIP) + public Builder line2(Optional line2) { + this.line2 = line2; + return this; + } + + public Builder line2(String line2) { + this.line2 = Optional.ofNullable(line2); + return this; + } + + @JsonSetter(value = "postalCode", nulls = Nulls.SKIP) + public Builder postalCode(Optional postalCode) { + this.postalCode = postalCode; + return this; + } + + public Builder postalCode(String postalCode) { + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(String country) { + this.country = Optional.ofNullable(country); + return this; + } + + public FlowActionStripeAddress build() { + return new FlowActionStripeAddress(line1, line2, postalCode, city, state, country, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java new file mode 100644 index 000000000..4249a817e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeCreateCustomer.Builder.class) +public final class FlowActionStripeCreateCustomer { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeCreateCustomerParams params; + + private final Map additionalProperties; + + private FlowActionStripeCreateCustomer( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeCreateCustomerParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_CUSTOMER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeCreateCustomerParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeCreateCustomer && equalTo((FlowActionStripeCreateCustomer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeCreateCustomer other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeCreateCustomer other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeCreateCustomerParams params); + } + + public interface _FinalStage { + FlowActionStripeCreateCustomer build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeCreateCustomerParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeCreateCustomer other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeCreateCustomerParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeCreateCustomer build() { + return new FlowActionStripeCreateCustomer( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java new file mode 100644 index 000000000..cf31e6686 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java @@ -0,0 +1,366 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeCreateCustomerParams.Builder.class) +public final class FlowActionStripeCreateCustomerParams { + private final String connectionId; + + private final Optional taxId; + + private final Optional name; + + private final Optional description; + + private final Optional email; + + private final Optional phone; + + private final Optional taxExempt; + + private final Optional address; + + private final Optional> metadata; + + private final Map additionalProperties; + + private FlowActionStripeCreateCustomerParams( + String connectionId, + Optional taxId, + Optional name, + Optional description, + Optional email, + Optional phone, + Optional taxExempt, + Optional address, + Optional> metadata, + Map additionalProperties) { + this.connectionId = connectionId; + this.taxId = taxId; + this.name = name; + this.description = description; + this.email = email; + this.phone = phone; + this.taxExempt = taxExempt; + this.address = address; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("tax_id") + public Optional getTaxId() { + return taxId; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone") + public Optional getPhone() { + return phone; + } + + @JsonProperty("tax_exempt") + public Optional getTaxExempt() { + return taxExempt; + } + + @JsonProperty("address") + public Optional getAddress() { + return address; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeCreateCustomerParams + && equalTo((FlowActionStripeCreateCustomerParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeCreateCustomerParams other) { + return connectionId.equals(other.connectionId) + && taxId.equals(other.taxId) + && name.equals(other.name) + && description.equals(other.description) + && email.equals(other.email) + && phone.equals(other.phone) + && taxExempt.equals(other.taxExempt) + && address.equals(other.address) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.taxId, + this.name, + this.description, + this.email, + this.phone, + this.taxExempt, + this.address, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeCreateCustomerParams other); + } + + public interface _FinalStage { + FlowActionStripeCreateCustomerParams build(); + + _FinalStage taxId(Optional taxId); + + _FinalStage taxId(FlowActionStripeTaxId taxId); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phone(Optional phone); + + _FinalStage phone(String phone); + + _FinalStage taxExempt(Optional taxExempt); + + _FinalStage taxExempt(String taxExempt); + + _FinalStage address(Optional address); + + _FinalStage address(FlowActionStripeAddress address); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional> metadata = Optional.empty(); + + private Optional address = Optional.empty(); + + private Optional taxExempt = Optional.empty(); + + private Optional phone = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional taxId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeCreateCustomerParams other) { + connectionId(other.getConnectionId()); + taxId(other.getTaxId()); + name(other.getName()); + description(other.getDescription()); + email(other.getEmail()); + phone(other.getPhone()); + taxExempt(other.getTaxExempt()); + address(other.getAddress()); + metadata(other.getMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + @java.lang.Override + public _FinalStage address(FlowActionStripeAddress address) { + this.address = Optional.ofNullable(address); + return this; + } + + @java.lang.Override + @JsonSetter(value = "address", nulls = Nulls.SKIP) + public _FinalStage address(Optional address) { + this.address = address; + return this; + } + + @java.lang.Override + public _FinalStage taxExempt(String taxExempt) { + this.taxExempt = Optional.ofNullable(taxExempt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) + public _FinalStage taxExempt(Optional taxExempt) { + this.taxExempt = taxExempt; + return this; + } + + @java.lang.Override + public _FinalStage phone(String phone) { + this.phone = Optional.ofNullable(phone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone", nulls = Nulls.SKIP) + public _FinalStage phone(Optional phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage taxId(FlowActionStripeTaxId taxId) { + this.taxId = Optional.ofNullable(taxId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tax_id", nulls = Nulls.SKIP) + public _FinalStage taxId(Optional taxId) { + this.taxId = taxId; + return this; + } + + @java.lang.Override + public FlowActionStripeCreateCustomerParams build() { + return new FlowActionStripeCreateCustomerParams( + connectionId, + taxId, + name, + description, + email, + phone, + taxExempt, + address, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java new file mode 100644 index 000000000..2ec512cc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeCreatePortalSession.Builder.class) +public final class FlowActionStripeCreatePortalSession { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeCreatePortalSessionParams params; + + private final Map additionalProperties; + + private FlowActionStripeCreatePortalSession( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeCreatePortalSessionParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "CREATE_PORTAL_SESSION"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeCreatePortalSessionParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeCreatePortalSession + && equalTo((FlowActionStripeCreatePortalSession) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeCreatePortalSession other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeCreatePortalSession other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeCreatePortalSessionParams params); + } + + public interface _FinalStage { + FlowActionStripeCreatePortalSession build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeCreatePortalSessionParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeCreatePortalSession other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeCreatePortalSessionParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeCreatePortalSession build() { + return new FlowActionStripeCreatePortalSession( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java new file mode 100644 index 000000000..77748d777 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeCreatePortalSessionParams.Builder.class) +public final class FlowActionStripeCreatePortalSessionParams { + private final String connectionId; + + private final String customerId; + + private final Optional returnUrl; + + private final Map additionalProperties; + + private FlowActionStripeCreatePortalSessionParams( + String connectionId, + String customerId, + Optional returnUrl, + Map additionalProperties) { + this.connectionId = connectionId; + this.customerId = customerId; + this.returnUrl = returnUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("customer_id") + public String getCustomerId() { + return customerId; + } + + @JsonProperty("return_url") + public Optional getReturnUrl() { + return returnUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeCreatePortalSessionParams + && equalTo((FlowActionStripeCreatePortalSessionParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeCreatePortalSessionParams other) { + return connectionId.equals(other.connectionId) + && customerId.equals(other.customerId) + && returnUrl.equals(other.returnUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.customerId, this.returnUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + CustomerIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeCreatePortalSessionParams other); + } + + public interface CustomerIdStage { + _FinalStage customerId(@NotNull String customerId); + } + + public interface _FinalStage { + FlowActionStripeCreatePortalSessionParams build(); + + _FinalStage returnUrl(Optional returnUrl); + + _FinalStage returnUrl(String returnUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, CustomerIdStage, _FinalStage { + private String connectionId; + + private String customerId; + + private Optional returnUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeCreatePortalSessionParams other) { + connectionId(other.getConnectionId()); + customerId(other.getCustomerId()); + returnUrl(other.getReturnUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public CustomerIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("customer_id") + public _FinalStage customerId(@NotNull String customerId) { + this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage returnUrl(String returnUrl) { + this.returnUrl = Optional.ofNullable(returnUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "return_url", nulls = Nulls.SKIP) + public _FinalStage returnUrl(Optional returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + @java.lang.Override + public FlowActionStripeCreatePortalSessionParams build() { + return new FlowActionStripeCreatePortalSessionParams( + connectionId, customerId, returnUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java new file mode 100644 index 000000000..a7b0ad519 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeDeleteTaxId.Builder.class) +public final class FlowActionStripeDeleteTaxId { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeDeleteTaxIdParams params; + + private final Map additionalProperties; + + private FlowActionStripeDeleteTaxId( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeDeleteTaxIdParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "DELETE_TAX_ID"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeDeleteTaxIdParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeDeleteTaxId && equalTo((FlowActionStripeDeleteTaxId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeDeleteTaxId other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeDeleteTaxId other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeDeleteTaxIdParams params); + } + + public interface _FinalStage { + FlowActionStripeDeleteTaxId build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeDeleteTaxIdParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeDeleteTaxId other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeDeleteTaxIdParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeDeleteTaxId build() { + return new FlowActionStripeDeleteTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java new file mode 100644 index 000000000..f180442cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeDeleteTaxIdParams.Builder.class) +public final class FlowActionStripeDeleteTaxIdParams { + private final String connectionId; + + private final String customerId; + + private final String id; + + private final Map additionalProperties; + + private FlowActionStripeDeleteTaxIdParams( + String connectionId, String customerId, String id, Map additionalProperties) { + this.connectionId = connectionId; + this.customerId = customerId; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("customer_id") + public String getCustomerId() { + return customerId; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeDeleteTaxIdParams && equalTo((FlowActionStripeDeleteTaxIdParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeDeleteTaxIdParams other) { + return connectionId.equals(other.connectionId) && customerId.equals(other.customerId) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.customerId, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + CustomerIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeDeleteTaxIdParams other); + } + + public interface CustomerIdStage { + IdStage customerId(@NotNull String customerId); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + FlowActionStripeDeleteTaxIdParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, CustomerIdStage, IdStage, _FinalStage { + private String connectionId; + + private String customerId; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeDeleteTaxIdParams other) { + connectionId(other.getConnectionId()); + customerId(other.getCustomerId()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public CustomerIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("customer_id") + public IdStage customerId(@NotNull String customerId) { + this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public FlowActionStripeDeleteTaxIdParams build() { + return new FlowActionStripeDeleteTaxIdParams(connectionId, customerId, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java new file mode 100644 index 000000000..7012c5db5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeFindCustomers.Builder.class) +public final class FlowActionStripeFindCustomers { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeFindCustomersParams params; + + private final Map additionalProperties; + + private FlowActionStripeFindCustomers( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeFindCustomersParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "FIND_CUSTOMERS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeFindCustomersParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeFindCustomers && equalTo((FlowActionStripeFindCustomers) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeFindCustomers other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeFindCustomers other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeFindCustomersParams params); + } + + public interface _FinalStage { + FlowActionStripeFindCustomers build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeFindCustomersParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeFindCustomers other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeFindCustomersParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeFindCustomers build() { + return new FlowActionStripeFindCustomers(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java new file mode 100644 index 000000000..3d72d5a63 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeFindCustomersParams.Builder.class) +public final class FlowActionStripeFindCustomersParams { + private final String connectionId; + + private final String email; + + private final Map additionalProperties; + + private FlowActionStripeFindCustomersParams( + String connectionId, String email, Map additionalProperties) { + this.connectionId = connectionId; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeFindCustomersParams + && equalTo((FlowActionStripeFindCustomersParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeFindCustomersParams other) { + return connectionId.equals(other.connectionId) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + EmailStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeFindCustomersParams other); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + } + + public interface _FinalStage { + FlowActionStripeFindCustomersParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, EmailStage, _FinalStage { + private String connectionId; + + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeFindCustomersParams other) { + connectionId(other.getConnectionId()); + email(other.getEmail()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public EmailStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public FlowActionStripeFindCustomersParams build() { + return new FlowActionStripeFindCustomersParams(connectionId, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java new file mode 100644 index 000000000..2d6edbdf1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeGetCustomer.Builder.class) +public final class FlowActionStripeGetCustomer { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeGetCustomerParams params; + + private final Map additionalProperties; + + private FlowActionStripeGetCustomer( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeGetCustomerParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "GET_CUSTOMER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeGetCustomerParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeGetCustomer && equalTo((FlowActionStripeGetCustomer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeGetCustomer other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeGetCustomer other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeGetCustomerParams params); + } + + public interface _FinalStage { + FlowActionStripeGetCustomer build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeGetCustomerParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeGetCustomer other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeGetCustomerParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeGetCustomer build() { + return new FlowActionStripeGetCustomer(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java new file mode 100644 index 000000000..0964cf72c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeGetCustomerParams.Builder.class) +public final class FlowActionStripeGetCustomerParams { + private final String connectionId; + + private final String id; + + private final Map additionalProperties; + + private FlowActionStripeGetCustomerParams( + String connectionId, String id, Map additionalProperties) { + this.connectionId = connectionId; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeGetCustomerParams && equalTo((FlowActionStripeGetCustomerParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeGetCustomerParams other) { + return connectionId.equals(other.connectionId) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + IdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeGetCustomerParams other); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + FlowActionStripeGetCustomerParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, IdStage, _FinalStage { + private String connectionId; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeGetCustomerParams other) { + connectionId(other.getConnectionId()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public IdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public FlowActionStripeGetCustomerParams build() { + return new FlowActionStripeGetCustomerParams(connectionId, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java new file mode 100644 index 000000000..195ec6824 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeTaxId.Builder.class) +public final class FlowActionStripeTaxId { + private final String type; + + private final String value; + + private final Map additionalProperties; + + private FlowActionStripeTaxId(String type, String value, Map additionalProperties) { + this.type = type; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeTaxId && equalTo((FlowActionStripeTaxId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeTaxId other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ValueStage type(@NotNull String type); + + Builder from(FlowActionStripeTaxId other); + } + + public interface ValueStage { + _FinalStage value(@NotNull String value); + } + + public interface _FinalStage { + FlowActionStripeTaxId build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ValueStage, _FinalStage { + private String type; + + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeTaxId other) { + type(other.getType()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ValueStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public FlowActionStripeTaxId build() { + return new FlowActionStripeTaxId(type, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java new file mode 100644 index 000000000..c05a51589 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeUpdateCustomer.Builder.class) +public final class FlowActionStripeUpdateCustomer { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionStripeUpdateCustomerParams params; + + private final Map additionalProperties; + + private FlowActionStripeUpdateCustomer( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionStripeUpdateCustomerParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "STRIPE"; + } + + @JsonProperty("action") + public String getAction() { + return "UPDATE_CUSTOMER"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionStripeUpdateCustomerParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeUpdateCustomer && equalTo((FlowActionStripeUpdateCustomer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeUpdateCustomer other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionStripeUpdateCustomer other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionStripeUpdateCustomerParams params); + } + + public interface _FinalStage { + FlowActionStripeUpdateCustomer build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionStripeUpdateCustomerParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeUpdateCustomer other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionStripeUpdateCustomerParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionStripeUpdateCustomer build() { + return new FlowActionStripeUpdateCustomer( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java new file mode 100644 index 000000000..860f52795 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionStripeUpdateCustomerParams.Builder.class) +public final class FlowActionStripeUpdateCustomerParams { + private final String connectionId; + + private final String id; + + private final Optional name; + + private final Optional description; + + private final Optional email; + + private final Optional phone; + + private final Optional taxExempt; + + private final Optional address; + + private final Optional> metadata; + + private final Map additionalProperties; + + private FlowActionStripeUpdateCustomerParams( + String connectionId, + String id, + Optional name, + Optional description, + Optional email, + Optional phone, + Optional taxExempt, + Optional address, + Optional> metadata, + Map additionalProperties) { + this.connectionId = connectionId; + this.id = id; + this.name = name; + this.description = description; + this.email = email; + this.phone = phone; + this.taxExempt = taxExempt; + this.address = address; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone") + public Optional getPhone() { + return phone; + } + + @JsonProperty("tax_exempt") + public Optional getTaxExempt() { + return taxExempt; + } + + @JsonProperty("address") + public Optional getAddress() { + return address; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionStripeUpdateCustomerParams + && equalTo((FlowActionStripeUpdateCustomerParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionStripeUpdateCustomerParams other) { + return connectionId.equals(other.connectionId) + && id.equals(other.id) + && name.equals(other.name) + && description.equals(other.description) + && email.equals(other.email) + && phone.equals(other.phone) + && taxExempt.equals(other.taxExempt) + && address.equals(other.address) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.id, + this.name, + this.description, + this.email, + this.phone, + this.taxExempt, + this.address, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + IdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionStripeUpdateCustomerParams other); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + FlowActionStripeUpdateCustomerParams build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phone(Optional phone); + + _FinalStage phone(String phone); + + _FinalStage taxExempt(Optional taxExempt); + + _FinalStage taxExempt(String taxExempt); + + _FinalStage address(Optional address); + + _FinalStage address(FlowActionStripeAddress address); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, IdStage, _FinalStage { + private String connectionId; + + private String id; + + private Optional> metadata = Optional.empty(); + + private Optional address = Optional.empty(); + + private Optional taxExempt = Optional.empty(); + + private Optional phone = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionStripeUpdateCustomerParams other) { + connectionId(other.getConnectionId()); + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + email(other.getEmail()); + phone(other.getPhone()); + taxExempt(other.getTaxExempt()); + address(other.getAddress()); + metadata(other.getMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public IdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + @java.lang.Override + public _FinalStage address(FlowActionStripeAddress address) { + this.address = Optional.ofNullable(address); + return this; + } + + @java.lang.Override + @JsonSetter(value = "address", nulls = Nulls.SKIP) + public _FinalStage address(Optional address) { + this.address = address; + return this; + } + + @java.lang.Override + public _FinalStage taxExempt(String taxExempt) { + this.taxExempt = Optional.ofNullable(taxExempt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) + public _FinalStage taxExempt(Optional taxExempt) { + this.taxExempt = taxExempt; + return this; + } + + @java.lang.Override + public _FinalStage phone(String phone) { + this.phone = Optional.ofNullable(phone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone", nulls = Nulls.SKIP) + public _FinalStage phone(Optional phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public FlowActionStripeUpdateCustomerParams build() { + return new FlowActionStripeUpdateCustomerParams( + connectionId, + id, + name, + description, + email, + phone, + taxExempt, + address, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java new file mode 100644 index 000000000..6d0962853 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTelegramSendMessage.Builder.class) +public final class FlowActionTelegramSendMessage { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionTelegramSendMessageParams params; + + private final Map additionalProperties; + + private FlowActionTelegramSendMessage( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionTelegramSendMessageParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "TELEGRAM"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_MESSAGE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionTelegramSendMessageParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTelegramSendMessage && equalTo((FlowActionTelegramSendMessage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTelegramSendMessage other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionTelegramSendMessage other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionTelegramSendMessageParams params); + } + + public interface _FinalStage { + FlowActionTelegramSendMessage build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionTelegramSendMessageParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTelegramSendMessage other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionTelegramSendMessageParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionTelegramSendMessage build() { + return new FlowActionTelegramSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java new file mode 100644 index 000000000..d33f13ad6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTelegramSendMessageParams.Builder.class) +public final class FlowActionTelegramSendMessageParams { + private final String connectionId; + + private final String chatId; + + private final String text; + + private final Map additionalProperties; + + private FlowActionTelegramSendMessageParams( + String connectionId, String chatId, String text, Map additionalProperties) { + this.connectionId = connectionId; + this.chatId = chatId; + this.text = text; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("chat_id") + public String getChatId() { + return chatId; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTelegramSendMessageParams + && equalTo((FlowActionTelegramSendMessageParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTelegramSendMessageParams other) { + return connectionId.equals(other.connectionId) && chatId.equals(other.chatId) && text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.chatId, this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + ChatIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionTelegramSendMessageParams other); + } + + public interface ChatIdStage { + TextStage chatId(@NotNull String chatId); + } + + public interface TextStage { + _FinalStage text(@NotNull String text); + } + + public interface _FinalStage { + FlowActionTelegramSendMessageParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, ChatIdStage, TextStage, _FinalStage { + private String connectionId; + + private String chatId; + + private String text; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTelegramSendMessageParams other) { + connectionId(other.getConnectionId()); + chatId(other.getChatId()); + text(other.getText()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public ChatIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("chat_id") + public TextStage chatId(@NotNull String chatId) { + this.chatId = Objects.requireNonNull(chatId, "chatId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + @java.lang.Override + public FlowActionTelegramSendMessageParams build() { + return new FlowActionTelegramSendMessageParams(connectionId, chatId, text, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java new file mode 100644 index 000000000..7f91ca908 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionTwilio.Deserializer.class) +public final class FlowActionTwilio { + private final Object value; + + private final int type; + + private FlowActionTwilio(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionTwilioMakeCall) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionTwilioSendSms) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTwilio && equalTo((FlowActionTwilio) other); + } + + private boolean equalTo(FlowActionTwilio other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionTwilio of(FlowActionTwilioMakeCall value) { + return new FlowActionTwilio(value, 0); + } + + public static FlowActionTwilio of(FlowActionTwilioSendSms value) { + return new FlowActionTwilio(value, 1); + } + + public interface Visitor { + T visit(FlowActionTwilioMakeCall value); + + T visit(FlowActionTwilioSendSms value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionTwilio.class); + } + + @java.lang.Override + public FlowActionTwilio deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionTwilioMakeCall.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionTwilioSendSms.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java new file mode 100644 index 000000000..d13fd2629 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTwilioMakeCall.Builder.class) +public final class FlowActionTwilioMakeCall { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionTwilioMakeCallParams params; + + private final Map additionalProperties; + + private FlowActionTwilioMakeCall( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionTwilioMakeCallParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "TWILIO"; + } + + @JsonProperty("action") + public String getAction() { + return "MAKE_CALL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionTwilioMakeCallParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTwilioMakeCall && equalTo((FlowActionTwilioMakeCall) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTwilioMakeCall other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionTwilioMakeCall other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionTwilioMakeCallParams params); + } + + public interface _FinalStage { + FlowActionTwilioMakeCall build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionTwilioMakeCallParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTwilioMakeCall other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionTwilioMakeCallParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionTwilioMakeCall build() { + return new FlowActionTwilioMakeCall(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java new file mode 100644 index 000000000..8d4aa1b6c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTwilioMakeCallParams.Builder.class) +public final class FlowActionTwilioMakeCallParams { + private final String connectionId; + + private final String from; + + private final String to; + + private final String payload; + + private final Map additionalProperties; + + private FlowActionTwilioMakeCallParams( + String connectionId, String from, String to, String payload, Map additionalProperties) { + this.connectionId = connectionId; + this.from = from; + this.to = to; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("from") + public String getFrom() { + return from; + } + + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("payload") + public String getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTwilioMakeCallParams && equalTo((FlowActionTwilioMakeCallParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTwilioMakeCallParams other) { + return connectionId.equals(other.connectionId) + && from.equals(other.from) + && to.equals(other.to) + && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.from, this.to, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + FromStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionTwilioMakeCallParams other); + } + + public interface FromStage { + ToStage from(@NotNull String from); + } + + public interface ToStage { + PayloadStage to(@NotNull String to); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull String payload); + } + + public interface _FinalStage { + FlowActionTwilioMakeCallParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, FromStage, ToStage, PayloadStage, _FinalStage { + private String connectionId; + + private String from; + + private String to; + + private String payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTwilioMakeCallParams other) { + connectionId(other.getConnectionId()); + from(other.getFrom()); + to(other.getTo()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public FromStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("from") + public ToStage from(@NotNull String from) { + this.from = Objects.requireNonNull(from, "from must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("to") + public PayloadStage to(@NotNull String to) { + this.to = Objects.requireNonNull(to, "to must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull String payload) { + this.payload = Objects.requireNonNull(payload, "payload must not be null"); + return this; + } + + @java.lang.Override + public FlowActionTwilioMakeCallParams build() { + return new FlowActionTwilioMakeCallParams(connectionId, from, to, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java new file mode 100644 index 000000000..2005828de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTwilioSendSms.Builder.class) +public final class FlowActionTwilioSendSms { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionTwilioSendSmsParams params; + + private final Map additionalProperties; + + private FlowActionTwilioSendSms( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionTwilioSendSmsParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "TWILIO"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_SMS"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionTwilioSendSmsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTwilioSendSms && equalTo((FlowActionTwilioSendSms) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTwilioSendSms other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionTwilioSendSms other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionTwilioSendSmsParams params); + } + + public interface _FinalStage { + FlowActionTwilioSendSms build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionTwilioSendSmsParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTwilioSendSms other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionTwilioSendSmsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionTwilioSendSms build() { + return new FlowActionTwilioSendSms(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java new file mode 100644 index 000000000..0cce55f3c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionTwilioSendSmsParams.Builder.class) +public final class FlowActionTwilioSendSmsParams { + private final String connectionId; + + private final String from; + + private final String to; + + private final String message; + + private final Map additionalProperties; + + private FlowActionTwilioSendSmsParams( + String connectionId, String from, String to, String message, Map additionalProperties) { + this.connectionId = connectionId; + this.from = from; + this.to = to; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("from") + public String getFrom() { + return from; + } + + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionTwilioSendSmsParams && equalTo((FlowActionTwilioSendSmsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionTwilioSendSmsParams other) { + return connectionId.equals(other.connectionId) + && from.equals(other.from) + && to.equals(other.to) + && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.from, this.to, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + FromStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionTwilioSendSmsParams other); + } + + public interface FromStage { + ToStage from(@NotNull String from); + } + + public interface ToStage { + MessageStage to(@NotNull String to); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + FlowActionTwilioSendSmsParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, FromStage, ToStage, MessageStage, _FinalStage { + private String connectionId; + + private String from; + + private String to; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionTwilioSendSmsParams other) { + connectionId(other.getConnectionId()); + from(other.getFrom()); + to(other.getTo()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public FromStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("from") + public ToStage from(@NotNull String from) { + this.from = Objects.requireNonNull(from, "from must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("to") + public MessageStage to(@NotNull String to) { + this.to = Objects.requireNonNull(to, "to must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public FlowActionTwilioSendSmsParams build() { + return new FlowActionTwilioSendSmsParams(connectionId, from, to, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java new file mode 100644 index 000000000..d0172e7b6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionWhatsappSendMessage.Builder.class) +public final class FlowActionWhatsappSendMessage { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionWhatsappSendMessageParams params; + + private final Map additionalProperties; + + private FlowActionWhatsappSendMessage( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionWhatsappSendMessageParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "WHATSAPP"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_MESSAGE"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionWhatsappSendMessageParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionWhatsappSendMessage && equalTo((FlowActionWhatsappSendMessage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionWhatsappSendMessage other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionWhatsappSendMessage other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionWhatsappSendMessageParams params); + } + + public interface _FinalStage { + FlowActionWhatsappSendMessage build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionWhatsappSendMessageParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionWhatsappSendMessage other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionWhatsappSendMessageParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionWhatsappSendMessage build() { + return new FlowActionWhatsappSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java new file mode 100644 index 000000000..18fd44671 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java @@ -0,0 +1,203 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionWhatsappSendMessageParams.Builder.class) +public final class FlowActionWhatsappSendMessageParams { + private final String connectionId; + + private final String senderId; + + private final String recipientNumber; + + private final FlowActionWhatsappSendMessageParamsType type; + + private final FlowActionWhatsappSendMessageParamsPayload payload; + + private final Map additionalProperties; + + private FlowActionWhatsappSendMessageParams( + String connectionId, + String senderId, + String recipientNumber, + FlowActionWhatsappSendMessageParamsType type, + FlowActionWhatsappSendMessageParamsPayload payload, + Map additionalProperties) { + this.connectionId = connectionId; + this.senderId = senderId; + this.recipientNumber = recipientNumber; + this.type = type; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("sender_id") + public String getSenderId() { + return senderId; + } + + @JsonProperty("recipient_number") + public String getRecipientNumber() { + return recipientNumber; + } + + @JsonProperty("type") + public FlowActionWhatsappSendMessageParamsType getType() { + return type; + } + + @JsonProperty("payload") + public FlowActionWhatsappSendMessageParamsPayload getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionWhatsappSendMessageParams + && equalTo((FlowActionWhatsappSendMessageParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionWhatsappSendMessageParams other) { + return connectionId.equals(other.connectionId) + && senderId.equals(other.senderId) + && recipientNumber.equals(other.recipientNumber) + && type.equals(other.type) + && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.senderId, this.recipientNumber, this.type, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + SenderIdStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionWhatsappSendMessageParams other); + } + + public interface SenderIdStage { + RecipientNumberStage senderId(@NotNull String senderId); + } + + public interface RecipientNumberStage { + TypeStage recipientNumber(@NotNull String recipientNumber); + } + + public interface TypeStage { + PayloadStage type(@NotNull FlowActionWhatsappSendMessageParamsType type); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull FlowActionWhatsappSendMessageParamsPayload payload); + } + + public interface _FinalStage { + FlowActionWhatsappSendMessageParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, SenderIdStage, RecipientNumberStage, TypeStage, PayloadStage, _FinalStage { + private String connectionId; + + private String senderId; + + private String recipientNumber; + + private FlowActionWhatsappSendMessageParamsType type; + + private FlowActionWhatsappSendMessageParamsPayload payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionWhatsappSendMessageParams other) { + connectionId(other.getConnectionId()); + senderId(other.getSenderId()); + recipientNumber(other.getRecipientNumber()); + type(other.getType()); + payload(other.getPayload()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public SenderIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("sender_id") + public RecipientNumberStage senderId(@NotNull String senderId) { + this.senderId = Objects.requireNonNull(senderId, "senderId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("recipient_number") + public TypeStage recipientNumber(@NotNull String recipientNumber) { + this.recipientNumber = Objects.requireNonNull(recipientNumber, "recipientNumber must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public PayloadStage type(@NotNull FlowActionWhatsappSendMessageParamsType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull FlowActionWhatsappSendMessageParamsPayload payload) { + this.payload = Objects.requireNonNull(payload, "payload must not be null"); + return this; + } + + @java.lang.Override + public FlowActionWhatsappSendMessageParams build() { + return new FlowActionWhatsappSendMessageParams( + connectionId, senderId, recipientNumber, type, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java new file mode 100644 index 000000000..ad46169cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionWhatsappSendMessageParamsPayload.Deserializer.class) +public final class FlowActionWhatsappSendMessageParamsPayload { + private final Object value; + + private final int type; + + private FlowActionWhatsappSendMessageParamsPayload(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((Map) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionWhatsappSendMessageParamsPayload + && equalTo((FlowActionWhatsappSendMessageParamsPayload) other); + } + + private boolean equalTo(FlowActionWhatsappSendMessageParamsPayload other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionWhatsappSendMessageParamsPayload of(Map value) { + return new FlowActionWhatsappSendMessageParamsPayload(value, 0); + } + + public static FlowActionWhatsappSendMessageParamsPayload of(String value) { + return new FlowActionWhatsappSendMessageParamsPayload(value, 1); + } + + public interface Visitor { + T visit(Map value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionWhatsappSendMessageParamsPayload.class); + } + + @java.lang.Override + public FlowActionWhatsappSendMessageParamsPayload deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsType.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsType.java new file mode 100644 index 000000000..96951c41d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsType.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionWhatsappSendMessageParamsType { + public static final FlowActionWhatsappSendMessageParamsType INTERACTIVE = + new FlowActionWhatsappSendMessageParamsType(Value.INTERACTIVE, "INTERACTIVE"); + + public static final FlowActionWhatsappSendMessageParamsType DOCUMENT = + new FlowActionWhatsappSendMessageParamsType(Value.DOCUMENT, "DOCUMENT"); + + public static final FlowActionWhatsappSendMessageParamsType TEMPLATE = + new FlowActionWhatsappSendMessageParamsType(Value.TEMPLATE, "TEMPLATE"); + + public static final FlowActionWhatsappSendMessageParamsType TEXT = + new FlowActionWhatsappSendMessageParamsType(Value.TEXT, "TEXT"); + + public static final FlowActionWhatsappSendMessageParamsType AUDIO = + new FlowActionWhatsappSendMessageParamsType(Value.AUDIO, "AUDIO"); + + public static final FlowActionWhatsappSendMessageParamsType CONTACTS = + new FlowActionWhatsappSendMessageParamsType(Value.CONTACTS, "CONTACTS"); + + public static final FlowActionWhatsappSendMessageParamsType LOCATION = + new FlowActionWhatsappSendMessageParamsType(Value.LOCATION, "LOCATION"); + + public static final FlowActionWhatsappSendMessageParamsType STICKER = + new FlowActionWhatsappSendMessageParamsType(Value.STICKER, "STICKER"); + + public static final FlowActionWhatsappSendMessageParamsType IMAGE = + new FlowActionWhatsappSendMessageParamsType(Value.IMAGE, "IMAGE"); + + private final Value value; + + private final String string; + + FlowActionWhatsappSendMessageParamsType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionWhatsappSendMessageParamsType + && this.string.equals(((FlowActionWhatsappSendMessageParamsType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case INTERACTIVE: + return visitor.visitInteractive(); + case DOCUMENT: + return visitor.visitDocument(); + case TEMPLATE: + return visitor.visitTemplate(); + case TEXT: + return visitor.visitText(); + case AUDIO: + return visitor.visitAudio(); + case CONTACTS: + return visitor.visitContacts(); + case LOCATION: + return visitor.visitLocation(); + case STICKER: + return visitor.visitSticker(); + case IMAGE: + return visitor.visitImage(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionWhatsappSendMessageParamsType valueOf(String value) { + switch (value) { + case "INTERACTIVE": + return INTERACTIVE; + case "DOCUMENT": + return DOCUMENT; + case "TEMPLATE": + return TEMPLATE; + case "TEXT": + return TEXT; + case "AUDIO": + return AUDIO; + case "CONTACTS": + return CONTACTS; + case "LOCATION": + return LOCATION; + case "STICKER": + return STICKER; + case "IMAGE": + return IMAGE; + default: + return new FlowActionWhatsappSendMessageParamsType(Value.UNKNOWN, value); + } + } + + public enum Value { + AUDIO, + + CONTACTS, + + DOCUMENT, + + IMAGE, + + INTERACTIVE, + + LOCATION, + + STICKER, + + TEMPLATE, + + TEXT, + + UNKNOWN + } + + public interface Visitor { + T visitAudio(); + + T visitContacts(); + + T visitDocument(); + + T visitImage(); + + T visitInteractive(); + + T visitLocation(); + + T visitSticker(); + + T visitTemplate(); + + T visitText(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXml.java new file mode 100644 index 000000000..f182e2e9c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXml.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionXml.Deserializer.class) +public final class FlowActionXml { + private final Object value; + + private final int type; + + private FlowActionXml(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowActionXmlParseXml) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowActionXmlSerializeXml) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXml && equalTo((FlowActionXml) other); + } + + private boolean equalTo(FlowActionXml other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionXml of(FlowActionXmlParseXml value) { + return new FlowActionXml(value, 0); + } + + public static FlowActionXml of(FlowActionXmlSerializeXml value) { + return new FlowActionXml(value, 1); + } + + public interface Visitor { + T visit(FlowActionXmlParseXml value); + + T visit(FlowActionXmlSerializeXml value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionXml.class); + } + + @java.lang.Override + public FlowActionXml deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionXmlParseXml.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionXmlSerializeXml.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java new file mode 100644 index 000000000..e543c01ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionXmlParseXml.Builder.class) +public final class FlowActionXmlParseXml { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionXmlParseXmlParams params; + + private final Map additionalProperties; + + private FlowActionXmlParseXml( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionXmlParseXmlParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "XML"; + } + + @JsonProperty("action") + public String getAction() { + return "PARSE_XML"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionXmlParseXmlParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXmlParseXml && equalTo((FlowActionXmlParseXml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionXmlParseXml other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionXmlParseXml other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionXmlParseXmlParams params); + } + + public interface _FinalStage { + FlowActionXmlParseXml build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionXmlParseXmlParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionXmlParseXml other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionXmlParseXmlParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionXmlParseXml build() { + return new FlowActionXmlParseXml(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java new file mode 100644 index 000000000..9c97b5312 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionXmlParseXmlParams.Builder.class) +public final class FlowActionXmlParseXmlParams { + private final String xml; + + private final Map additionalProperties; + + private FlowActionXmlParseXmlParams(String xml, Map additionalProperties) { + this.xml = xml; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("xml") + public String getXml() { + return xml; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXmlParseXmlParams && equalTo((FlowActionXmlParseXmlParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionXmlParseXmlParams other) { + return xml.equals(other.xml); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.xml); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static XmlStage builder() { + return new Builder(); + } + + public interface XmlStage { + _FinalStage xml(@NotNull String xml); + + Builder from(FlowActionXmlParseXmlParams other); + } + + public interface _FinalStage { + FlowActionXmlParseXmlParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements XmlStage, _FinalStage { + private String xml; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionXmlParseXmlParams other) { + xml(other.getXml()); + return this; + } + + @java.lang.Override + @JsonSetter("xml") + public _FinalStage xml(@NotNull String xml) { + this.xml = Objects.requireNonNull(xml, "xml must not be null"); + return this; + } + + @java.lang.Override + public FlowActionXmlParseXmlParams build() { + return new FlowActionXmlParseXmlParams(xml, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java new file mode 100644 index 000000000..bbe425904 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionXmlSerializeXml.Builder.class) +public final class FlowActionXmlSerializeXml { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionXmlSerializeXmlParams params; + + private final Map additionalProperties; + + private FlowActionXmlSerializeXml( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionXmlSerializeXmlParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "XML"; + } + + @JsonProperty("action") + public String getAction() { + return "SERIALIZE_XML"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionXmlSerializeXmlParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXmlSerializeXml && equalTo((FlowActionXmlSerializeXml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionXmlSerializeXml other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionXmlSerializeXml other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionXmlSerializeXmlParams params); + } + + public interface _FinalStage { + FlowActionXmlSerializeXml build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionXmlSerializeXmlParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionXmlSerializeXml other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionXmlSerializeXmlParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionXmlSerializeXml build() { + return new FlowActionXmlSerializeXml(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java new file mode 100644 index 000000000..f061b36a6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionXmlSerializeXmlParams.Builder.class) +public final class FlowActionXmlSerializeXmlParams { + private final FlowActionXmlSerializeXmlParamsObject object; + + private final Map additionalProperties; + + private FlowActionXmlSerializeXmlParams( + FlowActionXmlSerializeXmlParamsObject object, Map additionalProperties) { + this.object = object; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public FlowActionXmlSerializeXmlParamsObject getObject() { + return object; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXmlSerializeXmlParams && equalTo((FlowActionXmlSerializeXmlParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionXmlSerializeXmlParams other) { + return object.equals(other.object); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + _FinalStage object(@NotNull FlowActionXmlSerializeXmlParamsObject object); + + Builder from(FlowActionXmlSerializeXmlParams other); + } + + public interface _FinalStage { + FlowActionXmlSerializeXmlParams build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, _FinalStage { + private FlowActionXmlSerializeXmlParamsObject object; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionXmlSerializeXmlParams other) { + object(other.getObject()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public _FinalStage object(@NotNull FlowActionXmlSerializeXmlParamsObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + public FlowActionXmlSerializeXmlParams build() { + return new FlowActionXmlSerializeXmlParams(object, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java new file mode 100644 index 000000000..abba5fb24 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = FlowActionXmlSerializeXmlParamsObject.Deserializer.class) +public final class FlowActionXmlSerializeXmlParamsObject { + private final Object value; + + private final int type; + + private FlowActionXmlSerializeXmlParamsObject(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionXmlSerializeXmlParamsObject + && equalTo((FlowActionXmlSerializeXmlParamsObject) other); + } + + private boolean equalTo(FlowActionXmlSerializeXmlParamsObject other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionXmlSerializeXmlParamsObject of(String value) { + return new FlowActionXmlSerializeXmlParamsObject(value, 0); + } + + public static FlowActionXmlSerializeXmlParamsObject of(Map value) { + return new FlowActionXmlSerializeXmlParamsObject(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionXmlSerializeXmlParamsObject.class); + } + + @java.lang.Override + public FlowActionXmlSerializeXmlParamsObject deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhook.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhook.java new file mode 100644 index 000000000..9a17526e6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhook.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionZapierTriggerWebhook.Builder.class) +public final class FlowActionZapierTriggerWebhook { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionZapierTriggerWebhookParams params; + + private final Map additionalProperties; + + private FlowActionZapierTriggerWebhook( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionZapierTriggerWebhookParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "ZAPIER"; + } + + @JsonProperty("action") + public String getAction() { + return "TRIGGER_WEBHOOK"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionZapierTriggerWebhookParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionZapierTriggerWebhook && equalTo((FlowActionZapierTriggerWebhook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionZapierTriggerWebhook other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionZapierTriggerWebhook other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionZapierTriggerWebhookParams params); + } + + public interface _FinalStage { + FlowActionZapierTriggerWebhook build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionZapierTriggerWebhookParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionZapierTriggerWebhook other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionZapierTriggerWebhookParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @java.lang.Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FlowActionZapierTriggerWebhook build() { + return new FlowActionZapierTriggerWebhook( + id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java new file mode 100644 index 000000000..1a30886e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionZapierTriggerWebhookParams.Builder.class) +public final class FlowActionZapierTriggerWebhookParams { + private final String connectionId; + + private final Optional method; + + private final Map additionalProperties; + + private FlowActionZapierTriggerWebhookParams( + String connectionId, + Optional method, + Map additionalProperties) { + this.connectionId = connectionId; + this.method = method; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionZapierTriggerWebhookParams + && equalTo((FlowActionZapierTriggerWebhookParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionZapierTriggerWebhookParams other) { + return connectionId.equals(other.connectionId) && method.equals(other.method); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectionId, this.method); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(FlowActionZapierTriggerWebhookParams other); + } + + public interface _FinalStage { + FlowActionZapierTriggerWebhookParams build(); + + _FinalStage method(Optional method); + + _FinalStage method(FlowActionZapierTriggerWebhookParamsMethod method); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional method = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowActionZapierTriggerWebhookParams other) { + connectionId(other.getConnectionId()); + method(other.getMethod()); + return this; + } + + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage method(FlowActionZapierTriggerWebhookParamsMethod method) { + this.method = Optional.ofNullable(method); + return this; + } + + @java.lang.Override + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public _FinalStage method(Optional method) { + this.method = method; + return this; + } + + @java.lang.Override + public FlowActionZapierTriggerWebhookParams build() { + return new FlowActionZapierTriggerWebhookParams(connectionId, method, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java new file mode 100644 index 000000000..bd0e8036a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowActionZapierTriggerWebhookParamsMethod { + public static final FlowActionZapierTriggerWebhookParamsMethod GET = + new FlowActionZapierTriggerWebhookParamsMethod(Value.GET, "GET"); + + public static final FlowActionZapierTriggerWebhookParamsMethod PUT = + new FlowActionZapierTriggerWebhookParamsMethod(Value.PUT, "PUT"); + + public static final FlowActionZapierTriggerWebhookParamsMethod POST = + new FlowActionZapierTriggerWebhookParamsMethod(Value.POST, "POST"); + + private final Value value; + + private final String string; + + FlowActionZapierTriggerWebhookParamsMethod(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowActionZapierTriggerWebhookParamsMethod + && this.string.equals(((FlowActionZapierTriggerWebhookParamsMethod) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GET: + return visitor.visitGet(); + case PUT: + return visitor.visitPut(); + case POST: + return visitor.visitPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowActionZapierTriggerWebhookParamsMethod valueOf(String value) { + switch (value) { + case "GET": + return GET; + case "PUT": + return PUT; + case "POST": + return POST; + default: + return new FlowActionZapierTriggerWebhookParamsMethod(Value.UNKNOWN, value); + } + } + + public enum Value { + GET, + + POST, + + PUT, + + UNKNOWN + } + + public interface Visitor { + T visitGet(); + + T visitPost(); + + T visitPut(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java new file mode 100644 index 000000000..0f85945d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java @@ -0,0 +1,397 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowExecutionSummary.Builder.class) +public final class FlowExecutionSummary { + private final String id; + + private final String traceId; + + private final Optional journeyId; + + private final String status; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional startedAt; + + private final Optional endedAt; + + private final Map additionalProperties; + + private FlowExecutionSummary( + String id, + String traceId, + Optional journeyId, + String status, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional startedAt, + Optional endedAt, + Map additionalProperties) { + this.id = id; + this.traceId = traceId; + this.journeyId = journeyId; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.startedAt = startedAt; + this.endedAt = endedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flow execution identifier + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Trace id + */ + @JsonProperty("trace_id") + public String getTraceId() { + return traceId; + } + + /** + * @return Journey id + */ + @JsonProperty("journey_id") + public Optional getJourneyId() { + return journeyId; + } + + /** + * @return Execution status + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return The ISO 8601 formatted date when this flow execution was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution started. + */ + @JsonProperty("started_at") + public Optional getStartedAt() { + return startedAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution ended. + */ + @JsonProperty("ended_at") + public Optional getEndedAt() { + return endedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowExecutionSummary && equalTo((FlowExecutionSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowExecutionSummary other) { + return id.equals(other.id) + && traceId.equals(other.traceId) + && journeyId.equals(other.journeyId) + && status.equals(other.status) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && startedAt.equals(other.startedAt) + && endedAt.equals(other.endedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.traceId, + this.journeyId, + this.status, + this.createdAt, + this.updatedAt, + this.startedAt, + this.endedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flow execution identifier

+ */ + TraceIdStage id(@NotNull String id); + + Builder from(FlowExecutionSummary other); + } + + public interface TraceIdStage { + /** + *

Trace id

+ */ + StatusStage traceId(@NotNull String traceId); + } + + public interface StatusStage { + /** + *

Execution status

+ */ + CreatedAtStage status(@NotNull String status); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this flow execution was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this flow execution was updated.

+ */ + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + FlowExecutionSummary build(); + + /** + *

Journey id

+ */ + _FinalStage journeyId(Optional journeyId); + + _FinalStage journeyId(String journeyId); + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ */ + _FinalStage startedAt(Optional startedAt); + + _FinalStage startedAt(OffsetDateTime startedAt); + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ */ + _FinalStage endedAt(Optional endedAt); + + _FinalStage endedAt(OffsetDateTime endedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TraceIdStage, StatusStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String traceId; + + private String status; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional endedAt = Optional.empty(); + + private Optional startedAt = Optional.empty(); + + private Optional journeyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowExecutionSummary other) { + id(other.getId()); + traceId(other.getTraceId()); + journeyId(other.getJourneyId()); + status(other.getStatus()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + startedAt(other.getStartedAt()); + endedAt(other.getEndedAt()); + return this; + } + + /** + *

Flow execution identifier

+ *

Flow execution identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public TraceIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Trace id

+ *

Trace id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("trace_id") + public StatusStage traceId(@NotNull String traceId) { + this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); + return this; + } + + /** + *

Execution status

+ *

Execution status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public CreatedAtStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution was created.

+ *

The ISO 8601 formatted date when this flow execution was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution was updated.

+ *

The ISO 8601 formatted date when this flow execution was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage endedAt(OffsetDateTime endedAt) { + this.endedAt = Optional.ofNullable(endedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ */ + @java.lang.Override + @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) + public _FinalStage endedAt(Optional endedAt) { + this.endedAt = endedAt; + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startedAt(OffsetDateTime startedAt) { + this.startedAt = Optional.ofNullable(startedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ */ + @java.lang.Override + @JsonSetter(value = "started_at", nulls = Nulls.SKIP) + public _FinalStage startedAt(Optional startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + *

Journey id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage journeyId(String journeyId) { + this.journeyId = Optional.ofNullable(journeyId); + return this; + } + + /** + *

Journey id

+ */ + @java.lang.Override + @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) + public _FinalStage journeyId(Optional journeyId) { + this.journeyId = journeyId; + return this; + } + + @java.lang.Override + public FlowExecutionSummary build() { + return new FlowExecutionSummary( + id, traceId, journeyId, status, createdAt, updatedAt, startedAt, endedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java new file mode 100644 index 000000000..ad5d7050b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowSummary.Builder.class) +public final class FlowSummary { + private final String id; + + private final String name; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional executedAt; + + private final Map additionalProperties; + + private FlowSummary( + String id, + String name, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional executedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.executedAt = executedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("executed_at") + public Optional getExecutedAt() { + return executedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowSummary && equalTo((FlowSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowSummary other) { + return id.equals(other.id) + && name.equals(other.name) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && executedAt.equals(other.executedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.executedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(FlowSummary other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + FlowSummary build(); + + _FinalStage executedAt(Optional executedAt); + + _FinalStage executedAt(String executedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional executedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FlowSummary other) { + id(other.getId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + executedAt(other.getExecutedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage executedAt(String executedAt) { + this.executedAt = Optional.ofNullable(executedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) + public _FinalStage executedAt(Optional executedAt) { + this.executedAt = executedAt; + return this; + } + + @java.lang.Override + public FlowSummary build() { + return new FlowSummary(id, name, createdAt, updatedAt, executedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java new file mode 100644 index 000000000..9c7631ed5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java @@ -0,0 +1,356 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsListRequest.Builder.class) +public final class FlowsListRequest { + private final Optional> hydrate; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable synchronous; + + private final Map additionalProperties; + + private FlowsListRequest( + Optional> hydrate, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable synchronous, + Map additionalProperties) { + this.hydrate = hydrate; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.synchronous = synchronous; + this.additionalProperties = additionalProperties; + } + + /** + * @return hydration param + */ + @JsonIgnore + public Optional> getHydrate() { + if (hydrate == null) { + return Optional.empty(); + } + return hydrate; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return flag to filter by sync/async flows + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("synchronous") + public OptionalNullable getSynchronous() { + if (synchronous == null) { + return OptionalNullable.absent(); + } + return synchronous; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hydrate") + private Optional> _getHydrate() { + return hydrate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("synchronous") + private OptionalNullable _getSynchronous() { + return synchronous; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsListRequest && equalTo((FlowsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsListRequest other) { + return hydrate.equals(other.hydrate) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && synchronous.equals(other.synchronous); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals, this.synchronous); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hydrate = Optional.empty(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable synchronous = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowsListRequest other) { + hydrate(other.getHydrate()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + synchronous(other.getSynchronous()); + return this; + } + + /** + *

hydration param

+ */ + @JsonSetter(value = "hydrate", nulls = Nulls.SKIP) + public Builder hydrate(@Nullable Optional> hydrate) { + this.hydrate = hydrate; + return this; + } + + public Builder hydrate(List hydrate) { + this.hydrate = Optional.ofNullable(hydrate); + return this; + } + + public Builder hydrate(com.auth0.client.mgmt.core.Nullable> hydrate) { + if (hydrate.isNull()) { + this.hydrate = null; + } else if (hydrate.isEmpty()) { + this.hydrate = Optional.empty(); + } else { + this.hydrate = Optional.of(hydrate.get()); + } + return this; + } + + public Builder hydrate(String hydrate) { + this.hydrate = Optional.of(Collections.singletonList(hydrate)); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

flag to filter by sync/async flows

+ */ + @JsonSetter(value = "synchronous", nulls = Nulls.SKIP) + public Builder synchronous(@Nullable OptionalNullable synchronous) { + this.synchronous = synchronous; + return this; + } + + public Builder synchronous(Boolean synchronous) { + this.synchronous = OptionalNullable.of(synchronous); + return this; + } + + public Builder synchronous(Optional synchronous) { + if (synchronous.isPresent()) { + this.synchronous = OptionalNullable.of(synchronous.get()); + } else { + this.synchronous = OptionalNullable.absent(); + } + return this; + } + + public Builder synchronous(com.auth0.client.mgmt.core.Nullable synchronous) { + if (synchronous.isNull()) { + this.synchronous = OptionalNullable.ofNull(); + } else if (synchronous.isEmpty()) { + this.synchronous = OptionalNullable.absent(); + } else { + this.synchronous = OptionalNullable.of(synchronous.get()); + } + return this; + } + + public FlowsListRequest build() { + return new FlowsListRequest(hydrate, page, perPage, includeTotals, synchronous, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlock.java b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java new file mode 100644 index 000000000..e12842dd3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormBlock.Deserializer.class) +public final class FormBlock { + private final Object value; + + private final int type; + + private FormBlock(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormBlockDivider) this.value); + } else if (this.type == 1) { + return visitor.visit((FormBlockHtml) this.value); + } else if (this.type == 2) { + return visitor.visit((FormBlockImage) this.value); + } else if (this.type == 3) { + return visitor.visit((FormBlockJumpButton) this.value); + } else if (this.type == 4) { + return visitor.visit((FormBlockResendButton) this.value); + } else if (this.type == 5) { + return visitor.visit((FormBlockNextButton) this.value); + } else if (this.type == 6) { + return visitor.visit((FormBlockPreviousButton) this.value); + } else if (this.type == 7) { + return visitor.visit((FormBlockRichText) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlock && equalTo((FormBlock) other); + } + + private boolean equalTo(FormBlock other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormBlock of(FormBlockDivider value) { + return new FormBlock(value, 0); + } + + public static FormBlock of(FormBlockHtml value) { + return new FormBlock(value, 1); + } + + public static FormBlock of(FormBlockImage value) { + return new FormBlock(value, 2); + } + + public static FormBlock of(FormBlockJumpButton value) { + return new FormBlock(value, 3); + } + + public static FormBlock of(FormBlockResendButton value) { + return new FormBlock(value, 4); + } + + public static FormBlock of(FormBlockNextButton value) { + return new FormBlock(value, 5); + } + + public static FormBlock of(FormBlockPreviousButton value) { + return new FormBlock(value, 6); + } + + public static FormBlock of(FormBlockRichText value) { + return new FormBlock(value, 7); + } + + public interface Visitor { + T visit(FormBlockDivider value); + + T visit(FormBlockHtml value); + + T visit(FormBlockImage value); + + T visit(FormBlockJumpButton value); + + T visit(FormBlockResendButton value); + + T visit(FormBlockNextButton value); + + T visit(FormBlockPreviousButton value); + + T visit(FormBlockRichText value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormBlock.class); + } + + @java.lang.Override + public FormBlock deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockDivider.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockHtml.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockImage.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockJumpButton.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockResendButton.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockNextButton.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockPreviousButton.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlockRichText.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java new file mode 100644 index 000000000..a62e0db33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockDivider.Builder.class) +public final class FormBlockDivider { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Map additionalProperties; + + private FormBlockDivider( + String id, + String category, + String type, + Optional config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockDivider && equalTo((FormBlockDivider) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockDivider other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockDivider other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormBlockDivider build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormBlockDividerConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockDivider other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormBlockDividerConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormBlockDivider build() { + return new FormBlockDivider(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java new file mode 100644 index 000000000..a5183c3a3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockDividerConfig.Builder.class) +public final class FormBlockDividerConfig { + private final Optional text; + + private final Map additionalProperties; + + private FormBlockDividerConfig(Optional text, Map additionalProperties) { + this.text = text; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("text") + public Optional getText() { + return text; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockDividerConfig && equalTo((FormBlockDividerConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockDividerConfig other) { + return text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional text = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormBlockDividerConfig other) { + text(other.getText()); + return this; + } + + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public Builder text(Optional text) { + this.text = text; + return this; + } + + public Builder text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + public FormBlockDividerConfig build() { + return new FormBlockDividerConfig(text, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java new file mode 100644 index 000000000..a184d58cc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockHtml.Builder.class) +public final class FormBlockHtml { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Map additionalProperties; + + private FormBlockHtml( + String id, + String category, + String type, + Optional config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockHtml && equalTo((FormBlockHtml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockHtml other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockHtml other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormBlockHtml build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormBlockHtmlConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockHtml other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormBlockHtmlConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormBlockHtml build() { + return new FormBlockHtml(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java new file mode 100644 index 000000000..1a3622c5e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockHtmlConfig.Builder.class) +public final class FormBlockHtmlConfig { + private final Optional content; + + private final Map additionalProperties; + + private FormBlockHtmlConfig(Optional content, Map additionalProperties) { + this.content = content; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("content") + public Optional getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockHtmlConfig && equalTo((FormBlockHtmlConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockHtmlConfig other) { + return content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional content = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormBlockHtmlConfig other) { + content(other.getContent()); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + public FormBlockHtmlConfig build() { + return new FormBlockHtmlConfig(content, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java new file mode 100644 index 000000000..e9452fb15 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockImage.Builder.class) +public final class FormBlockImage { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Map additionalProperties; + + private FormBlockImage( + String id, + String category, + String type, + Optional config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockImage && equalTo((FormBlockImage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockImage other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockImage other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormBlockImage build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormBlockImageConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockImage other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormBlockImageConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormBlockImage build() { + return new FormBlockImage(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java new file mode 100644 index 000000000..88372a4b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockImageConfig.Builder.class) +public final class FormBlockImageConfig { + private final String src; + + private final Optional position; + + private final Optional height; + + private final Map additionalProperties; + + private FormBlockImageConfig( + String src, + Optional position, + Optional height, + Map additionalProperties) { + this.src = src; + this.position = position; + this.height = height; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("src") + public String getSrc() { + return src; + } + + @JsonProperty("position") + public Optional getPosition() { + return position; + } + + @JsonProperty("height") + public Optional getHeight() { + return height; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockImageConfig && equalTo((FormBlockImageConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockImageConfig other) { + return src.equals(other.src) && position.equals(other.position) && height.equals(other.height); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.src, this.position, this.height); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SrcStage builder() { + return new Builder(); + } + + public interface SrcStage { + _FinalStage src(@NotNull String src); + + Builder from(FormBlockImageConfig other); + } + + public interface _FinalStage { + FormBlockImageConfig build(); + + _FinalStage position(Optional position); + + _FinalStage position(FormBlockImageConfigPositionEnum position); + + _FinalStage height(Optional height); + + _FinalStage height(Double height); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SrcStage, _FinalStage { + private String src; + + private Optional height = Optional.empty(); + + private Optional position = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockImageConfig other) { + src(other.getSrc()); + position(other.getPosition()); + height(other.getHeight()); + return this; + } + + @java.lang.Override + @JsonSetter("src") + public _FinalStage src(@NotNull String src) { + this.src = Objects.requireNonNull(src, "src must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage height(Double height) { + this.height = Optional.ofNullable(height); + return this; + } + + @java.lang.Override + @JsonSetter(value = "height", nulls = Nulls.SKIP) + public _FinalStage height(Optional height) { + this.height = height; + return this; + } + + @java.lang.Override + public _FinalStage position(FormBlockImageConfigPositionEnum position) { + this.position = Optional.ofNullable(position); + return this; + } + + @java.lang.Override + @JsonSetter(value = "position", nulls = Nulls.SKIP) + public _FinalStage position(Optional position) { + this.position = position; + return this; + } + + @java.lang.Override + public FormBlockImageConfig build() { + return new FormBlockImageConfig(src, position, height, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java new file mode 100644 index 000000000..ecc7f7dd9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormBlockImageConfigPositionEnum { + public static final FormBlockImageConfigPositionEnum RIGHT = + new FormBlockImageConfigPositionEnum(Value.RIGHT, "RIGHT"); + + public static final FormBlockImageConfigPositionEnum LEFT = + new FormBlockImageConfigPositionEnum(Value.LEFT, "LEFT"); + + public static final FormBlockImageConfigPositionEnum CENTER = + new FormBlockImageConfigPositionEnum(Value.CENTER, "CENTER"); + + private final Value value; + + private final String string; + + FormBlockImageConfigPositionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormBlockImageConfigPositionEnum + && this.string.equals(((FormBlockImageConfigPositionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RIGHT: + return visitor.visitRight(); + case LEFT: + return visitor.visitLeft(); + case CENTER: + return visitor.visitCenter(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormBlockImageConfigPositionEnum valueOf(String value) { + switch (value) { + case "RIGHT": + return RIGHT; + case "LEFT": + return LEFT; + case "CENTER": + return CENTER; + default: + return new FormBlockImageConfigPositionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LEFT, + + CENTER, + + RIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitLeft(); + + T visitCenter(); + + T visitRight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java new file mode 100644 index 000000000..9f7bf1319 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockJumpButton.Builder.class) +public final class FormBlockJumpButton { + private final String id; + + private final String category; + + private final String type; + + private final FormBlockJumpButtonConfig config; + + private final Map additionalProperties; + + private FormBlockJumpButton( + String id, + String category, + String type, + FormBlockJumpButtonConfig config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormBlockJumpButtonConfig getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockJumpButton && equalTo((FormBlockJumpButton) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockJumpButton other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockJumpButton other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormBlockJumpButtonConfig config); + } + + public interface _FinalStage { + FormBlockJumpButton build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormBlockJumpButtonConfig config; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockJumpButton other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormBlockJumpButtonConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public FormBlockJumpButton build() { + return new FormBlockJumpButton(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java new file mode 100644 index 000000000..9f6282db1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockJumpButtonConfig.Builder.class) +public final class FormBlockJumpButtonConfig { + private final String text; + + private final FormNodePointer nextNode; + + private final Optional style; + + private final Map additionalProperties; + + private FormBlockJumpButtonConfig( + String text, + FormNodePointer nextNode, + Optional style, + Map additionalProperties) { + this.text = text; + this.nextNode = nextNode; + this.style = style; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @JsonProperty("next_node") + public FormNodePointer getNextNode() { + return nextNode; + } + + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockJumpButtonConfig && equalTo((FormBlockJumpButtonConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockJumpButtonConfig other) { + return text.equals(other.text) && nextNode.equals(other.nextNode) && style.equals(other.style); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text, this.nextNode, this.style); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TextStage builder() { + return new Builder(); + } + + public interface TextStage { + NextNodeStage text(@NotNull String text); + + Builder from(FormBlockJumpButtonConfig other); + } + + public interface NextNodeStage { + _FinalStage nextNode(@NotNull FormNodePointer nextNode); + } + + public interface _FinalStage { + FormBlockJumpButtonConfig build(); + + _FinalStage style(Optional style); + + _FinalStage style(FormBlockJumpButtonConfigStyle style); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TextStage, NextNodeStage, _FinalStage { + private String text; + + private FormNodePointer nextNode; + + private Optional style = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockJumpButtonConfig other) { + text(other.getText()); + nextNode(other.getNextNode()); + style(other.getStyle()); + return this; + } + + @java.lang.Override + @JsonSetter("text") + public NextNodeStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("next_node") + public _FinalStage nextNode(@NotNull FormNodePointer nextNode) { + this.nextNode = Objects.requireNonNull(nextNode, "nextNode must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage style(FormBlockJumpButtonConfigStyle style) { + this.style = Optional.ofNullable(style); + return this; + } + + @java.lang.Override + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public _FinalStage style(Optional style) { + this.style = style; + return this; + } + + @java.lang.Override + public FormBlockJumpButtonConfig build() { + return new FormBlockJumpButtonConfig(text, nextNode, style, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java new file mode 100644 index 000000000..ffd730672 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockJumpButtonConfigStyle.Builder.class) +public final class FormBlockJumpButtonConfigStyle { + private final Optional backgroundColor; + + private final Map additionalProperties; + + private FormBlockJumpButtonConfigStyle(Optional backgroundColor, Map additionalProperties) { + this.backgroundColor = backgroundColor; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("background_color") + public Optional getBackgroundColor() { + return backgroundColor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockJumpButtonConfigStyle && equalTo((FormBlockJumpButtonConfigStyle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockJumpButtonConfigStyle other) { + return backgroundColor.equals(other.backgroundColor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.backgroundColor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional backgroundColor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormBlockJumpButtonConfigStyle other) { + backgroundColor(other.getBackgroundColor()); + return this; + } + + @JsonSetter(value = "background_color", nulls = Nulls.SKIP) + public Builder backgroundColor(Optional backgroundColor) { + this.backgroundColor = backgroundColor; + return this; + } + + public Builder backgroundColor(String backgroundColor) { + this.backgroundColor = Optional.ofNullable(backgroundColor); + return this; + } + + public FormBlockJumpButtonConfigStyle build() { + return new FormBlockJumpButtonConfigStyle(backgroundColor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java new file mode 100644 index 000000000..e4f72fc7e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockNextButton.Builder.class) +public final class FormBlockNextButton { + private final String id; + + private final String category; + + private final String type; + + private final FormBlockNextButtonConfig config; + + private final Map additionalProperties; + + private FormBlockNextButton( + String id, + String category, + String type, + FormBlockNextButtonConfig config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormBlockNextButtonConfig getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockNextButton && equalTo((FormBlockNextButton) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockNextButton other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockNextButton other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormBlockNextButtonConfig config); + } + + public interface _FinalStage { + FormBlockNextButton build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormBlockNextButtonConfig config; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockNextButton other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormBlockNextButtonConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public FormBlockNextButton build() { + return new FormBlockNextButton(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java new file mode 100644 index 000000000..6d24c23bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockNextButtonConfig.Builder.class) +public final class FormBlockNextButtonConfig { + private final String text; + + private final Map additionalProperties; + + private FormBlockNextButtonConfig(String text, Map additionalProperties) { + this.text = text; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockNextButtonConfig && equalTo((FormBlockNextButtonConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockNextButtonConfig other) { + return text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TextStage builder() { + return new Builder(); + } + + public interface TextStage { + _FinalStage text(@NotNull String text); + + Builder from(FormBlockNextButtonConfig other); + } + + public interface _FinalStage { + FormBlockNextButtonConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TextStage, _FinalStage { + private String text; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockNextButtonConfig other) { + text(other.getText()); + return this; + } + + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + @java.lang.Override + public FormBlockNextButtonConfig build() { + return new FormBlockNextButtonConfig(text, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java new file mode 100644 index 000000000..6e176cfad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockPreviousButton.Builder.class) +public final class FormBlockPreviousButton { + private final String id; + + private final String category; + + private final String type; + + private final FormBlockPreviousButtonConfig config; + + private final Map additionalProperties; + + private FormBlockPreviousButton( + String id, + String category, + String type, + FormBlockPreviousButtonConfig config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormBlockPreviousButtonConfig getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockPreviousButton && equalTo((FormBlockPreviousButton) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockPreviousButton other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockPreviousButton other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormBlockPreviousButtonConfig config); + } + + public interface _FinalStage { + FormBlockPreviousButton build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormBlockPreviousButtonConfig config; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockPreviousButton other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormBlockPreviousButtonConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public FormBlockPreviousButton build() { + return new FormBlockPreviousButton(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java new file mode 100644 index 000000000..60fb63e51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockPreviousButtonConfig.Builder.class) +public final class FormBlockPreviousButtonConfig { + private final String text; + + private final Map additionalProperties; + + private FormBlockPreviousButtonConfig(String text, Map additionalProperties) { + this.text = text; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockPreviousButtonConfig && equalTo((FormBlockPreviousButtonConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockPreviousButtonConfig other) { + return text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TextStage builder() { + return new Builder(); + } + + public interface TextStage { + _FinalStage text(@NotNull String text); + + Builder from(FormBlockPreviousButtonConfig other); + } + + public interface _FinalStage { + FormBlockPreviousButtonConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TextStage, _FinalStage { + private String text; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockPreviousButtonConfig other) { + text(other.getText()); + return this; + } + + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + @java.lang.Override + public FormBlockPreviousButtonConfig build() { + return new FormBlockPreviousButtonConfig(text, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java new file mode 100644 index 000000000..cc5e57605 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockResendButton.Builder.class) +public final class FormBlockResendButton { + private final String id; + + private final String category; + + private final String type; + + private final FormBlockResendButtonConfig config; + + private final Map additionalProperties; + + private FormBlockResendButton( + String id, + String category, + String type, + FormBlockResendButtonConfig config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormBlockResendButtonConfig getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockResendButton && equalTo((FormBlockResendButton) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockResendButton other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockResendButton other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormBlockResendButtonConfig config); + } + + public interface _FinalStage { + FormBlockResendButton build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormBlockResendButtonConfig config; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockResendButton other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormBlockResendButtonConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public FormBlockResendButton build() { + return new FormBlockResendButton(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java new file mode 100644 index 000000000..d899c55c3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockResendButtonConfig.Builder.class) +public final class FormBlockResendButtonConfig { + private final String activeText; + + private final String buttonText; + + private final String waitingText; + + private final Optional textAlignment; + + private final String flowId; + + private final Optional maxAttempts; + + private final Optional waitingTime; + + private final Map additionalProperties; + + private FormBlockResendButtonConfig( + String activeText, + String buttonText, + String waitingText, + Optional textAlignment, + String flowId, + Optional maxAttempts, + Optional waitingTime, + Map additionalProperties) { + this.activeText = activeText; + this.buttonText = buttonText; + this.waitingText = waitingText; + this.textAlignment = textAlignment; + this.flowId = flowId; + this.maxAttempts = maxAttempts; + this.waitingTime = waitingTime; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active_text") + public String getActiveText() { + return activeText; + } + + @JsonProperty("button_text") + public String getButtonText() { + return buttonText; + } + + @JsonProperty("waiting_text") + public String getWaitingText() { + return waitingText; + } + + @JsonProperty("text_alignment") + public Optional getTextAlignment() { + return textAlignment; + } + + @JsonProperty("flow_id") + public String getFlowId() { + return flowId; + } + + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + @JsonProperty("waiting_time") + public Optional getWaitingTime() { + return waitingTime; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockResendButtonConfig && equalTo((FormBlockResendButtonConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockResendButtonConfig other) { + return activeText.equals(other.activeText) + && buttonText.equals(other.buttonText) + && waitingText.equals(other.waitingText) + && textAlignment.equals(other.textAlignment) + && flowId.equals(other.flowId) + && maxAttempts.equals(other.maxAttempts) + && waitingTime.equals(other.waitingTime); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.activeText, + this.buttonText, + this.waitingText, + this.textAlignment, + this.flowId, + this.maxAttempts, + this.waitingTime); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActiveTextStage builder() { + return new Builder(); + } + + public interface ActiveTextStage { + ButtonTextStage activeText(@NotNull String activeText); + + Builder from(FormBlockResendButtonConfig other); + } + + public interface ButtonTextStage { + WaitingTextStage buttonText(@NotNull String buttonText); + } + + public interface WaitingTextStage { + FlowIdStage waitingText(@NotNull String waitingText); + } + + public interface FlowIdStage { + _FinalStage flowId(@NotNull String flowId); + } + + public interface _FinalStage { + FormBlockResendButtonConfig build(); + + _FinalStage textAlignment(Optional textAlignment); + + _FinalStage textAlignment(FormBlockResendButtonConfigTextAlignmentEnum textAlignment); + + _FinalStage maxAttempts(Optional maxAttempts); + + _FinalStage maxAttempts(Double maxAttempts); + + _FinalStage waitingTime(Optional waitingTime); + + _FinalStage waitingTime(Double waitingTime); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ActiveTextStage, ButtonTextStage, WaitingTextStage, FlowIdStage, _FinalStage { + private String activeText; + + private String buttonText; + + private String waitingText; + + private String flowId; + + private Optional waitingTime = Optional.empty(); + + private Optional maxAttempts = Optional.empty(); + + private Optional textAlignment = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockResendButtonConfig other) { + activeText(other.getActiveText()); + buttonText(other.getButtonText()); + waitingText(other.getWaitingText()); + textAlignment(other.getTextAlignment()); + flowId(other.getFlowId()); + maxAttempts(other.getMaxAttempts()); + waitingTime(other.getWaitingTime()); + return this; + } + + @java.lang.Override + @JsonSetter("active_text") + public ButtonTextStage activeText(@NotNull String activeText) { + this.activeText = Objects.requireNonNull(activeText, "activeText must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("button_text") + public WaitingTextStage buttonText(@NotNull String buttonText) { + this.buttonText = Objects.requireNonNull(buttonText, "buttonText must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("waiting_text") + public FlowIdStage waitingText(@NotNull String waitingText) { + this.waitingText = Objects.requireNonNull(waitingText, "waitingText must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("flow_id") + public _FinalStage flowId(@NotNull String flowId) { + this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage waitingTime(Double waitingTime) { + this.waitingTime = Optional.ofNullable(waitingTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "waiting_time", nulls = Nulls.SKIP) + public _FinalStage waitingTime(Optional waitingTime) { + this.waitingTime = waitingTime; + return this; + } + + @java.lang.Override + public _FinalStage maxAttempts(Double maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public _FinalStage maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + @java.lang.Override + public _FinalStage textAlignment(FormBlockResendButtonConfigTextAlignmentEnum textAlignment) { + this.textAlignment = Optional.ofNullable(textAlignment); + return this; + } + + @java.lang.Override + @JsonSetter(value = "text_alignment", nulls = Nulls.SKIP) + public _FinalStage textAlignment(Optional textAlignment) { + this.textAlignment = textAlignment; + return this; + } + + @java.lang.Override + public FormBlockResendButtonConfig build() { + return new FormBlockResendButtonConfig( + activeText, + buttonText, + waitingText, + textAlignment, + flowId, + maxAttempts, + waitingTime, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java new file mode 100644 index 000000000..b98a7331a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormBlockResendButtonConfigTextAlignmentEnum { + public static final FormBlockResendButtonConfigTextAlignmentEnum RIGHT = + new FormBlockResendButtonConfigTextAlignmentEnum(Value.RIGHT, "RIGHT"); + + public static final FormBlockResendButtonConfigTextAlignmentEnum LEFT = + new FormBlockResendButtonConfigTextAlignmentEnum(Value.LEFT, "LEFT"); + + public static final FormBlockResendButtonConfigTextAlignmentEnum CENTER = + new FormBlockResendButtonConfigTextAlignmentEnum(Value.CENTER, "CENTER"); + + private final Value value; + + private final String string; + + FormBlockResendButtonConfigTextAlignmentEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormBlockResendButtonConfigTextAlignmentEnum + && this.string.equals(((FormBlockResendButtonConfigTextAlignmentEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RIGHT: + return visitor.visitRight(); + case LEFT: + return visitor.visitLeft(); + case CENTER: + return visitor.visitCenter(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormBlockResendButtonConfigTextAlignmentEnum valueOf(String value) { + switch (value) { + case "RIGHT": + return RIGHT; + case "LEFT": + return LEFT; + case "CENTER": + return CENTER; + default: + return new FormBlockResendButtonConfigTextAlignmentEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LEFT, + + CENTER, + + RIGHT, + + UNKNOWN + } + + public interface Visitor { + T visitLeft(); + + T visitCenter(); + + T visitRight(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java new file mode 100644 index 000000000..630ccddbb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockRichText.Builder.class) +public final class FormBlockRichText { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Map additionalProperties; + + private FormBlockRichText( + String id, + String category, + String type, + Optional config, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockRichText && equalTo((FormBlockRichText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockRichText other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.category, this.type, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormBlockRichText other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormBlockRichText build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormBlockRichTextConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormBlockRichText other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormBlockRichTextConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormBlockRichText build() { + return new FormBlockRichText(id, category, type, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java new file mode 100644 index 000000000..a4986d07b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormBlockRichTextConfig.Builder.class) +public final class FormBlockRichTextConfig { + private final Optional content; + + private final Map additionalProperties; + + private FormBlockRichTextConfig(Optional content, Map additionalProperties) { + this.content = content; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("content") + public Optional getContent() { + return content; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormBlockRichTextConfig && equalTo((FormBlockRichTextConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormBlockRichTextConfig other) { + return content.equals(other.content); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.content); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional content = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormBlockRichTextConfig other) { + content(other.getContent()); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + public FormBlockRichTextConfig build() { + return new FormBlockRichTextConfig(content, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormComponent.java b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java new file mode 100644 index 000000000..62c7f133a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormComponent.Deserializer.class) +public final class FormComponent { + private final Object value; + + private final int type; + + private FormComponent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormBlock) this.value); + } else if (this.type == 1) { + return visitor.visit((FormWidget) this.value); + } else if (this.type == 2) { + return visitor.visit((FormField) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormComponent && equalTo((FormComponent) other); + } + + private boolean equalTo(FormComponent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormComponent of(FormBlock value) { + return new FormComponent(value, 0); + } + + public static FormComponent of(FormWidget value) { + return new FormComponent(value, 1); + } + + public static FormComponent of(FormField value) { + return new FormComponent(value, 2); + } + + public interface Visitor { + T visit(FormBlock value); + + T visit(FormWidget value); + + T visit(FormField value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormComponent.class); + } + + @java.lang.Override + public FormComponent deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormBlock.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormWidget.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormField.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java new file mode 100644 index 000000000..e6e50def2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormEndingNode.Builder.class) +public final class FormEndingNode { + private final Optional redirection; + + private final Optional afterSubmit; + + private final Optional coordinates; + + private final Optional resumeFlow; + + private final Map additionalProperties; + + private FormEndingNode( + Optional redirection, + Optional afterSubmit, + Optional coordinates, + Optional resumeFlow, + Map additionalProperties) { + this.redirection = redirection; + this.afterSubmit = afterSubmit; + this.coordinates = coordinates; + this.resumeFlow = resumeFlow; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("redirection") + public Optional getRedirection() { + return redirection; + } + + @JsonProperty("after_submit") + public Optional getAfterSubmit() { + return afterSubmit; + } + + @JsonProperty("coordinates") + public Optional getCoordinates() { + return coordinates; + } + + @JsonProperty("resume_flow") + public Optional getResumeFlow() { + return resumeFlow; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormEndingNode && equalTo((FormEndingNode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormEndingNode other) { + return redirection.equals(other.redirection) + && afterSubmit.equals(other.afterSubmit) + && coordinates.equals(other.coordinates) + && resumeFlow.equals(other.resumeFlow); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.redirection, this.afterSubmit, this.coordinates, this.resumeFlow); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional redirection = Optional.empty(); + + private Optional afterSubmit = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + private Optional resumeFlow = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormEndingNode other) { + redirection(other.getRedirection()); + afterSubmit(other.getAfterSubmit()); + coordinates(other.getCoordinates()); + resumeFlow(other.getResumeFlow()); + return this; + } + + @JsonSetter(value = "redirection", nulls = Nulls.SKIP) + public Builder redirection(Optional redirection) { + this.redirection = redirection; + return this; + } + + public Builder redirection(FormEndingNodeRedirection redirection) { + this.redirection = Optional.ofNullable(redirection); + return this; + } + + @JsonSetter(value = "after_submit", nulls = Nulls.SKIP) + public Builder afterSubmit(Optional afterSubmit) { + this.afterSubmit = afterSubmit; + return this; + } + + public Builder afterSubmit(FormEndingNodeAfterSubmit afterSubmit) { + this.afterSubmit = Optional.ofNullable(afterSubmit); + return this; + } + + @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) + public Builder coordinates(Optional coordinates) { + this.coordinates = coordinates; + return this; + } + + public Builder coordinates(FormNodeCoordinates coordinates) { + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + @JsonSetter(value = "resume_flow", nulls = Nulls.SKIP) + public Builder resumeFlow(Optional resumeFlow) { + this.resumeFlow = resumeFlow; + return this; + } + + public Builder resumeFlow(Boolean resumeFlow) { + this.resumeFlow = Optional.ofNullable(resumeFlow); + return this; + } + + public FormEndingNode build() { + return new FormEndingNode(redirection, afterSubmit, coordinates, resumeFlow, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java new file mode 100644 index 000000000..9cb34292c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormEndingNodeAfterSubmit.Builder.class) +public final class FormEndingNodeAfterSubmit { + private final Optional flowId; + + private final Map additionalProperties; + + private FormEndingNodeAfterSubmit(Optional flowId, Map additionalProperties) { + this.flowId = flowId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("flow_id") + public Optional getFlowId() { + return flowId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormEndingNodeAfterSubmit && equalTo((FormEndingNodeAfterSubmit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormEndingNodeAfterSubmit other) { + return flowId.equals(other.flowId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.flowId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional flowId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormEndingNodeAfterSubmit other) { + flowId(other.getFlowId()); + return this; + } + + @JsonSetter(value = "flow_id", nulls = Nulls.SKIP) + public Builder flowId(Optional flowId) { + this.flowId = flowId; + return this; + } + + public Builder flowId(String flowId) { + this.flowId = Optional.ofNullable(flowId); + return this; + } + + public FormEndingNodeAfterSubmit build() { + return new FormEndingNodeAfterSubmit(flowId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java new file mode 100644 index 000000000..c7f3601f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormEndingNodeRedirection.Builder.class) +public final class FormEndingNodeRedirection { + private final Optional delay; + + private final String target; + + private final Map additionalProperties; + + private FormEndingNodeRedirection( + Optional delay, String target, Map additionalProperties) { + this.delay = delay; + this.target = target; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("delay") + public Optional getDelay() { + return delay; + } + + @JsonProperty("target") + public String getTarget() { + return target; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormEndingNodeRedirection && equalTo((FormEndingNodeRedirection) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormEndingNodeRedirection other) { + return delay.equals(other.delay) && target.equals(other.target); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.delay, this.target); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetStage builder() { + return new Builder(); + } + + public interface TargetStage { + _FinalStage target(@NotNull String target); + + Builder from(FormEndingNodeRedirection other); + } + + public interface _FinalStage { + FormEndingNodeRedirection build(); + + _FinalStage delay(Optional delay); + + _FinalStage delay(Integer delay); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TargetStage, _FinalStage { + private String target; + + private Optional delay = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormEndingNodeRedirection other) { + delay(other.getDelay()); + target(other.getTarget()); + return this; + } + + @java.lang.Override + @JsonSetter("target") + public _FinalStage target(@NotNull String target) { + this.target = Objects.requireNonNull(target, "target must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage delay(Integer delay) { + this.delay = Optional.ofNullable(delay); + return this; + } + + @java.lang.Override + @JsonSetter(value = "delay", nulls = Nulls.SKIP) + public _FinalStage delay(Optional delay) { + this.delay = delay; + return this; + } + + @java.lang.Override + public FormEndingNodeRedirection build() { + return new FormEndingNodeRedirection(delay, target, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormField.java b/src/main/java/com/auth0/client/mgmt/types/FormField.java new file mode 100644 index 000000000..2efcc642c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormField.java @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormField.Deserializer.class) +public final class FormField { + private final Object value; + + private final int type; + + private FormField(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormFieldBoolean) this.value); + } else if (this.type == 1) { + return visitor.visit((FormFieldCards) this.value); + } else if (this.type == 2) { + return visitor.visit((FormFieldChoice) this.value); + } else if (this.type == 3) { + return visitor.visit((FormFieldCustom) this.value); + } else if (this.type == 4) { + return visitor.visit((FormFieldDate) this.value); + } else if (this.type == 5) { + return visitor.visit((FormFieldDropdown) this.value); + } else if (this.type == 6) { + return visitor.visit((FormFieldEmail) this.value); + } else if (this.type == 7) { + return visitor.visit((FormFieldFile) this.value); + } else if (this.type == 8) { + return visitor.visit((FormFieldLegal) this.value); + } else if (this.type == 9) { + return visitor.visit((FormFieldNumber) this.value); + } else if (this.type == 10) { + return visitor.visit((FormFieldPassword) this.value); + } else if (this.type == 11) { + return visitor.visit((FormFieldPayment) this.value); + } else if (this.type == 12) { + return visitor.visit((FormFieldSocial) this.value); + } else if (this.type == 13) { + return visitor.visit((FormFieldTel) this.value); + } else if (this.type == 14) { + return visitor.visit((FormFieldText) this.value); + } else if (this.type == 15) { + return visitor.visit((FormFieldUrl) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormField && equalTo((FormField) other); + } + + private boolean equalTo(FormField other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormField of(FormFieldBoolean value) { + return new FormField(value, 0); + } + + public static FormField of(FormFieldCards value) { + return new FormField(value, 1); + } + + public static FormField of(FormFieldChoice value) { + return new FormField(value, 2); + } + + public static FormField of(FormFieldCustom value) { + return new FormField(value, 3); + } + + public static FormField of(FormFieldDate value) { + return new FormField(value, 4); + } + + public static FormField of(FormFieldDropdown value) { + return new FormField(value, 5); + } + + public static FormField of(FormFieldEmail value) { + return new FormField(value, 6); + } + + public static FormField of(FormFieldFile value) { + return new FormField(value, 7); + } + + public static FormField of(FormFieldLegal value) { + return new FormField(value, 8); + } + + public static FormField of(FormFieldNumber value) { + return new FormField(value, 9); + } + + public static FormField of(FormFieldPassword value) { + return new FormField(value, 10); + } + + public static FormField of(FormFieldPayment value) { + return new FormField(value, 11); + } + + public static FormField of(FormFieldSocial value) { + return new FormField(value, 12); + } + + public static FormField of(FormFieldTel value) { + return new FormField(value, 13); + } + + public static FormField of(FormFieldText value) { + return new FormField(value, 14); + } + + public static FormField of(FormFieldUrl value) { + return new FormField(value, 15); + } + + public interface Visitor { + T visit(FormFieldBoolean value); + + T visit(FormFieldCards value); + + T visit(FormFieldChoice value); + + T visit(FormFieldCustom value); + + T visit(FormFieldDate value); + + T visit(FormFieldDropdown value); + + T visit(FormFieldEmail value); + + T visit(FormFieldFile value); + + T visit(FormFieldLegal value); + + T visit(FormFieldNumber value); + + T visit(FormFieldPassword value); + + T visit(FormFieldPayment value); + + T visit(FormFieldSocial value); + + T visit(FormFieldTel value); + + T visit(FormFieldText value); + + T visit(FormFieldUrl value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormField.class); + } + + @java.lang.Override + public FormField deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldBoolean.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldCards.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldChoice.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldCustom.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldDate.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldDropdown.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldEmail.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldFile.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldLegal.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldNumber.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldPassword.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldPayment.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldSocial.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldTel.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldText.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldUrl.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java new file mode 100644 index 000000000..35da43ce1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldBoolean.Builder.class) +public final class FormFieldBoolean { + private final String id; + + private final String category; + + private final String type; + + private final FormFieldBooleanConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldBoolean( + String id, + String category, + String type, + FormFieldBooleanConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormFieldBooleanConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldBoolean && equalTo((FormFieldBoolean) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldBoolean other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldBoolean other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFieldBooleanConfig config); + } + + public interface _FinalStage { + FormFieldBoolean build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormFieldBooleanConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldBoolean other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFieldBooleanConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormFieldBoolean build() { + return new FormFieldBoolean( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java new file mode 100644 index 000000000..6901ba78e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldBooleanConfig.Builder.class) +public final class FormFieldBooleanConfig { + private final Optional defaultValue; + + private final Optional options; + + private final Map additionalProperties; + + private FormFieldBooleanConfig( + Optional defaultValue, + Optional options, + Map additionalProperties) { + this.defaultValue = defaultValue; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldBooleanConfig && equalTo((FormFieldBooleanConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldBooleanConfig other) { + return defaultValue.equals(other.defaultValue) && options.equals(other.options); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.defaultValue, this.options); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional defaultValue = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldBooleanConfig other) { + defaultValue(other.getDefaultValue()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(Boolean defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(FormFieldBooleanConfigOptions options) { + this.options = Optional.ofNullable(options); + return this; + } + + public FormFieldBooleanConfig build() { + return new FormFieldBooleanConfig(defaultValue, options, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java new file mode 100644 index 000000000..4303222fc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldBooleanConfigOptions.Builder.class) +public final class FormFieldBooleanConfigOptions { + private final Optional true_; + + private final Optional false_; + + private final Map additionalProperties; + + private FormFieldBooleanConfigOptions( + Optional true_, Optional false_, Map additionalProperties) { + this.true_ = true_; + this.false_ = false_; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("true") + public Optional getTrue() { + return true_; + } + + @JsonProperty("false") + public Optional getFalse() { + return false_; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldBooleanConfigOptions && equalTo((FormFieldBooleanConfigOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldBooleanConfigOptions other) { + return true_.equals(other.true_) && false_.equals(other.false_); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.true_, this.false_); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional true_ = Optional.empty(); + + private Optional false_ = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldBooleanConfigOptions other) { + true_(other.getTrue()); + false_(other.getFalse()); + return this; + } + + @JsonSetter(value = "true", nulls = Nulls.SKIP) + public Builder true_(Optional true_) { + this.true_ = true_; + return this; + } + + public Builder true_(String true_) { + this.true_ = Optional.ofNullable(true_); + return this; + } + + @JsonSetter(value = "false", nulls = Nulls.SKIP) + public Builder false_(Optional false_) { + this.false_ = false_; + return this; + } + + public Builder false_(String false_) { + this.false_ = Optional.ofNullable(false_); + return this; + } + + public FormFieldBooleanConfigOptions build() { + return new FormFieldBooleanConfigOptions(true_, false_, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java new file mode 100644 index 000000000..50dfdcffe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldCards.Builder.class) +public final class FormFieldCards { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldCards( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldCards && equalTo((FormFieldCards) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldCards other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldCards other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldCards build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldCardsConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldCards other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldCardsConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldCards build() { + return new FormFieldCards( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java new file mode 100644 index 000000000..a526bc8b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldCardsConfig.Builder.class) +public final class FormFieldCardsConfig { + private final Optional hideLabels; + + private final Optional multiple; + + private final Optional> options; + + private final Map additionalProperties; + + private FormFieldCardsConfig( + Optional hideLabels, + Optional multiple, + Optional> options, + Map additionalProperties) { + this.hideLabels = hideLabels; + this.multiple = multiple; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("hide_labels") + public Optional getHideLabels() { + return hideLabels; + } + + @JsonProperty("multiple") + public Optional getMultiple() { + return multiple; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldCardsConfig && equalTo((FormFieldCardsConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldCardsConfig other) { + return hideLabels.equals(other.hideLabels) && multiple.equals(other.multiple) && options.equals(other.options); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hideLabels, this.multiple, this.options); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional hideLabels = Optional.empty(); + + private Optional multiple = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldCardsConfig other) { + hideLabels(other.getHideLabels()); + multiple(other.getMultiple()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "hide_labels", nulls = Nulls.SKIP) + public Builder hideLabels(Optional hideLabels) { + this.hideLabels = hideLabels; + return this; + } + + public Builder hideLabels(Boolean hideLabels) { + this.hideLabels = Optional.ofNullable(hideLabels); + return this; + } + + @JsonSetter(value = "multiple", nulls = Nulls.SKIP) + public Builder multiple(Optional multiple) { + this.multiple = multiple; + return this; + } + + public Builder multiple(Boolean multiple) { + this.multiple = Optional.ofNullable(multiple); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(List options) { + this.options = Optional.ofNullable(options); + return this; + } + + public FormFieldCardsConfig build() { + return new FormFieldCardsConfig(hideLabels, multiple, options, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java new file mode 100644 index 000000000..e85a6ccea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldCardsConfigOption.Builder.class) +public final class FormFieldCardsConfigOption { + private final String value; + + private final String label; + + private final String imageUrl; + + private final Map additionalProperties; + + private FormFieldCardsConfigOption( + String value, String label, String imageUrl, Map additionalProperties) { + this.value = value; + this.label = label; + this.imageUrl = imageUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @JsonProperty("image_url") + public String getImageUrl() { + return imageUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldCardsConfigOption && equalTo((FormFieldCardsConfigOption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldCardsConfigOption other) { + return value.equals(other.value) && label.equals(other.label) && imageUrl.equals(other.imageUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.label, this.imageUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ValueStage builder() { + return new Builder(); + } + + public interface ValueStage { + LabelStage value(@NotNull String value); + + Builder from(FormFieldCardsConfigOption other); + } + + public interface LabelStage { + ImageUrlStage label(@NotNull String label); + } + + public interface ImageUrlStage { + _FinalStage imageUrl(@NotNull String imageUrl); + } + + public interface _FinalStage { + FormFieldCardsConfigOption build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ValueStage, LabelStage, ImageUrlStage, _FinalStage { + private String value; + + private String label; + + private String imageUrl; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldCardsConfigOption other) { + value(other.getValue()); + label(other.getLabel()); + imageUrl(other.getImageUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("value") + public LabelStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("label") + public ImageUrlStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("image_url") + public _FinalStage imageUrl(@NotNull String imageUrl) { + this.imageUrl = Objects.requireNonNull(imageUrl, "imageUrl must not be null"); + return this; + } + + @java.lang.Override + public FormFieldCardsConfigOption build() { + return new FormFieldCardsConfigOption(value, label, imageUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java new file mode 100644 index 000000000..57f6f4dfe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldChoice.Builder.class) +public final class FormFieldChoice { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldChoice( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldChoice && equalTo((FormFieldChoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldChoice other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldChoice other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldChoice build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldChoiceConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldChoice other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldChoiceConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldChoice build() { + return new FormFieldChoice( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java new file mode 100644 index 000000000..181bab370 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldChoiceConfig.Builder.class) +public final class FormFieldChoiceConfig { + private final Optional multiple; + + private final Optional> options; + + private final Optional allowOther; + + private final Map additionalProperties; + + private FormFieldChoiceConfig( + Optional multiple, + Optional> options, + Optional allowOther, + Map additionalProperties) { + this.multiple = multiple; + this.options = options; + this.allowOther = allowOther; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("multiple") + public Optional getMultiple() { + return multiple; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @JsonProperty("allow_other") + public Optional getAllowOther() { + return allowOther; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldChoiceConfig && equalTo((FormFieldChoiceConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldChoiceConfig other) { + return multiple.equals(other.multiple) && options.equals(other.options) && allowOther.equals(other.allowOther); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.multiple, this.options, this.allowOther); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional multiple = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional allowOther = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldChoiceConfig other) { + multiple(other.getMultiple()); + options(other.getOptions()); + allowOther(other.getAllowOther()); + return this; + } + + @JsonSetter(value = "multiple", nulls = Nulls.SKIP) + public Builder multiple(Optional multiple) { + this.multiple = multiple; + return this; + } + + public Builder multiple(Boolean multiple) { + this.multiple = Optional.ofNullable(multiple); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(List options) { + this.options = Optional.ofNullable(options); + return this; + } + + @JsonSetter(value = "allow_other", nulls = Nulls.SKIP) + public Builder allowOther(Optional allowOther) { + this.allowOther = allowOther; + return this; + } + + public Builder allowOther(FormFieldChoiceConfigAllowOther allowOther) { + this.allowOther = Optional.ofNullable(allowOther); + return this; + } + + public FormFieldChoiceConfig build() { + return new FormFieldChoiceConfig(multiple, options, allowOther, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java new file mode 100644 index 000000000..49c6d7e81 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldChoiceConfigAllowOther.Builder.class) +public final class FormFieldChoiceConfigAllowOther { + private final Optional enabled; + + private final Optional label; + + private final Optional placeholder; + + private final Map additionalProperties; + + private FormFieldChoiceConfigAllowOther( + Optional enabled, + Optional label, + Optional placeholder, + Map additionalProperties) { + this.enabled = enabled; + this.label = label; + this.placeholder = placeholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldChoiceConfigAllowOther && equalTo((FormFieldChoiceConfigAllowOther) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldChoiceConfigAllowOther other) { + return enabled.equals(other.enabled) && label.equals(other.label) && placeholder.equals(other.placeholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.label, this.placeholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldChoiceConfigAllowOther other) { + enabled(other.getEnabled()); + label(other.getLabel()); + placeholder(other.getPlaceholder()); + return this; + } + + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public Builder label(Optional label) { + this.label = label; + return this; + } + + public Builder label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + public FormFieldChoiceConfigAllowOther build() { + return new FormFieldChoiceConfigAllowOther(enabled, label, placeholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java new file mode 100644 index 000000000..a7b0cf35b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldChoiceConfigOption.Builder.class) +public final class FormFieldChoiceConfigOption { + private final String value; + + private final String label; + + private final Map additionalProperties; + + private FormFieldChoiceConfigOption(String value, String label, Map additionalProperties) { + this.value = value; + this.label = label; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldChoiceConfigOption && equalTo((FormFieldChoiceConfigOption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldChoiceConfigOption other) { + return value.equals(other.value) && label.equals(other.label); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.label); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ValueStage builder() { + return new Builder(); + } + + public interface ValueStage { + LabelStage value(@NotNull String value); + + Builder from(FormFieldChoiceConfigOption other); + } + + public interface LabelStage { + _FinalStage label(@NotNull String label); + } + + public interface _FinalStage { + FormFieldChoiceConfigOption build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ValueStage, LabelStage, _FinalStage { + private String value; + + private String label; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldChoiceConfigOption other) { + value(other.getValue()); + label(other.getLabel()); + return this; + } + + @java.lang.Override + @JsonSetter("value") + public LabelStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("label") + public _FinalStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + @java.lang.Override + public FormFieldChoiceConfigOption build() { + return new FormFieldChoiceConfigOption(value, label, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java new file mode 100644 index 000000000..83d7fddd2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldCustom.Builder.class) +public final class FormFieldCustom { + private final String id; + + private final String category; + + private final String type; + + private final FormFieldCustomConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldCustom( + String id, + String category, + String type, + FormFieldCustomConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormFieldCustomConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldCustom && equalTo((FormFieldCustom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldCustom other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldCustom other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFieldCustomConfig config); + } + + public interface _FinalStage { + FormFieldCustom build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormFieldCustomConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldCustom other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFieldCustomConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormFieldCustom build() { + return new FormFieldCustom( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java new file mode 100644 index 000000000..8a789643a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldCustomConfig.Builder.class) +public final class FormFieldCustomConfig { + private final Map schema; + + private final String code; + + private final Optional css; + + private final Optional> params; + + private final Map additionalProperties; + + private FormFieldCustomConfig( + Map schema, + String code, + Optional css, + Optional> params, + Map additionalProperties) { + this.schema = schema; + this.code = code; + this.css = css; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("code") + public String getCode() { + return code; + } + + @JsonProperty("css") + public Optional getCss() { + return css; + } + + @JsonProperty("params") + public Optional> getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldCustomConfig && equalTo((FormFieldCustomConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldCustomConfig other) { + return schema.equals(other.schema) + && code.equals(other.code) + && css.equals(other.css) + && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.schema, this.code, this.css, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CodeStage builder() { + return new Builder(); + } + + public interface CodeStage { + _FinalStage code(@NotNull String code); + + Builder from(FormFieldCustomConfig other); + } + + public interface _FinalStage { + FormFieldCustomConfig build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, Object value); + + _FinalStage css(Optional css); + + _FinalStage css(String css); + + _FinalStage params(Optional> params); + + _FinalStage params(Map params); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CodeStage, _FinalStage { + private String code; + + private Optional> params = Optional.empty(); + + private Optional css = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldCustomConfig other) { + schema(other.getSchema()); + code(other.getCode()); + css(other.getCss()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public _FinalStage code(@NotNull String code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage params(Map params) { + this.params = Optional.ofNullable(params); + return this; + } + + @java.lang.Override + @JsonSetter(value = "params", nulls = Nulls.SKIP) + public _FinalStage params(Optional> params) { + this.params = params; + return this; + } + + @java.lang.Override + public _FinalStage css(String css) { + this.css = Optional.ofNullable(css); + return this; + } + + @java.lang.Override + @JsonSetter(value = "css", nulls = Nulls.SKIP) + public _FinalStage css(Optional css) { + this.css = css; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, Object value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + public FormFieldCustomConfig build() { + return new FormFieldCustomConfig(schema, code, css, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java new file mode 100644 index 000000000..7484ab2ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldDate.Builder.class) +public final class FormFieldDate { + private final String id; + + private final String category; + + private final String type; + + private final FormFieldDateConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldDate( + String id, + String category, + String type, + FormFieldDateConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormFieldDateConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldDate && equalTo((FormFieldDate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldDate other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldDate other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFieldDateConfig config); + } + + public interface _FinalStage { + FormFieldDate build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormFieldDateConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldDate other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFieldDateConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormFieldDate build() { + return new FormFieldDate( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java new file mode 100644 index 000000000..11f4bdb32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldDateConfig.Builder.class) +public final class FormFieldDateConfig { + private final Optional format; + + private final Optional defaultValue; + + private final Map additionalProperties; + + private FormFieldDateConfig( + Optional format, + Optional defaultValue, + Map additionalProperties) { + this.format = format; + this.defaultValue = defaultValue; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldDateConfig && equalTo((FormFieldDateConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldDateConfig other) { + return format.equals(other.format) && defaultValue.equals(other.defaultValue); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.format, this.defaultValue); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional format = Optional.empty(); + + private Optional defaultValue = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldDateConfig other) { + format(other.getFormat()); + defaultValue(other.getDefaultValue()); + return this; + } + + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public Builder format(Optional format) { + this.format = format; + return this; + } + + public Builder format(FormFieldDateConfigFormatEnum format) { + this.format = Optional.ofNullable(format); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + public FormFieldDateConfig build() { + return new FormFieldDateConfig(format, defaultValue, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java new file mode 100644 index 000000000..1bc0f9a37 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormFieldDateConfigFormatEnum { + public static final FormFieldDateConfigFormatEnum TIME = new FormFieldDateConfigFormatEnum(Value.TIME, "TIME"); + + public static final FormFieldDateConfigFormatEnum DATE = new FormFieldDateConfigFormatEnum(Value.DATE, "DATE"); + + private final Value value; + + private final String string; + + FormFieldDateConfigFormatEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormFieldDateConfigFormatEnum + && this.string.equals(((FormFieldDateConfigFormatEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TIME: + return visitor.visitTime(); + case DATE: + return visitor.visitDate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormFieldDateConfigFormatEnum valueOf(String value) { + switch (value) { + case "TIME": + return TIME; + case "DATE": + return DATE; + default: + return new FormFieldDateConfigFormatEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DATE, + + TIME, + + UNKNOWN + } + + public interface Visitor { + T visitDate(); + + T visitTime(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java new file mode 100644 index 000000000..674c4b055 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldDropdown.Builder.class) +public final class FormFieldDropdown { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldDropdown( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldDropdown && equalTo((FormFieldDropdown) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldDropdown other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldDropdown other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldDropdown build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldDropdownConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldDropdown other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldDropdownConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldDropdown build() { + return new FormFieldDropdown( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java new file mode 100644 index 000000000..5a1efa85e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldDropdownConfig.Builder.class) +public final class FormFieldDropdownConfig { + private final Optional multiple; + + private final Optional> options; + + private final Optional placeholder; + + private final Map additionalProperties; + + private FormFieldDropdownConfig( + Optional multiple, + Optional> options, + Optional placeholder, + Map additionalProperties) { + this.multiple = multiple; + this.options = options; + this.placeholder = placeholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("multiple") + public Optional getMultiple() { + return multiple; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldDropdownConfig && equalTo((FormFieldDropdownConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldDropdownConfig other) { + return multiple.equals(other.multiple) + && options.equals(other.options) + && placeholder.equals(other.placeholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.multiple, this.options, this.placeholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional multiple = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldDropdownConfig other) { + multiple(other.getMultiple()); + options(other.getOptions()); + placeholder(other.getPlaceholder()); + return this; + } + + @JsonSetter(value = "multiple", nulls = Nulls.SKIP) + public Builder multiple(Optional multiple) { + this.multiple = multiple; + return this; + } + + public Builder multiple(Boolean multiple) { + this.multiple = Optional.ofNullable(multiple); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(List options) { + this.options = Optional.ofNullable(options); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + public FormFieldDropdownConfig build() { + return new FormFieldDropdownConfig(multiple, options, placeholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java new file mode 100644 index 000000000..49965c866 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldDropdownConfigOption.Builder.class) +public final class FormFieldDropdownConfigOption { + private final String value; + + private final String label; + + private final Map additionalProperties; + + private FormFieldDropdownConfigOption(String value, String label, Map additionalProperties) { + this.value = value; + this.label = label; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldDropdownConfigOption && equalTo((FormFieldDropdownConfigOption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldDropdownConfigOption other) { + return value.equals(other.value) && label.equals(other.label); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.label); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ValueStage builder() { + return new Builder(); + } + + public interface ValueStage { + LabelStage value(@NotNull String value); + + Builder from(FormFieldDropdownConfigOption other); + } + + public interface LabelStage { + _FinalStage label(@NotNull String label); + } + + public interface _FinalStage { + FormFieldDropdownConfigOption build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ValueStage, LabelStage, _FinalStage { + private String value; + + private String label; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldDropdownConfigOption other) { + value(other.getValue()); + label(other.getLabel()); + return this; + } + + @java.lang.Override + @JsonSetter("value") + public LabelStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("label") + public _FinalStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + @java.lang.Override + public FormFieldDropdownConfigOption build() { + return new FormFieldDropdownConfigOption(value, label, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java new file mode 100644 index 000000000..de80038fa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldEmail.Builder.class) +public final class FormFieldEmail { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldEmail( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldEmail && equalTo((FormFieldEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldEmail other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldEmail other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldEmail build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldEmailConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldEmail other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldEmailConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldEmail build() { + return new FormFieldEmail( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java new file mode 100644 index 000000000..6cf5817fe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldEmailConfig.Builder.class) +public final class FormFieldEmailConfig { + private final Optional defaultValue; + + private final Optional placeholder; + + private final Map additionalProperties; + + private FormFieldEmailConfig( + Optional defaultValue, Optional placeholder, Map additionalProperties) { + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldEmailConfig && equalTo((FormFieldEmailConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldEmailConfig other) { + return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.defaultValue, this.placeholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldEmailConfig other) { + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + public FormFieldEmailConfig build() { + return new FormFieldEmailConfig(defaultValue, placeholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java new file mode 100644 index 000000000..ee9d498df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldFile.Builder.class) +public final class FormFieldFile { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldFile( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldFile && equalTo((FormFieldFile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldFile other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldFile other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldFile build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldFileConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldFile other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldFileConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldFile build() { + return new FormFieldFile( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java new file mode 100644 index 000000000..29a77e1e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldFileConfig.Builder.class) +public final class FormFieldFileConfig { + private final Optional multiple; + + private final Optional storage; + + private final Optional> categories; + + private final Optional> extensions; + + private final Optional maxSize; + + private final Optional maxFiles; + + private final Map additionalProperties; + + private FormFieldFileConfig( + Optional multiple, + Optional storage, + Optional> categories, + Optional> extensions, + Optional maxSize, + Optional maxFiles, + Map additionalProperties) { + this.multiple = multiple; + this.storage = storage; + this.categories = categories; + this.extensions = extensions; + this.maxSize = maxSize; + this.maxFiles = maxFiles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("multiple") + public Optional getMultiple() { + return multiple; + } + + @JsonProperty("storage") + public Optional getStorage() { + return storage; + } + + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + @JsonProperty("extensions") + public Optional> getExtensions() { + return extensions; + } + + @JsonProperty("maxSize") + public Optional getMaxSize() { + return maxSize; + } + + @JsonProperty("maxFiles") + public Optional getMaxFiles() { + return maxFiles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldFileConfig && equalTo((FormFieldFileConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldFileConfig other) { + return multiple.equals(other.multiple) + && storage.equals(other.storage) + && categories.equals(other.categories) + && extensions.equals(other.extensions) + && maxSize.equals(other.maxSize) + && maxFiles.equals(other.maxFiles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.multiple, this.storage, this.categories, this.extensions, this.maxSize, this.maxFiles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional multiple = Optional.empty(); + + private Optional storage = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional> extensions = Optional.empty(); + + private Optional maxSize = Optional.empty(); + + private Optional maxFiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldFileConfig other) { + multiple(other.getMultiple()); + storage(other.getStorage()); + categories(other.getCategories()); + extensions(other.getExtensions()); + maxSize(other.getMaxSize()); + maxFiles(other.getMaxFiles()); + return this; + } + + @JsonSetter(value = "multiple", nulls = Nulls.SKIP) + public Builder multiple(Optional multiple) { + this.multiple = multiple; + return this; + } + + public Builder multiple(Boolean multiple) { + this.multiple = Optional.ofNullable(multiple); + return this; + } + + @JsonSetter(value = "storage", nulls = Nulls.SKIP) + public Builder storage(Optional storage) { + this.storage = storage; + return this; + } + + public Builder storage(FormFieldFileConfigStorage storage) { + this.storage = Optional.ofNullable(storage); + return this; + } + + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public Builder categories(Optional> categories) { + this.categories = categories; + return this; + } + + public Builder categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @JsonSetter(value = "extensions", nulls = Nulls.SKIP) + public Builder extensions(Optional> extensions) { + this.extensions = extensions; + return this; + } + + public Builder extensions(List extensions) { + this.extensions = Optional.ofNullable(extensions); + return this; + } + + @JsonSetter(value = "maxSize", nulls = Nulls.SKIP) + public Builder maxSize(Optional maxSize) { + this.maxSize = maxSize; + return this; + } + + public Builder maxSize(Integer maxSize) { + this.maxSize = Optional.ofNullable(maxSize); + return this; + } + + @JsonSetter(value = "maxFiles", nulls = Nulls.SKIP) + public Builder maxFiles(Optional maxFiles) { + this.maxFiles = maxFiles; + return this; + } + + public Builder maxFiles(Integer maxFiles) { + this.maxFiles = Optional.ofNullable(maxFiles); + return this; + } + + public FormFieldFileConfig build() { + return new FormFieldFileConfig( + multiple, storage, categories, extensions, maxSize, maxFiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java new file mode 100644 index 000000000..e28d21e68 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormFieldFileConfigCategoryEnum { + public static final FormFieldFileConfigCategoryEnum VIDEO = + new FormFieldFileConfigCategoryEnum(Value.VIDEO, "VIDEO"); + + public static final FormFieldFileConfigCategoryEnum DOCUMENT = + new FormFieldFileConfigCategoryEnum(Value.DOCUMENT, "DOCUMENT"); + + public static final FormFieldFileConfigCategoryEnum AUDIO = + new FormFieldFileConfigCategoryEnum(Value.AUDIO, "AUDIO"); + + public static final FormFieldFileConfigCategoryEnum ARCHIVE = + new FormFieldFileConfigCategoryEnum(Value.ARCHIVE, "ARCHIVE"); + + public static final FormFieldFileConfigCategoryEnum IMAGE = + new FormFieldFileConfigCategoryEnum(Value.IMAGE, "IMAGE"); + + private final Value value; + + private final String string; + + FormFieldFileConfigCategoryEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormFieldFileConfigCategoryEnum + && this.string.equals(((FormFieldFileConfigCategoryEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case VIDEO: + return visitor.visitVideo(); + case DOCUMENT: + return visitor.visitDocument(); + case AUDIO: + return visitor.visitAudio(); + case ARCHIVE: + return visitor.visitArchive(); + case IMAGE: + return visitor.visitImage(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormFieldFileConfigCategoryEnum valueOf(String value) { + switch (value) { + case "VIDEO": + return VIDEO; + case "DOCUMENT": + return DOCUMENT; + case "AUDIO": + return AUDIO; + case "ARCHIVE": + return ARCHIVE; + case "IMAGE": + return IMAGE; + default: + return new FormFieldFileConfigCategoryEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUDIO, + + VIDEO, + + IMAGE, + + DOCUMENT, + + ARCHIVE, + + UNKNOWN + } + + public interface Visitor { + T visitAudio(); + + T visitVideo(); + + T visitImage(); + + T visitDocument(); + + T visitArchive(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java new file mode 100644 index 000000000..56854c2b6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldFileConfigStorage.Builder.class) +public final class FormFieldFileConfigStorage { + private final FormFieldFileConfigStorageTypeEnum type; + + private final Map additionalProperties; + + private FormFieldFileConfigStorage( + FormFieldFileConfigStorageTypeEnum type, Map additionalProperties) { + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public FormFieldFileConfigStorageTypeEnum getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldFileConfigStorage && equalTo((FormFieldFileConfigStorage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldFileConfigStorage other) { + return type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull FormFieldFileConfigStorageTypeEnum type); + + Builder from(FormFieldFileConfigStorage other); + } + + public interface _FinalStage { + FormFieldFileConfigStorage build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private FormFieldFileConfigStorageTypeEnum type; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldFileConfigStorage other) { + type(other.getType()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull FormFieldFileConfigStorageTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public FormFieldFileConfigStorage build() { + return new FormFieldFileConfigStorage(type, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java new file mode 100644 index 000000000..363cb3796 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormFieldFileConfigStorageTypeEnum { + public static final FormFieldFileConfigStorageTypeEnum CUSTOM = + new FormFieldFileConfigStorageTypeEnum(Value.CUSTOM, "CUSTOM"); + + public static final FormFieldFileConfigStorageTypeEnum MANAGED = + new FormFieldFileConfigStorageTypeEnum(Value.MANAGED, "MANAGED"); + + private final Value value; + + private final String string; + + FormFieldFileConfigStorageTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormFieldFileConfigStorageTypeEnum + && this.string.equals(((FormFieldFileConfigStorageTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOM: + return visitor.visitCustom(); + case MANAGED: + return visitor.visitManaged(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormFieldFileConfigStorageTypeEnum valueOf(String value) { + switch (value) { + case "CUSTOM": + return CUSTOM; + case "MANAGED": + return MANAGED; + default: + return new FormFieldFileConfigStorageTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + MANAGED, + + CUSTOM, + + UNKNOWN + } + + public interface Visitor { + T visitManaged(); + + T visitCustom(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java new file mode 100644 index 000000000..ff8e09e60 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldLegal.Builder.class) +public final class FormFieldLegal { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldLegal( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldLegal && equalTo((FormFieldLegal) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldLegal other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldLegal other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldLegal build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldLegalConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldLegal other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldLegalConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldLegal build() { + return new FormFieldLegal( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java new file mode 100644 index 000000000..482a6c4d0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldLegalConfig.Builder.class) +public final class FormFieldLegalConfig { + private final Optional text; + + private final Map additionalProperties; + + private FormFieldLegalConfig(Optional text, Map additionalProperties) { + this.text = text; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("text") + public Optional getText() { + return text; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldLegalConfig && equalTo((FormFieldLegalConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldLegalConfig other) { + return text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional text = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldLegalConfig other) { + text(other.getText()); + return this; + } + + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public Builder text(Optional text) { + this.text = text; + return this; + } + + public Builder text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + public FormFieldLegalConfig build() { + return new FormFieldLegalConfig(text, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java new file mode 100644 index 000000000..04e6a4766 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldNumber.Builder.class) +public final class FormFieldNumber { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldNumber( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldNumber && equalTo((FormFieldNumber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldNumber other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldNumber other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldNumber build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldNumberConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldNumber other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldNumberConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldNumber build() { + return new FormFieldNumber( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java new file mode 100644 index 000000000..3f25a6c1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldNumberConfig.Builder.class) +public final class FormFieldNumberConfig { + private final Optional defaultValue; + + private final Optional placeholder; + + private final Optional minValue; + + private final Optional maxValue; + + private final Map additionalProperties; + + private FormFieldNumberConfig( + Optional defaultValue, + Optional placeholder, + Optional minValue, + Optional maxValue, + Map additionalProperties) { + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.minValue = minValue; + this.maxValue = maxValue; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @JsonProperty("min_value") + public Optional getMinValue() { + return minValue; + } + + @JsonProperty("max_value") + public Optional getMaxValue() { + return maxValue; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldNumberConfig && equalTo((FormFieldNumberConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldNumberConfig other) { + return defaultValue.equals(other.defaultValue) + && placeholder.equals(other.placeholder) + && minValue.equals(other.minValue) + && maxValue.equals(other.maxValue); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.defaultValue, this.placeholder, this.minValue, this.maxValue); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + private Optional minValue = Optional.empty(); + + private Optional maxValue = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldNumberConfig other) { + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + minValue(other.getMinValue()); + maxValue(other.getMaxValue()); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(Double defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + @JsonSetter(value = "min_value", nulls = Nulls.SKIP) + public Builder minValue(Optional minValue) { + this.minValue = minValue; + return this; + } + + public Builder minValue(Double minValue) { + this.minValue = Optional.ofNullable(minValue); + return this; + } + + @JsonSetter(value = "max_value", nulls = Nulls.SKIP) + public Builder maxValue(Optional maxValue) { + this.maxValue = maxValue; + return this; + } + + public Builder maxValue(Double maxValue) { + this.maxValue = Optional.ofNullable(maxValue); + return this; + } + + public FormFieldNumberConfig build() { + return new FormFieldNumberConfig(defaultValue, placeholder, minValue, maxValue, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java new file mode 100644 index 000000000..fc1c79169 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPassword.Builder.class) +public final class FormFieldPassword { + private final String id; + + private final String category; + + private final String type; + + private final FormFieldPasswordConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldPassword( + String id, + String category, + String type, + FormFieldPasswordConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormFieldPasswordConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPassword && equalTo((FormFieldPassword) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPassword other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldPassword other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFieldPasswordConfig config); + } + + public interface _FinalStage { + FormFieldPassword build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormFieldPasswordConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPassword other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFieldPasswordConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormFieldPassword build() { + return new FormFieldPassword( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java new file mode 100644 index 000000000..9c0a9a4dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPasswordConfig.Builder.class) +public final class FormFieldPasswordConfig { + private final Optional hash; + + private final Optional placeholder; + + private final Optional minLength; + + private final Optional maxLength; + + private final Optional complexity; + + private final Optional nist; + + private final Optional strengthMeter; + + private final Map additionalProperties; + + private FormFieldPasswordConfig( + Optional hash, + Optional placeholder, + Optional minLength, + Optional maxLength, + Optional complexity, + Optional nist, + Optional strengthMeter, + Map additionalProperties) { + this.hash = hash; + this.placeholder = placeholder; + this.minLength = minLength; + this.maxLength = maxLength; + this.complexity = complexity; + this.nist = nist; + this.strengthMeter = strengthMeter; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("hash") + public Optional getHash() { + return hash; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + @JsonProperty("max_length") + public Optional getMaxLength() { + return maxLength; + } + + @JsonProperty("complexity") + public Optional getComplexity() { + return complexity; + } + + @JsonProperty("nist") + public Optional getNist() { + return nist; + } + + @JsonProperty("strength_meter") + public Optional getStrengthMeter() { + return strengthMeter; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPasswordConfig && equalTo((FormFieldPasswordConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPasswordConfig other) { + return hash.equals(other.hash) + && placeholder.equals(other.placeholder) + && minLength.equals(other.minLength) + && maxLength.equals(other.maxLength) + && complexity.equals(other.complexity) + && nist.equals(other.nist) + && strengthMeter.equals(other.strengthMeter); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.hash, + this.placeholder, + this.minLength, + this.maxLength, + this.complexity, + this.nist, + this.strengthMeter); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional hash = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + private Optional minLength = Optional.empty(); + + private Optional maxLength = Optional.empty(); + + private Optional complexity = Optional.empty(); + + private Optional nist = Optional.empty(); + + private Optional strengthMeter = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldPasswordConfig other) { + hash(other.getHash()); + placeholder(other.getPlaceholder()); + minLength(other.getMinLength()); + maxLength(other.getMaxLength()); + complexity(other.getComplexity()); + nist(other.getNist()); + strengthMeter(other.getStrengthMeter()); + return this; + } + + @JsonSetter(value = "hash", nulls = Nulls.SKIP) + public Builder hash(Optional hash) { + this.hash = hash; + return this; + } + + public Builder hash(FormFieldPasswordConfigHashEnum hash) { + this.hash = Optional.ofNullable(hash); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public Builder minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + public Builder minLength(Integer minLength) { + this.minLength = Optional.ofNullable(minLength); + return this; + } + + @JsonSetter(value = "max_length", nulls = Nulls.SKIP) + public Builder maxLength(Optional maxLength) { + this.maxLength = maxLength; + return this; + } + + public Builder maxLength(Integer maxLength) { + this.maxLength = Optional.ofNullable(maxLength); + return this; + } + + @JsonSetter(value = "complexity", nulls = Nulls.SKIP) + public Builder complexity(Optional complexity) { + this.complexity = complexity; + return this; + } + + public Builder complexity(Boolean complexity) { + this.complexity = Optional.ofNullable(complexity); + return this; + } + + @JsonSetter(value = "nist", nulls = Nulls.SKIP) + public Builder nist(Optional nist) { + this.nist = nist; + return this; + } + + public Builder nist(Boolean nist) { + this.nist = Optional.ofNullable(nist); + return this; + } + + @JsonSetter(value = "strength_meter", nulls = Nulls.SKIP) + public Builder strengthMeter(Optional strengthMeter) { + this.strengthMeter = strengthMeter; + return this; + } + + public Builder strengthMeter(Boolean strengthMeter) { + this.strengthMeter = Optional.ofNullable(strengthMeter); + return this; + } + + public FormFieldPasswordConfig build() { + return new FormFieldPasswordConfig( + hash, placeholder, minLength, maxLength, complexity, nist, strengthMeter, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java new file mode 100644 index 000000000..b61d4c088 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormFieldPasswordConfigHashEnum { + public static final FormFieldPasswordConfigHashEnum SHA1 = new FormFieldPasswordConfigHashEnum(Value.SHA1, "SHA1"); + + public static final FormFieldPasswordConfigHashEnum SHA256 = + new FormFieldPasswordConfigHashEnum(Value.SHA256, "SHA256"); + + public static final FormFieldPasswordConfigHashEnum NONE = new FormFieldPasswordConfigHashEnum(Value.NONE, "NONE"); + + public static final FormFieldPasswordConfigHashEnum SHA512 = + new FormFieldPasswordConfigHashEnum(Value.SHA512, "SHA512"); + + public static final FormFieldPasswordConfigHashEnum MD5 = new FormFieldPasswordConfigHashEnum(Value.MD5, "MD5"); + + private final Value value; + + private final String string; + + FormFieldPasswordConfigHashEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormFieldPasswordConfigHashEnum + && this.string.equals(((FormFieldPasswordConfigHashEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHA1: + return visitor.visitSha1(); + case SHA256: + return visitor.visitSha256(); + case NONE: + return visitor.visitNone(); + case SHA512: + return visitor.visitSha512(); + case MD5: + return visitor.visitMd5(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormFieldPasswordConfigHashEnum valueOf(String value) { + switch (value) { + case "SHA1": + return SHA1; + case "SHA256": + return SHA256; + case "NONE": + return NONE; + case "SHA512": + return SHA512; + case "MD5": + return MD5; + default: + return new FormFieldPasswordConfigHashEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + MD5, + + SHA1, + + SHA256, + + SHA512, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitMd5(); + + T visitSha1(); + + T visitSha256(); + + T visitSha512(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java new file mode 100644 index 000000000..1e6ce138e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPayment.Builder.class) +public final class FormFieldPayment { + private final String id; + + private final String category; + + private final String type; + + private final FormFieldPaymentConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldPayment( + String id, + String category, + String type, + FormFieldPaymentConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormFieldPaymentConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPayment && equalTo((FormFieldPayment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPayment other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldPayment other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFieldPaymentConfig config); + } + + public interface _FinalStage { + FormFieldPayment build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormFieldPaymentConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPayment other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFieldPaymentConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormFieldPayment build() { + return new FormFieldPayment( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java new file mode 100644 index 000000000..094177612 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfig.Builder.class) +public final class FormFieldPaymentConfig { + private final Optional provider; + + private final FormFieldPaymentConfigCharge charge; + + private final FormFieldPaymentConfigCredentials credentials; + + private final Optional> customer; + + private final Optional fields; + + private final Map additionalProperties; + + private FormFieldPaymentConfig( + Optional provider, + FormFieldPaymentConfigCharge charge, + FormFieldPaymentConfigCredentials credentials, + Optional> customer, + Optional fields, + Map additionalProperties) { + this.provider = provider; + this.charge = charge; + this.credentials = credentials; + this.customer = customer; + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @JsonProperty("charge") + public FormFieldPaymentConfigCharge getCharge() { + return charge; + } + + @JsonProperty("credentials") + public FormFieldPaymentConfigCredentials getCredentials() { + return credentials; + } + + @JsonProperty("customer") + public Optional> getCustomer() { + return customer; + } + + @JsonProperty("fields") + public Optional getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfig && equalTo((FormFieldPaymentConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfig other) { + return provider.equals(other.provider) + && charge.equals(other.charge) + && credentials.equals(other.credentials) + && customer.equals(other.customer) + && fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider, this.charge, this.credentials, this.customer, this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ChargeStage builder() { + return new Builder(); + } + + public interface ChargeStage { + CredentialsStage charge(@NotNull FormFieldPaymentConfigCharge charge); + + Builder from(FormFieldPaymentConfig other); + } + + public interface CredentialsStage { + _FinalStage credentials(@NotNull FormFieldPaymentConfigCredentials credentials); + } + + public interface _FinalStage { + FormFieldPaymentConfig build(); + + _FinalStage provider(Optional provider); + + _FinalStage provider(String provider); + + _FinalStage customer(Optional> customer); + + _FinalStage customer(Map customer); + + _FinalStage fields(Optional fields); + + _FinalStage fields(FormFieldPaymentConfigFields fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ChargeStage, CredentialsStage, _FinalStage { + private FormFieldPaymentConfigCharge charge; + + private FormFieldPaymentConfigCredentials credentials; + + private Optional fields = Optional.empty(); + + private Optional> customer = Optional.empty(); + + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPaymentConfig other) { + provider(other.getProvider()); + charge(other.getCharge()); + credentials(other.getCredentials()); + customer(other.getCustomer()); + fields(other.getFields()); + return this; + } + + @java.lang.Override + @JsonSetter("charge") + public CredentialsStage charge(@NotNull FormFieldPaymentConfigCharge charge) { + this.charge = Objects.requireNonNull(charge, "charge must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("credentials") + public _FinalStage credentials(@NotNull FormFieldPaymentConfigCredentials credentials) { + this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(FormFieldPaymentConfigFields fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public _FinalStage customer(Map customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public _FinalStage customer(Optional> customer) { + this.customer = customer; + return this; + } + + @java.lang.Override + public _FinalStage provider(String provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + @java.lang.Override + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public _FinalStage provider(Optional provider) { + this.provider = provider; + return this; + } + + @java.lang.Override + public FormFieldPaymentConfig build() { + return new FormFieldPaymentConfig(provider, charge, credentials, customer, fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java new file mode 100644 index 000000000..f9fbb95ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormFieldPaymentConfigCharge.Deserializer.class) +public final class FormFieldPaymentConfigCharge { + private final Object value; + + private final int type; + + private FormFieldPaymentConfigCharge(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormFieldPaymentConfigChargeOneOff) this.value); + } else if (this.type == 1) { + return visitor.visit((FormFieldPaymentConfigChargeSubscription) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigCharge && equalTo((FormFieldPaymentConfigCharge) other); + } + + private boolean equalTo(FormFieldPaymentConfigCharge other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormFieldPaymentConfigCharge of(FormFieldPaymentConfigChargeOneOff value) { + return new FormFieldPaymentConfigCharge(value, 0); + } + + public static FormFieldPaymentConfigCharge of(FormFieldPaymentConfigChargeSubscription value) { + return new FormFieldPaymentConfigCharge(value, 1); + } + + public interface Visitor { + T visit(FormFieldPaymentConfigChargeOneOff value); + + T visit(FormFieldPaymentConfigChargeSubscription value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormFieldPaymentConfigCharge.class); + } + + @java.lang.Override + public FormFieldPaymentConfigCharge deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldPaymentConfigChargeOneOff.class)); + } catch (RuntimeException e) { + } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, FormFieldPaymentConfigChargeSubscription.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOff.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOff.java new file mode 100644 index 000000000..bc4688a83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOff.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigChargeOneOff.Builder.class) +public final class FormFieldPaymentConfigChargeOneOff { + private final String type; + + private final FormFieldPaymentConfigChargeOneOffOneOff oneOff; + + private final Map additionalProperties; + + private FormFieldPaymentConfigChargeOneOff( + String type, FormFieldPaymentConfigChargeOneOffOneOff oneOff, Map additionalProperties) { + this.type = type; + this.oneOff = oneOff; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("one_off") + public FormFieldPaymentConfigChargeOneOffOneOff getOneOff() { + return oneOff; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigChargeOneOff + && equalTo((FormFieldPaymentConfigChargeOneOff) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigChargeOneOff other) { + return type.equals(other.type) && oneOff.equals(other.oneOff); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.oneOff); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + OneOffStage type(@NotNull String type); + + Builder from(FormFieldPaymentConfigChargeOneOff other); + } + + public interface OneOffStage { + _FinalStage oneOff(@NotNull FormFieldPaymentConfigChargeOneOffOneOff oneOff); + } + + public interface _FinalStage { + FormFieldPaymentConfigChargeOneOff build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, OneOffStage, _FinalStage { + private String type; + + private FormFieldPaymentConfigChargeOneOffOneOff oneOff; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPaymentConfigChargeOneOff other) { + type(other.getType()); + oneOff(other.getOneOff()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public OneOffStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("one_off") + public _FinalStage oneOff(@NotNull FormFieldPaymentConfigChargeOneOffOneOff oneOff) { + this.oneOff = Objects.requireNonNull(oneOff, "oneOff must not be null"); + return this; + } + + @java.lang.Override + public FormFieldPaymentConfigChargeOneOff build() { + return new FormFieldPaymentConfigChargeOneOff(type, oneOff, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffCurrencyEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffCurrencyEnum.java new file mode 100644 index 000000000..6743e7c97 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffCurrencyEnum.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormFieldPaymentConfigChargeOneOffCurrencyEnum { + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum AUD = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.AUD, "AUD"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum CAD = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.CAD, "CAD"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum USD = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.USD, "USD"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum CHF = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.CHF, "CHF"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum EUR = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.EUR, "EUR"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum INR = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.INR, "INR"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum MXN = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.MXN, "MXN"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum GBP = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.GBP, "GBP"); + + public static final FormFieldPaymentConfigChargeOneOffCurrencyEnum SEK = + new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.SEK, "SEK"); + + private final Value value; + + private final String string; + + FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormFieldPaymentConfigChargeOneOffCurrencyEnum + && this.string.equals(((FormFieldPaymentConfigChargeOneOffCurrencyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUD: + return visitor.visitAud(); + case CAD: + return visitor.visitCad(); + case USD: + return visitor.visitUsd(); + case CHF: + return visitor.visitChf(); + case EUR: + return visitor.visitEur(); + case INR: + return visitor.visitInr(); + case MXN: + return visitor.visitMxn(); + case GBP: + return visitor.visitGbp(); + case SEK: + return visitor.visitSek(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormFieldPaymentConfigChargeOneOffCurrencyEnum valueOf(String value) { + switch (value) { + case "AUD": + return AUD; + case "CAD": + return CAD; + case "USD": + return USD; + case "CHF": + return CHF; + case "EUR": + return EUR; + case "INR": + return INR; + case "MXN": + return MXN; + case "GBP": + return GBP; + case "SEK": + return SEK; + default: + return new FormFieldPaymentConfigChargeOneOffCurrencyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUD, + + CAD, + + CHF, + + EUR, + + GBP, + + INR, + + MXN, + + SEK, + + USD, + + UNKNOWN + } + + public interface Visitor { + T visitAud(); + + T visitCad(); + + T visitChf(); + + T visitEur(); + + T visitGbp(); + + T visitInr(); + + T visitMxn(); + + T visitSek(); + + T visitUsd(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOff.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOff.java new file mode 100644 index 000000000..fec664046 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOff.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigChargeOneOffOneOff.Builder.class) +public final class FormFieldPaymentConfigChargeOneOffOneOff { + private final FormFieldPaymentConfigChargeOneOffOneOffAmount amount; + + private final FormFieldPaymentConfigChargeOneOffCurrencyEnum currency; + + private final Map additionalProperties; + + private FormFieldPaymentConfigChargeOneOffOneOff( + FormFieldPaymentConfigChargeOneOffOneOffAmount amount, + FormFieldPaymentConfigChargeOneOffCurrencyEnum currency, + Map additionalProperties) { + this.amount = amount; + this.currency = currency; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("amount") + public FormFieldPaymentConfigChargeOneOffOneOffAmount getAmount() { + return amount; + } + + @JsonProperty("currency") + public FormFieldPaymentConfigChargeOneOffCurrencyEnum getCurrency() { + return currency; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigChargeOneOffOneOff + && equalTo((FormFieldPaymentConfigChargeOneOffOneOff) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigChargeOneOffOneOff other) { + return amount.equals(other.amount) && currency.equals(other.currency); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.amount, this.currency); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountStage builder() { + return new Builder(); + } + + public interface AmountStage { + CurrencyStage amount(@NotNull FormFieldPaymentConfigChargeOneOffOneOffAmount amount); + + Builder from(FormFieldPaymentConfigChargeOneOffOneOff other); + } + + public interface CurrencyStage { + _FinalStage currency(@NotNull FormFieldPaymentConfigChargeOneOffCurrencyEnum currency); + } + + public interface _FinalStage { + FormFieldPaymentConfigChargeOneOffOneOff build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AmountStage, CurrencyStage, _FinalStage { + private FormFieldPaymentConfigChargeOneOffOneOffAmount amount; + + private FormFieldPaymentConfigChargeOneOffCurrencyEnum currency; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPaymentConfigChargeOneOffOneOff other) { + amount(other.getAmount()); + currency(other.getCurrency()); + return this; + } + + @java.lang.Override + @JsonSetter("amount") + public CurrencyStage amount(@NotNull FormFieldPaymentConfigChargeOneOffOneOffAmount amount) { + this.amount = Objects.requireNonNull(amount, "amount must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("currency") + public _FinalStage currency(@NotNull FormFieldPaymentConfigChargeOneOffCurrencyEnum currency) { + this.currency = Objects.requireNonNull(currency, "currency must not be null"); + return this; + } + + @java.lang.Override + public FormFieldPaymentConfigChargeOneOffOneOff build() { + return new FormFieldPaymentConfigChargeOneOffOneOff(amount, currency, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOffAmount.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOffAmount.java new file mode 100644 index 000000000..20aa4f64f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeOneOffOneOffAmount.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormFieldPaymentConfigChargeOneOffOneOffAmount.Deserializer.class) +public final class FormFieldPaymentConfigChargeOneOffOneOffAmount { + private final Object value; + + private final int type; + + private FormFieldPaymentConfigChargeOneOffOneOffAmount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigChargeOneOffOneOffAmount + && equalTo((FormFieldPaymentConfigChargeOneOffOneOffAmount) other); + } + + private boolean equalTo(FormFieldPaymentConfigChargeOneOffOneOffAmount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormFieldPaymentConfigChargeOneOffOneOffAmount of(String value) { + return new FormFieldPaymentConfigChargeOneOffOneOffAmount(value, 0); + } + + public static FormFieldPaymentConfigChargeOneOffOneOffAmount of(double value) { + return new FormFieldPaymentConfigChargeOneOffOneOffAmount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormFieldPaymentConfigChargeOneOffOneOffAmount.class); + } + + @java.lang.Override + public FormFieldPaymentConfigChargeOneOffOneOffAmount deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeSubscription.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeSubscription.java new file mode 100644 index 000000000..db128a0d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigChargeSubscription.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigChargeSubscription.Builder.class) +public final class FormFieldPaymentConfigChargeSubscription { + private final String type; + + private final Map subscription; + + private final Map additionalProperties; + + private FormFieldPaymentConfigChargeSubscription( + String type, Map subscription, Map additionalProperties) { + this.type = type; + this.subscription = subscription; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("subscription") + public Map getSubscription() { + return subscription; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigChargeSubscription + && equalTo((FormFieldPaymentConfigChargeSubscription) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigChargeSubscription other) { + return type.equals(other.type) && subscription.equals(other.subscription); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.subscription); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + + Builder from(FormFieldPaymentConfigChargeSubscription other); + } + + public interface _FinalStage { + FormFieldPaymentConfigChargeSubscription build(); + + _FinalStage subscription(Map subscription); + + _FinalStage putAllSubscription(Map subscription); + + _FinalStage subscription(String key, Object value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private String type; + + private Map subscription = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPaymentConfigChargeSubscription other) { + type(other.getType()); + subscription(other.getSubscription()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage subscription(String key, Object value) { + this.subscription.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSubscription(Map subscription) { + if (subscription != null) { + this.subscription.putAll(subscription); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "subscription", nulls = Nulls.SKIP) + public _FinalStage subscription(Map subscription) { + this.subscription.clear(); + if (subscription != null) { + this.subscription.putAll(subscription); + } + return this; + } + + @java.lang.Override + public FormFieldPaymentConfigChargeSubscription build() { + return new FormFieldPaymentConfigChargeSubscription(type, subscription, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java new file mode 100644 index 000000000..4bfc3ba15 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigCredentials.Builder.class) +public final class FormFieldPaymentConfigCredentials { + private final String publicKey; + + private final String privateKey; + + private final Map additionalProperties; + + private FormFieldPaymentConfigCredentials( + String publicKey, String privateKey, Map additionalProperties) { + this.publicKey = publicKey; + this.privateKey = privateKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("public_key") + public String getPublicKey() { + return publicKey; + } + + @JsonProperty("private_key") + public String getPrivateKey() { + return privateKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigCredentials && equalTo((FormFieldPaymentConfigCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigCredentials other) { + return publicKey.equals(other.publicKey) && privateKey.equals(other.privateKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.publicKey, this.privateKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PublicKeyStage builder() { + return new Builder(); + } + + public interface PublicKeyStage { + PrivateKeyStage publicKey(@NotNull String publicKey); + + Builder from(FormFieldPaymentConfigCredentials other); + } + + public interface PrivateKeyStage { + _FinalStage privateKey(@NotNull String privateKey); + } + + public interface _FinalStage { + FormFieldPaymentConfigCredentials build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PublicKeyStage, PrivateKeyStage, _FinalStage { + private String publicKey; + + private String privateKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldPaymentConfigCredentials other) { + publicKey(other.getPublicKey()); + privateKey(other.getPrivateKey()); + return this; + } + + @java.lang.Override + @JsonSetter("public_key") + public PrivateKeyStage publicKey(@NotNull String publicKey) { + this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("private_key") + public _FinalStage privateKey(@NotNull String privateKey) { + this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); + return this; + } + + @java.lang.Override + public FormFieldPaymentConfigCredentials build() { + return new FormFieldPaymentConfigCredentials(publicKey, privateKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java new file mode 100644 index 000000000..e60ac1a8c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigFieldProperties.Builder.class) +public final class FormFieldPaymentConfigFieldProperties { + private final Optional label; + + private final Optional placeholder; + + private final Map additionalProperties; + + private FormFieldPaymentConfigFieldProperties( + Optional label, Optional placeholder, Map additionalProperties) { + this.label = label; + this.placeholder = placeholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigFieldProperties + && equalTo((FormFieldPaymentConfigFieldProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigFieldProperties other) { + return label.equals(other.label) && placeholder.equals(other.placeholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.label, this.placeholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional label = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldPaymentConfigFieldProperties other) { + label(other.getLabel()); + placeholder(other.getPlaceholder()); + return this; + } + + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public Builder label(Optional label) { + this.label = label; + return this; + } + + public Builder label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + public FormFieldPaymentConfigFieldProperties build() { + return new FormFieldPaymentConfigFieldProperties(label, placeholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java new file mode 100644 index 000000000..cf2cae117 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldPaymentConfigFields.Builder.class) +public final class FormFieldPaymentConfigFields { + private final Optional cardNumber; + + private final Optional expirationDate; + + private final Optional securityCode; + + private final Optional trustmarks; + + private final Map additionalProperties; + + private FormFieldPaymentConfigFields( + Optional cardNumber, + Optional expirationDate, + Optional securityCode, + Optional trustmarks, + Map additionalProperties) { + this.cardNumber = cardNumber; + this.expirationDate = expirationDate; + this.securityCode = securityCode; + this.trustmarks = trustmarks; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("card_number") + public Optional getCardNumber() { + return cardNumber; + } + + @JsonProperty("expiration_date") + public Optional getExpirationDate() { + return expirationDate; + } + + @JsonProperty("security_code") + public Optional getSecurityCode() { + return securityCode; + } + + @JsonProperty("trustmarks") + public Optional getTrustmarks() { + return trustmarks; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldPaymentConfigFields && equalTo((FormFieldPaymentConfigFields) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldPaymentConfigFields other) { + return cardNumber.equals(other.cardNumber) + && expirationDate.equals(other.expirationDate) + && securityCode.equals(other.securityCode) + && trustmarks.equals(other.trustmarks); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cardNumber, this.expirationDate, this.securityCode, this.trustmarks); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cardNumber = Optional.empty(); + + private Optional expirationDate = Optional.empty(); + + private Optional securityCode = Optional.empty(); + + private Optional trustmarks = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldPaymentConfigFields other) { + cardNumber(other.getCardNumber()); + expirationDate(other.getExpirationDate()); + securityCode(other.getSecurityCode()); + trustmarks(other.getTrustmarks()); + return this; + } + + @JsonSetter(value = "card_number", nulls = Nulls.SKIP) + public Builder cardNumber(Optional cardNumber) { + this.cardNumber = cardNumber; + return this; + } + + public Builder cardNumber(FormFieldPaymentConfigFieldProperties cardNumber) { + this.cardNumber = Optional.ofNullable(cardNumber); + return this; + } + + @JsonSetter(value = "expiration_date", nulls = Nulls.SKIP) + public Builder expirationDate(Optional expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + public Builder expirationDate(FormFieldPaymentConfigFieldProperties expirationDate) { + this.expirationDate = Optional.ofNullable(expirationDate); + return this; + } + + @JsonSetter(value = "security_code", nulls = Nulls.SKIP) + public Builder securityCode(Optional securityCode) { + this.securityCode = securityCode; + return this; + } + + public Builder securityCode(FormFieldPaymentConfigFieldProperties securityCode) { + this.securityCode = Optional.ofNullable(securityCode); + return this; + } + + @JsonSetter(value = "trustmarks", nulls = Nulls.SKIP) + public Builder trustmarks(Optional trustmarks) { + this.trustmarks = trustmarks; + return this; + } + + public Builder trustmarks(Boolean trustmarks) { + this.trustmarks = Optional.ofNullable(trustmarks); + return this; + } + + public FormFieldPaymentConfigFields build() { + return new FormFieldPaymentConfigFields( + cardNumber, expirationDate, securityCode, trustmarks, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java new file mode 100644 index 000000000..8c4eb19ad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldSocial.Builder.class) +public final class FormFieldSocial { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldSocial( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldSocial && equalTo((FormFieldSocial) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldSocial other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldSocial other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldSocial build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldSocialConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldSocial other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldSocialConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldSocial build() { + return new FormFieldSocial( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java new file mode 100644 index 000000000..8148ad2df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldSocialConfig.Builder.class) +public final class FormFieldSocialConfig { + private final Map additionalProperties; + + private FormFieldSocialConfig(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldSocialConfig; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldSocialConfig other) { + return this; + } + + public FormFieldSocialConfig build() { + return new FormFieldSocialConfig(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java new file mode 100644 index 000000000..ea547e5ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java @@ -0,0 +1,305 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldTel.Builder.class) +public final class FormFieldTel { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldTel( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldTel && equalTo((FormFieldTel) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldTel other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldTel other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldTel build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldTelConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldTel other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldTelConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldTel build() { + return new FormFieldTel(id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java new file mode 100644 index 000000000..850208153 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldTelConfig.Builder.class) +public final class FormFieldTelConfig { + private final Optional defaultValue; + + private final Optional placeholder; + + private final Optional minLength; + + private final Optional maxLength; + + private final Optional countryPicker; + + private final Optional strings; + + private final Map additionalProperties; + + private FormFieldTelConfig( + Optional defaultValue, + Optional placeholder, + Optional minLength, + Optional maxLength, + Optional countryPicker, + Optional strings, + Map additionalProperties) { + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.minLength = minLength; + this.maxLength = maxLength; + this.countryPicker = countryPicker; + this.strings = strings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + @JsonProperty("max_length") + public Optional getMaxLength() { + return maxLength; + } + + @JsonProperty("country_picker") + public Optional getCountryPicker() { + return countryPicker; + } + + @JsonProperty("strings") + public Optional getStrings() { + return strings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldTelConfig && equalTo((FormFieldTelConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldTelConfig other) { + return defaultValue.equals(other.defaultValue) + && placeholder.equals(other.placeholder) + && minLength.equals(other.minLength) + && maxLength.equals(other.maxLength) + && countryPicker.equals(other.countryPicker) + && strings.equals(other.strings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.defaultValue, this.placeholder, this.minLength, this.maxLength, this.countryPicker, this.strings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + private Optional minLength = Optional.empty(); + + private Optional maxLength = Optional.empty(); + + private Optional countryPicker = Optional.empty(); + + private Optional strings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldTelConfig other) { + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + minLength(other.getMinLength()); + maxLength(other.getMaxLength()); + countryPicker(other.getCountryPicker()); + strings(other.getStrings()); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public Builder minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + public Builder minLength(Integer minLength) { + this.minLength = Optional.ofNullable(minLength); + return this; + } + + @JsonSetter(value = "max_length", nulls = Nulls.SKIP) + public Builder maxLength(Optional maxLength) { + this.maxLength = maxLength; + return this; + } + + public Builder maxLength(Integer maxLength) { + this.maxLength = Optional.ofNullable(maxLength); + return this; + } + + @JsonSetter(value = "country_picker", nulls = Nulls.SKIP) + public Builder countryPicker(Optional countryPicker) { + this.countryPicker = countryPicker; + return this; + } + + public Builder countryPicker(Boolean countryPicker) { + this.countryPicker = Optional.ofNullable(countryPicker); + return this; + } + + @JsonSetter(value = "strings", nulls = Nulls.SKIP) + public Builder strings(Optional strings) { + this.strings = strings; + return this; + } + + public Builder strings(FormFieldTelConfigStrings strings) { + this.strings = Optional.ofNullable(strings); + return this; + } + + public FormFieldTelConfig build() { + return new FormFieldTelConfig( + defaultValue, placeholder, minLength, maxLength, countryPicker, strings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java new file mode 100644 index 000000000..b142adc2f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldTelConfigStrings.Builder.class) +public final class FormFieldTelConfigStrings { + private final Optional filterPlaceholder; + + private final Map additionalProperties; + + private FormFieldTelConfigStrings(Optional filterPlaceholder, Map additionalProperties) { + this.filterPlaceholder = filterPlaceholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("filter_placeholder") + public Optional getFilterPlaceholder() { + return filterPlaceholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldTelConfigStrings && equalTo((FormFieldTelConfigStrings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldTelConfigStrings other) { + return filterPlaceholder.equals(other.filterPlaceholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.filterPlaceholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional filterPlaceholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldTelConfigStrings other) { + filterPlaceholder(other.getFilterPlaceholder()); + return this; + } + + @JsonSetter(value = "filter_placeholder", nulls = Nulls.SKIP) + public Builder filterPlaceholder(Optional filterPlaceholder) { + this.filterPlaceholder = filterPlaceholder; + return this; + } + + public Builder filterPlaceholder(String filterPlaceholder) { + this.filterPlaceholder = Optional.ofNullable(filterPlaceholder); + return this; + } + + public FormFieldTelConfigStrings build() { + return new FormFieldTelConfigStrings(filterPlaceholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java new file mode 100644 index 000000000..a8e8d8b42 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldText.Builder.class) +public final class FormFieldText { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldText( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldText && equalTo((FormFieldText) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldText other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldText other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldText build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldTextConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldText other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldTextConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldText build() { + return new FormFieldText( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java new file mode 100644 index 000000000..18acecdba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldTextConfig.Builder.class) +public final class FormFieldTextConfig { + private final Optional multiline; + + private final Optional defaultValue; + + private final Optional placeholder; + + private final Optional minLength; + + private final Optional maxLength; + + private final Map additionalProperties; + + private FormFieldTextConfig( + Optional multiline, + Optional defaultValue, + Optional placeholder, + Optional minLength, + Optional maxLength, + Map additionalProperties) { + this.multiline = multiline; + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.minLength = minLength; + this.maxLength = maxLength; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("multiline") + public Optional getMultiline() { + return multiline; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + @JsonProperty("max_length") + public Optional getMaxLength() { + return maxLength; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldTextConfig && equalTo((FormFieldTextConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldTextConfig other) { + return multiline.equals(other.multiline) + && defaultValue.equals(other.defaultValue) + && placeholder.equals(other.placeholder) + && minLength.equals(other.minLength) + && maxLength.equals(other.maxLength); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.multiline, this.defaultValue, this.placeholder, this.minLength, this.maxLength); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional multiline = Optional.empty(); + + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + private Optional minLength = Optional.empty(); + + private Optional maxLength = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldTextConfig other) { + multiline(other.getMultiline()); + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + minLength(other.getMinLength()); + maxLength(other.getMaxLength()); + return this; + } + + @JsonSetter(value = "multiline", nulls = Nulls.SKIP) + public Builder multiline(Optional multiline) { + this.multiline = multiline; + return this; + } + + public Builder multiline(Boolean multiline) { + this.multiline = Optional.ofNullable(multiline); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public Builder minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + public Builder minLength(Integer minLength) { + this.minLength = Optional.ofNullable(minLength); + return this; + } + + @JsonSetter(value = "max_length", nulls = Nulls.SKIP) + public Builder maxLength(Optional maxLength) { + this.maxLength = maxLength; + return this; + } + + public Builder maxLength(Integer maxLength) { + this.maxLength = Optional.ofNullable(maxLength); + return this; + } + + public FormFieldTextConfig build() { + return new FormFieldTextConfig( + multiline, defaultValue, placeholder, minLength, maxLength, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java new file mode 100644 index 000000000..3b6775c9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java @@ -0,0 +1,305 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldUrl.Builder.class) +public final class FormFieldUrl { + private final String id; + + private final String category; + + private final String type; + + private final Optional config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormFieldUrl( + String id, + String category, + String type, + Optional config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldUrl && equalTo((FormFieldUrl) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldUrl other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormFieldUrl other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormFieldUrl build(); + + _FinalStage config(Optional config); + + _FinalStage config(FormFieldUrlConfig config); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional config = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFieldUrl other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public _FinalStage config(FormFieldUrlConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public FormFieldUrl build() { + return new FormFieldUrl(id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java new file mode 100644 index 000000000..3ade6fdbd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFieldUrlConfig.Builder.class) +public final class FormFieldUrlConfig { + private final Optional defaultValue; + + private final Optional placeholder; + + private final Map additionalProperties; + + private FormFieldUrlConfig( + Optional defaultValue, Optional placeholder, Map additionalProperties) { + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFieldUrlConfig && equalTo((FormFieldUrlConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFieldUrlConfig other) { + return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.defaultValue, this.placeholder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormFieldUrlConfig other) { + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + return this; + } + + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + public FormFieldUrlConfig build() { + return new FormFieldUrlConfig(defaultValue, placeholder, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlow.java b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java new file mode 100644 index 000000000..b2cf724a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java @@ -0,0 +1,214 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFlow.Builder.class) +public final class FormFlow { + private final String id; + + private final String type; + + private final Optional coordinates; + + private final Optional alias; + + private final FormFlowConfig config; + + private final Map additionalProperties; + + private FormFlow( + String id, + String type, + Optional coordinates, + Optional alias, + FormFlowConfig config, + Map additionalProperties) { + this.id = id; + this.type = type; + this.coordinates = coordinates; + this.alias = alias; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("coordinates") + public Optional getCoordinates() { + return coordinates; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("config") + public FormFlowConfig getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFlow && equalTo((FormFlow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFlow other) { + return id.equals(other.id) + && type.equals(other.type) + && coordinates.equals(other.coordinates) + && alias.equals(other.alias) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TypeStage id(@NotNull String id); + + Builder from(FormFlow other); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormFlowConfig config); + } + + public interface _FinalStage { + FormFlow build(); + + _FinalStage coordinates(Optional coordinates); + + _FinalStage coordinates(FormNodeCoordinates coordinates); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String type; + + private FormFlowConfig config; + + private Optional alias = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFlow other) { + id(other.getId()); + type(other.getType()); + coordinates(other.getCoordinates()); + alias(other.getAlias()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TypeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormFlowConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public _FinalStage coordinates(FormNodeCoordinates coordinates) { + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) + public _FinalStage coordinates(Optional coordinates) { + this.coordinates = coordinates; + return this; + } + + @java.lang.Override + public FormFlow build() { + return new FormFlow(id, type, coordinates, alias, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java new file mode 100644 index 000000000..27e810319 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormFlowConfig.Builder.class) +public final class FormFlowConfig { + private final String flowId; + + private final Optional nextNode; + + private final Map additionalProperties; + + private FormFlowConfig( + String flowId, Optional nextNode, Map additionalProperties) { + this.flowId = flowId; + this.nextNode = nextNode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("flow_id") + public String getFlowId() { + return flowId; + } + + @JsonProperty("next_node") + public Optional getNextNode() { + return nextNode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormFlowConfig && equalTo((FormFlowConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormFlowConfig other) { + return flowId.equals(other.flowId) && nextNode.equals(other.nextNode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.flowId, this.nextNode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FlowIdStage builder() { + return new Builder(); + } + + public interface FlowIdStage { + _FinalStage flowId(@NotNull String flowId); + + Builder from(FormFlowConfig other); + } + + public interface _FinalStage { + FormFlowConfig build(); + + _FinalStage nextNode(Optional nextNode); + + _FinalStage nextNode(FormNodePointer nextNode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FlowIdStage, _FinalStage { + private String flowId; + + private Optional nextNode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormFlowConfig other) { + flowId(other.getFlowId()); + nextNode(other.getNextNode()); + return this; + } + + @java.lang.Override + @JsonSetter("flow_id") + public _FinalStage flowId(@NotNull String flowId) { + this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage nextNode(FormNodePointer nextNode) { + this.nextNode = Optional.ofNullable(nextNode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_node", nulls = Nulls.SKIP) + public _FinalStage nextNode(Optional nextNode) { + this.nextNode = nextNode; + return this; + } + + @java.lang.Override + public FormFlowConfig build() { + return new FormFlowConfig(flowId, nextNode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java new file mode 100644 index 000000000..04a0f3ec3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormHiddenField.Builder.class) +public final class FormHiddenField { + private final String key; + + private final Optional value; + + private final Map additionalProperties; + + private FormHiddenField(String key, Optional value, Map additionalProperties) { + this.key = key; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormHiddenField && equalTo((FormHiddenField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormHiddenField other) { + return key.equals(other.key) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.key, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KeyStage builder() { + return new Builder(); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + + Builder from(FormHiddenField other); + } + + public interface _FinalStage { + FormHiddenField build(); + + _FinalStage value(Optional value); + + _FinalStage value(String value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KeyStage, _FinalStage { + private String key; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormHiddenField other) { + key(other.getKey()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = Objects.requireNonNull(key, "key must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public FormHiddenField build() { + return new FormHiddenField(key, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java new file mode 100644 index 000000000..747cf6895 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormLanguages.Builder.class) +public final class FormLanguages { + private final Optional primary; + + private final Optional default_; + + private final Map additionalProperties; + + private FormLanguages( + Optional primary, Optional default_, Map additionalProperties) { + this.primary = primary; + this.default_ = default_; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("primary") + public Optional getPrimary() { + return primary; + } + + @JsonProperty("default") + public Optional getDefault() { + return default_; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormLanguages && equalTo((FormLanguages) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormLanguages other) { + return primary.equals(other.primary) && default_.equals(other.default_); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.primary, this.default_); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional primary = Optional.empty(); + + private Optional default_ = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormLanguages other) { + primary(other.getPrimary()); + default_(other.getDefault()); + return this; + } + + @JsonSetter(value = "primary", nulls = Nulls.SKIP) + public Builder primary(Optional primary) { + this.primary = primary; + return this; + } + + public Builder primary(String primary) { + this.primary = Optional.ofNullable(primary); + return this; + } + + @JsonSetter(value = "default", nulls = Nulls.SKIP) + public Builder default_(Optional default_) { + this.default_ = default_; + return this; + } + + public Builder default_(String default_) { + this.default_ = Optional.ofNullable(default_); + return this; + } + + public FormLanguages build() { + return new FormLanguages(primary, default_, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormMessages.java b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java new file mode 100644 index 000000000..712300574 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormMessages.Builder.class) +public final class FormMessages { + private final Optional> errors; + + private final Optional> custom; + + private final Map additionalProperties; + + private FormMessages( + Optional> errors, + Optional> custom, + Map additionalProperties) { + this.errors = errors; + this.custom = custom; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("custom") + public Optional> getCustom() { + return custom; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormMessages && equalTo((FormMessages) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormMessages other) { + return errors.equals(other.errors) && custom.equals(other.custom); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.errors, this.custom); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> errors = Optional.empty(); + + private Optional> custom = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormMessages other) { + errors(other.getErrors()); + custom(other.getCustom()); + return this; + } + + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(Map errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "custom", nulls = Nulls.SKIP) + public Builder custom(Optional> custom) { + this.custom = custom; + return this; + } + + public Builder custom(Map custom) { + this.custom = Optional.ofNullable(custom); + return this; + } + + public FormMessages build() { + return new FormMessages(errors, custom, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNode.java b/src/main/java/com/auth0/client/mgmt/types/FormNode.java new file mode 100644 index 000000000..7e0be4d13 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormNode.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormNode.Deserializer.class) +public final class FormNode { + private final Object value; + + private final int type; + + private FormNode(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormFlow) this.value); + } else if (this.type == 1) { + return visitor.visit((FormRouter) this.value); + } else if (this.type == 2) { + return visitor.visit((FormStep) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormNode && equalTo((FormNode) other); + } + + private boolean equalTo(FormNode other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormNode of(FormFlow value) { + return new FormNode(value, 0); + } + + public static FormNode of(FormRouter value) { + return new FormNode(value, 1); + } + + public static FormNode of(FormStep value) { + return new FormNode(value, 2); + } + + public interface Visitor { + T visit(FormFlow value); + + T visit(FormRouter value); + + T visit(FormStep value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormNode.class); + } + + @java.lang.Override + public FormNode deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormFlow.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormRouter.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormStep.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java new file mode 100644 index 000000000..3dd9fcf17 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormNodeCoordinates.Builder.class) +public final class FormNodeCoordinates { + private final int x; + + private final int y; + + private final Map additionalProperties; + + private FormNodeCoordinates(int x, int y, Map additionalProperties) { + this.x = x; + this.y = y; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("x") + public int getX() { + return x; + } + + @JsonProperty("y") + public int getY() { + return y; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormNodeCoordinates && equalTo((FormNodeCoordinates) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormNodeCoordinates other) { + return x == other.x && y == other.y; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.x, this.y); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static XStage builder() { + return new Builder(); + } + + public interface XStage { + YStage x(int x); + + Builder from(FormNodeCoordinates other); + } + + public interface YStage { + _FinalStage y(int y); + } + + public interface _FinalStage { + FormNodeCoordinates build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements XStage, YStage, _FinalStage { + private int x; + + private int y; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormNodeCoordinates other) { + x(other.getX()); + y(other.getY()); + return this; + } + + @java.lang.Override + @JsonSetter("x") + public YStage x(int x) { + this.x = x; + return this; + } + + @java.lang.Override + @JsonSetter("y") + public _FinalStage y(int y) { + this.y = y; + return this; + } + + @java.lang.Override + public FormNodeCoordinates build() { + return new FormNodeCoordinates(x, y, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java new file mode 100644 index 000000000..0486c3a3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormNodePointer.Deserializer.class) +public final class FormNodePointer { + private final Object value; + + private final int type; + + private FormNodePointer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit2((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormNodePointer && equalTo((FormNodePointer) other); + } + + private boolean equalTo(FormNodePointer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormNodePointer of(String value) { + return new FormNodePointer(value, 0); + } + + public static FormNodePointer of2(String value) { + return new FormNodePointer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit2(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormNodePointer.class); + } + + @java.lang.Override + public FormNodePointer deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of2(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouter.java b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java new file mode 100644 index 000000000..378da08d7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormRouter.Builder.class) +public final class FormRouter { + private final String id; + + private final String type; + + private final Optional coordinates; + + private final Optional alias; + + private final Optional config; + + private final Map additionalProperties; + + private FormRouter( + String id, + String type, + Optional coordinates, + Optional alias, + Optional config, + Map additionalProperties) { + this.id = id; + this.type = type; + this.coordinates = coordinates; + this.alias = alias; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("coordinates") + public Optional getCoordinates() { + return coordinates; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormRouter && equalTo((FormRouter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormRouter other) { + return id.equals(other.id) + && type.equals(other.type) + && coordinates.equals(other.coordinates) + && alias.equals(other.alias) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TypeStage id(@NotNull String id); + + Builder from(FormRouter other); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormRouter build(); + + _FinalStage coordinates(Optional coordinates); + + _FinalStage coordinates(FormNodeCoordinates coordinates); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage config(Optional config); + + _FinalStage config(FormRouterConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, TypeStage, _FinalStage { + private String id; + + private String type; + + private Optional config = Optional.empty(); + + private Optional alias = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormRouter other) { + id(other.getId()); + type(other.getType()); + coordinates(other.getCoordinates()); + alias(other.getAlias()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TypeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormRouterConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public _FinalStage coordinates(FormNodeCoordinates coordinates) { + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) + public _FinalStage coordinates(Optional coordinates) { + this.coordinates = coordinates; + return this; + } + + @java.lang.Override + public FormRouter build() { + return new FormRouter(id, type, coordinates, alias, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java new file mode 100644 index 000000000..a6c450ea7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormRouterConfig.Builder.class) +public final class FormRouterConfig { + private final Optional> rules; + + private final Optional fallback; + + private final Map additionalProperties; + + private FormRouterConfig( + Optional> rules, + Optional fallback, + Map additionalProperties) { + this.rules = rules; + this.fallback = fallback; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rules") + public Optional> getRules() { + return rules; + } + + @JsonProperty("fallback") + public Optional getFallback() { + return fallback; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormRouterConfig && equalTo((FormRouterConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormRouterConfig other) { + return rules.equals(other.rules) && fallback.equals(other.fallback); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.rules, this.fallback); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> rules = Optional.empty(); + + private Optional fallback = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormRouterConfig other) { + rules(other.getRules()); + fallback(other.getFallback()); + return this; + } + + @JsonSetter(value = "rules", nulls = Nulls.SKIP) + public Builder rules(Optional> rules) { + this.rules = rules; + return this; + } + + public Builder rules(List rules) { + this.rules = Optional.ofNullable(rules); + return this; + } + + @JsonSetter(value = "fallback", nulls = Nulls.SKIP) + public Builder fallback(Optional fallback) { + this.fallback = fallback; + return this; + } + + public Builder fallback(FormNodePointer fallback) { + this.fallback = Optional.ofNullable(fallback); + return this; + } + + public FormRouterConfig build() { + return new FormRouterConfig(rules, fallback, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java new file mode 100644 index 000000000..ea3f83563 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormRouterRule.Builder.class) +public final class FormRouterRule { + private final String id; + + private final Optional alias; + + private final Optional nextNode; + + private final Map additionalProperties; + + private FormRouterRule( + String id, + Optional alias, + Optional nextNode, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.nextNode = nextNode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("next_node") + public Optional getNextNode() { + return nextNode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormRouterRule && equalTo((FormRouterRule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormRouterRule other) { + return id.equals(other.id) && alias.equals(other.alias) && nextNode.equals(other.nextNode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.nextNode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(FormRouterRule other); + } + + public interface _FinalStage { + FormRouterRule build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage nextNode(Optional nextNode); + + _FinalStage nextNode(FormNodePointer nextNode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional nextNode = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormRouterRule other) { + id(other.getId()); + alias(other.getAlias()); + nextNode(other.getNextNode()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage nextNode(FormNodePointer nextNode) { + this.nextNode = Optional.ofNullable(nextNode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_node", nulls = Nulls.SKIP) + public _FinalStage nextNode(Optional nextNode) { + this.nextNode = nextNode; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public FormRouterRule build() { + return new FormRouterRule(id, alias, nextNode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java new file mode 100644 index 000000000..5777adaad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormStartNode.Builder.class) +public final class FormStartNode { + private final Optional> hiddenFields; + + private final Optional nextNode; + + private final Optional coordinates; + + private final Map additionalProperties; + + private FormStartNode( + Optional> hiddenFields, + Optional nextNode, + Optional coordinates, + Map additionalProperties) { + this.hiddenFields = hiddenFields; + this.nextNode = nextNode; + this.coordinates = coordinates; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("hidden_fields") + public Optional> getHiddenFields() { + return hiddenFields; + } + + @JsonProperty("next_node") + public Optional getNextNode() { + return nextNode; + } + + @JsonProperty("coordinates") + public Optional getCoordinates() { + return coordinates; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormStartNode && equalTo((FormStartNode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormStartNode other) { + return hiddenFields.equals(other.hiddenFields) + && nextNode.equals(other.nextNode) + && coordinates.equals(other.coordinates); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hiddenFields, this.nextNode, this.coordinates); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hiddenFields = Optional.empty(); + + private Optional nextNode = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormStartNode other) { + hiddenFields(other.getHiddenFields()); + nextNode(other.getNextNode()); + coordinates(other.getCoordinates()); + return this; + } + + @JsonSetter(value = "hidden_fields", nulls = Nulls.SKIP) + public Builder hiddenFields(Optional> hiddenFields) { + this.hiddenFields = hiddenFields; + return this; + } + + public Builder hiddenFields(List hiddenFields) { + this.hiddenFields = Optional.ofNullable(hiddenFields); + return this; + } + + @JsonSetter(value = "next_node", nulls = Nulls.SKIP) + public Builder nextNode(Optional nextNode) { + this.nextNode = nextNode; + return this; + } + + public Builder nextNode(FormNodePointer nextNode) { + this.nextNode = Optional.ofNullable(nextNode); + return this; + } + + @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) + public Builder coordinates(Optional coordinates) { + this.coordinates = coordinates; + return this; + } + + public Builder coordinates(FormNodeCoordinates coordinates) { + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + public FormStartNode build() { + return new FormStartNode(hiddenFields, nextNode, coordinates, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStep.java b/src/main/java/com/auth0/client/mgmt/types/FormStep.java new file mode 100644 index 000000000..d8adc9b71 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormStep.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormStep.Builder.class) +public final class FormStep { + private final String id; + + private final String type; + + private final Optional coordinates; + + private final Optional alias; + + private final Optional config; + + private final Map additionalProperties; + + private FormStep( + String id, + String type, + Optional coordinates, + Optional alias, + Optional config, + Map additionalProperties) { + this.id = id; + this.type = type; + this.coordinates = coordinates; + this.alias = alias; + this.config = config; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("coordinates") + public Optional getCoordinates() { + return coordinates; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("config") + public Optional getConfig() { + return config; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormStep && equalTo((FormStep) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormStep other) { + return id.equals(other.id) + && type.equals(other.type) + && coordinates.equals(other.coordinates) + && alias.equals(other.alias) + && config.equals(other.config); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TypeStage id(@NotNull String id); + + Builder from(FormStep other); + } + + public interface TypeStage { + _FinalStage type(@NotNull String type); + } + + public interface _FinalStage { + FormStep build(); + + _FinalStage coordinates(Optional coordinates); + + _FinalStage coordinates(FormNodeCoordinates coordinates); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage config(Optional config); + + _FinalStage config(FormStepConfig config); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, TypeStage, _FinalStage { + private String id; + + private String type; + + private Optional config = Optional.empty(); + + private Optional alias = Optional.empty(); + + private Optional coordinates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormStep other) { + id(other.getId()); + type(other.getType()); + coordinates(other.getCoordinates()); + alias(other.getAlias()); + config(other.getConfig()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TypeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage config(FormStepConfig config) { + this.config = Optional.ofNullable(config); + return this; + } + + @java.lang.Override + @JsonSetter(value = "config", nulls = Nulls.SKIP) + public _FinalStage config(Optional config) { + this.config = config; + return this; + } + + @java.lang.Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @java.lang.Override + public _FinalStage coordinates(FormNodeCoordinates coordinates) { + this.coordinates = Optional.ofNullable(coordinates); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) + public _FinalStage coordinates(Optional coordinates) { + this.coordinates = coordinates; + return this; + } + + @java.lang.Override + public FormStep build() { + return new FormStep(id, type, coordinates, alias, config, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java new file mode 100644 index 000000000..7b61890cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormStepConfig.Builder.class) +public final class FormStepConfig { + private final Optional> components; + + private final Optional nextNode; + + private final Map additionalProperties; + + private FormStepConfig( + Optional> components, + Optional nextNode, + Map additionalProperties) { + this.components = components; + this.nextNode = nextNode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("components") + public Optional> getComponents() { + return components; + } + + @JsonProperty("next_node") + public Optional getNextNode() { + return nextNode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormStepConfig && equalTo((FormStepConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormStepConfig other) { + return components.equals(other.components) && nextNode.equals(other.nextNode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.components, this.nextNode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> components = Optional.empty(); + + private Optional nextNode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormStepConfig other) { + components(other.getComponents()); + nextNode(other.getNextNode()); + return this; + } + + @JsonSetter(value = "components", nulls = Nulls.SKIP) + public Builder components(Optional> components) { + this.components = components; + return this; + } + + public Builder components(List components) { + this.components = Optional.ofNullable(components); + return this; + } + + @JsonSetter(value = "next_node", nulls = Nulls.SKIP) + public Builder nextNode(Optional nextNode) { + this.nextNode = nextNode; + return this; + } + + public Builder nextNode(FormNodePointer nextNode) { + this.nextNode = Optional.ofNullable(nextNode); + return this; + } + + public FormStepConfig build() { + return new FormStepConfig(components, nextNode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java new file mode 100644 index 000000000..f90d8dbbd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormStyle.Builder.class) +public final class FormStyle { + private final Optional css; + + private final Map additionalProperties; + + private FormStyle(Optional css, Map additionalProperties) { + this.css = css; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("css") + public Optional getCss() { + return css; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormStyle && equalTo((FormStyle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormStyle other) { + return css.equals(other.css); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.css); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional css = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FormStyle other) { + css(other.getCss()); + return this; + } + + @JsonSetter(value = "css", nulls = Nulls.SKIP) + public Builder css(Optional css) { + this.css = css; + return this; + } + + public Builder css(String css) { + this.css = Optional.ofNullable(css); + return this; + } + + public FormStyle build() { + return new FormStyle(css, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormSummary.java b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java new file mode 100644 index 000000000..e7dca63d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormSummary.Builder.class) +public final class FormSummary { + private final String id; + + private final String name; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional embeddedAt; + + private final Optional submittedAt; + + private final Map additionalProperties; + + private FormSummary( + String id, + String name, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional embeddedAt, + Optional submittedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.embeddedAt = embeddedAt; + this.submittedAt = submittedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("embedded_at") + public Optional getEmbeddedAt() { + return embeddedAt; + } + + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormSummary && equalTo((FormSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormSummary other) { + return id.equals(other.id) + && name.equals(other.name) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && embeddedAt.equals(other.embeddedAt) + && submittedAt.equals(other.submittedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.embeddedAt, this.submittedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(FormSummary other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + FormSummary build(); + + _FinalStage embeddedAt(Optional embeddedAt); + + _FinalStage embeddedAt(String embeddedAt); + + _FinalStage submittedAt(Optional submittedAt); + + _FinalStage submittedAt(String submittedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional submittedAt = Optional.empty(); + + private Optional embeddedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormSummary other) { + id(other.getId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + embeddedAt(other.getEmbeddedAt()); + submittedAt(other.getSubmittedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage submittedAt(String submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) + public _FinalStage submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + @java.lang.Override + public _FinalStage embeddedAt(String embeddedAt) { + this.embeddedAt = Optional.ofNullable(embeddedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) + public _FinalStage embeddedAt(Optional embeddedAt) { + this.embeddedAt = embeddedAt; + return this; + } + + @java.lang.Override + public FormSummary build() { + return new FormSummary(id, name, createdAt, updatedAt, embeddedAt, submittedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidget.java b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java new file mode 100644 index 000000000..7fc550a16 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FormWidget.Deserializer.class) +public final class FormWidget { + private final Object value; + + private final int type; + + private FormWidget(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FormWidgetAuth0VerifiableCredentials) this.value); + } else if (this.type == 1) { + return visitor.visit((FormWidgetGMapsAddress) this.value); + } else if (this.type == 2) { + return visitor.visit((FormWidgetRecaptcha) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidget && equalTo((FormWidget) other); + } + + private boolean equalTo(FormWidget other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static FormWidget of(FormWidgetAuth0VerifiableCredentials value) { + return new FormWidget(value, 0); + } + + public static FormWidget of(FormWidgetGMapsAddress value) { + return new FormWidget(value, 1); + } + + public static FormWidget of(FormWidgetRecaptcha value) { + return new FormWidget(value, 2); + } + + public interface Visitor { + T visit(FormWidgetAuth0VerifiableCredentials value); + + T visit(FormWidgetGMapsAddress value); + + T visit(FormWidgetRecaptcha value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FormWidget.class); + } + + @java.lang.Override + public FormWidget deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormWidgetAuth0VerifiableCredentials.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormWidgetGMapsAddress.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FormWidgetRecaptcha.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java new file mode 100644 index 000000000..eea18bb7a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java @@ -0,0 +1,301 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetAuth0VerifiableCredentials.Builder.class) +public final class FormWidgetAuth0VerifiableCredentials { + private final String id; + + private final String category; + + private final String type; + + private final FormWidgetAuth0VerifiableCredentialsConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormWidgetAuth0VerifiableCredentials( + String id, + String category, + String type, + FormWidgetAuth0VerifiableCredentialsConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormWidgetAuth0VerifiableCredentialsConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetAuth0VerifiableCredentials + && equalTo((FormWidgetAuth0VerifiableCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetAuth0VerifiableCredentials other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormWidgetAuth0VerifiableCredentials other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormWidgetAuth0VerifiableCredentialsConfig config); + } + + public interface _FinalStage { + FormWidgetAuth0VerifiableCredentials build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormWidgetAuth0VerifiableCredentialsConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetAuth0VerifiableCredentials other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormWidgetAuth0VerifiableCredentialsConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormWidgetAuth0VerifiableCredentials build() { + return new FormWidgetAuth0VerifiableCredentials( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java new file mode 100644 index 000000000..89fe92e76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetAuth0VerifiableCredentialsConfig.Builder.class) +public final class FormWidgetAuth0VerifiableCredentialsConfig { + private final String url; + + private final Optional size; + + private final String alternateText; + + private final String accessToken; + + private final String verificationId; + + private final Optional maxWait; + + private final Map additionalProperties; + + private FormWidgetAuth0VerifiableCredentialsConfig( + String url, + Optional size, + String alternateText, + String accessToken, + String verificationId, + Optional maxWait, + Map additionalProperties) { + this.url = url; + this.size = size; + this.alternateText = alternateText; + this.accessToken = accessToken; + this.verificationId = verificationId; + this.maxWait = maxWait; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("size") + public Optional getSize() { + return size; + } + + @JsonProperty("alternate_text") + public String getAlternateText() { + return alternateText; + } + + @JsonProperty("access_token") + public String getAccessToken() { + return accessToken; + } + + @JsonProperty("verification_id") + public String getVerificationId() { + return verificationId; + } + + @JsonProperty("max_wait") + public Optional getMaxWait() { + return maxWait; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetAuth0VerifiableCredentialsConfig + && equalTo((FormWidgetAuth0VerifiableCredentialsConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetAuth0VerifiableCredentialsConfig other) { + return url.equals(other.url) + && size.equals(other.size) + && alternateText.equals(other.alternateText) + && accessToken.equals(other.accessToken) + && verificationId.equals(other.verificationId) + && maxWait.equals(other.maxWait); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.url, this.size, this.alternateText, this.accessToken, this.verificationId, this.maxWait); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + AlternateTextStage url(@NotNull String url); + + Builder from(FormWidgetAuth0VerifiableCredentialsConfig other); + } + + public interface AlternateTextStage { + AccessTokenStage alternateText(@NotNull String alternateText); + } + + public interface AccessTokenStage { + VerificationIdStage accessToken(@NotNull String accessToken); + } + + public interface VerificationIdStage { + _FinalStage verificationId(@NotNull String verificationId); + } + + public interface _FinalStage { + FormWidgetAuth0VerifiableCredentialsConfig build(); + + _FinalStage size(Optional size); + + _FinalStage size(Double size); + + _FinalStage maxWait(Optional maxWait); + + _FinalStage maxWait(Double maxWait); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements UrlStage, AlternateTextStage, AccessTokenStage, VerificationIdStage, _FinalStage { + private String url; + + private String alternateText; + + private String accessToken; + + private String verificationId; + + private Optional maxWait = Optional.empty(); + + private Optional size = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetAuth0VerifiableCredentialsConfig other) { + url(other.getUrl()); + size(other.getSize()); + alternateText(other.getAlternateText()); + accessToken(other.getAccessToken()); + verificationId(other.getVerificationId()); + maxWait(other.getMaxWait()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public AlternateTextStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("alternate_text") + public AccessTokenStage alternateText(@NotNull String alternateText) { + this.alternateText = Objects.requireNonNull(alternateText, "alternateText must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("access_token") + public VerificationIdStage accessToken(@NotNull String accessToken) { + this.accessToken = Objects.requireNonNull(accessToken, "accessToken must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("verification_id") + public _FinalStage verificationId(@NotNull String verificationId) { + this.verificationId = Objects.requireNonNull(verificationId, "verificationId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage maxWait(Double maxWait) { + this.maxWait = Optional.ofNullable(maxWait); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_wait", nulls = Nulls.SKIP) + public _FinalStage maxWait(Optional maxWait) { + this.maxWait = maxWait; + return this; + } + + @java.lang.Override + public _FinalStage size(Double size) { + this.size = Optional.ofNullable(size); + return this; + } + + @java.lang.Override + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public _FinalStage size(Optional size) { + this.size = size; + return this; + } + + @java.lang.Override + public FormWidgetAuth0VerifiableCredentialsConfig build() { + return new FormWidgetAuth0VerifiableCredentialsConfig( + url, size, alternateText, accessToken, verificationId, maxWait, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java new file mode 100644 index 000000000..f532695ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetGMapsAddress.Builder.class) +public final class FormWidgetGMapsAddress { + private final String id; + + private final String category; + + private final String type; + + private final FormWidgetGMapsAddressConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormWidgetGMapsAddress( + String id, + String category, + String type, + FormWidgetGMapsAddressConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormWidgetGMapsAddressConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetGMapsAddress && equalTo((FormWidgetGMapsAddress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetGMapsAddress other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormWidgetGMapsAddress other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormWidgetGMapsAddressConfig config); + } + + public interface _FinalStage { + FormWidgetGMapsAddress build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormWidgetGMapsAddressConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetGMapsAddress other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormWidgetGMapsAddressConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormWidgetGMapsAddress build() { + return new FormWidgetGMapsAddress( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java new file mode 100644 index 000000000..380619e1e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetGMapsAddressConfig.Builder.class) +public final class FormWidgetGMapsAddressConfig { + private final String apiKey; + + private final Map additionalProperties; + + private FormWidgetGMapsAddressConfig(String apiKey, Map additionalProperties) { + this.apiKey = apiKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetGMapsAddressConfig && equalTo((FormWidgetGMapsAddressConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetGMapsAddressConfig other) { + return apiKey.equals(other.apiKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apiKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ApiKeyStage builder() { + return new Builder(); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + + Builder from(FormWidgetGMapsAddressConfig other); + } + + public interface _FinalStage { + FormWidgetGMapsAddressConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ApiKeyStage, _FinalStage { + private String apiKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetGMapsAddressConfig other) { + apiKey(other.getApiKey()); + return this; + } + + @java.lang.Override + @JsonSetter("api_key") + public _FinalStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @java.lang.Override + public FormWidgetGMapsAddressConfig build() { + return new FormWidgetGMapsAddressConfig(apiKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java new file mode 100644 index 000000000..ad4e811a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetRecaptcha.Builder.class) +public final class FormWidgetRecaptcha { + private final String id; + + private final String category; + + private final String type; + + private final FormWidgetRecaptchaConfig config; + + private final Optional label; + + private final Optional hint; + + private final Optional required; + + private final Optional sensitive; + + private final Map additionalProperties; + + private FormWidgetRecaptcha( + String id, + String category, + String type, + FormWidgetRecaptchaConfig config, + Optional label, + Optional hint, + Optional required, + Optional sensitive, + Map additionalProperties) { + this.id = id; + this.category = category; + this.type = type; + this.config = config; + this.label = label; + this.hint = hint; + this.required = required; + this.sensitive = sensitive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public String getCategory() { + return category; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("config") + public FormWidgetRecaptchaConfig getConfig() { + return config; + } + + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @JsonProperty("hint") + public Optional getHint() { + return hint; + } + + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("sensitive") + public Optional getSensitive() { + return sensitive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetRecaptcha && equalTo((FormWidgetRecaptcha) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetRecaptcha other) { + return id.equals(other.id) + && category.equals(other.category) + && type.equals(other.type) + && config.equals(other.config) + && label.equals(other.label) + && hint.equals(other.hint) + && required.equals(other.required) + && sensitive.equals(other.sensitive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CategoryStage id(@NotNull String id); + + Builder from(FormWidgetRecaptcha other); + } + + public interface CategoryStage { + TypeStage category(@NotNull String category); + } + + public interface TypeStage { + ConfigStage type(@NotNull String type); + } + + public interface ConfigStage { + _FinalStage config(@NotNull FormWidgetRecaptchaConfig config); + } + + public interface _FinalStage { + FormWidgetRecaptcha build(); + + _FinalStage label(Optional label); + + _FinalStage label(String label); + + _FinalStage hint(Optional hint); + + _FinalStage hint(String hint); + + _FinalStage required(Optional required); + + _FinalStage required(Boolean required); + + _FinalStage sensitive(Optional sensitive); + + _FinalStage sensitive(Boolean sensitive); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CategoryStage, TypeStage, ConfigStage, _FinalStage { + private String id; + + private String category; + + private String type; + + private FormWidgetRecaptchaConfig config; + + private Optional sensitive = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional hint = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetRecaptcha other) { + id(other.getId()); + category(other.getCategory()); + type(other.getType()); + config(other.getConfig()); + label(other.getLabel()); + hint(other.getHint()); + required(other.getRequired()); + sensitive(other.getSensitive()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CategoryStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("category") + public TypeStage category(@NotNull String category) { + this.category = Objects.requireNonNull(category, "category must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public ConfigStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("config") + public _FinalStage config(@NotNull FormWidgetRecaptchaConfig config) { + this.config = Objects.requireNonNull(config, "config must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage sensitive(Boolean sensitive) { + this.sensitive = Optional.ofNullable(sensitive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) + public _FinalStage sensitive(Optional sensitive) { + this.sensitive = sensitive; + return this; + } + + @java.lang.Override + public _FinalStage required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public _FinalStage required(Optional required) { + this.required = required; + return this; + } + + @java.lang.Override + public _FinalStage hint(String hint) { + this.hint = Optional.ofNullable(hint); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hint", nulls = Nulls.SKIP) + public _FinalStage hint(Optional hint) { + this.hint = hint; + return this; + } + + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + @java.lang.Override + public FormWidgetRecaptcha build() { + return new FormWidgetRecaptcha( + id, category, type, config, label, hint, required, sensitive, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java new file mode 100644 index 000000000..eb3212400 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FormWidgetRecaptchaConfig.Builder.class) +public final class FormWidgetRecaptchaConfig { + private final String siteKey; + + private final String secretKey; + + private final Map additionalProperties; + + private FormWidgetRecaptchaConfig(String siteKey, String secretKey, Map additionalProperties) { + this.siteKey = siteKey; + this.secretKey = secretKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + @JsonProperty("secret_key") + public String getSecretKey() { + return secretKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FormWidgetRecaptchaConfig && equalTo((FormWidgetRecaptchaConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FormWidgetRecaptchaConfig other) { + return siteKey.equals(other.siteKey) && secretKey.equals(other.secretKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.siteKey, this.secretKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + SecretKeyStage siteKey(@NotNull String siteKey); + + Builder from(FormWidgetRecaptchaConfig other); + } + + public interface SecretKeyStage { + _FinalStage secretKey(@NotNull String secretKey); + } + + public interface _FinalStage { + FormWidgetRecaptchaConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, SecretKeyStage, _FinalStage { + private String siteKey; + + private String secretKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FormWidgetRecaptchaConfig other) { + siteKey(other.getSiteKey()); + secretKey(other.getSecretKey()); + return this; + } + + @java.lang.Override + @JsonSetter("site_key") + public SecretKeyStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("secret_key") + public _FinalStage secretKey(@NotNull String secretKey) { + this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); + return this; + } + + @java.lang.Override + public FormWidgetRecaptchaConfig build() { + return new FormWidgetRecaptchaConfig(siteKey, secretKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java new file mode 100644 index 000000000..b0d8f710c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FormsRequestParametersHydrateEnum { + public static final FormsRequestParametersHydrateEnum LINKS = + new FormsRequestParametersHydrateEnum(Value.LINKS, "links"); + + public static final FormsRequestParametersHydrateEnum FLOW_COUNT = + new FormsRequestParametersHydrateEnum(Value.FLOW_COUNT, "flow_count"); + + private final Value value; + + private final String string; + + FormsRequestParametersHydrateEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FormsRequestParametersHydrateEnum + && this.string.equals(((FormsRequestParametersHydrateEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LINKS: + return visitor.visitLinks(); + case FLOW_COUNT: + return visitor.visitFlowCount(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FormsRequestParametersHydrateEnum valueOf(String value) { + switch (value) { + case "links": + return LINKS; + case "flow_count": + return FLOW_COUNT; + default: + return new FormsRequestParametersHydrateEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + FLOW_COUNT, + + LINKS, + + UNKNOWN + } + + public interface Visitor { + T visitFlowCount(); + + T visitLinks(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java new file mode 100644 index 000000000..676cf76ab --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetActionExecutionResponseContent.Builder.class) +public final class GetActionExecutionResponseContent { + private final Optional id; + + private final Optional triggerId; + + private final Optional status; + + private final Optional> results; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetActionExecutionResponseContent( + Optional id, + Optional triggerId, + Optional status, + Optional> results, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.triggerId = triggerId; + this.status = status; + this.results = results; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID identifies this specific execution simulation. These IDs would resemble real executions in production. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("trigger_id") + public Optional getTriggerId() { + return triggerId; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + /** + * @return The time that the execution was started. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time that the exeution finished executing. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetActionExecutionResponseContent && equalTo((GetActionExecutionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetActionExecutionResponseContent other) { + return id.equals(other.id) + && triggerId.equals(other.triggerId) + && status.equals(other.status) + && results.equals(other.results) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.triggerId, this.status, this.results, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional triggerId = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional> results = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetActionExecutionResponseContent other) { + id(other.getId()); + triggerId(other.getTriggerId()); + status(other.getStatus()); + results(other.getResults()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

ID identifies this specific execution simulation. These IDs would resemble real executions in production.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "trigger_id", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionExecutionStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + /** + *

The time that the execution was started.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time that the exeution finished executing.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetActionExecutionResponseContent build() { + return new GetActionExecutionResponseContent( + id, triggerId, status, results, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java new file mode 100644 index 000000000..43754419f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetActionResponseContent.Builder.class) +public final class GetActionResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional allChangesDeployed; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional deployedVersion; + + private final Optional installedIntegrationId; + + private final Optional integration; + + private final Optional status; + + private final Optional builtAt; + + private final Optional deploy; + + private final Map additionalProperties; + + private GetActionResponseContent( + Optional id, + Optional name, + Optional> supportedTriggers, + Optional allChangesDeployed, + Optional createdAt, + Optional updatedAt, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Optional deployedVersion, + Optional installedIntegrationId, + Optional integration, + Optional status, + Optional builtAt, + Optional deploy, + Map additionalProperties) { + this.id = id; + this.name = name; + this.supportedTriggers = supportedTriggers; + this.allChangesDeployed = allChangesDeployed; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.deployedVersion = deployedVersion; + this.installedIntegrationId = installedIntegrationId; + this.integration = integration; + this.status = status; + this.builtAt = builtAt; + this.deploy = deploy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the action. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return True if all of an Action's contents have been deployed. + */ + @JsonProperty("all_changes_deployed") + public Optional getAllChangesDeployed() { + return allChangesDeployed; + } + + /** + * @return The time when this action was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this action was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("deployed_version") + public Optional getDeployedVersion() { + return deployedVersion; + } + + /** + * @return installed_integration_id is the fk reference to the InstalledIntegration entity. + */ + @JsonProperty("installed_integration_id") + public Optional getInstalledIntegrationId() { + return installedIntegrationId; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The time when this action was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return True if the action should be deployed after creation. + */ + @JsonProperty("deploy") + public Optional getDeploy() { + return deploy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetActionResponseContent && equalTo((GetActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetActionResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && allChangesDeployed.equals(other.allChangesDeployed) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && deployedVersion.equals(other.deployedVersion) + && installedIntegrationId.equals(other.installedIntegrationId) + && integration.equals(other.integration) + && status.equals(other.status) + && builtAt.equals(other.builtAt) + && deploy.equals(other.deploy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.supportedTriggers, + this.allChangesDeployed, + this.createdAt, + this.updatedAt, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.deployedVersion, + this.installedIntegrationId, + this.integration, + this.status, + this.builtAt, + this.deploy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional allChangesDeployed = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional deployedVersion = Optional.empty(); + + private Optional installedIntegrationId = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional deploy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetActionResponseContent other) { + id(other.getId()); + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + allChangesDeployed(other.getAllChangesDeployed()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + deployedVersion(other.getDeployedVersion()); + installedIntegrationId(other.getInstalledIntegrationId()); + integration(other.getIntegration()); + status(other.getStatus()); + builtAt(other.getBuiltAt()); + deploy(other.getDeploy()); + return this; + } + + /** + *

The unique ID of the action.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

True if all of an Action's contents have been deployed.

+ */ + @JsonSetter(value = "all_changes_deployed", nulls = Nulls.SKIP) + public Builder allChangesDeployed(Optional allChangesDeployed) { + this.allChangesDeployed = allChangesDeployed; + return this; + } + + public Builder allChangesDeployed(Boolean allChangesDeployed) { + this.allChangesDeployed = Optional.ofNullable(allChangesDeployed); + return this; + } + + /** + *

The time when this action was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this action was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The source code of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "deployed_version", nulls = Nulls.SKIP) + public Builder deployedVersion(Optional deployedVersion) { + this.deployedVersion = deployedVersion; + return this; + } + + public Builder deployedVersion(ActionDeployedVersion deployedVersion) { + this.deployedVersion = Optional.ofNullable(deployedVersion); + return this; + } + + /** + *

installed_integration_id is the fk reference to the InstalledIntegration entity.

+ */ + @JsonSetter(value = "installed_integration_id", nulls = Nulls.SKIP) + public Builder installedIntegrationId(Optional installedIntegrationId) { + this.installedIntegrationId = installedIntegrationId; + return this; + } + + public Builder installedIntegrationId(String installedIntegrationId) { + this.installedIntegrationId = Optional.ofNullable(installedIntegrationId); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(Integration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The time when this action was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ */ + @JsonSetter(value = "deploy", nulls = Nulls.SKIP) + public Builder deploy(Optional deploy) { + this.deploy = deploy; + return this; + } + + public Builder deploy(Boolean deploy) { + this.deploy = Optional.ofNullable(deploy); + return this; + } + + public GetActionResponseContent build() { + return new GetActionResponseContent( + id, + name, + supportedTriggers, + allChangesDeployed, + createdAt, + updatedAt, + code, + dependencies, + runtime, + secrets, + deployedVersion, + installedIntegrationId, + integration, + status, + builtAt, + deploy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java new file mode 100644 index 000000000..7afac26dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java @@ -0,0 +1,544 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetActionVersionResponseContent.Builder.class) +public final class GetActionVersionResponseContent { + private final Optional id; + + private final Optional actionId; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional deployed; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional status; + + private final Optional number; + + private final Optional> errors; + + private final Optional action; + + private final Optional builtAt; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> supportedTriggers; + + private final Map additionalProperties; + + private GetActionVersionResponseContent( + Optional id, + Optional actionId, + Optional code, + Optional> dependencies, + Optional deployed, + Optional runtime, + Optional> secrets, + Optional status, + Optional number, + Optional> errors, + Optional action, + Optional builtAt, + Optional createdAt, + Optional updatedAt, + Optional> supportedTriggers, + Map additionalProperties) { + this.id = id; + this.actionId = actionId; + this.code = code; + this.dependencies = dependencies; + this.deployed = deployed; + this.runtime = runtime; + this.secrets = secrets; + this.status = status; + this.number = number; + this.errors = errors; + this.action = action; + this.builtAt = builtAt; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.supportedTriggers = supportedTriggers; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique id of an action version. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The id of the action to which this version belongs. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + /** + * @return The source code of this specific version of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this specific version depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return Indicates if this speciic version is the currently one deployed. + */ + @JsonProperty("deployed") + public Optional getDeployed() { + return deployed; + } + + /** + * @return The Node runtime. For example: node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The index of this version in list of versions for the action. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return Any errors that occurred while the version was being built. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @JsonProperty("action") + public Optional getAction() { + return action; + } + + /** + * @return The time when this version was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return The time when this version was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The list of triggers that this version supports. At this time, a version can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetActionVersionResponseContent && equalTo((GetActionVersionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetActionVersionResponseContent other) { + return id.equals(other.id) + && actionId.equals(other.actionId) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && deployed.equals(other.deployed) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && status.equals(other.status) + && number.equals(other.number) + && errors.equals(other.errors) + && action.equals(other.action) + && builtAt.equals(other.builtAt) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && supportedTriggers.equals(other.supportedTriggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.actionId, + this.code, + this.dependencies, + this.deployed, + this.runtime, + this.secrets, + this.status, + this.number, + this.errors, + this.action, + this.builtAt, + this.createdAt, + this.updatedAt, + this.supportedTriggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional deployed = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional action = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetActionVersionResponseContent other) { + id(other.getId()); + actionId(other.getActionId()); + code(other.getCode()); + dependencies(other.getDependencies()); + deployed(other.getDeployed()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + status(other.getStatus()); + number(other.getNumber()); + errors(other.getErrors()); + action(other.getAction()); + builtAt(other.getBuiltAt()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + supportedTriggers(other.getSupportedTriggers()); + return this; + } + + /** + *

The unique id of an action version.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The id of the action to which this version belongs.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + /** + *

The source code of this specific version of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this specific version depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

Indicates if this speciic version is the currently one deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(Optional deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = Optional.ofNullable(deployed); + return this; + } + + /** + *

The Node runtime. For example: node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionVersionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The index of this version in list of versions for the action.

+ */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(Double number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

Any errors that occurred while the version was being built.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + @JsonSetter(value = "action", nulls = Nulls.SKIP) + public Builder action(Optional action) { + this.action = action; + return this; + } + + public Builder action(ActionBase action) { + this.action = Optional.ofNullable(action); + return this; + } + + /** + *

The time when this version was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

The time when this version was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when a version was updated. Versions are never updated externally. Only Auth0 will update an action version as it is being built.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The list of triggers that this version supports. At this time, a version can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + public GetActionVersionResponseContent build() { + return new GetActionVersionResponseContent( + id, + actionId, + code, + dependencies, + deployed, + runtime, + secrets, + status, + number, + errors, + action, + builtAt, + createdAt, + updatedAt, + supportedTriggers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java new file mode 100644 index 000000000..cbacb856f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java @@ -0,0 +1,414 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetAculResponseContent.Builder.class) +public final class GetAculResponseContent { + private final Optional tenant; + + private final Optional prompt; + + private final Optional screen; + + private final Optional renderingMode; + + private final Optional> contextConfiguration; + + private final Optional defaultHeadTagsDisabled; + + private final Optional> headTags; + + private final OptionalNullable filters; + + private final OptionalNullable usePageTemplate; + + private final Map additionalProperties; + + private GetAculResponseContent( + Optional tenant, + Optional prompt, + Optional screen, + Optional renderingMode, + Optional> contextConfiguration, + Optional defaultHeadTagsDisabled, + Optional> headTags, + OptionalNullable filters, + OptionalNullable usePageTemplate, + Map additionalProperties) { + this.tenant = tenant; + this.prompt = prompt; + this.screen = screen; + this.renderingMode = renderingMode; + this.contextConfiguration = contextConfiguration; + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.headTags = headTags; + this.filters = filters; + this.usePageTemplate = usePageTemplate; + this.additionalProperties = additionalProperties; + } + + /** + * @return Tenant ID + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of the prompt + */ + @JsonProperty("prompt") + public Optional getPrompt() { + return prompt; + } + + /** + * @return Name of the screen + */ + @JsonProperty("screen") + public Optional getScreen() { + return screen; + } + + @JsonProperty("rendering_mode") + public Optional getRenderingMode() { + return renderingMode; + } + + /** + * @return Context values to make available + */ + @JsonProperty("context_configuration") + public Optional> getContextConfiguration() { + return contextConfiguration; + } + + /** + * @return Override Universal Login default head tags + */ + @JsonProperty("default_head_tags_disabled") + public Optional getDefaultHeadTagsDisabled() { + return defaultHeadTagsDisabled; + } + + /** + * @return An array of head tags + */ + @JsonProperty("head_tags") + public Optional> getHeadTags() { + return headTags; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + public OptionalNullable getFilters() { + if (filters == null) { + return OptionalNullable.absent(); + } + return filters; + } + + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + private OptionalNullable _getUsePageTemplate() { + return usePageTemplate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetAculResponseContent && equalTo((GetAculResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetAculResponseContent other) { + return tenant.equals(other.tenant) + && prompt.equals(other.prompt) + && screen.equals(other.screen) + && renderingMode.equals(other.renderingMode) + && contextConfiguration.equals(other.contextConfiguration) + && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && headTags.equals(other.headTags) + && filters.equals(other.filters) + && usePageTemplate.equals(other.usePageTemplate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.tenant, + this.prompt, + this.screen, + this.renderingMode, + this.contextConfiguration, + this.defaultHeadTagsDisabled, + this.headTags, + this.filters, + this.usePageTemplate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tenant = Optional.empty(); + + private Optional prompt = Optional.empty(); + + private Optional screen = Optional.empty(); + + private Optional renderingMode = Optional.empty(); + + private Optional> contextConfiguration = Optional.empty(); + + private Optional defaultHeadTagsDisabled = Optional.empty(); + + private Optional> headTags = Optional.empty(); + + private OptionalNullable filters = OptionalNullable.absent(); + + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetAculResponseContent other) { + tenant(other.getTenant()); + prompt(other.getPrompt()); + screen(other.getScreen()); + renderingMode(other.getRenderingMode()); + contextConfiguration(other.getContextConfiguration()); + defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + headTags(other.getHeadTags()); + filters(other.getFilters()); + usePageTemplate(other.getUsePageTemplate()); + return this; + } + + /** + *

Tenant ID

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of the prompt

+ */ + @JsonSetter(value = "prompt", nulls = Nulls.SKIP) + public Builder prompt(Optional prompt) { + this.prompt = prompt; + return this; + } + + public Builder prompt(String prompt) { + this.prompt = Optional.ofNullable(prompt); + return this; + } + + /** + *

Name of the screen

+ */ + @JsonSetter(value = "screen", nulls = Nulls.SKIP) + public Builder screen(Optional screen) { + this.screen = screen; + return this; + } + + public Builder screen(String screen) { + this.screen = Optional.ofNullable(screen); + return this; + } + + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public Builder renderingMode(Optional renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + public Builder renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = Optional.ofNullable(renderingMode); + return this; + } + + /** + *

Context values to make available

+ */ + @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) + public Builder contextConfiguration(Optional> contextConfiguration) { + this.contextConfiguration = contextConfiguration; + return this; + } + + public Builder contextConfiguration(List contextConfiguration) { + this.contextConfiguration = Optional.ofNullable(contextConfiguration); + return this; + } + + /** + *

Override Universal Login default head tags

+ */ + @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) + public Builder defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + return this; + } + + public Builder defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = Optional.ofNullable(defaultHeadTagsDisabled); + return this; + } + + /** + *

An array of head tags

+ */ + @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) + public Builder headTags(Optional> headTags) { + this.headTags = headTags; + return this; + } + + public Builder headTags(List headTags) { + this.headTags = Optional.ofNullable(headTags); + return this; + } + + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(@Nullable OptionalNullable filters) { + this.filters = filters; + return this; + } + + public Builder filters(AculFilters filters) { + this.filters = OptionalNullable.of(filters); + return this; + } + + public Builder filters(Optional filters) { + if (filters.isPresent()) { + this.filters = OptionalNullable.of(filters.get()); + } else { + this.filters = OptionalNullable.absent(); + } + return this; + } + + public Builder filters(com.auth0.client.mgmt.core.Nullable filters) { + if (filters.isNull()) { + this.filters = OptionalNullable.ofNull(); + } else if (filters.isEmpty()) { + this.filters = OptionalNullable.absent(); + } else { + this.filters = OptionalNullable.of(filters.get()); + } + return this; + } + + /** + *

Use page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + + public GetAculResponseContent build() { + return new GetAculResponseContent( + tenant, + prompt, + screen, + renderingMode, + contextConfiguration, + defaultHeadTagsDisabled, + headTags, + filters, + usePageTemplate, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java new file mode 100644 index 000000000..3309725f6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBrandingDefaultThemeResponseContent.Builder.class) +public final class GetBrandingDefaultThemeResponseContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final String displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final String themeId; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private GetBrandingDefaultThemeResponseContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + String displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + String themeId, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.themeId = themeId; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + /** + * @return Theme Id + */ + @JsonProperty("themeId") + public String getThemeId() { + return themeId; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBrandingDefaultThemeResponseContent + && equalTo((GetBrandingDefaultThemeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBrandingDefaultThemeResponseContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && themeId.equals(other.themeId) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.borders, + this.colors, + this.displayName, + this.fonts, + this.pageBackground, + this.themeId, + this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(GetBrandingDefaultThemeResponseContent other); + } + + public interface ColorsStage { + DisplayNameStage colors(@NotNull BrandingThemeColors colors); + } + + public interface DisplayNameStage { + /** + *

Display Name

+ */ + FontsStage displayName(@NotNull String displayName); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface ThemeIdStage { + /** + *

Theme Id

+ */ + WidgetStage themeId(@NotNull String themeId); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + GetBrandingDefaultThemeResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, + ColorsStage, + DisplayNameStage, + FontsStage, + PageBackgroundStage, + ThemeIdStage, + WidgetStage, + _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private String displayName; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private String themeId; + + private BrandingThemeWidget widget; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetBrandingDefaultThemeResponseContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + themeId(other.getThemeId()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + /** + *

Display Name

+ *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayName") + public FontsStage displayName(@NotNull String displayName) { + this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + /** + *

Theme Id

+ *

Theme Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("themeId") + public WidgetStage themeId(@NotNull String themeId) { + this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + @java.lang.Override + public GetBrandingDefaultThemeResponseContent build() { + return new GetBrandingDefaultThemeResponseContent( + borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java new file mode 100644 index 000000000..08f799854 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBrandingPhoneProviderResponseContent.Builder.class) +public final class GetBrandingPhoneProviderResponseContent { + private final Optional id; + + private final Optional tenant; + + private final PhoneProviderNameEnum name; + + private final Optional channel; + + private final Optional disabled; + + private final Optional configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetBrandingPhoneProviderResponseContent( + Optional id, + Optional tenant, + PhoneProviderNameEnum name, + Optional channel, + Optional disabled, + Optional configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.tenant = tenant; + this.name = name; + this.channel = channel; + this.disabled = disabled; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the tenant + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("name") + public PhoneProviderNameEnum getName() { + return name; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + /** + * @return The provider's creation date and time in ISO 8601 format + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time of the last update to the provider in ISO 8601 format + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBrandingPhoneProviderResponseContent + && equalTo((GetBrandingPhoneProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBrandingPhoneProviderResponseContent other) { + return id.equals(other.id) + && tenant.equals(other.tenant) + && name.equals(other.name) + && channel.equals(other.channel) + && disabled.equals(other.disabled) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.tenant, + this.name, + this.channel, + this.disabled, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull PhoneProviderNameEnum name); + + Builder from(GetBrandingPhoneProviderResponseContent other); + } + + public interface _FinalStage { + GetBrandingPhoneProviderResponseContent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

The name of the tenant

+ */ + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(Optional disabled); + + _FinalStage disabled(Boolean disabled); + + _FinalStage configuration(Optional configuration); + + _FinalStage configuration(PhoneProviderConfiguration configuration); + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private PhoneProviderNameEnum name; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional configuration = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional channel = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetBrandingPhoneProviderResponseContent other) { + id(other.getId()); + tenant(other.getTenant()); + name(other.getName()); + channel(other.getChannel()); + disabled(other.getDisabled()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull PhoneProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public _FinalStage updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public _FinalStage configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public _FinalStage configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @java.lang.Override + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public _FinalStage disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + /** + *

The name of the tenant

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

The name of the tenant

+ */ + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public GetBrandingPhoneProviderResponseContent build() { + return new GetBrandingPhoneProviderResponseContent( + id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java new file mode 100644 index 000000000..a647a9d18 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBrandingResponseContent.Builder.class) +public final class GetBrandingResponseContent { + private final Optional colors; + + private final Optional faviconUrl; + + private final Optional logoUrl; + + private final Optional font; + + private final Map additionalProperties; + + private GetBrandingResponseContent( + Optional colors, + Optional faviconUrl, + Optional logoUrl, + Optional font, + Map additionalProperties) { + this.colors = colors; + this.faviconUrl = faviconUrl; + this.logoUrl = logoUrl; + this.font = font; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("colors") + public Optional getColors() { + return colors; + } + + /** + * @return URL for the favicon. Must use HTTPS. + */ + @JsonProperty("favicon_url") + public Optional getFaviconUrl() { + return faviconUrl; + } + + /** + * @return URL for the logo. Must use HTTPS. + */ + @JsonProperty("logo_url") + public Optional getLogoUrl() { + return logoUrl; + } + + @JsonProperty("font") + public Optional getFont() { + return font; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBrandingResponseContent && equalTo((GetBrandingResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBrandingResponseContent other) { + return colors.equals(other.colors) + && faviconUrl.equals(other.faviconUrl) + && logoUrl.equals(other.logoUrl) + && font.equals(other.font); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional colors = Optional.empty(); + + private Optional faviconUrl = Optional.empty(); + + private Optional logoUrl = Optional.empty(); + + private Optional font = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetBrandingResponseContent other) { + colors(other.getColors()); + faviconUrl(other.getFaviconUrl()); + logoUrl(other.getLogoUrl()); + font(other.getFont()); + return this; + } + + @JsonSetter(value = "colors", nulls = Nulls.SKIP) + public Builder colors(Optional colors) { + this.colors = colors; + return this; + } + + public Builder colors(BrandingColors colors) { + this.colors = Optional.ofNullable(colors); + return this; + } + + /** + *

URL for the favicon. Must use HTTPS.

+ */ + @JsonSetter(value = "favicon_url", nulls = Nulls.SKIP) + public Builder faviconUrl(Optional faviconUrl) { + this.faviconUrl = faviconUrl; + return this; + } + + public Builder faviconUrl(String faviconUrl) { + this.faviconUrl = Optional.ofNullable(faviconUrl); + return this; + } + + /** + *

URL for the logo. Must use HTTPS.

+ */ + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public Builder logoUrl(Optional logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + public Builder logoUrl(String logoUrl) { + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + @JsonSetter(value = "font", nulls = Nulls.SKIP) + public Builder font(Optional font) { + this.font = font; + return this; + } + + public Builder font(BrandingFont font) { + this.font = Optional.ofNullable(font); + return this; + } + + public GetBrandingResponseContent build() { + return new GetBrandingResponseContent(colors, faviconUrl, logoUrl, font, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java new file mode 100644 index 000000000..6bf26326d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java @@ -0,0 +1,286 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBrandingThemeResponseContent.Builder.class) +public final class GetBrandingThemeResponseContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final String displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final String themeId; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private GetBrandingThemeResponseContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + String displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + String themeId, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.themeId = themeId; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + /** + * @return Theme Id + */ + @JsonProperty("themeId") + public String getThemeId() { + return themeId; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBrandingThemeResponseContent && equalTo((GetBrandingThemeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBrandingThemeResponseContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && themeId.equals(other.themeId) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.borders, + this.colors, + this.displayName, + this.fonts, + this.pageBackground, + this.themeId, + this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(GetBrandingThemeResponseContent other); + } + + public interface ColorsStage { + DisplayNameStage colors(@NotNull BrandingThemeColors colors); + } + + public interface DisplayNameStage { + /** + *

Display Name

+ */ + FontsStage displayName(@NotNull String displayName); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface ThemeIdStage { + /** + *

Theme Id

+ */ + WidgetStage themeId(@NotNull String themeId); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + GetBrandingThemeResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, + ColorsStage, + DisplayNameStage, + FontsStage, + PageBackgroundStage, + ThemeIdStage, + WidgetStage, + _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private String displayName; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private String themeId; + + private BrandingThemeWidget widget; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetBrandingThemeResponseContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + themeId(other.getThemeId()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + /** + *

Display Name

+ *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayName") + public FontsStage displayName(@NotNull String displayName) { + this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + /** + *

Theme Id

+ *

Theme Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("themeId") + public WidgetStage themeId(@NotNull String themeId) { + this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + @java.lang.Override + public GetBrandingThemeResponseContent build() { + return new GetBrandingThemeResponseContent( + borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java new file mode 100644 index 000000000..125b7d2cb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBreachedPasswordDetectionSettingsResponseContent.Builder.class) +public final class GetBreachedPasswordDetectionSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> adminNotificationFrequency; + + private final Optional method; + + private final Optional stage; + + private final Map additionalProperties; + + private GetBreachedPasswordDetectionSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> adminNotificationFrequency, + Optional method, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.adminNotificationFrequency = adminNotificationFrequency; + this.method = method; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not breached password detection is active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>. + */ + @JsonProperty("admin_notification_frequency") + public Optional> getAdminNotificationFrequency() { + return adminNotificationFrequency; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBreachedPasswordDetectionSettingsResponseContent + && equalTo((GetBreachedPasswordDetectionSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBreachedPasswordDetectionSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && adminNotificationFrequency.equals(other.adminNotificationFrequency) + && method.equals(other.method) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> adminNotificationFrequency = + Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetBreachedPasswordDetectionSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + adminNotificationFrequency(other.getAdminNotificationFrequency()); + method(other.getMethod()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not breached password detection is active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>.

+ */ + @JsonSetter(value = "admin_notification_frequency", nulls = Nulls.SKIP) + public Builder adminNotificationFrequency( + Optional> adminNotificationFrequency) { + this.adminNotificationFrequency = adminNotificationFrequency; + return this; + } + + public Builder adminNotificationFrequency( + List adminNotificationFrequency) { + this.adminNotificationFrequency = Optional.ofNullable(adminNotificationFrequency); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(BreachedPasswordDetectionMethodEnum method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(BreachedPasswordDetectionStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public GetBreachedPasswordDetectionSettingsResponseContent build() { + return new GetBreachedPasswordDetectionSettingsResponseContent( + enabled, shields, adminNotificationFrequency, method, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java new file mode 100644 index 000000000..1efa800b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBruteForceSettingsResponseContent.Builder.class) +public final class GetBruteForceSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional mode; + + private final Optional maxAttempts; + + private final Map additionalProperties; + + private GetBruteForceSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional mode, + Optional maxAttempts, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.mode = mode; + this.maxAttempts = maxAttempts; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not brute force attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return List of trusted IP addresses that will not have attack protection enforced against them. + */ + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + /** + * @return Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>. + */ + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + + /** + * @return Maximum number of unsuccessful attempts. + */ + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBruteForceSettingsResponseContent + && equalTo((GetBruteForceSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBruteForceSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && mode.equals(other.mode) + && maxAttempts.equals(other.maxAttempts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional mode = Optional.empty(); + + private Optional maxAttempts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetBruteForceSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + mode(other.getMode()); + maxAttempts(other.getMaxAttempts()); + return this; + } + + /** + *

Whether or not brute force attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

List of trusted IP addresses that will not have attack protection enforced against them.

+ */ + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + /** + *

Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>.

+ */ + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(GetBruteForceSettingsResponseContentMode mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + /** + *

Maximum number of unsuccessful attempts.

+ */ + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public Builder maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + public Builder maxAttempts(Integer maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + public GetBruteForceSettingsResponseContent build() { + return new GetBruteForceSettingsResponseContent( + enabled, shields, allowlist, mode, maxAttempts, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java new file mode 100644 index 000000000..eac3c1ac2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GetBruteForceSettingsResponseContentMode { + public static final GetBruteForceSettingsResponseContentMode COUNT_PER_IDENTIFIER = + new GetBruteForceSettingsResponseContentMode(Value.COUNT_PER_IDENTIFIER, "count_per_identifier"); + + public static final GetBruteForceSettingsResponseContentMode COUNT_PER_IDENTIFIER_AND_IP = + new GetBruteForceSettingsResponseContentMode( + Value.COUNT_PER_IDENTIFIER_AND_IP, "count_per_identifier_and_ip"); + + private final Value value; + + private final String string; + + GetBruteForceSettingsResponseContentMode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GetBruteForceSettingsResponseContentMode + && this.string.equals(((GetBruteForceSettingsResponseContentMode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COUNT_PER_IDENTIFIER: + return visitor.visitCountPerIdentifier(); + case COUNT_PER_IDENTIFIER_AND_IP: + return visitor.visitCountPerIdentifierAndIp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GetBruteForceSettingsResponseContentMode valueOf(String value) { + switch (value) { + case "count_per_identifier": + return COUNT_PER_IDENTIFIER; + case "count_per_identifier_and_ip": + return COUNT_PER_IDENTIFIER_AND_IP; + default: + return new GetBruteForceSettingsResponseContentMode(Value.UNKNOWN, value); + } + } + + public enum Value { + COUNT_PER_IDENTIFIER_AND_IP, + + COUNT_PER_IDENTIFIER, + + UNKNOWN + } + + public interface Visitor { + T visitCountPerIdentifierAndIp(); + + T visitCountPerIdentifier(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java new file mode 100644 index 000000000..82a015ce8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GetBruteForceSettingsResponseContentShieldsItem { + public static final GetBruteForceSettingsResponseContentShieldsItem BLOCK = + new GetBruteForceSettingsResponseContentShieldsItem(Value.BLOCK, "block"); + + public static final GetBruteForceSettingsResponseContentShieldsItem USER_NOTIFICATION = + new GetBruteForceSettingsResponseContentShieldsItem(Value.USER_NOTIFICATION, "user_notification"); + + private final Value value; + + private final String string; + + GetBruteForceSettingsResponseContentShieldsItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GetBruteForceSettingsResponseContentShieldsItem + && this.string.equals(((GetBruteForceSettingsResponseContentShieldsItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case USER_NOTIFICATION: + return visitor.visitUserNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GetBruteForceSettingsResponseContentShieldsItem valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "user_notification": + return USER_NOTIFICATION; + default: + return new GetBruteForceSettingsResponseContentShieldsItem(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + USER_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitUserNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java new file mode 100644 index 000000000..413a65ae1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetClientCredentialResponseContent.Builder.class) +public final class GetClientCredentialResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional kid; + + private final Optional alg; + + private final Optional credentialType; + + private final Optional subjectDn; + + private final Optional thumbprintSha256; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private GetClientCredentialResponseContent( + Optional id, + Optional name, + Optional kid, + Optional alg, + Optional credentialType, + Optional subjectDn, + Optional thumbprintSha256, + Optional createdAt, + Optional updatedAt, + Optional expiresAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.kid = kid; + this.alg = alg; + this.credentialType = credentialType; + this.subjectDn = subjectDn; + this.thumbprintSha256 = thumbprintSha256; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the credential. Generated on creation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name given to the credential by the user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The key identifier of the credential, generated on creation. + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + @JsonProperty("credential_type") + public Optional getCredentialType() { + return credentialType; + } + + /** + * @return The X509 certificate's Subject Distinguished Name + */ + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + /** + * @return The X509 certificate's SHA256 thumbprint + */ + @JsonProperty("thumbprint_sha256") + public Optional getThumbprintSha256() { + return thumbprintSha256; + } + + /** + * @return The ISO 8601 formatted date the credential was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date the credential was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetClientCredentialResponseContent + && equalTo((GetClientCredentialResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetClientCredentialResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && kid.equals(other.kid) + && alg.equals(other.alg) + && credentialType.equals(other.credentialType) + && subjectDn.equals(other.subjectDn) + && thumbprintSha256.equals(other.thumbprintSha256) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.kid, + this.alg, + this.credentialType, + this.subjectDn, + this.thumbprintSha256, + this.createdAt, + this.updatedAt, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional kid = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional credentialType = Optional.empty(); + + private Optional subjectDn = Optional.empty(); + + private Optional thumbprintSha256 = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetClientCredentialResponseContent other) { + id(other.getId()); + name(other.getName()); + kid(other.getKid()); + alg(other.getAlg()); + credentialType(other.getCredentialType()); + subjectDn(other.getSubjectDn()); + thumbprintSha256(other.getThumbprintSha256()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

ID of the credential. Generated on creation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name given to the credential by the user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The key identifier of the credential, generated on creation.

+ */ + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public Builder kid(Optional kid) { + this.kid = kid; + return this; + } + + public Builder kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public Builder alg(Optional alg) { + this.alg = alg; + return this; + } + + public Builder alg(ClientCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @JsonSetter(value = "credential_type", nulls = Nulls.SKIP) + public Builder credentialType(Optional credentialType) { + this.credentialType = credentialType; + return this; + } + + public Builder credentialType(ClientCredentialTypeEnum credentialType) { + this.credentialType = Optional.ofNullable(credentialType); + return this; + } + + /** + *

The X509 certificate's Subject Distinguished Name

+ */ + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public Builder subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + public Builder subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + /** + *

The X509 certificate's SHA256 thumbprint

+ */ + @JsonSetter(value = "thumbprint_sha256", nulls = Nulls.SKIP) + public Builder thumbprintSha256(Optional thumbprintSha256) { + this.thumbprintSha256 = thumbprintSha256; + return this; + } + + public Builder thumbprintSha256(String thumbprintSha256) { + this.thumbprintSha256 = Optional.ofNullable(thumbprintSha256); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public GetClientCredentialResponseContent build() { + return new GetClientCredentialResponseContent( + id, + name, + kid, + alg, + credentialType, + subjectDn, + thumbprintSha256, + createdAt, + updatedAt, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java new file mode 100644 index 000000000..de80034af --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetClientRequestParameters.Builder.class) +public final class GetClientRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetClientRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetClientRequestParameters && equalTo((GetClientRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetClientRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetClientRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetClientRequestParameters build() { + return new GetClientRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java new file mode 100644 index 000000000..63fa7ef0e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java @@ -0,0 +1,1663 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetClientResponseContent.Builder.class) +public final class GetClientResponseContent { + private final Optional clientId; + + private final Optional tenant; + + private final Optional name; + + private final Optional description; + + private final Optional global; + + private final Optional clientSecret; + + private final Optional appType; + + private final Optional logoUri; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional> callbacks; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final OptionalNullable sessionTransfer; + + private final Optional oidcLogout; + + private final Optional> grantTypes; + + private final Optional jwtConfiguration; + + private final Optional> signingKeys; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional ssoDisabled; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional tokenEndpointAuthMethod; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private GetClientResponseContent( + Optional clientId, + Optional tenant, + Optional name, + Optional description, + Optional global, + Optional clientSecret, + Optional appType, + Optional logoUri, + Optional isFirstParty, + Optional oidcConformant, + Optional> callbacks, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + OptionalNullable sessionTransfer, + Optional oidcLogout, + Optional> grantTypes, + Optional jwtConfiguration, + Optional> signingKeys, + OptionalNullable encryptionKey, + Optional sso, + Optional ssoDisabled, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional tokenEndpointAuthMethod, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Map additionalProperties) { + this.clientId = clientId; + this.tenant = tenant; + this.name = name; + this.description = description; + this.global = global; + this.clientSecret = clientSecret; + this.appType = appType; + this.logoUri = logoUri; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.callbacks = callbacks; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionTransfer = sessionTransfer; + this.oidcLogout = oidcLogout; + this.grantTypes = grantTypes; + this.jwtConfiguration = jwtConfiguration; + this.signingKeys = signingKeys; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.ssoDisabled = ssoDisabled; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the tenant this client belongs to. + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). + */ + @JsonProperty("global") + public Optional getGlobal() { + return global; + } + + /** + * @return Client secret (which you must not make public). + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. + */ + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Whether this client a first party client (true) or not (false). + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonProperty("signing_keys") + public Optional> getSigningKeys() { + return signingKeys; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether Single Sign On is disabled (true) or enabled (true). Defaults to true. + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return Whether a custom login page is to be used (true) or the default provided login page (false). + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetClientResponseContent && equalTo((GetClientResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetClientResponseContent other) { + return clientId.equals(other.clientId) + && tenant.equals(other.tenant) + && name.equals(other.name) + && description.equals(other.description) + && global.equals(other.global) + && clientSecret.equals(other.clientSecret) + && appType.equals(other.appType) + && logoUri.equals(other.logoUri) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && callbacks.equals(other.callbacks) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionTransfer.equals(other.sessionTransfer) + && oidcLogout.equals(other.oidcLogout) + && grantTypes.equals(other.grantTypes) + && jwtConfiguration.equals(other.jwtConfiguration) + && signingKeys.equals(other.signingKeys) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && ssoDisabled.equals(other.ssoDisabled) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.tenant, + this.name, + this.description, + this.global, + this.clientSecret, + this.appType, + this.logoUri, + this.isFirstParty, + this.oidcConformant, + this.callbacks, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.sessionTransfer, + this.oidcLogout, + this.grantTypes, + this.jwtConfiguration, + this.signingKeys, + this.encryptionKey, + this.sso, + this.ssoDisabled, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.tokenEndpointAuthMethod, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional global = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional> signingKeys = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private Optional organizationUsage = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetClientResponseContent other) { + clientId(other.getClientId()); + tenant(other.getTenant()); + name(other.getName()); + description(other.getDescription()); + global(other.getGlobal()); + clientSecret(other.getClientSecret()); + appType(other.getAppType()); + logoUri(other.getLogoUri()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + callbacks(other.getCallbacks()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionTransfer(other.getSessionTransfer()); + oidcLogout(other.getOidcLogout()); + grantTypes(other.getGrantTypes()); + jwtConfiguration(other.getJwtConfiguration()); + signingKeys(other.getSigningKeys()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + ssoDisabled(other.getSsoDisabled()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

ID of this client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the tenant this client belongs to.

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).

+ */ + @JsonSetter(value = "global", nulls = Nulls.SKIP) + public Builder global(Optional global) { + this.global = global; + return this; + } + + public Builder global(Boolean global) { + this.global = Optional.ofNullable(global); + return this; + } + + /** + *

Client secret (which you must not make public).

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

Whether this client a first party client (true) or not (false).

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "signing_keys", nulls = Nulls.SKIP) + public Builder signingKeys(Optional> signingKeys) { + this.signingKeys = signingKeys; + return this; + } + + public Builder signingKeys(List signingKeys) { + this.signingKeys = Optional.ofNullable(signingKeys); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Whether Single Sign On is disabled (true) or enabled (true). Defaults to true.

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

Whether a custom login page is to be used (true) or the default provided login page (false).

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public GetClientResponseContent build() { + return new GetClientResponseContent( + clientId, + tenant, + name, + description, + global, + clientSecret, + appType, + logoUri, + isFirstParty, + oidcConformant, + callbacks, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + sessionTransfer, + oidcLogout, + grantTypes, + jwtConfiguration, + signingKeys, + encryptionKey, + sso, + ssoDisabled, + crossOriginAuthentication, + crossOriginLoc, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + tokenEndpointAuthMethod, + clientMetadata, + mobile, + initiateLoginUri, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java new file mode 100644 index 000000000..bb84d0ac9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionEnabledClientsResponseContent.Builder.class) +public final class GetConnectionEnabledClientsResponseContent { + private final List clients; + + private final Optional next; + + private final Map additionalProperties; + + private GetConnectionEnabledClientsResponseContent( + List clients, Optional next, Map additionalProperties) { + this.clients = clients; + this.next = next; + this.additionalProperties = additionalProperties; + } + + /** + * @return Clients for which the connection is enabled + */ + @JsonProperty("clients") + public List getClients() { + return clients; + } + + /** + * @return Encoded next token + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionEnabledClientsResponseContent + && equalTo((GetConnectionEnabledClientsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionEnabledClientsResponseContent other) { + return clients.equals(other.clients) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clients, this.next); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List clients = new ArrayList<>(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionEnabledClientsResponseContent other) { + clients(other.getClients()); + next(other.getNext()); + return this; + } + + /** + *

Clients for which the connection is enabled

+ */ + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(List clients) { + this.clients.clear(); + if (clients != null) { + this.clients.addAll(clients); + } + return this; + } + + public Builder addClients(ConnectionEnabledClient clients) { + this.clients.add(clients); + return this; + } + + public Builder addAllClients(List clients) { + if (clients != null) { + this.clients.addAll(clients); + } + return this; + } + + /** + *

Encoded next token

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public GetConnectionEnabledClientsResponseContent build() { + return new GetConnectionEnabledClientsResponseContent(clients, next, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java new file mode 100644 index 000000000..51b0465ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionRequestParameters.Builder.class) +public final class GetConnectionRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetConnectionRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return <code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>) + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionRequestParameters && equalTo((GetConnectionRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

<code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>)

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetConnectionRequestParameters build() { + return new GetConnectionRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java new file mode 100644 index 000000000..9e85407b5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionResponseContent.Builder.class) +public final class GetConnectionResponseContent { + private final Optional name; + + private final Optional displayName; + + private final Optional> options; + + private final Optional id; + + private final Optional strategy; + + private final Optional> realms; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> metadata; + + private final Map additionalProperties; + + private GetConnectionResponseContent( + Optional name, + Optional displayName, + Optional> options, + Optional id, + Optional strategy, + Optional> realms, + Optional> enabledClients, + Optional isDomainConnection, + Optional showAsButton, + Optional> metadata, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.options = options; + this.id = id; + this.strategy = strategy; + this.realms = realms; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Connection name used in login screen + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The type of the connection, related to the identity provider + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + /** + * @return DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return True if the connection is domain level + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionResponseContent && equalTo((GetConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionResponseContent other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && options.equals(other.options) + && id.equals(other.id) + && strategy.equals(other.strategy) + && realms.equals(other.realms) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.displayName, + this.options, + this.id, + this.strategy, + this.realms, + this.enabledClients, + this.isDomainConnection, + this.showAsButton, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionResponseContent other) { + name(other.getName()); + displayName(other.getDisplayName()); + options(other.getOptions()); + id(other.getId()); + strategy(other.getStrategy()); + realms(other.getRealms()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The name of the connection

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Connection name used in login screen

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The type of the connection, related to the identity provider

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + /** + *

DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled

+ */ + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

True if the connection is domain level

+ */ + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public GetConnectionResponseContent build() { + return new GetConnectionResponseContent( + name, + displayName, + options, + id, + strategy, + realms, + enabledClients, + isDomainConnection, + showAsButton, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java new file mode 100644 index 000000000..188311f51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetCustomDomainResponseContent.Builder.class) +public final class GetCustomDomainResponseContent { + private final String customDomainId; + + private final String domain; + + private final boolean primary; + + private final CustomDomainTypeEnum type; + + private final Optional originDomainName; + + private final Optional verification; + + private final OptionalNullable customClientIpHeader; + + private final Optional tlsPolicy; + + private final Map additionalProperties; + + private GetCustomDomainResponseContent( + String customDomainId, + String domain, + boolean primary, + CustomDomainTypeEnum type, + Optional originDomainName, + Optional verification, + OptionalNullable customClientIpHeader, + Optional tlsPolicy, + Map additionalProperties) { + this.customDomainId = customDomainId; + this.domain = domain; + this.primary = primary; + this.type = type; + this.originDomainName = originDomainName; + this.verification = verification; + this.customClientIpHeader = customClientIpHeader; + this.tlsPolicy = tlsPolicy; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the custom domain. + */ + @JsonProperty("custom_domain_id") + public String getCustomDomainId() { + return customDomainId; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + /** + * @return Whether this is a primary domain (true) or not (false). + */ + @JsonProperty("primary") + public boolean getPrimary() { + return primary; + } + + @JsonProperty("type") + public CustomDomainTypeEnum getType() { + return type; + } + + /** + * @return Intermediate address. + */ + @JsonProperty("origin_domain_name") + public Optional getOriginDomainName() { + return originDomainName; + } + + @JsonProperty("verification") + public Optional getVerification() { + return verification; + } + + /** + * @return The HTTP header to fetch the client's IP address + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + if (customClientIpHeader == null) { + return OptionalNullable.absent(); + } + return customClientIpHeader; + } + + /** + * @return The TLS version policy + */ + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + private OptionalNullable _getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetCustomDomainResponseContent && equalTo((GetCustomDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetCustomDomainResponseContent other) { + return customDomainId.equals(other.customDomainId) + && domain.equals(other.domain) + && primary == other.primary + && type.equals(other.type) + && originDomainName.equals(other.originDomainName) + && verification.equals(other.verification) + && customClientIpHeader.equals(other.customClientIpHeader) + && tlsPolicy.equals(other.tlsPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customDomainId, + this.domain, + this.primary, + this.type, + this.originDomainName, + this.verification, + this.customClientIpHeader, + this.tlsPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CustomDomainIdStage builder() { + return new Builder(); + } + + public interface CustomDomainIdStage { + /** + *

ID of the custom domain.

+ */ + DomainStage customDomainId(@NotNull String customDomainId); + + Builder from(GetCustomDomainResponseContent other); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + PrimaryStage domain(@NotNull String domain); + } + + public interface PrimaryStage { + /** + *

Whether this is a primary domain (true) or not (false).

+ */ + TypeStage primary(boolean primary); + } + + public interface TypeStage { + _FinalStage type(@NotNull CustomDomainTypeEnum type); + } + + public interface _FinalStage { + GetCustomDomainResponseContent build(); + + /** + *

Intermediate address.

+ */ + _FinalStage originDomainName(Optional originDomainName); + + _FinalStage originDomainName(String originDomainName); + + _FinalStage verification(Optional verification); + + _FinalStage verification(DomainVerification verification); + + /** + *

The HTTP header to fetch the client's IP address

+ */ + _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(String customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader); + + /** + *

The TLS version policy

+ */ + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + private String customDomainId; + + private String domain; + + private boolean primary; + + private CustomDomainTypeEnum type; + + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + private Optional verification = Optional.empty(); + + private Optional originDomainName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetCustomDomainResponseContent other) { + customDomainId(other.getCustomDomainId()); + domain(other.getDomain()); + primary(other.getPrimary()); + type(other.getType()); + originDomainName(other.getOriginDomainName()); + verification(other.getVerification()); + customClientIpHeader(other.getCustomClientIpHeader()); + tlsPolicy(other.getTlsPolicy()); + return this; + } + + /** + *

ID of the custom domain.

+ *

ID of the custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("custom_domain_id") + public DomainStage customDomainId(@NotNull String customDomainId) { + this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public PrimaryStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + /** + *

Whether this is a primary domain (true) or not (false).

+ *

Whether this is a primary domain (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public TypeStage primary(boolean primary) { + this.primary = primary; + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CustomDomainTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

The TLS version policy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + /** + *

The TLS version policy

+ */ + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(String customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ */ + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public _FinalStage verification(DomainVerification verification) { + this.verification = Optional.ofNullable(verification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "verification", nulls = Nulls.SKIP) + public _FinalStage verification(Optional verification) { + this.verification = verification; + return this; + } + + /** + *

Intermediate address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originDomainName(String originDomainName) { + this.originDomainName = Optional.ofNullable(originDomainName); + return this; + } + + /** + *

Intermediate address.

+ */ + @java.lang.Override + @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) + public _FinalStage originDomainName(Optional originDomainName) { + this.originDomainName = originDomainName; + return this; + } + + @java.lang.Override + public GetCustomDomainResponseContent build() { + return new GetCustomDomainResponseContent( + customDomainId, + domain, + primary, + type, + originDomainName, + verification, + customClientIpHeader, + tlsPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java new file mode 100644 index 000000000..a7392658e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetCustomSigningKeysResponseContent.Builder.class) +public final class GetCustomSigningKeysResponseContent { + private final Optional> keys; + + private final Map additionalProperties; + + private GetCustomSigningKeysResponseContent( + Optional> keys, Map additionalProperties) { + this.keys = keys; + this.additionalProperties = additionalProperties; + } + + /** + * @return An array of custom public signing keys. + */ + @JsonProperty("keys") + public Optional> getKeys() { + return keys; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetCustomSigningKeysResponseContent + && equalTo((GetCustomSigningKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetCustomSigningKeysResponseContent other) { + return keys.equals(other.keys); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.keys); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> keys = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetCustomSigningKeysResponseContent other) { + keys(other.getKeys()); + return this; + } + + /** + *

An array of custom public signing keys.

+ */ + @JsonSetter(value = "keys", nulls = Nulls.SKIP) + public Builder keys(Optional> keys) { + this.keys = keys; + return this; + } + + public Builder keys(List keys) { + this.keys = Optional.ofNullable(keys); + return this; + } + + public GetCustomSigningKeysResponseContent build() { + return new GetCustomSigningKeysResponseContent(keys, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java new file mode 100644 index 000000000..5c044597e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetDailyStatsRequestParameters.Builder.class) +public final class GetDailyStatsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable to; + + private final Map additionalProperties; + + private GetDailyStatsRequestParameters( + OptionalNullable from, OptionalNullable to, Map additionalProperties) { + this.from = from; + this.to = to; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional first day of the date range (inclusive) in YYYYMMDD format. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Optional last day of the date range (inclusive) in YYYYMMDD format. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to") + public OptionalNullable getTo() { + if (to == null) { + return OptionalNullable.absent(); + } + return to; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to") + private OptionalNullable _getTo() { + return to; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetDailyStatsRequestParameters && equalTo((GetDailyStatsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetDailyStatsRequestParameters other) { + return from.equals(other.from) && to.equals(other.to); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.to); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable to = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetDailyStatsRequestParameters other) { + from(other.getFrom()); + to(other.getTo()); + return this; + } + + /** + *

Optional first day of the date range (inclusive) in YYYYMMDD format.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Optional last day of the date range (inclusive) in YYYYMMDD format.

+ */ + @JsonSetter(value = "to", nulls = Nulls.SKIP) + public Builder to(@Nullable OptionalNullable to) { + this.to = to; + return this; + } + + public Builder to(String to) { + this.to = OptionalNullable.of(to); + return this; + } + + public Builder to(Optional to) { + if (to.isPresent()) { + this.to = OptionalNullable.of(to.get()); + } else { + this.to = OptionalNullable.absent(); + } + return this; + } + + public Builder to(com.auth0.client.mgmt.core.Nullable to) { + if (to.isNull()) { + this.to = OptionalNullable.ofNull(); + } else if (to.isEmpty()) { + this.to = OptionalNullable.absent(); + } else { + this.to = OptionalNullable.of(to.get()); + } + return this; + } + + public GetDailyStatsRequestParameters build() { + return new GetDailyStatsRequestParameters(from, to, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java new file mode 100644 index 000000000..33b76c557 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEmailProviderResponseContent.Builder.class) +public final class GetEmailProviderResponseContent { + private final Optional name; + + private final Optional enabled; + + private final Optional defaultFromAddress; + + private final Optional credentials; + + private final Optional> settings; + + private final Map additionalProperties; + + private GetEmailProviderResponseContent( + Optional name, + Optional enabled, + Optional defaultFromAddress, + Optional credentials, + Optional> settings, + Map additionalProperties) { + this.name = name; + this.enabled = enabled; + this.defaultFromAddress = defaultFromAddress; + this.credentials = credentials; + this.settings = settings; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the provider is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Email address to use as "from" when no other address specified. + */ + @JsonProperty("default_from_address") + public Optional getDefaultFromAddress() { + return defaultFromAddress; + } + + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @JsonProperty("settings") + public Optional> getSettings() { + return settings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEmailProviderResponseContent && equalTo((GetEmailProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEmailProviderResponseContent other) { + return name.equals(other.name) + && enabled.equals(other.enabled) + && defaultFromAddress.equals(other.defaultFromAddress) + && credentials.equals(other.credentials) + && settings.equals(other.settings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional defaultFromAddress = Optional.empty(); + + private Optional credentials = Optional.empty(); + + private Optional> settings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetEmailProviderResponseContent other) { + name(other.getName()); + enabled(other.getEnabled()); + defaultFromAddress(other.getDefaultFromAddress()); + credentials(other.getCredentials()); + settings(other.getSettings()); + return this; + } + + /** + *

Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ */ + @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) + public Builder defaultFromAddress(Optional defaultFromAddress) { + this.defaultFromAddress = defaultFromAddress; + return this; + } + + public Builder defaultFromAddress(String defaultFromAddress) { + this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(EmailProviderCredentials credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + @JsonSetter(value = "settings", nulls = Nulls.SKIP) + public Builder settings(Optional> settings) { + this.settings = settings; + return this; + } + + public Builder settings(Map settings) { + this.settings = Optional.ofNullable(settings); + return this; + } + + public GetEmailProviderResponseContent build() { + return new GetEmailProviderResponseContent( + name, enabled, defaultFromAddress, credentials, settings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java new file mode 100644 index 000000000..8907b4e80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java @@ -0,0 +1,569 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEmailTemplateResponseContent.Builder.class) +public final class GetEmailTemplateResponseContent { + private final Optional template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private GetEmailTemplateResponseContent( + Optional template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEmailTemplateResponseContent && equalTo((GetEmailTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEmailTemplateResponseContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional template = Optional.empty(); + + private OptionalNullable body = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable enabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetEmailTemplateResponseContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(EmailTemplateNameEnum template) { + this.template = Optional.ofNullable(template); + return this; + } + + /** + *

Body of the email template.

+ */ + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + public Builder body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + public Builder body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Senders from email address.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public Builder resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + public Builder resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + public Builder resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ */ + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + public Builder subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + public Builder subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ */ + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public Builder syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + public Builder syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + public Builder syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + public Builder syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public Builder urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + public Builder urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + public Builder urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + public Builder urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public Builder includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + public Builder includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + public Builder enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + public GetEmailTemplateResponseContent build() { + return new GetEmailTemplateResponseContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java new file mode 100644 index 000000000..b56881929 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEncryptionKeyResponseContent.Builder.class) +public final class GetEncryptionKeyResponseContent { + private final String kid; + + private final EncryptionKeyType type; + + private final EncryptionKeyState state; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final String parentKid; + + private final Optional publicKey; + + private final Map additionalProperties; + + private GetEncryptionKeyResponseContent( + String kid, + EncryptionKeyType type, + EncryptionKeyState state, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + String parentKid, + Optional publicKey, + Map additionalProperties) { + this.kid = kid; + this.type = type; + this.state = state; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.parentKid = parentKid; + this.publicKey = publicKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key ID + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @JsonProperty("type") + public EncryptionKeyType getType() { + return type; + } + + @JsonProperty("state") + public EncryptionKeyState getState() { + return state; + } + + /** + * @return Key creation timestamp + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Key update timestamp + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return ID of parent wrapping key + */ + @JsonProperty("parent_kid") + public String getParentKid() { + return parentKid; + } + + /** + * @return Public key in PEM format + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEncryptionKeyResponseContent && equalTo((GetEncryptionKeyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEncryptionKeyResponseContent other) { + return kid.equals(other.kid) + && type.equals(other.type) + && state.equals(other.state) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && parentKid.equals(other.parentKid) + && publicKey.equals(other.publicKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

Key ID

+ */ + TypeStage kid(@NotNull String kid); + + Builder from(GetEncryptionKeyResponseContent other); + } + + public interface TypeStage { + StateStage type(@NotNull EncryptionKeyType type); + } + + public interface StateStage { + CreatedAtStage state(@NotNull EncryptionKeyState state); + } + + public interface CreatedAtStage { + /** + *

Key creation timestamp

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

Key update timestamp

+ */ + ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface ParentKidStage { + /** + *

ID of parent wrapping key

+ */ + _FinalStage parentKid(@NotNull String parentKid); + } + + public interface _FinalStage { + GetEncryptionKeyResponseContent build(); + + /** + *

Public key in PEM format

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements KidStage, TypeStage, StateStage, CreatedAtStage, UpdatedAtStage, ParentKidStage, _FinalStage { + private String kid; + + private EncryptionKeyType type; + + private EncryptionKeyState state; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String parentKid; + + private Optional publicKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetEncryptionKeyResponseContent other) { + kid(other.getKid()); + type(other.getType()); + state(other.getState()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + parentKid(other.getParentKid()); + publicKey(other.getPublicKey()); + return this; + } + + /** + *

Key ID

+ *

Key ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public TypeStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public StateStage type(@NotNull EncryptionKeyType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("state") + public CreatedAtStage state(@NotNull EncryptionKeyState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + /** + *

Key creation timestamp

+ *

Key creation timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Key update timestamp

+ *

Key update timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

ID of parent wrapping key

+ *

ID of parent wrapping key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parent_kid") + public _FinalStage parentKid(@NotNull String parentKid) { + this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); + return this; + } + + /** + *

Public key in PEM format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Public key in PEM format

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + @java.lang.Override + public GetEncryptionKeyResponseContent build() { + return new GetEncryptionKeyResponseContent( + kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java new file mode 100644 index 000000000..84acb36ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEventStreamDeliveryHistoryResponseContent.Builder.class) +public final class GetEventStreamDeliveryHistoryResponseContent { + private final String id; + + private final String eventStreamId; + + private final String status; + + private final EventStreamDeliveryEventTypeEnum eventType; + + private final List attempts; + + private final Optional event; + + private final Map additionalProperties; + + private GetEventStreamDeliveryHistoryResponseContent( + String id, + String eventStreamId, + String status, + EventStreamDeliveryEventTypeEnum eventType, + List attempts, + Optional event, + Map additionalProperties) { + this.id = id; + this.eventStreamId = eventStreamId; + this.status = status; + this.eventType = eventType; + this.attempts = attempts; + this.event = event; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the delivery + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("event_stream_id") + public String getEventStreamId() { + return eventStreamId; + } + + @JsonProperty("status") + public String getStatus() { + return status; + } + + @JsonProperty("event_type") + public EventStreamDeliveryEventTypeEnum getEventType() { + return eventType; + } + + /** + * @return Results of delivery attempts + */ + @JsonProperty("attempts") + public List getAttempts() { + return attempts; + } + + @JsonProperty("event") + public Optional getEvent() { + return event; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEventStreamDeliveryHistoryResponseContent + && equalTo((GetEventStreamDeliveryHistoryResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEventStreamDeliveryHistoryResponseContent other) { + return id.equals(other.id) + && eventStreamId.equals(other.eventStreamId) + && status.equals(other.status) + && eventType.equals(other.eventType) + && attempts.equals(other.attempts) + && event.equals(other.event); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Unique identifier for the delivery

+ */ + EventStreamIdStage id(@NotNull String id); + + Builder from(GetEventStreamDeliveryHistoryResponseContent other); + } + + public interface EventStreamIdStage { + /** + *

Unique identifier for the event stream.

+ */ + StatusStage eventStreamId(@NotNull String eventStreamId); + } + + public interface StatusStage { + EventTypeStage status(@NotNull String status); + } + + public interface EventTypeStage { + _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType); + } + + public interface _FinalStage { + GetEventStreamDeliveryHistoryResponseContent build(); + + /** + *

Results of delivery attempts

+ */ + _FinalStage attempts(List attempts); + + _FinalStage addAttempts(EventStreamDeliveryAttempt attempts); + + _FinalStage addAllAttempts(List attempts); + + _FinalStage event(Optional event); + + _FinalStage event(EventStreamCloudEvent event); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, EventStreamIdStage, StatusStage, EventTypeStage, _FinalStage { + private String id; + + private String eventStreamId; + + private String status; + + private EventStreamDeliveryEventTypeEnum eventType; + + private Optional event = Optional.empty(); + + private List attempts = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetEventStreamDeliveryHistoryResponseContent other) { + id(other.getId()); + eventStreamId(other.getEventStreamId()); + status(other.getStatus()); + eventType(other.getEventType()); + attempts(other.getAttempts()); + event(other.getEvent()); + return this; + } + + /** + *

Unique identifier for the delivery

+ *

Unique identifier for the delivery

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public EventStreamIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Unique identifier for the event stream.

+ *

Unique identifier for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_stream_id") + public StatusStage eventStreamId(@NotNull String eventStreamId) { + this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EventTypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage event(EventStreamCloudEvent event) { + this.event = Optional.ofNullable(event); + return this; + } + + @java.lang.Override + @JsonSetter(value = "event", nulls = Nulls.SKIP) + public _FinalStage event(Optional event) { + this.event = event; + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllAttempts(List attempts) { + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + /** + *

Results of delivery attempts

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { + this.attempts.add(attempts); + return this; + } + + /** + *

Results of delivery attempts

+ */ + @java.lang.Override + @JsonSetter(value = "attempts", nulls = Nulls.SKIP) + public _FinalStage attempts(List attempts) { + this.attempts.clear(); + if (attempts != null) { + this.attempts.addAll(attempts); + } + return this; + } + + @java.lang.Override + public GetEventStreamDeliveryHistoryResponseContent build() { + return new GetEventStreamDeliveryHistoryResponseContent( + id, eventStreamId, status, eventType, attempts, event, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java new file mode 100644 index 000000000..ca3fd3d8e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GetEventStreamResponseContent.Deserializer.class) +public final class GetEventStreamResponseContent { + private final Object value; + + private final int type; + + private GetEventStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookResponseContent) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamEventBridgeResponseContent) this.value); + } else if (this.type == 2) { + return visitor.visit((EventStreamActionResponseContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEventStreamResponseContent && equalTo((GetEventStreamResponseContent) other); + } + + private boolean equalTo(GetEventStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GetEventStreamResponseContent of(EventStreamWebhookResponseContent value) { + return new GetEventStreamResponseContent(value, 0); + } + + public static GetEventStreamResponseContent of(EventStreamEventBridgeResponseContent value) { + return new GetEventStreamResponseContent(value, 1); + } + + public static GetEventStreamResponseContent of(EventStreamActionResponseContent value) { + return new GetEventStreamResponseContent(value, 2); + } + + public interface Visitor { + T visit(EventStreamWebhookResponseContent value); + + T visit(EventStreamEventBridgeResponseContent value); + + T visit(EventStreamActionResponseContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GetEventStreamResponseContent.class); + } + + @java.lang.Override + public GetEventStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamEventBridgeResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamActionResponseContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamStatsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamStatsResponseContent.java new file mode 100644 index 000000000..888558665 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamStatsResponseContent.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEventStreamStatsResponseContent.Builder.class) +public final class GetEventStreamStatsResponseContent { + private final String id; + + private final String name; + + private final EventStreamWindow window; + + private final List buckets; + + private final List metrics; + + private final Map additionalProperties; + + private GetEventStreamStatsResponseContent( + String id, + String name, + EventStreamWindow window, + List buckets, + List metrics, + Map additionalProperties) { + this.id = id; + this.name = name; + this.window = window; + this.buckets = buckets; + this.metrics = metrics; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the event stream. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("window") + public EventStreamWindow getWindow() { + return window; + } + + /** + * @return Array of timestamp strings representing bucket boundaries. + */ + @JsonProperty("buckets") + public List getBuckets() { + return buckets; + } + + /** + * @return Array of metrics for the event stream. + */ + @JsonProperty("metrics") + public List getMetrics() { + return metrics; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetEventStreamStatsResponseContent + && equalTo((GetEventStreamStatsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEventStreamStatsResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && window.equals(other.window) + && buckets.equals(other.buckets) + && metrics.equals(other.metrics); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.window, this.buckets, this.metrics); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Unique identifier for the event stream.

+ */ + NameStage id(@NotNull String id); + + Builder from(GetEventStreamStatsResponseContent other); + } + + public interface NameStage { + /** + *

Name of the event stream.

+ */ + WindowStage name(@NotNull String name); + } + + public interface WindowStage { + _FinalStage window(@NotNull EventStreamWindow window); + } + + public interface _FinalStage { + GetEventStreamStatsResponseContent build(); + + /** + *

Array of timestamp strings representing bucket boundaries.

+ */ + _FinalStage buckets(List buckets); + + _FinalStage addBuckets(OffsetDateTime buckets); + + _FinalStage addAllBuckets(List buckets); + + /** + *

Array of metrics for the event stream.

+ */ + _FinalStage metrics(List metrics); + + _FinalStage addMetrics(EventStreamMetric metrics); + + _FinalStage addAllMetrics(List metrics); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, WindowStage, _FinalStage { + private String id; + + private String name; + + private EventStreamWindow window; + + private List metrics = new ArrayList<>(); + + private List buckets = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetEventStreamStatsResponseContent other) { + id(other.getId()); + name(other.getName()); + window(other.getWindow()); + buckets(other.getBuckets()); + metrics(other.getMetrics()); + return this; + } + + /** + *

Unique identifier for the event stream.

+ *

Unique identifier for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Name of the event stream.

+ *

Name of the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public WindowStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("window") + public _FinalStage window(@NotNull EventStreamWindow window) { + this.window = Objects.requireNonNull(window, "window must not be null"); + return this; + } + + /** + *

Array of metrics for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllMetrics(List metrics) { + if (metrics != null) { + this.metrics.addAll(metrics); + } + return this; + } + + /** + *

Array of metrics for the event stream.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addMetrics(EventStreamMetric metrics) { + this.metrics.add(metrics); + return this; + } + + /** + *

Array of metrics for the event stream.

+ */ + @java.lang.Override + @JsonSetter(value = "metrics", nulls = Nulls.SKIP) + public _FinalStage metrics(List metrics) { + this.metrics.clear(); + if (metrics != null) { + this.metrics.addAll(metrics); + } + return this; + } + + /** + *

Array of timestamp strings representing bucket boundaries.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllBuckets(List buckets) { + if (buckets != null) { + this.buckets.addAll(buckets); + } + return this; + } + + /** + *

Array of timestamp strings representing bucket boundaries.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addBuckets(OffsetDateTime buckets) { + this.buckets.add(buckets); + return this; + } + + /** + *

Array of timestamp strings representing bucket boundaries.

+ */ + @java.lang.Override + @JsonSetter(value = "buckets", nulls = Nulls.SKIP) + public _FinalStage buckets(List buckets) { + this.buckets.clear(); + if (buckets != null) { + this.buckets.addAll(buckets); + } + return this; + } + + @java.lang.Override + public GetEventStreamStatsResponseContent build() { + return new GetEventStreamStatsResponseContent(id, name, window, buckets, metrics, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java new file mode 100644 index 000000000..c30bb03d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java @@ -0,0 +1,437 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFlowExecutionResponseContent.Builder.class) +public final class GetFlowExecutionResponseContent { + private final String id; + + private final String traceId; + + private final Optional journeyId; + + private final String status; + + private final Optional> debug; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional startedAt; + + private final Optional endedAt; + + private final Map additionalProperties; + + private GetFlowExecutionResponseContent( + String id, + String traceId, + Optional journeyId, + String status, + Optional> debug, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional startedAt, + Optional endedAt, + Map additionalProperties) { + this.id = id; + this.traceId = traceId; + this.journeyId = journeyId; + this.status = status; + this.debug = debug; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.startedAt = startedAt; + this.endedAt = endedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flow execution identifier + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Trace id + */ + @JsonProperty("trace_id") + public String getTraceId() { + return traceId; + } + + /** + * @return Journey id + */ + @JsonProperty("journey_id") + public Optional getJourneyId() { + return journeyId; + } + + /** + * @return Execution status + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + @JsonProperty("debug") + public Optional> getDebug() { + return debug; + } + + /** + * @return The ISO 8601 formatted date when this flow execution was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution started. + */ + @JsonProperty("started_at") + public Optional getStartedAt() { + return startedAt; + } + + /** + * @return The ISO 8601 formatted date when this flow execution ended. + */ + @JsonProperty("ended_at") + public Optional getEndedAt() { + return endedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFlowExecutionResponseContent && equalTo((GetFlowExecutionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFlowExecutionResponseContent other) { + return id.equals(other.id) + && traceId.equals(other.traceId) + && journeyId.equals(other.journeyId) + && status.equals(other.status) + && debug.equals(other.debug) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && startedAt.equals(other.startedAt) + && endedAt.equals(other.endedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.traceId, + this.journeyId, + this.status, + this.debug, + this.createdAt, + this.updatedAt, + this.startedAt, + this.endedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flow execution identifier

+ */ + TraceIdStage id(@NotNull String id); + + Builder from(GetFlowExecutionResponseContent other); + } + + public interface TraceIdStage { + /** + *

Trace id

+ */ + StatusStage traceId(@NotNull String traceId); + } + + public interface StatusStage { + /** + *

Execution status

+ */ + CreatedAtStage status(@NotNull String status); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this flow execution was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this flow execution was updated.

+ */ + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + GetFlowExecutionResponseContent build(); + + /** + *

Journey id

+ */ + _FinalStage journeyId(Optional journeyId); + + _FinalStage journeyId(String journeyId); + + _FinalStage debug(Optional> debug); + + _FinalStage debug(Map debug); + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ */ + _FinalStage startedAt(Optional startedAt); + + _FinalStage startedAt(OffsetDateTime startedAt); + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ */ + _FinalStage endedAt(Optional endedAt); + + _FinalStage endedAt(OffsetDateTime endedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TraceIdStage, StatusStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String traceId; + + private String status; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional endedAt = Optional.empty(); + + private Optional startedAt = Optional.empty(); + + private Optional> debug = Optional.empty(); + + private Optional journeyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetFlowExecutionResponseContent other) { + id(other.getId()); + traceId(other.getTraceId()); + journeyId(other.getJourneyId()); + status(other.getStatus()); + debug(other.getDebug()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + startedAt(other.getStartedAt()); + endedAt(other.getEndedAt()); + return this; + } + + /** + *

Flow execution identifier

+ *

Flow execution identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public TraceIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Trace id

+ *

Trace id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("trace_id") + public StatusStage traceId(@NotNull String traceId) { + this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); + return this; + } + + /** + *

Execution status

+ *

Execution status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public CreatedAtStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution was created.

+ *

The ISO 8601 formatted date when this flow execution was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution was updated.

+ *

The ISO 8601 formatted date when this flow execution was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage endedAt(OffsetDateTime endedAt) { + this.endedAt = Optional.ofNullable(endedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution ended.

+ */ + @java.lang.Override + @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) + public _FinalStage endedAt(Optional endedAt) { + this.endedAt = endedAt; + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startedAt(OffsetDateTime startedAt) { + this.startedAt = Optional.ofNullable(startedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this flow execution started.

+ */ + @java.lang.Override + @JsonSetter(value = "started_at", nulls = Nulls.SKIP) + public _FinalStage startedAt(Optional startedAt) { + this.startedAt = startedAt; + return this; + } + + @java.lang.Override + public _FinalStage debug(Map debug) { + this.debug = Optional.ofNullable(debug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "debug", nulls = Nulls.SKIP) + public _FinalStage debug(Optional> debug) { + this.debug = debug; + return this; + } + + /** + *

Journey id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage journeyId(String journeyId) { + this.journeyId = Optional.ofNullable(journeyId); + return this; + } + + /** + *

Journey id

+ */ + @java.lang.Override + @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) + public _FinalStage journeyId(Optional journeyId) { + this.journeyId = journeyId; + return this; + } + + @java.lang.Override + public GetFlowExecutionResponseContent build() { + return new GetFlowExecutionResponseContent( + id, + traceId, + journeyId, + status, + debug, + createdAt, + updatedAt, + startedAt, + endedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java new file mode 100644 index 000000000..e526c2f07 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFlowRequestParameters.Builder.class) +public final class GetFlowRequestParameters { + private final Optional> hydrate; + + private final Map additionalProperties; + + private GetFlowRequestParameters( + Optional> hydrate, Map additionalProperties) { + this.hydrate = hydrate; + this.additionalProperties = additionalProperties; + } + + /** + * @return hydration param + */ + @JsonIgnore + public Optional> getHydrate() { + if (hydrate == null) { + return Optional.empty(); + } + return hydrate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hydrate") + private Optional> _getHydrate() { + return hydrate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFlowRequestParameters && equalTo((GetFlowRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFlowRequestParameters other) { + return hydrate.equals(other.hydrate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hydrate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hydrate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetFlowRequestParameters other) { + hydrate(other.getHydrate()); + return this; + } + + /** + *

hydration param

+ */ + @JsonSetter(value = "hydrate", nulls = Nulls.SKIP) + public Builder hydrate(@Nullable Optional> hydrate) { + this.hydrate = hydrate; + return this; + } + + public Builder hydrate(List hydrate) { + this.hydrate = Optional.ofNullable(hydrate); + return this; + } + + public Builder hydrate(com.auth0.client.mgmt.core.Nullable> hydrate) { + if (hydrate.isNull()) { + this.hydrate = null; + } else if (hydrate.isEmpty()) { + this.hydrate = Optional.empty(); + } else { + this.hydrate = Optional.of(hydrate.get()); + } + return this; + } + + public Builder hydrate(GetFlowRequestParametersHydrateEnum hydrate) { + this.hydrate = Optional.of(Collections.singletonList(hydrate)); + return this; + } + + public GetFlowRequestParameters build() { + return new GetFlowRequestParameters(hydrate, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java new file mode 100644 index 000000000..cbed07c94 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GetFlowRequestParametersHydrateEnum { + public static final GetFlowRequestParametersHydrateEnum FORM_COUNT = + new GetFlowRequestParametersHydrateEnum(Value.FORM_COUNT, "form_count"); + + public static final GetFlowRequestParametersHydrateEnum FORMS = + new GetFlowRequestParametersHydrateEnum(Value.FORMS, "forms"); + + private final Value value; + + private final String string; + + GetFlowRequestParametersHydrateEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GetFlowRequestParametersHydrateEnum + && this.string.equals(((GetFlowRequestParametersHydrateEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FORM_COUNT: + return visitor.visitFormCount(); + case FORMS: + return visitor.visitForms(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GetFlowRequestParametersHydrateEnum valueOf(String value) { + switch (value) { + case "form_count": + return FORM_COUNT; + case "forms": + return FORMS; + default: + return new GetFlowRequestParametersHydrateEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + FORM_COUNT, + + FORMS, + + UNKNOWN + } + + public interface Visitor { + T visitFormCount(); + + T visitForms(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java new file mode 100644 index 000000000..5f7ca895d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFlowResponseContent.Builder.class) +public final class GetFlowResponseContent { + private final String id; + + private final String name; + + private final Optional> actions; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional executedAt; + + private final Map additionalProperties; + + private GetFlowResponseContent( + String id, + String name, + Optional> actions, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional executedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.actions = actions; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.executedAt = executedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("executed_at") + public Optional getExecutedAt() { + return executedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFlowResponseContent && equalTo((GetFlowResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFlowResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && actions.equals(other.actions) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && executedAt.equals(other.executedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(GetFlowResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + GetFlowResponseContent build(); + + _FinalStage actions(Optional> actions); + + _FinalStage actions(List actions); + + _FinalStage executedAt(Optional executedAt); + + _FinalStage executedAt(String executedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional executedAt = Optional.empty(); + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetFlowResponseContent other) { + id(other.getId()); + name(other.getName()); + actions(other.getActions()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + executedAt(other.getExecutedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage executedAt(String executedAt) { + this.executedAt = Optional.ofNullable(executedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) + public _FinalStage executedAt(Optional executedAt) { + this.executedAt = executedAt; + return this; + } + + @java.lang.Override + public _FinalStage actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public _FinalStage actions(Optional> actions) { + this.actions = actions; + return this; + } + + @java.lang.Override + public GetFlowResponseContent build() { + return new GetFlowResponseContent( + id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java new file mode 100644 index 000000000..0370436da --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFormRequestParameters.Builder.class) +public final class GetFormRequestParameters { + private final Optional> hydrate; + + private final Map additionalProperties; + + private GetFormRequestParameters( + Optional> hydrate, Map additionalProperties) { + this.hydrate = hydrate; + this.additionalProperties = additionalProperties; + } + + /** + * @return Query parameter to hydrate the response with additional data + */ + @JsonIgnore + public Optional> getHydrate() { + if (hydrate == null) { + return Optional.empty(); + } + return hydrate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hydrate") + private Optional> _getHydrate() { + return hydrate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFormRequestParameters && equalTo((GetFormRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFormRequestParameters other) { + return hydrate.equals(other.hydrate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hydrate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hydrate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetFormRequestParameters other) { + hydrate(other.getHydrate()); + return this; + } + + /** + *

Query parameter to hydrate the response with additional data

+ */ + @JsonSetter(value = "hydrate", nulls = Nulls.SKIP) + public Builder hydrate(@Nullable Optional> hydrate) { + this.hydrate = hydrate; + return this; + } + + public Builder hydrate(List hydrate) { + this.hydrate = Optional.ofNullable(hydrate); + return this; + } + + public Builder hydrate(com.auth0.client.mgmt.core.Nullable> hydrate) { + if (hydrate.isNull()) { + this.hydrate = null; + } else if (hydrate.isEmpty()) { + this.hydrate = Optional.empty(); + } else { + this.hydrate = Optional.of(hydrate.get()); + } + return this; + } + + public Builder hydrate(FormsRequestParametersHydrateEnum hydrate) { + this.hydrate = Optional.of(Collections.singletonList(hydrate)); + return this; + } + + public GetFormRequestParameters build() { + return new GetFormRequestParameters(hydrate, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java new file mode 100644 index 000000000..61007ec41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFormResponseContent.Builder.class) +public final class GetFormResponseContent { + private final String id; + + private final String name; + + private final Optional messages; + + private final Optional languages; + + private final Optional> translations; + + private final Optional> nodes; + + private final Optional start; + + private final Optional ending; + + private final Optional style; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional embeddedAt; + + private final Optional submittedAt; + + private final Map additionalProperties; + + private GetFormResponseContent( + String id, + String name, + Optional messages, + Optional languages, + Optional> translations, + Optional> nodes, + Optional start, + Optional ending, + Optional style, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional embeddedAt, + Optional submittedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.messages = messages; + this.languages = languages; + this.translations = translations; + this.nodes = nodes; + this.start = start; + this.ending = ending; + this.style = style; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.embeddedAt = embeddedAt; + this.submittedAt = submittedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("messages") + public Optional getMessages() { + return messages; + } + + @JsonProperty("languages") + public Optional getLanguages() { + return languages; + } + + @JsonProperty("translations") + public Optional> getTranslations() { + return translations; + } + + @JsonProperty("nodes") + public Optional> getNodes() { + return nodes; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("ending") + public Optional getEnding() { + return ending; + } + + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("embedded_at") + public Optional getEmbeddedAt() { + return embeddedAt; + } + + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFormResponseContent && equalTo((GetFormResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFormResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && messages.equals(other.messages) + && languages.equals(other.languages) + && translations.equals(other.translations) + && nodes.equals(other.nodes) + && start.equals(other.start) + && ending.equals(other.ending) + && style.equals(other.style) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && embeddedAt.equals(other.embeddedAt) + && submittedAt.equals(other.submittedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.messages, + this.languages, + this.translations, + this.nodes, + this.start, + this.ending, + this.style, + this.createdAt, + this.updatedAt, + this.embeddedAt, + this.submittedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(GetFormResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + GetFormResponseContent build(); + + _FinalStage messages(Optional messages); + + _FinalStage messages(FormMessages messages); + + _FinalStage languages(Optional languages); + + _FinalStage languages(FormLanguages languages); + + _FinalStage translations(Optional> translations); + + _FinalStage translations(Map translations); + + _FinalStage nodes(Optional> nodes); + + _FinalStage nodes(List nodes); + + _FinalStage start(Optional start); + + _FinalStage start(FormStartNode start); + + _FinalStage ending(Optional ending); + + _FinalStage ending(FormEndingNode ending); + + _FinalStage style(Optional style); + + _FinalStage style(FormStyle style); + + _FinalStage embeddedAt(Optional embeddedAt); + + _FinalStage embeddedAt(String embeddedAt); + + _FinalStage submittedAt(Optional submittedAt); + + _FinalStage submittedAt(String submittedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional submittedAt = Optional.empty(); + + private Optional embeddedAt = Optional.empty(); + + private Optional style = Optional.empty(); + + private Optional ending = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional> nodes = Optional.empty(); + + private Optional> translations = Optional.empty(); + + private Optional languages = Optional.empty(); + + private Optional messages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetFormResponseContent other) { + id(other.getId()); + name(other.getName()); + messages(other.getMessages()); + languages(other.getLanguages()); + translations(other.getTranslations()); + nodes(other.getNodes()); + start(other.getStart()); + ending(other.getEnding()); + style(other.getStyle()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + embeddedAt(other.getEmbeddedAt()); + submittedAt(other.getSubmittedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage submittedAt(String submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) + public _FinalStage submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + @java.lang.Override + public _FinalStage embeddedAt(String embeddedAt) { + this.embeddedAt = Optional.ofNullable(embeddedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) + public _FinalStage embeddedAt(Optional embeddedAt) { + this.embeddedAt = embeddedAt; + return this; + } + + @java.lang.Override + public _FinalStage style(FormStyle style) { + this.style = Optional.ofNullable(style); + return this; + } + + @java.lang.Override + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public _FinalStage style(Optional style) { + this.style = style; + return this; + } + + @java.lang.Override + public _FinalStage ending(FormEndingNode ending) { + this.ending = Optional.ofNullable(ending); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ending", nulls = Nulls.SKIP) + public _FinalStage ending(Optional ending) { + this.ending = ending; + return this; + } + + @java.lang.Override + public _FinalStage start(FormStartNode start) { + this.start = Optional.ofNullable(start); + return this; + } + + @java.lang.Override + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public _FinalStage start(Optional start) { + this.start = start; + return this; + } + + @java.lang.Override + public _FinalStage nodes(List nodes) { + this.nodes = Optional.ofNullable(nodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nodes", nulls = Nulls.SKIP) + public _FinalStage nodes(Optional> nodes) { + this.nodes = nodes; + return this; + } + + @java.lang.Override + public _FinalStage translations(Map translations) { + this.translations = Optional.ofNullable(translations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "translations", nulls = Nulls.SKIP) + public _FinalStage translations(Optional> translations) { + this.translations = translations; + return this; + } + + @java.lang.Override + public _FinalStage languages(FormLanguages languages) { + this.languages = Optional.ofNullable(languages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "languages", nulls = Nulls.SKIP) + public _FinalStage languages(Optional languages) { + this.languages = languages; + return this; + } + + @java.lang.Override + public _FinalStage messages(FormMessages messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public _FinalStage messages(Optional messages) { + this.messages = messages; + return this; + } + + @java.lang.Override + public GetFormResponseContent build() { + return new GetFormResponseContent( + id, + name, + messages, + languages, + translations, + nodes, + start, + ending, + style, + createdAt, + updatedAt, + embeddedAt, + submittedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java new file mode 100644 index 000000000..bf2dcd0a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java @@ -0,0 +1,339 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianEnrollmentResponseContent.Builder.class) +public final class GetGuardianEnrollmentResponseContent { + private final String id; + + private final Optional status; + + private final Optional name; + + private final Optional identifier; + + private final Optional phoneNumber; + + private final Optional enrolledAt; + + private final Optional lastAuth; + + private final Map additionalProperties; + + private GetGuardianEnrollmentResponseContent( + String id, + Optional status, + Optional name, + Optional identifier, + Optional phoneNumber, + Optional enrolledAt, + Optional lastAuth, + Map additionalProperties) { + this.id = id; + this.status = status; + this.name = name; + this.identifier = identifier; + this.phoneNumber = phoneNumber; + this.enrolledAt = enrolledAt; + this.lastAuth = lastAuth; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this enrollment. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Device name (only for push notification). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Device identifier. This is usually the phone identifier. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return Phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("enrolled_at") + public Optional getEnrolledAt() { + return enrolledAt; + } + + @JsonProperty("last_auth") + public Optional getLastAuth() { + return lastAuth; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianEnrollmentResponseContent + && equalTo((GetGuardianEnrollmentResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianEnrollmentResponseContent other) { + return id.equals(other.id) + && status.equals(other.status) + && name.equals(other.name) + && identifier.equals(other.identifier) + && phoneNumber.equals(other.phoneNumber) + && enrolledAt.equals(other.enrolledAt) + && lastAuth.equals(other.lastAuth); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.status, this.name, this.identifier, this.phoneNumber, this.enrolledAt, this.lastAuth); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

ID for this enrollment.

+ */ + _FinalStage id(@NotNull String id); + + Builder from(GetGuardianEnrollmentResponseContent other); + } + + public interface _FinalStage { + GetGuardianEnrollmentResponseContent build(); + + _FinalStage status(Optional status); + + _FinalStage status(GuardianEnrollmentStatus status); + + /** + *

Device name (only for push notification).

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Device identifier. This is usually the phone identifier.

+ */ + _FinalStage identifier(Optional identifier); + + _FinalStage identifier(String identifier); + + /** + *

Phone number.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage enrolledAt(Optional enrolledAt); + + _FinalStage enrolledAt(String enrolledAt); + + _FinalStage lastAuth(Optional lastAuth); + + _FinalStage lastAuth(String lastAuth); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional lastAuth = Optional.empty(); + + private Optional enrolledAt = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetGuardianEnrollmentResponseContent other) { + id(other.getId()); + status(other.getStatus()); + name(other.getName()); + identifier(other.getIdentifier()); + phoneNumber(other.getPhoneNumber()); + enrolledAt(other.getEnrolledAt()); + lastAuth(other.getLastAuth()); + return this; + } + + /** + *

ID for this enrollment.

+ *

ID for this enrollment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage lastAuth(String lastAuth) { + this.lastAuth = Optional.ofNullable(lastAuth); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_auth", nulls = Nulls.SKIP) + public _FinalStage lastAuth(Optional lastAuth) { + this.lastAuth = lastAuth; + return this; + } + + @java.lang.Override + public _FinalStage enrolledAt(String enrolledAt) { + this.enrolledAt = Optional.ofNullable(enrolledAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) + public _FinalStage enrolledAt(Optional enrolledAt) { + this.enrolledAt = enrolledAt; + return this; + } + + /** + *

Phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Phone number.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

Device identifier. This is usually the phone identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

Device identifier. This is usually the phone identifier.

+ */ + @java.lang.Override + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public _FinalStage identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + /** + *

Device name (only for push notification).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Device name (only for push notification).

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage status(GuardianEnrollmentStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public GetGuardianEnrollmentResponseContent build() { + return new GetGuardianEnrollmentResponseContent( + id, status, name, identifier, phoneNumber, enrolledAt, lastAuth, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java new file mode 100644 index 000000000..a400b0fd0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorDuoSettingsResponseContent.Builder.class) +public final class GetGuardianFactorDuoSettingsResponseContent { + private final Optional ikey; + + private final Optional skey; + + private final Optional host; + + private final Map additionalProperties; + + private GetGuardianFactorDuoSettingsResponseContent( + Optional ikey, + Optional skey, + Optional host, + Map additionalProperties) { + this.ikey = ikey; + this.skey = skey; + this.host = host; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ikey") + public Optional getIkey() { + return ikey; + } + + @JsonProperty("skey") + public Optional getSkey() { + return skey; + } + + @JsonProperty("host") + public Optional getHost() { + return host; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorDuoSettingsResponseContent + && equalTo((GetGuardianFactorDuoSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorDuoSettingsResponseContent other) { + return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ikey, this.skey, this.host); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ikey = Optional.empty(); + + private Optional skey = Optional.empty(); + + private Optional host = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorDuoSettingsResponseContent other) { + ikey(other.getIkey()); + skey(other.getSkey()); + host(other.getHost()); + return this; + } + + @JsonSetter(value = "ikey", nulls = Nulls.SKIP) + public Builder ikey(Optional ikey) { + this.ikey = ikey; + return this; + } + + public Builder ikey(String ikey) { + this.ikey = Optional.ofNullable(ikey); + return this; + } + + @JsonSetter(value = "skey", nulls = Nulls.SKIP) + public Builder skey(Optional skey) { + this.skey = skey; + return this; + } + + public Builder skey(String skey) { + this.skey = Optional.ofNullable(skey); + return this; + } + + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + public GetGuardianFactorDuoSettingsResponseContent build() { + return new GetGuardianFactorDuoSettingsResponseContent(ikey, skey, host, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java new file mode 100644 index 000000000..9cd64efc5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorPhoneMessageTypesResponseContent.Builder.class) +public final class GetGuardianFactorPhoneMessageTypesResponseContent { + private final Optional> messageTypes; + + private final Map additionalProperties; + + private GetGuardianFactorPhoneMessageTypesResponseContent( + Optional> messageTypes, + Map additionalProperties) { + this.messageTypes = messageTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The list of phone factors to enable on the tenant. Can include sms and voice. + */ + @JsonProperty("message_types") + public Optional> getMessageTypes() { + return messageTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorPhoneMessageTypesResponseContent + && equalTo((GetGuardianFactorPhoneMessageTypesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorPhoneMessageTypesResponseContent other) { + return messageTypes.equals(other.messageTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.messageTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> messageTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorPhoneMessageTypesResponseContent other) { + messageTypes(other.getMessageTypes()); + return this; + } + + /** + *

The list of phone factors to enable on the tenant. Can include sms and voice.

+ */ + @JsonSetter(value = "message_types", nulls = Nulls.SKIP) + public Builder messageTypes(Optional> messageTypes) { + this.messageTypes = messageTypes; + return this; + } + + public Builder messageTypes(List messageTypes) { + this.messageTypes = Optional.ofNullable(messageTypes); + return this; + } + + public GetGuardianFactorPhoneMessageTypesResponseContent build() { + return new GetGuardianFactorPhoneMessageTypesResponseContent(messageTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java new file mode 100644 index 000000000..5a1c1ca0a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorPhoneTemplatesResponseContent.Builder.class) +public final class GetGuardianFactorPhoneTemplatesResponseContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private GetGuardianFactorPhoneTemplatesResponseContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorPhoneTemplatesResponseContent + && equalTo((GetGuardianFactorPhoneTemplatesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorPhoneTemplatesResponseContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(GetGuardianFactorPhoneTemplatesResponseContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + GetGuardianFactorPhoneTemplatesResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetGuardianFactorPhoneTemplatesResponseContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public GetGuardianFactorPhoneTemplatesResponseContent build() { + return new GetGuardianFactorPhoneTemplatesResponseContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java new file mode 100644 index 000000000..e6402e537 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorSmsTemplatesResponseContent.Builder.class) +public final class GetGuardianFactorSmsTemplatesResponseContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private GetGuardianFactorSmsTemplatesResponseContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorSmsTemplatesResponseContent + && equalTo((GetGuardianFactorSmsTemplatesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorSmsTemplatesResponseContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(GetGuardianFactorSmsTemplatesResponseContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + GetGuardianFactorSmsTemplatesResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetGuardianFactorSmsTemplatesResponseContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public GetGuardianFactorSmsTemplatesResponseContent build() { + return new GetGuardianFactorSmsTemplatesResponseContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java new file mode 100644 index 000000000..96f717c2b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderApnsResponseContent.Builder.class) +public final class GetGuardianFactorsProviderApnsResponseContent { + private final OptionalNullable bundleId; + + private final Optional sandbox; + + private final Optional enabled; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderApnsResponseContent( + OptionalNullable bundleId, + Optional sandbox, + Optional enabled, + Map additionalProperties) { + this.bundleId = bundleId; + this.sandbox = sandbox; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + public OptionalNullable getBundleId() { + if (bundleId == null) { + return OptionalNullable.absent(); + } + return bundleId; + } + + @JsonProperty("sandbox") + public Optional getSandbox() { + return sandbox; + } + + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + private OptionalNullable _getBundleId() { + return bundleId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderApnsResponseContent + && equalTo((GetGuardianFactorsProviderApnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderApnsResponseContent other) { + return bundleId.equals(other.bundleId) && sandbox.equals(other.sandbox) && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bundleId, this.sandbox, this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable bundleId = OptionalNullable.absent(); + + private Optional sandbox = Optional.empty(); + + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderApnsResponseContent other) { + bundleId(other.getBundleId()); + sandbox(other.getSandbox()); + enabled(other.getEnabled()); + return this; + } + + @JsonSetter(value = "bundle_id", nulls = Nulls.SKIP) + public Builder bundleId(@Nullable OptionalNullable bundleId) { + this.bundleId = bundleId; + return this; + } + + public Builder bundleId(String bundleId) { + this.bundleId = OptionalNullable.of(bundleId); + return this; + } + + public Builder bundleId(Optional bundleId) { + if (bundleId.isPresent()) { + this.bundleId = OptionalNullable.of(bundleId.get()); + } else { + this.bundleId = OptionalNullable.absent(); + } + return this; + } + + public Builder bundleId(com.auth0.client.mgmt.core.Nullable bundleId) { + if (bundleId.isNull()) { + this.bundleId = OptionalNullable.ofNull(); + } else if (bundleId.isEmpty()) { + this.bundleId = OptionalNullable.absent(); + } else { + this.bundleId = OptionalNullable.of(bundleId.get()); + } + return this; + } + + @JsonSetter(value = "sandbox", nulls = Nulls.SKIP) + public Builder sandbox(Optional sandbox) { + this.sandbox = sandbox; + return this; + } + + public Builder sandbox(Boolean sandbox) { + this.sandbox = Optional.ofNullable(sandbox); + return this; + } + + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public GetGuardianFactorsProviderApnsResponseContent build() { + return new GetGuardianFactorsProviderApnsResponseContent(bundleId, sandbox, enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java new file mode 100644 index 000000000..5b13c1cc4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderPhoneResponseContent.Builder.class) +public final class GetGuardianFactorsProviderPhoneResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderPhoneResponseContent( + Optional provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderPhoneResponseContent + && equalTo((GetGuardianFactorsProviderPhoneResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderPhoneResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderPhoneResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public GetGuardianFactorsProviderPhoneResponseContent build() { + return new GetGuardianFactorsProviderPhoneResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java new file mode 100644 index 000000000..7d7d0543f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderPhoneTwilioResponseContent.Builder.class) +public final class GetGuardianFactorsProviderPhoneTwilioResponseContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderPhoneTwilioResponseContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderPhoneTwilioResponseContent + && equalTo((GetGuardianFactorsProviderPhoneTwilioResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderPhoneTwilioResponseContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderPhoneTwilioResponseContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public GetGuardianFactorsProviderPhoneTwilioResponseContent build() { + return new GetGuardianFactorsProviderPhoneTwilioResponseContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java new file mode 100644 index 000000000..ac65d4e65 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderPushNotificationResponseContent.Builder.class) +public final class GetGuardianFactorsProviderPushNotificationResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderPushNotificationResponseContent( + Optional provider, + Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderPushNotificationResponseContent + && equalTo((GetGuardianFactorsProviderPushNotificationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderPushNotificationResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderPushNotificationResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderPushNotificationProviderDataEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public GetGuardianFactorsProviderPushNotificationResponseContent build() { + return new GetGuardianFactorsProviderPushNotificationResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java new file mode 100644 index 000000000..3a720f8c7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderSmsResponseContent.Builder.class) +public final class GetGuardianFactorsProviderSmsResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderSmsResponseContent( + Optional provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderSmsResponseContent + && equalTo((GetGuardianFactorsProviderSmsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderSmsResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderSmsResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public GetGuardianFactorsProviderSmsResponseContent build() { + return new GetGuardianFactorsProviderSmsResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java new file mode 100644 index 000000000..49e7e495c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderSmsTwilioResponseContent.Builder.class) +public final class GetGuardianFactorsProviderSmsTwilioResponseContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderSmsTwilioResponseContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderSmsTwilioResponseContent + && equalTo((GetGuardianFactorsProviderSmsTwilioResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderSmsTwilioResponseContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderSmsTwilioResponseContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public GetGuardianFactorsProviderSmsTwilioResponseContent build() { + return new GetGuardianFactorsProviderSmsTwilioResponseContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java new file mode 100644 index 000000000..7cc96727d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianFactorsProviderSnsResponseContent.Builder.class) +public final class GetGuardianFactorsProviderSnsResponseContent { + private final OptionalNullable awsAccessKeyId; + + private final OptionalNullable awsSecretAccessKey; + + private final OptionalNullable awsRegion; + + private final OptionalNullable snsApnsPlatformApplicationArn; + + private final OptionalNullable snsGcmPlatformApplicationArn; + + private final Map additionalProperties; + + private GetGuardianFactorsProviderSnsResponseContent( + OptionalNullable awsAccessKeyId, + OptionalNullable awsSecretAccessKey, + OptionalNullable awsRegion, + OptionalNullable snsApnsPlatformApplicationArn, + OptionalNullable snsGcmPlatformApplicationArn, + Map additionalProperties) { + this.awsAccessKeyId = awsAccessKeyId; + this.awsSecretAccessKey = awsSecretAccessKey; + this.awsRegion = awsRegion; + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + public OptionalNullable getAwsAccessKeyId() { + if (awsAccessKeyId == null) { + return OptionalNullable.absent(); + } + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + public OptionalNullable getAwsSecretAccessKey() { + if (awsSecretAccessKey == null) { + return OptionalNullable.absent(); + } + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + public OptionalNullable getAwsRegion() { + if (awsRegion == null) { + return OptionalNullable.absent(); + } + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + public OptionalNullable getSnsApnsPlatformApplicationArn() { + if (snsApnsPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + public OptionalNullable getSnsGcmPlatformApplicationArn() { + if (snsGcmPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsGcmPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + private OptionalNullable _getAwsAccessKeyId() { + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + private OptionalNullable _getAwsSecretAccessKey() { + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + private OptionalNullable _getAwsRegion() { + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + private OptionalNullable _getSnsApnsPlatformApplicationArn() { + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + private OptionalNullable _getSnsGcmPlatformApplicationArn() { + return snsGcmPlatformApplicationArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianFactorsProviderSnsResponseContent + && equalTo((GetGuardianFactorsProviderSnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianFactorsProviderSnsResponseContent other) { + return awsAccessKeyId.equals(other.awsAccessKeyId) + && awsSecretAccessKey.equals(other.awsSecretAccessKey) + && awsRegion.equals(other.awsRegion) + && snsApnsPlatformApplicationArn.equals(other.snsApnsPlatformApplicationArn) + && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.awsRegion, + this.snsApnsPlatformApplicationArn, + this.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable awsAccessKeyId = OptionalNullable.absent(); + + private OptionalNullable awsSecretAccessKey = OptionalNullable.absent(); + + private OptionalNullable awsRegion = OptionalNullable.absent(); + + private OptionalNullable snsApnsPlatformApplicationArn = OptionalNullable.absent(); + + private OptionalNullable snsGcmPlatformApplicationArn = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetGuardianFactorsProviderSnsResponseContent other) { + awsAccessKeyId(other.getAwsAccessKeyId()); + awsSecretAccessKey(other.getAwsSecretAccessKey()); + awsRegion(other.getAwsRegion()); + snsApnsPlatformApplicationArn(other.getSnsApnsPlatformApplicationArn()); + snsGcmPlatformApplicationArn(other.getSnsGcmPlatformApplicationArn()); + return this; + } + + @JsonSetter(value = "aws_access_key_id", nulls = Nulls.SKIP) + public Builder awsAccessKeyId(@Nullable OptionalNullable awsAccessKeyId) { + this.awsAccessKeyId = awsAccessKeyId; + return this; + } + + public Builder awsAccessKeyId(String awsAccessKeyId) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId); + return this; + } + + public Builder awsAccessKeyId(Optional awsAccessKeyId) { + if (awsAccessKeyId.isPresent()) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } else { + this.awsAccessKeyId = OptionalNullable.absent(); + } + return this; + } + + public Builder awsAccessKeyId(com.auth0.client.mgmt.core.Nullable awsAccessKeyId) { + if (awsAccessKeyId.isNull()) { + this.awsAccessKeyId = OptionalNullable.ofNull(); + } else if (awsAccessKeyId.isEmpty()) { + this.awsAccessKeyId = OptionalNullable.absent(); + } else { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } + return this; + } + + @JsonSetter(value = "aws_secret_access_key", nulls = Nulls.SKIP) + public Builder awsSecretAccessKey(@Nullable OptionalNullable awsSecretAccessKey) { + this.awsSecretAccessKey = awsSecretAccessKey; + return this; + } + + public Builder awsSecretAccessKey(String awsSecretAccessKey) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey); + return this; + } + + public Builder awsSecretAccessKey(Optional awsSecretAccessKey) { + if (awsSecretAccessKey.isPresent()) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } else { + this.awsSecretAccessKey = OptionalNullable.absent(); + } + return this; + } + + public Builder awsSecretAccessKey(com.auth0.client.mgmt.core.Nullable awsSecretAccessKey) { + if (awsSecretAccessKey.isNull()) { + this.awsSecretAccessKey = OptionalNullable.ofNull(); + } else if (awsSecretAccessKey.isEmpty()) { + this.awsSecretAccessKey = OptionalNullable.absent(); + } else { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } + return this; + } + + @JsonSetter(value = "aws_region", nulls = Nulls.SKIP) + public Builder awsRegion(@Nullable OptionalNullable awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + public Builder awsRegion(String awsRegion) { + this.awsRegion = OptionalNullable.of(awsRegion); + return this; + } + + public Builder awsRegion(Optional awsRegion) { + if (awsRegion.isPresent()) { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } else { + this.awsRegion = OptionalNullable.absent(); + } + return this; + } + + public Builder awsRegion(com.auth0.client.mgmt.core.Nullable awsRegion) { + if (awsRegion.isNull()) { + this.awsRegion = OptionalNullable.ofNull(); + } else if (awsRegion.isEmpty()) { + this.awsRegion = OptionalNullable.absent(); + } else { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } + return this; + } + + @JsonSetter(value = "sns_apns_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsApnsPlatformApplicationArn(@Nullable OptionalNullable snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + return this; + } + + public Builder snsApnsPlatformApplicationArn(String snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn); + return this; + } + + public Builder snsApnsPlatformApplicationArn(Optional snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isPresent()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsApnsPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isNull()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsApnsPlatformApplicationArn.isEmpty()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } + return this; + } + + @JsonSetter(value = "sns_gcm_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsGcmPlatformApplicationArn(@Nullable OptionalNullable snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + return this; + } + + public Builder snsGcmPlatformApplicationArn(String snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn); + return this; + } + + public Builder snsGcmPlatformApplicationArn(Optional snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isPresent()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsGcmPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isNull()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsGcmPlatformApplicationArn.isEmpty()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } + return this; + } + + public GetGuardianFactorsProviderSnsResponseContent build() { + return new GetGuardianFactorsProviderSnsResponseContent( + awsAccessKeyId, + awsSecretAccessKey, + awsRegion, + snsApnsPlatformApplicationArn, + snsGcmPlatformApplicationArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java new file mode 100644 index 000000000..3c3c39176 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetHookRequestParameters.Builder.class) +public final class GetHookRequestParameters { + private final OptionalNullable fields; + + private final Map additionalProperties; + + private GetHookRequestParameters(OptionalNullable fields, Map additionalProperties) { + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetHookRequestParameters && equalTo((GetHookRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetHookRequestParameters other) { + return fields.equals(other.fields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetHookRequestParameters other) { + fields(other.getFields()); + return this; + } + + /** + *

Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + public GetHookRequestParameters build() { + return new GetHookRequestParameters(fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java new file mode 100644 index 000000000..4c5444bd3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetHookResponseContent.Builder.class) +public final class GetHookResponseContent { + private final Optional triggerId; + + private final Optional id; + + private final Optional name; + + private final Optional enabled; + + private final Optional script; + + private final Optional> dependencies; + + private final Map additionalProperties; + + private GetHookResponseContent( + Optional triggerId, + Optional id, + Optional name, + Optional enabled, + Optional script, + Optional> dependencies, + Map additionalProperties) { + this.triggerId = triggerId; + this.id = id; + this.name = name; + this.enabled = enabled; + this.script = script; + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + /** + * @return Trigger ID + */ + @JsonProperty("triggerId") + public Optional getTriggerId() { + return triggerId; + } + + /** + * @return ID of this hook. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetHookResponseContent && equalTo((GetHookResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetHookResponseContent other) { + return triggerId.equals(other.triggerId) + && id.equals(other.id) + && name.equals(other.name) + && enabled.equals(other.enabled) + && script.equals(other.script) + && dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional triggerId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetHookResponseContent other) { + triggerId(other.getTriggerId()); + id(other.getId()); + name(other.getName()); + enabled(other.getEnabled()); + script(other.getScript()); + dependencies(other.getDependencies()); + return this; + } + + /** + *

Trigger ID

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + /** + *

ID of this hook.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this hook.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public GetHookResponseContent build() { + return new GetHookResponseContent(triggerId, id, name, enabled, script, dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java new file mode 100644 index 000000000..032a6928c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetJobErrorResponseContent.Builder.class) +public final class GetJobErrorResponseContent { + private final Optional> user; + + private final Optional> errors; + + private final Map additionalProperties; + + private GetJobErrorResponseContent( + Optional> user, + Optional> errors, + Map additionalProperties) { + this.user = user; + this.errors = errors; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user") + public Optional> getUser() { + return user; + } + + /** + * @return Errors importing the user. + */ + @JsonProperty("errors") + public Optional> getErrors() { + return errors; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetJobErrorResponseContent && equalTo((GetJobErrorResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetJobErrorResponseContent other) { + return user.equals(other.user) && errors.equals(other.errors); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.user, this.errors); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> user = Optional.empty(); + + private Optional> errors = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetJobErrorResponseContent other) { + user(other.getUser()); + errors(other.getErrors()); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(Map user) { + this.user = Optional.ofNullable(user); + return this; + } + + /** + *

Errors importing the user.

+ */ + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public Builder errors(Optional> errors) { + this.errors = errors; + return this; + } + + public Builder errors(List errors) { + this.errors = Optional.ofNullable(errors); + return this; + } + + public GetJobErrorResponseContent build() { + return new GetJobErrorResponseContent(user, errors, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java new file mode 100644 index 000000000..54163273a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetJobGenericErrorResponseContent.Builder.class) +public final class GetJobGenericErrorResponseContent { + private final String status; + + private final String type; + + private final Optional createdAt; + + private final String id; + + private final Optional connectionId; + + private final Optional statusDetails; + + private final Map additionalProperties; + + private GetJobGenericErrorResponseContent( + String status, + String type, + Optional createdAt, + String id, + Optional connectionId, + Optional statusDetails, + Map additionalProperties) { + this.status = status; + this.type = type; + this.createdAt = createdAt; + this.id = id; + this.connectionId = connectionId; + this.statusDetails = statusDetails; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of this job. + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Type of job this is. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return When this job was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return ID of this job. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return connection_id of the connection this job uses. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return Status details. + */ + @JsonProperty("status_details") + public Optional getStatusDetails() { + return statusDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetJobGenericErrorResponseContent && equalTo((GetJobGenericErrorResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetJobGenericErrorResponseContent other) { + return status.equals(other.status) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && id.equals(other.id) + && connectionId.equals(other.connectionId) + && statusDetails.equals(other.statusDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.statusDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + *

Status of this job.

+ */ + TypeStage status(@NotNull String status); + + Builder from(GetJobGenericErrorResponseContent other); + } + + public interface TypeStage { + /** + *

Type of job this is.

+ */ + IdStage type(@NotNull String type); + } + + public interface IdStage { + /** + *

ID of this job.

+ */ + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + GetJobGenericErrorResponseContent build(); + + /** + *

When this job was created.

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(String createdAt); + + /** + *

connection_id of the connection this job uses.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + + /** + *

Status details.

+ */ + _FinalStage statusDetails(Optional statusDetails); + + _FinalStage statusDetails(String statusDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, TypeStage, IdStage, _FinalStage { + private String status; + + private String type; + + private String id; + + private Optional statusDetails = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetJobGenericErrorResponseContent other) { + status(other.getStatus()); + type(other.getType()); + createdAt(other.getCreatedAt()); + id(other.getId()); + connectionId(other.getConnectionId()); + statusDetails(other.getStatusDetails()); + return this; + } + + /** + *

Status of this job.

+ *

Status of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Type of job this is.

+ *

Type of job this is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public IdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

ID of this job.

+ *

ID of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Status details.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage statusDetails(String statusDetails) { + this.statusDetails = Optional.ofNullable(statusDetails); + return this; + } + + /** + *

Status details.

+ */ + @java.lang.Override + @JsonSetter(value = "status_details", nulls = Nulls.SKIP) + public _FinalStage statusDetails(Optional statusDetails) { + this.statusDetails = statusDetails; + return this; + } + + /** + *

connection_id of the connection this job uses.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

connection_id of the connection this job uses.

+ */ + @java.lang.Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + *

When this job was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

When this job was created.

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public GetJobGenericErrorResponseContent build() { + return new GetJobGenericErrorResponseContent( + status, type, createdAt, id, connectionId, statusDetails, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java new file mode 100644 index 000000000..679232e11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetJobImportUserError.Builder.class) +public final class GetJobImportUserError { + private final Optional code; + + private final Optional message; + + private final Optional path; + + private final Map additionalProperties; + + private GetJobImportUserError( + Optional code, + Optional message, + Optional path, + Map additionalProperties) { + this.code = code; + this.message = message; + this.path = path; + this.additionalProperties = additionalProperties; + } + + /** + * @return Error code. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return Error message. + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + /** + * @return Error field. + */ + @JsonProperty("path") + public Optional getPath() { + return path; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetJobImportUserError && equalTo((GetJobImportUserError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetJobImportUserError other) { + return code.equals(other.code) && message.equals(other.message) && path.equals(other.path); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.code, this.message, this.path); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional path = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetJobImportUserError other) { + code(other.getCode()); + message(other.getMessage()); + path(other.getPath()); + return this; + } + + /** + *

Error code.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

Error message.

+ */ + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public Builder message(Optional message) { + this.message = message; + return this; + } + + public Builder message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + /** + *

Error field.

+ */ + @JsonSetter(value = "path", nulls = Nulls.SKIP) + public Builder path(Optional path) { + this.path = path; + return this; + } + + public Builder path(String path) { + this.path = Optional.ofNullable(path); + return this; + } + + public GetJobImportUserError build() { + return new GetJobImportUserError(code, message, path, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java new file mode 100644 index 000000000..8fe628481 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java @@ -0,0 +1,496 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetJobResponseContent.Builder.class) +public final class GetJobResponseContent { + private final String status; + + private final String type; + + private final Optional createdAt; + + private final String id; + + private final Optional connectionId; + + private final Optional location; + + private final Optional percentageDone; + + private final Optional timeLeftSeconds; + + private final Optional format; + + private final Optional statusDetails; + + private final Map additionalProperties; + + private GetJobResponseContent( + String status, + String type, + Optional createdAt, + String id, + Optional connectionId, + Optional location, + Optional percentageDone, + Optional timeLeftSeconds, + Optional format, + Optional statusDetails, + Map additionalProperties) { + this.status = status; + this.type = type; + this.createdAt = createdAt; + this.id = id; + this.connectionId = connectionId; + this.location = location; + this.percentageDone = percentageDone; + this.timeLeftSeconds = timeLeftSeconds; + this.format = format; + this.statusDetails = statusDetails; + this.additionalProperties = additionalProperties; + } + + /** + * @return Status of this job. + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + /** + * @return Type of job this is. + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * @return When this job was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return ID of this job. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return connection_id of the connection this job uses. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return URL to download the result of this job. + */ + @JsonProperty("location") + public Optional getLocation() { + return location; + } + + /** + * @return Completion percentage of this job. + */ + @JsonProperty("percentage_done") + public Optional getPercentageDone() { + return percentageDone; + } + + /** + * @return Estimated time remaining before job completes. + */ + @JsonProperty("time_left_seconds") + public Optional getTimeLeftSeconds() { + return timeLeftSeconds; + } + + @JsonProperty("format") + public Optional getFormat() { + return format; + } + + /** + * @return Status details. + */ + @JsonProperty("status_details") + public Optional getStatusDetails() { + return statusDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetJobResponseContent && equalTo((GetJobResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetJobResponseContent other) { + return status.equals(other.status) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && id.equals(other.id) + && connectionId.equals(other.connectionId) + && location.equals(other.location) + && percentageDone.equals(other.percentageDone) + && timeLeftSeconds.equals(other.timeLeftSeconds) + && format.equals(other.format) + && statusDetails.equals(other.statusDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.status, + this.type, + this.createdAt, + this.id, + this.connectionId, + this.location, + this.percentageDone, + this.timeLeftSeconds, + this.format, + this.statusDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + /** + *

Status of this job.

+ */ + TypeStage status(@NotNull String status); + + Builder from(GetJobResponseContent other); + } + + public interface TypeStage { + /** + *

Type of job this is.

+ */ + IdStage type(@NotNull String type); + } + + public interface IdStage { + /** + *

ID of this job.

+ */ + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + GetJobResponseContent build(); + + /** + *

When this job was created.

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(String createdAt); + + /** + *

connection_id of the connection this job uses.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + + /** + *

URL to download the result of this job.

+ */ + _FinalStage location(Optional location); + + _FinalStage location(String location); + + /** + *

Completion percentage of this job.

+ */ + _FinalStage percentageDone(Optional percentageDone); + + _FinalStage percentageDone(Integer percentageDone); + + /** + *

Estimated time remaining before job completes.

+ */ + _FinalStage timeLeftSeconds(Optional timeLeftSeconds); + + _FinalStage timeLeftSeconds(Integer timeLeftSeconds); + + _FinalStage format(Optional format); + + _FinalStage format(JobFileFormatEnum format); + + /** + *

Status details.

+ */ + _FinalStage statusDetails(Optional statusDetails); + + _FinalStage statusDetails(String statusDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, TypeStage, IdStage, _FinalStage { + private String status; + + private String type; + + private String id; + + private Optional statusDetails = Optional.empty(); + + private Optional format = Optional.empty(); + + private Optional timeLeftSeconds = Optional.empty(); + + private Optional percentageDone = Optional.empty(); + + private Optional location = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetJobResponseContent other) { + status(other.getStatus()); + type(other.getType()); + createdAt(other.getCreatedAt()); + id(other.getId()); + connectionId(other.getConnectionId()); + location(other.getLocation()); + percentageDone(other.getPercentageDone()); + timeLeftSeconds(other.getTimeLeftSeconds()); + format(other.getFormat()); + statusDetails(other.getStatusDetails()); + return this; + } + + /** + *

Status of this job.

+ *

Status of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TypeStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Type of job this is.

+ *

Type of job this is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public IdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

ID of this job.

+ *

ID of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Status details.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage statusDetails(String statusDetails) { + this.statusDetails = Optional.ofNullable(statusDetails); + return this; + } + + /** + *

Status details.

+ */ + @java.lang.Override + @JsonSetter(value = "status_details", nulls = Nulls.SKIP) + public _FinalStage statusDetails(Optional statusDetails) { + this.statusDetails = statusDetails; + return this; + } + + @java.lang.Override + public _FinalStage format(JobFileFormatEnum format) { + this.format = Optional.ofNullable(format); + return this; + } + + @java.lang.Override + @JsonSetter(value = "format", nulls = Nulls.SKIP) + public _FinalStage format(Optional format) { + this.format = format; + return this; + } + + /** + *

Estimated time remaining before job completes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage timeLeftSeconds(Integer timeLeftSeconds) { + this.timeLeftSeconds = Optional.ofNullable(timeLeftSeconds); + return this; + } + + /** + *

Estimated time remaining before job completes.

+ */ + @java.lang.Override + @JsonSetter(value = "time_left_seconds", nulls = Nulls.SKIP) + public _FinalStage timeLeftSeconds(Optional timeLeftSeconds) { + this.timeLeftSeconds = timeLeftSeconds; + return this; + } + + /** + *

Completion percentage of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage percentageDone(Integer percentageDone) { + this.percentageDone = Optional.ofNullable(percentageDone); + return this; + } + + /** + *

Completion percentage of this job.

+ */ + @java.lang.Override + @JsonSetter(value = "percentage_done", nulls = Nulls.SKIP) + public _FinalStage percentageDone(Optional percentageDone) { + this.percentageDone = percentageDone; + return this; + } + + /** + *

URL to download the result of this job.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage location(String location) { + this.location = Optional.ofNullable(location); + return this; + } + + /** + *

URL to download the result of this job.

+ */ + @java.lang.Override + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public _FinalStage location(Optional location) { + this.location = location; + return this; + } + + /** + *

connection_id of the connection this job uses.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

connection_id of the connection this job uses.

+ */ + @java.lang.Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + *

When this job was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

When this job was created.

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public GetJobResponseContent build() { + return new GetJobResponseContent( + status, + type, + createdAt, + id, + connectionId, + location, + percentageDone, + timeLeftSeconds, + format, + statusDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java new file mode 100644 index 000000000..4c479c269 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java @@ -0,0 +1,755 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetLogResponseContent.Builder.class) +public final class GetLogResponseContent { + private final Optional date; + + private final Optional type; + + private final OptionalNullable description; + + private final Optional connection; + + private final Optional connectionId; + + private final Optional clientId; + + private final Optional clientName; + + private final Optional ip; + + private final Optional hostname; + + private final Optional userId; + + private final Optional userName; + + private final Optional audience; + + private final Optional scope; + + private final Optional strategy; + + private final Optional strategyType; + + private final Optional logId; + + private final Optional isMobile; + + private final Optional> details; + + private final Optional userAgent; + + private final Optional securityContext; + + private final Optional locationInfo; + + private final Map additionalProperties; + + private GetLogResponseContent( + Optional date, + Optional type, + OptionalNullable description, + Optional connection, + Optional connectionId, + Optional clientId, + Optional clientName, + Optional ip, + Optional hostname, + Optional userId, + Optional userName, + Optional audience, + Optional scope, + Optional strategy, + Optional strategyType, + Optional logId, + Optional isMobile, + Optional> details, + Optional userAgent, + Optional securityContext, + Optional locationInfo, + Map additionalProperties) { + this.date = date; + this.type = type; + this.description = description; + this.connection = connection; + this.connectionId = connectionId; + this.clientId = clientId; + this.clientName = clientName; + this.ip = ip; + this.hostname = hostname; + this.userId = userId; + this.userName = userName; + this.audience = audience; + this.scope = scope; + this.strategy = strategy; + this.strategyType = strategyType; + this.logId = logId; + this.isMobile = isMobile; + this.details = details; + this.userAgent = userAgent; + this.securityContext = securityContext; + this.locationInfo = locationInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("date") + public Optional getDate() { + return date; + } + + /** + * @return Type of event. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Description of this event. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + public OptionalNullable getDescription() { + if (description == null) { + return OptionalNullable.absent(); + } + return description; + } + + /** + * @return Name of the connection the event relates to. + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + /** + * @return ID of the connection the event relates to. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return ID of the client (application). + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the client (application). + */ + @JsonProperty("client_name") + public Optional getClientName() { + return clientName; + } + + /** + * @return IP address of the log event source. + */ + @JsonProperty("ip") + public Optional getIp() { + return ip; + } + + /** + * @return Hostname the event applies to. + */ + @JsonProperty("hostname") + public Optional getHostname() { + return hostname; + } + + /** + * @return ID of the user involved in the event. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Name of the user involved in the event. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return API audience the event applies to. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scope permissions applied to the event. + */ + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + /** + * @return Name of the strategy involved in the event. + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Type of strategy involved in the event. + */ + @JsonProperty("strategy_type") + public Optional getStrategyType() { + return strategyType; + } + + /** + * @return Unique ID of the event. + */ + @JsonProperty("log_id") + public Optional getLogId() { + return logId; + } + + /** + * @return Whether the client was a mobile device (true) or desktop/laptop/server (false). + */ + @JsonProperty("isMobile") + public Optional getIsMobile() { + return isMobile; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + /** + * @return User agent string from the client device that caused the event. + */ + @JsonProperty("user_agent") + public Optional getUserAgent() { + return userAgent; + } + + @JsonProperty("security_context") + public Optional getSecurityContext() { + return securityContext; + } + + @JsonProperty("location_info") + public Optional getLocationInfo() { + return locationInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private OptionalNullable _getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetLogResponseContent && equalTo((GetLogResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetLogResponseContent other) { + return date.equals(other.date) + && type.equals(other.type) + && description.equals(other.description) + && connection.equals(other.connection) + && connectionId.equals(other.connectionId) + && clientId.equals(other.clientId) + && clientName.equals(other.clientName) + && ip.equals(other.ip) + && hostname.equals(other.hostname) + && userId.equals(other.userId) + && userName.equals(other.userName) + && audience.equals(other.audience) + && scope.equals(other.scope) + && strategy.equals(other.strategy) + && strategyType.equals(other.strategyType) + && logId.equals(other.logId) + && isMobile.equals(other.isMobile) + && details.equals(other.details) + && userAgent.equals(other.userAgent) + && securityContext.equals(other.securityContext) + && locationInfo.equals(other.locationInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.date, + this.type, + this.description, + this.connection, + this.connectionId, + this.clientId, + this.clientName, + this.ip, + this.hostname, + this.userId, + this.userName, + this.audience, + this.scope, + this.strategy, + this.strategyType, + this.logId, + this.isMobile, + this.details, + this.userAgent, + this.securityContext, + this.locationInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional date = Optional.empty(); + + private Optional type = Optional.empty(); + + private OptionalNullable description = OptionalNullable.absent(); + + private Optional connection = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientName = Optional.empty(); + + private Optional ip = Optional.empty(); + + private Optional hostname = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional strategyType = Optional.empty(); + + private Optional logId = Optional.empty(); + + private Optional isMobile = Optional.empty(); + + private Optional> details = Optional.empty(); + + private Optional userAgent = Optional.empty(); + + private Optional securityContext = Optional.empty(); + + private Optional locationInfo = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetLogResponseContent other) { + date(other.getDate()); + type(other.getType()); + description(other.getDescription()); + connection(other.getConnection()); + connectionId(other.getConnectionId()); + clientId(other.getClientId()); + clientName(other.getClientName()); + ip(other.getIp()); + hostname(other.getHostname()); + userId(other.getUserId()); + userName(other.getUserName()); + audience(other.getAudience()); + scope(other.getScope()); + strategy(other.getStrategy()); + strategyType(other.getStrategyType()); + logId(other.getLogId()); + isMobile(other.getIsMobile()); + details(other.getDetails()); + userAgent(other.getUserAgent()); + securityContext(other.getSecurityContext()); + locationInfo(other.getLocationInfo()); + return this; + } + + @JsonSetter(value = "date", nulls = Nulls.SKIP) + public Builder date(Optional date) { + this.date = date; + return this; + } + + public Builder date(LogDate date) { + this.date = Optional.ofNullable(date); + return this; + } + + /** + *

Type of event.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

Description of this event.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(@Nullable OptionalNullable description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = OptionalNullable.of(description); + return this; + } + + public Builder description(Optional description) { + if (description.isPresent()) { + this.description = OptionalNullable.of(description.get()); + } else { + this.description = OptionalNullable.absent(); + } + return this; + } + + public Builder description(com.auth0.client.mgmt.core.Nullable description) { + if (description.isNull()) { + this.description = OptionalNullable.ofNull(); + } else if (description.isEmpty()) { + this.description = OptionalNullable.absent(); + } else { + this.description = OptionalNullable.of(description.get()); + } + return this; + } + + /** + *

Name of the connection the event relates to.

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + *

ID of the connection the event relates to.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

ID of the client (application).

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the client (application).

+ */ + @JsonSetter(value = "client_name", nulls = Nulls.SKIP) + public Builder clientName(Optional clientName) { + this.clientName = clientName; + return this; + } + + public Builder clientName(String clientName) { + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + *

IP address of the log event source.

+ */ + @JsonSetter(value = "ip", nulls = Nulls.SKIP) + public Builder ip(Optional ip) { + this.ip = ip; + return this; + } + + public Builder ip(String ip) { + this.ip = Optional.ofNullable(ip); + return this; + } + + /** + *

Hostname the event applies to.

+ */ + @JsonSetter(value = "hostname", nulls = Nulls.SKIP) + public Builder hostname(Optional hostname) { + this.hostname = hostname; + return this; + } + + public Builder hostname(String hostname) { + this.hostname = Optional.ofNullable(hostname); + return this; + } + + /** + *

ID of the user involved in the event.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Name of the user involved in the event.

+ */ + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public Builder userName(Optional userName) { + this.userName = userName; + return this; + } + + public Builder userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + /** + *

API audience the event applies to.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scope permissions applied to the event.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + /** + *

Name of the strategy involved in the event.

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Type of strategy involved in the event.

+ */ + @JsonSetter(value = "strategy_type", nulls = Nulls.SKIP) + public Builder strategyType(Optional strategyType) { + this.strategyType = strategyType; + return this; + } + + public Builder strategyType(String strategyType) { + this.strategyType = Optional.ofNullable(strategyType); + return this; + } + + /** + *

Unique ID of the event.

+ */ + @JsonSetter(value = "log_id", nulls = Nulls.SKIP) + public Builder logId(Optional logId) { + this.logId = logId; + return this; + } + + public Builder logId(String logId) { + this.logId = Optional.ofNullable(logId); + return this; + } + + /** + *

Whether the client was a mobile device (true) or desktop/laptop/server (false).

+ */ + @JsonSetter(value = "isMobile", nulls = Nulls.SKIP) + public Builder isMobile(Optional isMobile) { + this.isMobile = isMobile; + return this; + } + + public Builder isMobile(Boolean isMobile) { + this.isMobile = Optional.ofNullable(isMobile); + return this; + } + + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public Builder details(Optional> details) { + this.details = details; + return this; + } + + public Builder details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + /** + *

User agent string from the client device that caused the event.

+ */ + @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) + public Builder userAgent(Optional userAgent) { + this.userAgent = userAgent; + return this; + } + + public Builder userAgent(String userAgent) { + this.userAgent = Optional.ofNullable(userAgent); + return this; + } + + @JsonSetter(value = "security_context", nulls = Nulls.SKIP) + public Builder securityContext(Optional securityContext) { + this.securityContext = securityContext; + return this; + } + + public Builder securityContext(LogSecurityContext securityContext) { + this.securityContext = Optional.ofNullable(securityContext); + return this; + } + + @JsonSetter(value = "location_info", nulls = Nulls.SKIP) + public Builder locationInfo(Optional locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + public Builder locationInfo(LogLocationInfo locationInfo) { + this.locationInfo = Optional.ofNullable(locationInfo); + return this; + } + + public GetLogResponseContent build() { + return new GetLogResponseContent( + date, + type, + description, + connection, + connectionId, + clientId, + clientName, + ip, + hostname, + userId, + userName, + audience, + scope, + strategy, + strategyType, + logId, + isMobile, + details, + userAgent, + securityContext, + locationInfo, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java new file mode 100644 index 000000000..d2995b77f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GetLogStreamResponseContent.Deserializer.class) +public final class GetLogStreamResponseContent { + private final Object value; + + private final int type; + + private GetLogStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LogStreamHttpResponseSchema) this.value); + } else if (this.type == 1) { + return visitor.visit((LogStreamEventBridgeResponseSchema) this.value); + } else if (this.type == 2) { + return visitor.visit((LogStreamEventGridResponseSchema) this.value); + } else if (this.type == 3) { + return visitor.visit((LogStreamDatadogResponseSchema) this.value); + } else if (this.type == 4) { + return visitor.visit((LogStreamSplunkResponseSchema) this.value); + } else if (this.type == 5) { + return visitor.visit((LogStreamSumoResponseSchema) this.value); + } else if (this.type == 6) { + return visitor.visit((LogStreamSegmentResponseSchema) this.value); + } else if (this.type == 7) { + return visitor.visit((LogStreamMixpanelResponseSchema) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetLogStreamResponseContent && equalTo((GetLogStreamResponseContent) other); + } + + private boolean equalTo(GetLogStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GetLogStreamResponseContent of(LogStreamHttpResponseSchema value) { + return new GetLogStreamResponseContent(value, 0); + } + + public static GetLogStreamResponseContent of(LogStreamEventBridgeResponseSchema value) { + return new GetLogStreamResponseContent(value, 1); + } + + public static GetLogStreamResponseContent of(LogStreamEventGridResponseSchema value) { + return new GetLogStreamResponseContent(value, 2); + } + + public static GetLogStreamResponseContent of(LogStreamDatadogResponseSchema value) { + return new GetLogStreamResponseContent(value, 3); + } + + public static GetLogStreamResponseContent of(LogStreamSplunkResponseSchema value) { + return new GetLogStreamResponseContent(value, 4); + } + + public static GetLogStreamResponseContent of(LogStreamSumoResponseSchema value) { + return new GetLogStreamResponseContent(value, 5); + } + + public static GetLogStreamResponseContent of(LogStreamSegmentResponseSchema value) { + return new GetLogStreamResponseContent(value, 6); + } + + public static GetLogStreamResponseContent of(LogStreamMixpanelResponseSchema value) { + return new GetLogStreamResponseContent(value, 7); + } + + public interface Visitor { + T visit(LogStreamHttpResponseSchema value); + + T visit(LogStreamEventBridgeResponseSchema value); + + T visit(LogStreamEventGridResponseSchema value); + + T visit(LogStreamDatadogResponseSchema value); + + T visit(LogStreamSplunkResponseSchema value); + + T visit(LogStreamSumoResponseSchema value); + + T visit(LogStreamSegmentResponseSchema value); + + T visit(LogStreamMixpanelResponseSchema value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GetLogStreamResponseContent.class); + } + + @java.lang.Override + public GetLogStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamHttpResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventBridgeResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventGridResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamDatadogResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSplunkResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSumoResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSegmentResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamMixpanelResponseSchema.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetNetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetNetworkAclsResponseContent.java new file mode 100644 index 000000000..f4cf25ce1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetNetworkAclsResponseContent.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetNetworkAclsResponseContent.Builder.class) +public final class GetNetworkAclsResponseContent { + private final Optional id; + + private final Optional description; + + private final Optional active; + + private final Optional priority; + + private final Optional rule; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetNetworkAclsResponseContent( + Optional id, + Optional description, + Optional active, + Optional priority, + Optional rule, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("rule") + public Optional getRule() { + return rule; + } + + /** + * @return The timestamp when the Network ACL Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp when the Network ACL Configuration was last updated + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetNetworkAclsResponseContent && equalTo((GetNetworkAclsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetNetworkAclsResponseContent other) { + return id.equals(other.id) + && description.equals(other.description) + && active.equals(other.active) + && priority.equals(other.priority) + && rule.equals(other.rule) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional active = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional rule = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetNetworkAclsResponseContent other) { + id(other.getId()); + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(Double priority) { + this.priority = Optional.ofNullable(priority); + return this; + } + + @JsonSetter(value = "rule", nulls = Nulls.SKIP) + public Builder rule(Optional rule) { + this.rule = rule; + return this; + } + + public Builder rule(NetworkAclRule rule) { + this.rule = Optional.ofNullable(rule); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was last updated

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(String updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetNetworkAclsResponseContent build() { + return new GetNetworkAclsResponseContent( + id, description, active, priority, rule, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java new file mode 100644 index 000000000..15e3a9781 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationByNameResponseContent.Builder.class) +public final class GetOrganizationByNameResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private GetOrganizationByNameResponseContent( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional tokenQuota, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationByNameResponseContent + && equalTo((GetOrganizationByNameResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationByNameResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOrganizationByNameResponseContent other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public GetOrganizationByNameResponseContent build() { + return new GetOrganizationByNameResponseContent( + id, name, displayName, branding, metadata, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java new file mode 100644 index 000000000..b9aaa3bb2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java @@ -0,0 +1,229 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationConnectionResponseContent.Builder.class) +public final class GetOrganizationConnectionResponseContent { + private final Optional connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional connection; + + private final Map additionalProperties; + + private GetOrganizationConnectionResponseContent( + Optional connectionId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional connection, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationConnectionResponseContent + && equalTo((GetOrganizationConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationConnectionResponseContent other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOrganizationConnectionResponseContent other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + connection(other.getConnection()); + return this; + } + + /** + *

ID of the connection.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public GetOrganizationConnectionResponseContent build() { + return new GetOrganizationConnectionResponseContent( + connectionId, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + connection, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java new file mode 100644 index 000000000..9e33abce2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java @@ -0,0 +1,469 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationInvitationResponseContent.Builder.class) +public final class GetOrganizationInvitationResponseContent { + private final Optional id; + + private final Optional organizationId; + + private final Optional inviter; + + private final Optional invitee; + + private final Optional invitationUrl; + + private final Optional createdAt; + + private final Optional expiresAt; + + private final Optional clientId; + + private final Optional connectionId; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional> roles; + + private final Optional ticketId; + + private final Map additionalProperties; + + private GetOrganizationInvitationResponseContent( + Optional id, + Optional organizationId, + Optional inviter, + Optional invitee, + Optional invitationUrl, + Optional createdAt, + Optional expiresAt, + Optional clientId, + Optional connectionId, + Optional> appMetadata, + Optional> userMetadata, + Optional> roles, + Optional ticketId, + Map additionalProperties) { + this.id = id; + this.organizationId = organizationId; + this.inviter = inviter; + this.invitee = invitee; + this.invitationUrl = invitationUrl; + this.createdAt = createdAt; + this.expiresAt = expiresAt; + this.clientId = clientId; + this.connectionId = connectionId; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.roles = roles; + this.ticketId = ticketId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the user invitation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @JsonProperty("inviter") + public Optional getInviter() { + return inviter; + } + + @JsonProperty("invitee") + public Optional getInvitee() { + return invitee; + } + + /** + * @return The invitation url to be send to the invitee. + */ + @JsonProperty("invitation_url") + public Optional getInvitationUrl() { + return invitationUrl; + } + + /** + * @return The ISO 8601 formatted timestamp representing the creation time of the invitation. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted timestamp representing the expiration time of the invitation. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + /** + * @return Auth0 client ID. Used to resolve the application's login initiation endpoint. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The id of the connection to force invitee to authenticate with. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + /** + * @return The id of the invitation ticket + */ + @JsonProperty("ticket_id") + public Optional getTicketId() { + return ticketId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationInvitationResponseContent + && equalTo((GetOrganizationInvitationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationInvitationResponseContent other) { + return id.equals(other.id) + && organizationId.equals(other.organizationId) + && inviter.equals(other.inviter) + && invitee.equals(other.invitee) + && invitationUrl.equals(other.invitationUrl) + && createdAt.equals(other.createdAt) + && expiresAt.equals(other.expiresAt) + && clientId.equals(other.clientId) + && connectionId.equals(other.connectionId) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && roles.equals(other.roles) + && ticketId.equals(other.ticketId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.organizationId, + this.inviter, + this.invitee, + this.invitationUrl, + this.createdAt, + this.expiresAt, + this.clientId, + this.connectionId, + this.appMetadata, + this.userMetadata, + this.roles, + this.ticketId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional inviter = Optional.empty(); + + private Optional invitee = Optional.empty(); + + private Optional invitationUrl = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional> roles = Optional.empty(); + + private Optional ticketId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOrganizationInvitationResponseContent other) { + id(other.getId()); + organizationId(other.getOrganizationId()); + inviter(other.getInviter()); + invitee(other.getInvitee()); + invitationUrl(other.getInvitationUrl()); + createdAt(other.getCreatedAt()); + expiresAt(other.getExpiresAt()); + clientId(other.getClientId()); + connectionId(other.getConnectionId()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + roles(other.getRoles()); + ticketId(other.getTicketId()); + return this; + } + + /** + *

The id of the user invitation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + @JsonSetter(value = "inviter", nulls = Nulls.SKIP) + public Builder inviter(Optional inviter) { + this.inviter = inviter; + return this; + } + + public Builder inviter(OrganizationInvitationInviter inviter) { + this.inviter = Optional.ofNullable(inviter); + return this; + } + + @JsonSetter(value = "invitee", nulls = Nulls.SKIP) + public Builder invitee(Optional invitee) { + this.invitee = invitee; + return this; + } + + public Builder invitee(OrganizationInvitationInvitee invitee) { + this.invitee = Optional.ofNullable(invitee); + return this; + } + + /** + *

The invitation url to be send to the invitee.

+ */ + @JsonSetter(value = "invitation_url", nulls = Nulls.SKIP) + public Builder invitationUrl(Optional invitationUrl) { + this.invitationUrl = invitationUrl; + return this; + } + + public Builder invitationUrl(String invitationUrl) { + this.invitationUrl = Optional.ofNullable(invitationUrl); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the creation time of the invitation.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the expiration time of the invitation.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The id of the connection to force invitee to authenticate with.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + *

The id of the invitation ticket

+ */ + @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) + public Builder ticketId(Optional ticketId) { + this.ticketId = ticketId; + return this; + } + + public Builder ticketId(String ticketId) { + this.ticketId = Optional.ofNullable(ticketId); + return this; + } + + public GetOrganizationInvitationResponseContent build() { + return new GetOrganizationInvitationResponseContent( + id, + organizationId, + inviter, + invitee, + invitationUrl, + createdAt, + expiresAt, + clientId, + connectionId, + appMetadata, + userMetadata, + roles, + ticketId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java new file mode 100644 index 000000000..db37d19ba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationResponseContent.Builder.class) +public final class GetOrganizationResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private GetOrganizationResponseContent( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional tokenQuota, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationResponseContent && equalTo((GetOrganizationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOrganizationResponseContent other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public GetOrganizationResponseContent build() { + return new GetOrganizationResponseContent( + id, name, displayName, branding, metadata, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java new file mode 100644 index 000000000..501d59b70 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetPhoneTemplateResponseContent.Builder.class) +public final class GetPhoneTemplateResponseContent { + private final String id; + + private final Optional channel; + + private final Optional customizable; + + private final Optional tenant; + + private final PhoneTemplateContent content; + + private final PhoneTemplateNotificationTypeEnum type; + + private final boolean disabled; + + private final Map additionalProperties; + + private GetPhoneTemplateResponseContent( + String id, + Optional channel, + Optional customizable, + Optional tenant, + PhoneTemplateContent content, + PhoneTemplateNotificationTypeEnum type, + boolean disabled, + Map additionalProperties) { + this.id = id; + this.channel = channel; + this.customizable = customizable; + this.tenant = tenant; + this.content = content; + this.type = type; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + @JsonProperty("customizable") + public Optional getCustomizable() { + return customizable; + } + + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("content") + public PhoneTemplateContent getContent() { + return content; + } + + @JsonProperty("type") + public PhoneTemplateNotificationTypeEnum getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public boolean getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetPhoneTemplateResponseContent && equalTo((GetPhoneTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetPhoneTemplateResponseContent other) { + return id.equals(other.id) + && channel.equals(other.channel) + && customizable.equals(other.customizable) + && tenant.equals(other.tenant) + && content.equals(other.content) + && type.equals(other.type) + && disabled == other.disabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ContentStage id(@NotNull String id); + + Builder from(GetPhoneTemplateResponseContent other); + } + + public interface ContentStage { + TypeStage content(@NotNull PhoneTemplateContent content); + } + + public interface TypeStage { + DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type); + } + + public interface DisabledStage { + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(boolean disabled); + } + + public interface _FinalStage { + GetPhoneTemplateResponseContent build(); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + _FinalStage customizable(Optional customizable); + + _FinalStage customizable(Boolean customizable); + + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ContentStage, TypeStage, DisabledStage, _FinalStage { + private String id; + + private PhoneTemplateContent content; + + private PhoneTemplateNotificationTypeEnum type; + + private boolean disabled; + + private Optional tenant = Optional.empty(); + + private Optional customizable = Optional.empty(); + + private Optional channel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetPhoneTemplateResponseContent other) { + id(other.getId()); + channel(other.getChannel()); + customizable(other.getCustomizable()); + tenant(other.getTenant()); + content(other.getContent()); + type(other.getType()); + disabled(other.getDisabled()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ContentStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public TypeStage content(@NotNull PhoneTemplateContent content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ *

Whether the template is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("disabled") + public _FinalStage disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage customizable(Boolean customizable) { + this.customizable = Optional.ofNullable(customizable); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customizable", nulls = Nulls.SKIP) + public _FinalStage customizable(Optional customizable) { + this.customizable = customizable; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + @java.lang.Override + public GetPhoneTemplateResponseContent build() { + return new GetPhoneTemplateResponseContent( + id, channel, customizable, tenant, content, type, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java new file mode 100644 index 000000000..57cbcae57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java @@ -0,0 +1,424 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRefreshTokenResponseContent.Builder.class) +public final class GetRefreshTokenResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional device; + + private final Optional clientId; + + private final OptionalNullable sessionId; + + private final Optional rotating; + + private final Optional> resourceServers; + + private final Optional lastExchangedAt; + + private final Map additionalProperties; + + private GetRefreshTokenResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional device, + Optional clientId, + OptionalNullable sessionId, + Optional rotating, + Optional> resourceServers, + Optional lastExchangedAt, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.device = device; + this.clientId = clientId; + this.sessionId = sessionId; + this.rotating = rotating; + this.resourceServers = resourceServers; + this.lastExchangedAt = lastExchangedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the refresh token + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return ID of the client application granted with this refresh token + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + public OptionalNullable getSessionId() { + if (sessionId == null) { + return OptionalNullable.absent(); + } + return sessionId; + } + + /** + * @return True if the token is a rotating refresh token + */ + @JsonProperty("rotating") + public Optional getRotating() { + return rotating; + } + + /** + * @return A list of the resource server IDs associated to this refresh-token and their granted scopes + */ + @JsonProperty("resource_servers") + public Optional> getResourceServers() { + return resourceServers; + } + + @JsonProperty("last_exchanged_at") + public Optional getLastExchangedAt() { + return lastExchangedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + private OptionalNullable _getSessionId() { + return sessionId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRefreshTokenResponseContent && equalTo((GetRefreshTokenResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRefreshTokenResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && device.equals(other.device) + && clientId.equals(other.clientId) + && sessionId.equals(other.sessionId) + && rotating.equals(other.rotating) + && resourceServers.equals(other.resourceServers) + && lastExchangedAt.equals(other.lastExchangedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.idleExpiresAt, + this.expiresAt, + this.device, + this.clientId, + this.sessionId, + this.rotating, + this.resourceServers, + this.lastExchangedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private OptionalNullable sessionId = OptionalNullable.absent(); + + private Optional rotating = Optional.empty(); + + private Optional> resourceServers = Optional.empty(); + + private Optional lastExchangedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetRefreshTokenResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + device(other.getDevice()); + clientId(other.getClientId()); + sessionId(other.getSessionId()); + rotating(other.getRotating()); + resourceServers(other.getResourceServers()); + lastExchangedAt(other.getLastExchangedAt()); + return this; + } + + /** + *

The ID of the refresh token

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(RefreshTokenDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(RefreshTokenDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(RefreshTokenDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(RefreshTokenDevice device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

ID of the client application granted with this refresh token

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "session_id", nulls = Nulls.SKIP) + public Builder sessionId(@Nullable OptionalNullable sessionId) { + this.sessionId = sessionId; + return this; + } + + public Builder sessionId(String sessionId) { + this.sessionId = OptionalNullable.of(sessionId); + return this; + } + + public Builder sessionId(Optional sessionId) { + if (sessionId.isPresent()) { + this.sessionId = OptionalNullable.of(sessionId.get()); + } else { + this.sessionId = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionId(com.auth0.client.mgmt.core.Nullable sessionId) { + if (sessionId.isNull()) { + this.sessionId = OptionalNullable.ofNull(); + } else if (sessionId.isEmpty()) { + this.sessionId = OptionalNullable.absent(); + } else { + this.sessionId = OptionalNullable.of(sessionId.get()); + } + return this; + } + + /** + *

True if the token is a rotating refresh token

+ */ + @JsonSetter(value = "rotating", nulls = Nulls.SKIP) + public Builder rotating(Optional rotating) { + this.rotating = rotating; + return this; + } + + public Builder rotating(Boolean rotating) { + this.rotating = Optional.ofNullable(rotating); + return this; + } + + /** + *

A list of the resource server IDs associated to this refresh-token and their granted scopes

+ */ + @JsonSetter(value = "resource_servers", nulls = Nulls.SKIP) + public Builder resourceServers(Optional> resourceServers) { + this.resourceServers = resourceServers; + return this; + } + + public Builder resourceServers(List resourceServers) { + this.resourceServers = Optional.ofNullable(resourceServers); + return this; + } + + @JsonSetter(value = "last_exchanged_at", nulls = Nulls.SKIP) + public Builder lastExchangedAt(Optional lastExchangedAt) { + this.lastExchangedAt = lastExchangedAt; + return this; + } + + public Builder lastExchangedAt(RefreshTokenDate lastExchangedAt) { + this.lastExchangedAt = Optional.ofNullable(lastExchangedAt); + return this; + } + + public GetRefreshTokenResponseContent build() { + return new GetRefreshTokenResponseContent( + id, + userId, + createdAt, + idleExpiresAt, + expiresAt, + device, + clientId, + sessionId, + rotating, + resourceServers, + lastExchangedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java new file mode 100644 index 000000000..3012356f2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetResourceServerRequestParameters.Builder.class) +public final class GetResourceServerRequestParameters { + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetResourceServerRequestParameters( + OptionalNullable includeFields, Map additionalProperties) { + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetResourceServerRequestParameters + && equalTo((GetResourceServerRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetResourceServerRequestParameters other) { + return includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetResourceServerRequestParameters other) { + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetResourceServerRequestParameters build() { + return new GetResourceServerRequestParameters(includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java new file mode 100644 index 000000000..703b5a06f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java @@ -0,0 +1,681 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetResourceServerResponseContent.Builder.class) +public final class GetResourceServerResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional isSystem; + + private final Optional identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional allowOfflineAccess; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional tokenLifetime; + + private final Optional tokenLifetimeForWeb; + + private final Optional enforcePolicies; + + private final Optional tokenDialect; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private GetResourceServerResponseContent( + Optional id, + Optional name, + Optional isSystem, + Optional identifier, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional allowOfflineAccess, + Optional skipConsentForVerifiableFirstPartyClients, + Optional tokenLifetime, + Optional tokenLifetimeForWeb, + Optional enforcePolicies, + Optional tokenDialect, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.id = id; + this.name = name; + this.isSystem = isSystem; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.allowOfflineAccess = allowOfflineAccess; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + this.enforcePolicies = enforcePolicies; + this.tokenDialect = tokenDialect; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the API (resource server). + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this is an Auth0 system API (true) or a custom API (false). + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value. + */ + @JsonProperty("token_lifetime_for_web") + public Optional getTokenLifetimeForWeb() { + return tokenLifetimeForWeb; + } + + /** + * @return Whether authorization polices are enforced (true) or unenforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetResourceServerResponseContent && equalTo((GetResourceServerResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetResourceServerResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && isSystem.equals(other.isSystem) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) + && enforcePolicies.equals(other.enforcePolicies) + && tokenDialect.equals(other.tokenDialect) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.isSystem, + this.identifier, + this.scopes, + this.signingAlg, + this.signingSecret, + this.allowOfflineAccess, + this.skipConsentForVerifiableFirstPartyClients, + this.tokenLifetime, + this.tokenLifetimeForWeb, + this.enforcePolicies, + this.tokenDialect, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenLifetimeForWeb = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetResourceServerResponseContent other) { + id(other.getId()); + name(other.getName()); + isSystem(other.getIsSystem()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + allowOfflineAccess(other.getAllowOfflineAccess()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); + enforcePolicies(other.getEnforcePolicies()); + tokenDialect(other.getTokenDialect()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

ID of the API (resource server).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this is an Auth0 system API (true) or a custom API (false).

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public Builder signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + public Builder signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public Builder allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + public Builder allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public Builder skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + public Builder skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value.

+ */ + @JsonSetter(value = "token_lifetime_for_web", nulls = Nulls.SKIP) + public Builder tokenLifetimeForWeb(Optional tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + return this; + } + + public Builder tokenLifetimeForWeb(Integer tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = Optional.ofNullable(tokenLifetimeForWeb); + return this; + } + + /** + *

Whether authorization polices are enforced (true) or unenforced (false).

+ */ + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public Builder enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + public Builder enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectResponseEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + public GetResourceServerResponseContent build() { + return new GetResourceServerResponseContent( + id, + name, + isSystem, + identifier, + scopes, + signingAlg, + signingSecret, + allowOfflineAccess, + skipConsentForVerifiableFirstPartyClients, + tokenLifetime, + tokenLifetimeForWeb, + enforcePolicies, + tokenDialect, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java new file mode 100644 index 000000000..4b04ade20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRoleResponseContent.Builder.class) +public final class GetRoleResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Map additionalProperties; + + private GetRoleResponseContent( + Optional id, + Optional name, + Optional description, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this role. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of this role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRoleResponseContent && equalTo((GetRoleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRoleResponseContent other) { + return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetRoleResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

ID for this role.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Description of this role.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public GetRoleResponseContent build() { + return new GetRoleResponseContent(id, name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java new file mode 100644 index 000000000..0b9e31fa6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRuleRequestParameters.Builder.class) +public final class GetRuleRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetRuleRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRuleRequestParameters && equalTo((GetRuleRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRuleRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetRuleRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetRuleRequestParameters build() { + return new GetRuleRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java new file mode 100644 index 000000000..716fd9d72 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRuleResponseContent.Builder.class) +public final class GetRuleResponseContent { + private final Optional name; + + private final Optional id; + + private final Optional enabled; + + private final Optional script; + + private final Optional order; + + private final Optional stage; + + private final Map additionalProperties; + + private GetRuleResponseContent( + Optional name, + Optional id, + Optional enabled, + Optional script, + Optional order, + Optional stage, + Map additionalProperties) { + this.name = name; + this.id = id; + this.enabled = enabled; + this.script = script; + this.order = order; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return ID of this rule. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Execution stage of this rule. Can be login_success, login_failure, or pre_authorize. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRuleResponseContent && equalTo((GetRuleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRuleResponseContent other) { + return name.equals(other.name) + && id.equals(other.id) + && enabled.equals(other.enabled) + && script.equals(other.script) + && order.equals(other.order) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional order = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetRuleResponseContent other) { + name(other.getName()); + id(other.getId()); + enabled(other.getEnabled()); + script(other.getScript()); + order(other.getOrder()); + stage(other.getStage()); + return this; + } + + /** + *

Name of this rule.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

ID of this rule.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Execution stage of this rule. Can be login_success, login_failure, or pre_authorize.

+ */ + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(String stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public GetRuleResponseContent build() { + return new GetRuleResponseContent(name, id, enabled, script, order, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java new file mode 100644 index 000000000..856daa884 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetScimConfigurationDefaultMappingResponseContent.Builder.class) +public final class GetScimConfigurationDefaultMappingResponseContent { + private final Optional> mapping; + + private final Map additionalProperties; + + private GetScimConfigurationDefaultMappingResponseContent( + Optional> mapping, Map additionalProperties) { + this.mapping = mapping; + this.additionalProperties = additionalProperties; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetScimConfigurationDefaultMappingResponseContent + && equalTo((GetScimConfigurationDefaultMappingResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetScimConfigurationDefaultMappingResponseContent other) { + return mapping.equals(other.mapping); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mapping); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> mapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetScimConfigurationDefaultMappingResponseContent other) { + mapping(other.getMapping()); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + public GetScimConfigurationDefaultMappingResponseContent build() { + return new GetScimConfigurationDefaultMappingResponseContent(mapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java new file mode 100644 index 000000000..a3da02aeb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetScimConfigurationResponseContent.Builder.class) +public final class GetScimConfigurationResponseContent { + private final Optional connectionId; + + private final Optional connectionName; + + private final Optional strategy; + + private final Optional tenantName; + + private final Optional userIdAttribute; + + private final Optional> mapping; + + private final Optional createdAt; + + private final Optional updatedOn; + + private final Map additionalProperties; + + private GetScimConfigurationResponseContent( + Optional connectionId, + Optional connectionName, + Optional strategy, + Optional tenantName, + Optional userIdAttribute, + Optional> mapping, + Optional createdAt, + Optional updatedOn, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.tenantName = tenantName; + this.userIdAttribute = userIdAttribute; + this.mapping = mapping; + this.createdAt = createdAt; + this.updatedOn = updatedOn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_name") + public Optional getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return The tenant's name + */ + @JsonProperty("tenant_name") + public Optional getTenantName() { + return tenantName; + } + + /** + * @return User ID attribute for generating unique user ids + */ + @JsonProperty("user_id_attribute") + public Optional getUserIdAttribute() { + return userIdAttribute; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + /** + * @return The Date Time Scim Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The Date Time Scim Configuration was last updated + */ + @JsonProperty("updated_on") + public Optional getUpdatedOn() { + return updatedOn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetScimConfigurationResponseContent + && equalTo((GetScimConfigurationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetScimConfigurationResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && tenantName.equals(other.tenantName) + && userIdAttribute.equals(other.userIdAttribute) + && mapping.equals(other.mapping) + && createdAt.equals(other.createdAt) + && updatedOn.equals(other.updatedOn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.tenantName, + this.userIdAttribute, + this.mapping, + this.createdAt, + this.updatedOn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional connectionName = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional tenantName = Optional.empty(); + + private Optional userIdAttribute = Optional.empty(); + + private Optional> mapping = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedOn = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetScimConfigurationResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + tenantName(other.getTenantName()); + userIdAttribute(other.getUserIdAttribute()); + mapping(other.getMapping()); + createdAt(other.getCreatedAt()); + updatedOn(other.getUpdatedOn()); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_name", nulls = Nulls.SKIP) + public Builder connectionName(Optional connectionName) { + this.connectionName = connectionName; + return this; + } + + public Builder connectionName(String connectionName) { + this.connectionName = Optional.ofNullable(connectionName); + return this; + } + + /** + *

The connection's strategy

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

The tenant's name

+ */ + @JsonSetter(value = "tenant_name", nulls = Nulls.SKIP) + public Builder tenantName(Optional tenantName) { + this.tenantName = tenantName; + return this; + } + + public Builder tenantName(String tenantName) { + this.tenantName = Optional.ofNullable(tenantName); + return this; + } + + /** + *

User ID attribute for generating unique user ids

+ */ + @JsonSetter(value = "user_id_attribute", nulls = Nulls.SKIP) + public Builder userIdAttribute(Optional userIdAttribute) { + this.userIdAttribute = userIdAttribute; + return this; + } + + public Builder userIdAttribute(String userIdAttribute) { + this.userIdAttribute = Optional.ofNullable(userIdAttribute); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + /** + *

The Date Time Scim Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The Date Time Scim Configuration was last updated

+ */ + @JsonSetter(value = "updated_on", nulls = Nulls.SKIP) + public Builder updatedOn(Optional updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + public Builder updatedOn(String updatedOn) { + this.updatedOn = Optional.ofNullable(updatedOn); + return this; + } + + public GetScimConfigurationResponseContent build() { + return new GetScimConfigurationResponseContent( + connectionId, + connectionName, + strategy, + tenantName, + userIdAttribute, + mapping, + createdAt, + updatedOn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java new file mode 100644 index 000000000..e36cfd798 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java @@ -0,0 +1,327 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSelfServiceProfileResponseContent.Builder.class) +public final class GetSelfServiceProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Optional> userAttributes; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional branding; + + private final Optional> allowedStrategies; + + private final Map additionalProperties; + + private GetSelfServiceProfileResponseContent( + Optional id, + Optional name, + Optional description, + Optional> userAttributes, + Optional createdAt, + Optional updatedAt, + Optional branding, + Optional> allowedStrategies, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.userAttributes = userAttributes; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the self-service Profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the self-service Profile. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + */ + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + /** + * @return The time when this self-service Profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this self-service Profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSelfServiceProfileResponseContent + && equalTo((GetSelfServiceProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSelfServiceProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && description.equals(other.description) + && userAttributes.equals(other.userAttributes) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.description, + this.userAttributes, + this.createdAt, + this.updatedAt, + this.branding, + this.allowedStrategies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> userAttributes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> allowedStrategies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetSelfServiceProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + userAttributes(other.getUserAttributes()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + return this; + } + + /** + *

The unique ID of the self-service Profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the self-service Profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The description of the self-service Profile.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes(Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes(List userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + /** + *

The time when this self-service Profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this self-service Profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(SelfServiceProfileBrandingProperties branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public Builder allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + public Builder allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + public GetSelfServiceProfileResponseContent build() { + return new GetSelfServiceProfileResponseContent( + id, + name, + description, + userAttributes, + createdAt, + updatedAt, + branding, + allowedStrategies, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java new file mode 100644 index 000000000..077b05495 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java @@ -0,0 +1,405 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSessionResponseContent.Builder.class) +public final class GetSessionResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional authenticatedAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional lastInteractedAt; + + private final Optional device; + + private final Optional> clients; + + private final Optional authentication; + + private final Optional cookie; + + private final Map additionalProperties; + + private GetSessionResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional updatedAt, + Optional authenticatedAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional lastInteractedAt, + Optional device, + Optional> clients, + Optional authentication, + Optional cookie, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.authenticatedAt = authenticatedAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.lastInteractedAt = lastInteractedAt; + this.device = device; + this.clients = clients; + this.authentication = authentication; + this.cookie = cookie; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the session + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("authenticated_at") + public Optional getAuthenticatedAt() { + return authenticatedAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("last_interacted_at") + public Optional getLastInteractedAt() { + return lastInteractedAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return List of client details for the session + */ + @JsonProperty("clients") + public Optional> getClients() { + return clients; + } + + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("cookie") + public Optional getCookie() { + return cookie; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSessionResponseContent && equalTo((GetSessionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSessionResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && authenticatedAt.equals(other.authenticatedAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && lastInteractedAt.equals(other.lastInteractedAt) + && device.equals(other.device) + && clients.equals(other.clients) + && authentication.equals(other.authentication) + && cookie.equals(other.cookie); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.updatedAt, + this.authenticatedAt, + this.idleExpiresAt, + this.expiresAt, + this.lastInteractedAt, + this.device, + this.clients, + this.authentication, + this.cookie); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional authenticatedAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional lastInteractedAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional> clients = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional cookie = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetSessionResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + authenticatedAt(other.getAuthenticatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + lastInteractedAt(other.getLastInteractedAt()); + device(other.getDevice()); + clients(other.getClients()); + authentication(other.getAuthentication()); + cookie(other.getCookie()); + return this; + } + + /** + *

The ID of the session

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(SessionDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(SessionDate updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "authenticated_at", nulls = Nulls.SKIP) + public Builder authenticatedAt(Optional authenticatedAt) { + this.authenticatedAt = authenticatedAt; + return this; + } + + public Builder authenticatedAt(SessionDate authenticatedAt) { + this.authenticatedAt = Optional.ofNullable(authenticatedAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(SessionDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(SessionDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "last_interacted_at", nulls = Nulls.SKIP) + public Builder lastInteractedAt(Optional lastInteractedAt) { + this.lastInteractedAt = lastInteractedAt; + return this; + } + + public Builder lastInteractedAt(SessionDate lastInteractedAt) { + this.lastInteractedAt = Optional.ofNullable(lastInteractedAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(SessionDeviceMetadata device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

List of client details for the session

+ */ + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional> clients) { + this.clients = clients; + return this; + } + + public Builder clients(List clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(SessionAuthenticationSignals authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "cookie", nulls = Nulls.SKIP) + public Builder cookie(Optional cookie) { + this.cookie = cookie; + return this; + } + + public Builder cookie(SessionCookieMetadata cookie) { + this.cookie = Optional.ofNullable(cookie); + return this; + } + + public GetSessionResponseContent build() { + return new GetSessionResponseContent( + id, + userId, + createdAt, + updatedAt, + authenticatedAt, + idleExpiresAt, + expiresAt, + lastInteractedAt, + device, + clients, + authentication, + cookie, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java new file mode 100644 index 000000000..7a588405f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSettingsResponseContent.Builder.class) +public final class GetSettingsResponseContent { + private final Optional universalLoginExperience; + + private final Optional identifierFirst; + + private final Optional webauthnPlatformFirstFactor; + + private final Map additionalProperties; + + private GetSettingsResponseContent( + Optional universalLoginExperience, + Optional identifierFirst, + Optional webauthnPlatformFirstFactor, + Map additionalProperties) { + this.universalLoginExperience = universalLoginExperience; + this.identifierFirst = identifierFirst; + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("universal_login_experience") + public Optional getUniversalLoginExperience() { + return universalLoginExperience; + } + + /** + * @return Whether identifier first is enabled or not + */ + @JsonProperty("identifier_first") + public Optional getIdentifierFirst() { + return identifierFirst; + } + + /** + * @return Use WebAuthn with Device Biometrics as the first authentication factor + */ + @JsonProperty("webauthn_platform_first_factor") + public Optional getWebauthnPlatformFirstFactor() { + return webauthnPlatformFirstFactor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSettingsResponseContent && equalTo((GetSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSettingsResponseContent other) { + return universalLoginExperience.equals(other.universalLoginExperience) + && identifierFirst.equals(other.identifierFirst) + && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional universalLoginExperience = Optional.empty(); + + private Optional identifierFirst = Optional.empty(); + + private Optional webauthnPlatformFirstFactor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetSettingsResponseContent other) { + universalLoginExperience(other.getUniversalLoginExperience()); + identifierFirst(other.getIdentifierFirst()); + webauthnPlatformFirstFactor(other.getWebauthnPlatformFirstFactor()); + return this; + } + + @JsonSetter(value = "universal_login_experience", nulls = Nulls.SKIP) + public Builder universalLoginExperience(Optional universalLoginExperience) { + this.universalLoginExperience = universalLoginExperience; + return this; + } + + public Builder universalLoginExperience(UniversalLoginExperienceEnum universalLoginExperience) { + this.universalLoginExperience = Optional.ofNullable(universalLoginExperience); + return this; + } + + /** + *

Whether identifier first is enabled or not

+ */ + @JsonSetter(value = "identifier_first", nulls = Nulls.SKIP) + public Builder identifierFirst(Optional identifierFirst) { + this.identifierFirst = identifierFirst; + return this; + } + + public Builder identifierFirst(Boolean identifierFirst) { + this.identifierFirst = Optional.ofNullable(identifierFirst); + return this; + } + + /** + *

Use WebAuthn with Device Biometrics as the first authentication factor

+ */ + @JsonSetter(value = "webauthn_platform_first_factor", nulls = Nulls.SKIP) + public Builder webauthnPlatformFirstFactor(Optional webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + return this; + } + + public Builder webauthnPlatformFirstFactor(Boolean webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = Optional.ofNullable(webauthnPlatformFirstFactor); + return this; + } + + public GetSettingsResponseContent build() { + return new GetSettingsResponseContent( + universalLoginExperience, identifierFirst, webauthnPlatformFirstFactor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java new file mode 100644 index 000000000..c53de182e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java @@ -0,0 +1,552 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSigningKeysResponseContent.Builder.class) +public final class GetSigningKeysResponseContent { + private final String kid; + + private final String cert; + + private final Optional pkcs7; + + private final Optional current; + + private final Optional next; + + private final Optional previous; + + private final Optional currentSince; + + private final Optional currentUntil; + + private final String fingerprint; + + private final String thumbprint; + + private final Optional revoked; + + private final Optional revokedAt; + + private final Map additionalProperties; + + private GetSigningKeysResponseContent( + String kid, + String cert, + Optional pkcs7, + Optional current, + Optional next, + Optional previous, + Optional currentSince, + Optional currentUntil, + String fingerprint, + String thumbprint, + Optional revoked, + Optional revokedAt, + Map additionalProperties) { + this.kid = kid; + this.cert = cert; + this.pkcs7 = pkcs7; + this.current = current; + this.next = next; + this.previous = previous; + this.currentSince = currentSince; + this.currentUntil = currentUntil; + this.fingerprint = fingerprint; + this.thumbprint = thumbprint; + this.revoked = revoked; + this.revokedAt = revokedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The key id of the signing key + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + /** + * @return The public certificate of the signing key + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return The public certificate of the signing key in pkcs7 format + */ + @JsonProperty("pkcs7") + public Optional getPkcs7() { + return pkcs7; + } + + /** + * @return True if the key is the the current key + */ + @JsonProperty("current") + public Optional getCurrent() { + return current; + } + + /** + * @return True if the key is the the next key + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + /** + * @return True if the key is the the previous key + */ + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("current_since") + public Optional getCurrentSince() { + return currentSince; + } + + @JsonProperty("current_until") + public Optional getCurrentUntil() { + return currentUntil; + } + + /** + * @return The cert fingerprint + */ + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + /** + * @return The cert thumbprint + */ + @JsonProperty("thumbprint") + public String getThumbprint() { + return thumbprint; + } + + /** + * @return True if the key is revoked + */ + @JsonProperty("revoked") + public Optional getRevoked() { + return revoked; + } + + @JsonProperty("revoked_at") + public Optional getRevokedAt() { + return revokedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSigningKeysResponseContent && equalTo((GetSigningKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSigningKeysResponseContent other) { + return kid.equals(other.kid) + && cert.equals(other.cert) + && pkcs7.equals(other.pkcs7) + && current.equals(other.current) + && next.equals(other.next) + && previous.equals(other.previous) + && currentSince.equals(other.currentSince) + && currentUntil.equals(other.currentUntil) + && fingerprint.equals(other.fingerprint) + && thumbprint.equals(other.thumbprint) + && revoked.equals(other.revoked) + && revokedAt.equals(other.revokedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, + this.cert, + this.pkcs7, + this.current, + this.next, + this.previous, + this.currentSince, + this.currentUntil, + this.fingerprint, + this.thumbprint, + this.revoked, + this.revokedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

The key id of the signing key

+ */ + CertStage kid(@NotNull String kid); + + Builder from(GetSigningKeysResponseContent other); + } + + public interface CertStage { + /** + *

The public certificate of the signing key

+ */ + FingerprintStage cert(@NotNull String cert); + } + + public interface FingerprintStage { + /** + *

The cert fingerprint

+ */ + ThumbprintStage fingerprint(@NotNull String fingerprint); + } + + public interface ThumbprintStage { + /** + *

The cert thumbprint

+ */ + _FinalStage thumbprint(@NotNull String thumbprint); + } + + public interface _FinalStage { + GetSigningKeysResponseContent build(); + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + _FinalStage pkcs7(Optional pkcs7); + + _FinalStage pkcs7(String pkcs7); + + /** + *

True if the key is the the current key

+ */ + _FinalStage current(Optional current); + + _FinalStage current(Boolean current); + + /** + *

True if the key is the the next key

+ */ + _FinalStage next(Optional next); + + _FinalStage next(Boolean next); + + /** + *

True if the key is the the previous key

+ */ + _FinalStage previous(Optional previous); + + _FinalStage previous(Boolean previous); + + _FinalStage currentSince(Optional currentSince); + + _FinalStage currentSince(SigningKeysDate currentSince); + + _FinalStage currentUntil(Optional currentUntil); + + _FinalStage currentUntil(SigningKeysDate currentUntil); + + /** + *

True if the key is revoked

+ */ + _FinalStage revoked(Optional revoked); + + _FinalStage revoked(Boolean revoked); + + _FinalStage revokedAt(Optional revokedAt); + + _FinalStage revokedAt(SigningKeysDate revokedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KidStage, CertStage, FingerprintStage, ThumbprintStage, _FinalStage { + private String kid; + + private String cert; + + private String fingerprint; + + private String thumbprint; + + private Optional revokedAt = Optional.empty(); + + private Optional revoked = Optional.empty(); + + private Optional currentUntil = Optional.empty(); + + private Optional currentSince = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional next = Optional.empty(); + + private Optional current = Optional.empty(); + + private Optional pkcs7 = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetSigningKeysResponseContent other) { + kid(other.getKid()); + cert(other.getCert()); + pkcs7(other.getPkcs7()); + current(other.getCurrent()); + next(other.getNext()); + previous(other.getPrevious()); + currentSince(other.getCurrentSince()); + currentUntil(other.getCurrentUntil()); + fingerprint(other.getFingerprint()); + thumbprint(other.getThumbprint()); + revoked(other.getRevoked()); + revokedAt(other.getRevokedAt()); + return this; + } + + /** + *

The key id of the signing key

+ *

The key id of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public CertStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + /** + *

The public certificate of the signing key

+ *

The public certificate of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public FingerprintStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

The cert fingerprint

+ *

The cert fingerprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("fingerprint") + public ThumbprintStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The cert thumbprint

+ *

The cert thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("thumbprint") + public _FinalStage thumbprint(@NotNull String thumbprint) { + this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage revokedAt(SigningKeysDate revokedAt) { + this.revokedAt = Optional.ofNullable(revokedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) + public _FinalStage revokedAt(Optional revokedAt) { + this.revokedAt = revokedAt; + return this; + } + + /** + *

True if the key is revoked

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage revoked(Boolean revoked) { + this.revoked = Optional.ofNullable(revoked); + return this; + } + + /** + *

True if the key is revoked

+ */ + @java.lang.Override + @JsonSetter(value = "revoked", nulls = Nulls.SKIP) + public _FinalStage revoked(Optional revoked) { + this.revoked = revoked; + return this; + } + + @java.lang.Override + public _FinalStage currentUntil(SigningKeysDate currentUntil) { + this.currentUntil = Optional.ofNullable(currentUntil); + return this; + } + + @java.lang.Override + @JsonSetter(value = "current_until", nulls = Nulls.SKIP) + public _FinalStage currentUntil(Optional currentUntil) { + this.currentUntil = currentUntil; + return this; + } + + @java.lang.Override + public _FinalStage currentSince(SigningKeysDate currentSince) { + this.currentSince = Optional.ofNullable(currentSince); + return this; + } + + @java.lang.Override + @JsonSetter(value = "current_since", nulls = Nulls.SKIP) + public _FinalStage currentSince(Optional currentSince) { + this.currentSince = currentSince; + return this; + } + + /** + *

True if the key is the the previous key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage previous(Boolean previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + /** + *

True if the key is the the previous key

+ */ + @java.lang.Override + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public _FinalStage previous(Optional previous) { + this.previous = previous; + return this; + } + + /** + *

True if the key is the the next key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage next(Boolean next) { + this.next = Optional.ofNullable(next); + return this; + } + + /** + *

True if the key is the the next key

+ */ + @java.lang.Override + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public _FinalStage next(Optional next) { + this.next = next; + return this; + } + + /** + *

True if the key is the the current key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage current(Boolean current) { + this.current = Optional.ofNullable(current); + return this; + } + + /** + *

True if the key is the the current key

+ */ + @java.lang.Override + @JsonSetter(value = "current", nulls = Nulls.SKIP) + public _FinalStage current(Optional current) { + this.current = current; + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage pkcs7(String pkcs7) { + this.pkcs7 = Optional.ofNullable(pkcs7); + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + @java.lang.Override + @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) + public _FinalStage pkcs7(Optional pkcs7) { + this.pkcs7 = pkcs7; + return this; + } + + @java.lang.Override + public GetSigningKeysResponseContent build() { + return new GetSigningKeysResponseContent( + kid, + cert, + pkcs7, + current, + next, + previous, + currentSince, + currentUntil, + fingerprint, + thumbprint, + revoked, + revokedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java new file mode 100644 index 000000000..e8571ce80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSupplementalSignalsResponseContent.Builder.class) +public final class GetSupplementalSignalsResponseContent { + private final Optional akamaiEnabled; + + private final Map additionalProperties; + + private GetSupplementalSignalsResponseContent( + Optional akamaiEnabled, Map additionalProperties) { + this.akamaiEnabled = akamaiEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates if incoming Akamai Headers should be processed + */ + @JsonProperty("akamai_enabled") + public Optional getAkamaiEnabled() { + return akamaiEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSupplementalSignalsResponseContent + && equalTo((GetSupplementalSignalsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSupplementalSignalsResponseContent other) { + return akamaiEnabled.equals(other.akamaiEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.akamaiEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional akamaiEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetSupplementalSignalsResponseContent other) { + akamaiEnabled(other.getAkamaiEnabled()); + return this; + } + + /** + *

Indicates if incoming Akamai Headers should be processed

+ */ + @JsonSetter(value = "akamai_enabled", nulls = Nulls.SKIP) + public Builder akamaiEnabled(Optional akamaiEnabled) { + this.akamaiEnabled = akamaiEnabled; + return this; + } + + public Builder akamaiEnabled(Boolean akamaiEnabled) { + this.akamaiEnabled = Optional.ofNullable(akamaiEnabled); + return this; + } + + public GetSupplementalSignalsResponseContent build() { + return new GetSupplementalSignalsResponseContent(akamaiEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java new file mode 100644 index 000000000..a73e05b88 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java @@ -0,0 +1,186 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetSuspiciousIpThrottlingSettingsResponseContent.Builder.class) +public final class GetSuspiciousIpThrottlingSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional stage; + + private final Map additionalProperties; + + private GetSuspiciousIpThrottlingSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not suspicious IP throttling attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetSuspiciousIpThrottlingSettingsResponseContent + && equalTo((GetSuspiciousIpThrottlingSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSuspiciousIpThrottlingSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetSuspiciousIpThrottlingSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not suspicious IP throttling attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(SuspiciousIpThrottlingStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public GetSuspiciousIpThrottlingSettingsResponseContent build() { + return new GetSuspiciousIpThrottlingSettingsResponseContent( + enabled, shields, allowlist, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java new file mode 100644 index 000000000..dcb5ae486 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java @@ -0,0 +1,1289 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetTenantSettingsResponseContent.Builder.class) +public final class GetTenantSettingsResponseContent { + private final OptionalNullable changePassword; + + private final OptionalNullable guardianMfaPage; + + private final Optional defaultAudience; + + private final Optional defaultDirectory; + + private final OptionalNullable errorPage; + + private final OptionalNullable deviceFlow; + + private final OptionalNullable defaultTokenQuota; + + private final Optional flags; + + private final Optional friendlyName; + + private final Optional pictureUrl; + + private final Optional supportEmail; + + private final Optional supportUrl; + + private final Optional> allowedLogoutUrls; + + private final Optional sessionLifetime; + + private final Optional idleSessionLifetime; + + private final Optional ephemeralSessionLifetime; + + private final Optional idleEphemeralSessionLifetime; + + private final Optional sandboxVersion; + + private final Optional legacySandboxVersion; + + private final Optional> sandboxVersionsAvailable; + + private final Optional defaultRedirectionUri; + + private final Optional> enabledLocales; + + private final OptionalNullable sessionCookie; + + private final OptionalNullable sessions; + + private final Optional oidcLogout; + + private final Optional allowOrganizationNameInAuthenticationApi; + + private final Optional customizeMfaInPostloginAction; + + private final Optional> acrValuesSupported; + + private final OptionalNullable mtls; + + private final Optional pushedAuthorizationRequestsSupported; + + private final OptionalNullable authorizationResponseIssParameterSupported; + + private final Map additionalProperties; + + private GetTenantSettingsResponseContent( + OptionalNullable changePassword, + OptionalNullable guardianMfaPage, + Optional defaultAudience, + Optional defaultDirectory, + OptionalNullable errorPage, + OptionalNullable deviceFlow, + OptionalNullable defaultTokenQuota, + Optional flags, + Optional friendlyName, + Optional pictureUrl, + Optional supportEmail, + Optional supportUrl, + Optional> allowedLogoutUrls, + Optional sessionLifetime, + Optional idleSessionLifetime, + Optional ephemeralSessionLifetime, + Optional idleEphemeralSessionLifetime, + Optional sandboxVersion, + Optional legacySandboxVersion, + Optional> sandboxVersionsAvailable, + Optional defaultRedirectionUri, + Optional> enabledLocales, + OptionalNullable sessionCookie, + OptionalNullable sessions, + Optional oidcLogout, + Optional allowOrganizationNameInAuthenticationApi, + Optional customizeMfaInPostloginAction, + Optional> acrValuesSupported, + OptionalNullable mtls, + Optional pushedAuthorizationRequestsSupported, + OptionalNullable authorizationResponseIssParameterSupported, + Map additionalProperties) { + this.changePassword = changePassword; + this.guardianMfaPage = guardianMfaPage; + this.defaultAudience = defaultAudience; + this.defaultDirectory = defaultDirectory; + this.errorPage = errorPage; + this.deviceFlow = deviceFlow; + this.defaultTokenQuota = defaultTokenQuota; + this.flags = flags; + this.friendlyName = friendlyName; + this.pictureUrl = pictureUrl; + this.supportEmail = supportEmail; + this.supportUrl = supportUrl; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionLifetime = sessionLifetime; + this.idleSessionLifetime = idleSessionLifetime; + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + this.sandboxVersion = sandboxVersion; + this.legacySandboxVersion = legacySandboxVersion; + this.sandboxVersionsAvailable = sandboxVersionsAvailable; + this.defaultRedirectionUri = defaultRedirectionUri; + this.enabledLocales = enabledLocales; + this.sessionCookie = sessionCookie; + this.sessions = sessions; + this.oidcLogout = oidcLogout; + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + this.acrValuesSupported = acrValuesSupported; + this.mtls = mtls; + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + public OptionalNullable getChangePassword() { + if (changePassword == null) { + return OptionalNullable.absent(); + } + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + public OptionalNullable getGuardianMfaPage() { + if (guardianMfaPage == null) { + return OptionalNullable.absent(); + } + return guardianMfaPage; + } + + /** + * @return Default audience for API authorization. + */ + @JsonProperty("default_audience") + public Optional getDefaultAudience() { + return defaultAudience; + } + + /** + * @return Name of connection used for password grants at the /tokenendpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. + */ + @JsonProperty("default_directory") + public Optional getDefaultDirectory() { + return defaultDirectory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + public OptionalNullable getErrorPage() { + if (errorPage == null) { + return OptionalNullable.absent(); + } + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + public OptionalNullable getDeviceFlow() { + if (deviceFlow == null) { + return OptionalNullable.absent(); + } + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + public OptionalNullable getDefaultTokenQuota() { + if (defaultTokenQuota == null) { + return OptionalNullable.absent(); + } + return defaultTokenQuota; + } + + @JsonProperty("flags") + public Optional getFlags() { + return flags; + } + + /** + * @return Friendly name for this tenant. + */ + @JsonProperty("friendly_name") + public Optional getFriendlyName() { + return friendlyName; + } + + /** + * @return URL of logo to be shown for this tenant (recommended size: 150x150) + */ + @JsonProperty("picture_url") + public Optional getPictureUrl() { + return pictureUrl; + } + + /** + * @return End-user support email address. + */ + @JsonProperty("support_email") + public Optional getSupportEmail() { + return supportEmail; + } + + /** + * @return End-user support URL. + */ + @JsonProperty("support_url") + public Optional getSupportUrl() { + return supportUrl; + } + + /** + * @return URLs that are valid to redirect to after logout from Auth0. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + /** + * @return Number of hours a session will stay valid. + */ + @JsonProperty("session_lifetime") + public Optional getSessionLifetime() { + return sessionLifetime; + } + + /** + * @return Number of hours for which a session can be inactive before the user must log in again. + */ + @JsonProperty("idle_session_lifetime") + public Optional getIdleSessionLifetime() { + return idleSessionLifetime; + } + + /** + * @return Number of hours an ephemeral (non-persistent) session will stay valid. + */ + @JsonProperty("ephemeral_session_lifetime") + public Optional getEphemeralSessionLifetime() { + return ephemeralSessionLifetime; + } + + /** + * @return Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again. + */ + @JsonProperty("idle_ephemeral_session_lifetime") + public Optional getIdleEphemeralSessionLifetime() { + return idleEphemeralSessionLifetime; + } + + /** + * @return Selected sandbox version for the extensibility environment. + */ + @JsonProperty("sandbox_version") + public Optional getSandboxVersion() { + return sandboxVersion; + } + + /** + * @return Selected sandbox version for rules and hooks extensibility. + */ + @JsonProperty("legacy_sandbox_version") + public Optional getLegacySandboxVersion() { + return legacySandboxVersion; + } + + /** + * @return Available sandbox versions for the extensibility environment. + */ + @JsonProperty("sandbox_versions_available") + public Optional> getSandboxVersionsAvailable() { + return sandboxVersionsAvailable; + } + + /** + * @return The default absolute redirection uri, must be https + */ + @JsonProperty("default_redirection_uri") + public Optional getDefaultRedirectionUri() { + return defaultRedirectionUri; + } + + /** + * @return Supported locales for the user interface. + */ + @JsonProperty("enabled_locales") + public Optional> getEnabledLocales() { + return enabledLocales; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + public OptionalNullable getSessionCookie() { + if (sessionCookie == null) { + return OptionalNullable.absent(); + } + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + public OptionalNullable getSessions() { + if (sessions == null) { + return OptionalNullable.absent(); + } + return sessions; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return Whether to accept an organization name instead of an ID on auth endpoints + */ + @JsonProperty("allow_organization_name_in_authentication_api") + public Optional getAllowOrganizationNameInAuthenticationApi() { + return allowOrganizationNameInAuthenticationApi; + } + + /** + * @return Whether to enable flexible factors for MFA in the PostLogin action + */ + @JsonProperty("customize_mfa_in_postlogin_action") + public Optional getCustomizeMfaInPostloginAction() { + return customizeMfaInPostloginAction; + } + + /** + * @return Supported ACR values + */ + @JsonProperty("acr_values_supported") + public Optional> getAcrValuesSupported() { + return acrValuesSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + public OptionalNullable getMtls() { + if (mtls == null) { + return OptionalNullable.absent(); + } + return mtls; + } + + /** + * @return Enables the use of Pushed Authorization Requests + */ + @JsonProperty("pushed_authorization_requests_supported") + public Optional getPushedAuthorizationRequestsSupported() { + return pushedAuthorizationRequestsSupported; + } + + /** + * @return Supports iss parameter in authorization responses + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + public OptionalNullable getAuthorizationResponseIssParameterSupported() { + if (authorizationResponseIssParameterSupported == null) { + return OptionalNullable.absent(); + } + return authorizationResponseIssParameterSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + private OptionalNullable _getChangePassword() { + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + private OptionalNullable _getGuardianMfaPage() { + return guardianMfaPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + private OptionalNullable _getErrorPage() { + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + private OptionalNullable _getDeviceFlow() { + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + private OptionalNullable _getDefaultTokenQuota() { + return defaultTokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + private OptionalNullable _getSessionCookie() { + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + private OptionalNullable _getSessions() { + return sessions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + private OptionalNullable _getMtls() { + return mtls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + private OptionalNullable _getAuthorizationResponseIssParameterSupported() { + return authorizationResponseIssParameterSupported; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetTenantSettingsResponseContent && equalTo((GetTenantSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetTenantSettingsResponseContent other) { + return changePassword.equals(other.changePassword) + && guardianMfaPage.equals(other.guardianMfaPage) + && defaultAudience.equals(other.defaultAudience) + && defaultDirectory.equals(other.defaultDirectory) + && errorPage.equals(other.errorPage) + && deviceFlow.equals(other.deviceFlow) + && defaultTokenQuota.equals(other.defaultTokenQuota) + && flags.equals(other.flags) + && friendlyName.equals(other.friendlyName) + && pictureUrl.equals(other.pictureUrl) + && supportEmail.equals(other.supportEmail) + && supportUrl.equals(other.supportUrl) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionLifetime.equals(other.sessionLifetime) + && idleSessionLifetime.equals(other.idleSessionLifetime) + && ephemeralSessionLifetime.equals(other.ephemeralSessionLifetime) + && idleEphemeralSessionLifetime.equals(other.idleEphemeralSessionLifetime) + && sandboxVersion.equals(other.sandboxVersion) + && legacySandboxVersion.equals(other.legacySandboxVersion) + && sandboxVersionsAvailable.equals(other.sandboxVersionsAvailable) + && defaultRedirectionUri.equals(other.defaultRedirectionUri) + && enabledLocales.equals(other.enabledLocales) + && sessionCookie.equals(other.sessionCookie) + && sessions.equals(other.sessions) + && oidcLogout.equals(other.oidcLogout) + && allowOrganizationNameInAuthenticationApi.equals(other.allowOrganizationNameInAuthenticationApi) + && customizeMfaInPostloginAction.equals(other.customizeMfaInPostloginAction) + && acrValuesSupported.equals(other.acrValuesSupported) + && mtls.equals(other.mtls) + && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.changePassword, + this.guardianMfaPage, + this.defaultAudience, + this.defaultDirectory, + this.errorPage, + this.deviceFlow, + this.defaultTokenQuota, + this.flags, + this.friendlyName, + this.pictureUrl, + this.supportEmail, + this.supportUrl, + this.allowedLogoutUrls, + this.sessionLifetime, + this.idleSessionLifetime, + this.ephemeralSessionLifetime, + this.idleEphemeralSessionLifetime, + this.sandboxVersion, + this.legacySandboxVersion, + this.sandboxVersionsAvailable, + this.defaultRedirectionUri, + this.enabledLocales, + this.sessionCookie, + this.sessions, + this.oidcLogout, + this.allowOrganizationNameInAuthenticationApi, + this.customizeMfaInPostloginAction, + this.acrValuesSupported, + this.mtls, + this.pushedAuthorizationRequestsSupported, + this.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable changePassword = OptionalNullable.absent(); + + private OptionalNullable guardianMfaPage = OptionalNullable.absent(); + + private Optional defaultAudience = Optional.empty(); + + private Optional defaultDirectory = Optional.empty(); + + private OptionalNullable errorPage = OptionalNullable.absent(); + + private OptionalNullable deviceFlow = OptionalNullable.absent(); + + private OptionalNullable defaultTokenQuota = OptionalNullable.absent(); + + private Optional flags = Optional.empty(); + + private Optional friendlyName = Optional.empty(); + + private Optional pictureUrl = Optional.empty(); + + private Optional supportEmail = Optional.empty(); + + private Optional supportUrl = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private Optional sessionLifetime = Optional.empty(); + + private Optional idleSessionLifetime = Optional.empty(); + + private Optional ephemeralSessionLifetime = Optional.empty(); + + private Optional idleEphemeralSessionLifetime = Optional.empty(); + + private Optional sandboxVersion = Optional.empty(); + + private Optional legacySandboxVersion = Optional.empty(); + + private Optional> sandboxVersionsAvailable = Optional.empty(); + + private Optional defaultRedirectionUri = Optional.empty(); + + private Optional> enabledLocales = Optional.empty(); + + private OptionalNullable sessionCookie = OptionalNullable.absent(); + + private OptionalNullable sessions = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional allowOrganizationNameInAuthenticationApi = Optional.empty(); + + private Optional customizeMfaInPostloginAction = Optional.empty(); + + private Optional> acrValuesSupported = Optional.empty(); + + private OptionalNullable mtls = OptionalNullable.absent(); + + private Optional pushedAuthorizationRequestsSupported = Optional.empty(); + + private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetTenantSettingsResponseContent other) { + changePassword(other.getChangePassword()); + guardianMfaPage(other.getGuardianMfaPage()); + defaultAudience(other.getDefaultAudience()); + defaultDirectory(other.getDefaultDirectory()); + errorPage(other.getErrorPage()); + deviceFlow(other.getDeviceFlow()); + defaultTokenQuota(other.getDefaultTokenQuota()); + flags(other.getFlags()); + friendlyName(other.getFriendlyName()); + pictureUrl(other.getPictureUrl()); + supportEmail(other.getSupportEmail()); + supportUrl(other.getSupportUrl()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionLifetime(other.getSessionLifetime()); + idleSessionLifetime(other.getIdleSessionLifetime()); + ephemeralSessionLifetime(other.getEphemeralSessionLifetime()); + idleEphemeralSessionLifetime(other.getIdleEphemeralSessionLifetime()); + sandboxVersion(other.getSandboxVersion()); + legacySandboxVersion(other.getLegacySandboxVersion()); + sandboxVersionsAvailable(other.getSandboxVersionsAvailable()); + defaultRedirectionUri(other.getDefaultRedirectionUri()); + enabledLocales(other.getEnabledLocales()); + sessionCookie(other.getSessionCookie()); + sessions(other.getSessions()); + oidcLogout(other.getOidcLogout()); + allowOrganizationNameInAuthenticationApi(other.getAllowOrganizationNameInAuthenticationApi()); + customizeMfaInPostloginAction(other.getCustomizeMfaInPostloginAction()); + acrValuesSupported(other.getAcrValuesSupported()); + mtls(other.getMtls()); + pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); + authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + return this; + } + + @JsonSetter(value = "change_password", nulls = Nulls.SKIP) + public Builder changePassword(@Nullable OptionalNullable changePassword) { + this.changePassword = changePassword; + return this; + } + + public Builder changePassword(TenantSettingsPasswordPage changePassword) { + this.changePassword = OptionalNullable.of(changePassword); + return this; + } + + public Builder changePassword(Optional changePassword) { + if (changePassword.isPresent()) { + this.changePassword = OptionalNullable.of(changePassword.get()); + } else { + this.changePassword = OptionalNullable.absent(); + } + return this; + } + + public Builder changePassword(com.auth0.client.mgmt.core.Nullable changePassword) { + if (changePassword.isNull()) { + this.changePassword = OptionalNullable.ofNull(); + } else if (changePassword.isEmpty()) { + this.changePassword = OptionalNullable.absent(); + } else { + this.changePassword = OptionalNullable.of(changePassword.get()); + } + return this; + } + + @JsonSetter(value = "guardian_mfa_page", nulls = Nulls.SKIP) + public Builder guardianMfaPage(@Nullable OptionalNullable guardianMfaPage) { + this.guardianMfaPage = guardianMfaPage; + return this; + } + + public Builder guardianMfaPage(TenantSettingsGuardianPage guardianMfaPage) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage); + return this; + } + + public Builder guardianMfaPage(Optional guardianMfaPage) { + if (guardianMfaPage.isPresent()) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } else { + this.guardianMfaPage = OptionalNullable.absent(); + } + return this; + } + + public Builder guardianMfaPage( + com.auth0.client.mgmt.core.Nullable guardianMfaPage) { + if (guardianMfaPage.isNull()) { + this.guardianMfaPage = OptionalNullable.ofNull(); + } else if (guardianMfaPage.isEmpty()) { + this.guardianMfaPage = OptionalNullable.absent(); + } else { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } + return this; + } + + /** + *

Default audience for API authorization.

+ */ + @JsonSetter(value = "default_audience", nulls = Nulls.SKIP) + public Builder defaultAudience(Optional defaultAudience) { + this.defaultAudience = defaultAudience; + return this; + } + + public Builder defaultAudience(String defaultAudience) { + this.defaultAudience = Optional.ofNullable(defaultAudience); + return this; + } + + /** + *

Name of connection used for password grants at the /tokenendpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS.

+ */ + @JsonSetter(value = "default_directory", nulls = Nulls.SKIP) + public Builder defaultDirectory(Optional defaultDirectory) { + this.defaultDirectory = defaultDirectory; + return this; + } + + public Builder defaultDirectory(String defaultDirectory) { + this.defaultDirectory = Optional.ofNullable(defaultDirectory); + return this; + } + + @JsonSetter(value = "error_page", nulls = Nulls.SKIP) + public Builder errorPage(@Nullable OptionalNullable errorPage) { + this.errorPage = errorPage; + return this; + } + + public Builder errorPage(TenantSettingsErrorPage errorPage) { + this.errorPage = OptionalNullable.of(errorPage); + return this; + } + + public Builder errorPage(Optional errorPage) { + if (errorPage.isPresent()) { + this.errorPage = OptionalNullable.of(errorPage.get()); + } else { + this.errorPage = OptionalNullable.absent(); + } + return this; + } + + public Builder errorPage(com.auth0.client.mgmt.core.Nullable errorPage) { + if (errorPage.isNull()) { + this.errorPage = OptionalNullable.ofNull(); + } else if (errorPage.isEmpty()) { + this.errorPage = OptionalNullable.absent(); + } else { + this.errorPage = OptionalNullable.of(errorPage.get()); + } + return this; + } + + @JsonSetter(value = "device_flow", nulls = Nulls.SKIP) + public Builder deviceFlow(@Nullable OptionalNullable deviceFlow) { + this.deviceFlow = deviceFlow; + return this; + } + + public Builder deviceFlow(TenantSettingsDeviceFlow deviceFlow) { + this.deviceFlow = OptionalNullable.of(deviceFlow); + return this; + } + + public Builder deviceFlow(Optional deviceFlow) { + if (deviceFlow.isPresent()) { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } else { + this.deviceFlow = OptionalNullable.absent(); + } + return this; + } + + public Builder deviceFlow(com.auth0.client.mgmt.core.Nullable deviceFlow) { + if (deviceFlow.isNull()) { + this.deviceFlow = OptionalNullable.ofNull(); + } else if (deviceFlow.isEmpty()) { + this.deviceFlow = OptionalNullable.absent(); + } else { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } + return this; + } + + @JsonSetter(value = "default_token_quota", nulls = Nulls.SKIP) + public Builder defaultTokenQuota(@Nullable OptionalNullable defaultTokenQuota) { + this.defaultTokenQuota = defaultTokenQuota; + return this; + } + + public Builder defaultTokenQuota(DefaultTokenQuota defaultTokenQuota) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota); + return this; + } + + public Builder defaultTokenQuota(Optional defaultTokenQuota) { + if (defaultTokenQuota.isPresent()) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } else { + this.defaultTokenQuota = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultTokenQuota(com.auth0.client.mgmt.core.Nullable defaultTokenQuota) { + if (defaultTokenQuota.isNull()) { + this.defaultTokenQuota = OptionalNullable.ofNull(); + } else if (defaultTokenQuota.isEmpty()) { + this.defaultTokenQuota = OptionalNullable.absent(); + } else { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } + return this; + } + + @JsonSetter(value = "flags", nulls = Nulls.SKIP) + public Builder flags(Optional flags) { + this.flags = flags; + return this; + } + + public Builder flags(TenantSettingsFlags flags) { + this.flags = Optional.ofNullable(flags); + return this; + } + + /** + *

Friendly name for this tenant.

+ */ + @JsonSetter(value = "friendly_name", nulls = Nulls.SKIP) + public Builder friendlyName(Optional friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + public Builder friendlyName(String friendlyName) { + this.friendlyName = Optional.ofNullable(friendlyName); + return this; + } + + /** + *

URL of logo to be shown for this tenant (recommended size: 150x150)

+ */ + @JsonSetter(value = "picture_url", nulls = Nulls.SKIP) + public Builder pictureUrl(Optional pictureUrl) { + this.pictureUrl = pictureUrl; + return this; + } + + public Builder pictureUrl(String pictureUrl) { + this.pictureUrl = Optional.ofNullable(pictureUrl); + return this; + } + + /** + *

End-user support email address.

+ */ + @JsonSetter(value = "support_email", nulls = Nulls.SKIP) + public Builder supportEmail(Optional supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + public Builder supportEmail(String supportEmail) { + this.supportEmail = Optional.ofNullable(supportEmail); + return this; + } + + /** + *

End-user support URL.

+ */ + @JsonSetter(value = "support_url", nulls = Nulls.SKIP) + public Builder supportUrl(Optional supportUrl) { + this.supportUrl = supportUrl; + return this; + } + + public Builder supportUrl(String supportUrl) { + this.supportUrl = Optional.ofNullable(supportUrl); + return this; + } + + /** + *

URLs that are valid to redirect to after logout from Auth0.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + /** + *

Number of hours a session will stay valid.

+ */ + @JsonSetter(value = "session_lifetime", nulls = Nulls.SKIP) + public Builder sessionLifetime(Optional sessionLifetime) { + this.sessionLifetime = sessionLifetime; + return this; + } + + public Builder sessionLifetime(Double sessionLifetime) { + this.sessionLifetime = Optional.ofNullable(sessionLifetime); + return this; + } + + /** + *

Number of hours for which a session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_session_lifetime", nulls = Nulls.SKIP) + public Builder idleSessionLifetime(Optional idleSessionLifetime) { + this.idleSessionLifetime = idleSessionLifetime; + return this; + } + + public Builder idleSessionLifetime(Double idleSessionLifetime) { + this.idleSessionLifetime = Optional.ofNullable(idleSessionLifetime); + return this; + } + + /** + *

Number of hours an ephemeral (non-persistent) session will stay valid.

+ */ + @JsonSetter(value = "ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder ephemeralSessionLifetime(Optional ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + return this; + } + + public Builder ephemeralSessionLifetime(Double ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = Optional.ofNullable(ephemeralSessionLifetime); + return this; + } + + /** + *

Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder idleEphemeralSessionLifetime(Optional idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + return this; + } + + public Builder idleEphemeralSessionLifetime(Double idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = Optional.ofNullable(idleEphemeralSessionLifetime); + return this; + } + + /** + *

Selected sandbox version for the extensibility environment.

+ */ + @JsonSetter(value = "sandbox_version", nulls = Nulls.SKIP) + public Builder sandboxVersion(Optional sandboxVersion) { + this.sandboxVersion = sandboxVersion; + return this; + } + + public Builder sandboxVersion(String sandboxVersion) { + this.sandboxVersion = Optional.ofNullable(sandboxVersion); + return this; + } + + /** + *

Selected sandbox version for rules and hooks extensibility.

+ */ + @JsonSetter(value = "legacy_sandbox_version", nulls = Nulls.SKIP) + public Builder legacySandboxVersion(Optional legacySandboxVersion) { + this.legacySandboxVersion = legacySandboxVersion; + return this; + } + + public Builder legacySandboxVersion(String legacySandboxVersion) { + this.legacySandboxVersion = Optional.ofNullable(legacySandboxVersion); + return this; + } + + /** + *

Available sandbox versions for the extensibility environment.

+ */ + @JsonSetter(value = "sandbox_versions_available", nulls = Nulls.SKIP) + public Builder sandboxVersionsAvailable(Optional> sandboxVersionsAvailable) { + this.sandboxVersionsAvailable = sandboxVersionsAvailable; + return this; + } + + public Builder sandboxVersionsAvailable(List sandboxVersionsAvailable) { + this.sandboxVersionsAvailable = Optional.ofNullable(sandboxVersionsAvailable); + return this; + } + + /** + *

The default absolute redirection uri, must be https

+ */ + @JsonSetter(value = "default_redirection_uri", nulls = Nulls.SKIP) + public Builder defaultRedirectionUri(Optional defaultRedirectionUri) { + this.defaultRedirectionUri = defaultRedirectionUri; + return this; + } + + public Builder defaultRedirectionUri(String defaultRedirectionUri) { + this.defaultRedirectionUri = Optional.ofNullable(defaultRedirectionUri); + return this; + } + + /** + *

Supported locales for the user interface.

+ */ + @JsonSetter(value = "enabled_locales", nulls = Nulls.SKIP) + public Builder enabledLocales(Optional> enabledLocales) { + this.enabledLocales = enabledLocales; + return this; + } + + public Builder enabledLocales(List enabledLocales) { + this.enabledLocales = Optional.ofNullable(enabledLocales); + return this; + } + + @JsonSetter(value = "session_cookie", nulls = Nulls.SKIP) + public Builder sessionCookie(@Nullable OptionalNullable sessionCookie) { + this.sessionCookie = sessionCookie; + return this; + } + + public Builder sessionCookie(SessionCookieSchema sessionCookie) { + this.sessionCookie = OptionalNullable.of(sessionCookie); + return this; + } + + public Builder sessionCookie(Optional sessionCookie) { + if (sessionCookie.isPresent()) { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } else { + this.sessionCookie = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionCookie(com.auth0.client.mgmt.core.Nullable sessionCookie) { + if (sessionCookie.isNull()) { + this.sessionCookie = OptionalNullable.ofNull(); + } else if (sessionCookie.isEmpty()) { + this.sessionCookie = OptionalNullable.absent(); + } else { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } + return this; + } + + @JsonSetter(value = "sessions", nulls = Nulls.SKIP) + public Builder sessions(@Nullable OptionalNullable sessions) { + this.sessions = sessions; + return this; + } + + public Builder sessions(TenantSettingsSessions sessions) { + this.sessions = OptionalNullable.of(sessions); + return this; + } + + public Builder sessions(Optional sessions) { + if (sessions.isPresent()) { + this.sessions = OptionalNullable.of(sessions.get()); + } else { + this.sessions = OptionalNullable.absent(); + } + return this; + } + + public Builder sessions(com.auth0.client.mgmt.core.Nullable sessions) { + if (sessions.isNull()) { + this.sessions = OptionalNullable.ofNull(); + } else if (sessions.isEmpty()) { + this.sessions = OptionalNullable.absent(); + } else { + this.sessions = OptionalNullable.of(sessions.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(TenantOidcLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

Whether to accept an organization name instead of an ID on auth endpoints

+ */ + @JsonSetter(value = "allow_organization_name_in_authentication_api", nulls = Nulls.SKIP) + public Builder allowOrganizationNameInAuthenticationApi( + Optional allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + return this; + } + + public Builder allowOrganizationNameInAuthenticationApi(Boolean allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = + Optional.ofNullable(allowOrganizationNameInAuthenticationApi); + return this; + } + + /** + *

Whether to enable flexible factors for MFA in the PostLogin action

+ */ + @JsonSetter(value = "customize_mfa_in_postlogin_action", nulls = Nulls.SKIP) + public Builder customizeMfaInPostloginAction(Optional customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + return this; + } + + public Builder customizeMfaInPostloginAction(Boolean customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = Optional.ofNullable(customizeMfaInPostloginAction); + return this; + } + + /** + *

Supported ACR values

+ */ + @JsonSetter(value = "acr_values_supported", nulls = Nulls.SKIP) + public Builder acrValuesSupported(Optional> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + return this; + } + + public Builder acrValuesSupported(List acrValuesSupported) { + this.acrValuesSupported = Optional.ofNullable(acrValuesSupported); + return this; + } + + @JsonSetter(value = "mtls", nulls = Nulls.SKIP) + public Builder mtls(@Nullable OptionalNullable mtls) { + this.mtls = mtls; + return this; + } + + public Builder mtls(TenantSettingsMtls mtls) { + this.mtls = OptionalNullable.of(mtls); + return this; + } + + public Builder mtls(Optional mtls) { + if (mtls.isPresent()) { + this.mtls = OptionalNullable.of(mtls.get()); + } else { + this.mtls = OptionalNullable.absent(); + } + return this; + } + + public Builder mtls(com.auth0.client.mgmt.core.Nullable mtls) { + if (mtls.isNull()) { + this.mtls = OptionalNullable.ofNull(); + } else if (mtls.isEmpty()) { + this.mtls = OptionalNullable.absent(); + } else { + this.mtls = OptionalNullable.of(mtls.get()); + } + return this; + } + + /** + *

Enables the use of Pushed Authorization Requests

+ */ + @JsonSetter(value = "pushed_authorization_requests_supported", nulls = Nulls.SKIP) + public Builder pushedAuthorizationRequestsSupported(Optional pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + return this; + } + + public Builder pushedAuthorizationRequestsSupported(Boolean pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = Optional.ofNullable(pushedAuthorizationRequestsSupported); + return this; + } + + /** + *

Supports iss parameter in authorization responses

+ */ + @JsonSetter(value = "authorization_response_iss_parameter_supported", nulls = Nulls.SKIP) + public Builder authorizationResponseIssParameterSupported( + @Nullable OptionalNullable authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + return this; + } + + public Builder authorizationResponseIssParameterSupported(Boolean authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported); + return this; + } + + public Builder authorizationResponseIssParameterSupported( + Optional authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isPresent()) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } else { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } + return this; + } + + public Builder authorizationResponseIssParameterSupported( + com.auth0.client.mgmt.core.Nullable authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isNull()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.ofNull(); + } else if (authorizationResponseIssParameterSupported.isEmpty()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } else { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } + return this; + } + + public GetTenantSettingsResponseContent build() { + return new GetTenantSettingsResponseContent( + changePassword, + guardianMfaPage, + defaultAudience, + defaultDirectory, + errorPage, + deviceFlow, + defaultTokenQuota, + flags, + friendlyName, + pictureUrl, + supportEmail, + supportUrl, + allowedLogoutUrls, + sessionLifetime, + idleSessionLifetime, + ephemeralSessionLifetime, + idleEphemeralSessionLifetime, + sandboxVersion, + legacySandboxVersion, + sandboxVersionsAvailable, + defaultRedirectionUri, + enabledLocales, + sessionCookie, + sessions, + oidcLogout, + allowOrganizationNameInAuthenticationApi, + customizeMfaInPostloginAction, + acrValuesSupported, + mtls, + pushedAuthorizationRequestsSupported, + authorizationResponseIssParameterSupported, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java new file mode 100644 index 000000000..1f1fb1119 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetTokenExchangeProfileResponseContent.Builder.class) +public final class GetTokenExchangeProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional subjectTokenType; + + private final Optional actionId; + + private final Optional type; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetTokenExchangeProfileResponseContent( + Optional id, + Optional name, + Optional subjectTokenType, + Optional actionId, + Optional type, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subjectTokenType = subjectTokenType; + this.actionId = actionId; + this.type = type; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the token exchange profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name of this profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + */ + @JsonProperty("subject_token_type") + public Optional getSubjectTokenType() { + return subjectTokenType; + } + + /** + * @return The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The time when this profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetTokenExchangeProfileResponseContent + && equalTo((GetTokenExchangeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetTokenExchangeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subjectTokenType.equals(other.subjectTokenType) + && actionId.equals(other.actionId) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional subjectTokenType = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetTokenExchangeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + subjectTokenType(other.getSubjectTokenType()); + actionId(other.getActionId()); + type(other.getType()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The unique ID of the token exchange profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name of this profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ */ + @JsonSetter(value = "subject_token_type", nulls = Nulls.SKIP) + public Builder subjectTokenType(Optional subjectTokenType) { + this.subjectTokenType = subjectTokenType; + return this; + } + + public Builder subjectTokenType(String subjectTokenType) { + this.subjectTokenType = Optional.ofNullable(subjectTokenType); + return this; + } + + /** + *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The time when this profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetTokenExchangeProfileResponseContent build() { + return new GetTokenExchangeProfileResponseContent( + id, name, subjectTokenType, actionId, type, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java new file mode 100644 index 000000000..1af8321d2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUniversalLoginTemplate.Builder.class) +public final class GetUniversalLoginTemplate { + private final Optional body; + + private final Map additionalProperties; + + private GetUniversalLoginTemplate(Optional body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + /** + * @return The custom page template for the New Universal Login Experience + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUniversalLoginTemplate && equalTo((GetUniversalLoginTemplate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUniversalLoginTemplate other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional body = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUniversalLoginTemplate other) { + body(other.getBody()); + return this; + } + + /** + *

The custom page template for the New Universal Login Experience

+ */ + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + public GetUniversalLoginTemplate build() { + return new GetUniversalLoginTemplate(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java new file mode 100644 index 000000000..aa54a7fad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GetUniversalLoginTemplateResponseContent.Deserializer.class) +public final class GetUniversalLoginTemplateResponseContent { + private final Object value; + + private final int type; + + private GetUniversalLoginTemplateResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((GetUniversalLoginTemplate) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUniversalLoginTemplateResponseContent + && equalTo((GetUniversalLoginTemplateResponseContent) other); + } + + private boolean equalTo(GetUniversalLoginTemplateResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GetUniversalLoginTemplateResponseContent of(GetUniversalLoginTemplate value) { + return new GetUniversalLoginTemplateResponseContent(value, 0); + } + + public static GetUniversalLoginTemplateResponseContent of(String value) { + return new GetUniversalLoginTemplateResponseContent(value, 1); + } + + public interface Visitor { + T visit(GetUniversalLoginTemplate value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GetUniversalLoginTemplateResponseContent.class); + } + + @java.lang.Override + public GetUniversalLoginTemplateResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, GetUniversalLoginTemplate.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java new file mode 100644 index 000000000..404e1e46c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java @@ -0,0 +1,839 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUserAuthenticationMethodResponseContent.Builder.class) +public final class GetUserAuthenticationMethodResponseContent { + private final String id; + + private final AuthenticationMethodTypeEnum type; + + private final Optional confirmed; + + private final Optional name; + + private final Optional> authenticationMethods; + + private final Optional preferredAuthenticationMethod; + + private final Optional linkId; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional keyId; + + private final Optional publicKey; + + private final OffsetDateTime createdAt; + + private final Optional enrolledAt; + + private final Optional lastAuthAt; + + private final Optional credentialDeviceType; + + private final Optional credentialBackedUp; + + private final Optional identityUserId; + + private final Optional userAgent; + + private final Map additionalProperties; + + private GetUserAuthenticationMethodResponseContent( + String id, + AuthenticationMethodTypeEnum type, + Optional confirmed, + Optional name, + Optional> authenticationMethods, + Optional preferredAuthenticationMethod, + Optional linkId, + Optional phoneNumber, + Optional email, + Optional keyId, + Optional publicKey, + OffsetDateTime createdAt, + Optional enrolledAt, + Optional lastAuthAt, + Optional credentialDeviceType, + Optional credentialBackedUp, + Optional identityUserId, + Optional userAgent, + Map additionalProperties) { + this.id = id; + this.type = type; + this.confirmed = confirmed; + this.name = name; + this.authenticationMethods = authenticationMethods; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.linkId = linkId; + this.phoneNumber = phoneNumber; + this.email = email; + this.keyId = keyId; + this.publicKey = publicKey; + this.createdAt = createdAt; + this.enrolledAt = enrolledAt; + this.lastAuthAt = lastAuthAt; + this.credentialDeviceType = credentialDeviceType; + this.credentialBackedUp = credentialBackedUp; + this.identityUserId = identityUserId; + this.userAgent = userAgent; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the authentication method (auto generated) + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("type") + public AuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return The authentication method status + */ + @JsonProperty("confirmed") + public Optional getConfirmed() { + return confirmed; + } + + /** + * @return A human-readable label to identify the authentication method + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("authentication_methods") + public Optional> getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return The ID of a linked authentication method. Linked authentication methods will be deleted together. + */ + @JsonProperty("link_id") + public Optional getLinkId() { + return linkId; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email and email-verification authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Applies to webauthn authentication methods only. The ID of the generated credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authentication methods only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Authenticator creation date + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Enrollment date + */ + @JsonProperty("enrolled_at") + public Optional getEnrolledAt() { + return enrolledAt; + } + + /** + * @return Last authentication + */ + @JsonProperty("last_auth_at") + public Optional getLastAuthAt() { + return lastAuthAt; + } + + /** + * @return Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user. + */ + @JsonProperty("credential_device_type") + public Optional getCredentialDeviceType() { + return credentialDeviceType; + } + + /** + * @return Applies to passkeys only. Whether the credential was backed up. + */ + @JsonProperty("credential_backed_up") + public Optional getCredentialBackedUp() { + return credentialBackedUp; + } + + /** + * @return Applies to passkeys only. The ID of the user identity linked with the authentication method. + */ + @JsonProperty("identity_user_id") + public Optional getIdentityUserId() { + return identityUserId; + } + + /** + * @return Applies to passkeys only. The user-agent of the browser used to create the passkey. + */ + @JsonProperty("user_agent") + public Optional getUserAgent() { + return userAgent; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserAuthenticationMethodResponseContent + && equalTo((GetUserAuthenticationMethodResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserAuthenticationMethodResponseContent other) { + return id.equals(other.id) + && type.equals(other.type) + && confirmed.equals(other.confirmed) + && name.equals(other.name) + && authenticationMethods.equals(other.authenticationMethods) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && linkId.equals(other.linkId) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && createdAt.equals(other.createdAt) + && enrolledAt.equals(other.enrolledAt) + && lastAuthAt.equals(other.lastAuthAt) + && credentialDeviceType.equals(other.credentialDeviceType) + && credentialBackedUp.equals(other.credentialBackedUp) + && identityUserId.equals(other.identityUserId) + && userAgent.equals(other.userAgent); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.type, + this.confirmed, + this.name, + this.authenticationMethods, + this.preferredAuthenticationMethod, + this.linkId, + this.phoneNumber, + this.email, + this.keyId, + this.publicKey, + this.createdAt, + this.enrolledAt, + this.lastAuthAt, + this.credentialDeviceType, + this.credentialBackedUp, + this.identityUserId, + this.userAgent); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The ID of the authentication method (auto generated)

+ */ + TypeStage id(@NotNull String id); + + Builder from(GetUserAuthenticationMethodResponseContent other); + } + + public interface TypeStage { + CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type); + } + + public interface CreatedAtStage { + /** + *

Authenticator creation date

+ */ + _FinalStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface _FinalStage { + GetUserAuthenticationMethodResponseContent build(); + + /** + *

The authentication method status

+ */ + _FinalStage confirmed(Optional confirmed); + + _FinalStage confirmed(Boolean confirmed); + + /** + *

A human-readable label to identify the authentication method

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage authenticationMethods(Optional> authenticationMethods); + + _FinalStage authenticationMethods(List authenticationMethods); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ */ + _FinalStage linkId(Optional linkId); + + _FinalStage linkId(String linkId); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Enrollment date

+ */ + _FinalStage enrolledAt(Optional enrolledAt); + + _FinalStage enrolledAt(OffsetDateTime enrolledAt); + + /** + *

Last authentication

+ */ + _FinalStage lastAuthAt(Optional lastAuthAt); + + _FinalStage lastAuthAt(OffsetDateTime lastAuthAt); + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ */ + _FinalStage credentialDeviceType(Optional credentialDeviceType); + + _FinalStage credentialDeviceType(String credentialDeviceType); + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ */ + _FinalStage credentialBackedUp(Optional credentialBackedUp); + + _FinalStage credentialBackedUp(Boolean credentialBackedUp); + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ */ + _FinalStage identityUserId(Optional identityUserId); + + _FinalStage identityUserId(String identityUserId); + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ */ + _FinalStage userAgent(Optional userAgent); + + _FinalStage userAgent(String userAgent); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, TypeStage, CreatedAtStage, _FinalStage { + private String id; + + private AuthenticationMethodTypeEnum type; + + private OffsetDateTime createdAt; + + private Optional userAgent = Optional.empty(); + + private Optional identityUserId = Optional.empty(); + + private Optional credentialBackedUp = Optional.empty(); + + private Optional credentialDeviceType = Optional.empty(); + + private Optional lastAuthAt = Optional.empty(); + + private Optional enrolledAt = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional linkId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional> authenticationMethods = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional confirmed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetUserAuthenticationMethodResponseContent other) { + id(other.getId()); + type(other.getType()); + confirmed(other.getConfirmed()); + name(other.getName()); + authenticationMethods(other.getAuthenticationMethods()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + linkId(other.getLinkId()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + createdAt(other.getCreatedAt()); + enrolledAt(other.getEnrolledAt()); + lastAuthAt(other.getLastAuthAt()); + credentialDeviceType(other.getCredentialDeviceType()); + credentialBackedUp(other.getCredentialBackedUp()); + identityUserId(other.getIdentityUserId()); + userAgent(other.getUserAgent()); + return this; + } + + /** + *

The ID of the authentication method (auto generated)

+ *

The ID of the authentication method (auto generated)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public TypeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Authenticator creation date

+ *

Authenticator creation date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userAgent(String userAgent) { + this.userAgent = Optional.ofNullable(userAgent); + return this; + } + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ */ + @java.lang.Override + @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) + public _FinalStage userAgent(Optional userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage identityUserId(String identityUserId) { + this.identityUserId = Optional.ofNullable(identityUserId); + return this; + } + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) + public _FinalStage identityUserId(Optional identityUserId) { + this.identityUserId = identityUserId; + return this; + } + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { + this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); + return this; + } + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ */ + @java.lang.Override + @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) + public _FinalStage credentialBackedUp(Optional credentialBackedUp) { + this.credentialBackedUp = credentialBackedUp; + return this; + } + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialDeviceType(String credentialDeviceType) { + this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); + return this; + } + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ */ + @java.lang.Override + @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) + public _FinalStage credentialDeviceType(Optional credentialDeviceType) { + this.credentialDeviceType = credentialDeviceType; + return this; + } + + /** + *

Last authentication

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { + this.lastAuthAt = Optional.ofNullable(lastAuthAt); + return this; + } + + /** + *

Last authentication

+ */ + @java.lang.Override + @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) + public _FinalStage lastAuthAt(Optional lastAuthAt) { + this.lastAuthAt = lastAuthAt; + return this; + } + + /** + *

Enrollment date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { + this.enrolledAt = Optional.ofNullable(enrolledAt); + return this; + } + + /** + *

Enrollment date

+ */ + @java.lang.Override + @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) + public _FinalStage enrolledAt(Optional enrolledAt) { + this.enrolledAt = enrolledAt; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkId(String linkId) { + this.linkId = Optional.ofNullable(linkId); + return this; + } + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ */ + @java.lang.Override + @JsonSetter(value = "link_id", nulls = Nulls.SKIP) + public _FinalStage linkId(Optional linkId) { + this.linkId = linkId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public _FinalStage authenticationMethods(List authenticationMethods) { + this.authenticationMethods = Optional.ofNullable(authenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public _FinalStage authenticationMethods( + Optional> authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + *

A human-readable label to identify the authentication method

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The authentication method status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage confirmed(Boolean confirmed) { + this.confirmed = Optional.ofNullable(confirmed); + return this; + } + + /** + *

The authentication method status

+ */ + @java.lang.Override + @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) + public _FinalStage confirmed(Optional confirmed) { + this.confirmed = confirmed; + return this; + } + + @java.lang.Override + public GetUserAuthenticationMethodResponseContent build() { + return new GetUserAuthenticationMethodResponseContent( + id, + type, + confirmed, + name, + authenticationMethods, + preferredAuthenticationMethod, + linkId, + phoneNumber, + email, + keyId, + publicKey, + createdAt, + enrolledAt, + lastAuthAt, + credentialDeviceType, + credentialBackedUp, + identityUserId, + userAgent, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java new file mode 100644 index 000000000..a95706d17 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUserRequestParameters.Builder.class) +public final class GetUserRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private GetUserRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserRequestParameters && equalTo((GetUserRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUserRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public GetUserRequestParameters build() { + return new GetUserRequestParameters(fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java new file mode 100644 index 000000000..497df4221 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java @@ -0,0 +1,717 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUserResponseContent.Builder.class) +public final class GetUserResponseContent { + private final Optional userId; + + private final Optional email; + + private final Optional emailVerified; + + private final Optional username; + + private final Optional phoneNumber; + + private final Optional phoneVerified; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> identities; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional picture; + + private final Optional name; + + private final Optional nickname; + + private final Optional> multifactor; + + private final Optional lastIp; + + private final Optional lastLogin; + + private final Optional loginsCount; + + private final Optional blocked; + + private final Optional givenName; + + private final Optional familyName; + + private final Map additionalProperties; + + private GetUserResponseContent( + Optional userId, + Optional email, + Optional emailVerified, + Optional username, + Optional phoneNumber, + Optional phoneVerified, + Optional createdAt, + Optional updatedAt, + Optional> identities, + Optional> appMetadata, + Optional> userMetadata, + Optional picture, + Optional name, + Optional nickname, + Optional> multifactor, + Optional lastIp, + Optional lastLogin, + Optional loginsCount, + Optional blocked, + Optional givenName, + Optional familyName, + Map additionalProperties) { + this.userId = userId; + this.email = email; + this.emailVerified = emailVerified; + this.username = username; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.identities = identities; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.picture = picture; + this.name = name; + this.nickname = nickname; + this.multifactor = multifactor; + this.lastIp = lastIp; + this.lastLogin = lastLogin; + this.loginsCount = loginsCount; + this.blocked = blocked; + this.givenName = givenName; + this.familyName = familyName; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Username of this user. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Array of user identity objects when accounts are linked. + */ + @JsonProperty("identities") + public Optional> getIdentities() { + return identities; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return URL to picture, photo, or avatar of this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Preferred nickname or alias of this user. + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return List of multi-factor authentication providers with which this user has enrolled. + */ + @JsonProperty("multifactor") + public Optional> getMultifactor() { + return multifactor; + } + + /** + * @return Last IP address from which this user logged in. + */ + @JsonProperty("last_ip") + public Optional getLastIp() { + return lastIp; + } + + @JsonProperty("last_login") + public Optional getLastLogin() { + return lastLogin; + } + + /** + * @return Total number of logins this user has performed. + */ + @JsonProperty("logins_count") + public Optional getLoginsCount() { + return loginsCount; + } + + /** + * @return Whether this user was blocked by an administrator (true) or is not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserResponseContent && equalTo((GetUserResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserResponseContent other) { + return userId.equals(other.userId) + && email.equals(other.email) + && emailVerified.equals(other.emailVerified) + && username.equals(other.username) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && identities.equals(other.identities) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && picture.equals(other.picture) + && name.equals(other.name) + && nickname.equals(other.nickname) + && multifactor.equals(other.multifactor) + && lastIp.equals(other.lastIp) + && lastLogin.equals(other.lastLogin) + && loginsCount.equals(other.loginsCount) + && blocked.equals(other.blocked) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userId, + this.email, + this.emailVerified, + this.username, + this.phoneNumber, + this.phoneVerified, + this.createdAt, + this.updatedAt, + this.identities, + this.appMetadata, + this.userMetadata, + this.picture, + this.name, + this.nickname, + this.multifactor, + this.lastIp, + this.lastLogin, + this.loginsCount, + this.blocked, + this.givenName, + this.familyName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> identities = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional nickname = Optional.empty(); + + private Optional> multifactor = Optional.empty(); + + private Optional lastIp = Optional.empty(); + + private Optional lastLogin = Optional.empty(); + + private Optional loginsCount = Optional.empty(); + + private Optional blocked = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional familyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUserResponseContent other) { + userId(other.getUserId()); + email(other.getEmail()); + emailVerified(other.getEmailVerified()); + username(other.getUsername()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + identities(other.getIdentities()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + picture(other.getPicture()); + name(other.getName()); + nickname(other.getNickname()); + multifactor(other.getMultifactor()); + lastIp(other.getLastIp()); + lastLogin(other.getLastLogin()); + loginsCount(other.getLoginsCount()); + blocked(other.getBlocked()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Username of this user.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(UserDateSchema createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(UserDateSchema updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Array of user identity objects when accounts are linked.

+ */ + @JsonSetter(value = "identities", nulls = Nulls.SKIP) + public Builder identities(Optional> identities) { + this.identities = identities; + return this; + } + + public Builder identities(List identities) { + this.identities = Optional.ofNullable(identities); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

URL to picture, photo, or avatar of this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Preferred nickname or alias of this user.

+ */ + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public Builder nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = Optional.ofNullable(nickname); + return this; + } + + /** + *

List of multi-factor authentication providers with which this user has enrolled.

+ */ + @JsonSetter(value = "multifactor", nulls = Nulls.SKIP) + public Builder multifactor(Optional> multifactor) { + this.multifactor = multifactor; + return this; + } + + public Builder multifactor(List multifactor) { + this.multifactor = Optional.ofNullable(multifactor); + return this; + } + + /** + *

Last IP address from which this user logged in.

+ */ + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(Optional lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = Optional.ofNullable(lastIp); + return this; + } + + @JsonSetter(value = "last_login", nulls = Nulls.SKIP) + public Builder lastLogin(Optional lastLogin) { + this.lastLogin = lastLogin; + return this; + } + + public Builder lastLogin(UserDateSchema lastLogin) { + this.lastLogin = Optional.ofNullable(lastLogin); + return this; + } + + /** + *

Total number of logins this user has performed.

+ */ + @JsonSetter(value = "logins_count", nulls = Nulls.SKIP) + public Builder loginsCount(Optional loginsCount) { + this.loginsCount = loginsCount; + return this; + } + + public Builder loginsCount(Integer loginsCount) { + this.loginsCount = Optional.ofNullable(loginsCount); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or is not (false).

+ */ + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public Builder blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + public Builder blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + public GetUserResponseContent build() { + return new GetUserResponseContent( + userId, + email, + emailVerified, + username, + phoneNumber, + phoneVerified, + createdAt, + updatedAt, + identities, + appMetadata, + userMetadata, + picture, + name, + nickname, + multifactor, + lastIp, + lastLogin, + loginsCount, + blocked, + givenName, + familyName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java new file mode 100644 index 000000000..ca2fa1069 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetVerifiableCredentialTemplateResponseContent.Builder.class) +public final class GetVerifiableCredentialTemplateResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional type; + + private final Optional dialect; + + private final Optional presentation; + + private final Optional customCertificateAuthority; + + private final Optional wellKnownTrustedIssuers; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetVerifiableCredentialTemplateResponseContent( + Optional id, + Optional name, + Optional type, + Optional dialect, + Optional presentation, + Optional customCertificateAuthority, + Optional wellKnownTrustedIssuers, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.customCertificateAuthority = customCertificateAuthority; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the template. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The type of the template. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The dialect of the template. + */ + @JsonProperty("dialect") + public Optional getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public Optional getPresentation() { + return presentation; + } + + /** + * @return The custom certificate authority. + */ + @JsonProperty("custom_certificate_authority") + public Optional getCustomCertificateAuthority() { + return customCertificateAuthority; + } + + /** + * @return The well-known trusted issuers, comma separated. + */ + @JsonProperty("well_known_trusted_issuers") + public Optional getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetVerifiableCredentialTemplateResponseContent + && equalTo((GetVerifiableCredentialTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetVerifiableCredentialTemplateResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && customCertificateAuthority.equals(other.customCertificateAuthority) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.type, + this.dialect, + this.presentation, + this.customCertificateAuthority, + this.wellKnownTrustedIssuers, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional dialect = Optional.empty(); + + private Optional presentation = Optional.empty(); + + private Optional customCertificateAuthority = Optional.empty(); + + private Optional wellKnownTrustedIssuers = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetVerifiableCredentialTemplateResponseContent other) { + id(other.getId()); + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + customCertificateAuthority(other.getCustomCertificateAuthority()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the template.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The type of the template.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The dialect of the template.

+ */ + @JsonSetter(value = "dialect", nulls = Nulls.SKIP) + public Builder dialect(Optional dialect) { + this.dialect = dialect; + return this; + } + + public Builder dialect(String dialect) { + this.dialect = Optional.ofNullable(dialect); + return this; + } + + @JsonSetter(value = "presentation", nulls = Nulls.SKIP) + public Builder presentation(Optional presentation) { + this.presentation = presentation; + return this; + } + + public Builder presentation(MdlPresentationRequest presentation) { + this.presentation = Optional.ofNullable(presentation); + return this; + } + + /** + *

The custom certificate authority.

+ */ + @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) + public Builder customCertificateAuthority(Optional customCertificateAuthority) { + this.customCertificateAuthority = customCertificateAuthority; + return this; + } + + public Builder customCertificateAuthority(String customCertificateAuthority) { + this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); + return this; + } + + /** + *

The well-known trusted issuers, comma separated.

+ */ + @JsonSetter(value = "well_known_trusted_issuers", nulls = Nulls.SKIP) + public Builder wellKnownTrustedIssuers(Optional wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + return this; + } + + public Builder wellKnownTrustedIssuers(String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = Optional.ofNullable(wellKnownTrustedIssuers); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public GetVerifiableCredentialTemplateResponseContent build() { + return new GetVerifiableCredentialTemplateResponseContent( + id, + name, + type, + dialect, + presentation, + customCertificateAuthority, + wellKnownTrustedIssuers, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java new file mode 100644 index 000000000..03409797d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianEnrollmentFactorEnum { + public static final GuardianEnrollmentFactorEnum EMAIL = new GuardianEnrollmentFactorEnum(Value.EMAIL, "email"); + + public static final GuardianEnrollmentFactorEnum OTP = new GuardianEnrollmentFactorEnum(Value.OTP, "otp"); + + public static final GuardianEnrollmentFactorEnum WEBAUTHN_PLATFORM = + new GuardianEnrollmentFactorEnum(Value.WEBAUTHN_PLATFORM, "webauthn-platform"); + + public static final GuardianEnrollmentFactorEnum PHONE = new GuardianEnrollmentFactorEnum(Value.PHONE, "phone"); + + public static final GuardianEnrollmentFactorEnum PUSH_NOTIFICATION = + new GuardianEnrollmentFactorEnum(Value.PUSH_NOTIFICATION, "push-notification"); + + public static final GuardianEnrollmentFactorEnum WEBAUTHN_ROAMING = + new GuardianEnrollmentFactorEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + private final Value value; + + private final String string; + + GuardianEnrollmentFactorEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianEnrollmentFactorEnum + && this.string.equals(((GuardianEnrollmentFactorEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case OTP: + return visitor.visitOtp(); + case WEBAUTHN_PLATFORM: + return visitor.visitWebauthnPlatform(); + case PHONE: + return visitor.visitPhone(); + case PUSH_NOTIFICATION: + return visitor.visitPushNotification(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianEnrollmentFactorEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "otp": + return OTP; + case "webauthn-platform": + return WEBAUTHN_PLATFORM; + case "phone": + return PHONE; + case "push-notification": + return PUSH_NOTIFICATION; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + default: + return new GuardianEnrollmentFactorEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PUSH_NOTIFICATION, + + PHONE, + + EMAIL, + + OTP, + + WEBAUTHN_ROAMING, + + WEBAUTHN_PLATFORM, + + UNKNOWN + } + + public interface Visitor { + T visitPushNotification(); + + T visitPhone(); + + T visitEmail(); + + T visitOtp(); + + T visitWebauthnRoaming(); + + T visitWebauthnPlatform(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java new file mode 100644 index 000000000..203f74178 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianEnrollmentStatus { + public static final GuardianEnrollmentStatus PENDING = new GuardianEnrollmentStatus(Value.PENDING, "pending"); + + public static final GuardianEnrollmentStatus CONFIRMED = new GuardianEnrollmentStatus(Value.CONFIRMED, "confirmed"); + + private final Value value; + + private final String string; + + GuardianEnrollmentStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianEnrollmentStatus + && this.string.equals(((GuardianEnrollmentStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case CONFIRMED: + return visitor.visitConfirmed(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianEnrollmentStatus valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + case "confirmed": + return CONFIRMED; + default: + return new GuardianEnrollmentStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + CONFIRMED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitConfirmed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java new file mode 100644 index 000000000..8cca5a606 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GuardianFactor.Builder.class) +public final class GuardianFactor { + private final boolean enabled; + + private final Optional trialExpired; + + private final Optional name; + + private final Map additionalProperties; + + private GuardianFactor( + boolean enabled, + Optional trialExpired, + Optional name, + Map additionalProperties) { + this.enabled = enabled; + this.trialExpired = trialExpired; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether this factor is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + /** + * @return Whether trial limits have been exceeded. + */ + @JsonProperty("trial_expired") + public Optional getTrialExpired() { + return trialExpired; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GuardianFactor && equalTo((GuardianFactor) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GuardianFactor other) { + return enabled == other.enabled && trialExpired.equals(other.trialExpired) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.trialExpired, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether this factor is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(GuardianFactor other); + } + + public interface _FinalStage { + GuardianFactor build(); + + /** + *

Whether trial limits have been exceeded.

+ */ + _FinalStage trialExpired(Optional trialExpired); + + _FinalStage trialExpired(Boolean trialExpired); + + _FinalStage name(Optional name); + + _FinalStage name(GuardianFactorNameEnum name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + private Optional name = Optional.empty(); + + private Optional trialExpired = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GuardianFactor other) { + enabled(other.getEnabled()); + trialExpired(other.getTrialExpired()); + name(other.getName()); + return this; + } + + /** + *

Whether this factor is enabled (true) or disabled (false).

+ *

Whether this factor is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @java.lang.Override + public _FinalStage name(GuardianFactorNameEnum name) { + this.name = Optional.ofNullable(name); + return this; + } + + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

Whether trial limits have been exceeded.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage trialExpired(Boolean trialExpired) { + this.trialExpired = Optional.ofNullable(trialExpired); + return this; + } + + /** + *

Whether trial limits have been exceeded.

+ */ + @java.lang.Override + @JsonSetter(value = "trial_expired", nulls = Nulls.SKIP) + public _FinalStage trialExpired(Optional trialExpired) { + this.trialExpired = trialExpired; + return this; + } + + @java.lang.Override + public GuardianFactor build() { + return new GuardianFactor(enabled, trialExpired, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java new file mode 100644 index 000000000..4c9117e5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianFactorNameEnum { + public static final GuardianFactorNameEnum EMAIL = new GuardianFactorNameEnum(Value.EMAIL, "email"); + + public static final GuardianFactorNameEnum DUO = new GuardianFactorNameEnum(Value.DUO, "duo"); + + public static final GuardianFactorNameEnum OTP = new GuardianFactorNameEnum(Value.OTP, "otp"); + + public static final GuardianFactorNameEnum WEBAUTHN_PLATFORM = + new GuardianFactorNameEnum(Value.WEBAUTHN_PLATFORM, "webauthn-platform"); + + public static final GuardianFactorNameEnum PUSH_NOTIFICATION = + new GuardianFactorNameEnum(Value.PUSH_NOTIFICATION, "push-notification"); + + public static final GuardianFactorNameEnum SMS = new GuardianFactorNameEnum(Value.SMS, "sms"); + + public static final GuardianFactorNameEnum WEBAUTHN_ROAMING = + new GuardianFactorNameEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + public static final GuardianFactorNameEnum RECOVERY_CODE = + new GuardianFactorNameEnum(Value.RECOVERY_CODE, "recovery-code"); + + private final Value value; + + private final String string; + + GuardianFactorNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianFactorNameEnum + && this.string.equals(((GuardianFactorNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case DUO: + return visitor.visitDuo(); + case OTP: + return visitor.visitOtp(); + case WEBAUTHN_PLATFORM: + return visitor.visitWebauthnPlatform(); + case PUSH_NOTIFICATION: + return visitor.visitPushNotification(); + case SMS: + return visitor.visitSms(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case RECOVERY_CODE: + return visitor.visitRecoveryCode(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianFactorNameEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "duo": + return DUO; + case "otp": + return OTP; + case "webauthn-platform": + return WEBAUTHN_PLATFORM; + case "push-notification": + return PUSH_NOTIFICATION; + case "sms": + return SMS; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + case "recovery-code": + return RECOVERY_CODE; + default: + return new GuardianFactorNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PUSH_NOTIFICATION, + + SMS, + + EMAIL, + + DUO, + + OTP, + + WEBAUTHN_ROAMING, + + WEBAUTHN_PLATFORM, + + RECOVERY_CODE, + + UNKNOWN + } + + public interface Visitor { + T visitPushNotification(); + + T visitSms(); + + T visitEmail(); + + T visitDuo(); + + T visitOtp(); + + T visitWebauthnRoaming(); + + T visitWebauthnPlatform(); + + T visitRecoveryCode(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java new file mode 100644 index 000000000..028a2a4e7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianFactorPhoneFactorMessageTypeEnum { + public static final GuardianFactorPhoneFactorMessageTypeEnum VOICE = + new GuardianFactorPhoneFactorMessageTypeEnum(Value.VOICE, "voice"); + + public static final GuardianFactorPhoneFactorMessageTypeEnum SMS = + new GuardianFactorPhoneFactorMessageTypeEnum(Value.SMS, "sms"); + + private final Value value; + + private final String string; + + GuardianFactorPhoneFactorMessageTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianFactorPhoneFactorMessageTypeEnum + && this.string.equals(((GuardianFactorPhoneFactorMessageTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case VOICE: + return visitor.visitVoice(); + case SMS: + return visitor.visitSms(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianFactorPhoneFactorMessageTypeEnum valueOf(String value) { + switch (value) { + case "voice": + return VOICE; + case "sms": + return SMS; + default: + return new GuardianFactorPhoneFactorMessageTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SMS, + + VOICE, + + UNKNOWN + } + + public interface Visitor { + T visitSms(); + + T visitVoice(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java new file mode 100644 index 000000000..a960f2730 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianFactorsProviderPushNotificationProviderDataEnum { + public static final GuardianFactorsProviderPushNotificationProviderDataEnum GUARDIAN = + new GuardianFactorsProviderPushNotificationProviderDataEnum(Value.GUARDIAN, "guardian"); + + public static final GuardianFactorsProviderPushNotificationProviderDataEnum SNS = + new GuardianFactorsProviderPushNotificationProviderDataEnum(Value.SNS, "sns"); + + public static final GuardianFactorsProviderPushNotificationProviderDataEnum DIRECT = + new GuardianFactorsProviderPushNotificationProviderDataEnum(Value.DIRECT, "direct"); + + private final Value value; + + private final String string; + + GuardianFactorsProviderPushNotificationProviderDataEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianFactorsProviderPushNotificationProviderDataEnum + && this.string.equals( + ((GuardianFactorsProviderPushNotificationProviderDataEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GUARDIAN: + return visitor.visitGuardian(); + case SNS: + return visitor.visitSns(); + case DIRECT: + return visitor.visitDirect(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianFactorsProviderPushNotificationProviderDataEnum valueOf(String value) { + switch (value) { + case "guardian": + return GUARDIAN; + case "sns": + return SNS; + case "direct": + return DIRECT; + default: + return new GuardianFactorsProviderPushNotificationProviderDataEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + GUARDIAN, + + SNS, + + DIRECT, + + UNKNOWN + } + + public interface Visitor { + T visitGuardian(); + + T visitSns(); + + T visitDirect(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java new file mode 100644 index 000000000..d56e13452 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GuardianFactorsProviderSmsProviderEnum { + public static final GuardianFactorsProviderSmsProviderEnum PHONE_MESSAGE_HOOK = + new GuardianFactorsProviderSmsProviderEnum(Value.PHONE_MESSAGE_HOOK, "phone-message-hook"); + + public static final GuardianFactorsProviderSmsProviderEnum TWILIO = + new GuardianFactorsProviderSmsProviderEnum(Value.TWILIO, "twilio"); + + public static final GuardianFactorsProviderSmsProviderEnum AUTH0 = + new GuardianFactorsProviderSmsProviderEnum(Value.AUTH0, "auth0"); + + private final Value value; + + private final String string; + + GuardianFactorsProviderSmsProviderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GuardianFactorsProviderSmsProviderEnum + && this.string.equals(((GuardianFactorsProviderSmsProviderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PHONE_MESSAGE_HOOK: + return visitor.visitPhoneMessageHook(); + case TWILIO: + return visitor.visitTwilio(); + case AUTH0: + return visitor.visitAuth0(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GuardianFactorsProviderSmsProviderEnum valueOf(String value) { + switch (value) { + case "phone-message-hook": + return PHONE_MESSAGE_HOOK; + case "twilio": + return TWILIO; + case "auth0": + return AUTH0; + default: + return new GuardianFactorsProviderSmsProviderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTH0, + + TWILIO, + + PHONE_MESSAGE_HOOK, + + UNKNOWN + } + + public interface Visitor { + T visitAuth0(); + + T visitTwilio(); + + T visitPhoneMessageHook(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Hook.java b/src/main/java/com/auth0/client/mgmt/types/Hook.java new file mode 100644 index 000000000..02d25ddc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Hook.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Hook.Builder.class) +public final class Hook { + private final Optional triggerId; + + private final Optional id; + + private final Optional name; + + private final Optional enabled; + + private final Optional script; + + private final Optional> dependencies; + + private final Map additionalProperties; + + private Hook( + Optional triggerId, + Optional id, + Optional name, + Optional enabled, + Optional script, + Optional> dependencies, + Map additionalProperties) { + this.triggerId = triggerId; + this.id = id; + this.name = name; + this.enabled = enabled; + this.script = script; + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + /** + * @return Trigger ID + */ + @JsonProperty("triggerId") + public Optional getTriggerId() { + return triggerId; + } + + /** + * @return ID of this hook. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Hook && equalTo((Hook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Hook other) { + return triggerId.equals(other.triggerId) + && id.equals(other.id) + && name.equals(other.name) + && enabled.equals(other.enabled) + && script.equals(other.script) + && dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional triggerId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Hook other) { + triggerId(other.getTriggerId()); + id(other.getId()); + name(other.getName()); + enabled(other.getEnabled()); + script(other.getScript()); + dependencies(other.getDependencies()); + return this; + } + + /** + *

Trigger ID

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + /** + *

ID of this hook.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this hook.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public Hook build() { + return new Hook(triggerId, id, name, enabled, script, dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java new file mode 100644 index 000000000..e90d154bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class HookTriggerIdEnum { + public static final HookTriggerIdEnum CREDENTIALS_EXCHANGE = + new HookTriggerIdEnum(Value.CREDENTIALS_EXCHANGE, "credentials-exchange"); + + public static final HookTriggerIdEnum POST_USER_REGISTRATION = + new HookTriggerIdEnum(Value.POST_USER_REGISTRATION, "post-user-registration"); + + public static final HookTriggerIdEnum PRE_USER_REGISTRATION = + new HookTriggerIdEnum(Value.PRE_USER_REGISTRATION, "pre-user-registration"); + + public static final HookTriggerIdEnum POST_CHANGE_PASSWORD = + new HookTriggerIdEnum(Value.POST_CHANGE_PASSWORD, "post-change-password"); + + public static final HookTriggerIdEnum SEND_PHONE_MESSAGE = + new HookTriggerIdEnum(Value.SEND_PHONE_MESSAGE, "send-phone-message"); + + private final Value value; + + private final String string; + + HookTriggerIdEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof HookTriggerIdEnum && this.string.equals(((HookTriggerIdEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CREDENTIALS_EXCHANGE: + return visitor.visitCredentialsExchange(); + case POST_USER_REGISTRATION: + return visitor.visitPostUserRegistration(); + case PRE_USER_REGISTRATION: + return visitor.visitPreUserRegistration(); + case POST_CHANGE_PASSWORD: + return visitor.visitPostChangePassword(); + case SEND_PHONE_MESSAGE: + return visitor.visitSendPhoneMessage(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static HookTriggerIdEnum valueOf(String value) { + switch (value) { + case "credentials-exchange": + return CREDENTIALS_EXCHANGE; + case "post-user-registration": + return POST_USER_REGISTRATION; + case "pre-user-registration": + return PRE_USER_REGISTRATION; + case "post-change-password": + return POST_CHANGE_PASSWORD; + case "send-phone-message": + return SEND_PHONE_MESSAGE; + default: + return new HookTriggerIdEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CREDENTIALS_EXCHANGE, + + PRE_USER_REGISTRATION, + + POST_USER_REGISTRATION, + + POST_CHANGE_PASSWORD, + + SEND_PHONE_MESSAGE, + + UNKNOWN + } + + public interface Visitor { + T visitCredentialsExchange(); + + T visitPreUserRegistration(); + + T visitPostUserRegistration(); + + T visitPostChangePassword(); + + T visitSendPhoneMessage(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java new file mode 100644 index 000000000..1764d0864 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = HttpCustomHeader.Builder.class) +public final class HttpCustomHeader { + private final Optional header; + + private final Optional value; + + private final Map additionalProperties; + + private HttpCustomHeader( + Optional header, Optional value, Map additionalProperties) { + this.header = header; + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return HTTP header name + */ + @JsonProperty("header") + public Optional getHeader() { + return header; + } + + /** + * @return HTTP header value + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof HttpCustomHeader && equalTo((HttpCustomHeader) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(HttpCustomHeader other) { + return header.equals(other.header) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.header, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional header = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(HttpCustomHeader other) { + header(other.getHeader()); + value(other.getValue()); + return this; + } + + /** + *

HTTP header name

+ */ + @JsonSetter(value = "header", nulls = Nulls.SKIP) + public Builder header(Optional header) { + this.header = header; + return this; + } + + public Builder header(String header) { + this.header = Optional.ofNullable(header); + return this; + } + + /** + *

HTTP header value

+ */ + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + public HttpCustomHeader build() { + return new HttpCustomHeader(header, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Identity.java b/src/main/java/com/auth0/client/mgmt/types/Identity.java new file mode 100644 index 000000000..3018d23f8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Identity.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Identity.Builder.class) +public final class Identity { + private final String userId; + + private final IdentityProviderEnum provider; + + private final Map additionalProperties; + + private Identity(String userId, IdentityProviderEnum provider, Map additionalProperties) { + this.userId = userId; + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id of the identity to be verified. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + @JsonProperty("provider") + public IdentityProviderEnum getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Identity && equalTo((Identity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Identity other) { + return userId.equals(other.userId) && provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userId, this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id of the identity to be verified.

+ */ + ProviderStage userId(@NotNull String userId); + + Builder from(Identity other); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull IdentityProviderEnum provider); + } + + public interface _FinalStage { + Identity build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, ProviderStage, _FinalStage { + private String userId; + + private IdentityProviderEnum provider; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Identity other) { + userId(other.getUserId()); + provider(other.getProvider()); + return this; + } + + /** + *

user_id of the identity to be verified.

+ *

user_id of the identity to be verified.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public ProviderStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull IdentityProviderEnum provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + public Identity build() { + return new Identity(userId, provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java new file mode 100644 index 000000000..38a726017 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java @@ -0,0 +1,692 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IdentityProviderEnum { + public static final IdentityProviderEnum SHOP = new IdentityProviderEnum(Value.SHOP, "shop"); + + public static final IdentityProviderEnum AUTH0OIDC = new IdentityProviderEnum(Value.AUTH0OIDC, "auth0-oidc"); + + public static final IdentityProviderEnum DWOLLA = new IdentityProviderEnum(Value.DWOLLA, "dwolla"); + + public static final IdentityProviderEnum FLICKR = new IdentityProviderEnum(Value.FLICKR, "flickr"); + + public static final IdentityProviderEnum OKTA = new IdentityProviderEnum(Value.OKTA, "okta"); + + public static final IdentityProviderEnum PLANNINGCENTER = + new IdentityProviderEnum(Value.PLANNINGCENTER, "planningcenter"); + + public static final IdentityProviderEnum GOOGLE_OAUTH2 = + new IdentityProviderEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); + + public static final IdentityProviderEnum AUTH0 = new IdentityProviderEnum(Value.AUTH0, "auth0"); + + public static final IdentityProviderEnum EXACT = new IdentityProviderEnum(Value.EXACT, "exact"); + + public static final IdentityProviderEnum WORDPRESS = new IdentityProviderEnum(Value.WORDPRESS, "wordpress"); + + public static final IdentityProviderEnum FITBIT = new IdentityProviderEnum(Value.FITBIT, "fitbit"); + + public static final IdentityProviderEnum EVERNOTE = new IdentityProviderEnum(Value.EVERNOTE, "evernote"); + + public static final IdentityProviderEnum SHAREPOINT = new IdentityProviderEnum(Value.SHAREPOINT, "sharepoint"); + + public static final IdentityProviderEnum SHOPIFY = new IdentityProviderEnum(Value.SHOPIFY, "shopify"); + + public static final IdentityProviderEnum SALESFORCE_SANDBOX = + new IdentityProviderEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); + + public static final IdentityProviderEnum MIICARD = new IdentityProviderEnum(Value.MIICARD, "miicard"); + + public static final IdentityProviderEnum FACEBOOK = new IdentityProviderEnum(Value.FACEBOOK, "facebook"); + + public static final IdentityProviderEnum OAUTH1 = new IdentityProviderEnum(Value.OAUTH1, "oauth1"); + + public static final IdentityProviderEnum APPLE = new IdentityProviderEnum(Value.APPLE, "apple"); + + public static final IdentityProviderEnum UNTAPPD = new IdentityProviderEnum(Value.UNTAPPD, "untappd"); + + public static final IdentityProviderEnum AMAZON = new IdentityProviderEnum(Value.AMAZON, "amazon"); + + public static final IdentityProviderEnum LINE = new IdentityProviderEnum(Value.LINE, "line"); + + public static final IdentityProviderEnum BITBUCKET = new IdentityProviderEnum(Value.BITBUCKET, "bitbucket"); + + public static final IdentityProviderEnum GITHUB = new IdentityProviderEnum(Value.GITHUB, "github"); + + public static final IdentityProviderEnum SALESFORCE = new IdentityProviderEnum(Value.SALESFORCE, "salesforce"); + + public static final IdentityProviderEnum OFFICE365 = new IdentityProviderEnum(Value.OFFICE365, "office365"); + + public static final IdentityProviderEnum SMS = new IdentityProviderEnum(Value.SMS, "sms"); + + public static final IdentityProviderEnum AOL = new IdentityProviderEnum(Value.AOL, "aol"); + + public static final IdentityProviderEnum TWITTER = new IdentityProviderEnum(Value.TWITTER, "twitter"); + + public static final IdentityProviderEnum WINDOWSLIVE = new IdentityProviderEnum(Value.WINDOWSLIVE, "windowslive"); + + public static final IdentityProviderEnum YANDEX = new IdentityProviderEnum(Value.YANDEX, "yandex"); + + public static final IdentityProviderEnum AD = new IdentityProviderEnum(Value.AD, "ad"); + + public static final IdentityProviderEnum BAIDU = new IdentityProviderEnum(Value.BAIDU, "baidu"); + + public static final IdentityProviderEnum BITLY = new IdentityProviderEnum(Value.BITLY, "bitly"); + + public static final IdentityProviderEnum PAYPAL_SANDBOX = + new IdentityProviderEnum(Value.PAYPAL_SANDBOX, "paypal-sandbox"); + + public static final IdentityProviderEnum RENREN = new IdentityProviderEnum(Value.RENREN, "renren"); + + public static final IdentityProviderEnum SAMLP = new IdentityProviderEnum(Value.SAMLP, "samlp"); + + public static final IdentityProviderEnum DROPBOX = new IdentityProviderEnum(Value.DROPBOX, "dropbox"); + + public static final IdentityProviderEnum VKONTAKTE = new IdentityProviderEnum(Value.VKONTAKTE, "vkontakte"); + + public static final IdentityProviderEnum PINGFEDERATE = + new IdentityProviderEnum(Value.PINGFEDERATE, "pingfederate"); + + public static final IdentityProviderEnum INSTAGRAM = new IdentityProviderEnum(Value.INSTAGRAM, "instagram"); + + public static final IdentityProviderEnum THIRTYSEVENSIGNALS = + new IdentityProviderEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); + + public static final IdentityProviderEnum WAAD = new IdentityProviderEnum(Value.WAAD, "waad"); + + public static final IdentityProviderEnum THECITY_SANDBOX = + new IdentityProviderEnum(Value.THECITY_SANDBOX, "thecity-sandbox"); + + public static final IdentityProviderEnum OIDC = new IdentityProviderEnum(Value.OIDC, "oidc"); + + public static final IdentityProviderEnum YAMMER = new IdentityProviderEnum(Value.YAMMER, "yammer"); + + public static final IdentityProviderEnum EVERNOTE_SANDBOX = + new IdentityProviderEnum(Value.EVERNOTE_SANDBOX, "evernote-sandbox"); + + public static final IdentityProviderEnum SALESFORCE_COMMUNITY = + new IdentityProviderEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); + + public static final IdentityProviderEnum DACCOUNT = new IdentityProviderEnum(Value.DACCOUNT, "daccount"); + + public static final IdentityProviderEnum SOUNDCLOUD = new IdentityProviderEnum(Value.SOUNDCLOUD, "soundcloud"); + + public static final IdentityProviderEnum OAUTH2 = new IdentityProviderEnum(Value.OAUTH2, "oauth2"); + + public static final IdentityProviderEnum BOX = new IdentityProviderEnum(Value.BOX, "box"); + + public static final IdentityProviderEnum IP = new IdentityProviderEnum(Value.IP, "ip"); + + public static final IdentityProviderEnum ADFS = new IdentityProviderEnum(Value.ADFS, "adfs"); + + public static final IdentityProviderEnum EMAIL = new IdentityProviderEnum(Value.EMAIL, "email"); + + public static final IdentityProviderEnum CUSTOM = new IdentityProviderEnum(Value.CUSTOM, "custom"); + + public static final IdentityProviderEnum YAHOO = new IdentityProviderEnum(Value.YAHOO, "yahoo"); + + public static final IdentityProviderEnum WEIBO = new IdentityProviderEnum(Value.WEIBO, "weibo"); + + public static final IdentityProviderEnum GOOGLE_APPS = new IdentityProviderEnum(Value.GOOGLE_APPS, "google-apps"); + + public static final IdentityProviderEnum PAYPAL = new IdentityProviderEnum(Value.PAYPAL, "paypal"); + + public static final IdentityProviderEnum LINKEDIN = new IdentityProviderEnum(Value.LINKEDIN, "linkedin"); + + public static final IdentityProviderEnum THECITY = new IdentityProviderEnum(Value.THECITY, "thecity"); + + private final Value value; + + private final String string; + + IdentityProviderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IdentityProviderEnum && this.string.equals(((IdentityProviderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHOP: + return visitor.visitShop(); + case AUTH0OIDC: + return visitor.visitAuth0Oidc(); + case DWOLLA: + return visitor.visitDwolla(); + case FLICKR: + return visitor.visitFlickr(); + case OKTA: + return visitor.visitOkta(); + case PLANNINGCENTER: + return visitor.visitPlanningcenter(); + case GOOGLE_OAUTH2: + return visitor.visitGoogleOauth2(); + case AUTH0: + return visitor.visitAuth0(); + case EXACT: + return visitor.visitExact(); + case WORDPRESS: + return visitor.visitWordpress(); + case FITBIT: + return visitor.visitFitbit(); + case EVERNOTE: + return visitor.visitEvernote(); + case SHAREPOINT: + return visitor.visitSharepoint(); + case SHOPIFY: + return visitor.visitShopify(); + case SALESFORCE_SANDBOX: + return visitor.visitSalesforceSandbox(); + case MIICARD: + return visitor.visitMiicard(); + case FACEBOOK: + return visitor.visitFacebook(); + case OAUTH1: + return visitor.visitOauth1(); + case APPLE: + return visitor.visitApple(); + case UNTAPPD: + return visitor.visitUntappd(); + case AMAZON: + return visitor.visitAmazon(); + case LINE: + return visitor.visitLine(); + case BITBUCKET: + return visitor.visitBitbucket(); + case GITHUB: + return visitor.visitGithub(); + case SALESFORCE: + return visitor.visitSalesforce(); + case OFFICE365: + return visitor.visitOffice365(); + case SMS: + return visitor.visitSms(); + case AOL: + return visitor.visitAol(); + case TWITTER: + return visitor.visitTwitter(); + case WINDOWSLIVE: + return visitor.visitWindowslive(); + case YANDEX: + return visitor.visitYandex(); + case AD: + return visitor.visitAd(); + case BAIDU: + return visitor.visitBaidu(); + case BITLY: + return visitor.visitBitly(); + case PAYPAL_SANDBOX: + return visitor.visitPaypalSandbox(); + case RENREN: + return visitor.visitRenren(); + case SAMLP: + return visitor.visitSamlp(); + case DROPBOX: + return visitor.visitDropbox(); + case VKONTAKTE: + return visitor.visitVkontakte(); + case PINGFEDERATE: + return visitor.visitPingfederate(); + case INSTAGRAM: + return visitor.visitInstagram(); + case THIRTYSEVENSIGNALS: + return visitor.visitThirtysevensignals(); + case WAAD: + return visitor.visitWaad(); + case THECITY_SANDBOX: + return visitor.visitThecitySandbox(); + case OIDC: + return visitor.visitOidc(); + case YAMMER: + return visitor.visitYammer(); + case EVERNOTE_SANDBOX: + return visitor.visitEvernoteSandbox(); + case SALESFORCE_COMMUNITY: + return visitor.visitSalesforceCommunity(); + case DACCOUNT: + return visitor.visitDaccount(); + case SOUNDCLOUD: + return visitor.visitSoundcloud(); + case OAUTH2: + return visitor.visitOauth2(); + case BOX: + return visitor.visitBox(); + case IP: + return visitor.visitIp(); + case ADFS: + return visitor.visitAdfs(); + case EMAIL: + return visitor.visitEmail(); + case CUSTOM: + return visitor.visitCustom(); + case YAHOO: + return visitor.visitYahoo(); + case WEIBO: + return visitor.visitWeibo(); + case GOOGLE_APPS: + return visitor.visitGoogleApps(); + case PAYPAL: + return visitor.visitPaypal(); + case LINKEDIN: + return visitor.visitLinkedin(); + case THECITY: + return visitor.visitThecity(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IdentityProviderEnum valueOf(String value) { + switch (value) { + case "shop": + return SHOP; + case "auth0-oidc": + return AUTH0OIDC; + case "dwolla": + return DWOLLA; + case "flickr": + return FLICKR; + case "okta": + return OKTA; + case "planningcenter": + return PLANNINGCENTER; + case "google-oauth2": + return GOOGLE_OAUTH2; + case "auth0": + return AUTH0; + case "exact": + return EXACT; + case "wordpress": + return WORDPRESS; + case "fitbit": + return FITBIT; + case "evernote": + return EVERNOTE; + case "sharepoint": + return SHAREPOINT; + case "shopify": + return SHOPIFY; + case "salesforce-sandbox": + return SALESFORCE_SANDBOX; + case "miicard": + return MIICARD; + case "facebook": + return FACEBOOK; + case "oauth1": + return OAUTH1; + case "apple": + return APPLE; + case "untappd": + return UNTAPPD; + case "amazon": + return AMAZON; + case "line": + return LINE; + case "bitbucket": + return BITBUCKET; + case "github": + return GITHUB; + case "salesforce": + return SALESFORCE; + case "office365": + return OFFICE365; + case "sms": + return SMS; + case "aol": + return AOL; + case "twitter": + return TWITTER; + case "windowslive": + return WINDOWSLIVE; + case "yandex": + return YANDEX; + case "ad": + return AD; + case "baidu": + return BAIDU; + case "bitly": + return BITLY; + case "paypal-sandbox": + return PAYPAL_SANDBOX; + case "renren": + return RENREN; + case "samlp": + return SAMLP; + case "dropbox": + return DROPBOX; + case "vkontakte": + return VKONTAKTE; + case "pingfederate": + return PINGFEDERATE; + case "instagram": + return INSTAGRAM; + case "thirtysevensignals": + return THIRTYSEVENSIGNALS; + case "waad": + return WAAD; + case "thecity-sandbox": + return THECITY_SANDBOX; + case "oidc": + return OIDC; + case "yammer": + return YAMMER; + case "evernote-sandbox": + return EVERNOTE_SANDBOX; + case "salesforce-community": + return SALESFORCE_COMMUNITY; + case "daccount": + return DACCOUNT; + case "soundcloud": + return SOUNDCLOUD; + case "oauth2": + return OAUTH2; + case "box": + return BOX; + case "ip": + return IP; + case "adfs": + return ADFS; + case "email": + return EMAIL; + case "custom": + return CUSTOM; + case "yahoo": + return YAHOO; + case "weibo": + return WEIBO; + case "google-apps": + return GOOGLE_APPS; + case "paypal": + return PAYPAL; + case "linkedin": + return LINKEDIN; + case "thecity": + return THECITY; + default: + return new IdentityProviderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AD, + + ADFS, + + AMAZON, + + APPLE, + + DROPBOX, + + BITBUCKET, + + AOL, + + AUTH0OIDC, + + AUTH0, + + BAIDU, + + BITLY, + + BOX, + + CUSTOM, + + DACCOUNT, + + DWOLLA, + + EMAIL, + + EVERNOTE_SANDBOX, + + EVERNOTE, + + EXACT, + + FACEBOOK, + + FITBIT, + + FLICKR, + + GITHUB, + + GOOGLE_APPS, + + GOOGLE_OAUTH2, + + INSTAGRAM, + + IP, + + LINE, + + LINKEDIN, + + MIICARD, + + OAUTH1, + + OAUTH2, + + OFFICE365, + + OIDC, + + OKTA, + + PAYPAL, + + PAYPAL_SANDBOX, + + PINGFEDERATE, + + PLANNINGCENTER, + + RENREN, + + SALESFORCE_COMMUNITY, + + SALESFORCE_SANDBOX, + + SALESFORCE, + + SAMLP, + + SHAREPOINT, + + SHOPIFY, + + SHOP, + + SMS, + + SOUNDCLOUD, + + THECITY_SANDBOX, + + THECITY, + + THIRTYSEVENSIGNALS, + + TWITTER, + + UNTAPPD, + + VKONTAKTE, + + WAAD, + + WEIBO, + + WINDOWSLIVE, + + WORDPRESS, + + YAHOO, + + YAMMER, + + YANDEX, + + UNKNOWN + } + + public interface Visitor { + T visitAd(); + + T visitAdfs(); + + T visitAmazon(); + + T visitApple(); + + T visitDropbox(); + + T visitBitbucket(); + + T visitAol(); + + T visitAuth0Oidc(); + + T visitAuth0(); + + T visitBaidu(); + + T visitBitly(); + + T visitBox(); + + T visitCustom(); + + T visitDaccount(); + + T visitDwolla(); + + T visitEmail(); + + T visitEvernoteSandbox(); + + T visitEvernote(); + + T visitExact(); + + T visitFacebook(); + + T visitFitbit(); + + T visitFlickr(); + + T visitGithub(); + + T visitGoogleApps(); + + T visitGoogleOauth2(); + + T visitInstagram(); + + T visitIp(); + + T visitLine(); + + T visitLinkedin(); + + T visitMiicard(); + + T visitOauth1(); + + T visitOauth2(); + + T visitOffice365(); + + T visitOidc(); + + T visitOkta(); + + T visitPaypal(); + + T visitPaypalSandbox(); + + T visitPingfederate(); + + T visitPlanningcenter(); + + T visitRenren(); + + T visitSalesforceCommunity(); + + T visitSalesforceSandbox(); + + T visitSalesforce(); + + T visitSamlp(); + + T visitSharepoint(); + + T visitShopify(); + + T visitShop(); + + T visitSms(); + + T visitSoundcloud(); + + T visitThecitySandbox(); + + T visitThecity(); + + T visitThirtysevensignals(); + + T visitTwitter(); + + T visitUntappd(); + + T visitVkontakte(); + + T visitWaad(); + + T visitWeibo(); + + T visitWindowslive(); + + T visitWordpress(); + + T visitYahoo(); + + T visitYammer(); + + T visitYandex(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java new file mode 100644 index 000000000..aab4a35c8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ImportEncryptionKeyResponseContent.Builder.class) +public final class ImportEncryptionKeyResponseContent { + private final String kid; + + private final EncryptionKeyType type; + + private final EncryptionKeyState state; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final String parentKid; + + private final Optional publicKey; + + private final Map additionalProperties; + + private ImportEncryptionKeyResponseContent( + String kid, + EncryptionKeyType type, + EncryptionKeyState state, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + String parentKid, + Optional publicKey, + Map additionalProperties) { + this.kid = kid; + this.type = type; + this.state = state; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.parentKid = parentKid; + this.publicKey = publicKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key ID + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @JsonProperty("type") + public EncryptionKeyType getType() { + return type; + } + + @JsonProperty("state") + public EncryptionKeyState getState() { + return state; + } + + /** + * @return Key creation timestamp + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Key update timestamp + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return ID of parent wrapping key + */ + @JsonProperty("parent_kid") + public String getParentKid() { + return parentKid; + } + + /** + * @return Public key in PEM format + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ImportEncryptionKeyResponseContent + && equalTo((ImportEncryptionKeyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ImportEncryptionKeyResponseContent other) { + return kid.equals(other.kid) + && type.equals(other.type) + && state.equals(other.state) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && parentKid.equals(other.parentKid) + && publicKey.equals(other.publicKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

Key ID

+ */ + TypeStage kid(@NotNull String kid); + + Builder from(ImportEncryptionKeyResponseContent other); + } + + public interface TypeStage { + StateStage type(@NotNull EncryptionKeyType type); + } + + public interface StateStage { + CreatedAtStage state(@NotNull EncryptionKeyState state); + } + + public interface CreatedAtStage { + /** + *

Key creation timestamp

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

Key update timestamp

+ */ + ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface ParentKidStage { + /** + *

ID of parent wrapping key

+ */ + _FinalStage parentKid(@NotNull String parentKid); + } + + public interface _FinalStage { + ImportEncryptionKeyResponseContent build(); + + /** + *

Public key in PEM format

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements KidStage, TypeStage, StateStage, CreatedAtStage, UpdatedAtStage, ParentKidStage, _FinalStage { + private String kid; + + private EncryptionKeyType type; + + private EncryptionKeyState state; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String parentKid; + + private Optional publicKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ImportEncryptionKeyResponseContent other) { + kid(other.getKid()); + type(other.getType()); + state(other.getState()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + parentKid(other.getParentKid()); + publicKey(other.getPublicKey()); + return this; + } + + /** + *

Key ID

+ *

Key ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public TypeStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public StateStage type(@NotNull EncryptionKeyType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("state") + public CreatedAtStage state(@NotNull EncryptionKeyState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + /** + *

Key creation timestamp

+ *

Key creation timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Key update timestamp

+ *

Key update timestamp

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("updated_at") + public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

ID of parent wrapping key

+ *

ID of parent wrapping key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parent_kid") + public _FinalStage parentKid(@NotNull String parentKid) { + this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); + return this; + } + + /** + *

Public key in PEM format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Public key in PEM format

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + @java.lang.Override + public ImportEncryptionKeyResponseContent build() { + return new ImportEncryptionKeyResponseContent( + kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Integration.java b/src/main/java/com/auth0/client/mgmt/types/Integration.java new file mode 100644 index 000000000..647537bc9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Integration.java @@ -0,0 +1,519 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Integration.Builder.class) +public final class Integration { + private final Optional id; + + private final Optional catalogId; + + private final Optional urlSlug; + + private final Optional partnerId; + + private final Optional name; + + private final Optional description; + + private final Optional shortDescription; + + private final Optional logo; + + private final Optional featureType; + + private final Optional termsOfUseUrl; + + private final Optional privacyPolicyUrl; + + private final Optional publicSupportLink; + + private final Optional currentRelease; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private Integration( + Optional id, + Optional catalogId, + Optional urlSlug, + Optional partnerId, + Optional name, + Optional description, + Optional shortDescription, + Optional logo, + Optional featureType, + Optional termsOfUseUrl, + Optional privacyPolicyUrl, + Optional publicSupportLink, + Optional currentRelease, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.catalogId = catalogId; + this.urlSlug = urlSlug; + this.partnerId = partnerId; + this.name = name; + this.description = description; + this.shortDescription = shortDescription; + this.logo = logo; + this.featureType = featureType; + this.termsOfUseUrl = termsOfUseUrl; + this.privacyPolicyUrl = privacyPolicyUrl; + this.publicSupportLink = publicSupportLink; + this.currentRelease = currentRelease; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return id is a system generated GUID. This same ID is designed to be federated in + * all the applicable localities. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return catalog_id refers to the ID in the marketplace catalog + */ + @JsonProperty("catalog_id") + public Optional getCatalogId() { + return catalogId; + } + + /** + * @return url_slug refers to the url_slug in the marketplace catalog + */ + @JsonProperty("url_slug") + public Optional getUrlSlug() { + return urlSlug; + } + + /** + * @return partner_id is the foreign key reference to the partner account this + * integration belongs to. + */ + @JsonProperty("partner_id") + public Optional getPartnerId() { + return partnerId; + } + + /** + * @return name is the integration name, which will be used for display purposes in + * the marketplace. + *

To start we're going to make sure the display name is at least 3 + * characters. Can adjust this easily later.

+ */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return description adds more text for the integration name -- also relevant for + * the marketplace listing. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return short_description is the brief description of the integration, which is used for display purposes in cards + */ + @JsonProperty("short_description") + public Optional getShortDescription() { + return shortDescription; + } + + @JsonProperty("logo") + public Optional getLogo() { + return logo; + } + + @JsonProperty("feature_type") + public Optional getFeatureType() { + return featureType; + } + + @JsonProperty("terms_of_use_url") + public Optional getTermsOfUseUrl() { + return termsOfUseUrl; + } + + @JsonProperty("privacy_policy_url") + public Optional getPrivacyPolicyUrl() { + return privacyPolicyUrl; + } + + @JsonProperty("public_support_link") + public Optional getPublicSupportLink() { + return publicSupportLink; + } + + @JsonProperty("current_release") + public Optional getCurrentRelease() { + return currentRelease; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Integration && equalTo((Integration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Integration other) { + return id.equals(other.id) + && catalogId.equals(other.catalogId) + && urlSlug.equals(other.urlSlug) + && partnerId.equals(other.partnerId) + && name.equals(other.name) + && description.equals(other.description) + && shortDescription.equals(other.shortDescription) + && logo.equals(other.logo) + && featureType.equals(other.featureType) + && termsOfUseUrl.equals(other.termsOfUseUrl) + && privacyPolicyUrl.equals(other.privacyPolicyUrl) + && publicSupportLink.equals(other.publicSupportLink) + && currentRelease.equals(other.currentRelease) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.catalogId, + this.urlSlug, + this.partnerId, + this.name, + this.description, + this.shortDescription, + this.logo, + this.featureType, + this.termsOfUseUrl, + this.privacyPolicyUrl, + this.publicSupportLink, + this.currentRelease, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional catalogId = Optional.empty(); + + private Optional urlSlug = Optional.empty(); + + private Optional partnerId = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional shortDescription = Optional.empty(); + + private Optional logo = Optional.empty(); + + private Optional featureType = Optional.empty(); + + private Optional termsOfUseUrl = Optional.empty(); + + private Optional privacyPolicyUrl = Optional.empty(); + + private Optional publicSupportLink = Optional.empty(); + + private Optional currentRelease = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Integration other) { + id(other.getId()); + catalogId(other.getCatalogId()); + urlSlug(other.getUrlSlug()); + partnerId(other.getPartnerId()); + name(other.getName()); + description(other.getDescription()); + shortDescription(other.getShortDescription()); + logo(other.getLogo()); + featureType(other.getFeatureType()); + termsOfUseUrl(other.getTermsOfUseUrl()); + privacyPolicyUrl(other.getPrivacyPolicyUrl()); + publicSupportLink(other.getPublicSupportLink()); + currentRelease(other.getCurrentRelease()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

id is a system generated GUID. This same ID is designed to be federated in + * all the applicable localities.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

catalog_id refers to the ID in the marketplace catalog

+ */ + @JsonSetter(value = "catalog_id", nulls = Nulls.SKIP) + public Builder catalogId(Optional catalogId) { + this.catalogId = catalogId; + return this; + } + + public Builder catalogId(String catalogId) { + this.catalogId = Optional.ofNullable(catalogId); + return this; + } + + /** + *

url_slug refers to the url_slug in the marketplace catalog

+ */ + @JsonSetter(value = "url_slug", nulls = Nulls.SKIP) + public Builder urlSlug(Optional urlSlug) { + this.urlSlug = urlSlug; + return this; + } + + public Builder urlSlug(String urlSlug) { + this.urlSlug = Optional.ofNullable(urlSlug); + return this; + } + + /** + *

partner_id is the foreign key reference to the partner account this + * integration belongs to.

+ */ + @JsonSetter(value = "partner_id", nulls = Nulls.SKIP) + public Builder partnerId(Optional partnerId) { + this.partnerId = partnerId; + return this; + } + + public Builder partnerId(String partnerId) { + this.partnerId = Optional.ofNullable(partnerId); + return this; + } + + /** + *

name is the integration name, which will be used for display purposes in + * the marketplace.

+ *

To start we're going to make sure the display name is at least 3 + * characters. Can adjust this easily later.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

description adds more text for the integration name -- also relevant for + * the marketplace listing.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

short_description is the brief description of the integration, which is used for display purposes in cards

+ */ + @JsonSetter(value = "short_description", nulls = Nulls.SKIP) + public Builder shortDescription(Optional shortDescription) { + this.shortDescription = shortDescription; + return this; + } + + public Builder shortDescription(String shortDescription) { + this.shortDescription = Optional.ofNullable(shortDescription); + return this; + } + + @JsonSetter(value = "logo", nulls = Nulls.SKIP) + public Builder logo(Optional logo) { + this.logo = logo; + return this; + } + + public Builder logo(String logo) { + this.logo = Optional.ofNullable(logo); + return this; + } + + @JsonSetter(value = "feature_type", nulls = Nulls.SKIP) + public Builder featureType(Optional featureType) { + this.featureType = featureType; + return this; + } + + public Builder featureType(IntegrationFeatureTypeEnum featureType) { + this.featureType = Optional.ofNullable(featureType); + return this; + } + + @JsonSetter(value = "terms_of_use_url", nulls = Nulls.SKIP) + public Builder termsOfUseUrl(Optional termsOfUseUrl) { + this.termsOfUseUrl = termsOfUseUrl; + return this; + } + + public Builder termsOfUseUrl(String termsOfUseUrl) { + this.termsOfUseUrl = Optional.ofNullable(termsOfUseUrl); + return this; + } + + @JsonSetter(value = "privacy_policy_url", nulls = Nulls.SKIP) + public Builder privacyPolicyUrl(Optional privacyPolicyUrl) { + this.privacyPolicyUrl = privacyPolicyUrl; + return this; + } + + public Builder privacyPolicyUrl(String privacyPolicyUrl) { + this.privacyPolicyUrl = Optional.ofNullable(privacyPolicyUrl); + return this; + } + + @JsonSetter(value = "public_support_link", nulls = Nulls.SKIP) + public Builder publicSupportLink(Optional publicSupportLink) { + this.publicSupportLink = publicSupportLink; + return this; + } + + public Builder publicSupportLink(String publicSupportLink) { + this.publicSupportLink = Optional.ofNullable(publicSupportLink); + return this; + } + + @JsonSetter(value = "current_release", nulls = Nulls.SKIP) + public Builder currentRelease(Optional currentRelease) { + this.currentRelease = currentRelease; + return this; + } + + public Builder currentRelease(IntegrationRelease currentRelease) { + this.currentRelease = Optional.ofNullable(currentRelease); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public Integration build() { + return new Integration( + id, + catalogId, + urlSlug, + partnerId, + name, + description, + shortDescription, + logo, + featureType, + termsOfUseUrl, + privacyPolicyUrl, + publicSupportLink, + currentRelease, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java new file mode 100644 index 000000000..378ce1601 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IntegrationFeatureTypeEnum { + public static final IntegrationFeatureTypeEnum UNSPECIFIED = + new IntegrationFeatureTypeEnum(Value.UNSPECIFIED, "unspecified"); + + public static final IntegrationFeatureTypeEnum SMS_PROVIDER = + new IntegrationFeatureTypeEnum(Value.SMS_PROVIDER, "sms_provider"); + + public static final IntegrationFeatureTypeEnum ACTION = new IntegrationFeatureTypeEnum(Value.ACTION, "action"); + + public static final IntegrationFeatureTypeEnum SSO_INTEGRATION = + new IntegrationFeatureTypeEnum(Value.SSO_INTEGRATION, "sso_integration"); + + public static final IntegrationFeatureTypeEnum SOCIAL_CONNECTION = + new IntegrationFeatureTypeEnum(Value.SOCIAL_CONNECTION, "social_connection"); + + public static final IntegrationFeatureTypeEnum LOG_STREAM = + new IntegrationFeatureTypeEnum(Value.LOG_STREAM, "log_stream"); + + private final Value value; + + private final String string; + + IntegrationFeatureTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IntegrationFeatureTypeEnum + && this.string.equals(((IntegrationFeatureTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case UNSPECIFIED: + return visitor.visitUnspecified(); + case SMS_PROVIDER: + return visitor.visitSmsProvider(); + case ACTION: + return visitor.visitAction(); + case SSO_INTEGRATION: + return visitor.visitSsoIntegration(); + case SOCIAL_CONNECTION: + return visitor.visitSocialConnection(); + case LOG_STREAM: + return visitor.visitLogStream(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IntegrationFeatureTypeEnum valueOf(String value) { + switch (value) { + case "unspecified": + return UNSPECIFIED; + case "sms_provider": + return SMS_PROVIDER; + case "action": + return ACTION; + case "sso_integration": + return SSO_INTEGRATION; + case "social_connection": + return SOCIAL_CONNECTION; + case "log_stream": + return LOG_STREAM; + default: + return new IntegrationFeatureTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + UNSPECIFIED, + + ACTION, + + SOCIAL_CONNECTION, + + LOG_STREAM, + + SSO_INTEGRATION, + + SMS_PROVIDER, + + UNKNOWN + } + + public interface Visitor { + T visitUnspecified(); + + T visitAction(); + + T visitSocialConnection(); + + T visitLogStream(); + + T visitSsoIntegration(); + + T visitSmsProvider(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java new file mode 100644 index 000000000..60f4838a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java @@ -0,0 +1,215 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IntegrationRelease.Builder.class) +public final class IntegrationRelease { + private final Optional id; + + private final Optional trigger; + + private final Optional semver; + + private final Optional> requiredSecrets; + + private final Optional> requiredConfiguration; + + private final Map additionalProperties; + + private IntegrationRelease( + Optional id, + Optional trigger, + Optional semver, + Optional> requiredSecrets, + Optional> requiredConfiguration, + Map additionalProperties) { + this.id = id; + this.trigger = trigger; + this.semver = semver; + this.requiredSecrets = requiredSecrets; + this.requiredConfiguration = requiredConfiguration; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the associated IntegrationRelease + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("trigger") + public Optional getTrigger() { + return trigger; + } + + @JsonProperty("semver") + public Optional getSemver() { + return semver; + } + + /** + * @return required_secrets declares all the necessary secrets for an integration to + * work. + */ + @JsonProperty("required_secrets") + public Optional> getRequiredSecrets() { + return requiredSecrets; + } + + /** + * @return required_configuration declares all the necessary configuration fields for an integration to work. + */ + @JsonProperty("required_configuration") + public Optional> getRequiredConfiguration() { + return requiredConfiguration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IntegrationRelease && equalTo((IntegrationRelease) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IntegrationRelease other) { + return id.equals(other.id) + && trigger.equals(other.trigger) + && semver.equals(other.semver) + && requiredSecrets.equals(other.requiredSecrets) + && requiredConfiguration.equals(other.requiredConfiguration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.trigger, this.semver, this.requiredSecrets, this.requiredConfiguration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional trigger = Optional.empty(); + + private Optional semver = Optional.empty(); + + private Optional> requiredSecrets = Optional.empty(); + + private Optional> requiredConfiguration = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IntegrationRelease other) { + id(other.getId()); + trigger(other.getTrigger()); + semver(other.getSemver()); + requiredSecrets(other.getRequiredSecrets()); + requiredConfiguration(other.getRequiredConfiguration()); + return this; + } + + /** + *

The id of the associated IntegrationRelease

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "trigger", nulls = Nulls.SKIP) + public Builder trigger(Optional trigger) { + this.trigger = trigger; + return this; + } + + public Builder trigger(ActionTrigger trigger) { + this.trigger = Optional.ofNullable(trigger); + return this; + } + + @JsonSetter(value = "semver", nulls = Nulls.SKIP) + public Builder semver(Optional semver) { + this.semver = semver; + return this; + } + + public Builder semver(IntegrationSemVer semver) { + this.semver = Optional.ofNullable(semver); + return this; + } + + /** + *

required_secrets declares all the necessary secrets for an integration to + * work.

+ */ + @JsonSetter(value = "required_secrets", nulls = Nulls.SKIP) + public Builder requiredSecrets(Optional> requiredSecrets) { + this.requiredSecrets = requiredSecrets; + return this; + } + + public Builder requiredSecrets(List requiredSecrets) { + this.requiredSecrets = Optional.ofNullable(requiredSecrets); + return this; + } + + /** + *

required_configuration declares all the necessary configuration fields for an integration to work.

+ */ + @JsonSetter(value = "required_configuration", nulls = Nulls.SKIP) + public Builder requiredConfiguration(Optional> requiredConfiguration) { + this.requiredConfiguration = requiredConfiguration; + return this; + } + + public Builder requiredConfiguration(List requiredConfiguration) { + this.requiredConfiguration = Optional.ofNullable(requiredConfiguration); + return this; + } + + public IntegrationRelease build() { + return new IntegrationRelease( + id, trigger, semver, requiredSecrets, requiredConfiguration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java new file mode 100644 index 000000000..8a8356603 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java @@ -0,0 +1,357 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IntegrationRequiredParam.Builder.class) +public final class IntegrationRequiredParam { + private final Optional type; + + private final Optional name; + + private final Optional required; + + private final Optional optional; + + private final Optional label; + + private final Optional description; + + private final Optional defaultValue; + + private final Optional placeholder; + + private final Optional> options; + + private final Map additionalProperties; + + private IntegrationRequiredParam( + Optional type, + Optional name, + Optional required, + Optional optional, + Optional label, + Optional description, + Optional defaultValue, + Optional placeholder, + Optional> options, + Map additionalProperties) { + this.type = type; + this.name = name; + this.required = required; + this.optional = optional; + this.label = label; + this.description = description; + this.defaultValue = defaultValue; + this.placeholder = placeholder; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The name of the parameter. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The flag for if this parameter is required. + */ + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + /** + * @return The temp flag for if this parameter is required (experimental; for Labs use only). + */ + @JsonProperty("optional") + public Optional getOptional() { + return optional; + } + + /** + * @return The short label for this parameter. + */ + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + /** + * @return The lengthier description for this parameter. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The default value for this parameter. + */ + @JsonProperty("default_value") + public Optional getDefaultValue() { + return defaultValue; + } + + /** + * @return Placeholder text for this parameter. + */ + @JsonProperty("placeholder") + public Optional getPlaceholder() { + return placeholder; + } + + /** + * @return The allowable options for this param. + */ + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IntegrationRequiredParam && equalTo((IntegrationRequiredParam) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IntegrationRequiredParam other) { + return type.equals(other.type) + && name.equals(other.name) + && required.equals(other.required) + && optional.equals(other.optional) + && label.equals(other.label) + && description.equals(other.description) + && defaultValue.equals(other.defaultValue) + && placeholder.equals(other.placeholder) + && options.equals(other.options); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.type, + this.name, + this.required, + this.optional, + this.label, + this.description, + this.defaultValue, + this.placeholder, + this.options); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional optional = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional defaultValue = Optional.empty(); + + private Optional placeholder = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IntegrationRequiredParam other) { + type(other.getType()); + name(other.getName()); + required(other.getRequired()); + optional(other.getOptional()); + label(other.getLabel()); + description(other.getDescription()); + defaultValue(other.getDefaultValue()); + placeholder(other.getPlaceholder()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(IntegrationRequiredParamTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The name of the parameter.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The flag for if this parameter is required.

+ */ + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public Builder required(Optional required) { + this.required = required; + return this; + } + + public Builder required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + /** + *

The temp flag for if this parameter is required (experimental; for Labs use only).

+ */ + @JsonSetter(value = "optional", nulls = Nulls.SKIP) + public Builder optional(Optional optional) { + this.optional = optional; + return this; + } + + public Builder optional(Boolean optional) { + this.optional = Optional.ofNullable(optional); + return this; + } + + /** + *

The short label for this parameter.

+ */ + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public Builder label(Optional label) { + this.label = label; + return this; + } + + public Builder label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + /** + *

The lengthier description for this parameter.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

The default value for this parameter.

+ */ + @JsonSetter(value = "default_value", nulls = Nulls.SKIP) + public Builder defaultValue(Optional defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public Builder defaultValue(String defaultValue) { + this.defaultValue = Optional.ofNullable(defaultValue); + return this; + } + + /** + *

Placeholder text for this parameter.

+ */ + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public Builder placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + public Builder placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + /** + *

The allowable options for this param.

+ */ + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(List options) { + this.options = Optional.ofNullable(options); + return this; + } + + public IntegrationRequiredParam build() { + return new IntegrationRequiredParam( + type, + name, + required, + optional, + label, + description, + defaultValue, + placeholder, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java new file mode 100644 index 000000000..29cd5ccc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IntegrationRequiredParamOption.Builder.class) +public final class IntegrationRequiredParamOption { + private final Optional value; + + private final Optional label; + + private final Map additionalProperties; + + private IntegrationRequiredParamOption( + Optional value, Optional label, Map additionalProperties) { + this.value = value; + this.label = label; + this.additionalProperties = additionalProperties; + } + + /** + * @return The value of an option that will be used within the application. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The display value of an option suitable for displaying in a UI. + */ + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IntegrationRequiredParamOption && equalTo((IntegrationRequiredParamOption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IntegrationRequiredParamOption other) { + return value.equals(other.value) && label.equals(other.label); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.label); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + private Optional label = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IntegrationRequiredParamOption other) { + value(other.getValue()); + label(other.getLabel()); + return this; + } + + /** + *

The value of an option that will be used within the application.

+ */ + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + /** + *

The display value of an option suitable for displaying in a UI.

+ */ + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public Builder label(Optional label) { + this.label = label; + return this; + } + + public Builder label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + public IntegrationRequiredParamOption build() { + return new IntegrationRequiredParamOption(value, label, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java new file mode 100644 index 000000000..9c421852a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IntegrationRequiredParamTypeEnum { + public static final IntegrationRequiredParamTypeEnum UNSPECIFIED = + new IntegrationRequiredParamTypeEnum(Value.UNSPECIFIED, "UNSPECIFIED"); + + public static final IntegrationRequiredParamTypeEnum STRING = + new IntegrationRequiredParamTypeEnum(Value.STRING, "STRING"); + + private final Value value; + + private final String string; + + IntegrationRequiredParamTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IntegrationRequiredParamTypeEnum + && this.string.equals(((IntegrationRequiredParamTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case UNSPECIFIED: + return visitor.visitUnspecified(); + case STRING: + return visitor.visitString(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IntegrationRequiredParamTypeEnum valueOf(String value) { + switch (value) { + case "UNSPECIFIED": + return UNSPECIFIED; + case "STRING": + return STRING; + default: + return new IntegrationRequiredParamTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + UNSPECIFIED, + + STRING, + + UNKNOWN + } + + public interface Visitor { + T visitUnspecified(); + + T visitString(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java new file mode 100644 index 000000000..62f0972f6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IntegrationSemVer.Builder.class) +public final class IntegrationSemVer { + private final Optional major; + + private final Optional minor; + + private final Map additionalProperties; + + private IntegrationSemVer( + Optional major, Optional minor, Map additionalProperties) { + this.major = major; + this.minor = minor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Major is the major number of a semver + */ + @JsonProperty("major") + public Optional getMajor() { + return major; + } + + /** + * @return Minior is the minior number of a semver + */ + @JsonProperty("minor") + public Optional getMinor() { + return minor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IntegrationSemVer && equalTo((IntegrationSemVer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IntegrationSemVer other) { + return major.equals(other.major) && minor.equals(other.minor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.major, this.minor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional major = Optional.empty(); + + private Optional minor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IntegrationSemVer other) { + major(other.getMajor()); + minor(other.getMinor()); + return this; + } + + /** + *

Major is the major number of a semver

+ */ + @JsonSetter(value = "major", nulls = Nulls.SKIP) + public Builder major(Optional major) { + this.major = major; + return this; + } + + public Builder major(Integer major) { + this.major = Optional.ofNullable(major); + return this; + } + + /** + *

Minior is the minior number of a semver

+ */ + @JsonSetter(value = "minor", nulls = Nulls.SKIP) + public Builder minor(Optional minor) { + this.minor = minor; + return this; + } + + public Builder minor(Integer minor) { + this.minor = Optional.ofNullable(minor); + return this; + } + + public IntegrationSemVer build() { + return new IntegrationSemVer(major, minor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java new file mode 100644 index 000000000..5030eb5da --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class JobFileFormatEnum { + public static final JobFileFormatEnum CSV = new JobFileFormatEnum(Value.CSV, "csv"); + + public static final JobFileFormatEnum JSON = new JobFileFormatEnum(Value.JSON, "json"); + + private final Value value; + + private final String string; + + JobFileFormatEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof JobFileFormatEnum && this.string.equals(((JobFileFormatEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CSV: + return visitor.visitCsv(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobFileFormatEnum valueOf(String value) { + switch (value) { + case "csv": + return CSV; + case "json": + return JSON; + default: + return new JobFileFormatEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + CSV, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitCsv(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java new file mode 100644 index 000000000..3f2a5dadd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionBindingsPaginatedResponseContent.Builder.class) +public final class ListActionBindingsPaginatedResponseContent { + private final Optional total; + + private final Optional page; + + private final Optional perPage; + + private final Optional> bindings; + + private final Map additionalProperties; + + private ListActionBindingsPaginatedResponseContent( + Optional total, + Optional page, + Optional perPage, + Optional> bindings, + Map additionalProperties) { + this.total = total; + this.page = page; + this.perPage = perPage; + this.bindings = bindings; + this.additionalProperties = additionalProperties; + } + + /** + * @return The total result count. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + /** + * @return Page index of the results being returned. First page is 0. + */ + @JsonProperty("page") + public Optional getPage() { + return page; + } + + /** + * @return Number of results per page. + */ + @JsonProperty("per_page") + public Optional getPerPage() { + return perPage; + } + + /** + * @return The list of actions that are bound to this trigger in the order in which they will be executed. + */ + @JsonProperty("bindings") + public Optional> getBindings() { + return bindings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionBindingsPaginatedResponseContent + && equalTo((ListActionBindingsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionBindingsPaginatedResponseContent other) { + return total.equals(other.total) + && page.equals(other.page) + && perPage.equals(other.perPage) + && bindings.equals(other.bindings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.total, this.page, this.perPage, this.bindings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional total = Optional.empty(); + + private Optional page = Optional.empty(); + + private Optional perPage = Optional.empty(); + + private Optional> bindings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionBindingsPaginatedResponseContent other) { + total(other.getTotal()); + page(other.getPage()); + perPage(other.getPerPage()); + bindings(other.getBindings()); + return this; + } + + /** + *

The total result count.

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + /** + *

Page index of the results being returned. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(Optional page) { + this.page = page; + return this; + } + + public Builder page(Double page) { + this.page = Optional.ofNullable(page); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(Optional perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Double perPage) { + this.perPage = Optional.ofNullable(perPage); + return this; + } + + /** + *

The list of actions that are bound to this trigger in the order in which they will be executed.

+ */ + @JsonSetter(value = "bindings", nulls = Nulls.SKIP) + public Builder bindings(Optional> bindings) { + this.bindings = bindings; + return this; + } + + public Builder bindings(List bindings) { + this.bindings = Optional.ofNullable(bindings); + return this; + } + + public ListActionBindingsPaginatedResponseContent build() { + return new ListActionBindingsPaginatedResponseContent(total, page, perPage, bindings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java new file mode 100644 index 000000000..85b7426c1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionTriggersResponseContent.Builder.class) +public final class ListActionTriggersResponseContent { + private final Optional> triggers; + + private final Map additionalProperties; + + private ListActionTriggersResponseContent( + Optional> triggers, Map additionalProperties) { + this.triggers = triggers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("triggers") + public Optional> getTriggers() { + return triggers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionTriggersResponseContent && equalTo((ListActionTriggersResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionTriggersResponseContent other) { + return triggers.equals(other.triggers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> triggers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionTriggersResponseContent other) { + triggers(other.getTriggers()); + return this; + } + + @JsonSetter(value = "triggers", nulls = Nulls.SKIP) + public Builder triggers(Optional> triggers) { + this.triggers = triggers; + return this; + } + + public Builder triggers(List triggers) { + this.triggers = Optional.ofNullable(triggers); + return this; + } + + public ListActionTriggersResponseContent build() { + return new ListActionTriggersResponseContent(triggers, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java new file mode 100644 index 000000000..ecc1418e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionVersionsPaginatedResponseContent.Builder.class) +public final class ListActionVersionsPaginatedResponseContent { + private final Optional total; + + private final Optional page; + + private final Optional perPage; + + private final Optional> versions; + + private final Map additionalProperties; + + private ListActionVersionsPaginatedResponseContent( + Optional total, + Optional page, + Optional perPage, + Optional> versions, + Map additionalProperties) { + this.total = total; + this.page = page; + this.perPage = perPage; + this.versions = versions; + this.additionalProperties = additionalProperties; + } + + /** + * @return The total result count. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + /** + * @return Page index of the results being returned. First page is 0. + */ + @JsonProperty("page") + public Optional getPage() { + return page; + } + + /** + * @return Number of results per page. + */ + @JsonProperty("per_page") + public Optional getPerPage() { + return perPage; + } + + @JsonProperty("versions") + public Optional> getVersions() { + return versions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionVersionsPaginatedResponseContent + && equalTo((ListActionVersionsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionVersionsPaginatedResponseContent other) { + return total.equals(other.total) + && page.equals(other.page) + && perPage.equals(other.perPage) + && versions.equals(other.versions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.total, this.page, this.perPage, this.versions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional total = Optional.empty(); + + private Optional page = Optional.empty(); + + private Optional perPage = Optional.empty(); + + private Optional> versions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionVersionsPaginatedResponseContent other) { + total(other.getTotal()); + page(other.getPage()); + perPage(other.getPerPage()); + versions(other.getVersions()); + return this; + } + + /** + *

The total result count.

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + /** + *

Page index of the results being returned. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(Optional page) { + this.page = page; + return this; + } + + public Builder page(Double page) { + this.page = Optional.ofNullable(page); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(Optional perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Double perPage) { + this.perPage = Optional.ofNullable(perPage); + return this; + } + + @JsonSetter(value = "versions", nulls = Nulls.SKIP) + public Builder versions(Optional> versions) { + this.versions = versions; + return this; + } + + public Builder versions(List versions) { + this.versions = Optional.ofNullable(versions); + return this; + } + + public ListActionVersionsPaginatedResponseContent build() { + return new ListActionVersionsPaginatedResponseContent(total, page, perPage, versions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java new file mode 100644 index 000000000..bca8a2104 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionsPaginatedResponseContent.Builder.class) +public final class ListActionsPaginatedResponseContent { + private final Optional total; + + private final Optional page; + + private final Optional perPage; + + private final Optional> actions; + + private final Map additionalProperties; + + private ListActionsPaginatedResponseContent( + Optional total, + Optional page, + Optional perPage, + Optional> actions, + Map additionalProperties) { + this.total = total; + this.page = page; + this.perPage = perPage; + this.actions = actions; + this.additionalProperties = additionalProperties; + } + + /** + * @return The total result count. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + /** + * @return Page index of the results being returned. First page is 0. + */ + @JsonProperty("page") + public Optional getPage() { + return page; + } + + /** + * @return Number of results per page. + */ + @JsonProperty("per_page") + public Optional getPerPage() { + return perPage; + } + + /** + * @return The list of actions. + */ + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionsPaginatedResponseContent + && equalTo((ListActionsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionsPaginatedResponseContent other) { + return total.equals(other.total) + && page.equals(other.page) + && perPage.equals(other.perPage) + && actions.equals(other.actions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.total, this.page, this.perPage, this.actions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional total = Optional.empty(); + + private Optional page = Optional.empty(); + + private Optional perPage = Optional.empty(); + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionsPaginatedResponseContent other) { + total(other.getTotal()); + page(other.getPage()); + perPage(other.getPerPage()); + actions(other.getActions()); + return this; + } + + /** + *

The total result count.

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + /** + *

Page index of the results being returned. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(Optional page) { + this.page = page; + return this; + } + + public Builder page(Double page) { + this.page = Optional.ofNullable(page); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(Optional perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Double perPage) { + this.perPage = Optional.ofNullable(perPage); + return this; + } + + /** + *

The list of actions.

+ */ + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public Builder actions(Optional> actions) { + this.actions = actions; + return this; + } + + public Builder actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + public ListActionsPaginatedResponseContent build() { + return new ListActionsPaginatedResponseContent(total, page, perPage, actions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java new file mode 100644 index 000000000..2bb4d9184 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java @@ -0,0 +1,428 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListActionsRequestParameters.Builder.class) +public final class ListActionsRequestParameters { + private final OptionalNullable triggerId; + + private final OptionalNullable actionName; + + private final OptionalNullable deployed; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable installed; + + private final Map additionalProperties; + + private ListActionsRequestParameters( + OptionalNullable triggerId, + OptionalNullable actionName, + OptionalNullable deployed, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable installed, + Map additionalProperties) { + this.triggerId = triggerId; + this.actionName = actionName; + this.deployed = deployed; + this.page = page; + this.perPage = perPage; + this.installed = installed; + this.additionalProperties = additionalProperties; + } + + /** + * @return An actions extensibility point. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("triggerId") + public OptionalNullable getTriggerId() { + if (triggerId == null) { + return OptionalNullable.absent(); + } + return triggerId; + } + + /** + * @return The name of the action to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("actionName") + public OptionalNullable getActionName() { + if (actionName == null) { + return OptionalNullable.absent(); + } + return actionName; + } + + /** + * @return Optional filter to only retrieve actions that are deployed. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("deployed") + public OptionalNullable getDeployed() { + if (deployed == null) { + return OptionalNullable.absent(); + } + return deployed; + } + + /** + * @return Use this field to request a specific page of the list results. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return The maximum number of results to be returned by the server in single response. 20 by default + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Optional. When true, return only installed actions. When false, return only custom actions. Returns all actions by default. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("installed") + public OptionalNullable getInstalled() { + if (installed == null) { + return OptionalNullable.absent(); + } + return installed; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("triggerId") + private OptionalNullable _getTriggerId() { + return triggerId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("actionName") + private OptionalNullable _getActionName() { + return actionName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("deployed") + private OptionalNullable _getDeployed() { + return deployed; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("installed") + private OptionalNullable _getInstalled() { + return installed; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListActionsRequestParameters && equalTo((ListActionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListActionsRequestParameters other) { + return triggerId.equals(other.triggerId) + && actionName.equals(other.actionName) + && deployed.equals(other.deployed) + && page.equals(other.page) + && perPage.equals(other.perPage) + && installed.equals(other.installed); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggerId, this.actionName, this.deployed, this.page, this.perPage, this.installed); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable triggerId = OptionalNullable.absent(); + + private OptionalNullable actionName = OptionalNullable.absent(); + + private OptionalNullable deployed = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable installed = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListActionsRequestParameters other) { + triggerId(other.getTriggerId()); + actionName(other.getActionName()); + deployed(other.getDeployed()); + page(other.getPage()); + perPage(other.getPerPage()); + installed(other.getInstalled()); + return this; + } + + /** + *

An actions extensibility point.

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(@Nullable OptionalNullable triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = OptionalNullable.of(triggerId); + return this; + } + + public Builder triggerId(Optional triggerId) { + if (triggerId.isPresent()) { + this.triggerId = OptionalNullable.of(triggerId.get()); + } else { + this.triggerId = OptionalNullable.absent(); + } + return this; + } + + public Builder triggerId(com.auth0.client.mgmt.core.Nullable triggerId) { + if (triggerId.isNull()) { + this.triggerId = OptionalNullable.ofNull(); + } else if (triggerId.isEmpty()) { + this.triggerId = OptionalNullable.absent(); + } else { + this.triggerId = OptionalNullable.of(triggerId.get()); + } + return this; + } + + /** + *

The name of the action to retrieve.

+ */ + @JsonSetter(value = "actionName", nulls = Nulls.SKIP) + public Builder actionName(@Nullable OptionalNullable actionName) { + this.actionName = actionName; + return this; + } + + public Builder actionName(String actionName) { + this.actionName = OptionalNullable.of(actionName); + return this; + } + + public Builder actionName(Optional actionName) { + if (actionName.isPresent()) { + this.actionName = OptionalNullable.of(actionName.get()); + } else { + this.actionName = OptionalNullable.absent(); + } + return this; + } + + public Builder actionName(com.auth0.client.mgmt.core.Nullable actionName) { + if (actionName.isNull()) { + this.actionName = OptionalNullable.ofNull(); + } else if (actionName.isEmpty()) { + this.actionName = OptionalNullable.absent(); + } else { + this.actionName = OptionalNullable.of(actionName.get()); + } + return this; + } + + /** + *

Optional filter to only retrieve actions that are deployed.

+ */ + @JsonSetter(value = "deployed", nulls = Nulls.SKIP) + public Builder deployed(@Nullable OptionalNullable deployed) { + this.deployed = deployed; + return this; + } + + public Builder deployed(Boolean deployed) { + this.deployed = OptionalNullable.of(deployed); + return this; + } + + public Builder deployed(Optional deployed) { + if (deployed.isPresent()) { + this.deployed = OptionalNullable.of(deployed.get()); + } else { + this.deployed = OptionalNullable.absent(); + } + return this; + } + + public Builder deployed(com.auth0.client.mgmt.core.Nullable deployed) { + if (deployed.isNull()) { + this.deployed = OptionalNullable.ofNull(); + } else if (deployed.isEmpty()) { + this.deployed = OptionalNullable.absent(); + } else { + this.deployed = OptionalNullable.of(deployed.get()); + } + return this; + } + + /** + *

Use this field to request a specific page of the list results.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

The maximum number of results to be returned by the server in single response. 20 by default

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Optional. When true, return only installed actions. When false, return only custom actions. Returns all actions by default.

+ */ + @JsonSetter(value = "installed", nulls = Nulls.SKIP) + public Builder installed(@Nullable OptionalNullable installed) { + this.installed = installed; + return this; + } + + public Builder installed(Boolean installed) { + this.installed = OptionalNullable.of(installed); + return this; + } + + public Builder installed(Optional installed) { + if (installed.isPresent()) { + this.installed = OptionalNullable.of(installed.get()); + } else { + this.installed = OptionalNullable.absent(); + } + return this; + } + + public Builder installed(com.auth0.client.mgmt.core.Nullable installed) { + if (installed.isNull()) { + this.installed = OptionalNullable.ofNull(); + } else if (installed.isEmpty()) { + this.installed = OptionalNullable.absent(); + } else { + this.installed = OptionalNullable.of(installed.get()); + } + return this; + } + + public ListActionsRequestParameters build() { + return new ListActionsRequestParameters( + triggerId, actionName, deployed, page, perPage, installed, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..4d80bc312 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListAculsOffsetPaginatedResponseContent.Builder.class) +public final class ListAculsOffsetPaginatedResponseContent { + private final Optional> configs; + + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Map additionalProperties; + + private ListAculsOffsetPaginatedResponseContent( + Optional> configs, + Optional start, + Optional limit, + Optional total, + Map additionalProperties) { + this.configs = configs; + this.start = start; + this.limit = limit; + this.total = total; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("configs") + public Optional> getConfigs() { + return configs; + } + + /** + * @return the index of the first configuration in the response (before filtering) + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return the maximum number of configurations shown per page (before filtering) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return the total number of configurations on this tenant + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListAculsOffsetPaginatedResponseContent + && equalTo((ListAculsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListAculsOffsetPaginatedResponseContent other) { + return configs.equals(other.configs) + && start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.configs, this.start, this.limit, this.total); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> configs = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListAculsOffsetPaginatedResponseContent other) { + configs(other.getConfigs()); + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + return this; + } + + @JsonSetter(value = "configs", nulls = Nulls.SKIP) + public Builder configs(Optional> configs) { + this.configs = configs; + return this; + } + + public Builder configs(List configs) { + this.configs = Optional.ofNullable(configs); + return this; + } + + /** + *

the index of the first configuration in the response (before filtering)

+ */ + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

the maximum number of configurations shown per page (before filtering)

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

the total number of configurations on this tenant

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + public ListAculsOffsetPaginatedResponseContent build() { + return new ListAculsOffsetPaginatedResponseContent(configs, start, limit, total, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java new file mode 100644 index 000000000..fba219f29 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListBrandingPhoneProvidersResponseContent.Builder.class) +public final class ListBrandingPhoneProvidersResponseContent { + private final Optional> providers; + + private final Map additionalProperties; + + private ListBrandingPhoneProvidersResponseContent( + Optional> providers, Map additionalProperties) { + this.providers = providers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("providers") + public Optional> getProviders() { + return providers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListBrandingPhoneProvidersResponseContent + && equalTo((ListBrandingPhoneProvidersResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListBrandingPhoneProvidersResponseContent other) { + return providers.equals(other.providers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.providers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> providers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListBrandingPhoneProvidersResponseContent other) { + providers(other.getProviders()); + return this; + } + + @JsonSetter(value = "providers", nulls = Nulls.SKIP) + public Builder providers(Optional> providers) { + this.providers = providers; + return this; + } + + public Builder providers(List providers) { + this.providers = Optional.ofNullable(providers); + return this; + } + + public ListBrandingPhoneProvidersResponseContent build() { + return new ListBrandingPhoneProvidersResponseContent(providers, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java new file mode 100644 index 000000000..e9bb942a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientConnectionsResponseContent.Builder.class) +public final class ListClientConnectionsResponseContent { + private final List connections; + + private final Optional next; + + private final Map additionalProperties; + + private ListClientConnectionsResponseContent( + List connections, Optional next, Map additionalProperties) { + this.connections = connections; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connections") + public List getConnections() { + return connections; + } + + /** + * @return Encoded next token + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientConnectionsResponseContent + && equalTo((ListClientConnectionsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientConnectionsResponseContent other) { + return connections.equals(other.connections) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connections, this.next); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List connections = new ArrayList<>(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientConnectionsResponseContent other) { + connections(other.getConnections()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "connections", nulls = Nulls.SKIP) + public Builder connections(List connections) { + this.connections.clear(); + if (connections != null) { + this.connections.addAll(connections); + } + return this; + } + + public Builder addConnections(ConnectionForList connections) { + this.connections.add(connections); + return this; + } + + public Builder addAllConnections(List connections) { + if (connections != null) { + this.connections.addAll(connections); + } + return this; + } + + /** + *

Encoded next token

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public ListClientConnectionsResponseContent build() { + return new ListClientConnectionsResponseContent(connections, next, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java new file mode 100644 index 000000000..b356b3512 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientGrantOrganizationsPaginatedResponseContent.Builder.class) +public final class ListClientGrantOrganizationsPaginatedResponseContent { + private final Optional next; + + private final Optional> organizations; + + private final Map additionalProperties; + + private ListClientGrantOrganizationsPaginatedResponseContent( + Optional next, + Optional> organizations, + Map additionalProperties) { + this.next = next; + this.organizations = organizations; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("organizations") + public Optional> getOrganizations() { + return organizations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientGrantOrganizationsPaginatedResponseContent + && equalTo((ListClientGrantOrganizationsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientGrantOrganizationsPaginatedResponseContent other) { + return next.equals(other.next) && organizations.equals(other.organizations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.organizations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> organizations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientGrantOrganizationsPaginatedResponseContent other) { + next(other.getNext()); + organizations(other.getOrganizations()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "organizations", nulls = Nulls.SKIP) + public Builder organizations(Optional> organizations) { + this.organizations = organizations; + return this; + } + + public Builder organizations(List organizations) { + this.organizations = Optional.ofNullable(organizations); + return this; + } + + public ListClientGrantOrganizationsPaginatedResponseContent build() { + return new ListClientGrantOrganizationsPaginatedResponseContent(next, organizations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java new file mode 100644 index 000000000..4fddd9cf4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientGrantPaginatedResponseContent.Builder.class) +public final class ListClientGrantPaginatedResponseContent { + private final Optional next; + + private final Optional> clientGrants; + + private final Map additionalProperties; + + private ListClientGrantPaginatedResponseContent( + Optional next, + Optional> clientGrants, + Map additionalProperties) { + this.next = next; + this.clientGrants = clientGrants; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("client_grants") + public Optional> getClientGrants() { + return clientGrants; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientGrantPaginatedResponseContent + && equalTo((ListClientGrantPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientGrantPaginatedResponseContent other) { + return next.equals(other.next) && clientGrants.equals(other.clientGrants); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.clientGrants); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> clientGrants = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientGrantPaginatedResponseContent other) { + next(other.getNext()); + clientGrants(other.getClientGrants()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "client_grants", nulls = Nulls.SKIP) + public Builder clientGrants(Optional> clientGrants) { + this.clientGrants = clientGrants; + return this; + } + + public Builder clientGrants(List clientGrants) { + this.clientGrants = Optional.ofNullable(clientGrants); + return this; + } + + public ListClientGrantPaginatedResponseContent build() { + return new ListClientGrantPaginatedResponseContent(next, clientGrants, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java new file mode 100644 index 000000000..65e6becac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java @@ -0,0 +1,368 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientGrantsRequestParameters.Builder.class) +public final class ListClientGrantsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final OptionalNullable audience; + + private final OptionalNullable clientId; + + private final OptionalNullable allowAnyOrganization; + + private final Map additionalProperties; + + private ListClientGrantsRequestParameters( + OptionalNullable from, + OptionalNullable take, + OptionalNullable audience, + OptionalNullable clientId, + OptionalNullable allowAnyOrganization, + Map additionalProperties) { + this.from = from; + this.take = take; + this.audience = audience; + this.clientId = clientId; + this.allowAnyOrganization = allowAnyOrganization; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Optional filter on audience. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + public OptionalNullable getAudience() { + if (audience == null) { + return OptionalNullable.absent(); + } + return audience; + } + + /** + * @return Optional filter on client_id. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + /** + * @return Optional filter on allow_any_organization. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_any_organization") + public OptionalNullable getAllowAnyOrganization() { + if (allowAnyOrganization == null) { + return OptionalNullable.absent(); + } + return allowAnyOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + private OptionalNullable _getAudience() { + return audience; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_any_organization") + private OptionalNullable _getAllowAnyOrganization() { + return allowAnyOrganization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientGrantsRequestParameters && equalTo((ListClientGrantsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientGrantsRequestParameters other) { + return from.equals(other.from) + && take.equals(other.take) + && audience.equals(other.audience) + && clientId.equals(other.clientId) + && allowAnyOrganization.equals(other.allowAnyOrganization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take, this.audience, this.clientId, this.allowAnyOrganization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable audience = OptionalNullable.absent(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private OptionalNullable allowAnyOrganization = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientGrantsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + audience(other.getAudience()); + clientId(other.getClientId()); + allowAnyOrganization(other.getAllowAnyOrganization()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Optional filter on audience.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(@Nullable OptionalNullable audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = OptionalNullable.of(audience); + return this; + } + + public Builder audience(Optional audience) { + if (audience.isPresent()) { + this.audience = OptionalNullable.of(audience.get()); + } else { + this.audience = OptionalNullable.absent(); + } + return this; + } + + public Builder audience(com.auth0.client.mgmt.core.Nullable audience) { + if (audience.isNull()) { + this.audience = OptionalNullable.ofNull(); + } else if (audience.isEmpty()) { + this.audience = OptionalNullable.absent(); + } else { + this.audience = OptionalNullable.of(audience.get()); + } + return this; + } + + /** + *

Optional filter on client_id.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + /** + *

Optional filter on allow_any_organization.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(@Nullable OptionalNullable allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization); + return this; + } + + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + if (allowAnyOrganization.isPresent()) { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization.get()); + } else { + this.allowAnyOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder allowAnyOrganization(com.auth0.client.mgmt.core.Nullable allowAnyOrganization) { + if (allowAnyOrganization.isNull()) { + this.allowAnyOrganization = OptionalNullable.ofNull(); + } else if (allowAnyOrganization.isEmpty()) { + this.allowAnyOrganization = OptionalNullable.absent(); + } else { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization.get()); + } + return this; + } + + public ListClientGrantsRequestParameters build() { + return new ListClientGrantsRequestParameters( + from, take, audience, clientId, allowAnyOrganization, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..b1a490f66 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientsOffsetPaginatedResponseContent.Builder.class) +public final class ListClientsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> clients; + + private final Map additionalProperties; + + private ListClientsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> clients, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.clients = clients; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("clients") + public Optional> getClients() { + return clients; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientsOffsetPaginatedResponseContent + && equalTo((ListClientsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && clients.equals(other.clients); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.clients); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> clients = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + clients(other.getClients()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional> clients) { + this.clients = clients; + return this; + } + + public Builder clients(List clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + public ListClientsOffsetPaginatedResponseContent build() { + return new ListClientsOffsetPaginatedResponseContent(start, limit, total, clients, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java new file mode 100644 index 000000000..d3de9d7b8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java @@ -0,0 +1,617 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListClientsRequestParameters.Builder.class) +public final class ListClientsRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable isGlobal; + + private final OptionalNullable isFirstParty; + + private final OptionalNullable appType; + + private final OptionalNullable q; + + private final Map additionalProperties; + + private ListClientsRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable isGlobal, + OptionalNullable isFirstParty, + OptionalNullable appType, + OptionalNullable q, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.isGlobal = isGlobal; + this.isFirstParty = isFirstParty; + this.appType = appType; + this.q = q; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Default value is 50, maximum value is 100 + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Optional filter on the global client parameter. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_global") + public OptionalNullable getIsGlobal() { + if (isGlobal == null) { + return OptionalNullable.absent(); + } + return isGlobal; + } + + /** + * @return Optional filter on whether or not a client is a first-party client. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_first_party") + public OptionalNullable getIsFirstParty() { + if (isFirstParty == null) { + return OptionalNullable.absent(); + } + return isFirstParty; + } + + /** + * @return Optional filter by a comma-separated list of application types. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("app_type") + public OptionalNullable getAppType() { + if (appType == null) { + return OptionalNullable.absent(); + } + return appType; + } + + /** + * @return Advanced Query in <a href="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene</a> syntax.<br /><b>Permitted Queries</b>:<br /><ul><li><i>client_grant.organization_id:{organization_id}</i></li><li><i>client_grant.allow_any_organization:true</i></li></ul><b>Additional Restrictions</b>:<br /><ul><li>Cannot be used in combination with other filters</li><li>Requires use of the <i>from</i> and <i>take</i> paging parameters (checkpoint paginatinon)</li><li>Reduced rate limits apply. See <a href="https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations/enterprise-public">Rate Limit Configurations</a></li></ul><i><b>Note</b>: Recent updates may not be immediately reflected in query results</i> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_global") + private OptionalNullable _getIsGlobal() { + return isGlobal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_first_party") + private OptionalNullable _getIsFirstParty() { + return isFirstParty; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("app_type") + private OptionalNullable _getAppType() { + return appType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListClientsRequestParameters && equalTo((ListClientsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListClientsRequestParameters other) { + return fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && isGlobal.equals(other.isGlobal) + && isFirstParty.equals(other.isFirstParty) + && appType.equals(other.appType) + && q.equals(other.q); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.fields, + this.includeFields, + this.page, + this.perPage, + this.includeTotals, + this.isGlobal, + this.isFirstParty, + this.appType, + this.q); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable isGlobal = OptionalNullable.absent(); + + private OptionalNullable isFirstParty = OptionalNullable.absent(); + + private OptionalNullable appType = OptionalNullable.absent(); + + private OptionalNullable q = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListClientsRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + isGlobal(other.getIsGlobal()); + isFirstParty(other.getIsFirstParty()); + appType(other.getAppType()); + q(other.getQ()); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Default value is 50, maximum value is 100

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Optional filter on the global client parameter.

+ */ + @JsonSetter(value = "is_global", nulls = Nulls.SKIP) + public Builder isGlobal(@Nullable OptionalNullable isGlobal) { + this.isGlobal = isGlobal; + return this; + } + + public Builder isGlobal(Boolean isGlobal) { + this.isGlobal = OptionalNullable.of(isGlobal); + return this; + } + + public Builder isGlobal(Optional isGlobal) { + if (isGlobal.isPresent()) { + this.isGlobal = OptionalNullable.of(isGlobal.get()); + } else { + this.isGlobal = OptionalNullable.absent(); + } + return this; + } + + public Builder isGlobal(com.auth0.client.mgmt.core.Nullable isGlobal) { + if (isGlobal.isNull()) { + this.isGlobal = OptionalNullable.ofNull(); + } else if (isGlobal.isEmpty()) { + this.isGlobal = OptionalNullable.absent(); + } else { + this.isGlobal = OptionalNullable.of(isGlobal.get()); + } + return this; + } + + /** + *

Optional filter on whether or not a client is a first-party client.

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(@Nullable OptionalNullable isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = OptionalNullable.of(isFirstParty); + return this; + } + + public Builder isFirstParty(Optional isFirstParty) { + if (isFirstParty.isPresent()) { + this.isFirstParty = OptionalNullable.of(isFirstParty.get()); + } else { + this.isFirstParty = OptionalNullable.absent(); + } + return this; + } + + public Builder isFirstParty(com.auth0.client.mgmt.core.Nullable isFirstParty) { + if (isFirstParty.isNull()) { + this.isFirstParty = OptionalNullable.ofNull(); + } else if (isFirstParty.isEmpty()) { + this.isFirstParty = OptionalNullable.absent(); + } else { + this.isFirstParty = OptionalNullable.of(isFirstParty.get()); + } + return this; + } + + /** + *

Optional filter by a comma-separated list of application types.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(@Nullable OptionalNullable appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = OptionalNullable.of(appType); + return this; + } + + public Builder appType(Optional appType) { + if (appType.isPresent()) { + this.appType = OptionalNullable.of(appType.get()); + } else { + this.appType = OptionalNullable.absent(); + } + return this; + } + + public Builder appType(com.auth0.client.mgmt.core.Nullable appType) { + if (appType.isNull()) { + this.appType = OptionalNullable.ofNull(); + } else if (appType.isEmpty()) { + this.appType = OptionalNullable.absent(); + } else { + this.appType = OptionalNullable.of(appType.get()); + } + return this; + } + + /** + *

Advanced Query in <a href="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene</a> syntax.<br /><b>Permitted Queries</b>:<br /><ul><li><i>client_grant.organization_id:{organization_id}</i></li><li><i>client_grant.allow_any_organization:true</i></li></ul><b>Additional Restrictions</b>:<br /><ul><li>Cannot be used in combination with other filters</li><li>Requires use of the <i>from</i> and <i>take</i> paging parameters (checkpoint paginatinon)</li><li>Reduced rate limits apply. See <a href="https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations/enterprise-public">Rate Limit Configurations</a></li></ul><i><b>Note</b>: Recent updates may not be immediately reflected in query results</i>

+ */ + @JsonSetter(value = "q", nulls = Nulls.SKIP) + public Builder q(@Nullable OptionalNullable q) { + this.q = q; + return this; + } + + public Builder q(String q) { + this.q = OptionalNullable.of(q); + return this; + } + + public Builder q(Optional q) { + if (q.isPresent()) { + this.q = OptionalNullable.of(q.get()); + } else { + this.q = OptionalNullable.absent(); + } + return this; + } + + public Builder q(com.auth0.client.mgmt.core.Nullable q) { + if (q.isNull()) { + this.q = OptionalNullable.ofNull(); + } else if (q.isEmpty()) { + this.q = OptionalNullable.absent(); + } else { + this.q = OptionalNullable.of(q.get()); + } + return this; + } + + public ListClientsRequestParameters build() { + return new ListClientsRequestParameters( + fields, + includeFields, + page, + perPage, + includeTotals, + isGlobal, + isFirstParty, + appType, + q, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java new file mode 100644 index 000000000..7b7e04dcd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListConnectionsCheckpointPaginatedResponseContent.Builder.class) +public final class ListConnectionsCheckpointPaginatedResponseContent { + private final Optional next; + + private final Optional> connections; + + private final Map additionalProperties; + + private ListConnectionsCheckpointPaginatedResponseContent( + Optional next, + Optional> connections, + Map additionalProperties) { + this.next = next; + this.connections = connections; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("connections") + public Optional> getConnections() { + return connections; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListConnectionsCheckpointPaginatedResponseContent + && equalTo((ListConnectionsCheckpointPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListConnectionsCheckpointPaginatedResponseContent other) { + return next.equals(other.next) && connections.equals(other.connections); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.connections); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> connections = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListConnectionsCheckpointPaginatedResponseContent other) { + next(other.getNext()); + connections(other.getConnections()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "connections", nulls = Nulls.SKIP) + public Builder connections(Optional> connections) { + this.connections = connections; + return this; + } + + public Builder connections(List connections) { + this.connections = Optional.ofNullable(connections); + return this; + } + + public ListConnectionsCheckpointPaginatedResponseContent build() { + return new ListConnectionsCheckpointPaginatedResponseContent(next, connections, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java new file mode 100644 index 000000000..a4f64a988 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java @@ -0,0 +1,426 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListConnectionsQueryParameters.Builder.class) +public final class ListConnectionsQueryParameters { + private final Optional> strategy; + + private final OptionalNullable from; + + private final OptionalNullable take; + + private final OptionalNullable name; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private ListConnectionsQueryParameters( + Optional> strategy, + OptionalNullable from, + OptionalNullable take, + OptionalNullable name, + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.strategy = strategy; + this.from = from; + this.take = take; + this.name = name; + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Provide strategies to only retrieve connections with such strategies + */ + @JsonIgnore + public Optional> getStrategy() { + if (strategy == null) { + return Optional.empty(); + } + return strategy; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Provide the name of the connection to retrieve + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + public OptionalNullable getName() { + if (name == null) { + return OptionalNullable.absent(); + } + return name; + } + + /** + * @return A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return <code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>) + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("strategy") + private Optional> _getStrategy() { + return strategy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private OptionalNullable _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListConnectionsQueryParameters && equalTo((ListConnectionsQueryParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListConnectionsQueryParameters other) { + return strategy.equals(other.strategy) + && from.equals(other.from) + && take.equals(other.take) + && name.equals(other.name) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.strategy, this.from, this.take, this.name, this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> strategy = Optional.empty(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable name = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListConnectionsQueryParameters other) { + strategy(other.getStrategy()); + from(other.getFrom()); + take(other.getTake()); + name(other.getName()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Provide strategies to only retrieve connections with such strategies

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(@Nullable Optional> strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(List strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + public Builder strategy(com.auth0.client.mgmt.core.Nullable> strategy) { + if (strategy.isNull()) { + this.strategy = null; + } else if (strategy.isEmpty()) { + this.strategy = Optional.empty(); + } else { + this.strategy = Optional.of(strategy.get()); + } + return this; + } + + public Builder strategy(ConnectionStrategyEnum strategy) { + this.strategy = Optional.of(Collections.singletonList(strategy)); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Provide the name of the connection to retrieve

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(@Nullable OptionalNullable name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = OptionalNullable.of(name); + return this; + } + + public Builder name(Optional name) { + if (name.isPresent()) { + this.name = OptionalNullable.of(name.get()); + } else { + this.name = OptionalNullable.absent(); + } + return this; + } + + public Builder name(com.auth0.client.mgmt.core.Nullable name) { + if (name.isNull()) { + this.name = OptionalNullable.ofNull(); + } else if (name.isEmpty()) { + this.name = OptionalNullable.absent(); + } else { + this.name = OptionalNullable.of(name.get()); + } + return this; + } + + /** + *

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

<code>true</code> if the fields specified are to be included in the result, <code>false</code> otherwise (defaults to <code>true</code>)

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public ListConnectionsQueryParameters build() { + return new ListConnectionsQueryParameters( + strategy, from, take, name, fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..c97ba3c8d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListDeviceCredentialsOffsetPaginatedResponseContent.Builder.class) +public final class ListDeviceCredentialsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> deviceCredentials; + + private final Map additionalProperties; + + private ListDeviceCredentialsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> deviceCredentials, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.deviceCredentials = deviceCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("device_credentials") + public Optional> getDeviceCredentials() { + return deviceCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListDeviceCredentialsOffsetPaginatedResponseContent + && equalTo((ListDeviceCredentialsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListDeviceCredentialsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && deviceCredentials.equals(other.deviceCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.deviceCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> deviceCredentials = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListDeviceCredentialsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + deviceCredentials(other.getDeviceCredentials()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "device_credentials", nulls = Nulls.SKIP) + public Builder deviceCredentials(Optional> deviceCredentials) { + this.deviceCredentials = deviceCredentials; + return this; + } + + public Builder deviceCredentials(List deviceCredentials) { + this.deviceCredentials = Optional.ofNullable(deviceCredentials); + return this; + } + + public ListDeviceCredentialsOffsetPaginatedResponseContent build() { + return new ListDeviceCredentialsOffsetPaginatedResponseContent( + start, limit, total, deviceCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java new file mode 100644 index 000000000..0be96441d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java @@ -0,0 +1,548 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListDeviceCredentialsRequestParameters.Builder.class) +public final class ListDeviceCredentialsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable userId; + + private final OptionalNullable clientId; + + private final OptionalNullable type; + + private final Map additionalProperties; + + private ListDeviceCredentialsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable userId, + OptionalNullable clientId, + OptionalNullable type, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.fields = fields; + this.includeFields = includeFields; + this.userId = userId; + this.clientId = clientId; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. There is a maximum of 1000 results allowed from this endpoint. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return user_id of the devices to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_id") + public OptionalNullable getUserId() { + if (userId == null) { + return OptionalNullable.absent(); + } + return userId; + } + + /** + * @return client_id of the devices to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + /** + * @return Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + public OptionalNullable getType() { + if (type == null) { + return OptionalNullable.absent(); + } + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_id") + private OptionalNullable _getUserId() { + return userId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private OptionalNullable _getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListDeviceCredentialsRequestParameters + && equalTo((ListDeviceCredentialsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListDeviceCredentialsRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && userId.equals(other.userId) + && clientId.equals(other.clientId) + && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.page, + this.perPage, + this.includeTotals, + this.fields, + this.includeFields, + this.userId, + this.clientId, + this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable userId = OptionalNullable.absent(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private OptionalNullable type = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListDeviceCredentialsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + userId(other.getUserId()); + clientId(other.getClientId()); + type(other.getType()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. There is a maximum of 1000 results allowed from this endpoint.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

user_id of the devices to retrieve.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(@Nullable OptionalNullable userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = OptionalNullable.of(userId); + return this; + } + + public Builder userId(Optional userId) { + if (userId.isPresent()) { + this.userId = OptionalNullable.of(userId.get()); + } else { + this.userId = OptionalNullable.absent(); + } + return this; + } + + public Builder userId(com.auth0.client.mgmt.core.Nullable userId) { + if (userId.isNull()) { + this.userId = OptionalNullable.ofNull(); + } else if (userId.isEmpty()) { + this.userId = OptionalNullable.absent(); + } else { + this.userId = OptionalNullable.of(userId.get()); + } + return this; + } + + /** + *

client_id of the devices to retrieve.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + /** + *

Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(@Nullable OptionalNullable type) { + this.type = type; + return this; + } + + public Builder type(DeviceCredentialTypeEnum type) { + this.type = OptionalNullable.of(type); + return this; + } + + public Builder type(Optional type) { + if (type.isPresent()) { + this.type = OptionalNullable.of(type.get()); + } else { + this.type = OptionalNullable.absent(); + } + return this; + } + + public Builder type(com.auth0.client.mgmt.core.Nullable type) { + if (type.isNull()) { + this.type = OptionalNullable.ofNull(); + } else if (type.isEmpty()) { + this.type = OptionalNullable.absent(); + } else { + this.type = OptionalNullable.of(type.get()); + } + return this; + } + + public ListDeviceCredentialsRequestParameters build() { + return new ListDeviceCredentialsRequestParameters( + page, perPage, includeTotals, fields, includeFields, userId, clientId, type, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..8b4abaab5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListEncryptionKeyOffsetPaginatedResponseContent.Builder.class) +public final class ListEncryptionKeyOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> keys; + + private final Map additionalProperties; + + private ListEncryptionKeyOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> keys, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.keys = keys; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return Number of results per page. + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Total amount of encryption keys. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + /** + * @return Encryption keys. + */ + @JsonProperty("keys") + public Optional> getKeys() { + return keys; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListEncryptionKeyOffsetPaginatedResponseContent + && equalTo((ListEncryptionKeyOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListEncryptionKeyOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && keys.equals(other.keys); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.keys); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> keys = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListEncryptionKeyOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + keys(other.getKeys()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Integer start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

Total amount of encryption keys.

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Integer total) { + this.total = Optional.ofNullable(total); + return this; + } + + /** + *

Encryption keys.

+ */ + @JsonSetter(value = "keys", nulls = Nulls.SKIP) + public Builder keys(Optional> keys) { + this.keys = keys; + return this; + } + + public Builder keys(List keys) { + this.keys = Optional.ofNullable(keys); + return this; + } + + public ListEncryptionKeyOffsetPaginatedResponseContent build() { + return new ListEncryptionKeyOffsetPaginatedResponseContent(start, limit, total, keys, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java new file mode 100644 index 000000000..0dffe8000 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListEventStreamsRequestParameters.Builder.class) +public final class ListEventStreamsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListEventStreamsRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListEventStreamsRequestParameters && equalTo((ListEventStreamsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListEventStreamsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListEventStreamsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListEventStreamsRequestParameters build() { + return new ListEventStreamsRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java new file mode 100644 index 000000000..af0d6c733 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFlowExecutionsPaginatedResponseContent.Builder.class) +public final class ListFlowExecutionsPaginatedResponseContent { + private final Optional next; + + private final Optional> executions; + + private final Map additionalProperties; + + private ListFlowExecutionsPaginatedResponseContent( + Optional next, + Optional> executions, + Map additionalProperties) { + this.next = next; + this.executions = executions; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("executions") + public Optional> getExecutions() { + return executions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFlowExecutionsPaginatedResponseContent + && equalTo((ListFlowExecutionsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFlowExecutionsPaginatedResponseContent other) { + return next.equals(other.next) && executions.equals(other.executions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.executions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> executions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFlowExecutionsPaginatedResponseContent other) { + next(other.getNext()); + executions(other.getExecutions()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "executions", nulls = Nulls.SKIP) + public Builder executions(Optional> executions) { + this.executions = executions; + return this; + } + + public Builder executions(List executions) { + this.executions = Optional.ofNullable(executions); + return this; + } + + public ListFlowExecutionsPaginatedResponseContent build() { + return new ListFlowExecutionsPaginatedResponseContent(next, executions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..94bce6bc6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFlowsOffsetPaginatedResponseContent.Builder.class) +public final class ListFlowsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> flows; + + private final Map additionalProperties; + + private ListFlowsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> flows, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.flows = flows; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("flows") + public Optional> getFlows() { + return flows; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFlowsOffsetPaginatedResponseContent + && equalTo((ListFlowsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFlowsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && flows.equals(other.flows); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.flows); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> flows = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFlowsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + flows(other.getFlows()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "flows", nulls = Nulls.SKIP) + public Builder flows(Optional> flows) { + this.flows = flows; + return this; + } + + public Builder flows(List flows) { + this.flows = Optional.ofNullable(flows); + return this; + } + + public ListFlowsOffsetPaginatedResponseContent build() { + return new ListFlowsOffsetPaginatedResponseContent(start, limit, total, flows, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..39ce76c65 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFormsOffsetPaginatedResponseContent.Builder.class) +public final class ListFormsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> forms; + + private final Map additionalProperties; + + private ListFormsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> forms, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.forms = forms; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("forms") + public Optional> getForms() { + return forms; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFormsOffsetPaginatedResponseContent + && equalTo((ListFormsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFormsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && forms.equals(other.forms); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.forms); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> forms = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFormsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + forms(other.getForms()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "forms", nulls = Nulls.SKIP) + public Builder forms(Optional> forms) { + this.forms = forms; + return this; + } + + public Builder forms(List forms) { + this.forms = Optional.ofNullable(forms); + return this; + } + + public ListFormsOffsetPaginatedResponseContent build() { + return new ListFormsOffsetPaginatedResponseContent(start, limit, total, forms, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java new file mode 100644 index 000000000..a5b127aba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java @@ -0,0 +1,296 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFormsRequestParameters.Builder.class) +public final class ListFormsRequestParameters { + private final Optional> hydrate; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListFormsRequestParameters( + Optional> hydrate, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.hydrate = hydrate; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Query parameter to hydrate the response with additional data + */ + @JsonIgnore + public Optional> getHydrate() { + if (hydrate == null) { + return Optional.empty(); + } + return hydrate; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hydrate") + private Optional> _getHydrate() { + return hydrate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFormsRequestParameters && equalTo((ListFormsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFormsRequestParameters other) { + return hydrate.equals(other.hydrate) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hydrate = Optional.empty(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFormsRequestParameters other) { + hydrate(other.getHydrate()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Query parameter to hydrate the response with additional data

+ */ + @JsonSetter(value = "hydrate", nulls = Nulls.SKIP) + public Builder hydrate(@Nullable Optional> hydrate) { + this.hydrate = hydrate; + return this; + } + + public Builder hydrate(List hydrate) { + this.hydrate = Optional.ofNullable(hydrate); + return this; + } + + public Builder hydrate(com.auth0.client.mgmt.core.Nullable> hydrate) { + if (hydrate.isNull()) { + this.hydrate = null; + } else if (hydrate.isEmpty()) { + this.hydrate = Optional.empty(); + } else { + this.hydrate = Optional.of(hydrate.get()); + } + return this; + } + + public Builder hydrate(FormsRequestParametersHydrateEnum hydrate) { + this.hydrate = Optional.of(Collections.singletonList(hydrate)); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListFormsRequestParameters build() { + return new ListFormsRequestParameters(hydrate, page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..58d7d6974 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListHooksOffsetPaginatedResponseContent.Builder.class) +public final class ListHooksOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> hooks; + + private final Map additionalProperties; + + private ListHooksOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> hooks, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.hooks = hooks; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("hooks") + public Optional> getHooks() { + return hooks; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListHooksOffsetPaginatedResponseContent + && equalTo((ListHooksOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListHooksOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && hooks.equals(other.hooks); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.hooks); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> hooks = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListHooksOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + hooks(other.getHooks()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "hooks", nulls = Nulls.SKIP) + public Builder hooks(Optional> hooks) { + this.hooks = hooks; + return this; + } + + public Builder hooks(List hooks) { + this.hooks = Optional.ofNullable(hooks); + return this; + } + + public ListHooksOffsetPaginatedResponseContent build() { + return new ListHooksOffsetPaginatedResponseContent(start, limit, total, hooks, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java new file mode 100644 index 000000000..fa1bad27e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListHooksRequestParameters.Builder.class) +public final class ListHooksRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable enabled; + + private final OptionalNullable fields; + + private final OptionalNullable triggerId; + + private final Map additionalProperties; + + private ListHooksRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable enabled, + OptionalNullable fields, + OptionalNullable triggerId, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.enabled = enabled; + this.fields = fields; + this.triggerId = triggerId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Optional filter on whether a hook is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + /** + * @return Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Retrieves hooks that match the trigger + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("triggerId") + public OptionalNullable getTriggerId() { + if (triggerId == null) { + return OptionalNullable.absent(); + } + return triggerId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("triggerId") + private OptionalNullable _getTriggerId() { + return triggerId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListHooksRequestParameters && equalTo((ListHooksRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListHooksRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && enabled.equals(other.enabled) + && fields.equals(other.fields) + && triggerId.equals(other.triggerId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.triggerId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable enabled = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable triggerId = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListHooksRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + enabled(other.getEnabled()); + fields(other.getFields()); + triggerId(other.getTriggerId()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Optional filter on whether a hook is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + public Builder enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Retrieves hooks that match the trigger

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(@Nullable OptionalNullable triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(HookTriggerIdEnum triggerId) { + this.triggerId = OptionalNullable.of(triggerId); + return this; + } + + public Builder triggerId(Optional triggerId) { + if (triggerId.isPresent()) { + this.triggerId = OptionalNullable.of(triggerId.get()); + } else { + this.triggerId = OptionalNullable.absent(); + } + return this; + } + + public Builder triggerId(com.auth0.client.mgmt.core.Nullable triggerId) { + if (triggerId.isNull()) { + this.triggerId = OptionalNullable.ofNull(); + } else if (triggerId.isEmpty()) { + this.triggerId = OptionalNullable.absent(); + } else { + this.triggerId = OptionalNullable.of(triggerId.get()); + } + return this; + } + + public ListHooksRequestParameters build() { + return new ListHooksRequestParameters( + page, perPage, includeTotals, enabled, fields, triggerId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..1acead10e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListLogOffsetPaginatedResponseContent.Builder.class) +public final class ListLogOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional length; + + private final Optional total; + + private final Optional> logs; + + private final Map additionalProperties; + + private ListLogOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional length, + Optional total, + Optional> logs, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.length = length; + this.total = total; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("length") + public Optional getLength() { + return length; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListLogOffsetPaginatedResponseContent + && equalTo((ListLogOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListLogOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && length.equals(other.length) + && total.equals(other.total) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional length = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> logs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListLogOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + length(other.getLength()); + total(other.getTotal()); + logs(other.getLogs()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "length", nulls = Nulls.SKIP) + public Builder length(Optional length) { + this.length = length; + return this; + } + + public Builder length(Double length) { + this.length = Optional.ofNullable(length); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public Builder logs(Optional> logs) { + this.logs = logs; + return this; + } + + public Builder logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + public ListLogOffsetPaginatedResponseContent build() { + return new ListLogOffsetPaginatedResponseContent(start, limit, length, total, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java new file mode 100644 index 000000000..bc89f4bc9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListLogsRequestParameters.Builder.class) +public final class ListLogsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable sort; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable includeTotals; + + private final OptionalNullable q; + + private final Map additionalProperties; + + private ListLogsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable sort, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable includeTotals, + OptionalNullable q, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.sort = sort; + this.fields = fields; + this.includeFields = includeFields; + this.includeTotals = includeTotals; + this.q = q; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Paging is disabled if parameter not sent. Default: <code>50</code>. Max value: <code>100</code> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Field to use for sorting appended with <code>:1</code> for ascending and <code>:-1</code> for descending. e.g. <code>date:-1</code> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for <code>include_fields</code>) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (<code>true</code>) or excluded (<code>false</code>) + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Return results as an array when false (default). Return results inside an object that also contains a total result count when true. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListLogsRequestParameters && equalTo((ListLogsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListLogsRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && sort.equals(other.sort) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && includeTotals.equals(other.includeTotals) + && q.equals(other.q); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.page, this.perPage, this.sort, this.fields, this.includeFields, this.includeTotals, this.q); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable q = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListLogsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + sort(other.getSort()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + includeTotals(other.getIncludeTotals()); + q(other.getQ()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Paging is disabled if parameter not sent. Default: <code>50</code>. Max value: <code>100</code>

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Field to use for sorting appended with <code>:1</code> for ascending and <code>:-1</code> for descending. e.g. <code>date:-1</code>

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for <code>include_fields</code>) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (<code>true</code>) or excluded (<code>false</code>)

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Return results as an array when false (default). Return results inside an object that also contains a total result count when true.

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>.

+ */ + @JsonSetter(value = "q", nulls = Nulls.SKIP) + public Builder q(@Nullable OptionalNullable q) { + this.q = q; + return this; + } + + public Builder q(String q) { + this.q = OptionalNullable.of(q); + return this; + } + + public Builder q(Optional q) { + if (q.isPresent()) { + this.q = OptionalNullable.of(q.get()); + } else { + this.q = OptionalNullable.absent(); + } + return this; + } + + public Builder q(com.auth0.client.mgmt.core.Nullable q) { + if (q.isNull()) { + this.q = OptionalNullable.ofNull(); + } else if (q.isEmpty()) { + this.q = OptionalNullable.absent(); + } else { + this.q = OptionalNullable.of(q.get()); + } + return this; + } + + public ListLogsRequestParameters build() { + return new ListLogsRequestParameters( + page, perPage, sort, fields, includeFields, includeTotals, q, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..c6f098161 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListNetworkAclsOffsetPaginatedResponseContent.Builder.class) +public final class ListNetworkAclsOffsetPaginatedResponseContent { + private final Optional> networkAcls; + + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Map additionalProperties; + + private ListNetworkAclsOffsetPaginatedResponseContent( + Optional> networkAcls, + Optional start, + Optional limit, + Optional total, + Map additionalProperties) { + this.networkAcls = networkAcls; + this.start = start; + this.limit = limit; + this.total = total; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("network_acls") + public Optional> getNetworkAcls() { + return networkAcls; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListNetworkAclsOffsetPaginatedResponseContent + && equalTo((ListNetworkAclsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListNetworkAclsOffsetPaginatedResponseContent other) { + return networkAcls.equals(other.networkAcls) + && start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.networkAcls, this.start, this.limit, this.total); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> networkAcls = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListNetworkAclsOffsetPaginatedResponseContent other) { + networkAcls(other.getNetworkAcls()); + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + return this; + } + + @JsonSetter(value = "network_acls", nulls = Nulls.SKIP) + public Builder networkAcls(Optional> networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + public Builder networkAcls(List networkAcls) { + this.networkAcls = Optional.ofNullable(networkAcls); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + public ListNetworkAclsOffsetPaginatedResponseContent build() { + return new ListNetworkAclsOffsetPaginatedResponseContent( + networkAcls, start, limit, total, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java new file mode 100644 index 000000000..f2b54281b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListNetworkAclsRequestParameters.Builder.class) +public final class ListNetworkAclsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListNetworkAclsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Use this field to request a specific page of the list results. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return The amount of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListNetworkAclsRequestParameters && equalTo((ListNetworkAclsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListNetworkAclsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListNetworkAclsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Use this field to request a specific page of the list results.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

The amount of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListNetworkAclsRequestParameters build() { + return new ListNetworkAclsRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..758e7980c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationClientGrantsOffsetPaginatedResponseContent.Builder.class) +public final class ListOrganizationClientGrantsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> clientGrants; + + private final Map additionalProperties; + + private ListOrganizationClientGrantsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> clientGrants, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.clientGrants = clientGrants; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("client_grants") + public Optional> getClientGrants() { + return clientGrants; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationClientGrantsOffsetPaginatedResponseContent + && equalTo((ListOrganizationClientGrantsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationClientGrantsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && clientGrants.equals(other.clientGrants); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.clientGrants); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> clientGrants = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationClientGrantsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + clientGrants(other.getClientGrants()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "client_grants", nulls = Nulls.SKIP) + public Builder clientGrants(Optional> clientGrants) { + this.clientGrants = clientGrants; + return this; + } + + public Builder clientGrants(List clientGrants) { + this.clientGrants = Optional.ofNullable(clientGrants); + return this; + } + + public ListOrganizationClientGrantsOffsetPaginatedResponseContent build() { + return new ListOrganizationClientGrantsOffsetPaginatedResponseContent( + start, limit, total, clientGrants, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..29935e032 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationConnectionsOffsetPaginatedResponseContent.Builder.class) +public final class ListOrganizationConnectionsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> enabledConnections; + + private final Map additionalProperties; + + private ListOrganizationConnectionsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> enabledConnections, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.enabledConnections = enabledConnections; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("enabled_connections") + public Optional> getEnabledConnections() { + return enabledConnections; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationConnectionsOffsetPaginatedResponseContent + && equalTo((ListOrganizationConnectionsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationConnectionsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && enabledConnections.equals(other.enabledConnections); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.enabledConnections); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> enabledConnections = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationConnectionsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + enabledConnections(other.getEnabledConnections()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "enabled_connections", nulls = Nulls.SKIP) + public Builder enabledConnections(Optional> enabledConnections) { + this.enabledConnections = enabledConnections; + return this; + } + + public Builder enabledConnections(List enabledConnections) { + this.enabledConnections = Optional.ofNullable(enabledConnections); + return this; + } + + public ListOrganizationConnectionsOffsetPaginatedResponseContent build() { + return new ListOrganizationConnectionsOffsetPaginatedResponseContent( + start, limit, total, enabledConnections, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..211d4a4cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationInvitationsOffsetPaginatedResponseContent.Builder.class) +public final class ListOrganizationInvitationsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional> invitations; + + private final Map additionalProperties; + + private ListOrganizationInvitationsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional> invitations, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.invitations = invitations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("invitations") + public Optional> getInvitations() { + return invitations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationInvitationsOffsetPaginatedResponseContent + && equalTo((ListOrganizationInvitationsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationInvitationsOffsetPaginatedResponseContent other) { + return start.equals(other.start) && limit.equals(other.limit) && invitations.equals(other.invitations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.invitations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional> invitations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationInvitationsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + invitations(other.getInvitations()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "invitations", nulls = Nulls.SKIP) + public Builder invitations(Optional> invitations) { + this.invitations = invitations; + return this; + } + + public Builder invitations(List invitations) { + this.invitations = Optional.ofNullable(invitations); + return this; + } + + public ListOrganizationInvitationsOffsetPaginatedResponseContent build() { + return new ListOrganizationInvitationsOffsetPaginatedResponseContent( + start, limit, invitations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..d0bc8b685 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationMemberRolesOffsetPaginatedResponseContent.Builder.class) +public final class ListOrganizationMemberRolesOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> roles; + + private final Map additionalProperties; + + private ListOrganizationMemberRolesOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> roles, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationMemberRolesOffsetPaginatedResponseContent + && equalTo((ListOrganizationMemberRolesOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationMemberRolesOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> roles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationMemberRolesOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + roles(other.getRoles()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + public ListOrganizationMemberRolesOffsetPaginatedResponseContent build() { + return new ListOrganizationMemberRolesOffsetPaginatedResponseContent( + start, limit, total, roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java new file mode 100644 index 000000000..f04ca1ef3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationMembersPaginatedResponseContent.Builder.class) +public final class ListOrganizationMembersPaginatedResponseContent { + private final Optional next; + + private final Optional> members; + + private final Map additionalProperties; + + private ListOrganizationMembersPaginatedResponseContent( + Optional next, + Optional> members, + Map additionalProperties) { + this.next = next; + this.members = members; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("members") + public Optional> getMembers() { + return members; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationMembersPaginatedResponseContent + && equalTo((ListOrganizationMembersPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationMembersPaginatedResponseContent other) { + return next.equals(other.next) && members.equals(other.members); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.members); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> members = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationMembersPaginatedResponseContent other) { + next(other.getNext()); + members(other.getMembers()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "members", nulls = Nulls.SKIP) + public Builder members(Optional> members) { + this.members = members; + return this; + } + + public Builder members(List members) { + this.members = Optional.ofNullable(members); + return this; + } + + public ListOrganizationMembersPaginatedResponseContent build() { + return new ListOrganizationMembersPaginatedResponseContent(next, members, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java new file mode 100644 index 000000000..f299d9278 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationsPaginatedResponseContent.Builder.class) +public final class ListOrganizationsPaginatedResponseContent { + private final Optional next; + + private final Optional> organizations; + + private final Map additionalProperties; + + private ListOrganizationsPaginatedResponseContent( + Optional next, + Optional> organizations, + Map additionalProperties) { + this.next = next; + this.organizations = organizations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("organizations") + public Optional> getOrganizations() { + return organizations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationsPaginatedResponseContent + && equalTo((ListOrganizationsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationsPaginatedResponseContent other) { + return next.equals(other.next) && organizations.equals(other.organizations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.organizations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> organizations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationsPaginatedResponseContent other) { + next(other.getNext()); + organizations(other.getOrganizations()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "organizations", nulls = Nulls.SKIP) + public Builder organizations(Optional> organizations) { + this.organizations = organizations; + return this; + } + + public Builder organizations(List organizations) { + this.organizations = Optional.ofNullable(organizations); + return this; + } + + public ListOrganizationsPaginatedResponseContent build() { + return new ListOrganizationsPaginatedResponseContent(next, organizations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java new file mode 100644 index 000000000..36cbf3e96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationsRequestParameters.Builder.class) +public final class ListOrganizationsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final OptionalNullable sort; + + private final Map additionalProperties; + + private ListOrganizationsRequestParameters( + OptionalNullable from, + OptionalNullable take, + OptionalNullable sort, + Map additionalProperties) { + this.from = from; + this.take = take; + this.sort = sort; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Field to sort by. Use <code>field:order</code> where order is <code>1</code> for ascending and <code>-1</code> for descending. e.g. <code>created_at:1</code>. We currently support sorting by the following fields: <code>name</code>, <code>display_name</code> and <code>created_at</code>. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationsRequestParameters + && equalTo((ListOrganizationsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take) && sort.equals(other.sort); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take, this.sort); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + sort(other.getSort()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Field to sort by. Use <code>field:order</code> where order is <code>1</code> for ascending and <code>-1</code> for descending. e.g. <code>created_at:1</code>. We currently support sorting by the following fields: <code>name</code>, <code>display_name</code> and <code>created_at</code>.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + public ListOrganizationsRequestParameters build() { + return new ListOrganizationsRequestParameters(from, take, sort, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java new file mode 100644 index 000000000..a01528c7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListPhoneTemplatesResponseContent.Builder.class) +public final class ListPhoneTemplatesResponseContent { + private final Optional> templates; + + private final Map additionalProperties; + + private ListPhoneTemplatesResponseContent( + Optional> templates, Map additionalProperties) { + this.templates = templates; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("templates") + public Optional> getTemplates() { + return templates; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListPhoneTemplatesResponseContent && equalTo((ListPhoneTemplatesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListPhoneTemplatesResponseContent other) { + return templates.equals(other.templates); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.templates); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> templates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListPhoneTemplatesResponseContent other) { + templates(other.getTemplates()); + return this; + } + + @JsonSetter(value = "templates", nulls = Nulls.SKIP) + public Builder templates(Optional> templates) { + this.templates = templates; + return this; + } + + public Builder templates(List templates) { + this.templates = Optional.ofNullable(templates); + return this; + } + + public ListPhoneTemplatesResponseContent build() { + return new ListPhoneTemplatesResponseContent(templates, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java new file mode 100644 index 000000000..15d627177 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRefreshTokensPaginatedResponseContent.Builder.class) +public final class ListRefreshTokensPaginatedResponseContent { + private final Optional> tokens; + + private final Optional next; + + private final Map additionalProperties; + + private ListRefreshTokensPaginatedResponseContent( + Optional> tokens, + Optional next, + Map additionalProperties) { + this.tokens = tokens; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("tokens") + public Optional> getTokens() { + return tokens; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRefreshTokensPaginatedResponseContent + && equalTo((ListRefreshTokensPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRefreshTokensPaginatedResponseContent other) { + return tokens.equals(other.tokens) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tokens, this.next); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> tokens = Optional.empty(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRefreshTokensPaginatedResponseContent other) { + tokens(other.getTokens()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "tokens", nulls = Nulls.SKIP) + public Builder tokens(Optional> tokens) { + this.tokens = tokens; + return this; + } + + public Builder tokens(List tokens) { + this.tokens = Optional.ofNullable(tokens); + return this; + } + + /** + *

A cursor to be used as the "from" query parameter for the next page of results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public ListRefreshTokensPaginatedResponseContent build() { + return new ListRefreshTokensPaginatedResponseContent(tokens, next, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..9d78cdf54 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListResourceServerOffsetPaginatedResponseContent.Builder.class) +public final class ListResourceServerOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> resourceServers; + + private final Map additionalProperties; + + private ListResourceServerOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> resourceServers, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.resourceServers = resourceServers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("resource_servers") + public Optional> getResourceServers() { + return resourceServers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListResourceServerOffsetPaginatedResponseContent + && equalTo((ListResourceServerOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListResourceServerOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && resourceServers.equals(other.resourceServers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.resourceServers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> resourceServers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListResourceServerOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + resourceServers(other.getResourceServers()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "resource_servers", nulls = Nulls.SKIP) + public Builder resourceServers(Optional> resourceServers) { + this.resourceServers = resourceServers; + return this; + } + + public Builder resourceServers(List resourceServers) { + this.resourceServers = Optional.ofNullable(resourceServers); + return this; + } + + public ListResourceServerOffsetPaginatedResponseContent build() { + return new ListResourceServerOffsetPaginatedResponseContent( + start, limit, total, resourceServers, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java new file mode 100644 index 000000000..6f6882487 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListResourceServerRequestParameters.Builder.class) +public final class ListResourceServerRequestParameters { + private final Optional> identifiers; + + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private ListResourceServerRequestParameters( + Optional> identifiers, + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable includeFields, + Map additionalProperties) { + this.identifiers = identifiers; + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).<br /><b>e.g.</b> <i>../resource-servers?identifiers=id1&identifiers=id2</i> + */ + @JsonIgnore + public Optional> getIdentifiers() { + if (identifiers == null) { + return Optional.empty(); + } + return identifiers; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identifiers") + private Optional> _getIdentifiers() { + return identifiers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListResourceServerRequestParameters + && equalTo((ListResourceServerRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListResourceServerRequestParameters other) { + return identifiers.equals(other.identifiers) + && page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifiers, this.page, this.perPage, this.includeTotals, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> identifiers = Optional.empty(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListResourceServerRequestParameters other) { + identifiers(other.getIdentifiers()); + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).<br /><b>e.g.</b> <i>../resource-servers?identifiers=id1&identifiers=id2</i>

+ */ + @JsonSetter(value = "identifiers", nulls = Nulls.SKIP) + public Builder identifiers(@Nullable Optional> identifiers) { + this.identifiers = identifiers; + return this; + } + + public Builder identifiers(List identifiers) { + this.identifiers = Optional.ofNullable(identifiers); + return this; + } + + public Builder identifiers(com.auth0.client.mgmt.core.Nullable> identifiers) { + if (identifiers.isNull()) { + this.identifiers = null; + } else if (identifiers.isEmpty()) { + this.identifiers = Optional.empty(); + } else { + this.identifiers = Optional.of(identifiers.get()); + } + return this; + } + + public Builder identifiers(String identifiers) { + this.identifiers = Optional.of(Collections.singletonList(identifiers)); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public ListResourceServerRequestParameters build() { + return new ListResourceServerRequestParameters( + identifiers, page, perPage, includeTotals, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..bc8acae9b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRolePermissionsOffsetPaginatedResponseContent.Builder.class) +public final class ListRolePermissionsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> permissions; + + private final Map additionalProperties; + + private ListRolePermissionsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> permissions, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRolePermissionsOffsetPaginatedResponseContent + && equalTo((ListRolePermissionsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRolePermissionsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> permissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRolePermissionsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + permissions(other.getPermissions()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + public ListRolePermissionsOffsetPaginatedResponseContent build() { + return new ListRolePermissionsOffsetPaginatedResponseContent( + start, limit, total, permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java new file mode 100644 index 000000000..a489c2d16 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRoleUsersPaginatedResponseContent.Builder.class) +public final class ListRoleUsersPaginatedResponseContent { + private final Optional next; + + private final Optional> users; + + private final Map additionalProperties; + + private ListRoleUsersPaginatedResponseContent( + Optional next, Optional> users, Map additionalProperties) { + this.next = next; + this.users = users; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("users") + public Optional> getUsers() { + return users; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRoleUsersPaginatedResponseContent + && equalTo((ListRoleUsersPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRoleUsersPaginatedResponseContent other) { + return next.equals(other.next) && users.equals(other.users); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.users); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> users = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRoleUsersPaginatedResponseContent other) { + next(other.getNext()); + users(other.getUsers()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(Optional> users) { + this.users = users; + return this; + } + + public Builder users(List users) { + this.users = Optional.ofNullable(users); + return this; + } + + public ListRoleUsersPaginatedResponseContent build() { + return new ListRoleUsersPaginatedResponseContent(next, users, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..9fbe5e5f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRolesOffsetPaginatedResponseContent.Builder.class) +public final class ListRolesOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> roles; + + private final Map additionalProperties; + + private ListRolesOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> roles, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRolesOffsetPaginatedResponseContent + && equalTo((ListRolesOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRolesOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> roles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRolesOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + roles(other.getRoles()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + public ListRolesOffsetPaginatedResponseContent build() { + return new ListRolesOffsetPaginatedResponseContent(start, limit, total, roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java new file mode 100644 index 000000000..6ce82c229 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRolesRequestParameters.Builder.class) +public final class ListRolesRequestParameters { + private final OptionalNullable perPage; + + private final OptionalNullable page; + + private final OptionalNullable includeTotals; + + private final OptionalNullable nameFilter; + + private final Map additionalProperties; + + private ListRolesRequestParameters( + OptionalNullable perPage, + OptionalNullable page, + OptionalNullable includeTotals, + OptionalNullable nameFilter, + Map additionalProperties) { + this.perPage = perPage; + this.page = page; + this.includeTotals = includeTotals; + this.nameFilter = nameFilter; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Optional filter on name (case-insensitive). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name_filter") + public OptionalNullable getNameFilter() { + if (nameFilter == null) { + return OptionalNullable.absent(); + } + return nameFilter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name_filter") + private OptionalNullable _getNameFilter() { + return nameFilter; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRolesRequestParameters && equalTo((ListRolesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRolesRequestParameters other) { + return perPage.equals(other.perPage) + && page.equals(other.page) + && includeTotals.equals(other.includeTotals) + && nameFilter.equals(other.nameFilter); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.perPage, this.page, this.includeTotals, this.nameFilter); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable nameFilter = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRolesRequestParameters other) { + perPage(other.getPerPage()); + page(other.getPage()); + includeTotals(other.getIncludeTotals()); + nameFilter(other.getNameFilter()); + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Optional filter on name (case-insensitive).

+ */ + @JsonSetter(value = "name_filter", nulls = Nulls.SKIP) + public Builder nameFilter(@org.jetbrains.annotations.Nullable OptionalNullable nameFilter) { + this.nameFilter = nameFilter; + return this; + } + + public Builder nameFilter(String nameFilter) { + this.nameFilter = OptionalNullable.of(nameFilter); + return this; + } + + public Builder nameFilter(Optional nameFilter) { + if (nameFilter.isPresent()) { + this.nameFilter = OptionalNullable.of(nameFilter.get()); + } else { + this.nameFilter = OptionalNullable.absent(); + } + return this; + } + + public Builder nameFilter(Nullable nameFilter) { + if (nameFilter.isNull()) { + this.nameFilter = OptionalNullable.ofNull(); + } else if (nameFilter.isEmpty()) { + this.nameFilter = OptionalNullable.absent(); + } else { + this.nameFilter = OptionalNullable.of(nameFilter.get()); + } + return this; + } + + public ListRolesRequestParameters build() { + return new ListRolesRequestParameters(perPage, page, includeTotals, nameFilter, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..c1a0726c0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRulesOffsetPaginatedResponseContent.Builder.class) +public final class ListRulesOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> rules; + + private final Map additionalProperties; + + private ListRulesOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> rules, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.rules = rules; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("rules") + public Optional> getRules() { + return rules; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRulesOffsetPaginatedResponseContent + && equalTo((ListRulesOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRulesOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && rules.equals(other.rules); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.rules); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> rules = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRulesOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + rules(other.getRules()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "rules", nulls = Nulls.SKIP) + public Builder rules(Optional> rules) { + this.rules = rules; + return this; + } + + public Builder rules(List rules) { + this.rules = Optional.ofNullable(rules); + return this; + } + + public ListRulesOffsetPaginatedResponseContent build() { + return new ListRulesOffsetPaginatedResponseContent(start, limit, total, rules, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java new file mode 100644 index 000000000..c0693d187 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRulesRequestParameters.Builder.class) +public final class ListRulesRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable enabled; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final Map additionalProperties; + + private ListRulesRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable enabled, + OptionalNullable fields, + OptionalNullable includeFields, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.enabled = enabled; + this.fields = fields; + this.includeFields = includeFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Optional filter on whether a rule is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRulesRequestParameters && equalTo((ListRulesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRulesRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && enabled.equals(other.enabled) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.includeFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable enabled = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRulesRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + enabled(other.getEnabled()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Optional filter on whether a rule is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + public Builder enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + public ListRulesRequestParameters build() { + return new ListRulesRequestParameters( + page, perPage, includeTotals, enabled, fields, includeFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java new file mode 100644 index 000000000..54a43729b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListSelfServiceProfilesPaginatedResponseContent.Builder.class) +public final class ListSelfServiceProfilesPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> selfServiceProfiles; + + private final Map additionalProperties; + + private ListSelfServiceProfilesPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> selfServiceProfiles, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.selfServiceProfiles = selfServiceProfiles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("self_service_profiles") + public Optional> getSelfServiceProfiles() { + return selfServiceProfiles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListSelfServiceProfilesPaginatedResponseContent + && equalTo((ListSelfServiceProfilesPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListSelfServiceProfilesPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && selfServiceProfiles.equals(other.selfServiceProfiles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.selfServiceProfiles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> selfServiceProfiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListSelfServiceProfilesPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + selfServiceProfiles(other.getSelfServiceProfiles()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "self_service_profiles", nulls = Nulls.SKIP) + public Builder selfServiceProfiles(Optional> selfServiceProfiles) { + this.selfServiceProfiles = selfServiceProfiles; + return this; + } + + public Builder selfServiceProfiles(List selfServiceProfiles) { + this.selfServiceProfiles = Optional.ofNullable(selfServiceProfiles); + return this; + } + + public ListSelfServiceProfilesPaginatedResponseContent build() { + return new ListSelfServiceProfilesPaginatedResponseContent( + start, limit, total, selfServiceProfiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java new file mode 100644 index 000000000..880fe0faa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListSelfServiceProfilesRequestParameters.Builder.class) +public final class ListSelfServiceProfilesRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListSelfServiceProfilesRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListSelfServiceProfilesRequestParameters + && equalTo((ListSelfServiceProfilesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListSelfServiceProfilesRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListSelfServiceProfilesRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListSelfServiceProfilesRequestParameters build() { + return new ListSelfServiceProfilesRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java new file mode 100644 index 000000000..6c03ca1f6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListTokenExchangeProfileResponseContent.Builder.class) +public final class ListTokenExchangeProfileResponseContent { + private final Optional next; + + private final Optional> tokenExchangeProfiles; + + private final Map additionalProperties; + + private ListTokenExchangeProfileResponseContent( + Optional next, + Optional> tokenExchangeProfiles, + Map additionalProperties) { + this.next = next; + this.tokenExchangeProfiles = tokenExchangeProfiles; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("token_exchange_profiles") + public Optional> getTokenExchangeProfiles() { + return tokenExchangeProfiles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListTokenExchangeProfileResponseContent + && equalTo((ListTokenExchangeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListTokenExchangeProfileResponseContent other) { + return next.equals(other.next) && tokenExchangeProfiles.equals(other.tokenExchangeProfiles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.tokenExchangeProfiles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> tokenExchangeProfiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListTokenExchangeProfileResponseContent other) { + next(other.getNext()); + tokenExchangeProfiles(other.getTokenExchangeProfiles()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "token_exchange_profiles", nulls = Nulls.SKIP) + public Builder tokenExchangeProfiles( + Optional> tokenExchangeProfiles) { + this.tokenExchangeProfiles = tokenExchangeProfiles; + return this; + } + + public Builder tokenExchangeProfiles(List tokenExchangeProfiles) { + this.tokenExchangeProfiles = Optional.ofNullable(tokenExchangeProfiles); + return this; + } + + public ListTokenExchangeProfileResponseContent build() { + return new ListTokenExchangeProfileResponseContent(next, tokenExchangeProfiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..832aba447 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserAuthenticationMethodsOffsetPaginatedResponseContent.Builder.class) +public final class ListUserAuthenticationMethodsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> authenticators; + + private final Map additionalProperties; + + private ListUserAuthenticationMethodsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> authenticators, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.authenticators = authenticators; + this.additionalProperties = additionalProperties; + } + + /** + * @return Index of the starting record. Derived from the page and per_page parameters. + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return Maximum amount of records to return. + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Total number of pageable records. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + /** + * @return The paginated authentication methods. Returned in this structure when include_totals is true. + */ + @JsonProperty("authenticators") + public Optional> getAuthenticators() { + return authenticators; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserAuthenticationMethodsOffsetPaginatedResponseContent + && equalTo((ListUserAuthenticationMethodsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserAuthenticationMethodsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && authenticators.equals(other.authenticators); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.authenticators); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> authenticators = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserAuthenticationMethodsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + authenticators(other.getAuthenticators()); + return this; + } + + /** + *

Index of the starting record. Derived from the page and per_page parameters.

+ */ + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

Maximum amount of records to return.

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

Total number of pageable records.

+ */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + /** + *

The paginated authentication methods. Returned in this structure when include_totals is true.

+ */ + @JsonSetter(value = "authenticators", nulls = Nulls.SKIP) + public Builder authenticators(Optional> authenticators) { + this.authenticators = authenticators; + return this; + } + + public Builder authenticators(List authenticators) { + this.authenticators = Optional.ofNullable(authenticators); + return this; + } + + public ListUserAuthenticationMethodsOffsetPaginatedResponseContent build() { + return new ListUserAuthenticationMethodsOffsetPaginatedResponseContent( + start, limit, total, authenticators, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java new file mode 100644 index 000000000..a99680925 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java @@ -0,0 +1,218 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserBlocksByIdentifierRequestParameters.Builder.class) +public final class ListUserBlocksByIdentifierRequestParameters { + private final String identifier; + + private final OptionalNullable considerBruteForceEnablement; + + private final Map additionalProperties; + + private ListUserBlocksByIdentifierRequestParameters( + String identifier, + OptionalNullable considerBruteForceEnablement, + Map additionalProperties) { + this.identifier = identifier; + this.considerBruteForceEnablement = considerBruteForceEnablement; + this.additionalProperties = additionalProperties; + } + + /** + * @return Should be any of a username, phone number, or email. + */ + @JsonProperty("identifier") + public String getIdentifier() { + return identifier; + } + + /** + * @return If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consider_brute_force_enablement") + public OptionalNullable getConsiderBruteForceEnablement() { + if (considerBruteForceEnablement == null) { + return OptionalNullable.absent(); + } + return considerBruteForceEnablement; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consider_brute_force_enablement") + private OptionalNullable _getConsiderBruteForceEnablement() { + return considerBruteForceEnablement; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserBlocksByIdentifierRequestParameters + && equalTo((ListUserBlocksByIdentifierRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserBlocksByIdentifierRequestParameters other) { + return identifier.equals(other.identifier) + && considerBruteForceEnablement.equals(other.considerBruteForceEnablement); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier, this.considerBruteForceEnablement); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdentifierStage builder() { + return new Builder(); + } + + public interface IdentifierStage { + /** + *

Should be any of a username, phone number, or email.

+ */ + _FinalStage identifier(@NotNull String identifier); + + Builder from(ListUserBlocksByIdentifierRequestParameters other); + } + + public interface _FinalStage { + ListUserBlocksByIdentifierRequestParameters build(); + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ */ + _FinalStage considerBruteForceEnablement(@Nullable OptionalNullable considerBruteForceEnablement); + + _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnablement); + + _FinalStage considerBruteForceEnablement(Optional considerBruteForceEnablement); + + _FinalStage considerBruteForceEnablement( + com.auth0.client.mgmt.core.Nullable considerBruteForceEnablement); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdentifierStage, _FinalStage { + private String identifier; + + private OptionalNullable considerBruteForceEnablement = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ListUserBlocksByIdentifierRequestParameters other) { + identifier(other.getIdentifier()); + considerBruteForceEnablement(other.getConsiderBruteForceEnablement()); + return this; + } + + /** + *

Should be any of a username, phone number, or email.

+ *

Should be any of a username, phone number, or email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("identifier") + public _FinalStage identifier(@NotNull String identifier) { + this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); + return this; + } + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage considerBruteForceEnablement( + com.auth0.client.mgmt.core.Nullable considerBruteForceEnablement) { + if (considerBruteForceEnablement.isNull()) { + this.considerBruteForceEnablement = OptionalNullable.ofNull(); + } else if (considerBruteForceEnablement.isEmpty()) { + this.considerBruteForceEnablement = OptionalNullable.absent(); + } else { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); + } + return this; + } + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage considerBruteForceEnablement(Optional considerBruteForceEnablement) { + if (considerBruteForceEnablement.isPresent()) { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); + } else { + this.considerBruteForceEnablement = OptionalNullable.absent(); + } + return this; + } + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnablement) { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement); + return this; + } + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ */ + @java.lang.Override + @JsonSetter(value = "consider_brute_force_enablement", nulls = Nulls.SKIP) + public _FinalStage considerBruteForceEnablement( + @Nullable OptionalNullable considerBruteForceEnablement) { + this.considerBruteForceEnablement = considerBruteForceEnablement; + return this; + } + + @java.lang.Override + public ListUserBlocksByIdentifierRequestParameters build() { + return new ListUserBlocksByIdentifierRequestParameters( + identifier, considerBruteForceEnablement, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java new file mode 100644 index 000000000..1e92989df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserBlocksByIdentifierResponseContent.Builder.class) +public final class ListUserBlocksByIdentifierResponseContent { + private final Optional> blockedFor; + + private final Map additionalProperties; + + private ListUserBlocksByIdentifierResponseContent( + Optional> blockedFor, Map additionalProperties) { + this.blockedFor = blockedFor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Array of identifier + IP address pairs. IP address is optional, and may be omitted in certain circumstances (such as Account Lockout mode). + */ + @JsonProperty("blocked_for") + public Optional> getBlockedFor() { + return blockedFor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserBlocksByIdentifierResponseContent + && equalTo((ListUserBlocksByIdentifierResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserBlocksByIdentifierResponseContent other) { + return blockedFor.equals(other.blockedFor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blockedFor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> blockedFor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserBlocksByIdentifierResponseContent other) { + blockedFor(other.getBlockedFor()); + return this; + } + + /** + *

Array of identifier + IP address pairs. IP address is optional, and may be omitted in certain circumstances (such as Account Lockout mode).

+ */ + @JsonSetter(value = "blocked_for", nulls = Nulls.SKIP) + public Builder blockedFor(Optional> blockedFor) { + this.blockedFor = blockedFor; + return this; + } + + public Builder blockedFor(List blockedFor) { + this.blockedFor = Optional.ofNullable(blockedFor); + return this; + } + + public ListUserBlocksByIdentifierResponseContent build() { + return new ListUserBlocksByIdentifierResponseContent(blockedFor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java new file mode 100644 index 000000000..d7df16883 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserBlocksRequestParameters.Builder.class) +public final class ListUserBlocksRequestParameters { + private final OptionalNullable considerBruteForceEnablement; + + private final Map additionalProperties; + + private ListUserBlocksRequestParameters( + OptionalNullable considerBruteForceEnablement, Map additionalProperties) { + this.considerBruteForceEnablement = considerBruteForceEnablement; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consider_brute_force_enablement") + public OptionalNullable getConsiderBruteForceEnablement() { + if (considerBruteForceEnablement == null) { + return OptionalNullable.absent(); + } + return considerBruteForceEnablement; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consider_brute_force_enablement") + private OptionalNullable _getConsiderBruteForceEnablement() { + return considerBruteForceEnablement; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserBlocksRequestParameters && equalTo((ListUserBlocksRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserBlocksRequestParameters other) { + return considerBruteForceEnablement.equals(other.considerBruteForceEnablement); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.considerBruteForceEnablement); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable considerBruteForceEnablement = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserBlocksRequestParameters other) { + considerBruteForceEnablement(other.getConsiderBruteForceEnablement()); + return this; + } + + /** + *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + * If true and Brute Force Protection is disabled, will return an empty list.

+ */ + @JsonSetter(value = "consider_brute_force_enablement", nulls = Nulls.SKIP) + public Builder considerBruteForceEnablement(@Nullable OptionalNullable considerBruteForceEnablement) { + this.considerBruteForceEnablement = considerBruteForceEnablement; + return this; + } + + public Builder considerBruteForceEnablement(Boolean considerBruteForceEnablement) { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement); + return this; + } + + public Builder considerBruteForceEnablement(Optional considerBruteForceEnablement) { + if (considerBruteForceEnablement.isPresent()) { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); + } else { + this.considerBruteForceEnablement = OptionalNullable.absent(); + } + return this; + } + + public Builder considerBruteForceEnablement( + com.auth0.client.mgmt.core.Nullable considerBruteForceEnablement) { + if (considerBruteForceEnablement.isNull()) { + this.considerBruteForceEnablement = OptionalNullable.ofNull(); + } else if (considerBruteForceEnablement.isEmpty()) { + this.considerBruteForceEnablement = OptionalNullable.absent(); + } else { + this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); + } + return this; + } + + public ListUserBlocksRequestParameters build() { + return new ListUserBlocksRequestParameters(considerBruteForceEnablement, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java new file mode 100644 index 000000000..1ac2c96b1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserBlocksResponseContent.Builder.class) +public final class ListUserBlocksResponseContent { + private final Optional> blockedFor; + + private final Map additionalProperties; + + private ListUserBlocksResponseContent( + Optional> blockedFor, Map additionalProperties) { + this.blockedFor = blockedFor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Array of identifier + IP address pairs. IP address is optional, and may be omitted in certain circumstances (such as Account Lockout mode). + */ + @JsonProperty("blocked_for") + public Optional> getBlockedFor() { + return blockedFor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserBlocksResponseContent && equalTo((ListUserBlocksResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserBlocksResponseContent other) { + return blockedFor.equals(other.blockedFor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blockedFor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> blockedFor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserBlocksResponseContent other) { + blockedFor(other.getBlockedFor()); + return this; + } + + /** + *

Array of identifier + IP address pairs. IP address is optional, and may be omitted in certain circumstances (such as Account Lockout mode).

+ */ + @JsonSetter(value = "blocked_for", nulls = Nulls.SKIP) + public Builder blockedFor(Optional> blockedFor) { + this.blockedFor = blockedFor; + return this; + } + + public Builder blockedFor(List blockedFor) { + this.blockedFor = Optional.ofNullable(blockedFor); + return this; + } + + public ListUserBlocksResponseContent build() { + return new ListUserBlocksResponseContent(blockedFor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..ae55daad1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserGrantsOffsetPaginatedResponseContent.Builder.class) +public final class ListUserGrantsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> grants; + + private final Map additionalProperties; + + private ListUserGrantsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> grants, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.grants = grants; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("grants") + public Optional> getGrants() { + return grants; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserGrantsOffsetPaginatedResponseContent + && equalTo((ListUserGrantsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserGrantsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && grants.equals(other.grants); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.grants); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> grants = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserGrantsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + grants(other.getGrants()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "grants", nulls = Nulls.SKIP) + public Builder grants(Optional> grants) { + this.grants = grants; + return this; + } + + public Builder grants(List grants) { + this.grants = Optional.ofNullable(grants); + return this; + } + + public ListUserGrantsOffsetPaginatedResponseContent build() { + return new ListUserGrantsOffsetPaginatedResponseContent(start, limit, total, grants, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java new file mode 100644 index 000000000..432ccf8c1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserGrantsRequestParameters.Builder.class) +public final class ListUserGrantsRequestParameters { + private final OptionalNullable perPage; + + private final OptionalNullable page; + + private final OptionalNullable includeTotals; + + private final OptionalNullable userId; + + private final OptionalNullable clientId; + + private final OptionalNullable audience; + + private final Map additionalProperties; + + private ListUserGrantsRequestParameters( + OptionalNullable perPage, + OptionalNullable page, + OptionalNullable includeTotals, + OptionalNullable userId, + OptionalNullable clientId, + OptionalNullable audience, + Map additionalProperties) { + this.perPage = perPage; + this.page = page; + this.includeTotals = includeTotals; + this.userId = userId; + this.clientId = clientId; + this.audience = audience; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return user_id of the grants to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_id") + public OptionalNullable getUserId() { + if (userId == null) { + return OptionalNullable.absent(); + } + return userId; + } + + /** + * @return client_id of the grants to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + /** + * @return audience of the grants to retrieve. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + public OptionalNullable getAudience() { + if (audience == null) { + return OptionalNullable.absent(); + } + return audience; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_id") + private OptionalNullable _getUserId() { + return userId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("audience") + private OptionalNullable _getAudience() { + return audience; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserGrantsRequestParameters && equalTo((ListUserGrantsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserGrantsRequestParameters other) { + return perPage.equals(other.perPage) + && page.equals(other.page) + && includeTotals.equals(other.includeTotals) + && userId.equals(other.userId) + && clientId.equals(other.clientId) + && audience.equals(other.audience); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.perPage, this.page, this.includeTotals, this.userId, this.clientId, this.audience); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable userId = OptionalNullable.absent(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private OptionalNullable audience = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserGrantsRequestParameters other) { + perPage(other.getPerPage()); + page(other.getPage()); + includeTotals(other.getIncludeTotals()); + userId(other.getUserId()); + clientId(other.getClientId()); + audience(other.getAudience()); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

user_id of the grants to retrieve.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(@org.jetbrains.annotations.Nullable OptionalNullable userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = OptionalNullable.of(userId); + return this; + } + + public Builder userId(Optional userId) { + if (userId.isPresent()) { + this.userId = OptionalNullable.of(userId.get()); + } else { + this.userId = OptionalNullable.absent(); + } + return this; + } + + public Builder userId(Nullable userId) { + if (userId.isNull()) { + this.userId = OptionalNullable.ofNull(); + } else if (userId.isEmpty()) { + this.userId = OptionalNullable.absent(); + } else { + this.userId = OptionalNullable.of(userId.get()); + } + return this; + } + + /** + *

client_id of the grants to retrieve.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@org.jetbrains.annotations.Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + /** + *

audience of the grants to retrieve.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(@org.jetbrains.annotations.Nullable OptionalNullable audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = OptionalNullable.of(audience); + return this; + } + + public Builder audience(Optional audience) { + if (audience.isPresent()) { + this.audience = OptionalNullable.of(audience.get()); + } else { + this.audience = OptionalNullable.absent(); + } + return this; + } + + public Builder audience(Nullable audience) { + if (audience.isNull()) { + this.audience = OptionalNullable.ofNull(); + } else if (audience.isEmpty()) { + this.audience = OptionalNullable.absent(); + } else { + this.audience = OptionalNullable.of(audience.get()); + } + return this; + } + + public ListUserGrantsRequestParameters build() { + return new ListUserGrantsRequestParameters( + perPage, page, includeTotals, userId, clientId, audience, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..9c9d1d39a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserOrganizationsOffsetPaginatedResponseContent.Builder.class) +public final class ListUserOrganizationsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> organizations; + + private final Map additionalProperties; + + private ListUserOrganizationsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> organizations, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.organizations = organizations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("organizations") + public Optional> getOrganizations() { + return organizations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserOrganizationsOffsetPaginatedResponseContent + && equalTo((ListUserOrganizationsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserOrganizationsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && organizations.equals(other.organizations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.organizations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> organizations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserOrganizationsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + organizations(other.getOrganizations()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "organizations", nulls = Nulls.SKIP) + public Builder organizations(Optional> organizations) { + this.organizations = organizations; + return this; + } + + public Builder organizations(List organizations) { + this.organizations = Optional.ofNullable(organizations); + return this; + } + + public ListUserOrganizationsOffsetPaginatedResponseContent build() { + return new ListUserOrganizationsOffsetPaginatedResponseContent( + start, limit, total, organizations, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..8cc2bba3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserPermissionsOffsetPaginatedResponseContent.Builder.class) +public final class ListUserPermissionsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> permissions; + + private final Map additionalProperties; + + private ListUserPermissionsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> permissions, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserPermissionsOffsetPaginatedResponseContent + && equalTo((ListUserPermissionsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserPermissionsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> permissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserPermissionsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + permissions(other.getPermissions()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + public ListUserPermissionsOffsetPaginatedResponseContent build() { + return new ListUserPermissionsOffsetPaginatedResponseContent( + start, limit, total, permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..80f924308 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserRolesOffsetPaginatedResponseContent.Builder.class) +public final class ListUserRolesOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> roles; + + private final Map additionalProperties; + + private ListUserRolesOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> roles, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserRolesOffsetPaginatedResponseContent + && equalTo((ListUserRolesOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserRolesOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> roles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserRolesOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + roles(other.getRoles()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + public ListUserRolesOffsetPaginatedResponseContent build() { + return new ListUserRolesOffsetPaginatedResponseContent(start, limit, total, roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java new file mode 100644 index 000000000..55c248c5b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserSessionsPaginatedResponseContent.Builder.class) +public final class ListUserSessionsPaginatedResponseContent { + private final Optional> sessions; + + private final Optional next; + + private final Map additionalProperties; + + private ListUserSessionsPaginatedResponseContent( + Optional> sessions, + Optional next, + Map additionalProperties) { + this.sessions = sessions; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("sessions") + public Optional> getSessions() { + return sessions; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserSessionsPaginatedResponseContent + && equalTo((ListUserSessionsPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserSessionsPaginatedResponseContent other) { + return sessions.equals(other.sessions) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sessions, this.next); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> sessions = Optional.empty(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserSessionsPaginatedResponseContent other) { + sessions(other.getSessions()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "sessions", nulls = Nulls.SKIP) + public Builder sessions(Optional> sessions) { + this.sessions = sessions; + return this; + } + + public Builder sessions(List sessions) { + this.sessions = Optional.ofNullable(sessions); + return this; + } + + /** + *

A cursor to be used as the "from" query parameter for the next page of results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public ListUserSessionsPaginatedResponseContent build() { + return new ListUserSessionsPaginatedResponseContent(sessions, next, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java new file mode 100644 index 000000000..c66fe3a64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUsersByEmailRequestParameters.Builder.class) +public final class ListUsersByEmailRequestParameters { + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final String email; + + private final Map additionalProperties; + + private ListUsersByEmailRequestParameters( + OptionalNullable fields, + OptionalNullable includeFields, + String email, + Map additionalProperties) { + this.fields = fields; + this.includeFields = includeFields; + this.email = email; + this.additionalProperties = additionalProperties; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). Defaults to true. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Email address to search for (case-sensitive). + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUsersByEmailRequestParameters && equalTo((ListUsersByEmailRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUsersByEmailRequestParameters other) { + return fields.equals(other.fields) && includeFields.equals(other.includeFields) && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.includeFields, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + /** + *

Email address to search for (case-sensitive).

+ */ + _FinalStage email(@NotNull String email); + + Builder from(ListUsersByEmailRequestParameters other); + } + + public interface _FinalStage { + ListUsersByEmailRequestParameters build(); + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + _FinalStage fields(@Nullable OptionalNullable fields); + + _FinalStage fields(String fields); + + _FinalStage fields(Optional fields); + + _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields); + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ */ + _FinalStage includeFields(@Nullable OptionalNullable includeFields); + + _FinalStage includeFields(Boolean includeFields); + + _FinalStage includeFields(Optional includeFields); + + _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable includeFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ListUsersByEmailRequestParameters other) { + fields(other.getFields()); + includeFields(other.getIncludeFields()); + email(other.getEmail()); + return this; + } + + /** + *

Email address to search for (case-sensitive).

+ *

Email address to search for (case-sensitive).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

+ */ + @java.lang.Override + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public _FinalStage includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public ListUsersByEmailRequestParameters build() { + return new ListUsersByEmailRequestParameters(fields, includeFields, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..6367d2130 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUsersOffsetPaginatedResponseContent.Builder.class) +public final class ListUsersOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional length; + + private final Optional total; + + private final Optional> users; + + private final Map additionalProperties; + + private ListUsersOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional length, + Optional total, + Optional> users, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.length = length; + this.total = total; + this.users = users; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("length") + public Optional getLength() { + return length; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("users") + public Optional> getUsers() { + return users; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUsersOffsetPaginatedResponseContent + && equalTo((ListUsersOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUsersOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && length.equals(other.length) + && total.equals(other.total) + && users.equals(other.users); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.length, this.total, this.users); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional length = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> users = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUsersOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + length(other.getLength()); + total(other.getTotal()); + users(other.getUsers()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "length", nulls = Nulls.SKIP) + public Builder length(Optional length) { + this.length = length; + return this; + } + + public Builder length(Double length) { + this.length = Optional.ofNullable(length); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(Optional> users) { + this.users = users; + return this; + } + + public Builder users(List users) { + this.users = Optional.ofNullable(users); + return this; + } + + public ListUsersOffsetPaginatedResponseContent build() { + return new ListUsersOffsetPaginatedResponseContent( + start, limit, length, total, users, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java new file mode 100644 index 000000000..474ff3d05 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java @@ -0,0 +1,679 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUsersRequestParameters.Builder.class) +public final class ListUsersRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable sort; + + private final OptionalNullable connection; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable q; + + private final OptionalNullable searchEngine; + + private final OptionalNullable primaryOrder; + + private final Map additionalProperties; + + private ListUsersRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable sort, + OptionalNullable connection, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable q, + OptionalNullable searchEngine, + OptionalNullable primaryOrder, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.sort = sort; + this.connection = connection; + this.fields = fields; + this.includeFields = includeFields; + this.q = q; + this.searchEngine = searchEngine; + this.primaryOrder = primaryOrder; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Field to sort by. Use <code>field:order</code> where order is <code>1</code> for ascending and <code>-1</code> for descending. e.g. <code>created_at:1</code> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + /** + * @return Connection filter. Only applies when using <code>search_engine=v1</code>. To filter by connection with <code>search_engine=v2|v3</code>, use <code>q=identities.connection:"connection_name"</code> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("connection") + public OptionalNullable getConnection() { + if (connection == null) { + return OptionalNullable.absent(); + } + return connection; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>. Some query types cannot be used on metadata fields, for details see <a href='https://auth0.com/docs/users/search/v3/query-syntax#searchable-fields'>Searchable Fields</a>. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + /** + * @return The version of the search engine + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("search_engine") + public OptionalNullable getSearchEngine() { + if (searchEngine == null) { + return OptionalNullable.absent(); + } + return searchEngine; + } + + /** + * @return If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("primary_order") + public OptionalNullable getPrimaryOrder() { + if (primaryOrder == null) { + return OptionalNullable.absent(); + } + return primaryOrder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("connection") + private OptionalNullable _getConnection() { + return connection; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("search_engine") + private OptionalNullable _getSearchEngine() { + return searchEngine; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("primary_order") + private OptionalNullable _getPrimaryOrder() { + return primaryOrder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUsersRequestParameters && equalTo((ListUsersRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUsersRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && sort.equals(other.sort) + && connection.equals(other.connection) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && q.equals(other.q) + && searchEngine.equals(other.searchEngine) + && primaryOrder.equals(other.primaryOrder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.page, + this.perPage, + this.includeTotals, + this.sort, + this.connection, + this.fields, + this.includeFields, + this.q, + this.searchEngine, + this.primaryOrder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + private OptionalNullable connection = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable q = OptionalNullable.absent(); + + private OptionalNullable searchEngine = OptionalNullable.absent(); + + private OptionalNullable primaryOrder = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUsersRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + sort(other.getSort()); + connection(other.getConnection()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + q(other.getQ()); + searchEngine(other.getSearchEngine()); + primaryOrder(other.getPrimaryOrder()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Field to sort by. Use <code>field:order</code> where order is <code>1</code> for ascending and <code>-1</code> for descending. e.g. <code>created_at:1</code>

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + /** + *

Connection filter. Only applies when using <code>search_engine=v1</code>. To filter by connection with <code>search_engine=v2|v3</code>, use <code>q=identities.connection:"connection_name"</code>

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(@Nullable OptionalNullable connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = OptionalNullable.of(connection); + return this; + } + + public Builder connection(Optional connection) { + if (connection.isPresent()) { + this.connection = OptionalNullable.of(connection.get()); + } else { + this.connection = OptionalNullable.absent(); + } + return this; + } + + public Builder connection(com.auth0.client.mgmt.core.Nullable connection) { + if (connection.isNull()) { + this.connection = OptionalNullable.ofNull(); + } else if (connection.isEmpty()) { + this.connection = OptionalNullable.absent(); + } else { + this.connection = OptionalNullable.of(connection.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>. Some query types cannot be used on metadata fields, for details see <a href='https://auth0.com/docs/users/search/v3/query-syntax#searchable-fields'>Searchable Fields</a>.

+ */ + @JsonSetter(value = "q", nulls = Nulls.SKIP) + public Builder q(@Nullable OptionalNullable q) { + this.q = q; + return this; + } + + public Builder q(String q) { + this.q = OptionalNullable.of(q); + return this; + } + + public Builder q(Optional q) { + if (q.isPresent()) { + this.q = OptionalNullable.of(q.get()); + } else { + this.q = OptionalNullable.absent(); + } + return this; + } + + public Builder q(com.auth0.client.mgmt.core.Nullable q) { + if (q.isNull()) { + this.q = OptionalNullable.ofNull(); + } else if (q.isEmpty()) { + this.q = OptionalNullable.absent(); + } else { + this.q = OptionalNullable.of(q.get()); + } + return this; + } + + /** + *

The version of the search engine

+ */ + @JsonSetter(value = "search_engine", nulls = Nulls.SKIP) + public Builder searchEngine(@Nullable OptionalNullable searchEngine) { + this.searchEngine = searchEngine; + return this; + } + + public Builder searchEngine(SearchEngineVersionsEnum searchEngine) { + this.searchEngine = OptionalNullable.of(searchEngine); + return this; + } + + public Builder searchEngine(Optional searchEngine) { + if (searchEngine.isPresent()) { + this.searchEngine = OptionalNullable.of(searchEngine.get()); + } else { + this.searchEngine = OptionalNullable.absent(); + } + return this; + } + + public Builder searchEngine(com.auth0.client.mgmt.core.Nullable searchEngine) { + if (searchEngine.isNull()) { + this.searchEngine = OptionalNullable.ofNull(); + } else if (searchEngine.isEmpty()) { + this.searchEngine = OptionalNullable.absent(); + } else { + this.searchEngine = OptionalNullable.of(searchEngine.get()); + } + return this; + } + + /** + *

If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required.

+ */ + @JsonSetter(value = "primary_order", nulls = Nulls.SKIP) + public Builder primaryOrder(@Nullable OptionalNullable primaryOrder) { + this.primaryOrder = primaryOrder; + return this; + } + + public Builder primaryOrder(Boolean primaryOrder) { + this.primaryOrder = OptionalNullable.of(primaryOrder); + return this; + } + + public Builder primaryOrder(Optional primaryOrder) { + if (primaryOrder.isPresent()) { + this.primaryOrder = OptionalNullable.of(primaryOrder.get()); + } else { + this.primaryOrder = OptionalNullable.absent(); + } + return this; + } + + public Builder primaryOrder(com.auth0.client.mgmt.core.Nullable primaryOrder) { + if (primaryOrder.isNull()) { + this.primaryOrder = OptionalNullable.ofNull(); + } else if (primaryOrder.isEmpty()) { + this.primaryOrder = OptionalNullable.absent(); + } else { + this.primaryOrder = OptionalNullable.of(primaryOrder.get()); + } + return this; + } + + public ListUsersRequestParameters build() { + return new ListUsersRequestParameters( + page, + perPage, + includeTotals, + sort, + connection, + fields, + includeFields, + q, + searchEngine, + primaryOrder, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java new file mode 100644 index 000000000..6de2aee25 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListVerifiableCredentialTemplatesPaginatedResponseContent.Builder.class) +public final class ListVerifiableCredentialTemplatesPaginatedResponseContent { + private final Optional next; + + private final Optional> templates; + + private final Map additionalProperties; + + private ListVerifiableCredentialTemplatesPaginatedResponseContent( + Optional next, + Optional> templates, + Map additionalProperties) { + this.next = next; + this.templates = templates; + this.additionalProperties = additionalProperties; + } + + /** + * @return Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("templates") + public Optional> getTemplates() { + return templates; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListVerifiableCredentialTemplatesPaginatedResponseContent + && equalTo((ListVerifiableCredentialTemplatesPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListVerifiableCredentialTemplatesPaginatedResponseContent other) { + return next.equals(other.next) && templates.equals(other.templates); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.templates); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> templates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListVerifiableCredentialTemplatesPaginatedResponseContent other) { + next(other.getNext()); + templates(other.getTemplates()); + return this; + } + + /** + *

Opaque identifier for use with the <i>from</i> query parameter for the next page of results.<br/>This identifier is valid for 24 hours.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "templates", nulls = Nulls.SKIP) + public Builder templates(Optional> templates) { + this.templates = templates; + return this; + } + + public Builder templates(List templates) { + this.templates = Optional.ofNullable(templates); + return this; + } + + public ListVerifiableCredentialTemplatesPaginatedResponseContent build() { + return new ListVerifiableCredentialTemplatesPaginatedResponseContent(next, templates, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Log.java b/src/main/java/com/auth0/client/mgmt/types/Log.java new file mode 100644 index 000000000..27dd1c32b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Log.java @@ -0,0 +1,755 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Log.Builder.class) +public final class Log { + private final Optional date; + + private final Optional type; + + private final OptionalNullable description; + + private final Optional connection; + + private final Optional connectionId; + + private final Optional clientId; + + private final Optional clientName; + + private final Optional ip; + + private final Optional hostname; + + private final Optional userId; + + private final Optional userName; + + private final Optional audience; + + private final Optional scope; + + private final Optional strategy; + + private final Optional strategyType; + + private final Optional logId; + + private final Optional isMobile; + + private final Optional> details; + + private final Optional userAgent; + + private final Optional securityContext; + + private final Optional locationInfo; + + private final Map additionalProperties; + + private Log( + Optional date, + Optional type, + OptionalNullable description, + Optional connection, + Optional connectionId, + Optional clientId, + Optional clientName, + Optional ip, + Optional hostname, + Optional userId, + Optional userName, + Optional audience, + Optional scope, + Optional strategy, + Optional strategyType, + Optional logId, + Optional isMobile, + Optional> details, + Optional userAgent, + Optional securityContext, + Optional locationInfo, + Map additionalProperties) { + this.date = date; + this.type = type; + this.description = description; + this.connection = connection; + this.connectionId = connectionId; + this.clientId = clientId; + this.clientName = clientName; + this.ip = ip; + this.hostname = hostname; + this.userId = userId; + this.userName = userName; + this.audience = audience; + this.scope = scope; + this.strategy = strategy; + this.strategyType = strategyType; + this.logId = logId; + this.isMobile = isMobile; + this.details = details; + this.userAgent = userAgent; + this.securityContext = securityContext; + this.locationInfo = locationInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("date") + public Optional getDate() { + return date; + } + + /** + * @return Type of event. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Description of this event. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + public OptionalNullable getDescription() { + if (description == null) { + return OptionalNullable.absent(); + } + return description; + } + + /** + * @return Name of the connection the event relates to. + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + /** + * @return ID of the connection the event relates to. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return ID of the client (application). + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the client (application). + */ + @JsonProperty("client_name") + public Optional getClientName() { + return clientName; + } + + /** + * @return IP address of the log event source. + */ + @JsonProperty("ip") + public Optional getIp() { + return ip; + } + + /** + * @return Hostname the event applies to. + */ + @JsonProperty("hostname") + public Optional getHostname() { + return hostname; + } + + /** + * @return ID of the user involved in the event. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Name of the user involved in the event. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return API audience the event applies to. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scope permissions applied to the event. + */ + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + /** + * @return Name of the strategy involved in the event. + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Type of strategy involved in the event. + */ + @JsonProperty("strategy_type") + public Optional getStrategyType() { + return strategyType; + } + + /** + * @return Unique ID of the event. + */ + @JsonProperty("log_id") + public Optional getLogId() { + return logId; + } + + /** + * @return Whether the client was a mobile device (true) or desktop/laptop/server (false). + */ + @JsonProperty("isMobile") + public Optional getIsMobile() { + return isMobile; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + /** + * @return User agent string from the client device that caused the event. + */ + @JsonProperty("user_agent") + public Optional getUserAgent() { + return userAgent; + } + + @JsonProperty("security_context") + public Optional getSecurityContext() { + return securityContext; + } + + @JsonProperty("location_info") + public Optional getLocationInfo() { + return locationInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private OptionalNullable _getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Log && equalTo((Log) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Log other) { + return date.equals(other.date) + && type.equals(other.type) + && description.equals(other.description) + && connection.equals(other.connection) + && connectionId.equals(other.connectionId) + && clientId.equals(other.clientId) + && clientName.equals(other.clientName) + && ip.equals(other.ip) + && hostname.equals(other.hostname) + && userId.equals(other.userId) + && userName.equals(other.userName) + && audience.equals(other.audience) + && scope.equals(other.scope) + && strategy.equals(other.strategy) + && strategyType.equals(other.strategyType) + && logId.equals(other.logId) + && isMobile.equals(other.isMobile) + && details.equals(other.details) + && userAgent.equals(other.userAgent) + && securityContext.equals(other.securityContext) + && locationInfo.equals(other.locationInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.date, + this.type, + this.description, + this.connection, + this.connectionId, + this.clientId, + this.clientName, + this.ip, + this.hostname, + this.userId, + this.userName, + this.audience, + this.scope, + this.strategy, + this.strategyType, + this.logId, + this.isMobile, + this.details, + this.userAgent, + this.securityContext, + this.locationInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional date = Optional.empty(); + + private Optional type = Optional.empty(); + + private OptionalNullable description = OptionalNullable.absent(); + + private Optional connection = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientName = Optional.empty(); + + private Optional ip = Optional.empty(); + + private Optional hostname = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional strategyType = Optional.empty(); + + private Optional logId = Optional.empty(); + + private Optional isMobile = Optional.empty(); + + private Optional> details = Optional.empty(); + + private Optional userAgent = Optional.empty(); + + private Optional securityContext = Optional.empty(); + + private Optional locationInfo = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Log other) { + date(other.getDate()); + type(other.getType()); + description(other.getDescription()); + connection(other.getConnection()); + connectionId(other.getConnectionId()); + clientId(other.getClientId()); + clientName(other.getClientName()); + ip(other.getIp()); + hostname(other.getHostname()); + userId(other.getUserId()); + userName(other.getUserName()); + audience(other.getAudience()); + scope(other.getScope()); + strategy(other.getStrategy()); + strategyType(other.getStrategyType()); + logId(other.getLogId()); + isMobile(other.getIsMobile()); + details(other.getDetails()); + userAgent(other.getUserAgent()); + securityContext(other.getSecurityContext()); + locationInfo(other.getLocationInfo()); + return this; + } + + @JsonSetter(value = "date", nulls = Nulls.SKIP) + public Builder date(Optional date) { + this.date = date; + return this; + } + + public Builder date(LogDate date) { + this.date = Optional.ofNullable(date); + return this; + } + + /** + *

Type of event.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

Description of this event.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(@Nullable OptionalNullable description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = OptionalNullable.of(description); + return this; + } + + public Builder description(Optional description) { + if (description.isPresent()) { + this.description = OptionalNullable.of(description.get()); + } else { + this.description = OptionalNullable.absent(); + } + return this; + } + + public Builder description(com.auth0.client.mgmt.core.Nullable description) { + if (description.isNull()) { + this.description = OptionalNullable.ofNull(); + } else if (description.isEmpty()) { + this.description = OptionalNullable.absent(); + } else { + this.description = OptionalNullable.of(description.get()); + } + return this; + } + + /** + *

Name of the connection the event relates to.

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + *

ID of the connection the event relates to.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

ID of the client (application).

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the client (application).

+ */ + @JsonSetter(value = "client_name", nulls = Nulls.SKIP) + public Builder clientName(Optional clientName) { + this.clientName = clientName; + return this; + } + + public Builder clientName(String clientName) { + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + *

IP address of the log event source.

+ */ + @JsonSetter(value = "ip", nulls = Nulls.SKIP) + public Builder ip(Optional ip) { + this.ip = ip; + return this; + } + + public Builder ip(String ip) { + this.ip = Optional.ofNullable(ip); + return this; + } + + /** + *

Hostname the event applies to.

+ */ + @JsonSetter(value = "hostname", nulls = Nulls.SKIP) + public Builder hostname(Optional hostname) { + this.hostname = hostname; + return this; + } + + public Builder hostname(String hostname) { + this.hostname = Optional.ofNullable(hostname); + return this; + } + + /** + *

ID of the user involved in the event.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Name of the user involved in the event.

+ */ + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public Builder userName(Optional userName) { + this.userName = userName; + return this; + } + + public Builder userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + /** + *

API audience the event applies to.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scope permissions applied to the event.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + /** + *

Name of the strategy involved in the event.

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Type of strategy involved in the event.

+ */ + @JsonSetter(value = "strategy_type", nulls = Nulls.SKIP) + public Builder strategyType(Optional strategyType) { + this.strategyType = strategyType; + return this; + } + + public Builder strategyType(String strategyType) { + this.strategyType = Optional.ofNullable(strategyType); + return this; + } + + /** + *

Unique ID of the event.

+ */ + @JsonSetter(value = "log_id", nulls = Nulls.SKIP) + public Builder logId(Optional logId) { + this.logId = logId; + return this; + } + + public Builder logId(String logId) { + this.logId = Optional.ofNullable(logId); + return this; + } + + /** + *

Whether the client was a mobile device (true) or desktop/laptop/server (false).

+ */ + @JsonSetter(value = "isMobile", nulls = Nulls.SKIP) + public Builder isMobile(Optional isMobile) { + this.isMobile = isMobile; + return this; + } + + public Builder isMobile(Boolean isMobile) { + this.isMobile = Optional.ofNullable(isMobile); + return this; + } + + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public Builder details(Optional> details) { + this.details = details; + return this; + } + + public Builder details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + /** + *

User agent string from the client device that caused the event.

+ */ + @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) + public Builder userAgent(Optional userAgent) { + this.userAgent = userAgent; + return this; + } + + public Builder userAgent(String userAgent) { + this.userAgent = Optional.ofNullable(userAgent); + return this; + } + + @JsonSetter(value = "security_context", nulls = Nulls.SKIP) + public Builder securityContext(Optional securityContext) { + this.securityContext = securityContext; + return this; + } + + public Builder securityContext(LogSecurityContext securityContext) { + this.securityContext = Optional.ofNullable(securityContext); + return this; + } + + @JsonSetter(value = "location_info", nulls = Nulls.SKIP) + public Builder locationInfo(Optional locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + public Builder locationInfo(LogLocationInfo locationInfo) { + this.locationInfo = Optional.ofNullable(locationInfo); + return this; + } + + public Log build() { + return new Log( + date, + type, + description, + connection, + connectionId, + clientId, + clientName, + ip, + hostname, + userId, + userName, + audience, + scope, + strategy, + strategyType, + logId, + isMobile, + details, + userAgent, + securityContext, + locationInfo, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogDate.java b/src/main/java/com/auth0/client/mgmt/types/LogDate.java new file mode 100644 index 000000000..5dca4f02f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogDate.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = LogDate.Deserializer.class) +public final class LogDate { + private final Object value; + + private final int type; + + private LogDate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogDate && equalTo((LogDate) other); + } + + private boolean equalTo(LogDate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static LogDate of(String value) { + return new LogDate(value, 0); + } + + public static LogDate of(Map value) { + return new LogDate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LogDate.class); + } + + @java.lang.Override + public LogDate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java new file mode 100644 index 000000000..135dfbfdd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java @@ -0,0 +1,330 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogLocationInfo.Builder.class) +public final class LogLocationInfo { + private final Optional countryCode; + + private final Optional countryCode3; + + private final Optional countryName; + + private final Optional cityName; + + private final Optional latitude; + + private final Optional longitude; + + private final Optional timeZone; + + private final Optional continentCode; + + private final Map additionalProperties; + + private LogLocationInfo( + Optional countryCode, + Optional countryCode3, + Optional countryName, + Optional cityName, + Optional latitude, + Optional longitude, + Optional timeZone, + Optional continentCode, + Map additionalProperties) { + this.countryCode = countryCode; + this.countryCode3 = countryCode3; + this.countryName = countryName; + this.cityName = cityName; + this.latitude = latitude; + this.longitude = longitude; + this.timeZone = timeZone; + this.continentCode = continentCode; + this.additionalProperties = additionalProperties; + } + + /** + * @return Two-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-2 ISO 3166-1</a> country code. + */ + @JsonProperty("country_code") + public Optional getCountryCode() { + return countryCode; + } + + /** + * @return Three-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-3 ISO 3166-1</a> country code. + */ + @JsonProperty("country_code3") + public Optional getCountryCode3() { + return countryCode3; + } + + /** + * @return Full country name in English. + */ + @JsonProperty("country_name") + public Optional getCountryName() { + return countryName; + } + + /** + * @return Full city name in English. + */ + @JsonProperty("city_name") + public Optional getCityName() { + return cityName; + } + + /** + * @return Global latitude (horizontal) position. + */ + @JsonProperty("latitude") + public Optional getLatitude() { + return latitude; + } + + /** + * @return Global longitude (vertical) position. + */ + @JsonProperty("longitude") + public Optional getLongitude() { + return longitude; + } + + /** + * @return Time zone name as found in the <a href="https://www.iana.org/time-zones">tz database</a>. + */ + @JsonProperty("time_zone") + public Optional getTimeZone() { + return timeZone; + } + + /** + * @return Continent the country is located within. Can be AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), NA (North America), OC (Oceania) or SA (South America). + */ + @JsonProperty("continent_code") + public Optional getContinentCode() { + return continentCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogLocationInfo && equalTo((LogLocationInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogLocationInfo other) { + return countryCode.equals(other.countryCode) + && countryCode3.equals(other.countryCode3) + && countryName.equals(other.countryName) + && cityName.equals(other.cityName) + && latitude.equals(other.latitude) + && longitude.equals(other.longitude) + && timeZone.equals(other.timeZone) + && continentCode.equals(other.continentCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.countryCode, + this.countryCode3, + this.countryName, + this.cityName, + this.latitude, + this.longitude, + this.timeZone, + this.continentCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional countryCode = Optional.empty(); + + private Optional countryCode3 = Optional.empty(); + + private Optional countryName = Optional.empty(); + + private Optional cityName = Optional.empty(); + + private Optional latitude = Optional.empty(); + + private Optional longitude = Optional.empty(); + + private Optional timeZone = Optional.empty(); + + private Optional continentCode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogLocationInfo other) { + countryCode(other.getCountryCode()); + countryCode3(other.getCountryCode3()); + countryName(other.getCountryName()); + cityName(other.getCityName()); + latitude(other.getLatitude()); + longitude(other.getLongitude()); + timeZone(other.getTimeZone()); + continentCode(other.getContinentCode()); + return this; + } + + /** + *

Two-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-2 ISO 3166-1</a> country code.

+ */ + @JsonSetter(value = "country_code", nulls = Nulls.SKIP) + public Builder countryCode(Optional countryCode) { + this.countryCode = countryCode; + return this; + } + + public Builder countryCode(String countryCode) { + this.countryCode = Optional.ofNullable(countryCode); + return this; + } + + /** + *

Three-letter <a href="https://www.iso.org/iso-3166-country-codes.html">Alpha-3 ISO 3166-1</a> country code.

+ */ + @JsonSetter(value = "country_code3", nulls = Nulls.SKIP) + public Builder countryCode3(Optional countryCode3) { + this.countryCode3 = countryCode3; + return this; + } + + public Builder countryCode3(String countryCode3) { + this.countryCode3 = Optional.ofNullable(countryCode3); + return this; + } + + /** + *

Full country name in English.

+ */ + @JsonSetter(value = "country_name", nulls = Nulls.SKIP) + public Builder countryName(Optional countryName) { + this.countryName = countryName; + return this; + } + + public Builder countryName(String countryName) { + this.countryName = Optional.ofNullable(countryName); + return this; + } + + /** + *

Full city name in English.

+ */ + @JsonSetter(value = "city_name", nulls = Nulls.SKIP) + public Builder cityName(Optional cityName) { + this.cityName = cityName; + return this; + } + + public Builder cityName(String cityName) { + this.cityName = Optional.ofNullable(cityName); + return this; + } + + /** + *

Global latitude (horizontal) position.

+ */ + @JsonSetter(value = "latitude", nulls = Nulls.SKIP) + public Builder latitude(Optional latitude) { + this.latitude = latitude; + return this; + } + + public Builder latitude(String latitude) { + this.latitude = Optional.ofNullable(latitude); + return this; + } + + /** + *

Global longitude (vertical) position.

+ */ + @JsonSetter(value = "longitude", nulls = Nulls.SKIP) + public Builder longitude(Optional longitude) { + this.longitude = longitude; + return this; + } + + public Builder longitude(String longitude) { + this.longitude = Optional.ofNullable(longitude); + return this; + } + + /** + *

Time zone name as found in the <a href="https://www.iana.org/time-zones">tz database</a>.

+ */ + @JsonSetter(value = "time_zone", nulls = Nulls.SKIP) + public Builder timeZone(Optional timeZone) { + this.timeZone = timeZone; + return this; + } + + public Builder timeZone(String timeZone) { + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + /** + *

Continent the country is located within. Can be AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), NA (North America), OC (Oceania) or SA (South America).

+ */ + @JsonSetter(value = "continent_code", nulls = Nulls.SKIP) + public Builder continentCode(Optional continentCode) { + this.continentCode = continentCode; + return this; + } + + public Builder continentCode(String continentCode) { + this.continentCode = Optional.ofNullable(continentCode); + return this; + } + + public LogLocationInfo build() { + return new LogLocationInfo( + countryCode, + countryCode3, + countryName, + cityName, + latitude, + longitude, + timeZone, + continentCode, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java new file mode 100644 index 000000000..d3e305a6b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogSecurityContext.Builder.class) +public final class LogSecurityContext { + private final Optional ja3; + + private final Optional ja4; + + private final Map additionalProperties; + + private LogSecurityContext(Optional ja3, Optional ja4, Map additionalProperties) { + this.ja3 = ja3; + this.ja4 = ja4; + this.additionalProperties = additionalProperties; + } + + /** + * @return JA3 fingerprint value. + */ + @JsonProperty("ja3") + public Optional getJa3() { + return ja3; + } + + /** + * @return JA4 fingerprint value. + */ + @JsonProperty("ja4") + public Optional getJa4() { + return ja4; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogSecurityContext && equalTo((LogSecurityContext) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogSecurityContext other) { + return ja3.equals(other.ja3) && ja4.equals(other.ja4); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ja3, this.ja4); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ja3 = Optional.empty(); + + private Optional ja4 = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogSecurityContext other) { + ja3(other.getJa3()); + ja4(other.getJa4()); + return this; + } + + /** + *

JA3 fingerprint value.

+ */ + @JsonSetter(value = "ja3", nulls = Nulls.SKIP) + public Builder ja3(Optional ja3) { + this.ja3 = ja3; + return this; + } + + public Builder ja3(String ja3) { + this.ja3 = Optional.ofNullable(ja3); + return this; + } + + /** + *

JA4 fingerprint value.

+ */ + @JsonSetter(value = "ja4", nulls = Nulls.SKIP) + public Builder ja4(Optional ja4) { + this.ja4 = ja4; + return this; + } + + public Builder ja4(String ja4) { + this.ja4 = Optional.ofNullable(ja4); + return this; + } + + public LogSecurityContext build() { + return new LogSecurityContext(ja3, ja4, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java new file mode 100644 index 000000000..73427a011 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamDatadogRegionEnum { + public static final LogStreamDatadogRegionEnum US3 = new LogStreamDatadogRegionEnum(Value.US3, "us3"); + + public static final LogStreamDatadogRegionEnum US = new LogStreamDatadogRegionEnum(Value.US, "us"); + + public static final LogStreamDatadogRegionEnum EU = new LogStreamDatadogRegionEnum(Value.EU, "eu"); + + public static final LogStreamDatadogRegionEnum US5 = new LogStreamDatadogRegionEnum(Value.US5, "us5"); + + private final Value value; + + private final String string; + + LogStreamDatadogRegionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamDatadogRegionEnum + && this.string.equals(((LogStreamDatadogRegionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case US3: + return visitor.visitUs3(); + case US: + return visitor.visitUs(); + case EU: + return visitor.visitEu(); + case US5: + return visitor.visitUs5(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamDatadogRegionEnum valueOf(String value) { + switch (value) { + case "us3": + return US3; + case "us": + return US; + case "eu": + return EU; + case "us5": + return US5; + default: + return new LogStreamDatadogRegionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + US, + + EU, + + US3, + + US5, + + UNKNOWN + } + + public interface Visitor { + T visitUs(); + + T visitEu(); + + T visitUs3(); + + T visitUs5(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java new file mode 100644 index 000000000..7655a24c4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamDatadogResponseSchema.Builder.class) +public final class LogStreamDatadogResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamDatadogResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamDatadogResponseSchema && equalTo((LogStreamDatadogResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamDatadogResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamDatadogResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamDatadogSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamDatadogResponseSchema build() { + return new LogStreamDatadogResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java new file mode 100644 index 000000000..98ca3b2d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamDatadogSink.Builder.class) +public final class LogStreamDatadogSink { + private final String datadogApiKey; + + private final LogStreamDatadogRegionEnum datadogRegion; + + private final Map additionalProperties; + + private LogStreamDatadogSink( + String datadogApiKey, LogStreamDatadogRegionEnum datadogRegion, Map additionalProperties) { + this.datadogApiKey = datadogApiKey; + this.datadogRegion = datadogRegion; + this.additionalProperties = additionalProperties; + } + + /** + * @return Datadog API Key + */ + @JsonProperty("datadogApiKey") + public String getDatadogApiKey() { + return datadogApiKey; + } + + @JsonProperty("datadogRegion") + public LogStreamDatadogRegionEnum getDatadogRegion() { + return datadogRegion; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamDatadogSink && equalTo((LogStreamDatadogSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamDatadogSink other) { + return datadogApiKey.equals(other.datadogApiKey) && datadogRegion.equals(other.datadogRegion); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.datadogApiKey, this.datadogRegion); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DatadogApiKeyStage builder() { + return new Builder(); + } + + public interface DatadogApiKeyStage { + /** + *

Datadog API Key

+ */ + DatadogRegionStage datadogApiKey(@NotNull String datadogApiKey); + + Builder from(LogStreamDatadogSink other); + } + + public interface DatadogRegionStage { + _FinalStage datadogRegion(@NotNull LogStreamDatadogRegionEnum datadogRegion); + } + + public interface _FinalStage { + LogStreamDatadogSink build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DatadogApiKeyStage, DatadogRegionStage, _FinalStage { + private String datadogApiKey; + + private LogStreamDatadogRegionEnum datadogRegion; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamDatadogSink other) { + datadogApiKey(other.getDatadogApiKey()); + datadogRegion(other.getDatadogRegion()); + return this; + } + + /** + *

Datadog API Key

+ *

Datadog API Key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("datadogApiKey") + public DatadogRegionStage datadogApiKey(@NotNull String datadogApiKey) { + this.datadogApiKey = Objects.requireNonNull(datadogApiKey, "datadogApiKey must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("datadogRegion") + public _FinalStage datadogRegion(@NotNull LogStreamDatadogRegionEnum datadogRegion) { + this.datadogRegion = Objects.requireNonNull(datadogRegion, "datadogRegion must not be null"); + return this; + } + + @java.lang.Override + public LogStreamDatadogSink build() { + return new LogStreamDatadogSink(datadogApiKey, datadogRegion, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java new file mode 100644 index 000000000..9389ff557 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java @@ -0,0 +1,293 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamEventBridgeResponseSchema.Builder.class) +public final class LogStreamEventBridgeResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamEventBridgeResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamEventBridgeResponseSchema + && equalTo((LogStreamEventBridgeResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamEventBridgeResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamEventBridgeResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamEventBridgeSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamEventBridgeResponseSchema build() { + return new LogStreamEventBridgeResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java new file mode 100644 index 000000000..30d1188dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamEventBridgeSink.Builder.class) +public final class LogStreamEventBridgeSink { + private final String awsAccountId; + + private final LogStreamEventBridgeSinkRegionEnum awsRegion; + + private final Optional awsPartnerEventSource; + + private final Map additionalProperties; + + private LogStreamEventBridgeSink( + String awsAccountId, + LogStreamEventBridgeSinkRegionEnum awsRegion, + Optional awsPartnerEventSource, + Map additionalProperties) { + this.awsAccountId = awsAccountId; + this.awsRegion = awsRegion; + this.awsPartnerEventSource = awsPartnerEventSource; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS account ID + */ + @JsonProperty("awsAccountId") + public String getAwsAccountId() { + return awsAccountId; + } + + @JsonProperty("awsRegion") + public LogStreamEventBridgeSinkRegionEnum getAwsRegion() { + return awsRegion; + } + + /** + * @return AWS EventBridge partner event source + */ + @JsonProperty("awsPartnerEventSource") + public Optional getAwsPartnerEventSource() { + return awsPartnerEventSource; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamEventBridgeSink && equalTo((LogStreamEventBridgeSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamEventBridgeSink other) { + return awsAccountId.equals(other.awsAccountId) + && awsRegion.equals(other.awsRegion) + && awsPartnerEventSource.equals(other.awsPartnerEventSource); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AwsAccountIdStage builder() { + return new Builder(); + } + + public interface AwsAccountIdStage { + /** + *

AWS account ID

+ */ + AwsRegionStage awsAccountId(@NotNull String awsAccountId); + + Builder from(LogStreamEventBridgeSink other); + } + + public interface AwsRegionStage { + _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegion); + } + + public interface _FinalStage { + LogStreamEventBridgeSink build(); + + /** + *

AWS EventBridge partner event source

+ */ + _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource); + + _FinalStage awsPartnerEventSource(String awsPartnerEventSource); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AwsAccountIdStage, AwsRegionStage, _FinalStage { + private String awsAccountId; + + private LogStreamEventBridgeSinkRegionEnum awsRegion; + + private Optional awsPartnerEventSource = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamEventBridgeSink other) { + awsAccountId(other.getAwsAccountId()); + awsRegion(other.getAwsRegion()); + awsPartnerEventSource(other.getAwsPartnerEventSource()); + return this; + } + + /** + *

AWS account ID

+ *

AWS account ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("awsAccountId") + public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { + this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("awsRegion") + public _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegion) { + this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); + return this; + } + + /** + *

AWS EventBridge partner event source

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { + this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); + return this; + } + + /** + *

AWS EventBridge partner event source

+ */ + @java.lang.Override + @JsonSetter(value = "awsPartnerEventSource", nulls = Nulls.SKIP) + public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { + this.awsPartnerEventSource = awsPartnerEventSource; + return this; + } + + @java.lang.Override + public LogStreamEventBridgeSink build() { + return new LogStreamEventBridgeSink(awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java new file mode 100644 index 000000000..8105f44a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java @@ -0,0 +1,295 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamEventBridgeSinkRegionEnum { + public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST2, "ap-northeast-2"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST1, "ap-southeast-1"); + + public static final LogStreamEventBridgeSinkRegionEnum ME_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.ME_SOUTH1, "me-south-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST3 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST3, "ap-northeast-3"); + + public static final LogStreamEventBridgeSinkRegionEnum US_EAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_EAST1, "us-east-1"); + + public static final LogStreamEventBridgeSinkRegionEnum SA_EAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.SA_EAST1, "sa-east-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST1, "ap-northeast-1"); + + public static final LogStreamEventBridgeSinkRegionEnum US_GOV_EAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_GOV_EAST1, "us-gov-east-1"); + + public static final LogStreamEventBridgeSinkRegionEnum US_EAST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_EAST2, "us-east-2"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTH1, "ap-south-1"); + + public static final LogStreamEventBridgeSinkRegionEnum CA_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.CA_CENTRAL1, "ca-central-1"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_NORTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_NORTH1, "eu-north-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_EAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_EAST1, "ap-east-1"); + + public static final LogStreamEventBridgeSinkRegionEnum US_GOV_WEST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_GOV_WEST1, "us-gov-west-1"); + + public static final LogStreamEventBridgeSinkRegionEnum US_WEST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_WEST2, "us-west-2"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_WEST3 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST3, "eu-west-3"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_WEST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST2, "eu-west-2"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST2, "ap-southeast-2"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_CENTRAL1, "eu-central-1"); + + public static final LogStreamEventBridgeSinkRegionEnum US_WEST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_WEST1, "us-west-1"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_WEST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST1, "eu-west-1"); + + private final Value value; + + private final String string; + + LogStreamEventBridgeSinkRegionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamEventBridgeSinkRegionEnum + && this.string.equals(((LogStreamEventBridgeSinkRegionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AP_NORTHEAST2: + return visitor.visitApNortheast2(); + case AP_SOUTHEAST1: + return visitor.visitApSoutheast1(); + case ME_SOUTH1: + return visitor.visitMeSouth1(); + case AP_NORTHEAST3: + return visitor.visitApNortheast3(); + case US_EAST1: + return visitor.visitUsEast1(); + case SA_EAST1: + return visitor.visitSaEast1(); + case AP_NORTHEAST1: + return visitor.visitApNortheast1(); + case US_GOV_EAST1: + return visitor.visitUsGovEast1(); + case US_EAST2: + return visitor.visitUsEast2(); + case AP_SOUTH1: + return visitor.visitApSouth1(); + case CA_CENTRAL1: + return visitor.visitCaCentral1(); + case EU_NORTH1: + return visitor.visitEuNorth1(); + case AP_EAST1: + return visitor.visitApEast1(); + case US_GOV_WEST1: + return visitor.visitUsGovWest1(); + case US_WEST2: + return visitor.visitUsWest2(); + case EU_WEST3: + return visitor.visitEuWest3(); + case EU_WEST2: + return visitor.visitEuWest2(); + case AP_SOUTHEAST2: + return visitor.visitApSoutheast2(); + case EU_CENTRAL1: + return visitor.visitEuCentral1(); + case US_WEST1: + return visitor.visitUsWest1(); + case EU_WEST1: + return visitor.visitEuWest1(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamEventBridgeSinkRegionEnum valueOf(String value) { + switch (value) { + case "ap-northeast-2": + return AP_NORTHEAST2; + case "ap-southeast-1": + return AP_SOUTHEAST1; + case "me-south-1": + return ME_SOUTH1; + case "ap-northeast-3": + return AP_NORTHEAST3; + case "us-east-1": + return US_EAST1; + case "sa-east-1": + return SA_EAST1; + case "ap-northeast-1": + return AP_NORTHEAST1; + case "us-gov-east-1": + return US_GOV_EAST1; + case "us-east-2": + return US_EAST2; + case "ap-south-1": + return AP_SOUTH1; + case "ca-central-1": + return CA_CENTRAL1; + case "eu-north-1": + return EU_NORTH1; + case "ap-east-1": + return AP_EAST1; + case "us-gov-west-1": + return US_GOV_WEST1; + case "us-west-2": + return US_WEST2; + case "eu-west-3": + return EU_WEST3; + case "eu-west-2": + return EU_WEST2; + case "ap-southeast-2": + return AP_SOUTHEAST2; + case "eu-central-1": + return EU_CENTRAL1; + case "us-west-1": + return US_WEST1; + case "eu-west-1": + return EU_WEST1; + default: + return new LogStreamEventBridgeSinkRegionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AP_EAST1, + + AP_NORTHEAST1, + + AP_NORTHEAST2, + + AP_NORTHEAST3, + + AP_SOUTH1, + + AP_SOUTHEAST1, + + AP_SOUTHEAST2, + + CA_CENTRAL1, + + EU_CENTRAL1, + + EU_NORTH1, + + EU_WEST1, + + EU_WEST2, + + EU_WEST3, + + ME_SOUTH1, + + SA_EAST1, + + US_GOV_EAST1, + + US_GOV_WEST1, + + US_EAST1, + + US_EAST2, + + US_WEST1, + + US_WEST2, + + UNKNOWN + } + + public interface Visitor { + T visitApEast1(); + + T visitApNortheast1(); + + T visitApNortheast2(); + + T visitApNortheast3(); + + T visitApSouth1(); + + T visitApSoutheast1(); + + T visitApSoutheast2(); + + T visitCaCentral1(); + + T visitEuCentral1(); + + T visitEuNorth1(); + + T visitEuWest1(); + + T visitEuWest2(); + + T visitEuWest3(); + + T visitMeSouth1(); + + T visitSaEast1(); + + T visitUsGovEast1(); + + T visitUsGovWest1(); + + T visitUsEast1(); + + T visitUsEast2(); + + T visitUsWest1(); + + T visitUsWest2(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java new file mode 100644 index 000000000..daae8ad22 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamEventGridRegionEnum { + public static final LogStreamEventGridRegionEnum GERMANYWESTCENTRAL = + new LogStreamEventGridRegionEnum(Value.GERMANYWESTCENTRAL, "germanywestcentral"); + + public static final LogStreamEventGridRegionEnum WESTINDIA = + new LogStreamEventGridRegionEnum(Value.WESTINDIA, "westindia"); + + public static final LogStreamEventGridRegionEnum SOUTHCENTRALUS = + new LogStreamEventGridRegionEnum(Value.SOUTHCENTRALUS, "southcentralus"); + + public static final LogStreamEventGridRegionEnum JAPANEAST = + new LogStreamEventGridRegionEnum(Value.JAPANEAST, "japaneast"); + + public static final LogStreamEventGridRegionEnum KOREACENTRAL = + new LogStreamEventGridRegionEnum(Value.KOREACENTRAL, "koreacentral"); + + public static final LogStreamEventGridRegionEnum AUSTRALIASOUTHEAST = + new LogStreamEventGridRegionEnum(Value.AUSTRALIASOUTHEAST, "australiasoutheast"); + + public static final LogStreamEventGridRegionEnum SOUTHAFRICANORTH = + new LogStreamEventGridRegionEnum(Value.SOUTHAFRICANORTH, "southafricanorth"); + + public static final LogStreamEventGridRegionEnum CANADACENTRAL = + new LogStreamEventGridRegionEnum(Value.CANADACENTRAL, "canadacentral"); + + public static final LogStreamEventGridRegionEnum CANADAEAST = + new LogStreamEventGridRegionEnum(Value.CANADAEAST, "canadaeast"); + + public static final LogStreamEventGridRegionEnum SOUTHINDIA = + new LogStreamEventGridRegionEnum(Value.SOUTHINDIA, "southindia"); + + public static final LogStreamEventGridRegionEnum KOREASOUTH = + new LogStreamEventGridRegionEnum(Value.KOREASOUTH, "koreasouth"); + + public static final LogStreamEventGridRegionEnum BRAZILSOUTH = + new LogStreamEventGridRegionEnum(Value.BRAZILSOUTH, "brazilsouth"); + + public static final LogStreamEventGridRegionEnum CENTRALINDIA = + new LogStreamEventGridRegionEnum(Value.CENTRALINDIA, "centralindia"); + + public static final LogStreamEventGridRegionEnum EASTUS2 = + new LogStreamEventGridRegionEnum(Value.EASTUS2, "eastus2"); + + public static final LogStreamEventGridRegionEnum SOUTHEASTASIA = + new LogStreamEventGridRegionEnum(Value.SOUTHEASTASIA, "southeastasia"); + + public static final LogStreamEventGridRegionEnum AUSTRALIAEAST = + new LogStreamEventGridRegionEnum(Value.AUSTRALIAEAST, "australiaeast"); + + public static final LogStreamEventGridRegionEnum EASTUS = new LogStreamEventGridRegionEnum(Value.EASTUS, "eastus"); + + public static final LogStreamEventGridRegionEnum FRANCECENTRAL = + new LogStreamEventGridRegionEnum(Value.FRANCECENTRAL, "francecentral"); + + public static final LogStreamEventGridRegionEnum SWITZERLANDNORTH = + new LogStreamEventGridRegionEnum(Value.SWITZERLANDNORTH, "switzerlandnorth"); + + public static final LogStreamEventGridRegionEnum UAENORTH = + new LogStreamEventGridRegionEnum(Value.UAENORTH, "uaenorth"); + + public static final LogStreamEventGridRegionEnum NORTHEUROPE = + new LogStreamEventGridRegionEnum(Value.NORTHEUROPE, "northeurope"); + + public static final LogStreamEventGridRegionEnum NORTHCENTRALUS = + new LogStreamEventGridRegionEnum(Value.NORTHCENTRALUS, "northcentralus"); + + public static final LogStreamEventGridRegionEnum UKWEST = new LogStreamEventGridRegionEnum(Value.UKWEST, "ukwest"); + + public static final LogStreamEventGridRegionEnum NORWAYEAST = + new LogStreamEventGridRegionEnum(Value.NORWAYEAST, "norwayeast"); + + public static final LogStreamEventGridRegionEnum WESTUS = new LogStreamEventGridRegionEnum(Value.WESTUS, "westus"); + + public static final LogStreamEventGridRegionEnum WESTCENTRALUS = + new LogStreamEventGridRegionEnum(Value.WESTCENTRALUS, "westcentralus"); + + public static final LogStreamEventGridRegionEnum EASTASIA = + new LogStreamEventGridRegionEnum(Value.EASTASIA, "eastasia"); + + public static final LogStreamEventGridRegionEnum AUSTRALIACENTRAL = + new LogStreamEventGridRegionEnum(Value.AUSTRALIACENTRAL, "australiacentral"); + + public static final LogStreamEventGridRegionEnum SWEDENCENTRAL = + new LogStreamEventGridRegionEnum(Value.SWEDENCENTRAL, "swedencentral"); + + public static final LogStreamEventGridRegionEnum CENTRALUS = + new LogStreamEventGridRegionEnum(Value.CENTRALUS, "centralus"); + + public static final LogStreamEventGridRegionEnum WESTEUROPE = + new LogStreamEventGridRegionEnum(Value.WESTEUROPE, "westeurope"); + + public static final LogStreamEventGridRegionEnum JAPANWEST = + new LogStreamEventGridRegionEnum(Value.JAPANWEST, "japanwest"); + + public static final LogStreamEventGridRegionEnum WESTUS2 = + new LogStreamEventGridRegionEnum(Value.WESTUS2, "westus2"); + + public static final LogStreamEventGridRegionEnum UKSOUTH = + new LogStreamEventGridRegionEnum(Value.UKSOUTH, "uksouth"); + + private final Value value; + + private final String string; + + LogStreamEventGridRegionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamEventGridRegionEnum + && this.string.equals(((LogStreamEventGridRegionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GERMANYWESTCENTRAL: + return visitor.visitGermanywestcentral(); + case WESTINDIA: + return visitor.visitWestindia(); + case SOUTHCENTRALUS: + return visitor.visitSouthcentralus(); + case JAPANEAST: + return visitor.visitJapaneast(); + case KOREACENTRAL: + return visitor.visitKoreacentral(); + case AUSTRALIASOUTHEAST: + return visitor.visitAustraliasoutheast(); + case SOUTHAFRICANORTH: + return visitor.visitSouthafricanorth(); + case CANADACENTRAL: + return visitor.visitCanadacentral(); + case CANADAEAST: + return visitor.visitCanadaeast(); + case SOUTHINDIA: + return visitor.visitSouthindia(); + case KOREASOUTH: + return visitor.visitKoreasouth(); + case BRAZILSOUTH: + return visitor.visitBrazilsouth(); + case CENTRALINDIA: + return visitor.visitCentralindia(); + case EASTUS2: + return visitor.visitEastus2(); + case SOUTHEASTASIA: + return visitor.visitSoutheastasia(); + case AUSTRALIAEAST: + return visitor.visitAustraliaeast(); + case EASTUS: + return visitor.visitEastus(); + case FRANCECENTRAL: + return visitor.visitFrancecentral(); + case SWITZERLANDNORTH: + return visitor.visitSwitzerlandnorth(); + case UAENORTH: + return visitor.visitUaenorth(); + case NORTHEUROPE: + return visitor.visitNortheurope(); + case NORTHCENTRALUS: + return visitor.visitNorthcentralus(); + case UKWEST: + return visitor.visitUkwest(); + case NORWAYEAST: + return visitor.visitNorwayeast(); + case WESTUS: + return visitor.visitWestus(); + case WESTCENTRALUS: + return visitor.visitWestcentralus(); + case EASTASIA: + return visitor.visitEastasia(); + case AUSTRALIACENTRAL: + return visitor.visitAustraliacentral(); + case SWEDENCENTRAL: + return visitor.visitSwedencentral(); + case CENTRALUS: + return visitor.visitCentralus(); + case WESTEUROPE: + return visitor.visitWesteurope(); + case JAPANWEST: + return visitor.visitJapanwest(); + case WESTUS2: + return visitor.visitWestus2(); + case UKSOUTH: + return visitor.visitUksouth(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamEventGridRegionEnum valueOf(String value) { + switch (value) { + case "germanywestcentral": + return GERMANYWESTCENTRAL; + case "westindia": + return WESTINDIA; + case "southcentralus": + return SOUTHCENTRALUS; + case "japaneast": + return JAPANEAST; + case "koreacentral": + return KOREACENTRAL; + case "australiasoutheast": + return AUSTRALIASOUTHEAST; + case "southafricanorth": + return SOUTHAFRICANORTH; + case "canadacentral": + return CANADACENTRAL; + case "canadaeast": + return CANADAEAST; + case "southindia": + return SOUTHINDIA; + case "koreasouth": + return KOREASOUTH; + case "brazilsouth": + return BRAZILSOUTH; + case "centralindia": + return CENTRALINDIA; + case "eastus2": + return EASTUS2; + case "southeastasia": + return SOUTHEASTASIA; + case "australiaeast": + return AUSTRALIAEAST; + case "eastus": + return EASTUS; + case "francecentral": + return FRANCECENTRAL; + case "switzerlandnorth": + return SWITZERLANDNORTH; + case "uaenorth": + return UAENORTH; + case "northeurope": + return NORTHEUROPE; + case "northcentralus": + return NORTHCENTRALUS; + case "ukwest": + return UKWEST; + case "norwayeast": + return NORWAYEAST; + case "westus": + return WESTUS; + case "westcentralus": + return WESTCENTRALUS; + case "eastasia": + return EASTASIA; + case "australiacentral": + return AUSTRALIACENTRAL; + case "swedencentral": + return SWEDENCENTRAL; + case "centralus": + return CENTRALUS; + case "westeurope": + return WESTEUROPE; + case "japanwest": + return JAPANWEST; + case "westus2": + return WESTUS2; + case "uksouth": + return UKSOUTH; + default: + return new LogStreamEventGridRegionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUSTRALIACENTRAL, + + AUSTRALIAEAST, + + AUSTRALIASOUTHEAST, + + BRAZILSOUTH, + + CANADACENTRAL, + + CANADAEAST, + + CENTRALINDIA, + + CENTRALUS, + + EASTASIA, + + EASTUS, + + EASTUS2, + + FRANCECENTRAL, + + GERMANYWESTCENTRAL, + + JAPANEAST, + + JAPANWEST, + + KOREACENTRAL, + + KOREASOUTH, + + NORTHCENTRALUS, + + NORTHEUROPE, + + NORWAYEAST, + + SOUTHAFRICANORTH, + + SOUTHCENTRALUS, + + SOUTHEASTASIA, + + SOUTHINDIA, + + SWEDENCENTRAL, + + SWITZERLANDNORTH, + + UAENORTH, + + UKSOUTH, + + UKWEST, + + WESTCENTRALUS, + + WESTEUROPE, + + WESTINDIA, + + WESTUS, + + WESTUS2, + + UNKNOWN + } + + public interface Visitor { + T visitAustraliacentral(); + + T visitAustraliaeast(); + + T visitAustraliasoutheast(); + + T visitBrazilsouth(); + + T visitCanadacentral(); + + T visitCanadaeast(); + + T visitCentralindia(); + + T visitCentralus(); + + T visitEastasia(); + + T visitEastus(); + + T visitEastus2(); + + T visitFrancecentral(); + + T visitGermanywestcentral(); + + T visitJapaneast(); + + T visitJapanwest(); + + T visitKoreacentral(); + + T visitKoreasouth(); + + T visitNorthcentralus(); + + T visitNortheurope(); + + T visitNorwayeast(); + + T visitSouthafricanorth(); + + T visitSouthcentralus(); + + T visitSoutheastasia(); + + T visitSouthindia(); + + T visitSwedencentral(); + + T visitSwitzerlandnorth(); + + T visitUaenorth(); + + T visitUksouth(); + + T visitUkwest(); + + T visitWestcentralus(); + + T visitWesteurope(); + + T visitWestindia(); + + T visitWestus(); + + T visitWestus2(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java new file mode 100644 index 000000000..88fbbb0ea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamEventGridResponseSchema.Builder.class) +public final class LogStreamEventGridResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamEventGridResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamEventGridResponseSchema && equalTo((LogStreamEventGridResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamEventGridResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamEventGridResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamEventGridSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamEventGridResponseSchema build() { + return new LogStreamEventGridResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java new file mode 100644 index 000000000..f15163dd5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java @@ -0,0 +1,223 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamEventGridSink.Builder.class) +public final class LogStreamEventGridSink { + private final String azureSubscriptionId; + + private final LogStreamEventGridRegionEnum azureRegion; + + private final String azureResourceGroup; + + private final Optional azurePartnerTopic; + + private final Map additionalProperties; + + private LogStreamEventGridSink( + String azureSubscriptionId, + LogStreamEventGridRegionEnum azureRegion, + String azureResourceGroup, + Optional azurePartnerTopic, + Map additionalProperties) { + this.azureSubscriptionId = azureSubscriptionId; + this.azureRegion = azureRegion; + this.azureResourceGroup = azureResourceGroup; + this.azurePartnerTopic = azurePartnerTopic; + this.additionalProperties = additionalProperties; + } + + /** + * @return Subscription ID + */ + @JsonProperty("azureSubscriptionId") + public String getAzureSubscriptionId() { + return azureSubscriptionId; + } + + @JsonProperty("azureRegion") + public LogStreamEventGridRegionEnum getAzureRegion() { + return azureRegion; + } + + /** + * @return Resource Group + */ + @JsonProperty("azureResourceGroup") + public String getAzureResourceGroup() { + return azureResourceGroup; + } + + /** + * @return Partner Topic + */ + @JsonProperty("azurePartnerTopic") + public Optional getAzurePartnerTopic() { + return azurePartnerTopic; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamEventGridSink && equalTo((LogStreamEventGridSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamEventGridSink other) { + return azureSubscriptionId.equals(other.azureSubscriptionId) + && azureRegion.equals(other.azureRegion) + && azureResourceGroup.equals(other.azureResourceGroup) + && azurePartnerTopic.equals(other.azurePartnerTopic); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.azureSubscriptionId, this.azureRegion, this.azureResourceGroup, this.azurePartnerTopic); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AzureSubscriptionIdStage builder() { + return new Builder(); + } + + public interface AzureSubscriptionIdStage { + /** + *

Subscription ID

+ */ + AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId); + + Builder from(LogStreamEventGridSink other); + } + + public interface AzureRegionStage { + AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum azureRegion); + } + + public interface AzureResourceGroupStage { + /** + *

Resource Group

+ */ + _FinalStage azureResourceGroup(@NotNull String azureResourceGroup); + } + + public interface _FinalStage { + LogStreamEventGridSink build(); + + /** + *

Partner Topic

+ */ + _FinalStage azurePartnerTopic(Optional azurePartnerTopic); + + _FinalStage azurePartnerTopic(String azurePartnerTopic); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AzureSubscriptionIdStage, AzureRegionStage, AzureResourceGroupStage, _FinalStage { + private String azureSubscriptionId; + + private LogStreamEventGridRegionEnum azureRegion; + + private String azureResourceGroup; + + private Optional azurePartnerTopic = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamEventGridSink other) { + azureSubscriptionId(other.getAzureSubscriptionId()); + azureRegion(other.getAzureRegion()); + azureResourceGroup(other.getAzureResourceGroup()); + azurePartnerTopic(other.getAzurePartnerTopic()); + return this; + } + + /** + *

Subscription ID

+ *

Subscription ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("azureSubscriptionId") + public AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId) { + this.azureSubscriptionId = + Objects.requireNonNull(azureSubscriptionId, "azureSubscriptionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("azureRegion") + public AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum azureRegion) { + this.azureRegion = Objects.requireNonNull(azureRegion, "azureRegion must not be null"); + return this; + } + + /** + *

Resource Group

+ *

Resource Group

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("azureResourceGroup") + public _FinalStage azureResourceGroup(@NotNull String azureResourceGroup) { + this.azureResourceGroup = Objects.requireNonNull(azureResourceGroup, "azureResourceGroup must not be null"); + return this; + } + + /** + *

Partner Topic

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage azurePartnerTopic(String azurePartnerTopic) { + this.azurePartnerTopic = Optional.ofNullable(azurePartnerTopic); + return this; + } + + /** + *

Partner Topic

+ */ + @java.lang.Override + @JsonSetter(value = "azurePartnerTopic", nulls = Nulls.SKIP) + public _FinalStage azurePartnerTopic(Optional azurePartnerTopic) { + this.azurePartnerTopic = azurePartnerTopic; + return this; + } + + @java.lang.Override + public LogStreamEventGridSink build() { + return new LogStreamEventGridSink( + azureSubscriptionId, azureRegion, azureResourceGroup, azurePartnerTopic, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java new file mode 100644 index 000000000..12f7c4c6d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamFilter.Builder.class) +public final class LogStreamFilter { + private final Optional type; + + private final Optional name; + + private final Map additionalProperties; + + private LogStreamFilter( + Optional type, + Optional name, + Map additionalProperties) { + this.type = type; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamFilter && equalTo((LogStreamFilter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamFilter other) { + return type.equals(other.type) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamFilter other) { + type(other.getType()); + name(other.getName()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(LogStreamFilterGroupNameEnum name) { + this.name = Optional.ofNullable(name); + return this; + } + + public LogStreamFilter build() { + return new LogStreamFilter(type, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java new file mode 100644 index 000000000..5690aa6ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamFilterGroupNameEnum { + public static final LogStreamFilterGroupNameEnum AUTH_LOGIN_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.AUTH_LOGIN_SUCCESS, "auth.login.success"); + + public static final LogStreamFilterGroupNameEnum AUTH_LOGOUT_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.AUTH_LOGOUT_SUCCESS, "auth.logout.success"); + + public static final LogStreamFilterGroupNameEnum AUTH_TOKEN_EXCHANGE_FAIL = + new LogStreamFilterGroupNameEnum(Value.AUTH_TOKEN_EXCHANGE_FAIL, "auth.token_exchange.fail"); + + public static final LogStreamFilterGroupNameEnum SYSTEM_NOTIFICATION = + new LogStreamFilterGroupNameEnum(Value.SYSTEM_NOTIFICATION, "system.notification"); + + public static final LogStreamFilterGroupNameEnum ACTIONS = + new LogStreamFilterGroupNameEnum(Value.ACTIONS, "actions"); + + public static final LogStreamFilterGroupNameEnum AUTH_SILENT_AUTH_FAIL = + new LogStreamFilterGroupNameEnum(Value.AUTH_SILENT_AUTH_FAIL, "auth.silent_auth.fail"); + + public static final LogStreamFilterGroupNameEnum MANAGEMENT_FAIL = + new LogStreamFilterGroupNameEnum(Value.MANAGEMENT_FAIL, "management.fail"); + + public static final LogStreamFilterGroupNameEnum AUTH_TOKEN_EXCHANGE_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.AUTH_TOKEN_EXCHANGE_SUCCESS, "auth.token_exchange.success"); + + public static final LogStreamFilterGroupNameEnum USER_NOTIFICATION = + new LogStreamFilterGroupNameEnum(Value.USER_NOTIFICATION, "user.notification"); + + public static final LogStreamFilterGroupNameEnum AUTH_SILENT_AUTH_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.AUTH_SILENT_AUTH_SUCCESS, "auth.silent_auth.success"); + + public static final LogStreamFilterGroupNameEnum AUTH_LOGOUT_FAIL = + new LogStreamFilterGroupNameEnum(Value.AUTH_LOGOUT_FAIL, "auth.logout.fail"); + + public static final LogStreamFilterGroupNameEnum MANAGEMENT_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.MANAGEMENT_SUCCESS, "management.success"); + + public static final LogStreamFilterGroupNameEnum OTHER = new LogStreamFilterGroupNameEnum(Value.OTHER, "other"); + + public static final LogStreamFilterGroupNameEnum AUTH_SIGNUP_FAIL = + new LogStreamFilterGroupNameEnum(Value.AUTH_SIGNUP_FAIL, "auth.signup.fail"); + + public static final LogStreamFilterGroupNameEnum AUTH_SIGNUP_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.AUTH_SIGNUP_SUCCESS, "auth.signup.success"); + + public static final LogStreamFilterGroupNameEnum SCIM_EVENT = + new LogStreamFilterGroupNameEnum(Value.SCIM_EVENT, "scim.event"); + + public static final LogStreamFilterGroupNameEnum AUTH_LOGIN_FAIL = + new LogStreamFilterGroupNameEnum(Value.AUTH_LOGIN_FAIL, "auth.login.fail"); + + public static final LogStreamFilterGroupNameEnum AUTH_LOGIN_NOTIFICATION = + new LogStreamFilterGroupNameEnum(Value.AUTH_LOGIN_NOTIFICATION, "auth.login.notification"); + + public static final LogStreamFilterGroupNameEnum USER_FAIL = + new LogStreamFilterGroupNameEnum(Value.USER_FAIL, "user.fail"); + + public static final LogStreamFilterGroupNameEnum USER_SUCCESS = + new LogStreamFilterGroupNameEnum(Value.USER_SUCCESS, "user.success"); + + private final Value value; + + private final String string; + + LogStreamFilterGroupNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamFilterGroupNameEnum + && this.string.equals(((LogStreamFilterGroupNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTH_LOGIN_SUCCESS: + return visitor.visitAuthLoginSuccess(); + case AUTH_LOGOUT_SUCCESS: + return visitor.visitAuthLogoutSuccess(); + case AUTH_TOKEN_EXCHANGE_FAIL: + return visitor.visitAuthTokenExchangeFail(); + case SYSTEM_NOTIFICATION: + return visitor.visitSystemNotification(); + case ACTIONS: + return visitor.visitActions(); + case AUTH_SILENT_AUTH_FAIL: + return visitor.visitAuthSilentAuthFail(); + case MANAGEMENT_FAIL: + return visitor.visitManagementFail(); + case AUTH_TOKEN_EXCHANGE_SUCCESS: + return visitor.visitAuthTokenExchangeSuccess(); + case USER_NOTIFICATION: + return visitor.visitUserNotification(); + case AUTH_SILENT_AUTH_SUCCESS: + return visitor.visitAuthSilentAuthSuccess(); + case AUTH_LOGOUT_FAIL: + return visitor.visitAuthLogoutFail(); + case MANAGEMENT_SUCCESS: + return visitor.visitManagementSuccess(); + case OTHER: + return visitor.visitOther(); + case AUTH_SIGNUP_FAIL: + return visitor.visitAuthSignupFail(); + case AUTH_SIGNUP_SUCCESS: + return visitor.visitAuthSignupSuccess(); + case SCIM_EVENT: + return visitor.visitScimEvent(); + case AUTH_LOGIN_FAIL: + return visitor.visitAuthLoginFail(); + case AUTH_LOGIN_NOTIFICATION: + return visitor.visitAuthLoginNotification(); + case USER_FAIL: + return visitor.visitUserFail(); + case USER_SUCCESS: + return visitor.visitUserSuccess(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamFilterGroupNameEnum valueOf(String value) { + switch (value) { + case "auth.login.success": + return AUTH_LOGIN_SUCCESS; + case "auth.logout.success": + return AUTH_LOGOUT_SUCCESS; + case "auth.token_exchange.fail": + return AUTH_TOKEN_EXCHANGE_FAIL; + case "system.notification": + return SYSTEM_NOTIFICATION; + case "actions": + return ACTIONS; + case "auth.silent_auth.fail": + return AUTH_SILENT_AUTH_FAIL; + case "management.fail": + return MANAGEMENT_FAIL; + case "auth.token_exchange.success": + return AUTH_TOKEN_EXCHANGE_SUCCESS; + case "user.notification": + return USER_NOTIFICATION; + case "auth.silent_auth.success": + return AUTH_SILENT_AUTH_SUCCESS; + case "auth.logout.fail": + return AUTH_LOGOUT_FAIL; + case "management.success": + return MANAGEMENT_SUCCESS; + case "other": + return OTHER; + case "auth.signup.fail": + return AUTH_SIGNUP_FAIL; + case "auth.signup.success": + return AUTH_SIGNUP_SUCCESS; + case "scim.event": + return SCIM_EVENT; + case "auth.login.fail": + return AUTH_LOGIN_FAIL; + case "auth.login.notification": + return AUTH_LOGIN_NOTIFICATION; + case "user.fail": + return USER_FAIL; + case "user.success": + return USER_SUCCESS; + default: + return new LogStreamFilterGroupNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTH_LOGIN_FAIL, + + AUTH_LOGIN_NOTIFICATION, + + AUTH_LOGIN_SUCCESS, + + AUTH_LOGOUT_FAIL, + + AUTH_LOGOUT_SUCCESS, + + AUTH_SIGNUP_FAIL, + + AUTH_SIGNUP_SUCCESS, + + AUTH_SILENT_AUTH_FAIL, + + AUTH_SILENT_AUTH_SUCCESS, + + AUTH_TOKEN_EXCHANGE_FAIL, + + AUTH_TOKEN_EXCHANGE_SUCCESS, + + MANAGEMENT_FAIL, + + MANAGEMENT_SUCCESS, + + SCIM_EVENT, + + SYSTEM_NOTIFICATION, + + USER_FAIL, + + USER_NOTIFICATION, + + USER_SUCCESS, + + ACTIONS, + + OTHER, + + UNKNOWN + } + + public interface Visitor { + T visitAuthLoginFail(); + + T visitAuthLoginNotification(); + + T visitAuthLoginSuccess(); + + T visitAuthLogoutFail(); + + T visitAuthLogoutSuccess(); + + T visitAuthSignupFail(); + + T visitAuthSignupSuccess(); + + T visitAuthSilentAuthFail(); + + T visitAuthSilentAuthSuccess(); + + T visitAuthTokenExchangeFail(); + + T visitAuthTokenExchangeSuccess(); + + T visitManagementFail(); + + T visitManagementSuccess(); + + T visitScimEvent(); + + T visitSystemNotification(); + + T visitUserFail(); + + T visitUserNotification(); + + T visitUserSuccess(); + + T visitActions(); + + T visitOther(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java new file mode 100644 index 000000000..ff2a585bb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamHttpContentFormatEnum { + public static final LogStreamHttpContentFormatEnum JSONOBJECT = + new LogStreamHttpContentFormatEnum(Value.JSONOBJECT, "JSONOBJECT"); + + public static final LogStreamHttpContentFormatEnum JSONARRAY = + new LogStreamHttpContentFormatEnum(Value.JSONARRAY, "JSONARRAY"); + + public static final LogStreamHttpContentFormatEnum JSONLINES = + new LogStreamHttpContentFormatEnum(Value.JSONLINES, "JSONLINES"); + + private final Value value; + + private final String string; + + LogStreamHttpContentFormatEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamHttpContentFormatEnum + && this.string.equals(((LogStreamHttpContentFormatEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case JSONOBJECT: + return visitor.visitJsonobject(); + case JSONARRAY: + return visitor.visitJsonarray(); + case JSONLINES: + return visitor.visitJsonlines(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamHttpContentFormatEnum valueOf(String value) { + switch (value) { + case "JSONOBJECT": + return JSONOBJECT; + case "JSONARRAY": + return JSONARRAY; + case "JSONLINES": + return JSONLINES; + default: + return new LogStreamHttpContentFormatEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSONARRAY, + + JSONLINES, + + JSONOBJECT, + + UNKNOWN + } + + public interface Visitor { + T visitJsonarray(); + + T visitJsonlines(); + + T visitJsonobject(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java new file mode 100644 index 000000000..09f1163f7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamHttpResponseSchema.Builder.class) +public final class LogStreamHttpResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamHttpResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamHttpResponseSchema && equalTo((LogStreamHttpResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamHttpResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamHttpResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamHttpSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamHttpResponseSchema build() { + return new LogStreamHttpResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java new file mode 100644 index 000000000..73ec671fe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java @@ -0,0 +1,288 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamHttpSink.Builder.class) +public final class LogStreamHttpSink { + private final Optional httpAuthorization; + + private final Optional httpContentFormat; + + private final Optional httpContentType; + + private final String httpEndpoint; + + private final Optional> httpCustomHeaders; + + private final Map additionalProperties; + + private LogStreamHttpSink( + Optional httpAuthorization, + Optional httpContentFormat, + Optional httpContentType, + String httpEndpoint, + Optional> httpCustomHeaders, + Map additionalProperties) { + this.httpAuthorization = httpAuthorization; + this.httpContentFormat = httpContentFormat; + this.httpContentType = httpContentType; + this.httpEndpoint = httpEndpoint; + this.httpCustomHeaders = httpCustomHeaders; + this.additionalProperties = additionalProperties; + } + + /** + * @return HTTP Authorization header + */ + @JsonProperty("httpAuthorization") + public Optional getHttpAuthorization() { + return httpAuthorization; + } + + @JsonProperty("httpContentFormat") + public Optional getHttpContentFormat() { + return httpContentFormat; + } + + /** + * @return HTTP Content-Type header + */ + @JsonProperty("httpContentType") + public Optional getHttpContentType() { + return httpContentType; + } + + /** + * @return HTTP endpoint + */ + @JsonProperty("httpEndpoint") + public String getHttpEndpoint() { + return httpEndpoint; + } + + /** + * @return custom HTTP headers + */ + @JsonProperty("httpCustomHeaders") + public Optional> getHttpCustomHeaders() { + return httpCustomHeaders; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamHttpSink && equalTo((LogStreamHttpSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamHttpSink other) { + return httpAuthorization.equals(other.httpAuthorization) + && httpContentFormat.equals(other.httpContentFormat) + && httpContentType.equals(other.httpContentType) + && httpEndpoint.equals(other.httpEndpoint) + && httpCustomHeaders.equals(other.httpCustomHeaders); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.httpAuthorization, + this.httpContentFormat, + this.httpContentType, + this.httpEndpoint, + this.httpCustomHeaders); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HttpEndpointStage builder() { + return new Builder(); + } + + public interface HttpEndpointStage { + /** + *

HTTP endpoint

+ */ + _FinalStage httpEndpoint(@NotNull String httpEndpoint); + + Builder from(LogStreamHttpSink other); + } + + public interface _FinalStage { + LogStreamHttpSink build(); + + /** + *

HTTP Authorization header

+ */ + _FinalStage httpAuthorization(Optional httpAuthorization); + + _FinalStage httpAuthorization(String httpAuthorization); + + _FinalStage httpContentFormat(Optional httpContentFormat); + + _FinalStage httpContentFormat(LogStreamHttpContentFormatEnum httpContentFormat); + + /** + *

HTTP Content-Type header

+ */ + _FinalStage httpContentType(Optional httpContentType); + + _FinalStage httpContentType(String httpContentType); + + /** + *

custom HTTP headers

+ */ + _FinalStage httpCustomHeaders(Optional> httpCustomHeaders); + + _FinalStage httpCustomHeaders(List httpCustomHeaders); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HttpEndpointStage, _FinalStage { + private String httpEndpoint; + + private Optional> httpCustomHeaders = Optional.empty(); + + private Optional httpContentType = Optional.empty(); + + private Optional httpContentFormat = Optional.empty(); + + private Optional httpAuthorization = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamHttpSink other) { + httpAuthorization(other.getHttpAuthorization()); + httpContentFormat(other.getHttpContentFormat()); + httpContentType(other.getHttpContentType()); + httpEndpoint(other.getHttpEndpoint()); + httpCustomHeaders(other.getHttpCustomHeaders()); + return this; + } + + /** + *

HTTP endpoint

+ *

HTTP endpoint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("httpEndpoint") + public _FinalStage httpEndpoint(@NotNull String httpEndpoint) { + this.httpEndpoint = Objects.requireNonNull(httpEndpoint, "httpEndpoint must not be null"); + return this; + } + + /** + *

custom HTTP headers

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage httpCustomHeaders(List httpCustomHeaders) { + this.httpCustomHeaders = Optional.ofNullable(httpCustomHeaders); + return this; + } + + /** + *

custom HTTP headers

+ */ + @java.lang.Override + @JsonSetter(value = "httpCustomHeaders", nulls = Nulls.SKIP) + public _FinalStage httpCustomHeaders(Optional> httpCustomHeaders) { + this.httpCustomHeaders = httpCustomHeaders; + return this; + } + + /** + *

HTTP Content-Type header

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage httpContentType(String httpContentType) { + this.httpContentType = Optional.ofNullable(httpContentType); + return this; + } + + /** + *

HTTP Content-Type header

+ */ + @java.lang.Override + @JsonSetter(value = "httpContentType", nulls = Nulls.SKIP) + public _FinalStage httpContentType(Optional httpContentType) { + this.httpContentType = httpContentType; + return this; + } + + @java.lang.Override + public _FinalStage httpContentFormat(LogStreamHttpContentFormatEnum httpContentFormat) { + this.httpContentFormat = Optional.ofNullable(httpContentFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "httpContentFormat", nulls = Nulls.SKIP) + public _FinalStage httpContentFormat(Optional httpContentFormat) { + this.httpContentFormat = httpContentFormat; + return this; + } + + /** + *

HTTP Authorization header

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage httpAuthorization(String httpAuthorization) { + this.httpAuthorization = Optional.ofNullable(httpAuthorization); + return this; + } + + /** + *

HTTP Authorization header

+ */ + @java.lang.Override + @JsonSetter(value = "httpAuthorization", nulls = Nulls.SKIP) + public _FinalStage httpAuthorization(Optional httpAuthorization) { + this.httpAuthorization = httpAuthorization; + return this; + } + + @java.lang.Override + public LogStreamHttpSink build() { + return new LogStreamHttpSink( + httpAuthorization, + httpContentFormat, + httpContentType, + httpEndpoint, + httpCustomHeaders, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java new file mode 100644 index 000000000..ed11aaa74 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamMixpanelRegionEnum { + public static final LogStreamMixpanelRegionEnum US = new LogStreamMixpanelRegionEnum(Value.US, "us"); + + public static final LogStreamMixpanelRegionEnum EU = new LogStreamMixpanelRegionEnum(Value.EU, "eu"); + + private final Value value; + + private final String string; + + LogStreamMixpanelRegionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamMixpanelRegionEnum + && this.string.equals(((LogStreamMixpanelRegionEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case US: + return visitor.visitUs(); + case EU: + return visitor.visitEu(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamMixpanelRegionEnum valueOf(String value) { + switch (value) { + case "us": + return US; + case "eu": + return EU; + default: + return new LogStreamMixpanelRegionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + US, + + EU, + + UNKNOWN + } + + public interface Visitor { + T visitUs(); + + T visitEu(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java new file mode 100644 index 000000000..f45369b57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamMixpanelResponseSchema.Builder.class) +public final class LogStreamMixpanelResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamMixpanelResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamMixpanelResponseSchema && equalTo((LogStreamMixpanelResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamMixpanelResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamMixpanelResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamMixpanelSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamMixpanelResponseSchema build() { + return new LogStreamMixpanelResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java new file mode 100644 index 000000000..0ca307704 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamMixpanelSink.Builder.class) +public final class LogStreamMixpanelSink { + private final LogStreamMixpanelRegionEnum mixpanelRegion; + + private final String mixpanelProjectId; + + private final String mixpanelServiceAccountUsername; + + private final String mixpanelServiceAccountPassword; + + private final Map additionalProperties; + + private LogStreamMixpanelSink( + LogStreamMixpanelRegionEnum mixpanelRegion, + String mixpanelProjectId, + String mixpanelServiceAccountUsername, + String mixpanelServiceAccountPassword, + Map additionalProperties) { + this.mixpanelRegion = mixpanelRegion; + this.mixpanelProjectId = mixpanelProjectId; + this.mixpanelServiceAccountUsername = mixpanelServiceAccountUsername; + this.mixpanelServiceAccountPassword = mixpanelServiceAccountPassword; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mixpanelRegion") + public LogStreamMixpanelRegionEnum getMixpanelRegion() { + return mixpanelRegion; + } + + /** + * @return Mixpanel Project Id + */ + @JsonProperty("mixpanelProjectId") + public String getMixpanelProjectId() { + return mixpanelProjectId; + } + + /** + * @return Mixpanel Service Account Username + */ + @JsonProperty("mixpanelServiceAccountUsername") + public String getMixpanelServiceAccountUsername() { + return mixpanelServiceAccountUsername; + } + + /** + * @return Mixpanel Service Account Password + */ + @JsonProperty("mixpanelServiceAccountPassword") + public String getMixpanelServiceAccountPassword() { + return mixpanelServiceAccountPassword; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamMixpanelSink && equalTo((LogStreamMixpanelSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamMixpanelSink other) { + return mixpanelRegion.equals(other.mixpanelRegion) + && mixpanelProjectId.equals(other.mixpanelProjectId) + && mixpanelServiceAccountUsername.equals(other.mixpanelServiceAccountUsername) + && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.mixpanelRegion, + this.mixpanelProjectId, + this.mixpanelServiceAccountUsername, + this.mixpanelServiceAccountPassword); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MixpanelRegionStage builder() { + return new Builder(); + } + + public interface MixpanelRegionStage { + MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion); + + Builder from(LogStreamMixpanelSink other); + } + + public interface MixpanelProjectIdStage { + /** + *

Mixpanel Project Id

+ */ + MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId); + } + + public interface MixpanelServiceAccountUsernameStage { + /** + *

Mixpanel Service Account Username

+ */ + MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( + @NotNull String mixpanelServiceAccountUsername); + } + + public interface MixpanelServiceAccountPasswordStage { + /** + *

Mixpanel Service Account Password

+ */ + _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServiceAccountPassword); + } + + public interface _FinalStage { + LogStreamMixpanelSink build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements MixpanelRegionStage, + MixpanelProjectIdStage, + MixpanelServiceAccountUsernameStage, + MixpanelServiceAccountPasswordStage, + _FinalStage { + private LogStreamMixpanelRegionEnum mixpanelRegion; + + private String mixpanelProjectId; + + private String mixpanelServiceAccountUsername; + + private String mixpanelServiceAccountPassword; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamMixpanelSink other) { + mixpanelRegion(other.getMixpanelRegion()); + mixpanelProjectId(other.getMixpanelProjectId()); + mixpanelServiceAccountUsername(other.getMixpanelServiceAccountUsername()); + mixpanelServiceAccountPassword(other.getMixpanelServiceAccountPassword()); + return this; + } + + @java.lang.Override + @JsonSetter("mixpanelRegion") + public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { + this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); + return this; + } + + /** + *

Mixpanel Project Id

+ *

Mixpanel Project Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mixpanelProjectId") + public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { + this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); + return this; + } + + /** + *

Mixpanel Service Account Username

+ *

Mixpanel Service Account Username

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mixpanelServiceAccountUsername") + public MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( + @NotNull String mixpanelServiceAccountUsername) { + this.mixpanelServiceAccountUsername = Objects.requireNonNull( + mixpanelServiceAccountUsername, "mixpanelServiceAccountUsername must not be null"); + return this; + } + + /** + *

Mixpanel Service Account Password

+ *

Mixpanel Service Account Password

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mixpanelServiceAccountPassword") + public _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServiceAccountPassword) { + this.mixpanelServiceAccountPassword = Objects.requireNonNull( + mixpanelServiceAccountPassword, "mixpanelServiceAccountPassword must not be null"); + return this; + } + + @java.lang.Override + public LogStreamMixpanelSink build() { + return new LogStreamMixpanelSink( + mixpanelRegion, + mixpanelProjectId, + mixpanelServiceAccountUsername, + mixpanelServiceAccountPassword, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java new file mode 100644 index 000000000..c77a29061 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamMixpanelSinkPatch.Builder.class) +public final class LogStreamMixpanelSinkPatch { + private final LogStreamMixpanelRegionEnum mixpanelRegion; + + private final String mixpanelProjectId; + + private final String mixpanelServiceAccountUsername; + + private final Optional mixpanelServiceAccountPassword; + + private final Map additionalProperties; + + private LogStreamMixpanelSinkPatch( + LogStreamMixpanelRegionEnum mixpanelRegion, + String mixpanelProjectId, + String mixpanelServiceAccountUsername, + Optional mixpanelServiceAccountPassword, + Map additionalProperties) { + this.mixpanelRegion = mixpanelRegion; + this.mixpanelProjectId = mixpanelProjectId; + this.mixpanelServiceAccountUsername = mixpanelServiceAccountUsername; + this.mixpanelServiceAccountPassword = mixpanelServiceAccountPassword; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mixpanelRegion") + public LogStreamMixpanelRegionEnum getMixpanelRegion() { + return mixpanelRegion; + } + + /** + * @return Mixpanel Project Id + */ + @JsonProperty("mixpanelProjectId") + public String getMixpanelProjectId() { + return mixpanelProjectId; + } + + /** + * @return Mixpanel Service Account Username + */ + @JsonProperty("mixpanelServiceAccountUsername") + public String getMixpanelServiceAccountUsername() { + return mixpanelServiceAccountUsername; + } + + /** + * @return Mixpanel Service Account Password + */ + @JsonProperty("mixpanelServiceAccountPassword") + public Optional getMixpanelServiceAccountPassword() { + return mixpanelServiceAccountPassword; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamMixpanelSinkPatch && equalTo((LogStreamMixpanelSinkPatch) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamMixpanelSinkPatch other) { + return mixpanelRegion.equals(other.mixpanelRegion) + && mixpanelProjectId.equals(other.mixpanelProjectId) + && mixpanelServiceAccountUsername.equals(other.mixpanelServiceAccountUsername) + && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.mixpanelRegion, + this.mixpanelProjectId, + this.mixpanelServiceAccountUsername, + this.mixpanelServiceAccountPassword); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MixpanelRegionStage builder() { + return new Builder(); + } + + public interface MixpanelRegionStage { + MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion); + + Builder from(LogStreamMixpanelSinkPatch other); + } + + public interface MixpanelProjectIdStage { + /** + *

Mixpanel Project Id

+ */ + MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId); + } + + public interface MixpanelServiceAccountUsernameStage { + /** + *

Mixpanel Service Account Username

+ */ + _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServiceAccountUsername); + } + + public interface _FinalStage { + LogStreamMixpanelSinkPatch build(); + + /** + *

Mixpanel Service Account Password

+ */ + _FinalStage mixpanelServiceAccountPassword(Optional mixpanelServiceAccountPassword); + + _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountPassword); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements MixpanelRegionStage, MixpanelProjectIdStage, MixpanelServiceAccountUsernameStage, _FinalStage { + private LogStreamMixpanelRegionEnum mixpanelRegion; + + private String mixpanelProjectId; + + private String mixpanelServiceAccountUsername; + + private Optional mixpanelServiceAccountPassword = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamMixpanelSinkPatch other) { + mixpanelRegion(other.getMixpanelRegion()); + mixpanelProjectId(other.getMixpanelProjectId()); + mixpanelServiceAccountUsername(other.getMixpanelServiceAccountUsername()); + mixpanelServiceAccountPassword(other.getMixpanelServiceAccountPassword()); + return this; + } + + @java.lang.Override + @JsonSetter("mixpanelRegion") + public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { + this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); + return this; + } + + /** + *

Mixpanel Project Id

+ *

Mixpanel Project Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mixpanelProjectId") + public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { + this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); + return this; + } + + /** + *

Mixpanel Service Account Username

+ *

Mixpanel Service Account Username

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mixpanelServiceAccountUsername") + public _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServiceAccountUsername) { + this.mixpanelServiceAccountUsername = Objects.requireNonNull( + mixpanelServiceAccountUsername, "mixpanelServiceAccountUsername must not be null"); + return this; + } + + /** + *

Mixpanel Service Account Password

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountPassword) { + this.mixpanelServiceAccountPassword = Optional.ofNullable(mixpanelServiceAccountPassword); + return this; + } + + /** + *

Mixpanel Service Account Password

+ */ + @java.lang.Override + @JsonSetter(value = "mixpanelServiceAccountPassword", nulls = Nulls.SKIP) + public _FinalStage mixpanelServiceAccountPassword(Optional mixpanelServiceAccountPassword) { + this.mixpanelServiceAccountPassword = mixpanelServiceAccountPassword; + return this; + } + + @java.lang.Override + public LogStreamMixpanelSinkPatch build() { + return new LogStreamMixpanelSinkPatch( + mixpanelRegion, + mixpanelProjectId, + mixpanelServiceAccountUsername, + mixpanelServiceAccountPassword, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java new file mode 100644 index 000000000..3b71477db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamPiiConfig.Builder.class) +public final class LogStreamPiiConfig { + private final List logFields; + + private final Optional method; + + private final Optional algorithm; + + private final Map additionalProperties; + + private LogStreamPiiConfig( + List logFields, + Optional method, + Optional algorithm, + Map additionalProperties) { + this.logFields = logFields; + this.method = method; + this.algorithm = algorithm; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_fields") + public List getLogFields() { + return logFields; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("algorithm") + public Optional getAlgorithm() { + return algorithm; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamPiiConfig && equalTo((LogStreamPiiConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamPiiConfig other) { + return logFields.equals(other.logFields) && method.equals(other.method) && algorithm.equals(other.algorithm); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logFields, this.method, this.algorithm); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List logFields = new ArrayList<>(); + + private Optional method = Optional.empty(); + + private Optional algorithm = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamPiiConfig other) { + logFields(other.getLogFields()); + method(other.getMethod()); + algorithm(other.getAlgorithm()); + return this; + } + + @JsonSetter(value = "log_fields", nulls = Nulls.SKIP) + public Builder logFields(List logFields) { + this.logFields.clear(); + if (logFields != null) { + this.logFields.addAll(logFields); + } + return this; + } + + public Builder addLogFields(LogStreamPiiLogFieldsEnum logFields) { + this.logFields.add(logFields); + return this; + } + + public Builder addAllLogFields(List logFields) { + if (logFields != null) { + this.logFields.addAll(logFields); + } + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(LogStreamPiiMethodEnum method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) + public Builder algorithm(Optional algorithm) { + this.algorithm = algorithm; + return this; + } + + public Builder algorithm(String algorithm) { + this.algorithm = Optional.ofNullable(algorithm); + return this; + } + + public LogStreamPiiConfig build() { + return new LogStreamPiiConfig(logFields, method, algorithm, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java new file mode 100644 index 000000000..aa094af5b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamPiiLogFieldsEnum { + public static final LogStreamPiiLogFieldsEnum EMAIL = new LogStreamPiiLogFieldsEnum(Value.EMAIL, "email"); + + public static final LogStreamPiiLogFieldsEnum LAST_NAME = + new LogStreamPiiLogFieldsEnum(Value.LAST_NAME, "last_name"); + + public static final LogStreamPiiLogFieldsEnum PHONE = new LogStreamPiiLogFieldsEnum(Value.PHONE, "phone"); + + public static final LogStreamPiiLogFieldsEnum USERNAME = new LogStreamPiiLogFieldsEnum(Value.USERNAME, "username"); + + public static final LogStreamPiiLogFieldsEnum FIRST_NAME = + new LogStreamPiiLogFieldsEnum(Value.FIRST_NAME, "first_name"); + + public static final LogStreamPiiLogFieldsEnum ADDRESS = new LogStreamPiiLogFieldsEnum(Value.ADDRESS, "address"); + + private final Value value; + + private final String string; + + LogStreamPiiLogFieldsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamPiiLogFieldsEnum + && this.string.equals(((LogStreamPiiLogFieldsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case LAST_NAME: + return visitor.visitLastName(); + case PHONE: + return visitor.visitPhone(); + case USERNAME: + return visitor.visitUsername(); + case FIRST_NAME: + return visitor.visitFirstName(); + case ADDRESS: + return visitor.visitAddress(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamPiiLogFieldsEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "last_name": + return LAST_NAME; + case "phone": + return PHONE; + case "username": + return USERNAME; + case "first_name": + return FIRST_NAME; + case "address": + return ADDRESS; + default: + return new LogStreamPiiLogFieldsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + FIRST_NAME, + + LAST_NAME, + + USERNAME, + + EMAIL, + + PHONE, + + ADDRESS, + + UNKNOWN + } + + public interface Visitor { + T visitFirstName(); + + T visitLastName(); + + T visitUsername(); + + T visitEmail(); + + T visitPhone(); + + T visitAddress(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java new file mode 100644 index 000000000..d45d816df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamPiiMethodEnum { + public static final LogStreamPiiMethodEnum MASK = new LogStreamPiiMethodEnum(Value.MASK, "mask"); + + public static final LogStreamPiiMethodEnum HASH = new LogStreamPiiMethodEnum(Value.HASH, "hash"); + + private final Value value; + + private final String string; + + LogStreamPiiMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamPiiMethodEnum + && this.string.equals(((LogStreamPiiMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MASK: + return visitor.visitMask(); + case HASH: + return visitor.visitHash(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamPiiMethodEnum valueOf(String value) { + switch (value) { + case "mask": + return MASK; + case "hash": + return HASH; + default: + return new LogStreamPiiMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + MASK, + + HASH, + + UNKNOWN + } + + public interface Visitor { + T visitMask(); + + T visitHash(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java new file mode 100644 index 000000000..0e7be12ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LogStreamResponseSchema.Deserializer.class) +public final class LogStreamResponseSchema { + private final Object value; + + private final int type; + + private LogStreamResponseSchema(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LogStreamHttpResponseSchema) this.value); + } else if (this.type == 1) { + return visitor.visit((LogStreamEventBridgeResponseSchema) this.value); + } else if (this.type == 2) { + return visitor.visit((LogStreamEventGridResponseSchema) this.value); + } else if (this.type == 3) { + return visitor.visit((LogStreamDatadogResponseSchema) this.value); + } else if (this.type == 4) { + return visitor.visit((LogStreamSplunkResponseSchema) this.value); + } else if (this.type == 5) { + return visitor.visit((LogStreamSumoResponseSchema) this.value); + } else if (this.type == 6) { + return visitor.visit((LogStreamSegmentResponseSchema) this.value); + } else if (this.type == 7) { + return visitor.visit((LogStreamMixpanelResponseSchema) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamResponseSchema && equalTo((LogStreamResponseSchema) other); + } + + private boolean equalTo(LogStreamResponseSchema other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static LogStreamResponseSchema of(LogStreamHttpResponseSchema value) { + return new LogStreamResponseSchema(value, 0); + } + + public static LogStreamResponseSchema of(LogStreamEventBridgeResponseSchema value) { + return new LogStreamResponseSchema(value, 1); + } + + public static LogStreamResponseSchema of(LogStreamEventGridResponseSchema value) { + return new LogStreamResponseSchema(value, 2); + } + + public static LogStreamResponseSchema of(LogStreamDatadogResponseSchema value) { + return new LogStreamResponseSchema(value, 3); + } + + public static LogStreamResponseSchema of(LogStreamSplunkResponseSchema value) { + return new LogStreamResponseSchema(value, 4); + } + + public static LogStreamResponseSchema of(LogStreamSumoResponseSchema value) { + return new LogStreamResponseSchema(value, 5); + } + + public static LogStreamResponseSchema of(LogStreamSegmentResponseSchema value) { + return new LogStreamResponseSchema(value, 6); + } + + public static LogStreamResponseSchema of(LogStreamMixpanelResponseSchema value) { + return new LogStreamResponseSchema(value, 7); + } + + public interface Visitor { + T visit(LogStreamHttpResponseSchema value); + + T visit(LogStreamEventBridgeResponseSchema value); + + T visit(LogStreamEventGridResponseSchema value); + + T visit(LogStreamDatadogResponseSchema value); + + T visit(LogStreamSplunkResponseSchema value); + + T visit(LogStreamSumoResponseSchema value); + + T visit(LogStreamSegmentResponseSchema value); + + T visit(LogStreamMixpanelResponseSchema value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LogStreamResponseSchema.class); + } + + @java.lang.Override + public LogStreamResponseSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamHttpResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventBridgeResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventGridResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamDatadogResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSplunkResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSumoResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSegmentResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamMixpanelResponseSchema.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java new file mode 100644 index 000000000..e0a1ec9aa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSegmentResponseSchema.Builder.class) +public final class LogStreamSegmentResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamSegmentResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSegmentResponseSchema && equalTo((LogStreamSegmentResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSegmentResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamSegmentResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamSegmentSinkWriteKey sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamSegmentResponseSchema build() { + return new LogStreamSegmentResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java new file mode 100644 index 000000000..26b9a8047 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSegmentSink.Builder.class) +public final class LogStreamSegmentSink { + private final Optional segmentWriteKey; + + private final Map additionalProperties; + + private LogStreamSegmentSink(Optional segmentWriteKey, Map additionalProperties) { + this.segmentWriteKey = segmentWriteKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Segment write key + */ + @JsonProperty("segmentWriteKey") + public Optional getSegmentWriteKey() { + return segmentWriteKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSegmentSink && equalTo((LogStreamSegmentSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSegmentSink other) { + return segmentWriteKey.equals(other.segmentWriteKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.segmentWriteKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional segmentWriteKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamSegmentSink other) { + segmentWriteKey(other.getSegmentWriteKey()); + return this; + } + + /** + *

Segment write key

+ */ + @JsonSetter(value = "segmentWriteKey", nulls = Nulls.SKIP) + public Builder segmentWriteKey(Optional segmentWriteKey) { + this.segmentWriteKey = segmentWriteKey; + return this; + } + + public Builder segmentWriteKey(String segmentWriteKey) { + this.segmentWriteKey = Optional.ofNullable(segmentWriteKey); + return this; + } + + public LogStreamSegmentSink build() { + return new LogStreamSegmentSink(segmentWriteKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java new file mode 100644 index 000000000..b349b869f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSegmentSinkWriteKey.Builder.class) +public final class LogStreamSegmentSinkWriteKey { + private final String segmentWriteKey; + + private final Map additionalProperties; + + private LogStreamSegmentSinkWriteKey(String segmentWriteKey, Map additionalProperties) { + this.segmentWriteKey = segmentWriteKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return Segment write key + */ + @JsonProperty("segmentWriteKey") + public String getSegmentWriteKey() { + return segmentWriteKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSegmentSinkWriteKey && equalTo((LogStreamSegmentSinkWriteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSegmentSinkWriteKey other) { + return segmentWriteKey.equals(other.segmentWriteKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.segmentWriteKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SegmentWriteKeyStage builder() { + return new Builder(); + } + + public interface SegmentWriteKeyStage { + /** + *

Segment write key

+ */ + _FinalStage segmentWriteKey(@NotNull String segmentWriteKey); + + Builder from(LogStreamSegmentSinkWriteKey other); + } + + public interface _FinalStage { + LogStreamSegmentSinkWriteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SegmentWriteKeyStage, _FinalStage { + private String segmentWriteKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamSegmentSinkWriteKey other) { + segmentWriteKey(other.getSegmentWriteKey()); + return this; + } + + /** + *

Segment write key

+ *

Segment write key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("segmentWriteKey") + public _FinalStage segmentWriteKey(@NotNull String segmentWriteKey) { + this.segmentWriteKey = Objects.requireNonNull(segmentWriteKey, "segmentWriteKey must not be null"); + return this; + } + + @java.lang.Override + public LogStreamSegmentSinkWriteKey build() { + return new LogStreamSegmentSinkWriteKey(segmentWriteKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java new file mode 100644 index 000000000..594e4516a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LogStreamSinkPatch.Deserializer.class) +public final class LogStreamSinkPatch { + private final Object value; + + private final int type; + + private LogStreamSinkPatch(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LogStreamHttpSink) this.value); + } else if (this.type == 1) { + return visitor.visit((LogStreamDatadogSink) this.value); + } else if (this.type == 2) { + return visitor.visit((LogStreamSplunkSink) this.value); + } else if (this.type == 3) { + return visitor.visit((LogStreamSumoSink) this.value); + } else if (this.type == 4) { + return visitor.visit((LogStreamSegmentSink) this.value); + } else if (this.type == 5) { + return visitor.visit((LogStreamMixpanelSinkPatch) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSinkPatch && equalTo((LogStreamSinkPatch) other); + } + + private boolean equalTo(LogStreamSinkPatch other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static LogStreamSinkPatch of(LogStreamHttpSink value) { + return new LogStreamSinkPatch(value, 0); + } + + public static LogStreamSinkPatch of(LogStreamDatadogSink value) { + return new LogStreamSinkPatch(value, 1); + } + + public static LogStreamSinkPatch of(LogStreamSplunkSink value) { + return new LogStreamSinkPatch(value, 2); + } + + public static LogStreamSinkPatch of(LogStreamSumoSink value) { + return new LogStreamSinkPatch(value, 3); + } + + public static LogStreamSinkPatch of(LogStreamSegmentSink value) { + return new LogStreamSinkPatch(value, 4); + } + + public static LogStreamSinkPatch of(LogStreamMixpanelSinkPatch value) { + return new LogStreamSinkPatch(value, 5); + } + + public interface Visitor { + T visit(LogStreamHttpSink value); + + T visit(LogStreamDatadogSink value); + + T visit(LogStreamSplunkSink value); + + T visit(LogStreamSumoSink value); + + T visit(LogStreamSegmentSink value); + + T visit(LogStreamMixpanelSinkPatch value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LogStreamSinkPatch.class); + } + + @java.lang.Override + public LogStreamSinkPatch deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamHttpSink.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamDatadogSink.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSplunkSink.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSumoSink.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSegmentSink.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamMixpanelSinkPatch.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java new file mode 100644 index 000000000..3d48b6453 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSplunkResponseSchema.Builder.class) +public final class LogStreamSplunkResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamSplunkResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSplunkResponseSchema && equalTo((LogStreamSplunkResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSplunkResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamSplunkResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamSplunkSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamSplunkResponseSchema build() { + return new LogStreamSplunkResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java new file mode 100644 index 000000000..46a046528 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSplunkSink.Builder.class) +public final class LogStreamSplunkSink { + private final String splunkDomain; + + private final String splunkPort; + + private final String splunkToken; + + private final boolean splunkSecure; + + private final Map additionalProperties; + + private LogStreamSplunkSink( + String splunkDomain, + String splunkPort, + String splunkToken, + boolean splunkSecure, + Map additionalProperties) { + this.splunkDomain = splunkDomain; + this.splunkPort = splunkPort; + this.splunkToken = splunkToken; + this.splunkSecure = splunkSecure; + this.additionalProperties = additionalProperties; + } + + /** + * @return Splunk URL Endpoint + */ + @JsonProperty("splunkDomain") + public String getSplunkDomain() { + return splunkDomain; + } + + /** + * @return Port + */ + @JsonProperty("splunkPort") + public String getSplunkPort() { + return splunkPort; + } + + /** + * @return Splunk token + */ + @JsonProperty("splunkToken") + public String getSplunkToken() { + return splunkToken; + } + + /** + * @return Verify TLS certificate + */ + @JsonProperty("splunkSecure") + public boolean getSplunkSecure() { + return splunkSecure; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSplunkSink && equalTo((LogStreamSplunkSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSplunkSink other) { + return splunkDomain.equals(other.splunkDomain) + && splunkPort.equals(other.splunkPort) + && splunkToken.equals(other.splunkToken) + && splunkSecure == other.splunkSecure; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.splunkDomain, this.splunkPort, this.splunkToken, this.splunkSecure); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SplunkDomainStage builder() { + return new Builder(); + } + + public interface SplunkDomainStage { + /** + *

Splunk URL Endpoint

+ */ + SplunkPortStage splunkDomain(@NotNull String splunkDomain); + + Builder from(LogStreamSplunkSink other); + } + + public interface SplunkPortStage { + /** + *

Port

+ */ + SplunkTokenStage splunkPort(@NotNull String splunkPort); + } + + public interface SplunkTokenStage { + /** + *

Splunk token

+ */ + SplunkSecureStage splunkToken(@NotNull String splunkToken); + } + + public interface SplunkSecureStage { + /** + *

Verify TLS certificate

+ */ + _FinalStage splunkSecure(boolean splunkSecure); + } + + public interface _FinalStage { + LogStreamSplunkSink build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements SplunkDomainStage, SplunkPortStage, SplunkTokenStage, SplunkSecureStage, _FinalStage { + private String splunkDomain; + + private String splunkPort; + + private String splunkToken; + + private boolean splunkSecure; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamSplunkSink other) { + splunkDomain(other.getSplunkDomain()); + splunkPort(other.getSplunkPort()); + splunkToken(other.getSplunkToken()); + splunkSecure(other.getSplunkSecure()); + return this; + } + + /** + *

Splunk URL Endpoint

+ *

Splunk URL Endpoint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("splunkDomain") + public SplunkPortStage splunkDomain(@NotNull String splunkDomain) { + this.splunkDomain = Objects.requireNonNull(splunkDomain, "splunkDomain must not be null"); + return this; + } + + /** + *

Port

+ *

Port

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("splunkPort") + public SplunkTokenStage splunkPort(@NotNull String splunkPort) { + this.splunkPort = Objects.requireNonNull(splunkPort, "splunkPort must not be null"); + return this; + } + + /** + *

Splunk token

+ *

Splunk token

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("splunkToken") + public SplunkSecureStage splunkToken(@NotNull String splunkToken) { + this.splunkToken = Objects.requireNonNull(splunkToken, "splunkToken must not be null"); + return this; + } + + /** + *

Verify TLS certificate

+ *

Verify TLS certificate

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("splunkSecure") + public _FinalStage splunkSecure(boolean splunkSecure) { + this.splunkSecure = splunkSecure; + return this; + } + + @java.lang.Override + public LogStreamSplunkSink build() { + return new LogStreamSplunkSink(splunkDomain, splunkPort, splunkToken, splunkSecure, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java new file mode 100644 index 000000000..4fb5fa90b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LogStreamStatusEnum { + public static final LogStreamStatusEnum PAUSED = new LogStreamStatusEnum(Value.PAUSED, "paused"); + + public static final LogStreamStatusEnum SUSPENDED = new LogStreamStatusEnum(Value.SUSPENDED, "suspended"); + + public static final LogStreamStatusEnum ACTIVE = new LogStreamStatusEnum(Value.ACTIVE, "active"); + + private final Value value; + + private final String string; + + LogStreamStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LogStreamStatusEnum && this.string.equals(((LogStreamStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PAUSED: + return visitor.visitPaused(); + case SUSPENDED: + return visitor.visitSuspended(); + case ACTIVE: + return visitor.visitActive(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LogStreamStatusEnum valueOf(String value) { + switch (value) { + case "paused": + return PAUSED; + case "suspended": + return SUSPENDED; + case "active": + return ACTIVE; + default: + return new LogStreamStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ACTIVE, + + PAUSED, + + SUSPENDED, + + UNKNOWN + } + + public interface Visitor { + T visitActive(); + + T visitPaused(); + + T visitSuspended(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java new file mode 100644 index 000000000..3bff6f16c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSumoResponseSchema.Builder.class) +public final class LogStreamSumoResponseSchema { + private final Optional id; + + private final Optional name; + + private final Optional status; + + private final Optional type; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private LogStreamSumoResponseSchema( + Optional id, + Optional name, + Optional status, + Optional type, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.id = id; + this.name = name; + this.status = status; + this.type = type; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the log stream + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSumoResponseSchema && equalTo((LogStreamSumoResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSumoResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && status.equals(other.status) + && type.equals(other.type) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LogStreamSumoResponseSchema other) { + id(other.getId()); + name(other.getName()); + status(other.getStatus()); + type(other.getType()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

The id of the log stream

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamSumoSink sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public LogStreamSumoResponseSchema build() { + return new LogStreamSumoResponseSchema( + id, name, status, type, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java new file mode 100644 index 000000000..5b26ddfea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LogStreamSumoSink.Builder.class) +public final class LogStreamSumoSink { + private final String sumoSourceAddress; + + private final Map additionalProperties; + + private LogStreamSumoSink(String sumoSourceAddress, Map additionalProperties) { + this.sumoSourceAddress = sumoSourceAddress; + this.additionalProperties = additionalProperties; + } + + /** + * @return HTTP Source Address + */ + @JsonProperty("sumoSourceAddress") + public String getSumoSourceAddress() { + return sumoSourceAddress; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LogStreamSumoSink && equalTo((LogStreamSumoSink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LogStreamSumoSink other) { + return sumoSourceAddress.equals(other.sumoSourceAddress); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sumoSourceAddress); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SumoSourceAddressStage builder() { + return new Builder(); + } + + public interface SumoSourceAddressStage { + /** + *

HTTP Source Address

+ */ + _FinalStage sumoSourceAddress(@NotNull String sumoSourceAddress); + + Builder from(LogStreamSumoSink other); + } + + public interface _FinalStage { + LogStreamSumoSink build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SumoSourceAddressStage, _FinalStage { + private String sumoSourceAddress; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LogStreamSumoSink other) { + sumoSourceAddress(other.getSumoSourceAddress()); + return this; + } + + /** + *

HTTP Source Address

+ *

HTTP Source Address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("sumoSourceAddress") + public _FinalStage sumoSourceAddress(@NotNull String sumoSourceAddress) { + this.sumoSourceAddress = Objects.requireNonNull(sumoSourceAddress, "sumoSourceAddress must not be null"); + return this; + } + + @java.lang.Override + public LogStreamSumoSink build() { + return new LogStreamSumoSink(sumoSourceAddress, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java new file mode 100644 index 000000000..db2e7af83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java @@ -0,0 +1,746 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MdlPresentationProperties.Builder.class) +public final class MdlPresentationProperties { + private final Optional familyName; + + private final Optional givenName; + + private final Optional birthDate; + + private final Optional issueDate; + + private final Optional expiryDate; + + private final Optional issuingCountry; + + private final Optional issuingAuthority; + + private final Optional portrait; + + private final Optional drivingPrivileges; + + private final Optional residentAddress; + + private final Optional portraitCaptureDate; + + private final Optional ageInYears; + + private final Optional ageBirthYear; + + private final Optional issuingJurisdiction; + + private final Optional nationality; + + private final Optional residentCity; + + private final Optional residentState; + + private final Optional residentPostalCode; + + private final Optional residentCountry; + + private final Optional familyNameNationalCharacter; + + private final Optional givenNameNationalCharacter; + + private final Map additionalProperties; + + private MdlPresentationProperties( + Optional familyName, + Optional givenName, + Optional birthDate, + Optional issueDate, + Optional expiryDate, + Optional issuingCountry, + Optional issuingAuthority, + Optional portrait, + Optional drivingPrivileges, + Optional residentAddress, + Optional portraitCaptureDate, + Optional ageInYears, + Optional ageBirthYear, + Optional issuingJurisdiction, + Optional nationality, + Optional residentCity, + Optional residentState, + Optional residentPostalCode, + Optional residentCountry, + Optional familyNameNationalCharacter, + Optional givenNameNationalCharacter, + Map additionalProperties) { + this.familyName = familyName; + this.givenName = givenName; + this.birthDate = birthDate; + this.issueDate = issueDate; + this.expiryDate = expiryDate; + this.issuingCountry = issuingCountry; + this.issuingAuthority = issuingAuthority; + this.portrait = portrait; + this.drivingPrivileges = drivingPrivileges; + this.residentAddress = residentAddress; + this.portraitCaptureDate = portraitCaptureDate; + this.ageInYears = ageInYears; + this.ageBirthYear = ageBirthYear; + this.issuingJurisdiction = issuingJurisdiction; + this.nationality = nationality; + this.residentCity = residentCity; + this.residentState = residentState; + this.residentPostalCode = residentPostalCode; + this.residentCountry = residentCountry; + this.familyNameNationalCharacter = familyNameNationalCharacter; + this.givenNameNationalCharacter = givenNameNationalCharacter; + this.additionalProperties = additionalProperties; + } + + /** + * @return Family Name + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + /** + * @return Given Name + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Birth Date + */ + @JsonProperty("birth_date") + public Optional getBirthDate() { + return birthDate; + } + + /** + * @return Issue Date + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return Expiry Date + */ + @JsonProperty("expiry_date") + public Optional getExpiryDate() { + return expiryDate; + } + + /** + * @return Issuing Country + */ + @JsonProperty("issuing_country") + public Optional getIssuingCountry() { + return issuingCountry; + } + + /** + * @return Issuing Authority + */ + @JsonProperty("issuing_authority") + public Optional getIssuingAuthority() { + return issuingAuthority; + } + + /** + * @return Portrait + */ + @JsonProperty("portrait") + public Optional getPortrait() { + return portrait; + } + + /** + * @return Driving Privileges + */ + @JsonProperty("driving_privileges") + public Optional getDrivingPrivileges() { + return drivingPrivileges; + } + + /** + * @return Resident Address + */ + @JsonProperty("resident_address") + public Optional getResidentAddress() { + return residentAddress; + } + + /** + * @return Portrait Capture Date + */ + @JsonProperty("portrait_capture_date") + public Optional getPortraitCaptureDate() { + return portraitCaptureDate; + } + + /** + * @return Age in Years + */ + @JsonProperty("age_in_years") + public Optional getAgeInYears() { + return ageInYears; + } + + /** + * @return Age Birth Year + */ + @JsonProperty("age_birth_year") + public Optional getAgeBirthYear() { + return ageBirthYear; + } + + /** + * @return Issuing Jurisdiction + */ + @JsonProperty("issuing_jurisdiction") + public Optional getIssuingJurisdiction() { + return issuingJurisdiction; + } + + /** + * @return Nationality + */ + @JsonProperty("nationality") + public Optional getNationality() { + return nationality; + } + + /** + * @return Resident City + */ + @JsonProperty("resident_city") + public Optional getResidentCity() { + return residentCity; + } + + /** + * @return Resident State + */ + @JsonProperty("resident_state") + public Optional getResidentState() { + return residentState; + } + + /** + * @return Resident Postal Code + */ + @JsonProperty("resident_postal_code") + public Optional getResidentPostalCode() { + return residentPostalCode; + } + + /** + * @return Resident Country + */ + @JsonProperty("resident_country") + public Optional getResidentCountry() { + return residentCountry; + } + + /** + * @return Family Name National Character + */ + @JsonProperty("family_name_national_character") + public Optional getFamilyNameNationalCharacter() { + return familyNameNationalCharacter; + } + + /** + * @return Given Name National Character + */ + @JsonProperty("given_name_national_character") + public Optional getGivenNameNationalCharacter() { + return givenNameNationalCharacter; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MdlPresentationProperties && equalTo((MdlPresentationProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MdlPresentationProperties other) { + return familyName.equals(other.familyName) + && givenName.equals(other.givenName) + && birthDate.equals(other.birthDate) + && issueDate.equals(other.issueDate) + && expiryDate.equals(other.expiryDate) + && issuingCountry.equals(other.issuingCountry) + && issuingAuthority.equals(other.issuingAuthority) + && portrait.equals(other.portrait) + && drivingPrivileges.equals(other.drivingPrivileges) + && residentAddress.equals(other.residentAddress) + && portraitCaptureDate.equals(other.portraitCaptureDate) + && ageInYears.equals(other.ageInYears) + && ageBirthYear.equals(other.ageBirthYear) + && issuingJurisdiction.equals(other.issuingJurisdiction) + && nationality.equals(other.nationality) + && residentCity.equals(other.residentCity) + && residentState.equals(other.residentState) + && residentPostalCode.equals(other.residentPostalCode) + && residentCountry.equals(other.residentCountry) + && familyNameNationalCharacter.equals(other.familyNameNationalCharacter) + && givenNameNationalCharacter.equals(other.givenNameNationalCharacter); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.familyName, + this.givenName, + this.birthDate, + this.issueDate, + this.expiryDate, + this.issuingCountry, + this.issuingAuthority, + this.portrait, + this.drivingPrivileges, + this.residentAddress, + this.portraitCaptureDate, + this.ageInYears, + this.ageBirthYear, + this.issuingJurisdiction, + this.nationality, + this.residentCity, + this.residentState, + this.residentPostalCode, + this.residentCountry, + this.familyNameNationalCharacter, + this.givenNameNationalCharacter); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional familyName = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional birthDate = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional expiryDate = Optional.empty(); + + private Optional issuingCountry = Optional.empty(); + + private Optional issuingAuthority = Optional.empty(); + + private Optional portrait = Optional.empty(); + + private Optional drivingPrivileges = Optional.empty(); + + private Optional residentAddress = Optional.empty(); + + private Optional portraitCaptureDate = Optional.empty(); + + private Optional ageInYears = Optional.empty(); + + private Optional ageBirthYear = Optional.empty(); + + private Optional issuingJurisdiction = Optional.empty(); + + private Optional nationality = Optional.empty(); + + private Optional residentCity = Optional.empty(); + + private Optional residentState = Optional.empty(); + + private Optional residentPostalCode = Optional.empty(); + + private Optional residentCountry = Optional.empty(); + + private Optional familyNameNationalCharacter = Optional.empty(); + + private Optional givenNameNationalCharacter = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(MdlPresentationProperties other) { + familyName(other.getFamilyName()); + givenName(other.getGivenName()); + birthDate(other.getBirthDate()); + issueDate(other.getIssueDate()); + expiryDate(other.getExpiryDate()); + issuingCountry(other.getIssuingCountry()); + issuingAuthority(other.getIssuingAuthority()); + portrait(other.getPortrait()); + drivingPrivileges(other.getDrivingPrivileges()); + residentAddress(other.getResidentAddress()); + portraitCaptureDate(other.getPortraitCaptureDate()); + ageInYears(other.getAgeInYears()); + ageBirthYear(other.getAgeBirthYear()); + issuingJurisdiction(other.getIssuingJurisdiction()); + nationality(other.getNationality()); + residentCity(other.getResidentCity()); + residentState(other.getResidentState()); + residentPostalCode(other.getResidentPostalCode()); + residentCountry(other.getResidentCountry()); + familyNameNationalCharacter(other.getFamilyNameNationalCharacter()); + givenNameNationalCharacter(other.getGivenNameNationalCharacter()); + return this; + } + + /** + *

Family Name

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(Boolean familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + /** + *

Given Name

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(Boolean givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Birth Date

+ */ + @JsonSetter(value = "birth_date", nulls = Nulls.SKIP) + public Builder birthDate(Optional birthDate) { + this.birthDate = birthDate; + return this; + } + + public Builder birthDate(Boolean birthDate) { + this.birthDate = Optional.ofNullable(birthDate); + return this; + } + + /** + *

Issue Date

+ */ + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(Boolean issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + /** + *

Expiry Date

+ */ + @JsonSetter(value = "expiry_date", nulls = Nulls.SKIP) + public Builder expiryDate(Optional expiryDate) { + this.expiryDate = expiryDate; + return this; + } + + public Builder expiryDate(Boolean expiryDate) { + this.expiryDate = Optional.ofNullable(expiryDate); + return this; + } + + /** + *

Issuing Country

+ */ + @JsonSetter(value = "issuing_country", nulls = Nulls.SKIP) + public Builder issuingCountry(Optional issuingCountry) { + this.issuingCountry = issuingCountry; + return this; + } + + public Builder issuingCountry(Boolean issuingCountry) { + this.issuingCountry = Optional.ofNullable(issuingCountry); + return this; + } + + /** + *

Issuing Authority

+ */ + @JsonSetter(value = "issuing_authority", nulls = Nulls.SKIP) + public Builder issuingAuthority(Optional issuingAuthority) { + this.issuingAuthority = issuingAuthority; + return this; + } + + public Builder issuingAuthority(Boolean issuingAuthority) { + this.issuingAuthority = Optional.ofNullable(issuingAuthority); + return this; + } + + /** + *

Portrait

+ */ + @JsonSetter(value = "portrait", nulls = Nulls.SKIP) + public Builder portrait(Optional portrait) { + this.portrait = portrait; + return this; + } + + public Builder portrait(Boolean portrait) { + this.portrait = Optional.ofNullable(portrait); + return this; + } + + /** + *

Driving Privileges

+ */ + @JsonSetter(value = "driving_privileges", nulls = Nulls.SKIP) + public Builder drivingPrivileges(Optional drivingPrivileges) { + this.drivingPrivileges = drivingPrivileges; + return this; + } + + public Builder drivingPrivileges(Boolean drivingPrivileges) { + this.drivingPrivileges = Optional.ofNullable(drivingPrivileges); + return this; + } + + /** + *

Resident Address

+ */ + @JsonSetter(value = "resident_address", nulls = Nulls.SKIP) + public Builder residentAddress(Optional residentAddress) { + this.residentAddress = residentAddress; + return this; + } + + public Builder residentAddress(Boolean residentAddress) { + this.residentAddress = Optional.ofNullable(residentAddress); + return this; + } + + /** + *

Portrait Capture Date

+ */ + @JsonSetter(value = "portrait_capture_date", nulls = Nulls.SKIP) + public Builder portraitCaptureDate(Optional portraitCaptureDate) { + this.portraitCaptureDate = portraitCaptureDate; + return this; + } + + public Builder portraitCaptureDate(Boolean portraitCaptureDate) { + this.portraitCaptureDate = Optional.ofNullable(portraitCaptureDate); + return this; + } + + /** + *

Age in Years

+ */ + @JsonSetter(value = "age_in_years", nulls = Nulls.SKIP) + public Builder ageInYears(Optional ageInYears) { + this.ageInYears = ageInYears; + return this; + } + + public Builder ageInYears(Boolean ageInYears) { + this.ageInYears = Optional.ofNullable(ageInYears); + return this; + } + + /** + *

Age Birth Year

+ */ + @JsonSetter(value = "age_birth_year", nulls = Nulls.SKIP) + public Builder ageBirthYear(Optional ageBirthYear) { + this.ageBirthYear = ageBirthYear; + return this; + } + + public Builder ageBirthYear(Boolean ageBirthYear) { + this.ageBirthYear = Optional.ofNullable(ageBirthYear); + return this; + } + + /** + *

Issuing Jurisdiction

+ */ + @JsonSetter(value = "issuing_jurisdiction", nulls = Nulls.SKIP) + public Builder issuingJurisdiction(Optional issuingJurisdiction) { + this.issuingJurisdiction = issuingJurisdiction; + return this; + } + + public Builder issuingJurisdiction(Boolean issuingJurisdiction) { + this.issuingJurisdiction = Optional.ofNullable(issuingJurisdiction); + return this; + } + + /** + *

Nationality

+ */ + @JsonSetter(value = "nationality", nulls = Nulls.SKIP) + public Builder nationality(Optional nationality) { + this.nationality = nationality; + return this; + } + + public Builder nationality(Boolean nationality) { + this.nationality = Optional.ofNullable(nationality); + return this; + } + + /** + *

Resident City

+ */ + @JsonSetter(value = "resident_city", nulls = Nulls.SKIP) + public Builder residentCity(Optional residentCity) { + this.residentCity = residentCity; + return this; + } + + public Builder residentCity(Boolean residentCity) { + this.residentCity = Optional.ofNullable(residentCity); + return this; + } + + /** + *

Resident State

+ */ + @JsonSetter(value = "resident_state", nulls = Nulls.SKIP) + public Builder residentState(Optional residentState) { + this.residentState = residentState; + return this; + } + + public Builder residentState(Boolean residentState) { + this.residentState = Optional.ofNullable(residentState); + return this; + } + + /** + *

Resident Postal Code

+ */ + @JsonSetter(value = "resident_postal_code", nulls = Nulls.SKIP) + public Builder residentPostalCode(Optional residentPostalCode) { + this.residentPostalCode = residentPostalCode; + return this; + } + + public Builder residentPostalCode(Boolean residentPostalCode) { + this.residentPostalCode = Optional.ofNullable(residentPostalCode); + return this; + } + + /** + *

Resident Country

+ */ + @JsonSetter(value = "resident_country", nulls = Nulls.SKIP) + public Builder residentCountry(Optional residentCountry) { + this.residentCountry = residentCountry; + return this; + } + + public Builder residentCountry(Boolean residentCountry) { + this.residentCountry = Optional.ofNullable(residentCountry); + return this; + } + + /** + *

Family Name National Character

+ */ + @JsonSetter(value = "family_name_national_character", nulls = Nulls.SKIP) + public Builder familyNameNationalCharacter(Optional familyNameNationalCharacter) { + this.familyNameNationalCharacter = familyNameNationalCharacter; + return this; + } + + public Builder familyNameNationalCharacter(Boolean familyNameNationalCharacter) { + this.familyNameNationalCharacter = Optional.ofNullable(familyNameNationalCharacter); + return this; + } + + /** + *

Given Name National Character

+ */ + @JsonSetter(value = "given_name_national_character", nulls = Nulls.SKIP) + public Builder givenNameNationalCharacter(Optional givenNameNationalCharacter) { + this.givenNameNationalCharacter = givenNameNationalCharacter; + return this; + } + + public Builder givenNameNationalCharacter(Boolean givenNameNationalCharacter) { + this.givenNameNationalCharacter = Optional.ofNullable(givenNameNationalCharacter); + return this; + } + + public MdlPresentationProperties build() { + return new MdlPresentationProperties( + familyName, + givenName, + birthDate, + issueDate, + expiryDate, + issuingCountry, + issuingAuthority, + portrait, + drivingPrivileges, + residentAddress, + portraitCaptureDate, + ageInYears, + ageBirthYear, + issuingJurisdiction, + nationality, + residentCity, + residentState, + residentPostalCode, + residentCountry, + familyNameNationalCharacter, + givenNameNationalCharacter, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java new file mode 100644 index 000000000..e9eb58149 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MdlPresentationRequest.Builder.class) +public final class MdlPresentationRequest { + private final MdlPresentationRequestProperties orgIso1801351MDl; + + private final Map additionalProperties; + + private MdlPresentationRequest( + MdlPresentationRequestProperties orgIso1801351MDl, Map additionalProperties) { + this.orgIso1801351MDl = orgIso1801351MDl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("org.iso.18013.5.1.mDL") + public MdlPresentationRequestProperties getOrgIso1801351MDl() { + return orgIso1801351MDl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MdlPresentationRequest && equalTo((MdlPresentationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MdlPresentationRequest other) { + return orgIso1801351MDl.equals(other.orgIso1801351MDl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.orgIso1801351MDl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OrgIso1801351MDlStage builder() { + return new Builder(); + } + + public interface OrgIso1801351MDlStage { + _FinalStage orgIso1801351MDl(@NotNull MdlPresentationRequestProperties orgIso1801351MDl); + + Builder from(MdlPresentationRequest other); + } + + public interface _FinalStage { + MdlPresentationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OrgIso1801351MDlStage, _FinalStage { + private MdlPresentationRequestProperties orgIso1801351MDl; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MdlPresentationRequest other) { + orgIso1801351MDl(other.getOrgIso1801351MDl()); + return this; + } + + @java.lang.Override + @JsonSetter("org.iso.18013.5.1.mDL") + public _FinalStage orgIso1801351MDl(@NotNull MdlPresentationRequestProperties orgIso1801351MDl) { + this.orgIso1801351MDl = Objects.requireNonNull(orgIso1801351MDl, "orgIso1801351MDl must not be null"); + return this; + } + + @java.lang.Override + public MdlPresentationRequest build() { + return new MdlPresentationRequest(orgIso1801351MDl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java new file mode 100644 index 000000000..dde377856 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MdlPresentationRequestProperties.Builder.class) +public final class MdlPresentationRequestProperties { + private final MdlPresentationProperties orgIso1801351; + + private final Map additionalProperties; + + private MdlPresentationRequestProperties( + MdlPresentationProperties orgIso1801351, Map additionalProperties) { + this.orgIso1801351 = orgIso1801351; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("org.iso.18013.5.1") + public MdlPresentationProperties getOrgIso1801351() { + return orgIso1801351; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MdlPresentationRequestProperties && equalTo((MdlPresentationRequestProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MdlPresentationRequestProperties other) { + return orgIso1801351.equals(other.orgIso1801351); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.orgIso1801351); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OrgIso1801351Stage builder() { + return new Builder(); + } + + public interface OrgIso1801351Stage { + _FinalStage orgIso1801351(@NotNull MdlPresentationProperties orgIso1801351); + + Builder from(MdlPresentationRequestProperties other); + } + + public interface _FinalStage { + MdlPresentationRequestProperties build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OrgIso1801351Stage, _FinalStage { + private MdlPresentationProperties orgIso1801351; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MdlPresentationRequestProperties other) { + orgIso1801351(other.getOrgIso1801351()); + return this; + } + + @java.lang.Override + @JsonSetter("org.iso.18013.5.1") + public _FinalStage orgIso1801351(@NotNull MdlPresentationProperties orgIso1801351) { + this.orgIso1801351 = Objects.requireNonNull(orgIso1801351, "orgIso1801351 must not be null"); + return this; + } + + @java.lang.Override + public MdlPresentationRequestProperties build() { + return new MdlPresentationRequestProperties(orgIso1801351, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java new file mode 100644 index 000000000..4acf60e81 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MfaPolicyEnum { + public static final MfaPolicyEnum CONFIDENCE_SCORE = new MfaPolicyEnum(Value.CONFIDENCE_SCORE, "confidence-score"); + + public static final MfaPolicyEnum ALL_APPLICATIONS = new MfaPolicyEnum(Value.ALL_APPLICATIONS, "all-applications"); + + private final Value value; + + private final String string; + + MfaPolicyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof MfaPolicyEnum && this.string.equals(((MfaPolicyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CONFIDENCE_SCORE: + return visitor.visitConfidenceScore(); + case ALL_APPLICATIONS: + return visitor.visitAllApplications(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MfaPolicyEnum valueOf(String value) { + switch (value) { + case "confidence-score": + return CONFIDENCE_SCORE; + case "all-applications": + return ALL_APPLICATIONS; + default: + return new MfaPolicyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ALL_APPLICATIONS, + + CONFIDENCE_SCORE, + + UNKNOWN + } + + public interface Visitor { + T visitAllApplications(); + + T visitConfidenceScore(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java new file mode 100644 index 000000000..bef1b4f76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NativeSocialLogin.Builder.class) +public final class NativeSocialLogin { + private final Optional apple; + + private final Optional facebook; + + private final Optional google; + + private final Map additionalProperties; + + private NativeSocialLogin( + Optional apple, + Optional facebook, + Optional google, + Map additionalProperties) { + this.apple = apple; + this.facebook = facebook; + this.google = google; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("apple") + public Optional getApple() { + return apple; + } + + @JsonProperty("facebook") + public Optional getFacebook() { + return facebook; + } + + @JsonProperty("google") + public Optional getGoogle() { + return google; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NativeSocialLogin && equalTo((NativeSocialLogin) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NativeSocialLogin other) { + return apple.equals(other.apple) && facebook.equals(other.facebook) && google.equals(other.google); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.apple, this.facebook, this.google); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional apple = Optional.empty(); + + private Optional facebook = Optional.empty(); + + private Optional google = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NativeSocialLogin other) { + apple(other.getApple()); + facebook(other.getFacebook()); + google(other.getGoogle()); + return this; + } + + @JsonSetter(value = "apple", nulls = Nulls.SKIP) + public Builder apple(Optional apple) { + this.apple = apple; + return this; + } + + public Builder apple(NativeSocialLoginApple apple) { + this.apple = Optional.ofNullable(apple); + return this; + } + + @JsonSetter(value = "facebook", nulls = Nulls.SKIP) + public Builder facebook(Optional facebook) { + this.facebook = facebook; + return this; + } + + public Builder facebook(NativeSocialLoginFacebook facebook) { + this.facebook = Optional.ofNullable(facebook); + return this; + } + + @JsonSetter(value = "google", nulls = Nulls.SKIP) + public Builder google(Optional google) { + this.google = google; + return this; + } + + public Builder google(NativeSocialLoginGoogle google) { + this.google = Optional.ofNullable(google); + return this; + } + + public NativeSocialLogin build() { + return new NativeSocialLogin(apple, facebook, google, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java new file mode 100644 index 000000000..ba6330302 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NativeSocialLoginApple.Builder.class) +public final class NativeSocialLoginApple { + private final Optional enabled; + + private final Map additionalProperties; + + private NativeSocialLoginApple(Optional enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determine whether or not to allow signing in natively using an Apple authorization code + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NativeSocialLoginApple && equalTo((NativeSocialLoginApple) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NativeSocialLoginApple other) { + return enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NativeSocialLoginApple other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Determine whether or not to allow signing in natively using an Apple authorization code

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public NativeSocialLoginApple build() { + return new NativeSocialLoginApple(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java new file mode 100644 index 000000000..0af39c46e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NativeSocialLoginFacebook.Builder.class) +public final class NativeSocialLoginFacebook { + private final Optional enabled; + + private final Map additionalProperties; + + private NativeSocialLoginFacebook(Optional enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determine whether or not to allow signing in natively using Facebook + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NativeSocialLoginFacebook && equalTo((NativeSocialLoginFacebook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NativeSocialLoginFacebook other) { + return enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NativeSocialLoginFacebook other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Determine whether or not to allow signing in natively using Facebook

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public NativeSocialLoginFacebook build() { + return new NativeSocialLoginFacebook(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java new file mode 100644 index 000000000..be456d506 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NativeSocialLoginGoogle.Builder.class) +public final class NativeSocialLoginGoogle { + private final Optional enabled; + + private final Map additionalProperties; + + private NativeSocialLoginGoogle(Optional enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determine whether or not to allow signing in natively using a Google ID token + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NativeSocialLoginGoogle && equalTo((NativeSocialLoginGoogle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NativeSocialLoginGoogle other) { + return enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NativeSocialLoginGoogle other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Determine whether or not to allow signing in natively using a Google ID token

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public NativeSocialLoginGoogle build() { + return new NativeSocialLoginGoogle(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java new file mode 100644 index 000000000..4a59f950e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NetworkAclAction.Builder.class) +public final class NetworkAclAction { + private final Optional block; + + private final Optional allow; + + private final Optional log; + + private final Optional redirect; + + private final Optional redirectUri; + + private final Map additionalProperties; + + private NetworkAclAction( + Optional block, + Optional allow, + Optional log, + Optional redirect, + Optional redirectUri, + Map additionalProperties) { + this.block = block; + this.allow = allow; + this.log = log; + this.redirect = redirect; + this.redirectUri = redirectUri; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("block") + public Optional getBlock() { + return block; + } + + @JsonProperty("allow") + public Optional getAllow() { + return allow; + } + + @JsonProperty("log") + public Optional getLog() { + return log; + } + + @JsonProperty("redirect") + public Optional getRedirect() { + return redirect; + } + + /** + * @return The URI to which the match or not_match requests will be routed + */ + @JsonProperty("redirect_uri") + public Optional getRedirectUri() { + return redirectUri; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworkAclAction && equalTo((NetworkAclAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworkAclAction other) { + return block.equals(other.block) + && allow.equals(other.allow) + && log.equals(other.log) + && redirect.equals(other.redirect) + && redirectUri.equals(other.redirectUri); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.block, this.allow, this.log, this.redirect, this.redirectUri); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional block = Optional.empty(); + + private Optional allow = Optional.empty(); + + private Optional log = Optional.empty(); + + private Optional redirect = Optional.empty(); + + private Optional redirectUri = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NetworkAclAction other) { + block(other.getBlock()); + allow(other.getAllow()); + log(other.getLog()); + redirect(other.getRedirect()); + redirectUri(other.getRedirectUri()); + return this; + } + + @JsonSetter(value = "block", nulls = Nulls.SKIP) + public Builder block(Optional block) { + this.block = block; + return this; + } + + public Builder block(Boolean block) { + this.block = Optional.ofNullable(block); + return this; + } + + @JsonSetter(value = "allow", nulls = Nulls.SKIP) + public Builder allow(Optional allow) { + this.allow = allow; + return this; + } + + public Builder allow(Boolean allow) { + this.allow = Optional.ofNullable(allow); + return this; + } + + @JsonSetter(value = "log", nulls = Nulls.SKIP) + public Builder log(Optional log) { + this.log = log; + return this; + } + + public Builder log(Boolean log) { + this.log = Optional.ofNullable(log); + return this; + } + + @JsonSetter(value = "redirect", nulls = Nulls.SKIP) + public Builder redirect(Optional redirect) { + this.redirect = redirect; + return this; + } + + public Builder redirect(Boolean redirect) { + this.redirect = Optional.ofNullable(redirect); + return this; + } + + /** + *

The URI to which the match or not_match requests will be routed

+ */ + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public Builder redirectUri(Optional redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + public Builder redirectUri(String redirectUri) { + this.redirectUri = Optional.ofNullable(redirectUri); + return this; + } + + public NetworkAclAction build() { + return new NetworkAclAction(block, allow, log, redirect, redirectUri, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java new file mode 100644 index 000000000..d58a63488 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NetworkAclMatch.Builder.class) +public final class NetworkAclMatch { + private final Optional> asns; + + private final Optional> geoCountryCodes; + + private final Optional> geoSubdivisionCodes; + + private final Optional> ipv4Cidrs; + + private final Optional> ipv6Cidrs; + + private final Optional> ja3Fingerprints; + + private final Optional> ja4Fingerprints; + + private final Optional> userAgents; + + private final Map additionalProperties; + + private NetworkAclMatch( + Optional> asns, + Optional> geoCountryCodes, + Optional> geoSubdivisionCodes, + Optional> ipv4Cidrs, + Optional> ipv6Cidrs, + Optional> ja3Fingerprints, + Optional> ja4Fingerprints, + Optional> userAgents, + Map additionalProperties) { + this.asns = asns; + this.geoCountryCodes = geoCountryCodes; + this.geoSubdivisionCodes = geoSubdivisionCodes; + this.ipv4Cidrs = ipv4Cidrs; + this.ipv6Cidrs = ipv6Cidrs; + this.ja3Fingerprints = ja3Fingerprints; + this.ja4Fingerprints = ja4Fingerprints; + this.userAgents = userAgents; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("asns") + public Optional> getAsns() { + return asns; + } + + @JsonProperty("geo_country_codes") + public Optional> getGeoCountryCodes() { + return geoCountryCodes; + } + + @JsonProperty("geo_subdivision_codes") + public Optional> getGeoSubdivisionCodes() { + return geoSubdivisionCodes; + } + + @JsonProperty("ipv4_cidrs") + public Optional> getIpv4Cidrs() { + return ipv4Cidrs; + } + + @JsonProperty("ipv6_cidrs") + public Optional> getIpv6Cidrs() { + return ipv6Cidrs; + } + + @JsonProperty("ja3_fingerprints") + public Optional> getJa3Fingerprints() { + return ja3Fingerprints; + } + + @JsonProperty("ja4_fingerprints") + public Optional> getJa4Fingerprints() { + return ja4Fingerprints; + } + + @JsonProperty("user_agents") + public Optional> getUserAgents() { + return userAgents; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworkAclMatch && equalTo((NetworkAclMatch) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworkAclMatch other) { + return asns.equals(other.asns) + && geoCountryCodes.equals(other.geoCountryCodes) + && geoSubdivisionCodes.equals(other.geoSubdivisionCodes) + && ipv4Cidrs.equals(other.ipv4Cidrs) + && ipv6Cidrs.equals(other.ipv6Cidrs) + && ja3Fingerprints.equals(other.ja3Fingerprints) + && ja4Fingerprints.equals(other.ja4Fingerprints) + && userAgents.equals(other.userAgents); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.asns, + this.geoCountryCodes, + this.geoSubdivisionCodes, + this.ipv4Cidrs, + this.ipv6Cidrs, + this.ja3Fingerprints, + this.ja4Fingerprints, + this.userAgents); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> asns = Optional.empty(); + + private Optional> geoCountryCodes = Optional.empty(); + + private Optional> geoSubdivisionCodes = Optional.empty(); + + private Optional> ipv4Cidrs = Optional.empty(); + + private Optional> ipv6Cidrs = Optional.empty(); + + private Optional> ja3Fingerprints = Optional.empty(); + + private Optional> ja4Fingerprints = Optional.empty(); + + private Optional> userAgents = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NetworkAclMatch other) { + asns(other.getAsns()); + geoCountryCodes(other.getGeoCountryCodes()); + geoSubdivisionCodes(other.getGeoSubdivisionCodes()); + ipv4Cidrs(other.getIpv4Cidrs()); + ipv6Cidrs(other.getIpv6Cidrs()); + ja3Fingerprints(other.getJa3Fingerprints()); + ja4Fingerprints(other.getJa4Fingerprints()); + userAgents(other.getUserAgents()); + return this; + } + + @JsonSetter(value = "asns", nulls = Nulls.SKIP) + public Builder asns(Optional> asns) { + this.asns = asns; + return this; + } + + public Builder asns(List asns) { + this.asns = Optional.ofNullable(asns); + return this; + } + + @JsonSetter(value = "geo_country_codes", nulls = Nulls.SKIP) + public Builder geoCountryCodes(Optional> geoCountryCodes) { + this.geoCountryCodes = geoCountryCodes; + return this; + } + + public Builder geoCountryCodes(List geoCountryCodes) { + this.geoCountryCodes = Optional.ofNullable(geoCountryCodes); + return this; + } + + @JsonSetter(value = "geo_subdivision_codes", nulls = Nulls.SKIP) + public Builder geoSubdivisionCodes(Optional> geoSubdivisionCodes) { + this.geoSubdivisionCodes = geoSubdivisionCodes; + return this; + } + + public Builder geoSubdivisionCodes(List geoSubdivisionCodes) { + this.geoSubdivisionCodes = Optional.ofNullable(geoSubdivisionCodes); + return this; + } + + @JsonSetter(value = "ipv4_cidrs", nulls = Nulls.SKIP) + public Builder ipv4Cidrs(Optional> ipv4Cidrs) { + this.ipv4Cidrs = ipv4Cidrs; + return this; + } + + public Builder ipv4Cidrs(List ipv4Cidrs) { + this.ipv4Cidrs = Optional.ofNullable(ipv4Cidrs); + return this; + } + + @JsonSetter(value = "ipv6_cidrs", nulls = Nulls.SKIP) + public Builder ipv6Cidrs(Optional> ipv6Cidrs) { + this.ipv6Cidrs = ipv6Cidrs; + return this; + } + + public Builder ipv6Cidrs(List ipv6Cidrs) { + this.ipv6Cidrs = Optional.ofNullable(ipv6Cidrs); + return this; + } + + @JsonSetter(value = "ja3_fingerprints", nulls = Nulls.SKIP) + public Builder ja3Fingerprints(Optional> ja3Fingerprints) { + this.ja3Fingerprints = ja3Fingerprints; + return this; + } + + public Builder ja3Fingerprints(List ja3Fingerprints) { + this.ja3Fingerprints = Optional.ofNullable(ja3Fingerprints); + return this; + } + + @JsonSetter(value = "ja4_fingerprints", nulls = Nulls.SKIP) + public Builder ja4Fingerprints(Optional> ja4Fingerprints) { + this.ja4Fingerprints = ja4Fingerprints; + return this; + } + + public Builder ja4Fingerprints(List ja4Fingerprints) { + this.ja4Fingerprints = Optional.ofNullable(ja4Fingerprints); + return this; + } + + @JsonSetter(value = "user_agents", nulls = Nulls.SKIP) + public Builder userAgents(Optional> userAgents) { + this.userAgents = userAgents; + return this; + } + + public Builder userAgents(List userAgents) { + this.userAgents = Optional.ofNullable(userAgents); + return this; + } + + public NetworkAclMatch build() { + return new NetworkAclMatch( + asns, + geoCountryCodes, + geoSubdivisionCodes, + ipv4Cidrs, + ipv6Cidrs, + ja3Fingerprints, + ja4Fingerprints, + userAgents, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java new file mode 100644 index 000000000..8511f8a3d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NetworkAclRule.Builder.class) +public final class NetworkAclRule { + private final NetworkAclAction action; + + private final Optional match; + + private final Optional notMatch; + + private final NetworkAclRuleScopeEnum scope; + + private final Map additionalProperties; + + private NetworkAclRule( + NetworkAclAction action, + Optional match, + Optional notMatch, + NetworkAclRuleScopeEnum scope, + Map additionalProperties) { + this.action = action; + this.match = match; + this.notMatch = notMatch; + this.scope = scope; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action") + public NetworkAclAction getAction() { + return action; + } + + @JsonProperty("match") + public Optional getMatch() { + return match; + } + + @JsonProperty("not_match") + public Optional getNotMatch() { + return notMatch; + } + + @JsonProperty("scope") + public NetworkAclRuleScopeEnum getScope() { + return scope; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworkAclRule && equalTo((NetworkAclRule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworkAclRule other) { + return action.equals(other.action) + && match.equals(other.match) + && notMatch.equals(other.notMatch) + && scope.equals(other.scope); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action, this.match, this.notMatch, this.scope); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + ScopeStage action(@NotNull NetworkAclAction action); + + Builder from(NetworkAclRule other); + } + + public interface ScopeStage { + _FinalStage scope(@NotNull NetworkAclRuleScopeEnum scope); + } + + public interface _FinalStage { + NetworkAclRule build(); + + _FinalStage match(Optional match); + + _FinalStage match(NetworkAclMatch match); + + _FinalStage notMatch(Optional notMatch); + + _FinalStage notMatch(NetworkAclMatch notMatch); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionStage, ScopeStage, _FinalStage { + private NetworkAclAction action; + + private NetworkAclRuleScopeEnum scope; + + private Optional notMatch = Optional.empty(); + + private Optional match = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(NetworkAclRule other) { + action(other.getAction()); + match(other.getMatch()); + notMatch(other.getNotMatch()); + scope(other.getScope()); + return this; + } + + @java.lang.Override + @JsonSetter("action") + public ScopeStage action(@NotNull NetworkAclAction action) { + this.action = Objects.requireNonNull(action, "action must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("scope") + public _FinalStage scope(@NotNull NetworkAclRuleScopeEnum scope) { + this.scope = Objects.requireNonNull(scope, "scope must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage notMatch(NetworkAclMatch notMatch) { + this.notMatch = Optional.ofNullable(notMatch); + return this; + } + + @java.lang.Override + @JsonSetter(value = "not_match", nulls = Nulls.SKIP) + public _FinalStage notMatch(Optional notMatch) { + this.notMatch = notMatch; + return this; + } + + @java.lang.Override + public _FinalStage match(NetworkAclMatch match) { + this.match = Optional.ofNullable(match); + return this; + } + + @java.lang.Override + @JsonSetter(value = "match", nulls = Nulls.SKIP) + public _FinalStage match(Optional match) { + this.match = match; + return this; + } + + @java.lang.Override + public NetworkAclRule build() { + return new NetworkAclRule(action, match, notMatch, scope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java new file mode 100644 index 000000000..0c899d0d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class NetworkAclRuleScopeEnum { + public static final NetworkAclRuleScopeEnum AUTHENTICATION = + new NetworkAclRuleScopeEnum(Value.AUTHENTICATION, "authentication"); + + public static final NetworkAclRuleScopeEnum MANAGEMENT = + new NetworkAclRuleScopeEnum(Value.MANAGEMENT, "management"); + + public static final NetworkAclRuleScopeEnum TENANT = new NetworkAclRuleScopeEnum(Value.TENANT, "tenant"); + + private final Value value; + + private final String string; + + NetworkAclRuleScopeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof NetworkAclRuleScopeEnum + && this.string.equals(((NetworkAclRuleScopeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTHENTICATION: + return visitor.visitAuthentication(); + case MANAGEMENT: + return visitor.visitManagement(); + case TENANT: + return visitor.visitTenant(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static NetworkAclRuleScopeEnum valueOf(String value) { + switch (value) { + case "authentication": + return AUTHENTICATION; + case "management": + return MANAGEMENT; + case "tenant": + return TENANT; + default: + return new NetworkAclRuleScopeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + MANAGEMENT, + + AUTHENTICATION, + + TENANT, + + UNKNOWN + } + + public interface Visitor { + T visitManagement(); + + T visitAuthentication(); + + T visitTenant(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java new file mode 100644 index 000000000..6ab74dbe1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NetworkAclsResponseContent.Builder.class) +public final class NetworkAclsResponseContent { + private final Optional id; + + private final Optional description; + + private final Optional active; + + private final Optional priority; + + private final Optional rule; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private NetworkAclsResponseContent( + Optional id, + Optional description, + Optional active, + Optional priority, + Optional rule, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("rule") + public Optional getRule() { + return rule; + } + + /** + * @return The timestamp when the Network ACL Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp when the Network ACL Configuration was last updated + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworkAclsResponseContent && equalTo((NetworkAclsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworkAclsResponseContent other) { + return id.equals(other.id) + && description.equals(other.description) + && active.equals(other.active) + && priority.equals(other.priority) + && rule.equals(other.rule) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional active = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional rule = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NetworkAclsResponseContent other) { + id(other.getId()); + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(Double priority) { + this.priority = Optional.ofNullable(priority); + return this; + } + + @JsonSetter(value = "rule", nulls = Nulls.SKIP) + public Builder rule(Optional rule) { + this.rule = rule; + return this; + } + + public Builder rule(NetworkAclRule rule) { + this.rule = Optional.ofNullable(rule); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was last updated

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(String updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public NetworkAclsResponseContent build() { + return new NetworkAclsResponseContent( + id, description, active, priority, rule, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java new file mode 100644 index 000000000..8d01f9770 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java @@ -0,0 +1,2607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OauthScope { + public static final OauthScope READ_AUTHENTICATION_METHODS = + new OauthScope(Value.READ_AUTHENTICATION_METHODS, "read:authentication_methods"); + + public static final OauthScope UPDATE_USERS_APP_METADATA = + new OauthScope(Value.UPDATE_USERS_APP_METADATA, "update:users_app_metadata"); + + public static final OauthScope READ_ANOMALY_BLOCKS = + new OauthScope(Value.READ_ANOMALY_BLOCKS, "read:anomaly_blocks"); + + public static final OauthScope READ_CLIENT_SUMMARY = + new OauthScope(Value.READ_CLIENT_SUMMARY, "read:client_summary"); + + public static final OauthScope READ_SCIM_CONFIG = new OauthScope(Value.READ_SCIM_CONFIG, "read:scim_config"); + + public static final OauthScope UPDATE_SCIM_CONFIG = new OauthScope(Value.UPDATE_SCIM_CONFIG, "update:scim_config"); + + public static final OauthScope CREATE_RULES = new OauthScope(Value.CREATE_RULES, "create:rules"); + + public static final OauthScope READ_EXTENSIONS = new OauthScope(Value.READ_EXTENSIONS, "read:extensions"); + + public static final OauthScope READ_PROMPTS = new OauthScope(Value.READ_PROMPTS, "read:prompts"); + + public static final OauthScope CREATE_ORGANIZATION_DISCOVERY_DOMAINS = + new OauthScope(Value.CREATE_ORGANIZATION_DISCOVERY_DOMAINS, "create:organization_discovery_domains"); + + public static final OauthScope CREATE_PHONE_TEMPLATES = + new OauthScope(Value.CREATE_PHONE_TEMPLATES, "create:phone_templates"); + + public static final OauthScope UPDATE_PHONE_PROVIDERS = + new OauthScope(Value.UPDATE_PHONE_PROVIDERS, "update:phone_providers"); + + public static final OauthScope CREATE_ROLES = new OauthScope(Value.CREATE_ROLES, "create:roles"); + + public static final OauthScope CREATE_CONNECTIONS_KEYS = + new OauthScope(Value.CREATE_CONNECTIONS_KEYS, "create:connections_keys"); + + public static final OauthScope UPDATE_RULES = new OauthScope(Value.UPDATE_RULES, "update:rules"); + + public static final OauthScope DELETE_AUTHENTICATION_METHODS = + new OauthScope(Value.DELETE_AUTHENTICATION_METHODS, "delete:authentication_methods"); + + public static final OauthScope UPDATE_FLOWS_VAULT_CONNECTIONS = + new OauthScope(Value.UPDATE_FLOWS_VAULT_CONNECTIONS, "update:flows_vault_connections"); + + public static final OauthScope READ_ENCRYPTION_KEYS = + new OauthScope(Value.READ_ENCRYPTION_KEYS, "read:encryption_keys"); + + public static final OauthScope DELETE_SESSIONS = new OauthScope(Value.DELETE_SESSIONS, "delete:sessions"); + + public static final OauthScope UPDATE_ACTIONS = new OauthScope(Value.UPDATE_ACTIONS, "update:actions"); + + public static final OauthScope CREATE_EVENT_STREAMS = + new OauthScope(Value.CREATE_EVENT_STREAMS, "create:event_streams"); + + public static final OauthScope DELETE_EVENT_STREAMS = + new OauthScope(Value.DELETE_EVENT_STREAMS, "delete:event_streams"); + + public static final OauthScope DELETE_FLOWS = new OauthScope(Value.DELETE_FLOWS, "delete:flows"); + + public static final OauthScope READ_USER_APPLICATION_PASSWORDS = + new OauthScope(Value.READ_USER_APPLICATION_PASSWORDS, "read:user_application_passwords"); + + public static final OauthScope DELETE_PHONE_PROVIDERS = + new OauthScope(Value.DELETE_PHONE_PROVIDERS, "delete:phone_providers"); + + public static final OauthScope DELETE_SELF_SERVICE_PROFILES = + new OauthScope(Value.DELETE_SELF_SERVICE_PROFILES, "delete:self_service_profiles"); + + public static final OauthScope READ_TENANT_FEATURE_FLAGS = + new OauthScope(Value.READ_TENANT_FEATURE_FLAGS, "read:tenant_feature_flags"); + + public static final OauthScope READ_INSIGHTS = new OauthScope(Value.READ_INSIGHTS, "read:insights"); + + public static final OauthScope CREATE_SIGNING_KEYS = + new OauthScope(Value.CREATE_SIGNING_KEYS, "create:signing_keys"); + + public static final OauthScope UPDATE_SIGNING_KEYS = + new OauthScope(Value.UPDATE_SIGNING_KEYS, "update:signing_keys"); + + public static final OauthScope CREATE_USER_TICKETS = + new OauthScope(Value.CREATE_USER_TICKETS, "create:user_tickets"); + + public static final OauthScope DELETE_GRANTS = new OauthScope(Value.DELETE_GRANTS, "delete:grants"); + + public static final OauthScope DELETE_REFRESH_TOKENS = + new OauthScope(Value.DELETE_REFRESH_TOKENS, "delete:refresh_tokens"); + + public static final OauthScope READ_RULES_CONFIGS = new OauthScope(Value.READ_RULES_CONFIGS, "read:rules_configs"); + + public static final OauthScope CREATE_SELF_SERVICE_PROFILES = + new OauthScope(Value.CREATE_SELF_SERVICE_PROFILES, "create:self_service_profiles"); + + public static final OauthScope READ_USER_IDP_TOKENS = + new OauthScope(Value.READ_USER_IDP_TOKENS, "read:user_idp_tokens"); + + public static final OauthScope READ_HOOKS = new OauthScope(Value.READ_HOOKS, "read:hooks"); + + public static final OauthScope READ_CUSTOM_SIGNING_KEYS = + new OauthScope(Value.READ_CUSTOM_SIGNING_KEYS, "read:custom_signing_keys"); + + public static final OauthScope CREATE_CURRENT_USER_DEVICE_CREDENTIALS = + new OauthScope(Value.CREATE_CURRENT_USER_DEVICE_CREDENTIALS, "create:current_user_device_credentials"); + + public static final OauthScope DELETE_BRANDING = new OauthScope(Value.DELETE_BRANDING, "delete:branding"); + + public static final OauthScope DELETE_CLIENT_CREDENTIALS = + new OauthScope(Value.DELETE_CLIENT_CREDENTIALS, "delete:client_credentials"); + + public static final OauthScope UPDATE_TENANT_SETTINGS = + new OauthScope(Value.UPDATE_TENANT_SETTINGS, "update:tenant_settings"); + + public static final OauthScope READ_ORGANIZATION_INVITATIONS = + new OauthScope(Value.READ_ORGANIZATION_INVITATIONS, "read:organization_invitations"); + + public static final OauthScope READ_GRANTS = new OauthScope(Value.READ_GRANTS, "read:grants"); + + public static final OauthScope DELETE_ORGANIZATION_INVITATIONS = + new OauthScope(Value.DELETE_ORGANIZATION_INVITATIONS, "delete:organization_invitations"); + + public static final OauthScope UPDATE_RULES_CONFIGS = + new OauthScope(Value.UPDATE_RULES_CONFIGS, "update:rules_configs"); + + public static final OauthScope UPDATE_CONNECTION_PROFILES = + new OauthScope(Value.UPDATE_CONNECTION_PROFILES, "update:connection_profiles"); + + public static final OauthScope DELETE_ACTIONS = new OauthScope(Value.DELETE_ACTIONS, "delete:actions"); + + public static final OauthScope UPDATE_AUTHENTICATION_METHODS = + new OauthScope(Value.UPDATE_AUTHENTICATION_METHODS, "update:authentication_methods"); + + public static final OauthScope CREATE_VDCS_TEMPLATES = + new OauthScope(Value.CREATE_VDCS_TEMPLATES, "create:vdcs_templates"); + + public static final OauthScope READ_ATTACK_PROTECTION = + new OauthScope(Value.READ_ATTACK_PROTECTION, "read:attack_protection"); + + public static final OauthScope CREATE_CUSTOM_DOMAINS = + new OauthScope(Value.CREATE_CUSTOM_DOMAINS, "create:custom_domains"); + + public static final OauthScope DELETE_ORGANIZATION_CONNECTIONS = + new OauthScope(Value.DELETE_ORGANIZATION_CONNECTIONS, "delete:organization_connections"); + + public static final OauthScope READ_CURRENT_USER = new OauthScope(Value.READ_CURRENT_USER, "read:current_user"); + + public static final OauthScope UPDATE_SHIELDS = new OauthScope(Value.UPDATE_SHIELDS, "update:shields"); + + public static final OauthScope READ_CLIENT_CREDENTIALS = + new OauthScope(Value.READ_CLIENT_CREDENTIALS, "read:client_credentials"); + + public static final OauthScope CREATE_ORGANIZATIONS = + new OauthScope(Value.CREATE_ORGANIZATIONS, "create:organizations"); + + public static final OauthScope READ_ORGANIZATIONS_SUMMARY = + new OauthScope(Value.READ_ORGANIZATIONS_SUMMARY, "read:organizations_summary"); + + public static final OauthScope READ_SCIM_TOKEN = new OauthScope(Value.READ_SCIM_TOKEN, "read:scim_token"); + + public static final OauthScope DELETE_ORGANIZATIONS = + new OauthScope(Value.DELETE_ORGANIZATIONS, "delete:organizations"); + + public static final OauthScope READ_CONNECTIONS = new OauthScope(Value.READ_CONNECTIONS, "read:connections"); + + public static final OauthScope READ_SIGNING_KEYS = new OauthScope(Value.READ_SIGNING_KEYS, "read:signing_keys"); + + public static final OauthScope DELETE_TENANT_INVITATIONS = + new OauthScope(Value.DELETE_TENANT_INVITATIONS, "delete:tenant_invitations"); + + public static final OauthScope DELETE_FEDERATED_CONNECTIONS_TOKENS = + new OauthScope(Value.DELETE_FEDERATED_CONNECTIONS_TOKENS, "delete:federated_connections_tokens"); + + public static final OauthScope DELETE_CONNECTIONS = new OauthScope(Value.DELETE_CONNECTIONS, "delete:connections"); + + public static final OauthScope CREATE_USERS = new OauthScope(Value.CREATE_USERS, "create:users"); + + public static final OauthScope UPDATE_RESOURCE_SERVERS = + new OauthScope(Value.UPDATE_RESOURCE_SERVERS, "update:resource_servers"); + + public static final OauthScope READ_PHONE_TEMPLATES = + new OauthScope(Value.READ_PHONE_TEMPLATES, "read:phone_templates"); + + public static final OauthScope UPDATE_ROLES = new OauthScope(Value.UPDATE_ROLES, "update:roles"); + + public static final OauthScope CREATE_SSO_ACCESS_TICKETS = + new OauthScope(Value.CREATE_SSO_ACCESS_TICKETS, "create:sso_access_tickets"); + + public static final OauthScope READ_SELF_SERVICE_PROFILE_CUSTOM_TEXTS = + new OauthScope(Value.READ_SELF_SERVICE_PROFILE_CUSTOM_TEXTS, "read:self_service_profile_custom_texts"); + + public static final OauthScope DELETE_SCIM_TOKEN = new OauthScope(Value.DELETE_SCIM_TOKEN, "delete:scim_token"); + + public static final OauthScope DELETE_FORMS = new OauthScope(Value.DELETE_FORMS, "delete:forms"); + + public static final OauthScope READ_SELF_SERVICE_PROFILES = + new OauthScope(Value.READ_SELF_SERVICE_PROFILES, "read:self_service_profiles"); + + public static final OauthScope DELETE_RULES_CONFIGS = + new OauthScope(Value.DELETE_RULES_CONFIGS, "delete:rules_configs"); + + public static final OauthScope CREATE_FORMS = new OauthScope(Value.CREATE_FORMS, "create:forms"); + + public static final OauthScope READ_USER_ATTRIBUTE_PROFILES = + new OauthScope(Value.READ_USER_ATTRIBUTE_PROFILES, "read:user_attribute_profiles"); + + public static final OauthScope UPDATE_TENANT_MEMBERS = + new OauthScope(Value.UPDATE_TENANT_MEMBERS, "update:tenant_members"); + + public static final OauthScope CREATE_AUTHENTICATION_METHODS = + new OauthScope(Value.CREATE_AUTHENTICATION_METHODS, "create:authentication_methods"); + + public static final OauthScope CREATE_PHONE_PROVIDERS = + new OauthScope(Value.CREATE_PHONE_PROVIDERS, "create:phone_providers"); + + public static final OauthScope DELETE_ORGANIZATION_CLIENT_GRANTS = + new OauthScope(Value.DELETE_ORGANIZATION_CLIENT_GRANTS, "delete:organization_client_grants"); + + public static final OauthScope CREATE_SCIM_CONFIG = new OauthScope(Value.CREATE_SCIM_CONFIG, "create:scim_config"); + + public static final OauthScope CREATE_CLIENTS = new OauthScope(Value.CREATE_CLIENTS, "create:clients"); + + public static final OauthScope UPDATE_USERS = new OauthScope(Value.UPDATE_USERS, "update:users"); + + public static final OauthScope READ_ORGANIZATION_MEMBERS = + new OauthScope(Value.READ_ORGANIZATION_MEMBERS, "read:organization_members"); + + public static final OauthScope UPDATE_EVENT_STREAMS = + new OauthScope(Value.UPDATE_EVENT_STREAMS, "update:event_streams"); + + public static final OauthScope READ_INTEGRATIONS = new OauthScope(Value.READ_INTEGRATIONS, "read:integrations"); + + public static final OauthScope CREATE_TENANT_INVITATIONS = + new OauthScope(Value.CREATE_TENANT_INVITATIONS, "create:tenant_invitations"); + + public static final OauthScope UPDATE_CUSTOM_SIGNING_KEYS = + new OauthScope(Value.UPDATE_CUSTOM_SIGNING_KEYS, "update:custom_signing_keys"); + + public static final OauthScope READ_LOG_STREAMS = new OauthScope(Value.READ_LOG_STREAMS, "read:log_streams"); + + public static final OauthScope UPDATE_LOG_STREAMS = new OauthScope(Value.UPDATE_LOG_STREAMS, "update:log_streams"); + + public static final OauthScope READ_CLIENTS = new OauthScope(Value.READ_CLIENTS, "read:clients"); + + public static final OauthScope READ_SHIELDS = new OauthScope(Value.READ_SHIELDS, "read:shields"); + + public static final OauthScope DELETE_ENCRYPTION_KEYS = + new OauthScope(Value.DELETE_ENCRYPTION_KEYS, "delete:encryption_keys"); + + public static final OauthScope CREATE_SHIELDS = new OauthScope(Value.CREATE_SHIELDS, "create:shields"); + + public static final OauthScope UPDATE_USER_ATTRIBUTE_PROFILES = + new OauthScope(Value.UPDATE_USER_ATTRIBUTE_PROFILES, "update:user_attribute_profiles"); + + public static final OauthScope CREATE_CUSTOM_SIGNING_KEYS = + new OauthScope(Value.CREATE_CUSTOM_SIGNING_KEYS, "create:custom_signing_keys"); + + public static final OauthScope DELETE_INTEGRATIONS = + new OauthScope(Value.DELETE_INTEGRATIONS, "delete:integrations"); + + public static final OauthScope READ_CLIENT_KEYS = new OauthScope(Value.READ_CLIENT_KEYS, "read:client_keys"); + + public static final OauthScope CREATE_EMAIL_PROVIDER = + new OauthScope(Value.CREATE_EMAIL_PROVIDER, "create:email_provider"); + + public static final OauthScope UPDATE_NETWORK_ACLS = + new OauthScope(Value.UPDATE_NETWORK_ACLS, "update:network_acls"); + + public static final OauthScope DELETE_VDCS_TEMPLATES = + new OauthScope(Value.DELETE_VDCS_TEMPLATES, "delete:vdcs_templates"); + + public static final OauthScope CREATE_USER_APPLICATION_PASSWORDS = + new OauthScope(Value.CREATE_USER_APPLICATION_PASSWORDS, "create:user_application_passwords"); + + public static final OauthScope READ_FLOWS = new OauthScope(Value.READ_FLOWS, "read:flows"); + + public static final OauthScope READ_SESSIONS = new OauthScope(Value.READ_SESSIONS, "read:sessions"); + + public static final OauthScope CREATE_TEST_EMAIL_DISPATCH = + new OauthScope(Value.CREATE_TEST_EMAIL_DISPATCH, "create:test_email_dispatch"); + + public static final OauthScope CREATE_ORGANIZATION_MEMBER_ROLES = + new OauthScope(Value.CREATE_ORGANIZATION_MEMBER_ROLES, "create:organization_member_roles"); + + public static final OauthScope DELETE_ORGANIZATION_MEMBERS = + new OauthScope(Value.DELETE_ORGANIZATION_MEMBERS, "delete:organization_members"); + + public static final OauthScope UPDATE_FORMS = new OauthScope(Value.UPDATE_FORMS, "update:forms"); + + public static final OauthScope CREATE_RESOURCE_SERVERS = + new OauthScope(Value.CREATE_RESOURCE_SERVERS, "create:resource_servers"); + + public static final OauthScope READ_BRANDING = new OauthScope(Value.READ_BRANDING, "read:branding"); + + public static final OauthScope UPDATE_MFA_POLICIES = + new OauthScope(Value.UPDATE_MFA_POLICIES, "update:mfa_policies"); + + public static final OauthScope UPDATE_CURRENT_USER_METADATA = + new OauthScope(Value.UPDATE_CURRENT_USER_METADATA, "update:current_user_metadata"); + + public static final OauthScope READ_FLOWS_VAULT_CONNECTIONS = + new OauthScope(Value.READ_FLOWS_VAULT_CONNECTIONS, "read:flows_vault_connections"); + + public static final OauthScope READ_ORGANIZATION_CLIENT_GRANTS = + new OauthScope(Value.READ_ORGANIZATION_CLIENT_GRANTS, "read:organization_client_grants"); + + public static final OauthScope UPDATE_CLIENTS = new OauthScope(Value.UPDATE_CLIENTS, "update:clients"); + + public static final OauthScope READ_SECURITY_METRICS = + new OauthScope(Value.READ_SECURITY_METRICS, "read:security_metrics"); + + public static final OauthScope RUN_CHECKS = new OauthScope(Value.RUN_CHECKS, "run:checks"); + + public static final OauthScope DELETE_CLIENT_GRANTS = + new OauthScope(Value.DELETE_CLIENT_GRANTS, "delete:client_grants"); + + public static final OauthScope UPDATE_DEVICE_CODES = + new OauthScope(Value.UPDATE_DEVICE_CODES, "update:device_codes"); + + public static final OauthScope CREATE_ENCRYPTION_KEYS = + new OauthScope(Value.CREATE_ENCRYPTION_KEYS, "create:encryption_keys"); + + public static final OauthScope UPDATE_ENCRYPTION_KEYS = + new OauthScope(Value.UPDATE_ENCRYPTION_KEYS, "update:encryption_keys"); + + public static final OauthScope READ_ROLES = new OauthScope(Value.READ_ROLES, "read:roles"); + + public static final OauthScope READ_DEVICE_CREDENTIALS = + new OauthScope(Value.READ_DEVICE_CREDENTIALS, "read:device_credentials"); + + public static final OauthScope DELETE_TOKEN_EXCHANGE_PROFILES = + new OauthScope(Value.DELETE_TOKEN_EXCHANGE_PROFILES, "delete:token_exchange_profiles"); + + public static final OauthScope UPDATE_ORGANIZATION_DISCOVERY_DOMAINS = + new OauthScope(Value.UPDATE_ORGANIZATION_DISCOVERY_DOMAINS, "update:organization_discovery_domains"); + + public static final OauthScope READ_LOGS = new OauthScope(Value.READ_LOGS, "read:logs"); + + public static final OauthScope UPDATE_EMAIL_PROVIDER = + new OauthScope(Value.UPDATE_EMAIL_PROVIDER, "update:email_provider"); + + public static final OauthScope READ_TENANT_MEMBERS = + new OauthScope(Value.READ_TENANT_MEMBERS, "read:tenant_members"); + + public static final OauthScope DELETE_FLOWS_VAULT_CONNECTIONS = + new OauthScope(Value.DELETE_FLOWS_VAULT_CONNECTIONS, "delete:flows_vault_connections"); + + public static final OauthScope DELETE_NETWORK_ACLS = + new OauthScope(Value.DELETE_NETWORK_ACLS, "delete:network_acls"); + + public static final OauthScope UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS = + new OauthScope(Value.UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS, "update:self_service_profile_custom_texts"); + + public static final OauthScope UPDATE_CLIENT_GRANTS = + new OauthScope(Value.UPDATE_CLIENT_GRANTS, "update:client_grants"); + + public static final OauthScope READ_EMAIL_TEMPLATES = + new OauthScope(Value.READ_EMAIL_TEMPLATES, "read:email_templates"); + + public static final OauthScope UPDATE_VDCS_TEMPLATES = + new OauthScope(Value.UPDATE_VDCS_TEMPLATES, "update:vdcs_templates"); + + public static final OauthScope DELETE_TENANTS = new OauthScope(Value.DELETE_TENANTS, "delete:tenants"); + + public static final OauthScope CREATE_USER_ATTRIBUTE_PROFILES = + new OauthScope(Value.CREATE_USER_ATTRIBUTE_PROFILES, "create:user_attribute_profiles"); + + public static final OauthScope CREATE_ORGANIZATION_INVITATIONS = + new OauthScope(Value.CREATE_ORGANIZATION_INVITATIONS, "create:organization_invitations"); + + public static final OauthScope DELETE_LOG_STREAMS = new OauthScope(Value.DELETE_LOG_STREAMS, "delete:log_streams"); + + public static final OauthScope DELETE_CUSTOM_SIGNING_KEYS = + new OauthScope(Value.DELETE_CUSTOM_SIGNING_KEYS, "delete:custom_signing_keys"); + + public static final OauthScope READ_DEVICE_CODES = new OauthScope(Value.READ_DEVICE_CODES, "read:device_codes"); + + public static final OauthScope DELETE_RESOURCE_SERVERS = + new OauthScope(Value.DELETE_RESOURCE_SERVERS, "delete:resource_servers"); + + public static final OauthScope UPDATE_GUARDIAN_FACTORS = + new OauthScope(Value.UPDATE_GUARDIAN_FACTORS, "update:guardian_factors"); + + public static final OauthScope READ_USERS = new OauthScope(Value.READ_USERS, "read:users"); + + public static final OauthScope DELETE_ORGANIZATION_MEMBER_ROLES = + new OauthScope(Value.DELETE_ORGANIZATION_MEMBER_ROLES, "delete:organization_member_roles"); + + public static final OauthScope UPDATE_BRANDING = new OauthScope(Value.UPDATE_BRANDING, "update:branding"); + + public static final OauthScope CREATE_INTEGRATIONS = + new OauthScope(Value.CREATE_INTEGRATIONS, "create:integrations"); + + public static final OauthScope DELETE_SSO_ACCESS_TICKETS = + new OauthScope(Value.DELETE_SSO_ACCESS_TICKETS, "delete:sso_access_tickets"); + + public static final OauthScope UPDATE_ORGANIZATION_CONNECTIONS = + new OauthScope(Value.UPDATE_ORGANIZATION_CONNECTIONS, "update:organization_connections"); + + public static final OauthScope UPDATE_CUSTOM_DOMAINS = + new OauthScope(Value.UPDATE_CUSTOM_DOMAINS, "update:custom_domains"); + + public static final OauthScope READ_NETWORK_ACLS = new OauthScope(Value.READ_NETWORK_ACLS, "read:network_acls"); + + public static final OauthScope DELETE_EMAIL_PROVIDER = + new OauthScope(Value.DELETE_EMAIL_PROVIDER, "delete:email_provider"); + + public static final OauthScope READ_FORMS = new OauthScope(Value.READ_FORMS, "read:forms"); + + public static final OauthScope CREATE_GUARDIAN_ENROLLMENT_TICKETS = + new OauthScope(Value.CREATE_GUARDIAN_ENROLLMENT_TICKETS, "create:guardian_enrollment_tickets"); + + public static final OauthScope READ_EVENT_STREAMS = new OauthScope(Value.READ_EVENT_STREAMS, "read:event_streams"); + + public static final OauthScope CREATE_NETWORK_ACLS = + new OauthScope(Value.CREATE_NETWORK_ACLS, "create:network_acls"); + + public static final OauthScope CREATE_SCIM_TOKEN = new OauthScope(Value.CREATE_SCIM_TOKEN, "create:scim_token"); + + public static final OauthScope DELETE_CUSTOM_DOMAINS = + new OauthScope(Value.DELETE_CUSTOM_DOMAINS, "delete:custom_domains"); + + public static final OauthScope DELETE_CONNECTION_PROFILES = + new OauthScope(Value.DELETE_CONNECTION_PROFILES, "delete:connection_profiles"); + + public static final OauthScope UPDATE_CONNECTIONS = new OauthScope(Value.UPDATE_CONNECTIONS, "update:connections"); + + public static final OauthScope DELETE_DEVICE_CREDENTIALS = + new OauthScope(Value.DELETE_DEVICE_CREDENTIALS, "delete:device_credentials"); + + public static final OauthScope READ_GUARDIAN_FACTORS = + new OauthScope(Value.READ_GUARDIAN_FACTORS, "read:guardian_factors"); + + public static final OauthScope READ_TENANT_SETTINGS = + new OauthScope(Value.READ_TENANT_SETTINGS, "read:tenant_settings"); + + public static final OauthScope DELETE_SCIM_CONFIG = new OauthScope(Value.DELETE_SCIM_CONFIG, "delete:scim_config"); + + public static final OauthScope DELETE_RULES = new OauthScope(Value.DELETE_RULES, "delete:rules"); + + public static final OauthScope UPDATE_TENANT_INVITATIONS = + new OauthScope(Value.UPDATE_TENANT_INVITATIONS, "update:tenant_invitations"); + + public static final OauthScope READ_ORGANIZATION_MEMBER_ROLES = + new OauthScope(Value.READ_ORGANIZATION_MEMBER_ROLES, "read:organization_member_roles"); + + public static final OauthScope UPDATE_FLOWS = new OauthScope(Value.UPDATE_FLOWS, "update:flows"); + + public static final OauthScope READ_FEDERATED_CONNECTIONS_TOKENS = + new OauthScope(Value.READ_FEDERATED_CONNECTIONS_TOKENS, "read:federated_connections_tokens"); + + public static final OauthScope CREATE_LOG_STREAMS = new OauthScope(Value.CREATE_LOG_STREAMS, "create:log_streams"); + + public static final OauthScope CREATE_CONNECTION_PROFILES = + new OauthScope(Value.CREATE_CONNECTION_PROFILES, "create:connection_profiles"); + + public static final OauthScope CREATE_FLOWS_VAULT_CONNECTIONS = + new OauthScope(Value.CREATE_FLOWS_VAULT_CONNECTIONS, "create:flows_vault_connections"); + + public static final OauthScope UPDATE_INTEGRATIONS = + new OauthScope(Value.UPDATE_INTEGRATIONS, "update:integrations"); + + public static final OauthScope DELETE_USER_ATTRIBUTE_PROFILES = + new OauthScope(Value.DELETE_USER_ATTRIBUTE_PROFILES, "delete:user_attribute_profiles"); + + public static final OauthScope READ_CLIENT_GRANTS = new OauthScope(Value.READ_CLIENT_GRANTS, "read:client_grants"); + + public static final OauthScope READ_ENTITLEMENTS = new OauthScope(Value.READ_ENTITLEMENTS, "read:entitlements"); + + public static final OauthScope CREATE_TOKEN_EXCHANGE_PROFILES = + new OauthScope(Value.CREATE_TOKEN_EXCHANGE_PROFILES, "create:token_exchange_profiles"); + + public static final OauthScope READ_LOGS_USERS = new OauthScope(Value.READ_LOGS_USERS, "read:logs_users"); + + public static final OauthScope READ_RULES = new OauthScope(Value.READ_RULES, "read:rules"); + + public static final OauthScope DELETE_GUARDIAN_ENROLLMENTS = + new OauthScope(Value.DELETE_GUARDIAN_ENROLLMENTS, "delete:guardian_enrollments"); + + public static final OauthScope UPDATE_CLIENT_KEYS = new OauthScope(Value.UPDATE_CLIENT_KEYS, "update:client_keys"); + + public static final OauthScope UPDATE_CURRENT_USER_IDENTITIES = + new OauthScope(Value.UPDATE_CURRENT_USER_IDENTITIES, "update:current_user_identities"); + + public static final OauthScope CREATE_ORGANIZATION_CONNECTIONS = + new OauthScope(Value.CREATE_ORGANIZATION_CONNECTIONS, "create:organization_connections"); + + public static final OauthScope READ_EMAIL_PROVIDER = + new OauthScope(Value.READ_EMAIL_PROVIDER, "read:email_provider"); + + public static final OauthScope READ_FLOWS_EXECUTIONS = + new OauthScope(Value.READ_FLOWS_EXECUTIONS, "read:flows_executions"); + + public static final OauthScope DELETE_CLIENTS = new OauthScope(Value.DELETE_CLIENTS, "delete:clients"); + + public static final OauthScope CREATE_ROLE_MEMBERS = + new OauthScope(Value.CREATE_ROLE_MEMBERS, "create:role_members"); + + public static final OauthScope CREATE_FLOWS = new OauthScope(Value.CREATE_FLOWS, "create:flows"); + + public static final OauthScope DELETE_HOOKS = new OauthScope(Value.DELETE_HOOKS, "delete:hooks"); + + public static final OauthScope READ_ORGANIZATIONS = new OauthScope(Value.READ_ORGANIZATIONS, "read:organizations"); + + public static final OauthScope DELETE_CURRENT_USER = + new OauthScope(Value.DELETE_CURRENT_USER, "delete:current_user"); + + public static final OauthScope DELETE_ROLES = new OauthScope(Value.DELETE_ROLES, "delete:roles"); + + public static final OauthScope UPDATE_PHONE_TEMPLATES = + new OauthScope(Value.UPDATE_PHONE_TEMPLATES, "update:phone_templates"); + + public static final OauthScope READ_CONNECTION_PROFILES = + new OauthScope(Value.READ_CONNECTION_PROFILES, "read:connection_profiles"); + + public static final OauthScope READ_STATS = new OauthScope(Value.READ_STATS, "read:stats"); + + public static final OauthScope READ_CUSTOM_DOMAINS = + new OauthScope(Value.READ_CUSTOM_DOMAINS, "read:custom_domains"); + + public static final OauthScope READ_TOKEN_EXCHANGE_PROFILES = + new OauthScope(Value.READ_TOKEN_EXCHANGE_PROFILES, "read:token_exchange_profiles"); + + public static final OauthScope READ_GUARDIAN_ENROLLMENTS = + new OauthScope(Value.READ_GUARDIAN_ENROLLMENTS, "read:guardian_enrollments"); + + public static final OauthScope UPDATE_ORGANIZATIONS = + new OauthScope(Value.UPDATE_ORGANIZATIONS, "update:organizations"); + + public static final OauthScope UPDATE_SELF_SERVICE_PROFILES = + new OauthScope(Value.UPDATE_SELF_SERVICE_PROFILES, "update:self_service_profiles"); + + public static final OauthScope CREATE_ORGANIZATION_CLIENT_GRANTS = + new OauthScope(Value.CREATE_ORGANIZATION_CLIENT_GRANTS, "create:organization_client_grants"); + + public static final OauthScope DELETE_FLOWS_EXECUTIONS = + new OauthScope(Value.DELETE_FLOWS_EXECUTIONS, "delete:flows_executions"); + + public static final OauthScope UPDATE_CONNECTIONS_KEYS = + new OauthScope(Value.UPDATE_CONNECTIONS_KEYS, "update:connections_keys"); + + public static final OauthScope UPDATE_EVENT_DELIVERIES = + new OauthScope(Value.UPDATE_EVENT_DELIVERIES, "update:event_deliveries"); + + public static final OauthScope DELETE_CURRENT_USER_DEVICE_CREDENTIALS = + new OauthScope(Value.DELETE_CURRENT_USER_DEVICE_CREDENTIALS, "delete:current_user_device_credentials"); + + public static final OauthScope READ_VDCS_TEMPLATES = + new OauthScope(Value.READ_VDCS_TEMPLATES, "read:vdcs_templates"); + + public static final OauthScope READ_PHONE_PROVIDERS = + new OauthScope(Value.READ_PHONE_PROVIDERS, "read:phone_providers"); + + public static final OauthScope CREATE_CLIENT_GRANTS = + new OauthScope(Value.CREATE_CLIENT_GRANTS, "create:client_grants"); + + public static final OauthScope DELETE_ANOMALY_BLOCKS = + new OauthScope(Value.DELETE_ANOMALY_BLOCKS, "delete:anomaly_blocks"); + + public static final OauthScope READ_CONNECTIONS_KEYS = + new OauthScope(Value.READ_CONNECTIONS_KEYS, "read:connections_keys"); + + public static final OauthScope READ_ACTIONS = new OauthScope(Value.READ_ACTIONS, "read:actions"); + + public static final OauthScope READ_RESOURCE_SERVERS = + new OauthScope(Value.READ_RESOURCE_SERVERS, "read:resource_servers"); + + public static final OauthScope UPDATE_TOKEN_EXCHANGE_PROFILES = + new OauthScope(Value.UPDATE_TOKEN_EXCHANGE_PROFILES, "update:token_exchange_profiles"); + + public static final OauthScope DELETE_ROLE_MEMBERS = + new OauthScope(Value.DELETE_ROLE_MEMBERS, "delete:role_members"); + + public static final OauthScope READ_ORGANIZATION_CONNECTIONS = + new OauthScope(Value.READ_ORGANIZATION_CONNECTIONS, "read:organization_connections"); + + public static final OauthScope UPDATE_PROMPTS = new OauthScope(Value.UPDATE_PROMPTS, "update:prompts"); + + public static final OauthScope CREATE_HOOKS = new OauthScope(Value.CREATE_HOOKS, "create:hooks"); + + public static final OauthScope READ_CHECKS = new OauthScope(Value.READ_CHECKS, "read:checks"); + + public static final OauthScope CREATE_CONNECTIONS = new OauthScope(Value.CREATE_CONNECTIONS, "create:connections"); + + public static final OauthScope CREATE_EMAIL_TEMPLATES = + new OauthScope(Value.CREATE_EMAIL_TEMPLATES, "create:email_templates"); + + public static final OauthScope UPDATE_ATTACK_PROTECTION = + new OauthScope(Value.UPDATE_ATTACK_PROTECTION, "update:attack_protection"); + + public static final OauthScope READ_MFA_POLICIES = new OauthScope(Value.READ_MFA_POLICIES, "read:mfa_policies"); + + public static final OauthScope UPDATE_HOOKS = new OauthScope(Value.UPDATE_HOOKS, "update:hooks"); + + public static final OauthScope DELETE_USERS = new OauthScope(Value.DELETE_USERS, "delete:users"); + + public static final OauthScope READ_ENTITY_COUNTS = new OauthScope(Value.READ_ENTITY_COUNTS, "read:entity_counts"); + + public static final OauthScope CREATE_CLIENT_CREDENTIALS = + new OauthScope(Value.CREATE_CLIENT_CREDENTIALS, "create:client_credentials"); + + public static final OauthScope UPDATE_CLIENT_CREDENTIALS = + new OauthScope(Value.UPDATE_CLIENT_CREDENTIALS, "update:client_credentials"); + + public static final OauthScope CREATE_ACTIONS = new OauthScope(Value.CREATE_ACTIONS, "create:actions"); + + public static final OauthScope DELETE_PHONE_TEMPLATES = + new OauthScope(Value.DELETE_PHONE_TEMPLATES, "delete:phone_templates"); + + public static final OauthScope READ_EVENT_DELIVERIES = + new OauthScope(Value.READ_EVENT_DELIVERIES, "read:event_deliveries"); + + public static final OauthScope READ_REFRESH_TOKENS = + new OauthScope(Value.READ_REFRESH_TOKENS, "read:refresh_tokens"); + + public static final OauthScope UPDATE_EMAIL_TEMPLATES = + new OauthScope(Value.UPDATE_EMAIL_TEMPLATES, "update:email_templates"); + + public static final OauthScope READ_OWNERS = new OauthScope(Value.READ_OWNERS, "read:owners"); + + public static final OauthScope DELETE_USER_APPLICATION_PASSWORDS = + new OauthScope(Value.DELETE_USER_APPLICATION_PASSWORDS, "delete:user_application_passwords"); + + public static final OauthScope READ_ROLE_MEMBERS = new OauthScope(Value.READ_ROLE_MEMBERS, "read:role_members"); + + public static final OauthScope READ_TENANT_INVITATIONS = + new OauthScope(Value.READ_TENANT_INVITATIONS, "read:tenant_invitations"); + + public static final OauthScope DELETE_TENANT_MEMBERS = + new OauthScope(Value.DELETE_TENANT_MEMBERS, "delete:tenant_members"); + + public static final OauthScope CREATE_ORGANIZATION_MEMBERS = + new OauthScope(Value.CREATE_ORGANIZATION_MEMBERS, "create:organization_members"); + + public static final OauthScope DELETE_OWNERS = new OauthScope(Value.DELETE_OWNERS, "delete:owners"); + + private final Value value; + + private final String string; + + OauthScope(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof OauthScope && this.string.equals(((OauthScope) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READ_AUTHENTICATION_METHODS: + return visitor.visitReadAuthenticationMethods(); + case UPDATE_USERS_APP_METADATA: + return visitor.visitUpdateUsersAppMetadata(); + case READ_ANOMALY_BLOCKS: + return visitor.visitReadAnomalyBlocks(); + case READ_CLIENT_SUMMARY: + return visitor.visitReadClientSummary(); + case READ_SCIM_CONFIG: + return visitor.visitReadScimConfig(); + case UPDATE_SCIM_CONFIG: + return visitor.visitUpdateScimConfig(); + case CREATE_RULES: + return visitor.visitCreateRules(); + case READ_EXTENSIONS: + return visitor.visitReadExtensions(); + case READ_PROMPTS: + return visitor.visitReadPrompts(); + case CREATE_ORGANIZATION_DISCOVERY_DOMAINS: + return visitor.visitCreateOrganizationDiscoveryDomains(); + case CREATE_PHONE_TEMPLATES: + return visitor.visitCreatePhoneTemplates(); + case UPDATE_PHONE_PROVIDERS: + return visitor.visitUpdatePhoneProviders(); + case CREATE_ROLES: + return visitor.visitCreateRoles(); + case CREATE_CONNECTIONS_KEYS: + return visitor.visitCreateConnectionsKeys(); + case UPDATE_RULES: + return visitor.visitUpdateRules(); + case DELETE_AUTHENTICATION_METHODS: + return visitor.visitDeleteAuthenticationMethods(); + case UPDATE_FLOWS_VAULT_CONNECTIONS: + return visitor.visitUpdateFlowsVaultConnections(); + case READ_ENCRYPTION_KEYS: + return visitor.visitReadEncryptionKeys(); + case DELETE_SESSIONS: + return visitor.visitDeleteSessions(); + case UPDATE_ACTIONS: + return visitor.visitUpdateActions(); + case CREATE_EVENT_STREAMS: + return visitor.visitCreateEventStreams(); + case DELETE_EVENT_STREAMS: + return visitor.visitDeleteEventStreams(); + case DELETE_FLOWS: + return visitor.visitDeleteFlows(); + case READ_USER_APPLICATION_PASSWORDS: + return visitor.visitReadUserApplicationPasswords(); + case DELETE_PHONE_PROVIDERS: + return visitor.visitDeletePhoneProviders(); + case DELETE_SELF_SERVICE_PROFILES: + return visitor.visitDeleteSelfServiceProfiles(); + case READ_TENANT_FEATURE_FLAGS: + return visitor.visitReadTenantFeatureFlags(); + case READ_INSIGHTS: + return visitor.visitReadInsights(); + case CREATE_SIGNING_KEYS: + return visitor.visitCreateSigningKeys(); + case UPDATE_SIGNING_KEYS: + return visitor.visitUpdateSigningKeys(); + case CREATE_USER_TICKETS: + return visitor.visitCreateUserTickets(); + case DELETE_GRANTS: + return visitor.visitDeleteGrants(); + case DELETE_REFRESH_TOKENS: + return visitor.visitDeleteRefreshTokens(); + case READ_RULES_CONFIGS: + return visitor.visitReadRulesConfigs(); + case CREATE_SELF_SERVICE_PROFILES: + return visitor.visitCreateSelfServiceProfiles(); + case READ_USER_IDP_TOKENS: + return visitor.visitReadUserIdpTokens(); + case READ_HOOKS: + return visitor.visitReadHooks(); + case READ_CUSTOM_SIGNING_KEYS: + return visitor.visitReadCustomSigningKeys(); + case CREATE_CURRENT_USER_DEVICE_CREDENTIALS: + return visitor.visitCreateCurrentUserDeviceCredentials(); + case DELETE_BRANDING: + return visitor.visitDeleteBranding(); + case DELETE_CLIENT_CREDENTIALS: + return visitor.visitDeleteClientCredentials(); + case UPDATE_TENANT_SETTINGS: + return visitor.visitUpdateTenantSettings(); + case READ_ORGANIZATION_INVITATIONS: + return visitor.visitReadOrganizationInvitations(); + case READ_GRANTS: + return visitor.visitReadGrants(); + case DELETE_ORGANIZATION_INVITATIONS: + return visitor.visitDeleteOrganizationInvitations(); + case UPDATE_RULES_CONFIGS: + return visitor.visitUpdateRulesConfigs(); + case UPDATE_CONNECTION_PROFILES: + return visitor.visitUpdateConnectionProfiles(); + case DELETE_ACTIONS: + return visitor.visitDeleteActions(); + case UPDATE_AUTHENTICATION_METHODS: + return visitor.visitUpdateAuthenticationMethods(); + case CREATE_VDCS_TEMPLATES: + return visitor.visitCreateVdcsTemplates(); + case READ_ATTACK_PROTECTION: + return visitor.visitReadAttackProtection(); + case CREATE_CUSTOM_DOMAINS: + return visitor.visitCreateCustomDomains(); + case DELETE_ORGANIZATION_CONNECTIONS: + return visitor.visitDeleteOrganizationConnections(); + case READ_CURRENT_USER: + return visitor.visitReadCurrentUser(); + case UPDATE_SHIELDS: + return visitor.visitUpdateShields(); + case READ_CLIENT_CREDENTIALS: + return visitor.visitReadClientCredentials(); + case CREATE_ORGANIZATIONS: + return visitor.visitCreateOrganizations(); + case READ_ORGANIZATIONS_SUMMARY: + return visitor.visitReadOrganizationsSummary(); + case READ_SCIM_TOKEN: + return visitor.visitReadScimToken(); + case DELETE_ORGANIZATIONS: + return visitor.visitDeleteOrganizations(); + case READ_CONNECTIONS: + return visitor.visitReadConnections(); + case READ_SIGNING_KEYS: + return visitor.visitReadSigningKeys(); + case DELETE_TENANT_INVITATIONS: + return visitor.visitDeleteTenantInvitations(); + case DELETE_FEDERATED_CONNECTIONS_TOKENS: + return visitor.visitDeleteFederatedConnectionsTokens(); + case DELETE_CONNECTIONS: + return visitor.visitDeleteConnections(); + case CREATE_USERS: + return visitor.visitCreateUsers(); + case UPDATE_RESOURCE_SERVERS: + return visitor.visitUpdateResourceServers(); + case READ_PHONE_TEMPLATES: + return visitor.visitReadPhoneTemplates(); + case UPDATE_ROLES: + return visitor.visitUpdateRoles(); + case CREATE_SSO_ACCESS_TICKETS: + return visitor.visitCreateSsoAccessTickets(); + case READ_SELF_SERVICE_PROFILE_CUSTOM_TEXTS: + return visitor.visitReadSelfServiceProfileCustomTexts(); + case DELETE_SCIM_TOKEN: + return visitor.visitDeleteScimToken(); + case DELETE_FORMS: + return visitor.visitDeleteForms(); + case READ_SELF_SERVICE_PROFILES: + return visitor.visitReadSelfServiceProfiles(); + case DELETE_RULES_CONFIGS: + return visitor.visitDeleteRulesConfigs(); + case CREATE_FORMS: + return visitor.visitCreateForms(); + case READ_USER_ATTRIBUTE_PROFILES: + return visitor.visitReadUserAttributeProfiles(); + case UPDATE_TENANT_MEMBERS: + return visitor.visitUpdateTenantMembers(); + case CREATE_AUTHENTICATION_METHODS: + return visitor.visitCreateAuthenticationMethods(); + case CREATE_PHONE_PROVIDERS: + return visitor.visitCreatePhoneProviders(); + case DELETE_ORGANIZATION_CLIENT_GRANTS: + return visitor.visitDeleteOrganizationClientGrants(); + case CREATE_SCIM_CONFIG: + return visitor.visitCreateScimConfig(); + case CREATE_CLIENTS: + return visitor.visitCreateClients(); + case UPDATE_USERS: + return visitor.visitUpdateUsers(); + case READ_ORGANIZATION_MEMBERS: + return visitor.visitReadOrganizationMembers(); + case UPDATE_EVENT_STREAMS: + return visitor.visitUpdateEventStreams(); + case READ_INTEGRATIONS: + return visitor.visitReadIntegrations(); + case CREATE_TENANT_INVITATIONS: + return visitor.visitCreateTenantInvitations(); + case UPDATE_CUSTOM_SIGNING_KEYS: + return visitor.visitUpdateCustomSigningKeys(); + case READ_LOG_STREAMS: + return visitor.visitReadLogStreams(); + case UPDATE_LOG_STREAMS: + return visitor.visitUpdateLogStreams(); + case READ_CLIENTS: + return visitor.visitReadClients(); + case READ_SHIELDS: + return visitor.visitReadShields(); + case DELETE_ENCRYPTION_KEYS: + return visitor.visitDeleteEncryptionKeys(); + case CREATE_SHIELDS: + return visitor.visitCreateShields(); + case UPDATE_USER_ATTRIBUTE_PROFILES: + return visitor.visitUpdateUserAttributeProfiles(); + case CREATE_CUSTOM_SIGNING_KEYS: + return visitor.visitCreateCustomSigningKeys(); + case DELETE_INTEGRATIONS: + return visitor.visitDeleteIntegrations(); + case READ_CLIENT_KEYS: + return visitor.visitReadClientKeys(); + case CREATE_EMAIL_PROVIDER: + return visitor.visitCreateEmailProvider(); + case UPDATE_NETWORK_ACLS: + return visitor.visitUpdateNetworkAcls(); + case DELETE_VDCS_TEMPLATES: + return visitor.visitDeleteVdcsTemplates(); + case CREATE_USER_APPLICATION_PASSWORDS: + return visitor.visitCreateUserApplicationPasswords(); + case READ_FLOWS: + return visitor.visitReadFlows(); + case READ_SESSIONS: + return visitor.visitReadSessions(); + case CREATE_TEST_EMAIL_DISPATCH: + return visitor.visitCreateTestEmailDispatch(); + case CREATE_ORGANIZATION_MEMBER_ROLES: + return visitor.visitCreateOrganizationMemberRoles(); + case DELETE_ORGANIZATION_MEMBERS: + return visitor.visitDeleteOrganizationMembers(); + case UPDATE_FORMS: + return visitor.visitUpdateForms(); + case CREATE_RESOURCE_SERVERS: + return visitor.visitCreateResourceServers(); + case READ_BRANDING: + return visitor.visitReadBranding(); + case UPDATE_MFA_POLICIES: + return visitor.visitUpdateMfaPolicies(); + case UPDATE_CURRENT_USER_METADATA: + return visitor.visitUpdateCurrentUserMetadata(); + case READ_FLOWS_VAULT_CONNECTIONS: + return visitor.visitReadFlowsVaultConnections(); + case READ_ORGANIZATION_CLIENT_GRANTS: + return visitor.visitReadOrganizationClientGrants(); + case UPDATE_CLIENTS: + return visitor.visitUpdateClients(); + case READ_SECURITY_METRICS: + return visitor.visitReadSecurityMetrics(); + case RUN_CHECKS: + return visitor.visitRunChecks(); + case DELETE_CLIENT_GRANTS: + return visitor.visitDeleteClientGrants(); + case UPDATE_DEVICE_CODES: + return visitor.visitUpdateDeviceCodes(); + case CREATE_ENCRYPTION_KEYS: + return visitor.visitCreateEncryptionKeys(); + case UPDATE_ENCRYPTION_KEYS: + return visitor.visitUpdateEncryptionKeys(); + case READ_ROLES: + return visitor.visitReadRoles(); + case READ_DEVICE_CREDENTIALS: + return visitor.visitReadDeviceCredentials(); + case DELETE_TOKEN_EXCHANGE_PROFILES: + return visitor.visitDeleteTokenExchangeProfiles(); + case UPDATE_ORGANIZATION_DISCOVERY_DOMAINS: + return visitor.visitUpdateOrganizationDiscoveryDomains(); + case READ_LOGS: + return visitor.visitReadLogs(); + case UPDATE_EMAIL_PROVIDER: + return visitor.visitUpdateEmailProvider(); + case READ_TENANT_MEMBERS: + return visitor.visitReadTenantMembers(); + case DELETE_FLOWS_VAULT_CONNECTIONS: + return visitor.visitDeleteFlowsVaultConnections(); + case DELETE_NETWORK_ACLS: + return visitor.visitDeleteNetworkAcls(); + case UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS: + return visitor.visitUpdateSelfServiceProfileCustomTexts(); + case UPDATE_CLIENT_GRANTS: + return visitor.visitUpdateClientGrants(); + case READ_EMAIL_TEMPLATES: + return visitor.visitReadEmailTemplates(); + case UPDATE_VDCS_TEMPLATES: + return visitor.visitUpdateVdcsTemplates(); + case DELETE_TENANTS: + return visitor.visitDeleteTenants(); + case CREATE_USER_ATTRIBUTE_PROFILES: + return visitor.visitCreateUserAttributeProfiles(); + case CREATE_ORGANIZATION_INVITATIONS: + return visitor.visitCreateOrganizationInvitations(); + case DELETE_LOG_STREAMS: + return visitor.visitDeleteLogStreams(); + case DELETE_CUSTOM_SIGNING_KEYS: + return visitor.visitDeleteCustomSigningKeys(); + case READ_DEVICE_CODES: + return visitor.visitReadDeviceCodes(); + case DELETE_RESOURCE_SERVERS: + return visitor.visitDeleteResourceServers(); + case UPDATE_GUARDIAN_FACTORS: + return visitor.visitUpdateGuardianFactors(); + case READ_USERS: + return visitor.visitReadUsers(); + case DELETE_ORGANIZATION_MEMBER_ROLES: + return visitor.visitDeleteOrganizationMemberRoles(); + case UPDATE_BRANDING: + return visitor.visitUpdateBranding(); + case CREATE_INTEGRATIONS: + return visitor.visitCreateIntegrations(); + case DELETE_SSO_ACCESS_TICKETS: + return visitor.visitDeleteSsoAccessTickets(); + case UPDATE_ORGANIZATION_CONNECTIONS: + return visitor.visitUpdateOrganizationConnections(); + case UPDATE_CUSTOM_DOMAINS: + return visitor.visitUpdateCustomDomains(); + case READ_NETWORK_ACLS: + return visitor.visitReadNetworkAcls(); + case DELETE_EMAIL_PROVIDER: + return visitor.visitDeleteEmailProvider(); + case READ_FORMS: + return visitor.visitReadForms(); + case CREATE_GUARDIAN_ENROLLMENT_TICKETS: + return visitor.visitCreateGuardianEnrollmentTickets(); + case READ_EVENT_STREAMS: + return visitor.visitReadEventStreams(); + case CREATE_NETWORK_ACLS: + return visitor.visitCreateNetworkAcls(); + case CREATE_SCIM_TOKEN: + return visitor.visitCreateScimToken(); + case DELETE_CUSTOM_DOMAINS: + return visitor.visitDeleteCustomDomains(); + case DELETE_CONNECTION_PROFILES: + return visitor.visitDeleteConnectionProfiles(); + case UPDATE_CONNECTIONS: + return visitor.visitUpdateConnections(); + case DELETE_DEVICE_CREDENTIALS: + return visitor.visitDeleteDeviceCredentials(); + case READ_GUARDIAN_FACTORS: + return visitor.visitReadGuardianFactors(); + case READ_TENANT_SETTINGS: + return visitor.visitReadTenantSettings(); + case DELETE_SCIM_CONFIG: + return visitor.visitDeleteScimConfig(); + case DELETE_RULES: + return visitor.visitDeleteRules(); + case UPDATE_TENANT_INVITATIONS: + return visitor.visitUpdateTenantInvitations(); + case READ_ORGANIZATION_MEMBER_ROLES: + return visitor.visitReadOrganizationMemberRoles(); + case UPDATE_FLOWS: + return visitor.visitUpdateFlows(); + case READ_FEDERATED_CONNECTIONS_TOKENS: + return visitor.visitReadFederatedConnectionsTokens(); + case CREATE_LOG_STREAMS: + return visitor.visitCreateLogStreams(); + case CREATE_CONNECTION_PROFILES: + return visitor.visitCreateConnectionProfiles(); + case CREATE_FLOWS_VAULT_CONNECTIONS: + return visitor.visitCreateFlowsVaultConnections(); + case UPDATE_INTEGRATIONS: + return visitor.visitUpdateIntegrations(); + case DELETE_USER_ATTRIBUTE_PROFILES: + return visitor.visitDeleteUserAttributeProfiles(); + case READ_CLIENT_GRANTS: + return visitor.visitReadClientGrants(); + case READ_ENTITLEMENTS: + return visitor.visitReadEntitlements(); + case CREATE_TOKEN_EXCHANGE_PROFILES: + return visitor.visitCreateTokenExchangeProfiles(); + case READ_LOGS_USERS: + return visitor.visitReadLogsUsers(); + case READ_RULES: + return visitor.visitReadRules(); + case DELETE_GUARDIAN_ENROLLMENTS: + return visitor.visitDeleteGuardianEnrollments(); + case UPDATE_CLIENT_KEYS: + return visitor.visitUpdateClientKeys(); + case UPDATE_CURRENT_USER_IDENTITIES: + return visitor.visitUpdateCurrentUserIdentities(); + case CREATE_ORGANIZATION_CONNECTIONS: + return visitor.visitCreateOrganizationConnections(); + case READ_EMAIL_PROVIDER: + return visitor.visitReadEmailProvider(); + case READ_FLOWS_EXECUTIONS: + return visitor.visitReadFlowsExecutions(); + case DELETE_CLIENTS: + return visitor.visitDeleteClients(); + case CREATE_ROLE_MEMBERS: + return visitor.visitCreateRoleMembers(); + case CREATE_FLOWS: + return visitor.visitCreateFlows(); + case DELETE_HOOKS: + return visitor.visitDeleteHooks(); + case READ_ORGANIZATIONS: + return visitor.visitReadOrganizations(); + case DELETE_CURRENT_USER: + return visitor.visitDeleteCurrentUser(); + case DELETE_ROLES: + return visitor.visitDeleteRoles(); + case UPDATE_PHONE_TEMPLATES: + return visitor.visitUpdatePhoneTemplates(); + case READ_CONNECTION_PROFILES: + return visitor.visitReadConnectionProfiles(); + case READ_STATS: + return visitor.visitReadStats(); + case READ_CUSTOM_DOMAINS: + return visitor.visitReadCustomDomains(); + case READ_TOKEN_EXCHANGE_PROFILES: + return visitor.visitReadTokenExchangeProfiles(); + case READ_GUARDIAN_ENROLLMENTS: + return visitor.visitReadGuardianEnrollments(); + case UPDATE_ORGANIZATIONS: + return visitor.visitUpdateOrganizations(); + case UPDATE_SELF_SERVICE_PROFILES: + return visitor.visitUpdateSelfServiceProfiles(); + case CREATE_ORGANIZATION_CLIENT_GRANTS: + return visitor.visitCreateOrganizationClientGrants(); + case DELETE_FLOWS_EXECUTIONS: + return visitor.visitDeleteFlowsExecutions(); + case UPDATE_CONNECTIONS_KEYS: + return visitor.visitUpdateConnectionsKeys(); + case UPDATE_EVENT_DELIVERIES: + return visitor.visitUpdateEventDeliveries(); + case DELETE_CURRENT_USER_DEVICE_CREDENTIALS: + return visitor.visitDeleteCurrentUserDeviceCredentials(); + case READ_VDCS_TEMPLATES: + return visitor.visitReadVdcsTemplates(); + case READ_PHONE_PROVIDERS: + return visitor.visitReadPhoneProviders(); + case CREATE_CLIENT_GRANTS: + return visitor.visitCreateClientGrants(); + case DELETE_ANOMALY_BLOCKS: + return visitor.visitDeleteAnomalyBlocks(); + case READ_CONNECTIONS_KEYS: + return visitor.visitReadConnectionsKeys(); + case READ_ACTIONS: + return visitor.visitReadActions(); + case READ_RESOURCE_SERVERS: + return visitor.visitReadResourceServers(); + case UPDATE_TOKEN_EXCHANGE_PROFILES: + return visitor.visitUpdateTokenExchangeProfiles(); + case DELETE_ROLE_MEMBERS: + return visitor.visitDeleteRoleMembers(); + case READ_ORGANIZATION_CONNECTIONS: + return visitor.visitReadOrganizationConnections(); + case UPDATE_PROMPTS: + return visitor.visitUpdatePrompts(); + case CREATE_HOOKS: + return visitor.visitCreateHooks(); + case READ_CHECKS: + return visitor.visitReadChecks(); + case CREATE_CONNECTIONS: + return visitor.visitCreateConnections(); + case CREATE_EMAIL_TEMPLATES: + return visitor.visitCreateEmailTemplates(); + case UPDATE_ATTACK_PROTECTION: + return visitor.visitUpdateAttackProtection(); + case READ_MFA_POLICIES: + return visitor.visitReadMfaPolicies(); + case UPDATE_HOOKS: + return visitor.visitUpdateHooks(); + case DELETE_USERS: + return visitor.visitDeleteUsers(); + case READ_ENTITY_COUNTS: + return visitor.visitReadEntityCounts(); + case CREATE_CLIENT_CREDENTIALS: + return visitor.visitCreateClientCredentials(); + case UPDATE_CLIENT_CREDENTIALS: + return visitor.visitUpdateClientCredentials(); + case CREATE_ACTIONS: + return visitor.visitCreateActions(); + case DELETE_PHONE_TEMPLATES: + return visitor.visitDeletePhoneTemplates(); + case READ_EVENT_DELIVERIES: + return visitor.visitReadEventDeliveries(); + case READ_REFRESH_TOKENS: + return visitor.visitReadRefreshTokens(); + case UPDATE_EMAIL_TEMPLATES: + return visitor.visitUpdateEmailTemplates(); + case READ_OWNERS: + return visitor.visitReadOwners(); + case DELETE_USER_APPLICATION_PASSWORDS: + return visitor.visitDeleteUserApplicationPasswords(); + case READ_ROLE_MEMBERS: + return visitor.visitReadRoleMembers(); + case READ_TENANT_INVITATIONS: + return visitor.visitReadTenantInvitations(); + case DELETE_TENANT_MEMBERS: + return visitor.visitDeleteTenantMembers(); + case CREATE_ORGANIZATION_MEMBERS: + return visitor.visitCreateOrganizationMembers(); + case DELETE_OWNERS: + return visitor.visitDeleteOwners(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OauthScope valueOf(String value) { + switch (value) { + case "read:authentication_methods": + return READ_AUTHENTICATION_METHODS; + case "update:users_app_metadata": + return UPDATE_USERS_APP_METADATA; + case "read:anomaly_blocks": + return READ_ANOMALY_BLOCKS; + case "read:client_summary": + return READ_CLIENT_SUMMARY; + case "read:scim_config": + return READ_SCIM_CONFIG; + case "update:scim_config": + return UPDATE_SCIM_CONFIG; + case "create:rules": + return CREATE_RULES; + case "read:extensions": + return READ_EXTENSIONS; + case "read:prompts": + return READ_PROMPTS; + case "create:organization_discovery_domains": + return CREATE_ORGANIZATION_DISCOVERY_DOMAINS; + case "create:phone_templates": + return CREATE_PHONE_TEMPLATES; + case "update:phone_providers": + return UPDATE_PHONE_PROVIDERS; + case "create:roles": + return CREATE_ROLES; + case "create:connections_keys": + return CREATE_CONNECTIONS_KEYS; + case "update:rules": + return UPDATE_RULES; + case "delete:authentication_methods": + return DELETE_AUTHENTICATION_METHODS; + case "update:flows_vault_connections": + return UPDATE_FLOWS_VAULT_CONNECTIONS; + case "read:encryption_keys": + return READ_ENCRYPTION_KEYS; + case "delete:sessions": + return DELETE_SESSIONS; + case "update:actions": + return UPDATE_ACTIONS; + case "create:event_streams": + return CREATE_EVENT_STREAMS; + case "delete:event_streams": + return DELETE_EVENT_STREAMS; + case "delete:flows": + return DELETE_FLOWS; + case "read:user_application_passwords": + return READ_USER_APPLICATION_PASSWORDS; + case "delete:phone_providers": + return DELETE_PHONE_PROVIDERS; + case "delete:self_service_profiles": + return DELETE_SELF_SERVICE_PROFILES; + case "read:tenant_feature_flags": + return READ_TENANT_FEATURE_FLAGS; + case "read:insights": + return READ_INSIGHTS; + case "create:signing_keys": + return CREATE_SIGNING_KEYS; + case "update:signing_keys": + return UPDATE_SIGNING_KEYS; + case "create:user_tickets": + return CREATE_USER_TICKETS; + case "delete:grants": + return DELETE_GRANTS; + case "delete:refresh_tokens": + return DELETE_REFRESH_TOKENS; + case "read:rules_configs": + return READ_RULES_CONFIGS; + case "create:self_service_profiles": + return CREATE_SELF_SERVICE_PROFILES; + case "read:user_idp_tokens": + return READ_USER_IDP_TOKENS; + case "read:hooks": + return READ_HOOKS; + case "read:custom_signing_keys": + return READ_CUSTOM_SIGNING_KEYS; + case "create:current_user_device_credentials": + return CREATE_CURRENT_USER_DEVICE_CREDENTIALS; + case "delete:branding": + return DELETE_BRANDING; + case "delete:client_credentials": + return DELETE_CLIENT_CREDENTIALS; + case "update:tenant_settings": + return UPDATE_TENANT_SETTINGS; + case "read:organization_invitations": + return READ_ORGANIZATION_INVITATIONS; + case "read:grants": + return READ_GRANTS; + case "delete:organization_invitations": + return DELETE_ORGANIZATION_INVITATIONS; + case "update:rules_configs": + return UPDATE_RULES_CONFIGS; + case "update:connection_profiles": + return UPDATE_CONNECTION_PROFILES; + case "delete:actions": + return DELETE_ACTIONS; + case "update:authentication_methods": + return UPDATE_AUTHENTICATION_METHODS; + case "create:vdcs_templates": + return CREATE_VDCS_TEMPLATES; + case "read:attack_protection": + return READ_ATTACK_PROTECTION; + case "create:custom_domains": + return CREATE_CUSTOM_DOMAINS; + case "delete:organization_connections": + return DELETE_ORGANIZATION_CONNECTIONS; + case "read:current_user": + return READ_CURRENT_USER; + case "update:shields": + return UPDATE_SHIELDS; + case "read:client_credentials": + return READ_CLIENT_CREDENTIALS; + case "create:organizations": + return CREATE_ORGANIZATIONS; + case "read:organizations_summary": + return READ_ORGANIZATIONS_SUMMARY; + case "read:scim_token": + return READ_SCIM_TOKEN; + case "delete:organizations": + return DELETE_ORGANIZATIONS; + case "read:connections": + return READ_CONNECTIONS; + case "read:signing_keys": + return READ_SIGNING_KEYS; + case "delete:tenant_invitations": + return DELETE_TENANT_INVITATIONS; + case "delete:federated_connections_tokens": + return DELETE_FEDERATED_CONNECTIONS_TOKENS; + case "delete:connections": + return DELETE_CONNECTIONS; + case "create:users": + return CREATE_USERS; + case "update:resource_servers": + return UPDATE_RESOURCE_SERVERS; + case "read:phone_templates": + return READ_PHONE_TEMPLATES; + case "update:roles": + return UPDATE_ROLES; + case "create:sso_access_tickets": + return CREATE_SSO_ACCESS_TICKETS; + case "read:self_service_profile_custom_texts": + return READ_SELF_SERVICE_PROFILE_CUSTOM_TEXTS; + case "delete:scim_token": + return DELETE_SCIM_TOKEN; + case "delete:forms": + return DELETE_FORMS; + case "read:self_service_profiles": + return READ_SELF_SERVICE_PROFILES; + case "delete:rules_configs": + return DELETE_RULES_CONFIGS; + case "create:forms": + return CREATE_FORMS; + case "read:user_attribute_profiles": + return READ_USER_ATTRIBUTE_PROFILES; + case "update:tenant_members": + return UPDATE_TENANT_MEMBERS; + case "create:authentication_methods": + return CREATE_AUTHENTICATION_METHODS; + case "create:phone_providers": + return CREATE_PHONE_PROVIDERS; + case "delete:organization_client_grants": + return DELETE_ORGANIZATION_CLIENT_GRANTS; + case "create:scim_config": + return CREATE_SCIM_CONFIG; + case "create:clients": + return CREATE_CLIENTS; + case "update:users": + return UPDATE_USERS; + case "read:organization_members": + return READ_ORGANIZATION_MEMBERS; + case "update:event_streams": + return UPDATE_EVENT_STREAMS; + case "read:integrations": + return READ_INTEGRATIONS; + case "create:tenant_invitations": + return CREATE_TENANT_INVITATIONS; + case "update:custom_signing_keys": + return UPDATE_CUSTOM_SIGNING_KEYS; + case "read:log_streams": + return READ_LOG_STREAMS; + case "update:log_streams": + return UPDATE_LOG_STREAMS; + case "read:clients": + return READ_CLIENTS; + case "read:shields": + return READ_SHIELDS; + case "delete:encryption_keys": + return DELETE_ENCRYPTION_KEYS; + case "create:shields": + return CREATE_SHIELDS; + case "update:user_attribute_profiles": + return UPDATE_USER_ATTRIBUTE_PROFILES; + case "create:custom_signing_keys": + return CREATE_CUSTOM_SIGNING_KEYS; + case "delete:integrations": + return DELETE_INTEGRATIONS; + case "read:client_keys": + return READ_CLIENT_KEYS; + case "create:email_provider": + return CREATE_EMAIL_PROVIDER; + case "update:network_acls": + return UPDATE_NETWORK_ACLS; + case "delete:vdcs_templates": + return DELETE_VDCS_TEMPLATES; + case "create:user_application_passwords": + return CREATE_USER_APPLICATION_PASSWORDS; + case "read:flows": + return READ_FLOWS; + case "read:sessions": + return READ_SESSIONS; + case "create:test_email_dispatch": + return CREATE_TEST_EMAIL_DISPATCH; + case "create:organization_member_roles": + return CREATE_ORGANIZATION_MEMBER_ROLES; + case "delete:organization_members": + return DELETE_ORGANIZATION_MEMBERS; + case "update:forms": + return UPDATE_FORMS; + case "create:resource_servers": + return CREATE_RESOURCE_SERVERS; + case "read:branding": + return READ_BRANDING; + case "update:mfa_policies": + return UPDATE_MFA_POLICIES; + case "update:current_user_metadata": + return UPDATE_CURRENT_USER_METADATA; + case "read:flows_vault_connections": + return READ_FLOWS_VAULT_CONNECTIONS; + case "read:organization_client_grants": + return READ_ORGANIZATION_CLIENT_GRANTS; + case "update:clients": + return UPDATE_CLIENTS; + case "read:security_metrics": + return READ_SECURITY_METRICS; + case "run:checks": + return RUN_CHECKS; + case "delete:client_grants": + return DELETE_CLIENT_GRANTS; + case "update:device_codes": + return UPDATE_DEVICE_CODES; + case "create:encryption_keys": + return CREATE_ENCRYPTION_KEYS; + case "update:encryption_keys": + return UPDATE_ENCRYPTION_KEYS; + case "read:roles": + return READ_ROLES; + case "read:device_credentials": + return READ_DEVICE_CREDENTIALS; + case "delete:token_exchange_profiles": + return DELETE_TOKEN_EXCHANGE_PROFILES; + case "update:organization_discovery_domains": + return UPDATE_ORGANIZATION_DISCOVERY_DOMAINS; + case "read:logs": + return READ_LOGS; + case "update:email_provider": + return UPDATE_EMAIL_PROVIDER; + case "read:tenant_members": + return READ_TENANT_MEMBERS; + case "delete:flows_vault_connections": + return DELETE_FLOWS_VAULT_CONNECTIONS; + case "delete:network_acls": + return DELETE_NETWORK_ACLS; + case "update:self_service_profile_custom_texts": + return UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS; + case "update:client_grants": + return UPDATE_CLIENT_GRANTS; + case "read:email_templates": + return READ_EMAIL_TEMPLATES; + case "update:vdcs_templates": + return UPDATE_VDCS_TEMPLATES; + case "delete:tenants": + return DELETE_TENANTS; + case "create:user_attribute_profiles": + return CREATE_USER_ATTRIBUTE_PROFILES; + case "create:organization_invitations": + return CREATE_ORGANIZATION_INVITATIONS; + case "delete:log_streams": + return DELETE_LOG_STREAMS; + case "delete:custom_signing_keys": + return DELETE_CUSTOM_SIGNING_KEYS; + case "read:device_codes": + return READ_DEVICE_CODES; + case "delete:resource_servers": + return DELETE_RESOURCE_SERVERS; + case "update:guardian_factors": + return UPDATE_GUARDIAN_FACTORS; + case "read:users": + return READ_USERS; + case "delete:organization_member_roles": + return DELETE_ORGANIZATION_MEMBER_ROLES; + case "update:branding": + return UPDATE_BRANDING; + case "create:integrations": + return CREATE_INTEGRATIONS; + case "delete:sso_access_tickets": + return DELETE_SSO_ACCESS_TICKETS; + case "update:organization_connections": + return UPDATE_ORGANIZATION_CONNECTIONS; + case "update:custom_domains": + return UPDATE_CUSTOM_DOMAINS; + case "read:network_acls": + return READ_NETWORK_ACLS; + case "delete:email_provider": + return DELETE_EMAIL_PROVIDER; + case "read:forms": + return READ_FORMS; + case "create:guardian_enrollment_tickets": + return CREATE_GUARDIAN_ENROLLMENT_TICKETS; + case "read:event_streams": + return READ_EVENT_STREAMS; + case "create:network_acls": + return CREATE_NETWORK_ACLS; + case "create:scim_token": + return CREATE_SCIM_TOKEN; + case "delete:custom_domains": + return DELETE_CUSTOM_DOMAINS; + case "delete:connection_profiles": + return DELETE_CONNECTION_PROFILES; + case "update:connections": + return UPDATE_CONNECTIONS; + case "delete:device_credentials": + return DELETE_DEVICE_CREDENTIALS; + case "read:guardian_factors": + return READ_GUARDIAN_FACTORS; + case "read:tenant_settings": + return READ_TENANT_SETTINGS; + case "delete:scim_config": + return DELETE_SCIM_CONFIG; + case "delete:rules": + return DELETE_RULES; + case "update:tenant_invitations": + return UPDATE_TENANT_INVITATIONS; + case "read:organization_member_roles": + return READ_ORGANIZATION_MEMBER_ROLES; + case "update:flows": + return UPDATE_FLOWS; + case "read:federated_connections_tokens": + return READ_FEDERATED_CONNECTIONS_TOKENS; + case "create:log_streams": + return CREATE_LOG_STREAMS; + case "create:connection_profiles": + return CREATE_CONNECTION_PROFILES; + case "create:flows_vault_connections": + return CREATE_FLOWS_VAULT_CONNECTIONS; + case "update:integrations": + return UPDATE_INTEGRATIONS; + case "delete:user_attribute_profiles": + return DELETE_USER_ATTRIBUTE_PROFILES; + case "read:client_grants": + return READ_CLIENT_GRANTS; + case "read:entitlements": + return READ_ENTITLEMENTS; + case "create:token_exchange_profiles": + return CREATE_TOKEN_EXCHANGE_PROFILES; + case "read:logs_users": + return READ_LOGS_USERS; + case "read:rules": + return READ_RULES; + case "delete:guardian_enrollments": + return DELETE_GUARDIAN_ENROLLMENTS; + case "update:client_keys": + return UPDATE_CLIENT_KEYS; + case "update:current_user_identities": + return UPDATE_CURRENT_USER_IDENTITIES; + case "create:organization_connections": + return CREATE_ORGANIZATION_CONNECTIONS; + case "read:email_provider": + return READ_EMAIL_PROVIDER; + case "read:flows_executions": + return READ_FLOWS_EXECUTIONS; + case "delete:clients": + return DELETE_CLIENTS; + case "create:role_members": + return CREATE_ROLE_MEMBERS; + case "create:flows": + return CREATE_FLOWS; + case "delete:hooks": + return DELETE_HOOKS; + case "read:organizations": + return READ_ORGANIZATIONS; + case "delete:current_user": + return DELETE_CURRENT_USER; + case "delete:roles": + return DELETE_ROLES; + case "update:phone_templates": + return UPDATE_PHONE_TEMPLATES; + case "read:connection_profiles": + return READ_CONNECTION_PROFILES; + case "read:stats": + return READ_STATS; + case "read:custom_domains": + return READ_CUSTOM_DOMAINS; + case "read:token_exchange_profiles": + return READ_TOKEN_EXCHANGE_PROFILES; + case "read:guardian_enrollments": + return READ_GUARDIAN_ENROLLMENTS; + case "update:organizations": + return UPDATE_ORGANIZATIONS; + case "update:self_service_profiles": + return UPDATE_SELF_SERVICE_PROFILES; + case "create:organization_client_grants": + return CREATE_ORGANIZATION_CLIENT_GRANTS; + case "delete:flows_executions": + return DELETE_FLOWS_EXECUTIONS; + case "update:connections_keys": + return UPDATE_CONNECTIONS_KEYS; + case "update:event_deliveries": + return UPDATE_EVENT_DELIVERIES; + case "delete:current_user_device_credentials": + return DELETE_CURRENT_USER_DEVICE_CREDENTIALS; + case "read:vdcs_templates": + return READ_VDCS_TEMPLATES; + case "read:phone_providers": + return READ_PHONE_PROVIDERS; + case "create:client_grants": + return CREATE_CLIENT_GRANTS; + case "delete:anomaly_blocks": + return DELETE_ANOMALY_BLOCKS; + case "read:connections_keys": + return READ_CONNECTIONS_KEYS; + case "read:actions": + return READ_ACTIONS; + case "read:resource_servers": + return READ_RESOURCE_SERVERS; + case "update:token_exchange_profiles": + return UPDATE_TOKEN_EXCHANGE_PROFILES; + case "delete:role_members": + return DELETE_ROLE_MEMBERS; + case "read:organization_connections": + return READ_ORGANIZATION_CONNECTIONS; + case "update:prompts": + return UPDATE_PROMPTS; + case "create:hooks": + return CREATE_HOOKS; + case "read:checks": + return READ_CHECKS; + case "create:connections": + return CREATE_CONNECTIONS; + case "create:email_templates": + return CREATE_EMAIL_TEMPLATES; + case "update:attack_protection": + return UPDATE_ATTACK_PROTECTION; + case "read:mfa_policies": + return READ_MFA_POLICIES; + case "update:hooks": + return UPDATE_HOOKS; + case "delete:users": + return DELETE_USERS; + case "read:entity_counts": + return READ_ENTITY_COUNTS; + case "create:client_credentials": + return CREATE_CLIENT_CREDENTIALS; + case "update:client_credentials": + return UPDATE_CLIENT_CREDENTIALS; + case "create:actions": + return CREATE_ACTIONS; + case "delete:phone_templates": + return DELETE_PHONE_TEMPLATES; + case "read:event_deliveries": + return READ_EVENT_DELIVERIES; + case "read:refresh_tokens": + return READ_REFRESH_TOKENS; + case "update:email_templates": + return UPDATE_EMAIL_TEMPLATES; + case "read:owners": + return READ_OWNERS; + case "delete:user_application_passwords": + return DELETE_USER_APPLICATION_PASSWORDS; + case "read:role_members": + return READ_ROLE_MEMBERS; + case "read:tenant_invitations": + return READ_TENANT_INVITATIONS; + case "delete:tenant_members": + return DELETE_TENANT_MEMBERS; + case "create:organization_members": + return CREATE_ORGANIZATION_MEMBERS; + case "delete:owners": + return DELETE_OWNERS; + default: + return new OauthScope(Value.UNKNOWN, value); + } + } + + public enum Value { + READ_ACTIONS, + + CREATE_ACTIONS, + + DELETE_ACTIONS, + + UPDATE_ACTIONS, + + READ_ANOMALY_BLOCKS, + + DELETE_ANOMALY_BLOCKS, + + READ_SHIELDS, + + CREATE_SHIELDS, + + UPDATE_SHIELDS, + + READ_ATTACK_PROTECTION, + + UPDATE_ATTACK_PROTECTION, + + READ_BRANDING, + + UPDATE_BRANDING, + + READ_PHONE_PROVIDERS, + + CREATE_PHONE_PROVIDERS, + + UPDATE_PHONE_PROVIDERS, + + DELETE_PHONE_PROVIDERS, + + READ_PHONE_TEMPLATES, + + CREATE_PHONE_TEMPLATES, + + UPDATE_PHONE_TEMPLATES, + + DELETE_PHONE_TEMPLATES, + + DELETE_BRANDING, + + READ_CLIENT_GRANTS, + + CREATE_CLIENT_GRANTS, + + UPDATE_CLIENT_GRANTS, + + DELETE_CLIENT_GRANTS, + + READ_ORGANIZATION_CLIENT_GRANTS, + + READ_CLIENTS, + + READ_CLIENT_KEYS, + + READ_CLIENT_CREDENTIALS, + + READ_CLIENT_SUMMARY, + + CREATE_CLIENTS, + + CREATE_CLIENT_CREDENTIALS, + + UPDATE_CLIENT_CREDENTIALS, + + DELETE_CLIENT_CREDENTIALS, + + UPDATE_CLIENTS, + + UPDATE_CLIENT_KEYS, + + DELETE_CLIENTS, + + READ_CONNECTIONS, + + READ_CONNECTION_PROFILES, + + CREATE_CONNECTION_PROFILES, + + UPDATE_CONNECTION_PROFILES, + + DELETE_CONNECTION_PROFILES, + + CREATE_CONNECTIONS, + + UPDATE_CONNECTIONS, + + DELETE_CONNECTIONS, + + READ_USERS, + + READ_CONNECTIONS_KEYS, + + CREATE_CONNECTIONS_KEYS, + + UPDATE_CONNECTIONS_KEYS, + + READ_SCIM_CONFIG, + + CREATE_SCIM_CONFIG, + + UPDATE_SCIM_CONFIG, + + DELETE_SCIM_CONFIG, + + READ_SCIM_TOKEN, + + CREATE_SCIM_TOKEN, + + DELETE_SCIM_TOKEN, + + DELETE_USERS, + + READ_CUSTOM_DOMAINS, + + CREATE_CUSTOM_DOMAINS, + + UPDATE_CUSTOM_DOMAINS, + + DELETE_CUSTOM_DOMAINS, + + READ_DEVICE_CREDENTIALS, + + CREATE_CURRENT_USER_DEVICE_CREDENTIALS, + + DELETE_DEVICE_CREDENTIALS, + + DELETE_CURRENT_USER_DEVICE_CREDENTIALS, + + UPDATE_DEVICE_CODES, + + READ_DEVICE_CODES, + + CREATE_TEST_EMAIL_DISPATCH, + + CREATE_EMAIL_TEMPLATES, + + READ_EMAIL_TEMPLATES, + + UPDATE_EMAIL_TEMPLATES, + + READ_EMAIL_PROVIDER, + + CREATE_EMAIL_PROVIDER, + + UPDATE_EMAIL_PROVIDER, + + DELETE_EMAIL_PROVIDER, + + READ_ENTITLEMENTS, + + READ_EVENT_STREAMS, + + CREATE_EVENT_STREAMS, + + UPDATE_EVENT_STREAMS, + + DELETE_EVENT_STREAMS, + + READ_EVENT_DELIVERIES, + + UPDATE_EVENT_DELIVERIES, + + READ_EXTENSIONS, + + READ_FLOWS, + + CREATE_FLOWS, + + READ_FLOWS_VAULT_CONNECTIONS, + + CREATE_FLOWS_VAULT_CONNECTIONS, + + UPDATE_FLOWS_VAULT_CONNECTIONS, + + DELETE_FLOWS_VAULT_CONNECTIONS, + + READ_FLOWS_EXECUTIONS, + + DELETE_FLOWS_EXECUTIONS, + + UPDATE_FLOWS, + + DELETE_FLOWS, + + READ_FORMS, + + CREATE_FORMS, + + UPDATE_FORMS, + + DELETE_FORMS, + + READ_GRANTS, + + DELETE_GRANTS, + + CREATE_GUARDIAN_ENROLLMENT_TICKETS, + + READ_GUARDIAN_ENROLLMENTS, + + DELETE_GUARDIAN_ENROLLMENTS, + + READ_GUARDIAN_FACTORS, + + UPDATE_GUARDIAN_FACTORS, + + READ_MFA_POLICIES, + + UPDATE_MFA_POLICIES, + + READ_HOOKS, + + CREATE_HOOKS, + + UPDATE_HOOKS, + + DELETE_HOOKS, + + READ_INSIGHTS, + + READ_STATS, + + READ_INTEGRATIONS, + + CREATE_INTEGRATIONS, + + UPDATE_INTEGRATIONS, + + DELETE_INTEGRATIONS, + + CREATE_USERS, + + UPDATE_USERS, + + READ_CUSTOM_SIGNING_KEYS, + + CREATE_CUSTOM_SIGNING_KEYS, + + UPDATE_CUSTOM_SIGNING_KEYS, + + DELETE_CUSTOM_SIGNING_KEYS, + + READ_ENCRYPTION_KEYS, + + CREATE_ENCRYPTION_KEYS, + + UPDATE_ENCRYPTION_KEYS, + + DELETE_ENCRYPTION_KEYS, + + READ_SIGNING_KEYS, + + CREATE_SIGNING_KEYS, + + UPDATE_SIGNING_KEYS, + + READ_LOG_STREAMS, + + CREATE_LOG_STREAMS, + + UPDATE_LOG_STREAMS, + + DELETE_LOG_STREAMS, + + READ_LOGS, + + READ_LOGS_USERS, + + READ_TENANT_SETTINGS, + + UPDATE_TENANT_SETTINGS, + + READ_NETWORK_ACLS, + + CREATE_NETWORK_ACLS, + + UPDATE_NETWORK_ACLS, + + DELETE_NETWORK_ACLS, + + READ_ORGANIZATIONS, + + READ_ORGANIZATIONS_SUMMARY, + + CREATE_ORGANIZATIONS, + + CREATE_ORGANIZATION_CONNECTIONS, + + UPDATE_ORGANIZATIONS, + + DELETE_ORGANIZATIONS, + + CREATE_ORGANIZATION_CLIENT_GRANTS, + + DELETE_ORGANIZATION_CLIENT_GRANTS, + + READ_ORGANIZATION_CONNECTIONS, + + CREATE_ORGANIZATION_DISCOVERY_DOMAINS, + + UPDATE_ORGANIZATION_DISCOVERY_DOMAINS, + + UPDATE_ORGANIZATION_CONNECTIONS, + + DELETE_ORGANIZATION_CONNECTIONS, + + READ_ORGANIZATION_INVITATIONS, + + CREATE_ORGANIZATION_INVITATIONS, + + DELETE_ORGANIZATION_INVITATIONS, + + READ_ORGANIZATION_MEMBERS, + + CREATE_ORGANIZATION_MEMBERS, + + DELETE_ORGANIZATION_MEMBERS, + + READ_ORGANIZATION_MEMBER_ROLES, + + CREATE_ORGANIZATION_MEMBER_ROLES, + + DELETE_ORGANIZATION_MEMBER_ROLES, + + READ_PROMPTS, + + UPDATE_PROMPTS, + + READ_RESOURCE_SERVERS, + + UPDATE_RESOURCE_SERVERS, + + READ_REFRESH_TOKENS, + + DELETE_REFRESH_TOKENS, + + CREATE_RESOURCE_SERVERS, + + DELETE_RESOURCE_SERVERS, + + READ_ROLES, + + CREATE_ROLES, + + UPDATE_ROLES, + + DELETE_ROLES, + + READ_ROLE_MEMBERS, + + CREATE_ROLE_MEMBERS, + + READ_RULES, + + CREATE_RULES, + + UPDATE_RULES, + + READ_RULES_CONFIGS, + + UPDATE_RULES_CONFIGS, + + DELETE_RULES_CONFIGS, + + DELETE_RULES, + + READ_SECURITY_METRICS, + + READ_SELF_SERVICE_PROFILES, + + CREATE_SELF_SERVICE_PROFILES, + + UPDATE_SELF_SERVICE_PROFILES, + + DELETE_SELF_SERVICE_PROFILES, + + READ_SELF_SERVICE_PROFILE_CUSTOM_TEXTS, + + UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS, + + CREATE_SSO_ACCESS_TICKETS, + + DELETE_SSO_ACCESS_TICKETS, + + READ_SESSIONS, + + DELETE_SESSIONS, + + DELETE_TENANTS, + + RUN_CHECKS, + + READ_CHECKS, + + READ_TENANT_FEATURE_FLAGS, + + READ_TENANT_INVITATIONS, + + CREATE_TENANT_INVITATIONS, + + UPDATE_TENANT_INVITATIONS, + + DELETE_TENANT_INVITATIONS, + + READ_TENANT_MEMBERS, + + UPDATE_TENANT_MEMBERS, + + DELETE_TENANT_MEMBERS, + + READ_OWNERS, + + DELETE_OWNERS, + + CREATE_USER_TICKETS, + + READ_TOKEN_EXCHANGE_PROFILES, + + CREATE_TOKEN_EXCHANGE_PROFILES, + + UPDATE_TOKEN_EXCHANGE_PROFILES, + + DELETE_TOKEN_EXCHANGE_PROFILES, + + READ_ENTITY_COUNTS, + + READ_USER_ATTRIBUTE_PROFILES, + + CREATE_USER_ATTRIBUTE_PROFILES, + + UPDATE_USER_ATTRIBUTE_PROFILES, + + DELETE_USER_ATTRIBUTE_PROFILES, + + READ_USER_IDP_TOKENS, + + READ_CURRENT_USER, + + UPDATE_USERS_APP_METADATA, + + UPDATE_CURRENT_USER_METADATA, + + DELETE_CURRENT_USER, + + READ_USER_APPLICATION_PASSWORDS, + + CREATE_USER_APPLICATION_PASSWORDS, + + DELETE_USER_APPLICATION_PASSWORDS, + + READ_AUTHENTICATION_METHODS, + + UPDATE_AUTHENTICATION_METHODS, + + CREATE_AUTHENTICATION_METHODS, + + DELETE_AUTHENTICATION_METHODS, + + READ_FEDERATED_CONNECTIONS_TOKENS, + + DELETE_FEDERATED_CONNECTIONS_TOKENS, + + UPDATE_CURRENT_USER_IDENTITIES, + + DELETE_ROLE_MEMBERS, + + READ_VDCS_TEMPLATES, + + CREATE_VDCS_TEMPLATES, + + UPDATE_VDCS_TEMPLATES, + + DELETE_VDCS_TEMPLATES, + + UNKNOWN + } + + public interface Visitor { + T visitReadActions(); + + T visitCreateActions(); + + T visitDeleteActions(); + + T visitUpdateActions(); + + T visitReadAnomalyBlocks(); + + T visitDeleteAnomalyBlocks(); + + T visitReadShields(); + + T visitCreateShields(); + + T visitUpdateShields(); + + T visitReadAttackProtection(); + + T visitUpdateAttackProtection(); + + T visitReadBranding(); + + T visitUpdateBranding(); + + T visitReadPhoneProviders(); + + T visitCreatePhoneProviders(); + + T visitUpdatePhoneProviders(); + + T visitDeletePhoneProviders(); + + T visitReadPhoneTemplates(); + + T visitCreatePhoneTemplates(); + + T visitUpdatePhoneTemplates(); + + T visitDeletePhoneTemplates(); + + T visitDeleteBranding(); + + T visitReadClientGrants(); + + T visitCreateClientGrants(); + + T visitUpdateClientGrants(); + + T visitDeleteClientGrants(); + + T visitReadOrganizationClientGrants(); + + T visitReadClients(); + + T visitReadClientKeys(); + + T visitReadClientCredentials(); + + T visitReadClientSummary(); + + T visitCreateClients(); + + T visitCreateClientCredentials(); + + T visitUpdateClientCredentials(); + + T visitDeleteClientCredentials(); + + T visitUpdateClients(); + + T visitUpdateClientKeys(); + + T visitDeleteClients(); + + T visitReadConnections(); + + T visitReadConnectionProfiles(); + + T visitCreateConnectionProfiles(); + + T visitUpdateConnectionProfiles(); + + T visitDeleteConnectionProfiles(); + + T visitCreateConnections(); + + T visitUpdateConnections(); + + T visitDeleteConnections(); + + T visitReadUsers(); + + T visitReadConnectionsKeys(); + + T visitCreateConnectionsKeys(); + + T visitUpdateConnectionsKeys(); + + T visitReadScimConfig(); + + T visitCreateScimConfig(); + + T visitUpdateScimConfig(); + + T visitDeleteScimConfig(); + + T visitReadScimToken(); + + T visitCreateScimToken(); + + T visitDeleteScimToken(); + + T visitDeleteUsers(); + + T visitReadCustomDomains(); + + T visitCreateCustomDomains(); + + T visitUpdateCustomDomains(); + + T visitDeleteCustomDomains(); + + T visitReadDeviceCredentials(); + + T visitCreateCurrentUserDeviceCredentials(); + + T visitDeleteDeviceCredentials(); + + T visitDeleteCurrentUserDeviceCredentials(); + + T visitUpdateDeviceCodes(); + + T visitReadDeviceCodes(); + + T visitCreateTestEmailDispatch(); + + T visitCreateEmailTemplates(); + + T visitReadEmailTemplates(); + + T visitUpdateEmailTemplates(); + + T visitReadEmailProvider(); + + T visitCreateEmailProvider(); + + T visitUpdateEmailProvider(); + + T visitDeleteEmailProvider(); + + T visitReadEntitlements(); + + T visitReadEventStreams(); + + T visitCreateEventStreams(); + + T visitUpdateEventStreams(); + + T visitDeleteEventStreams(); + + T visitReadEventDeliveries(); + + T visitUpdateEventDeliveries(); + + T visitReadExtensions(); + + T visitReadFlows(); + + T visitCreateFlows(); + + T visitReadFlowsVaultConnections(); + + T visitCreateFlowsVaultConnections(); + + T visitUpdateFlowsVaultConnections(); + + T visitDeleteFlowsVaultConnections(); + + T visitReadFlowsExecutions(); + + T visitDeleteFlowsExecutions(); + + T visitUpdateFlows(); + + T visitDeleteFlows(); + + T visitReadForms(); + + T visitCreateForms(); + + T visitUpdateForms(); + + T visitDeleteForms(); + + T visitReadGrants(); + + T visitDeleteGrants(); + + T visitCreateGuardianEnrollmentTickets(); + + T visitReadGuardianEnrollments(); + + T visitDeleteGuardianEnrollments(); + + T visitReadGuardianFactors(); + + T visitUpdateGuardianFactors(); + + T visitReadMfaPolicies(); + + T visitUpdateMfaPolicies(); + + T visitReadHooks(); + + T visitCreateHooks(); + + T visitUpdateHooks(); + + T visitDeleteHooks(); + + T visitReadInsights(); + + T visitReadStats(); + + T visitReadIntegrations(); + + T visitCreateIntegrations(); + + T visitUpdateIntegrations(); + + T visitDeleteIntegrations(); + + T visitCreateUsers(); + + T visitUpdateUsers(); + + T visitReadCustomSigningKeys(); + + T visitCreateCustomSigningKeys(); + + T visitUpdateCustomSigningKeys(); + + T visitDeleteCustomSigningKeys(); + + T visitReadEncryptionKeys(); + + T visitCreateEncryptionKeys(); + + T visitUpdateEncryptionKeys(); + + T visitDeleteEncryptionKeys(); + + T visitReadSigningKeys(); + + T visitCreateSigningKeys(); + + T visitUpdateSigningKeys(); + + T visitReadLogStreams(); + + T visitCreateLogStreams(); + + T visitUpdateLogStreams(); + + T visitDeleteLogStreams(); + + T visitReadLogs(); + + T visitReadLogsUsers(); + + T visitReadTenantSettings(); + + T visitUpdateTenantSettings(); + + T visitReadNetworkAcls(); + + T visitCreateNetworkAcls(); + + T visitUpdateNetworkAcls(); + + T visitDeleteNetworkAcls(); + + T visitReadOrganizations(); + + T visitReadOrganizationsSummary(); + + T visitCreateOrganizations(); + + T visitCreateOrganizationConnections(); + + T visitUpdateOrganizations(); + + T visitDeleteOrganizations(); + + T visitCreateOrganizationClientGrants(); + + T visitDeleteOrganizationClientGrants(); + + T visitReadOrganizationConnections(); + + T visitCreateOrganizationDiscoveryDomains(); + + T visitUpdateOrganizationDiscoveryDomains(); + + T visitUpdateOrganizationConnections(); + + T visitDeleteOrganizationConnections(); + + T visitReadOrganizationInvitations(); + + T visitCreateOrganizationInvitations(); + + T visitDeleteOrganizationInvitations(); + + T visitReadOrganizationMembers(); + + T visitCreateOrganizationMembers(); + + T visitDeleteOrganizationMembers(); + + T visitReadOrganizationMemberRoles(); + + T visitCreateOrganizationMemberRoles(); + + T visitDeleteOrganizationMemberRoles(); + + T visitReadPrompts(); + + T visitUpdatePrompts(); + + T visitReadResourceServers(); + + T visitUpdateResourceServers(); + + T visitReadRefreshTokens(); + + T visitDeleteRefreshTokens(); + + T visitCreateResourceServers(); + + T visitDeleteResourceServers(); + + T visitReadRoles(); + + T visitCreateRoles(); + + T visitUpdateRoles(); + + T visitDeleteRoles(); + + T visitReadRoleMembers(); + + T visitCreateRoleMembers(); + + T visitReadRules(); + + T visitCreateRules(); + + T visitUpdateRules(); + + T visitReadRulesConfigs(); + + T visitUpdateRulesConfigs(); + + T visitDeleteRulesConfigs(); + + T visitDeleteRules(); + + T visitReadSecurityMetrics(); + + T visitReadSelfServiceProfiles(); + + T visitCreateSelfServiceProfiles(); + + T visitUpdateSelfServiceProfiles(); + + T visitDeleteSelfServiceProfiles(); + + T visitReadSelfServiceProfileCustomTexts(); + + T visitUpdateSelfServiceProfileCustomTexts(); + + T visitCreateSsoAccessTickets(); + + T visitDeleteSsoAccessTickets(); + + T visitReadSessions(); + + T visitDeleteSessions(); + + T visitDeleteTenants(); + + T visitRunChecks(); + + T visitReadChecks(); + + T visitReadTenantFeatureFlags(); + + T visitReadTenantInvitations(); + + T visitCreateTenantInvitations(); + + T visitUpdateTenantInvitations(); + + T visitDeleteTenantInvitations(); + + T visitReadTenantMembers(); + + T visitUpdateTenantMembers(); + + T visitDeleteTenantMembers(); + + T visitReadOwners(); + + T visitDeleteOwners(); + + T visitCreateUserTickets(); + + T visitReadTokenExchangeProfiles(); + + T visitCreateTokenExchangeProfiles(); + + T visitUpdateTokenExchangeProfiles(); + + T visitDeleteTokenExchangeProfiles(); + + T visitReadEntityCounts(); + + T visitReadUserAttributeProfiles(); + + T visitCreateUserAttributeProfiles(); + + T visitUpdateUserAttributeProfiles(); + + T visitDeleteUserAttributeProfiles(); + + T visitReadUserIdpTokens(); + + T visitReadCurrentUser(); + + T visitUpdateUsersAppMetadata(); + + T visitUpdateCurrentUserMetadata(); + + T visitDeleteCurrentUser(); + + T visitReadUserApplicationPasswords(); + + T visitCreateUserApplicationPasswords(); + + T visitDeleteUserApplicationPasswords(); + + T visitReadAuthenticationMethods(); + + T visitUpdateAuthenticationMethods(); + + T visitCreateAuthenticationMethods(); + + T visitDeleteAuthenticationMethods(); + + T visitReadFederatedConnectionsTokens(); + + T visitDeleteFederatedConnectionsTokens(); + + T visitUpdateCurrentUserIdentities(); + + T visitDeleteRoleMembers(); + + T visitReadVdcsTemplates(); + + T visitCreateVdcsTemplates(); + + T visitUpdateVdcsTemplates(); + + T visitDeleteVdcsTemplates(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Organization.java b/src/main/java/com/auth0/client/mgmt/types/Organization.java new file mode 100644 index 000000000..4aebdc347 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Organization.java @@ -0,0 +1,235 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Organization.Builder.class) +public final class Organization { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private Organization( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional tokenQuota, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Organization && equalTo((Organization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Organization other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Organization other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public Organization build() { + return new Organization(id, name, displayName, branding, metadata, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java new file mode 100644 index 000000000..936ba5f11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationAccessLevelEnum { + public static final OrganizationAccessLevelEnum READONLY = + new OrganizationAccessLevelEnum(Value.READONLY, "readonly"); + + public static final OrganizationAccessLevelEnum FULL = new OrganizationAccessLevelEnum(Value.FULL, "full"); + + public static final OrganizationAccessLevelEnum LIMITED = new OrganizationAccessLevelEnum(Value.LIMITED, "limited"); + + public static final OrganizationAccessLevelEnum NONE = new OrganizationAccessLevelEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + OrganizationAccessLevelEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationAccessLevelEnum + && this.string.equals(((OrganizationAccessLevelEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READONLY: + return visitor.visitReadonly(); + case FULL: + return visitor.visitFull(); + case LIMITED: + return visitor.visitLimited(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationAccessLevelEnum valueOf(String value) { + switch (value) { + case "readonly": + return READONLY; + case "full": + return FULL; + case "limited": + return LIMITED; + case "none": + return NONE; + default: + return new OrganizationAccessLevelEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + READONLY, + + LIMITED, + + FULL, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitReadonly(); + + T visitLimited(); + + T visitFull(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java new file mode 100644 index 000000000..db58bbc39 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationBranding.Builder.class) +public final class OrganizationBranding { + private final Optional logoUrl; + + private final Optional colors; + + private final Map additionalProperties; + + private OrganizationBranding( + Optional logoUrl, + Optional colors, + Map additionalProperties) { + this.logoUrl = logoUrl; + this.colors = colors; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL of logo to display on login page. + */ + @JsonProperty("logo_url") + public Optional getLogoUrl() { + return logoUrl; + } + + @JsonProperty("colors") + public Optional getColors() { + return colors; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationBranding && equalTo((OrganizationBranding) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationBranding other) { + return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logoUrl, this.colors); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional logoUrl = Optional.empty(); + + private Optional colors = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationBranding other) { + logoUrl(other.getLogoUrl()); + colors(other.getColors()); + return this; + } + + /** + *

URL of logo to display on login page.

+ */ + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public Builder logoUrl(Optional logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + public Builder logoUrl(String logoUrl) { + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + @JsonSetter(value = "colors", nulls = Nulls.SKIP) + public Builder colors(Optional colors) { + this.colors = colors; + return this; + } + + public Builder colors(OrganizationBrandingColors colors) { + this.colors = Optional.ofNullable(colors); + return this; + } + + public OrganizationBranding build() { + return new OrganizationBranding(logoUrl, colors, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java new file mode 100644 index 000000000..f4935915c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationBrandingColors.Builder.class) +public final class OrganizationBrandingColors { + private final String primary; + + private final String pageBackground; + + private final Map additionalProperties; + + private OrganizationBrandingColors( + String primary, String pageBackground, Map additionalProperties) { + this.primary = primary; + this.pageBackground = pageBackground; + this.additionalProperties = additionalProperties; + } + + /** + * @return HEX Color for primary elements. + */ + @JsonProperty("primary") + public String getPrimary() { + return primary; + } + + /** + * @return HEX Color for background. + */ + @JsonProperty("page_background") + public String getPageBackground() { + return pageBackground; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationBrandingColors && equalTo((OrganizationBrandingColors) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationBrandingColors other) { + return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.primary, this.pageBackground); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PrimaryStage builder() { + return new Builder(); + } + + public interface PrimaryStage { + /** + *

HEX Color for primary elements.

+ */ + PageBackgroundStage primary(@NotNull String primary); + + Builder from(OrganizationBrandingColors other); + } + + public interface PageBackgroundStage { + /** + *

HEX Color for background.

+ */ + _FinalStage pageBackground(@NotNull String pageBackground); + } + + public interface _FinalStage { + OrganizationBrandingColors build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PrimaryStage, PageBackgroundStage, _FinalStage { + private String primary; + + private String pageBackground; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OrganizationBrandingColors other) { + primary(other.getPrimary()); + pageBackground(other.getPageBackground()); + return this; + } + + /** + *

HEX Color for primary elements.

+ *

HEX Color for primary elements.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public PageBackgroundStage primary(@NotNull String primary) { + this.primary = Objects.requireNonNull(primary, "primary must not be null"); + return this; + } + + /** + *

HEX Color for background.

+ *

HEX Color for background.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("page_background") + public _FinalStage pageBackground(@NotNull String pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + @java.lang.Override + public OrganizationBrandingColors build() { + return new OrganizationBrandingColors(primary, pageBackground, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java new file mode 100644 index 000000000..bb281b935 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationClientGrant.Builder.class) +public final class OrganizationClientGrant { + private final Optional id; + + private final Optional clientId; + + private final Optional audience; + + private final Optional> scope; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final Map additionalProperties; + + private OrganizationClientGrant( + Optional id, + Optional clientId, + Optional audience, + Optional> scope, + Optional organizationUsage, + Optional allowAnyOrganization, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.audience = audience; + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationClientGrant && equalTo((OrganizationClientGrant) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationClientGrant other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && audience.equals(other.audience) + && scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private Optional allowAnyOrganization = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationClientGrant other) { + id(other.getId()); + clientId(other.getClientId()); + audience(other.getAudience()); + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + return this; + } + + /** + *

ID of the client grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The audience (API identifier) of this client grant

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(OrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + public OrganizationClientGrant build() { + return new OrganizationClientGrant( + id, clientId, audience, scope, organizationUsage, allowAnyOrganization, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java new file mode 100644 index 000000000..604ee9f6e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationConnection.Builder.class) +public final class OrganizationConnection { + private final Optional connectionId; + + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional connection; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final Map additionalProperties; + + private OrganizationConnection( + Optional connectionId, + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional connection, + Optional organizationAccessLevel, + Optional isEnabled, + Map additionalProperties) { + this.connectionId = connectionId; + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.connection = connection; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationConnection && equalTo((OrganizationConnection) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationConnection other) { + return connectionId.equals(other.connectionId) + && organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && connection.equals(other.connection) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.connection, + this.organizationAccessLevel, + this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional connection = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationConnection other) { + connectionId(other.getConnectionId()); + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + connection(other.getConnection()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + return this; + } + + /** + *

ID of the connection.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public Builder organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + public Builder organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public Builder organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + public Builder organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public OrganizationConnection build() { + return new OrganizationConnection( + connectionId, + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + connection, + organizationAccessLevel, + isEnabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java new file mode 100644 index 000000000..647c645d6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationConnectionInformation.Builder.class) +public final class OrganizationConnectionInformation { + private final Optional name; + + private final Optional strategy; + + private final Map additionalProperties; + + private OrganizationConnectionInformation( + Optional name, Optional strategy, Map additionalProperties) { + this.name = name; + this.strategy = strategy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the enabled connection. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The strategy of the enabled connection. + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationConnectionInformation && equalTo((OrganizationConnectionInformation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationConnectionInformation other) { + return name.equals(other.name) && strategy.equals(other.strategy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.strategy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional strategy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationConnectionInformation other) { + name(other.getName()); + strategy(other.getStrategy()); + return this; + } + + /** + *

The name of the enabled connection.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The strategy of the enabled connection.

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + public OrganizationConnectionInformation build() { + return new OrganizationConnectionInformation(name, strategy, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java new file mode 100644 index 000000000..e9d82484e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationEnabledConnection.Builder.class) +public final class OrganizationEnabledConnection { + private final Optional connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional connection; + + private final Map additionalProperties; + + private OrganizationEnabledConnection( + Optional connectionId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional connection, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationEnabledConnection && equalTo((OrganizationEnabledConnection) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationEnabledConnection other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationEnabledConnection other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + connection(other.getConnection()); + return this; + } + + /** + *

ID of the connection.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public OrganizationEnabledConnection build() { + return new OrganizationEnabledConnection( + connectionId, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + connection, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java new file mode 100644 index 000000000..4343fb85a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java @@ -0,0 +1,468 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationInvitation.Builder.class) +public final class OrganizationInvitation { + private final Optional id; + + private final Optional organizationId; + + private final Optional inviter; + + private final Optional invitee; + + private final Optional invitationUrl; + + private final Optional createdAt; + + private final Optional expiresAt; + + private final Optional clientId; + + private final Optional connectionId; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional> roles; + + private final Optional ticketId; + + private final Map additionalProperties; + + private OrganizationInvitation( + Optional id, + Optional organizationId, + Optional inviter, + Optional invitee, + Optional invitationUrl, + Optional createdAt, + Optional expiresAt, + Optional clientId, + Optional connectionId, + Optional> appMetadata, + Optional> userMetadata, + Optional> roles, + Optional ticketId, + Map additionalProperties) { + this.id = id; + this.organizationId = organizationId; + this.inviter = inviter; + this.invitee = invitee; + this.invitationUrl = invitationUrl; + this.createdAt = createdAt; + this.expiresAt = expiresAt; + this.clientId = clientId; + this.connectionId = connectionId; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.roles = roles; + this.ticketId = ticketId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the user invitation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + @JsonProperty("inviter") + public Optional getInviter() { + return inviter; + } + + @JsonProperty("invitee") + public Optional getInvitee() { + return invitee; + } + + /** + * @return The invitation url to be send to the invitee. + */ + @JsonProperty("invitation_url") + public Optional getInvitationUrl() { + return invitationUrl; + } + + /** + * @return The ISO 8601 formatted timestamp representing the creation time of the invitation. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted timestamp representing the expiration time of the invitation. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + /** + * @return Auth0 client ID. Used to resolve the application's login initiation endpoint. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The id of the connection to force invitee to authenticate with. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + /** + * @return The id of the invitation ticket + */ + @JsonProperty("ticket_id") + public Optional getTicketId() { + return ticketId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationInvitation && equalTo((OrganizationInvitation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationInvitation other) { + return id.equals(other.id) + && organizationId.equals(other.organizationId) + && inviter.equals(other.inviter) + && invitee.equals(other.invitee) + && invitationUrl.equals(other.invitationUrl) + && createdAt.equals(other.createdAt) + && expiresAt.equals(other.expiresAt) + && clientId.equals(other.clientId) + && connectionId.equals(other.connectionId) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && roles.equals(other.roles) + && ticketId.equals(other.ticketId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.organizationId, + this.inviter, + this.invitee, + this.invitationUrl, + this.createdAt, + this.expiresAt, + this.clientId, + this.connectionId, + this.appMetadata, + this.userMetadata, + this.roles, + this.ticketId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional inviter = Optional.empty(); + + private Optional invitee = Optional.empty(); + + private Optional invitationUrl = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional> roles = Optional.empty(); + + private Optional ticketId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationInvitation other) { + id(other.getId()); + organizationId(other.getOrganizationId()); + inviter(other.getInviter()); + invitee(other.getInvitee()); + invitationUrl(other.getInvitationUrl()); + createdAt(other.getCreatedAt()); + expiresAt(other.getExpiresAt()); + clientId(other.getClientId()); + connectionId(other.getConnectionId()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + roles(other.getRoles()); + ticketId(other.getTicketId()); + return this; + } + + /** + *

The id of the user invitation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + @JsonSetter(value = "inviter", nulls = Nulls.SKIP) + public Builder inviter(Optional inviter) { + this.inviter = inviter; + return this; + } + + public Builder inviter(OrganizationInvitationInviter inviter) { + this.inviter = Optional.ofNullable(inviter); + return this; + } + + @JsonSetter(value = "invitee", nulls = Nulls.SKIP) + public Builder invitee(Optional invitee) { + this.invitee = invitee; + return this; + } + + public Builder invitee(OrganizationInvitationInvitee invitee) { + this.invitee = Optional.ofNullable(invitee); + return this; + } + + /** + *

The invitation url to be send to the invitee.

+ */ + @JsonSetter(value = "invitation_url", nulls = Nulls.SKIP) + public Builder invitationUrl(Optional invitationUrl) { + this.invitationUrl = invitationUrl; + return this; + } + + public Builder invitationUrl(String invitationUrl) { + this.invitationUrl = Optional.ofNullable(invitationUrl); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the creation time of the invitation.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted timestamp representing the expiration time of the invitation.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The id of the connection to force invitee to authenticate with.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + *

The id of the invitation ticket

+ */ + @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) + public Builder ticketId(Optional ticketId) { + this.ticketId = ticketId; + return this; + } + + public Builder ticketId(String ticketId) { + this.ticketId = Optional.ofNullable(ticketId); + return this; + } + + public OrganizationInvitation build() { + return new OrganizationInvitation( + id, + organizationId, + inviter, + invitee, + invitationUrl, + createdAt, + expiresAt, + clientId, + connectionId, + appMetadata, + userMetadata, + roles, + ticketId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java new file mode 100644 index 000000000..8431ecd16 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationInvitationInvitee.Builder.class) +public final class OrganizationInvitationInvitee { + private final String email; + + private final Map additionalProperties; + + private OrganizationInvitationInvitee(String email, Map additionalProperties) { + this.email = email; + this.additionalProperties = additionalProperties; + } + + /** + * @return The invitee's email. + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationInvitationInvitee && equalTo((OrganizationInvitationInvitee) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationInvitationInvitee other) { + return email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + /** + *

The invitee's email.

+ */ + _FinalStage email(@NotNull String email); + + Builder from(OrganizationInvitationInvitee other); + } + + public interface _FinalStage { + OrganizationInvitationInvitee build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OrganizationInvitationInvitee other) { + email(other.getEmail()); + return this; + } + + /** + *

The invitee's email.

+ *

The invitee's email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @java.lang.Override + public OrganizationInvitationInvitee build() { + return new OrganizationInvitationInvitee(email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java new file mode 100644 index 000000000..c144190bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationInvitationInviter.Builder.class) +public final class OrganizationInvitationInviter { + private final String name; + + private final Map additionalProperties; + + private OrganizationInvitationInviter(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The inviter's name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationInvitationInviter && equalTo((OrganizationInvitationInviter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationInvitationInviter other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The inviter's name.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(OrganizationInvitationInviter other); + } + + public interface _FinalStage { + OrganizationInvitationInviter build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OrganizationInvitationInviter other) { + name(other.getName()); + return this; + } + + /** + *

The inviter's name.

+ *

The inviter's name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public OrganizationInvitationInviter build() { + return new OrganizationInvitationInviter(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java new file mode 100644 index 000000000..4ffc171d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java @@ -0,0 +1,218 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationMember.Builder.class) +public final class OrganizationMember { + private final Optional userId; + + private final Optional picture; + + private final Optional name; + + private final Optional email; + + private final Optional> roles; + + private final Map additionalProperties; + + private OrganizationMember( + Optional userId, + Optional picture, + Optional name, + Optional email, + Optional> roles, + Map additionalProperties) { + this.userId = userId; + this.picture = picture; + this.name = name; + this.email = email; + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this user. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return URL to a picture for this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("roles") + public Optional> getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationMember && equalTo((OrganizationMember) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationMember other) { + return userId.equals(other.userId) + && picture.equals(other.picture) + && name.equals(other.name) + && email.equals(other.email) + && roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userId, this.picture, this.name, this.email, this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional> roles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationMember other) { + userId(other.getUserId()); + picture(other.getPicture()); + name(other.getName()); + email(other.getEmail()); + roles(other.getRoles()); + return this; + } + + /** + *

ID of this user.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

URL to a picture for this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + public OrganizationMember build() { + return new OrganizationMember(userId, picture, name, email, roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java new file mode 100644 index 000000000..fe271a84f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationMemberRole.Builder.class) +public final class OrganizationMemberRole { + private final Optional id; + + private final Optional name; + + private final Map additionalProperties; + + private OrganizationMemberRole( + Optional id, Optional name, Map additionalProperties) { + this.id = id; + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this role. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationMemberRole && equalTo((OrganizationMemberRole) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationMemberRole other) { + return id.equals(other.id) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OrganizationMemberRole other) { + id(other.getId()); + name(other.getName()); + return this; + } + + /** + *

ID for this role.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + public OrganizationMemberRole build() { + return new OrganizationMemberRole(id, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java new file mode 100644 index 000000000..6dbe037f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationUsageEnum { + public static final OrganizationUsageEnum ALLOW = new OrganizationUsageEnum(Value.ALLOW, "allow"); + + public static final OrganizationUsageEnum REQUIRE = new OrganizationUsageEnum(Value.REQUIRE, "require"); + + public static final OrganizationUsageEnum DENY = new OrganizationUsageEnum(Value.DENY, "deny"); + + private final Value value; + + private final String string; + + OrganizationUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationUsageEnum + && this.string.equals(((OrganizationUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case REQUIRE: + return visitor.visitRequire(); + case DENY: + return visitor.visitDeny(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationUsageEnum valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + case "require": + return REQUIRE; + case "deny": + return DENY; + default: + return new OrganizationUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY, + + ALLOW, + + REQUIRE, + + UNKNOWN + } + + public interface Visitor { + T visitDeny(); + + T visitAllow(); + + T visitRequire(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java new file mode 100644 index 000000000..0d58290a8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PartialGroupsEnum { + public static final PartialGroupsEnum SIGNUP_ID = new PartialGroupsEnum(Value.SIGNUP_ID, "signup-id"); + + public static final PartialGroupsEnum LOGIN = new PartialGroupsEnum(Value.LOGIN, "login"); + + public static final PartialGroupsEnum SIGNUP_PASSWORD = + new PartialGroupsEnum(Value.SIGNUP_PASSWORD, "signup-password"); + + public static final PartialGroupsEnum SIGNUP = new PartialGroupsEnum(Value.SIGNUP, "signup"); + + public static final PartialGroupsEnum CUSTOMIZED_CONSENT = + new PartialGroupsEnum(Value.CUSTOMIZED_CONSENT, "customized-consent"); + + public static final PartialGroupsEnum LOGIN_PASSWORD = + new PartialGroupsEnum(Value.LOGIN_PASSWORD, "login-password"); + + public static final PartialGroupsEnum LOGIN_PASSWORDLESS = + new PartialGroupsEnum(Value.LOGIN_PASSWORDLESS, "login-passwordless"); + + public static final PartialGroupsEnum LOGIN_ID = new PartialGroupsEnum(Value.LOGIN_ID, "login-id"); + + private final Value value; + + private final String string; + + PartialGroupsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PartialGroupsEnum && this.string.equals(((PartialGroupsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SIGNUP_ID: + return visitor.visitSignupId(); + case LOGIN: + return visitor.visitLogin(); + case SIGNUP_PASSWORD: + return visitor.visitSignupPassword(); + case SIGNUP: + return visitor.visitSignup(); + case CUSTOMIZED_CONSENT: + return visitor.visitCustomizedConsent(); + case LOGIN_PASSWORD: + return visitor.visitLoginPassword(); + case LOGIN_PASSWORDLESS: + return visitor.visitLoginPasswordless(); + case LOGIN_ID: + return visitor.visitLoginId(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PartialGroupsEnum valueOf(String value) { + switch (value) { + case "signup-id": + return SIGNUP_ID; + case "login": + return LOGIN; + case "signup-password": + return SIGNUP_PASSWORD; + case "signup": + return SIGNUP; + case "customized-consent": + return CUSTOMIZED_CONSENT; + case "login-password": + return LOGIN_PASSWORD; + case "login-passwordless": + return LOGIN_PASSWORDLESS; + case "login-id": + return LOGIN_ID; + default: + return new PartialGroupsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LOGIN, + + LOGIN_ID, + + LOGIN_PASSWORD, + + LOGIN_PASSWORDLESS, + + SIGNUP, + + SIGNUP_ID, + + SIGNUP_PASSWORD, + + CUSTOMIZED_CONSENT, + + UNKNOWN + } + + public interface Visitor { + T visitLogin(); + + T visitLoginId(); + + T visitLoginPassword(); + + T visitLoginPasswordless(); + + T visitSignup(); + + T visitSignupId(); + + T visitSignupPassword(); + + T visitCustomizedConsent(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java new file mode 100644 index 000000000..2b5d425e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PartialPhoneTemplateContent.Builder.class) +public final class PartialPhoneTemplateContent { + private final Optional from; + + private final Optional body; + + private final Map additionalProperties; + + private PartialPhoneTemplateContent( + Optional from, Optional body, Map additionalProperties) { + this.from = from; + this.body = body; + this.additionalProperties = additionalProperties; + } + + /** + * @return Default phone number to be used as 'from' when sending a phone notification + */ + @JsonProperty("from") + public Optional getFrom() { + return from; + } + + @JsonProperty("body") + public Optional getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PartialPhoneTemplateContent && equalTo((PartialPhoneTemplateContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PartialPhoneTemplateContent other) { + return from.equals(other.from) && body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional from = Optional.empty(); + + private Optional body = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PartialPhoneTemplateContent other) { + from(other.getFrom()); + body(other.getBody()); + return this; + } + + /** + *

Default phone number to be used as 'from' when sending a phone notification

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(Optional from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = Optional.ofNullable(from); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(PhoneTemplateBody body) { + this.body = Optional.ofNullable(body); + return this; + } + + public PartialPhoneTemplateContent build() { + return new PartialPhoneTemplateContent(from, body, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java new file mode 100644 index 000000000..2e1b9f47e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchClientCredentialResponseContent.Builder.class) +public final class PatchClientCredentialResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional kid; + + private final Optional alg; + + private final Optional credentialType; + + private final Optional subjectDn; + + private final Optional thumbprintSha256; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private PatchClientCredentialResponseContent( + Optional id, + Optional name, + Optional kid, + Optional alg, + Optional credentialType, + Optional subjectDn, + Optional thumbprintSha256, + Optional createdAt, + Optional updatedAt, + Optional expiresAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.kid = kid; + this.alg = alg; + this.credentialType = credentialType; + this.subjectDn = subjectDn; + this.thumbprintSha256 = thumbprintSha256; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the credential. Generated on creation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name given to the credential by the user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The key identifier of the credential, generated on creation. + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + @JsonProperty("credential_type") + public Optional getCredentialType() { + return credentialType; + } + + /** + * @return The X509 certificate's Subject Distinguished Name + */ + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + /** + * @return The X509 certificate's SHA256 thumbprint + */ + @JsonProperty("thumbprint_sha256") + public Optional getThumbprintSha256() { + return thumbprintSha256; + } + + /** + * @return The ISO 8601 formatted date the credential was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date the credential was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchClientCredentialResponseContent + && equalTo((PatchClientCredentialResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchClientCredentialResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && kid.equals(other.kid) + && alg.equals(other.alg) + && credentialType.equals(other.credentialType) + && subjectDn.equals(other.subjectDn) + && thumbprintSha256.equals(other.thumbprintSha256) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.kid, + this.alg, + this.credentialType, + this.subjectDn, + this.thumbprintSha256, + this.createdAt, + this.updatedAt, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional kid = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional credentialType = Optional.empty(); + + private Optional subjectDn = Optional.empty(); + + private Optional thumbprintSha256 = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchClientCredentialResponseContent other) { + id(other.getId()); + name(other.getName()); + kid(other.getKid()); + alg(other.getAlg()); + credentialType(other.getCredentialType()); + subjectDn(other.getSubjectDn()); + thumbprintSha256(other.getThumbprintSha256()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

ID of the credential. Generated on creation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name given to the credential by the user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The key identifier of the credential, generated on creation.

+ */ + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public Builder kid(Optional kid) { + this.kid = kid; + return this; + } + + public Builder kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public Builder alg(Optional alg) { + this.alg = alg; + return this; + } + + public Builder alg(ClientCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @JsonSetter(value = "credential_type", nulls = Nulls.SKIP) + public Builder credentialType(Optional credentialType) { + this.credentialType = credentialType; + return this; + } + + public Builder credentialType(ClientCredentialTypeEnum credentialType) { + this.credentialType = Optional.ofNullable(credentialType); + return this; + } + + /** + *

The X509 certificate's Subject Distinguished Name

+ */ + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public Builder subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + public Builder subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + /** + *

The X509 certificate's SHA256 thumbprint

+ */ + @JsonSetter(value = "thumbprint_sha256", nulls = Nulls.SKIP) + public Builder thumbprintSha256(Optional thumbprintSha256) { + this.thumbprintSha256 = thumbprintSha256; + return this; + } + + public Builder thumbprintSha256(String thumbprintSha256) { + this.thumbprintSha256 = Optional.ofNullable(thumbprintSha256); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public PatchClientCredentialResponseContent build() { + return new PatchClientCredentialResponseContent( + id, + name, + kid, + alg, + credentialType, + subjectDn, + thumbprintSha256, + createdAt, + updatedAt, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java new file mode 100644 index 000000000..7911c0f9e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchSupplementalSignalsResponseContent.Builder.class) +public final class PatchSupplementalSignalsResponseContent { + private final Optional akamaiEnabled; + + private final Map additionalProperties; + + private PatchSupplementalSignalsResponseContent( + Optional akamaiEnabled, Map additionalProperties) { + this.akamaiEnabled = akamaiEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates if incoming Akamai Headers should be processed + */ + @JsonProperty("akamai_enabled") + public Optional getAkamaiEnabled() { + return akamaiEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchSupplementalSignalsResponseContent + && equalTo((PatchSupplementalSignalsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchSupplementalSignalsResponseContent other) { + return akamaiEnabled.equals(other.akamaiEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.akamaiEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional akamaiEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchSupplementalSignalsResponseContent other) { + akamaiEnabled(other.getAkamaiEnabled()); + return this; + } + + /** + *

Indicates if incoming Akamai Headers should be processed

+ */ + @JsonSetter(value = "akamai_enabled", nulls = Nulls.SKIP) + public Builder akamaiEnabled(Optional akamaiEnabled) { + this.akamaiEnabled = akamaiEnabled; + return this; + } + + public Builder akamaiEnabled(Boolean akamaiEnabled) { + this.akamaiEnabled = Optional.ofNullable(akamaiEnabled); + return this; + } + + public PatchSupplementalSignalsResponseContent build() { + return new PatchSupplementalSignalsResponseContent(akamaiEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java new file mode 100644 index 000000000..a92f96555 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PermissionRequestPayload.Builder.class) +public final class PermissionRequestPayload { + private final String resourceServerIdentifier; + + private final String permissionName; + + private final Map additionalProperties; + + private PermissionRequestPayload( + String resourceServerIdentifier, String permissionName, Map additionalProperties) { + this.resourceServerIdentifier = resourceServerIdentifier; + this.permissionName = permissionName; + this.additionalProperties = additionalProperties; + } + + /** + * @return Resource server (API) identifier that this permission is for. + */ + @JsonProperty("resource_server_identifier") + public String getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + /** + * @return Name of this permission. + */ + @JsonProperty("permission_name") + public String getPermissionName() { + return permissionName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequestPayload && equalTo((PermissionRequestPayload) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PermissionRequestPayload other) { + return resourceServerIdentifier.equals(other.resourceServerIdentifier) + && permissionName.equals(other.permissionName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.resourceServerIdentifier, this.permissionName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ResourceServerIdentifierStage builder() { + return new Builder(); + } + + public interface ResourceServerIdentifierStage { + /** + *

Resource server (API) identifier that this permission is for.

+ */ + PermissionNameStage resourceServerIdentifier(@NotNull String resourceServerIdentifier); + + Builder from(PermissionRequestPayload other); + } + + public interface PermissionNameStage { + /** + *

Name of this permission.

+ */ + _FinalStage permissionName(@NotNull String permissionName); + } + + public interface _FinalStage { + PermissionRequestPayload build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ResourceServerIdentifierStage, PermissionNameStage, _FinalStage { + private String resourceServerIdentifier; + + private String permissionName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PermissionRequestPayload other) { + resourceServerIdentifier(other.getResourceServerIdentifier()); + permissionName(other.getPermissionName()); + return this; + } + + /** + *

Resource server (API) identifier that this permission is for.

+ *

Resource server (API) identifier that this permission is for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("resource_server_identifier") + public PermissionNameStage resourceServerIdentifier(@NotNull String resourceServerIdentifier) { + this.resourceServerIdentifier = + Objects.requireNonNull(resourceServerIdentifier, "resourceServerIdentifier must not be null"); + return this; + } + + /** + *

Name of this permission.

+ *

Name of this permission.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("permission_name") + public _FinalStage permissionName(@NotNull String permissionName) { + this.permissionName = Objects.requireNonNull(permissionName, "permissionName must not be null"); + return this; + } + + @java.lang.Override + public PermissionRequestPayload build() { + return new PermissionRequestPayload(resourceServerIdentifier, permissionName, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java new file mode 100644 index 000000000..8283fb3c3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PermissionsResponsePayload.Builder.class) +public final class PermissionsResponsePayload { + private final Optional resourceServerIdentifier; + + private final Optional permissionName; + + private final Optional resourceServerName; + + private final Optional description; + + private final Map additionalProperties; + + private PermissionsResponsePayload( + Optional resourceServerIdentifier, + Optional permissionName, + Optional resourceServerName, + Optional description, + Map additionalProperties) { + this.resourceServerIdentifier = resourceServerIdentifier; + this.permissionName = permissionName; + this.resourceServerName = resourceServerName; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return Resource server (API) identifier that this permission is for. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + /** + * @return Name of this permission. + */ + @JsonProperty("permission_name") + public Optional getPermissionName() { + return permissionName; + } + + /** + * @return Resource server (API) name this permission is for. + */ + @JsonProperty("resource_server_name") + public Optional getResourceServerName() { + return resourceServerName; + } + + /** + * @return Description of this permission. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionsResponsePayload && equalTo((PermissionsResponsePayload) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PermissionsResponsePayload other) { + return resourceServerIdentifier.equals(other.resourceServerIdentifier) + && permissionName.equals(other.permissionName) + && resourceServerName.equals(other.resourceServerName) + && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional permissionName = Optional.empty(); + + private Optional resourceServerName = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PermissionsResponsePayload other) { + resourceServerIdentifier(other.getResourceServerIdentifier()); + permissionName(other.getPermissionName()); + resourceServerName(other.getResourceServerName()); + description(other.getDescription()); + return this; + } + + /** + *

Resource server (API) identifier that this permission is for.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + /** + *

Name of this permission.

+ */ + @JsonSetter(value = "permission_name", nulls = Nulls.SKIP) + public Builder permissionName(Optional permissionName) { + this.permissionName = permissionName; + return this; + } + + public Builder permissionName(String permissionName) { + this.permissionName = Optional.ofNullable(permissionName); + return this; + } + + /** + *

Resource server (API) name this permission is for.

+ */ + @JsonSetter(value = "resource_server_name", nulls = Nulls.SKIP) + public Builder resourceServerName(Optional resourceServerName) { + this.resourceServerName = resourceServerName; + return this; + } + + public Builder resourceServerName(String resourceServerName) { + this.resourceServerName = Optional.ofNullable(resourceServerName); + return this; + } + + /** + *

Description of this permission.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public PermissionsResponsePayload build() { + return new PermissionsResponsePayload( + resourceServerIdentifier, permissionName, resourceServerName, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java new file mode 100644 index 000000000..b89b02963 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneAttribute.Builder.class) +public final class PhoneAttribute { + private final Optional identifier; + + private final Optional profileRequired; + + private final Optional signup; + + private final Map additionalProperties; + + private PhoneAttribute( + Optional identifier, + Optional profileRequired, + Optional signup, + Map additionalProperties) { + this.identifier = identifier; + this.profileRequired = profileRequired; + this.signup = signup; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return Determines if property should be required for users + */ + @JsonProperty("profile_required") + public Optional getProfileRequired() { + return profileRequired; + } + + @JsonProperty("signup") + public Optional getSignup() { + return signup; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneAttribute && equalTo((PhoneAttribute) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneAttribute other) { + return identifier.equals(other.identifier) + && profileRequired.equals(other.profileRequired) + && signup.equals(other.signup); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier, this.profileRequired, this.signup); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional identifier = Optional.empty(); + + private Optional profileRequired = Optional.empty(); + + private Optional signup = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneAttribute other) { + identifier(other.getIdentifier()); + profileRequired(other.getProfileRequired()); + signup(other.getSignup()); + return this; + } + + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(ConnectionAttributeIdentifier identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

Determines if property should be required for users

+ */ + @JsonSetter(value = "profile_required", nulls = Nulls.SKIP) + public Builder profileRequired(Optional profileRequired) { + this.profileRequired = profileRequired; + return this; + } + + public Builder profileRequired(Boolean profileRequired) { + this.profileRequired = Optional.ofNullable(profileRequired); + return this; + } + + @JsonSetter(value = "signup", nulls = Nulls.SKIP) + public Builder signup(Optional signup) { + this.signup = signup; + return this; + } + + public Builder signup(SignupVerified signup) { + this.signup = Optional.ofNullable(signup); + return this; + } + + public PhoneAttribute build() { + return new PhoneAttribute(identifier, profileRequired, signup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java new file mode 100644 index 000000000..7d13e70b7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PhoneProviderConfiguration.Deserializer.class) +public final class PhoneProviderConfiguration { + private final Object value; + + private final int type; + + private PhoneProviderConfiguration(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TwilioProviderConfiguration) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomProviderConfiguration) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneProviderConfiguration && equalTo((PhoneProviderConfiguration) other); + } + + private boolean equalTo(PhoneProviderConfiguration other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PhoneProviderConfiguration of(TwilioProviderConfiguration value) { + return new PhoneProviderConfiguration(value, 0); + } + + public static PhoneProviderConfiguration of(CustomProviderConfiguration value) { + return new PhoneProviderConfiguration(value, 1); + } + + public interface Visitor { + T visit(TwilioProviderConfiguration value); + + T visit(CustomProviderConfiguration value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PhoneProviderConfiguration.class); + } + + @java.lang.Override + public PhoneProviderConfiguration deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TwilioProviderConfiguration.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomProviderConfiguration.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderCredentials.java new file mode 100644 index 000000000..6861f7eeb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderCredentials.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PhoneProviderCredentials.Deserializer.class) +public final class PhoneProviderCredentials { + private final Object value; + + private final int type; + + private PhoneProviderCredentials(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TwilioProviderCredentials) this.value); + } else if (this.type == 1) { + return visitor.visit((CustomProviderCredentials) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneProviderCredentials && equalTo((PhoneProviderCredentials) other); + } + + private boolean equalTo(PhoneProviderCredentials other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PhoneProviderCredentials of(TwilioProviderCredentials value) { + return new PhoneProviderCredentials(value, 0); + } + + public static PhoneProviderCredentials of(CustomProviderCredentials value) { + return new PhoneProviderCredentials(value, 1); + } + + public interface Visitor { + T visit(TwilioProviderCredentials value); + + T visit(CustomProviderCredentials value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PhoneProviderCredentials.class); + } + + @java.lang.Override + public PhoneProviderCredentials deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TwilioProviderCredentials.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CustomProviderCredentials.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderDeliveryMethodEnum.java new file mode 100644 index 000000000..bd2c7fb25 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderDeliveryMethodEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PhoneProviderDeliveryMethodEnum { + public static final PhoneProviderDeliveryMethodEnum TEXT = new PhoneProviderDeliveryMethodEnum(Value.TEXT, "text"); + + public static final PhoneProviderDeliveryMethodEnum VOICE = + new PhoneProviderDeliveryMethodEnum(Value.VOICE, "voice"); + + private final Value value; + + private final String string; + + PhoneProviderDeliveryMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PhoneProviderDeliveryMethodEnum + && this.string.equals(((PhoneProviderDeliveryMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TEXT: + return visitor.visitText(); + case VOICE: + return visitor.visitVoice(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PhoneProviderDeliveryMethodEnum valueOf(String value) { + switch (value) { + case "text": + return TEXT; + case "voice": + return VOICE; + default: + return new PhoneProviderDeliveryMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TEXT, + + VOICE, + + UNKNOWN + } + + public interface Visitor { + T visitText(); + + T visitVoice(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderNameEnum.java new file mode 100644 index 000000000..5e62462ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderNameEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PhoneProviderNameEnum { + public static final PhoneProviderNameEnum CUSTOM = new PhoneProviderNameEnum(Value.CUSTOM, "custom"); + + public static final PhoneProviderNameEnum TWILIO = new PhoneProviderNameEnum(Value.TWILIO, "twilio"); + + private final Value value; + + private final String string; + + PhoneProviderNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PhoneProviderNameEnum + && this.string.equals(((PhoneProviderNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOM: + return visitor.visitCustom(); + case TWILIO: + return visitor.visitTwilio(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PhoneProviderNameEnum valueOf(String value) { + switch (value) { + case "custom": + return CUSTOM; + case "twilio": + return TWILIO; + default: + return new PhoneProviderNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TWILIO, + + CUSTOM, + + UNKNOWN + } + + public interface Visitor { + T visitTwilio(); + + T visitCustom(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderSchemaMasked.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderSchemaMasked.java new file mode 100644 index 000000000..e47c38168 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderSchemaMasked.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneProviderSchemaMasked.Builder.class) +public final class PhoneProviderSchemaMasked { + private final Optional id; + + private final Optional tenant; + + private final PhoneProviderNameEnum name; + + private final Optional channel; + + private final Optional disabled; + + private final Optional configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private PhoneProviderSchemaMasked( + Optional id, + Optional tenant, + PhoneProviderNameEnum name, + Optional channel, + Optional disabled, + Optional configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.tenant = tenant; + this.name = name; + this.channel = channel; + this.disabled = disabled; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the tenant + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("name") + public PhoneProviderNameEnum getName() { + return name; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + /** + * @return The provider's creation date and time in ISO 8601 format + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time of the last update to the provider in ISO 8601 format + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneProviderSchemaMasked && equalTo((PhoneProviderSchemaMasked) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneProviderSchemaMasked other) { + return id.equals(other.id) + && tenant.equals(other.tenant) + && name.equals(other.name) + && channel.equals(other.channel) + && disabled.equals(other.disabled) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.tenant, + this.name, + this.channel, + this.disabled, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull PhoneProviderNameEnum name); + + Builder from(PhoneProviderSchemaMasked other); + } + + public interface _FinalStage { + PhoneProviderSchemaMasked build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

The name of the tenant

+ */ + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(Optional disabled); + + _FinalStage disabled(Boolean disabled); + + _FinalStage configuration(Optional configuration); + + _FinalStage configuration(PhoneProviderConfiguration configuration); + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private PhoneProviderNameEnum name; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional configuration = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional channel = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhoneProviderSchemaMasked other) { + id(other.getId()); + tenant(other.getTenant()); + name(other.getName()); + channel(other.getChannel()); + disabled(other.getDisabled()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull PhoneProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public _FinalStage updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public _FinalStage configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public _FinalStage configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @java.lang.Override + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public _FinalStage disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + /** + *

The name of the tenant

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

The name of the tenant

+ */ + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public PhoneProviderSchemaMasked build() { + return new PhoneProviderSchemaMasked( + id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java new file mode 100644 index 000000000..b716bbf5f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java @@ -0,0 +1,280 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneTemplate.Builder.class) +public final class PhoneTemplate { + private final String id; + + private final Optional channel; + + private final Optional customizable; + + private final Optional tenant; + + private final PhoneTemplateContent content; + + private final PhoneTemplateNotificationTypeEnum type; + + private final boolean disabled; + + private final Map additionalProperties; + + private PhoneTemplate( + String id, + Optional channel, + Optional customizable, + Optional tenant, + PhoneTemplateContent content, + PhoneTemplateNotificationTypeEnum type, + boolean disabled, + Map additionalProperties) { + this.id = id; + this.channel = channel; + this.customizable = customizable; + this.tenant = tenant; + this.content = content; + this.type = type; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + @JsonProperty("customizable") + public Optional getCustomizable() { + return customizable; + } + + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("content") + public PhoneTemplateContent getContent() { + return content; + } + + @JsonProperty("type") + public PhoneTemplateNotificationTypeEnum getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public boolean getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneTemplate && equalTo((PhoneTemplate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneTemplate other) { + return id.equals(other.id) + && channel.equals(other.channel) + && customizable.equals(other.customizable) + && tenant.equals(other.tenant) + && content.equals(other.content) + && type.equals(other.type) + && disabled == other.disabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ContentStage id(@NotNull String id); + + Builder from(PhoneTemplate other); + } + + public interface ContentStage { + TypeStage content(@NotNull PhoneTemplateContent content); + } + + public interface TypeStage { + DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type); + } + + public interface DisabledStage { + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(boolean disabled); + } + + public interface _FinalStage { + PhoneTemplate build(); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + _FinalStage customizable(Optional customizable); + + _FinalStage customizable(Boolean customizable); + + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ContentStage, TypeStage, DisabledStage, _FinalStage { + private String id; + + private PhoneTemplateContent content; + + private PhoneTemplateNotificationTypeEnum type; + + private boolean disabled; + + private Optional tenant = Optional.empty(); + + private Optional customizable = Optional.empty(); + + private Optional channel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhoneTemplate other) { + id(other.getId()); + channel(other.getChannel()); + customizable(other.getCustomizable()); + tenant(other.getTenant()); + content(other.getContent()); + type(other.getType()); + disabled(other.getDisabled()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ContentStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public TypeStage content(@NotNull PhoneTemplateContent content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ *

Whether the template is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("disabled") + public _FinalStage disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage customizable(Boolean customizable) { + this.customizable = Optional.ofNullable(customizable); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customizable", nulls = Nulls.SKIP) + public _FinalStage customizable(Optional customizable) { + this.customizable = customizable; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + @java.lang.Override + public PhoneTemplate build() { + return new PhoneTemplate(id, channel, customizable, tenant, content, type, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java new file mode 100644 index 000000000..32949a808 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneTemplateBody.Builder.class) +public final class PhoneTemplateBody { + private final Optional text; + + private final Optional voice; + + private final Map additionalProperties; + + private PhoneTemplateBody(Optional text, Optional voice, Map additionalProperties) { + this.text = text; + this.voice = voice; + this.additionalProperties = additionalProperties; + } + + /** + * @return Content of the phone template for text notifications + */ + @JsonProperty("text") + public Optional getText() { + return text; + } + + /** + * @return Content of the phone template for voice notifications + */ + @JsonProperty("voice") + public Optional getVoice() { + return voice; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneTemplateBody && equalTo((PhoneTemplateBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneTemplateBody other) { + return text.equals(other.text) && voice.equals(other.voice); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.text, this.voice); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional text = Optional.empty(); + + private Optional voice = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneTemplateBody other) { + text(other.getText()); + voice(other.getVoice()); + return this; + } + + /** + *

Content of the phone template for text notifications

+ */ + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public Builder text(Optional text) { + this.text = text; + return this; + } + + public Builder text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + /** + *

Content of the phone template for voice notifications

+ */ + @JsonSetter(value = "voice", nulls = Nulls.SKIP) + public Builder voice(Optional voice) { + this.voice = voice; + return this; + } + + public Builder voice(String voice) { + this.voice = Optional.ofNullable(voice); + return this; + } + + public PhoneTemplateBody build() { + return new PhoneTemplateBody(text, voice, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java new file mode 100644 index 000000000..e6f6934fb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneTemplateContent.Builder.class) +public final class PhoneTemplateContent { + private final Optional syntax; + + private final Optional from; + + private final Optional body; + + private final Map additionalProperties; + + private PhoneTemplateContent( + Optional syntax, + Optional from, + Optional body, + Map additionalProperties) { + this.syntax = syntax; + this.from = from; + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("syntax") + public Optional getSyntax() { + return syntax; + } + + /** + * @return Default phone number to be used as 'from' when sending a phone notification + */ + @JsonProperty("from") + public Optional getFrom() { + return from; + } + + @JsonProperty("body") + public Optional getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneTemplateContent && equalTo((PhoneTemplateContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneTemplateContent other) { + return syntax.equals(other.syntax) && from.equals(other.from) && body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.syntax, this.from, this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional syntax = Optional.empty(); + + private Optional from = Optional.empty(); + + private Optional body = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneTemplateContent other) { + syntax(other.getSyntax()); + from(other.getFrom()); + body(other.getBody()); + return this; + } + + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public Builder syntax(Optional syntax) { + this.syntax = syntax; + return this; + } + + public Builder syntax(String syntax) { + this.syntax = Optional.ofNullable(syntax); + return this; + } + + /** + *

Default phone number to be used as 'from' when sending a phone notification

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(Optional from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = Optional.ofNullable(from); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(PhoneTemplateBody body) { + this.body = Optional.ofNullable(body); + return this; + } + + public PhoneTemplateContent build() { + return new PhoneTemplateContent(syntax, from, body, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java new file mode 100644 index 000000000..7a64e0b1e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PhoneTemplateNotificationTypeEnum { + public static final PhoneTemplateNotificationTypeEnum CHANGE_PASSWORD = + new PhoneTemplateNotificationTypeEnum(Value.CHANGE_PASSWORD, "change_password"); + + public static final PhoneTemplateNotificationTypeEnum OTP_VERIFY = + new PhoneTemplateNotificationTypeEnum(Value.OTP_VERIFY, "otp_verify"); + + public static final PhoneTemplateNotificationTypeEnum BLOCKED_ACCOUNT = + new PhoneTemplateNotificationTypeEnum(Value.BLOCKED_ACCOUNT, "blocked_account"); + + public static final PhoneTemplateNotificationTypeEnum OTP_ENROLL = + new PhoneTemplateNotificationTypeEnum(Value.OTP_ENROLL, "otp_enroll"); + + public static final PhoneTemplateNotificationTypeEnum PASSWORD_BREACH = + new PhoneTemplateNotificationTypeEnum(Value.PASSWORD_BREACH, "password_breach"); + + private final Value value; + + private final String string; + + PhoneTemplateNotificationTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PhoneTemplateNotificationTypeEnum + && this.string.equals(((PhoneTemplateNotificationTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CHANGE_PASSWORD: + return visitor.visitChangePassword(); + case OTP_VERIFY: + return visitor.visitOtpVerify(); + case BLOCKED_ACCOUNT: + return visitor.visitBlockedAccount(); + case OTP_ENROLL: + return visitor.visitOtpEnroll(); + case PASSWORD_BREACH: + return visitor.visitPasswordBreach(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PhoneTemplateNotificationTypeEnum valueOf(String value) { + switch (value) { + case "change_password": + return CHANGE_PASSWORD; + case "otp_verify": + return OTP_VERIFY; + case "blocked_account": + return BLOCKED_ACCOUNT; + case "otp_enroll": + return OTP_ENROLL; + case "password_breach": + return PASSWORD_BREACH; + default: + return new PhoneTemplateNotificationTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + OTP_VERIFY, + + OTP_ENROLL, + + CHANGE_PASSWORD, + + BLOCKED_ACCOUNT, + + PASSWORD_BREACH, + + UNKNOWN + } + + public interface Visitor { + T visitOtpVerify(); + + T visitOtpEnroll(); + + T visitChangePassword(); + + T visitBlockedAccount(); + + T visitPasswordBreach(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java new file mode 100644 index 000000000..17054e06f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PostClientCredentialResponseContent.Builder.class) +public final class PostClientCredentialResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional kid; + + private final Optional alg; + + private final Optional credentialType; + + private final Optional subjectDn; + + private final Optional thumbprintSha256; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private PostClientCredentialResponseContent( + Optional id, + Optional name, + Optional kid, + Optional alg, + Optional credentialType, + Optional subjectDn, + Optional thumbprintSha256, + Optional createdAt, + Optional updatedAt, + Optional expiresAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.kid = kid; + this.alg = alg; + this.credentialType = credentialType; + this.subjectDn = subjectDn; + this.thumbprintSha256 = thumbprintSha256; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the credential. Generated on creation. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name given to the credential by the user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The key identifier of the credential, generated on creation. + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + @JsonProperty("credential_type") + public Optional getCredentialType() { + return credentialType; + } + + /** + * @return The X509 certificate's Subject Distinguished Name + */ + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + /** + * @return The X509 certificate's SHA256 thumbprint + */ + @JsonProperty("thumbprint_sha256") + public Optional getThumbprintSha256() { + return thumbprintSha256; + } + + /** + * @return The ISO 8601 formatted date the credential was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date the credential was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PostClientCredentialResponseContent + && equalTo((PostClientCredentialResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PostClientCredentialResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && kid.equals(other.kid) + && alg.equals(other.alg) + && credentialType.equals(other.credentialType) + && subjectDn.equals(other.subjectDn) + && thumbprintSha256.equals(other.thumbprintSha256) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.kid, + this.alg, + this.credentialType, + this.subjectDn, + this.thumbprintSha256, + this.createdAt, + this.updatedAt, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional kid = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional credentialType = Optional.empty(); + + private Optional subjectDn = Optional.empty(); + + private Optional thumbprintSha256 = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PostClientCredentialResponseContent other) { + id(other.getId()); + name(other.getName()); + kid(other.getKid()); + alg(other.getAlg()); + credentialType(other.getCredentialType()); + subjectDn(other.getSubjectDn()); + thumbprintSha256(other.getThumbprintSha256()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

ID of the credential. Generated on creation.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name given to the credential by the user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The key identifier of the credential, generated on creation.

+ */ + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public Builder kid(Optional kid) { + this.kid = kid; + return this; + } + + public Builder kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public Builder alg(Optional alg) { + this.alg = alg; + return this; + } + + public Builder alg(ClientCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @JsonSetter(value = "credential_type", nulls = Nulls.SKIP) + public Builder credentialType(Optional credentialType) { + this.credentialType = credentialType; + return this; + } + + public Builder credentialType(ClientCredentialTypeEnum credentialType) { + this.credentialType = Optional.ofNullable(credentialType); + return this; + } + + /** + *

The X509 certificate's Subject Distinguished Name

+ */ + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public Builder subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + public Builder subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + /** + *

The X509 certificate's SHA256 thumbprint

+ */ + @JsonSetter(value = "thumbprint_sha256", nulls = Nulls.SKIP) + public Builder thumbprintSha256(Optional thumbprintSha256) { + this.thumbprintSha256 = thumbprintSha256; + return this; + } + + public Builder thumbprintSha256(String thumbprintSha256) { + this.thumbprintSha256 = Optional.ofNullable(thumbprintSha256); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The ISO 8601 formatted date the credential was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential.

+ */ + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + public PostClientCredentialResponseContent build() { + return new PostClientCredentialResponseContent( + id, + name, + kid, + alg, + credentialType, + subjectDn, + thumbprintSha256, + createdAt, + updatedAt, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java new file mode 100644 index 000000000..2ebd01e91 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PreferredAuthenticationMethodEnum { + public static final PreferredAuthenticationMethodEnum VOICE = + new PreferredAuthenticationMethodEnum(Value.VOICE, "voice"); + + public static final PreferredAuthenticationMethodEnum SMS = new PreferredAuthenticationMethodEnum(Value.SMS, "sms"); + + private final Value value; + + private final String string; + + PreferredAuthenticationMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PreferredAuthenticationMethodEnum + && this.string.equals(((PreferredAuthenticationMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case VOICE: + return visitor.visitVoice(); + case SMS: + return visitor.visitSms(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PreferredAuthenticationMethodEnum valueOf(String value) { + switch (value) { + case "voice": + return VOICE; + case "sms": + return SMS; + default: + return new PreferredAuthenticationMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + VOICE, + + SMS, + + UNKNOWN + } + + public interface Visitor { + T visitVoice(); + + T visitSms(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java new file mode 100644 index 000000000..6e3aef742 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PrivateKeyJwt.Builder.class) +public final class PrivateKeyJwt { + private final List credentials; + + private final Map additionalProperties; + + private PrivateKeyJwt(List credentials, Map additionalProperties) { + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credentials") + public List getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PrivateKeyJwt && equalTo((PrivateKeyJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PrivateKeyJwt other) { + return credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List credentials = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PrivateKeyJwt other) { + credentials(other.getCredentials()); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(List credentials) { + this.credentials.clear(); + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public Builder addCredentials(CredentialId credentials) { + this.credentials.add(credentials); + return this; + } + + public Builder addAllCredentials(List credentials) { + if (credentials != null) { + this.credentials.addAll(credentials); + } + return this; + } + + public PrivateKeyJwt build() { + return new PrivateKeyJwt(credentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java new file mode 100644 index 000000000..968940763 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java @@ -0,0 +1,427 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PromptGroupNameEnum { + public static final PromptGroupNameEnum MFA_PUSH = new PromptGroupNameEnum(Value.MFA_PUSH, "mfa-push"); + + public static final PromptGroupNameEnum CAPTCHA = new PromptGroupNameEnum(Value.CAPTCHA, "captcha"); + + public static final PromptGroupNameEnum EMAIL_IDENTIFIER_CHALLENGE = + new PromptGroupNameEnum(Value.EMAIL_IDENTIFIER_CHALLENGE, "email-identifier-challenge"); + + public static final PromptGroupNameEnum INVITATION = new PromptGroupNameEnum(Value.INVITATION, "invitation"); + + public static final PromptGroupNameEnum MFA_VOICE = new PromptGroupNameEnum(Value.MFA_VOICE, "mfa-voice"); + + public static final PromptGroupNameEnum SIGNUP = new PromptGroupNameEnum(Value.SIGNUP, "signup"); + + public static final PromptGroupNameEnum CUSTOMIZED_CONSENT = + new PromptGroupNameEnum(Value.CUSTOMIZED_CONSENT, "customized-consent"); + + public static final PromptGroupNameEnum BRUTE_FORCE_PROTECTION = + new PromptGroupNameEnum(Value.BRUTE_FORCE_PROTECTION, "brute-force-protection"); + + public static final PromptGroupNameEnum MFA = new PromptGroupNameEnum(Value.MFA, "mfa"); + + public static final PromptGroupNameEnum COMMON = new PromptGroupNameEnum(Value.COMMON, "common"); + + public static final PromptGroupNameEnum MFA_PHONE = new PromptGroupNameEnum(Value.MFA_PHONE, "mfa-phone"); + + public static final PromptGroupNameEnum CUSTOM_FORM = new PromptGroupNameEnum(Value.CUSTOM_FORM, "custom-form"); + + public static final PromptGroupNameEnum LOGOUT = new PromptGroupNameEnum(Value.LOGOUT, "logout"); + + public static final PromptGroupNameEnum PHONE_IDENTIFIER_ENROLLMENT = + new PromptGroupNameEnum(Value.PHONE_IDENTIFIER_ENROLLMENT, "phone-identifier-enrollment"); + + public static final PromptGroupNameEnum LOGIN_PASSWORD = + new PromptGroupNameEnum(Value.LOGIN_PASSWORD, "login-password"); + + public static final PromptGroupNameEnum LOGIN_EMAIL_VERIFICATION = + new PromptGroupNameEnum(Value.LOGIN_EMAIL_VERIFICATION, "login-email-verification"); + + public static final PromptGroupNameEnum ORGANIZATIONS = + new PromptGroupNameEnum(Value.ORGANIZATIONS, "organizations"); + + public static final PromptGroupNameEnum LOGIN_ID = new PromptGroupNameEnum(Value.LOGIN_ID, "login-id"); + + public static final PromptGroupNameEnum MFA_OTP = new PromptGroupNameEnum(Value.MFA_OTP, "mfa-otp"); + + public static final PromptGroupNameEnum STATUS = new PromptGroupNameEnum(Value.STATUS, "status"); + + public static final PromptGroupNameEnum EMAIL_OTP_CHALLENGE = + new PromptGroupNameEnum(Value.EMAIL_OTP_CHALLENGE, "email-otp-challenge"); + + public static final PromptGroupNameEnum CONSENT = new PromptGroupNameEnum(Value.CONSENT, "consent"); + + public static final PromptGroupNameEnum SIGNUP_ID = new PromptGroupNameEnum(Value.SIGNUP_ID, "signup-id"); + + public static final PromptGroupNameEnum LOGIN_PASSWORDLESS = + new PromptGroupNameEnum(Value.LOGIN_PASSWORDLESS, "login-passwordless"); + + public static final PromptGroupNameEnum MFA_SMS = new PromptGroupNameEnum(Value.MFA_SMS, "mfa-sms"); + + public static final PromptGroupNameEnum MFA_WEBAUTHN = new PromptGroupNameEnum(Value.MFA_WEBAUTHN, "mfa-webauthn"); + + public static final PromptGroupNameEnum RESET_PASSWORD = + new PromptGroupNameEnum(Value.RESET_PASSWORD, "reset-password"); + + public static final PromptGroupNameEnum MFA_RECOVERY_CODE = + new PromptGroupNameEnum(Value.MFA_RECOVERY_CODE, "mfa-recovery-code"); + + public static final PromptGroupNameEnum EMAIL_VERIFICATION = + new PromptGroupNameEnum(Value.EMAIL_VERIFICATION, "email-verification"); + + public static final PromptGroupNameEnum PASSKEYS = new PromptGroupNameEnum(Value.PASSKEYS, "passkeys"); + + public static final PromptGroupNameEnum LOGIN = new PromptGroupNameEnum(Value.LOGIN, "login"); + + public static final PromptGroupNameEnum SIGNUP_PASSWORD = + new PromptGroupNameEnum(Value.SIGNUP_PASSWORD, "signup-password"); + + public static final PromptGroupNameEnum PHONE_IDENTIFIER_CHALLENGE = + new PromptGroupNameEnum(Value.PHONE_IDENTIFIER_CHALLENGE, "phone-identifier-challenge"); + + public static final PromptGroupNameEnum DEVICE_FLOW = new PromptGroupNameEnum(Value.DEVICE_FLOW, "device-flow"); + + public static final PromptGroupNameEnum MFA_EMAIL = new PromptGroupNameEnum(Value.MFA_EMAIL, "mfa-email"); + + private final Value value; + + private final String string; + + PromptGroupNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PromptGroupNameEnum && this.string.equals(((PromptGroupNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MFA_PUSH: + return visitor.visitMfaPush(); + case CAPTCHA: + return visitor.visitCaptcha(); + case EMAIL_IDENTIFIER_CHALLENGE: + return visitor.visitEmailIdentifierChallenge(); + case INVITATION: + return visitor.visitInvitation(); + case MFA_VOICE: + return visitor.visitMfaVoice(); + case SIGNUP: + return visitor.visitSignup(); + case CUSTOMIZED_CONSENT: + return visitor.visitCustomizedConsent(); + case BRUTE_FORCE_PROTECTION: + return visitor.visitBruteForceProtection(); + case MFA: + return visitor.visitMfa(); + case COMMON: + return visitor.visitCommon(); + case MFA_PHONE: + return visitor.visitMfaPhone(); + case CUSTOM_FORM: + return visitor.visitCustomForm(); + case LOGOUT: + return visitor.visitLogout(); + case PHONE_IDENTIFIER_ENROLLMENT: + return visitor.visitPhoneIdentifierEnrollment(); + case LOGIN_PASSWORD: + return visitor.visitLoginPassword(); + case LOGIN_EMAIL_VERIFICATION: + return visitor.visitLoginEmailVerification(); + case ORGANIZATIONS: + return visitor.visitOrganizations(); + case LOGIN_ID: + return visitor.visitLoginId(); + case MFA_OTP: + return visitor.visitMfaOtp(); + case STATUS: + return visitor.visitStatus(); + case EMAIL_OTP_CHALLENGE: + return visitor.visitEmailOtpChallenge(); + case CONSENT: + return visitor.visitConsent(); + case SIGNUP_ID: + return visitor.visitSignupId(); + case LOGIN_PASSWORDLESS: + return visitor.visitLoginPasswordless(); + case MFA_SMS: + return visitor.visitMfaSms(); + case MFA_WEBAUTHN: + return visitor.visitMfaWebauthn(); + case RESET_PASSWORD: + return visitor.visitResetPassword(); + case MFA_RECOVERY_CODE: + return visitor.visitMfaRecoveryCode(); + case EMAIL_VERIFICATION: + return visitor.visitEmailVerification(); + case PASSKEYS: + return visitor.visitPasskeys(); + case LOGIN: + return visitor.visitLogin(); + case SIGNUP_PASSWORD: + return visitor.visitSignupPassword(); + case PHONE_IDENTIFIER_CHALLENGE: + return visitor.visitPhoneIdentifierChallenge(); + case DEVICE_FLOW: + return visitor.visitDeviceFlow(); + case MFA_EMAIL: + return visitor.visitMfaEmail(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PromptGroupNameEnum valueOf(String value) { + switch (value) { + case "mfa-push": + return MFA_PUSH; + case "captcha": + return CAPTCHA; + case "email-identifier-challenge": + return EMAIL_IDENTIFIER_CHALLENGE; + case "invitation": + return INVITATION; + case "mfa-voice": + return MFA_VOICE; + case "signup": + return SIGNUP; + case "customized-consent": + return CUSTOMIZED_CONSENT; + case "brute-force-protection": + return BRUTE_FORCE_PROTECTION; + case "mfa": + return MFA; + case "common": + return COMMON; + case "mfa-phone": + return MFA_PHONE; + case "custom-form": + return CUSTOM_FORM; + case "logout": + return LOGOUT; + case "phone-identifier-enrollment": + return PHONE_IDENTIFIER_ENROLLMENT; + case "login-password": + return LOGIN_PASSWORD; + case "login-email-verification": + return LOGIN_EMAIL_VERIFICATION; + case "organizations": + return ORGANIZATIONS; + case "login-id": + return LOGIN_ID; + case "mfa-otp": + return MFA_OTP; + case "status": + return STATUS; + case "email-otp-challenge": + return EMAIL_OTP_CHALLENGE; + case "consent": + return CONSENT; + case "signup-id": + return SIGNUP_ID; + case "login-passwordless": + return LOGIN_PASSWORDLESS; + case "mfa-sms": + return MFA_SMS; + case "mfa-webauthn": + return MFA_WEBAUTHN; + case "reset-password": + return RESET_PASSWORD; + case "mfa-recovery-code": + return MFA_RECOVERY_CODE; + case "email-verification": + return EMAIL_VERIFICATION; + case "passkeys": + return PASSKEYS; + case "login": + return LOGIN; + case "signup-password": + return SIGNUP_PASSWORD; + case "phone-identifier-challenge": + return PHONE_IDENTIFIER_CHALLENGE; + case "device-flow": + return DEVICE_FLOW; + case "mfa-email": + return MFA_EMAIL; + default: + return new PromptGroupNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LOGIN, + + LOGIN_ID, + + LOGIN_PASSWORD, + + LOGIN_PASSWORDLESS, + + LOGIN_EMAIL_VERIFICATION, + + SIGNUP, + + SIGNUP_ID, + + SIGNUP_PASSWORD, + + PHONE_IDENTIFIER_ENROLLMENT, + + PHONE_IDENTIFIER_CHALLENGE, + + EMAIL_IDENTIFIER_CHALLENGE, + + RESET_PASSWORD, + + CUSTOM_FORM, + + CONSENT, + + CUSTOMIZED_CONSENT, + + LOGOUT, + + MFA_PUSH, + + MFA_OTP, + + MFA_VOICE, + + MFA_PHONE, + + MFA_WEBAUTHN, + + MFA_SMS, + + MFA_EMAIL, + + MFA_RECOVERY_CODE, + + MFA, + + STATUS, + + DEVICE_FLOW, + + EMAIL_VERIFICATION, + + EMAIL_OTP_CHALLENGE, + + ORGANIZATIONS, + + INVITATION, + + COMMON, + + PASSKEYS, + + CAPTCHA, + + BRUTE_FORCE_PROTECTION, + + UNKNOWN + } + + public interface Visitor { + T visitLogin(); + + T visitLoginId(); + + T visitLoginPassword(); + + T visitLoginPasswordless(); + + T visitLoginEmailVerification(); + + T visitSignup(); + + T visitSignupId(); + + T visitSignupPassword(); + + T visitPhoneIdentifierEnrollment(); + + T visitPhoneIdentifierChallenge(); + + T visitEmailIdentifierChallenge(); + + T visitResetPassword(); + + T visitCustomForm(); + + T visitConsent(); + + T visitCustomizedConsent(); + + T visitLogout(); + + T visitMfaPush(); + + T visitMfaOtp(); + + T visitMfaVoice(); + + T visitMfaPhone(); + + T visitMfaWebauthn(); + + T visitMfaSms(); + + T visitMfaEmail(); + + T visitMfaRecoveryCode(); + + T visitMfa(); + + T visitStatus(); + + T visitDeviceFlow(); + + T visitEmailVerification(); + + T visitEmailOtpChallenge(); + + T visitOrganizations(); + + T visitInvitation(); + + T visitCommon(); + + T visitPasskeys(); + + T visitCaptcha(); + + T visitBruteForceProtection(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java new file mode 100644 index 000000000..355be8241 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java @@ -0,0 +1,873 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PromptLanguageEnum { + public static final PromptLanguageEnum AZ = new PromptLanguageEnum(Value.AZ, "az"); + + public static final PromptLanguageEnum MK = new PromptLanguageEnum(Value.MK, "mk"); + + public static final PromptLanguageEnum CA_ES = new PromptLanguageEnum(Value.CA_ES, "ca-ES"); + + public static final PromptLanguageEnum ML = new PromptLanguageEnum(Value.ML, "ml"); + + public static final PromptLanguageEnum TR = new PromptLanguageEnum(Value.TR, "tr"); + + public static final PromptLanguageEnum GU = new PromptLanguageEnum(Value.GU, "gu"); + + public static final PromptLanguageEnum ES_AR = new PromptLanguageEnum(Value.ES_AR, "es-AR"); + + public static final PromptLanguageEnum ID = new PromptLanguageEnum(Value.ID, "id"); + + public static final PromptLanguageEnum CNR = new PromptLanguageEnum(Value.CNR, "cnr"); + + public static final PromptLanguageEnum MN = new PromptLanguageEnum(Value.MN, "mn"); + + public static final PromptLanguageEnum FI = new PromptLanguageEnum(Value.FI, "fi"); + + public static final PromptLanguageEnum PL = new PromptLanguageEnum(Value.PL, "pl"); + + public static final PromptLanguageEnum EN_CA = new PromptLanguageEnum(Value.EN_CA, "en-CA"); + + public static final PromptLanguageEnum AR_EG = new PromptLanguageEnum(Value.AR_EG, "ar-EG"); + + public static final PromptLanguageEnum MR = new PromptLanguageEnum(Value.MR, "mr"); + + public static final PromptLanguageEnum MS = new PromptLanguageEnum(Value.MS, "ms"); + + public static final PromptLanguageEnum PT_PT = new PromptLanguageEnum(Value.PT_PT, "pt-PT"); + + public static final PromptLanguageEnum SK = new PromptLanguageEnum(Value.SK, "sk"); + + public static final PromptLanguageEnum SL = new PromptLanguageEnum(Value.SL, "sl"); + + public static final PromptLanguageEnum CS = new PromptLanguageEnum(Value.CS, "cs"); + + public static final PromptLanguageEnum UR = new PromptLanguageEnum(Value.UR, "ur"); + + public static final PromptLanguageEnum HU = new PromptLanguageEnum(Value.HU, "hu"); + + public static final PromptLanguageEnum TE = new PromptLanguageEnum(Value.TE, "te"); + + public static final PromptLanguageEnum ZH_CN = new PromptLanguageEnum(Value.ZH_CN, "zh-CN"); + + public static final PromptLanguageEnum AR_SA = new PromptLanguageEnum(Value.AR_SA, "ar-SA"); + + public static final PromptLanguageEnum SO = new PromptLanguageEnum(Value.SO, "so"); + + public static final PromptLanguageEnum FR = new PromptLanguageEnum(Value.FR, "fr"); + + public static final PromptLanguageEnum NO = new PromptLanguageEnum(Value.NO, "no"); + + public static final PromptLanguageEnum ZH_TW = new PromptLanguageEnum(Value.ZH_TW, "zh-TW"); + + public static final PromptLanguageEnum AR = new PromptLanguageEnum(Value.AR, "ar"); + + public static final PromptLanguageEnum PT = new PromptLanguageEnum(Value.PT, "pt"); + + public static final PromptLanguageEnum MY = new PromptLanguageEnum(Value.MY, "my"); + + public static final PromptLanguageEnum SQ = new PromptLanguageEnum(Value.SQ, "sq"); + + public static final PromptLanguageEnum HY = new PromptLanguageEnum(Value.HY, "hy"); + + public static final PromptLanguageEnum FR_FR = new PromptLanguageEnum(Value.FR_FR, "fr-FR"); + + public static final PromptLanguageEnum CY = new PromptLanguageEnum(Value.CY, "cy"); + + public static final PromptLanguageEnum PA = new PromptLanguageEnum(Value.PA, "pa"); + + public static final PromptLanguageEnum KA = new PromptLanguageEnum(Value.KA, "ka"); + + public static final PromptLanguageEnum IS = new PromptLanguageEnum(Value.IS, "is"); + + public static final PromptLanguageEnum FA = new PromptLanguageEnum(Value.FA, "fa"); + + public static final PromptLanguageEnum BN = new PromptLanguageEnum(Value.BN, "bn"); + + public static final PromptLanguageEnum PT_BR = new PromptLanguageEnum(Value.PT_BR, "pt-BR"); + + public static final PromptLanguageEnum SW = new PromptLanguageEnum(Value.SW, "sw"); + + public static final PromptLanguageEnum HI = new PromptLanguageEnum(Value.HI, "hi"); + + public static final PromptLanguageEnum EN = new PromptLanguageEnum(Value.EN, "en"); + + public static final PromptLanguageEnum NB = new PromptLanguageEnum(Value.NB, "nb"); + + public static final PromptLanguageEnum DA = new PromptLanguageEnum(Value.DA, "da"); + + public static final PromptLanguageEnum LT = new PromptLanguageEnum(Value.LT, "lt"); + + public static final PromptLanguageEnum BS = new PromptLanguageEnum(Value.BS, "bs"); + + public static final PromptLanguageEnum ES_MX = new PromptLanguageEnum(Value.ES_MX, "es-MX"); + + public static final PromptLanguageEnum LV = new PromptLanguageEnum(Value.LV, "lv"); + + public static final PromptLanguageEnum RO = new PromptLanguageEnum(Value.RO, "ro"); + + public static final PromptLanguageEnum UK = new PromptLanguageEnum(Value.UK, "uk"); + + public static final PromptLanguageEnum DE = new PromptLanguageEnum(Value.DE, "de"); + + public static final PromptLanguageEnum ES = new PromptLanguageEnum(Value.ES, "es"); + + public static final PromptLanguageEnum KK = new PromptLanguageEnum(Value.KK, "kk"); + + public static final PromptLanguageEnum ET = new PromptLanguageEnum(Value.ET, "et"); + + public static final PromptLanguageEnum TA = new PromptLanguageEnum(Value.TA, "ta"); + + public static final PromptLanguageEnum HR = new PromptLanguageEnum(Value.HR, "hr"); + + public static final PromptLanguageEnum KN = new PromptLanguageEnum(Value.KN, "kn"); + + public static final PromptLanguageEnum ZGH = new PromptLanguageEnum(Value.ZGH, "zgh"); + + public static final PromptLanguageEnum AM = new PromptLanguageEnum(Value.AM, "am"); + + public static final PromptLanguageEnum JA = new PromptLanguageEnum(Value.JA, "ja"); + + public static final PromptLanguageEnum KO = new PromptLanguageEnum(Value.KO, "ko"); + + public static final PromptLanguageEnum RU = new PromptLanguageEnum(Value.RU, "ru"); + + public static final PromptLanguageEnum NL = new PromptLanguageEnum(Value.NL, "nl"); + + public static final PromptLanguageEnum VI = new PromptLanguageEnum(Value.VI, "vi"); + + public static final PromptLanguageEnum BG = new PromptLanguageEnum(Value.BG, "bg"); + + public static final PromptLanguageEnum NN = new PromptLanguageEnum(Value.NN, "nn"); + + public static final PromptLanguageEnum GL_ES = new PromptLanguageEnum(Value.GL_ES, "gl-ES"); + + public static final PromptLanguageEnum TH = new PromptLanguageEnum(Value.TH, "th"); + + public static final PromptLanguageEnum SR = new PromptLanguageEnum(Value.SR, "sr"); + + public static final PromptLanguageEnum ES419 = new PromptLanguageEnum(Value.ES419, "es-419"); + + public static final PromptLanguageEnum HE = new PromptLanguageEnum(Value.HE, "he"); + + public static final PromptLanguageEnum ZH_HK = new PromptLanguageEnum(Value.ZH_HK, "zh-HK"); + + public static final PromptLanguageEnum EU_ES = new PromptLanguageEnum(Value.EU_ES, "eu-ES"); + + public static final PromptLanguageEnum TL = new PromptLanguageEnum(Value.TL, "tl"); + + public static final PromptLanguageEnum IT = new PromptLanguageEnum(Value.IT, "it"); + + public static final PromptLanguageEnum SV = new PromptLanguageEnum(Value.SV, "sv"); + + public static final PromptLanguageEnum FR_CA = new PromptLanguageEnum(Value.FR_CA, "fr-CA"); + + public static final PromptLanguageEnum EL = new PromptLanguageEnum(Value.EL, "el"); + + private final Value value; + + private final String string; + + PromptLanguageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PromptLanguageEnum && this.string.equals(((PromptLanguageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AZ: + return visitor.visitAz(); + case MK: + return visitor.visitMk(); + case CA_ES: + return visitor.visitCaEs(); + case ML: + return visitor.visitMl(); + case TR: + return visitor.visitTr(); + case GU: + return visitor.visitGu(); + case ES_AR: + return visitor.visitEsAr(); + case ID: + return visitor.visitId(); + case CNR: + return visitor.visitCnr(); + case MN: + return visitor.visitMn(); + case FI: + return visitor.visitFi(); + case PL: + return visitor.visitPl(); + case EN_CA: + return visitor.visitEnCa(); + case AR_EG: + return visitor.visitArEg(); + case MR: + return visitor.visitMr(); + case MS: + return visitor.visitMs(); + case PT_PT: + return visitor.visitPtPt(); + case SK: + return visitor.visitSk(); + case SL: + return visitor.visitSl(); + case CS: + return visitor.visitCs(); + case UR: + return visitor.visitUr(); + case HU: + return visitor.visitHu(); + case TE: + return visitor.visitTe(); + case ZH_CN: + return visitor.visitZhCn(); + case AR_SA: + return visitor.visitArSa(); + case SO: + return visitor.visitSo(); + case FR: + return visitor.visitFr(); + case NO: + return visitor.visitNo(); + case ZH_TW: + return visitor.visitZhTw(); + case AR: + return visitor.visitAr(); + case PT: + return visitor.visitPt(); + case MY: + return visitor.visitMy(); + case SQ: + return visitor.visitSq(); + case HY: + return visitor.visitHy(); + case FR_FR: + return visitor.visitFrFr(); + case CY: + return visitor.visitCy(); + case PA: + return visitor.visitPa(); + case KA: + return visitor.visitKa(); + case IS: + return visitor.visitIs(); + case FA: + return visitor.visitFa(); + case BN: + return visitor.visitBn(); + case PT_BR: + return visitor.visitPtBr(); + case SW: + return visitor.visitSw(); + case HI: + return visitor.visitHi(); + case EN: + return visitor.visitEn(); + case NB: + return visitor.visitNb(); + case DA: + return visitor.visitDa(); + case LT: + return visitor.visitLt(); + case BS: + return visitor.visitBs(); + case ES_MX: + return visitor.visitEsMx(); + case LV: + return visitor.visitLv(); + case RO: + return visitor.visitRo(); + case UK: + return visitor.visitUk(); + case DE: + return visitor.visitDe(); + case ES: + return visitor.visitEs(); + case KK: + return visitor.visitKk(); + case ET: + return visitor.visitEt(); + case TA: + return visitor.visitTa(); + case HR: + return visitor.visitHr(); + case KN: + return visitor.visitKn(); + case ZGH: + return visitor.visitZgh(); + case AM: + return visitor.visitAm(); + case JA: + return visitor.visitJa(); + case KO: + return visitor.visitKo(); + case RU: + return visitor.visitRu(); + case NL: + return visitor.visitNl(); + case VI: + return visitor.visitVi(); + case BG: + return visitor.visitBg(); + case NN: + return visitor.visitNn(); + case GL_ES: + return visitor.visitGlEs(); + case TH: + return visitor.visitTh(); + case SR: + return visitor.visitSr(); + case ES419: + return visitor.visitEs419(); + case HE: + return visitor.visitHe(); + case ZH_HK: + return visitor.visitZhHk(); + case EU_ES: + return visitor.visitEuEs(); + case TL: + return visitor.visitTl(); + case IT: + return visitor.visitIt(); + case SV: + return visitor.visitSv(); + case FR_CA: + return visitor.visitFrCa(); + case EL: + return visitor.visitEl(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PromptLanguageEnum valueOf(String value) { + switch (value) { + case "az": + return AZ; + case "mk": + return MK; + case "ca-ES": + return CA_ES; + case "ml": + return ML; + case "tr": + return TR; + case "gu": + return GU; + case "es-AR": + return ES_AR; + case "id": + return ID; + case "cnr": + return CNR; + case "mn": + return MN; + case "fi": + return FI; + case "pl": + return PL; + case "en-CA": + return EN_CA; + case "ar-EG": + return AR_EG; + case "mr": + return MR; + case "ms": + return MS; + case "pt-PT": + return PT_PT; + case "sk": + return SK; + case "sl": + return SL; + case "cs": + return CS; + case "ur": + return UR; + case "hu": + return HU; + case "te": + return TE; + case "zh-CN": + return ZH_CN; + case "ar-SA": + return AR_SA; + case "so": + return SO; + case "fr": + return FR; + case "no": + return NO; + case "zh-TW": + return ZH_TW; + case "ar": + return AR; + case "pt": + return PT; + case "my": + return MY; + case "sq": + return SQ; + case "hy": + return HY; + case "fr-FR": + return FR_FR; + case "cy": + return CY; + case "pa": + return PA; + case "ka": + return KA; + case "is": + return IS; + case "fa": + return FA; + case "bn": + return BN; + case "pt-BR": + return PT_BR; + case "sw": + return SW; + case "hi": + return HI; + case "en": + return EN; + case "nb": + return NB; + case "da": + return DA; + case "lt": + return LT; + case "bs": + return BS; + case "es-MX": + return ES_MX; + case "lv": + return LV; + case "ro": + return RO; + case "uk": + return UK; + case "de": + return DE; + case "es": + return ES; + case "kk": + return KK; + case "et": + return ET; + case "ta": + return TA; + case "hr": + return HR; + case "kn": + return KN; + case "zgh": + return ZGH; + case "am": + return AM; + case "ja": + return JA; + case "ko": + return KO; + case "ru": + return RU; + case "nl": + return NL; + case "vi": + return VI; + case "bg": + return BG; + case "nn": + return NN; + case "gl-ES": + return GL_ES; + case "th": + return TH; + case "sr": + return SR; + case "es-419": + return ES419; + case "he": + return HE; + case "zh-HK": + return ZH_HK; + case "eu-ES": + return EU_ES; + case "tl": + return TL; + case "it": + return IT; + case "sv": + return SV; + case "fr-CA": + return FR_CA; + case "el": + return EL; + default: + return new PromptLanguageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AM, + + AR, + + AR_EG, + + AR_SA, + + AZ, + + BG, + + BN, + + BS, + + CA_ES, + + CNR, + + CS, + + CY, + + DA, + + DE, + + EL, + + EN, + + EN_CA, + + ES, + + ES419, + + ES_AR, + + ES_MX, + + ET, + + EU_ES, + + FA, + + FI, + + FR, + + FR_CA, + + FR_FR, + + GL_ES, + + GU, + + HE, + + HI, + + HR, + + HU, + + HY, + + ID, + + IS, + + IT, + + JA, + + KA, + + KK, + + KN, + + KO, + + LT, + + LV, + + MK, + + ML, + + MN, + + MR, + + MS, + + MY, + + NB, + + NL, + + NN, + + NO, + + PA, + + PL, + + PT, + + PT_BR, + + PT_PT, + + RO, + + RU, + + SK, + + SL, + + SO, + + SQ, + + SR, + + SV, + + SW, + + TA, + + TE, + + TH, + + TL, + + TR, + + UK, + + UR, + + VI, + + ZGH, + + ZH_CN, + + ZH_HK, + + ZH_TW, + + UNKNOWN + } + + public interface Visitor { + T visitAm(); + + T visitAr(); + + T visitArEg(); + + T visitArSa(); + + T visitAz(); + + T visitBg(); + + T visitBn(); + + T visitBs(); + + T visitCaEs(); + + T visitCnr(); + + T visitCs(); + + T visitCy(); + + T visitDa(); + + T visitDe(); + + T visitEl(); + + T visitEn(); + + T visitEnCa(); + + T visitEs(); + + T visitEs419(); + + T visitEsAr(); + + T visitEsMx(); + + T visitEt(); + + T visitEuEs(); + + T visitFa(); + + T visitFi(); + + T visitFr(); + + T visitFrCa(); + + T visitFrFr(); + + T visitGlEs(); + + T visitGu(); + + T visitHe(); + + T visitHi(); + + T visitHr(); + + T visitHu(); + + T visitHy(); + + T visitId(); + + T visitIs(); + + T visitIt(); + + T visitJa(); + + T visitKa(); + + T visitKk(); + + T visitKn(); + + T visitKo(); + + T visitLt(); + + T visitLv(); + + T visitMk(); + + T visitMl(); + + T visitMn(); + + T visitMr(); + + T visitMs(); + + T visitMy(); + + T visitNb(); + + T visitNl(); + + T visitNn(); + + T visitNo(); + + T visitPa(); + + T visitPl(); + + T visitPt(); + + T visitPtBr(); + + T visitPtPt(); + + T visitRo(); + + T visitRu(); + + T visitSk(); + + T visitSl(); + + T visitSo(); + + T visitSq(); + + T visitSr(); + + T visitSv(); + + T visitSw(); + + T visitTa(); + + T visitTe(); + + T visitTh(); + + T visitTl(); + + T visitTr(); + + T visitUk(); + + T visitUr(); + + T visitVi(); + + T visitZgh(); + + T visitZhCn(); + + T visitZhHk(); + + T visitZhTw(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java new file mode 100644 index 000000000..bc9d81a3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java @@ -0,0 +1,303 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PublicKeyCredential.Builder.class) +public final class PublicKeyCredential { + private final String credentialType; + + private final Optional name; + + private final String pem; + + private final Optional alg; + + private final Optional parseExpiryFromCert; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private PublicKeyCredential( + String credentialType, + Optional name, + String pem, + Optional alg, + Optional parseExpiryFromCert, + Optional expiresAt, + Map additionalProperties) { + this.credentialType = credentialType; + this.name = name; + this.pem = pem; + this.alg = alg; + this.parseExpiryFromCert = parseExpiryFromCert; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credential_type") + public String getCredentialType() { + return credentialType; + } + + /** + * @return Friendly name for a credential. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped. + */ + @JsonProperty("pem") + public String getPem() { + return pem; + } + + @JsonProperty("alg") + public Optional getAlg() { + return alg; + } + + /** + * @return Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type. + */ + @JsonProperty("parse_expiry_from_cert") + public Optional getParseExpiryFromCert() { + return parseExpiryFromCert; + } + + /** + * @return The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PublicKeyCredential && equalTo((PublicKeyCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PublicKeyCredential other) { + return credentialType.equals(other.credentialType) + && name.equals(other.name) + && pem.equals(other.pem) + && alg.equals(other.alg) + && parseExpiryFromCert.equals(other.parseExpiryFromCert) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.credentialType, this.name, this.pem, this.alg, this.parseExpiryFromCert, this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CredentialTypeStage builder() { + return new Builder(); + } + + public interface CredentialTypeStage { + PemStage credentialType(@NotNull String credentialType); + + Builder from(PublicKeyCredential other); + } + + public interface PemStage { + /** + *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ */ + _FinalStage pem(@NotNull String pem); + } + + public interface _FinalStage { + PublicKeyCredential build(); + + /** + *

Friendly name for a credential.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage alg(Optional alg); + + _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg); + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ */ + _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert); + + _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert); + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ */ + _FinalStage expiresAt(Optional expiresAt); + + _FinalStage expiresAt(OffsetDateTime expiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CredentialTypeStage, PemStage, _FinalStage { + private String credentialType; + + private String pem; + + private Optional expiresAt = Optional.empty(); + + private Optional parseExpiryFromCert = Optional.empty(); + + private Optional alg = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PublicKeyCredential other) { + credentialType(other.getCredentialType()); + name(other.getName()); + pem(other.getPem()); + alg(other.getAlg()); + parseExpiryFromCert(other.getParseExpiryFromCert()); + expiresAt(other.getExpiresAt()); + return this; + } + + @java.lang.Override + @JsonSetter("credential_type") + public PemStage credentialType(@NotNull String credentialType) { + this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); + return this; + } + + /** + *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("pem") + public _FinalStage pem(@NotNull String pem) { + this.pem = Objects.requireNonNull(pem, "pem must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

+ */ + @java.lang.Override + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public _FinalStage expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { + this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); + return this; + } + + /** + *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

+ */ + @java.lang.Override + @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) + public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { + this.parseExpiryFromCert = parseExpiryFromCert; + return this; + } + + @java.lang.Override + public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { + this.alg = Optional.ofNullable(alg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "alg", nulls = Nulls.SKIP) + public _FinalStage alg(Optional alg) { + this.alg = alg; + return this; + } + + /** + *

Friendly name for a credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name for a credential.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public PublicKeyCredential build() { + return new PublicKeyCredential( + credentialType, name, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java new file mode 100644 index 000000000..01c10d3ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PublicKeyCredentialAlgorithmEnum { + public static final PublicKeyCredentialAlgorithmEnum PS256 = + new PublicKeyCredentialAlgorithmEnum(Value.PS256, "PS256"); + + public static final PublicKeyCredentialAlgorithmEnum RS256 = + new PublicKeyCredentialAlgorithmEnum(Value.RS256, "RS256"); + + public static final PublicKeyCredentialAlgorithmEnum RS384 = + new PublicKeyCredentialAlgorithmEnum(Value.RS384, "RS384"); + + private final Value value; + + private final String string; + + PublicKeyCredentialAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PublicKeyCredentialAlgorithmEnum + && this.string.equals(((PublicKeyCredentialAlgorithmEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PS256: + return visitor.visitPs256(); + case RS256: + return visitor.visitRs256(); + case RS384: + return visitor.visitRs384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PublicKeyCredentialAlgorithmEnum valueOf(String value) { + switch (value) { + case "PS256": + return PS256; + case "RS256": + return RS256; + case "RS384": + return RS384; + default: + return new PublicKeyCredentialAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RS256, + + RS384, + + PS256, + + UNKNOWN + } + + public interface Visitor { + T visitRs256(); + + T visitRs384(); + + T visitPs256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java new file mode 100644 index 000000000..71c44cc4e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = RefreshTokenDate.Deserializer.class) +public final class RefreshTokenDate { + private final Object value; + + private final int type; + + private RefreshTokenDate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((OffsetDateTime) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RefreshTokenDate && equalTo((RefreshTokenDate) other); + } + + private boolean equalTo(RefreshTokenDate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RefreshTokenDate of(OffsetDateTime value) { + return new RefreshTokenDate(value, 0); + } + + public static RefreshTokenDate of(Map value) { + return new RefreshTokenDate(value, 1); + } + + public interface Visitor { + T visit(OffsetDateTime value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RefreshTokenDate.class); + } + + @java.lang.Override + public RefreshTokenDate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, OffsetDateTime.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java new file mode 100644 index 000000000..cf85639bb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RefreshTokenDevice.Builder.class) +public final class RefreshTokenDevice { + private final Optional initialIp; + + private final Optional initialAsn; + + private final Optional initialUserAgent; + + private final Optional lastIp; + + private final Optional lastAsn; + + private final Optional lastUserAgent; + + private final Map additionalProperties; + + private RefreshTokenDevice( + Optional initialIp, + Optional initialAsn, + Optional initialUserAgent, + Optional lastIp, + Optional lastAsn, + Optional lastUserAgent, + Map additionalProperties) { + this.initialIp = initialIp; + this.initialAsn = initialAsn; + this.initialUserAgent = initialUserAgent; + this.lastIp = lastIp; + this.lastAsn = lastAsn; + this.lastUserAgent = lastUserAgent; + this.additionalProperties = additionalProperties; + } + + /** + * @return First IP address associated with the refresh token + */ + @JsonProperty("initial_ip") + public Optional getInitialIp() { + return initialIp; + } + + /** + * @return First autonomous system number associated with the refresh token + */ + @JsonProperty("initial_asn") + public Optional getInitialAsn() { + return initialAsn; + } + + /** + * @return First user agent associated with the refresh token + */ + @JsonProperty("initial_user_agent") + public Optional getInitialUserAgent() { + return initialUserAgent; + } + + /** + * @return Last IP address associated with the refresh token + */ + @JsonProperty("last_ip") + public Optional getLastIp() { + return lastIp; + } + + /** + * @return Last autonomous system number associated with the refresh token + */ + @JsonProperty("last_asn") + public Optional getLastAsn() { + return lastAsn; + } + + /** + * @return Last user agent associated with the refresh token + */ + @JsonProperty("last_user_agent") + public Optional getLastUserAgent() { + return lastUserAgent; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RefreshTokenDevice && equalTo((RefreshTokenDevice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RefreshTokenDevice other) { + return initialIp.equals(other.initialIp) + && initialAsn.equals(other.initialAsn) + && initialUserAgent.equals(other.initialUserAgent) + && lastIp.equals(other.lastIp) + && lastAsn.equals(other.lastAsn) + && lastUserAgent.equals(other.lastUserAgent); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.initialIp, this.initialAsn, this.initialUserAgent, this.lastIp, this.lastAsn, this.lastUserAgent); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional initialIp = Optional.empty(); + + private Optional initialAsn = Optional.empty(); + + private Optional initialUserAgent = Optional.empty(); + + private Optional lastIp = Optional.empty(); + + private Optional lastAsn = Optional.empty(); + + private Optional lastUserAgent = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RefreshTokenDevice other) { + initialIp(other.getInitialIp()); + initialAsn(other.getInitialAsn()); + initialUserAgent(other.getInitialUserAgent()); + lastIp(other.getLastIp()); + lastAsn(other.getLastAsn()); + lastUserAgent(other.getLastUserAgent()); + return this; + } + + /** + *

First IP address associated with the refresh token

+ */ + @JsonSetter(value = "initial_ip", nulls = Nulls.SKIP) + public Builder initialIp(Optional initialIp) { + this.initialIp = initialIp; + return this; + } + + public Builder initialIp(String initialIp) { + this.initialIp = Optional.ofNullable(initialIp); + return this; + } + + /** + *

First autonomous system number associated with the refresh token

+ */ + @JsonSetter(value = "initial_asn", nulls = Nulls.SKIP) + public Builder initialAsn(Optional initialAsn) { + this.initialAsn = initialAsn; + return this; + } + + public Builder initialAsn(String initialAsn) { + this.initialAsn = Optional.ofNullable(initialAsn); + return this; + } + + /** + *

First user agent associated with the refresh token

+ */ + @JsonSetter(value = "initial_user_agent", nulls = Nulls.SKIP) + public Builder initialUserAgent(Optional initialUserAgent) { + this.initialUserAgent = initialUserAgent; + return this; + } + + public Builder initialUserAgent(String initialUserAgent) { + this.initialUserAgent = Optional.ofNullable(initialUserAgent); + return this; + } + + /** + *

Last IP address associated with the refresh token

+ */ + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(Optional lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = Optional.ofNullable(lastIp); + return this; + } + + /** + *

Last autonomous system number associated with the refresh token

+ */ + @JsonSetter(value = "last_asn", nulls = Nulls.SKIP) + public Builder lastAsn(Optional lastAsn) { + this.lastAsn = lastAsn; + return this; + } + + public Builder lastAsn(String lastAsn) { + this.lastAsn = Optional.ofNullable(lastAsn); + return this; + } + + /** + *

Last user agent associated with the refresh token

+ */ + @JsonSetter(value = "last_user_agent", nulls = Nulls.SKIP) + public Builder lastUserAgent(Optional lastUserAgent) { + this.lastUserAgent = lastUserAgent; + return this; + } + + public Builder lastUserAgent(String lastUserAgent) { + this.lastUserAgent = Optional.ofNullable(lastUserAgent); + return this; + } + + public RefreshTokenDevice build() { + return new RefreshTokenDevice( + initialIp, initialAsn, initialUserAgent, lastIp, lastAsn, lastUserAgent, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java new file mode 100644 index 000000000..423edab00 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RefreshTokenExpirationTypeEnum { + public static final RefreshTokenExpirationTypeEnum EXPIRING = + new RefreshTokenExpirationTypeEnum(Value.EXPIRING, "expiring"); + + public static final RefreshTokenExpirationTypeEnum NON_EXPIRING = + new RefreshTokenExpirationTypeEnum(Value.NON_EXPIRING, "non-expiring"); + + private final Value value; + + private final String string; + + RefreshTokenExpirationTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof RefreshTokenExpirationTypeEnum + && this.string.equals(((RefreshTokenExpirationTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EXPIRING: + return visitor.visitExpiring(); + case NON_EXPIRING: + return visitor.visitNonExpiring(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RefreshTokenExpirationTypeEnum valueOf(String value) { + switch (value) { + case "expiring": + return EXPIRING; + case "non-expiring": + return NON_EXPIRING; + default: + return new RefreshTokenExpirationTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EXPIRING, + + NON_EXPIRING, + + UNKNOWN + } + + public interface Visitor { + T visitExpiring(); + + T visitNonExpiring(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java new file mode 100644 index 000000000..424d49153 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RefreshTokenResourceServer.Builder.class) +public final class RefreshTokenResourceServer { + private final Optional audience; + + private final Optional scopes; + + private final Map additionalProperties; + + private RefreshTokenResourceServer( + Optional audience, Optional scopes, Map additionalProperties) { + this.audience = audience; + this.scopes = scopes; + this.additionalProperties = additionalProperties; + } + + /** + * @return Resource server ID + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return List of scopes for the refresh token + */ + @JsonProperty("scopes") + public Optional getScopes() { + return scopes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RefreshTokenResourceServer && equalTo((RefreshTokenResourceServer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RefreshTokenResourceServer other) { + return audience.equals(other.audience) && scopes.equals(other.scopes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.audience, this.scopes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional audience = Optional.empty(); + + private Optional scopes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RefreshTokenResourceServer other) { + audience(other.getAudience()); + scopes(other.getScopes()); + return this; + } + + /** + *

Resource server ID

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

List of scopes for the refresh token

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(String scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + public RefreshTokenResourceServer build() { + return new RefreshTokenResourceServer(audience, scopes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java new file mode 100644 index 000000000..788f8e096 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java @@ -0,0 +1,424 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RefreshTokenResponseContent.Builder.class) +public final class RefreshTokenResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional device; + + private final Optional clientId; + + private final OptionalNullable sessionId; + + private final Optional rotating; + + private final Optional> resourceServers; + + private final Optional lastExchangedAt; + + private final Map additionalProperties; + + private RefreshTokenResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional device, + Optional clientId, + OptionalNullable sessionId, + Optional rotating, + Optional> resourceServers, + Optional lastExchangedAt, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.device = device; + this.clientId = clientId; + this.sessionId = sessionId; + this.rotating = rotating; + this.resourceServers = resourceServers; + this.lastExchangedAt = lastExchangedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the refresh token + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return ID of the client application granted with this refresh token + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + public OptionalNullable getSessionId() { + if (sessionId == null) { + return OptionalNullable.absent(); + } + return sessionId; + } + + /** + * @return True if the token is a rotating refresh token + */ + @JsonProperty("rotating") + public Optional getRotating() { + return rotating; + } + + /** + * @return A list of the resource server IDs associated to this refresh-token and their granted scopes + */ + @JsonProperty("resource_servers") + public Optional> getResourceServers() { + return resourceServers; + } + + @JsonProperty("last_exchanged_at") + public Optional getLastExchangedAt() { + return lastExchangedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + private OptionalNullable _getSessionId() { + return sessionId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RefreshTokenResponseContent && equalTo((RefreshTokenResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RefreshTokenResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && device.equals(other.device) + && clientId.equals(other.clientId) + && sessionId.equals(other.sessionId) + && rotating.equals(other.rotating) + && resourceServers.equals(other.resourceServers) + && lastExchangedAt.equals(other.lastExchangedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.idleExpiresAt, + this.expiresAt, + this.device, + this.clientId, + this.sessionId, + this.rotating, + this.resourceServers, + this.lastExchangedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private OptionalNullable sessionId = OptionalNullable.absent(); + + private Optional rotating = Optional.empty(); + + private Optional> resourceServers = Optional.empty(); + + private Optional lastExchangedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RefreshTokenResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + device(other.getDevice()); + clientId(other.getClientId()); + sessionId(other.getSessionId()); + rotating(other.getRotating()); + resourceServers(other.getResourceServers()); + lastExchangedAt(other.getLastExchangedAt()); + return this; + } + + /** + *

The ID of the refresh token

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(RefreshTokenDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(RefreshTokenDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(RefreshTokenDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(RefreshTokenDevice device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

ID of the client application granted with this refresh token

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "session_id", nulls = Nulls.SKIP) + public Builder sessionId(@Nullable OptionalNullable sessionId) { + this.sessionId = sessionId; + return this; + } + + public Builder sessionId(String sessionId) { + this.sessionId = OptionalNullable.of(sessionId); + return this; + } + + public Builder sessionId(Optional sessionId) { + if (sessionId.isPresent()) { + this.sessionId = OptionalNullable.of(sessionId.get()); + } else { + this.sessionId = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionId(com.auth0.client.mgmt.core.Nullable sessionId) { + if (sessionId.isNull()) { + this.sessionId = OptionalNullable.ofNull(); + } else if (sessionId.isEmpty()) { + this.sessionId = OptionalNullable.absent(); + } else { + this.sessionId = OptionalNullable.of(sessionId.get()); + } + return this; + } + + /** + *

True if the token is a rotating refresh token

+ */ + @JsonSetter(value = "rotating", nulls = Nulls.SKIP) + public Builder rotating(Optional rotating) { + this.rotating = rotating; + return this; + } + + public Builder rotating(Boolean rotating) { + this.rotating = Optional.ofNullable(rotating); + return this; + } + + /** + *

A list of the resource server IDs associated to this refresh-token and their granted scopes

+ */ + @JsonSetter(value = "resource_servers", nulls = Nulls.SKIP) + public Builder resourceServers(Optional> resourceServers) { + this.resourceServers = resourceServers; + return this; + } + + public Builder resourceServers(List resourceServers) { + this.resourceServers = Optional.ofNullable(resourceServers); + return this; + } + + @JsonSetter(value = "last_exchanged_at", nulls = Nulls.SKIP) + public Builder lastExchangedAt(Optional lastExchangedAt) { + this.lastExchangedAt = lastExchangedAt; + return this; + } + + public Builder lastExchangedAt(RefreshTokenDate lastExchangedAt) { + this.lastExchangedAt = Optional.ofNullable(lastExchangedAt); + return this; + } + + public RefreshTokenResponseContent build() { + return new RefreshTokenResponseContent( + id, + userId, + createdAt, + idleExpiresAt, + expiresAt, + device, + clientId, + sessionId, + rotating, + resourceServers, + lastExchangedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java new file mode 100644 index 000000000..e7ec8768c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RefreshTokenRotationTypeEnum { + public static final RefreshTokenRotationTypeEnum ROTATING = + new RefreshTokenRotationTypeEnum(Value.ROTATING, "rotating"); + + public static final RefreshTokenRotationTypeEnum NON_ROTATING = + new RefreshTokenRotationTypeEnum(Value.NON_ROTATING, "non-rotating"); + + private final Value value; + + private final String string; + + RefreshTokenRotationTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof RefreshTokenRotationTypeEnum + && this.string.equals(((RefreshTokenRotationTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ROTATING: + return visitor.visitRotating(); + case NON_ROTATING: + return visitor.visitNonRotating(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RefreshTokenRotationTypeEnum valueOf(String value) { + switch (value) { + case "rotating": + return ROTATING; + case "non-rotating": + return NON_ROTATING; + default: + return new RefreshTokenRotationTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ROTATING, + + NON_ROTATING, + + UNKNOWN + } + + public interface Visitor { + T visitRotating(); + + T visitNonRotating(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java new file mode 100644 index 000000000..e20b46a0e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateUsersRecoveryCodeResponseContent.Builder.class) +public final class RegenerateUsersRecoveryCodeResponseContent { + private final Optional recoveryCode; + + private final Map additionalProperties; + + private RegenerateUsersRecoveryCodeResponseContent( + Optional recoveryCode, Map additionalProperties) { + this.recoveryCode = recoveryCode; + this.additionalProperties = additionalProperties; + } + + /** + * @return New account recovery code. + */ + @JsonProperty("recovery_code") + public Optional getRecoveryCode() { + return recoveryCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateUsersRecoveryCodeResponseContent + && equalTo((RegenerateUsersRecoveryCodeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateUsersRecoveryCodeResponseContent other) { + return recoveryCode.equals(other.recoveryCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.recoveryCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional recoveryCode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RegenerateUsersRecoveryCodeResponseContent other) { + recoveryCode(other.getRecoveryCode()); + return this; + } + + /** + *

New account recovery code.

+ */ + @JsonSetter(value = "recovery_code", nulls = Nulls.SKIP) + public Builder recoveryCode(Optional recoveryCode) { + this.recoveryCode = recoveryCode; + return this; + } + + public Builder recoveryCode(String recoveryCode) { + this.recoveryCode = Optional.ofNullable(recoveryCode); + return this; + } + + public RegenerateUsersRecoveryCodeResponseContent build() { + return new RegenerateUsersRecoveryCodeResponseContent(recoveryCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java new file mode 100644 index 000000000..214459bc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResetPhoneTemplateResponseContent.Builder.class) +public final class ResetPhoneTemplateResponseContent { + private final String id; + + private final Optional channel; + + private final Optional customizable; + + private final Optional tenant; + + private final PhoneTemplateContent content; + + private final PhoneTemplateNotificationTypeEnum type; + + private final boolean disabled; + + private final Map additionalProperties; + + private ResetPhoneTemplateResponseContent( + String id, + Optional channel, + Optional customizable, + Optional tenant, + PhoneTemplateContent content, + PhoneTemplateNotificationTypeEnum type, + boolean disabled, + Map additionalProperties) { + this.id = id; + this.channel = channel; + this.customizable = customizable; + this.tenant = tenant; + this.content = content; + this.type = type; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + @JsonProperty("customizable") + public Optional getCustomizable() { + return customizable; + } + + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("content") + public PhoneTemplateContent getContent() { + return content; + } + + @JsonProperty("type") + public PhoneTemplateNotificationTypeEnum getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public boolean getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResetPhoneTemplateResponseContent && equalTo((ResetPhoneTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResetPhoneTemplateResponseContent other) { + return id.equals(other.id) + && channel.equals(other.channel) + && customizable.equals(other.customizable) + && tenant.equals(other.tenant) + && content.equals(other.content) + && type.equals(other.type) + && disabled == other.disabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ContentStage id(@NotNull String id); + + Builder from(ResetPhoneTemplateResponseContent other); + } + + public interface ContentStage { + TypeStage content(@NotNull PhoneTemplateContent content); + } + + public interface TypeStage { + DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type); + } + + public interface DisabledStage { + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(boolean disabled); + } + + public interface _FinalStage { + ResetPhoneTemplateResponseContent build(); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + _FinalStage customizable(Optional customizable); + + _FinalStage customizable(Boolean customizable); + + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ContentStage, TypeStage, DisabledStage, _FinalStage { + private String id; + + private PhoneTemplateContent content; + + private PhoneTemplateNotificationTypeEnum type; + + private boolean disabled; + + private Optional tenant = Optional.empty(); + + private Optional customizable = Optional.empty(); + + private Optional channel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ResetPhoneTemplateResponseContent other) { + id(other.getId()); + channel(other.getChannel()); + customizable(other.getCustomizable()); + tenant(other.getTenant()); + content(other.getContent()); + type(other.getType()); + disabled(other.getDisabled()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ContentStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public TypeStage content(@NotNull PhoneTemplateContent content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ *

Whether the template is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("disabled") + public _FinalStage disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage customizable(Boolean customizable) { + this.customizable = Optional.ofNullable(customizable); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customizable", nulls = Nulls.SKIP) + public _FinalStage customizable(Optional customizable) { + this.customizable = customizable; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + @java.lang.Override + public ResetPhoneTemplateResponseContent build() { + return new ResetPhoneTemplateResponseContent( + id, channel, customizable, tenant, content, type, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java new file mode 100644 index 000000000..d16121b94 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java @@ -0,0 +1,681 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServer.Builder.class) +public final class ResourceServer { + private final Optional id; + + private final Optional name; + + private final Optional isSystem; + + private final Optional identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional allowOfflineAccess; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional tokenLifetime; + + private final Optional tokenLifetimeForWeb; + + private final Optional enforcePolicies; + + private final Optional tokenDialect; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private ResourceServer( + Optional id, + Optional name, + Optional isSystem, + Optional identifier, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional allowOfflineAccess, + Optional skipConsentForVerifiableFirstPartyClients, + Optional tokenLifetime, + Optional tokenLifetimeForWeb, + Optional enforcePolicies, + Optional tokenDialect, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.id = id; + this.name = name; + this.isSystem = isSystem; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.allowOfflineAccess = allowOfflineAccess; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + this.enforcePolicies = enforcePolicies; + this.tokenDialect = tokenDialect; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the API (resource server). + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this is an Auth0 system API (true) or a custom API (false). + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value. + */ + @JsonProperty("token_lifetime_for_web") + public Optional getTokenLifetimeForWeb() { + return tokenLifetimeForWeb; + } + + /** + * @return Whether authorization polices are enforced (true) or unenforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServer && equalTo((ResourceServer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServer other) { + return id.equals(other.id) + && name.equals(other.name) + && isSystem.equals(other.isSystem) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) + && enforcePolicies.equals(other.enforcePolicies) + && tokenDialect.equals(other.tokenDialect) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.isSystem, + this.identifier, + this.scopes, + this.signingAlg, + this.signingSecret, + this.allowOfflineAccess, + this.skipConsentForVerifiableFirstPartyClients, + this.tokenLifetime, + this.tokenLifetimeForWeb, + this.enforcePolicies, + this.tokenDialect, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenLifetimeForWeb = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServer other) { + id(other.getId()); + name(other.getName()); + isSystem(other.getIsSystem()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + allowOfflineAccess(other.getAllowOfflineAccess()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); + enforcePolicies(other.getEnforcePolicies()); + tokenDialect(other.getTokenDialect()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

ID of the API (resource server).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this is an Auth0 system API (true) or a custom API (false).

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public Builder signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + public Builder signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public Builder allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + public Builder allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public Builder skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + public Builder skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value.

+ */ + @JsonSetter(value = "token_lifetime_for_web", nulls = Nulls.SKIP) + public Builder tokenLifetimeForWeb(Optional tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + return this; + } + + public Builder tokenLifetimeForWeb(Integer tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = Optional.ofNullable(tokenLifetimeForWeb); + return this; + } + + /** + *

Whether authorization polices are enforced (true) or unenforced (false).

+ */ + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public Builder enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + public Builder enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectResponseEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + public ResourceServer build() { + return new ResourceServer( + id, + name, + isSystem, + identifier, + scopes, + signingAlg, + signingSecret, + allowOfflineAccess, + skipConsentForVerifiableFirstPartyClients, + tokenLifetime, + tokenLifetimeForWeb, + enforcePolicies, + tokenDialect, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java new file mode 100644 index 000000000..cd6214c52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerProofOfPossession.Builder.class) +public final class ResourceServerProofOfPossession { + private final ResourceServerProofOfPossessionMechanismEnum mechanism; + + private final boolean required; + + private final Map additionalProperties; + + private ResourceServerProofOfPossession( + ResourceServerProofOfPossessionMechanismEnum mechanism, + boolean required, + Map additionalProperties) { + this.mechanism = mechanism; + this.required = required; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mechanism") + public ResourceServerProofOfPossessionMechanismEnum getMechanism() { + return mechanism; + } + + /** + * @return Whether the use of Proof-of-Possession is required for the resource server + */ + @JsonProperty("required") + public boolean getRequired() { + return required; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerProofOfPossession && equalTo((ResourceServerProofOfPossession) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerProofOfPossession other) { + return mechanism.equals(other.mechanism) && required == other.required; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mechanism, this.required); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MechanismStage builder() { + return new Builder(); + } + + public interface MechanismStage { + RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanismEnum mechanism); + + Builder from(ResourceServerProofOfPossession other); + } + + public interface RequiredStage { + /** + *

Whether the use of Proof-of-Possession is required for the resource server

+ */ + _FinalStage required(boolean required); + } + + public interface _FinalStage { + ResourceServerProofOfPossession build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MechanismStage, RequiredStage, _FinalStage { + private ResourceServerProofOfPossessionMechanismEnum mechanism; + + private boolean required; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ResourceServerProofOfPossession other) { + mechanism(other.getMechanism()); + required(other.getRequired()); + return this; + } + + @java.lang.Override + @JsonSetter("mechanism") + public RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanismEnum mechanism) { + this.mechanism = Objects.requireNonNull(mechanism, "mechanism must not be null"); + return this; + } + + /** + *

Whether the use of Proof-of-Possession is required for the resource server

+ *

Whether the use of Proof-of-Possession is required for the resource server

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("required") + public _FinalStage required(boolean required) { + this.required = required; + return this; + } + + @java.lang.Override + public ResourceServerProofOfPossession build() { + return new ResourceServerProofOfPossession(mechanism, required, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java new file mode 100644 index 000000000..365f9920a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerProofOfPossessionMechanismEnum { + public static final ResourceServerProofOfPossessionMechanismEnum DPOP = + new ResourceServerProofOfPossessionMechanismEnum(Value.DPOP, "dpop"); + + public static final ResourceServerProofOfPossessionMechanismEnum MTLS = + new ResourceServerProofOfPossessionMechanismEnum(Value.MTLS, "mtls"); + + private final Value value; + + private final String string; + + ResourceServerProofOfPossessionMechanismEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerProofOfPossessionMechanismEnum + && this.string.equals(((ResourceServerProofOfPossessionMechanismEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DPOP: + return visitor.visitDpop(); + case MTLS: + return visitor.visitMtls(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerProofOfPossessionMechanismEnum valueOf(String value) { + switch (value) { + case "dpop": + return DPOP; + case "mtls": + return MTLS; + default: + return new ResourceServerProofOfPossessionMechanismEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + MTLS, + + DPOP, + + UNKNOWN + } + + public interface Visitor { + T visitMtls(); + + T visitDpop(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java new file mode 100644 index 000000000..483429c0e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerScope.Builder.class) +public final class ResourceServerScope { + private final String value; + + private final Optional description; + + private final Map additionalProperties; + + private ResourceServerScope(String value, Optional description, Map additionalProperties) { + this.value = value; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return Value of this scope. + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + /** + * @return User-friendly description of this scope. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerScope && equalTo((ResourceServerScope) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerScope other) { + return value.equals(other.value) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ValueStage builder() { + return new Builder(); + } + + public interface ValueStage { + /** + *

Value of this scope.

+ */ + _FinalStage value(@NotNull String value); + + Builder from(ResourceServerScope other); + } + + public interface _FinalStage { + ResourceServerScope build(); + + /** + *

User-friendly description of this scope.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ValueStage, _FinalStage { + private String value; + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ResourceServerScope other) { + value(other.getValue()); + description(other.getDescription()); + return this; + } + + /** + *

Value of this scope.

+ *

Value of this scope.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + /** + *

User-friendly description of this scope.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

User-friendly description of this scope.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public ResourceServerScope build() { + return new ResourceServerScope(value, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java new file mode 100644 index 000000000..41d95ba20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerTokenDialectResponseEnum { + public static final ResourceServerTokenDialectResponseEnum RFC9068PROFILE = + new ResourceServerTokenDialectResponseEnum(Value.RFC9068PROFILE, "rfc9068_profile"); + + public static final ResourceServerTokenDialectResponseEnum ACCESS_TOKEN_AUTHZ = + new ResourceServerTokenDialectResponseEnum(Value.ACCESS_TOKEN_AUTHZ, "access_token_authz"); + + public static final ResourceServerTokenDialectResponseEnum RFC9068PROFILE_AUTHZ = + new ResourceServerTokenDialectResponseEnum(Value.RFC9068PROFILE_AUTHZ, "rfc9068_profile_authz"); + + public static final ResourceServerTokenDialectResponseEnum ACCESS_TOKEN = + new ResourceServerTokenDialectResponseEnum(Value.ACCESS_TOKEN, "access_token"); + + private final Value value; + + private final String string; + + ResourceServerTokenDialectResponseEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerTokenDialectResponseEnum + && this.string.equals(((ResourceServerTokenDialectResponseEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RFC9068PROFILE: + return visitor.visitRfc9068Profile(); + case ACCESS_TOKEN_AUTHZ: + return visitor.visitAccessTokenAuthz(); + case RFC9068PROFILE_AUTHZ: + return visitor.visitRfc9068ProfileAuthz(); + case ACCESS_TOKEN: + return visitor.visitAccessToken(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerTokenDialectResponseEnum valueOf(String value) { + switch (value) { + case "rfc9068_profile": + return RFC9068PROFILE; + case "access_token_authz": + return ACCESS_TOKEN_AUTHZ; + case "rfc9068_profile_authz": + return RFC9068PROFILE_AUTHZ; + case "access_token": + return ACCESS_TOKEN; + default: + return new ResourceServerTokenDialectResponseEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_TOKEN, + + ACCESS_TOKEN_AUTHZ, + + RFC9068PROFILE, + + RFC9068PROFILE_AUTHZ, + + UNKNOWN + } + + public interface Visitor { + T visitAccessToken(); + + T visitAccessTokenAuthz(); + + T visitRfc9068Profile(); + + T visitRfc9068ProfileAuthz(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java new file mode 100644 index 000000000..8124b2690 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerTokenDialectSchemaEnum { + public static final ResourceServerTokenDialectSchemaEnum RFC9068PROFILE = + new ResourceServerTokenDialectSchemaEnum(Value.RFC9068PROFILE, "rfc9068_profile"); + + public static final ResourceServerTokenDialectSchemaEnum ACCESS_TOKEN_AUTHZ = + new ResourceServerTokenDialectSchemaEnum(Value.ACCESS_TOKEN_AUTHZ, "access_token_authz"); + + public static final ResourceServerTokenDialectSchemaEnum RFC9068PROFILE_AUTHZ = + new ResourceServerTokenDialectSchemaEnum(Value.RFC9068PROFILE_AUTHZ, "rfc9068_profile_authz"); + + public static final ResourceServerTokenDialectSchemaEnum ACCESS_TOKEN = + new ResourceServerTokenDialectSchemaEnum(Value.ACCESS_TOKEN, "access_token"); + + private final Value value; + + private final String string; + + ResourceServerTokenDialectSchemaEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerTokenDialectSchemaEnum + && this.string.equals(((ResourceServerTokenDialectSchemaEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RFC9068PROFILE: + return visitor.visitRfc9068Profile(); + case ACCESS_TOKEN_AUTHZ: + return visitor.visitAccessTokenAuthz(); + case RFC9068PROFILE_AUTHZ: + return visitor.visitRfc9068ProfileAuthz(); + case ACCESS_TOKEN: + return visitor.visitAccessToken(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerTokenDialectSchemaEnum valueOf(String value) { + switch (value) { + case "rfc9068_profile": + return RFC9068PROFILE; + case "access_token_authz": + return ACCESS_TOKEN_AUTHZ; + case "rfc9068_profile_authz": + return RFC9068PROFILE_AUTHZ; + case "access_token": + return ACCESS_TOKEN; + default: + return new ResourceServerTokenDialectSchemaEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_TOKEN, + + ACCESS_TOKEN_AUTHZ, + + RFC9068PROFILE, + + RFC9068PROFILE_AUTHZ, + + UNKNOWN + } + + public interface Visitor { + T visitAccessToken(); + + T visitAccessTokenAuthz(); + + T visitRfc9068Profile(); + + T visitRfc9068ProfileAuthz(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java new file mode 100644 index 000000000..468eb7521 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerTokenEncryption.Builder.class) +public final class ResourceServerTokenEncryption { + private final String format; + + private final ResourceServerTokenEncryptionKey encryptionKey; + + private final Map additionalProperties; + + private ResourceServerTokenEncryption( + String format, ResourceServerTokenEncryptionKey encryptionKey, Map additionalProperties) { + this.format = format; + this.encryptionKey = encryptionKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("format") + public String getFormat() { + return format; + } + + @JsonProperty("encryption_key") + public ResourceServerTokenEncryptionKey getEncryptionKey() { + return encryptionKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerTokenEncryption && equalTo((ResourceServerTokenEncryption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerTokenEncryption other) { + return format.equals(other.format) && encryptionKey.equals(other.encryptionKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.format, this.encryptionKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FormatStage builder() { + return new Builder(); + } + + public interface FormatStage { + EncryptionKeyStage format(@NotNull String format); + + Builder from(ResourceServerTokenEncryption other); + } + + public interface EncryptionKeyStage { + _FinalStage encryptionKey(@NotNull ResourceServerTokenEncryptionKey encryptionKey); + } + + public interface _FinalStage { + ResourceServerTokenEncryption build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FormatStage, EncryptionKeyStage, _FinalStage { + private String format; + + private ResourceServerTokenEncryptionKey encryptionKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ResourceServerTokenEncryption other) { + format(other.getFormat()); + encryptionKey(other.getEncryptionKey()); + return this; + } + + @java.lang.Override + @JsonSetter("format") + public EncryptionKeyStage format(@NotNull String format) { + this.format = Objects.requireNonNull(format, "format must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("encryption_key") + public _FinalStage encryptionKey(@NotNull ResourceServerTokenEncryptionKey encryptionKey) { + this.encryptionKey = Objects.requireNonNull(encryptionKey, "encryptionKey must not be null"); + return this; + } + + @java.lang.Override + public ResourceServerTokenEncryption build() { + return new ResourceServerTokenEncryption(format, encryptionKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java new file mode 100644 index 000000000..ad694adff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerTokenEncryptionAlgorithmEnum { + public static final ResourceServerTokenEncryptionAlgorithmEnum RSA_OAEP256 = + new ResourceServerTokenEncryptionAlgorithmEnum(Value.RSA_OAEP256, "RSA-OAEP-256"); + + public static final ResourceServerTokenEncryptionAlgorithmEnum RSA_OAEP512 = + new ResourceServerTokenEncryptionAlgorithmEnum(Value.RSA_OAEP512, "RSA-OAEP-512"); + + public static final ResourceServerTokenEncryptionAlgorithmEnum RSA_OAEP384 = + new ResourceServerTokenEncryptionAlgorithmEnum(Value.RSA_OAEP384, "RSA-OAEP-384"); + + private final Value value; + + private final String string; + + ResourceServerTokenEncryptionAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerTokenEncryptionAlgorithmEnum + && this.string.equals(((ResourceServerTokenEncryptionAlgorithmEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RSA_OAEP256: + return visitor.visitRsaOaep256(); + case RSA_OAEP512: + return visitor.visitRsaOaep512(); + case RSA_OAEP384: + return visitor.visitRsaOaep384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerTokenEncryptionAlgorithmEnum valueOf(String value) { + switch (value) { + case "RSA-OAEP-256": + return RSA_OAEP256; + case "RSA-OAEP-512": + return RSA_OAEP512; + case "RSA-OAEP-384": + return RSA_OAEP384; + default: + return new ResourceServerTokenEncryptionAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RSA_OAEP256, + + RSA_OAEP384, + + RSA_OAEP512, + + UNKNOWN + } + + public interface Visitor { + T visitRsaOaep256(); + + T visitRsaOaep384(); + + T visitRsaOaep512(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java new file mode 100644 index 000000000..6715e0f2c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerTokenEncryptionKey.Builder.class) +public final class ResourceServerTokenEncryptionKey { + private final Optional name; + + private final ResourceServerTokenEncryptionAlgorithmEnum alg; + + private final Optional kid; + + private final String pem; + + private final Map additionalProperties; + + private ResourceServerTokenEncryptionKey( + Optional name, + ResourceServerTokenEncryptionAlgorithmEnum alg, + Optional kid, + String pem, + Map additionalProperties) { + this.name = name; + this.alg = alg; + this.kid = kid; + this.pem = pem; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the encryption key. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("alg") + public ResourceServerTokenEncryptionAlgorithmEnum getAlg() { + return alg; + } + + /** + * @return Key ID. + */ + @JsonProperty("kid") + public Optional getKid() { + return kid; + } + + /** + * @return PEM-formatted public key. Must be JSON escaped. + */ + @JsonProperty("pem") + public String getPem() { + return pem; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerTokenEncryptionKey && equalTo((ResourceServerTokenEncryptionKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerTokenEncryptionKey other) { + return name.equals(other.name) && alg.equals(other.alg) && kid.equals(other.kid) && pem.equals(other.pem); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.alg, this.kid, this.pem); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AlgStage builder() { + return new Builder(); + } + + public interface AlgStage { + PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg); + + Builder from(ResourceServerTokenEncryptionKey other); + } + + public interface PemStage { + /** + *

PEM-formatted public key. Must be JSON escaped.

+ */ + _FinalStage pem(@NotNull String pem); + } + + public interface _FinalStage { + ResourceServerTokenEncryptionKey build(); + + /** + *

Name of the encryption key.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Key ID.

+ */ + _FinalStage kid(Optional kid); + + _FinalStage kid(String kid); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AlgStage, PemStage, _FinalStage { + private ResourceServerTokenEncryptionAlgorithmEnum alg; + + private String pem; + + private Optional kid = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ResourceServerTokenEncryptionKey other) { + name(other.getName()); + alg(other.getAlg()); + kid(other.getKid()); + pem(other.getPem()); + return this; + } + + @java.lang.Override + @JsonSetter("alg") + public PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg) { + this.alg = Objects.requireNonNull(alg, "alg must not be null"); + return this; + } + + /** + *

PEM-formatted public key. Must be JSON escaped.

+ *

PEM-formatted public key. Must be JSON escaped.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("pem") + public _FinalStage pem(@NotNull String pem) { + this.pem = Objects.requireNonNull(pem, "pem must not be null"); + return this; + } + + /** + *

Key ID.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage kid(String kid) { + this.kid = Optional.ofNullable(kid); + return this; + } + + /** + *

Key ID.

+ */ + @java.lang.Override + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public _FinalStage kid(Optional kid) { + this.kid = kid; + return this; + } + + /** + *

Name of the encryption key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Name of the encryption key.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public ResourceServerTokenEncryptionKey build() { + return new ResourceServerTokenEncryptionKey(name, alg, kid, pem, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java new file mode 100644 index 000000000..7c0ebc5d8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RevokeUserAccessRequestContent.Builder.class) +public final class RevokeUserAccessRequestContent { + private final Optional sessionId; + + private final Optional preserveRefreshTokens; + + private final Map additionalProperties; + + private RevokeUserAccessRequestContent( + Optional sessionId, + Optional preserveRefreshTokens, + Map additionalProperties) { + this.sessionId = sessionId; + this.preserveRefreshTokens = preserveRefreshTokens; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the session to revoke. + */ + @JsonProperty("session_id") + public Optional getSessionId() { + return sessionId; + } + + /** + * @return Whether to preserve the refresh tokens associated with the session. + */ + @JsonProperty("preserve_refresh_tokens") + public Optional getPreserveRefreshTokens() { + return preserveRefreshTokens; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RevokeUserAccessRequestContent && equalTo((RevokeUserAccessRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RevokeUserAccessRequestContent other) { + return sessionId.equals(other.sessionId) && preserveRefreshTokens.equals(other.preserveRefreshTokens); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sessionId, this.preserveRefreshTokens); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sessionId = Optional.empty(); + + private Optional preserveRefreshTokens = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RevokeUserAccessRequestContent other) { + sessionId(other.getSessionId()); + preserveRefreshTokens(other.getPreserveRefreshTokens()); + return this; + } + + /** + *

ID of the session to revoke.

+ */ + @JsonSetter(value = "session_id", nulls = Nulls.SKIP) + public Builder sessionId(Optional sessionId) { + this.sessionId = sessionId; + return this; + } + + public Builder sessionId(String sessionId) { + this.sessionId = Optional.ofNullable(sessionId); + return this; + } + + /** + *

Whether to preserve the refresh tokens associated with the session.

+ */ + @JsonSetter(value = "preserve_refresh_tokens", nulls = Nulls.SKIP) + public Builder preserveRefreshTokens(Optional preserveRefreshTokens) { + this.preserveRefreshTokens = preserveRefreshTokens; + return this; + } + + public Builder preserveRefreshTokens(Boolean preserveRefreshTokens) { + this.preserveRefreshTokens = Optional.ofNullable(preserveRefreshTokens); + return this; + } + + public RevokeUserAccessRequestContent build() { + return new RevokeUserAccessRequestContent(sessionId, preserveRefreshTokens, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java new file mode 100644 index 000000000..480903d04 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RevokedSigningKeysResponseContent.Builder.class) +public final class RevokedSigningKeysResponseContent { + private final String cert; + + private final String kid; + + private final Map additionalProperties; + + private RevokedSigningKeysResponseContent(String cert, String kid, Map additionalProperties) { + this.cert = cert; + this.kid = kid; + this.additionalProperties = additionalProperties; + } + + /** + * @return Revoked key certificate + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return Revoked key id + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RevokedSigningKeysResponseContent && equalTo((RevokedSigningKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RevokedSigningKeysResponseContent other) { + return cert.equals(other.cert) && kid.equals(other.kid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cert, this.kid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CertStage builder() { + return new Builder(); + } + + public interface CertStage { + /** + *

Revoked key certificate

+ */ + KidStage cert(@NotNull String cert); + + Builder from(RevokedSigningKeysResponseContent other); + } + + public interface KidStage { + /** + *

Revoked key id

+ */ + _FinalStage kid(@NotNull String kid); + } + + public interface _FinalStage { + RevokedSigningKeysResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CertStage, KidStage, _FinalStage { + private String cert; + + private String kid; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RevokedSigningKeysResponseContent other) { + cert(other.getCert()); + kid(other.getKid()); + return this; + } + + /** + *

Revoked key certificate

+ *

Revoked key certificate

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public KidStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

Revoked key id

+ *

Revoked key id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public _FinalStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + public RevokedSigningKeysResponseContent build() { + return new RevokedSigningKeysResponseContent(cert, kid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Role.java b/src/main/java/com/auth0/client/mgmt/types/Role.java new file mode 100644 index 000000000..6fb817d6a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Role.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Role.Builder.class) +public final class Role { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Map additionalProperties; + + private Role( + Optional id, + Optional name, + Optional description, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this role. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of this role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Role && equalTo((Role) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Role other) { + return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Role other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

ID for this role.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Description of this role.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public Role build() { + return new Role(id, name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RoleUser.java b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java new file mode 100644 index 000000000..7e84435cc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RoleUser.Builder.class) +public final class RoleUser { + private final Optional userId; + + private final Optional picture; + + private final Optional name; + + private final Optional email; + + private final Map additionalProperties; + + private RoleUser( + Optional userId, + Optional picture, + Optional name, + Optional email, + Map additionalProperties) { + this.userId = userId; + this.picture = picture; + this.name = name; + this.email = email; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this user. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return URL to a picture for this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RoleUser && equalTo((RoleUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RoleUser other) { + return userId.equals(other.userId) + && picture.equals(other.picture) + && name.equals(other.name) + && email.equals(other.email); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userId, this.picture, this.name, this.email); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional email = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RoleUser other) { + userId(other.getUserId()); + picture(other.getPicture()); + name(other.getName()); + email(other.getEmail()); + return this; + } + + /** + *

ID of this user.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

URL to a picture for this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + public RoleUser build() { + return new RoleUser(userId, picture, name, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java new file mode 100644 index 000000000..e987123bf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java @@ -0,0 +1,1663 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RotateClientSecretResponseContent.Builder.class) +public final class RotateClientSecretResponseContent { + private final Optional clientId; + + private final Optional tenant; + + private final Optional name; + + private final Optional description; + + private final Optional global; + + private final Optional clientSecret; + + private final Optional appType; + + private final Optional logoUri; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional> callbacks; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final OptionalNullable sessionTransfer; + + private final Optional oidcLogout; + + private final Optional> grantTypes; + + private final Optional jwtConfiguration; + + private final Optional> signingKeys; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional ssoDisabled; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional tokenEndpointAuthMethod; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private RotateClientSecretResponseContent( + Optional clientId, + Optional tenant, + Optional name, + Optional description, + Optional global, + Optional clientSecret, + Optional appType, + Optional logoUri, + Optional isFirstParty, + Optional oidcConformant, + Optional> callbacks, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + OptionalNullable sessionTransfer, + Optional oidcLogout, + Optional> grantTypes, + Optional jwtConfiguration, + Optional> signingKeys, + OptionalNullable encryptionKey, + Optional sso, + Optional ssoDisabled, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional tokenEndpointAuthMethod, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Map additionalProperties) { + this.clientId = clientId; + this.tenant = tenant; + this.name = name; + this.description = description; + this.global = global; + this.clientSecret = clientSecret; + this.appType = appType; + this.logoUri = logoUri; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.callbacks = callbacks; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionTransfer = sessionTransfer; + this.oidcLogout = oidcLogout; + this.grantTypes = grantTypes; + this.jwtConfiguration = jwtConfiguration; + this.signingKeys = signingKeys; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.ssoDisabled = ssoDisabled; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the tenant this client belongs to. + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). + */ + @JsonProperty("global") + public Optional getGlobal() { + return global; + } + + /** + * @return Client secret (which you must not make public). + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. + */ + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Whether this client a first party client (true) or not (false). + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonProperty("signing_keys") + public Optional> getSigningKeys() { + return signingKeys; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether Single Sign On is disabled (true) or enabled (true). Defaults to true. + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return Whether a custom login page is to be used (true) or the default provided login page (false). + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RotateClientSecretResponseContent && equalTo((RotateClientSecretResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RotateClientSecretResponseContent other) { + return clientId.equals(other.clientId) + && tenant.equals(other.tenant) + && name.equals(other.name) + && description.equals(other.description) + && global.equals(other.global) + && clientSecret.equals(other.clientSecret) + && appType.equals(other.appType) + && logoUri.equals(other.logoUri) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && callbacks.equals(other.callbacks) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionTransfer.equals(other.sessionTransfer) + && oidcLogout.equals(other.oidcLogout) + && grantTypes.equals(other.grantTypes) + && jwtConfiguration.equals(other.jwtConfiguration) + && signingKeys.equals(other.signingKeys) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && ssoDisabled.equals(other.ssoDisabled) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.tenant, + this.name, + this.description, + this.global, + this.clientSecret, + this.appType, + this.logoUri, + this.isFirstParty, + this.oidcConformant, + this.callbacks, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.sessionTransfer, + this.oidcLogout, + this.grantTypes, + this.jwtConfiguration, + this.signingKeys, + this.encryptionKey, + this.sso, + this.ssoDisabled, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.tokenEndpointAuthMethod, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional global = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional> signingKeys = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private Optional organizationUsage = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RotateClientSecretResponseContent other) { + clientId(other.getClientId()); + tenant(other.getTenant()); + name(other.getName()); + description(other.getDescription()); + global(other.getGlobal()); + clientSecret(other.getClientSecret()); + appType(other.getAppType()); + logoUri(other.getLogoUri()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + callbacks(other.getCallbacks()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionTransfer(other.getSessionTransfer()); + oidcLogout(other.getOidcLogout()); + grantTypes(other.getGrantTypes()); + jwtConfiguration(other.getJwtConfiguration()); + signingKeys(other.getSigningKeys()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + ssoDisabled(other.getSsoDisabled()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

ID of this client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the tenant this client belongs to.

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).

+ */ + @JsonSetter(value = "global", nulls = Nulls.SKIP) + public Builder global(Optional global) { + this.global = global; + return this; + } + + public Builder global(Boolean global) { + this.global = Optional.ofNullable(global); + return this; + } + + /** + *

Client secret (which you must not make public).

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

Whether this client a first party client (true) or not (false).

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "signing_keys", nulls = Nulls.SKIP) + public Builder signingKeys(Optional> signingKeys) { + this.signingKeys = signingKeys; + return this; + } + + public Builder signingKeys(List signingKeys) { + this.signingKeys = Optional.ofNullable(signingKeys); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Whether Single Sign On is disabled (true) or enabled (true). Defaults to true.

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

Whether a custom login page is to be used (true) or the default provided login page (false).

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public RotateClientSecretResponseContent build() { + return new RotateClientSecretResponseContent( + clientId, + tenant, + name, + description, + global, + clientSecret, + appType, + logoUri, + isFirstParty, + oidcConformant, + callbacks, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + sessionTransfer, + oidcLogout, + grantTypes, + jwtConfiguration, + signingKeys, + encryptionKey, + sso, + ssoDisabled, + crossOriginAuthentication, + crossOriginLoc, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + tokenEndpointAuthMethod, + clientMetadata, + mobile, + initiateLoginUri, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java new file mode 100644 index 000000000..82394286a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RotateConnectionKeysRequestContent.Builder.class) +public final class RotateConnectionKeysRequestContent { + private final Optional signingAlg; + + private final Map additionalProperties; + + private RotateConnectionKeysRequestContent( + Optional signingAlg, Map additionalProperties) { + this.signingAlg = signingAlg; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RotateConnectionKeysRequestContent + && equalTo((RotateConnectionKeysRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RotateConnectionKeysRequestContent other) { + return signingAlg.equals(other.signingAlg); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.signingAlg); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional signingAlg = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RotateConnectionKeysRequestContent other) { + signingAlg(other.getSigningAlg()); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(RotateConnectionKeysSigningAlgEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + public RotateConnectionKeysRequestContent build() { + return new RotateConnectionKeysRequestContent(signingAlg, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java new file mode 100644 index 000000000..912cd24f4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RotateConnectionKeysSigningAlgEnum { + public static final RotateConnectionKeysSigningAlgEnum RS512 = + new RotateConnectionKeysSigningAlgEnum(Value.RS512, "RS512"); + + public static final RotateConnectionKeysSigningAlgEnum PS256 = + new RotateConnectionKeysSigningAlgEnum(Value.PS256, "PS256"); + + public static final RotateConnectionKeysSigningAlgEnum ES256 = + new RotateConnectionKeysSigningAlgEnum(Value.ES256, "ES256"); + + public static final RotateConnectionKeysSigningAlgEnum RS256 = + new RotateConnectionKeysSigningAlgEnum(Value.RS256, "RS256"); + + private final Value value; + + private final String string; + + RotateConnectionKeysSigningAlgEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof RotateConnectionKeysSigningAlgEnum + && this.string.equals(((RotateConnectionKeysSigningAlgEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case PS256: + return visitor.visitPs256(); + case ES256: + return visitor.visitEs256(); + case RS256: + return visitor.visitRs256(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RotateConnectionKeysSigningAlgEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "PS256": + return PS256; + case "ES256": + return ES256; + case "RS256": + return RS256; + default: + return new RotateConnectionKeysSigningAlgEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RS256, + + RS512, + + PS256, + + ES256, + + UNKNOWN + } + + public interface Visitor { + T visitRs256(); + + T visitRs512(); + + T visitPs256(); + + T visitEs256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java new file mode 100644 index 000000000..ffbdd5bad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java @@ -0,0 +1,422 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RotateConnectionsKeysResponseContent.Builder.class) +public final class RotateConnectionsKeysResponseContent { + private final String kid; + + private final String cert; + + private final Optional pkcs; + + private final Optional next; + + private final String fingerprint; + + private final String thumbprint; + + private final Optional algorithm; + + private final Optional keyUse; + + private final Optional subjectDn; + + private final Map additionalProperties; + + private RotateConnectionsKeysResponseContent( + String kid, + String cert, + Optional pkcs, + Optional next, + String fingerprint, + String thumbprint, + Optional algorithm, + Optional keyUse, + Optional subjectDn, + Map additionalProperties) { + this.kid = kid; + this.cert = cert; + this.pkcs = pkcs; + this.next = next; + this.fingerprint = fingerprint; + this.thumbprint = thumbprint; + this.algorithm = algorithm; + this.keyUse = keyUse; + this.subjectDn = subjectDn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The key id of the signing key + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + /** + * @return The public certificate of the signing key + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return The public certificate of the signing key in pkcs7 format + */ + @JsonProperty("pkcs") + public Optional getPkcs() { + return pkcs; + } + + /** + * @return True if the key is the the next key + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + /** + * @return The cert fingerprint + */ + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + /** + * @return The cert thumbprint + */ + @JsonProperty("thumbprint") + public String getThumbprint() { + return thumbprint; + } + + /** + * @return Signing key algorithm + */ + @JsonProperty("algorithm") + public Optional getAlgorithm() { + return algorithm; + } + + @JsonProperty("key_use") + public Optional getKeyUse() { + return keyUse; + } + + @JsonProperty("subject_dn") + public Optional getSubjectDn() { + return subjectDn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RotateConnectionsKeysResponseContent + && equalTo((RotateConnectionsKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RotateConnectionsKeysResponseContent other) { + return kid.equals(other.kid) + && cert.equals(other.cert) + && pkcs.equals(other.pkcs) + && next.equals(other.next) + && fingerprint.equals(other.fingerprint) + && thumbprint.equals(other.thumbprint) + && algorithm.equals(other.algorithm) + && keyUse.equals(other.keyUse) + && subjectDn.equals(other.subjectDn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, + this.cert, + this.pkcs, + this.next, + this.fingerprint, + this.thumbprint, + this.algorithm, + this.keyUse, + this.subjectDn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

The key id of the signing key

+ */ + CertStage kid(@NotNull String kid); + + Builder from(RotateConnectionsKeysResponseContent other); + } + + public interface CertStage { + /** + *

The public certificate of the signing key

+ */ + FingerprintStage cert(@NotNull String cert); + } + + public interface FingerprintStage { + /** + *

The cert fingerprint

+ */ + ThumbprintStage fingerprint(@NotNull String fingerprint); + } + + public interface ThumbprintStage { + /** + *

The cert thumbprint

+ */ + _FinalStage thumbprint(@NotNull String thumbprint); + } + + public interface _FinalStage { + RotateConnectionsKeysResponseContent build(); + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + _FinalStage pkcs(Optional pkcs); + + _FinalStage pkcs(String pkcs); + + /** + *

True if the key is the the next key

+ */ + _FinalStage next(Optional next); + + _FinalStage next(Boolean next); + + /** + *

Signing key algorithm

+ */ + _FinalStage algorithm(Optional algorithm); + + _FinalStage algorithm(String algorithm); + + _FinalStage keyUse(Optional keyUse); + + _FinalStage keyUse(ConnectionKeyUseEnum keyUse); + + _FinalStage subjectDn(Optional subjectDn); + + _FinalStage subjectDn(String subjectDn); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KidStage, CertStage, FingerprintStage, ThumbprintStage, _FinalStage { + private String kid; + + private String cert; + + private String fingerprint; + + private String thumbprint; + + private Optional subjectDn = Optional.empty(); + + private Optional keyUse = Optional.empty(); + + private Optional algorithm = Optional.empty(); + + private Optional next = Optional.empty(); + + private Optional pkcs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RotateConnectionsKeysResponseContent other) { + kid(other.getKid()); + cert(other.getCert()); + pkcs(other.getPkcs()); + next(other.getNext()); + fingerprint(other.getFingerprint()); + thumbprint(other.getThumbprint()); + algorithm(other.getAlgorithm()); + keyUse(other.getKeyUse()); + subjectDn(other.getSubjectDn()); + return this; + } + + /** + *

The key id of the signing key

+ *

The key id of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public CertStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + /** + *

The public certificate of the signing key

+ *

The public certificate of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public FingerprintStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

The cert fingerprint

+ *

The cert fingerprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("fingerprint") + public ThumbprintStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The cert thumbprint

+ *

The cert thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("thumbprint") + public _FinalStage thumbprint(@NotNull String thumbprint) { + this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage subjectDn(String subjectDn) { + this.subjectDn = Optional.ofNullable(subjectDn); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) + public _FinalStage subjectDn(Optional subjectDn) { + this.subjectDn = subjectDn; + return this; + } + + @java.lang.Override + public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { + this.keyUse = Optional.ofNullable(keyUse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key_use", nulls = Nulls.SKIP) + public _FinalStage keyUse(Optional keyUse) { + this.keyUse = keyUse; + return this; + } + + /** + *

Signing key algorithm

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage algorithm(String algorithm) { + this.algorithm = Optional.ofNullable(algorithm); + return this; + } + + /** + *

Signing key algorithm

+ */ + @java.lang.Override + @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) + public _FinalStage algorithm(Optional algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + *

True if the key is the the next key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage next(Boolean next) { + this.next = Optional.ofNullable(next); + return this; + } + + /** + *

True if the key is the the next key

+ */ + @java.lang.Override + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public _FinalStage next(Optional next) { + this.next = next; + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage pkcs(String pkcs) { + this.pkcs = Optional.ofNullable(pkcs); + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + @java.lang.Override + @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) + public _FinalStage pkcs(Optional pkcs) { + this.pkcs = pkcs; + return this; + } + + @java.lang.Override + public RotateConnectionsKeysResponseContent build() { + return new RotateConnectionsKeysResponseContent( + kid, cert, pkcs, next, fingerprint, thumbprint, algorithm, keyUse, subjectDn, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java new file mode 100644 index 000000000..1ab5d2e5f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RotateSigningKeysResponseContent.Builder.class) +public final class RotateSigningKeysResponseContent { + private final String cert; + + private final String kid; + + private final Map additionalProperties; + + private RotateSigningKeysResponseContent(String cert, String kid, Map additionalProperties) { + this.cert = cert; + this.kid = kid; + this.additionalProperties = additionalProperties; + } + + /** + * @return Next key certificate + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return Next key id + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RotateSigningKeysResponseContent && equalTo((RotateSigningKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RotateSigningKeysResponseContent other) { + return cert.equals(other.cert) && kid.equals(other.kid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cert, this.kid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CertStage builder() { + return new Builder(); + } + + public interface CertStage { + /** + *

Next key certificate

+ */ + KidStage cert(@NotNull String cert); + + Builder from(RotateSigningKeysResponseContent other); + } + + public interface KidStage { + /** + *

Next key id

+ */ + _FinalStage kid(@NotNull String kid); + } + + public interface _FinalStage { + RotateSigningKeysResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CertStage, KidStage, _FinalStage { + private String cert; + + private String kid; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RotateSigningKeysResponseContent other) { + cert(other.getCert()); + kid(other.getKid()); + return this; + } + + /** + *

Next key certificate

+ *

Next key certificate

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public KidStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

Next key id

+ *

Next key id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public _FinalStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + @java.lang.Override + public RotateSigningKeysResponseContent build() { + return new RotateSigningKeysResponseContent(cert, kid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Rule.java b/src/main/java/com/auth0/client/mgmt/types/Rule.java new file mode 100644 index 000000000..f2dabb288 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Rule.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Rule.Builder.class) +public final class Rule { + private final Optional name; + + private final Optional id; + + private final Optional enabled; + + private final Optional script; + + private final Optional order; + + private final Optional stage; + + private final Map additionalProperties; + + private Rule( + Optional name, + Optional id, + Optional enabled, + Optional script, + Optional order, + Optional stage, + Map additionalProperties) { + this.name = name; + this.id = id; + this.enabled = enabled; + this.script = script; + this.order = order; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return ID of this rule. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Execution stage of this rule. Can be login_success, login_failure, or pre_authorize. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Rule && equalTo((Rule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Rule other) { + return name.equals(other.name) + && id.equals(other.id) + && enabled.equals(other.enabled) + && script.equals(other.script) + && order.equals(other.order) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional order = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Rule other) { + name(other.getName()); + id(other.getId()); + enabled(other.getEnabled()); + script(other.getScript()); + order(other.getOrder()); + stage(other.getStage()); + return this; + } + + /** + *

Name of this rule.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

ID of this rule.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Execution stage of this rule. Can be login_success, login_failure, or pre_authorize.

+ */ + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(String stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public Rule build() { + return new Rule(name, id, enabled, script, order, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java new file mode 100644 index 000000000..356148acf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RulesConfig.Builder.class) +public final class RulesConfig { + private final Optional key; + + private final Map additionalProperties; + + private RulesConfig(Optional key, Map additionalProperties) { + this.key = key; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key for a rules config variable. + */ + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RulesConfig && equalTo((RulesConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RulesConfig other) { + return key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RulesConfig other) { + key(other.getKey()); + return this; + } + + /** + *

Key for a rules config variable.

+ */ + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public Builder key(Optional key) { + this.key = key; + return this; + } + + public Builder key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + public RulesConfig build() { + return new RulesConfig(key, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java new file mode 100644 index 000000000..982709a3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScimMappingItem.Builder.class) +public final class ScimMappingItem { + private final Optional auth0; + + private final Optional scim; + + private final Map additionalProperties; + + private ScimMappingItem(Optional auth0, Optional scim, Map additionalProperties) { + this.auth0 = auth0; + this.scim = scim; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field location in the auth0 schema + */ + @JsonProperty("auth0") + public Optional getAuth0() { + return auth0; + } + + /** + * @return The field location in the SCIM schema + */ + @JsonProperty("scim") + public Optional getScim() { + return scim; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScimMappingItem && equalTo((ScimMappingItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScimMappingItem other) { + return auth0.equals(other.auth0) && scim.equals(other.scim); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.auth0, this.scim); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional auth0 = Optional.empty(); + + private Optional scim = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScimMappingItem other) { + auth0(other.getAuth0()); + scim(other.getScim()); + return this; + } + + /** + *

The field location in the auth0 schema

+ */ + @JsonSetter(value = "auth0", nulls = Nulls.SKIP) + public Builder auth0(Optional auth0) { + this.auth0 = auth0; + return this; + } + + public Builder auth0(String auth0) { + this.auth0 = Optional.ofNullable(auth0); + return this; + } + + /** + *

The field location in the SCIM schema

+ */ + @JsonSetter(value = "scim", nulls = Nulls.SKIP) + public Builder scim(Optional scim) { + this.scim = scim; + return this; + } + + public Builder scim(String scim) { + this.scim = Optional.ofNullable(scim); + return this; + } + + public ScimMappingItem build() { + return new ScimMappingItem(auth0, scim, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java new file mode 100644 index 000000000..8bfce20a3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScimTokenItem.Builder.class) +public final class ScimTokenItem { + private final Optional tokenId; + + private final Optional> scopes; + + private final Optional createdAt; + + private final Optional validUntil; + + private final Optional lastUsedAt; + + private final Map additionalProperties; + + private ScimTokenItem( + Optional tokenId, + Optional> scopes, + Optional createdAt, + Optional validUntil, + Optional lastUsedAt, + Map additionalProperties) { + this.tokenId = tokenId; + this.scopes = scopes; + this.createdAt = createdAt; + this.validUntil = validUntil; + this.lastUsedAt = lastUsedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The token's identifier + */ + @JsonProperty("token_id") + public Optional getTokenId() { + return tokenId; + } + + /** + * @return The scopes of the scim token + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + /** + * @return The token's created at timestamp + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The token's valid until timestamp + */ + @JsonProperty("valid_until") + public Optional getValidUntil() { + return validUntil; + } + + /** + * @return The token's last used at timestamp + */ + @JsonProperty("last_used_at") + public Optional getLastUsedAt() { + return lastUsedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScimTokenItem && equalTo((ScimTokenItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScimTokenItem other) { + return tokenId.equals(other.tokenId) + && scopes.equals(other.scopes) + && createdAt.equals(other.createdAt) + && validUntil.equals(other.validUntil) + && lastUsedAt.equals(other.lastUsedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tokenId, this.scopes, this.createdAt, this.validUntil, this.lastUsedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tokenId = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional validUntil = Optional.empty(); + + private Optional lastUsedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScimTokenItem other) { + tokenId(other.getTokenId()); + scopes(other.getScopes()); + createdAt(other.getCreatedAt()); + validUntil(other.getValidUntil()); + lastUsedAt(other.getLastUsedAt()); + return this; + } + + /** + *

The token's identifier

+ */ + @JsonSetter(value = "token_id", nulls = Nulls.SKIP) + public Builder tokenId(Optional tokenId) { + this.tokenId = tokenId; + return this; + } + + public Builder tokenId(String tokenId) { + this.tokenId = Optional.ofNullable(tokenId); + return this; + } + + /** + *

The scopes of the scim token

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + *

The token's created at timestamp

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The token's valid until timestamp

+ */ + @JsonSetter(value = "valid_until", nulls = Nulls.SKIP) + public Builder validUntil(Optional validUntil) { + this.validUntil = validUntil; + return this; + } + + public Builder validUntil(String validUntil) { + this.validUntil = Optional.ofNullable(validUntil); + return this; + } + + /** + *

The token's last used at timestamp

+ */ + @JsonSetter(value = "last_used_at", nulls = Nulls.SKIP) + public Builder lastUsedAt(Optional lastUsedAt) { + this.lastUsedAt = lastUsedAt; + return this; + } + + public Builder lastUsedAt(String lastUsedAt) { + this.lastUsedAt = Optional.ofNullable(lastUsedAt); + return this; + } + + public ScimTokenItem build() { + return new ScimTokenItem(tokenId, scopes, createdAt, validUntil, lastUsedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java new file mode 100644 index 000000000..6ee139d8d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java @@ -0,0 +1,978 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ScreenGroupNameEnum { + public static final ScreenGroupNameEnum MFA_PHONE_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_PHONE_CHALLENGE, "mfa-phone-challenge"); + + public static final ScreenGroupNameEnum MFA_VOICE_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_VOICE_ENROLLMENT, "mfa-voice-enrollment"); + + public static final ScreenGroupNameEnum SIGNUP = new ScreenGroupNameEnum(Value.SIGNUP, "signup"); + + public static final ScreenGroupNameEnum MFA_PUSH_WELCOME = + new ScreenGroupNameEnum(Value.MFA_PUSH_WELCOME, "mfa-push-welcome"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_EMAIL = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_EMAIL, "reset-password-email"); + + public static final ScreenGroupNameEnum LOGOUT_ABORTED = + new ScreenGroupNameEnum(Value.LOGOUT_ABORTED, "logout-aborted"); + + public static final ScreenGroupNameEnum REDEEM_TICKET = + new ScreenGroupNameEnum(Value.REDEEM_TICKET, "redeem-ticket"); + + public static final ScreenGroupNameEnum MFA_RECOVERY_CODE_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_RECOVERY_CODE_ENROLLMENT, "mfa-recovery-code-enrollment"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_SMS_CHALLENGE = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_SMS_CHALLENGE, "reset-password-mfa-sms-challenge"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_WEBAUTHN_ROAMING_CHALLENGE = new ScreenGroupNameEnum( + Value.RESET_PASSWORD_MFA_WEBAUTHN_ROAMING_CHALLENGE, "reset-password-mfa-webauthn-roaming-challenge"); + + public static final ScreenGroupNameEnum PHONE_IDENTIFIER_ENROLLMENT = + new ScreenGroupNameEnum(Value.PHONE_IDENTIFIER_ENROLLMENT, "phone-identifier-enrollment"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_ERROR = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_ERROR, "reset-password-error"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_PUSH_CHALLENGE_PUSH = new ScreenGroupNameEnum( + Value.RESET_PASSWORD_MFA_PUSH_CHALLENGE_PUSH, "reset-password-mfa-push-challenge-push"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_VOICE_CHALLENGE = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_VOICE_CHALLENGE, "reset-password-mfa-voice-challenge"); + + public static final ScreenGroupNameEnum MFA_PUSH_SUCCESS = + new ScreenGroupNameEnum(Value.MFA_PUSH_SUCCESS, "mfa-push-success"); + + public static final ScreenGroupNameEnum DEVICE_CODE_ACTIVATION_ALLOWED = + new ScreenGroupNameEnum(Value.DEVICE_CODE_ACTIVATION_ALLOWED, "device-code-activation-allowed"); + + public static final ScreenGroupNameEnum INTERSTITIAL_CAPTCHA = + new ScreenGroupNameEnum(Value.INTERSTITIAL_CAPTCHA, "interstitial-captcha"); + + public static final ScreenGroupNameEnum LOGIN_PASSWORD = + new ScreenGroupNameEnum(Value.LOGIN_PASSWORD, "login-password"); + + public static final ScreenGroupNameEnum BRUTE_FORCE_PROTECTION_UNBLOCK_SUCCESS = new ScreenGroupNameEnum( + Value.BRUTE_FORCE_PROTECTION_UNBLOCK_SUCCESS, "brute-force-protection-unblock-success"); + + public static final ScreenGroupNameEnum EMAIL_OTP_CHALLENGE = + new ScreenGroupNameEnum(Value.EMAIL_OTP_CHALLENGE, "email-otp-challenge"); + + public static final ScreenGroupNameEnum LOGIN_PASSWORDLESS_EMAIL_LINK = + new ScreenGroupNameEnum(Value.LOGIN_PASSWORDLESS_EMAIL_LINK, "login-passwordless-email-link"); + + public static final ScreenGroupNameEnum CONSENT = new ScreenGroupNameEnum(Value.CONSENT, "consent"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_ROAMING_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_ROAMING_ENROLLMENT, "mfa-webauthn-roaming-enrollment"); + + public static final ScreenGroupNameEnum BRUTE_FORCE_PROTECTION_UNBLOCK = + new ScreenGroupNameEnum(Value.BRUTE_FORCE_PROTECTION_UNBLOCK, "brute-force-protection-unblock"); + + public static final ScreenGroupNameEnum SIGNUP_ID = new ScreenGroupNameEnum(Value.SIGNUP_ID, "signup-id"); + + public static final ScreenGroupNameEnum MFA_OTP_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_OTP_CHALLENGE, "mfa-otp-challenge"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_PLATFORM_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_PLATFORM_CHALLENGE, "mfa-webauthn-platform-challenge"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE = new ScreenGroupNameEnum( + Value.RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE, "reset-password-mfa-recovery-code-challenge"); + + public static final ScreenGroupNameEnum ORGANIZATION_SELECTION = + new ScreenGroupNameEnum(Value.ORGANIZATION_SELECTION, "organization-selection"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_PHONE_CHALLENGE = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_PHONE_CHALLENGE, "reset-password-mfa-phone-challenge"); + + public static final ScreenGroupNameEnum MFA_RECOVERY_CODE_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_RECOVERY_CODE_CHALLENGE, "mfa-recovery-code-challenge"); + + public static final ScreenGroupNameEnum MFA_OTP_ENROLLMENT_CODE = + new ScreenGroupNameEnum(Value.MFA_OTP_ENROLLMENT_CODE, "mfa-otp-enrollment-code"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE = new ScreenGroupNameEnum( + Value.RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE, "reset-password-mfa-webauthn-platform-challenge"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_SUCCESS = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_SUCCESS, "reset-password-success"); + + public static final ScreenGroupNameEnum LOGIN_PASSWORDLESS_SMS_OTP = + new ScreenGroupNameEnum(Value.LOGIN_PASSWORDLESS_SMS_OTP, "login-passwordless-sms-otp"); + + public static final ScreenGroupNameEnum DEVICE_CODE_CONFIRMATION = + new ScreenGroupNameEnum(Value.DEVICE_CODE_CONFIRMATION, "device-code-confirmation"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_CHANGE_KEY_NICKNAME = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_CHANGE_KEY_NICKNAME, "mfa-webauthn-change-key-nickname"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_EMAIL_CHALLENGE = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_EMAIL_CHALLENGE, "reset-password-mfa-email-challenge"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_REQUEST = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_REQUEST, "reset-password-request"); + + public static final ScreenGroupNameEnum MFA_EMAIL_LIST = + new ScreenGroupNameEnum(Value.MFA_EMAIL_LIST, "mfa-email-list"); + + public static final ScreenGroupNameEnum EMAIL_IDENTIFIER_CHALLENGE = + new ScreenGroupNameEnum(Value.EMAIL_IDENTIFIER_CHALLENGE, "email-identifier-challenge"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_ERROR = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_ERROR, "mfa-webauthn-error"); + + public static final ScreenGroupNameEnum MFA_PUSH_ENROLLMENT_QR = + new ScreenGroupNameEnum(Value.MFA_PUSH_ENROLLMENT_QR, "mfa-push-enrollment-qr"); + + public static final ScreenGroupNameEnum MFA_DETECT_BROWSER_CAPABILITIES = + new ScreenGroupNameEnum(Value.MFA_DETECT_BROWSER_CAPABILITIES, "mfa-detect-browser-capabilities"); + + public static final ScreenGroupNameEnum LOGOUT_COMPLETE = + new ScreenGroupNameEnum(Value.LOGOUT_COMPLETE, "logout-complete"); + + public static final ScreenGroupNameEnum CUSTOMIZED_CONSENT = + new ScreenGroupNameEnum(Value.CUSTOMIZED_CONSENT, "customized-consent"); + + public static final ScreenGroupNameEnum MFA_OTP_ENROLLMENT_QR = + new ScreenGroupNameEnum(Value.MFA_OTP_ENROLLMENT_QR, "mfa-otp-enrollment-qr"); + + public static final ScreenGroupNameEnum MFA_SMS_LIST = new ScreenGroupNameEnum(Value.MFA_SMS_LIST, "mfa-sms-list"); + + public static final ScreenGroupNameEnum DEVICE_CODE_ACTIVATION_DENIED = + new ScreenGroupNameEnum(Value.DEVICE_CODE_ACTIVATION_DENIED, "device-code-activation-denied"); + + public static final ScreenGroupNameEnum MFA_SMS_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_SMS_ENROLLMENT, "mfa-sms-enrollment"); + + public static final ScreenGroupNameEnum CUSTOM_FORM = new ScreenGroupNameEnum(Value.CUSTOM_FORM, "custom-form"); + + public static final ScreenGroupNameEnum LOGOUT = new ScreenGroupNameEnum(Value.LOGOUT, "logout"); + + public static final ScreenGroupNameEnum MFA_LOGIN_OPTIONS = + new ScreenGroupNameEnum(Value.MFA_LOGIN_OPTIONS, "mfa-login-options"); + + public static final ScreenGroupNameEnum MFA_VOICE_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_VOICE_CHALLENGE, "mfa-voice-challenge"); + + public static final ScreenGroupNameEnum PASSKEY_ENROLLMENT_LOCAL = + new ScreenGroupNameEnum(Value.PASSKEY_ENROLLMENT_LOCAL, "passkey-enrollment-local"); + + public static final ScreenGroupNameEnum LOGIN_EMAIL_VERIFICATION = + new ScreenGroupNameEnum(Value.LOGIN_EMAIL_VERIFICATION, "login-email-verification"); + + public static final ScreenGroupNameEnum LOGIN_ID = new ScreenGroupNameEnum(Value.LOGIN_ID, "login-id"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_ROAMING_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_ROAMING_CHALLENGE, "mfa-webauthn-roaming-challenge"); + + public static final ScreenGroupNameEnum STATUS = new ScreenGroupNameEnum(Value.STATUS, "status"); + + public static final ScreenGroupNameEnum MFA_PUSH_ENROLLMENT_CODE = + new ScreenGroupNameEnum(Value.MFA_PUSH_ENROLLMENT_CODE, "mfa-push-enrollment-code"); + + public static final ScreenGroupNameEnum BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE = new ScreenGroupNameEnum( + Value.BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE, "brute-force-protection-unblock-failure"); + + public static final ScreenGroupNameEnum MFA_ENROLL_RESULT = + new ScreenGroupNameEnum(Value.MFA_ENROLL_RESULT, "mfa-enroll-result"); + + public static final ScreenGroupNameEnum MFA_PUSH_LIST = + new ScreenGroupNameEnum(Value.MFA_PUSH_LIST, "mfa-push-list"); + + public static final ScreenGroupNameEnum MFA_PHONE_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_PHONE_ENROLLMENT, "mfa-phone-enrollment"); + + public static final ScreenGroupNameEnum MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE = + new ScreenGroupNameEnum(Value.MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE, "mfa-recovery-code-challenge-new-code"); + + public static final ScreenGroupNameEnum EMAIL_VERIFICATION_RESULT = + new ScreenGroupNameEnum(Value.EMAIL_VERIFICATION_RESULT, "email-verification-result"); + + public static final ScreenGroupNameEnum DEVICE_CODE_ACTIVATION = + new ScreenGroupNameEnum(Value.DEVICE_CODE_ACTIVATION, "device-code-activation"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_PLATFORM_ENROLLMENT = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_PLATFORM_ENROLLMENT, "mfa-webauthn-platform-enrollment"); + + public static final ScreenGroupNameEnum MFA_SMS_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_SMS_CHALLENGE, "mfa-sms-challenge"); + + public static final ScreenGroupNameEnum ORGANIZATION_PICKER = + new ScreenGroupNameEnum(Value.ORGANIZATION_PICKER, "organization-picker"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_ENROLLMENT_SUCCESS = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_ENROLLMENT_SUCCESS, "mfa-webauthn-enrollment-success"); + + public static final ScreenGroupNameEnum RESET_PASSWORD = + new ScreenGroupNameEnum(Value.RESET_PASSWORD, "reset-password"); + + public static final ScreenGroupNameEnum PASSKEY_ENROLLMENT = + new ScreenGroupNameEnum(Value.PASSKEY_ENROLLMENT, "passkey-enrollment"); + + public static final ScreenGroupNameEnum LOGIN = new ScreenGroupNameEnum(Value.LOGIN, "login"); + + public static final ScreenGroupNameEnum LOGIN_PASSWORDLESS_EMAIL_CODE = + new ScreenGroupNameEnum(Value.LOGIN_PASSWORDLESS_EMAIL_CODE, "login-passwordless-email-code"); + + public static final ScreenGroupNameEnum SIGNUP_PASSWORD = + new ScreenGroupNameEnum(Value.SIGNUP_PASSWORD, "signup-password"); + + public static final ScreenGroupNameEnum PHONE_IDENTIFIER_CHALLENGE = + new ScreenGroupNameEnum(Value.PHONE_IDENTIFIER_CHALLENGE, "phone-identifier-challenge"); + + public static final ScreenGroupNameEnum MFA_PUSH_CHALLENGE_PUSH = + new ScreenGroupNameEnum(Value.MFA_PUSH_CHALLENGE_PUSH, "mfa-push-challenge-push"); + + public static final ScreenGroupNameEnum MFA_BEGIN_ENROLL_OPTIONS = + new ScreenGroupNameEnum(Value.MFA_BEGIN_ENROLL_OPTIONS, "mfa-begin-enroll-options"); + + public static final ScreenGroupNameEnum MFA_EMAIL_CHALLENGE = + new ScreenGroupNameEnum(Value.MFA_EMAIL_CHALLENGE, "mfa-email-challenge"); + + public static final ScreenGroupNameEnum ACCEPT_INVITATION = + new ScreenGroupNameEnum(Value.ACCEPT_INVITATION, "accept-invitation"); + + public static final ScreenGroupNameEnum MFA_WEBAUTHN_NOT_AVAILABLE_ERROR = + new ScreenGroupNameEnum(Value.MFA_WEBAUTHN_NOT_AVAILABLE_ERROR, "mfa-webauthn-not-available-error"); + + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_OTP_CHALLENGE = + new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_OTP_CHALLENGE, "reset-password-mfa-otp-challenge"); + + public static final ScreenGroupNameEnum MFA_COUNTRY_CODES = + new ScreenGroupNameEnum(Value.MFA_COUNTRY_CODES, "mfa-country-codes"); + + private final Value value; + + private final String string; + + ScreenGroupNameEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ScreenGroupNameEnum && this.string.equals(((ScreenGroupNameEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MFA_PHONE_CHALLENGE: + return visitor.visitMfaPhoneChallenge(); + case MFA_VOICE_ENROLLMENT: + return visitor.visitMfaVoiceEnrollment(); + case SIGNUP: + return visitor.visitSignup(); + case MFA_PUSH_WELCOME: + return visitor.visitMfaPushWelcome(); + case RESET_PASSWORD_EMAIL: + return visitor.visitResetPasswordEmail(); + case LOGOUT_ABORTED: + return visitor.visitLogoutAborted(); + case REDEEM_TICKET: + return visitor.visitRedeemTicket(); + case MFA_RECOVERY_CODE_ENROLLMENT: + return visitor.visitMfaRecoveryCodeEnrollment(); + case RESET_PASSWORD_MFA_SMS_CHALLENGE: + return visitor.visitResetPasswordMfaSmsChallenge(); + case RESET_PASSWORD_MFA_WEBAUTHN_ROAMING_CHALLENGE: + return visitor.visitResetPasswordMfaWebauthnRoamingChallenge(); + case PHONE_IDENTIFIER_ENROLLMENT: + return visitor.visitPhoneIdentifierEnrollment(); + case RESET_PASSWORD_ERROR: + return visitor.visitResetPasswordError(); + case RESET_PASSWORD_MFA_PUSH_CHALLENGE_PUSH: + return visitor.visitResetPasswordMfaPushChallengePush(); + case RESET_PASSWORD_MFA_VOICE_CHALLENGE: + return visitor.visitResetPasswordMfaVoiceChallenge(); + case MFA_PUSH_SUCCESS: + return visitor.visitMfaPushSuccess(); + case DEVICE_CODE_ACTIVATION_ALLOWED: + return visitor.visitDeviceCodeActivationAllowed(); + case INTERSTITIAL_CAPTCHA: + return visitor.visitInterstitialCaptcha(); + case LOGIN_PASSWORD: + return visitor.visitLoginPassword(); + case BRUTE_FORCE_PROTECTION_UNBLOCK_SUCCESS: + return visitor.visitBruteForceProtectionUnblockSuccess(); + case EMAIL_OTP_CHALLENGE: + return visitor.visitEmailOtpChallenge(); + case LOGIN_PASSWORDLESS_EMAIL_LINK: + return visitor.visitLoginPasswordlessEmailLink(); + case CONSENT: + return visitor.visitConsent(); + case MFA_WEBAUTHN_ROAMING_ENROLLMENT: + return visitor.visitMfaWebauthnRoamingEnrollment(); + case BRUTE_FORCE_PROTECTION_UNBLOCK: + return visitor.visitBruteForceProtectionUnblock(); + case SIGNUP_ID: + return visitor.visitSignupId(); + case MFA_OTP_CHALLENGE: + return visitor.visitMfaOtpChallenge(); + case MFA_WEBAUTHN_PLATFORM_CHALLENGE: + return visitor.visitMfaWebauthnPlatformChallenge(); + case RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE: + return visitor.visitResetPasswordMfaRecoveryCodeChallenge(); + case ORGANIZATION_SELECTION: + return visitor.visitOrganizationSelection(); + case RESET_PASSWORD_MFA_PHONE_CHALLENGE: + return visitor.visitResetPasswordMfaPhoneChallenge(); + case MFA_RECOVERY_CODE_CHALLENGE: + return visitor.visitMfaRecoveryCodeChallenge(); + case MFA_OTP_ENROLLMENT_CODE: + return visitor.visitMfaOtpEnrollmentCode(); + case RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE: + return visitor.visitResetPasswordMfaWebauthnPlatformChallenge(); + case RESET_PASSWORD_SUCCESS: + return visitor.visitResetPasswordSuccess(); + case LOGIN_PASSWORDLESS_SMS_OTP: + return visitor.visitLoginPasswordlessSmsOtp(); + case DEVICE_CODE_CONFIRMATION: + return visitor.visitDeviceCodeConfirmation(); + case MFA_WEBAUTHN_CHANGE_KEY_NICKNAME: + return visitor.visitMfaWebauthnChangeKeyNickname(); + case RESET_PASSWORD_MFA_EMAIL_CHALLENGE: + return visitor.visitResetPasswordMfaEmailChallenge(); + case RESET_PASSWORD_REQUEST: + return visitor.visitResetPasswordRequest(); + case MFA_EMAIL_LIST: + return visitor.visitMfaEmailList(); + case EMAIL_IDENTIFIER_CHALLENGE: + return visitor.visitEmailIdentifierChallenge(); + case MFA_WEBAUTHN_ERROR: + return visitor.visitMfaWebauthnError(); + case MFA_PUSH_ENROLLMENT_QR: + return visitor.visitMfaPushEnrollmentQr(); + case MFA_DETECT_BROWSER_CAPABILITIES: + return visitor.visitMfaDetectBrowserCapabilities(); + case LOGOUT_COMPLETE: + return visitor.visitLogoutComplete(); + case CUSTOMIZED_CONSENT: + return visitor.visitCustomizedConsent(); + case MFA_OTP_ENROLLMENT_QR: + return visitor.visitMfaOtpEnrollmentQr(); + case MFA_SMS_LIST: + return visitor.visitMfaSmsList(); + case DEVICE_CODE_ACTIVATION_DENIED: + return visitor.visitDeviceCodeActivationDenied(); + case MFA_SMS_ENROLLMENT: + return visitor.visitMfaSmsEnrollment(); + case CUSTOM_FORM: + return visitor.visitCustomForm(); + case LOGOUT: + return visitor.visitLogout(); + case MFA_LOGIN_OPTIONS: + return visitor.visitMfaLoginOptions(); + case MFA_VOICE_CHALLENGE: + return visitor.visitMfaVoiceChallenge(); + case PASSKEY_ENROLLMENT_LOCAL: + return visitor.visitPasskeyEnrollmentLocal(); + case LOGIN_EMAIL_VERIFICATION: + return visitor.visitLoginEmailVerification(); + case LOGIN_ID: + return visitor.visitLoginId(); + case MFA_WEBAUTHN_ROAMING_CHALLENGE: + return visitor.visitMfaWebauthnRoamingChallenge(); + case STATUS: + return visitor.visitStatus(); + case MFA_PUSH_ENROLLMENT_CODE: + return visitor.visitMfaPushEnrollmentCode(); + case BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE: + return visitor.visitBruteForceProtectionUnblockFailure(); + case MFA_ENROLL_RESULT: + return visitor.visitMfaEnrollResult(); + case MFA_PUSH_LIST: + return visitor.visitMfaPushList(); + case MFA_PHONE_ENROLLMENT: + return visitor.visitMfaPhoneEnrollment(); + case MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE: + return visitor.visitMfaRecoveryCodeChallengeNewCode(); + case EMAIL_VERIFICATION_RESULT: + return visitor.visitEmailVerificationResult(); + case DEVICE_CODE_ACTIVATION: + return visitor.visitDeviceCodeActivation(); + case MFA_WEBAUTHN_PLATFORM_ENROLLMENT: + return visitor.visitMfaWebauthnPlatformEnrollment(); + case MFA_SMS_CHALLENGE: + return visitor.visitMfaSmsChallenge(); + case ORGANIZATION_PICKER: + return visitor.visitOrganizationPicker(); + case MFA_WEBAUTHN_ENROLLMENT_SUCCESS: + return visitor.visitMfaWebauthnEnrollmentSuccess(); + case RESET_PASSWORD: + return visitor.visitResetPassword(); + case PASSKEY_ENROLLMENT: + return visitor.visitPasskeyEnrollment(); + case LOGIN: + return visitor.visitLogin(); + case LOGIN_PASSWORDLESS_EMAIL_CODE: + return visitor.visitLoginPasswordlessEmailCode(); + case SIGNUP_PASSWORD: + return visitor.visitSignupPassword(); + case PHONE_IDENTIFIER_CHALLENGE: + return visitor.visitPhoneIdentifierChallenge(); + case MFA_PUSH_CHALLENGE_PUSH: + return visitor.visitMfaPushChallengePush(); + case MFA_BEGIN_ENROLL_OPTIONS: + return visitor.visitMfaBeginEnrollOptions(); + case MFA_EMAIL_CHALLENGE: + return visitor.visitMfaEmailChallenge(); + case ACCEPT_INVITATION: + return visitor.visitAcceptInvitation(); + case MFA_WEBAUTHN_NOT_AVAILABLE_ERROR: + return visitor.visitMfaWebauthnNotAvailableError(); + case RESET_PASSWORD_MFA_OTP_CHALLENGE: + return visitor.visitResetPasswordMfaOtpChallenge(); + case MFA_COUNTRY_CODES: + return visitor.visitMfaCountryCodes(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ScreenGroupNameEnum valueOf(String value) { + switch (value) { + case "mfa-phone-challenge": + return MFA_PHONE_CHALLENGE; + case "mfa-voice-enrollment": + return MFA_VOICE_ENROLLMENT; + case "signup": + return SIGNUP; + case "mfa-push-welcome": + return MFA_PUSH_WELCOME; + case "reset-password-email": + return RESET_PASSWORD_EMAIL; + case "logout-aborted": + return LOGOUT_ABORTED; + case "redeem-ticket": + return REDEEM_TICKET; + case "mfa-recovery-code-enrollment": + return MFA_RECOVERY_CODE_ENROLLMENT; + case "reset-password-mfa-sms-challenge": + return RESET_PASSWORD_MFA_SMS_CHALLENGE; + case "reset-password-mfa-webauthn-roaming-challenge": + return RESET_PASSWORD_MFA_WEBAUTHN_ROAMING_CHALLENGE; + case "phone-identifier-enrollment": + return PHONE_IDENTIFIER_ENROLLMENT; + case "reset-password-error": + return RESET_PASSWORD_ERROR; + case "reset-password-mfa-push-challenge-push": + return RESET_PASSWORD_MFA_PUSH_CHALLENGE_PUSH; + case "reset-password-mfa-voice-challenge": + return RESET_PASSWORD_MFA_VOICE_CHALLENGE; + case "mfa-push-success": + return MFA_PUSH_SUCCESS; + case "device-code-activation-allowed": + return DEVICE_CODE_ACTIVATION_ALLOWED; + case "interstitial-captcha": + return INTERSTITIAL_CAPTCHA; + case "login-password": + return LOGIN_PASSWORD; + case "brute-force-protection-unblock-success": + return BRUTE_FORCE_PROTECTION_UNBLOCK_SUCCESS; + case "email-otp-challenge": + return EMAIL_OTP_CHALLENGE; + case "login-passwordless-email-link": + return LOGIN_PASSWORDLESS_EMAIL_LINK; + case "consent": + return CONSENT; + case "mfa-webauthn-roaming-enrollment": + return MFA_WEBAUTHN_ROAMING_ENROLLMENT; + case "brute-force-protection-unblock": + return BRUTE_FORCE_PROTECTION_UNBLOCK; + case "signup-id": + return SIGNUP_ID; + case "mfa-otp-challenge": + return MFA_OTP_CHALLENGE; + case "mfa-webauthn-platform-challenge": + return MFA_WEBAUTHN_PLATFORM_CHALLENGE; + case "reset-password-mfa-recovery-code-challenge": + return RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE; + case "organization-selection": + return ORGANIZATION_SELECTION; + case "reset-password-mfa-phone-challenge": + return RESET_PASSWORD_MFA_PHONE_CHALLENGE; + case "mfa-recovery-code-challenge": + return MFA_RECOVERY_CODE_CHALLENGE; + case "mfa-otp-enrollment-code": + return MFA_OTP_ENROLLMENT_CODE; + case "reset-password-mfa-webauthn-platform-challenge": + return RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE; + case "reset-password-success": + return RESET_PASSWORD_SUCCESS; + case "login-passwordless-sms-otp": + return LOGIN_PASSWORDLESS_SMS_OTP; + case "device-code-confirmation": + return DEVICE_CODE_CONFIRMATION; + case "mfa-webauthn-change-key-nickname": + return MFA_WEBAUTHN_CHANGE_KEY_NICKNAME; + case "reset-password-mfa-email-challenge": + return RESET_PASSWORD_MFA_EMAIL_CHALLENGE; + case "reset-password-request": + return RESET_PASSWORD_REQUEST; + case "mfa-email-list": + return MFA_EMAIL_LIST; + case "email-identifier-challenge": + return EMAIL_IDENTIFIER_CHALLENGE; + case "mfa-webauthn-error": + return MFA_WEBAUTHN_ERROR; + case "mfa-push-enrollment-qr": + return MFA_PUSH_ENROLLMENT_QR; + case "mfa-detect-browser-capabilities": + return MFA_DETECT_BROWSER_CAPABILITIES; + case "logout-complete": + return LOGOUT_COMPLETE; + case "customized-consent": + return CUSTOMIZED_CONSENT; + case "mfa-otp-enrollment-qr": + return MFA_OTP_ENROLLMENT_QR; + case "mfa-sms-list": + return MFA_SMS_LIST; + case "device-code-activation-denied": + return DEVICE_CODE_ACTIVATION_DENIED; + case "mfa-sms-enrollment": + return MFA_SMS_ENROLLMENT; + case "custom-form": + return CUSTOM_FORM; + case "logout": + return LOGOUT; + case "mfa-login-options": + return MFA_LOGIN_OPTIONS; + case "mfa-voice-challenge": + return MFA_VOICE_CHALLENGE; + case "passkey-enrollment-local": + return PASSKEY_ENROLLMENT_LOCAL; + case "login-email-verification": + return LOGIN_EMAIL_VERIFICATION; + case "login-id": + return LOGIN_ID; + case "mfa-webauthn-roaming-challenge": + return MFA_WEBAUTHN_ROAMING_CHALLENGE; + case "status": + return STATUS; + case "mfa-push-enrollment-code": + return MFA_PUSH_ENROLLMENT_CODE; + case "brute-force-protection-unblock-failure": + return BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE; + case "mfa-enroll-result": + return MFA_ENROLL_RESULT; + case "mfa-push-list": + return MFA_PUSH_LIST; + case "mfa-phone-enrollment": + return MFA_PHONE_ENROLLMENT; + case "mfa-recovery-code-challenge-new-code": + return MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE; + case "email-verification-result": + return EMAIL_VERIFICATION_RESULT; + case "device-code-activation": + return DEVICE_CODE_ACTIVATION; + case "mfa-webauthn-platform-enrollment": + return MFA_WEBAUTHN_PLATFORM_ENROLLMENT; + case "mfa-sms-challenge": + return MFA_SMS_CHALLENGE; + case "organization-picker": + return ORGANIZATION_PICKER; + case "mfa-webauthn-enrollment-success": + return MFA_WEBAUTHN_ENROLLMENT_SUCCESS; + case "reset-password": + return RESET_PASSWORD; + case "passkey-enrollment": + return PASSKEY_ENROLLMENT; + case "login": + return LOGIN; + case "login-passwordless-email-code": + return LOGIN_PASSWORDLESS_EMAIL_CODE; + case "signup-password": + return SIGNUP_PASSWORD; + case "phone-identifier-challenge": + return PHONE_IDENTIFIER_CHALLENGE; + case "mfa-push-challenge-push": + return MFA_PUSH_CHALLENGE_PUSH; + case "mfa-begin-enroll-options": + return MFA_BEGIN_ENROLL_OPTIONS; + case "mfa-email-challenge": + return MFA_EMAIL_CHALLENGE; + case "accept-invitation": + return ACCEPT_INVITATION; + case "mfa-webauthn-not-available-error": + return MFA_WEBAUTHN_NOT_AVAILABLE_ERROR; + case "reset-password-mfa-otp-challenge": + return RESET_PASSWORD_MFA_OTP_CHALLENGE; + case "mfa-country-codes": + return MFA_COUNTRY_CODES; + default: + return new ScreenGroupNameEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LOGIN, + + LOGIN_ID, + + LOGIN_PASSWORD, + + LOGIN_PASSWORDLESS_EMAIL_CODE, + + LOGIN_PASSWORDLESS_EMAIL_LINK, + + LOGIN_PASSWORDLESS_SMS_OTP, + + LOGIN_EMAIL_VERIFICATION, + + SIGNUP, + + SIGNUP_ID, + + SIGNUP_PASSWORD, + + PHONE_IDENTIFIER_ENROLLMENT, + + PHONE_IDENTIFIER_CHALLENGE, + + EMAIL_IDENTIFIER_CHALLENGE, + + RESET_PASSWORD_REQUEST, + + RESET_PASSWORD_EMAIL, + + RESET_PASSWORD, + + RESET_PASSWORD_SUCCESS, + + RESET_PASSWORD_ERROR, + + RESET_PASSWORD_MFA_EMAIL_CHALLENGE, + + RESET_PASSWORD_MFA_OTP_CHALLENGE, + + RESET_PASSWORD_MFA_PHONE_CHALLENGE, + + RESET_PASSWORD_MFA_PUSH_CHALLENGE_PUSH, + + RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE, + + RESET_PASSWORD_MFA_SMS_CHALLENGE, + + RESET_PASSWORD_MFA_VOICE_CHALLENGE, + + RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE, + + RESET_PASSWORD_MFA_WEBAUTHN_ROAMING_CHALLENGE, + + CUSTOM_FORM, + + CONSENT, + + CUSTOMIZED_CONSENT, + + LOGOUT, + + LOGOUT_COMPLETE, + + LOGOUT_ABORTED, + + MFA_PUSH_WELCOME, + + MFA_PUSH_ENROLLMENT_QR, + + MFA_PUSH_ENROLLMENT_CODE, + + MFA_PUSH_SUCCESS, + + MFA_PUSH_CHALLENGE_PUSH, + + MFA_PUSH_LIST, + + MFA_OTP_ENROLLMENT_QR, + + MFA_OTP_ENROLLMENT_CODE, + + MFA_OTP_CHALLENGE, + + MFA_VOICE_ENROLLMENT, + + MFA_VOICE_CHALLENGE, + + MFA_PHONE_CHALLENGE, + + MFA_PHONE_ENROLLMENT, + + MFA_WEBAUTHN_PLATFORM_ENROLLMENT, + + MFA_WEBAUTHN_ROAMING_ENROLLMENT, + + MFA_WEBAUTHN_PLATFORM_CHALLENGE, + + MFA_WEBAUTHN_ROAMING_CHALLENGE, + + MFA_WEBAUTHN_CHANGE_KEY_NICKNAME, + + MFA_WEBAUTHN_ENROLLMENT_SUCCESS, + + MFA_WEBAUTHN_ERROR, + + MFA_WEBAUTHN_NOT_AVAILABLE_ERROR, + + MFA_COUNTRY_CODES, + + MFA_SMS_ENROLLMENT, + + MFA_SMS_CHALLENGE, + + MFA_SMS_LIST, + + MFA_EMAIL_CHALLENGE, + + MFA_EMAIL_LIST, + + MFA_RECOVERY_CODE_ENROLLMENT, + + MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE, + + MFA_RECOVERY_CODE_CHALLENGE, + + MFA_DETECT_BROWSER_CAPABILITIES, + + MFA_ENROLL_RESULT, + + MFA_LOGIN_OPTIONS, + + MFA_BEGIN_ENROLL_OPTIONS, + + STATUS, + + DEVICE_CODE_ACTIVATION, + + DEVICE_CODE_ACTIVATION_ALLOWED, + + DEVICE_CODE_ACTIVATION_DENIED, + + DEVICE_CODE_CONFIRMATION, + + EMAIL_VERIFICATION_RESULT, + + EMAIL_OTP_CHALLENGE, + + ORGANIZATION_SELECTION, + + ORGANIZATION_PICKER, + + ACCEPT_INVITATION, + + REDEEM_TICKET, + + PASSKEY_ENROLLMENT, + + PASSKEY_ENROLLMENT_LOCAL, + + INTERSTITIAL_CAPTCHA, + + BRUTE_FORCE_PROTECTION_UNBLOCK, + + BRUTE_FORCE_PROTECTION_UNBLOCK_SUCCESS, + + BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE, + + UNKNOWN + } + + public interface Visitor { + T visitLogin(); + + T visitLoginId(); + + T visitLoginPassword(); + + T visitLoginPasswordlessEmailCode(); + + T visitLoginPasswordlessEmailLink(); + + T visitLoginPasswordlessSmsOtp(); + + T visitLoginEmailVerification(); + + T visitSignup(); + + T visitSignupId(); + + T visitSignupPassword(); + + T visitPhoneIdentifierEnrollment(); + + T visitPhoneIdentifierChallenge(); + + T visitEmailIdentifierChallenge(); + + T visitResetPasswordRequest(); + + T visitResetPasswordEmail(); + + T visitResetPassword(); + + T visitResetPasswordSuccess(); + + T visitResetPasswordError(); + + T visitResetPasswordMfaEmailChallenge(); + + T visitResetPasswordMfaOtpChallenge(); + + T visitResetPasswordMfaPhoneChallenge(); + + T visitResetPasswordMfaPushChallengePush(); + + T visitResetPasswordMfaRecoveryCodeChallenge(); + + T visitResetPasswordMfaSmsChallenge(); + + T visitResetPasswordMfaVoiceChallenge(); + + T visitResetPasswordMfaWebauthnPlatformChallenge(); + + T visitResetPasswordMfaWebauthnRoamingChallenge(); + + T visitCustomForm(); + + T visitConsent(); + + T visitCustomizedConsent(); + + T visitLogout(); + + T visitLogoutComplete(); + + T visitLogoutAborted(); + + T visitMfaPushWelcome(); + + T visitMfaPushEnrollmentQr(); + + T visitMfaPushEnrollmentCode(); + + T visitMfaPushSuccess(); + + T visitMfaPushChallengePush(); + + T visitMfaPushList(); + + T visitMfaOtpEnrollmentQr(); + + T visitMfaOtpEnrollmentCode(); + + T visitMfaOtpChallenge(); + + T visitMfaVoiceEnrollment(); + + T visitMfaVoiceChallenge(); + + T visitMfaPhoneChallenge(); + + T visitMfaPhoneEnrollment(); + + T visitMfaWebauthnPlatformEnrollment(); + + T visitMfaWebauthnRoamingEnrollment(); + + T visitMfaWebauthnPlatformChallenge(); + + T visitMfaWebauthnRoamingChallenge(); + + T visitMfaWebauthnChangeKeyNickname(); + + T visitMfaWebauthnEnrollmentSuccess(); + + T visitMfaWebauthnError(); + + T visitMfaWebauthnNotAvailableError(); + + T visitMfaCountryCodes(); + + T visitMfaSmsEnrollment(); + + T visitMfaSmsChallenge(); + + T visitMfaSmsList(); + + T visitMfaEmailChallenge(); + + T visitMfaEmailList(); + + T visitMfaRecoveryCodeEnrollment(); + + T visitMfaRecoveryCodeChallengeNewCode(); + + T visitMfaRecoveryCodeChallenge(); + + T visitMfaDetectBrowserCapabilities(); + + T visitMfaEnrollResult(); + + T visitMfaLoginOptions(); + + T visitMfaBeginEnrollOptions(); + + T visitStatus(); + + T visitDeviceCodeActivation(); + + T visitDeviceCodeActivationAllowed(); + + T visitDeviceCodeActivationDenied(); + + T visitDeviceCodeConfirmation(); + + T visitEmailVerificationResult(); + + T visitEmailOtpChallenge(); + + T visitOrganizationSelection(); + + T visitOrganizationPicker(); + + T visitAcceptInvitation(); + + T visitRedeemTicket(); + + T visitPasskeyEnrollment(); + + T visitPasskeyEnrollmentLocal(); + + T visitInterstitialCaptcha(); + + T visitBruteForceProtectionUnblock(); + + T visitBruteForceProtectionUnblockSuccess(); + + T visitBruteForceProtectionUnblockFailure(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java new file mode 100644 index 000000000..5a1e7fbf1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SearchEngineVersionsEnum { + public static final SearchEngineVersionsEnum V1 = new SearchEngineVersionsEnum(Value.V1, "v1"); + + public static final SearchEngineVersionsEnum V2 = new SearchEngineVersionsEnum(Value.V2, "v2"); + + public static final SearchEngineVersionsEnum V3 = new SearchEngineVersionsEnum(Value.V3, "v3"); + + private final Value value; + + private final String string; + + SearchEngineVersionsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SearchEngineVersionsEnum + && this.string.equals(((SearchEngineVersionsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case V1: + return visitor.visitV1(); + case V2: + return visitor.visitV2(); + case V3: + return visitor.visitV3(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SearchEngineVersionsEnum valueOf(String value) { + switch (value) { + case "v1": + return V1; + case "v2": + return V2; + case "v3": + return V3; + default: + return new SearchEngineVersionsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + V1, + + V2, + + V3, + + UNKNOWN + } + + public interface Visitor { + T visitV1(); + + T visitV2(); + + T visitV3(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java new file mode 100644 index 000000000..02948da08 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java @@ -0,0 +1,326 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfile.Builder.class) +public final class SelfServiceProfile { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Optional> userAttributes; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional branding; + + private final Optional> allowedStrategies; + + private final Map additionalProperties; + + private SelfServiceProfile( + Optional id, + Optional name, + Optional description, + Optional> userAttributes, + Optional createdAt, + Optional updatedAt, + Optional branding, + Optional> allowedStrategies, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.userAttributes = userAttributes; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the self-service Profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the self-service Profile. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + */ + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + /** + * @return The time when this self-service Profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this self-service Profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfile && equalTo((SelfServiceProfile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfile other) { + return id.equals(other.id) + && name.equals(other.name) + && description.equals(other.description) + && userAttributes.equals(other.userAttributes) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.description, + this.userAttributes, + this.createdAt, + this.updatedAt, + this.branding, + this.allowedStrategies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> userAttributes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> allowedStrategies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SelfServiceProfile other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + userAttributes(other.getUserAttributes()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + return this; + } + + /** + *

The unique ID of the self-service Profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the self-service Profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The description of the self-service Profile.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes(Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes(List userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + /** + *

The time when this self-service Profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this self-service Profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(SelfServiceProfileBrandingProperties branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public Builder allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + public Builder allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + public SelfServiceProfile build() { + return new SelfServiceProfile( + id, + name, + description, + userAttributes, + createdAt, + updatedAt, + branding, + allowedStrategies, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java new file mode 100644 index 000000000..493df00d2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelfServiceProfileAllowedStrategyEnum { + public static final SelfServiceProfileAllowedStrategyEnum PINGFEDERATE = + new SelfServiceProfileAllowedStrategyEnum(Value.PINGFEDERATE, "pingfederate"); + + public static final SelfServiceProfileAllowedStrategyEnum OKTA = + new SelfServiceProfileAllowedStrategyEnum(Value.OKTA, "okta"); + + public static final SelfServiceProfileAllowedStrategyEnum SAMLP = + new SelfServiceProfileAllowedStrategyEnum(Value.SAMLP, "samlp"); + + public static final SelfServiceProfileAllowedStrategyEnum GOOGLE_APPS = + new SelfServiceProfileAllowedStrategyEnum(Value.GOOGLE_APPS, "google-apps"); + + public static final SelfServiceProfileAllowedStrategyEnum KEYCLOAK_SAMLP = + new SelfServiceProfileAllowedStrategyEnum(Value.KEYCLOAK_SAMLP, "keycloak-samlp"); + + public static final SelfServiceProfileAllowedStrategyEnum WAAD = + new SelfServiceProfileAllowedStrategyEnum(Value.WAAD, "waad"); + + public static final SelfServiceProfileAllowedStrategyEnum OIDC = + new SelfServiceProfileAllowedStrategyEnum(Value.OIDC, "oidc"); + + public static final SelfServiceProfileAllowedStrategyEnum ADFS = + new SelfServiceProfileAllowedStrategyEnum(Value.ADFS, "adfs"); + + private final Value value; + + private final String string; + + SelfServiceProfileAllowedStrategyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelfServiceProfileAllowedStrategyEnum + && this.string.equals(((SelfServiceProfileAllowedStrategyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PINGFEDERATE: + return visitor.visitPingfederate(); + case OKTA: + return visitor.visitOkta(); + case SAMLP: + return visitor.visitSamlp(); + case GOOGLE_APPS: + return visitor.visitGoogleApps(); + case KEYCLOAK_SAMLP: + return visitor.visitKeycloakSamlp(); + case WAAD: + return visitor.visitWaad(); + case OIDC: + return visitor.visitOidc(); + case ADFS: + return visitor.visitAdfs(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelfServiceProfileAllowedStrategyEnum valueOf(String value) { + switch (value) { + case "pingfederate": + return PINGFEDERATE; + case "okta": + return OKTA; + case "samlp": + return SAMLP; + case "google-apps": + return GOOGLE_APPS; + case "keycloak-samlp": + return KEYCLOAK_SAMLP; + case "waad": + return WAAD; + case "oidc": + return OIDC; + case "adfs": + return ADFS; + default: + return new SelfServiceProfileAllowedStrategyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + OIDC, + + SAMLP, + + WAAD, + + GOOGLE_APPS, + + ADFS, + + OKTA, + + KEYCLOAK_SAMLP, + + PINGFEDERATE, + + UNKNOWN + } + + public interface Visitor { + T visitOidc(); + + T visitSamlp(); + + T visitWaad(); + + T visitGoogleApps(); + + T visitAdfs(); + + T visitOkta(); + + T visitKeycloakSamlp(); + + T visitPingfederate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java new file mode 100644 index 000000000..a7b65cd3c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileBrandingColors.Builder.class) +public final class SelfServiceProfileBrandingColors { + private final String primary; + + private final Map additionalProperties; + + private SelfServiceProfileBrandingColors(String primary, Map additionalProperties) { + this.primary = primary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("primary") + public String getPrimary() { + return primary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileBrandingColors && equalTo((SelfServiceProfileBrandingColors) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileBrandingColors other) { + return primary.equals(other.primary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.primary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PrimaryStage builder() { + return new Builder(); + } + + public interface PrimaryStage { + _FinalStage primary(@NotNull String primary); + + Builder from(SelfServiceProfileBrandingColors other); + } + + public interface _FinalStage { + SelfServiceProfileBrandingColors build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PrimaryStage, _FinalStage { + private String primary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SelfServiceProfileBrandingColors other) { + primary(other.getPrimary()); + return this; + } + + @java.lang.Override + @JsonSetter("primary") + public _FinalStage primary(@NotNull String primary) { + this.primary = Objects.requireNonNull(primary, "primary must not be null"); + return this; + } + + @java.lang.Override + public SelfServiceProfileBrandingColors build() { + return new SelfServiceProfileBrandingColors(primary, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java new file mode 100644 index 000000000..3ece91ff2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileBrandingProperties.Builder.class) +public final class SelfServiceProfileBrandingProperties { + private final Optional logoUrl; + + private final Optional colors; + + private final Map additionalProperties; + + private SelfServiceProfileBrandingProperties( + Optional logoUrl, + Optional colors, + Map additionalProperties) { + this.logoUrl = logoUrl; + this.colors = colors; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("logo_url") + public Optional getLogoUrl() { + return logoUrl; + } + + @JsonProperty("colors") + public Optional getColors() { + return colors; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileBrandingProperties + && equalTo((SelfServiceProfileBrandingProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileBrandingProperties other) { + return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logoUrl, this.colors); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional logoUrl = Optional.empty(); + + private Optional colors = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SelfServiceProfileBrandingProperties other) { + logoUrl(other.getLogoUrl()); + colors(other.getColors()); + return this; + } + + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public Builder logoUrl(Optional logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + public Builder logoUrl(String logoUrl) { + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + @JsonSetter(value = "colors", nulls = Nulls.SKIP) + public Builder colors(Optional colors) { + this.colors = colors; + return this; + } + + public Builder colors(SelfServiceProfileBrandingColors colors) { + this.colors = Optional.ofNullable(colors); + return this; + } + + public SelfServiceProfileBrandingProperties build() { + return new SelfServiceProfileBrandingProperties(logoUrl, colors, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java new file mode 100644 index 000000000..4fe08b160 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java @@ -0,0 +1,349 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketConnectionConfig.Builder.class) +public final class SelfServiceProfileSsoTicketConnectionConfig { + private final String name; + + private final Optional displayName; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> metadata; + + private final OptionalNullable options; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketConnectionConfig( + String name, + Optional displayName, + Optional isDomainConnection, + Optional showAsButton, + Optional> metadata, + OptionalNullable options, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.metadata = metadata; + this.options = options; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection that will be created as a part of the SSO flow. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Connection name used in the new universal login experience + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + /** + * @return <code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.) + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.) + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + public OptionalNullable getOptions() { + if (options == null) { + return OptionalNullable.absent(); + } + return options; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private OptionalNullable _getOptions() { + return options; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketConnectionConfig + && equalTo((SelfServiceProfileSsoTicketConnectionConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketConnectionConfig other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && metadata.equals(other.metadata) + && options.equals(other.options); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.displayName, this.isDomainConnection, this.showAsButton, this.metadata, this.options); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The name of the connection that will be created as a part of the SSO flow.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(SelfServiceProfileSsoTicketConnectionConfig other); + } + + public interface _FinalStage { + SelfServiceProfileSsoTicketConnectionConfig build(); + + /** + *

Connection name used in the new universal login experience

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ */ + _FinalStage isDomainConnection(Optional isDomainConnection); + + _FinalStage isDomainConnection(Boolean isDomainConnection); + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + + _FinalStage options(@Nullable OptionalNullable options); + + _FinalStage options(SelfServiceProfileSsoTicketConnectionOptions options); + + _FinalStage options(Optional options); + + _FinalStage options(com.auth0.client.mgmt.core.Nullable options); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private OptionalNullable options = OptionalNullable.absent(); + + private Optional> metadata = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SelfServiceProfileSsoTicketConnectionConfig other) { + name(other.getName()); + displayName(other.getDisplayName()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + metadata(other.getMetadata()); + options(other.getOptions()); + return this; + } + + /** + *

The name of the connection that will be created as a part of the SSO flow.

+ *

The name of the connection that will be created as a part of the SSO flow.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage options( + com.auth0.client.mgmt.core.Nullable options) { + if (options.isNull()) { + this.options = OptionalNullable.ofNull(); + } else if (options.isEmpty()) { + this.options = OptionalNullable.absent(); + } else { + this.options = OptionalNullable.of(options.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage options(Optional options) { + if (options.isPresent()) { + this.options = OptionalNullable.of(options.get()); + } else { + this.options = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage options(SelfServiceProfileSsoTicketConnectionOptions options) { + this.options = OptionalNullable.of(options); + return this; + } + + @java.lang.Override + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public _FinalStage options(@Nullable OptionalNullable options) { + this.options = options; + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ */ + @java.lang.Override + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public _FinalStage isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + /** + *

Connection name used in the new universal login experience

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Connection name used in the new universal login experience

+ */ + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public SelfServiceProfileSsoTicketConnectionConfig build() { + return new SelfServiceProfileSsoTicketConnectionConfig( + name, displayName, isDomainConnection, showAsButton, metadata, options, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java new file mode 100644 index 000000000..ecd00be80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketConnectionOptions.Builder.class) +public final class SelfServiceProfileSsoTicketConnectionOptions { + private final OptionalNullable iconUrl; + + private final Optional> domainAliases; + + private final OptionalNullable idpinitiated; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketConnectionOptions( + OptionalNullable iconUrl, + Optional> domainAliases, + OptionalNullable idpinitiated, + Map additionalProperties) { + this.iconUrl = iconUrl; + this.domainAliases = domainAliases; + this.idpinitiated = idpinitiated; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL for the icon. Must use HTTPS. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("icon_url") + public OptionalNullable getIconUrl() { + if (iconUrl == null) { + return OptionalNullable.absent(); + } + return iconUrl; + } + + /** + * @return List of domain_aliases that can be authenticated in the Identity Provider + */ + @JsonProperty("domain_aliases") + public Optional> getDomainAliases() { + return domainAliases; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("idpinitiated") + public OptionalNullable getIdpinitiated() { + if (idpinitiated == null) { + return OptionalNullable.absent(); + } + return idpinitiated; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("icon_url") + private OptionalNullable _getIconUrl() { + return iconUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("idpinitiated") + private OptionalNullable _getIdpinitiated() { + return idpinitiated; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketConnectionOptions + && equalTo((SelfServiceProfileSsoTicketConnectionOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketConnectionOptions other) { + return iconUrl.equals(other.iconUrl) + && domainAliases.equals(other.domainAliases) + && idpinitiated.equals(other.idpinitiated); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.iconUrl, this.domainAliases, this.idpinitiated); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable iconUrl = OptionalNullable.absent(); + + private Optional> domainAliases = Optional.empty(); + + private OptionalNullable idpinitiated = + OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SelfServiceProfileSsoTicketConnectionOptions other) { + iconUrl(other.getIconUrl()); + domainAliases(other.getDomainAliases()); + idpinitiated(other.getIdpinitiated()); + return this; + } + + /** + *

URL for the icon. Must use HTTPS.

+ */ + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public Builder iconUrl(@Nullable OptionalNullable iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + public Builder iconUrl(String iconUrl) { + this.iconUrl = OptionalNullable.of(iconUrl); + return this; + } + + public Builder iconUrl(Optional iconUrl) { + if (iconUrl.isPresent()) { + this.iconUrl = OptionalNullable.of(iconUrl.get()); + } else { + this.iconUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder iconUrl(com.auth0.client.mgmt.core.Nullable iconUrl) { + if (iconUrl.isNull()) { + this.iconUrl = OptionalNullable.ofNull(); + } else if (iconUrl.isEmpty()) { + this.iconUrl = OptionalNullable.absent(); + } else { + this.iconUrl = OptionalNullable.of(iconUrl.get()); + } + return this; + } + + /** + *

List of domain_aliases that can be authenticated in the Identity Provider

+ */ + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public Builder domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + public Builder domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @JsonSetter(value = "idpinitiated", nulls = Nulls.SKIP) + public Builder idpinitiated( + @Nullable OptionalNullable idpinitiated) { + this.idpinitiated = idpinitiated; + return this; + } + + public Builder idpinitiated(SelfServiceProfileSsoTicketIdpInitiatedOptions idpinitiated) { + this.idpinitiated = OptionalNullable.of(idpinitiated); + return this; + } + + public Builder idpinitiated(Optional idpinitiated) { + if (idpinitiated.isPresent()) { + this.idpinitiated = OptionalNullable.of(idpinitiated.get()); + } else { + this.idpinitiated = OptionalNullable.absent(); + } + return this; + } + + public Builder idpinitiated( + com.auth0.client.mgmt.core.Nullable idpinitiated) { + if (idpinitiated.isNull()) { + this.idpinitiated = OptionalNullable.ofNull(); + } else if (idpinitiated.isEmpty()) { + this.idpinitiated = OptionalNullable.absent(); + } else { + this.idpinitiated = OptionalNullable.of(idpinitiated.get()); + } + return this; + } + + public SelfServiceProfileSsoTicketConnectionOptions build() { + return new SelfServiceProfileSsoTicketConnectionOptions( + iconUrl, domainAliases, idpinitiated, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java new file mode 100644 index 000000000..94a640d7f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketDomainAliasesConfig.Builder.class) +public final class SelfServiceProfileSsoTicketDomainAliasesConfig { + private final SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketDomainAliasesConfig( + SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification, + Map additionalProperties) { + this.domainVerification = domainVerification; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("domain_verification") + public SelfServiceProfileSsoTicketDomainVerificationEnum getDomainVerification() { + return domainVerification; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketDomainAliasesConfig + && equalTo((SelfServiceProfileSsoTicketDomainAliasesConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketDomainAliasesConfig other) { + return domainVerification.equals(other.domainVerification); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.domainVerification); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DomainVerificationStage builder() { + return new Builder(); + } + + public interface DomainVerificationStage { + _FinalStage domainVerification(@NotNull SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification); + + Builder from(SelfServiceProfileSsoTicketDomainAliasesConfig other); + } + + public interface _FinalStage { + SelfServiceProfileSsoTicketDomainAliasesConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DomainVerificationStage, _FinalStage { + private SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SelfServiceProfileSsoTicketDomainAliasesConfig other) { + domainVerification(other.getDomainVerification()); + return this; + } + + @java.lang.Override + @JsonSetter("domain_verification") + public _FinalStage domainVerification( + @NotNull SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification) { + this.domainVerification = Objects.requireNonNull(domainVerification, "domainVerification must not be null"); + return this; + } + + @java.lang.Override + public SelfServiceProfileSsoTicketDomainAliasesConfig build() { + return new SelfServiceProfileSsoTicketDomainAliasesConfig(domainVerification, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java new file mode 100644 index 000000000..dcb54f647 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelfServiceProfileSsoTicketDomainVerificationEnum { + public static final SelfServiceProfileSsoTicketDomainVerificationEnum REQUIRED = + new SelfServiceProfileSsoTicketDomainVerificationEnum(Value.REQUIRED, "required"); + + public static final SelfServiceProfileSsoTicketDomainVerificationEnum NONE = + new SelfServiceProfileSsoTicketDomainVerificationEnum(Value.NONE, "none"); + + public static final SelfServiceProfileSsoTicketDomainVerificationEnum OPTIONAL = + new SelfServiceProfileSsoTicketDomainVerificationEnum(Value.OPTIONAL, "optional"); + + private final Value value; + + private final String string; + + SelfServiceProfileSsoTicketDomainVerificationEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelfServiceProfileSsoTicketDomainVerificationEnum + && this.string.equals(((SelfServiceProfileSsoTicketDomainVerificationEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REQUIRED: + return visitor.visitRequired(); + case NONE: + return visitor.visitNone(); + case OPTIONAL: + return visitor.visitOptional(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelfServiceProfileSsoTicketDomainVerificationEnum valueOf(String value) { + switch (value) { + case "required": + return REQUIRED; + case "none": + return NONE; + case "optional": + return OPTIONAL; + default: + return new SelfServiceProfileSsoTicketDomainVerificationEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + OPTIONAL, + + REQUIRED, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitOptional(); + + T visitRequired(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java new file mode 100644 index 000000000..b84285960 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketEnabledOrganization.Builder.class) +public final class SelfServiceProfileSsoTicketEnabledOrganization { + private final String organizationId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketEnabledOrganization( + String organizationId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Map additionalProperties) { + this.organizationId = organizationId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("organization_id") + public String getOrganizationId() { + return organizationId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketEnabledOrganization + && equalTo((SelfServiceProfileSsoTicketEnabledOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketEnabledOrganization other) { + return organizationId.equals(other.organizationId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationId, this.assignMembershipOnLogin, this.showAsButton); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OrganizationIdStage builder() { + return new Builder(); + } + + public interface OrganizationIdStage { + /** + *

Organization identifier.

+ */ + _FinalStage organizationId(@NotNull String organizationId); + + Builder from(SelfServiceProfileSsoTicketEnabledOrganization other); + } + + public interface _FinalStage { + SelfServiceProfileSsoTicketEnabledOrganization build(); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OrganizationIdStage, _FinalStage { + private String organizationId; + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SelfServiceProfileSsoTicketEnabledOrganization other) { + organizationId(other.getOrganizationId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + return this; + } + + /** + *

Organization identifier.

+ *

Organization identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("organization_id") + public _FinalStage organizationId(@NotNull String organizationId) { + this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + @java.lang.Override + public SelfServiceProfileSsoTicketEnabledOrganization build() { + return new SelfServiceProfileSsoTicketEnabledOrganization( + organizationId, assignMembershipOnLogin, showAsButton, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java new file mode 100644 index 000000000..81075f195 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum { + public static final SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum WSFED = + new SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum(Value.WSFED, "wsfed"); + + public static final SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum SAMLP = + new SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum(Value.SAMLP, "samlp"); + + public static final SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum OAUTH2 = + new SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum(Value.OAUTH2, "oauth2"); + + private final Value value; + + private final String string; + + SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum + && this.string.equals( + ((SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case WSFED: + return visitor.visitWsfed(); + case SAMLP: + return visitor.visitSamlp(); + case OAUTH2: + return visitor.visitOauth2(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum valueOf(String value) { + switch (value) { + case "wsfed": + return WSFED; + case "samlp": + return SAMLP; + case "oauth2": + return OAUTH2; + default: + return new SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SAMLP, + + WSFED, + + OAUTH2, + + UNKNOWN + } + + public interface Visitor { + T visitSamlp(); + + T visitWsfed(); + + T visitOauth2(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java new file mode 100644 index 000000000..dff7baef3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketIdpInitiatedOptions.Builder.class) +public final class SelfServiceProfileSsoTicketIdpInitiatedOptions { + private final Optional enabled; + + private final Optional clientId; + + private final Optional clientProtocol; + + private final Optional clientAuthorizequery; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketIdpInitiatedOptions( + Optional enabled, + Optional clientId, + Optional clientProtocol, + Optional clientAuthorizequery, + Map additionalProperties) { + this.enabled = enabled; + this.clientId = clientId; + this.clientProtocol = clientProtocol; + this.clientAuthorizequery = clientAuthorizequery; + this.additionalProperties = additionalProperties; + } + + /** + * @return Enables IdP-initiated login for this connection + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Default application <code>client_id</code> user is redirected to after validated SAML response + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("client_protocol") + public Optional getClientProtocol() { + return clientProtocol; + } + + /** + * @return Query string options to customize the behaviour for OpenID Connect when <code>idpinitiated.client_protocol</code> is <code>oauth2</code>. Allowed parameters: <code>redirect_uri</code>, <code>scope</code>, <code>response_type</code>. For example, <code>redirect_uri=https://jwt.io&scope=openid email&response_type=token</code> + */ + @JsonProperty("client_authorizequery") + public Optional getClientAuthorizequery() { + return clientAuthorizequery; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketIdpInitiatedOptions + && equalTo((SelfServiceProfileSsoTicketIdpInitiatedOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketIdpInitiatedOptions other) { + return enabled.equals(other.enabled) + && clientId.equals(other.clientId) + && clientProtocol.equals(other.clientProtocol) + && clientAuthorizequery.equals(other.clientAuthorizequery); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.clientId, this.clientProtocol, this.clientAuthorizequery); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientProtocol = Optional.empty(); + + private Optional clientAuthorizequery = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SelfServiceProfileSsoTicketIdpInitiatedOptions other) { + enabled(other.getEnabled()); + clientId(other.getClientId()); + clientProtocol(other.getClientProtocol()); + clientAuthorizequery(other.getClientAuthorizequery()); + return this; + } + + /** + *

Enables IdP-initiated login for this connection

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Default application <code>client_id</code> user is redirected to after validated SAML response

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "client_protocol", nulls = Nulls.SKIP) + public Builder clientProtocol( + Optional clientProtocol) { + this.clientProtocol = clientProtocol; + return this; + } + + public Builder clientProtocol(SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum clientProtocol) { + this.clientProtocol = Optional.ofNullable(clientProtocol); + return this; + } + + /** + *

Query string options to customize the behaviour for OpenID Connect when <code>idpinitiated.client_protocol</code> is <code>oauth2</code>. Allowed parameters: <code>redirect_uri</code>, <code>scope</code>, <code>response_type</code>. For example, <code>redirect_uri=https://jwt.io&scope=openid email&response_type=token</code>

+ */ + @JsonSetter(value = "client_authorizequery", nulls = Nulls.SKIP) + public Builder clientAuthorizequery(Optional clientAuthorizequery) { + this.clientAuthorizequery = clientAuthorizequery; + return this; + } + + public Builder clientAuthorizequery(String clientAuthorizequery) { + this.clientAuthorizequery = Optional.ofNullable(clientAuthorizequery); + return this; + } + + public SelfServiceProfileSsoTicketIdpInitiatedOptions build() { + return new SelfServiceProfileSsoTicketIdpInitiatedOptions( + enabled, clientId, clientProtocol, clientAuthorizequery, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java new file mode 100644 index 000000000..b5d111ee9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketProvisioningConfig.Builder.class) +public final class SelfServiceProfileSsoTicketProvisioningConfig { + private final List scopes; + + private final OptionalNullable tokenLifetime; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketProvisioningConfig( + List scopes, + OptionalNullable tokenLifetime, + Map additionalProperties) { + this.scopes = scopes; + this.tokenLifetime = tokenLifetime; + this.additionalProperties = additionalProperties; + } + + /** + * @return The scopes of the SCIM tokens generated during the self-service flow. + */ + @JsonProperty("scopes") + public List getScopes() { + return scopes; + } + + /** + * @return Lifetime of the tokens in seconds. Must be greater than 900. If not provided, the tokens don't expire. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime") + public OptionalNullable getTokenLifetime() { + if (tokenLifetime == null) { + return OptionalNullable.absent(); + } + return tokenLifetime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime") + private OptionalNullable _getTokenLifetime() { + return tokenLifetime; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketProvisioningConfig + && equalTo((SelfServiceProfileSsoTicketProvisioningConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketProvisioningConfig other) { + return scopes.equals(other.scopes) && tokenLifetime.equals(other.tokenLifetime); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.scopes, this.tokenLifetime); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List scopes = new ArrayList<>(); + + private OptionalNullable tokenLifetime = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SelfServiceProfileSsoTicketProvisioningConfig other) { + scopes(other.getScopes()); + tokenLifetime(other.getTokenLifetime()); + return this; + } + + /** + *

The scopes of the SCIM tokens generated during the self-service flow.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(List scopes) { + this.scopes.clear(); + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + public Builder addScopes(SelfServiceProfileSsoTicketProvisioningScopeEnum scopes) { + this.scopes.add(scopes); + return this; + } + + public Builder addAllScopes(List scopes) { + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + /** + *

Lifetime of the tokens in seconds. Must be greater than 900. If not provided, the tokens don't expire.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(@Nullable OptionalNullable tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = OptionalNullable.of(tokenLifetime); + return this; + } + + public Builder tokenLifetime(Optional tokenLifetime) { + if (tokenLifetime.isPresent()) { + this.tokenLifetime = OptionalNullable.of(tokenLifetime.get()); + } else { + this.tokenLifetime = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenLifetime(com.auth0.client.mgmt.core.Nullable tokenLifetime) { + if (tokenLifetime.isNull()) { + this.tokenLifetime = OptionalNullable.ofNull(); + } else if (tokenLifetime.isEmpty()) { + this.tokenLifetime = OptionalNullable.absent(); + } else { + this.tokenLifetime = OptionalNullable.of(tokenLifetime.get()); + } + return this; + } + + public SelfServiceProfileSsoTicketProvisioningConfig build() { + return new SelfServiceProfileSsoTicketProvisioningConfig(scopes, tokenLifetime, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java new file mode 100644 index 000000000..ec9fada64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelfServiceProfileSsoTicketProvisioningScopeEnum { + public static final SelfServiceProfileSsoTicketProvisioningScopeEnum PATCH_USERS = + new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.PATCH_USERS, "patch:users"); + + public static final SelfServiceProfileSsoTicketProvisioningScopeEnum DELETE_USERS = + new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.DELETE_USERS, "delete:users"); + + public static final SelfServiceProfileSsoTicketProvisioningScopeEnum GET_USERS = + new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.GET_USERS, "get:users"); + + public static final SelfServiceProfileSsoTicketProvisioningScopeEnum PUT_USERS = + new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.PUT_USERS, "put:users"); + + public static final SelfServiceProfileSsoTicketProvisioningScopeEnum POST_USERS = + new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.POST_USERS, "post:users"); + + private final Value value; + + private final String string; + + SelfServiceProfileSsoTicketProvisioningScopeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelfServiceProfileSsoTicketProvisioningScopeEnum + && this.string.equals(((SelfServiceProfileSsoTicketProvisioningScopeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PATCH_USERS: + return visitor.visitPatchUsers(); + case DELETE_USERS: + return visitor.visitDeleteUsers(); + case GET_USERS: + return visitor.visitGetUsers(); + case PUT_USERS: + return visitor.visitPutUsers(); + case POST_USERS: + return visitor.visitPostUsers(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelfServiceProfileSsoTicketProvisioningScopeEnum valueOf(String value) { + switch (value) { + case "patch:users": + return PATCH_USERS; + case "delete:users": + return DELETE_USERS; + case "get:users": + return GET_USERS; + case "put:users": + return PUT_USERS; + case "post:users": + return POST_USERS; + default: + return new SelfServiceProfileSsoTicketProvisioningScopeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + GET_USERS, + + POST_USERS, + + PUT_USERS, + + PATCH_USERS, + + DELETE_USERS, + + UNKNOWN + } + + public interface Visitor { + T visitGetUsers(); + + T visitPostUsers(); + + T visitPutUsers(); + + T visitPatchUsers(); + + T visitDeleteUsers(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java new file mode 100644 index 000000000..0228f1414 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileUserAttribute.Builder.class) +public final class SelfServiceProfileUserAttribute { + private final String name; + + private final String description; + + private final boolean isOptional; + + private final Map additionalProperties; + + private SelfServiceProfileUserAttribute( + String name, String description, boolean isOptional, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOptional = isOptional; + this.additionalProperties = additionalProperties; + } + + /** + * @return Identifier of this attribute. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Description of this attribute. + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Determines if this attribute is required + */ + @JsonProperty("is_optional") + public boolean getIsOptional() { + return isOptional; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileUserAttribute && equalTo((SelfServiceProfileUserAttribute) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileUserAttribute other) { + return name.equals(other.name) && description.equals(other.description) && isOptional == other.isOptional; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOptional); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Identifier of this attribute.

+ */ + DescriptionStage name(@NotNull String name); + + Builder from(SelfServiceProfileUserAttribute other); + } + + public interface DescriptionStage { + /** + *

Description of this attribute.

+ */ + IsOptionalStage description(@NotNull String description); + } + + public interface IsOptionalStage { + /** + *

Determines if this attribute is required

+ */ + _FinalStage isOptional(boolean isOptional); + } + + public interface _FinalStage { + SelfServiceProfileUserAttribute build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOptionalStage, _FinalStage { + private String name; + + private String description; + + private boolean isOptional; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SelfServiceProfileUserAttribute other) { + name(other.getName()); + description(other.getDescription()); + isOptional(other.getIsOptional()); + return this; + } + + /** + *

Identifier of this attribute.

+ *

Identifier of this attribute.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Description of this attribute.

+ *

Description of this attribute.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("description") + public IsOptionalStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Determines if this attribute is required

+ *

Determines if this attribute is required

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_optional") + public _FinalStage isOptional(boolean isOptional) { + this.isOptional = isOptional; + return this; + } + + @java.lang.Override + public SelfServiceProfileUserAttribute build() { + return new SelfServiceProfileUserAttribute(name, description, isOptional, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java new file mode 100644 index 000000000..6424915ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionAuthenticationSignal.Builder.class) +public final class SessionAuthenticationSignal { + private final Optional name; + + private final Optional timestamp; + + private final Optional type; + + private final Map additionalProperties; + + private SessionAuthenticationSignal( + Optional name, + Optional timestamp, + Optional type, + Map additionalProperties) { + this.name = name; + this.timestamp = timestamp; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return One of: "federated", "passkey", "pwd", "sms", "email", "mfa", "mock" or a custom method denoted by a URL + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("timestamp") + public Optional getTimestamp() { + return timestamp; + } + + /** + * @return A specific MFA factor. Only present when "name" is set to "mfa" + */ + @JsonProperty("^type$") + public Optional getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionAuthenticationSignal && equalTo((SessionAuthenticationSignal) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionAuthenticationSignal other) { + return name.equals(other.name) && timestamp.equals(other.timestamp) && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.timestamp, this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional timestamp = Optional.empty(); + + private Optional type = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionAuthenticationSignal other) { + name(other.getName()); + timestamp(other.getTimestamp()); + type(other.getType()); + return this; + } + + /** + *

One of: "federated", "passkey", "pwd", "sms", "email", "mfa", "mock" or a custom method denoted by a URL

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "timestamp", nulls = Nulls.SKIP) + public Builder timestamp(Optional timestamp) { + this.timestamp = timestamp; + return this; + } + + public Builder timestamp(SessionDate timestamp) { + this.timestamp = Optional.ofNullable(timestamp); + return this; + } + + /** + *

A specific MFA factor. Only present when "name" is set to "mfa"

+ */ + @JsonSetter(value = "^type$", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + public SessionAuthenticationSignal build() { + return new SessionAuthenticationSignal(name, timestamp, type, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java new file mode 100644 index 000000000..d12ab5d88 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionAuthenticationSignals.Builder.class) +public final class SessionAuthenticationSignals { + private final Optional> methods; + + private final Map additionalProperties; + + private SessionAuthenticationSignals( + Optional> methods, Map additionalProperties) { + this.methods = methods; + this.additionalProperties = additionalProperties; + } + + /** + * @return Contains the authentication methods a user has completed during their session + */ + @JsonProperty("methods") + public Optional> getMethods() { + return methods; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionAuthenticationSignals && equalTo((SessionAuthenticationSignals) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionAuthenticationSignals other) { + return methods.equals(other.methods); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.methods); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> methods = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionAuthenticationSignals other) { + methods(other.getMethods()); + return this; + } + + /** + *

Contains the authentication methods a user has completed during their session

+ */ + @JsonSetter(value = "methods", nulls = Nulls.SKIP) + public Builder methods(Optional> methods) { + this.methods = methods; + return this; + } + + public Builder methods(List methods) { + this.methods = Optional.ofNullable(methods); + return this; + } + + public SessionAuthenticationSignals build() { + return new SessionAuthenticationSignals(methods, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java new file mode 100644 index 000000000..1d841f73b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionClientMetadata.Builder.class) +public final class SessionClientMetadata { + private final Optional clientId; + + private final Map additionalProperties; + + private SessionClientMetadata(Optional clientId, Map additionalProperties) { + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of client for the session + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionClientMetadata && equalTo((SessionClientMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionClientMetadata other) { + return clientId.equals(other.clientId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionClientMetadata other) { + clientId(other.getClientId()); + return this; + } + + /** + *

ID of client for the session

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + public SessionClientMetadata build() { + return new SessionClientMetadata(clientId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java new file mode 100644 index 000000000..459ef0888 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionCookieMetadata.Builder.class) +public final class SessionCookieMetadata { + private final Optional mode; + + private final Map additionalProperties; + + private SessionCookieMetadata( + Optional mode, Map additionalProperties) { + this.mode = mode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionCookieMetadata && equalTo((SessionCookieMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionCookieMetadata other) { + return mode.equals(other.mode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional mode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionCookieMetadata other) { + mode(other.getMode()); + return this; + } + + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(SessionCookieMetadataModeEnum mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + public SessionCookieMetadata build() { + return new SessionCookieMetadata(mode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java new file mode 100644 index 000000000..c082d2237 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SessionCookieMetadataModeEnum { + public static final SessionCookieMetadataModeEnum NON_PERSISTENT = + new SessionCookieMetadataModeEnum(Value.NON_PERSISTENT, "non-persistent"); + + public static final SessionCookieMetadataModeEnum PERSISTENT = + new SessionCookieMetadataModeEnum(Value.PERSISTENT, "persistent"); + + private final Value value; + + private final String string; + + SessionCookieMetadataModeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SessionCookieMetadataModeEnum + && this.string.equals(((SessionCookieMetadataModeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NON_PERSISTENT: + return visitor.visitNonPersistent(); + case PERSISTENT: + return visitor.visitPersistent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SessionCookieMetadataModeEnum valueOf(String value) { + switch (value) { + case "non-persistent": + return NON_PERSISTENT; + case "persistent": + return PERSISTENT; + default: + return new SessionCookieMetadataModeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NON_PERSISTENT, + + PERSISTENT, + + UNKNOWN + } + + public interface Visitor { + T visitNonPersistent(); + + T visitPersistent(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java new file mode 100644 index 000000000..56933f15e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SessionCookieModeEnum { + public static final SessionCookieModeEnum NON_PERSISTENT = + new SessionCookieModeEnum(Value.NON_PERSISTENT, "non-persistent"); + + public static final SessionCookieModeEnum PERSISTENT = new SessionCookieModeEnum(Value.PERSISTENT, "persistent"); + + private final Value value; + + private final String string; + + SessionCookieModeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SessionCookieModeEnum + && this.string.equals(((SessionCookieModeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NON_PERSISTENT: + return visitor.visitNonPersistent(); + case PERSISTENT: + return visitor.visitPersistent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SessionCookieModeEnum valueOf(String value) { + switch (value) { + case "non-persistent": + return NON_PERSISTENT; + case "persistent": + return PERSISTENT; + default: + return new SessionCookieModeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PERSISTENT, + + NON_PERSISTENT, + + UNKNOWN + } + + public interface Visitor { + T visitPersistent(); + + T visitNonPersistent(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java new file mode 100644 index 000000000..68e8bd009 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionCookieSchema.Builder.class) +public final class SessionCookieSchema { + private final SessionCookieModeEnum mode; + + private final Map additionalProperties; + + private SessionCookieSchema(SessionCookieModeEnum mode, Map additionalProperties) { + this.mode = mode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("mode") + public SessionCookieModeEnum getMode() { + return mode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionCookieSchema && equalTo((SessionCookieSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionCookieSchema other) { + return mode.equals(other.mode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModeStage builder() { + return new Builder(); + } + + public interface ModeStage { + _FinalStage mode(@NotNull SessionCookieModeEnum mode); + + Builder from(SessionCookieSchema other); + } + + public interface _FinalStage { + SessionCookieSchema build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModeStage, _FinalStage { + private SessionCookieModeEnum mode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SessionCookieSchema other) { + mode(other.getMode()); + return this; + } + + @java.lang.Override + @JsonSetter("mode") + public _FinalStage mode(@NotNull SessionCookieModeEnum mode) { + this.mode = Objects.requireNonNull(mode, "mode must not be null"); + return this; + } + + @java.lang.Override + public SessionCookieSchema build() { + return new SessionCookieSchema(mode, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDate.java b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java new file mode 100644 index 000000000..0c78619bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = SessionDate.Deserializer.class) +public final class SessionDate { + private final Object value; + + private final int type; + + private SessionDate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((OffsetDateTime) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionDate && equalTo((SessionDate) other); + } + + private boolean equalTo(SessionDate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SessionDate of(OffsetDateTime value) { + return new SessionDate(value, 0); + } + + public static SessionDate of(Map value) { + return new SessionDate(value, 1); + } + + public interface Visitor { + T visit(OffsetDateTime value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SessionDate.class); + } + + @java.lang.Override + public SessionDate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, OffsetDateTime.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java new file mode 100644 index 000000000..1da1dccac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionDeviceMetadata.Builder.class) +public final class SessionDeviceMetadata { + private final Optional initialUserAgent; + + private final OptionalNullable initialIp; + + private final Optional initialAsn; + + private final Optional lastUserAgent; + + private final OptionalNullable lastIp; + + private final Optional lastAsn; + + private final Map additionalProperties; + + private SessionDeviceMetadata( + Optional initialUserAgent, + OptionalNullable initialIp, + Optional initialAsn, + Optional lastUserAgent, + OptionalNullable lastIp, + Optional lastAsn, + Map additionalProperties) { + this.initialUserAgent = initialUserAgent; + this.initialIp = initialIp; + this.initialAsn = initialAsn; + this.lastUserAgent = lastUserAgent; + this.lastIp = lastIp; + this.lastAsn = lastAsn; + this.additionalProperties = additionalProperties; + } + + /** + * @return First user agent of the device from which this user logged in + */ + @JsonProperty("initial_user_agent") + public Optional getInitialUserAgent() { + return initialUserAgent; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("initial_ip") + public OptionalNullable getInitialIp() { + if (initialIp == null) { + return OptionalNullable.absent(); + } + return initialIp; + } + + /** + * @return First autonomous system number associated with this session + */ + @JsonProperty("initial_asn") + public Optional getInitialAsn() { + return initialAsn; + } + + /** + * @return Last user agent of the device from which this user logged in + */ + @JsonProperty("last_user_agent") + public Optional getLastUserAgent() { + return lastUserAgent; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_ip") + public OptionalNullable getLastIp() { + if (lastIp == null) { + return OptionalNullable.absent(); + } + return lastIp; + } + + /** + * @return Last autonomous system number from which this user logged in + */ + @JsonProperty("last_asn") + public Optional getLastAsn() { + return lastAsn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("initial_ip") + private OptionalNullable _getInitialIp() { + return initialIp; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_ip") + private OptionalNullable _getLastIp() { + return lastIp; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionDeviceMetadata && equalTo((SessionDeviceMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionDeviceMetadata other) { + return initialUserAgent.equals(other.initialUserAgent) + && initialIp.equals(other.initialIp) + && initialAsn.equals(other.initialAsn) + && lastUserAgent.equals(other.lastUserAgent) + && lastIp.equals(other.lastIp) + && lastAsn.equals(other.lastAsn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.initialUserAgent, this.initialIp, this.initialAsn, this.lastUserAgent, this.lastIp, this.lastAsn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional initialUserAgent = Optional.empty(); + + private OptionalNullable initialIp = OptionalNullable.absent(); + + private Optional initialAsn = Optional.empty(); + + private Optional lastUserAgent = Optional.empty(); + + private OptionalNullable lastIp = OptionalNullable.absent(); + + private Optional lastAsn = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionDeviceMetadata other) { + initialUserAgent(other.getInitialUserAgent()); + initialIp(other.getInitialIp()); + initialAsn(other.getInitialAsn()); + lastUserAgent(other.getLastUserAgent()); + lastIp(other.getLastIp()); + lastAsn(other.getLastAsn()); + return this; + } + + /** + *

First user agent of the device from which this user logged in

+ */ + @JsonSetter(value = "initial_user_agent", nulls = Nulls.SKIP) + public Builder initialUserAgent(Optional initialUserAgent) { + this.initialUserAgent = initialUserAgent; + return this; + } + + public Builder initialUserAgent(String initialUserAgent) { + this.initialUserAgent = Optional.ofNullable(initialUserAgent); + return this; + } + + @JsonSetter(value = "initial_ip", nulls = Nulls.SKIP) + public Builder initialIp(@Nullable OptionalNullable initialIp) { + this.initialIp = initialIp; + return this; + } + + public Builder initialIp(String initialIp) { + this.initialIp = OptionalNullable.of(initialIp); + return this; + } + + public Builder initialIp(Optional initialIp) { + if (initialIp.isPresent()) { + this.initialIp = OptionalNullable.of(initialIp.get()); + } else { + this.initialIp = OptionalNullable.absent(); + } + return this; + } + + public Builder initialIp(com.auth0.client.mgmt.core.Nullable initialIp) { + if (initialIp.isNull()) { + this.initialIp = OptionalNullable.ofNull(); + } else if (initialIp.isEmpty()) { + this.initialIp = OptionalNullable.absent(); + } else { + this.initialIp = OptionalNullable.of(initialIp.get()); + } + return this; + } + + /** + *

First autonomous system number associated with this session

+ */ + @JsonSetter(value = "initial_asn", nulls = Nulls.SKIP) + public Builder initialAsn(Optional initialAsn) { + this.initialAsn = initialAsn; + return this; + } + + public Builder initialAsn(String initialAsn) { + this.initialAsn = Optional.ofNullable(initialAsn); + return this; + } + + /** + *

Last user agent of the device from which this user logged in

+ */ + @JsonSetter(value = "last_user_agent", nulls = Nulls.SKIP) + public Builder lastUserAgent(Optional lastUserAgent) { + this.lastUserAgent = lastUserAgent; + return this; + } + + public Builder lastUserAgent(String lastUserAgent) { + this.lastUserAgent = Optional.ofNullable(lastUserAgent); + return this; + } + + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(@Nullable OptionalNullable lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = OptionalNullable.of(lastIp); + return this; + } + + public Builder lastIp(Optional lastIp) { + if (lastIp.isPresent()) { + this.lastIp = OptionalNullable.of(lastIp.get()); + } else { + this.lastIp = OptionalNullable.absent(); + } + return this; + } + + public Builder lastIp(com.auth0.client.mgmt.core.Nullable lastIp) { + if (lastIp.isNull()) { + this.lastIp = OptionalNullable.ofNull(); + } else if (lastIp.isEmpty()) { + this.lastIp = OptionalNullable.absent(); + } else { + this.lastIp = OptionalNullable.of(lastIp.get()); + } + return this; + } + + /** + *

Last autonomous system number from which this user logged in

+ */ + @JsonSetter(value = "last_asn", nulls = Nulls.SKIP) + public Builder lastAsn(Optional lastAsn) { + this.lastAsn = lastAsn; + return this; + } + + public Builder lastAsn(String lastAsn) { + this.lastAsn = Optional.ofNullable(lastAsn); + return this; + } + + public SessionDeviceMetadata build() { + return new SessionDeviceMetadata( + initialUserAgent, initialIp, initialAsn, lastUserAgent, lastIp, lastAsn, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java new file mode 100644 index 000000000..e59b0dd99 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java @@ -0,0 +1,405 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SessionResponseContent.Builder.class) +public final class SessionResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional authenticatedAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional lastInteractedAt; + + private final Optional device; + + private final Optional> clients; + + private final Optional authentication; + + private final Optional cookie; + + private final Map additionalProperties; + + private SessionResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional updatedAt, + Optional authenticatedAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional lastInteractedAt, + Optional device, + Optional> clients, + Optional authentication, + Optional cookie, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.authenticatedAt = authenticatedAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.lastInteractedAt = lastInteractedAt; + this.device = device; + this.clients = clients; + this.authentication = authentication; + this.cookie = cookie; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the session + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("authenticated_at") + public Optional getAuthenticatedAt() { + return authenticatedAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("last_interacted_at") + public Optional getLastInteractedAt() { + return lastInteractedAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return List of client details for the session + */ + @JsonProperty("clients") + public Optional> getClients() { + return clients; + } + + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("cookie") + public Optional getCookie() { + return cookie; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SessionResponseContent && equalTo((SessionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SessionResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && authenticatedAt.equals(other.authenticatedAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && lastInteractedAt.equals(other.lastInteractedAt) + && device.equals(other.device) + && clients.equals(other.clients) + && authentication.equals(other.authentication) + && cookie.equals(other.cookie); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.updatedAt, + this.authenticatedAt, + this.idleExpiresAt, + this.expiresAt, + this.lastInteractedAt, + this.device, + this.clients, + this.authentication, + this.cookie); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional authenticatedAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional lastInteractedAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional> clients = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional cookie = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SessionResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + authenticatedAt(other.getAuthenticatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + lastInteractedAt(other.getLastInteractedAt()); + device(other.getDevice()); + clients(other.getClients()); + authentication(other.getAuthentication()); + cookie(other.getCookie()); + return this; + } + + /** + *

The ID of the session

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(SessionDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(SessionDate updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "authenticated_at", nulls = Nulls.SKIP) + public Builder authenticatedAt(Optional authenticatedAt) { + this.authenticatedAt = authenticatedAt; + return this; + } + + public Builder authenticatedAt(SessionDate authenticatedAt) { + this.authenticatedAt = Optional.ofNullable(authenticatedAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(SessionDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(SessionDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "last_interacted_at", nulls = Nulls.SKIP) + public Builder lastInteractedAt(Optional lastInteractedAt) { + this.lastInteractedAt = lastInteractedAt; + return this; + } + + public Builder lastInteractedAt(SessionDate lastInteractedAt) { + this.lastInteractedAt = Optional.ofNullable(lastInteractedAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(SessionDeviceMetadata device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

List of client details for the session

+ */ + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional> clients) { + this.clients = clients; + return this; + } + + public Builder clients(List clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(SessionAuthenticationSignals authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "cookie", nulls = Nulls.SKIP) + public Builder cookie(Optional cookie) { + this.cookie = cookie; + return this; + } + + public Builder cookie(SessionCookieMetadata cookie) { + this.cookie = Optional.ofNullable(cookie); + return this; + } + + public SessionResponseContent build() { + return new SessionResponseContent( + id, + userId, + createdAt, + updatedAt, + authenticatedAt, + idleExpiresAt, + expiresAt, + lastInteractedAt, + device, + clients, + authentication, + cookie, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java new file mode 100644 index 000000000..41989a253 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetCustomSigningKeysResponseContent.Builder.class) +public final class SetCustomSigningKeysResponseContent { + private final Optional> keys; + + private final Map additionalProperties; + + private SetCustomSigningKeysResponseContent( + Optional> keys, Map additionalProperties) { + this.keys = keys; + this.additionalProperties = additionalProperties; + } + + /** + * @return An array of custom public signing keys. + */ + @JsonProperty("keys") + public Optional> getKeys() { + return keys; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetCustomSigningKeysResponseContent + && equalTo((SetCustomSigningKeysResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetCustomSigningKeysResponseContent other) { + return keys.equals(other.keys); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.keys); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> keys = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetCustomSigningKeysResponseContent other) { + keys(other.getKeys()); + return this; + } + + /** + *

An array of custom public signing keys.

+ */ + @JsonSetter(value = "keys", nulls = Nulls.SKIP) + public Builder keys(Optional> keys) { + this.keys = keys; + return this; + } + + public Builder keys(List keys) { + this.keys = Optional.ofNullable(keys); + return this; + } + + public SetCustomSigningKeysResponseContent build() { + return new SetCustomSigningKeysResponseContent(keys, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java new file mode 100644 index 000000000..6932d5194 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java @@ -0,0 +1,780 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetEmailTemplateRequestContent.Builder.class) +public final class SetEmailTemplateRequestContent { + private final EmailTemplateNameEnum template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private SetEmailTemplateRequestContent( + EmailTemplateNameEnum template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public EmailTemplateNameEnum getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetEmailTemplateRequestContent && equalTo((SetEmailTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetEmailTemplateRequestContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateStage builder() { + return new Builder(); + } + + public interface TemplateStage { + _FinalStage template(@NotNull EmailTemplateNameEnum template); + + Builder from(SetEmailTemplateRequestContent other); + } + + public interface _FinalStage { + SetEmailTemplateRequestContent build(); + + /** + *

Body of the email template.

+ */ + _FinalStage body(@Nullable OptionalNullable body); + + _FinalStage body(String body); + + _FinalStage body(Optional body); + + _FinalStage body(com.auth0.client.mgmt.core.Nullable body); + + /** + *

Senders from email address.

+ */ + _FinalStage from(@Nullable OptionalNullable from); + + _FinalStage from(String from); + + _FinalStage from(Optional from); + + _FinalStage from(com.auth0.client.mgmt.core.Nullable from); + + /** + *

URL to redirect the user to after a successful action.

+ */ + _FinalStage resultUrl(@Nullable OptionalNullable resultUrl); + + _FinalStage resultUrl(String resultUrl); + + _FinalStage resultUrl(Optional resultUrl); + + _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl); + + /** + *

Subject line of the email.

+ */ + _FinalStage subject(@Nullable OptionalNullable subject); + + _FinalStage subject(String subject); + + _FinalStage subject(Optional subject); + + _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject); + + /** + *

Syntax of the template body.

+ */ + _FinalStage syntax(@Nullable OptionalNullable syntax); + + _FinalStage syntax(String syntax); + + _FinalStage syntax(Optional syntax); + + _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax); + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds); + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect); + + _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect); + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(@Nullable OptionalNullable enabled); + + _FinalStage enabled(Boolean enabled); + + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateStage, _FinalStage { + private EmailTemplateNameEnum template; + + private OptionalNullable enabled = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable body = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetEmailTemplateRequestContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @java.lang.Override + @JsonSetter("template") + public _FinalStage template(@NotNull EmailTemplateNameEnum template) { + this.template = Objects.requireNonNull(template, "template must not be null"); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @java.lang.Override + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @java.lang.Override + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + /** + *

Syntax of the template body.

+ */ + @java.lang.Override + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public _FinalStage syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + /** + *

Subject line of the email.

+ */ + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @java.lang.Override + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + /** + *

Senders from email address.

+ */ + @java.lang.Override + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public _FinalStage from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + /** + *

Body of the email template.

+ */ + @java.lang.Override + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public _FinalStage body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + @java.lang.Override + public SetEmailTemplateRequestContent build() { + return new SetEmailTemplateRequestContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java new file mode 100644 index 000000000..12b45012d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java @@ -0,0 +1,780 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetEmailTemplateResponseContent.Builder.class) +public final class SetEmailTemplateResponseContent { + private final EmailTemplateNameEnum template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private SetEmailTemplateResponseContent( + EmailTemplateNameEnum template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public EmailTemplateNameEnum getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetEmailTemplateResponseContent && equalTo((SetEmailTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetEmailTemplateResponseContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateStage builder() { + return new Builder(); + } + + public interface TemplateStage { + _FinalStage template(@NotNull EmailTemplateNameEnum template); + + Builder from(SetEmailTemplateResponseContent other); + } + + public interface _FinalStage { + SetEmailTemplateResponseContent build(); + + /** + *

Body of the email template.

+ */ + _FinalStage body(@Nullable OptionalNullable body); + + _FinalStage body(String body); + + _FinalStage body(Optional body); + + _FinalStage body(com.auth0.client.mgmt.core.Nullable body); + + /** + *

Senders from email address.

+ */ + _FinalStage from(@Nullable OptionalNullable from); + + _FinalStage from(String from); + + _FinalStage from(Optional from); + + _FinalStage from(com.auth0.client.mgmt.core.Nullable from); + + /** + *

URL to redirect the user to after a successful action.

+ */ + _FinalStage resultUrl(@Nullable OptionalNullable resultUrl); + + _FinalStage resultUrl(String resultUrl); + + _FinalStage resultUrl(Optional resultUrl); + + _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl); + + /** + *

Subject line of the email.

+ */ + _FinalStage subject(@Nullable OptionalNullable subject); + + _FinalStage subject(String subject); + + _FinalStage subject(Optional subject); + + _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject); + + /** + *

Syntax of the template body.

+ */ + _FinalStage syntax(@Nullable OptionalNullable syntax); + + _FinalStage syntax(String syntax); + + _FinalStage syntax(Optional syntax); + + _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax); + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds); + + _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds); + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect); + + _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect); + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(@Nullable OptionalNullable enabled); + + _FinalStage enabled(Boolean enabled); + + _FinalStage enabled(Optional enabled); + + _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateStage, _FinalStage { + private EmailTemplateNameEnum template; + + private OptionalNullable enabled = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable body = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetEmailTemplateResponseContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @java.lang.Override + @JsonSetter("template") + public _FinalStage template(@NotNull EmailTemplateNameEnum template) { + this.template = Objects.requireNonNull(template, "template must not be null"); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @java.lang.Override + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public _FinalStage enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @java.lang.Override + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @java.lang.Override + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + /** + *

Syntax of the template body.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + /** + *

Syntax of the template body.

+ */ + @java.lang.Override + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public _FinalStage syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + /** + *

Subject line of the email.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + /** + *

Subject line of the email.

+ */ + @java.lang.Override + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public _FinalStage subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @java.lang.Override + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + /** + *

Senders from email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + /** + *

Senders from email address.

+ */ + @java.lang.Override + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public _FinalStage from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + /** + *

Body of the email template.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + /** + *

Body of the email template.

+ */ + @java.lang.Override + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public _FinalStage body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + @java.lang.Override + public SetEmailTemplateResponseContent build() { + return new SetEmailTemplateResponseContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java new file mode 100644 index 000000000..b0e6d7cfc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorDuoSettingsResponseContent.Builder.class) +public final class SetGuardianFactorDuoSettingsResponseContent { + private final Optional ikey; + + private final Optional skey; + + private final Optional host; + + private final Map additionalProperties; + + private SetGuardianFactorDuoSettingsResponseContent( + Optional ikey, + Optional skey, + Optional host, + Map additionalProperties) { + this.ikey = ikey; + this.skey = skey; + this.host = host; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ikey") + public Optional getIkey() { + return ikey; + } + + @JsonProperty("skey") + public Optional getSkey() { + return skey; + } + + @JsonProperty("host") + public Optional getHost() { + return host; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorDuoSettingsResponseContent + && equalTo((SetGuardianFactorDuoSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorDuoSettingsResponseContent other) { + return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ikey, this.skey, this.host); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ikey = Optional.empty(); + + private Optional skey = Optional.empty(); + + private Optional host = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorDuoSettingsResponseContent other) { + ikey(other.getIkey()); + skey(other.getSkey()); + host(other.getHost()); + return this; + } + + @JsonSetter(value = "ikey", nulls = Nulls.SKIP) + public Builder ikey(Optional ikey) { + this.ikey = ikey; + return this; + } + + public Builder ikey(String ikey) { + this.ikey = Optional.ofNullable(ikey); + return this; + } + + @JsonSetter(value = "skey", nulls = Nulls.SKIP) + public Builder skey(Optional skey) { + this.skey = skey; + return this; + } + + public Builder skey(String skey) { + this.skey = Optional.ofNullable(skey); + return this; + } + + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + public SetGuardianFactorDuoSettingsResponseContent build() { + return new SetGuardianFactorDuoSettingsResponseContent(ikey, skey, host, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java new file mode 100644 index 000000000..1d1d7dba3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorPhoneMessageTypesResponseContent.Builder.class) +public final class SetGuardianFactorPhoneMessageTypesResponseContent { + private final Optional> messageTypes; + + private final Map additionalProperties; + + private SetGuardianFactorPhoneMessageTypesResponseContent( + Optional> messageTypes, + Map additionalProperties) { + this.messageTypes = messageTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The list of phone factors to enable on the tenant. Can include sms and voice. + */ + @JsonProperty("message_types") + public Optional> getMessageTypes() { + return messageTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorPhoneMessageTypesResponseContent + && equalTo((SetGuardianFactorPhoneMessageTypesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorPhoneMessageTypesResponseContent other) { + return messageTypes.equals(other.messageTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.messageTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> messageTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorPhoneMessageTypesResponseContent other) { + messageTypes(other.getMessageTypes()); + return this; + } + + /** + *

The list of phone factors to enable on the tenant. Can include sms and voice.

+ */ + @JsonSetter(value = "message_types", nulls = Nulls.SKIP) + public Builder messageTypes(Optional> messageTypes) { + this.messageTypes = messageTypes; + return this; + } + + public Builder messageTypes(List messageTypes) { + this.messageTypes = Optional.ofNullable(messageTypes); + return this; + } + + public SetGuardianFactorPhoneMessageTypesResponseContent build() { + return new SetGuardianFactorPhoneMessageTypesResponseContent(messageTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java new file mode 100644 index 000000000..2fb065313 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorPhoneTemplatesResponseContent.Builder.class) +public final class SetGuardianFactorPhoneTemplatesResponseContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private SetGuardianFactorPhoneTemplatesResponseContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorPhoneTemplatesResponseContent + && equalTo((SetGuardianFactorPhoneTemplatesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorPhoneTemplatesResponseContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(SetGuardianFactorPhoneTemplatesResponseContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + SetGuardianFactorPhoneTemplatesResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorPhoneTemplatesResponseContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorPhoneTemplatesResponseContent build() { + return new SetGuardianFactorPhoneTemplatesResponseContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java new file mode 100644 index 000000000..7cebe40d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorResponseContent.Builder.class) +public final class SetGuardianFactorResponseContent { + private final boolean enabled; + + private final Map additionalProperties; + + private SetGuardianFactorResponseContent(boolean enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether this factor is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorResponseContent && equalTo((SetGuardianFactorResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorResponseContent other) { + return enabled == other.enabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether this factor is enabled (true) or disabled (false).

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(SetGuardianFactorResponseContent other); + } + + public interface _FinalStage { + SetGuardianFactorResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorResponseContent other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Whether this factor is enabled (true) or disabled (false).

+ *

Whether this factor is enabled (true) or disabled (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @java.lang.Override + public SetGuardianFactorResponseContent build() { + return new SetGuardianFactorResponseContent(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java new file mode 100644 index 000000000..7f1280a48 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorSmsTemplatesResponseContent.Builder.class) +public final class SetGuardianFactorSmsTemplatesResponseContent { + private final String enrollmentMessage; + + private final String verificationMessage; + + private final Map additionalProperties; + + private SetGuardianFactorSmsTemplatesResponseContent( + String enrollmentMessage, String verificationMessage, Map additionalProperties) { + this.enrollmentMessage = enrollmentMessage; + this.verificationMessage = verificationMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message sent to the user when they are invited to enroll with a phone number. + */ + @JsonProperty("enrollment_message") + public String getEnrollmentMessage() { + return enrollmentMessage; + } + + /** + * @return Message sent to the user when they are prompted to verify their account. + */ + @JsonProperty("verification_message") + public String getVerificationMessage() { + return verificationMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorSmsTemplatesResponseContent + && equalTo((SetGuardianFactorSmsTemplatesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorSmsTemplatesResponseContent other) { + return enrollmentMessage.equals(other.enrollmentMessage) + && verificationMessage.equals(other.verificationMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentMessage, this.verificationMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentMessageStage builder() { + return new Builder(); + } + + public interface EnrollmentMessageStage { + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ */ + VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage); + + Builder from(SetGuardianFactorSmsTemplatesResponseContent other); + } + + public interface VerificationMessageStage { + /** + *

Message sent to the user when they are prompted to verify their account.

+ */ + _FinalStage verificationMessage(@NotNull String verificationMessage); + } + + public interface _FinalStage { + SetGuardianFactorSmsTemplatesResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentMessageStage, VerificationMessageStage, _FinalStage { + private String enrollmentMessage; + + private String verificationMessage; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianFactorSmsTemplatesResponseContent other) { + enrollmentMessage(other.getEnrollmentMessage()); + verificationMessage(other.getVerificationMessage()); + return this; + } + + /** + *

Message sent to the user when they are invited to enroll with a phone number.

+ *

Message sent to the user when they are invited to enroll with a phone number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("enrollment_message") + public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { + this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); + return this; + } + + /** + *

Message sent to the user when they are prompted to verify their account.

+ *

Message sent to the user when they are prompted to verify their account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_message") + public _FinalStage verificationMessage(@NotNull String verificationMessage) { + this.verificationMessage = + Objects.requireNonNull(verificationMessage, "verificationMessage must not be null"); + return this; + } + + @java.lang.Override + public SetGuardianFactorSmsTemplatesResponseContent build() { + return new SetGuardianFactorSmsTemplatesResponseContent( + enrollmentMessage, verificationMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java new file mode 100644 index 000000000..c7ca94056 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPhoneResponseContent.Builder.class) +public final class SetGuardianFactorsProviderPhoneResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPhoneResponseContent( + Optional provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPhoneResponseContent + && equalTo((SetGuardianFactorsProviderPhoneResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPhoneResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPhoneResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public SetGuardianFactorsProviderPhoneResponseContent build() { + return new SetGuardianFactorsProviderPhoneResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java new file mode 100644 index 000000000..3e0e6cfa8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPhoneTwilioResponseContent.Builder.class) +public final class SetGuardianFactorsProviderPhoneTwilioResponseContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPhoneTwilioResponseContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPhoneTwilioResponseContent + && equalTo((SetGuardianFactorsProviderPhoneTwilioResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioResponseContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPhoneTwilioResponseContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public SetGuardianFactorsProviderPhoneTwilioResponseContent build() { + return new SetGuardianFactorsProviderPhoneTwilioResponseContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java new file mode 100644 index 000000000..07369413a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java @@ -0,0 +1,208 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationApnsRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationApnsRequestContent { + private final Optional sandbox; + + private final OptionalNullable bundleId; + + private final OptionalNullable p12; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationApnsRequestContent( + Optional sandbox, + OptionalNullable bundleId, + OptionalNullable p12, + Map additionalProperties) { + this.sandbox = sandbox; + this.bundleId = bundleId; + this.p12 = p12; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("sandbox") + public Optional getSandbox() { + return sandbox; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + public OptionalNullable getBundleId() { + if (bundleId == null) { + return OptionalNullable.absent(); + } + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("p12") + public OptionalNullable getP12() { + if (p12 == null) { + return OptionalNullable.absent(); + } + return p12; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + private OptionalNullable _getBundleId() { + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("p12") + private OptionalNullable _getP12() { + return p12; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationApnsRequestContent + && equalTo((SetGuardianFactorsProviderPushNotificationApnsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsRequestContent other) { + return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId) && p12.equals(other.p12); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sandbox, this.bundleId, this.p12); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sandbox = Optional.empty(); + + private OptionalNullable bundleId = OptionalNullable.absent(); + + private OptionalNullable p12 = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationApnsRequestContent other) { + sandbox(other.getSandbox()); + bundleId(other.getBundleId()); + p12(other.getP12()); + return this; + } + + @JsonSetter(value = "sandbox", nulls = Nulls.SKIP) + public Builder sandbox(Optional sandbox) { + this.sandbox = sandbox; + return this; + } + + public Builder sandbox(Boolean sandbox) { + this.sandbox = Optional.ofNullable(sandbox); + return this; + } + + @JsonSetter(value = "bundle_id", nulls = Nulls.SKIP) + public Builder bundleId(@Nullable OptionalNullable bundleId) { + this.bundleId = bundleId; + return this; + } + + public Builder bundleId(String bundleId) { + this.bundleId = OptionalNullable.of(bundleId); + return this; + } + + public Builder bundleId(Optional bundleId) { + if (bundleId.isPresent()) { + this.bundleId = OptionalNullable.of(bundleId.get()); + } else { + this.bundleId = OptionalNullable.absent(); + } + return this; + } + + public Builder bundleId(com.auth0.client.mgmt.core.Nullable bundleId) { + if (bundleId.isNull()) { + this.bundleId = OptionalNullable.ofNull(); + } else if (bundleId.isEmpty()) { + this.bundleId = OptionalNullable.absent(); + } else { + this.bundleId = OptionalNullable.of(bundleId.get()); + } + return this; + } + + @JsonSetter(value = "p12", nulls = Nulls.SKIP) + public Builder p12(@Nullable OptionalNullable p12) { + this.p12 = p12; + return this; + } + + public Builder p12(String p12) { + this.p12 = OptionalNullable.of(p12); + return this; + } + + public Builder p12(Optional p12) { + if (p12.isPresent()) { + this.p12 = OptionalNullable.of(p12.get()); + } else { + this.p12 = OptionalNullable.absent(); + } + return this; + } + + public Builder p12(com.auth0.client.mgmt.core.Nullable p12) { + if (p12.isNull()) { + this.p12 = OptionalNullable.ofNull(); + } else if (p12.isEmpty()) { + this.p12 = OptionalNullable.absent(); + } else { + this.p12 = OptionalNullable.of(p12.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationApnsRequestContent build() { + return new SetGuardianFactorsProviderPushNotificationApnsRequestContent( + sandbox, bundleId, p12, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java new file mode 100644 index 000000000..307f15ec1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationApnsResponseContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationApnsResponseContent { + private final Optional sandbox; + + private final OptionalNullable bundleId; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationApnsResponseContent( + Optional sandbox, OptionalNullable bundleId, Map additionalProperties) { + this.sandbox = sandbox; + this.bundleId = bundleId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("sandbox") + public Optional getSandbox() { + return sandbox; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + public OptionalNullable getBundleId() { + if (bundleId == null) { + return OptionalNullable.absent(); + } + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + private OptionalNullable _getBundleId() { + return bundleId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationApnsResponseContent + && equalTo((SetGuardianFactorsProviderPushNotificationApnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsResponseContent other) { + return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sandbox, this.bundleId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sandbox = Optional.empty(); + + private OptionalNullable bundleId = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationApnsResponseContent other) { + sandbox(other.getSandbox()); + bundleId(other.getBundleId()); + return this; + } + + @JsonSetter(value = "sandbox", nulls = Nulls.SKIP) + public Builder sandbox(Optional sandbox) { + this.sandbox = sandbox; + return this; + } + + public Builder sandbox(Boolean sandbox) { + this.sandbox = Optional.ofNullable(sandbox); + return this; + } + + @JsonSetter(value = "bundle_id", nulls = Nulls.SKIP) + public Builder bundleId(@Nullable OptionalNullable bundleId) { + this.bundleId = bundleId; + return this; + } + + public Builder bundleId(String bundleId) { + this.bundleId = OptionalNullable.of(bundleId); + return this; + } + + public Builder bundleId(Optional bundleId) { + if (bundleId.isPresent()) { + this.bundleId = OptionalNullable.of(bundleId.get()); + } else { + this.bundleId = OptionalNullable.absent(); + } + return this; + } + + public Builder bundleId(com.auth0.client.mgmt.core.Nullable bundleId) { + if (bundleId.isNull()) { + this.bundleId = OptionalNullable.ofNull(); + } else if (bundleId.isEmpty()) { + this.bundleId = OptionalNullable.absent(); + } else { + this.bundleId = OptionalNullable.of(bundleId.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationApnsResponseContent build() { + return new SetGuardianFactorsProviderPushNotificationApnsResponseContent( + sandbox, bundleId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java new file mode 100644 index 000000000..a3133b6e0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationFcmRequestContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationFcmRequestContent { + private final OptionalNullable serverKey; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationFcmRequestContent( + OptionalNullable serverKey, Map additionalProperties) { + this.serverKey = serverKey; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_key") + public OptionalNullable getServerKey() { + if (serverKey == null) { + return OptionalNullable.absent(); + } + return serverKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_key") + private OptionalNullable _getServerKey() { + return serverKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationFcmRequestContent + && equalTo((SetGuardianFactorsProviderPushNotificationFcmRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmRequestContent other) { + return serverKey.equals(other.serverKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.serverKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable serverKey = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationFcmRequestContent other) { + serverKey(other.getServerKey()); + return this; + } + + @JsonSetter(value = "server_key", nulls = Nulls.SKIP) + public Builder serverKey(@Nullable OptionalNullable serverKey) { + this.serverKey = serverKey; + return this; + } + + public Builder serverKey(String serverKey) { + this.serverKey = OptionalNullable.of(serverKey); + return this; + } + + public Builder serverKey(Optional serverKey) { + if (serverKey.isPresent()) { + this.serverKey = OptionalNullable.of(serverKey.get()); + } else { + this.serverKey = OptionalNullable.absent(); + } + return this; + } + + public Builder serverKey(com.auth0.client.mgmt.core.Nullable serverKey) { + if (serverKey.isNull()) { + this.serverKey = OptionalNullable.ofNull(); + } else if (serverKey.isEmpty()) { + this.serverKey = OptionalNullable.absent(); + } else { + this.serverKey = OptionalNullable.of(serverKey.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationFcmRequestContent build() { + return new SetGuardianFactorsProviderPushNotificationFcmRequestContent(serverKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java new file mode 100644 index 000000000..48ab3516e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationFcmv1RequestContent { + private final OptionalNullable serverCredentials; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationFcmv1RequestContent( + OptionalNullable serverCredentials, Map additionalProperties) { + this.serverCredentials = serverCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_credentials") + public OptionalNullable getServerCredentials() { + if (serverCredentials == null) { + return OptionalNullable.absent(); + } + return serverCredentials; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_credentials") + private OptionalNullable _getServerCredentials() { + return serverCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationFcmv1RequestContent + && equalTo((SetGuardianFactorsProviderPushNotificationFcmv1RequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent other) { + return serverCredentials.equals(other.serverCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.serverCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable serverCredentials = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent other) { + serverCredentials(other.getServerCredentials()); + return this; + } + + @JsonSetter(value = "server_credentials", nulls = Nulls.SKIP) + public Builder serverCredentials(@Nullable OptionalNullable serverCredentials) { + this.serverCredentials = serverCredentials; + return this; + } + + public Builder serverCredentials(String serverCredentials) { + this.serverCredentials = OptionalNullable.of(serverCredentials); + return this; + } + + public Builder serverCredentials(Optional serverCredentials) { + if (serverCredentials.isPresent()) { + this.serverCredentials = OptionalNullable.of(serverCredentials.get()); + } else { + this.serverCredentials = OptionalNullable.absent(); + } + return this; + } + + public Builder serverCredentials(com.auth0.client.mgmt.core.Nullable serverCredentials) { + if (serverCredentials.isNull()) { + this.serverCredentials = OptionalNullable.ofNull(); + } else if (serverCredentials.isEmpty()) { + this.serverCredentials = OptionalNullable.absent(); + } else { + this.serverCredentials = OptionalNullable.of(serverCredentials.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationFcmv1RequestContent build() { + return new SetGuardianFactorsProviderPushNotificationFcmv1RequestContent( + serverCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java new file mode 100644 index 000000000..c7713b530 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationResponseContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationResponseContent( + Optional provider, + Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationResponseContent + && equalTo((SetGuardianFactorsProviderPushNotificationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderPushNotificationProviderDataEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public SetGuardianFactorsProviderPushNotificationResponseContent build() { + return new SetGuardianFactorsProviderPushNotificationResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java new file mode 100644 index 000000000..0e2aff519 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderPushNotificationSnsResponseContent.Builder.class) +public final class SetGuardianFactorsProviderPushNotificationSnsResponseContent { + private final OptionalNullable awsAccessKeyId; + + private final OptionalNullable awsSecretAccessKey; + + private final OptionalNullable awsRegion; + + private final OptionalNullable snsApnsPlatformApplicationArn; + + private final OptionalNullable snsGcmPlatformApplicationArn; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderPushNotificationSnsResponseContent( + OptionalNullable awsAccessKeyId, + OptionalNullable awsSecretAccessKey, + OptionalNullable awsRegion, + OptionalNullable snsApnsPlatformApplicationArn, + OptionalNullable snsGcmPlatformApplicationArn, + Map additionalProperties) { + this.awsAccessKeyId = awsAccessKeyId; + this.awsSecretAccessKey = awsSecretAccessKey; + this.awsRegion = awsRegion; + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + public OptionalNullable getAwsAccessKeyId() { + if (awsAccessKeyId == null) { + return OptionalNullable.absent(); + } + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + public OptionalNullable getAwsSecretAccessKey() { + if (awsSecretAccessKey == null) { + return OptionalNullable.absent(); + } + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + public OptionalNullable getAwsRegion() { + if (awsRegion == null) { + return OptionalNullable.absent(); + } + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + public OptionalNullable getSnsApnsPlatformApplicationArn() { + if (snsApnsPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + public OptionalNullable getSnsGcmPlatformApplicationArn() { + if (snsGcmPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsGcmPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + private OptionalNullable _getAwsAccessKeyId() { + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + private OptionalNullable _getAwsSecretAccessKey() { + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + private OptionalNullable _getAwsRegion() { + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + private OptionalNullable _getSnsApnsPlatformApplicationArn() { + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + private OptionalNullable _getSnsGcmPlatformApplicationArn() { + return snsGcmPlatformApplicationArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderPushNotificationSnsResponseContent + && equalTo((SetGuardianFactorsProviderPushNotificationSnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsResponseContent other) { + return awsAccessKeyId.equals(other.awsAccessKeyId) + && awsSecretAccessKey.equals(other.awsSecretAccessKey) + && awsRegion.equals(other.awsRegion) + && snsApnsPlatformApplicationArn.equals(other.snsApnsPlatformApplicationArn) + && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.awsRegion, + this.snsApnsPlatformApplicationArn, + this.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable awsAccessKeyId = OptionalNullable.absent(); + + private OptionalNullable awsSecretAccessKey = OptionalNullable.absent(); + + private OptionalNullable awsRegion = OptionalNullable.absent(); + + private OptionalNullable snsApnsPlatformApplicationArn = OptionalNullable.absent(); + + private OptionalNullable snsGcmPlatformApplicationArn = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderPushNotificationSnsResponseContent other) { + awsAccessKeyId(other.getAwsAccessKeyId()); + awsSecretAccessKey(other.getAwsSecretAccessKey()); + awsRegion(other.getAwsRegion()); + snsApnsPlatformApplicationArn(other.getSnsApnsPlatformApplicationArn()); + snsGcmPlatformApplicationArn(other.getSnsGcmPlatformApplicationArn()); + return this; + } + + @JsonSetter(value = "aws_access_key_id", nulls = Nulls.SKIP) + public Builder awsAccessKeyId(@Nullable OptionalNullable awsAccessKeyId) { + this.awsAccessKeyId = awsAccessKeyId; + return this; + } + + public Builder awsAccessKeyId(String awsAccessKeyId) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId); + return this; + } + + public Builder awsAccessKeyId(Optional awsAccessKeyId) { + if (awsAccessKeyId.isPresent()) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } else { + this.awsAccessKeyId = OptionalNullable.absent(); + } + return this; + } + + public Builder awsAccessKeyId(com.auth0.client.mgmt.core.Nullable awsAccessKeyId) { + if (awsAccessKeyId.isNull()) { + this.awsAccessKeyId = OptionalNullable.ofNull(); + } else if (awsAccessKeyId.isEmpty()) { + this.awsAccessKeyId = OptionalNullable.absent(); + } else { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } + return this; + } + + @JsonSetter(value = "aws_secret_access_key", nulls = Nulls.SKIP) + public Builder awsSecretAccessKey(@Nullable OptionalNullable awsSecretAccessKey) { + this.awsSecretAccessKey = awsSecretAccessKey; + return this; + } + + public Builder awsSecretAccessKey(String awsSecretAccessKey) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey); + return this; + } + + public Builder awsSecretAccessKey(Optional awsSecretAccessKey) { + if (awsSecretAccessKey.isPresent()) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } else { + this.awsSecretAccessKey = OptionalNullable.absent(); + } + return this; + } + + public Builder awsSecretAccessKey(com.auth0.client.mgmt.core.Nullable awsSecretAccessKey) { + if (awsSecretAccessKey.isNull()) { + this.awsSecretAccessKey = OptionalNullable.ofNull(); + } else if (awsSecretAccessKey.isEmpty()) { + this.awsSecretAccessKey = OptionalNullable.absent(); + } else { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } + return this; + } + + @JsonSetter(value = "aws_region", nulls = Nulls.SKIP) + public Builder awsRegion(@Nullable OptionalNullable awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + public Builder awsRegion(String awsRegion) { + this.awsRegion = OptionalNullable.of(awsRegion); + return this; + } + + public Builder awsRegion(Optional awsRegion) { + if (awsRegion.isPresent()) { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } else { + this.awsRegion = OptionalNullable.absent(); + } + return this; + } + + public Builder awsRegion(com.auth0.client.mgmt.core.Nullable awsRegion) { + if (awsRegion.isNull()) { + this.awsRegion = OptionalNullable.ofNull(); + } else if (awsRegion.isEmpty()) { + this.awsRegion = OptionalNullable.absent(); + } else { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } + return this; + } + + @JsonSetter(value = "sns_apns_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsApnsPlatformApplicationArn(@Nullable OptionalNullable snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + return this; + } + + public Builder snsApnsPlatformApplicationArn(String snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn); + return this; + } + + public Builder snsApnsPlatformApplicationArn(Optional snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isPresent()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsApnsPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isNull()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsApnsPlatformApplicationArn.isEmpty()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } + return this; + } + + @JsonSetter(value = "sns_gcm_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsGcmPlatformApplicationArn(@Nullable OptionalNullable snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + return this; + } + + public Builder snsGcmPlatformApplicationArn(String snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn); + return this; + } + + public Builder snsGcmPlatformApplicationArn(Optional snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isPresent()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsGcmPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isNull()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsGcmPlatformApplicationArn.isEmpty()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } + return this; + } + + public SetGuardianFactorsProviderPushNotificationSnsResponseContent build() { + return new SetGuardianFactorsProviderPushNotificationSnsResponseContent( + awsAccessKeyId, + awsSecretAccessKey, + awsRegion, + snsApnsPlatformApplicationArn, + snsGcmPlatformApplicationArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java new file mode 100644 index 000000000..712e9c554 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderSmsResponseContent.Builder.class) +public final class SetGuardianFactorsProviderSmsResponseContent { + private final Optional provider; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderSmsResponseContent( + Optional provider, Map additionalProperties) { + this.provider = provider; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderSmsResponseContent + && equalTo((SetGuardianFactorsProviderSmsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderSmsResponseContent other) { + return provider.equals(other.provider); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderSmsResponseContent other) { + provider(other.getProvider()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(GuardianFactorsProviderSmsProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + public SetGuardianFactorsProviderSmsResponseContent build() { + return new SetGuardianFactorsProviderSmsResponseContent(provider, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java new file mode 100644 index 000000000..53076ea2e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianFactorsProviderSmsTwilioResponseContent.Builder.class) +public final class SetGuardianFactorsProviderSmsTwilioResponseContent { + private final OptionalNullable from; + + private final OptionalNullable messagingServiceSid; + + private final OptionalNullable authToken; + + private final OptionalNullable sid; + + private final Map additionalProperties; + + private SetGuardianFactorsProviderSmsTwilioResponseContent( + OptionalNullable from, + OptionalNullable messagingServiceSid, + OptionalNullable authToken, + OptionalNullable sid, + Map additionalProperties) { + this.from = from; + this.messagingServiceSid = messagingServiceSid; + this.authToken = authToken; + this.sid = sid; + this.additionalProperties = additionalProperties; + } + + /** + * @return From number + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Copilot SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + public OptionalNullable getMessagingServiceSid() { + if (messagingServiceSid == null) { + return OptionalNullable.absent(); + } + return messagingServiceSid; + } + + /** + * @return Twilio Authentication token + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + public OptionalNullable getAuthToken() { + if (authToken == null) { + return OptionalNullable.absent(); + } + return authToken; + } + + /** + * @return Twilio SID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + public OptionalNullable getSid() { + if (sid == null) { + return OptionalNullable.absent(); + } + return sid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messaging_service_sid") + private OptionalNullable _getMessagingServiceSid() { + return messagingServiceSid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_token") + private OptionalNullable _getAuthToken() { + return authToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sid") + private OptionalNullable _getSid() { + return sid; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianFactorsProviderSmsTwilioResponseContent + && equalTo((SetGuardianFactorsProviderSmsTwilioResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianFactorsProviderSmsTwilioResponseContent other) { + return from.equals(other.from) + && messagingServiceSid.equals(other.messagingServiceSid) + && authToken.equals(other.authToken) + && sid.equals(other.sid); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable messagingServiceSid = OptionalNullable.absent(); + + private OptionalNullable authToken = OptionalNullable.absent(); + + private OptionalNullable sid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetGuardianFactorsProviderSmsTwilioResponseContent other) { + from(other.getFrom()); + messagingServiceSid(other.getMessagingServiceSid()); + authToken(other.getAuthToken()); + sid(other.getSid()); + return this; + } + + /** + *

From number

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Copilot SID

+ */ + @JsonSetter(value = "messaging_service_sid", nulls = Nulls.SKIP) + public Builder messagingServiceSid(@Nullable OptionalNullable messagingServiceSid) { + this.messagingServiceSid = messagingServiceSid; + return this; + } + + public Builder messagingServiceSid(String messagingServiceSid) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid); + return this; + } + + public Builder messagingServiceSid(Optional messagingServiceSid) { + if (messagingServiceSid.isPresent()) { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } else { + this.messagingServiceSid = OptionalNullable.absent(); + } + return this; + } + + public Builder messagingServiceSid(com.auth0.client.mgmt.core.Nullable messagingServiceSid) { + if (messagingServiceSid.isNull()) { + this.messagingServiceSid = OptionalNullable.ofNull(); + } else if (messagingServiceSid.isEmpty()) { + this.messagingServiceSid = OptionalNullable.absent(); + } else { + this.messagingServiceSid = OptionalNullable.of(messagingServiceSid.get()); + } + return this; + } + + /** + *

Twilio Authentication token

+ */ + @JsonSetter(value = "auth_token", nulls = Nulls.SKIP) + public Builder authToken(@Nullable OptionalNullable authToken) { + this.authToken = authToken; + return this; + } + + public Builder authToken(String authToken) { + this.authToken = OptionalNullable.of(authToken); + return this; + } + + public Builder authToken(Optional authToken) { + if (authToken.isPresent()) { + this.authToken = OptionalNullable.of(authToken.get()); + } else { + this.authToken = OptionalNullable.absent(); + } + return this; + } + + public Builder authToken(com.auth0.client.mgmt.core.Nullable authToken) { + if (authToken.isNull()) { + this.authToken = OptionalNullable.ofNull(); + } else if (authToken.isEmpty()) { + this.authToken = OptionalNullable.absent(); + } else { + this.authToken = OptionalNullable.of(authToken.get()); + } + return this; + } + + /** + *

Twilio SID

+ */ + @JsonSetter(value = "sid", nulls = Nulls.SKIP) + public Builder sid(@Nullable OptionalNullable sid) { + this.sid = sid; + return this; + } + + public Builder sid(String sid) { + this.sid = OptionalNullable.of(sid); + return this; + } + + public Builder sid(Optional sid) { + if (sid.isPresent()) { + this.sid = OptionalNullable.of(sid.get()); + } else { + this.sid = OptionalNullable.absent(); + } + return this; + } + + public Builder sid(com.auth0.client.mgmt.core.Nullable sid) { + if (sid.isNull()) { + this.sid = OptionalNullable.ofNull(); + } else if (sid.isEmpty()) { + this.sid = OptionalNullable.absent(); + } else { + this.sid = OptionalNullable.of(sid.get()); + } + return this; + } + + public SetGuardianFactorsProviderSmsTwilioResponseContent build() { + return new SetGuardianFactorsProviderSmsTwilioResponseContent( + from, messagingServiceSid, authToken, sid, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java new file mode 100644 index 000000000..63eb55efd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetNetworkAclRequestContent.Builder.class) +public final class SetNetworkAclRequestContent { + private final String description; + + private final boolean active; + + private final double priority; + + private final NetworkAclRule rule; + + private final Map additionalProperties; + + private SetNetworkAclRequestContent( + String description, + boolean active, + double priority, + NetworkAclRule rule, + Map additionalProperties) { + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Indicates whether or not this access control list is actively being used + */ + @JsonProperty("active") + public boolean getActive() { + return active; + } + + /** + * @return Indicates the order in which the ACL will be evaluated relative to other ACL rules. + */ + @JsonProperty("priority") + public double getPriority() { + return priority; + } + + @JsonProperty("rule") + public NetworkAclRule getRule() { + return rule; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetNetworkAclRequestContent && equalTo((SetNetworkAclRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetNetworkAclRequestContent other) { + return description.equals(other.description) + && active == other.active + && priority == other.priority + && rule.equals(other.rule); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.description, this.active, this.priority, this.rule); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DescriptionStage builder() { + return new Builder(); + } + + public interface DescriptionStage { + ActiveStage description(@NotNull String description); + + Builder from(SetNetworkAclRequestContent other); + } + + public interface ActiveStage { + /** + *

Indicates whether or not this access control list is actively being used

+ */ + PriorityStage active(boolean active); + } + + public interface PriorityStage { + /** + *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ */ + RuleStage priority(double priority); + } + + public interface RuleStage { + _FinalStage rule(@NotNull NetworkAclRule rule); + } + + public interface _FinalStage { + SetNetworkAclRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DescriptionStage, ActiveStage, PriorityStage, RuleStage, _FinalStage { + private String description; + + private boolean active; + + private double priority; + + private NetworkAclRule rule; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetNetworkAclRequestContent other) { + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + return this; + } + + @java.lang.Override + @JsonSetter("description") + public ActiveStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Indicates whether or not this access control list is actively being used

+ *

Indicates whether or not this access control list is actively being used

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("active") + public PriorityStage active(boolean active) { + this.active = active; + return this; + } + + /** + *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("priority") + public RuleStage priority(double priority) { + this.priority = priority; + return this; + } + + @java.lang.Override + @JsonSetter("rule") + public _FinalStage rule(@NotNull NetworkAclRule rule) { + this.rule = Objects.requireNonNull(rule, "rule must not be null"); + return this; + } + + @java.lang.Override + public SetNetworkAclRequestContent build() { + return new SetNetworkAclRequestContent(description, active, priority, rule, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java new file mode 100644 index 000000000..2f9b88e14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetNetworkAclsResponseContent.Builder.class) +public final class SetNetworkAclsResponseContent { + private final Optional id; + + private final Optional description; + + private final Optional active; + + private final Optional priority; + + private final Optional rule; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private SetNetworkAclsResponseContent( + Optional id, + Optional description, + Optional active, + Optional priority, + Optional rule, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("rule") + public Optional getRule() { + return rule; + } + + /** + * @return The timestamp when the Network ACL Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp when the Network ACL Configuration was last updated + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetNetworkAclsResponseContent && equalTo((SetNetworkAclsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetNetworkAclsResponseContent other) { + return id.equals(other.id) + && description.equals(other.description) + && active.equals(other.active) + && priority.equals(other.priority) + && rule.equals(other.rule) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional active = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional rule = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SetNetworkAclsResponseContent other) { + id(other.getId()); + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(Double priority) { + this.priority = Optional.ofNullable(priority); + return this; + } + + @JsonSetter(value = "rule", nulls = Nulls.SKIP) + public Builder rule(Optional rule) { + this.rule = rule; + return this; + } + + public Builder rule(NetworkAclRule rule) { + this.rule = Optional.ofNullable(rule); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was last updated

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(String updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public SetNetworkAclsResponseContent build() { + return new SetNetworkAclsResponseContent( + id, description, active, priority, rule, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java new file mode 100644 index 000000000..fe5071d0f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetRulesConfigRequestContent.Builder.class) +public final class SetRulesConfigRequestContent { + private final String value; + + private final Map additionalProperties; + + private SetRulesConfigRequestContent(String value, Map additionalProperties) { + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return Value for a rules config variable. + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetRulesConfigRequestContent && equalTo((SetRulesConfigRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetRulesConfigRequestContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ValueStage builder() { + return new Builder(); + } + + public interface ValueStage { + /** + *

Value for a rules config variable.

+ */ + _FinalStage value(@NotNull String value); + + Builder from(SetRulesConfigRequestContent other); + } + + public interface _FinalStage { + SetRulesConfigRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ValueStage, _FinalStage { + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetRulesConfigRequestContent other) { + value(other.getValue()); + return this; + } + + /** + *

Value for a rules config variable.

+ *

Value for a rules config variable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public SetRulesConfigRequestContent build() { + return new SetRulesConfigRequestContent(value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java new file mode 100644 index 000000000..26d5058ad --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetRulesConfigResponseContent.Builder.class) +public final class SetRulesConfigResponseContent { + private final String key; + + private final String value; + + private final Map additionalProperties; + + private SetRulesConfigResponseContent(String key, String value, Map additionalProperties) { + this.key = key; + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return Key for a rules config variable. + */ + @JsonProperty("key") + public String getKey() { + return key; + } + + /** + * @return Value for a rules config variable. + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetRulesConfigResponseContent && equalTo((SetRulesConfigResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetRulesConfigResponseContent other) { + return key.equals(other.key) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.key, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KeyStage builder() { + return new Builder(); + } + + public interface KeyStage { + /** + *

Key for a rules config variable.

+ */ + ValueStage key(@NotNull String key); + + Builder from(SetRulesConfigResponseContent other); + } + + public interface ValueStage { + /** + *

Value for a rules config variable.

+ */ + _FinalStage value(@NotNull String value); + } + + public interface _FinalStage { + SetRulesConfigResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KeyStage, ValueStage, _FinalStage { + private String key; + + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetRulesConfigResponseContent other) { + key(other.getKey()); + value(other.getValue()); + return this; + } + + /** + *

Key for a rules config variable.

+ *

Key for a rules config variable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("key") + public ValueStage key(@NotNull String key) { + this.key = Objects.requireNonNull(key, "key must not be null"); + return this; + } + + /** + *

Value for a rules config variable.

+ *

Value for a rules config variable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public SetRulesConfigResponseContent build() { + return new SetRulesConfigResponseContent(key, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java new file mode 100644 index 000000000..5bd9d3875 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetUserAuthenticationMethodResponseContent.Builder.class) +public final class SetUserAuthenticationMethodResponseContent { + private final Optional id; + + private final CreatedAuthenticationMethodTypeEnum type; + + private final Optional name; + + private final Optional totpSecret; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional> authenticationMethods; + + private final Optional preferredAuthenticationMethod; + + private final Optional keyId; + + private final Optional publicKey; + + private final Optional relyingPartyIdentifier; + + private final Optional createdAt; + + private final Map additionalProperties; + + private SetUserAuthenticationMethodResponseContent( + Optional id, + CreatedAuthenticationMethodTypeEnum type, + Optional name, + Optional totpSecret, + Optional phoneNumber, + Optional email, + Optional> authenticationMethods, + Optional preferredAuthenticationMethod, + Optional keyId, + Optional publicKey, + Optional relyingPartyIdentifier, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.type = type; + this.name = name; + this.totpSecret = totpSecret; + this.phoneNumber = phoneNumber; + this.email = email; + this.authenticationMethods = authenticationMethods; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.keyId = keyId; + this.publicKey = publicKey; + this.relyingPartyIdentifier = relyingPartyIdentifier; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the newly created authentication method (automatically generated by the application) + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("type") + public CreatedAuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return A human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Base32 encoded secret for TOTP generation + */ + @JsonProperty("totp_secret") + public Optional getTotpSecret() { + return totpSecret; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("authentication_methods") + public Optional> getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return Applies to webauthn authenticators only. The id of the credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authenticators only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Applies to webauthn authenticators only. The relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + /** + * @return Authentication method creation date + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetUserAuthenticationMethodResponseContent + && equalTo((SetUserAuthenticationMethodResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetUserAuthenticationMethodResponseContent other) { + return id.equals(other.id) + && type.equals(other.type) + && name.equals(other.name) + && totpSecret.equals(other.totpSecret) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && authenticationMethods.equals(other.authenticationMethods) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.type, + this.name, + this.totpSecret, + this.phoneNumber, + this.email, + this.authenticationMethods, + this.preferredAuthenticationMethod, + this.keyId, + this.publicKey, + this.relyingPartyIdentifier, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type); + + Builder from(SetUserAuthenticationMethodResponseContent other); + } + + public interface _FinalStage { + SetUserAuthenticationMethodResponseContent build(); + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

A human-readable label to identify the authentication method.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Base32 encoded secret for TOTP generation

+ */ + _FinalStage totpSecret(Optional totpSecret); + + _FinalStage totpSecret(String totpSecret); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage authenticationMethods(Optional> authenticationMethods); + + _FinalStage authenticationMethods(List authenticationMethods); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authenticators only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); + + /** + *

Authentication method creation date

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CreatedAuthenticationMethodTypeEnum type; + + private Optional createdAt = Optional.empty(); + + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional> authenticationMethods = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional totpSecret = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetUserAuthenticationMethodResponseContent other) { + id(other.getId()); + type(other.getType()); + name(other.getName()); + totpSecret(other.getTotpSecret()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + authenticationMethods(other.getAuthenticationMethods()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); + createdAt(other.getCreatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Authentication method creation date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Authentication method creation date

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn authenticators only. The relying party identifier.

+ */ + @java.lang.Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to webauthn authenticators only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authenticators only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authenticators only. The id of the credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public _FinalStage authenticationMethods(List authenticationMethods) { + this.authenticationMethods = Optional.ofNullable(authenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public _FinalStage authenticationMethods( + Optional> authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage totpSecret(String totpSecret) { + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ */ + @java.lang.Override + @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) + public _FinalStage totpSecret(Optional totpSecret) { + this.totpSecret = totpSecret; + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public SetUserAuthenticationMethodResponseContent build() { + return new SetUserAuthenticationMethodResponseContent( + id, + type, + name, + totpSecret, + phoneNumber, + email, + authenticationMethods, + preferredAuthenticationMethod, + keyId, + publicKey, + relyingPartyIdentifier, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java new file mode 100644 index 000000000..a070ffc99 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetUserAuthenticationMethods.Builder.class) +public final class SetUserAuthenticationMethods { + private final AuthenticationTypeEnum type; + + private final Optional preferredAuthenticationMethod; + + private final Optional name; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional totpSecret; + + private final Map additionalProperties; + + private SetUserAuthenticationMethods( + AuthenticationTypeEnum type, + Optional preferredAuthenticationMethod, + Optional name, + Optional phoneNumber, + Optional email, + Optional totpSecret, + Map additionalProperties) { + this.type = type; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.name = name; + this.phoneNumber = phoneNumber; + this.email = email; + this.totpSecret = totpSecret; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public AuthenticationTypeEnum getType() { + return type; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return AA human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Applies to totp authentication methods only. The base32 encoded secret for TOTP generation. + */ + @JsonProperty("totp_secret") + public Optional getTotpSecret() { + return totpSecret; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetUserAuthenticationMethods && equalTo((SetUserAuthenticationMethods) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetUserAuthenticationMethods other) { + return type.equals(other.type) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && name.equals(other.name) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && totpSecret.equals(other.totpSecret); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.type, + this.preferredAuthenticationMethod, + this.name, + this.phoneNumber, + this.email, + this.totpSecret); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull AuthenticationTypeEnum type); + + Builder from(SetUserAuthenticationMethods other); + } + + public interface _FinalStage { + SetUserAuthenticationMethods build(); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

AA human-readable label to identify the authentication method.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + /** + *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

+ */ + _FinalStage totpSecret(Optional totpSecret); + + _FinalStage totpSecret(String totpSecret); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private AuthenticationTypeEnum type; + + private Optional totpSecret = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetUserAuthenticationMethods other) { + type(other.getType()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + name(other.getName()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + totpSecret(other.getTotpSecret()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull AuthenticationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage totpSecret(String totpSecret) { + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

+ */ + @java.lang.Override + @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) + public _FinalStage totpSecret(Optional totpSecret) { + this.totpSecret = totpSecret; + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

AA human-readable label to identify the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

AA human-readable label to identify the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public SetUserAuthenticationMethods build() { + return new SetUserAuthenticationMethods( + type, preferredAuthenticationMethod, name, phoneNumber, email, totpSecret, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java new file mode 100644 index 000000000..4b9b95a98 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SigningAlgorithmEnum { + public static final SigningAlgorithmEnum RS512 = new SigningAlgorithmEnum(Value.RS512, "RS512"); + + public static final SigningAlgorithmEnum PS256 = new SigningAlgorithmEnum(Value.PS256, "PS256"); + + public static final SigningAlgorithmEnum HS256 = new SigningAlgorithmEnum(Value.HS256, "HS256"); + + public static final SigningAlgorithmEnum RS256 = new SigningAlgorithmEnum(Value.RS256, "RS256"); + + private final Value value; + + private final String string; + + SigningAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SigningAlgorithmEnum && this.string.equals(((SigningAlgorithmEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case PS256: + return visitor.visitPs256(); + case HS256: + return visitor.visitHs256(); + case RS256: + return visitor.visitRs256(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SigningAlgorithmEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "PS256": + return PS256; + case "HS256": + return HS256; + case "RS256": + return RS256; + default: + return new SigningAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HS256, + + RS256, + + RS512, + + PS256, + + UNKNOWN + } + + public interface Visitor { + T visitHs256(); + + T visitRs256(); + + T visitRs512(); + + T visitPs256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java new file mode 100644 index 000000000..657e7445a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java @@ -0,0 +1,552 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SigningKeys.Builder.class) +public final class SigningKeys { + private final String kid; + + private final String cert; + + private final Optional pkcs7; + + private final Optional current; + + private final Optional next; + + private final Optional previous; + + private final Optional currentSince; + + private final Optional currentUntil; + + private final String fingerprint; + + private final String thumbprint; + + private final Optional revoked; + + private final Optional revokedAt; + + private final Map additionalProperties; + + private SigningKeys( + String kid, + String cert, + Optional pkcs7, + Optional current, + Optional next, + Optional previous, + Optional currentSince, + Optional currentUntil, + String fingerprint, + String thumbprint, + Optional revoked, + Optional revokedAt, + Map additionalProperties) { + this.kid = kid; + this.cert = cert; + this.pkcs7 = pkcs7; + this.current = current; + this.next = next; + this.previous = previous; + this.currentSince = currentSince; + this.currentUntil = currentUntil; + this.fingerprint = fingerprint; + this.thumbprint = thumbprint; + this.revoked = revoked; + this.revokedAt = revokedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The key id of the signing key + */ + @JsonProperty("kid") + public String getKid() { + return kid; + } + + /** + * @return The public certificate of the signing key + */ + @JsonProperty("cert") + public String getCert() { + return cert; + } + + /** + * @return The public certificate of the signing key in pkcs7 format + */ + @JsonProperty("pkcs7") + public Optional getPkcs7() { + return pkcs7; + } + + /** + * @return True if the key is the the current key + */ + @JsonProperty("current") + public Optional getCurrent() { + return current; + } + + /** + * @return True if the key is the the next key + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + /** + * @return True if the key is the the previous key + */ + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("current_since") + public Optional getCurrentSince() { + return currentSince; + } + + @JsonProperty("current_until") + public Optional getCurrentUntil() { + return currentUntil; + } + + /** + * @return The cert fingerprint + */ + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + /** + * @return The cert thumbprint + */ + @JsonProperty("thumbprint") + public String getThumbprint() { + return thumbprint; + } + + /** + * @return True if the key is revoked + */ + @JsonProperty("revoked") + public Optional getRevoked() { + return revoked; + } + + @JsonProperty("revoked_at") + public Optional getRevokedAt() { + return revokedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SigningKeys && equalTo((SigningKeys) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SigningKeys other) { + return kid.equals(other.kid) + && cert.equals(other.cert) + && pkcs7.equals(other.pkcs7) + && current.equals(other.current) + && next.equals(other.next) + && previous.equals(other.previous) + && currentSince.equals(other.currentSince) + && currentUntil.equals(other.currentUntil) + && fingerprint.equals(other.fingerprint) + && thumbprint.equals(other.thumbprint) + && revoked.equals(other.revoked) + && revokedAt.equals(other.revokedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.kid, + this.cert, + this.pkcs7, + this.current, + this.next, + this.previous, + this.currentSince, + this.currentUntil, + this.fingerprint, + this.thumbprint, + this.revoked, + this.revokedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KidStage builder() { + return new Builder(); + } + + public interface KidStage { + /** + *

The key id of the signing key

+ */ + CertStage kid(@NotNull String kid); + + Builder from(SigningKeys other); + } + + public interface CertStage { + /** + *

The public certificate of the signing key

+ */ + FingerprintStage cert(@NotNull String cert); + } + + public interface FingerprintStage { + /** + *

The cert fingerprint

+ */ + ThumbprintStage fingerprint(@NotNull String fingerprint); + } + + public interface ThumbprintStage { + /** + *

The cert thumbprint

+ */ + _FinalStage thumbprint(@NotNull String thumbprint); + } + + public interface _FinalStage { + SigningKeys build(); + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + _FinalStage pkcs7(Optional pkcs7); + + _FinalStage pkcs7(String pkcs7); + + /** + *

True if the key is the the current key

+ */ + _FinalStage current(Optional current); + + _FinalStage current(Boolean current); + + /** + *

True if the key is the the next key

+ */ + _FinalStage next(Optional next); + + _FinalStage next(Boolean next); + + /** + *

True if the key is the the previous key

+ */ + _FinalStage previous(Optional previous); + + _FinalStage previous(Boolean previous); + + _FinalStage currentSince(Optional currentSince); + + _FinalStage currentSince(SigningKeysDate currentSince); + + _FinalStage currentUntil(Optional currentUntil); + + _FinalStage currentUntil(SigningKeysDate currentUntil); + + /** + *

True if the key is revoked

+ */ + _FinalStage revoked(Optional revoked); + + _FinalStage revoked(Boolean revoked); + + _FinalStage revokedAt(Optional revokedAt); + + _FinalStage revokedAt(SigningKeysDate revokedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KidStage, CertStage, FingerprintStage, ThumbprintStage, _FinalStage { + private String kid; + + private String cert; + + private String fingerprint; + + private String thumbprint; + + private Optional revokedAt = Optional.empty(); + + private Optional revoked = Optional.empty(); + + private Optional currentUntil = Optional.empty(); + + private Optional currentSince = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional next = Optional.empty(); + + private Optional current = Optional.empty(); + + private Optional pkcs7 = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SigningKeys other) { + kid(other.getKid()); + cert(other.getCert()); + pkcs7(other.getPkcs7()); + current(other.getCurrent()); + next(other.getNext()); + previous(other.getPrevious()); + currentSince(other.getCurrentSince()); + currentUntil(other.getCurrentUntil()); + fingerprint(other.getFingerprint()); + thumbprint(other.getThumbprint()); + revoked(other.getRevoked()); + revokedAt(other.getRevokedAt()); + return this; + } + + /** + *

The key id of the signing key

+ *

The key id of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kid") + public CertStage kid(@NotNull String kid) { + this.kid = Objects.requireNonNull(kid, "kid must not be null"); + return this; + } + + /** + *

The public certificate of the signing key

+ *

The public certificate of the signing key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cert") + public FingerprintStage cert(@NotNull String cert) { + this.cert = Objects.requireNonNull(cert, "cert must not be null"); + return this; + } + + /** + *

The cert fingerprint

+ *

The cert fingerprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("fingerprint") + public ThumbprintStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The cert thumbprint

+ *

The cert thumbprint

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("thumbprint") + public _FinalStage thumbprint(@NotNull String thumbprint) { + this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage revokedAt(SigningKeysDate revokedAt) { + this.revokedAt = Optional.ofNullable(revokedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) + public _FinalStage revokedAt(Optional revokedAt) { + this.revokedAt = revokedAt; + return this; + } + + /** + *

True if the key is revoked

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage revoked(Boolean revoked) { + this.revoked = Optional.ofNullable(revoked); + return this; + } + + /** + *

True if the key is revoked

+ */ + @java.lang.Override + @JsonSetter(value = "revoked", nulls = Nulls.SKIP) + public _FinalStage revoked(Optional revoked) { + this.revoked = revoked; + return this; + } + + @java.lang.Override + public _FinalStage currentUntil(SigningKeysDate currentUntil) { + this.currentUntil = Optional.ofNullable(currentUntil); + return this; + } + + @java.lang.Override + @JsonSetter(value = "current_until", nulls = Nulls.SKIP) + public _FinalStage currentUntil(Optional currentUntil) { + this.currentUntil = currentUntil; + return this; + } + + @java.lang.Override + public _FinalStage currentSince(SigningKeysDate currentSince) { + this.currentSince = Optional.ofNullable(currentSince); + return this; + } + + @java.lang.Override + @JsonSetter(value = "current_since", nulls = Nulls.SKIP) + public _FinalStage currentSince(Optional currentSince) { + this.currentSince = currentSince; + return this; + } + + /** + *

True if the key is the the previous key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage previous(Boolean previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + /** + *

True if the key is the the previous key

+ */ + @java.lang.Override + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public _FinalStage previous(Optional previous) { + this.previous = previous; + return this; + } + + /** + *

True if the key is the the next key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage next(Boolean next) { + this.next = Optional.ofNullable(next); + return this; + } + + /** + *

True if the key is the the next key

+ */ + @java.lang.Override + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public _FinalStage next(Optional next) { + this.next = next; + return this; + } + + /** + *

True if the key is the the current key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage current(Boolean current) { + this.current = Optional.ofNullable(current); + return this; + } + + /** + *

True if the key is the the current key

+ */ + @java.lang.Override + @JsonSetter(value = "current", nulls = Nulls.SKIP) + public _FinalStage current(Optional current) { + this.current = current; + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage pkcs7(String pkcs7) { + this.pkcs7 = Optional.ofNullable(pkcs7); + return this; + } + + /** + *

The public certificate of the signing key in pkcs7 format

+ */ + @java.lang.Override + @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) + public _FinalStage pkcs7(Optional pkcs7) { + this.pkcs7 = pkcs7; + return this; + } + + @java.lang.Override + public SigningKeys build() { + return new SigningKeys( + kid, + cert, + pkcs7, + current, + next, + previous, + currentSince, + currentUntil, + fingerprint, + thumbprint, + revoked, + revokedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java new file mode 100644 index 000000000..2e7dab279 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = SigningKeysDate.Deserializer.class) +public final class SigningKeysDate { + private final Object value; + + private final int type; + + private SigningKeysDate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SigningKeysDate && equalTo((SigningKeysDate) other); + } + + private boolean equalTo(SigningKeysDate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SigningKeysDate of(String value) { + return new SigningKeysDate(value, 0); + } + + public static SigningKeysDate of(Map value) { + return new SigningKeysDate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SigningKeysDate.class); + } + + @java.lang.Override + public SigningKeysDate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java new file mode 100644 index 000000000..1046a9079 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SignupSchema.Builder.class) +public final class SignupSchema { + private final Optional status; + + private final Map additionalProperties; + + private SignupSchema(Optional status, Map additionalProperties) { + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SignupSchema && equalTo((SignupSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SignupSchema other) { + return status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SignupSchema other) { + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(SignupStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + public SignupSchema build() { + return new SignupSchema(status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java new file mode 100644 index 000000000..cb5d82bd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SignupStatusEnum { + public static final SignupStatusEnum INACTIVE = new SignupStatusEnum(Value.INACTIVE, "inactive"); + + public static final SignupStatusEnum REQUIRED = new SignupStatusEnum(Value.REQUIRED, "required"); + + public static final SignupStatusEnum OPTIONAL = new SignupStatusEnum(Value.OPTIONAL, "optional"); + + private final Value value; + + private final String string; + + SignupStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SignupStatusEnum && this.string.equals(((SignupStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case INACTIVE: + return visitor.visitInactive(); + case REQUIRED: + return visitor.visitRequired(); + case OPTIONAL: + return visitor.visitOptional(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SignupStatusEnum valueOf(String value) { + switch (value) { + case "inactive": + return INACTIVE; + case "required": + return REQUIRED; + case "optional": + return OPTIONAL; + default: + return new SignupStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + REQUIRED, + + OPTIONAL, + + INACTIVE, + + UNKNOWN + } + + public interface Visitor { + T visitRequired(); + + T visitOptional(); + + T visitInactive(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java new file mode 100644 index 000000000..8201e8d66 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SignupVerification.Builder.class) +public final class SignupVerification { + private final Optional active; + + private final Map additionalProperties; + + private SignupVerification(Optional active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SignupVerification && equalTo((SignupVerification) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SignupVerification other) { + return active.equals(other.active); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.active); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional active = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SignupVerification other) { + active(other.getActive()); + return this; + } + + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + public SignupVerification build() { + return new SignupVerification(active, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java new file mode 100644 index 000000000..b4ea5c8be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SignupVerified.Builder.class) +public final class SignupVerified { + private final Optional status; + + private final Optional verification; + + private final Map additionalProperties; + + private SignupVerified( + Optional status, + Optional verification, + Map additionalProperties) { + this.status = status; + this.verification = verification; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("verification") + public Optional getVerification() { + return verification; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SignupVerified && equalTo((SignupVerified) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SignupVerified other) { + return status.equals(other.status) && verification.equals(other.verification); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.status, this.verification); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional status = Optional.empty(); + + private Optional verification = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SignupVerified other) { + status(other.getStatus()); + verification(other.getVerification()); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(SignupStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "verification", nulls = Nulls.SKIP) + public Builder verification(Optional verification) { + this.verification = verification; + return this; + } + + public Builder verification(SignupVerification verification) { + this.verification = Optional.ofNullable(verification); + return this; + } + + public SignupVerified build() { + return new SignupVerified(status, verification, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java new file mode 100644 index 000000000..506db0d55 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java @@ -0,0 +1,873 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SupportedLocales { + public static final SupportedLocales AZ = new SupportedLocales(Value.AZ, "az"); + + public static final SupportedLocales MK = new SupportedLocales(Value.MK, "mk"); + + public static final SupportedLocales CA_ES = new SupportedLocales(Value.CA_ES, "ca-ES"); + + public static final SupportedLocales ML = new SupportedLocales(Value.ML, "ml"); + + public static final SupportedLocales TR = new SupportedLocales(Value.TR, "tr"); + + public static final SupportedLocales GU = new SupportedLocales(Value.GU, "gu"); + + public static final SupportedLocales ES_AR = new SupportedLocales(Value.ES_AR, "es-AR"); + + public static final SupportedLocales ID = new SupportedLocales(Value.ID, "id"); + + public static final SupportedLocales CNR = new SupportedLocales(Value.CNR, "cnr"); + + public static final SupportedLocales MN = new SupportedLocales(Value.MN, "mn"); + + public static final SupportedLocales FI = new SupportedLocales(Value.FI, "fi"); + + public static final SupportedLocales PL = new SupportedLocales(Value.PL, "pl"); + + public static final SupportedLocales EN_CA = new SupportedLocales(Value.EN_CA, "en-CA"); + + public static final SupportedLocales AR_EG = new SupportedLocales(Value.AR_EG, "ar-EG"); + + public static final SupportedLocales MR = new SupportedLocales(Value.MR, "mr"); + + public static final SupportedLocales MS = new SupportedLocales(Value.MS, "ms"); + + public static final SupportedLocales PT_PT = new SupportedLocales(Value.PT_PT, "pt-PT"); + + public static final SupportedLocales SK = new SupportedLocales(Value.SK, "sk"); + + public static final SupportedLocales SL = new SupportedLocales(Value.SL, "sl"); + + public static final SupportedLocales CS = new SupportedLocales(Value.CS, "cs"); + + public static final SupportedLocales UR = new SupportedLocales(Value.UR, "ur"); + + public static final SupportedLocales HU = new SupportedLocales(Value.HU, "hu"); + + public static final SupportedLocales TE = new SupportedLocales(Value.TE, "te"); + + public static final SupportedLocales ZH_CN = new SupportedLocales(Value.ZH_CN, "zh-CN"); + + public static final SupportedLocales AR_SA = new SupportedLocales(Value.AR_SA, "ar-SA"); + + public static final SupportedLocales SO = new SupportedLocales(Value.SO, "so"); + + public static final SupportedLocales FR = new SupportedLocales(Value.FR, "fr"); + + public static final SupportedLocales NO = new SupportedLocales(Value.NO, "no"); + + public static final SupportedLocales ZH_TW = new SupportedLocales(Value.ZH_TW, "zh-TW"); + + public static final SupportedLocales AR = new SupportedLocales(Value.AR, "ar"); + + public static final SupportedLocales PT = new SupportedLocales(Value.PT, "pt"); + + public static final SupportedLocales MY = new SupportedLocales(Value.MY, "my"); + + public static final SupportedLocales SQ = new SupportedLocales(Value.SQ, "sq"); + + public static final SupportedLocales HY = new SupportedLocales(Value.HY, "hy"); + + public static final SupportedLocales FR_FR = new SupportedLocales(Value.FR_FR, "fr-FR"); + + public static final SupportedLocales CY = new SupportedLocales(Value.CY, "cy"); + + public static final SupportedLocales PA = new SupportedLocales(Value.PA, "pa"); + + public static final SupportedLocales KA = new SupportedLocales(Value.KA, "ka"); + + public static final SupportedLocales IS = new SupportedLocales(Value.IS, "is"); + + public static final SupportedLocales FA = new SupportedLocales(Value.FA, "fa"); + + public static final SupportedLocales BN = new SupportedLocales(Value.BN, "bn"); + + public static final SupportedLocales PT_BR = new SupportedLocales(Value.PT_BR, "pt-BR"); + + public static final SupportedLocales SW = new SupportedLocales(Value.SW, "sw"); + + public static final SupportedLocales HI = new SupportedLocales(Value.HI, "hi"); + + public static final SupportedLocales EN = new SupportedLocales(Value.EN, "en"); + + public static final SupportedLocales NB = new SupportedLocales(Value.NB, "nb"); + + public static final SupportedLocales DA = new SupportedLocales(Value.DA, "da"); + + public static final SupportedLocales LT = new SupportedLocales(Value.LT, "lt"); + + public static final SupportedLocales BS = new SupportedLocales(Value.BS, "bs"); + + public static final SupportedLocales ES_MX = new SupportedLocales(Value.ES_MX, "es-MX"); + + public static final SupportedLocales LV = new SupportedLocales(Value.LV, "lv"); + + public static final SupportedLocales RO = new SupportedLocales(Value.RO, "ro"); + + public static final SupportedLocales UK = new SupportedLocales(Value.UK, "uk"); + + public static final SupportedLocales DE = new SupportedLocales(Value.DE, "de"); + + public static final SupportedLocales ES = new SupportedLocales(Value.ES, "es"); + + public static final SupportedLocales KK = new SupportedLocales(Value.KK, "kk"); + + public static final SupportedLocales ET = new SupportedLocales(Value.ET, "et"); + + public static final SupportedLocales TA = new SupportedLocales(Value.TA, "ta"); + + public static final SupportedLocales HR = new SupportedLocales(Value.HR, "hr"); + + public static final SupportedLocales KN = new SupportedLocales(Value.KN, "kn"); + + public static final SupportedLocales ZGH = new SupportedLocales(Value.ZGH, "zgh"); + + public static final SupportedLocales AM = new SupportedLocales(Value.AM, "am"); + + public static final SupportedLocales JA = new SupportedLocales(Value.JA, "ja"); + + public static final SupportedLocales KO = new SupportedLocales(Value.KO, "ko"); + + public static final SupportedLocales RU = new SupportedLocales(Value.RU, "ru"); + + public static final SupportedLocales NL = new SupportedLocales(Value.NL, "nl"); + + public static final SupportedLocales VI = new SupportedLocales(Value.VI, "vi"); + + public static final SupportedLocales BG = new SupportedLocales(Value.BG, "bg"); + + public static final SupportedLocales NN = new SupportedLocales(Value.NN, "nn"); + + public static final SupportedLocales GL_ES = new SupportedLocales(Value.GL_ES, "gl-ES"); + + public static final SupportedLocales TH = new SupportedLocales(Value.TH, "th"); + + public static final SupportedLocales SR = new SupportedLocales(Value.SR, "sr"); + + public static final SupportedLocales ES419 = new SupportedLocales(Value.ES419, "es-419"); + + public static final SupportedLocales HE = new SupportedLocales(Value.HE, "he"); + + public static final SupportedLocales ZH_HK = new SupportedLocales(Value.ZH_HK, "zh-HK"); + + public static final SupportedLocales EU_ES = new SupportedLocales(Value.EU_ES, "eu-ES"); + + public static final SupportedLocales TL = new SupportedLocales(Value.TL, "tl"); + + public static final SupportedLocales IT = new SupportedLocales(Value.IT, "it"); + + public static final SupportedLocales SV = new SupportedLocales(Value.SV, "sv"); + + public static final SupportedLocales FR_CA = new SupportedLocales(Value.FR_CA, "fr-CA"); + + public static final SupportedLocales EL = new SupportedLocales(Value.EL, "el"); + + private final Value value; + + private final String string; + + SupportedLocales(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SupportedLocales && this.string.equals(((SupportedLocales) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AZ: + return visitor.visitAz(); + case MK: + return visitor.visitMk(); + case CA_ES: + return visitor.visitCaEs(); + case ML: + return visitor.visitMl(); + case TR: + return visitor.visitTr(); + case GU: + return visitor.visitGu(); + case ES_AR: + return visitor.visitEsAr(); + case ID: + return visitor.visitId(); + case CNR: + return visitor.visitCnr(); + case MN: + return visitor.visitMn(); + case FI: + return visitor.visitFi(); + case PL: + return visitor.visitPl(); + case EN_CA: + return visitor.visitEnCa(); + case AR_EG: + return visitor.visitArEg(); + case MR: + return visitor.visitMr(); + case MS: + return visitor.visitMs(); + case PT_PT: + return visitor.visitPtPt(); + case SK: + return visitor.visitSk(); + case SL: + return visitor.visitSl(); + case CS: + return visitor.visitCs(); + case UR: + return visitor.visitUr(); + case HU: + return visitor.visitHu(); + case TE: + return visitor.visitTe(); + case ZH_CN: + return visitor.visitZhCn(); + case AR_SA: + return visitor.visitArSa(); + case SO: + return visitor.visitSo(); + case FR: + return visitor.visitFr(); + case NO: + return visitor.visitNo(); + case ZH_TW: + return visitor.visitZhTw(); + case AR: + return visitor.visitAr(); + case PT: + return visitor.visitPt(); + case MY: + return visitor.visitMy(); + case SQ: + return visitor.visitSq(); + case HY: + return visitor.visitHy(); + case FR_FR: + return visitor.visitFrFr(); + case CY: + return visitor.visitCy(); + case PA: + return visitor.visitPa(); + case KA: + return visitor.visitKa(); + case IS: + return visitor.visitIs(); + case FA: + return visitor.visitFa(); + case BN: + return visitor.visitBn(); + case PT_BR: + return visitor.visitPtBr(); + case SW: + return visitor.visitSw(); + case HI: + return visitor.visitHi(); + case EN: + return visitor.visitEn(); + case NB: + return visitor.visitNb(); + case DA: + return visitor.visitDa(); + case LT: + return visitor.visitLt(); + case BS: + return visitor.visitBs(); + case ES_MX: + return visitor.visitEsMx(); + case LV: + return visitor.visitLv(); + case RO: + return visitor.visitRo(); + case UK: + return visitor.visitUk(); + case DE: + return visitor.visitDe(); + case ES: + return visitor.visitEs(); + case KK: + return visitor.visitKk(); + case ET: + return visitor.visitEt(); + case TA: + return visitor.visitTa(); + case HR: + return visitor.visitHr(); + case KN: + return visitor.visitKn(); + case ZGH: + return visitor.visitZgh(); + case AM: + return visitor.visitAm(); + case JA: + return visitor.visitJa(); + case KO: + return visitor.visitKo(); + case RU: + return visitor.visitRu(); + case NL: + return visitor.visitNl(); + case VI: + return visitor.visitVi(); + case BG: + return visitor.visitBg(); + case NN: + return visitor.visitNn(); + case GL_ES: + return visitor.visitGlEs(); + case TH: + return visitor.visitTh(); + case SR: + return visitor.visitSr(); + case ES419: + return visitor.visitEs419(); + case HE: + return visitor.visitHe(); + case ZH_HK: + return visitor.visitZhHk(); + case EU_ES: + return visitor.visitEuEs(); + case TL: + return visitor.visitTl(); + case IT: + return visitor.visitIt(); + case SV: + return visitor.visitSv(); + case FR_CA: + return visitor.visitFrCa(); + case EL: + return visitor.visitEl(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SupportedLocales valueOf(String value) { + switch (value) { + case "az": + return AZ; + case "mk": + return MK; + case "ca-ES": + return CA_ES; + case "ml": + return ML; + case "tr": + return TR; + case "gu": + return GU; + case "es-AR": + return ES_AR; + case "id": + return ID; + case "cnr": + return CNR; + case "mn": + return MN; + case "fi": + return FI; + case "pl": + return PL; + case "en-CA": + return EN_CA; + case "ar-EG": + return AR_EG; + case "mr": + return MR; + case "ms": + return MS; + case "pt-PT": + return PT_PT; + case "sk": + return SK; + case "sl": + return SL; + case "cs": + return CS; + case "ur": + return UR; + case "hu": + return HU; + case "te": + return TE; + case "zh-CN": + return ZH_CN; + case "ar-SA": + return AR_SA; + case "so": + return SO; + case "fr": + return FR; + case "no": + return NO; + case "zh-TW": + return ZH_TW; + case "ar": + return AR; + case "pt": + return PT; + case "my": + return MY; + case "sq": + return SQ; + case "hy": + return HY; + case "fr-FR": + return FR_FR; + case "cy": + return CY; + case "pa": + return PA; + case "ka": + return KA; + case "is": + return IS; + case "fa": + return FA; + case "bn": + return BN; + case "pt-BR": + return PT_BR; + case "sw": + return SW; + case "hi": + return HI; + case "en": + return EN; + case "nb": + return NB; + case "da": + return DA; + case "lt": + return LT; + case "bs": + return BS; + case "es-MX": + return ES_MX; + case "lv": + return LV; + case "ro": + return RO; + case "uk": + return UK; + case "de": + return DE; + case "es": + return ES; + case "kk": + return KK; + case "et": + return ET; + case "ta": + return TA; + case "hr": + return HR; + case "kn": + return KN; + case "zgh": + return ZGH; + case "am": + return AM; + case "ja": + return JA; + case "ko": + return KO; + case "ru": + return RU; + case "nl": + return NL; + case "vi": + return VI; + case "bg": + return BG; + case "nn": + return NN; + case "gl-ES": + return GL_ES; + case "th": + return TH; + case "sr": + return SR; + case "es-419": + return ES419; + case "he": + return HE; + case "zh-HK": + return ZH_HK; + case "eu-ES": + return EU_ES; + case "tl": + return TL; + case "it": + return IT; + case "sv": + return SV; + case "fr-CA": + return FR_CA; + case "el": + return EL; + default: + return new SupportedLocales(Value.UNKNOWN, value); + } + } + + public enum Value { + AM, + + AR, + + AR_EG, + + AR_SA, + + AZ, + + BG, + + BN, + + BS, + + CA_ES, + + CNR, + + CS, + + CY, + + DA, + + DE, + + EL, + + EN, + + EN_CA, + + ES, + + ES419, + + ES_AR, + + ES_MX, + + ET, + + EU_ES, + + FA, + + FI, + + FR, + + FR_CA, + + FR_FR, + + GL_ES, + + GU, + + HE, + + HI, + + HR, + + HU, + + HY, + + ID, + + IS, + + IT, + + JA, + + KA, + + KK, + + KN, + + KO, + + LT, + + LV, + + MK, + + ML, + + MN, + + MR, + + MS, + + MY, + + NB, + + NL, + + NN, + + NO, + + PA, + + PL, + + PT, + + PT_BR, + + PT_PT, + + RO, + + RU, + + SK, + + SL, + + SO, + + SQ, + + SR, + + SV, + + SW, + + TA, + + TE, + + TH, + + TL, + + TR, + + UK, + + UR, + + VI, + + ZGH, + + ZH_CN, + + ZH_HK, + + ZH_TW, + + UNKNOWN + } + + public interface Visitor { + T visitAm(); + + T visitAr(); + + T visitArEg(); + + T visitArSa(); + + T visitAz(); + + T visitBg(); + + T visitBn(); + + T visitBs(); + + T visitCaEs(); + + T visitCnr(); + + T visitCs(); + + T visitCy(); + + T visitDa(); + + T visitDe(); + + T visitEl(); + + T visitEn(); + + T visitEnCa(); + + T visitEs(); + + T visitEs419(); + + T visitEsAr(); + + T visitEsMx(); + + T visitEt(); + + T visitEuEs(); + + T visitFa(); + + T visitFi(); + + T visitFr(); + + T visitFrCa(); + + T visitFrFr(); + + T visitGlEs(); + + T visitGu(); + + T visitHe(); + + T visitHi(); + + T visitHr(); + + T visitHu(); + + T visitHy(); + + T visitId(); + + T visitIs(); + + T visitIt(); + + T visitJa(); + + T visitKa(); + + T visitKk(); + + T visitKn(); + + T visitKo(); + + T visitLt(); + + T visitLv(); + + T visitMk(); + + T visitMl(); + + T visitMn(); + + T visitMr(); + + T visitMs(); + + T visitMy(); + + T visitNb(); + + T visitNl(); + + T visitNn(); + + T visitNo(); + + T visitPa(); + + T visitPl(); + + T visitPt(); + + T visitPtBr(); + + T visitPtPt(); + + T visitRo(); + + T visitRu(); + + T visitSk(); + + T visitSl(); + + T visitSo(); + + T visitSq(); + + T visitSr(); + + T visitSv(); + + T visitSw(); + + T visitTa(); + + T visitTe(); + + T visitTh(); + + T visitTl(); + + T visitTr(); + + T visitUk(); + + T visitUr(); + + T visitVi(); + + T visitZgh(); + + T visitZhCn(); + + T visitZhHk(); + + T visitZhTw(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java new file mode 100644 index 000000000..bdadd4d67 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SuspiciousIpThrottlingPreLoginStage.Builder.class) +public final class SuspiciousIpThrottlingPreLoginStage { + private final Optional maxAttempts; + + private final Optional rate; + + private final Map additionalProperties; + + private SuspiciousIpThrottlingPreLoginStage( + Optional maxAttempts, Optional rate, Map additionalProperties) { + this.maxAttempts = maxAttempts; + this.rate = rate; + this.additionalProperties = additionalProperties; + } + + /** + * @return Total number of attempts allowed per day. + */ + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + /** + * @return Interval of time, given in milliseconds, at which new attempts are granted. + */ + @JsonProperty("rate") + public Optional getRate() { + return rate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SuspiciousIpThrottlingPreLoginStage + && equalTo((SuspiciousIpThrottlingPreLoginStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SuspiciousIpThrottlingPreLoginStage other) { + return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.maxAttempts, this.rate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional maxAttempts = Optional.empty(); + + private Optional rate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SuspiciousIpThrottlingPreLoginStage other) { + maxAttempts(other.getMaxAttempts()); + rate(other.getRate()); + return this; + } + + /** + *

Total number of attempts allowed per day.

+ */ + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public Builder maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + public Builder maxAttempts(Integer maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + /** + *

Interval of time, given in milliseconds, at which new attempts are granted.

+ */ + @JsonSetter(value = "rate", nulls = Nulls.SKIP) + public Builder rate(Optional rate) { + this.rate = rate; + return this; + } + + public Builder rate(Integer rate) { + this.rate = Optional.ofNullable(rate); + return this; + } + + public SuspiciousIpThrottlingPreLoginStage build() { + return new SuspiciousIpThrottlingPreLoginStage(maxAttempts, rate, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java new file mode 100644 index 000000000..255f2881b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SuspiciousIpThrottlingPreUserRegistrationStage.Builder.class) +public final class SuspiciousIpThrottlingPreUserRegistrationStage { + private final Optional maxAttempts; + + private final Optional rate; + + private final Map additionalProperties; + + private SuspiciousIpThrottlingPreUserRegistrationStage( + Optional maxAttempts, Optional rate, Map additionalProperties) { + this.maxAttempts = maxAttempts; + this.rate = rate; + this.additionalProperties = additionalProperties; + } + + /** + * @return Total number of attempts allowed. + */ + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + /** + * @return Interval of time, given in milliseconds, at which new attempts are granted. + */ + @JsonProperty("rate") + public Optional getRate() { + return rate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SuspiciousIpThrottlingPreUserRegistrationStage + && equalTo((SuspiciousIpThrottlingPreUserRegistrationStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SuspiciousIpThrottlingPreUserRegistrationStage other) { + return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.maxAttempts, this.rate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional maxAttempts = Optional.empty(); + + private Optional rate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SuspiciousIpThrottlingPreUserRegistrationStage other) { + maxAttempts(other.getMaxAttempts()); + rate(other.getRate()); + return this; + } + + /** + *

Total number of attempts allowed.

+ */ + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public Builder maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + public Builder maxAttempts(Integer maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + /** + *

Interval of time, given in milliseconds, at which new attempts are granted.

+ */ + @JsonSetter(value = "rate", nulls = Nulls.SKIP) + public Builder rate(Optional rate) { + this.rate = rate; + return this; + } + + public Builder rate(Integer rate) { + this.rate = Optional.ofNullable(rate); + return this; + } + + public SuspiciousIpThrottlingPreUserRegistrationStage build() { + return new SuspiciousIpThrottlingPreUserRegistrationStage(maxAttempts, rate, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java new file mode 100644 index 000000000..00f6b5ade --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SuspiciousIpThrottlingShieldsEnum { + public static final SuspiciousIpThrottlingShieldsEnum BLOCK = + new SuspiciousIpThrottlingShieldsEnum(Value.BLOCK, "block"); + + public static final SuspiciousIpThrottlingShieldsEnum ADMIN_NOTIFICATION = + new SuspiciousIpThrottlingShieldsEnum(Value.ADMIN_NOTIFICATION, "admin_notification"); + + private final Value value; + + private final String string; + + SuspiciousIpThrottlingShieldsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SuspiciousIpThrottlingShieldsEnum + && this.string.equals(((SuspiciousIpThrottlingShieldsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case ADMIN_NOTIFICATION: + return visitor.visitAdminNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SuspiciousIpThrottlingShieldsEnum valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "admin_notification": + return ADMIN_NOTIFICATION; + default: + return new SuspiciousIpThrottlingShieldsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + ADMIN_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitAdminNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java new file mode 100644 index 000000000..9aeba1e60 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SuspiciousIpThrottlingStage.Builder.class) +public final class SuspiciousIpThrottlingStage { + private final Optional preLogin; + + private final Optional preUserRegistration; + + private final Map additionalProperties; + + private SuspiciousIpThrottlingStage( + Optional preLogin, + Optional preUserRegistration, + Map additionalProperties) { + this.preLogin = preLogin; + this.preUserRegistration = preUserRegistration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pre-login") + public Optional getPreLogin() { + return preLogin; + } + + @JsonProperty("pre-user-registration") + public Optional getPreUserRegistration() { + return preUserRegistration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SuspiciousIpThrottlingStage && equalTo((SuspiciousIpThrottlingStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SuspiciousIpThrottlingStage other) { + return preLogin.equals(other.preLogin) && preUserRegistration.equals(other.preUserRegistration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.preLogin, this.preUserRegistration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional preLogin = Optional.empty(); + + private Optional preUserRegistration = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SuspiciousIpThrottlingStage other) { + preLogin(other.getPreLogin()); + preUserRegistration(other.getPreUserRegistration()); + return this; + } + + @JsonSetter(value = "pre-login", nulls = Nulls.SKIP) + public Builder preLogin(Optional preLogin) { + this.preLogin = preLogin; + return this; + } + + public Builder preLogin(SuspiciousIpThrottlingPreLoginStage preLogin) { + this.preLogin = Optional.ofNullable(preLogin); + return this; + } + + @JsonSetter(value = "pre-user-registration", nulls = Nulls.SKIP) + public Builder preUserRegistration( + Optional preUserRegistration) { + this.preUserRegistration = preUserRegistration; + return this; + } + + public Builder preUserRegistration(SuspiciousIpThrottlingPreUserRegistrationStage preUserRegistration) { + this.preUserRegistration = Optional.ofNullable(preUserRegistration); + return this; + } + + public SuspiciousIpThrottlingStage build() { + return new SuspiciousIpThrottlingStage(preLogin, preUserRegistration, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java new file mode 100644 index 000000000..5439ecd61 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantOidcLogoutSettings.Builder.class) +public final class TenantOidcLogoutSettings { + private final Optional rpLogoutEndSessionEndpointDiscovery; + + private final Map additionalProperties; + + private TenantOidcLogoutSettings( + Optional rpLogoutEndSessionEndpointDiscovery, Map additionalProperties) { + this.rpLogoutEndSessionEndpointDiscovery = rpLogoutEndSessionEndpointDiscovery; + this.additionalProperties = additionalProperties; + } + + /** + * @return Enable the end_session_endpoint URL in the .well-known discovery configuration + */ + @JsonProperty("rp_logout_end_session_endpoint_discovery") + public Optional getRpLogoutEndSessionEndpointDiscovery() { + return rpLogoutEndSessionEndpointDiscovery; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantOidcLogoutSettings && equalTo((TenantOidcLogoutSettings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantOidcLogoutSettings other) { + return rpLogoutEndSessionEndpointDiscovery.equals(other.rpLogoutEndSessionEndpointDiscovery); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.rpLogoutEndSessionEndpointDiscovery); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional rpLogoutEndSessionEndpointDiscovery = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantOidcLogoutSettings other) { + rpLogoutEndSessionEndpointDiscovery(other.getRpLogoutEndSessionEndpointDiscovery()); + return this; + } + + /** + *

Enable the end_session_endpoint URL in the .well-known discovery configuration

+ */ + @JsonSetter(value = "rp_logout_end_session_endpoint_discovery", nulls = Nulls.SKIP) + public Builder rpLogoutEndSessionEndpointDiscovery(Optional rpLogoutEndSessionEndpointDiscovery) { + this.rpLogoutEndSessionEndpointDiscovery = rpLogoutEndSessionEndpointDiscovery; + return this; + } + + public Builder rpLogoutEndSessionEndpointDiscovery(Boolean rpLogoutEndSessionEndpointDiscovery) { + this.rpLogoutEndSessionEndpointDiscovery = Optional.ofNullable(rpLogoutEndSessionEndpointDiscovery); + return this; + } + + public TenantOidcLogoutSettings build() { + return new TenantOidcLogoutSettings(rpLogoutEndSessionEndpointDiscovery, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java new file mode 100644 index 000000000..2aaf54480 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsDeviceFlow.Builder.class) +public final class TenantSettingsDeviceFlow { + private final Optional charset; + + private final Optional mask; + + private final Map additionalProperties; + + private TenantSettingsDeviceFlow( + Optional charset, + Optional mask, + Map additionalProperties) { + this.charset = charset; + this.mask = mask; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("charset") + public Optional getCharset() { + return charset; + } + + /** + * @return Mask used to format a generated User Code into a friendly, readable format. + */ + @JsonProperty("mask") + public Optional getMask() { + return mask; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsDeviceFlow && equalTo((TenantSettingsDeviceFlow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsDeviceFlow other) { + return charset.equals(other.charset) && mask.equals(other.mask); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.charset, this.mask); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional charset = Optional.empty(); + + private Optional mask = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsDeviceFlow other) { + charset(other.getCharset()); + mask(other.getMask()); + return this; + } + + @JsonSetter(value = "charset", nulls = Nulls.SKIP) + public Builder charset(Optional charset) { + this.charset = charset; + return this; + } + + public Builder charset(TenantSettingsDeviceFlowCharset charset) { + this.charset = Optional.ofNullable(charset); + return this; + } + + /** + *

Mask used to format a generated User Code into a friendly, readable format.

+ */ + @JsonSetter(value = "mask", nulls = Nulls.SKIP) + public Builder mask(Optional mask) { + this.mask = mask; + return this; + } + + public Builder mask(String mask) { + this.mask = Optional.ofNullable(mask); + return this; + } + + public TenantSettingsDeviceFlow build() { + return new TenantSettingsDeviceFlow(charset, mask, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java new file mode 100644 index 000000000..deafec3a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TenantSettingsDeviceFlowCharset { + public static final TenantSettingsDeviceFlowCharset DIGITS = + new TenantSettingsDeviceFlowCharset(Value.DIGITS, "digits"); + + public static final TenantSettingsDeviceFlowCharset BASE20 = + new TenantSettingsDeviceFlowCharset(Value.BASE20, "base20"); + + private final Value value; + + private final String string; + + TenantSettingsDeviceFlowCharset(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TenantSettingsDeviceFlowCharset + && this.string.equals(((TenantSettingsDeviceFlowCharset) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DIGITS: + return visitor.visitDigits(); + case BASE20: + return visitor.visitBase20(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TenantSettingsDeviceFlowCharset valueOf(String value) { + switch (value) { + case "digits": + return DIGITS; + case "base20": + return BASE20; + default: + return new TenantSettingsDeviceFlowCharset(Value.UNKNOWN, value); + } + } + + public enum Value { + BASE20, + + DIGITS, + + UNKNOWN + } + + public interface Visitor { + T visitBase20(); + + T visitDigits(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java new file mode 100644 index 000000000..906837dc1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsErrorPage.Builder.class) +public final class TenantSettingsErrorPage { + private final Optional html; + + private final Optional showLogLink; + + private final Optional url; + + private final Map additionalProperties; + + private TenantSettingsErrorPage( + Optional html, + Optional showLogLink, + Optional url, + Map additionalProperties) { + this.html = html; + this.showLogLink = showLogLink; + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return Custom Error HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> is supported). + */ + @JsonProperty("html") + public Optional getHtml() { + return html; + } + + /** + * @return Whether to show the link to log as part of the default error page (true, default) or not to show the link (false). + */ + @JsonProperty("show_log_link") + public Optional getShowLogLink() { + return showLogLink; + } + + /** + * @return URL to redirect to when an error occurs instead of showing the default error page. + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsErrorPage && equalTo((TenantSettingsErrorPage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsErrorPage other) { + return html.equals(other.html) && showLogLink.equals(other.showLogLink) && url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.html, this.showLogLink, this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional html = Optional.empty(); + + private Optional showLogLink = Optional.empty(); + + private Optional url = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsErrorPage other) { + html(other.getHtml()); + showLogLink(other.getShowLogLink()); + url(other.getUrl()); + return this; + } + + /** + *

Custom Error HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> is supported).

+ */ + @JsonSetter(value = "html", nulls = Nulls.SKIP) + public Builder html(Optional html) { + this.html = html; + return this; + } + + public Builder html(String html) { + this.html = Optional.ofNullable(html); + return this; + } + + /** + *

Whether to show the link to log as part of the default error page (true, default) or not to show the link (false).

+ */ + @JsonSetter(value = "show_log_link", nulls = Nulls.SKIP) + public Builder showLogLink(Optional showLogLink) { + this.showLogLink = showLogLink; + return this; + } + + public Builder showLogLink(Boolean showLogLink) { + this.showLogLink = Optional.ofNullable(showLogLink); + return this; + } + + /** + *

URL to redirect to when an error occurs instead of showing the default error page.

+ */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + public TenantSettingsErrorPage build() { + return new TenantSettingsErrorPage(html, showLogLink, url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java new file mode 100644 index 000000000..29fb8040c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java @@ -0,0 +1,1010 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsFlags.Builder.class) +public final class TenantSettingsFlags { + private final Optional changePwdFlowV1; + + private final Optional enableApisSection; + + private final Optional disableImpersonation; + + private final Optional enableClientConnections; + + private final Optional enablePipeline2; + + private final Optional allowLegacyDelegationGrantTypes; + + private final Optional allowLegacyRoGrantTypes; + + private final Optional allowLegacyTokeninfoEndpoint; + + private final Optional enableLegacyProfile; + + private final Optional enableIdtokenApi2; + + private final Optional enablePublicSignupUserExistsError; + + private final Optional enableSso; + + private final Optional allowChangingEnableSso; + + private final Optional disableClickjackProtectionHeaders; + + private final Optional noDiscloseEnterpriseConnections; + + private final Optional enforceClientAuthenticationOnPasswordlessStart; + + private final Optional enableAdfsWaadEmailVerification; + + private final Optional revokeRefreshTokenGrant; + + private final Optional dashboardLogStreamsNext; + + private final Optional dashboardInsightsView; + + private final Optional disableFieldsMapFix; + + private final Optional mfaShowFactorListOnEnrollment; + + private final Optional removeAlgFromJwks; + + private final Optional improvedSignupBotDetectionInClassic; + + private final Optional genaiTrial; + + private final Optional enableDynamicClientRegistration; + + private final Optional disableManagementApiSmsObfuscation; + + private final Optional trustAzureAdfsEmailVerifiedConnectionProperty; + + private final Optional customDomainsProvisioning; + + private final Map additionalProperties; + + private TenantSettingsFlags( + Optional changePwdFlowV1, + Optional enableApisSection, + Optional disableImpersonation, + Optional enableClientConnections, + Optional enablePipeline2, + Optional allowLegacyDelegationGrantTypes, + Optional allowLegacyRoGrantTypes, + Optional allowLegacyTokeninfoEndpoint, + Optional enableLegacyProfile, + Optional enableIdtokenApi2, + Optional enablePublicSignupUserExistsError, + Optional enableSso, + Optional allowChangingEnableSso, + Optional disableClickjackProtectionHeaders, + Optional noDiscloseEnterpriseConnections, + Optional enforceClientAuthenticationOnPasswordlessStart, + Optional enableAdfsWaadEmailVerification, + Optional revokeRefreshTokenGrant, + Optional dashboardLogStreamsNext, + Optional dashboardInsightsView, + Optional disableFieldsMapFix, + Optional mfaShowFactorListOnEnrollment, + Optional removeAlgFromJwks, + Optional improvedSignupBotDetectionInClassic, + Optional genaiTrial, + Optional enableDynamicClientRegistration, + Optional disableManagementApiSmsObfuscation, + Optional trustAzureAdfsEmailVerifiedConnectionProperty, + Optional customDomainsProvisioning, + Map additionalProperties) { + this.changePwdFlowV1 = changePwdFlowV1; + this.enableApisSection = enableApisSection; + this.disableImpersonation = disableImpersonation; + this.enableClientConnections = enableClientConnections; + this.enablePipeline2 = enablePipeline2; + this.allowLegacyDelegationGrantTypes = allowLegacyDelegationGrantTypes; + this.allowLegacyRoGrantTypes = allowLegacyRoGrantTypes; + this.allowLegacyTokeninfoEndpoint = allowLegacyTokeninfoEndpoint; + this.enableLegacyProfile = enableLegacyProfile; + this.enableIdtokenApi2 = enableIdtokenApi2; + this.enablePublicSignupUserExistsError = enablePublicSignupUserExistsError; + this.enableSso = enableSso; + this.allowChangingEnableSso = allowChangingEnableSso; + this.disableClickjackProtectionHeaders = disableClickjackProtectionHeaders; + this.noDiscloseEnterpriseConnections = noDiscloseEnterpriseConnections; + this.enforceClientAuthenticationOnPasswordlessStart = enforceClientAuthenticationOnPasswordlessStart; + this.enableAdfsWaadEmailVerification = enableAdfsWaadEmailVerification; + this.revokeRefreshTokenGrant = revokeRefreshTokenGrant; + this.dashboardLogStreamsNext = dashboardLogStreamsNext; + this.dashboardInsightsView = dashboardInsightsView; + this.disableFieldsMapFix = disableFieldsMapFix; + this.mfaShowFactorListOnEnrollment = mfaShowFactorListOnEnrollment; + this.removeAlgFromJwks = removeAlgFromJwks; + this.improvedSignupBotDetectionInClassic = improvedSignupBotDetectionInClassic; + this.genaiTrial = genaiTrial; + this.enableDynamicClientRegistration = enableDynamicClientRegistration; + this.disableManagementApiSmsObfuscation = disableManagementApiSmsObfuscation; + this.trustAzureAdfsEmailVerifiedConnectionProperty = trustAzureAdfsEmailVerifiedConnectionProperty; + this.customDomainsProvisioning = customDomainsProvisioning; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to use the older v1 change password flow (true, not recommended except for backward compatibility) or the newer safer flow (false, recommended). + */ + @JsonProperty("change_pwd_flow_v1") + public Optional getChangePwdFlowV1() { + return changePwdFlowV1; + } + + /** + * @return Whether the APIs section is enabled (true) or disabled (false). + */ + @JsonProperty("enable_apis_section") + public Optional getEnableApisSection() { + return enableApisSection; + } + + /** + * @return Whether the impersonation functionality has been disabled (true) or not (false). Read-only. + */ + @JsonProperty("disable_impersonation") + public Optional getDisableImpersonation() { + return disableImpersonation; + } + + /** + * @return Whether all current connections should be enabled when a new client (application) is created (true, default) or not (false). + */ + @JsonProperty("enable_client_connections") + public Optional getEnableClientConnections() { + return enableClientConnections; + } + + /** + * @return Whether advanced API Authorization scenarios are enabled (true) or disabled (false). + */ + @JsonProperty("enable_pipeline2") + public Optional getEnablePipeline2() { + return enablePipeline2; + } + + /** + * @return If enabled, clients are able to add legacy delegation grants. + */ + @JsonProperty("allow_legacy_delegation_grant_types") + public Optional getAllowLegacyDelegationGrantTypes() { + return allowLegacyDelegationGrantTypes; + } + + /** + * @return If enabled, clients are able to add legacy RO grants. + */ + @JsonProperty("allow_legacy_ro_grant_types") + public Optional getAllowLegacyRoGrantTypes() { + return allowLegacyRoGrantTypes; + } + + /** + * @return Whether the legacy /tokeninfo endpoint is enabled for your account (true) or unavailable (false). + */ + @JsonProperty("allow_legacy_tokeninfo_endpoint") + public Optional getAllowLegacyTokeninfoEndpoint() { + return allowLegacyTokeninfoEndpoint; + } + + /** + * @return Whether ID tokens and the userinfo endpoint includes a complete user profile (true) or only OpenID Connect claims (false). + */ + @JsonProperty("enable_legacy_profile") + public Optional getEnableLegacyProfile() { + return enableLegacyProfile; + } + + /** + * @return Whether ID tokens can be used to authorize some types of requests to API v2 (true) not not (false). + */ + @JsonProperty("enable_idtoken_api2") + public Optional getEnableIdtokenApi2() { + return enableIdtokenApi2; + } + + /** + * @return Whether the public sign up process shows a user_exists error (true) or a generic error (false) if the user already exists. + */ + @JsonProperty("enable_public_signup_user_exists_error") + public Optional getEnablePublicSignupUserExistsError() { + return enablePublicSignupUserExistsError; + } + + /** + * @return Whether users are prompted to confirm log in before SSO redirection (false) or are not prompted (true). + */ + @JsonProperty("enable_sso") + public Optional getEnableSso() { + return enableSso; + } + + /** + * @return Whether the enable_sso setting can be changed (true) or not (false). + */ + @JsonProperty("allow_changing_enable_sso") + public Optional getAllowChangingEnableSso() { + return allowChangingEnableSso; + } + + /** + * @return Whether classic Universal Login prompts include additional security headers to prevent clickjacking (true) or no safeguard (false). + */ + @JsonProperty("disable_clickjack_protection_headers") + public Optional getDisableClickjackProtectionHeaders() { + return disableClickjackProtectionHeaders; + } + + /** + * @return Do not Publish Enterprise Connections Information with IdP domains on the lock configuration file. + */ + @JsonProperty("no_disclose_enterprise_connections") + public Optional getNoDiscloseEnterpriseConnections() { + return noDiscloseEnterpriseConnections; + } + + /** + * @return Enforce client authentication for passwordless start. + */ + @JsonProperty("enforce_client_authentication_on_passwordless_start") + public Optional getEnforceClientAuthenticationOnPasswordlessStart() { + return enforceClientAuthenticationOnPasswordlessStart; + } + + /** + * @return Enables the email verification flow during login for Azure AD and ADFS connections + */ + @JsonProperty("enable_adfs_waad_email_verification") + public Optional getEnableAdfsWaadEmailVerification() { + return enableAdfsWaadEmailVerification; + } + + /** + * @return Delete underlying grant when a Refresh Token is revoked via the Authentication API. + */ + @JsonProperty("revoke_refresh_token_grant") + public Optional getRevokeRefreshTokenGrant() { + return revokeRefreshTokenGrant; + } + + /** + * @return Enables beta access to log streaming changes + */ + @JsonProperty("dashboard_log_streams_next") + public Optional getDashboardLogStreamsNext() { + return dashboardLogStreamsNext; + } + + /** + * @return Enables new insights activity page view + */ + @JsonProperty("dashboard_insights_view") + public Optional getDashboardInsightsView() { + return dashboardInsightsView; + } + + /** + * @return Disables SAML fields map fix for bad mappings with repeated attributes + */ + @JsonProperty("disable_fields_map_fix") + public Optional getDisableFieldsMapFix() { + return disableFieldsMapFix; + } + + /** + * @return Used to allow users to pick what factor to enroll of the available MFA factors. + */ + @JsonProperty("mfa_show_factor_list_on_enrollment") + public Optional getMfaShowFactorListOnEnrollment() { + return mfaShowFactorListOnEnrollment; + } + + /** + * @return Removes alg property from jwks .well-known endpoint + */ + @JsonProperty("remove_alg_from_jwks") + public Optional getRemoveAlgFromJwks() { + return removeAlgFromJwks; + } + + /** + * @return Improves bot detection during signup in classic universal login + */ + @JsonProperty("improved_signup_bot_detection_in_classic") + public Optional getImprovedSignupBotDetectionInClassic() { + return improvedSignupBotDetectionInClassic; + } + + /** + * @return This tenant signed up for the Auth4GenAI trail + */ + @JsonProperty("genai_trial") + public Optional getGenaiTrial() { + return genaiTrial; + } + + /** + * @return Whether third-party developers can <a href="https://auth0.com/docs/api-auth/dynamic-client-registration">dynamically register</a> applications for your APIs (true) or not (false). This flag enables dynamic client registration. + */ + @JsonProperty("enable_dynamic_client_registration") + public Optional getEnableDynamicClientRegistration() { + return enableDynamicClientRegistration; + } + + /** + * @return If true, SMS phone numbers will not be obfuscated in Management API GET calls. + */ + @JsonProperty("disable_management_api_sms_obfuscation") + public Optional getDisableManagementApiSmsObfuscation() { + return disableManagementApiSmsObfuscation; + } + + /** + * @return Changes email_verified behavior for Azure AD/ADFS connections when enabled. Sets email_verified to false otherwise. + */ + @JsonProperty("trust_azure_adfs_email_verified_connection_property") + public Optional getTrustAzureAdfsEmailVerifiedConnectionProperty() { + return trustAzureAdfsEmailVerifiedConnectionProperty; + } + + /** + * @return If true, custom domains feature will be enabled for tenant. + */ + @JsonProperty("custom_domains_provisioning") + public Optional getCustomDomainsProvisioning() { + return customDomainsProvisioning; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsFlags && equalTo((TenantSettingsFlags) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsFlags other) { + return changePwdFlowV1.equals(other.changePwdFlowV1) + && enableApisSection.equals(other.enableApisSection) + && disableImpersonation.equals(other.disableImpersonation) + && enableClientConnections.equals(other.enableClientConnections) + && enablePipeline2.equals(other.enablePipeline2) + && allowLegacyDelegationGrantTypes.equals(other.allowLegacyDelegationGrantTypes) + && allowLegacyRoGrantTypes.equals(other.allowLegacyRoGrantTypes) + && allowLegacyTokeninfoEndpoint.equals(other.allowLegacyTokeninfoEndpoint) + && enableLegacyProfile.equals(other.enableLegacyProfile) + && enableIdtokenApi2.equals(other.enableIdtokenApi2) + && enablePublicSignupUserExistsError.equals(other.enablePublicSignupUserExistsError) + && enableSso.equals(other.enableSso) + && allowChangingEnableSso.equals(other.allowChangingEnableSso) + && disableClickjackProtectionHeaders.equals(other.disableClickjackProtectionHeaders) + && noDiscloseEnterpriseConnections.equals(other.noDiscloseEnterpriseConnections) + && enforceClientAuthenticationOnPasswordlessStart.equals( + other.enforceClientAuthenticationOnPasswordlessStart) + && enableAdfsWaadEmailVerification.equals(other.enableAdfsWaadEmailVerification) + && revokeRefreshTokenGrant.equals(other.revokeRefreshTokenGrant) + && dashboardLogStreamsNext.equals(other.dashboardLogStreamsNext) + && dashboardInsightsView.equals(other.dashboardInsightsView) + && disableFieldsMapFix.equals(other.disableFieldsMapFix) + && mfaShowFactorListOnEnrollment.equals(other.mfaShowFactorListOnEnrollment) + && removeAlgFromJwks.equals(other.removeAlgFromJwks) + && improvedSignupBotDetectionInClassic.equals(other.improvedSignupBotDetectionInClassic) + && genaiTrial.equals(other.genaiTrial) + && enableDynamicClientRegistration.equals(other.enableDynamicClientRegistration) + && disableManagementApiSmsObfuscation.equals(other.disableManagementApiSmsObfuscation) + && trustAzureAdfsEmailVerifiedConnectionProperty.equals( + other.trustAzureAdfsEmailVerifiedConnectionProperty) + && customDomainsProvisioning.equals(other.customDomainsProvisioning); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.changePwdFlowV1, + this.enableApisSection, + this.disableImpersonation, + this.enableClientConnections, + this.enablePipeline2, + this.allowLegacyDelegationGrantTypes, + this.allowLegacyRoGrantTypes, + this.allowLegacyTokeninfoEndpoint, + this.enableLegacyProfile, + this.enableIdtokenApi2, + this.enablePublicSignupUserExistsError, + this.enableSso, + this.allowChangingEnableSso, + this.disableClickjackProtectionHeaders, + this.noDiscloseEnterpriseConnections, + this.enforceClientAuthenticationOnPasswordlessStart, + this.enableAdfsWaadEmailVerification, + this.revokeRefreshTokenGrant, + this.dashboardLogStreamsNext, + this.dashboardInsightsView, + this.disableFieldsMapFix, + this.mfaShowFactorListOnEnrollment, + this.removeAlgFromJwks, + this.improvedSignupBotDetectionInClassic, + this.genaiTrial, + this.enableDynamicClientRegistration, + this.disableManagementApiSmsObfuscation, + this.trustAzureAdfsEmailVerifiedConnectionProperty, + this.customDomainsProvisioning); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional changePwdFlowV1 = Optional.empty(); + + private Optional enableApisSection = Optional.empty(); + + private Optional disableImpersonation = Optional.empty(); + + private Optional enableClientConnections = Optional.empty(); + + private Optional enablePipeline2 = Optional.empty(); + + private Optional allowLegacyDelegationGrantTypes = Optional.empty(); + + private Optional allowLegacyRoGrantTypes = Optional.empty(); + + private Optional allowLegacyTokeninfoEndpoint = Optional.empty(); + + private Optional enableLegacyProfile = Optional.empty(); + + private Optional enableIdtokenApi2 = Optional.empty(); + + private Optional enablePublicSignupUserExistsError = Optional.empty(); + + private Optional enableSso = Optional.empty(); + + private Optional allowChangingEnableSso = Optional.empty(); + + private Optional disableClickjackProtectionHeaders = Optional.empty(); + + private Optional noDiscloseEnterpriseConnections = Optional.empty(); + + private Optional enforceClientAuthenticationOnPasswordlessStart = Optional.empty(); + + private Optional enableAdfsWaadEmailVerification = Optional.empty(); + + private Optional revokeRefreshTokenGrant = Optional.empty(); + + private Optional dashboardLogStreamsNext = Optional.empty(); + + private Optional dashboardInsightsView = Optional.empty(); + + private Optional disableFieldsMapFix = Optional.empty(); + + private Optional mfaShowFactorListOnEnrollment = Optional.empty(); + + private Optional removeAlgFromJwks = Optional.empty(); + + private Optional improvedSignupBotDetectionInClassic = Optional.empty(); + + private Optional genaiTrial = Optional.empty(); + + private Optional enableDynamicClientRegistration = Optional.empty(); + + private Optional disableManagementApiSmsObfuscation = Optional.empty(); + + private Optional trustAzureAdfsEmailVerifiedConnectionProperty = Optional.empty(); + + private Optional customDomainsProvisioning = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsFlags other) { + changePwdFlowV1(other.getChangePwdFlowV1()); + enableApisSection(other.getEnableApisSection()); + disableImpersonation(other.getDisableImpersonation()); + enableClientConnections(other.getEnableClientConnections()); + enablePipeline2(other.getEnablePipeline2()); + allowLegacyDelegationGrantTypes(other.getAllowLegacyDelegationGrantTypes()); + allowLegacyRoGrantTypes(other.getAllowLegacyRoGrantTypes()); + allowLegacyTokeninfoEndpoint(other.getAllowLegacyTokeninfoEndpoint()); + enableLegacyProfile(other.getEnableLegacyProfile()); + enableIdtokenApi2(other.getEnableIdtokenApi2()); + enablePublicSignupUserExistsError(other.getEnablePublicSignupUserExistsError()); + enableSso(other.getEnableSso()); + allowChangingEnableSso(other.getAllowChangingEnableSso()); + disableClickjackProtectionHeaders(other.getDisableClickjackProtectionHeaders()); + noDiscloseEnterpriseConnections(other.getNoDiscloseEnterpriseConnections()); + enforceClientAuthenticationOnPasswordlessStart(other.getEnforceClientAuthenticationOnPasswordlessStart()); + enableAdfsWaadEmailVerification(other.getEnableAdfsWaadEmailVerification()); + revokeRefreshTokenGrant(other.getRevokeRefreshTokenGrant()); + dashboardLogStreamsNext(other.getDashboardLogStreamsNext()); + dashboardInsightsView(other.getDashboardInsightsView()); + disableFieldsMapFix(other.getDisableFieldsMapFix()); + mfaShowFactorListOnEnrollment(other.getMfaShowFactorListOnEnrollment()); + removeAlgFromJwks(other.getRemoveAlgFromJwks()); + improvedSignupBotDetectionInClassic(other.getImprovedSignupBotDetectionInClassic()); + genaiTrial(other.getGenaiTrial()); + enableDynamicClientRegistration(other.getEnableDynamicClientRegistration()); + disableManagementApiSmsObfuscation(other.getDisableManagementApiSmsObfuscation()); + trustAzureAdfsEmailVerifiedConnectionProperty(other.getTrustAzureAdfsEmailVerifiedConnectionProperty()); + customDomainsProvisioning(other.getCustomDomainsProvisioning()); + return this; + } + + /** + *

Whether to use the older v1 change password flow (true, not recommended except for backward compatibility) or the newer safer flow (false, recommended).

+ */ + @JsonSetter(value = "change_pwd_flow_v1", nulls = Nulls.SKIP) + public Builder changePwdFlowV1(Optional changePwdFlowV1) { + this.changePwdFlowV1 = changePwdFlowV1; + return this; + } + + public Builder changePwdFlowV1(Boolean changePwdFlowV1) { + this.changePwdFlowV1 = Optional.ofNullable(changePwdFlowV1); + return this; + } + + /** + *

Whether the APIs section is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enable_apis_section", nulls = Nulls.SKIP) + public Builder enableApisSection(Optional enableApisSection) { + this.enableApisSection = enableApisSection; + return this; + } + + public Builder enableApisSection(Boolean enableApisSection) { + this.enableApisSection = Optional.ofNullable(enableApisSection); + return this; + } + + /** + *

Whether the impersonation functionality has been disabled (true) or not (false). Read-only.

+ */ + @JsonSetter(value = "disable_impersonation", nulls = Nulls.SKIP) + public Builder disableImpersonation(Optional disableImpersonation) { + this.disableImpersonation = disableImpersonation; + return this; + } + + public Builder disableImpersonation(Boolean disableImpersonation) { + this.disableImpersonation = Optional.ofNullable(disableImpersonation); + return this; + } + + /** + *

Whether all current connections should be enabled when a new client (application) is created (true, default) or not (false).

+ */ + @JsonSetter(value = "enable_client_connections", nulls = Nulls.SKIP) + public Builder enableClientConnections(Optional enableClientConnections) { + this.enableClientConnections = enableClientConnections; + return this; + } + + public Builder enableClientConnections(Boolean enableClientConnections) { + this.enableClientConnections = Optional.ofNullable(enableClientConnections); + return this; + } + + /** + *

Whether advanced API Authorization scenarios are enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enable_pipeline2", nulls = Nulls.SKIP) + public Builder enablePipeline2(Optional enablePipeline2) { + this.enablePipeline2 = enablePipeline2; + return this; + } + + public Builder enablePipeline2(Boolean enablePipeline2) { + this.enablePipeline2 = Optional.ofNullable(enablePipeline2); + return this; + } + + /** + *

If enabled, clients are able to add legacy delegation grants.

+ */ + @JsonSetter(value = "allow_legacy_delegation_grant_types", nulls = Nulls.SKIP) + public Builder allowLegacyDelegationGrantTypes(Optional allowLegacyDelegationGrantTypes) { + this.allowLegacyDelegationGrantTypes = allowLegacyDelegationGrantTypes; + return this; + } + + public Builder allowLegacyDelegationGrantTypes(Boolean allowLegacyDelegationGrantTypes) { + this.allowLegacyDelegationGrantTypes = Optional.ofNullable(allowLegacyDelegationGrantTypes); + return this; + } + + /** + *

If enabled, clients are able to add legacy RO grants.

+ */ + @JsonSetter(value = "allow_legacy_ro_grant_types", nulls = Nulls.SKIP) + public Builder allowLegacyRoGrantTypes(Optional allowLegacyRoGrantTypes) { + this.allowLegacyRoGrantTypes = allowLegacyRoGrantTypes; + return this; + } + + public Builder allowLegacyRoGrantTypes(Boolean allowLegacyRoGrantTypes) { + this.allowLegacyRoGrantTypes = Optional.ofNullable(allowLegacyRoGrantTypes); + return this; + } + + /** + *

Whether the legacy /tokeninfo endpoint is enabled for your account (true) or unavailable (false).

+ */ + @JsonSetter(value = "allow_legacy_tokeninfo_endpoint", nulls = Nulls.SKIP) + public Builder allowLegacyTokeninfoEndpoint(Optional allowLegacyTokeninfoEndpoint) { + this.allowLegacyTokeninfoEndpoint = allowLegacyTokeninfoEndpoint; + return this; + } + + public Builder allowLegacyTokeninfoEndpoint(Boolean allowLegacyTokeninfoEndpoint) { + this.allowLegacyTokeninfoEndpoint = Optional.ofNullable(allowLegacyTokeninfoEndpoint); + return this; + } + + /** + *

Whether ID tokens and the userinfo endpoint includes a complete user profile (true) or only OpenID Connect claims (false).

+ */ + @JsonSetter(value = "enable_legacy_profile", nulls = Nulls.SKIP) + public Builder enableLegacyProfile(Optional enableLegacyProfile) { + this.enableLegacyProfile = enableLegacyProfile; + return this; + } + + public Builder enableLegacyProfile(Boolean enableLegacyProfile) { + this.enableLegacyProfile = Optional.ofNullable(enableLegacyProfile); + return this; + } + + /** + *

Whether ID tokens can be used to authorize some types of requests to API v2 (true) not not (false).

+ */ + @JsonSetter(value = "enable_idtoken_api2", nulls = Nulls.SKIP) + public Builder enableIdtokenApi2(Optional enableIdtokenApi2) { + this.enableIdtokenApi2 = enableIdtokenApi2; + return this; + } + + public Builder enableIdtokenApi2(Boolean enableIdtokenApi2) { + this.enableIdtokenApi2 = Optional.ofNullable(enableIdtokenApi2); + return this; + } + + /** + *

Whether the public sign up process shows a user_exists error (true) or a generic error (false) if the user already exists.

+ */ + @JsonSetter(value = "enable_public_signup_user_exists_error", nulls = Nulls.SKIP) + public Builder enablePublicSignupUserExistsError(Optional enablePublicSignupUserExistsError) { + this.enablePublicSignupUserExistsError = enablePublicSignupUserExistsError; + return this; + } + + public Builder enablePublicSignupUserExistsError(Boolean enablePublicSignupUserExistsError) { + this.enablePublicSignupUserExistsError = Optional.ofNullable(enablePublicSignupUserExistsError); + return this; + } + + /** + *

Whether users are prompted to confirm log in before SSO redirection (false) or are not prompted (true).

+ */ + @JsonSetter(value = "enable_sso", nulls = Nulls.SKIP) + public Builder enableSso(Optional enableSso) { + this.enableSso = enableSso; + return this; + } + + public Builder enableSso(Boolean enableSso) { + this.enableSso = Optional.ofNullable(enableSso); + return this; + } + + /** + *

Whether the enable_sso setting can be changed (true) or not (false).

+ */ + @JsonSetter(value = "allow_changing_enable_sso", nulls = Nulls.SKIP) + public Builder allowChangingEnableSso(Optional allowChangingEnableSso) { + this.allowChangingEnableSso = allowChangingEnableSso; + return this; + } + + public Builder allowChangingEnableSso(Boolean allowChangingEnableSso) { + this.allowChangingEnableSso = Optional.ofNullable(allowChangingEnableSso); + return this; + } + + /** + *

Whether classic Universal Login prompts include additional security headers to prevent clickjacking (true) or no safeguard (false).

+ */ + @JsonSetter(value = "disable_clickjack_protection_headers", nulls = Nulls.SKIP) + public Builder disableClickjackProtectionHeaders(Optional disableClickjackProtectionHeaders) { + this.disableClickjackProtectionHeaders = disableClickjackProtectionHeaders; + return this; + } + + public Builder disableClickjackProtectionHeaders(Boolean disableClickjackProtectionHeaders) { + this.disableClickjackProtectionHeaders = Optional.ofNullable(disableClickjackProtectionHeaders); + return this; + } + + /** + *

Do not Publish Enterprise Connections Information with IdP domains on the lock configuration file.

+ */ + @JsonSetter(value = "no_disclose_enterprise_connections", nulls = Nulls.SKIP) + public Builder noDiscloseEnterpriseConnections(Optional noDiscloseEnterpriseConnections) { + this.noDiscloseEnterpriseConnections = noDiscloseEnterpriseConnections; + return this; + } + + public Builder noDiscloseEnterpriseConnections(Boolean noDiscloseEnterpriseConnections) { + this.noDiscloseEnterpriseConnections = Optional.ofNullable(noDiscloseEnterpriseConnections); + return this; + } + + /** + *

Enforce client authentication for passwordless start.

+ */ + @JsonSetter(value = "enforce_client_authentication_on_passwordless_start", nulls = Nulls.SKIP) + public Builder enforceClientAuthenticationOnPasswordlessStart( + Optional enforceClientAuthenticationOnPasswordlessStart) { + this.enforceClientAuthenticationOnPasswordlessStart = enforceClientAuthenticationOnPasswordlessStart; + return this; + } + + public Builder enforceClientAuthenticationOnPasswordlessStart( + Boolean enforceClientAuthenticationOnPasswordlessStart) { + this.enforceClientAuthenticationOnPasswordlessStart = + Optional.ofNullable(enforceClientAuthenticationOnPasswordlessStart); + return this; + } + + /** + *

Enables the email verification flow during login for Azure AD and ADFS connections

+ */ + @JsonSetter(value = "enable_adfs_waad_email_verification", nulls = Nulls.SKIP) + public Builder enableAdfsWaadEmailVerification(Optional enableAdfsWaadEmailVerification) { + this.enableAdfsWaadEmailVerification = enableAdfsWaadEmailVerification; + return this; + } + + public Builder enableAdfsWaadEmailVerification(Boolean enableAdfsWaadEmailVerification) { + this.enableAdfsWaadEmailVerification = Optional.ofNullable(enableAdfsWaadEmailVerification); + return this; + } + + /** + *

Delete underlying grant when a Refresh Token is revoked via the Authentication API.

+ */ + @JsonSetter(value = "revoke_refresh_token_grant", nulls = Nulls.SKIP) + public Builder revokeRefreshTokenGrant(Optional revokeRefreshTokenGrant) { + this.revokeRefreshTokenGrant = revokeRefreshTokenGrant; + return this; + } + + public Builder revokeRefreshTokenGrant(Boolean revokeRefreshTokenGrant) { + this.revokeRefreshTokenGrant = Optional.ofNullable(revokeRefreshTokenGrant); + return this; + } + + /** + *

Enables beta access to log streaming changes

+ */ + @JsonSetter(value = "dashboard_log_streams_next", nulls = Nulls.SKIP) + public Builder dashboardLogStreamsNext(Optional dashboardLogStreamsNext) { + this.dashboardLogStreamsNext = dashboardLogStreamsNext; + return this; + } + + public Builder dashboardLogStreamsNext(Boolean dashboardLogStreamsNext) { + this.dashboardLogStreamsNext = Optional.ofNullable(dashboardLogStreamsNext); + return this; + } + + /** + *

Enables new insights activity page view

+ */ + @JsonSetter(value = "dashboard_insights_view", nulls = Nulls.SKIP) + public Builder dashboardInsightsView(Optional dashboardInsightsView) { + this.dashboardInsightsView = dashboardInsightsView; + return this; + } + + public Builder dashboardInsightsView(Boolean dashboardInsightsView) { + this.dashboardInsightsView = Optional.ofNullable(dashboardInsightsView); + return this; + } + + /** + *

Disables SAML fields map fix for bad mappings with repeated attributes

+ */ + @JsonSetter(value = "disable_fields_map_fix", nulls = Nulls.SKIP) + public Builder disableFieldsMapFix(Optional disableFieldsMapFix) { + this.disableFieldsMapFix = disableFieldsMapFix; + return this; + } + + public Builder disableFieldsMapFix(Boolean disableFieldsMapFix) { + this.disableFieldsMapFix = Optional.ofNullable(disableFieldsMapFix); + return this; + } + + /** + *

Used to allow users to pick what factor to enroll of the available MFA factors.

+ */ + @JsonSetter(value = "mfa_show_factor_list_on_enrollment", nulls = Nulls.SKIP) + public Builder mfaShowFactorListOnEnrollment(Optional mfaShowFactorListOnEnrollment) { + this.mfaShowFactorListOnEnrollment = mfaShowFactorListOnEnrollment; + return this; + } + + public Builder mfaShowFactorListOnEnrollment(Boolean mfaShowFactorListOnEnrollment) { + this.mfaShowFactorListOnEnrollment = Optional.ofNullable(mfaShowFactorListOnEnrollment); + return this; + } + + /** + *

Removes alg property from jwks .well-known endpoint

+ */ + @JsonSetter(value = "remove_alg_from_jwks", nulls = Nulls.SKIP) + public Builder removeAlgFromJwks(Optional removeAlgFromJwks) { + this.removeAlgFromJwks = removeAlgFromJwks; + return this; + } + + public Builder removeAlgFromJwks(Boolean removeAlgFromJwks) { + this.removeAlgFromJwks = Optional.ofNullable(removeAlgFromJwks); + return this; + } + + /** + *

Improves bot detection during signup in classic universal login

+ */ + @JsonSetter(value = "improved_signup_bot_detection_in_classic", nulls = Nulls.SKIP) + public Builder improvedSignupBotDetectionInClassic(Optional improvedSignupBotDetectionInClassic) { + this.improvedSignupBotDetectionInClassic = improvedSignupBotDetectionInClassic; + return this; + } + + public Builder improvedSignupBotDetectionInClassic(Boolean improvedSignupBotDetectionInClassic) { + this.improvedSignupBotDetectionInClassic = Optional.ofNullable(improvedSignupBotDetectionInClassic); + return this; + } + + /** + *

This tenant signed up for the Auth4GenAI trail

+ */ + @JsonSetter(value = "genai_trial", nulls = Nulls.SKIP) + public Builder genaiTrial(Optional genaiTrial) { + this.genaiTrial = genaiTrial; + return this; + } + + public Builder genaiTrial(Boolean genaiTrial) { + this.genaiTrial = Optional.ofNullable(genaiTrial); + return this; + } + + /** + *

Whether third-party developers can <a href="https://auth0.com/docs/api-auth/dynamic-client-registration">dynamically register</a> applications for your APIs (true) or not (false). This flag enables dynamic client registration.

+ */ + @JsonSetter(value = "enable_dynamic_client_registration", nulls = Nulls.SKIP) + public Builder enableDynamicClientRegistration(Optional enableDynamicClientRegistration) { + this.enableDynamicClientRegistration = enableDynamicClientRegistration; + return this; + } + + public Builder enableDynamicClientRegistration(Boolean enableDynamicClientRegistration) { + this.enableDynamicClientRegistration = Optional.ofNullable(enableDynamicClientRegistration); + return this; + } + + /** + *

If true, SMS phone numbers will not be obfuscated in Management API GET calls.

+ */ + @JsonSetter(value = "disable_management_api_sms_obfuscation", nulls = Nulls.SKIP) + public Builder disableManagementApiSmsObfuscation(Optional disableManagementApiSmsObfuscation) { + this.disableManagementApiSmsObfuscation = disableManagementApiSmsObfuscation; + return this; + } + + public Builder disableManagementApiSmsObfuscation(Boolean disableManagementApiSmsObfuscation) { + this.disableManagementApiSmsObfuscation = Optional.ofNullable(disableManagementApiSmsObfuscation); + return this; + } + + /** + *

Changes email_verified behavior for Azure AD/ADFS connections when enabled. Sets email_verified to false otherwise.

+ */ + @JsonSetter(value = "trust_azure_adfs_email_verified_connection_property", nulls = Nulls.SKIP) + public Builder trustAzureAdfsEmailVerifiedConnectionProperty( + Optional trustAzureAdfsEmailVerifiedConnectionProperty) { + this.trustAzureAdfsEmailVerifiedConnectionProperty = trustAzureAdfsEmailVerifiedConnectionProperty; + return this; + } + + public Builder trustAzureAdfsEmailVerifiedConnectionProperty( + Boolean trustAzureAdfsEmailVerifiedConnectionProperty) { + this.trustAzureAdfsEmailVerifiedConnectionProperty = + Optional.ofNullable(trustAzureAdfsEmailVerifiedConnectionProperty); + return this; + } + + /** + *

If true, custom domains feature will be enabled for tenant.

+ */ + @JsonSetter(value = "custom_domains_provisioning", nulls = Nulls.SKIP) + public Builder customDomainsProvisioning(Optional customDomainsProvisioning) { + this.customDomainsProvisioning = customDomainsProvisioning; + return this; + } + + public Builder customDomainsProvisioning(Boolean customDomainsProvisioning) { + this.customDomainsProvisioning = Optional.ofNullable(customDomainsProvisioning); + return this; + } + + public TenantSettingsFlags build() { + return new TenantSettingsFlags( + changePwdFlowV1, + enableApisSection, + disableImpersonation, + enableClientConnections, + enablePipeline2, + allowLegacyDelegationGrantTypes, + allowLegacyRoGrantTypes, + allowLegacyTokeninfoEndpoint, + enableLegacyProfile, + enableIdtokenApi2, + enablePublicSignupUserExistsError, + enableSso, + allowChangingEnableSso, + disableClickjackProtectionHeaders, + noDiscloseEnterpriseConnections, + enforceClientAuthenticationOnPasswordlessStart, + enableAdfsWaadEmailVerification, + revokeRefreshTokenGrant, + dashboardLogStreamsNext, + dashboardInsightsView, + disableFieldsMapFix, + mfaShowFactorListOnEnrollment, + removeAlgFromJwks, + improvedSignupBotDetectionInClassic, + genaiTrial, + enableDynamicClientRegistration, + disableManagementApiSmsObfuscation, + trustAzureAdfsEmailVerifiedConnectionProperty, + customDomainsProvisioning, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java new file mode 100644 index 000000000..7b6af4a8c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsGuardianPage.Builder.class) +public final class TenantSettingsGuardianPage { + private final Optional enabled; + + private final Optional html; + + private final Map additionalProperties; + + private TenantSettingsGuardianPage( + Optional enabled, Optional html, Map additionalProperties) { + this.enabled = enabled; + this.html = html; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to use the custom Guardian HTML (true) or the default Auth0 page (false, default) + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Custom Guardian HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> is supported). + */ + @JsonProperty("html") + public Optional getHtml() { + return html; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsGuardianPage && equalTo((TenantSettingsGuardianPage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsGuardianPage other) { + return enabled.equals(other.enabled) && html.equals(other.html); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.html); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional html = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsGuardianPage other) { + enabled(other.getEnabled()); + html(other.getHtml()); + return this; + } + + /** + *

Whether to use the custom Guardian HTML (true) or the default Auth0 page (false, default)

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Custom Guardian HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> is supported).

+ */ + @JsonSetter(value = "html", nulls = Nulls.SKIP) + public Builder html(Optional html) { + this.html = html; + return this; + } + + public Builder html(String html) { + this.html = Optional.ofNullable(html); + return this; + } + + public TenantSettingsGuardianPage build() { + return new TenantSettingsGuardianPage(enabled, html, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java new file mode 100644 index 000000000..4fce8b382 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsMtls.Builder.class) +public final class TenantSettingsMtls { + private final Optional enableEndpointAliases; + + private final Map additionalProperties; + + private TenantSettingsMtls(Optional enableEndpointAliases, Map additionalProperties) { + this.enableEndpointAliases = enableEndpointAliases; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, enables mTLS endpoint aliases + */ + @JsonProperty("enable_endpoint_aliases") + public Optional getEnableEndpointAliases() { + return enableEndpointAliases; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsMtls && equalTo((TenantSettingsMtls) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsMtls other) { + return enableEndpointAliases.equals(other.enableEndpointAliases); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enableEndpointAliases); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enableEndpointAliases = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsMtls other) { + enableEndpointAliases(other.getEnableEndpointAliases()); + return this; + } + + /** + *

If true, enables mTLS endpoint aliases

+ */ + @JsonSetter(value = "enable_endpoint_aliases", nulls = Nulls.SKIP) + public Builder enableEndpointAliases(Optional enableEndpointAliases) { + this.enableEndpointAliases = enableEndpointAliases; + return this; + } + + public Builder enableEndpointAliases(Boolean enableEndpointAliases) { + this.enableEndpointAliases = Optional.ofNullable(enableEndpointAliases); + return this; + } + + public TenantSettingsMtls build() { + return new TenantSettingsMtls(enableEndpointAliases, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java new file mode 100644 index 000000000..3d254ec4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsPasswordPage.Builder.class) +public final class TenantSettingsPasswordPage { + private final Optional enabled; + + private final Optional html; + + private final Map additionalProperties; + + private TenantSettingsPasswordPage( + Optional enabled, Optional html, Map additionalProperties) { + this.enabled = enabled; + this.html = html; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to use the custom change password HTML (true) or the default Auth0 page (false). Default is to use the Auth0 page. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Custom change password HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> supported). + */ + @JsonProperty("html") + public Optional getHtml() { + return html; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsPasswordPage && equalTo((TenantSettingsPasswordPage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsPasswordPage other) { + return enabled.equals(other.enabled) && html.equals(other.html); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.html); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional html = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsPasswordPage other) { + enabled(other.getEnabled()); + html(other.getHtml()); + return this; + } + + /** + *

Whether to use the custom change password HTML (true) or the default Auth0 page (false). Default is to use the Auth0 page.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Custom change password HTML (<a href='https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'>Liquid syntax</a> supported).

+ */ + @JsonSetter(value = "html", nulls = Nulls.SKIP) + public Builder html(Optional html) { + this.html = html; + return this; + } + + public Builder html(String html) { + this.html = Optional.ofNullable(html); + return this; + } + + public TenantSettingsPasswordPage build() { + return new TenantSettingsPasswordPage(enabled, html, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java new file mode 100644 index 000000000..ae2da26d0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsSessions.Builder.class) +public final class TenantSettingsSessions { + private final Optional oidcLogoutPromptEnabled; + + private final Map additionalProperties; + + private TenantSettingsSessions( + Optional oidcLogoutPromptEnabled, Map additionalProperties) { + this.oidcLogoutPromptEnabled = oidcLogoutPromptEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to bypass prompting logic (false) when performing OIDC Logout + */ + @JsonProperty("oidc_logout_prompt_enabled") + public Optional getOidcLogoutPromptEnabled() { + return oidcLogoutPromptEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsSessions && equalTo((TenantSettingsSessions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsSessions other) { + return oidcLogoutPromptEnabled.equals(other.oidcLogoutPromptEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.oidcLogoutPromptEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional oidcLogoutPromptEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsSessions other) { + oidcLogoutPromptEnabled(other.getOidcLogoutPromptEnabled()); + return this; + } + + /** + *

Whether to bypass prompting logic (false) when performing OIDC Logout

+ */ + @JsonSetter(value = "oidc_logout_prompt_enabled", nulls = Nulls.SKIP) + public Builder oidcLogoutPromptEnabled(Optional oidcLogoutPromptEnabled) { + this.oidcLogoutPromptEnabled = oidcLogoutPromptEnabled; + return this; + } + + public Builder oidcLogoutPromptEnabled(Boolean oidcLogoutPromptEnabled) { + this.oidcLogoutPromptEnabled = Optional.ofNullable(oidcLogoutPromptEnabled); + return this; + } + + public TenantSettingsSessions build() { + return new TenantSettingsSessions(oidcLogoutPromptEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java new file mode 100644 index 000000000..b6ffac639 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TestActionRequestContent.Builder.class) +public final class TestActionRequestContent { + private final Map payload; + + private final Map additionalProperties; + + private TestActionRequestContent(Map payload, Map additionalProperties) { + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("payload") + public Map getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TestActionRequestContent && equalTo((TestActionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TestActionRequestContent other) { + return payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map payload = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TestActionRequestContent other) { + payload(other.getPayload()); + return this; + } + + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public Builder payload(Map payload) { + this.payload.clear(); + if (payload != null) { + this.payload.putAll(payload); + } + return this; + } + + public Builder putAllPayload(Map payload) { + if (payload != null) { + this.payload.putAll(payload); + } + return this; + } + + public Builder payload(String key, Object value) { + this.payload.put(key, value); + return this; + } + + public TestActionRequestContent build() { + return new TestActionRequestContent(payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java new file mode 100644 index 000000000..d7f2a85a8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TestActionResponseContent.Builder.class) +public final class TestActionResponseContent { + private final Optional> payload; + + private final Map additionalProperties; + + private TestActionResponseContent(Optional> payload, Map additionalProperties) { + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("payload") + public Optional> getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TestActionResponseContent && equalTo((TestActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TestActionResponseContent other) { + return payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> payload = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TestActionResponseContent other) { + payload(other.getPayload()); + return this; + } + + @JsonSetter(value = "payload", nulls = Nulls.SKIP) + public Builder payload(Optional> payload) { + this.payload = payload; + return this; + } + + public Builder payload(Map payload) { + this.payload = Optional.ofNullable(payload); + return this; + } + + public TestActionResponseContent build() { + return new TestActionResponseContent(payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java new file mode 100644 index 000000000..9393013df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TestCustomDomainResponseContent.Builder.class) +public final class TestCustomDomainResponseContent { + private final boolean success; + + private final Optional message; + + private final Map additionalProperties; + + private TestCustomDomainResponseContent( + boolean success, Optional message, Map additionalProperties) { + this.success = success; + this.message = message; + this.additionalProperties = additionalProperties; + } + + /** + * @return Result of the operation. + */ + @JsonProperty("success") + public boolean getSuccess() { + return success; + } + + /** + * @return Message describing the operation status. + */ + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TestCustomDomainResponseContent && equalTo((TestCustomDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TestCustomDomainResponseContent other) { + return success == other.success && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.success, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SuccessStage builder() { + return new Builder(); + } + + public interface SuccessStage { + /** + *

Result of the operation.

+ */ + _FinalStage success(boolean success); + + Builder from(TestCustomDomainResponseContent other); + } + + public interface _FinalStage { + TestCustomDomainResponseContent build(); + + /** + *

Message describing the operation status.

+ */ + _FinalStage message(Optional message); + + _FinalStage message(String message); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SuccessStage, _FinalStage { + private boolean success; + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TestCustomDomainResponseContent other) { + success(other.getSuccess()); + message(other.getMessage()); + return this; + } + + /** + *

Result of the operation.

+ *

Result of the operation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("success") + public _FinalStage success(boolean success) { + this.success = success; + return this; + } + + /** + *

Message describing the operation status.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + /** + *

Message describing the operation status.

+ */ + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @java.lang.Override + public TestCustomDomainResponseContent build() { + return new TestCustomDomainResponseContent(success, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java new file mode 100644 index 000000000..09dd38ab9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TokenExchangeProfileResponseContent.Builder.class) +public final class TokenExchangeProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional subjectTokenType; + + private final Optional actionId; + + private final Optional type; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private TokenExchangeProfileResponseContent( + Optional id, + Optional name, + Optional subjectTokenType, + Optional actionId, + Optional type, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.subjectTokenType = subjectTokenType; + this.actionId = actionId; + this.type = type; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the token exchange profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name of this profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + */ + @JsonProperty("subject_token_type") + public Optional getSubjectTokenType() { + return subjectTokenType; + } + + /** + * @return The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + */ + @JsonProperty("action_id") + public Optional getActionId() { + return actionId; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The time when this profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TokenExchangeProfileResponseContent + && equalTo((TokenExchangeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TokenExchangeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && subjectTokenType.equals(other.subjectTokenType) + && actionId.equals(other.actionId) + && type.equals(other.type) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional subjectTokenType = Optional.empty(); + + private Optional actionId = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TokenExchangeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + subjectTokenType(other.getSubjectTokenType()); + actionId(other.getActionId()); + type(other.getType()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The unique ID of the token exchange profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name of this profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ */ + @JsonSetter(value = "subject_token_type", nulls = Nulls.SKIP) + public Builder subjectTokenType(Optional subjectTokenType) { + this.subjectTokenType = subjectTokenType; + return this; + } + + public Builder subjectTokenType(String subjectTokenType) { + this.subjectTokenType = Optional.ofNullable(subjectTokenType); + return this; + } + + /** + *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

+ */ + @JsonSetter(value = "action_id", nulls = Nulls.SKIP) + public Builder actionId(Optional actionId) { + this.actionId = actionId; + return this; + } + + public Builder actionId(String actionId) { + this.actionId = Optional.ofNullable(actionId); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The time when this profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public TokenExchangeProfileResponseContent build() { + return new TokenExchangeProfileResponseContent( + id, name, subjectTokenType, actionId, type, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java new file mode 100644 index 000000000..7d9471003 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TokenExchangeProfilesListRequest.Builder.class) +public final class TokenExchangeProfilesListRequest { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private TokenExchangeProfilesListRequest( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TokenExchangeProfilesListRequest && equalTo((TokenExchangeProfilesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TokenExchangeProfilesListRequest other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TokenExchangeProfilesListRequest other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public TokenExchangeProfilesListRequest build() { + return new TokenExchangeProfilesListRequest(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java new file mode 100644 index 000000000..d7cf28e47 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TokenQuota.Builder.class) +public final class TokenQuota { + private final TokenQuotaClientCredentials clientCredentials; + + private final Map additionalProperties; + + private TokenQuota(TokenQuotaClientCredentials clientCredentials, Map additionalProperties) { + this.clientCredentials = clientCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_credentials") + public TokenQuotaClientCredentials getClientCredentials() { + return clientCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TokenQuota && equalTo((TokenQuota) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TokenQuota other) { + return clientCredentials.equals(other.clientCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientCredentialsStage builder() { + return new Builder(); + } + + public interface ClientCredentialsStage { + _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials); + + Builder from(TokenQuota other); + } + + public interface _FinalStage { + TokenQuota build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientCredentialsStage, _FinalStage { + private TokenQuotaClientCredentials clientCredentials; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TokenQuota other) { + clientCredentials(other.getClientCredentials()); + return this; + } + + @java.lang.Override + @JsonSetter("client_credentials") + public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { + this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); + return this; + } + + @java.lang.Override + public TokenQuota build() { + return new TokenQuota(clientCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java new file mode 100644 index 000000000..920f2889b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TokenQuotaClientCredentials.Builder.class) +public final class TokenQuotaClientCredentials { + private final Optional enforce; + + private final Optional perDay; + + private final Optional perHour; + + private final Map additionalProperties; + + private TokenQuotaClientCredentials( + Optional enforce, + Optional perDay, + Optional perHour, + Map additionalProperties) { + this.enforce = enforce; + this.perDay = perDay; + this.perHour = perHour; + this.additionalProperties = additionalProperties; + } + + /** + * @return If enabled, the quota will be enforced and requests in excess of the quota will fail. If disabled, the quota will not be enforced, but notifications for requests exceeding the quota will be available in logs. + */ + @JsonProperty("enforce") + public Optional getEnforce() { + return enforce; + } + + /** + * @return Maximum number of issued tokens per day + */ + @JsonProperty("per_day") + public Optional getPerDay() { + return perDay; + } + + /** + * @return Maximum number of issued tokens per hour + */ + @JsonProperty("per_hour") + public Optional getPerHour() { + return perHour; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TokenQuotaClientCredentials && equalTo((TokenQuotaClientCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TokenQuotaClientCredentials other) { + return enforce.equals(other.enforce) && perDay.equals(other.perDay) && perHour.equals(other.perHour); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enforce, this.perDay, this.perHour); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enforce = Optional.empty(); + + private Optional perDay = Optional.empty(); + + private Optional perHour = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TokenQuotaClientCredentials other) { + enforce(other.getEnforce()); + perDay(other.getPerDay()); + perHour(other.getPerHour()); + return this; + } + + /** + *

If enabled, the quota will be enforced and requests in excess of the quota will fail. If disabled, the quota will not be enforced, but notifications for requests exceeding the quota will be available in logs.

+ */ + @JsonSetter(value = "enforce", nulls = Nulls.SKIP) + public Builder enforce(Optional enforce) { + this.enforce = enforce; + return this; + } + + public Builder enforce(Boolean enforce) { + this.enforce = Optional.ofNullable(enforce); + return this; + } + + /** + *

Maximum number of issued tokens per day

+ */ + @JsonSetter(value = "per_day", nulls = Nulls.SKIP) + public Builder perDay(Optional perDay) { + this.perDay = perDay; + return this; + } + + public Builder perDay(Integer perDay) { + this.perDay = Optional.ofNullable(perDay); + return this; + } + + /** + *

Maximum number of issued tokens per hour

+ */ + @JsonSetter(value = "per_hour", nulls = Nulls.SKIP) + public Builder perHour(Optional perHour) { + this.perHour = perHour; + return this; + } + + public Builder perHour(Integer perHour) { + this.perHour = Optional.ofNullable(perHour); + return this; + } + + public TokenQuotaClientCredentials build() { + return new TokenQuotaClientCredentials(enforce, perDay, perHour, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java new file mode 100644 index 000000000..d343e5b82 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TokenQuotaConfiguration.Builder.class) +public final class TokenQuotaConfiguration { + private final TokenQuotaClientCredentials clientCredentials; + + private final Map additionalProperties; + + private TokenQuotaConfiguration( + TokenQuotaClientCredentials clientCredentials, Map additionalProperties) { + this.clientCredentials = clientCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_credentials") + public TokenQuotaClientCredentials getClientCredentials() { + return clientCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TokenQuotaConfiguration && equalTo((TokenQuotaConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TokenQuotaConfiguration other) { + return clientCredentials.equals(other.clientCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientCredentialsStage builder() { + return new Builder(); + } + + public interface ClientCredentialsStage { + _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials); + + Builder from(TokenQuotaConfiguration other); + } + + public interface _FinalStage { + TokenQuotaConfiguration build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientCredentialsStage, _FinalStage { + private TokenQuotaClientCredentials clientCredentials; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TokenQuotaConfiguration other) { + clientCredentials(other.getClientCredentials()); + return this; + } + + @java.lang.Override + @JsonSetter("client_credentials") + public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { + this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); + return this; + } + + @java.lang.Override + public TokenQuotaConfiguration build() { + return new TokenQuotaConfiguration(clientCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java new file mode 100644 index 000000000..8468c49e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TwilioProviderConfiguration.Builder.class) +public final class TwilioProviderConfiguration { + private final Optional defaultFrom; + + private final Optional mssid; + + private final String sid; + + private final List deliveryMethods; + + private final Map additionalProperties; + + private TwilioProviderConfiguration( + Optional defaultFrom, + Optional mssid, + String sid, + List deliveryMethods, + Map additionalProperties) { + this.defaultFrom = defaultFrom; + this.mssid = mssid; + this.sid = sid; + this.deliveryMethods = deliveryMethods; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("default_from") + public Optional getDefaultFrom() { + return defaultFrom; + } + + @JsonProperty("mssid") + public Optional getMssid() { + return mssid; + } + + @JsonProperty("sid") + public String getSid() { + return sid; + } + + @JsonProperty("delivery_methods") + public List getDeliveryMethods() { + return deliveryMethods; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TwilioProviderConfiguration && equalTo((TwilioProviderConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TwilioProviderConfiguration other) { + return defaultFrom.equals(other.defaultFrom) + && mssid.equals(other.mssid) + && sid.equals(other.sid) + && deliveryMethods.equals(other.deliveryMethods); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.defaultFrom, this.mssid, this.sid, this.deliveryMethods); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SidStage builder() { + return new Builder(); + } + + public interface SidStage { + _FinalStage sid(@NotNull String sid); + + Builder from(TwilioProviderConfiguration other); + } + + public interface _FinalStage { + TwilioProviderConfiguration build(); + + _FinalStage defaultFrom(Optional defaultFrom); + + _FinalStage defaultFrom(String defaultFrom); + + _FinalStage mssid(Optional mssid); + + _FinalStage mssid(String mssid); + + _FinalStage deliveryMethods(List deliveryMethods); + + _FinalStage addDeliveryMethods(TwilioProviderDeliveryMethodEnum deliveryMethods); + + _FinalStage addAllDeliveryMethods(List deliveryMethods); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SidStage, _FinalStage { + private String sid; + + private List deliveryMethods = new ArrayList<>(); + + private Optional mssid = Optional.empty(); + + private Optional defaultFrom = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TwilioProviderConfiguration other) { + defaultFrom(other.getDefaultFrom()); + mssid(other.getMssid()); + sid(other.getSid()); + deliveryMethods(other.getDeliveryMethods()); + return this; + } + + @java.lang.Override + @JsonSetter("sid") + public _FinalStage sid(@NotNull String sid) { + this.sid = Objects.requireNonNull(sid, "sid must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllDeliveryMethods(List deliveryMethods) { + if (deliveryMethods != null) { + this.deliveryMethods.addAll(deliveryMethods); + } + return this; + } + + @java.lang.Override + public _FinalStage addDeliveryMethods(TwilioProviderDeliveryMethodEnum deliveryMethods) { + this.deliveryMethods.add(deliveryMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "delivery_methods", nulls = Nulls.SKIP) + public _FinalStage deliveryMethods(List deliveryMethods) { + this.deliveryMethods.clear(); + if (deliveryMethods != null) { + this.deliveryMethods.addAll(deliveryMethods); + } + return this; + } + + @java.lang.Override + public _FinalStage mssid(String mssid) { + this.mssid = Optional.ofNullable(mssid); + return this; + } + + @java.lang.Override + @JsonSetter(value = "mssid", nulls = Nulls.SKIP) + public _FinalStage mssid(Optional mssid) { + this.mssid = mssid; + return this; + } + + @java.lang.Override + public _FinalStage defaultFrom(String defaultFrom) { + this.defaultFrom = Optional.ofNullable(defaultFrom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "default_from", nulls = Nulls.SKIP) + public _FinalStage defaultFrom(Optional defaultFrom) { + this.defaultFrom = defaultFrom; + return this; + } + + @java.lang.Override + public TwilioProviderConfiguration build() { + return new TwilioProviderConfiguration(defaultFrom, mssid, sid, deliveryMethods, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java new file mode 100644 index 000000000..195d73745 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TwilioProviderCredentials.Builder.class) +public final class TwilioProviderCredentials { + private final String authToken; + + private final Map additionalProperties; + + private TwilioProviderCredentials(String authToken, Map additionalProperties) { + this.authToken = authToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("auth_token") + public String getAuthToken() { + return authToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TwilioProviderCredentials && equalTo((TwilioProviderCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TwilioProviderCredentials other) { + return authToken.equals(other.authToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.authToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AuthTokenStage builder() { + return new Builder(); + } + + public interface AuthTokenStage { + _FinalStage authToken(@NotNull String authToken); + + Builder from(TwilioProviderCredentials other); + } + + public interface _FinalStage { + TwilioProviderCredentials build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AuthTokenStage, _FinalStage { + private String authToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(TwilioProviderCredentials other) { + authToken(other.getAuthToken()); + return this; + } + + @java.lang.Override + @JsonSetter("auth_token") + public _FinalStage authToken(@NotNull String authToken) { + this.authToken = Objects.requireNonNull(authToken, "authToken must not be null"); + return this; + } + + @java.lang.Override + public TwilioProviderCredentials build() { + return new TwilioProviderCredentials(authToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java new file mode 100644 index 000000000..dc8c8aae6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TwilioProviderDeliveryMethodEnum { + public static final TwilioProviderDeliveryMethodEnum TEXT = + new TwilioProviderDeliveryMethodEnum(Value.TEXT, "text"); + + public static final TwilioProviderDeliveryMethodEnum VOICE = + new TwilioProviderDeliveryMethodEnum(Value.VOICE, "voice"); + + private final Value value; + + private final String string; + + TwilioProviderDeliveryMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TwilioProviderDeliveryMethodEnum + && this.string.equals(((TwilioProviderDeliveryMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TEXT: + return visitor.visitText(); + case VOICE: + return visitor.visitVoice(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TwilioProviderDeliveryMethodEnum valueOf(String value) { + switch (value) { + case "text": + return TEXT; + case "voice": + return VOICE; + default: + return new TwilioProviderDeliveryMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TEXT, + + VOICE, + + UNKNOWN + } + + public interface Visitor { + T visitText(); + + T visitVoice(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java new file mode 100644 index 000000000..bd6f45f36 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UniversalLoginExperienceEnum { + public static final UniversalLoginExperienceEnum CLASSIC = + new UniversalLoginExperienceEnum(Value.CLASSIC, "classic"); + + public static final UniversalLoginExperienceEnum NEW = new UniversalLoginExperienceEnum(Value.NEW, "new"); + + private final Value value; + + private final String string; + + UniversalLoginExperienceEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UniversalLoginExperienceEnum + && this.string.equals(((UniversalLoginExperienceEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLASSIC: + return visitor.visitClassic(); + case NEW: + return visitor.visitNew(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UniversalLoginExperienceEnum valueOf(String value) { + switch (value) { + case "classic": + return CLASSIC; + case "new": + return NEW; + default: + return new UniversalLoginExperienceEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NEW, + + CLASSIC, + + UNKNOWN + } + + public interface Visitor { + T visitNew(); + + T visitClassic(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java new file mode 100644 index 000000000..d8d2c5e92 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateActionBindingsResponseContent.Builder.class) +public final class UpdateActionBindingsResponseContent { + private final Optional> bindings; + + private final Map additionalProperties; + + private UpdateActionBindingsResponseContent( + Optional> bindings, Map additionalProperties) { + this.bindings = bindings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("bindings") + public Optional> getBindings() { + return bindings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateActionBindingsResponseContent + && equalTo((UpdateActionBindingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateActionBindingsResponseContent other) { + return bindings.equals(other.bindings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.bindings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> bindings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateActionBindingsResponseContent other) { + bindings(other.getBindings()); + return this; + } + + @JsonSetter(value = "bindings", nulls = Nulls.SKIP) + public Builder bindings(Optional> bindings) { + this.bindings = bindings; + return this; + } + + public Builder bindings(List bindings) { + this.bindings = Optional.ofNullable(bindings); + return this; + } + + public UpdateActionBindingsResponseContent build() { + return new UpdateActionBindingsResponseContent(bindings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java new file mode 100644 index 000000000..228ad6884 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java @@ -0,0 +1,256 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateActionRequestContent.Builder.class) +public final class UpdateActionRequestContent { + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Map additionalProperties; + + private UpdateActionRequestContent( + Optional name, + Optional> supportedTriggers, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Map additionalProperties) { + this.name = name; + this.supportedTriggers = supportedTriggers; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateActionRequestContent && equalTo((UpdateActionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateActionRequestContent other) { + return name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.supportedTriggers, this.code, this.dependencies, this.runtime, this.secrets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateActionRequestContent other) { + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

The source code of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + public UpdateActionRequestContent build() { + return new UpdateActionRequestContent( + name, supportedTriggers, code, dependencies, runtime, secrets, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java new file mode 100644 index 000000000..63661a0ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateActionResponseContent.Builder.class) +public final class UpdateActionResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional> supportedTriggers; + + private final Optional allChangesDeployed; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional code; + + private final Optional> dependencies; + + private final Optional runtime; + + private final Optional> secrets; + + private final Optional deployedVersion; + + private final Optional installedIntegrationId; + + private final Optional integration; + + private final Optional status; + + private final Optional builtAt; + + private final Optional deploy; + + private final Map additionalProperties; + + private UpdateActionResponseContent( + Optional id, + Optional name, + Optional> supportedTriggers, + Optional allChangesDeployed, + Optional createdAt, + Optional updatedAt, + Optional code, + Optional> dependencies, + Optional runtime, + Optional> secrets, + Optional deployedVersion, + Optional installedIntegrationId, + Optional integration, + Optional status, + Optional builtAt, + Optional deploy, + Map additionalProperties) { + this.id = id; + this.name = name; + this.supportedTriggers = supportedTriggers; + this.allChangesDeployed = allChangesDeployed; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.code = code; + this.dependencies = dependencies; + this.runtime = runtime; + this.secrets = secrets; + this.deployedVersion = deployedVersion; + this.installedIntegrationId = installedIntegrationId; + this.integration = integration; + this.status = status; + this.builtAt = builtAt; + this.deploy = deploy; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the action. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of an action. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The list of triggers that this action supports. At this time, an action can only target a single trigger at a time. + */ + @JsonProperty("supported_triggers") + public Optional> getSupportedTriggers() { + return supportedTriggers; + } + + /** + * @return True if all of an Action's contents have been deployed. + */ + @JsonProperty("all_changes_deployed") + public Optional getAllChangesDeployed() { + return allChangesDeployed; + } + + /** + * @return The time when this action was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this action was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return The source code of the action. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The list of third party npm modules, and their versions, that this action depends on. + */ + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + /** + * @return The Node runtime. For example: node12, defaults to node12 + */ + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + + /** + * @return The list of secrets that are included in an action or a version of an action. + */ + @JsonProperty("secrets") + public Optional> getSecrets() { + return secrets; + } + + @JsonProperty("deployed_version") + public Optional getDeployedVersion() { + return deployedVersion; + } + + /** + * @return installed_integration_id is the fk reference to the InstalledIntegration entity. + */ + @JsonProperty("installed_integration_id") + public Optional getInstalledIntegrationId() { + return installedIntegrationId; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The time when this action was built successfully. + */ + @JsonProperty("built_at") + public Optional getBuiltAt() { + return builtAt; + } + + /** + * @return True if the action should be deployed after creation. + */ + @JsonProperty("deploy") + public Optional getDeploy() { + return deploy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateActionResponseContent && equalTo((UpdateActionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateActionResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && supportedTriggers.equals(other.supportedTriggers) + && allChangesDeployed.equals(other.allChangesDeployed) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && code.equals(other.code) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime) + && secrets.equals(other.secrets) + && deployedVersion.equals(other.deployedVersion) + && installedIntegrationId.equals(other.installedIntegrationId) + && integration.equals(other.integration) + && status.equals(other.status) + && builtAt.equals(other.builtAt) + && deploy.equals(other.deploy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.supportedTriggers, + this.allChangesDeployed, + this.createdAt, + this.updatedAt, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.deployedVersion, + this.installedIntegrationId, + this.integration, + this.status, + this.builtAt, + this.deploy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> supportedTriggers = Optional.empty(); + + private Optional allChangesDeployed = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + + private Optional> secrets = Optional.empty(); + + private Optional deployedVersion = Optional.empty(); + + private Optional installedIntegrationId = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional builtAt = Optional.empty(); + + private Optional deploy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateActionResponseContent other) { + id(other.getId()); + name(other.getName()); + supportedTriggers(other.getSupportedTriggers()); + allChangesDeployed(other.getAllChangesDeployed()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + code(other.getCode()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); + secrets(other.getSecrets()); + deployedVersion(other.getDeployedVersion()); + installedIntegrationId(other.getInstalledIntegrationId()); + integration(other.getIntegration()); + status(other.getStatus()); + builtAt(other.getBuiltAt()); + deploy(other.getDeploy()); + return this; + } + + /** + *

The unique ID of the action.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of an action.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

+ */ + @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) + public Builder supportedTriggers(Optional> supportedTriggers) { + this.supportedTriggers = supportedTriggers; + return this; + } + + public Builder supportedTriggers(List supportedTriggers) { + this.supportedTriggers = Optional.ofNullable(supportedTriggers); + return this; + } + + /** + *

True if all of an Action's contents have been deployed.

+ */ + @JsonSetter(value = "all_changes_deployed", nulls = Nulls.SKIP) + public Builder allChangesDeployed(Optional allChangesDeployed) { + this.allChangesDeployed = allChangesDeployed; + return this; + } + + public Builder allChangesDeployed(Boolean allChangesDeployed) { + this.allChangesDeployed = Optional.ofNullable(allChangesDeployed); + return this; + } + + /** + *

The time when this action was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this action was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The source code of the action.

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The list of third party npm modules, and their versions, that this action depends on.

+ */ + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(List dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + /** + *

The Node runtime. For example: node12, defaults to node12

+ */ + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + /** + *

The list of secrets that are included in an action or a version of an action.

+ */ + @JsonSetter(value = "secrets", nulls = Nulls.SKIP) + public Builder secrets(Optional> secrets) { + this.secrets = secrets; + return this; + } + + public Builder secrets(List secrets) { + this.secrets = Optional.ofNullable(secrets); + return this; + } + + @JsonSetter(value = "deployed_version", nulls = Nulls.SKIP) + public Builder deployedVersion(Optional deployedVersion) { + this.deployedVersion = deployedVersion; + return this; + } + + public Builder deployedVersion(ActionDeployedVersion deployedVersion) { + this.deployedVersion = Optional.ofNullable(deployedVersion); + return this; + } + + /** + *

installed_integration_id is the fk reference to the InstalledIntegration entity.

+ */ + @JsonSetter(value = "installed_integration_id", nulls = Nulls.SKIP) + public Builder installedIntegrationId(Optional installedIntegrationId) { + this.installedIntegrationId = installedIntegrationId; + return this; + } + + public Builder installedIntegrationId(String installedIntegrationId) { + this.installedIntegrationId = Optional.ofNullable(installedIntegrationId); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(Integration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ActionBuildStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The time when this action was built successfully.

+ */ + @JsonSetter(value = "built_at", nulls = Nulls.SKIP) + public Builder builtAt(Optional builtAt) { + this.builtAt = builtAt; + return this; + } + + public Builder builtAt(OffsetDateTime builtAt) { + this.builtAt = Optional.ofNullable(builtAt); + return this; + } + + /** + *

True if the action should be deployed after creation.

+ */ + @JsonSetter(value = "deploy", nulls = Nulls.SKIP) + public Builder deploy(Optional deploy) { + this.deploy = deploy; + return this; + } + + public Builder deploy(Boolean deploy) { + this.deploy = Optional.ofNullable(deploy); + return this; + } + + public UpdateActionResponseContent build() { + return new UpdateActionResponseContent( + id, + name, + supportedTriggers, + allChangesDeployed, + createdAt, + updatedAt, + code, + dependencies, + runtime, + secrets, + deployedVersion, + installedIntegrationId, + integration, + status, + builtAt, + deploy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java new file mode 100644 index 000000000..ca10bac1c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAculResponseContent.Builder.class) +public final class UpdateAculResponseContent { + private final Optional renderingMode; + + private final Optional> contextConfiguration; + + private final OptionalNullable defaultHeadTagsDisabled; + + private final Optional> headTags; + + private final OptionalNullable filters; + + private final OptionalNullable usePageTemplate; + + private final Map additionalProperties; + + private UpdateAculResponseContent( + Optional renderingMode, + Optional> contextConfiguration, + OptionalNullable defaultHeadTagsDisabled, + Optional> headTags, + OptionalNullable filters, + OptionalNullable usePageTemplate, + Map additionalProperties) { + this.renderingMode = renderingMode; + this.contextConfiguration = contextConfiguration; + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.headTags = headTags; + this.filters = filters; + this.usePageTemplate = usePageTemplate; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rendering_mode") + public Optional getRenderingMode() { + return renderingMode; + } + + /** + * @return Context values to make available + */ + @JsonProperty("context_configuration") + public Optional> getContextConfiguration() { + return contextConfiguration; + } + + /** + * @return Override Universal Login default head tags + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + public OptionalNullable getDefaultHeadTagsDisabled() { + if (defaultHeadTagsDisabled == null) { + return OptionalNullable.absent(); + } + return defaultHeadTagsDisabled; + } + + /** + * @return An array of head tags + */ + @JsonProperty("head_tags") + public Optional> getHeadTags() { + return headTags; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + public OptionalNullable getFilters() { + if (filters == null) { + return OptionalNullable.absent(); + } + return filters; + } + + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + private OptionalNullable _getDefaultHeadTagsDisabled() { + return defaultHeadTagsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + private OptionalNullable _getUsePageTemplate() { + return usePageTemplate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAculResponseContent && equalTo((UpdateAculResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAculResponseContent other) { + return renderingMode.equals(other.renderingMode) + && contextConfiguration.equals(other.contextConfiguration) + && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && headTags.equals(other.headTags) + && filters.equals(other.filters) + && usePageTemplate.equals(other.usePageTemplate); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.renderingMode, + this.contextConfiguration, + this.defaultHeadTagsDisabled, + this.headTags, + this.filters, + this.usePageTemplate); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional renderingMode = Optional.empty(); + + private Optional> contextConfiguration = Optional.empty(); + + private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + + private Optional> headTags = Optional.empty(); + + private OptionalNullable filters = OptionalNullable.absent(); + + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateAculResponseContent other) { + renderingMode(other.getRenderingMode()); + contextConfiguration(other.getContextConfiguration()); + defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + headTags(other.getHeadTags()); + filters(other.getFilters()); + usePageTemplate(other.getUsePageTemplate()); + return this; + } + + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public Builder renderingMode(Optional renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + public Builder renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = Optional.ofNullable(renderingMode); + return this; + } + + /** + *

Context values to make available

+ */ + @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) + public Builder contextConfiguration(Optional> contextConfiguration) { + this.contextConfiguration = contextConfiguration; + return this; + } + + public Builder contextConfiguration(List contextConfiguration) { + this.contextConfiguration = Optional.ofNullable(contextConfiguration); + return this; + } + + /** + *

Override Universal Login default head tags

+ */ + @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) + public Builder defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + return this; + } + + public Builder defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled); + return this; + } + + public Builder defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isPresent()) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isNull()) { + this.defaultHeadTagsDisabled = OptionalNullable.ofNull(); + } else if (defaultHeadTagsDisabled.isEmpty()) { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } + return this; + } + + /** + *

An array of head tags

+ */ + @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) + public Builder headTags(Optional> headTags) { + this.headTags = headTags; + return this; + } + + public Builder headTags(List headTags) { + this.headTags = Optional.ofNullable(headTags); + return this; + } + + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(@Nullable OptionalNullable filters) { + this.filters = filters; + return this; + } + + public Builder filters(AculFilters filters) { + this.filters = OptionalNullable.of(filters); + return this; + } + + public Builder filters(Optional filters) { + if (filters.isPresent()) { + this.filters = OptionalNullable.of(filters.get()); + } else { + this.filters = OptionalNullable.absent(); + } + return this; + } + + public Builder filters(com.auth0.client.mgmt.core.Nullable filters) { + if (filters.isNull()) { + this.filters = OptionalNullable.ofNull(); + } else if (filters.isEmpty()) { + this.filters = OptionalNullable.absent(); + } else { + this.filters = OptionalNullable.of(filters.get()); + } + return this; + } + + /** + *

Use page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + + public UpdateAculResponseContent build() { + return new UpdateAculResponseContent( + renderingMode, + contextConfiguration, + defaultHeadTagsDisabled, + headTags, + filters, + usePageTemplate, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java new file mode 100644 index 000000000..a17710ac0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingColors.Builder.class) +public final class UpdateBrandingColors { + private final OptionalNullable primary; + + private final Optional pageBackground; + + private final Map additionalProperties; + + private UpdateBrandingColors( + OptionalNullable primary, + Optional pageBackground, + Map additionalProperties) { + this.primary = primary; + this.pageBackground = pageBackground; + this.additionalProperties = additionalProperties; + } + + /** + * @return Accent color. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("primary") + public OptionalNullable getPrimary() { + if (primary == null) { + return OptionalNullable.absent(); + } + return primary; + } + + @JsonProperty("page_background") + public Optional getPageBackground() { + return pageBackground; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("primary") + private OptionalNullable _getPrimary() { + return primary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingColors && equalTo((UpdateBrandingColors) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingColors other) { + return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.primary, this.pageBackground); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable primary = OptionalNullable.absent(); + + private Optional pageBackground = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBrandingColors other) { + primary(other.getPrimary()); + pageBackground(other.getPageBackground()); + return this; + } + + /** + *

Accent color.

+ */ + @JsonSetter(value = "primary", nulls = Nulls.SKIP) + public Builder primary(@Nullable OptionalNullable primary) { + this.primary = primary; + return this; + } + + public Builder primary(String primary) { + this.primary = OptionalNullable.of(primary); + return this; + } + + public Builder primary(Optional primary) { + if (primary.isPresent()) { + this.primary = OptionalNullable.of(primary.get()); + } else { + this.primary = OptionalNullable.absent(); + } + return this; + } + + public Builder primary(com.auth0.client.mgmt.core.Nullable primary) { + if (primary.isNull()) { + this.primary = OptionalNullable.ofNull(); + } else if (primary.isEmpty()) { + this.primary = OptionalNullable.absent(); + } else { + this.primary = OptionalNullable.of(primary.get()); + } + return this; + } + + @JsonSetter(value = "page_background", nulls = Nulls.SKIP) + public Builder pageBackground(Optional pageBackground) { + this.pageBackground = pageBackground; + return this; + } + + public Builder pageBackground(UpdateBrandingPageBackground pageBackground) { + this.pageBackground = Optional.ofNullable(pageBackground); + return this; + } + + public UpdateBrandingColors build() { + return new UpdateBrandingColors(primary, pageBackground, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java new file mode 100644 index 000000000..1da496328 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingFont.Builder.class) +public final class UpdateBrandingFont { + private final OptionalNullable url; + + private final Map additionalProperties; + + private UpdateBrandingFont(OptionalNullable url, Map additionalProperties) { + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL for the custom font. The URL must point to a font file and not a stylesheet. Must use HTTPS. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url") + public OptionalNullable getUrl() { + if (url == null) { + return OptionalNullable.absent(); + } + return url; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url") + private OptionalNullable _getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingFont && equalTo((UpdateBrandingFont) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingFont other) { + return url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable url = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBrandingFont other) { + url(other.getUrl()); + return this; + } + + /** + *

URL for the custom font. The URL must point to a font file and not a stylesheet. Must use HTTPS.

+ */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(@Nullable OptionalNullable url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = OptionalNullable.of(url); + return this; + } + + public Builder url(Optional url) { + if (url.isPresent()) { + this.url = OptionalNullable.of(url.get()); + } else { + this.url = OptionalNullable.absent(); + } + return this; + } + + public Builder url(com.auth0.client.mgmt.core.Nullable url) { + if (url.isNull()) { + this.url = OptionalNullable.ofNull(); + } else if (url.isEmpty()) { + this.url = OptionalNullable.absent(); + } else { + this.url = OptionalNullable.of(url.get()); + } + return this; + } + + public UpdateBrandingFont build() { + return new UpdateBrandingFont(url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java new file mode 100644 index 000000000..849ba5b81 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = UpdateBrandingPageBackground.Deserializer.class) +public final class UpdateBrandingPageBackground { + private final Object value; + + private final int type; + + private UpdateBrandingPageBackground(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visitOptionalNullableString((OptionalNullable) this.value); + } else if (this.type == 1) { + return visitor.visitOptionalNullableMapOfStringToUnknown( + (OptionalNullable>) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingPageBackground && equalTo((UpdateBrandingPageBackground) other); + } + + private boolean equalTo(UpdateBrandingPageBackground other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UpdateBrandingPageBackground ofOptionalNullableString(OptionalNullable value) { + return new UpdateBrandingPageBackground(value, 0); + } + + public static UpdateBrandingPageBackground ofOptionalNullableMapOfStringToUnknown( + OptionalNullable> value) { + return new UpdateBrandingPageBackground(value, 1); + } + + public interface Visitor { + T visitOptionalNullableString(OptionalNullable value); + + T visitOptionalNullableMapOfStringToUnknown(OptionalNullable> value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateBrandingPageBackground.class); + } + + @java.lang.Override + public UpdateBrandingPageBackground deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return ofOptionalNullableString(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + try { + return ofOptionalNullableMapOfStringToUnknown(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPhoneProviderResponseContent.java new file mode 100644 index 000000000..282e6e178 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPhoneProviderResponseContent.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingPhoneProviderResponseContent.Builder.class) +public final class UpdateBrandingPhoneProviderResponseContent { + private final Optional id; + + private final Optional tenant; + + private final PhoneProviderNameEnum name; + + private final Optional channel; + + private final Optional disabled; + + private final Optional configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private UpdateBrandingPhoneProviderResponseContent( + Optional id, + Optional tenant, + PhoneProviderNameEnum name, + Optional channel, + Optional disabled, + Optional configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.tenant = tenant; + this.name = name; + this.channel = channel; + this.disabled = disabled; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the tenant + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("name") + public PhoneProviderNameEnum getName() { + return name; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + /** + * @return Whether the provider is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + @JsonProperty("configuration") + public Optional getConfiguration() { + return configuration; + } + + /** + * @return The provider's creation date and time in ISO 8601 format + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time of the last update to the provider in ISO 8601 format + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingPhoneProviderResponseContent + && equalTo((UpdateBrandingPhoneProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingPhoneProviderResponseContent other) { + return id.equals(other.id) + && tenant.equals(other.tenant) + && name.equals(other.name) + && channel.equals(other.channel) + && disabled.equals(other.disabled) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.tenant, + this.name, + this.channel, + this.disabled, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull PhoneProviderNameEnum name); + + Builder from(UpdateBrandingPhoneProviderResponseContent other); + } + + public interface _FinalStage { + UpdateBrandingPhoneProviderResponseContent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

The name of the tenant

+ */ + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(Optional disabled); + + _FinalStage disabled(Boolean disabled); + + _FinalStage configuration(Optional configuration); + + _FinalStage configuration(PhoneProviderConfiguration configuration); + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private PhoneProviderNameEnum name; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional configuration = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional channel = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateBrandingPhoneProviderResponseContent other) { + id(other.getId()); + tenant(other.getTenant()); + name(other.getName()); + channel(other.getChannel()); + disabled(other.getDisabled()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull PhoneProviderNameEnum name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

The date and time of the last update to the provider in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public _FinalStage updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The provider's creation date and time in ISO 8601 format

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public _FinalStage configuration(PhoneProviderConfiguration configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public _FinalStage configuration(Optional configuration) { + this.configuration = configuration; + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + return this; + } + + /** + *

Whether the provider is enabled (false) or disabled (true).

+ */ + @java.lang.Override + @JsonSetter(value = "disabled", nulls = Nulls.SKIP) + public _FinalStage disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + /** + *

The name of the tenant

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

The name of the tenant

+ */ + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public UpdateBrandingPhoneProviderResponseContent build() { + return new UpdateBrandingPhoneProviderResponseContent( + id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java new file mode 100644 index 000000000..ad7fd7d62 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java @@ -0,0 +1,304 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingRequestContent.Builder.class) +public final class UpdateBrandingRequestContent { + private final OptionalNullable colors; + + private final OptionalNullable faviconUrl; + + private final OptionalNullable logoUrl; + + private final OptionalNullable font; + + private final Map additionalProperties; + + private UpdateBrandingRequestContent( + OptionalNullable colors, + OptionalNullable faviconUrl, + OptionalNullable logoUrl, + OptionalNullable font, + Map additionalProperties) { + this.colors = colors; + this.faviconUrl = faviconUrl; + this.logoUrl = logoUrl; + this.font = font; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("colors") + public OptionalNullable getColors() { + if (colors == null) { + return OptionalNullable.absent(); + } + return colors; + } + + /** + * @return URL for the favicon. Must use HTTPS. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("favicon_url") + public OptionalNullable getFaviconUrl() { + if (faviconUrl == null) { + return OptionalNullable.absent(); + } + return faviconUrl; + } + + /** + * @return URL for the logo. Must use HTTPS. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("logo_url") + public OptionalNullable getLogoUrl() { + if (logoUrl == null) { + return OptionalNullable.absent(); + } + return logoUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("font") + public OptionalNullable getFont() { + if (font == null) { + return OptionalNullable.absent(); + } + return font; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("colors") + private OptionalNullable _getColors() { + return colors; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("favicon_url") + private OptionalNullable _getFaviconUrl() { + return faviconUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("logo_url") + private OptionalNullable _getLogoUrl() { + return logoUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("font") + private OptionalNullable _getFont() { + return font; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingRequestContent && equalTo((UpdateBrandingRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingRequestContent other) { + return colors.equals(other.colors) + && faviconUrl.equals(other.faviconUrl) + && logoUrl.equals(other.logoUrl) + && font.equals(other.font); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable colors = OptionalNullable.absent(); + + private OptionalNullable faviconUrl = OptionalNullable.absent(); + + private OptionalNullable logoUrl = OptionalNullable.absent(); + + private OptionalNullable font = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBrandingRequestContent other) { + colors(other.getColors()); + faviconUrl(other.getFaviconUrl()); + logoUrl(other.getLogoUrl()); + font(other.getFont()); + return this; + } + + @JsonSetter(value = "colors", nulls = Nulls.SKIP) + public Builder colors(@Nullable OptionalNullable colors) { + this.colors = colors; + return this; + } + + public Builder colors(UpdateBrandingColors colors) { + this.colors = OptionalNullable.of(colors); + return this; + } + + public Builder colors(Optional colors) { + if (colors.isPresent()) { + this.colors = OptionalNullable.of(colors.get()); + } else { + this.colors = OptionalNullable.absent(); + } + return this; + } + + public Builder colors(com.auth0.client.mgmt.core.Nullable colors) { + if (colors.isNull()) { + this.colors = OptionalNullable.ofNull(); + } else if (colors.isEmpty()) { + this.colors = OptionalNullable.absent(); + } else { + this.colors = OptionalNullable.of(colors.get()); + } + return this; + } + + /** + *

URL for the favicon. Must use HTTPS.

+ */ + @JsonSetter(value = "favicon_url", nulls = Nulls.SKIP) + public Builder faviconUrl(@Nullable OptionalNullable faviconUrl) { + this.faviconUrl = faviconUrl; + return this; + } + + public Builder faviconUrl(String faviconUrl) { + this.faviconUrl = OptionalNullable.of(faviconUrl); + return this; + } + + public Builder faviconUrl(Optional faviconUrl) { + if (faviconUrl.isPresent()) { + this.faviconUrl = OptionalNullable.of(faviconUrl.get()); + } else { + this.faviconUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder faviconUrl(com.auth0.client.mgmt.core.Nullable faviconUrl) { + if (faviconUrl.isNull()) { + this.faviconUrl = OptionalNullable.ofNull(); + } else if (faviconUrl.isEmpty()) { + this.faviconUrl = OptionalNullable.absent(); + } else { + this.faviconUrl = OptionalNullable.of(faviconUrl.get()); + } + return this; + } + + /** + *

URL for the logo. Must use HTTPS.

+ */ + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public Builder logoUrl(@Nullable OptionalNullable logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + public Builder logoUrl(String logoUrl) { + this.logoUrl = OptionalNullable.of(logoUrl); + return this; + } + + public Builder logoUrl(Optional logoUrl) { + if (logoUrl.isPresent()) { + this.logoUrl = OptionalNullable.of(logoUrl.get()); + } else { + this.logoUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder logoUrl(com.auth0.client.mgmt.core.Nullable logoUrl) { + if (logoUrl.isNull()) { + this.logoUrl = OptionalNullable.ofNull(); + } else if (logoUrl.isEmpty()) { + this.logoUrl = OptionalNullable.absent(); + } else { + this.logoUrl = OptionalNullable.of(logoUrl.get()); + } + return this; + } + + @JsonSetter(value = "font", nulls = Nulls.SKIP) + public Builder font(@Nullable OptionalNullable font) { + this.font = font; + return this; + } + + public Builder font(UpdateBrandingFont font) { + this.font = OptionalNullable.of(font); + return this; + } + + public Builder font(Optional font) { + if (font.isPresent()) { + this.font = OptionalNullable.of(font.get()); + } else { + this.font = OptionalNullable.absent(); + } + return this; + } + + public Builder font(com.auth0.client.mgmt.core.Nullable font) { + if (font.isNull()) { + this.font = OptionalNullable.ofNull(); + } else if (font.isEmpty()) { + this.font = OptionalNullable.absent(); + } else { + this.font = OptionalNullable.of(font.get()); + } + return this; + } + + public UpdateBrandingRequestContent build() { + return new UpdateBrandingRequestContent(colors, faviconUrl, logoUrl, font, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java new file mode 100644 index 000000000..f1a68fe24 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingResponseContent.Builder.class) +public final class UpdateBrandingResponseContent { + private final Optional colors; + + private final Optional faviconUrl; + + private final Optional logoUrl; + + private final Optional font; + + private final Map additionalProperties; + + private UpdateBrandingResponseContent( + Optional colors, + Optional faviconUrl, + Optional logoUrl, + Optional font, + Map additionalProperties) { + this.colors = colors; + this.faviconUrl = faviconUrl; + this.logoUrl = logoUrl; + this.font = font; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("colors") + public Optional getColors() { + return colors; + } + + /** + * @return URL for the favicon. Must use HTTPS. + */ + @JsonProperty("favicon_url") + public Optional getFaviconUrl() { + return faviconUrl; + } + + /** + * @return URL for the logo. Must use HTTPS. + */ + @JsonProperty("logo_url") + public Optional getLogoUrl() { + return logoUrl; + } + + @JsonProperty("font") + public Optional getFont() { + return font; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingResponseContent && equalTo((UpdateBrandingResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingResponseContent other) { + return colors.equals(other.colors) + && faviconUrl.equals(other.faviconUrl) + && logoUrl.equals(other.logoUrl) + && font.equals(other.font); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional colors = Optional.empty(); + + private Optional faviconUrl = Optional.empty(); + + private Optional logoUrl = Optional.empty(); + + private Optional font = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBrandingResponseContent other) { + colors(other.getColors()); + faviconUrl(other.getFaviconUrl()); + logoUrl(other.getLogoUrl()); + font(other.getFont()); + return this; + } + + @JsonSetter(value = "colors", nulls = Nulls.SKIP) + public Builder colors(Optional colors) { + this.colors = colors; + return this; + } + + public Builder colors(BrandingColors colors) { + this.colors = Optional.ofNullable(colors); + return this; + } + + /** + *

URL for the favicon. Must use HTTPS.

+ */ + @JsonSetter(value = "favicon_url", nulls = Nulls.SKIP) + public Builder faviconUrl(Optional faviconUrl) { + this.faviconUrl = faviconUrl; + return this; + } + + public Builder faviconUrl(String faviconUrl) { + this.faviconUrl = Optional.ofNullable(faviconUrl); + return this; + } + + /** + *

URL for the logo. Must use HTTPS.

+ */ + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public Builder logoUrl(Optional logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + public Builder logoUrl(String logoUrl) { + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + @JsonSetter(value = "font", nulls = Nulls.SKIP) + public Builder font(Optional font) { + this.font = font; + return this; + } + + public Builder font(BrandingFont font) { + this.font = Optional.ofNullable(font); + return this; + } + + public UpdateBrandingResponseContent build() { + return new UpdateBrandingResponseContent(colors, faviconUrl, logoUrl, font, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java new file mode 100644 index 000000000..fe37d6c34 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBrandingThemeResponseContent.Builder.class) +public final class UpdateBrandingThemeResponseContent { + private final BrandingThemeBorders borders; + + private final BrandingThemeColors colors; + + private final String displayName; + + private final BrandingThemeFonts fonts; + + private final BrandingThemePageBackground pageBackground; + + private final String themeId; + + private final BrandingThemeWidget widget; + + private final Map additionalProperties; + + private UpdateBrandingThemeResponseContent( + BrandingThemeBorders borders, + BrandingThemeColors colors, + String displayName, + BrandingThemeFonts fonts, + BrandingThemePageBackground pageBackground, + String themeId, + BrandingThemeWidget widget, + Map additionalProperties) { + this.borders = borders; + this.colors = colors; + this.displayName = displayName; + this.fonts = fonts; + this.pageBackground = pageBackground; + this.themeId = themeId; + this.widget = widget; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("borders") + public BrandingThemeBorders getBorders() { + return borders; + } + + @JsonProperty("colors") + public BrandingThemeColors getColors() { + return colors; + } + + /** + * @return Display Name + */ + @JsonProperty("displayName") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("fonts") + public BrandingThemeFonts getFonts() { + return fonts; + } + + @JsonProperty("page_background") + public BrandingThemePageBackground getPageBackground() { + return pageBackground; + } + + /** + * @return Theme Id + */ + @JsonProperty("themeId") + public String getThemeId() { + return themeId; + } + + @JsonProperty("widget") + public BrandingThemeWidget getWidget() { + return widget; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBrandingThemeResponseContent + && equalTo((UpdateBrandingThemeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBrandingThemeResponseContent other) { + return borders.equals(other.borders) + && colors.equals(other.colors) + && displayName.equals(other.displayName) + && fonts.equals(other.fonts) + && pageBackground.equals(other.pageBackground) + && themeId.equals(other.themeId) + && widget.equals(other.widget); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.borders, + this.colors, + this.displayName, + this.fonts, + this.pageBackground, + this.themeId, + this.widget); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BordersStage builder() { + return new Builder(); + } + + public interface BordersStage { + ColorsStage borders(@NotNull BrandingThemeBorders borders); + + Builder from(UpdateBrandingThemeResponseContent other); + } + + public interface ColorsStage { + DisplayNameStage colors(@NotNull BrandingThemeColors colors); + } + + public interface DisplayNameStage { + /** + *

Display Name

+ */ + FontsStage displayName(@NotNull String displayName); + } + + public interface FontsStage { + PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts); + } + + public interface PageBackgroundStage { + ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground); + } + + public interface ThemeIdStage { + /** + *

Theme Id

+ */ + WidgetStage themeId(@NotNull String themeId); + } + + public interface WidgetStage { + _FinalStage widget(@NotNull BrandingThemeWidget widget); + } + + public interface _FinalStage { + UpdateBrandingThemeResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BordersStage, + ColorsStage, + DisplayNameStage, + FontsStage, + PageBackgroundStage, + ThemeIdStage, + WidgetStage, + _FinalStage { + private BrandingThemeBorders borders; + + private BrandingThemeColors colors; + + private String displayName; + + private BrandingThemeFonts fonts; + + private BrandingThemePageBackground pageBackground; + + private String themeId; + + private BrandingThemeWidget widget; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateBrandingThemeResponseContent other) { + borders(other.getBorders()); + colors(other.getColors()); + displayName(other.getDisplayName()); + fonts(other.getFonts()); + pageBackground(other.getPageBackground()); + themeId(other.getThemeId()); + widget(other.getWidget()); + return this; + } + + @java.lang.Override + @JsonSetter("borders") + public ColorsStage borders(@NotNull BrandingThemeBorders borders) { + this.borders = Objects.requireNonNull(borders, "borders must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("colors") + public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { + this.colors = Objects.requireNonNull(colors, "colors must not be null"); + return this; + } + + /** + *

Display Name

+ *

Display Name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("displayName") + public FontsStage displayName(@NotNull String displayName) { + this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("fonts") + public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { + this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("page_background") + public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { + this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); + return this; + } + + /** + *

Theme Id

+ *

Theme Id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("themeId") + public WidgetStage themeId(@NotNull String themeId) { + this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("widget") + public _FinalStage widget(@NotNull BrandingThemeWidget widget) { + this.widget = Objects.requireNonNull(widget, "widget must not be null"); + return this; + } + + @java.lang.Override + public UpdateBrandingThemeResponseContent build() { + return new UpdateBrandingThemeResponseContent( + borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java new file mode 100644 index 000000000..056a6b7d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBreachedPasswordDetectionSettingsResponseContent.Builder.class) +public final class UpdateBreachedPasswordDetectionSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> adminNotificationFrequency; + + private final Optional method; + + private final Optional stage; + + private final Map additionalProperties; + + private UpdateBreachedPasswordDetectionSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> adminNotificationFrequency, + Optional method, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.adminNotificationFrequency = adminNotificationFrequency; + this.method = method; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not breached password detection is active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>. + */ + @JsonProperty("admin_notification_frequency") + public Optional> getAdminNotificationFrequency() { + return adminNotificationFrequency; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBreachedPasswordDetectionSettingsResponseContent + && equalTo((UpdateBreachedPasswordDetectionSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBreachedPasswordDetectionSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && adminNotificationFrequency.equals(other.adminNotificationFrequency) + && method.equals(other.method) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> adminNotificationFrequency = + Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBreachedPasswordDetectionSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + adminNotificationFrequency(other.getAdminNotificationFrequency()); + method(other.getMethod()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not breached password detection is active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a breached password is detected during a login. + * Possible values: <code>block</code>, <code>user_notification</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

When "admin_notification" is enabled, determines how often email notifications are sent. + * Possible values: <code>immediately</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>.

+ */ + @JsonSetter(value = "admin_notification_frequency", nulls = Nulls.SKIP) + public Builder adminNotificationFrequency( + Optional> adminNotificationFrequency) { + this.adminNotificationFrequency = adminNotificationFrequency; + return this; + } + + public Builder adminNotificationFrequency( + List adminNotificationFrequency) { + this.adminNotificationFrequency = Optional.ofNullable(adminNotificationFrequency); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(BreachedPasswordDetectionMethodEnum method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(BreachedPasswordDetectionStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public UpdateBreachedPasswordDetectionSettingsResponseContent build() { + return new UpdateBreachedPasswordDetectionSettingsResponseContent( + enabled, shields, adminNotificationFrequency, method, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java new file mode 100644 index 000000000..f8277dcfb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBruteForceSettingsResponseContent.Builder.class) +public final class UpdateBruteForceSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional mode; + + private final Optional maxAttempts; + + private final Map additionalProperties; + + private UpdateBruteForceSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional mode, + Optional maxAttempts, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.mode = mode; + this.maxAttempts = maxAttempts; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not brute force attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + /** + * @return List of trusted IP addresses that will not have attack protection enforced against them. + */ + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + /** + * @return Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>. + */ + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + + /** + * @return Maximum number of unsuccessful attempts. + */ + @JsonProperty("max_attempts") + public Optional getMaxAttempts() { + return maxAttempts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBruteForceSettingsResponseContent + && equalTo((UpdateBruteForceSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBruteForceSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && mode.equals(other.mode) + && maxAttempts.equals(other.maxAttempts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional mode = Optional.empty(); + + private Optional maxAttempts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBruteForceSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + mode(other.getMode()); + maxAttempts(other.getMaxAttempts()); + return this; + } + + /** + *

Whether or not brute force attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a brute force protection threshold is violated. + * Possible values: <code>block</code>, <code>user_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + /** + *

List of trusted IP addresses that will not have attack protection enforced against them.

+ */ + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + /** + *

Account Lockout: Determines whether or not IP address is used when counting failed attempts. + * Possible values: <code>count_per_identifier_and_ip</code>, <code>count_per_identifier</code>.

+ */ + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(UpdateBruteForceSettingsResponseContentMode mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + /** + *

Maximum number of unsuccessful attempts.

+ */ + @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) + public Builder maxAttempts(Optional maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + public Builder maxAttempts(Integer maxAttempts) { + this.maxAttempts = Optional.ofNullable(maxAttempts); + return this; + } + + public UpdateBruteForceSettingsResponseContent build() { + return new UpdateBruteForceSettingsResponseContent( + enabled, shields, allowlist, mode, maxAttempts, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java new file mode 100644 index 000000000..bc1c4f841 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateBruteForceSettingsResponseContentMode { + public static final UpdateBruteForceSettingsResponseContentMode COUNT_PER_IDENTIFIER = + new UpdateBruteForceSettingsResponseContentMode(Value.COUNT_PER_IDENTIFIER, "count_per_identifier"); + + public static final UpdateBruteForceSettingsResponseContentMode COUNT_PER_IDENTIFIER_AND_IP = + new UpdateBruteForceSettingsResponseContentMode( + Value.COUNT_PER_IDENTIFIER_AND_IP, "count_per_identifier_and_ip"); + + private final Value value; + + private final String string; + + UpdateBruteForceSettingsResponseContentMode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateBruteForceSettingsResponseContentMode + && this.string.equals(((UpdateBruteForceSettingsResponseContentMode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COUNT_PER_IDENTIFIER: + return visitor.visitCountPerIdentifier(); + case COUNT_PER_IDENTIFIER_AND_IP: + return visitor.visitCountPerIdentifierAndIp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateBruteForceSettingsResponseContentMode valueOf(String value) { + switch (value) { + case "count_per_identifier": + return COUNT_PER_IDENTIFIER; + case "count_per_identifier_and_ip": + return COUNT_PER_IDENTIFIER_AND_IP; + default: + return new UpdateBruteForceSettingsResponseContentMode(Value.UNKNOWN, value); + } + } + + public enum Value { + COUNT_PER_IDENTIFIER_AND_IP, + + COUNT_PER_IDENTIFIER, + + UNKNOWN + } + + public interface Visitor { + T visitCountPerIdentifierAndIp(); + + T visitCountPerIdentifier(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java new file mode 100644 index 000000000..3780c4514 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateBruteForceSettingsResponseContentShieldsItem { + public static final UpdateBruteForceSettingsResponseContentShieldsItem BLOCK = + new UpdateBruteForceSettingsResponseContentShieldsItem(Value.BLOCK, "block"); + + public static final UpdateBruteForceSettingsResponseContentShieldsItem USER_NOTIFICATION = + new UpdateBruteForceSettingsResponseContentShieldsItem(Value.USER_NOTIFICATION, "user_notification"); + + private final Value value; + + private final String string; + + UpdateBruteForceSettingsResponseContentShieldsItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateBruteForceSettingsResponseContentShieldsItem + && this.string.equals(((UpdateBruteForceSettingsResponseContentShieldsItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case USER_NOTIFICATION: + return visitor.visitUserNotification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateBruteForceSettingsResponseContentShieldsItem valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "user_notification": + return USER_NOTIFICATION; + default: + return new UpdateBruteForceSettingsResponseContentShieldsItem(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + USER_NOTIFICATION, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitUserNotification(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java new file mode 100644 index 000000000..e630d129f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateClientGrantRequestContent.Builder.class) +public final class UpdateClientGrantRequestContent { + private final Optional> scope; + + private final OptionalNullable organizationUsage; + + private final OptionalNullable allowAnyOrganization; + + private final Map additionalProperties; + + private UpdateClientGrantRequestContent( + Optional> scope, + OptionalNullable organizationUsage, + OptionalNullable allowAnyOrganization, + Map additionalProperties) { + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.additionalProperties = additionalProperties; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_usage") + public OptionalNullable getOrganizationUsage() { + if (organizationUsage == null) { + return OptionalNullable.absent(); + } + return organizationUsage; + } + + /** + * @return Controls allowing any organization to be used with this grant + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_any_organization") + public OptionalNullable getAllowAnyOrganization() { + if (allowAnyOrganization == null) { + return OptionalNullable.absent(); + } + return allowAnyOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_usage") + private OptionalNullable _getOrganizationUsage() { + return organizationUsage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("allow_any_organization") + private OptionalNullable _getAllowAnyOrganization() { + return allowAnyOrganization; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateClientGrantRequestContent && equalTo((UpdateClientGrantRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateClientGrantRequestContent other) { + return scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.scope, this.organizationUsage, this.allowAnyOrganization); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> scope = Optional.empty(); + + private OptionalNullable organizationUsage = + OptionalNullable.absent(); + + private OptionalNullable allowAnyOrganization = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateClientGrantRequestContent other) { + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage( + @Nullable OptionalNullable organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientGrantOrganizationNullableUsageEnum organizationUsage) { + this.organizationUsage = OptionalNullable.of(organizationUsage); + return this; + } + + public Builder organizationUsage(Optional organizationUsage) { + if (organizationUsage.isPresent()) { + this.organizationUsage = OptionalNullable.of(organizationUsage.get()); + } else { + this.organizationUsage = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationUsage( + com.auth0.client.mgmt.core.Nullable organizationUsage) { + if (organizationUsage.isNull()) { + this.organizationUsage = OptionalNullable.ofNull(); + } else if (organizationUsage.isEmpty()) { + this.organizationUsage = OptionalNullable.absent(); + } else { + this.organizationUsage = OptionalNullable.of(organizationUsage.get()); + } + return this; + } + + /** + *

Controls allowing any organization to be used with this grant

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(@Nullable OptionalNullable allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization); + return this; + } + + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + if (allowAnyOrganization.isPresent()) { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization.get()); + } else { + this.allowAnyOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder allowAnyOrganization(com.auth0.client.mgmt.core.Nullable allowAnyOrganization) { + if (allowAnyOrganization.isNull()) { + this.allowAnyOrganization = OptionalNullable.ofNull(); + } else if (allowAnyOrganization.isEmpty()) { + this.allowAnyOrganization = OptionalNullable.absent(); + } else { + this.allowAnyOrganization = OptionalNullable.of(allowAnyOrganization.get()); + } + return this; + } + + public UpdateClientGrantRequestContent build() { + return new UpdateClientGrantRequestContent( + scope, organizationUsage, allowAnyOrganization, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java new file mode 100644 index 000000000..375538c5f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java @@ -0,0 +1,293 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateClientGrantResponseContent.Builder.class) +public final class UpdateClientGrantResponseContent { + private final Optional id; + + private final Optional clientId; + + private final Optional audience; + + private final Optional> scope; + + private final Optional organizationUsage; + + private final Optional allowAnyOrganization; + + private final Optional isSystem; + + private final Map additionalProperties; + + private UpdateClientGrantResponseContent( + Optional id, + Optional clientId, + Optional audience, + Optional> scope, + Optional organizationUsage, + Optional allowAnyOrganization, + Optional isSystem, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.audience = audience; + this.scope = scope; + this.organizationUsage = organizationUsage; + this.allowAnyOrganization = allowAnyOrganization; + this.isSystem = isSystem; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the client grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The audience (API identifier) of this client grant. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes allowed for this client grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + /** + * @return If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. + */ + @JsonProperty("allow_any_organization") + public Optional getAllowAnyOrganization() { + return allowAnyOrganization; + } + + /** + * @return If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly. + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateClientGrantResponseContent && equalTo((UpdateClientGrantResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateClientGrantResponseContent other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && audience.equals(other.audience) + && scope.equals(other.scope) + && organizationUsage.equals(other.organizationUsage) + && allowAnyOrganization.equals(other.allowAnyOrganization) + && isSystem.equals(other.isSystem); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.clientId, + this.audience, + this.scope, + this.organizationUsage, + this.allowAnyOrganization, + this.isSystem); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional organizationUsage = Optional.empty(); + + private Optional allowAnyOrganization = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateClientGrantResponseContent other) { + id(other.getId()); + clientId(other.getClientId()); + audience(other.getAudience()); + scope(other.getScope()); + organizationUsage(other.getOrganizationUsage()); + allowAnyOrganization(other.getAllowAnyOrganization()); + isSystem(other.getIsSystem()); + return this; + } + + /** + *

ID of the client grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The audience (API identifier) of this client grant.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes allowed for this client grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + /** + *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

+ */ + @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) + public Builder allowAnyOrganization(Optional allowAnyOrganization) { + this.allowAnyOrganization = allowAnyOrganization; + return this; + } + + public Builder allowAnyOrganization(Boolean allowAnyOrganization) { + this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); + return this; + } + + /** + *

If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + public UpdateClientGrantResponseContent build() { + return new UpdateClientGrantResponseContent( + id, + clientId, + audience, + scope, + organizationUsage, + allowAnyOrganization, + isSystem, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java new file mode 100644 index 000000000..d7088814c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java @@ -0,0 +1,1742 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateClientRequestContent.Builder.class) +public final class UpdateClientRequestContent { + private final Optional name; + + private final Optional description; + + private final Optional clientSecret; + + private final Optional logoUri; + + private final Optional> callbacks; + + private final Optional oidcLogout; + + private final Optional oidcBackchannelLogout; + + private final OptionalNullable sessionTransfer; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> grantTypes; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final Optional jwtConfiguration; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional crossOriginAuthentication; + + private final OptionalNullable crossOriginLoc; + + private final Optional ssoDisabled; + + private final Optional customLoginPageOn; + + private final OptionalNullable tokenEndpointAuthMethod; + + private final Optional appType; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final OptionalNullable tokenQuota; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final Optional nativeSocialLogin; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final OptionalNullable organizationUsage; + + private final OptionalNullable organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Map additionalProperties; + + private UpdateClientRequestContent( + Optional name, + Optional description, + Optional clientSecret, + Optional logoUri, + Optional> callbacks, + Optional oidcLogout, + Optional oidcBackchannelLogout, + OptionalNullable sessionTransfer, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> grantTypes, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + Optional jwtConfiguration, + OptionalNullable encryptionKey, + Optional sso, + Optional crossOriginAuthentication, + OptionalNullable crossOriginLoc, + Optional ssoDisabled, + Optional customLoginPageOn, + OptionalNullable tokenEndpointAuthMethod, + Optional appType, + Optional isFirstParty, + Optional oidcConformant, + Optional customLoginPage, + Optional customLoginPagePreview, + OptionalNullable tokenQuota, + Optional formTemplate, + Optional addons, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + Optional nativeSocialLogin, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + OptionalNullable organizationUsage, + OptionalNullable organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Map additionalProperties) { + this.name = name; + this.description = description; + this.clientSecret = clientSecret; + this.logoUri = logoUri; + this.callbacks = callbacks; + this.oidcLogout = oidcLogout; + this.oidcBackchannelLogout = oidcBackchannelLogout; + this.sessionTransfer = sessionTransfer; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.grantTypes = grantTypes; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.jwtConfiguration = jwtConfiguration; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.ssoDisabled = ssoDisabled; + this.customLoginPageOn = customLoginPageOn; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.appType = appType; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.tokenQuota = tokenQuota; + this.formTemplate = formTemplate; + this.addons = addons; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.nativeSocialLogin = nativeSocialLogin; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the client. Must contain at least one character. Does not allow '<' or '>'. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of the purpose of the Client. (Max character length: <code>140</code>) + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The secret used to sign tokens for the client + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return The URL of the client logo (recommended size: 150x150) + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return A set of URLs that are valid to call back from Auth0 when authenticating users + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + @JsonProperty("oidc_backchannel_logout") + public Optional getOidcBackchannelLogout() { + return oidcBackchannelLogout; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + /** + * @return A set of URLs that represents valid origins for CORS + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return A set of URLs that represents valid web origins for use with web message response mode + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + /** + * @return List of audiences for SAML protocol + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return URLs that are valid to redirect to after logout from Auth0. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return <code>true</code> to use Auth0 instead of the IdP to do Single Sign On, <code>false</code> otherwise (default: <code>false</code>) + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return <code>true</code> if this client can be used to make cross-origin authentication requests, <code>false</code> otherwise if cross origin is disabled + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL for the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cross_origin_loc") + public OptionalNullable getCrossOriginLoc() { + if (crossOriginLoc == null) { + return OptionalNullable.absent(); + } + return crossOriginLoc; + } + + /** + * @return <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>) + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return <code>true</code> if the custom login page is to be used, <code>false</code> otherwise. + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + public OptionalNullable getTokenEndpointAuthMethod() { + if (tokenEndpointAuthMethod == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthMethod; + } + + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return Whether this client a first party client or not + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client will conform to strict OIDC specifications + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_quota") + public OptionalNullable getTokenQuota() { + if (tokenQuota == null) { + return OptionalNullable.absent(); + } + return tokenQuota; + } + + /** + * @return Form template for WS-Federation protocol + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonProperty("native_social_login") + public Optional getNativeSocialLogin() { + return nativeSocialLogin; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_usage") + public OptionalNullable getOrganizationUsage() { + if (organizationUsage == null) { + return OptionalNullable.absent(); + } + return organizationUsage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_require_behavior") + public OptionalNullable getOrganizationRequireBehavior() { + if (organizationRequireBehavior == null) { + return OptionalNullable.absent(); + } + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cross_origin_loc") + private OptionalNullable _getCrossOriginLoc() { + return crossOriginLoc; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + private OptionalNullable _getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_quota") + private OptionalNullable _getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_usage") + private OptionalNullable _getOrganizationUsage() { + return organizationUsage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_require_behavior") + private OptionalNullable _getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateClientRequestContent && equalTo((UpdateClientRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateClientRequestContent other) { + return name.equals(other.name) + && description.equals(other.description) + && clientSecret.equals(other.clientSecret) + && logoUri.equals(other.logoUri) + && callbacks.equals(other.callbacks) + && oidcLogout.equals(other.oidcLogout) + && oidcBackchannelLogout.equals(other.oidcBackchannelLogout) + && sessionTransfer.equals(other.sessionTransfer) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && grantTypes.equals(other.grantTypes) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && jwtConfiguration.equals(other.jwtConfiguration) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && ssoDisabled.equals(other.ssoDisabled) + && customLoginPageOn.equals(other.customLoginPageOn) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && appType.equals(other.appType) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && tokenQuota.equals(other.tokenQuota) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && nativeSocialLogin.equals(other.nativeSocialLogin) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.description, + this.clientSecret, + this.logoUri, + this.callbacks, + this.oidcLogout, + this.oidcBackchannelLogout, + this.sessionTransfer, + this.allowedOrigins, + this.webOrigins, + this.grantTypes, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.jwtConfiguration, + this.encryptionKey, + this.sso, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.ssoDisabled, + this.customLoginPageOn, + this.tokenEndpointAuthMethod, + this.appType, + this.isFirstParty, + this.oidcConformant, + this.customLoginPage, + this.customLoginPagePreview, + this.tokenQuota, + this.formTemplate, + this.addons, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.nativeSocialLogin, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional oidcLogout = Optional.empty(); + + private Optional oidcBackchannelLogout = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private OptionalNullable crossOriginLoc = OptionalNullable.absent(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private OptionalNullable tokenEndpointAuthMethod = + OptionalNullable.absent(); + + private Optional appType = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private OptionalNullable tokenQuota = OptionalNullable.absent(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private Optional nativeSocialLogin = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private OptionalNullable organizationUsage = OptionalNullable.absent(); + + private OptionalNullable organizationRequireBehavior = + OptionalNullable.absent(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateClientRequestContent other) { + name(other.getName()); + description(other.getDescription()); + clientSecret(other.getClientSecret()); + logoUri(other.getLogoUri()); + callbacks(other.getCallbacks()); + oidcLogout(other.getOidcLogout()); + oidcBackchannelLogout(other.getOidcBackchannelLogout()); + sessionTransfer(other.getSessionTransfer()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + grantTypes(other.getGrantTypes()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + jwtConfiguration(other.getJwtConfiguration()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + ssoDisabled(other.getSsoDisabled()); + customLoginPageOn(other.getCustomLoginPageOn()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + appType(other.getAppType()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + tokenQuota(other.getTokenQuota()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + nativeSocialLogin(other.getNativeSocialLogin()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + return this; + } + + /** + *

The name of the client. Must contain at least one character. Does not allow '<' or '>'.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of the purpose of the Client. (Max character length: <code>140</code>)

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

The secret used to sign tokens for the client

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

The URL of the client logo (recommended size: 150x150)

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

A set of URLs that are valid to call back from Auth0 when authenticating users

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + @JsonSetter(value = "oidc_backchannel_logout", nulls = Nulls.SKIP) + public Builder oidcBackchannelLogout(Optional oidcBackchannelLogout) { + this.oidcBackchannelLogout = oidcBackchannelLogout; + return this; + } + + public Builder oidcBackchannelLogout(ClientOidcBackchannelLogoutSettings oidcBackchannelLogout) { + this.oidcBackchannelLogout = Optional.ofNullable(oidcBackchannelLogout); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + /** + *

A set of URLs that represents valid origins for CORS

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

A set of URLs that represents valid web origins for use with web message response mode

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + /** + *

List of audiences for SAML protocol

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

URLs that are valid to redirect to after logout from Auth0.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

<code>true</code> to use Auth0 instead of the IdP to do Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

<code>true</code> if this client can be used to make cross-origin authentication requests, <code>false</code> otherwise if cross origin is disabled

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL for the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(@Nullable OptionalNullable crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = OptionalNullable.of(crossOriginLoc); + return this; + } + + public Builder crossOriginLoc(Optional crossOriginLoc) { + if (crossOriginLoc.isPresent()) { + this.crossOriginLoc = OptionalNullable.of(crossOriginLoc.get()); + } else { + this.crossOriginLoc = OptionalNullable.absent(); + } + return this; + } + + public Builder crossOriginLoc(com.auth0.client.mgmt.core.Nullable crossOriginLoc) { + if (crossOriginLoc.isNull()) { + this.crossOriginLoc = OptionalNullable.ofNull(); + } else if (crossOriginLoc.isEmpty()) { + this.crossOriginLoc = OptionalNullable.absent(); + } else { + this.crossOriginLoc = OptionalNullable.of(crossOriginLoc.get()); + } + return this; + } + + /** + *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise.

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodOrNullEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); + return this; + } + + public Builder tokenEndpointAuthMethod( + Optional tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isPresent()) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isNull()) { + this.tokenEndpointAuthMethod = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthMethod.isEmpty()) { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } + return this; + } + + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(ClientAppTypeEnum appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

Whether this client a first party client or not

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client will conform to strict OIDC specifications

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(@Nullable OptionalNullable tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(UpdateTokenQuota tokenQuota) { + this.tokenQuota = OptionalNullable.of(tokenQuota); + return this; + } + + public Builder tokenQuota(Optional tokenQuota) { + if (tokenQuota.isPresent()) { + this.tokenQuota = OptionalNullable.of(tokenQuota.get()); + } else { + this.tokenQuota = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenQuota(com.auth0.client.mgmt.core.Nullable tokenQuota) { + if (tokenQuota.isNull()) { + this.tokenQuota = OptionalNullable.ofNull(); + } else if (tokenQuota.isEmpty()) { + this.tokenQuota = OptionalNullable.absent(); + } else { + this.tokenQuota = OptionalNullable.of(tokenQuota.get()); + } + return this; + } + + /** + *

Form template for WS-Federation protocol

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "native_social_login", nulls = Nulls.SKIP) + public Builder nativeSocialLogin(Optional nativeSocialLogin) { + this.nativeSocialLogin = nativeSocialLogin; + return this; + } + + public Builder nativeSocialLogin(NativeSocialLogin nativeSocialLogin) { + this.nativeSocialLogin = Optional.ofNullable(nativeSocialLogin); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage( + @Nullable OptionalNullable organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsagePatchEnum organizationUsage) { + this.organizationUsage = OptionalNullable.of(organizationUsage); + return this; + } + + public Builder organizationUsage(Optional organizationUsage) { + if (organizationUsage.isPresent()) { + this.organizationUsage = OptionalNullable.of(organizationUsage.get()); + } else { + this.organizationUsage = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationUsage( + com.auth0.client.mgmt.core.Nullable organizationUsage) { + if (organizationUsage.isNull()) { + this.organizationUsage = OptionalNullable.ofNull(); + } else if (organizationUsage.isEmpty()) { + this.organizationUsage = OptionalNullable.absent(); + } else { + this.organizationUsage = OptionalNullable.of(organizationUsage.get()); + } + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + @Nullable OptionalNullable organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior( + ClientOrganizationRequireBehaviorPatchEnum organizationRequireBehavior) { + this.organizationRequireBehavior = OptionalNullable.of(organizationRequireBehavior); + return this; + } + + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + if (organizationRequireBehavior.isPresent()) { + this.organizationRequireBehavior = OptionalNullable.of(organizationRequireBehavior.get()); + } else { + this.organizationRequireBehavior = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationRequireBehavior( + com.auth0.client.mgmt.core.Nullable + organizationRequireBehavior) { + if (organizationRequireBehavior.isNull()) { + this.organizationRequireBehavior = OptionalNullable.ofNull(); + } else if (organizationRequireBehavior.isEmpty()) { + this.organizationRequireBehavior = OptionalNullable.absent(); + } else { + this.organizationRequireBehavior = OptionalNullable.of(organizationRequireBehavior.get()); + } + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + public UpdateClientRequestContent build() { + return new UpdateClientRequestContent( + name, + description, + clientSecret, + logoUri, + callbacks, + oidcLogout, + oidcBackchannelLogout, + sessionTransfer, + allowedOrigins, + webOrigins, + grantTypes, + clientAliases, + allowedClients, + allowedLogoutUrls, + jwtConfiguration, + encryptionKey, + sso, + crossOriginAuthentication, + crossOriginLoc, + ssoDisabled, + customLoginPageOn, + tokenEndpointAuthMethod, + appType, + isFirstParty, + oidcConformant, + customLoginPage, + customLoginPagePreview, + tokenQuota, + formTemplate, + addons, + clientMetadata, + mobile, + initiateLoginUri, + nativeSocialLogin, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java new file mode 100644 index 000000000..e49b55584 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java @@ -0,0 +1,1663 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateClientResponseContent.Builder.class) +public final class UpdateClientResponseContent { + private final Optional clientId; + + private final Optional tenant; + + private final Optional name; + + private final Optional description; + + private final Optional global; + + private final Optional clientSecret; + + private final Optional appType; + + private final Optional logoUri; + + private final Optional isFirstParty; + + private final Optional oidcConformant; + + private final Optional> callbacks; + + private final Optional> allowedOrigins; + + private final Optional> webOrigins; + + private final Optional> clientAliases; + + private final Optional> allowedClients; + + private final Optional> allowedLogoutUrls; + + private final OptionalNullable sessionTransfer; + + private final Optional oidcLogout; + + private final Optional> grantTypes; + + private final Optional jwtConfiguration; + + private final Optional> signingKeys; + + private final OptionalNullable encryptionKey; + + private final Optional sso; + + private final Optional ssoDisabled; + + private final Optional crossOriginAuthentication; + + private final Optional crossOriginLoc; + + private final Optional customLoginPageOn; + + private final Optional customLoginPage; + + private final Optional customLoginPagePreview; + + private final Optional formTemplate; + + private final Optional addons; + + private final Optional tokenEndpointAuthMethod; + + private final Optional> clientMetadata; + + private final Optional mobile; + + private final Optional initiateLoginUri; + + private final OptionalNullable refreshToken; + + private final OptionalNullable defaultOrganization; + + private final Optional organizationUsage; + + private final Optional organizationRequireBehavior; + + private final OptionalNullable clientAuthenticationMethods; + + private final Optional requirePushedAuthorizationRequests; + + private final Optional requireProofOfPossession; + + private final Optional signedRequestObject; + + private final OptionalNullable complianceLevel; + + private final OptionalNullable parRequestExpiry; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private UpdateClientResponseContent( + Optional clientId, + Optional tenant, + Optional name, + Optional description, + Optional global, + Optional clientSecret, + Optional appType, + Optional logoUri, + Optional isFirstParty, + Optional oidcConformant, + Optional> callbacks, + Optional> allowedOrigins, + Optional> webOrigins, + Optional> clientAliases, + Optional> allowedClients, + Optional> allowedLogoutUrls, + OptionalNullable sessionTransfer, + Optional oidcLogout, + Optional> grantTypes, + Optional jwtConfiguration, + Optional> signingKeys, + OptionalNullable encryptionKey, + Optional sso, + Optional ssoDisabled, + Optional crossOriginAuthentication, + Optional crossOriginLoc, + Optional customLoginPageOn, + Optional customLoginPage, + Optional customLoginPagePreview, + Optional formTemplate, + Optional addons, + Optional tokenEndpointAuthMethod, + Optional> clientMetadata, + Optional mobile, + Optional initiateLoginUri, + OptionalNullable refreshToken, + OptionalNullable defaultOrganization, + Optional organizationUsage, + Optional organizationRequireBehavior, + OptionalNullable clientAuthenticationMethods, + Optional requirePushedAuthorizationRequests, + Optional requireProofOfPossession, + Optional signedRequestObject, + OptionalNullable complianceLevel, + OptionalNullable parRequestExpiry, + Optional tokenQuota, + Map additionalProperties) { + this.clientId = clientId; + this.tenant = tenant; + this.name = name; + this.description = description; + this.global = global; + this.clientSecret = clientSecret; + this.appType = appType; + this.logoUri = logoUri; + this.isFirstParty = isFirstParty; + this.oidcConformant = oidcConformant; + this.callbacks = callbacks; + this.allowedOrigins = allowedOrigins; + this.webOrigins = webOrigins; + this.clientAliases = clientAliases; + this.allowedClients = allowedClients; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionTransfer = sessionTransfer; + this.oidcLogout = oidcLogout; + this.grantTypes = grantTypes; + this.jwtConfiguration = jwtConfiguration; + this.signingKeys = signingKeys; + this.encryptionKey = encryptionKey; + this.sso = sso; + this.ssoDisabled = ssoDisabled; + this.crossOriginAuthentication = crossOriginAuthentication; + this.crossOriginLoc = crossOriginLoc; + this.customLoginPageOn = customLoginPageOn; + this.customLoginPage = customLoginPage; + this.customLoginPagePreview = customLoginPagePreview; + this.formTemplate = formTemplate; + this.addons = addons; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.clientMetadata = clientMetadata; + this.mobile = mobile; + this.initiateLoginUri = initiateLoginUri; + this.refreshToken = refreshToken; + this.defaultOrganization = defaultOrganization; + this.organizationUsage = organizationUsage; + this.organizationRequireBehavior = organizationRequireBehavior; + this.clientAuthenticationMethods = clientAuthenticationMethods; + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + this.requireProofOfPossession = requireProofOfPossession; + this.signedRequestObject = signedRequestObject; + this.complianceLevel = complianceLevel; + this.parRequestExpiry = parRequestExpiry; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this client. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return Name of the tenant this client belongs to. + */ + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + /** + * @return Name of this client (min length: 1 character, does not allow < or >). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Free text description of this client (max length: 140 characters). + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). + */ + @JsonProperty("global") + public Optional getGlobal() { + return global; + } + + /** + * @return Client secret (which you must not make public). + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. + */ + @JsonProperty("app_type") + public Optional getAppType() { + return appType; + } + + /** + * @return URL of the logo to display for this client. Recommended size is 150x150 pixels. + */ + @JsonProperty("logo_uri") + public Optional getLogoUri() { + return logoUri; + } + + /** + * @return Whether this client a first party client (true) or not (false). + */ + @JsonProperty("is_first_party") + public Optional getIsFirstParty() { + return isFirstParty; + } + + /** + * @return Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false). + */ + @JsonProperty("oidc_conformant") + public Optional getOidcConformant() { + return oidcConformant; + } + + /** + * @return Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication. + */ + @JsonProperty("callbacks") + public Optional> getCallbacks() { + return callbacks; + } + + /** + * @return Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. + */ + @JsonProperty("allowed_origins") + public Optional> getAllowedOrigins() { + return allowedOrigins; + } + + /** + * @return Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>. + */ + @JsonProperty("web_origins") + public Optional> getWebOrigins() { + return webOrigins; + } + + /** + * @return List of audiences/realms for SAML protocol. Used by the wsfed addon. + */ + @JsonProperty("client_aliases") + public Optional> getClientAliases() { + return clientAliases; + } + + /** + * @return List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed. + */ + @JsonProperty("allowed_clients") + public Optional> getAllowedClients() { + return allowedClients; + } + + /** + * @return Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + public OptionalNullable getSessionTransfer() { + if (sessionTransfer == null) { + return OptionalNullable.absent(); + } + return sessionTransfer; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + */ + @JsonProperty("grant_types") + public Optional> getGrantTypes() { + return grantTypes; + } + + @JsonProperty("jwt_configuration") + public Optional getJwtConfiguration() { + return jwtConfiguration; + } + + @JsonProperty("signing_keys") + public Optional> getSigningKeys() { + return signingKeys; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + public OptionalNullable getEncryptionKey() { + if (encryptionKey == null) { + return OptionalNullable.absent(); + } + return encryptionKey; + } + + /** + * @return Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false). + */ + @JsonProperty("sso") + public Optional getSso() { + return sso; + } + + /** + * @return Whether Single Sign On is disabled (true) or enabled (true). Defaults to true. + */ + @JsonProperty("sso_disabled") + public Optional getSsoDisabled() { + return ssoDisabled; + } + + /** + * @return Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). + */ + @JsonProperty("cross_origin_authentication") + public Optional getCrossOriginAuthentication() { + return crossOriginAuthentication; + } + + /** + * @return URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + @JsonProperty("cross_origin_loc") + public Optional getCrossOriginLoc() { + return crossOriginLoc; + } + + /** + * @return Whether a custom login page is to be used (true) or the default provided login page (false). + */ + @JsonProperty("custom_login_page_on") + public Optional getCustomLoginPageOn() { + return customLoginPageOn; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. + */ + @JsonProperty("custom_login_page") + public Optional getCustomLoginPage() { + return customLoginPage; + } + + /** + * @return The content (HTML, CSS, JS) of the custom login page. (Used on Previews) + */ + @JsonProperty("custom_login_page_preview") + public Optional getCustomLoginPagePreview() { + return customLoginPagePreview; + } + + /** + * @return HTML form template to be used for WS-Federation. + */ + @JsonProperty("form_template") + public Optional getFormTemplate() { + return formTemplate; + } + + @JsonProperty("addons") + public Optional getAddons() { + return addons; + } + + @JsonProperty("token_endpoint_auth_method") + public Optional getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonProperty("client_metadata") + public Optional> getClientMetadata() { + return clientMetadata; + } + + @JsonProperty("mobile") + public Optional getMobile() { + return mobile; + } + + /** + * @return Initiate login uri, must be https + */ + @JsonProperty("initiate_login_uri") + public Optional getInitiateLoginUri() { + return initiateLoginUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + public OptionalNullable getRefreshToken() { + if (refreshToken == null) { + return OptionalNullable.absent(); + } + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + public OptionalNullable getDefaultOrganization() { + if (defaultOrganization == null) { + return OptionalNullable.absent(); + } + return defaultOrganization; + } + + @JsonProperty("organization_usage") + public Optional getOrganizationUsage() { + return organizationUsage; + } + + @JsonProperty("organization_require_behavior") + public Optional getOrganizationRequireBehavior() { + return organizationRequireBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + public OptionalNullable getClientAuthenticationMethods() { + if (clientAuthenticationMethods == null) { + return OptionalNullable.absent(); + } + return clientAuthenticationMethods; + } + + /** + * @return Makes the use of Pushed Authorization Requests mandatory for this client + */ + @JsonProperty("require_pushed_authorization_requests") + public Optional getRequirePushedAuthorizationRequests() { + return requirePushedAuthorizationRequests; + } + + /** + * @return Makes the use of Proof-of-Possession mandatory for this client + */ + @JsonProperty("require_proof_of_possession") + public Optional getRequireProofOfPossession() { + return requireProofOfPossession; + } + + @JsonProperty("signed_request_object") + public Optional getSignedRequestObject() { + return signedRequestObject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + public OptionalNullable getComplianceLevel() { + if (complianceLevel == null) { + return OptionalNullable.absent(); + } + return complianceLevel; + } + + /** + * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + public OptionalNullable getParRequestExpiry() { + if (parRequestExpiry == null) { + return OptionalNullable.absent(); + } + return parRequestExpiry; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_transfer") + private OptionalNullable _getSessionTransfer() { + return sessionTransfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encryption_key") + private OptionalNullable _getEncryptionKey() { + return encryptionKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token") + private OptionalNullable _getRefreshToken() { + return refreshToken; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_organization") + private OptionalNullable _getDefaultOrganization() { + return defaultOrganization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_authentication_methods") + private OptionalNullable _getClientAuthenticationMethods() { + return clientAuthenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("compliance_level") + private OptionalNullable _getComplianceLevel() { + return complianceLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("par_request_expiry") + private OptionalNullable _getParRequestExpiry() { + return parRequestExpiry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateClientResponseContent && equalTo((UpdateClientResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateClientResponseContent other) { + return clientId.equals(other.clientId) + && tenant.equals(other.tenant) + && name.equals(other.name) + && description.equals(other.description) + && global.equals(other.global) + && clientSecret.equals(other.clientSecret) + && appType.equals(other.appType) + && logoUri.equals(other.logoUri) + && isFirstParty.equals(other.isFirstParty) + && oidcConformant.equals(other.oidcConformant) + && callbacks.equals(other.callbacks) + && allowedOrigins.equals(other.allowedOrigins) + && webOrigins.equals(other.webOrigins) + && clientAliases.equals(other.clientAliases) + && allowedClients.equals(other.allowedClients) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionTransfer.equals(other.sessionTransfer) + && oidcLogout.equals(other.oidcLogout) + && grantTypes.equals(other.grantTypes) + && jwtConfiguration.equals(other.jwtConfiguration) + && signingKeys.equals(other.signingKeys) + && encryptionKey.equals(other.encryptionKey) + && sso.equals(other.sso) + && ssoDisabled.equals(other.ssoDisabled) + && crossOriginAuthentication.equals(other.crossOriginAuthentication) + && crossOriginLoc.equals(other.crossOriginLoc) + && customLoginPageOn.equals(other.customLoginPageOn) + && customLoginPage.equals(other.customLoginPage) + && customLoginPagePreview.equals(other.customLoginPagePreview) + && formTemplate.equals(other.formTemplate) + && addons.equals(other.addons) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && clientMetadata.equals(other.clientMetadata) + && mobile.equals(other.mobile) + && initiateLoginUri.equals(other.initiateLoginUri) + && refreshToken.equals(other.refreshToken) + && defaultOrganization.equals(other.defaultOrganization) + && organizationUsage.equals(other.organizationUsage) + && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) + && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) + && requireProofOfPossession.equals(other.requireProofOfPossession) + && signedRequestObject.equals(other.signedRequestObject) + && complianceLevel.equals(other.complianceLevel) + && parRequestExpiry.equals(other.parRequestExpiry) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.tenant, + this.name, + this.description, + this.global, + this.clientSecret, + this.appType, + this.logoUri, + this.isFirstParty, + this.oidcConformant, + this.callbacks, + this.allowedOrigins, + this.webOrigins, + this.clientAliases, + this.allowedClients, + this.allowedLogoutUrls, + this.sessionTransfer, + this.oidcLogout, + this.grantTypes, + this.jwtConfiguration, + this.signingKeys, + this.encryptionKey, + this.sso, + this.ssoDisabled, + this.crossOriginAuthentication, + this.crossOriginLoc, + this.customLoginPageOn, + this.customLoginPage, + this.customLoginPagePreview, + this.formTemplate, + this.addons, + this.tokenEndpointAuthMethod, + this.clientMetadata, + this.mobile, + this.initiateLoginUri, + this.refreshToken, + this.defaultOrganization, + this.organizationUsage, + this.organizationRequireBehavior, + this.clientAuthenticationMethods, + this.requirePushedAuthorizationRequests, + this.requireProofOfPossession, + this.signedRequestObject, + this.complianceLevel, + this.parRequestExpiry, + this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientId = Optional.empty(); + + private Optional tenant = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional global = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional appType = Optional.empty(); + + private Optional logoUri = Optional.empty(); + + private Optional isFirstParty = Optional.empty(); + + private Optional oidcConformant = Optional.empty(); + + private Optional> callbacks = Optional.empty(); + + private Optional> allowedOrigins = Optional.empty(); + + private Optional> webOrigins = Optional.empty(); + + private Optional> clientAliases = Optional.empty(); + + private Optional> allowedClients = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private OptionalNullable sessionTransfer = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional> grantTypes = Optional.empty(); + + private Optional jwtConfiguration = Optional.empty(); + + private Optional> signingKeys = Optional.empty(); + + private OptionalNullable encryptionKey = OptionalNullable.absent(); + + private Optional sso = Optional.empty(); + + private Optional ssoDisabled = Optional.empty(); + + private Optional crossOriginAuthentication = Optional.empty(); + + private Optional crossOriginLoc = Optional.empty(); + + private Optional customLoginPageOn = Optional.empty(); + + private Optional customLoginPage = Optional.empty(); + + private Optional customLoginPagePreview = Optional.empty(); + + private Optional formTemplate = Optional.empty(); + + private Optional addons = Optional.empty(); + + private Optional tokenEndpointAuthMethod = Optional.empty(); + + private Optional> clientMetadata = Optional.empty(); + + private Optional mobile = Optional.empty(); + + private Optional initiateLoginUri = Optional.empty(); + + private OptionalNullable refreshToken = OptionalNullable.absent(); + + private OptionalNullable defaultOrganization = OptionalNullable.absent(); + + private Optional organizationUsage = Optional.empty(); + + private Optional organizationRequireBehavior = Optional.empty(); + + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); + + private Optional requirePushedAuthorizationRequests = Optional.empty(); + + private Optional requireProofOfPossession = Optional.empty(); + + private Optional signedRequestObject = Optional.empty(); + + private OptionalNullable complianceLevel = OptionalNullable.absent(); + + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateClientResponseContent other) { + clientId(other.getClientId()); + tenant(other.getTenant()); + name(other.getName()); + description(other.getDescription()); + global(other.getGlobal()); + clientSecret(other.getClientSecret()); + appType(other.getAppType()); + logoUri(other.getLogoUri()); + isFirstParty(other.getIsFirstParty()); + oidcConformant(other.getOidcConformant()); + callbacks(other.getCallbacks()); + allowedOrigins(other.getAllowedOrigins()); + webOrigins(other.getWebOrigins()); + clientAliases(other.getClientAliases()); + allowedClients(other.getAllowedClients()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionTransfer(other.getSessionTransfer()); + oidcLogout(other.getOidcLogout()); + grantTypes(other.getGrantTypes()); + jwtConfiguration(other.getJwtConfiguration()); + signingKeys(other.getSigningKeys()); + encryptionKey(other.getEncryptionKey()); + sso(other.getSso()); + ssoDisabled(other.getSsoDisabled()); + crossOriginAuthentication(other.getCrossOriginAuthentication()); + crossOriginLoc(other.getCrossOriginLoc()); + customLoginPageOn(other.getCustomLoginPageOn()); + customLoginPage(other.getCustomLoginPage()); + customLoginPagePreview(other.getCustomLoginPagePreview()); + formTemplate(other.getFormTemplate()); + addons(other.getAddons()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + clientMetadata(other.getClientMetadata()); + mobile(other.getMobile()); + initiateLoginUri(other.getInitiateLoginUri()); + refreshToken(other.getRefreshToken()); + defaultOrganization(other.getDefaultOrganization()); + organizationUsage(other.getOrganizationUsage()); + organizationRequireBehavior(other.getOrganizationRequireBehavior()); + clientAuthenticationMethods(other.getClientAuthenticationMethods()); + requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); + requireProofOfPossession(other.getRequireProofOfPossession()); + signedRequestObject(other.getSignedRequestObject()); + complianceLevel(other.getComplianceLevel()); + parRequestExpiry(other.getParRequestExpiry()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

ID of this client.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

Name of the tenant this client belongs to.

+ */ + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public Builder tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + public Builder tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + /** + *

Name of this client (min length: 1 character, does not allow < or >).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Free text description of this client (max length: 140 characters).

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).

+ */ + @JsonSetter(value = "global", nulls = Nulls.SKIP) + public Builder global(Optional global) { + this.global = global; + return this; + } + + public Builder global(Boolean global) { + this.global = Optional.ofNullable(global); + return this; + } + + /** + *

Client secret (which you must not make public).

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

+ */ + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) + public Builder appType(Optional appType) { + this.appType = appType; + return this; + } + + public Builder appType(String appType) { + this.appType = Optional.ofNullable(appType); + return this; + } + + /** + *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

+ */ + @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) + public Builder logoUri(Optional logoUri) { + this.logoUri = logoUri; + return this; + } + + public Builder logoUri(String logoUri) { + this.logoUri = Optional.ofNullable(logoUri); + return this; + } + + /** + *

Whether this client a first party client (true) or not (false).

+ */ + @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) + public Builder isFirstParty(Optional isFirstParty) { + this.isFirstParty = isFirstParty; + return this; + } + + public Builder isFirstParty(Boolean isFirstParty) { + this.isFirstParty = Optional.ofNullable(isFirstParty); + return this; + } + + /** + *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

+ */ + @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) + public Builder oidcConformant(Optional oidcConformant) { + this.oidcConformant = oidcConformant; + return this; + } + + public Builder oidcConformant(Boolean oidcConformant) { + this.oidcConformant = Optional.ofNullable(oidcConformant); + return this; + } + + /** + *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

+ */ + @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) + public Builder callbacks(Optional> callbacks) { + this.callbacks = callbacks; + return this; + } + + public Builder callbacks(List callbacks) { + this.callbacks = Optional.ofNullable(callbacks); + return this; + } + + /** + *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

+ */ + @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) + public Builder allowedOrigins(Optional> allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + public Builder allowedOrigins(List allowedOrigins) { + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

+ */ + @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) + public Builder webOrigins(Optional> webOrigins) { + this.webOrigins = webOrigins; + return this; + } + + public Builder webOrigins(List webOrigins) { + this.webOrigins = Optional.ofNullable(webOrigins); + return this; + } + + /** + *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

+ */ + @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) + public Builder clientAliases(Optional> clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + public Builder clientAliases(List clientAliases) { + this.clientAliases = Optional.ofNullable(clientAliases); + return this; + } + + /** + *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

+ */ + @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) + public Builder allowedClients(Optional> allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + public Builder allowedClients(List allowedClients) { + this.allowedClients = Optional.ofNullable(allowedClients); + return this; + } + + /** + *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) + public Builder sessionTransfer(@Nullable OptionalNullable sessionTransfer) { + this.sessionTransfer = sessionTransfer; + return this; + } + + public Builder sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer); + return this; + } + + public Builder sessionTransfer(Optional sessionTransfer) { + if (sessionTransfer.isPresent()) { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } else { + this.sessionTransfer = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionTransfer( + com.auth0.client.mgmt.core.Nullable sessionTransfer) { + if (sessionTransfer.isNull()) { + this.sessionTransfer = OptionalNullable.ofNull(); + } else if (sessionTransfer.isEmpty()) { + this.sessionTransfer = OptionalNullable.absent(); + } else { + this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ */ + @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) + public Builder grantTypes(Optional> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public Builder grantTypes(List grantTypes) { + this.grantTypes = Optional.ofNullable(grantTypes); + return this; + } + + @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) + public Builder jwtConfiguration(Optional jwtConfiguration) { + this.jwtConfiguration = jwtConfiguration; + return this; + } + + public Builder jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { + this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); + return this; + } + + @JsonSetter(value = "signing_keys", nulls = Nulls.SKIP) + public Builder signingKeys(Optional> signingKeys) { + this.signingKeys = signingKeys; + return this; + } + + public Builder signingKeys(List signingKeys) { + this.signingKeys = Optional.ofNullable(signingKeys); + return this; + } + + @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) + public Builder encryptionKey(@Nullable OptionalNullable encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + public Builder encryptionKey(ClientEncryptionKey encryptionKey) { + this.encryptionKey = OptionalNullable.of(encryptionKey); + return this; + } + + public Builder encryptionKey(Optional encryptionKey) { + if (encryptionKey.isPresent()) { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } else { + this.encryptionKey = OptionalNullable.absent(); + } + return this; + } + + public Builder encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { + if (encryptionKey.isNull()) { + this.encryptionKey = OptionalNullable.ofNull(); + } else if (encryptionKey.isEmpty()) { + this.encryptionKey = OptionalNullable.absent(); + } else { + this.encryptionKey = OptionalNullable.of(encryptionKey.get()); + } + return this; + } + + /** + *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

+ */ + @JsonSetter(value = "sso", nulls = Nulls.SKIP) + public Builder sso(Optional sso) { + this.sso = sso; + return this; + } + + public Builder sso(Boolean sso) { + this.sso = Optional.ofNullable(sso); + return this; + } + + /** + *

Whether Single Sign On is disabled (true) or enabled (true). Defaults to true.

+ */ + @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) + public Builder ssoDisabled(Optional ssoDisabled) { + this.ssoDisabled = ssoDisabled; + return this; + } + + public Builder ssoDisabled(Boolean ssoDisabled) { + this.ssoDisabled = Optional.ofNullable(ssoDisabled); + return this; + } + + /** + *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

+ */ + @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) + public Builder crossOriginAuthentication(Optional crossOriginAuthentication) { + this.crossOriginAuthentication = crossOriginAuthentication; + return this; + } + + public Builder crossOriginAuthentication(Boolean crossOriginAuthentication) { + this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); + return this; + } + + /** + *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

+ */ + @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) + public Builder crossOriginLoc(Optional crossOriginLoc) { + this.crossOriginLoc = crossOriginLoc; + return this; + } + + public Builder crossOriginLoc(String crossOriginLoc) { + this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); + return this; + } + + /** + *

Whether a custom login page is to be used (true) or the default provided login page (false).

+ */ + @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) + public Builder customLoginPageOn(Optional customLoginPageOn) { + this.customLoginPageOn = customLoginPageOn; + return this; + } + + public Builder customLoginPageOn(Boolean customLoginPageOn) { + this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page.

+ */ + @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) + public Builder customLoginPage(Optional customLoginPage) { + this.customLoginPage = customLoginPage; + return this; + } + + public Builder customLoginPage(String customLoginPage) { + this.customLoginPage = Optional.ofNullable(customLoginPage); + return this; + } + + /** + *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

+ */ + @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) + public Builder customLoginPagePreview(Optional customLoginPagePreview) { + this.customLoginPagePreview = customLoginPagePreview; + return this; + } + + public Builder customLoginPagePreview(String customLoginPagePreview) { + this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); + return this; + } + + /** + *

HTML form template to be used for WS-Federation.

+ */ + @JsonSetter(value = "form_template", nulls = Nulls.SKIP) + public Builder formTemplate(Optional formTemplate) { + this.formTemplate = formTemplate; + return this; + } + + public Builder formTemplate(String formTemplate) { + this.formTemplate = Optional.ofNullable(formTemplate); + return this; + } + + @JsonSetter(value = "addons", nulls = Nulls.SKIP) + public Builder addons(Optional addons) { + this.addons = addons; + return this; + } + + public Builder addons(ClientAddons addons) { + this.addons = Optional.ofNullable(addons); + return this; + } + + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public Builder tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); + return this; + } + + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) + public Builder clientMetadata(Optional> clientMetadata) { + this.clientMetadata = clientMetadata; + return this; + } + + public Builder clientMetadata(Map clientMetadata) { + this.clientMetadata = Optional.ofNullable(clientMetadata); + return this; + } + + @JsonSetter(value = "mobile", nulls = Nulls.SKIP) + public Builder mobile(Optional mobile) { + this.mobile = mobile; + return this; + } + + public Builder mobile(ClientMobile mobile) { + this.mobile = Optional.ofNullable(mobile); + return this; + } + + /** + *

Initiate login uri, must be https

+ */ + @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) + public Builder initiateLoginUri(Optional initiateLoginUri) { + this.initiateLoginUri = initiateLoginUri; + return this; + } + + public Builder initiateLoginUri(String initiateLoginUri) { + this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); + return this; + } + + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(@Nullable OptionalNullable refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(ClientRefreshTokenConfiguration refreshToken) { + this.refreshToken = OptionalNullable.of(refreshToken); + return this; + } + + public Builder refreshToken(Optional refreshToken) { + if (refreshToken.isPresent()) { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } else { + this.refreshToken = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshToken(com.auth0.client.mgmt.core.Nullable refreshToken) { + if (refreshToken.isNull()) { + this.refreshToken = OptionalNullable.ofNull(); + } else if (refreshToken.isEmpty()) { + this.refreshToken = OptionalNullable.absent(); + } else { + this.refreshToken = OptionalNullable.of(refreshToken.get()); + } + return this; + } + + @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) + public Builder defaultOrganization(@Nullable OptionalNullable defaultOrganization) { + this.defaultOrganization = defaultOrganization; + return this; + } + + public Builder defaultOrganization(ClientDefaultOrganization defaultOrganization) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization); + return this; + } + + public Builder defaultOrganization(Optional defaultOrganization) { + if (defaultOrganization.isPresent()) { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } else { + this.defaultOrganization = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultOrganization( + com.auth0.client.mgmt.core.Nullable defaultOrganization) { + if (defaultOrganization.isNull()) { + this.defaultOrganization = OptionalNullable.ofNull(); + } else if (defaultOrganization.isEmpty()) { + this.defaultOrganization = OptionalNullable.absent(); + } else { + this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); + } + return this; + } + + @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) + public Builder organizationUsage(Optional organizationUsage) { + this.organizationUsage = organizationUsage; + return this; + } + + public Builder organizationUsage(ClientOrganizationUsageEnum organizationUsage) { + this.organizationUsage = Optional.ofNullable(organizationUsage); + return this; + } + + @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) + public Builder organizationRequireBehavior( + Optional organizationRequireBehavior) { + this.organizationRequireBehavior = organizationRequireBehavior; + return this; + } + + public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { + this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); + return this; + } + + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) + public Builder clientAuthenticationMethods( + @Nullable OptionalNullable clientAuthenticationMethods) { + this.clientAuthenticationMethods = clientAuthenticationMethods; + return this; + } + + public Builder clientAuthenticationMethods(ClientAuthenticationMethod clientAuthenticationMethods) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods); + return this; + } + + public Builder clientAuthenticationMethods(Optional clientAuthenticationMethods) { + if (clientAuthenticationMethods.isPresent()) { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } else { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder clientAuthenticationMethods( + com.auth0.client.mgmt.core.Nullable clientAuthenticationMethods) { + if (clientAuthenticationMethods.isNull()) { + this.clientAuthenticationMethods = OptionalNullable.ofNull(); + } else if (clientAuthenticationMethods.isEmpty()) { + this.clientAuthenticationMethods = OptionalNullable.absent(); + } else { + this.clientAuthenticationMethods = OptionalNullable.of(clientAuthenticationMethods.get()); + } + return this; + } + + /** + *

Makes the use of Pushed Authorization Requests mandatory for this client

+ */ + @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) + public Builder requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; + return this; + } + + public Builder requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { + this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); + return this; + } + + /** + *

Makes the use of Proof-of-Possession mandatory for this client

+ */ + @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) + public Builder requireProofOfPossession(Optional requireProofOfPossession) { + this.requireProofOfPossession = requireProofOfPossession; + return this; + } + + public Builder requireProofOfPossession(Boolean requireProofOfPossession) { + this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); + return this; + } + + @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) + public Builder signedRequestObject(Optional signedRequestObject) { + this.signedRequestObject = signedRequestObject; + return this; + } + + public Builder signedRequestObject(ClientSignedRequestObjectWithCredentialId signedRequestObject) { + this.signedRequestObject = Optional.ofNullable(signedRequestObject); + return this; + } + + @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) + public Builder complianceLevel(@Nullable OptionalNullable complianceLevel) { + this.complianceLevel = complianceLevel; + return this; + } + + public Builder complianceLevel(ClientComplianceLevelEnum complianceLevel) { + this.complianceLevel = OptionalNullable.of(complianceLevel); + return this; + } + + public Builder complianceLevel(Optional complianceLevel) { + if (complianceLevel.isPresent()) { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } else { + this.complianceLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel) { + if (complianceLevel.isNull()) { + this.complianceLevel = OptionalNullable.ofNull(); + } else if (complianceLevel.isEmpty()) { + this.complianceLevel = OptionalNullable.absent(); + } else { + this.complianceLevel = OptionalNullable.of(complianceLevel.get()); + } + return this; + } + + /** + *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

+ */ + @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) + public Builder parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { + this.parRequestExpiry = parRequestExpiry; + return this; + } + + public Builder parRequestExpiry(Integer parRequestExpiry) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); + return this; + } + + public Builder parRequestExpiry(Optional parRequestExpiry) { + if (parRequestExpiry.isPresent()) { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } else { + this.parRequestExpiry = OptionalNullable.absent(); + } + return this; + } + + public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { + if (parRequestExpiry.isNull()) { + this.parRequestExpiry = OptionalNullable.ofNull(); + } else if (parRequestExpiry.isEmpty()) { + this.parRequestExpiry = OptionalNullable.absent(); + } else { + this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); + } + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public UpdateClientResponseContent build() { + return new UpdateClientResponseContent( + clientId, + tenant, + name, + description, + global, + clientSecret, + appType, + logoUri, + isFirstParty, + oidcConformant, + callbacks, + allowedOrigins, + webOrigins, + clientAliases, + allowedClients, + allowedLogoutUrls, + sessionTransfer, + oidcLogout, + grantTypes, + jwtConfiguration, + signingKeys, + encryptionKey, + sso, + ssoDisabled, + crossOriginAuthentication, + crossOriginLoc, + customLoginPageOn, + customLoginPage, + customLoginPagePreview, + formTemplate, + addons, + tokenEndpointAuthMethod, + clientMetadata, + mobile, + initiateLoginUri, + refreshToken, + defaultOrganization, + organizationUsage, + organizationRequireBehavior, + clientAuthenticationMethods, + requirePushedAuthorizationRequests, + requireProofOfPossession, + signedRequestObject, + complianceLevel, + parRequestExpiry, + tokenQuota, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java new file mode 100644 index 000000000..409777e37 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java @@ -0,0 +1,1120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateConnectionOptions.Builder.class) +public final class UpdateConnectionOptions { + private final OptionalNullable validation; + + private final Optional> nonPersistentAttrs; + + private final Optional> precedence; + + private final Optional attributes; + + private final Optional enableScriptContext; + + private final Optional enabledDatabaseCustomization; + + private final Optional importMode; + + private final Optional customScripts; + + private final OptionalNullable authenticationMethods; + + private final OptionalNullable passkeyOptions; + + private final OptionalNullable passwordPolicy; + + private final OptionalNullable passwordComplexityOptions; + + private final OptionalNullable passwordHistory; + + private final OptionalNullable passwordNoPersonalInfo; + + private final OptionalNullable passwordDictionary; + + private final Optional apiEnableUsers; + + private final Optional basicProfile; + + private final Optional extAdmin; + + private final Optional extIsSuspended; + + private final Optional extAgreedTerms; + + private final Optional extGroups; + + private final Optional extAssignedPlans; + + private final Optional extProfile; + + private final Optional disableSelfServiceChangePassword; + + private final OptionalNullable> upstreamParams; + + private final Optional setUserRootAttributes; + + private final OptionalNullable gatewayAuthentication; + + private final Map additionalProperties; + + private UpdateConnectionOptions( + OptionalNullable validation, + Optional> nonPersistentAttrs, + Optional> precedence, + Optional attributes, + Optional enableScriptContext, + Optional enabledDatabaseCustomization, + Optional importMode, + Optional customScripts, + OptionalNullable authenticationMethods, + OptionalNullable passkeyOptions, + OptionalNullable passwordPolicy, + OptionalNullable passwordComplexityOptions, + OptionalNullable passwordHistory, + OptionalNullable passwordNoPersonalInfo, + OptionalNullable passwordDictionary, + Optional apiEnableUsers, + Optional basicProfile, + Optional extAdmin, + Optional extIsSuspended, + Optional extAgreedTerms, + Optional extGroups, + Optional extAssignedPlans, + Optional extProfile, + Optional disableSelfServiceChangePassword, + OptionalNullable> upstreamParams, + Optional setUserRootAttributes, + OptionalNullable gatewayAuthentication, + Map additionalProperties) { + this.validation = validation; + this.nonPersistentAttrs = nonPersistentAttrs; + this.precedence = precedence; + this.attributes = attributes; + this.enableScriptContext = enableScriptContext; + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + this.importMode = importMode; + this.customScripts = customScripts; + this.authenticationMethods = authenticationMethods; + this.passkeyOptions = passkeyOptions; + this.passwordPolicy = passwordPolicy; + this.passwordComplexityOptions = passwordComplexityOptions; + this.passwordHistory = passwordHistory; + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + this.passwordDictionary = passwordDictionary; + this.apiEnableUsers = apiEnableUsers; + this.basicProfile = basicProfile; + this.extAdmin = extAdmin; + this.extIsSuspended = extIsSuspended; + this.extAgreedTerms = extAgreedTerms; + this.extGroups = extGroups; + this.extAssignedPlans = extAssignedPlans; + this.extProfile = extProfile; + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + this.upstreamParams = upstreamParams; + this.setUserRootAttributes = setUserRootAttributes; + this.gatewayAuthentication = gatewayAuthentication; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + public OptionalNullable getValidation() { + if (validation == null) { + return OptionalNullable.absent(); + } + return validation; + } + + /** + * @return An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist) + */ + @JsonProperty("non_persistent_attrs") + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + /** + * @return Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used. + */ + @JsonProperty("precedence") + public Optional> getPrecedence() { + return precedence; + } + + @JsonProperty("attributes") + public Optional getAttributes() { + return attributes; + } + + @JsonProperty("enable_script_context") + public Optional getEnableScriptContext() { + return enableScriptContext; + } + + /** + * @return Set to true to use a legacy user store + */ + @JsonProperty("enabledDatabaseCustomization") + public Optional getEnabledDatabaseCustomization() { + return enabledDatabaseCustomization; + } + + /** + * @return Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store + */ + @JsonProperty("import_mode") + public Optional getImportMode() { + return importMode; + } + + @JsonProperty("customScripts") + public Optional getCustomScripts() { + return customScripts; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + public OptionalNullable getAuthenticationMethods() { + if (authenticationMethods == null) { + return OptionalNullable.absent(); + } + return authenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + public OptionalNullable getPasskeyOptions() { + if (passkeyOptions == null) { + return OptionalNullable.absent(); + } + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + public OptionalNullable getPasswordPolicy() { + if (passwordPolicy == null) { + return OptionalNullable.absent(); + } + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + public OptionalNullable getPasswordComplexityOptions() { + if (passwordComplexityOptions == null) { + return OptionalNullable.absent(); + } + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + public OptionalNullable getPasswordHistory() { + if (passwordHistory == null) { + return OptionalNullable.absent(); + } + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + public OptionalNullable getPasswordNoPersonalInfo() { + if (passwordNoPersonalInfo == null) { + return OptionalNullable.absent(); + } + return passwordNoPersonalInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + public OptionalNullable getPasswordDictionary() { + if (passwordDictionary == null) { + return OptionalNullable.absent(); + } + return passwordDictionary; + } + + @JsonProperty("api_enable_users") + public Optional getApiEnableUsers() { + return apiEnableUsers; + } + + @JsonProperty("basic_profile") + public Optional getBasicProfile() { + return basicProfile; + } + + @JsonProperty("ext_admin") + public Optional getExtAdmin() { + return extAdmin; + } + + @JsonProperty("ext_is_suspended") + public Optional getExtIsSuspended() { + return extIsSuspended; + } + + @JsonProperty("ext_agreed_terms") + public Optional getExtAgreedTerms() { + return extAgreedTerms; + } + + @JsonProperty("ext_groups") + public Optional getExtGroups() { + return extGroups; + } + + @JsonProperty("ext_assigned_plans") + public Optional getExtAssignedPlans() { + return extAssignedPlans; + } + + @JsonProperty("ext_profile") + public Optional getExtProfile() { + return extProfile; + } + + @JsonProperty("disable_self_service_change_password") + public Optional getDisableSelfServiceChangePassword() { + return disableSelfServiceChangePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gateway_authentication") + public OptionalNullable getGatewayAuthentication() { + if (gatewayAuthentication == null) { + return OptionalNullable.absent(); + } + return gatewayAuthentication; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + private OptionalNullable _getValidation() { + return validation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + private OptionalNullable _getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + private OptionalNullable _getPasskeyOptions() { + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + private OptionalNullable _getPasswordPolicy() { + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + private OptionalNullable _getPasswordComplexityOptions() { + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + private OptionalNullable _getPasswordHistory() { + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + private OptionalNullable _getPasswordNoPersonalInfo() { + return passwordNoPersonalInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + private OptionalNullable _getPasswordDictionary() { + return passwordDictionary; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable> _getUpstreamParams() { + return upstreamParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gateway_authentication") + private OptionalNullable _getGatewayAuthentication() { + return gatewayAuthentication; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateConnectionOptions && equalTo((UpdateConnectionOptions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateConnectionOptions other) { + return validation.equals(other.validation) + && nonPersistentAttrs.equals(other.nonPersistentAttrs) + && precedence.equals(other.precedence) + && attributes.equals(other.attributes) + && enableScriptContext.equals(other.enableScriptContext) + && enabledDatabaseCustomization.equals(other.enabledDatabaseCustomization) + && importMode.equals(other.importMode) + && customScripts.equals(other.customScripts) + && authenticationMethods.equals(other.authenticationMethods) + && passkeyOptions.equals(other.passkeyOptions) + && passwordPolicy.equals(other.passwordPolicy) + && passwordComplexityOptions.equals(other.passwordComplexityOptions) + && passwordHistory.equals(other.passwordHistory) + && passwordNoPersonalInfo.equals(other.passwordNoPersonalInfo) + && passwordDictionary.equals(other.passwordDictionary) + && apiEnableUsers.equals(other.apiEnableUsers) + && basicProfile.equals(other.basicProfile) + && extAdmin.equals(other.extAdmin) + && extIsSuspended.equals(other.extIsSuspended) + && extAgreedTerms.equals(other.extAgreedTerms) + && extGroups.equals(other.extGroups) + && extAssignedPlans.equals(other.extAssignedPlans) + && extProfile.equals(other.extProfile) + && disableSelfServiceChangePassword.equals(other.disableSelfServiceChangePassword) + && upstreamParams.equals(other.upstreamParams) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && gatewayAuthentication.equals(other.gatewayAuthentication); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.validation, + this.nonPersistentAttrs, + this.precedence, + this.attributes, + this.enableScriptContext, + this.enabledDatabaseCustomization, + this.importMode, + this.customScripts, + this.authenticationMethods, + this.passkeyOptions, + this.passwordPolicy, + this.passwordComplexityOptions, + this.passwordHistory, + this.passwordNoPersonalInfo, + this.passwordDictionary, + this.apiEnableUsers, + this.basicProfile, + this.extAdmin, + this.extIsSuspended, + this.extAgreedTerms, + this.extGroups, + this.extAssignedPlans, + this.extProfile, + this.disableSelfServiceChangePassword, + this.upstreamParams, + this.setUserRootAttributes, + this.gatewayAuthentication); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable validation = OptionalNullable.absent(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional> precedence = Optional.empty(); + + private Optional attributes = Optional.empty(); + + private Optional enableScriptContext = Optional.empty(); + + private Optional enabledDatabaseCustomization = Optional.empty(); + + private Optional importMode = Optional.empty(); + + private Optional customScripts = Optional.empty(); + + private OptionalNullable authenticationMethods = OptionalNullable.absent(); + + private OptionalNullable passkeyOptions = OptionalNullable.absent(); + + private OptionalNullable passwordPolicy = OptionalNullable.absent(); + + private OptionalNullable passwordComplexityOptions = + OptionalNullable.absent(); + + private OptionalNullable passwordHistory = OptionalNullable.absent(); + + private OptionalNullable passwordNoPersonalInfo = + OptionalNullable.absent(); + + private OptionalNullable passwordDictionary = OptionalNullable.absent(); + + private Optional apiEnableUsers = Optional.empty(); + + private Optional basicProfile = Optional.empty(); + + private Optional extAdmin = Optional.empty(); + + private Optional extIsSuspended = Optional.empty(); + + private Optional extAgreedTerms = Optional.empty(); + + private Optional extGroups = Optional.empty(); + + private Optional extAssignedPlans = Optional.empty(); + + private Optional extProfile = Optional.empty(); + + private Optional disableSelfServiceChangePassword = Optional.empty(); + + private OptionalNullable> upstreamParams = OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + private OptionalNullable gatewayAuthentication = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateConnectionOptions other) { + validation(other.getValidation()); + nonPersistentAttrs(other.getNonPersistentAttrs()); + precedence(other.getPrecedence()); + attributes(other.getAttributes()); + enableScriptContext(other.getEnableScriptContext()); + enabledDatabaseCustomization(other.getEnabledDatabaseCustomization()); + importMode(other.getImportMode()); + customScripts(other.getCustomScripts()); + authenticationMethods(other.getAuthenticationMethods()); + passkeyOptions(other.getPasskeyOptions()); + passwordPolicy(other.getPasswordPolicy()); + passwordComplexityOptions(other.getPasswordComplexityOptions()); + passwordHistory(other.getPasswordHistory()); + passwordNoPersonalInfo(other.getPasswordNoPersonalInfo()); + passwordDictionary(other.getPasswordDictionary()); + apiEnableUsers(other.getApiEnableUsers()); + basicProfile(other.getBasicProfile()); + extAdmin(other.getExtAdmin()); + extIsSuspended(other.getExtIsSuspended()); + extAgreedTerms(other.getExtAgreedTerms()); + extGroups(other.getExtGroups()); + extAssignedPlans(other.getExtAssignedPlans()); + extProfile(other.getExtProfile()); + disableSelfServiceChangePassword(other.getDisableSelfServiceChangePassword()); + upstreamParams(other.getUpstreamParams()); + setUserRootAttributes(other.getSetUserRootAttributes()); + gatewayAuthentication(other.getGatewayAuthentication()); + return this; + } + + @JsonSetter(value = "validation", nulls = Nulls.SKIP) + public Builder validation(@Nullable OptionalNullable validation) { + this.validation = validation; + return this; + } + + public Builder validation(ConnectionValidationOptions validation) { + this.validation = OptionalNullable.of(validation); + return this; + } + + public Builder validation(Optional validation) { + if (validation.isPresent()) { + this.validation = OptionalNullable.of(validation.get()); + } else { + this.validation = OptionalNullable.absent(); + } + return this; + } + + public Builder validation(com.auth0.client.mgmt.core.Nullable validation) { + if (validation.isNull()) { + this.validation = OptionalNullable.ofNull(); + } else if (validation.isEmpty()) { + this.validation = OptionalNullable.absent(); + } else { + this.validation = OptionalNullable.of(validation.get()); + } + return this; + } + + /** + *

An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist)

+ */ + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + /** + *

Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used.

+ */ + @JsonSetter(value = "precedence", nulls = Nulls.SKIP) + public Builder precedence(Optional> precedence) { + this.precedence = precedence; + return this; + } + + public Builder precedence(List precedence) { + this.precedence = Optional.ofNullable(precedence); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(ConnectionAttributes attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + @JsonSetter(value = "enable_script_context", nulls = Nulls.SKIP) + public Builder enableScriptContext(Optional enableScriptContext) { + this.enableScriptContext = enableScriptContext; + return this; + } + + public Builder enableScriptContext(Boolean enableScriptContext) { + this.enableScriptContext = Optional.ofNullable(enableScriptContext); + return this; + } + + /** + *

Set to true to use a legacy user store

+ */ + @JsonSetter(value = "enabledDatabaseCustomization", nulls = Nulls.SKIP) + public Builder enabledDatabaseCustomization(Optional enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + return this; + } + + public Builder enabledDatabaseCustomization(Boolean enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = Optional.ofNullable(enabledDatabaseCustomization); + return this; + } + + /** + *

Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store

+ */ + @JsonSetter(value = "import_mode", nulls = Nulls.SKIP) + public Builder importMode(Optional importMode) { + this.importMode = importMode; + return this; + } + + public Builder importMode(Boolean importMode) { + this.importMode = Optional.ofNullable(importMode); + return this; + } + + @JsonSetter(value = "customScripts", nulls = Nulls.SKIP) + public Builder customScripts(Optional customScripts) { + this.customScripts = customScripts; + return this; + } + + public Builder customScripts(ConnectionCustomScripts customScripts) { + this.customScripts = Optional.ofNullable(customScripts); + return this; + } + + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public Builder authenticationMethods( + @Nullable OptionalNullable authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + public Builder authenticationMethods(ConnectionAuthenticationMethods authenticationMethods) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods); + return this; + } + + public Builder authenticationMethods(Optional authenticationMethods) { + if (authenticationMethods.isPresent()) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } else { + this.authenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder authenticationMethods( + com.auth0.client.mgmt.core.Nullable authenticationMethods) { + if (authenticationMethods.isNull()) { + this.authenticationMethods = OptionalNullable.ofNull(); + } else if (authenticationMethods.isEmpty()) { + this.authenticationMethods = OptionalNullable.absent(); + } else { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } + return this; + } + + @JsonSetter(value = "passkey_options", nulls = Nulls.SKIP) + public Builder passkeyOptions(@Nullable OptionalNullable passkeyOptions) { + this.passkeyOptions = passkeyOptions; + return this; + } + + public Builder passkeyOptions(ConnectionPasskeyOptions passkeyOptions) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions); + return this; + } + + public Builder passkeyOptions(Optional passkeyOptions) { + if (passkeyOptions.isPresent()) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } else { + this.passkeyOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passkeyOptions(com.auth0.client.mgmt.core.Nullable passkeyOptions) { + if (passkeyOptions.isNull()) { + this.passkeyOptions = OptionalNullable.ofNull(); + } else if (passkeyOptions.isEmpty()) { + this.passkeyOptions = OptionalNullable.absent(); + } else { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } + return this; + } + + @JsonSetter(value = "passwordPolicy", nulls = Nulls.SKIP) + public Builder passwordPolicy(@Nullable OptionalNullable passwordPolicy) { + this.passwordPolicy = passwordPolicy; + return this; + } + + public Builder passwordPolicy(ConnectionPasswordPolicyEnum passwordPolicy) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy); + return this; + } + + public Builder passwordPolicy(Optional passwordPolicy) { + if (passwordPolicy.isPresent()) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } else { + this.passwordPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordPolicy( + com.auth0.client.mgmt.core.Nullable passwordPolicy) { + if (passwordPolicy.isNull()) { + this.passwordPolicy = OptionalNullable.ofNull(); + } else if (passwordPolicy.isEmpty()) { + this.passwordPolicy = OptionalNullable.absent(); + } else { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } + return this; + } + + @JsonSetter(value = "password_complexity_options", nulls = Nulls.SKIP) + public Builder passwordComplexityOptions( + @Nullable OptionalNullable passwordComplexityOptions) { + this.passwordComplexityOptions = passwordComplexityOptions; + return this; + } + + public Builder passwordComplexityOptions(ConnectionPasswordComplexityOptions passwordComplexityOptions) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions); + return this; + } + + public Builder passwordComplexityOptions( + Optional passwordComplexityOptions) { + if (passwordComplexityOptions.isPresent()) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } else { + this.passwordComplexityOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordComplexityOptions( + com.auth0.client.mgmt.core.Nullable passwordComplexityOptions) { + if (passwordComplexityOptions.isNull()) { + this.passwordComplexityOptions = OptionalNullable.ofNull(); + } else if (passwordComplexityOptions.isEmpty()) { + this.passwordComplexityOptions = OptionalNullable.absent(); + } else { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } + return this; + } + + @JsonSetter(value = "password_history", nulls = Nulls.SKIP) + public Builder passwordHistory(@Nullable OptionalNullable passwordHistory) { + this.passwordHistory = passwordHistory; + return this; + } + + public Builder passwordHistory(ConnectionPasswordHistoryOptions passwordHistory) { + this.passwordHistory = OptionalNullable.of(passwordHistory); + return this; + } + + public Builder passwordHistory(Optional passwordHistory) { + if (passwordHistory.isPresent()) { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } else { + this.passwordHistory = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordHistory( + com.auth0.client.mgmt.core.Nullable passwordHistory) { + if (passwordHistory.isNull()) { + this.passwordHistory = OptionalNullable.ofNull(); + } else if (passwordHistory.isEmpty()) { + this.passwordHistory = OptionalNullable.absent(); + } else { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } + return this; + } + + @JsonSetter(value = "password_no_personal_info", nulls = Nulls.SKIP) + public Builder passwordNoPersonalInfo( + @Nullable OptionalNullable passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + return this; + } + + public Builder passwordNoPersonalInfo(ConnectionPasswordNoPersonalInfoOptions passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo); + return this; + } + + public Builder passwordNoPersonalInfo( + Optional passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isPresent()) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } else { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordNoPersonalInfo( + com.auth0.client.mgmt.core.Nullable passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isNull()) { + this.passwordNoPersonalInfo = OptionalNullable.ofNull(); + } else if (passwordNoPersonalInfo.isEmpty()) { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } else { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } + return this; + } + + @JsonSetter(value = "password_dictionary", nulls = Nulls.SKIP) + public Builder passwordDictionary( + @Nullable OptionalNullable passwordDictionary) { + this.passwordDictionary = passwordDictionary; + return this; + } + + public Builder passwordDictionary(ConnectionPasswordDictionaryOptions passwordDictionary) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary); + return this; + } + + public Builder passwordDictionary(Optional passwordDictionary) { + if (passwordDictionary.isPresent()) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } else { + this.passwordDictionary = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordDictionary( + com.auth0.client.mgmt.core.Nullable passwordDictionary) { + if (passwordDictionary.isNull()) { + this.passwordDictionary = OptionalNullable.ofNull(); + } else if (passwordDictionary.isEmpty()) { + this.passwordDictionary = OptionalNullable.absent(); + } else { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } + return this; + } + + @JsonSetter(value = "api_enable_users", nulls = Nulls.SKIP) + public Builder apiEnableUsers(Optional apiEnableUsers) { + this.apiEnableUsers = apiEnableUsers; + return this; + } + + public Builder apiEnableUsers(Boolean apiEnableUsers) { + this.apiEnableUsers = Optional.ofNullable(apiEnableUsers); + return this; + } + + @JsonSetter(value = "basic_profile", nulls = Nulls.SKIP) + public Builder basicProfile(Optional basicProfile) { + this.basicProfile = basicProfile; + return this; + } + + public Builder basicProfile(Boolean basicProfile) { + this.basicProfile = Optional.ofNullable(basicProfile); + return this; + } + + @JsonSetter(value = "ext_admin", nulls = Nulls.SKIP) + public Builder extAdmin(Optional extAdmin) { + this.extAdmin = extAdmin; + return this; + } + + public Builder extAdmin(Boolean extAdmin) { + this.extAdmin = Optional.ofNullable(extAdmin); + return this; + } + + @JsonSetter(value = "ext_is_suspended", nulls = Nulls.SKIP) + public Builder extIsSuspended(Optional extIsSuspended) { + this.extIsSuspended = extIsSuspended; + return this; + } + + public Builder extIsSuspended(Boolean extIsSuspended) { + this.extIsSuspended = Optional.ofNullable(extIsSuspended); + return this; + } + + @JsonSetter(value = "ext_agreed_terms", nulls = Nulls.SKIP) + public Builder extAgreedTerms(Optional extAgreedTerms) { + this.extAgreedTerms = extAgreedTerms; + return this; + } + + public Builder extAgreedTerms(Boolean extAgreedTerms) { + this.extAgreedTerms = Optional.ofNullable(extAgreedTerms); + return this; + } + + @JsonSetter(value = "ext_groups", nulls = Nulls.SKIP) + public Builder extGroups(Optional extGroups) { + this.extGroups = extGroups; + return this; + } + + public Builder extGroups(Boolean extGroups) { + this.extGroups = Optional.ofNullable(extGroups); + return this; + } + + @JsonSetter(value = "ext_assigned_plans", nulls = Nulls.SKIP) + public Builder extAssignedPlans(Optional extAssignedPlans) { + this.extAssignedPlans = extAssignedPlans; + return this; + } + + public Builder extAssignedPlans(Boolean extAssignedPlans) { + this.extAssignedPlans = Optional.ofNullable(extAssignedPlans); + return this; + } + + @JsonSetter(value = "ext_profile", nulls = Nulls.SKIP) + public Builder extProfile(Optional extProfile) { + this.extProfile = extProfile; + return this; + } + + public Builder extProfile(Boolean extProfile) { + this.extProfile = Optional.ofNullable(extProfile); + return this; + } + + @JsonSetter(value = "disable_self_service_change_password", nulls = Nulls.SKIP) + public Builder disableSelfServiceChangePassword(Optional disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + return this; + } + + public Builder disableSelfServiceChangePassword(Boolean disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = Optional.ofNullable(disableSelfServiceChangePassword); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams(@Nullable OptionalNullable> upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams(Map upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams(Optional> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams(com.auth0.client.mgmt.core.Nullable> upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @JsonSetter(value = "gateway_authentication", nulls = Nulls.SKIP) + public Builder gatewayAuthentication( + @Nullable OptionalNullable gatewayAuthentication) { + this.gatewayAuthentication = gatewayAuthentication; + return this; + } + + public Builder gatewayAuthentication(ConnectionGatewayAuthentication gatewayAuthentication) { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication); + return this; + } + + public Builder gatewayAuthentication(Optional gatewayAuthentication) { + if (gatewayAuthentication.isPresent()) { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication.get()); + } else { + this.gatewayAuthentication = OptionalNullable.absent(); + } + return this; + } + + public Builder gatewayAuthentication( + com.auth0.client.mgmt.core.Nullable gatewayAuthentication) { + if (gatewayAuthentication.isNull()) { + this.gatewayAuthentication = OptionalNullable.ofNull(); + } else if (gatewayAuthentication.isEmpty()) { + this.gatewayAuthentication = OptionalNullable.absent(); + } else { + this.gatewayAuthentication = OptionalNullable.of(gatewayAuthentication.get()); + } + return this; + } + + public UpdateConnectionOptions build() { + return new UpdateConnectionOptions( + validation, + nonPersistentAttrs, + precedence, + attributes, + enableScriptContext, + enabledDatabaseCustomization, + importMode, + customScripts, + authenticationMethods, + passkeyOptions, + passwordPolicy, + passwordComplexityOptions, + passwordHistory, + passwordNoPersonalInfo, + passwordDictionary, + apiEnableUsers, + basicProfile, + extAdmin, + extIsSuspended, + extAgreedTerms, + extGroups, + extAssignedPlans, + extProfile, + disableSelfServiceChangePassword, + upstreamParams, + setUserRootAttributes, + gatewayAuthentication, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java new file mode 100644 index 000000000..0fe404c77 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java @@ -0,0 +1,320 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateConnectionRequestContent.Builder.class) +public final class UpdateConnectionRequestContent { + private final Optional displayName; + + private final OptionalNullable options; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> realms; + + private final Optional> metadata; + + private final Map additionalProperties; + + private UpdateConnectionRequestContent( + Optional displayName, + OptionalNullable options, + Optional> enabledClients, + Optional isDomainConnection, + Optional showAsButton, + Optional> realms, + Optional> metadata, + Map additionalProperties) { + this.displayName = displayName; + this.options = options; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.realms = realms; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection name used in the new universal login experience. If display_name is not included in the request, the field will be overwritten with the name value. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + public OptionalNullable getOptions() { + if (options == null) { + return OptionalNullable.absent(); + } + return options; + } + + /** + * @return DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients. + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return <code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.) + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.) + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private OptionalNullable _getOptions() { + return options; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateConnectionRequestContent && equalTo((UpdateConnectionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateConnectionRequestContent other) { + return displayName.equals(other.displayName) + && options.equals(other.options) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && realms.equals(other.realms) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.displayName, + this.options, + this.enabledClients, + this.isDomainConnection, + this.showAsButton, + this.realms, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional displayName = Optional.empty(); + + private OptionalNullable options = OptionalNullable.absent(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateConnectionRequestContent other) { + displayName(other.getDisplayName()); + options(other.getOptions()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + realms(other.getRealms()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The connection name used in the new universal login experience. If display_name is not included in the request, the field will be overwritten with the name value.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(@Nullable OptionalNullable options) { + this.options = options; + return this; + } + + public Builder options(UpdateConnectionOptions options) { + this.options = OptionalNullable.of(options); + return this; + } + + public Builder options(Optional options) { + if (options.isPresent()) { + this.options = OptionalNullable.of(options.get()); + } else { + this.options = OptionalNullable.absent(); + } + return this; + } + + public Builder options(com.auth0.client.mgmt.core.Nullable options) { + if (options.isNull()) { + this.options = OptionalNullable.ofNull(); + } else if (options.isEmpty()) { + this.options = OptionalNullable.absent(); + } else { + this.options = OptionalNullable.of(options.get()); + } + return this; + } + + /** + *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients.

+ */ + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

+ */ + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public UpdateConnectionRequestContent build() { + return new UpdateConnectionRequestContent( + displayName, + options, + enabledClients, + isDomainConnection, + showAsButton, + realms, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java new file mode 100644 index 000000000..c6b7bb368 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateConnectionResponseContent.Builder.class) +public final class UpdateConnectionResponseContent { + private final Optional name; + + private final Optional displayName; + + private final Optional> options; + + private final Optional id; + + private final Optional strategy; + + private final Optional> realms; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional showAsButton; + + private final Optional> metadata; + + private final Map additionalProperties; + + private UpdateConnectionResponseContent( + Optional name, + Optional displayName, + Optional> options, + Optional id, + Optional strategy, + Optional> realms, + Optional> enabledClients, + Optional isDomainConnection, + Optional showAsButton, + Optional> metadata, + Map additionalProperties) { + this.name = name; + this.displayName = displayName; + this.options = options; + this.id = id; + this.strategy = strategy; + this.realms = realms; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.showAsButton = showAsButton; + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Connection name used in login screen + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The type of the connection, related to the identity provider + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + */ + @JsonProperty("realms") + public Optional> getRealms() { + return realms; + } + + /** + * @return DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled + */ + @JsonProperty("enabled_clients") + public Optional> getEnabledClients() { + return enabledClients; + } + + /** + * @return True if the connection is domain level + */ + @JsonProperty("is_domain_connection") + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + /** + * @return Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateConnectionResponseContent && equalTo((UpdateConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateConnectionResponseContent other) { + return name.equals(other.name) + && displayName.equals(other.displayName) + && options.equals(other.options) + && id.equals(other.id) + && strategy.equals(other.strategy) + && realms.equals(other.realms) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && showAsButton.equals(other.showAsButton) + && metadata.equals(other.metadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.displayName, + this.options, + this.id, + this.strategy, + this.realms, + this.enabledClients, + this.isDomainConnection, + this.showAsButton, + this.metadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateConnectionResponseContent other) { + name(other.getName()); + displayName(other.getDisplayName()); + options(other.getOptions()); + id(other.getId()); + strategy(other.getStrategy()); + realms(other.getRealms()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + showAsButton(other.getShowAsButton()); + metadata(other.getMetadata()); + return this; + } + + /** + *

The name of the connection

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Connection name used in login screen

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The type of the connection, related to the identity provider

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

+ */ + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + /** + *

DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled

+ */ + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + /** + *

True if the connection is domain level

+ */ + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + /** + *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public UpdateConnectionResponseContent build() { + return new UpdateConnectionResponseContent( + name, + displayName, + options, + id, + strategy, + realms, + enabledClients, + isDomainConnection, + showAsButton, + metadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java new file mode 100644 index 000000000..91547b142 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateCustomDomainRequestContent.Builder.class) +public final class UpdateCustomDomainRequestContent { + private final Optional tlsPolicy; + + private final OptionalNullable customClientIpHeader; + + private final Map additionalProperties; + + private UpdateCustomDomainRequestContent( + Optional tlsPolicy, + OptionalNullable customClientIpHeader, + Map additionalProperties) { + this.tlsPolicy = tlsPolicy; + this.customClientIpHeader = customClientIpHeader; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateCustomDomainRequestContent && equalTo((UpdateCustomDomainRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateCustomDomainRequestContent other) { + return tlsPolicy.equals(other.tlsPolicy) && customClientIpHeader.equals(other.customClientIpHeader); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.tlsPolicy, this.customClientIpHeader); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateCustomDomainRequestContent other) { + tlsPolicy(other.getTlsPolicy()); + customClientIpHeader(other.getCustomClientIpHeader()); + return this; + } + + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public Builder tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + public Builder tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public Builder customClientIpHeader( + OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + public Builder customClientIpHeader(CustomDomainCustomClientIpHeaderEnum customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + public Builder customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + public Builder customClientIpHeader(Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + public UpdateCustomDomainRequestContent build() { + return new UpdateCustomDomainRequestContent(tlsPolicy, customClientIpHeader, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java new file mode 100644 index 000000000..4e90d7259 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateCustomDomainResponseContent.Builder.class) +public final class UpdateCustomDomainResponseContent { + private final String customDomainId; + + private final String domain; + + private final boolean primary; + + private final CustomDomainTypeEnum type; + + private final DomainVerification verification; + + private final OptionalNullable customClientIpHeader; + + private final Optional tlsPolicy; + + private final Map additionalProperties; + + private UpdateCustomDomainResponseContent( + String customDomainId, + String domain, + boolean primary, + CustomDomainTypeEnum type, + DomainVerification verification, + OptionalNullable customClientIpHeader, + Optional tlsPolicy, + Map additionalProperties) { + this.customDomainId = customDomainId; + this.domain = domain; + this.primary = primary; + this.type = type; + this.verification = verification; + this.customClientIpHeader = customClientIpHeader; + this.tlsPolicy = tlsPolicy; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the custom domain. + */ + @JsonProperty("custom_domain_id") + public String getCustomDomainId() { + return customDomainId; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + /** + * @return Whether this is a primary domain (true) or not (false). + */ + @JsonProperty("primary") + public boolean getPrimary() { + return primary; + } + + @JsonProperty("type") + public CustomDomainTypeEnum getType() { + return type; + } + + @JsonProperty("verification") + public DomainVerification getVerification() { + return verification; + } + + /** + * @return The HTTP header to fetch the client's IP address + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + if (customClientIpHeader == null) { + return OptionalNullable.absent(); + } + return customClientIpHeader; + } + + /** + * @return The TLS version policy + */ + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + private OptionalNullable _getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateCustomDomainResponseContent && equalTo((UpdateCustomDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateCustomDomainResponseContent other) { + return customDomainId.equals(other.customDomainId) + && domain.equals(other.domain) + && primary == other.primary + && type.equals(other.type) + && verification.equals(other.verification) + && customClientIpHeader.equals(other.customClientIpHeader) + && tlsPolicy.equals(other.tlsPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customDomainId, + this.domain, + this.primary, + this.type, + this.verification, + this.customClientIpHeader, + this.tlsPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CustomDomainIdStage builder() { + return new Builder(); + } + + public interface CustomDomainIdStage { + /** + *

ID of the custom domain.

+ */ + DomainStage customDomainId(@NotNull String customDomainId); + + Builder from(UpdateCustomDomainResponseContent other); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + PrimaryStage domain(@NotNull String domain); + } + + public interface PrimaryStage { + /** + *

Whether this is a primary domain (true) or not (false).

+ */ + TypeStage primary(boolean primary); + } + + public interface TypeStage { + VerificationStage type(@NotNull CustomDomainTypeEnum type); + } + + public interface VerificationStage { + _FinalStage verification(@NotNull DomainVerification verification); + } + + public interface _FinalStage { + UpdateCustomDomainResponseContent build(); + + /** + *

The HTTP header to fetch the client's IP address

+ */ + _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(String customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader); + + /** + *

The TLS version policy

+ */ + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, VerificationStage, _FinalStage { + private String customDomainId; + + private String domain; + + private boolean primary; + + private CustomDomainTypeEnum type; + + private DomainVerification verification; + + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateCustomDomainResponseContent other) { + customDomainId(other.getCustomDomainId()); + domain(other.getDomain()); + primary(other.getPrimary()); + type(other.getType()); + verification(other.getVerification()); + customClientIpHeader(other.getCustomClientIpHeader()); + tlsPolicy(other.getTlsPolicy()); + return this; + } + + /** + *

ID of the custom domain.

+ *

ID of the custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("custom_domain_id") + public DomainStage customDomainId(@NotNull String customDomainId) { + this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public PrimaryStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + /** + *

Whether this is a primary domain (true) or not (false).

+ *

Whether this is a primary domain (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public TypeStage primary(boolean primary) { + this.primary = primary; + return this; + } + + @java.lang.Override + @JsonSetter("type") + public VerificationStage type(@NotNull CustomDomainTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("verification") + public _FinalStage verification(@NotNull DomainVerification verification) { + this.verification = Objects.requireNonNull(verification, "verification must not be null"); + return this; + } + + /** + *

The TLS version policy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + /** + *

The TLS version policy

+ */ + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(String customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ */ + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public UpdateCustomDomainResponseContent build() { + return new UpdateCustomDomainResponseContent( + customDomainId, + domain, + primary, + type, + verification, + customClientIpHeader, + tlsPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java new file mode 100644 index 000000000..12a2255f0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEmailProviderResponseContent.Builder.class) +public final class UpdateEmailProviderResponseContent { + private final Optional name; + + private final Optional enabled; + + private final Optional defaultFromAddress; + + private final Optional credentials; + + private final Optional> settings; + + private final Map additionalProperties; + + private UpdateEmailProviderResponseContent( + Optional name, + Optional enabled, + Optional defaultFromAddress, + Optional credentials, + Optional> settings, + Map additionalProperties) { + this.name = name; + this.enabled = enabled; + this.defaultFromAddress = defaultFromAddress; + this.credentials = credentials; + this.settings = settings; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the provider is enabled (true) or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Email address to use as "from" when no other address specified. + */ + @JsonProperty("default_from_address") + public Optional getDefaultFromAddress() { + return defaultFromAddress; + } + + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @JsonProperty("settings") + public Optional> getSettings() { + return settings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEmailProviderResponseContent + && equalTo((UpdateEmailProviderResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEmailProviderResponseContent other) { + return name.equals(other.name) + && enabled.equals(other.enabled) + && defaultFromAddress.equals(other.defaultFromAddress) + && credentials.equals(other.credentials) + && settings.equals(other.settings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional defaultFromAddress = Optional.empty(); + + private Optional credentials = Optional.empty(); + + private Optional> settings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateEmailProviderResponseContent other) { + name(other.getName()); + enabled(other.getEnabled()); + defaultFromAddress(other.getDefaultFromAddress()); + credentials(other.getCredentials()); + settings(other.getSettings()); + return this; + } + + /** + *

Name of the email provider. Can be mailgun, mandrill, sendgrid, ses, sparkpost, smtp, azure_cs, ms365, or custom.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether the provider is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Email address to use as "from" when no other address specified.

+ */ + @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) + public Builder defaultFromAddress(Optional defaultFromAddress) { + this.defaultFromAddress = defaultFromAddress; + return this; + } + + public Builder defaultFromAddress(String defaultFromAddress) { + this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); + return this; + } + + @JsonSetter(value = "credentials", nulls = Nulls.SKIP) + public Builder credentials(Optional credentials) { + this.credentials = credentials; + return this; + } + + public Builder credentials(EmailProviderCredentials credentials) { + this.credentials = Optional.ofNullable(credentials); + return this; + } + + @JsonSetter(value = "settings", nulls = Nulls.SKIP) + public Builder settings(Optional> settings) { + this.settings = settings; + return this; + } + + public Builder settings(Map settings) { + this.settings = Optional.ofNullable(settings); + return this; + } + + public UpdateEmailProviderResponseContent build() { + return new UpdateEmailProviderResponseContent( + name, enabled, defaultFromAddress, credentials, settings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java new file mode 100644 index 000000000..24add727f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java @@ -0,0 +1,569 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEmailTemplateRequestContent.Builder.class) +public final class UpdateEmailTemplateRequestContent { + private final Optional template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private UpdateEmailTemplateRequestContent( + Optional template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEmailTemplateRequestContent && equalTo((UpdateEmailTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEmailTemplateRequestContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional template = Optional.empty(); + + private OptionalNullable body = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable enabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateEmailTemplateRequestContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(EmailTemplateNameEnum template) { + this.template = Optional.ofNullable(template); + return this; + } + + /** + *

Body of the email template.

+ */ + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + public Builder body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + public Builder body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Senders from email address.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public Builder resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + public Builder resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + public Builder resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ */ + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + public Builder subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + public Builder subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ */ + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public Builder syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + public Builder syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + public Builder syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + public Builder syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public Builder urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + public Builder urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + public Builder urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + public Builder urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public Builder includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + public Builder includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + public Builder enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + public UpdateEmailTemplateRequestContent build() { + return new UpdateEmailTemplateRequestContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java new file mode 100644 index 000000000..c7a2f72b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEmailTemplateResponseContent.Builder.class) +public final class UpdateEmailTemplateResponseContent { + private final Optional template; + + private final OptionalNullable body; + + private final OptionalNullable from; + + private final OptionalNullable resultUrl; + + private final OptionalNullable subject; + + private final OptionalNullable syntax; + + private final OptionalNullable urlLifetimeInSeconds; + + private final Optional includeEmailInRedirect; + + private final OptionalNullable enabled; + + private final Map additionalProperties; + + private UpdateEmailTemplateResponseContent( + Optional template, + OptionalNullable body, + OptionalNullable from, + OptionalNullable resultUrl, + OptionalNullable subject, + OptionalNullable syntax, + OptionalNullable urlLifetimeInSeconds, + Optional includeEmailInRedirect, + OptionalNullable enabled, + Map additionalProperties) { + this.template = template; + this.body = body; + this.from = from; + this.resultUrl = resultUrl; + this.subject = subject; + this.syntax = syntax; + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + this.includeEmailInRedirect = includeEmailInRedirect; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + /** + * @return Body of the email template. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + public OptionalNullable getBody() { + if (body == null) { + return OptionalNullable.absent(); + } + return body; + } + + /** + * @return Senders from email address. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return URL to redirect the user to after a successful action. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + public OptionalNullable getResultUrl() { + if (resultUrl == null) { + return OptionalNullable.absent(); + } + return resultUrl; + } + + /** + * @return Subject line of the email. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + public OptionalNullable getSubject() { + if (subject == null) { + return OptionalNullable.absent(); + } + return subject; + } + + /** + * @return Syntax of the template body. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + public OptionalNullable getSyntax() { + if (syntax == null) { + return OptionalNullable.absent(); + } + return syntax; + } + + /** + * @return Lifetime in seconds that the link within the email will be valid for. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + public OptionalNullable getUrlLifetimeInSeconds() { + if (urlLifetimeInSeconds == null) { + return OptionalNullable.absent(); + } + return urlLifetimeInSeconds; + } + + /** + * @return Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + /** + * @return Whether the template is enabled (true) or disabled (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + public OptionalNullable getEnabled() { + if (enabled == null) { + return OptionalNullable.absent(); + } + return enabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private OptionalNullable _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resultUrl") + private OptionalNullable _getResultUrl() { + return resultUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private OptionalNullable _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("syntax") + private OptionalNullable _getSyntax() { + return syntax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urlLifetimeInSeconds") + private OptionalNullable _getUrlLifetimeInSeconds() { + return urlLifetimeInSeconds; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("enabled") + private OptionalNullable _getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEmailTemplateResponseContent + && equalTo((UpdateEmailTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEmailTemplateResponseContent other) { + return template.equals(other.template) + && body.equals(other.body) + && from.equals(other.from) + && resultUrl.equals(other.resultUrl) + && subject.equals(other.subject) + && syntax.equals(other.syntax) + && urlLifetimeInSeconds.equals(other.urlLifetimeInSeconds) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.template, + this.body, + this.from, + this.resultUrl, + this.subject, + this.syntax, + this.urlLifetimeInSeconds, + this.includeEmailInRedirect, + this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional template = Optional.empty(); + + private OptionalNullable body = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable resultUrl = OptionalNullable.absent(); + + private OptionalNullable subject = OptionalNullable.absent(); + + private OptionalNullable syntax = OptionalNullable.absent(); + + private OptionalNullable urlLifetimeInSeconds = OptionalNullable.absent(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private OptionalNullable enabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateEmailTemplateResponseContent other) { + template(other.getTemplate()); + body(other.getBody()); + from(other.getFrom()); + resultUrl(other.getResultUrl()); + subject(other.getSubject()); + syntax(other.getSyntax()); + urlLifetimeInSeconds(other.getUrlLifetimeInSeconds()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + enabled(other.getEnabled()); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(EmailTemplateNameEnum template) { + this.template = Optional.ofNullable(template); + return this; + } + + /** + *

Body of the email template.

+ */ + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(@Nullable OptionalNullable body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = OptionalNullable.of(body); + return this; + } + + public Builder body(Optional body) { + if (body.isPresent()) { + this.body = OptionalNullable.of(body.get()); + } else { + this.body = OptionalNullable.absent(); + } + return this; + } + + public Builder body(com.auth0.client.mgmt.core.Nullable body) { + if (body.isNull()) { + this.body = OptionalNullable.ofNull(); + } else if (body.isEmpty()) { + this.body = OptionalNullable.absent(); + } else { + this.body = OptionalNullable.of(body.get()); + } + return this; + } + + /** + *

Senders from email address.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

URL to redirect the user to after a successful action.

+ */ + @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) + public Builder resultUrl(@Nullable OptionalNullable resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + public Builder resultUrl(String resultUrl) { + this.resultUrl = OptionalNullable.of(resultUrl); + return this; + } + + public Builder resultUrl(Optional resultUrl) { + if (resultUrl.isPresent()) { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } else { + this.resultUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { + if (resultUrl.isNull()) { + this.resultUrl = OptionalNullable.ofNull(); + } else if (resultUrl.isEmpty()) { + this.resultUrl = OptionalNullable.absent(); + } else { + this.resultUrl = OptionalNullable.of(resultUrl.get()); + } + return this; + } + + /** + *

Subject line of the email.

+ */ + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(@Nullable OptionalNullable subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = OptionalNullable.of(subject); + return this; + } + + public Builder subject(Optional subject) { + if (subject.isPresent()) { + this.subject = OptionalNullable.of(subject.get()); + } else { + this.subject = OptionalNullable.absent(); + } + return this; + } + + public Builder subject(com.auth0.client.mgmt.core.Nullable subject) { + if (subject.isNull()) { + this.subject = OptionalNullable.ofNull(); + } else if (subject.isEmpty()) { + this.subject = OptionalNullable.absent(); + } else { + this.subject = OptionalNullable.of(subject.get()); + } + return this; + } + + /** + *

Syntax of the template body.

+ */ + @JsonSetter(value = "syntax", nulls = Nulls.SKIP) + public Builder syntax(@Nullable OptionalNullable syntax) { + this.syntax = syntax; + return this; + } + + public Builder syntax(String syntax) { + this.syntax = OptionalNullable.of(syntax); + return this; + } + + public Builder syntax(Optional syntax) { + if (syntax.isPresent()) { + this.syntax = OptionalNullable.of(syntax.get()); + } else { + this.syntax = OptionalNullable.absent(); + } + return this; + } + + public Builder syntax(com.auth0.client.mgmt.core.Nullable syntax) { + if (syntax.isNull()) { + this.syntax = OptionalNullable.ofNull(); + } else if (syntax.isEmpty()) { + this.syntax = OptionalNullable.absent(); + } else { + this.syntax = OptionalNullable.of(syntax.get()); + } + return this; + } + + /** + *

Lifetime in seconds that the link within the email will be valid for.

+ */ + @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) + public Builder urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = urlLifetimeInSeconds; + return this; + } + + public Builder urlLifetimeInSeconds(Double urlLifetimeInSeconds) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); + return this; + } + + public Builder urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isPresent()) { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } else { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } + return this; + } + + public Builder urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { + if (urlLifetimeInSeconds.isNull()) { + this.urlLifetimeInSeconds = OptionalNullable.ofNull(); + } else if (urlLifetimeInSeconds.isEmpty()) { + this.urlLifetimeInSeconds = OptionalNullable.absent(); + } else { + this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); + } + return this; + } + + /** + *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

+ */ + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public Builder includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + public Builder includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether the template is enabled (true) or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(@Nullable OptionalNullable enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = OptionalNullable.of(enabled); + return this; + } + + public Builder enabled(Optional enabled) { + if (enabled.isPresent()) { + this.enabled = OptionalNullable.of(enabled.get()); + } else { + this.enabled = OptionalNullable.absent(); + } + return this; + } + + public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + if (enabled.isNull()) { + this.enabled = OptionalNullable.ofNull(); + } else if (enabled.isEmpty()) { + this.enabled = OptionalNullable.absent(); + } else { + this.enabled = OptionalNullable.of(enabled.get()); + } + return this; + } + + public UpdateEmailTemplateResponseContent build() { + return new UpdateEmailTemplateResponseContent( + template, + body, + from, + resultUrl, + subject, + syntax, + urlLifetimeInSeconds, + includeEmailInRedirect, + enabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java new file mode 100644 index 000000000..fb814e981 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEnabledClientConnectionsRequestContentItem.Builder.class) +public final class UpdateEnabledClientConnectionsRequestContentItem { + private final String clientId; + + private final boolean status; + + private final Map additionalProperties; + + private UpdateEnabledClientConnectionsRequestContentItem( + String clientId, boolean status, Map additionalProperties) { + this.clientId = clientId; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return The client_id of the client to be the subject to change status + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return Whether the connection is enabled or not for this client_id + */ + @JsonProperty("status") + public boolean getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEnabledClientConnectionsRequestContentItem + && equalTo((UpdateEnabledClientConnectionsRequestContentItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEnabledClientConnectionsRequestContentItem other) { + return clientId.equals(other.clientId) && status == other.status; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientId, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The client_id of the client to be the subject to change status

+ */ + StatusStage clientId(@NotNull String clientId); + + Builder from(UpdateEnabledClientConnectionsRequestContentItem other); + } + + public interface StatusStage { + /** + *

Whether the connection is enabled or not for this client_id

+ */ + _FinalStage status(boolean status); + } + + public interface _FinalStage { + UpdateEnabledClientConnectionsRequestContentItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, StatusStage, _FinalStage { + private String clientId; + + private boolean status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateEnabledClientConnectionsRequestContentItem other) { + clientId(other.getClientId()); + status(other.getStatus()); + return this; + } + + /** + *

The client_id of the client to be the subject to change status

+ *

The client_id of the client to be the subject to change status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public StatusStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

Whether the connection is enabled or not for this client_id

+ *

Whether the connection is enabled or not for this client_id

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(boolean status) { + this.status = status; + return this; + } + + @java.lang.Override + public UpdateEnabledClientConnectionsRequestContentItem build() { + return new UpdateEnabledClientConnectionsRequestContentItem(clientId, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java new file mode 100644 index 000000000..6f2a670cd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateEventStreamRequestContent.Builder.class) +public final class UpdateEventStreamRequestContent { + private final Optional name; + + private final Optional> subscriptions; + + private final Optional destination; + + private final Optional status; + + private final Map additionalProperties; + + private UpdateEventStreamRequestContent( + Optional name, + Optional> subscriptions, + Optional destination, + Optional status, + Map additionalProperties) { + this.name = name; + this.subscriptions = subscriptions; + this.destination = destination; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the event stream. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of event types subscribed to in this stream. + */ + @JsonProperty("subscriptions") + public Optional> getSubscriptions() { + return subscriptions; + } + + @JsonProperty("destination") + public Optional getDestination() { + return destination; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEventStreamRequestContent && equalTo((UpdateEventStreamRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateEventStreamRequestContent other) { + return name.equals(other.name) + && subscriptions.equals(other.subscriptions) + && destination.equals(other.destination) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subscriptions, this.destination, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional> subscriptions = Optional.empty(); + + private Optional destination = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateEventStreamRequestContent other) { + name(other.getName()); + subscriptions(other.getSubscriptions()); + destination(other.getDestination()); + status(other.getStatus()); + return this; + } + + /** + *

Name of the event stream.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

List of event types subscribed to in this stream.

+ */ + @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) + public Builder subscriptions(Optional> subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public Builder subscriptions(List subscriptions) { + this.subscriptions = Optional.ofNullable(subscriptions); + return this; + } + + @JsonSetter(value = "destination", nulls = Nulls.SKIP) + public Builder destination(Optional destination) { + this.destination = destination; + return this; + } + + public Builder destination(EventStreamDestinationPatch destination) { + this.destination = Optional.ofNullable(destination); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(EventStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + public UpdateEventStreamRequestContent build() { + return new UpdateEventStreamRequestContent(name, subscriptions, destination, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java new file mode 100644 index 000000000..b2dbd0284 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UpdateEventStreamResponseContent.Deserializer.class) +public final class UpdateEventStreamResponseContent { + private final Object value; + + private final int type; + + private UpdateEventStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventStreamWebhookResponseContent) this.value); + } else if (this.type == 1) { + return visitor.visit((EventStreamEventBridgeResponseContent) this.value); + } else if (this.type == 2) { + return visitor.visit((EventStreamActionResponseContent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateEventStreamResponseContent && equalTo((UpdateEventStreamResponseContent) other); + } + + private boolean equalTo(UpdateEventStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UpdateEventStreamResponseContent of(EventStreamWebhookResponseContent value) { + return new UpdateEventStreamResponseContent(value, 0); + } + + public static UpdateEventStreamResponseContent of(EventStreamEventBridgeResponseContent value) { + return new UpdateEventStreamResponseContent(value, 1); + } + + public static UpdateEventStreamResponseContent of(EventStreamActionResponseContent value) { + return new UpdateEventStreamResponseContent(value, 2); + } + + public interface Visitor { + T visit(EventStreamWebhookResponseContent value); + + T visit(EventStreamEventBridgeResponseContent value); + + T visit(EventStreamActionResponseContent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateEventStreamResponseContent.class); + } + + @java.lang.Override + public UpdateEventStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamWebhookResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamEventBridgeResponseContent.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventStreamActionResponseContent.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowRequestContent.java new file mode 100644 index 000000000..d71828b46 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowRequestContent.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFlowRequestContent.Builder.class) +public final class UpdateFlowRequestContent { + private final Optional name; + + private final Optional> actions; + + private final Map additionalProperties; + + private UpdateFlowRequestContent( + Optional name, Optional> actions, Map additionalProperties) { + this.name = name; + this.actions = actions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFlowRequestContent && equalTo((UpdateFlowRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFlowRequestContent other) { + return name.equals(other.name) && actions.equals(other.actions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.actions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateFlowRequestContent other) { + name(other.getName()); + actions(other.getActions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public Builder actions(Optional> actions) { + this.actions = actions; + return this; + } + + public Builder actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + public UpdateFlowRequestContent build() { + return new UpdateFlowRequestContent(name, actions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java new file mode 100644 index 000000000..dd6e1cb24 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFlowResponseContent.Builder.class) +public final class UpdateFlowResponseContent { + private final String id; + + private final String name; + + private final Optional> actions; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional executedAt; + + private final Map additionalProperties; + + private UpdateFlowResponseContent( + String id, + String name, + Optional> actions, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional executedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.actions = actions; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.executedAt = executedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("actions") + public Optional> getActions() { + return actions; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("executed_at") + public Optional getExecutedAt() { + return executedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFlowResponseContent && equalTo((UpdateFlowResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFlowResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && actions.equals(other.actions) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && executedAt.equals(other.executedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(UpdateFlowResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + UpdateFlowResponseContent build(); + + _FinalStage actions(Optional> actions); + + _FinalStage actions(List actions); + + _FinalStage executedAt(Optional executedAt); + + _FinalStage executedAt(String executedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional executedAt = Optional.empty(); + + private Optional> actions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateFlowResponseContent other) { + id(other.getId()); + name(other.getName()); + actions(other.getActions()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + executedAt(other.getExecutedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage executedAt(String executedAt) { + this.executedAt = Optional.ofNullable(executedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) + public _FinalStage executedAt(Optional executedAt) { + this.executedAt = executedAt; + return this; + } + + @java.lang.Override + public _FinalStage actions(List actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public _FinalStage actions(Optional> actions) { + this.actions = actions; + return this; + } + + @java.lang.Override + public UpdateFlowResponseContent build() { + return new UpdateFlowResponseContent( + id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java new file mode 100644 index 000000000..fef7660b5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java @@ -0,0 +1,425 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFormRequestContent.Builder.class) +public final class UpdateFormRequestContent { + private final Optional name; + + private final OptionalNullable messages; + + private final OptionalNullable languages; + + private final OptionalNullable> translations; + + private final OptionalNullable> nodes; + + private final OptionalNullable start; + + private final OptionalNullable ending; + + private final OptionalNullable style; + + private final Map additionalProperties; + + private UpdateFormRequestContent( + Optional name, + OptionalNullable messages, + OptionalNullable languages, + OptionalNullable> translations, + OptionalNullable> nodes, + OptionalNullable start, + OptionalNullable ending, + OptionalNullable style, + Map additionalProperties) { + this.name = name; + this.messages = messages; + this.languages = languages; + this.translations = translations; + this.nodes = nodes; + this.start = start; + this.ending = ending; + this.style = style; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("messages") + public OptionalNullable getMessages() { + return messages; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("languages") + public OptionalNullable getLanguages() { + return languages; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("translations") + public OptionalNullable> getTranslations() { + return translations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("nodes") + public OptionalNullable> getNodes() { + return nodes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start") + public OptionalNullable getStart() { + return start; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ending") + public OptionalNullable getEnding() { + return ending; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("style") + public OptionalNullable getStyle() { + return style; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFormRequestContent && equalTo((UpdateFormRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFormRequestContent other) { + return name.equals(other.name) + && messages.equals(other.messages) + && languages.equals(other.languages) + && translations.equals(other.translations) + && nodes.equals(other.nodes) + && start.equals(other.start) + && ending.equals(other.ending) + && style.equals(other.style); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.messages, + this.languages, + this.translations, + this.nodes, + this.start, + this.ending, + this.style); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private OptionalNullable messages = OptionalNullable.absent(); + + private OptionalNullable languages = OptionalNullable.absent(); + + private OptionalNullable> translations = OptionalNullable.absent(); + + private OptionalNullable> nodes = OptionalNullable.absent(); + + private OptionalNullable start = OptionalNullable.absent(); + + private OptionalNullable ending = OptionalNullable.absent(); + + private OptionalNullable style = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateFormRequestContent other) { + name(other.getName()); + messages(other.getMessages()); + languages(other.getLanguages()); + translations(other.getTranslations()); + nodes(other.getNodes()); + start(other.getStart()); + ending(other.getEnding()); + style(other.getStyle()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public Builder messages(OptionalNullable messages) { + this.messages = messages; + return this; + } + + public Builder messages(FormMessages messages) { + this.messages = OptionalNullable.of(messages); + return this; + } + + public Builder messages(Optional messages) { + if (messages.isPresent()) { + this.messages = OptionalNullable.of(messages.get()); + } else { + this.messages = OptionalNullable.absent(); + } + return this; + } + + public Builder messages(Nullable messages) { + if (messages.isNull()) { + this.messages = OptionalNullable.ofNull(); + } else if (messages.isEmpty()) { + this.messages = OptionalNullable.absent(); + } else { + this.messages = OptionalNullable.of(messages.get()); + } + return this; + } + + @JsonSetter(value = "languages", nulls = Nulls.SKIP) + public Builder languages(OptionalNullable languages) { + this.languages = languages; + return this; + } + + public Builder languages(FormLanguages languages) { + this.languages = OptionalNullable.of(languages); + return this; + } + + public Builder languages(Optional languages) { + if (languages.isPresent()) { + this.languages = OptionalNullable.of(languages.get()); + } else { + this.languages = OptionalNullable.absent(); + } + return this; + } + + public Builder languages(Nullable languages) { + if (languages.isNull()) { + this.languages = OptionalNullable.ofNull(); + } else if (languages.isEmpty()) { + this.languages = OptionalNullable.absent(); + } else { + this.languages = OptionalNullable.of(languages.get()); + } + return this; + } + + @JsonSetter(value = "translations", nulls = Nulls.SKIP) + public Builder translations(OptionalNullable> translations) { + this.translations = translations; + return this; + } + + public Builder translations(Map translations) { + this.translations = OptionalNullable.of(translations); + return this; + } + + public Builder translations(Optional> translations) { + if (translations.isPresent()) { + this.translations = OptionalNullable.of(translations.get()); + } else { + this.translations = OptionalNullable.absent(); + } + return this; + } + + public Builder translations(Nullable> translations) { + if (translations.isNull()) { + this.translations = OptionalNullable.ofNull(); + } else if (translations.isEmpty()) { + this.translations = OptionalNullable.absent(); + } else { + this.translations = OptionalNullable.of(translations.get()); + } + return this; + } + + @JsonSetter(value = "nodes", nulls = Nulls.SKIP) + public Builder nodes(OptionalNullable> nodes) { + this.nodes = nodes; + return this; + } + + public Builder nodes(List nodes) { + this.nodes = OptionalNullable.of(nodes); + return this; + } + + public Builder nodes(Optional> nodes) { + if (nodes.isPresent()) { + this.nodes = OptionalNullable.of(nodes.get()); + } else { + this.nodes = OptionalNullable.absent(); + } + return this; + } + + public Builder nodes(Nullable> nodes) { + if (nodes.isNull()) { + this.nodes = OptionalNullable.ofNull(); + } else if (nodes.isEmpty()) { + this.nodes = OptionalNullable.absent(); + } else { + this.nodes = OptionalNullable.of(nodes.get()); + } + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(OptionalNullable start) { + this.start = start; + return this; + } + + public Builder start(FormStartNode start) { + this.start = OptionalNullable.of(start); + return this; + } + + public Builder start(Optional start) { + if (start.isPresent()) { + this.start = OptionalNullable.of(start.get()); + } else { + this.start = OptionalNullable.absent(); + } + return this; + } + + public Builder start(Nullable start) { + if (start.isNull()) { + this.start = OptionalNullable.ofNull(); + } else if (start.isEmpty()) { + this.start = OptionalNullable.absent(); + } else { + this.start = OptionalNullable.of(start.get()); + } + return this; + } + + @JsonSetter(value = "ending", nulls = Nulls.SKIP) + public Builder ending(OptionalNullable ending) { + this.ending = ending; + return this; + } + + public Builder ending(FormEndingNode ending) { + this.ending = OptionalNullable.of(ending); + return this; + } + + public Builder ending(Optional ending) { + if (ending.isPresent()) { + this.ending = OptionalNullable.of(ending.get()); + } else { + this.ending = OptionalNullable.absent(); + } + return this; + } + + public Builder ending(Nullable ending) { + if (ending.isNull()) { + this.ending = OptionalNullable.ofNull(); + } else if (ending.isEmpty()) { + this.ending = OptionalNullable.absent(); + } else { + this.ending = OptionalNullable.of(ending.get()); + } + return this; + } + + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public Builder style(OptionalNullable style) { + this.style = style; + return this; + } + + public Builder style(FormStyle style) { + this.style = OptionalNullable.of(style); + return this; + } + + public Builder style(Optional style) { + if (style.isPresent()) { + this.style = OptionalNullable.of(style.get()); + } else { + this.style = OptionalNullable.absent(); + } + return this; + } + + public Builder style(Nullable style) { + if (style.isNull()) { + this.style = OptionalNullable.ofNull(); + } else if (style.isEmpty()) { + this.style = OptionalNullable.absent(); + } else { + this.style = OptionalNullable.of(style.get()); + } + return this; + } + + public UpdateFormRequestContent build() { + return new UpdateFormRequestContent( + name, messages, languages, translations, nodes, start, ending, style, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java new file mode 100644 index 000000000..b439045f4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFormResponseContent.Builder.class) +public final class UpdateFormResponseContent { + private final String id; + + private final String name; + + private final Optional messages; + + private final Optional languages; + + private final Optional> translations; + + private final Optional> nodes; + + private final Optional start; + + private final Optional ending; + + private final Optional style; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional embeddedAt; + + private final Optional submittedAt; + + private final Map additionalProperties; + + private UpdateFormResponseContent( + String id, + String name, + Optional messages, + Optional languages, + Optional> translations, + Optional> nodes, + Optional start, + Optional ending, + Optional style, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional embeddedAt, + Optional submittedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.messages = messages; + this.languages = languages; + this.translations = translations; + this.nodes = nodes; + this.start = start; + this.ending = ending; + this.style = style; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.embeddedAt = embeddedAt; + this.submittedAt = submittedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("messages") + public Optional getMessages() { + return messages; + } + + @JsonProperty("languages") + public Optional getLanguages() { + return languages; + } + + @JsonProperty("translations") + public Optional> getTranslations() { + return translations; + } + + @JsonProperty("nodes") + public Optional> getNodes() { + return nodes; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("ending") + public Optional getEnding() { + return ending; + } + + @JsonProperty("style") + public Optional getStyle() { + return style; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("embedded_at") + public Optional getEmbeddedAt() { + return embeddedAt; + } + + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFormResponseContent && equalTo((UpdateFormResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFormResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && messages.equals(other.messages) + && languages.equals(other.languages) + && translations.equals(other.translations) + && nodes.equals(other.nodes) + && start.equals(other.start) + && ending.equals(other.ending) + && style.equals(other.style) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && embeddedAt.equals(other.embeddedAt) + && submittedAt.equals(other.submittedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.messages, + this.languages, + this.translations, + this.nodes, + this.start, + this.ending, + this.style, + this.createdAt, + this.updatedAt, + this.embeddedAt, + this.submittedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(UpdateFormResponseContent other); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + UpdateFormResponseContent build(); + + _FinalStage messages(Optional messages); + + _FinalStage messages(FormMessages messages); + + _FinalStage languages(Optional languages); + + _FinalStage languages(FormLanguages languages); + + _FinalStage translations(Optional> translations); + + _FinalStage translations(Map translations); + + _FinalStage nodes(Optional> nodes); + + _FinalStage nodes(List nodes); + + _FinalStage start(Optional start); + + _FinalStage start(FormStartNode start); + + _FinalStage ending(Optional ending); + + _FinalStage ending(FormEndingNode ending); + + _FinalStage style(Optional style); + + _FinalStage style(FormStyle style); + + _FinalStage embeddedAt(Optional embeddedAt); + + _FinalStage embeddedAt(String embeddedAt); + + _FinalStage submittedAt(Optional submittedAt); + + _FinalStage submittedAt(String submittedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String name; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional submittedAt = Optional.empty(); + + private Optional embeddedAt = Optional.empty(); + + private Optional style = Optional.empty(); + + private Optional ending = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional> nodes = Optional.empty(); + + private Optional> translations = Optional.empty(); + + private Optional languages = Optional.empty(); + + private Optional messages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateFormResponseContent other) { + id(other.getId()); + name(other.getName()); + messages(other.getMessages()); + languages(other.getLanguages()); + translations(other.getTranslations()); + nodes(other.getNodes()); + start(other.getStart()); + ending(other.getEnding()); + style(other.getStyle()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + embeddedAt(other.getEmbeddedAt()); + submittedAt(other.getSubmittedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage submittedAt(String submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) + public _FinalStage submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + @java.lang.Override + public _FinalStage embeddedAt(String embeddedAt) { + this.embeddedAt = Optional.ofNullable(embeddedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) + public _FinalStage embeddedAt(Optional embeddedAt) { + this.embeddedAt = embeddedAt; + return this; + } + + @java.lang.Override + public _FinalStage style(FormStyle style) { + this.style = Optional.ofNullable(style); + return this; + } + + @java.lang.Override + @JsonSetter(value = "style", nulls = Nulls.SKIP) + public _FinalStage style(Optional style) { + this.style = style; + return this; + } + + @java.lang.Override + public _FinalStage ending(FormEndingNode ending) { + this.ending = Optional.ofNullable(ending); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ending", nulls = Nulls.SKIP) + public _FinalStage ending(Optional ending) { + this.ending = ending; + return this; + } + + @java.lang.Override + public _FinalStage start(FormStartNode start) { + this.start = Optional.ofNullable(start); + return this; + } + + @java.lang.Override + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public _FinalStage start(Optional start) { + this.start = start; + return this; + } + + @java.lang.Override + public _FinalStage nodes(List nodes) { + this.nodes = Optional.ofNullable(nodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nodes", nulls = Nulls.SKIP) + public _FinalStage nodes(Optional> nodes) { + this.nodes = nodes; + return this; + } + + @java.lang.Override + public _FinalStage translations(Map translations) { + this.translations = Optional.ofNullable(translations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "translations", nulls = Nulls.SKIP) + public _FinalStage translations(Optional> translations) { + this.translations = translations; + return this; + } + + @java.lang.Override + public _FinalStage languages(FormLanguages languages) { + this.languages = Optional.ofNullable(languages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "languages", nulls = Nulls.SKIP) + public _FinalStage languages(Optional languages) { + this.languages = languages; + return this; + } + + @java.lang.Override + public _FinalStage messages(FormMessages messages) { + this.messages = Optional.ofNullable(messages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "messages", nulls = Nulls.SKIP) + public _FinalStage messages(Optional messages) { + this.messages = messages; + return this; + } + + @java.lang.Override + public UpdateFormResponseContent build() { + return new UpdateFormResponseContent( + id, + name, + messages, + languages, + translations, + nodes, + start, + ending, + style, + createdAt, + updatedAt, + embeddedAt, + submittedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java new file mode 100644 index 000000000..634e09d9d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorDuoSettingsResponseContent.Builder.class) +public final class UpdateGuardianFactorDuoSettingsResponseContent { + private final Optional ikey; + + private final Optional skey; + + private final Optional host; + + private final Map additionalProperties; + + private UpdateGuardianFactorDuoSettingsResponseContent( + Optional ikey, + Optional skey, + Optional host, + Map additionalProperties) { + this.ikey = ikey; + this.skey = skey; + this.host = host; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ikey") + public Optional getIkey() { + return ikey; + } + + @JsonProperty("skey") + public Optional getSkey() { + return skey; + } + + @JsonProperty("host") + public Optional getHost() { + return host; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorDuoSettingsResponseContent + && equalTo((UpdateGuardianFactorDuoSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorDuoSettingsResponseContent other) { + return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ikey, this.skey, this.host); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ikey = Optional.empty(); + + private Optional skey = Optional.empty(); + + private Optional host = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorDuoSettingsResponseContent other) { + ikey(other.getIkey()); + skey(other.getSkey()); + host(other.getHost()); + return this; + } + + @JsonSetter(value = "ikey", nulls = Nulls.SKIP) + public Builder ikey(Optional ikey) { + this.ikey = ikey; + return this; + } + + public Builder ikey(String ikey) { + this.ikey = Optional.ofNullable(ikey); + return this; + } + + @JsonSetter(value = "skey", nulls = Nulls.SKIP) + public Builder skey(Optional skey) { + this.skey = skey; + return this; + } + + public Builder skey(String skey) { + this.skey = Optional.ofNullable(skey); + return this; + } + + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + public UpdateGuardianFactorDuoSettingsResponseContent build() { + return new UpdateGuardianFactorDuoSettingsResponseContent(ikey, skey, host, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java new file mode 100644 index 000000000..72a5d6a4f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationSnsResponseContent { + private final OptionalNullable awsAccessKeyId; + + private final OptionalNullable awsSecretAccessKey; + + private final OptionalNullable awsRegion; + + private final OptionalNullable snsApnsPlatformApplicationArn; + + private final OptionalNullable snsGcmPlatformApplicationArn; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationSnsResponseContent( + OptionalNullable awsAccessKeyId, + OptionalNullable awsSecretAccessKey, + OptionalNullable awsRegion, + OptionalNullable snsApnsPlatformApplicationArn, + OptionalNullable snsGcmPlatformApplicationArn, + Map additionalProperties) { + this.awsAccessKeyId = awsAccessKeyId; + this.awsSecretAccessKey = awsSecretAccessKey; + this.awsRegion = awsRegion; + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + public OptionalNullable getAwsAccessKeyId() { + if (awsAccessKeyId == null) { + return OptionalNullable.absent(); + } + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + public OptionalNullable getAwsSecretAccessKey() { + if (awsSecretAccessKey == null) { + return OptionalNullable.absent(); + } + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + public OptionalNullable getAwsRegion() { + if (awsRegion == null) { + return OptionalNullable.absent(); + } + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + public OptionalNullable getSnsApnsPlatformApplicationArn() { + if (snsApnsPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + public OptionalNullable getSnsGcmPlatformApplicationArn() { + if (snsGcmPlatformApplicationArn == null) { + return OptionalNullable.absent(); + } + return snsGcmPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_access_key_id") + private OptionalNullable _getAwsAccessKeyId() { + return awsAccessKeyId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_secret_access_key") + private OptionalNullable _getAwsSecretAccessKey() { + return awsSecretAccessKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("aws_region") + private OptionalNullable _getAwsRegion() { + return awsRegion; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_apns_platform_application_arn") + private OptionalNullable _getSnsApnsPlatformApplicationArn() { + return snsApnsPlatformApplicationArn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sns_gcm_platform_application_arn") + private OptionalNullable _getSnsGcmPlatformApplicationArn() { + return snsGcmPlatformApplicationArn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsResponseContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationSnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsResponseContent other) { + return awsAccessKeyId.equals(other.awsAccessKeyId) + && awsSecretAccessKey.equals(other.awsSecretAccessKey) + && awsRegion.equals(other.awsRegion) + && snsApnsPlatformApplicationArn.equals(other.snsApnsPlatformApplicationArn) + && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.awsAccessKeyId, + this.awsSecretAccessKey, + this.awsRegion, + this.snsApnsPlatformApplicationArn, + this.snsGcmPlatformApplicationArn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable awsAccessKeyId = OptionalNullable.absent(); + + private OptionalNullable awsSecretAccessKey = OptionalNullable.absent(); + + private OptionalNullable awsRegion = OptionalNullable.absent(); + + private OptionalNullable snsApnsPlatformApplicationArn = OptionalNullable.absent(); + + private OptionalNullable snsGcmPlatformApplicationArn = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationSnsResponseContent other) { + awsAccessKeyId(other.getAwsAccessKeyId()); + awsSecretAccessKey(other.getAwsSecretAccessKey()); + awsRegion(other.getAwsRegion()); + snsApnsPlatformApplicationArn(other.getSnsApnsPlatformApplicationArn()); + snsGcmPlatformApplicationArn(other.getSnsGcmPlatformApplicationArn()); + return this; + } + + @JsonSetter(value = "aws_access_key_id", nulls = Nulls.SKIP) + public Builder awsAccessKeyId(@Nullable OptionalNullable awsAccessKeyId) { + this.awsAccessKeyId = awsAccessKeyId; + return this; + } + + public Builder awsAccessKeyId(String awsAccessKeyId) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId); + return this; + } + + public Builder awsAccessKeyId(Optional awsAccessKeyId) { + if (awsAccessKeyId.isPresent()) { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } else { + this.awsAccessKeyId = OptionalNullable.absent(); + } + return this; + } + + public Builder awsAccessKeyId(com.auth0.client.mgmt.core.Nullable awsAccessKeyId) { + if (awsAccessKeyId.isNull()) { + this.awsAccessKeyId = OptionalNullable.ofNull(); + } else if (awsAccessKeyId.isEmpty()) { + this.awsAccessKeyId = OptionalNullable.absent(); + } else { + this.awsAccessKeyId = OptionalNullable.of(awsAccessKeyId.get()); + } + return this; + } + + @JsonSetter(value = "aws_secret_access_key", nulls = Nulls.SKIP) + public Builder awsSecretAccessKey(@Nullable OptionalNullable awsSecretAccessKey) { + this.awsSecretAccessKey = awsSecretAccessKey; + return this; + } + + public Builder awsSecretAccessKey(String awsSecretAccessKey) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey); + return this; + } + + public Builder awsSecretAccessKey(Optional awsSecretAccessKey) { + if (awsSecretAccessKey.isPresent()) { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } else { + this.awsSecretAccessKey = OptionalNullable.absent(); + } + return this; + } + + public Builder awsSecretAccessKey(com.auth0.client.mgmt.core.Nullable awsSecretAccessKey) { + if (awsSecretAccessKey.isNull()) { + this.awsSecretAccessKey = OptionalNullable.ofNull(); + } else if (awsSecretAccessKey.isEmpty()) { + this.awsSecretAccessKey = OptionalNullable.absent(); + } else { + this.awsSecretAccessKey = OptionalNullable.of(awsSecretAccessKey.get()); + } + return this; + } + + @JsonSetter(value = "aws_region", nulls = Nulls.SKIP) + public Builder awsRegion(@Nullable OptionalNullable awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + public Builder awsRegion(String awsRegion) { + this.awsRegion = OptionalNullable.of(awsRegion); + return this; + } + + public Builder awsRegion(Optional awsRegion) { + if (awsRegion.isPresent()) { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } else { + this.awsRegion = OptionalNullable.absent(); + } + return this; + } + + public Builder awsRegion(com.auth0.client.mgmt.core.Nullable awsRegion) { + if (awsRegion.isNull()) { + this.awsRegion = OptionalNullable.ofNull(); + } else if (awsRegion.isEmpty()) { + this.awsRegion = OptionalNullable.absent(); + } else { + this.awsRegion = OptionalNullable.of(awsRegion.get()); + } + return this; + } + + @JsonSetter(value = "sns_apns_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsApnsPlatformApplicationArn(@Nullable OptionalNullable snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = snsApnsPlatformApplicationArn; + return this; + } + + public Builder snsApnsPlatformApplicationArn(String snsApnsPlatformApplicationArn) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn); + return this; + } + + public Builder snsApnsPlatformApplicationArn(Optional snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isPresent()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsApnsPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsApnsPlatformApplicationArn) { + if (snsApnsPlatformApplicationArn.isNull()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsApnsPlatformApplicationArn.isEmpty()) { + this.snsApnsPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsApnsPlatformApplicationArn = OptionalNullable.of(snsApnsPlatformApplicationArn.get()); + } + return this; + } + + @JsonSetter(value = "sns_gcm_platform_application_arn", nulls = Nulls.SKIP) + public Builder snsGcmPlatformApplicationArn(@Nullable OptionalNullable snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = snsGcmPlatformApplicationArn; + return this; + } + + public Builder snsGcmPlatformApplicationArn(String snsGcmPlatformApplicationArn) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn); + return this; + } + + public Builder snsGcmPlatformApplicationArn(Optional snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isPresent()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } + return this; + } + + public Builder snsGcmPlatformApplicationArn( + com.auth0.client.mgmt.core.Nullable snsGcmPlatformApplicationArn) { + if (snsGcmPlatformApplicationArn.isNull()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.ofNull(); + } else if (snsGcmPlatformApplicationArn.isEmpty()) { + this.snsGcmPlatformApplicationArn = OptionalNullable.absent(); + } else { + this.snsGcmPlatformApplicationArn = OptionalNullable.of(snsGcmPlatformApplicationArn.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationSnsResponseContent build() { + return new UpdateGuardianFactorsProviderPushNotificationSnsResponseContent( + awsAccessKeyId, + awsSecretAccessKey, + awsRegion, + snsApnsPlatformApplicationArn, + snsGcmPlatformApplicationArn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java new file mode 100644 index 000000000..811065047 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateHookRequestContent.Builder.class) +public final class UpdateHookRequestContent { + private final Optional name; + + private final Optional script; + + private final Optional enabled; + + private final Optional> dependencies; + + private final Map additionalProperties; + + private UpdateHookRequestContent( + Optional name, + Optional script, + Optional enabled, + Optional> dependencies, + Map additionalProperties) { + this.name = name; + this.script = script; + this.enabled = enabled; + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateHookRequestContent && equalTo((UpdateHookRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateHookRequestContent other) { + return name.equals(other.name) + && script.equals(other.script) + && enabled.equals(other.enabled) + && dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.script, this.enabled, this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateHookRequestContent other) { + name(other.getName()); + script(other.getScript()); + enabled(other.getEnabled()); + dependencies(other.getDependencies()); + return this; + } + + /** + *

Name of this hook.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public UpdateHookRequestContent build() { + return new UpdateHookRequestContent(name, script, enabled, dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java new file mode 100644 index 000000000..bbbab3cfa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java @@ -0,0 +1,248 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateHookResponseContent.Builder.class) +public final class UpdateHookResponseContent { + private final Optional triggerId; + + private final Optional id; + + private final Optional name; + + private final Optional enabled; + + private final Optional script; + + private final Optional> dependencies; + + private final Map additionalProperties; + + private UpdateHookResponseContent( + Optional triggerId, + Optional id, + Optional name, + Optional enabled, + Optional script, + Optional> dependencies, + Map additionalProperties) { + this.triggerId = triggerId; + this.id = id; + this.name = name; + this.enabled = enabled; + this.script = script; + this.dependencies = dependencies; + this.additionalProperties = additionalProperties; + } + + /** + * @return Trigger ID + */ + @JsonProperty("triggerId") + public Optional getTriggerId() { + return triggerId; + } + + /** + * @return ID of this hook. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this hook. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this hook will be executed (true) or ignored (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this hook runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + @JsonProperty("dependencies") + public Optional> getDependencies() { + return dependencies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateHookResponseContent && equalTo((UpdateHookResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateHookResponseContent other) { + return triggerId.equals(other.triggerId) + && id.equals(other.id) + && name.equals(other.name) + && enabled.equals(other.enabled) + && script.equals(other.script) + && dependencies.equals(other.dependencies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional triggerId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional> dependencies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateHookResponseContent other) { + triggerId(other.getTriggerId()); + id(other.getId()); + name(other.getName()); + enabled(other.getEnabled()); + script(other.getScript()); + dependencies(other.getDependencies()); + return this; + } + + /** + *

Trigger ID

+ */ + @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) + public Builder triggerId(Optional triggerId) { + this.triggerId = triggerId; + return this; + } + + public Builder triggerId(String triggerId) { + this.triggerId = Optional.ofNullable(triggerId); + return this; + } + + /** + *

ID of this hook.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this hook.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this hook will be executed (true) or ignored (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this hook runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + public UpdateHookResponseContent build() { + return new UpdateHookResponseContent( + triggerId, id, name, enabled, script, dependencies, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java new file mode 100644 index 000000000..f6ea3cb1c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateLogStreamRequestContent.Builder.class) +public final class UpdateLogStreamRequestContent { + private final Optional name; + + private final Optional status; + + private final Optional isPriority; + + private final Optional> filters; + + private final Optional piiConfig; + + private final Optional sink; + + private final Map additionalProperties; + + private UpdateLogStreamRequestContent( + Optional name, + Optional status, + Optional isPriority, + Optional> filters, + Optional piiConfig, + Optional sink, + Map additionalProperties) { + this.name = name; + this.status = status; + this.isPriority = isPriority; + this.filters = filters; + this.piiConfig = piiConfig; + this.sink = sink; + this.additionalProperties = additionalProperties; + } + + /** + * @return log stream name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return True for priority log streams, false for non-priority + */ + @JsonProperty("isPriority") + public Optional getIsPriority() { + return isPriority; + } + + /** + * @return Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + */ + @JsonProperty("filters") + public Optional> getFilters() { + return filters; + } + + @JsonProperty("pii_config") + public Optional getPiiConfig() { + return piiConfig; + } + + @JsonProperty("sink") + public Optional getSink() { + return sink; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateLogStreamRequestContent && equalTo((UpdateLogStreamRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateLogStreamRequestContent other) { + return name.equals(other.name) + && status.equals(other.status) + && isPriority.equals(other.isPriority) + && filters.equals(other.filters) + && piiConfig.equals(other.piiConfig) + && sink.equals(other.sink); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.status, this.isPriority, this.filters, this.piiConfig, this.sink); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional isPriority = Optional.empty(); + + private Optional> filters = Optional.empty(); + + private Optional piiConfig = Optional.empty(); + + private Optional sink = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateLogStreamRequestContent other) { + name(other.getName()); + status(other.getStatus()); + isPriority(other.getIsPriority()); + filters(other.getFilters()); + piiConfig(other.getPiiConfig()); + sink(other.getSink()); + return this; + } + + /** + *

log stream name

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LogStreamStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

True for priority log streams, false for non-priority

+ */ + @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) + public Builder isPriority(Optional isPriority) { + this.isPriority = isPriority; + return this; + } + + public Builder isPriority(Boolean isPriority) { + this.isPriority = Optional.ofNullable(isPriority); + return this; + } + + /** + *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

+ */ + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public Builder filters(Optional> filters) { + this.filters = filters; + return this; + } + + public Builder filters(List filters) { + this.filters = Optional.ofNullable(filters); + return this; + } + + @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) + public Builder piiConfig(Optional piiConfig) { + this.piiConfig = piiConfig; + return this; + } + + public Builder piiConfig(LogStreamPiiConfig piiConfig) { + this.piiConfig = Optional.ofNullable(piiConfig); + return this; + } + + @JsonSetter(value = "sink", nulls = Nulls.SKIP) + public Builder sink(Optional sink) { + this.sink = sink; + return this; + } + + public Builder sink(LogStreamSinkPatch sink) { + this.sink = Optional.ofNullable(sink); + return this; + } + + public UpdateLogStreamRequestContent build() { + return new UpdateLogStreamRequestContent( + name, status, isPriority, filters, piiConfig, sink, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java new file mode 100644 index 000000000..7f02c46ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UpdateLogStreamResponseContent.Deserializer.class) +public final class UpdateLogStreamResponseContent { + private final Object value; + + private final int type; + + private UpdateLogStreamResponseContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LogStreamHttpResponseSchema) this.value); + } else if (this.type == 1) { + return visitor.visit((LogStreamEventBridgeResponseSchema) this.value); + } else if (this.type == 2) { + return visitor.visit((LogStreamEventGridResponseSchema) this.value); + } else if (this.type == 3) { + return visitor.visit((LogStreamDatadogResponseSchema) this.value); + } else if (this.type == 4) { + return visitor.visit((LogStreamSplunkResponseSchema) this.value); + } else if (this.type == 5) { + return visitor.visit((LogStreamSumoResponseSchema) this.value); + } else if (this.type == 6) { + return visitor.visit((LogStreamSegmentResponseSchema) this.value); + } else if (this.type == 7) { + return visitor.visit((LogStreamMixpanelResponseSchema) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateLogStreamResponseContent && equalTo((UpdateLogStreamResponseContent) other); + } + + private boolean equalTo(UpdateLogStreamResponseContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UpdateLogStreamResponseContent of(LogStreamHttpResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 0); + } + + public static UpdateLogStreamResponseContent of(LogStreamEventBridgeResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 1); + } + + public static UpdateLogStreamResponseContent of(LogStreamEventGridResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 2); + } + + public static UpdateLogStreamResponseContent of(LogStreamDatadogResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 3); + } + + public static UpdateLogStreamResponseContent of(LogStreamSplunkResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 4); + } + + public static UpdateLogStreamResponseContent of(LogStreamSumoResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 5); + } + + public static UpdateLogStreamResponseContent of(LogStreamSegmentResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 6); + } + + public static UpdateLogStreamResponseContent of(LogStreamMixpanelResponseSchema value) { + return new UpdateLogStreamResponseContent(value, 7); + } + + public interface Visitor { + T visit(LogStreamHttpResponseSchema value); + + T visit(LogStreamEventBridgeResponseSchema value); + + T visit(LogStreamEventGridResponseSchema value); + + T visit(LogStreamDatadogResponseSchema value); + + T visit(LogStreamSplunkResponseSchema value); + + T visit(LogStreamSumoResponseSchema value); + + T visit(LogStreamSegmentResponseSchema value); + + T visit(LogStreamMixpanelResponseSchema value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateLogStreamResponseContent.class); + } + + @java.lang.Override + public UpdateLogStreamResponseContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamHttpResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventBridgeResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamEventGridResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamDatadogResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSplunkResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSumoResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamSegmentResponseSchema.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LogStreamMixpanelResponseSchema.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclRequestContent.java new file mode 100644 index 000000000..bb297f74c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclRequestContent.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateNetworkAclRequestContent.Builder.class) +public final class UpdateNetworkAclRequestContent { + private final Optional description; + + private final Optional active; + + private final Optional priority; + + private final Optional rule; + + private final Map additionalProperties; + + private UpdateNetworkAclRequestContent( + Optional description, + Optional active, + Optional priority, + Optional rule, + Map additionalProperties) { + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Indicates whether or not this access control list is actively being used + */ + @JsonProperty("active") + public Optional getActive() { + return active; + } + + /** + * @return Indicates the order in which the ACL will be evaluated relative to other ACL rules. + */ + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("rule") + public Optional getRule() { + return rule; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateNetworkAclRequestContent && equalTo((UpdateNetworkAclRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateNetworkAclRequestContent other) { + return description.equals(other.description) + && active.equals(other.active) + && priority.equals(other.priority) + && rule.equals(other.rule); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.description, this.active, this.priority, this.rule); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional description = Optional.empty(); + + private Optional active = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional rule = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateNetworkAclRequestContent other) { + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Indicates whether or not this access control list is actively being used

+ */ + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + /** + *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

+ */ + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(Double priority) { + this.priority = Optional.ofNullable(priority); + return this; + } + + @JsonSetter(value = "rule", nulls = Nulls.SKIP) + public Builder rule(Optional rule) { + this.rule = rule; + return this; + } + + public Builder rule(NetworkAclRule rule) { + this.rule = Optional.ofNullable(rule); + return this; + } + + public UpdateNetworkAclRequestContent build() { + return new UpdateNetworkAclRequestContent(description, active, priority, rule, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java new file mode 100644 index 000000000..9b15c8f06 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateNetworkAclResponseContent.Builder.class) +public final class UpdateNetworkAclResponseContent { + private final Optional id; + + private final Optional description; + + private final Optional active; + + private final Optional priority; + + private final Optional rule; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private UpdateNetworkAclResponseContent( + Optional id, + Optional description, + Optional active, + Optional priority, + Optional rule, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.description = description; + this.active = active; + this.priority = priority; + this.rule = rule; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("rule") + public Optional getRule() { + return rule; + } + + /** + * @return The timestamp when the Network ACL Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp when the Network ACL Configuration was last updated + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateNetworkAclResponseContent && equalTo((UpdateNetworkAclResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateNetworkAclResponseContent other) { + return id.equals(other.id) + && description.equals(other.description) + && active.equals(other.active) + && priority.equals(other.priority) + && rule.equals(other.rule) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional active = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional rule = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateNetworkAclResponseContent other) { + id(other.getId()); + description(other.getDescription()); + active(other.getActive()); + priority(other.getPriority()); + rule(other.getRule()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(Double priority) { + this.priority = Optional.ofNullable(priority); + return this; + } + + @JsonSetter(value = "rule", nulls = Nulls.SKIP) + public Builder rule(Optional rule) { + this.rule = rule; + return this; + } + + public Builder rule(NetworkAclRule rule) { + this.rule = Optional.ofNullable(rule); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The timestamp when the Network ACL Configuration was last updated

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(String updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public UpdateNetworkAclResponseContent build() { + return new UpdateNetworkAclResponseContent( + id, description, active, priority, rule, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java new file mode 100644 index 000000000..e4707f1de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java @@ -0,0 +1,229 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationConnectionResponseContent.Builder.class) +public final class UpdateOrganizationConnectionResponseContent { + private final Optional connectionId; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional connection; + + private final Map additionalProperties; + + private UpdateOrganizationConnectionResponseContent( + Optional connectionId, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional connection, + Map additionalProperties) { + this.connectionId = connectionId; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the connection. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationConnectionResponseContent + && equalTo((UpdateOrganizationConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationConnectionResponseContent other) { + return connectionId.equals(other.connectionId) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationConnectionResponseContent other) { + connectionId(other.getConnectionId()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + connection(other.getConnection()); + return this; + } + + /** + *

ID of the connection.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public UpdateOrganizationConnectionResponseContent build() { + return new UpdateOrganizationConnectionResponseContent( + connectionId, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + connection, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java new file mode 100644 index 000000000..2fc18091d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationRequestContent.Builder.class) +public final class UpdateOrganizationRequestContent { + private final Optional displayName; + + private final Optional name; + + private final Optional branding; + + private final Optional> metadata; + + private final OptionalNullable tokenQuota; + + private final Map additionalProperties; + + private UpdateOrganizationRequestContent( + Optional displayName, + Optional name, + Optional branding, + Optional> metadata, + OptionalNullable tokenQuota, + Map additionalProperties) { + this.displayName = displayName; + this.name = name; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_quota") + public OptionalNullable getTokenQuota() { + if (tokenQuota == null) { + return OptionalNullable.absent(); + } + return tokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_quota") + private OptionalNullable _getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationRequestContent && equalTo((UpdateOrganizationRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationRequestContent other) { + return displayName.equals(other.displayName) + && name.equals(other.name) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.displayName, this.name, this.branding, this.metadata, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional displayName = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private OptionalNullable tokenQuota = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationRequestContent other) { + displayName(other.getDisplayName()); + name(other.getName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(@Nullable OptionalNullable tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(UpdateTokenQuota tokenQuota) { + this.tokenQuota = OptionalNullable.of(tokenQuota); + return this; + } + + public Builder tokenQuota(Optional tokenQuota) { + if (tokenQuota.isPresent()) { + this.tokenQuota = OptionalNullable.of(tokenQuota.get()); + } else { + this.tokenQuota = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenQuota(com.auth0.client.mgmt.core.Nullable tokenQuota) { + if (tokenQuota.isNull()) { + this.tokenQuota = OptionalNullable.ofNull(); + } else if (tokenQuota.isEmpty()) { + this.tokenQuota = OptionalNullable.absent(); + } else { + this.tokenQuota = OptionalNullable.of(tokenQuota.get()); + } + return this; + } + + public UpdateOrganizationRequestContent build() { + return new UpdateOrganizationRequestContent( + displayName, name, branding, metadata, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java new file mode 100644 index 000000000..28ff63c41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationResponseContent.Builder.class) +public final class UpdateOrganizationResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional> metadata; + + private final Optional tokenQuota; + + private final Map additionalProperties; + + private UpdateOrganizationResponseContent( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional> metadata, + Optional tokenQuota, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationResponseContent && equalTo((UpdateOrganizationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationResponseContent other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + return this; + } + + /** + *

Organization identifier.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of this organization.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + public UpdateOrganizationResponseContent build() { + return new UpdateOrganizationResponseContent( + id, name, displayName, branding, metadata, tokenQuota, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java new file mode 100644 index 000000000..9ed20af9c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdatePhoneTemplateResponseContent.Builder.class) +public final class UpdatePhoneTemplateResponseContent { + private final String id; + + private final Optional channel; + + private final Optional customizable; + + private final Optional tenant; + + private final PhoneTemplateContent content; + + private final PhoneTemplateNotificationTypeEnum type; + + private final boolean disabled; + + private final Map additionalProperties; + + private UpdatePhoneTemplateResponseContent( + String id, + Optional channel, + Optional customizable, + Optional tenant, + PhoneTemplateContent content, + PhoneTemplateNotificationTypeEnum type, + boolean disabled, + Map additionalProperties) { + this.id = id; + this.channel = channel; + this.customizable = customizable; + this.tenant = tenant; + this.content = content; + this.type = type; + this.disabled = disabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("channel") + public Optional getChannel() { + return channel; + } + + @JsonProperty("customizable") + public Optional getCustomizable() { + return customizable; + } + + @JsonProperty("tenant") + public Optional getTenant() { + return tenant; + } + + @JsonProperty("content") + public PhoneTemplateContent getContent() { + return content; + } + + @JsonProperty("type") + public PhoneTemplateNotificationTypeEnum getType() { + return type; + } + + /** + * @return Whether the template is enabled (false) or disabled (true). + */ + @JsonProperty("disabled") + public boolean getDisabled() { + return disabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdatePhoneTemplateResponseContent + && equalTo((UpdatePhoneTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdatePhoneTemplateResponseContent other) { + return id.equals(other.id) + && channel.equals(other.channel) + && customizable.equals(other.customizable) + && tenant.equals(other.tenant) + && content.equals(other.content) + && type.equals(other.type) + && disabled == other.disabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ContentStage id(@NotNull String id); + + Builder from(UpdatePhoneTemplateResponseContent other); + } + + public interface ContentStage { + TypeStage content(@NotNull PhoneTemplateContent content); + } + + public interface TypeStage { + DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type); + } + + public interface DisabledStage { + /** + *

Whether the template is enabled (false) or disabled (true).

+ */ + _FinalStage disabled(boolean disabled); + } + + public interface _FinalStage { + UpdatePhoneTemplateResponseContent build(); + + _FinalStage channel(Optional channel); + + _FinalStage channel(String channel); + + _FinalStage customizable(Optional customizable); + + _FinalStage customizable(Boolean customizable); + + _FinalStage tenant(Optional tenant); + + _FinalStage tenant(String tenant); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ContentStage, TypeStage, DisabledStage, _FinalStage { + private String id; + + private PhoneTemplateContent content; + + private PhoneTemplateNotificationTypeEnum type; + + private boolean disabled; + + private Optional tenant = Optional.empty(); + + private Optional customizable = Optional.empty(); + + private Optional channel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdatePhoneTemplateResponseContent other) { + id(other.getId()); + channel(other.getChannel()); + customizable(other.getCustomizable()); + tenant(other.getTenant()); + content(other.getContent()); + type(other.getType()); + disabled(other.getDisabled()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ContentStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("content") + public TypeStage content(@NotNull PhoneTemplateContent content) { + this.content = Objects.requireNonNull(content, "content must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Whether the template is enabled (false) or disabled (true).

+ *

Whether the template is enabled (false) or disabled (true).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("disabled") + public _FinalStage disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + @java.lang.Override + public _FinalStage tenant(String tenant) { + this.tenant = Optional.ofNullable(tenant); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant", nulls = Nulls.SKIP) + public _FinalStage tenant(Optional tenant) { + this.tenant = tenant; + return this; + } + + @java.lang.Override + public _FinalStage customizable(Boolean customizable) { + this.customizable = Optional.ofNullable(customizable); + return this; + } + + @java.lang.Override + @JsonSetter(value = "customizable", nulls = Nulls.SKIP) + public _FinalStage customizable(Optional customizable) { + this.customizable = customizable; + return this; + } + + @java.lang.Override + public _FinalStage channel(String channel) { + this.channel = Optional.ofNullable(channel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "channel", nulls = Nulls.SKIP) + public _FinalStage channel(Optional channel) { + this.channel = channel; + return this; + } + + @java.lang.Override + public UpdatePhoneTemplateResponseContent build() { + return new UpdatePhoneTemplateResponseContent( + id, channel, customizable, tenant, content, type, disabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java new file mode 100644 index 000000000..71609de05 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java @@ -0,0 +1,554 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateResourceServerRequestContent.Builder.class) +public final class UpdateResourceServerRequestContent { + private final Optional name; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional allowOfflineAccess; + + private final Optional tokenLifetime; + + private final Optional tokenDialect; + + private final Optional enforcePolicies; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private UpdateResourceServerRequestContent( + Optional name, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional skipConsentForVerifiableFirstPartyClients, + Optional allowOfflineAccess, + Optional tokenLifetime, + Optional tokenDialect, + Optional enforcePolicies, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.name = name; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.allowOfflineAccess = allowOfflineAccess; + this.tokenLifetime = tokenLifetime; + this.tokenDialect = tokenDialect; + this.enforcePolicies = enforcePolicies; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + /** + * @return Whether authorization policies are enforced (true) or not enforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateResourceServerRequestContent + && equalTo((UpdateResourceServerRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateResourceServerRequestContent other) { + return name.equals(other.name) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && tokenLifetime.equals(other.tokenLifetime) + && tokenDialect.equals(other.tokenDialect) + && enforcePolicies.equals(other.enforcePolicies) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.scopes, + this.signingAlg, + this.signingSecret, + this.skipConsentForVerifiableFirstPartyClients, + this.allowOfflineAccess, + this.tokenLifetime, + this.tokenDialect, + this.enforcePolicies, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateResourceServerRequestContent other) { + name(other.getName()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + allowOfflineAccess(other.getAllowOfflineAccess()); + tokenLifetime(other.getTokenLifetime()); + tokenDialect(other.getTokenDialect()); + enforcePolicies(other.getEnforcePolicies()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public Builder signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + public Builder signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public Builder skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + public Builder skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public Builder allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + public Builder allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + /** + *

Whether authorization policies are enforced (true) or not enforced (false).

+ */ + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public Builder enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + public Builder enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + public UpdateResourceServerRequestContent build() { + return new UpdateResourceServerRequestContent( + name, + scopes, + signingAlg, + signingSecret, + skipConsentForVerifiableFirstPartyClients, + allowOfflineAccess, + tokenLifetime, + tokenDialect, + enforcePolicies, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java new file mode 100644 index 000000000..693d2cc46 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java @@ -0,0 +1,682 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateResourceServerResponseContent.Builder.class) +public final class UpdateResourceServerResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional isSystem; + + private final Optional identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional signingSecret; + + private final Optional allowOfflineAccess; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional tokenLifetime; + + private final Optional tokenLifetimeForWeb; + + private final Optional enforcePolicies; + + private final Optional tokenDialect; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final Optional> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Map additionalProperties; + + private UpdateResourceServerResponseContent( + Optional id, + Optional name, + Optional isSystem, + Optional identifier, + Optional> scopes, + Optional signingAlg, + Optional signingSecret, + Optional allowOfflineAccess, + Optional skipConsentForVerifiableFirstPartyClients, + Optional tokenLifetime, + Optional tokenLifetimeForWeb, + Optional enforcePolicies, + Optional tokenDialect, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + Optional> authorizationDetails, + OptionalNullable proofOfPossession, + Map additionalProperties) { + this.id = id; + this.name = name; + this.isSystem = isSystem; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.signingSecret = signingSecret; + this.allowOfflineAccess = allowOfflineAccess; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + this.enforcePolicies = enforcePolicies; + this.tokenDialect = tokenDialect; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the API (resource server). + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this is an Auth0 system API (true) or a custom API (false). + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Secret used to sign tokens when using symmetric algorithms (HS256). + */ + @JsonProperty("signing_secret") + public Optional getSigningSecret() { + return signingSecret; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value. + */ + @JsonProperty("token_lifetime_for_web") + public Optional getTokenLifetimeForWeb() { + return tokenLifetimeForWeb; + } + + /** + * @return Whether authorization polices are enforced (true) or unenforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonProperty("authorization_details") + public Optional> getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateResourceServerResponseContent + && equalTo((UpdateResourceServerResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateResourceServerResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && isSystem.equals(other.isSystem) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && signingSecret.equals(other.signingSecret) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) + && enforcePolicies.equals(other.enforcePolicies) + && tokenDialect.equals(other.tokenDialect) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.isSystem, + this.identifier, + this.scopes, + this.signingAlg, + this.signingSecret, + this.allowOfflineAccess, + this.skipConsentForVerifiableFirstPartyClients, + this.tokenLifetime, + this.tokenLifetimeForWeb, + this.enforcePolicies, + this.tokenDialect, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional signingSecret = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenLifetimeForWeb = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private Optional> authorizationDetails = Optional.empty(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateResourceServerResponseContent other) { + id(other.getId()); + name(other.getName()); + isSystem(other.getIsSystem()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + signingSecret(other.getSigningSecret()); + allowOfflineAccess(other.getAllowOfflineAccess()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); + enforcePolicies(other.getEnforcePolicies()); + tokenDialect(other.getTokenDialect()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + return this; + } + + /** + *

ID of the API (resource server).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Friendly name for this resource server. Can not contain < or > characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Whether this is an Auth0 system API (true) or a custom API (false).

+ */ + @JsonSetter(value = "is_system", nulls = Nulls.SKIP) + public Builder isSystem(Optional isSystem) { + this.isSystem = isSystem; + return this; + } + + public Builder isSystem(Boolean isSystem) { + this.isSystem = Optional.ofNullable(isSystem); + return this; + } + + /** + *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Secret used to sign tokens when using symmetric algorithms (HS256).

+ */ + @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) + public Builder signingSecret(Optional signingSecret) { + this.signingSecret = signingSecret; + return this; + } + + public Builder signingSecret(String signingSecret) { + this.signingSecret = Optional.ofNullable(signingSecret); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

+ */ + @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) + public Builder allowOfflineAccess(Optional allowOfflineAccess) { + this.allowOfflineAccess = allowOfflineAccess; + return this; + } + + public Builder allowOfflineAccess(Boolean allowOfflineAccess) { + this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); + return this; + } + + /** + *

Whether to skip user consent for applications flagged as first party (true) or not (false).

+ */ + @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) + public Builder skipConsentForVerifiableFirstPartyClients( + Optional skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + return this; + } + + public Builder skipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { + this.skipConsentForVerifiableFirstPartyClients = + Optional.ofNullable(skipConsentForVerifiableFirstPartyClients); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

+ */ + @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) + public Builder tokenLifetime(Optional tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + public Builder tokenLifetime(Integer tokenLifetime) { + this.tokenLifetime = Optional.ofNullable(tokenLifetime); + return this; + } + + /** + *

Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value.

+ */ + @JsonSetter(value = "token_lifetime_for_web", nulls = Nulls.SKIP) + public Builder tokenLifetimeForWeb(Optional tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + return this; + } + + public Builder tokenLifetimeForWeb(Integer tokenLifetimeForWeb) { + this.tokenLifetimeForWeb = Optional.ofNullable(tokenLifetimeForWeb); + return this; + } + + /** + *

Whether authorization polices are enforced (true) or unenforced (false).

+ */ + @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) + public Builder enforcePolicies(Optional enforcePolicies) { + this.enforcePolicies = enforcePolicies; + return this; + } + + public Builder enforcePolicies(Boolean enforcePolicies) { + this.enforcePolicies = Optional.ofNullable(enforcePolicies); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectResponseEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(String consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(Optional> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = Optional.ofNullable(authorizationDetails); + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + public UpdateResourceServerResponseContent build() { + return new UpdateResourceServerResponseContent( + id, + name, + isSystem, + identifier, + scopes, + signingAlg, + signingSecret, + allowOfflineAccess, + skipConsentForVerifiableFirstPartyClients, + tokenLifetime, + tokenLifetimeForWeb, + enforcePolicies, + tokenDialect, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java new file mode 100644 index 000000000..b2295388d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRoleRequestContent.Builder.class) +public final class UpdateRoleRequestContent { + private final Optional name; + + private final Optional description; + + private final Map additionalProperties; + + private UpdateRoleRequestContent( + Optional name, Optional description, Map additionalProperties) { + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of this role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRoleRequestContent && equalTo((UpdateRoleRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRoleRequestContent other) { + return name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRoleRequestContent other) { + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Description of this role.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public UpdateRoleRequestContent build() { + return new UpdateRoleRequestContent(name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java new file mode 100644 index 000000000..030113ea9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRoleResponseContent.Builder.class) +public final class UpdateRoleResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Map additionalProperties; + + private UpdateRoleResponseContent( + Optional id, + Optional name, + Optional description, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID for this role. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Name of this role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of this role. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRoleResponseContent && equalTo((UpdateRoleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRoleResponseContent other) { + return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRoleResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + return this; + } + + /** + *

ID for this role.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of this role.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Description of this role.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public UpdateRoleResponseContent build() { + return new UpdateRoleResponseContent(id, name, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java new file mode 100644 index 000000000..a2ea28daf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRuleRequestContent.Builder.class) +public final class UpdateRuleRequestContent { + private final Optional script; + + private final Optional name; + + private final Optional order; + + private final Optional enabled; + + private final Map additionalProperties; + + private UpdateRuleRequestContent( + Optional script, + Optional name, + Optional order, + Optional enabled, + Map additionalProperties) { + this.script = script; + this.name = name; + this.order = order; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRuleRequestContent && equalTo((UpdateRuleRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRuleRequestContent other) { + return script.equals(other.script) + && name.equals(other.name) + && order.equals(other.order) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.script, this.name, this.order, this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional script = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional order = Optional.empty(); + + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRuleRequestContent other) { + script(other.getScript()); + name(other.getName()); + order(other.getOrder()); + enabled(other.getEnabled()); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Name of this rule.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public UpdateRuleRequestContent build() { + return new UpdateRuleRequestContent(script, name, order, enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java new file mode 100644 index 000000000..3705f0238 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRuleResponseContent.Builder.class) +public final class UpdateRuleResponseContent { + private final Optional name; + + private final Optional id; + + private final Optional enabled; + + private final Optional script; + + private final Optional order; + + private final Optional stage; + + private final Map additionalProperties; + + private UpdateRuleResponseContent( + Optional name, + Optional id, + Optional enabled, + Optional script, + Optional order, + Optional stage, + Map additionalProperties) { + this.name = name; + this.id = id; + this.enabled = enabled; + this.script = script; + this.order = order; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of this rule. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return ID of this rule. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Whether the rule is enabled (true), or disabled (false). + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Code to be executed when this rule runs. + */ + @JsonProperty("script") + public Optional getScript() { + return script; + } + + /** + * @return Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + + /** + * @return Execution stage of this rule. Can be login_success, login_failure, or pre_authorize. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRuleResponseContent && equalTo((UpdateRuleResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRuleResponseContent other) { + return name.equals(other.name) + && id.equals(other.id) + && enabled.equals(other.enabled) + && script.equals(other.script) + && order.equals(other.order) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional enabled = Optional.empty(); + + private Optional script = Optional.empty(); + + private Optional order = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRuleResponseContent other) { + name(other.getName()); + id(other.getId()); + enabled(other.getEnabled()); + script(other.getScript()); + order(other.getOrder()); + stage(other.getStage()); + return this; + } + + /** + *

Name of this rule.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

ID of this rule.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Whether the rule is enabled (true), or disabled (false).

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Code to be executed when this rule runs.

+ */ + @JsonSetter(value = "script", nulls = Nulls.SKIP) + public Builder script(Optional script) { + this.script = script; + return this; + } + + public Builder script(String script) { + this.script = Optional.ofNullable(script); + return this; + } + + /** + *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(Double order) { + this.order = Optional.ofNullable(order); + return this; + } + + /** + *

Execution stage of this rule. Can be login_success, login_failure, or pre_authorize.

+ */ + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(String stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public UpdateRuleResponseContent build() { + return new UpdateRuleResponseContent(name, id, enabled, script, order, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java new file mode 100644 index 000000000..14fcbb308 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateScimConfigurationResponseContent.Builder.class) +public final class UpdateScimConfigurationResponseContent { + private final Optional connectionId; + + private final Optional connectionName; + + private final Optional strategy; + + private final Optional tenantName; + + private final Optional userIdAttribute; + + private final Optional> mapping; + + private final Optional createdAt; + + private final Optional updatedOn; + + private final Map additionalProperties; + + private UpdateScimConfigurationResponseContent( + Optional connectionId, + Optional connectionName, + Optional strategy, + Optional tenantName, + Optional userIdAttribute, + Optional> mapping, + Optional createdAt, + Optional updatedOn, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.tenantName = tenantName; + this.userIdAttribute = userIdAttribute; + this.mapping = mapping; + this.createdAt = createdAt; + this.updatedOn = updatedOn; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_name") + public Optional getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + /** + * @return The tenant's name + */ + @JsonProperty("tenant_name") + public Optional getTenantName() { + return tenantName; + } + + /** + * @return User ID attribute for generating unique user ids + */ + @JsonProperty("user_id_attribute") + public Optional getUserIdAttribute() { + return userIdAttribute; + } + + /** + * @return The mapping between auth0 and SCIM + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + /** + * @return The Date Time Scim Configuration was created + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The Date Time Scim Configuration was last updated + */ + @JsonProperty("updated_on") + public Optional getUpdatedOn() { + return updatedOn; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateScimConfigurationResponseContent + && equalTo((UpdateScimConfigurationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateScimConfigurationResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && tenantName.equals(other.tenantName) + && userIdAttribute.equals(other.userIdAttribute) + && mapping.equals(other.mapping) + && createdAt.equals(other.createdAt) + && updatedOn.equals(other.updatedOn); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.tenantName, + this.userIdAttribute, + this.mapping, + this.createdAt, + this.updatedOn); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connectionId = Optional.empty(); + + private Optional connectionName = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional tenantName = Optional.empty(); + + private Optional userIdAttribute = Optional.empty(); + + private Optional> mapping = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedOn = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateScimConfigurationResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + tenantName(other.getTenantName()); + userIdAttribute(other.getUserIdAttribute()); + mapping(other.getMapping()); + createdAt(other.getCreatedAt()); + updatedOn(other.getUpdatedOn()); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

The connection's identifier

+ */ + @JsonSetter(value = "connection_name", nulls = Nulls.SKIP) + public Builder connectionName(Optional connectionName) { + this.connectionName = connectionName; + return this; + } + + public Builder connectionName(String connectionName) { + this.connectionName = Optional.ofNullable(connectionName); + return this; + } + + /** + *

The connection's strategy

+ */ + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public Builder strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + public Builder strategy(String strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + /** + *

The tenant's name

+ */ + @JsonSetter(value = "tenant_name", nulls = Nulls.SKIP) + public Builder tenantName(Optional tenantName) { + this.tenantName = tenantName; + return this; + } + + public Builder tenantName(String tenantName) { + this.tenantName = Optional.ofNullable(tenantName); + return this; + } + + /** + *

User ID attribute for generating unique user ids

+ */ + @JsonSetter(value = "user_id_attribute", nulls = Nulls.SKIP) + public Builder userIdAttribute(Optional userIdAttribute) { + this.userIdAttribute = userIdAttribute; + return this; + } + + public Builder userIdAttribute(String userIdAttribute) { + this.userIdAttribute = Optional.ofNullable(userIdAttribute); + return this; + } + + /** + *

The mapping between auth0 and SCIM

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + /** + *

The Date Time Scim Configuration was created

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(String createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The Date Time Scim Configuration was last updated

+ */ + @JsonSetter(value = "updated_on", nulls = Nulls.SKIP) + public Builder updatedOn(Optional updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + public Builder updatedOn(String updatedOn) { + this.updatedOn = Optional.ofNullable(updatedOn); + return this; + } + + public UpdateScimConfigurationResponseContent build() { + return new UpdateScimConfigurationResponseContent( + connectionId, + connectionName, + strategy, + tenantName, + userIdAttribute, + mapping, + createdAt, + updatedOn, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java new file mode 100644 index 000000000..1c06feeb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSelfServiceProfileRequestContent.Builder.class) +public final class UpdateSelfServiceProfileRequestContent { + private final Optional name; + + private final OptionalNullable description; + + private final OptionalNullable branding; + + private final Optional> allowedStrategies; + + private final OptionalNullable> userAttributes; + + private final Map additionalProperties; + + private UpdateSelfServiceProfileRequestContent( + Optional name, + OptionalNullable description, + OptionalNullable branding, + Optional> allowedStrategies, + OptionalNullable> userAttributes, + Map additionalProperties) { + this.name = name; + this.description = description; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + public OptionalNullable getDescription() { + if (description == null) { + return OptionalNullable.absent(); + } + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("branding") + public OptionalNullable getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_attributes") + public OptionalNullable> getUserAttributes() { + if (userAttributes == null) { + return OptionalNullable.absent(); + } + return userAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private OptionalNullable _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_attributes") + private OptionalNullable> _getUserAttributes() { + return userAttributes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSelfServiceProfileRequestContent + && equalTo((UpdateSelfServiceProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSelfServiceProfileRequestContent other) { + return name.equals(other.name) + && description.equals(other.description) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies) + && userAttributes.equals(other.userAttributes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.branding, this.allowedStrategies, this.userAttributes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private OptionalNullable description = OptionalNullable.absent(); + + private OptionalNullable branding = OptionalNullable.absent(); + + private Optional> allowedStrategies = Optional.empty(); + + private OptionalNullable> userAttributes = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSelfServiceProfileRequestContent other) { + name(other.getName()); + description(other.getDescription()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + userAttributes(other.getUserAttributes()); + return this; + } + + /** + *

The name of the self-service Profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(@Nullable OptionalNullable description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = OptionalNullable.of(description); + return this; + } + + public Builder description(Optional description) { + if (description.isPresent()) { + this.description = OptionalNullable.of(description.get()); + } else { + this.description = OptionalNullable.absent(); + } + return this; + } + + public Builder description(com.auth0.client.mgmt.core.Nullable description) { + if (description.isNull()) { + this.description = OptionalNullable.ofNull(); + } else if (description.isEmpty()) { + this.description = OptionalNullable.absent(); + } else { + this.description = OptionalNullable.of(description.get()); + } + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(OptionalNullable branding) { + this.branding = branding; + return this; + } + + public Builder branding(SelfServiceProfileBrandingProperties branding) { + this.branding = OptionalNullable.of(branding); + return this; + } + + public Builder branding(Optional branding) { + if (branding.isPresent()) { + this.branding = OptionalNullable.of(branding.get()); + } else { + this.branding = OptionalNullable.absent(); + } + return this; + } + + public Builder branding(com.auth0.client.mgmt.core.Nullable branding) { + if (branding.isNull()) { + this.branding = OptionalNullable.ofNull(); + } else if (branding.isEmpty()) { + this.branding = OptionalNullable.absent(); + } else { + this.branding = OptionalNullable.of(branding.get()); + } + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public Builder allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + public Builder allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + @Nullable OptionalNullable> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes(List userAttributes) { + this.userAttributes = OptionalNullable.of(userAttributes); + return this; + } + + public Builder userAttributes(Optional> userAttributes) { + if (userAttributes.isPresent()) { + this.userAttributes = OptionalNullable.of(userAttributes.get()); + } else { + this.userAttributes = OptionalNullable.absent(); + } + return this; + } + + public Builder userAttributes( + com.auth0.client.mgmt.core.Nullable> userAttributes) { + if (userAttributes.isNull()) { + this.userAttributes = OptionalNullable.ofNull(); + } else if (userAttributes.isEmpty()) { + this.userAttributes = OptionalNullable.absent(); + } else { + this.userAttributes = OptionalNullable.of(userAttributes.get()); + } + return this; + } + + public UpdateSelfServiceProfileRequestContent build() { + return new UpdateSelfServiceProfileRequestContent( + name, description, branding, allowedStrategies, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java new file mode 100644 index 000000000..f76becbb6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java @@ -0,0 +1,327 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSelfServiceProfileResponseContent.Builder.class) +public final class UpdateSelfServiceProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional description; + + private final Optional> userAttributes; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional branding; + + private final Optional> allowedStrategies; + + private final Map additionalProperties; + + private UpdateSelfServiceProfileResponseContent( + Optional id, + Optional name, + Optional description, + Optional> userAttributes, + Optional createdAt, + Optional updatedAt, + Optional branding, + Optional> allowedStrategies, + Map additionalProperties) { + this.id = id; + this.name = name; + this.description = description; + this.userAttributes = userAttributes; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.branding = branding; + this.allowedStrategies = allowedStrategies; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the self-service Profile. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the self-service Profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the self-service Profile. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + */ + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + /** + * @return The time when this self-service Profile was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The time when this self-service Profile was updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + /** + * @return List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate] + */ + @JsonProperty("allowed_strategies") + public Optional> getAllowedStrategies() { + return allowedStrategies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSelfServiceProfileResponseContent + && equalTo((UpdateSelfServiceProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSelfServiceProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && description.equals(other.description) + && userAttributes.equals(other.userAttributes) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && branding.equals(other.branding) + && allowedStrategies.equals(other.allowedStrategies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.description, + this.userAttributes, + this.createdAt, + this.updatedAt, + this.branding, + this.allowedStrategies); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> userAttributes = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional> allowedStrategies = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSelfServiceProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + description(other.getDescription()); + userAttributes(other.getUserAttributes()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + branding(other.getBranding()); + allowedStrategies(other.getAllowedStrategies()); + return this; + } + + /** + *

The unique ID of the self-service Profile.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the self-service Profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The description of the self-service Profile.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

+ */ + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes(Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes(List userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + /** + *

The time when this self-service Profile was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The time when this self-service Profile was updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(SelfServiceProfileBrandingProperties branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + /** + *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

+ */ + @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) + public Builder allowedStrategies(Optional> allowedStrategies) { + this.allowedStrategies = allowedStrategies; + return this; + } + + public Builder allowedStrategies(List allowedStrategies) { + this.allowedStrategies = Optional.ofNullable(allowedStrategies); + return this; + } + + public UpdateSelfServiceProfileResponseContent build() { + return new UpdateSelfServiceProfileResponseContent( + id, + name, + description, + userAttributes, + createdAt, + updatedAt, + branding, + allowedStrategies, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java new file mode 100644 index 000000000..9dc1449b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSettingsRequestContent.Builder.class) +public final class UpdateSettingsRequestContent { + private final Optional universalLoginExperience; + + private final OptionalNullable identifierFirst; + + private final OptionalNullable webauthnPlatformFirstFactor; + + private final Map additionalProperties; + + private UpdateSettingsRequestContent( + Optional universalLoginExperience, + OptionalNullable identifierFirst, + OptionalNullable webauthnPlatformFirstFactor, + Map additionalProperties) { + this.universalLoginExperience = universalLoginExperience; + this.identifierFirst = identifierFirst; + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("universal_login_experience") + public Optional getUniversalLoginExperience() { + return universalLoginExperience; + } + + /** + * @return Whether identifier first is enabled or not + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identifier_first") + public OptionalNullable getIdentifierFirst() { + if (identifierFirst == null) { + return OptionalNullable.absent(); + } + return identifierFirst; + } + + /** + * @return Use WebAuthn with Device Biometrics as the first authentication factor + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webauthn_platform_first_factor") + public OptionalNullable getWebauthnPlatformFirstFactor() { + if (webauthnPlatformFirstFactor == null) { + return OptionalNullable.absent(); + } + return webauthnPlatformFirstFactor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identifier_first") + private OptionalNullable _getIdentifierFirst() { + return identifierFirst; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webauthn_platform_first_factor") + private OptionalNullable _getWebauthnPlatformFirstFactor() { + return webauthnPlatformFirstFactor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSettingsRequestContent && equalTo((UpdateSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSettingsRequestContent other) { + return universalLoginExperience.equals(other.universalLoginExperience) + && identifierFirst.equals(other.identifierFirst) + && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional universalLoginExperience = Optional.empty(); + + private OptionalNullable identifierFirst = OptionalNullable.absent(); + + private OptionalNullable webauthnPlatformFirstFactor = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSettingsRequestContent other) { + universalLoginExperience(other.getUniversalLoginExperience()); + identifierFirst(other.getIdentifierFirst()); + webauthnPlatformFirstFactor(other.getWebauthnPlatformFirstFactor()); + return this; + } + + @JsonSetter(value = "universal_login_experience", nulls = Nulls.SKIP) + public Builder universalLoginExperience(Optional universalLoginExperience) { + this.universalLoginExperience = universalLoginExperience; + return this; + } + + public Builder universalLoginExperience(UniversalLoginExperienceEnum universalLoginExperience) { + this.universalLoginExperience = Optional.ofNullable(universalLoginExperience); + return this; + } + + /** + *

Whether identifier first is enabled or not

+ */ + @JsonSetter(value = "identifier_first", nulls = Nulls.SKIP) + public Builder identifierFirst(@Nullable OptionalNullable identifierFirst) { + this.identifierFirst = identifierFirst; + return this; + } + + public Builder identifierFirst(Boolean identifierFirst) { + this.identifierFirst = OptionalNullable.of(identifierFirst); + return this; + } + + public Builder identifierFirst(Optional identifierFirst) { + if (identifierFirst.isPresent()) { + this.identifierFirst = OptionalNullable.of(identifierFirst.get()); + } else { + this.identifierFirst = OptionalNullable.absent(); + } + return this; + } + + public Builder identifierFirst(com.auth0.client.mgmt.core.Nullable identifierFirst) { + if (identifierFirst.isNull()) { + this.identifierFirst = OptionalNullable.ofNull(); + } else if (identifierFirst.isEmpty()) { + this.identifierFirst = OptionalNullable.absent(); + } else { + this.identifierFirst = OptionalNullable.of(identifierFirst.get()); + } + return this; + } + + /** + *

Use WebAuthn with Device Biometrics as the first authentication factor

+ */ + @JsonSetter(value = "webauthn_platform_first_factor", nulls = Nulls.SKIP) + public Builder webauthnPlatformFirstFactor(@Nullable OptionalNullable webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + return this; + } + + public Builder webauthnPlatformFirstFactor(Boolean webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = OptionalNullable.of(webauthnPlatformFirstFactor); + return this; + } + + public Builder webauthnPlatformFirstFactor(Optional webauthnPlatformFirstFactor) { + if (webauthnPlatformFirstFactor.isPresent()) { + this.webauthnPlatformFirstFactor = OptionalNullable.of(webauthnPlatformFirstFactor.get()); + } else { + this.webauthnPlatformFirstFactor = OptionalNullable.absent(); + } + return this; + } + + public Builder webauthnPlatformFirstFactor( + com.auth0.client.mgmt.core.Nullable webauthnPlatformFirstFactor) { + if (webauthnPlatformFirstFactor.isNull()) { + this.webauthnPlatformFirstFactor = OptionalNullable.ofNull(); + } else if (webauthnPlatformFirstFactor.isEmpty()) { + this.webauthnPlatformFirstFactor = OptionalNullable.absent(); + } else { + this.webauthnPlatformFirstFactor = OptionalNullable.of(webauthnPlatformFirstFactor.get()); + } + return this; + } + + public UpdateSettingsRequestContent build() { + return new UpdateSettingsRequestContent( + universalLoginExperience, identifierFirst, webauthnPlatformFirstFactor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java new file mode 100644 index 000000000..8acc2ed8e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSettingsResponseContent.Builder.class) +public final class UpdateSettingsResponseContent { + private final Optional universalLoginExperience; + + private final Optional identifierFirst; + + private final Optional webauthnPlatformFirstFactor; + + private final Map additionalProperties; + + private UpdateSettingsResponseContent( + Optional universalLoginExperience, + Optional identifierFirst, + Optional webauthnPlatformFirstFactor, + Map additionalProperties) { + this.universalLoginExperience = universalLoginExperience; + this.identifierFirst = identifierFirst; + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("universal_login_experience") + public Optional getUniversalLoginExperience() { + return universalLoginExperience; + } + + /** + * @return Whether identifier first is enabled or not + */ + @JsonProperty("identifier_first") + public Optional getIdentifierFirst() { + return identifierFirst; + } + + /** + * @return Use WebAuthn with Device Biometrics as the first authentication factor + */ + @JsonProperty("webauthn_platform_first_factor") + public Optional getWebauthnPlatformFirstFactor() { + return webauthnPlatformFirstFactor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSettingsResponseContent && equalTo((UpdateSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSettingsResponseContent other) { + return universalLoginExperience.equals(other.universalLoginExperience) + && identifierFirst.equals(other.identifierFirst) + && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional universalLoginExperience = Optional.empty(); + + private Optional identifierFirst = Optional.empty(); + + private Optional webauthnPlatformFirstFactor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSettingsResponseContent other) { + universalLoginExperience(other.getUniversalLoginExperience()); + identifierFirst(other.getIdentifierFirst()); + webauthnPlatformFirstFactor(other.getWebauthnPlatformFirstFactor()); + return this; + } + + @JsonSetter(value = "universal_login_experience", nulls = Nulls.SKIP) + public Builder universalLoginExperience(Optional universalLoginExperience) { + this.universalLoginExperience = universalLoginExperience; + return this; + } + + public Builder universalLoginExperience(UniversalLoginExperienceEnum universalLoginExperience) { + this.universalLoginExperience = Optional.ofNullable(universalLoginExperience); + return this; + } + + /** + *

Whether identifier first is enabled or not

+ */ + @JsonSetter(value = "identifier_first", nulls = Nulls.SKIP) + public Builder identifierFirst(Optional identifierFirst) { + this.identifierFirst = identifierFirst; + return this; + } + + public Builder identifierFirst(Boolean identifierFirst) { + this.identifierFirst = Optional.ofNullable(identifierFirst); + return this; + } + + /** + *

Use WebAuthn with Device Biometrics as the first authentication factor

+ */ + @JsonSetter(value = "webauthn_platform_first_factor", nulls = Nulls.SKIP) + public Builder webauthnPlatformFirstFactor(Optional webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; + return this; + } + + public Builder webauthnPlatformFirstFactor(Boolean webauthnPlatformFirstFactor) { + this.webauthnPlatformFirstFactor = Optional.ofNullable(webauthnPlatformFirstFactor); + return this; + } + + public UpdateSettingsResponseContent build() { + return new UpdateSettingsResponseContent( + universalLoginExperience, identifierFirst, webauthnPlatformFirstFactor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java new file mode 100644 index 000000000..a7502a8fc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSupplementalSignalsRequestContent.Builder.class) +public final class UpdateSupplementalSignalsRequestContent { + private final boolean akamaiEnabled; + + private final Map additionalProperties; + + private UpdateSupplementalSignalsRequestContent(boolean akamaiEnabled, Map additionalProperties) { + this.akamaiEnabled = akamaiEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates if incoming Akamai Headers should be processed + */ + @JsonProperty("akamai_enabled") + public boolean getAkamaiEnabled() { + return akamaiEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSupplementalSignalsRequestContent + && equalTo((UpdateSupplementalSignalsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSupplementalSignalsRequestContent other) { + return akamaiEnabled == other.akamaiEnabled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.akamaiEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AkamaiEnabledStage builder() { + return new Builder(); + } + + public interface AkamaiEnabledStage { + /** + *

Indicates if incoming Akamai Headers should be processed

+ */ + _FinalStage akamaiEnabled(boolean akamaiEnabled); + + Builder from(UpdateSupplementalSignalsRequestContent other); + } + + public interface _FinalStage { + UpdateSupplementalSignalsRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AkamaiEnabledStage, _FinalStage { + private boolean akamaiEnabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateSupplementalSignalsRequestContent other) { + akamaiEnabled(other.getAkamaiEnabled()); + return this; + } + + /** + *

Indicates if incoming Akamai Headers should be processed

+ *

Indicates if incoming Akamai Headers should be processed

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("akamai_enabled") + public _FinalStage akamaiEnabled(boolean akamaiEnabled) { + this.akamaiEnabled = akamaiEnabled; + return this; + } + + @java.lang.Override + public UpdateSupplementalSignalsRequestContent build() { + return new UpdateSupplementalSignalsRequestContent(akamaiEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java new file mode 100644 index 000000000..115a9ef00 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java @@ -0,0 +1,186 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSuspiciousIpThrottlingSettingsResponseContent.Builder.class) +public final class UpdateSuspiciousIpThrottlingSettingsResponseContent { + private final Optional enabled; + + private final Optional> shields; + + private final Optional> allowlist; + + private final Optional stage; + + private final Map additionalProperties; + + private UpdateSuspiciousIpThrottlingSettingsResponseContent( + Optional enabled, + Optional> shields, + Optional> allowlist, + Optional stage, + Map additionalProperties) { + this.enabled = enabled; + this.shields = shields; + this.allowlist = allowlist; + this.stage = stage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not suspicious IP throttling attack protections are active. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + /** + * @return Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>. + */ + @JsonProperty("shields") + public Optional> getShields() { + return shields; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSuspiciousIpThrottlingSettingsResponseContent + && equalTo((UpdateSuspiciousIpThrottlingSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsResponseContent other) { + return enabled.equals(other.enabled) + && shields.equals(other.shields) + && allowlist.equals(other.allowlist) + && stage.equals(other.stage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional enabled = Optional.empty(); + + private Optional> shields = Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional stage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSuspiciousIpThrottlingSettingsResponseContent other) { + enabled(other.getEnabled()); + shields(other.getShields()); + allowlist(other.getAllowlist()); + stage(other.getStage()); + return this; + } + + /** + *

Whether or not suspicious IP throttling attack protections are active.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + /** + *

Action to take when a suspicious IP throttling threshold is violated. + * Possible values: <code>block</code>, <code>admin_notification</code>.

+ */ + @JsonSetter(value = "shields", nulls = Nulls.SKIP) + public Builder shields(Optional> shields) { + this.shields = shields; + return this; + } + + public Builder shields(List shields) { + this.shields = Optional.ofNullable(shields); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(SuspiciousIpThrottlingStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + public UpdateSuspiciousIpThrottlingSettingsResponseContent build() { + return new UpdateSuspiciousIpThrottlingSettingsResponseContent( + enabled, shields, allowlist, stage, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java new file mode 100644 index 000000000..7a01f31da --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java @@ -0,0 +1,1290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateTenantSettingsResponseContent.Builder.class) +public final class UpdateTenantSettingsResponseContent { + private final OptionalNullable changePassword; + + private final OptionalNullable guardianMfaPage; + + private final Optional defaultAudience; + + private final Optional defaultDirectory; + + private final OptionalNullable errorPage; + + private final OptionalNullable deviceFlow; + + private final OptionalNullable defaultTokenQuota; + + private final Optional flags; + + private final Optional friendlyName; + + private final Optional pictureUrl; + + private final Optional supportEmail; + + private final Optional supportUrl; + + private final Optional> allowedLogoutUrls; + + private final Optional sessionLifetime; + + private final Optional idleSessionLifetime; + + private final Optional ephemeralSessionLifetime; + + private final Optional idleEphemeralSessionLifetime; + + private final Optional sandboxVersion; + + private final Optional legacySandboxVersion; + + private final Optional> sandboxVersionsAvailable; + + private final Optional defaultRedirectionUri; + + private final Optional> enabledLocales; + + private final OptionalNullable sessionCookie; + + private final OptionalNullable sessions; + + private final Optional oidcLogout; + + private final Optional allowOrganizationNameInAuthenticationApi; + + private final Optional customizeMfaInPostloginAction; + + private final Optional> acrValuesSupported; + + private final OptionalNullable mtls; + + private final Optional pushedAuthorizationRequestsSupported; + + private final OptionalNullable authorizationResponseIssParameterSupported; + + private final Map additionalProperties; + + private UpdateTenantSettingsResponseContent( + OptionalNullable changePassword, + OptionalNullable guardianMfaPage, + Optional defaultAudience, + Optional defaultDirectory, + OptionalNullable errorPage, + OptionalNullable deviceFlow, + OptionalNullable defaultTokenQuota, + Optional flags, + Optional friendlyName, + Optional pictureUrl, + Optional supportEmail, + Optional supportUrl, + Optional> allowedLogoutUrls, + Optional sessionLifetime, + Optional idleSessionLifetime, + Optional ephemeralSessionLifetime, + Optional idleEphemeralSessionLifetime, + Optional sandboxVersion, + Optional legacySandboxVersion, + Optional> sandboxVersionsAvailable, + Optional defaultRedirectionUri, + Optional> enabledLocales, + OptionalNullable sessionCookie, + OptionalNullable sessions, + Optional oidcLogout, + Optional allowOrganizationNameInAuthenticationApi, + Optional customizeMfaInPostloginAction, + Optional> acrValuesSupported, + OptionalNullable mtls, + Optional pushedAuthorizationRequestsSupported, + OptionalNullable authorizationResponseIssParameterSupported, + Map additionalProperties) { + this.changePassword = changePassword; + this.guardianMfaPage = guardianMfaPage; + this.defaultAudience = defaultAudience; + this.defaultDirectory = defaultDirectory; + this.errorPage = errorPage; + this.deviceFlow = deviceFlow; + this.defaultTokenQuota = defaultTokenQuota; + this.flags = flags; + this.friendlyName = friendlyName; + this.pictureUrl = pictureUrl; + this.supportEmail = supportEmail; + this.supportUrl = supportUrl; + this.allowedLogoutUrls = allowedLogoutUrls; + this.sessionLifetime = sessionLifetime; + this.idleSessionLifetime = idleSessionLifetime; + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + this.sandboxVersion = sandboxVersion; + this.legacySandboxVersion = legacySandboxVersion; + this.sandboxVersionsAvailable = sandboxVersionsAvailable; + this.defaultRedirectionUri = defaultRedirectionUri; + this.enabledLocales = enabledLocales; + this.sessionCookie = sessionCookie; + this.sessions = sessions; + this.oidcLogout = oidcLogout; + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + this.acrValuesSupported = acrValuesSupported; + this.mtls = mtls; + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + public OptionalNullable getChangePassword() { + if (changePassword == null) { + return OptionalNullable.absent(); + } + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + public OptionalNullable getGuardianMfaPage() { + if (guardianMfaPage == null) { + return OptionalNullable.absent(); + } + return guardianMfaPage; + } + + /** + * @return Default audience for API authorization. + */ + @JsonProperty("default_audience") + public Optional getDefaultAudience() { + return defaultAudience; + } + + /** + * @return Name of connection used for password grants at the /tokenendpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. + */ + @JsonProperty("default_directory") + public Optional getDefaultDirectory() { + return defaultDirectory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + public OptionalNullable getErrorPage() { + if (errorPage == null) { + return OptionalNullable.absent(); + } + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + public OptionalNullable getDeviceFlow() { + if (deviceFlow == null) { + return OptionalNullable.absent(); + } + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + public OptionalNullable getDefaultTokenQuota() { + if (defaultTokenQuota == null) { + return OptionalNullable.absent(); + } + return defaultTokenQuota; + } + + @JsonProperty("flags") + public Optional getFlags() { + return flags; + } + + /** + * @return Friendly name for this tenant. + */ + @JsonProperty("friendly_name") + public Optional getFriendlyName() { + return friendlyName; + } + + /** + * @return URL of logo to be shown for this tenant (recommended size: 150x150) + */ + @JsonProperty("picture_url") + public Optional getPictureUrl() { + return pictureUrl; + } + + /** + * @return End-user support email address. + */ + @JsonProperty("support_email") + public Optional getSupportEmail() { + return supportEmail; + } + + /** + * @return End-user support URL. + */ + @JsonProperty("support_url") + public Optional getSupportUrl() { + return supportUrl; + } + + /** + * @return URLs that are valid to redirect to after logout from Auth0. + */ + @JsonProperty("allowed_logout_urls") + public Optional> getAllowedLogoutUrls() { + return allowedLogoutUrls; + } + + /** + * @return Number of hours a session will stay valid. + */ + @JsonProperty("session_lifetime") + public Optional getSessionLifetime() { + return sessionLifetime; + } + + /** + * @return Number of hours for which a session can be inactive before the user must log in again. + */ + @JsonProperty("idle_session_lifetime") + public Optional getIdleSessionLifetime() { + return idleSessionLifetime; + } + + /** + * @return Number of hours an ephemeral (non-persistent) session will stay valid. + */ + @JsonProperty("ephemeral_session_lifetime") + public Optional getEphemeralSessionLifetime() { + return ephemeralSessionLifetime; + } + + /** + * @return Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again. + */ + @JsonProperty("idle_ephemeral_session_lifetime") + public Optional getIdleEphemeralSessionLifetime() { + return idleEphemeralSessionLifetime; + } + + /** + * @return Selected sandbox version for the extensibility environment. + */ + @JsonProperty("sandbox_version") + public Optional getSandboxVersion() { + return sandboxVersion; + } + + /** + * @return Selected sandbox version for rules and hooks extensibility. + */ + @JsonProperty("legacy_sandbox_version") + public Optional getLegacySandboxVersion() { + return legacySandboxVersion; + } + + /** + * @return Available sandbox versions for the extensibility environment. + */ + @JsonProperty("sandbox_versions_available") + public Optional> getSandboxVersionsAvailable() { + return sandboxVersionsAvailable; + } + + /** + * @return The default absolute redirection uri, must be https + */ + @JsonProperty("default_redirection_uri") + public Optional getDefaultRedirectionUri() { + return defaultRedirectionUri; + } + + /** + * @return Supported locales for the user interface. + */ + @JsonProperty("enabled_locales") + public Optional> getEnabledLocales() { + return enabledLocales; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + public OptionalNullable getSessionCookie() { + if (sessionCookie == null) { + return OptionalNullable.absent(); + } + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + public OptionalNullable getSessions() { + if (sessions == null) { + return OptionalNullable.absent(); + } + return sessions; + } + + @JsonProperty("oidc_logout") + public Optional getOidcLogout() { + return oidcLogout; + } + + /** + * @return Whether to accept an organization name instead of an ID on auth endpoints + */ + @JsonProperty("allow_organization_name_in_authentication_api") + public Optional getAllowOrganizationNameInAuthenticationApi() { + return allowOrganizationNameInAuthenticationApi; + } + + /** + * @return Whether to enable flexible factors for MFA in the PostLogin action + */ + @JsonProperty("customize_mfa_in_postlogin_action") + public Optional getCustomizeMfaInPostloginAction() { + return customizeMfaInPostloginAction; + } + + /** + * @return Supported ACR values + */ + @JsonProperty("acr_values_supported") + public Optional> getAcrValuesSupported() { + return acrValuesSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + public OptionalNullable getMtls() { + if (mtls == null) { + return OptionalNullable.absent(); + } + return mtls; + } + + /** + * @return Enables the use of Pushed Authorization Requests + */ + @JsonProperty("pushed_authorization_requests_supported") + public Optional getPushedAuthorizationRequestsSupported() { + return pushedAuthorizationRequestsSupported; + } + + /** + * @return Supports iss parameter in authorization responses + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + public OptionalNullable getAuthorizationResponseIssParameterSupported() { + if (authorizationResponseIssParameterSupported == null) { + return OptionalNullable.absent(); + } + return authorizationResponseIssParameterSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("change_password") + private OptionalNullable _getChangePassword() { + return changePassword; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("guardian_mfa_page") + private OptionalNullable _getGuardianMfaPage() { + return guardianMfaPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_page") + private OptionalNullable _getErrorPage() { + return errorPage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("device_flow") + private OptionalNullable _getDeviceFlow() { + return deviceFlow; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_token_quota") + private OptionalNullable _getDefaultTokenQuota() { + return defaultTokenQuota; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_cookie") + private OptionalNullable _getSessionCookie() { + return sessionCookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sessions") + private OptionalNullable _getSessions() { + return sessions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mtls") + private OptionalNullable _getMtls() { + return mtls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_response_iss_parameter_supported") + private OptionalNullable _getAuthorizationResponseIssParameterSupported() { + return authorizationResponseIssParameterSupported; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateTenantSettingsResponseContent + && equalTo((UpdateTenantSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateTenantSettingsResponseContent other) { + return changePassword.equals(other.changePassword) + && guardianMfaPage.equals(other.guardianMfaPage) + && defaultAudience.equals(other.defaultAudience) + && defaultDirectory.equals(other.defaultDirectory) + && errorPage.equals(other.errorPage) + && deviceFlow.equals(other.deviceFlow) + && defaultTokenQuota.equals(other.defaultTokenQuota) + && flags.equals(other.flags) + && friendlyName.equals(other.friendlyName) + && pictureUrl.equals(other.pictureUrl) + && supportEmail.equals(other.supportEmail) + && supportUrl.equals(other.supportUrl) + && allowedLogoutUrls.equals(other.allowedLogoutUrls) + && sessionLifetime.equals(other.sessionLifetime) + && idleSessionLifetime.equals(other.idleSessionLifetime) + && ephemeralSessionLifetime.equals(other.ephemeralSessionLifetime) + && idleEphemeralSessionLifetime.equals(other.idleEphemeralSessionLifetime) + && sandboxVersion.equals(other.sandboxVersion) + && legacySandboxVersion.equals(other.legacySandboxVersion) + && sandboxVersionsAvailable.equals(other.sandboxVersionsAvailable) + && defaultRedirectionUri.equals(other.defaultRedirectionUri) + && enabledLocales.equals(other.enabledLocales) + && sessionCookie.equals(other.sessionCookie) + && sessions.equals(other.sessions) + && oidcLogout.equals(other.oidcLogout) + && allowOrganizationNameInAuthenticationApi.equals(other.allowOrganizationNameInAuthenticationApi) + && customizeMfaInPostloginAction.equals(other.customizeMfaInPostloginAction) + && acrValuesSupported.equals(other.acrValuesSupported) + && mtls.equals(other.mtls) + && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.changePassword, + this.guardianMfaPage, + this.defaultAudience, + this.defaultDirectory, + this.errorPage, + this.deviceFlow, + this.defaultTokenQuota, + this.flags, + this.friendlyName, + this.pictureUrl, + this.supportEmail, + this.supportUrl, + this.allowedLogoutUrls, + this.sessionLifetime, + this.idleSessionLifetime, + this.ephemeralSessionLifetime, + this.idleEphemeralSessionLifetime, + this.sandboxVersion, + this.legacySandboxVersion, + this.sandboxVersionsAvailable, + this.defaultRedirectionUri, + this.enabledLocales, + this.sessionCookie, + this.sessions, + this.oidcLogout, + this.allowOrganizationNameInAuthenticationApi, + this.customizeMfaInPostloginAction, + this.acrValuesSupported, + this.mtls, + this.pushedAuthorizationRequestsSupported, + this.authorizationResponseIssParameterSupported); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable changePassword = OptionalNullable.absent(); + + private OptionalNullable guardianMfaPage = OptionalNullable.absent(); + + private Optional defaultAudience = Optional.empty(); + + private Optional defaultDirectory = Optional.empty(); + + private OptionalNullable errorPage = OptionalNullable.absent(); + + private OptionalNullable deviceFlow = OptionalNullable.absent(); + + private OptionalNullable defaultTokenQuota = OptionalNullable.absent(); + + private Optional flags = Optional.empty(); + + private Optional friendlyName = Optional.empty(); + + private Optional pictureUrl = Optional.empty(); + + private Optional supportEmail = Optional.empty(); + + private Optional supportUrl = Optional.empty(); + + private Optional> allowedLogoutUrls = Optional.empty(); + + private Optional sessionLifetime = Optional.empty(); + + private Optional idleSessionLifetime = Optional.empty(); + + private Optional ephemeralSessionLifetime = Optional.empty(); + + private Optional idleEphemeralSessionLifetime = Optional.empty(); + + private Optional sandboxVersion = Optional.empty(); + + private Optional legacySandboxVersion = Optional.empty(); + + private Optional> sandboxVersionsAvailable = Optional.empty(); + + private Optional defaultRedirectionUri = Optional.empty(); + + private Optional> enabledLocales = Optional.empty(); + + private OptionalNullable sessionCookie = OptionalNullable.absent(); + + private OptionalNullable sessions = OptionalNullable.absent(); + + private Optional oidcLogout = Optional.empty(); + + private Optional allowOrganizationNameInAuthenticationApi = Optional.empty(); + + private Optional customizeMfaInPostloginAction = Optional.empty(); + + private Optional> acrValuesSupported = Optional.empty(); + + private OptionalNullable mtls = OptionalNullable.absent(); + + private Optional pushedAuthorizationRequestsSupported = Optional.empty(); + + private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateTenantSettingsResponseContent other) { + changePassword(other.getChangePassword()); + guardianMfaPage(other.getGuardianMfaPage()); + defaultAudience(other.getDefaultAudience()); + defaultDirectory(other.getDefaultDirectory()); + errorPage(other.getErrorPage()); + deviceFlow(other.getDeviceFlow()); + defaultTokenQuota(other.getDefaultTokenQuota()); + flags(other.getFlags()); + friendlyName(other.getFriendlyName()); + pictureUrl(other.getPictureUrl()); + supportEmail(other.getSupportEmail()); + supportUrl(other.getSupportUrl()); + allowedLogoutUrls(other.getAllowedLogoutUrls()); + sessionLifetime(other.getSessionLifetime()); + idleSessionLifetime(other.getIdleSessionLifetime()); + ephemeralSessionLifetime(other.getEphemeralSessionLifetime()); + idleEphemeralSessionLifetime(other.getIdleEphemeralSessionLifetime()); + sandboxVersion(other.getSandboxVersion()); + legacySandboxVersion(other.getLegacySandboxVersion()); + sandboxVersionsAvailable(other.getSandboxVersionsAvailable()); + defaultRedirectionUri(other.getDefaultRedirectionUri()); + enabledLocales(other.getEnabledLocales()); + sessionCookie(other.getSessionCookie()); + sessions(other.getSessions()); + oidcLogout(other.getOidcLogout()); + allowOrganizationNameInAuthenticationApi(other.getAllowOrganizationNameInAuthenticationApi()); + customizeMfaInPostloginAction(other.getCustomizeMfaInPostloginAction()); + acrValuesSupported(other.getAcrValuesSupported()); + mtls(other.getMtls()); + pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); + authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + return this; + } + + @JsonSetter(value = "change_password", nulls = Nulls.SKIP) + public Builder changePassword(@Nullable OptionalNullable changePassword) { + this.changePassword = changePassword; + return this; + } + + public Builder changePassword(TenantSettingsPasswordPage changePassword) { + this.changePassword = OptionalNullable.of(changePassword); + return this; + } + + public Builder changePassword(Optional changePassword) { + if (changePassword.isPresent()) { + this.changePassword = OptionalNullable.of(changePassword.get()); + } else { + this.changePassword = OptionalNullable.absent(); + } + return this; + } + + public Builder changePassword(com.auth0.client.mgmt.core.Nullable changePassword) { + if (changePassword.isNull()) { + this.changePassword = OptionalNullable.ofNull(); + } else if (changePassword.isEmpty()) { + this.changePassword = OptionalNullable.absent(); + } else { + this.changePassword = OptionalNullable.of(changePassword.get()); + } + return this; + } + + @JsonSetter(value = "guardian_mfa_page", nulls = Nulls.SKIP) + public Builder guardianMfaPage(@Nullable OptionalNullable guardianMfaPage) { + this.guardianMfaPage = guardianMfaPage; + return this; + } + + public Builder guardianMfaPage(TenantSettingsGuardianPage guardianMfaPage) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage); + return this; + } + + public Builder guardianMfaPage(Optional guardianMfaPage) { + if (guardianMfaPage.isPresent()) { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } else { + this.guardianMfaPage = OptionalNullable.absent(); + } + return this; + } + + public Builder guardianMfaPage( + com.auth0.client.mgmt.core.Nullable guardianMfaPage) { + if (guardianMfaPage.isNull()) { + this.guardianMfaPage = OptionalNullable.ofNull(); + } else if (guardianMfaPage.isEmpty()) { + this.guardianMfaPage = OptionalNullable.absent(); + } else { + this.guardianMfaPage = OptionalNullable.of(guardianMfaPage.get()); + } + return this; + } + + /** + *

Default audience for API authorization.

+ */ + @JsonSetter(value = "default_audience", nulls = Nulls.SKIP) + public Builder defaultAudience(Optional defaultAudience) { + this.defaultAudience = defaultAudience; + return this; + } + + public Builder defaultAudience(String defaultAudience) { + this.defaultAudience = Optional.ofNullable(defaultAudience); + return this; + } + + /** + *

Name of connection used for password grants at the /tokenendpoint. The following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS.

+ */ + @JsonSetter(value = "default_directory", nulls = Nulls.SKIP) + public Builder defaultDirectory(Optional defaultDirectory) { + this.defaultDirectory = defaultDirectory; + return this; + } + + public Builder defaultDirectory(String defaultDirectory) { + this.defaultDirectory = Optional.ofNullable(defaultDirectory); + return this; + } + + @JsonSetter(value = "error_page", nulls = Nulls.SKIP) + public Builder errorPage(@Nullable OptionalNullable errorPage) { + this.errorPage = errorPage; + return this; + } + + public Builder errorPage(TenantSettingsErrorPage errorPage) { + this.errorPage = OptionalNullable.of(errorPage); + return this; + } + + public Builder errorPage(Optional errorPage) { + if (errorPage.isPresent()) { + this.errorPage = OptionalNullable.of(errorPage.get()); + } else { + this.errorPage = OptionalNullable.absent(); + } + return this; + } + + public Builder errorPage(com.auth0.client.mgmt.core.Nullable errorPage) { + if (errorPage.isNull()) { + this.errorPage = OptionalNullable.ofNull(); + } else if (errorPage.isEmpty()) { + this.errorPage = OptionalNullable.absent(); + } else { + this.errorPage = OptionalNullable.of(errorPage.get()); + } + return this; + } + + @JsonSetter(value = "device_flow", nulls = Nulls.SKIP) + public Builder deviceFlow(@Nullable OptionalNullable deviceFlow) { + this.deviceFlow = deviceFlow; + return this; + } + + public Builder deviceFlow(TenantSettingsDeviceFlow deviceFlow) { + this.deviceFlow = OptionalNullable.of(deviceFlow); + return this; + } + + public Builder deviceFlow(Optional deviceFlow) { + if (deviceFlow.isPresent()) { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } else { + this.deviceFlow = OptionalNullable.absent(); + } + return this; + } + + public Builder deviceFlow(com.auth0.client.mgmt.core.Nullable deviceFlow) { + if (deviceFlow.isNull()) { + this.deviceFlow = OptionalNullable.ofNull(); + } else if (deviceFlow.isEmpty()) { + this.deviceFlow = OptionalNullable.absent(); + } else { + this.deviceFlow = OptionalNullable.of(deviceFlow.get()); + } + return this; + } + + @JsonSetter(value = "default_token_quota", nulls = Nulls.SKIP) + public Builder defaultTokenQuota(@Nullable OptionalNullable defaultTokenQuota) { + this.defaultTokenQuota = defaultTokenQuota; + return this; + } + + public Builder defaultTokenQuota(DefaultTokenQuota defaultTokenQuota) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota); + return this; + } + + public Builder defaultTokenQuota(Optional defaultTokenQuota) { + if (defaultTokenQuota.isPresent()) { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } else { + this.defaultTokenQuota = OptionalNullable.absent(); + } + return this; + } + + public Builder defaultTokenQuota(com.auth0.client.mgmt.core.Nullable defaultTokenQuota) { + if (defaultTokenQuota.isNull()) { + this.defaultTokenQuota = OptionalNullable.ofNull(); + } else if (defaultTokenQuota.isEmpty()) { + this.defaultTokenQuota = OptionalNullable.absent(); + } else { + this.defaultTokenQuota = OptionalNullable.of(defaultTokenQuota.get()); + } + return this; + } + + @JsonSetter(value = "flags", nulls = Nulls.SKIP) + public Builder flags(Optional flags) { + this.flags = flags; + return this; + } + + public Builder flags(TenantSettingsFlags flags) { + this.flags = Optional.ofNullable(flags); + return this; + } + + /** + *

Friendly name for this tenant.

+ */ + @JsonSetter(value = "friendly_name", nulls = Nulls.SKIP) + public Builder friendlyName(Optional friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + public Builder friendlyName(String friendlyName) { + this.friendlyName = Optional.ofNullable(friendlyName); + return this; + } + + /** + *

URL of logo to be shown for this tenant (recommended size: 150x150)

+ */ + @JsonSetter(value = "picture_url", nulls = Nulls.SKIP) + public Builder pictureUrl(Optional pictureUrl) { + this.pictureUrl = pictureUrl; + return this; + } + + public Builder pictureUrl(String pictureUrl) { + this.pictureUrl = Optional.ofNullable(pictureUrl); + return this; + } + + /** + *

End-user support email address.

+ */ + @JsonSetter(value = "support_email", nulls = Nulls.SKIP) + public Builder supportEmail(Optional supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + public Builder supportEmail(String supportEmail) { + this.supportEmail = Optional.ofNullable(supportEmail); + return this; + } + + /** + *

End-user support URL.

+ */ + @JsonSetter(value = "support_url", nulls = Nulls.SKIP) + public Builder supportUrl(Optional supportUrl) { + this.supportUrl = supportUrl; + return this; + } + + public Builder supportUrl(String supportUrl) { + this.supportUrl = Optional.ofNullable(supportUrl); + return this; + } + + /** + *

URLs that are valid to redirect to after logout from Auth0.

+ */ + @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) + public Builder allowedLogoutUrls(Optional> allowedLogoutUrls) { + this.allowedLogoutUrls = allowedLogoutUrls; + return this; + } + + public Builder allowedLogoutUrls(List allowedLogoutUrls) { + this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); + return this; + } + + /** + *

Number of hours a session will stay valid.

+ */ + @JsonSetter(value = "session_lifetime", nulls = Nulls.SKIP) + public Builder sessionLifetime(Optional sessionLifetime) { + this.sessionLifetime = sessionLifetime; + return this; + } + + public Builder sessionLifetime(Double sessionLifetime) { + this.sessionLifetime = Optional.ofNullable(sessionLifetime); + return this; + } + + /** + *

Number of hours for which a session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_session_lifetime", nulls = Nulls.SKIP) + public Builder idleSessionLifetime(Optional idleSessionLifetime) { + this.idleSessionLifetime = idleSessionLifetime; + return this; + } + + public Builder idleSessionLifetime(Double idleSessionLifetime) { + this.idleSessionLifetime = Optional.ofNullable(idleSessionLifetime); + return this; + } + + /** + *

Number of hours an ephemeral (non-persistent) session will stay valid.

+ */ + @JsonSetter(value = "ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder ephemeralSessionLifetime(Optional ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = ephemeralSessionLifetime; + return this; + } + + public Builder ephemeralSessionLifetime(Double ephemeralSessionLifetime) { + this.ephemeralSessionLifetime = Optional.ofNullable(ephemeralSessionLifetime); + return this; + } + + /** + *

Number of hours for which an ephemeral (non-persistent) session can be inactive before the user must log in again.

+ */ + @JsonSetter(value = "idle_ephemeral_session_lifetime", nulls = Nulls.SKIP) + public Builder idleEphemeralSessionLifetime(Optional idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = idleEphemeralSessionLifetime; + return this; + } + + public Builder idleEphemeralSessionLifetime(Double idleEphemeralSessionLifetime) { + this.idleEphemeralSessionLifetime = Optional.ofNullable(idleEphemeralSessionLifetime); + return this; + } + + /** + *

Selected sandbox version for the extensibility environment.

+ */ + @JsonSetter(value = "sandbox_version", nulls = Nulls.SKIP) + public Builder sandboxVersion(Optional sandboxVersion) { + this.sandboxVersion = sandboxVersion; + return this; + } + + public Builder sandboxVersion(String sandboxVersion) { + this.sandboxVersion = Optional.ofNullable(sandboxVersion); + return this; + } + + /** + *

Selected sandbox version for rules and hooks extensibility.

+ */ + @JsonSetter(value = "legacy_sandbox_version", nulls = Nulls.SKIP) + public Builder legacySandboxVersion(Optional legacySandboxVersion) { + this.legacySandboxVersion = legacySandboxVersion; + return this; + } + + public Builder legacySandboxVersion(String legacySandboxVersion) { + this.legacySandboxVersion = Optional.ofNullable(legacySandboxVersion); + return this; + } + + /** + *

Available sandbox versions for the extensibility environment.

+ */ + @JsonSetter(value = "sandbox_versions_available", nulls = Nulls.SKIP) + public Builder sandboxVersionsAvailable(Optional> sandboxVersionsAvailable) { + this.sandboxVersionsAvailable = sandboxVersionsAvailable; + return this; + } + + public Builder sandboxVersionsAvailable(List sandboxVersionsAvailable) { + this.sandboxVersionsAvailable = Optional.ofNullable(sandboxVersionsAvailable); + return this; + } + + /** + *

The default absolute redirection uri, must be https

+ */ + @JsonSetter(value = "default_redirection_uri", nulls = Nulls.SKIP) + public Builder defaultRedirectionUri(Optional defaultRedirectionUri) { + this.defaultRedirectionUri = defaultRedirectionUri; + return this; + } + + public Builder defaultRedirectionUri(String defaultRedirectionUri) { + this.defaultRedirectionUri = Optional.ofNullable(defaultRedirectionUri); + return this; + } + + /** + *

Supported locales for the user interface.

+ */ + @JsonSetter(value = "enabled_locales", nulls = Nulls.SKIP) + public Builder enabledLocales(Optional> enabledLocales) { + this.enabledLocales = enabledLocales; + return this; + } + + public Builder enabledLocales(List enabledLocales) { + this.enabledLocales = Optional.ofNullable(enabledLocales); + return this; + } + + @JsonSetter(value = "session_cookie", nulls = Nulls.SKIP) + public Builder sessionCookie(@Nullable OptionalNullable sessionCookie) { + this.sessionCookie = sessionCookie; + return this; + } + + public Builder sessionCookie(SessionCookieSchema sessionCookie) { + this.sessionCookie = OptionalNullable.of(sessionCookie); + return this; + } + + public Builder sessionCookie(Optional sessionCookie) { + if (sessionCookie.isPresent()) { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } else { + this.sessionCookie = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionCookie(com.auth0.client.mgmt.core.Nullable sessionCookie) { + if (sessionCookie.isNull()) { + this.sessionCookie = OptionalNullable.ofNull(); + } else if (sessionCookie.isEmpty()) { + this.sessionCookie = OptionalNullable.absent(); + } else { + this.sessionCookie = OptionalNullable.of(sessionCookie.get()); + } + return this; + } + + @JsonSetter(value = "sessions", nulls = Nulls.SKIP) + public Builder sessions(@Nullable OptionalNullable sessions) { + this.sessions = sessions; + return this; + } + + public Builder sessions(TenantSettingsSessions sessions) { + this.sessions = OptionalNullable.of(sessions); + return this; + } + + public Builder sessions(Optional sessions) { + if (sessions.isPresent()) { + this.sessions = OptionalNullable.of(sessions.get()); + } else { + this.sessions = OptionalNullable.absent(); + } + return this; + } + + public Builder sessions(com.auth0.client.mgmt.core.Nullable sessions) { + if (sessions.isNull()) { + this.sessions = OptionalNullable.ofNull(); + } else if (sessions.isEmpty()) { + this.sessions = OptionalNullable.absent(); + } else { + this.sessions = OptionalNullable.of(sessions.get()); + } + return this; + } + + @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) + public Builder oidcLogout(Optional oidcLogout) { + this.oidcLogout = oidcLogout; + return this; + } + + public Builder oidcLogout(TenantOidcLogoutSettings oidcLogout) { + this.oidcLogout = Optional.ofNullable(oidcLogout); + return this; + } + + /** + *

Whether to accept an organization name instead of an ID on auth endpoints

+ */ + @JsonSetter(value = "allow_organization_name_in_authentication_api", nulls = Nulls.SKIP) + public Builder allowOrganizationNameInAuthenticationApi( + Optional allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = allowOrganizationNameInAuthenticationApi; + return this; + } + + public Builder allowOrganizationNameInAuthenticationApi(Boolean allowOrganizationNameInAuthenticationApi) { + this.allowOrganizationNameInAuthenticationApi = + Optional.ofNullable(allowOrganizationNameInAuthenticationApi); + return this; + } + + /** + *

Whether to enable flexible factors for MFA in the PostLogin action

+ */ + @JsonSetter(value = "customize_mfa_in_postlogin_action", nulls = Nulls.SKIP) + public Builder customizeMfaInPostloginAction(Optional customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = customizeMfaInPostloginAction; + return this; + } + + public Builder customizeMfaInPostloginAction(Boolean customizeMfaInPostloginAction) { + this.customizeMfaInPostloginAction = Optional.ofNullable(customizeMfaInPostloginAction); + return this; + } + + /** + *

Supported ACR values

+ */ + @JsonSetter(value = "acr_values_supported", nulls = Nulls.SKIP) + public Builder acrValuesSupported(Optional> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + return this; + } + + public Builder acrValuesSupported(List acrValuesSupported) { + this.acrValuesSupported = Optional.ofNullable(acrValuesSupported); + return this; + } + + @JsonSetter(value = "mtls", nulls = Nulls.SKIP) + public Builder mtls(@Nullable OptionalNullable mtls) { + this.mtls = mtls; + return this; + } + + public Builder mtls(TenantSettingsMtls mtls) { + this.mtls = OptionalNullable.of(mtls); + return this; + } + + public Builder mtls(Optional mtls) { + if (mtls.isPresent()) { + this.mtls = OptionalNullable.of(mtls.get()); + } else { + this.mtls = OptionalNullable.absent(); + } + return this; + } + + public Builder mtls(com.auth0.client.mgmt.core.Nullable mtls) { + if (mtls.isNull()) { + this.mtls = OptionalNullable.ofNull(); + } else if (mtls.isEmpty()) { + this.mtls = OptionalNullable.absent(); + } else { + this.mtls = OptionalNullable.of(mtls.get()); + } + return this; + } + + /** + *

Enables the use of Pushed Authorization Requests

+ */ + @JsonSetter(value = "pushed_authorization_requests_supported", nulls = Nulls.SKIP) + public Builder pushedAuthorizationRequestsSupported(Optional pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; + return this; + } + + public Builder pushedAuthorizationRequestsSupported(Boolean pushedAuthorizationRequestsSupported) { + this.pushedAuthorizationRequestsSupported = Optional.ofNullable(pushedAuthorizationRequestsSupported); + return this; + } + + /** + *

Supports iss parameter in authorization responses

+ */ + @JsonSetter(value = "authorization_response_iss_parameter_supported", nulls = Nulls.SKIP) + public Builder authorizationResponseIssParameterSupported( + @Nullable OptionalNullable authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + return this; + } + + public Builder authorizationResponseIssParameterSupported(Boolean authorizationResponseIssParameterSupported) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported); + return this; + } + + public Builder authorizationResponseIssParameterSupported( + Optional authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isPresent()) { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } else { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } + return this; + } + + public Builder authorizationResponseIssParameterSupported( + com.auth0.client.mgmt.core.Nullable authorizationResponseIssParameterSupported) { + if (authorizationResponseIssParameterSupported.isNull()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.ofNull(); + } else if (authorizationResponseIssParameterSupported.isEmpty()) { + this.authorizationResponseIssParameterSupported = OptionalNullable.absent(); + } else { + this.authorizationResponseIssParameterSupported = + OptionalNullable.of(authorizationResponseIssParameterSupported.get()); + } + return this; + } + + public UpdateTenantSettingsResponseContent build() { + return new UpdateTenantSettingsResponseContent( + changePassword, + guardianMfaPage, + defaultAudience, + defaultDirectory, + errorPage, + deviceFlow, + defaultTokenQuota, + flags, + friendlyName, + pictureUrl, + supportEmail, + supportUrl, + allowedLogoutUrls, + sessionLifetime, + idleSessionLifetime, + ephemeralSessionLifetime, + idleEphemeralSessionLifetime, + sandboxVersion, + legacySandboxVersion, + sandboxVersionsAvailable, + defaultRedirectionUri, + enabledLocales, + sessionCookie, + sessions, + oidcLogout, + allowOrganizationNameInAuthenticationApi, + customizeMfaInPostloginAction, + acrValuesSupported, + mtls, + pushedAuthorizationRequestsSupported, + authorizationResponseIssParameterSupported, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java new file mode 100644 index 000000000..d4253ec21 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateTokenExchangeProfileRequestContent.Builder.class) +public final class UpdateTokenExchangeProfileRequestContent { + private final Optional name; + + private final Optional subjectTokenType; + + private final Map additionalProperties; + + private UpdateTokenExchangeProfileRequestContent( + Optional name, Optional subjectTokenType, Map additionalProperties) { + this.name = name; + this.subjectTokenType = subjectTokenType; + this.additionalProperties = additionalProperties; + } + + /** + * @return Friendly name of this profile. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + */ + @JsonProperty("subject_token_type") + public Optional getSubjectTokenType() { + return subjectTokenType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateTokenExchangeProfileRequestContent + && equalTo((UpdateTokenExchangeProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateTokenExchangeProfileRequestContent other) { + return name.equals(other.name) && subjectTokenType.equals(other.subjectTokenType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.subjectTokenType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional subjectTokenType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateTokenExchangeProfileRequestContent other) { + name(other.getName()); + subjectTokenType(other.getSubjectTokenType()); + return this; + } + + /** + *

Friendly name of this profile.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

+ */ + @JsonSetter(value = "subject_token_type", nulls = Nulls.SKIP) + public Builder subjectTokenType(Optional subjectTokenType) { + this.subjectTokenType = subjectTokenType; + return this; + } + + public Builder subjectTokenType(String subjectTokenType) { + this.subjectTokenType = Optional.ofNullable(subjectTokenType); + return this; + } + + public UpdateTokenExchangeProfileRequestContent build() { + return new UpdateTokenExchangeProfileRequestContent(name, subjectTokenType, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java new file mode 100644 index 000000000..809a005a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateTokenQuota.Builder.class) +public final class UpdateTokenQuota { + private final TokenQuotaClientCredentials clientCredentials; + + private final Map additionalProperties; + + private UpdateTokenQuota(TokenQuotaClientCredentials clientCredentials, Map additionalProperties) { + this.clientCredentials = clientCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_credentials") + public TokenQuotaClientCredentials getClientCredentials() { + return clientCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateTokenQuota && equalTo((UpdateTokenQuota) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateTokenQuota other) { + return clientCredentials.equals(other.clientCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientCredentialsStage builder() { + return new Builder(); + } + + public interface ClientCredentialsStage { + _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials); + + Builder from(UpdateTokenQuota other); + } + + public interface _FinalStage { + UpdateTokenQuota build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientCredentialsStage, _FinalStage { + private TokenQuotaClientCredentials clientCredentials; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateTokenQuota other) { + clientCredentials(other.getClientCredentials()); + return this; + } + + @java.lang.Override + @JsonSetter("client_credentials") + public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { + this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); + return this; + } + + @java.lang.Override + public UpdateTokenQuota build() { + return new UpdateTokenQuota(clientCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java new file mode 100644 index 000000000..eca442c22 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UpdateUniversalLoginTemplateRequestContent.Deserializer.class) +public final class UpdateUniversalLoginTemplateRequestContent { + private final Object value; + + private final int type; + + private UpdateUniversalLoginTemplateRequestContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((UpdateUniversalLoginTemplateRequestContentTemplate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUniversalLoginTemplateRequestContent + && equalTo((UpdateUniversalLoginTemplateRequestContent) other); + } + + private boolean equalTo(UpdateUniversalLoginTemplateRequestContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UpdateUniversalLoginTemplateRequestContent of(String value) { + return new UpdateUniversalLoginTemplateRequestContent(value, 0); + } + + public static UpdateUniversalLoginTemplateRequestContent of( + UpdateUniversalLoginTemplateRequestContentTemplate value) { + return new UpdateUniversalLoginTemplateRequestContent(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(UpdateUniversalLoginTemplateRequestContentTemplate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateUniversalLoginTemplateRequestContent.class); + } + + @java.lang.Override + public UpdateUniversalLoginTemplateRequestContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, UpdateUniversalLoginTemplateRequestContentTemplate.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContentTemplate.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContentTemplate.java new file mode 100644 index 000000000..933f432d6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContentTemplate.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUniversalLoginTemplateRequestContentTemplate.Builder.class) +public final class UpdateUniversalLoginTemplateRequestContentTemplate { + private final String template; + + private final Map additionalProperties; + + private UpdateUniversalLoginTemplateRequestContentTemplate( + String template, Map additionalProperties) { + this.template = template; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("template") + public String getTemplate() { + return template; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUniversalLoginTemplateRequestContentTemplate + && equalTo((UpdateUniversalLoginTemplateRequestContentTemplate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUniversalLoginTemplateRequestContentTemplate other) { + return template.equals(other.template); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.template); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemplateStage builder() { + return new Builder(); + } + + public interface TemplateStage { + _FinalStage template(@NotNull String template); + + Builder from(UpdateUniversalLoginTemplateRequestContentTemplate other); + } + + public interface _FinalStage { + UpdateUniversalLoginTemplateRequestContentTemplate build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TemplateStage, _FinalStage { + private String template; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateUniversalLoginTemplateRequestContentTemplate other) { + template(other.getTemplate()); + return this; + } + + @java.lang.Override + @JsonSetter("template") + public _FinalStage template(@NotNull String template) { + this.template = Objects.requireNonNull(template, "template must not be null"); + return this; + } + + @java.lang.Override + public UpdateUniversalLoginTemplateRequestContentTemplate build() { + return new UpdateUniversalLoginTemplateRequestContentTemplate(template, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java new file mode 100644 index 000000000..bbb6fcfe1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUserAuthenticationMethodResponseContent.Builder.class) +public final class UpdateUserAuthenticationMethodResponseContent { + private final Optional id; + + private final CreatedAuthenticationMethodTypeEnum type; + + private final Optional name; + + private final Optional totpSecret; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional> authenticationMethods; + + private final Optional preferredAuthenticationMethod; + + private final Optional keyId; + + private final Optional publicKey; + + private final Optional relyingPartyIdentifier; + + private final Optional createdAt; + + private final Map additionalProperties; + + private UpdateUserAuthenticationMethodResponseContent( + Optional id, + CreatedAuthenticationMethodTypeEnum type, + Optional name, + Optional totpSecret, + Optional phoneNumber, + Optional email, + Optional> authenticationMethods, + Optional preferredAuthenticationMethod, + Optional keyId, + Optional publicKey, + Optional relyingPartyIdentifier, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.type = type; + this.name = name; + this.totpSecret = totpSecret; + this.phoneNumber = phoneNumber; + this.email = email; + this.authenticationMethods = authenticationMethods; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.keyId = keyId; + this.publicKey = publicKey; + this.relyingPartyIdentifier = relyingPartyIdentifier; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the newly created authentication method (automatically generated by the application) + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("type") + public CreatedAuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return A human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Base32 encoded secret for TOTP generation + */ + @JsonProperty("totp_secret") + public Optional getTotpSecret() { + return totpSecret; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("authentication_methods") + public Optional> getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return Applies to webauthn authentication methods only. The id of the credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authentication methods only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Applies to webauthn authentication methods only. The relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + /** + * @return Authentication method creation date + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserAuthenticationMethodResponseContent + && equalTo((UpdateUserAuthenticationMethodResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserAuthenticationMethodResponseContent other) { + return id.equals(other.id) + && type.equals(other.type) + && name.equals(other.name) + && totpSecret.equals(other.totpSecret) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && authenticationMethods.equals(other.authenticationMethods) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.type, + this.name, + this.totpSecret, + this.phoneNumber, + this.email, + this.authenticationMethods, + this.preferredAuthenticationMethod, + this.keyId, + this.publicKey, + this.relyingPartyIdentifier, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type); + + Builder from(UpdateUserAuthenticationMethodResponseContent other); + } + + public interface _FinalStage { + UpdateUserAuthenticationMethodResponseContent build(); + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

A human-readable label to identify the authentication method.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Base32 encoded secret for TOTP generation

+ */ + _FinalStage totpSecret(Optional totpSecret); + + _FinalStage totpSecret(String totpSecret); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage authenticationMethods(Optional> authenticationMethods); + + _FinalStage authenticationMethods(List authenticationMethods); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); + + /** + *

Authentication method creation date

+ */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CreatedAuthenticationMethodTypeEnum type; + + private Optional createdAt = Optional.empty(); + + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional> authenticationMethods = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional totpSecret = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateUserAuthenticationMethodResponseContent other) { + id(other.getId()); + type(other.getType()); + name(other.getName()); + totpSecret(other.getTotpSecret()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + authenticationMethods(other.getAuthenticationMethods()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); + createdAt(other.getCreatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Authentication method creation date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Authentication method creation date

+ */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ */ + @java.lang.Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public _FinalStage authenticationMethods(List authenticationMethods) { + this.authenticationMethods = Optional.ofNullable(authenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public _FinalStage authenticationMethods( + Optional> authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage totpSecret(String totpSecret) { + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + *

Base32 encoded secret for TOTP generation

+ */ + @java.lang.Override + @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) + public _FinalStage totpSecret(Optional totpSecret) { + this.totpSecret = totpSecret; + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The ID of the newly created authentication method (automatically generated by the application)

+ */ + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public UpdateUserAuthenticationMethodResponseContent build() { + return new UpdateUserAuthenticationMethodResponseContent( + id, + type, + name, + totpSecret, + phoneNumber, + email, + authenticationMethods, + preferredAuthenticationMethod, + keyId, + publicKey, + relyingPartyIdentifier, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java new file mode 100644 index 000000000..c6a627803 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java @@ -0,0 +1,911 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUserRequestContent.Builder.class) +public final class UpdateUserRequestContent { + private final Optional blocked; + + private final Optional emailVerified; + + private final OptionalNullable email; + + private final OptionalNullable phoneNumber; + + private final Optional phoneVerified; + + private final Optional> userMetadata; + + private final Optional> appMetadata; + + private final OptionalNullable givenName; + + private final OptionalNullable familyName; + + private final OptionalNullable name; + + private final OptionalNullable nickname; + + private final OptionalNullable picture; + + private final Optional verifyEmail; + + private final Optional verifyPhoneNumber; + + private final OptionalNullable password; + + private final Optional connection; + + private final Optional clientId; + + private final OptionalNullable username; + + private final Map additionalProperties; + + private UpdateUserRequestContent( + Optional blocked, + Optional emailVerified, + OptionalNullable email, + OptionalNullable phoneNumber, + Optional phoneVerified, + Optional> userMetadata, + Optional> appMetadata, + OptionalNullable givenName, + OptionalNullable familyName, + OptionalNullable name, + OptionalNullable nickname, + OptionalNullable picture, + Optional verifyEmail, + Optional verifyPhoneNumber, + OptionalNullable password, + Optional connection, + Optional clientId, + OptionalNullable username, + Map additionalProperties) { + this.blocked = blocked; + this.emailVerified = emailVerified; + this.email = email; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.userMetadata = userMetadata; + this.appMetadata = appMetadata; + this.givenName = givenName; + this.familyName = familyName; + this.name = name; + this.nickname = nickname; + this.picture = picture; + this.verifyEmail = verifyEmail; + this.verifyPhoneNumber = verifyPhoneNumber; + this.password = password; + this.connection = connection; + this.clientId = clientId; + this.username = username; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether this user was blocked by an administrator (true) or not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). If set to false the user will not receive a verification email unless verify_email is set to true. + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Email address of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + public OptionalNullable getEmail() { + if (email == null) { + return OptionalNullable.absent(); + } + return email; + } + + /** + * @return The user's phone number (following the E.164 recommendation). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + public OptionalNullable getPhoneNumber() { + if (phoneNumber == null) { + return OptionalNullable.absent(); + } + return phoneNumber; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("given_name") + public OptionalNullable getGivenName() { + if (givenName == null) { + return OptionalNullable.absent(); + } + return givenName; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("family_name") + public OptionalNullable getFamilyName() { + if (familyName == null) { + return OptionalNullable.absent(); + } + return familyName; + } + + /** + * @return Name of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + public OptionalNullable getName() { + if (name == null) { + return OptionalNullable.absent(); + } + return name; + } + + /** + * @return Preferred nickname or alias of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("nickname") + public OptionalNullable getNickname() { + if (nickname == null) { + return OptionalNullable.absent(); + } + return nickname; + } + + /** + * @return URL to picture, photo, or avatar of this user. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("picture") + public OptionalNullable getPicture() { + if (picture == null) { + return OptionalNullable.absent(); + } + return picture; + } + + /** + * @return Whether this user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter. + */ + @JsonProperty("verify_email") + public Optional getVerifyEmail() { + return verifyEmail; + } + + /** + * @return Whether this user will receive a text after changing the phone number (true) or no text (false). Only valid when changing phone number for SMS connections. + */ + @JsonProperty("verify_phone_number") + public Optional getVerifyPhoneNumber() { + return verifyPhoneNumber; + } + + /** + * @return New password for this user. Only valid for database connections. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password") + public OptionalNullable getPassword() { + if (password == null) { + return OptionalNullable.absent(); + } + return password; + } + + /** + * @return Name of the connection to target for this user update. + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + /** + * @return Auth0 client ID. Only valid when updating email address. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return The user's username. Only valid if the connection requires a username. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + public OptionalNullable getUsername() { + if (username == null) { + return OptionalNullable.absent(); + } + return username; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + private OptionalNullable _getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private OptionalNullable _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("given_name") + private OptionalNullable _getGivenName() { + return givenName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("family_name") + private OptionalNullable _getFamilyName() { + return familyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private OptionalNullable _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("nickname") + private OptionalNullable _getNickname() { + return nickname; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("picture") + private OptionalNullable _getPicture() { + return picture; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password") + private OptionalNullable _getPassword() { + return password; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + private OptionalNullable _getUsername() { + return username; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserRequestContent && equalTo((UpdateUserRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserRequestContent other) { + return blocked.equals(other.blocked) + && emailVerified.equals(other.emailVerified) + && email.equals(other.email) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && userMetadata.equals(other.userMetadata) + && appMetadata.equals(other.appMetadata) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName) + && name.equals(other.name) + && nickname.equals(other.nickname) + && picture.equals(other.picture) + && verifyEmail.equals(other.verifyEmail) + && verifyPhoneNumber.equals(other.verifyPhoneNumber) + && password.equals(other.password) + && connection.equals(other.connection) + && clientId.equals(other.clientId) + && username.equals(other.username); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.blocked, + this.emailVerified, + this.email, + this.phoneNumber, + this.phoneVerified, + this.userMetadata, + this.appMetadata, + this.givenName, + this.familyName, + this.name, + this.nickname, + this.picture, + this.verifyEmail, + this.verifyPhoneNumber, + this.password, + this.connection, + this.clientId, + this.username); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional blocked = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private OptionalNullable email = OptionalNullable.absent(); + + private OptionalNullable phoneNumber = OptionalNullable.absent(); + + private Optional phoneVerified = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private OptionalNullable givenName = OptionalNullable.absent(); + + private OptionalNullable familyName = OptionalNullable.absent(); + + private OptionalNullable name = OptionalNullable.absent(); + + private OptionalNullable nickname = OptionalNullable.absent(); + + private OptionalNullable picture = OptionalNullable.absent(); + + private Optional verifyEmail = Optional.empty(); + + private Optional verifyPhoneNumber = Optional.empty(); + + private OptionalNullable password = OptionalNullable.absent(); + + private Optional connection = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private OptionalNullable username = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateUserRequestContent other) { + blocked(other.getBlocked()); + emailVerified(other.getEmailVerified()); + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + userMetadata(other.getUserMetadata()); + appMetadata(other.getAppMetadata()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + name(other.getName()); + nickname(other.getNickname()); + picture(other.getPicture()); + verifyEmail(other.getVerifyEmail()); + verifyPhoneNumber(other.getVerifyPhoneNumber()); + password(other.getPassword()); + connection(other.getConnection()); + clientId(other.getClientId()); + username(other.getUsername()); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or not (false).

+ */ + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public Builder blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + public Builder blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false). If set to false the user will not receive a verification email unless verify_email is set to true.

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(@Nullable OptionalNullable email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = OptionalNullable.of(email); + return this; + } + + public Builder email(Optional email) { + if (email.isPresent()) { + this.email = OptionalNullable.of(email.get()); + } else { + this.email = OptionalNullable.absent(); + } + return this; + } + + public Builder email(com.auth0.client.mgmt.core.Nullable email) { + if (email.isNull()) { + this.email = OptionalNullable.ofNull(); + } else if (email.isEmpty()) { + this.email = OptionalNullable.absent(); + } else { + this.email = OptionalNullable.of(email.get()); + } + return this; + } + + /** + *

The user's phone number (following the E.164 recommendation).

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(@Nullable OptionalNullable phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = OptionalNullable.of(phoneNumber); + return this; + } + + public Builder phoneNumber(Optional phoneNumber) { + if (phoneNumber.isPresent()) { + this.phoneNumber = OptionalNullable.of(phoneNumber.get()); + } else { + this.phoneNumber = OptionalNullable.absent(); + } + return this; + } + + public Builder phoneNumber(com.auth0.client.mgmt.core.Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = OptionalNullable.ofNull(); + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = OptionalNullable.absent(); + } else { + this.phoneNumber = OptionalNullable.of(phoneNumber.get()); + } + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(@Nullable OptionalNullable givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = OptionalNullable.of(givenName); + return this; + } + + public Builder givenName(Optional givenName) { + if (givenName.isPresent()) { + this.givenName = OptionalNullable.of(givenName.get()); + } else { + this.givenName = OptionalNullable.absent(); + } + return this; + } + + public Builder givenName(com.auth0.client.mgmt.core.Nullable givenName) { + if (givenName.isNull()) { + this.givenName = OptionalNullable.ofNull(); + } else if (givenName.isEmpty()) { + this.givenName = OptionalNullable.absent(); + } else { + this.givenName = OptionalNullable.of(givenName.get()); + } + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(@Nullable OptionalNullable familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = OptionalNullable.of(familyName); + return this; + } + + public Builder familyName(Optional familyName) { + if (familyName.isPresent()) { + this.familyName = OptionalNullable.of(familyName.get()); + } else { + this.familyName = OptionalNullable.absent(); + } + return this; + } + + public Builder familyName(com.auth0.client.mgmt.core.Nullable familyName) { + if (familyName.isNull()) { + this.familyName = OptionalNullable.ofNull(); + } else if (familyName.isEmpty()) { + this.familyName = OptionalNullable.absent(); + } else { + this.familyName = OptionalNullable.of(familyName.get()); + } + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(@Nullable OptionalNullable name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = OptionalNullable.of(name); + return this; + } + + public Builder name(Optional name) { + if (name.isPresent()) { + this.name = OptionalNullable.of(name.get()); + } else { + this.name = OptionalNullable.absent(); + } + return this; + } + + public Builder name(com.auth0.client.mgmt.core.Nullable name) { + if (name.isNull()) { + this.name = OptionalNullable.ofNull(); + } else if (name.isEmpty()) { + this.name = OptionalNullable.absent(); + } else { + this.name = OptionalNullable.of(name.get()); + } + return this; + } + + /** + *

Preferred nickname or alias of this user.

+ */ + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public Builder nickname(@Nullable OptionalNullable nickname) { + this.nickname = nickname; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = OptionalNullable.of(nickname); + return this; + } + + public Builder nickname(Optional nickname) { + if (nickname.isPresent()) { + this.nickname = OptionalNullable.of(nickname.get()); + } else { + this.nickname = OptionalNullable.absent(); + } + return this; + } + + public Builder nickname(com.auth0.client.mgmt.core.Nullable nickname) { + if (nickname.isNull()) { + this.nickname = OptionalNullable.ofNull(); + } else if (nickname.isEmpty()) { + this.nickname = OptionalNullable.absent(); + } else { + this.nickname = OptionalNullable.of(nickname.get()); + } + return this; + } + + /** + *

URL to picture, photo, or avatar of this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(@Nullable OptionalNullable picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = OptionalNullable.of(picture); + return this; + } + + public Builder picture(Optional picture) { + if (picture.isPresent()) { + this.picture = OptionalNullable.of(picture.get()); + } else { + this.picture = OptionalNullable.absent(); + } + return this; + } + + public Builder picture(com.auth0.client.mgmt.core.Nullable picture) { + if (picture.isNull()) { + this.picture = OptionalNullable.ofNull(); + } else if (picture.isEmpty()) { + this.picture = OptionalNullable.absent(); + } else { + this.picture = OptionalNullable.of(picture.get()); + } + return this; + } + + /** + *

Whether this user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

+ */ + @JsonSetter(value = "verify_email", nulls = Nulls.SKIP) + public Builder verifyEmail(Optional verifyEmail) { + this.verifyEmail = verifyEmail; + return this; + } + + public Builder verifyEmail(Boolean verifyEmail) { + this.verifyEmail = Optional.ofNullable(verifyEmail); + return this; + } + + /** + *

Whether this user will receive a text after changing the phone number (true) or no text (false). Only valid when changing phone number for SMS connections.

+ */ + @JsonSetter(value = "verify_phone_number", nulls = Nulls.SKIP) + public Builder verifyPhoneNumber(Optional verifyPhoneNumber) { + this.verifyPhoneNumber = verifyPhoneNumber; + return this; + } + + public Builder verifyPhoneNumber(Boolean verifyPhoneNumber) { + this.verifyPhoneNumber = Optional.ofNullable(verifyPhoneNumber); + return this; + } + + /** + *

New password for this user. Only valid for database connections.

+ */ + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public Builder password(@Nullable OptionalNullable password) { + this.password = password; + return this; + } + + public Builder password(String password) { + this.password = OptionalNullable.of(password); + return this; + } + + public Builder password(Optional password) { + if (password.isPresent()) { + this.password = OptionalNullable.of(password.get()); + } else { + this.password = OptionalNullable.absent(); + } + return this; + } + + public Builder password(com.auth0.client.mgmt.core.Nullable password) { + if (password.isNull()) { + this.password = OptionalNullable.ofNull(); + } else if (password.isEmpty()) { + this.password = OptionalNullable.absent(); + } else { + this.password = OptionalNullable.of(password.get()); + } + return this; + } + + /** + *

Name of the connection to target for this user update.

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + *

Auth0 client ID. Only valid when updating email address.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

The user's username. Only valid if the connection requires a username.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(@Nullable OptionalNullable username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = OptionalNullable.of(username); + return this; + } + + public Builder username(Optional username) { + if (username.isPresent()) { + this.username = OptionalNullable.of(username.get()); + } else { + this.username = OptionalNullable.absent(); + } + return this; + } + + public Builder username(com.auth0.client.mgmt.core.Nullable username) { + if (username.isNull()) { + this.username = OptionalNullable.ofNull(); + } else if (username.isEmpty()) { + this.username = OptionalNullable.absent(); + } else { + this.username = OptionalNullable.of(username.get()); + } + return this; + } + + public UpdateUserRequestContent build() { + return new UpdateUserRequestContent( + blocked, + emailVerified, + email, + phoneNumber, + phoneVerified, + userMetadata, + appMetadata, + givenName, + familyName, + name, + nickname, + picture, + verifyEmail, + verifyPhoneNumber, + password, + connection, + clientId, + username, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java new file mode 100644 index 000000000..8e5b12bc5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java @@ -0,0 +1,717 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUserResponseContent.Builder.class) +public final class UpdateUserResponseContent { + private final Optional userId; + + private final Optional email; + + private final Optional emailVerified; + + private final Optional username; + + private final Optional phoneNumber; + + private final Optional phoneVerified; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> identities; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional picture; + + private final Optional name; + + private final Optional nickname; + + private final Optional> multifactor; + + private final Optional lastIp; + + private final Optional lastLogin; + + private final Optional loginsCount; + + private final Optional blocked; + + private final Optional givenName; + + private final Optional familyName; + + private final Map additionalProperties; + + private UpdateUserResponseContent( + Optional userId, + Optional email, + Optional emailVerified, + Optional username, + Optional phoneNumber, + Optional phoneVerified, + Optional createdAt, + Optional updatedAt, + Optional> identities, + Optional> appMetadata, + Optional> userMetadata, + Optional picture, + Optional name, + Optional nickname, + Optional> multifactor, + Optional lastIp, + Optional lastLogin, + Optional loginsCount, + Optional blocked, + Optional givenName, + Optional familyName, + Map additionalProperties) { + this.userId = userId; + this.email = email; + this.emailVerified = emailVerified; + this.username = username; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.identities = identities; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.picture = picture; + this.name = name; + this.nickname = nickname; + this.multifactor = multifactor; + this.lastIp = lastIp; + this.lastLogin = lastLogin; + this.loginsCount = loginsCount; + this.blocked = blocked; + this.givenName = givenName; + this.familyName = familyName; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Username of this user. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Array of user identity objects when accounts are linked. + */ + @JsonProperty("identities") + public Optional> getIdentities() { + return identities; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return URL to picture, photo, or avatar of this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Preferred nickname or alias of this user. + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return List of multi-factor authentication providers with which this user has enrolled. + */ + @JsonProperty("multifactor") + public Optional> getMultifactor() { + return multifactor; + } + + /** + * @return Last IP address from which this user logged in. + */ + @JsonProperty("last_ip") + public Optional getLastIp() { + return lastIp; + } + + @JsonProperty("last_login") + public Optional getLastLogin() { + return lastLogin; + } + + /** + * @return Total number of logins this user has performed. + */ + @JsonProperty("logins_count") + public Optional getLoginsCount() { + return loginsCount; + } + + /** + * @return Whether this user was blocked by an administrator (true) or is not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserResponseContent && equalTo((UpdateUserResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserResponseContent other) { + return userId.equals(other.userId) + && email.equals(other.email) + && emailVerified.equals(other.emailVerified) + && username.equals(other.username) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && identities.equals(other.identities) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && picture.equals(other.picture) + && name.equals(other.name) + && nickname.equals(other.nickname) + && multifactor.equals(other.multifactor) + && lastIp.equals(other.lastIp) + && lastLogin.equals(other.lastLogin) + && loginsCount.equals(other.loginsCount) + && blocked.equals(other.blocked) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userId, + this.email, + this.emailVerified, + this.username, + this.phoneNumber, + this.phoneVerified, + this.createdAt, + this.updatedAt, + this.identities, + this.appMetadata, + this.userMetadata, + this.picture, + this.name, + this.nickname, + this.multifactor, + this.lastIp, + this.lastLogin, + this.loginsCount, + this.blocked, + this.givenName, + this.familyName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> identities = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional nickname = Optional.empty(); + + private Optional> multifactor = Optional.empty(); + + private Optional lastIp = Optional.empty(); + + private Optional lastLogin = Optional.empty(); + + private Optional loginsCount = Optional.empty(); + + private Optional blocked = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional familyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateUserResponseContent other) { + userId(other.getUserId()); + email(other.getEmail()); + emailVerified(other.getEmailVerified()); + username(other.getUsername()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + identities(other.getIdentities()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + picture(other.getPicture()); + name(other.getName()); + nickname(other.getNickname()); + multifactor(other.getMultifactor()); + lastIp(other.getLastIp()); + lastLogin(other.getLastLogin()); + loginsCount(other.getLoginsCount()); + blocked(other.getBlocked()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Username of this user.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(UserDateSchema createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(UserDateSchema updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Array of user identity objects when accounts are linked.

+ */ + @JsonSetter(value = "identities", nulls = Nulls.SKIP) + public Builder identities(Optional> identities) { + this.identities = identities; + return this; + } + + public Builder identities(List identities) { + this.identities = Optional.ofNullable(identities); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

URL to picture, photo, or avatar of this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Preferred nickname or alias of this user.

+ */ + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public Builder nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = Optional.ofNullable(nickname); + return this; + } + + /** + *

List of multi-factor authentication providers with which this user has enrolled.

+ */ + @JsonSetter(value = "multifactor", nulls = Nulls.SKIP) + public Builder multifactor(Optional> multifactor) { + this.multifactor = multifactor; + return this; + } + + public Builder multifactor(List multifactor) { + this.multifactor = Optional.ofNullable(multifactor); + return this; + } + + /** + *

Last IP address from which this user logged in.

+ */ + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(Optional lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = Optional.ofNullable(lastIp); + return this; + } + + @JsonSetter(value = "last_login", nulls = Nulls.SKIP) + public Builder lastLogin(Optional lastLogin) { + this.lastLogin = lastLogin; + return this; + } + + public Builder lastLogin(UserDateSchema lastLogin) { + this.lastLogin = Optional.ofNullable(lastLogin); + return this; + } + + /** + *

Total number of logins this user has performed.

+ */ + @JsonSetter(value = "logins_count", nulls = Nulls.SKIP) + public Builder loginsCount(Optional loginsCount) { + this.loginsCount = loginsCount; + return this; + } + + public Builder loginsCount(Integer loginsCount) { + this.loginsCount = Optional.ofNullable(loginsCount); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or is not (false).

+ */ + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public Builder blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + public Builder blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + public UpdateUserResponseContent build() { + return new UpdateUserResponseContent( + userId, + email, + emailVerified, + username, + phoneNumber, + phoneVerified, + createdAt, + updatedAt, + identities, + appMetadata, + userMetadata, + picture, + name, + nickname, + multifactor, + lastIp, + lastLogin, + loginsCount, + blocked, + givenName, + familyName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java new file mode 100644 index 000000000..b89fbb1b7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateVerifiableCredentialTemplateResponseContent.Builder.class) +public final class UpdateVerifiableCredentialTemplateResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional type; + + private final Optional dialect; + + private final Optional presentation; + + private final Optional customCertificateAuthority; + + private final Optional wellKnownTrustedIssuers; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private UpdateVerifiableCredentialTemplateResponseContent( + Optional id, + Optional name, + Optional type, + Optional dialect, + Optional presentation, + Optional customCertificateAuthority, + Optional wellKnownTrustedIssuers, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.customCertificateAuthority = customCertificateAuthority; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the template. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The type of the template. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The dialect of the template. + */ + @JsonProperty("dialect") + public Optional getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public Optional getPresentation() { + return presentation; + } + + /** + * @return The custom certificate authority. + */ + @JsonProperty("custom_certificate_authority") + public Optional getCustomCertificateAuthority() { + return customCertificateAuthority; + } + + /** + * @return The well-known trusted issuers, comma separated. + */ + @JsonProperty("well_known_trusted_issuers") + public Optional getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateVerifiableCredentialTemplateResponseContent + && equalTo((UpdateVerifiableCredentialTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateVerifiableCredentialTemplateResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && customCertificateAuthority.equals(other.customCertificateAuthority) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.type, + this.dialect, + this.presentation, + this.customCertificateAuthority, + this.wellKnownTrustedIssuers, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional dialect = Optional.empty(); + + private Optional presentation = Optional.empty(); + + private Optional customCertificateAuthority = Optional.empty(); + + private Optional wellKnownTrustedIssuers = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateVerifiableCredentialTemplateResponseContent other) { + id(other.getId()); + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + customCertificateAuthority(other.getCustomCertificateAuthority()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the template.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The type of the template.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The dialect of the template.

+ */ + @JsonSetter(value = "dialect", nulls = Nulls.SKIP) + public Builder dialect(Optional dialect) { + this.dialect = dialect; + return this; + } + + public Builder dialect(String dialect) { + this.dialect = Optional.ofNullable(dialect); + return this; + } + + @JsonSetter(value = "presentation", nulls = Nulls.SKIP) + public Builder presentation(Optional presentation) { + this.presentation = presentation; + return this; + } + + public Builder presentation(MdlPresentationRequest presentation) { + this.presentation = Optional.ofNullable(presentation); + return this; + } + + /** + *

The custom certificate authority.

+ */ + @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) + public Builder customCertificateAuthority(Optional customCertificateAuthority) { + this.customCertificateAuthority = customCertificateAuthority; + return this; + } + + public Builder customCertificateAuthority(String customCertificateAuthority) { + this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); + return this; + } + + /** + *

The well-known trusted issuers, comma separated.

+ */ + @JsonSetter(value = "well_known_trusted_issuers", nulls = Nulls.SKIP) + public Builder wellKnownTrustedIssuers(Optional wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + return this; + } + + public Builder wellKnownTrustedIssuers(String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = Optional.ofNullable(wellKnownTrustedIssuers); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public UpdateVerifiableCredentialTemplateResponseContent build() { + return new UpdateVerifiableCredentialTemplateResponseContent( + id, + name, + type, + dialect, + presentation, + customCertificateAuthority, + wellKnownTrustedIssuers, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java new file mode 100644 index 000000000..5ac0e9415 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java @@ -0,0 +1,838 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAuthenticationMethod.Builder.class) +public final class UserAuthenticationMethod { + private final String id; + + private final AuthenticationMethodTypeEnum type; + + private final Optional confirmed; + + private final Optional name; + + private final Optional> authenticationMethods; + + private final Optional preferredAuthenticationMethod; + + private final Optional linkId; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional keyId; + + private final Optional publicKey; + + private final OffsetDateTime createdAt; + + private final Optional enrolledAt; + + private final Optional lastAuthAt; + + private final Optional credentialDeviceType; + + private final Optional credentialBackedUp; + + private final Optional identityUserId; + + private final Optional userAgent; + + private final Map additionalProperties; + + private UserAuthenticationMethod( + String id, + AuthenticationMethodTypeEnum type, + Optional confirmed, + Optional name, + Optional> authenticationMethods, + Optional preferredAuthenticationMethod, + Optional linkId, + Optional phoneNumber, + Optional email, + Optional keyId, + Optional publicKey, + OffsetDateTime createdAt, + Optional enrolledAt, + Optional lastAuthAt, + Optional credentialDeviceType, + Optional credentialBackedUp, + Optional identityUserId, + Optional userAgent, + Map additionalProperties) { + this.id = id; + this.type = type; + this.confirmed = confirmed; + this.name = name; + this.authenticationMethods = authenticationMethods; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.linkId = linkId; + this.phoneNumber = phoneNumber; + this.email = email; + this.keyId = keyId; + this.publicKey = publicKey; + this.createdAt = createdAt; + this.enrolledAt = enrolledAt; + this.lastAuthAt = lastAuthAt; + this.credentialDeviceType = credentialDeviceType; + this.credentialBackedUp = credentialBackedUp; + this.identityUserId = identityUserId; + this.userAgent = userAgent; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the authentication method (auto generated) + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("type") + public AuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return The authentication method status + */ + @JsonProperty("confirmed") + public Optional getConfirmed() { + return confirmed; + } + + /** + * @return A human-readable label to identify the authentication method + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("authentication_methods") + public Optional> getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return The ID of a linked authentication method. Linked authentication methods will be deleted together. + */ + @JsonProperty("link_id") + public Optional getLinkId() { + return linkId; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email and email-verification authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Applies to webauthn authentication methods only. The ID of the generated credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authentication methods only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Authenticator creation date + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Enrollment date + */ + @JsonProperty("enrolled_at") + public Optional getEnrolledAt() { + return enrolledAt; + } + + /** + * @return Last authentication + */ + @JsonProperty("last_auth_at") + public Optional getLastAuthAt() { + return lastAuthAt; + } + + /** + * @return Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user. + */ + @JsonProperty("credential_device_type") + public Optional getCredentialDeviceType() { + return credentialDeviceType; + } + + /** + * @return Applies to passkeys only. Whether the credential was backed up. + */ + @JsonProperty("credential_backed_up") + public Optional getCredentialBackedUp() { + return credentialBackedUp; + } + + /** + * @return Applies to passkeys only. The ID of the user identity linked with the authentication method. + */ + @JsonProperty("identity_user_id") + public Optional getIdentityUserId() { + return identityUserId; + } + + /** + * @return Applies to passkeys only. The user-agent of the browser used to create the passkey. + */ + @JsonProperty("user_agent") + public Optional getUserAgent() { + return userAgent; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAuthenticationMethod && equalTo((UserAuthenticationMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAuthenticationMethod other) { + return id.equals(other.id) + && type.equals(other.type) + && confirmed.equals(other.confirmed) + && name.equals(other.name) + && authenticationMethods.equals(other.authenticationMethods) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && linkId.equals(other.linkId) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && createdAt.equals(other.createdAt) + && enrolledAt.equals(other.enrolledAt) + && lastAuthAt.equals(other.lastAuthAt) + && credentialDeviceType.equals(other.credentialDeviceType) + && credentialBackedUp.equals(other.credentialBackedUp) + && identityUserId.equals(other.identityUserId) + && userAgent.equals(other.userAgent); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.type, + this.confirmed, + this.name, + this.authenticationMethods, + this.preferredAuthenticationMethod, + this.linkId, + this.phoneNumber, + this.email, + this.keyId, + this.publicKey, + this.createdAt, + this.enrolledAt, + this.lastAuthAt, + this.credentialDeviceType, + this.credentialBackedUp, + this.identityUserId, + this.userAgent); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The ID of the authentication method (auto generated)

+ */ + TypeStage id(@NotNull String id); + + Builder from(UserAuthenticationMethod other); + } + + public interface TypeStage { + CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type); + } + + public interface CreatedAtStage { + /** + *

Authenticator creation date

+ */ + _FinalStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface _FinalStage { + UserAuthenticationMethod build(); + + /** + *

The authentication method status

+ */ + _FinalStage confirmed(Optional confirmed); + + _FinalStage confirmed(Boolean confirmed); + + /** + *

A human-readable label to identify the authentication method

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + _FinalStage authenticationMethods(Optional> authenticationMethods); + + _FinalStage authenticationMethods(List authenticationMethods); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ */ + _FinalStage linkId(Optional linkId); + + _FinalStage linkId(String linkId); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Enrollment date

+ */ + _FinalStage enrolledAt(Optional enrolledAt); + + _FinalStage enrolledAt(OffsetDateTime enrolledAt); + + /** + *

Last authentication

+ */ + _FinalStage lastAuthAt(Optional lastAuthAt); + + _FinalStage lastAuthAt(OffsetDateTime lastAuthAt); + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ */ + _FinalStage credentialDeviceType(Optional credentialDeviceType); + + _FinalStage credentialDeviceType(String credentialDeviceType); + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ */ + _FinalStage credentialBackedUp(Optional credentialBackedUp); + + _FinalStage credentialBackedUp(Boolean credentialBackedUp); + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ */ + _FinalStage identityUserId(Optional identityUserId); + + _FinalStage identityUserId(String identityUserId); + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ */ + _FinalStage userAgent(Optional userAgent); + + _FinalStage userAgent(String userAgent); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, TypeStage, CreatedAtStage, _FinalStage { + private String id; + + private AuthenticationMethodTypeEnum type; + + private OffsetDateTime createdAt; + + private Optional userAgent = Optional.empty(); + + private Optional identityUserId = Optional.empty(); + + private Optional credentialBackedUp = Optional.empty(); + + private Optional credentialDeviceType = Optional.empty(); + + private Optional lastAuthAt = Optional.empty(); + + private Optional enrolledAt = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional linkId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional> authenticationMethods = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional confirmed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserAuthenticationMethod other) { + id(other.getId()); + type(other.getType()); + confirmed(other.getConfirmed()); + name(other.getName()); + authenticationMethods(other.getAuthenticationMethods()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + linkId(other.getLinkId()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + createdAt(other.getCreatedAt()); + enrolledAt(other.getEnrolledAt()); + lastAuthAt(other.getLastAuthAt()); + credentialDeviceType(other.getCredentialDeviceType()); + credentialBackedUp(other.getCredentialBackedUp()); + identityUserId(other.getIdentityUserId()); + userAgent(other.getUserAgent()); + return this; + } + + /** + *

The ID of the authentication method (auto generated)

+ *

The ID of the authentication method (auto generated)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public TypeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Authenticator creation date

+ *

Authenticator creation date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userAgent(String userAgent) { + this.userAgent = Optional.ofNullable(userAgent); + return this; + } + + /** + *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

+ */ + @java.lang.Override + @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) + public _FinalStage userAgent(Optional userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage identityUserId(String identityUserId) { + this.identityUserId = Optional.ofNullable(identityUserId); + return this; + } + + /** + *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) + public _FinalStage identityUserId(Optional identityUserId) { + this.identityUserId = identityUserId; + return this; + } + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { + this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); + return this; + } + + /** + *

Applies to passkeys only. Whether the credential was backed up.

+ */ + @java.lang.Override + @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) + public _FinalStage credentialBackedUp(Optional credentialBackedUp) { + this.credentialBackedUp = credentialBackedUp; + return this; + } + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialDeviceType(String credentialDeviceType) { + this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); + return this; + } + + /** + *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

+ */ + @java.lang.Override + @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) + public _FinalStage credentialDeviceType(Optional credentialDeviceType) { + this.credentialDeviceType = credentialDeviceType; + return this; + } + + /** + *

Last authentication

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { + this.lastAuthAt = Optional.ofNullable(lastAuthAt); + return this; + } + + /** + *

Last authentication

+ */ + @java.lang.Override + @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) + public _FinalStage lastAuthAt(Optional lastAuthAt) { + this.lastAuthAt = lastAuthAt; + return this; + } + + /** + *

Enrollment date

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { + this.enrolledAt = Optional.ofNullable(enrolledAt); + return this; + } + + /** + *

Enrollment date

+ */ + @java.lang.Override + @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) + public _FinalStage enrolledAt(Optional enrolledAt) { + this.enrolledAt = enrolledAt; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The ID of the generated credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkId(String linkId) { + this.linkId = Optional.ofNullable(linkId); + return this; + } + + /** + *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

+ */ + @java.lang.Override + @JsonSetter(value = "link_id", nulls = Nulls.SKIP) + public _FinalStage linkId(Optional linkId) { + this.linkId = linkId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + @java.lang.Override + public _FinalStage authenticationMethods(List authenticationMethods) { + this.authenticationMethods = Optional.ofNullable(authenticationMethods); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public _FinalStage authenticationMethods( + Optional> authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + *

A human-readable label to identify the authentication method

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + /** + *

The authentication method status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage confirmed(Boolean confirmed) { + this.confirmed = Optional.ofNullable(confirmed); + return this; + } + + /** + *

The authentication method status

+ */ + @java.lang.Override + @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) + public _FinalStage confirmed(Optional confirmed) { + this.confirmed = confirmed; + return this; + } + + @java.lang.Override + public UserAuthenticationMethod build() { + return new UserAuthenticationMethod( + id, + type, + confirmed, + name, + authenticationMethods, + preferredAuthenticationMethod, + linkId, + phoneNumber, + email, + keyId, + publicKey, + createdAt, + enrolledAt, + lastAuthAt, + credentialDeviceType, + credentialBackedUp, + identityUserId, + userAgent, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java new file mode 100644 index 000000000..9893bebd1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAuthenticationMethodProperties.Builder.class) +public final class UserAuthenticationMethodProperties { + private final Optional type; + + private final Optional id; + + private final Map additionalProperties; + + private UserAuthenticationMethodProperties( + Optional type, + Optional id, + Map additionalProperties) { + this.type = type; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAuthenticationMethodProperties + && equalTo((UserAuthenticationMethodProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAuthenticationMethodProperties other) { + return type.equals(other.type) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAuthenticationMethodProperties other) { + type(other.getType()); + id(other.getId()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(UserAuthenticationMethodPropertiesEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + public UserAuthenticationMethodProperties build() { + return new UserAuthenticationMethodProperties(type, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java new file mode 100644 index 000000000..1ef03fe1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserAuthenticationMethodPropertiesEnum { + public static final UserAuthenticationMethodPropertiesEnum TOTP = + new UserAuthenticationMethodPropertiesEnum(Value.TOTP, "totp"); + + public static final UserAuthenticationMethodPropertiesEnum PUSH = + new UserAuthenticationMethodPropertiesEnum(Value.PUSH, "push"); + + public static final UserAuthenticationMethodPropertiesEnum VOICE = + new UserAuthenticationMethodPropertiesEnum(Value.VOICE, "voice"); + + public static final UserAuthenticationMethodPropertiesEnum SMS = + new UserAuthenticationMethodPropertiesEnum(Value.SMS, "sms"); + + private final Value value; + + private final String string; + + UserAuthenticationMethodPropertiesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserAuthenticationMethodPropertiesEnum + && this.string.equals(((UserAuthenticationMethodPropertiesEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TOTP: + return visitor.visitTotp(); + case PUSH: + return visitor.visitPush(); + case VOICE: + return visitor.visitVoice(); + case SMS: + return visitor.visitSms(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserAuthenticationMethodPropertiesEnum valueOf(String value) { + switch (value) { + case "totp": + return TOTP; + case "push": + return PUSH; + case "voice": + return VOICE; + case "sms": + return SMS; + default: + return new UserAuthenticationMethodPropertiesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + TOTP, + + PUSH, + + SMS, + + VOICE, + + UNKNOWN + } + + public interface Visitor { + T visitTotp(); + + T visitPush(); + + T visitSms(); + + T visitVoice(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java new file mode 100644 index 000000000..1149c8ddd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserBlockIdentifier.Builder.class) +public final class UserBlockIdentifier { + private final Optional identifier; + + private final Optional ip; + + private final Optional connection; + + private final Map additionalProperties; + + private UserBlockIdentifier( + Optional identifier, + Optional ip, + Optional connection, + Map additionalProperties) { + this.identifier = identifier; + this.ip = ip; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Identifier (should be any of an email, username, or phone_number) + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return IP Address + */ + @JsonProperty("ip") + public Optional getIp() { + return ip; + } + + /** + * @return Connection identifier + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserBlockIdentifier && equalTo((UserBlockIdentifier) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserBlockIdentifier other) { + return identifier.equals(other.identifier) && ip.equals(other.ip) && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier, this.ip, this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional identifier = Optional.empty(); + + private Optional ip = Optional.empty(); + + private Optional connection = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserBlockIdentifier other) { + identifier(other.getIdentifier()); + ip(other.getIp()); + connection(other.getConnection()); + return this; + } + + /** + *

Identifier (should be any of an email, username, or phone_number)

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

IP Address

+ */ + @JsonSetter(value = "ip", nulls = Nulls.SKIP) + public Builder ip(Optional ip) { + this.ip = ip; + return this; + } + + public Builder ip(String ip) { + this.ip = Optional.ofNullable(ip); + return this; + } + + /** + *

Connection identifier

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + public UserBlockIdentifier build() { + return new UserBlockIdentifier(identifier, ip, connection, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java new file mode 100644 index 000000000..425e496ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = UserDateSchema.Deserializer.class) +public final class UserDateSchema { + private final Object value; + + private final int type; + + private UserDateSchema(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Map) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserDateSchema && equalTo((UserDateSchema) other); + } + + private boolean equalTo(UserDateSchema other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UserDateSchema of(String value) { + return new UserDateSchema(value, 0); + } + + public static UserDateSchema of(Map value) { + return new UserDateSchema(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Map value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserDateSchema.class); + } + + @java.lang.Override + public UserDateSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java new file mode 100644 index 000000000..75512a03e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserEnrollmentAuthMethodEnum { + public static final UserEnrollmentAuthMethodEnum WEBAUTHN_PLATFORM = + new UserEnrollmentAuthMethodEnum(Value.WEBAUTHN_PLATFORM, "webauthn-platform"); + + public static final UserEnrollmentAuthMethodEnum GUARDIAN = + new UserEnrollmentAuthMethodEnum(Value.GUARDIAN, "guardian"); + + public static final UserEnrollmentAuthMethodEnum AUTHENTICATOR = + new UserEnrollmentAuthMethodEnum(Value.AUTHENTICATOR, "authenticator"); + + public static final UserEnrollmentAuthMethodEnum SMS = new UserEnrollmentAuthMethodEnum(Value.SMS, "sms"); + + public static final UserEnrollmentAuthMethodEnum WEBAUTHN_ROAMING = + new UserEnrollmentAuthMethodEnum(Value.WEBAUTHN_ROAMING, "webauthn-roaming"); + + private final Value value; + + private final String string; + + UserEnrollmentAuthMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserEnrollmentAuthMethodEnum + && this.string.equals(((UserEnrollmentAuthMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case WEBAUTHN_PLATFORM: + return visitor.visitWebauthnPlatform(); + case GUARDIAN: + return visitor.visitGuardian(); + case AUTHENTICATOR: + return visitor.visitAuthenticator(); + case SMS: + return visitor.visitSms(); + case WEBAUTHN_ROAMING: + return visitor.visitWebauthnRoaming(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserEnrollmentAuthMethodEnum valueOf(String value) { + switch (value) { + case "webauthn-platform": + return WEBAUTHN_PLATFORM; + case "guardian": + return GUARDIAN; + case "authenticator": + return AUTHENTICATOR; + case "sms": + return SMS; + case "webauthn-roaming": + return WEBAUTHN_ROAMING; + default: + return new UserEnrollmentAuthMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTHENTICATOR, + + GUARDIAN, + + SMS, + + WEBAUTHN_PLATFORM, + + WEBAUTHN_ROAMING, + + UNKNOWN + } + + public interface Visitor { + T visitAuthenticator(); + + T visitGuardian(); + + T visitSms(); + + T visitWebauthnPlatform(); + + T visitWebauthnRoaming(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java new file mode 100644 index 000000000..a79d4f33e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserEnrollmentStatusEnum { + public static final UserEnrollmentStatusEnum PENDING = new UserEnrollmentStatusEnum(Value.PENDING, "pending"); + + public static final UserEnrollmentStatusEnum CONFIRMED = new UserEnrollmentStatusEnum(Value.CONFIRMED, "confirmed"); + + private final Value value; + + private final String string; + + UserEnrollmentStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserEnrollmentStatusEnum + && this.string.equals(((UserEnrollmentStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case CONFIRMED: + return visitor.visitConfirmed(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserEnrollmentStatusEnum valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + case "confirmed": + return CONFIRMED; + default: + return new UserEnrollmentStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + CONFIRMED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitConfirmed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserGrant.java b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java new file mode 100644 index 000000000..4da8da77d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserGrant.Builder.class) +public final class UserGrant { + private final Optional id; + + private final Optional clientId; + + private final Optional userId; + + private final Optional audience; + + private final Optional> scope; + + private final Map additionalProperties; + + private UserGrant( + Optional id, + Optional clientId, + Optional userId, + Optional audience, + Optional> scope, + Map additionalProperties) { + this.id = id; + this.clientId = clientId; + this.userId = userId; + this.audience = audience; + this.scope = scope; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the grant. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the client. + */ + @JsonProperty("clientID") + public Optional getClientId() { + return clientId; + } + + /** + * @return ID of the user. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Audience of the grant. + */ + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + /** + * @return Scopes included in this grant. + */ + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserGrant && equalTo((UserGrant) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserGrant other) { + return id.equals(other.id) + && clientId.equals(other.clientId) + && userId.equals(other.userId) + && audience.equals(other.audience) + && scope.equals(other.scope); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.clientId, this.userId, this.audience, this.scope); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional audience = Optional.empty(); + + private Optional> scope = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserGrant other) { + id(other.getId()); + clientId(other.getClientId()); + userId(other.getUserId()); + audience(other.getAudience()); + scope(other.getScope()); + return this; + } + + /** + *

ID of the grant.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the client.

+ */ + @JsonSetter(value = "clientID", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

ID of the user.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Audience of the grant.

+ */ + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public Builder audience(Optional audience) { + this.audience = audience; + return this; + } + + public Builder audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + /** + *

Scopes included in this grant.

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + public UserGrant build() { + return new UserGrant(id, clientId, userId, audience, scope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java new file mode 100644 index 000000000..6105461b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UserIdEnum.Deserializer.class) +public final class UserIdEnum { + private final Object value; + + private final int type; + + private UserIdEnum(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((int) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdEnum && equalTo((UserIdEnum) other); + } + + private boolean equalTo(UserIdEnum other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UserIdEnum of(String value) { + return new UserIdEnum(value, 0); + } + + public static UserIdEnum of(int value) { + return new UserIdEnum(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(int value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserIdEnum.class); + } + + @java.lang.Override + public UserIdEnum deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Integer) { + return of((Integer) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java new file mode 100644 index 000000000..f46bdd222 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java @@ -0,0 +1,395 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserIdentity.Builder.class) +public final class UserIdentity { + private final String connection; + + private final UserIdEnum userId; + + private final String provider; + + private final Optional profileData; + + private final Optional isSocial; + + private final Optional accessToken; + + private final Optional accessTokenSecret; + + private final Optional refreshToken; + + private final Map additionalProperties; + + private UserIdentity( + String connection, + UserIdEnum userId, + String provider, + Optional profileData, + Optional isSocial, + Optional accessToken, + Optional accessTokenSecret, + Optional refreshToken, + Map additionalProperties) { + this.connection = connection; + this.userId = userId; + this.provider = provider; + this.profileData = profileData; + this.isSocial = isSocial; + this.accessToken = accessToken; + this.accessTokenSecret = accessTokenSecret; + this.refreshToken = refreshToken; + this.additionalProperties = additionalProperties; + } + + /** + * @return Connection name of this identity. + */ + @JsonProperty("connection") + public String getConnection() { + return connection; + } + + @JsonProperty("user_id") + public UserIdEnum getUserId() { + return userId; + } + + /** + * @return Type of identity provider. + */ + @JsonProperty("provider") + public String getProvider() { + return provider; + } + + @JsonProperty("profileData") + public Optional getProfileData() { + return profileData; + } + + /** + * @return Whether the identity provider is a social provider (true) or not (false). + */ + @JsonProperty("isSocial") + public Optional getIsSocial() { + return isSocial; + } + + /** + * @return IDP access token returned if scope read:user_idp_tokens is defined. + */ + @JsonProperty("access_token") + public Optional getAccessToken() { + return accessToken; + } + + /** + * @return IDP access token secret returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("access_token_secret") + public Optional getAccessTokenSecret() { + return accessTokenSecret; + } + + /** + * @return IDP refresh token returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("refresh_token") + public Optional getRefreshToken() { + return refreshToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentity && equalTo((UserIdentity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentity other) { + return connection.equals(other.connection) + && userId.equals(other.userId) + && provider.equals(other.provider) + && profileData.equals(other.profileData) + && isSocial.equals(other.isSocial) + && accessToken.equals(other.accessToken) + && accessTokenSecret.equals(other.accessTokenSecret) + && refreshToken.equals(other.refreshToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connection, + this.userId, + this.provider, + this.profileData, + this.isSocial, + this.accessToken, + this.accessTokenSecret, + this.refreshToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionStage builder() { + return new Builder(); + } + + public interface ConnectionStage { + /** + *

Connection name of this identity.

+ */ + UserIdStage connection(@NotNull String connection); + + Builder from(UserIdentity other); + } + + public interface UserIdStage { + ProviderStage userId(@NotNull UserIdEnum userId); + } + + public interface ProviderStage { + /** + *

Type of identity provider.

+ */ + _FinalStage provider(@NotNull String provider); + } + + public interface _FinalStage { + UserIdentity build(); + + _FinalStage profileData(Optional profileData); + + _FinalStage profileData(UserProfileData profileData); + + /** + *

Whether the identity provider is a social provider (true) or not (false).

+ */ + _FinalStage isSocial(Optional isSocial); + + _FinalStage isSocial(Boolean isSocial); + + /** + *

IDP access token returned if scope read:user_idp_tokens is defined.

+ */ + _FinalStage accessToken(Optional accessToken); + + _FinalStage accessToken(String accessToken); + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ */ + _FinalStage accessTokenSecret(Optional accessTokenSecret); + + _FinalStage accessTokenSecret(String accessTokenSecret); + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ */ + _FinalStage refreshToken(Optional refreshToken); + + _FinalStage refreshToken(String refreshToken); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionStage, UserIdStage, ProviderStage, _FinalStage { + private String connection; + + private UserIdEnum userId; + + private String provider; + + private Optional refreshToken = Optional.empty(); + + private Optional accessTokenSecret = Optional.empty(); + + private Optional accessToken = Optional.empty(); + + private Optional isSocial = Optional.empty(); + + private Optional profileData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentity other) { + connection(other.getConnection()); + userId(other.getUserId()); + provider(other.getProvider()); + profileData(other.getProfileData()); + isSocial(other.getIsSocial()); + accessToken(other.getAccessToken()); + accessTokenSecret(other.getAccessTokenSecret()); + refreshToken(other.getRefreshToken()); + return this; + } + + /** + *

Connection name of this identity.

+ *

Connection name of this identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection") + public UserIdStage connection(@NotNull String connection) { + this.connection = Objects.requireNonNull(connection, "connection must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("user_id") + public ProviderStage userId(@NotNull UserIdEnum userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + /** + *

Type of identity provider.

+ *

Type of identity provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull String provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage refreshToken(String refreshToken) { + this.refreshToken = Optional.ofNullable(refreshToken); + return this; + } + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ */ + @java.lang.Override + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public _FinalStage refreshToken(Optional refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessTokenSecret(String accessTokenSecret) { + this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); + return this; + } + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ */ + @java.lang.Override + @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) + public _FinalStage accessTokenSecret(Optional accessTokenSecret) { + this.accessTokenSecret = accessTokenSecret; + return this; + } + + /** + *

IDP access token returned if scope read:user_idp_tokens is defined.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessToken(String accessToken) { + this.accessToken = Optional.ofNullable(accessToken); + return this; + } + + /** + *

IDP access token returned if scope read:user_idp_tokens is defined.

+ */ + @java.lang.Override + @JsonSetter(value = "access_token", nulls = Nulls.SKIP) + public _FinalStage accessToken(Optional accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + *

Whether the identity provider is a social provider (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSocial(Boolean isSocial) { + this.isSocial = Optional.ofNullable(isSocial); + return this; + } + + /** + *

Whether the identity provider is a social provider (true) or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) + public _FinalStage isSocial(Optional isSocial) { + this.isSocial = isSocial; + return this; + } + + @java.lang.Override + public _FinalStage profileData(UserProfileData profileData) { + this.profileData = Optional.ofNullable(profileData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "profileData", nulls = Nulls.SKIP) + public _FinalStage profileData(Optional profileData) { + this.profileData = profileData; + return this; + } + + @java.lang.Override + public UserIdentity build() { + return new UserIdentity( + connection, + userId, + provider, + profileData, + isSocial, + accessToken, + accessTokenSecret, + refreshToken, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java new file mode 100644 index 000000000..79e3e233f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java @@ -0,0 +1,699 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserIdentityProviderEnum { + public static final UserIdentityProviderEnum SHOP = new UserIdentityProviderEnum(Value.SHOP, "shop"); + + public static final UserIdentityProviderEnum AUTH0OIDC = + new UserIdentityProviderEnum(Value.AUTH0OIDC, "auth0-oidc"); + + public static final UserIdentityProviderEnum DWOLLA = new UserIdentityProviderEnum(Value.DWOLLA, "dwolla"); + + public static final UserIdentityProviderEnum FLICKR = new UserIdentityProviderEnum(Value.FLICKR, "flickr"); + + public static final UserIdentityProviderEnum OKTA = new UserIdentityProviderEnum(Value.OKTA, "okta"); + + public static final UserIdentityProviderEnum PLANNINGCENTER = + new UserIdentityProviderEnum(Value.PLANNINGCENTER, "planningcenter"); + + public static final UserIdentityProviderEnum GOOGLE_OAUTH2 = + new UserIdentityProviderEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); + + public static final UserIdentityProviderEnum AUTH0 = new UserIdentityProviderEnum(Value.AUTH0, "auth0"); + + public static final UserIdentityProviderEnum EXACT = new UserIdentityProviderEnum(Value.EXACT, "exact"); + + public static final UserIdentityProviderEnum WORDPRESS = new UserIdentityProviderEnum(Value.WORDPRESS, "wordpress"); + + public static final UserIdentityProviderEnum FITBIT = new UserIdentityProviderEnum(Value.FITBIT, "fitbit"); + + public static final UserIdentityProviderEnum EVERNOTE = new UserIdentityProviderEnum(Value.EVERNOTE, "evernote"); + + public static final UserIdentityProviderEnum SHAREPOINT = + new UserIdentityProviderEnum(Value.SHAREPOINT, "sharepoint"); + + public static final UserIdentityProviderEnum SHOPIFY = new UserIdentityProviderEnum(Value.SHOPIFY, "shopify"); + + public static final UserIdentityProviderEnum SALESFORCE_SANDBOX = + new UserIdentityProviderEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); + + public static final UserIdentityProviderEnum MIICARD = new UserIdentityProviderEnum(Value.MIICARD, "miicard"); + + public static final UserIdentityProviderEnum FACEBOOK = new UserIdentityProviderEnum(Value.FACEBOOK, "facebook"); + + public static final UserIdentityProviderEnum OAUTH1 = new UserIdentityProviderEnum(Value.OAUTH1, "oauth1"); + + public static final UserIdentityProviderEnum APPLE = new UserIdentityProviderEnum(Value.APPLE, "apple"); + + public static final UserIdentityProviderEnum UNTAPPD = new UserIdentityProviderEnum(Value.UNTAPPD, "untappd"); + + public static final UserIdentityProviderEnum AMAZON = new UserIdentityProviderEnum(Value.AMAZON, "amazon"); + + public static final UserIdentityProviderEnum LINE = new UserIdentityProviderEnum(Value.LINE, "line"); + + public static final UserIdentityProviderEnum BITBUCKET = new UserIdentityProviderEnum(Value.BITBUCKET, "bitbucket"); + + public static final UserIdentityProviderEnum GITHUB = new UserIdentityProviderEnum(Value.GITHUB, "github"); + + public static final UserIdentityProviderEnum SALESFORCE = + new UserIdentityProviderEnum(Value.SALESFORCE, "salesforce"); + + public static final UserIdentityProviderEnum OFFICE365 = new UserIdentityProviderEnum(Value.OFFICE365, "office365"); + + public static final UserIdentityProviderEnum SMS = new UserIdentityProviderEnum(Value.SMS, "sms"); + + public static final UserIdentityProviderEnum AOL = new UserIdentityProviderEnum(Value.AOL, "aol"); + + public static final UserIdentityProviderEnum TWITTER = new UserIdentityProviderEnum(Value.TWITTER, "twitter"); + + public static final UserIdentityProviderEnum WINDOWSLIVE = + new UserIdentityProviderEnum(Value.WINDOWSLIVE, "windowslive"); + + public static final UserIdentityProviderEnum YANDEX = new UserIdentityProviderEnum(Value.YANDEX, "yandex"); + + public static final UserIdentityProviderEnum AD = new UserIdentityProviderEnum(Value.AD, "ad"); + + public static final UserIdentityProviderEnum BAIDU = new UserIdentityProviderEnum(Value.BAIDU, "baidu"); + + public static final UserIdentityProviderEnum BITLY = new UserIdentityProviderEnum(Value.BITLY, "bitly"); + + public static final UserIdentityProviderEnum PAYPAL_SANDBOX = + new UserIdentityProviderEnum(Value.PAYPAL_SANDBOX, "paypal-sandbox"); + + public static final UserIdentityProviderEnum RENREN = new UserIdentityProviderEnum(Value.RENREN, "renren"); + + public static final UserIdentityProviderEnum SAMLP = new UserIdentityProviderEnum(Value.SAMLP, "samlp"); + + public static final UserIdentityProviderEnum DROPBOX = new UserIdentityProviderEnum(Value.DROPBOX, "dropbox"); + + public static final UserIdentityProviderEnum VKONTAKTE = new UserIdentityProviderEnum(Value.VKONTAKTE, "vkontakte"); + + public static final UserIdentityProviderEnum PINGFEDERATE = + new UserIdentityProviderEnum(Value.PINGFEDERATE, "pingfederate"); + + public static final UserIdentityProviderEnum INSTAGRAM = new UserIdentityProviderEnum(Value.INSTAGRAM, "instagram"); + + public static final UserIdentityProviderEnum THIRTYSEVENSIGNALS = + new UserIdentityProviderEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); + + public static final UserIdentityProviderEnum WAAD = new UserIdentityProviderEnum(Value.WAAD, "waad"); + + public static final UserIdentityProviderEnum THECITY_SANDBOX = + new UserIdentityProviderEnum(Value.THECITY_SANDBOX, "thecity-sandbox"); + + public static final UserIdentityProviderEnum OIDC = new UserIdentityProviderEnum(Value.OIDC, "oidc"); + + public static final UserIdentityProviderEnum YAMMER = new UserIdentityProviderEnum(Value.YAMMER, "yammer"); + + public static final UserIdentityProviderEnum EVERNOTE_SANDBOX = + new UserIdentityProviderEnum(Value.EVERNOTE_SANDBOX, "evernote-sandbox"); + + public static final UserIdentityProviderEnum SALESFORCE_COMMUNITY = + new UserIdentityProviderEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); + + public static final UserIdentityProviderEnum DACCOUNT = new UserIdentityProviderEnum(Value.DACCOUNT, "daccount"); + + public static final UserIdentityProviderEnum SOUNDCLOUD = + new UserIdentityProviderEnum(Value.SOUNDCLOUD, "soundcloud"); + + public static final UserIdentityProviderEnum OAUTH2 = new UserIdentityProviderEnum(Value.OAUTH2, "oauth2"); + + public static final UserIdentityProviderEnum BOX = new UserIdentityProviderEnum(Value.BOX, "box"); + + public static final UserIdentityProviderEnum IP = new UserIdentityProviderEnum(Value.IP, "ip"); + + public static final UserIdentityProviderEnum ADFS = new UserIdentityProviderEnum(Value.ADFS, "adfs"); + + public static final UserIdentityProviderEnum EMAIL = new UserIdentityProviderEnum(Value.EMAIL, "email"); + + public static final UserIdentityProviderEnum CUSTOM = new UserIdentityProviderEnum(Value.CUSTOM, "custom"); + + public static final UserIdentityProviderEnum YAHOO = new UserIdentityProviderEnum(Value.YAHOO, "yahoo"); + + public static final UserIdentityProviderEnum WEIBO = new UserIdentityProviderEnum(Value.WEIBO, "weibo"); + + public static final UserIdentityProviderEnum GOOGLE_APPS = + new UserIdentityProviderEnum(Value.GOOGLE_APPS, "google-apps"); + + public static final UserIdentityProviderEnum PAYPAL = new UserIdentityProviderEnum(Value.PAYPAL, "paypal"); + + public static final UserIdentityProviderEnum LINKEDIN = new UserIdentityProviderEnum(Value.LINKEDIN, "linkedin"); + + public static final UserIdentityProviderEnum THECITY = new UserIdentityProviderEnum(Value.THECITY, "thecity"); + + private final Value value; + + private final String string; + + UserIdentityProviderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserIdentityProviderEnum + && this.string.equals(((UserIdentityProviderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHOP: + return visitor.visitShop(); + case AUTH0OIDC: + return visitor.visitAuth0Oidc(); + case DWOLLA: + return visitor.visitDwolla(); + case FLICKR: + return visitor.visitFlickr(); + case OKTA: + return visitor.visitOkta(); + case PLANNINGCENTER: + return visitor.visitPlanningcenter(); + case GOOGLE_OAUTH2: + return visitor.visitGoogleOauth2(); + case AUTH0: + return visitor.visitAuth0(); + case EXACT: + return visitor.visitExact(); + case WORDPRESS: + return visitor.visitWordpress(); + case FITBIT: + return visitor.visitFitbit(); + case EVERNOTE: + return visitor.visitEvernote(); + case SHAREPOINT: + return visitor.visitSharepoint(); + case SHOPIFY: + return visitor.visitShopify(); + case SALESFORCE_SANDBOX: + return visitor.visitSalesforceSandbox(); + case MIICARD: + return visitor.visitMiicard(); + case FACEBOOK: + return visitor.visitFacebook(); + case OAUTH1: + return visitor.visitOauth1(); + case APPLE: + return visitor.visitApple(); + case UNTAPPD: + return visitor.visitUntappd(); + case AMAZON: + return visitor.visitAmazon(); + case LINE: + return visitor.visitLine(); + case BITBUCKET: + return visitor.visitBitbucket(); + case GITHUB: + return visitor.visitGithub(); + case SALESFORCE: + return visitor.visitSalesforce(); + case OFFICE365: + return visitor.visitOffice365(); + case SMS: + return visitor.visitSms(); + case AOL: + return visitor.visitAol(); + case TWITTER: + return visitor.visitTwitter(); + case WINDOWSLIVE: + return visitor.visitWindowslive(); + case YANDEX: + return visitor.visitYandex(); + case AD: + return visitor.visitAd(); + case BAIDU: + return visitor.visitBaidu(); + case BITLY: + return visitor.visitBitly(); + case PAYPAL_SANDBOX: + return visitor.visitPaypalSandbox(); + case RENREN: + return visitor.visitRenren(); + case SAMLP: + return visitor.visitSamlp(); + case DROPBOX: + return visitor.visitDropbox(); + case VKONTAKTE: + return visitor.visitVkontakte(); + case PINGFEDERATE: + return visitor.visitPingfederate(); + case INSTAGRAM: + return visitor.visitInstagram(); + case THIRTYSEVENSIGNALS: + return visitor.visitThirtysevensignals(); + case WAAD: + return visitor.visitWaad(); + case THECITY_SANDBOX: + return visitor.visitThecitySandbox(); + case OIDC: + return visitor.visitOidc(); + case YAMMER: + return visitor.visitYammer(); + case EVERNOTE_SANDBOX: + return visitor.visitEvernoteSandbox(); + case SALESFORCE_COMMUNITY: + return visitor.visitSalesforceCommunity(); + case DACCOUNT: + return visitor.visitDaccount(); + case SOUNDCLOUD: + return visitor.visitSoundcloud(); + case OAUTH2: + return visitor.visitOauth2(); + case BOX: + return visitor.visitBox(); + case IP: + return visitor.visitIp(); + case ADFS: + return visitor.visitAdfs(); + case EMAIL: + return visitor.visitEmail(); + case CUSTOM: + return visitor.visitCustom(); + case YAHOO: + return visitor.visitYahoo(); + case WEIBO: + return visitor.visitWeibo(); + case GOOGLE_APPS: + return visitor.visitGoogleApps(); + case PAYPAL: + return visitor.visitPaypal(); + case LINKEDIN: + return visitor.visitLinkedin(); + case THECITY: + return visitor.visitThecity(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserIdentityProviderEnum valueOf(String value) { + switch (value) { + case "shop": + return SHOP; + case "auth0-oidc": + return AUTH0OIDC; + case "dwolla": + return DWOLLA; + case "flickr": + return FLICKR; + case "okta": + return OKTA; + case "planningcenter": + return PLANNINGCENTER; + case "google-oauth2": + return GOOGLE_OAUTH2; + case "auth0": + return AUTH0; + case "exact": + return EXACT; + case "wordpress": + return WORDPRESS; + case "fitbit": + return FITBIT; + case "evernote": + return EVERNOTE; + case "sharepoint": + return SHAREPOINT; + case "shopify": + return SHOPIFY; + case "salesforce-sandbox": + return SALESFORCE_SANDBOX; + case "miicard": + return MIICARD; + case "facebook": + return FACEBOOK; + case "oauth1": + return OAUTH1; + case "apple": + return APPLE; + case "untappd": + return UNTAPPD; + case "amazon": + return AMAZON; + case "line": + return LINE; + case "bitbucket": + return BITBUCKET; + case "github": + return GITHUB; + case "salesforce": + return SALESFORCE; + case "office365": + return OFFICE365; + case "sms": + return SMS; + case "aol": + return AOL; + case "twitter": + return TWITTER; + case "windowslive": + return WINDOWSLIVE; + case "yandex": + return YANDEX; + case "ad": + return AD; + case "baidu": + return BAIDU; + case "bitly": + return BITLY; + case "paypal-sandbox": + return PAYPAL_SANDBOX; + case "renren": + return RENREN; + case "samlp": + return SAMLP; + case "dropbox": + return DROPBOX; + case "vkontakte": + return VKONTAKTE; + case "pingfederate": + return PINGFEDERATE; + case "instagram": + return INSTAGRAM; + case "thirtysevensignals": + return THIRTYSEVENSIGNALS; + case "waad": + return WAAD; + case "thecity-sandbox": + return THECITY_SANDBOX; + case "oidc": + return OIDC; + case "yammer": + return YAMMER; + case "evernote-sandbox": + return EVERNOTE_SANDBOX; + case "salesforce-community": + return SALESFORCE_COMMUNITY; + case "daccount": + return DACCOUNT; + case "soundcloud": + return SOUNDCLOUD; + case "oauth2": + return OAUTH2; + case "box": + return BOX; + case "ip": + return IP; + case "adfs": + return ADFS; + case "email": + return EMAIL; + case "custom": + return CUSTOM; + case "yahoo": + return YAHOO; + case "weibo": + return WEIBO; + case "google-apps": + return GOOGLE_APPS; + case "paypal": + return PAYPAL; + case "linkedin": + return LINKEDIN; + case "thecity": + return THECITY; + default: + return new UserIdentityProviderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AD, + + ADFS, + + AMAZON, + + APPLE, + + DROPBOX, + + BITBUCKET, + + AOL, + + AUTH0OIDC, + + AUTH0, + + BAIDU, + + BITLY, + + BOX, + + CUSTOM, + + DACCOUNT, + + DWOLLA, + + EMAIL, + + EVERNOTE_SANDBOX, + + EVERNOTE, + + EXACT, + + FACEBOOK, + + FITBIT, + + FLICKR, + + GITHUB, + + GOOGLE_APPS, + + GOOGLE_OAUTH2, + + INSTAGRAM, + + IP, + + LINE, + + LINKEDIN, + + MIICARD, + + OAUTH1, + + OAUTH2, + + OFFICE365, + + OIDC, + + OKTA, + + PAYPAL, + + PAYPAL_SANDBOX, + + PINGFEDERATE, + + PLANNINGCENTER, + + RENREN, + + SALESFORCE_COMMUNITY, + + SALESFORCE_SANDBOX, + + SALESFORCE, + + SAMLP, + + SHAREPOINT, + + SHOPIFY, + + SHOP, + + SMS, + + SOUNDCLOUD, + + THECITY_SANDBOX, + + THECITY, + + THIRTYSEVENSIGNALS, + + TWITTER, + + UNTAPPD, + + VKONTAKTE, + + WAAD, + + WEIBO, + + WINDOWSLIVE, + + WORDPRESS, + + YAHOO, + + YAMMER, + + YANDEX, + + UNKNOWN + } + + public interface Visitor { + T visitAd(); + + T visitAdfs(); + + T visitAmazon(); + + T visitApple(); + + T visitDropbox(); + + T visitBitbucket(); + + T visitAol(); + + T visitAuth0Oidc(); + + T visitAuth0(); + + T visitBaidu(); + + T visitBitly(); + + T visitBox(); + + T visitCustom(); + + T visitDaccount(); + + T visitDwolla(); + + T visitEmail(); + + T visitEvernoteSandbox(); + + T visitEvernote(); + + T visitExact(); + + T visitFacebook(); + + T visitFitbit(); + + T visitFlickr(); + + T visitGithub(); + + T visitGoogleApps(); + + T visitGoogleOauth2(); + + T visitInstagram(); + + T visitIp(); + + T visitLine(); + + T visitLinkedin(); + + T visitMiicard(); + + T visitOauth1(); + + T visitOauth2(); + + T visitOffice365(); + + T visitOidc(); + + T visitOkta(); + + T visitPaypal(); + + T visitPaypalSandbox(); + + T visitPingfederate(); + + T visitPlanningcenter(); + + T visitRenren(); + + T visitSalesforceCommunity(); + + T visitSalesforceSandbox(); + + T visitSalesforce(); + + T visitSamlp(); + + T visitSharepoint(); + + T visitShopify(); + + T visitShop(); + + T visitSms(); + + T visitSoundcloud(); + + T visitThecitySandbox(); + + T visitThecity(); + + T visitThirtysevensignals(); + + T visitTwitter(); + + T visitUntappd(); + + T visitVkontakte(); + + T visitWaad(); + + T visitWeibo(); + + T visitWindowslive(); + + T visitWordpress(); + + T visitYahoo(); + + T visitYammer(); + + T visitYandex(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java new file mode 100644 index 000000000..794f19544 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java @@ -0,0 +1,318 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserIdentitySchema.Builder.class) +public final class UserIdentitySchema { + private final Optional connection; + + private final Optional userId; + + private final Optional provider; + + private final Optional isSocial; + + private final Optional accessToken; + + private final Optional accessTokenSecret; + + private final Optional refreshToken; + + private final Optional profileData; + + private final Map additionalProperties; + + private UserIdentitySchema( + Optional connection, + Optional userId, + Optional provider, + Optional isSocial, + Optional accessToken, + Optional accessTokenSecret, + Optional refreshToken, + Optional profileData, + Map additionalProperties) { + this.connection = connection; + this.userId = userId; + this.provider = provider; + this.isSocial = isSocial; + this.accessToken = accessToken; + this.accessTokenSecret = accessTokenSecret; + this.refreshToken = refreshToken; + this.profileData = profileData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection containing this identity. + */ + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + /** + * @return Unique identifier of the user user for this identity. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + /** + * @return Whether this identity is from a social provider (true) or not (false). + */ + @JsonProperty("isSocial") + public Optional getIsSocial() { + return isSocial; + } + + /** + * @return IDP access token returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("access_token") + public Optional getAccessToken() { + return accessToken; + } + + /** + * @return IDP access token secret returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("access_token_secret") + public Optional getAccessTokenSecret() { + return accessTokenSecret; + } + + /** + * @return IDP refresh token returned only if scope read:user_idp_tokens is defined. + */ + @JsonProperty("refresh_token") + public Optional getRefreshToken() { + return refreshToken; + } + + @JsonProperty("profileData") + public Optional getProfileData() { + return profileData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitySchema && equalTo((UserIdentitySchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitySchema other) { + return connection.equals(other.connection) + && userId.equals(other.userId) + && provider.equals(other.provider) + && isSocial.equals(other.isSocial) + && accessToken.equals(other.accessToken) + && accessTokenSecret.equals(other.accessTokenSecret) + && refreshToken.equals(other.refreshToken) + && profileData.equals(other.profileData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.connection, + this.userId, + this.provider, + this.isSocial, + this.accessToken, + this.accessTokenSecret, + this.refreshToken, + this.profileData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional connection = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional provider = Optional.empty(); + + private Optional isSocial = Optional.empty(); + + private Optional accessToken = Optional.empty(); + + private Optional accessTokenSecret = Optional.empty(); + + private Optional refreshToken = Optional.empty(); + + private Optional profileData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserIdentitySchema other) { + connection(other.getConnection()); + userId(other.getUserId()); + provider(other.getProvider()); + isSocial(other.getIsSocial()); + accessToken(other.getAccessToken()); + accessTokenSecret(other.getAccessTokenSecret()); + refreshToken(other.getRefreshToken()); + profileData(other.getProfileData()); + return this; + } + + /** + *

Name of the connection containing this identity.

+ */ + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public Builder connection(Optional connection) { + this.connection = connection; + return this; + } + + public Builder connection(String connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + *

Unique identifier of the user user for this identity.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(UserIdentityProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + /** + *

Whether this identity is from a social provider (true) or not (false).

+ */ + @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) + public Builder isSocial(Optional isSocial) { + this.isSocial = isSocial; + return this; + } + + public Builder isSocial(Boolean isSocial) { + this.isSocial = Optional.ofNullable(isSocial); + return this; + } + + /** + *

IDP access token returned only if scope read:user_idp_tokens is defined.

+ */ + @JsonSetter(value = "access_token", nulls = Nulls.SKIP) + public Builder accessToken(Optional accessToken) { + this.accessToken = accessToken; + return this; + } + + public Builder accessToken(String accessToken) { + this.accessToken = Optional.ofNullable(accessToken); + return this; + } + + /** + *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

+ */ + @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) + public Builder accessTokenSecret(Optional accessTokenSecret) { + this.accessTokenSecret = accessTokenSecret; + return this; + } + + public Builder accessTokenSecret(String accessTokenSecret) { + this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); + return this; + } + + /** + *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

+ */ + @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) + public Builder refreshToken(Optional refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public Builder refreshToken(String refreshToken) { + this.refreshToken = Optional.ofNullable(refreshToken); + return this; + } + + @JsonSetter(value = "profileData", nulls = Nulls.SKIP) + public Builder profileData(Optional profileData) { + this.profileData = profileData; + return this; + } + + public Builder profileData(UserProfileData profileData) { + this.profileData = Optional.ofNullable(profileData); + return this; + } + + public UserIdentitySchema build() { + return new UserIdentitySchema( + connection, + userId, + provider, + isSocial, + accessToken, + accessTokenSecret, + refreshToken, + profileData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..6cc6f997c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserListLogOffsetPaginatedResponseContent.Builder.class) +public final class UserListLogOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional length; + + private final Optional total; + + private final Optional> logs; + + private final Map additionalProperties; + + private UserListLogOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional length, + Optional total, + Optional> logs, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.length = length; + this.total = total; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("length") + public Optional getLength() { + return length; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserListLogOffsetPaginatedResponseContent + && equalTo((UserListLogOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserListLogOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && length.equals(other.length) + && total.equals(other.total) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional length = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> logs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserListLogOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + length(other.getLength()); + total(other.getTotal()); + logs(other.getLogs()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "length", nulls = Nulls.SKIP) + public Builder length(Optional length) { + this.length = length; + return this; + } + + public Builder length(Double length) { + this.length = Optional.ofNullable(length); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public Builder logs(Optional> logs) { + this.logs = logs; + return this; + } + + public Builder logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + public UserListLogOffsetPaginatedResponseContent build() { + return new UserListLogOffsetPaginatedResponseContent( + start, limit, length, total, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java new file mode 100644 index 000000000..678d1a9c6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserMultifactorProviderEnum { + public static final UserMultifactorProviderEnum DUO = new UserMultifactorProviderEnum(Value.DUO, "duo"); + + public static final UserMultifactorProviderEnum GOOGLE_AUTHENTICATOR = + new UserMultifactorProviderEnum(Value.GOOGLE_AUTHENTICATOR, "google-authenticator"); + + private final Value value; + + private final String string; + + UserMultifactorProviderEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserMultifactorProviderEnum + && this.string.equals(((UserMultifactorProviderEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DUO: + return visitor.visitDuo(); + case GOOGLE_AUTHENTICATOR: + return visitor.visitGoogleAuthenticator(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserMultifactorProviderEnum valueOf(String value) { + switch (value) { + case "duo": + return DUO; + case "google-authenticator": + return GOOGLE_AUTHENTICATOR; + default: + return new UserMultifactorProviderEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DUO, + + GOOGLE_AUTHENTICATOR, + + UNKNOWN + } + + public interface Visitor { + T visitDuo(); + + T visitGoogleAuthenticator(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java new file mode 100644 index 000000000..0bd26cc73 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserPermissionSchema.Builder.class) +public final class UserPermissionSchema { + private final Optional resourceServerIdentifier; + + private final Optional permissionName; + + private final Optional resourceServerName; + + private final Optional description; + + private final Map additionalProperties; + + private UserPermissionSchema( + Optional resourceServerIdentifier, + Optional permissionName, + Optional resourceServerName, + Optional description, + Map additionalProperties) { + this.resourceServerIdentifier = resourceServerIdentifier; + this.permissionName = permissionName; + this.resourceServerName = resourceServerName; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return Resource server (API) identifier that this permission is for. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + /** + * @return Name of this permission. + */ + @JsonProperty("permission_name") + public Optional getPermissionName() { + return permissionName; + } + + /** + * @return Resource server (API) name this permission is for. + */ + @JsonProperty("resource_server_name") + public Optional getResourceServerName() { + return resourceServerName; + } + + /** + * @return Description of this permission. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserPermissionSchema && equalTo((UserPermissionSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserPermissionSchema other) { + return resourceServerIdentifier.equals(other.resourceServerIdentifier) + && permissionName.equals(other.permissionName) + && resourceServerName.equals(other.resourceServerName) + && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional permissionName = Optional.empty(); + + private Optional resourceServerName = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserPermissionSchema other) { + resourceServerIdentifier(other.getResourceServerIdentifier()); + permissionName(other.getPermissionName()); + resourceServerName(other.getResourceServerName()); + description(other.getDescription()); + return this; + } + + /** + *

Resource server (API) identifier that this permission is for.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + /** + *

Name of this permission.

+ */ + @JsonSetter(value = "permission_name", nulls = Nulls.SKIP) + public Builder permissionName(Optional permissionName) { + this.permissionName = permissionName; + return this; + } + + public Builder permissionName(String permissionName) { + this.permissionName = Optional.ofNullable(permissionName); + return this; + } + + /** + *

Resource server (API) name this permission is for.

+ */ + @JsonSetter(value = "resource_server_name", nulls = Nulls.SKIP) + public Builder resourceServerName(Optional resourceServerName) { + this.resourceServerName = resourceServerName; + return this; + } + + public Builder resourceServerName(String resourceServerName) { + this.resourceServerName = Optional.ofNullable(resourceServerName); + return this; + } + + /** + *

Description of this permission.

+ */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + public UserPermissionSchema build() { + return new UserPermissionSchema( + resourceServerIdentifier, permissionName, resourceServerName, description, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java new file mode 100644 index 000000000..e76d8a547 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java @@ -0,0 +1,330 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserProfileData.Builder.class) +public final class UserProfileData { + private final Optional email; + + private final Optional emailVerified; + + private final Optional name; + + private final Optional username; + + private final Optional givenName; + + private final Optional phoneNumber; + + private final Optional phoneVerified; + + private final Optional familyName; + + private final Map additionalProperties; + + private UserProfileData( + Optional email, + Optional emailVerified, + Optional name, + Optional username, + Optional givenName, + Optional phoneNumber, + Optional phoneVerified, + Optional familyName, + Map additionalProperties) { + this.email = email; + this.emailVerified = emailVerified; + this.name = name; + this.username = username; + this.givenName = givenName; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.familyName = familyName; + this.additionalProperties = additionalProperties; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Username of this user. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Phone number for this user. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Whether this phone number is verified (true) or unverified (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserProfileData && equalTo((UserProfileData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserProfileData other) { + return email.equals(other.email) + && emailVerified.equals(other.emailVerified) + && name.equals(other.name) + && username.equals(other.username) + && givenName.equals(other.givenName) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && familyName.equals(other.familyName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.email, + this.emailVerified, + this.name, + this.username, + this.givenName, + this.phoneNumber, + this.phoneVerified, + this.familyName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional email = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional familyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserProfileData other) { + email(other.getEmail()); + emailVerified(other.getEmailVerified()); + name(other.getName()); + username(other.getUsername()); + givenName(other.getGivenName()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + familyName(other.getFamilyName()); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Username of this user.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Phone number for this user.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Whether this phone number is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + public UserProfileData build() { + return new UserProfileData( + email, + emailVerified, + name, + username, + givenName, + phoneNumber, + phoneVerified, + familyName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java new file mode 100644 index 000000000..e177e50d5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java @@ -0,0 +1,717 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserResponseSchema.Builder.class) +public final class UserResponseSchema { + private final Optional userId; + + private final Optional email; + + private final Optional emailVerified; + + private final Optional username; + + private final Optional phoneNumber; + + private final Optional phoneVerified; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional> identities; + + private final Optional> appMetadata; + + private final Optional> userMetadata; + + private final Optional picture; + + private final Optional name; + + private final Optional nickname; + + private final Optional> multifactor; + + private final Optional lastIp; + + private final Optional lastLogin; + + private final Optional loginsCount; + + private final Optional blocked; + + private final Optional givenName; + + private final Optional familyName; + + private final Map additionalProperties; + + private UserResponseSchema( + Optional userId, + Optional email, + Optional emailVerified, + Optional username, + Optional phoneNumber, + Optional phoneVerified, + Optional createdAt, + Optional updatedAt, + Optional> identities, + Optional> appMetadata, + Optional> userMetadata, + Optional picture, + Optional name, + Optional nickname, + Optional> multifactor, + Optional lastIp, + Optional lastLogin, + Optional loginsCount, + Optional blocked, + Optional givenName, + Optional familyName, + Map additionalProperties) { + this.userId = userId; + this.email = email; + this.emailVerified = emailVerified; + this.username = username; + this.phoneNumber = phoneNumber; + this.phoneVerified = phoneVerified; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.identities = identities; + this.appMetadata = appMetadata; + this.userMetadata = userMetadata; + this.picture = picture; + this.name = name; + this.nickname = nickname; + this.multifactor = multifactor; + this.lastIp = lastIp; + this.lastLogin = lastLogin; + this.loginsCount = loginsCount; + this.blocked = blocked; + this.givenName = givenName; + this.familyName = familyName; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return Email address of this user. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether this email address is verified (true) or unverified (false). + */ + @JsonProperty("email_verified") + public Optional getEmailVerified() { + return emailVerified; + } + + /** + * @return Username of this user. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Whether this phone number has been verified (true) or not (false). + */ + @JsonProperty("phone_verified") + public Optional getPhoneVerified() { + return phoneVerified; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Array of user identity objects when accounts are linked. + */ + @JsonProperty("identities") + public Optional> getIdentities() { + return identities; + } + + @JsonProperty("app_metadata") + public Optional> getAppMetadata() { + return appMetadata; + } + + @JsonProperty("user_metadata") + public Optional> getUserMetadata() { + return userMetadata; + } + + /** + * @return URL to picture, photo, or avatar of this user. + */ + @JsonProperty("picture") + public Optional getPicture() { + return picture; + } + + /** + * @return Name of this user. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Preferred nickname or alias of this user. + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return List of multi-factor authentication providers with which this user has enrolled. + */ + @JsonProperty("multifactor") + public Optional> getMultifactor() { + return multifactor; + } + + /** + * @return Last IP address from which this user logged in. + */ + @JsonProperty("last_ip") + public Optional getLastIp() { + return lastIp; + } + + @JsonProperty("last_login") + public Optional getLastLogin() { + return lastLogin; + } + + /** + * @return Total number of logins this user has performed. + */ + @JsonProperty("logins_count") + public Optional getLoginsCount() { + return loginsCount; + } + + /** + * @return Whether this user was blocked by an administrator (true) or is not (false). + */ + @JsonProperty("blocked") + public Optional getBlocked() { + return blocked; + } + + /** + * @return Given name/first name/forename of this user. + */ + @JsonProperty("given_name") + public Optional getGivenName() { + return givenName; + } + + /** + * @return Family name/last name/surname of this user. + */ + @JsonProperty("family_name") + public Optional getFamilyName() { + return familyName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserResponseSchema && equalTo((UserResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserResponseSchema other) { + return userId.equals(other.userId) + && email.equals(other.email) + && emailVerified.equals(other.emailVerified) + && username.equals(other.username) + && phoneNumber.equals(other.phoneNumber) + && phoneVerified.equals(other.phoneVerified) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && identities.equals(other.identities) + && appMetadata.equals(other.appMetadata) + && userMetadata.equals(other.userMetadata) + && picture.equals(other.picture) + && name.equals(other.name) + && nickname.equals(other.nickname) + && multifactor.equals(other.multifactor) + && lastIp.equals(other.lastIp) + && lastLogin.equals(other.lastLogin) + && loginsCount.equals(other.loginsCount) + && blocked.equals(other.blocked) + && givenName.equals(other.givenName) + && familyName.equals(other.familyName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userId, + this.email, + this.emailVerified, + this.username, + this.phoneNumber, + this.phoneVerified, + this.createdAt, + this.updatedAt, + this.identities, + this.appMetadata, + this.userMetadata, + this.picture, + this.name, + this.nickname, + this.multifactor, + this.lastIp, + this.lastLogin, + this.loginsCount, + this.blocked, + this.givenName, + this.familyName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userId = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional emailVerified = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneVerified = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional> identities = Optional.empty(); + + private Optional> appMetadata = Optional.empty(); + + private Optional> userMetadata = Optional.empty(); + + private Optional picture = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional nickname = Optional.empty(); + + private Optional> multifactor = Optional.empty(); + + private Optional lastIp = Optional.empty(); + + private Optional lastLogin = Optional.empty(); + + private Optional loginsCount = Optional.empty(); + + private Optional blocked = Optional.empty(); + + private Optional givenName = Optional.empty(); + + private Optional familyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserResponseSchema other) { + userId(other.getUserId()); + email(other.getEmail()); + emailVerified(other.getEmailVerified()); + username(other.getUsername()); + phoneNumber(other.getPhoneNumber()); + phoneVerified(other.getPhoneVerified()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + identities(other.getIdentities()); + appMetadata(other.getAppMetadata()); + userMetadata(other.getUserMetadata()); + picture(other.getPicture()); + name(other.getName()); + nickname(other.getNickname()); + multifactor(other.getMultifactor()); + lastIp(other.getLastIp()); + lastLogin(other.getLastLogin()); + loginsCount(other.getLoginsCount()); + blocked(other.getBlocked()); + givenName(other.getGivenName()); + familyName(other.getFamilyName()); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

Email address of this user.

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether this email address is verified (true) or unverified (false).

+ */ + @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) + public Builder emailVerified(Optional emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + public Builder emailVerified(Boolean emailVerified) { + this.emailVerified = Optional.ofNullable(emailVerified); + return this; + } + + /** + *

Username of this user.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

Phone number for this user. Follows the <a href="https://en.wikipedia.org/wiki/E.164">E.164 recommendation</a>.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Whether this phone number has been verified (true) or not (false).

+ */ + @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) + public Builder phoneVerified(Optional phoneVerified) { + this.phoneVerified = phoneVerified; + return this; + } + + public Builder phoneVerified(Boolean phoneVerified) { + this.phoneVerified = Optional.ofNullable(phoneVerified); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(UserDateSchema createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(UserDateSchema updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Array of user identity objects when accounts are linked.

+ */ + @JsonSetter(value = "identities", nulls = Nulls.SKIP) + public Builder identities(Optional> identities) { + this.identities = identities; + return this; + } + + public Builder identities(List identities) { + this.identities = Optional.ofNullable(identities); + return this; + } + + @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) + public Builder appMetadata(Optional> appMetadata) { + this.appMetadata = appMetadata; + return this; + } + + public Builder appMetadata(Map appMetadata) { + this.appMetadata = Optional.ofNullable(appMetadata); + return this; + } + + @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) + public Builder userMetadata(Optional> userMetadata) { + this.userMetadata = userMetadata; + return this; + } + + public Builder userMetadata(Map userMetadata) { + this.userMetadata = Optional.ofNullable(userMetadata); + return this; + } + + /** + *

URL to picture, photo, or avatar of this user.

+ */ + @JsonSetter(value = "picture", nulls = Nulls.SKIP) + public Builder picture(Optional picture) { + this.picture = picture; + return this; + } + + public Builder picture(String picture) { + this.picture = Optional.ofNullable(picture); + return this; + } + + /** + *

Name of this user.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Preferred nickname or alias of this user.

+ */ + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public Builder nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + public Builder nickname(String nickname) { + this.nickname = Optional.ofNullable(nickname); + return this; + } + + /** + *

List of multi-factor authentication providers with which this user has enrolled.

+ */ + @JsonSetter(value = "multifactor", nulls = Nulls.SKIP) + public Builder multifactor(Optional> multifactor) { + this.multifactor = multifactor; + return this; + } + + public Builder multifactor(List multifactor) { + this.multifactor = Optional.ofNullable(multifactor); + return this; + } + + /** + *

Last IP address from which this user logged in.

+ */ + @JsonSetter(value = "last_ip", nulls = Nulls.SKIP) + public Builder lastIp(Optional lastIp) { + this.lastIp = lastIp; + return this; + } + + public Builder lastIp(String lastIp) { + this.lastIp = Optional.ofNullable(lastIp); + return this; + } + + @JsonSetter(value = "last_login", nulls = Nulls.SKIP) + public Builder lastLogin(Optional lastLogin) { + this.lastLogin = lastLogin; + return this; + } + + public Builder lastLogin(UserDateSchema lastLogin) { + this.lastLogin = Optional.ofNullable(lastLogin); + return this; + } + + /** + *

Total number of logins this user has performed.

+ */ + @JsonSetter(value = "logins_count", nulls = Nulls.SKIP) + public Builder loginsCount(Optional loginsCount) { + this.loginsCount = loginsCount; + return this; + } + + public Builder loginsCount(Integer loginsCount) { + this.loginsCount = Optional.ofNullable(loginsCount); + return this; + } + + /** + *

Whether this user was blocked by an administrator (true) or is not (false).

+ */ + @JsonSetter(value = "blocked", nulls = Nulls.SKIP) + public Builder blocked(Optional blocked) { + this.blocked = blocked; + return this; + } + + public Builder blocked(Boolean blocked) { + this.blocked = Optional.ofNullable(blocked); + return this; + } + + /** + *

Given name/first name/forename of this user.

+ */ + @JsonSetter(value = "given_name", nulls = Nulls.SKIP) + public Builder givenName(Optional givenName) { + this.givenName = givenName; + return this; + } + + public Builder givenName(String givenName) { + this.givenName = Optional.ofNullable(givenName); + return this; + } + + /** + *

Family name/last name/surname of this user.

+ */ + @JsonSetter(value = "family_name", nulls = Nulls.SKIP) + public Builder familyName(Optional familyName) { + this.familyName = familyName; + return this; + } + + public Builder familyName(String familyName) { + this.familyName = Optional.ofNullable(familyName); + return this; + } + + public UserResponseSchema build() { + return new UserResponseSchema( + userId, + email, + emailVerified, + username, + phoneNumber, + phoneVerified, + createdAt, + updatedAt, + identities, + appMetadata, + userMetadata, + picture, + name, + nickname, + multifactor, + lastIp, + lastLogin, + loginsCount, + blocked, + givenName, + familyName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java new file mode 100644 index 000000000..fd678fdb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsernameAllowedTypes.Builder.class) +public final class UsernameAllowedTypes { + private final Optional email; + + private final Optional phoneNumber; + + private final Map additionalProperties; + + private UsernameAllowedTypes( + Optional email, Optional phoneNumber, Map additionalProperties) { + this.email = email; + this.phoneNumber = phoneNumber; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsernameAllowedTypes && equalTo((UsernameAllowedTypes) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsernameAllowedTypes other) { + return email.equals(other.email) && phoneNumber.equals(other.phoneNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.email, this.phoneNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsernameAllowedTypes other) { + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + return this; + } + + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(Boolean email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(Boolean phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + public UsernameAllowedTypes build() { + return new UsernameAllowedTypes(email, phoneNumber, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java new file mode 100644 index 000000000..81d7ee07d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsernameAttribute.Builder.class) +public final class UsernameAttribute { + private final Optional identifier; + + private final Optional profileRequired; + + private final Optional signup; + + private final Optional validation; + + private final Map additionalProperties; + + private UsernameAttribute( + Optional identifier, + Optional profileRequired, + Optional signup, + Optional validation, + Map additionalProperties) { + this.identifier = identifier; + this.profileRequired = profileRequired; + this.signup = signup; + this.validation = validation; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return Determines if property should be required for users + */ + @JsonProperty("profile_required") + public Optional getProfileRequired() { + return profileRequired; + } + + @JsonProperty("signup") + public Optional getSignup() { + return signup; + } + + @JsonProperty("validation") + public Optional getValidation() { + return validation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsernameAttribute && equalTo((UsernameAttribute) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsernameAttribute other) { + return identifier.equals(other.identifier) + && profileRequired.equals(other.profileRequired) + && signup.equals(other.signup) + && validation.equals(other.validation); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.identifier, this.profileRequired, this.signup, this.validation); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional identifier = Optional.empty(); + + private Optional profileRequired = Optional.empty(); + + private Optional signup = Optional.empty(); + + private Optional validation = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsernameAttribute other) { + identifier(other.getIdentifier()); + profileRequired(other.getProfileRequired()); + signup(other.getSignup()); + validation(other.getValidation()); + return this; + } + + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(ConnectionAttributeIdentifier identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

Determines if property should be required for users

+ */ + @JsonSetter(value = "profile_required", nulls = Nulls.SKIP) + public Builder profileRequired(Optional profileRequired) { + this.profileRequired = profileRequired; + return this; + } + + public Builder profileRequired(Boolean profileRequired) { + this.profileRequired = Optional.ofNullable(profileRequired); + return this; + } + + @JsonSetter(value = "signup", nulls = Nulls.SKIP) + public Builder signup(Optional signup) { + this.signup = signup; + return this; + } + + public Builder signup(SignupSchema signup) { + this.signup = Optional.ofNullable(signup); + return this; + } + + @JsonSetter(value = "validation", nulls = Nulls.SKIP) + public Builder validation(Optional validation) { + this.validation = validation; + return this; + } + + public Builder validation(UsernameValidation validation) { + this.validation = Optional.ofNullable(validation); + return this; + } + + public UsernameAttribute build() { + return new UsernameAttribute(identifier, profileRequired, signup, validation, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java new file mode 100644 index 000000000..d8070e03b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsernameValidation.Builder.class) +public final class UsernameValidation { + private final Optional minLength; + + private final Optional maxLength; + + private final Optional allowedTypes; + + private final Map additionalProperties; + + private UsernameValidation( + Optional minLength, + Optional maxLength, + Optional allowedTypes, + Map additionalProperties) { + this.minLength = minLength; + this.maxLength = maxLength; + this.allowedTypes = allowedTypes; + this.additionalProperties = additionalProperties; + } + + /** + * @return Minimum allowed length + */ + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + /** + * @return Maximum allowed length + */ + @JsonProperty("max_length") + public Optional getMaxLength() { + return maxLength; + } + + @JsonProperty("allowed_types") + public Optional getAllowedTypes() { + return allowedTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsernameValidation && equalTo((UsernameValidation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsernameValidation other) { + return minLength.equals(other.minLength) + && maxLength.equals(other.maxLength) + && allowedTypes.equals(other.allowedTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.minLength, this.maxLength, this.allowedTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional minLength = Optional.empty(); + + private Optional maxLength = Optional.empty(); + + private Optional allowedTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsernameValidation other) { + minLength(other.getMinLength()); + maxLength(other.getMaxLength()); + allowedTypes(other.getAllowedTypes()); + return this; + } + + /** + *

Minimum allowed length

+ */ + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public Builder minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + public Builder minLength(Double minLength) { + this.minLength = Optional.ofNullable(minLength); + return this; + } + + /** + *

Maximum allowed length

+ */ + @JsonSetter(value = "max_length", nulls = Nulls.SKIP) + public Builder maxLength(Optional maxLength) { + this.maxLength = maxLength; + return this; + } + + public Builder maxLength(Double maxLength) { + this.maxLength = Optional.ofNullable(maxLength); + return this; + } + + @JsonSetter(value = "allowed_types", nulls = Nulls.SKIP) + public Builder allowedTypes(Optional allowedTypes) { + this.allowedTypes = allowedTypes; + return this; + } + + public Builder allowedTypes(UsernameAllowedTypes allowedTypes) { + this.allowedTypes = Optional.ofNullable(allowedTypes); + return this; + } + + public UsernameValidation build() { + return new UsernameValidation(minLength, maxLength, allowedTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java new file mode 100644 index 000000000..17c5706ff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersEnrollment.Builder.class) +public final class UsersEnrollment { + private final Optional id; + + private final Optional status; + + private final Optional type; + + private final Optional name; + + private final Optional identifier; + + private final Optional phoneNumber; + + private final Optional authMethod; + + private final Optional enrolledAt; + + private final Optional lastAuth; + + private final Map additionalProperties; + + private UsersEnrollment( + Optional id, + Optional status, + Optional type, + Optional name, + Optional identifier, + Optional phoneNumber, + Optional authMethod, + Optional enrolledAt, + Optional lastAuth, + Map additionalProperties) { + this.id = id; + this.status = status; + this.type = type; + this.name = name; + this.identifier = identifier; + this.phoneNumber = phoneNumber; + this.authMethod = authMethod; + this.enrolledAt = enrolledAt; + this.lastAuth = lastAuth; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of this enrollment. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Type of enrollment. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Name of enrollment (usually phone number). + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Device identifier (usually phone identifier) of this enrollment. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return Phone number for this enrollment. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("auth_method") + public Optional getAuthMethod() { + return authMethod; + } + + /** + * @return Start date and time of this enrollment. + */ + @JsonProperty("enrolled_at") + public Optional getEnrolledAt() { + return enrolledAt; + } + + /** + * @return Last authentication date and time of this enrollment. + */ + @JsonProperty("last_auth") + public Optional getLastAuth() { + return lastAuth; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersEnrollment && equalTo((UsersEnrollment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersEnrollment other) { + return id.equals(other.id) + && status.equals(other.status) + && type.equals(other.type) + && name.equals(other.name) + && identifier.equals(other.identifier) + && phoneNumber.equals(other.phoneNumber) + && authMethod.equals(other.authMethod) + && enrolledAt.equals(other.enrolledAt) + && lastAuth.equals(other.lastAuth); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.type, + this.name, + this.identifier, + this.phoneNumber, + this.authMethod, + this.enrolledAt, + this.lastAuth); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional authMethod = Optional.empty(); + + private Optional enrolledAt = Optional.empty(); + + private Optional lastAuth = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersEnrollment other) { + id(other.getId()); + status(other.getStatus()); + type(other.getType()); + name(other.getName()); + identifier(other.getIdentifier()); + phoneNumber(other.getPhoneNumber()); + authMethod(other.getAuthMethod()); + enrolledAt(other.getEnrolledAt()); + lastAuth(other.getLastAuth()); + return this; + } + + /** + *

ID of this enrollment.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(UserEnrollmentStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Type of enrollment.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

Name of enrollment (usually phone number).

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Device identifier (usually phone identifier) of this enrollment.

+ */ + @JsonSetter(value = "identifier", nulls = Nulls.SKIP) + public Builder identifier(Optional identifier) { + this.identifier = identifier; + return this; + } + + public Builder identifier(String identifier) { + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + *

Phone number for this enrollment.

+ */ + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "auth_method", nulls = Nulls.SKIP) + public Builder authMethod(Optional authMethod) { + this.authMethod = authMethod; + return this; + } + + public Builder authMethod(UserEnrollmentAuthMethodEnum authMethod) { + this.authMethod = Optional.ofNullable(authMethod); + return this; + } + + /** + *

Start date and time of this enrollment.

+ */ + @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) + public Builder enrolledAt(Optional enrolledAt) { + this.enrolledAt = enrolledAt; + return this; + } + + public Builder enrolledAt(OffsetDateTime enrolledAt) { + this.enrolledAt = Optional.ofNullable(enrolledAt); + return this; + } + + /** + *

Last authentication date and time of this enrollment.

+ */ + @JsonSetter(value = "last_auth", nulls = Nulls.SKIP) + public Builder lastAuth(Optional lastAuth) { + this.lastAuth = lastAuth; + return this; + } + + public Builder lastAuth(OffsetDateTime lastAuth) { + this.lastAuth = Optional.ofNullable(lastAuth); + return this; + } + + public UsersEnrollment build() { + return new UsersEnrollment( + id, + status, + type, + name, + identifier, + phoneNumber, + authMethod, + enrolledAt, + lastAuth, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java new file mode 100644 index 000000000..068589170 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VerifiableCredentialTemplateResponse.Builder.class) +public final class VerifiableCredentialTemplateResponse { + private final Optional id; + + private final Optional name; + + private final Optional type; + + private final Optional dialect; + + private final Optional presentation; + + private final Optional customCertificateAuthority; + + private final Optional wellKnownTrustedIssuers; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private VerifiableCredentialTemplateResponse( + Optional id, + Optional name, + Optional type, + Optional dialect, + Optional presentation, + Optional customCertificateAuthority, + Optional wellKnownTrustedIssuers, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.customCertificateAuthority = customCertificateAuthority; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of the template. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The type of the template. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The dialect of the template. + */ + @JsonProperty("dialect") + public Optional getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public Optional getPresentation() { + return presentation; + } + + /** + * @return The custom certificate authority. + */ + @JsonProperty("custom_certificate_authority") + public Optional getCustomCertificateAuthority() { + return customCertificateAuthority; + } + + /** + * @return The well-known trusted issuers, comma separated. + */ + @JsonProperty("well_known_trusted_issuers") + public Optional getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time the template was created. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VerifiableCredentialTemplateResponse + && equalTo((VerifiableCredentialTemplateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VerifiableCredentialTemplateResponse other) { + return id.equals(other.id) + && name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && customCertificateAuthority.equals(other.customCertificateAuthority) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.type, + this.dialect, + this.presentation, + this.customCertificateAuthority, + this.wellKnownTrustedIssuers, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional dialect = Optional.empty(); + + private Optional presentation = Optional.empty(); + + private Optional customCertificateAuthority = Optional.empty(); + + private Optional wellKnownTrustedIssuers = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VerifiableCredentialTemplateResponse other) { + id(other.getId()); + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + customCertificateAuthority(other.getCustomCertificateAuthority()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The name of the template.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

The type of the template.

+ */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

The dialect of the template.

+ */ + @JsonSetter(value = "dialect", nulls = Nulls.SKIP) + public Builder dialect(Optional dialect) { + this.dialect = dialect; + return this; + } + + public Builder dialect(String dialect) { + this.dialect = Optional.ofNullable(dialect); + return this; + } + + @JsonSetter(value = "presentation", nulls = Nulls.SKIP) + public Builder presentation(Optional presentation) { + this.presentation = presentation; + return this; + } + + public Builder presentation(MdlPresentationRequest presentation) { + this.presentation = Optional.ofNullable(presentation); + return this; + } + + /** + *

The custom certificate authority.

+ */ + @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) + public Builder customCertificateAuthority(Optional customCertificateAuthority) { + this.customCertificateAuthority = customCertificateAuthority; + return this; + } + + public Builder customCertificateAuthority(String customCertificateAuthority) { + this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); + return this; + } + + /** + *

The well-known trusted issuers, comma separated.

+ */ + @JsonSetter(value = "well_known_trusted_issuers", nulls = Nulls.SKIP) + public Builder wellKnownTrustedIssuers(Optional wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + return this; + } + + public Builder wellKnownTrustedIssuers(String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = Optional.ofNullable(wellKnownTrustedIssuers); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

The date and time the template was created.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public VerifiableCredentialTemplateResponse build() { + return new VerifiableCredentialTemplateResponse( + id, + name, + type, + dialect, + presentation, + customCertificateAuthority, + wellKnownTrustedIssuers, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java new file mode 100644 index 000000000..ce611f898 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class VerificationMethodEnum { + public static final VerificationMethodEnum OTP = new VerificationMethodEnum(Value.OTP, "otp"); + + public static final VerificationMethodEnum LINK = new VerificationMethodEnum(Value.LINK, "link"); + + private final Value value; + + private final String string; + + VerificationMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof VerificationMethodEnum + && this.string.equals(((VerificationMethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OTP: + return visitor.visitOtp(); + case LINK: + return visitor.visitLink(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static VerificationMethodEnum valueOf(String value) { + switch (value) { + case "otp": + return OTP; + case "link": + return LINK; + default: + return new VerificationMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LINK, + + OTP, + + UNKNOWN + } + + public interface Visitor { + T visitLink(); + + T visitOtp(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java new file mode 100644 index 000000000..fe90c7da3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VerifyCustomDomainResponseContent.Builder.class) +public final class VerifyCustomDomainResponseContent { + private final String customDomainId; + + private final String domain; + + private final boolean primary; + + private final CustomDomainTypeEnum type; + + private final Optional cnameApiKey; + + private final Optional originDomainName; + + private final Optional verification; + + private final OptionalNullable customClientIpHeader; + + private final Optional tlsPolicy; + + private final Map additionalProperties; + + private VerifyCustomDomainResponseContent( + String customDomainId, + String domain, + boolean primary, + CustomDomainTypeEnum type, + Optional cnameApiKey, + Optional originDomainName, + Optional verification, + OptionalNullable customClientIpHeader, + Optional tlsPolicy, + Map additionalProperties) { + this.customDomainId = customDomainId; + this.domain = domain; + this.primary = primary; + this.type = type; + this.cnameApiKey = cnameApiKey; + this.originDomainName = originDomainName; + this.verification = verification; + this.customClientIpHeader = customClientIpHeader; + this.tlsPolicy = tlsPolicy; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the custom domain. + */ + @JsonProperty("custom_domain_id") + public String getCustomDomainId() { + return customDomainId; + } + + /** + * @return Domain name. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + /** + * @return Whether this is a primary domain (true) or not (false). + */ + @JsonProperty("primary") + public boolean getPrimary() { + return primary; + } + + @JsonProperty("type") + public CustomDomainTypeEnum getType() { + return type; + } + + /** + * @return CNAME API key header. + */ + @JsonProperty("cname_api_key") + public Optional getCnameApiKey() { + return cnameApiKey; + } + + /** + * @return Intermediate address. + */ + @JsonProperty("origin_domain_name") + public Optional getOriginDomainName() { + return originDomainName; + } + + @JsonProperty("verification") + public Optional getVerification() { + return verification; + } + + /** + * @return The HTTP header to fetch the client's IP address + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + public OptionalNullable getCustomClientIpHeader() { + if (customClientIpHeader == null) { + return OptionalNullable.absent(); + } + return customClientIpHeader; + } + + /** + * @return The TLS version policy + */ + @JsonProperty("tls_policy") + public Optional getTlsPolicy() { + return tlsPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_client_ip_header") + private OptionalNullable _getCustomClientIpHeader() { + return customClientIpHeader; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VerifyCustomDomainResponseContent && equalTo((VerifyCustomDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VerifyCustomDomainResponseContent other) { + return customDomainId.equals(other.customDomainId) + && domain.equals(other.domain) + && primary == other.primary + && type.equals(other.type) + && cnameApiKey.equals(other.cnameApiKey) + && originDomainName.equals(other.originDomainName) + && verification.equals(other.verification) + && customClientIpHeader.equals(other.customClientIpHeader) + && tlsPolicy.equals(other.tlsPolicy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customDomainId, + this.domain, + this.primary, + this.type, + this.cnameApiKey, + this.originDomainName, + this.verification, + this.customClientIpHeader, + this.tlsPolicy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CustomDomainIdStage builder() { + return new Builder(); + } + + public interface CustomDomainIdStage { + /** + *

ID of the custom domain.

+ */ + DomainStage customDomainId(@NotNull String customDomainId); + + Builder from(VerifyCustomDomainResponseContent other); + } + + public interface DomainStage { + /** + *

Domain name.

+ */ + PrimaryStage domain(@NotNull String domain); + } + + public interface PrimaryStage { + /** + *

Whether this is a primary domain (true) or not (false).

+ */ + TypeStage primary(boolean primary); + } + + public interface TypeStage { + _FinalStage type(@NotNull CustomDomainTypeEnum type); + } + + public interface _FinalStage { + VerifyCustomDomainResponseContent build(); + + /** + *

CNAME API key header.

+ */ + _FinalStage cnameApiKey(Optional cnameApiKey); + + _FinalStage cnameApiKey(String cnameApiKey); + + /** + *

Intermediate address.

+ */ + _FinalStage originDomainName(Optional originDomainName); + + _FinalStage originDomainName(String originDomainName); + + _FinalStage verification(Optional verification); + + _FinalStage verification(DomainVerification verification); + + /** + *

The HTTP header to fetch the client's IP address

+ */ + _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader); + + _FinalStage customClientIpHeader(String customClientIpHeader); + + _FinalStage customClientIpHeader(Optional customClientIpHeader); + + _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader); + + /** + *

The TLS version policy

+ */ + _FinalStage tlsPolicy(Optional tlsPolicy); + + _FinalStage tlsPolicy(String tlsPolicy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + private String customDomainId; + + private String domain; + + private boolean primary; + + private CustomDomainTypeEnum type; + + private Optional tlsPolicy = Optional.empty(); + + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + + private Optional verification = Optional.empty(); + + private Optional originDomainName = Optional.empty(); + + private Optional cnameApiKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(VerifyCustomDomainResponseContent other) { + customDomainId(other.getCustomDomainId()); + domain(other.getDomain()); + primary(other.getPrimary()); + type(other.getType()); + cnameApiKey(other.getCnameApiKey()); + originDomainName(other.getOriginDomainName()); + verification(other.getVerification()); + customClientIpHeader(other.getCustomClientIpHeader()); + tlsPolicy(other.getTlsPolicy()); + return this; + } + + /** + *

ID of the custom domain.

+ *

ID of the custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("custom_domain_id") + public DomainStage customDomainId(@NotNull String customDomainId) { + this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); + return this; + } + + /** + *

Domain name.

+ *

Domain name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public PrimaryStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + /** + *

Whether this is a primary domain (true) or not (false).

+ *

Whether this is a primary domain (true) or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("primary") + public TypeStage primary(boolean primary) { + this.primary = primary; + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CustomDomainTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

The TLS version policy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tlsPolicy(String tlsPolicy) { + this.tlsPolicy = Optional.ofNullable(tlsPolicy); + return this; + } + + /** + *

The TLS version policy

+ */ + @java.lang.Override + @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) + public _FinalStage tlsPolicy(Optional tlsPolicy) { + this.tlsPolicy = tlsPolicy; + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { + if (customClientIpHeader.isNull()) { + this.customClientIpHeader = OptionalNullable.ofNull(); + } else if (customClientIpHeader.isEmpty()) { + this.customClientIpHeader = OptionalNullable.absent(); + } else { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(Optional customClientIpHeader) { + if (customClientIpHeader.isPresent()) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); + } else { + this.customClientIpHeader = OptionalNullable.absent(); + } + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customClientIpHeader(String customClientIpHeader) { + this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); + return this; + } + + /** + *

The HTTP header to fetch the client's IP address

+ */ + @java.lang.Override + @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) + public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { + this.customClientIpHeader = customClientIpHeader; + return this; + } + + @java.lang.Override + public _FinalStage verification(DomainVerification verification) { + this.verification = Optional.ofNullable(verification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "verification", nulls = Nulls.SKIP) + public _FinalStage verification(Optional verification) { + this.verification = verification; + return this; + } + + /** + *

Intermediate address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originDomainName(String originDomainName) { + this.originDomainName = Optional.ofNullable(originDomainName); + return this; + } + + /** + *

Intermediate address.

+ */ + @java.lang.Override + @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) + public _FinalStage originDomainName(Optional originDomainName) { + this.originDomainName = originDomainName; + return this; + } + + /** + *

CNAME API key header.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cnameApiKey(String cnameApiKey) { + this.cnameApiKey = Optional.ofNullable(cnameApiKey); + return this; + } + + /** + *

CNAME API key header.

+ */ + @java.lang.Override + @JsonSetter(value = "cname_api_key", nulls = Nulls.SKIP) + public _FinalStage cnameApiKey(Optional cnameApiKey) { + this.cnameApiKey = cnameApiKey; + return this; + } + + @java.lang.Override + public VerifyCustomDomainResponseContent build() { + return new VerifyCustomDomainResponseContent( + customDomainId, + domain, + primary, + type, + cnameApiKey, + originDomainName, + verification, + customClientIpHeader, + tlsPolicy, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java new file mode 100644 index 000000000..940d7b9a6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java @@ -0,0 +1,377 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VerifyEmailTicketRequestContent.Builder.class) +public final class VerifyEmailTicketRequestContent { + private final Optional resultUrl; + + private final String userId; + + private final Optional clientId; + + private final Optional organizationId; + + private final Optional ttlSec; + + private final Optional includeEmailInRedirect; + + private final Optional identity; + + private final Map additionalProperties; + + private VerifyEmailTicketRequestContent( + Optional resultUrl, + String userId, + Optional clientId, + Optional organizationId, + Optional ttlSec, + Optional includeEmailInRedirect, + Optional identity, + Map additionalProperties) { + this.resultUrl = resultUrl; + this.userId = userId; + this.clientId = clientId; + this.organizationId = organizationId; + this.ttlSec = ttlSec; + this.includeEmailInRedirect = includeEmailInRedirect; + this.identity = identity; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. + */ + @JsonProperty("result_url") + public Optional getResultUrl() { + return resultUrl; + } + + /** + * @return user_id of for whom the ticket should be created. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + /** + * @return ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + /** + * @return (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + */ + @JsonProperty("organization_id") + public Optional getOrganizationId() { + return organizationId; + } + + /** + * @return Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + */ + @JsonProperty("ttl_sec") + public Optional getTtlSec() { + return ttlSec; + } + + /** + * @return Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + */ + @JsonProperty("includeEmailInRedirect") + public Optional getIncludeEmailInRedirect() { + return includeEmailInRedirect; + } + + @JsonProperty("identity") + public Optional getIdentity() { + return identity; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VerifyEmailTicketRequestContent && equalTo((VerifyEmailTicketRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VerifyEmailTicketRequestContent other) { + return resultUrl.equals(other.resultUrl) + && userId.equals(other.userId) + && clientId.equals(other.clientId) + && organizationId.equals(other.organizationId) + && ttlSec.equals(other.ttlSec) + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && identity.equals(other.identity); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.resultUrl, + this.userId, + this.clientId, + this.organizationId, + this.ttlSec, + this.includeEmailInRedirect, + this.identity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id of for whom the ticket should be created.

+ */ + _FinalStage userId(@NotNull String userId); + + Builder from(VerifyEmailTicketRequestContent other); + } + + public interface _FinalStage { + VerifyEmailTicketRequestContent build(); + + /** + *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

+ */ + _FinalStage resultUrl(Optional resultUrl); + + _FinalStage resultUrl(String resultUrl); + + /** + *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

+ */ + _FinalStage clientId(Optional clientId); + + _FinalStage clientId(String clientId); + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ */ + _FinalStage organizationId(Optional organizationId); + + _FinalStage organizationId(String organizationId); + + /** + *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

+ */ + _FinalStage ttlSec(Optional ttlSec); + + _FinalStage ttlSec(Integer ttlSec); + + /** + *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

+ */ + _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect); + + _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect); + + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, _FinalStage { + private String userId; + + private Optional identity = Optional.empty(); + + private Optional includeEmailInRedirect = Optional.empty(); + + private Optional ttlSec = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional resultUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(VerifyEmailTicketRequestContent other) { + resultUrl(other.getResultUrl()); + userId(other.getUserId()); + clientId(other.getClientId()); + organizationId(other.getOrganizationId()); + ttlSec(other.getTtlSec()); + includeEmailInRedirect(other.getIncludeEmailInRedirect()); + identity(other.getIdentity()); + return this; + } + + /** + *

user_id of for whom the ticket should be created.

+ *

user_id of for whom the ticket should be created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("user_id") + public _FinalStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + + /** + *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { + this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); + return this; + } + + /** + *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

+ */ + @java.lang.Override + @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) + public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { + this.includeEmailInRedirect = includeEmailInRedirect; + return this; + } + + /** + *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage ttlSec(Integer ttlSec) { + this.ttlSec = Optional.ofNullable(ttlSec); + return this; + } + + /** + *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

+ */ + @java.lang.Override + @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) + public _FinalStage ttlSec(Optional ttlSec) { + this.ttlSec = ttlSec; + return this; + } + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationId(String organizationId) { + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + /** + *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public _FinalStage organizationId(Optional organizationId) { + this.organizationId = organizationId; + return this; + } + + /** + *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

+ */ + @java.lang.Override + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public _FinalStage clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + /** + *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage resultUrl(String resultUrl) { + this.resultUrl = Optional.ofNullable(resultUrl); + return this; + } + + /** + *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

+ */ + @java.lang.Override + @JsonSetter(value = "result_url", nulls = Nulls.SKIP) + public _FinalStage resultUrl(Optional resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + @java.lang.Override + public VerifyEmailTicketRequestContent build() { + return new VerifyEmailTicketRequestContent( + resultUrl, + userId, + clientId, + organizationId, + ttlSec, + includeEmailInRedirect, + identity, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java new file mode 100644 index 000000000..d558bbb5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VerifyEmailTicketResponseContent.Builder.class) +public final class VerifyEmailTicketResponseContent { + private final String ticket; + + private final Map additionalProperties; + + private VerifyEmailTicketResponseContent(String ticket, Map additionalProperties) { + this.ticket = ticket; + this.additionalProperties = additionalProperties; + } + + /** + * @return URL representing the ticket. + */ + @JsonProperty("ticket") + public String getTicket() { + return ticket; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VerifyEmailTicketResponseContent && equalTo((VerifyEmailTicketResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VerifyEmailTicketResponseContent other) { + return ticket.equals(other.ticket); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ticket); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TicketStage builder() { + return new Builder(); + } + + public interface TicketStage { + /** + *

URL representing the ticket.

+ */ + _FinalStage ticket(@NotNull String ticket); + + Builder from(VerifyEmailTicketResponseContent other); + } + + public interface _FinalStage { + VerifyEmailTicketResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TicketStage, _FinalStage { + private String ticket; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(VerifyEmailTicketResponseContent other) { + ticket(other.getTicket()); + return this; + } + + /** + *

URL representing the ticket.

+ *

URL representing the ticket.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("ticket") + public _FinalStage ticket(@NotNull String ticket) { + this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); + return this; + } + + @java.lang.Override + public VerifyEmailTicketResponseContent build() { + return new VerifyEmailTicketResponseContent(ticket, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticationMethodsClient.java new file mode 100644 index 000000000..c9f133367 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticationMethodsClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.GetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethods; +import com.auth0.client.mgmt.types.UpdateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.UserAuthenticationMethod; +import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent; +import com.auth0.client.mgmt.users.types.ListUserAuthenticationMethodsRequestParameters; +import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuthenticationMethodsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuthenticationMethodsClient rawClient; + + public AsyncAuthenticationMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuthenticationMethodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuthenticationMethodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture> list( + String id, ListUserAuthenticationMethodsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture> list( + String id, ListUserAuthenticationMethodsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CompletableFuture create( + String id, CreateUserAuthenticationMethodRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CompletableFuture create( + String id, CreateUserAuthenticationMethodRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public CompletableFuture> set( + String id, List request) { + return this.rawClient.set(id, request).thenApply(response -> response.body()); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public CompletableFuture> set( + String id, List request, RequestOptions requestOptions) { + return this.rawClient.set(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public CompletableFuture deleteAll(String id) { + return this.rawClient.deleteAll(id).thenApply(response -> response.body()); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public CompletableFuture deleteAll(String id, RequestOptions requestOptions) { + return this.rawClient.deleteAll(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, String authenticationMethodId) { + return this.rawClient.get(id, authenticationMethodId).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, String authenticationMethodId, RequestOptions requestOptions) { + return this.rawClient.get(id, authenticationMethodId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture delete(String id, String authenticationMethodId) { + return this.rawClient.delete(id, authenticationMethodId).thenApply(response -> response.body()); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture delete(String id, String authenticationMethodId, RequestOptions requestOptions) { + return this.rawClient.delete(id, authenticationMethodId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture update( + String id, String authenticationMethodId) { + return this.rawClient.update(id, authenticationMethodId).thenApply(response -> response.body()); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture update( + String id, String authenticationMethodId, UpdateUserAuthenticationMethodRequestContent request) { + return this.rawClient.update(id, authenticationMethodId, request).thenApply(response -> response.body()); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture update( + String id, + String authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(id, authenticationMethodId, request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticatorsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticatorsClient.java new file mode 100644 index 000000000..3c59a93dd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncAuthenticatorsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuthenticatorsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuthenticatorsClient rawClient; + + public AsyncAuthenticatorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuthenticatorsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuthenticatorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture deleteAll(String id) { + return this.rawClient.deleteAll(id).thenApply(response -> response.body()); + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture deleteAll(String id, RequestOptions requestOptions) { + return this.rawClient.deleteAll(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncEnrollmentsClient.java new file mode 100644 index 000000000..83f2ec120 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncEnrollmentsClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.UsersEnrollment; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncEnrollmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEnrollmentsClient rawClient; + + public AsyncEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEnrollmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEnrollmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public CompletableFuture> get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncFederatedConnectionsTokensetsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncFederatedConnectionsTokensetsClient.java new file mode 100644 index 000000000..a94c43cb7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncFederatedConnectionsTokensetsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.FederatedConnectionTokenSet; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncFederatedConnectionsTokensetsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFederatedConnectionsTokensetsClient rawClient; + + public AsyncFederatedConnectionsTokensetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFederatedConnectionsTokensetsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFederatedConnectionsTokensetsClient withRawResponse() { + return this.rawClient; + } + + /** + * List active federated connections tokensets for a provided user + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * List active federated connections tokensets for a provided user + */ + public CompletableFuture> list(String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String tokensetId) { + return this.rawClient.delete(id, tokensetId).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String tokensetId, RequestOptions requestOptions) { + return this.rawClient.delete(id, tokensetId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java new file mode 100644 index 000000000..72f68697d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DeleteUserIdentityResponseContentItem; +import com.auth0.client.mgmt.types.UserIdentity; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.auth0.client.mgmt.users.types.LinkUserIdentityRequestContent; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncIdentitiesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIdentitiesClient rawClient; + + public AsyncIdentitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIdentitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIdentitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture> link(String id) { + return this.rawClient.link(id).thenApply(response -> response.body()); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture> link(String id, LinkUserIdentityRequestContent request) { + return this.rawClient.link(id, request).thenApply(response -> response.body()); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture> link( + String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { + return this.rawClient.link(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public CompletableFuture> delete( + String id, UserIdentityProviderEnum provider, String userId) { + return this.rawClient.delete(id, provider, userId).thenApply(response -> response.body()); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public CompletableFuture> delete( + String id, UserIdentityProviderEnum provider, String userId, RequestOptions requestOptions) { + return this.rawClient.delete(id, provider, userId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncLogsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncLogsClient.java new file mode 100644 index 000000000..42f5d46c0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncLogsClient.java @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Log; +import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncLogsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLogsClient rawClient; + + public AsyncLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLogsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLogsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture> list(String id, ListUserLogsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture> list( + String id, ListUserLogsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncMultifactorClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncMultifactorClient.java new file mode 100644 index 000000000..1cda1888e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncMultifactorClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.UserMultifactorProviderEnum; +import java.util.concurrent.CompletableFuture; + +public class AsyncMultifactorClient { + protected final ClientOptions clientOptions; + + private final AsyncRawMultifactorClient rawClient; + + public AsyncMultifactorClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawMultifactorClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawMultifactorClient withRawResponse() { + return this.rawClient; + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public CompletableFuture invalidateRememberBrowser(String id) { + return this.rawClient.invalidateRememberBrowser(id).thenApply(response -> response.body()); + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public CompletableFuture invalidateRememberBrowser(String id, RequestOptions requestOptions) { + return this.rawClient.invalidateRememberBrowser(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public CompletableFuture deleteProvider(String id, UserMultifactorProviderEnum provider) { + return this.rawClient.deleteProvider(id, provider).thenApply(response -> response.body()); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public CompletableFuture deleteProvider( + String id, UserMultifactorProviderEnum provider, RequestOptions requestOptions) { + return this.rawClient.deleteProvider(id, provider, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncOrganizationsClient.java new file mode 100644 index 000000000..b60520d37 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncOrganizationsClient.java @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncOrganizationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOrganizationsClient rawClient; + + public AsyncOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOrganizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture> list( + String id, ListUserOrganizationsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture> list( + String id, ListUserOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncPermissionsClient.java new file mode 100644 index 000000000..90fc2792c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncPermissionsClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.UserPermissionSchema; +import com.auth0.client.mgmt.users.types.CreateUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.ListUserPermissionsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncPermissionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPermissionsClient rawClient; + + public AsyncPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPermissionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPermissionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture> list( + String id, ListUserPermissionsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture> list( + String id, ListUserPermissionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Assign permissions to a user. + */ + public CompletableFuture create(String id, CreateUserPermissionsRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Assign permissions to a user. + */ + public CompletableFuture create( + String id, CreateUserPermissionsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove permissions from a user. + */ + public CompletableFuture delete(String id, DeleteUserPermissionsRequestContent request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Remove permissions from a user. + */ + public CompletableFuture delete( + String id, DeleteUserPermissionsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java new file mode 100644 index 000000000..c4f9593f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java @@ -0,0 +1,751 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.GetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.ListUserAuthenticationMethodsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethods; +import com.auth0.client.mgmt.types.UpdateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.UserAuthenticationMethod; +import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent; +import com.auth0.client.mgmt.users.types.ListUserAuthenticationMethodsRequestParameters; +import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuthenticationMethodsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuthenticationMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture>> list(String id) { + return list(id, ListUserAuthenticationMethodsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture>> list( + String id, ListUserAuthenticationMethodsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public CompletableFuture>> list( + String id, ListUserAuthenticationMethodsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserAuthenticationMethodsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListUserAuthenticationMethodsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserAuthenticationMethodsRequestParameters nextRequest = + ListUserAuthenticationMethodsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getAuthenticators().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CompletableFuture> create( + String id, CreateUserAuthenticationMethodRequestContent request) { + return create(id, request, null); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CompletableFuture> create( + String id, CreateUserAuthenticationMethodRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateUserAuthenticationMethodResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public CompletableFuture>> set( + String id, List request) { + return set(id, request, null); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public CompletableFuture>> set( + String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public CompletableFuture> deleteAll(String id) { + return deleteAll(id, null); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public CompletableFuture> deleteAll(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get( + String id, String authenticationMethodId) { + return get(id, authenticationMethodId, null); + } + + public CompletableFuture> get( + String id, String authenticationMethodId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAuthenticationMethodResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> delete(String id, String authenticationMethodId) { + return delete(id, authenticationMethodId, null); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> delete( + String id, String authenticationMethodId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> update( + String id, String authenticationMethodId) { + return update( + id, + authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent.builder().build()); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> update( + String id, String authenticationMethodId, UpdateUserAuthenticationMethodRequestContent request) { + return update(id, authenticationMethodId, request, null); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> update( + String id, + String authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateUserAuthenticationMethodResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticatorsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticatorsClient.java new file mode 100644 index 000000000..ee6a94149 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticatorsClient.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuthenticatorsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuthenticatorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> deleteAll(String id) { + return deleteAll(id, null); + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public CompletableFuture> deleteAll(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authenticators") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawEnrollmentsClient.java new file mode 100644 index 000000000..ead3727b4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawEnrollmentsClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.UsersEnrollment; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEnrollmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public CompletableFuture>> get(String id) { + return get(id, null); + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public CompletableFuture>> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("enrollments") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawFederatedConnectionsTokensetsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawFederatedConnectionsTokensetsClient.java new file mode 100644 index 000000000..ddd52d8b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawFederatedConnectionsTokensetsClient.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.FederatedConnectionTokenSet; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFederatedConnectionsTokensetsClient { + protected final ClientOptions clientOptions; + + public AsyncRawFederatedConnectionsTokensetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List active federated connections tokensets for a provided user + */ + public CompletableFuture>> list(String id) { + return list(id, null); + } + + /** + * List active federated connections tokensets for a provided user + */ + public CompletableFuture>> list( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("federated-connections-tokensets") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id, String tokensetId) { + return delete(id, tokensetId, null); + } + + public CompletableFuture> delete( + String id, String tokensetId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("federated-connections-tokensets") + .addPathSegment(tokensetId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java new file mode 100644 index 000000000..b6b3abd3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java @@ -0,0 +1,315 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserIdentityResponseContentItem; +import com.auth0.client.mgmt.types.UserIdentity; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.auth0.client.mgmt.users.types.LinkUserIdentityRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIdentitiesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIdentitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture>> link(String id) { + return link(id, LinkUserIdentityRequestContent.builder().build()); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture>> link( + String id, LinkUserIdentityRequestContent request) { + return link(id, request, null); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public CompletableFuture>> link( + String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("identities") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public CompletableFuture>> delete( + String id, UserIdentityProviderEnum provider, String userId) { + return delete(id, provider, userId, null); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public CompletableFuture>> delete( + String id, UserIdentityProviderEnum provider, String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("identities") + .addPathSegment(provider.toString()) + .addPathSegment(userId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java new file mode 100644 index 000000000..da8ded0e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Log; +import com.auth0.client.mgmt.types.UserListLogOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLogsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture>> list(String id) { + return list(id, ListUserLogsRequestParameters.builder().build()); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture>> list( + String id, ListUserLogsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public CompletableFuture>> list( + String id, ListUserLogsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("logs"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + UserListLogOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UserListLogOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserLogsRequestParameters nextRequest = ListUserLogsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getLogs().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawMultifactorClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawMultifactorClient.java new file mode 100644 index 000000000..4348caac4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawMultifactorClient.java @@ -0,0 +1,203 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.UserMultifactorProviderEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawMultifactorClient { + protected final ClientOptions clientOptions; + + public AsyncRawMultifactorClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public CompletableFuture> invalidateRememberBrowser(String id) { + return invalidateRememberBrowser(id, null); + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public CompletableFuture> invalidateRememberBrowser( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("multifactor/actions") + .addPathSegments("invalidate-remember-browser") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public CompletableFuture> deleteProvider( + String id, UserMultifactorProviderEnum provider) { + return deleteProvider(id, provider, null); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public CompletableFuture> deleteProvider( + String id, UserMultifactorProviderEnum provider, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("multifactor") + .addPathSegment(provider.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java new file mode 100644 index 000000000..5732dea9c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserOrganizationsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOrganizationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture>> list(String id) { + return list(id, ListUserOrganizationsRequestParameters.builder().build()); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture>> list( + String id, ListUserOrganizationsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public CompletableFuture>> list( + String id, ListUserOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserOrganizationsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserOrganizationsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserOrganizationsRequestParameters nextRequest = + ListUserOrganizationsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getOrganizations().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawPermissionsClient.java new file mode 100644 index 000000000..7e3ac8032 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawPermissionsClient.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserPermissionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UserPermissionSchema; +import com.auth0.client.mgmt.users.types.CreateUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.ListUserPermissionsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPermissionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture>> list(String id) { + return list(id, ListUserPermissionsRequestParameters.builder().build()); + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture>> list( + String id, ListUserPermissionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve all permissions associated with the user. + */ + public CompletableFuture>> list( + String id, ListUserPermissionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserPermissionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserPermissionsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserPermissionsRequestParameters nextRequest = + ListUserPermissionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getPermissions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assign permissions to a user. + */ + public CompletableFuture> create( + String id, CreateUserPermissionsRequestContent request) { + return create(id, request, null); + } + + /** + * Assign permissions to a user. + */ + public CompletableFuture> create( + String id, CreateUserPermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove permissions from a user. + */ + public CompletableFuture> delete( + String id, DeleteUserPermissionsRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove permissions from a user. + */ + public CompletableFuture> delete( + String id, DeleteUserPermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRefreshTokenClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRefreshTokenClient.java new file mode 100644 index 000000000..b93900942 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRefreshTokenClient.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListRefreshTokensPaginatedResponseContent; +import com.auth0.client.mgmt.types.RefreshTokenResponseContent; +import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRefreshTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawRefreshTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture>> list( + String userId) { + return list(userId, ListRefreshTokensRequestParameters.builder().build()); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture>> list( + String userId, ListRefreshTokensRequestParameters request) { + return list(userId, request, null); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture>> list( + String userId, ListRefreshTokensRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("refresh-tokens"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRefreshTokensPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRefreshTokensPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRefreshTokensRequestParameters nextRequest = ListRefreshTokensRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTokens().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(userId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete all refresh tokens for a user. + */ + public CompletableFuture> delete(String userId) { + return delete(userId, null); + } + + /** + * Delete all refresh tokens for a user. + */ + public CompletableFuture> delete(String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("refresh-tokens") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java new file mode 100644 index 000000000..4999462aa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java @@ -0,0 +1,334 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.ListUserRolesRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRolesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture>> list(String id) { + return list(id, ListUserRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture>> list( + String id, ListUserRolesRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture>> list( + String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserRolesOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserRolesOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListUserRolesRequestParameters nextRequest = ListUserRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public CompletableFuture> assign(String id, AssignUserRolesRequestContent request) { + return assign(id, request, null); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public CompletableFuture> assign( + String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public CompletableFuture> delete(String id, DeleteUserRolesRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public CompletableFuture> delete( + String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java new file mode 100644 index 000000000..5dcd3f1d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserSessionsPaginatedResponseContent; +import com.auth0.client.mgmt.types.SessionResponseContent; +import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSessionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture>> list( + String userId) { + return list(userId, ListUserSessionsRequestParameters.builder().build()); + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture>> list( + String userId, ListUserSessionsRequestParameters request) { + return list(userId, request, null); + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture>> list( + String userId, ListUserSessionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("sessions"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserSessionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserSessionsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListUserSessionsRequestParameters nextRequest = ListUserSessionsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getSessions().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(userId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete all sessions for a user. + */ + public CompletableFuture> delete(String userId) { + return delete(userId, null); + } + + /** + * Delete all sessions for a user. + */ + public CompletableFuture> delete(String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("sessions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRefreshTokenClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRefreshTokenClient.java new file mode 100644 index 000000000..e6de3b15d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRefreshTokenClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.RefreshTokenResponseContent; +import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncRefreshTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRefreshTokenClient rawClient; + + public AsyncRefreshTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRefreshTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRefreshTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture> list(String userId) { + return this.rawClient.list(userId).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture> list( + String userId, ListRefreshTokensRequestParameters request) { + return this.rawClient.list(userId, request).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public CompletableFuture> list( + String userId, ListRefreshTokensRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(userId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete all refresh tokens for a user. + */ + public CompletableFuture delete(String userId) { + return this.rawClient.delete(userId).thenApply(response -> response.body()); + } + + /** + * Delete all refresh tokens for a user. + */ + public CompletableFuture delete(String userId, RequestOptions requestOptions) { + return this.rawClient.delete(userId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java new file mode 100644 index 000000000..c88b631d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.ListUserRolesRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncRolesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRolesClient rawClient; + + public AsyncRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture> list(String id, ListUserRolesRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public CompletableFuture> list( + String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public CompletableFuture assign(String id, AssignUserRolesRequestContent request) { + return this.rawClient.assign(id, request).thenApply(response -> response.body()); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public CompletableFuture assign( + String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.assign(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public CompletableFuture delete(String id, DeleteUserRolesRequestContent request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public CompletableFuture delete( + String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncSessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncSessionsClient.java new file mode 100644 index 000000000..4d6f38ae0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncSessionsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.SessionResponseContent; +import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncSessionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSessionsClient rawClient; + + public AsyncSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture> list(String userId) { + return this.rawClient.list(userId).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture> list( + String userId, ListUserSessionsRequestParameters request) { + return this.rawClient.list(userId, request).thenApply(response -> response.body()); + } + + /** + * Retrieve details for a user's sessions. + */ + public CompletableFuture> list( + String userId, ListUserSessionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(userId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete all sessions for a user. + */ + public CompletableFuture delete(String userId) { + return this.rawClient.delete(userId).thenApply(response -> response.body()); + } + + /** + * Delete all sessions for a user. + */ + public CompletableFuture delete(String userId, RequestOptions requestOptions) { + return this.rawClient.delete(userId, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/AuthenticationMethodsClient.java new file mode 100644 index 000000000..551aae322 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AuthenticationMethodsClient.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.GetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethods; +import com.auth0.client.mgmt.types.UpdateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.UserAuthenticationMethod; +import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent; +import com.auth0.client.mgmt.users.types.ListUserAuthenticationMethodsRequestParameters; +import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent; +import java.util.List; + +public class AuthenticationMethodsClient { + protected final ClientOptions clientOptions; + + private final RawAuthenticationMethodsClient rawClient; + + public AuthenticationMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuthenticationMethodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuthenticationMethodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public SyncPagingIterable list( + String id, ListUserAuthenticationMethodsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public SyncPagingIterable list( + String id, ListUserAuthenticationMethodsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CreateUserAuthenticationMethodResponseContent create( + String id, CreateUserAuthenticationMethodRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public CreateUserAuthenticationMethodResponseContent create( + String id, CreateUserAuthenticationMethodRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public List set(String id, List request) { + return this.rawClient.set(id, request).body(); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public List set( + String id, List request, RequestOptions requestOptions) { + return this.rawClient.set(id, request, requestOptions).body(); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public void deleteAll(String id) { + this.rawClient.deleteAll(id).body(); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public void deleteAll(String id, RequestOptions requestOptions) { + this.rawClient.deleteAll(id, requestOptions).body(); + } + + public GetUserAuthenticationMethodResponseContent get(String id, String authenticationMethodId) { + return this.rawClient.get(id, authenticationMethodId).body(); + } + + public GetUserAuthenticationMethodResponseContent get( + String id, String authenticationMethodId, RequestOptions requestOptions) { + return this.rawClient.get(id, authenticationMethodId, requestOptions).body(); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public void delete(String id, String authenticationMethodId) { + this.rawClient.delete(id, authenticationMethodId).body(); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public void delete(String id, String authenticationMethodId, RequestOptions requestOptions) { + this.rawClient.delete(id, authenticationMethodId, requestOptions).body(); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public UpdateUserAuthenticationMethodResponseContent update(String id, String authenticationMethodId) { + return this.rawClient.update(id, authenticationMethodId).body(); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public UpdateUserAuthenticationMethodResponseContent update( + String id, String authenticationMethodId, UpdateUserAuthenticationMethodRequestContent request) { + return this.rawClient.update(id, authenticationMethodId, request).body(); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public UpdateUserAuthenticationMethodResponseContent update( + String id, + String authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(id, authenticationMethodId, request, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AuthenticatorsClient.java b/src/main/java/com/auth0/client/mgmt/users/AuthenticatorsClient.java new file mode 100644 index 000000000..5a1096e31 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AuthenticatorsClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; + +public class AuthenticatorsClient { + protected final ClientOptions clientOptions; + + private final RawAuthenticatorsClient rawClient; + + public AuthenticatorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuthenticatorsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuthenticatorsClient withRawResponse() { + return this.rawClient; + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public void deleteAll(String id) { + this.rawClient.deleteAll(id).body(); + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public void deleteAll(String id, RequestOptions requestOptions) { + this.rawClient.deleteAll(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/EnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/EnrollmentsClient.java new file mode 100644 index 000000000..e8c4b5b4c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/EnrollmentsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.UsersEnrollment; +import java.util.List; + +public class EnrollmentsClient { + protected final ClientOptions clientOptions; + + private final RawEnrollmentsClient rawClient; + + public EnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEnrollmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEnrollmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public List get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public List get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/FederatedConnectionsTokensetsClient.java b/src/main/java/com/auth0/client/mgmt/users/FederatedConnectionsTokensetsClient.java new file mode 100644 index 000000000..6970674f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/FederatedConnectionsTokensetsClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.FederatedConnectionTokenSet; +import java.util.List; + +public class FederatedConnectionsTokensetsClient { + protected final ClientOptions clientOptions; + + private final RawFederatedConnectionsTokensetsClient rawClient; + + public FederatedConnectionsTokensetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFederatedConnectionsTokensetsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFederatedConnectionsTokensetsClient withRawResponse() { + return this.rawClient; + } + + /** + * List active federated connections tokensets for a provided user + */ + public List list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * List active federated connections tokensets for a provided user + */ + public List list(String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).body(); + } + + public void delete(String id, String tokensetId) { + this.rawClient.delete(id, tokensetId).body(); + } + + public void delete(String id, String tokensetId, RequestOptions requestOptions) { + this.rawClient.delete(id, tokensetId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java new file mode 100644 index 000000000..0ba639a0e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.DeleteUserIdentityResponseContentItem; +import com.auth0.client.mgmt.types.UserIdentity; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.auth0.client.mgmt.users.types.LinkUserIdentityRequestContent; +import java.util.List; + +public class IdentitiesClient { + protected final ClientOptions clientOptions; + + private final RawIdentitiesClient rawClient; + + public IdentitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIdentitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIdentitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public List link(String id) { + return this.rawClient.link(id).body(); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public List link(String id, LinkUserIdentityRequestContent request) { + return this.rawClient.link(id, request).body(); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public List link(String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { + return this.rawClient.link(id, request, requestOptions).body(); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public List delete( + String id, UserIdentityProviderEnum provider, String userId) { + return this.rawClient.delete(id, provider, userId).body(); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public List delete( + String id, UserIdentityProviderEnum provider, String userId, RequestOptions requestOptions) { + return this.rawClient.delete(id, provider, userId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/LogsClient.java b/src/main/java/com/auth0/client/mgmt/users/LogsClient.java new file mode 100644 index 000000000..32474027d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/LogsClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Log; +import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; + +public class LogsClient { + protected final ClientOptions clientOptions; + + private final RawLogsClient rawClient; + + public LogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLogsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLogsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public SyncPagingIterable list(String id, ListUserLogsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public SyncPagingIterable list( + String id, ListUserLogsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/MultifactorClient.java b/src/main/java/com/auth0/client/mgmt/users/MultifactorClient.java new file mode 100644 index 000000000..cbbd4e7c9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/MultifactorClient.java @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.UserMultifactorProviderEnum; + +public class MultifactorClient { + protected final ClientOptions clientOptions; + + private final RawMultifactorClient rawClient; + + public MultifactorClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawMultifactorClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawMultifactorClient withRawResponse() { + return this.rawClient; + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public void invalidateRememberBrowser(String id) { + this.rawClient.invalidateRememberBrowser(id).body(); + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public void invalidateRememberBrowser(String id, RequestOptions requestOptions) { + this.rawClient.invalidateRememberBrowser(id, requestOptions).body(); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public void deleteProvider(String id, UserMultifactorProviderEnum provider) { + this.rawClient.deleteProvider(id, provider).body(); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public void deleteProvider(String id, UserMultifactorProviderEnum provider, RequestOptions requestOptions) { + this.rawClient.deleteProvider(id, provider, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/OrganizationsClient.java new file mode 100644 index 000000000..e428d0e52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/OrganizationsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; + +public class OrganizationsClient { + protected final ClientOptions clientOptions; + + private final RawOrganizationsClient rawClient; + + public OrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOrganizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOrganizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public SyncPagingIterable list(String id, ListUserOrganizationsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public SyncPagingIterable list( + String id, ListUserOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/PermissionsClient.java b/src/main/java/com/auth0/client/mgmt/users/PermissionsClient.java new file mode 100644 index 000000000..387445507 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/PermissionsClient.java @@ -0,0 +1,80 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.UserPermissionSchema; +import com.auth0.client.mgmt.users.types.CreateUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.ListUserPermissionsRequestParameters; + +public class PermissionsClient { + protected final ClientOptions clientOptions; + + private final RawPermissionsClient rawClient; + + public PermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPermissionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPermissionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all permissions associated with the user. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve all permissions associated with the user. + */ + public SyncPagingIterable list(String id, ListUserPermissionsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve all permissions associated with the user. + */ + public SyncPagingIterable list( + String id, ListUserPermissionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Assign permissions to a user. + */ + public void create(String id, CreateUserPermissionsRequestContent request) { + this.rawClient.create(id, request).body(); + } + + /** + * Assign permissions to a user. + */ + public void create(String id, CreateUserPermissionsRequestContent request, RequestOptions requestOptions) { + this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Remove permissions from a user. + */ + public void delete(String id, DeleteUserPermissionsRequestContent request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Remove permissions from a user. + */ + public void delete(String id, DeleteUserPermissionsRequestContent request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java new file mode 100644 index 000000000..bf60f2efe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java @@ -0,0 +1,572 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.GetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.ListUserAuthenticationMethodsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethods; +import com.auth0.client.mgmt.types.UpdateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.UserAuthenticationMethod; +import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent; +import com.auth0.client.mgmt.users.types.ListUserAuthenticationMethodsRequestParameters; +import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuthenticationMethodsClient { + protected final ClientOptions clientOptions; + + public RawAuthenticationMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListUserAuthenticationMethodsRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public ManagementApiHttpResponse> list( + String id, ListUserAuthenticationMethodsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list of authentication methods associated with a specified user. + */ + public ManagementApiHttpResponse> list( + String id, ListUserAuthenticationMethodsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserAuthenticationMethodsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserAuthenticationMethodsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserAuthenticationMethodsRequestParameters nextRequest = + ListUserAuthenticationMethodsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getAuthenticators().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public ManagementApiHttpResponse create( + String id, CreateUserAuthenticationMethodRequestContent request) { + return create(id, request, null); + } + + /** + * Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed. + */ + public ManagementApiHttpResponse create( + String id, CreateUserAuthenticationMethodRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateUserAuthenticationMethodResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public ManagementApiHttpResponse> set( + String id, List request) { + return set(id, request, null); + } + + /** + * Replace the specified user <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors"> authentication methods</a> with supplied values. + *
<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.
+     * 
+ */ + public ManagementApiHttpResponse> set( + String id, List request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public ManagementApiHttpResponse deleteAll(String id) { + return deleteAll(id, null); + } + + /** + * Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone. + */ + public ManagementApiHttpResponse deleteAll(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get( + String id, String authenticationMethodId) { + return get(id, authenticationMethodId, null); + } + + public ManagementApiHttpResponse get( + String id, String authenticationMethodId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAuthenticationMethodResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse delete(String id, String authenticationMethodId) { + return delete(id, authenticationMethodId, null); + } + + /** + * Remove the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse delete( + String id, String authenticationMethodId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse update( + String id, String authenticationMethodId) { + return update( + id, + authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent.builder().build()); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse update( + String id, String authenticationMethodId, UpdateUserAuthenticationMethodRequestContent request) { + return update(id, authenticationMethodId, request, null); + } + + /** + * Modify the authentication method with the given ID from the specified user. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse update( + String id, + String authenticationMethodId, + UpdateUserAuthenticationMethodRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authentication-methods") + .addPathSegment(authenticationMethodId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateUserAuthenticationMethodResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawAuthenticatorsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticatorsClient.java new file mode 100644 index 000000000..2d017cc5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticatorsClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuthenticatorsClient { + protected final ClientOptions clientOptions; + + public RawAuthenticatorsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse deleteAll(String id) { + return deleteAll(id, null); + } + + /** + * Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api">Manage Authentication Methods with Management API</a>. + */ + public ManagementApiHttpResponse deleteAll(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("authenticators") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawEnrollmentsClient.java new file mode 100644 index 000000000..64bed11ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawEnrollmentsClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.UsersEnrollment; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEnrollmentsClient { + protected final ClientOptions clientOptions; + + public RawEnrollmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public ManagementApiHttpResponse> get(String id) { + return get(id, null); + } + + /** + * Retrieve the first <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors">multi-factor authentication</a> enrollment that a specific user has confirmed. + */ + public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("enrollments") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawFederatedConnectionsTokensetsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawFederatedConnectionsTokensetsClient.java new file mode 100644 index 000000000..b20d61cff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawFederatedConnectionsTokensetsClient.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.FederatedConnectionTokenSet; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFederatedConnectionsTokensetsClient { + protected final ClientOptions clientOptions; + + public RawFederatedConnectionsTokensetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List active federated connections tokensets for a provided user + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, null); + } + + /** + * List active federated connections tokensets for a provided user + */ + public ManagementApiHttpResponse> list(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("federated-connections-tokensets") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id, String tokensetId) { + return delete(id, tokensetId, null); + } + + public ManagementApiHttpResponse delete(String id, String tokensetId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("federated-connections-tokensets") + .addPathSegment(tokensetId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java new file mode 100644 index 000000000..5fe5447af --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.DeleteUserIdentityResponseContentItem; +import com.auth0.client.mgmt.types.UserIdentity; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.auth0.client.mgmt.users.types.LinkUserIdentityRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIdentitiesClient { + protected final ClientOptions clientOptions; + + public RawIdentitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> link(String id) { + return link(id, LinkUserIdentityRequestContent.builder().build()); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> link(String id, LinkUserIdentityRequestContent request) { + return link(id, request, null); + } + + /** + * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. + *

Note: There are two ways of invoking the endpoint:

+ *

<ul> + * <li>With the authenticated primary account's JWT in the Authorization header, which has the <code>update:current_user_identities</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + * { + * "link_with": "SECONDARY_ACCOUNT_JWT" + * } + * </pre> + * In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + * </li> + * <li>With a token generated by the API V2 containing the <code>update:users</code> scope: + * <pre> + * POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + * Authorization: "Bearer YOUR_API_V2_TOKEN" + * { + * "provider": "SECONDARY_ACCOUNT_PROVIDER", + * "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + * "user_id": "SECONDARY_ACCOUNT_USER_ID" + * } + * </pre> + * In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider. + * </li> + * </ul>

+ */ + public ManagementApiHttpResponse> link( + String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("identities") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public ManagementApiHttpResponse> delete( + String id, UserIdentityProviderEnum provider, String userId) { + return delete(id, provider, userId, null); + } + + /** + * Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. + *

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review <a href="https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts">Unlink User Accounts</a>.

+ */ + public ManagementApiHttpResponse> delete( + String id, UserIdentityProviderEnum provider, String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("identities") + .addPathSegment(provider.toString()) + .addPathSegment(userId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java new file mode 100644 index 000000000..915c42d4d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.Log; +import com.auth0.client.mgmt.types.UserListLogOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLogsClient { + protected final ClientOptions clientOptions; + + public RawLogsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListUserLogsRequestParameters.builder().build()); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public ManagementApiHttpResponse> list(String id, ListUserLogsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve log events for a specific user. + *

Note: For more information on all possible event types, their respective acronyms and descriptions, see <a href="https://auth0.com/docs/logs/log-event-type-codes">Log Event Type Codes</a>.

+ *

For more information on the list of fields that can be used in sort, see <a href="https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields">Searchable Fields</a>.

+ *

Auth0 <a href="https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations">limits the number of logs</a> you can return by search criteria to 100 logs per request. Furthermore, you may only paginate through up to 1,000 search results. If you exceed this threshold, please redefine your search.

+ */ + public ManagementApiHttpResponse> list( + String id, ListUserLogsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("logs"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + UserListLogOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UserListLogOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserLogsRequestParameters nextRequest = ListUserLogsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getLogs().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawMultifactorClient.java b/src/main/java/com/auth0/client/mgmt/users/RawMultifactorClient.java new file mode 100644 index 000000000..893c2dc74 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawMultifactorClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.UserMultifactorProviderEnum; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawMultifactorClient { + protected final ClientOptions clientOptions; + + public RawMultifactorClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public ManagementApiHttpResponse invalidateRememberBrowser(String id) { + return invalidateRememberBrowser(id, null); + } + + /** + * Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user. + */ + public ManagementApiHttpResponse invalidateRememberBrowser(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("multifactor/actions") + .addPathSegments("invalidate-remember-browser") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public ManagementApiHttpResponse deleteProvider(String id, UserMultifactorProviderEnum provider) { + return deleteProvider(id, provider, null); + } + + /** + * Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + */ + public ManagementApiHttpResponse deleteProvider( + String id, UserMultifactorProviderEnum provider, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("multifactor") + .addPathSegment(provider.toString()) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java new file mode 100644 index 000000000..d4b01eb3a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserOrganizationsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOrganizationsClient { + protected final ClientOptions clientOptions; + + public RawOrganizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListUserOrganizationsRequestParameters.builder().build()); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public ManagementApiHttpResponse> list( + String id, ListUserOrganizationsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review <a href="https://auth0.com/docs/manage-users/organizations">Auth0 Organizations</a>. + */ + public ManagementApiHttpResponse> list( + String id, ListUserOrganizationsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("organizations"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserOrganizationsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserOrganizationsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserOrganizationsRequestParameters nextRequest = ListUserOrganizationsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getOrganizations().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java new file mode 100644 index 000000000..7224d2d81 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserPermissionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UserPermissionSchema; +import com.auth0.client.mgmt.users.types.CreateUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.ListUserPermissionsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPermissionsClient { + protected final ClientOptions clientOptions; + + public RawPermissionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all permissions associated with the user. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListUserPermissionsRequestParameters.builder().build()); + } + + /** + * Retrieve all permissions associated with the user. + */ + public ManagementApiHttpResponse> list( + String id, ListUserPermissionsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve all permissions associated with the user. + */ + public ManagementApiHttpResponse> list( + String id, ListUserPermissionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserPermissionsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserPermissionsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserPermissionsRequestParameters nextRequest = ListUserPermissionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getPermissions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Assign permissions to a user. + */ + public ManagementApiHttpResponse create(String id, CreateUserPermissionsRequestContent request) { + return create(id, request, null); + } + + /** + * Assign permissions to a user. + */ + public ManagementApiHttpResponse create( + String id, CreateUserPermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove permissions from a user. + */ + public ManagementApiHttpResponse delete(String id, DeleteUserPermissionsRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove permissions from a user. + */ + public ManagementApiHttpResponse delete( + String id, DeleteUserPermissionsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("permissions") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java new file mode 100644 index 000000000..681cc9e5c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListRefreshTokensPaginatedResponseContent; +import com.auth0.client.mgmt.types.RefreshTokenResponseContent; +import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRefreshTokenClient { + protected final ClientOptions clientOptions; + + public RawRefreshTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public ManagementApiHttpResponse> list(String userId) { + return list(userId, ListRefreshTokensRequestParameters.builder().build()); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public ManagementApiHttpResponse> list( + String userId, ListRefreshTokensRequestParameters request) { + return list(userId, request, null); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public ManagementApiHttpResponse> list( + String userId, ListRefreshTokensRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("refresh-tokens"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRefreshTokensPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRefreshTokensPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRefreshTokensRequestParameters nextRequest = ListRefreshTokensRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTokens().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + userId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete all refresh tokens for a user. + */ + public ManagementApiHttpResponse delete(String userId) { + return delete(userId, null); + } + + /** + * Delete all refresh tokens for a user. + */ + public ManagementApiHttpResponse delete(String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("refresh-tokens") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java new file mode 100644 index 000000000..ba17bdeac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java @@ -0,0 +1,261 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserRolesOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.ListUserRolesRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRolesClient { + protected final ClientOptions clientOptions; + + public RawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListUserRolesRequestParameters.builder().build()); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public ManagementApiHttpResponse> list(String id, ListUserRolesRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public ManagementApiHttpResponse> list( + String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles"); + QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserRolesOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserRolesOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListUserRolesRequestParameters nextRequest = ListUserRolesRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = parsedResponse.getRoles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public ManagementApiHttpResponse assign(String id, AssignUserRolesRequestContent request) { + return assign(id, request, null); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public ManagementApiHttpResponse assign( + String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public ManagementApiHttpResponse delete(String id, DeleteUserRolesRequestContent request) { + return delete(id, request, null); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public ManagementApiHttpResponse delete( + String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("roles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java new file mode 100644 index 000000000..636f95046 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ListUserSessionsPaginatedResponseContent; +import com.auth0.client.mgmt.types.SessionResponseContent; +import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSessionsClient { + protected final ClientOptions clientOptions; + + public RawSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve details for a user's sessions. + */ + public ManagementApiHttpResponse> list(String userId) { + return list(userId, ListUserSessionsRequestParameters.builder().build()); + } + + /** + * Retrieve details for a user's sessions. + */ + public ManagementApiHttpResponse> list( + String userId, ListUserSessionsRequestParameters request) { + return list(userId, request, null); + } + + /** + * Retrieve details for a user's sessions. + */ + public ManagementApiHttpResponse> list( + String userId, ListUserSessionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("sessions"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserSessionsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserSessionsPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListUserSessionsRequestParameters nextRequest = ListUserSessionsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getSessions().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + userId, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete all sessions for a user. + */ + public ManagementApiHttpResponse delete(String userId) { + return delete(userId, null); + } + + /** + * Delete all sessions for a user. + */ + public ManagementApiHttpResponse delete(String userId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(userId) + .addPathSegments("sessions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RefreshTokenClient.java b/src/main/java/com/auth0/client/mgmt/users/RefreshTokenClient.java new file mode 100644 index 000000000..d9032df25 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RefreshTokenClient.java @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.RefreshTokenResponseContent; +import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; + +public class RefreshTokenClient { + protected final ClientOptions clientOptions; + + private final RawRefreshTokenClient rawClient; + + public RefreshTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRefreshTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRefreshTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public SyncPagingIterable list(String userId) { + return this.rawClient.list(userId).body(); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public SyncPagingIterable list( + String userId, ListRefreshTokensRequestParameters request) { + return this.rawClient.list(userId, request).body(); + } + + /** + * Retrieve details for a user's refresh tokens. + */ + public SyncPagingIterable list( + String userId, ListRefreshTokensRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(userId, request, requestOptions).body(); + } + + /** + * Delete all refresh tokens for a user. + */ + public void delete(String userId) { + this.rawClient.delete(userId).body(); + } + + /** + * Delete all refresh tokens for a user. + */ + public void delete(String userId, RequestOptions requestOptions) { + this.rawClient.delete(userId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RolesClient.java b/src/main/java/com/auth0/client/mgmt/users/RolesClient.java new file mode 100644 index 000000000..3be2b7c43 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RolesClient.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.ListUserRolesRequestParameters; + +public class RolesClient { + protected final ClientOptions clientOptions; + + private final RawRolesClient rawClient; + + public RolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public SyncPagingIterable list(String id, ListUserRolesRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve detailed list of all user roles currently assigned to a user. + *

<b>Note</b>: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles">Get user roles assigned to an Organization member</a>.

+ */ + public SyncPagingIterable list( + String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public void assign(String id, AssignUserRolesRequestContent request) { + this.rawClient.assign(id, request).body(); + } + + /** + * Assign one or more existing user roles to a user. For more information, review <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. + *

<b>Note</b>: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles">Assign user roles to an Organization member</a>.

+ */ + public void assign(String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { + this.rawClient.assign(id, request, requestOptions).body(); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public void delete(String id, DeleteUserRolesRequestContent request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Remove one or more specified user roles assigned to a user. + *

<b>Note</b>: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: <a href="https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles">Delete user roles from an Organization member</a>.

+ */ + public void delete(String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/SessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/SessionsClient.java new file mode 100644 index 000000000..56304204a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/SessionsClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.SessionResponseContent; +import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; + +public class SessionsClient { + protected final ClientOptions clientOptions; + + private final RawSessionsClient rawClient; + + public SessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve details for a user's sessions. + */ + public SyncPagingIterable list(String userId) { + return this.rawClient.list(userId).body(); + } + + /** + * Retrieve details for a user's sessions. + */ + public SyncPagingIterable list(String userId, ListUserSessionsRequestParameters request) { + return this.rawClient.list(userId, request).body(); + } + + /** + * Retrieve details for a user's sessions. + */ + public SyncPagingIterable list( + String userId, ListUserSessionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(userId, request, requestOptions).body(); + } + + /** + * Delete all sessions for a user. + */ + public void delete(String userId) { + this.rawClient.delete(userId).body(); + } + + /** + * Delete all sessions for a user. + */ + public void delete(String userId, RequestOptions requestOptions) { + this.rawClient.delete(userId, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java new file mode 100644 index 000000000..b423d70e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssignUserRolesRequestContent.Builder.class) +public final class AssignUserRolesRequestContent { + private final List roles; + + private final Map additionalProperties; + + private AssignUserRolesRequestContent(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of roles IDs to associated with the user. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssignUserRolesRequestContent && equalTo((AssignUserRolesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssignUserRolesRequestContent other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssignUserRolesRequestContent other) { + roles(other.getRoles()); + return this; + } + + /** + *

List of roles IDs to associated with the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public AssignUserRolesRequestContent build() { + return new AssignUserRolesRequestContent(roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java new file mode 100644 index 000000000..97914b813 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java @@ -0,0 +1,462 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreatedUserAuthenticationMethodTypeEnum; +import com.auth0.client.mgmt.types.PreferredAuthenticationMethodEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserAuthenticationMethodRequestContent.Builder.class) +public final class CreateUserAuthenticationMethodRequestContent { + private final CreatedUserAuthenticationMethodTypeEnum type; + + private final Optional name; + + private final Optional totpSecret; + + private final Optional phoneNumber; + + private final Optional email; + + private final Optional preferredAuthenticationMethod; + + private final Optional keyId; + + private final Optional publicKey; + + private final Optional relyingPartyIdentifier; + + private final Map additionalProperties; + + private CreateUserAuthenticationMethodRequestContent( + CreatedUserAuthenticationMethodTypeEnum type, + Optional name, + Optional totpSecret, + Optional phoneNumber, + Optional email, + Optional preferredAuthenticationMethod, + Optional keyId, + Optional publicKey, + Optional relyingPartyIdentifier, + Map additionalProperties) { + this.type = type; + this.name = name; + this.totpSecret = totpSecret; + this.phoneNumber = phoneNumber; + this.email = email; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.keyId = keyId; + this.publicKey = publicKey; + this.relyingPartyIdentifier = relyingPartyIdentifier; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public CreatedUserAuthenticationMethodTypeEnum getType() { + return type; + } + + /** + * @return A human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Base32 encoded secret for TOTP generation. + */ + @JsonProperty("totp_secret") + public Optional getTotpSecret() { + return totpSecret; + } + + /** + * @return Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Applies to email authentication methods only. The email address used to send verification messages. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + /** + * @return Applies to webauthn authentication methods only. The id of the credential. + */ + @JsonProperty("key_id") + public Optional getKeyId() { + return keyId; + } + + /** + * @return Applies to webauthn authentication methods only. The public key. + */ + @JsonProperty("public_key") + public Optional getPublicKey() { + return publicKey; + } + + /** + * @return Applies to webauthn authentication methods only. The relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserAuthenticationMethodRequestContent + && equalTo((CreateUserAuthenticationMethodRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserAuthenticationMethodRequestContent other) { + return type.equals(other.type) + && name.equals(other.name) + && totpSecret.equals(other.totpSecret) + && phoneNumber.equals(other.phoneNumber) + && email.equals(other.email) + && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) + && keyId.equals(other.keyId) + && publicKey.equals(other.publicKey) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.type, + this.name, + this.totpSecret, + this.phoneNumber, + this.email, + this.preferredAuthenticationMethod, + this.keyId, + this.publicKey, + this.relyingPartyIdentifier); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type); + + Builder from(CreateUserAuthenticationMethodRequestContent other); + } + + public interface _FinalStage { + CreateUserAuthenticationMethodRequestContent build(); + + /** + *

A human-readable label to identify the authentication method.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

Base32 encoded secret for TOTP generation.

+ */ + _FinalStage totpSecret(Optional totpSecret); + + _FinalStage totpSecret(String totpSecret); + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod); + + _FinalStage preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod); + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ */ + _FinalStage keyId(Optional keyId); + + _FinalStage keyId(String keyId); + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + _FinalStage publicKey(Optional publicKey); + + _FinalStage publicKey(String publicKey); + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CreatedUserAuthenticationMethodTypeEnum type; + + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional publicKey = Optional.empty(); + + private Optional keyId = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional totpSecret = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateUserAuthenticationMethodRequestContent other) { + type(other.getType()); + name(other.getName()); + totpSecret(other.getTotpSecret()); + phoneNumber(other.getPhoneNumber()); + email(other.getEmail()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + keyId(other.getKeyId()); + publicKey(other.getPublicKey()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The relying party identifier.

+ */ + @java.lang.Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicKey(String publicKey) { + this.publicKey = Optional.ofNullable(publicKey); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The public key.

+ */ + @java.lang.Override + @JsonSetter(value = "public_key", nulls = Nulls.SKIP) + public _FinalStage publicKey(Optional publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage keyId(String keyId) { + this.keyId = Optional.ofNullable(keyId); + return this; + } + + /** + *

Applies to webauthn authentication methods only. The id of the credential.

+ */ + @java.lang.Override + @JsonSetter(value = "key_id", nulls = Nulls.SKIP) + public _FinalStage keyId(Optional keyId) { + this.keyId = keyId; + return this; + } + + @java.lang.Override + public _FinalStage preferredAuthenticationMethod( + PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public _FinalStage preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Applies to email authentication methods only. The email address used to send verification messages.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

Base32 encoded secret for TOTP generation.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage totpSecret(String totpSecret) { + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + *

Base32 encoded secret for TOTP generation.

+ */ + @java.lang.Override + @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) + public _FinalStage totpSecret(Optional totpSecret) { + this.totpSecret = totpSecret; + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @java.lang.Override + public CreateUserAuthenticationMethodRequestContent build() { + return new CreateUserAuthenticationMethodRequestContent( + type, + name, + totpSecret, + phoneNumber, + email, + preferredAuthenticationMethod, + keyId, + publicKey, + relyingPartyIdentifier, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java new file mode 100644 index 000000000..a422a33db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserPermissionsRequestContent.Builder.class) +public final class CreateUserPermissionsRequestContent { + private final List permissions; + + private final Map additionalProperties; + + private CreateUserPermissionsRequestContent( + List permissions, Map additionalProperties) { + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of permissions to add to this user. + */ + @JsonProperty("permissions") + public List getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserPermissionsRequestContent + && equalTo((CreateUserPermissionsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserPermissionsRequestContent other) { + return permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List permissions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateUserPermissionsRequestContent other) { + permissions(other.getPermissions()); + return this; + } + + /** + *

List of permissions to add to this user.

+ */ + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(List permissions) { + this.permissions.clear(); + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public Builder addPermissions(PermissionRequestPayload permissions) { + this.permissions.add(permissions); + return this; + } + + public Builder addAllPermissions(List permissions) { + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public CreateUserPermissionsRequestContent build() { + return new CreateUserPermissionsRequestContent(permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java new file mode 100644 index 000000000..2bffd3434 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteUserPermissionsRequestContent.Builder.class) +public final class DeleteUserPermissionsRequestContent { + private final List permissions; + + private final Map additionalProperties; + + private DeleteUserPermissionsRequestContent( + List permissions, Map additionalProperties) { + this.permissions = permissions; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of permissions to remove from this user. + */ + @JsonProperty("permissions") + public List getPermissions() { + return permissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteUserPermissionsRequestContent + && equalTo((DeleteUserPermissionsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteUserPermissionsRequestContent other) { + return permissions.equals(other.permissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.permissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List permissions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteUserPermissionsRequestContent other) { + permissions(other.getPermissions()); + return this; + } + + /** + *

List of permissions to remove from this user.

+ */ + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(List permissions) { + this.permissions.clear(); + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public Builder addPermissions(PermissionRequestPayload permissions) { + this.permissions.add(permissions); + return this; + } + + public Builder addAllPermissions(List permissions) { + if (permissions != null) { + this.permissions.addAll(permissions); + } + return this; + } + + public DeleteUserPermissionsRequestContent build() { + return new DeleteUserPermissionsRequestContent(permissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java new file mode 100644 index 000000000..09a108eae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteUserRolesRequestContent.Builder.class) +public final class DeleteUserRolesRequestContent { + private final List roles; + + private final Map additionalProperties; + + private DeleteUserRolesRequestContent(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of roles IDs to remove from the user. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteUserRolesRequestContent && equalTo((DeleteUserRolesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteUserRolesRequestContent other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteUserRolesRequestContent other) { + roles(other.getRoles()); + return this; + } + + /** + *

List of roles IDs to remove from the user.

+ */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public DeleteUserRolesRequestContent build() { + return new DeleteUserRolesRequestContent(roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java new file mode 100644 index 000000000..5b75173dd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.UserIdEnum; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkUserIdentityRequestContent.Builder.class) +public final class LinkUserIdentityRequestContent { + private final Optional provider; + + private final Optional connectionId; + + private final Optional userId; + + private final Optional linkWith; + + private final Map additionalProperties; + + private LinkUserIdentityRequestContent( + Optional provider, + Optional connectionId, + Optional userId, + Optional linkWith, + Map additionalProperties) { + this.provider = provider; + this.connectionId = connectionId; + this.userId = userId; + this.linkWith = linkWith; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public Optional getProvider() { + return provider; + } + + /** + * @return connection_id of the secondary user account being linked when more than one auth0 database provider exists. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return JWT for the secondary account being linked. If sending this parameter, provider, user_id, and connection_id must not be sent. + */ + @JsonProperty("link_with") + public Optional getLinkWith() { + return linkWith; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkUserIdentityRequestContent && equalTo((LinkUserIdentityRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkUserIdentityRequestContent other) { + return provider.equals(other.provider) + && connectionId.equals(other.connectionId) + && userId.equals(other.userId) + && linkWith.equals(other.linkWith); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider, this.connectionId, this.userId, this.linkWith); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional provider = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional linkWith = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkUserIdentityRequestContent other) { + provider(other.getProvider()); + connectionId(other.getConnectionId()); + userId(other.getUserId()); + linkWith(other.getLinkWith()); + return this; + } + + @JsonSetter(value = "provider", nulls = Nulls.SKIP) + public Builder provider(Optional provider) { + this.provider = provider; + return this; + } + + public Builder provider(UserIdentityProviderEnum provider) { + this.provider = Optional.ofNullable(provider); + return this; + } + + /** + *

connection_id of the secondary user account being linked when more than one auth0 database provider exists.

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserIdEnum userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

JWT for the secondary account being linked. If sending this parameter, provider, user_id, and connection_id must not be sent.

+ */ + @JsonSetter(value = "link_with", nulls = Nulls.SKIP) + public Builder linkWith(Optional linkWith) { + this.linkWith = linkWith; + return this; + } + + public Builder linkWith(String linkWith) { + this.linkWith = Optional.ofNullable(linkWith); + return this; + } + + public LinkUserIdentityRequestContent build() { + return new LinkUserIdentityRequestContent(provider, connectionId, userId, linkWith, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java new file mode 100644 index 000000000..1b9177d8b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRefreshTokensRequestParameters.Builder.class) +public final class ListRefreshTokensRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListRefreshTokensRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return An optional cursor from which to start the selection (exclusive). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRefreshTokensRequestParameters + && equalTo((ListRefreshTokensRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRefreshTokensRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRefreshTokensRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

An optional cursor from which to start the selection (exclusive).

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListRefreshTokensRequestParameters build() { + return new ListRefreshTokensRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java new file mode 100644 index 000000000..820d3be3b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserAuthenticationMethodsRequestParameters.Builder.class) +public final class ListUserAuthenticationMethodsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListUserAuthenticationMethodsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. Default is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Default is 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserAuthenticationMethodsRequestParameters + && equalTo((ListUserAuthenticationMethodsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserAuthenticationMethodsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserAuthenticationMethodsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0. Default is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Default is 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListUserAuthenticationMethodsRequestParameters build() { + return new ListUserAuthenticationMethodsRequestParameters( + page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java new file mode 100644 index 000000000..e7041c4bc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserLogsRequestParameters.Builder.class) +public final class ListUserLogsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable sort; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListUserLogsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable sort, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.sort = sort; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Paging is disabled if parameter not sent. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Field to sort by. Use fieldname:1 for ascending order and fieldname:-1 for descending. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserLogsRequestParameters && equalTo((ListUserLogsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserLogsRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && sort.equals(other.sort) + && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.sort, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserLogsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + sort(other.getSort()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Paging is disabled if parameter not sent.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Field to sort by. Use fieldname:1 for ascending order and fieldname:-1 for descending.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListUserLogsRequestParameters build() { + return new ListUserLogsRequestParameters(page, perPage, sort, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java new file mode 100644 index 000000000..cb1a63315 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserOrganizationsRequestParameters.Builder.class) +public final class ListUserOrganizationsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListUserOrganizationsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserOrganizationsRequestParameters + && equalTo((ListUserOrganizationsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserOrganizationsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserOrganizationsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(com.auth0.client.mgmt.core.Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListUserOrganizationsRequestParameters build() { + return new ListUserOrganizationsRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java new file mode 100644 index 000000000..a8e77081e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserPermissionsRequestParameters.Builder.class) +public final class ListUserPermissionsRequestParameters { + private final OptionalNullable perPage; + + private final OptionalNullable page; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListUserPermissionsRequestParameters( + OptionalNullable perPage, + OptionalNullable page, + OptionalNullable includeTotals, + Map additionalProperties) { + this.perPage = perPage; + this.page = page; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserPermissionsRequestParameters + && equalTo((ListUserPermissionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserPermissionsRequestParameters other) { + return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.perPage, this.page, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserPermissionsRequestParameters other) { + perPage(other.getPerPage()); + page(other.getPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListUserPermissionsRequestParameters build() { + return new ListUserPermissionsRequestParameters(perPage, page, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java new file mode 100644 index 000000000..0e6a74bea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserRolesRequestParameters.Builder.class) +public final class ListUserRolesRequestParameters { + private final OptionalNullable perPage; + + private final OptionalNullable page; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListUserRolesRequestParameters( + OptionalNullable perPage, + OptionalNullable page, + OptionalNullable includeTotals, + Map additionalProperties) { + this.perPage = perPage; + this.page = page; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + if (page == null) { + return OptionalNullable.absent(); + } + return page; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + private OptionalNullable _getPage() { + return page; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserRolesRequestParameters && equalTo((ListUserRolesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserRolesRequestParameters other) { + return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.perPage, this.page, this.includeTotals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserRolesRequestParameters other) { + perPage(other.getPerPage()); + page(other.getPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Number of results per page.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListUserRolesRequestParameters build() { + return new ListUserRolesRequestParameters(perPage, page, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java new file mode 100644 index 000000000..6238eeb0c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserSessionsRequestParameters.Builder.class) +public final class ListUserSessionsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListUserSessionsRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return An optional cursor from which to start the selection (exclusive). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserSessionsRequestParameters && equalTo((ListUserSessionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserSessionsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserSessionsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

An optional cursor from which to start the selection (exclusive).

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListUserSessionsRequestParameters build() { + return new ListUserSessionsRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java new file mode 100644 index 000000000..981906ce3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PreferredAuthenticationMethodEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUserAuthenticationMethodRequestContent.Builder.class) +public final class UpdateUserAuthenticationMethodRequestContent { + private final Optional name; + + private final Optional preferredAuthenticationMethod; + + private final Map additionalProperties; + + private UpdateUserAuthenticationMethodRequestContent( + Optional name, + Optional preferredAuthenticationMethod, + Map additionalProperties) { + this.name = name; + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + this.additionalProperties = additionalProperties; + } + + /** + * @return A human-readable label to identify the authentication method. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("preferred_authentication_method") + public Optional getPreferredAuthenticationMethod() { + return preferredAuthenticationMethod; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserAuthenticationMethodRequestContent + && equalTo((UpdateUserAuthenticationMethodRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserAuthenticationMethodRequestContent other) { + return name.equals(other.name) && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.preferredAuthenticationMethod); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional preferredAuthenticationMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateUserAuthenticationMethodRequestContent other) { + name(other.getName()); + preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); + return this; + } + + /** + *

A human-readable label to identify the authentication method.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) + public Builder preferredAuthenticationMethod( + Optional preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = preferredAuthenticationMethod; + return this; + } + + public Builder preferredAuthenticationMethod(PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { + this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); + return this; + } + + public UpdateUserAuthenticationMethodRequestContent build() { + return new UpdateUserAuthenticationMethodRequestContent( + name, preferredAuthenticationMethod, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/AsyncVerifiableCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/AsyncVerifiableCredentialsClient.java new file mode 100644 index 000000000..649282faa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/AsyncVerifiableCredentialsClient.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.verifiablecredentials.verification.AsyncVerificationClient; +import java.util.function.Supplier; + +public class AsyncVerifiableCredentialsClient { + protected final ClientOptions clientOptions; + + protected final Supplier verificationClient; + + public AsyncVerifiableCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.verificationClient = Suppliers.memoize(() -> new AsyncVerificationClient(clientOptions)); + } + + public AsyncVerificationClient verification() { + return this.verificationClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/VerifiableCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/VerifiableCredentialsClient.java new file mode 100644 index 000000000..52b33aa48 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/VerifiableCredentialsClient.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.verifiablecredentials.verification.VerificationClient; +import java.util.function.Supplier; + +public class VerifiableCredentialsClient { + protected final ClientOptions clientOptions; + + protected final Supplier verificationClient; + + public VerifiableCredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.verificationClient = Suppliers.memoize(() -> new VerificationClient(clientOptions)); + } + + public VerificationClient verification() { + return this.verificationClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java new file mode 100644 index 000000000..2f7857d3c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java @@ -0,0 +1,538 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.ListVerifiableCredentialTemplatesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.VerifiableCredentialTemplateResponse; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.CreateVerifiableCredentialTemplateRequestContent; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.ListVerifiableCredentialTemplatesRequestParameters; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.UpdateVerifiableCredentialTemplateRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTemplatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture>> + list() { + return list(ListVerifiableCredentialTemplatesRequestParameters.builder().build()); + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture>> list( + ListVerifiableCredentialTemplatesRequestParameters request) { + return list(request, null); + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture>> list( + ListVerifiableCredentialTemplatesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListVerifiableCredentialTemplatesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListVerifiableCredentialTemplatesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListVerifiableCredentialTemplatesRequestParameters nextRequest = + ListVerifiableCredentialTemplatesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTemplates().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a verifiable credential template. + */ + public CompletableFuture> create( + CreateVerifiableCredentialTemplateRequestContent request) { + return create(request, null); + } + + /** + * Create a verifiable credential template. + */ + public CompletableFuture> create( + CreateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateVerifiableCredentialTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a verifiable credential template. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Get a verifiable credential template. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetVerifiableCredentialTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a verifiable credential template. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a verifiable credential template. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture> update( + String id) { + return update( + id, UpdateVerifiableCredentialTemplateRequestContent.builder().build()); + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture> update( + String id, UpdateVerifiableCredentialTemplateRequestContent request) { + return update(id, request, null); + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture> update( + String id, UpdateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateVerifiableCredentialTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncTemplatesClient.java new file mode 100644 index 000000000..0613b3a5c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncTemplatesClient.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.VerifiableCredentialTemplateResponse; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.CreateVerifiableCredentialTemplateRequestContent; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.ListVerifiableCredentialTemplatesRequestParameters; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.UpdateVerifiableCredentialTemplateRequestContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncTemplatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTemplatesClient rawClient; + + public AsyncTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTemplatesClient withRawResponse() { + return this.rawClient; + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture> list( + ListVerifiableCredentialTemplatesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List a verifiable credential templates. + */ + public CompletableFuture> list( + ListVerifiableCredentialTemplatesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a verifiable credential template. + */ + public CompletableFuture create( + CreateVerifiableCredentialTemplateRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a verifiable credential template. + */ + public CompletableFuture create( + CreateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a verifiable credential template. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Get a verifiable credential template. + */ + public CompletableFuture get( + String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a verifiable credential template. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a verifiable credential template. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture update( + String id, UpdateVerifiableCredentialTemplateRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a verifiable credential template. + */ + public CompletableFuture update( + String id, UpdateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncVerificationClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncVerificationClient.java new file mode 100644 index 000000000..c00317219 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncVerificationClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncVerificationClient { + protected final ClientOptions clientOptions; + + protected final Supplier templatesClient; + + public AsyncVerificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.templatesClient = Suppliers.memoize(() -> new AsyncTemplatesClient(clientOptions)); + } + + public AsyncTemplatesClient templates() { + return this.templatesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/RawTemplatesClient.java new file mode 100644 index 000000000..cb0553a16 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/RawTemplatesClient.java @@ -0,0 +1,409 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.ListVerifiableCredentialTemplatesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.VerifiableCredentialTemplateResponse; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.CreateVerifiableCredentialTemplateRequestContent; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.ListVerifiableCredentialTemplatesRequestParameters; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.UpdateVerifiableCredentialTemplateRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTemplatesClient { + protected final ClientOptions clientOptions; + + public RawTemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List a verifiable credential templates. + */ + public ManagementApiHttpResponse> list() { + return list(ListVerifiableCredentialTemplatesRequestParameters.builder().build()); + } + + /** + * List a verifiable credential templates. + */ + public ManagementApiHttpResponse> list( + ListVerifiableCredentialTemplatesRequestParameters request) { + return list(request, null); + } + + /** + * List a verifiable credential templates. + */ + public ManagementApiHttpResponse> list( + ListVerifiableCredentialTemplatesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates"); + QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListVerifiableCredentialTemplatesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListVerifiableCredentialTemplatesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListVerifiableCredentialTemplatesRequestParameters nextRequest = + ListVerifiableCredentialTemplatesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getTemplates().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a verifiable credential template. + */ + public ManagementApiHttpResponse create( + CreateVerifiableCredentialTemplateRequestContent request) { + return create(request, null); + } + + /** + * Create a verifiable credential template. + */ + public ManagementApiHttpResponse create( + CreateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateVerifiableCredentialTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Get a verifiable credential template. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Get a verifiable credential template. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetVerifiableCredentialTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a verifiable credential template. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a verifiable credential template. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update a verifiable credential template. + */ + public ManagementApiHttpResponse update(String id) { + return update( + id, UpdateVerifiableCredentialTemplateRequestContent.builder().build()); + } + + /** + * Update a verifiable credential template. + */ + public ManagementApiHttpResponse update( + String id, UpdateVerifiableCredentialTemplateRequestContent request) { + return update(id, request, null); + } + + /** + * Update a verifiable credential template. + */ + public ManagementApiHttpResponse update( + String id, UpdateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("verifiable-credentials/verification/templates") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateVerifiableCredentialTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/TemplatesClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/TemplatesClient.java new file mode 100644 index 000000000..f941f2471 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/TemplatesClient.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.VerifiableCredentialTemplateResponse; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.CreateVerifiableCredentialTemplateRequestContent; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.ListVerifiableCredentialTemplatesRequestParameters; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.UpdateVerifiableCredentialTemplateRequestContent; + +public class TemplatesClient { + protected final ClientOptions clientOptions; + + private final RawTemplatesClient rawClient; + + public TemplatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTemplatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTemplatesClient withRawResponse() { + return this.rawClient; + } + + /** + * List a verifiable credential templates. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List a verifiable credential templates. + */ + public SyncPagingIterable list( + ListVerifiableCredentialTemplatesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * List a verifiable credential templates. + */ + public SyncPagingIterable list( + ListVerifiableCredentialTemplatesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a verifiable credential template. + */ + public CreateVerifiableCredentialTemplateResponseContent create( + CreateVerifiableCredentialTemplateRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a verifiable credential template. + */ + public CreateVerifiableCredentialTemplateResponseContent create( + CreateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Get a verifiable credential template. + */ + public GetVerifiableCredentialTemplateResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Get a verifiable credential template. + */ + public GetVerifiableCredentialTemplateResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a verifiable credential template. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a verifiable credential template. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update a verifiable credential template. + */ + public UpdateVerifiableCredentialTemplateResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a verifiable credential template. + */ + public UpdateVerifiableCredentialTemplateResponseContent update( + String id, UpdateVerifiableCredentialTemplateRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a verifiable credential template. + */ + public UpdateVerifiableCredentialTemplateResponseContent update( + String id, UpdateVerifiableCredentialTemplateRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/VerificationClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/VerificationClient.java new file mode 100644 index 000000000..d0feff32c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/VerificationClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class VerificationClient { + protected final ClientOptions clientOptions; + + protected final Supplier templatesClient; + + public VerificationClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.templatesClient = Suppliers.memoize(() -> new TemplatesClient(clientOptions)); + } + + public TemplatesClient templates() { + return this.templatesClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java new file mode 100644 index 000000000..16c40a488 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.MdlPresentationRequest; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateVerifiableCredentialTemplateRequestContent.Builder.class) +public final class CreateVerifiableCredentialTemplateRequestContent { + private final String name; + + private final String type; + + private final String dialect; + + private final MdlPresentationRequest presentation; + + private final Optional customCertificateAuthority; + + private final String wellKnownTrustedIssuers; + + private final Map additionalProperties; + + private CreateVerifiableCredentialTemplateRequestContent( + String name, + String type, + String dialect, + MdlPresentationRequest presentation, + Optional customCertificateAuthority, + String wellKnownTrustedIssuers, + Map additionalProperties) { + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.customCertificateAuthority = customCertificateAuthority; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("dialect") + public String getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public MdlPresentationRequest getPresentation() { + return presentation; + } + + @JsonProperty("custom_certificate_authority") + public Optional getCustomCertificateAuthority() { + return customCertificateAuthority; + } + + @JsonProperty("well_known_trusted_issuers") + public String getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateVerifiableCredentialTemplateRequestContent + && equalTo((CreateVerifiableCredentialTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateVerifiableCredentialTemplateRequestContent other) { + return name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && customCertificateAuthority.equals(other.customCertificateAuthority) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.type, + this.dialect, + this.presentation, + this.customCertificateAuthority, + this.wellKnownTrustedIssuers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + TypeStage name(@NotNull String name); + + Builder from(CreateVerifiableCredentialTemplateRequestContent other); + } + + public interface TypeStage { + DialectStage type(@NotNull String type); + } + + public interface DialectStage { + PresentationStage dialect(@NotNull String dialect); + } + + public interface PresentationStage { + WellKnownTrustedIssuersStage presentation(@NotNull MdlPresentationRequest presentation); + } + + public interface WellKnownTrustedIssuersStage { + _FinalStage wellKnownTrustedIssuers(@NotNull String wellKnownTrustedIssuers); + } + + public interface _FinalStage { + CreateVerifiableCredentialTemplateRequestContent build(); + + _FinalStage customCertificateAuthority(Optional customCertificateAuthority); + + _FinalStage customCertificateAuthority(String customCertificateAuthority); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, + TypeStage, + DialectStage, + PresentationStage, + WellKnownTrustedIssuersStage, + _FinalStage { + private String name; + + private String type; + + private String dialect; + + private MdlPresentationRequest presentation; + + private String wellKnownTrustedIssuers; + + private Optional customCertificateAuthority = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateVerifiableCredentialTemplateRequestContent other) { + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + customCertificateAuthority(other.getCustomCertificateAuthority()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public TypeStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DialectStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("dialect") + public PresentationStage dialect(@NotNull String dialect) { + this.dialect = Objects.requireNonNull(dialect, "dialect must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("presentation") + public WellKnownTrustedIssuersStage presentation(@NotNull MdlPresentationRequest presentation) { + this.presentation = Objects.requireNonNull(presentation, "presentation must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("well_known_trusted_issuers") + public _FinalStage wellKnownTrustedIssuers(@NotNull String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = + Objects.requireNonNull(wellKnownTrustedIssuers, "wellKnownTrustedIssuers must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage customCertificateAuthority(String customCertificateAuthority) { + this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) + public _FinalStage customCertificateAuthority(Optional customCertificateAuthority) { + this.customCertificateAuthority = customCertificateAuthority; + return this; + } + + @java.lang.Override + public CreateVerifiableCredentialTemplateRequestContent build() { + return new CreateVerifiableCredentialTemplateRequestContent( + name, + type, + dialect, + presentation, + customCertificateAuthority, + wellKnownTrustedIssuers, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java new file mode 100644 index 000000000..ada4bfbdd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListVerifiableCredentialTemplatesRequestParameters.Builder.class) +public final class ListVerifiableCredentialTemplatesRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListVerifiableCredentialTemplatesRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListVerifiableCredentialTemplatesRequestParameters + && equalTo((ListVerifiableCredentialTemplatesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListVerifiableCredentialTemplatesRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListVerifiableCredentialTemplatesRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListVerifiableCredentialTemplatesRequestParameters build() { + return new ListVerifiableCredentialTemplatesRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java new file mode 100644 index 000000000..354237b36 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.verifiablecredentials.verification.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.MdlPresentationRequest; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateVerifiableCredentialTemplateRequestContent.Builder.class) +public final class UpdateVerifiableCredentialTemplateRequestContent { + private final Optional name; + + private final Optional type; + + private final Optional dialect; + + private final Optional presentation; + + private final Optional wellKnownTrustedIssuers; + + private final Optional version; + + private final Map additionalProperties; + + private UpdateVerifiableCredentialTemplateRequestContent( + Optional name, + Optional type, + Optional dialect, + Optional presentation, + Optional wellKnownTrustedIssuers, + Optional version, + Map additionalProperties) { + this.name = name; + this.type = type; + this.dialect = dialect; + this.presentation = presentation; + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + this.version = version; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("dialect") + public Optional getDialect() { + return dialect; + } + + @JsonProperty("presentation") + public Optional getPresentation() { + return presentation; + } + + @JsonProperty("well_known_trusted_issuers") + public Optional getWellKnownTrustedIssuers() { + return wellKnownTrustedIssuers; + } + + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateVerifiableCredentialTemplateRequestContent + && equalTo((UpdateVerifiableCredentialTemplateRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateVerifiableCredentialTemplateRequestContent other) { + return name.equals(other.name) + && type.equals(other.type) + && dialect.equals(other.dialect) + && presentation.equals(other.presentation) + && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers) + && version.equals(other.version); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.type, this.dialect, this.presentation, this.wellKnownTrustedIssuers, this.version); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional dialect = Optional.empty(); + + private Optional presentation = Optional.empty(); + + private Optional wellKnownTrustedIssuers = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateVerifiableCredentialTemplateRequestContent other) { + name(other.getName()); + type(other.getType()); + dialect(other.getDialect()); + presentation(other.getPresentation()); + wellKnownTrustedIssuers(other.getWellKnownTrustedIssuers()); + version(other.getVersion()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "dialect", nulls = Nulls.SKIP) + public Builder dialect(Optional dialect) { + this.dialect = dialect; + return this; + } + + public Builder dialect(String dialect) { + this.dialect = Optional.ofNullable(dialect); + return this; + } + + @JsonSetter(value = "presentation", nulls = Nulls.SKIP) + public Builder presentation(Optional presentation) { + this.presentation = presentation; + return this; + } + + public Builder presentation(MdlPresentationRequest presentation) { + this.presentation = Optional.ofNullable(presentation); + return this; + } + + @JsonSetter(value = "well_known_trusted_issuers", nulls = Nulls.SKIP) + public Builder wellKnownTrustedIssuers(Optional wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = wellKnownTrustedIssuers; + return this; + } + + public Builder wellKnownTrustedIssuers(String wellKnownTrustedIssuers) { + this.wellKnownTrustedIssuers = Optional.ofNullable(wellKnownTrustedIssuers); + return this; + } + + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public Builder version(Optional version) { + this.version = version; + return this; + } + + public Builder version(Double version) { + this.version = Optional.ofNullable(version); + return this; + } + + public UpdateVerifiableCredentialTemplateRequestContent build() { + return new UpdateVerifiableCredentialTemplateRequestContent( + name, type, dialect, presentation, wellKnownTrustedIssuers, version, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/exception/APIException.java b/src/main/java/com/auth0/exception/APIException.java index 40703855a..89be475f0 100644 --- a/src/main/java/com/auth0/exception/APIException.java +++ b/src/main/java/com/auth0/exception/APIException.java @@ -99,7 +99,8 @@ public boolean isMultifactorRequired() { * @return {@code true} when the username and/or password used for authentication are invalid, {@code false} otherwise. */ public boolean isInvalidCredentials() { - return "invalid_user_password".equals(error) || "invalid_grant".equals(error) && "Wrong email or password.".equals(description); + return "invalid_user_password".equals(error) + || "invalid_grant".equals(error) && "Wrong email or password.".equals(description); } /** @@ -120,8 +121,8 @@ public boolean isVerificationRequired() { * @return {@code true} when the MFA Token used on the login request is malformed or has expired, {@code false} otherwise. */ public boolean isMultifactorTokenInvalid() { - return "expired_token".equals(error) && "mfa_token is expired".equals(description) || - "invalid_grant".equals(error) && "Malformed mfa_token".equals(description); + return "expired_token".equals(error) && "mfa_token is expired".equals(description) + || "invalid_grant".equals(error) && "Malformed mfa_token".equals(description); } /** @@ -143,7 +144,7 @@ private static String obtainExceptionMessage(Map values) { Object description = values.get(DESCRIPTION); if (description instanceof String) { return (String) description; - } else if (description instanceof Map){ + } else if (description instanceof Map) { @SuppressWarnings("unchecked") PasswordStrengthErrorParser policy = new PasswordStrengthErrorParser((Map) description); return policy.getDescription(); diff --git a/src/main/java/com/auth0/exception/PasswordStrengthErrorParser.java b/src/main/java/com/auth0/exception/PasswordStrengthErrorParser.java index 6aac382e1..7c3d0884b 100644 --- a/src/main/java/com/auth0/exception/PasswordStrengthErrorParser.java +++ b/src/main/java/com/auth0/exception/PasswordStrengthErrorParser.java @@ -71,7 +71,8 @@ private String asContainsCharset(Map rule) { if (rule.containsKey(KEY_FORMAT)) { List quantity = (List) rule.get(KEY_FORMAT); - message = String.format(message, quantity.get(0).intValue(), quantity.get(1).intValue()); + message = String.format( + message, quantity.get(0).intValue(), quantity.get(1).intValue()); } return String.format("%s %s", message, requiredItems); diff --git a/src/main/java/com/auth0/exception/PublicKeyProviderException.java b/src/main/java/com/auth0/exception/PublicKeyProviderException.java index b9f751612..47999231f 100644 --- a/src/main/java/com/auth0/exception/PublicKeyProviderException.java +++ b/src/main/java/com/auth0/exception/PublicKeyProviderException.java @@ -1,6 +1,5 @@ package com.auth0.exception; - /** * Represents an error when attempting to retrieve a public key. * @see com.auth0.utils.tokens.PublicKeyProvider @@ -26,5 +25,4 @@ public PublicKeyProviderException(String message) { public PublicKeyProviderException(String message, Throwable cause) { super(message, cause); } - } diff --git a/src/main/java/com/auth0/exception/RateLimitException.java b/src/main/java/com/auth0/exception/RateLimitException.java index 9d2a15a77..a9d1ea99b 100644 --- a/src/main/java/com/auth0/exception/RateLimitException.java +++ b/src/main/java/com/auth0/exception/RateLimitException.java @@ -1,7 +1,6 @@ package com.auth0.exception; import com.auth0.net.TokenQuotaBucket; - import java.util.Map; /** @@ -166,8 +165,8 @@ public Builder values(Map values) { public RateLimitException build() { RateLimitException exception = (this.values != null) - ? new RateLimitException(this.limit, this.remaining, this.reset, this.values) - : new RateLimitException(this.limit, this.remaining, this.reset); + ? new RateLimitException(this.limit, this.remaining, this.reset, this.values) + : new RateLimitException(this.limit, this.remaining, this.reset); exception.clientQuotaLimit = this.clientQuotaLimit; exception.organizationQuotaLimit = this.organizationQuotaLimit; @@ -176,5 +175,4 @@ public RateLimitException build() { return exception; } } - } diff --git a/src/main/java/com/auth0/json/auth/BackChannelAuthorizeResponse.java b/src/main/java/com/auth0/json/auth/BackChannelAuthorizeResponse.java index 1765867d5..01a6807a3 100644 --- a/src/main/java/com/auth0/json/auth/BackChannelAuthorizeResponse.java +++ b/src/main/java/com/auth0/json/auth/BackChannelAuthorizeResponse.java @@ -7,13 +7,18 @@ public class BackChannelAuthorizeResponse { @JsonProperty("auth_req_id") private String authReqId; + @JsonProperty("expires_in") private Long expiresIn; + @JsonProperty("interval") private Integer interval; @JsonCreator - public BackChannelAuthorizeResponse(@JsonProperty("auth_req_id") String authReqId, @JsonProperty("expires_in") Long expiresIn, @JsonProperty("interval") Integer interval) { + public BackChannelAuthorizeResponse( + @JsonProperty("auth_req_id") String authReqId, + @JsonProperty("expires_in") Long expiresIn, + @JsonProperty("interval") Integer interval) { this.authReqId = authReqId; this.expiresIn = expiresIn; this.interval = interval; diff --git a/src/main/java/com/auth0/json/auth/BackChannelTokenResponse.java b/src/main/java/com/auth0/json/auth/BackChannelTokenResponse.java index ab632f98c..2eaae5125 100644 --- a/src/main/java/com/auth0/json/auth/BackChannelTokenResponse.java +++ b/src/main/java/com/auth0/json/auth/BackChannelTokenResponse.java @@ -9,10 +9,13 @@ public class BackChannelTokenResponse { @JsonProperty("access_token") private String accessToken; + @JsonProperty("id_token") private String idToken; + @JsonProperty("expires_in") private long expiresIn; + @JsonProperty("scope") private String scope; diff --git a/src/main/java/com/auth0/json/auth/CreatedOobResponse.java b/src/main/java/com/auth0/json/auth/CreatedOobResponse.java index b58d24e1b..32cc11aa9 100644 --- a/src/main/java/com/auth0/json/auth/CreatedOobResponse.java +++ b/src/main/java/com/auth0/json/auth/CreatedOobResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/com/auth0/json/auth/CreatedOtpResponse.java b/src/main/java/com/auth0/json/auth/CreatedOtpResponse.java index 72f739be3..c24a35bbb 100644 --- a/src/main/java/com/auth0/json/auth/CreatedOtpResponse.java +++ b/src/main/java/com/auth0/json/auth/CreatedOtpResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) @@ -37,5 +36,4 @@ public String getAuthenticatorType() { public List getRecoveryCodes() { return recoveryCodes; } - } diff --git a/src/main/java/com/auth0/json/auth/CreatedUser.java b/src/main/java/com/auth0/json/auth/CreatedUser.java index c2d0b6ef7..4ef0f598b 100644 --- a/src/main/java/com/auth0/json/auth/CreatedUser.java +++ b/src/main/java/com/auth0/json/auth/CreatedUser.java @@ -16,12 +16,16 @@ public class CreatedUser { @JsonProperty("_id") @JsonAlias({"_id", "id", "user_id"}) private String userId; + @JsonProperty("email") private String email; + @JsonProperty("username") private String username; + @JsonProperty("email_verified") private Boolean emailVerified; + @JsonProperty("phone_number") private String phoneNumber; diff --git a/src/main/java/com/auth0/json/auth/PasswordlessEmailResponse.java b/src/main/java/com/auth0/json/auth/PasswordlessEmailResponse.java index d122725fb..16e6f85fc 100644 --- a/src/main/java/com/auth0/json/auth/PasswordlessEmailResponse.java +++ b/src/main/java/com/auth0/json/auth/PasswordlessEmailResponse.java @@ -13,8 +13,10 @@ public class PasswordlessEmailResponse { @JsonProperty("_id") private String id; + @JsonProperty("email") private String email; + @JsonProperty("email_verified") private Boolean emailVerified; diff --git a/src/main/java/com/auth0/json/auth/PasswordlessSmsResponse.java b/src/main/java/com/auth0/json/auth/PasswordlessSmsResponse.java index e9504d36e..0ef6ed985 100644 --- a/src/main/java/com/auth0/json/auth/PasswordlessSmsResponse.java +++ b/src/main/java/com/auth0/json/auth/PasswordlessSmsResponse.java @@ -12,10 +12,13 @@ public class PasswordlessSmsResponse { @JsonProperty("_id") private String id; + @JsonProperty("phone_number") private String phoneNumber; + @JsonProperty("phone_verified") private Boolean phoneVerified; + @JsonProperty("request_language") private String requestLanguage; diff --git a/src/main/java/com/auth0/json/auth/PushedAuthorizationResponse.java b/src/main/java/com/auth0/json/auth/PushedAuthorizationResponse.java index 347d0c4e6..e9e553ed2 100644 --- a/src/main/java/com/auth0/json/auth/PushedAuthorizationResponse.java +++ b/src/main/java/com/auth0/json/auth/PushedAuthorizationResponse.java @@ -14,11 +14,13 @@ public class PushedAuthorizationResponse { @JsonProperty("request_uri") private String requestURI; + @JsonProperty("expires_in") private Integer expiresIn; @JsonCreator - public PushedAuthorizationResponse(@JsonProperty("request_uri") String requestURI, @JsonProperty("expires_in") Integer expiresIn) { + public PushedAuthorizationResponse( + @JsonProperty("request_uri") String requestURI, @JsonProperty("expires_in") Integer expiresIn) { this.requestURI = requestURI; this.expiresIn = expiresIn; } diff --git a/src/main/java/com/auth0/json/auth/TokenHolder.java b/src/main/java/com/auth0/json/auth/TokenHolder.java index d2227b948..3df0638f2 100644 --- a/src/main/java/com/auth0/json/auth/TokenHolder.java +++ b/src/main/java/com/auth0/json/auth/TokenHolder.java @@ -1,7 +1,6 @@ package com.auth0.json.auth; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - import java.util.Date; /** @@ -23,7 +22,14 @@ public class TokenHolder { @SuppressWarnings("unused") public TokenHolder() {} - public TokenHolder(String accessToken, String idToken, String refreshToken, String tokenType, long expiresIn, String scope, Date expiresAt) { + public TokenHolder( + String accessToken, + String idToken, + String refreshToken, + String tokenType, + long expiresIn, + String scope, + Date expiresAt) { this.accessToken = accessToken; this.idToken = idToken; this.refreshToken = refreshToken; @@ -97,5 +103,4 @@ public Date getExpiresAt() { public String getScope() { return scope; } - } diff --git a/src/main/java/com/auth0/json/auth/TokenHolderDeserializer.java b/src/main/java/com/auth0/json/auth/TokenHolderDeserializer.java index c4cf42973..b6d34ed44 100644 --- a/src/main/java/com/auth0/json/auth/TokenHolderDeserializer.java +++ b/src/main/java/com/auth0/json/auth/TokenHolderDeserializer.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; - import java.io.IOException; import java.time.Instant; import java.util.Date; @@ -26,7 +25,8 @@ public TokenHolderDeserializer(Class clazz) { } @Override - public TokenHolder deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public TokenHolder deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode node = p.getCodec().readTree(p); JsonNode accessTokenNode = node.get("access_token"); @@ -37,13 +37,13 @@ public TokenHolder deserialize(JsonParser p, DeserializationContext ctxt) throws JsonNode expiresInNode = node.get("expires_in"); String accessToken = accessTokenNode != null ? accessTokenNode.asText() : null; - String idToken = idTokenNode != null ? idTokenNode.asText() : null; + String idToken = idTokenNode != null ? idTokenNode.asText() : null; String refreshToken = refreshTokenNode != null ? refreshTokenNode.asText() : null; - String tokenType = tokenTypeNode != null ? tokenTypeNode.asText() : null; - String scope = scopeNode != null ? scopeNode.asText() : null; + String tokenType = tokenTypeNode != null ? tokenTypeNode.asText() : null; + String scope = scopeNode != null ? scopeNode.asText() : null; // As a primitive, if expires_in is not sent on the response, value will be 0 instead of null - long expiresIn = expiresInNode != null ? expiresInNode.asLong() : 0L; + long expiresIn = expiresInNode != null ? expiresInNode.asLong() : 0L; Date expiresAt = expiresInNode != null ? Date.from(Instant.now().plusSeconds(expiresIn)) : null; return new TokenHolder(accessToken, idToken, refreshToken, tokenType, expiresIn, scope, expiresAt); diff --git a/src/main/java/com/auth0/json/auth/UserInfo.java b/src/main/java/com/auth0/json/auth/UserInfo.java index 01683aa25..118012eeb 100644 --- a/src/main/java/com/auth0/json/auth/UserInfo.java +++ b/src/main/java/com/auth0/json/auth/UserInfo.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - import java.io.Serializable; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/auth0/json/mgmt/Page.java b/src/main/java/com/auth0/json/mgmt/Page.java deleted file mode 100644 index 65c5f20cf..000000000 --- a/src/main/java/com/auth0/json/mgmt/Page.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.auth0.json.mgmt; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents a paginated list of objects. - * - * @param the type of the object this page contains. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public abstract class Page { - - @JsonProperty("start") - private Integer start; - @JsonProperty("length") - private Integer length; - @JsonProperty("total") - private Integer total; - @JsonProperty("limit") - private Integer limit; - @JsonProperty("next") - private String next; - private final List items; - - public Page(List items) { - this.items = items; - } - - public Page(Integer start, Integer length, Integer total, Integer limit, List items) { - this(start, length, total, limit, null, items); - } - - public Page(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - this.start = start; - this.length = length; - this.total = total; - this.limit = limit; - this.next = next; - this.items = items; - } - - /** - * Getter for the position of the item this page starts from. - * - * @return the start value. - */ - @JsonProperty("start") - public Integer getStart() { - return start; - } - - /** - * Getter for the amount of items per page. - * - * @return the length value. - */ - @JsonProperty("length") - public Integer getLength() { - return length; - } - - /** - * Getter for the total amount of items. - * - * @return the total value. - */ - @JsonProperty("total") - public Integer getTotal() { - return total; - } - - /** - * Getter for the items amount limit. - * - * @return the limit value. - */ - @JsonProperty("limit") - public Integer getLimit() { - return limit; - } - - /** - * Getter for the next value, if using checkpoint pagination, which can be used to fetch the next page of results. - * @return the next value. - */ - @JsonProperty("next") - public String getNext() { - return next; - } - - /** - * Getter for the list of items. - * - * @return the list of items. - */ - public List getItems() { - return items; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/PageDeserializer.java b/src/main/java/com/auth0/json/mgmt/PageDeserializer.java deleted file mode 100644 index 63994f71a..000000000 --- a/src/main/java/com/auth0/json/mgmt/PageDeserializer.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.ObjectMapperProvider; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.type.CollectionType; - -import java.io.IOException; -import java.util.List; - -/** - * Parses a given paged response into their page pojo representation. - *

- * This class is thread-safe. - * - * @param the class that represents a page of U. - * @param the class that represents the items in the page. - */ -public abstract class PageDeserializer extends StdDeserializer { - - private final String itemsPropertyName; - private final Class uClazz; - - protected PageDeserializer(Class clazz, String arrayName) { - super(Object.class); - this.uClazz = clazz; - this.itemsPropertyName = arrayName; - } - - @Override - public T deserialize(JsonParser p, DeserializationContext ctx) throws IOException { - JsonNode node = p.getCodec().readTree(p); - if (node.isArray()) { - return createPage(getArrayElements((ArrayNode) node)); - } - - Integer start = getIntegerValue(node.get("start")); - Integer length = getIntegerValue(node.get("length")); - Integer total = getIntegerValue(node.get("total")); - Integer limit = getIntegerValue(node.get("limit")); - - // "next" field is sent when using checkpoint pagination on APIs that support it. It will be null when - // end of pages reached, or if offset paging is used - String next = getStringValue(node.get("next")); - ArrayNode array = (ArrayNode) node.get(itemsPropertyName); - - return createPage(start, length, total, limit, next, getArrayElements(array)); - } - - protected abstract T createPage(List items); - - protected abstract T createPage(Integer start, Integer length, Integer total, Integer limit, List items); - - /** - * Creates a new page result.
- * By default, this method delegates to {@linkplain PageDeserializer#createPage(Integer, Integer, Integer, Integer, List)}, - * to preserve backwards-compatibility for implementors. If an API supports checkpoint pagination, the specific - * deserializer implementation must override this method and construct the Page to populate the "next" field. - */ - protected T createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return createPage(start, length, total, limit, items); - } - - private Integer getIntegerValue(JsonNode node) { - if (node == null || node.isNull()) { - return null; - } else { - return node.intValue(); - } - } - - private String getStringValue(JsonNode node) { - if (node == null || node.isNull()) { - return null; - } else { - return node.textValue(); - } - } - - private List getArrayElements(ArrayNode array) throws IOException { - CollectionType type = ObjectMapperProvider.getMapper().getTypeFactory().constructCollectionType(List.class, uClazz); - return ObjectMapperProvider.getMapper().readerFor(type).readValue(array); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Action.java b/src/main/java/com/auth0/json/mgmt/actions/Action.java deleted file mode 100644 index 1a3494480..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Action.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.*; - -import java.util.Date; -import java.util.List; - -/** - * Represents the Action entity. - * - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Action { - - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("supported_triggers") - private List supportedTriggers; - @JsonProperty("code") - private String code; - @JsonProperty("dependencies") - private List dependencies; - @JsonProperty("runtime") - private String runtime; - @JsonProperty("secrets") - private List secrets; - @JsonProperty("deployed_version") - private Version deployedVersion; - @JsonProperty("status") - private String status; - @JsonProperty("all_changes_deployed") - private Boolean allChangesDeployed; - @JsonProperty("created_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date updatedAt; - - /** - * Create a new instance. - * @param name the name of the action - * @param supportedTriggers the action's supported triggers - */ - @JsonCreator - public Action(@JsonProperty("name") String name, @JsonProperty("supported_triggers") List supportedTriggers) { - this.name = name; - this.supportedTriggers = supportedTriggers; - } - - /** - * Create a new instance. - */ - public Action() {} - - /** - * @return the supported triggers for this action. - */ - public List getSupportedTriggers() { - return this.supportedTriggers; - } - - /** - * Set the supported triggers for this action. - * - * @param supportedTriggers the supported triggers. - */ - public void setSupportedTriggers(List supportedTriggers) { - this.supportedTriggers = supportedTriggers; - } - - /** - * @return the ID of this action. - */ - public String getId() { - return this.id; - } - - /** - * Sets the name of this action. - * @param name the name of the action. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the name of this action. - */ - public String getName() { - return this.name; - } - - /** - * @return the created at date of this action. - */ - public Date getCreatedAt() { - return this.createdAt; - } - - /** - * @return the updated at date of this action. - */ - public Date getUpdatedAt() { - return this.updatedAt; - } - - /** - * @return the code of this action. - */ - public String getCode() { - return this.code; - } - - /** - * Sets the code of this action. - * @param code the code of this action. - */ - public void setCode(String code) { - this.code = code; - } - - /** - * @return the dependencies of this action. - */ - public List getDependencies() { - return this.dependencies; - } - - /** - * Sets the dependencies of this action. - * @param dependencies the dependencies of this action. - */ - public void setDependencies(List dependencies) { - this.dependencies = dependencies; - } - - /** - * @return the runtime of this action. - */ - public String getRuntime() { - return this.runtime; - } - - /** - * Sets the runtime of this action. - * @param runtime the runtime of this action. - */ - public void setRuntime(String runtime) { - this.runtime = runtime; - } - - /** - * @return the status of this action. - */ - public String getStatus() { - return this.status; - } - - /** - * @return the secrets of this action. - */ - public List getSecrets() { - return this.secrets; - } - - /** - * Sets the secrets of this action. - * @param secrets the secrets of this action. - */ - public void setSecrets(List secrets) { - this.secrets = secrets; - } - - /** - * @return whether all changes have been deployed for this action. - */ - public Boolean getAllChangesDeployed() { - return this.allChangesDeployed; - } - - /** - * @return the deployed version of this action. - */ - public Version getDeployedVersion() { - return this.deployedVersion; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/ActionsPage.java b/src/main/java/com/auth0/json/mgmt/actions/ActionsPage.java deleted file mode 100644 index 97b4f6b49..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/ActionsPage.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of an Action. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ActionsPageDeserializer.class) -public class ActionsPage extends Page { - public ActionsPage(List items) { - super(items); - } - - public ActionsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public ActionsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/ActionsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/actions/ActionsPageDeserializer.java deleted file mode 100644 index d885061ef..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/ActionsPageDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain ActionsPage} representation. - */ -public class ActionsPageDeserializer extends PageDeserializer { - - protected ActionsPageDeserializer() { - super(Action.class, "actions"); - } - - @Override - protected ActionsPage createPage(List items) { - return new ActionsPage(items); - } - - @Override - protected ActionsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new ActionsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Binding.java b/src/main/java/com/auth0/json/mgmt/actions/Binding.java deleted file mode 100644 index 831b18fb4..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Binding.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Represents an action binding. - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Binding { - @JsonProperty("id") - private String id; - @JsonProperty("trigger_id") - private String triggerId; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("action") - private Action action; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date updatedAt; - - /** - * @return the ID of this binding - */ - public String getId() { - return id; - } - - /** - * @return the ID the trigger associated with this binding - */ - public String getTriggerId() { - return triggerId; - } - - /** - * @return the name of this binding - */ - public String getDisplayName() { - return displayName; - } - - /** - * @return the action associated with this binding - */ - public Action getAction() { - return action; - } - - /** - * @return the time when this binding was created - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return the time when this binding was updated - */ - public Date getUpdatedAt() { - return updatedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/BindingActionReference.java b/src/main/java/com/auth0/json/mgmt/actions/BindingActionReference.java deleted file mode 100644 index b9360f0ce..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/BindingActionReference.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an action to bind to a trigger when updating a trigger's binding. - * @see BindingUpdate - * @see BindingsUpdateRequest - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BindingActionReference { - - @JsonProperty("type") - private String type; - @JsonProperty("value") - private String value; - - /** - * Create a new instance. - * - * @param type the type of action reference that will be used for the value, e.g., "action_name" or "action_id". - * @param value the value of the action reference. This is used along with the {@code type} parameter to associate an action. - * For example, {@code new BindingActionReference("action_id", "abc")} would create a binding reference - * to the action with ID "abc". - */ - @JsonCreator - public BindingActionReference(@JsonProperty("type") String type, - @JsonProperty("value") String value) { - this.type = type; - this.value = value; - } - - /** - * @return the reference type. - */ - public String getType() { - return type; - } - - /** - * @return the reference value. - */ - public String getValue() { - return value; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/BindingUpdate.java b/src/main/java/com/auth0/json/mgmt/actions/BindingUpdate.java deleted file mode 100644 index 308f149c5..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/BindingUpdate.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents a trigger binding object when updating a trigger's action bindings. - * @see BindingsUpdateRequest - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BindingUpdate { - - @JsonProperty("ref") - private BindingActionReference bindingActionReference; - @JsonProperty("display_name") - private String displayName; - - /** - * Creates a new instance. - * - * @param bindingActionReference the action bindings reference. - */ - @JsonCreator - public BindingUpdate(@JsonProperty("ref") BindingActionReference bindingActionReference) { - this.bindingActionReference = bindingActionReference; - } - - /** - * @return the binding action references associated with this instance. - */ - public BindingActionReference getBindingActionReference() { - return bindingActionReference; - } - - /** - * Sets the display name of this binding reference. - * - * @param displayName the display name of this binding reference. - */ - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * @return the display name of this binding reference. - */ - public String getDisplayName() { - return displayName; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/BindingsPage.java b/src/main/java/com/auth0/json/mgmt/actions/BindingsPage.java deleted file mode 100644 index 14b98d62a..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/BindingsPage.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of an action trigger binding. - * @see Binding - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = BindingsPageDeserializer.class) -public class BindingsPage extends Page { - public BindingsPage(List items) { - super(items); - } - - public BindingsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public BindingsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/BindingsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/actions/BindingsPageDeserializer.java deleted file mode 100644 index b6b89e4d2..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/BindingsPageDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain ActionsPage} representation. - */ -public class BindingsPageDeserializer extends PageDeserializer { - - protected BindingsPageDeserializer() { - super(Binding.class, "bindings"); - } - - @Override - protected BindingsPage createPage(List items) { - return new BindingsPage(items); - } - - @Override - protected BindingsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new BindingsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/BindingsUpdateRequest.java b/src/main/java/com/auth0/json/mgmt/actions/BindingsUpdateRequest.java deleted file mode 100644 index 2339d1891..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/BindingsUpdateRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the request body when updating a trigger's action bindings. - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BindingsUpdateRequest { - - @JsonProperty("bindings") - private List bindingUpdates; - - /** - * Creates a new instance - * - * @param bindingUpdates a list of binding updates - */ - @JsonCreator - public BindingsUpdateRequest(@JsonProperty("bindings") List bindingUpdates) { - this.bindingUpdates = bindingUpdates; - } - - /** - * @return the binding updates associated with this instance. - */ - public List getBindingUpdates() { - return bindingUpdates; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Dependency.java b/src/main/java/com/auth0/json/mgmt/actions/Dependency.java deleted file mode 100644 index 4f6b84232..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Dependency.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an Action's dependencies. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Dependency { - - @JsonProperty("name") - private String name; - @JsonProperty("version") - private String version; - @JsonProperty("registry_url") - private String registryUrl; - - /** - * Creates a new instance. - * @param name the name of this dependency, e.g., "lodash" - * @param version the version of this dependency, e.g., 4.17.1 - */ - @JsonCreator - public Dependency(@JsonProperty("name") String name, @JsonProperty("version") String version) { - this.name = name; - this.version = version; - } - - /** - * Creates a new dependency - */ - public Dependency() {} - - /** - * @return the name of this dependency. - */ - public String getName() { - return name; - } - - /** - * Sets the name of this dependency. - * @param name the name of this dependency, e.g., "lodash" - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the version of this dependency. - */ - public String getVersion() { - return version; - } - - /** - * Sets the version of this dependency. - * @param version the version of this dependency, e.g., 4.17.1 - */ - public void setVersion(String version) { - this.version = version; - } - - /** - * @return the registry URL of this dependency. - */ - public String getRegistryUrl() { - return registryUrl; - } - - /** - * Sets the registry URL of this dependency. This is optional, and primarily used for private npm modules. - * @param registryUrl the registry URL of this dependency. - */ - public void setRegistryUrl(String registryUrl) { - this.registryUrl = registryUrl; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Error.java b/src/main/java/com/auth0/json/mgmt/actions/Error.java deleted file mode 100644 index 399c63a10..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Error.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an error of an Action execution. - * @see Execution - * @see ExecutionResult - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Error { - - @JsonProperty("id") - private String id; - @JsonProperty("msg") - private String message; - @JsonProperty("url") - private String url; - - /** - * @return the ID of this error - */ - public String getId() { - return id; - } - - /** - * @return the message of this error - */ - public String getMessage() { - return message; - } - - /** - * @return the URL of this error - */ - public String getUrl() { - return url; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Execution.java b/src/main/java/com/auth0/json/mgmt/actions/Execution.java deleted file mode 100644 index a75dfb07e..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Execution.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; -import java.util.List; - -/** - * Represents an action's execution. - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Execution { - - @JsonProperty("id") - private String id; - @JsonProperty("trigger_id") - private String triggerId; - @JsonProperty("status") - private String status; - @JsonProperty("created_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date updatedAt; - @JsonProperty("results") - private List results; - - /** - * @return the ID that identifies this execution - */ - public String getId() { - return id; - } - - /** - * @return the trigger ID associated with this execution - */ - public String getTriggerId() { - return triggerId; - } - - /** - * @return the status associated with this execution - */ - public String getStatus() { - return status; - } - - /** - * @return the time this execution was started - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return the time this execution finished executing - */ - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * @return the results of this execution - */ - public List getResults() { - return results; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/ExecutionResult.java b/src/main/java/com/auth0/json/mgmt/actions/ExecutionResult.java deleted file mode 100644 index 65708eaed..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/ExecutionResult.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Represents the result of an action execution. - * @see Execution - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ExecutionResult { - - @JsonProperty("error") - private Error error; - @JsonProperty("action_name") - private String actionName; - @JsonProperty("started_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - Date startedAt; - @JsonProperty("ended_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date endedAt; - - /** - * @return the error of this execution, if applicable - */ - public Error getError() { - return error; - } - - /** - * @return the name of the action that was executed - */ - public String getActionName() { - return actionName; - } - - /** - * @return the time when the execution started - */ - public Date getStartedAt() { - return startedAt; - } - - /** - * @return the time when the execution completed - */ - public Date getEndedAt() { - return endedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Secret.java b/src/main/java/com/auth0/json/mgmt/actions/Secret.java deleted file mode 100644 index 5e90ecbb6..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Secret.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.*; - -import java.util.Date; - -/** - * Represents a secret of an action. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Secret { - - @JsonProperty("name") - private String name; - @JsonProperty("value") - private String value; - @JsonProperty("updated_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date updatedAt; - - /** - * Creates a new instance. - * @param name the name of the secret, e.g., "API_KEY" - * @param value the value of the secret. - */ - @JsonCreator - public Secret(@JsonProperty("name") String name, @JsonProperty("value") String value) { - this.name = name; - this.value = value; - } - - /** - * @return the name of this secret. - */ - public String getName() { - return this.name; - } - - /** - * Sets the name of this secret. - * @param name the name of the secret, e.g., "API_KEY" - */ - public void setName(String name) { - this.name = name; - } - - /** - * Get the value of this secret. - *

- * Secret values will never be returned by the API. This will only return a value if the instance is being - * used to create or update a secret. - *

- * @return the value of this secret. - */ - public String getValue() { - return this.value; - } - - /** - * Sets the value of this secret. - * @param value the value of this secret. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * @return the date this secret was updated at. - */ - public Date getUpdatedAt() { - return this.updatedAt; - } - - -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/ServiceStatus.java b/src/main/java/com/auth0/json/mgmt/actions/ServiceStatus.java deleted file mode 100644 index bb48bc360..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/ServiceStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the status of the actions service. - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ServiceStatus { - - @JsonProperty("status") - private String status; - - /** - * @return the status of the actions service. - */ - public String getStatus() { - return status; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Trigger.java b/src/main/java/com/auth0/json/mgmt/actions/Trigger.java deleted file mode 100644 index 52d4a61b0..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Trigger.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents an action's trigger. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Trigger { - - @JsonProperty("id") - private String id; - @JsonProperty("version") - private String version; - @JsonProperty("status") - private String status; - @JsonProperty("runtimes") - private List runtimes; - @JsonProperty("default_runtime") - private String defaultRuntime; - - /** - * @return the ID of this trigger, which represents the type of this trigger. - */ - public String getId() { - return id; - } - - /** - * Sets the ID of this trigger. - * - * @param id the ID of this trigger, which represents the type of this trigger. - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the version of this trigger. - */ - public String getVersion() { - return version; - } - - /** - * Sets the version of this trigger. - * - * @param version the version of this trigger. - */ - public void setVersion(String version) { - this.version = version; - } - - /** - * @return the status of this trigger. - */ - public String getStatus() { - return status; - } - - /** - * Sets the status of this trigger. - * - * @param status the status of this trigger. - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * @return the runtimes supported by this trigger. - */ - public List getRuntimes() { - return runtimes; - } - - /** - * Sets the runtimes supported by this trigger. - * @param runtimes the runtimes supported by this trigger. - */ - public void setRuntimes(List runtimes) { - this.runtimes = runtimes; - } - - /** - * @return the default runtime of this trigger. - */ - public String getDefaultRuntime() { - return defaultRuntime; - } - - /** - * Sets the default runtime of this trigger. - * @param defaultRuntime the default runtime of this trigger. - */ - public void setDefaultRuntime(String defaultRuntime) { - this.defaultRuntime = defaultRuntime; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Triggers.java b/src/main/java/com/auth0/json/mgmt/actions/Triggers.java deleted file mode 100644 index 8e5817623..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Triggers.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the triggers of an action. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Triggers { - - @JsonProperty("triggers") - private List triggers; - - /** - * @return the list of triggers - */ - public List getTriggers() { - return this.triggers; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/Version.java b/src/main/java/com/auth0/json/mgmt/actions/Version.java deleted file mode 100644 index 7a6768174..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/Version.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; -import java.util.List; - -/** - * Represents a version of an action. - * @see Action - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Version { - - @JsonProperty("id") - private String id; - @JsonProperty("code") - private String code; - @JsonProperty("dependencies") - private List dependencies; - @JsonProperty("deployed") - private Boolean deployed; - @JsonProperty("runtime") - private String runtime; - @JsonProperty("secrets") - private List secrets; - @JsonProperty("status") - private String status; - @JsonProperty("number") - private Integer number; - @JsonProperty("errors") - private List errors; - @JsonProperty("action") - private Action action; - @JsonProperty("built_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date builtAt; - @JsonProperty("created_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date createdAt; - @JsonProperty("updated_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date updatedAt; - - /** - * @return the code for this action version. - */ - public String getCode() { - return code; - } - - /** - * @return the dependencies for this action version - */ - public List getDependencies() { - return dependencies; - } - - /** - * @return whether this action version is deployed or not. - */ - public Boolean isDeployed() { - return deployed; - } - - /** - * @return the runtime for this action version. - */ - public String getRuntime() { - return runtime; - } - - /** - * @return the secrets for this action version. - */ - public List getSecrets() { - return secrets; - } - - /** - * @return the status for this action version. - */ - public String getStatus() { - return status; - } - - /** - * @return the index of this version in the list of versions for the action. - */ - public Integer getNumber() { - return number; - } - - /** - * @return any errors that occurred while this action version was being built. - */ - public List getErrors() { - return errors; - } - - /** - * @return the date when this version was built successfully. - */ - public Date getBuiltAt() { - return builtAt; - } - - /** - * @return the date when this action version was created. - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return the date when this action version was updated. - */ - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * @return the ID of this action version. - */ - public String getId() { - return id; - } - - /** - * @return the action to which this version belongs. - */ - public Action getAction() { - return action; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/VersionsPage.java b/src/main/java/com/auth0/json/mgmt/actions/VersionsPage.java deleted file mode 100644 index a801b073b..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/VersionsPage.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of an action's versions. - * @see Version - * @see com.auth0.client.mgmt.ActionsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = VersionsPageDeserializer.class) -public class VersionsPage extends Page { - - public VersionsPage(List items) { - super(items); - } - - public VersionsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public VersionsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/actions/VersionsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/actions/VersionsPageDeserializer.java deleted file mode 100644 index 67d3bc111..000000000 --- a/src/main/java/com/auth0/json/mgmt/actions/VersionsPageDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain VersionsPage} representation. - */ -public class VersionsPageDeserializer extends PageDeserializer { - - protected VersionsPageDeserializer() { - super(Version.class, "versions"); - } - - @Override - protected VersionsPage createPage(List items) { - return new VersionsPage(items); - } - - @Override - protected VersionsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new VersionsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPassword.java b/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPassword.java deleted file mode 100644 index 53b1caed9..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPassword.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the Breached Password entity. - * - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BreachedPassword { - - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("method") - private String method; - @JsonProperty("shields") - private List shields; - @JsonProperty("admin_notification_frequency") - private List adminNotificationFrequency; - @JsonProperty("stage") - private BreachedPasswordStage stage; - - /** - * @return whether or not breached password detection is active. - */ - public Boolean getEnabled() { - return enabled; - } - - /** - * Sets whether or not breached password detection is active. - * @param enabled whether or not breached password detection is active. - */ - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * @return the subscription level for breached password detection methods. - */ - public String getMethod() { - return method; - } - - /** - * Sets the subscription level for breached password detection methods. - * @param method the subscription level for breached password detection methods. - */ - public void setMethod(String method) { - this.method = method; - } - - /** - * @return the action to take when a breached password is detected. - */ - public List getShields() { - return shields; - } - - /** - * Sets the action to take when a breached password is detected. - * @param shields the action to take when a breached password is detected. - */ - public void setShields(List shields) { - this.shields = shields; - } - - /** - * @return the frequency email notifications are sent. - */ - public List getAdminNotificationFrequency() { - return adminNotificationFrequency; - } - - /** - * Sets the frequency email notifications are sent. - * @param adminNotificationFrequency the frequency email notifications are sent. - */ - public void setAdminNotificationFrequency(List adminNotificationFrequency) { - this.adminNotificationFrequency = adminNotificationFrequency; - } - - /** - * @return the per-stage configuration options - */ - public BreachedPasswordStage getStage() { - return stage; - } - - /** - * Sets the per-stage configuration options. - * @param stage the per-stage configuration options. - */ - public void setStage(BreachedPasswordStage stage) { - this.stage = stage; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStage.java b/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStage.java deleted file mode 100644 index d9b946155..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStage.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the BreachedPassword stage configuration options - * - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BreachedPasswordStage { - - @JsonProperty("pre-user-registration") - BreachedPasswordStageEntry preUserRegistrationStage; - - /** - * Get the pre-user-registration stage entry. - * @return the pre-user-registration stage entry. - */ - public BreachedPasswordStageEntry getPreUserRegistrationStage() { - return preUserRegistrationStage; - } - - /** - * Set the pre-user-registration stage entry. - * @param preUserRegistrationStage the pre-user-registration stage entry. - */ - public void setPreUserRegistrationStage(BreachedPasswordStageEntry preUserRegistrationStage) { - this.preUserRegistrationStage = preUserRegistrationStage; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStageEntry.java b/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStageEntry.java deleted file mode 100644 index 0db6af1b6..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordStageEntry.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the per-stage configuration options for BreachedPasswordStage - * - * @see Stage - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BreachedPasswordStageEntry { - @JsonProperty("shields") - private List shields; - - /** - * Get the shields for this Stage entry - * @return the shields for this Stage entry - */ - public List getShields() { - return shields; - } - - /** - * Sets the shields for this Stage entry - * @param shields the shields for this Stage entry - */ - public void setShields(List shields) { - this.shields = shields; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/BruteForceConfiguration.java b/src/main/java/com/auth0/json/mgmt/attackprotection/BruteForceConfiguration.java deleted file mode 100644 index e1aa55084..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/BruteForceConfiguration.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the Brute Force Configuration - * - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BruteForceConfiguration { - - @JsonProperty("enabled") - Boolean enabled; - @JsonProperty("shields") - List shields; - @JsonProperty("allowlist") - List allowList; - @JsonProperty("mode") - String mode; - @JsonProperty("max_attempts") - Integer maxAttempts; - - /** - * @return whether or not brute force protections are active. - */ - public Boolean getEnabled() { - return enabled; - } - - /** - * Sets whether or not brute force protections are active. - * @param enabled whether or not brute force protections are active. - */ - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * @return the action to take when a brute force configuration threshold is violated. - */ - public List getShields() { - return shields; - } - - /** - * Sets the action to take when a brute force configuration threshold is violated. - * @param shields the action to take when a brute force configuration threshold is violated. - */ - public void setShields(List shields) { - this.shields = shields; - } - - /** - * @return the list of trusted IP addresses that will not have attack protection enforced against them. - */ - public List getAllowList() { - return allowList; - } - - /** - * Sets the list of trusted IP addresses that will not have attack protection enforced against them. - * @param allowList the list of trusted IP addresses that will not have attack protection enforced against them. - */ - public void setAllowList(List allowList) { - this.allowList = allowList; - } - - /** - * @return gets the account lockout mode; determines whether or not IP address is used when counting failed attempts. - */ - public String getMode() { - return mode; - } - - /** - * Sets the account lockout mode; determines whether or not IP address is used when counting failed attempts. - * @param mode the account lockout mode; determines whether or not IP address is used when counting failed attempts. - */ - public void setMode(String mode) { - this.mode = mode; - } - - /** - * @return the maximum number of unsuccessful attempts. - */ - public Integer getMaxAttempts() { - return maxAttempts; - } - - /** - * Sets the maximum number of unsuccessful attempts. - * @param maxAttempts the maximum number of unsuccessful attempts. - */ - public void setMaxAttempts(Integer maxAttempts) { - this.maxAttempts = maxAttempts; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/Stage.java b/src/main/java/com/auth0/json/mgmt/attackprotection/Stage.java deleted file mode 100644 index ccf73b9f7..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/Stage.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the stage configuration options - * - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Stage { - - @JsonProperty("pre-login") - StageEntry preLoginStage; - @JsonProperty("pre-user-registration") - StageEntry preUserRegistrationStage; - - /** - * Get the pre-login stage entry. - * @return the pre-login stage entry. - */ - public StageEntry getPreLoginStage() { - return preLoginStage; - } - - /** - * Sets the pre-login stage entry. - * @param preLoginStage the pre-login stage entry. - */ - public void setPreLoginStage(StageEntry preLoginStage) { - this.preLoginStage = preLoginStage; - } - - /** - * Get the pre-user-registration stage entry. - * @return the pre-user-registration stage entry. - */ - public StageEntry getPreUserRegistrationStage() { - return preUserRegistrationStage; - } - - /** - * Set the pre-user-registration stage entry. - * @param preUserRegistrationStage the pre-user-registration stage entry. - */ - public void setPreUserRegistrationStage(StageEntry preUserRegistrationStage) { - this.preUserRegistrationStage = preUserRegistrationStage; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/StageEntry.java b/src/main/java/com/auth0/json/mgmt/attackprotection/StageEntry.java deleted file mode 100644 index d1a4b8b4a..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/StageEntry.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the per-stage configuration options - * - * @see Stage - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class StageEntry { - @JsonProperty("max_attempts") - Integer maxAttempts; - @JsonProperty("rate") - Integer rate; - - /** - * @return the max attempts for this Stage entry - */ - public Integer getMaxAttempts() { - return maxAttempts; - } - - /** - * Set the max attempts for this Stage entry - * @param maxAttempts the max attempts for this Stage entry - */ - public void setMaxAttempts(Integer maxAttempts) { - this.maxAttempts = maxAttempts; - } - - /** - * Get the rate for this Stage entry - * @return the rate for this Stage entry - */ - public Integer getRate() { - return rate; - } - - /** - * Sets the rate for this Stage entry - * @param rate the rate for this Stage entry - */ - public void setRate(Integer rate) { - this.rate = rate; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfiguration.java b/src/main/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfiguration.java deleted file mode 100644 index e2b381dba..000000000 --- a/src/main/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfiguration.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the Suspicious IP Throttling Configuration - * - * @see com.auth0.client.mgmt.AttackProtectionEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SuspiciousIPThrottlingConfiguration { - - @JsonProperty("enabled") - Boolean enabled; - @JsonProperty("shields") - private List shields; - @JsonProperty("allowlist") - List allowList; - @JsonProperty("stage") - Stage stage; - - /** - * @return whether or not suspicious IP throttling attack protections are active. - */ - public Boolean getEnabled() { - return enabled; - } - - /** - * Sets whether or not suspicious IP throttling attack protections are active. - * @param enabled whether or not suspicious IP throttling attack protections are active. - */ - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * @return the action to take when a suspicious IP throttling threshold is violated. - */ - public List getShields() { - return shields; - } - - /** - * Sets the action to take when a suspicious IP throttling threshold is violated. - * @param shields the action to take when a suspicious IP throttling threshold is violated. - */ - public void setShields(List shields) { - this.shields = shields; - } - - /** - * @return the per-stage configuration options. - */ - public Stage getStage() { - return stage; - } - - /** - * Sets the per-stage configuration options. - * @param stage the per-stage configuration options. - */ - public void setStage(Stage stage) { - this.stage = stage; - } - - /** - * @return the list of trusted IP addresses that will not have attack protection enforced against them. - */ - public List getAllowList() { - return allowList; - } - - /** - * Sets the list of trusted IP addresses that will not have attack protection enforced against them. - * @param allowList the list of trusted IP addresses that will not have attack protection enforced against them. - */ - public void setAllowList(List allowList) { - this.allowList = allowList; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/blacklists/Token.java b/src/main/java/com/auth0/json/mgmt/blacklists/Token.java deleted file mode 100644 index f8f8543ce..000000000 --- a/src/main/java/com/auth0/json/mgmt/blacklists/Token.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.json.mgmt.blacklists; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Blacklisted Token object. Related to the {@link com.auth0.client.mgmt.BlacklistsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Token { - - @JsonProperty("aud") - private String aud; - @JsonProperty("jti") - private String jti; - - @JsonCreator - public Token(@JsonProperty("jti") String jti) { - this.jti = jti; - } - - /** - * Getter for the JWT's aud claim. This is the client id of the application for which this token was issued. - * - * @return the audience. - */ - @JsonProperty("aud") - public String getAud() { - return aud; - } - - /** - * Setter for the JWT's aud claim. This is the client id of the application for which this token was issued. - * - * @param aud the audience to blacklist. - */ - @JsonProperty("aud") - public void setAud(String aud) { - this.aud = aud; - } - - /** - * Getter for the JWT's jti claim. - * - * @return the audience. - */ - @JsonProperty("jti") - public String getJTI() { - return jti; - } - - /** - * Setter for the JWT's jti to blacklist. - * - * @param jti the jwt identifier to blacklist. - */ - @JsonProperty("jti") - public void setJTI(String jti) { - this.jti = jti; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/branding/BrandingColors.java b/src/main/java/com/auth0/json/mgmt/branding/BrandingColors.java deleted file mode 100644 index 3136ccf51..000000000 --- a/src/main/java/com/auth0/json/mgmt/branding/BrandingColors.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt.branding; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BrandingColors { - @JsonProperty("primary") - private String primary; - @JsonProperty("page_background") - private String pageBackground; - - /** - * Getter for the primary color. - * - * @return the primary color. - */ - @JsonProperty("primary") - public String getPrimary() { - return primary; - } - - /** - * Sets for the primary color. - */ - @JsonProperty("primary") - public void setPrimary(String primary) { - this.primary = primary; - } - - /** - * Getter for the color of the page background. - * - * @return the page background color. - */ - @JsonProperty("page_background") - public String getPageBackground() { - return pageBackground; - } - - /** - * Sets the page background color. - */ - @JsonProperty("page_background") - public void setPageBackground(String pageBackground) { - this.pageBackground = pageBackground; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/branding/BrandingFont.java b/src/main/java/com/auth0/json/mgmt/branding/BrandingFont.java deleted file mode 100644 index 75850a666..000000000 --- a/src/main/java/com/auth0/json/mgmt/branding/BrandingFont.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.branding; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BrandingFont { - @JsonProperty("url") - private String url; - - /** - * Getter for the url of the font. - * - * @return the url. - */ - @JsonProperty("url") - public String getUrl() { - return url; - } - - /** - * Sets the url of the font. - */ - @JsonProperty("url") - public void setUrl(String url) { - this.url = url; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/branding/BrandingSettings.java b/src/main/java/com/auth0/json/mgmt/branding/BrandingSettings.java deleted file mode 100644 index 76740fc54..000000000 --- a/src/main/java/com/auth0/json/mgmt/branding/BrandingSettings.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.auth0.json.mgmt.branding; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BrandingSettings { - @JsonProperty("colors") - private BrandingColors colors; - @JsonProperty("favicon_url") - private String faviconUrl; - @JsonProperty("logo_url") - private String logoUrl; - @JsonProperty("font") - private BrandingFont font; - - /** - * Getter for the colors of the branding. - * - * @return the colors of the branding. - */ - @JsonProperty("colors") - public BrandingColors getColors() { - return colors; - } - - /** - * Sets the colors of the branding. - */ - @JsonProperty("colors") - public void setColors(BrandingColors colors) { - this.colors = colors; - } - - /** - * Getter for the favicon URL. - * - * @return the favicon URL. - */ - @JsonProperty("favicon_url") - public String getFaviconUrl() { - return faviconUrl; - } - - /** - * Sets the favicon URL. - */ - @JsonProperty("favicon_url") - public void setFaviconUrl(String faviconUrl) { - this.faviconUrl = faviconUrl; - } - - /** - * Getter for the logo URL. - * - * @return the logo URL. - */ - @JsonProperty("logo_url") - public String getLogoUrl() { - return logoUrl; - } - - /** - * Sets the logo URL. - */ - @JsonProperty("logo_url") - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - /** - * Getter for the font. - * - * @return the font. - */ - @JsonProperty("font") - public BrandingFont getFont() { - return font; - } - - /** - * Sets the font. - */ - @JsonProperty("font") - public void setFont(BrandingFont font) { - this.font = font; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplate.java b/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplate.java deleted file mode 100644 index f8283f1ec..000000000 --- a/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplate.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.branding; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UniversalLoginTemplate { - @JsonProperty("body") - private String body; - - /** - * Getter for the template body. - * - * @return the template body. - */ - @JsonProperty("body") - public String getBody() { - return body; - } - - /** - * Sets for the body of the template. - */ - @JsonProperty("body") - public void setBody(String body) { - this.body = body; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplateUpdate.java b/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplateUpdate.java deleted file mode 100644 index 7c26d3ad1..000000000 --- a/src/main/java/com/auth0/json/mgmt/branding/UniversalLoginTemplateUpdate.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.branding; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UniversalLoginTemplateUpdate { - @JsonProperty("template") - private String template; - - /** - * Getter for the template body. - * - * @return the template body. - */ - @JsonProperty("template") - public String getTemplate() { - return template; - } - - /** - * Sets for the body of the template. - */ - @JsonProperty("template") - public void setTemplate(String template) { - this.template = template; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/Addon.java b/src/main/java/com/auth0/json/mgmt/client/Addon.java deleted file mode 100644 index bc608d7b1..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Addon.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings("WeakerAccess") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Addon { - - @JsonUnwrapped - @JsonIgnore - private final Map properties; - - public Addon() { - this.properties = new HashMap<>(); - } - - @JsonAnySetter - public void setProperty(String name, Object value) { - properties.put(name, value); - } - - @JsonAnyGetter - public Map getProperties() { - return properties; - } - - public Object getProperty(String name) { - return properties.get(name); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/client/Addons.java b/src/main/java/com/auth0/json/mgmt/client/Addons.java deleted file mode 100644 index d8f104924..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Addons.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Addons { - - @JsonProperty("rms") - private Addon rms; - @JsonProperty("mscrm") - private Addon mscrm; - @JsonProperty("slack") - private Addon slack; - @JsonProperty("layer") - private Addon layer; - - @JsonUnwrapped - @JsonIgnore - private final Map additionalAddons; - - @JsonCreator - public Addons(@JsonProperty("rms") Addon rms, @JsonProperty("mscrm") Addon mscrm, @JsonProperty("slack") Addon slack, @JsonProperty("layer") Addon layer) { - this.additionalAddons = new HashMap<>(); - this.rms = rms; - this.mscrm = mscrm; - this.slack = slack; - this.layer = layer; - } - - @JsonProperty("rms") - public Addon getRMS() { - return rms; - } - - @JsonProperty("rms") - public void setRMS(Addon rms) { - this.rms = rms; - } - - @JsonProperty("mscrm") - public Addon getMSCRM() { - return mscrm; - } - - @JsonProperty("mscrm") - public void setMSCRM(Addon mscrm) { - this.mscrm = mscrm; - } - - @JsonProperty("slack") - public Addon getSlack() { - return slack; - } - - @JsonProperty("slack") - public void setSlack(Addon slack) { - this.slack = slack; - } - - @JsonProperty("layer") - public Addon getLayer() { - return layer; - } - - @JsonProperty("layer") - public void setLayer(Addon layer) { - this.layer = layer; - } - - @JsonAnyGetter - public Map getAdditionalAddons() { - return additionalAddons; - } - - @JsonAnySetter - public void setAdditionalAddon(String name, Addon addon) { - this.additionalAddons.put(name, addon); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/Android.java b/src/main/java/com/auth0/json/mgmt/client/Android.java deleted file mode 100644 index 39f8cb95d..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Android.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Android { - - @JsonProperty("app_package_name") - private String appPackageName; - @JsonProperty("sha256_cert_fingerprints") - private List sha256CertFingerprints; - - @JsonCreator - public Android(@JsonProperty("app_package_name") String appPackageName, @JsonProperty("sha256_cert_fingerprints") List sha256CertFingerprints) { - this.appPackageName = appPackageName; - this.sha256CertFingerprints = sha256CertFingerprints; - } - - /** - * Getter for the Application Package Name, found in the AndroidManifest.xml file. - * - * @return the package name. - */ - @JsonProperty("app_package_name") - public String getAppPackageName() { - return appPackageName; - } - - /** - * Setter for the Application Package Name. - * - * @param appPackageName the package name to set. - */ - @JsonProperty("app_package_name") - public void setAppPackageName(String appPackageName) { - this.appPackageName = appPackageName; - } - - /** - * Getter for the list of allowed SHA256 certificate fingerprints. - * - * @return the list of allowed fingerprints. - */ - @JsonProperty("sha256_cert_fingerprints") - public List getSHA256CertFingerprints() { - return sha256CertFingerprints; - } - - /** - * Setter for the list of allowed SHA256 certificate fingerprints. - * - * @param certFingerprints the list of allowed fingerprints to set. - */ - @JsonProperty("sha256_cert_fingerprints") - public void setSHA256CertFingerprints(List certFingerprints) { - this.sha256CertFingerprints = certFingerprints; - } -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/client/Client.java b/src/main/java/com/auth0/json/mgmt/client/Client.java deleted file mode 100644 index 62147bfde..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Client.java +++ /dev/null @@ -1,963 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * Class that represents an Auth0 Application object. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Client { - - @JsonProperty("name") - private String name; - @JsonProperty("description") - private String description; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("client_secret") - private String clientSecret; - @JsonProperty("app_type") - private String appType; - @JsonProperty("logo_uri") - private String logoUri; - @JsonProperty("is_first_party") - private Boolean isFirstParty; - @JsonProperty("is_token_endpoint_ip_header_trusted") - private Boolean isTokenEndpointIpHeaderTrusted; - @JsonProperty("oidc_conformant") - private Boolean oidcConformant; - @JsonProperty("callbacks") - private List callbacks; - @JsonProperty("allowed_origins") - private List allowedOrigins; - @JsonProperty("web_origins") - private List webOrigins; - @JsonProperty("grant_types") - private List grantTypes; - @JsonProperty("client_aliases") - private List clientAliases; - @JsonProperty("allowed_clients") - private List allowedClients; - @JsonProperty("allowed_logout_urls") - private List allowedLogoutUrls; - @JsonProperty("jwt_configuration") - private JWTConfiguration jwtConfiguration; - @JsonProperty("signing_keys") - private List signingKeys; - @JsonProperty("encryption_key") - private EncryptionKey encryptionKey; - @JsonProperty("sso") - private Boolean sso; - @JsonProperty("sso_disabled") - private Boolean ssoDisabled; - @JsonProperty("custom_login_page_on") - private Boolean customLoginPageOn; - @JsonProperty("is_heroku_app") - private Boolean isHerokuApp; - @JsonProperty("initiate_login_uri") - private String initiateLoginUri; - @JsonProperty("custom_login_page") - private String customLoginPage; - @JsonProperty("custom_login_page_preview") - private String customLoginPagePreview; - @JsonProperty("form_template") - private String formTemplate; - @JsonProperty("addons") - private Addons addons; - @JsonProperty("token_endpoint_auth_method") - private String tokenEndpointAuthMethod; - @JsonProperty("client_metadata") - private Map clientMetadata; - @JsonProperty("mobile") - private Mobile mobile; - @JsonProperty("refresh_token") - private RefreshToken refreshToken; - @JsonProperty("organization_usage") - private String organizationUsage; - @JsonProperty("organization_require_behavior") - private String organizationRequireBehavior; - @JsonProperty("tenant") - private String tenant; - @JsonProperty("global") - private Boolean global; - @JsonProperty("cross_origin_authentication") - private Boolean crossOriginAuth; - @JsonProperty("cross_origin_loc") - private String crossOriginLoc; - @JsonProperty("client_authentication_methods") - private ClientAuthenticationMethods clientAuthenticationMethods; - @JsonProperty("require_pushed_authorization_requests") - private Boolean requiresPushedAuthorizationRequests; - @JsonProperty("oidc_backchannel_logout") - private OIDCBackchannelLogout oidcBackchannelLogout; - @JsonProperty("signed_request_object") - private SignedRequest signedRequest; - @JsonProperty("compliance_level") - private String complianceLevel; - @JsonProperty("require_proof_of_possession") - private Boolean requireProofOfPossession; - @JsonProperty("default_organization") - private ClientDefaultOrganization defaultOrganization; - @JsonProperty("token_quota") - private TokenQuota tokenQuota; - - /** - * Getter for the name of the tenant this client belongs to. - * @return the tenant name - */ - @JsonProperty("tenant") - public String getTenant() { - return tenant; - } - - /** - * Setter for the name of the tenant this client belongs to. - * @param tenant the name of the tenant - */ - @JsonProperty("tenant") - public void setTenant(String tenant) { - this.tenant = tenant; - } - - /** - * Setter whether this is a global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). - * @param global whether legacy tenant or regular client - */ - @JsonProperty("global") - public void setGlobal(Boolean global) { - this.global = global; - } - - /** - * Whether this is a global 'All Applications' client representing legacy tenant settings (true) or a regular client (false). - * @return client representing legacy tenant settings (true) or a regular client (false). - */ - @JsonProperty("global") - public Boolean getGlobal() { - return global; - } - - /** - * Creates a new Application instance setting the name property. - * - * @param name of the application. - */ - @JsonCreator - public Client(@JsonProperty("name") String name) { - this.name = name; - } - - /** - * Creates a new Application instance setting the name and client id properties. - * - * @param name of the application. - * @param clientId the client id of the application. - */ - public Client(String name, String clientId) { - this.name = name; - this.clientId = clientId; - } - - /** - * Getter for the name of the application. - * - * @return the name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Setter for the application name. - * - * @param name the name to use. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the description of the application. - * - * @return the description. - */ - @JsonProperty("description") - public String getDescription() { - return description; - } - - /** - * Setter for the description of the application. - * - * @param description the description to use. - */ - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - /** - * Getter for the application's client id. - * - * @return the application's client id. - */ - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - /** - * Getter for the application's client secret. - * - * @return the application's client secret. - */ - @JsonProperty("client_secret") - public String getClientSecret() { - return clientSecret; - } - - /** - * Setter for the application's client secret. If no secret is provided, it will be generated by the Auth0 Server upon Application creation. - * - * @param clientSecret the secret to use. - */ - @JsonProperty("client_secret") - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - /** - * Getter for the type that this application represents. - * - * @return the application's type. - */ - @JsonProperty("app_type") - public String getAppType() { - return appType; - } - - /** - * Setter for the type that this application represents. - * - * @param appType the application type to set. - */ - @JsonProperty("app_type") - public void setAppType(String appType) { - this.appType = appType; - } - - /** - * Getter for the URI of the application logo. - * - * @return the application's logo URI. - */ - @JsonProperty("logo_uri") - public String getLogoUri() { - return logoUri; - } - - /** - * Setter for the application logo URI. An image with size 150x150 is recommended. - * - * @param logoUri the logo URI to set. - */ - @JsonProperty("logo_uri") - public void setLogoUri(String logoUri) { - this.logoUri = logoUri; - } - - /** - * Whether this application is a first party client or not. - * - * @return true if the application is first party, false otherwise. - */ - @JsonProperty("is_first_party") - public Boolean isFirstParty() { - return isFirstParty; - } - - /** - * Setter for whether this application is a first party client or not. - * - * @param isFirstParty whether the application is a first party client or not. - */ - @JsonProperty("is_first_party") - public void setIsFirstParty(Boolean isFirstParty) { - this.isFirstParty = isFirstParty; - } - - /** - * Whether the token endpoint IP header is trusted for this application. - * - * @return true if the token endpoint IP header is trusted, false otherwise. - */ - @JsonProperty("is_token_endpoint_ip_header_trusted") - public Boolean getIsTokenEndpointIpHeaderTrusted() { - return isTokenEndpointIpHeaderTrusted; - } - - /** - * Setter for whether the token endpoint IP header is trusted for this application. - * - * @param isTokenEndpointIpHeaderTrusted whether the token endpoint IP header is trusted or not. - */ - @JsonProperty("is_token_endpoint_ip_header_trusted") - public void setIsTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { - this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; - } - - /** - * Whether this application will conform to strict Open ID Connect specifications or not. - * - * @return true if the application will conform to strict OIDC specifications, false otherwise. - */ - @JsonProperty("oidc_conformant") - public Boolean isOIDCConformant() { - return oidcConformant; - } - - /** - * Setter for the strict conform to the Open ID Connect specifications. - * - * @param oidcConformant whether the application will conform to strict OIDC specifications or not. - */ - @JsonProperty("oidc_conformant") - public void setOIDCConformant(Boolean oidcConformant) { - this.oidcConformant = oidcConformant; - } - - /** - * Getter for the list of allowed callback urls for the application. - * - * @return the list of callback urls. - */ - @JsonProperty("callbacks") - public List getCallbacks() { - return callbacks; - } - - /** - * Setter for the list of allowed callback urls for the application. - * - * @param callbacks the allowed callback urls to set. - */ - @JsonProperty("callbacks") - public void setCallbacks(List callbacks) { - this.callbacks = callbacks; - } - - /** - * Getter for the list of allowed origins for the application. - * - * @return the list of allowed origins. - */ - @JsonProperty("allowed_origins") - public List getAllowedOrigins() { - return allowedOrigins; - } - - /** - * Setter for the list of allowed origins for the application. - * - * @param allowedOrigins the allowed callback urls to set. - */ - @JsonProperty("allowed_origins") - public void setAllowedOrigins(List allowedOrigins) { - this.allowedOrigins = allowedOrigins; - } - - /** - * Setter for the list of web origins for the application. - * - * @param webOrigins the web origins to set. - */ - @JsonProperty("web_origins") - public void setWebOrigins(List webOrigins) { - this.webOrigins = webOrigins; - } - - /** - * Getter for the list of web origins for the application. - * - * @return the list of web origins. - */ - @JsonProperty("web_origins") - public List getWebOrigins() { - return webOrigins; - } - - /** - * Setter for the list of grant types for the application. - * See allowed values at https://auth0.com/docs/applications/application-grant-types. - * - * @param grantTypes the list of grant types to set. - */ - @JsonProperty("grant_types") - public void setGrantTypes(List grantTypes) { - this.grantTypes = grantTypes; - } - - /** - * Getter for the list of grant types for the application. - * - * @return the list of grant types. - */ - @JsonProperty("grant_types") - public List getGrantTypes() { - return grantTypes; - } - - /** - * Getter for the list of application aliases. - * - * @return the list of application aliases. - */ - @JsonProperty("client_aliases") - public List getClientAliases() { - return clientAliases; - } - - /** - * Setter for the list of application aliases. - * - * @param clientAliases the application aliases to set. - */ - @JsonProperty("client_aliases") - public void setClientAliases(List clientAliases) { - this.clientAliases = clientAliases; - } - - /** - * Getter for the list of applications that will be allowed to make a delegation request. - * - * @return the list of allowed applications. - */ - @JsonProperty("allowed_clients") - public List getAllowedClients() { - return allowedClients; - } - - /** - * Setter for the list of applications that will be allowed to make a delegation request. - * - * @param allowedClients the list of allowed application. - */ - @JsonProperty("allowed_clients") - public void setAllowedClients(List allowedClients) { - this.allowedClients = allowedClients; - } - - /** - * Getter for the application list of URLs that are valid to redirect to after logout from Auth0. - * - * @return the list of logout urls. - */ - @JsonProperty("allowed_logout_urls") - public List getAllowedLogoutUrls() { - return allowedLogoutUrls; - } - - /** - * Setter for the application list of URLs that are valid to redirect to after logout from Auth0. - * - * @param allowedLogoutUrls the allowed logout urls to set. - */ - @JsonProperty("allowed_logout_urls") - public void setAllowedLogoutUrls(List allowedLogoutUrls) { - this.allowedLogoutUrls = allowedLogoutUrls; - } - - /** - * Getter for the JWT configuration object. - * - * @return the JWT Configuration. - */ - @JsonProperty("jwt_configuration") - public JWTConfiguration getJWTConfiguration() { - return jwtConfiguration; - } - - /** - * Setter for the JWT configuration object. - * - * @param jwtConfiguration the JWT configuration to set. - */ - @JsonProperty("jwt_configuration") - public void setJWTConfiguration(JWTConfiguration jwtConfiguration) { - this.jwtConfiguration = jwtConfiguration; - } - - /** - * Getter for the application signing keys. - * - * @return the application signing keys. - */ - @JsonProperty("signing_keys") - public List getSigningKeys() { - return signingKeys; - } - - /** - * Getter for the encryption Key. - * - * @return the encryption key. - */ - @JsonProperty("encryption_key") - public EncryptionKey getEncryptionKey() { - return encryptionKey; - } - - /** - * Setter for the encryption Key. - * - * @param encryptionKey the encryption key. - */ - @JsonProperty("encryption_key") - public void setEncryptionKey(EncryptionKey encryptionKey) { - this.encryptionKey = encryptionKey; - } - - /** - * Whether to use Auth0 instead of the Identity Provider to do Single Sign On or not. - * - * @return true if this application will use Auth0 for SSO instead of the Identity Provider or not. - */ - @JsonProperty("sso") - public Boolean useAuth0SSO() { - return sso; - } - - /** - * Sets if Auth0 will do Single Sign On instead of the Identity Provider. - * - * @param useAuth0SSO whether to use Auth0 instead of the Identity Provider to do Single Sign On or not. - */ - @JsonProperty("sso") - public void setUseAuth0SSO(Boolean useAuth0SSO) { - this.sso = useAuth0SSO; - } - - /** - * Whether Single Sign On is disabled or not for this application. - * - * @return true is SSO is disabled for this application, false otherwise. - */ - @JsonProperty("sso_disabled") - public Boolean isSSODisabled() { - return ssoDisabled; - } - - /** - * Sets if Single Sign On is disabled for this application or not. - * - * @param ssoDisabled whether SSO is disabled for this application or not. - */ - @JsonProperty("sso_disabled") - public void setSSODisabled(Boolean ssoDisabled) { - this.ssoDisabled = ssoDisabled; - } - - /** - * Whether to use a custom login page or the default one. - * - * @return true if this application uses a custom login page, false otherwise. - */ - @JsonProperty("custom_login_page_on") - public Boolean useCustomLoginPage() { - return customLoginPageOn; - } - - /** - * Sets if this application should use a custom login page or the default one. - * - * @param useCustomLoginPage true if this application uses a custom login page, false otherwise. - */ - @JsonProperty("custom_login_page_on") - public void setUseCustomLoginPage(Boolean useCustomLoginPage) { - this.customLoginPageOn = useCustomLoginPage; - } - - /** - * Getter for the initiate login URI. - * - * @return the initiate login URI. - */ - @JsonProperty("initiate_login_uri") - public String getInitiateLoginUri() { - return initiateLoginUri; - } - - /** - * Setter for the initiate login URI. - * - * @param initiateLoginUri the initiate login URI to set. - */ - @JsonProperty("initiate_login_uri") - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - } - - /** - * Whether this application is a Heroku application or not. - * - * @return true if this application is a Heroku application, false otherwise. - */ - @JsonProperty("is_heroku_app") - public Boolean isHerokuApp() { - return isHerokuApp; - } - - /** - * Getter for the custom login page HTML code. - * - * @return the custom login page HTML code. - */ - @JsonProperty("custom_login_page") - public String getCustomLoginPage() { - return customLoginPage; - } - - /** - * Setter for the custom login page HTML code. - * - * @param customLoginPage the custom login page HTML code. - */ - @JsonProperty("custom_login_page") - public void setCustomLoginPage(String customLoginPage) { - this.customLoginPage = customLoginPage; - } - - /** - * Getter for the custom login page preview HTML code. - * - * @return the custom login page preview HTML code. - */ - @JsonProperty("custom_login_page_preview") - public String getCustomLoginPagePreview() { - return customLoginPagePreview; - } - - /** - * Setter for the custom login page preview HTML code. - * - * @param customLoginPagePreview the custom login page preview HTML code. - */ - @JsonProperty("custom_login_page_preview") - public void setCustomLoginPagePreview(String customLoginPagePreview) { - this.customLoginPagePreview = customLoginPagePreview; - } - - /** - * Getter for the WS federation form template. - * - * @return the form template - */ - @JsonProperty("form_template") - public String getFormTemplate() { - return formTemplate; - } - - /** - * Setter for the WS federation form template. - * - * @param formTemplate the form template to set. - */ - @JsonProperty("form_template") - public void setFormTemplate(String formTemplate) { - this.formTemplate = formTemplate; - } - - /** - * Getter for the addons or plugins associated with an application in Auth0. - * - * @return the addons for this application. - */ - @JsonProperty("addons") - public Addons getAddons() { - return addons; - } - - /** - * Setter for the addons or plugins associated with an application in Auth0. - * - * @param addons the addons to set for this application. - */ - @JsonProperty("addons") - public void setAddons(Addons addons) { - this.addons = addons; - } - - /** - * Getter for the requested authentication method for the token endpoint. - * - * @return the requested authentication method. - */ - @JsonProperty("token_endpoint_auth_method") - public String getTokenEndpointAuthMethod() { - return tokenEndpointAuthMethod; - } - - /** - * Setter for the requested authentication method for the token endpoint. Possible values are 'none' (public application without a client secret), 'client_secret_post' (application uses HTTP POST parameters) or 'client_secret_basic' (application uses HTTP Basic). - * - * @param authMethod the authentication method to set. - */ - @JsonProperty("token_endpoint_auth_method") - public void setTokenEndpointAuthMethod(String authMethod) { - this.tokenEndpointAuthMethod = authMethod; - } - - /** - * Getter for the metadata associated with the application. - * - * @return the application metadata. - */ - @JsonProperty("client_metadata") - public Map getClientMetadata() { - return clientMetadata; - } - - /** - * Setter for the metadata associated with the application, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. - * - * @param clientMetadata the application metadata to set. - */ - @JsonProperty("client_metadata") - public void setClientMetadata(Map clientMetadata) { - this.clientMetadata = clientMetadata; - } - - /** - * Getter for the configuration related to native mobile apps. - * - * @return the mobile configuration. - */ - @JsonProperty("mobile") - public Mobile getMobile() { - return mobile; - } - - /** - * Setter for the configuration related to native mobile apps. - * - * @param mobile the mobile configuration to set. - */ - @JsonProperty("mobile") - public void setMobile(Mobile mobile) { - this.mobile = mobile; - } - - /** - * Getter for the configuration related to refresh tokens. - * - * @return the refresh token configuration. - */ - public RefreshToken getRefreshToken() { - return refreshToken; - } - - /** - * Setter for the configuration related to refresh tokens. - * - * @param refreshToken the refresh token configuration to set. - */ - public void setRefreshToken(RefreshToken refreshToken) { - this.refreshToken = refreshToken; - } - - /** - * @return the organization usage value - */ - public String getOrganizationUsage() { - return organizationUsage; - } - - /** - * Sets the value of the organization_usage field - * - * @param organizationUsage the organization_usage value - */ - public void setOrganizationUsage(String organizationUsage) { - this.organizationUsage = organizationUsage; - } - - /** - * @return the organization require behavior value - */ - public String getOrganizationRequireBehavior() { - return organizationRequireBehavior; - } - - /** - * Sets the value of the organization_require_behavior field - * @param organizationRequireBehavior the organization_require_behavior value - */ - public void setOrganizationRequireBehavior(String organizationRequireBehavior) { - this.organizationRequireBehavior = organizationRequireBehavior; - } - - - /** - * Setter whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). - * @param crossOriginAuth whether an application can make cross-origin authentication requests or not - */ - @JsonProperty("cross_origin_authentication") - public void setCrossOriginAuth(Boolean crossOriginAuth) { - this.crossOriginAuth = crossOriginAuth; - } - - /** - * Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false). - * @return true if application can make cross-origin authentication requests, false otherwise - */ - @JsonProperty("cross_origin_authentication") - public Boolean getCrossOriginAuth() { - return crossOriginAuth; - } - - /** - * URL of the location in your site where the cross-origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. - * @param crossOriginLoc url location for cross-origin verification - */ - @JsonProperty("cross_origin_loc") - public void setCrossOriginLoc(String crossOriginLoc) { - this.crossOriginLoc = crossOriginLoc; - } - - /** - * Getter for the URL of the location in your site where the cross-origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. - * @return URL of the location in your site where the cross-origin verification takes place - */ - @JsonProperty("cross_origin_loc") - public String getCrossOriginLoc() { - return crossOriginLoc; - } - - public void setClientAuthenticationMethods(ClientAuthenticationMethods clientAuthenticationMethods) { - this.clientAuthenticationMethods = clientAuthenticationMethods; - } - - public ClientAuthenticationMethods getClientAuthenticationMethods() { - return clientAuthenticationMethods; - } - - /** - * @return whether this client requires pushed authorization requests or not. - */ - public Boolean getRequiresPushedAuthorizationRequests() { - return requiresPushedAuthorizationRequests; - } - - /** - * Sets whether the client requires pushed authorization requests or not. - * @param requiresPushedAuthorizationRequests true if the client should require pushed authorization requests, false if not. - */ - public void setRequiresPushedAuthorizationRequests(Boolean requiresPushedAuthorizationRequests) { - this.requiresPushedAuthorizationRequests = requiresPushedAuthorizationRequests; - } - - /** - * @return the value of the {@code oidc_backchannel_logout} property. - */ - public OIDCBackchannelLogout getOidcBackchannelLogout() { - return oidcBackchannelLogout; - } - - /** - * Sets the {@code oidc_backchannel_logout} property. - * @param oidcBackchannelLogout the value to set the {@code oidc_backchannel_logout} property to. - */ - public void setOidcBackchannelLogout(OIDCBackchannelLogout oidcBackchannelLogout) { - this.oidcBackchannelLogout = oidcBackchannelLogout; - } - - /** - * @return the value of the {@code signed_request_object} field. - */ - public SignedRequest getSignedRequest() { - return signedRequest; - } - - /** - * Sets the value of the {@code SignedRequest} field. - * - * @param signedRequest the value to set the {@code signed_request_field} field to. - */ - public void setSignedRequest(SignedRequest signedRequest) { - this.signedRequest = signedRequest; - } - - /** - * @return the value of the {@code compliance_level} field - */ - public String getComplianceLevel() { - return complianceLevel; - } - - /** - * Sets the value of the {@code compliance_level} field - * @param complianceLevel the value of the {@code compliance_level} field - */ - public void setComplianceLevel(String complianceLevel) { - this.complianceLevel = complianceLevel; - } - - /** - * @return the value of the {@code require_proof_of_possession} field - */ - public Boolean getRequireProofOfPossession() { - return requireProofOfPossession; - } - - /** - * Sets the value of the {@code require_proof_of_possession} field - * @param requireProofOfPossession the value of the {@code require_proof_of_possession} field - */ - public void setRequireProofOfPossession(Boolean requireProofOfPossession) { - this.requireProofOfPossession = requireProofOfPossession; - } - - /** - * Getter for the default organization configuration. - * @return the default organization configuration. - */ - public ClientDefaultOrganization getDefaultOrganization() { - return defaultOrganization; - } - - /** - * Setter for the default organization configuration. - * @param defaultOrganization the default organization configuration to set. - */ - public void setDefaultOrganization(ClientDefaultOrganization defaultOrganization) { - this.defaultOrganization = defaultOrganization; - } - - /** - * Getter for the token quota configuration. - * @return the token quota configuration. - */ - public TokenQuota getTokenQuota() { - return tokenQuota; - } - - /** - * Setter for the token quota configuration. - * @param tokenQuota the token quota configuration to set. - */ - public void setTokenQuota(TokenQuota tokenQuota) { - this.tokenQuota = tokenQuota; - } -} - diff --git a/src/main/java/com/auth0/json/mgmt/client/ClientAuthenticationMethods.java b/src/main/java/com/auth0/json/mgmt/client/ClientAuthenticationMethods.java deleted file mode 100644 index bc7b22aa6..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/ClientAuthenticationMethods.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Application authentication methods. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ClientAuthenticationMethods { - - @JsonProperty("private_key_jwt") - private PrivateKeyJwt privateKeyJwt; - @JsonProperty("self_signed_tls_client_auth") - private SelfSignedTLSClientAuth selfSignedTLSClientAuth; - @JsonProperty("tls_client_auth") - private TLSClientAuth tlsClientAuth; - - public ClientAuthenticationMethods() { - - } - - /** - * Create a new instance. - * @param privateKeyJwt the value of the {@code private_key_jwt} field. - */ - public ClientAuthenticationMethods(PrivateKeyJwt privateKeyJwt) { - this(privateKeyJwt, null, null); - } - - /** - * Create a new instance. - * @param privateKeyJwt the value of the {@code private_key_jwt} field. - * @param selfSignedTLSClientAuth the value of the {@code self_signed_tls_client_auth} field. - */ - public ClientAuthenticationMethods(PrivateKeyJwt privateKeyJwt, SelfSignedTLSClientAuth selfSignedTLSClientAuth) { - this(privateKeyJwt, selfSignedTLSClientAuth, null); - } - - /** - * Create a new instance. - * @param privateKeyJwt the value of the {@code private_key_jwt} field. - * @param selfSignedTLSClientAuth the value of the {@code self_signed_tls_client_auth} field. - * @param tlsClientAuth the value of the {@code tls_client_auth} field. - */ - public ClientAuthenticationMethods(PrivateKeyJwt privateKeyJwt, SelfSignedTLSClientAuth selfSignedTLSClientAuth, TLSClientAuth tlsClientAuth) { - this.privateKeyJwt = privateKeyJwt; - this.selfSignedTLSClientAuth = selfSignedTLSClientAuth; - this.tlsClientAuth = tlsClientAuth; - } - - public PrivateKeyJwt getPrivateKeyJwt() { - return privateKeyJwt; - } - - /** - * @return the value of the {@code self_signed_tls_client_auth} field - */ - public SelfSignedTLSClientAuth getSelfSignedTLSClientAuth() { - return selfSignedTLSClientAuth; - } - - /** - * @return the value of the {@code tls_client_auth} field - */ - public TLSClientAuth getTlsClientAuth() { - return tlsClientAuth; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/ClientDefaultOrganization.java b/src/main/java/com/auth0/json/mgmt/client/ClientDefaultOrganization.java deleted file mode 100644 index 3512f6b80..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/ClientDefaultOrganization.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ClientDefaultOrganization { - @JsonProperty("flows") - private List flows; - @JsonProperty("organization_id") - private String organizationId; - - public ClientDefaultOrganization() { - - } - - public ClientDefaultOrganization(List flows, String organizationId) { - this.flows = flows; - this.organizationId = organizationId; - } - - /** - * Getter for the supported flows. - * @return the supported flows. - */ - public List getFlows() { - return flows; - } - - /** - * Setter for the supported flows. - * @param flows the supported flows to set. - */ - public void setFlows(List flows) { - this.flows = flows; - } - - /** - * Getter for the organization_id. - * @return the organization_id. - */ - public String getOrganizationId() { - return organizationId; - } - - /** - * Setter for the organization_id. - * @param organizationId the organization_id to set. - */ - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/ClientsPage.java b/src/main/java/com/auth0/json/mgmt/client/ClientsPage.java deleted file mode 100644 index ae696bd36..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/ClientsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Clients. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ClientsPageDeserializer.class) -public class ClientsPage extends Page { - - public ClientsPage(List items) { - super(items); - } - - public ClientsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/client/ClientsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/client/ClientsPageDeserializer.java deleted file mode 100644 index 6348ac359..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/ClientsPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link ClientsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.ClientsEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class ClientsPageDeserializer extends PageDeserializer { - - ClientsPageDeserializer() { - super(Client.class, "clients"); - } - - @Override - protected ClientsPage createPage(List items) { - return new ClientsPage(items); - } - - @Override - protected ClientsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new ClientsPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/client/Credential.java b/src/main/java/com/auth0/json/mgmt/client/Credential.java deleted file mode 100644 index d6a7ff181..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Credential.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Class that represents an Auth0 application credential object. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Credential { - - @JsonProperty("credential_type") - private String credentialType; - @JsonProperty("name") - private String name; - @JsonProperty("pem") - private String pem; - - @JsonProperty("id") - private String id; - @JsonProperty("kid") - private String kid; - @JsonProperty("thumbprint") - private String thumbprint; - @JsonProperty("alg") - private String alg; - @JsonProperty("parse_expiry_from_cert") - private Boolean parseExpiryFromCert; - @JsonProperty("subject_dn") - private String subjectDn; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - private Date createdAt; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("updated_at") - private Date updatedAt; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("expires_at") - private Date expiresAt; - - /** - * Create a new credential - * @param credentialType the credential type - * @param pem the PEM - */ - public Credential(String credentialType, String pem) { - this.credentialType = credentialType; - this.pem = pem; - } - - /** - * Create a new credential - * @param id the ID of the credential - */ - public Credential(String id) { - this.id = id; - } - - /** - * Create a new credential - */ - public Credential() {} - - /** - * @return the credential type - */ - public String getCredentialType() { - return credentialType; - } - - /** - * Sets the credential type - * @param credentialType the credential type - */ - public void setCredentialType(String credentialType) { - this.credentialType = credentialType; - } - - /** - * @return the credential name - */ - public String getName() { - return name; - } - - /** - * Sets the credential name - * @param name the name of the credential - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the credential's PEM - */ - public String getPem() { - return pem; - } - - /** - * Sets the credential's PEM - * @param pem the PEM of the credential - */ - public void setPem(String pem) { - this.pem = pem; - } - - /** - * @return the ID of the credential - */ - public String getId() { - return id; - } - - /** - * @return the KID of the credential - */ - public String getKid() { - return kid; - } - - /** - * @return the thumbprint of the credential - */ - public String getThumbprint() { - return thumbprint; - } - - /** - * @return the date the credential was created at - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return the algorithm of this credential - */ - public String getAlg() { - return alg; - } - - /** - * Set the algorithm - * @param alg the algorithm - */ - public void setAlg(String alg) { - this.alg = alg; - } - - /** - * @return the time this credential was last updated - */ - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * @return the expiration time of this credential - */ - public Date getExpiresAt() { - return expiresAt; - } - - /** - * Set the expires_at value for this credential - * @param expiresAt the time this credential should expire - */ - public void setExpiresAt(Date expiresAt) { - this.expiresAt = expiresAt; - } - - /** - * @return whether the expiry will be parsed from the x509 certificate - */ - public Boolean getParseExpiryFromCert() { - return parseExpiryFromCert; - } - - /** - * Whether to parse expiry from x509 certificate - * @param parseExpiryFromCert true to parse expiry; false otherwise. - */ - public void setParseExpiryFromCert(Boolean parseExpiryFromCert) { - this.parseExpiryFromCert = parseExpiryFromCert; - } - - /** - * @return the value of the {@code subject_dn} field - */ - public String getSubjectDn() { - return subjectDn; - } - - /** - * Sets the value of the {@code subject_dn} field - * @param subjectDn the value of the {@code subject_dn} field - */ - public void setSubjectDn(String subjectDn) { - this.subjectDn = subjectDn; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/EncryptionKey.java b/src/main/java/com/auth0/json/mgmt/client/EncryptionKey.java deleted file mode 100644 index f0a388885..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/EncryptionKey.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EncryptionKey { - - @JsonProperty("pub") - private String pub; - @JsonProperty("cert") - private String cert; - @JsonProperty("subject") - private String subject; - - @JsonCreator - public EncryptionKey(@JsonProperty("pub") String pub, @JsonProperty("cert") String cert) { - this.pub = pub; - this.cert = cert; - } - - @JsonProperty("pub") - public String getPub() { - return pub; - } - - @JsonProperty("pub") - public void setPub(String pub) { - this.pub = pub; - } - - @JsonProperty("cert") - public String getCert() { - return cert; - } - - @JsonProperty("cert") - public void setCert(String cert) { - this.cert = cert; - } - - @JsonProperty("subject") - public String getSubject() { - return subject; - } - - @JsonProperty("subject") - public void setSubject(String subject) { - this.subject = subject; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/IOS.java b/src/main/java/com/auth0/json/mgmt/client/IOS.java deleted file mode 100644 index b18cb08b8..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/IOS.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class IOS { - - @JsonProperty("team_id") - private String teamId; - @JsonProperty("app_bundle_identifier") - private String appBundleIdentifier; - - @JsonCreator - public IOS(@JsonProperty("team_id") String teamId, @JsonProperty("app_bundle_identifier") String appBundleIdentifier) { - this.teamId = teamId; - this.appBundleIdentifier = appBundleIdentifier; - } - - /** - * Getter for the identifier assigned to the account that signs and upload the app to the store. - * - * @return the team identifier. - */ - @JsonProperty("team_id") - public String getTeamId() { - return teamId; - } - - /** - * Setter for the identifier assigned to the account that signs and upload the app to the store. - * - * @param teamId the team identifier to set. - */ - @JsonProperty("team_id") - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - /** - * Getter for the unique identifier assigned by the developer to the app inside the store. - * - * @return the bundle identifier. - */ - @JsonProperty("app_bundle_identifier") - public String getAppBundleIdentifier() { - return appBundleIdentifier; - } - - /** - * Setter for the unique identifier assigned by the developer to the app inside the store. - * - * @param appBundleIdentifier the bundle identifier to set. - */ - @JsonProperty("app_bundle_identifier") - public void setAppBundleIdentifier(String appBundleIdentifier) { - this.appBundleIdentifier = appBundleIdentifier; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/JWTConfiguration.java b/src/main/java/com/auth0/json/mgmt/client/JWTConfiguration.java deleted file mode 100644 index 81c9d623c..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/JWTConfiguration.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class JWTConfiguration { - - @JsonProperty("lifetime_in_seconds") - private Integer lifetimeInSeconds; - @JsonProperty("secret_encoded") - private Boolean secretEncoded; - @JsonProperty("scopes") - private Object scopes; - @JsonProperty("alg") - private String alg; - - @JsonCreator - public JWTConfiguration(@JsonProperty("lifetime_in_seconds") Integer lifetimeInSeconds, - @JsonProperty("scopes") Object scopes, @JsonProperty("alg") String alg) { - this.lifetimeInSeconds = lifetimeInSeconds; - this.scopes = scopes; - this.alg = alg; - } - - /** - * Getter for the amount of seconds the JWT will be valid. (Affects 'exp' claim) - * - * @return the lifetime in seconds. - */ - @JsonProperty("lifetime_in_seconds") - public Integer getLifetimeInSeconds() { - return lifetimeInSeconds; - } - - /** - * Setter for the amount of seconds the JWT will be valid. (Affects 'exp' claim) - * - * @param lifetimeInSeconds the lifetime in seconds to set. - */ - @JsonProperty("lifetime_in_seconds") - public void setLifetimeInSeconds(Integer lifetimeInSeconds) { - this.lifetimeInSeconds = lifetimeInSeconds; - } - - /** - * Whether the application's client secret is base64 encoded or not. - * - * @return true if the application secret is base64 encoded, false otherwise. - */ - @JsonProperty("secret_encoded") - public Boolean isSecretEncoded() { - return secretEncoded; - } - - /** - * Getter for the scopes. - * - * @return the scopes. - */ - @JsonProperty("scopes") - public Object getScopes() { - return scopes; - } - - /** - * Setter for the scopes. - * - * @param scopes the scopes value to set. - */ - @JsonProperty("scopes") - public void setScopes(Object scopes) { - this.scopes = scopes; - } - - /** - * Getter for the algorithm used to sign JWTs. - * - * @return the algorithm used to sign JWTs. - */ - @JsonProperty("alg") - public String getAlgorithm() { - return alg; - } - - /** - * Setter for the algorithm used to sign JWTs. - * - * @param alg the algorithm to use to sign JWTs. - */ - @JsonProperty("alg") - public void setAlgorithm(String alg) { - this.alg = alg; - } -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/client/Mobile.java b/src/main/java/com/auth0/json/mgmt/client/Mobile.java deleted file mode 100644 index 22461b4da..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/Mobile.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Mobile { - - @JsonProperty("android") - private Android android; - @JsonProperty("ios") - private IOS ios; - - @JsonCreator - public Mobile(@JsonProperty("android") Android android, @JsonProperty("ios") IOS ios) { - this.android = android; - this.ios = ios; - } - - /** - * Getter for the android mobile configuration. - * - * @return the android mobile configuration. - */ - @JsonProperty("android") - public Android getAndroid() { - return android; - } - - /** - * Setter for the Android mobile configuration. - * - * @param android the Android mobile configuration to set. - */ - @JsonProperty("android") - public void setAndroid(Android android) { - this.android = android; - } - - /** - * Getter for the iOS mobile configuration. - * - * @return the iOS mobile configuration. - */ - @JsonProperty("ios") - public IOS getIOS() { - return ios; - } - - /** - * Setter for the iOS mobile configuration. - * - * @param ios the iOS mobile configuration to set. - */ - @JsonProperty("ios") - public void setIOS(IOS ios) { - this.ios = ios; - } -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/client/OIDCBackchannelLogout.java b/src/main/java/com/auth0/json/mgmt/client/OIDCBackchannelLogout.java deleted file mode 100644 index 4f95b70cc..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/OIDCBackchannelLogout.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the value of the {@code oidc_backchannel_logout} property on an Auth0 application.\ - * @see Client - * @see com.auth0.client.mgmt.ClientsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class OIDCBackchannelLogout { - - @JsonProperty("backchannel_logout_urls") - private List backchannelLogoutUrls; - - /** - * Create a new instance with the given list of Logout URIs that will receive a {@code logout_token} when selected Back-Channel Logout Initiators occur. - * @param backchannelLogoutUrls the list of allowed backchannel logout URLs. - */ - public OIDCBackchannelLogout(@JsonProperty("backchannel_logout_urls") List backchannelLogoutUrls) { - this.backchannelLogoutUrls = backchannelLogoutUrls; - } - - /** - * @return the list of Logout URIs that will receive a {@code logout_token} when selected Back-Channel Logout Initiators occur. - */ - public List getBackchannelLogoutUrls() { - return this.backchannelLogoutUrls; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/PrivateKeyJwt.java b/src/main/java/com/auth0/json/mgmt/client/PrivateKeyJwt.java deleted file mode 100644 index 1cb674ce3..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/PrivateKeyJwt.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Application private key JWT authentication method. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PrivateKeyJwt { - - @JsonProperty("credentials") - private List credentials; - - /** - * Create a new instance - */ - public PrivateKeyJwt() {} - - /** - * Create a new instance - * @param credentials the credentials to use - */ - public PrivateKeyJwt(List credentials) { - this.credentials = credentials; - } - - /** - * @return the credentials - */ - public List getCredentials() { - return credentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/RefreshToken.java b/src/main/java/com/auth0/json/mgmt/client/RefreshToken.java deleted file mode 100644 index 0e818c6bb..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/RefreshToken.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents the configuration of refresh tokens for a client. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RefreshToken { - - @JsonProperty("rotation_type") - private String rotationType; - @JsonProperty("expiration_type") - private String expirationType; - @JsonProperty("leeway") - private Integer leeway; - @JsonProperty("token_lifetime") - private Integer tokenLifetime; - @JsonProperty("infinite_token_lifetime") - private Boolean infiniteTokenLifetime; - @JsonProperty("idle_token_lifetime") - private Integer idleTokenLifetime; - @JsonProperty("infinite_idle_token_lifetime") - private Boolean infiniteIdleTokenLifetime; - - /** - * Getter for the rotation type of the refresh token. - * - * @return the rotation type. - */ - @JsonProperty("rotation_type") - public String getRotationType() { - return rotationType; - } - - /** - * Setter for the rotation type of the refresh token. - * - * @param rotationType the rotation type to set. - */ - @JsonProperty("rotation_type") - public void setRotationType(String rotationType) { - this.rotationType = rotationType; - } - - /** - * Getter for the expiration type of the refresh token. - * - * @return the expiration type. - */ - @JsonProperty("expiration_type") - public String getExpirationType() { - return expirationType; - } - - /** - * Setter for the expiration type of the refresh token. - * - * @param expirationType the expiration type to set. - */ - @JsonProperty("expiration_type") - public void setExpirationType(String expirationType) { - this.expirationType = expirationType; - } - - /** - * Getter for the period in seconds where the previous refresh token can be exchanged without - * triggering breach detection. - * - * @return the leeway in seconds. - */ - @JsonProperty("leeway") - public Integer getLeeway() { - return leeway; - } - - /** - * Setter for the period in seconds where the previous refresh token can be exchanged without - * triggering breach detection. - * - * @param leeway the leeway in seconds. - */ - @JsonProperty("leeway") - public void setLeeway(Integer leeway) { - this.leeway = leeway; - } - - /** - * Getter for the period in seconds for which refresh tokens will remain valid. - * - * @return a token's lifetime in seconds. - */ - @JsonProperty("token_lifetime") - public Integer getTokenLifetime() { - return tokenLifetime; - } - - /** - * Setter for the period in seconds for which refresh tokens will remain valid. - * - * @param tokenLifetime a token's lifetime in seconds. - */ - @JsonProperty("token_lifetime") - public void setTokenLifetime(Integer tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } - - /** - * Getter for determining whether tokens have a set lifetime or not. This takes precedence over - * token_lifetime values. - * - * @return true if tokens do not have a set lifetime, false otherwise. - */ - @JsonProperty("infinite_token_lifetime") - public Boolean getInfiniteTokenLifetime() { - return infiniteTokenLifetime; - } - - /** - * Setter for determining whether tokens have a set lifetime or not. This takes precedence over - * token_lifetime values. - * - * @param infiniteTokenLifetime true if tokens do not have a set lifetime, false otherwise. - */ - @JsonProperty("infinite_token_lifetime") - public void setInfiniteTokenLifetime(Boolean infiniteTokenLifetime) { - this.infiniteTokenLifetime = infiniteTokenLifetime; - } - - /** - * Getter for the period in seconds for which refresh tokens will remain valid without use. - * - * @return a token's lifetime without use in seconds. - */ - @JsonProperty("idle_token_lifetime") - public Integer getIdleTokenLifetime() { - return idleTokenLifetime; - } - - /** - * Setter for the period in seconds for which refresh tokens will remain valid without use. - * - * @param idleTokenLifetime a token's lifetime without use in seconds. - */ - @JsonProperty("idle_token_lifetime") - public void setIdleTokenLifetime(Integer idleTokenLifetime) { - this.idleTokenLifetime = idleTokenLifetime; - } - - /** - * Getter for determining whether tokens expire without use or not. This takes precedence over - * idle_token_lifetime values. - * - * @return true if tokens do not expire from lack of use, false otherwise. - */ - @JsonProperty("infinite_idle_token_lifetime") - public Boolean getInfiniteIdleTokenLifetime() { - return infiniteIdleTokenLifetime; - } - - /** - * Setter for determining whether tokens expire without use or not. This takes precedence over - * idle_token_lifetime values. - * - * @param infiniteIdleTokenLifetime true if tokens do not expire from lack of use, false - * otherwise. - */ - @JsonProperty("infinite_idle_token_lifetime") - public void setInfiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) { - this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/SelfSignedTLSClientAuth.java b/src/main/java/com/auth0/json/mgmt/client/SelfSignedTLSClientAuth.java deleted file mode 100644 index e73d2be02..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/SelfSignedTLSClientAuth.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Application self-signed TLS client authentication method. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SelfSignedTLSClientAuth { - - @JsonProperty("credentials") - private List credentials; - - /** - * Create a new instance - * @param credentials the credentials to use - */ - public SelfSignedTLSClientAuth(@JsonProperty("credentials") List credentials) { - this.credentials = credentials; - } - - /** - * @return the credentials - */ - public List getCredentials() { - return credentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/SignedRequest.java b/src/main/java/com/auth0/json/mgmt/client/SignedRequest.java deleted file mode 100644 index 2854f690d..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/SignedRequest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Application signed request object. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SignedRequest { - - @JsonProperty("required") - private Boolean required; - @JsonProperty("credentials") - private List credentials; - - /** - * @return the value of the {@code credentials} field - */ - public List getCredentials() { - return credentials; - } - - /** - * Sets the value of the {@code credentials} field - * - * @param credentials the value of the {@code credentials} field - */ - public void setCredentials(List credentials) { - this.credentials = credentials; - } - - public Boolean getRequired() { - return required; - } - - public void setRequired(Boolean required) { - this.required = required; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/SigningKey.java b/src/main/java/com/auth0/json/mgmt/client/SigningKey.java deleted file mode 100644 index 733f1694e..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/SigningKey.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SigningKey { - - @JsonProperty("cert") - private String cert; - @JsonProperty("pkcs7") - private String pkcs7; - @JsonProperty("subject") - private String subject; - - @JsonCreator - public SigningKey(@JsonProperty("cert") String cert, @JsonProperty("pkcs7") String pkcs7, @JsonProperty("subject") String subject) { - this.cert = cert; - this.pkcs7 = pkcs7; - this.subject = subject; - } - - /** - * Getter for the signing public key. - * - * @return the public key. - */ - @JsonProperty("cert") - public String getCert() { - return cert; - } - - /** - * Setter for the signing public key. - * - * @param cert the certificate to set. - */ - @JsonProperty("cert") - public void setCert(String cert) { - this.cert = cert; - } - - /** - * Getter for the signing public key in PKCS#7 format. - * - * @return the public key in PKCS#7 format. - */ - @JsonProperty("pkcs7") - public String getPKCS7() { - return pkcs7; - } - - /** - * Setter for the signing public key in PKCS#7 format. - * - * @param pkcs7 the public key in PKCS#7 format to use. - */ - @JsonProperty("pkcs7") - public void setPKCS7(String pkcs7) { - this.pkcs7 = pkcs7; - } - - /** - * Getter for the subject. - * - * @return the subject. - */ - @JsonProperty("subject") - public String getSubject() { - return subject; - } - - /** - * Setter for the subject. - * - * @param subject the subject to set. - */ - @JsonProperty("subject") - public void setSubject(String subject) { - this.subject = subject; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/client/TLSClientAuth.java b/src/main/java/com/auth0/json/mgmt/client/TLSClientAuth.java deleted file mode 100644 index 05e896af1..000000000 --- a/src/main/java/com/auth0/json/mgmt/client/TLSClientAuth.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Application TLS client authentication method. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class TLSClientAuth { - @JsonProperty("credentials") - private List credentials; - - /** - * Create a new instance - * @param credentials the credentials to use - */ - public TLSClientAuth(@JsonProperty("credentials") List credentials) { - this.credentials = credentials; - } - - /** - * @return the credentials - */ - public List getCredentials() { - return credentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrant.java b/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrant.java deleted file mode 100644 index 86a6a3a4b..000000000 --- a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrant.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.auth0.json.mgmt.clientgrants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Client Grant object. Related to the {@link com.auth0.client.mgmt.ClientGrantsEntity} entity. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ClientGrant { - - @JsonProperty("id") - private String id; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("audience") - private String audience; - @JsonProperty("scope") - private List scope; - @JsonProperty("organization_usage") - private String organizationUsage; - @JsonProperty("allow_any_organization") - private Boolean allowAnyOrganization; - - /** - * Getter for the id of the client grant. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the client id of the application. - * - * @return the application's client id. - */ - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - /** - * Setter for the application's client id. - * - * @param clientId the application's client id to set. - */ - @JsonProperty("client_id") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Getter for the audience. - * - * @return the audience. - */ - @JsonProperty("audience") - public String getAudience() { - return audience; - } - - /** - * Setter for the audience. - * - * @param audience the audience to set. - */ - @JsonProperty("audience") - public void setAudience(String audience) { - this.audience = audience; - } - - /** - * Getter for the scope. - * - * @return the scope. - */ - @JsonProperty("scope") - public List getScope() { - return scope; - } - - /** - * Setter for the scope. - * - * @param scope the scope to set. - */ - @JsonProperty("scope") - public void setScope(List scope) { - this.scope = scope; - } - - /** - * @return the organization use - */ - public String getOrganizationUsage() { - return organizationUsage; - } - - /** - * @param organizationUsage the value of {@code organization_usage} to set. - */ - public void setOrganizationUsage(String organizationUsage) { - this.organizationUsage = organizationUsage; - } - - /** - * @return the value of {@code allow_any_organization} - */ - public Boolean getAllowAnyOrganization() { - return allowAnyOrganization; - } - - /** - * @param allowAnyOrganization the value of {@code allow_any_organization} to set. - */ - public void setAllowAnyOrganization(Boolean allowAnyOrganization) { - this.allowAnyOrganization = allowAnyOrganization; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPage.java b/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPage.java deleted file mode 100644 index 2f38a8bf8..000000000 --- a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.clientgrants; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Client Grants. Related to the {@link com.auth0.client.mgmt.ClientGrantsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ClientGrantsPageDeserializer.class) -public class ClientGrantsPage extends Page { - - public ClientGrantsPage(List items) { - super(items); - } - - public ClientGrantsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPageDeserializer.java deleted file mode 100644 index 179412db9..000000000 --- a/src/main/java/com/auth0/json/mgmt/clientgrants/ClientGrantsPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.clientgrants; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link ClientGrantsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.ClientGrantsEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class ClientGrantsPageDeserializer extends PageDeserializer { - - ClientGrantsPageDeserializer() { - super(ClientGrant.class, "client_grants"); - } - - @Override - protected ClientGrantsPage createPage(List items) { - return new ClientGrantsPage(items); - } - - @Override - protected ClientGrantsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new ClientGrantsPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/Clients.java b/src/main/java/com/auth0/json/mgmt/connections/Clients.java deleted file mode 100644 index f0d5f0d02..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/Clients.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class Clients { - @JsonProperty("client_id") - private String clientId; - - /** - * Default constructor for the Clients class. - */ - public Clients() { - } - - /** - * Constructor for the Clients class. - * - * @param clientId the client ID. - */ - public Clients(String clientId) { - this.clientId = clientId; - } - - /** - * Getter for the client ID. - * - * @return the client ID. - */ - public String getClientId() { - return clientId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/Connection.java b/src/main/java/com/auth0/json/mgmt/connections/Connection.java deleted file mode 100644 index b40a3dc56..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/Connection.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * Class that represents an Auth0 Connection object. Related to the {@link com.auth0.client.mgmt.ConnectionsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Connection { - - @JsonProperty("name") - private String name; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("options") - private Map options; - @JsonProperty("id") - private String id; - @JsonProperty("strategy") - private String strategy; - @JsonProperty("enabled_clients") - private List enabledClients = null; - @JsonProperty("provisioning_ticket_url") - private String provisioningTicketUrl; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("realms") - private List realms; - @JsonProperty("show_as_button") - private Boolean showAsButton; - @JsonProperty("is_domain_connection") - private Boolean isDomainConnection; - - public Connection() { - } - - @JsonCreator - public Connection(@JsonProperty("name") String name, @JsonProperty("strategy") String strategy) { - this.name = name; - this.strategy = strategy; - } - - /** - * Getter for the name of the connection. - * - * @return the name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Getter for the connection options. - * - * @return the connection options. - */ - @JsonProperty("options") - public Map getOptions() { - return options; - } - - /** - * Setter for the connection options. - * - * @param options the connection options. - */ - @JsonProperty("options") - public void setOptions(Map options) { - this.options = options; - } - - /** - * Getter for the id of this connection. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the connection display name, used in the new universal login experience. - * - * @return the connection display name. - */ - @JsonProperty("display_name") - public String getDisplayName() { - return displayName; - } - - /** - * Setter for the connection display name, used in the new universal login experience. - * - * @param displayName the connection display name to set. - */ - @JsonProperty("display_name") - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * Getter for the type of the connection, related to the identity provider. - * - * @return the strategy. - */ - @JsonProperty("strategy") - public String getStrategy() { - return strategy; - } - - /** - * Getter for the list of applications this connection is enabled for. - *

Deprecated: This field is deprecated and will be removed in future versions. - * Use `updateEnabledClients` and `getEnabledClients` methods instead for managing enabled clients - * - * @return the list of enabled applications. - */ - @JsonProperty("enabled_clients") - public List getEnabledClients() { - return enabledClients; - } - - /** - * Setter for the list of applications this connection is enabled for. - *

Deprecated: This field is deprecated and will be removed in future versions. - * Use `updateEnabledClients` and `getEnabledClients` methods instead for managing enabled clients - * - * @param enabledClients the list of enabled applications to set. - */ - @JsonProperty("enabled_clients") - public void setEnabledClients(List enabledClients) { - this.enabledClients = enabledClients; - } - - /** - * Getter for the ad/ldap connection's ticket url. - * - * @return the provisioning ticket url. - */ - @JsonProperty("provisioning_ticket_url") - public String getProvisioningTicketUrl() { - return provisioningTicketUrl; - } - - /** - * Getter for the metadata of this connection. - * - * @return the map of metadata key-values. - */ - @JsonProperty("metadata") - public Map getMetadata() { - return metadata; - } - - /** - * Setter for the metadata of this connection. - * - * @param metadata the map of metadata key-values. - */ - @JsonProperty("metadata") - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - /** - * Getter for the realms of this connection. - * - * @return the list of realms. - */ - @JsonProperty("realms") - public List getRealms() { - return realms; - } - - /** - * Setter for the realms of this connection. - * - * @param realms the list of realms. - */ - @JsonProperty("realms") - public void setRealms(List realms) { - this.realms = realms; - } - - /** - * Getter for the show as button flag. - * - * @return the show as button flag. - */ - @JsonProperty("show_as_button") - public Boolean isShowAsButton() { - return showAsButton; - } - - /** - * Setter for the show as button flag. - * - * @param showAsButton the show as button flag to set. - */ - @JsonProperty("show_as_button") - public void setShowAsButton(Boolean showAsButton) { - this.showAsButton = showAsButton; - } - - /** - * Getter for the domain connection flag. - * @return the domain connection flag. - */ - @JsonProperty("is_domain_connection") - public Boolean isDomainConnection() { - return isDomainConnection; - } - - /** - * Setter for the domain connection flag. - * @param domainConnection the domain connection flag to set. - */ - @JsonProperty("is_domain_connection") - public void setDomainConnection(Boolean domainConnection) { - this.isDomainConnection = domainConnection; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ConnectionKeys.java b/src/main/java/com/auth0/json/mgmt/connections/ConnectionKeys.java deleted file mode 100644 index b1bca6e0f..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ConnectionKeys.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ConnectionKeys { - @JsonProperty("kid") - private String kid; - - @JsonProperty("algorithm") - private String algorithm; - - @JsonProperty("key_use") - private String keyUse; - - @JsonProperty("subject_dn") - private String subjectDn; - - @JsonProperty("cert") - private String cert; - - @JsonProperty("fingerprint") - private String fingerprint; - - @JsonProperty("thumbprint") - private String thumbprint; - - @JsonProperty("pkcs") - private String pkcs; - - @JsonProperty("current") - private Boolean current; - - @JsonProperty("current_since") - private String currentSince; - - @JsonProperty("next") - private Boolean next; - - /** - * Getter for the Key ID (kid). - * @return the Key ID (kid). - */ - public String getKid() { - return kid; - } - - /** - * Setter for the Key ID (kid). - * @param kid the Key ID (kid). - */ - public void setKid(String kid) { - this.kid = kid; - } - - /** - * Getter for the algorithm used by the key. - * @return the algorithm used by the key. - */ - public String getAlgorithm() { - return algorithm; - } - - /** - * Setter for the algorithm used by the key. - * @param algorithm the algorithm used by the key. - */ - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } - - /** - * Getter for the key use (e.g., "sig" for signature). - * @return the key use. - */ - public String getKeyUse() { - return keyUse; - } - - /** - * Setter for the key use. - * @param keyUse the key use (e.g., "sig" for signature). - */ - public void setKeyUse(String keyUse) { - this.keyUse = keyUse; - } - - /** - * Getter for the subject distinguished name (DN). - * @return the subject DN. - */ - public String getSubjectDn() { - return subjectDn; - } - - /** - * Setter for the subject distinguished name (DN). - * @param subjectDn the subject DN. - */ - public void setSubjectDn(String subjectDn) { - this.subjectDn = subjectDn; - } - - /** - * Getter for the certificate associated with the key. - * @return the certificate. - */ - public String getCert() { - return cert; - } - - /** - * Setter for the certificate associated with the key. - * @param cert the certificate. - */ - public void setCert(String cert) { - this.cert = cert; - } - - /** - * Getter for the fingerprint of the key. - * @return the fingerprint. - */ - public String getFingerprint() { - return fingerprint; - } - - /** - * Setter for the fingerprint of the key. - * @param fingerprint the fingerprint. - */ - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - /** - * Getter for the thumbprint of the key. - * @return the thumbprint. - */ - public String getThumbprint() { - return thumbprint; - } - - /** - * Setter for the thumbprint of the key. - * @param thumbprint the thumbprint. - */ - public void setThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - } - - /** - * Getter for the PKCS#8 representation of the key. - * @return the PKCS#8 representation. - */ - public String getPkcs() { - return pkcs; - } - - /** - * Setter for the PKCS#8 representation of the key. - * @param pkcs the PKCS#8 representation. - */ - public void setPkcs(String pkcs) { - this.pkcs = pkcs; - } - - /** - * Getter for whether the key is currently active. - * @return true if the key is current, false otherwise. - */ - public Boolean getCurrent() { - return current; - } - - /** - * Setter for whether the key is currently active. - * @param current true if the key is current, false otherwise. - */ - public void setCurrent(Boolean current) { - this.current = current; - } - - /** - * Getter for the timestamp when the key became current. - * @return the timestamp in ISO 8601 format. - */ - public String getCurrentSince() { - return currentSince; - } - - /** - * Setter for the timestamp when the key became current. - * @param currentSince the timestamp in ISO 8601 format. - */ - public void setCurrentSince(String currentSince) { - this.currentSince = currentSince; - } - - /** - * Getter for whether there is a next key available. - * @return true if there is a next key, false otherwise. - */ - public Boolean getNext() { - return next; - } - - /** - * Setter for whether there is a next key available. - * @param next true if there is a next key, false otherwise. - */ - public void setNext(Boolean next) { - this.next = next; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPage.java b/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPage.java deleted file mode 100644 index dfb663239..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPage.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Grants. Related to the {@link com.auth0.client.mgmt.ConnectionsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ConnectionsPageDeserializer.class) -public class ConnectionsPage extends Page { - - public ConnectionsPage(List items) { - super(items); - } - - public ConnectionsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public ConnectionsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items){ - super(start, length, total, limit, next, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPageDeserializer.java deleted file mode 100644 index 52b616af1..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ConnectionsPageDeserializer.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link ConnectionsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.ConnectionsEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class ConnectionsPageDeserializer extends PageDeserializer { - - ConnectionsPageDeserializer() { - super(Connection.class, "connections"); - } - - @Override - protected ConnectionsPage createPage(List items) { - return new ConnectionsPage(items); - } - - @Override - protected ConnectionsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new ConnectionsPage(start, length, total, limit, items); - } - - @Override - protected ConnectionsPage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new ConnectionsPage(start, length, total, limit, next, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/DefaultScimMappingResponse.java b/src/main/java/com/auth0/json/mgmt/connections/DefaultScimMappingResponse.java deleted file mode 100644 index 481e7df75..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/DefaultScimMappingResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class DefaultScimMappingResponse { - @JsonProperty("mapping") - private List mapping; - - /** - * Creates a new instance. - */ - @JsonCreator - public DefaultScimMappingResponse() { - } - - /** - * Creates a new instance with the given mapping. - * @param mapping the mapping attribute. - */ - @JsonCreator - public DefaultScimMappingResponse(@JsonProperty("mapping") List mapping) { - this.mapping = mapping; - } - - /** - * Getter for the mapping attribute. - * @return the mapping attribute. - */ - public List getMapping() { - return mapping; - } - - /** - * Setter for the mapping attribute. - * @param mapping the mapping attribute to set. - */ - public void setMapping(List mapping) { - this.mapping = mapping; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/EnabledClientRequest.java b/src/main/java/com/auth0/json/mgmt/connections/EnabledClientRequest.java deleted file mode 100644 index 5845b652e..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/EnabledClientRequest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class EnabledClientRequest { - @JsonProperty("client_id") - private String clientId; - - @JsonProperty("status") - private boolean status; - - /** - * Constructor for the EnabledClientRequest. - * @param clientId - * @param status - */ - public EnabledClientRequest(String clientId, boolean status) { - this.clientId = clientId; - this.status = status; - } - - /** - * Getter for the client ID. - * - * @return the client ID. - */ - public String getClientId() { - return clientId; - } - - /** - * Getter for the status. - * - * @return the status. - */ - @JsonProperty("status") - public boolean isStatus() { - return status; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/EnabledClientResponse.java b/src/main/java/com/auth0/json/mgmt/connections/EnabledClientResponse.java deleted file mode 100644 index c139d95ab..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/EnabledClientResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class EnabledClientResponse { - @JsonProperty("clients") - private List clients; - @JsonProperty("next") - private String next; - - /** - * Getter for the list of clients. - * - * @return the list of clients. - */ - public List getClients() { - return clients; - } - - /** - * Setter for the list of clients. - * - * @param clients the list of clients to set. - */ - public void setClients(List clients) { - this.clients = clients; - } - - /** - * Getter for the next page URL. - * - * @return the next page URL. - */ - public String getNext() { - return next; - } - - /** - * Setter for the next page URL. - * - * @param next the next page URL to set. - */ - public void setNext(String next) { - this.next = next; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/Mapping.java b/src/main/java/com/auth0/json/mgmt/connections/Mapping.java deleted file mode 100644 index 868c6e7d8..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/Mapping.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Mapping { - @JsonProperty("auth0") - private String auth0; - @JsonProperty("scim") - private String scim; - - /** - * Creates a new instance. - */ - @JsonCreator - public Mapping() { - - } - - /** - * Creates a new instance with the given Auth0 and SCIM attributes. - * @param auth0 the Auth0 attribute. - * @param scim the SCIM attribute. - */ - @JsonCreator - public Mapping(@JsonProperty("auth0") String auth0, @JsonProperty("scim") String scim) { - this.auth0 = auth0; - this.scim = scim; - } - - /** - * Getter for the Auth0 attribute. - * @return the Auth0 attribute. - */ - public String getAuth0() { - return auth0; - } - - /** - * Setter for the Auth0 attribute. - * @param auth0 the Auth0 attribute to set. - */ - public void setAuth0(String auth0) { - this.auth0 = auth0; - } - - /** - * Getter for the SCIM attribute. - * @return the SCIM attribute. - */ - public String getScim() { - return scim; - } - - /** - * Setter for the SCIM attribute. - * @param scim the SCIM attribute to set. - */ - public void setScim(String scim) { - this.scim = scim; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/RotateKey.java b/src/main/java/com/auth0/json/mgmt/connections/RotateKey.java deleted file mode 100644 index d83bc656a..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/RotateKey.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RotateKey { - @JsonProperty("cert") - private String cert; - @JsonProperty("kid") - private String kid; - - /** - * Returns the certificate used for the key rotation. - * @return the certificate as a String. - */ - public String getCert() { - return cert; - } - - /** - * Sets the certificate used for the key rotation. - * @param cert the certificate as a String. - */ - public void setCert(String cert) { - this.cert = cert; - } - - /** - * Returns the Key ID (kid) of the key being rotated. - * @return the Key ID as a String. - */ - public String getKid() { - return kid; - } - - /** - * Sets the Key ID (kid) of the key being rotated. - * @param kid the Key ID as a String. - */ - public void setKid(String kid) { - this.kid = kid; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationRequest.java b/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationRequest.java deleted file mode 100644 index 337d5288b..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationRequest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ScimConfigurationRequest { - @JsonProperty("user_id_attribute") - private String userIdAttribute; - @JsonProperty("mapping") - private List mapping; - - /** - * Creates a new instance. - */ - public ScimConfigurationRequest() { - - } - - /** - * Creates a new instance with the given user id attribute and mapping. - * @param userIdAttribute the user id attribute. - * @param mapping the mappings. - */ - public ScimConfigurationRequest(String userIdAttribute, List mapping) { - this.userIdAttribute = userIdAttribute; - this.mapping = mapping; - } - - /** - * Getter for the user id attribute. - * @return the user id attribute. - */ - public String getUserIdAttribute() { - return userIdAttribute; - } - - /** - * Setter for the user id attribute. - * @param userIdAttribute the user id attribute to set. - */ - public void setUserIdAttribute(String userIdAttribute) { - this.userIdAttribute = userIdAttribute; - } - - /** - * Getter for the mapping. - * @return the mapping. - */ - public List getMapping() { - return mapping; - } - - /** - * Setter for the mapping. - * @param mapping the mapping to set. - */ - public void setMapping(List mapping) { - this.mapping = mapping; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationResponse.java b/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationResponse.java deleted file mode 100644 index 1133fa590..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimConfigurationResponse.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ScimConfigurationResponse { - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("connection_name") - private String connectionName; - @JsonProperty("strategy") - private String strategy; - @JsonProperty("tenant_name") - private String tenantName; - @JsonProperty("user_id_attribute") - private String userIdAttribute; - @JsonProperty("mapping") - private List mapping; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("updated_on") - private String updatedOn; - - /** - * Getter for the connection id. - * @return the connection id. - */ - public String getConnectionId() { - return connectionId; - } - - /** - * Setter for the connection id. - * @param connectionId the connection id to set. - */ - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * Getter for the connection name. - * @return the connection name. - */ - public String getConnectionName() { - return connectionName; - } - - /** - * Setter for the connection name. - * @param connectionName the connection name to set. - */ - public void setConnectionName(String connectionName) { - this.connectionName = connectionName; - } - - /** - * Getter for the strategy. - * @return the strategy. - */ - public String getStrategy() { - return strategy; - } - - /** - * Setter for the strategy. - * @param strategy the strategy to set. - */ - public void setStrategy(String strategy) { - this.strategy = strategy; - } - - /** - * Getter for the tenant name. - * @return the tenant name. - */ - public String getTenantName() { - return tenantName; - } - - /** - * Setter for the tenant name. - * @param tenantName the tenant name to set. - */ - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - /** - * Getter for the user id attribute. - * @return the user id attribute. - */ - public String getUserIdAttribute() { - return userIdAttribute; - } - - /** - * Setter for the user id attribute. - * @param userIdAttribute the user id attribute to set. - */ - public void setUserIdAttribute(String userIdAttribute) { - this.userIdAttribute = userIdAttribute; - } - - /** - * Getter for the mapping. - * @return the mapping. - */ - public List getMapping() { - return mapping; - } - - /** - * Setter for the mapping. - * @param mapping the mapping to set. - */ - public void setMapping(List mapping) { - this.mapping = mapping; - } - - /** - * Getter for the created at. - * @return the created at. - */ - public String getCreatedAt() { - return createdAt; - } - - /** - * Setter for the created at. - * @param createdAt the created at to set. - */ - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /** - * Getter for the updated on. - * @return the updated on. - */ - public String getUpdatedOn() { - return updatedOn; - } - - /** - * Setter for the updated on. - * @param updatedOn the updated on to set. - */ - public void setUpdatedOn(String updatedOn) { - this.updatedOn = updatedOn; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponse.java b/src/main/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponse.java deleted file mode 100644 index 951461054..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ScimTokenBaseResponse { - @JsonProperty("token_id") - private String tokenId; - @JsonProperty("scopes") - private List scopes; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("valid_until") - private String validUntil; - - /** - * Getter for the token id. - * @return the token id. - */ - public String getTokenId() { - return tokenId; - } - - /** - * Setter for the token id. - * @param tokenId the token id to set. - */ - public void setTokenId(String tokenId) { - this.tokenId = tokenId; - } - - /** - * Getter for the scopes. - * @return the scopes. - */ - public List getScopes() { - return scopes; - } - - /** - * Setter for the scopes. - * @param scopes the scopes to set. - */ - public void setScopes(List scopes) { - this.scopes = scopes; - } - - /** - * Getter for the created at. - * @return the created at. - */ - public String getCreatedAt() { - return createdAt; - } - - /** - * Setter for the created at. - * @param createdAt the created at to set. - */ - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /** - * Getter for the valid until. - * @return the valid until. - */ - public String getValidUntil() { - return validUntil; - } - - /** - * Setter for the valid until. - * @param validUntil the valid until to set. - */ - public void setValidUntil(String validUntil) { - this.validUntil = validUntil; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponse.java b/src/main/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponse.java deleted file mode 100644 index ce332e0be..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ScimTokenCreateResponse extends ScimTokenBaseResponse { - @JsonProperty("token") - private String token; - - /** - * Getter for the token. - * @return the token. - */ - public String getToken() { - return token; - } - - /** - * Setter for the token. - * @param token the token to set. - */ - public void setToken(String token) { - this.token = token; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenRequest.java b/src/main/java/com/auth0/json/mgmt/connections/ScimTokenRequest.java deleted file mode 100644 index 3d2d387b8..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenRequest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ScimTokenRequest { - @JsonProperty("scopes") - private List scopes; - @JsonProperty("token_lifetime") - private Integer tokenLifetime; - - /** - * Getter for the scopes. - * @return the scopes. - */ - public List getScopes() { - return scopes; - } - - /** - * Setter for the scopes. - * @param scopes the scopes to set. - */ - public void setScopes(List scopes) { - this.scopes = scopes; - } - - /** - * Getter for the token lifetime. - * @return the token lifetime. - */ - public Integer getTokenLifetime() { - return tokenLifetime; - } - - /** - * Setter for the token lifetime. - * @param tokenLifetime the token lifetime to set. - */ - public void setTokenLifetime(Integer tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenResponse.java b/src/main/java/com/auth0/json/mgmt/connections/ScimTokenResponse.java deleted file mode 100644 index 1cbea6390..000000000 --- a/src/main/java/com/auth0/json/mgmt/connections/ScimTokenResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ScimTokenResponse extends ScimTokenBaseResponse { - @JsonProperty("last_used_at") - private String lastUsedAt; - - /** - * Getter for the last used at. - * @return the last used at. - */ - public String getLastUsedAt() { - return lastUsedAt; - } - - /** - * Setter for the last used at. - * @param lastUsedAt the last used at to set. - */ - public void setLastUsedAt(String lastUsedAt) { - this.lastUsedAt = lastUsedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/devicecredentials/DeviceCredentials.java b/src/main/java/com/auth0/json/mgmt/devicecredentials/DeviceCredentials.java deleted file mode 100644 index 2fd9b19d0..000000000 --- a/src/main/java/com/auth0/json/mgmt/devicecredentials/DeviceCredentials.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.auth0.json.mgmt.devicecredentials; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Device Credentials object. Related to the {@link com.auth0.client.mgmt.DeviceCredentialsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class DeviceCredentials { - - @JsonProperty("id") - private String id; - @JsonProperty("device_name") - private String deviceName; - @JsonProperty("type") - private String type; - @JsonProperty("value") - private String value; - @JsonProperty("device_id") - private String deviceId; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("user_id") - private String userId; - - @JsonCreator - public DeviceCredentials(@JsonProperty("device_name") String deviceName, @JsonProperty("type") String type, @JsonProperty("value") String value, @JsonProperty("device_id") String deviceId, @JsonProperty("client_id") String clientId) { - this.deviceName = deviceName; - this.type = type; - this.value = value; - this.deviceId = deviceId; - this.clientId = clientId; - } - - /** - * Getter for the unique identifier of the device credentials. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the device name. - * - * @return the device name. - */ - @JsonProperty("device_name") - public String getDeviceName() { - return deviceName; - } - - /** - * Setter for the device name. - * - * @param deviceName the device name to set. - */ - @JsonProperty("device_name") - public void setDeviceName(String deviceName) { - this.deviceName = deviceName; - } - - /** - * Getter for the type of credential. Either 'public_key', 'refresh_token' or 'rotating_refresh_token'. - * - * @return the type of credential. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Setter for the type of credential. Either 'public_key', 'refresh_token' or 'rotating_refresh_token'. - * - * @param type the type of credential to set. - */ - @JsonProperty("type") - public void setType(String type) { - this.type = type; - } - - /** - * Setter for the base64 encoded string with the value of the credential. - * - * @param value the value of the credential to set. - */ - @JsonProperty("value") - public void setValue(String value) { - this.value = value; - } - - /** - * Getter for the unique device identifier. - * - * @return the unique device identifier. - */ - @JsonProperty("device_id") - public String getDeviceId() { - return deviceId; - } - - /** - * Setter for the unique device identifier. - * - * @param deviceId the unique device identifier to set. - */ - @JsonProperty("device_id") - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - /** - * Setter for the client id of the application for which the credential will be created. - * - * @param clientId the application's client id to set. - */ - @JsonProperty("client_id") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Getter for the client id of the application for which the credential is created. - * - * @return the client id. - */ - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - - /** - * Getter for the user id of the device - * - * @return the user if - */ - @JsonProperty("user_id") - public String getUserId() { - return userId; - } - - /** - * Setter for the user id of the devices to retrieve - * - * @param userId the user id to set. - */ - @JsonProperty("user_id") - public void setUserId(String userId) { - this.userId = userId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProvider.java b/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProvider.java deleted file mode 100644 index a46a721a6..000000000 --- a/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProvider.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.auth0.json.mgmt.emailproviders; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Map; - -/** - * Class that represents an Auth0 Email Provider object. Related to the {@link com.auth0.client.mgmt.EmailProviderEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EmailProvider { - - @JsonProperty("name") - private String name; - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("default_from_address") - private String defaultFromAddress; - @JsonProperty("credentials") - private EmailProviderCredentials credentials; - @JsonProperty("settings") - private Map settings; - - @JsonCreator - public EmailProvider(@JsonProperty("name") String name) { - this.name = name; - } - - /** - * Getter for the provider name. - * - * @return the provider name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Setter for the provider name. - * - * @param name the name to set. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Whether this provider is enabled or not. - * - * @return true if this provider is enabled, false otherwise. - */ - @JsonProperty("enabled") - public Boolean isEnabled() { - return enabled; - } - - /** - * Sets if this provider is enabled or not. - * - * @param enabled whether this provider is enabled or not. - */ - @JsonProperty("enabled") - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * Getter for the default from address. - * - * @return the default from address. - */ - @JsonProperty("default_from_address") - public String getDefaultFromAddress() { - return defaultFromAddress; - } - - /** - * Setter for the default from address. - * - * @param defaultFromAddress the default from address. - */ - @JsonProperty("default_from_address") - public void setDefaultFromAddress(String defaultFromAddress) { - this.defaultFromAddress = defaultFromAddress; - } - - /** - * Getter for the provider credentials. - * - * @return the provider credentials. - */ - @JsonProperty("credentials") - public EmailProviderCredentials getCredentials() { - return credentials; - } - - /** - * Setter for the provider credentials. - * - * @param credentials the provider credentials to set. - */ - @JsonProperty("credentials") - public void setCredentials(EmailProviderCredentials credentials) { - this.credentials = credentials; - } - - /** - * Getter for the specific provider settings. - * - * @return the provider settings. - */ - @JsonProperty("settings") - public Map getSettings() { - return settings; - } - - /** - * Setter for the specific provider settings. - * - * @param settings the provider settings to set. - */ - @JsonProperty("settings") - public void setSettings(Map settings) { - this.settings = settings; - } -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentials.java b/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentials.java deleted file mode 100644 index 04b66fd38..000000000 --- a/src/main/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentials.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.auth0.json.mgmt.emailproviders; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EmailProviderCredentials { - - @JsonProperty("api_user") - private String apiUser; - @JsonProperty("api_key") - private String apiKey; - @JsonProperty("accessKeyId") - private String accessKeyId; - @JsonProperty("secretAccessKey") - private String secretAccessKey; - @JsonProperty("region") - private String region; - @JsonProperty("smtp_host") - private String smtpHost; - @JsonProperty("smtp_port") - private Integer smtpPort; - @JsonProperty("smtp_user") - private String smtpUser; - @JsonProperty("smtp_pass") - private String smtpPass; - - @JsonCreator - public EmailProviderCredentials(@JsonProperty("api_key") String apiKey) { - this.apiKey = apiKey; - } - - @JsonProperty("api_user") - public String getApiUser() { - return apiUser; - } - - @JsonProperty("api_user") - public void setApiUser(String apiUser) { - this.apiUser = apiUser; - } - - @JsonProperty("api_key") - public String getApiKey() { - return apiKey; - } - - @JsonProperty("api_key") - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - @JsonProperty("accessKeyId") - public String getAccessKeyId() { - return accessKeyId; - } - - @JsonProperty("accessKeyId") - public void setAccessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; - } - - @JsonProperty("secretAccessKey") - public String getSecretAccessKey() { - return secretAccessKey; - } - - @JsonProperty("secretAccessKey") - public void setSecretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; - } - - @JsonProperty("region") - public String getRegion() { - return region; - } - - @JsonProperty("region") - public void setRegion(String region) { - this.region = region; - } - - @JsonProperty("smtp_host") - public String getSMTPHost() { - return smtpHost; - } - - @JsonProperty("smtp_host") - public void setSMTPHost(String smtpHost) { - this.smtpHost = smtpHost; - } - - @JsonProperty("smtp_port") - public Integer getSMTPPort() { - return smtpPort; - } - - @JsonProperty("smtp_port") - public void setSMTPPort(Integer smtpPort) { - this.smtpPort = smtpPort; - } - - @JsonProperty("smtp_user") - public String getSMTPUser() { - return smtpUser; - } - - @JsonProperty("smtp_user") - public void setSMTPUser(String smtpUser) { - this.smtpUser = smtpUser; - } - - @JsonProperty("smtp_pass") - public String getSMTPPass() { - return smtpPass; - } - - @JsonProperty("smtp_pass") - public void setSMTPPass(String smtpPass) { - this.smtpPass = smtpPass; - } -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/emailtemplates/EmailTemplate.java b/src/main/java/com/auth0/json/mgmt/emailtemplates/EmailTemplate.java deleted file mode 100644 index 6fc46b3f1..000000000 --- a/src/main/java/com/auth0/json/mgmt/emailtemplates/EmailTemplate.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.auth0.json.mgmt.emailtemplates; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Email Template object. Related to the {@link com.auth0.client.mgmt.EmailTemplatesEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EmailTemplate { - - @JsonProperty("template") - private String name; - @JsonProperty("body") - private String body; - @JsonProperty("from") - private String from; - @JsonProperty("resultUrl") - private String resultUrl; - @JsonProperty("subject") - private String subject; - @JsonProperty("syntax") - private String syntax; - @JsonProperty("urlLifetimeInSeconds") - private Integer urlLifetimeInSeconds; - @JsonProperty("enabled") - private Boolean enabled; - - public EmailTemplate() { - //Only here to set the syntax default value - this.syntax = "liquid"; - } - - /** - * Getter for the name of the template. - * - * @return the name. - */ - @JsonProperty("template") - public String getName() { - return name; - } - - /** - * Sets the name of the template. - * - * @param name the name to set for this template - */ - @JsonProperty("template") - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the template code. - * - * @return the template code. - */ - @JsonProperty("body") - public String getBody() { - return body; - } - - /** - * Sets the template code - * - * @param body the code this template will have - */ - @JsonProperty("body") - public void setBody(String body) { - this.body = body; - } - - /** - * Getter for the sender of the email - * - * @return the sender of the email - */ - @JsonProperty("from") - public String getFrom() { - return from; - } - - /** - * Sets the sender of the email - * - * @param from the sender of the email - */ - @JsonProperty("from") - public void setFrom(String from) { - this.from = from; - } - - /** - * Getter the URL to redirect the user to after a successful action. - * - * @return the URL to redirect the user to after a successful action. - */ - @JsonProperty("resultUrl") - public String getResultUrl() { - return resultUrl; - } - - /** - * Sets the URL to redirect the user to after a successful action. - * - * @param resultUrl the URL to redirect the user to after a successful action. - */ - @JsonProperty("resultUrl") - public void setResultUrl(String resultUrl) { - this.resultUrl = resultUrl; - } - - /** - * Getter for the subject of the email. - * - * @return the subject of the email. - */ - @JsonProperty("subject") - public String getSubject() { - return subject; - } - - /** - * Sets the subject of the email. - * - * @param subject the subject of the email. - */ - @JsonProperty("subject") - public void setSubject(String subject) { - this.subject = subject; - } - - /** - * Getter for the syntax used in the template's code. - * - * @return the syntax used in the template's code. - */ - @JsonProperty("syntax") - public String getSyntax() { - return syntax; - } - - /** - * Sets for the syntax to be used in the template's code. - * Default value is 'liquid' - * - * @param syntax the syntax to be used in the template's code. - */ - @JsonProperty("syntax") - public void setSyntax(String syntax) { - this.syntax = syntax; - } - - /** - * Getter for the lifetime in seconds that the link within the email will be valid for. - * - * @return the lifetime in seconds that the link within the email will be valid for. - */ - @JsonProperty("urlLifetimeInSeconds") - public Integer getUrlLifetimeInSeconds() { - return urlLifetimeInSeconds; - } - - /** - * Sets the lifetime in seconds that the link within the email will be valid for. - * - * @param urlLifetimeInSeconds the lifetime in seconds that the link within the email will be valid for. - */ - @JsonProperty("urlLifetimeInSeconds") - public void setUrlLifetimeInSeconds(Integer urlLifetimeInSeconds) { - this.urlLifetimeInSeconds = urlLifetimeInSeconds; - } - - /** - * Whether or not this template is enabled. - * - * @return true if this template is enabled, false otherwise. - */ - @JsonProperty("enabled") - public Boolean isEnabled() { - return enabled; - } - - /** - * Enables or disables this template. - * - * @param enabled whether this template is enabled or not. - */ - @JsonProperty("enabled") - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/grants/Grant.java b/src/main/java/com/auth0/json/mgmt/grants/Grant.java deleted file mode 100644 index e7365d9fa..000000000 --- a/src/main/java/com/auth0/json/mgmt/grants/Grant.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.auth0.json.mgmt.grants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Grant object. Related to the {@link com.auth0.client.mgmt.GrantsEntity} entity. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Grant { - - @JsonProperty("id") - private String id; - @JsonProperty("clientID") - private String clientId; - @JsonProperty("user_id") - private String userId; - @JsonProperty("audience") - private String audience; - @JsonProperty("scope") - private List scope; - - /** - * Getter for the id of the grant. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the client id of the application. - * - * @return the application's client id. - */ - @JsonProperty("clientID") - public String getClientId() { - return clientId; - } - - /** - * Setter for the application's client id. - * - * @param clientId the application's client id to set. - */ - @JsonProperty("clientID") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Getter for the user id. - * - * @return the user id. - */ - @JsonProperty("user_id") - public String getUserId() { - return userId; - } - - /** - * Setter for the user id. - * - * @param userId the user id to set. - */ - @JsonProperty("user_id") - public void setUserId(String userId) { - this.userId = userId; - } - - /** - * Getter for the audience. - * - * @return the audience. - */ - @JsonProperty("audience") - public String getAudience() { - return audience; - } - - /** - * Setter for the audience. - * - * @param audience the audience to set. - */ - @JsonProperty("audience") - public void setAudience(String audience) { - this.audience = audience; - } - - /** - * Getter for the scope. - * - * @return the scope. - */ - @JsonProperty("scope") - public List getScope() { - return scope; - } - - /** - * Setter for the scope. - * - * @param scope the scope to set. - */ - @JsonProperty("scope") - public void setScope(List scope) { - this.scope = scope; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/grants/GrantsPage.java b/src/main/java/com/auth0/json/mgmt/grants/GrantsPage.java deleted file mode 100644 index 39d2dce92..000000000 --- a/src/main/java/com/auth0/json/mgmt/grants/GrantsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.grants; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Grants. Related to the {@link com.auth0.client.mgmt.GrantsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = GrantsPageDeserializer.class) -public class GrantsPage extends Page { - - public GrantsPage(List items) { - super(items); - } - - public GrantsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/grants/GrantsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/grants/GrantsPageDeserializer.java deleted file mode 100644 index 4d9fb9012..000000000 --- a/src/main/java/com/auth0/json/mgmt/grants/GrantsPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.grants; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link GrantsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.GrantsEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class GrantsPageDeserializer extends PageDeserializer { - - GrantsPageDeserializer() { - super(Grant.class, "grants"); - } - - @Override - protected GrantsPage createPage(List items) { - return new GrantsPage(items); - } - - @Override - protected GrantsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new GrantsPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java b/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java deleted file mode 100644 index 29648d803..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Class that represents an Auth0 Guardian Enrollment object. Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Enrollment { - - @JsonProperty("id") - private String id; - @JsonProperty("status") - private String status; - @JsonProperty("type") - private String type; - @JsonProperty("name") - private String name; - @JsonProperty("identifier") - private String identifier; - @JsonProperty("phone_number") - private String phoneNumber; - @JsonProperty("auth_method") - private String authMethod; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("enrolled_at") - private Date enrolledAt; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_auth") - private Date lastAuth; - - /** - * Getter for the enrollment ID - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the enrollment status. Either 'pending' or 'confirmed'. - * - * @return the status. - */ - @JsonProperty("status") - public String getStatus() { - return status; - } - - /** - * Getter for the enrollment type. - * - * @return the type. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Getter for the enrollment name. This is usually the phone name. Only for 'guardian' enrollments. - * - * @return the name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Getter for the device identifier. This is usually a unique phone identifier. Only for 'guardian' enrollments. - * - * @return the identifier. - */ - @JsonProperty("identifier") - public String getIdentifier() { - return identifier; - } - - /** - * Getter for the phone number. Only for 'sms' enrollments. - * - * @return the phone number. - */ - @JsonProperty("phone_number") - public String getPhoneNumber() { - return phoneNumber; - } - - /** - * Getter for the authentication method. - * - * @return the authentication method. - */ - @JsonProperty("auth_method") - public String getAuthMethod() { - return authMethod; - } - - /** - * Getter for the enrolled at. - * - * @return the enrolled at. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("enrolled_at") - public Date getEnrolledAt() { - return enrolledAt; - } - - /** - * Getter for the last authentication. - * - * @return the last authentication. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_auth") - public Date getLastAuth() { - return lastAuth; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/EnrollmentTicket.java b/src/main/java/com/auth0/json/mgmt/guardian/EnrollmentTicket.java deleted file mode 100644 index d36c7afbe..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/EnrollmentTicket.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Guardian Enrollment Ticket object. Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EnrollmentTicket { - - @JsonProperty("user_id") - private String userId; - @JsonProperty("send_mail") - private Boolean sendEmail; - @JsonProperty("email") - private String email; - @JsonProperty("ticket_id") - private String ticketId; - @JsonProperty("ticket_url") - private String ticketUrl; - - /** - * Creates a new instance of the Enrollment Ticket for a given User. - * - * @param userId the user id - */ - public EnrollmentTicket(String userId) { - this(userId, null, null); - } - - /** - * Creates a new instance of the Enrollment Ticket for a given User, specifying if you want the ticket to also be - * sent to the user by email. - * - * @param userId the user id - * @param sendEmail whether the ticket should also be sent to the user by email - */ - public EnrollmentTicket(String userId, Boolean sendEmail) { - this(userId, sendEmail, null); - } - - /** - * Creates a new instance of the Enrollment Ticket for a given User, specifying if you want the ticket to also be - * sent to the specified email address. - * - * @param userId the user id - * @param sendEmail whether the ticket should also be sent to the user by email - * @param email the email where the ticket will be sent. - */ - public EnrollmentTicket(String userId, Boolean sendEmail, String email) { - this.userId = userId; - this.sendEmail = sendEmail; - this.email = email; - } - - @JsonCreator - EnrollmentTicket(@JsonProperty("ticket_id") String ticketId, @JsonProperty("ticket_url") String ticketUrl) { - this.ticketId = ticketId; - this.ticketUrl = ticketUrl; - } - - /** - * Getter for the id of the User this ticket was made for. - * - * @return the user id. - */ - @JsonProperty("user_id") - public String getUserId() { - return userId; - } - - /** - * Whether to send and email for enrollment or not. - * - * @return true is this ticket will send an email upon enrollment, false otherwise. - */ - @JsonProperty("send_mail") - public Boolean willSendEmail() { - return sendEmail; - } - - /** - * Getter for the email to which the ticket will be sent. - * - * @return the email. - */ - @JsonProperty("email") - public String getEmail() { - return email; - } - - /** - * Getter for the ticket id. - * - * @return the ticket id. - */ - @JsonProperty("ticket_id") - public String getTicketId() { - return ticketId; - } - - /** - * Getter for the ticket url. - * - * @return the ticket url. - */ - @JsonProperty("ticket_url") - public String getTicketUrl() { - return ticketUrl; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/Factor.java b/src/main/java/com/auth0/json/mgmt/guardian/Factor.java deleted file mode 100644 index 85905f819..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/Factor.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Guardian Factor object. Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Factor { - - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("trial_expired") - private Boolean trialExpired; - @JsonProperty("name") - private String name; - - @JsonCreator - Factor(@JsonProperty("enabled") Boolean enabled) { - this.enabled = enabled; - } - - /** - * Whether this factor is enabled or not. - * - * @return true if this factor is enabled, false otherwise. - */ - @JsonProperty("enabled") - public Boolean isEnabled() { - return enabled; - } - - /** - * Sets whether this factor is enabled or not. - * - * @param enabled whether this factor is enabled or not. - */ - @JsonProperty("enabled") - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * Whether the trial has already expired or not. - * - * @return true if the trial has expired, false otherwise. - */ - @JsonProperty("trial_expired") - public Boolean isTrialExpired() { - return trialExpired; - } - - /** - * Getter for the name of this factor. - * - * @return the factor name. - */ - @JsonProperty("name") - public String getName() { - return name; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/GuardianTemplates.java b/src/main/java/com/auth0/json/mgmt/guardian/GuardianTemplates.java deleted file mode 100644 index 7be3d3ff6..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/GuardianTemplates.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Guardian SMS Templates object. Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class GuardianTemplates { - - @JsonProperty("enrollment_message") - private String enrollmentMessage; - @JsonProperty("verification_message") - private String verificationMessage; - - @JsonCreator - public GuardianTemplates(@JsonProperty("enrollment_message") String enrollmentMessage, @JsonProperty("verification_message") String verificationMessage) { - this.enrollmentMessage = enrollmentMessage; - this.verificationMessage = verificationMessage; - } - - /** - * Getter for the message to send when the user enrolls with SMS. - * - * @return the message to send upon enrollment. - */ - @JsonProperty("enrollment_message") - public String getEnrollmentMessage() { - return enrollmentMessage; - } - - /** - * Setter for the message to send when the user enrolls with SMS. - * - * @param enrollmentMessage the message to send upon enrollment. - */ - @JsonProperty("enrollment_message") - public void setEnrollmentMessage(String enrollmentMessage) { - this.enrollmentMessage = enrollmentMessage; - } - - /** - * Getter for the message to send when the user is prompted to verify their account via SMS. - * - * @return the message to send upon verification. - */ - @JsonProperty("verification_message") - public String getVerificationMessage() { - return verificationMessage; - } - - /** - * Setter for the message to send when the user is prompted to verify their account via SMS. - * - * @param verificationMessage the message to send upon verification. - */ - @JsonProperty("verification_message") - public void setVerificationMessage(String verificationMessage) { - this.verificationMessage = verificationMessage; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/SNSFactorProvider.java b/src/main/java/com/auth0/json/mgmt/guardian/SNSFactorProvider.java deleted file mode 100644 index 47772125f..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/SNSFactorProvider.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents a Guardian's push-notification Factor Provider for Amazon's Simple Notification Service (SNS). - * Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SNSFactorProvider { - - @JsonProperty("aws_access_key_id") - private String awsAccessKeyId; - @JsonProperty("aws_secret_access_key") - private String awsSecretAccessKey; - @JsonProperty("aws_region") - private String awsRegion; - @JsonProperty("sns_apns_platform_application_arn") - private String snsAPNSPlatformApplicationArn; - @JsonProperty("sns_gcm_platform_application_arn") - private String snsGCMPlatformApplicationArn; - - /** - * Creates a SNS settings object - * - * @param awsAccessKeyId the Amazon Web Services access key id. - * @param awsSecretAccessKey the Amazon Web Services secret access key. - * @param awsRegion the Amazon Web Services region. - * @param snsAPNSPlatformApplicationArn the Apple Push Notification Service platform application Amazon Resource Name. - * @param snsGCMPlatformApplicationArn the Google Cloud Messaging platform application Amazon Resource Name. - */ - @JsonCreator - public SNSFactorProvider(@JsonProperty("aws_access_key_id") String awsAccessKeyId, @JsonProperty("aws_secret_access_key") String awsSecretAccessKey, @JsonProperty("aws_region") String awsRegion, @JsonProperty("sns_apns_platform_application_arn") String snsAPNSPlatformApplicationArn, @JsonProperty("sns_gcm_platform_application_arn") String snsGCMPlatformApplicationArn) { - this.awsAccessKeyId = awsAccessKeyId; - this.awsSecretAccessKey = awsSecretAccessKey; - this.awsRegion = awsRegion; - this.snsAPNSPlatformApplicationArn = snsAPNSPlatformApplicationArn; - this.snsGCMPlatformApplicationArn = snsGCMPlatformApplicationArn; - } - - /** - * Getter for the Amazon Web Services access key id. - * - * @return the AWS access key id. - */ - @JsonProperty("aws_access_key_id") - public String getAWSAccessKeyId() { - return awsAccessKeyId; - } - - /** - * Getter for the Amazon Web Services secret access key. - * - * @return the AWS secret access key. - */ - @JsonProperty("aws_secret_access_key") - public String getAWSSecretAccessKey() { - return awsSecretAccessKey; - } - - /** - * Getter for the Amazon Web Services region. - * - * @return the AWS region. - */ - @JsonProperty("aws_region") - public String getAWSRegion() { - return awsRegion; - } - - /** - * Getter for the Simple Notification Service Apple Push Notification service platform application Amazon Resource Name. - * - * @return the SNS APNs ARN. - */ - @JsonProperty("sns_apns_platform_application_arn") - public String getSNSAPNSPlatformApplicationARN() { - return snsAPNSPlatformApplicationArn; - } - - /** - * Getter for the Simple Notification Service Google Cloud Messaging platform application Amazon Resource Name. - * - * @return the SNS GCM ARN. - */ - @JsonProperty("sns_gcm_platform_application_arn") - public String getSNSGCMPlatformApplicationARN() { - return snsGCMPlatformApplicationArn; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java b/src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java deleted file mode 100644 index 3fca3ab9c..000000000 --- a/src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents a Guardian's SMS Factor Provider for Twilio. - * Related to the {@link com.auth0.client.mgmt.GuardianEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class TwilioFactorProvider { - - @JsonProperty("from") - private String from; - @JsonProperty("messaging_service_sid") - private String messagingServiceSID; - @JsonProperty("auth_token") - private String authToken; - @JsonProperty("sid") - private String sid; - - /** - * Creates a Twilio settings object - * - * You must only specify either a non-null `from` or `messagingServiceSID`, but not both. - * - * @param from the Twilio From number. - * @param messagingServiceSID the Twilio Messaging Service SID. - * @param authToken the Twilio auth token. - * @param sid the Twilio SID. - * @throws IllegalArgumentException when both `from` and `messagingServiceSID` are set - */ - @JsonCreator - public TwilioFactorProvider(@JsonProperty("from") String from, @JsonProperty("messaging_service_sid") String messagingServiceSID, @JsonProperty("auth_token") String authToken, @JsonProperty("sid") String sid) - throws IllegalArgumentException { - if (from != null && messagingServiceSID != null) { - throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both"); - } - this.from = from; - this.messagingServiceSID = messagingServiceSID; - this.authToken = authToken; - this.sid = sid; - } - - /** - * Getter for the Twilio From number. - * - * @return the from number. - */ - @JsonProperty("from") - public String getFrom() { - return from; - } - - /** - * Getter for the Twilio Messaging Service SID. - * - * @return the messaging service SID. - */ - @JsonProperty("messaging_service_sid") - public String getMessagingServiceSID() { - return messagingServiceSID; - } - - /** - * Getter for the Twilio auth token. - * - * @return the Twilio auth token. - */ - @JsonProperty("auth_token") - public String getAuthToken() { - return authToken; - } - - /** - * Getter for the Twilio SID - * - * @return the Twilio SID. - */ - @JsonProperty("sid") - public String getSID() { - return sid; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/jobs/Job.java b/src/main/java/com/auth0/json/mgmt/jobs/Job.java deleted file mode 100644 index ce7296067..000000000 --- a/src/main/java/com/auth0/json/mgmt/jobs/Job.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.fasterxml.jackson.annotation.*; - -import java.util.Date; - -/** - * Class that represents an Auth0 Job object. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Job { - - @JsonProperty("status") - private final String status; - @JsonProperty("type") - private final String type; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("id") - private final String id; - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("connection") - private String connection; - @JsonProperty("location") - private String location; - @JsonProperty("percentage_done") - private Integer percentageDone; - @JsonProperty("external_id") - private String externalId; - @JsonProperty("time_left_seconds") - private Integer timeLeftSeconds; - @JsonProperty("format") - private String format; - @JsonProperty("summary") - private JobSummary summary; - - @JsonCreator - private Job(@JsonProperty("status") String status, @JsonProperty("type") String type, @JsonProperty("id") String id) { - this.status = status; - this.type = type; - this.id = id; - } - - @JsonProperty("status") - public String getStatus() { - return status; - } - - @JsonProperty("type") - public String getType() { - return type; - } - - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - public Date getCreatedAt() { - return createdAt; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the connection id this job uses. - * - * @return the connection id. - */ - @JsonProperty("connection_id") - public String getConnectionId() { - return connectionId; - } - - /** - * Getter for the name of the connection this job uses. - * - * @return the connection name. - */ - @JsonProperty("connection") - public String getConnection() { - return connection; - } - - /** - * Getter for the format this job will output. - * - * @return the format. - */ - @JsonProperty("format") - public String getFormat() { - return format; - } - - /** - * Getter for the URL to download the result of the job. - * - * @return the location. - */ - @JsonProperty("location") - public String getLocation() { - return location; - } - - /** - * Getter for the completion percentage of this job. - * - * @return the percentage done. - */ - @JsonProperty("percentage_done") - public Integer getPercentageDone() { - return percentageDone; - } - - /** - * Getter for the external ID used to correlate multiple jobs. - * - * @return the external id. - */ - @JsonProperty("external_id") - public String getExternalId() { - return externalId; - } - - /** - * Getter for the estimated time remaining before job completes. - * - * @return the time left in seconds. - */ - @JsonProperty("time_left_seconds") - public Integer getTimeLeftSeconds() { - return timeLeftSeconds; - } - - /** - * Getter for the summary of a completed Auth0 Job. - * - * @return the summary of the Job. - */ - @JsonProperty("summary") - public JobSummary getSummary() { - return summary; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/jobs/JobError.java b/src/main/java/com/auth0/json/mgmt/jobs/JobError.java deleted file mode 100644 index 3150d8dfb..000000000 --- a/src/main/java/com/auth0/json/mgmt/jobs/JobError.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class JobError { - - @JsonProperty("code") - private String code; - @JsonProperty("message") - private String message; - @JsonProperty("path") - private String path; - - @JsonCreator - public JobError(@JsonProperty("code") String code, @JsonProperty("message") String message, @JsonProperty("path") String path) { - this.code = code; - this.message = message; - this.path = path; - } - - @JsonProperty("code") - public String getCode() { - return code; - } - - @JsonProperty("message") - public String getMessage() { - return message; - } - - @JsonProperty("path") - public String getPath() { - return path; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/jobs/JobErrorDetails.java b/src/main/java/com/auth0/json/mgmt/jobs/JobErrorDetails.java deleted file mode 100644 index a67e7a888..000000000 --- a/src/main/java/com/auth0/json/mgmt/jobs/JobErrorDetails.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.auth0.json.mgmt.users.User; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Class that represents the error details for an Auth0 Job object. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class JobErrorDetails { - - @JsonProperty("user") - private final User user; - - @JsonProperty("errors") - private final List errors; - - @JsonCreator - public JobErrorDetails(@JsonProperty("user") User user, @JsonProperty("errors") List errors) { - this.user = user; - this.errors = errors; - } - - @JsonProperty("user") - public User getUser() { - return user; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/jobs/JobSummary.java b/src/main/java/com/auth0/json/mgmt/jobs/JobSummary.java deleted file mode 100644 index 88e6db1a6..000000000 --- a/src/main/java/com/auth0/json/mgmt/jobs/JobSummary.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents the summary of a completed Auth0 Job object. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class JobSummary { - - @JsonProperty("failed") - private final Integer failed; - @JsonProperty("updated") - private final Integer updated; - @JsonProperty("inserted") - private final Integer inserted; - @JsonProperty("total") - private final Integer total; - - @JsonCreator - private JobSummary(@JsonProperty("failed") Integer failed, @JsonProperty("updated") Integer updated, @JsonProperty("inserted") Integer inserted, @JsonProperty("total") Integer total) { - this.failed = failed; - this.updated = updated; - this.inserted = inserted; - this.total = total; - } - - @JsonProperty("failed") - public Integer getFailed() { - return failed; - } - - @JsonProperty("updated") - public Integer getUpdated() { - return updated; - } - - @JsonProperty("inserted") - public Integer getInserted() { - return inserted; - } - - @JsonProperty("total") - public Integer getTotal() { - return total; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/jobs/UsersExportField.java b/src/main/java/com/auth0/json/mgmt/jobs/UsersExportField.java deleted file mode 100644 index b39e5d058..000000000 --- a/src/main/java/com/auth0/json/mgmt/jobs/UsersExportField.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents a Users Export Job's Field object. Related to the {@link com.auth0.client.mgmt.JobsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UsersExportField { - - @JsonProperty("name") - private final String name; - @JsonProperty("export_as") - private String exportAs; - - public UsersExportField(String name) { - this.name = name; - } - - public UsersExportField(@JsonProperty("name") String name, @JsonProperty("export_as") String exportAs) { - this.name = name; - this.exportAs = exportAs; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("export_as") - public String getExportAs() { - return exportAs; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKey.java b/src/main/java/com/auth0/json/mgmt/keys/EncryptionKey.java deleted file mode 100644 index 00f52fe12..000000000 --- a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKey.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EncryptionKey { - @JsonProperty("kid") - private String kid; - @JsonProperty("type") - private String type; - @JsonProperty("state") - private String state; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("updated_at") - private String updatedAt; - @JsonProperty("parent_kid") - private String parentKid; - @JsonProperty("public_key") - private String publicKey; - - /** - * Getter for the key id. - * @return - */ - public String getKid() { - return kid; - } - - /** - * Setter for the key id. - * @param kid - */ - public void setKid(String kid) { - this.kid = kid; - } - - /** - * Getter for the key type. - * @return - */ - public String getType() { - return type; - } - - /** - * Setter for the key type. - * @param type - */ - public void setType(String type) { - this.type = type; - } - - /** - * Getter for the key state. - * @return - */ - public String getState() { - return state; - } - - /** - * Setter for the key state. - * @param state - */ - public void setState(String state) { - this.state = state; - } - - /** - * Getter for the key creation date. - * @return - */ - public String getCreatedAt() { - return createdAt; - } - - /** - * Setter for the key creation date. - * @param createdAt - */ - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /** - * Getter for the key update date. - * @return - */ - public String getUpdatedAt() { - return updatedAt; - } - - /** - * Setter for the key update date. - * @param updatedAt - */ - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - /** - * Getter for the parent key id. - * @return - */ - public String getParentKid() { - return parentKid; - } - - /** - * Setter for the parent key id. - * @param parentKid - */ - public void setParentKid(String parentKid) { - this.parentKid = parentKid; - } - - /** - * Getter for the public key. - * @return - */ - public String getPublicKey() { - return publicKey; - } - - /** - * Setter for the public key. - * @param publicKey - */ - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPage.java b/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPage.java deleted file mode 100644 index 283a5aa31..000000000 --- a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPage.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = EncryptionKeysPageDeserializer.class) -public class EncryptionKeysPage extends Page { - - public EncryptionKeysPage(List items) { - super(items); - } - - public EncryptionKeysPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPageDeserializer.java deleted file mode 100644 index 797255e1f..000000000 --- a/src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPageDeserializer.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -public class EncryptionKeysPageDeserializer extends PageDeserializer { - - protected EncryptionKeysPageDeserializer() { - super(EncryptionKey.class, "keys"); - } - - @Override - protected EncryptionKeysPage createPage(List items) { - return new EncryptionKeysPage(items); - } - - @Override - protected EncryptionKeysPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new EncryptionKeysPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponse.java b/src/main/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponse.java deleted file mode 100644 index 49de28690..000000000 --- a/src/main/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EncryptionWrappingKeyResponse { - @JsonProperty("public_key") - private String publicKey; - @JsonProperty("algorithm") - private String algorithm; - - /** - * Getter for the public key. - * @return the public key. - */ - public String getPublicKey() { - return publicKey; - } - - /** - * Setter for the public key. - * @param publicKey the public key. - */ - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } - - /** - * Getter for the algorithm. - * @return the algorithm. - */ - public String getAlgorithm() { - return algorithm; - } - - /** - * Setter for the algorithm. - * @param algorithm the algorithm. - */ - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/keys/Key.java b/src/main/java/com/auth0/json/mgmt/keys/Key.java deleted file mode 100644 index c9adaa6f4..000000000 --- a/src/main/java/com/auth0/json/mgmt/keys/Key.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Class that represents an Auth0 Key object. Related to the {@link com.auth0.client.mgmt.KeysEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Key { - - @JsonProperty("kid") - private String kid; - - @JsonProperty("cert") - private String cert; - - @JsonProperty("pkcs7") - private String pkcs7; - - @JsonProperty("current") - private Boolean current; - - @JsonProperty("next") - private Boolean next; - - @JsonProperty("previous") - private Boolean previous; - - @JsonProperty("fingerprint") - private String fingerprint; - - @JsonProperty("thumbprint") - private String thumbprint; - - @JsonProperty("revoked") - private Boolean revoked; - - @JsonProperty("current_since") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date currentSince; - - @JsonProperty("current_until") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date currentUntil; - - @JsonProperty("revoked_at") - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Date revokedAt; - - @JsonProperty("kid") - public String getKid() { - return kid; - } - - @JsonProperty("kid") - public void setKid(String kid) { - this.kid = kid; - } - - @JsonProperty("cert") - public String getCert() { - return cert; - } - - @JsonProperty("cert") - public void setCert(String cert) { - this.cert = cert; - } - - @JsonProperty("pkcs7") - public String getPkcs7() { - return pkcs7; - } - - @JsonProperty("pkcs7") - public void setPkcs7(String pkcs7) { - this.pkcs7 = pkcs7; - } - - @JsonProperty("current") - public Boolean getCurrent() { - return current; - } - - @JsonProperty("current") - public void setCurrent(Boolean current) { - this.current = current; - } - - @JsonProperty("next") - public Boolean getNext() { - return next; - } - - @JsonProperty("next") - public void setNext(Boolean next) { - this.next = next; - } - - @JsonProperty("previous") - public Boolean getPrevious() { - return previous; - } - - @JsonProperty("previous") - public void setPrevious(Boolean previous) { - this.previous = previous; - } - - @JsonProperty("fingerprint") - public String getFingerprint() { - return fingerprint; - } - - @JsonProperty("fingerprint") - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - @JsonProperty("thumbprint") - public String getThumbprint() { - return thumbprint; - } - - @JsonProperty("thumbprint") - public void setThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - } - - @JsonProperty("revoked") - public Boolean getRevoked() { - return revoked; - } - - @JsonProperty("revoked") - public void setRevoked(Boolean revoked) { - this.revoked = revoked; - } - - @JsonProperty("current_since") - public Date getCurrentSince() { - return currentSince; - } - - @JsonProperty("current_since") - public void setCurrentSince(Date currentSince) { - this.currentSince = currentSince; - } - - @JsonProperty("current_until") - public Date getCurrentUntil() { - return currentUntil; - } - - @JsonProperty("current_until") - public void setCurrentUntil(Date currentUntil) { - this.currentUntil = currentUntil; - } - - @JsonProperty("revoked_at") - public Date getRevokedAt() { - return revokedAt; - } - - @JsonProperty("revoked_at") - public void setRevokedAt(Date revokedAt) { - this.revokedAt = revokedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java b/src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java deleted file mode 100644 index 5d679a6cd..000000000 --- a/src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java +++ /dev/null @@ -1,291 +0,0 @@ -package com.auth0.json.mgmt.logevents; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * Class that represents an Auth0 Events object. Related to the {@link com.auth0.client.mgmt.LogEventsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class LogEvent { - - @JsonProperty("_id") - private String id; - @JsonProperty("log_id") - private String logId; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("date") - private Date date; - @JsonProperty("type") - private String type; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("client_name") - private String clientName; - @JsonProperty("ip") - private String ip; - @JsonProperty("user_id") - private String userId; - @JsonProperty("user_name") - private String userName; - @JsonProperty("location_info") - private Map locationInfo; - @JsonProperty("details") - private Map details; - @JsonProperty("connection") - private String connection; - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("description") - private String description; - @JsonProperty("hostname") - private String hostname; - @JsonProperty("audience") - private String audience; - @JsonProperty("scope") - private Object scope; - @JsonProperty("strategy") - private String strategy; - @JsonProperty("strategy_type") - private String strategyType; - @JsonProperty("isMobile") - private boolean isMobile; - @JsonProperty("user_agent") - private String userAgent; - @JsonProperty("organization_id") - private String organizationId; - @JsonProperty("organization_name") - private String organizationName; - @JsonProperty("tenant_name") - private String tenantName; - @JsonProperty("$event_schema") - private Object eventSchema; - - /** - * Getter for the id of this event. - * - * @return the id. - */ - @JsonProperty("_id") - public String getId() { - return id; - } - - /** - * Getter for the log_id of this event. - * - * @return the log_id of this event. - */ - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - /** - * Getter for the date of this event. - * - * @return the date. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("date") - public Date getDate() { - return date; - } - - /** - * Getter for the type of this event. - * - * @return the type. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Getter for the application's client id related to this event. - * - * @return the application's client id. - */ - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - /** - * Getter for the application's client name related to this event. - * - * @return the application's client name. - */ - @JsonProperty("client_name") - public String getClientName() { - return clientName; - } - - /** - * Getter for the IP address related to this event. - * - * @return the IP address. - */ - @JsonProperty("ip") - public String getIP() { - return ip; - } - - /** - * Getter for the user id related to this event. - * - * @return the user id. - */ - @JsonProperty("user_id") - public String getUserId() { - return userId; - } - - /** - * Getter for the scope of this event. - * @return the scope. - */ - @JsonProperty("scope") - public Object getScope() { - return scope; - } - - /** - * Getter for the strategy of this event. - * @return the strategy. - */ - @JsonProperty("strategy") - public String getStrategy() { - return strategy; - } - - /** - * Getter for the strategy type of this event. - * @return the strategy type. - */ - @JsonProperty("strategy_type") - public String getStrategyType() { - return strategyType; - } - - /** - * Getter for the isMobile flag of this event. - * @return the isMobile flag. - */ - @JsonProperty("isMobile") - public boolean isMobile() { - return isMobile; - } - - /** - * Getter for the user agent related to this event. - * @return the user agent. - */ - @JsonProperty("user_agent") - public String getUserAgent() { - return userAgent; - } - - /** - * Getter for the user name related to this event. - * - * @return the user id. - */ - @JsonProperty("user_name") - public String getUserName() { - return userName; - } - - /** - * Getter for the location info object. - * - * @return the location info object. - */ - @JsonProperty("location_info") - public Map getLocationInfo() { - return locationInfo; - } - - /** - * Getter for the details object. - * - * @return the details object. - */ - @JsonProperty("details") - public Map getDetails() { - return details; - } - - /** - * @return the connection. - */ - public String getConnection() { - return connection; - } - - /** - * @return the connection ID - */ - public String getConnectionId() { - return connectionId; - } - - /** - * @return the description. - */ - public String getDescription() { - return description; - } - - /** - * @return the hostname. - */ - public String getHostname() { - return hostname; - } - - /** - * @return the audience. - */ - public String getAudience() { - return audience; - } - - /** - * @return the organization ID. - */ - public String getOrganizationId() { - return organizationId; - } - - /** - * @return the organization name. - */ - public String getOrganizationName() { - return organizationName; - } - - /** - * @return the tenant name. - */ - public String getTenantName() { - return tenantName; - } - - /** - * Getter for the event schema object. - * @return the event schema object. - */ - public Object getEventSchema() { - return eventSchema; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPage.java b/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPage.java deleted file mode 100644 index 2a3973d23..000000000 --- a/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.logevents; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Log Events. Related to the {@link com.auth0.client.mgmt.LogEventsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = LogEventsPageDeserializer.class) -public class LogEventsPage extends Page { - - public LogEventsPage(List items) { - super(items); - } - - public LogEventsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} \ No newline at end of file diff --git a/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPageDeserializer.java deleted file mode 100644 index 7cf3a7a61..000000000 --- a/src/main/java/com/auth0/json/mgmt/logevents/LogEventsPageDeserializer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.logevents; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link LogEventsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.LogEventsEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class LogEventsPageDeserializer extends PageDeserializer { - - protected LogEventsPageDeserializer() { - super(LogEvent.class, "logs"); - } - - @Override - protected LogEventsPage createPage(List items) { - return new LogEventsPage(items); - } - - @Override - protected LogEventsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new LogEventsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/logstreams/LogStream.java b/src/main/java/com/auth0/json/mgmt/logstreams/LogStream.java deleted file mode 100644 index 52b871726..000000000 --- a/src/main/java/com/auth0/json/mgmt/logstreams/LogStream.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.auth0.json.mgmt.logstreams; - -import com.fasterxml.jackson.annotation.*; - -import java.util.List; -import java.util.Map; - -/** - * Represents an Auth0 Log Stream object. Related to the {@linkplain com.auth0.client.mgmt.LogStreamsEntity} - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class LogStream { - - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("type") - private final String type; - @JsonProperty("status") - private String status; - @JsonProperty("sink") - private Map sink; - - @JsonProperty("filters") - private List filters; - - /** - * Creates a new LogStream instance and sets the type, which cannot be changed once set. - * - * @param type The type of the Log Stream. - */ - @JsonCreator - public LogStream(@JsonProperty("type") String type) { - this.type = type; - } - - /** - * Creates a new empty LogStream. Use this when you need to create an instance for use with an update request, as - * you cannot send the {@code type} field to the update API. - */ - public LogStream() { - this(null); - } - - /** - * Get the ID of this Log Stream. - * - * @return The ID of this Log Stream. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Get the name of this Log Stream. - * - * @return The name of this Log Stream. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets the name of this Log Stream. - * - * @param name the name to set. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Gets the type of this Log Stream. - * - * @return The type of this Log Stream. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Gets the status of this Log Stream. - * - * @return The status of this Log Stream. - */ - @JsonProperty("status") - public String getStatus() { - return status; - } - - /** - * Sets the status of this Log Stream. - * - * @param status The status to set. - */ - @JsonProperty("status") - public void setStatus(String status) { - this.status = status; - } - - /** - * Gets the sink of this Log Stream. - * - * @return the sink of this Log Stream. - */ - @JsonProperty("sink") - public Map getSink() { - return sink; - } - - /** - * Sets the sink of this Log Stream. - * - * @param sink A key-value map representing the sink to set. - */ - @JsonProperty("sink") - public void setSink(Map sink) { - this.sink = sink; - } - - /** - * @return the log stream filters - */ - @JsonProperty("filters") - public List getFilters() { - return filters; - } - - /** - * Set the log stream filters. - * - * @param filters the filters to set for the log stream. - */ - @JsonProperty("filters") - public void setFilters(List filters) { - this.filters = filters; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/logstreams/LogStreamFilter.java b/src/main/java/com/auth0/json/mgmt/logstreams/LogStreamFilter.java deleted file mode 100644 index 3e254c635..000000000 --- a/src/main/java/com/auth0/json/mgmt/logstreams/LogStreamFilter.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.auth0.json.mgmt.logstreams; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents an Auth0 Log Stream Filter object. Related to the {@linkplain com.auth0.client.mgmt.LogStreamsEntity} - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class LogStreamFilter { - - @JsonProperty("type") - private String type; - @JsonProperty("name") - private String name; - - /** - * Create a new instance. - * - * @param type the log stream filter type. - * @param name the log stream filter name. - */ - @JsonCreator - public LogStreamFilter(@JsonProperty("type") String type, @JsonProperty("name") String name) { - this.type = type; - this.name = name; - } - - /** - * @return the log stream filter type. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Set the log stream filter type. - * @param type the log stream filter type. - */ - @JsonProperty("type") - public void setType(String type) { - this.type = type; - } - - /** - * @return the log stream filter name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/Action.java b/src/main/java/com/auth0/json/mgmt/networkacls/Action.java deleted file mode 100644 index 029d86118..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/Action.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Action { - @JsonProperty("block") - private Boolean block; - @JsonProperty("allow") - private Boolean allow; - @JsonProperty("log") - private Boolean log; - @JsonProperty("redirect") - private Boolean redirect; - @JsonProperty("redirect_uri") - private String redirectUri; - - /** - * Getter for the block action. - * @return true if the action is to block. - */ - @JsonProperty("block") - public Boolean isBlock() { - return block; - } - - /** - * Setter for the block action. - * @param block true to set the action as block, false otherwise. - */ - @JsonProperty("block") - public void setBlock(Boolean block) { - this.block = block; - } - - /** - * Getter for the allow action. - * @return true if the action is to allow. - */ - @JsonProperty("allow") - public Boolean isAllow() { - return allow; - } - - /** - * Setter for the allow action. - * @param allow true to set the action as allow, false otherwise. - */ - @JsonProperty("allow") - public void setAllow(Boolean allow) { - this.allow = allow; - } - - /** - * Getter for the log action. - * @return true if the action is to log. - */ - @JsonProperty("log") - public Boolean isLog() { - return log; - } - - /** - * Setter for the log action. - * @param log true to set the action as log, false otherwise. - */ - @JsonProperty("log") - public void setLog(Boolean log) { - this.log = log; - } - - /** - * Getter for the redirect action. - * @return true if the action is to redirect. - */ - @JsonProperty("redirect") - public Boolean isRedirect() { - return redirect; - } - - /** - * Setter for the redirect action. - * @param redirect true to set the action as redirect, false otherwise. - */ - @JsonProperty("redirect") - public void setRedirect(Boolean redirect) { - this.redirect = redirect; - } - - /** - * Getter for the redirect URI. - * @return the redirect URI if set, null otherwise. - */ - public String getRedrectUri() { - return redirectUri; - } - - /** - * Setter for the redirect URI. - * @param redrectUri the URI to set for redirection. - */ - public void setRedrectUri(String redrectUri) { - this.redirectUri = redrectUri; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/Match.java b/src/main/java/com/auth0/json/mgmt/networkacls/Match.java deleted file mode 100644 index dd8759eae..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/Match.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Match { - private List asns; - @JsonProperty("geo_country_codes") - private List geoCountryCodes; - @JsonProperty("geo_subdivision_codes") - private List geoSubdivisionCodes; - @JsonProperty("ipv4_cidrs") - private List ipv4Cidrs; - @JsonProperty("ipv6_cidrs") - private List ipv6Cidrs; - @JsonProperty("ja3_fingerprints") - private List ja3Fingerprints; - @JsonProperty("ja4_fingerprints") - private List ja4Fingerprints; - @JsonProperty("user_agents") - private List userAgents; - - /** - * Getter for the ASNs. - * @return a list of ASNs. - */ - public List getAsns() { - return asns; - } - - /** - * Setter for the ASNs. - * @param asns a list of ASNs to set. - */ - public void setAsns(List asns) { - this.asns = asns; - } - - /** - * Getter for the geo country codes. - * @return a list of geo country codes. - */ - public List getGeoCountryCodes() { - return geoCountryCodes; - } - - /** - * Setter for the geo country codes. - * @param geoCountryCodes a list of geo country codes to set. - */ - public void setGeoCountryCodes(List geoCountryCodes) { - this.geoCountryCodes = geoCountryCodes; - } - - /** - * Getter for the geo subdivision codes. - * @return a list of geo subdivision codes. - */ - public List getGeoSubdivisionCodes() { - return geoSubdivisionCodes; - } - - /** - * Setter for the geo subdivision codes. - * @param geoSubdivisionCodes a list of geo subdivision codes to set. - */ - public void setGeoSubdivisionCodes(List geoSubdivisionCodes) { - this.geoSubdivisionCodes = geoSubdivisionCodes; - } - - /** - * Getter for the IPv4 CIDRs. - * @return a list of IPv4 CIDRs. - */ - public List getIpv4Cidrs() { - return ipv4Cidrs; - } - - /** - * Setter for the IPv4 CIDRs. - * @param ipv4Cidrs a list of IPv4 CIDRs to set. - */ - public void setIpv4Cidrs(List ipv4Cidrs) { - this.ipv4Cidrs = ipv4Cidrs; - } - - /** - * Getter for the IPv6 CIDRs. - * @return a list of IPv6 CIDRs. - */ - public List getIpv6Cidrs() { - return ipv6Cidrs; - } - - /** - * Setter for the IPv6 CIDRs. - * @param ipv6Cidrs a list of IPv6 CIDRs to set. - */ - public void setIpv6Cidrs(List ipv6Cidrs) { - this.ipv6Cidrs = ipv6Cidrs; - } - - /** - * Getter for the JA3 fingerprints. - * @return a list of JA3 fingerprints. - */ - public List getJa3Fingerprints() { - return ja3Fingerprints; - } - - /** - * Setter for the JA3 fingerprints. - * @param ja3Fingerprints a list of JA3 fingerprints to set. - */ - public void setJa3Fingerprints(List ja3Fingerprints) { - this.ja3Fingerprints = ja3Fingerprints; - } - - /** - * Getter for the JA4 fingerprints. - * @return a list of JA4 fingerprints. - */ - public List getJa4Fingerprints() { - return ja4Fingerprints; - } - - /** - * Setter for the JA4 fingerprints. - * @param ja4Fingerprints a list of JA4 fingerprints to set. - */ - public void setJa4Fingerprints(List ja4Fingerprints) { - this.ja4Fingerprints = ja4Fingerprints; - } - - /** - * Getter for the user agents. - * @return a list of user agents. - */ - public List getUserAgents() { - return userAgents; - } - - /** - * Setter for the user agents. - * @param userAgents a list of user agents to set. - */ - public void setUserAgents(List userAgents) { - this.userAgents = userAgents; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAcls.java b/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAcls.java deleted file mode 100644 index 3385fa343..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAcls.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class NetworkAcls { - @JsonProperty("description") - private String description; - @JsonProperty("active") - private boolean active; - @JsonProperty("priority") - private int priority; - @JsonProperty("id") - private String id; - @JsonProperty("rule") - private Rule rule; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("updated_at") - private String updatedAt; - - /** - * Getter for the ID of the network ACL. - * @return the ID of the network ACL. - */ - public String getId() { - return id; - } - - /** - * Getter for the creation timestamp of the network ACL. - * @return the creation timestamp of the network ACL. - */ - public String getCreatedAt() { - return createdAt; - } - - /** - * Getter for the last updated timestamp of the network ACL. - * @return the last updated timestamp of the network ACL. - */ - public String getUpdatedAt() { - return updatedAt; - } - - /** - * Getter for the description of the network ACL. - * @return the description of the network ACL. - */ - public String getDescription() { - return description; - } - - /** - * Setter for the description of the network ACL. - * @param description the description to set for the network ACL. - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * Checks if the network ACL is active. - * @return true if the network ACL is active, false otherwise. - */ - @JsonProperty("active") - public boolean isActive() { - return active; - } - - /** - * Setter for the active status of the network ACL. - * @param active true to set the network ACL as active, false to set it as inactive. - */ - @JsonProperty("active") - public void setActive(boolean active) { - this.active = active; - } - - /** - * Getter for the priority of the network ACL. - * @return the priority of the network ACL. - */ - public int getPriority() { - return priority; - } - - /** - * Setter for the priority of the network ACL. - * @param priority the priority to set for the network ACL. - */ - public void setPriority(int priority) { - this.priority = priority; - } - - /** - * Getter for the rule associated with the network ACL. - * @return the rule of the network ACL. - */ - public Rule getRule() { - return rule; - } - - /** - * Setter for the rule associated with the network ACL. - * @param rule the rule to set for the network ACL. - */ - public void setRule(Rule rule) { - this.rule = rule; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPage.java b/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPage.java deleted file mode 100644 index 192b8ab40..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPage.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = NetworkAclsPageDeserializer.class) -public class NetworkAclsPage extends Page { - - public NetworkAclsPage(List items) { - super(items); - } - - public NetworkAclsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageDeserializer.java deleted file mode 100644 index 100fd5bde..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageDeserializer.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -public class NetworkAclsPageDeserializer extends PageDeserializer { - protected NetworkAclsPageDeserializer() { - super(NetworkAcls.class, "network_acls"); - } - - @Override - protected NetworkAclsPage createPage(List items) { - return new NetworkAclsPage(items); - } - - @Override - protected NetworkAclsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new NetworkAclsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/networkacls/Rule.java b/src/main/java/com/auth0/json/mgmt/networkacls/Rule.java deleted file mode 100644 index dad6bca7f..000000000 --- a/src/main/java/com/auth0/json/mgmt/networkacls/Rule.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Rule { - @JsonProperty("action") - private Action action; - @JsonProperty("match") - private Match match; - @JsonProperty("not_match") - private Match notMatch; - @JsonProperty("scope") - private String scope; - - /** - * Getter for the action associated with the rule. - * @return the action. - */ - public Action getAction() { - return action; - } - - /** - * Setter for the action associated with the rule. - * @param action the action to set. - */ - public void setAction(Action action) { - this.action = action; - } - - /** - * Getter for the match criteria of the rule. - * @return the match criteria. - */ - public Match getMatch() { - return match; - } - - /** - * Setter for the match criteria of the rule. - * @param match the match criteria to set. - */ - public void setMatch(Match match) { - this.match = match; - } - - /** - * Getter for the not match criteria of the rule. - * @return the not match criteria. - */ - public Match getNotMatch() { - return notMatch; - } - - /** - * Setter for the not match criteria of the rule. - * @param notMatch the not match criteria to set. - */ - public void setNotMatch(Match notMatch) { - this.notMatch = notMatch; - } - - /** - * Getter for the scope of the rule. - * @return the scope of the rule. - */ - public String getScope() { - return scope; - } - - /** - * Setter for the scope of the rule. - * @param scope the scope to set for the rule. - */ - public void setScope(String scope) { - this.scope = scope; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Branding.java b/src/main/java/com/auth0/json/mgmt/organizations/Branding.java deleted file mode 100644 index c901a8b2e..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Branding.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the branding object of an {@linkplain Organization}. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Branding { - - @JsonProperty("logo_url") - private String logoUrl; - @JsonProperty("colors") - private Colors colors; - - /** - * @return the value of the logo URL - */ - public String getLogoUrl() { - return logoUrl; - } - - /** - * Sets the value of the logo URL to display on the login page - * - * @param logoUrl the logo URL to display on the login page. Must be an HTTPS URL or null. - */ - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - /** - * @return the {@linkplain Colors} for this Branding instance. - */ - public Colors getColors() { - return colors; - } - - /** - * Sets the value of the {@linkplain Colors} for this Branding instance. - * - * @param colors the colors associated with this Branding instance. - */ - public void setColors(Colors colors) { - this.colors = colors; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Colors.java b/src/main/java/com/auth0/json/mgmt/organizations/Colors.java deleted file mode 100644 index 82c2b8bee..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Colors.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the colors object of a {@linkplain Branding}. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Colors { - - @JsonProperty("primary") - private String primary; - @JsonProperty("page_background") - private String pageBackground; - - public Colors() {} - - /** - * Create a new instance. - * - * @param primary the HEX color for primary elements. - * @param pageBackground the HEX color for background. - */ - public Colors(@JsonProperty("primary") String primary, @JsonProperty("page_background") String pageBackground) { - this.primary = primary; - this.pageBackground = pageBackground; - } - - /** - * @return the primary color value. - */ - public String getPrimary() { - return primary; - } - - /** - * Sets the color for primary elements. - * - * @param primary the HEX color for primary elements. - */ - public void setPrimary(String primary) { - this.primary = primary; - } - - /** - * @return the background color value. - */ - public String getPageBackground() { - return pageBackground; - } - - /** - * Sets the color for the background. - * - * @param pageBackground the HEX color for the background. - */ - public void setPageBackground(String pageBackground) { - this.pageBackground = pageBackground; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Connection.java b/src/main/java/com/auth0/json/mgmt/organizations/Connection.java deleted file mode 100644 index e37b38617..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Connection.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the Connection object of an {@linkplain EnabledConnection}. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Connection { - - @JsonProperty("name") - private String name; - @JsonProperty("strategy") - private String strategy; - - /** - * @return the name of the connection. - */ - public String getName() { - return this.name; - } - - /** - * Sets the name of the connection. - * - * @param name the name of the connection. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the strategy of the connection - */ - public String getStrategy() { - return this.strategy; - } - - /** - * Sets the strategy of this connection. - * - * @param strategy the strategy of the connection. - */ - public void setStrategy(String strategy) { - this.strategy = strategy; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/ConnectionsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/organizations/ConnectionsPageDeserializer.java deleted file mode 100644 index bf08def5d..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/ConnectionsPageDeserializer.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain EnabledConnectionsPage} representation. - */ -public class ConnectionsPageDeserializer extends PageDeserializer { - protected ConnectionsPageDeserializer() { - super(EnabledConnection.class, "enabled_connections"); - } - - @Override - protected EnabledConnectionsPage createPage(List items) { - return new EnabledConnectionsPage(items); - } - - @Override - protected EnabledConnectionsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new EnabledConnectionsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/CreateOrganizationClientGrantRequestBody.java b/src/main/java/com/auth0/json/mgmt/organizations/CreateOrganizationClientGrantRequestBody.java deleted file mode 100644 index 451276db3..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/CreateOrganizationClientGrantRequestBody.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the body of the request to send when associating a client grant with an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity#addClientGrant(String, CreateOrganizationClientGrantRequestBody) - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class CreateOrganizationClientGrantRequestBody { - - @JsonProperty("grant_id") - private String grantId; - - /** - * Create a new instance. - * @param grantId the ID of the grant. - */ - @JsonCreator - public CreateOrganizationClientGrantRequestBody(String grantId) { - this.grantId = grantId; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java b/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java deleted file mode 100644 index 0361ea608..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the enabled connection object for an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EnabledConnection { - - @JsonProperty("connection") - private Connection connection; - @JsonProperty("assign_membership_on_login") - private boolean assignMembershipOnLogin; - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("show_as_button") - private Boolean showAsButton; - @JsonProperty("is_signup_enabled") - private Boolean isSignupEnabled; - - public EnabledConnection() {} - - /** - * Create a new instance. - * - * @param connectionId the ID of the connection - */ - public EnabledConnection(@JsonProperty("connection_id") String connectionId) { - this.connectionId = connectionId; - } - - /** - * @return the value of the {@linkplain Connection}. - */ - public Connection getConnection() { - return connection; - } - - /** - * Sets the value of the {@linkplain Connection}. - * - * @param connection the {@linkplain Connection} to set. - */ - public void setConnection(Connection connection) { - this.connection = connection; - } - - /** - * @return whether users will automatically granted membership in the organization when logging in. - */ - public boolean isAssignMembershipOnLogin() { - return assignMembershipOnLogin; - } - - /** - * Sets whether users will be automatically granted membership in the organization when logging in. - * - * @param assignMembershipOnLogin {@code true} to grant membership in the organization automatically when logging in, {@code false} to require membership to be granted prior to logging with this connection. - */ - public void setAssignMembershipOnLogin(boolean assignMembershipOnLogin) { - this.assignMembershipOnLogin = assignMembershipOnLogin; - } - - /** - * @return the value of the connection ID. - */ - public String getConnectionId() { - return connectionId; - } - - /** - * Sets the connection ID. - * - * @param connectionId the connection ID. - */ - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @return the value of the {@code show_as_button} field. - */ - public Boolean getShowAsButton() { - return showAsButton; - } - - /** - * Sets the {@code show_as_button} value. - * - * @param showAsButton the value for {@code show_as_button}. - */ - public void setShowAsButton(Boolean showAsButton) { - this.showAsButton = showAsButton; - } - - /** - * @return whether signup is enabled for this connection. - */ - @JsonProperty("is_signup_enabled") - public Boolean getSignupEnabled() { - return isSignupEnabled; - } - - /** - * Sets whether signup is enabled for this connection. - * @param signupEnabled {@code true} to enable signup, {@code false} to disable it. - */ - @JsonProperty("is_signup_enabled") - public void setSignupEnabled(Boolean signupEnabled) { - isSignupEnabled = signupEnabled; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPage.java b/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPage.java deleted file mode 100644 index 7410e2e3b..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of the enabled connections for an organization. - * @see EnabledConnection - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ConnectionsPageDeserializer.class) -public class EnabledConnectionsPage extends Page { - - public EnabledConnectionsPage(List items) { - super(items); - } - - public EnabledConnectionsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Invitation.java b/src/main/java/com/auth0/json/mgmt/organizations/Invitation.java deleted file mode 100644 index 79b93cb50..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Invitation.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.*; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * Represents the Invitation object for an organization. - * - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Invitation { - - @JsonProperty("id") - private String id; - @JsonProperty("inviter") - private Inviter inviter; - @JsonProperty("invitee") - private Invitee invitee; - @JsonProperty("ttl_sec") - private Integer ttlInSeconds; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("app_metadata") - private Map appMetadata; - @JsonProperty("user_metadata") - private Map userMetadata; - @JsonProperty("send_invitation_email") - private Boolean sendInvitationEmail; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - private Date createdAt; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("expires_at") - private Date expiresAt; - @JsonProperty("ticket_id") - private String ticketId; - @JsonProperty("invitation_url") - private String invitationUrl; - @JsonProperty("organization_id") - private String organizationId; - @JsonProperty("roles") - private List roles; - - /** - * Create a new instance. - * - * @param inviter the {@linkplain Inviter} of this invitation. - * @param invitee the {@linkplain Invitee} of this invitation. - * @param clientId Auth0 client ID. Used to resolve the application's login initiation endpoint. - */ - @JsonCreator - public Invitation(@JsonProperty("inviter") Inviter inviter, @JsonProperty("invitee") Invitee invitee, @JsonProperty("client_id") String clientId) { - this.inviter = inviter; - this.invitee = invitee; - this.clientId = clientId; - } - - /** - * @return the ID of this invitation. - */ - public String getId() { - return id; - } - - /** - * @return the {@linkplain Inviter} of this invitation. - */ - public Inviter getInviter() { - return inviter; - } - - /** - * @return the {@linkplain Invitee} of this invitation. - */ - public Invitee getInvitee() { - return invitee; - } - - /** - * @return the number of seconds before this invitation expires. - */ - public Integer getTtlInSeconds() { - return ttlInSeconds; - } - - /** - * Sets the number of seconds before this invitation expires. - * If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days). - * - * @param ttlInSeconds the number of seconds before this invitation expires. - */ - public void setTtlInSeconds(Integer ttlInSeconds) { - this.ttlInSeconds = ttlInSeconds; - } - - /** - * @return the client ID of this invitation. - */ - public String getClientId() { - return clientId; - } - - /** - * @return the connection ID of this invitation. - */ - public String getConnectionId() { - return connectionId; - } - - /** - * Sets the ID of the connection for the inviter to authenticate with. - * - * @param connectionId the ID of the connection. - */ - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @return the app metadata of this invitation. - */ - public Map getAppMetadata() { - return appMetadata; - } - - /** - * Sets the app metadata associated with this invitation. - * - * @param appMetadata the app metadata. - */ - public void setAppMetadata(Map appMetadata) { - this.appMetadata = appMetadata; - } - - /** - * @return the user metadata of this invitation. - */ - public Map getUserMetadata() { - return userMetadata; - } - - /** - * Sets the user metadata associated with this invitation. - * - * @param userMetadata the user metadata. - */ - public void setUserMetadata(Map userMetadata) { - this.userMetadata = userMetadata; - } - - /** - * @return whether the user will receive an invitation email (true) or no email (false). - */ - public Boolean isSendInvitationEmail() { - return sendInvitationEmail; - } - - /** - * Whether the user will receive an invitation email (true) or no email (false). If not specified, default value is true. - * - * @param sendInvitationEmail whether to send the user an invitation email or not. - */ - public void setSendInvitationEmail(Boolean sendInvitationEmail) { - this.sendInvitationEmail = sendInvitationEmail; - } - - /** - * @return the date this invitation was created at. - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return the date this invitation expires. - */ - public Date getExpiresAt() { - return expiresAt; - } - - /** - * @return the ID of the invitation ticket. - */ - public String getTicketId() { - return ticketId; - } - - /** - * @return the roles associated with the user invited. - */ - @JsonIgnore - public Roles getRoles() { - return new Roles(roles); - } - - /** - * Sets the roles to be associated with the user invited. - * - * @param roles the {@linkplain Roles} to associated with the user invited. - */ - @JsonIgnore - public void setRoles(Roles roles) { - this.roles = roles.getRoles(); - } - - /** - * @return the invitation url to be send to the invitee. - */ - public String getInvitationUrl() { - return invitationUrl; - } - - /** - * @return the ID of the organization for this invitation. - */ - public String getOrganizationId() { - return organizationId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPage.java b/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPage.java deleted file mode 100644 index 223d7f89f..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of Invitations. - * @see Invitation - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = InvitationsPageDeserializer.class) -public class InvitationsPage extends Page { - - public InvitationsPage(List items) { - super(items); - } - - public InvitationsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPageDeserializer.java deleted file mode 100644 index 94408ccdb..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/InvitationsPageDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain InvitationsPage} representation. - */ -public class InvitationsPageDeserializer extends PageDeserializer { - - protected InvitationsPageDeserializer() { - super(Invitation.class, "invitations"); - } - - @Override - protected InvitationsPage createPage(List items) { - return new InvitationsPage(items); - } - - @Override - protected InvitationsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new InvitationsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Invitee.java b/src/main/java/com/auth0/json/mgmt/organizations/Invitee.java deleted file mode 100644 index 145c43936..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Invitee.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the Invitee object for an Invitation. - * @see Invitation - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Invitee { - - @JsonProperty("email") - private String email; - - /** - * Create a new instance. - * - * @param email the email of the Invitee. - */ - public Invitee(@JsonProperty("email") String email) { - this.email = email; - } - - /** - * @return the email of this Invitee. - */ - public String getEmail() { - return email; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Inviter.java b/src/main/java/com/auth0/json/mgmt/organizations/Inviter.java deleted file mode 100644 index fb8091ce9..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Inviter.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the Inviter object for an Invitation. - * @see Invitation - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Inviter { - - @JsonProperty("name") - private String name; - - /** - * Create a new instance. - * - * @param name the name of the Inviter. - */ - public Inviter(@JsonProperty("name") String name) { - this.name = name; - } - - /** - * @return the name of this Inviter. - */ - public String getName() { - return name; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Member.java b/src/main/java/com/auth0/json/mgmt/organizations/Member.java deleted file mode 100644 index 5c1f073fa..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Member.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.roles.Role; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the member of an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Member { - - @JsonProperty("user_id") - private String userId; - @JsonProperty("email") - private String email; - @JsonProperty("picture") - private String picture; - @JsonProperty("name") - private String name; - @JsonProperty("roles") - private List roles; - - /** - * @return the user ID of this Member. - */ - public String getUserId() { - return userId; - } - - /** - * @return the user ID of this Member. - */ - public String getEmail() { - return email; - } - - /** - * Sets the email of this Member. - * - * @param email the email of this Member. - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * @return the URL for this Member's picture. - */ - public String getPicture() { - return picture; - } - - /** - * Sets the URL for this Member's picture. - * - * @param picture the URL of this Member's picture. - */ - public void setPicture(String picture) { - this.picture = picture; - } - - /** - * @return the name of this Member. - */ - public String getName() { - return name; - } - - /** - * Sets the name of this Member. - * - * @param name the name of this Member. - */ - public void setName(String name) { - this.name = name; - } - - public List getRoles() { - return roles; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Members.java b/src/main/java/com/auth0/json/mgmt/organizations/Members.java deleted file mode 100644 index d5a68bade..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Members.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the request body when adding or deleting members from an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Members { - - @JsonProperty("members") - private List members; - - /** - * Create a new instance. - * - * @param members a list of {@linkplain Member} - */ - @JsonCreator - public Members(@JsonProperty("members") List members) { - this.members = members; - } - - /** - * @return the list of members. - */ - public List getMembers() { - return members; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/MembersPage.java b/src/main/java/com/auth0/json/mgmt/organizations/MembersPage.java deleted file mode 100644 index c85f9e4d1..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/MembersPage.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of Members of an organization. - * @see Member - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = MembersPageDeserializer.class) -public class MembersPage extends Page { - public MembersPage(List items) { - super(items); - } - - /** - * @deprecated Use {@linkplain MembersPage#MembersPage(Integer, Integer, Integer, Integer, String, List)} instead. - */ - @Deprecated - public MembersPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public MembersPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/MembersPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/organizations/MembersPageDeserializer.java deleted file mode 100644 index 6139cf329..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/MembersPageDeserializer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain MembersPage} representation. - */ -public class MembersPageDeserializer extends PageDeserializer { - - protected MembersPageDeserializer() { - super(Member.class, "members"); - } - - @Override - protected MembersPage createPage(List items) { - return new MembersPage(items); - } - - @Override - @SuppressWarnings("deprecation") - protected MembersPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new MembersPage(start, length, total, limit, items); - } - - @Override - protected MembersPage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new MembersPage(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Organization.java b/src/main/java/com/auth0/json/mgmt/organizations/Organization.java deleted file mode 100644 index 1b7142492..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Organization.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * Represents the organization object. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Organization { - - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("metadata") - private Map metadata; - @JsonProperty("branding") - private Branding branding; - @JsonProperty("enabled_connections") - private List enabledConnections; - @JsonProperty("token_quota") - private TokenQuota tokenQuota; - - public Organization() {} - - /** - * Create a new instance. - * - * @param name the name of this organization. - */ - @JsonCreator - public Organization(@JsonProperty("name") String name) { - this.name = name; - } - - /** - * @return the ID of this organization. - */ - public String getId() { - return id; - } - - /** - * @return the name of this Organization. - */ - public String getName() { - return name; - } - - /** - * Sets the name of this Organization. - * - * @param name the name of the Organization. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the display name of this Organization. - */ - public String getDisplayName() { - return displayName; - } - - /** - * Sets the display name of this Organization. - * - * @param displayName the display name of this Organization. - */ - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * @return the {@linkplain Branding} of this Organization. - */ - public Branding getBranding() { - return branding; - } - - /** - * Sets the {@linkplain Branding} of this Organization. - * - * @param branding the {@linkplain Branding} of this Organization. - */ - public void setBranding(Branding branding) { - this.branding = branding; - } - - /** - * @return the metadata of this Organization. - */ - public Map getMetadata() { - return metadata; - } - - /** - * Sets the metadata of this Organization. - * - * @param metadata the metadata of this Organization. - */ - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - /** - * @return the enabled connections of this Organization. - * @deprecated the {@code enabled_connections} property was removed from the API response body, so this will always - * return {@code null}. Use {@link com.auth0.client.mgmt.OrganizationsEntity#getConnections(String, PageFilter)} - * instead. - */ - @Deprecated - public List getEnabledConnections() { - return enabledConnections; - } - - /** - * Sets the enabled connections of this Organization. - * - * @param enabledConnections the metadata of this Organization. - */ - public void setEnabledConnections(List enabledConnections) { - this.enabledConnections = enabledConnections; - } - - /** - * @return the token quota of this Organization. - */ - public TokenQuota getTokenQuota() { - return tokenQuota; - } - - /** - * Sets the token quota of this Organization. - * - * @param tokenQuota the token quota of this Organization. - */ - public void setTokenQuota(TokenQuota tokenQuota) { - this.tokenQuota = tokenQuota; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrant.java b/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrant.java deleted file mode 100644 index 358fd3792..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrant.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents a client grant associated with an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class OrganizationClientGrant { - @JsonProperty("id") - private String id; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("audience") - private String audience; - @JsonProperty("scope") - private List scope; - - /** - * Getter for the id of the client grant. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the client id of the application. - * - * @return the application's client id. - */ - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - /** - * Setter for the application's client id. - * - * @param clientId the application's client id to set. - */ - @JsonProperty("client_id") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Getter for the audience. - * - * @return the audience. - */ - @JsonProperty("audience") - public String getAudience() { - return audience; - } - - /** - * Setter for the audience. - * - * @param audience the audience to set. - */ - @JsonProperty("audience") - public void setAudience(String audience) { - this.audience = audience; - } - - /** - * Getter for the scope. - * - * @return the scope. - */ - @JsonProperty("scope") - public List getScope() { - return scope; - } - - /** - * Setter for the scope. - * - * @param scope the scope to set. - */ - @JsonProperty("scope") - public void setScope(List scope) { - this.scope = scope; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPage.java b/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPage.java deleted file mode 100644 index faa2961c7..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of a response when getting the client grants associated with an organization. - * @see OrganizationClientGrant - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = OrganizationClientGrantsPageDeserializer.class) -public class OrganizationClientGrantsPage extends Page { - - public OrganizationClientGrantsPage(List items) { - super(items); - } - - public OrganizationClientGrantsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageDeserializer.java deleted file mode 100644 index c334e7599..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain OrganizationClientGrant} representation. - */ -public class OrganizationClientGrantsPageDeserializer extends PageDeserializer { - - OrganizationClientGrantsPageDeserializer() { - super(OrganizationClientGrant.class, "client_grants"); - } - - @Override - protected OrganizationClientGrantsPage createPage(List items) { - return new OrganizationClientGrantsPage(items); - } - - @Override - protected OrganizationClientGrantsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new OrganizationClientGrantsPage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPage.java b/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPage.java deleted file mode 100644 index b9c8876b5..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPage.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of an Organization. - * @see Organization - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = OrganizationsPageDeserializer.class) -public class OrganizationsPage extends Page { - public OrganizationsPage(List items) { - super(items); - } - - /** - * @deprecated use {@linkplain OrganizationsPage#OrganizationsPage(Integer, Integer, Integer, Integer, String, List)} instead. - */ - @Deprecated - public OrganizationsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public OrganizationsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPageDeserializer.java deleted file mode 100644 index 02df0a68f..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/OrganizationsPageDeserializer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain OrganizationsPage} representation. - */ -public class OrganizationsPageDeserializer extends PageDeserializer { - - protected OrganizationsPageDeserializer() { - super(Organization.class, "organizations"); - } - - @Override - protected OrganizationsPage createPage(List items) { - return new OrganizationsPage(items); - } - - @Override - @SuppressWarnings("deprecation") - protected OrganizationsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new OrganizationsPage(start, length, total, limit, items); - } - - @Override - protected OrganizationsPage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new OrganizationsPage(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/organizations/Roles.java b/src/main/java/com/auth0/json/mgmt/organizations/Roles.java deleted file mode 100644 index 2ef99ce8d..000000000 --- a/src/main/java/com/auth0/json/mgmt/organizations/Roles.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Represents the request body when adding or deleting roles from a member of an organization. - * @see com.auth0.client.mgmt.OrganizationsEntity - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Roles { - - @JsonProperty("roles") - private List roles; - - /** - * Create a new instance. - * - * @param roles the list of Role IDs to associate with the member. - */ - public Roles(List roles) { - this.roles = roles; - } - - /** - * @return the list of Role IDs associated with the member. - */ - public List getRoles() { - return roles; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/permissions/Permission.java b/src/main/java/com/auth0/json/mgmt/permissions/Permission.java deleted file mode 100644 index 537076b86..000000000 --- a/src/main/java/com/auth0/json/mgmt/permissions/Permission.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 Permission object. Related to the {@link com.auth0.client.mgmt.RolesEntity} entity. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Permission { - - @JsonProperty("permission_name") - private String name; - - @JsonProperty("description") - private String description; - - @JsonProperty("resource_server_identifier") - private String resourceServerId; - - @JsonProperty("resource_server_name") - private String resourceServerName; - - @JsonProperty("sources") - private List sources; - - /** - * Getter for the role's name. - * - * @return the name of the role. - */ - @JsonProperty("permission_name") - public String getName() { - return name; - } - - /** - * Setter for the role's name. - * - * @param name the name of the role to set. - */ - @JsonProperty("permission_name") - public void setName(String name) { - this.name = name; - } - - /** - * The getter for the role's description. - * - * @return the description of the role. - */ - @JsonProperty("description") - public String getDescription() { - return description; - } - - /** - * Setter for the role's description. - * - * @param description the description of the role to set. - */ - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - /** - * Getter for the permissions's resource server identifier. - * - * @return the resource server identifier of the permission. - */ - @JsonProperty("resource_server_identifier") - public String getResourceServerId() { - return resourceServerId; - } - - /** - * Setter for the permissions's resource server identifier. - * - * @param resourceServerId the resource server identifier of the permission to set. - */ - @JsonProperty("resource_server_identifier") - public void setResourceServerId(String resourceServerId) { - this.resourceServerId = resourceServerId; - } - - /** - * Getter for the permissions's resource server name. - * - * @return the resource server name of the permission. - */ - @JsonProperty("resource_server_name") - public String getResourceServerName() { - return resourceServerName; - } - - /** - * Setter for the permissions's resource server name. - * - * @param resourceServerName the resource server name of the permission to set. - */ - @JsonProperty("resource_server_name") - public void setResourceServerName(String resourceServerName) { - this.resourceServerName = resourceServerName; - } - - /** - * Getter for the permission's sources. - * - * @return the permission sources. - */ - @JsonProperty("sources") - public List getSources() { - return sources; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/permissions/PermissionSource.java b/src/main/java/com/auth0/json/mgmt/permissions/PermissionSource.java deleted file mode 100644 index a3a6b4f52..000000000 --- a/src/main/java/com/auth0/json/mgmt/permissions/PermissionSource.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Permission's Source object. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PermissionSource { - - @JsonProperty("source_type") - private String type; - - @JsonProperty("source_name") - private String name; - - @JsonProperty("source_id") - private String id; - - /** - * Getter for the source's name. - * - * @return the name of the source. - */ - @JsonProperty("source_name") - public String getName() { - return name; - } - - /** - * Getter for the source's type. - * - * @return the type of the source. - */ - @JsonProperty("source_type") - public String getType() { - return type; - } - - /** - * Getter for the source's id. - * - * @return the id of the source. - */ - @JsonProperty("source_id") - public String getId() { - return id; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPage.java b/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPage.java deleted file mode 100644 index f13ac1026..000000000 --- a/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPage.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = PermissionsPageDeserializer.class) -public class PermissionsPage extends Page { - - public PermissionsPage(List items) { - super(items); - } - - public PermissionsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPageDeserializer.java deleted file mode 100644 index 74d71ffad..000000000 --- a/src/main/java/com/auth0/json/mgmt/permissions/PermissionsPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link PermissionsPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.RolesEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class PermissionsPageDeserializer extends PageDeserializer { - - PermissionsPageDeserializer() { - super(Permission.class, "permissions"); - } - - @Override - protected PermissionsPage createPage(List items) { - return new PermissionsPage(items); - } - - @Override - protected PermissionsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new PermissionsPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/prompts/Prompt.java b/src/main/java/com/auth0/json/mgmt/prompts/Prompt.java deleted file mode 100644 index b7e1ca3a2..000000000 --- a/src/main/java/com/auth0/json/mgmt/prompts/Prompt.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.prompts; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Prompt { - @JsonProperty("universal_login_experience") - private String universalLoginExperience; - @JsonProperty("identifier_first") - private boolean identifierFirst; - @JsonProperty("webauthn_platform_first_factor") - private boolean webauthnPlatformFirstFactor; - - /** - * Getter for the universal login experience. - * @return the universal login experience. - */ - public String getUniversalLoginExperience() { - return universalLoginExperience; - } - - /** - * Setter for the universal login experience. - * @param universalLoginExperience the universal login experience to set. - */ - public void setUniversalLoginExperience(String universalLoginExperience) { - this.universalLoginExperience = universalLoginExperience; - } - - /** - * Getter for the identifier first. - * @return the identifier first. - */ - public boolean isIdentifierFirst() { - return identifierFirst; - } - - /** - * Setter for the identifier first. - * @param identifierFirst the identifier first to set. - */ - public void setIdentifierFirst(boolean identifierFirst) { - this.identifierFirst = identifierFirst; - } - - /** - * Getter for the webauthn platform first factor. - * @return the webauthn platform first factor. - */ - public boolean isWebauthnPlatformFirstFactor() { - return webauthnPlatformFirstFactor; - } - - /** - * Setter for the webauthn platform first factor. - * @param webauthnPlatformFirstFactor the webauthn platform first factor to set. - */ - public void setWebauthnPlatformFirstFactor(boolean webauthnPlatformFirstFactor) { - this.webauthnPlatformFirstFactor = webauthnPlatformFirstFactor; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/refreshtokens/Device.java b/src/main/java/com/auth0/json/mgmt/refreshtokens/Device.java deleted file mode 100644 index e83e61339..000000000 --- a/src/main/java/com/auth0/json/mgmt/refreshtokens/Device.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Device { - @JsonProperty("initial_ip") - private String initialIp; - @JsonProperty("initial_asn") - private String initialAsn; - @JsonProperty("initial_user_agent") - private String initialUserAgent; - @JsonProperty("last_ip") - private String lastIp; - @JsonProperty("last_asn") - private String lastAsn; - @JsonProperty("last_user_agent") - private String lastUserAgent; - - /** - * @return First IP address associated with this session - */ - public String getInitialIp() { - return initialIp; - } - - /** - * @return First autonomous system number associated with this session - */ - public String getInitialAsn() { - return initialAsn; - } - - /** - * @return First user agent associated with this session - */ - public String getInitialUserAgent() { - return initialUserAgent; - } - - /** - * @return Last IP address from which this user logged in - */ - public String getLastIp() { - return lastIp; - } - - /** - * @return Last autonomous system number from which this user logged in - */ - public String getLastAsn() { - return lastAsn; - } - - /** - * @return Last user agent of the device from which this user logged in - */ - public String getLastUserAgent() { - return lastUserAgent; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshToken.java b/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshToken.java deleted file mode 100644 index 2efc36b00..000000000 --- a/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshToken.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RefreshToken { - @JsonProperty("id") - private String id; - @JsonProperty("user_id") - private String userId; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("idle_expires_at") - private Date idleExpiresAt; - @JsonProperty("expires_at") - private Date expiresAt; - @JsonProperty("device") - private Device device; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("session_id") - private String sessionId; - @JsonProperty("rotating") - private Boolean rotating; - @JsonProperty("resource_servers") - private List resourceServers; - @JsonProperty("last_exchanged_at") - private Date lastExchangedAt; - - /** - * @return The ID of the refresh token - */ - public String getId() { - return id; - } - - /** - * @return ID of the user which can be used when interacting with other APIs. - */ - public String getUserId() { - return userId; - } - - /** - * @return The date and time when the refresh token was created - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * - * @return The date and time when the refresh token will expire if idle - */ - public Date getIdleExpiresAt() { - return idleExpiresAt; - } - - /** - * - * @return The date and time when the refresh token will expire - */ - public Date getExpiresAt() { - return expiresAt; - } - - /** - * @return Device information - */ - public Device getDevice() { - return device; - } - - /** - * @return ID of the client application granted with this refresh token - */ - public String getClientId() { - return clientId; - } - - /** - * - * @return ID of the authenticated session used to obtain this refresh-token - */ - public String getSessionId() { - return sessionId; - } - - /** - * @return True if the token is a rotating refresh token - */ - public Boolean isRotating() { - return rotating; - } - - /** - * @return A list of the resource server IDs associated to this refresh-token and their granted scopes - */ - public List getResourceServers() { - return resourceServers; - } - - /** - * @return The date and time when the refresh token was last exchanged - */ - public Date getLastExchangedAt() { - return lastExchangedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPage.java b/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPage.java deleted file mode 100644 index 9aea796c3..000000000 --- a/src/main/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPage.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents a page of Refresh Tokens. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RefreshTokensPage { - @JsonProperty("total") - private Integer total; - - @JsonProperty("next") - private String next; - - @JsonProperty("tokens") - private List tokens; - - /** - * @return the total number of refresh tokens. This is only present when `include_totals` is passed as a query parameter. - */ - public Integer getTotal() { - return total; - } - - /** - * @return the token ID from which to start selection for a new page - */ - public String getNext() { - return next; - } - - /** - * @return the list of Tokens - */ - public List getTokens() { - return tokens; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/refreshtokens/ResourceServer.java b/src/main/java/com/auth0/json/mgmt/refreshtokens/ResourceServer.java deleted file mode 100644 index 2c0c4a9e6..000000000 --- a/src/main/java/com/auth0/json/mgmt/refreshtokens/ResourceServer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ResourceServer { - @JsonProperty("audience") - private String audience; - @JsonProperty("scopes") - private String scopes; - - /** - * @return Resource server ID - */ - public String getAudience() { - return audience; - } - - /** - * @return List of scopes for the refresh token - */ - public String getScopes() { - return scopes; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/AuthorizationDetails.java b/src/main/java/com/auth0/json/mgmt/resourceserver/AuthorizationDetails.java deleted file mode 100644 index 69989507c..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/AuthorizationDetails.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents the authorization details associated with a {@link ResourceServer} - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AuthorizationDetails { - - @JsonProperty("type") - private String type; - - /** - * Create a new instance. - * @param type the value of the {@code type} field. - */ - @JsonCreator - public AuthorizationDetails(@JsonProperty("type") String type) { - this.type = type; - } - - /** - * @return the value of the {@code type} field - */ - public String getType() { - return type; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/EncryptionKey.java b/src/main/java/com/auth0/json/mgmt/resourceserver/EncryptionKey.java deleted file mode 100644 index 74f19707f..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/EncryptionKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents the encryption key associated with a {@link TokenEncryption} - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EncryptionKey { - - @JsonProperty("name") - private String name; - @JsonProperty("alg") - private String alg; - @JsonProperty("pem") - private String pem; - @JsonProperty("kid") - private String kid; - @JsonProperty("thumbprint_sha256") - private String thumbprintSha256; - - /** - * @return the value of the {@code name} field. - */ - public String getName() { - return name; - } - - /** - * Sets the value of the {@code name} field. - * @param name the value of the {@code name} field. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the value of the {@code alg} field. - */ - public String getAlg() { - return alg; - } - - /** - * Sets the value of the {@code alg} field. - * @param alg the value of the {@code alg} field. - */ - public void setAlg(String alg) { - this.alg = alg; - } - - /** - * @return the value of the {@code pem} field. - */ - public String getPem() { - return pem; - } - - /** - * Sets the value of the {@code pem} field. - * @param pem the value of the {@code pem} field. - */ - public void setPem(String pem) { - this.pem = pem; - } - - /** - * @return the value of the {@code kid} field. - */ - public String getKid() { - return kid; - } - - /** - * Sets the value of the {@code kid} field. - * @param kid the value of the {@code kid} field. - */ - public void setKid(String kid) { - this.kid = kid; - } - - /** - * @return the value of the {@code thumbprint_sha256} field. - */ - public String getThumbprintSha256() { - return thumbprintSha256; - } - - /** - * Sets the value of the {@code thumbprint_sha256} field. - * @param thumbprintSha256 the value of the {@code thumbprint_sha256} field. - */ - public void setThumbprintSha256(String thumbprintSha256) { - this.thumbprintSha256 = thumbprintSha256; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/ProofOfPossession.java b/src/main/java/com/auth0/json/mgmt/resourceserver/ProofOfPossession.java deleted file mode 100644 index 5c7be6eb4..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/ProofOfPossession.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ProofOfPossession { - - @JsonProperty("mechanism") - private String mechanism; - @JsonProperty("required") - private Boolean required; - - @JsonCreator - public ProofOfPossession(@JsonProperty("mechanism") String mechanism, @JsonProperty("required") Boolean required) { - this.mechanism = mechanism; - this.required = required; - } - - /** - * Getter for the mechanism of the Proof of Possession. - * @return the mechanism of the Proof of Possession. - */ - public String getMechanism() { - return mechanism; - } - - /** - * Setter for the mechanism of the Proof of Possession. - * @param mechanism the mechanism of the Proof of Possession. - */ - public void setMechanism(String mechanism) { - this.mechanism = mechanism; - } - - /** - * Getter for the required flag of the Proof of Possession. - * @return the required flag of the Proof of Possession. - */ - public Boolean getRequired() { - return required; - } - - /** - * Setter for the required flag of the Proof of Possession. - * @param required the required flag of the Proof of Possession. - */ - public void setRequired(Boolean required) { - this.required = required; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServer.java b/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServer.java deleted file mode 100644 index 0c80f5c0b..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServer.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ResourceServer { - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("identifier") - private String identifier; - @JsonProperty("scopes") - private List scopes; - @JsonProperty("signing_alg") - private String signingAlgorithm; - @JsonProperty("signing_secret") - private String signingSecret; - @JsonProperty("allow_offline_access") - private Boolean allowOfflineAccess; - @JsonProperty("skip_consent_for_verifiable_first_party_clients") - private Boolean skipConsentForVerifiableFirstPartyClients; - @JsonProperty("token_lifetime") - private Integer tokenLifetime; - @JsonProperty("token_dialect") - private String tokenDialect; - @JsonProperty("token_lifetime_for_web") - private Integer tokenLifetimeForWeb; - @JsonProperty("verification_location") - private String verificationLocation; - @JsonProperty("is_system") - private Boolean isSystem; - @JsonProperty("enforce_policies") - private Boolean enforcePolicies; - @JsonProperty("consent_policy") - private String consentPolicy; - @JsonProperty("authorization_details") - private List authorizationDetails; - @JsonProperty("token_encryption") - private TokenEncryption tokenEncryption; - @JsonProperty("proof_of_possession") - private ProofOfPossession proofOfPossession; - - @JsonCreator - public ResourceServer(@JsonProperty("identifier") String identifier) { - this.identifier = identifier; - } - - public ResourceServer() { - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("id") - public void setId(String id) { - this.id = id; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("is_system") - public Boolean isSystem() { - return isSystem; - } - - @JsonProperty("enforce_policies") - public Boolean enforcePolicies() { - return enforcePolicies; - } - - @JsonProperty("enforce_policies") - public void setEnforcePolicies(Boolean enforcePolicies) { - this.enforcePolicies = enforcePolicies; - } - - @JsonProperty("identifier") - public String getIdentifier() { - return identifier; - } - - @JsonProperty("scopes") - public List getScopes() { - return scopes; - } - - @JsonProperty("scopes") - public void setScopes(List scopes) { - this.scopes = scopes; - } - - @JsonProperty("signing_alg") - public String getSigningAlgorithm() { - return signingAlgorithm; - } - - @JsonProperty("signing_alg") - public void setSigningAlgorithm(String signingAlgorithm) { - this.signingAlgorithm = signingAlgorithm; - } - - @JsonProperty("signing_secret") - public String getSigningSecret() { - return signingSecret; - } - - @JsonProperty("signing_secret") - public void setSigningSecret(String signingSecret) { - this.signingSecret = signingSecret; - } - - @JsonProperty("allow_offline_access") - public Boolean getAllowOfflineAccess() { - return allowOfflineAccess; - } - - @JsonProperty("allow_offline_access") - public void setAllowOfflineAccess(Boolean allowOfflineAccess) { - this.allowOfflineAccess = allowOfflineAccess; - } - - @JsonProperty("skip_consent_for_verifiable_first_party_clients") - public Boolean getSkipConsentForVerifiableFirstPartyClients() { - return skipConsentForVerifiableFirstPartyClients; - } - - @JsonProperty("skip_consent_for_verifiable_first_party_clients") - public void setSkipConsentForVerifiableFirstPartyClients(Boolean skipConsentForVerifiableFirstPartyClients) { - this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; - } - - @JsonProperty("token_lifetime") - public Integer getTokenLifetime() { - return tokenLifetime; - } - - @JsonProperty("token_lifetime") - public void setTokenLifetime(Integer tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } - - @JsonProperty("token_dialect") - public String getTokenDialect() { - return tokenDialect; - } - - @JsonProperty("token_dialect") - public void setTokenDialect(String tokenDialect) { - this.tokenDialect = tokenDialect; - } - - @JsonProperty("verification_location") - public String getVerificationLocation() { - return verificationLocation; - } - - @JsonProperty("verification_location") - public void setVerificationLocation(String verificationLocation) { - this.verificationLocation = verificationLocation; - } - - @JsonProperty("token_lifetime_for_web") - public Integer getTokenLifetimeForWeb() { - return tokenLifetimeForWeb; - } - - @JsonProperty("token_lifetime_for_web") - public void setTokenLifetimeForWeb(Integer tokenLifetimeForWeb) { - this.tokenLifetimeForWeb = tokenLifetimeForWeb; - } - - /** - * @return the value of the {@code consent_policy} field. - */ - public String getConsentPolicy() { - return consentPolicy; - } - - /** - * Sets the value of the {@code consent_policy} field - * @param consentPolicy the value of the {@code consent_policy} field - */ - public void setConsentPolicy(String consentPolicy) { - this.consentPolicy = consentPolicy; - } - - /** - * @return the value of the {@code authorization_details} field. - */ - public List getAuthorizationDetails() { - return authorizationDetails; - } - - /** - * Sets the value of the {@code authorization_details} field. - * @param authorizationDetails the value of the {@code authorization_details} field. - */ - public void setAuthorizationDetails(List authorizationDetails) { - this.authorizationDetails = authorizationDetails; - } - - /** - * @return the value of the {@code token_encryption} field. - */ - public TokenEncryption getTokenEncryption() { - return tokenEncryption; - } - - /** - * Sets the value of the {@code token_encryption} field. - * @param tokenEncryption the value of the {@code token_encryption} field. - */ - public void setTokenEncryption(TokenEncryption tokenEncryption) { - this.tokenEncryption = tokenEncryption; - } - - /** - * @return the value of the {@code proof_of_possession} field. - */ - public ProofOfPossession getProofOfPossession() { - return proofOfPossession; - } - - /** - * Sets the value of the {@code proof_of_possession} field. - * @param proofOfPossession the value of the {@code proof_of_possession} field. - */ - public void setProofOfPossession(ProofOfPossession proofOfPossession) { - this.proofOfPossession = proofOfPossession; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPage.java b/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPage.java deleted file mode 100644 index dc021659c..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Resource Servers. Related to the {@link com.auth0.client.mgmt.ResourceServerEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = ResourceServersPageDeserializer.class) -public class ResourceServersPage extends Page { - - public ResourceServersPage(List items) { - super(items); - } - - public ResourceServersPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPageDeserializer.java deleted file mode 100644 index d85c7cd86..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/ResourceServersPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link ResourceServersPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.ResourceServerEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class ResourceServersPageDeserializer extends PageDeserializer { - - ResourceServersPageDeserializer() { - super(ResourceServer.class, "resource_servers"); - } - - @Override - protected ResourceServersPage createPage(List items) { - return new ResourceServersPage(items); - } - - @Override - protected ResourceServersPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new ResourceServersPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/Scope.java b/src/main/java/com/auth0/json/mgmt/resourceserver/Scope.java deleted file mode 100644 index b7af7f6d8..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/Scope.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"WeakerAccess", "unused"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Scope { - @JsonProperty("description") - private String description; - @JsonProperty("value") - private String value; - - @JsonCreator - public Scope(@JsonProperty("value") String value) { - this.value = value; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - @JsonProperty("value") - public String getValue() { - return value; - } - - @JsonProperty("value") - public void setValue(String value) { - this.value = value; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/resourceserver/TokenEncryption.java b/src/main/java/com/auth0/json/mgmt/resourceserver/TokenEncryption.java deleted file mode 100644 index 86aa0f516..000000000 --- a/src/main/java/com/auth0/json/mgmt/resourceserver/TokenEncryption.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.auth0.json.mgmt.resourceserver; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents the token encryption associated with a {@link ResourceServer} - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class TokenEncryption { - - @JsonProperty("format") - private String format; - @JsonProperty("encryption_key") - private EncryptionKey encryptionKey; - - /** - * Create a new instance. - * @param format the value of the {@code format} field. - * @param encryptionKey the value of the {@code encryption_key} field. - */ - @JsonCreator - public TokenEncryption(@JsonProperty("format") String format, @JsonProperty("encryption_key") EncryptionKey encryptionKey) { - this.format = format; - this.encryptionKey = encryptionKey; - } - /** - * @return the value of the {@code format} field. - */ - public String getFormat() { - return format; - } - - /** - * @return the value of the {@code encryption_key} field. - */ - public EncryptionKey getEncryptionKey() { - return encryptionKey; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/roles/Role.java b/src/main/java/com/auth0/json/mgmt/roles/Role.java deleted file mode 100644 index c1f5068a4..000000000 --- a/src/main/java/com/auth0/json/mgmt/roles/Role.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.auth0.json.mgmt.roles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Role object. Related to the {@link com.auth0.client.mgmt.RolesEntity} entity. - */ -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Role { - @JsonProperty("id") - private String id; - - @JsonProperty("name") - private String name; - - @JsonProperty("description") - private String description; - - /** - * Getter for the role's unique identifier. - * - * @return the role id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the role's name. - * - * @return the name of the role. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Setter for the role's name. - * - * @param name the name of the role to set. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * The getter for the role's description. - * - * @return the description of the role. - */ - @JsonProperty("description") - public String getDescription() { - return description; - } - - /** - * Setter for the role's description. - * - * @param description the description of the role to set. - */ - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/roles/RolesPage.java b/src/main/java/com/auth0/json/mgmt/roles/RolesPage.java deleted file mode 100644 index 61af9d66b..000000000 --- a/src/main/java/com/auth0/json/mgmt/roles/RolesPage.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.roles; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = RolesPageDeserializer.class) -public class RolesPage extends Page { - - public RolesPage(List items) { - super(items); - } - - public RolesPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/roles/RolesPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/roles/RolesPageDeserializer.java deleted file mode 100644 index 2df11828b..000000000 --- a/src/main/java/com/auth0/json/mgmt/roles/RolesPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.roles; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link RolesPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.RolesEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class RolesPageDeserializer extends PageDeserializer { - - RolesPageDeserializer() { - super(Role.class, "roles"); - } - - @Override - protected RolesPage createPage(List items) { - return new RolesPage(items); - } - - @Override - protected RolesPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new RolesPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/rules/Rule.java b/src/main/java/com/auth0/json/mgmt/rules/Rule.java deleted file mode 100644 index be11eb401..000000000 --- a/src/main/java/com/auth0/json/mgmt/rules/Rule.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.auth0.json.mgmt.rules; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Rule object. Related to the {@link com.auth0.client.mgmt.RulesEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Rule { - @JsonProperty("name") - private String name; - @JsonProperty("script") - private String script; - @JsonProperty("id") - private String id; - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("order") - private Integer order; - @JsonProperty("stage") - private String stage; - - @JsonCreator - public Rule(@JsonProperty("name") String name, @JsonProperty("script") String script) { - this.name = name; - this.script = script; - } - - /** - * Getter for the name of the rule - * - * @return the name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Setter for the name of the rule. - * - * @param name the name to set. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the code to be executed when the rule runs. - * - * @return the script. - */ - @JsonProperty("script") - public String getScript() { - return script; - } - - /** - * Setter for the code to be executed when the rule runs. - * - * @param script the script to set. - */ - @JsonProperty("script") - public void setScript(String script) { - this.script = script; - } - - /** - * Getter for the rule's identifier. - * - * @return the id. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Whether the rule is enabled or not. - * - * @return true if the rule is enabled, false otherwise. - */ - @JsonProperty("enabled") - public Boolean isEnabled() { - return enabled; - } - - /** - * Sets if the rule is enabled or not. - * - * @param enabled whether the rule is enabled or not. - */ - @JsonProperty("enabled") - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * Getter for the rule's order in relation to other rules. A rule with a lower order than another rule executes first. - * - * @return the order. - */ - @JsonProperty("order") - public Integer getOrder() { - return order; - } - - /** - * Setter for the rule's order in relation to other rules. A rule with a lower order than another rule executes first. - * - * @param order the order to set. - */ - @JsonProperty("order") - public void setOrder(Integer order) { - this.order = order; - } - - /** - * Getter for the rule's execution stage. - * - * @return the stage. - */ - @JsonProperty("stage") - public String getStage() { - return stage; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/rules/RulesConfig.java b/src/main/java/com/auth0/json/mgmt/rules/RulesConfig.java deleted file mode 100644 index 1adf9aa7d..000000000 --- a/src/main/java/com/auth0/json/mgmt/rules/RulesConfig.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.auth0.json.mgmt.rules; - -import com.auth0.client.mgmt.RulesConfigsEntity; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Rules Config object. Related to the {@link RulesConfigsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RulesConfig { - @JsonProperty("key") - private String key; - @JsonProperty("value") - private String value; - - @JsonCreator - public RulesConfig(@JsonProperty("value") String value) { - this.value = value; - } - - /** - * Getter for the key of the rules config - * - * @return the key. - */ - @JsonProperty("key") - public String getKey() { - return key; - } - - /** - * Getter for the value of the rules config - * - * @return the value. - */ - @JsonProperty("value") - public String getValue() { - return value; - } - - /** - * Setter for the value of the rules config. - * - * @param value the value to set. - */ - @JsonProperty("value") - public void setValue(String value) { - this.value = value; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/rules/RulesPage.java b/src/main/java/com/auth0/json/mgmt/rules/RulesPage.java deleted file mode 100644 index 6da4e6618..000000000 --- a/src/main/java/com/auth0/json/mgmt/rules/RulesPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.rules; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given page of Rules. Related to the {@link com.auth0.client.mgmt.RulesEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = RulesPageDeserializer.class) -public class RulesPage extends Page { - - public RulesPage(List items) { - super(items); - } - - public RulesPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/rules/RulesPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/rules/RulesPageDeserializer.java deleted file mode 100644 index f163355e7..000000000 --- a/src/main/java/com/auth0/json/mgmt/rules/RulesPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.rules; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link RulesPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.RulesEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class RulesPageDeserializer extends PageDeserializer { - - RulesPageDeserializer() { - super(Rule.class, "rules"); - } - - @Override - protected RulesPage createPage(List items) { - return new RulesPage(items); - } - - @Override - protected RulesPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new RulesPage(start, length, total, limit, items); - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Branding.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Branding.java deleted file mode 100644 index 55433ba72..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Branding.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class Branding { - @JsonProperty("logo_url") - private String logoUrl; - @JsonProperty("colors") - private Color colors; - - /** - * Getter for the logo URL. - * @return the logo URL. - */ - public String getLogoUrl() { - return logoUrl; - } - - /** - * Setter for the logo URL. - * @param logoUrl the logo URL to set. - */ - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - /** - * Getter for the colors. - * @return the colors. - */ - public Color getColors() { - return colors; - } - - /** - * Setter for the colors. - * @param colors the colors to set. - */ - public void setColors(Color colors) { - this.colors = colors; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Color.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Color.java deleted file mode 100644 index 87891fbab..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/Color.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class Color { - @JsonProperty("primary") - private String primary; - - /** - * Creates a new instance of the Color class. - */ - public Color() {} - - /** - * Creates a new instance of the Color class. - * @param primary the primary color. - */ - @JsonCreator - public Color(@JsonProperty("primary") String primary) { - this.primary = primary; - } - - /** - * Getter for the primary color. - * @return the primary color. - */ - public String getPrimary() { - return primary; - } - - /** - * Setter for the primary color. - * @param primary the primary color to set. - */ - public void setPrimary(String primary) { - this.primary = primary; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/DomainAliasesConfig.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/DomainAliasesConfig.java deleted file mode 100644 index 2502578b3..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/DomainAliasesConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class DomainAliasesConfig { - @JsonProperty("domain_verification") - private String domainVerification; - - /** - * Creates a new instance of the DomainAliasesConfig class. - */ - @JsonCreator - public DomainAliasesConfig(@JsonProperty("domain_verification") String domainVerification) { - this.domainVerification = domainVerification; - } - - /** - * Getter for the domain verification. - * @return the domain verification. - */ - public String getDomainVerification() { - return domainVerification; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/EnabledOrganizations.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/EnabledOrganizations.java deleted file mode 100644 index fada60683..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/EnabledOrganizations.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class EnabledOrganizations { - @JsonProperty("organization_id") - private String organizationId; - @JsonProperty("assign_membership_on_login") - private boolean assignMembershipOnLogin; - @JsonProperty("show_as_button") - private boolean showAsButton; - - /** - * Getter for the organization id. - * @return the organization id. - */ - public String getOrganizationId() { - return organizationId; - } - - /** - * Setter for the organization id. - * @param organizationId the organization id to set. - */ - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } - - /** - * Getter for the assign membership on login. - * @return the assign membership on login. - */ - public boolean isAssignMembershipOnLogin() { - return assignMembershipOnLogin; - } - - /** - * Setter for the assign membership on login. - * @param assignMembershipOnLogin the assign membership on login to set. - */ - public void setAssignMembershipOnLogin(boolean assignMembershipOnLogin) { - this.assignMembershipOnLogin = assignMembershipOnLogin; - } - - /** - * Getter for the show as button. - * @return the show as button. - */ - public boolean isShowAsButton() { - return showAsButton; - } - - /** - * Setter for the show as button. - * @param showAsButton the show as button to set. - */ - public void setShowAsButton(boolean showAsButton) { - this.showAsButton = showAsButton; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/ProvisioningConfig.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/ProvisioningConfig.java deleted file mode 100644 index c267e7ec4..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/ProvisioningConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ProvisioningConfig { - @JsonProperty("scopes") - private List scopes; - @JsonProperty("token_lifetime") - private int tokenLifetime; - - - /** - * Getter for the scopes. - * @return the scopes. - */ - @JsonProperty("scopes") - public List getScopes() { - return scopes; - } - - /** - * Setter for the scopes. - * @param scopes the scopes to set. - */ - @JsonProperty("scopes") - public void setScopes(List scopes) { - this.scopes = scopes; - } - - /** - * Getter for the token lifetime. - * @return the token lifetime. - */ - @JsonProperty("token_lifetime") - public int getTokenLifetime() { - return tokenLifetime; - } - - /** - * Setter for the token lifetime. - * @param tokenLifetime the token lifetime to set. - */ - @JsonProperty("token_lifetime") - public void setTokenLifetime(int tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfile.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfile.java deleted file mode 100644 index 534f0e074..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfile.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class SelfServiceProfile { - @JsonProperty("name") - private String name; - @JsonProperty("description") - private String description; - @JsonProperty("user_attributes") - private List userAttributes; - @JsonProperty("branding") - private Branding branding; - @JsonProperty("allowed_strategies") - private List allowedStrategies; - @JsonProperty("user_attribute_profile_id") - private String userAttributeProfileId; - - /** - * Getter for the name of the self-service profile. - * @return the name of the self-service profile. - */ - public String getName() { - return name; - } - - /** - * Setter for the name of the self-service profile. - * @param name the name of the self-service profile to set. - */ - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the description of the self-service profile. - * @return the description of the self-service profile. - */ - public String getDescription() { - return description; - } - - /** - * Setter for the description of the self-service profile. - * @param description the description of the self-service profile to set. - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * Getter for the user attributes of the self-service profile. - * @return the user attributes of the self-service profile. - */ - public List getUserAttributes() { - return userAttributes; - } - - /** - * Setter for the user attributes of the self-service profile. - * @param userAttributes the user attributes of the self-service profile to set. - */ - public void setUserAttributes(List userAttributes) { - this.userAttributes = userAttributes; - } - - /** - * Getter for the branding of the self-service profile. - * @return the branding of the self-service profile. - */ - public Branding getBranding() { - return branding; - } - - /** - * Setter for the branding of the self-service profile. - * @param branding the branding of the self-service profile to set. - */ - public void setBranding(Branding branding) { - this.branding = branding; - } - - /** - * Getter for the allowed strategies of the self-service profile. - * @return the allowed strategies of the self-service profile. - */ - public List getAllowedStrategies() { - return allowedStrategies; - } - - /** - * Setter for the allowed strategies of the self-service profile. - * @param allowedStrategies the allowed strategies of the self-service profile to set. - */ - public void setAllowedStrategies(List allowedStrategies) { - this.allowedStrategies = allowedStrategies; - } - - /** - * Getter for user attribute profile ID. - * @return the user attribute profile ID. - */ - public String getUserAttributeProfileId() { - return userAttributeProfileId; - } - - /** - * Setter for user attribute profile ID. - * @param userAttributeProfileId the user attribute profile ID to set. - */ - public void setUserAttributeProfileId(String userAttributeProfileId) { - this.userAttributeProfileId = userAttributeProfileId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponse.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponse.java deleted file mode 100644 index 838bb9daf..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponse.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SelfServiceProfileResponse extends SelfServiceProfile { - @JsonProperty("id") - private String id; - @JsonProperty("created_at") - private String createdAt; - @JsonProperty("updated_at") - private String updatedAt; - - /** - * Getter for the id of the self-service profile. - * @return the id of the self-service profile. - */ - public String getId() { - return id; - } - - /** - * Setter for the id of the self-service profile. - * @param id the id of the self-service profile to set. - */ - public void setId(String id) { - this.id = id; - } - - /** - * Getter for the created at of the self-service profile. - * @return the created at of the self-service profile. - */ - public String getCreatedAt() { - return createdAt; - } - - /** - * Setter for the created at of the self-service profile. - * @param createdAt the created at of the self-service profile to set. - */ - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /** - * Getter for the updated at of the self-service profile. - * @return the updated at of the self-service profile. - */ - public String getUpdatedAt() { - return updatedAt; - } - - /** - * Setter for the updated at of the self-service profile. - * @param updatedAt the updated at of the self-service profile to set. - */ - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePage.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePage.java deleted file mode 100644 index e28d4cf74..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePage.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = SelfServiceProfileResponsePageDeserializer.class) -public class SelfServiceProfileResponsePage extends Page { - public SelfServiceProfileResponsePage(List items) { - super(items); - } - - public SelfServiceProfileResponsePage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageDeserializer.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageDeserializer.java deleted file mode 100644 index bebdbade6..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageDeserializer.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - - -public class SelfServiceProfileResponsePageDeserializer extends PageDeserializer { - - protected SelfServiceProfileResponsePageDeserializer() { - super(SelfServiceProfileResponse.class, "self_service_profiles"); - } - - @Override - protected SelfServiceProfileResponsePage createPage(List items) { - return new SelfServiceProfileResponsePage(items); - } - - @Override - protected SelfServiceProfileResponsePage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new SelfServiceProfileResponsePage(start, length, total, limit, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequest.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequest.java deleted file mode 100644 index 7b9436664..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequest.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class SsoAccessTicketRequest { - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("connection_config") - private Map connectionConfig; - @JsonProperty("enabled_clients") - private List enabledClients; - @JsonProperty("enabled_organizations") - private List enabledOrganizations; - @JsonProperty("ttl_sec") - private int ttlSec; - @JsonProperty("domain_aliases_config") - private DomainAliasesConfig domainAliasesConfig; - @JsonProperty("provisioning_config") - private ProvisioningConfig provisioningConfig; - - /** - * Creates a new instance. - * @return the new instance. - */ - public String getConnectionId() { - return connectionId; - } - - /** - * Sets the connection ID. - * @param connectionId the connection ID to set. - */ - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * Getter for the connection configuration. - * @return the connection configuration. - */ - public Map getConnectionConfig() { - return connectionConfig; - } - - /** - * Setter for the connection configuration. - * @param connectionConfig the connection configuration to set. - */ - public void setConnectionConfig(Map connectionConfig) { - this.connectionConfig = connectionConfig; - } - - /** - * Getter for the enabled clients. - * @return the enabled clients. - */ - public List getEnabledClients() { - return enabledClients; - } - - /** - * Setter for the enabled clients. - * @param enabledClients the enabled clients to set. - */ - public void setEnabledClients(List enabledClients) { - this.enabledClients = enabledClients; - } - - /** - * Getter for the enabled organizations. - * @return the enabled organizations. - */ - public List getEnabledOrganizations() { - return enabledOrganizations; - } - - /** - * Setter for the enabled organizations. - * @param enabledOrganizations the enabled organizations to set. - */ - public void setEnabledOrganizations(List enabledOrganizations) { - this.enabledOrganizations = enabledOrganizations; - } - - /** - * Getter for the TTL in seconds. - * @return the TTL in seconds. - */ - public int getTtlSec() { - return ttlSec; - } - - /** - * Setter for the TTL in seconds. - * @param ttlSec the TTL in seconds to set. - */ - public void setTtlSec(int ttlSec) { - this.ttlSec = ttlSec; - } - - /** - * Getter for the domain aliases configuration. - * @return the domain aliases configuration. - */ - public DomainAliasesConfig getDomainAliasesConfig() { - return domainAliasesConfig; - } - - /** - * Setter for the domain aliases configuration. - * @param domainAliasesConfig the domain aliases configuration to set. - */ - public void setDomainAliasesConfig(DomainAliasesConfig domainAliasesConfig) { - this.domainAliasesConfig = domainAliasesConfig; - } - - /** - * Getter for the provisioning configuration. - * @return the provisioning configuration. - */ - public ProvisioningConfig getProvisioningConfig() { - return provisioningConfig; - } - - /** - * Setter for the provisioning configuration. - * @param provisioningConfig the provisioning configuration to set. - */ - public void setProvisioningConfig(ProvisioningConfig provisioningConfig) { - this.provisioningConfig = provisioningConfig; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponse.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponse.java deleted file mode 100644 index ab4bf3441..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.*; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class SsoAccessTicketResponse { - @JsonProperty("ticket") - private String ticket; - - /** - * Creates a new instance. - */ - public SsoAccessTicketResponse() { - } - - /** - * Creates a new instance with the given ticket. - * @param ticket the ticket. - */ - @JsonCreator - public SsoAccessTicketResponse(@JsonProperty("ticket") String ticket) { - this.ticket = ticket; - } - - /** - * Getter for the ticket. - * @return the ticket. - */ - public String getTicket() { - return ticket; - } - - /** - * Setter for the ticket. - * @param ticket the ticket to set. - */ - public void setTicket(String ticket) { - this.ticket = ticket; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/UserAttribute.java b/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/UserAttribute.java deleted file mode 100644 index 33db0ad6b..000000000 --- a/src/main/java/com/auth0/json/mgmt/selfserviceprofiles/UserAttribute.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class UserAttribute { - @JsonProperty("name") - private String name; - @JsonProperty("description") - private String description; - @JsonProperty("is_optional") - private boolean isOptional; - - /** - * Creates a new instance of the UserAttribute class. - */ - public UserAttribute() { } - - /** - * Creates a new instance of the UserAttribute class. - * @param name the name of the user attribute. - * @param description the description of the user attribute. - * @param isOptional the isOptional of the user attribute. - */ - @JsonCreator - public UserAttribute(@JsonProperty("name") String name, @JsonProperty("description") String description, @JsonProperty("is_optional") boolean isOptional) { - this.name = name; - this.description = description; - this.isOptional = isOptional; - } - - /** - * Getter for the name of the user attribute. - * @return the name of the user attribute. - */ - public String getName() { - return name; - } - - /** - * Setter for the name of the user attribute. - * @param name the name of the user attribute to set. - */ - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the description of the user attribute. - * @return the description of the user attribute. - */ - public String getDescription() { - return description; - } - - /** - * Setter for the description of the user attribute. - * @param description the description of the user attribute to set. - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * Getter for the isOptional of the user attribute. - * @return the isOptional of the user attribute. - */ - public boolean getIsOptional() { - return isOptional; - } - - /** - * Setter for the isOptional of the user attribute. - * @param isOptional the isOptional of the user attribute to set. - */ - public void setIsOptional(boolean isOptional) { - this.isOptional = isOptional; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/Authentication.java b/src/main/java/com/auth0/json/mgmt/sessions/Authentication.java deleted file mode 100644 index 177c14699..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/Authentication.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Authentication { - @JsonProperty("methods") - private List methods; - - /** - * @return Contains the authentication methods a user has completed during their session - */ - public List getMethods() { - return methods; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/AuthenticationMethod.java b/src/main/java/com/auth0/json/mgmt/sessions/AuthenticationMethod.java deleted file mode 100644 index 012a29d61..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/AuthenticationMethod.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AuthenticationMethod { - @JsonProperty("name") - private String name; - @JsonProperty("timestamp") - private Date timestamp; - @JsonProperty("type") - private String type; - - /** - * @return One of: "federated", "passkey", "pwd", "sms", "email", "mfa", "mock" or a custom method denoted by a URL - */ - public String getName() { - return name; - } - - /** - * @return Timestamp of when the signal was received - */ - public Date getTimestamp() { - return timestamp; - } - - /** - * @return A specific MFA factor. Only present when "name" is set to "mfa" - */ - public String getType() { - return type; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/Client.java b/src/main/java/com/auth0/json/mgmt/sessions/Client.java deleted file mode 100644 index 7ac383e65..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/Client.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Client { - @JsonProperty("client_id") - private String clientId; - - /** - * @return ID of client for the session - */ - public String getClientId() { - return clientId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/Device.java b/src/main/java/com/auth0/json/mgmt/sessions/Device.java deleted file mode 100644 index cf3fe3954..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/Device.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Device { - @JsonProperty("initial_user_agent") - private String initialUserAgent; - @JsonProperty("initial_ip") - private String initialIP; - @JsonProperty("initial_asn") - private String initialASN; - @JsonProperty("last_user_agent") - private String lastUserAgent; - @JsonProperty("last_ip") - private String lastIP; - @JsonProperty("last_asn") - private String lastASN; - - /** - * @return First user agent associated with this session - */ - public String getInitialUserAgent() { - return initialUserAgent; - } - - /** - * @return First IP address associated with this session - */ - public String getInitialIP() { - return initialIP; - } - - /** - * @return First autonomous system number associated with this session - */ - public String getInitialASN() { - return initialASN; - } - - /** - * @return Last user agent of the device from which this user logged in - */ - public String getLastUserAgent() { - return lastUserAgent; - } - - /** - * @return Last IP address from which this user logged in - */ - public String getLastIP() { - return lastIP; - } - - /** - * @return Last autonomous system number from which this user logged in - */ - public String getLastASN() { - return lastASN; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/Session.java b/src/main/java/com/auth0/json/mgmt/sessions/Session.java deleted file mode 100644 index c231770e7..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/Session.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Session { - @JsonProperty("id") - private String id; - @JsonProperty("user_id") - private String userId; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("authenticated_at") - private Date authenticatedAt; - @JsonProperty("idle_expires_at") - private Date idleExpiresAt; - @JsonProperty("expires_at") - private Date expiresAt; - @JsonProperty("last_interacted_at") - private Date lastInteractedAt; - @JsonProperty("device") - private Device device; - @JsonProperty("clients") - private List clients; - @JsonProperty("authentication") - private Authentication authentication; - - /** - * @return The ID of the session - */ - public String getId() { - return id; - } - - /** - * @return ID of the user which can be used when interacting with other APIs. - */ - public String getUserId() { - return userId; - } - - /** - * - * @return The date and time when the session was created - */ - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return The date and time when the session was last updated - */ - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * @return The date and time when the session was last authenticated - */ - public Date getAuthenticatedAt() { - return authenticatedAt; - } - - /** - * @return The date and time when the session will expire if idle - */ - public Date getIdleExpiresAt() { - return idleExpiresAt; - } - - /** - * @return The date and time when the session will expire - */ - public Date getExpiresAt() { - return expiresAt; - } - - /** - * @return Metadata related to the device used in the session - */ - public Device getDevice() { - return device; - } - - /** - * @return List of client details for the session - */ - public List getClients() { - return clients; - } - - /** - * @return Details about authentication signals obtained during the login flow - */ - public Authentication getAuthentication() { - return authentication; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/sessions/SessionsPage.java b/src/main/java/com/auth0/json/mgmt/sessions/SessionsPage.java deleted file mode 100644 index 10d58e9d5..000000000 --- a/src/main/java/com/auth0/json/mgmt/sessions/SessionsPage.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents a given Page of Sessions. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SessionsPage { - @JsonProperty("total") - private Integer total; - - @JsonProperty("next") - private String next; - - @JsonProperty("sessions") - private List sessions; - - /** - * @return the total number of refresh tokens. This is only present when `include_totals` is passed as a query parameter. - */ - public Integer getTotal() { - return total; - } - - /** - * @return the token ID from which to start selection for a new page - */ - public String getNext() { - return next; - } - - /** - * @return the list of Sessions - */ - public List getSessions() { - return sessions; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/stats/DailyStats.java b/src/main/java/com/auth0/json/mgmt/stats/DailyStats.java deleted file mode 100644 index a673e5e31..000000000 --- a/src/main/java/com/auth0/json/mgmt/stats/DailyStats.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.stats; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * Class that represents an Auth0 Daily Stats object. Related to the {@link com.auth0.client.mgmt.StatsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class DailyStats { - - @JsonProperty("logins") - private Integer logins; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("date") - private Date date; - - /** - * Getter for the amount of logins on the date - * - * @return the amount of logins - */ - @JsonProperty("logins") - public Integer getLogins() { - return logins; - } - - /** - * Getter for the date to which the stats belong - * - * @return the date to which the stats belong - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("date") - public Date getDate() { - return date; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/Clients.java b/src/main/java/com/auth0/json/mgmt/tenants/Clients.java deleted file mode 100644 index 49db8743e..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/Clients.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Clients { - @JsonProperty("client_credentials") - private ClientCredentials clientCredentials; - - /** - * Default constructor for Clients. - */ - public Clients() { - } - - /** - * Constructor for Clients. - * - * @param clientCredentials the client credentials - */ - public Clients(ClientCredentials clientCredentials) { - this.clientCredentials = clientCredentials; - } - - /** - * @return the client credentials - */ - public ClientCredentials getClientCredentials() { - return clientCredentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/DefaultTokenQuota.java b/src/main/java/com/auth0/json/mgmt/tenants/DefaultTokenQuota.java deleted file mode 100644 index 2d5ae414d..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/DefaultTokenQuota.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class DefaultTokenQuota { - @JsonProperty("clients") - private Clients clients; - - @JsonProperty("organizations") - private Organizations organizations; - - /** - * Default constructor for DefaultTokenQuota. - */ - public DefaultTokenQuota() {} - - /** - * Constructor for DefaultTokenQuota. - * - * @param clients the clients - * @param organizations the organizations - */ - public DefaultTokenQuota(Clients clients, Organizations organizations) { - this.clients = clients; - this.organizations = organizations; - } - - /** - * @return the clients - */ - public Clients getClients() { - return clients; - } - - /** - * @param clients the clients to set - */ - public void setClients(Clients clients) { - this.clients = clients; - } - - /** - * @return the organizations - */ - public Organizations getOrganizations() { - return organizations; - } - - /** - * @param organizations the organizations to set - */ - public void setOrganizations(Organizations organizations) { - this.organizations = organizations; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/ErrorPageCustomization.java b/src/main/java/com/auth0/json/mgmt/tenants/ErrorPageCustomization.java deleted file mode 100644 index adc435ccf..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/ErrorPageCustomization.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ErrorPageCustomization extends PageCustomization { - - @JsonProperty("show_log_link") - private Boolean showLogLink; - @JsonProperty("url") - private String url; - - /** - * Whether the error page will show a link to the log or not. - * - * @return true if the error page will show a link to the log, false otherwise. - */ - @JsonProperty("show_log_link") - public Boolean willShowLogLink() { - return showLogLink; - } - - /** - * Sets if the error page will show a link to the log or not. - * - * @param showLogLink whether the error page will show a link to the log or not. - */ - @JsonProperty("show_log_link") - public void setShowLogLink(Boolean showLogLink) { - this.showLogLink = showLogLink; - } - - /** - * Getter for the url to redirect to instead of showing the default error page. - * - * @return the url to redirect to. - */ - @JsonProperty("url") - public String getUrl() { - return url; - } - - /** - * Setter for the url to redirect to instead of showing the default error page. - * - * @param url the url to redirect to. - */ - @JsonProperty("url") - public void setUrl(String url) { - this.url = url; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/Mtls.java b/src/main/java/com/auth0/json/mgmt/tenants/Mtls.java deleted file mode 100644 index e4c441e42..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/Mtls.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the value of the {@code enable_endpoint_aliases} field of the {@link Tenant}. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Mtls { - - @JsonProperty("enable_endpoint_aliases") - private Boolean enableEndpointAliases; - - /** - * @return the value of the {@code enable_endpoint_aliases} field - */ - public Boolean getEnableEndpointAliases() { - return enableEndpointAliases; - } - - /** - * Sets the value of the {@code enable_endpoint_aliases} field - * - * @param enableEndpointAliases the value of the {@code enable_endpoint_aliases} field - */ - public void setEnableEndpointAliases(Boolean enableEndpointAliases) { - this.enableEndpointAliases = enableEndpointAliases; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/Organizations.java b/src/main/java/com/auth0/json/mgmt/tenants/Organizations.java deleted file mode 100644 index 56c2d85d8..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/Organizations.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Organizations { - @JsonProperty("client_credentials") - private ClientCredentials clientCredentials; - - /** - * Default constructor for Organizations. - */ - public Organizations() {} - - /** - * Constructor for Organizations. - * - * @param clientCredentials the client credentials - */ - public Organizations(ClientCredentials clientCredentials) { - this.clientCredentials = clientCredentials; - } - - /** - * @return the client credentials - */ - public ClientCredentials getClientCredentials() { - return clientCredentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/PageCustomization.java b/src/main/java/com/auth0/json/mgmt/tenants/PageCustomization.java deleted file mode 100644 index 3a8efa13d..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/PageCustomization.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PageCustomization { - - @JsonProperty("enabled") - private Boolean enabled; - @JsonProperty("html") - private String html; - - /** - * Whether the custom page will be used instead of the default one or not. - * - * @return true if the custom page will be used instead of the default one, false otherwise. - */ - @JsonProperty("enabled") - public Boolean isEnabled() { - return enabled; - } - - /** - * Sets if the custom page will be used instead of the default one or not. - * - * @param enabled whether the custom page will be used instead of the default one, false otherwise. - */ - @JsonProperty("enabled") - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * Getter for the page custom HTML code. - * - * @return the HTML code. - */ - @JsonProperty("html") - public String getHTML() { - return html; - } - - /** - * Setter for the page custom HTML code. - * - * @param html the HTML code to set. - */ - @JsonProperty("html") - public void setHTML(String html) { - this.html = html; - } - -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/SessionCookie.java b/src/main/java/com/auth0/json/mgmt/tenants/SessionCookie.java deleted file mode 100644 index 0bc7db4e7..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/SessionCookie.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the value of the {@code session_cookie} field of the {@link Tenant}. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SessionCookie { - - @JsonProperty("mode") - private String mode; - - @JsonCreator - public SessionCookie(@JsonProperty("mode") String mode) { - this.mode = mode; - } - - public String getMode() { - return mode; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tenants/Tenant.java b/src/main/java/com/auth0/json/mgmt/tenants/Tenant.java deleted file mode 100644 index 817db0007..000000000 --- a/src/main/java/com/auth0/json/mgmt/tenants/Tenant.java +++ /dev/null @@ -1,437 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * Class that represents an Auth0 Tenant Settings object. Related to the {@link com.auth0.client.mgmt.TenantsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Tenant { - - @JsonProperty("change_password") - private PageCustomization changePassword; - @JsonProperty("guardian_mfa_page") - private PageCustomization guardianMFAPage; - @JsonProperty("default_audience") - private String defaultAudience; - @JsonProperty("default_directory") - private String defaultDirectory; - @JsonProperty("error_page") - private ErrorPageCustomization errorPage; - @JsonProperty("flags") - private Map flags; - @JsonProperty("friendly_name") - private String friendlyName; - @JsonProperty("picture_url") - private String pictureUrl; - @JsonProperty("support_email") - private String supportEmail; - @JsonProperty("support_url") - private String supportUrl; - @JsonProperty("allowed_logout_urls") - private List allowedLogoutUrls; - @JsonProperty("session_lifetime") - private Integer sessionLifetime; - - @JsonProperty("session_cookie") - private SessionCookie sessionCookie; - - @JsonProperty("idle_session_lifetime") - private Integer idleSessionLifetime; - - @JsonProperty("acr_values_supported") - private List acrValuesSupported; - - @JsonProperty("pushed_authorization_requests_supported") - private Boolean pushedAuthorizationRequestsSupported; - - @JsonProperty("remove_alg_from_jwks") - private Boolean removeAlgFromJwks; - - @JsonProperty("mtls") - private Mtls mtls; - - @JsonProperty("authorization_response_iss_parameter_supported") - private boolean authorizationResponseIssParameterSupported; - - @JsonProperty("default_token_quota") - private DefaultTokenQuota defaultTokenQuota; - - /** - * Getter for the change password page customization. - * - * @return the page customization. - */ - @JsonProperty("change_password") - public PageCustomization getChangePasswordPage() { - return changePassword; - } - - /** - * Setter for the change password customization. - * - * @param changePassword the page customization to set. - */ - @JsonProperty("change_password") - public void setChangePasswordPage(PageCustomization changePassword) { - this.changePassword = changePassword; - } - - /** - * Getter for the guardian MFA page customization. - * - * @return the page customization. - */ - @JsonProperty("guardian_mfa_page") - public PageCustomization getGuardianMFAPage() { - return guardianMFAPage; - } - - /** - * Setter for the guardian MFA page customization. - * - * @param guardianMFAPage the page customization to set. - */ - @JsonProperty("guardian_mfa_page") - public void setGuardianMFAPage(PageCustomization guardianMFAPage) { - this.guardianMFAPage = guardianMFAPage; - } - - /** - * Getter for the default audience used for API Authorization. - * - * @return the default audience. - */ - @JsonProperty("default_audience") - public String getDefaultAudience() { - return defaultAudience; - } - - /** - * Setter for the default audience used for API Authorization. - * - * @param defaultAudience the default audience to set. - */ - @JsonProperty("default_audience") - public void setDefaultAudience(String defaultAudience) { - this.defaultAudience = defaultAudience; - } - - /** - * Getter for the name of the connection that will be used for password grants at the token endpoint. Only the following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. - * - * @return the default directory. - */ - @JsonProperty("default_directory") - public String getDefaultDirectory() { - return defaultDirectory; - } - - /** - * Setter for the name of the connection that will be used for password grants at the token endpoint. Only the following connection types are supported: LDAP, AD, Database Connections, Passwordless, Windows Azure Active Directory, ADFS. - * - * @param defaultDirectory the default directory to set. - */ - @JsonProperty("default_directory") - public void setDefaultDirectory(String defaultDirectory) { - this.defaultDirectory = defaultDirectory; - } - - /** - * Getter for the error page customization. - * - * @return the page customization. - */ - @JsonProperty("error_page") - public ErrorPageCustomization getErrorPage() { - return errorPage; - } - - /** - * Setter for the error page customization. - * - * @param errorPage the page customization to set. - */ - @JsonProperty("error_page") - public void setErrorPage(ErrorPageCustomization errorPage) { - this.errorPage = errorPage; - } - - /** - * Getter for the tenant flags. Some flags are 'change_pwd_flow_v1', 'enable_apis_section', 'disable_impersonation', 'enable_client_connections', 'enable_pipeline2'. - * - * @return the tenant flags. - */ - @JsonProperty("flags") - public Map getFlags() { - return flags; - } - - /** - * Setter for the tenant flags. Some flags are 'change_pwd_flow_v1', 'enable_apis_section', 'disable_impersonation', 'enable_client_connections', 'enable_pipeline2'. - * - * @param flags the flags to set. - */ - @JsonProperty("flags") - public void setFlags(Map flags) { - this.flags = flags; - } - - /** - * Getter for the friendly name of the tenant. - * - * @return the friendly name. - */ - @JsonProperty("friendly_name") - public String getFriendlyName() { - return friendlyName; - } - - /** - * Setter for the friendly name of the tenant. - * - * @param friendlyName the friendly name to set. - */ - @JsonProperty("friendly_name") - public void setFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - } - - /** - * Getter for the url of the tenant picture. - * - * @return the tenant picture url. - */ - @JsonProperty("picture_url") - public String getPictureUrl() { - return pictureUrl; - } - - /** - * Setter for the tenant picture url. An image with size 150x150 is recommended. - * - * @param pictureUrl the picture url to set. - */ - @JsonProperty("picture_url") - public void setPictureUrl(String pictureUrl) { - this.pictureUrl = pictureUrl; - } - - /** - * Getter for the user support email. - * - * @return the support email. - */ - @JsonProperty("support_email") - public String getSupportEmail() { - return supportEmail; - } - - /** - * Setter for the user support email. - * - * @param supportEmail the support email to set. - */ - @JsonProperty("support_email") - public void setSupportEmail(String supportEmail) { - this.supportEmail = supportEmail; - } - - /** - * Getter for the user support url. - * - * @return the support url. - */ - @JsonProperty("support_url") - public String getSupportUrl() { - return supportUrl; - } - - /** - * Setter for the user support url. - * - * @param supportUrl the support url to set. - */ - @JsonProperty("support_url") - public void setSupportUrl(String supportUrl) { - this.supportUrl = supportUrl; - } - - /** - * Getter for the tenant list of URLs that are valid to redirect to after logout from Auth0. - * - * @return the list of logout urls. - */ - @JsonProperty("allowed_logout_urls") - public List getAllowedLogoutUrls() { - return allowedLogoutUrls; - } - - /** - * Setter for the tenant list of URLs that are valid to redirect to after logout from Auth0. - * - * @param allowedLogoutUrls the allowed logout urls to set. - */ - @JsonProperty("allowed_logout_urls") - public void setAllowedLogoutUrls(List allowedLogoutUrls) { - this.allowedLogoutUrls = allowedLogoutUrls; - } - - /** - * Getter for the login session lifetime. This is how long the session will stay valid. Value is in hours. - * - * @return the session lifetime in hours. - */ - @JsonProperty("session_lifetime") - public Integer getSessionLifetime() { - return sessionLifetime; - } - - /** - * @return the value of the session cookie. - */ - public SessionCookie getSessionCookie() { - return sessionCookie; - } - - /** - * Sets the value of the session cookie. - * @param sessionCookie the value of the session cookie to set. - */ - public void setSessionCookie(SessionCookie sessionCookie) { - this.sessionCookie = sessionCookie; - } - - /** - * Setter for the login session lifetime. This is how long the session will stay valid. Value is in hours. - * - * @param sessionLifetime the session lifetime in hours to set. - */ - @JsonProperty("session_lifetime") - public void setSessionLifetime(Integer sessionLifetime) { - this.sessionLifetime = sessionLifetime; - } - - /** - * Getter for the login session idle lifetime. This is how long the session will stay valid without user activity. Value is in hours. - * - * @return the session idle lifetime in hours. - */ - @JsonProperty("idle_session_lifetime") - public Integer getIdleSessionLifetime() { - return idleSessionLifetime; - } - - /** - * Setter for the login session idle lifetime. This is how long the session will stay valid without user activity. Value is in hours. - * - * @param idleSessionLifetime the session lifetime in hours to set. - */ - @JsonProperty("idle_session_lifetime") - public void setIdleSessionLifetime(Integer idleSessionLifetime) { - this.idleSessionLifetime = idleSessionLifetime; - } - - /** - * @return the value of the {@code acr_values_supported} field - */ - public List getAcrValuesSupported() { - return acrValuesSupported; - } - - /** - * Sets the value of the {@code acr_values_supported} field - * - * @param acrValuesSupported the value of the {@code acr_values_supported_field} - */ - public void setAcrValuesSupported(List acrValuesSupported) { - this.acrValuesSupported = acrValuesSupported; - } - - /** - * @return the value of the {@code pushed_authorization_requests_supported} field. - */ - public Boolean getPushedAuthorizationRequestsSupported() { - return pushedAuthorizationRequestsSupported; - } - - /** - * Sets the value of the {@code pushed_authorization_requests_supported} field - * - * @param pushedAuthorizationRequestsSupported the value of the {@code pushed_authorization_requests_supported} field - */ - public void setPushedAuthorizationRequestsSupported(Boolean pushedAuthorizationRequestsSupported) { - this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; - } - - /** - * @return the value of the {@code remove_alg_from_jwks} field - */ - public Boolean getRemoveAlgFromJwks() { - return removeAlgFromJwks; - } - - /** - * Sets the value of the {@code remove_alg_from_jwks} field - * - * @param removeAlgFromJwks the value of the {@code remove_alg_from_jwks} field - */ - public void setRemoveAlgFromJwks(Boolean removeAlgFromJwks) { - this.removeAlgFromJwks = removeAlgFromJwks; - } - - /** - * @return the value of the {@code mtls} field - */ - public Mtls getMtls() { - return mtls; - } - - /** - * Sets the value of the {@code mtls} field - * - * @param mtls the value of the {@code mtls} field - */ - public void setMtls(Mtls mtls) { - this.mtls = mtls; - } - - /** - * @return the value of the {@code authorization_response_iss_parameter_supported} field - */ - public boolean isAuthorizationResponseIssParameterSupported() { - return authorizationResponseIssParameterSupported; - } - - /** - * Sets the value of the {@code authorization_response_iss_parameter_supported} field - * - * @param authorizationResponseIssParameterSupported the value of the {@code authorization_response_iss_parameter_supported} field - */ - public void setAuthorizationResponseIssParameterSupported(boolean authorizationResponseIssParameterSupported) { - this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; - } - - /** - * @return the value of the {@code default_token_quota} field - */ - public DefaultTokenQuota getDefaultTokenQuota() { - return defaultTokenQuota; - } - - /** - * Sets the value of the {@code default_token_quota} field - * - * @param defaultTokenQuota the value of the {@code default_token_quota} field - */ - public void setDefaultTokenQuota(DefaultTokenQuota defaultTokenQuota) { - this.defaultTokenQuota = defaultTokenQuota; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationIdentity.java b/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationIdentity.java deleted file mode 100644 index 5c2a73c7d..000000000 --- a/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationIdentity.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.tickets; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; - -/** - * Represents the identity object that can be sent on requests to create an email verification ticket or job. - * Related to {@link com.auth0.client.mgmt.JobsEntity} and {@link com.auth0.client.mgmt.TicketsEntity}. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EmailVerificationIdentity { - - @JsonProperty("provider") - private final String provider; - @JsonProperty("user_id") - private final String userId; - - /** - * Create a new instance. - * - * @param provider The identity provider name (e.g. {@code "google-oauth2"}). - * @param userId The user ID of the identity to be verified. - */ - public EmailVerificationIdentity(String provider, String userId) { - this.provider = provider; - this.userId = userId; - } - - /** - * Get the identity provider name. - * - * @return The identity provider name. - */ - @JsonProperty("provider") - public String getProvider() { - return this.provider; - } - - /** - * Get the user ID. - * - * @return the User ID. - */ - @JsonProperty("user_id") - public String getUserId() { - return this.userId; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationTicket.java b/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationTicket.java deleted file mode 100644 index c33c10c48..000000000 --- a/src/main/java/com/auth0/json/mgmt/tickets/EmailVerificationTicket.java +++ /dev/null @@ -1,123 +0,0 @@ - -package com.auth0.json.mgmt.tickets; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Email Verification Ticket object. Related to the {@link com.auth0.client.mgmt.TicketsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess", "FieldCanBeLocal"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EmailVerificationTicket { - - @JsonProperty("user_id") - private String userId; - @JsonProperty("result_url") - private String resultUrl; - @JsonProperty("ttl_sec") - private Integer ttlSec; - @JsonProperty("ticket") - private String ticket; - @JsonProperty("includeEmailInRedirect") - private Boolean includeEmailInRedirect; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("organization_id") - private String organizationId; - @JsonProperty("identity") - private EmailVerificationIdentity identity; - - @JsonCreator - public EmailVerificationTicket(@JsonProperty("user_id") String userId) { - this.userId = userId; - } - - /** - * Setter for the id of the user this ticket is meant to. - * - * @param userId the user id to set. - */ - @JsonProperty("user_id") - public void setUserId(String userId) { - this.userId = userId; - } - - /** - * Setter for the url the user will be redirected to after using the ticket. - * - * @param resultUrl the result url. - */ - @JsonProperty("result_url") - public void setResultUrl(String resultUrl) { - this.resultUrl = resultUrl; - } - - /** - * The ticket's lifetime in seconds starting from the moment of creation. After expiration the ticket can not be used to verify the users's email. If not specified or if you send 0 the Auth0 default lifetime will be applied. - * - * @param seconds the lifetime in seconds to set. - */ - @JsonProperty("ttl_sec") - public void setTTLSeconds(Integer seconds) { - this.ttlSec = seconds; - } - - /** - * Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). - * - * @param includeEmailInRedirect whether to include the email address as part of the returnUrl in the reset email. - */ - public void setIncludeEmailInRedirect(Boolean includeEmailInRedirect) { - this.includeEmailInRedirect = includeEmailInRedirect; - } - - /** - * Sets the ID of the client. If provided for tenants using New Universal Login experience, the user will be prompted - * to redirect to the default login route of the corresponding application once the ticket is used. - * - * @param clientId the ID of the client - * - * @see Configuring Default Login Routes - */ - @JsonProperty("client_id") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Sets the ID of the Organization. If provided, organization parameters will be made available to the email template - * and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include - * {@code organization_id} and {@code organization_name} query string parameters. - * - * @param organizationId the ID of the organization - */ - @JsonProperty("organization_id") - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } - - /** - * Sets the identity. Needed to verify primary identities when using social, enterprise, or passwordless connections. - * It is also required to verify secondary identities. - * - * @param identity the identity. - */ - @JsonProperty("identity") - public void setIdentity(EmailVerificationIdentity identity) { - this.identity = identity; - } - - /** - * Getter for the ticket url. - * - * @return the ticket url. - */ - @JsonProperty("ticket") - public String getTicket() { - return ticket; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tickets/PasswordChangeTicket.java b/src/main/java/com/auth0/json/mgmt/tickets/PasswordChangeTicket.java deleted file mode 100644 index fd58a3b0a..000000000 --- a/src/main/java/com/auth0/json/mgmt/tickets/PasswordChangeTicket.java +++ /dev/null @@ -1,169 +0,0 @@ - -package com.auth0.json.mgmt.tickets; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents an Auth0 Password Change Ticket object. Related to the {@link com.auth0.client.mgmt.TicketsEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess", "FieldCanBeLocal"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PasswordChangeTicket { - - @JsonProperty("user_id") - private String userId; - @JsonProperty("result_url") - private String resultUrl; - @JsonProperty("ttl_sec") - private Integer ttlSec; - @JsonProperty("new_password") - private char[] newPassword; - @JsonProperty("connection_id") - private String connectionId; - @JsonProperty("email") - private String email; - @JsonProperty("ticket") - private String ticket; - @JsonProperty("mark_email_as_verified") - private Boolean markEmailAsVerified; - @JsonProperty("organization_id") - private String orgId; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("includeEmailInRedirect") - private Boolean includeEmailInRedirect; - - @JsonCreator - public PasswordChangeTicket(@JsonProperty("user_id") String userId) { - this.userId = userId; - } - - public PasswordChangeTicket(String email, String connectionId) { - this.email = email; - this.connectionId = connectionId; - } - - /** - * Setter for the id of the user for whom the ticket should be created. - * - * @param userId the user id to set. - */ - @JsonProperty("user_id") - public void setUserId(String userId) { - this.userId = userId; - } - - /** - * Setter for the client_id - * @param clientId the ID of the client to set - */ - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public void setIncludeEmailInRedirect(Boolean includeEmailInRedirect) { - this.includeEmailInRedirect = includeEmailInRedirect; - } - - /** - * Setter for the url the user will be redirected to after using the ticket. - * - * @param resultUrl the result url. - */ - @JsonProperty("result_url") - public void setResultUrl(String resultUrl) { - this.resultUrl = resultUrl; - } - - /** - * The ticket's lifetime in seconds starting from the moment of creation. After expiration the ticket can not be used to verify the users's email. If not specified or if you send 0 the Auth0 default lifetime will be applied. - * - * @param seconds the lifetime in seconds to set. - */ - @JsonProperty("ttl_sec") - public void setTTLSeconds(Integer seconds) { - this.ttlSec = seconds; - } - - /** - * Setter for the new password to set after the ticket is used. - * - * @param newPassword the new password to set. - * - * @deprecated Use {@linkplain #setNewPassword(char[])} instead. - */ - @JsonProperty("new_password") - @Deprecated - public void setNewPassword(String newPassword) { - setNewPassword(newPassword != null ? newPassword.toCharArray() : null); - } - - @JsonProperty("new_password") - public void setNewPassword(char[] newPassword) { - this.newPassword = newPassword; - } - - /** - * Setter for the id of the connection the user's email should be search in. - * - * @param connectionId the connection id - */ - @JsonProperty("connection_id") - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * Setter for the user's email. - * - * @param email the user email to set. - */ - @JsonProperty("email") - public void setEmail(String email) { - this.email = email; - } - - /** - * Setter for the mark_email_as_verified to define if user.email_verified should be set to true after ticket is consumed. - * - * @param markEmailAsVerified true if email_verified attribute must be set to true once password is changed, false if email_verified attribute should not be updated. - */ - @JsonProperty("mark_email_as_verified") - public void setMarkEmailAsVerified(Boolean markEmailAsVerified){ - this.markEmailAsVerified = markEmailAsVerified; - } - - /** - * Sets the organization ID. This allows the organization_id and organization_name to be included in the redirect URL query. - * - * @param orgId the ID of the organization - */ - @JsonProperty("organization_id") - public void setOrganizationId(String orgId) { - this.orgId = orgId; - } - - /** - * Gets the organization ID - * - * @return the organization ID - */ - @JsonProperty("organization_id") - public String getOrganizationId() { - return orgId; - } - - /** - * Getter for the ticket url. - * - * @return the ticket url. - */ - @JsonProperty("ticket") - public String getTicket() { - return ticket; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tokenquota/ClientCredentials.java b/src/main/java/com/auth0/json/mgmt/tokenquota/ClientCredentials.java deleted file mode 100644 index b7d52ef4c..000000000 --- a/src/main/java/com/auth0/json/mgmt/tokenquota/ClientCredentials.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.auth0.json.mgmt.tokenquota; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ClientCredentials { - @JsonProperty("per_day") - private Integer perDay; - @JsonProperty("per_hour") - private Integer perHour; - @JsonProperty("enforce") - private boolean enforce; - /** - * Default constructor for ClientCredentials. - */ - public ClientCredentials() {} - - /** - * Constructor for ClientCredentials. - * - * @param perDay the number of client credentials allowed per day - * @param perHour the number of client credentials allowed per hour - * @param enforce true if the quota is enforced, false otherwise - */ - public ClientCredentials(Integer perDay, Integer perHour, boolean enforce) { - this.perDay = perDay; - this.perHour = perHour; - this.enforce = enforce; - } - - /** - * @return the number of client credentials allowed per day - */ - public Integer getPerDay() { - return perDay; - } - - /** - * Sets the number of client credentials allowed per day. - * - * @param perDay the number of client credentials allowed per day - */ - public void setPerDay(Integer perDay) { - this.perDay = perDay; - } - - /** - * @return the number of client credentials allowed per hour - */ - public Integer getPerHour() { - return perHour; - } - - /** - * Sets the number of client credentials allowed per hour. - * - * @param perHour the number of client credentials allowed per hour - */ - public void setPerHour(Integer perHour) { - this.perHour = perHour; - } - - /** - * @return true if the quota is enforced, false otherwise - */ - public boolean isEnforce() { - return enforce; - } - - /** - * Sets whether the quota is enforced. - * - * @param enforce true to enforce the quota, false otherwise - */ - public void setEnforce(boolean enforce) { - this.enforce = enforce; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/tokenquota/TokenQuota.java b/src/main/java/com/auth0/json/mgmt/tokenquota/TokenQuota.java deleted file mode 100644 index e11dadac2..000000000 --- a/src/main/java/com/auth0/json/mgmt/tokenquota/TokenQuota.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.tokenquota; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class TokenQuota { - @JsonProperty("client_credentials") - private ClientCredentials clientCredentials; - - /** - * Default constructor for Clients. - */ - public TokenQuota() {} - /** - * Constructor for Clients. - * - * @param clientCredentials the client credentials - */ - public TokenQuota(ClientCredentials clientCredentials) { - this.clientCredentials = clientCredentials; - } - - /** - * @return the client credentials - */ - public ClientCredentials getClientCredentials() { - return clientCredentials; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplate.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplate.java deleted file mode 100644 index 34d108839..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplate.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ListUserAttributeProfileTemplate { - @JsonProperty("user_attribute_profile_templates") - private List userAttributeProfileTemplateResponses; - - /** - * Gets the user attribute profile templates - * @return the user attribute profile templates - */ - @JsonProperty("user_attribute_profile_templates") - public List getUserAttributeProfileTemplates() { - return userAttributeProfileTemplateResponses; - } - - /** - * Sets the user attribute profile templates - * @param userAttributeProfileTemplateResponses the user attribute profile templates - */ - @JsonProperty("user_attribute_profile_templates") - public void setUserAttributeProfileTemplates(List userAttributeProfileTemplateResponses) { - this.userAttributeProfileTemplateResponses = userAttributeProfileTemplateResponses; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/OidcMapping.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/OidcMapping.java deleted file mode 100644 index 363d53d24..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/OidcMapping.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class OidcMapping { - @JsonProperty("mapping") - private String mapping; - @JsonProperty("display_name") - private String displayName; - - @JsonProperty("mapping") - public String getMapping() { - return mapping; - } - - @JsonProperty("mapping") - public void setMapping(String mapping) { - this.mapping = mapping; - } - - @JsonProperty("display_name") - public String getDisplayName() { - return displayName; - } - - @JsonProperty("display_name") - public void setDisplayName(String displayName) { - this.displayName = displayName; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserAttributes.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserAttributes.java deleted file mode 100644 index 221cf0288..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserAttributes.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class StrategyOverridesUserAttributes { - - @JsonProperty("oidc_mapping") - private OidcMapping oidcMapping; - @JsonProperty("saml_mapping") - private List samlMapping; - @JsonProperty("scim_mapping") - private String scimMapping; - - /** - * OIDC mapping. - * @return the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public OidcMapping getOidcMapping() { - return oidcMapping; - } - - /** - * Sets the OIDC mapping. - * @param oidcMapping the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public void setOidcMapping(OidcMapping oidcMapping) { - this.oidcMapping = oidcMapping; - } - - /** - * SAML mapping. - * @return the SAML mapping - */ - @JsonProperty("saml_mapping") - public List getSamlMapping() { - return samlMapping; - } - - /** - * Sets the SAML mapping. - * @param samlMapping the SAML mapping - */ - @JsonProperty("saml_mapping") - public void setSamlMapping(List samlMapping) { - this.samlMapping = samlMapping; - } - - /** - * SCIM mapping. - * @return the SCIM mapping - */ - @JsonProperty("scim_mapping") - public String getScimMapping() { - return scimMapping; - } - - /** - * Sets the SCIM mapping. - * @param scimMapping the SCIM mapping - */ - @JsonProperty("scim_mapping") - public void setScimMapping(String scimMapping) { - this.scimMapping = scimMapping; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserId.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserId.java deleted file mode 100644 index 9e2543cd5..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/StrategyOverridesUserId.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class StrategyOverridesUserId { - @JsonProperty("oidc_mapping") - private String oidcMapping; - @JsonProperty("saml_mapping") - private List samlMapping; - @JsonProperty("scim_mapping") - private String scimMapping; - - /** - * OIDC mapping. - * @return the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public String getOidcMapping() { - return oidcMapping; - } - - /** - * Sets the OIDC mapping. - * @param oidcMapping the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public void setOidcMapping(String oidcMapping) { - this.oidcMapping = oidcMapping; - } - - /** - * SAML mapping. - * @return the SAML mapping - */ - @JsonProperty("saml_mapping") - public List getSamlMapping() { - return samlMapping; - } - - /** - * Sets the SAML mapping. - * @param samlMapping the SAML mapping - */ - @JsonProperty("saml_mapping") - public void setSamlMapping(List samlMapping) { - this.samlMapping = samlMapping; - } - - /** - * SCIM mapping. - * @return the SCIM mapping - */ - @JsonProperty("scim_mapping") - public String getScimMapping() { - return scimMapping; - } - - /** - * Sets the SCIM mapping. - * @param scimMapping the SCIM mapping - */ - @JsonProperty("scim_mapping") - public void setScimMapping(String scimMapping) { - this.scimMapping = scimMapping; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfile.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfile.java deleted file mode 100644 index f0e9d5587..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfile.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Map; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserAttributeProfile { - - @JsonProperty("id") - private String id; - @JsonProperty("name") - private String name; - @JsonProperty("user_id") - private UserId userId; - @JsonProperty("user_attributes") - private Map userAttributes; - - /** - * Gets the user attribute profile ID. - * @return the user attribute profile ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Sets the user attribute profile ID. - * @return the user attribute profile ID - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets the user attribute profile name. - * @param name the user attribute profile name - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Gets the user ID configuration. - * @return the user ID configuration - */ - @JsonProperty("user_id") - public UserId getUserId() { - return userId; - } - - /** - * Sets the user ID configuration. - * @param userId the user ID configuration - */ - @JsonProperty("user_id") - public void setUserId(UserId userId) { - this.userId = userId; - } - - /** - * Gets the user attributes configuration. - * @return the user attributes configuration - */ - @JsonProperty("user_attributes") - public Map getUserAttributes() { - return userAttributes; - } - - /** - * Sets the user attributes configuration. - * @param userAttributes the user attributes configuration - */ - @JsonProperty("user_attributes") - public void setUserAttributes(Map userAttributes) { - this.userAttributes = userAttributes; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePage.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePage.java deleted file mode 100644 index 3cdca2a6d..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePage.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = UserAttributeProfilePageDeserializer.class) -public class UserAttributeProfilePage extends Page { - public UserAttributeProfilePage(List items) { - super(items); - } - - protected UserAttributeProfilePage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - protected UserAttributeProfilePage(Integer start, Integer length, Integer total, Integer limit, String next, List items){ - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePageDeserializer.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePageDeserializer.java deleted file mode 100644 index d4a89bf7b..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfilePageDeserializer.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - - -@SuppressWarnings({"unused", "WeakerAccess"}) -class UserAttributeProfilePageDeserializer extends PageDeserializer { - UserAttributeProfilePageDeserializer() { - super(UserAttributeProfile.class, "user_attribute_profiles"); - } - - @Override - protected UserAttributeProfilePage createPage(List items) { - return new UserAttributeProfilePage(items); - } - - @Override - protected UserAttributeProfilePage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new UserAttributeProfilePage(start, length, total, limit, items); - } - - @Override - protected UserAttributeProfilePage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new UserAttributeProfilePage(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplate.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplate.java deleted file mode 100644 index 1934a521d..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplate.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Class that represents a User Attribute Profile Template object. Related to - * the {@link com.auth0.client.mgmt.UserAttributeProfilesEntity} entity. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserAttributeProfileTemplate { - - @JsonProperty("id") - private String id; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("template") - private UserAttributeProfile template; - - /** - * Getter for the template ID. - * - * @return the template ID. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Getter for the display name. - * - * @return the display name. - */ - @JsonProperty("display_name") - public String getDisplayName() { - return displayName; - } - - /** - * Setter for the display name. - * - * @param displayName the display name to set. - */ - @JsonProperty("display_name") - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * Getter for the template. - * - * @return the template. - */ - @JsonProperty("template") - public UserAttributeProfile getTemplate() { - return template; - } - - /** - * Setter for the template. - * - * @param template the template to set. - */ - @JsonProperty("template") - public void setTemplate(UserAttributeProfile template) { - this.template = template; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributes.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributes.java deleted file mode 100644 index cd1276084..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributes.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserAttributes { - @JsonProperty("description") - private String description; - @JsonProperty("label") - private String label; - @JsonProperty("profile_required") - private boolean profileRequired; - @JsonProperty("auth0_mapping") - private String auth0Mapping; - @JsonProperty("oidc_mapping") - private OidcMapping oidcMapping; - @JsonProperty("saml_mapping") - private List samlMapping; - @JsonProperty("scim_mapping") - private String scimMapping; - @JsonProperty("strategy_overrides") - private Map strategyOverrides; - - /** - * Description of the user attribute. - * @return the description - */ - @JsonProperty("description") - public String getDescription() { - return description; - } - - /** - * Sets the description of the user attribute. - * @param description - */ - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - /** - * Label of the user attribute. - * @return the label - */ - @JsonProperty("label") - public String getLabel() { - return label; - } - - /** - * Sets the label of the user attribute. - * @param label the label - */ - @JsonProperty("label") - public void setLabel(String label) { - this.label = label; - } - - /** - * Indicates if the user attribute is required in the profile. - * @return true if the user attribute is required in the profile, false otherwise - */ - @JsonProperty("profile_required") - public boolean isProfileRequired() { - return profileRequired; - } - - /** - * Sets if the user attribute is required in the profile. - * @param profileRequired true if the user attribute is required in the profile, false otherwise - */ - @JsonProperty("profile_required") - public void setProfileRequired(boolean profileRequired) { - this.profileRequired = profileRequired; - } - - /** - * Auth0 mapping. - * @return the Auth0 mapping - */ - @JsonProperty("auth0_mapping") - public String getAuth0Mapping() { - return auth0Mapping; - } - - /** - * Sets the Auth0 mapping. - * @param auth0Mapping the Auth0 mapping - */ - @JsonProperty("auth0_mapping") - public void setAuth0Mapping(String auth0Mapping) { - this.auth0Mapping = auth0Mapping; - } - - /** - * OIDC mapping. - * @return the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public OidcMapping getOidcMapping() { - return oidcMapping; - } - - /** - * Sets the OIDC mapping. - * @param oidcMapping the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public void setOidcMapping(OidcMapping oidcMapping) { - this.oidcMapping = oidcMapping; - } - - /** - * SAML mapping. - * @return the SAML mapping - */ - @JsonProperty("saml_mapping") - public List getSamlMapping() { - return samlMapping; - } - - /** - * Sets the SAML mapping. - * @param samlMapping the SAML mapping - */ - @JsonProperty("saml_mapping") - public void setSamlMapping(List samlMapping) { - this.samlMapping = samlMapping; - } - - /** - * SCIM mapping. - * @return the SCIM mapping - */ - @JsonProperty("scim_mapping") - public String getScimMapping() { - return scimMapping; - } - - /** - * Sets the SCIM mapping. - * @param scimMapping the SCIM mapping - */ - @JsonProperty("scim_mapping") - public void setScimMapping(String scimMapping) { - this.scimMapping = scimMapping; - } - - /** - * Strategy overrides mapping. - * @return the strategy overrides mapping - */ - @JsonProperty("strategy_overrides") - public Map getStrategyOverrides() { - return strategyOverrides; - } - - /** - * Sets the strategy overrides mapping. - * @param strategyOverrides the strategy overrides mapping - */ - @JsonProperty("strategy_overrides") - public void setStrategyOverrides(Map strategyOverrides) { - this.strategyOverrides = strategyOverrides; - } -} - diff --git a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserId.java b/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserId.java deleted file mode 100644 index 41391d4e2..000000000 --- a/src/main/java/com/auth0/json/mgmt/userAttributeProfiles/UserId.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserId { - @JsonProperty("oidc_mapping") - private String oidcMapping; - @JsonProperty("saml_mapping") - private List samlMapping; - @JsonProperty("scim_mapping") - private String scimMapping; - @JsonProperty("strategy_overrides") - private Map strategyOverrides; - - /** - * OIDC mapping. - * @return the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public String getOidcMapping() { - return oidcMapping; - } - - /** - * Sets the OIDC mapping. - * @param oidcMapping the OIDC mapping - */ - @JsonProperty("oidc_mapping") - public void setOidcMapping(String oidcMapping) { - this.oidcMapping = oidcMapping; - } - - /** - * SAML mapping. - * @return the SAML mapping - */ - @JsonProperty("saml_mapping") - public List getSamlMapping() { - return samlMapping; - } - - /** - * Sets the SAML mapping. - * @param samlMapping the SAML mapping - */ - @JsonProperty("saml_mapping") - public void setSamlMapping(List samlMapping) { - this.samlMapping = samlMapping; - } - - /** - * SCIM mapping. - * @return the SCIM mapping - */ - @JsonProperty("scim_mapping") - public String getScimMapping() { - return scimMapping; - } - - /** - * Sets the SCIM mapping. - * @param scimMapping the SCIM mapping - */ - @JsonProperty("scim_mapping") - public void setScimMapping(String scimMapping) { - this.scimMapping = scimMapping; - } - - /** - * Strategy overrides mapping. - * @return the strategy overrides mapping - */ - @JsonProperty("strategy_overrides") - public Map getStrategyOverrides() { - return strategyOverrides; - } - - /** - * Sets the strategy overrides mapping. - * @param strategyOverrides the strategy overrides mapping - */ - @JsonProperty("strategy_overrides") - public void setStrategyOverrides(Map strategyOverrides) { - this.strategyOverrides = strategyOverrides; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userblocks/BlockDetails.java b/src/main/java/com/auth0/json/mgmt/userblocks/BlockDetails.java deleted file mode 100644 index 1ffdf7e6f..000000000 --- a/src/main/java/com/auth0/json/mgmt/userblocks/BlockDetails.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.auth0.json.mgmt.userblocks; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class BlockDetails { - - @JsonProperty("identifier") - private String identifier; - @JsonProperty("ip") - private String ip; - - @JsonProperty("identifier") - public String getIdentifier() { - return identifier; - } - - @JsonProperty("ip") - public String getIP() { - return ip; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/userblocks/UserBlocks.java b/src/main/java/com/auth0/json/mgmt/userblocks/UserBlocks.java deleted file mode 100644 index 2133a24b2..000000000 --- a/src/main/java/com/auth0/json/mgmt/userblocks/UserBlocks.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.auth0.json.mgmt.userblocks; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Class that represents an Auth0 User Block object. Related to the {@link com.auth0.client.mgmt.UserBlocksEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserBlocks { - - @JsonProperty("blocked_for") - private List blockedFor; - - /** - * Getter for the list of user block details. - * - * @return the list of block details. - */ - @JsonProperty("blocked_for") - public List getBlockedFor() { - return blockedFor; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/Identity.java b/src/main/java/com/auth0/json/mgmt/users/Identity.java deleted file mode 100644 index 37adac472..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/Identity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.fasterxml.jackson.annotation.*; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Identity implements Serializable { - - @JsonProperty("connection") - private String connection; - @JsonProperty("user_id") - private String userId; - @JsonProperty("provider") - private String provider; - @JsonProperty("isSocial") - private Boolean isSocial; - @JsonProperty("access_token") - private String accessToken; - @JsonProperty("profileData") - private ProfileData profileData; - private final Map values; - - public Identity() { - values = new HashMap<>(); - } - - @JsonAnySetter - void setValue(String key, Object value) { - values.put(key, value); - } - - @JsonAnyGetter - public Map getValues() { - return values; - } - - @JsonProperty("connection") - public String getConnection() { - return connection; - } - - @JsonProperty("user_id") - public String getUserId() { - return userId; - } - - @JsonProperty("provider") - public String getProvider() { - return provider; - } - - @JsonProperty("isSocial") - public Boolean isSocial() { - return isSocial; - } - - @JsonProperty("access_token") - public String getAccessToken() { - return accessToken; - } - - @JsonProperty("profileData") - public ProfileData getProfileData() { - return profileData; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/ProfileData.java b/src/main/java/com/auth0/json/mgmt/users/ProfileData.java deleted file mode 100644 index a3b77c9e0..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/ProfileData.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.fasterxml.jackson.annotation.*; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ProfileData implements Serializable { - - @JsonProperty("email") - private String email; - @JsonProperty("email_verified") - private Boolean emailVerified; - @JsonProperty("name") - private String name; - @JsonProperty("username") - private String username; - @JsonProperty("given_name") - private String givenName; - @JsonProperty("phone_number") - private String phoneNumber; - @JsonProperty("phone_verified") - private Boolean phoneVerified; - @JsonProperty("family_name") - private String familyName; - private final Map values; - - public ProfileData() { - values = new HashMap<>(); - } - - @JsonProperty("email") - public String getEmail() { - return email; - } - - @JsonProperty("email_verified") - public Boolean isEmailVerified() { - return emailVerified; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("username") - public String getUsername() { - return username; - } - - @JsonProperty("given_name") - public String getGivenName() { - return givenName; - } - - @JsonProperty("phone_number") - public String getPhoneNumber() { - return phoneNumber; - } - - @JsonProperty("phone_verified") - public Boolean isPhoneVerified() { - return phoneVerified; - } - - @JsonProperty("family_name") - public String getFamilyName() { - return familyName; - } - - @JsonAnySetter - void setValue(String key, Object value) { - values.put(key, value); - } - - @JsonAnyGetter - public Map getValues() { - return values; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/RecoveryCode.java b/src/main/java/com/auth0/json/mgmt/users/RecoveryCode.java deleted file mode 100644 index fb1e559d9..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/RecoveryCode.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@SuppressWarnings("unused") -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RecoveryCode { - - @JsonProperty("recovery_code") - private String code; - - @JsonProperty("recovery_code") - public String getCode() { - return code; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/User.java b/src/main/java/com/auth0/json/mgmt/users/User.java deleted file mode 100644 index ef034dc08..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/User.java +++ /dev/null @@ -1,569 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.fasterxml.jackson.annotation.*; - -import java.io.Serializable; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Class that represents an Auth0 User object. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class User implements Serializable { - - @JsonProperty("client_id") - private String clientId; - @JsonProperty("connection") - private String connection; - @JsonProperty("password") - private char[] password; - @JsonProperty("verify_password") - private Boolean verifyPassword; - @JsonProperty("username") - private String username; - @JsonProperty("email") - private String email; - @JsonProperty("email_verified") - private Boolean emailVerified; - @JsonProperty("verify_email") - private Boolean verifyEmail; - @JsonProperty("phone_number") - private String phoneNumber; - @JsonProperty("phone_verified") - private Boolean phoneVerified; - @JsonProperty("verify_phone_number") - private Boolean verifyPhoneNumber; - @JsonProperty("user_id") - private String userId; - @JsonProperty("picture") - private String picture; - @JsonProperty("name") - private String name; - @JsonProperty("nickname") - private String nickname; - @JsonProperty("given_name") - private String givenName; - @JsonProperty("family_name") - private String familyName; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - private Date createdAt; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("updated_at") - private Date updatedAt; - @JsonProperty("identities") - private List identities; - @JsonProperty("app_metadata") - private Map appMetadata; - @JsonProperty("user_metadata") - private Map userMetadata; - @JsonProperty("multifactor") - private List multifactor; - @JsonProperty("last_ip") - private String lastIp; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_login") - private Date lastLogin; - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_password_reset") - private Date lastPasswordReset; - @JsonProperty("logins_count") - private Integer loginsCount; - @JsonProperty("blocked") - private Boolean blocked; - private final Map values; - - public User() { - this(null); - } - - @JsonCreator - public User(@JsonProperty("connection") String connection) { - this.values = new HashMap<>(); - this.connection = connection; - } - - /** - * Setter for the connection this user will be created into. - * - * @param connection the connection to set. - */ - @JsonProperty("connection") - public void setConnection(String connection) { - this.connection = connection; - } - - /** - * Setter for the password this user will have once created. - * - * @param password the password to set. - * - * @deprecated Use {@linkplain #setPassword(char[])} instead. - */ - @JsonProperty("password") - @Deprecated - public void setPassword(String password) { - setPassword(password != null ? password.toCharArray() : null); - } - - /** - * Setter for the password this user will have once created. - * - * @param password the password to set. - */ - @JsonProperty("password") - public void setPassword(char[] password) { - this.password = password; - } - - /** - * Getter for the user's username. - * - * @return the username. - */ - @JsonProperty("username") - public String getUsername() { - return username; - } - - /** - * Setter for the user's username. - * - * @param username the username - */ - @JsonProperty("username") - public void setUsername(String username) { - this.username = username; - } - - /** - * Getter for the user's email. - * - * @return the email. - */ - @JsonProperty("email") - public String getEmail() { - return email; - } - - /** - * Setter for the user's email. - * - * @param email the email to set. - */ - @JsonProperty("email") - public void setEmail(String email) { - this.email = email; - } - - /** - * Whether the email was verified or not. - * - * @return true if the email was verified, false otherwise. - */ - @JsonProperty("email_verified") - public Boolean isEmailVerified() { - return emailVerified; - } - - /** - * Sets if the email was verified or not. - * - * @param emailVerified whether the email was verified or not. - */ - @JsonProperty("email_verified") - public void setEmailVerified(Boolean emailVerified) { - this.emailVerified = emailVerified; - } - - /** - * Getter for the user's phone number (following the E.164 recommendation), only valid for users from SMS connections. - * - * @return the user's phone number. - */ - @JsonProperty("phone_number") - public String getPhoneNumber() { - return phoneNumber; - } - - /** - * Setter for the user's phone number (following the E.164 recommendation), only valid when creating a user on SMS connections. - * - * @param phoneNumber the phone number to set. - */ - @JsonProperty("phone_number") - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - /** - * Whether the phone number was verified or not. - * - * @return true if the phone number was verified, false otherwise. - */ - @JsonProperty("phone_verified") - public Boolean isPhoneVerified() { - return phoneVerified; - } - - /** - * Sets if the phone number was verified or not. - * - * @param phoneVerified whether the phone number was verified or not. - */ - @JsonProperty("phone_verified") - public void setPhoneVerified(Boolean phoneVerified) { - this.phoneVerified = phoneVerified; - } - - /** - * Getter for the user's unique identifier. - * - * @return the user id. - */ - @JsonProperty("user_id") - public String getId() { - return userId; - } - - /** - * Setter for the user's unique identifier. This is only valid when creating a new user, as the property can't change once set. - * The server will prepend the connection name and a pipe character before the given id value. - * i.e. For "auth0" connection with user id "123456789" the final user id would be "auth0|123456789". - * - * @param userId the id of the user - */ - @JsonProperty("user_id") - public void setId(String userId) { - this.userId = userId; - } - - /** - * Getter for the user's picture url. - * - * @return the picture url. - */ - @JsonProperty("picture") - public String getPicture() { - return picture; - } - - /** - * Setter for the user's picture url. - * - * @param picture the picture url to set. - */ - @JsonProperty("picture") - public void setPicture(String picture) { - this.picture = picture; - } - - /** - * Getter for the user's name. - * - * @return the name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Setter for the user's name. - * - * @param name the name to set. - */ - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the user's nickname. - * - * @return the nickname. - */ - @JsonProperty("nickname") - public String getNickname() { - return nickname; - } - - /** - * Setter for the user's nickname. - * - * @param nickname the nickname to set. - */ - @JsonProperty("nickname") - public void setNickname(String nickname) { - this.nickname = nickname; - } - - /** - * Getter for the user's given name. - * - * @return the given name. - */ - @JsonProperty("given_name") - public String getGivenName() { - return givenName; - } - - /** - * Setter for the user's given name. - * - * @param givenName the given name to set. - */ - @JsonProperty("given_name") - public void setGivenName(String givenName) { - this.givenName = givenName; - } - - /** - * Getter for the user's family name. - * - * @return the family name. - */ - @JsonProperty("family_name") - public String getFamilyName() { - return familyName; - } - - /** - * Setter for the user's family name. - * - * @param familyName the family name to set. - */ - @JsonProperty("family_name") - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * Getter for the date this user was created on. - * - * @return the created at. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - public Date getCreatedAt() { - return createdAt; - } - - /** - * Getter for the date this user was last updated on. - * - * @return the updated at. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("updated_at") - public Date getUpdatedAt() { - return updatedAt; - } - - /** - * Getter for the list of user's identities information. More than one will exists in case accounts are linked. - * - * @return the list of user's identities. - */ - @JsonProperty("identities") - public List getIdentities() { - return identities; - } - - /** - * Getter for the metadata of the application. - * - * @return the application metadata. - */ - @JsonProperty("app_metadata") - public Map getAppMetadata() { - return appMetadata; - } - - /** - * Setter for the metadata of the application. - * - * @param appMetadata the application metadata to set. - */ - @JsonProperty("app_metadata") - public void setAppMetadata(Map appMetadata) { - this.appMetadata = appMetadata; - } - - /** - * Getter for the metadata of the user. - * - * @return the user metadata. - */ - @JsonProperty("user_metadata") - public Map getUserMetadata() { - return userMetadata; - } - - /** - * Setter for the metadata of the user. - * - * @param userMetadata the user metadata to set. - */ - @JsonProperty("user_metadata") - public void setUserMetadata(Map userMetadata) { - this.userMetadata = userMetadata; - } - - /** - * Getter for the list of multifactor providers that the user has enrolled to. - * - * @return the list of enrolled multifactor providers. - */ - @JsonProperty("multifactor") - public List getMultifactor() { - return multifactor; - } - - /** - * Getter for the last login IP. - * - * @return the last IP. - */ - @JsonProperty("last_ip") - public String getLastIP() { - return lastIp; - } - - /** - * Getter for the last login date. - * - * @return the last login. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_login") - public Date getLastLogin() { - return lastLogin; - } - - /** - * Getter for the last password reset date. Only available for Database Connection users. - * - * @return the last password reset. - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_password_reset") - public Date getLastPasswordReset() { - return lastPasswordReset; - } - - /** - * Getter for the number of logins for this user. - * - * @return the logins count. - */ - @JsonProperty("logins_count") - public Integer getLoginsCount() { - return loginsCount; - } - - /** - * Whether the user is blocked or not. - * - * @return true if the user is blocked, false otherwise. - */ - @JsonProperty("blocked") - public Boolean isBlocked() { - return blocked; - } - - /** - * Sets if the user is blocked or not. - * - * @param blocked whether the user is blocked or not. - */ - @JsonProperty("blocked") - public void setBlocked(Boolean blocked) { - this.blocked = blocked; - } - - /** - * Setter for the Auth0 Application's client ID. Only useful when updating the email. - * - * @param clientId the application's client ID to set. - */ - @JsonProperty("client_id") - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Sets if a password change should be verified via email. - * - * @param verifyPassword true if a password change should be verified via email, false otherwise. - */ - @JsonProperty("verify_password") - public void setVerifyPassword(Boolean verifyPassword) { - this.verifyPassword = verifyPassword; - } - - /** - * Sets if an email change should be verified. - * - * @param verifyEmail true if an email change should be verified, false otherwise. - */ - @JsonProperty("verify_email") - public void setVerifyEmail(Boolean verifyEmail) { - this.verifyEmail = verifyEmail; - } - - /** - * Sets if a phone number change should be verified. - * - * @param verifyPhoneNumber true if a phone number change should be verified, false otherwise. - */ - @JsonProperty("verify_phone_number") - public void setVerifyPhoneNumber(Boolean verifyPhoneNumber) { - this.verifyPhoneNumber = verifyPhoneNumber; - } - - @JsonProperty("password") - char[] getPassword() { - return password; - } - - @JsonProperty("verify_password") - Boolean willVerifyPassword() { - return verifyPassword; - } - - @JsonProperty("verify_email") - Boolean willVerifyEmail() { - return verifyEmail; - } - - @JsonProperty("client_id") - String getClientId() { - return clientId; - } - - @JsonProperty("verify_phone_number") - Boolean willVerifyPhoneNumber() { - return verifyPhoneNumber; - } - - @JsonProperty("connection") - String getConnection() { - return connection; - } - - @JsonAnySetter - void setValue(String key, Object value) { - values.put(key, value); - } - - @JsonAnyGetter - public Map getValues() { - return values; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/UsersPage.java b/src/main/java/com/auth0/json/mgmt/users/UsersPage.java deleted file mode 100644 index 3da01bc60..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/UsersPage.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Class that represents a given Page of Users. Related to the {@link com.auth0.client.mgmt.UsersEntity} entity. - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = UsersPageDeserializer.class) -public class UsersPage extends Page { - - public UsersPage(List items) { - super(items); - } - - /** - * @deprecated Use {@linkplain UsersPage#UsersPage(Integer, Integer, Integer, Integer, String, List)} instead. - */ - @Deprecated - public UsersPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public UsersPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/UsersPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/users/UsersPageDeserializer.java deleted file mode 100644 index 0b56e2620..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/UsersPageDeserializer.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a given paged response into their {@link UsersPage} representation. - *

- * This class is thread-safe. - * - * @see PageDeserializer - * @see com.auth0.client.mgmt.UsersEntity - */ -@SuppressWarnings({"unused", "WeakerAccess"}) -class UsersPageDeserializer extends PageDeserializer { - - UsersPageDeserializer() { - super(User.class, "users"); - } - - @Override - protected UsersPage createPage(List items) { - return new UsersPage(items); - } - - @Override - @SuppressWarnings("deprecation") - protected UsersPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new UsersPage(start, length, total, limit, items); - } - - @Override - protected UsersPage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new UsersPage(start, length, total, limit, next, items); - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthMethod.java b/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthMethod.java deleted file mode 100644 index 2cd1c4e90..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthMethod.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.users.authenticationmethods; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AuthMethod { - - @JsonProperty("id") - private String id; - @JsonProperty("type") - private String type; - - public String getId() { - return id; - } - - public String getType() { - return type; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethod.java b/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethod.java deleted file mode 100644 index 8b17b8f48..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethod.java +++ /dev/null @@ -1,290 +0,0 @@ -package com.auth0.json.mgmt.users.authenticationmethods; - -import com.fasterxml.jackson.annotation.*; - -import java.util.Date; -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AuthenticationMethod { - @JsonProperty("id") - private String id; - @JsonProperty("type") - private String type; - @JsonProperty("confirmed") - private Boolean confirmed; - @JsonProperty("name") - private String name; - @JsonProperty("link_id") - private String linkId; - @JsonProperty("phone_number") - private String phoneNumber; - @JsonProperty("email") - private String email; - @JsonProperty("key_id") - private String keyId; - @JsonProperty("public_key") - private String publicKey; - @JsonProperty("created_at") - private Date createdAt; - @JsonProperty("enrolled_at") - private Date enrolledAt; - @JsonProperty("last_auth_at") - private Date lastAuthedAt; - @JsonProperty("totp_secret") - private String totpSecret; - @JsonProperty("preferred_authentication_method") - private String preferredAuthenticationMethod; - @JsonProperty("relying_party_identifier") - private String relyingPartyIdentifier; - @JsonProperty("authentication_methods") - private List authenticationMethods; - @JsonProperty("credential_device_type") - private String credentialDeviceType; - @JsonProperty("credential_backed_up") - private Boolean credentialBackedUp; - @JsonProperty("identity_user_id") - private String identityUserId; - @JsonProperty("user_agent") - private String userAgent; - - /** - * Create a new instance. - */ - @JsonCreator - public AuthenticationMethod() { - } - - /** - * @return the ID of this enrollment. - */ - public String getId() { - return id; - } - - /** - * @return the type of this enrollment - */ - public String getType() { - return type; - } - - /** - * Sets the type of this enrollment - * Should be ["phone" or "email" or "totp" or "webauthn-roaming"] - * - * @param type the type of the enrollment. - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the enrollment status - */ - public Boolean getConfirmed() { - return confirmed; - } - - /** - * @return A human-readable label to identify the authentication method. - */ - public String getName() { - return name; - } - - /** - * Set a human-readable label to identify the authentication method. - * - * @param name A human-readable label to identify the authentication method. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the indication that the authenticator is linked to another authenticator - */ - public String getLinkId() { - return linkId; - } - - /** - * @return The destination phone number used to send verification codes via text and voice. Applies to phone authentication methods only. - */ - public String getPhoneNumber() { - return phoneNumber; - } - - /** - * Set the destination phone number used to send verification codes via text and voice. - * Applies to phone authentication methods only. - * - * @param phoneNumber The destination phone number used to send verification codes via text and voice. - */ - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - /** - * @return The email address used to send verification messages. Applies to email authentication methods only. - */ - public String getEmail() { - return email; - } - - /** - * Set the email address used to send verification messages. Applies to email authentication methods only. - * @param email The email address used to send verification messages. - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * @return The id of the credential. Applies to email webauthn authenticators only. - */ - public String getKeyId() { - return keyId; - } - - /** - * The id of the credential. Applies to email webauthn authenticators only. - * @param keyId The id of the credential. - */ - public void setKeyId(String keyId) { - this.keyId = keyId; - } - - /** - * @return The public key. Applies to email webauthn authenticators only. - */ - public String getPublicKey() { - return publicKey; - } - - /** - * Set the public key. Applies to email webauthn authenticators only. - * @param publicKey The public key. Applies to email webauthn authenticators only. - */ - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } - - /** - * - * @return Authenticator creation date - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("created_at") - public Date getCreatedAt() { - return createdAt; - } - - /** - * @return Enrollment date - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("enrolled_at") - public Date getEnrolledAt() { - return enrolledAt; - } - - /** - * @return Last authentication - */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - @JsonProperty("last_auth_at") - public Date getLastAuthedAt() { - return lastAuthedAt; - } - - /** - * @return The base32 encoded secret for TOTP generation. Applies to totp authentication methods only. - */ - public String getTotpSecret() { - return totpSecret; - } - - /** - * Set the base32 encoded secret for TOTP generation. Applies to totp authentication methods only. - * @param totpSecret The base32 encoded secret for TOTP generation. - */ - public void setTotpSecret(String totpSecret) { - this.totpSecret = totpSecret; - } - - /** - * @return Preferred phone authentication method. - */ - public String getPreferredAuthenticationMethod() { - return preferredAuthenticationMethod; - } - - /** - * Set the preferred phone authentication method. - * @param preferredAuthenticationMethod Preferred phone authentication method. - */ - public void setPreferredAuthenticationMethod(String preferredAuthenticationMethod) { - this.preferredAuthenticationMethod = preferredAuthenticationMethod; - } - - /** - * @return The relying party identifier. Applies to email webauthn authenticators only. - */ - public String getRelyingPartyIdentifier() { - return relyingPartyIdentifier; - } - - /** - * Set the relying party identifier. Applies to email webauthn authenticators only. - * @param relyingPartyIdentifier The relying party identifier. Applies to email webauthn authenticators only. - */ - public void setRelyingPartyIdentifier(String relyingPartyIdentifier) { - this.relyingPartyIdentifier = relyingPartyIdentifier; - } - - /** - * @return list of authentication methods - */ - public List getAuthenticationMethods() { - return authenticationMethods; - } - - /** - * Applies to passkeys only. - * - * @return The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user. - */ - public String getCredentialDeviceType() { - return credentialDeviceType; - } - - /** - * Applies to passkeys only. - * - * @return Whether the credential was backed up. - */ - public Boolean getCredentialBackedUp() { - return credentialBackedUp; - } - - /** - * Applies to passkeys only. - * - * @return The ID of the user identity linked with the authentication method. - */ - public String getIdentityUserId() { - return identityUserId; - } - - /** - * Applies to passkeys only. - * - * @return The user-agent of the browser used to create the passkey. - */ - public String getUserAgent() { - return userAgent; - } -} diff --git a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPage.java b/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPage.java deleted file mode 100644 index 7ad7b34e5..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPage.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.users.authenticationmethods; - -import com.auth0.json.mgmt.Page; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import java.util.List; - -/** - * Represents a page of an AuthenticationMethod. - * @see AuthenticationMethod - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonDeserialize(using = AuthenticationMethodsPageDeserializer.class) -public class AuthenticationMethodsPage extends Page { - public AuthenticationMethodsPage(List items) { - super(items); - } - - /** - * @deprecated use {@linkplain AuthenticationMethodsPage#AuthenticationMethodsPage(Integer, Integer, Integer, Integer, String, List)} instead. - */ - @Deprecated - public AuthenticationMethodsPage(Integer start, Integer length, Integer total, Integer limit, List items) { - super(start, length, total, limit, items); - } - - public AuthenticationMethodsPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - super(start, length, total, limit, next, items); - } -} - diff --git a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPageDeserializer.java b/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPageDeserializer.java deleted file mode 100644 index 3472e9d63..000000000 --- a/src/main/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodsPageDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.json.mgmt.users.authenticationmethods; - -import com.auth0.json.mgmt.PageDeserializer; - -import java.util.List; - -/** - * Parses a paged response into its {@linkplain AuthenticationMethodsPage} representation. - */ -public class AuthenticationMethodsPageDeserializer extends PageDeserializer { - - protected AuthenticationMethodsPageDeserializer() { - super(AuthenticationMethod.class, "authenticators"); - } - - @Override - protected AuthenticationMethodsPage createPage(List items) { - return new AuthenticationMethodsPage(items); - } - - @Override - @SuppressWarnings("deprecation") - protected AuthenticationMethodsPage createPage(Integer start, Integer length, Integer total, Integer limit, List items) { - return new AuthenticationMethodsPage(start, length, total, limit, items); - } - - @Override - protected AuthenticationMethodsPage createPage(Integer start, Integer length, Integer total, Integer limit, String next, List items) { - return new AuthenticationMethodsPage(start, length, total, limit, next, items); - } -} - diff --git a/src/main/java/com/auth0/net/BaseRequest.java b/src/main/java/com/auth0/net/BaseRequest.java index 2ddcfc5f0..28852bdff 100644 --- a/src/main/java/com/auth0/net/BaseRequest.java +++ b/src/main/java/com/auth0/net/BaseRequest.java @@ -10,14 +10,12 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.MapType; - import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; - /** * A request class that is able to interact fluently with the Auth0 server. * The default content type of this request is "application/json". @@ -45,7 +43,13 @@ public class BaseRequest implements Request { private final Auth0HttpClient client; private final TokenProvider tokenProvider; - BaseRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, ObjectMapper mapper, TypeReference tType) { + BaseRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + ObjectMapper mapper, + TypeReference tType) { this.client = client; this.tokenProvider = tokenProvider; this.url = url; @@ -56,7 +60,12 @@ public class BaseRequest implements Request { this.parameters = new HashMap<>(); } - public BaseRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { + public BaseRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + TypeReference tType) { this(client, tokenProvider, url, method, ObjectMapperProvider.getMapper(), tType); } @@ -73,9 +82,9 @@ protected Auth0HttpRequest createRequest(String apiToken) throws Auth0Exception headers.put("Authorization", "Bearer " + apiToken); } Auth0HttpRequest request = Auth0HttpRequest.newBuilder(url, method) - .withBody(body) - .withHeaders(headers) - .build(); + .withBody(body) + .withHeaders(headers) + .build(); return request; } @@ -153,8 +162,7 @@ public CompletableFuture> executeAsync() { if (Objects.nonNull(tokenProvider)) { return tokenProvider.getTokenAsync().thenCompose(token -> { try { - return client.sendRequestAsync(createRequest(token)) - .thenCompose(this::getResponseFuture); + return client.sendRequestAsync(createRequest(token)).thenCompose(this::getResponseFuture); } catch (Auth0Exception e) { future.completeExceptionally(e); return future; @@ -163,8 +171,7 @@ public CompletableFuture> executeAsync() { } try { - return client.sendRequestAsync(createRequest(null)) - .thenCompose(this::getResponseFuture); + return client.sendRequestAsync(createRequest(null)).thenCompose(this::getResponseFuture); } catch (Auth0Exception e) { future.completeExceptionally(e); return future; @@ -175,7 +182,8 @@ private CompletableFuture> getResponseFuture(Auth0HttpResponse httpR CompletableFuture> future = new CompletableFuture<>(); try { T body = parseResponseBody(httpResponse); - future = CompletableFuture.completedFuture(new ResponseImpl<>(httpResponse.getHeaders(), body, httpResponse.getCode())); + future = CompletableFuture.completedFuture( + new ResponseImpl<>(httpResponse.getHeaders(), body, httpResponse.getCode())); } catch (Auth0Exception e) { future.completeExceptionally(e); return future; @@ -221,7 +229,8 @@ private RateLimitException createRateLimitException(Auth0HttpResponse response) long reset = Long.parseLong(response.getHeader("x-ratelimit-reset", "-1")); TokenQuotaBucket clientQuotaLimit = HttpResponseHeadersUtils.getClientQuotaLimit(response.getHeaders()); - TokenQuotaBucket organizationQuotaLimit = HttpResponseHeadersUtils.getOrganizationQuotaLimit(response.getHeaders()); + TokenQuotaBucket organizationQuotaLimit = + HttpResponseHeadersUtils.getOrganizationQuotaLimit(response.getHeaders()); long retryAfter = Long.parseLong(response.getHeader("retry-after", "-1")); @@ -270,4 +279,3 @@ public BaseRequest setBody(Object value) { return this; } } - diff --git a/src/main/java/com/auth0/net/EmptyBodyRequest.java b/src/main/java/com/auth0/net/EmptyBodyRequest.java index a91a2d433..464c60af9 100644 --- a/src/main/java/com/auth0/net/EmptyBodyRequest.java +++ b/src/main/java/com/auth0/net/EmptyBodyRequest.java @@ -5,7 +5,6 @@ import com.auth0.net.client.HttpMethod; import com.auth0.net.client.HttpRequestBody; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; /** * Request class that does not accept parameters to be sent as part of its body. @@ -16,7 +15,12 @@ */ public class EmptyBodyRequest extends BaseRequest { - public EmptyBodyRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { + public EmptyBodyRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + TypeReference tType) { super(client, tokenProvider, url, method, tType); } @@ -28,7 +32,7 @@ protected HttpRequestBody createRequestBody() { @Override public EmptyBodyRequest addParameter(String name, Object value) { - //do nothing + // do nothing return this; } } diff --git a/src/main/java/com/auth0/net/EmptyBodyVoidRequest.java b/src/main/java/com/auth0/net/EmptyBodyVoidRequest.java index f93f8825c..af6881824 100644 --- a/src/main/java/com/auth0/net/EmptyBodyVoidRequest.java +++ b/src/main/java/com/auth0/net/EmptyBodyVoidRequest.java @@ -15,8 +15,13 @@ * @param The type expected to be received as part of the response. * @see BaseRequest */ -public class EmptyBodyVoidRequest extends BaseRequest { - public EmptyBodyVoidRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { +public class EmptyBodyVoidRequest extends BaseRequest { + public EmptyBodyVoidRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + TypeReference tType) { super(client, tokenProvider, url, method, tType); } @@ -28,9 +33,10 @@ protected HttpRequestBody createRequestBody() { @Override public EmptyBodyVoidRequest addParameter(String name, Object value) { - //do nothing + // do nothing return this; } + @Override protected T parseResponseBody(Auth0HttpResponse response) throws Auth0Exception { if (!response.isSuccessful()) { @@ -38,5 +44,4 @@ protected T parseResponseBody(Auth0HttpResponse response) throws Auth0Exception } return null; } - } diff --git a/src/main/java/com/auth0/net/FormBodyRequest.java b/src/main/java/com/auth0/net/FormBodyRequest.java index d44e43da4..7939f907b 100644 --- a/src/main/java/com/auth0/net/FormBodyRequest.java +++ b/src/main/java/com/auth0/net/FormBodyRequest.java @@ -2,14 +2,9 @@ import com.auth0.client.mgmt.TokenProvider; import com.auth0.json.ObjectMapperProvider; -import com.auth0.json.auth.PushedAuthorizationResponse; import com.auth0.net.client.*; -import com.auth0.utils.Asserts; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import okhttp3.FormBody; -import okhttp3.RequestBody; - import java.io.IOException; /** @@ -20,11 +15,22 @@ public class FormBodyRequest extends BaseRequest { private static final String CONTENT_TYPE_FORM_DATA = "application/x-www-form-urlencoded"; - FormBodyRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, ObjectMapper mapper, TypeReference tType) { + FormBodyRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + ObjectMapper mapper, + TypeReference tType) { super(client, tokenProvider, url, method, mapper, tType); } - public FormBodyRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { + public FormBodyRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + TypeReference tType) { this(client, tokenProvider, url, method, ObjectMapperProvider.getMapper(), tType); } diff --git a/src/main/java/com/auth0/net/MultipartRequest.java b/src/main/java/com/auth0/net/MultipartRequest.java index 3261d58e9..9e6a4da91 100644 --- a/src/main/java/com/auth0/net/MultipartRequest.java +++ b/src/main/java/com/auth0/net/MultipartRequest.java @@ -1,17 +1,16 @@ package com.auth0.net; +import static com.auth0.utils.Asserts.assertNotNull; + import com.auth0.client.mgmt.TokenProvider; import com.auth0.json.ObjectMapperProvider; import com.auth0.net.client.*; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; - import java.io.File; import java.io.IOException; import java.util.HashMap; -import static com.auth0.utils.Asserts.assertNotNull; - /** * Request class that accepts parts to be sent encoded in a form. * The content type of this request is "multipart/form-data". @@ -32,7 +31,13 @@ public class MultipartRequest extends BaseRequest { private final ObjectMapper mapper; private int partsCount; - MultipartRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, ObjectMapper mapper, TypeReference tType) { + MultipartRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + ObjectMapper mapper, + TypeReference tType) { super(client, tokenProvider, url, method, mapper, tType); if (HttpMethod.GET.equals(method)) { throw new IllegalArgumentException("Multipart/form-data requests do not support the GET method."); @@ -42,7 +47,12 @@ public class MultipartRequest extends BaseRequest { this.bodyBuilder = Auth0MultipartRequestBody.newBuilder(); } - public MultipartRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { + public MultipartRequest( + Auth0HttpClient client, + TokenProvider tokenProvider, + String url, + HttpMethod method, + TypeReference tType) { this(client, tokenProvider, url, method, ObjectMapperProvider.getMapper(), tType); } @@ -67,7 +77,7 @@ protected T readResponseBody(Auth0HttpResponse response) throws IOException { @Override public MultipartRequest addHeader(String name, String value) { - //This is to avoid returning a different type + // This is to avoid returning a different type super.addHeader(name, value); return this; } diff --git a/src/main/java/com/auth0/net/RateLimitInterceptor.java b/src/main/java/com/auth0/net/RateLimitInterceptor.java index 842f143ad..e73b3ed36 100644 --- a/src/main/java/com/auth0/net/RateLimitInterceptor.java +++ b/src/main/java/com/auth0/net/RateLimitInterceptor.java @@ -2,6 +2,8 @@ import com.auth0.exception.Auth0Exception; import com.auth0.net.client.DefaultHttpClient; +import java.io.IOException; +import java.time.temporal.ChronoUnit; import net.jodah.failsafe.Failsafe; import net.jodah.failsafe.FailsafeException; import net.jodah.failsafe.RetryPolicy; @@ -11,9 +13,6 @@ import okhttp3.Response; import org.jetbrains.annotations.NotNull; -import java.io.IOException; -import java.time.temporal.ChronoUnit; - /** * An OkHttp {@linkplain Interceptor} responsible for retrying rate-limit errors (429) using a configurable maximum * number of retries, and an exponential backoff on retry attempts. @@ -64,10 +63,10 @@ public Response intercept(@NotNull Chain chain) throws IOException { } RetryPolicy retryPolicy = new RetryPolicy() - .withMaxRetries(maxRetries) - .withBackoff(INITIAL_INTERVAL, MAX_INTERVAL, ChronoUnit.MILLIS) - .withJitter(JITTER) - .handleResultIf(response -> response.code() == 429); + .withMaxRetries(maxRetries) + .withBackoff(INITIAL_INTERVAL, MAX_INTERVAL, ChronoUnit.MILLIS) + .withJitter(JITTER) + .handleResultIf(response -> response.code() == 429); // For testing purposes only, allow test to hook into retry listener to enable verification of retry backoff if (retryListener != null) { @@ -78,7 +77,8 @@ public Response intercept(@NotNull Chain chain) throws IOException { return Failsafe.with(retryPolicy).get((context) -> { // ensure response of last recorded response prior to retry is closed if (context.getLastResult() != null) { - context.getLastResult().close();; + context.getLastResult().close(); + ; } return chain.proceed(chain.request()); }); diff --git a/src/main/java/com/auth0/net/Request.java b/src/main/java/com/auth0/net/Request.java index 2b4e1491e..8f5f8f264 100644 --- a/src/main/java/com/auth0/net/Request.java +++ b/src/main/java/com/auth0/net/Request.java @@ -2,7 +2,6 @@ import com.auth0.exception.APIException; import com.auth0.exception.Auth0Exception; - import java.util.concurrent.CompletableFuture; /** diff --git a/src/main/java/com/auth0/net/SignUpRequest.java b/src/main/java/com/auth0/net/SignUpRequest.java index 474f7c4a1..6fc1e5e43 100644 --- a/src/main/java/com/auth0/net/SignUpRequest.java +++ b/src/main/java/com/auth0/net/SignUpRequest.java @@ -4,7 +4,6 @@ import com.auth0.net.client.Auth0HttpClient; import com.auth0.net.client.HttpMethod; import com.fasterxml.jackson.core.type.TypeReference; - import java.util.Map; /** @@ -13,8 +12,7 @@ public class SignUpRequest extends BaseRequest { public SignUpRequest(Auth0HttpClient client, String url) { - super(client, null, url, HttpMethod.POST, new TypeReference() { - }); + super(client, null, url, HttpMethod.POST, new TypeReference() {}); } /** diff --git a/src/main/java/com/auth0/net/Telemetry.java b/src/main/java/com/auth0/net/Telemetry.java index bf6c45ec2..76247b42f 100644 --- a/src/main/java/com/auth0/net/Telemetry.java +++ b/src/main/java/com/auth0/net/Telemetry.java @@ -2,7 +2,6 @@ import com.auth0.json.ObjectMapperProvider; import com.fasterxml.jackson.core.JsonProcessingException; - import java.util.Base64; import java.util.Collections; import java.util.HashMap; @@ -80,12 +79,12 @@ public String getVersion() { return version; } - //Visible for testing + // Visible for testing String getLibraryVersion() { return libraryVersion; } - //Visible for testing + // Visible for testing Map getEnvironment() { return env; } @@ -103,5 +102,4 @@ private String getJDKVersion() { } return version; } - } diff --git a/src/main/java/com/auth0/net/TelemetryInterceptor.java b/src/main/java/com/auth0/net/TelemetryInterceptor.java index 378f501fd..43cd44f51 100644 --- a/src/main/java/com/auth0/net/TelemetryInterceptor.java +++ b/src/main/java/com/auth0/net/TelemetryInterceptor.java @@ -1,10 +1,9 @@ package com.auth0.net; +import java.io.IOException; import okhttp3.Interceptor; import okhttp3.Response; -import java.io.IOException; - /** * OkHttp Interceptor implementation that adds the auth0-client header * to every request made by this SDK. diff --git a/src/main/java/com/auth0/net/TokenQuotaBucket.java b/src/main/java/com/auth0/net/TokenQuotaBucket.java index e6c192c21..79a4b5a11 100644 --- a/src/main/java/com/auth0/net/TokenQuotaBucket.java +++ b/src/main/java/com/auth0/net/TokenQuotaBucket.java @@ -30,6 +30,4 @@ public TokenQuotaLimit getPerHour() { public TokenQuotaLimit getPerDay() { return perDay; } - - } diff --git a/src/main/java/com/auth0/net/TokenRequest.java b/src/main/java/com/auth0/net/TokenRequest.java index 8122d48f2..800c5f4a3 100644 --- a/src/main/java/com/auth0/net/TokenRequest.java +++ b/src/main/java/com/auth0/net/TokenRequest.java @@ -11,8 +11,7 @@ public class TokenRequest extends BaseRequest { public TokenRequest(Auth0HttpClient client, String url) { - super(client, null, url, HttpMethod.POST, new TypeReference() { - }); + super(client, null, url, HttpMethod.POST, new TypeReference() {}); } /** diff --git a/src/main/java/com/auth0/net/VoidRequest.java b/src/main/java/com/auth0/net/VoidRequest.java index 5538fe672..293556925 100644 --- a/src/main/java/com/auth0/net/VoidRequest.java +++ b/src/main/java/com/auth0/net/VoidRequest.java @@ -6,7 +6,6 @@ import com.auth0.net.client.Auth0HttpResponse; import com.auth0.net.client.HttpMethod; import com.fasterxml.jackson.core.type.TypeReference; - import java.util.HashMap; /** @@ -21,8 +20,7 @@ public class VoidRequest extends BaseRequest { public VoidRequest(Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method) { - super(client, tokenProvider, url, method, new TypeReference() { - }); + super(client, tokenProvider, url, method, new TypeReference() {}); } @Override diff --git a/src/main/java/com/auth0/net/client/Auth0HttpClient.java b/src/main/java/com/auth0/net/client/Auth0HttpClient.java index 1ebefa4c3..d415f13ac 100644 --- a/src/main/java/com/auth0/net/client/Auth0HttpClient.java +++ b/src/main/java/com/auth0/net/client/Auth0HttpClient.java @@ -22,5 +22,4 @@ public interface Auth0HttpClient { * @return the {@link CompletableFuture} that represents the result of the asynchronous HTTP request. */ CompletableFuture sendRequestAsync(Auth0HttpRequest request); - } diff --git a/src/main/java/com/auth0/net/client/Auth0HttpRequest.java b/src/main/java/com/auth0/net/client/Auth0HttpRequest.java index 1b7d83bf7..c63f2a6ab 100644 --- a/src/main/java/com/auth0/net/client/Auth0HttpRequest.java +++ b/src/main/java/com/auth0/net/client/Auth0HttpRequest.java @@ -32,8 +32,8 @@ public Map getHeaders() { } public HttpRequestBody getBody() { - return body; -} + return body; + } public HttpMethod getMethod() { return method; @@ -52,7 +52,7 @@ private Builder(String url, HttpMethod method) { } public Builder withHeaders(Map headers) { - this.headers = headers; + this.headers = headers; return this; } diff --git a/src/main/java/com/auth0/net/client/Auth0HttpResponse.java b/src/main/java/com/auth0/net/client/Auth0HttpResponse.java index 28474bd96..e7c7a8f38 100644 --- a/src/main/java/com/auth0/net/client/Auth0HttpResponse.java +++ b/src/main/java/com/auth0/net/client/Auth0HttpResponse.java @@ -1,7 +1,6 @@ package com.auth0.net.client; import com.auth0.utils.Asserts; - import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ public class Auth0HttpResponse { private final Map headers; - private Auth0HttpResponse(Builder builder) { + private Auth0HttpResponse(Builder builder) { Asserts.assertNotNull(builder.code, "response code"); Asserts.assertNotNull(builder.headers, "response headers"); this.code = builder.code; @@ -25,7 +24,7 @@ public static Builder newBuilder() { } public boolean isSuccessful() { - return code >= 200 && code <= 299; + return code >= 200 && code <= 299; } public String getBody() { @@ -47,6 +46,7 @@ public String getHeader(String header) { public String getHeader(String header, String defaultValue) { return headers.get(header) != null ? headers.get(header) : defaultValue; } + public static class Builder { private int code; private String body; diff --git a/src/main/java/com/auth0/net/client/Auth0MultipartRequestBody.java b/src/main/java/com/auth0/net/client/Auth0MultipartRequestBody.java index b0425b051..6b79fa9e4 100644 --- a/src/main/java/com/auth0/net/client/Auth0MultipartRequestBody.java +++ b/src/main/java/com/auth0/net/client/Auth0MultipartRequestBody.java @@ -1,7 +1,6 @@ package com.auth0.net.client; import com.auth0.utils.Asserts; - import java.io.File; import java.util.HashMap; import java.util.Map; @@ -28,7 +27,7 @@ public Map getParts() { return this.parts; } - static public class FilePart { + public static class FilePart { private final String partName; private final File file; private final String mediaType; @@ -54,7 +53,6 @@ public File getFile() { public String getMediaType() { return mediaType; } - } public static class Builder { diff --git a/src/main/java/com/auth0/net/client/DefaultHttpClient.java b/src/main/java/com/auth0/net/client/DefaultHttpClient.java index 8daf3cea2..9e7ddf649 100644 --- a/src/main/java/com/auth0/net/client/DefaultHttpClient.java +++ b/src/main/java/com/auth0/net/client/DefaultHttpClient.java @@ -4,16 +4,15 @@ import com.auth0.client.ProxyOptions; import com.auth0.net.RateLimitInterceptor; import com.auth0.net.TelemetryInterceptor; -import okhttp3.*; -import okhttp3.logging.HttpLoggingInterceptor; -import org.jetbrains.annotations.NotNull; - import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; +import okhttp3.*; +import okhttp3.logging.HttpLoggingInterceptor; +import org.jetbrains.annotations.NotNull; /** * Default implementation of {@link Auth0HttpClient} responsible for performing HTTP requests @@ -113,8 +112,8 @@ private Request buildRequest(Auth0HttpRequest a0Request) { RequestBody okBody = addBody(a0Request); okhttp3.Request.Builder builder = new okhttp3.Request.Builder() - .url(a0Request.getUrl()) - .method(a0Request.getMethod().toString(), okBody); + .url(a0Request.getUrl()) + .method(a0Request.getMethod().toString(), okBody); for (Map.Entry e : a0Request.getHeaders().entrySet()) { builder.addHeader(e.getKey(), e.getValue()); } @@ -144,17 +143,16 @@ private Auth0HttpResponse buildResponse(Response okResponse) throws IOException content = responseBody.string(); } return Auth0HttpResponse.newBuilder() - .withStatusCode(okResponse.code()) - .withBody(content) - .withHeaders(headers) - .build(); + .withStatusCode(okResponse.code()) + .withBody(content) + .withHeaders(headers) + .build(); } @SuppressWarnings("deprecation") private RequestBody addBody(Auth0HttpRequest request) { // null body added to request results in request without body - if (Objects.isNull(request.getBody()) || - HttpMethod.GET.equals(request.getMethod())) { + if (Objects.isNull(request.getBody()) || HttpMethod.GET.equals(request.getMethod())) { return null; } @@ -169,20 +167,24 @@ private RequestBody addBody(Auth0HttpRequest request) { builder.add(entry.getKey(), val instanceof String ? (String) val : val.toString()); } okBody = builder.build(); - } - else if (Objects.nonNull(body.getMultipartRequestBody())) { + } else if (Objects.nonNull(body.getMultipartRequestBody())) { Auth0MultipartRequestBody multipartRequestBody = body.getMultipartRequestBody(); - MultipartBody.Builder bodyBuilder = new MultipartBody.Builder() - .setType(MultipartBody.FORM); + MultipartBody.Builder bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); if (Objects.nonNull(multipartRequestBody.getFilePart())) { - bodyBuilder.addFormDataPart(multipartRequestBody.getFilePart().getPartName(), - multipartRequestBody.getFilePart().getFile().getName(), - RequestBody.create(MediaType.parse(multipartRequestBody.getFilePart().getMediaType()), multipartRequestBody.getFilePart().getFile())); + bodyBuilder.addFormDataPart( + multipartRequestBody.getFilePart().getPartName(), + multipartRequestBody.getFilePart().getFile().getName(), + RequestBody.create( + MediaType.parse( + multipartRequestBody.getFilePart().getMediaType()), + multipartRequestBody.getFilePart().getFile())); } multipartRequestBody.getParts().forEach(bodyBuilder::addFormDataPart); okBody = bodyBuilder.build(); } else { - okBody = RequestBody.create(MediaType.parse(request.getBody().getContentType()), request.getBody().getContent()); + okBody = RequestBody.create( + MediaType.parse(request.getBody().getContentType()), + request.getBody().getContent()); } return okBody; @@ -217,9 +219,9 @@ private HttpLoggingInterceptor getLoggingInterceptor(LoggingOptions loggingOptio private void configureProxy(okhttp3.OkHttpClient.Builder clientBuilder, ProxyOptions proxyOptions) { if (Objects.nonNull(proxyOptions)) { - //Set proxy + // Set proxy clientBuilder.proxy(proxyOptions.getProxy()); - //Set authentication, if present + // Set authentication, if present final String proxyAuth = proxyOptions.getBasicAuthentication(); if (Objects.nonNull(proxyAuth)) { clientBuilder.proxyAuthenticator(new Authenticator() { @@ -231,9 +233,10 @@ public okhttp3.Request authenticate(Route route, @NotNull Response response) { if (Objects.nonNull(response.request().header(PROXY_AUTHORIZATION_HEADER))) { return null; } - return response.request().newBuilder() - .header(PROXY_AUTHORIZATION_HEADER, proxyAuth) - .build(); + return response.request() + .newBuilder() + .header(PROXY_AUTHORIZATION_HEADER, proxyAuth) + .build(); } }); } @@ -379,5 +382,4 @@ public DefaultHttpClient build() { return new DefaultHttpClient(this); } } - } diff --git a/src/main/java/com/auth0/net/client/HttpMethod.java b/src/main/java/com/auth0/net/client/HttpMethod.java index 23752f00b..0b316f2c8 100644 --- a/src/main/java/com/auth0/net/client/HttpMethod.java +++ b/src/main/java/com/auth0/net/client/HttpMethod.java @@ -4,7 +4,9 @@ * Represents the HTTP methods when calling the Auth0 APIs. */ public enum HttpMethod { - - GET, POST, PUT, PATCH, DELETE; - + GET, + POST, + PUT, + PATCH, + DELETE; } diff --git a/src/main/java/com/auth0/utils/Asserts.java b/src/main/java/com/auth0/utils/Asserts.java index f572e961b..199819a38 100644 --- a/src/main/java/com/auth0/utils/Asserts.java +++ b/src/main/java/com/auth0/utils/Asserts.java @@ -30,8 +30,8 @@ public static void assertValidUrl(String value, String name) { throw new IllegalArgumentException(String.format("'%s' must be a valid URL!", name)); } boolean isValidUrl = HttpUrl.parse(value) != null; - boolean isValidCustomSchemeUrl = value.contains(":") && - HttpUrl.parse(value.replaceFirst(value.substring(0, value.indexOf(":")), "https")) != null; + boolean isValidCustomSchemeUrl = value.contains(":") + && HttpUrl.parse(value.replaceFirst(value.substring(0, value.indexOf(":")), "https")) != null; if (!isValidUrl && !isValidCustomSchemeUrl) { throw new IllegalArgumentException(String.format("'%s' must be a valid URL!", name)); } diff --git a/src/main/java/com/auth0/utils/HttpResponseHeadersUtils.java b/src/main/java/com/auth0/utils/HttpResponseHeadersUtils.java index 12d4b14dc..bf003d36a 100644 --- a/src/main/java/com/auth0/utils/HttpResponseHeadersUtils.java +++ b/src/main/java/com/auth0/utils/HttpResponseHeadersUtils.java @@ -1,8 +1,7 @@ package com.auth0.utils; -import com.auth0.net.TokenQuotaLimit; import com.auth0.net.TokenQuotaBucket; - +import com.auth0.net.TokenQuotaLimit; import java.util.Map; public class HttpResponseHeadersUtils { @@ -65,18 +64,17 @@ public static TokenQuotaBucket parseQuota(String tokenQuota) { } } - if (attributes.length >0 && attributes[0].contains("per_hour")) { + if (attributes.length > 0 && attributes[0].contains("per_hour")) { perHour = new TokenQuotaLimit(quota, remaining, time); - } else if (attributes.length >0 && attributes[0].contains("per_day")) { + } else if (attributes.length > 0 && attributes[0].contains("per_day")) { perDay = new TokenQuotaLimit(quota, remaining, time); } } - if(perHour == null && perDay == null) { + if (perHour == null && perDay == null) { return null; } return new TokenQuotaBucket(perHour, perDay); } - } diff --git a/src/main/java/com/auth0/utils/tokens/HS256SignatureVerifier.java b/src/main/java/com/auth0/utils/tokens/HS256SignatureVerifier.java index 21586a1ce..6831741a2 100644 --- a/src/main/java/com/auth0/utils/tokens/HS256SignatureVerifier.java +++ b/src/main/java/com/auth0/utils/tokens/HS256SignatureVerifier.java @@ -12,5 +12,4 @@ class HS256SignatureVerifier extends SignatureVerifier { HS256SignatureVerifier(String secret) { super(Algorithm.HMAC256(secret)); } - } diff --git a/src/main/java/com/auth0/utils/tokens/IdTokenVerifier.java b/src/main/java/com/auth0/utils/tokens/IdTokenVerifier.java index 9a354713a..321a2c699 100644 --- a/src/main/java/com/auth0/utils/tokens/IdTokenVerifier.java +++ b/src/main/java/com/auth0/utils/tokens/IdTokenVerifier.java @@ -3,7 +3,6 @@ import com.auth0.exception.IdTokenValidationException; import com.auth0.jwt.interfaces.DecodedJWT; import com.auth0.utils.Asserts; - import java.util.Calendar; import java.util.Date; import java.util.List; @@ -121,7 +120,9 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr throw new IdTokenValidationException("Issuer (iss) claim must be a string present in the ID token"); } if (!decoded.getIssuer().equals(this.issuer)) { - throw new IdTokenValidationException(String.format("Issuer (iss) claim mismatch in the ID token, expected \"%s\", found \"%s\"", this.issuer, decoded.getIssuer())); + throw new IdTokenValidationException(String.format( + "Issuer (iss) claim mismatch in the ID token, expected \"%s\", found \"%s\"", + this.issuer, decoded.getIssuer())); } if (isEmpty(decoded.getSubject())) { @@ -130,10 +131,13 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr final List audience = decoded.getAudience(); if (audience == null) { - throw new IdTokenValidationException("Audience (aud) claim must be a string or array of strings present in the ID token"); + throw new IdTokenValidationException( + "Audience (aud) claim must be a string or array of strings present in the ID token"); } if (!audience.contains(this.audience)) { - throw new IdTokenValidationException(String.format("Audience (aud) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", this.audience, decoded.getAudience())); + throw new IdTokenValidationException(String.format( + "Audience (aud) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", + this.audience, decoded.getAudience())); } // Org verification @@ -143,19 +147,25 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr // org ID String orgClaim = decoded.getClaim("org_id").asString(); if (isEmpty(orgClaim)) { - throw new IdTokenValidationException("Organization Id (org_id) claim must be a string present in the ID token"); + throw new IdTokenValidationException( + "Organization Id (org_id) claim must be a string present in the ID token"); } if (!this.organization.equals(orgClaim)) { - throw new IdTokenValidationException(String.format("Organization (org_id) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", this.organization, orgClaim)); + throw new IdTokenValidationException(String.format( + "Organization (org_id) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", + this.organization, orgClaim)); } } else { // org name String orgNameClaim = decoded.getClaim("org_name").asString(); if (isEmpty(orgNameClaim)) { - throw new IdTokenValidationException("Organization name (org_name) claim must be a string present in the ID token"); + throw new IdTokenValidationException( + "Organization name (org_name) claim must be a string present in the ID token"); } if (!org.toLowerCase().equals(orgNameClaim)) { - throw new IdTokenValidationException(String.format("Organization (org_name) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", this.organization, orgNameClaim)); + throw new IdTokenValidationException(String.format( + "Organization (org_name) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", + this.organization, orgNameClaim)); } } } @@ -165,7 +175,8 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr final int clockSkew = this.leeway != null ? this.leeway : DEFAULT_LEEWAY; if (decoded.getExpiresAt() == null) { - throw new IdTokenValidationException("Expiration Time (exp) claim must be a number present in the ID token"); + throw new IdTokenValidationException( + "Expiration Time (exp) claim must be a number present in the ID token"); } cal.setTime(decoded.getExpiresAt()); @@ -173,7 +184,9 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr Date expDate = cal.getTime(); if (now.after(expDate)) { - throw new IdTokenValidationException(String.format("Expiration Time (exp) claim error in the ID token; current time (%d) is after expiration time (%d)", now.getTime() / 1000, expDate.getTime() / 1000)); + throw new IdTokenValidationException(String.format( + "Expiration Time (exp) claim error in the ID token; current time (%d) is after expiration time (%d)", + now.getTime() / 1000, expDate.getTime() / 1000)); } if (decoded.getIssuedAt() == null) { @@ -189,24 +202,30 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr throw new IdTokenValidationException("Nonce (nonce) claim must be a string present in the ID token"); } if (!nonce.equals(nonceClaim)) { - throw new IdTokenValidationException(String.format("Nonce (nonce) claim mismatch in the ID token; expected \"%s\", found \"%s\"", nonce, nonceClaim)); + throw new IdTokenValidationException(String.format( + "Nonce (nonce) claim mismatch in the ID token; expected \"%s\", found \"%s\"", + nonce, nonceClaim)); } } if (audience.size() > 1) { String azpClaim = decoded.getClaim(AZP_CLAIM).asString(); if (isEmpty(azpClaim)) { - throw new IdTokenValidationException("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"); + throw new IdTokenValidationException( + "Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"); } if (!this.audience.equals(azpClaim)) { - throw new IdTokenValidationException(String.format("Authorized Party (azp) claim mismatch in the ID token; expected \"%s\", found \"%s\"", this.audience, azpClaim)); + throw new IdTokenValidationException(String.format( + "Authorized Party (azp) claim mismatch in the ID token; expected \"%s\", found \"%s\"", + this.audience, azpClaim)); } } if (maxAuthenticationAge != null) { Date authTime = decoded.getClaim(AUTH_TIME_CLAIM).asDate(); if (authTime == null) { - throw new IdTokenValidationException("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"); + throw new IdTokenValidationException( + "Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"); } cal.setTime(authTime); @@ -215,7 +234,9 @@ public void verify(String token, String nonce, Integer maxAuthenticationAge) thr Date authTimeDate = cal.getTime(); if (now.after(authTimeDate)) { - throw new IdTokenValidationException(String.format("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (%d) is after last auth at (%d)", now.getTime() / 1000, authTimeDate.getTime() / 1000)); + throw new IdTokenValidationException(String.format( + "Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (%d) is after last auth at (%d)", + now.getTime() / 1000, authTimeDate.getTime() / 1000)); } } } @@ -269,7 +290,7 @@ public Builder withLeeway(Integer leeway) { /** * Specify the expected organization (org_id) the token must be issued for. This should be used if using the * Organizations feature. - + * * @param organization the ID of the organization. * @return this Builder instance. */ diff --git a/src/main/java/com/auth0/utils/tokens/PublicKeyProvider.java b/src/main/java/com/auth0/utils/tokens/PublicKeyProvider.java index c7efdb591..ae8f4970e 100644 --- a/src/main/java/com/auth0/utils/tokens/PublicKeyProvider.java +++ b/src/main/java/com/auth0/utils/tokens/PublicKeyProvider.java @@ -1,7 +1,6 @@ package com.auth0.utils.tokens; import com.auth0.exception.PublicKeyProviderException; - import java.security.interfaces.RSAPublicKey; /** diff --git a/src/main/java/com/auth0/utils/tokens/RS256SignatureVerifier.java b/src/main/java/com/auth0/utils/tokens/RS256SignatureVerifier.java index 06cdfe7eb..1ac052a7b 100644 --- a/src/main/java/com/auth0/utils/tokens/RS256SignatureVerifier.java +++ b/src/main/java/com/auth0/utils/tokens/RS256SignatureVerifier.java @@ -4,7 +4,6 @@ import com.auth0.exception.PublicKeyProviderException; import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.interfaces.RSAKeyProvider; - import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; @@ -26,7 +25,8 @@ public RSAPublicKey getPublicKeyById(String keyId) { try { return publicKeyProvider.getPublicKeyById(keyId); } catch (PublicKeyProviderException pke) { - throw new IdTokenValidationException(String.format("Could not find a public key for Key ID (kid) \"%s\"", keyId), pke); + throw new IdTokenValidationException( + String.format("Could not find a public key for Key ID (kid) \"%s\"", keyId), pke); } } diff --git a/src/main/java/com/auth0/utils/tokens/SignatureVerifier.java b/src/main/java/com/auth0/utils/tokens/SignatureVerifier.java index acc1ba9d1..2045fbd92 100644 --- a/src/main/java/com/auth0/utils/tokens/SignatureVerifier.java +++ b/src/main/java/com/auth0/utils/tokens/SignatureVerifier.java @@ -54,9 +54,7 @@ public static SignatureVerifier forRS256(PublicKeyProvider publicKeyProvider) { SignatureVerifier(Algorithm algorithm) { Asserts.assertNotNull(algorithm, "algorithm"); this.algorithm = algorithm; - this.verifier = JWT.require(algorithm) - .ignoreIssuedAt() - .build(); + this.verifier = JWT.require(algorithm).ignoreIssuedAt().build(); } /** @@ -72,7 +70,8 @@ DecodedJWT verifySignature(String token) throws IdTokenValidationException { try { this.verifier.verify(decoded); } catch (AlgorithmMismatchException algorithmMismatchException) { - String message = String.format("Signature algorithm of \"%s\" is not supported. Expected the ID token to be signed with \"%s\"", + String message = String.format( + "Signature algorithm of \"%s\" is not supported. Expected the ID token to be signed with \"%s\"", decoded.getAlgorithm(), this.algorithm.getName()); throw new IdTokenValidationException(message, algorithmMismatchException); } catch (SignatureVerificationException signatureVerificationException) { diff --git a/src/test/java/com/auth0/AssertsUtil.java b/src/test/java/com/auth0/AssertsUtil.java deleted file mode 100644 index 822851e7f..000000000 --- a/src/test/java/com/auth0/AssertsUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.auth0; - -import org.junit.jupiter.api.function.Executable; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertThrows; - -public class AssertsUtil { - - public static T verifyThrows(Class expectedType, Executable executable) { - return assertThrows(expectedType, executable); - } - - public static T verifyThrows(Class expectedType, Executable executable, String message) { - T result = assertThrows(expectedType, executable); - assertThat(result.getMessage(), is(message)); - return result; - } -} diff --git a/src/test/java/com/auth0/client/HttpOptionsTest.java b/src/test/java/com/auth0/client/HttpOptionsTest.java deleted file mode 100644 index a3d74f5bf..000000000 --- a/src/test/java/com/auth0/client/HttpOptionsTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.auth0.client; - -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -@SuppressWarnings("deprecation") -public class HttpOptionsTest { - - @Test - public void setsOptions() { - HttpOptions opts = new HttpOptions(); - opts.setLoggingOptions(new LoggingOptions(LoggingOptions.LogLevel.NONE)); - opts.setConnectTimeout(20); - opts.setReadTimeout(30); - opts.setMaxRequests(5); - opts.setMaxRequestsPerHost(3); - opts.setManagementAPIMaxRetries(5); - - assertThat(opts.getLoggingOptions().getLogLevel(), is(LoggingOptions.LogLevel.NONE)); - assertThat(opts.getConnectTimeout(), is(20)); - assertThat(opts.getReadTimeout(), is(30)); - assertThat(opts.getMaxRequests(), is(5)); - assertThat(opts.getManagementAPIMaxRetries(), is(5)); - assertThat(opts.getMaxRequestsPerHost(), is(3)); - } - - @Test - public void connectTimeoutMustNotBeNegative() { - HttpOptions opts = new HttpOptions(); - opts.setConnectTimeout(-1); - assertThat(opts.getConnectTimeout(), is(0)); - } - - @Test - public void readTimeoutMustNotBeNegative() { - HttpOptions opts = new HttpOptions(); - opts.setReadTimeout(-1); - assertThat(opts.getReadTimeout(), is(0)); - } - - @Test - public void apiMaxRetriesNotLessThan0() { - HttpOptions opts = new HttpOptions(); - verifyThrows(IllegalArgumentException.class, - () -> opts.setManagementAPIMaxRetries(-1), - "Retries must be between zero and ten."); - } - - @Test - public void apiMaxRetriesNotGreaterThan10() { - HttpOptions opts = new HttpOptions(); - verifyThrows(IllegalArgumentException.class, - () -> opts.setManagementAPIMaxRetries(11), - "Retries must be between zero and ten."); - } - - @Test - public void maxRequestsMustBePositive() { - HttpOptions opts = new HttpOptions(); - verifyThrows(IllegalArgumentException.class, () -> opts.setMaxRequests(0), "maxRequests must be one or greater."); - } - - @Test - public void maxRequestsPerHostMustBePositive() { - HttpOptions opts = new HttpOptions(); - } - - @Test - public void usesDefaults() { - HttpOptions opts = new HttpOptions(); - assertThat(opts.getReadTimeout(), is(10)); - assertThat(opts.getConnectTimeout(), is(10)); - assertThat(opts.getMaxRequests(), is(64)); - assertThat(opts.getMaxRequestsPerHost(), is(5)); - assertThat(opts.getManagementAPIMaxRetries(), is(3)); - } -} diff --git a/src/test/java/com/auth0/client/MockServer.java b/src/test/java/com/auth0/client/MockServer.java deleted file mode 100644 index 7dbe2217e..000000000 --- a/src/test/java/com/auth0/client/MockServer.java +++ /dev/null @@ -1,312 +0,0 @@ -package com.auth0.client; - -import com.auth0.net.TokenQuotaBucket; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.type.CollectionType; -import com.fasterxml.jackson.databind.type.MapType; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import okio.Buffer; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class MockServer { - - public static final String AUTH_USER_INFO = "src/test/resources/auth/user_info.json"; - public static final String AUTH_RESET_PASSWORD = "src/test/resources/auth/reset_password.json"; - public static final String AUTH_SIGN_UP = "src/test/resources/auth/sign_up.json"; - public static final String AUTH_SIGN_UP_USERNAME = "src/test/resources/auth/sign_up_username.json"; - public static final String AUTH_TOKENS = "src/test/resources/auth/tokens.json"; - public static final String AUTH_ERROR_WITH_ERROR_DESCRIPTION = "src/test/resources/auth/error_with_error_description.json"; - public static final String AUTH_ERROR_WITH_ERROR = "src/test/resources/auth/error_with_error.json"; - public static final String AUTH_ERROR_WITH_DESCRIPTION = "src/test/resources/auth/error_with_description.json"; - public static final String AUTH_ERROR_WITH_DESCRIPTION_AND_EXTRA_PROPERTIES = "src/test/resources/auth/error_with_description_and_extra_properties.json"; - public static final String AUTH_ERROR_PLAINTEXT = "src/test/resources/auth/error_plaintext.json"; - public static final String AUTH_OOB_AUTHENTICATOR_RESPONSE = "src/test/resources/auth/add_oob_authenticator_response.json"; - public static final String AUTH_OTP_AUTHENTICATOR_RESPONSE = "src/test/resources/auth/add_otp_authenticator_response.json"; - public static final String AUTH_LIST_AUTHENTICATORS_RESPONSE = "src/test/resources/auth/list_authenticators_response.json"; - public static final String AUTH_CHALLENGE_RESPONSE = "src/test/resources/auth/mfa_challenge_request_response.json"; - public static final String MGMT_ERROR_WITH_MESSAGE = "src/test/resources/mgmt/error_with_message.json"; - public static final String MGMT_CLIENT_GRANTS_LIST = "src/test/resources/mgmt/client_grants_list.json"; - public static final String MGMT_CLIENT_GRANTS_PAGED_LIST = "src/test/resources/mgmt/client_grants_paged_list.json"; - public static final String MGMT_CLIENT_GRANT = "src/test/resources/mgmt/client_grant.json"; - public static final String MGMT_CLIENTS_LIST = "src/test/resources/mgmt/clients_list.json"; - public static final String MGMT_CLIENTS_PAGED_LIST = "src/test/resources/mgmt/clients_paged_list.json"; - public static final String MGMT_CLIENT = "src/test/resources/mgmt/client.json"; - public static final String MGMT_CLIENT_CREDENTIAL = "src/test/resources/mgmt/client_credential.json"; - public static final String MGMT_CLIENT_CREDENTIAL_LIST = "src/test/resources/mgmt/client_credential_list.json"; - public static final String MGMT_CONNECTIONS_LIST = "src/test/resources/mgmt/connections_list.json"; - public static final String MGMT_CONNECTIONS_PAGED_LIST = "src/test/resources/mgmt/connections_paged_list.json"; - public static final String MGMT_CONNECTION = "src/test/resources/mgmt/connection.json"; - public static final String MGMT_CONNECTION_SCIM_CONFIGURATION = "src/test/resources/mgmt/connection_scim_configuration.json"; - public static final String MGMT_CONNECTION_DEFAULT_SCIM_CONFIGURATION = "src/test/resources/mgmt/default_connection_scim_configuration.json"; - public static final String MGMT_CONNECTION_SCIM_TOKENS = "src/test/resources/mgmt/connection_scim_tokens.json"; - public static final String MGMT_CONNECTION_SCIM_TOKEN = "src/test/resources/mgmt/connection_scim_token.json"; - public static final String MGMT_ENABLED_CLIENTS_FOR_CONNECTION = "src/test/resources/mgmt/enabled_clients_for_connection.json"; - public static final String MGMT_CONNECTION_KEY = "src/test/resources/mgmt/connection_key.json"; - public static final String MGMT_ROTATE_KEY = "src/test/resources/mgmt/rotate_key.json"; - public static final String MGMT_DEVICE_CREDENTIALS_LIST = "src/test/resources/mgmt/device_credentials_list.json"; - public static final String MGMT_DEVICE_CREDENTIALS = "src/test/resources/mgmt/device_credentials.json"; - public static final String MGMT_GRANTS_LIST = "src/test/resources/mgmt/grants_list.json"; - public static final String MGMT_GRANTS_PAGED_LIST = "src/test/resources/mgmt/grants_paged_list.json"; - public static final String MGMT_LOG_EVENTS_LIST = "src/test/resources/mgmt/event_logs_list.json"; - public static final String MGMT_LOG_EVENTS_PAGED_LIST = "src/test/resources/mgmt/event_logs_paged_list.json"; - public static final String MGMT_LOG_EVENT = "src/test/resources/mgmt/event_log.json"; - public static final String MGMT_LOG_STREAM = "src/test/resources/mgmt/log_stream.json"; - public static final String MGMT_LOG_STREAMS_LIST = "src/test/resources/mgmt/log_streams_list.json"; - public static final String MGMT_RESOURCE_SERVERS_LIST = "src/test/resources/mgmt/resource_servers_list.json"; - public static final String MGMT_RESOURCE_SERVERS_PAGED_LIST = "src/test/resources/mgmt/resource_servers_paged_list.json"; - public static final String MGMT_RESOURCE_SERVER = "src/test/resources/mgmt/resource_server.json"; - public static final String MGMT_ROLE = "src/test/resources/mgmt/role.json"; - public static final String MGMT_ROLES_LIST = "src/test/resources/mgmt/roles_list.json"; - public static final String MGMT_ROLES_PAGED_LIST = "src/test/resources/mgmt/roles_paged_list.json"; - public static final String MGMT_ROLE_PERMISSIONS_LIST = "src/test/resources/mgmt/role_permissions_list.json"; - public static final String MGMT_ROLE_PERMISSIONS_PAGED_LIST = "src/test/resources/mgmt/role_permissions_paged_list.json"; - public static final String MGMT_ROLE_USERS_LIST = "src/test/resources/mgmt/role_users_list.json"; - public static final String MGMT_ROLE_USERS_PAGED_LIST = "src/test/resources/mgmt/role_users_paged_list.json"; - public static final String MGMT_ROLE_USERS_CHECKPOINT_PAGED_LIST = "src/test/resources/mgmt/role_users_checkpoint_paged_list.json"; - public static final String MGMT_RULES_LIST = "src/test/resources/mgmt/rules_list.json"; - public static final String MGMT_RULES_CONFIGS_LIST = "src/test/resources/mgmt/rules_configs_list.json"; - public static final String MGMT_RULES_PAGED_LIST = "src/test/resources/mgmt/rules_paged_list.json"; - public static final String MGMT_RULE = "src/test/resources/mgmt/rule.json"; - public static final String MGMT_USER_BLOCKS = "src/test/resources/mgmt/user_blocks.json"; - public static final String MGMT_BRANDING_SETTINGS = "src/test/resources/mgmt/branding_settings.json"; - public static final String MGMT_BRANDING_LOGIN_TEMPLATE = "src/test/resources/mgmt/branding_login_template.json"; - public static final String MGMT_BLACKLISTED_TOKENS_LIST = "src/test/resources/mgmt/blacklisted_tokens_list.json"; - public static final String MGMT_EMAIL_PROVIDER = "src/test/resources/mgmt/email_provider.json"; - public static final String MGMT_EMAIL_TEMPLATE = "src/test/resources/mgmt/email_template.json"; - public static final String MGMT_USERS_LIST = "src/test/resources/mgmt/users_list.json"; - public static final String MGMT_USERS_PAGED_LIST = "src/test/resources/mgmt/users_paged_list.json"; - public static final String MGMT_USER_PERMISSIONS_PAGED_LIST = "src/test/resources/mgmt/user_permissions_paged_list.json"; - public static final String MGMT_USER_ROLES_PAGED_LIST = "src/test/resources/mgmt/user_roles_paged_list.json"; - public static final String MGMT_REFRESH_TOKEN = "src/test/resources/mgmt/refresh_token.json"; - public static final String MGMT_SESSION = "src/test/resources/mgmt/session.json"; - public static final String MGMT_USER_REFRESH_TOKENS = "src/test/resources/mgmt/user_refresh_tokens.json"; - public static final String MGMT_USER_SESSIONS = "src/test/resources/mgmt/user_sessions.json"; - public static final String MGMT_USER = "src/test/resources/mgmt/user.json"; - public static final String MGMT_RECOVERY_CODE = "src/test/resources/mgmt/recovery_code.json"; - public static final String MGMT_IDENTITIES_LIST = "src/test/resources/mgmt/identities_list.json"; - public static final String MGMT_PROMPT = "src/test/resources/mgmt/prompt.json"; - public static final String MGMT_CUSTOM_TEXT_PROMPT = "src/test/resources/mgmt/custom_text_prompt.json"; - public static final String MGMT_PARTIALS_PROMPT = "src/test/resources/mgmt/partials_prompt.json"; - public static final String MGMT_GUARDIAN_AUTHENTICATION_POLICIES_LIST = "src/test/resources/mgmt/guardian_authentication_policies_list.json"; - public static final String MGMT_GUARDIAN_ENROLLMENT = "src/test/resources/mgmt/guardian_enrollment.json"; - public static final String MGMT_GUARDIAN_ENROLLMENTS_LIST = "src/test/resources/mgmt/guardian_enrollments_list.json"; - public static final String MGMT_GUARDIAN_ENROLLMENT_TICKET = "src/test/resources/mgmt/guardian_enrollment_ticket.json"; - public static final String MGMT_GUARDIAN_FACTOR = "src/test/resources/mgmt/guardian_factor.json"; - public static final String MGMT_GUARDIAN_FACTORS_LIST = "src/test/resources/mgmt/guardian_factors_list.json"; - public static final String MGMT_GUARDIAN_TEMPLATES = "src/test/resources/mgmt/guardian_templates.json"; - public static final String MGMT_GUARDIAN_SNS_FACTOR_PROVIDER_EMPTY = "src/test/resources/mgmt/guardian_sns_factor_provider_empty.json"; - public static final String MGMT_GUARDIAN_SNS_FACTOR_PROVIDER = "src/test/resources/mgmt/guardian_sns_factor_provider.json"; - public static final String MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_EMPTY = "src/test/resources/mgmt/guardian_twilio_factor_provider_empty.json"; - public static final String MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_FROM = "src/test/resources/mgmt/guardian_twilio_factor_provider_with_from.json"; - public static final String MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_MSSID = "src/test/resources/mgmt/guardian_twilio_factor_provider_with_messaging_service_sid.json"; - public static final String MGMT_TENANT = "src/test/resources/mgmt/tenant.json"; - public static final String MGMT_ACTIVE_USERS_COUNT = "src/test/resources/mgmt/active_users_count.json"; - public static final String MGMT_DAILY_STATS_LIST = "src/test/resources/mgmt/daily_stats_list.json"; - public static final String MGMT_PASSWORD_CHANGE_TICKET = "src/test/resources/mgmt/password_change_ticket.json"; - public static final String MGMT_EMAIL_VERIFICATION_TICKET = "src/test/resources/mgmt/email_verification_ticket.json"; - public static final String MGMT_EMPTY_LIST = "src/test/resources/mgmt/empty_list.json"; - public static final String MGMT_JOB = "src/test/resources/mgmt/job.json"; - public static final String MGMT_JOB_POST_VERIFICATION_EMAIL = "src/test/resources/mgmt/job_post_verification_email.json"; - public static final String MGMT_JOB_POST_USERS_EXPORTS = "src/test/resources/mgmt/job_post_users_exports.json"; - public static final String MGMT_JOB_POST_USERS_IMPORTS = "src/test/resources/mgmt/job_post_users_imports.json"; - public static final String MGMT_JOB_POST_USERS_IMPORTS_INPUT = "src/test/resources/mgmt/job_post_users_imports_input.json"; - public static final String MGMT_JOB_ERROR_DETAILS = "src/test/resources/mgmt/job_error_details.json"; - public static final String MGMT_NETWORK_ACLS_LIST = "src/test/resources/mgmt/network_acls_list.json"; - public static final String MGMT_NETWORK_ACLS = "src/test/resources/mgmt/network_acls.json"; - public static final String MGMT_USER_ATTRIBUTE_PROFILES_LIST = "src/test/resources/mgmt/user_attribute_profiles_list.json"; - public static final String MGMT_USER_ATTRIBUTE_PROFILE = "src/test/resources/mgmt/user_attribute_profile.json"; - public static final String MGMT_USER_ATTRIBUTE_PROFILE_TEMPLATE = "src/test/resources/mgmt/user_attribute_profile_template.json"; - public static final String MGMT_USER_ATTRIBUTE_PROFILE_TEMPLATES_LIST = "src/test/resources/mgmt/user_attribute_profile_templates_list.json"; - public static final String MULTIPART_SAMPLE = "src/test/resources/mgmt/multipart_sample.json"; - public static final String PASSWORDLESS_EMAIL_RESPONSE = "src/test/resources/auth/passwordless_email.json"; - public static final String PASSWORDLESS_SMS_RESPONSE = "src/test/resources/auth/passwordless_sms.json"; - public static final String PUSHED_AUTHORIZATION_RESPONSE = "src/test/resources/auth/pushed_authorization_response.json"; - public static final String BACK_CHANNEL_AUTHORIZE_RESPONSE = "src/test/resources/auth/back_channel_authorize_response.json"; - public static final String BACK_CHANNEL_LOGIN_STATUS_RESPONSE = "src/test/resources/auth/back_channel_login_status_response.json"; - public static final String AUTHENTICATOR_METHOD_BY_ID = "src/test/resources/mgmt/authenticator_method_by_id.json"; - public static final String AUTHENTICATOR_METHOD_CREATE = "src/test/resources/mgmt/authenticator_method_create.json"; - public static final String AUTHENTICATOR_METHOD_LIST = "src/test/resources/mgmt/authenticator_method_list.json"; - public static final String AUTHENTICATOR_METHOD_PAGED_LIST = "src/test/resources/mgmt/authenticator_method_paged_list.json"; - public static final String AUTHENTICATOR_METHOD_UPDATE = "src/test/resources/mgmt/authenticator_method_update.json"; - public static final String AUTHENTICATOR_METHOD_UPDATE_BY_ID = "src/test/resources/mgmt/authenticator_method_update_by_id.json"; - public static final String ORGANIZATION = "src/test/resources/mgmt/organization.json"; - public static final String ORGANIZATIONS_LIST = "src/test/resources/mgmt/organizations_list.json"; - public static final String ORGANIZATIONS_PAGED_LIST = "src/test/resources/mgmt/organizations_paged_list.json"; - public static final String ORGANIZATIONS_CHECKPOINT_PAGED_LIST = "src/test/resources/mgmt/organizations_checkpoint_paged_list.json"; - public static final String ORGANIZATION_MEMBERS_LIST = "src/test/resources/mgmt/organization_members_list.json"; - public static final String ORGANIZATION_MEMBERS_PAGED_LIST = "src/test/resources/mgmt/organization_members_paged_list.json"; - public static final String ORGANIZATION_MEMBERS_CHECKPOINT_PAGED_LIST = "src/test/resources/mgmt/organization_members_checkpoint_paged_list.json"; - public static final String ORGANIZATION_CONNECTIONS_LIST = "src/test/resources/mgmt/organization_connections_list.json"; - public static final String ORGANIZATION_CONNECTIONS_PAGED_LIST = "src/test/resources/mgmt/organization_connections_paged_list.json"; - public static final String ORGANIZATION_CONNECTION = "src/test/resources/mgmt/organization_connection.json"; - public static final String ORGANIZATION_MEMBER_ROLES_LIST = "src/test/resources/mgmt/organization_member_roles_list.json"; - public static final String ORGANIZATION_MEMBER_ROLES_PAGED_LIST = "src/test/resources/mgmt/organization_member_roles_paged_list.json"; - public static final String ORGANIZATION_CLIENT_GRANTS = "src/test/resources/mgmt/organization_client_grants.json"; - public static final String ORGANIZATION_CLIENT_GRANTS_PAGED_LIST = "src/test/resources/mgmt/organization_client_grants_paged_list.json"; - public static final String ORGANIZATION_CLIENT_GRANT = "src/test/resources/mgmt/organization_client_grant.json"; - public static final String INVITATION = "src/test/resources/mgmt/invitation.json"; - public static final String INVITATIONS_LIST = "src/test/resources/mgmt/invitations_list.json"; - public static final String INVITATIONS_PAGED_LIST = "src/test/resources/mgmt/invitations_paged_list.json"; - public static final String ACTION = "src/test/resources/mgmt/action.json"; - public static final String ACTION_TRIGGERS = "src/test/resources/mgmt/action_triggers.json"; - public static final String ACTION_VERSION = "src/test/resources/mgmt/action_version.json"; - public static final String ACTION_EXECUTION = "src/test/resources/mgmt/action_execution.json"; - public static final String ACTIONS_LIST = "src/test/resources/mgmt/actions_list.json"; - public static final String ACTION_VERSIONS_LIST = "src/test/resources/mgmt/action_versions_list.json"; - public static final String ACTION_TRIGGER_BINDINGS = "src/test/resources/mgmt/action_trigger_bindings.json"; - public static final String BREACHED_PASSWORD_SETTINGS = "src/test/resources/mgmt/breached_password_settings.json"; - public static final String BRUTE_FORCE_CONFIGURATION = "src/test/resources/mgmt/brute_force_configuration.json"; - public static final String SUSPICIOUS_IP_THROTTLING_CONFIGURATION = "src/test/resources/mgmt/suspicious_ip_throttling_configuration.json"; - public static final String KEY = "src/test/resources/mgmt/key.json"; - public static final String KEY_LIST = "src/test/resources/mgmt/key_list.json"; - public static final String KEY_REVOKE = "src/test/resources/mgmt/key_revoke.json"; - public static final String KEY_ROTATE = "src/test/resources/mgmt/key_rotate.json"; - public static final String ENCRYPTION_KEY = "src/test/resources/mgmt/encryption_key.json"; - public static final String ENCRYPTION_KEYS_LIST = "src/test/resources/mgmt/encryption_keys_list.json"; - public static final String RATE_LIMIT_ERROR = "src/test/resources/mgmt/rate_limit_error.json"; - public static final String SELF_SERVICE_PROFILES_LIST = "src/test/resources/mgmt/self_service_profiles_list.json"; - public static final String SELF_SERVICE_PROFILE_RESPONSE = "src/test/resources/mgmt/self_service_profile_response.json"; - public static final String SELF_SERVICE_PROFILE_CUSTOM_TEXT = "src/test/resources/mgmt/self_service_profile_custom_text.json"; - public static final String SELF_SERVICE_PROFILE_SSO_TICKET = "src/test/resources/mgmt/self_service_profile_sso_ticket.json"; - - private final MockWebServer server; - - public MockServer() throws Exception { - server = new MockWebServer(); - server.start(); - } - - public void stop() throws IOException { - server.shutdown(); - } - - public String getBaseUrl() { - return server.url("/").toString(); - } - - public RecordedRequest takeRequest() throws InterruptedException { - return server.takeRequest(); - } - - private String readTextFile(String path) throws IOException { - return new String(Files.readAllBytes(Paths.get(path))); - } - - public void jsonResponse(String path, int statusCode) throws IOException { - MockResponse response = new MockResponse() - .setResponseCode(statusCode) - .addHeader("Content-Type", "application/json") - .setBody(readTextFile(path)); - server.enqueue(response); - } - - public void noContentResponse() { - MockResponse response = new MockResponse() - .setResponseCode(204) - .addHeader("Content-Type", "application/json") - .setBody(""); - server.enqueue(response); - } - - public void rateLimitReachedResponse(long limit, long remaining, long reset) throws IOException { - rateLimitReachedResponse(limit, remaining, reset, null); - } - - public void rateLimitReachedResponse(long limit, long remaining, long reset, String path) throws IOException { - MockResponse response = new MockResponse().setResponseCode(429); - if (limit != -1) { - response.addHeader("x-ratelimit-limit", String.valueOf(limit)); - } - if (remaining != -1) { - response.addHeader("x-ratelimit-remaining", String.valueOf(remaining)); - } - if (reset != -1) { - response.addHeader("x-ratelimit-reset", String.valueOf(reset)); - } - if (path != null) { - response - .addHeader("Content-Type", "application/json") - .setBody(readTextFile(path)); - } - server.enqueue(response); - } - - public void rateLimitReachedResponse(long limit, long remaining, long reset, - String clientQuotaLimit, String organizationQuotaLimit, long retryAfter) throws IOException { - rateLimitReachedResponse(limit, remaining, reset, null, clientQuotaLimit, organizationQuotaLimit, retryAfter); - } - - public void rateLimitReachedResponse(long limit, long remaining, long reset, String path, String clientQuotaLimit, - String organizationQuotaLimit, long retryAfter) throws IOException { - MockResponse response = new MockResponse().setResponseCode(429); - if (limit != -1) { - response.addHeader("x-ratelimit-limit", String.valueOf(limit)); - } - if (remaining != -1) { - response.addHeader("x-ratelimit-remaining", String.valueOf(remaining)); - } - if (reset != -1) { - response.addHeader("x-ratelimit-reset", String.valueOf(reset)); - } - if (clientQuotaLimit != null) { - response.addHeader("auth0-client-quota-limit", clientQuotaLimit); - } - if (organizationQuotaLimit != null) { - response.addHeader("auth0-organization-quota-limit", organizationQuotaLimit); - } - if (retryAfter != -1) { - response.addHeader("retry-after", String.valueOf(retryAfter)); - } - if (path != null) { - response - .addHeader("Content-Type", "application/json") - .setBody(readTextFile(path)); - } - server.enqueue(response); - } - - public void textResponse(String path, int statusCode) throws IOException { - MockResponse response = new MockResponse() - .setResponseCode(statusCode) - .addHeader("Content-Type", "text/plain") - .setBody(readTextFile(path)); - server.enqueue(response); - } - - public void emptyResponse(int statusCode) { - MockResponse response = new MockResponse() - .setResponseCode(statusCode); - server.enqueue(response); - } - - public static Map bodyFromRequest(RecordedRequest request) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - MapType mapType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class); - try (Buffer body = request.getBody()) { - return mapper.readValue(body.inputStream(), mapType); - } - } - - public static List bodyListFromRequest(RecordedRequest request) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - CollectionType listType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, Object.class); - try (Buffer body = request.getBody()) { - return mapper.readValue(body.inputStream(), listType); - } - } - - public static String readFromRequest(RecordedRequest request) { - try (Buffer body = request.getBody()) { - return body.readUtf8(); - } - } -} diff --git a/src/test/java/com/auth0/client/RecordedRequestMatcher.java b/src/test/java/com/auth0/client/RecordedRequestMatcher.java deleted file mode 100644 index f0e659878..000000000 --- a/src/test/java/com/auth0/client/RecordedRequestMatcher.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.auth0.client; - -import com.auth0.net.client.HttpMethod; -import okhttp3.HttpUrl; -import okhttp3.mockwebserver.RecordedRequest; -import org.hamcrest.Description; -import org.hamcrest.TypeSafeDiagnosingMatcher; - -public class RecordedRequestMatcher extends TypeSafeDiagnosingMatcher { - - private static final int METHOD_PATH = 0; - private static final int HEADER = 1; - private static final int QUERY_PARAMETER = 2; - private static final int QUERY_PARAMETER_PRESENCE = 3; - - private final int checkingOption; - private final String first; - private final String second; - - - private RecordedRequestMatcher(String first, String second, int checkingOption) { - this.checkingOption = checkingOption; - this.first = first; - this.second = second; - } - - @Override - protected boolean matchesSafely(RecordedRequest item, Description mismatchDescription) { - if (item == null) { - mismatchDescription.appendText("was null"); - return false; - } - - switch (checkingOption) { - default: - case METHOD_PATH: - return matchesMethodAndPath(item, mismatchDescription); - case HEADER: - return matchesHeader(item, mismatchDescription); - case QUERY_PARAMETER: - return matchesQueryParameter(item, mismatchDescription); - case QUERY_PARAMETER_PRESENCE: - return hasQueryParameter(item, mismatchDescription); - } - } - - private boolean matchesMethodAndPath(RecordedRequest item, Description mismatchDescription) { - if (!item.getMethod().equalsIgnoreCase(first)) { - mismatchDescription.appendText("method was ").appendValue(item.getMethod()); - return false; - } - String path = item.getPath(); - boolean hasQuery = path.indexOf("?") > 0; - if (hasQuery) { - path = path.substring(0, path.indexOf("?")); - } - if (!path.equals(second)) { - mismatchDescription.appendText("path was ").appendValue(path); - return false; - } - - return true; - } - - private boolean matchesHeader(RecordedRequest item, Description mismatchDescription) { - String value = item.getHeader(first); - if (value != null && !value.equals(second) || value == null && second != null) { - mismatchDescription.appendText(first).appendText(" header was ").appendValue(value); - return false; - } - - return true; - } - - private boolean matchesQueryParameter(RecordedRequest item, Description mismatchDescription) { - HttpUrl requestUrl = item.getRequestUrl(); - if (requestUrl.querySize() == 0) { - mismatchDescription.appendText(" query was empty"); - return false; - } - - String queryParamValue = requestUrl.queryParameter(first); - if (second.equals(queryParamValue)) { - return true; - } - - mismatchDescription.appendValueList("Query parameters were {", ", ", "}.", - requestUrl.query().split("&")); - return false; - } - - private boolean hasQueryParameter(RecordedRequest item, Description mismatchDescription) { - String path = item.getPath(); - boolean hasQuery = path.indexOf("?") > 0; - if (!hasQuery) { - mismatchDescription.appendText(" query was empty"); - return false; - } - - String query = path.substring(path.indexOf("?") + 1); - String[] parameters = query.split("&"); - for (String p : parameters) { - if (p.startsWith(String.format("%s=", first))) { - return true; - } - } - mismatchDescription.appendValueList("Query parameters were {", ", ", "}.", parameters); - return false; - } - - @Override - public void describeTo(Description description) { - switch (checkingOption) { - default: - case METHOD_PATH: - description.appendText("A request with method ") - .appendValue(first) - .appendText(" and path ") - .appendValue(second); - break; - case HEADER: - description.appendText("A request containing header ") - .appendValue(first) - .appendText(" with value ") - .appendValue(second); - break; - case QUERY_PARAMETER: - description.appendText("A request containing query parameter ") - .appendValue(first) - .appendText(" with value ") - .appendValue(second); - break; - case QUERY_PARAMETER_PRESENCE: - description.appendText("A request containing query parameter ") - .appendValue(first); - break; - } - } - - public static RecordedRequestMatcher hasMethodAndPath(HttpMethod method, String path) { - return new RecordedRequestMatcher(method.toString(), path, METHOD_PATH); - } - - public static RecordedRequestMatcher hasHeader(String name, String value) { - return new RecordedRequestMatcher(name, value, HEADER); - } - - public static RecordedRequestMatcher hasQueryParameter(String name, String value) { - return new RecordedRequestMatcher(name, value, QUERY_PARAMETER); - } - - public static RecordedRequestMatcher hasQueryParameter(String name) { - return new RecordedRequestMatcher(name, null, QUERY_PARAMETER_PRESENCE); - } -} diff --git a/src/test/java/com/auth0/client/UrlMatcher.java b/src/test/java/com/auth0/client/UrlMatcher.java deleted file mode 100644 index 2bc0af750..000000000 --- a/src/test/java/com/auth0/client/UrlMatcher.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.auth0.client; - -import okhttp3.HttpUrl; -import org.hamcrest.Description; -import org.hamcrest.TypeSafeDiagnosingMatcher; - -import java.util.Arrays; - -public class UrlMatcher extends TypeSafeDiagnosingMatcher { - - - private static final int BASE_URL = 0; - private static final int QUERY_PARAMETER = 1; - private static final int ENCODED_QUERY = 2; - private final int checkingOption; - - private String encodedQueryContains; - private String scheme; - private String host; - private String path; - private String paramKey; - private String paramValue; - - private UrlMatcher(String scheme, String host, String path) { - this.checkingOption = BASE_URL; - this.scheme = scheme; - this.host = host; - this.path = path; - } - - private UrlMatcher(String paramKey, String paramValue) { - this.checkingOption = QUERY_PARAMETER; - this.paramKey = paramKey; - this.paramValue = paramValue; - } - - private UrlMatcher(String encodedQueryContains) { - this.checkingOption = ENCODED_QUERY; - this.encodedQueryContains = encodedQueryContains; - } - - @Override - protected boolean matchesSafely(String item, Description mismatchDescription) { - if (item == null) { - mismatchDescription.appendText("was null"); - return false; - } - HttpUrl url = HttpUrl.parse(item); - if (url == null) { - mismatchDescription.appendText("was not a valid url"); - return false; - } - - switch (checkingOption) { - default: - case BASE_URL: - return matchesBaseUrl(url, mismatchDescription); - case QUERY_PARAMETER: - return matchesParameter(url, mismatchDescription); - case ENCODED_QUERY: - return matchesEncodedQuery(url, mismatchDescription); - } - } - - private boolean matchesEncodedQuery(HttpUrl url, Description mismatchDescription) { - if (!url.encodedQuery().contains(encodedQueryContains)) { - mismatchDescription.appendText("encoded query was ").appendValue(url.encodedQuery()); - return false; - } - - return true; - } - - private boolean matchesBaseUrl(HttpUrl url, Description mismatchDescription) { - if (!url.scheme().equals(scheme)) { - mismatchDescription.appendText("scheme was ").appendValue(url.scheme()); - return false; - } - if (!url.host().equals(host)) { - mismatchDescription.appendText("host was ").appendValue(url.host()); - return false; - } - if (path == null) { - return true; - } - if (path.startsWith("/")) { - path = path.substring(1); - } - if (path.endsWith("/")) { - path = path.substring(0, path.length() - 1); - } - if (!url.pathSegments().equals(Arrays.asList(path.split("/")))) { - StringBuilder sb = new StringBuilder(); - for (String p : url.pathSegments()) { - sb.append(p).append("/"); - } - sb.deleteCharAt(sb.length() - 1); - mismatchDescription.appendText("path was ").appendValue(sb.toString()); - return false; - } - - return true; - } - - private boolean matchesParameter(HttpUrl url, Description mismatchDescription) { - String value = url.queryParameter(paramKey); - if (value != null && !value.equals(paramValue) || value == null && paramValue != null) { - mismatchDescription.appendText("value was ").appendValue(value); - return false; - } - - return true; - } - - @Override - public void describeTo(Description description) { - switch (checkingOption) { - default: - case BASE_URL: - description.appendText("An url with scheme ") - .appendValue(scheme) - .appendText(", host ") - .appendValue(host) - .appendText("and path ") - .appendValue(path); - break; - case QUERY_PARAMETER: - description.appendText("An url with the query parameter ") - .appendValue(paramKey) - .appendText(" with value ") - .appendValue(paramValue); - break; - case ENCODED_QUERY: - description.appendText("An url with encoded query containing ") - .appendValue(encodedQueryContains); - break; - } - } - - public static UrlMatcher isUrl(String scheme, String host, String path) { - return new UrlMatcher(scheme, host, path); - } - - public static UrlMatcher isUrl(String scheme, String host) { - return new UrlMatcher(scheme, host, null); - } - - public static UrlMatcher hasQueryParameter(String key, String value) { - return new UrlMatcher(key, value); - } - - public static UrlMatcher encodedQueryContains(String text) { - return new UrlMatcher(text); - } -} diff --git a/src/test/java/com/auth0/client/auth/AuthAPITest.java b/src/test/java/com/auth0/client/auth/AuthAPITest.java deleted file mode 100644 index b65c51ad1..000000000 --- a/src/test/java/com/auth0/client/auth/AuthAPITest.java +++ /dev/null @@ -1,2388 +0,0 @@ -package com.auth0.client.auth; - -import com.auth0.client.MockServer; -import com.auth0.exception.APIException; -import com.auth0.json.ObjectMapperProvider; -import com.auth0.json.auth.*; -import com.auth0.net.BaseRequest; -import com.auth0.net.Request; -import com.auth0.net.SignUpRequest; -import com.auth0.net.TokenRequest; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.Auth0HttpRequest; -import com.auth0.net.client.Auth0HttpResponse; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.FileReader; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static com.auth0.client.UrlMatcher.hasQueryParameter; -import static com.auth0.client.UrlMatcher.isUrl; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.hamcrest.collection.IsMapContaining.hasEntry; -import static org.hamcrest.collection.IsMapContaining.hasKey; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class AuthAPITest { - - private static final String DOMAIN = "domain.auth0.com"; - private static final String CLIENT_ID = "clientId"; - private static final String CLIENT_SECRET = "clientSecret"; - private static final String PASSWORD_STRENGTH_ERROR_RESPONSE_NONE = "src/test/resources/auth/password_strength_error_none.json"; - private static final String PASSWORD_STRENGTH_ERROR_RESPONSE_SOME = "src/test/resources/auth/password_strength_error_some.json"; - - private MockServer server; - private AuthAPI api; - private AuthAPI apiNoClientAuthentication; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - api = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID, CLIENT_SECRET).build(); - apiNoClientAuthentication = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID).build(); - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - // Configuration - - @Test - @SuppressWarnings("deprecation") - public void shouldAcceptHttpOptions() { - AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET, new com.auth0.client.HttpOptions()); - assertThat(api, is(notNullValue())); - } - - @Test - public void shouldAcceptHttpClient() { - Auth0HttpClient httpClient = new Auth0HttpClient() { - @Override - public Auth0HttpResponse sendRequest(Auth0HttpRequest request) { - return null; - } - - @Override - public CompletableFuture sendRequestAsync(Auth0HttpRequest request) { - return null; - } - }; - - AuthAPI api = AuthAPI.newBuilder(DOMAIN, CLIENT_ID, CLIENT_SECRET) - .withHttpClient(httpClient) - .build(); - - assertThat(api, is(notNullValue())); - assertThat(api.getHttpClient(), is(notNullValue())); - } - - @Test - public void shouldAcceptDomainWithNoScheme() { - AuthAPI api = AuthAPI.newBuilder("me.something.com", CLIENT_ID, CLIENT_SECRET).build(); - - assertThat(api.getBaseUrl(), is(notNullValue())); - assertThat(api.getBaseUrl().toString(), isUrl("https", "me.something.com")); - } - - @Test - public void shouldAcceptDomainWithHttpScheme() { - AuthAPI api = AuthAPI.newBuilder("http://me.something.com", CLIENT_ID, CLIENT_SECRET).build(); - - assertThat(api.getBaseUrl(), is(notNullValue())); - assertThat(api.getBaseUrl().toString(), isUrl("http", "me.something.com")); - } - - @Test - public void shouldThrowWhenDomainIsInvalid() { - verifyThrows(IllegalArgumentException.class, - () -> AuthAPI.newBuilder("", CLIENT_ID, CLIENT_SECRET).build(), - "The domain had an invalid format and couldn't be parsed as an URL."); - } - - @Test - public void shouldThrowWhenDomainIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthAPI.newBuilder(null, CLIENT_ID, CLIENT_SECRET).build(), - "'domain' cannot be null!"); - } - - @Test - public void shouldThrowWhenClientIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthAPI.newBuilder(DOMAIN, null, CLIENT_SECRET).build(), - "'client id' cannot be null!"); - } - - @Test - public void shouldAcceptNullClientSecret() { - assertThat(AuthAPI.newBuilder(DOMAIN, CLIENT_ID, (String) null).build(), - is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldThrowOnInValidMaxRequestsPerHostConfiguration() { - com.auth0.client.HttpOptions options = new com.auth0.client.HttpOptions(); - verifyThrows(IllegalArgumentException.class, - () -> options.setMaxRequestsPerHost(0), - "maxRequestsPerHost must be one or greater."); - } - - //Authorize - - @Test - public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeUrl(null), - "'redirect uri' must be a valid URL!"); - } - - @Test - public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNotValidURL() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeUrl("notvalid.url"), - "'redirect uri' must be a valid URL!"); - } - - @Test - public void shouldGetAuthorizeUrlBuilder() { - AuthorizeUrlBuilder builder = api.authorizeUrl("https://domain.auth0.com/callback"); - assertThat(builder, is(notNullValue())); - } - - @Test - public void shouldSetAuthorizeUrlBuilderDefaultValues() { - AuthAPI api = AuthAPI.newBuilder("domain.auth0.com", CLIENT_ID, CLIENT_SECRET).build(); - String url = api.authorizeUrl("https://domain.auth0.com/callback").build(); - - assertThat(url, isUrl("https", "domain.auth0.com", "/authorize")); - assertThat(url, hasQueryParameter("response_type", "code")); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - assertThat(url, hasQueryParameter("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(url, hasQueryParameter("connection", null)); - } - - - //Logout - - @Test - public void shouldThrowWhenLogoutUrlBuilderReturnToUrlIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.logoutUrl(null, true), - "'return to url' must be a valid URL!"); - } - - @Test - public void shouldThrowWhenLogoutUrlBuilderRedirectUriIsNotValidURL() { - verifyThrows(IllegalArgumentException.class, - () -> api.logoutUrl("notvalid.url", true), - "'return to url' must be a valid URL!"); - } - - @Test - public void shouldGetLogoutUrlBuilder() { - LogoutUrlBuilder builder = api.logoutUrl("https://domain.auth0.com/callback", true); - assertThat(builder, is(notNullValue())); - } - - @Test - public void shouldSetLogoutUrlBuilderDefaultValues() { - AuthAPI api = AuthAPI.newBuilder("domain.auth0.com", CLIENT_ID, CLIENT_SECRET).build(); - String url = api.logoutUrl("https://my.domain.com/welcome", false).build(); - - assertThat(url, isUrl("https", "domain.auth0.com", "/v2/logout")); - assertThat(url, hasQueryParameter("client_id", null)); - assertThat(url, hasQueryParameter("returnTo", "https://my.domain.com/welcome")); - } - - @Test - public void shouldSetLogoutUrlBuilderDefaultValuesAndClientId() { - AuthAPI api = AuthAPI.newBuilder("domain.auth0.com", CLIENT_ID, CLIENT_SECRET).build(); - String url = api.logoutUrl("https://my.domain.com/welcome", true).build(); - - assertThat(url, isUrl("https", "domain.auth0.com", "/v2/logout")); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - assertThat(url, hasQueryParameter("returnTo", "https://my.domain.com/welcome")); - } - - - //UserInfo - - @Test - public void shouldThrowOnUserInfoWithNullAccessToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.userInfo(null), - "'access token' cannot be null!"); - } - - @Test - public void shouldCreateUserInfoRequest() throws Exception { - Request request = api.userInfo("accessToken"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_USER_INFO, 200); - UserInfo response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/userinfo")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer accessToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getValues(), is(notNullValue())); - assertThat(response.getValues(), hasEntry("email_verified", false)); - assertThat(response.getValues(), hasEntry("email", "test.account@userinfo.com")); - assertThat(response.getValues(), hasEntry("clientID", "q2hnj2iu...")); - assertThat(response.getValues(), hasEntry("updated_at", "2016-12-05T15:15:40.545Z")); - assertThat(response.getValues(), hasEntry("name", "test.account@userinfo.com")); - assertThat(response.getValues(), hasEntry("picture", "https://s.gravatar.com/avatar/dummy.png")); - assertThat(response.getValues(), hasEntry("user_id", "auth0|58454...")); - assertThat(response.getValues(), hasEntry("nickname", "test.account")); - assertThat(response.getValues(), hasEntry("created_at", "2016-12-05T11:16:59.640Z")); - assertThat(response.getValues(), hasEntry("sub", "auth0|58454...")); - assertThat(response.getValues(), hasKey("identities")); - @SuppressWarnings("unchecked") - List> identities = (List>) response.getValues().get("identities"); - assertThat(identities, hasSize(1)); - assertThat(identities.get(0), hasEntry("user_id", "58454...")); - assertThat(identities.get(0), hasEntry("provider", "auth0")); - assertThat(identities.get(0), hasEntry("connection", "Username-Password-Authentication")); - assertThat(identities.get(0), hasEntry("isSocial", false)); - } - - - //Reset Password - - @Test - public void shouldThrowOnResetPasswordWithNullEmail() { - verifyThrows(IllegalArgumentException.class, - () -> api.resetPassword(null, "my-connection"), - "'email' cannot be null!"); - } - - @Test - public void shouldThrowOnResetPasswordWithNullConnection() { - verifyThrows(IllegalArgumentException.class, - () -> api.resetPassword("me@auth0.com", null), - "'connection' cannot be null!"); - } - - @Test - public void shouldCreateResetPasswordRequest() throws Exception { - Request request = api.resetPassword("me@auth0.com", "db-connection"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_RESET_PASSWORD, 200); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/change_password")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, not(hasKey("password"))); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldCreateResetPasswordRequestWithSpecifiedClientId() throws Exception { - Request request = api.resetPassword("CLIENT-ID", "me@auth0.com", "db-connection"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_RESET_PASSWORD, 200); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/change_password")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", "CLIENT-ID")); - assertThat(body, not(hasKey("password"))); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldCreateResetPasswordRequestWithSpecifiedClientIdWithOrganization() throws Exception { - Request request = api.resetPassword("CLIENT-ID", "me@auth0.com", "db-connection", "ORGANIZATION-ID"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_RESET_PASSWORD, 200); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/change_password")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", "CLIENT-ID")); - assertThat(body, hasEntry("organization", "ORGANIZATION-ID")); - assertThat(body, not(hasKey("password"))); - - assertThat(response, is(nullValue())); - } - - //Sign Up - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnSignUpWithNullEmail() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp(null, "p455w0rd", "my-connection"), - "'email' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnSignUpWithNullPasswordString() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", (String) null, "my-connection"), - "'password' cannot be null!"); - } - - @Test - public void shouldThrowOnSignUpWithNullPasswordCharArray() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", (char[]) null, "my-connection"), - "'password' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnSignUpWithNullConnection() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", "p455w0rd", null), - "'connection' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnUsernameSignUpWithNullEmail() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp(null, "me", "p455w0rd", "my-connection"), - "'email' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnUsernameSignUpWithNullUsername() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", null, "p455w0rd", "my-connection"), - "'username' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnUsernameSignUpWithNullPasswordString() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", "me", (String) null, "my-connection"), - "'password' cannot be null!"); - } - - @Test - public void shouldThrowOnUsernameSignUpWithNullPasswordCharArray() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", "me", (char[]) null, "my-connection"), - "'password' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnUsernameSignUpWithNullConnection() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", "me", "p455w0rd", null), - "'connection' cannot be null!"); - } - - @Test - public void shouldThrowOnUsernameAndPhoneNumberSignUpWithNullPhoneNumber() { - verifyThrows(IllegalArgumentException.class, - () -> api.signUp("me@auth0.com", "me", new char[]{'p','4','5','5','w','0','r','d'}, "my-connection", null), - "'phone number' cannot be null!"); - } - - @Test - public void shouldHaveNotStrongPasswordWithDetailedDescription() throws Exception { - ObjectMapper mapper = new ObjectMapper(); - FileReader fr = new FileReader(PASSWORD_STRENGTH_ERROR_RESPONSE_NONE); - Map mapPayload = mapper.readValue(fr, new TypeReference>() { - }); - APIException ex = new APIException(mapPayload, 400); - assertThat(ex.getError(), is("invalid_password")); - String expectedDescription = "At least 10 characters in length; Contain at least 3 of the following 4 types of characters: lower case letters (a-z), upper case letters (A-Z), numbers (i.e. 0-9), special characters (e.g. !@#$%^&*); Should contain: lower case letters (a-z), upper case letters (A-Z), numbers (i.e. 0-9), special characters (e.g. !@#$%^&*); No more than 2 identical characters in a row (e.g., \"aaa\" not allowed)"; - assertThat(ex.getDescription(), is(expectedDescription)); - } - - @Test - public void shouldHaveNotStrongPasswordWithShortDetailedDescription() throws Exception { - ObjectMapper mapper = new ObjectMapper(); - FileReader fr = new FileReader(PASSWORD_STRENGTH_ERROR_RESPONSE_SOME); - Map mapPayload = mapper.readValue(fr, new TypeReference>() { - }); - APIException ex = new APIException(mapPayload, 400); - assertThat(ex.getError(), is("invalid_password")); - String expectedDescription = "Should contain: lower case letters (a-z), upper case letters (A-Z), numbers (i.e. 0-9), special characters (e.g. !@#$%^&*)"; - assertThat(ex.getDescription(), is(expectedDescription)); - } - - @Test - public void shouldCreateSignUpRequestWithUsernameAndPhoneNumber() throws Exception { - SignUpRequest request = api.signUp("me@auth0.com", "me", new char[]{'p','4','5','5','w','0','r','d'}, "db-connection", "1234567890"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_SIGN_UP_USERNAME, 200); - CreatedUser response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/signup")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("phone_number", "1234567890")); - - assertThat(response, is(notNullValue())); - assertThat(response.getUserId(), is("58457fe6b27")); - assertThat(response.getEmail(), is("me@auth0.com")); - assertThat(response.isEmailVerified(), is(false)); - assertThat(response.getUsername(), is("me")); - assertThat(response.getPhoneNumber(), is("1234567890")); - } - - @Test - public void shouldCreateSignUpRequestWithUsername() throws Exception { - @SuppressWarnings("deprecation") - SignUpRequest request = api.signUp("me@auth0.com", "me", "p455w0rd", "db-connection"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_SIGN_UP_USERNAME, 200); - CreatedUser response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/signup")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - - assertThat(response, is(notNullValue())); - assertThat(response.getUserId(), is("58457fe6b27")); - assertThat(response.getEmail(), is("me@auth0.com")); - assertThat(response.isEmailVerified(), is(false)); - assertThat(response.getUsername(), is("me")); - } - - @Test - public void shouldCreateSignUpRequest() throws Exception { - @SuppressWarnings("deprecation") - SignUpRequest request = api.signUp("me@auth0.com", "p455w0rd", "db-connection"); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_SIGN_UP, 200); - CreatedUser response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/signup")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, not(hasKey("username"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getUserId(), is("58457fe6b27")); - assertThat(response.getEmail(), is("me@auth0.com")); - assertThat(response.isEmailVerified(), is(false)); - assertThat(response.getUsername(), is(nullValue())); - } - - @Test - public void shouldCreateSignUpRequestWithCustomParameters() throws Exception { - @SuppressWarnings("deprecation") - SignUpRequest request = api.signUp("me@auth0.com", "p455w0rd", "db-connection"); - assertThat(request, is(notNullValue())); - Map customFields = new HashMap<>(); - customFields.put("age", "25"); - customFields.put("address", "123, fake street"); - request.setCustomFields(customFields); - - server.jsonResponse(AUTH_SIGN_UP, 200); - CreatedUser response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/dbconnections/signup")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("email", "me@auth0.com")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("connection", "db-connection")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasKey("user_metadata")); - @SuppressWarnings("unchecked") - Map metadata = (Map) body.get("user_metadata"); - assertThat(metadata, hasEntry("age", "25")); - assertThat(metadata, hasEntry("address", "123, fake street")); - assertThat(body, not(hasKey("username"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getUserId(), is("58457fe6b27")); - assertThat(response.getEmail(), is("me@auth0.com")); - assertThat(response.isEmailVerified(), is(false)); - assertThat(response.getUsername(), is(nullValue())); - } - - - //Log In with AuthorizationCode Grant - - @Test - public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullCode() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeCode(null, "https://domain.auth0.com/callback"), - "'code' cannot be null!"); - } - - @Test - public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullRedirectUri() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeCode("code", null), - "'redirect uri' cannot be null!"); - } - - @Test - public void shouldCreateLogInWithAuthorizationCodeGrantRequest() throws Exception { - TokenRequest request = api.exchangeCode("code123", "https://domain.auth0.com/callback"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("code", "code123")); - assertThat(body, hasEntry("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(body, hasEntry("grant_type", "authorization_code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void authorizationCodeGrantRequestRequiresClientAuthentication() { - verifyThrows(IllegalStateException.class, - () -> apiNoClientAuthentication.exchangeCode("code", "https://domain.auth0.com/callback"), - "A client secret or client assertion signing key is required for this operation"); - } - - @Test - public void shouldCreateLogInWithAuthorizationCodeGrantRequestWithCustomParameters() throws Exception { - TokenRequest request = api.exchangeCode("code123", "https://domain.auth0.com/callback"); - assertThat(request, is(notNullValue())); - request.setAudience("https://myapi.auth0.com/users"); - request.setRealm("dbconnection"); - request.setScope("profile photos contacts"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("code", "code123")); - assertThat(body, hasEntry("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(body, hasEntry("grant_type", "authorization_code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - assertThat(body, hasEntry("realm", "dbconnection")); - assertThat(body, hasEntry("scope", "profile photos contacts")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - - //Log In with Password grant - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnLogInWithPasswordWithNullUsername() { - verifyThrows(IllegalArgumentException.class, - () -> api.login(null, "p455w0rd"), - "'email or username' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnLogInWithPasswordWithNullPassword() { - verifyThrows(IllegalArgumentException.class, - () -> api.login("me", (String) null), - "'password' cannot be null!"); - } - - @Test - public void shouldThrowOnLogInWithCharPasswordWithNullPassword() { - verifyThrows(IllegalArgumentException.class, - () -> api.login("me", (char[]) null), - "'password' cannot be null!"); - } - - @Test - public void shouldCreateLogInWithPasswordGrantRequest() throws Exception { - @SuppressWarnings("deprecation") - TokenRequest request = api.login("me", "p455w0rd"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "password")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void passwordGrantRequestRequiresClientAuthentication() { - verifyThrows(IllegalStateException.class, - () -> apiNoClientAuthentication.login("me", "p455w0rd"), - "A client secret or client assertion signing key is required for this operation"); - } - - @Test - public void shouldCreateLogInWithPasswordGrantRequestWithCustomParameters() throws Exception { - @SuppressWarnings("deprecation") - TokenRequest request = api.login("me", "p455w0rd"); - assertThat(request, is(notNullValue())); - request.setRealm("dbconnection"); - request.setScope("profile photos contacts"); - request.setAudience("https://myapi.auth0.com/users"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "password")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("realm", "dbconnection")); - assertThat(body, hasEntry("scope", "profile photos contacts")); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldSetCustomHeaderWithPasswordlessRealmRequest() throws Exception { - TokenRequest request = api.login("me", new char[]{'p','a','s','s','w','o','r','d'}); - request.addHeader("some-header", "some-value"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("some-header", "some-value")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "password")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "password")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - //Log In with PasswordRealm grant - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullUsername() { - verifyThrows(IllegalArgumentException.class, - () -> api.login(null, "p455w0rd", "realm"), - "'email or username' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordString() { - verifyThrows(IllegalArgumentException.class, - () -> api.login("me", (String) null, "realm"), - "'password' cannot be null!"); - } - - @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordCharArray() { - verifyThrows(IllegalArgumentException.class, - () -> api.login("me", (char[]) null, "realm"), - "'password' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullRealm() { - verifyThrows(IllegalArgumentException.class, - () -> api.login("me", "p455w0rd", null), - "'realm' cannot be null!"); - } - - @Test - public void shouldCreateLogInWithPasswordRealmGrantRequest() throws Exception { - @SuppressWarnings("deprecation") - TokenRequest request = api.login("me", "p455w0rd", "realm"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/password-realm")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("realm", "realm")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void passwordRealmGrantRequestRequiresClientAuthentication() { - verifyThrows(IllegalStateException.class, - () -> apiNoClientAuthentication.login("me", "p455w0rd", "realm"), - "A client secret or client assertion signing key is required for this operation"); - } - - @Test - public void shouldCreateLogInWithPasswordRealmGrantRequestWithCustomParameters() throws Exception { - @SuppressWarnings("deprecation") - TokenRequest request = api.login("me", "p455w0rd", "realm"); - assertThat(request, is(notNullValue())); - request.setAudience("https://myapi.auth0.com/users"); - request.setRealm("dbconnection"); - request.setScope("profile photos contacts"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/password-realm")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("username", "me")); - assertThat(body, hasEntry("password", "p455w0rd")); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - assertThat(body, hasEntry("realm", "dbconnection")); - assertThat(body, hasEntry("scope", "profile photos contacts")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - - //Log In with ClientCredentials grant - - @Test - public void shouldThrowOnLogInWithClientCredentialsWithNullAudience() { - verifyThrows(IllegalArgumentException.class, - () -> api.requestToken(null), - "'audience' cannot be null!"); - } - - @Test - public void shouldCreateLogInWithClientCredentialsGrantRequest() throws Exception { - TokenRequest request = api.requestToken("https://myapi.auth0.com/users"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "client_credentials")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - assertThat(body, not(hasEntry("organization", any(String.class)))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldCreateLogInWithClientCredentialsGrantRequestWithOrg() throws Exception { - TokenRequest request = api.requestToken("https://myapi.auth0.com/users", "org_123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "client_credentials")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - assertThat(body, hasEntry("organization", "org_123")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldCreateLogInWithClientCredentialsGrantRequestWithoutOrgWhenEmpty() throws Exception { - TokenRequest request = api.requestToken("https://myapi.auth0.com/users", " "); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "client_credentials")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("audience", "https://myapi.auth0.com/users")); - assertThat(body, not(hasKey("organization"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void clientCredentialsGrantRequestRequiresClientAuthentication() { - verifyThrows(IllegalStateException.class, - () -> apiNoClientAuthentication.requestToken("https://myapi.auth0.com/users"), - "A client secret or client assertion signing key is required for this operation"); - } - - // Login with Passwordless - - @Test - public void shouldCreateStartEmailPasswordlessFlowRequest() throws Exception { - Request request = api.startPasswordlessEmailFlow("user@domain.com", - PasswordlessEmailType.CODE); - assertThat(request, is(notNullValue())); - - emailPasswordlessRequest(request, true); - } - - @Test - public void shouldCreateStartEmailPasswordlessFlowRequestWithoutClientAuthentication() throws Exception { - Request request = apiNoClientAuthentication.startPasswordlessEmailFlow("user@domain.com", - PasswordlessEmailType.CODE); - assertThat(request, is(notNullValue())); - - emailPasswordlessRequest(request, false); - } - - private void emailPasswordlessRequest(Request request, boolean secretSent) throws Exception{ - server.jsonResponse(PASSWORDLESS_EMAIL_RESPONSE, 200); - PasswordlessEmailResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/passwordless/start")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("connection", "email")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("email", "user@domain.com")); - - assertThat(response, is(notNullValue())); - assertThat(response.getEmail(), not(emptyOrNullString())); - assertThat(response.getId(), not(emptyOrNullString())); - assertThat(response.isEmailVerified(), is(notNullValue())); - } - - @Test - public void startPasswordlessEmailFlowShouldThrowWhenEmailIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.startPasswordlessEmailFlow(null, PasswordlessEmailType.CODE), - "'email' cannot be null!"); - } - - @Test - public void startPasswordlessEmailFlowShouldThrowWhenTypeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.startPasswordlessEmailFlow("user@domain.com", null), - "'type' cannot be null!"); - } - - @Test - public void shouldCreateStartEmailPasswordlessFlowRequestWithCustomParams() throws Exception { - Map authParams = new HashMap<>(); - authParams.put("scope", "openid profile email"); - authParams.put("state", "abc123"); - - BaseRequest request = api.startPasswordlessEmailFlow("user@domain.com", PasswordlessEmailType.CODE) - .addParameter("authParams", authParams); - - // verify that connection parameter can be overridden for custom connection types - request.addParameter("connection", "custom-email"); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(PASSWORDLESS_EMAIL_RESPONSE, 200); - PasswordlessEmailResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/passwordless/start")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("connection", "custom-email")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("email", "user@domain.com")); - assertThat(body, hasKey("authParams")); - @SuppressWarnings("unchecked") - Map authParamsSent = (Map) body.get("authParams"); - assertThat(authParamsSent, hasEntry("scope", authParams.get("scope"))); - assertThat(authParamsSent, hasEntry("state", authParams.get("state"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getEmail(), not(emptyOrNullString())); - assertThat(response.getId(), not(emptyOrNullString())); - assertThat(response.isEmailVerified(), is(notNullValue())); - } - - @Test - public void shouldCreateStartSmsPasswordlessFlowRequest() throws Exception { - Request request = api.startPasswordlessSmsFlow("+16511234567"); - assertThat(request, is(notNullValue())); - - smsPasswordlessFlow(request, true); - } - - @Test - public void shouldCreateStartSmsPasswordlessFlowRequestWithoutClientAuthentication() throws Exception { - Request request = apiNoClientAuthentication.startPasswordlessSmsFlow("+16511234567"); - assertThat(request, is(notNullValue())); - - smsPasswordlessFlow(request, false); - } - - private void smsPasswordlessFlow(Request request, boolean secretSent) throws Exception { - server.jsonResponse(PASSWORDLESS_SMS_RESPONSE, 200); - PasswordlessSmsResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/passwordless/start")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("connection", "sms")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("phone_number", "+16511234567")); - - assertThat(response, is(notNullValue())); - assertThat(response.getPhoneNumber(), not(emptyOrNullString())); - assertThat(response.getId(), not(emptyOrNullString())); - assertThat(response.isPhoneVerified(), is(notNullValue())); - assertThat(response.getRequestLanguage(), is(nullValue())); - } - - @Test - public void shouldCreateStartSmsPasswordlessFlowRequestWithCustomConnection() throws Exception { - BaseRequest request = api.startPasswordlessSmsFlow("+16511234567"); - - // verify that connection parameter can be overridden for custom connection types - request.addParameter("connection", "custom-sms"); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(PASSWORDLESS_SMS_RESPONSE, 200); - PasswordlessSmsResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/passwordless/start")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("connection", "custom-sms")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("phone_number", "+16511234567")); - - assertThat(response, is(notNullValue())); - assertThat(response.getPhoneNumber(), not(emptyOrNullString())); - assertThat(response.getId(), not(emptyOrNullString())); - assertThat(response.isPhoneVerified(), is(notNullValue())); - assertThat(response.getRequestLanguage(), is(nullValue())); - } - - @Test - public void startPasswordlessSmsFlowShouldThrowWhenPhoneIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.startPasswordlessSmsFlow(null), - "'phoneNumber' cannot be null!"); - } - - @Test - public void shouldCreateLoginWithPasswordlessCodeRequest() throws Exception { - TokenRequest request = api.exchangePasswordlessOtp("+16511234567", "email", "otp".toCharArray()); - assertThat(request, is(notNullValue())); - - passwordlessCodeRequest(request, true); - } - - @Test - public void shouldCreateLoginWithPasswordlessCodeRequestWithoutClientAuthentication() throws Exception { - TokenRequest request = apiNoClientAuthentication.exchangePasswordlessOtp("+16511234567", "email", "otp".toCharArray()); - assertThat(request, is(notNullValue())); - - passwordlessCodeRequest(request, false); - } - - private void passwordlessCodeRequest(TokenRequest request, boolean secretSent) throws Exception { - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("realm", "email")); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/passwordless/otp")); - assertThat(body, hasEntry("otp", "otp")); - - assertThat(response, is(notNullValue())); - assertThat(response.getScope(), is(nullValue())); - assertThat(response.getAccessToken(), is(notNullValue())); - assertThat(response.getExpiresIn(), is(notNullValue())); - assertThat(response.getIdToken(), is(notNullValue())); - assertThat(response.getTokenType(), is(notNullValue())); - } - - //Revoke a Token - - @Test - public void shouldThrowOnRevokeTokenWithNullToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.revokeToken(null), - "'refresh token' cannot be null!"); - } - - @Test - public void shouldCreateRevokeTokenRequest() throws Exception { - Request request = api.revokeToken("2679NfkaBn62e6w5E8zNEzjr"); - assertThat(request, is(notNullValue())); - - revokeTokenRequest(request, true); - } - - @Test - public void shouldCreateRevokeTokenRequestWithoutClientAuthentication() throws Exception { - Request request = apiNoClientAuthentication.revokeToken("2679NfkaBn62e6w5E8zNEzjr"); - assertThat(request, is(notNullValue())); - - revokeTokenRequest(request, false); - } - - private void revokeTokenRequest( Request request, boolean secretSent) throws Exception { - server.emptyResponse(200); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/revoke")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("token", "2679NfkaBn62e6w5E8zNEzjr")); - - assertThat(response, is(nullValue())); - } - - - //Renew Authentication using Refresh Token - - @Test - public void shouldThrowOnRenewAuthWithNullRefreshToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.renewAuth(null), - "'refresh token' cannot be null!"); - } - - @Test - public void shouldCreateRenewTokenRequest() throws Exception { - TokenRequest request = api.renewAuth("ej2E8zNEzjrcSD2edjaE"); - assertThat(request, is(notNullValue())); - - renewTokenRequest(request, true); - } - - @Test - public void shouldCreateRenewTokenRequestWithoutClientAuthentication() throws Exception { - TokenRequest request = apiNoClientAuthentication.renewAuth("ej2E8zNEzjrcSD2edjaE"); - assertThat(request, is(notNullValue())); - - renewTokenRequest(request, false); - } - - private void renewTokenRequest(TokenRequest request, boolean secretSent) throws Exception { - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "refresh_token")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("clieht_secret"))); - } - assertThat(body, hasEntry("refresh_token", "ej2E8zNEzjrcSD2edjaE")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - // PKCE - - @Test - public void shouldCreateLogInWithAuthorizationCodeGrantWithPKCERequest() throws Exception { - TokenRequest request = api.exchangeCodeWithVerifier("code123", "verifier", "https://domain.auth0.com/callback"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("code", "code123")); - assertThat(body, hasEntry("code_verifier", "verifier")); - assertThat(body, hasEntry("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(body, hasEntry("grant_type", "authorization_code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldThrowWhenVerifierNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeCodeWithVerifier("code", null,"https://domain.auth0.com/callback"), - "'verifier' cannot be null!"); - } - - // MFA - - @Test - public void shouldThrowWhenExchangeMfaOtpCalledWithNullMfaToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaOtp(null, new char[]{'o','t','p'}), - "'mfa token' cannot be null!"); - } - - @Test - public void shouldThrowWhenExchangeMfaOtpCalledWithNullOtp() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaOtp("mfaToken", null), - "'otp' cannot be null!"); - } - - @Test - public void shouldCreateExchangeMfaOtpRequest() throws Exception { - TokenRequest request = api.exchangeMfaOtp("mfaToken", new char[]{'o','t','p'}); - assertThat(request, is(notNullValue())); - - mfaOtpRequest(request, true); - } - - @Test - public void shouldCreateExchangeMfaOtpRequestWithoutClientAuthentication() throws Exception { - TokenRequest request = apiNoClientAuthentication.exchangeMfaOtp("mfaToken", new char[]{'o','t','p'}); - assertThat(request, is(notNullValue())); - - mfaOtpRequest(request, false); - } - - private void mfaOtpRequest(TokenRequest request, boolean secretSent) throws Exception { - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/mfa-otp")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("mfa_token", "mfaToken")); - assertThat(body, hasEntry("otp", "otp")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldThrowWhenExchangeMfaOobCalledWithNullMfaToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaOob(null, new char[]{'o','t','p'}, null), - "'mfa token' cannot be null!"); - } - - @Test - public void shouldThrowWhenExchangeMfaOobCalledWithNullOoob() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaOob("mfaToken", null, null), - "'OOB code' cannot be null!"); - } - - @Test - public void shouldCreateExchangeMfaOobRequest() throws Exception { - TokenRequest request = api.exchangeMfaOob("mfaToken", new char[]{'o','o','b'}, null); - assertThat(request, is(notNullValue())); - - mfaOobExchangeRequest(request, null, true); - } - - @Test - public void shouldCreateExchangeMfaOobRequestWithoutSecret() throws Exception { - TokenRequest request = apiNoClientAuthentication.exchangeMfaOob("mfaToken", new char[]{'o','o','b'}, new char[]{'b','o','b'}); - assertThat(request, is(notNullValue())); - - mfaOobExchangeRequest(request, "bob", false); - } - - private void mfaOobExchangeRequest(TokenRequest request, String bindingCode, boolean secretSent) throws Exception { - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/mfa-oob")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - - if (bindingCode != null) { - assertThat(body, hasEntry("binding_code", bindingCode)); - } else { - assertThat(body, not(hasKey("binding_code"))); - } - - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("mfa_token", "mfaToken")); - assertThat(body, hasEntry("oob_code", "oob")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldThrowWhenExchangeMfaRecoveryCodeCalledWithNullMfaToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaRecoveryCode(null, new char[]{'c','o','d','e'}), - "'mfa token' cannot be null!"); - } - - @Test - public void shouldThrowWhenExchangeMfaRecoveryCodeCalledWithNullCode() { - verifyThrows(IllegalArgumentException.class, - () -> api.exchangeMfaRecoveryCode("mfaToken", null), - "'recovery code' cannot be null!"); - } - - @Test - public void shouldCreateExchangeMfaRecoveryCodeRequest() throws Exception { - TokenRequest request = api.exchangeMfaRecoveryCode("mfaToken", new char[]{'c','o','d','e'}); - assertThat(request, is(notNullValue())); - - mfaRecoveryCodeExchangeRequest(request, true); - } - - @Test - public void shouldCreateExchangeMfaRecoveryCodeRequestWithoutSecret() throws Exception { - TokenRequest request = apiNoClientAuthentication.exchangeMfaRecoveryCode("mfaToken", new char[]{'c','o','d','e'}); - assertThat(request, is(notNullValue())); - - mfaRecoveryCodeExchangeRequest(request, false); - } - - private void mfaRecoveryCodeExchangeRequest(TokenRequest request, boolean secretSent) throws Exception { - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("grant_type", "http://auth0.com/oauth/grant-type/mfa-recovery-code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - - if (secretSent) { - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - } else { - assertThat(body, not(hasKey("client_secret"))); - } - assertThat(body, hasEntry("mfa_token", "mfaToken")); - assertThat(body, hasEntry("recovery_code", "code")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void addOtpAuthenticatorThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOtpAuthenticator(null), - "'mfa token' cannot be null!"); - } - - @Test - public void addOtpAuthenticatorRequest() throws Exception { - Request request = api.addOtpAuthenticator("mfaToken"); - - server.jsonResponse(AUTH_OTP_AUTHENTICATOR_RESPONSE, 200); - CreatedOtpResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("otp"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getSecret(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator(null, Collections.singletonList("auth0"), null), - "'mfa token' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedThrowsWhenChannelsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", null, null), - "'OOB channels' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedThrowsWhenPhoneNumberNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", Collections.singletonList("sms"), null), - "'phone number' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedThrowsWhenPhoneNumberNullVoiceChannel() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", Collections.singletonList("voice"), null), - "'phone number' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedRequest() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("sms"), "phone-number"); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("sms"))); - assertThat(body, hasEntry("phone_number", "phone-number")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @SuppressWarnings("deprecation") - @Test - public void addOobAuthenticatorDeprecatedRequestWithNoPhoneNumber() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("auth0"), null); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("auth0"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void addOobAuthenticatorThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator(null, Collections.singletonList("auth0"), null, null), - "'mfa token' cannot be null!"); - } - - - @Test - public void addOobAuthenticatorThrowsWhenChannelsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", null, null, null), - "'OOB channels' cannot be null!"); - } - - @Test - public void addOobAuthenticatorThrowsWhenChannelsNullWithPhoneNumber() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", null, "phone-number", null), - "'OOB channels' cannot be null!"); - } - - @Test - public void addOobAuthenticatorThrowsWhenChannelsNullWithEmail() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", null, null, "email-address"), - "'OOB channels' cannot be null!"); - } - - @Test - public void addOobAuthenticatorThrowsWhenPhoneNumberNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", Collections.singletonList("sms"), null, null), - "'phone number' cannot be null!"); - } - - @Test - public void addOobAuthenticatorThrowsWhenPhoneNumberNullWithVoiceChannel() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", Collections.singletonList("voice"), null, null), - "'phone number' cannot be null!"); - } - - @Test - public void addOobAuthenticatorThrowsWhenEmailNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.addOobAuthenticator("mfaToken", Collections.singletonList("email"), null, null), - "'email address' cannot be null!"); - } - - @Test - public void addOobAuthenticatorRequestWithPhoneNumber() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("sms"), "phone-number", null); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("sms"))); - assertThat(body, hasEntry("phone_number", "phone-number")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void addOobAuthenticatorRequestWithEmail() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("email"), null, "email-address"); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("email"))); - assertThat(body, hasEntry("email", "email-address")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void addOobAuthenticatorRequestWithNoContactInfo() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("auth0"), null, null); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("auth0"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void addOobAuthenticatorRequestWithMultipleChannels() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Arrays.asList("sms", "email", "auth0"), "phone-number", "email-address"); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Arrays.asList("sms", "email", "auth0"))); - assertThat(body, hasEntry("phone_number", "phone-number")); - assertThat(body, hasEntry("email", "email-address")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void addOobAuthenticatorRequestWithAuth0Channel() throws Exception { - Request request = api.addOobAuthenticator("mfaToken", Collections.singletonList("auth0"), null, "email-address"); - - server.jsonResponse(AUTH_OOB_AUTHENTICATOR_RESPONSE, 200); - CreatedOobResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/associate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("authenticator_types", Collections.singletonList("oob"))); - assertThat(body, hasEntry("oob_channels", Collections.singletonList("auth0"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthenticatorType(), not(emptyOrNullString())); - assertThat(response.getOobChannel(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - assertThat(response.getBarcodeUri(), not(emptyOrNullString())); - assertThat(response.getRecoveryCodes(), notNullValue()); - } - - @Test - public void listAuthenticatorsThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.listAuthenticators(null), - "'access token' cannot be null!"); - } - - @Test - public void listAuthenticatorsRequest() throws Exception { - Request> request = api.listAuthenticators("token"); - - server.jsonResponse(AUTH_LIST_AUTHENTICATORS_RESPONSE, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/mfa/authenticators")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer token")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void deleteAuthenticatorThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.deleteAuthenticator(null, "authenticatorId"), - "'access token' cannot be null!"); - } - - @Test - public void deleteAuthenticatorThrowsWhenAuthenticatorIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.deleteAuthenticator("Bearer accessToken", null), - "'authenticator id' cannot be null!"); - } - - @Test - public void deleteAuthenticatorRequest() throws Exception { - Request request = api.deleteAuthenticator("accessToken", "authenticatorId"); - - server.jsonResponse(AUTH_LIST_AUTHENTICATORS_RESPONSE, 200); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/mfa/authenticators/authenticatorId")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer accessToken")); - - assertThat(response, is(nullValue())); - } - - @Test - public void challengeRequestThrowsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.mfaChallengeRequest(null, "otp", "authenticatorId"), - "'mfa token' cannot be null!"); - } - - @Test - public void challengeRequest() throws Exception { - Request request = api.mfaChallengeRequest("mfaToken", "otp", "authenticatorId"); - - server.jsonResponse(AUTH_CHALLENGE_RESPONSE, 200); - MfaChallengeResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/mfa/challenge")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("mfa_token", "mfaToken")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); - assertThat(body, hasEntry("challenge_type", "otp")); - assertThat(body, hasEntry("authenticator_id", "authenticatorId")); - - assertThat(response, is(notNullValue())); - assertThat(response.getChallengeType(), not(emptyOrNullString())); - assertThat(response.getBindingMethod(), not(emptyOrNullString())); - assertThat(response.getOobCode(), not(emptyOrNullString())); - } - - // Client Assertion tests - @Test - public void shouldAddAndPreferClientAuthentication() throws Exception { - AuthAPI authAPI = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID, CLIENT_SECRET) - .withClientAssertionSigner(new TestAssertionSigner("token")) - .build(); - TokenRequest request = authAPI.exchangeCode("code123", "https://domain.auth0.com/callback"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("code", "code123")); - assertThat(body, hasEntry("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(body, hasEntry("grant_type", "authorization_code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, not(hasEntry("client_secret", CLIENT_SECRET))); - assertThat(body, hasEntry("client_assertion", "token")); - assertThat(body, hasEntry("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldNotAddAnyParamsIfNoSecretOrAssertion() throws Exception { - AuthAPI authAPI = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID).build(); - TokenRequest request = authAPI.exchangeCodeWithVerifier("code123", "verifier", "https://domain.auth0.com/callback"); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("code", "code123")); - assertThat(body, hasEntry("code_verifier", "verifier")); - assertThat(body, hasEntry("redirect_uri", "https://domain.auth0.com/callback")); - assertThat(body, hasEntry("grant_type", "authorization_code")); - assertThat(body, hasEntry("client_id", CLIENT_ID)); - assertThat(body, not(hasEntry("client_secret", CLIENT_SECRET))); - assertThat(body, not(hasEntry("client_assertion", "token"))); - assertThat(body, not(hasEntry("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void authorizeUrlWithPARShouldThrowWhenRequestUriNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeUrlWithPAR(null), - "'request uri' cannot be null!"); - } - - @Test - public void shouldBuildAuthorizeUrlWithPAR() { - AuthAPI api = AuthAPI.newBuilder("domain.auth0.com", CLIENT_ID, CLIENT_SECRET).build(); - String url = api.authorizeUrlWithPAR("urn:example:bwc4JK-ESC0w8acc191e-Y1LTC2"); - assertThat(url, is(notNullValue())); - assertThat(url, isUrl("https", "domain.auth0.com", "/authorize")); - - assertThat(url, hasQueryParameter("request_uri", "urn:example:bwc4JK-ESC0w8acc191e-Y1LTC2")); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - } - - @Test - public void pushedAuthorizationRequestShouldThrowWhenRedirectUriIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.pushedAuthorizationRequest(null, "code", Collections.emptyMap()), - "'redirect uri' must be a valid URL!"); - } - - @Test - public void pushedAuthorizationRequestShouldThrowWhenResponseTypeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.pushedAuthorizationRequest("https://domain.com/callback", null, Collections.emptyMap()), - "'response type' cannot be null!"); - } - - @Test - public void shouldCreatePushedAuthorizationRequestWithNullAdditionalParams() throws Exception { - Request request = api.pushedAuthorizationRequest("https://domain.com/callback", "code", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("redirect_uri=" + "https%3A%2F%2Fdomain.com%2Fcallback")); - assertThat(body, containsString("response_type=" + "code")); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - public void shouldCreatePushedAuthorizationRequestWithAdditionalParams() throws Exception { - Map additionalParams = new HashMap<>(); - additionalParams.put("audience", "aud"); - additionalParams.put("connection", "conn"); - Request request = api.pushedAuthorizationRequest("https://domain.com/callback", "code", additionalParams); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("redirect_uri=" + "https%3A%2F%2Fdomain.com%2Fcallback")); - assertThat(body, containsString("response_type=" + "code")); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - assertThat(body, containsString("audience=" + "aud")); - assertThat(body, containsString("connection=" + "conn")); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - @SuppressWarnings("unchecked") - public void shouldCreatePushedAuthorizationRequestWithAuthDetails() throws Exception { - Map authorizationDetails = new HashMap<>(); - authorizationDetails.put("type", "account information"); - authorizationDetails.put("locations", Collections.singletonList("https://example.com/customers")); - authorizationDetails.put("actions", Arrays.asList("read", "write")); - List> authDetailsList = Collections.singletonList(authorizationDetails); - - Request request = api.pushedAuthorizationRequest("https://domain.com/callback", "code", null, authDetailsList); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("redirect_uri=" + "https%3A%2F%2Fdomain.com%2Fcallback")); - assertThat(body, containsString("response_type=" + "code")); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - - String authDetailsParam = getQueryMap(body).get("authorization_details"); - String decodedAuthDetails = URLDecoder.decode(authDetailsParam, StandardCharsets.UTF_8.name()); - TypeReference>> typeReference = new TypeReference>>() { - }; - List> deserialized = ObjectMapperProvider.getMapper().readValue(decodedAuthDetails, typeReference); - assertThat(deserialized, notNullValue()); - assertThat(deserialized, hasSize(1)); - assertThat(deserialized.get(0).get("type"), is("account information")); - - List locations = (List) deserialized.get(0).get("locations"); - List actions = (List) deserialized.get(0).get("actions"); - - assertThat(locations, hasSize(1)); - assertThat(locations.get(0), is("https://example.com/customers")); - assertThat(actions, hasSize(2)); - assertThat(actions, contains("read", "write")); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - public void shouldThrowWhenCreatePushedAuthorizationRequestWithInvalidAuthDetails() { - // force Jackson to throw error on serialization - // see https://stackoverflow.com/questions/26716020/how-to-get-a-jsonprocessingexception-using-jackson - @SuppressWarnings("unchecked") - List> mockList = mock(List.class); - when(mockList.toString()).thenReturn(mockList.getClass().getName()); - - IllegalArgumentException e = verifyThrows(IllegalArgumentException.class, - () -> api.pushedAuthorizationRequest("https://domain.com/callback", "code", null, mockList)); - - assertThat(e.getMessage(), is("'authorizationDetails' must be a list that can be serialized to JSON")); - assertThat(e.getCause(), instanceOf(JsonProcessingException.class)); - } - - @Test - public void shouldCreatePushedAuthorizationRequestWithoutSecret() throws Exception { - AuthAPI api = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID).build(); - Request request = api.pushedAuthorizationRequest("https://domain.com/callback", "code", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("redirect_uri=" + "https%3A%2F%2Fdomain.com%2Fcallback")); - assertThat(body, containsString("response_type=" + "code")); - assertThat(body, not(containsString("client_secret"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - public void authorizeUrlWithJARShouldThrowWhenRequestNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeUrlWithJAR(null), - "'request' cannot be null!"); - } - - @Test - public void shouldBuildAuthorizeUrlWithJAR() { - String requestJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"; - AuthAPI api = AuthAPI.newBuilder("domain.auth0.com", CLIENT_ID, CLIENT_SECRET).build(); - String url = api.authorizeUrlWithJAR("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"); - assertThat(url, is(notNullValue())); - assertThat(url, isUrl("https", "domain.auth0.com", "/authorize")); - - assertThat(url, hasQueryParameter("request", requestJwt)); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - } - - @Test - public void pushedAuthorizationRequestShouldThrowWhenRequestIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.pushedAuthorizationRequestWithJAR(null), - "'request' cannot be null!"); - } - - @Test - public void shouldCreatePushedAuthorizationJarRequest() throws Exception { - String requestJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"; - Request request = api.pushedAuthorizationRequestWithJAR(requestJwt); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("request=" + requestJwt)); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - public void shouldCreatePushedAuthorizationJarRequestWithoutSecret() throws Exception { - String requestJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"; - AuthAPI api = AuthAPI.newBuilder(server.getBaseUrl(), CLIENT_ID).build(); - Request request = api.pushedAuthorizationRequestWithJAR(requestJwt); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("request=" + requestJwt)); - assertThat(body, not(containsString("client_secret"))); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - @SuppressWarnings("unchecked") - public void shouldCreatePushedAuthorizationJarRequestWithoutAuthDetails() throws Exception { - String requestJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"; - Map authorizationDetails = new HashMap<>(); - authorizationDetails.put("type", "account information"); - authorizationDetails.put("locations", Collections.singletonList("https://example.com/customers")); - authorizationDetails.put("actions", Arrays.asList("read", "write")); - List> authDetailsList = Collections.singletonList(authorizationDetails); - - Request request = api.pushedAuthorizationRequestWithJAR(requestJwt, authDetailsList); - assertThat(request, is(notNullValue())); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - PushedAuthorizationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/par")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = readFromRequest(recordedRequest); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("request=" + requestJwt)); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - - String authDetailsParam = getQueryMap(body).get("authorization_details"); - String decodedAuthDetails = URLDecoder.decode(authDetailsParam, StandardCharsets.UTF_8.name()); - TypeReference>> typeReference = new TypeReference>>() { - }; - List> deserialized = ObjectMapperProvider.getMapper().readValue(decodedAuthDetails, typeReference); - assertThat(deserialized, notNullValue()); - assertThat(deserialized, hasSize(1)); - assertThat(deserialized.get(0).get("type"), is("account information")); - - List locations = (List) deserialized.get(0).get("locations"); - List actions = (List) deserialized.get(0).get("actions"); - - assertThat(locations, hasSize(1)); - assertThat(locations.get(0), is("https://example.com/customers")); - assertThat(actions, hasSize(2)); - assertThat(actions, contains("read", "write")); - - assertThat(response, is(notNullValue())); - assertThat(response.getRequestURI(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - } - - @Test - @SuppressWarnings("unchecked") - public void shouldThrowWhenCreatePushedAuthorizationJarRequestWithInvalidAuthDetails() { - String requestJwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxMjM0NTYiLCJyZWRpcmVjdF91cmkiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsIm5vbmNlIjoiMTIzNCIsInN0YXRlIjoiNzhkeXVma2poZGYifQ.UQDz8hBIabaqatY75BvqGyiPoOqNYJQIsimUKg4_VrU"; - // force Jackson to throw error on serialization - // see https://stackoverflow.com/questions/26716020/how-to-get-a-jsonprocessingexception-using-jackson - List mockList = mock(List.class); - when(mockList.toString()).thenReturn(mockList.getClass().getName()); - - IllegalArgumentException e = verifyThrows(IllegalArgumentException.class, - () -> api.pushedAuthorizationRequestWithJAR(requestJwt, mockList)); - - assertThat(e.getMessage(), is("'authorizationDetails' must be a list that can be serialized to JSON")); - assertThat(e.getCause(), instanceOf(JsonProcessingException.class)); - } - - @Test - public void authorizeBackChannelWhenScopeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeBackChannel(null, "This is binding message", getLoginHint()), - "'scope' cannot be null!"); - } - - @Test - public void authorizeBackChannelWhenBindingMessageIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeBackChannel("openid", null, getLoginHint()), - "'binding message' cannot be null!"); - } - - @Test - public void authorizeBackChannelWhenLoginHintIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.authorizeBackChannel("openid", "This is binding message", null), - "'login hint' cannot be null!"); - } - - @Test - public void authorizeBackChannel() throws Exception { - Request request = api.authorizeBackChannel("openid", "This is binding message", getLoginHint()); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BACK_CHANNEL_AUTHORIZE_RESPONSE, 200); - BackChannelAuthorizeResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/bc-authorize")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = URLDecoder.decode(readFromRequest(recordedRequest), StandardCharsets.UTF_8.name()); - assertThat(body, containsString("scope=" + "openid")); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - assertThat(body, containsString("binding_message=This is binding message")); - assertThat(body, containsString("login_hint={\"sub\":\"auth0|user1\",\"format\":\"format1\",\"iss\":\"https://auth0.com\"}")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthReqId(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - assertThat(response.getInterval(), notNullValue()); - } - - @Test - public void authorizeBackChannelWithAudienceAndRequestedExpiry() throws Exception { - Request request = api.authorizeBackChannel("openid", "This is binding message", getLoginHint(), "https://api.example.com", 300); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BACK_CHANNEL_AUTHORIZE_RESPONSE, 200); - BackChannelAuthorizeResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/bc-authorize")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = URLDecoder.decode(readFromRequest(recordedRequest), StandardCharsets.UTF_8.name()); - assertThat(body, containsString("scope=" + "openid")); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - assertThat(body, containsString("binding_message=This is binding message")); - assertThat(body, containsString("login_hint={\"sub\":\"auth0|user1\",\"format\":\"format1\",\"iss\":\"https://auth0.com\"}")); - assertThat(body, containsString("requested_expiry=" + 300)); - assertThat(body, containsString("audience=" + "https://api.example.com")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAuthReqId(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - assertThat(response.getInterval(), notNullValue()); - } - - private Map getLoginHint() { - Map loginHint = new HashMap<>(); - loginHint.put("format", "format1"); - loginHint.put("iss", "https://auth0.com"); - loginHint.put("sub", "auth0|user1"); - return loginHint; - } - - @Test - public void getBackChannelLoginStatusWhenAuthReqIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.getBackChannelLoginStatus(null, "ciba"), - "'auth req id' cannot be null!"); - } - - @Test - public void getBackChannelLoginStatusWhenGrantTypeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.getBackChannelLoginStatus("red_id_1", null), - "'grant type' cannot be null!"); - } - - @Test - public void getBackChannelLoginStatus() throws Exception { - Request request = api.getBackChannelLoginStatus("red_id_1", "ciba"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BACK_CHANNEL_LOGIN_STATUS_RESPONSE, 200); - BackChannelTokenResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/oauth/token")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/x-www-form-urlencoded")); - - String body = URLDecoder.decode(readFromRequest(recordedRequest), StandardCharsets.UTF_8.name()); - assertThat(body, containsString("client_id=" + CLIENT_ID)); - assertThat(body, containsString("client_secret=" + CLIENT_SECRET)); - assertThat(body, containsString("auth_req_id=red_id_1")); - assertThat(body, containsString("grant_type=ciba")); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), notNullValue()); - assertThat(response.getScope(), not(emptyOrNullString())); - } - - - private Map getQueryMap(String input) { - String[] params = input.split("&"); - - return Arrays.stream(params) - .map(param -> param.split("=")) - .collect(Collectors.toMap(p -> p[0], p -> p[1])); - } - - static class TestAssertionSigner implements ClientAssertionSigner { - - private final String token; - - public TestAssertionSigner(String token) { - this.token = token; - } - - @Override - public String createSignedClientAssertion(String issuer, String audience, String subject) { - return token; - } - } -} diff --git a/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java b/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java deleted file mode 100644 index 966d54572..000000000 --- a/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.auth0.client.auth; - -import okhttp3.HttpUrl; -import org.junit.jupiter.api.Test; - -import java.net.URLEncoder; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.UrlMatcher.*; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.notNullValue; - -public class AuthorizeUrlBuilderTest { - - private static final HttpUrl DOMAIN = HttpUrl.parse("https://domain.auth0.com"); - private static final String CLIENT_ID = "clientId"; - private static final String REDIRECT_URI = "https://domain.auth0.com/callback"; - - @Test - public void shouldThrowWhenBaseUrlIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(null, CLIENT_ID, REDIRECT_URI), - "'base url' cannot be null!"); - } - - @Test - public void shouldThrowWhenRedirectUriIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, null), - "'redirect uri' cannot be null!"); - } - - @Test - public void shouldThrowWhenClientIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, null, REDIRECT_URI), - "'client id' cannot be null!"); - } - - @Test - public void shouldGetNewInstance() { - AuthorizeUrlBuilder instance = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI); - assertThat(instance, is(notNullValue())); - } - - @Test - public void shouldBuildValidAuthorizeUrlWithHttp() { - HttpUrl httpBaseUrl = HttpUrl.parse("http://domain.auth0.com"); - String url = AuthorizeUrlBuilder.newInstance(httpBaseUrl, CLIENT_ID, REDIRECT_URI).build(); - assertThat(url, isUrl("http", "domain.auth0.com", "/authorize")); - } - - @Test - public void shouldBuildValidAuthorizeUrlWithHttps() { - HttpUrl httpsBaseUrl = HttpUrl.parse("https://domain.auth0.com"); - String url = AuthorizeUrlBuilder.newInstance(httpsBaseUrl, CLIENT_ID, REDIRECT_URI).build(); - assertThat(url, isUrl("https", "domain.auth0.com", "/authorize")); - } - - @Test - public void shouldAddResponseTypeCode() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); - assertThat(url, hasQueryParameter("response_type", "code")); - } - - @Test - public void shouldAddClientId() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - - } - - @Test - public void shouldAddRedirectUri() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); - assertThat(url, hasQueryParameter("redirect_uri", REDIRECT_URI)); - } - - @Test - public void shouldNotEncodeTwiceTheRedirectUri() throws Exception { - String encodedUrl = URLEncoder.encode("https://www.google.com/?src=her&q=ans", "UTF-8"); - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, encodedUrl).build(); - assertThat(url, encodedQueryContains("redirect_uri=" + encodedUrl)); - } - - @Test - public void shouldSetConnection() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withConnection("my-connection") - .build(); - assertThat(url, hasQueryParameter("connection", "my-connection")); - } - - @Test - public void shouldThrowWhenConnectionIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withConnection(null), - "'connection' cannot be null!"); - } - - @Test - public void shouldSetAudience() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withAudience("https://myapi.domain.com/users") - .build(); - assertThat(url, hasQueryParameter("audience", "https://myapi.domain.com/users")); - } - - @Test - public void shouldThrowWhenAudienceIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withAudience(null), - "'audience' cannot be null!"); - } - - @Test - public void shouldSetState() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withState("1234567890") - .build(); - assertThat(url, hasQueryParameter("state", "1234567890")); - } - - @Test - public void shouldThrowWhenStateIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withState(null), - "'state' cannot be null!"); - } - - @Test - public void shouldSetScope() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withScope("profile email contacts") - .build(); - assertThat(url, hasQueryParameter("scope", "profile email contacts")); - } - - @Test - public void shouldThrowWhenScopeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withScope(null), - "'scope' cannot be null!"); - } - - @Test - public void shouldSetResponseType() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withResponseType("token id_token") - .build(); - assertThat(url, hasQueryParameter("response_type", "token id_token")); - } - - @Test - public void shouldThrowWhenResponseTypeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withResponseType(null), - "'response type' cannot be null!"); - } - - @Test - public void shouldSetCustomParameter() { - String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withParameter("name", "value") - .build(); - assertThat(url, hasQueryParameter("name", "value")); - } - - @Test - public void shouldThrowWhenCustomParameterNameIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withParameter(null, "value"), - "'name' cannot be null!"); - } - - @Test - public void shouldThrowWhenCustomParameterValueIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withParameter("name", null), - "'value' cannot be null!"); - } - - @Test - public void shouldAddOrganizationParameter() { - String authUrl = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withOrganization("org_abc") - .build(); - assertThat(authUrl, hasQueryParameter("organization", "org_abc")); - } - - @Test - public void shouldThrowWhenOrganizationIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withOrganization(null) - .build(), - "'organization' cannot be null!"); - } - - @Test - public void shouldAddInvitationParameter() { - String authUrl = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withInvitation("invitation_123") - .build(); - assertThat(authUrl, hasQueryParameter("invitation", "invitation_123")); - } - - @Test - public void shouldThrowWhenInvitationIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withInvitation(null) - .build(), - "'invitation' cannot be null!"); - } - - @Test - public void shouldAddCodeChallengeParameter() { - String authUrl = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withCodeChallenge("insecure_challenge") - .build(); - assertThat(authUrl, hasQueryParameter("code_challenge", "insecure_challenge")); - assertThat(authUrl, hasQueryParameter("code_challenge_method", "S256")); - } - - @Test - public void shouldThrowWhenChallengeIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) - .withCodeChallenge(null) - .build(), - "'challenge' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java b/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java deleted file mode 100644 index 792d69eb9..000000000 --- a/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.auth0.client.auth; - -import okhttp3.HttpUrl; -import org.junit.jupiter.api.Test; - -import java.net.URLEncoder; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.UrlMatcher.*; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.notNullValue; - -public class LogoutUrlBuilderTest { - - private static final HttpUrl DOMAIN = HttpUrl.parse("https://domain.auth0.com"); - private static final String CLIENT_ID = "clientId"; - private static final String RETURN_TO_URL = "https://domain.auth0.com/callback"; - - @Test - public void shouldThrowWhenBaseUrlIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> LogoutUrlBuilder.newInstance(null, CLIENT_ID, RETURN_TO_URL, true), - "'base url' cannot be null!"); - } - - @Test - public void shouldThrowWhenReturnToURLIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, null, true), - "'return to url' cannot be null!"); - } - - @Test - public void shouldNotThrowWhenClientIdIsNull() { - LogoutUrlBuilder.newInstance(DOMAIN, null, RETURN_TO_URL, true); - } - - @Test - public void shouldGetNewInstance() { - LogoutUrlBuilder instance = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true); - assertThat(instance, is(notNullValue())); - } - - @Test - public void shouldBuildValidLogoutUrlWithHttp() { - HttpUrl httpBaseUrl = HttpUrl.parse("http://domain.auth0.com"); - String url = LogoutUrlBuilder.newInstance(httpBaseUrl, CLIENT_ID, RETURN_TO_URL, true).build(); - assertThat(url, isUrl("http", "domain.auth0.com", "/v2/logout")); - } - - @Test - public void shouldBuildValidLogoutUrlWithHttps() { - HttpUrl httpsBaseUrl = HttpUrl.parse("https://domain.auth0.com"); - String url = LogoutUrlBuilder.newInstance(httpsBaseUrl, CLIENT_ID, RETURN_TO_URL, true).build(); - assertThat(url, isUrl("https", "domain.auth0.com", "/v2/logout")); - } - - @Test - public void shouldAddReturnToURL() { - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true).build(); - assertThat(url, hasQueryParameter("returnTo", RETURN_TO_URL)); - } - - @Test - public void shouldNotEncodeTwiceTheReturnToURL() throws Exception { - String encodedUrl = URLEncoder.encode("https://www.google.com/?src=her&q=ans", "UTF-8"); - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, encodedUrl, true).build(); - assertThat(url, encodedQueryContains("returnTo=" + encodedUrl)); - } - - @Test - public void shouldNotAddClientId() { - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, false).build(); - assertThat(url, hasQueryParameter("client_id", null)); - } - - @Test - public void shouldAddClientId() { - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true).build(); - assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); - } - - @Test - public void shouldUseFederated() { - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true) - .useFederated(true) - .build(); - assertThat(url, hasQueryParameter("federated", "")); - } - - @Test - public void shouldNotUseFederated() { - String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true) - .useFederated(false) - .build(); - assertThat(url, hasQueryParameter("federated", null)); - } - -} diff --git a/src/test/java/com/auth0/client/auth/RSAClientAssertionSignerTest.java b/src/test/java/com/auth0/client/auth/RSAClientAssertionSignerTest.java deleted file mode 100644 index dfadc9e65..000000000 --- a/src/test/java/com/auth0/client/auth/RSAClientAssertionSignerTest.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.auth0.client.auth; - -import com.auth0.AssertsUtil; -import com.auth0.exception.ClientAssertionSigningException; -import com.auth0.jwt.JWT; -import com.auth0.jwt.JWTCreator; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.exceptions.JWTCreationException; -import com.auth0.jwt.interfaces.DecodedJWT; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.KeyFactory; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.EncodedKeySpec; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; -import java.util.Base64; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class RSAClientAssertionSignerTest { - - private static final String PRIVATE_KEY_FILE_RSA = "src/test/resources/auth/rsa_private_key.pem"; - private static final String PUBLIC_KEY_FILE_RSA = "src/test/resources/auth/rsa_public_key.pem"; - - @Test - public void defaultsToRS256() { - RSAPrivateKey privateKey = mock(RSAPrivateKey.class); - RSAClientAssertionSigner rsa = new RSAClientAssertionSigner(privateKey); - assertThat(rsa.getAssertionSigningAlgorithm(), is(RSAClientAssertionSigner.RSASigningAlgorithm.RSA256)); - } - - @Test - public void throwsOnNullSigningKey() { - AssertsUtil.verifyThrows(IllegalArgumentException.class, - () -> new RSAClientAssertionSigner(null), - "'assertion signing key' cannot be null!"); - } - - @Test - public void throwsOnNullSigningAlgorithm() { - RSAPrivateKey privateKey = mock(RSAPrivateKey.class); - verifyThrows(IllegalArgumentException.class, - () -> new RSAClientAssertionSigner(privateKey, null), - "'assertion signing algorithm' cannot be null!"); - } - - @Test - public void throwsWhenErrorSigning256() { - JWTCreator.Builder mockBuilder = mock(JWTCreator.Builder.class); - RSAPrivateKey mockPrivateKey = mock(RSAPrivateKey.class); - - when(mockBuilder.sign(Algorithm.RSA256(null,mockPrivateKey))).thenThrow(JWTCreationException.class); - - ClientAssertionSigningException e = verifyThrows(ClientAssertionSigningException.class, - () -> new RSAClientAssertionSigner(mockPrivateKey).createSignedClientAssertion("iss", "aud", "sub"), - "Error creating the JWT used for client assertion using the RSA256 signing algorithm"); - - assertThat(e.getCause(), is(instanceOf(JWTCreationException.class))); - } - - @Test - public void throwsWhenErrorSigning384() { - JWTCreator.Builder mockBuilder = mock(JWTCreator.Builder.class); - RSAPrivateKey mockPrivateKey = mock(RSAPrivateKey.class); - - when(mockBuilder.sign(Algorithm.RSA384(null,mockPrivateKey))).thenThrow(JWTCreationException.class); - - ClientAssertionSigningException e = verifyThrows(ClientAssertionSigningException.class, - () -> new RSAClientAssertionSigner(mockPrivateKey, RSAClientAssertionSigner.RSASigningAlgorithm.RSA384).createSignedClientAssertion("iss", "aud", "sub"), - "Error creating the JWT used for client assertion using the RSA384 signing algorithm"); - - assertThat(e.getCause(), is(instanceOf(JWTCreationException.class))); - } - - @Test - public void createsVerifiedRSA256SigningAssertion() throws Exception { - KeyPair keyPair = getKeyPair(); - - RSAClientAssertionSigner clientAssertion = new RSAClientAssertionSigner((RSAPrivateKey) keyPair.getPrivate()); - String jwt = clientAssertion.createSignedClientAssertion("issuer", "audience", "subject"); - - DecodedJWT decodedJWT = JWT.require(Algorithm.RSA256((RSAPublicKey) keyPair.getPublic(), null)) - .build() - .verify(jwt); - - assertThat(decodedJWT.getSubject(), is("subject")); - assertThat(decodedJWT.getAudience(), hasItem("audience")); - assertThat(decodedJWT.getIssuer(), is("issuer")); - assertThat(decodedJWT.getExpiresAtAsInstant(), is(decodedJWT.getIssuedAtAsInstant().plusSeconds(180))); - assertThat(decodedJWT.getClaim("jti").asString(), is(notNullValue())); - - - System.out.println(decodedJWT); - } - - @Test - public void createsVerifiedRSA384SigningAssertion() throws Exception { - KeyPair keyPair = getKeyPair(); - - RSAClientAssertionSigner clientAssertion = new RSAClientAssertionSigner((RSAPrivateKey) keyPair.getPrivate(), RSAClientAssertionSigner.RSASigningAlgorithm.RSA384); - String jwt = clientAssertion.createSignedClientAssertion("issuer", "audience", "subject"); - - DecodedJWT decodedJWT = JWT.require(Algorithm.RSA384((RSAPublicKey) keyPair.getPublic(), null)) - .build() - .verify(jwt); - - assertThat(decodedJWT.getSubject(), is("subject")); - assertThat(decodedJWT.getAudience(), hasItem("audience")); - assertThat(decodedJWT.getIssuer(), is("issuer")); - assertThat(decodedJWT.getExpiresAtAsInstant(), is(decodedJWT.getIssuedAtAsInstant().plusSeconds(180))); - assertThat(decodedJWT.getClaim("jti").asString(), is(notNullValue())); - - - System.out.println(decodedJWT); - } - - private KeyPair getKeyPair() throws Exception { - URI fileUri = new File(PRIVATE_KEY_FILE_RSA).toURI(); - String privateKeyContent = new String(Files.readAllBytes(Paths.get(fileUri))); - privateKeyContent = privateKeyContent.replaceAll("\\n", "").replace("-----BEGIN PRIVATE KEY-----", "").replace("-----END PRIVATE KEY-----", ""); - - KeyFactory kf = KeyFactory.getInstance("RSA"); - - PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKeyContent)); - PrivateKey privateKey = kf.generatePrivate(keySpecPKCS8); - - URI publicKeyFileUri = new File(PUBLIC_KEY_FILE_RSA).toURI(); - String publicKeyContent = new String(Files.readAllBytes(Paths.get(publicKeyFileUri))); - publicKeyContent = publicKeyContent.replaceAll("\\n", "").replace("-----BEGIN PUBLIC KEY-----", "").replace("-----END PUBLIC KEY-----", ""); - - byte[] encodedPublicKey = Base64.getDecoder().decode(publicKeyContent); - - EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedPublicKey); - PublicKey publicKey = kf.generatePublic(keySpec); - - return new KeyPair(publicKey, privateKey); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ActionsEntityTest.java deleted file mode 100644 index 9554fdcae..000000000 --- a/src/test/java/com/auth0/client/mgmt/ActionsEntityTest.java +++ /dev/null @@ -1,535 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.filter.ActionsFilter; -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.json.mgmt.actions.*; -import com.auth0.net.Request; -import com.auth0.net.Response; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.*; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.bodyFromRequest; -import static com.auth0.client.MockServer.readFromRequest; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -@SuppressWarnings("unchecked") -public class ActionsEntityTest extends BaseMgmtEntityTest { - - @Test - public void getActionShouldThrowOnNullActionId() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().get(null), - "'action ID' cannot be null!"); - } - - @Test - public void shouldGetAction() throws Exception { - Request request = api.actions().get("action-id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION, 200); - Action response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions/action-id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void createActionShouldThrowOnNullAction() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().create(null), - "'action' cannot be null!"); - } - - @Test - public void shouldCreateAction() throws Exception { - Trigger trigger = new Trigger(); - trigger.setId("post-login"); - trigger.setVersion("v2"); - - Dependency dependency = new Dependency(); - dependency.setVersion("v2"); - dependency.setName("some-dep"); - dependency.setRegistryUrl("some-registry-url"); - - Secret secret = new Secret("secret-name", "secret-value"); - Action action = new Action("my action", Collections.singletonList(trigger)); - action.setCode("some code"); - action.setRuntime("node16"); - action.setDependencies(Collections.singletonList(dependency)); - action.setSecrets(Collections.singletonList(secret)); - - Request request = api.actions().create(action); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION, 200); - Response response = request.execute(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/actions/actions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(6)); - assertThat(body, hasEntry("name", "my action")); - assertThat(body, hasEntry("code", "some code")); - assertThat(body, hasEntry("runtime", "node16")); - - assertThat(body, hasEntry(is("supported_triggers"), is(notNullValue()))); - List> triggersOnRequest = (ArrayList>) body.get("supported_triggers"); - assertThat(triggersOnRequest, hasSize(1)); - assertThat(triggersOnRequest.get(0), is(aMapWithSize(2))); - assertThat(triggersOnRequest.get(0), hasEntry("version", trigger.getVersion())); - assertThat(triggersOnRequest.get(0), hasEntry("id", trigger.getId())); - - assertThat(body, hasEntry(is("dependencies"), is(notNullValue()))); - List> dependenciesOnRequest = (ArrayList>) body.get("dependencies"); - assertThat(dependenciesOnRequest, hasSize(1)); - assertThat(dependenciesOnRequest.get(0), is(aMapWithSize(3))); - assertThat(dependenciesOnRequest.get(0), hasEntry("version", dependency.getVersion())); - assertThat(dependenciesOnRequest.get(0), hasEntry("name", dependency.getName())); - assertThat(dependenciesOnRequest.get(0), hasEntry("registry_url", dependency.getRegistryUrl())); - - assertThat(body, hasEntry(is("secrets"), is(notNullValue()))); - List> secretsOnRequest = (ArrayList>) body.get("secrets"); - assertThat(secretsOnRequest, hasSize(1)); - assertThat(secretsOnRequest.get(0), is(aMapWithSize(2))); - assertThat(secretsOnRequest.get(0), hasEntry("name", secret.getName())); - assertThat(secretsOnRequest.get(0), hasEntry("value", secret.getValue())); - - assertThat(response, is(notNullValue())); - assertThat(response.getBody(), is(instanceOf(Action.class))); - assertThat(response.getStatusCode(), is(200)); - } - - @Test - public void deleteActionShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().delete(null), - "'action ID' cannot be null!"); - } - - @Test - public void shouldDeleteAction() throws Exception { - Request request = api.actions().delete("action-id"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/actions/actions/action-id")); - assertThat(recordedRequest, hasQueryParameter("force", "false")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldForceDeleteAction() throws Exception { - Request request = api.actions().delete("action-id", true); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/actions/actions/action-id")); - assertThat(recordedRequest, hasQueryParameter("force", "true")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldGetActionTriggers() throws Exception { - Request request = api.actions().getTriggers(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_TRIGGERS, 200); - Triggers triggers = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/triggers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(triggers, is(notNullValue())); - assertThat(triggers.getTriggers(), hasSize(12)); - } - - @Test - public void updateActionShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().update(null, new Action()), - "'action ID' cannot be null!"); - } - - @Test - public void updateActionShouldThrowWhenActionIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().update("action-id", null), - "'action' cannot be null!"); - } - - @Test - public void shouldUpdateAction() throws Exception { - Dependency dependency = new Dependency("lodash", "1.5.5"); - Secret secret = new Secret("secret-key", "secret-val"); - - Action action = new Action(); - action.setName("action name"); - action.setCode("some code"); - action.setRuntime("node16"); - action.setDependencies(Collections.singletonList(dependency)); - action.setSecrets(Collections.singletonList(secret)); - - Request request = api.actions().update("action-id", action); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION, 200); - Action response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/actions/actions/action-id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(5)); - assertThat(body, hasEntry("name", "action name")); - assertThat(body, hasEntry("code", "some code")); - assertThat(body, hasEntry("runtime", "node16")); - - assertThat(body, hasEntry(is("dependencies"), is(notNullValue()))); - List> dependenciesOnRequest = (ArrayList>) body.get("dependencies"); - assertThat(dependenciesOnRequest, hasSize(1)); - assertThat(dependenciesOnRequest.get(0), is(aMapWithSize(2))); - assertThat(dependenciesOnRequest.get(0), hasEntry("version", dependency.getVersion())); - assertThat(dependenciesOnRequest.get(0), hasEntry("name", dependency.getName())); - - assertThat(body, hasEntry(is("secrets"), is(notNullValue()))); - List> secretsOnRequest = (ArrayList>) body.get("secrets"); - assertThat(secretsOnRequest, hasSize(1)); - assertThat(secretsOnRequest.get(0), is(aMapWithSize(2))); - assertThat(secretsOnRequest.get(0), hasEntry("name", secret.getName())); - assertThat(secretsOnRequest.get(0), hasEntry("value", secret.getValue())); - - assertThat(response, is(notNullValue())); - } - - @Test - public void deployActionShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().deploy(null), - "'action ID' cannot be null!"); - } - - @Test - public void shouldDeployAction() throws Exception { - Request request = api.actions().deploy("action-id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_VERSION, 200); - Version response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/actions/actions/action-id/deploy")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest.getBody(), is(notNullValue())); - assertThat(recordedRequest.getBody().size(), is(0L)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void getVersionShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().getVersion(null, "version-id"), - "'action ID' cannot be null!"); - } - - @Test - public void getVersionShouldThrowWhenVersionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().getVersion("action-id", null), - "'action version ID' cannot be null!"); - } - - @Test - public void shouldGetActionVersion() throws Exception { - Request request = api.actions().getVersion("action-id", "version-id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_VERSION, 200); - Version response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions/action-id/versions/version-id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void rollBackToVersionShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().rollBackToVersion(null, "version-id"), - "'action ID' cannot be null!"); - } - - @Test - public void rollbackToVersionShouldThrowWhenVersionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().rollBackToVersion("action-id", null), - "'action version ID' cannot be null!"); - } - - @Test - public void shouldRollBackActionVersion() throws Exception { - Request request = api.actions().rollBackToVersion("action-id", "version-id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_VERSION, 200); - Version response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/actions/actions/action-id/versions/version-id/deploy")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest.getBody(), is(notNullValue())); - assertThat(readFromRequest(recordedRequest), is("{}")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void getExecutionShouldThrowWhenExecutionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().getExecution(null), - "'execution ID' cannot be null!"); - } - - @Test - public void shouldGetExecution() throws Exception { - Request request = api.actions().getExecution("execution-id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_EXECUTION, 200); - Execution response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/executions/execution-id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldListActionsWithNoFilter() throws Exception { - Request request = api.actions().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTIONS_LIST, 200); - ActionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldListActionsWithFilter() throws Exception { - ActionsFilter filter = new ActionsFilter() - .withActionName("action-name") - .withDeployed(true) - .withInstalled(false) - .withTriggerId("post-login") - .withPage(1, 10); - - Request request = api.actions().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTIONS_LIST, 200); - ActionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions")); - assertThat(recordedRequest, hasQueryParameter("actionName", "action-name")); - assertThat(recordedRequest, hasQueryParameter("deployed", "true")); - assertThat(recordedRequest, hasQueryParameter("installed", "false")); - assertThat(recordedRequest, hasQueryParameter("triggerId", "post-login")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "10")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void getActionVetsionsShouldThrowWhenActionIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().getVersions(null, null), - "'action ID' cannot be null!"); - } - - @Test - public void shouldGetActionVersionsWithNoFilter() throws Exception { - Request request = api.actions().getVersions("action-id",null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_VERSIONS_LIST, 200); - VersionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions/action-id/versions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetActionVersionsWithFilter() throws Exception { - PageFilter filter = new PageFilter() - .withPage(1, 10); - - Request request = api.actions().getVersions("action-id", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_VERSIONS_LIST, 200); - VersionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/actions/action-id/versions")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "10")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void getTriggerBindingsShouldThrowWhenTriggerIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().getTriggerBindings(null, null), - "'trigger ID' cannot be null!"); - } - - @Test - public void shouldGetTriggerBindingsWithNoFilter() throws Exception { - Request request = api.actions().getTriggerBindings("trigger-id",null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_TRIGGER_BINDINGS, 200); - BindingsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/triggers/trigger-id/bindings")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetTriggerBindingsWithFilter() throws Exception { - PageFilter filter = new PageFilter() - .withPage(1, 10); - - Request request = api.actions().getTriggerBindings("trigger-id",filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_TRIGGER_BINDINGS, 200); - BindingsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/actions/triggers/trigger-id/bindings")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "10")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void updateTriggerBindingsShouldThrowWhenTriggerIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().updateTriggerBindings(null, null), - "'trigger ID' cannot be null!"); - } - - @Test - public void updateTriggerBindingsShouldThrowWhenRequestBodyIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.actions().updateTriggerBindings("triggerId", null), - "'request body' cannot be null!"); - } - - @Test - public void shouldUpdateTriggerBinding() throws Exception { - BindingActionReference bindingReference1 = new BindingActionReference("action_name", "action name"); - BindingActionReference bindingReference2 = new BindingActionReference("action_id", "action-id"); - BindingUpdate update1 = new BindingUpdate(bindingReference1); - update1.setDisplayName("display name"); - BindingUpdate update2 = new BindingUpdate(bindingReference2); - update2.setDisplayName("another display name"); - - BindingsUpdateRequest requestBody = new BindingsUpdateRequest(Arrays.asList(update1, update2)); - - Request request = api.actions().updateTriggerBindings("trigger-id", requestBody); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ACTION_TRIGGER_BINDINGS, 200); - BindingsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/actions/triggers/trigger-id/bindings")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - - assertThat(body, hasEntry(is("bindings"), is(notNullValue()))); - List> bindingsOnRequest = (ArrayList>) body.get("bindings"); - assertThat(bindingsOnRequest, hasSize(2)); - - Map binding1 = bindingsOnRequest.get(0); - assertThat(binding1, is(notNullValue())); - assertThat(binding1.get("display_name"), is("display name")); - Map binding1Ref = (Map) binding1.get("ref"); - assertThat(binding1Ref, is(aMapWithSize(2))); - assertThat(binding1Ref, hasEntry("type", "action_name")); - assertThat(binding1Ref, hasEntry("value", "action name")); - - Map binding2 = bindingsOnRequest.get(1); - assertThat(binding2, is(notNullValue())); - assertThat(binding2.get("display_name"), is("another display name")); - Map binding2Ref = (Map) binding2.get("ref"); - assertThat(binding2Ref, is(aMapWithSize(2))); - assertThat(binding2Ref, hasEntry("type", "action_id")); - assertThat(binding2Ref, hasEntry("value", "action-id")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java new file mode 100644 index 000000000..528fb4801 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java @@ -0,0 +1,121 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetActionExecutionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ActionsExecutionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"trigger_id\":\"trigger_id\",\"status\":\"unspecified\",\"results\":[{\"action_name\":\"action_name\",\"started_at\":\"2024-01-15T09:30:00Z\",\"ended_at\":\"2024-01-15T09:30:00Z\"}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetActionExecutionResponseContent response = + client.actions().executions().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"trigger_id\": \"trigger_id\",\n" + + " \"status\": \"unspecified\",\n" + + " \"results\": [\n" + + " {\n" + + " \"action_name\": \"action_name\",\n" + + " \"started_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"ended_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java new file mode 100644 index 000000000..6855a58f7 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java @@ -0,0 +1,181 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; +import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionBinding; +import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ActionsTriggersBindingsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"bindings\":[{\"id\":\"id\",\"trigger_id\":\"trigger_id\",\"display_name\":\"display_name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + SyncPagingIterable response = client.actions() + .triggers() + .bindings() + .list( + "triggerId", + ListActionTriggerBindingsRequestParameters.builder() + .page(1) + .perPage(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testUpdateMany() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"bindings\":[{\"id\":\"id\",\"trigger_id\":\"trigger_id\",\"display_name\":\"display_name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + UpdateActionBindingsResponseContent response = client.actions() + .triggers() + .bindings() + .updateMany( + "triggerId", + UpdateActionBindingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"bindings\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"trigger_id\": \"trigger_id\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java new file mode 100644 index 000000000..f15c04833 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java @@ -0,0 +1,126 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ListActionTriggersResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ActionsTriggersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + ListActionTriggersResponseContent response = client.actions().triggers().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java new file mode 100644 index 000000000..b71c1cf48 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java @@ -0,0 +1,308 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.actions.types.ListActionVersionsRequestParameters; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ActionVersion; +import com.auth0.client.mgmt.types.DeployActionVersionResponseContent; +import com.auth0.client.mgmt.types.GetActionVersionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ActionsVersionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"versions\":[{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]}]}")); + SyncPagingIterable response = client.actions() + .versions() + .list( + "actionId", + ListActionVersionsRequestParameters.builder() + .page(1) + .perPage(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + GetActionVersionResponseContent response = client.actions().versions().get("actionId", "id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"msg\": \"msg\",\n" + + " \"url\": \"url\"\n" + + " }\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDeploy() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + DeployActionVersionResponseContent response = + client.actions().versions().deploy("actionId", "id", OptionalNullable.absent()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"msg\": \"msg\",\n" + + " \"url\": \"url\"\n" + + " }\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java new file mode 100644 index 000000000..c54154878 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java @@ -0,0 +1,844 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Action; +import com.auth0.client.mgmt.types.ActionTrigger; +import com.auth0.client.mgmt.types.CreateActionRequestContent; +import com.auth0.client.mgmt.types.CreateActionResponseContent; +import com.auth0.client.mgmt.types.DeleteActionRequestParameters; +import com.auth0.client.mgmt.types.DeployActionResponseContent; +import com.auth0.client.mgmt.types.GetActionResponseContent; +import com.auth0.client.mgmt.types.ListActionsRequestParameters; +import com.auth0.client.mgmt.types.TestActionRequestContent; +import com.auth0.client.mgmt.types.TestActionResponseContent; +import com.auth0.client.mgmt.types.UpdateActionRequestContent; +import com.auth0.client.mgmt.types.UpdateActionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import java.util.HashMap; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ActionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"actions\":[{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{}],\"runtime\":\"runtime\",\"secrets\":[{}],\"installed_integration_id\":\"installed_integration_id\",\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}]}")); + SyncPagingIterable response = client.actions() + .list(ListActionsRequestParameters.builder() + .triggerId("triggerId") + .actionName("actionName") + .deployed(true) + .page(1) + .perPage(1) + .installed(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + CreateActionResponseContent response = client.actions() + .create(CreateActionRequestContent.builder() + .name("name") + .supportedTriggers( + Arrays.asList(ActionTrigger.builder().id("id").build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"deployed_version\": {\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {}\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {}\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"installed_integration_id\": \"installed_integration_id\",\n" + + " \"integration\": {\n" + + " \"id\": \"id\",\n" + + " \"catalog_id\": \"catalog_id\",\n" + + " \"url_slug\": \"url_slug\",\n" + + " \"partner_id\": \"partner_id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"short_description\": \"short_description\",\n" + + " \"logo\": \"logo\",\n" + + " \"feature_type\": \"unspecified\",\n" + + " \"terms_of_use_url\": \"terms_of_use_url\",\n" + + " \"privacy_policy_url\": \"privacy_policy_url\",\n" + + " \"public_support_link\": \"public_support_link\",\n" + + " \"current_release\": {\n" + + " \"id\": \"id\",\n" + + " \"trigger\": {\n" + + " \"id\": \"id\"\n" + + " },\n" + + " \"required_secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"required_configuration\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"status\": \"pending\",\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"deploy\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + GetActionResponseContent response = client.actions().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"deployed_version\": {\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {}\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {}\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"installed_integration_id\": \"installed_integration_id\",\n" + + " \"integration\": {\n" + + " \"id\": \"id\",\n" + + " \"catalog_id\": \"catalog_id\",\n" + + " \"url_slug\": \"url_slug\",\n" + + " \"partner_id\": \"partner_id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"short_description\": \"short_description\",\n" + + " \"logo\": \"logo\",\n" + + " \"feature_type\": \"unspecified\",\n" + + " \"terms_of_use_url\": \"terms_of_use_url\",\n" + + " \"privacy_policy_url\": \"privacy_policy_url\",\n" + + " \"public_support_link\": \"public_support_link\",\n" + + " \"current_release\": {\n" + + " \"id\": \"id\",\n" + + " \"trigger\": {\n" + + " \"id\": \"id\"\n" + + " },\n" + + " \"required_secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"required_configuration\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"status\": \"pending\",\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"deploy\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.actions() + .delete( + "id", + DeleteActionRequestParameters.builder().force(true).build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + UpdateActionResponseContent response = client.actions() + .update("id", UpdateActionRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"deployed_version\": {\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {}\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {}\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"installed_integration_id\": \"installed_integration_id\",\n" + + " \"integration\": {\n" + + " \"id\": \"id\",\n" + + " \"catalog_id\": \"catalog_id\",\n" + + " \"url_slug\": \"url_slug\",\n" + + " \"partner_id\": \"partner_id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"short_description\": \"short_description\",\n" + + " \"logo\": \"logo\",\n" + + " \"feature_type\": \"unspecified\",\n" + + " \"terms_of_use_url\": \"terms_of_use_url\",\n" + + " \"privacy_policy_url\": \"privacy_policy_url\",\n" + + " \"public_support_link\": \"public_support_link\",\n" + + " \"current_release\": {\n" + + " \"id\": \"id\",\n" + + " \"trigger\": {\n" + + " \"id\": \"id\"\n" + + " },\n" + + " \"required_secrets\": [\n" + + " {}\n" + + " ],\n" + + " \"required_configuration\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"status\": \"pending\",\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"deploy\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDeploy() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + DeployActionResponseContent response = client.actions().deploy("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"code\": \"code\",\n" + + " \"dependencies\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\",\n" + + " \"registry_url\": \"registry_url\"\n" + + " }\n" + + " ],\n" + + " \"deployed\": true,\n" + + " \"runtime\": \"runtime\",\n" + + " \"secrets\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"status\": \"pending\",\n" + + " \"number\": 1.1,\n" + + " \"errors\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"msg\": \"msg\",\n" + + " \"url\": \"url\"\n" + + " }\n" + + " ],\n" + + " \"action\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"all_changes_deployed\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " },\n" + + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"supported_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\",\n" + + " \"status\": \"status\",\n" + + " \"runtimes\": [\n" + + " \"runtimes\"\n" + + " ],\n" + + " \"default_runtime\": \"default_runtime\",\n" + + " \"compatible_triggers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " ],\n" + + " \"binding_policy\": \"trigger-bound\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testTest() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"payload\":{\"key\":\"value\"}}")); + TestActionResponseContent response = client.actions() + .test( + "id", + TestActionRequestContent.builder() + .payload(new HashMap() { + { + put("key", "value"); + } + }) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"payload\": {\n" + " \"key\": \"value\"\n" + " }\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"payload\": {\n" + " \"key\": \"value\"\n" + " }\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java b/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java new file mode 100644 index 000000000..f89c83520 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java @@ -0,0 +1,76 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AnomalyBlocksWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCheckIp() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.anomaly().blocks().checkIp("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + } + + @Test + public void testUnblockIp() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.anomaly().blocks().unblockIp("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java new file mode 100644 index 000000000..0553f71f1 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java @@ -0,0 +1,232 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBreachedPasswordDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetBreachedPasswordDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBreachedPasswordDetectionSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AttackProtectionBreachedPasswordDetectionWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"admin_notification_frequency\":[\"immediately\"],\"method\":\"standard\",\"stage\":{\"pre-user-registration\":{\"shields\":[\"block\"]},\"pre-change-password\":{\"shields\":[\"block\"]}}}")); + GetBreachedPasswordDetectionSettingsResponseContent response = + client.attackProtection().breachedPasswordDetection().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"admin_notification_frequency\": [\n" + + " \"immediately\"\n" + + " ],\n" + + " \"method\": \"standard\",\n" + + " \"stage\": {\n" + + " \"pre-user-registration\": {\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ]\n" + + " },\n" + + " \"pre-change-password\": {\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ]\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"admin_notification_frequency\":[\"immediately\"],\"method\":\"standard\",\"stage\":{\"pre-user-registration\":{\"shields\":[\"block\"]},\"pre-change-password\":{\"shields\":[\"block\"]}}}")); + UpdateBreachedPasswordDetectionSettingsResponseContent response = client.attackProtection() + .breachedPasswordDetection() + .update(UpdateBreachedPasswordDetectionSettingsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"admin_notification_frequency\": [\n" + + " \"immediately\"\n" + + " ],\n" + + " \"method\": \"standard\",\n" + + " \"stage\": {\n" + + " \"pre-user-registration\": {\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ]\n" + + " },\n" + + " \"pre-change-password\": {\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ]\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java new file mode 100644 index 000000000..593edc61d --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java @@ -0,0 +1,209 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBruteForceSettingsRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetBruteForceSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBruteForceSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AttackProtectionBruteForceProtectionWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"allowlist\":[\"allowlist\"],\"mode\":\"count_per_identifier_and_ip\",\"max_attempts\":1}")); + GetBruteForceSettingsResponseContent response = + client.attackProtection().bruteForceProtection().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"mode\": \"count_per_identifier_and_ip\",\n" + + " \"max_attempts\": 1\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"allowlist\":[\"allowlist\"],\"mode\":\"count_per_identifier_and_ip\",\"max_attempts\":1}")); + UpdateBruteForceSettingsResponseContent response = client.attackProtection() + .bruteForceProtection() + .update(UpdateBruteForceSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"mode\": \"count_per_identifier_and_ip\",\n" + + " \"max_attempts\": 1\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionEntityTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionEntityTest.java deleted file mode 100644 index 089f5c9a4..000000000 --- a/src/test/java/com/auth0/client/mgmt/AttackProtectionEntityTest.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.attackprotection.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class AttackProtectionEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListBreachedPasswordSettings() throws Exception { - Request request = api.attackProtection().getBreachedPasswordSettings(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BREACHED_PASSWORD_SETTINGS, 200); - BreachedPassword response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/attack-protection/breached-password-detection")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getEnabled(), is(true)); - assertThat(response.getMethod(), is("standard")); - assertThat(response.getShields(), is(notNullValue())); - assertThat(response.getShields().size(), is(2)); - assertThat(response.getShields(), contains("block", "admin_notification")); - assertThat(response.getAdminNotificationFrequency(), is(notNullValue())); - assertThat(response.getAdminNotificationFrequency().size(), is(2)); - assertThat(response.getAdminNotificationFrequency(), contains("immediately", "weekly")); - assertThat(response.getStage().getPreUserRegistrationStage().getShields(), contains("admin_notification")); - } - - @Test - public void shouldUpdateBreachedPasswordSettings() throws Exception { - BreachedPasswordStage stage = new BreachedPasswordStage(); - BreachedPasswordStageEntry preReg = new BreachedPasswordStageEntry(); - preReg.setShields(Arrays.asList("admin_notification")); - stage.setPreUserRegistrationStage(preReg); - - BreachedPassword breachedPassword = new BreachedPassword(); - breachedPassword.setEnabled(true); - breachedPassword.setMethod("standard"); - breachedPassword.setAdminNotificationFrequency(Arrays.asList("immediately", "daily")); - breachedPassword.setShields(Arrays.asList("admin_notification", "block")); - breachedPassword.setStage(stage); - - Request request = api.attackProtection().updateBreachedPasswordSettings(breachedPassword); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BREACHED_PASSWORD_SETTINGS, 200); - BreachedPassword response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/attack-protection/breached-password-detection")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - System.out.println(body); - - assertThat(body.size(), is(5)); - assertThat(body.get("method"), is("standard")); - assertThat(body.get("enabled"), is(true)); - assertThat(((List)body.get("shields")).size(), is(2)); - assertThat((List) body.get("shields"), contains("admin_notification", "block")); - assertThat(body.get("stage"), is(notNullValue())); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetBruteForceConfiguration() throws Exception { - Request request = api.attackProtection().getBruteForceConfiguration(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BRUTE_FORCE_CONFIGURATION, 200); - BruteForceConfiguration response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/attack-protection/brute-force-protection")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getEnabled(), is(false)); - assertThat(response.getMode(), is("count_per_identifier_and_ip")); - assertThat(response.getMaxAttempts(), is(10)); - assertThat(response.getShields(), is(notNullValue())); - assertThat(response.getShields().size(), is(2)); - assertThat(response.getShields(), contains("block", "user_notification")); - assertThat(response.getAllowList(), is(notNullValue())); - assertThat(response.getAllowList().size(), is(2)); - assertThat(response.getAllowList(), contains("143.204.0.105", - "2600:9000:208f:ca00:d:f5f5:b40:93a1")); - } - - @Test - public void shouldUpdateBruteForceConfiguration() throws Exception { - List allowList = Arrays.asList("123", "456"); - List shields = Arrays.asList("block", "user_notification"); - String mode = "count_per_identifier_and_ip"; - - BruteForceConfiguration configuration = new BruteForceConfiguration(); - configuration.setEnabled(true); - configuration.setMaxAttempts(5); - configuration.setMode(mode); - configuration.setAllowList(allowList); - configuration.setShields(shields); - - Request request = api.attackProtection().updateBruteForceConfiguration(configuration); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BRUTE_FORCE_CONFIGURATION, 200); - BruteForceConfiguration response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/attack-protection/brute-force-protection")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - - assertThat(body.size(), is(5)); - assertThat(body.get("enabled"), is(true)); - assertThat(body.get("max_attempts"), is(5)); - assertThat(body.get("mode"), is(mode)); - assertThat(body.get("shields"), is(shields)); - assertThat(body.get("allowlist"), is(allowList)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetSuspiciousIPThrottlingConfig() throws Exception { - Request request = api.attackProtection().getSuspiciousIPThrottlingConfiguration(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SUSPICIOUS_IP_THROTTLING_CONFIGURATION, 200); - SuspiciousIPThrottlingConfiguration response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/attack-protection/suspicious-ip-throttling")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getEnabled(), is(false)); - assertThat(response.getShields(), is(notNullValue())); - assertThat(response.getShields().size(), is(2)); - assertThat(response.getShields(), contains("block", "admin_notification")); - assertThat(response.getAllowList(), is(notNullValue())); - assertThat(response.getAllowList().size(), is(2)); - assertThat(response.getAllowList(), contains("143.204.0.105", - "2600:9000:208f:ca00:d:f5f5:b40:93a1")); - assertThat(response.getStage(), is(notNullValue())); - assertThat(response.getStage().getPreLoginStage(), is(notNullValue())); - assertThat(response.getStage().getPreLoginStage().getMaxAttempts(), is(100)); - assertThat(response.getStage().getPreLoginStage().getRate(), is(864000)); - assertThat(response.getStage().getPreUserRegistrationStage(), is(notNullValue())); - assertThat(response.getStage().getPreUserRegistrationStage().getMaxAttempts(), is(50)); - assertThat(response.getStage().getPreUserRegistrationStage().getRate(), is(1728000)); - } - - @Test - public void shouldUpdateSuspiciousIPTThrottlingConfig() throws Exception { - List allowList = Arrays.asList("123", "456"); - List shields = Arrays.asList("block", "user_notification"); - - Stage stage = new Stage(); - StageEntry preLogin = new StageEntry(); - preLogin.setRate(10); - preLogin.setMaxAttempts(11); - StageEntry preReg = new StageEntry(); - preReg.setRate(12); - preReg.setMaxAttempts(13); - stage.setPreLoginStage(preLogin); - stage.setPreUserRegistrationStage(preLogin); - - SuspiciousIPThrottlingConfiguration configuration = new SuspiciousIPThrottlingConfiguration(); - configuration.setEnabled(true); - configuration.setAllowList(allowList); - configuration.setShields(shields); - configuration.setStage(stage); - - Request request = api.attackProtection().updateSuspiciousIPThrottlingConfiguration(configuration); - assertThat(request, is(notNullValue())); - - server.jsonResponse(BRUTE_FORCE_CONFIGURATION, 200); - SuspiciousIPThrottlingConfiguration response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/attack-protection/suspicious-ip-throttling")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - - assertThat(body.size(), is(4)); - assertThat(body.get("enabled"), is(true)); - assertThat(body.get("shields"), is(shields)); - assertThat(body.get("allowlist"), is(allowList)); - assertThat(body.get("stage"), is(notNullValue())); - - assertThat(response, is(notNullValue())); - } - - @Test - public void updateBreachedPasswordSettingsShouldThrowWithNullParam() { - verifyThrows(IllegalArgumentException.class, - () -> api.attackProtection().updateBreachedPasswordSettings(null), - "'breached password' cannot be null!"); - } - - @Test - public void updateBruteForceConfigurationShouldThrowWithNullParam() { - verifyThrows(IllegalArgumentException.class, - () -> api.attackProtection().updateBruteForceConfiguration(null), - "'configuration' cannot be null!"); - } - - @Test - public void updateSuspiciousIPThrottlingConfigurationShouldThrowWithNullParam() { - verifyThrows(IllegalArgumentException.class, - () -> api.attackProtection().updateSuspiciousIPThrottlingConfiguration(null), - "'configuration' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java new file mode 100644 index 000000000..ecba14d6f --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java @@ -0,0 +1,226 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.attackprotection.types.UpdateSuspiciousIpThrottlingSettingsRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetSuspiciousIpThrottlingSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSuspiciousIpThrottlingSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AttackProtectionSuspiciousIpThrottlingWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"allowlist\":[\"allowlist\"],\"stage\":{\"pre-login\":{\"max_attempts\":1,\"rate\":1},\"pre-user-registration\":{\"max_attempts\":1,\"rate\":1}}}")); + GetSuspiciousIpThrottlingSettingsResponseContent response = + client.attackProtection().suspiciousIpThrottling().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"stage\": {\n" + + " \"pre-login\": {\n" + + " \"max_attempts\": 1,\n" + + " \"rate\": 1\n" + + " },\n" + + " \"pre-user-registration\": {\n" + + " \"max_attempts\": 1,\n" + + " \"rate\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enabled\":true,\"shields\":[\"block\"],\"allowlist\":[\"allowlist\"],\"stage\":{\"pre-login\":{\"max_attempts\":1,\"rate\":1},\"pre-user-registration\":{\"max_attempts\":1,\"rate\":1}}}")); + UpdateSuspiciousIpThrottlingSettingsResponseContent response = client.attackProtection() + .suspiciousIpThrottling() + .update(UpdateSuspiciousIpThrottlingSettingsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enabled\": true,\n" + + " \"shields\": [\n" + + " \"block\"\n" + + " ],\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"stage\": {\n" + + " \"pre-login\": {\n" + + " \"max_attempts\": 1,\n" + + " \"rate\": 1\n" + + " },\n" + + " \"pre-user-registration\": {\n" + + " \"max_attempts\": 1,\n" + + " \"rate\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/BaseMgmtEntityTest.java b/src/test/java/com/auth0/client/mgmt/BaseMgmtEntityTest.java deleted file mode 100644 index 26d4d32da..000000000 --- a/src/test/java/com/auth0/client/mgmt/BaseMgmtEntityTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; - -public class BaseMgmtEntityTest { - - private static final String API_TOKEN = "apiToken"; - - protected MockServer server; - protected ManagementAPI api; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - api = ManagementAPI.newBuilder(server.getBaseUrl(), API_TOKEN).build(); - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java b/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java deleted file mode 100644 index da351714e..000000000 --- a/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.blacklists.Token; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class BlacklistsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnGetBlacklistedTokensWithNullAudience() { - verifyThrows(IllegalArgumentException.class, - () -> api.blacklists().getBlacklist(null), - "'audience' cannot be null!"); - } - - @Test - public void shouldGetBlacklistedTokens() throws Exception { - Request> request = api.blacklists().getBlacklist("myapi"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_BLACKLISTED_TOKENS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/blacklists/tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("aud", "myapi")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldReturnEmptyBlacklistedTokens() throws Exception { - Request> request = api.blacklists().getBlacklist("myapi"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(Token.class))); - } - - @Test - public void shouldThrowOnBlacklistTokensWithNullToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.blacklists().blacklistToken(null), - "'token' cannot be null!"); - } - - @Test - public void shouldBlacklistToken() throws Exception { - Request request = api.blacklists().blacklistToken(new Token("id")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_BLACKLISTED_TOKENS_LIST, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/blacklists/tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("jti", "id")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingEntityTest.java b/src/test/java/com/auth0/client/mgmt/BrandingEntityTest.java deleted file mode 100644 index 0889073a3..000000000 --- a/src/test/java/com/auth0/client/mgmt/BrandingEntityTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.branding.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_BRANDING_LOGIN_TEMPLATE; -import static com.auth0.client.MockServer.MGMT_BRANDING_SETTINGS; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class BrandingEntityTest extends BaseMgmtEntityTest { - @Test - public void shouldGetBrandingSettings() throws Exception { - Request request = api.branding().getBrandingSettings(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_BRANDING_SETTINGS, 200); - BrandingSettings response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/branding")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateBrandingSettingsWithNullSettings() { - verifyThrows(IllegalArgumentException.class, - () -> api.branding().updateBrandingSettings(null), - "'settings' cannot be null!"); - } - - @Test - public void shouldUpdateBrandingSettings() throws Exception { - Request request = api.branding().updateBrandingSettings(getBrandingSettings()); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_BRANDING_SETTINGS, 200); - BrandingSettings response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/branding")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetTheUniversalLoginTemplate() throws Exception { - Request request = api.branding().getUniversalLoginTemplate(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_BRANDING_LOGIN_TEMPLATE, 200); - UniversalLoginTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/branding/templates/universal-login")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldDeleteTheUniversalLoginTemplate() throws Exception { - Request request = api.branding().deleteUniversalLoginTemplate(); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/branding/templates/universal-login")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnSetUniversalLoginTemplateNullTemplate() { - verifyThrows(IllegalArgumentException.class, - () -> api.branding().setUniversalLoginTemplate(null), - "'template' cannot be null!"); - } - - @Test - public void shouldSetTheUniversalLoginTemplate() throws Exception { - Request request = api.branding().setUniversalLoginTemplate(getUniversalLoginTemplateUpdate()); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/branding/templates/universal-login")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - private BrandingSettings getBrandingSettings() { - BrandingSettings settings = new BrandingSettings(); - - BrandingColors colors = new BrandingColors(); - colors.setPrimary("#00000"); - colors.setPageBackground("#ffffff"); - settings.setColors(colors); - - settings.setFaviconUrl("https://test-url.com/favicon.svg"); - settings.setLogoUrl("https://test-url.com/logo.svg"); - - BrandingFont font = new BrandingFont(); - font.setUrl("https://test.com/font.ttf"); - settings.setFont(font); - - return settings; - - } - - private UniversalLoginTemplateUpdate getUniversalLoginTemplateUpdate(){ - UniversalLoginTemplateUpdate template = new UniversalLoginTemplateUpdate(); - template.setTemplate("{%- auth0:head -%}{%- auth0:widget -%}"); - return template; - } -} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java new file mode 100644 index 000000000..e4ed7ef4b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java @@ -0,0 +1,499 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.branding.phone.types.CreateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneProviderSendTestRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; +import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; +import com.auth0.client.mgmt.types.ListBrandingPhoneProvidersResponseContent; +import com.auth0.client.mgmt.types.PhoneProviderCredentials; +import com.auth0.client.mgmt.types.PhoneProviderNameEnum; +import com.auth0.client.mgmt.types.TwilioProviderCredentials; +import com.auth0.client.mgmt.types.UpdateBrandingPhoneProviderResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class BrandingPhoneProvidersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"providers\":[{\"id\":\"id\",\"tenant\":\"tenant\",\"name\":\"twilio\",\"channel\":\"phone\",\"disabled\":true,\"configuration\":{\"sid\":\"sid\",\"delivery_methods\":[\"text\"]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + ListBrandingPhoneProvidersResponseContent response = client.branding() + .phone() + .providers() + .list(ListBrandingPhoneProvidersRequestParameters.builder() + .disabled(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"providers\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"twilio\",\n" + + " \"channel\": \"phone\",\n" + + " \"disabled\": true,\n" + + " \"configuration\": {\n" + + " \"sid\": \"sid\",\n" + + " \"delivery_methods\": [\n" + + " \"text\"\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"tenant\":\"tenant\",\"name\":\"twilio\",\"channel\":\"phone\",\"disabled\":true,\"configuration\":{\"default_from\":\"default_from\",\"mssid\":\"mssid\",\"sid\":\"sid\",\"delivery_methods\":[\"text\"]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + CreateBrandingPhoneProviderResponseContent response = client.branding() + .phone() + .providers() + .create(CreateBrandingPhoneProviderRequestContent.builder() + .name(PhoneProviderNameEnum.TWILIO) + .credentials(PhoneProviderCredentials.of(TwilioProviderCredentials.builder() + .authToken("auth_token") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"twilio\",\n" + + " \"credentials\": {\n" + + " \"auth_token\": \"auth_token\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"twilio\",\n" + + " \"channel\": \"phone\",\n" + + " \"disabled\": true,\n" + + " \"configuration\": {\n" + + " \"default_from\": \"default_from\",\n" + + " \"mssid\": \"mssid\",\n" + + " \"sid\": \"sid\",\n" + + " \"delivery_methods\": [\n" + + " \"text\"\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"tenant\":\"tenant\",\"name\":\"twilio\",\"channel\":\"phone\",\"disabled\":true,\"configuration\":{\"default_from\":\"default_from\",\"mssid\":\"mssid\",\"sid\":\"sid\",\"delivery_methods\":[\"text\"]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetBrandingPhoneProviderResponseContent response = + client.branding().phone().providers().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"twilio\",\n" + + " \"channel\": \"phone\",\n" + + " \"disabled\": true,\n" + + " \"configuration\": {\n" + + " \"default_from\": \"default_from\",\n" + + " \"mssid\": \"mssid\",\n" + + " \"sid\": \"sid\",\n" + + " \"delivery_methods\": [\n" + + " \"text\"\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.branding().phone().providers().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"tenant\":\"tenant\",\"name\":\"twilio\",\"channel\":\"phone\",\"disabled\":true,\"configuration\":{\"default_from\":\"default_from\",\"mssid\":\"mssid\",\"sid\":\"sid\",\"delivery_methods\":[\"text\"]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateBrandingPhoneProviderResponseContent response = client.branding() + .phone() + .providers() + .update( + "id", + UpdateBrandingPhoneProviderRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"twilio\",\n" + + " \"channel\": \"phone\",\n" + + " \"disabled\": true,\n" + + " \"configuration\": {\n" + + " \"default_from\": \"default_from\",\n" + + " \"mssid\": \"mssid\",\n" + + " \"sid\": \"sid\",\n" + + " \"delivery_methods\": [\n" + + " \"text\"\n" + + " ]\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testTest() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"code\":1.1,\"message\":\"message\"}")); + CreatePhoneProviderSendTestResponseContent response = client.branding() + .phone() + .providers() + .test( + "id", + CreatePhoneProviderSendTestRequestContent.builder() + .to("to") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"to\": \"to\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"code\": 1.1,\n" + " \"message\": \"message\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java new file mode 100644 index 000000000..1fc19fc13 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java @@ -0,0 +1,575 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.branding.phone.types.CreatePhoneTemplateTestNotificationRequestContent; +import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; +import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; +import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.ListPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.ResetPhoneTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdatePhoneTemplateResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class BrandingPhoneTemplatesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"templates\":[{\"id\":\"id\",\"channel\":\"channel\",\"customizable\":true,\"tenant\":\"tenant\",\"content\":{},\"type\":\"otp_verify\",\"disabled\":true}]}")); + ListPhoneTemplatesResponseContent response = client.branding() + .phone() + .templates() + .list(ListPhoneTemplatesRequestParameters.builder() + .disabled(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"templates\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"channel\": \"channel\",\n" + + " \"customizable\": true,\n" + + " \"tenant\": \"tenant\",\n" + + " \"content\": {},\n" + + " \"type\": \"otp_verify\",\n" + + " \"disabled\": true\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"channel\":\"channel\",\"customizable\":true,\"tenant\":\"tenant\",\"content\":{\"syntax\":\"syntax\",\"from\":\"from\",\"body\":{\"text\":\"text\",\"voice\":\"voice\"}},\"type\":\"otp_verify\",\"disabled\":true}")); + CreatePhoneTemplateResponseContent response = client.branding() + .phone() + .templates() + .create(CreatePhoneTemplateRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"channel\": \"channel\",\n" + + " \"customizable\": true,\n" + + " \"tenant\": \"tenant\",\n" + + " \"content\": {\n" + + " \"syntax\": \"syntax\",\n" + + " \"from\": \"from\",\n" + + " \"body\": {\n" + + " \"text\": \"text\",\n" + + " \"voice\": \"voice\"\n" + + " }\n" + + " },\n" + + " \"type\": \"otp_verify\",\n" + + " \"disabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"channel\":\"channel\",\"customizable\":true,\"tenant\":\"tenant\",\"content\":{\"syntax\":\"syntax\",\"from\":\"from\",\"body\":{\"text\":\"text\",\"voice\":\"voice\"}},\"type\":\"otp_verify\",\"disabled\":true}")); + GetPhoneTemplateResponseContent response = + client.branding().phone().templates().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"channel\": \"channel\",\n" + + " \"customizable\": true,\n" + + " \"tenant\": \"tenant\",\n" + + " \"content\": {\n" + + " \"syntax\": \"syntax\",\n" + + " \"from\": \"from\",\n" + + " \"body\": {\n" + + " \"text\": \"text\",\n" + + " \"voice\": \"voice\"\n" + + " }\n" + + " },\n" + + " \"type\": \"otp_verify\",\n" + + " \"disabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.branding().phone().templates().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"channel\":\"channel\",\"customizable\":true,\"tenant\":\"tenant\",\"content\":{\"syntax\":\"syntax\",\"from\":\"from\",\"body\":{\"text\":\"text\",\"voice\":\"voice\"}},\"type\":\"otp_verify\",\"disabled\":true}")); + UpdatePhoneTemplateResponseContent response = client.branding() + .phone() + .templates() + .update("id", UpdatePhoneTemplateRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"channel\": \"channel\",\n" + + " \"customizable\": true,\n" + + " \"tenant\": \"tenant\",\n" + + " \"content\": {\n" + + " \"syntax\": \"syntax\",\n" + + " \"from\": \"from\",\n" + + " \"body\": {\n" + + " \"text\": \"text\",\n" + + " \"voice\": \"voice\"\n" + + " }\n" + + " },\n" + + " \"type\": \"otp_verify\",\n" + + " \"disabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testReset() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"x\",\"channel\":\"channel\",\"customizable\":true,\"tenant\":\"x\",\"content\":{\"syntax\":\"syntax\",\"from\":\"x\",\"body\":{\"text\":\"x\",\"voice\":\"x\"}},\"type\":\"otp_verify\",\"disabled\":true}")); + ResetPhoneTemplateResponseContent response = client.branding() + .phone() + .templates() + .reset("id", new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"x\",\n" + + " \"channel\": \"channel\",\n" + + " \"customizable\": true,\n" + + " \"tenant\": \"x\",\n" + + " \"content\": {\n" + + " \"syntax\": \"syntax\",\n" + + " \"from\": \"x\",\n" + + " \"body\": {\n" + + " \"text\": \"x\",\n" + + " \"voice\": \"x\"\n" + + " }\n" + + " },\n" + + " \"type\": \"otp_verify\",\n" + + " \"disabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testTest() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"message\":\"message\"}")); + CreatePhoneTemplateTestNotificationResponseContent response = client.branding() + .phone() + .templates() + .test( + "id", + CreatePhoneTemplateTestNotificationRequestContent.builder() + .to("to") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"to\": \"to\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"message\": \"message\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java new file mode 100644 index 000000000..52128c622 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java @@ -0,0 +1,151 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetUniversalLoginTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUniversalLoginTemplateRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class BrandingTemplatesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetUniversalLogin() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"body\":\"body\"}")); + GetUniversalLoginTemplateResponseContent response = + client.branding().templates().getUniversalLogin(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"body\": \"body\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateUniversalLogin() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.branding().templates().updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent.of("string")); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "\"string\""; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDeleteUniversalLogin() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.branding().templates().deleteUniversalLogin(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java new file mode 100644 index 000000000..4c161ae67 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java @@ -0,0 +1,942 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.branding.types.CreateBrandingThemeRequestContent; +import com.auth0.client.mgmt.branding.types.UpdateBrandingThemeRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.BrandingThemeBorders; +import com.auth0.client.mgmt.types.BrandingThemeBordersButtonsStyleEnum; +import com.auth0.client.mgmt.types.BrandingThemeBordersInputsStyleEnum; +import com.auth0.client.mgmt.types.BrandingThemeColors; +import com.auth0.client.mgmt.types.BrandingThemeFontBodyText; +import com.auth0.client.mgmt.types.BrandingThemeFontButtonsText; +import com.auth0.client.mgmt.types.BrandingThemeFontInputLabels; +import com.auth0.client.mgmt.types.BrandingThemeFontLinks; +import com.auth0.client.mgmt.types.BrandingThemeFontLinksStyleEnum; +import com.auth0.client.mgmt.types.BrandingThemeFontSubtitle; +import com.auth0.client.mgmt.types.BrandingThemeFontTitle; +import com.auth0.client.mgmt.types.BrandingThemeFonts; +import com.auth0.client.mgmt.types.BrandingThemePageBackground; +import com.auth0.client.mgmt.types.BrandingThemePageBackgroundPageLayoutEnum; +import com.auth0.client.mgmt.types.BrandingThemeWidget; +import com.auth0.client.mgmt.types.BrandingThemeWidgetHeaderTextAlignmentEnum; +import com.auth0.client.mgmt.types.BrandingThemeWidgetLogoPositionEnum; +import com.auth0.client.mgmt.types.BrandingThemeWidgetSocialButtonsLayoutEnum; +import com.auth0.client.mgmt.types.CreateBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingDefaultThemeResponseContent; +import com.auth0.client.mgmt.types.GetBrandingThemeResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingThemeResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class BrandingThemesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"borders\":{\"button_border_radius\":1.1,\"button_border_weight\":1.1,\"buttons_style\":\"pill\",\"input_border_radius\":1.1,\"input_border_weight\":1.1,\"inputs_style\":\"pill\",\"show_widget_shadow\":true,\"widget_border_weight\":1.1,\"widget_corner_radius\":1.1},\"colors\":{\"base_focus_color\":\"base_focus_color\",\"base_hover_color\":\"base_hover_color\",\"body_text\":\"body_text\",\"captcha_widget_theme\":\"auto\",\"error\":\"error\",\"header\":\"header\",\"icons\":\"icons\",\"input_background\":\"input_background\",\"input_border\":\"input_border\",\"input_filled_text\":\"input_filled_text\",\"input_labels_placeholders\":\"input_labels_placeholders\",\"links_focused_components\":\"links_focused_components\",\"primary_button\":\"primary_button\",\"primary_button_label\":\"primary_button_label\",\"read_only_background\":\"read_only_background\",\"secondary_button_border\":\"secondary_button_border\",\"secondary_button_label\":\"secondary_button_label\",\"success\":\"success\",\"widget_background\":\"widget_background\",\"widget_border\":\"widget_border\"},\"displayName\":\"displayName\",\"fonts\":{\"body_text\":{\"bold\":true,\"size\":1.1},\"buttons_text\":{\"bold\":true,\"size\":1.1},\"font_url\":\"font_url\",\"input_labels\":{\"bold\":true,\"size\":1.1},\"links\":{\"bold\":true,\"size\":1.1},\"links_style\":\"normal\",\"reference_text_size\":1.1,\"subtitle\":{\"bold\":true,\"size\":1.1},\"title\":{\"bold\":true,\"size\":1.1}},\"page_background\":{\"background_color\":\"background_color\",\"background_image_url\":\"background_image_url\",\"page_layout\":\"center\"},\"themeId\":\"themeId\",\"widget\":{\"header_text_alignment\":\"center\",\"logo_height\":1.1,\"logo_position\":\"center\",\"logo_url\":\"logo_url\",\"social_buttons_layout\":\"bottom\"}}")); + CreateBrandingThemeResponseContent response = client.branding() + .themes() + .create(CreateBrandingThemeRequestContent.builder() + .borders(BrandingThemeBorders.builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build()) + .colors(BrandingThemeColors.builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build()) + .fonts(BrandingThemeFonts.builder() + .bodyText(BrandingThemeFontBodyText.builder() + .bold(true) + .size(1.1) + .build()) + .buttonsText(BrandingThemeFontButtonsText.builder() + .bold(true) + .size(1.1) + .build()) + .fontUrl("font_url") + .inputLabels(BrandingThemeFontInputLabels.builder() + .bold(true) + .size(1.1) + .build()) + .links(BrandingThemeFontLinks.builder() + .bold(true) + .size(1.1) + .build()) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle(BrandingThemeFontSubtitle.builder() + .bold(true) + .size(1.1) + .build()) + .title(BrandingThemeFontTitle.builder() + .bold(true) + .size(1.1) + .build()) + .build()) + .pageBackground(BrandingThemePageBackground.builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build()) + .widget(BrandingThemeWidget.builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build()) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"body_text\": \"body_text\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"base_focus_color\": \"base_focus_color\",\n" + + " \"base_hover_color\": \"base_hover_color\",\n" + + " \"body_text\": \"body_text\",\n" + + " \"captcha_widget_theme\": \"auto\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"read_only_background\": \"read_only_background\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"displayName\": \"displayName\",\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"themeId\": \"themeId\",\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetDefault() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"borders\":{\"button_border_radius\":1.1,\"button_border_weight\":1.1,\"buttons_style\":\"pill\",\"input_border_radius\":1.1,\"input_border_weight\":1.1,\"inputs_style\":\"pill\",\"show_widget_shadow\":true,\"widget_border_weight\":1.1,\"widget_corner_radius\":1.1},\"colors\":{\"base_focus_color\":\"base_focus_color\",\"base_hover_color\":\"base_hover_color\",\"body_text\":\"body_text\",\"captcha_widget_theme\":\"auto\",\"error\":\"error\",\"header\":\"header\",\"icons\":\"icons\",\"input_background\":\"input_background\",\"input_border\":\"input_border\",\"input_filled_text\":\"input_filled_text\",\"input_labels_placeholders\":\"input_labels_placeholders\",\"links_focused_components\":\"links_focused_components\",\"primary_button\":\"primary_button\",\"primary_button_label\":\"primary_button_label\",\"read_only_background\":\"read_only_background\",\"secondary_button_border\":\"secondary_button_border\",\"secondary_button_label\":\"secondary_button_label\",\"success\":\"success\",\"widget_background\":\"widget_background\",\"widget_border\":\"widget_border\"},\"displayName\":\"displayName\",\"fonts\":{\"body_text\":{\"bold\":true,\"size\":1.1},\"buttons_text\":{\"bold\":true,\"size\":1.1},\"font_url\":\"font_url\",\"input_labels\":{\"bold\":true,\"size\":1.1},\"links\":{\"bold\":true,\"size\":1.1},\"links_style\":\"normal\",\"reference_text_size\":1.1,\"subtitle\":{\"bold\":true,\"size\":1.1},\"title\":{\"bold\":true,\"size\":1.1}},\"page_background\":{\"background_color\":\"background_color\",\"background_image_url\":\"background_image_url\",\"page_layout\":\"center\"},\"themeId\":\"themeId\",\"widget\":{\"header_text_alignment\":\"center\",\"logo_height\":1.1,\"logo_position\":\"center\",\"logo_url\":\"logo_url\",\"social_buttons_layout\":\"bottom\"}}")); + GetBrandingDefaultThemeResponseContent response = + client.branding().themes().getDefault(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"base_focus_color\": \"base_focus_color\",\n" + + " \"base_hover_color\": \"base_hover_color\",\n" + + " \"body_text\": \"body_text\",\n" + + " \"captcha_widget_theme\": \"auto\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"read_only_background\": \"read_only_background\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"displayName\": \"displayName\",\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"themeId\": \"themeId\",\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"borders\":{\"button_border_radius\":1.1,\"button_border_weight\":1.1,\"buttons_style\":\"pill\",\"input_border_radius\":1.1,\"input_border_weight\":1.1,\"inputs_style\":\"pill\",\"show_widget_shadow\":true,\"widget_border_weight\":1.1,\"widget_corner_radius\":1.1},\"colors\":{\"base_focus_color\":\"base_focus_color\",\"base_hover_color\":\"base_hover_color\",\"body_text\":\"body_text\",\"captcha_widget_theme\":\"auto\",\"error\":\"error\",\"header\":\"header\",\"icons\":\"icons\",\"input_background\":\"input_background\",\"input_border\":\"input_border\",\"input_filled_text\":\"input_filled_text\",\"input_labels_placeholders\":\"input_labels_placeholders\",\"links_focused_components\":\"links_focused_components\",\"primary_button\":\"primary_button\",\"primary_button_label\":\"primary_button_label\",\"read_only_background\":\"read_only_background\",\"secondary_button_border\":\"secondary_button_border\",\"secondary_button_label\":\"secondary_button_label\",\"success\":\"success\",\"widget_background\":\"widget_background\",\"widget_border\":\"widget_border\"},\"displayName\":\"displayName\",\"fonts\":{\"body_text\":{\"bold\":true,\"size\":1.1},\"buttons_text\":{\"bold\":true,\"size\":1.1},\"font_url\":\"font_url\",\"input_labels\":{\"bold\":true,\"size\":1.1},\"links\":{\"bold\":true,\"size\":1.1},\"links_style\":\"normal\",\"reference_text_size\":1.1,\"subtitle\":{\"bold\":true,\"size\":1.1},\"title\":{\"bold\":true,\"size\":1.1}},\"page_background\":{\"background_color\":\"background_color\",\"background_image_url\":\"background_image_url\",\"page_layout\":\"center\"},\"themeId\":\"themeId\",\"widget\":{\"header_text_alignment\":\"center\",\"logo_height\":1.1,\"logo_position\":\"center\",\"logo_url\":\"logo_url\",\"social_buttons_layout\":\"bottom\"}}")); + GetBrandingThemeResponseContent response = client.branding().themes().get("themeId"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"base_focus_color\": \"base_focus_color\",\n" + + " \"base_hover_color\": \"base_hover_color\",\n" + + " \"body_text\": \"body_text\",\n" + + " \"captcha_widget_theme\": \"auto\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"read_only_background\": \"read_only_background\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"displayName\": \"displayName\",\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"themeId\": \"themeId\",\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.branding().themes().delete("themeId"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"borders\":{\"button_border_radius\":1.1,\"button_border_weight\":1.1,\"buttons_style\":\"pill\",\"input_border_radius\":1.1,\"input_border_weight\":1.1,\"inputs_style\":\"pill\",\"show_widget_shadow\":true,\"widget_border_weight\":1.1,\"widget_corner_radius\":1.1},\"colors\":{\"base_focus_color\":\"base_focus_color\",\"base_hover_color\":\"base_hover_color\",\"body_text\":\"body_text\",\"captcha_widget_theme\":\"auto\",\"error\":\"error\",\"header\":\"header\",\"icons\":\"icons\",\"input_background\":\"input_background\",\"input_border\":\"input_border\",\"input_filled_text\":\"input_filled_text\",\"input_labels_placeholders\":\"input_labels_placeholders\",\"links_focused_components\":\"links_focused_components\",\"primary_button\":\"primary_button\",\"primary_button_label\":\"primary_button_label\",\"read_only_background\":\"read_only_background\",\"secondary_button_border\":\"secondary_button_border\",\"secondary_button_label\":\"secondary_button_label\",\"success\":\"success\",\"widget_background\":\"widget_background\",\"widget_border\":\"widget_border\"},\"displayName\":\"displayName\",\"fonts\":{\"body_text\":{\"bold\":true,\"size\":1.1},\"buttons_text\":{\"bold\":true,\"size\":1.1},\"font_url\":\"font_url\",\"input_labels\":{\"bold\":true,\"size\":1.1},\"links\":{\"bold\":true,\"size\":1.1},\"links_style\":\"normal\",\"reference_text_size\":1.1,\"subtitle\":{\"bold\":true,\"size\":1.1},\"title\":{\"bold\":true,\"size\":1.1}},\"page_background\":{\"background_color\":\"background_color\",\"background_image_url\":\"background_image_url\",\"page_layout\":\"center\"},\"themeId\":\"themeId\",\"widget\":{\"header_text_alignment\":\"center\",\"logo_height\":1.1,\"logo_position\":\"center\",\"logo_url\":\"logo_url\",\"social_buttons_layout\":\"bottom\"}}")); + UpdateBrandingThemeResponseContent response = client.branding() + .themes() + .update( + "themeId", + UpdateBrandingThemeRequestContent.builder() + .borders(BrandingThemeBorders.builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build()) + .colors(BrandingThemeColors.builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build()) + .fonts(BrandingThemeFonts.builder() + .bodyText(BrandingThemeFontBodyText.builder() + .bold(true) + .size(1.1) + .build()) + .buttonsText(BrandingThemeFontButtonsText.builder() + .bold(true) + .size(1.1) + .build()) + .fontUrl("font_url") + .inputLabels(BrandingThemeFontInputLabels.builder() + .bold(true) + .size(1.1) + .build()) + .links(BrandingThemeFontLinks.builder() + .bold(true) + .size(1.1) + .build()) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle(BrandingThemeFontSubtitle.builder() + .bold(true) + .size(1.1) + .build()) + .title(BrandingThemeFontTitle.builder() + .bold(true) + .size(1.1) + .build()) + .build()) + .pageBackground(BrandingThemePageBackground.builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build()) + .widget(BrandingThemeWidget.builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build()) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"body_text\": \"body_text\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"borders\": {\n" + + " \"button_border_radius\": 1.1,\n" + + " \"button_border_weight\": 1.1,\n" + + " \"buttons_style\": \"pill\",\n" + + " \"input_border_radius\": 1.1,\n" + + " \"input_border_weight\": 1.1,\n" + + " \"inputs_style\": \"pill\",\n" + + " \"show_widget_shadow\": true,\n" + + " \"widget_border_weight\": 1.1,\n" + + " \"widget_corner_radius\": 1.1\n" + + " },\n" + + " \"colors\": {\n" + + " \"base_focus_color\": \"base_focus_color\",\n" + + " \"base_hover_color\": \"base_hover_color\",\n" + + " \"body_text\": \"body_text\",\n" + + " \"captcha_widget_theme\": \"auto\",\n" + + " \"error\": \"error\",\n" + + " \"header\": \"header\",\n" + + " \"icons\": \"icons\",\n" + + " \"input_background\": \"input_background\",\n" + + " \"input_border\": \"input_border\",\n" + + " \"input_filled_text\": \"input_filled_text\",\n" + + " \"input_labels_placeholders\": \"input_labels_placeholders\",\n" + + " \"links_focused_components\": \"links_focused_components\",\n" + + " \"primary_button\": \"primary_button\",\n" + + " \"primary_button_label\": \"primary_button_label\",\n" + + " \"read_only_background\": \"read_only_background\",\n" + + " \"secondary_button_border\": \"secondary_button_border\",\n" + + " \"secondary_button_label\": \"secondary_button_label\",\n" + + " \"success\": \"success\",\n" + + " \"widget_background\": \"widget_background\",\n" + + " \"widget_border\": \"widget_border\"\n" + + " },\n" + + " \"displayName\": \"displayName\",\n" + + " \"fonts\": {\n" + + " \"body_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"buttons_text\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"font_url\": \"font_url\",\n" + + " \"input_labels\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"links_style\": \"normal\",\n" + + " \"reference_text_size\": 1.1,\n" + + " \"subtitle\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " },\n" + + " \"title\": {\n" + + " \"bold\": true,\n" + + " \"size\": 1.1\n" + + " }\n" + + " },\n" + + " \"page_background\": {\n" + + " \"background_color\": \"background_color\",\n" + + " \"background_image_url\": \"background_image_url\",\n" + + " \"page_layout\": \"center\"\n" + + " },\n" + + " \"themeId\": \"themeId\",\n" + + " \"widget\": {\n" + + " \"header_text_alignment\": \"center\",\n" + + " \"logo_height\": 1.1,\n" + + " \"logo_position\": \"center\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"social_buttons_layout\": \"bottom\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java new file mode 100644 index 000000000..d6f37c67a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java @@ -0,0 +1,207 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetBrandingResponseContent; +import com.auth0.client.mgmt.types.UpdateBrandingRequestContent; +import com.auth0.client.mgmt.types.UpdateBrandingResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class BrandingWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"},\"favicon_url\":\"favicon_url\",\"logo_url\":\"logo_url\",\"font\":{\"url\":\"url\"}}")); + GetBrandingResponseContent response = client.branding().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " },\n" + + " \"favicon_url\": \"favicon_url\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"font\": {\n" + + " \"url\": \"url\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"},\"favicon_url\":\"favicon_url\",\"logo_url\":\"logo_url\",\"font\":{\"url\":\"url\"}}")); + UpdateBrandingResponseContent response = + client.branding().update(UpdateBrandingRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " },\n" + + " \"favicon_url\": \"favicon_url\",\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"font\": {\n" + + " \"url\": \"url\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java deleted file mode 100644 index 8d810c947..000000000 --- a/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java +++ /dev/null @@ -1,348 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ClientGrantsFilter; -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.json.mgmt.clientgrants.ClientGrant; -import com.auth0.json.mgmt.clientgrants.ClientGrantsPage; -import com.auth0.json.mgmt.organizations.OrganizationsPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ClientGrantsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListClientGrantsWithoutFilter() throws Exception { - Request request = api.clientGrants().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANTS_LIST, 200); - ClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientGrantsWithPage() throws Exception { - ClientGrantsFilter filter = new ClientGrantsFilter().withPage(23, 5); - Request request = api.clientGrants().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANTS_LIST, 200); - ClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientGrantsWithTotals() throws Exception { - ClientGrantsFilter filter = new ClientGrantsFilter().withTotals(true); - Request request = api.clientGrants().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANTS_PAGED_LIST, 200); - ClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListClientGrantsWithAdditionalProperties() throws Exception { - ClientGrantsFilter filter = new ClientGrantsFilter() - .withAudience("https://myapi.auth0.com") - .withAllowAnyOrganization(true) - .withClientId("u9e3hh3e9j2fj9092ked"); - Request request = api.clientGrants().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANTS_LIST, 200); - ClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("audience", "https://myapi.auth0.com")); - assertThat(recordedRequest, hasQueryParameter("client_id", "u9e3hh3e9j2fj9092ked")); - assertThat(recordedRequest, hasQueryParameter("allow_any_organization", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnCreateClientGrantWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().create(null, "audience", new String[]{"openid"}), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateClientGrantWithNullAudience() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().create("clientId", null, new String[]{"openid"}), - "'audience' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateClientGrantWithNullScope() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().create("clientId", "audience", null), - "'scope' cannot be null!"); - } - - @Test - public void shouldCreateClientGrant() throws Exception { - Request request = api.clientGrants().create("clientId", "audience", new String[]{"openid"}); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("client_id", "clientId")); - assertThat(body, hasEntry("audience", "audience")); - assertThat(body, hasKey("scope")); - assertThat((Iterable) body.get("scope"), contains("openid")); - assertThat(body, not(hasKey("organization_usage"))); - assertThat(body, not(hasKey("allow_any_organization"))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldCreateClientGrantWithOrgParams() throws Exception { - Request request = api.clientGrants().create("clientId", "audience", new String[]{"openid"}, "allow", false); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(5)); - assertThat(body, hasEntry("client_id", "clientId")); - assertThat(body, hasEntry("audience", "audience")); - assertThat(body, hasKey("scope")); - assertThat((Iterable) body.get("scope"), contains("openid")); - assertThat(body, hasEntry("organization_usage", "allow")); - assertThat(body, hasEntry("allow_any_organization", false)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void createClientGrantWithOrgParamsShouldNotSendEmptyOrgUsage() throws Exception { - Request request = api.clientGrants().create("clientId", "audience", new String[]{"openid"}, " ", false); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(4)); - assertThat(body, hasEntry("client_id", "clientId")); - assertThat(body, hasEntry("audience", "audience")); - assertThat(body, hasKey("scope")); - assertThat((Iterable) body.get("scope"), contains("openid")); - assertThat(body, not(hasKey("organization_usage"))); - assertThat(body, hasEntry("allow_any_organization", false)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteClientGrantWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().delete(null), - "'client grant id' cannot be null!"); - } - - @Test - public void shouldDeleteClientGrant() throws Exception { - Request request = api.clientGrants().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/client-grants/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateClientGrantWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().update(null, new String[]{}), - "'client grant id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateClientGrantWithNullScope() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().update("clientGrantId", null), - "'scope' cannot be null!"); - } - - @Test - public void shouldUpdateClientGrant() throws Exception { - Request request = api.clientGrants().update("1", new String[]{"openid", "profile"}); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/client-grants/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat((ArrayList) body.get("scope"), contains("openid", "profile")); - assertThat(body, not(hasKey("organization_usage"))); - assertThat(body, not(hasKey("allow_any_organization"))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldUpdateClientGrantWithOrgParams() throws Exception { - Request request = api.clientGrants().update("1", new String[]{"openid", "profile"}, "allow", true); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/client-grants/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat((ArrayList) body.get("scope"), contains("openid", "profile")); - assertThat(body, hasEntry("organization_usage", "allow")); - assertThat(body, hasEntry("allow_any_organization", true)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void updateClientGrantWithOrgParamsShouldNotSendEmptyOrgUsage() throws Exception { - Request request = api.clientGrants().update("1", new String[]{"openid", "profile"}, " ", true); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 200); - ClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/client-grants/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat((ArrayList) body.get("scope"), contains("openid", "profile")); - assertThat(body, not(hasKey("organization_usage"))); - assertThat(body, hasEntry("allow_any_organization", true)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldListOrganizationsWithoutFilter() throws Exception { - Request request = api.clientGrants().listOrganizations("grant-id", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants/grant-id/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListOrganizationsWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(23, 5); - Request request = api.clientGrants().listOrganizations("grant-id", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_PAGED_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/client-grants/grant-id/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnGetOrganizationsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clientGrants().listOrganizations(null, new PageFilter()), - "'client grant ID' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java new file mode 100644 index 000000000..6a977a88b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java @@ -0,0 +1,86 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientGrantsOrganizationsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + SyncPagingIterable response = client.clientGrants() + .organizations() + .list( + "id", + ListClientGrantOrganizationsRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java new file mode 100644 index 000000000..07f8e07cd --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java @@ -0,0 +1,287 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; +import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; +import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.UpdateClientGrantRequestContent; +import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientGrantsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"client_grants\":[{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}]}")); + SyncPagingIterable response = client.clientGrants() + .list(ListClientGrantsRequestParameters.builder() + .from("from") + .take(1) + .audience("audience") + .clientId("client_id") + .allowAnyOrganization(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}")); + CreateClientGrantResponseContent response = client.clientGrants() + .create(CreateClientGrantRequestContent.builder() + .clientId("client_id") + .audience("audience") + .scope(Arrays.asList("scope")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"client_id\": \"client_id\",\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ],\n" + + " \"organization_usage\": \"deny\",\n" + + " \"allow_any_organization\": true,\n" + + " \"is_system\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.clientGrants().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}")); + UpdateClientGrantResponseContent response = client.clientGrants() + .update("id", UpdateClientGrantRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ],\n" + + " \"organization_usage\": \"deny\",\n" + + " \"allow_any_organization\": true,\n" + + " \"is_system\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java new file mode 100644 index 000000000..934776918 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java @@ -0,0 +1,88 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientsConnectionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}],\"next\":\"next\"}")); + SyncPagingIterable response = client.clients() + .connections() + .get( + "id", + ConnectionsGetRequest.builder() + .from("from") + .take(1) + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java new file mode 100644 index 000000000..d1b3bb49e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java @@ -0,0 +1,383 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.clients.types.PatchClientCredentialRequestContent; +import com.auth0.client.mgmt.clients.types.PostClientCredentialRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ClientCredential; +import com.auth0.client.mgmt.types.ClientCredentialTypeEnum; +import com.auth0.client.mgmt.types.GetClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PatchClientCredentialResponseContent; +import com.auth0.client.mgmt.types.PostClientCredentialResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientsCredentialsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"name\":\"name\",\"kid\":\"kid\",\"alg\":\"RS256\",\"credential_type\":\"public_key\",\"subject_dn\":\"subject_dn\",\"thumbprint_sha256\":\"thumbprint_sha256\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\"}]")); + List response = client.clients().credentials().list("client_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"kid\": \"kid\",\n" + + " \"alg\": \"RS256\",\n" + + " \"credential_type\": \"public_key\",\n" + + " \"subject_dn\": \"subject_dn\",\n" + + " \"thumbprint_sha256\": \"thumbprint_sha256\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"kid\":\"kid\",\"alg\":\"RS256\",\"credential_type\":\"public_key\",\"subject_dn\":\"subject_dn\",\"thumbprint_sha256\":\"thumbprint_sha256\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\"}")); + PostClientCredentialResponseContent response = client.clients() + .credentials() + .create( + "client_id", + PostClientCredentialRequestContent.builder() + .credentialType(ClientCredentialTypeEnum.PUBLIC_KEY) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"credential_type\": \"public_key\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"kid\": \"kid\",\n" + + " \"alg\": \"RS256\",\n" + + " \"credential_type\": \"public_key\",\n" + + " \"subject_dn\": \"subject_dn\",\n" + + " \"thumbprint_sha256\": \"thumbprint_sha256\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"kid\":\"kid\",\"alg\":\"RS256\",\"credential_type\":\"public_key\",\"subject_dn\":\"subject_dn\",\"thumbprint_sha256\":\"thumbprint_sha256\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\"}")); + GetClientCredentialResponseContent response = + client.clients().credentials().get("client_id", "credential_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"kid\": \"kid\",\n" + + " \"alg\": \"RS256\",\n" + + " \"credential_type\": \"public_key\",\n" + + " \"subject_dn\": \"subject_dn\",\n" + + " \"thumbprint_sha256\": \"thumbprint_sha256\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.clients().credentials().delete("client_id", "credential_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"kid\":\"kid\",\"alg\":\"RS256\",\"credential_type\":\"public_key\",\"subject_dn\":\"subject_dn\",\"thumbprint_sha256\":\"thumbprint_sha256\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\"}")); + PatchClientCredentialResponseContent response = client.clients() + .credentials() + .update( + "client_id", + "credential_id", + PatchClientCredentialRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"kid\": \"kid\",\n" + + " \"alg\": \"RS256\",\n" + + " \"credential_type\": \"public_key\",\n" + + " \"subject_dn\": \"subject_dn\",\n" + + " \"thumbprint_sha256\": \"thumbprint_sha256\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java deleted file mode 100644 index d46008662..000000000 --- a/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java +++ /dev/null @@ -1,507 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ClientFilter; -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.client.Client; -import com.auth0.json.mgmt.client.ClientsPage; -import com.auth0.json.mgmt.client.Credential; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ClientsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListClientsWithoutFilter() throws Exception { - Request request = api.clients().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientsWithPage() throws Exception { - ClientFilter filter = new ClientFilter().withPage(23, 5); - Request request = api.clients().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientsWithTotals() throws Exception { - ClientFilter filter = new ClientFilter().withTotals(true); - Request request = api.clients().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_PAGED_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListClientsWithFields() throws Exception { - ClientFilter filter = new ClientFilter().withFields("some,random,fields", true); - Request request = api.clients().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_PAGED_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientsWithAdditionalProperties() throws Exception { - ClientFilter filter = new ClientFilter() - .withAppType("regular_web,native") - .withIsFirstParty(true) - .withIsGlobal(true); - Request request = api.clients().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("app_type", "regular_web,native")); - assertThat(recordedRequest, hasQueryParameter("is_first_party", "true")); - assertThat(recordedRequest, hasQueryParameter("is_global", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientsWithQuery() throws Exception { - ClientFilter filter = new ClientFilter().withQuery("client_grant.organization_id:" + "org_123"); - Request request = api.clients().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENTS_PAGED_LIST, 200); - ClientsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("q", "client_grant.organization_id:" + "org_123")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnGetClientWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().get(null), - "'client id' cannot be null!"); - } - - @Test - public void shouldGetClient() throws Exception { - Request request = api.clients().get("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetClientWithFilter() throws Exception { - FieldsFilter fieldsFilter = new FieldsFilter() - .withFields("name,client_id,app_type,tenant", true); - - Request request = api.clients().get("1", fieldsFilter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "name,client_id,app_type,tenant")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetClientWithNullFilter() throws Exception { - Request request = api.clients().get("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateClientWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().create(null), - "'client' cannot be null!"); - } - - @Test - public void shouldCreateClient() throws Exception { - Client clientCreate = new Client("My Application"); - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - - TokenQuota tokenQuota = new TokenQuota(clientCredentials); - clientCreate.setTokenQuota(tokenQuota); - Request request = api.clients().create(clientCreate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "My Application")); - - // Verify the token_quota structure - Map tokenQuotaMap = (Map) body.get("token_quota"); - assertThat(tokenQuotaMap, is(notNullValue())); - Map clientCredentialsMap = (Map) tokenQuotaMap.get("client_credentials"); - assertThat(clientCredentialsMap, is(notNullValue())); - assertThat(clientCredentialsMap, hasEntry("per_day", 100)); - assertThat(clientCredentialsMap, hasEntry("per_hour", 20)); - assertThat(clientCredentialsMap, hasEntry("enforce", true)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteClientWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().delete(null), - "'client id' cannot be null!"); - } - - @Test - public void shouldDeleteClient() throws Exception { - Request request = api.clients().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/clients/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateClientWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().update(null, new Client("name")), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateClientWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().update("clientId", null), - "'client' cannot be null!"); - } - - @Test - public void shouldUpdateClient() throws Exception { - Client clientUpdate = new Client( "My Application"); - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - - TokenQuota tokenQuota = new TokenQuota(clientCredentials); - clientUpdate.setTokenQuota(tokenQuota); - Request request = api.clients().update("1", clientUpdate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/clients/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "My Application")); - - Map tokenQuotaMap = (Map) body.get("token_quota"); - assertThat(tokenQuotaMap, is(notNullValue())); - Map clientCredentialsMap = (Map) tokenQuotaMap.get("client_credentials"); - assertThat(clientCredentialsMap, is(notNullValue())); - assertThat(clientCredentialsMap, hasEntry("per_day", 100)); - assertThat(clientCredentialsMap, hasEntry("per_hour", 20)); - assertThat(clientCredentialsMap, hasEntry("enforce", true)); - - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnRotateClientSecretWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().rotateSecret(null), - "'client id' cannot be null!"); - } - - @Test - public void shouldRotateClientSecret() throws Exception { - Request request = api.clients().rotateSecret("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT, 200); - Client response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/clients/1/rotate-secret")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Content-Length", "0")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldListClientCredentials() throws Exception { - Request> request = api.clients().listCredentials("clientId"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_CREDENTIAL_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients/clientId/credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnListCredentialsWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().listCredentials(null), - "'client id' cannot be null!"); - } - - @Test - public void shouldGetClientCredential() throws Exception { - Request request = api.clients().getCredential("clientId", "credId"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_CREDENTIAL, 200); - Credential response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/clients/clientId/credentials/credId")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetCredentialsWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().getCredential(null, "credId"), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnGetCredentialsWithNullCredentialId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().getCredential("clientId", null), - "'credential id' cannot be null!"); - } - - @Test - public void shouldCreateClientCredential() throws Exception { - Credential credential = new Credential("public_key", "pem"); - Request request = api.clients().createCredential("clientId", credential); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_CREDENTIAL, 201); - Credential response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/clients/clientId/credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("credential_type", "public_key")); - assertThat(body, hasEntry("pem", "pem")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateCredentialsWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().createCredential(null, new Credential()), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateCredentialsWithNullCredentialId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().deleteCredential("clientId", null), - "'credential id' cannot be null!"); - } - - @Test - public void shouldDeleteCredential() throws Exception { - Request request = api.clients().deleteCredential("clientId", "credId"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/clients/clientId/credentials/credId")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnDeleteCredentialsWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().deleteCredential(null, "credId"), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteCredentialsWithNullCredentialId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().deleteCredential("clientId", null), - "'credential id' cannot be null!"); - } - - @Test - public void shouldUpdateClientCredential() throws Exception { - Credential credential = new Credential(); - credential.setName("Updated credential name"); - Request request = api.clients().updateCredential("clientId", "credId", credential); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_CREDENTIAL, 200); - Credential response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/clients/clientId/credentials/credId")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("name", "Updated credential name")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateCredentialWithNullClientId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().updateCredential(null, "credId", new Credential()), - "'client id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateCredentialWithNullCredentialId() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().updateCredential("clientId", null, new Credential()), - "'credential id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateCredentialWithNullCredential() { - verifyThrows(IllegalArgumentException.class, - () -> api.clients().updateCredential("clientId", "credId", null), - "'credential' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java new file mode 100644 index 000000000..58ffee042 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java @@ -0,0 +1,1596 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Client; +import com.auth0.client.mgmt.types.CreateClientRequestContent; +import com.auth0.client.mgmt.types.CreateClientResponseContent; +import com.auth0.client.mgmt.types.GetClientRequestParameters; +import com.auth0.client.mgmt.types.GetClientResponseContent; +import com.auth0.client.mgmt.types.ListClientsRequestParameters; +import com.auth0.client.mgmt.types.RotateClientSecretResponseContent; +import com.auth0.client.mgmt.types.UpdateClientRequestContent; +import com.auth0.client.mgmt.types.UpdateClientResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"clients\":[{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"grant_types\":[\"grant_types\"],\"signing_keys\":[{}],\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\"},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{}}}]}")); + SyncPagingIterable response = client.clients() + .list(ListClientsRequestParameters.builder() + .fields("fields") + .includeFields(true) + .page(1) + .perPage(1) + .includeTotals(true) + .isGlobal(true) + .isFirstParty(true) + .appType("app_type") + .q("q") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + CreateClientResponseContent response = client.clients() + .create(CreateClientRequestContent.builder().name("name").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"client_id\": \"client_id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"global\": true,\n" + + " \"client_secret\": \"client_secret\",\n" + + " \"app_type\": \"app_type\",\n" + + " \"logo_uri\": \"logo_uri\",\n" + + " \"is_first_party\": true,\n" + + " \"oidc_conformant\": true,\n" + + " \"callbacks\": [\n" + + " \"callbacks\"\n" + + " ],\n" + + " \"allowed_origins\": [\n" + + " \"allowed_origins\"\n" + + " ],\n" + + " \"web_origins\": [\n" + + " \"web_origins\"\n" + + " ],\n" + + " \"client_aliases\": [\n" + + " \"client_aliases\"\n" + + " ],\n" + + " \"allowed_clients\": [\n" + + " \"allowed_clients\"\n" + + " ],\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_transfer\": {\n" + + " \"can_create_session_transfer_token\": true,\n" + + " \"allowed_authentication_methods\": [\n" + + " \"cookie\"\n" + + " ],\n" + + " \"enforce_device_binding\": \"ip\",\n" + + " \"allow_refresh_token\": true,\n" + + " \"enforce_online_refresh_tokens\": true,\n" + + " \"enforce_cascade_revocation\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"backchannel_logout_urls\": [\n" + + " \"backchannel_logout_urls\"\n" + + " ],\n" + + " \"backchannel_logout_initiators\": {\n" + + " \"mode\": \"custom\",\n" + + " \"selected_initiators\": [\n" + + " \"rp-logout\"\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"grant_types\": [\n" + + " \"grant_types\"\n" + + " ],\n" + + " \"jwt_configuration\": {\n" + + " \"lifetime_in_seconds\": 1,\n" + + " \"secret_encoded\": true,\n" + + " \"scopes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"alg\": \"HS256\"\n" + + " },\n" + + " \"signing_keys\": [\n" + + " {\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " }\n" + + " ],\n" + + " \"encryption_key\": {\n" + + " \"pub\": \"pub\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " },\n" + + " \"sso\": true,\n" + + " \"sso_disabled\": true,\n" + + " \"cross_origin_authentication\": true,\n" + + " \"cross_origin_loc\": \"cross_origin_loc\",\n" + + " \"custom_login_page_on\": true,\n" + + " \"custom_login_page\": \"custom_login_page\",\n" + + " \"custom_login_page_preview\": \"custom_login_page_preview\",\n" + + " \"form_template\": \"form_template\",\n" + + " \"addons\": {\n" + + " \"aws\": {\n" + + " \"principal\": \"principal\",\n" + + " \"role\": \"role\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"azure_blob\": {\n" + + " \"accountName\": \"accountName\",\n" + + " \"storageAccessKey\": \"storageAccessKey\",\n" + + " \"containerName\": \"containerName\",\n" + + " \"blobName\": \"blobName\",\n" + + " \"expiration\": 1,\n" + + " \"signedIdentifier\": \"signedIdentifier\",\n" + + " \"blob_read\": true,\n" + + " \"blob_write\": true,\n" + + " \"blob_delete\": true,\n" + + " \"container_read\": true,\n" + + " \"container_write\": true,\n" + + " \"container_delete\": true,\n" + + " \"container_list\": true\n" + + " },\n" + + " \"azure_sb\": {\n" + + " \"namespace\": \"namespace\",\n" + + " \"sasKeyName\": \"sasKeyName\",\n" + + " \"sasKey\": \"sasKey\",\n" + + " \"entityPath\": \"entityPath\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"rms\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"mscrm\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"slack\": {\n" + + " \"team\": \"team\"\n" + + " },\n" + + " \"sentry\": {\n" + + " \"org_slug\": \"org_slug\",\n" + + " \"base_url\": \"base_url\"\n" + + " },\n" + + " \"box\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"cloudbees\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"concur\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"dropbox\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"echosign\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"egnyte\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"firebase\": {\n" + + " \"secret\": \"secret\",\n" + + " \"private_key_id\": \"private_key_id\",\n" + + " \"private_key\": \"private_key\",\n" + + " \"client_email\": \"client_email\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"newrelic\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"office365\": {\n" + + " \"domain\": \"domain\",\n" + + " \"connection\": \"connection\"\n" + + " },\n" + + " \"salesforce\": {\n" + + " \"entity_id\": \"entity_id\"\n" + + " },\n" + + " \"salesforce_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"salesforce_sandbox_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"samlp\": {\n" + + " \"mappings\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"audience\": \"audience\",\n" + + " \"recipient\": \"recipient\",\n" + + " \"createUpnClaim\": true,\n" + + " \"mapUnknownClaimsAsIs\": true,\n" + + " \"passthroughClaimsWithNoMapping\": true,\n" + + " \"mapIdentities\": true,\n" + + " \"signatureAlgorithm\": \"signatureAlgorithm\",\n" + + " \"digestAlgorithm\": \"digestAlgorithm\",\n" + + " \"issuer\": \"issuer\",\n" + + " \"destination\": \"destination\",\n" + + " \"lifetimeInSeconds\": 1,\n" + + " \"signResponse\": true,\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\",\n" + + " \"nameIdentifierProbes\": [\n" + + " \"nameIdentifierProbes\"\n" + + " ],\n" + + " \"authnContextClassRef\": \"authnContextClassRef\"\n" + + " },\n" + + " \"layer\": {\n" + + " \"providerId\": \"providerId\",\n" + + " \"keyId\": \"keyId\",\n" + + " \"privateKey\": \"privateKey\",\n" + + " \"principal\": \"principal\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"sap_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"usernameAttribute\": \"usernameAttribute\",\n" + + " \"tokenEndpointUrl\": \"tokenEndpointUrl\",\n" + + " \"scope\": \"scope\",\n" + + " \"servicePassword\": \"servicePassword\",\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\"\n" + + " },\n" + + " \"sharepoint\": {\n" + + " \"url\": \"url\",\n" + + " \"external_url\": [\n" + + " \"external_url\"\n" + + " ]\n" + + " },\n" + + " \"springcm\": {\n" + + " \"acsurl\": \"acsurl\"\n" + + " },\n" + + " \"wams\": {\n" + + " \"masterkey\": \"masterkey\"\n" + + " },\n" + + " \"wsfed\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"zendesk\": {\n" + + " \"accountName\": \"accountName\"\n" + + " },\n" + + " \"zoom\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"sso_integration\": {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " },\n" + + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"client_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"mobile\": {\n" + + " \"android\": {\n" + + " \"app_package_name\": \"app_package_name\",\n" + + " \"sha256_cert_fingerprints\": [\n" + + " \"sha256_cert_fingerprints\"\n" + + " ]\n" + + " },\n" + + " \"ios\": {\n" + + " \"team_id\": \"team_id\",\n" + + " \"app_bundle_identifier\": \"app_bundle_identifier\"\n" + + " }\n" + + " },\n" + + " \"initiate_login_uri\": \"initiate_login_uri\",\n" + + " \"refresh_token\": {\n" + + " \"rotation_type\": \"rotating\",\n" + + " \"expiration_type\": \"expiring\",\n" + + " \"leeway\": 1,\n" + + " \"token_lifetime\": 1,\n" + + " \"infinite_token_lifetime\": true,\n" + + " \"idle_token_lifetime\": 1,\n" + + " \"infinite_idle_token_lifetime\": true\n" + + " },\n" + + " \"default_organization\": {\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"flows\": [\n" + + " \"client_credentials\"\n" + + " ]\n" + + " },\n" + + " \"organization_usage\": \"deny\",\n" + + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"client_authentication_methods\": {\n" + + " \"private_key_jwt\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"self_signed_tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"require_pushed_authorization_requests\": true,\n" + + " \"require_proof_of_possession\": true,\n" + + " \"signed_request_object\": {\n" + + " \"required\": true,\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"compliance_level\": \"none\",\n" + + " \"par_request_expiry\": 1,\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + GetClientResponseContent response = client.clients() + .get( + "id", + GetClientRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"client_id\": \"client_id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"global\": true,\n" + + " \"client_secret\": \"client_secret\",\n" + + " \"app_type\": \"app_type\",\n" + + " \"logo_uri\": \"logo_uri\",\n" + + " \"is_first_party\": true,\n" + + " \"oidc_conformant\": true,\n" + + " \"callbacks\": [\n" + + " \"callbacks\"\n" + + " ],\n" + + " \"allowed_origins\": [\n" + + " \"allowed_origins\"\n" + + " ],\n" + + " \"web_origins\": [\n" + + " \"web_origins\"\n" + + " ],\n" + + " \"client_aliases\": [\n" + + " \"client_aliases\"\n" + + " ],\n" + + " \"allowed_clients\": [\n" + + " \"allowed_clients\"\n" + + " ],\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_transfer\": {\n" + + " \"can_create_session_transfer_token\": true,\n" + + " \"allowed_authentication_methods\": [\n" + + " \"cookie\"\n" + + " ],\n" + + " \"enforce_device_binding\": \"ip\",\n" + + " \"allow_refresh_token\": true,\n" + + " \"enforce_online_refresh_tokens\": true,\n" + + " \"enforce_cascade_revocation\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"backchannel_logout_urls\": [\n" + + " \"backchannel_logout_urls\"\n" + + " ],\n" + + " \"backchannel_logout_initiators\": {\n" + + " \"mode\": \"custom\",\n" + + " \"selected_initiators\": [\n" + + " \"rp-logout\"\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"grant_types\": [\n" + + " \"grant_types\"\n" + + " ],\n" + + " \"jwt_configuration\": {\n" + + " \"lifetime_in_seconds\": 1,\n" + + " \"secret_encoded\": true,\n" + + " \"scopes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"alg\": \"HS256\"\n" + + " },\n" + + " \"signing_keys\": [\n" + + " {\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " }\n" + + " ],\n" + + " \"encryption_key\": {\n" + + " \"pub\": \"pub\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " },\n" + + " \"sso\": true,\n" + + " \"sso_disabled\": true,\n" + + " \"cross_origin_authentication\": true,\n" + + " \"cross_origin_loc\": \"cross_origin_loc\",\n" + + " \"custom_login_page_on\": true,\n" + + " \"custom_login_page\": \"custom_login_page\",\n" + + " \"custom_login_page_preview\": \"custom_login_page_preview\",\n" + + " \"form_template\": \"form_template\",\n" + + " \"addons\": {\n" + + " \"aws\": {\n" + + " \"principal\": \"principal\",\n" + + " \"role\": \"role\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"azure_blob\": {\n" + + " \"accountName\": \"accountName\",\n" + + " \"storageAccessKey\": \"storageAccessKey\",\n" + + " \"containerName\": \"containerName\",\n" + + " \"blobName\": \"blobName\",\n" + + " \"expiration\": 1,\n" + + " \"signedIdentifier\": \"signedIdentifier\",\n" + + " \"blob_read\": true,\n" + + " \"blob_write\": true,\n" + + " \"blob_delete\": true,\n" + + " \"container_read\": true,\n" + + " \"container_write\": true,\n" + + " \"container_delete\": true,\n" + + " \"container_list\": true\n" + + " },\n" + + " \"azure_sb\": {\n" + + " \"namespace\": \"namespace\",\n" + + " \"sasKeyName\": \"sasKeyName\",\n" + + " \"sasKey\": \"sasKey\",\n" + + " \"entityPath\": \"entityPath\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"rms\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"mscrm\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"slack\": {\n" + + " \"team\": \"team\"\n" + + " },\n" + + " \"sentry\": {\n" + + " \"org_slug\": \"org_slug\",\n" + + " \"base_url\": \"base_url\"\n" + + " },\n" + + " \"box\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"cloudbees\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"concur\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"dropbox\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"echosign\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"egnyte\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"firebase\": {\n" + + " \"secret\": \"secret\",\n" + + " \"private_key_id\": \"private_key_id\",\n" + + " \"private_key\": \"private_key\",\n" + + " \"client_email\": \"client_email\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"newrelic\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"office365\": {\n" + + " \"domain\": \"domain\",\n" + + " \"connection\": \"connection\"\n" + + " },\n" + + " \"salesforce\": {\n" + + " \"entity_id\": \"entity_id\"\n" + + " },\n" + + " \"salesforce_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"salesforce_sandbox_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"samlp\": {\n" + + " \"mappings\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"audience\": \"audience\",\n" + + " \"recipient\": \"recipient\",\n" + + " \"createUpnClaim\": true,\n" + + " \"mapUnknownClaimsAsIs\": true,\n" + + " \"passthroughClaimsWithNoMapping\": true,\n" + + " \"mapIdentities\": true,\n" + + " \"signatureAlgorithm\": \"signatureAlgorithm\",\n" + + " \"digestAlgorithm\": \"digestAlgorithm\",\n" + + " \"issuer\": \"issuer\",\n" + + " \"destination\": \"destination\",\n" + + " \"lifetimeInSeconds\": 1,\n" + + " \"signResponse\": true,\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\",\n" + + " \"nameIdentifierProbes\": [\n" + + " \"nameIdentifierProbes\"\n" + + " ],\n" + + " \"authnContextClassRef\": \"authnContextClassRef\"\n" + + " },\n" + + " \"layer\": {\n" + + " \"providerId\": \"providerId\",\n" + + " \"keyId\": \"keyId\",\n" + + " \"privateKey\": \"privateKey\",\n" + + " \"principal\": \"principal\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"sap_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"usernameAttribute\": \"usernameAttribute\",\n" + + " \"tokenEndpointUrl\": \"tokenEndpointUrl\",\n" + + " \"scope\": \"scope\",\n" + + " \"servicePassword\": \"servicePassword\",\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\"\n" + + " },\n" + + " \"sharepoint\": {\n" + + " \"url\": \"url\",\n" + + " \"external_url\": [\n" + + " \"external_url\"\n" + + " ]\n" + + " },\n" + + " \"springcm\": {\n" + + " \"acsurl\": \"acsurl\"\n" + + " },\n" + + " \"wams\": {\n" + + " \"masterkey\": \"masterkey\"\n" + + " },\n" + + " \"wsfed\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"zendesk\": {\n" + + " \"accountName\": \"accountName\"\n" + + " },\n" + + " \"zoom\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"sso_integration\": {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " },\n" + + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"client_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"mobile\": {\n" + + " \"android\": {\n" + + " \"app_package_name\": \"app_package_name\",\n" + + " \"sha256_cert_fingerprints\": [\n" + + " \"sha256_cert_fingerprints\"\n" + + " ]\n" + + " },\n" + + " \"ios\": {\n" + + " \"team_id\": \"team_id\",\n" + + " \"app_bundle_identifier\": \"app_bundle_identifier\"\n" + + " }\n" + + " },\n" + + " \"initiate_login_uri\": \"initiate_login_uri\",\n" + + " \"refresh_token\": {\n" + + " \"rotation_type\": \"rotating\",\n" + + " \"expiration_type\": \"expiring\",\n" + + " \"leeway\": 1,\n" + + " \"token_lifetime\": 1,\n" + + " \"infinite_token_lifetime\": true,\n" + + " \"idle_token_lifetime\": 1,\n" + + " \"infinite_idle_token_lifetime\": true\n" + + " },\n" + + " \"default_organization\": {\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"flows\": [\n" + + " \"client_credentials\"\n" + + " ]\n" + + " },\n" + + " \"organization_usage\": \"deny\",\n" + + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"client_authentication_methods\": {\n" + + " \"private_key_jwt\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"self_signed_tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"require_pushed_authorization_requests\": true,\n" + + " \"require_proof_of_possession\": true,\n" + + " \"signed_request_object\": {\n" + + " \"required\": true,\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"compliance_level\": \"none\",\n" + + " \"par_request_expiry\": 1,\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.clients().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + UpdateClientResponseContent response = client.clients() + .update("id", UpdateClientRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"client_id\": \"client_id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"global\": true,\n" + + " \"client_secret\": \"client_secret\",\n" + + " \"app_type\": \"app_type\",\n" + + " \"logo_uri\": \"logo_uri\",\n" + + " \"is_first_party\": true,\n" + + " \"oidc_conformant\": true,\n" + + " \"callbacks\": [\n" + + " \"callbacks\"\n" + + " ],\n" + + " \"allowed_origins\": [\n" + + " \"allowed_origins\"\n" + + " ],\n" + + " \"web_origins\": [\n" + + " \"web_origins\"\n" + + " ],\n" + + " \"client_aliases\": [\n" + + " \"client_aliases\"\n" + + " ],\n" + + " \"allowed_clients\": [\n" + + " \"allowed_clients\"\n" + + " ],\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_transfer\": {\n" + + " \"can_create_session_transfer_token\": true,\n" + + " \"allowed_authentication_methods\": [\n" + + " \"cookie\"\n" + + " ],\n" + + " \"enforce_device_binding\": \"ip\",\n" + + " \"allow_refresh_token\": true,\n" + + " \"enforce_online_refresh_tokens\": true,\n" + + " \"enforce_cascade_revocation\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"backchannel_logout_urls\": [\n" + + " \"backchannel_logout_urls\"\n" + + " ],\n" + + " \"backchannel_logout_initiators\": {\n" + + " \"mode\": \"custom\",\n" + + " \"selected_initiators\": [\n" + + " \"rp-logout\"\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"grant_types\": [\n" + + " \"grant_types\"\n" + + " ],\n" + + " \"jwt_configuration\": {\n" + + " \"lifetime_in_seconds\": 1,\n" + + " \"secret_encoded\": true,\n" + + " \"scopes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"alg\": \"HS256\"\n" + + " },\n" + + " \"signing_keys\": [\n" + + " {\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " }\n" + + " ],\n" + + " \"encryption_key\": {\n" + + " \"pub\": \"pub\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " },\n" + + " \"sso\": true,\n" + + " \"sso_disabled\": true,\n" + + " \"cross_origin_authentication\": true,\n" + + " \"cross_origin_loc\": \"cross_origin_loc\",\n" + + " \"custom_login_page_on\": true,\n" + + " \"custom_login_page\": \"custom_login_page\",\n" + + " \"custom_login_page_preview\": \"custom_login_page_preview\",\n" + + " \"form_template\": \"form_template\",\n" + + " \"addons\": {\n" + + " \"aws\": {\n" + + " \"principal\": \"principal\",\n" + + " \"role\": \"role\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"azure_blob\": {\n" + + " \"accountName\": \"accountName\",\n" + + " \"storageAccessKey\": \"storageAccessKey\",\n" + + " \"containerName\": \"containerName\",\n" + + " \"blobName\": \"blobName\",\n" + + " \"expiration\": 1,\n" + + " \"signedIdentifier\": \"signedIdentifier\",\n" + + " \"blob_read\": true,\n" + + " \"blob_write\": true,\n" + + " \"blob_delete\": true,\n" + + " \"container_read\": true,\n" + + " \"container_write\": true,\n" + + " \"container_delete\": true,\n" + + " \"container_list\": true\n" + + " },\n" + + " \"azure_sb\": {\n" + + " \"namespace\": \"namespace\",\n" + + " \"sasKeyName\": \"sasKeyName\",\n" + + " \"sasKey\": \"sasKey\",\n" + + " \"entityPath\": \"entityPath\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"rms\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"mscrm\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"slack\": {\n" + + " \"team\": \"team\"\n" + + " },\n" + + " \"sentry\": {\n" + + " \"org_slug\": \"org_slug\",\n" + + " \"base_url\": \"base_url\"\n" + + " },\n" + + " \"box\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"cloudbees\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"concur\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"dropbox\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"echosign\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"egnyte\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"firebase\": {\n" + + " \"secret\": \"secret\",\n" + + " \"private_key_id\": \"private_key_id\",\n" + + " \"private_key\": \"private_key\",\n" + + " \"client_email\": \"client_email\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"newrelic\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"office365\": {\n" + + " \"domain\": \"domain\",\n" + + " \"connection\": \"connection\"\n" + + " },\n" + + " \"salesforce\": {\n" + + " \"entity_id\": \"entity_id\"\n" + + " },\n" + + " \"salesforce_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"salesforce_sandbox_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"samlp\": {\n" + + " \"mappings\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"audience\": \"audience\",\n" + + " \"recipient\": \"recipient\",\n" + + " \"createUpnClaim\": true,\n" + + " \"mapUnknownClaimsAsIs\": true,\n" + + " \"passthroughClaimsWithNoMapping\": true,\n" + + " \"mapIdentities\": true,\n" + + " \"signatureAlgorithm\": \"signatureAlgorithm\",\n" + + " \"digestAlgorithm\": \"digestAlgorithm\",\n" + + " \"issuer\": \"issuer\",\n" + + " \"destination\": \"destination\",\n" + + " \"lifetimeInSeconds\": 1,\n" + + " \"signResponse\": true,\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\",\n" + + " \"nameIdentifierProbes\": [\n" + + " \"nameIdentifierProbes\"\n" + + " ],\n" + + " \"authnContextClassRef\": \"authnContextClassRef\"\n" + + " },\n" + + " \"layer\": {\n" + + " \"providerId\": \"providerId\",\n" + + " \"keyId\": \"keyId\",\n" + + " \"privateKey\": \"privateKey\",\n" + + " \"principal\": \"principal\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"sap_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"usernameAttribute\": \"usernameAttribute\",\n" + + " \"tokenEndpointUrl\": \"tokenEndpointUrl\",\n" + + " \"scope\": \"scope\",\n" + + " \"servicePassword\": \"servicePassword\",\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\"\n" + + " },\n" + + " \"sharepoint\": {\n" + + " \"url\": \"url\",\n" + + " \"external_url\": [\n" + + " \"external_url\"\n" + + " ]\n" + + " },\n" + + " \"springcm\": {\n" + + " \"acsurl\": \"acsurl\"\n" + + " },\n" + + " \"wams\": {\n" + + " \"masterkey\": \"masterkey\"\n" + + " },\n" + + " \"wsfed\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"zendesk\": {\n" + + " \"accountName\": \"accountName\"\n" + + " },\n" + + " \"zoom\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"sso_integration\": {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " },\n" + + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"client_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"mobile\": {\n" + + " \"android\": {\n" + + " \"app_package_name\": \"app_package_name\",\n" + + " \"sha256_cert_fingerprints\": [\n" + + " \"sha256_cert_fingerprints\"\n" + + " ]\n" + + " },\n" + + " \"ios\": {\n" + + " \"team_id\": \"team_id\",\n" + + " \"app_bundle_identifier\": \"app_bundle_identifier\"\n" + + " }\n" + + " },\n" + + " \"initiate_login_uri\": \"initiate_login_uri\",\n" + + " \"refresh_token\": {\n" + + " \"rotation_type\": \"rotating\",\n" + + " \"expiration_type\": \"expiring\",\n" + + " \"leeway\": 1,\n" + + " \"token_lifetime\": 1,\n" + + " \"infinite_token_lifetime\": true,\n" + + " \"idle_token_lifetime\": 1,\n" + + " \"infinite_idle_token_lifetime\": true\n" + + " },\n" + + " \"default_organization\": {\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"flows\": [\n" + + " \"client_credentials\"\n" + + " ]\n" + + " },\n" + + " \"organization_usage\": \"deny\",\n" + + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"client_authentication_methods\": {\n" + + " \"private_key_jwt\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"self_signed_tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"require_pushed_authorization_requests\": true,\n" + + " \"require_proof_of_possession\": true,\n" + + " \"signed_request_object\": {\n" + + " \"required\": true,\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"compliance_level\": \"none\",\n" + + " \"par_request_expiry\": 1,\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRotateSecret() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + RotateClientSecretResponseContent response = client.clients().rotateSecret("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"client_id\": \"client_id\",\n" + + " \"tenant\": \"tenant\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"global\": true,\n" + + " \"client_secret\": \"client_secret\",\n" + + " \"app_type\": \"app_type\",\n" + + " \"logo_uri\": \"logo_uri\",\n" + + " \"is_first_party\": true,\n" + + " \"oidc_conformant\": true,\n" + + " \"callbacks\": [\n" + + " \"callbacks\"\n" + + " ],\n" + + " \"allowed_origins\": [\n" + + " \"allowed_origins\"\n" + + " ],\n" + + " \"web_origins\": [\n" + + " \"web_origins\"\n" + + " ],\n" + + " \"client_aliases\": [\n" + + " \"client_aliases\"\n" + + " ],\n" + + " \"allowed_clients\": [\n" + + " \"allowed_clients\"\n" + + " ],\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_transfer\": {\n" + + " \"can_create_session_transfer_token\": true,\n" + + " \"allowed_authentication_methods\": [\n" + + " \"cookie\"\n" + + " ],\n" + + " \"enforce_device_binding\": \"ip\",\n" + + " \"allow_refresh_token\": true,\n" + + " \"enforce_online_refresh_tokens\": true,\n" + + " \"enforce_cascade_revocation\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"backchannel_logout_urls\": [\n" + + " \"backchannel_logout_urls\"\n" + + " ],\n" + + " \"backchannel_logout_initiators\": {\n" + + " \"mode\": \"custom\",\n" + + " \"selected_initiators\": [\n" + + " \"rp-logout\"\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"grant_types\": [\n" + + " \"grant_types\"\n" + + " ],\n" + + " \"jwt_configuration\": {\n" + + " \"lifetime_in_seconds\": 1,\n" + + " \"secret_encoded\": true,\n" + + " \"scopes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"alg\": \"HS256\"\n" + + " },\n" + + " \"signing_keys\": [\n" + + " {\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " }\n" + + " ],\n" + + " \"encryption_key\": {\n" + + " \"pub\": \"pub\",\n" + + " \"cert\": \"cert\",\n" + + " \"subject\": \"subject\"\n" + + " },\n" + + " \"sso\": true,\n" + + " \"sso_disabled\": true,\n" + + " \"cross_origin_authentication\": true,\n" + + " \"cross_origin_loc\": \"cross_origin_loc\",\n" + + " \"custom_login_page_on\": true,\n" + + " \"custom_login_page\": \"custom_login_page\",\n" + + " \"custom_login_page_preview\": \"custom_login_page_preview\",\n" + + " \"form_template\": \"form_template\",\n" + + " \"addons\": {\n" + + " \"aws\": {\n" + + " \"principal\": \"principal\",\n" + + " \"role\": \"role\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"azure_blob\": {\n" + + " \"accountName\": \"accountName\",\n" + + " \"storageAccessKey\": \"storageAccessKey\",\n" + + " \"containerName\": \"containerName\",\n" + + " \"blobName\": \"blobName\",\n" + + " \"expiration\": 1,\n" + + " \"signedIdentifier\": \"signedIdentifier\",\n" + + " \"blob_read\": true,\n" + + " \"blob_write\": true,\n" + + " \"blob_delete\": true,\n" + + " \"container_read\": true,\n" + + " \"container_write\": true,\n" + + " \"container_delete\": true,\n" + + " \"container_list\": true\n" + + " },\n" + + " \"azure_sb\": {\n" + + " \"namespace\": \"namespace\",\n" + + " \"sasKeyName\": \"sasKeyName\",\n" + + " \"sasKey\": \"sasKey\",\n" + + " \"entityPath\": \"entityPath\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"rms\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"mscrm\": {\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"slack\": {\n" + + " \"team\": \"team\"\n" + + " },\n" + + " \"sentry\": {\n" + + " \"org_slug\": \"org_slug\",\n" + + " \"base_url\": \"base_url\"\n" + + " },\n" + + " \"box\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"cloudbees\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"concur\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"dropbox\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"echosign\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"egnyte\": {\n" + + " \"domain\": \"domain\"\n" + + " },\n" + + " \"firebase\": {\n" + + " \"secret\": \"secret\",\n" + + " \"private_key_id\": \"private_key_id\",\n" + + " \"private_key\": \"private_key\",\n" + + " \"client_email\": \"client_email\",\n" + + " \"lifetime_in_seconds\": 1\n" + + " },\n" + + " \"newrelic\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"office365\": {\n" + + " \"domain\": \"domain\",\n" + + " \"connection\": \"connection\"\n" + + " },\n" + + " \"salesforce\": {\n" + + " \"entity_id\": \"entity_id\"\n" + + " },\n" + + " \"salesforce_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"salesforce_sandbox_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"principal\": \"principal\",\n" + + " \"communityName\": \"communityName\",\n" + + " \"community_url_section\": \"community_url_section\"\n" + + " },\n" + + " \"samlp\": {\n" + + " \"mappings\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"audience\": \"audience\",\n" + + " \"recipient\": \"recipient\",\n" + + " \"createUpnClaim\": true,\n" + + " \"mapUnknownClaimsAsIs\": true,\n" + + " \"passthroughClaimsWithNoMapping\": true,\n" + + " \"mapIdentities\": true,\n" + + " \"signatureAlgorithm\": \"signatureAlgorithm\",\n" + + " \"digestAlgorithm\": \"digestAlgorithm\",\n" + + " \"issuer\": \"issuer\",\n" + + " \"destination\": \"destination\",\n" + + " \"lifetimeInSeconds\": 1,\n" + + " \"signResponse\": true,\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\",\n" + + " \"nameIdentifierProbes\": [\n" + + " \"nameIdentifierProbes\"\n" + + " ],\n" + + " \"authnContextClassRef\": \"authnContextClassRef\"\n" + + " },\n" + + " \"layer\": {\n" + + " \"providerId\": \"providerId\",\n" + + " \"keyId\": \"keyId\",\n" + + " \"privateKey\": \"privateKey\",\n" + + " \"principal\": \"principal\",\n" + + " \"expiration\": 1\n" + + " },\n" + + " \"sap_api\": {\n" + + " \"clientid\": \"clientid\",\n" + + " \"usernameAttribute\": \"usernameAttribute\",\n" + + " \"tokenEndpointUrl\": \"tokenEndpointUrl\",\n" + + " \"scope\": \"scope\",\n" + + " \"servicePassword\": \"servicePassword\",\n" + + " \"nameIdentifierFormat\": \"nameIdentifierFormat\"\n" + + " },\n" + + " \"sharepoint\": {\n" + + " \"url\": \"url\",\n" + + " \"external_url\": [\n" + + " \"external_url\"\n" + + " ]\n" + + " },\n" + + " \"springcm\": {\n" + + " \"acsurl\": \"acsurl\"\n" + + " },\n" + + " \"wams\": {\n" + + " \"masterkey\": \"masterkey\"\n" + + " },\n" + + " \"wsfed\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"zendesk\": {\n" + + " \"accountName\": \"accountName\"\n" + + " },\n" + + " \"zoom\": {\n" + + " \"account\": \"account\"\n" + + " },\n" + + " \"sso_integration\": {\n" + + " \"name\": \"name\",\n" + + " \"version\": \"version\"\n" + + " }\n" + + " },\n" + + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"client_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"mobile\": {\n" + + " \"android\": {\n" + + " \"app_package_name\": \"app_package_name\",\n" + + " \"sha256_cert_fingerprints\": [\n" + + " \"sha256_cert_fingerprints\"\n" + + " ]\n" + + " },\n" + + " \"ios\": {\n" + + " \"team_id\": \"team_id\",\n" + + " \"app_bundle_identifier\": \"app_bundle_identifier\"\n" + + " }\n" + + " },\n" + + " \"initiate_login_uri\": \"initiate_login_uri\",\n" + + " \"refresh_token\": {\n" + + " \"rotation_type\": \"rotating\",\n" + + " \"expiration_type\": \"expiring\",\n" + + " \"leeway\": 1,\n" + + " \"token_lifetime\": 1,\n" + + " \"infinite_token_lifetime\": true,\n" + + " \"idle_token_lifetime\": 1,\n" + + " \"infinite_idle_token_lifetime\": true\n" + + " },\n" + + " \"default_organization\": {\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"flows\": [\n" + + " \"client_credentials\"\n" + + " ]\n" + + " },\n" + + " \"organization_usage\": \"deny\",\n" + + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"client_authentication_methods\": {\n" + + " \"private_key_jwt\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"self_signed_tls_client_auth\": {\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"require_pushed_authorization_requests\": true,\n" + + " \"require_proof_of_possession\": true,\n" + + " \"signed_request_object\": {\n" + + " \"required\": true,\n" + + " \"credentials\": [\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"compliance_level\": \"none\",\n" + + " \"par_request_expiry\": 1,\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java new file mode 100644 index 000000000..4f43f7159 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java @@ -0,0 +1,132 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionEnabledClient; +import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsClientsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"clients\":[{\"client_id\":\"client_id\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.connections() + .clients() + .get( + "id", + GetConnectionEnabledClientsRequestParameters.builder() + .take(1) + .from("from") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections() + .clients() + .update( + "id", + Arrays.asList(UpdateEnabledClientConnectionsRequestContentItem.builder() + .clientId("client_id") + .status(true) + .build())); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = + "" + "[\n" + " {\n" + " \"client_id\": \"client_id\",\n" + " \"status\": true\n" + " }\n" + "]"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java deleted file mode 100644 index bf19b4908..000000000 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java +++ /dev/null @@ -1,717 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ConnectionFilter; -import com.auth0.client.mgmt.filter.EnabledClientsFilter; -import com.auth0.json.mgmt.connections.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ConnectionsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListConnectionsWithoutFilter() throws Exception { - Request request = api.connections().listAll(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTIONS_LIST, 200); - ConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListConnectionsWithPage() throws Exception { - ConnectionFilter filter = new ConnectionFilter().withPage(23, 5); - Request request = api.connections().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTIONS_LIST, 200); - ConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListConnectionsWithTotals() throws Exception { - ConnectionFilter filter = new ConnectionFilter().withTotals(true); - Request request = api.connections().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTIONS_PAGED_LIST, 200); - ConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListConnectionsWithFrom() throws Exception { - ConnectionFilter filter = new ConnectionFilter().withFrom("10"); - Request request = api.connections().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTIONS_PAGED_LIST, 200); - ConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "10")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListConnectionsWithTake() throws Exception { - ConnectionFilter filter = new ConnectionFilter().withTake(1); - Request request = api.connections().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTIONS_PAGED_LIST, 200); - ConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("take", "1")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldThrowOnGetConnectionWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().get(null, null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetConnection() throws Exception { - Request request = api.connections().get("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - Connection response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetConnectionWithFields() throws Exception { - ConnectionFilter filter = new ConnectionFilter().withFields("some,random,fields", true); - Request request = api.connections().get("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - Connection response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateConnectionWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().create(null), - "'connection' cannot be null!"); - } - - @Test - public void shouldCreateConnection() throws Exception { - Connection createConnection = new Connection("my-connection", "auth0"); - createConnection.setDomainConnection(true); - createConnection.setShowAsButton(true); - Request request = api.connections().create(createConnection); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - Connection response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(4)); - assertThat(body, hasEntry("name", "my-connection")); - assertThat(body, hasEntry("strategy", "auth0")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteConnectionWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().delete(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldDeleteConnection() throws Exception { - Request request = api.connections().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/connections/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateConnectionWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().update(null, new Connection("my-connection", "auth0")), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateConnectionWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().update("1", null), - "'connection' cannot be null!"); - } - - @Test - public void shouldUpdateConnection() throws Exception { - Request request = api.connections().update("1", new Connection("my-connection", "auth0")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - Connection response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/connections/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "my-connection")); - assertThat(body, hasEntry("strategy", "auth0")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteConnectionUserWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().deleteUser(null, "user@domain.com"), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteConnectionUserWithNullEmail() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().deleteUser("1", null), - "'email' cannot be null!"); - } - - @Test - public void shouldDeleteConnectionUser() throws Exception { - Request request = api.connections().deleteUser("1", "user@domain.com"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/connections/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("email", "user@domain.com")); - } - - @Test - public void shouldThrowOnGetScimConfigurationWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().getScimConfiguration(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetScimConfiguration() throws Exception { - Request request = api.connections().getScimConfiguration("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_CONFIGURATION, 200); - ScimConfigurationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/scim-configuration")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteScimConfigurationWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().deleteScimConfiguration(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldDeleteScimConfiguration() throws Exception { - Request request = api.connections().deleteScimConfiguration("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_CONFIGURATION, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/connections/1/scim-configuration")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateScimConfigurationWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateScimConfiguration(null, null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateScimConfigurationWithNullScimConfigurationRequest() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateScimConfiguration("1", null), - "'scim configuration request' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateScimConfigurationWithNullUserIdAttribute() { - ScimConfigurationRequest request = new ScimConfigurationRequest(); - request.setMapping(getMappings()); - - verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateScimConfiguration("1", request), - "'user id attribute' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateScimConfigurationWithNullMapping() { - ScimConfigurationRequest request = new ScimConfigurationRequest(); - request.setUserIdAttribute("externalId"); - - verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateScimConfiguration("1", request), - "'mapping' cannot be null!"); - } - - @Test - public void shouldUpdateScimConfiguration() throws Exception { - ScimConfigurationRequest scimConfigurationRequest = getScimConfiguration(); - Request request = api.connections().updateScimConfiguration("1", scimConfigurationRequest); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_CONFIGURATION, 200); - ScimConfigurationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/connections/1/scim-configuration")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("user_id_attribute", "externalId")); - assertThat(body, hasKey("mapping")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateScimConfigurationWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().createScimConfiguration(null, getScimConfiguration()), - "'connection id' cannot be null!"); - } - - @Test - public void shouldCreateScimConfiguration() throws Exception { - ScimConfigurationRequest scimConfigurationRequest = getScimConfiguration(); - Request request = api.connections().createScimConfiguration("1", scimConfigurationRequest); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_CONFIGURATION, 200); - ScimConfigurationResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/connections/1/scim-configuration")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("user_id_attribute", "externalId")); - assertThat(body, hasKey("mapping")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetDefaultScimConfigurationWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().createScimConfiguration(null, getScimConfiguration()), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetDefaultScimConfiguration() throws Exception { - Request request = api.connections().getDefaultScimConfiguration("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_DEFAULT_SCIM_CONFIGURATION, 200); - DefaultScimMappingResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/scim-configuration/default-mapping")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetScimTokenWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().getScimToken(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetScimToken() throws Exception { - Request> request = api.connections().getScimToken("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_TOKENS, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/scim-configuration/tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.size(), is(2)); - } - - @Test - public void shouldThrowOnCreateScimTokenWithNullId() { - ScimTokenRequest request = getScimToken(); - - verifyThrows(IllegalArgumentException.class, - () -> api.connections().createScimToken(null, request), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateScimTokenWithNullScimTokenRequest() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().createScimToken("1", null), - "'scim token request' cannot be null!"); - } - - @Test - public void shouldCreateScimToken() throws Exception { - ScimTokenRequest scimTokenRequest = getScimToken(); - Request request = api.connections().createScimToken("1", scimTokenRequest); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_TOKEN, 200); - ScimTokenBaseResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/connections/1/scim-configuration/tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasKey("scopes")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteScimTokenWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().deleteScimToken(null, "1"), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteScimTokenWithNullTokenId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().deleteScimToken("1", null), - "'token id' cannot be null!"); - } - - @Test - public void shouldDeleteScimToken() throws Exception { - Request request = api.connections().deleteScimToken("1", "1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_SCIM_CONFIGURATION, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/connections/1/scim-configuration/tokens/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnCheckConnectionStatusWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().checkConnectionStatus(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldCheckConnectionStatus() throws Exception { - Request request = api.connections().checkConnectionStatus("1"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/status")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnGetEnabledClientsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().getEnabledClients(null, new EnabledClientsFilter()), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetEnabledClientsWithoutFilter() throws Exception { - Request request = api.connections().getEnabledClients("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ENABLED_CLIENTS_FOR_CONNECTION, 200); - EnabledClientResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getClients(), hasSize(2)); - } - - @Test - public void shouldGetEnabledClientsWithFromFilter() throws Exception { - EnabledClientsFilter filter = new EnabledClientsFilter().withFrom("1"); - Request request = api.connections().getEnabledClients("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ENABLED_CLIENTS_FOR_CONNECTION, 200); - EnabledClientResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "1")); - - assertThat(response, is(notNullValue())); - assertThat(response.getClients(), hasSize(2)); - } - - @Test - public void shouldGetEnabledClientsWithTakeFilter() throws Exception { - EnabledClientsFilter filter = new EnabledClientsFilter().withTake(2); - Request request = api.connections().getEnabledClients("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ENABLED_CLIENTS_FOR_CONNECTION, 200); - EnabledClientResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("take", "2")); - - assertThat(response, is(notNullValue())); - assertThat(response.getClients(), hasSize(2)); - } - - @Test - public void shouldThrowOnUpdateEnabledClientsWithNullId() { - EnabledClientRequest clientRequest = new EnabledClientRequest("clientId", true); - List enabledClientRequests = new ArrayList<>(); - enabledClientRequests.add(clientRequest); - verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateEnabledClients(null, enabledClientRequests), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateEnabledClientsWithNullRequest() { -; verifyThrows(IllegalArgumentException.class, - () -> api.connections().updateEnabledClients("1", null), - "'enabled client Request' cannot be null!"); - } - - - @Test - public void shouldUpdateEnabledClients() throws Exception { - EnabledClientRequest clientRequest = new EnabledClientRequest("clientId", true); - List enabledClientRequests = new ArrayList<>(); - enabledClientRequests.add(clientRequest); - Request request = api.connections().updateEnabledClients("1", enabledClientRequests); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ENABLED_CLIENTS_FOR_CONNECTION, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/connections/1/clients")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - List body = bodyListFromRequest(recordedRequest); - assertThat(body, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetKeysWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().getKeys(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldGetKeys() throws Exception { - Request> request = api.connections().getKeys("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION_KEY, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/keys")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnRotateKeyWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.connections().rotateKey(null), - "'connection id' cannot be null!"); - } - - @Test - public void shouldRotateKey() throws Exception { - Request request = api.connections().rotateKey("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROTATE_KEY, 200); - RotateKey response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/connections/1/keys/rotate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - private ScimTokenRequest getScimToken() { - ScimTokenRequest request = new ScimTokenRequest(); - List scopes = new ArrayList<>(); - scopes.add("get:users"); - request.setScopes(scopes); - request.setTokenLifetime(1000); - return request; - } - - private ScimConfigurationRequest getScimConfiguration() { - ScimConfigurationRequest request = new ScimConfigurationRequest(); - request.setUserIdAttribute("externalId"); - request.setMapping(getMappings()); - return request; - } - - private List getMappings() { - List mappingList = new ArrayList<>(); - mappingList.add(new Mapping("user_id", "id")); - return mappingList; - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java new file mode 100644 index 000000000..27d4d40f9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java @@ -0,0 +1,184 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.ConnectionKey; +import com.auth0.client.mgmt.types.RotateConnectionsKeysResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsKeysWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"kid\":\"kid\",\"cert\":\"cert\",\"pkcs\":\"pkcs\",\"current\":true,\"next\":true,\"previous\":true,\"current_since\":\"current_since\",\"fingerprint\":\"fingerprint\",\"thumbprint\":\"thumbprint\",\"algorithm\":\"algorithm\",\"key_use\":\"encryption\",\"subject_dn\":\"subject_dn\"}]")); + List response = client.connections().keys().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"kid\": \"kid\",\n" + + " \"cert\": \"cert\",\n" + + " \"pkcs\": \"pkcs\",\n" + + " \"current\": true,\n" + + " \"next\": true,\n" + + " \"previous\": true,\n" + + " \"current_since\": \"current_since\",\n" + + " \"fingerprint\": \"fingerprint\",\n" + + " \"thumbprint\": \"thumbprint\",\n" + + " \"algorithm\": \"algorithm\",\n" + + " \"key_use\": \"encryption\",\n" + + " \"subject_dn\": \"subject_dn\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRotate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"kid\":\"kid\",\"cert\":\"cert\",\"pkcs\":\"pkcs\",\"next\":true,\"fingerprint\":\"fingerprint\",\"thumbprint\":\"thumbprint\",\"algorithm\":\"algorithm\",\"key_use\":\"encryption\",\"subject_dn\":\"subject_dn\"}")); + RotateConnectionsKeysResponseContent response = + client.connections().keys().rotate("id", OptionalNullable.absent()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"kid\": \"kid\",\n" + + " \"cert\": \"cert\",\n" + + " \"pkcs\": \"pkcs\",\n" + + " \"next\": true,\n" + + " \"fingerprint\": \"fingerprint\",\n" + + " \"thumbprint\": \"thumbprint\",\n" + + " \"algorithm\": \"algorithm\",\n" + + " \"key_use\": \"encryption\",\n" + + " \"subject_dn\": \"subject_dn\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java new file mode 100644 index 000000000..585566390 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java @@ -0,0 +1,218 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.scimconfiguration.types.CreateScimTokenRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateScimTokenResponseContent; +import com.auth0.client.mgmt.types.ScimTokenItem; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsScimConfigurationTokensWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"token_id\":\"token_id\",\"scopes\":[\"scopes\"],\"created_at\":\"created_at\",\"valid_until\":\"valid_until\",\"last_used_at\":\"last_used_at\"}]")); + List response = + client.connections().scimConfiguration().tokens().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"token_id\": \"token_id\",\n" + + " \"scopes\": [\n" + + " \"scopes\"\n" + + " ],\n" + + " \"created_at\": \"created_at\",\n" + + " \"valid_until\": \"valid_until\",\n" + + " \"last_used_at\": \"last_used_at\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"token_id\":\"token_id\",\"token\":\"token\",\"scopes\":[\"scopes\"],\"created_at\":\"created_at\",\"valid_until\":\"valid_until\"}")); + CreateScimTokenResponseContent response = client.connections() + .scimConfiguration() + .tokens() + .create("id", CreateScimTokenRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"token_id\": \"token_id\",\n" + + " \"token\": \"token\",\n" + + " \"scopes\": [\n" + + " \"scopes\"\n" + + " ],\n" + + " \"created_at\": \"created_at\",\n" + + " \"valid_until\": \"valid_until\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections().scimConfiguration().tokens().delete("id", "tokenId"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java new file mode 100644 index 000000000..1bf4b22a4 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java @@ -0,0 +1,359 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.types.UpdateScimConfigurationRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.CreateScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetScimConfigurationResponseContent; +import com.auth0.client.mgmt.types.ScimMappingItem; +import com.auth0.client.mgmt.types.UpdateScimConfigurationResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsScimConfigurationWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"tenant_name\":\"tenant_name\",\"user_id_attribute\":\"user_id_attribute\",\"mapping\":[{\"auth0\":\"auth0\",\"scim\":\"scim\"}],\"created_at\":\"created_at\",\"updated_on\":\"updated_on\"}")); + GetScimConfigurationResponseContent response = + client.connections().scimConfiguration().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"tenant_name\": \"tenant_name\",\n" + + " \"user_id_attribute\": \"user_id_attribute\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"scim\": \"scim\"\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_on\": \"updated_on\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"tenant_name\":\"tenant_name\",\"user_id_attribute\":\"user_id_attribute\",\"mapping\":[{\"auth0\":\"auth0\",\"scim\":\"scim\"}],\"created_at\":\"created_at\",\"updated_on\":\"updated_on\"}")); + CreateScimConfigurationResponseContent response = + client.connections().scimConfiguration().create("id", OptionalNullable.absent()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"tenant_name\": \"tenant_name\",\n" + + " \"user_id_attribute\": \"user_id_attribute\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"scim\": \"scim\"\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_on\": \"updated_on\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections().scimConfiguration().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"tenant_name\":\"tenant_name\",\"user_id_attribute\":\"user_id_attribute\",\"mapping\":[{\"auth0\":\"auth0\",\"scim\":\"scim\"}],\"created_at\":\"created_at\",\"updated_on\":\"updated_on\"}")); + UpdateScimConfigurationResponseContent response = client.connections() + .scimConfiguration() + .update( + "id", + UpdateScimConfigurationRequestContent.builder() + .userIdAttribute("user_id_attribute") + .mapping(Arrays.asList(ScimMappingItem.builder().build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"user_id_attribute\": \"user_id_attribute\",\n" + + " \"mapping\": [\n" + + " {}\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"tenant_name\": \"tenant_name\",\n" + + " \"user_id_attribute\": \"user_id_attribute\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"scim\": \"scim\"\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_on\": \"updated_on\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetDefaultMapping() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"mapping\":[{\"auth0\":\"auth0\",\"scim\":\"scim\"}]}")); + GetScimConfigurationDefaultMappingResponseContent response = + client.connections().scimConfiguration().getDefaultMapping("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"scim\": \"scim\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java new file mode 100644 index 000000000..57acdee43 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java @@ -0,0 +1,74 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.connections.types.DeleteConnectionUsersByEmailQueryParameters; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsUsersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testDeleteByEmail() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections() + .users() + .deleteByEmail( + "id", + DeleteConnectionUsersByEmailQueryParameters.builder() + .email("email") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java new file mode 100644 index 000000000..2b5ae2802 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java @@ -0,0 +1,381 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionForList; +import com.auth0.client.mgmt.types.ConnectionIdentityProviderEnum; +import com.auth0.client.mgmt.types.CreateConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionResponseContent; +import com.auth0.client.mgmt.types.GetConnectionRequestParameters; +import com.auth0.client.mgmt.types.GetConnectionResponseContent; +import com.auth0.client.mgmt.types.ListConnectionsQueryParameters; +import com.auth0.client.mgmt.types.UpdateConnectionRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}]}")); + SyncPagingIterable response = client.connections() + .list(ListConnectionsQueryParameters.builder() + .from("from") + .take(1) + .name("name") + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + CreateConnectionResponseContent response = client.connections() + .create(CreateConnectionRequestContent.builder() + .name("name") + .strategy(ConnectionIdentityProviderEnum.AD) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\",\n" + " \"strategy\": \"ad\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"options\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"id\": \"id\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"realms\": [\n" + + " \"realms\"\n" + + " ],\n" + + " \"enabled_clients\": [\n" + + " \"enabled_clients\"\n" + + " ],\n" + + " \"is_domain_connection\": true,\n" + + " \"show_as_button\": true,\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + GetConnectionResponseContent response = client.connections() + .get( + "id", + GetConnectionRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"options\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"id\": \"id\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"realms\": [\n" + + " \"realms\"\n" + + " ],\n" + + " \"enabled_clients\": [\n" + + " \"enabled_clients\"\n" + + " ],\n" + + " \"is_domain_connection\": true,\n" + + " \"show_as_button\": true,\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + UpdateConnectionResponseContent response = client.connections() + .update("id", UpdateConnectionRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"options\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"id\": \"id\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"realms\": [\n" + + " \"realms\"\n" + + " ],\n" + + " \"enabled_clients\": [\n" + + " \"enabled_clients\"\n" + + " ],\n" + + " \"is_domain_connection\": true,\n" + + " \"show_as_button\": true,\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCheckStatus() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections().checkStatus("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java new file mode 100644 index 000000000..d4737366f --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java @@ -0,0 +1,505 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.CustomDomain; +import com.auth0.client.mgmt.types.CustomDomainProvisioningTypeEnum; +import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; +import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; +import com.auth0.client.mgmt.types.VerifyCustomDomainResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class CustomDomainsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}]")); + List response = client.customDomains().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"custom_domain_id\": \"custom_domain_id\",\n" + + " \"domain\": \"domain\",\n" + + " \"primary\": true,\n" + + " \"type\": \"auth0_managed_certs\",\n" + + " \"origin_domain_name\": \"origin_domain_name\",\n" + + " \"verification\": {\n" + + " \"methods\": [\n" + + " {\n" + + " \"name\": \"cname\",\n" + + " \"record\": \"record\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" + + " \"tls_policy\": \"tls_policy\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + CreateCustomDomainResponseContent response = client.customDomains() + .create(CreateCustomDomainRequestContent.builder() + .domain("domain") + .type(CustomDomainProvisioningTypeEnum.AUTH0MANAGED_CERTS) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = + "" + "{\n" + " \"domain\": \"domain\",\n" + " \"type\": \"auth0_managed_certs\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"custom_domain_id\": \"custom_domain_id\",\n" + + " \"domain\": \"domain\",\n" + + " \"primary\": true,\n" + + " \"type\": \"auth0_managed_certs\",\n" + + " \"verification\": {\n" + + " \"methods\": [\n" + + " {\n" + + " \"name\": \"cname\",\n" + + " \"record\": \"record\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" + + " \"tls_policy\": \"tls_policy\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + GetCustomDomainResponseContent response = client.customDomains().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"custom_domain_id\": \"custom_domain_id\",\n" + + " \"domain\": \"domain\",\n" + + " \"primary\": true,\n" + + " \"type\": \"auth0_managed_certs\",\n" + + " \"origin_domain_name\": \"origin_domain_name\",\n" + + " \"verification\": {\n" + + " \"methods\": [\n" + + " {\n" + + " \"name\": \"cname\",\n" + + " \"record\": \"record\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" + + " \"tls_policy\": \"tls_policy\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.customDomains().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + UpdateCustomDomainResponseContent response = client.customDomains() + .update("id", UpdateCustomDomainRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"custom_domain_id\": \"custom_domain_id\",\n" + + " \"domain\": \"domain\",\n" + + " \"primary\": true,\n" + + " \"type\": \"auth0_managed_certs\",\n" + + " \"verification\": {\n" + + " \"methods\": [\n" + + " {\n" + + " \"name\": \"cname\",\n" + + " \"record\": \"record\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" + + " \"tls_policy\": \"tls_policy\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testTest() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"success\":true,\"message\":\"message\"}")); + TestCustomDomainResponseContent response = client.customDomains().test("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"success\": true,\n" + " \"message\": \"message\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testVerify() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"cname_api_key\":\"cname_api_key\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + VerifyCustomDomainResponseContent response = client.customDomains().verify("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"custom_domain_id\": \"custom_domain_id\",\n" + + " \"domain\": \"domain\",\n" + + " \"primary\": true,\n" + + " \"type\": \"auth0_managed_certs\",\n" + + " \"cname_api_key\": \"cname_api_key\",\n" + + " \"origin_domain_name\": \"origin_domain_name\",\n" + + " \"verification\": {\n" + + " \"methods\": [\n" + + " {\n" + + " \"name\": \"cname\",\n" + + " \"record\": \"record\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" + + " \"tls_policy\": \"tls_policy\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java deleted file mode 100644 index 8bcfbf76f..000000000 --- a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.AssertsUtil; -import com.auth0.client.mgmt.filter.DeviceCredentialsFilter; -import com.auth0.json.mgmt.devicecredentials.DeviceCredentials; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class DeviceCredentialsEntityTest extends BaseMgmtEntityTest { - @Test - public void shouldListDeviceCredentials() throws Exception { - Request> request = api.deviceCredentials().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldListDeviceCredentialsWithClientId() throws Exception { - DeviceCredentialsFilter filter = new DeviceCredentialsFilter().withClientId("client_23"); - Request> request = api.deviceCredentials().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("client_id", "client_23")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldListDeviceCredentialsWithUserId() throws Exception { - DeviceCredentialsFilter filter = new DeviceCredentialsFilter().withUserId("user_23"); - Request> request = api.deviceCredentials().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("user_id", "user_23")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - - @Test - public void shouldListDeviceCredentialsWithType() throws Exception { - DeviceCredentialsFilter filter = new DeviceCredentialsFilter().withType("public_key"); - Request> request = api.deviceCredentials().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("type", "public_key")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - - @Test - public void shouldListDeviceCredentialsWithFields() throws Exception { - DeviceCredentialsFilter filter = new DeviceCredentialsFilter().withFields("some,random,fields", true); - Request> request = api.deviceCredentials().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldReturnEmptyDeviceCredentials() throws Exception { - Request> request = api.deviceCredentials().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(DeviceCredentials.class))); - } - - @Test - public void shouldThrowOnCreateDeviceCredentialsWithNullData() { - AssertsUtil.verifyThrows(IllegalArgumentException.class, - () -> api.deviceCredentials().create(null), - "'device credentials' cannot be null!"); - } - - @Test - public void shouldCreateDeviceCredentials() throws Exception { - Request request = api.deviceCredentials().create(new DeviceCredentials("device", "public_key", "val123", "id123", "clientId")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS, 200); - DeviceCredentials response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/device-credentials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(5)); - assertThat(body, hasEntry("device_name", "device")); - assertThat(body, hasEntry("type", "public_key")); - assertThat(body, hasEntry("value", "val123")); - assertThat(body, hasEntry("device_id", "id123")); - assertThat(body, hasEntry("client_id", "clientId")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteDeviceCredentialsWithNullId() { - AssertsUtil.verifyThrows(IllegalArgumentException.class, - () -> api.deviceCredentials().delete(null), - "'device credentials id' cannot be null!"); - } - - @Test - public void shouldDeleteDeviceCredentials() throws Exception { - Request request = api.deviceCredentials().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DEVICE_CREDENTIALS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/device-credentials/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java new file mode 100644 index 000000000..8c710e153 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java @@ -0,0 +1,185 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; +import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; +import com.auth0.client.mgmt.types.DeviceCredential; +import com.auth0.client.mgmt.types.DeviceCredentialTypeEnum; +import com.auth0.client.mgmt.types.ListDeviceCredentialsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class DeviceCredentialsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"device_credentials\":[{\"id\":\"id\",\"device_name\":\"device_name\",\"device_id\":\"device_id\",\"type\":\"public_key\",\"user_id\":\"user_id\",\"client_id\":\"client_id\"}]}")); + SyncPagingIterable response = client.deviceCredentials() + .list(ListDeviceCredentialsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .fields("fields") + .includeFields(true) + .userId("user_id") + .clientId("client_id") + .type(DeviceCredentialTypeEnum.PUBLIC_KEY) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreatePublicKey() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"id\":\"id\"}")); + CreatePublicKeyDeviceCredentialResponseContent response = client.deviceCredentials() + .createPublicKey(CreatePublicKeyDeviceCredentialRequestContent.builder() + .deviceName("device_name") + .type("public_key") + .value("value") + .deviceId("device_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"device_name\": \"device_name\",\n" + + " \"type\": \"public_key\",\n" + + " \"value\": \"value\",\n" + + " \"device_id\": \"device_id\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"id\": \"id\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.deviceCredentials().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java b/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java new file mode 100644 index 000000000..f0dab602d --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java @@ -0,0 +1,400 @@ +package com.auth0.client.mgmt; + +import static org.junit.jupiter.api.Assertions.*; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Environment; +import com.auth0.client.mgmt.core.RequestOptions; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** + * Comprehensive tests to verify that Fern-generated Auth0 SDK supports + * dynamic token management using Supplier. + */ +public class DynamicTokenManagementTest { + + @Test + @DisplayName("Verify Supplier is evaluated on each request") + public void testSupplierEvaluatedOnEachRequest() { + // Counter to track supplier evaluations + AtomicInteger evaluationCount = new AtomicInteger(0); + + // Create dynamic token supplier + Supplier tokenSupplier = () -> { + int count = evaluationCount.incrementAndGet(); + return "token-" + count; + }; + + // Build ClientOptions with dynamic header + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) + .build(); + + // First request - should evaluate supplier + Map headers1 = options.headers(null); + assertEquals("Bearer token-1", headers1.get("Authorization")); + assertEquals(1, evaluationCount.get()); + + // Second request - should evaluate supplier again + Map headers2 = options.headers(null); + assertEquals("Bearer token-2", headers2.get("Authorization")); + assertEquals(2, evaluationCount.get()); + + // Third request - should evaluate supplier again + Map headers3 = options.headers(null); + assertEquals("Bearer token-3", headers3.get("Authorization")); + assertEquals(3, evaluationCount.get()); + + System.out.println("✅ Supplier is evaluated on each request: " + evaluationCount.get() + " times"); + } + + @Test + @DisplayName("Test automatic token refresh on expiry") + public void testAutomaticTokenRefreshOnExpiry() { + // Simulated token storage with expiry + class TokenStore { + private String token; + private long expiryTime; + private int refreshCount = 0; + + synchronized String getToken() { + if (token == null || System.currentTimeMillis() >= expiryTime) { + refreshCount++; + token = "refreshed-token-" + refreshCount; + expiryTime = System.currentTimeMillis() + 1000; // 1 second expiry + System.out.println("Token refreshed: " + token); + } + return token; + } + + int getRefreshCount() { + return refreshCount; + } + } + + TokenStore tokenStore = new TokenStore(); + + // Build ClientOptions with token store + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> "Bearer " + tokenStore.getToken()) + .build(); + + // First request - initial token + Map headers1 = options.headers(null); + assertEquals("Bearer refreshed-token-1", headers1.get("Authorization")); + assertEquals(1, tokenStore.getRefreshCount()); + + // Second request immediately - should use cached token + Map headers2 = options.headers(null); + assertEquals("Bearer refreshed-token-1", headers2.get("Authorization")); + assertEquals(1, tokenStore.getRefreshCount()); // No refresh + + // Wait for token to expire + try { + Thread.sleep(1100); // 1.1 seconds + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + + // Third request after expiry - should refresh + Map headers3 = options.headers(null); + assertEquals("Bearer refreshed-token-2", headers3.get("Authorization")); + assertEquals(2, tokenStore.getRefreshCount()); // Token refreshed + + System.out.println("✅ Token automatically refreshed " + tokenStore.getRefreshCount() + " times"); + } + + @Test + @DisplayName("Verify static and dynamic headers coexist") + public void testStaticAndDynamicHeadersCoexist() { + AtomicInteger dynamicCounter = new AtomicInteger(0); + + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("X-Static-Header", "static-value") // Static + .addHeader("X-Dynamic-Header", () -> "dynamic-" + dynamicCounter.incrementAndGet()) // Dynamic + .addHeader("X-Another-Static", "another-static") // Static + .build(); + + // First request + Map headers1 = options.headers(null); + assertEquals("static-value", headers1.get("X-Static-Header")); + assertEquals("dynamic-1", headers1.get("X-Dynamic-Header")); + assertEquals("another-static", headers1.get("X-Another-Static")); + + // Second request - static should remain same, dynamic should change + Map headers2 = options.headers(null); + assertEquals("static-value", headers2.get("X-Static-Header")); + assertEquals("dynamic-2", headers2.get("X-Dynamic-Header")); + assertEquals("another-static", headers2.get("X-Another-Static")); + + System.out.println("✅ Static and dynamic headers coexist correctly"); + } + + @Test + @DisplayName("Test multiple dynamic headers with different suppliers") + public void testMultipleDynamicHeaders() { + AtomicInteger authCounter = new AtomicInteger(0); + AtomicInteger requestIdCounter = new AtomicInteger(100); + AtomicReference sessionId = new AtomicReference<>("session-initial"); + + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> "Bearer token-" + authCounter.incrementAndGet()) + .addHeader("X-Request-ID", () -> "req-" + requestIdCounter.addAndGet(10)) + .addHeader("X-Session-ID", sessionId::get) + .addHeader("X-Timestamp", () -> String.valueOf(System.currentTimeMillis())) + .build(); + + // First request + Map headers1 = options.headers(null); + assertEquals("Bearer token-1", headers1.get("Authorization")); + assertEquals("req-110", headers1.get("X-Request-ID")); + assertEquals("session-initial", headers1.get("X-Session-ID")); + String timestamp1 = headers1.get("X-Timestamp"); + assertNotNull(timestamp1); + + // Update session ID + sessionId.set("session-updated"); + + // Small delay for timestamp + try { + Thread.sleep(10); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + + // Second request + Map headers2 = options.headers(null); + assertEquals("Bearer token-2", headers2.get("Authorization")); + assertEquals("req-120", headers2.get("X-Request-ID")); + assertEquals("session-updated", headers2.get("X-Session-ID")); + String timestamp2 = headers2.get("X-Timestamp"); + assertNotEquals(timestamp1, timestamp2); + + System.out.println("✅ Multiple dynamic headers work independently"); + } + + @Test + @DisplayName("Test RequestOptions override dynamic headers") + public void testRequestOptionsOverrideDynamicHeaders() { + AtomicInteger dynamicCounter = new AtomicInteger(0); + + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> "Bearer dynamic-" + dynamicCounter.incrementAndGet()) + .addHeader("X-Header", "client-level") + .build(); + + // Request without override + Map headers1 = options.headers(null); + assertEquals("Bearer dynamic-1", headers1.get("Authorization")); + assertEquals("client-level", headers1.get("X-Header")); + + // Request with RequestOptions override + RequestOptions requestOptions = RequestOptions.builder() + .addHeader("Authorization", "Bearer request-override") + .addHeader("X-Header", "request-level") + .addHeader("X-New-Header", "new-value") + .build(); + + Map headers2 = options.headers(requestOptions); + assertEquals("Bearer request-override", headers2.get("Authorization")); // Overridden + assertEquals("request-level", headers2.get("X-Header")); // Overridden + assertEquals("new-value", headers2.get("X-New-Header")); // Added + + // Verify dynamic supplier was still called (even though overridden) + assertEquals(2, dynamicCounter.get()); + + System.out.println("✅ RequestOptions correctly override dynamic headers"); + } + + @Test + @DisplayName("Test ManagementApi uses dynamic headers") + public void testManagementApiUsesDynamicHeaders() throws Exception { + AtomicInteger tokenVersion = new AtomicInteger(0); + + // Build ManagementApi with dynamic token + ClientOptions clientOptions = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> { + int version = tokenVersion.incrementAndGet(); + System.out.println("Token supplier called: version " + version); + return "Bearer dynamic-token-v" + version; + }) + .build(); + ManagementApi api = new ManagementApi(clientOptions); + + // No need for reflection anymore, we have direct access to clientOptions + + // Verify dynamic header is evaluated on each call + Map headers1 = clientOptions.headers(null); + assertEquals("Bearer dynamic-token-v1", headers1.get("Authorization")); + + Map headers2 = clientOptions.headers(null); + assertEquals("Bearer dynamic-token-v2", headers2.get("Authorization")); + + Map headers3 = clientOptions.headers(null); + assertEquals("Bearer dynamic-token-v3", headers3.get("Authorization")); + + assertEquals(3, tokenVersion.get()); + System.out.println("✅ ManagementApi correctly uses dynamic headers"); + } + + @Test + @DisplayName("Test thread safety of dynamic headers") + public void testThreadSafetyOfDynamicHeaders() throws Exception { + AtomicInteger globalCounter = new AtomicInteger(0); + + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("X-Thread-ID", () -> Thread.currentThread().getName()) + .addHeader("X-Counter", () -> String.valueOf(globalCounter.incrementAndGet())) + .build(); + + // Run multiple threads concurrently + int threadCount = 10; + Thread[] threads = new Thread[threadCount]; + String[] results = new String[threadCount]; + + for (int i = 0; i < threadCount; i++) { + final int index = i; + threads[i] = new Thread( + () -> { + Map headers = options.headers(null); + results[index] = headers.get("X-Thread-ID"); + }, + "TestThread-" + i); + } + + // Start all threads + for (Thread thread : threads) { + thread.start(); + } + + // Wait for all threads to complete + for (Thread thread : threads) { + thread.join(); + } + + // Verify each thread got its own thread name + for (int i = 0; i < threadCount; i++) { + assertEquals("TestThread-" + i, results[i]); + } + + // Verify counter was incremented correctly + assertEquals(threadCount, globalCounter.get()); + + System.out.println("✅ Dynamic headers are thread-safe"); + } + + @Test + @DisplayName("Test supplier exception handling") + public void testSupplierExceptionHandling() { + AtomicInteger callCount = new AtomicInteger(0); + + ClientOptions options = ClientOptions.builder() + .environment(Environment.custom("https://test.auth0.com/api/v2")) + .addHeader("Authorization", () -> { + int count = callCount.incrementAndGet(); + if (count == 2) { + throw new RuntimeException("Simulated token fetch failure"); + } + return "Bearer token-" + count; + }) + .build(); + + // First call - should work + Map headers1 = options.headers(null); + assertEquals("Bearer token-1", headers1.get("Authorization")); + + // Second call - supplier throws exception + assertThrows(RuntimeException.class, () -> { + options.headers(null); + }); + + // Third call - should work again + Map headers3 = options.headers(null); + assertEquals("Bearer token-3", headers3.get("Authorization")); + + assertEquals(3, callCount.get()); + System.out.println("✅ Supplier exceptions are properly propagated"); + } + + @Test + @DisplayName("Verify Auth0 real-world scenario: M2M token refresh") + public void testAuth0MachineToMachineTokenRefresh() { + // Simulate Auth0 M2M token management + class Auth0TokenManager { + private String accessToken; + private long expiresAt; + private final String clientId = "test-client-id"; + private final String clientSecret = "test-client-secret"; + private int tokenFetchCount = 0; + + synchronized String getAccessToken() { + if (accessToken == null || System.currentTimeMillis() >= expiresAt) { + // Simulate fetching new M2M token + tokenFetchCount++; + accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.mock-m2m-token-" + tokenFetchCount; + expiresAt = System.currentTimeMillis() + 86400000; // 24 hours + System.out.println("Fetched new M2M token (fetch #" + tokenFetchCount + ")"); + } + return accessToken; + } + + void expireToken() { + expiresAt = 0; // Force expiry + } + + int getTokenFetchCount() { + return tokenFetchCount; + } + } + + Auth0TokenManager tokenManager = new Auth0TokenManager(); + + // Build ManagementApi with Auth0 token manager + ClientOptions clientOptions = ClientOptions.builder() + .environment(Environment.custom("https://myapp.auth0.com/api/v2")) + .addHeader("Authorization", () -> "Bearer " + tokenManager.getAccessToken()) + .build(); + ManagementApi api = new ManagementApi(clientOptions); + + // Simulate API calls + try { + + // First API call - fetches initial token + Map headers1 = clientOptions.headers(null); + assertTrue(headers1.get("Authorization").startsWith("Bearer eyJhbGciOiJSUzI1NiI")); + assertEquals(1, tokenManager.getTokenFetchCount()); + + // Multiple API calls - reuse same token + for (int i = 0; i < 5; i++) { + Map headers = clientOptions.headers(null); + assertTrue(headers.get("Authorization").contains("mock-m2m-token-1")); + } + assertEquals(1, tokenManager.getTokenFetchCount()); // Still only 1 fetch + + // Expire token + tokenManager.expireToken(); + + // Next API call - fetches new token + Map headersAfterExpiry = clientOptions.headers(null); + assertTrue(headersAfterExpiry.get("Authorization").contains("mock-m2m-token-2")); + assertEquals(2, tokenManager.getTokenFetchCount()); + + System.out.println("✅ Auth0 M2M token refresh scenario works correctly"); + + } catch (Exception e) { + fail("Test failed: " + e.getMessage()); + } + } +} diff --git a/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java b/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java deleted file mode 100644 index 0ac03337c..000000000 --- a/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.emailproviders.EmailProvider; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_EMAIL_PROVIDER; -import static com.auth0.client.MockServer.bodyFromRequest; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class EmailProviderEntityTest extends BaseMgmtEntityTest { - @Test - public void shouldGetEmailProvider() throws Exception { - Request request = api.emailProvider().get(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/emails/provider")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetEmailProviderWithFields() throws Exception { - FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true); - Request request = api.emailProvider().get(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/emails/provider")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnSetupEmailProviderWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.emailProvider().setup(null), - "'email provider' cannot be null!"); - } - - @Test - public void shouldSetupEmailProvider() throws Exception { - Request request = api.emailProvider().setup(new EmailProvider("provider")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/emails/provider")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("name", "provider")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldDeleteEmailProvider() throws Exception { - Request request = api.emailProvider().delete(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/emails/provider")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateEmailProviderWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.emailProvider().update(null), - "'email provider' cannot be null!"); - } - - @Test - public void shouldUpdateEmailProvider() throws Exception { - Request request = api.emailProvider().update(new EmailProvider("name")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/emails/provider")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("name", "name")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/EmailTemplatesEntityTest.java b/src/test/java/com/auth0/client/mgmt/EmailTemplatesEntityTest.java deleted file mode 100644 index bfdec1fe8..000000000 --- a/src/test/java/com/auth0/client/mgmt/EmailTemplatesEntityTest.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.emailtemplates.EmailTemplate; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -@SuppressWarnings("RedundantThrows") -public class EmailTemplatesEntityTest extends BaseMgmtEntityTest { - @Test - public void shouldGetEmailTemplate() throws Exception { - Request request = api.emailTemplates().get("welcome_email"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_TEMPLATE, 200); - EmailTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/email-templates/welcome_email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetEmailTemplateWithNullName() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.emailTemplates().get(null), - "'template name' cannot be null!"); - } - - @Test - public void shouldCreateEmailTemplate() throws Exception { - EmailTemplate template = new EmailTemplate(); - template.setName("welcome_email"); - template.setBody("Welcome!!"); - template.setFrom("auth0.com"); - template.setSubject("Welcome"); - template.setSyntax("liquid"); - template.setEnabled(true); - - Request request = api.emailTemplates().create(template); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/email-templates")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(6)); - assertThat(body, hasEntry("template", "welcome_email")); - assertThat(body, hasEntry("body", "Welcome!!")); - assertThat(body, hasEntry("from", "auth0.com")); - assertThat(body, hasEntry("syntax", "liquid")); - assertThat(body, hasEntry("subject", "Welcome")); - assertThat(body, hasEntry("enabled", true)); - assertThat(body, not(hasKey("resultUrl"))); - assertThat(body, not(hasKey("urlLifetimeInSeconds"))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateEmailTemplateWithNullData() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.emailTemplates().create(null), - "'template' cannot be null!"); - } - - @Test - public void shouldPatchEmailTemplate() throws Exception { - EmailTemplate template = new EmailTemplate(); - template.setBody("New"); - template.setUrlLifetimeInSeconds(123); - template.setResultUrl("https://somewhere.com"); - - Request request = api.emailTemplates().update("welcome_email", template); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - EmailTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/email-templates/welcome_email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(4)); - assertThat(body, hasEntry("resultUrl", "https://somewhere.com")); - assertThat(body, hasEntry("body", "New")); - assertThat(body, hasEntry("syntax", "liquid")); - assertThat(body, hasEntry("urlLifetimeInSeconds", 123)); - assertThat(body, not(hasKey("template"))); - assertThat(body, not(hasKey("from"))); - assertThat(body, not(hasKey("enabled"))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnPatchEmailTemplateWithNullData() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.emailTemplates().update("welcome_email", null), - "'template' cannot be null!"); - } - - @Test - public void shouldThrowOnPatchEmailTemplateWithNullName() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.emailTemplates().update(null, new EmailTemplate()), - "'template name' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java new file mode 100644 index 000000000..3ec5a0a25 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java @@ -0,0 +1,396 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.CreateEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.EmailTemplateNameEnum; +import com.auth0.client.mgmt.types.GetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.SetEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.SetEmailTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateRequestContent; +import com.auth0.client.mgmt.types.UpdateEmailTemplateResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class EmailTemplatesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"template\":\"verify_email\",\"body\":\"body\",\"from\":\"from\",\"resultUrl\":\"resultUrl\",\"subject\":\"subject\",\"syntax\":\"syntax\",\"urlLifetimeInSeconds\":1.1,\"includeEmailInRedirect\":true,\"enabled\":true}")); + CreateEmailTemplateResponseContent response = client.emailTemplates() + .create(CreateEmailTemplateRequestContent.builder() + .template(EmailTemplateNameEnum.VERIFY_EMAIL) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"template\": \"verify_email\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"template\": \"verify_email\",\n" + + " \"body\": \"body\",\n" + + " \"from\": \"from\",\n" + + " \"resultUrl\": \"resultUrl\",\n" + + " \"subject\": \"subject\",\n" + + " \"syntax\": \"syntax\",\n" + + " \"urlLifetimeInSeconds\": 1.1,\n" + + " \"includeEmailInRedirect\": true,\n" + + " \"enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"template\":\"verify_email\",\"body\":\"body\",\"from\":\"from\",\"resultUrl\":\"resultUrl\",\"subject\":\"subject\",\"syntax\":\"syntax\",\"urlLifetimeInSeconds\":1.1,\"includeEmailInRedirect\":true,\"enabled\":true}")); + GetEmailTemplateResponseContent response = client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"template\": \"verify_email\",\n" + + " \"body\": \"body\",\n" + + " \"from\": \"from\",\n" + + " \"resultUrl\": \"resultUrl\",\n" + + " \"subject\": \"subject\",\n" + + " \"syntax\": \"syntax\",\n" + + " \"urlLifetimeInSeconds\": 1.1,\n" + + " \"includeEmailInRedirect\": true,\n" + + " \"enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"template\":\"verify_email\",\"body\":\"body\",\"from\":\"from\",\"resultUrl\":\"resultUrl\",\"subject\":\"subject\",\"syntax\":\"syntax\",\"urlLifetimeInSeconds\":1.1,\"includeEmailInRedirect\":true,\"enabled\":true}")); + SetEmailTemplateResponseContent response = client.emailTemplates() + .set( + EmailTemplateNameEnum.VERIFY_EMAIL, + SetEmailTemplateRequestContent.builder() + .template(EmailTemplateNameEnum.VERIFY_EMAIL) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"template\": \"verify_email\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"template\": \"verify_email\",\n" + + " \"body\": \"body\",\n" + + " \"from\": \"from\",\n" + + " \"resultUrl\": \"resultUrl\",\n" + + " \"subject\": \"subject\",\n" + + " \"syntax\": \"syntax\",\n" + + " \"urlLifetimeInSeconds\": 1.1,\n" + + " \"includeEmailInRedirect\": true,\n" + + " \"enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"template\":\"verify_email\",\"body\":\"body\",\"from\":\"from\",\"resultUrl\":\"resultUrl\",\"subject\":\"subject\",\"syntax\":\"syntax\",\"urlLifetimeInSeconds\":1.1,\"includeEmailInRedirect\":true,\"enabled\":true}")); + UpdateEmailTemplateResponseContent response = client.emailTemplates() + .update( + EmailTemplateNameEnum.VERIFY_EMAIL, + UpdateEmailTemplateRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"template\": \"verify_email\",\n" + + " \"body\": \"body\",\n" + + " \"from\": \"from\",\n" + + " \"resultUrl\": \"resultUrl\",\n" + + " \"subject\": \"subject\",\n" + + " \"syntax\": \"syntax\",\n" + + " \"urlLifetimeInSeconds\": 1.1,\n" + + " \"includeEmailInRedirect\": true,\n" + + " \"enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java b/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java new file mode 100644 index 000000000..f5cc834a6 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java @@ -0,0 +1,340 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; +import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; +import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; +import com.auth0.client.mgmt.types.CreateEmailProviderResponseContent; +import com.auth0.client.mgmt.types.EmailProviderCredentialsSchema; +import com.auth0.client.mgmt.types.EmailProviderCredentialsSchemaZero; +import com.auth0.client.mgmt.types.EmailProviderNameEnum; +import com.auth0.client.mgmt.types.GetEmailProviderResponseContent; +import com.auth0.client.mgmt.types.UpdateEmailProviderResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class EmailsProviderWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"enabled\":true,\"default_from_address\":\"default_from_address\",\"credentials\":{\"api_user\":\"api_user\",\"region\":\"region\",\"smtp_host\":\"smtp_host\",\"smtp_port\":1,\"smtp_user\":\"smtp_user\"},\"settings\":{\"key\":\"value\"}}")); + GetEmailProviderResponseContent response = client.emails() + .provider() + .get(GetEmailProviderRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"default_from_address\": \"default_from_address\",\n" + + " \"credentials\": {\n" + + " \"api_user\": \"api_user\",\n" + + " \"region\": \"region\",\n" + + " \"smtp_host\": \"smtp_host\",\n" + + " \"smtp_port\": 1,\n" + + " \"smtp_user\": \"smtp_user\"\n" + + " },\n" + + " \"settings\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"enabled\":true,\"default_from_address\":\"default_from_address\",\"credentials\":{\"api_user\":\"api_user\",\"region\":\"region\",\"smtp_host\":\"smtp_host\",\"smtp_port\":1,\"smtp_user\":\"smtp_user\"},\"settings\":{\"key\":\"value\"}}")); + CreateEmailProviderResponseContent response = client.emails() + .provider() + .create(CreateEmailProviderRequestContent.builder() + .name(EmailProviderNameEnum.MAILGUN) + .credentials(EmailProviderCredentialsSchema.of(EmailProviderCredentialsSchemaZero.builder() + .apiKey("api_key") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"mailgun\",\n" + + " \"credentials\": {\n" + + " \"api_key\": \"api_key\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"default_from_address\": \"default_from_address\",\n" + + " \"credentials\": {\n" + + " \"api_user\": \"api_user\",\n" + + " \"region\": \"region\",\n" + + " \"smtp_host\": \"smtp_host\",\n" + + " \"smtp_port\": 1,\n" + + " \"smtp_user\": \"smtp_user\"\n" + + " },\n" + + " \"settings\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.emails().provider().delete(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"enabled\":true,\"default_from_address\":\"default_from_address\",\"credentials\":{\"api_user\":\"api_user\",\"region\":\"region\",\"smtp_host\":\"smtp_host\",\"smtp_port\":1,\"smtp_user\":\"smtp_user\"},\"settings\":{\"key\":\"value\"}}")); + UpdateEmailProviderResponseContent response = client.emails() + .provider() + .update(UpdateEmailProviderRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"default_from_address\": \"default_from_address\",\n" + + " \"credentials\": {\n" + + " \"api_user\": \"api_user\",\n" + + " \"region\": \"region\",\n" + + " \"smtp_host\": \"smtp_host\",\n" + + " \"smtp_port\": 1,\n" + + " \"smtp_user\": \"smtp_user\"\n" + + " },\n" + + " \"settings\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java new file mode 100644 index 000000000..1b8877388 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java @@ -0,0 +1,211 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; +import com.auth0.client.mgmt.types.EventStreamDelivery; +import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class EventStreamsDeliveriesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"event_stream_id\":\"event_stream_id\",\"status\":\"failed\",\"event_type\":\"user.created\",\"attempts\":[{\"status\":\"failed\",\"timestamp\":\"2024-01-15T09:30:00Z\"}],\"event\":{\"id\":\"id\",\"source\":\"source\",\"specversion\":\"specversion\",\"type\":\"type\",\"time\":\"2024-01-15T09:30:00Z\",\"data\":\"data\"}}]")); + List response = client.eventStreams() + .deliveries() + .list( + "id", + ListEventStreamDeliveriesRequestParameters.builder() + .statuses("statuses") + .eventTypes("event_types") + .dateFrom("date_from") + .dateTo("date_to") + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"event_stream_id\": \"event_stream_id\",\n" + + " \"status\": \"failed\",\n" + + " \"event_type\": \"user.created\",\n" + + " \"attempts\": [\n" + + " {\n" + + " \"status\": \"failed\",\n" + + " \"timestamp\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ],\n" + + " \"event\": {\n" + + " \"id\": \"id\",\n" + + " \"source\": \"source\",\n" + + " \"specversion\": \"specversion\",\n" + + " \"type\": \"type\",\n" + + " \"time\": \"2024-01-15T09:30:00Z\",\n" + + " \"data\": \"data\"\n" + + " }\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetHistory() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"event_stream_id\":\"event_stream_id\",\"status\":\"failed\",\"event_type\":\"user.created\",\"attempts\":[{\"status\":\"failed\",\"timestamp\":\"2024-01-15T09:30:00Z\",\"error_message\":\"error_message\"}],\"event\":{\"id\":\"id\",\"source\":\"source\",\"specversion\":\"specversion\",\"type\":\"type\",\"time\":\"2024-01-15T09:30:00Z\",\"data\":\"data\"}}")); + GetEventStreamDeliveryHistoryResponseContent response = + client.eventStreams().deliveries().getHistory("id", "event_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"event_stream_id\": \"event_stream_id\",\n" + + " \"status\": \"failed\",\n" + + " \"event_type\": \"user.created\",\n" + + " \"attempts\": [\n" + + " {\n" + + " \"status\": \"failed\",\n" + + " \"timestamp\": \"2024-01-15T09:30:00Z\",\n" + + " \"error_message\": \"error_message\"\n" + + " }\n" + + " ],\n" + + " \"event\": {\n" + + " \"id\": \"id\",\n" + + " \"source\": \"source\",\n" + + " \"specversion\": \"specversion\",\n" + + " \"type\": \"type\",\n" + + " \"time\": \"2024-01-15T09:30:00Z\",\n" + + " \"data\": \"data\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java new file mode 100644 index 000000000..1401c0f28 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java @@ -0,0 +1,159 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.eventstreams.types.CreateEventStreamRedeliveryRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamRedeliveryResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class EventStreamsRedeliveriesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"date_from\":\"2024-01-15T09:30:00Z\",\"date_to\":\"2024-01-15T09:30:00Z\",\"statuses\":[\"failed\"],\"event_types\":[\"user.created\"]}")); + CreateEventStreamRedeliveryResponseContent response = client.eventStreams() + .redeliveries() + .create( + "id", + CreateEventStreamRedeliveryRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"date_from\": \"2024-01-15T09:30:00Z\",\n" + + " \"date_to\": \"2024-01-15T09:30:00Z\",\n" + + " \"statuses\": [\n" + + " \"failed\"\n" + + " ],\n" + + " \"event_types\": [\n" + + " \"user.created\"\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreateById() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.eventStreams().redeliveries().createById("id", "event_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java new file mode 100644 index 000000000..f50181459 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java @@ -0,0 +1,628 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; +import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; +import com.auth0.client.mgmt.types.CreateEventStreamWebHookRequestContent; +import com.auth0.client.mgmt.types.EventStreamResponseContent; +import com.auth0.client.mgmt.types.EventStreamTestEventTypeEnum; +import com.auth0.client.mgmt.types.EventStreamWebhookAuthorizationResponse; +import com.auth0.client.mgmt.types.EventStreamWebhookBasicAuth; +import com.auth0.client.mgmt.types.EventStreamWebhookConfiguration; +import com.auth0.client.mgmt.types.EventStreamWebhookDestination; +import com.auth0.client.mgmt.types.EventStreamsCreateRequest; +import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; +import com.auth0.client.mgmt.types.GetEventStreamResponseContent; +import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; +import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class EventStreamsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]")); + List response = client.eventStreams() + .list(ListEventStreamsRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subscriptions\": [\n" + + " {}\n" + + " ],\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"status\": \"enabled\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{\"event_type\":\"event_type\"}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + CreateEventStreamResponseContent response = client.eventStreams() + .create(EventStreamsCreateRequest.of(CreateEventStreamWebHookRequestContent.builder() + .destination(EventStreamWebhookDestination.builder() + .type("webhook") + .configuration(EventStreamWebhookConfiguration.builder() + .webhookEndpoint("webhook_endpoint") + .webhookAuthorization(EventStreamWebhookAuthorizationResponse.of( + EventStreamWebhookBasicAuth.builder() + .method("basic") + .username("username") + .build())) + .build()) + .build()) + .build())); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subscriptions\": [\n" + + " {\n" + + " \"event_type\": \"event_type\"\n" + + " }\n" + + " ],\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"status\": \"enabled\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{\"event_type\":\"event_type\"}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetEventStreamResponseContent response = client.eventStreams().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subscriptions\": [\n" + + " {\n" + + " \"event_type\": \"event_type\"\n" + + " }\n" + + " ],\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"status\": \"enabled\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.eventStreams().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{\"event_type\":\"event_type\"}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateEventStreamResponseContent response = client.eventStreams() + .update("id", UpdateEventStreamRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subscriptions\": [\n" + + " {\n" + + " \"event_type\": \"event_type\"\n" + + " }\n" + + " ],\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"status\": \"enabled\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetStats() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"window\":{\"date_from\":\"2024-01-15T09:30:00Z\",\"date_to\":\"2024-01-15T09:30:00Z\",\"bucket_interval\":{\"scale_factor\":1}},\"buckets\":[\"2024-01-15T09:30:00Z\"],\"metrics\":[{\"name\":\"name\",\"window_total\":1.1,\"type\":\"type\",\"data\":[1.1]}]}")); + GetEventStreamStatsResponseContent response = client.eventStreams() + .getStats( + "id", + EventStreamsGetStatsRequest.builder() + .dateFrom("date_from") + .dateTo("date_to") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"window\": {\n" + + " \"date_from\": \"2024-01-15T09:30:00Z\",\n" + + " \"date_to\": \"2024-01-15T09:30:00Z\",\n" + + " \"bucket_interval\": {\n" + + " \"scale_factor\": 1\n" + + " }\n" + + " },\n" + + " \"buckets\": [\n" + + " \"2024-01-15T09:30:00Z\"\n" + + " ],\n" + + " \"metrics\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"window_total\": 1.1,\n" + + " \"type\": \"type\",\n" + + " \"data\": [\n" + + " 1.1\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testTest() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"event_stream_id\":\"event_stream_id\",\"status\":\"failed\",\"event_type\":\"user.created\",\"attempts\":[{\"status\":\"failed\",\"timestamp\":\"2024-01-15T09:30:00Z\",\"error_message\":\"error_message\"}],\"event\":{\"id\":\"id\",\"source\":\"source\",\"specversion\":\"specversion\",\"type\":\"type\",\"time\":\"2024-01-15T09:30:00Z\",\"data\":\"data\"}}")); + CreateEventStreamTestEventResponseContent response = client.eventStreams() + .test( + "id", + CreateEventStreamTestEventRequestContent.builder() + .eventType(EventStreamTestEventTypeEnum.USER_CREATED) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"event_type\": \"user.created\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"event_stream_id\": \"event_stream_id\",\n" + + " \"status\": \"failed\",\n" + + " \"event_type\": \"user.created\",\n" + + " \"attempts\": [\n" + + " {\n" + + " \"status\": \"failed\",\n" + + " \"timestamp\": \"2024-01-15T09:30:00Z\",\n" + + " \"error_message\": \"error_message\"\n" + + " }\n" + + " ],\n" + + " \"event\": {\n" + + " \"id\": \"id\",\n" + + " \"source\": \"source\",\n" + + " \"specversion\": \"specversion\",\n" + + " \"type\": \"type\",\n" + + " \"time\": \"2024-01-15T09:30:00Z\",\n" + + " \"data\": \"data\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java b/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java new file mode 100644 index 000000000..187d64e52 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java @@ -0,0 +1,156 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; +import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; +import com.auth0.client.mgmt.types.FlowExecutionSummary; +import com.auth0.client.mgmt.types.GetFlowExecutionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class FlowsExecutionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"executions\":[{\"id\":\"id\",\"trace_id\":\"trace_id\",\"journey_id\":\"journey_id\",\"status\":\"status\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"started_at\":\"2024-01-15T09:30:00Z\",\"ended_at\":\"2024-01-15T09:30:00Z\"}]}")); + SyncPagingIterable response = client.flows() + .executions() + .list( + "flow_id", + ExecutionsListRequest.builder().from("from").take(1).build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"trace_id\":\"trace_id\",\"journey_id\":\"journey_id\",\"status\":\"status\",\"debug\":{\"key\":\"value\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"started_at\":\"2024-01-15T09:30:00Z\",\"ended_at\":\"2024-01-15T09:30:00Z\"}")); + GetFlowExecutionResponseContent response = client.flows() + .executions() + .get("flow_id", "execution_id", ExecutionsGetRequest.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"trace_id\": \"trace_id\",\n" + + " \"journey_id\": \"journey_id\",\n" + + " \"status\": \"status\",\n" + + " \"debug\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"started_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"ended_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.flows().executions().delete("flow_id", "execution_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java b/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java new file mode 100644 index 000000000..17bd6646e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java @@ -0,0 +1,365 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateFlowRequestContent; +import com.auth0.client.mgmt.types.CreateFlowResponseContent; +import com.auth0.client.mgmt.types.FlowSummary; +import com.auth0.client.mgmt.types.FlowsListRequest; +import com.auth0.client.mgmt.types.GetFlowRequestParameters; +import com.auth0.client.mgmt.types.GetFlowResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowRequestContent; +import com.auth0.client.mgmt.types.UpdateFlowResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class FlowsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"flows\":[{\"id\":\"id\",\"name\":\"name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"executed_at\":\"executed_at\"}]}")); + SyncPagingIterable response = client.flows() + .list(FlowsListRequest.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .synchronous(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"actions\":[{\"id\":\"id\",\"alias\":\"alias\",\"type\":\"ACTIVECAMPAIGN\",\"action\":\"LIST_CONTACTS\",\"allow_failure\":true,\"mask_output\":true,\"params\":{\"connection_id\":\"connection_id\",\"email\":\"email\"}}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"executed_at\":\"executed_at\"}")); + CreateFlowResponseContent response = client.flows() + .create(CreateFlowRequestContent.builder().name("name").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"actions\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"alias\": \"alias\",\n" + + " \"type\": \"ACTIVECAMPAIGN\",\n" + + " \"action\": \"LIST_CONTACTS\",\n" + + " \"allow_failure\": true,\n" + + " \"mask_output\": true,\n" + + " \"params\": {\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"email\": \"email\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"executed_at\": \"executed_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"actions\":[{\"id\":\"id\",\"alias\":\"alias\",\"type\":\"ACTIVECAMPAIGN\",\"action\":\"LIST_CONTACTS\",\"allow_failure\":true,\"mask_output\":true,\"params\":{\"connection_id\":\"connection_id\",\"email\":\"email\"}}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"executed_at\":\"executed_at\"}")); + GetFlowResponseContent response = + client.flows().get("id", GetFlowRequestParameters.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"actions\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"alias\": \"alias\",\n" + + " \"type\": \"ACTIVECAMPAIGN\",\n" + + " \"action\": \"LIST_CONTACTS\",\n" + + " \"allow_failure\": true,\n" + + " \"mask_output\": true,\n" + + " \"params\": {\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"email\": \"email\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"executed_at\": \"executed_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.flows().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"actions\":[{\"id\":\"id\",\"alias\":\"alias\",\"type\":\"ACTIVECAMPAIGN\",\"action\":\"LIST_CONTACTS\",\"allow_failure\":true,\"mask_output\":true,\"params\":{\"connection_id\":\"connection_id\",\"email\":\"email\"}}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"executed_at\":\"executed_at\"}")); + UpdateFlowResponseContent response = + client.flows().update("id", UpdateFlowRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"actions\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"alias\": \"alias\",\n" + + " \"type\": \"ACTIVECAMPAIGN\",\n" + + " \"action\": \"LIST_CONTACTS\",\n" + + " \"allow_failure\": true,\n" + + " \"mask_output\": true,\n" + + " \"params\": {\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"email\": \"email\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"executed_at\": \"executed_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/FormsWireTest.java b/src/test/java/com/auth0/client/mgmt/FormsWireTest.java new file mode 100644 index 000000000..cf4623501 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/FormsWireTest.java @@ -0,0 +1,499 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateFormRequestContent; +import com.auth0.client.mgmt.types.CreateFormResponseContent; +import com.auth0.client.mgmt.types.FormSummary; +import com.auth0.client.mgmt.types.GetFormRequestParameters; +import com.auth0.client.mgmt.types.GetFormResponseContent; +import com.auth0.client.mgmt.types.ListFormsRequestParameters; +import com.auth0.client.mgmt.types.UpdateFormRequestContent; +import com.auth0.client.mgmt.types.UpdateFormResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class FormsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"forms\":[{\"id\":\"id\",\"name\":\"name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}]}")); + SyncPagingIterable response = client.forms() + .list(ListFormsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + CreateFormResponseContent response = client.forms() + .create(CreateFormRequestContent.builder().name("name").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"messages\": {\n" + + " \"errors\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"custom\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " },\n" + + " \"languages\": {\n" + + " \"primary\": \"primary\",\n" + + " \"default\": \"default\"\n" + + " },\n" + + " \"translations\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"nodes\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"type\": \"FLOW\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"alias\": \"alias\",\n" + + " \"config\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"start\": {\n" + + " \"hidden_fields\": [\n" + + " {\n" + + " \"key\": \"key\"\n" + + " }\n" + + " ],\n" + + " \"next_node\": \"next_node\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " }\n" + + " },\n" + + " \"ending\": {\n" + + " \"redirection\": {\n" + + " \"delay\": 1,\n" + + " \"target\": \"target\"\n" + + " },\n" + + " \"after_submit\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " },\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"resume_flow\": true\n" + + " },\n" + + " \"style\": {\n" + + " \"css\": \"css\"\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"embedded_at\": \"embedded_at\",\n" + + " \"submitted_at\": \"submitted_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + GetFormResponseContent response = + client.forms().get("id", GetFormRequestParameters.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"messages\": {\n" + + " \"errors\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"custom\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " },\n" + + " \"languages\": {\n" + + " \"primary\": \"primary\",\n" + + " \"default\": \"default\"\n" + + " },\n" + + " \"translations\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"nodes\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"type\": \"FLOW\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"alias\": \"alias\",\n" + + " \"config\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"start\": {\n" + + " \"hidden_fields\": [\n" + + " {\n" + + " \"key\": \"key\"\n" + + " }\n" + + " ],\n" + + " \"next_node\": \"next_node\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " }\n" + + " },\n" + + " \"ending\": {\n" + + " \"redirection\": {\n" + + " \"delay\": 1,\n" + + " \"target\": \"target\"\n" + + " },\n" + + " \"after_submit\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " },\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"resume_flow\": true\n" + + " },\n" + + " \"style\": {\n" + + " \"css\": \"css\"\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"embedded_at\": \"embedded_at\",\n" + + " \"submitted_at\": \"submitted_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.forms().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + UpdateFormResponseContent response = + client.forms().update("id", UpdateFormRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"messages\": {\n" + + " \"errors\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"custom\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " },\n" + + " \"languages\": {\n" + + " \"primary\": \"primary\",\n" + + " \"default\": \"default\"\n" + + " },\n" + + " \"translations\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"nodes\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"type\": \"FLOW\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"alias\": \"alias\",\n" + + " \"config\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"start\": {\n" + + " \"hidden_fields\": [\n" + + " {\n" + + " \"key\": \"key\"\n" + + " }\n" + + " ],\n" + + " \"next_node\": \"next_node\",\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " }\n" + + " },\n" + + " \"ending\": {\n" + + " \"redirection\": {\n" + + " \"delay\": 1,\n" + + " \"target\": \"target\"\n" + + " },\n" + + " \"after_submit\": {\n" + + " \"flow_id\": \"flow_id\"\n" + + " },\n" + + " \"coordinates\": {\n" + + " \"x\": 1,\n" + + " \"y\": 1\n" + + " },\n" + + " \"resume_flow\": true\n" + + " },\n" + + " \"style\": {\n" + + " \"css\": \"css\"\n" + + " },\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"embedded_at\": \"embedded_at\",\n" + + " \"submitted_at\": \"submitted_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java deleted file mode 100644 index 46c42a556..000000000 --- a/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.GrantsFilter; -import com.auth0.json.mgmt.grants.GrantsPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_GRANTS_LIST; -import static com.auth0.client.MockServer.MGMT_GRANTS_PAGED_LIST; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class GrantsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListGrantsWithoutFilter() throws Exception { - Request request = api.grants().list("userId", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GRANTS_LIST, 200); - GrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("user_id", "userId")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnListGrantsWithoutFilterWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.grants().list(null, null), - "'user id' cannot be null!"); - } - - @Test - public void shouldListGrantsWithPage() throws Exception { - GrantsFilter filter = new GrantsFilter().withPage(23, 5); - Request request = api.grants().list("userId", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GRANTS_LIST, 200); - GrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("user_id", "userId")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListGrantsWithTotals() throws Exception { - GrantsFilter filter = new GrantsFilter().withTotals(true); - Request request = api.grants().list("userId", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GRANTS_PAGED_LIST, 200); - GrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("user_id", "userId")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListGrantsWithAdditionalProperties() throws Exception { - GrantsFilter filter = new GrantsFilter() - .withAudience("https://myapi.auth0.com") - .withClientId("u9e3hh3e9j2fj9092ked"); - Request request = api.grants().list("userId", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GRANTS_LIST, 200); - GrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("user_id", "userId")); - assertThat(recordedRequest, hasQueryParameter("audience", "https://myapi.auth0.com")); - assertThat(recordedRequest, hasQueryParameter("client_id", "u9e3hh3e9j2fj9092ked")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnDeleteGrantWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.grants().delete(null), - "'grant id' cannot be null!"); - } - - @Test - public void shouldDeleteGrantById() throws Exception { - Request request = api.grants().delete("1"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/grants/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnDeleteAllGrantsWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.grants().deleteAll(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldDeleteAllGrantsByUserId() throws Exception { - Request request = api.grants().deleteAll("userId"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/grants")); - assertThat(recordedRequest, hasQueryParameter("user_id", "userId")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java new file mode 100644 index 000000000..8789b5e4a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java @@ -0,0 +1,206 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.types.CreateGuardianEnrollmentTicketRequestContent; +import com.auth0.client.mgmt.types.CreateGuardianEnrollmentTicketResponseContent; +import com.auth0.client.mgmt.types.GetGuardianEnrollmentResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianEnrollmentsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreateTicket() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"ticket_id\":\"ticket_id\",\"ticket_url\":\"ticket_url\"}")); + CreateGuardianEnrollmentTicketResponseContent response = client.guardian() + .enrollments() + .createTicket(CreateGuardianEnrollmentTicketRequestContent.builder() + .userId("user_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"user_id\": \"user_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = + "" + "{\n" + " \"ticket_id\": \"ticket_id\",\n" + " \"ticket_url\": \"ticket_url\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"status\":\"pending\",\"name\":\"name\",\"identifier\":\"identifier\",\"phone_number\":\"phone_number\",\"enrolled_at\":\"enrolled_at\",\"last_auth\":\"last_auth\"}")); + GetGuardianEnrollmentResponseContent response = + client.guardian().enrollments().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"status\": \"pending\",\n" + + " \"name\": \"name\",\n" + + " \"identifier\": \"identifier\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"enrolled_at\": \"enrolled_at\",\n" + + " \"last_auth\": \"last_auth\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.guardian().enrollments().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java b/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java deleted file mode 100644 index 4fe883277..000000000 --- a/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java +++ /dev/null @@ -1,402 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.guardian.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class GuardianEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnDeleteGuardianEnrollmentWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().deleteEnrollment(null), - "'enrollment id' cannot be null!"); - } - - @Test - public void shouldDeleteGuardianEnrollment() throws Exception { - Request request = api.guardian().deleteEnrollment("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_ENROLLMENT, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/guardian/enrollments/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnCreateGuardianEnrollmentTicketWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().createEnrollmentTicket(null), - "'enrollment ticket' cannot be null!"); - } - - @Test - public void shouldCreateGuardianEnrollmentTicket() throws Exception { - Request request = api.guardian().createEnrollmentTicket(new EnrollmentTicket("1")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_ENROLLMENT_TICKET, 200); - EnrollmentTicket response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/guardian/enrollments/ticket")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("user_id", "1")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetGuardianTemplates() throws Exception { - Request request = api.guardian().getTemplates(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TEMPLATES, 200); - GuardianTemplates response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/factors/sms/templates")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateGuardianTemplatesWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateTemplates(null), - "'guardian templates' cannot be null!"); - } - - @Test - public void shouldUpdateGuardianTemplates() throws Exception { - Request request = api.guardian().updateTemplates(new GuardianTemplates("msg", "msg")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TEMPLATES, 200); - GuardianTemplates response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/sms/templates")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldListGuardianFactors() throws Exception { - Request> request = api.guardian().listFactors(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_FACTORS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/factors")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldReturnEmptyGuardianFactors() throws Exception { - Request> request = api.guardian().listFactors(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(Factor.class))); - } - - @Test - public void shouldThrowOnUpdateGuardianFactorWithNullName() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateFactor(null, true), - "'name' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateGuardianFactorWithNullEnabled() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateFactor("my-factor", null), - "'enabled' cannot be null!"); - } - - @Test - public void shouldUpdateGuardianFactor() throws Exception { - Request request = api.guardian().updateFactor("my-factor", true); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_FACTOR, 200); - Factor response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/my-factor")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("enabled", true)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetGuardianTwilioFactorProviderWithMSSID() throws Exception { - Request request = api.guardian().getTwilioFactorProvider(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_MSSID, 200); - TwilioFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/factors/sms/providers/twilio")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetGuardianTwilioFactorProviderWithFrom() throws Exception { - Request request = api.guardian().getTwilioFactorProvider(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_FROM, 200); - TwilioFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/factors/sms/providers/twilio")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateGuardianTwilioFactorProviderWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateTwilioFactorProvider(null), - "'provider' cannot be null!"); - } - - @Test - public void shouldUpdateGuardianTwilioFactorProviderWithFrom() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider("+156789", null, "aToKen", "3123"); - Request request = api.guardian().updateTwilioFactorProvider(provider); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_FROM, 200); - TwilioFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/sms/providers/twilio")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("from", "+156789")); - assertThat(body, hasEntry("auth_token", "aToKen")); - assertThat(body, hasEntry("sid", "3123")); - - assertThat(response, is(notNullValue())); - assertThat(response.getFrom(), is(equalTo("+156789"))); - assertThat(response.getMessagingServiceSID(), is(nullValue())); - assertThat(response.getAuthToken(), is(equalTo("aToKen"))); - assertThat(response.getSID(), is(equalTo("3123"))); - } - - @Test - public void shouldUpdateGuardianTwilioFactorProviderWithMSSID() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider(null, "aac", "aToKen", "3123"); - Request request = api.guardian().updateTwilioFactorProvider(provider); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_WITH_MSSID, 200); - TwilioFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/sms/providers/twilio")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("messaging_service_sid", "aac")); - assertThat(body, hasEntry("auth_token", "aToKen")); - assertThat(body, hasEntry("sid", "3123")); - - assertThat(response, is(notNullValue())); - assertThat(response.getFrom(), is(nullValue())); - assertThat(response.getMessagingServiceSID(), is(equalTo("aac"))); - assertThat(response.getAuthToken(), is(equalTo("aToKen"))); - assertThat(response.getSID(), is(equalTo("3123"))); - } - - @Test - public void shouldResetGuardianTwilioFactorProvider() throws Exception { - Request request = api.guardian().resetTwilioFactorProvider(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_TWILIO_FACTOR_PROVIDER_EMPTY, 200); - TwilioFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/sms/providers/twilio")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(0)); - - assertThat(response, is(notNullValue())); - assertThat(response.getFrom(), is(nullValue())); - assertThat(response.getMessagingServiceSID(), is(nullValue())); - assertThat(response.getAuthToken(), is(nullValue())); - assertThat(response.getSID(), is(nullValue())); - } - - @Test - public void shouldGetGuardianSnsFactorProvider() throws Exception { - Request request = api.guardian().getSNSFactorProvider(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_SNS_FACTOR_PROVIDER, 200); - SNSFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/factors/push-notification/providers/sns")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateGuardianSnsFactorProviderWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateSNSFactorProvider(null), - "'provider' cannot be null!"); - } - - @Test - public void shouldUpdateGuardianSnsFactorProvider() throws Exception { - SNSFactorProvider provider = new SNSFactorProvider("awsAccessKeyId", "awsSecretAccessKey", "us-west-2", "APNS:platform:arn", "GCM:platform:arn"); - Request request = api.guardian().updateSNSFactorProvider(provider); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_SNS_FACTOR_PROVIDER, 200); - SNSFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/push-notification/providers/sns")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(5)); - assertThat(body, hasEntry("aws_access_key_id", "awsAccessKeyId")); - assertThat(body, hasEntry("aws_secret_access_key", "awsSecretAccessKey")); - assertThat(body, hasEntry("aws_region", "us-west-2")); - assertThat(body, hasEntry("sns_apns_platform_application_arn", "APNS:platform:arn")); - assertThat(body, hasEntry("sns_gcm_platform_application_arn", "GCM:platform:arn")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldResetGuardianSnsFactorProvider() throws Exception { - Request request = api.guardian().resetSNSFactorProvider(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_SNS_FACTOR_PROVIDER_EMPTY, 200); - SNSFactorProvider response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/factors/push-notification/providers/sns")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(0)); - - assertThat(response, is(notNullValue())); - assertThat(response.getAWSAccessKeyId(), is(nullValue())); - assertThat(response.getAWSRegion(), is(nullValue())); - assertThat(response.getAWSSecretAccessKey(), is(nullValue())); - assertThat(response.getSNSAPNSPlatformApplicationARN(), is(nullValue())); - assertThat(response.getSNSGCMPlatformApplicationARN(), is(nullValue())); - } - - @Test - public void shouldGetAuthenticationPolicies() throws Exception { - Request> request = api.guardian().getAuthenticationPolicies(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_AUTHENTICATION_POLICIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/guardian/policies")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, hasSize(1)); - } - - @Test - public void shouldThrowOnUpdateAuthenticationPoliciesWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.guardian().updateAuthenticationPolicies(null), - "'policies' cannot be null!"); - } - - @Test - public void shouldUpdateAuthenticationPolicies() throws Exception { - List policies = Collections.singletonList("all-applications"); - Request> request = api.guardian().updateAuthenticationPolicies(policies); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_AUTHENTICATION_POLICIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/guardian/policies")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - List body = bodyListFromRequest(recordedRequest); - assertThat(body, is(policies)); - - assertThat(response, hasSize(1)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java new file mode 100644 index 000000000..9da356b51 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java @@ -0,0 +1,268 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.factors.duo.types.SetGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.guardian.factors.duo.types.UpdateGuardianFactorDuoSettingsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorDuoSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorDuoSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsDuoSettingsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"ikey\":\"ikey\",\"skey\":\"skey\",\"host\":\"host\"}")); + GetGuardianFactorDuoSettingsResponseContent response = + client.guardian().factors().duo().settings().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = + "" + "{\n" + " \"ikey\": \"ikey\",\n" + " \"skey\": \"skey\",\n" + " \"host\": \"host\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"ikey\":\"ikey\",\"skey\":\"skey\",\"host\":\"host\"}")); + SetGuardianFactorDuoSettingsResponseContent response = client.guardian() + .factors() + .duo() + .settings() + .set(SetGuardianFactorDuoSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = + "" + "{\n" + " \"ikey\": \"ikey\",\n" + " \"skey\": \"skey\",\n" + " \"host\": \"host\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"ikey\":\"ikey\",\"skey\":\"skey\",\"host\":\"host\"}")); + UpdateGuardianFactorDuoSettingsResponseContent response = client.guardian() + .factors() + .duo() + .settings() + .update(UpdateGuardianFactorDuoSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = + "" + "{\n" + " \"ikey\": \"ikey\",\n" + " \"skey\": \"skey\",\n" + " \"host\": \"host\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java new file mode 100644 index 000000000..8153ff511 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java @@ -0,0 +1,597 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.auth0.client.mgmt.types.GuardianFactorPhoneFactorMessageTypeEnum; +import com.auth0.client.mgmt.types.GuardianFactorsProviderSmsProviderEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsPhoneWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetMessageTypes() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"message_types\":[\"sms\"]}")); + GetGuardianFactorPhoneMessageTypesResponseContent response = + client.guardian().factors().phone().getMessageTypes(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"message_types\": [\n" + " \"sms\"\n" + " ]\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetMessageTypes() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"message_types\":[\"sms\"]}")); + SetGuardianFactorPhoneMessageTypesResponseContent response = client.guardian() + .factors() + .phone() + .setMessageTypes(SetGuardianFactorPhoneMessageTypesRequestContent.builder() + .messageTypes(Arrays.asList(GuardianFactorPhoneFactorMessageTypeEnum.SMS)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"message_types\": [\n" + " \"sms\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"message_types\": [\n" + " \"sms\"\n" + " ]\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetTwilioProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"from\":\"from\",\"messaging_service_sid\":\"messaging_service_sid\",\"auth_token\":\"auth_token\",\"sid\":\"sid\"}")); + GetGuardianFactorsProviderPhoneTwilioResponseContent response = + client.guardian().factors().phone().getTwilioProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"from\": \"from\",\n" + + " \"messaging_service_sid\": \"messaging_service_sid\",\n" + + " \"auth_token\": \"auth_token\",\n" + + " \"sid\": \"sid\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetTwilioProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"from\":\"from\",\"messaging_service_sid\":\"messaging_service_sid\",\"auth_token\":\"auth_token\",\"sid\":\"sid\"}")); + SetGuardianFactorsProviderPhoneTwilioResponseContent response = client.guardian() + .factors() + .phone() + .setTwilioProvider(SetGuardianFactorsProviderPhoneTwilioRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"from\": \"from\",\n" + + " \"messaging_service_sid\": \"messaging_service_sid\",\n" + + " \"auth_token\": \"auth_token\",\n" + + " \"sid\": \"sid\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetSelectedProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"auth0\"}")); + GetGuardianFactorsProviderPhoneResponseContent response = + client.guardian().factors().phone().getSelectedProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"auth0\"}")); + SetGuardianFactorsProviderPhoneResponseContent response = client.guardian() + .factors() + .phone() + .setProvider(SetGuardianFactorsProviderPhoneRequestContent.builder() + .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetTemplates() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enrollment_message\":\"enrollment_message\",\"verification_message\":\"verification_message\"}")); + GetGuardianFactorPhoneTemplatesResponseContent response = + client.guardian().factors().phone().getTemplates(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetTemplates() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enrollment_message\":\"enrollment_message\",\"verification_message\":\"verification_message\"}")); + SetGuardianFactorPhoneTemplatesResponseContent response = client.guardian() + .factors() + .phone() + .setTemplates(SetGuardianFactorPhoneTemplatesRequestContent.builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java new file mode 100644 index 000000000..977591478 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java @@ -0,0 +1,703 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; +import com.auth0.client.mgmt.types.GuardianFactorsProviderPushNotificationProviderDataEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsPushNotificationWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetApnsProvider() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"bundle_id\":\"bundle_id\",\"sandbox\":true,\"enabled\":true}")); + GetGuardianFactorsProviderApnsResponseContent response = + client.guardian().factors().pushNotification().getApnsProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"bundle_id\": \"bundle_id\",\n" + + " \"sandbox\": true,\n" + + " \"enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetApnsProvider() throws Exception { + server.enqueue( + new MockResponse().setResponseCode(200).setBody("{\"sandbox\":true,\"bundle_id\":\"bundle_id\"}")); + SetGuardianFactorsProviderPushNotificationApnsResponseContent response = client.guardian() + .factors() + .pushNotification() + .setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"sandbox\": true,\n" + " \"bundle_id\": \"bundle_id\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetFcmProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.guardian() + .factors() + .pushNotification() + .setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetFcmv1Provider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.guardian() + .factors() + .pushNotification() + .setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetSnsProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"aws_access_key_id\":\"aws_access_key_id\",\"aws_secret_access_key\":\"aws_secret_access_key\",\"aws_region\":\"aws_region\",\"sns_apns_platform_application_arn\":\"sns_apns_platform_application_arn\",\"sns_gcm_platform_application_arn\":\"sns_gcm_platform_application_arn\"}")); + GetGuardianFactorsProviderSnsResponseContent response = + client.guardian().factors().pushNotification().getSnsProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"aws_access_key_id\": \"aws_access_key_id\",\n" + + " \"aws_secret_access_key\": \"aws_secret_access_key\",\n" + + " \"aws_region\": \"aws_region\",\n" + + " \"sns_apns_platform_application_arn\": \"sns_apns_platform_application_arn\",\n" + + " \"sns_gcm_platform_application_arn\": \"sns_gcm_platform_application_arn\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetSnsProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"aws_access_key_id\":\"aws_access_key_id\",\"aws_secret_access_key\":\"aws_secret_access_key\",\"aws_region\":\"aws_region\",\"sns_apns_platform_application_arn\":\"sns_apns_platform_application_arn\",\"sns_gcm_platform_application_arn\":\"sns_gcm_platform_application_arn\"}")); + SetGuardianFactorsProviderPushNotificationSnsResponseContent response = client.guardian() + .factors() + .pushNotification() + .setSnsProvider(SetGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"aws_access_key_id\": \"aws_access_key_id\",\n" + + " \"aws_secret_access_key\": \"aws_secret_access_key\",\n" + + " \"aws_region\": \"aws_region\",\n" + + " \"sns_apns_platform_application_arn\": \"sns_apns_platform_application_arn\",\n" + + " \"sns_gcm_platform_application_arn\": \"sns_gcm_platform_application_arn\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateSnsProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"aws_access_key_id\":\"aws_access_key_id\",\"aws_secret_access_key\":\"aws_secret_access_key\",\"aws_region\":\"aws_region\",\"sns_apns_platform_application_arn\":\"sns_apns_platform_application_arn\",\"sns_gcm_platform_application_arn\":\"sns_gcm_platform_application_arn\"}")); + UpdateGuardianFactorsProviderPushNotificationSnsResponseContent response = client.guardian() + .factors() + .pushNotification() + .updateSnsProvider(UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"aws_access_key_id\": \"aws_access_key_id\",\n" + + " \"aws_secret_access_key\": \"aws_secret_access_key\",\n" + + " \"aws_region\": \"aws_region\",\n" + + " \"sns_apns_platform_application_arn\": \"sns_apns_platform_application_arn\",\n" + + " \"sns_gcm_platform_application_arn\": \"sns_gcm_platform_application_arn\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetSelectedProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"guardian\"}")); + GetGuardianFactorsProviderPushNotificationResponseContent response = + client.guardian().factors().pushNotification().getSelectedProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"guardian\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"guardian\"}")); + SetGuardianFactorsProviderPushNotificationResponseContent response = client.guardian() + .factors() + .pushNotification() + .setProvider(SetGuardianFactorsProviderPushNotificationRequestContent.builder() + .provider(GuardianFactorsProviderPushNotificationProviderDataEnum.GUARDIAN) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"provider\": \"guardian\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"guardian\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java new file mode 100644 index 000000000..6f81a6cfe --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java @@ -0,0 +1,471 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorSmsTemplatesRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderSmsTwilioRequestContent; +import com.auth0.client.mgmt.types.GetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSmsTwilioResponseContent; +import com.auth0.client.mgmt.types.GuardianFactorsProviderSmsProviderEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorSmsTemplatesResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianFactorsProviderSmsTwilioResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsSmsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetTwilioProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"from\":\"from\",\"messaging_service_sid\":\"messaging_service_sid\",\"auth_token\":\"auth_token\",\"sid\":\"sid\"}")); + GetGuardianFactorsProviderSmsTwilioResponseContent response = + client.guardian().factors().sms().getTwilioProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"from\": \"from\",\n" + + " \"messaging_service_sid\": \"messaging_service_sid\",\n" + + " \"auth_token\": \"auth_token\",\n" + + " \"sid\": \"sid\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetTwilioProvider() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"from\":\"from\",\"messaging_service_sid\":\"messaging_service_sid\",\"auth_token\":\"auth_token\",\"sid\":\"sid\"}")); + SetGuardianFactorsProviderSmsTwilioResponseContent response = client.guardian() + .factors() + .sms() + .setTwilioProvider(SetGuardianFactorsProviderSmsTwilioRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"from\": \"from\",\n" + + " \"messaging_service_sid\": \"messaging_service_sid\",\n" + + " \"auth_token\": \"auth_token\",\n" + + " \"sid\": \"sid\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetSelectedProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"auth0\"}")); + GetGuardianFactorsProviderSmsResponseContent response = + client.guardian().factors().sms().getSelectedProvider(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"provider\":\"auth0\"}")); + SetGuardianFactorsProviderSmsResponseContent response = client.guardian() + .factors() + .sms() + .setProvider(SetGuardianFactorsProviderSmsRequestContent.builder() + .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"provider\": \"auth0\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetTemplates() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enrollment_message\":\"enrollment_message\",\"verification_message\":\"verification_message\"}")); + GetGuardianFactorSmsTemplatesResponseContent response = + client.guardian().factors().sms().getTemplates(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSetTemplates() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"enrollment_message\":\"enrollment_message\",\"verification_message\":\"verification_message\"}")); + SetGuardianFactorSmsTemplatesResponseContent response = client.guardian() + .factors() + .sms() + .setTemplates(SetGuardianFactorSmsTemplatesRequestContent.builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"enrollment_message\": \"enrollment_message\",\n" + + " \"verification_message\": \"verification_message\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java new file mode 100644 index 000000000..ad778920d --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java @@ -0,0 +1,191 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.types.SetGuardianFactorRequestContent; +import com.auth0.client.mgmt.types.GuardianFactor; +import com.auth0.client.mgmt.types.GuardianFactorNameEnum; +import com.auth0.client.mgmt.types.SetGuardianFactorResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("[{\"enabled\":true,\"trial_expired\":true,\"name\":\"push-notification\"}]")); + List response = client.guardian().factors().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"enabled\": true,\n" + + " \"trial_expired\": true,\n" + + " \"name\": \"push-notification\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"enabled\":true}")); + SetGuardianFactorResponseContent response = client.guardian() + .factors() + .set( + GuardianFactorNameEnum.PUSH_NOTIFICATION, + SetGuardianFactorRequestContent.builder().enabled(true).build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"enabled\": true\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"enabled\": true\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java new file mode 100644 index 000000000..9e5d44cfd --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java @@ -0,0 +1,176 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.MfaPolicyEnum; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianPoliciesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("[\"all-applications\"]")); + List response = client.guardian().policies().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "[\n" + " \"all-applications\"\n" + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("[\"all-applications\"]")); + List response = client.guardian().policies().set(Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS)); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "[\n" + " \"all-applications\"\n" + "]"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "[\n" + " \"all-applications\"\n" + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java new file mode 100644 index 000000000..54861cbbf --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java @@ -0,0 +1,226 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class HooksSecretsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.hooks().secrets().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.hooks().secrets().create("id", new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.hooks().secrets().delete("id", Arrays.asList("string")); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "[\n" + " \"string\"\n" + "]"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.hooks().secrets().update("id", new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/HooksWireTest.java b/src/test/java/com/auth0/client/mgmt/HooksWireTest.java new file mode 100644 index 000000000..f632a45c2 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/HooksWireTest.java @@ -0,0 +1,344 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateHookRequestContent; +import com.auth0.client.mgmt.types.CreateHookResponseContent; +import com.auth0.client.mgmt.types.GetHookRequestParameters; +import com.auth0.client.mgmt.types.GetHookResponseContent; +import com.auth0.client.mgmt.types.Hook; +import com.auth0.client.mgmt.types.HookTriggerIdEnum; +import com.auth0.client.mgmt.types.ListHooksRequestParameters; +import com.auth0.client.mgmt.types.UpdateHookRequestContent; +import com.auth0.client.mgmt.types.UpdateHookResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class HooksWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"hooks\":[{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}]}")); + SyncPagingIterable response = client.hooks() + .list(ListHooksRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .enabled(true) + .fields("fields") + .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}")); + CreateHookResponseContent response = client.hooks() + .create(CreateHookRequestContent.builder() + .name("name") + .script("script") + .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"script\": \"script\",\n" + + " \"triggerId\": \"credentials-exchange\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"triggerId\": \"triggerId\",\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"dependencies\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}")); + GetHookResponseContent response = client.hooks() + .get("id", GetHookRequestParameters.builder().fields("fields").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"triggerId\": \"triggerId\",\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"dependencies\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.hooks().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}")); + UpdateHookResponseContent response = + client.hooks().update("id", UpdateHookRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"triggerId\": \"triggerId\",\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"dependencies\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java b/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java deleted file mode 100644 index 5087b5098..000000000 --- a/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java +++ /dev/null @@ -1,545 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.UsersExportFilter; -import com.auth0.client.mgmt.filter.UsersImportOptions; -import com.auth0.json.mgmt.jobs.Job; -import com.auth0.json.mgmt.jobs.JobErrorDetails; -import com.auth0.json.mgmt.jobs.UsersExportField; -import com.auth0.json.mgmt.tickets.EmailVerificationIdentity; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import com.auth0.net.client.multipart.FilePart; -import com.auth0.net.client.multipart.KeyValuePart; -import com.auth0.net.client.multipart.RecordedMultipartRequest; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNull.notNullValue; -import static org.hamcrest.core.IsNull.nullValue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class JobsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnGetJobWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().get(null), - "'job id' cannot be null!"); - } - - @Test - public void shouldGetJob() throws Exception { - Request request = api.jobs().get("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/jobs/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetJobErrorDetailsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().getErrorDetails(null), - "'job id' cannot be null!"); - } - - @Test - public void shouldGetJobErrorDetails() throws Exception { - Request> request = api.jobs().getErrorDetails("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_ERROR_DETAILS, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/jobs/1/errors")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(1)); - assertThat(response.get(0).getErrors(), hasSize(1)); - } - - @Test - public void shouldGetJobErrorDetails_noErrors() throws Exception { - Request> request = api.jobs().getErrorDetails("1"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/jobs/1/errors")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, is(empty())); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldThrowOnRequestUsersExportWithNullConnectionId() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().exportUsers(null, null), - "'connection id' cannot be null!"); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldNotThrowOnRequestUsersExportWithNullFilter() { - api.jobs().exportUsers("con_123456789", null); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldRequestUsersExport() throws Exception { - Request request = api.jobs().exportUsers("con_123456789", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("connection_id", "con_123456789")); - - assertThat(response, is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void usersExportWithFilterOverridesClientId() throws Exception { - UsersExportFilter filter = new UsersExportFilter(); - filter.withConnectionId("filter_con"); - - Request request = api.jobs().exportUsers("con_123456789", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("connection_id", "filter_con")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRequestUsersExportWithoutConnectionOrFilter() throws Exception { - Request request = api.jobs().exportUsers(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(0)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRequestUsersExportWithFilter() throws Exception { - UsersExportFilter filter = new UsersExportFilter(); - filter.withConnectionId("conId"); - filter.withFormat("json"); - List fields = new ArrayList<>(); - fields.add(new UsersExportField("full_name")); - fields.add(new UsersExportField("user_metadata.company_name", "company")); - filter.withFields(fields); - - Request request = api.jobs().exportUsers(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("connection_id", "conId")); - assertThat(body, hasEntry("format", "json")); - assertThat(body, hasKey("fields")); - @SuppressWarnings("unchecked") - List> bodyFields = (List>) body.get("fields"); - assertThat(bodyFields.get(0).get("name"), is("full_name")); - assertThat(bodyFields.get(0).get("export_as"), is(nullValue())); - assertThat(bodyFields.get(1).get("name"), is("user_metadata.company_name")); - assertThat(bodyFields.get(1).get("export_as"), is("company")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void usersExportShouldHandleNullFilter() throws Exception { - Request request = api.jobs().exportUsers(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(0)); - - assertThat(response, is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldRequestUsersExportWithLimit() throws Exception { - UsersExportFilter filter = new UsersExportFilter(); - filter.withLimit(82); - Request request = api.jobs().exportUsers("con_123456789", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("connection_id", "con_123456789")); - assertThat(body, hasEntry("limit", 82)); - - assertThat(response, is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldRequestUsersExportWithFormat() throws Exception { - UsersExportFilter filter = new UsersExportFilter(); - filter.withFormat("csv"); - Request request = api.jobs().exportUsers("con_123456789", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("connection_id", "con_123456789")); - assertThat(body, hasEntry("format", "csv")); - - assertThat(response, is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldRequestUsersExportWithFields() throws Exception { - UsersExportFilter filter = new UsersExportFilter(); - ArrayList fields = new ArrayList<>(); - fields.add(new UsersExportField("full_name")); - fields.add(new UsersExportField("user_metadata.company_name", "company")); - filter.withFields(fields); - Request request = api.jobs().exportUsers("con_123456789", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_EXPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-exports")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("connection_id", "con_123456789")); - assertThat(body, hasKey("fields")); - @SuppressWarnings("unchecked") - List> bodyFields = (List>) body.get("fields"); - assertThat(bodyFields.get(0).get("name"), is("full_name")); - assertThat(bodyFields.get(0).get("export_as"), is(nullValue())); - assertThat(bodyFields.get(1).get("name"), is("user_metadata.company_name")); - assertThat(bodyFields.get(1).get("export_as"), is("company")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldSendUserAVerificationEmailWithNullClientIdAndEmailVerification() throws Exception { - Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", null, null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_VERIFICATION_EMAIL, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/verification-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("user_id", "google-oauth2|1234")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldSendUserVerificationEmailWithClientId() throws Exception { - Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_VERIFICATION_EMAIL, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/verification-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("user_id", "google-oauth2|1234")); - assertThat(body, hasEntry("client_id", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldSendUserVerificationEmailWithIdentity() throws Exception { - EmailVerificationIdentity identity = new EmailVerificationIdentity("google-oauth2", "1234"); - Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww", identity); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_VERIFICATION_EMAIL, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/verification-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("user_id", "google-oauth2|1234")); - assertThat(body, hasEntry("client_id", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww")); - - Map identityMap = new HashMap<>(); - identityMap.put("provider", "google-oauth2"); - identityMap.put("user_id", "1234"); - assertThat(body, hasEntry("identity", identityMap)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldSendUserVerificationEmailWithOrgId() throws Exception { - Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", "client_abc", null, "org_abc"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_VERIFICATION_EMAIL, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/verification-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("user_id", "google-oauth2|1234")); - assertThat(body, hasEntry("client_id", "client_abc")); - assertThat(body, hasEntry("organization_id", "org_abc")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnSendUserVerificationEmailWithNullIdentityProvider() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().sendVerificationEmail("google-oauth2|1234", null, new EmailVerificationIdentity(null, "user-id")), - "'identity provider' cannot be null!"); - } - - @Test - public void shouldThrowOnSendUserVerificationEmailWithNullIdentityUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().sendVerificationEmail("google-oauth2|1234", null, new EmailVerificationIdentity("google-oauth2", null)), - "'identity user id' cannot be null!"); - } - - @Test - public void shouldThrowOnSendUserVerificationEmailWithNullIdentityProviderAndUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().sendVerificationEmail("google-oauth2|1234", null, new EmailVerificationIdentity(null, null)), - "'identity provider' cannot be null!"); - } - - @Test - public void shouldThrowOnRequestUsersImportWithNullConnectionId() { - File usersFile = mock(File.class); - when(usersFile.exists()).thenReturn(true); - UsersImportOptions options = mock(UsersImportOptions.class); - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().importUsers(null, usersFile, options), - "'connection id' cannot be null!"); - } - - @Test - public void shouldThrowOnRequestUsersImportWithNullUsersFile() { - UsersImportOptions options = mock(UsersImportOptions.class); - verifyThrows(IllegalArgumentException.class, - () -> api.jobs().importUsers("con_123456789", null, options), - "'users file' cannot be null!"); - } - - @Test - public void shouldNotThrowOnRequestUsersImportWithNullOptions() { - File usersFile = mock(File.class); - when(usersFile.exists()).thenReturn(true); - api.jobs().importUsers("con_123456789", usersFile, null); - } - - @Test - public void shouldRequestUsersImport() throws Exception { - File usersFile = new File(MGMT_JOB_POST_USERS_IMPORTS_INPUT); - Request request = api.jobs().importUsers("con_123456789", usersFile, null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_IMPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-imports")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - String ctHeader = recordedRequest.getHeader("Content-Type"); - assertThat(ctHeader, startsWith("multipart/form-data")); - String[] ctParts = ctHeader.split("multipart/form-data; boundary="); - - RecordedMultipartRequest recordedMultipartRequest = new RecordedMultipartRequest(recordedRequest); - assertThat(recordedMultipartRequest.getPartsCount(), is(2)); - assertThat(recordedMultipartRequest.getBoundary(), is(notNullValue())); - assertThat(recordedMultipartRequest.getBoundary(), is(ctParts[1])); - - //Connection ID - KeyValuePart formParam = recordedMultipartRequest.getKeyValuePart("connection_id"); - assertThat(formParam, is(notNullValue())); - assertThat(formParam.getValue(), is("con_123456789")); - - //Users JSON - FilePart jsonFile = recordedMultipartRequest.getFilePart("users"); - assertThat(jsonFile, is(notNullValue())); - String utf8Contents = new String(Files.readAllBytes(usersFile.toPath())); - assertThat(jsonFile.getContentType(), is("text/json")); - assertThat(jsonFile.getFilename(), is("job_post_users_imports_input.json")); - assertThat(jsonFile.getValue(), is(utf8Contents)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRequestUsersImportWithOptions() throws Exception { - UsersImportOptions options = new UsersImportOptions(); - options.withExternalId("ext_id123"); - options.withUpsert(true); - options.withSendCompletionEmail(false); - File usersFile = new File(MGMT_JOB_POST_USERS_IMPORTS_INPUT); - Request request = api.jobs().importUsers("con_123456789", usersFile, options); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_JOB_POST_USERS_IMPORTS, 200); - Job response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/jobs/users-imports")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - String ctHeader = recordedRequest.getHeader("Content-Type"); - assertThat(ctHeader, startsWith("multipart/form-data")); - String[] ctParts = ctHeader.split("multipart/form-data; boundary="); - - RecordedMultipartRequest recordedMultipartRequest = new RecordedMultipartRequest(recordedRequest); - assertThat(recordedMultipartRequest.getPartsCount(), is(5)); - assertThat(recordedMultipartRequest.getBoundary(), is(notNullValue())); - assertThat(recordedMultipartRequest.getBoundary(), is(ctParts[1])); - - //Connection ID - KeyValuePart connectionIdParam = recordedMultipartRequest.getKeyValuePart("connection_id"); - assertThat(connectionIdParam, is(notNullValue())); - assertThat(connectionIdParam.getValue(), is("con_123456789")); - - //External ID - KeyValuePart externalIdParam = recordedMultipartRequest.getKeyValuePart("external_id"); - assertThat(externalIdParam, is(notNullValue())); - assertThat(externalIdParam.getValue(), is("ext_id123")); - - //Upsert - KeyValuePart upsertParam = recordedMultipartRequest.getKeyValuePart("upsert"); - assertThat(upsertParam, is(notNullValue())); - assertThat(upsertParam.getValue(), is("true")); - - //Send Completion Email - KeyValuePart sendCompletionEmailParam = recordedMultipartRequest.getKeyValuePart("send_completion_email"); - assertThat(sendCompletionEmailParam, is(notNullValue())); - assertThat(sendCompletionEmailParam.getValue(), is("false")); - - //Users JSON - FilePart jsonFile = recordedMultipartRequest.getFilePart("users"); - assertThat(jsonFile, is(notNullValue())); - String utf8Contents = new String(Files.readAllBytes(usersFile.toPath())); - assertThat(jsonFile.getContentType(), is("text/json")); - assertThat(jsonFile.getFilename(), is("job_post_users_imports_input.json")); - assertThat(jsonFile.getValue(), is(utf8Contents)); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java new file mode 100644 index 000000000..8e36f6eeb --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java @@ -0,0 +1,113 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.jobs.types.ErrorsGetResponse; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class JobsErrorsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse().setResponseCode(200).setBody("[{\"user\":{\"key\":\"value\"},\"errors\":[{}]}]")); + ErrorsGetResponse response = client.jobs().errors().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"user\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"errors\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java new file mode 100644 index 000000000..16a0c3b9a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java @@ -0,0 +1,153 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.jobs.types.CreateExportUsersRequestContent; +import com.auth0.client.mgmt.types.CreateExportUsersResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class JobsUsersExportsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"status\":\"status\",\"type\":\"type\",\"created_at\":\"created_at\",\"id\":\"id\",\"connection_id\":\"connection_id\",\"format\":\"json\",\"limit\":1,\"fields\":[{\"name\":\"name\",\"export_as\":\"export_as\"}]}")); + CreateExportUsersResponseContent response = client.jobs() + .usersExports() + .create(CreateExportUsersRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"status\": \"status\",\n" + + " \"type\": \"type\",\n" + + " \"created_at\": \"created_at\",\n" + + " \"id\": \"id\",\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"format\": \"json\",\n" + + " \"limit\": 1,\n" + + " \"fields\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"export_as\": \"export_as\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java new file mode 100644 index 000000000..2c1d8f500 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java @@ -0,0 +1,144 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.jobs.types.CreateVerificationEmailRequestContent; +import com.auth0.client.mgmt.types.CreateVerificationEmailResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class JobsVerificationEmailWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"status\":\"status\",\"type\":\"type\",\"created_at\":\"created_at\",\"id\":\"id\"}")); + CreateVerificationEmailResponseContent response = client.jobs() + .verificationEmail() + .create(CreateVerificationEmailRequestContent.builder() + .userId("user_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"user_id\": \"user_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"status\": \"status\",\n" + + " \"type\": \"type\",\n" + + " \"created_at\": \"created_at\",\n" + + " \"id\": \"id\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/JobsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsWireTest.java new file mode 100644 index 000000000..eea89c9ea --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/JobsWireTest.java @@ -0,0 +1,118 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetJobResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class JobsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"status\":\"status\",\"type\":\"type\",\"created_at\":\"created_at\",\"id\":\"id\",\"connection_id\":\"connection_id\",\"location\":\"location\",\"percentage_done\":1,\"time_left_seconds\":1,\"format\":\"json\",\"status_details\":\"status_details\"}")); + GetJobResponseContent response = client.jobs().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"status\": \"status\",\n" + + " \"type\": \"type\",\n" + + " \"created_at\": \"created_at\",\n" + + " \"id\": \"id\",\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"location\": \"location\",\n" + + " \"percentage_done\": 1,\n" + + " \"time_left_seconds\": 1,\n" + + " \"format\": \"json\",\n" + + " \"status_details\": \"status_details\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java new file mode 100644 index 000000000..51b832e43 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java @@ -0,0 +1,252 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.keys.types.SetCustomSigningKeysRequestContent; +import com.auth0.client.mgmt.types.CustomSigningKeyJwk; +import com.auth0.client.mgmt.types.CustomSigningKeyTypeEnum; +import com.auth0.client.mgmt.types.GetCustomSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SetCustomSigningKeysResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class KeysCustomSigningWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"keys\":[{\"kty\":\"EC\",\"kid\":\"kid\",\"use\":\"sig\",\"key_ops\":[\"verify\"],\"alg\":\"RS256\",\"n\":\"n\",\"e\":\"e\",\"crv\":\"P-256\",\"x\":\"x\",\"y\":\"y\",\"x5u\":\"x5u\",\"x5c\":[\"x5c\"],\"x5t\":\"x5t\",\"x5t#S256\":\"x5t#S256\"}]}")); + GetCustomSigningKeysResponseContent response = + client.keys().customSigning().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"keys\": [\n" + + " {\n" + + " \"kty\": \"EC\",\n" + + " \"kid\": \"kid\",\n" + + " \"use\": \"sig\",\n" + + " \"key_ops\": [\n" + + " \"verify\"\n" + + " ],\n" + + " \"alg\": \"RS256\",\n" + + " \"n\": \"n\",\n" + + " \"e\": \"e\",\n" + + " \"crv\": \"P-256\",\n" + + " \"x\": \"x\",\n" + + " \"y\": \"y\",\n" + + " \"x5u\": \"x5u\",\n" + + " \"x5c\": [\n" + + " \"x5c\"\n" + + " ],\n" + + " \"x5t\": \"x5t\",\n" + + " \"x5t#S256\": \"x5t#S256\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"keys\":[{\"kty\":\"EC\",\"kid\":\"kid\",\"use\":\"sig\",\"key_ops\":[\"verify\"],\"alg\":\"RS256\",\"n\":\"n\",\"e\":\"e\",\"crv\":\"P-256\",\"x\":\"x\",\"y\":\"y\",\"x5u\":\"x5u\",\"x5c\":[\"x5c\"],\"x5t\":\"x5t\",\"x5t#S256\":\"x5t#S256\"}]}")); + SetCustomSigningKeysResponseContent response = client.keys() + .customSigning() + .set(SetCustomSigningKeysRequestContent.builder() + .keys(Arrays.asList(CustomSigningKeyJwk.builder() + .kty(CustomSigningKeyTypeEnum.EC) + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = + "" + "{\n" + " \"keys\": [\n" + " {\n" + " \"kty\": \"EC\"\n" + " }\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"keys\": [\n" + + " {\n" + + " \"kty\": \"EC\",\n" + + " \"kid\": \"kid\",\n" + + " \"use\": \"sig\",\n" + + " \"key_ops\": [\n" + + " \"verify\"\n" + + " ],\n" + + " \"alg\": \"RS256\",\n" + + " \"n\": \"n\",\n" + + " \"e\": \"e\",\n" + + " \"crv\": \"P-256\",\n" + + " \"x\": \"x\",\n" + + " \"y\": \"y\",\n" + + " \"x5u\": \"x5u\",\n" + + " \"x5c\": [\n" + + " \"x5c\"\n" + + " ],\n" + + " \"x5t\": \"x5t\",\n" + + " \"x5t#S256\": \"x5t#S256\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.keys().customSigning().delete(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java new file mode 100644 index 000000000..a01b3887d --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java @@ -0,0 +1,396 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; +import com.auth0.client.mgmt.keys.types.ListEncryptionKeysRequestParameters; +import com.auth0.client.mgmt.types.CreateEncryptionKeyPublicWrappingResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.CreateEncryptionKeyType; +import com.auth0.client.mgmt.types.EncryptionKey; +import com.auth0.client.mgmt.types.GetEncryptionKeyResponseContent; +import com.auth0.client.mgmt.types.ImportEncryptionKeyResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class KeysEncryptionWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1,\"limit\":1,\"total\":1,\"keys\":[{\"kid\":\"kid\",\"type\":\"customer-provided-root-key\",\"state\":\"pre-activation\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"parent_kid\":\"parent_kid\",\"public_key\":\"public_key\"}]}")); + SyncPagingIterable response = client.keys() + .encryption() + .list(ListEncryptionKeysRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"kid\":\"kid\",\"type\":\"customer-provided-root-key\",\"state\":\"pre-activation\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"parent_kid\":\"parent_kid\",\"public_key\":\"public_key\"}")); + CreateEncryptionKeyResponseContent response = client.keys() + .encryption() + .create(CreateEncryptionKeyRequestContent.builder() + .type(CreateEncryptionKeyType.CUSTOMER_PROVIDED_ROOT_KEY) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"type\": \"customer-provided-root-key\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"kid\": \"kid\",\n" + + " \"type\": \"customer-provided-root-key\",\n" + + " \"state\": \"pre-activation\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"parent_kid\": \"parent_kid\",\n" + + " \"public_key\": \"public_key\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRekey() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.keys().encryption().rekey(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"kid\":\"kid\",\"type\":\"customer-provided-root-key\",\"state\":\"pre-activation\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"parent_kid\":\"parent_kid\",\"public_key\":\"public_key\"}")); + GetEncryptionKeyResponseContent response = client.keys().encryption().get("kid"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"kid\": \"kid\",\n" + + " \"type\": \"customer-provided-root-key\",\n" + + " \"state\": \"pre-activation\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"parent_kid\": \"parent_kid\",\n" + + " \"public_key\": \"public_key\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testImport() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"kid\":\"kid\",\"type\":\"customer-provided-root-key\",\"state\":\"pre-activation\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"parent_kid\":\"parent_kid\",\"public_key\":\"public_key\"}")); + ImportEncryptionKeyResponseContent response = client.keys() + .encryption() + .import_( + "kid", + ImportEncryptionKeyRequestContent.builder() + .wrappedKey("wrapped_key") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"wrapped_key\": \"wrapped_key\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"kid\": \"kid\",\n" + + " \"type\": \"customer-provided-root-key\",\n" + + " \"state\": \"pre-activation\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"parent_kid\": \"parent_kid\",\n" + + " \"public_key\": \"public_key\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.keys().encryption().delete("kid"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testCreatePublicWrappingKey() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"public_key\":\"public_key\",\"algorithm\":\"CKM_RSA_AES_KEY_WRAP\"}")); + CreateEncryptionKeyPublicWrappingResponseContent response = + client.keys().encryption().createPublicWrappingKey("kid"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"public_key\": \"public_key\",\n" + + " \"algorithm\": \"CKM_RSA_AES_KEY_WRAP\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/KeysEntityTest.java b/src/test/java/com/auth0/client/mgmt/KeysEntityTest.java deleted file mode 100644 index 98d54dcb5..000000000 --- a/src/test/java/com/auth0/client/mgmt/KeysEntityTest.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.EncryptionKeyFilter; -import com.auth0.json.mgmt.keys.EncryptionKey; -import com.auth0.json.mgmt.keys.EncryptionKeysPage; -import com.auth0.json.mgmt.keys.EncryptionWrappingKeyResponse; -import com.auth0.json.mgmt.keys.Key; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class KeysEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnGetWithIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.keys().get(null), - "'kid' cannot be null!"); - } - - @Test - public void shouldThrowOnRevokeWithIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.keys().revoke(null), - "'kid' cannot be null!"); - } - - @Test - public void shouldListKeys() throws Exception { - Request> request = api.keys().list(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(KEY_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/signing")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldGetKeyWithId() throws Exception { - Request request = api.keys().get("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(KEY, 200); - Key response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/signing/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRotateKey() throws Exception { - Request request = api.keys().rotate(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(KEY_ROTATE, 200); - Key response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/keys/signing/rotate")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRevokeKey() throws Exception { - Request request = api.keys().revoke("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(KEY_REVOKE, 200); - Key response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/keys/signing/123/revoke")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldRekey() throws Exception { - Request request = api.keys().postEncryptionRekey(); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/keys/encryption/rekey")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldListEncryptionKeysWithoutFilter() throws Exception { - Request request = api.keys().listEncryptionKeys(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEYS_LIST, 200); - EncryptionKeysPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/encryption")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListEncryptionKeysWithPage() throws Exception { - EncryptionKeyFilter filter = new EncryptionKeyFilter().withPage(1, 5); - Request request = api.keys().listEncryptionKeys(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEYS_LIST, 200); - EncryptionKeysPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/encryption")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListEncryptionKeysWithTotals() throws Exception { - EncryptionKeyFilter filter = new EncryptionKeyFilter().withTotals(true); - Request request = api.keys().listEncryptionKeys(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEYS_LIST, 200); - EncryptionKeysPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/encryption")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldGetEncryptionKeyWithKid() throws Exception { - Request request = api.keys().getEncryptionKey("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEY, 200); - EncryptionKey response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/keys/encryption/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldCreateEncryptionKey() throws Exception { - Request request = api.keys().createEncryptionKey("tenant-master-key"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEY, 201); - EncryptionKey response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/keys/encryption")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("type", "tenant-master-key")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldImportEncryptionKey() throws Exception { - Request request = api.keys().importEncryptionKey("key@1234", "123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEY, 201); - EncryptionKey response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/keys/encryption/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("wrapped_key", "key@1234")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldCreateEncryptionWrappingKey() throws Exception { - Request request = api.keys().createEncryptionWrappingKey("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEY, 201); - EncryptionWrappingKeyResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/keys/encryption/123/wrapping-key")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldDeleteEncryptionKey() throws Exception { - Request request = api.keys().deleteEncryptionKey("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ENCRYPTION_KEY, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/keys/encryption/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnDeleteEncryptionKeyWithNullKid(){ - verifyThrows(IllegalArgumentException.class, - () -> api.keys().deleteEncryptionKey(null), - "'kid' cannot be null!"); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java new file mode 100644 index 000000000..f2672fb4a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java @@ -0,0 +1,273 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RevokedSigningKeysResponseContent; +import com.auth0.client.mgmt.types.RotateSigningKeysResponseContent; +import com.auth0.client.mgmt.types.SigningKeys; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class KeysSigningWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"kid\":\"kid\",\"cert\":\"cert\",\"pkcs7\":\"pkcs7\",\"current\":true,\"next\":true,\"previous\":true,\"current_since\":\"current_since\",\"current_until\":\"current_until\",\"fingerprint\":\"fingerprint\",\"thumbprint\":\"thumbprint\",\"revoked\":true,\"revoked_at\":\"revoked_at\"}]")); + List response = client.keys().signing().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"kid\": \"kid\",\n" + + " \"cert\": \"cert\",\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"current\": true,\n" + + " \"next\": true,\n" + + " \"previous\": true,\n" + + " \"current_since\": \"current_since\",\n" + + " \"current_until\": \"current_until\",\n" + + " \"fingerprint\": \"fingerprint\",\n" + + " \"thumbprint\": \"thumbprint\",\n" + + " \"revoked\": true,\n" + + " \"revoked_at\": \"revoked_at\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRotate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"cert\":\"cert\",\"kid\":\"kid\"}")); + RotateSigningKeysResponseContent response = client.keys().signing().rotate(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"cert\": \"cert\",\n" + " \"kid\": \"kid\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"kid\":\"kid\",\"cert\":\"cert\",\"pkcs7\":\"pkcs7\",\"current\":true,\"next\":true,\"previous\":true,\"current_since\":\"current_since\",\"current_until\":\"current_until\",\"fingerprint\":\"fingerprint\",\"thumbprint\":\"thumbprint\",\"revoked\":true,\"revoked_at\":\"revoked_at\"}")); + GetSigningKeysResponseContent response = client.keys().signing().get("kid"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"kid\": \"kid\",\n" + + " \"cert\": \"cert\",\n" + + " \"pkcs7\": \"pkcs7\",\n" + + " \"current\": true,\n" + + " \"next\": true,\n" + + " \"previous\": true,\n" + + " \"current_since\": \"current_since\",\n" + + " \"current_until\": \"current_until\",\n" + + " \"fingerprint\": \"fingerprint\",\n" + + " \"thumbprint\": \"thumbprint\",\n" + + " \"revoked\": true,\n" + + " \"revoked_at\": \"revoked_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRevoke() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"cert\":\"cert\",\"kid\":\"kid\"}")); + RevokedSigningKeysResponseContent response = client.keys().signing().revoke("kid"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"cert\": \"cert\",\n" + " \"kid\": \"kid\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java b/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java deleted file mode 100644 index d6a502873..000000000 --- a/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.LogEventFilter; -import com.auth0.json.mgmt.logevents.LogEvent; -import com.auth0.json.mgmt.logevents.LogEventsPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class LogEventsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListEventLogs() throws Exception { - Request request = api.logEvents().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListLogEventsWithPage() throws Exception { - LogEventFilter filter = new LogEventFilter().withPage(23, 5); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListLogEventsWithTotals() throws Exception { - LogEventFilter filter = new LogEventFilter().withTotals(true); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_PAGED_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListLogEventsWithSort() throws Exception { - LogEventFilter filter = new LogEventFilter().withSort("date:1"); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("sort", "date:1")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListLogEventsWithQuery() throws Exception { - LogEventFilter filter = new LogEventFilter().withQuery("email:\\*@gmail.com"); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("q", "email:\\*@gmail.com")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListLogEventsWithCheckpoint() throws Exception { - LogEventFilter filter = new LogEventFilter().withCheckpoint("id3", 5); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "id3")); - assertThat(recordedRequest, hasQueryParameter("take", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListLogEventsWithFields() throws Exception { - LogEventFilter filter = new LogEventFilter().withFields("some,random,fields", true); - Request request = api.logEvents().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldReturnEmptyLogEvents() throws Exception { - Request request = api.logEvents().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - LogEventsPage response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), is(emptyCollectionOf(LogEvent.class))); - } - - @Test - public void shouldThrowOnGetLogEventWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.logEvents().get(null), - "'log event id' cannot be null!"); - } - - @Test - public void shouldGetLogEvent() throws Exception { - Request request = api.logEvents().get("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENT, 200); - LogEvent response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/logs/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/LogStreamsEntityTest.java b/src/test/java/com/auth0/client/mgmt/LogStreamsEntityTest.java deleted file mode 100644 index f92e95a11..000000000 --- a/src/test/java/com/auth0/client/mgmt/LogStreamsEntityTest.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.json.mgmt.logstreams.LogStream; -import com.auth0.json.mgmt.logstreams.LogStreamFilter; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class LogStreamsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListLogStreams() throws Exception { - Request> request = api.logStreams().list(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_LOG_STREAMS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/log-streams")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - assertThat(response, everyItem(hasProperty("id", is(notNullValue())))); - assertThat(response, everyItem(hasProperty("name", is(notNullValue())))); - assertThat(response, everyItem(hasProperty("type", is(notNullValue())))); - assertThat(response, everyItem(hasProperty("status", is(notNullValue())))); - assertThat(response, everyItem(hasProperty("sink", is(notNullValue())))); - assertThat(response, everyItem(hasProperty("filters", is(notNullValue())))); - } - - @Test - public void shouldReturnEmptyLogStreams() throws Exception { - Request> request = api.logStreams().list(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, empty()); - } - - @Test - public void shouldGetLogStream() throws Exception { - Request request = api.logStreams().get("123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_LOG_STREAM, 200); - LogStream response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/log-streams/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasProperty("id", is(notNullValue()))); - assertThat(response, hasProperty("name", is(notNullValue()))); - assertThat(response, hasProperty("type", is(notNullValue()))); - assertThat(response, hasProperty("status", is(notNullValue()))); - assertThat(response, hasProperty("sink", is(notNullValue()))); - assertThat(response, hasProperty("filters", is(notNullValue()))); - } - - @Test - public void shouldCreateLogStream() throws Exception { - LogStream logStream = getLogStream("log stream", "http"); - LogStreamFilter filter = new LogStreamFilter("category", "auth.ancillary.success"); - logStream.setFilters(Collections.singletonList(filter)); - - Request request = api.logStreams().create(logStream); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_STREAM, 200); - LogStream response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/log-streams")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(4)); - assertThat(body, hasEntry("name", "log stream")); - assertThat(body, hasEntry("type", "http")); - assertThat(body, hasEntry("sink", logStream.getSink())); - assertThat(body, hasKey("filters")); - assertThat(body.get("filters"), is(notNullValue())); - - assertThat(response, is(notNullValue())); - assertThat(response, hasProperty("id", is(notNullValue()))); - assertThat(response, hasProperty("name", is(notNullValue()))); - assertThat(response, hasProperty("type", is(notNullValue()))); - assertThat(response, hasProperty("status", is(notNullValue()))); - assertThat(response, hasProperty("sink", is(notNullValue()))); - assertThat(response, hasProperty("filters", is(notNullValue()))); - - } - - @Test - public void shouldUpdateLogStream() throws Exception { - LogStream logStream = getLogStream("log stream", null); - logStream.setStatus("paused"); - - Request request = api.logStreams().update("123", logStream); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_STREAM, 200); - LogStream response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/log-streams/123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("name", "log stream")); - assertThat(body, hasEntry("status", "paused")); - assertThat(body, hasEntry("sink", logStream.getSink())); - - assertThat(response, is(notNullValue())); - assertThat(response, hasProperty("id", is(notNullValue()))); - assertThat(response, hasProperty("name", is(notNullValue()))); - assertThat(response, hasProperty("type", is(notNullValue()))); - assertThat(response, hasProperty("status", is(notNullValue()))); - assertThat(response, hasProperty("sink", is(notNullValue()))); - } - - @Test - public void shouldDeleteLogStream() throws Exception { - Request request = api.logStreams().delete("1"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/log-streams/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnGetLogStreamWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.logStreams().get(null), - "'log stream id' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteLogStreamWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.logStreams().delete(null), - "'log stream id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateLogStreamWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.logStreams().update(null, new LogStream()), - "'log stream id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateLogStreamWithNullLogStream() { - verifyThrows(IllegalArgumentException.class, - () -> api.logStreams().update("123", null), - "'log stream' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateLogStreamWithNullLogStream() { - verifyThrows(IllegalArgumentException.class, - () -> api.logStreams().create(null), - "'log stream' cannot be null!"); - } - - private LogStream getLogStream(String name, String type) { - LogStream logStream = new LogStream(type); - logStream.setName(name); - - Map sink = new HashMap<>(); - sink.put("httpEndpoint", "https://me.org"); - sink.put("httpAuthorization", "abc123"); - sink.put("httpContentFormat", "JSONLINES"); - sink.put("httpContentType", "application/json"); - logStream.setSink(sink); - - return logStream; - } -} diff --git a/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java b/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java new file mode 100644 index 000000000..b6bd8e951 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java @@ -0,0 +1,450 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateLogStreamHttpRequestBody; +import com.auth0.client.mgmt.types.CreateLogStreamRequestContent; +import com.auth0.client.mgmt.types.CreateLogStreamResponseContent; +import com.auth0.client.mgmt.types.GetLogStreamResponseContent; +import com.auth0.client.mgmt.types.LogStreamHttpSink; +import com.auth0.client.mgmt.types.LogStreamResponseSchema; +import com.auth0.client.mgmt.types.UpdateLogStreamRequestContent; +import com.auth0.client.mgmt.types.UpdateLogStreamResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class LogStreamsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"name\":\"name\",\"status\":\"active\",\"type\":\"http\",\"isPriority\":true,\"filters\":[{}],\"pii_config\":{\"log_fields\":[\"first_name\"],\"method\":\"mask\",\"algorithm\":\"xxhash\"},\"sink\":{\"httpAuthorization\":\"httpAuthorization\",\"httpContentFormat\":\"JSONARRAY\",\"httpContentType\":\"httpContentType\",\"httpEndpoint\":\"httpEndpoint\",\"httpCustomHeaders\":[{}]}}]")); + List response = client.logStreams().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"status\": \"active\",\n" + + " \"type\": \"http\",\n" + + " \"isPriority\": true,\n" + + " \"filters\": [\n" + + " {}\n" + + " ],\n" + + " \"pii_config\": {\n" + + " \"log_fields\": [\n" + + " \"first_name\"\n" + + " ],\n" + + " \"method\": \"mask\",\n" + + " \"algorithm\": \"xxhash\"\n" + + " },\n" + + " \"sink\": {\n" + + " \"httpAuthorization\": \"httpAuthorization\",\n" + + " \"httpContentFormat\": \"JSONARRAY\",\n" + + " \"httpContentType\": \"httpContentType\",\n" + + " \"httpEndpoint\": \"httpEndpoint\",\n" + + " \"httpCustomHeaders\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"status\":\"active\",\"type\":\"http\",\"isPriority\":true,\"filters\":[{\"type\":\"category\",\"name\":\"auth.login.fail\"}],\"pii_config\":{\"log_fields\":[\"first_name\"],\"method\":\"mask\",\"algorithm\":\"xxhash\"},\"sink\":{\"httpAuthorization\":\"httpAuthorization\",\"httpContentFormat\":\"JSONARRAY\",\"httpContentType\":\"httpContentType\",\"httpEndpoint\":\"httpEndpoint\",\"httpCustomHeaders\":[{}]}}")); + CreateLogStreamResponseContent response = client.logStreams() + .create(CreateLogStreamRequestContent.of(CreateLogStreamHttpRequestBody.builder() + .type("http") + .sink(LogStreamHttpSink.builder() + .httpEndpoint("httpEndpoint") + .build()) + .build())); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"type\": \"http\",\n" + + " \"sink\": {\n" + + " \"httpEndpoint\": \"httpEndpoint\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"status\": \"active\",\n" + + " \"type\": \"http\",\n" + + " \"isPriority\": true,\n" + + " \"filters\": [\n" + + " {\n" + + " \"type\": \"category\",\n" + + " \"name\": \"auth.login.fail\"\n" + + " }\n" + + " ],\n" + + " \"pii_config\": {\n" + + " \"log_fields\": [\n" + + " \"first_name\"\n" + + " ],\n" + + " \"method\": \"mask\",\n" + + " \"algorithm\": \"xxhash\"\n" + + " },\n" + + " \"sink\": {\n" + + " \"httpAuthorization\": \"httpAuthorization\",\n" + + " \"httpContentFormat\": \"JSONARRAY\",\n" + + " \"httpContentType\": \"httpContentType\",\n" + + " \"httpEndpoint\": \"httpEndpoint\",\n" + + " \"httpCustomHeaders\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"status\":\"active\",\"type\":\"http\",\"isPriority\":true,\"filters\":[{\"type\":\"category\",\"name\":\"auth.login.fail\"}],\"pii_config\":{\"log_fields\":[\"first_name\"],\"method\":\"mask\",\"algorithm\":\"xxhash\"},\"sink\":{\"httpAuthorization\":\"httpAuthorization\",\"httpContentFormat\":\"JSONARRAY\",\"httpContentType\":\"httpContentType\",\"httpEndpoint\":\"httpEndpoint\",\"httpCustomHeaders\":[{}]}}")); + GetLogStreamResponseContent response = client.logStreams().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"status\": \"active\",\n" + + " \"type\": \"http\",\n" + + " \"isPriority\": true,\n" + + " \"filters\": [\n" + + " {\n" + + " \"type\": \"category\",\n" + + " \"name\": \"auth.login.fail\"\n" + + " }\n" + + " ],\n" + + " \"pii_config\": {\n" + + " \"log_fields\": [\n" + + " \"first_name\"\n" + + " ],\n" + + " \"method\": \"mask\",\n" + + " \"algorithm\": \"xxhash\"\n" + + " },\n" + + " \"sink\": {\n" + + " \"httpAuthorization\": \"httpAuthorization\",\n" + + " \"httpContentFormat\": \"JSONARRAY\",\n" + + " \"httpContentType\": \"httpContentType\",\n" + + " \"httpEndpoint\": \"httpEndpoint\",\n" + + " \"httpCustomHeaders\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.logStreams().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"status\":\"active\",\"type\":\"http\",\"isPriority\":true,\"filters\":[{\"type\":\"category\",\"name\":\"auth.login.fail\"}],\"pii_config\":{\"log_fields\":[\"first_name\"],\"method\":\"mask\",\"algorithm\":\"xxhash\"},\"sink\":{\"httpAuthorization\":\"httpAuthorization\",\"httpContentFormat\":\"JSONARRAY\",\"httpContentType\":\"httpContentType\",\"httpEndpoint\":\"httpEndpoint\",\"httpCustomHeaders\":[{}]}}")); + UpdateLogStreamResponseContent response = client.logStreams() + .update("id", UpdateLogStreamRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"status\": \"active\",\n" + + " \"type\": \"http\",\n" + + " \"isPriority\": true,\n" + + " \"filters\": [\n" + + " {\n" + + " \"type\": \"category\",\n" + + " \"name\": \"auth.login.fail\"\n" + + " }\n" + + " ],\n" + + " \"pii_config\": {\n" + + " \"log_fields\": [\n" + + " \"first_name\"\n" + + " ],\n" + + " \"method\": \"mask\",\n" + + " \"algorithm\": \"xxhash\"\n" + + " },\n" + + " \"sink\": {\n" + + " \"httpAuthorization\": \"httpAuthorization\",\n" + + " \"httpContentFormat\": \"JSONARRAY\",\n" + + " \"httpContentType\": \"httpContentType\",\n" + + " \"httpEndpoint\": \"httpEndpoint\",\n" + + " \"httpCustomHeaders\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/LogsWireTest.java b/src/test/java/com/auth0/client/mgmt/LogsWireTest.java new file mode 100644 index 000000000..e454d7222 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/LogsWireTest.java @@ -0,0 +1,173 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.GetLogResponseContent; +import com.auth0.client.mgmt.types.ListLogsRequestParameters; +import com.auth0.client.mgmt.types.Log; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class LogsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"logs\":[{\"date\":\"date\",\"type\":\"type\",\"description\":\"description\",\"connection\":\"connection\",\"connection_id\":\"connection_id\",\"client_id\":\"client_id\",\"client_name\":\"client_name\",\"ip\":\"ip\",\"hostname\":\"hostname\",\"user_id\":\"user_id\",\"user_name\":\"user_name\",\"audience\":\"audience\",\"scope\":\"scope\",\"strategy\":\"strategy\",\"strategy_type\":\"strategy_type\",\"log_id\":\"log_id\",\"isMobile\":true,\"details\":{\"key\":\"value\"},\"user_agent\":\"user_agent\"}]}")); + SyncPagingIterable response = client.logs() + .list(ListLogsRequestParameters.builder() + .page(1) + .perPage(1) + .sort("sort") + .fields("fields") + .includeFields(true) + .includeTotals(true) + .q("q") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"date\":\"date\",\"type\":\"type\",\"description\":\"description\",\"connection\":\"connection\",\"connection_id\":\"connection_id\",\"client_id\":\"client_id\",\"client_name\":\"client_name\",\"ip\":\"ip\",\"hostname\":\"hostname\",\"user_id\":\"user_id\",\"user_name\":\"user_name\",\"audience\":\"audience\",\"scope\":\"scope\",\"strategy\":\"strategy\",\"strategy_type\":\"strategy_type\",\"log_id\":\"log_id\",\"isMobile\":true,\"details\":{\"key\":\"value\"},\"user_agent\":\"user_agent\",\"security_context\":{\"ja3\":\"ja3\",\"ja4\":\"ja4\"},\"location_info\":{\"country_code\":\"country_code\",\"country_code3\":\"country_code3\",\"country_name\":\"country_name\",\"city_name\":\"city_name\",\"latitude\":\"latitude\",\"longitude\":\"longitude\",\"time_zone\":\"time_zone\",\"continent_code\":\"continent_code\"}}")); + GetLogResponseContent response = client.logs().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"date\": \"date\",\n" + + " \"type\": \"type\",\n" + + " \"description\": \"description\",\n" + + " \"connection\": \"connection\",\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"client_name\": \"client_name\",\n" + + " \"ip\": \"ip\",\n" + + " \"hostname\": \"hostname\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"user_name\": \"user_name\",\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": \"scope\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"strategy_type\": \"strategy_type\",\n" + + " \"log_id\": \"log_id\",\n" + + " \"isMobile\": true,\n" + + " \"details\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_agent\": \"user_agent\",\n" + + " \"security_context\": {\n" + + " \"ja3\": \"ja3\",\n" + + " \"ja4\": \"ja4\"\n" + + " },\n" + + " \"location_info\": {\n" + + " \"country_code\": \"country_code\",\n" + + " \"country_code3\": \"country_code3\",\n" + + " \"country_name\": \"country_name\",\n" + + " \"city_name\": \"city_name\",\n" + + " \"latitude\": \"latitude\",\n" + + " \"longitude\": \"longitude\",\n" + + " \"time_zone\": \"time_zone\",\n" + + " \"continent_code\": \"continent_code\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java b/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java deleted file mode 100644 index 419f8511a..000000000 --- a/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.exception.Auth0Exception; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.Auth0HttpRequest; -import com.auth0.net.client.Auth0HttpResponse; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.UrlMatcher.isUrl; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class ManagementAPITest { - - private static final String DOMAIN = "domain.auth0.com"; - private static final String API_TOKEN = "apiToken"; - - private MockServer server; - private ManagementAPI api; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - api = ManagementAPI.newBuilder(server.getBaseUrl(), API_TOKEN).build(); - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - // Configuration - - @Test - public void shouldAcceptDomainWithNoScheme() { - ManagementAPI api = ManagementAPI.newBuilder("me.something.com", API_TOKEN).build(); - - assertThat(api.getBaseUrl(), is(notNullValue())); - assertThat(api.getBaseUrl().toString(), isUrl("https", "me.something.com")); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldCreateWithDomainAndToken() { - ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); - assertThat(api, is(notNullValue())); - } - - @Test - public void shouldCreateWithHttpClientWithApiToken() { - Auth0HttpClient httpClient = new Auth0HttpClient() { - @Override - public Auth0HttpResponse sendRequest(Auth0HttpRequest request) { - return null; - } - - @Override - public CompletableFuture sendRequestAsync(Auth0HttpRequest request) { - return null; - } - }; - - ManagementAPI api = ManagementAPI.newBuilder(DOMAIN, API_TOKEN) - .withHttpClient(httpClient).build(); - - assertThat(api, is(notNullValue())); - assertThat(api.getHttpClient(), is(httpClient)); - } - - @Test - public void shouldCreateWithHttpClientWithTokenProvider() { - Auth0HttpClient httpClient = new Auth0HttpClient() { - @Override - public Auth0HttpResponse sendRequest(Auth0HttpRequest request) { - return null; - } - - @Override - public CompletableFuture sendRequestAsync(Auth0HttpRequest request) { - return null; - } - }; - - ManagementAPI api = ManagementAPI.newBuilder( - DOMAIN, - SimpleTokenProvider.create(API_TOKEN) - ) - .withHttpClient(httpClient) - .build(); - assertThat(api, is(notNullValue())); - assertThat(api.getHttpClient(), is(httpClient)); - } - - @Test - public void shouldAcceptDomainWithHttpScheme() { - ManagementAPI api = ManagementAPI.newBuilder("http://me.something.com", API_TOKEN).build(); - - assertThat(api.getBaseUrl(), is(notNullValue())); - assertThat(api.getBaseUrl().toString(), isUrl("http", "me.something.com")); - } - - @Test - public void shouldThrowWhenDomainIsInvalid() { - verifyThrows(IllegalArgumentException.class, - () -> ManagementAPI.newBuilder("", API_TOKEN).build(), - "The domain had an invalid format and couldn't be parsed as an URL."); - } - - @Test - public void shouldThrowWhenDomainIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> ManagementAPI.newBuilder(null, API_TOKEN).build(), - "'domain' cannot be null!"); - } - - @Test - public void shouldThrowWhenApiTokenIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> ManagementAPI.newBuilder(DOMAIN, (String) null).build(), - "'api token' cannot be null!"); - } - - @Test - public void shouldThrowWhenTokenProviderIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> ManagementAPI.newBuilder(DOMAIN, (TokenProvider) null).build(), - "'token provider' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateWhenApiTokenIsNull() { - ManagementAPI api = ManagementAPI.newBuilder(DOMAIN, API_TOKEN).build(); - - verifyThrows(IllegalArgumentException.class, - () -> api.setApiToken(null), - "'api token' cannot be null!"); - } - - @Test - public void shouldUpdateApiToken() throws Auth0Exception { - //Initialize with a token - ManagementAPI api = ManagementAPI.newBuilder(DOMAIN, "first token").build(); - - assertThat(api.blacklists().tokenProvider.getToken(), is("first token")); - assertThat(api.clientGrants().tokenProvider.getToken(), is("first token")); - assertThat(api.clients().tokenProvider.getToken(), is("first token")); - assertThat(api.connections().tokenProvider.getToken(), is("first token")); - assertThat(api.deviceCredentials().tokenProvider.getToken(), is("first token")); - assertThat(api.emailProvider().tokenProvider.getToken(), is("first token")); - assertThat(api.emailTemplates().tokenProvider.getToken(), is("first token")); - assertThat(api.grants().tokenProvider.getToken(), is("first token")); - assertThat(api.guardian().tokenProvider.getToken(), is("first token")); - assertThat(api.jobs().tokenProvider.getToken(), is("first token")); - assertThat(api.logEvents().tokenProvider.getToken(), is("first token")); - assertThat(api.resourceServers().tokenProvider.getToken(), is("first token")); - assertThat(api.rules().tokenProvider.getToken(), is("first token")); - assertThat(api.stats().tokenProvider.getToken(), is("first token")); - assertThat(api.tenants().tokenProvider.getToken(), is("first token")); - assertThat(api.tickets().tokenProvider.getToken(), is("first token")); - assertThat(api.userBlocks().tokenProvider.getToken(), is("first token")); - assertThat(api.users().tokenProvider.getToken(), is("first token")); - - //Update the token - api.setApiToken("new token"); - - assertThat(api.blacklists().tokenProvider.getToken(), is("new token")); - assertThat(api.clientGrants().tokenProvider.getToken(), is("new token")); - assertThat(api.clients().tokenProvider.getToken(), is("new token")); - assertThat(api.connections().tokenProvider.getToken(), is("new token")); - assertThat(api.deviceCredentials().tokenProvider.getToken(), is("new token")); - assertThat(api.emailProvider().tokenProvider.getToken(), is("new token")); - assertThat(api.emailTemplates().tokenProvider.getToken(), is("new token")); - assertThat(api.grants().tokenProvider.getToken(), is("new token")); - assertThat(api.guardian().tokenProvider.getToken(), is("new token")); - assertThat(api.jobs().tokenProvider.getToken(), is("new token")); - assertThat(api.logEvents().tokenProvider.getToken(), is("new token")); - assertThat(api.resourceServers().tokenProvider.getToken(), is("new token")); - assertThat(api.rules().tokenProvider.getToken(), is("new token")); - assertThat(api.stats().tokenProvider.getToken(), is("new token")); - assertThat(api.tenants().tokenProvider.getToken(), is("new token")); - assertThat(api.tickets().tokenProvider.getToken(), is("new token")); - assertThat(api.userBlocks().tokenProvider.getToken(), is("new token")); - assertThat(api.users().tokenProvider.getToken(), is("new token")); - } - - @Test - @SuppressWarnings("deprecation") - public void acceptsHttpOptions() { - com.auth0.client.HttpOptions httpOptions = new com.auth0.client.HttpOptions(); - httpOptions.setConnectTimeout(15); - ManagementAPI api = new ManagementAPI(DOMAIN, "CLIENT_ID", httpOptions); - assertThat(api, is(notNullValue())); - } - - @Test - @SuppressWarnings("deprecation") - public void httpOptionsShouldThrowWhenNull() { - verifyThrows(IllegalArgumentException.class, () -> new ManagementAPI(DOMAIN, API_TOKEN, null)); - } - - @Test - @SuppressWarnings("deprecation") - public void shouldThrowOnInValidMaxRequestsPerHostConfiguration() { - com.auth0.client.HttpOptions options = new com.auth0.client.HttpOptions(); - - verifyThrows(IllegalArgumentException.class, - () -> options.setMaxRequestsPerHost(0), - "maxRequestsPerHost must be one or greater."); - } - - //Entities - - @Test - public void shouldGetBlacklists() { - assertThat(api.blacklists(), notNullValue()); - } - - @Test - public void shouldGetClientGrants() { - assertThat(api.clientGrants(), notNullValue()); - } - - @Test - public void shouldGetClients() { - assertThat(api.clients(), notNullValue()); - } - - @Test - public void shouldGetConnections() { - assertThat(api.connections(), notNullValue()); - } - - @Test - public void shouldGetDeviceCredentials() { - assertThat(api.deviceCredentials(), notNullValue()); - } - - @Test - public void shouldGetEmailProvider() { - assertThat(api.emailProvider(), notNullValue()); - } - - @Test - public void shouldGetEmailTemplates() { - assertThat(api.emailTemplates(), notNullValue()); - } - - @Test - public void shouldGetGrants() { - assertThat(api.grants(), notNullValue()); - } - - @Test - public void shouldGetGuardian() { - assertThat(api.guardian(), notNullValue()); - } - - @Test - public void shouldGetJobs() { - assertThat(api.jobs(), notNullValue()); - } - - @Test - public void shouldGetLogEvents() { - assertThat(api.logEvents(), notNullValue()); - } - - @Test - public void shouldGetResourceServers() { - assertThat(api.resourceServers(), notNullValue()); - } - - @Test - public void shouldGetRules() { - assertThat(api.rules(), notNullValue()); - } - - @Test - public void shouldGetStats() { - assertThat(api.stats(), notNullValue()); - } - - @Test - public void shouldGetTenants() { - assertThat(api.tenants(), notNullValue()); - } - - @Test - public void shouldGetTickets() { - assertThat(api.tickets(), notNullValue()); - } - - @Test - public void shouldGetUserBlocks() { - assertThat(api.userBlocks(), notNullValue()); - } - - @Test - public void shouldGetUsers() { - assertThat(api.users(), notNullValue()); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/NetworkAclsEntityTest.java b/src/test/java/com/auth0/client/mgmt/NetworkAclsEntityTest.java deleted file mode 100644 index 49e31f78c..000000000 --- a/src/test/java/com/auth0/client/mgmt/NetworkAclsEntityTest.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.filter.NetworkAclsFilter; -import com.auth0.json.mgmt.networkacls.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class NetworkAclsEntityTest extends BaseMgmtEntityTest { - - // Network ACLs entity - - @Test - public void shouldListNetworkAclsWithoutFilter() throws Exception { - Request request = api.networkAcls().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS_LIST, 200); - NetworkAclsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/network-acls")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListNetworkAclsWithFilter() throws Exception { - NetworkAclsFilter filter = new NetworkAclsFilter() - .withPage(0, 10) - .withTotals(true); - - Request request = api.networkAcls().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS_LIST, 200); - NetworkAclsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/network-acls")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "10")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnCreateNetworkAclWithNullNetworkAcls() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().create(null), - "'network acls' cannot be null!"); - } - - @Test - public void shouldCreateNetworkAcl() throws Exception { - NetworkAcls networkAclsToCreate = new NetworkAcls(); - networkAclsToCreate.setDescription("Log America and Canada all the time."); - networkAclsToCreate.setActive(true); - networkAclsToCreate.setPriority(1); - Rule rule = new Rule(); - Action action = new Action(); - action.setLog(true); - rule.setAction(action); - - rule.setScope("authentication"); - - Match match = new Match(); - List geoCountryCodes = new ArrayList<>(); - geoCountryCodes.add("US"); - geoCountryCodes.add("CA"); - - match.setGeoCountryCodes(geoCountryCodes); - rule.setMatch(match); - networkAclsToCreate.setRule(rule); - - - Request request = api.networkAcls().create(networkAclsToCreate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS, 201); - NetworkAcls response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/network-acls")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(4)); - assertThat(body, hasEntry("description", "Log America and Canada all the time.")); - assertThat(body, hasEntry("active", true)); - assertThat(body, hasEntry("priority", 1)); - assertThat(body, hasEntry(is("rule"), is(notNullValue()))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetNetworkAclWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().get(null), - "'id' cannot be null!"); - } - - @Test - public void shouldGetNetworkAcl() throws Exception { - Request request = api.networkAcls().get("acl_1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS, 200); - NetworkAcls response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/network-acls/acl_1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getId(), is("acl_1")); - assertThat(response.getDescription(), is("Log America and Canada all the time.")); - } - - @Test - public void shouldThrowOnDeleteNetworkAclWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().delete(null), - "'id' cannot be null!"); - } - - @Test - public void shouldDeleteNetworkAcl() throws Exception { - Request request = api.networkAcls().delete("acl_1"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/network-acls/acl_1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateNetworkAclWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().update(null, new NetworkAcls()), - "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateNetworkAclWithNullNetworkAcls() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().update("acl_1", null), - "'network acls' cannot be null!"); - } - - @Test - public void shouldUpdateNetworkAcl() throws Exception { - NetworkAcls networkAclsToUpdate = new NetworkAcls(); - networkAclsToUpdate.setDescription("Log America and Canada all the time."); - networkAclsToUpdate.setActive(false); - networkAclsToUpdate.setPriority(5); - - Request request = api.networkAcls().update("acl_1", networkAclsToUpdate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS, 200); - NetworkAcls response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/network-acls/acl_1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(3)); - assertThat(body, hasEntry("description", "Log America and Canada all the time.")); - assertThat(body, hasEntry("active", false)); - assertThat(body, hasEntry("priority", 5)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnPatchNetworkAclWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.networkAcls().patch(null, new NetworkAcls()), - "'id' cannot be null!"); - } - - @Test - public void shouldPatchNetworkAcl() throws Exception { - NetworkAcls networkAclsToPatch = new NetworkAcls(); - networkAclsToPatch.setActive(true); - networkAclsToPatch.setPriority(3); - - Request request = api.networkAcls().patch("acl_1", networkAclsToPatch); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_NETWORK_ACLS, 200); - NetworkAcls response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/network-acls/acl_1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(2)); - assertThat(body, hasEntry("active", true)); - assertThat(body, hasEntry("priority", 3)); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java b/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java new file mode 100644 index 000000000..7cf3d66f8 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java @@ -0,0 +1,588 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.ListNetworkAclsRequestParameters; +import com.auth0.client.mgmt.types.NetworkAclAction; +import com.auth0.client.mgmt.types.NetworkAclRule; +import com.auth0.client.mgmt.types.NetworkAclRuleScopeEnum; +import com.auth0.client.mgmt.types.NetworkAclsResponseContent; +import com.auth0.client.mgmt.types.SetNetworkAclRequestContent; +import com.auth0.client.mgmt.types.SetNetworkAclsResponseContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclRequestContent; +import com.auth0.client.mgmt.types.UpdateNetworkAclResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class NetworkAclsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"network_acls\":[{\"id\":\"id\",\"description\":\"description\",\"active\":true,\"priority\":1.1,\"rule\":{\"action\":{},\"scope\":\"management\"},\"created_at\":\"created_at\",\"updated_at\":\"updated_at\"}],\"start\":1.1,\"limit\":1.1,\"total\":1.1}")); + SyncPagingIterable response = client.networkAcls() + .list(ListNetworkAclsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.networkAcls() + .create(CreateNetworkAclRequestContent.builder() + .description("description") + .active(true) + .priority(1.1) + .rule(NetworkAclRule.builder() + .action(NetworkAclAction.builder().build()) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build()) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"description\": \"description\",\n" + + " \"active\": true,\n" + + " \"priority\": 1.1,\n" + + " \"rule\": {\n" + + " \"action\": {},\n" + + " \"scope\": \"management\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"description\":\"description\",\"active\":true,\"priority\":1.1,\"rule\":{\"action\":{\"block\":true,\"allow\":true,\"log\":true,\"redirect\":true,\"redirect_uri\":\"redirect_uri\"},\"match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"not_match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"scope\":\"management\"},\"created_at\":\"created_at\",\"updated_at\":\"updated_at\"}")); + GetNetworkAclsResponseContent response = client.networkAcls().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"description\": \"description\",\n" + + " \"active\": true,\n" + + " \"priority\": 1.1,\n" + + " \"rule\": {\n" + + " \"action\": {\n" + + " \"block\": true,\n" + + " \"allow\": true,\n" + + " \"log\": true,\n" + + " \"redirect\": true,\n" + + " \"redirect_uri\": \"redirect_uri\"\n" + + " },\n" + + " \"match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"not_match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"scope\": \"management\"\n" + + " },\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"description\":\"description\",\"active\":true,\"priority\":1.1,\"rule\":{\"action\":{\"block\":true,\"allow\":true,\"log\":true,\"redirect\":true,\"redirect_uri\":\"redirect_uri\"},\"match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"not_match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"scope\":\"management\"},\"created_at\":\"created_at\",\"updated_at\":\"updated_at\"}")); + SetNetworkAclsResponseContent response = client.networkAcls() + .set( + "id", + SetNetworkAclRequestContent.builder() + .description("description") + .active(true) + .priority(1.1) + .rule(NetworkAclRule.builder() + .action(NetworkAclAction.builder().build()) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build()) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"description\": \"description\",\n" + + " \"active\": true,\n" + + " \"priority\": 1.1,\n" + + " \"rule\": {\n" + + " \"action\": {},\n" + + " \"scope\": \"management\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"description\": \"description\",\n" + + " \"active\": true,\n" + + " \"priority\": 1.1,\n" + + " \"rule\": {\n" + + " \"action\": {\n" + + " \"block\": true,\n" + + " \"allow\": true,\n" + + " \"log\": true,\n" + + " \"redirect\": true,\n" + + " \"redirect_uri\": \"redirect_uri\"\n" + + " },\n" + + " \"match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"not_match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"scope\": \"management\"\n" + + " },\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.networkAcls().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"description\":\"description\",\"active\":true,\"priority\":1.1,\"rule\":{\"action\":{\"block\":true,\"allow\":true,\"log\":true,\"redirect\":true,\"redirect_uri\":\"redirect_uri\"},\"match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"not_match\":{\"asns\":[1],\"geo_country_codes\":[\"geo_country_codes\"],\"geo_subdivision_codes\":[\"geo_subdivision_codes\"],\"ipv4_cidrs\":[\"ipv4_cidrs\"],\"ipv6_cidrs\":[\"ipv6_cidrs\"],\"ja3_fingerprints\":[\"ja3_fingerprints\"],\"ja4_fingerprints\":[\"ja4_fingerprints\"],\"user_agents\":[\"user_agents\"]},\"scope\":\"management\"},\"created_at\":\"created_at\",\"updated_at\":\"updated_at\"}")); + UpdateNetworkAclResponseContent response = client.networkAcls() + .update("id", UpdateNetworkAclRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"description\": \"description\",\n" + + " \"active\": true,\n" + + " \"priority\": 1.1,\n" + + " \"rule\": {\n" + + " \"action\": {\n" + + " \"block\": true,\n" + + " \"allow\": true,\n" + + " \"log\": true,\n" + + " \"redirect\": true,\n" + + " \"redirect_uri\": \"redirect_uri\"\n" + + " },\n" + + " \"match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"not_match\": {\n" + + " \"asns\": [\n" + + " 1\n" + + " ],\n" + + " \"geo_country_codes\": [\n" + + " \"geo_country_codes\"\n" + + " ],\n" + + " \"geo_subdivision_codes\": [\n" + + " \"geo_subdivision_codes\"\n" + + " ],\n" + + " \"ipv4_cidrs\": [\n" + + " \"ipv4_cidrs\"\n" + + " ],\n" + + " \"ipv6_cidrs\": [\n" + + " \"ipv6_cidrs\"\n" + + " ],\n" + + " \"ja3_fingerprints\": [\n" + + " \"ja3_fingerprints\"\n" + + " ],\n" + + " \"ja4_fingerprints\": [\n" + + " \"ja4_fingerprints\"\n" + + " ],\n" + + " \"user_agents\": [\n" + + " \"user_agents\"\n" + + " ]\n" + + " },\n" + + " \"scope\": \"management\"\n" + + " },\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java b/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java new file mode 100644 index 000000000..53c8b7c24 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java @@ -0,0 +1,158 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.OAuthTokenSupplier; +import com.auth0.client.mgmt.core.RequestOptions; +import org.junit.Test; + +/** + * Tests for OAuth per-request credentials functionality. + */ +public class OAuthTokenSupplierTest { + + /** + * Verify that special characters in credentials don't cause issues. + * This tests the fix for JSON injection vulnerability. + */ + @Test + public void testSpecialCharactersInCredentials() { + // Create supplier with credentials containing special characters + String clientIdWithQuotes = "client\"with\\quotes"; + String clientSecretWithSpecialChars = "secret'with\"special\\chars\nand\nnewlines"; + String baseUrl = "https://example.auth0.com"; + + // This should not throw an exception during construction + OAuthTokenSupplier supplier = + new OAuthTokenSupplier(clientIdWithQuotes, clientSecretWithSpecialChars, baseUrl, null); + + // Verify object was created successfully + assert supplier != null; + System.out.println("✓ OAuthTokenSupplier handles special characters safely"); + } + + /** + * Verify that multiple suppliers can be created without resource issues. + * This tests the fix for HTTP client resource leak. + */ + @Test + public void testMultipleSupplierCreation() { + // Create multiple suppliers - they should all share the same HTTP client + for (int i = 0; i < 100; i++) { + OAuthTokenSupplier supplier = new OAuthTokenSupplier( + "client-id-" + i, "client-secret-" + i, "https://tenant-" + i + ".auth0.com", null); + assert supplier != null; + } + + System.out.println("✓ Multiple OAuthTokenSupplier instances created without resource leaks"); + } + + /** + * Test base URL validation. + */ + @Test(expected = IllegalArgumentException.class) + public void testNullBaseUrl() { + new OAuthTokenSupplier("client-id", "client-secret", null, null); + } + + @Test(expected = IllegalArgumentException.class) + public void testEmptyBaseUrl() { + new OAuthTokenSupplier("client-id", "client-secret", "", null); + } + + @Test + public void testTrailingSlashNormalization() { + OAuthTokenSupplier supplier1 = new OAuthTokenSupplier("id", "secret", "https://example.auth0.com/", null); + OAuthTokenSupplier supplier2 = new OAuthTokenSupplier("id", "secret", "https://example.auth0.com", null); + + // Both should work without issues (trailing slash normalized) + assert supplier1 != null; + assert supplier2 != null; + System.out.println("✓ Base URL trailing slash normalization works"); + } + + /** + * Test RequestOptions creation and getters. + */ + @Test + public void testRequestOptionsCreation() { + RequestOptions options = + RequestOptions.withClientCredentials("https://example.auth0.com", "client-id", "client-secret"); + + assert options != null; + assert options.getClientId().equals("client-id"); + assert options.getClientSecret().equals("client-secret"); + assert options.getBaseUrl().equals("https://example.auth0.com"); + assert options.hasClientCredentials(); + System.out.println("✓ RequestOptions.withClientCredentials() works"); + } + + @Test + public void testRequestOptionsWithAudience() { + RequestOptions options = RequestOptions.withClientCredentialsAndAudience( + "https://example.auth0.com", "client-id", "client-secret", "https://custom-api.com/api/v2/"); + + assert options != null; + assert options.getAudience().equals("https://custom-api.com/api/v2/"); + System.out.println("✓ RequestOptions.withClientCredentialsAndAudience() works"); + } + + @Test + public void testRequestOptionsBuilder() { + RequestOptions options = RequestOptions.builder() + .baseUrl("https://example.auth0.com") + .clientCredentials("client-id", "client-secret") + .timeout(30) + .addHeader("X-Custom", "value") + .build(); + + assert options != null; + assert options.hasClientCredentials(); + assert options.getClientId().equals("client-id"); + assert options.getBaseUrl().equals("https://example.auth0.com"); + System.out.println("✓ RequestOptions.builder() pattern works"); + } + + @Test + public void testRequestOptionsWithoutCredentials() { + RequestOptions options = RequestOptions.builder().timeout(10).build(); + + assert options != null; + assert !options.hasClientCredentials(); + assert options.getClientId() == null; + System.out.println("✓ RequestOptions without credentials works"); + } + + /** + * Run all tests and print summary. + */ + public static void main(String[] args) { + OAuthTokenSupplierTest test = new OAuthTokenSupplierTest(); + + System.out.println("\n=== Running OAuth Per-Request Credentials Tests ===\n"); + + // Run each test + test.testSpecialCharactersInCredentials(); + test.testMultipleSupplierCreation(); + test.testTrailingSlashNormalization(); + test.testRequestOptionsCreation(); + test.testRequestOptionsWithAudience(); + test.testRequestOptionsBuilder(); + test.testRequestOptionsWithoutCredentials(); + + // Test validation + try { + test.testNullBaseUrl(); + System.out.println("✗ testNullBaseUrl should have thrown exception"); + } catch (IllegalArgumentException e) { + System.out.println("✓ Null base URL validation works"); + } + + try { + test.testEmptyBaseUrl(); + System.out.println("✗ testEmptyBaseUrl should have thrown exception"); + } catch (IllegalArgumentException e) { + System.out.println("✓ Empty base URL validation works"); + } + + System.out.println("\n=== All Tests Passed! ===\n"); + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationEntityTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationEntityTest.java deleted file mode 100644 index 2928ed95b..000000000 --- a/src/test/java/com/auth0/client/mgmt/OrganizationEntityTest.java +++ /dev/null @@ -1,1321 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.filter.*; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.mgmt.client.Client; -import com.auth0.json.mgmt.client.ClientDefaultOrganization; -import com.auth0.json.mgmt.client.ClientsPage; -import com.auth0.json.mgmt.clientgrants.ClientGrant; -import com.auth0.json.mgmt.clientgrants.ClientGrantsPage; -import com.auth0.json.mgmt.organizations.*; -import com.auth0.json.mgmt.resourceserver.ResourceServer; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.*; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class OrganizationEntityTest extends BaseMgmtEntityTest { - - // Organizations entity - - @Test - public void shouldListOrgsWithoutFilter() throws Exception { - Request request = api.organizations().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATIONS_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListOrgsWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(2, 30); - Request request = api.organizations().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATIONS_PAGED_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "2")); - assertThat(recordedRequest, hasQueryParameter("per_page", "30")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListOrgsWithCheckpointPagination() throws Exception { - PageFilter filter = new PageFilter().withTake(10).withFrom("from-id"); - Request request = api.organizations().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_CHECKPOINT_PAGED_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("take", "10")); - assertThat(recordedRequest, hasQueryParameter("from", "from-id")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListOrgsWithTotals() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.organizations().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATIONS_PAGED_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnGetOrgWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().get(null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldGetOrganization() throws Exception { - Request request = api.organizations().get("org_123"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION, 200); - Organization response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetOrgWithNullName() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getByName( null), - "'organization name' cannot be null!"); - } - - @Test - public void shouldGetOrganizationByName() throws Exception { - Request request = api.organizations().getByName("org-1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION, 200); - Organization response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/name/org-1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateOrgWithNullOrg() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().create(null), - "'organization' cannot be null!"); - } - - @Test - public void shouldCreateOrganization() throws Exception { - Organization orgToCreate = new Organization("test-org"); - orgToCreate.setDisplayName("display name"); - - Colors colors = new Colors(); - colors.setPageBackground("#FF0000"); - colors.setPrimary("#FF0000"); - Branding branding = new Branding(); - branding.setColors(colors); - branding.setLogoUrl("https://some-uri.com"); - orgToCreate.setBranding(branding); - - Map metadata = new HashMap<>(); - metadata.put("key1", "val1"); - orgToCreate.setMetadata(metadata); - - EnabledConnection enabledConnection = new EnabledConnection(); - enabledConnection.setConnectionId("con-1"); - enabledConnection.setAssignMembershipOnLogin(false); - List enabledConnections = new ArrayList<>(); - enabledConnections.add(enabledConnection); - orgToCreate.setEnabledConnections(enabledConnections); - - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - - TokenQuota tokenQuota = new TokenQuota(clientCredentials); - orgToCreate.setTokenQuota(tokenQuota); - - Request request = api.organizations().create(orgToCreate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION, 200); - Organization response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(6)); - assertThat(body, hasEntry("name", "test-org")); - assertThat(body, hasEntry("display_name", "display name")); - assertThat(body, hasEntry("metadata", metadata)); - assertThat(body, hasEntry(is("enabled_connections"), is(notNullValue()))); - assertThat(body, hasEntry(is("branding"), is(notNullValue()))); - assertThat(body, hasEntry(is("token_quota"), is(notNullValue()))); - Map tokenQuotaMap = (Map) body.get("token_quota"); - assertThat(tokenQuotaMap, is(notNullValue())); - Map clientCredentialsMap = (Map) tokenQuotaMap.get("client_credentials"); - assertThat(clientCredentialsMap, is(notNullValue())); - assertThat(clientCredentialsMap, hasEntry("per_day", 100)); - assertThat(clientCredentialsMap, hasEntry("per_hour", 20)); - assertThat(clientCredentialsMap, hasEntry("enforce", true)); - - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateOrgWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().update(null, new Organization()), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateOrgWithNullOrg() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().update("org_123", null), - "'organization' cannot be null!"); - } - - @Test - public void shouldUpdateOrganization() throws Exception { - Organization orgToUpdate = new Organization("test-org"); - orgToUpdate.setDisplayName("display name"); - - Colors colors = new Colors(); - colors.setPageBackground("#FF0000"); - colors.setPrimary("#FF0000"); - Branding branding = new Branding(); - branding.setColors(colors); - branding.setLogoUrl("https://some-uri.com"); - orgToUpdate.setBranding(branding); - - Map metadata = new HashMap<>(); - metadata.put("key1", "val1"); - orgToUpdate.setMetadata(metadata); - - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - - TokenQuota tokenQuota = new TokenQuota(clientCredentials); - orgToUpdate.setTokenQuota(tokenQuota); - - Request request = api.organizations().update("org_abc", orgToUpdate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION, 200); - Organization response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/organizations/org_abc")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(5)); - assertThat(body, hasEntry("name", "test-org")); - assertThat(body, hasEntry("display_name", "display name")); - assertThat(body, hasEntry("metadata", metadata)); - assertThat(body, hasEntry(is("branding"), is(notNullValue()))); - assertThat(body, hasEntry(is("token_quota"), is(notNullValue()))); - - Map tokenQuotaMap = (Map) body.get("token_quota"); - assertThat(tokenQuotaMap, is(notNullValue())); - Map clientCredentialsMap = (Map) tokenQuotaMap.get("client_credentials"); - assertThat(clientCredentialsMap, is(notNullValue())); - assertThat(clientCredentialsMap, hasEntry("per_day", 100)); - assertThat(clientCredentialsMap, hasEntry("per_hour", 20)); - assertThat(clientCredentialsMap, hasEntry("enforce", true)); - - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteOrgWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().delete(null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldDeleteOrganization() throws Exception { - Request request = api.organizations().delete("org_abc"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - // Organization members entity - - @Test - public void shouldThrowOnGetMembersWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getMembers(null, null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldListOrgMembersWithoutFilter() throws Exception { - Request request = api.organizations().getMembers("org_abc", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_MEMBERS_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListOrgMembersWithFieldsFilter() throws Exception { - FieldsFilter fieldsFilter = new FieldsFilter().withFields("name,email,user_id,roles", true); - - Request request = api.organizations().getMembers("org_abc", null, fieldsFilter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_MEMBERS_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "name,email,user_id,roles")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListOrgMembersWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(0, 20); - Request request = api.organizations().getMembers("org_abc", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_MEMBERS_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListOrgMembersWithFieldsFilterAndPageFilter() throws Exception { - PageFilter pageFilter = new PageFilter().withPage(0, 20); - FieldsFilter fieldsFilter = new FieldsFilter().withFields("name,email,user_id,roles", true); - - Request request = api.organizations().getMembers("org_abc", pageFilter, fieldsFilter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_MEMBERS_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "name,email,user_id,roles")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListOrgMembersWithTotals() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.organizations().getMembers("org_abc", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_MEMBERS_PAGED_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldListOrgMembersWithCheckpointPageResponse() throws Exception { - PageFilter filter = new PageFilter().withTake(3).withFrom("from-pointer"); - Request request = api.organizations().getMembers("org_abc", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_MEMBERS_CHECKPOINT_PAGED_LIST, 200); - MembersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("take", "3")); - assertThat(recordedRequest, hasQueryParameter("from", "from-pointer")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldThrowOnAddMembersWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addMembers(null, new Members(Collections.singletonList("user1"))), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnAddMembersWhenMembersIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addMembers("org_abc", null), - "'members' cannot be null!"); - } - - @Test - public void shouldAddMembersToOrganization() throws Exception { - List membersList = Arrays.asList("user1", "user2"); - Members members = new Members(membersList); - Request request = api.organizations().addMembers("org_abc", members); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - assertThat(body, hasEntry("members", membersList)); - } - - @Test - public void shouldThrowOnDeleteMembersWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteMembers(null, new Members(Collections.singletonList("user1"))), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteMembersWhenMembersIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteMembers("org_abc", null), - "'members' cannot be null!"); - } - - @Test - public void shouldDeleteMembersFromOrganization() throws Exception { - List membersList = Collections.singletonList("user1"); - Members members = new Members(membersList); - Request request = api.organizations().deleteMembers("org_abc", members); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc/members")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - assertThat(body, hasEntry("members", membersList)); - } - - // Organization connections - - @Test - public void shouldThrowOnGetConnectionsWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteMembers(null, null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldListOrganizationConnectionsWithoutFilter() throws Exception { - Request request = api.organizations().getConnections("org_abc", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_CONNECTIONS_LIST, 200); - EnabledConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/enabled_connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldGetOrganizationConnectionsWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(2, 30); - Request request = api.organizations().getConnections("org_abc", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_CONNECTIONS_LIST, 200); - EnabledConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/enabled_connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "2")); - assertThat(recordedRequest, hasQueryParameter("per_page", "30")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldGetOrganizationConnectionsWithTotals() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.organizations().getConnections("org_abc", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.ORGANIZATION_CONNECTIONS_PAGED_LIST, 200); - EnabledConnectionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/enabled_connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldThrowOnGetConnectionWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getConnection(null, "con_id"), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnGetConnectionWhenConnectionIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getConnection("org_abc",null), - "'connection ID' cannot be null!"); - } - - @Test - public void shouldGetConnection() throws Exception { - Request request = api.organizations().getConnection("org_123", "con_abc"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CONNECTION, 200); - EnabledConnection response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/enabled_connections/con_abc")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnAddConnectionWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addConnection(null, new EnabledConnection()), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnAddConnectionWhenConnectionIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addConnection("org_abc", null), - "'connection' cannot be null!"); - } - - @Test - public void shouldAddConnection() throws Exception { - EnabledConnection connection = new EnabledConnection(); - connection.setAssignMembershipOnLogin(false); - connection.setConnectionId("con_123"); - connection.setShowAsButton(true); - - Request request = api.organizations().addConnection("org_abc", connection); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CONNECTION, 201); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations/org_abc/enabled_connections")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(3)); - assertThat(body, hasEntry("connection_id", "con_123")); - assertThat(body, hasEntry("assign_membership_on_login", false)); - assertThat(body, hasEntry("show_as_button", true)); - } - - @Test - public void shouldThrowOnDeleteConnectionWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteConnection(null, "con_123"), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteConnectionWhenConnectionIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteConnection("org_abc", null), - "'connection ID' cannot be null!"); - } - - @Test - public void shouldDeleteConnection() throws Exception { - Request request = api.organizations().deleteConnection("org_abc", "con_123"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc/enabled_connections/con_123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateConnectionWhenOrgIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().updateConnection(null, "con_123", new EnabledConnection()), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateConnectionWhenUserIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().updateConnection("org_abc", null, new EnabledConnection()), - "'connection ID' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateConnectionWhenConnectionIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().updateConnection("org_abc", "con_123", null), - "'connection' cannot be null!"); - - } - - @Test - public void shouldUpdateOrgConnection() throws Exception { - EnabledConnection connection = new EnabledConnection(); - connection.setAssignMembershipOnLogin(true); - connection.setShowAsButton(false); - - Request request = api.organizations().updateConnection("org_abc", "con_123", connection); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CONNECTION, 201); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/organizations/org_abc/enabled_connections/con_123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(2)); - assertThat(body, hasEntry("assign_membership_on_login", true)); - assertThat(body, hasEntry("show_as_button", false)); - } - - // Organization roles - - @Test - public void shouldThrowOnGetOrgRolesWhenOrgIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getRoles(null, "user_123", null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnGetOrgRolesWhenUserIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getRoles("org_abc", null, null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldGetOrgRolesWithoutPaging() throws Exception { - Request request = api.organizations().getRoles("org_abc", "user_123", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_MEMBER_ROLES_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members/user_123/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - } - - @Test - public void shouldGetOrgRolesWithPaging() throws Exception { - Request request = api.organizations().getRoles("org_abc", "user_123", new PageFilter().withPage(0, 20)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_MEMBER_ROLES_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members/user_123/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - } - - @Test - public void shouldGetOrgRolesWithIncludeTotals() throws Exception { - Request request = api.organizations().getRoles("org_abc", "user_123", new PageFilter().withTotals(true)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_MEMBER_ROLES_PAGED_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_abc/members/user_123/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - } - - @Test - public void shouldThrowOnAddOrgRolesWhenOrgIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addRoles(null, "user_123", new Roles(Collections.singletonList("role_id"))), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnAddOrgRolesWhenUserIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addRoles("org_abc", null, new Roles(Collections.singletonList("role_id"))), - "'user ID' cannot be null!"); - } - - @Test - public void shouldThrowOnAddOrgRolesWhenRolesIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addRoles("org_abc", "user_123", null), - "'roles' cannot be null!"); - } - - @Test - public void shouldAddOrgRoles() throws Exception { - List rolesList = Arrays.asList("role_1", "role_2"); - Request request = api.organizations().addRoles("org_abc", "user_123", new Roles(rolesList)); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations/org_abc/members/user_123/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - assertThat(body, hasEntry("roles", rolesList)); - } - - @Test - public void shouldThrowOnDeleteOrgRolesWhenOrgIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteRoles(null, "user_123", new Roles(Collections.singletonList("role_id"))), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowDeleteOrgRolesWhenUserIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteRoles("org_abc", null, new Roles(Collections.singletonList("role_id"))), - "'user ID' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteOrgRolesWhenRolesIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteRoles("org_abc", "user_123", null), - "'roles' cannot be null!"); - - } - - @Test - public void shouldDeleteOrgRoles() throws Exception { - List rolesList = Arrays.asList("role_1", "role_2"); - Request request = api.organizations().deleteRoles("org_abc", "user_123", new Roles(rolesList)); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc/members/user_123/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - assertThat(body, hasEntry("roles", rolesList)); - } - - // Invitations - - @Test - public void shouldThrowOnGetInvitationWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getInvitation(null, "invitation_id", null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnGetInvitationWithNullInvitationId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getInvitation("org_id", null, null), - "'invitation ID' cannot be null!"); - } - - @Test - public void shouldGetInvitationWithoutFilter() throws Exception { - Request request = api.organizations().getInvitation("org_123", "invitation_id", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATION, 200); - Invitation response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations/invitation_id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetInvitationWithFilter() throws Exception { - Request request = api.organizations().getInvitation("org_123", "invitation_id", - new FieldsFilter().withFields("id,invitation_url,invitee", true)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATION, 200); - Invitation response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations/invitation_id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "id,invitation_url,invitee")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetInvitationsWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().getInvitations(null, null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldGetInvitationsWithoutFilter() throws Exception { - Request request = api.organizations().getInvitations("org_123", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATIONS_LIST, 200); - InvitationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetInvitationsWithFilter() throws Exception { - InvitationsFilter filter = new InvitationsFilter() - .withSort("created_at:1") - .withFields("invitee,inviter,created_at", true); - - Request request = api.organizations().getInvitations("org_123", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATIONS_LIST, 200); - InvitationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "invitee,inviter,created_at")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - assertThat(recordedRequest, hasQueryParameter("sort", "created_at:1")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetInvitationsWithPaging() throws Exception { - InvitationsFilter filter = new InvitationsFilter().withPage(0, 20); - - Request request = api.organizations().getInvitations("org_123", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATIONS_LIST, 200); - InvitationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetInvitationsWithTotals() throws Exception { - InvitationsFilter filter = new InvitationsFilter().withTotals(true); - - Request request = api.organizations().getInvitations("org_123", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATIONS_PAGED_LIST, 200); - InvitationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/org_123/invitations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateInvitationWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().createInvitation(null, null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateInvitationWithNullInvitation() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().createInvitation("org_abc", null), - "'invitation' cannot be null!"); - } - - @Test - public void shouldCreateInvitation() throws Exception { - Invitation invitation = new Invitation(new Inviter("name"), new Invitee("name@domain.com"), "con_id"); - invitation.setTtlInSeconds(300); - invitation.setConnectionId("con_id"); - invitation.setSendInvitationEmail(true); - - Request request = api.organizations().createInvitation("org_123", invitation); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(INVITATION, 201); - Invitation response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations/org_123/invitations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(6)); - assertThat(body, hasEntry("send_invitation_email", true)); - assertThat(body, hasEntry("connection_id", "con_id")); - assertThat(body, hasEntry("ttl_sec", 300)); - assertThat(body, hasEntry("inviter", Collections.singletonMap("name", "name"))); - assertThat(body, hasEntry("invitee", Collections.singletonMap("email", "name@domain.com"))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteInvitationWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteInvitation(null, "inv_123"), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteInvitationWithNullInvitationId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteInvitation("org_abc", null), - "'invitation ID' cannot be null!"); - } - - @Test - public void shouldDeleteInvitation() throws Exception { - Request request = api.organizations().deleteInvitation("org_abc", "inv_123"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc/invitations/inv_123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldListClientGrantsWithoutFilter() throws Exception { - Request request = api.organizations().listClientGrants("orgId", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CLIENT_GRANTS, 200); - OrganizationClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/orgId/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListClientGrantsWithFilter() throws Exception { - OrganizationClientGrantsFilter filter = new OrganizationClientGrantsFilter(); - filter - .withClientId("clientId") - .withAudience("https://api-identifier/") - .withPage(1, 2) - .withTotals(true); - - Request request = api.organizations().listClientGrants("orgId", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CLIENT_GRANTS_PAGED_LIST, 200); - OrganizationClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/orgId/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "2")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - assertThat(recordedRequest, hasQueryParameter("audience", "https://api-identifier/")); - assertThat(recordedRequest, hasQueryParameter("client_id", "clientId")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - } - - @Test - public void shouldListClientGrantsWithGrantIds() throws Exception { - OrganizationClientGrantsFilter filter = new OrganizationClientGrantsFilter(); - filter - .withClientId("clientId") - .withAudience("https://api-identifier/") - .withGrantIds("cgr_123456789012,cgr_abcdefghijkl"); - - Request request = api.organizations().listClientGrants("orgId", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATION_CLIENT_GRANTS_PAGED_LIST, 200); - OrganizationClientGrantsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/organizations/orgId/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("grant_ids", "cgr_123456789012,cgr_abcdefghijkl")); - assertThat(recordedRequest, hasQueryParameter("audience", "https://api-identifier/")); - assertThat(recordedRequest, hasQueryParameter("client_id", "clientId")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - } - - @Test - public void shouldThrowOnGetClientGrantsWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().listClientGrants(null, null), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldCreateClientGrant() throws Exception { - CreateOrganizationClientGrantRequestBody requestBody = new CreateOrganizationClientGrantRequestBody("grant-id"); - - Request request = api.organizations().addClientGrant("org_123", requestBody); - - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CLIENT_GRANT, 201); - OrganizationClientGrant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/organizations/org_123/client-grants")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(1)); - assertThat(body, hasEntry("grant_id", "grant-id")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateClientGrantWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addClientGrant(null, new CreateOrganizationClientGrantRequestBody("id")), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateClientGreatWithNullGrant() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().addClientGrant("org_1213", null), - "'client grant' cannot be null!"); - } - - @Test - public void shouldDeleteClientGrant() throws Exception { - Request request = api.organizations().deleteClientGrant("org_abc", "grant_123"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/organizations/org_abc/client-grants/grant_123")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnDeleteClientGrantWithNullOrgId() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteClientGrant(null, "grant-id"), - "'organization ID' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteClientGreatWithNullGrant() { - verifyThrows(IllegalArgumentException.class, - () -> api.organizations().deleteClientGrant("org_1213", null), - "'client grant ID' cannot be null!"); - } - - @Test - public void testClientGrantsWithOrg() throws Auth0Exception { - - Organization organization = null; - ResourceServer resourceServer = null; - Client client = null; - ClientGrant clientGrant = null; - OrganizationClientGrant organizationClientGrant = null; - - try { - //Create organization - organization = givenAnOrganization(); - - //Create resource server - resourceServer = givenAResourceServer(); - - //Create client - client = createNewClient(organization.getId()); - - //Create client grants - clientGrant = createNewClientGrant(client, resourceServer); - - //Associates the grant with an organization. - organizationClientGrant = api.organizations().addClientGrant(organization.getId(), new CreateOrganizationClientGrantRequestBody(clientGrant.getId())).execute().getBody(); - - ClientFilter clientFilter = new ClientFilter(); - clientFilter.withQuery("client_grant.organization_id:" + organization.getId()); - - // List all clients associated with a ClientGrant given an organizationID as query param - ClientsPage clientsPage = api.clients().list(clientFilter).execute().getBody(); - - for (Client c : clientsPage.getItems()) { - assertThat(organization.getId(), is(c.getDefaultOrganization().getOrganizationId())); - } - - OrganizationClientGrantsFilter filter = new OrganizationClientGrantsFilter(); - filter.withGrantIds(clientGrant.getId()); - - // List all ClientGrants given a list of grant_ids as query param - OrganizationClientGrantsPage organizationClientGrantsPage = api.organizations().listClientGrants(organization.getId(), filter).execute().getBody(); - - assertThat(organizationClientGrantsPage.getItems().size(), is(1)); - assertThat(organizationClientGrantsPage.getItems().get(0).getClientId(), is(clientGrant.getClientId())); - - // Remove the associated ClientGrants - api.organizations().deleteClientGrant(organization.getId(), organizationClientGrant.getId()).execute(); - - // List all ClientGrants which should be an empty list since grant has been removed from the organization. - OrganizationClientGrantsPage organizationClientGrantsPage1 = api.organizations().listClientGrants(organization.getId(), filter).execute().getBody(); - assertThat(organizationClientGrantsPage1.getItems().size(), is(0)); - - // Delete the ClientGrant. - api.clientGrants().delete(clientGrant.getId()).execute(); - - // Retrieve the ClientGrant and ensure error is return since grant has been deleted. - ClientGrantsPage clientGrantsPage = api.clientGrants().list(new ClientGrantsFilter().withClientId(client.getClientId())).execute().getBody(); - assertThat(clientGrantsPage.getItems().size(), is(0)); - } - catch (Exception ex){ - ex.printStackTrace(); - } - } - - private ClientGrant createNewClientGrant(Client client, ResourceServer resourceServer) throws Auth0Exception { - ClientGrant clientGrant = new ClientGrant(); - clientGrant.setClientId(client.getClientId()); - clientGrant.setAudience(resourceServer.getIdentifier()); - clientGrant.setScope(Arrays.asList("create:resource", "create:organization_client_grants")); - clientGrant.setAllowAnyOrganization(true); - clientGrant.setOrganizationUsage("allow"); - - return api.clientGrants().create(client.getClientId(), resourceServer.getIdentifier(), new String[]{"create:resource", "create:organization_client_grants"}).execute().getBody(); - } - - private Client createNewClient(String orgId) throws Auth0Exception { - Client client = new Client("Test Client (" + System.currentTimeMillis() + ")"); - client.setDescription("This is just a test client."); - client.setOrganizationUsage("allow"); - client.setDefaultOrganization(new ClientDefaultOrganization(Arrays.asList("client_credentials"), orgId)); - - return api.clients().create(client).execute().getBody(); - } - - private Organization givenAnOrganization() throws Auth0Exception { - Organization organization = new Organization(); - organization.setName("test-organization"); - organization.setDisplayName("test-organization"); - - return api.organizations().create(organization).execute().getBody(); - } - - private ResourceServer givenAResourceServer() throws Auth0Exception { - ResourceServer resourceServer = new ResourceServer("https://www.tanyaisawesome.com"); - resourceServer.setName("tanyaisawesome"); - - return api.resourceServers().create(resourceServer).execute().getBody(); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java new file mode 100644 index 000000000..96deab10b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java @@ -0,0 +1,192 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; +import com.auth0.client.mgmt.types.AssociateOrganizationClientGrantResponseContent; +import com.auth0.client.mgmt.types.OrganizationClientGrant; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsClientGrantsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"client_grants\":[{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true}]}")); + SyncPagingIterable response = client.organizations() + .clientGrants() + .list( + "id", + ListOrganizationClientGrantsRequestParameters.builder() + .audience("audience") + .clientId("client_id") + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true}")); + AssociateOrganizationClientGrantResponseContent response = client.organizations() + .clientGrants() + .create( + "id", + AssociateOrganizationClientGrantRequestContent.builder() + .grantId("grant_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"grant_id\": \"grant_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ],\n" + + " \"organization_usage\": \"deny\",\n" + + " \"allow_any_organization\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().clientGrants().delete("id", "grant_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java new file mode 100644 index 000000000..5a94e2c58 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java @@ -0,0 +1,342 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestContent; +import com.auth0.client.mgmt.types.AddOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationConnection; +import com.auth0.client.mgmt.types.UpdateOrganizationConnectionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsEnabledConnectionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"enabled_connections\":[{\"connection_id\":\"connection_id\",\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true}]}")); + SyncPagingIterable response = client.organizations() + .enabledConnections() + .list( + "id", + ListOrganizationConnectionsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testAdd() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + AddOrganizationConnectionResponseContent response = client.organizations() + .enabledConnections() + .add( + "id", + AddOrganizationConnectionRequestContent.builder() + .connectionId("connection_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"connection_id\": \"connection_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + GetOrganizationConnectionResponseContent response = + client.organizations().enabledConnections().get("id", "connectionId"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().enabledConnections().delete("id", "connectionId"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + UpdateOrganizationConnectionResponseContent response = client.organizations() + .enabledConnections() + .update( + "id", + "connectionId", + UpdateOrganizationConnectionRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java new file mode 100644 index 000000000..e32781b4c --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java @@ -0,0 +1,307 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; +import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationInvitationsRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationInvitationResponseContent; +import com.auth0.client.mgmt.types.OrganizationInvitation; +import com.auth0.client.mgmt.types.OrganizationInvitationInvitee; +import com.auth0.client.mgmt.types.OrganizationInvitationInviter; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsInvitationsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"invitations\":[{\"id\":\"id\",\"organization_id\":\"organization_id\",\"inviter\":{\"name\":\"name\"},\"invitee\":{\"email\":\"email\"},\"invitation_url\":\"invitation_url\",\"created_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"connection_id\":\"connection_id\",\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"roles\":[\"roles\"],\"ticket_id\":\"ticket_id\"}]}")); + SyncPagingIterable response = client.organizations() + .invitations() + .list( + "id", + ListOrganizationInvitationsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .fields("fields") + .includeFields(true) + .sort("sort") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"organization_id\":\"organization_id\",\"inviter\":{\"name\":\"name\"},\"invitee\":{\"email\":\"email\"},\"invitation_url\":\"invitation_url\",\"created_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"connection_id\":\"connection_id\",\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"roles\":[\"roles\"],\"ticket_id\":\"ticket_id\"}")); + CreateOrganizationInvitationResponseContent response = client.organizations() + .invitations() + .create( + "id", + CreateOrganizationInvitationRequestContent.builder() + .inviter(OrganizationInvitationInviter.builder() + .name("name") + .build()) + .invitee(OrganizationInvitationInvitee.builder() + .email("email") + .build()) + .clientId("client_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"inviter\": {\n" + + " \"name\": \"name\"\n" + + " },\n" + + " \"invitee\": {\n" + + " \"email\": \"email\"\n" + + " },\n" + + " \"client_id\": \"client_id\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"inviter\": {\n" + + " \"name\": \"name\"\n" + + " },\n" + + " \"invitee\": {\n" + + " \"email\": \"email\"\n" + + " },\n" + + " \"invitation_url\": \"invitation_url\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"roles\": [\n" + + " \"roles\"\n" + + " ],\n" + + " \"ticket_id\": \"ticket_id\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"organization_id\":\"organization_id\",\"inviter\":{\"name\":\"name\"},\"invitee\":{\"email\":\"email\"},\"invitation_url\":\"invitation_url\",\"created_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"connection_id\":\"connection_id\",\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"roles\":[\"roles\"],\"ticket_id\":\"ticket_id\"}")); + GetOrganizationInvitationResponseContent response = client.organizations() + .invitations() + .get( + "id", + "invitation_id", + GetOrganizationInvitationRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"organization_id\": \"organization_id\",\n" + + " \"inviter\": {\n" + + " \"name\": \"name\"\n" + + " },\n" + + " \"invitee\": {\n" + + " \"email\": \"email\"\n" + + " },\n" + + " \"invitation_url\": \"invitation_url\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"client_id\": \"client_id\",\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"roles\": [\n" + + " \"roles\"\n" + + " ],\n" + + " \"ticket_id\": \"ticket_id\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().invitations().delete("id", "invitation_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java new file mode 100644 index 000000000..4a4d1bb18 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java @@ -0,0 +1,184 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; +import com.auth0.client.mgmt.organizations.members.types.ListOrganizationMemberRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsMembersRolesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"roles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}]}")); + SyncPagingIterable response = client.organizations() + .members() + .roles() + .list( + "id", + "user_id", + ListOrganizationMemberRolesRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testAssign() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations() + .members() + .roles() + .assign( + "id", + "user_id", + AssignOrganizationMemberRolesRequestContent.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations() + .members() + .roles() + .delete( + "id", + "user_id", + DeleteOrganizationMemberRolesRequestContent.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java new file mode 100644 index 000000000..7f3db2378 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java @@ -0,0 +1,179 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; +import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationMembersRequestParameters; +import com.auth0.client.mgmt.types.OrganizationMember; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsMembersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"members\":[{\"user_id\":\"user_id\",\"picture\":\"picture\",\"name\":\"name\",\"email\":\"email\",\"roles\":[{}]}]}")); + SyncPagingIterable response = client.organizations() + .members() + .list( + "id", + ListOrganizationMembersRequestParameters.builder() + .from("from") + .take(1) + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations() + .members() + .create( + "id", + CreateOrganizationMemberRequestContent.builder() + .members(Arrays.asList("members")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"members\": [\n" + " \"members\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations() + .members() + .delete( + "id", + DeleteOrganizationMembersRequestContent.builder() + .members(Arrays.asList("members")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"members\": [\n" + " \"members\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java new file mode 100644 index 000000000..5105e1266 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java @@ -0,0 +1,443 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationByNameResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; +import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + SyncPagingIterable response = client.organizations() + .list(ListOrganizationsRequestParameters.builder() + .from("from") + .take(1) + .sort("sort") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"}},\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"enabled_connections\":[{\"connection_id\":\"connection_id\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true}]}")); + CreateOrganizationResponseContent response = client.organizations() + .create(CreateOrganizationRequestContent.builder().name("name").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " }\n" + + " },\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " },\n" + + " \"enabled_connections\": [\n" + + " {\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetByName() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"}},\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + GetOrganizationByNameResponseContent response = client.organizations().getByName("name"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " }\n" + + " },\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"}},\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + GetOrganizationResponseContent response = client.organizations().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " }\n" + + " },\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\",\"page_background\":\"page_background\"}},\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + UpdateOrganizationResponseContent response = client.organizations() + .update("id", UpdateOrganizationRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\",\n" + + " \"page_background\": \"page_background\"\n" + + " }\n" + + " },\n" + + " \"metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"token_quota\": {\n" + + " \"client_credentials\": {\n" + + " \"enforce\": true,\n" + + " \"per_day\": 1,\n" + + " \"per_hour\": 1\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java new file mode 100644 index 000000000..00f0ecb4a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java @@ -0,0 +1,150 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.PromptLanguageEnum; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class PromptsCustomTextWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = + client.prompts().customText().get(PromptGroupNameEnum.LOGIN, PromptLanguageEnum.AM); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.prompts() + .customText() + .set(PromptGroupNameEnum.LOGIN, PromptLanguageEnum.AM, new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/PromptsEntityTest.java b/src/test/java/com/auth0/client/mgmt/PromptsEntityTest.java deleted file mode 100644 index 435baf3c1..000000000 --- a/src/test/java/com/auth0/client/mgmt/PromptsEntityTest.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.prompts.Prompt; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static com.auth0.AssertsUtil.verifyThrows; - -public class PromptsEntityTest extends BaseMgmtEntityTest{ - - @Test - public void shouldGetPrompts() throws Exception { - Request request = api.prompts().getPrompt(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_PROMPT, 200); - Prompt response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/prompts")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdatePromptsWhenPromptIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().updatePrompt(null), - "'prompt' cannot be null!"); - } - - @Test - public void shouldUpdatePrompts() throws Exception { - Prompt prompt = new Prompt(); - prompt.setIdentifierFirst(true); - prompt.setUniversalLoginExperience("new"); - prompt.setWebauthnPlatformFirstFactor(true); - - Request request = api.prompts().updatePrompt(prompt); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_PROMPT, 200); - Prompt response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/prompts")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.isIdentifierFirst(), is(true)); - assertThat(response.getUniversalLoginExperience(), is("new")); - assertThat(response.isWebauthnPlatformFirstFactor(), is(true)); - } - - @Test - public void shouldThrowOnGetCustomTextWhenPromptIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().getCustomText(null, "en"), - "'prompt' cannot be null!"); - } - - @Test - public void shouldThrowOnGetCustomTextWhenLanguageIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().getCustomText("login", null), - "'language' cannot be null!"); - } - - @Test - public void shouldGetCustomText() throws Exception { - Request request = api.prompts().getCustomText("login", "en"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CUSTOM_TEXT_PROMPT, 200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/prompts/login/custom-text/en")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnSetCustomTextWhenPromptIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().getCustomText(null, "en"), - "'prompt' cannot be null!"); - } - - @Test - public void shouldThrowOnSetCustomTextWhenLanguageIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().getCustomText("login", null), - "'language' cannot be null!"); - } - - @Test - public void shouldThrowOnSetCustomTextWhenCustomTextIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().setCustomText("login", "en", null), - "'customText' cannot be null!"); - } - - @Test - public void shouldSetCustomText() throws Exception { - Map signup = new HashMap<>(); - signup.put("description", "Sign up to access amazing features for my login domain"); - - Map customText = new HashMap<>(); - customText.put("signup", signup); - - Request request = api.prompts().setCustomText("login", "en", customText); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CUSTOM_TEXT_PROMPT, 200); - request.execute(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/prompts/login/custom-text/en")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnGetPartialsWhenPromptIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().getPartialsPrompt(null), - "'prompt' cannot be null!"); - } - - @Test - public void shouldGetPartials() throws Exception { - Request request = api.prompts().getPartialsPrompt("login"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_PARTIALS_PROMPT, 200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/prompts/login/partials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnSetPartialsWhenPromptIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().setPartialsPrompt(null, new Object()), - "'prompt' cannot be null!"); - } - - @Test - public void shouldThrowOnSetPartialsWhenPartialsIsNull() throws Exception { - verifyThrows(IllegalArgumentException.class, - () -> api.prompts().setPartialsPrompt("login", null), - "'partials' cannot be null!"); - } - - @Test - public void shouldSetPartials() throws Exception { - Map partials = new HashMap<>(); - Request request = api.prompts().setPartialsPrompt("login", partials); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_PARTIALS_PROMPT, 200); - request.execute(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/prompts/login/partials")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java new file mode 100644 index 000000000..b4372bbca --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java @@ -0,0 +1,146 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.PartialGroupsEnum; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class PromptsPartialsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.prompts().partials().get(PartialGroupsEnum.LOGIN); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.prompts().partials().set(PartialGroupsEnum.LOGIN, new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java new file mode 100644 index 000000000..3be7d9d41 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java @@ -0,0 +1,280 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; +import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculRenderingModeEnum; +import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.GetAculResponseContent; +import com.auth0.client.mgmt.types.PromptGroupNameEnum; +import com.auth0.client.mgmt.types.ScreenGroupNameEnum; +import com.auth0.client.mgmt.types.UpdateAculResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class PromptsRenderingWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"configs\":[{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{}],\"use_page_template\":true}],\"start\":1.1,\"limit\":1.1,\"total\":1.1}")); + SyncPagingIterable response = client.prompts() + .rendering() + .list(ListAculsRequestParameters.builder() + .fields("fields") + .includeFields(true) + .page(1) + .perPage(1) + .includeTotals(true) + .prompt("prompt") + .screen("screen") + .renderingMode(AculRenderingModeEnum.ADVANCED) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"tenant\":\"tenant\",\"prompt\":\"prompt\",\"screen\":\"screen\",\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{\"tag\":\"tag\",\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{}],\"organizations\":[{}],\"domains\":[{}]},\"use_page_template\":true}")); + GetAculResponseContent response = + client.prompts().rendering().get(PromptGroupNameEnum.LOGIN, ScreenGroupNameEnum.LOGIN); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"tenant\": \"tenant\",\n" + + " \"prompt\": \"prompt\",\n" + + " \"screen\": \"screen\",\n" + + " \"rendering_mode\": \"advanced\",\n" + + " \"context_configuration\": [\n" + + " \"context_configuration\"\n" + + " ],\n" + + " \"default_head_tags_disabled\": true,\n" + + " \"head_tags\": [\n" + + " {\n" + + " \"tag\": \"tag\",\n" + + " \"content\": \"content\"\n" + + " }\n" + + " ],\n" + + " \"filters\": {\n" + + " \"match_type\": \"includes_any\",\n" + + " \"clients\": [\n" + + " {}\n" + + " ],\n" + + " \"organizations\": [\n" + + " {}\n" + + " ],\n" + + " \"domains\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"use_page_template\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{\"tag\":\"tag\",\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{}],\"organizations\":[{}],\"domains\":[{}]},\"use_page_template\":true}")); + UpdateAculResponseContent response = client.prompts() + .rendering() + .update( + PromptGroupNameEnum.LOGIN, + ScreenGroupNameEnum.LOGIN, + UpdateAculRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"rendering_mode\": \"advanced\",\n" + + " \"context_configuration\": [\n" + + " \"context_configuration\"\n" + + " ],\n" + + " \"default_head_tags_disabled\": true,\n" + + " \"head_tags\": [\n" + + " {\n" + + " \"tag\": \"tag\",\n" + + " \"content\": \"content\"\n" + + " }\n" + + " ],\n" + + " \"filters\": {\n" + + " \"match_type\": \"includes_any\",\n" + + " \"clients\": [\n" + + " {}\n" + + " ],\n" + + " \"organizations\": [\n" + + " {}\n" + + " ],\n" + + " \"domains\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"use_page_template\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java new file mode 100644 index 000000000..2d803509a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java @@ -0,0 +1,195 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateSettingsRequestContent; +import com.auth0.client.mgmt.types.UpdateSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class PromptsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetSettings() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"universal_login_experience\":\"new\",\"identifier_first\":true,\"webauthn_platform_first_factor\":true}")); + GetSettingsResponseContent response = client.prompts().getSettings(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"universal_login_experience\": \"new\",\n" + + " \"identifier_first\": true,\n" + + " \"webauthn_platform_first_factor\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateSettings() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"universal_login_experience\":\"new\",\"identifier_first\":true,\"webauthn_platform_first_factor\":true}")); + UpdateSettingsResponseContent response = client.prompts() + .updateSettings(UpdateSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"universal_login_experience\": \"new\",\n" + + " \"identifier_first\": true,\n" + + " \"webauthn_platform_first_factor\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RefreshTokensEntityTest.java b/src/test/java/com/auth0/client/mgmt/RefreshTokensEntityTest.java deleted file mode 100644 index 69ef26841..000000000 --- a/src/test/java/com/auth0/client/mgmt/RefreshTokensEntityTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.refreshtokens.RefreshToken; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_REFRESH_TOKEN; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RefreshTokensEntityTest extends BaseMgmtEntityTest{ - - @Test - public void shouldThrowOnGetWithNullRefreshTokenId() { - verifyThrows(IllegalArgumentException.class, - () -> api.refreshTokens().get(null), - "'refresh token ID' cannot be null!"); - } - - @Test - public void shouldGetRefreshToken() throws Exception { - Request request = api.refreshTokens().get("refresh_token_ID"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_REFRESH_TOKEN, 200); - RefreshToken response =request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/refresh-tokens/refresh_token_ID")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteWithNullRefreshTokenId() { - verifyThrows(IllegalArgumentException.class, - () -> api.refreshTokens().delete(null), - "'refresh token ID' cannot be null!"); - } - - @Test - public void shouldDeleteRefreshToken() throws Exception { - Request request = api.refreshTokens().delete("refresh_token_ID"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/refresh-tokens/refresh_token_ID")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java new file mode 100644 index 000000000..0d224496d --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java @@ -0,0 +1,140 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RefreshTokensWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"initial_user_agent\":\"initial_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\",\"last_user_agent\":\"last_user_agent\"},\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{\"audience\":\"audience\",\"scopes\":\"scopes\"}],\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}")); + GetRefreshTokenResponseContent response = client.refreshTokens().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"idle_expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"device\": {\n" + + " \"initial_ip\": \"initial_ip\",\n" + + " \"initial_asn\": \"initial_asn\",\n" + + " \"initial_user_agent\": \"initial_user_agent\",\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_asn\": \"last_asn\",\n" + + " \"last_user_agent\": \"last_user_agent\"\n" + + " },\n" + + " \"client_id\": \"client_id\",\n" + + " \"session_id\": \"session_id\",\n" + + " \"rotating\": true,\n" + + " \"resource_servers\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scopes\": \"scopes\"\n" + + " }\n" + + " ],\n" + + " \"last_exchanged_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.refreshTokens().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ResourceServerEntityTest.java b/src/test/java/com/auth0/client/mgmt/ResourceServerEntityTest.java deleted file mode 100644 index e4f7d9fe8..000000000 --- a/src/test/java/com/auth0/client/mgmt/ResourceServerEntityTest.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.ResourceServersFilter; -import com.auth0.json.mgmt.resourceserver.ResourceServer; -import com.auth0.json.mgmt.resourceserver.ResourceServersPage; -import com.auth0.json.mgmt.resourceserver.Scope; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.Map; - -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ResourceServerEntityTest extends BaseMgmtEntityTest { - - - @Test - public void shouldListResourceServerWithoutFilter() throws Exception { - Request request = api.resourceServers().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVERS_LIST, 200); - ResourceServersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListResourceServerWithPage() throws Exception { - ResourceServersFilter filter = new ResourceServersFilter().withPage(23, 5); - Request request = api.resourceServers().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVERS_LIST, 200); - ResourceServersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListResourceServerWithTotals() throws Exception { - ResourceServersFilter filter = new ResourceServersFilter().withTotals(true); - Request request = api.resourceServers().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVERS_PAGED_LIST, 200); - ResourceServersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListResourceServerWithIdentifiers() throws Exception { - ResourceServersFilter filter = new ResourceServersFilter().withIdentifiers("identifier"); - Request request = api.resourceServers().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVERS_PAGED_LIST, 200); - ResourceServersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("identifiers", "identifier")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListResourceServerWithCheckpointPagination() throws Exception { - ResourceServersFilter filter = new ResourceServersFilter().withCheckpointPagination("tokenId2", 5); - Request request = api.resourceServers().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVERS_PAGED_LIST, 200); - ResourceServersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "tokenId2")); - assertThat(recordedRequest, hasQueryParameter("take", "5")); - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldUpdateResourceServer() throws Exception { - ResourceServer resourceServer = new ResourceServer("https://api.my-company.com/api/v2/"); - resourceServer.setId("23445566abab"); - resourceServer.setName("Some API"); - resourceServer.setScopes(Collections.singletonList(new Scope("update:something"))); - resourceServer.setSigningAlgorithm("RS256"); - resourceServer.setSigningSecret("secret"); - resourceServer.setAllowOfflineAccess(false); - resourceServer.setEnforcePolicies(true); - resourceServer.setSkipConsentForVerifiableFirstPartyClients(false); - resourceServer.setTokenDialect("access_token"); - resourceServer.setTokenLifetime(0); - resourceServer.setVerificationLocation("verification_location"); - Request request = api.resourceServers() - .update("23445566abab", resourceServer); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVER, 200); - ResourceServer response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/resource-servers/23445566abab")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(12)); - assertThat(body, hasEntry("identifier", "https://api.my-company.com/api/v2/")); - - assertThat(response.getIdentifier(), is("https://api.my-company.com/api/v2/")); - } - - @Test - public void shouldGetResourceServerById() throws Exception { - Request request = api.resourceServers() - .get("23445566abab"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVER, 200); - ResourceServer response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/resource-servers/23445566abab")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response.getIdentifier(), is("https://api.my-company.com/api/v2/")); - } - - @Test - public void shouldCreateResourceServer() throws Exception { - Request request = api.resourceServers() - .create(new ResourceServer("https://api.my-company.com/api/v2/")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RESOURCE_SERVER, 200); - ResourceServer response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/resource-servers")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("identifier", "https://api.my-company.com/api/v2/")); - - assertThat(response.getIdentifier(), is("https://api.my-company.com/api/v2/")); - } - - @Test - public void shouldDeleteResourceServer() throws Exception { - Request request = api.resourceServers() - .delete("23445566abab"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/resource-servers/23445566abab")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java new file mode 100644 index 000000000..e0820a626 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java @@ -0,0 +1,425 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; +import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; +import com.auth0.client.mgmt.types.GetResourceServerRequestParameters; +import com.auth0.client.mgmt.types.GetResourceServerResponseContent; +import com.auth0.client.mgmt.types.ListResourceServerRequestParameters; +import com.auth0.client.mgmt.types.ResourceServer; +import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; +import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ResourceServersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}]}")); + SyncPagingIterable response = client.resourceServers() + .list(ListResourceServerRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + CreateResourceServerResponseContent response = client.resourceServers() + .create(CreateResourceServerRequestContent.builder() + .identifier("identifier") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"identifier\": \"identifier\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"is_system\": true,\n" + + " \"identifier\": \"identifier\",\n" + + " \"scopes\": [\n" + + " {\n" + + " \"value\": \"value\",\n" + + " \"description\": \"description\"\n" + + " }\n" + + " ],\n" + + " \"signing_alg\": \"HS256\",\n" + + " \"signing_secret\": \"signing_secret\",\n" + + " \"allow_offline_access\": true,\n" + + " \"skip_consent_for_verifiable_first_party_clients\": true,\n" + + " \"token_lifetime\": 1,\n" + + " \"token_lifetime_for_web\": 1,\n" + + " \"enforce_policies\": true,\n" + + " \"token_dialect\": \"access_token\",\n" + + " \"token_encryption\": {\n" + + " \"format\": \"compact-nested-jwe\",\n" + + " \"encryption_key\": {\n" + + " \"name\": \"name\",\n" + + " \"alg\": \"RSA-OAEP-256\",\n" + + " \"kid\": \"kid\",\n" + + " \"pem\": \"pem\"\n" + + " }\n" + + " },\n" + + " \"consent_policy\": \"transactional-authorization-with-mfa\",\n" + + " \"authorization_details\": [\n" + + " {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " ],\n" + + " \"proof_of_possession\": {\n" + + " \"mechanism\": \"mtls\",\n" + + " \"required\": true\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + GetResourceServerResponseContent response = client.resourceServers() + .get( + "id", + GetResourceServerRequestParameters.builder() + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"is_system\": true,\n" + + " \"identifier\": \"identifier\",\n" + + " \"scopes\": [\n" + + " {\n" + + " \"value\": \"value\",\n" + + " \"description\": \"description\"\n" + + " }\n" + + " ],\n" + + " \"signing_alg\": \"HS256\",\n" + + " \"signing_secret\": \"signing_secret\",\n" + + " \"allow_offline_access\": true,\n" + + " \"skip_consent_for_verifiable_first_party_clients\": true,\n" + + " \"token_lifetime\": 1,\n" + + " \"token_lifetime_for_web\": 1,\n" + + " \"enforce_policies\": true,\n" + + " \"token_dialect\": \"access_token\",\n" + + " \"token_encryption\": {\n" + + " \"format\": \"compact-nested-jwe\",\n" + + " \"encryption_key\": {\n" + + " \"name\": \"name\",\n" + + " \"alg\": \"RSA-OAEP-256\",\n" + + " \"kid\": \"kid\",\n" + + " \"pem\": \"pem\"\n" + + " }\n" + + " },\n" + + " \"consent_policy\": \"transactional-authorization-with-mfa\",\n" + + " \"authorization_details\": [\n" + + " {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " ],\n" + + " \"proof_of_possession\": {\n" + + " \"mechanism\": \"mtls\",\n" + + " \"required\": true\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.resourceServers().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + UpdateResourceServerResponseContent response = client.resourceServers() + .update("id", UpdateResourceServerRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"is_system\": true,\n" + + " \"identifier\": \"identifier\",\n" + + " \"scopes\": [\n" + + " {\n" + + " \"value\": \"value\",\n" + + " \"description\": \"description\"\n" + + " }\n" + + " ],\n" + + " \"signing_alg\": \"HS256\",\n" + + " \"signing_secret\": \"signing_secret\",\n" + + " \"allow_offline_access\": true,\n" + + " \"skip_consent_for_verifiable_first_party_clients\": true,\n" + + " \"token_lifetime\": 1,\n" + + " \"token_lifetime_for_web\": 1,\n" + + " \"enforce_policies\": true,\n" + + " \"token_dialect\": \"access_token\",\n" + + " \"token_encryption\": {\n" + + " \"format\": \"compact-nested-jwe\",\n" + + " \"encryption_key\": {\n" + + " \"name\": \"name\",\n" + + " \"alg\": \"RSA-OAEP-256\",\n" + + " \"kid\": \"kid\",\n" + + " \"pem\": \"pem\"\n" + + " }\n" + + " },\n" + + " \"consent_policy\": \"transactional-authorization-with-mfa\",\n" + + " \"authorization_details\": [\n" + + " {\n" + + " \"key\": \"value\"\n" + + " }\n" + + " ],\n" + + " \"proof_of_possession\": {\n" + + " \"mechanism\": \"mtls\",\n" + + " \"required\": true\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java b/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java deleted file mode 100644 index 77c48cc1d..000000000 --- a/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java +++ /dev/null @@ -1,481 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.client.mgmt.filter.RolesFilter; -import com.auth0.json.mgmt.permissions.Permission; -import com.auth0.json.mgmt.permissions.PermissionsPage; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class RolesEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListRolesWithoutFilter() throws Exception { - Request request = api.roles().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLES_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRolesWithPage() throws Exception { - RolesFilter filter = new RolesFilter().withPage(23, 5); - Request request = api.roles().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLES_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRolesWithTotals() throws Exception { - RolesFilter filter = new RolesFilter().withTotals(true); - Request request = api.roles().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLES_PAGED_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldGetRole() throws Exception { - Request request = api.roles().get("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE, 200); - Role response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetRoleWithNullRoleId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().get(null), - "'role id' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateRoleWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().create(null), - "'user' cannot be null!"); - } - - @Test - public void shouldCreateRole() throws Exception { - Role newRole = new Role(); - newRole.setName("roleId"); - Request request = api.roles().create(newRole); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE, 200); - Role response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("name", "roleId")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateRoleWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().update(null, new Role()), - "'role id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateRoleWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().update("1", null), - "'role' cannot be null!"); - } - - @Test - public void shouldUpdateRole() throws Exception { - Role updatedRole = new Role(); - updatedRole.setName("roleId"); - Request request = api.roles().update("1", updatedRole); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE, 200); - Role response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/roles/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("name", "roleId")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteRoleWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().delete(null), - "'role id' cannot be null!"); - } - - @Test - public void shouldDeleteRole() throws Exception { - Request request = api.roles().delete("1"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/roles/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnListUsersWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().listUsers(null, null), - "'role id' cannot be null!"); - } - - @Test - public void shouldListUsersWithoutFilter() throws Exception { - Request request = api.roles().listUsers("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_USERS_PAGED_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(23, 5); - Request request = api.roles().listUsers("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_USERS_PAGED_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithTotals() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.roles().listUsers("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_USERS_PAGED_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListUsersWithCheckpointPaging() throws Exception { - PageFilter filter = new PageFilter().withTake(2).withFrom("from-id"); - Request request = api.roles().listUsers("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_USERS_CHECKPOINT_PAGED_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("take", "2")); - assertThat(recordedRequest, hasQueryParameter("from", "from-id")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getNext(), is("MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw")); - assertThat(response.getStart(), is(nullValue())); - assertThat(response.getLength(), is(nullValue())); - assertThat(response.getTotal(), is(nullValue())); - assertThat(response.getLimit(), is(nullValue())); - } - - @Test - public void shouldThrowOnAssignUsersWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().assignUsers(null, Collections.emptyList()), - "'role id' cannot be null!"); - } - - @Test - public void shouldThrowOnAssignUsersWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().assignUsers("1", null), - "'user ids' cannot be null!"); - } - - @Test - public void shouldThrowOnAssignUsersWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().assignUsers("1", Collections.emptyList()), - "'user ids' cannot be empty!"); - } - - @Test - public void shouldAssignUsers() throws Exception { - List userIds = new ArrayList<>(); - userIds.add("userId"); - Request request = api.roles().assignUsers("1", userIds); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/roles/1/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("users")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldListPermissionsWithoutFilter() throws Exception { - Request request = api.roles().listPermissions("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListPermissionsWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(23, 5); - Request request = api.roles().listPermissions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListPermissionsWithTotal() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.roles().listPermissions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ROLE_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/roles/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldThrowOnAddPermissionsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().addPermissions(null, Collections.emptyList()), - "'role id' cannot be null!"); - } - - @Test - public void shouldThrowOnAddPermissionsWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().addPermissions("1", null), - "'permissions' cannot be null!"); - } - - @Test - public void shouldThrowOnAddPermissionsWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().addPermissions("1", Collections.emptyList()), - "'permissions' cannot be empty!"); - } - - @Test - public void shouldAddPermissions() throws Exception { - List permissions = new ArrayList<>(); - Permission permission = new Permission(); - permission.setName("permissionName"); - permissions.add(permission); - Request request = api.roles().addPermissions("1", permissions); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/roles/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("permissions")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldThrowOnRemovePermissionsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().removePermissions(null, Collections.emptyList()), - "'role id' cannot be null!"); - } - - @Test - public void shouldThrowOnRemovePermissionsWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().removePermissions("1", null), - "'permissions' cannot be null!"); - } - - @Test - public void shouldThrowOnRemovePermissionsWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.roles().removePermissions("1", Collections.emptyList()), - "'permissions' cannot be empty!"); - } - - @Test - public void shouldRemovePermissions() throws Exception { - List permissions = new ArrayList<>(); - Permission permission = new Permission(); - permission.setName("permissionName"); - permissions.add(permission); - Request request = api.roles().removePermissions("1", permissions); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/roles/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("permissions")); - - assertThat(response, is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java new file mode 100644 index 000000000..901f6c077 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java @@ -0,0 +1,201 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; +import com.auth0.client.mgmt.roles.types.ListRolePermissionsRequestParameters; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.auth0.client.mgmt.types.PermissionsResponsePayload; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RolesPermissionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"permissions\":[{\"resource_server_identifier\":\"resource_server_identifier\",\"permission_name\":\"permission_name\",\"resource_server_name\":\"resource_server_name\",\"description\":\"description\"}]}")); + SyncPagingIterable response = client.roles() + .permissions() + .list( + "id", + ListRolePermissionsRequestParameters.builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testAdd() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.roles() + .permissions() + .add( + "id", + AddRolePermissionsRequestContent.builder() + .permissions(Arrays.asList(PermissionRequestPayload.builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"permissions\": [\n" + + " {\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"permission_name\": \"permission_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.roles() + .permissions() + .delete( + "id", + DeleteRolePermissionsRequestContent.builder() + .permissions(Arrays.asList(PermissionRequestPayload.builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"permissions\": [\n" + + " {\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"permission_name\": \"permission_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java new file mode 100644 index 000000000..f6b666aaf --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java @@ -0,0 +1,132 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; +import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; +import com.auth0.client.mgmt.types.RoleUser; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RolesUsersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"users\":[{\"user_id\":\"user_id\",\"picture\":\"picture\",\"name\":\"name\",\"email\":\"email\"}]}")); + SyncPagingIterable response = client.roles() + .users() + .list( + "id", + ListRoleUsersRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testAssign() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.roles() + .users() + .assign( + "id", + AssignRoleUsersRequestContent.builder() + .users(Arrays.asList("users")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"users\": [\n" + " \"users\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RolesWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesWireTest.java new file mode 100644 index 000000000..c81aad723 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RolesWireTest.java @@ -0,0 +1,309 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRoleRequestContent; +import com.auth0.client.mgmt.types.CreateRoleResponseContent; +import com.auth0.client.mgmt.types.GetRoleResponseContent; +import com.auth0.client.mgmt.types.ListRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.UpdateRoleRequestContent; +import com.auth0.client.mgmt.types.UpdateRoleResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RolesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"roles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}]}")); + SyncPagingIterable response = client.roles() + .list(ListRolesRequestParameters.builder() + .perPage(1) + .page(1) + .includeTotals(true) + .nameFilter("name_filter") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}")); + CreateRoleResponseContent response = client.roles() + .create(CreateRoleRequestContent.builder().name("name").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}")); + GetRoleResponseContent response = client.roles().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.roles().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}")); + UpdateRoleResponseContent response = + client.roles().update("id", UpdateRoleRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java b/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java deleted file mode 100644 index 43fd23de9..000000000 --- a/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.rules.RulesConfig; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class RulesConfigsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListRules() throws Exception { - Request> request = api.rulesConfigs().list(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULES_CONFIGS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules-configs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldReturnEmptyRulesConfigs() throws Exception { - Request> request = api.rulesConfigs().list(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(RulesConfig.class))); - } - - @Test - public void shouldThrowOnDeleteRulesConfigWithNullKey() { - verifyThrows(IllegalArgumentException.class, - () -> api.rulesConfigs().delete(null), - "'rules config key' cannot be null!"); - } - - @Test - public void shouldDeleteRulesConfig() throws Exception { - Request request = api.rulesConfigs().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULE, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/rules-configs/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateRulesConfigWithNullKey() { - verifyThrows(IllegalArgumentException.class, - () -> api.rulesConfigs().update(null, new RulesConfig("my-value")), - "'rules config key' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateRulesConfigWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.rulesConfigs().update("1", null), - "'rules config' cannot be null!"); - } - - @Test - public void shouldUpdateRulesConfig() throws Exception { - Request request = api.rulesConfigs().update("1", new RulesConfig("my-value")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - RulesConfig response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/rules-configs/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("value", "my-value")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java b/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java new file mode 100644 index 000000000..304f98d93 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java @@ -0,0 +1,189 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.RulesConfig; +import com.auth0.client.mgmt.types.SetRulesConfigRequestContent; +import com.auth0.client.mgmt.types.SetRulesConfigResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RulesConfigsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("[{\"key\":\"key\"}]")); + List response = client.rulesConfigs().list(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "[\n" + " {\n" + " \"key\": \"key\"\n" + " }\n" + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"key\",\"value\":\"value\"}")); + SetRulesConfigResponseContent response = client.rulesConfigs() + .set( + "key", + SetRulesConfigRequestContent.builder().value("value").build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"value\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"key\",\n" + " \"value\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.rulesConfigs().delete("key"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java b/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java deleted file mode 100644 index 33e154222..000000000 --- a/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.RulesFilter; -import com.auth0.json.mgmt.rules.Rule; -import com.auth0.json.mgmt.rules.RulesPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class RulesEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListRulesWithoutFilter() throws Exception { - Request request = api.rules().listAll(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULES_LIST, 200); - RulesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRulesWithPage() throws Exception { - RulesFilter filter = new RulesFilter().withPage(23, 5); - Request request = api.rules().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULES_LIST, 200); - RulesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRulesWithTotals() throws Exception { - RulesFilter filter = new RulesFilter().withTotals(true); - Request request = api.rules().listAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULES_PAGED_LIST, 200); - RulesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldThrowOnGetRuleWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.rules().get(null, null), - "'rule id' cannot be null!"); - } - - @Test - public void shouldGetRule() throws Exception { - Request request = api.rules().get("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULE, 200); - Rule response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetRuleWithFields() throws Exception { - RulesFilter filter = new RulesFilter().withFields("some,random,fields", true); - Request request = api.rules().get("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULE, 200); - Rule response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/rules/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateRuleWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.rules().create(null), - "'rule' cannot be null!"); - } - - @Test - public void shouldCreateRule() throws Exception { - Request request = api.rules().create(new Rule("my-rule", "function(){}")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULE, 200); - Rule response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/rules")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "my-rule")); - assertThat(body, hasEntry("script", "function(){}")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteRuleWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.rules().delete(null), - "'rule id' cannot be null!"); - } - - @Test - public void shouldDeleteRule() throws Exception { - Request request = api.rules().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RULE, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/rules/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateRuleWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.rules().update(null, new Rule("my-rule", "function(){}")), - "'rule id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateRuleWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.rules().update("1", null), - "'rule' cannot be null!"); - } - - @Test - public void shouldUpdateRule() throws Exception { - Request request = api.rules().update("1", new Rule("my-rule", "function(){}")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_CONNECTION, 200); - Rule response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/rules/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "my-rule")); - assertThat(body, hasEntry("script", "function(){}")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/RulesWireTest.java b/src/test/java/com/auth0/client/mgmt/RulesWireTest.java new file mode 100644 index 000000000..24f456a99 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RulesWireTest.java @@ -0,0 +1,336 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRuleRequestContent; +import com.auth0.client.mgmt.types.CreateRuleResponseContent; +import com.auth0.client.mgmt.types.GetRuleRequestParameters; +import com.auth0.client.mgmt.types.GetRuleResponseContent; +import com.auth0.client.mgmt.types.ListRulesRequestParameters; +import com.auth0.client.mgmt.types.Rule; +import com.auth0.client.mgmt.types.UpdateRuleRequestContent; +import com.auth0.client.mgmt.types.UpdateRuleResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RulesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"rules\":[{\"name\":\"name\",\"id\":\"id\",\"enabled\":true,\"script\":\"script\",\"order\":1.1,\"stage\":\"stage\"}]}")); + SyncPagingIterable response = client.rules() + .list(ListRulesRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .enabled(true) + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"id\":\"id\",\"enabled\":true,\"script\":\"script\",\"order\":1.1,\"stage\":\"stage\"}")); + CreateRuleResponseContent response = client.rules() + .create(CreateRuleRequestContent.builder() + .name("name") + .script("script") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\",\n" + " \"script\": \"script\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"id\": \"id\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"order\": 1.1,\n" + + " \"stage\": \"stage\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"id\":\"id\",\"enabled\":true,\"script\":\"script\",\"order\":1.1,\"stage\":\"stage\"}")); + GetRuleResponseContent response = client.rules() + .get( + "id", + GetRuleRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"id\": \"id\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"order\": 1.1,\n" + + " \"stage\": \"stage\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.rules().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"name\":\"name\",\"id\":\"id\",\"enabled\":true,\"script\":\"script\",\"order\":1.1,\"stage\":\"stage\"}")); + UpdateRuleResponseContent response = + client.rules().update("id", UpdateRuleRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"id\": \"id\",\n" + + " \"enabled\": true,\n" + + " \"script\": \"script\",\n" + + " \"order\": 1.1,\n" + + " \"stage\": \"stage\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java new file mode 100644 index 000000000..eb901e12f --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java @@ -0,0 +1,181 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SelfServiceProfilesCustomTextWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.selfServiceProfiles().customText().list("id", "en", "get-started"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.selfServiceProfiles() + .customText() + .set("id", "en", "get-started", new HashMap() { + { + put("key", "value"); + } + }); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java deleted file mode 100644 index 08d66d578..000000000 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.PageBasedPaginationFilter; -import com.auth0.json.mgmt.selfserviceprofiles.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SelfServiceProfilesEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldGetSelfServiceProfilesWithoutFilter() throws Exception{ - Request request = api.selfServiceProfiles().get(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILES_LIST, 200); - SelfServiceProfileResponsePage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/self-service-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldGetSelfServiceProfilesWithPage() throws Exception { - PageBasedPaginationFilter filter = new PageBasedPaginationFilter().withPage(1, 5); - Request request = api.selfServiceProfiles().get(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILES_LIST, 200); - SelfServiceProfileResponsePage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/self-service-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "1")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldGetSelfServiceProfilesWithTotals() throws Exception { - PageBasedPaginationFilter filter = new PageBasedPaginationFilter().withTotals(true); - Request request = api.selfServiceProfiles().get(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILES_LIST, 200); - SelfServiceProfileResponsePage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/self-service-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldThrowOnCreateWhenSelfServiceProfileIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().create(null), "'self service profile' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateWhenNameInSelfServiceProfileIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().create(new SelfServiceProfile()), "'name' cannot be null!"); - } - - @Test - public void shouldCreateSelfServiceProfile() throws Exception { - SelfServiceProfile profile = new SelfServiceProfile(); - profile.setName("Test"); - profile.setDescription("This is for Test"); - Request request = api.selfServiceProfiles().create(profile); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_RESPONSE, 201); - SelfServiceProfileResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/self-service-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("name", "Test")); - assertThat(body, hasEntry("description", "This is for Test")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetByIdWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().getById(null), "'id' cannot be null!"); - } - - @Test - public void shouldGetSelfServiceProfileById() throws Exception { - Request request = api.selfServiceProfiles().getById("id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_RESPONSE, 200); - SelfServiceProfileResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/self-service-profiles/id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().delete(null), "'id' cannot be null!"); - } - - @Test - public void shouldDeleteSelfServiceProfile() throws Exception { - Request request = api.selfServiceProfiles().delete("id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_RESPONSE, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/self-service-profiles/id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().update(new SelfServiceProfile(), null), "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateWhenSelfServiceProfileIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().update(null, "id"), "'self service profile' cannot be null!"); - } - - @Test - public void shouldUpdateSelfServiceProfile() throws Exception { - SelfServiceProfile profile = new SelfServiceProfile(); - profile.setDescription("This is Test is updated"); - Request request = api.selfServiceProfiles().update(profile, "id"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_RESPONSE, 200); - SelfServiceProfileResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/self-service-profiles/id")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("description", "This is Test is updated")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetCustomTextWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().getCustomText(null, "language", "page"), "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnGetCustomTextWhenLanguageIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().getCustomText("id", null, "page"), "'language' cannot be null!"); - } - - @Test - public void shouldThrowOnGetCustomTextWhenPageIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().getCustomText("id", "language", null), "'page' cannot be null!"); - } - - @Test - public void shouldGetCustomText() throws Exception { - Request request = api.selfServiceProfiles().getCustomText("id", "language", "page"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_CUSTOM_TEXT, 200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/self-service-profiles/id/custom-text/language/page")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnSetCustomTextWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().setCustomText(null, "language", "page", new Object()), "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnSetCustomTextWhenLanguageIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().setCustomText("id", null, "page", new Object()), "'language' cannot be null!"); - } - - @Test - public void shouldThrowOnSetCustomTextWhenPageIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().setCustomText("id", "language", null, new Object()), "'page' cannot be null!"); - } - - @Test - public void shouldThrowOnSetCustomTextWhenCustomTextIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().setCustomText("id", "language", "page", null), "'custom text' cannot be null!"); - } - - @Test - public void shouldSetCustomText() throws Exception { - Map customText = new HashMap<>(); - customText.put("introduction", "Welcome! With only a few steps"); - Request request = api.selfServiceProfiles().setCustomText("id", "language", "page", customText); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_CUSTOM_TEXT, 200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/self-service-profiles/id/custom-text/language/page")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateSsoAccessTicketWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().createSsoAccessTicket(null, new SsoAccessTicketRequest()), "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateSsoAccessTicketWhenPayloadIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().createSsoAccessTicket("id", null), "'request body' cannot be null!"); - } - - @Test - public void shouldCreateSsoAccessTicket() throws Exception{ - SsoAccessTicketRequest requestBody = new SsoAccessTicketRequest(); - requestBody.setConnectionId("test-connection"); - - Request request = api.selfServiceProfiles().createSsoAccessTicket("id", requestBody); - assertThat(request, is(notNullValue())); - - server.jsonResponse(SELF_SERVICE_PROFILE_SSO_TICKET, 200); - SsoAccessTicketResponse response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/self-service-profiles/id/sso-ticket")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnRevokeSsoTicketWhenIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().revokeSsoTicket(null, "ticketId"), "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnRevokeSsoTicketWhenTicketIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.selfServiceProfiles().revokeSsoTicket("id", null), "'ticket id' cannot be null!"); - } - - @Test - public void shouldRevokeSsoTicket() throws Exception{ - Request request = api.selfServiceProfiles().revokeSsoTicket("id", "ticketId"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/self-service-profiles/id/sso-ticket/ticketId/revoke")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java new file mode 100644 index 000000000..0301b35b4 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java @@ -0,0 +1,146 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.selfserviceprofiles.types.CreateSelfServiceProfileSsoTicketRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileSsoTicketResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SelfServiceProfilesSsoTicketWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"ticket\":\"ticket\"}")); + CreateSelfServiceProfileSsoTicketResponseContent response = client.selfServiceProfiles() + .ssoTicket() + .create( + "id", + CreateSelfServiceProfileSsoTicketRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"ticket\": \"ticket\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRevoke() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.selfServiceProfiles().ssoTicket().revoke("profileId", "id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java new file mode 100644 index 000000000..2db3fd904 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java @@ -0,0 +1,371 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.GetSelfServiceProfileResponseContent; +import com.auth0.client.mgmt.types.ListSelfServiceProfilesRequestParameters; +import com.auth0.client.mgmt.types.SelfServiceProfile; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateSelfServiceProfileResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SelfServiceProfilesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"self_service_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"allowed_strategies\":[\"oidc\"]}]}")); + SyncPagingIterable response = client.selfServiceProfiles() + .list(ListSelfServiceProfilesRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + CreateSelfServiceProfileResponseContent response = client.selfServiceProfiles() + .create(CreateSelfServiceProfileRequestContent.builder() + .name("name") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"user_attributes\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"is_optional\": true\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\"\n" + + " }\n" + + " },\n" + + " \"allowed_strategies\": [\n" + + " \"oidc\"\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + GetSelfServiceProfileResponseContent response = + client.selfServiceProfiles().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"user_attributes\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"is_optional\": true\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\"\n" + + " }\n" + + " },\n" + + " \"allowed_strategies\": [\n" + + " \"oidc\"\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.selfServiceProfiles().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + UpdateSelfServiceProfileResponseContent response = client.selfServiceProfiles() + .update("id", UpdateSelfServiceProfileRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"user_attributes\": [\n" + + " {\n" + + " \"name\": \"name\",\n" + + " \"description\": \"description\",\n" + + " \"is_optional\": true\n" + + " }\n" + + " ],\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"branding\": {\n" + + " \"logo_url\": \"logo_url\",\n" + + " \"colors\": {\n" + + " \"primary\": \"primary\"\n" + + " }\n" + + " },\n" + + " \"allowed_strategies\": [\n" + + " \"oidc\"\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SessionsEntityTest.java b/src/test/java/com/auth0/client/mgmt/SessionsEntityTest.java deleted file mode 100644 index 795c544c6..000000000 --- a/src/test/java/com/auth0/client/mgmt/SessionsEntityTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.sessions.Session; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_SESSION; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class SessionsEntityTest extends BaseMgmtEntityTest{ - @Test - public void getSessionShouldThrowOnNullSessionId() { - verifyThrows(IllegalArgumentException.class, - () -> api.sessions().get(null), - "'session ID' cannot be null!"); - } - - @Test - public void shouldGetSession() throws Exception { - Request request = api.sessions().get("session_ID"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_SESSION, 200); - Session response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/sessions/session_ID")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void deleteSessionShouldThrowOnNullSessionId() { - verifyThrows(IllegalArgumentException.class, - () -> api.sessions().delete(null), - "'session ID' cannot be null!"); - } - - @Test - public void shouldDeleteSession() throws Exception { - Request request = api.sessions().delete("session_ID"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/sessions/session_ID")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void revokeShouldThrowOnNullSessionId() { - verifyThrows(IllegalArgumentException.class, - () -> api.sessions().revoke(null), - "'session ID' cannot be null!"); - } - - @Test - public void shouldRevoke() throws Exception { - Request request = api.sessions().revoke("session_ID"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/sessions/session_ID/revoke")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java b/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java new file mode 100644 index 000000000..df8b6028e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java @@ -0,0 +1,155 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SessionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_user_agent\":\"initial_user_agent\",\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"last_user_agent\":\"last_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\"},\"clients\":[{\"client_id\":\"client_id\"}],\"authentication\":{\"methods\":[{}]},\"cookie\":{\"mode\":\"non-persistent\"}}")); + GetSessionResponseContent response = client.sessions().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"authenticated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"idle_expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_interacted_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"device\": {\n" + + " \"initial_user_agent\": \"initial_user_agent\",\n" + + " \"initial_ip\": \"initial_ip\",\n" + + " \"initial_asn\": \"initial_asn\",\n" + + " \"last_user_agent\": \"last_user_agent\",\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_asn\": \"last_asn\"\n" + + " },\n" + + " \"clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"authentication\": {\n" + + " \"methods\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"cookie\": {\n" + + " \"mode\": \"non-persistent\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.sessions().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testRevoke() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.sessions().revoke("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SimpleTokenProviderTest.java b/src/test/java/com/auth0/client/mgmt/SimpleTokenProviderTest.java deleted file mode 100644 index dc938fcdb..000000000 --- a/src/test/java/com/auth0/client/mgmt/SimpleTokenProviderTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.auth0.client.mgmt; - -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class SimpleTokenProviderTest { - - @Test - public void throwsWhenTokenNull() { - verifyThrows(IllegalArgumentException.class, - () -> SimpleTokenProvider.create(null), - "'api token' cannot be null!"); - } - - @Test - public void getTokenReturnsToken() throws Exception { - TokenProvider provider = SimpleTokenProvider.create("token"); - assertThat(provider.getToken(), is("token")); - } - - @Test - public void getTokenAsyncReturnsTokenFuture() throws Exception { - TokenProvider provider = SimpleTokenProvider.create("token"); - CompletableFuture future = provider.getTokenAsync(); - assertThat(future.get(), is("token")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java b/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java deleted file mode 100644 index f67836904..000000000 --- a/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.stats.DailyStats; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class StatsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldGetActiveUsersCount() throws Exception { - Request request = api.stats().getActiveUsersCount(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_ACTIVE_USERS_COUNT, 200); - Integer response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/stats/active-users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetDailyStatsWithNullDateFrom() { - verifyThrows(IllegalArgumentException.class, - () -> api.stats().getDailyStats(null, new Date()), - "'date from' cannot be null!"); - - } - - @Test - public void shouldThrowOnGetDailyStatsWithNullDateTo() { - verifyThrows(IllegalArgumentException.class, - () -> api.stats().getDailyStats(new Date(), null), - "'date to' cannot be null!"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldGetDailyStats() throws Exception { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.YEAR, 2016); - calendar.set(Calendar.MONTH, Calendar.OCTOBER); - calendar.set(Calendar.DATE, 11); - Date dateFrom = calendar.getTime(); - calendar.set(Calendar.DATE, 12); - Date dateTo = calendar.getTime(); - Request> request = api.stats().getDailyStats(dateFrom, dateTo); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_DAILY_STATS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/stats/daily")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "20161011")); - assertThat(recordedRequest, hasQueryParameter("to", "20161012")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldReturnEmptyDailyStats() throws Exception { - Request> request = api.stats().getDailyStats(new Date(), new Date()); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(DailyStats.class))); - } - - @Test - public void shouldFormatDateToYYYYMMDD() { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.YEAR, 2010); - //Calendar.MONTH starts at 0 being January - calendar.set(Calendar.MONTH, Calendar.JANUARY); - calendar.set(Calendar.DATE, 22); - - assertThat(api.stats().formatDate(calendar.getTime()), is("20100122")); - - } -} diff --git a/src/test/java/com/auth0/client/mgmt/StatsWireTest.java b/src/test/java/com/auth0/client/mgmt/StatsWireTest.java new file mode 100644 index 000000000..19ceb18aa --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/StatsWireTest.java @@ -0,0 +1,165 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.DailyStats; +import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class StatsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGetActiveUsersCount() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("1.1")); + Double response = client.stats().getActiveUsersCount(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "1.1"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetDaily() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"date\":\"date\",\"logins\":1,\"signups\":1,\"leaked_passwords\":1,\"updated_at\":\"updated_at\",\"created_at\":\"created_at\"}]")); + List response = client.stats() + .getDaily(GetDailyStatsRequestParameters.builder() + .from("from") + .to("to") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"date\": \"date\",\n" + + " \"logins\": 1,\n" + + " \"signups\": 1,\n" + + " \"leaked_passwords\": 1,\n" + + " \"updated_at\": \"updated_at\",\n" + + " \"created_at\": \"created_at\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/StreamTest.java b/src/test/java/com/auth0/client/mgmt/StreamTest.java new file mode 100644 index 000000000..ac0649357 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/StreamTest.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import static org.junit.jupiter.api.Assertions.*; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.Stream; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.junit.jupiter.api.Test; + +public final class StreamTest { + @Test + public void testJsonStream() { + List> messages = + Arrays.asList(createMap("message", "hello"), createMap("message", "world")); + List jsonStrings = messages.stream().map(StreamTest::mapToJson).collect(Collectors.toList()); + String input = String.join("\n", jsonStrings); + StringReader jsonInput = new StringReader(input); + Stream jsonStream = Stream.fromJson(Map.class, jsonInput); + int expectedMessages = 2; + int actualMessages = 0; + for (Map jsonObject : jsonStream) { + actualMessages++; + assertTrue(jsonObject.containsKey("message")); + } + assertEquals(expectedMessages, actualMessages); + } + + @Test + public void testSseStream() { + List> events = Arrays.asList(createMap("event", "start"), createMap("event", "end")); + List sseStrings = events.stream().map(StreamTest::mapToSse).collect(Collectors.toList()); + String input = String.join("\n" + "\n", sseStrings); + StringReader sseInput = new StringReader(input); + Stream sseStream = Stream.fromSse(Map.class, sseInput); + int expectedEvents = 2; + int actualEvents = 0; + for (Map eventData : sseStream) { + actualEvents++; + assertTrue(eventData.containsKey("event")); + } + assertEquals(expectedEvents, actualEvents); + } + + @Test + public void testSseStreamWithTerminator() { + List> events = Arrays.asList(createMap("message", "first"), createMap("message", "second")); + List sseStrings = + new ArrayList<>(events.stream().map(StreamTest::mapToSse).collect(Collectors.toList())); + sseStrings.add("data: [DONE]"); + String input = String.join("\n" + "\n", sseStrings); + StringReader sseInput = new StringReader(input); + Stream sseStream = Stream.fromSse(Map.class, sseInput, "[DONE]"); + int expectedEvents = 2; + int actualEvents = 0; + for (Map eventData : sseStream) { + actualEvents++; + assertTrue(eventData.containsKey("message")); + } + assertEquals(expectedEvents, actualEvents); + } + + @Test + public void testStreamResourceManagement() throws IOException { + StringReader testInput = new StringReader("{\"test\":\"data\"}"); + Stream testStream = Stream.fromJson(Map.class, testInput); + testStream.close(); + assertFalse(testStream.iterator().hasNext()); + } + + private static String mapToJson(Map map) { + try { + return ObjectMappers.JSON_MAPPER.writeValueAsString(map); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static String mapToSse(Map map) { + return "data: " + mapToJson(map); + } + + private static Map createMap(String key, String value) { + Map map = new HashMap<>(); + map.put(key, value); + return map; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java b/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java new file mode 100644 index 000000000..4f61e5e93 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java @@ -0,0 +1,180 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.PatchSupplementalSignalsResponseContent; +import com.auth0.client.mgmt.types.UpdateSupplementalSignalsRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SupplementalSignalsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"akamai_enabled\":true}")); + GetSupplementalSignalsResponseContent response = + client.supplementalSignals().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"akamai_enabled\": true\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testPatch() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"akamai_enabled\":true}")); + PatchSupplementalSignalsResponseContent response = client.supplementalSignals() + .patch(UpdateSupplementalSignalsRequestContent.builder() + .akamaiEnabled(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"akamai_enabled\": true\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"akamai_enabled\": true\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java deleted file mode 100644 index 5abe4e9c7..000000000 --- a/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.json.mgmt.tenants.Clients; -import com.auth0.json.mgmt.tenants.DefaultTokenQuota; -import com.auth0.json.mgmt.tenants.Organizations; -import com.auth0.json.mgmt.tenants.Tenant; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_TENANT; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TenantsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldGetTenantSettings() throws Exception { - Request request = api.tenants().get(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_TENANT, 200); - Tenant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/tenants/settings")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetTenantSettingsWithFields() throws Exception { - FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true); - Request request = api.tenants().get(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_TENANT, 200); - Tenant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/tenants/settings")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUpdateTenantSettingsWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.tenants().update(null), - "'tenant' cannot be null!"); - } - - @Test - public void shouldUpdateTenantSettings() throws Exception { - Tenant tenant = new Tenant(); - - DefaultTokenQuota defaultTokenQuota = new DefaultTokenQuota( - new Clients(new ClientCredentials(100, 20, true)), - new Organizations(new ClientCredentials(100, 20, true))); - - tenant.setDefaultTokenQuota(defaultTokenQuota); - Request request = api.tenants().update(tenant); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_TENANT, 200); - Tenant response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/tenants/settings")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - - // Parse and validate the request body - Map body = bodyFromRequest(recordedRequest); - assertThat(body, is(notNullValue())); - - Map tokenQuotaMap = (Map) body.get("default_token_quota"); - assertThat(tokenQuotaMap, is(notNullValue())); - - // Validate "clients" nested structure - Map clientsMap = (Map) tokenQuotaMap.get("clients"); - assertThat(clientsMap, is(notNullValue())); - Map clientCredentialsMap = (Map) clientsMap.get("client_credentials"); - assertThat(clientCredentialsMap, is(notNullValue())); - assertThat(clientCredentialsMap, hasEntry("per_day", 100)); - assertThat(clientCredentialsMap, hasEntry("per_hour", 20)); - assertThat(clientCredentialsMap, hasEntry("enforce", true)); - - // Validate "organizations" nested structure - Map organizationsMap = (Map) tokenQuotaMap.get("organizations"); - assertThat(organizationsMap, is(notNullValue())); - Map organizationCredentialsMap = (Map) organizationsMap.get("client_credentials"); - assertThat(organizationCredentialsMap, is(notNullValue())); - assertThat(organizationCredentialsMap, hasEntry("per_day", 100)); - assertThat(organizationCredentialsMap, hasEntry("per_hour", 20)); - assertThat(organizationCredentialsMap, hasEntry("enforce", true)); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java new file mode 100644 index 000000000..3202f7778 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java @@ -0,0 +1,390 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; +import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; +import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateTenantSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TenantsSettingsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true}")); + GetTenantSettingsResponseContent response = client.tenants() + .settings() + .get(GetTenantSettingsRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"change_password\": {\n" + + " \"enabled\": true,\n" + + " \"html\": \"html\"\n" + + " },\n" + + " \"guardian_mfa_page\": {\n" + + " \"enabled\": true,\n" + + " \"html\": \"html\"\n" + + " },\n" + + " \"default_audience\": \"default_audience\",\n" + + " \"default_directory\": \"default_directory\",\n" + + " \"error_page\": {\n" + + " \"html\": \"html\",\n" + + " \"show_log_link\": true,\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"device_flow\": {\n" + + " \"charset\": \"base20\",\n" + + " \"mask\": \"mask\"\n" + + " },\n" + + " \"default_token_quota\": {\n" + + " \"clients\": {\n" + + " \"client_credentials\": {}\n" + + " },\n" + + " \"organizations\": {\n" + + " \"client_credentials\": {}\n" + + " }\n" + + " },\n" + + " \"flags\": {\n" + + " \"change_pwd_flow_v1\": true,\n" + + " \"enable_apis_section\": true,\n" + + " \"disable_impersonation\": true,\n" + + " \"enable_client_connections\": true,\n" + + " \"enable_pipeline2\": true,\n" + + " \"allow_legacy_delegation_grant_types\": true,\n" + + " \"allow_legacy_ro_grant_types\": true,\n" + + " \"allow_legacy_tokeninfo_endpoint\": true,\n" + + " \"enable_legacy_profile\": true,\n" + + " \"enable_idtoken_api2\": true,\n" + + " \"enable_public_signup_user_exists_error\": true,\n" + + " \"enable_sso\": true,\n" + + " \"allow_changing_enable_sso\": true,\n" + + " \"disable_clickjack_protection_headers\": true,\n" + + " \"no_disclose_enterprise_connections\": true,\n" + + " \"enforce_client_authentication_on_passwordless_start\": true,\n" + + " \"enable_adfs_waad_email_verification\": true,\n" + + " \"revoke_refresh_token_grant\": true,\n" + + " \"dashboard_log_streams_next\": true,\n" + + " \"dashboard_insights_view\": true,\n" + + " \"disable_fields_map_fix\": true,\n" + + " \"mfa_show_factor_list_on_enrollment\": true,\n" + + " \"remove_alg_from_jwks\": true,\n" + + " \"improved_signup_bot_detection_in_classic\": true,\n" + + " \"genai_trial\": true,\n" + + " \"enable_dynamic_client_registration\": true,\n" + + " \"disable_management_api_sms_obfuscation\": true,\n" + + " \"trust_azure_adfs_email_verified_connection_property\": true,\n" + + " \"custom_domains_provisioning\": true\n" + + " },\n" + + " \"friendly_name\": \"friendly_name\",\n" + + " \"picture_url\": \"picture_url\",\n" + + " \"support_email\": \"support_email\",\n" + + " \"support_url\": \"support_url\",\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_lifetime\": 1.1,\n" + + " \"idle_session_lifetime\": 1.1,\n" + + " \"ephemeral_session_lifetime\": 1.1,\n" + + " \"idle_ephemeral_session_lifetime\": 1.1,\n" + + " \"sandbox_version\": \"sandbox_version\",\n" + + " \"legacy_sandbox_version\": \"legacy_sandbox_version\",\n" + + " \"sandbox_versions_available\": [\n" + + " \"sandbox_versions_available\"\n" + + " ],\n" + + " \"default_redirection_uri\": \"default_redirection_uri\",\n" + + " \"enabled_locales\": [\n" + + " \"am\"\n" + + " ],\n" + + " \"session_cookie\": {\n" + + " \"mode\": \"persistent\"\n" + + " },\n" + + " \"sessions\": {\n" + + " \"oidc_logout_prompt_enabled\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"rp_logout_end_session_endpoint_discovery\": true\n" + + " },\n" + + " \"allow_organization_name_in_authentication_api\": true,\n" + + " \"customize_mfa_in_postlogin_action\": true,\n" + + " \"acr_values_supported\": [\n" + + " \"acr_values_supported\"\n" + + " ],\n" + + " \"mtls\": {\n" + + " \"enable_endpoint_aliases\": true\n" + + " },\n" + + " \"pushed_authorization_requests_supported\": true,\n" + + " \"authorization_response_iss_parameter_supported\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true}")); + UpdateTenantSettingsResponseContent response = client.tenants() + .settings() + .update(UpdateTenantSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"change_password\": {\n" + + " \"enabled\": true,\n" + + " \"html\": \"html\"\n" + + " },\n" + + " \"guardian_mfa_page\": {\n" + + " \"enabled\": true,\n" + + " \"html\": \"html\"\n" + + " },\n" + + " \"default_audience\": \"default_audience\",\n" + + " \"default_directory\": \"default_directory\",\n" + + " \"error_page\": {\n" + + " \"html\": \"html\",\n" + + " \"show_log_link\": true,\n" + + " \"url\": \"url\"\n" + + " },\n" + + " \"device_flow\": {\n" + + " \"charset\": \"base20\",\n" + + " \"mask\": \"mask\"\n" + + " },\n" + + " \"default_token_quota\": {\n" + + " \"clients\": {\n" + + " \"client_credentials\": {}\n" + + " },\n" + + " \"organizations\": {\n" + + " \"client_credentials\": {}\n" + + " }\n" + + " },\n" + + " \"flags\": {\n" + + " \"change_pwd_flow_v1\": true,\n" + + " \"enable_apis_section\": true,\n" + + " \"disable_impersonation\": true,\n" + + " \"enable_client_connections\": true,\n" + + " \"enable_pipeline2\": true,\n" + + " \"allow_legacy_delegation_grant_types\": true,\n" + + " \"allow_legacy_ro_grant_types\": true,\n" + + " \"allow_legacy_tokeninfo_endpoint\": true,\n" + + " \"enable_legacy_profile\": true,\n" + + " \"enable_idtoken_api2\": true,\n" + + " \"enable_public_signup_user_exists_error\": true,\n" + + " \"enable_sso\": true,\n" + + " \"allow_changing_enable_sso\": true,\n" + + " \"disable_clickjack_protection_headers\": true,\n" + + " \"no_disclose_enterprise_connections\": true,\n" + + " \"enforce_client_authentication_on_passwordless_start\": true,\n" + + " \"enable_adfs_waad_email_verification\": true,\n" + + " \"revoke_refresh_token_grant\": true,\n" + + " \"dashboard_log_streams_next\": true,\n" + + " \"dashboard_insights_view\": true,\n" + + " \"disable_fields_map_fix\": true,\n" + + " \"mfa_show_factor_list_on_enrollment\": true,\n" + + " \"remove_alg_from_jwks\": true,\n" + + " \"improved_signup_bot_detection_in_classic\": true,\n" + + " \"genai_trial\": true,\n" + + " \"enable_dynamic_client_registration\": true,\n" + + " \"disable_management_api_sms_obfuscation\": true,\n" + + " \"trust_azure_adfs_email_verified_connection_property\": true,\n" + + " \"custom_domains_provisioning\": true\n" + + " },\n" + + " \"friendly_name\": \"friendly_name\",\n" + + " \"picture_url\": \"picture_url\",\n" + + " \"support_email\": \"support_email\",\n" + + " \"support_url\": \"support_url\",\n" + + " \"allowed_logout_urls\": [\n" + + " \"allowed_logout_urls\"\n" + + " ],\n" + + " \"session_lifetime\": 1.1,\n" + + " \"idle_session_lifetime\": 1.1,\n" + + " \"ephemeral_session_lifetime\": 1.1,\n" + + " \"idle_ephemeral_session_lifetime\": 1.1,\n" + + " \"sandbox_version\": \"sandbox_version\",\n" + + " \"legacy_sandbox_version\": \"legacy_sandbox_version\",\n" + + " \"sandbox_versions_available\": [\n" + + " \"sandbox_versions_available\"\n" + + " ],\n" + + " \"default_redirection_uri\": \"default_redirection_uri\",\n" + + " \"enabled_locales\": [\n" + + " \"am\"\n" + + " ],\n" + + " \"session_cookie\": {\n" + + " \"mode\": \"persistent\"\n" + + " },\n" + + " \"sessions\": {\n" + + " \"oidc_logout_prompt_enabled\": true\n" + + " },\n" + + " \"oidc_logout\": {\n" + + " \"rp_logout_end_session_endpoint_discovery\": true\n" + + " },\n" + + " \"allow_organization_name_in_authentication_api\": true,\n" + + " \"customize_mfa_in_postlogin_action\": true,\n" + + " \"acr_values_supported\": [\n" + + " \"acr_values_supported\"\n" + + " ],\n" + + " \"mtls\": {\n" + + " \"enable_endpoint_aliases\": true\n" + + " },\n" + + " \"pushed_authorization_requests_supported\": true,\n" + + " \"authorization_response_iss_parameter_supported\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/TestClient.java b/src/test/java/com/auth0/client/mgmt/TestClient.java new file mode 100644 index 000000000..784f33e39 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/TestClient.java @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +public final class TestClient { + public void test() { + // Add tests here and mark this file in .fernignore + assert true; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java b/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java deleted file mode 100644 index 15a879655..000000000 --- a/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.tickets.EmailVerificationTicket; -import com.auth0.json.mgmt.tickets.PasswordChangeTicket; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.hasHeader; -import static com.auth0.client.RecordedRequestMatcher.hasMethodAndPath; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TicketsEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnCreateEmailVerificationTicketWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.tickets().requestEmailVerification(null), - "'email verification ticket' cannot be null!"); - } - - @Test - public void shouldCreateEmailVerificationTicket() throws Exception { - EmailVerificationTicket ticket = new EmailVerificationTicket("uid123"); - ticket.setIncludeEmailInRedirect(true); - ticket.setTTLSeconds(42); - - Request request = api.tickets().requestEmailVerification(ticket); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_VERIFICATION_TICKET, 200); - EmailVerificationTicket response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/tickets/email-verification")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("user_id", "uid123")); - assertThat(body, hasEntry("includeEmailInRedirect", true)); - assertThat(body, hasEntry("ttl_sec", 42)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreatePasswordChangeTicketWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.tickets().requestPasswordChange(null), - "'password change ticket' cannot be null!"); - } - - @Test - public void shouldCreatePasswordChangeTicket() throws Exception { - Request request = api.tickets().requestPasswordChange(new PasswordChangeTicket("uid123")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_PASSWORD_CHANGE_TICKET, 200); - PasswordChangeTicket response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/tickets/password-change")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("user_id", "uid123")); - - assertThat(response, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java b/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java new file mode 100644 index 000000000..e64b13ac4 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java @@ -0,0 +1,210 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.ChangePasswordTicketRequestContent; +import com.auth0.client.mgmt.types.ChangePasswordTicketResponseContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketRequestContent; +import com.auth0.client.mgmt.types.VerifyEmailTicketResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TicketsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testVerifyEmail() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"ticket\":\"ticket\"}")); + VerifyEmailTicketResponseContent response = client.tickets() + .verifyEmail(VerifyEmailTicketRequestContent.builder() + .userId("user_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"user_id\": \"user_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"ticket\": \"ticket\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testChangePassword() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"ticket\":\"ticket\"}")); + ChangePasswordTicketResponseContent response = client.tickets() + .changePassword(ChangePasswordTicketRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"ticket\": \"ticket\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java new file mode 100644 index 000000000..7682f32a0 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java @@ -0,0 +1,289 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.GetTokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfileResponseContent; +import com.auth0.client.mgmt.types.TokenExchangeProfilesListRequest; +import com.auth0.client.mgmt.types.UpdateTokenExchangeProfileRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TokenExchangeProfilesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"token_exchange_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"subject_token_type\":\"subject_token_type\",\"action_id\":\"action_id\",\"type\":\"custom_authentication\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + SyncPagingIterable response = client.tokenExchangeProfiles() + .list(TokenExchangeProfilesListRequest.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"subject_token_type\":\"subject_token_type\",\"action_id\":\"action_id\",\"type\":\"custom_authentication\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + CreateTokenExchangeProfileResponseContent response = client.tokenExchangeProfiles() + .create(CreateTokenExchangeProfileRequestContent.builder() + .name("name") + .subjectTokenType("subject_token_type") + .actionId("action_id") + .type("custom_authentication") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"subject_token_type\": \"subject_token_type\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"type\": \"custom_authentication\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subject_token_type\": \"subject_token_type\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"type\": \"custom_authentication\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"subject_token_type\":\"subject_token_type\",\"action_id\":\"action_id\",\"type\":\"custom_authentication\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetTokenExchangeProfileResponseContent response = + client.tokenExchangeProfiles().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subject_token_type\": \"subject_token_type\",\n" + + " \"action_id\": \"action_id\",\n" + + " \"type\": \"custom_authentication\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.tokenExchangeProfiles().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.tokenExchangeProfiles() + .update("id", UpdateTokenExchangeProfileRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesEntityTest.java b/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesEntityTest.java deleted file mode 100644 index 0ef82f5ce..000000000 --- a/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesEntityTest.java +++ /dev/null @@ -1,302 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.filter.UserAttributeProfilesFilter; -import com.auth0.json.mgmt.userAttributeProfiles.*; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class UserAttributeProfilesEntityTest extends BaseMgmtEntityTest { - - // User Attribute Profiles entity tests - - @Test - public void shouldThrowOnGetUserAttributeProfileWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().get(null), - "'id' cannot be null!"); - } - - @Test - public void shouldGetUserAttributeProfile() throws Exception { - Request request = api.userAttributeProfiles().get("uap_1234567890"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILE, 200); - UserAttributeProfile response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-attribute-profiles/uap_1234567890")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getId(), is("uap_1234567890")); - assertThat(response.getName(), is("This is just a test")); - } - - @Test - public void shouldGetAllUserAttributeProfilesWithoutFilter() throws Exception { - Request request = api.userAttributeProfiles().getAll(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILES_LIST, 200); - UserAttributeProfilePage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-attribute-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldGetAllUserAttributeProfilesWithFilter() throws Exception { - UserAttributeProfilesFilter filter = new UserAttributeProfilesFilter() - .withCheckpointPagination("uap_1234567890", 2); - - Request request = api.userAttributeProfiles().getAll(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILES_LIST, 200); - UserAttributeProfilePage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-attribute-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "uap_1234567890")); - assertThat(recordedRequest, hasQueryParameter("take", "2")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(3)); - } - - @Test - public void shouldThrowOnUpdateUserAttributeProfileWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().update(null, new UserAttributeProfile()), - "'id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateUserAttributeProfileWithNullProfile() { - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().update("uap_1234567890", null), - "'userAttributeProfile' cannot be null!"); - } - - @Test - public void shouldUpdateUserAttributeProfile() throws Exception { - UserAttributeProfile profileToUpdate = new UserAttributeProfile(); - profileToUpdate.setName("This is just a test"); - - UserId userId = new UserId(); - userId.setOidcMapping("sub"); - userId.setSamlMapping(Arrays.asList("urn:oid:0.9.10.10.100.1.1")); // Replace List.of() with Arrays.asList() - userId.setScimMapping("userName"); - profileToUpdate.setUserId(userId); - - Map userAttributes = new HashMap<>(); - UserAttributes usernameAttr = new UserAttributes(); - usernameAttr.setLabel("test User"); - usernameAttr.setDescription("This is just a test"); - - OidcMapping oidcMapping = new OidcMapping(); - oidcMapping.setMapping("preferred_username"); - oidcMapping.setDisplayName("UserName"); - usernameAttr.setOidcMapping(oidcMapping); - - usernameAttr.setSamlMapping(Arrays.asList("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")); // Replace List.of() with Arrays.asList() - usernameAttr.setScimMapping("displayName"); - usernameAttr.setAuth0Mapping("testUser"); - usernameAttr.setProfileRequired(false); - - StrategyOverridesUserAttributes strategyOverridesUserAttributes = new StrategyOverridesUserAttributes(); - strategyOverridesUserAttributes.setScimMapping("name.givenName"); - Map strategyOverridesMap = new HashMap<>(); - strategyOverridesMap.put("oidc", strategyOverridesUserAttributes); - usernameAttr.setStrategyOverrides(strategyOverridesMap); - - userAttributes.put("username", usernameAttr); - profileToUpdate.setUserAttributes(userAttributes); - - Request request = api.userAttributeProfiles().update("uap_1csqEmz4TE2P1o7izaATmb", profileToUpdate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILE, 200); - UserAttributeProfile response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, - hasMethodAndPath(HttpMethod.PATCH, "/api/v2/user-attribute-profiles/uap_1csqEmz4TE2P1o7izaATmb")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, hasEntry("name", "This is just a test")); - assertThat(body, hasEntry(is("user_id"), is(notNullValue()))); - assertThat(body, hasEntry(is("user_attributes"), is(notNullValue()))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateUserAttributeProfileWithNullName() { - UserAttributeProfile profile = new UserAttributeProfile(); - profile.setName(null); - Map userAttributes = new HashMap<>(); - profile.setUserAttributes(userAttributes); - - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().create(profile), - "'name' cannot be null!"); - } - - @Test - public void shouldThrowOnCreateUserAttributeProfileWithNullUserAttributes() { - UserAttributeProfile profile = new UserAttributeProfile(); - profile.setName("Test Profile"); - profile.setUserAttributes(null); - - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().create(profile), - "'userAttributes' cannot be null!"); - } - - @Test - public void shouldCreateUserAttributeProfile() throws Exception { - UserAttributeProfile profileToCreate = new UserAttributeProfile(); - profileToCreate.setName("This is just a test"); - - UserId userId = new UserId(); - userId.setOidcMapping("sub"); - userId.setSamlMapping(Arrays.asList("urn:oid:0.9.10.10.100.1.1")); - userId.setScimMapping("userName"); - profileToCreate.setUserId(userId); - - Map userAttributes = new HashMap<>(); - UserAttributes usernameAttr = new UserAttributes(); - usernameAttr.setLabel("test User"); - usernameAttr.setDescription("This is just a test"); - - OidcMapping oidcMapping = new OidcMapping(); - oidcMapping.setMapping("preferred_username"); - oidcMapping.setDisplayName("UserName"); - usernameAttr.setOidcMapping(oidcMapping); - - usernameAttr.setSamlMapping(Arrays.asList("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")); - usernameAttr.setScimMapping("displayName"); - usernameAttr.setAuth0Mapping("testUser"); - usernameAttr.setProfileRequired(false); - - StrategyOverridesUserAttributes strategyOverridesUserAttributes = new StrategyOverridesUserAttributes(); - strategyOverridesUserAttributes.setScimMapping("name.givenName"); - Map strategyOverridesMap = new HashMap<>(); - strategyOverridesMap.put("oidc", strategyOverridesUserAttributes); - usernameAttr.setStrategyOverrides(strategyOverridesMap); - - userAttributes.put("username", usernameAttr); - profileToCreate.setUserAttributes(userAttributes); - - Request request = api.userAttributeProfiles().create(profileToCreate); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILE, 201); - UserAttributeProfile response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/user-attribute-profiles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body, aMapWithSize(3)); - assertThat(body, hasEntry("name", "This is just a test")); - assertThat(body, hasEntry(is("user_id"), is(notNullValue()))); - assertThat(body, hasEntry(is("user_attributes"), is(notNullValue()))); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteUserAttributeProfileWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().delete(null), - "'id' cannot be null!"); - } - - @Test - public void shouldDeleteUserAttributeProfile() throws Exception { - Request request = api.userAttributeProfiles().delete("uap_1234567890"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, - hasMethodAndPath(HttpMethod.DELETE, "/api/v2/user-attribute-profiles/uap_1234567890")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - // User Attribute Profile Templates tests - - @Test - public void shouldThrowOnGetUserAttributeProfileTemplateWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userAttributeProfiles().getTemplate(null), - "'id' cannot be null!"); - } - - @Test - public void shouldGetUserAttributeProfileTemplate() throws Exception { - Request request = api.userAttributeProfiles().getTemplate("auth0-generic"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILE_TEMPLATE, 200); - UserAttributeProfileTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, - hasMethodAndPath(HttpMethod.GET, "/api/v2/user-attribute-profiles/templates/auth0-generic")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getId(), is("auth0-generic")); - assertThat(response.getDisplayName(), is("A standard user attribute profile template")); - } - - @Test - public void shouldGetAllUserAttributeProfileTemplates() throws Exception { - Request request = api.userAttributeProfiles().getAllTemplates(); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MockServer.MGMT_USER_ATTRIBUTE_PROFILE_TEMPLATES_LIST, 200); - ListUserAttributeProfileTemplate response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-attribute-profiles/templates")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getUserAttributeProfileTemplates(), hasSize(1)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java b/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java deleted file mode 100644 index 37a73db52..000000000 --- a/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.json.mgmt.userblocks.UserBlocks; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.MGMT_USER_BLOCKS; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class UserBlocksEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldThrowOnGetUserBlocksByIdentifierWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userBlocks().getByIdentifier(null), - "'identifier' cannot be null!"); - } - - @Test - public void shouldGetUserBlocksByIdentifier() throws Exception { - Request request = api.userBlocks().getByIdentifier("username"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_BLOCKS, 200); - UserBlocks response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-blocks")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("identifier", "username")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnGetUserBlocksWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userBlocks().get(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldGetUserBlocks() throws Exception { - Request request = api.userBlocks().get("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_BLOCKS, 200); - UserBlocks response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/user-blocks/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteUserBlocksByIdentifierWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userBlocks().deleteByIdentifier(null), - "'identifier' cannot be null!"); - } - - @Test - public void shouldDeleteUserBlocksByIdentifier() throws Exception { - Request request = api.userBlocks().deleteByIdentifier("username"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_BLOCKS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/user-blocks")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("identifier", "username")); - } - - @Test - public void shouldThrowOnDeleteUserBlocksWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.userBlocks().delete(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldDeleteUserBlocks() throws Exception { - Request request = api.userBlocks().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_BLOCKS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/user-blocks/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java b/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java new file mode 100644 index 000000000..65f0291b3 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java @@ -0,0 +1,205 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; +import com.auth0.client.mgmt.types.ListUserBlocksRequestParameters; +import com.auth0.client.mgmt.types.ListUserBlocksResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UserBlocksWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testListByIdentifier() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"blocked_for\":[{\"identifier\":\"identifier\",\"ip\":\"ip\",\"connection\":\"connection\"}]}")); + ListUserBlocksByIdentifierResponseContent response = client.userBlocks() + .listByIdentifier(ListUserBlocksByIdentifierRequestParameters.builder() + .identifier("identifier") + .considerBruteForceEnablement(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"blocked_for\": [\n" + + " {\n" + + " \"identifier\": \"identifier\",\n" + + " \"ip\": \"ip\",\n" + + " \"connection\": \"connection\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDeleteByIdentifier() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.userBlocks() + .deleteByIdentifier(DeleteUserBlocksByIdentifierRequestParameters.builder() + .identifier("identifier") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"blocked_for\":[{\"identifier\":\"identifier\",\"ip\":\"ip\",\"connection\":\"connection\"}]}")); + ListUserBlocksResponseContent response = client.userBlocks() + .list( + "id", + ListUserBlocksRequestParameters.builder() + .considerBruteForceEnablement(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"blocked_for\": [\n" + + " {\n" + + " \"identifier\": \"identifier\",\n" + + " \"ip\": \"ip\",\n" + + " \"connection\": \"connection\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.userBlocks().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java new file mode 100644 index 000000000..1605ee4a0 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java @@ -0,0 +1,109 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; +import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; +import com.auth0.client.mgmt.types.UserGrant; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UserGrantsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"grants\":[{\"id\":\"id\",\"clientID\":\"clientID\",\"user_id\":\"user_id\",\"audience\":\"audience\",\"scope\":[\"scope\"]}]}")); + SyncPagingIterable response = client.userGrants() + .list(ListUserGrantsRequestParameters.builder() + .perPage(1) + .page(1) + .includeTotals(true) + .userId("user_id") + .clientId("client_id") + .audience("audience") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testDeleteByUserId() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.userGrants() + .deleteByUserId(DeleteUserGrantByUserIdRequestParameters.builder() + .userId("user_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.userGrants().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java new file mode 100644 index 000000000..393321db9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java @@ -0,0 +1,490 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.AuthenticationTypeEnum; +import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.CreatedUserAuthenticationMethodTypeEnum; +import com.auth0.client.mgmt.types.GetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.SetUserAuthenticationMethods; +import com.auth0.client.mgmt.types.UpdateUserAuthenticationMethodResponseContent; +import com.auth0.client.mgmt.types.UserAuthenticationMethod; +import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent; +import com.auth0.client.mgmt.users.types.ListUserAuthenticationMethodsRequestParameters; +import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersAuthenticationMethodsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"authenticators\":[{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\"}]}")); + SyncPagingIterable response = client.users() + .authenticationMethods() + .list( + "id", + ListUserAuthenticationMethodsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); + CreateUserAuthenticationMethodResponseContent response = client.users() + .authenticationMethods() + .create( + "id", + CreateUserAuthenticationMethodRequestContent.builder() + .type(CreatedUserAuthenticationMethodTypeEnum.PHONE) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"type\": \"phone\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"type\": \"phone\",\n" + + " \"name\": \"name\",\n" + + " \"totp_secret\": \"totp_secret\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"email\": \"email\",\n" + + " \"authentication_methods\": [\n" + + " {\n" + + " \"type\": \"totp\",\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"preferred_authentication_method\": \"voice\",\n" + + " \"key_id\": \"key_id\",\n" + + " \"public_key\": \"public_key\",\n" + + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}]")); + List response = client.users() + .authenticationMethods() + .set( + "id", + Arrays.asList(SetUserAuthenticationMethods.builder() + .type(AuthenticationTypeEnum.PHONE) + .build())); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "[\n" + " {\n" + " \"type\": \"phone\"\n" + " }\n" + "]"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"type\": \"phone\",\n" + + " \"name\": \"name\",\n" + + " \"totp_secret\": \"totp_secret\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"email\": \"email\",\n" + + " \"authentication_methods\": [\n" + + " {}\n" + + " ],\n" + + " \"preferred_authentication_method\": \"voice\",\n" + + " \"key_id\": \"key_id\",\n" + + " \"public_key\": \"public_key\",\n" + + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDeleteAll() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().authenticationMethods().deleteAll("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\"}")); + GetUserAuthenticationMethodResponseContent response = + client.users().authenticationMethods().get("id", "authentication_method_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"type\": \"recovery-code\",\n" + + " \"confirmed\": true,\n" + + " \"name\": \"name\",\n" + + " \"authentication_methods\": [\n" + + " {\n" + + " \"type\": \"totp\",\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"preferred_authentication_method\": \"voice\",\n" + + " \"link_id\": \"link_id\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"email\": \"email\",\n" + + " \"key_id\": \"key_id\",\n" + + " \"public_key\": \"public_key\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"enrolled_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_auth_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"credential_device_type\": \"credential_device_type\",\n" + + " \"credential_backed_up\": true,\n" + + " \"identity_user_id\": \"identity_user_id\",\n" + + " \"user_agent\": \"user_agent\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().authenticationMethods().delete("id", "authentication_method_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateUserAuthenticationMethodResponseContent response = client.users() + .authenticationMethods() + .update( + "id", + "authentication_method_id", + UpdateUserAuthenticationMethodRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"type\": \"phone\",\n" + + " \"name\": \"name\",\n" + + " \"totp_secret\": \"totp_secret\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"email\": \"email\",\n" + + " \"authentication_methods\": [\n" + + " {\n" + + " \"type\": \"totp\",\n" + + " \"id\": \"id\"\n" + + " }\n" + + " ],\n" + + " \"preferred_authentication_method\": \"voice\",\n" + + " \"key_id\": \"key_id\",\n" + + " \"public_key\": \"public_key\",\n" + + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java new file mode 100644 index 000000000..5a063eb5e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java @@ -0,0 +1,67 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersAuthenticatorsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testDeleteAll() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().authenticators().deleteAll("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java new file mode 100644 index 000000000..c6b3e696f --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java @@ -0,0 +1,120 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.UsersEnrollment; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersEnrollmentsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"status\":\"pending\",\"type\":\"type\",\"name\":\"name\",\"identifier\":\"identifier\",\"phone_number\":\"phone_number\",\"auth_method\":\"authenticator\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth\":\"2024-01-15T09:30:00Z\"}]")); + List response = client.users().enrollments().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"status\": \"pending\",\n" + + " \"type\": \"type\",\n" + + " \"name\": \"name\",\n" + + " \"identifier\": \"identifier\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"auth_method\": \"authenticator\",\n" + + " \"enrolled_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_auth\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java b/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java deleted file mode 100644 index 59da2b86f..000000000 --- a/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java +++ /dev/null @@ -1,1507 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.client.mgmt.filter.LogEventFilter; -import com.auth0.client.mgmt.filter.PageFilter; -import com.auth0.client.mgmt.filter.UserFilter; -import com.auth0.json.mgmt.guardian.Enrollment; -import com.auth0.json.mgmt.logevents.LogEvent; -import com.auth0.json.mgmt.logevents.LogEventsPage; -import com.auth0.json.mgmt.organizations.OrganizationsPage; -import com.auth0.json.mgmt.permissions.Permission; -import com.auth0.json.mgmt.permissions.PermissionsPage; -import com.auth0.json.mgmt.roles.RolesPage; -import com.auth0.json.mgmt.users.Identity; -import com.auth0.json.mgmt.users.RecoveryCode; -import com.auth0.json.mgmt.users.User; -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.json.mgmt.users.authenticationmethods.AuthenticationMethod; -import com.auth0.json.mgmt.users.authenticationmethods.AuthenticationMethodsPage; -import com.auth0.json.mgmt.refreshtokens.RefreshTokensPage; -import com.auth0.json.mgmt.sessions.SessionsPage; -import com.auth0.net.Request; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static com.auth0.client.RecordedRequestMatcher.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class UsersEntityTest extends BaseMgmtEntityTest { - - @Test - public void shouldListUsersByEmail() throws Exception { - Request> request = api.users().listByEmail("johndoe@auth0.com", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users-by-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("email", "johndoe@auth0.com")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldListUsersByEmailWithFields() throws Exception { - FieldsFilter filter = new FieldsFilter().withFields("some,random,fields", true); - Request> request = api.users().listByEmail("johndoe@auth0.com", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users-by-email")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("email", "johndoe@auth0.com")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response, hasSize(2)); - } - - @Test - public void shouldReturnEmptyUsersByEmail() throws Exception { - Request> request = api.users().listByEmail("missing@auth0.com", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(User.class))); - } - - @Test - public void shouldListUsers() throws Exception { - Request request = api.users().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithPage() throws Exception { - UserFilter filter = new UserFilter().withPage(23, 5); - Request request = api.users().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithTotals() throws Exception { - UserFilter filter = new UserFilter().withTotals(true); - Request request = api.users().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_PAGED_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldListUsersWithSort() throws Exception { - UserFilter filter = new UserFilter().withSort("date:1"); - Request request = api.users().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("sort", "date:1")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithQuery() throws Exception { - UserFilter filter = new UserFilter().withQuery("email:\\*@gmail.com"); - Request request = api.users().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, not(hasQueryParameter("search_engine"))); - assertThat(recordedRequest, hasQueryParameter("q", "email:\\*@gmail.com")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListUsersWithFields() throws Exception { - UserFilter filter = new UserFilter().withFields("some,random,fields", true); - Request request = api.users().list(filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USERS_LIST, 200); - UsersPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldReturnEmptyUsers() throws Exception { - Request request = api.users().list(null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - UsersPage response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), is(emptyCollectionOf(User.class))); - } - - @Test - public void shouldThrowOnGetUserWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().get(null, null), - "'user id' cannot be null!"); - } - - @Test - public void shouldGetUser() throws Exception { - Request request = api.users().get("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER, 200); - User response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetUserWithFields() throws Exception { - UserFilter filter = new UserFilter().withFields("some,random,fields", true); - Request request = api.users().get("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER, 200); - User response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnCreateUserWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().create(null), - "'user' cannot be null!"); - } - - @Test - public void shouldCreateUser() throws Exception { - Request request = api.users().create(new User("auth0")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER, 200); - User response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("connection", "auth0")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnDeleteUserWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().delete(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldDeleteUser() throws Exception { - Request request = api.users().delete("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnUpdateUserWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().update(null, new User("auth0")), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnUpdateUserWithNullData() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().update("1", null), - "'user' cannot be null!"); - } - - @Test - public void shouldUpdateUser() throws Exception { - Request request = api.users().update("1", new User("auth0")); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER, 200); - User response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/users/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("connection", "auth0")); - - assertThat(response, is(notNullValue())); - } - - - @Test - public void shouldThrowOnGetUserGuardianEnrollmentsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getEnrollments(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldGetUserGuardianEnrollments() throws Exception { - Request> request = api.users().getEnrollments("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_GUARDIAN_ENROLLMENTS_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/enrollments")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldReturnEmptyUserGuardianEnrollments() throws Exception { - Request> request = api.users().getEnrollments("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - List response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response, is(emptyCollectionOf(Enrollment.class))); - } - - @Test - public void shouldThrowOnGetUserLogEventsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getLogEvents(null, null), - "'user id' cannot be null!"); - } - - @Test - public void shouldGetUserLogEvents() throws Exception { - Request request = api.users().getLogEvents("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetUserLogEventsWithQuery() throws Exception { - LogEventFilter filter = new LogEventFilter().withQuery("date:[2022-03-13 TO *]"); - Request request = api.users().getLogEvents("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("q", "date:[2022-03-13 TO *]")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldGetUserLogEventsWithPage() throws Exception { - LogEventFilter filter = new LogEventFilter().withPage(23, 5); - Request request = api.users().getLogEvents("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldGetUserLogEventsWithTotals() throws Exception { - LogEventFilter filter = new LogEventFilter().withTotals(true); - Request request = api.users().getLogEvents("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_PAGED_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldGetUserLogEventsWithSort() throws Exception { - LogEventFilter filter = new LogEventFilter().withSort("date:1"); - Request request = api.users().getLogEvents("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("sort", "date:1")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldGetUserLogEventsWithFields() throws Exception { - LogEventFilter filter = new LogEventFilter().withFields("some,random,fields", true); - Request request = api.users().getLogEvents("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_LOG_EVENTS_LIST, 200); - LogEventsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/logs")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("fields", "some,random,fields")); - assertThat(recordedRequest, hasQueryParameter("include_fields", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldReturnEmptyUserLogEvents() throws Exception { - Request request = api.users().getLogEvents("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMPTY_LIST, 200); - LogEventsPage response = request.execute().getBody(); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), is(emptyCollectionOf(LogEvent.class))); - } - - @Test - public void shouldThrowOnDeleteUserAuthenticatorsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteAllAuthenticators(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldDeleteUserAuthenticators() throws Exception { - Request request = api.users().deleteAllAuthenticators("auth0|23"); - assertThat(request, is(notNullValue())); - - server.emptyResponse(204); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/auth0%7C23/authenticators")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnDeleteUserMultifactorProviderWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteMultifactorProvider(null, "duo"), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnDeleteUserMultifactorProviderWithNullProvider() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteMultifactorProvider("1", null), - "'provider' cannot be null!"); - } - - @Test - public void shouldDeleteUserMultifactorProvider() throws Exception { - Request request = api.users().deleteMultifactorProvider("1", "duo"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_EMAIL_PROVIDER, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/multifactor/duo")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldThrowOnRotateUserRecoveryCodeWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().rotateRecoveryCode(null), - "'user id' cannot be null!"); - } - - @Test - public void shouldRotateUserRecoveryCode() throws Exception { - Request request = api.users().rotateRecoveryCode("1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_RECOVERY_CODE, 200); - RecoveryCode response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/recovery-code-regeneration")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnLinkUserIdentityWithNullPrimaryId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().linkIdentity(null, "2", "auth0", null), - "'primary user id' cannot be null!"); - } - - @Test - public void shouldThrowOnLinkUserIdentityWithNullSecondaryId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().linkIdentity("1", null, "auth0", null), - "'secondary user id' cannot be null!"); - } - - @Test - public void shouldThrowOnLinkUserIdentityWithNullSecondaryToken() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().linkIdentity("1", null), - "'secondary id token' cannot be null!"); - } - - @Test - public void shouldThrowOnLinkUserIdentityWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().linkIdentity(null, "2"), - "'primary user id' cannot be null!"); - } - - @Test - public void shouldThrowOnLinkUserIdentityWithNullProvider() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().linkIdentity("1", "2", null, null), - "'provider' cannot be null!"); - } - - @Test - public void shouldLinkUserIdentity() throws Exception { - Request> request = api.users().linkIdentity("1", "2", "auth0", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_IDENTITIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/identities")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(2)); - assertThat(body, hasEntry("provider", "auth0")); - assertThat(body, hasEntry("user_id", "2")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldLinkUserIdentityBySecondaryIdToken() throws Exception { - Request> request = api.users().linkIdentity("1", "2"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_IDENTITIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/identities")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasEntry("link_with", "2")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldLinkUserIdentityWithConnectionId() throws Exception { - Request> request = api.users().linkIdentity("1", "2", "auth0", "123456790"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_IDENTITIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/identities")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(3)); - assertThat(body, hasEntry("provider", "auth0")); - assertThat(body, hasEntry("user_id", "2")); - assertThat(body, hasEntry("connection_id", "123456790")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnUnlinkUserIdentityWithNullPrimaryId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().unlinkIdentity(null, "2", "auth0"), - "'primary user id' cannot be null!"); - } - - @Test - public void shouldThrowOnUnlinkUserIdentityWithNullSecondaryId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().unlinkIdentity("1", null, "auth0"), - "'secondary user id' cannot be null!"); - } - - @Test - public void shouldThrowOnUnlinkUserIdentityWithNullProvider() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().unlinkIdentity("1", "2", null), - "'provider' cannot be null!"); - } - - @Test - public void shouldUnlinkUserIdentity() throws Exception { - Request> request = api.users().unlinkIdentity("1", "2", "auth0"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_IDENTITIES_LIST, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/identities/auth0/2")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldThrowOnListRolesWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().listRoles(null, null), - "'user id' cannot be null!"); - } - - @Test - public void shouldListRolesWithoutFilter() throws Exception { - Request request = api.users().listRoles("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_ROLES_PAGED_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRolesWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(23, 5); - Request request = api.users().listRoles("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_ROLES_PAGED_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListRolesWithTotals() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.users().listRoles("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_ROLES_PAGED_LIST, 200); - RolesPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldThrowOnAddRolesWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addRoles(null, Collections.emptyList()), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnAddRolesWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addRoles("1", null), - "'role ids' cannot be null!"); - } - - @Test - public void shouldThrowOnAddRolesWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addRoles("1", Collections.emptyList()), - "'role ids' cannot be empty!"); - } - - @Test - public void shouldAddRoles() throws Exception { - Request request = api.users().addRoles("1", Collections.singletonList("roleId")); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("roles")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldThrowOnRemoveRolesWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removeRoles(null, Collections.emptyList()), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnRemoveRolesWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removeRoles("1", null), - "'role ids' cannot be null!"); - } - - @Test - public void shouldThrowOnRemoveRolesWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removeRoles("1", Collections.emptyList()), - "'role ids' cannot be empty!"); - } - - @Test - public void shouldRemoveRoles() throws Exception { - Request request = api.users().removeRoles("1", Collections.singletonList("roleId")); - assertThat(request, is(notNullValue())); - - server.emptyResponse( 200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/roles")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("roles")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldListPermissionsWithoutFilter() throws Exception { - Request request = api.users().listPermissions("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListPermissionsWithPage() throws Exception { - PageFilter filter = new PageFilter().withPage(23, 5); - Request request = api.users().listPermissions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "23")); - assertThat(recordedRequest, hasQueryParameter("per_page", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - } - - @Test - public void shouldListPermissionsWithTotal() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.users().listPermissions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_PERMISSIONS_PAGED_LIST, 200); - PermissionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getLength(), is(14)); - assertThat(response.getTotal(), is(14)); - assertThat(response.getLimit(), is(50)); - } - - @Test - public void shouldThrowOnAddPermissionsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addPermissions(null, Collections.emptyList()), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnAddPermissionsWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addPermissions("1", null), - "'permissions' cannot be null!"); - } - - @Test - public void shouldThrowOnAddPermissionsWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().addPermissions("1", Collections.emptyList()), - "'permissions' cannot be empty!"); - } - - @Test - public void shouldAddPermissions() throws Exception { - List permissions = new ArrayList<>(); - Permission permission = new Permission(); - permission.setName("permissionName"); - permissions.add(permission); - Request request = api.users().addPermissions("1", permissions); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("permissions")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldThrowOnRemovePermissionsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removePermissions(null, Collections.emptyList()), - "'user id' cannot be null!"); - } - - @Test - public void shouldThrowOnRemovePermissionsWithNullList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removePermissions("roleId", null), - "'permissions' cannot be null!"); - } - - @Test - public void shouldThrowOnRemovePermissionsWithEmptyList() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().removePermissions("roleId", Collections.emptyList()), - "'permissions' cannot be empty!"); - } - - @Test - public void shouldRemovePermissions() throws Exception { - List permissions = new ArrayList<>(); - Permission permission = new Permission(); - permission.setName("permissionName"); - permissions.add(permission); - Request request = api.users().removePermissions("1", permissions); - assertThat(request, is(notNullValue())); - - server.emptyResponse(200); - Object response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/permissions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - Map body = bodyFromRequest(recordedRequest); - assertThat(body.size(), is(1)); - assertThat(body, hasKey("permissions")); - - assertThat(response, is(nullValue())); - } - - @Test - public void shouldThrowOnGetOrganizationsWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getOrganizations(null, null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldGetUserOrganizationsWithoutFilter() throws Exception { - Request request = api.users().getOrganizations("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetUserOrganizationsWithPaging() throws Exception { - Request request = api.users().getOrganizations("1", - new PageFilter().withPage(0, 20)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetUserOrganizationsWithTotals() throws Exception { - Request request = api.users().getOrganizations("1", - new PageFilter().withTotals(true)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(ORGANIZATIONS_PAGED_LIST, 200); - OrganizationsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/organizations")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(2)); - assertThat(response.getStart(), is(0)); - assertThat(response.getTotal(), is(2)); - assertThat(response.getLimit(), is(20)); - } - - @Test - public void shouldGetUserAuthenticationMethodsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getAuthenticationMethods(null, null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldGetUserAuthenticationMethodsWithoutFilter() throws Exception { - Request request = api.users().getAuthenticationMethods("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_LIST, 200); - AuthenticationMethodsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - - - @Test - public void shouldGetUserAuthenticationMethodsWithPaging() throws Exception { - Request request = api.users().getAuthenticationMethods("1", - new PageFilter().withPage(0, 20)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_PAGED_LIST, 200); - AuthenticationMethodsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("page", "0")); - assertThat(recordedRequest, hasQueryParameter("per_page", "20")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldGetUserAuthenticationMethodsWithTotals() throws Exception { - Request request = api.users().getAuthenticationMethods("1", - new PageFilter().withTotals(true)); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_PAGED_LIST, 200); - AuthenticationMethodsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getItems(), hasSize(1)); - assertThat(response.getStart(), is(0)); - assertThat(response.getTotal(), is(3)); - assertThat(response.getLimit(), is(1)); - } - - @Test - public void shouldUpdateUserAuthenticationMethodsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().updateAuthenticationMethods(null, new ArrayList<>()), - "'user ID' cannot be null!"); - } - - @Test - public void shouldUpdateUserAuthenticationMethodsWithAuthenticatorMethodsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().updateAuthenticationMethods("1", null), - "'authentication methods' cannot be null!"); - } - - @Test - public void shouldUpdateUserAuthenticationMethods() throws Exception { - ArrayList list = new ArrayList<>(); - AuthenticationMethod authenticationMethod = new AuthenticationMethod(); - list.add(authenticationMethod); - Request> request = api.users().updateAuthenticationMethods("1", list); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_UPDATE, 200); - List response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PUT, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - - } - - @Test - public void shouldNotCreateUserAuthenticationMethodsWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().createAuthenticationMethods(null, new AuthenticationMethod()), - "'user ID' cannot be null!"); - } - - @Test - public void shouldNotCreateUserAuthenticationMethodsWithAuthenticatorMethodsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().createAuthenticationMethods("1", null), - "'authentication methods' cannot be null!"); - } - - @Test - public void shouldCreateUserAuthenticationMethods() throws Exception { - AuthenticationMethod authenticationMethod = new AuthenticationMethod(); - Request request = api.users().createAuthenticationMethods("1", authenticationMethod); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_CREATE, 200); - AuthenticationMethod response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldNotGetUserAuthenticationMethodsByIdWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getAuthenticationMethodById(null, "1"), - "'user ID' cannot be null!"); - } - - @Test - public void shouldNotGetUserAuthenticationMethodsByIdWithAuthenticatorMethodIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().getAuthenticationMethodById("1", null), - "'authentication method ID' cannot be null!"); - } - - @Test - public void shouldGetUserAuthenticationMethodById() throws Exception { - Request request = api.users().getAuthenticationMethodById("1", "1"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_BY_ID, 200); - AuthenticationMethod response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/authentication-methods/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldNotUpdateUserAuthenticationMethodsByIdWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().updateAuthenticationMethodById(null, "1", new AuthenticationMethod()), - "'user ID' cannot be null!"); - } - - @Test - public void shouldNotUpdateUserAuthenticationMethodsByIdWithAuthenticatorMethodIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().updateAuthenticationMethodById("1", null, new AuthenticationMethod()), - "'authentication method ID' cannot be null!"); - } - - @Test - public void shouldNotUpdateUserAuthenticationMethodsByIdWithAuthenticatorMethodNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().updateAuthenticationMethodById("1", "1", null), - "'authentication method' cannot be null!"); - } - - @Test - public void shouldUpdateUserAuthenticationMethodById() throws Exception { - Request request = api.users().updateAuthenticationMethodById("1", "1", new AuthenticationMethod()); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTHENTICATOR_METHOD_UPDATE_BY_ID, 200); - AuthenticationMethod response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.PATCH, "/api/v2/users/1/authentication-methods/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldNotDeleteUserAuthenticationMethodsByIdWithNullId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteAuthenticationMethodById(null, "1"), - "'user ID' cannot be null!"); - } - - @Test - public void shouldNotDeleteUserAuthenticationMethodsByIdWithAuthenticatorMethodIdNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteAuthenticationMethodById("1", null), - "'authentication method ID' cannot be null!"); - } - - @Test - public void shouldDeleteUserAuthenticationMethodById() throws Exception { - Request request = api.users().deleteAuthenticationMethodById("1", "1"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/authentication-methods/1")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldNotDeleteAllAuthenticationMethodsWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteAllAuthenticationMethods(null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldDeleteAllAuthenticationMethods() throws Exception { - Request request = api.users().deleteAllAuthenticationMethods("1"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/authentication-methods")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void invalidateRememberedBrowsersThrowsWhenUserIdIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().invalidateRememberedBrowsers(null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldInvalidateRememberedBrowsers() throws Exception { - Request request = api.users().invalidateRememberedBrowsers("userId"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - Void response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.POST, "/api/v2/users/userId/multifactor/actions/invalidate-remember-browser")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldListRefreshTokensWithoutFilter() throws Exception { - Request request = api.users().listRefreshTokens("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_REFRESH_TOKENS, 200); - RefreshTokensPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/refresh-tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getTokens(), hasSize(2)); - } - - @Test - public void shouldListRefreshTokensWithPage() throws Exception { - PageFilter filter = new PageFilter().withFrom("tokenId2").withTake(5); - Request request = api.users().listRefreshTokens("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_REFRESH_TOKENS, 200); - RefreshTokensPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/refresh-tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "tokenId2")); - assertThat(recordedRequest, hasQueryParameter("take", "5")); - - assertThat(response, is(notNullValue())); - assertThat(response.getTokens(), hasSize(2)); - } - - @Test - public void shouldListRefreshTokensWithTotal() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.users().listRefreshTokens("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_REFRESH_TOKENS, 200); - RefreshTokensPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/refresh-tokens")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getTokens(), hasSize(2)); - assertThat(response.getTotal(), is(11)); - } - - @Test - public void shouldNotDeleteRefreshTokensWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteRefreshTokens(null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldDeleteRefreshTokens() throws Exception { - Request request = api.users().deleteRefreshTokens("1"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/refresh-tokens")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } - - @Test - public void shouldListSessionsWithoutFilter() throws Exception { - Request request = api.users().listSessions("1", null); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_SESSIONS, 200); - SessionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/sessions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - - assertThat(response, is(notNullValue())); - assertThat(response.getSessions(), hasSize(1)); - } - - @Test - public void shouldListSessionsWithPage() throws Exception { - PageFilter filter = new PageFilter().withFrom("sessionId3").withTake(9); - Request request = api.users().listSessions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_SESSIONS, 200); - SessionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/sessions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("from", "sessionId3")); - assertThat(recordedRequest, hasQueryParameter("take", "9")); - - assertThat(response, is(notNullValue())); - assertThat(response.getSessions(), hasSize(1)); - } - - @Test - public void shouldListSessionsWithTotal() throws Exception { - PageFilter filter = new PageFilter().withTotals(true); - Request request = api.users().listSessions("1", filter); - assertThat(request, is(notNullValue())); - - server.jsonResponse(MGMT_USER_SESSIONS, 200); - SessionsPage response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/users/1/sessions")); - assertThat(recordedRequest, hasHeader("Content-Type", "application/json")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - assertThat(recordedRequest, hasQueryParameter("include_totals", "true")); - - assertThat(response, is(notNullValue())); - assertThat(response.getSessions(), hasSize(1)); - assertThat(response.getTotal(), is(9)); - } - - @Test - public void shouldNotDeleteSessionsWithNullUserId() { - verifyThrows(IllegalArgumentException.class, - () -> api.users().deleteRefreshTokens(null), - "'user ID' cannot be null!"); - } - - @Test - public void shouldDeleteSessions() throws Exception { - Request request = api.users().deleteSessions("1"); - assertThat(request, is(notNullValue())); - - server.noContentResponse(); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest, hasMethodAndPath(HttpMethod.DELETE, "/api/v2/users/1/sessions")); - assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java new file mode 100644 index 000000000..d29ed6db9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java @@ -0,0 +1,127 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.FederatedConnectionTokenSet; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersFederatedConnectionsTokensetsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"id\":\"id\",\"connection\":\"connection\",\"scope\":\"scope\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"issued_at\":\"2024-01-15T09:30:00Z\",\"last_used_at\":\"2024-01-15T09:30:00Z\"}]")); + List response = + client.users().federatedConnectionsTokensets().list("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"connection\": \"connection\",\n" + + " \"scope\": \"scope\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"issued_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_used_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().federatedConnectionsTokensets().delete("id", "tokenset_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java new file mode 100644 index 000000000..23713fb70 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java @@ -0,0 +1,231 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.DeleteUserIdentityResponseContentItem; +import com.auth0.client.mgmt.types.UserIdentity; +import com.auth0.client.mgmt.types.UserIdentityProviderEnum; +import com.auth0.client.mgmt.users.types.LinkUserIdentityRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersIdentitiesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testLink() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"provider\",\"profileData\":{\"email\":\"email\",\"email_verified\":true,\"name\":\"name\",\"username\":\"username\",\"given_name\":\"given_name\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"family_name\":\"family_name\"},\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}]")); + List response = client.users() + .identities() + .link("id", LinkUserIdentityRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"connection\": \"connection\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"provider\": \"provider\",\n" + + " \"profileData\": {\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"name\": \"name\",\n" + + " \"username\": \"username\",\n" + + " \"given_name\": \"given_name\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"family_name\": \"family_name\"\n" + + " },\n" + + " \"isSocial\": true,\n" + + " \"access_token\": \"access_token\",\n" + + " \"access_token_secret\": \"access_token_secret\",\n" + + " \"refresh_token\": \"refresh_token\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"provider\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\",\"profileData\":{\"email\":\"email\",\"email_verified\":true,\"name\":\"name\",\"username\":\"username\",\"given_name\":\"given_name\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"family_name\":\"family_name\"}}]")); + List response = + client.users().identities().delete("id", UserIdentityProviderEnum.AD, "user_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"connection\": \"connection\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"provider\": \"provider\",\n" + + " \"isSocial\": true,\n" + + " \"access_token\": \"access_token\",\n" + + " \"access_token_secret\": \"access_token_secret\",\n" + + " \"refresh_token\": \"refresh_token\",\n" + + " \"profileData\": {\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"name\": \"name\",\n" + + " \"username\": \"username\",\n" + + " \"given_name\": \"given_name\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"family_name\": \"family_name\"\n" + + " }\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java new file mode 100644 index 000000000..b03075770 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java @@ -0,0 +1,88 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Log; +import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersLogsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"logs\":[{\"date\":\"date\",\"type\":\"type\",\"description\":\"description\",\"connection\":\"connection\",\"connection_id\":\"connection_id\",\"client_id\":\"client_id\",\"client_name\":\"client_name\",\"ip\":\"ip\",\"hostname\":\"hostname\",\"user_id\":\"user_id\",\"user_name\":\"user_name\",\"audience\":\"audience\",\"scope\":\"scope\",\"strategy\":\"strategy\",\"strategy_type\":\"strategy_type\",\"log_id\":\"log_id\",\"isMobile\":true,\"details\":{\"key\":\"value\"},\"user_agent\":\"user_agent\"}]}")); + SyncPagingIterable response = client.users() + .logs() + .list( + "id", + ListUserLogsRequestParameters.builder() + .page(1) + .perPage(1) + .sort("sort") + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java new file mode 100644 index 000000000..51e941669 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java @@ -0,0 +1,77 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.UserMultifactorProviderEnum; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersMultifactorWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testInvalidateRememberBrowser() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().multifactor().invalidateRememberBrowser("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + } + + @Test + public void testDeleteProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().multifactor().deleteProvider("id", UserMultifactorProviderEnum.DUO); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java new file mode 100644 index 000000000..820038922 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java @@ -0,0 +1,87 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Organization; +import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersOrganizationsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + SyncPagingIterable response = client.users() + .organizations() + .list( + "id", + ListUserOrganizationsRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java new file mode 100644 index 000000000..7b716b50a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java @@ -0,0 +1,201 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.PermissionRequestPayload; +import com.auth0.client.mgmt.types.UserPermissionSchema; +import com.auth0.client.mgmt.users.types.CreateUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserPermissionsRequestContent; +import com.auth0.client.mgmt.users.types.ListUserPermissionsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersPermissionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"permissions\":[{\"resource_server_identifier\":\"resource_server_identifier\",\"permission_name\":\"permission_name\",\"resource_server_name\":\"resource_server_name\",\"description\":\"description\"}]}")); + SyncPagingIterable response = client.users() + .permissions() + .list( + "id", + ListUserPermissionsRequestParameters.builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .permissions() + .create( + "id", + CreateUserPermissionsRequestContent.builder() + .permissions(Arrays.asList(PermissionRequestPayload.builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"permissions\": [\n" + + " {\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"permission_name\": \"permission_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .permissions() + .delete( + "id", + DeleteUserPermissionsRequestContent.builder() + .permissions(Arrays.asList(PermissionRequestPayload.builder() + .resourceServerIdentifier("resource_server_identifier") + .permissionName("permission_name") + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"permissions\": [\n" + + " {\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"permission_name\": \"permission_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java new file mode 100644 index 000000000..d354afef9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java @@ -0,0 +1,95 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.RefreshTokenResponseContent; +import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersRefreshTokenWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"tokens\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{}],\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.users() + .refreshToken() + .list( + "user_id", + ListRefreshTokensRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().refreshToken().delete("user_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java new file mode 100644 index 000000000..48ad71482 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java @@ -0,0 +1,178 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.DeleteUserRolesRequestContent; +import com.auth0.client.mgmt.users.types.ListUserRolesRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersRolesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"roles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}]}")); + SyncPagingIterable response = client.users() + .roles() + .list( + "id", + ListUserRolesRequestParameters.builder() + .perPage(1) + .page(1) + .includeTotals(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testAssign() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .roles() + .assign( + "id", + AssignUserRolesRequestContent.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .roles() + .delete( + "id", + DeleteUserRolesRequestContent.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java new file mode 100644 index 000000000..dea61bec9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java @@ -0,0 +1,95 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.SessionResponseContent; +import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersSessionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"sessions\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"clients\":[{}]}],\"next\":\"next\"}")); + SyncPagingIterable response = client.users() + .sessions() + .list( + "user_id", + ListUserSessionsRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().sessions().delete("user_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java new file mode 100644 index 000000000..d3b72b112 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java @@ -0,0 +1,604 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.GetUserRequestParameters; +import com.auth0.client.mgmt.types.GetUserResponseContent; +import com.auth0.client.mgmt.types.ListUsersByEmailRequestParameters; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; +import com.auth0.client.mgmt.types.RegenerateUsersRecoveryCodeResponseContent; +import com.auth0.client.mgmt.types.RevokeUserAccessRequestContent; +import com.auth0.client.mgmt.types.SearchEngineVersionsEnum; +import com.auth0.client.mgmt.types.UpdateUserRequestContent; +import com.auth0.client.mgmt.types.UpdateUserResponseContent; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"users\":[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]}")); + SyncPagingIterable response = client.users() + .list(ListUsersRequestParameters.builder() + .page(1) + .perPage(1) + .includeTotals(true) + .sort("sort") + .connection("connection") + .fields("fields") + .includeFields(true) + .q("q") + .searchEngine(SearchEngineVersionsEnum.V1) + .primaryOrder(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + CreateUserResponseContent response = client.users() + .create(CreateUserRequestContent.builder() + .connection("connection") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"connection\": \"connection\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"user_id\": \"user_id\",\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"username\": \"username\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\",\n" + + " \"identities\": [\n" + + " {\n" + + " \"connection\": \"connection\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"provider\": \"ad\",\n" + + " \"isSocial\": true,\n" + + " \"access_token\": \"access_token\",\n" + + " \"access_token_secret\": \"access_token_secret\",\n" + + " \"refresh_token\": \"refresh_token\"\n" + + " }\n" + + " ],\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"picture\": \"picture\",\n" + + " \"name\": \"name\",\n" + + " \"nickname\": \"nickname\",\n" + + " \"multifactor\": [\n" + + " \"multifactor\"\n" + + " ],\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_login\": \"last_login\",\n" + + " \"logins_count\": 1,\n" + + " \"blocked\": true,\n" + + " \"given_name\": \"given_name\",\n" + + " \"family_name\": \"family_name\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testListUsersByEmail() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]")); + List response = client.users() + .listUsersByEmail(ListUsersByEmailRequestParameters.builder() + .email("email") + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "[\n" + + " {\n" + + " \"user_id\": \"user_id\",\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"username\": \"username\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\",\n" + + " \"identities\": [\n" + + " {}\n" + + " ],\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"picture\": \"picture\",\n" + + " \"name\": \"name\",\n" + + " \"nickname\": \"nickname\",\n" + + " \"multifactor\": [\n" + + " \"multifactor\"\n" + + " ],\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_login\": \"last_login\",\n" + + " \"logins_count\": 1,\n" + + " \"blocked\": true,\n" + + " \"given_name\": \"given_name\",\n" + + " \"family_name\": \"family_name\"\n" + + " }\n" + + "]"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + GetUserResponseContent response = client.users() + .get( + "id", + GetUserRequestParameters.builder() + .fields("fields") + .includeFields(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"user_id\": \"user_id\",\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"username\": \"username\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\",\n" + + " \"identities\": [\n" + + " {\n" + + " \"connection\": \"connection\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"provider\": \"ad\",\n" + + " \"isSocial\": true,\n" + + " \"access_token\": \"access_token\",\n" + + " \"access_token_secret\": \"access_token_secret\",\n" + + " \"refresh_token\": \"refresh_token\"\n" + + " }\n" + + " ],\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"picture\": \"picture\",\n" + + " \"name\": \"name\",\n" + + " \"nickname\": \"nickname\",\n" + + " \"multifactor\": [\n" + + " \"multifactor\"\n" + + " ],\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_login\": \"last_login\",\n" + + " \"logins_count\": 1,\n" + + " \"blocked\": true,\n" + + " \"given_name\": \"given_name\",\n" + + " \"family_name\": \"family_name\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + UpdateUserResponseContent response = + client.users().update("id", UpdateUserRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"user_id\": \"user_id\",\n" + + " \"email\": \"email\",\n" + + " \"email_verified\": true,\n" + + " \"username\": \"username\",\n" + + " \"phone_number\": \"phone_number\",\n" + + " \"phone_verified\": true,\n" + + " \"created_at\": \"created_at\",\n" + + " \"updated_at\": \"updated_at\",\n" + + " \"identities\": [\n" + + " {\n" + + " \"connection\": \"connection\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"provider\": \"ad\",\n" + + " \"isSocial\": true,\n" + + " \"access_token\": \"access_token\",\n" + + " \"access_token_secret\": \"access_token_secret\",\n" + + " \"refresh_token\": \"refresh_token\"\n" + + " }\n" + + " ],\n" + + " \"app_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"user_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"picture\": \"picture\",\n" + + " \"name\": \"name\",\n" + + " \"nickname\": \"nickname\",\n" + + " \"multifactor\": [\n" + + " \"multifactor\"\n" + + " ],\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_login\": \"last_login\",\n" + + " \"logins_count\": 1,\n" + + " \"blocked\": true,\n" + + " \"given_name\": \"given_name\",\n" + + " \"family_name\": \"family_name\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRegenerateRecoveryCode() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"recovery_code\":\"recovery_code\"}")); + RegenerateUsersRecoveryCodeResponseContent response = client.users().regenerateRecoveryCode("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"recovery_code\": \"recovery_code\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testRevokeAccess() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .revokeAccess("id", RevokeUserAccessRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java new file mode 100644 index 000000000..43fd024ee --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java @@ -0,0 +1,378 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.MdlPresentationProperties; +import com.auth0.client.mgmt.types.MdlPresentationRequest; +import com.auth0.client.mgmt.types.MdlPresentationRequestProperties; +import com.auth0.client.mgmt.types.UpdateVerifiableCredentialTemplateResponseContent; +import com.auth0.client.mgmt.types.VerifiableCredentialTemplateResponse; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.CreateVerifiableCredentialTemplateRequestContent; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.ListVerifiableCredentialTemplatesRequestParameters; +import com.auth0.client.mgmt.verifiablecredentials.verification.types.UpdateVerifiableCredentialTemplateRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class VerifiableCredentialsVerificationTemplatesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"templates\":[{\"id\":\"id\",\"name\":\"name\",\"type\":\"type\",\"dialect\":\"dialect\",\"presentation\":{\"org.iso.18013.5.1.mDL\":{\"org.iso.18013.5.1\":{}}},\"custom_certificate_authority\":\"custom_certificate_authority\",\"well_known_trusted_issuers\":\"well_known_trusted_issuers\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + SyncPagingIterable response = client.verifiableCredentials() + .verification() + .templates() + .list(ListVerifiableCredentialTemplatesRequestParameters.builder() + .from("from") + .take(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"type\":\"type\",\"dialect\":\"dialect\",\"presentation\":{\"org.iso.18013.5.1.mDL\":{\"org.iso.18013.5.1\":{}}},\"custom_certificate_authority\":\"custom_certificate_authority\",\"well_known_trusted_issuers\":\"well_known_trusted_issuers\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + CreateVerifiableCredentialTemplateResponseContent response = client.verifiableCredentials() + .verification() + .templates() + .create(CreateVerifiableCredentialTemplateRequestContent.builder() + .name("name") + .type("type") + .dialect("dialect") + .presentation(MdlPresentationRequest.builder() + .orgIso1801351MDl(MdlPresentationRequestProperties.builder() + .orgIso1801351(MdlPresentationProperties.builder() + .build()) + .build()) + .build()) + .wellKnownTrustedIssuers("well_known_trusted_issuers") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"type\": \"type\",\n" + + " \"dialect\": \"dialect\",\n" + + " \"presentation\": {\n" + + " \"org.iso.18013.5.1.mDL\": {\n" + + " \"org.iso.18013.5.1\": {}\n" + + " }\n" + + " },\n" + + " \"well_known_trusted_issuers\": \"well_known_trusted_issuers\"\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"type\": \"type\",\n" + + " \"dialect\": \"dialect\",\n" + + " \"presentation\": {\n" + + " \"org.iso.18013.5.1.mDL\": {\n" + + " \"org.iso.18013.5.1\": {}\n" + + " }\n" + + " },\n" + + " \"custom_certificate_authority\": \"custom_certificate_authority\",\n" + + " \"well_known_trusted_issuers\": \"well_known_trusted_issuers\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"type\":\"type\",\"dialect\":\"dialect\",\"presentation\":{\"org.iso.18013.5.1.mDL\":{\"org.iso.18013.5.1\":{}}},\"custom_certificate_authority\":\"custom_certificate_authority\",\"well_known_trusted_issuers\":\"well_known_trusted_issuers\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetVerifiableCredentialTemplateResponseContent response = + client.verifiableCredentials().verification().templates().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"type\": \"type\",\n" + + " \"dialect\": \"dialect\",\n" + + " \"presentation\": {\n" + + " \"org.iso.18013.5.1.mDL\": {\n" + + " \"org.iso.18013.5.1\": {}\n" + + " }\n" + + " },\n" + + " \"custom_certificate_authority\": \"custom_certificate_authority\",\n" + + " \"well_known_trusted_issuers\": \"well_known_trusted_issuers\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.verifiableCredentials().verification().templates().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"type\":\"type\",\"dialect\":\"dialect\",\"presentation\":{\"org.iso.18013.5.1.mDL\":{\"org.iso.18013.5.1\":{}}},\"custom_certificate_authority\":\"custom_certificate_authority\",\"well_known_trusted_issuers\":\"well_known_trusted_issuers\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateVerifiableCredentialTemplateResponseContent response = client.verifiableCredentials() + .verification() + .templates() + .update( + "id", + UpdateVerifiableCredentialTemplateRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"type\": \"type\",\n" + + " \"dialect\": \"dialect\",\n" + + " \"presentation\": {\n" + + " \"org.iso.18013.5.1.mDL\": {\n" + + " \"org.iso.18013.5.1\": {}\n" + + " }\n" + + " },\n" + + " \"custom_certificate_authority\": \"custom_certificate_authority\",\n" + + " \"well_known_trusted_issuers\": \"well_known_trusted_issuers\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence. + */ + private boolean jsonEquals(JsonNode a, JsonNode b) { + if (a.equals(b)) return true; + if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; + if (a.isObject() && b.isObject()) { + if (a.size() != b.size()) return false; + java.util.Iterator> iter = a.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + } + return true; + } + if (a.isArray() && b.isArray()) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); i++) { + if (!jsonEquals(a.get(i), b.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/core/QueryStringMapperTest.java b/src/test/java/com/auth0/client/mgmt/core/QueryStringMapperTest.java new file mode 100644 index 000000000..c0ff15223 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/core/QueryStringMapperTest.java @@ -0,0 +1,339 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.core; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.HttpUrl; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class QueryStringMapperTest { + @Test + public void testObjectWithQuotedString_indexedArrays() { + Map map = new HashMap() { + { + put("hello", "\"world\""); + } + }; + + String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; + + String actualQueryString = queryString( + new HashMap() { + { + put("withquoted", map); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithQuotedString_arraysAsRepeats() { + Map map = new HashMap() { + { + put("hello", "\"world\""); + } + }; + + String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; + + String actualQueryString = queryString( + new HashMap() { + { + put("withquoted", map); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObject_indexedArrays() { + Map map = new HashMap() { + { + put("foo", "bar"); + put("baz", "qux"); + } + }; + + String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; + + String actualQueryString = queryString( + new HashMap() { + { + put("metadata", map); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObject_arraysAsRepeats() { + Map map = new HashMap() { + { + put("foo", "bar"); + put("baz", "qux"); + } + }; + + String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; + + String actualQueryString = queryString( + new HashMap() { + { + put("metadata", map); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testNestedObject_indexedArrays() { + Map> nestedMap = new HashMap>() { + { + put("mapkey1", new HashMap() { + { + put("mapkey1mapkey1", "mapkey1mapkey1value"); + put("mapkey1mapkey2", "mapkey1mapkey2value"); + } + }); + put("mapkey2", new HashMap() { + { + put("mapkey2mapkey1", "mapkey2mapkey1value"); + } + }); + } + }; + + String expectedQueryString = + "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" + + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; + + String actualQueryString = queryString( + new HashMap() { + { + put("nested", nestedMap); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testNestedObject_arraysAsRepeats() { + Map> nestedMap = new HashMap>() { + { + put("mapkey1", new HashMap() { + { + put("mapkey1mapkey1", "mapkey1mapkey1value"); + put("mapkey1mapkey2", "mapkey1mapkey2value"); + } + }); + put("mapkey2", new HashMap() { + { + put("mapkey2mapkey1", "mapkey2mapkey1value"); + } + }); + } + }; + + String expectedQueryString = + "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" + + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; + + String actualQueryString = queryString( + new HashMap() { + { + put("nested", nestedMap); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testDateTime_indexedArrays() { + OffsetDateTime dateTime = + OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); + + String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; + + String actualQueryString = queryString( + new HashMap() { + { + put("datetime", dateTime); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testDateTime_arraysAsRepeats() { + OffsetDateTime dateTime = + OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); + + String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; + + String actualQueryString = queryString( + new HashMap() { + { + put("datetime", dateTime); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectArray_indexedArrays() { + List> mapArray = new ArrayList>() { + { + add(new HashMap() { + { + put("key", "hello"); + put("value", "world"); + } + }); + add(new HashMap() { + { + put("key", "foo"); + put("value", "bar"); + } + }); + add(new HashMap<>()); + } + }; + + String expectedQueryString = "objects%5B0%5D%5Bvalue%5D=world&objects%5B0%5D%5Bkey%5D=hello&objects%5B1%5D" + + "%5Bvalue%5D=bar&objects%5B1%5D%5Bkey%5D=foo"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objects", mapArray); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectArray_arraysAsRepeats() { + List> mapArray = new ArrayList>() { + { + add(new HashMap() { + { + put("key", "hello"); + put("value", "world"); + } + }); + add(new HashMap() { + { + put("key", "foo"); + put("value", "bar"); + } + }); + add(new HashMap<>()); + } + }; + + String expectedQueryString = + "objects%5Bvalue%5D=world&objects%5Bkey%5D=hello&objects%5Bvalue" + "%5D=bar&objects%5Bkey%5D=foo"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objects", mapArray); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithArray_indexedArrays() { + Map objectWithArray = new HashMap() { + { + put("id", "abc123"); + put("contactIds", new ArrayList() { + { + add("id1"); + add("id2"); + add("id3"); + } + }); + } + }; + + String expectedQueryString = + "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds%5D%5B0%5D=id1&objectwitharray" + + "%5BcontactIds%5D%5B1%5D=id2&objectwitharray%5BcontactIds%5D%5B2%5D=id3"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objectwitharray", objectWithArray); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithArray_arraysAsRepeats() { + Map objectWithArray = new HashMap() { + { + put("id", "abc123"); + put("contactIds", new ArrayList() { + { + add("id1"); + add("id2"); + add("id3"); + } + }); + } + }; + + String expectedQueryString = "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds" + + "%5D=id1&objectwitharray%5BcontactIds%5D=id2&objectwitharray%5BcontactIds%5D=id3"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objectwitharray", objectWithArray); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + private static String queryString(Map params, boolean arraysAsRepeats) { + HttpUrl.Builder httpUrl = HttpUrl.parse("http://www.fakewebsite.com/").newBuilder(); + params.forEach((paramName, paramValue) -> + QueryStringMapper.addQueryParameter(httpUrl, paramName, paramValue, arraysAsRepeats)); + return httpUrl.build().encodedQuery(); + } +} diff --git a/src/test/java/com/auth0/client/mgmt/filter/ActionsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ActionsFilterTest.java deleted file mode 100644 index a6e20c10d..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/ActionsFilterTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.aMapWithSize; -import static org.hamcrest.Matchers.hasEntry; - -public class ActionsFilterTest { - - @Test - public void shouldApplyFilters() { - ActionsFilter filter = new ActionsFilter(); - assertThat(filter.getAsMap(), is(aMapWithSize(0))); - - filter - .withActionName("name") - .withDeployed(true) - .withInstalled(false) - .withPage(1, 2) - .withTriggerId("trigger"); - - Map params = filter.getAsMap(); - assertThat(params, is(aMapWithSize(6))); - assertThat(params, hasEntry("actionName", "name")); - assertThat(params, hasEntry("deployed", true)); - assertThat(params, hasEntry("installed", false)); - assertThat(params, hasEntry("per_page", 2)); - assertThat(params, hasEntry("page", 1)); - assertThat(params, hasEntry("triggerId", "trigger")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java deleted file mode 100644 index b7b4f9b8c..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class ClientGrantsFilterTest { - - private ClientGrantsFilter filter; - - @BeforeEach - public void setUp() { - filter = new ClientGrantsFilter(); - } - - @Test - public void shouldFilterByAudience() { - ClientGrantsFilter instance = filter.withAudience("https://myapi.auth0.com"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("audience", "https://myapi.auth0.com")); - } - - @Test - public void shouldFilterByClientId() { - ClientGrantsFilter instance = filter.withClientId("n3roinr32i23iron23nr"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("client_id", "n3roinr32i23iron23nr")); - } - - @Test - public void shouldFilterByPage() { - ClientGrantsFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - ClientGrantsFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java deleted file mode 100644 index 16961428b..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class ConnectionFilterTest { - - private ConnectionFilter filter; - - @BeforeEach - public void setUp() { - filter = new ConnectionFilter(); - } - - @Test - public void shouldFilterByStrategy() { - ConnectionFilter instance = filter.withStrategy("auth0"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("strategy", "auth0")); - } - - @Test - public void shouldFilterByName() { - ConnectionFilter instance = filter.withName("my-connection"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("name", "my-connection")); - } - - @Test - public void shouldFilterByPage() { - ConnectionFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldFilterWithFields() { - ConnectionFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldIncludeTotals() { - ConnectionFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldFilterWithoutFields() { - ConnectionFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java deleted file mode 100644 index 95632f324..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class DeviceCredentialsFilterTest { - - private DeviceCredentialsFilter filter; - - @BeforeEach - public void setUp() { - filter = new DeviceCredentialsFilter(); - } - - @Test - public void shouldFilterByClientId() { - DeviceCredentialsFilter instance = filter.withClientId("1234567890"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("client_id", "1234567890")); - } - - @Test - public void shouldFilterByType() { - DeviceCredentialsFilter instance = filter.withType("public_key"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("type", "public_key")); - } - - @Test - public void shouldFilterByUserId() { - DeviceCredentialsFilter instance = filter.withUserId("1234567890"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("user_id", "1234567890")); - } - - @Test - public void shouldFilterWithFields() { - DeviceCredentialsFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - DeviceCredentialsFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } - - @Test - public void shouldFilterWithPage() { - DeviceCredentialsFilter instance = filter.withPage(1, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 1)); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - } - - @Test - public void shouldFilterWithTotals() { - DeviceCredentialsFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java deleted file mode 100644 index 6b9b66b36..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class FieldFilterTest { - - private FieldsFilter filter; - - @BeforeEach - public void setUp() { - filter = new FieldsFilter(); - } - - @Test - public void shouldFilterWithFields() { - FieldsFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - FieldsFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java deleted file mode 100644 index 3f9176c68..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class GrantsFilterTest { - - private GrantsFilter filter; - - @BeforeEach - public void setUp() { - filter = new GrantsFilter(); - } - - @Test - public void shouldFilterByAudience() { - GrantsFilter instance = filter.withAudience("https://myapi.auth0.com"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("audience", "https://myapi.auth0.com")); - } - - @Test - public void shouldFilterByClientId() { - GrantsFilter instance = filter.withClientId("n3roinr32i23iron23nr"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("client_id", "n3roinr32i23iron23nr")); - } - - @Test - public void shouldFilterByPage() { - GrantsFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - GrantsFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java deleted file mode 100644 index 43abb25da..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class LogEventFilterTest { - - private LogEventFilter filter; - - @BeforeEach - public void setUp() { - filter = new LogEventFilter(); - } - - @Test - public void shouldFilterByCheckpoint() { - LogEventFilter instance = filter.withCheckpoint("log123", 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("from", "log123")); - assertThat(filter.getAsMap(), Matchers.hasEntry("take", 10)); - } - - @Test - public void shouldIncludeTotals() { - LogEventFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldFilterByQuery() { - LogEventFilter instance = filter.withQuery("id=log123"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("q", "id%3Dlog123")); - } - - @Test - public void shouldSort() { - LogEventFilter instance = filter.withSort("date:-1"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("sort", "date:-1")); - } - - @Test - public void shouldFilterByPage() { - LogEventFilter instance = filter.withPage(15, 50); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 15)); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 50)); - } - - @Test - public void shouldFilterByWithFields() { - LogEventFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - LogEventFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilterTest.java deleted file mode 100644 index 282cfc69a..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/PageBasedPaginationFilterTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class PageBasedPaginationFilterTest { - - private PageBasedPaginationFilter filter; - - @BeforeEach - public void setUp() { - filter = new PageBasedPaginationFilter(); - } - - @Test - public void shouldFilterByPage() { - PageBasedPaginationFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - PageBasedPaginationFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java deleted file mode 100644 index 99c297d24..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class PageFilterTest { - - private PageFilter filter; - - @BeforeEach - public void setUp() { - filter = new PageFilter(); - } - - @Test - public void shouldFilterByPage() { - PageFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - PageFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldIncludeCheckpointParams() { - PageFilter instance = filter.withFrom("abc123").withTake(2); - - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("from", "abc123")); - assertThat(filter.getAsMap(), Matchers.hasEntry("take", 2)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java deleted file mode 100644 index 662a8aabd..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.UnsupportedEncodingException; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.CoreMatchers.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.spy; - -public class QueryFilterTest { - - private QueryFilter filter; - - @BeforeEach - public void setUp() { - filter = new QueryFilter(); - } - - @Test - public void shouldIncludeTotals() { - QueryFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldFilterByQuery() { - QueryFilter instance = filter.withQuery("id=log123"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("q", "id%3Dlog123")); - } - - @Test - public void shouldSort() { - QueryFilter instance = filter.withSort("date:-1"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("sort", "date:-1")); - } - - @Test - public void shouldFilterByPage() { - QueryFilter instance = filter.withPage(15, 50); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 15)); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 50)); - } - - @Test - public void shouldFilterByWithFields() { - QueryFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - QueryFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } - - @Test - public void shouldThrowIllegalStateExceptionWhenUtf8IsNotSupported() throws Exception { - String value = "my test value"; - QueryFilter filter = spy(new QueryFilter()); - doThrow(UnsupportedEncodingException.class).when(filter).urlEncode(value); - - IllegalStateException e = verifyThrows(IllegalStateException.class, - () -> filter.withQuery(value), - "UTF-8 encoding not supported by current Java platform implementation."); - assertThat(e.getCause(), instanceOf(UnsupportedEncodingException.class)); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java deleted file mode 100644 index a7af3a927..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class ResourceServersFilterTest { - - private ResourceServersFilter filter; - - @BeforeEach - public void setUp() { - filter = new ResourceServersFilter(); - } - - @Test - public void shouldFilterByPage() { - ResourceServersFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - ResourceServersFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java deleted file mode 100644 index 09039a755..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class RoleFilterTest { - - private RolesFilter filter; - - @BeforeEach - public void setUp() { - filter = new RolesFilter(); - } - - @Test - public void shouldFilterByName() { - RolesFilter instance = filter.withName("roleName"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("name_filter", "roleName")); - } - - @Test - public void shouldFilterByPage() { - RolesFilter instance = filter.withPage(5, 10); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 10)); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 5)); - } - - @Test - public void shouldIncludeTotals() { - RolesFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java deleted file mode 100644 index 84fa0009d..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class RulesFilterTest { - - private RulesFilter filter; - - @BeforeEach - public void setUp() { - filter = new RulesFilter(); - } - - @Test - public void shouldFilterWithEnabled() { - RulesFilter instance = filter.withEnabled(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("enabled", true)); - } - - @Test - public void shouldFilterWithFields() { - RulesFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - RulesFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } - - @Test - public void shouldIncludeTotals() { - RulesFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldFilterByPage() { - RulesFilter instance = filter.withPage(15, 50); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 15)); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 50)); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java deleted file mode 100644 index 57e7977d9..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.*; -import static org.hamcrest.MatcherAssert.assertThat; - -public class UserFilterTest { - - private UserFilter filter; - - @BeforeEach - public void setUp() { - filter = new UserFilter(); - } - - @Test - public void shouldNotSetADefaultSearchEngineValue() { - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), not(Matchers.hasKey("search_engine"))); - } - - @Test - public void shouldSetSearchEngine() { - UserFilter instance = filter.withSearchEngine("v3"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("search_engine", "v3")); - } - - @Test - public void shouldIncludeTotals() { - UserFilter instance = filter.withTotals(true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_totals", true)); - } - - @Test - public void shouldFilterByQuery() { - UserFilter instance = filter.withQuery("id=log123"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("q", "id%3Dlog123")); - } - - @Test - public void shouldSort() { - UserFilter instance = filter.withSort("date:-1"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("sort", "date:-1")); - } - - @Test - public void shouldFilterByPage() { - UserFilter instance = filter.withPage(15, 50); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("page", 15)); - assertThat(filter.getAsMap(), Matchers.hasEntry("per_page", 50)); - } - - @Test - public void shouldFilterByWithFields() { - UserFilter instance = filter.withFields("a,b,c", true); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", true)); - } - - @Test - public void shouldFilterWithoutFields() { - UserFilter instance = filter.withFields("a,b,c", false); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("fields", "a,b,c")); - assertThat(filter.getAsMap(), Matchers.hasEntry("include_fields", false)); - } - - @Test - public void shouldFilterWithConnection() { - UserFilter instance = filter.withConnection("test"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("connection", "test")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java deleted file mode 100644 index b5379f1a2..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import com.auth0.json.mgmt.jobs.UsersExportField; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.IsNull.nullValue; - -public class UsersExportFilterTest { - - private UsersExportFilter filter; - - @BeforeEach - public void setUp() { - filter = new UsersExportFilter(); - } - - @Test - public void shouldFilterByLimit() { - UsersExportFilter instance = filter.withLimit(123); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("limit", 123)); - } - - @Test - public void shouldFilterByFormat() { - UsersExportFilter instance = filter.withFormat("json"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("format", "json")); - } - - @Test - public void shouldFilterByFields() { - ArrayList fields = new ArrayList<>(); - fields.add(new UsersExportField("first_name")); - fields.add(new UsersExportField("last_name")); - fields.add(new UsersExportField("metadata.custom_property", "custom")); - filter.withFields(fields); - - UsersExportFilter instance = filter.withFields(fields); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasKey("fields")); - - @SuppressWarnings("unchecked") - List bodyFields = (List) filter.getAsMap().get("fields"); - assertThat(bodyFields.get(0).getName(), is("first_name")); - assertThat(bodyFields.get(0).getExportAs(), is(nullValue())); - assertThat(bodyFields.get(1).getName(), is("last_name")); - assertThat(bodyFields.get(1).getExportAs(), is(nullValue())); - assertThat(bodyFields.get(2).getName(), is("metadata.custom_property")); - assertThat(bodyFields.get(2).getExportAs(), is("custom")); - } - - @Test - public void shouldFilterByConnectionId() { - UsersExportFilter instance = filter.withConnectionId("123"); - - assertThat(filter, is(instance)); - assertThat(filter.getAsMap(), is(notNullValue())); - assertThat(filter.getAsMap(), Matchers.hasEntry("connection_id", "123")); - } -} diff --git a/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java b/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java deleted file mode 100644 index 11590d29c..000000000 --- a/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.client.mgmt.filter; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class UsersImportOptionsTest { - private UsersImportOptions options; - - @BeforeEach - public void setUp() { - options = new UsersImportOptions(); - } - - @Test - public void shouldSetExternalId() { - UsersImportOptions instance = options.withExternalId("ext_id123"); - - assertThat(options, is(instance)); - assertThat(options.getAsMap(), is(notNullValue())); - assertThat(options.getAsMap(), Matchers.hasEntry("external_id", "ext_id123")); - } - - @Test - public void shouldSetSendCompletionEmail() { - UsersImportOptions instance = options.withSendCompletionEmail(false); - - assertThat(options, is(instance)); - assertThat(options.getAsMap(), is(notNullValue())); - assertThat(options.getAsMap(), Matchers.hasEntry("send_completion_email", false)); - } - - @Test - public void shouldSetUpsert() { - UsersImportOptions instance = options.withUpsert(true); - - assertThat(options, is(instance)); - assertThat(options.getAsMap(), is(notNullValue())); - assertThat(options.getAsMap(), Matchers.hasEntry("upsert", true)); - } - - @Test - public void shouldSetConnectionId() { - UsersImportOptions instance = options.withConnectionId("123"); - - assertThat(options, is(instance)); - assertThat(options.getAsMap(), is(notNullValue())); - assertThat(options.getAsMap(), Matchers.hasEntry("connection_id", "123")); - } -} diff --git a/src/test/java/com/auth0/exception/APIExceptionTest.java b/src/test/java/com/auth0/exception/APIExceptionTest.java deleted file mode 100644 index 90f79ceff..000000000 --- a/src/test/java/com/auth0/exception/APIExceptionTest.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.auth0.exception; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class APIExceptionTest { - - private Map values; - - private final static int ERROR_CODE = 42; - private final static String EXPECTED_ERROR_MESSAGE_PREFIX = "Request failed with status code " + ERROR_CODE + ": "; - - @BeforeEach - public void setUp() { - values = new HashMap<>(); - } - - @Test - public void shouldGetMessageFromErrorDescription() { - values.put("error_description", "some error description"); - values.put("description", "some description"); - values.put("message", "some message"); - values.put("error", "some error"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "some error description")); - } - - @Test - public void shouldGetMessageFromDescriptionAsString() { - values.put("message", "some message"); - values.put("error", "some error"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "some message")); - } - - @Test - public void shouldGetMessageFromDescriptionAsMap() { - Map rules = new HashMap<>(); - rules.put("verified", false); - rules.put("code", "lengthAtLeast"); - rules.put("format", Collections.singletonList(8)); - rules.put("message", "some password length message"); - - Map passwordStrengthError = new HashMap<>(); - passwordStrengthError.put("rules", Collections.singletonList(rules)); - - values.put("description", passwordStrengthError); - values.put("message", "some message"); - values.put("error", "some error"); - - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "some password length message")); - } - - @Test - public void shouldGetDefaultMessageWhenDescriptionNotMapOrString() { - values.put("description", Collections.singletonList("some description")); - - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "Unknown exception")); - } - - @Test - public void shouldGetMessageFromMessage() { - values.put("message", "some message"); - values.put("error", "some error"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "some message")); - } - - @Test - public void shouldGetMessageFromError() { - values.put("error", "some error"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "some error")); - } - - @Test - public void shouldGetDefaultMessage() { - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.getMessage(), is(EXPECTED_ERROR_MESSAGE_PREFIX + "Unknown exception")); - } - - @Test - public void shouldBeMfaRequiredWithMfaTokenError() { - values.put("error", "mfa_required"); - values.put("mfa_token", "some-mfa-token"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorRequired(), is(true)); - assertThat(apiException.getValue("mfa_token"), is("some-mfa-token")); - } - - @Test - public void shouldBeInvalidCredentialsErrorWhenInvalidGrant() { - values.put("error", "invalid_grant"); - values.put("error_description", "Wrong email or password."); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isInvalidCredentials(), is(true)); - } - - @Test - public void shouldBeInvalidCredentialsErrorWhenInvalidUserPassword() { - values.put("error", "invalid_user_password"); - values.put("error_description", "Wrong email or password."); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isInvalidCredentials(), is(true)); - } - - @Test - public void shouldNotBeInvalidCredentialsErrorWhenWrongDescription() { - values.put("error", "invalid_grant"); - values.put("error_description", "some message"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isInvalidCredentials(), is(false)); - } - - @Test - public void shouldBeAccessDeniedError() { - values.put("error", "access_denied"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isAccessDenied(), is(true)); - } - - @Test - public void shouldBeMfaEnrollementRequiredError() { - values.put("error", "unsupported_challenge_type"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorEnrollRequired(), is(true)); - } - - @Test - public void shouldBeMfaTokenInvalidErrorForMalformedToken() { - values.put("error", "invalid_grant"); - values.put("error_description", "Malformed mfa_token"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorTokenInvalid(), is(true)); - } - - @Test - public void shouldBeMfaTokenInvalidErrorForExpiredToken() { - values.put("error", "expired_token"); - values.put("error_description", "mfa_token is expired"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorTokenInvalid(), is(true)); - } - - @Test - public void shouldNotBeMfaTokenInvalidErrorForExpiredTokenWhenWrongDescription() { - values.put("error", "expired_token"); - values.put("error_description", "some message"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorTokenInvalid(), is(false)); - } - - @Test - public void shouldNotBeMfaTokenInvalidErrorForMalformedTokenWhenWrongDescription() { - values.put("error", "invalid_grant"); - values.put("error_description", "some message"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorTokenInvalid(), is(false)); - } - - @Test - public void shouldBeMfaEnrollementRequired() { - values.put("error", "unsupported_challenge_type"); - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isMultifactorEnrollRequired(), is(true)); - } - - @Test - public void checkErrorTypesShouldHandleNullError() { - APIException apiException = new APIException(values, ERROR_CODE); - assertThat(apiException.isAccessDenied(), is(false)); - assertThat(apiException.isInvalidCredentials(), is(false)); - assertThat(apiException.isMultifactorRequired(), is(false)); - assertThat(apiException.isMultifactorEnrollRequired(), is(false)); - assertThat(apiException.isMultifactorTokenInvalid(), is(false)); - assertThat(apiException.isVerificationRequired(), is(false)); - } - - // error description non-string and null - - @Test - public void shouldHandleNonStringMessageForMessageError() { - Map vals = Collections.singletonMap("error", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is("42")); - } - - @Test - public void shouldHandleNonStringMessageForMessageErrorDescription() { - Map vals = Collections.singletonMap("error_description", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is("42")); - } - - @Test - public void shouldHandleNonStringMessageForErrorMessageMessage() { - Map vals = Collections.singletonMap("message", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is("42")); - } - - @Test - public void shouldHandleNullMessageForMessageErrorDescription() { - Map vals = Collections.singletonMap("error_description", null); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is(nullValue())); - } - - @Test - public void shouldHandleNullMessageForMessageVal() { - Map vals = Collections.singletonMap("message", null); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is(nullValue())); - } - - @Test - public void shouldHandleNullMessageForErrorVal() { - Map vals = Collections.singletonMap("error", null); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getDescription(), is(nullValue())); - } - - // error code non-string and null - - @Test - public void shouldHandleNonStringMessageForError() { - Map vals = Collections.singletonMap("errorCode", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getError(), is("42")); - } - - @Test - public void shouldHandleNonStringMessageForErrorDescription() { - Map vals = Collections.singletonMap("error", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getError(), is("42")); - } - - @Test - public void shouldHandleNonStringMessageForMessage() { - Map vals = Collections.singletonMap("code", 42); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getError(), is("42")); - } - - @Test - public void shouldHandleNullMessageForMessage() { - Map vals = Collections.singletonMap("error", null); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getError(), is(nullValue())); - } - - @Test - public void shouldHandleNullMessageForError() { - Map vals = Collections.singletonMap("code", null); - APIException apiException = new APIException(vals, ERROR_CODE); - assertThat(apiException.getError(), is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/json/JsonMatcher.java b/src/test/java/com/auth0/json/JsonMatcher.java deleted file mode 100644 index 7a7b622b7..000000000 --- a/src/test/java/com/auth0/json/JsonMatcher.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.auth0.json; - -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeDiagnosingMatcher; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -public class JsonMatcher extends TypeSafeDiagnosingMatcher { - - private final String entry; - private final String key; - private final Matcher matcher; - - private JsonMatcher(String key, Object value, Matcher valueMatcher) { - this.key = key; - this.matcher = valueMatcher; - if (value != null) { - String stringValue = objectToString(value); - entry = getStringKey(key) + stringValue; - } else { - entry = null; - } - } - - @Override - protected boolean matchesSafely(String item, Description mismatchDescription) { - if (item == null) { - mismatchDescription.appendText("JSON was null"); - return false; - } - if (matcher != null) { - if (!matcher.matches(item)) { - matcher.describeMismatch(item, mismatchDescription); - return false; - } - if (!item.contains(getStringKey(key))) { - mismatchDescription.appendText("JSON does not contain the key ").appendValue(key); - return false; - } - } - if (entry != null && !item.contains(entry)) { - mismatchDescription.appendText("JSON was ").appendValue(item); - return false; - } - - return true; - } - - @Override - public void describeTo(Description description) { - if (matcher == null) { - description.appendText("A JSON with entry ") - .appendValue(entry); - } else { - matcher.describeTo(description); - } - } - - public static JsonMatcher hasEntry(String key, Object value) { - return new JsonMatcher(key, value, null); - } - - public static JsonMatcher hasEntry(String key, Matcher valueMatcher) { - return new JsonMatcher(key, null, valueMatcher); - } - - private String getStringKey(String key) { - return "\"" + key + "\":"; - } - - private String objectToString(Object value) { - String stringValue; - if (value == null) { - stringValue = "null"; - } else if (value instanceof String) { - stringValue = "\"" + value + "\""; - } else if (value instanceof Map) { - stringValue = mapToString((Map) value); - } else if (value instanceof Array) { - stringValue = arrayToString((Object[]) value); - } else if (value instanceof List) { - stringValue = listToString((List) value); - } else { - stringValue = value.toString(); - } - return stringValue; - } - - private String arrayToString(Object[] array) { - StringBuilder sb = new StringBuilder(); - sb.append("["); - for (int i = 0; i < array.length; i++) { - Object o = array[i]; - sb.append(objectToString(o)); - if (i + 1 < array.length) { - sb.append(","); - } - } - sb.append("]"); - return sb.toString(); - } - - private String listToString(List list) { - StringBuilder sb = new StringBuilder(); - sb.append("["); - Iterator it = list.iterator(); - while (it.hasNext()) { - Object o = it.next(); - sb.append(objectToString(o)); - if (it.hasNext()) { - sb.append(","); - } - } - sb.append("]"); - return sb.toString(); - } - - private String mapToString(Map map) { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - Iterator> it = map.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry e = it.next(); - sb.append("\"" + e.getKey() + "\":" + objectToString(e.getValue())); - if (it.hasNext()) { - sb.append(","); - } - } - sb.append("}"); - return sb.toString(); - } -} diff --git a/src/test/java/com/auth0/json/JsonTest.java b/src/test/java/com/auth0/json/JsonTest.java deleted file mode 100644 index 1555021ed..000000000 --- a/src/test/java/com/auth0/json/JsonTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.auth0.json; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.text.ParseException; -import java.util.Date; - -public class JsonTest { - - private final ObjectMapper mapper; - - public JsonTest() { - this.mapper = new ObjectMapper(); - } - - public String toJSON(T value) throws JsonProcessingException { - return mapper.writeValueAsString(value); - } - - public T fromJSON(String json, Class tClazz) throws IOException { - return mapper.readValue(json, tClazz); - } - - public T fromJSON(String json, TypeReference tReference) throws IOException { - return mapper.readValue(json, tReference); - } - - public String readTextFile(String path) throws IOException { - return new String(Files.readAllBytes(Paths.get(path))); - } - - protected Date parseJSONDate(String dateString) throws ParseException { - // StdDateFormat is the DateFormat Jackson uses by default for date fields (uses UTC timezone by default) - // https://fasterxml.github.io/jackson-databind/javadoc/2.9/com/fasterxml/jackson/databind/util/StdDateFormat.html - return new StdDateFormat().parse(dateString); - } -} diff --git a/src/test/java/com/auth0/json/ObjectMapperProviderTest.java b/src/test/java/com/auth0/json/ObjectMapperProviderTest.java deleted file mode 100644 index d0e3216cc..000000000 --- a/src/test/java/com/auth0/json/ObjectMapperProviderTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.auth0.json; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - -public class ObjectMapperProviderTest { - - @Test - public void providesSameInstance() { - ObjectMapper mapper = ObjectMapperProvider.getMapper(); - assertThat(mapper, equalTo(ObjectMapperProvider.getMapper())); - } -} diff --git a/src/test/java/com/auth0/json/auth/CreatedUserTest.java b/src/test/java/com/auth0/json/auth/CreatedUserTest.java deleted file mode 100644 index 802a9dc7e..000000000 --- a/src/test/java/com/auth0/json/auth/CreatedUserTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.json.auth; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class CreatedUserTest extends JsonTest { - - private static final String jsonStandard = "{\"email\":\"sample@email.com\",\"username\":\"john.doe\",\"email_verified\":true,\"_id\": \"from|_id\"}"; - private static final String jsonCustom = "{\"email\":\"sample@email.com\",\"username\":\"john.doe\",\"email_verified\":true,\"id\": \"from|id\"}"; - private static final String jsonCustomExternal = "{\"email\":\"sample@email.com\",\"username\":\"john.doe\",\"email_verified\":true,\"user_id\": \"from|user_id\"}"; - private static final String jsonMultiple = "{\"email\":\"sample@email.com\",\"username\":\"john.doe\",\"email_verified\":true,\"user_id\": \"from|user_id\",\"id\": \"from|id\",\"_id\": \"from|_id\"}"; - - @Test - public void shouldDeserializePreferringStandardUserId() throws Exception { - CreatedUser user = fromJSON(jsonMultiple, CreatedUser.class); - - assertThat(user, is(notNullValue())); - - assertThat(user.getEmail(), is("sample@email.com")); - assertThat(user.getUsername(), is("john.doe")); - assertThat(user.isEmailVerified(), is(true)); - assertThat(user.getUserId(), is("from|_id")); - } - - @Test - public void shouldDeserializeStandardConnectionUser() throws Exception { - CreatedUser user = fromJSON(jsonStandard, CreatedUser.class); - - assertThat(user, is(notNullValue())); - - assertThat(user.getEmail(), is("sample@email.com")); - assertThat(user.getUsername(), is("john.doe")); - assertThat(user.isEmailVerified(), is(true)); - assertThat(user.getUserId(), is("from|_id")); - } - - @Test - public void shouldDeserializeCustomConnectionUser() throws Exception { - CreatedUser user = fromJSON(jsonCustom, CreatedUser.class); - - assertThat(user, is(notNullValue())); - - assertThat(user.getEmail(), is("sample@email.com")); - assertThat(user.getUsername(), is("john.doe")); - assertThat(user.isEmailVerified(), is(true)); - assertThat(user.getUserId(), is("from|id")); - } - - @Test - public void shouldDeserializeCustomExternalConnectionUser() throws Exception { - CreatedUser user = fromJSON(jsonCustomExternal, CreatedUser.class); - - assertThat(user, is(notNullValue())); - - assertThat(user.getEmail(), is("sample@email.com")); - assertThat(user.getUsername(), is("john.doe")); - assertThat(user.isEmailVerified(), is(true)); - assertThat(user.getUserId(), is("from|user_id")); - } -} diff --git a/src/test/java/com/auth0/json/auth/PasswordlessEmailResponseTest.java b/src/test/java/com/auth0/json/auth/PasswordlessEmailResponseTest.java deleted file mode 100644 index 420eca6ac..000000000 --- a/src/test/java/com/auth0/json/auth/PasswordlessEmailResponseTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.auth; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class PasswordlessEmailResponseTest extends JsonTest { - - private final static String EMAIL_RESPONSE_JSON = "{\"_id\":\"abc123\",\"email\":\"user@domain.com\",\"email_verified\":true}"; - - @Test - public void shouldDeserializePasswordlessEmailResponse() throws Exception { - PasswordlessEmailResponse response = fromJSON(EMAIL_RESPONSE_JSON, PasswordlessEmailResponse.class); - - assertThat(response, is(notNullValue())); - - assertThat(response.getEmail(), is("user@domain.com")); - assertThat(response.getId(), is("abc123")); - assertThat(response.isEmailVerified(), is(true)); - } -} diff --git a/src/test/java/com/auth0/json/auth/PasswordlessSmsResponseTest.java b/src/test/java/com/auth0/json/auth/PasswordlessSmsResponseTest.java deleted file mode 100644 index 312995f81..000000000 --- a/src/test/java/com/auth0/json/auth/PasswordlessSmsResponseTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.auth; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class PasswordlessSmsResponseTest extends JsonTest { - - private final static String SMS_RESPONSE_JSON = "{\"_id\":\"abc123\",\"phone_number\":\"+11234567891\",\"phone_verified\":false,\"request_language\":null}"; - - @Test - public void shouldDeserializePasswordlessEmailResponse() throws Exception { - PasswordlessSmsResponse response = fromJSON(SMS_RESPONSE_JSON, PasswordlessSmsResponse.class); - - assertThat(response, is(notNullValue())); - - assertThat(response.getId(), is("abc123")); - assertThat(response.isPhoneVerified(), is(false)); - assertThat(response.getPhoneNumber(), is("+11234567891")); - assertThat(response.getRequestLanguage(), is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/json/auth/TokenHolderTest.java b/src/test/java/com/auth0/json/auth/TokenHolderTest.java deleted file mode 100644 index 4547f342b..000000000 --- a/src/test/java/com/auth0/json/auth/TokenHolderTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.auth0.json.auth; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.time.Instant; -import java.util.Date; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TokenHolderTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\"id_token\":\"eyJ0eXAiOiJKV1Qi...\",\"access_token\":\"A9CvPwFojaBI...\",\"refresh_token\":\"GEbRxBN...edjnXbL\",\"token_type\": \"bearer\",\"expires_in\":86000, \"scope\": \"openid profile email\"}"; - - TokenHolder holder = fromJSON(json, TokenHolder.class); - - assertThat(holder, is(notNullValue())); - assertThat(holder.getAccessToken(), is("A9CvPwFojaBI...")); - assertThat(holder.getIdToken(), is("eyJ0eXAiOiJKV1Qi...")); - assertThat(holder.getRefreshToken(), is("GEbRxBN...edjnXbL")); - assertThat(holder.getTokenType(), is("bearer")); - assertThat(holder.getExpiresIn(), is(86000L)); - assertThat(holder.getScope(), is("openid profile email")); - - // allow for a small tolerance since now may be calculated at slightly different times in the test - assertThat(getExpectedExpiredAtDiff(86000, holder.getExpiresAt()), is(lessThanOrEqualTo(2L))); - - } - - @Test - public void shouldDeserializeWithUnexpectedValues() throws Exception { - String json = "{\"id_token\":\"eyJ0eXAiOiJKV1Qi...\",\"access_token\":\"A9CvPwFojaBI...\",\"refresh_token\":\"GEbRxBN...edjnXbL\",\"token_type\": \"bearer\",\"expires_in\":86000, \"scope\": \"openid profile email\", \"some-key\": \"some-value\"}"; - - TokenHolder holder = fromJSON(json, TokenHolder.class); - - assertThat(holder, is(notNullValue())); - assertThat(holder.getAccessToken(), is("A9CvPwFojaBI...")); - assertThat(holder.getIdToken(), is("eyJ0eXAiOiJKV1Qi...")); - assertThat(holder.getRefreshToken(), is("GEbRxBN...edjnXbL")); - assertThat(holder.getTokenType(), is("bearer")); - assertThat(holder.getExpiresIn(), is(86000L)); - assertThat(holder.getScope(), is("openid profile email")); - - // allow for a small tolerance since now may be calculated at slightly different times in the test - assertThat(getExpectedExpiredAtDiff(86000, holder.getExpiresAt()), is(lessThanOrEqualTo(2L))); - } - - @Test - public void shouldDeserializeWithMissingFields() throws Exception { - String json = "{}"; - - TokenHolder holder = fromJSON(json, TokenHolder.class); - - assertThat(holder, is(notNullValue())); - assertThat(holder.getAccessToken(), is(nullValue())); - assertThat(holder.getIdToken(), is(nullValue())); - assertThat(holder.getRefreshToken(), is(nullValue())); - assertThat(holder.getTokenType(), is(nullValue())); - assertThat(holder.getScope(), is(nullValue())); - - // as a primitive, a missing value in the JSON will result in a value of zero on the value object. - assertThat(holder.getExpiresIn(), is(0L)); - assertThat(holder.getExpiresAt(), is(nullValue())); - - } - - @Test - public void shouldHaveDefaultConstructor() { - // To ensure default constructor exists for backwards-compatibility - TokenHolder tokenHolder = new TokenHolder(); - assertThat(tokenHolder, is(notNullValue())); - } - - private long getExpectedExpiredAtDiff(long expiresIn, Date expiresAt) { - Instant expectedExpiresAt = Instant.now().plusSeconds(expiresIn); - long expectedEpochSeconds = expectedExpiresAt.getEpochSecond(); - long actualEpochSeconds = expiresAt.toInstant().getEpochSecond(); - return Math.abs(expectedEpochSeconds - actualEpochSeconds); - } -} diff --git a/src/test/java/com/auth0/json/auth/UserInfoTest.java b/src/test/java/com/auth0/json/auth/UserInfoTest.java deleted file mode 100644 index c3cc6ab12..000000000 --- a/src/test/java/com/auth0/json/auth/UserInfoTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.auth0.json.auth; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.hamcrest.collection.IsMapContaining; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class UserInfoTest extends JsonTest { - - private static final String json = "{\"email_verified\":false,\"client_id\":\"q2hnj2iu...\",\"updated_at\":\"2016-12-05T15:15:40.545Z\",\"name\":\"test.account@userinfo.com\",\"email\":\"test.account@userinfo.com\"}"; - - @Test - public void shouldSerialize() throws Exception { - UserInfo info = new UserInfo(); - info.setValue("email_verified", false); - info.setValue("email", "test.account@userinfo.com"); - info.setValue("client_id", "q2hnj2iu..."); - info.setValue("updated_at", "2016-12-05T15:15:40.545Z"); - info.setValue("name", "test.account@userinfo.com"); - - String serialized = toJSON(info); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("email_verified", false)); - assertThat(serialized, JsonMatcher.hasEntry("email", "test.account@userinfo.com")); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "q2hnj2iu...")); - assertThat(serialized, JsonMatcher.hasEntry("updated_at", "2016-12-05T15:15:40.545Z")); - assertThat(serialized, JsonMatcher.hasEntry("name", "test.account@userinfo.com")); - } - - @Test - public void shouldDeserialize() throws Exception { - UserInfo info = fromJSON(json, UserInfo.class); - - assertThat(info, is(notNullValue())); - - assertThat(info.getValues(), IsMapContaining.hasEntry("email_verified", false)); - assertThat(info.getValues(), IsMapContaining.hasEntry("email", "test.account@userinfo.com")); - assertThat(info.getValues(), IsMapContaining.hasEntry("client_id", "q2hnj2iu...")); - assertThat(info.getValues(), IsMapContaining.hasEntry("updated_at", "2016-12-05T15:15:40.545Z")); - assertThat(info.getValues(), IsMapContaining.hasEntry("name", "test.account@userinfo.com")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/ClientGrantTest.java b/src/test/java/com/auth0/json/mgmt/ClientGrantTest.java deleted file mode 100644 index cade1f906..000000000 --- a/src/test/java/com/auth0/json/mgmt/ClientGrantTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.clientgrants.ClientGrant; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ClientGrantTest extends JsonTest { - - private static final String json = "{\"client_id\":\"clientId\",\"audience\":\"aud\",\"scope\":[\"one\",\"two\"],\"organization_usage\": \"allow\",\"allow_any_organization\":true}"; - private static final String readOnlyJson = "{\"id\":\"grantId\"}"; - - @Test - public void shouldSerialize() throws Exception { - ClientGrant grant = new ClientGrant(); - grant.setAudience("aud"); - grant.setClientId("clientId"); - grant.setScope(Arrays.asList("one", "two")); - grant.setOrganizationUsage("require"); - grant.setAllowAnyOrganization(true); - - String serialized = toJSON(grant); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "clientId")); - assertThat(serialized, JsonMatcher.hasEntry("audience", "aud")); - assertThat(serialized, JsonMatcher.hasEntry("scope", Arrays.asList("one", "two"))); - assertThat(serialized, JsonMatcher.hasEntry("organization_usage", "require")); - assertThat(serialized, JsonMatcher.hasEntry("allow_any_organization", true)); - } - - @Test - public void shouldDeserialize() throws Exception { - ClientGrant grant = fromJSON(json, ClientGrant.class); - - assertThat(grant, is(notNullValue())); - - assertThat(grant.getAudience(), is("aud")); - assertThat(grant.getClientId(), is("clientId")); - assertThat(grant.getScope(), contains("one", "two")); - assertThat(grant.getOrganizationUsage(), is("allow")); - assertThat(grant.getAllowAnyOrganization(), is(true)); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - ClientGrant grant = fromJSON(readOnlyJson, ClientGrant.class); - assertThat(grant, is(notNullValue())); - - assertThat(grant.getId(), is("grantId")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/DailyStatsTest.java b/src/test/java/com/auth0/json/mgmt/DailyStatsTest.java deleted file mode 100644 index 25f9cdf19..000000000 --- a/src/test/java/com/auth0/json/mgmt/DailyStatsTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.stats.DailyStats; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class DailyStatsTest extends JsonTest { - private static final String json = "{\"logins\":123,\"date\":\"2017-01-18T17:45:08.328Z\"}"; - - @Test - public void shouldDeserialize() throws Exception { - DailyStats stats = fromJSON(json, DailyStats.class); - - assertThat(stats, is(notNullValue())); - assertThat(stats.getDate(), is(equalTo(parseJSONDate("2017-01-18T17:45:08.328Z")))); - assertThat(stats.getLogins(), is(123)); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/DeviceCredentialsTest.java b/src/test/java/com/auth0/json/mgmt/DeviceCredentialsTest.java deleted file mode 100644 index 46c85956b..000000000 --- a/src/test/java/com/auth0/json/mgmt/DeviceCredentialsTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.devicecredentials.DeviceCredentials; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class DeviceCredentialsTest extends JsonTest { - - private static final String json = "{\"device_name\":\"devName\",\"type\":\"publicKey\",\"device_id\":\"dev123\",\"user_id\":\"theUserId\",\"client_id\":\"client123\"}"; - private static final String readOnlyJson = "{\"id\":\"credentialsId\"}"; - - @Test - public void shouldSerialize() throws Exception { - DeviceCredentials credentials = new DeviceCredentials("devName", "publicKey", "val123", "dev123", "client123"); - credentials.setUserId("theUserId"); - - String serialized = toJSON(credentials); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("device_name", "devName")); - assertThat(serialized, JsonMatcher.hasEntry("type", "publicKey")); - assertThat(serialized, JsonMatcher.hasEntry("value", "val123")); - assertThat(serialized, JsonMatcher.hasEntry("device_id", "dev123")); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client123")); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "theUserId")); - } - - @Test - public void shouldDeserialize() throws Exception { - DeviceCredentials credentials = fromJSON(json, DeviceCredentials.class); - - assertThat(credentials, is(notNullValue())); - assertThat(credentials.getDeviceName(), is("devName")); - assertThat(credentials.getType(), is("publicKey")); - assertThat(credentials.getDeviceId(), is("dev123")); - assertThat(credentials.getUserId(), is("theUserId")); - assertThat(credentials.getClientId(), is("client123")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - DeviceCredentials credentials = fromJSON(readOnlyJson, DeviceCredentials.class); - assertThat(credentials, is(notNullValue())); - - assertThat(credentials.getId(), is("credentialsId")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/EmailTemplateTest.java b/src/test/java/com/auth0/json/mgmt/EmailTemplateTest.java deleted file mode 100644 index 01a8addf1..000000000 --- a/src/test/java/com/auth0/json/mgmt/EmailTemplateTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.emailtemplates.EmailTemplate; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EmailTemplateTest extends JsonTest { - - private static final String json = "{\"template\": \"welcome_email\", \"from\": \"you@auth0.com\", \"subject\": \"Some subject\", \"syntax\": \"liquid\", \"body\": \" \", \"enabled\": true}"; - - @Test - public void shouldSerialize() throws Exception { - EmailTemplate template = new EmailTemplate(); - template.setResultUrl("https://auth0.com"); - template.setUrlLifetimeInSeconds(993311); - template.setBody("SOME HTML"); - template.setEnabled(false); - template.setSyntax("html"); - template.setSubject("Hello world"); - template.setFrom("me@auth0.com"); - template.setName("farewell"); - - String serialized = toJSON(template); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("resultUrl", "https://auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("urlLifetimeInSeconds", 993311)); - assertThat(serialized, JsonMatcher.hasEntry("body", "SOME HTML")); - assertThat(serialized, JsonMatcher.hasEntry("enabled", false)); - assertThat(serialized, JsonMatcher.hasEntry("syntax", "html")); - assertThat(serialized, JsonMatcher.hasEntry("subject", "Hello world")); - assertThat(serialized, JsonMatcher.hasEntry("from", "me@auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("template", "farewell")); - } - - @Test - public void shouldDeserialize() throws Exception { - EmailTemplate template = fromJSON(json, EmailTemplate.class); - - assertThat(template, is(notNullValue())); - assertThat(template.getName(), is("welcome_email")); - assertThat(template.getFrom(), is("you@auth0.com")); - assertThat(template.getSubject(), is("Some subject")); - assertThat(template.getSyntax(), is("liquid")); - assertThat(template.getBody(), is(" ")); - assertThat(template.isEnabled(), is(true)); - } - - @Test - public void shouldHaveDefaults() { - EmailTemplate template = new EmailTemplate(); - assertThat(template.getSyntax(), is("liquid")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/GrantTest.java b/src/test/java/com/auth0/json/mgmt/GrantTest.java deleted file mode 100644 index 8f7c27e2e..000000000 --- a/src/test/java/com/auth0/json/mgmt/GrantTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.grants.Grant; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class GrantTest extends JsonTest { - - private static final String json = "{\"clientID\":\"clientId\",\"user_id\":\"userId\",\"audience\":\"aud\",\"scope\":[\"one\",\"two\"]}"; - private static final String readOnlyJson = "{\"id\":\"grantId\"}"; - - @Test - public void shouldSerialize() throws Exception { - Grant grant = new Grant(); - grant.setUserId("userId"); - grant.setAudience("aud"); - grant.setClientId("clientId"); - grant.setScope(Arrays.asList("one", "two")); - - String serialized = toJSON(grant); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "userId")); - assertThat(serialized, JsonMatcher.hasEntry("clientID", "clientId")); - assertThat(serialized, JsonMatcher.hasEntry("audience", "aud")); - assertThat(serialized, JsonMatcher.hasEntry("scope", Arrays.asList("one", "two"))); - } - - @Test - public void shouldDeserialize() throws Exception { - Grant grant = fromJSON(json, Grant.class); - - assertThat(grant, is(notNullValue())); - assertThat(grant.getUserId(), is("userId")); - assertThat(grant.getAudience(), is("aud")); - assertThat(grant.getClientId(), is("clientId")); - assertThat(grant.getScope(), contains("one", "two")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Grant grant = fromJSON(readOnlyJson, Grant.class); - assertThat(grant, is(notNullValue())); - - assertThat(grant.getId(), is("grantId")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/ResourceServerTest.java b/src/test/java/com/auth0/json/mgmt/ResourceServerTest.java deleted file mode 100644 index a5e6bd04b..000000000 --- a/src/test/java/com/auth0/json/mgmt/ResourceServerTest.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.resourceserver.*; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.hamcrest.Matchers.containsString; - -public class ResourceServerTest extends JsonTest { - private final static String RESOURCE_SERVER_JSON = "src/test/resources/mgmt/resource_server.json"; - - @Test - public void deserialize() throws Exception { - ResourceServer deserialized = fromJSON(readTextFile(RESOURCE_SERVER_JSON), ResourceServer.class); - - assertThat(deserialized.getId(), is("23445566abab")); - assertThat(deserialized.getName(), is("Some API")); - assertThat(deserialized.getIdentifier(), is("https://api.my-company.com/api/v2/")); - assertThat(deserialized.getScopes(), hasSize(2)); - assertThat(deserialized.getSigningAlgorithm(), is("RS256")); - assertThat(deserialized.getSigningSecret(), is("secret")); - assertThat(deserialized.isSystem(), is(true)); - assertThat(deserialized.getAllowOfflineAccess(), is(false)); - assertThat(deserialized.getSkipConsentForVerifiableFirstPartyClients(), is(false)); - assertThat(deserialized.getTokenDialect(), is("access_token")); - assertThat(deserialized.getTokenLifetime(), is(86400)); - assertThat(deserialized.getVerificationLocation(), is("verification_location")); - assertThat(deserialized.getConsentPolicy(), is("transactional-authorization-with-mfa")); - assertThat(deserialized.getAuthorizationDetails(), is(notNullValue())); - assertThat(deserialized.getAuthorizationDetails().size(), is(2)); - assertThat(deserialized.getAuthorizationDetails().stream().map(AuthorizationDetails::getType).collect(Collectors.toList()), containsInAnyOrder("payment", "my custom type")); - assertThat(deserialized.getTokenEncryption(), notNullValue()); - assertThat(deserialized.getTokenEncryption().getFormat(), is("compact-nested-jwe")); - assertThat(deserialized.getTokenEncryption().getEncryptionKey().getAlg(), is("RSA-OAEP-256")); - assertThat(deserialized.getTokenEncryption().getEncryptionKey().getKid(), is("my kid")); - assertThat(deserialized.getTokenEncryption().getEncryptionKey().getName(), is("my JWE public key")); - assertThat(deserialized.getTokenEncryption().getEncryptionKey().getThumbprintSha256(), is("thumbprint")); - assertThat(deserialized.getProofOfPossession().getMechanism(), is("mtls")); - assertThat(deserialized.getProofOfPossession().getRequired(), is(true)); - } - - @Test - public void serialize() throws Exception { - ResourceServer entity = new ResourceServer("https://api.my-company.com/api/v2/"); - Scope scope1 = new Scope("read:client_grants"); - scope1.setDescription("Read Client Grants"); - Scope scope2 = new Scope("create:client_grants"); - scope2.setDescription("Create Client Grants"); - - List scopes = new ArrayList<>(); - scopes.add(scope1); - scopes.add(scope2); - entity.setId("23445566abab"); - entity.setName("Some API"); - entity.setScopes(scopes); - entity.setSigningAlgorithm("RS256"); - entity.setSigningSecret("secret"); - entity.setEnforcePolicies(true); - entity.setAllowOfflineAccess(false); - entity.setSkipConsentForVerifiableFirstPartyClients(false); - entity.setTokenLifetime(86400); - entity.setTokenDialect("access_token_authz"); - entity.setVerificationLocation("verification_location"); - entity.setConsentPolicy("transactional-authorization-with-mfa"); - AuthorizationDetails authorizationDetails1 = new AuthorizationDetails("type1"); - AuthorizationDetails authorizationDetails2 = new AuthorizationDetails("type2"); - entity.setAuthorizationDetails(Arrays.asList(authorizationDetails1, authorizationDetails2)); - EncryptionKey encryptionKey = new EncryptionKey(); - encryptionKey.setName("name"); - encryptionKey.setAlg("alg"); - encryptionKey.setKid("kid"); - encryptionKey.setPem("pem"); - TokenEncryption tokenEncryption = new TokenEncryption("format", encryptionKey); - entity.setTokenEncryption(tokenEncryption); - ProofOfPossession proofOfPossession = new ProofOfPossession("mtls", true); - entity.setProofOfPossession(proofOfPossession); - - String json = toJSON(entity); - - System.out.println(json); - - assertThat(json, hasEntry("id", "23445566abab")); - assertThat(json, hasEntry("name", "Some API")); - assertThat(json, hasEntry("identifier", "https://api.my-company.com/api/v2/")); - assertThat(json, hasEntry("signing_alg", "RS256")); - assertThat(json, hasEntry("signing_secret", "secret")); - assertThat(json, hasEntry("enforce_policies", true)); - assertThat(json, hasEntry("allow_offline_access", false)); - assertThat(json, hasEntry("skip_consent_for_verifiable_first_party_clients", false)); - assertThat(json, hasEntry("token_lifetime", 86400)); - assertThat(json, hasEntry("token_dialect", "access_token_authz")); - assertThat(json, hasEntry("verification_location", "verification_location")); - assertThat(json, hasEntry("consent_policy", "transactional-authorization-with-mfa")); - assertThat(json, hasEntry("authorization_details", notNullValue())); - assertThat(json, hasEntry("token_encryption", containsString("{\"format\":\"format\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"alg\",\"pem\":\"pem\",\"kid\":\"kid\"}}"))); - assertThat(json, hasEntry("proof_of_possession", containsString("{\"mechanism\":\"mtls\",\"required\":true}"))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/RoleTest.java b/src/test/java/com/auth0/json/mgmt/RoleTest.java deleted file mode 100644 index 3b9bf5c05..000000000 --- a/src/test/java/com/auth0/json/mgmt/RoleTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.roles.Role; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RoleTest extends JsonTest { - - private static final String json = "{\"name\":\"role\",\"description\":\"desc\"}"; - private static final String readOnlyJson = "{\"id\":\"roleId\"}"; - - @Test - public void shouldSerialize() throws Exception { - Role role = new Role(); - role.setName("role"); - role.setDescription("desc"); - - String serialized = toJSON(role); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "role")); - assertThat(serialized, JsonMatcher.hasEntry("description", "desc")); - } - - @Test - public void shouldDeserialize() throws Exception { - Role role = fromJSON(json, Role.class); - - assertThat(role, is(notNullValue())); - assertThat(role.getName(), is("role")); - assertThat(role.getDescription(), is("desc")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Role role = fromJSON(readOnlyJson, Role.class); - assertThat(role, is(notNullValue())); - - assertThat(role.getId(), is("roleId")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/RuleTest.java b/src/test/java/com/auth0/json/mgmt/RuleTest.java deleted file mode 100644 index fc8eebec0..000000000 --- a/src/test/java/com/auth0/json/mgmt/RuleTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.rules.Rule; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RuleTest extends JsonTest { - - private static final String json = "{\"name\":\"my-rule\",\"script\":\"function(user,context,callback){}\",\"enabled\":true,\"order\":1}"; - private static final String readOnlyJson = "{\"id\":\"ruleId\",\"stage\":\"login_success\"}"; - - @Test - public void shouldSerialize() throws Exception { - Rule rule = new Rule("my-rule", "function(user,context,callback){}"); - rule.setOrder(1); - rule.setEnabled(true); - - String serialized = toJSON(rule); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "my-rule")); - assertThat(serialized, JsonMatcher.hasEntry("script", "function(user,context,callback){}")); - assertThat(serialized, JsonMatcher.hasEntry("enabled", true)); - assertThat(serialized, JsonMatcher.hasEntry("order", 1)); - } - - @Test - public void shouldDeserialize() throws Exception { - Rule rule = fromJSON(json, Rule.class); - - assertThat(rule, is(notNullValue())); - assertThat(rule.getName(), is("my-rule")); - assertThat(rule.getScript(), is("function(user,context,callback){}")); - assertThat(rule.getOrder(), is(1)); - assertThat(rule.isEnabled(), is(true)); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Rule rule = fromJSON(readOnlyJson, Rule.class); - assertThat(rule, is(notNullValue())); - - assertThat(rule.getId(), is("ruleId")); - assertThat(rule.getStage(), is("login_success")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/RulesConfigTest.java b/src/test/java/com/auth0/json/mgmt/RulesConfigTest.java deleted file mode 100644 index f352ab9e2..000000000 --- a/src/test/java/com/auth0/json/mgmt/RulesConfigTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.rules.RulesConfig; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RulesConfigTest extends JsonTest { - - private static final String json = "{\"key\":\"my-key\",\"value\":\"SECRET\"}"; - private static final String readOnlyJson = "{\"key\":\"my-key\"}"; - - @Test - public void shouldSerialize() throws Exception { - RulesConfig rule = new RulesConfig("SECRET"); - - String serialized = toJSON(rule); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("value", "SECRET")); - } - - @Test - public void shouldDeserialize() throws Exception { - RulesConfig rule = fromJSON(json, RulesConfig.class); - - assertThat(rule, is(notNullValue())); - assertThat(rule.getValue(), is("SECRET")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - RulesConfig rule = fromJSON(readOnlyJson, RulesConfig.class); - assertThat(rule, is(notNullValue())); - - assertThat(rule.getKey(), is("my-key")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/ScopeTest.java b/src/test/java/com/auth0/json/mgmt/ScopeTest.java deleted file mode 100644 index d5415d7a7..000000000 --- a/src/test/java/com/auth0/json/mgmt/ScopeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.resourceserver.Scope; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class ScopeTest extends JsonTest { - private static final String SCOPE_JSON = "src/test/resources/mgmt/scope.json"; - - @Test - public void serialize() throws Exception { - Scope scope = new Scope("read:client_grants"); - scope.setDescription("Read Client Grants"); - String json = toJSON(scope); - - assertThat(json, JsonMatcher.hasEntry("value", "read:client_grants")); - assertThat(json, JsonMatcher.hasEntry("description", "Read Client Grants")); - } - - @Test - public void deserialize() throws Exception { - Scope deserialized = fromJSON(readTextFile(SCOPE_JSON), Scope.class); - - assertThat(deserialized.getValue(), is("read:client_grants")); - assertThat(deserialized.getDescription(), is("Read Client Grants")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/TokenTest.java b/src/test/java/com/auth0/json/mgmt/TokenTest.java deleted file mode 100644 index 20d877728..000000000 --- a/src/test/java/com/auth0/json/mgmt/TokenTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.blacklists.Token; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class TokenTest extends JsonTest { - private static final String json = "{\"jti\":\"id\",\"aud\":\"myapi\"}"; - - @Test - public void shouldSerialize() throws Exception { - Token token = new Token("id"); - token.setAud("myapi"); - - String serialized = toJSON(token); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("jti", "id")); - assertThat(serialized, JsonMatcher.hasEntry("aud", "myapi")); - } - - @Test - public void shouldDeserialize() throws Exception { - Token token = fromJSON(json, Token.class); - - assertThat(token, is(notNullValue())); - assertThat(token.getAud(), is("myapi")); - assertThat(token.getJTI(), is("id")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/ActionTest.java b/src/test/java/com/auth0/json/mgmt/actions/ActionTest.java deleted file mode 100644 index 929535dd5..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/ActionTest.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class ActionTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"id\": \"action-id\",\n" + - " \"name\": \"my action\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-11T15:44:05.330221459Z\",\n" + - " \"updated_at\": \"2021-08-16T20:24:57.108759345Z\",\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"slack-notify\",\n" + - " \"version\": \"0.1.7\"\n" + - " }\n" + - " ],\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"built\",\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"secret-key-1\",\n" + - " \"updated_at\": \"2021-08-12T17:09:42.071504554Z\"\n" + - " }\n" + - " ],\n" + - " \"current_version\": {\n" + - " \"id\": \"c4d1c41e-a14d-441a-bbbe-da50871f0ce90\",\n" + - " \"code\": \"/**\\n* Handler that will be called during the execution of a PostLogin flow.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\nexports.onExecutePostLogin = async (event, api) => {\\n // var a = null;\\n // a.boom(;)\\n // throw new Error(\\\"oops\\\");\\n console.log(\\\"testing updated!\\\");\\n};\\n\\n\\n/**\\n* Handler that will be invoked when this action is resuming after an external redirect. If your\\n* onExecutePostLogin function does not perform a redirect, this function can be safely ignored.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\n// exports.onContinuePostLogin = async (event, api) => {\\n// };\\n\",\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"BUILT\",\n" + - " \"number\": 18,\n" + - " \"build_time\": \"2021-08-16T20:26:42.425146135Z\",\n" + - " \"created_at\": \"2021-08-16T20:26:42.253086110Z\",\n" + - " \"updated_at\": \"2021-08-16T20:26:42.427338891Z\"\n" + - " },\n" + - " \"deployed_version\": {\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"slack-notify\",\n" + - " \"version\": \"0.1.7\"\n" + - " }\n" + - " ],\n" + - " \"id\": \"some-id\",\n" + - " \"deployed\": true,\n" + - " \"number\": 18,\n" + - " \"built_at\": \"2021-08-16T20:26:42.425146135Z\",\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"secret-key-1\",\n" + - " \"updated_at\": \"2021-08-12T17:09:42.071504554Z\"\n" + - " }\n" + - " ],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-16T20:26:42.253086110Z\",\n" + - " \"updated_at\": \"2021-08-16T20:26:42.427338891Z\",\n" + - " \"runtime\": \"node16\"\n" + - " },\n" + - " \"all_changes_deployed\": true\n" + - "}\n"; - - Action action = fromJSON(json, Action.class); - - assertThat(action, is(notNullValue())); - assertThat(action.getId(), is("action-id")); - assertThat(action.getName(), is("my action")); - assertThat(action.getSupportedTriggers(), is(notNullValue())); - assertThat(action.getSupportedTriggers().size(), is(1)); - assertThat(action.getSupportedTriggers().get(0).getId(), is("post-login")); - assertThat(action.getSupportedTriggers().get(0).getVersion(), is("v2")); - assertThat(action.getCreatedAt(), is(parseJSONDate("2021-08-11T15:44:05.330221459Z"))); - assertThat(action.getUpdatedAt(), is(parseJSONDate("2021-08-16T20:24:57.108759345Z"))); - assertThat(action.getCode(), is("some code")); - assertThat(action.getDependencies(), is(notNullValue())); - assertThat(action.getDependencies().size(), is(1)); - assertThat(action.getDependencies().get(0).getName(), is("slack-notify")); - assertThat(action.getDependencies().get(0).getVersion(), is("0.1.7")); - assertThat(action.getRuntime(), is("node16")); - assertThat(action.getStatus(), is("built")); - assertThat(action.getSecrets(), is(notNullValue())); - assertThat(action.getSecrets().size(), is(1)); - assertThat(action.getSecrets().get(0).getName(), is("secret-key-1")); - assertThat(action.getSecrets().get(0).getUpdatedAt(), is(parseJSONDate("2021-08-12T17:09:42.071504554Z"))); - assertThat(action.getAllChangesDeployed(), is(true)); - - // current_version hidden from API explorer, should it be on model? - - assertThat(action.getDeployedVersion(), is(notNullValue())); - assertThat(action.getDeployedVersion().getCode(), is("some code")); - assertThat(action.getDeployedVersion().getDependencies(), is(notNullValue())); - assertThat(action.getDeployedVersion().getDependencies().size(), is(1)); - assertThat(action.getDeployedVersion().getDependencies().get(0).getName(), is("slack-notify")); - assertThat(action.getDeployedVersion().getDependencies().get(0).getVersion(), is("0.1.7")); - assertThat(action.getDeployedVersion().getId(), is("some-id")); - assertThat(action.getDeployedVersion().isDeployed(), is(true)); - assertThat(action.getDeployedVersion().getNumber(), is(18)); - assertThat(action.getDeployedVersion().getBuiltAt(), is(parseJSONDate("2021-08-16T20:26:42.425146135Z"))); - assertThat(action.getDeployedVersion().getSecrets(), is(notNullValue())); - assertThat(action.getDeployedVersion().getSecrets().size(), is(1)); - assertThat(action.getDeployedVersion().getSecrets().get(0).getName(), is("secret-key-1")); - assertThat(action.getDeployedVersion().getSecrets().get(0).getUpdatedAt(), is(parseJSONDate("2021-08-12T17:09:42.071504554Z"))); - assertThat(action.getDeployedVersion().getStatus(), is("built")); - assertThat(action.getDeployedVersion().getCreatedAt(), is(parseJSONDate("2021-08-16T20:26:42.253086110Z"))); - assertThat(action.getDeployedVersion().getUpdatedAt(), is(parseJSONDate("2021-08-16T20:26:42.427338891Z"))); - } - - @Test - public void shouldSerialize() throws Exception { - Action action = new Action(); - - Trigger trigger = new Trigger(); - trigger.setId("post-login"); - trigger.setVersion("v1"); - trigger.setDefaultRuntime("node12"); - trigger.setStatus("CURRENT"); - trigger.setRuntimes(Arrays.asList("node12", "node16")); - - Secret secret1 = new Secret("secret-1", "hidden-1"); - Secret secret2 = new Secret("secret-2", "hidden-2"); - - Dependency dependency = new Dependency("lowdash", "1.5.8"); - - action.setName("action-name"); - action.setRuntime("node16"); - action.setCode("some code"); - action.setSupportedTriggers(Collections.singletonList(trigger)); - action.setSecrets(Arrays.asList(secret1, secret2)); - action.setDependencies(Collections.singletonList(dependency)); - - String serialized = toJSON(action); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "action-name")); - assertThat(serialized, JsonMatcher.hasEntry("runtime", "node16")); - assertThat(serialized, JsonMatcher.hasEntry("code", "some code")); - assertThat(serialized, JsonMatcher.hasEntry("supported_triggers", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("dependencies", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("secrets", is(notNullValue()))); - - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/ActionsPageTest.java b/src/test/java/com/auth0/json/mgmt/actions/ActionsPageTest.java deleted file mode 100644 index e8fba5252..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/ActionsPageTest.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ActionsPageTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"actions\": [\n" + - " {\n" + - " \"id\": \"action-id\",\n" + - " \"name\": \"my action\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-16T19:38:33.018980733Z\",\n" + - " \"updated_at\": \"2021-08-16T19:38:33.047653418Z\",\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [],\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"built\",\n" + - " \"secrets\": [],\n" + - " \"deployed_version\": {\n" + - " \"code\": \"/**\\n* Handler that will be called during the execution of a PostLogin flow.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\nexports.onExecutePostLogin = async (event, api) => {\\n};\\n\\n\\n/**\\n* Handler that will be invoked when this action is resuming after an external redirect. If your\\n* onExecutePostLogin function does not perform a redirect, this function can be safely ignored.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\n// exports.onContinuePostLogin = async (event, api) => {\\n// };\\n\",\n" + - " \"dependencies\": [],\n" + - " \"id\": \"a1fc2198-119dd4403-8a45-9f3b6bf32a6e\",\n" + - " \"deployed\": true,\n" + - " \"number\": 1,\n" + - " \"built_at\": \"2021-08-16T19:39:37.789535383Z\",\n" + - " \"secrets\": [],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-16T19:39:37.655559720Z\",\n" + - " \"updated_at\": \"2021-08-16T19:39:37.791508099Z\",\n" + - " \"runtime\": \"node16\"\n" + - " },\n" + - " \"all_changes_deployed\": true\n" + - " },\n" + - " {\n" + - " \"id\": \"ff66aa6f-69c2-4b66-8d6d-5b4f0cd94820\",\n" + - " \"name\": \"new-action-6\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-17T19:06:56.702356177Z\",\n" + - " \"updated_at\": \"2021-08-17T19:06:56.726302287Z\",\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"my-dep\",\n" + - " \"version\": \"1.0.0\"\n" + - " }\n" + - " ],\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"built\",\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"my-secret-key\",\n" + - " \"updated_at\": \"2021-08-17T19:06:56.726302287Z\"\n" + - " }\n" + - " ],\n" + - " \"all_changes_deployed\": false\n" + - " }\n" + - " ],\n" + - " \"total\": 4,\n" + - " \"page\": 1,\n" + - " \"per_page\": 2\n" + - "}\n"; - - ActionsPage page = fromJSON(json, ActionsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getItems().get(0), is(instanceOf(Action.class))); - assertThat(page.getItems().get(1), is(instanceOf(Action.class))); - assertThat(page.getTotal(), is(4)); - } - - @Test - public void shouldCreatePageFromList() { - ActionsPage page = new ActionsPageDeserializer().createPage(Collections.singletonList(new Action())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - } - - @Test - public void shouldCreatePageWithAllParams() { - ActionsPage page = new ActionsPage(0, 1, 2, 3, "next", Collections.singletonList(new Action())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(1)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(3)); - assertThat(page.getNext(), is("next")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/BindingsPageTest.java b/src/test/java/com/auth0/json/mgmt/actions/BindingsPageTest.java deleted file mode 100644 index 248cc7476..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/BindingsPageTest.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class BindingsPageTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"bindings\": [\n" + - " {\n" + - " \"id\": \"binding-id\",\n" + - " \"trigger_id\": \"post-login\",\n" + - " \"action\": {\n" + - " \"id\": \"action-id\",\n" + - " \"name\": \"my action\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-11T15:44:05.330221459Z\",\n" + - " \"updated_at\": \"2021-08-16T20:24:57.101751726Z\",\n" + - " \"current_version\": {\n" + - " \"id\": \"1baa9d7e-49db-4e3f-b026-3c1a77dc9a99\",\n" + - " \"code\": \"/**\\n* Handler that will be called during the execution of a PostLogin flow.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\nexports.onExecutePostLogin = async (event, api) => {\\n // var a = null;\\n // a.boom(;)\\n // throw new Error(\\\"oops\\\");\\n console.log(\\\"testing updated!\\\");\\n};\\n\\n\\n/**\\n* Handler that will be invoked when this action is resuming after an external redirect. If your\\n* onExecutePostLogin function does not perform a redirect, this function can be safely ignored.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\n// exports.onContinuePostLogin = async (event, api) => {\\n// };\\n\",\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"BUILT\",\n" + - " \"number\": 19,\n" + - " \"build_time\": \"2021-08-17T20:34:25.421459622Z\",\n" + - " \"created_at\": \"2021-08-17T20:34:25.304585709Z\",\n" + - " \"updated_at\": \"2021-08-17T20:34:25.422251817Z\"\n" + - " },\n" + - " \"deployed_version\": {\n" + - " \"code\": \"/**\\n* Handler that will be called during the execution of a PostLogin flow.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\nexports.onExecutePostLogin = async (event, api) => {\\n // var a = null;\\n // a.boom(;)\\n // throw new Error(\\\"oops\\\");\\n console.log(\\\"testing updated!\\\");\\n};\\n\\n\\n/**\\n* Handler that will be invoked when this action is resuming after an external redirect. If your\\n* onExecutePostLogin function does not perform a redirect, this function can be safely ignored.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\n// exports.onContinuePostLogin = async (event, api) => {\\n// };\\n\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"slack-notify\",\n" + - " \"version\": \"0.1.7\"\n" + - " }\n" + - " ],\n" + - " \"id\": \"1bfc9d7e-49db-4e3f-b026-3c1a77dc9a99\",\n" + - " \"deployed\": true,\n" + - " \"number\": 19,\n" + - " \"built_at\": \"2021-08-17T20:34:25.421459622Z\",\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"secret-key-1\",\n" + - " \"updated_at\": \"2021-08-12T17:09:42.071504554Z\"\n" + - " }\n" + - " ],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-17T20:34:25.304585709Z\",\n" + - " \"updated_at\": \"2021-08-17T20:34:25.422251817Z\",\n" + - " \"runtime\": \"node16\"\n" + - " },\n" + - " \"all_changes_deployed\": false\n" + - " },\n" + - " \"created_at\": \"2021-08-16T20:21:06.548275270Z\",\n" + - " \"updated_at\": \"2021-08-16T20:21:06.548275270Z\",\n" + - " \"display_name\": \"display name\"\n" + - " }\n" + - " ],\n" + - " \"total\": 1,\n" + - " \"per_page\": 20\n" + - "}\n"; - - BindingsPage page = fromJSON(json, BindingsPage.class); - assertThat(page, is(notNullValue())); - assertThat(page.getTotal(), is(1)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - - Binding binding = page.getItems().get(0); - assertThat(binding, is(notNullValue())); - assertThat(binding.getId(), is("binding-id")); - assertThat(binding.getTriggerId(), is("post-login")); - assertThat(binding.getDisplayName(), is("display name")); - assertThat(binding.getCreatedAt(), is(parseJSONDate("2021-08-16T20:21:06.548275270Z"))); - assertThat(binding.getUpdatedAt(), is(parseJSONDate("2021-08-16T20:21:06.548275270Z"))); - assertThat(binding.getAction(), is(notNullValue())); - } - - @Test - public void shouldCreatePageFromList() { - BindingsPage page = new BindingsPageDeserializer().createPage(Collections.singletonList(new Binding())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - } - - @Test - public void shouldCreatePageWithAllParams() { - BindingsPage page = new BindingsPage(0, 1, 2, 3, "next", Collections.singletonList(new Binding())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(1)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(3)); - assertThat(page.getNext(), is("next")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/BindingsUpdateRequestTest.java b/src/test/java/com/auth0/json/mgmt/actions/BindingsUpdateRequestTest.java deleted file mode 100644 index cd91257d3..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/BindingsUpdateRequestTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class BindingsUpdateRequestTest extends JsonTest { - - @Test - public void shouldSerialize() throws Exception { - String json = "{\n" + - " \"bindings\": [\n" + - " {\n" + - " \"ref\": {\n" + - " \"type\": \"action_name\",\n" + - " \"value\": \"my-action\"\n" + - " },\n" + - " \"display_name\": \"First Action\"\n" + - " },\n" + - " {\n" + - " \"ref\": {\n" + - " \"type\": \"action_id\",\n" + - " \"value\": \"action-id\"\n" + - " },\n" + - " \"display_name\": \"Second Action\"\n" + - " }\n" + - " ]\n" + - "}"; - - BindingsUpdateRequest body = fromJSON(json, BindingsUpdateRequest.class); - assertThat(body, is(notNullValue())); - assertThat(body.getBindingUpdates(), hasSize(2)); - - BindingUpdate binding1 = body.getBindingUpdates().get(0); - assertThat(binding1, is(notNullValue())); - assertThat(binding1.getDisplayName(), is("First Action")); - BindingActionReference bindingReference1 = binding1.getBindingActionReference(); - assertThat(bindingReference1, is(notNullValue())); - assertThat(bindingReference1.getType(), is("action_name")); - assertThat(bindingReference1.getValue(), is("my-action")); - - BindingUpdate binding2 = body.getBindingUpdates().get(1); - assertThat(binding2, is(notNullValue())); - assertThat(binding2.getDisplayName(), is("Second Action")); - BindingActionReference bindingReference2 = binding2.getBindingActionReference(); - assertThat(bindingReference2, is(notNullValue())); - assertThat(bindingReference2.getType(), is("action_id")); - assertThat(bindingReference2.getValue(), is("action-id")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/ExecutionTest.java b/src/test/java/com/auth0/json/mgmt/actions/ExecutionTest.java deleted file mode 100644 index 7cd8ce291..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/ExecutionTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ExecutionTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"id\": \"execution-id\",\n" + - " \"trigger_id\": \"post-login\",\n" + - " \"status\": \"partial\",\n" + - " \"results\": [\n" + - " {\n" + - " \"binding_id\": \"18490d5b-7d34-42c5-a21d-37cb77c666a5\",\n" + - " \"version_id\": \"fbc0chac-2863-4c47-8445-11c2881fd1e9\",\n" + - " \"action_name\": \"my action\",\n" + - " \"response\": {\n" + - " \"error\": {\n" + - " \"message\": \"oops\",\n" + - " \"name\": \"Error\"\n" + - " },\n" + - " \"stats\": {\n" + - " \"total_request_duration_ms\": 383,\n" + - " \"total_runtime_execution_duration_ms\": 377,\n" + - " \"runtime_processing_duration_ms\": 6,\n" + - " \"action_duration_ms\": 40,\n" + - " \"runtime_external_call_duration_ms\": 331,\n" + - " \"boot_duration_ms\": 337,\n" + - " \"network_duration_ms\": 6\n" + - " }\n" + - " },\n" + - " \"error\": {\n" + - " \"id\": \"invalid_argument\",\n" + - " \"msg\": \"Invalid Argument\"\n" + - " },\n" + - " \"started_at\": \"2021-08-16T19:14:04.218396333Z\",\n" + - " \"ended_at\": \"2021-08-16T19:14:04.602232335Z\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-16T19:14:04.218386241Z\",\n" + - " \"updated_at\": \"2021-08-16T19:14:04.218386241Z\"\n" + - "}\n"; - - Execution execution = fromJSON(json, Execution.class); - assertThat(execution, is(notNullValue())); - - assertThat(execution.getCreatedAt(), is(parseJSONDate("2021-08-16T19:14:04.218386241Z"))); - assertThat(execution.getUpdatedAt(), is(parseJSONDate("2021-08-16T19:14:04.218386241Z"))); - assertThat(execution.getId(), is("execution-id")); - assertThat(execution.getStatus(), is("partial")); - assertThat(execution.getTriggerId(), is("post-login")); - - List results = execution.getResults(); - assertThat(results, is(notNullValue())); - assertThat(results, hasSize(1)); - assertThat(results.get(0).getActionName(), is("my action")); - assertThat(results.get(0).getStartedAt(), is(parseJSONDate("2021-08-16T19:14:04.218396333Z"))); - assertThat(results.get(0).getEndedAt(), is(parseJSONDate("2021-08-16T19:14:04.602232335Z"))); - - Error error = results.get(0).getError(); - assertThat(error, is(notNullValue())); - assertThat(error.getId(), is("invalid_argument")); - assertThat(error.getMessage(), is("Invalid Argument")); - assertThat(error.getUrl(), is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/TriggersTest.java b/src/test/java/com/auth0/json/mgmt/actions/TriggersTest.java deleted file mode 100644 index ff8c6a318..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/TriggersTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TriggersTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v1\",\n" + - " \"status\": \"DEPRECATED\",\n" + - " \"runtimes\": [\n" + - " \"node12\"\n" + - " ],\n" + - " \"default_runtime\": \"node12\"\n" + - " },\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\",\n" + - " \"status\": \"CURRENT\",\n" + - " \"runtimes\": [\n" + - " \"node12\",\n" + - " \"node16\"\n" + - " ],\n" + - " \"default_runtime\": \"node16\"\n" + - " }\n" + - " ]\n" + - "}\n"; - - Triggers triggers = fromJSON(json, Triggers.class); - assertThat(triggers, is(notNullValue())); - - assertThat(triggers.getTriggers(), hasSize(2)); - Trigger trigger = triggers.getTriggers().get(0); - assertThat(trigger, is(notNullValue())); - assertThat(trigger.getId(), is("post-login")); - assertThat(trigger.getVersion(), is("v1")); - assertThat(trigger.getStatus(), is("DEPRECATED")); - assertThat(trigger.getDefaultRuntime(), is("node12")); - assertThat(trigger.getRuntimes(), hasSize(1)); - assertThat(trigger.getRuntimes().get(0), is("node12")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/VersionTest.java b/src/test/java/com/auth0/json/mgmt/actions/VersionTest.java deleted file mode 100644 index dd8d70d13..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/VersionTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class VersionTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"slack-notify\",\n" + - " \"version\": \"0.1.7\"\n" + - " }\n" + - " ],\n" + - " \"id\": \"version-id\",\n" + - " \"deployed\": false,\n" + - " \"number\": 19,\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"secret-key-1\",\n" + - " \"updated_at\": \"2021-08-12T17:09:42.071504554Z\"\n" + - " }\n" + - " ],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-17T20:34:25.304585709Z\",\n" + - " \"updated_at\": \"2021-08-17T20:34:25.304585709Z\",\n" + - " \"runtime\": \"node16\",\n" + - " \"action\": {\n" + - " \"id\": \"action-id\",\n" + - " \"name\": \"action name\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-11T15:44:05.330221459Z\",\n" + - " \"updated_at\": \"2021-08-16T20:24:57.101751726Z\",\n" + - " \"current_version\": {\n" + - " \"id\": \"current-version-id\",\n" + - " \"code\": \"some code\",\n" + - " \"runtime\": \"node16\",\n" + - " \"status\": \"BUILT\",\n" + - " \"number\": 15,\n" + - " \"build_time\": \"2021-08-16T20:24:10.450936369Z\",\n" + - " \"created_at\": \"2021-08-16T20:24:10.269996405Z\",\n" + - " \"updated_at\": \"2021-08-16T20:24:10.452885076Z\"\n" + - " },\n" + - " \"deployed_version\": {\n" + - " \"code\": \"some code\",\n" + - " \"dependencies\": [\n" + - " {\n" + - " \"name\": \"slack-notify\",\n" + - " \"version\": \"0.1.7\"\n" + - " }\n" + - " ],\n" + - " \"id\": \"deployed-version-id\",\n" + - " \"deployed\": true,\n" + - " \"number\": 15,\n" + - " \"built_at\": \"2021-08-16T20:24:10.450936369Z\",\n" + - " \"secrets\": [\n" + - " {\n" + - " \"name\": \"secret-key-1\",\n" + - " \"updated_at\": \"2021-08-12T17:09:42.071504554Z\"\n" + - " }\n" + - " ],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-16T20:24:10.269996405Z\",\n" + - " \"updated_at\": \"2021-08-16T20:24:10.452885076Z\",\n" + - " \"runtime\": \"node16\"\n" + - " },\n" + - " \"all_changes_deployed\": false\n" + - " }\n" + - "}\n"; - - Version version = fromJSON(json, Version.class); - assertThat(version, is(notNullValue())); - - assertThat(version.getCode(), is("some code")); - assertThat(version.getDependencies(), is(notNullValue())); - assertThat(version.getDependencies().size(), is(1)); - assertThat(version.getDependencies().get(0).getName(), is("slack-notify")); - assertThat(version.getDependencies().get(0).getVersion(), is("0.1.7")); - assertThat(version.getId(), is("version-id")); - assertThat(version.isDeployed(), is(false)); - assertThat(version.getNumber(), is(19)); - assertThat(version.getSecrets(), is(notNullValue())); - assertThat(version.getSecrets().size(), is(1)); - assertThat(version.getSecrets().get(0).getName(), is("secret-key-1")); - assertThat(version.getSecrets().get(0).getUpdatedAt(), is(parseJSONDate("2021-08-12T17:09:42.071504554Z"))); - assertThat(version.getStatus(), is("built")); - assertThat(version.getCreatedAt(), is(parseJSONDate("2021-08-17T20:34:25.304585709Z"))); - assertThat(version.getUpdatedAt(), is(parseJSONDate("2021-08-17T20:34:25.304585709Z"))); - assertThat(version.getRuntime(), is("node16")); - - Action action = version.getAction(); - assertThat(action, is(notNullValue())); - assertThat(action.getId(), is("action-id")); - assertThat(action.getName(), is("action name")); - assertThat(action.getSupportedTriggers(), is(notNullValue())); - assertThat(action.getSupportedTriggers().size(), is(1)); - assertThat(action.getSupportedTriggers().get(0).getId(), is("post-login")); - assertThat(action.getSupportedTriggers().get(0).getVersion(), is("v2")); - assertThat(action.getCreatedAt(), is(parseJSONDate("2021-08-11T15:44:05.330221459Z"))); - assertThat(action.getUpdatedAt(), is(parseJSONDate("2021-08-16T20:24:57.101751726Z"))); - - Version deployedVersion = action.getDeployedVersion(); - assertThat(deployedVersion, is(notNullValue())); - assertThat(deployedVersion.getCode(), is("some code")); - assertThat(deployedVersion.getDependencies(), is(notNullValue())); - assertThat(deployedVersion.getDependencies().size(), is(1)); - assertThat(deployedVersion.getDependencies().get(0).getName(), is("slack-notify")); - assertThat(deployedVersion.getDependencies().get(0).getVersion(), is("0.1.7")); - assertThat(deployedVersion.getId(), is("deployed-version-id")); - assertThat(deployedVersion.isDeployed(), is(true)); - assertThat(deployedVersion.getNumber(), is(15)); - assertThat(deployedVersion.getBuiltAt(), is(parseJSONDate("2021-08-16T20:24:10.450936369Z"))); - assertThat(deployedVersion.getSecrets(), is(notNullValue())); - assertThat(deployedVersion.getSecrets().size(), is(1)); - assertThat(deployedVersion.getSecrets().get(0).getName(), is("secret-key-1")); - assertThat(deployedVersion.getSecrets().get(0).getUpdatedAt(), is(parseJSONDate("2021-08-12T17:09:42.071504554Z"))); - assertThat(deployedVersion.getStatus(), is("built")); - assertThat(deployedVersion.getCreatedAt(), is(parseJSONDate("2021-08-16T20:24:10.269996405Z"))); - assertThat(deployedVersion.getUpdatedAt(), is(parseJSONDate("2021-08-16T20:24:10.452885076Z"))); - assertThat(deployedVersion.getRuntime(), is("node16")); - assertThat(action.getAllChangesDeployed(), is(false)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/actions/VersionsPageTest.java b/src/test/java/com/auth0/json/mgmt/actions/VersionsPageTest.java deleted file mode 100644 index 6b8809091..000000000 --- a/src/test/java/com/auth0/json/mgmt/actions/VersionsPageTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.auth0.json.mgmt.actions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class VersionsPageTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"versions\": [\n" + - " {\n" + - " \"code\": \"/**\\n* Handler that will be called during the execution of a PostLogin flow.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\nexports.onExecutePostLogin = async (event, api) => {\\n};\\n\\n\\n/**\\n* Handler that will be invoked when this action is resuming after an external redirect. If your\\n* onExecutePostLogin function does not perform a redirect, this function can be safely ignored.\\n*\\n* @param {Event} event - Details about the user and the context in which they are logging in.\\n* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.\\n*/\\n// exports.onContinuePostLogin = async (event, api) => {\\n// };\\n\",\n" + - " \"dependencies\": [],\n" + - " \"id\": \"a1fcaa98-1199-4403-8a45-9f3b6bf32a6e\",\n" + - " \"deployed\": true,\n" + - " \"number\": 1,\n" + - " \"built_at\": \"2021-08-16T19:39:37.789535383Z\",\n" + - " \"secrets\": [],\n" + - " \"status\": \"built\",\n" + - " \"created_at\": \"2021-08-16T19:39:37.655559720Z\",\n" + - " \"updated_at\": \"2021-08-16T19:39:37.791508099Z\",\n" + - " \"runtime\": \"node16\",\n" + - " \"action\": {\n" + - " \"id\": \"a80ae4c9-43c0-4301-9eb7-e9da7852022b\",\n" + - " \"name\": \"new-action\",\n" + - " \"supported_triggers\": [\n" + - " {\n" + - " \"id\": \"post-login\",\n" + - " \"version\": \"v2\"\n" + - " }\n" + - " ],\n" + - " \"created_at\": \"2021-08-16T19:38:33.018980733Z\",\n" + - " \"updated_at\": \"2021-08-16T19:38:33.018980733Z\",\n" + - " \"all_changes_deployed\": false\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"total\": 1,\n" + - " \"per_page\": 20\n" + - "}\n"; - - VersionsPage page = fromJSON(json, VersionsPage.class); - assertThat(page, is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - assertThat(page.getItems().get(0), is(instanceOf(Version.class))); - assertThat(page.getTotal(), is(1)); - } - - @Test - public void shouldCreatePageFromList() { - VersionsPage page = new VersionsPageDeserializer().createPage(Collections.singletonList(new Version())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - } - - @Test - public void shouldCreatePageWithAllParams() { - VersionsPage page = new VersionsPage(0, 1, 2, 3, "next", Collections.singletonList(new Version())); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), hasSize(1)); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(1)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(3)); - assertThat(page.getNext(), is("next")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordTest.java b/src/test/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordTest.java deleted file mode 100644 index 139bc02b2..000000000 --- a/src/test/java/com/auth0/json/mgmt/attackprotection/BreachedPasswordTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class BreachedPasswordTest extends JsonTest { - - private String json = "{\n" + - " \"enabled\": true,\n" + - " \"shields\": [\n" + - " \"block\",\n" + - " \"admin_notification\"\n" + - " ],\n" + - " \"admin_notification_frequency\": [\n" + - " \"immediately\",\n" + - " \"weekly\"\n" + - " ],\n" + - " \"method\": \"standard\"\n" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - BreachedPassword breachedPassword = new BreachedPassword(); - breachedPassword.setAdminNotificationFrequency(Arrays.asList("immediately", "daily")); - breachedPassword.setShields(Arrays.asList("admin_notification", "block")); - breachedPassword.setMethod("standard"); - breachedPassword.setEnabled(true); - - String json = toJSON(breachedPassword); - - assertThat(json, JsonMatcher.hasEntry("enabled", true)); - assertThat(json, JsonMatcher.hasEntry("method", "standard")); - assertThat(json, JsonMatcher.hasEntry("admin_notification_frequency", Arrays.asList("immediately", "daily"))); - assertThat(json, JsonMatcher.hasEntry("shields", Arrays.asList("admin_notification", "block"))); - } - - @Test - public void shouldDeserialize() throws Exception { - BreachedPassword breachedPassword = fromJSON(json, BreachedPassword.class); - assertThat(breachedPassword, notNullValue()); - assertThat(breachedPassword.getEnabled(), is(true)); - assertThat(breachedPassword.getMethod(), is("standard")); - assertThat(breachedPassword.getShields(), is(notNullValue())); - assertThat(breachedPassword.getShields().size(), is(2)); - assertThat(breachedPassword.getShields(), contains("block", "admin_notification")); - assertThat(breachedPassword.getAdminNotificationFrequency(), is(notNullValue())); - assertThat(breachedPassword.getAdminNotificationFrequency().size(), is(2)); - assertThat(breachedPassword.getAdminNotificationFrequency(), contains("immediately", "weekly")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/attackprotection/BruteForceConfigurationTest.java b/src/test/java/com/auth0/json/mgmt/attackprotection/BruteForceConfigurationTest.java deleted file mode 100644 index 2a2ac0ffe..000000000 --- a/src/test/java/com/auth0/json/mgmt/attackprotection/BruteForceConfigurationTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class BruteForceConfigurationTest extends JsonTest { - - String json = "{\n" + - " \"enabled\": false,\n" + - " \"shields\": [\n" + - " \"block\",\n" + - " \"user_notification\"\n" + - " ],\n" + - " \"allowlist\": [\n" + - " \"143.204.0.105\",\n" + - " \"2600:9000:208f:ca00:d:f5f5:b40:93a1\"\n" + - " ],\n" + - " \"mode\": \"count_per_identifier_and_ip\",\n" + - " \"max_attempts\": 10\n" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - BruteForceConfiguration bruteForceConfiguration = new BruteForceConfiguration(); - bruteForceConfiguration.setEnabled(true); - bruteForceConfiguration.setMaxAttempts(10); - bruteForceConfiguration.setMode("count_per_identifier_and_ip"); - bruteForceConfiguration.setAllowList(Arrays.asList("123", "456")); - bruteForceConfiguration.setShields(Arrays.asList("user_notification", "block")); - - String json = toJSON(bruteForceConfiguration); - assertThat(json, JsonMatcher.hasEntry("enabled", true)); - assertThat(json, JsonMatcher.hasEntry("max_attempts", 10)); - assertThat(json, JsonMatcher.hasEntry("mode", "count_per_identifier_and_ip")); - assertThat(json, JsonMatcher.hasEntry("allowlist", Arrays.asList("123", "456"))); - assertThat(json, JsonMatcher.hasEntry("shields", Arrays.asList("user_notification", "block"))); - } - - @Test - public void shouldDeserialize() throws Exception { - BruteForceConfiguration bruteForceConfiguration = fromJSON(json, BruteForceConfiguration.class); - - assertThat(bruteForceConfiguration, notNullValue()); - assertThat(bruteForceConfiguration.getEnabled(), is(false)); - assertThat(bruteForceConfiguration.getMode(), is("count_per_identifier_and_ip")); - assertThat(bruteForceConfiguration.getMaxAttempts(), is(10)); - assertThat(bruteForceConfiguration.getShields(), is(notNullValue())); - assertThat(bruteForceConfiguration.getShields().size(), is(2)); - assertThat(bruteForceConfiguration.getShields(), contains("block", "user_notification")); - assertThat(bruteForceConfiguration.getAllowList(), is(notNullValue())); - assertThat(bruteForceConfiguration.getAllowList().size(), is(2)); - assertThat(bruteForceConfiguration.getAllowList(), contains("143.204.0.105", "2600:9000:208f:ca00:d:f5f5:b40:93a1")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfigurationTest.java b/src/test/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfigurationTest.java deleted file mode 100644 index b5d4d94cc..000000000 --- a/src/test/java/com/auth0/json/mgmt/attackprotection/SuspiciousIPThrottlingConfigurationTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.auth0.json.mgmt.attackprotection; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class SuspiciousIPThrottlingConfigurationTest extends JsonTest { - - private final String json = "{\n" + - " \"enabled\": false,\n" + - " \"shields\": [\n" + - " \"block\",\n" + - " \"admin_notification\"\n" + - " ],\n" + - " \"allowlist\": [\n" + - " \"143.204.0.105\",\n" + - " \"2600:9000:208f:ca00:d:f5f5:b40:93a1\"\n" + - " ],\n" + - " \"stage\": {\n" + - " \"pre-login\": {\n" + - " \"max_attempts\": 100,\n" + - " \"rate\": 864000\n" + - " },\n" + - " \"pre-user-registration\": {\n" + - " \"max_attempts\": 50,\n" + - " \"rate\": 1728000\n" + - " }\n" + - " }\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - SuspiciousIPThrottlingConfiguration config = fromJSON(json, SuspiciousIPThrottlingConfiguration.class); - - assertThat(config, is(notNullValue())); - assertThat(config.getEnabled(), is(false)); - assertThat(config.getShields(), is(Arrays.asList("block", "admin_notification"))); - assertThat(config.getAllowList(), is(Arrays.asList("143.204.0.105", "2600:9000:208f:ca00:d:f5f5:b40:93a1"))); - assertThat(config.getStage(), is(notNullValue())); - assertThat(config.getStage().getPreLoginStage(), is(notNullValue())); - assertThat(config.getStage().getPreLoginStage().getMaxAttempts(), is(100)); - assertThat(config.getStage().getPreLoginStage().getRate(), is(864000)); - assertThat(config.getStage().getPreUserRegistrationStage(), is(notNullValue())); - assertThat(config.getStage().getPreUserRegistrationStage().getMaxAttempts(), is(50)); - assertThat(config.getStage().getPreUserRegistrationStage().getRate(), is(1728000)); - - } - - @Test - public void shouldSerialize() throws Exception { - List allowList = Arrays.asList("123", "456"); - List shields = Arrays.asList("block", "user_notification"); - - StageEntry preLogin = new StageEntry(); - preLogin.setMaxAttempts(100); - preLogin.setRate(864000); - - StageEntry preRegistration = new StageEntry(); - preLogin.setMaxAttempts(50); - preLogin.setRate(1728000); - - Stage stage = new Stage(); - stage.setPreLoginStage(preLogin); - stage.setPreUserRegistrationStage(preRegistration); - - SuspiciousIPThrottlingConfiguration config = new SuspiciousIPThrottlingConfiguration(); - config.setEnabled(true); - config.setAllowList(allowList); - config.setShields(shields); - config.setStage(stage); - - String json = toJSON(config); - - assertThat(json, JsonMatcher.hasEntry("enabled", true)); - assertThat(json, JsonMatcher.hasEntry("shields", shields)); - assertThat(json, JsonMatcher.hasEntry("allowlist", allowList)); - assertThat(json, JsonMatcher.hasEntry("stage", is(notNullValue()))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/AddonTest.java b/src/test/java/com/auth0/json/mgmt/client/AddonTest.java deleted file mode 100644 index f4cd01f4e..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/AddonTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.hamcrest.collection.IsMapContaining; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class AddonTest extends JsonTest { - - private static final String json = "{\"a-boolean\":true,\"a-string\":\"string\"}"; - - @Test - public void shouldSerialize() throws Exception { - Addon addon = new Addon(); - addon.setProperty("a-boolean", true); - addon.setProperty("a-string", "string"); - - String serialized = toJSON(addon); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("a-boolean", true)); - assertThat(serialized, JsonMatcher.hasEntry("a-string", "string")); - } - - @Test - public void shouldDeserialize() throws Exception { - Addon addon = fromJSON(json, Addon.class); - - assertThat(addon, is(notNullValue())); - - assertThat(addon.getProperties(), IsMapContaining.hasEntry("a-boolean", true)); - assertThat(addon.getProperties(), IsMapContaining.hasEntry("a-string", "string")); - assertThat(addon.getProperty("a-boolean"), is(true)); - assertThat(addon.getProperty("a-string"), is("string")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/AddonsTest.java b/src/test/java/com/auth0/json/mgmt/client/AddonsTest.java deleted file mode 100644 index 09745e9c8..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/AddonsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class AddonsTest extends JsonTest { - - private static final String json = "{\"rms\":{\"key\":\"value\"},\"mscrm\":{\"key\":\"value\"},\"slack\":{\"key\":\"value\"},\"layer\":{\"key\":\"value\"},\"other\":{\"key\":\"value\"}}"; - - @Test - public void shouldSerialize() throws Exception { - Addon addon = new Addon(); - addon.setProperty("key", "value"); - Addons addons = new Addons(addon, addon, addon, addon); - addons.setAdditionalAddon("other", addon); - - String serialized = toJSON(addons); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("rms", Collections.singletonMap("key", "value"))); - assertThat(serialized, JsonMatcher.hasEntry("mscrm", Collections.singletonMap("key", "value"))); - assertThat(serialized, JsonMatcher.hasEntry("slack", Collections.singletonMap("key", "value"))); - assertThat(serialized, JsonMatcher.hasEntry("layer", Collections.singletonMap("key", "value"))); - assertThat(serialized, JsonMatcher.hasEntry("other", Collections.singletonMap("key", "value"))); - } - - @Test - public void shouldDeserialize() throws Exception { - Addons addons = fromJSON(json, Addons.class); - - assertThat(addons, is(notNullValue())); - - assertThat(addons.getRMS(), is(notNullValue())); - assertThat(addons.getMSCRM(), is(notNullValue())); - assertThat(addons.getSlack(), is(notNullValue())); - assertThat(addons.getLayer(), is(notNullValue())); - assertThat(addons.getAdditionalAddons(), is(notNullValue())); - assertThat(addons.getAdditionalAddons().size(), is(1)); - assertThat(addons.getAdditionalAddons().get("other"), is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/AndroidTest.java b/src/test/java/com/auth0/json/mgmt/client/AndroidTest.java deleted file mode 100644 index dc8a2f300..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/AndroidTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class AndroidTest extends JsonTest { - - private static final String json = "{\"app_package_name\":\"pkg\",\"sha256_cert_fingerprints\":[\"cert1\",\"cert2\"]}"; - - @Test - public void shouldSerialize() throws Exception { - Android android = new Android("pkg", Arrays.asList("cert1", "cert2")); - - String serialized = toJSON(android); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("app_package_name", "pkg")); - assertThat(serialized, JsonMatcher.hasEntry("sha256_cert_fingerprints", Arrays.asList("cert1", "cert2"))); - } - - - @Test - public void shouldDeserialize() throws Exception { - Android android = fromJSON(json, Android.class); - - assertThat(android, is(notNullValue())); - - assertThat(android.getAppPackageName(), is("pkg")); - assertThat(android.getSHA256CertFingerprints(), contains("cert1", "cert2")); - assertThat(android.getSHA256CertFingerprints().size(), is(2)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/ClientTest.java b/src/test/java/com/auth0/json/mgmt/client/ClientTest.java deleted file mode 100644 index c189d11f5..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/ClientTest.java +++ /dev/null @@ -1,398 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import org.hamcrest.collection.IsMapContaining; -import org.junit.jupiter.api.Test; - -import java.time.Instant; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ClientTest extends JsonTest { - - private static final String readOnlyJson = "{\"client_id\":\"clientId\",\"is_heroku_app\":true,\"signing_keys\":[{\"cert\":\"ce\",\"pkcs7\":\"pk\",\"subject\":\"su\"}]}"; - private static final String json = "{\n" + - " \"name\": \"name\",\n" + - " \"description\": \"description\",\n" + - " \"client_secret\": \"secret\",\n" + - " \"app_type\": \"type\",\n" + - " \"logo_uri\": \"uri\",\n" + - " \"oidc_conformant\": true,\n" + - " \"is_first_party\": true,\n" + - " \"is_token_endpoint_ip_header_trusted\": true,\n" + - " \"initiate_login_uri\": \"https://myhome.com/login\",\n" + - " \"callbacks\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"allowed_origins\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"web_origins\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"grant_types\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"client_aliases\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"allowed_clients\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"allowed_logout_urls\": [\n" + - " \"value\"\n" + - " ],\n" + - " \"organization_usage\": \"allow\",\n" + - " \"organization_require_behavior\": \"no_prompt\",\n" + - " \"jwt_configuration\": {\n" + - " \"lifetime_in_seconds\": 100,\n" + - " \"scopes\": \"openid\",\n" + - " \"alg\": \"alg\"\n" + - " },\n" + - " \"encryption_key\": {\n" + - " \"pub\": \"pub\",\n" + - " \"cert\": \"cert\"\n" + - " },\n" + - " \"sso\": true,\n" + - " \"sso_disabled\": true,\n" + - " \"custom_login_page_on\": true,\n" + - " \"custom_login_page\": \"custom\",\n" + - " \"custom_login_page_preview\": \"preview\",\n" + - " \"form_template\": \"template\",\n" + - " \"addons\": {\n" + - " \"rms\": {},\n" + - " \"mscrm\": {},\n" + - " \"slack\": {},\n" + - " \"layer\": {}\n" + - " },\n" + - " \"token_endpoint_auth_method\": \"method\",\n" + - " \"client_metadata\": {\n" + - " \"key\": \"value\"\n" + - " },\n" + - " \"mobile\": {\n" + - " \"android\": {\n" + - " \"app_package_name\": \"pkg\",\n" + - " \"sha256_cert_fingerprints\": [\n" + - " \"256\"\n" + - " ]\n" + - " },\n" + - " \"ios\": {\n" + - " \"team_id\": \"team\",\n" + - " \"app_bundle_identifier\": \"id\"\n" + - " }\n" + - " },\n" + - " \"refresh_token\": {\n" + - " \"rotation_type\": \"non-rotating\"\n" + - " },\n" + - " \"client_authentication_methods\": {\n" + - " \"private_key_jwt\": {\n" + - " \"credentials\": [\n" + - " {\n" + - " \"id\": \"cred_abc\"\n" + - " },\n" + - " {\n" + - " \"id\": \"cred_123\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"self_signed_tls_client_auth\": {\n" + - " \"credentials\": [\n" + - " {\n" + - " \"id\": \"cred_id\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"tls_client_auth\": {\n" + - " \"credentials\": [\n" + - " {\n" + - " \"id\": \"cred_id\",\n" + - " \"credential_type\": \"cert_subject_dn\",\n" + - " \"name\": \"My cA mtls credential\",\n" + - " \"subject_dn\": \"subject dn\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " },\n" + - " \"require_pushed_authorization_requests\": true,\n" + - " \"oidc_backchannel_logout\": {\n" + - " \"backchannel_logout_urls\": [\"http://acme.eu.auth0.com/events\"]\n" + - " },\n" + - " \"signed_request_object\": {\n" + - " \"credentials\": [\n" + - " {\n" + - " \"id\": \"cred_id\",\n" + - " \"credential_type\": \"public_key\",\n" + - " \"kid\": \"cred_kid\",\n" + - " \"alg\": \"RS256\",\n" + - " \"name\": \"My JAR credential\",\n" + - " \"created_at\": \"2024-03-14T11:34:28.893Z\",\n" + - " \"updated_at\": \"2024-03-14T11:34:28.893Z\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"require_proof_of_possession\": true,\n" + - " \"compliance_level\": \"fapi1_adv_pkj_par\",\n" + - " \"default_organization\": {\n" + - " \"flows\": [\"client_credentials\"],\n" + - " \"organizations_id\": \"org_id\"\n" + - " },\n" + - " \"token_quota\": {\n" + - " \"client_credentials\": {\n" + - " \"per_hour\": 10,\n" + - " \"per_day\": 100,\n" + - " \"enforce\": true\n" + - " }\n" + - " }" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - Client client = new Client("ignored"); - - client.setName("name"); - client.setDescription("description"); - client.setClientSecret("secret"); - client.setAppType("type"); - client.setLogoUri("uri"); - client.setOIDCConformant(true); - client.setIsFirstParty(true); - client.setIsTokenEndpointIpHeaderTrusted(true); - List stringList = Collections.singletonList("value"); - client.setCallbacks(stringList); - client.setAllowedOrigins(stringList); - client.setWebOrigins(stringList); - client.setGrantTypes(stringList); - client.setClientAliases(stringList); - client.setAllowedClients(stringList); - client.setAllowedLogoutUrls(stringList); - JWTConfiguration jwtConfig = new JWTConfiguration(100, "openid", "alg"); - client.setJWTConfiguration(jwtConfig); - EncryptionKey key = new EncryptionKey("pub", "cert"); - client.setEncryptionKey(key); - client.setUseAuth0SSO(true); - client.setSSODisabled(true); - client.setUseCustomLoginPage(true); - client.setCustomLoginPage("custom"); - client.setInitiateLoginUri("https://appzero.com/login"); - client.setCustomLoginPagePreview("preview"); - client.setFormTemplate("template"); - Addons addons = new Addons(new Addon(), new Addon(), new Addon(), new Addon()); - client.setAddons(addons); - client.setTokenEndpointAuthMethod("method"); - Map metadata = Collections.singletonMap("key", "value"); - client.setClientMetadata(metadata); - Mobile mobile = new Mobile(new Android("pkg", Collections.singletonList("256")), new IOS("team", "id")); - client.setMobile(mobile); - RefreshToken refreshToken = new RefreshToken(); - client.setRefreshToken(refreshToken); - client.setOrganizationUsage("require"); - client.setOrganizationRequireBehavior("pre_login_prompt"); - client.setRequireProofOfPossession(true); - - Credential credential = new Credential("public_key", "PEM"); - PrivateKeyJwt privateKeyJwt = new PrivateKeyJwt(Collections.singletonList(credential)); - - Credential selfSignedCredential = new Credential(); - selfSignedCredential.setName("mtls credential"); - selfSignedCredential.setCredentialType("x509_cert"); - selfSignedCredential.setPem("pem"); - SelfSignedTLSClientAuth selfSignedTLSClientAuth = new SelfSignedTLSClientAuth(Collections.singletonList(selfSignedCredential)); - - Credential tlsCredential = new Credential(); - tlsCredential.setName("My cA mtls credential"); - tlsCredential.setSubjectDn("subject dn"); - tlsCredential.setCredentialType("cert_subject_dn"); - TLSClientAuth tlsClientAuth = new TLSClientAuth(Collections.singletonList(tlsCredential)); - - ClientAuthenticationMethods cam = new ClientAuthenticationMethods(privateKeyJwt, selfSignedTLSClientAuth, tlsClientAuth); - - client.setClientAuthenticationMethods(cam); - client.setRequiresPushedAuthorizationRequests(true); - client.setOidcBackchannelLogout(new OIDCBackchannelLogout(Collections.singletonList("http://acme.eu.auth0.com/events"))); - - // HRI configuration - Credential signedRequestCredential = new Credential(); - signedRequestCredential.setName("cred name"); - signedRequestCredential.setCredentialType("public_key"); - signedRequestCredential.setPem("pem"); - SignedRequest signedRequest = new SignedRequest(); - signedRequest.setRequired(true); - signedRequest.setCredentials(Collections.singletonList(signedRequestCredential)); - client.setSignedRequest(signedRequest); - client.setComplianceLevel("fapi1_adv_pkj_par"); - - ClientDefaultOrganization defaultOrganization = new ClientDefaultOrganization(); - defaultOrganization.setFlows(Collections.singletonList("client_credentials")); - defaultOrganization.setOrganizationId("org_id"); - client.setDefaultOrganization(defaultOrganization); - - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - - TokenQuota tokenQuota = new TokenQuota(clientCredentials); - client.setTokenQuota(tokenQuota); - - String serialized = toJSON(client); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, JsonMatcher.hasEntry("name", "name")); - assertThat(serialized, JsonMatcher.hasEntry("description", "description")); - assertThat(serialized, JsonMatcher.hasEntry("client_secret", "secret")); - assertThat(serialized, JsonMatcher.hasEntry("app_type", "type")); - assertThat(serialized, JsonMatcher.hasEntry("logo_uri", "uri")); - assertThat(serialized, JsonMatcher.hasEntry("oidc_conformant", true)); - assertThat(serialized, JsonMatcher.hasEntry("initiate_login_uri", "https://appzero.com/login")); - assertThat(serialized, JsonMatcher.hasEntry("is_first_party", true)); - assertThat(serialized, JsonMatcher.hasEntry("is_token_endpoint_ip_header_trusted", true)); - assertThat(serialized, JsonMatcher.hasEntry("callbacks", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("grant_types", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("allowed_origins", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("client_aliases", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("allowed_clients", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("allowed_logout_urls", Collections.singletonList("value"))); - assertThat(serialized, JsonMatcher.hasEntry("jwt_configuration", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("encryption_key", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("sso", true)); - assertThat(serialized, JsonMatcher.hasEntry("sso_disabled", true)); - assertThat(serialized, JsonMatcher.hasEntry("custom_login_page_on", true)); - assertThat(serialized, JsonMatcher.hasEntry("custom_login_page", "custom")); - assertThat(serialized, JsonMatcher.hasEntry("custom_login_page_preview", "preview")); - assertThat(serialized, JsonMatcher.hasEntry("form_template", "template")); - assertThat(serialized, JsonMatcher.hasEntry("addons", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("token_endpoint_auth_method", "method")); - assertThat(serialized, JsonMatcher.hasEntry("client_metadata", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("mobile", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("refresh_token", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("organization_usage", "require")); - assertThat(serialized, JsonMatcher.hasEntry("organization_require_behavior", "pre_login_prompt")); - assertThat(serialized, JsonMatcher.hasEntry("client_authentication_methods", notNullValue())); - // but: was "{"name":"name","description":"description","client_secret":"secret","app_type":"type","logo_uri":"uri","is_first_party":true,"oidc_conformant":true,"callbacks":["value"],"allowed_origins":["value"],"web_origins":["value"],"grant_types":["value"],"client_aliases":["value"],"allowed_clients":["value"],"allowed_logout_urls":["value"],"jwt_configuration":{"lifetime_in_seconds":100,"scopes":"openid","alg":"alg"},"encryption_key":{"pub":"pub","cert":"cert"},"sso":true,"sso_disabled":true,"custom_login_page_on":true,"initiate_login_uri":"https://appzero.com/login","custom_login_page":"custom","custom_login_page_preview":"preview","form_template":"template","addons":{"rms":{},"mscrm":{},"slack":{},"layer":{}},"token_endpoint_auth_method":"method","client_metadata":{"key":"value"},"mobile":{"android":{"app_package_name":"pkg","sha256_cert_fingerprints":["256"]},"ios":{"team_id":"team","app_bundle_identifier":"id"}},"refresh_token":{},"organization_usage":"require","organization_require_behavior":"pre_login_prompt","client_authentication_methods":{"private_key_jwt":{"credentials":[{"credential_type":"public_key","pem":"PEM"}]},"self_signed_tls_client_auth":{"credentials":[{"credential_type":"x509_cert","name":"mtls credential","pem":"pem"}]},"tls_client_auth":{"credentials":[{"credential_type":"cert_subject_dn","name":"My cA mtls credential","subject_dn":"subject dn"}]}},"require_pushed_authorization_requests":true,"oidc_backchannel_logout":{"backchannel_logout_urls":["http://acme.eu.auth0.com/events"]},"signed_request_object":{"required":true,"credentials":[{"credential_type":"public_key","name":"cred name","pem":"pem"}]},"compliance_level":"fapi1_adv_pkj_par"}" - assertThat(serialized, JsonMatcher.hasEntry("client_authentication_methods", containsString("{\"private_key_jwt\":{\"credentials\":[{\"credential_type\":\"public_key\",\"pem\":\"PEM\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"credential_type\":\"x509_cert\",\"name\":\"mtls credential\",\"pem\":\"pem\"}]},\"tls_client_auth\":{\"credentials\":[{\"credential_type\":\"cert_subject_dn\",\"name\":\"My cA mtls credential\",\"subject_dn\":\"subject dn\"}]}}"))); - assertThat(serialized, JsonMatcher.hasEntry("require_pushed_authorization_requests", true)); - assertThat(serialized, JsonMatcher.hasEntry("oidc_backchannel_logout", containsString("{\"backchannel_logout_urls\":[\"http://acme.eu.auth0.com/events\"]}"))); - assertThat(serialized, JsonMatcher.hasEntry("signed_request_object", containsString("{\"required\":true,\"credentials\":[{\"credential_type\":\"public_key\",\"name\":\"cred name\",\"pem\":\"pem\"}]}"))); - assertThat(serialized, JsonMatcher.hasEntry("compliance_level", "fapi1_adv_pkj_par")); - assertThat(serialized, JsonMatcher.hasEntry("require_proof_of_possession", true)); - assertThat(serialized, JsonMatcher.hasEntry("default_organization", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", notNullValue())); - assertThat(serialized, containsString("\"token_quota\":{\"client_credentials\":{\"per_day\":100,\"per_hour\":20,\"enforce\":true}}")); - } - - @Test - public void shouldDeserialize() throws Exception { - Client client = fromJSON(json, Client.class); - assertThat(client, is(notNullValue())); - - assertThat(client.getName(), is("name")); - assertThat(client.getDescription(), is("description")); - assertThat(client.getClientSecret(), is("secret")); - assertThat(client.getAppType(), is("type")); - assertThat(client.getLogoUri(), is("uri")); - - assertThat(client.isOIDCConformant(), is(true)); - assertThat(client.isFirstParty(), is(true)); - assertThat(client.getIsTokenEndpointIpHeaderTrusted(), is(true)); - - assertThat(client.getCallbacks(), contains("value")); - assertThat(client.getWebOrigins(), contains("value")); - assertThat(client.getGrantTypes(), contains("value")); - assertThat(client.getAllowedOrigins(), contains("value")); - assertThat(client.getClientAliases(), contains("value")); - assertThat(client.getAllowedClients(), contains("value")); - assertThat(client.getAllowedLogoutUrls(), contains("value")); - - assertThat(client.getJWTConfiguration(), notNullValue()); - assertThat(client.getEncryptionKey(), notNullValue()); - - assertThat(client.useAuth0SSO(), is(true)); - assertThat(client.isSSODisabled(), is(true)); - assertThat(client.useCustomLoginPage(), is(true)); - - assertThat(client.getCustomLoginPage(), is("custom")); - assertThat(client.getCustomLoginPagePreview(), is("preview")); - assertThat(client.getInitiateLoginUri(), is("https://myhome.com/login")); - assertThat(client.getFormTemplate(), is("template")); - - assertThat(client.getAddons(), is(notNullValue())); - assertThat(client.getTokenEndpointAuthMethod(), is("method")); - assertThat(client.getClientMetadata(), IsMapContaining.hasEntry("key", "value")); - assertThat(client.getMobile(), is(notNullValue())); - assertThat(client.getRefreshToken(), is(notNullValue())); - assertThat(client.getOrganizationUsage(), is("allow")); - assertThat(client.getOrganizationRequireBehavior(), is("no_prompt")); - - assertThat(client.getClientAuthenticationMethods(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getPrivateKeyJwt(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getPrivateKeyJwt().getCredentials(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getPrivateKeyJwt().getCredentials().size(), is(2)); - assertThat(client.getClientAuthenticationMethods().getPrivateKeyJwt().getCredentials().get(0).getId(), is("cred_abc")); - assertThat(client.getClientAuthenticationMethods().getPrivateKeyJwt().getCredentials().get(1).getId(), is("cred_123")); - assertThat(client.getClientAuthenticationMethods().getSelfSignedTLSClientAuth(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getSelfSignedTLSClientAuth().getCredentials(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getSelfSignedTLSClientAuth().getCredentials().size(), is(1)); - assertThat(client.getClientAuthenticationMethods().getSelfSignedTLSClientAuth().getCredentials().get(0).getId(), is("cred_id")); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials(), is(notNullValue())); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials().size(), is(1)); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials().get(0).getId(), is("cred_id")); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials().get(0).getName(), is("My cA mtls credential")); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials().get(0).getSubjectDn(), is("subject dn")); - assertThat(client.getClientAuthenticationMethods().getTlsClientAuth().getCredentials().get(0).getCredentialType(), is("cert_subject_dn")); - assertThat(client.getRequiresPushedAuthorizationRequests(), is(true)); - assertThat(client.getOidcBackchannelLogout().getBackchannelLogoutUrls().size(), is(1)); - - assertThat(client.getComplianceLevel(), is("fapi1_adv_pkj_par")); - assertThat(client.getSignedRequest(), is(notNullValue())); - assertThat(client.getSignedRequest().getCredentials(), is(notNullValue())); - assertThat(client.getSignedRequest().getCredentials().size(), is(1)); - assertThat(client.getSignedRequest().getCredentials().get(0).getId(), is("cred_id")); - assertThat(client.getSignedRequest().getCredentials().get(0).getCredentialType(), is("public_key")); - assertThat(client.getSignedRequest().getCredentials().get(0).getKid(), is("cred_kid")); - assertThat(client.getSignedRequest().getCredentials().get(0).getAlg(), is("RS256")); - assertThat(client.getSignedRequest().getCredentials().get(0).getName(), is("My JAR credential")); - assertThat(client.getSignedRequest().getCredentials().get(0).getCreatedAt(), is(Date.from(Instant.parse("2024-03-14T11:34:28.893Z")))); - assertThat(client.getSignedRequest().getCredentials().get(0).getUpdatedAt(), is(Date.from(Instant.parse("2024-03-14T11:34:28.893Z")))); - - assertThat(client.getRequireProofOfPossession(), is(true)); - - assertThat(client.getTokenQuota(), is(notNullValue())); - assertThat(client.getTokenQuota().getClientCredentials(), is(notNullValue())); - assertThat(client.getTokenQuota().getClientCredentials().getPerDay(), is(100)); - assertThat(client.getTokenQuota().getClientCredentials().getPerHour(), is(10)); - assertThat(client.getTokenQuota().getClientCredentials().isEnforce(), is(true)); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Client client = fromJSON(readOnlyJson, Client.class); - assertThat(client, is(notNullValue())); - - assertThat(client.getClientId(), is("clientId")); - assertThat(client.isHerokuApp(), is(true)); - assertThat(client.getSigningKeys(), is(notNullValue())); - } - - @Test - public void shouldCreateClientWithNameOnly() { - Client client = new Client("My App"); - assertThat(client.getName(), is("My App")); - assertThat(client.getClientId(), is(nullValue())); - } - - @Test - public void shouldCreateClientWithNameAndClientId() { - Client client = new Client("My App", "client123"); - assertThat(client.getName(), is("My App")); - assertThat(client.getClientId(), is("client123")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/CredentialTest.java b/src/test/java/com/auth0/json/mgmt/client/CredentialTest.java deleted file mode 100644 index 87f95d482..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/CredentialTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.time.Instant; -import java.util.Date; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class CredentialTest extends JsonTest { - - private final static String JSON = "{\n" + - " \"id\": \"cred_asqwXXXIIadqq2T3zAXPwv\",\n" + - " \"name\": \"new cred\",\n" + - " \"credential_type\": \"public_key\",\n" + - " \"kid\": \"eKtBStP7BN2NiaoVrNGzb0QaRl4HlzyH1Lp00JB6Xj0\",\n" + - " \"alg\": \"RS256\",\n" + - " \"thumbprint\": \"thumb\",\n" + - " \"created_at\": \"2023-04-13T16:18:01.481Z\",\n" + - " \"updated_at\": \"2023-04-13T16:18:01.481Z\",\n" + - " \"expires_at\": \"2023-04-13T16:19:00.349Z\"\n" + - "}\n"; - - @Test - public void shouldDeserialize() throws Exception { - Credential credential = fromJSON(JSON, Credential.class); - - assertThat(credential, is(notNullValue())); - assertThat(credential.getAlg(), is("RS256")); - assertThat(credential.getCredentialType(), is("public_key")); - assertThat(credential.getExpiresAt(), is(Date.from(Instant.parse("2023-04-13T16:19:00.349Z")))); - assertThat(credential.getUpdatedAt(), is(Date.from(Instant.parse("2023-04-13T16:18:01.481Z")))); - assertThat(credential.getCreatedAt(), is(Date.from(Instant.parse("2023-04-13T16:18:01.481Z")))); - assertThat(credential.getKid(), is("eKtBStP7BN2NiaoVrNGzb0QaRl4HlzyH1Lp00JB6Xj0")); - assertThat(credential.getId(), is("cred_asqwXXXIIadqq2T3zAXPwv")); - assertThat(credential.getThumbprint(), is("thumb")); - } - - @Test - public void shouldSerialize() throws Exception { - Credential credential = new Credential("id"); - credential.setCredentialType("public_key"); - credential.setPem("pem"); - credential.setAlg("alg"); - credential.setName("name"); - credential.setParseExpiryFromCert(true); - credential.setExpiresAt(new Date()); - - String json = toJSON(credential); - assertThat(json, is(notNullValue())); - - assertThat(json, JsonMatcher.hasEntry("name", "name")); - assertThat(json, JsonMatcher.hasEntry("alg", "alg")); - assertThat(json, JsonMatcher.hasEntry("parse_expiry_from_cert", true)); - assertThat(json, JsonMatcher.hasEntry("pem", "pem")); - assertThat(json, JsonMatcher.hasEntry("credential_type", "public_key")); - assertThat(json, JsonMatcher.hasEntry("expires_at", is(notNullValue()))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/EncryptionKeyTest.java b/src/test/java/com/auth0/json/mgmt/client/EncryptionKeyTest.java deleted file mode 100644 index ddbad4928..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/EncryptionKeyTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EncryptionKeyTest extends JsonTest { - - private static final String json = "{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"}"; - - @Test - public void shouldSerialize() throws Exception { - EncryptionKey key = new EncryptionKey("pub", "cert"); - key.setSubject("subject"); - - String serialized = toJSON(key); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("pub", "pub")); - assertThat(serialized, JsonMatcher.hasEntry("cert", "cert")); - assertThat(serialized, JsonMatcher.hasEntry("subject", "subject")); - } - - @Test - public void shouldDeserialize() throws Exception { - EncryptionKey key = fromJSON(json, EncryptionKey.class); - - assertThat(key, is(notNullValue())); - - assertThat(key.getPub(), is("pub")); - assertThat(key.getCert(), is("cert")); - assertThat(key.getSubject(), is("subject")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/IOSTest.java b/src/test/java/com/auth0/json/mgmt/client/IOSTest.java deleted file mode 100644 index fc0f28ea3..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/IOSTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class IOSTest extends JsonTest { - - private static final String json = "{\"team_id\":\"team\",\"app_bundle_identifier\":\"identifier\"}"; - - @Test - public void shouldSerialize() throws Exception { - IOS ios = new IOS("team", "identifier"); - - String serialized = toJSON(ios); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("team_id", "team")); - assertThat(serialized, JsonMatcher.hasEntry("app_bundle_identifier", "identifier")); - } - - @Test - public void shouldDeserialize() throws Exception { - IOS ios = fromJSON(json, IOS.class); - - assertThat(ios, is(notNullValue())); - - assertThat(ios.getTeamId(), is("team")); - assertThat(ios.getAppBundleIdentifier(), is("identifier")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/JWTConfigurationTest.java b/src/test/java/com/auth0/json/mgmt/client/JWTConfigurationTest.java deleted file mode 100644 index 5918c14a5..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/JWTConfigurationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.hamcrest.collection.IsMapContaining; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class JWTConfigurationTest extends JsonTest { - - private static final String json = "{\"lifetime_in_seconds\":123,\"scopes\":{\"key\":\"value\"},\"alg\":\"alg\"}"; - private static final String readOnlyJson = "{\"secret_encoded\":true}"; - - @Test - public void shouldSerialize() throws Exception { - JWTConfiguration config = new JWTConfiguration(123, Collections.singletonMap("key", "value"), "alg"); - - String serialized = toJSON(config); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("lifetime_in_seconds", 123)); - assertThat(serialized, JsonMatcher.hasEntry("scopes", Collections.singletonMap("key", "value"))); - assertThat(serialized, JsonMatcher.hasEntry("alg", "alg")); - } - - @Test - public void shouldDeserialize() throws Exception { - JWTConfiguration config = fromJSON(json, JWTConfiguration.class); - - assertThat(config, is(notNullValue())); - - assertThat(config.getAlgorithm(), is("alg")); - assertThat(config.getLifetimeInSeconds(), is(123)); - assertThat(config.getScopes(), is(notNullValue())); - assertThat((Map) config.getScopes(), IsMapContaining.hasEntry("key", "value")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - JWTConfiguration config = fromJSON(readOnlyJson, JWTConfiguration.class); - assertThat(config, is(notNullValue())); - - assertThat(config.isSecretEncoded(), is(true)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/MobileTest.java b/src/test/java/com/auth0/json/mgmt/client/MobileTest.java deleted file mode 100644 index 6096b4343..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/MobileTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class MobileTest extends JsonTest { - - private static final String json = "{\"android\":{},\"ios\":{}}"; - - @Test - public void shouldSerialize() throws Exception { - Android android = new Android(null, null); - IOS ios = new IOS(null, null); - Mobile mobile = new Mobile(android, ios); - - String serialized = toJSON(mobile); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("android", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("ios", notNullValue())); - } - - @Test - public void shouldDeserialize() throws Exception { - Mobile mobile = fromJSON(json, Mobile.class); - - assertThat(mobile, is(notNullValue())); - assertThat(mobile.getAndroid(), is(notNullValue())); - assertThat(mobile.getIOS(), is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/RefreshTokenTest.java b/src/test/java/com/auth0/json/mgmt/client/RefreshTokenTest.java deleted file mode 100644 index 258f1dc5c..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/RefreshTokenTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RefreshTokenTest extends JsonTest { - - private static final String json = "{\"rotation_type\":\"non-rotating\",\"expiration_type\":\"non-expiring\",\"leeway\":0,\"token_lifetime\":0,\"infinite_token_lifetime\":false,\"idle_token_lifetime\":0,\"infinite_idle_token_lifetime\":false}"; - - @Test - public void shouldSerialize() throws Exception { - RefreshToken refreshToken = new RefreshToken(); - refreshToken.setRotationType("non-rotating"); - refreshToken.setExpirationType("non-expiring"); - refreshToken.setLeeway(0); - refreshToken.setTokenLifetime(0); - refreshToken.setInfiniteTokenLifetime(false); - refreshToken.setIdleTokenLifetime(0); - refreshToken.setInfiniteIdleTokenLifetime(false); - - String serialized = toJSON(refreshToken); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("rotation_type", "non-rotating")); - assertThat(serialized, JsonMatcher.hasEntry("expiration_type", "non-expiring")); - assertThat(serialized, JsonMatcher.hasEntry("leeway", 0)); - assertThat(serialized, JsonMatcher.hasEntry("token_lifetime", 0)); - assertThat(serialized, JsonMatcher.hasEntry("infinite_token_lifetime", false)); - assertThat(serialized, JsonMatcher.hasEntry("idle_token_lifetime", 0)); - assertThat(serialized, JsonMatcher.hasEntry("infinite_idle_token_lifetime", false)); - } - - @Test - public void shouldDeserialize() throws Exception { - RefreshToken refreshToken = fromJSON(json, RefreshToken.class); - - assertThat(refreshToken, is(notNullValue())); - assertThat(refreshToken.getRotationType(), is("non-rotating")); - assertThat(refreshToken.getExpirationType(), is("non-expiring")); - assertThat(refreshToken.getLeeway(), is(0)); - assertThat(refreshToken.getTokenLifetime(), is(0)); - assertThat(refreshToken.getInfiniteTokenLifetime(), is(false)); - assertThat(refreshToken.getIdleTokenLifetime(), is(0)); - assertThat(refreshToken.getInfiniteIdleTokenLifetime(), is(false)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/client/SigningKeyTest.java b/src/test/java/com/auth0/json/mgmt/client/SigningKeyTest.java deleted file mode 100644 index d4e7831c4..000000000 --- a/src/test/java/com/auth0/json/mgmt/client/SigningKeyTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt.client; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class SigningKeyTest extends JsonTest { - - private static final String json = "{\"cert\":\"cert\",\"pkcs7\":\"pkcs7\",\"subject\":\"subject\"}"; - - @Test - public void shouldSerialize() throws Exception { - SigningKey key = new SigningKey("cert", "pkcs7", "subject"); - - String serialized = toJSON(key); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("cert", "cert")); - assertThat(serialized, JsonMatcher.hasEntry("pkcs7", "pkcs7")); - assertThat(serialized, JsonMatcher.hasEntry("subject", "subject")); - } - - @Test - public void shouldDeserialize() throws Exception { - SigningKey key = fromJSON(json, SigningKey.class); - - assertThat(key, is(notNullValue())); - assertThat(key.getCert(), is("cert")); - assertThat(key.getPKCS7(), is("pkcs7")); - assertThat(key.getSubject(), is("subject")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ConnectionKeysTest.java b/src/test/java/com/auth0/json/mgmt/connections/ConnectionKeysTest.java deleted file mode 100644 index 764e58a5c..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ConnectionKeysTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class ConnectionKeysTest extends JsonTest { - private static final String json = "{\n" + - " \"kid\": \"kid-1\",\n" + - " \"algorithm\": \"RS256\",\n" + - " \"key_use\": \"signing\",\n" + - " \"subject_dn\": \"/CN=cajwt\",\n" + - " \"cert\": \"-----BEGIN CERTIFICATE-----\\r\\ncert-key-1\\r\\n-----END CERTIFICATE-----\\r\\n\",\n" + - " \"fingerprint\": \"F1\",\n" + - " \"thumbprint\": \"example-print\",\n" + - " \"pkcs\": \"-----BEGIN PKCS7-----\\r\\npkcs-1\\r\\n-----END PKCS7-----\\r\\n\",\n" + - " \"current\": true,\n" + - " \"current_since\": \"2025-05-29T13:17:24.850Z\"\n" + - " }"; - - @Test - public void shouldSerialize() throws Exception { - ConnectionKeys connectionKeys = new ConnectionKeys(); - connectionKeys.setKid("kid-1"); - connectionKeys.setAlgorithm("RS256"); - connectionKeys.setKeyUse("signing"); - connectionKeys.setSubjectDn("/CN=cajwt"); - connectionKeys.setFingerprint("F1"); - connectionKeys.setThumbprint("example-print"); - connectionKeys.setPkcs("pkcs"); - connectionKeys.setCurrent(true); - connectionKeys.setCurrentSince("2025-05-29T13:17:24.850Z"); - - String serialized = toJSON(connectionKeys); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("kid", "kid-1")); - assertThat(serialized, JsonMatcher.hasEntry("algorithm", "RS256")); - assertThat(serialized, JsonMatcher.hasEntry("key_use", "signing")); - assertThat(serialized, JsonMatcher.hasEntry("subject_dn", "/CN=cajwt")); - assertThat(serialized, JsonMatcher.hasEntry("fingerprint", "F1")); - assertThat(serialized, JsonMatcher.hasEntry("thumbprint", "example-print")); - assertThat(serialized, JsonMatcher.hasEntry("pkcs", "pkcs")); - assertThat(serialized, JsonMatcher.hasEntry("current", true)); - assertThat(serialized, JsonMatcher.hasEntry("current_since", "2025-05-29T13:17:24.850Z")); - } - - @Test - public void shouldDeserialize() throws Exception { - ConnectionKeys connectionKey = fromJSON(json, ConnectionKeys.class); - assertThat(connectionKey, is(notNullValue())); - assertThat(connectionKey.getKid(), is("kid-1")); - assertThat(connectionKey.getAlgorithm(), is("RS256")); - assertThat(connectionKey.getKeyUse(), is("signing")); - assertThat(connectionKey.getSubjectDn(), is("/CN=cajwt")); - assertThat(connectionKey.getCert(), is("-----BEGIN CERTIFICATE-----\r\ncert-key-1\r\n-----END CERTIFICATE-----\r\n")); - assertThat(connectionKey.getFingerprint(), is("F1")); - assertThat(connectionKey.getThumbprint(), is("example-print")); - assertThat(connectionKey.getPkcs(), is("-----BEGIN PKCS7-----\r\npkcs-1\r\n-----END PKCS7-----\r\n")); - assertThat(connectionKey.getCurrent(), is(true)); - assertThat(connectionKey.getCurrentSince(), is("2025-05-29T13:17:24.850Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ConnectionTest.java b/src/test/java/com/auth0/json/mgmt/connections/ConnectionTest.java deleted file mode 100644 index 529f3a86e..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ConnectionTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashMap; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ConnectionTest extends JsonTest { - - private static final String json = "{\"name\": \"my-connection\",\"display_name\": \"My cool connection!\",\"strategy\": \"auth0\",\"options\": {},\"enabled_clients\": [\"client1\",\"client2\"],\"metadata\": {\"key\": \"value\"},\"realms\": [\"realm1\",\"realm2\"]}"; - private static final String readOnlyJson = "{\"id\":\"connectionId\"}"; - - private static final String jsonAd = "{\"name\":\"my-ad-connection\",\"strategy\":\"ad\",\"provisioning_ticket_url\":\"https://demo.auth0.com/p/ad/ddQTRlVt\",\"options\":{},\"enabled_clients\":[\"client1\",\"client2\"]}"; - - @Test - public void shouldSerialize() throws Exception { - Connection connection = new Connection("my-connection", "auth0"); - connection.setDisplayName("COOL!"); - connection.setOptions(new HashMap()); - // enabled_clients is deprecated as part of the new connections API GET/PATCH Enabled Clients -// connection.setEnabledClients(Arrays.asList("client1", "client2")); - connection.setMetadata(new HashMap()); - connection.setRealms(Arrays.asList("realm1", "realm2")); - - String serialized = toJSON(connection); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "my-connection")); - assertThat(serialized, JsonMatcher.hasEntry("display_name", "COOL!")); - assertThat(serialized, JsonMatcher.hasEntry("strategy", "auth0")); - assertThat(serialized, JsonMatcher.hasEntry("options", notNullValue())); - // enabled_clients is deprecated as part of the new connections API GET/PATCH Enabled Clients -// assertThat(serialized, JsonMatcher.hasEntry("enabled_clients", Arrays.asList("client1", "client2"))); - assertThat(serialized, JsonMatcher.hasEntry("provisioning_ticket_url", null)); - assertThat(serialized, JsonMatcher.hasEntry("metadata", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("realms", Arrays.asList("realm1", "realm2"))); - } - - @Test - public void shouldDeserialize() throws Exception { - Connection connection = fromJSON(json, Connection.class); - - assertThat(connection, is(notNullValue())); - assertThat(connection.getName(), is("my-connection")); - assertThat(connection.getDisplayName(), is("My cool connection!")); - assertThat(connection.getOptions(), is(notNullValue())); - assertThat(connection.getStrategy(), is("auth0")); - // enabled_clients is deprecated as part of the new connections API GET/PATCH Enabled Clients -// assertThat(connection.getEnabledClients(), contains("client1", "client2")); - assertThat(connection.getProvisioningTicketUrl(), is(nullValue())); - assertThat(connection.getMetadata(), is(notNullValue())); - assertThat(connection.getRealms(), contains("realm1", "realm2")); - } - - @Test - public void shouldDeserializeAd() throws Exception { - Connection connection = fromJSON(jsonAd, Connection.class); - - assertThat(connection, is(notNullValue())); - assertThat(connection.getName(), is("my-ad-connection")); - assertThat(connection.getOptions(), is(notNullValue())); - assertThat(connection.getStrategy(), is("ad")); - // enabled_clients is deprecated as part of the new connections API GET/PATCH Enabled Clients - //assertThat(connection.getEnabledClients(), contains("client1", "client2")); - assertThat(connection.getProvisioningTicketUrl(), is("https://demo.auth0.com/p/ad/ddQTRlVt")); - assertThat(connection.getMetadata(), is(nullValue())); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Connection connection = fromJSON(readOnlyJson, Connection.class); - assertThat(connection, is(notNullValue())); - - assertThat(connection.getId(), is("connectionId")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/EnabledClientRequestTest.java b/src/test/java/com/auth0/json/mgmt/connections/EnabledClientRequestTest.java deleted file mode 100644 index 46164f764..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/EnabledClientRequestTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class EnabledClientRequestTest extends JsonTest { - private static final String json = "{\"client_id\":\"1\",\"status\":true}"; - - @Test - public void shouldSerialize() throws Exception { - EnabledClientRequest enabledClientRequest = new EnabledClientRequest("1", true); - - String serialized = toJSON(enabledClientRequest); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "1")); - assertThat(serialized, JsonMatcher.hasEntry("status", true)); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/EnabledClientResponseTest.java b/src/test/java/com/auth0/json/mgmt/connections/EnabledClientResponseTest.java deleted file mode 100644 index e304f7140..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/EnabledClientResponseTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EnabledClientResponseTest extends JsonTest { - private static final String json = "src/test/resources/mgmt/enabled_clients_for_connection.json"; - - @Test - public void shouldSerialize() throws Exception { - EnabledClientResponse enabledClientResponse = new EnabledClientResponse(); - List clientsList = new ArrayList<>(); - clientsList.add(new Clients("client-1")); - clientsList.add(new Clients("client-2")); - enabledClientResponse.setClients(clientsList); - enabledClientResponse.setNext("next"); - - String serialized = toJSON(enabledClientResponse); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("next", "next")); - } - - @Test - public void shouldDeserialize() throws Exception { - EnabledClientResponse deserialized = fromJSON(readTextFile(json), EnabledClientResponse.class); - - assertThat(deserialized, is(notNullValue())); - assertThat(deserialized.getClients().get(0).getClientId(), is("client-1")); - assertThat(deserialized.getClients().get(1).getClientId(), is("client-2")); - assertThat(deserialized.getNext(), is("next")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/RotateKeyTest.java b/src/test/java/com/auth0/json/mgmt/connections/RotateKeyTest.java deleted file mode 100644 index 570e163d2..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/RotateKeyTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RotateKeyTest extends JsonTest { - private static final String json = "src/test/resources/mgmt/rotate_key.json"; - - @Test - public void shouldSerialize() throws Exception { - RotateKey rotateKey = new RotateKey(); - rotateKey.setCert("-----BEGIN CERTIFICATE-----cert-key-----END CERTIFICATE-----"); - rotateKey.setKid("kid-1"); - - String serialized = toJSON(rotateKey); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("cert", "-----BEGIN CERTIFICATE-----cert-key-----END CERTIFICATE-----")); - assertThat(serialized, JsonMatcher.hasEntry("kid", "kid-1")); - } - - @Test - public void shouldDeserialize() throws Exception { - RotateKey deserialized = fromJSON(readTextFile(json), RotateKey.class); - - assertThat(deserialized, is(notNullValue())); - assertThat(deserialized.getCert(), is("-----BEGIN CERTIFICATE-----cert-key-----END CERTIFICATE-----")); - assertThat(deserialized.getKid(), is("kid-1")); - - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationRequestTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationRequestTest.java deleted file mode 100644 index 2eaf80151..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationRequestTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ScimConfigurationRequestTest extends JsonTest { - - private final static String json = "{\n" + - " \"user_id_attribute\": \"externalId\",\n" + - " \"mapping\": [\n" + - " {\n" + - " \"auth0\": \"preferred_username\",\n" + - " \"scim\": \"userName\"\n" + - " }\n" + - " ]\n" + - "}"; - - @Test - public void serialize() throws Exception { - ScimConfigurationRequest request = new ScimConfigurationRequest(); - request.setUserIdAttribute("externalId"); - List mappingList = new ArrayList<>(); - Mapping mapping = new Mapping("preferred_username", "userName"); - mappingList.add(mapping); - request.setMapping(mappingList); - - String serialized = toJSON(request); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id_attribute", "externalId")); - assertThat(serialized, JsonMatcher.hasEntry("mapping", notNullValue())); - assertThat(serialized, containsString("\"mapping\":[{\"auth0\":\"preferred_username\",\"scim\":\"userName\"}]")); - } - - @Test - public void deserialize() throws Exception { - ScimConfigurationRequest deserialized = fromJSON(json, ScimConfigurationRequest.class); - - assertThat(deserialized, is(notNullValue())); - - assertThat(deserialized.getUserIdAttribute(), is("externalId")); - assertThat(deserialized.getMapping().get(0).getAuth0(), is("preferred_username")); - assertThat(deserialized.getMapping().get(0).getScim(), is("userName")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationResponseTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationResponseTest.java deleted file mode 100644 index 5aa5f5855..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimConfigurationResponseTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ScimConfigurationResponseTest extends JsonTest { - private final static String SCIM_CONFIGURATION_RESPONSE_JSON = "src/test/resources/mgmt/connection_scim_configuration.json"; - - @Test - public void deserialize() throws Exception { - ScimConfigurationResponse deserialized = fromJSON(readTextFile(SCIM_CONFIGURATION_RESPONSE_JSON), ScimConfigurationResponse.class); - - assertThat(deserialized.getTenantName(), is("dev-1")); - assertThat(deserialized.getConnectionId(), is("con_0000000000000001")); - assertThat(deserialized.getConnectionName(), is("New Connection")); - assertThat(deserialized.getStrategy(), is("okta")); - assertThat(deserialized.getMapping().get(0).getAuth0(), is("preferred_username")); - assertThat(deserialized.getMapping().get(0).getScim(), is("userName")); - assertThat(deserialized.getMapping().get(1).getAuth0(), is("email")); - assertThat(deserialized.getMapping().get(1).getScim(), is("emails[primary eq true].value")); - assertThat(deserialized.getUpdatedOn(), is("2025-01-22T11:56:24.461Z")); - assertThat(deserialized.getCreatedAt(), is("2025-01-22T11:56:24.461Z")); - assertThat(deserialized.getUserIdAttribute(), is("externalId")); - } - - @Test - public void serialize() throws Exception { - ScimConfigurationResponse scimConfigurationResponse = new ScimConfigurationResponse(); - scimConfigurationResponse.setTenantName("dev-1"); - scimConfigurationResponse.setConnectionId("con_0000000000000001"); - scimConfigurationResponse.setConnectionName("New Connection"); - scimConfigurationResponse.setStrategy("okta"); - - List mappingList = new ArrayList<>(); - Mapping mapping1 = new Mapping("preferred_username", "userName"); - mappingList.add(mapping1); - Mapping mapping2 = new Mapping("email", "emails[primary eq true].value"); - mappingList.add(mapping2); - scimConfigurationResponse.setMapping(mappingList); - - scimConfigurationResponse.setUpdatedOn("2025-01-22T11:56:24.461Z"); - scimConfigurationResponse.setCreatedAt("2025-01-22T11:56:24.461Z"); - scimConfigurationResponse.setUserIdAttribute("externalId"); - - String serialized = toJSON(scimConfigurationResponse); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, hasEntry("tenant_name", "dev-1")); - assertThat(serialized, hasEntry("connection_id", "con_0000000000000001")); - assertThat(serialized, hasEntry("connection_name", "New Connection")); - assertThat(serialized, hasEntry("strategy", "okta")); - assertThat(serialized, hasEntry("mapping", notNullValue())); - assertThat(serialized, containsString("\"mapping\":[{\"auth0\":\"preferred_username\",\"scim\":\"userName\"},{\"auth0\":\"email\",\"scim\":\"emails[primary eq true].value\"}]")); - assertThat(serialized, hasEntry("updated_on", "2025-01-22T11:56:24.461Z")); - assertThat(serialized, hasEntry("created_at", "2025-01-22T11:56:24.461Z")); - assertThat(serialized, hasEntry("user_id_attribute", "externalId")); - } -} - diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponseTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponseTest.java deleted file mode 100644 index 98716f53d..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenBaseResponseTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ScimTokenBaseResponseTest extends JsonTest { - - private final static String json = "{\n" + - " \"token_id\": \"tok_000000001\",\n" + - " \"scopes\": [\n" + - " \"get:users\"\n" + - " ],\n" + - " \"created_at\": \"2025-01-23T12:34:46.321Z\",\n" + - " \"valid_until\": \"2025-01-23T12:51:26.321Z\"\n" + - "}"; - - - @Test - public void serialize() throws Exception { - ScimTokenBaseResponse request = new ScimTokenBaseResponse(); - request.setTokenId("tok_000000001"); - List scopes = new ArrayList<>(); - scopes.add("get:users"); - request.setScopes(scopes); - request.setCreatedAt("2025-01-23T12:34:46.321Z"); - request.setValidUntil("2025-01-23T12:51:26.321Z"); - - String serialized = toJSON(request); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("token_id", "tok_000000001")); - assertThat(serialized, hasEntry("scopes", notNullValue())); - assertThat(serialized, containsString("\"scopes\":[\"get:users\"]")); - assertThat(serialized, JsonMatcher.hasEntry("created_at", "2025-01-23T12:34:46.321Z")); - assertThat(serialized, JsonMatcher.hasEntry("valid_until", "2025-01-23T12:51:26.321Z")); - } - - @Test - public void deserialize() throws Exception { - ScimTokenBaseResponse deserialized = fromJSON(json, ScimTokenBaseResponse.class); - - assertThat(deserialized, is(notNullValue())); - - assertThat(deserialized.getTokenId(), is("tok_000000001")); - assertThat(deserialized.getScopes().get(0), is("get:users")); - assertThat(deserialized.getCreatedAt(), is("2025-01-23T12:34:46.321Z")); - assertThat(deserialized.getValidUntil(), is("2025-01-23T12:51:26.321Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponseTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponseTest.java deleted file mode 100644 index 45287acb8..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenCreateResponseTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ScimTokenCreateResponseTest extends JsonTest { - public static final String CONNECTION_SCIM_TOKEN = "src/test/resources/mgmt/connection_scim_token.json"; - - @Test - public void deserialize() throws Exception { - ScimTokenCreateResponse deserialized = fromJSON(readTextFile(CONNECTION_SCIM_TOKEN), ScimTokenCreateResponse.class); - - assertThat(deserialized.getTokenId(), is("tok_000000001")); - assertThat(deserialized.getToken(), is("tok_iwioqiwoqoqiwqoiwqwi")); - assertThat(deserialized.getScopes().get(0), is("get:users")); - assertThat(deserialized.getCreatedAt(), is("2025-01-23T12:34:46.321Z")); - assertThat(deserialized.getValidUntil(), is("2025-01-23T12:51:26.321Z")); - } - - @Test - public void serialize() throws Exception { - ScimTokenCreateResponse serialize = new ScimTokenCreateResponse(); - serialize.setTokenId("tok_000000001"); - serialize.setToken("tok_iwioqiwoqoqiwqoiwqwi"); - List scopes = new ArrayList<>(); - scopes.add("get:users"); - serialize.setScopes(scopes); - serialize.setCreatedAt("2025-01-23T12:34:46.321Z"); - serialize.setValidUntil("2025-01-23T12:51:26.321Z"); - - String serialized = toJSON(serialize); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, hasEntry("token_id", "tok_000000001")); - assertThat(serialized, hasEntry("token", "tok_iwioqiwoqoqiwqoiwqwi")); - assertThat(serialized, hasEntry("scopes", notNullValue())); - assertThat(serialized, containsString("\"scopes\":[\"get:users\"]")); - assertThat(serialized, hasEntry("created_at", "2025-01-23T12:34:46.321Z")); - assertThat(serialized, hasEntry("valid_until", "2025-01-23T12:51:26.321Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenRequestTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimTokenRequestTest.java deleted file mode 100644 index ca2769794..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenRequestTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class ScimTokenRequestTest extends JsonTest { - - public static final String json = "{\n" + - " \"scopes\": [\"get:users\"],\n" + - " \"token_lifetime\": 1000\n" + - "}"; - - @Test - public void serialize() throws Exception { - ScimTokenRequest request = new ScimTokenRequest(); - request.setTokenLifetime(1000); - List scopes = new ArrayList<>(); - scopes.add("get:users"); - request.setScopes(scopes); - - String serialized = toJSON(request); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, hasEntry("scopes", notNullValue())); - assertThat(serialized, containsString("\"scopes\":[\"get:users\"]")); - assertThat(serialized, hasEntry("token_lifetime", 1000)); - } - - @Test - public void deserialize() throws Exception { - ScimTokenRequest deserialized = fromJSON(json, ScimTokenRequest.class); - - assertThat(deserialized, is(notNullValue())); - - assertThat(deserialized.getTokenLifetime(), is(1000)); - assertThat(deserialized.getScopes().get(0), is("get:users")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenResponseTest.java b/src/test/java/com/auth0/json/mgmt/connections/ScimTokenResponseTest.java deleted file mode 100644 index 5924570b2..000000000 --- a/src/test/java/com/auth0/json/mgmt/connections/ScimTokenResponseTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.auth0.json.mgmt.connections; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.hamcrest.Matchers.is; - -public class ScimTokenResponseTest extends JsonTest { - private final static String json = "{\n" + - " \"token_id\": \"tok_000000001\",\n" + - " \"scopes\": [\n" + - " \"get:users\"\n" + - " ],\n" + - " \"created_at\": \"2025-01-23T12:34:46.321Z\",\n" + - " \"valid_until\": \"2025-01-23T12:51:26.321Z\",\n" + - " \"last_used_at\": \"2025-01-23T12:51:26.321Z\"\n" + - "}"; - - - @Test - public void serialize() throws Exception { - ScimTokenResponse request = new ScimTokenResponse(); - request.setTokenId("tok_000000001"); - List scopes = new ArrayList<>(); - scopes.add("get:users"); - request.setScopes(scopes); - request.setCreatedAt("2025-01-23T12:34:46.321Z"); - request.setValidUntil("2025-01-23T12:51:26.321Z"); - request.setLastUsedAt("2025-01-23T12:51:26.321Z"); - - String serialized = toJSON(request); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("token_id", "tok_000000001")); - assertThat(serialized, hasEntry("scopes", notNullValue())); - assertThat(serialized, containsString("\"scopes\":[\"get:users\"]")); - assertThat(serialized, JsonMatcher.hasEntry("created_at", "2025-01-23T12:34:46.321Z")); - assertThat(serialized, JsonMatcher.hasEntry("valid_until", "2025-01-23T12:51:26.321Z")); - assertThat(serialized, JsonMatcher.hasEntry("last_used_at", "2025-01-23T12:51:26.321Z")); - } - - @Test - public void deserialize() throws Exception { - ScimTokenResponse deserialized = fromJSON(json, ScimTokenResponse.class); - - assertThat(deserialized, is(notNullValue())); - - assertThat(deserialized.getTokenId(), is("tok_000000001")); - assertThat(deserialized.getScopes().get(0), is("get:users")); - assertThat(deserialized.getCreatedAt(), is("2025-01-23T12:34:46.321Z")); - assertThat(deserialized.getValidUntil(), is("2025-01-23T12:51:26.321Z")); - assertThat(deserialized.getLastUsedAt(), is("2025-01-23T12:51:26.321Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentialsTest.java b/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentialsTest.java deleted file mode 100644 index 29a642b82..000000000 --- a/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderCredentialsTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.auth0.json.mgmt.emailproviders; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EmailProviderCredentialsTest extends JsonTest { - - private static final String json = "{\"api_key\":\"key123\",\"api_user\":\"username\",\"accessKeyId\":\"id\",\"secretAccessKey\":\"secret\",\"region\":\"ar\",\"smtp_host\":\"host\",\"smtp_port\":1234,\"smtp_user\":\"usr\",\"smtp_pass\":\"pwd\"}"; - - @Test - public void shouldSerialize() throws Exception { - EmailProviderCredentials credentials = new EmailProviderCredentials("key123"); - credentials.setApiUser("username"); - credentials.setAccessKeyId("id"); - credentials.setSecretAccessKey("secret"); - credentials.setRegion("ar"); - credentials.setSMTPHost("host"); - credentials.setSMTPPort(1234); - credentials.setSMTPUser("usr"); - credentials.setSMTPPass("pwd"); - - String serialized = toJSON(credentials); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("api_key", "key123")); - assertThat(serialized, JsonMatcher.hasEntry("api_user", "username")); - assertThat(serialized, JsonMatcher.hasEntry("accessKeyId", "id")); - assertThat(serialized, JsonMatcher.hasEntry("secretAccessKey", "secret")); - assertThat(serialized, JsonMatcher.hasEntry("region", "ar")); - assertThat(serialized, JsonMatcher.hasEntry("smtp_host", "host")); - assertThat(serialized, JsonMatcher.hasEntry("smtp_port", 1234)); - assertThat(serialized, JsonMatcher.hasEntry("smtp_user", "usr")); - assertThat(serialized, JsonMatcher.hasEntry("smtp_pass", "pwd")); - } - - @Test - public void shouldDeserialize() throws Exception { - EmailProviderCredentials credentials = fromJSON(json, EmailProviderCredentials.class); - - assertThat(credentials, is(notNullValue())); - assertThat(credentials.getApiKey(), is("key123")); - assertThat(credentials.getApiUser(), is("username")); - assertThat(credentials.getAccessKeyId(), is("id")); - assertThat(credentials.getSecretAccessKey(), is("secret")); - assertThat(credentials.getRegion(), is("ar")); - assertThat(credentials.getSMTPHost(), is("host")); - assertThat(credentials.getSMTPPort(), is(1234)); - assertThat(credentials.getSMTPUser(), is("usr")); - assertThat(credentials.getSMTPPass(), is("pwd")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderTest.java b/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderTest.java deleted file mode 100644 index e387e36e5..000000000 --- a/src/test/java/com/auth0/json/mgmt/emailproviders/EmailProviderTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.auth0.json.mgmt.emailproviders; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EmailProviderTest extends JsonTest { - - private static final String json = "{\"name\":\"provider\",\"enabled\":true,\"default_from_address\":\"https://google.com\",\"credentials\":{\"api_key\":\"key123\"},\"settings\":{}}"; - - @Test - public void shouldSerialize() throws Exception { - EmailProvider provider = new EmailProvider("provider"); - provider.setEnabled(true); - provider.setDefaultFromAddress("https://google.com"); - provider.setSettings(Collections.emptyMap()); - provider.setCredentials(new EmailProviderCredentials("key123")); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "provider")); - assertThat(serialized, JsonMatcher.hasEntry("enabled", true)); - assertThat(serialized, JsonMatcher.hasEntry("default_from_address", "https://google.com")); - assertThat(serialized, JsonMatcher.hasEntry("credentials", Collections.singletonMap("api_key", "key123"))); - assertThat(serialized, JsonMatcher.hasEntry("settings", notNullValue())); - } - - @Test - public void shouldDeserialize() throws Exception { - EmailProvider provider = fromJSON(json, EmailProvider.class); - - assertThat(provider, is(notNullValue())); - assertThat(provider.getName(), is("provider")); - assertThat(provider.isEnabled(), is(true)); - assertThat(provider.getDefaultFromAddress(), is("https://google.com")); - assertThat(provider.getSettings(), is(notNullValue())); - assertThat(provider.getCredentials(), is(notNullValue())); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTest.java b/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTest.java deleted file mode 100644 index 5909e3482..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EnrollmentTest extends JsonTest { - - private static final String json = "{\"id\":\"123\",\"status\":\"confirmed\",\"type\":\"idk\",\"name\":\"auth0\",\"identifier\":\"id123\",\"phone_number\":\"1234567890\", \"auth_method\":\"authenticator\",\"enrolled_at\":\"2016-02-23T19:57:29.532Z\",\"last_auth\":\"2016-02-23T19:57:29.532Z\"}"; - - @Test - public void shouldDeserialize() throws Exception { - Enrollment enrollment = fromJSON(json, Enrollment.class); - - assertThat(enrollment, is(notNullValue())); - assertThat(enrollment.getId(), is("123")); - assertThat(enrollment.getStatus(), is("confirmed")); - assertThat(enrollment.getType(), is("idk")); - assertThat(enrollment.getName(), is("auth0")); - assertThat(enrollment.getIdentifier(), is("id123")); - assertThat(enrollment.getPhoneNumber(), is("1234567890")); - assertThat(enrollment.getAuthMethod(), is("authenticator")); - assertThat(enrollment.getEnrolledAt(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(enrollment.getLastAuth(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTicketTest.java b/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTicketTest.java deleted file mode 100644 index a4330a881..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTicketTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EnrollmentTicketTest extends JsonTest { - - private static final String readOnlyJson = "{\"ticket_id\":\"ticket123\",\"ticket_url\":\"https://auth0.com/guardian/tickets/123\"}"; - - @Test - public void shouldSerializeDataToBeSent() throws Exception { - EnrollmentTicket ticket = new EnrollmentTicket("1", true, "me@auth0.com"); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "1")); - assertThat(serialized, JsonMatcher.hasEntry("send_mail", true)); - assertThat(serialized, JsonMatcher.hasEntry("email", "me@auth0.com")); - } - - @Test - public void shouldSerializeDataToBeSentOnlyUserId() throws Exception { - EnrollmentTicket ticket = new EnrollmentTicket("1"); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "1")); - } - - @Test - public void shouldSerializeDataToBeSentOnlyUserIdAndSendEmail() throws Exception { - EnrollmentTicket ticket = new EnrollmentTicket("1", true); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "1")); - assertThat(serialized, JsonMatcher.hasEntry("send_mail", true)); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - EnrollmentTicket ticket = fromJSON(readOnlyJson, EnrollmentTicket.class); - assertThat(ticket, is(notNullValue())); - - assertThat(ticket.getTicketId(), is("ticket123")); - assertThat(ticket.getTicketUrl(), is("https://auth0.com/guardian/tickets/123")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/FactorTest.java b/src/test/java/com/auth0/json/mgmt/guardian/FactorTest.java deleted file mode 100644 index 2f8d5ce1f..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/FactorTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class FactorTest extends JsonTest { - - private static final String readOnlyJson = "{\"enabled\":true,\"name\":\"sms\",\"trial_expired\":true}"; - - @Test - public void shouldSerialize() throws Exception { - Factor factor = new Factor(true); - - String serialized = toJSON(factor); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("enabled", true)); - } - - @Test - public void shouldDeserialize() throws Exception { - Factor factor = fromJSON(readOnlyJson, Factor.class); - - assertThat(factor, is(notNullValue())); - assertThat(factor.isEnabled(), is(true)); - assertThat(factor.getName(), is("sms")); - assertThat(factor.isTrialExpired(), is(true)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/GuardianTemplatesTest.java b/src/test/java/com/auth0/json/mgmt/guardian/GuardianTemplatesTest.java deleted file mode 100644 index 8d9e9e434..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/GuardianTemplatesTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class GuardianTemplatesTest extends JsonTest { - private static final String json = "{\"enrollment_message\":\"enrollme\",\"verification_message\":\"verifyme\"}"; - - @Test - public void shouldSerialize() throws Exception { - GuardianTemplates templates = new GuardianTemplates("enrollme", "verifyme"); - - String serialized = toJSON(templates); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("enrollment_message", "enrollme")); - assertThat(serialized, JsonMatcher.hasEntry("verification_message", "verifyme")); - } - - @Test - public void shouldDeserialize() throws Exception { - GuardianTemplates templates = fromJSON(json, GuardianTemplates.class); - - assertThat(templates, is(notNullValue())); - assertThat(templates.getEnrollmentMessage(), is("enrollme")); - assertThat(templates.getVerificationMessage(), is("verifyme")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/SNSFactorProviderTest.java b/src/test/java/com/auth0/json/mgmt/guardian/SNSFactorProviderTest.java deleted file mode 100644 index d8acbbd5c..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/SNSFactorProviderTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class SNSFactorProviderTest extends JsonTest { - - private static final String json = "{\"aws_access_key_id\":\"akey\",\"aws_secret_access_key\":\"secretakey\",\"aws_region\":\"ar\",\"sns_apns_platform_application_arn\":\"arn1\",\"sns_gcm_platform_application_arn\":\"arn2\"}"; - - @SuppressWarnings("deprecation") - @Test - public void shouldSerializeWithDeprecatedSetters() throws Exception { - SNSFactorProvider provider = new SNSFactorProvider("akey", "secretakey", "ar", "arn1", "arn2"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("aws_access_key_id", "akey")); - assertThat(serialized, JsonMatcher.hasEntry("aws_secret_access_key", "secretakey")); - assertThat(serialized, JsonMatcher.hasEntry("aws_region", "ar")); - assertThat(serialized, JsonMatcher.hasEntry("sns_apns_platform_application_arn", "arn1")); - assertThat(serialized, JsonMatcher.hasEntry("sns_gcm_platform_application_arn", "arn2")); - } - - @Test - public void shouldSerialize() throws Exception { - SNSFactorProvider provider = new SNSFactorProvider("akey", "secretakey", "ar", "arn1", "arn2"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("aws_access_key_id", "akey")); - assertThat(serialized, JsonMatcher.hasEntry("aws_secret_access_key", "secretakey")); - assertThat(serialized, JsonMatcher.hasEntry("aws_region", "ar")); - assertThat(serialized, JsonMatcher.hasEntry("sns_apns_platform_application_arn", "arn1")); - assertThat(serialized, JsonMatcher.hasEntry("sns_gcm_platform_application_arn", "arn2")); - } - - @Test - public void shouldDeserialize() throws Exception { - SNSFactorProvider provider = fromJSON(json, SNSFactorProvider.class); - - assertThat(provider, is(notNullValue())); - assertThat(provider.getAWSRegion(), is("ar")); - assertThat(provider.getAWSAccessKeyId(), is("akey")); - assertThat(provider.getAWSSecretAccessKey(), is("secretakey")); - assertThat(provider.getSNSAPNSPlatformApplicationARN(), is("arn1")); - assertThat(provider.getSNSGCMPlatformApplicationARN(), is("arn2")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java b/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java deleted file mode 100644 index 508a1b788..000000000 --- a/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.auth0.json.mgmt.guardian; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TwilioFactorProviderTest extends JsonTest { - - private static final String JSON_WITH_FROM = "{\"from\":\"+12356789\",\"auth_token\":\"atokEn\",\"sid\":\"id123\"}"; - private static final String JSON_WITH_MESSAGING_SERVICE_SID = "{\"messaging_service_sid\":\"id321\",\"auth_token\":\"atokEn\",\"sid\":\"id123\"}"; - - @Test - public void shouldFailConstructionWithBothFromAndMessagingServiceSID() { - verifyThrows(IllegalArgumentException.class, - () -> new TwilioFactorProvider("+12356789", "messaging_service_sid", "atokEn", "id123"), - "You must specify either `from` or `messagingServiceSID`, but not both"); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldSerializeWithDeprecatedSettersWithFrom() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider("+12356789", null, "atokEn", "id123"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("from", "+12356789")); - assertThat(serialized, JsonMatcher.hasEntry("auth_token", "atokEn")); - assertThat(serialized, JsonMatcher.hasEntry("sid", "id123")); - assertThat(serialized, not(containsString("\"messaging_service_sid\""))); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldSerializeWithDeprecatedSettersWithMessagingServiceSID() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider(null, "id321", "atokEn", "id123"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, JsonMatcher.hasEntry("messaging_service_sid", "id321")); - assertThat(serialized, JsonMatcher.hasEntry("auth_token", "atokEn")); - assertThat(serialized, JsonMatcher.hasEntry("sid", "id123")); - assertThat(serialized, not(containsString("\"from\""))); - } - - @Test - public void shouldSerializeWithFrom() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider("+12356789", null, "atokEn", "id123"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("from", "+12356789")); - assertThat(serialized, JsonMatcher.hasEntry("auth_token", "atokEn")); - assertThat(serialized, JsonMatcher.hasEntry("sid", "id123")); - assertThat(serialized, not(containsString("\"messaging_service_sid\""))); - } - - @Test - public void shouldSerializeWithMessaginServiceSID() throws Exception { - TwilioFactorProvider provider = new TwilioFactorProvider(null, "id321", "atokEn", "id123"); - - String serialized = toJSON(provider); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("messaging_service_sid", "id321")); - assertThat(serialized, JsonMatcher.hasEntry("auth_token", "atokEn")); - assertThat(serialized, JsonMatcher.hasEntry("sid", "id123")); - assertThat(serialized, not(containsString("\"from\""))); - } - - @Test - public void shouldDeserializeWithFrom() throws Exception { - TwilioFactorProvider provider = fromJSON(JSON_WITH_FROM, TwilioFactorProvider.class); - - assertThat(provider, is(notNullValue())); - assertThat(provider.getAuthToken(), is("atokEn")); - assertThat(provider.getFrom(), is("+12356789")); - assertThat(provider.getMessagingServiceSID(), is(nullValue())); - assertThat(provider.getSID(), is("id123")); - } - - @Test - public void shouldDeserializeWithMessagingServiceSID() throws Exception { - TwilioFactorProvider provider = fromJSON(JSON_WITH_MESSAGING_SERVICE_SID, TwilioFactorProvider.class); - - assertThat(provider, is(notNullValue())); - assertThat(provider.getAuthToken(), is("atokEn")); - assertThat(provider.getFrom(), is(nullValue())); - assertThat(provider.getMessagingServiceSID(), is("id321")); - assertThat(provider.getSID(), is("id123")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/jobs/JobErrorDetailsTest.java b/src/test/java/com/auth0/json/mgmt/jobs/JobErrorDetailsTest.java deleted file mode 100644 index 69c8ac551..000000000 --- a/src/test/java/com/auth0/json/mgmt/jobs/JobErrorDetailsTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.users.User; -import com.fasterxml.jackson.core.JsonProcessingException; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class JobErrorDetailsTest extends JsonTest { - - String json = "{\"user\":{\"email\":\"john.doe@gmail.com\"},\"errors\":[{\"code\":\"code\",\"message\":\"message\",\"path\":\"path\"}]}"; - - @Test - public void shouldDeserialize() throws Exception { - JobErrorDetails errorDetails = fromJSON(json, JobErrorDetails.class); - - assertThat(errorDetails, is(notNullValue())); - assertThat(errorDetails.getUser(), is(notNullValue())); - assertThat(errorDetails.getUser().getEmail(), is(equalTo("john.doe@gmail.com"))); - assertThat(errorDetails.getErrors(), hasSize(1)); - - assertThat(errorDetails.getErrors().get(0).getCode(), is(equalTo("code"))); - assertThat(errorDetails.getErrors().get(0).getMessage(), is(equalTo("message"))); - assertThat(errorDetails.getErrors().get(0).getPath(), is(equalTo("path"))); - } - - @Test - public void shouldSerialize() throws JsonProcessingException { - User user = new User(); - user.setEmail("john.doe@gmail.com"); - JobError error = new JobError("code", "message", "path"); - JobErrorDetails errorDetails = new JobErrorDetails(user, Collections.singletonList(error)); - String serialized = toJSON(errorDetails); - - assertThat(serialized, is(equalTo(json))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/jobs/JobTest.java b/src/test/java/com/auth0/json/mgmt/jobs/JobTest.java deleted file mode 100644 index f7e1f7363..000000000 --- a/src/test/java/com/auth0/json/mgmt/jobs/JobTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.auth0.json.JsonTest; -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.core.Is.is; - -public class JobTest extends JsonTest { - - private static final String json = "{\"status\": \"completed\",\"type\": \"verification_email\",\"created_at\": \"2016-02-23T19:57:29.532Z\",\"id\": \"job_0000000000000001\"}"; - private static final String readOnlyJson = "{\"status\": \"completed\",\"type\": \"verification_email\",\"created_at\": \"2016-02-23T19:57:29.532Z\",\"id\": \"job_0000000000000001\", \"connection_id\": \"conn_1\", \"connection\": \"Custom-DB-Connection\", \"format\": \"csv\", \"location\": \"https://auth0.com/jobs/\", \"percentage_done\": 89, \"time_left_seconds\": 9814, \"summary\":{\"failed\":2,\"updated\":1,\"inserted\":3,\"total\":6}, \"external_id\": \"ext_id123\"}"; - - @Test - public void shouldDeserialize() throws Exception { - Job job = fromJSON(json, Job.class); - - assertThat(job, is(notNullValue())); - assertThat(job.getId(), is("job_0000000000000001")); - assertThat(job.getStatus(), is("completed")); - assertThat(job.getType(), is("verification_email")); - assertThat(job.getCreatedAt(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Job job = fromJSON(readOnlyJson, Job.class); - MatcherAssert.assertThat(job, Matchers.is(notNullValue())); - - assertThat(job, is(notNullValue())); - assertThat(job.getId(), is("job_0000000000000001")); - assertThat(job.getStatus(), is("completed")); - assertThat(job.getType(), is("verification_email")); - assertThat(job.getCreatedAt(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(job.getFormat(), is("csv")); - assertThat(job.getConnection(), is("Custom-DB-Connection")); - assertThat(job.getConnectionId(), is("conn_1")); - assertThat(job.getLocation(), is("https://auth0.com/jobs/")); - assertThat(job.getPercentageDone(), is(89)); - assertThat(job.getTimeLeftSeconds(), is(9814)); - assertThat(job.getExternalId(), is("ext_id123")); - assertThat(job.getSummary().getFailed(), is(2)); - assertThat(job.getSummary().getUpdated(), is(1)); - assertThat(job.getSummary().getInserted(), is(3)); - assertThat(job.getSummary().getTotal(), is(6)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/jobs/UsersExportFieldTest.java b/src/test/java/com/auth0/json/mgmt/jobs/UsersExportFieldTest.java deleted file mode 100644 index 0a77740be..000000000 --- a/src/test/java/com/auth0/json/mgmt/jobs/UsersExportFieldTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.jobs; - -import com.auth0.json.JsonTest; -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.nullValue; -import static org.hamcrest.core.Is.is; - -public class UsersExportFieldTest extends JsonTest { - - private static final String json = "{\"name\": \"name_of_the_property\"}"; - private static final String readOnlyJson = "{\"name\": \"name_of_the_property\", \"export_as\": \"new_name_of_the_property\"}"; - - @Test - public void shouldDeserialize() throws Exception { - UsersExportField field = fromJSON(json, UsersExportField.class); - - assertThat(field, is(notNullValue())); - assertThat(field.getName(), is("name_of_the_property")); - assertThat(field.getExportAs(), is(nullValue())); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - UsersExportField field = fromJSON(readOnlyJson, UsersExportField.class); - MatcherAssert.assertThat(field, Matchers.is(notNullValue())); - - assertThat(field, is(notNullValue())); - assertThat(field.getName(), is("name_of_the_property")); - assertThat(field.getExportAs(), is("new_name_of_the_property")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeyTest.java b/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeyTest.java deleted file mode 100644 index 31d08a463..000000000 --- a/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeyTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EncryptionKeyTest extends JsonTest { - - private static final String json = "{\n" + - " \"kid\": \"kid\",\n" + - " \"type\": \"tenant-master-key\",\n" + - " \"state\": \"active\",\n" + - " \"created_at\": \"2024-10-16T10:50:44.107Z\",\n" + - " \"updated_at\": \"2024-10-24T06:47:24.899Z\",\n" + - " \"parent_kid\": \"pkid\",\n" + - " \"public_key\": \"pkey\"\n" + - "}"; - - private static final String readOnlyJson = "{\n" + - " \"kid\": \"kid\"\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - EncryptionKey key = fromJSON(json, EncryptionKey.class); - - assertThat(key, is(notNullValue())); - assertThat(key.getKid(), is("kid")); - assertThat(key.getType(), is("tenant-master-key")); - assertThat(key.getState(), is("active")); - assertThat(key.getCreatedAt(), is("2024-10-16T10:50:44.107Z")); - assertThat(key.getUpdatedAt(), is("2024-10-24T06:47:24.899Z")); - assertThat(key.getParentKid(), is("pkid")); - assertThat(key.getPublicKey(), is("pkey")); - } - - @Test - public void shouldSerialize() throws Exception { - EncryptionKey key = new EncryptionKey(); - key.setKid("kid"); - key.setType("tenant-master-key"); - key.setState("active"); - key.setCreatedAt("2024-10-16T10:50:44.107Z"); - key.setUpdatedAt("2024-10-24T06:47:24.899Z"); - key.setParentKid("pkid"); - key.setPublicKey("pkey"); - - String serialized = toJSON(key); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("kid", "kid")); - assertThat(serialized, JsonMatcher.hasEntry("type", "tenant-master-key")); - assertThat(serialized, JsonMatcher.hasEntry("state", "active")); - assertThat(serialized, JsonMatcher.hasEntry("created_at", "2024-10-16T10:50:44.107Z")); - assertThat(serialized, JsonMatcher.hasEntry("updated_at", "2024-10-24T06:47:24.899Z")); - assertThat(serialized, JsonMatcher.hasEntry("parent_kid", "pkid")); - assertThat(serialized, JsonMatcher.hasEntry("public_key", "pkey")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - EncryptionKey key = fromJSON(readOnlyJson, EncryptionKey.class); - - assertThat(key, is(notNullValue())); - assertThat(key.getKid(), is("kid")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeysPageTest.java b/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeysPageTest.java deleted file mode 100644 index 07ed0935f..000000000 --- a/src/test/java/com/auth0/json/mgmt/keys/EncryptionKeysPageTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EncryptionKeysPageTest extends JsonTest { - - private static final String jsonWithTotal = "{\n" + - " \"start\": 0,\n" + - " \"total\": 20,\n" + - " \"limit\": 50,\n" + - " \"keys\": [\n" + - " {\n" + - " \"kid\": \"kid-1\",\n" + - " \"type\": \"customer-provided-root-key\",\n" + - " \"state\": \"pre-activation\",\n" + - " \"created_at\": \"2024-10-24T08:02:18.029Z\",\n" + - " \"updated_at\": \"2024-10-24T08:02:18.029Z\",\n" + - " \"parent_kid\": null,\n" + - " \"public_key\": null\n" + - " },\n" + - " {\n" + - " \"kid\": \"kid-2\",\n" + - " \"type\": \"tenant-master-key\",\n" + - " \"state\": \"active\",\n" + - " \"created_at\": \"2024-10-24T06:47:23.749Z\",\n" + - " \"updated_at\": \"2024-10-24T06:47:23.749Z\",\n" + - " \"parent_kid\": \"pkid-1\",\n" + - " \"public_key\": null\n" + - " }\n" + - " ]\n" + - "}"; - - private static final String jsonWithoutTotal = "{\n" + - " \"start\": 0,\n" + - " \"limit\": 50,\n" + - " \"keys\": [\n" + - " {\n" + - " \"kid\": \"kid-1\",\n" + - " \"type\": \"customer-provided-root-key\",\n" + - " \"state\": \"pre-activation\",\n" + - " \"created_at\": \"2024-10-24T08:02:18.029Z\",\n" + - " \"updated_at\": \"2024-10-24T08:02:18.029Z\",\n" + - " \"parent_kid\": null,\n" + - " \"public_key\": null\n" + - " },\n" + - " {\n" + - " \"kid\": \"kid-2\",\n" + - " \"type\": \"tenant-master-key\",\n" + - " \"state\": \"active\",\n" + - " \"created_at\": \"2024-10-24T06:47:23.749Z\",\n" + - " \"updated_at\": \"2024-10-24T06:47:23.749Z\",\n" + - " \"parent_kid\": \"pkid-1\",\n" + - " \"public_key\": null\n" + - " }\n" + - " ]\n" + - "}"; - - @Test - public void shouldDeserializeWithTotal() throws Exception { - EncryptionKeysPage page = fromJSON(jsonWithTotal, EncryptionKeysPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(20)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getItems().get(0).getKid(), is("kid-1")); - assertThat(page.getItems().get(0).getType(), is("customer-provided-root-key")); - assertThat(page.getItems().get(0).getState(), is("pre-activation")); - assertThat(page.getItems().get(0).getCreatedAt(), is("2024-10-24T08:02:18.029Z")); - assertThat(page.getItems().get(0).getUpdatedAt(), is("2024-10-24T08:02:18.029Z")); - } - - @Test - public void shouldDeserializeWithoutTotal() throws Exception { - EncryptionKeysPage page = fromJSON(jsonWithoutTotal, EncryptionKeysPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getItems().get(0).getKid(), is("kid-1")); - assertThat(page.getItems().get(0).getType(), is("customer-provided-root-key")); - assertThat(page.getItems().get(0).getState(), is("pre-activation")); - assertThat(page.getItems().get(0).getCreatedAt(), is("2024-10-24T08:02:18.029Z")); - assertThat(page.getItems().get(0).getUpdatedAt(), is("2024-10-24T08:02:18.029Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponseTest.java b/src/test/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponseTest.java deleted file mode 100644 index c6762702c..000000000 --- a/src/test/java/com/auth0/json/mgmt/keys/EncryptionWrappingKeyResponseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EncryptionWrappingKeyResponseTest extends JsonTest { - private static final String json = "{\n" + - " \"public_key\": \"pkey\",\n" + - " \"algorithm\": \"alg\"\n" + - "}"; - - private static final String readOnlyJson = "{\n" + - " \"public_key\": \"pkey\"\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - EncryptionWrappingKeyResponse response = fromJSON(json, EncryptionWrappingKeyResponse.class); - - assertThat(response, is(notNullValue())); - assertThat(response.getPublicKey(), is("pkey")); - assertThat(response.getAlgorithm(), is("alg")); - } - - @Test - public void shouldSerialize() throws Exception { - EncryptionWrappingKeyResponse response = new EncryptionWrappingKeyResponse(); - response.setPublicKey("pkey"); - response.setAlgorithm("alg"); - - String serialized = toJSON(response); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("public_key", "pkey")); - assertThat(serialized, JsonMatcher.hasEntry("algorithm", "alg")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - EncryptionWrappingKeyResponse response = fromJSON(readOnlyJson, EncryptionWrappingKeyResponse.class); - - assertThat(response, is(notNullValue())); - assertThat(response.getPublicKey(), is("pkey")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/keys/KeyTest.java b/src/test/java/com/auth0/json/mgmt/keys/KeyTest.java deleted file mode 100644 index 1f69edb0c..000000000 --- a/src/test/java/com/auth0/json/mgmt/keys/KeyTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.json.mgmt.keys; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.time.Instant; -import java.util.Date; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class KeyTest extends JsonTest { - private final static String KEY_JSON = "src/test/resources/mgmt/key.json"; - - @Test - public void deserialize() throws Exception { - Key deserialized = fromJSON(readTextFile(KEY_JSON), Key.class); - - assertThat(deserialized.getKid(), is("21hi274Rp02112mgkUGma")); - assertThat(deserialized.getCert(), is("-----BEGIN CERTIFICATE-----\r\nMIIDDTCCA...YiA0TQhAt8=\r\n-----END CERTIFICATE-----")); - assertThat(deserialized.getPkcs7(), is("-----BEGIN PKCS7-----\r\nMIIDPA....t8xAA==\r\n-----END PKCS7-----")); - assertThat(deserialized.getCurrent(), is(true)); - assertThat(deserialized.getNext(), is(false)); - assertThat(deserialized.getPrevious(), is(false)); - assertThat(deserialized.getCurrentSince(), is(parseJSONDate("2021-08-16T20:26:42.253086110Z"))); - assertThat(deserialized.getCurrentUntil(), is(parseJSONDate("2021-08-16T20:26:42.253086110Z"))); - assertThat(deserialized.getFingerprint(), is("CC:FB:DD:D8:9A:B5:DE:1B:F0:CC:36:D2:99:59:21:12:03:DD:A8:25")); - assertThat(deserialized.getThumbprint(), is("CCFBDDD89AB5DE1BF0CC36D29959211203DDA825")); - assertThat(deserialized.getRevoked(), is(false)); - assertThat(deserialized.getRevokedAt(), is(parseJSONDate("2021-08-16T20:26:42.253086110Z"))); - } - - @Test - public void serialize() throws Exception { - Key key = new Key(); - key.setKid("21hi274Rp02112mgkUGma"); - key.setCert("-----BEGIN CERTIFICATE-----\r\nMIIDDTCCA...YiA0TQhAt8=\r\n-----END CERTIFICATE-----"); - key.setPkcs7("-----BEGIN PKCS7-----\r\nMIIDPA....t8xAA==\r\n-----END PKCS7-----"); - key.setCurrent(true); - key.setNext(false); - key.setPrevious(false); - key.setCurrentSince(Date.from(Instant.parse("2016-12-05T15:15:40.545Z"))); - key.setCurrentUntil(Date.from(Instant.parse("2016-12-05T15:15:40.545Z"))); - key.setFingerprint("CC:FB:DD:D8:9A:B5:DE:1B:F0:CC:36:D2:99:59:21:12:03:DD:A8:25"); - key.setThumbprint("CCFBDDD89AB5DE1BF0CC36D29959211203DDA825"); - key.setRevoked(false); - key.setRevokedAt(Date.from(Instant.parse("2016-12-05T15:15:40.545Z"))); - - String json = toJSON(key); - - assertThat(json, hasEntry("kid", "21hi274Rp02112mgkUGma")); - assertThat(json, hasEntry("cert", "-----BEGIN CERTIFICATE-----\\r\\nMIIDDTCCA...YiA0TQhAt8=\\r\\n-----END CERTIFICATE-----")); - assertThat(json, hasEntry("pkcs7", "-----BEGIN PKCS7-----\\r\\nMIIDPA....t8xAA==\\r\\n-----END PKCS7-----")); - assertThat(json, hasEntry("current", true)); - assertThat(json, hasEntry("next", false)); - assertThat(json, hasEntry("previous", false)); - assertThat(json, hasEntry("fingerprint", "CC:FB:DD:D8:9A:B5:DE:1B:F0:CC:36:D2:99:59:21:12:03:DD:A8:25")); - assertThat(json, hasEntry("thumbprint", "CCFBDDD89AB5DE1BF0CC36D29959211203DDA825")); - assertThat(json, hasEntry("revoked", false)); - assertThat(json, hasEntry("current_since", "2016-12-05T15:15:40.545+00:00")); - assertThat(json, hasEntry("current_until", "2016-12-05T15:15:40.545+00:00")); - assertThat(json, hasEntry("revoked_at", "2016-12-05T15:15:40.545+00:00")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java b/src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java deleted file mode 100644 index fafcf175c..000000000 --- a/src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.auth0.json.mgmt.logevents; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class LogEventTest extends JsonTest { - - private static final String json = "{\n" + - " \"_id\": \"123\",\n" + - " \"log_id\": \"123\",\n" + - " \"date\": \"2016-02-23T19:57:29.532Z\",\n" + - " \"type\": \"thetype\",\n" + - " \"location_info\": {},\n" + - " \"details\": {},\n" + - " \"client_id\": \"clientId\",\n" + - " \"client_name\": \"clientName\",\n" + - " \"ip\": \"233.233.233.11\",\n" + - " \"user_id\": \"userId\",\n" + - " \"user_name\": \"userName\",\n" + - " \"connection\": \"connection\",\n" + - " \"connection_id\": \"connectionId\",\n" + - " \"description\": \"description\",\n" + - " \"hostname\": \"hostname\",\n" + - " \"audience\": \"audience\",\n" + - " \"organization_id\": \"org_1\",\n" + - " \"organization_name\": \"org2\",\n" + - " \"$event_schema\": {\n" + - " \"version\": \"1.0.0\"\n" + - " },\n" + - " \"tenant_name\": \"paid-testing\",\n" + - " \"audience\": \"audience\",\n" + - " \"isMobile\": \"false\",\n" + - " \"user_agent\": \"okhttp 4.11.0 / Other 0.0.0\",\n" + - " \"scope\": [\"read:client_grants\", \"create:client_grants\"]\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - LogEvent logEvent = fromJSON(json, LogEvent.class); - - assertThat(logEvent, is(notNullValue())); - assertThat(logEvent.getId(), is("123")); - assertThat(logEvent.getLogId(), is("123")); - assertThat(logEvent.getDate(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(logEvent.getType(), is("thetype")); - assertThat(logEvent.getClientId(), is("clientId")); - assertThat(logEvent.getClientName(), is("clientName")); - assertThat(logEvent.getIP(), is("233.233.233.11")); - assertThat(logEvent.getUserId(), is("userId")); - assertThat(logEvent.getUserName(), is("userName")); - assertThat(logEvent.getLocationInfo(), is(notNullValue())); - assertThat(logEvent.getDetails(), is(notNullValue())); - assertThat(logEvent.getAudience(), is("audience")); - assertThat(logEvent.getConnection(), is("connection")); - assertThat(logEvent.getConnectionId(), is("connectionId")); - assertThat(logEvent.getHostname(), is("hostname")); - assertThat(logEvent.getDescription(), is("description")); - assertThat(logEvent.isMobile(), is(false)); - assertThat(logEvent.getUserAgent(), is("okhttp 4.11.0 / Other 0.0.0")); - assertThat(logEvent.getOrganizationId(), is("org_1")); - assertThat(logEvent.getOrganizationName(), is("org2")); - assertThat(logEvent.getTenantName(), is("paid-testing")); - assertThat(logEvent.getEventSchema(), is(notNullValue())); - assertThat(logEvent.getScope(), is(Arrays.asList("read:client_grants", "create:client_grants"))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/logevents/LogEventsPageTest.java b/src/test/java/com/auth0/json/mgmt/logevents/LogEventsPageTest.java deleted file mode 100644 index b0856f350..000000000 --- a/src/test/java/com/auth0/json/mgmt/logevents/LogEventsPageTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.logevents; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class LogEventsPageTest extends JsonTest { - private static final String jsonWithTotals = "{\"start\":0,\"length\":10,\"total\":14,\"limit\":50,\"logs\":[{\"date\":\"2017-01-13T17:05:03.382Z\",\"type\":\"s\",\"connection\":\"Username-Password-Authentication\",\"connection_id\":\"con_0l1cXsZE7Ati0y\",\"client_id\":\"Owu62gnGsRYhk1v9SfB3IJcRIze\",\"client_name\":\"Auth0\",\"ip\":\"181.008.186.8\",\"user_agent\":\"Chrome 55.0.2883 / Mac OS X 10.12.2\",\"details\":{\"stats\":{\"loginsCount\":368}},\"user_id\":\"auth0|789789\",\"user_name\":\"asdasd\",\"strategy\":\"auth0\",\"strategy_type\":\"database\",\"_id\":\"7878787878978798789\",\"isMobile\":false}]}"; - private static final String jsonWithoutTotals = "[{\"date\":\"2017-01-13T17:05:03.382Z\",\"type\":\"s\",\"connection\":\"Username-Password-Authentication\",\"connection_id\":\"con_0l1cXsZE7Ati0yrT\",\"client_id\":\"Owu62gnGsRYhk1v9SfB3c6IUbIJcRIze\",\"client_name\":\"Auth0.Android/LockDemo\",\"ip\":\"181.47.186.202\",\"user_agent\":\"Chrome 55.0.2883 / Mac OS X 10.12.2\",\"details\":{\"stats\":{\"loginsCount\":368}},\"user_id\":\"auth0|5751d11a85a56dd86c460726\",\"user_name\":\"asdasd\",\"strategy\":\"auth0\",\"strategy_type\":\"database\",\"_id\":\"49560429270835143462013614719763219271357328593426317314\",\"isMobile\":false}]"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - LogEventsPage page = fromJSON(jsonWithoutTotals, LogEventsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - LogEventsPage page = fromJSON(jsonWithTotals, LogEventsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(10)); - assertThat(page.getTotal(), is(14)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/logstreams/LogStreamsTest.java b/src/test/java/com/auth0/json/mgmt/logstreams/LogStreamsTest.java deleted file mode 100644 index c02402609..000000000 --- a/src/test/java/com/auth0/json/mgmt/logstreams/LogStreamsTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.auth0.json.mgmt.logstreams; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class LogStreamsTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String httpSinkJson = "{\"id\": \"123\",\"name\": \"my http log stream\",\"type\": \"http\",\"status\":\"active\",\"sink\": {\"httpContentFormat\": \"JSONLINES\",\"httpContentType\": \"application/json\",\"httpEndpoint\": \"https://me.org\",\"httpAuthorization\": \"abc123\"}}"; - LogStream logStream = fromJSON(httpSinkJson, LogStream.class); - - assertThat(logStream, is(notNullValue())); - assertThat(logStream.getId(), is("123")); - assertThat(logStream.getName(), is("my http log stream")); - assertThat(logStream.getType(), is("http")); - assertThat(logStream.getStatus(), is("active")); - assertThat(logStream.getSink(), is(notNullValue())); - assertThat(logStream.getSink().size(), is(4)); - assertThat(logStream.getSink(), hasEntry("httpContentFormat", "JSONLINES")); - assertThat(logStream.getSink(), hasEntry("httpContentType", "application/json")); - assertThat(logStream.getSink(), hasEntry("httpEndpoint", "https://me.org")); - assertThat(logStream.getSink(), hasEntry("httpAuthorization", "abc123")); - } - - @Test - public void shouldDeserializeWithDifferentObjectTypes() throws Exception { - String json = "{\"id\": \"123\",\"name\": \"my http log stream\",\"type\": \"http\",\"status\":\"active\",\"sink\": {\"boolean\": true,\"array\": [\"one\",\"two\"],\"object\": {\"key1\":\"val1\",\"key2\":\"val2\"}}}"; - LogStream logStream = fromJSON(json, LogStream.class); - - assertThat(logStream, is(notNullValue())); - assertThat(logStream.getSink(), is(notNullValue())); - assertThat(logStream.getSink().size(), is(3)); - assertThat(logStream.getSink(), hasEntry("boolean", true)); - assertThat(logStream.getSink(), hasEntry("array", Arrays.asList("one","two"))); - - Map objectMap = new HashMap<>(); - objectMap.put("key1", "val1"); - objectMap.put("key2", "val2"); - assertThat(logStream.getSink(), hasEntry("object", objectMap)); - } - - @Test - public void shouldSerialize() throws Exception { - LogStream logStream = new LogStream("http"); - logStream.setName("My Http Log Stream"); - - Map sink = new HashMap<>(); - sink.put("httpContentFormat", "JSONLINES"); - sink.put("httpContentType", "application/json"); - sink.put("httpEndpoint", "https://me.org"); - sink.put("httpAuthorization", "abc123"); - logStream.setSink(sink); - - String serialized = toJSON(logStream); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "My Http Log Stream")); - assertThat(serialized, JsonMatcher.hasEntry("type", "http")); - assertThat(serialized, JsonMatcher.hasEntry("sink", sink)); - } - - @Test - public void shouldSerializeWithDifferentObjectTypes() throws Exception { - LogStream logStream = new LogStream("http"); - logStream.setName("My Log Stream"); - - Map sink = new HashMap<>(); - sink.put("boolean", true); - sink.put("array", Arrays.asList("one", 2)); - sink.put("object", Collections.singletonMap("key", "val")); - logStream.setSink(sink); - - String serialized = toJSON(logStream); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "My Log Stream")); - assertThat(serialized, JsonMatcher.hasEntry("type", "http")); - assertThat(serialized, JsonMatcher.hasEntry("sink", sink)); - } - - @Test - public void shouldDeserializeReadOnlyData() throws Exception { - String readOnlyJson = "{\"id\":\"logStreamId\",\"type\":\"http\"}"; - - LogStream logStream = fromJSON(readOnlyJson, LogStream.class); - assertThat(logStream, is(notNullValue())); - assertThat(logStream.getId(), is("logStreamId")); - assertThat(logStream.getType(), is("http")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageTest.java b/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageTest.java deleted file mode 100644 index ed39d9156..000000000 --- a/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsPageTest.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class NetworkAclsPageTest extends JsonTest { - - private static final String jsonWithTotal = "{\n" + - " \"total\": 2,\n" + - " \"start\": 0,\n" + - " \"limit\": 2,\n" + - " \"network_acls\": [\n" + - " {\n" + - " \"description\": \"Log America and Canada all the time.\",\n" + - " \"active\": true,\n" + - " \"priority\": 1,\n" + - " \"rule\": {\n" + - " \"match\": {\n" + - " \"geo_country_codes\": [\n" + - " \"US\",\n" + - " \"CA\"\n" + - " ]\n" + - " },\n" + - " \"scope\": \"authentication\",\n" + - " \"action\": {\n" + - " \"log\": true\n" + - " }\n" + - " },\n" + - " \"created_at\": \"2025-03-17T12:31:57.782Z\",\n" + - " \"updated_at\": \"2025-03-17T12:31:57.782Z\",\n" + - " \"id\": \"acl_1\"\n" + - " },\n" + - " {\n" + - " \"description\": \"Test Desc - 1\",\n" + - " \"active\": true,\n" + - " \"priority\": 10,\n" + - " \"rule\": {\n" + - " \"match\": {\n" + - " \"ipv4_cidrs\": [\n" + - " \"198.0.0.0\",\n" + - " \"10.0.0.0/24\"\n" + - " ]\n" + - " },\n" + - " \"scope\": \"management\",\n" + - " \"action\": {\n" + - " \"block\": true\n" + - " }\n" + - " },\n" + - " \"created_at\": \"2025-06-10T06:18:10.277Z\",\n" + - " \"updated_at\": \"2025-06-10T06:18:10.277Z\",\n" + - " \"id\": \"acl_2\"\n" + - " }\n" + - " ]\n" + - "}"; - - private static final String jsonWithoutTotal = "[\n" + - " {\n" + - " \"description\": \"Test Desc - 1\",\n" + - " \"active\": true,\n" + - " \"priority\": 10,\n" + - " \"rule\": {\n" + - " \"match\": {\n" + - " \"ipv4_cidrs\": [\n" + - " \"198.0.0.0\",\n" + - " \"10.0.0.0/24\"\n" + - " ]\n" + - " },\n" + - " \"scope\": \"management\",\n" + - " \"action\": {\n" + - " \"block\": true\n" + - " }\n" + - " },\n" + - " \"created_at\": \"2025-06-10T06:18:10.277Z\",\n" + - " \"updated_at\": \"2025-06-10T06:18:10.277Z\",\n" + - " \"id\": \"acl_1\"\n" + - " }\n" + - "]"; - - @Test - public void shouldDeserializeWithTotal() throws Exception { - NetworkAclsPage page = fromJSON(jsonWithTotal, NetworkAclsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(2)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getItems().get(0).getDescription(), is("Log America and Canada all the time.")); - assertThat(page.getItems().get(0).isActive(), is(true)); - assertThat(page.getItems().get(0).getPriority(), is(1)); - assertThat(page.getItems().get(0).getId(), is("acl_1")); - assertThat(page.getItems().get(0).getCreatedAt(), is("2025-03-17T12:31:57.782Z")); - assertThat(page.getItems().get(0).getUpdatedAt(), is("2025-03-17T12:31:57.782Z")); - } - - @Test - public void shouldDeserializeWithoutTotal() throws Exception { - NetworkAclsPage page = fromJSON(jsonWithoutTotal, NetworkAclsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - assertThat(page.getItems().get(0).getDescription(), is("Test Desc - 1")); - assertThat(page.getItems().get(0).isActive(), is(true)); - assertThat(page.getItems().get(0).getPriority(), is(10)); - assertThat(page.getItems().get(0).getId(), is("acl_1")); - assertThat(page.getItems().get(0).getCreatedAt(), is("2025-06-10T06:18:10.277Z")); - assertThat(page.getItems().get(0).getUpdatedAt(), is("2025-06-10T06:18:10.277Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsTest.java b/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsTest.java deleted file mode 100644 index 5b7abb9dd..000000000 --- a/src/test/java/com/auth0/json/mgmt/networkacls/NetworkAclsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.auth0.json.mgmt.networkacls; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class NetworkAclsTest extends JsonTest { - - private final static String NETWORK_ACLS_JSON = "src/test/resources/mgmt/network_acls.json"; - - @Test - public void deserialize() throws Exception { - NetworkAcls deserialized = fromJSON(readTextFile(NETWORK_ACLS_JSON), NetworkAcls.class); - - assertThat(deserialized.getDescription(), is("Log America and Canada all the time.")); - assertThat(deserialized.isActive(), is(true)); - assertThat(deserialized.getPriority(), is(1)); - assertThat(deserialized.getId(), is("acl_1")); - assertThat(deserialized.getCreatedAt(), is("2025-03-17T12:31:57.782Z")); - assertThat(deserialized.getUpdatedAt(), is("2025-03-17T12:31:57.782Z")); - } - - @Test - public void serialize() throws Exception { - NetworkAcls networkAcls = new NetworkAcls(); - networkAcls.setDescription("Log America and Canada all the time."); - networkAcls.setActive(true); - networkAcls.setPriority(1); - - Rule rule = new Rule(); - Match match = new Match(); - match.setGeoCountryCodes(Arrays.asList("US", "CA")); - rule.setMatch(match); - rule.setScope("authentication"); - Action action = new Action(); - action.setLog(true); - rule.setAction(action); - - networkAcls.setRule(rule); - - String json = toJSON(networkAcls); - - assertThat(json, hasEntry("description", "Log America and Canada all the time.")); - assertThat(json, hasEntry("active", true)); - assertThat(json, hasEntry("priority", 1)); - assertThat(json, hasEntry("rule", notNullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java deleted file mode 100644 index 8bfe75295..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class EnabledConnectionsPageTest extends JsonTest { - - private static String jsonWithoutTotals = "[\n" + - " {\n" + - " \"connection_id\": \"con_1\",\n" + - " \"assign_membership_on_login\": false,\n" + - " \"is_signup_enabled\": true,\n" + - " \"connection\": {\n" + - " \"name\": \"google-oauth2\",\n" + - " \"strategy\": \"google-oauth2\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"connection_id\": \"con_2\",\n" + - " \"assign_membership_on_login\": true,\n" + - " \"is_signup_enabled\": true,\n" + - " \"connection\": {\n" + - " \"name\": \"Username-Password-Authentication\",\n" + - " \"strategy\": \"auth0\"\n" + - " }\n" + - " }\n" + - "]"; - - private static String jsonWithTotals = "{\n" + - " \"enabled_connections\": [\n" + - " {\n" + - " \"connection_id\": \"con_1\",\n" + - " \"assign_membership_on_login\": false,\n" + - " \"is_signup_enabled\": true,\n" + - " \"connection\": {\n" + - " \"name\": \"google-oauth2\",\n" + - " \"strategy\": \"google-oauth2\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"connection_id\": \"con_2\",\n" + - " \"assign_membership_on_login\": true,\n" + - " \"is_signup_enabled\": true,\n" + - " \"connection\": {\n" + - " \"name\": \"Username-Password-Authentication\",\n" + - " \"strategy\": \"auth0\"\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"start\": 0,\n" + - " \"limit\": 2,\n" + - " \"total\": 2\n" + - "}"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - EnabledConnectionsPage page = fromJSON(jsonWithoutTotals, EnabledConnectionsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - EnabledConnectionsPage page = fromJSON(jsonWithTotals, EnabledConnectionsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(2)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java deleted file mode 100644 index 49017692d..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EnabledConnectionsTest extends JsonTest { - - @Test - public void shouldSerialize() throws Exception { - Connection connection = new Connection(); - connection.setName("con_1"); - connection.setStrategy("strategy"); - - EnabledConnection enabledConnection = new EnabledConnection(); - enabledConnection.setAssignMembershipOnLogin(true); - enabledConnection.setConnection(connection); - enabledConnection.setSignupEnabled(true); - - String serialized = toJSON(enabledConnection); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("assign_membership_on_login", true)); - assertThat(serialized, JsonMatcher.hasEntry("connection", is(notNullValue()))); - - Map connectionMap = new HashMap<>(); - connectionMap.put("name", "con_1"); - connectionMap.put("strategy", "strategy"); - assertThat(serialized, JsonMatcher.hasEntry("connection", connectionMap)); - } - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"connection_id\": \"con_id\",\n" + - " \"assign_membership_on_login\": false,\n" + - " \"is_signup_enabled\": true,\n" + - " \"connection\": {\n" + - " \"name\": \"google-oauth2\",\n" + - " \"strategy\": \"google-oauth2\"\n" + - " }\n" + - " }"; - - EnabledConnection enabledConnection = fromJSON(json, EnabledConnection.class); - assertThat(enabledConnection, is(notNullValue())); - assertThat(enabledConnection.getConnectionId(), is("con_id")); - assertThat(enabledConnection.isAssignMembershipOnLogin(), is(false)); - assertThat(enabledConnection.getSignupEnabled(), is(true)); - assertThat(enabledConnection.getConnection(), is(notNullValue())); - assertThat(enabledConnection.getConnection().getName(), is("google-oauth2")); - assertThat(enabledConnection.getConnection().getStrategy(), is("google-oauth2")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/InvitationTest.java b/src/test/java/com/auth0/json/mgmt/organizations/InvitationTest.java deleted file mode 100644 index ad4a60864..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/InvitationTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class InvitationTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"id\": \"inv_1\",\n" + - " \"client_id\": \"client-id\",\n" + - " \"inviter\": {\n" + - " \"name\": \"timmy\"\n" + - " },\n" + - " \"invitee\": {\n" + - " \"email\": \"timmy@domain.com\"\n" + - " },\n" + - " \"invitation_url\": \"https://somedomain.com\",\n" + - " \"ticket_id\": \"ticket-id\",\n" + - " \"created_at\": \"2021-03-31T19:08:40.295Z\",\n" + - " \"expires_at\": \"2021-04-07T19:08:40.295Z\",\n" + - " \"organization_id\": \"org_abc\",\n" + - " \"roles\": [\n" + - " \"rol_0987\"\n" + - " ]\n" + - "}\n"; - - Invitation invitation = fromJSON(json, Invitation.class); - - assertThat(invitation, is(notNullValue())); - assertThat(invitation.getRoles().getRoles(), is(contains("rol_0987"))); - assertThat(invitation.getId(), is("inv_1")); - assertThat(invitation.getClientId(), is("client-id")); - assertThat(invitation.getInviter(), is(notNullValue())); - assertThat(invitation.getInviter().getName(), is("timmy")); - assertThat(invitation.getInvitee(), is(notNullValue())); - assertThat(invitation.getInvitee().getEmail(), is("timmy@domain.com")); - assertThat(invitation.getInvitationUrl(), is("https://somedomain.com")); - assertThat(invitation.getTicketId(), is("ticket-id")); - assertThat(invitation.getCreatedAt(), is(parseJSONDate("2021-03-31T19:08:40.295Z"))); - assertThat(invitation.getExpiresAt(), is(parseJSONDate("2021-04-07T19:08:40.295Z"))); - assertThat(invitation.getOrganizationId(), is("org_abc")); - } - - @Test - public void shouldSerialize() throws Exception { - Map appMetadata = Collections.singletonMap("app1", "val1"); - Map userMetadata = Collections.singletonMap("user1", "val1"); - List rolesList = Arrays.asList("role-1", "role-2"); - - Invitation invitation = new Invitation(new Inviter("name"), new Invitee("joe@domain.com"), "client-id"); - invitation.setSendInvitationEmail(true); - invitation.setAppMetadata(appMetadata); - invitation.setUserMetadata(userMetadata); - invitation.setConnectionId("connId"); - invitation.setRoles(new Roles(rolesList)); - invitation.setTtlInSeconds(41); - - String serialized = toJSON(invitation); - - assertThat(serialized, is(notNullValue())); - System.out.println(serialized); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client-id")); - assertThat(serialized, JsonMatcher.hasEntry("ttl_sec", 41)); - assertThat(serialized, JsonMatcher.hasEntry("connection_id", "connId")); - assertThat(serialized, JsonMatcher.hasEntry("send_invitation_email", true)); - assertThat(serialized, JsonMatcher.hasEntry("roles", rolesList)); - assertThat(serialized, JsonMatcher.hasEntry("app_metadata", appMetadata)); - assertThat(serialized, JsonMatcher.hasEntry("user_metadata", userMetadata)); - assertThat(serialized, JsonMatcher.hasEntry("inviter", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("invitee", is(notNullValue()))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/InvitationsPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/InvitationsPageTest.java deleted file mode 100644 index 4ec1e27c3..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/InvitationsPageTest.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class InvitationsPageTest extends JsonTest { - - private static final String jsonWithoutTotals = "[\n" + - " {\n" + - " \"id\": \"uinv_Q3lgZ0a99aY7Rqs3\",\n" + - " \"client_id\": \"klCnbSD1U1Yd0333dvEAFMwDoOX5bfsb\",\n" + - " \"inviter\": {\n" + - " \"name\": \"dave!\"\n" + - " },\n" + - " \"invitee\": {\n" + - " \"email\": \"dave@domain.com\"\n" + - " },\n" + - " \"invitation_url\": \"https://some-domain.auth0.com/login?invitation=U0o1uoXAl1VPkKbZlaRWEWJadkeed1E&organization=org_W3OHp07dfbjhHuWK&organization_name=timmy-org\",\n" + - " \"ticket_id\": \"U0o1uoXAl1VPkKbZla0a833soMUMOo1E\",\n" + - " \"created_at\": \"2021-03-31T19:08:40.295Z\",\n" + - " \"expires_at\": \"2021-04-07T19:08:40.295Z\",\n" + - " \"organization_id\": \"org_W30s833MRbjhHuWK\"\n" + - " },\n" + - " {\n" + - " \"id\": \"uinv_Q3lgZ0a99aY7Rqs3\",\n" + - " \"client_id\": \"klCnbSD1U1Yd0333dvEAFMwDoOX5bfsb\",\n" + - " \"inviter\": {\n" + - " \"name\": \"jim.anderson@auth0.com\"\n" + - " },\n" + - " \"invitee\": {\n" + - " \"email\": \"jim.anderson+android@auth0.com\"\n" + - " },\n" + - " \"app_metadata\": {},\n" + - " \"user_metadata\": {},\n" + - " \"invitation_url\": \"https://some-domain.auth0.com/login?invitation=U0o1uoXAl1VPkKbZlaRWEWJadkeed1E&organization=org_W3OHp07dfbjhHuWK&organization_name=timmy-org\",\n" + - " \"ticket_id\": \"U0o1uoXAl1VPkK0a940a833soMUMOo1E\",\n" + - " \"created_at\": \"2021-03-31T17:59:23.132Z\",\n" + - " \"expires_at\": \"2021-04-07T17:59:23.132Z\",\n" + - " \"organization_id\": \"org_W30s833MRbjhHuWK\"\n" + - " }\n" + - "]\n"; - - private static final String jsonWithTotals = "{\n" + - " \"invitations\": [\n" + - " {\n" + - " \"id\": \"uinv_Q3lgZ0a99aY7Rqs3\",\n" + - " \"client_id\": \"klCnbSD1U1Yd0333dvEAFMwDoOX5bfsb\",\n" + - " \"inviter\": {\n" + - " \"name\": \"dave!\"\n" + - " },\n" + - " \"invitee\": {\n" + - " \"email\": \"dave@domain.com\"\n" + - " },\n" + - " \"invitation_url\": \"https://some-domain.auth0.com/login?invitation=U0o1uoXAl1VPkKbZlaRWEWJadkeed1E&organization=org_W3OHp07dfbjhHuWK&organization_name=timmy-org\",\n" + - " \"ticket_id\": \"U0o1uoXAl1VPkKbZla0a833soMUMOo1E\",\n" + - " \"created_at\": \"2021-03-31T19:08:40.295Z\",\n" + - " \"expires_at\": \"2021-04-07T19:08:40.295Z\",\n" + - " \"organization_id\": \"org_W30s833MRbjhHuWK\"\n" + - " },\n" + - " {\n" + - " \"id\": \"uinv_Q3lgZ0a99aY7Rqs3\",\n" + - " \"client_id\": \"klCnbSD1U1Yd0333dvEAFMwDoOX5bfsb\",\n" + - " \"inviter\": {\n" + - " \"name\": \"jim.anderson@auth0.com\"\n" + - " },\n" + - " \"invitee\": {\n" + - " \"email\": \"jim.anderson+android@auth0.com\"\n" + - " },\n" + - " \"app_metadata\": {},\n" + - " \"user_metadata\": {},\n" + - " \"invitation_url\": \"https://some-domain.auth0.com/login?invitation=U0o1uoXAl1VPkKbZlaRWEWJadkeed1E&organization=org_W3OHp07dfbjhHuWK&organization_name=timmy-org\",\n" + - " \"ticket_id\": \"U0o1uoXAl1VPkK0a940a833soMUMOo1E\",\n" + - " \"created_at\": \"2021-03-31T17:59:23.132Z\",\n" + - " \"expires_at\": \"2021-04-07T17:59:23.132Z\",\n" + - " \"organization_id\": \"org_W30s833MRbjhHuWK\"\n" + - " }\n" + - " ],\n" + - " \"start\": 0,\n" + - " \"limit\": 4\n" + - "}\n"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - InvitationsPage page = fromJSON(jsonWithoutTotals, InvitationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - InvitationsPage page = fromJSON(jsonWithTotals, InvitationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getLimit(), is(4)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/MembersPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/MembersPageTest.java deleted file mode 100644 index 5308e132e..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/MembersPageTest.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class MembersPageTest extends JsonTest { - private static final String jsonWithoutTotals = "[\n" + - " {\n" + - " \"user_id\": \"auth0|605a1f57cbeb2c0070fdf123\",\n" + - " \"email\": \"dave@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"dave\"\n" + - " },\n" + - " {\n" + - " \"user_id\": \"auth0|605a0fc1bef67f006851a123\",\n" + - " \"email\": \"eric@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"eric\"\n" + - " }\n" + - "]\n"; - - private static final String jsonWithTotals = "{\n" + - " \"members\": [\n" + - " {\n" + - " \"user_id\": \"auth0|605a1f57cbeb2c0070fdf123\",\n" + - " \"email\": \"dave@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"dave\"\n" + - " },\n" + - " {\n" + - " \"user_id\": \"auth0|605a0fc1bef67f006851a123\",\n" + - " \"email\": \"eric@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"eric\"\n" + - " }\n" + - " ],\n" + - " \"start\": 0,\n" + - " \"limit\": 20,\n" + - " \"total\": 2\n" + - "}\n"; - - private static final String jsonWithCheckpointPageResponse = "{\n" + - " \"members\": [\n" + - " {\n" + - " \"user_id\": \"auth0|605a1f57cbeb2c0070fdf123\",\n" + - " \"email\": \"dave@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"dave\"\n" + - " },\n" + - " {\n" + - " \"user_id\": \"auth0|605a0fc1bef67f006851a123\",\n" + - " \"email\": \"eric@domain.com\",\n" + - " \"picture\": \"https://domain.com/img.png\",\n" + - " \"name\": \"eric\"\n" + - " }\n" + - " ],\n" + - " \"next\": \"MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw\"\n" + - "}\n"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - MembersPage page = fromJSON(jsonWithoutTotals, MembersPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - MembersPage page = fromJSON(jsonWithTotals, MembersPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(20)); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldDeserializeWithNextItemPointer() throws Exception { - MembersPage page = fromJSON(jsonWithCheckpointPageResponse, MembersPage.class); - - assertThat(page, is(notNullValue())); - - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getNext(), is("MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw")); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldBeCreatedWithoutNextField() { - MembersPage page = new MembersPageDeserializer().createPage(0, 5, 20, 50, new ArrayList<>()); - - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(5)); - assertThat(page.getTotal(), is(20)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - } -} - diff --git a/src/test/java/com/auth0/json/mgmt/organizations/MembersTest.java b/src/test/java/com/auth0/json/mgmt/organizations/MembersTest.java deleted file mode 100644 index a70c7e350..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/MembersTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class MembersTest extends JsonTest { - - @Test - public void shouldSerialize() throws Exception { - Member member = new Member(); - member.setEmail("email@domain.com"); - member.setName("name"); - member.setPicture("https://myprofilepic.com"); - - String serialized = toJSON(member); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("email", "email@domain.com")); - assertThat(serialized, JsonMatcher.hasEntry("name", "name")); - assertThat(serialized, JsonMatcher.hasEntry("picture", "https://myprofilepic.com")); - } - - @Test - public void shouldDeserialize() throws Exception { - String memberJson = "{\n" + - " \"user_id\": \"user_123\",\n" + - " \"email\": \"fred@domain.com\",\n" + - " \"picture\": \"https://profilepic.com/mypic.png\",\n" + - " \"name\": \"fred\",\n" + - " \"roles\": [\n" + - " {\n" + - " \"id\": \"rol_abc\",\n" + - " \"name\": \"test role\"\n" + - " }\n" + - " ]" + - "}"; - - Member member = fromJSON(memberJson, Member.class); - assertThat(member, is(notNullValue())); - assertThat(member.getUserId(), is("user_123")); - assertThat(member.getEmail(), is("fred@domain.com")); - assertThat(member.getPicture(), is("https://profilepic.com/mypic.png")); - assertThat(member.getName(), is("fred")); - assertThat(member.getRoles().size(), is(1)); - assertThat(member.getRoles().get(0).getName(), is("test role")); - assertThat(member.getRoles().get(0).getId(), is("rol_abc")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantTest.java b/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantTest.java deleted file mode 100644 index 5d44821f0..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class OrganizationClientGrantTest extends JsonTest { - - @Test - public void shouldSerialize() throws Exception { - OrganizationClientGrant clientGrant = new OrganizationClientGrant(); - clientGrant.setClientId("client-id"); - clientGrant.setAudience("https://api-identifier/"); - clientGrant.setScope(Arrays.asList("read:messages", "write:messages")); - - String serialized = toJSON(clientGrant); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client-id")); - assertThat(serialized, JsonMatcher.hasEntry("audience", "https://api-identifier/")); - assertThat(serialized, JsonMatcher.hasEntry("scope", Arrays.asList("read:messages", "write:messages"))); - } - - @Test - public void shouldDeserialize() throws Exception { - String json = "{\n" + - " \"id\": \"1\",\n" + - " \"client_id\": \"clientId1\",\n" + - " \"audience\": \"audience1\",\n" + - " \"scope\": [\n" + - " \"openid\",\n" + - " \"profile\"\n" + - " ]\n" + - "}"; - - OrganizationClientGrant clientGrant = fromJSON(json, OrganizationClientGrant.class); - - assertThat(clientGrant, is(notNullValue())); - - assertThat(clientGrant.getAudience(), is("audience1")); - assertThat(clientGrant.getClientId(), is("clientId1")); - assertThat(clientGrant.getScope(), contains("openid", "profile")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageTest.java deleted file mode 100644 index 89aa3fe9f..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationClientGrantsPageTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class OrganizationClientGrantsPageTest extends JsonTest { - - private static final String JSON_WITHOUT_TOTALS = "[\n" + - " {\n" + - " \"id\": \"cgr_4pI9a42haOLLWnwq\",\n" + - " \"client_id\": \"client-id\",\n" + - " \"audience\": \"https://api-identifier\",\n" + - " \"scope\": [\n" + - " \"update:items\",\n" + - " \"read:messages\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"id\": \"cgr_D018f9kmBmwbZod\",\n" + - " \"client_id\": \"client-id\",\n" + - " \"audience\": \"https://api-identifier\",\n" + - " \"scope\": []\n" + - " }\n" + - "]"; - - private static final String JSON_WITH_TOTALS = "{\n" + - " \"total\": 13,\n" + - " \"start\": 0,\n" + - " \"limit\": 1,\n" + - " \"client_grants\": [\n" + - " {\n" + - " \"id\": \"cgr_3aidkk3skLVOM3Ay7\",\n" + - " \"client_id\": \"client-id\",\n" + - " \"audience\": \"https://api-identifier/\",\n" + - " \"scope\": [\n" + - " \"read:messages\"\n" + - " ]\n" + - " }\n" + - " ]\n" + - "}"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - OrganizationClientGrantsPage page = fromJSON(JSON_WITHOUT_TOTALS, OrganizationClientGrantsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - OrganizationClientGrantsPage page = fromJSON(JSON_WITH_TOTALS, OrganizationClientGrantsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(13)); - assertThat(page.getLimit(), is(1)); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsPageTest.java deleted file mode 100644 index db9a5f8bb..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsPageTest.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class OrganizationsPageTest extends JsonTest { - - private static final String jsonWithoutTotals = "[\n" + - " {\n" + - " \"id\": \"org_1\",\n" + - " \"name\": \"org-1\",\n" + - " \"display_name\": \"org 1\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://some-url.com/\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#FF0000\",\n" + - " \"page_background\": \"#FF0000\"\n" + - " }\n" + - " },\n" + - " \"metadata\": {\n" + - " \"key1\": \"val1\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-2\",\n" + - " \"display_name\": \"org 2\"\n" + - " }\n" + - "]"; - - private static final String jsonWithTotals = "{\n" + - " \"organizations\": [\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-1\",\n" + - " \"display_name\": \"org 1\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://some-url.com/\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#FF0000\",\n" + - " \"page_background\": \"#FF0000\"\n" + - " }\n" + - " },\n" + - " \"metadata\": {\n" + - " \"key1\": \"val1\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-2\",\n" + - " \"display_name\": \"org 2\"\n" + - " }\n" + - " ],\n" + - " \"start\": 0,\n" + - " \"limit\": 20,\n" + - " \"total\": 2\n" + - "}"; - - private static final String jsonWithCheckpointPageResponse = "{\n" + - " \"organizations\": [\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-1\",\n" + - " \"display_name\": \"org 1\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://some-url.com/\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#FF0000\",\n" + - " \"page_background\": \"#FF0000\"\n" + - " }\n" + - " },\n" + - " \"metadata\": {\n" + - " \"key1\": \"val1\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-2\",\n" + - " \"display_name\": \"org 2\"\n" + - " }\n" + - " ],\n" + - " \"next\": \"MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw\"\n" + - "}"; - - private static final String jsonWithNulls = "{\n" + - " \"organizations\": [\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-1\",\n" + - " \"display_name\": \"org 1\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://some-url.com/\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#FF0000\",\n" + - " \"page_background\": \"#FF0000\"\n" + - " }\n" + - " },\n" + - " \"metadata\": {\n" + - " \"key1\": \"val1\"\n" + - " }\n" + - " },\n" + - " {\n" + - " \"id\": \"org_2\",\n" + - " \"name\": \"org-2\",\n" + - " \"display_name\": \"org 2\"\n" + - " }\n" + - " ],\n" + - " \"start\": null,\n" + - " \"limit\": 20,\n" + - " \"total\": 2,\n" + - " \"next\": null" + - "}"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - OrganizationsPage page = fromJSON(jsonWithoutTotals, OrganizationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getNext(), is(nullValue())); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - OrganizationsPage page = fromJSON(jsonWithTotals, OrganizationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(20)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - assertThat(page.getNext(), is(nullValue())); - } - - @Test - public void shouldDeserializeWithCheckpointResponse() throws Exception { - OrganizationsPage page = fromJSON(jsonWithCheckpointPageResponse, OrganizationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getNext(), is("MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw")); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } - - @Test - public void shouldBeCreatedWithoutNextField() { - OrganizationsPage page = new OrganizationsPageDeserializer().createPage(0, 5, 20, 50, new ArrayList<>()); - - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(5)); - assertThat(page.getTotal(), is(20)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - } - - @Test - public void shouldHandleNullFields() throws Exception { - OrganizationsPage page = fromJSON(jsonWithNulls, OrganizationsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getTotal(), is(2)); - assertThat(page.getLimit(), is(20)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(2)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsTest.java b/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsTest.java deleted file mode 100644 index ea5cdd22f..000000000 --- a/src/test/java/com/auth0/json/mgmt/organizations/OrganizationsTest.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.auth0.json.mgmt.organizations; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import com.auth0.json.mgmt.tokenquota.TokenQuota; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class OrganizationsTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String orgJson = "{\n" + - " \"id\": \"org_abc\",\n" + - " \"name\": \"org-name\",\n" + - " \"display_name\": \"display name\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://some-url.com/\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#FF0000\",\n" + - " \"page_background\": \"#FF0000\"\n" + - " }\n" + - " },\n" + - " \"metadata\": {\n" + - " \"key1\": \"val1\"\n" + - " },\n" + - " \"token_quota\": {\n" + - " \"client_credentials\": {\n" + - " \"per_hour\": 10,\n" + - " \"per_day\": 100,\n" + - " \"enforce\": true\n" + - " }\n" + - " }\n" + - "}"; - - Organization org = fromJSON(orgJson, Organization.class); - assertThat(org, is(notNullValue())); - assertThat(org.getId(), is("org_abc")); - assertThat(org.getName(), is("org-name")); - assertThat(org.getDisplayName(), is("display name")); - assertThat(org.getBranding(), is(notNullValue())); - assertThat(org.getBranding().getLogoUrl(), is("https://some-url.com/")); - assertThat(org.getBranding().getColors(), is(notNullValue())); - assertThat(org.getBranding().getColors().getPrimary(), is("#FF0000")); - assertThat(org.getBranding().getColors().getPageBackground(), is("#FF0000")); - assertThat(org.getMetadata(), is(notNullValue())); - assertThat(org.getMetadata().get("key1"), is("val1")); - assertThat(org.getTokenQuota(), is(notNullValue())); - assertThat(org.getTokenQuota().getClientCredentials(), is(notNullValue())); - assertThat(org.getTokenQuota().getClientCredentials().getPerHour(), is(10)); - assertThat(org.getTokenQuota().getClientCredentials().getPerDay(), is(100)); - assertThat(org.getTokenQuota().getClientCredentials().isEnforce(), is(true)); - } - - @Test - public void shouldSerialize() throws Exception { - Colors colors = new Colors(); - colors.setPrimary("#FF0000"); - colors.setPageBackground("#DD0000"); - - Branding branding = new Branding(); - branding.setLogoUrl("https://some-url.com"); - branding.setColors(colors); - - Map metadata = Collections.singletonMap("key1", "val1"); - Organization organization = new Organization("org-name"); - organization.setDisplayName("display name"); - organization.setBranding(branding); - organization.setMetadata(metadata); - - EnabledConnection enabledConnection = new EnabledConnection(); - enabledConnection.setConnectionId("con-1"); - enabledConnection.setAssignMembershipOnLogin(false); - List enabledConnections = new ArrayList<>(); - enabledConnections.add(enabledConnection); - organization.setEnabledConnections(enabledConnections); - - TokenQuota tokenQuota = new TokenQuota(new ClientCredentials(100, 10, true)); - organization.setTokenQuota(tokenQuota); - - String serialized = toJSON(organization); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("name", "org-name")); - assertThat(serialized, JsonMatcher.hasEntry("display_name", "display name")); - assertThat(serialized, JsonMatcher.hasEntry("metadata", metadata)); - assertThat(serialized, JsonMatcher.hasEntry("enabled_connections", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("branding", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("branding", JsonMatcher.hasEntry("logo_url", "https://some-url.com"))); - assertThat(serialized, JsonMatcher.hasEntry("branding", JsonMatcher.hasEntry("colors", is(notNullValue())))); - assertThat(serialized, JsonMatcher.hasEntry("branding", JsonMatcher.hasEntry("colors", JsonMatcher.hasEntry("primary", "#FF0000")))); - assertThat(serialized, JsonMatcher.hasEntry("branding", JsonMatcher.hasEntry("colors", JsonMatcher.hasEntry("page_background", "#DD0000")))); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", is(notNullValue()))); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", JsonMatcher.hasEntry("client_credentials", is(notNullValue())))); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", JsonMatcher.hasEntry("client_credentials", JsonMatcher.hasEntry("per_hour", 10)))); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", JsonMatcher.hasEntry("client_credentials", JsonMatcher.hasEntry("per_day", 100)))); - assertThat(serialized, JsonMatcher.hasEntry("token_quota", JsonMatcher.hasEntry("client_credentials", JsonMatcher.hasEntry("enforce", true)))); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/permissions/PermissionSourceTest.java b/src/test/java/com/auth0/json/mgmt/permissions/PermissionSourceTest.java deleted file mode 100644 index d837a2f09..000000000 --- a/src/test/java/com/auth0/json/mgmt/permissions/PermissionSourceTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class PermissionSourceTest extends JsonTest { - - private static final String json = "{\"source_name\":\"sName\",\"source_id\":\"sId\",\"source_type\":\"sType\"}"; - - @Test - public void shouldDeserialize() throws Exception { - PermissionSource permission = fromJSON(json, PermissionSource.class); - - assertThat(permission, is(notNullValue())); - assertThat(permission.getName(), is("sName")); - assertThat(permission.getId(), is("sId")); - assertThat(permission.getType(), is("sType")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/permissions/PermissionTest.java b/src/test/java/com/auth0/json/mgmt/permissions/PermissionTest.java deleted file mode 100644 index 9be0a044e..000000000 --- a/src/test/java/com/auth0/json/mgmt/permissions/PermissionTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class PermissionTest extends JsonTest { - - private static final String json = "{\"permission_name\":\"pName\",\"description\":\"pDesc\",\"resource_server_name\":\"resName\",\"resource_server_identifier\":\"resId\",\"sources\":[{\"source_id\":\"srcId\",\"source_name\":\"srcName\",\"source_type\":\"srcType\"}]}"; - - @Test - public void shouldSerialize() throws Exception { - Permission permission = new Permission(); - permission.setDescription("pDesc"); - permission.setName("pName"); - permission.setResourceServerId("resServerId"); - permission.setResourceServerName("resServerName"); - - String serialized = toJSON(permission); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("description", "pDesc")); - assertThat(serialized, JsonMatcher.hasEntry("permission_name", "pName")); - assertThat(serialized, JsonMatcher.hasEntry("resource_server_identifier", "resServerId")); - assertThat(serialized, JsonMatcher.hasEntry("resource_server_name", "resServerName")); - } - - @Test - public void shouldDeserialize() throws Exception { - Permission permission = fromJSON(json, Permission.class); - - assertThat(permission, is(notNullValue())); - assertThat(permission.getDescription(), is("pDesc")); - assertThat(permission.getName(), is("pName")); - assertThat(permission.getResourceServerId(), is("resId")); - assertThat(permission.getResourceServerName(), is("resName")); - assertThat(permission.getSources(), hasSize(1)); - - PermissionSource includedSource = permission.getSources().get(0); - assertThat(includedSource.getId(), is("srcId")); - assertThat(includedSource.getName(), is("srcName")); - assertThat(includedSource.getType(), is("srcType")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/permissions/PermissionsPageTest.java b/src/test/java/com/auth0/json/mgmt/permissions/PermissionsPageTest.java deleted file mode 100644 index 428b716ae..000000000 --- a/src/test/java/com/auth0/json/mgmt/permissions/PermissionsPageTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.auth0.json.mgmt.permissions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class PermissionsPageTest extends JsonTest { - private static final String jsonWithTotals = "{\"start\":0,\"length\":10,\"total\":14,\"limit\":50,\"permissions\":[{\"permission_name\":\"pName\",\"description\":\"pDesc\",\"resource_server_name\":\"resName\",\"resource_server_identifier\":\"resId\",\"sources\":[]}]}"; - private static final String jsonWithoutTotals = "[{\"permission_name\":\"pName\",\"description\":\"pDesc\",\"resource_server_name\":\"resName\",\"resource_server_identifier\":\"resId\",\"sources\":[]}]"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - PermissionsPage page = fromJSON(jsonWithoutTotals, PermissionsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - PermissionsPage page = fromJSON(jsonWithTotals, PermissionsPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(10)); - assertThat(page.getTotal(), is(14)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokenTest.java b/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokenTest.java deleted file mode 100644 index a48c26505..000000000 --- a/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokenTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class RefreshTokenTest extends JsonTest { - - private static final String json = "{\n" + - " \"id\": \"tokenId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"idle_expires_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"client_id\": \"clientId1\",\n" + - " \"session_id\": \"sessionId1\",\n" + - " \"rotating\": false,\n" + - " \"resource_servers\": [\n" + - " {\n" + - " \"audience\": \"https://api.example.com\",\n" + - " \"scopes\": \"offline_access\"\n" + - " }\n" + - " ],\n" + - " \"last_exchanged_at\": \"2024-07-03T09:10:26.643Z\"\n" + - "}"; - - private static final String readOnlyJson = "{\n" + - " \"user_id\": \"userId1\",\n" + - " \"client_id\": \"clientId1\",\n" + - " \"session_id\": \"sessionId1\"\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - RefreshToken refreshToken = fromJSON(json, RefreshToken.class); - assertThat(refreshToken, is(notNullValue())); - - assertThat(refreshToken.getId(), is("tokenId1")); - assertThat(refreshToken.getUserId(), is("userId1")); - assertThat(refreshToken.getCreatedAt(), is(parseJSONDate("2024-06-26T09:10:26.643Z"))); - assertThat(refreshToken.getIdleExpiresAt(), is(parseJSONDate("2024-06-26T09:10:27.131Z"))); - assertThat(refreshToken.getExpiresAt(), is(parseJSONDate("2024-07-03T09:10:26.643Z"))); - - assertThat(refreshToken.getDevice(), is(notNullValue())); - assertThat(refreshToken.getDevice().getInitialAsn(), is("1234")); - assertThat(refreshToken.getDevice().getInitialIp(), is("203.0.113.1")); - assertThat(refreshToken.getDevice().getInitialUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - assertThat(refreshToken.getDevice().getLastUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - assertThat(refreshToken.getDevice().getLastIp(), is("203.0.113.1")); - assertThat(refreshToken.getDevice().getLastAsn(), is("1234")); - - assertThat(refreshToken.getClientId(), is("clientId1")); - assertThat(refreshToken.getSessionId(), is("sessionId1")); - assertThat(refreshToken.isRotating(), is(false)); - - assertThat(refreshToken.getResourceServers(), is(notNullValue())); - assertThat(refreshToken.getResourceServers().get(0).getAudience(), is("https://api.example.com")); - assertThat(refreshToken.getResourceServers().get(0).getScopes(), is(notNullValue())); - assertThat(refreshToken.getResourceServers().get(0).getScopes(), is("offline_access")); - - assertThat(refreshToken.getLastExchangedAt(), is(parseJSONDate("2024-07-03T09:10:26.643Z"))); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - RefreshToken refreshToken = fromJSON(readOnlyJson, RefreshToken.class); - assertThat(refreshToken, is(notNullValue())); - assertThat(refreshToken.getUserId(), is("userId1")); - assertThat(refreshToken.getClientId(), is("clientId1")); - assertThat(refreshToken.getSessionId(), is("sessionId1")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPageTest.java b/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPageTest.java deleted file mode 100644 index 50a68979b..000000000 --- a/src/test/java/com/auth0/json/mgmt/refreshtokens/RefreshTokensPageTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.auth0.json.mgmt.refreshtokens; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.nullValue; - -public class RefreshTokensPageTest extends JsonTest { - private static final String json = "{\n" + - " \"tokens\": [\n" + - " {\n" + - " \"id\": \"tokenId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"client_id\": \"clientId1\",\n" + - " \"session_id\": \"sessionId1\",\n" + - " \"rotating\": false,\n" + - " \"resource_servers\": [\n" + - " {\n" + - " \"audience\": \"https://api.example.com\",\n" + - " \"scopes\": \"offline_access\"\n" + - " }\n" + - " ],\n" + - " \"last_exchanged_at\": \"2024-07-03T09:10:26.643Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"tokenId2\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"client_id\": \"clientId2\",\n" + - " \"session_id\": \"sessionId2\",\n" + - " \"rotating\": true,\n" + - " \"resource_servers\": [\n" + - " {\n" + - " \"audience\": \"https://api.example.com\",\n" + - " \"scopes\": \"offline_access\"\n" + - " }\n" + - " ],\n" + - " \"last_exchanged_at\": \"2024-07-03T09:10:26.643Z\"\n" + - " }\n" + - " ],\n" + - " \"next\": \"token1\"\n" + - "}"; - - private static final String jsonWithTotal = "{\n" + - " \"tokens\": [\n" + - " {\n" + - " \"id\": \"tokenId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"client_id\": \"clientId1\",\n" + - " \"session_id\": \"sessionId1\",\n" + - " \"rotating\": false,\n" + - " \"resource_servers\": [\n" + - " {\n" + - " \"audience\": \"https://api.example.com\",\n" + - " \"scopes\": \"offline_access\"\n" + - " }\n" + - " ],\n" + - " \"last_exchanged_at\": \"2024-07-03T09:10:26.643Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"tokenId2\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"client_id\": \"clientId2\",\n" + - " \"session_id\": \"sessionId2\",\n" + - " \"rotating\": true,\n" + - " \"resource_servers\": [\n" + - " {\n" + - " \"audience\": \"https://api.example.com\",\n" + - " \"scopes\": \"offline_access\"\n" + - " }\n" + - " ],\n" + - " \"last_exchanged_at\": \"2024-07-03T09:10:26.643Z\"\n" + - " }\n" + - " ],\n" + - " \"next\": \"token1\",\n" + - " \"total\": 11\n" + - "}"; - @Test - public void shouldDeserialize() throws Exception { - RefreshTokensPage page = fromJSON(json, RefreshTokensPage.class); - - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getNext(), is("token1")); - - assertThat(page.getTokens().size(), is(2)); - assertThat(page.getTokens().get(0).getId(), is("tokenId1")); - assertThat(page.getTokens().get(0).getUserId(), is("userId1")); - assertThat(page.getTokens().get(0).getCreatedAt(), is(parseJSONDate("2024-06-26T09:10:26.643Z"))); - assertThat(page.getTokens().get(0).getIdleExpiresAt(), is(nullValue())); - assertThat(page.getTokens().get(0).getExpiresAt(), is(parseJSONDate("2024-07-03T09:10:26.643Z"))); - - assertThat(page.getTokens().get(0).getDevice().getInitialIp(), is("203.0.113.1")); - assertThat(page.getTokens().get(0).getDevice().getInitialAsn(), is("1234")); - assertThat(page.getTokens().get(0).getDevice().getInitialUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - assertThat(page.getTokens().get(0).getDevice().getLastIp(), is("203.0.113.1")); - assertThat(page.getTokens().get(0).getDevice().getLastAsn(), is("1234")); - assertThat(page.getTokens().get(0).getDevice().getLastUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - - assertThat(page.getTokens().get(0).getClientId(), is("clientId1")); - assertThat(page.getTokens().get(0).getSessionId(), is("sessionId1")); - assertThat(page.getTokens().get(0).isRotating(), is(false)); - - assertThat(page.getTokens().get(0).getResourceServers().size(), is(1)); - assertThat(page.getTokens().get(0).getResourceServers().get(0).getAudience(), is("https://api.example.com")); - assertThat(page.getTokens().get(0).getResourceServers().get(0).getScopes(), is("offline_access")); - - assertThat(page.getTokens().get(0).getLastExchangedAt(), is(parseJSONDate("2024-07-03T09:10:26.643Z"))); - } - - @Test - public void shouldDeserializeWithTotal() throws Exception { - RefreshTokensPage page = fromJSON(jsonWithTotal, RefreshTokensPage.class); - - assertThat(page.getTotal(), is(11)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageTest.java b/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageTest.java deleted file mode 100644 index 108e03125..000000000 --- a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponsePageTest.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SelfServiceProfileResponsePageTest extends JsonTest { - - private static final String jsonWithoutTotals = - "[\n" + - " {\n" + - " \"id\": \"id1\",\n" + - " \"name\": \"test1\",\n" + - " \"description\": \"This is for testing\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Phone\",\n" + - " \"description\": \"This is Phone Number\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"google-apps\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-16T15:26:39.015Z\",\n" + - " \"updated_at\": \"2024-12-16T15:28:04.933Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"id2\",\n" + - " \"name\": \"Test2\",\n" + - " \"description\": \"This is for Test2\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Phone\",\n" + - " \"description\": \"This is Phone Number\",\n" + - " \"is_optional\": true\n" + - " },\n" + - " {\n" + - " \"name\": \"UserName\",\n" + - " \"description\": \"This is User Name\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"oidc\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-16T15:29:06.119Z\",\n" + - " \"updated_at\": \"2024-12-16T15:29:06.119Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"id3\",\n" + - " \"name\": \"Test3\",\n" + - " \"description\": \"This is a Test3\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Name\",\n" + - " \"description\": \"Name Field\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"oidc\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-20T09:32:13.885Z\",\n" + - " \"updated_at\": \"2024-12-20T09:32:13.885Z\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://www.google.com\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#ffffff\"\n" + - " }\n" + - " }\n" + - " }\n" + - "]\n"; - - private static final String jsonWithTotals = - "{\n" + - " \"self_service_profiles\": [\n" + - " {\n" + - " \"id\": \"id1\",\n" + - " \"name\": \"test1\",\n" + - " \"description\": \"This is for testing\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Phone\",\n" + - " \"description\": \"This is Phone Number\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"google-apps\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-16T15:26:39.015Z\",\n" + - " \"updated_at\": \"2024-12-16T15:28:04.933Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"id2\",\n" + - " \"name\": \"Test2\",\n" + - " \"description\": \"This is for Test2\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Phone\",\n" + - " \"description\": \"This is Phone Number\",\n" + - " \"is_optional\": true\n" + - " },\n" + - " {\n" + - " \"name\": \"UserName\",\n" + - " \"description\": \"This is User Name\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"oidc\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-16T15:29:06.119Z\",\n" + - " \"updated_at\": \"2024-12-16T15:29:06.119Z\"\n" + - " },\n" + - " {\n" + - " \"id\": \"id3\",\n" + - " \"name\": \"Test3\",\n" + - " \"description\": \"This is a Test3\",\n" + - " \"user_attributes\": [\n" + - " {\n" + - " \"name\": \"Name\",\n" + - " \"description\": \"Name Field\",\n" + - " \"is_optional\": true\n" + - " }\n" + - " ],\n" + - " \"allowed_strategies\": [\n" + - " \"oidc\"\n" + - " ],\n" + - " \"created_at\": \"2024-12-20T09:32:13.885Z\",\n" + - " \"updated_at\": \"2024-12-20T09:32:13.885Z\",\n" + - " \"branding\": {\n" + - " \"logo_url\": \"https://www.google.com\",\n" + - " \"colors\": {\n" + - " \"primary\": \"#ffffff\"\n" + - " }\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"start\": 0,\n" + - " \"limit\": 10,\n" + - " \"total\": 3\n" + - "}"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - SelfServiceProfileResponsePage page = fromJSON(jsonWithoutTotals, SelfServiceProfileResponsePage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(3)); - assertThat(page.getNext(), is(nullValue())); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - SelfServiceProfileResponsePage page = fromJSON(jsonWithTotals, SelfServiceProfileResponsePage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getTotal(), is(3)); - assertThat(page.getLimit(), is(10)); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(3)); - assertThat(page.getNext(), is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponseTest.java b/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponseTest.java deleted file mode 100644 index 3a1173e90..000000000 --- a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileResponseTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SelfServiceProfileResponseTest extends JsonTest { - - private final static String SELF_SERVICE_PROFILE_RESPONSE_JSON = "src/test/resources/mgmt/self_service_profile_response.json"; - - @Test - public void deserialize() throws Exception { - SelfServiceProfileResponse deserialized = fromJSON(readTextFile(SELF_SERVICE_PROFILE_RESPONSE_JSON), SelfServiceProfileResponse.class); - - assertThat(deserialized.getId(), is("id")); - assertThat(deserialized.getName(), is("Test")); - assertThat(deserialized.getDescription(), is("This is a Test")); - assertThat(deserialized.getUserAttributes().get(0).getName(), is("Phone")); - assertThat(deserialized.getUserAttributes().get(0).getDescription(), is("This is Phone Number")); - assertThat(deserialized.getUserAttributes().get(0).getIsOptional(), is(true)); - assertThat(deserialized.getBranding().getColors().getPrimary(), is("#ffffff")); - assertThat(deserialized.getBranding().getLogoUrl(), is("https://www.google.com")); - assertThat(deserialized.getAllowedStrategies().get(0), is("oidc")); - assertThat(deserialized.getCreatedAt(), is("2024-12-20T09:32:13.885Z")); - assertThat(deserialized.getCreatedAt(), is("2024-12-20T09:32:13.885Z")); - } - - @Test - public void serialize() throws Exception { - SelfServiceProfileResponse selfServiceProfileResponse = new SelfServiceProfileResponse(); - selfServiceProfileResponse.setId("id"); - selfServiceProfileResponse.setName("Test"); - selfServiceProfileResponse.setDescription("This is for Test"); - - UserAttribute userAttribute = new UserAttribute("Phone", "This is Phone Number", true); - List userAttributes = new ArrayList<>(); - userAttributes.add(userAttribute); - selfServiceProfileResponse.setUserAttributes(userAttributes); - - Branding branding = new Branding(); - branding.setColors(new Color("#ffffff")); - branding.setLogoUrl("https://www.google.com"); - selfServiceProfileResponse.setBranding(branding); - - List allowedStrategies = new ArrayList<>(); - allowedStrategies.add("oidc"); - selfServiceProfileResponse.setAllowedStrategies(allowedStrategies); - - selfServiceProfileResponse.setCreatedAt("2024-12-20T09:32:13.885Z"); - selfServiceProfileResponse.setUpdatedAt("2024-12-20T09:32:13.885Z"); - - String serialized = toJSON(selfServiceProfileResponse); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, hasEntry("id", "id")); - assertThat(serialized, hasEntry("name", "Test")); - assertThat(serialized, hasEntry("description", "This is for Test")); - assertThat(serialized, hasEntry("user_attributes", notNullValue())); - assertThat(serialized, containsString("\"user_attributes\":[{\"name\":\"Phone\",\"description\":\"This is Phone Number\",\"is_optional\":true}]")); - assertThat(serialized, hasEntry("branding", notNullValue())); - assertThat(serialized, containsString("\"branding\":{\"logo_url\":\"https://www.google.com\",\"colors\":{\"primary\":\"#ffffff\"}}")); - assertThat(serialized, hasEntry("allowed_strategies", notNullValue())); - assertThat(serialized, containsString("\"allowed_strategies\":[\"oidc\"]")); - assertThat(serialized, hasEntry("created_at", "2024-12-20T09:32:13.885Z")); - assertThat(serialized, hasEntry("updated_at", "2024-12-20T09:32:13.885Z")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileTest.java b/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileTest.java deleted file mode 100644 index 2f7e1b8c8..000000000 --- a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SelfServiceProfileTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SelfServiceProfileTest extends JsonTest { - private final static String SELF_SERVICE_PROFILE_JSON = "src/test/resources/mgmt/self_service_profile.json"; - - @Test - public void deserialize() throws Exception { - SelfServiceProfile deserialized = fromJSON(readTextFile(SELF_SERVICE_PROFILE_JSON), SelfServiceProfile.class); - - assertThat(deserialized.getName(), is("Test")); - assertThat(deserialized.getDescription(), is("This is for Test")); - assertThat(deserialized.getUserAttributes().get(0).getName(), is("Phone")); - assertThat(deserialized.getUserAttributes().get(0).getDescription(), is("This is Phone Number")); - assertThat(deserialized.getUserAttributes().get(0).getIsOptional(), is(true)); - assertThat(deserialized.getBranding().getColors().getPrimary(), is("#ffffff")); - assertThat(deserialized.getBranding().getLogoUrl(), is("https://www.google.com")); - assertThat(deserialized.getAllowedStrategies().get(0), is("oidc")); - } - - @Test - public void serialize() throws Exception { - SelfServiceProfile selfServiceProfile = new SelfServiceProfile(); - selfServiceProfile.setName("Test"); - selfServiceProfile.setDescription("This is for Test"); - - UserAttribute userAttribute = new UserAttribute("Phone", "This is Phone Number", true); - List userAttributes = new ArrayList<>(); - userAttributes.add(userAttribute); - selfServiceProfile.setUserAttributes(userAttributes); - - Branding branding = new Branding(); - branding.setColors(new Color("#ffffff")); - branding.setLogoUrl("https://www.google.com"); - selfServiceProfile.setBranding(branding); - - List allowedStrategies = new ArrayList<>(); - allowedStrategies.add("oidc"); - selfServiceProfile.setAllowedStrategies(allowedStrategies); - - String serialized = toJSON(selfServiceProfile); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, hasEntry("name", "Test")); - assertThat(serialized, hasEntry("description", "This is for Test")); - assertThat(serialized, hasEntry("user_attributes", notNullValue())); - assertThat(serialized, containsString("\"user_attributes\":[{\"name\":\"Phone\",\"description\":\"This is Phone Number\",\"is_optional\":true}]")); - assertThat(serialized, hasEntry("branding", notNullValue())); - assertThat(serialized, containsString("\"branding\":{\"logo_url\":\"https://www.google.com\",\"colors\":{\"primary\":\"#ffffff\"}}")); - assertThat(serialized, hasEntry("allowed_strategies", notNullValue())); - assertThat(serialized, containsString("\"allowed_strategies\":[\"oidc\"]")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequestTest.java b/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequestTest.java deleted file mode 100644 index 41097b646..000000000 --- a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketRequestTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SsoAccessTicketRequestTest extends JsonTest { - private final static String SELF_SERVICE_PROFILE_SSO_ACCESS_TICKET_REQUEST_JSON = "src/test/resources/mgmt/self_service_profile_sso_ticket_request.json"; - - @Test - public void deserialize() throws Exception { - SsoAccessTicketRequest deserialized = fromJSON(readTextFile(SELF_SERVICE_PROFILE_SSO_ACCESS_TICKET_REQUEST_JSON), SsoAccessTicketRequest.class); - - assertThat(deserialized.getConnectionConfig(), is(notNullValue())); - assertThat(deserialized.getEnabledClients().get(0), is("client-1")); - - assertThat(deserialized.getEnabledOrganizations().get(0).getOrganizationId(), is("org_1")); - assertThat(deserialized.getEnabledOrganizations().get(0).isAssignMembershipOnLogin(), is(true)); - assertThat(deserialized.getEnabledOrganizations().get(0).isShowAsButton(), is(true)); - - assertThat(deserialized.getTtlSec(), is(0)); - - assertThat(deserialized.getDomainAliasesConfig().getDomainVerification(), is("none")); - } - - @Test - public void serialize() throws Exception { - - Map connectionConfig = new HashMap<>(); - connectionConfig.put("name", "okta"); - connectionConfig.put("display_name", "okta connection"); - connectionConfig.put("is_domain_connection", true); - connectionConfig.put("show_as_button", true); - connectionConfig.put("metadata", new HashMap<>()); - - Map idpInitiated = new HashMap<>(); - idpInitiated.put("enabled", true); - idpInitiated.put("client_id", "client-1"); - idpInitiated.put("client_protocol", "oauth2"); - idpInitiated.put("client_authorizequery", "response_type=code&scope=openid%20profile%20email"); - - Map options = new HashMap<>(); - options.put("idpinitiated", idpInitiated); - options.put("icon_url", "https://cdn.auth0.com/connections/okta.png"); - options.put("domain_aliases", new ArrayList() {{ - add("acme.corp"); - }}); - - connectionConfig.put("options", options); - - SsoAccessTicketRequest ssoAccessTicketRequest = new SsoAccessTicketRequest(); - - ssoAccessTicketRequest.setConnectionConfig(connectionConfig); - ssoAccessTicketRequest.setEnabledClients(new ArrayList() {{ - add("client-1"); - }}); - - EnabledOrganizations enabledOrganizations = new EnabledOrganizations(); - enabledOrganizations.setOrganizationId("org_1"); - enabledOrganizations.setAssignMembershipOnLogin(true); - enabledOrganizations.setShowAsButton(true); - - ssoAccessTicketRequest.setEnabledOrganizations(new ArrayList() {{ - add(enabledOrganizations); - }}); - - ssoAccessTicketRequest.setTtlSec(0); - - ssoAccessTicketRequest.setDomainAliasesConfig(new DomainAliasesConfig("none")); - - String serialized = toJSON(ssoAccessTicketRequest); - assertThat(ssoAccessTicketRequest, is(notNullValue())); - assertThat(serialized, containsString("{\"connection_config\":{\"metadata\":{},\"is_domain_connection\":true,\"show_as_button\":true,\"name\":\"okta\",\"options\":{\"icon_url\":\"https://cdn.auth0.com/connections/okta.png\",\"domain_aliases\":[\"acme.corp\"],\"idpinitiated\":{\"client_authorizequery\":\"response_type=code&scope=openid%20profile%20email\",\"client_protocol\":\"oauth2\",\"enabled\":true,\"client_id\":\"client-1\"}},\"display_name\":\"okta connection\"},\"enabled_clients\":[\"client-1\"],\"enabled_organizations\":[{\"organization_id\":\"org_1\",\"assign_membership_on_login\":true,\"show_as_button\":true}],\"ttl_sec\":0,\"domain_aliases_config\":{\"domain_verification\":\"none\"}}")); - assertThat(serialized, containsString("\"enabled_clients\":[\"client-1\"]")); - assertThat(serialized, containsString("\"enabled_organizations\":[{\"organization_id\":\"org_1\",\"assign_membership_on_login\":true,\"show_as_button\":true}]")); - assertThat(serialized, containsString("\"ttl_sec\":0")); - assertThat(serialized, containsString("\"domain_aliases_config\":{\"domain_verification\":\"none\"}")); - - } -} diff --git a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponseTest.java b/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponseTest.java deleted file mode 100644 index 3c1eb1475..000000000 --- a/src/test/java/com/auth0/json/mgmt/selfserviceprofiles/SsoAccessTicketResponseTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.selfserviceprofiles; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SsoAccessTicketResponseTest extends JsonTest { - - private final static String SELF_SERVICE_PROFILE_SSO_TICKET_JSON = "src/test/resources/mgmt/self_service_profile_sso_ticket.json"; - - @Test - public void deserialize() throws Exception { - SsoAccessTicketResponse deserialized = fromJSON(readTextFile(SELF_SERVICE_PROFILE_SSO_TICKET_JSON), SsoAccessTicketResponse.class); - - assertThat(deserialized.getTicket(), is("https://example.auth0.com/self-service/connections-flow?ticket=ticket-1234")); - } - - @Test - public void serialize() throws Exception { - SsoAccessTicketResponse ssoAccessTicketResponse = new SsoAccessTicketResponse(); - ssoAccessTicketResponse.setTicket("https://example.auth0.com/self-service/connections-flow?ticket=ticket-1234"); - - String serialized = toJSON(ssoAccessTicketResponse); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, hasEntry("ticket", "https://example.auth0.com/self-service/connections-flow?ticket=ticket-1234")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/sessions/SessionTest.java b/src/test/java/com/auth0/json/mgmt/sessions/SessionTest.java deleted file mode 100644 index 8ed3d2c28..000000000 --- a/src/test/java/com/auth0/json/mgmt/sessions/SessionTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class SessionTest extends JsonTest { - - private static final String json = "{\n" + - " \"id\": \"sessionId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-09-04T06:41:46.145Z\",\n" + - " \"updated_at\": \"2024-09-04T06:41:46.621Z\",\n" + - " \"authenticated_at\": \"2024-09-04T06:41:46.145Z\",\n" + - " \"authentication\": {\n" + - " \"methods\": [\n" + - " {\n" + - " \"name\": \"federated\",\n" + - " \"timestamp\": \"2024-09-04T06:41:46.145Z\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"idle_expires_at\": \"2024-09-07T06:41:46.622Z\",\n" + - " \"expires_at\": \"2024-09-11T06:41:46.145Z\",\n" + - " \"device\": {\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\",\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"134.1.15.0\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"134.1.15.0\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"clients\": [\n" + - " {\n" + - " \"client_id\": \"clientId1\"\n" + - " }\n" + - " ]\n" + - "}"; - - private static final String readOnlyJson = "{\n" + - " \"user_id\": \"userId1\",\n" + - " \"clients\": [\n" + - " {\n" + - " \"client_id\": \"clientId1\"\n" + - " }\n" + - " ]\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - Session session = fromJSON(json, Session.class); - - assertThat(session, is(notNullValue())); - assertThat(session.getId(), is("sessionId1")); - assertThat(session.getUserId(), is("userId1")); - assertThat(session.getCreatedAt(), is(parseJSONDate("2024-09-04T06:41:46.145Z"))); - assertThat(session.getUpdatedAt(), is(parseJSONDate("2024-09-04T06:41:46.621Z"))); - assertThat(session.getAuthenticatedAt(), is(parseJSONDate("2024-09-04T06:41:46.145Z"))); - - assertThat(session.getAuthentication().getMethods(), is(notNullValue())); - assertThat(session.getAuthentication().getMethods().get(0).getName(), is("federated")); - assertThat(session.getAuthentication().getMethods().get(0).getTimestamp(), is(parseJSONDate("2024-09-04T06:41:46.145Z"))); - - assertThat(session.getIdleExpiresAt(), is(parseJSONDate("2024-09-07T06:41:46.622Z"))); - assertThat(session.getExpiresAt(), is(parseJSONDate("2024-09-11T06:41:46.145Z"))); - - assertThat(session.getDevice(), is(notNullValue())); - assertThat(session.getDevice().getInitialASN(), is("1234")); - assertThat(session.getDevice().getInitialIP(), is("134.1.15.0")); - assertThat(session.getDevice().getInitialUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36")); - assertThat(session.getDevice().getLastASN(), is("1234")); - assertThat(session.getDevice().getLastIP(), is("134.1.15.0")); - assertThat(session.getDevice().getLastUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36")); - - assertThat(session.getClients(), is(notNullValue())); - assertThat(session.getClients().get(0).getClientId(), is("clientId1")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - Session session = fromJSON(readOnlyJson, Session.class); - assertThat(session, is(notNullValue())); - assertThat(session.getUserId(), is("userId1")); - assertThat(session.getClients().get(0).getClientId(), is("clientId1")); - } - - -} diff --git a/src/test/java/com/auth0/json/mgmt/sessions/SessionsPageTest.java b/src/test/java/com/auth0/json/mgmt/sessions/SessionsPageTest.java deleted file mode 100644 index 12d288993..000000000 --- a/src/test/java/com/auth0/json/mgmt/sessions/SessionsPageTest.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.auth0.json.mgmt.sessions; - -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.sessions.SessionsPage; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.nullValue; - -public class SessionsPageTest extends JsonTest { - private static final String json = "{\n" + - " \"sessions\": [\n" + - " {\n" + - " \"id\": \"sessionId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"authenticated_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"authentication\": {\n" + - " \"methods\": [\n" + - " {\n" + - " \"name\": \"pwd\",\n" + - " \"timestamp\": \"2024-06-26T09:10:26.643Z\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"idle_expires_at\": \"2024-06-26T09:40:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"clients\": [\n" + - " {\n" + - " \"client_id\": \"clientId1\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " ],\n" + - " \"next\": \"sessionId1\"\n" + - "}"; - private static final String jsonWithTotals = "{\n" + - " \"sessions\": [\n" + - " {\n" + - " \"id\": \"sessionId1\",\n" + - " \"user_id\": \"userId1\",\n" + - " \"created_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"updated_at\": \"2024-06-26T09:10:27.131Z\",\n" + - " \"authenticated_at\": \"2024-06-26T09:10:26.643Z\",\n" + - " \"authentication\": {\n" + - " \"methods\": [\n" + - " {\n" + - " \"name\": \"pwd\",\n" + - " \"timestamp\": \"2024-06-26T09:10:26.643Z\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"idle_expires_at\": \"2024-06-26T09:40:27.131Z\",\n" + - " \"expires_at\": \"2024-07-03T09:10:26.643Z\",\n" + - " \"device\": {\n" + - " \"initial_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\",\n" + - " \"initial_asn\": \"1234\",\n" + - " \"initial_ip\": \"203.0.113.1\",\n" + - " \"last_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\",\n" + - " \"last_ip\": \"203.0.113.1\",\n" + - " \"last_asn\": \"1234\"\n" + - " },\n" + - " \"clients\": [\n" + - " {\n" + - " \"client_id\": \"clientId1\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " ],\n" + - " \"next\": \"sessionId1\",\n" + - " \"total\": 11\n" + - "}"; - - @Test - public void shouldDeserialize() throws Exception { - SessionsPage page = fromJSON(json, SessionsPage.class); - - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getNext(), is("sessionId1")); - assertThat(page.getSessions().size(), is(1)); - assertThat(page.getSessions().get(0).getId(), is("sessionId1")); - assertThat(page.getSessions().get(0).getUserId(), is("userId1")); - assertThat(page.getSessions().get(0).getCreatedAt(), is(parseJSONDate("2024-06-26T09:10:26.643Z"))); - assertThat(page.getSessions().get(0).getUpdatedAt(), is(parseJSONDate("2024-06-26T09:10:27.131Z"))); - assertThat(page.getSessions().get(0).getAuthenticatedAt(), is(parseJSONDate("2024-06-26T09:10:26.643Z"))); - assertThat(page.getSessions().get(0).getIdleExpiresAt(), is(parseJSONDate("2024-06-26T09:40:27.131Z"))); - assertThat(page.getSessions().get(0).getExpiresAt(), is(parseJSONDate("2024-07-03T09:10:26.643Z"))); - - assertThat(page.getSessions().get(0).getDevice().getInitialASN(), is("1234")); - assertThat(page.getSessions().get(0).getDevice().getInitialIP(), is("203.0.113.1")); - assertThat(page.getSessions().get(0).getDevice().getLastUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - assertThat(page.getSessions().get(0).getDevice().getLastIP(), is("203.0.113.1")); - assertThat(page.getSessions().get(0).getDevice().getLastASN(), is("1234")); - assertThat(page.getSessions().get(0).getDevice().getLastUserAgent(), is("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")); - - assertThat(page.getSessions().get(0).getClients().size(), is(1)); - assertThat(page.getSessions().get(0).getClients().get(0).getClientId(), is("clientId1")); - - assertThat(page.getSessions().get(0).getAuthentication().getMethods().size(), is(1)); - assertThat(page.getSessions().get(0).getAuthentication().getMethods().get(0).getName(), is("pwd")); - assertThat(page.getSessions().get(0).getAuthentication().getMethods().get(0).getTimestamp(), is(parseJSONDate("2024-06-26T09:10:26.643Z"))); - assertThat(page.getSessions().get(0).getAuthentication().getMethods().get(0).getType(), is(nullValue())); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - SessionsPage page = fromJSON(jsonWithTotals, SessionsPage.class); - - assertThat(page.getTotal(), is(11)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/tenants/ErrorPageCustomizationTest.java b/src/test/java/com/auth0/json/mgmt/tenants/ErrorPageCustomizationTest.java deleted file mode 100644 index 4fa96caaf..000000000 --- a/src/test/java/com/auth0/json/mgmt/tenants/ErrorPageCustomizationTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class ErrorPageCustomizationTest extends JsonTest { - - private static final String json = "{\"enabled\":true,\"html\":\"thewebpage\",\"show_log_link\":true,\"url\":\"https://page.auth0.com/main\"}"; - - @Test - public void shouldSerialize() throws Exception { - ErrorPageCustomization customization = new ErrorPageCustomization(); - customization.setEnabled(true); - customization.setHTML("thewebpage"); - customization.setShowLogLink(true); - customization.setUrl("https://page.auth0.com/main"); - - String serialized = toJSON(customization); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("enabled", true)); - assertThat(serialized, JsonMatcher.hasEntry("html", "thewebpage")); - assertThat(serialized, JsonMatcher.hasEntry("show_log_link", true)); - assertThat(serialized, JsonMatcher.hasEntry("url", "https://page.auth0.com/main")); - } - - @Test - public void shouldDeserialize() throws Exception { - ErrorPageCustomization customization = fromJSON(json, ErrorPageCustomization.class); - - assertThat(customization, is(notNullValue())); - assertThat(customization.isEnabled(), is(true)); - assertThat(customization.getHTML(), is("thewebpage")); - assertThat(customization.willShowLogLink(), is(true)); - assertThat(customization.getUrl(), is("https://page.auth0.com/main")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/tenants/PageCustomizationTest.java b/src/test/java/com/auth0/json/mgmt/tenants/PageCustomizationTest.java deleted file mode 100644 index 897a85cdc..000000000 --- a/src/test/java/com/auth0/json/mgmt/tenants/PageCustomizationTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class PageCustomizationTest extends JsonTest { - - private static final String json = "{\"enabled\":true,\"html\":\"thewebpage\"}"; - - @Test - public void shouldSerialize() throws Exception { - PageCustomization customization = new PageCustomization(); - customization.setEnabled(true); - customization.setHTML("thewebpage"); - - String serialized = toJSON(customization); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("enabled", true)); - assertThat(serialized, JsonMatcher.hasEntry("html", "thewebpage")); - } - - @Test - public void shouldDeserialize() throws Exception { - PageCustomization customization = fromJSON(json, PageCustomization.class); - - assertThat(customization, is(notNullValue())); - assertThat(customization.isEnabled(), is(true)); - assertThat(customization.getHTML(), is("thewebpage")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/tenants/TenantTest.java b/src/test/java/com/auth0/json/mgmt/tenants/TenantTest.java deleted file mode 100644 index de5f478e4..000000000 --- a/src/test/java/com/auth0/json/mgmt/tenants/TenantTest.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.auth0.json.mgmt.tenants; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import com.auth0.json.mgmt.tokenquota.ClientCredentials; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TenantTest extends JsonTest { - - private static final String json = "{\n" + - " \"change_password\": {},\n" + - " \"guardian_mfa_page\": {},\n" + - " \"default_audience\": \"https://domain.auth0.com/myapi\",\n" + - " \"default_directory\": \"Username-Password-Authentication\",\n" + - " \"error_page\": {},\n" + - " \"flags\": {},\n" + - " \"friendly_name\": \"My-Tenant\",\n" + - " \"picture_url\": \"https://pic.to/123\",\n" + - " \"support_email\": \"support@auth0.com\",\n" + - " \"support_url\": \"https://support.auth0.com\",\n" + - " \"allowed_logout_urls\": [\n" + - " \"https://domain.auth0.com/logout\"\n" + - " ],\n" + - " \"session_lifetime\": 24,\n" + - " \"idle_session_lifetime\": 0.5,\n" + - " \"session_cookie\": {\n" + - " \"mode\": \"persistent\"\n" + - " },\n" + - " \"acr_values_supported\": [\n" + - " \"string1\",\n" + - " \"string2\"\n" + - " ],\n" + - " \"pushed_authorization_requests_supported\": true,\n" + - " \"remove_alg_from_jwks\": true,\n" + - " \"mtls\": {\n" + - " \"enable_endpoint_aliases\": true\n" + - " },\n" + - " \"default_token_quota\": {\n" + - " \"clients\": {\n" + - " \"client_credentials\": {\n" + - " \"per_day\": 100,\n" + - " \"per_hour\": 20,\n" + - " \"enforce\": true\n" + - " }\n" + - " },\n" + - " \"organizations\": {\n" + - " \"client_credentials\": {\n" + - " \"per_day\": 100,\n" + - " \"per_hour\": 20,\n" + - " \"enforce\": true\n" + - " }\n" + - " }\n" + - " }\n" + - "}"; - - - @Test - public void shouldSerialize() throws Exception { - Tenant tenant = new Tenant(); - tenant.setChangePasswordPage(new PageCustomization()); - tenant.setGuardianMFAPage(new PageCustomization()); - tenant.setDefaultAudience("https://domain.auth0.com/myapi"); - tenant.setDefaultDirectory("Username-Password-Authentication"); - tenant.setErrorPage(new ErrorPageCustomization()); - tenant.setFlags(Collections.emptyMap()); - tenant.setFriendlyName("My-Tenant"); - tenant.setPictureUrl("https://pic.to/123"); - tenant.setSupportEmail("support@auth0.com"); - tenant.setSupportUrl("https://support.auth0.com"); - tenant.setAllowedLogoutUrls(Collections.singletonList("https://domain.auth0.com/logout")); - tenant.setSessionLifetime(48); - tenant.setIdleSessionLifetime(0); - tenant.setSessionCookie(new SessionCookie("persistent")); - tenant.setAcrValuesSupported(Collections.singletonList("supported acr value")); - tenant.setPushedAuthorizationRequestsSupported(true); - tenant.setRemoveAlgFromJwks(true); - - ClientCredentials clientCredentials = new ClientCredentials(); - clientCredentials.setPerDay(100); - clientCredentials.setPerHour(20); - clientCredentials.setEnforce(true); - Clients clientTokenQuota = new Clients(clientCredentials); - Organizations organizationTokenQuota = new Organizations(clientCredentials); - tenant.setDefaultTokenQuota(new DefaultTokenQuota(clientTokenQuota, organizationTokenQuota)); - - Mtls mtls = new Mtls(); - mtls.setEnableEndpointAliases(true); - tenant.setMtls(mtls); - - String serialized = toJSON(tenant); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, JsonMatcher.hasEntry("change_password", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("guardian_mfa_page", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("default_audience", "https://domain.auth0.com/myapi")); - assertThat(serialized, JsonMatcher.hasEntry("default_directory", "Username-Password-Authentication")); - assertThat(serialized, JsonMatcher.hasEntry("error_page", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("flags", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("friendly_name", "My-Tenant")); - assertThat(serialized, JsonMatcher.hasEntry("picture_url", "https://pic.to/123")); - assertThat(serialized, JsonMatcher.hasEntry("support_email", "support@auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("support_url", "https://support.auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("allowed_logout_urls", Arrays.asList("https://domain.auth0.com/logout"))); - assertThat(serialized, JsonMatcher.hasEntry("session_lifetime", 48)); - assertThat(serialized, JsonMatcher.hasEntry("idle_session_lifetime", 0)); - assertThat(serialized, JsonMatcher.hasEntry("session_cookie", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("acr_values_supported", Collections.singletonList("supported acr value"))); - assertThat(serialized, JsonMatcher.hasEntry("pushed_authorization_requests_supported", true)); - assertThat(serialized, JsonMatcher.hasEntry("remove_alg_from_jwks", true)); - assertThat(serialized, JsonMatcher.hasEntry("enable_endpoint_aliases", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("mtls", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("default_token_quota", notNullValue())); - } - - @Test - public void shouldDeserialize() throws Exception { - Tenant tenant = fromJSON(json, Tenant.class); - - assertThat(tenant, is(notNullValue())); - assertThat(tenant.getChangePasswordPage(), is(notNullValue())); - assertThat(tenant.getGuardianMFAPage(), is(notNullValue())); - assertThat(tenant.getDefaultAudience(), is("https://domain.auth0.com/myapi")); - assertThat(tenant.getDefaultDirectory(), is("Username-Password-Authentication")); - assertThat(tenant.getErrorPage(), is(notNullValue())); - assertThat(tenant.getFlags(), is(notNullValue())); - assertThat(tenant.getFriendlyName(), is("My-Tenant")); - assertThat(tenant.getPictureUrl(), is("https://pic.to/123")); - assertThat(tenant.getSupportEmail(), is("support@auth0.com")); - assertThat(tenant.getSupportUrl(), is("https://support.auth0.com")); - assertThat(tenant.getAllowedLogoutUrls(), contains("https://domain.auth0.com/logout")); - assertThat(tenant.getSessionLifetime(), is(24)); - assertThat(tenant.getIdleSessionLifetime(), is(0)); - assertThat(tenant.getSessionCookie(), is(notNullValue())); - assertThat(tenant.getSessionCookie().getMode(), is("persistent")); - assertThat(tenant.getAcrValuesSupported(), contains("string1", "string2")); - assertThat(tenant.getPushedAuthorizationRequestsSupported(), is(true)); - assertThat(tenant.getRemoveAlgFromJwks(), is(true)); - assertThat(tenant.getMtls(), is(notNullValue())); - assertThat(tenant.getMtls().getEnableEndpointAliases(), is(true)); - assertThat(tenant.getDefaultTokenQuota(), is(notNullValue())); - assertThat(tenant.getDefaultTokenQuota().getClients(), is(notNullValue())); - assertThat(tenant.getDefaultTokenQuota().getClients().getClientCredentials(), is(notNullValue())); - assertThat(tenant.getDefaultTokenQuota().getClients().getClientCredentials().getPerDay(), is(100)); - assertThat(tenant.getDefaultTokenQuota().getClients().getClientCredentials().getPerHour(), is(20)); - assertThat(tenant.getDefaultTokenQuota().getClients().getClientCredentials().isEnforce(), is(true)); - assertThat(tenant.getDefaultTokenQuota().getOrganizations(), is(notNullValue())); - assertThat(tenant.getDefaultTokenQuota().getOrganizations().getClientCredentials(), is(notNullValue())); - assertThat(tenant.getDefaultTokenQuota().getOrganizations().getClientCredentials().getPerDay(), is(100)); - assertThat(tenant.getDefaultTokenQuota().getOrganizations().getClientCredentials().getPerHour(), is(20)); - assertThat(tenant.getDefaultTokenQuota().getOrganizations().getClientCredentials().isEnforce(), is(true)); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/tickets/EmailVerificationTicketTest.java b/src/test/java/com/auth0/json/mgmt/tickets/EmailVerificationTicketTest.java deleted file mode 100644 index 348066a03..000000000 --- a/src/test/java/com/auth0/json/mgmt/tickets/EmailVerificationTicketTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.json.mgmt.tickets; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class EmailVerificationTicketTest extends JsonTest { - - private static final String readOnlyJson = "{\"ticket\":\"https://page.auth0.com/tickets/123\"}"; - - @Test - public void shouldSerialize() throws Exception { - EmailVerificationTicket ticket = new EmailVerificationTicket("usr123"); - ticket.setResultUrl("https://page.auth0.com/result"); - ticket.setTTLSeconds(36000); - ticket.setIncludeEmailInRedirect(true); - ticket.setClientId("client_abc"); - ticket.setOrganizationId("org_abc"); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "usr123")); - assertThat(serialized, JsonMatcher.hasEntry("result_url", "https://page.auth0.com/result")); - assertThat(serialized, JsonMatcher.hasEntry("ttl_sec", 36000)); - assertThat(serialized, JsonMatcher.hasEntry("includeEmailInRedirect", true)); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client_abc")); - assertThat(serialized, JsonMatcher.hasEntry("organization_id", "org_abc")); - } - - @Test - public void shouldSerializeWithIdentity() throws Exception { - EmailVerificationTicket ticket = new EmailVerificationTicket("usr123"); - ticket.setResultUrl("https://page.auth0.com/result"); - ticket.setTTLSeconds(36000); - EmailVerificationIdentity identity = new EmailVerificationIdentity("some-provider", "some-user-id"); - ticket.setIdentity(identity); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "usr123")); - assertThat(serialized, JsonMatcher.hasEntry("result_url", "https://page.auth0.com/result")); - assertThat(serialized, JsonMatcher.hasEntry("ttl_sec", 36000)); - - Map identityMap = new HashMap<>(); - identityMap.put("provider", "some-provider"); - identityMap.put("user_id", "some-user-id"); - assertThat(serialized, JsonMatcher.hasEntry("identity", identityMap)); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - EmailVerificationTicket ticket = fromJSON(readOnlyJson, EmailVerificationTicket.class); - assertThat(ticket, is(notNullValue())); - - assertThat(ticket.getTicket(), is("https://page.auth0.com/tickets/123")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java b/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java deleted file mode 100644 index ce73ce755..000000000 --- a/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.auth0.json.mgmt.tickets; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class PasswordChangeTicketTest extends JsonTest { - - private static final String readOnlyJson = "{\"ticket\":\"https://page.auth0.com/tickets/123\"}"; - - @SuppressWarnings("deprecation") - @Test - public void shouldSerialize() throws Exception { - PasswordChangeTicket ticket = new PasswordChangeTicket("usr123"); - ticket.setResultUrl("https://page.auth0.com/result"); - ticket.setTTLSeconds(36000); - ticket.setConnectionId("12"); - ticket.setEmail("me@auth0.com"); - ticket.setNewPassword("pass123"); - ticket.setMarkEmailAsVerified(true); - ticket.setOrganizationId("org_abc"); - ticket.setClientId("client_abc"); - ticket.setIncludeEmailInRedirect(false); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "usr123")); - assertThat(serialized, JsonMatcher.hasEntry("result_url", "https://page.auth0.com/result")); - assertThat(serialized, JsonMatcher.hasEntry("ttl_sec", 36000)); - assertThat(serialized, JsonMatcher.hasEntry("new_password", "pass123")); - assertThat(serialized, JsonMatcher.hasEntry("connection_id", "12")); - assertThat(serialized, JsonMatcher.hasEntry("email", "me@auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("mark_email_as_verified", true)); - assertThat(serialized, JsonMatcher.hasEntry("organization_id", "org_abc")); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client_abc")); - assertThat(serialized, JsonMatcher.hasEntry("includeEmailInRedirect", false)); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldSerializeWithCustomizedConnection() throws Exception { - PasswordChangeTicket ticket = new PasswordChangeTicket("user@emailprovider.com", "connid123"); - ticket.setResultUrl("https://page.auth0.com/result"); - ticket.setTTLSeconds(36000); - ticket.setEmail("me@auth0.com"); - ticket.setNewPassword("pass123"); - ticket.setUserId("usr123"); - - String serialized = toJSON(ticket); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "usr123")); - assertThat(serialized, JsonMatcher.hasEntry("result_url", "https://page.auth0.com/result")); - assertThat(serialized, JsonMatcher.hasEntry("ttl_sec", 36000)); - assertThat(serialized, JsonMatcher.hasEntry("new_password", "pass123")); - assertThat(serialized, JsonMatcher.hasEntry("connection_id", "connid123")); - assertThat(serialized, JsonMatcher.hasEntry("email", "me@auth0.com")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - PasswordChangeTicket ticket = fromJSON(readOnlyJson, PasswordChangeTicket.class); - assertThat(ticket, is(notNullValue())); - - assertThat(ticket.getTicket(), is("https://page.auth0.com/tickets/123")); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldHandleNullPasswordString() { - PasswordChangeTicket ticket = new PasswordChangeTicket("userId"); - ticket.setNewPassword((String) null); - - assertThat(ticket, is(notNullValue())); - } - - @Test - public void shouldHandleNullPasswordCharArray() { - PasswordChangeTicket ticket = new PasswordChangeTicket("userId"); - ticket.setNewPassword((char[]) null); - - assertThat(ticket, is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplateTest.java b/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplateTest.java deleted file mode 100644 index 2c7c69be9..000000000 --- a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/ListUserAttributeProfileTemplateTest.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.auth0.json.JsonMatcher.hasEntry; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.hasKey; - -public class ListUserAttributeProfileTemplateTest extends JsonTest { - - private static final String jsonWithTemplates = "{\n" + - " \"user_attribute_profile_templates\": [\n" + - " {\n" + - " \"id\": \"auth0-generic\",\n" + - " \"display_name\": \"Auth0 Generic User Attribute Profile Template\",\n" + - " \"template\": {\n" + - " \"name\": \"This is just a test\",\n" + - " \"user_id\": {\n" + - " \"oidc_mapping\": \"sub\",\n" + - " \"saml_mapping\": [\n" + - " \"urn:oid:0.9.10.10.100.1.1\"\n" + - " ],\n" + - " \"scim_mapping\": \"userName\"\n" + - " },\n" + - " \"user_attributes\": {\n" + - " \"username\": {\n" + - " \"label\": \"test User\",\n" + - " \"description\": \"This is just a test\",\n" + - " \"oidc_mapping\": {\n" + - " \"mapping\": \"preferred_username\",\n" + - " \"display_name\": \"UserName\"\n" + - " },\n" + - " \"saml_mapping\": [\n" + - " \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress\"\n" + - " ],\n" + - " \"scim_mapping\": \"displayName\",\n" + - " \"auth0_mapping\": \"testUser\",\n" + - " \"profile_required\": false,\n" + - " \"strategy_overrides\": {\n" + - " \"oidc\": {\n" + - " \"scim_mapping\": \"name.givenName\"\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - " ]\n" + - "}"; - - private static final String emptyListJson = "{\n" + - " \"user_attribute_profile_templates\": []\n" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - ListUserAttributeProfileTemplate listTemplates = new ListUserAttributeProfileTemplate(); - - UserAttributeProfileTemplate template = new UserAttributeProfileTemplate(); - template.setDisplayName("Auth0 Generic User Attribute Profile Template"); - - // Create nested UserAttributeProfile for template1 - UserAttributeProfile userProfile = new UserAttributeProfile(); - userProfile.setName("This is just a test"); - template.setTemplate(userProfile); - - listTemplates.setUserAttributeProfileTemplates(Arrays.asList(template)); - - String serialized = toJSON(listTemplates); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, hasEntry("display_name", "Auth0 Generic User Attribute Profile Template")); - assertThat(serialized, hasEntry("template", notNullValue())); - } - - @Test - public void shouldDeserialize() throws Exception { - ListUserAttributeProfileTemplate listTemplates = fromJSON(jsonWithTemplates, - ListUserAttributeProfileTemplate.class); - - assertThat(listTemplates, is(notNullValue())); - assertThat(listTemplates.getUserAttributeProfileTemplates(), is(notNullValue())); - assertThat(listTemplates.getUserAttributeProfileTemplates(), hasSize(1)); - - List templates = listTemplates.getUserAttributeProfileTemplates(); - assertThat(templates, hasSize(1)); - - // Test template details - UserAttributeProfileTemplate template = templates.get(0); - assertThat(template.getId(), is("auth0-generic")); - assertThat(template.getDisplayName(), is("Auth0 Generic User Attribute Profile Template")); - - // Test nested UserAttributeProfile template - UserAttributeProfile userAttributeProfile = template.getTemplate(); - assertThat(userAttributeProfile, is(notNullValue())); - assertThat(userAttributeProfile.getName(), is("This is just a test")); - - // Test UserId in nested template - UserId userId = userAttributeProfile.getUserId(); - assertThat(userId, is(notNullValue())); - assertThat(userId.getOidcMapping(), is("sub")); - assertThat(userId.getSamlMapping(), hasSize(1)); - assertThat(userId.getSamlMapping().get(0), is("urn:oid:0.9.10.10.100.1.1")); - assertThat(userId.getScimMapping(), is("userName")); - - // Test UserAttributes in nested template - Map userAttributes = userAttributeProfile.getUserAttributes(); - assertThat(userAttributes, is(notNullValue())); - assertThat(userAttributes, hasKey("username")); - - UserAttributes usernameAttr = userAttributes.get("username"); - assertThat(usernameAttr, is(notNullValue())); - assertThat(usernameAttr.getLabel(), is("test User")); - assertThat(usernameAttr.getDescription(), is("This is just a test")); - assertThat(usernameAttr.getAuth0Mapping(), is("testUser")); - assertThat(usernameAttr.isProfileRequired(), is(false)); - - // Test OIDC mapping in nested template - assertThat(usernameAttr.getOidcMapping(), is(notNullValue())); - assertThat(usernameAttr.getOidcMapping().getMapping(), is("preferred_username")); - assertThat(usernameAttr.getOidcMapping().getDisplayName(), is("UserName")); - - // Test SAML mapping in nested template - assertThat(usernameAttr.getSamlMapping(), hasSize(1)); - assertThat(usernameAttr.getSamlMapping().get(0), - is("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")); - - // Test SCIM mapping in nested template - assertThat(usernameAttr.getScimMapping(), is("displayName")); - - // Test strategy overrides in nested template - assertThat(usernameAttr.getStrategyOverrides(), is(notNullValue())); - assertThat(usernameAttr.getStrategyOverrides(), hasKey("oidc")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplateTest.java b/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplateTest.java deleted file mode 100644 index 67c0dbccc..000000000 --- a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTemplateTest.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.auth0.json.JsonTest; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.hasKey; -import static org.hamcrest.Matchers.hasSize; - -public class UserAttributeProfileTemplateTest extends JsonTest { - - - private static final String fullJson = "{\n" + - " \"id\": \"auth0-generic\",\n" + - " \"display_name\": \"A standard user attribute profile template\",\n" + - " \"template\": {\n" + - " \"name\": \"This is just a test\",\n" + - " \"user_id\": {\n" + - " \"oidc_mapping\": \"sub\",\n" + - " \"saml_mapping\": [\n" + - " \"urn:oid:0.9.10.10.100.1.1\"\n" + - " ],\n" + - " \"scim_mapping\": \"userName\"\n" + - " },\n" + - " \"user_attributes\": {\n" + - " \"username\": {\n" + - " \"label\": \"test User\",\n" + - " \"description\": \"This is just a test\",\n" + - " \"oidc_mapping\": {\n" + - " \"mapping\": \"preferred_username\",\n" + - " \"display_name\": \"UserName\"\n" + - " },\n" + - " \"saml_mapping\":[\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress\"],\n" + - " \"scim_mapping\":\"displayName\",\n" + - " \"auth0_mapping\": \"testUser\",\n" + - " \"profile_required\": false,\n" + - " \"strategy_overrides\": {\n" + - " \"oidc\": {\n" + - " \"scim_mapping\":\"name.givenName\"\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - UserAttributeProfileTemplate template = new UserAttributeProfileTemplate(); - template.setDisplayName("A standard user attribute profile template"); - - // Create nested UserAttributeProfile template - UserAttributeProfile userAttributeProfile = new UserAttributeProfile(); - userAttributeProfile.setName("Test Template Profile"); - - // Create and set UserId - UserId userId = new UserId(); - userId.setOidcMapping("sub"); - userId.setSamlMapping(Arrays.asList("urn:oid:0.9.10.10.100.1.1")); - userId.setScimMapping("userName"); - userAttributeProfile.setUserId(userId); - - // Create and set UserAttributes - Map userAttributesMap = new HashMap<>(); - UserAttributes userAttributes = new UserAttributes(); - userAttributes.setLabel("test User"); - userAttributes.setDescription("This is just a test"); - userAttributes.setAuth0Mapping("testUser"); - userAttributes.setProfileRequired(false); - userAttributesMap.put("username", userAttributes); - userAttributeProfile.setUserAttributes(userAttributesMap); - - template.setTemplate(userAttributeProfile); - - String serialized = toJSON(template); - assertThat(serialized, is(notNullValue())); - - // Parse the serialized JSON into a Map - ObjectMapper objectMapper = new ObjectMapper(); - Map jsonMap = objectMapper.readValue(serialized, Map.class); - - // Validate the structure - assertThat(jsonMap, hasKey("display_name")); - assertThat(jsonMap.get("display_name"), is("A standard user attribute profile template")); - assertThat(jsonMap, hasKey("template")); - - Map templateMap = (Map) jsonMap.get("template"); - assertThat(templateMap, hasKey("name")); - assertThat(templateMap.get("name"), is("Test Template Profile")); - } - - @Test - public void shouldDeserialize() throws Exception { - UserAttributeProfileTemplate template = fromJSON(fullJson, UserAttributeProfileTemplate.class); - - assertThat(template, is(notNullValue())); - assertThat(template.getId(), is("auth0-generic")); - assertThat(template.getDisplayName(), is("A standard user attribute profile template")); - - // Verify nested UserAttributeProfile template - UserAttributeProfile userAttributeProfile = template.getTemplate(); - assertThat(userAttributeProfile, is(notNullValue())); - assertThat(userAttributeProfile.getName(), is("This is just a test")); - - // Verify UserId in template - UserId userId = userAttributeProfile.getUserId(); - assertThat(userId, is(notNullValue())); - assertThat(userId.getOidcMapping(), is("sub")); - assertThat(userId.getSamlMapping(), hasSize(1)); - assertThat(userId.getSamlMapping().get(0), is("urn:oid:0.9.10.10.100.1.1")); - assertThat(userId.getScimMapping(), is("userName")); - - // Verify UserAttributes in template - Map userAttributes = userAttributeProfile.getUserAttributes(); - assertThat(userAttributes, is(notNullValue())); - assertThat(userAttributes, hasKey("username")); - - UserAttributes usernameAttr = userAttributes.get("username"); - assertThat(usernameAttr, is(notNullValue())); - assertThat(usernameAttr.getLabel(), is("test User")); - assertThat(usernameAttr.getDescription(), is("This is just a test")); - assertThat(usernameAttr.getAuth0Mapping(), is("testUser")); - assertThat(usernameAttr.isProfileRequired(), is(false)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTest.java b/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTest.java deleted file mode 100644 index 28cbf9e4e..000000000 --- a/src/test/java/com/auth0/json/mgmt/userAttributeProfiles/UserAttributeProfileTest.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.auth0.json.mgmt.userAttributeProfiles; - -import com.auth0.json.JsonTest; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.hasKey; -import static org.hamcrest.Matchers.hasSize; - -public class UserAttributeProfileTest extends JsonTest { - - private static final String fullJson = "{\n" + - " \"id\": \"uap_1234567890\",\n" + - " \"name\": \"This is just a test\",\n" + - " \"user_id\": {\n" + - " \"oidc_mapping\": \"sub\",\n" + - " \"saml_mapping\": [\n" + - " \"urn:oid:0.9.10.10.100.1.1\"\n" + - " ],\n" + - " \"scim_mapping\": \"userName\"\n" + - " },\n" + - " \"user_attributes\": {\n" + - " \"username\": {\n" + - " \"label\": \"test User\",\n" + - " \"description\": \"This is just a test\",\n" + - " \"oidc_mapping\": {\n" + - " \"mapping\": \"preferred_username\",\n" + - " \"display_name\": \"UserName\"\n" + - " },\n" + - " \"saml_mapping\":[\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress\"],\n" + - " \"scim_mapping\":\"displayName\",\n" + - " \"auth0_mapping\": \"testUser\",\n" + - " \"profile_required\": false,\n" + - " \"strategy_overrides\": {\n" + - " \"oidc\": {\n" + - " \"scim_mapping\":\"name.givenName\"\n" + - " }\n" + - " }\n" + - " }\n" + - " }\n" + - "}"; - - @Test - public void shouldSerialize() throws Exception { - UserAttributeProfile profile = new UserAttributeProfile(); - profile.setName("Test Profile"); - - // Create and set UserId - UserId userId = new UserId(); - userId.setOidcMapping("sub"); - userId.setSamlMapping(Arrays.asList("urn:oid:0.9.10.10.100.1.1")); - userId.setScimMapping("userName"); - profile.setUserId(userId); - - // Create and set UserAttributes - Map userAttributesMap = new HashMap<>(); - UserAttributes userAttributes = new UserAttributes(); - userAttributes.setLabel("test User"); - userAttributes.setDescription("This is just a test"); - userAttributes.setAuth0Mapping("testUser"); - userAttributes.setProfileRequired(false); - userAttributesMap.put("username", userAttributes); - profile.setUserAttributes(userAttributesMap); - - String serialized = toJSON(profile); - assertThat(serialized, is(notNullValue())); - - // Parse the serialized JSON into a Map - ObjectMapper objectMapper = new ObjectMapper(); - Map jsonMap = objectMapper.readValue(serialized, Map.class); - - // Validate the structure - assertThat(jsonMap, hasKey("name")); - assertThat(jsonMap.get("name"), is("Test Profile")); - assertThat(jsonMap, hasKey("user_id")); - assertThat(jsonMap, hasKey("user_attributes")); - } - - @Test - public void shouldDeserialize() throws Exception { - UserAttributeProfile profile = fromJSON(fullJson, UserAttributeProfile.class); - - assertThat(profile, is(notNullValue())); - assertThat(profile.getId(), is("uap_1234567890")); - assertThat(profile.getName(), is("This is just a test")); - - // Verify UserId deserialization - UserId userId = profile.getUserId(); - assertThat(userId, is(notNullValue())); - assertThat(userId.getOidcMapping(), is("sub")); - assertThat(userId.getSamlMapping(), hasSize(1)); - assertThat(userId.getSamlMapping().get(0), is("urn:oid:0.9.10.10.100.1.1")); - assertThat(userId.getScimMapping(), is("userName")); - - // Verify UserAttributes deserialization - Map userAttributes = profile.getUserAttributes(); - assertThat(userAttributes, is(notNullValue())); - assertThat(userAttributes, hasKey("username")); - - UserAttributes usernameAttr = userAttributes.get("username"); - assertThat(usernameAttr, is(notNullValue())); - assertThat(usernameAttr.getLabel(), is("test User")); - assertThat(usernameAttr.getDescription(), is("This is just a test")); - assertThat(usernameAttr.getAuth0Mapping(), is("testUser")); - assertThat(usernameAttr.isProfileRequired(), is(false)); - - // Verify OIDC mapping - assertThat(usernameAttr.getOidcMapping(), is(notNullValue())); - assertThat(usernameAttr.getOidcMapping().getMapping(), is("preferred_username")); - assertThat(usernameAttr.getOidcMapping().getDisplayName(), is("UserName")); - - // Verify SAML mapping - assertThat(usernameAttr.getSamlMapping(), hasSize(1)); - assertThat(usernameAttr.getSamlMapping().get(0), - is("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")); - - // Verify SCIM mapping - assertThat(usernameAttr.getScimMapping(), is("displayName")); - - // Verify strategy overrides - assertThat(usernameAttr.getStrategyOverrides(), is(notNullValue())); - assertThat(usernameAttr.getStrategyOverrides(), hasKey("oidc")); - } - -} diff --git a/src/test/java/com/auth0/json/mgmt/userblocks/BlockDetailsTest.java b/src/test/java/com/auth0/json/mgmt/userblocks/BlockDetailsTest.java deleted file mode 100644 index d8efdba30..000000000 --- a/src/test/java/com/auth0/json/mgmt/userblocks/BlockDetailsTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.auth0.json.mgmt.userblocks; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class BlockDetailsTest extends JsonTest { - - private static final String json = "{\"ip\":\"10.0.0.1\", \"identifier\":\"username\"}"; - - @Test - public void shouldDeserialize() throws Exception { - BlockDetails details = fromJSON(json, BlockDetails.class); - - assertThat(details, is(notNullValue())); - assertThat(details.getIdentifier(), is("username")); - assertThat(details.getIP(), is("10.0.0.1")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/userblocks/UserBlocksTest.java b/src/test/java/com/auth0/json/mgmt/userblocks/UserBlocksTest.java deleted file mode 100644 index e51d244a7..000000000 --- a/src/test/java/com/auth0/json/mgmt/userblocks/UserBlocksTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.json.mgmt.userblocks; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class UserBlocksTest extends JsonTest { - - private static final String json = "{\"blocked_for\":[{},{}]}"; - - @Test - public void shouldDeserialize() throws Exception { - UserBlocks blocks = fromJSON(json, UserBlocks.class); - - assertThat(blocks, is(notNullValue())); - assertThat(blocks.getBlockedFor(), is(notNullValue())); - assertThat(blocks.getBlockedFor(), hasSize(2)); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/IdentityTest.java b/src/test/java/com/auth0/json/mgmt/users/IdentityTest.java deleted file mode 100644 index 914f98102..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/IdentityTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class IdentityTest extends JsonTest { - - private static final String json = "{\"connection\":\"auth0\",\"user_id\":\"user|123\",\"isSocial\":true,\"provider\":\"oauth\",\"access_token\":\"aTokEn\",\"profileData\":{},\"access_token_secret\":\"s3cr3t\"}"; - - @Test - public void shouldDeserialize() throws Exception { - Identity identity = fromJSON(json, Identity.class); - - assertThat(identity, is(notNullValue())); - assertThat(identity.getConnection(), is("auth0")); - assertThat(identity.getUserId(), is("user|123")); - assertThat(identity.isSocial(), is(true)); - assertThat(identity.getProvider(), is("oauth")); - assertThat(identity.getAccessToken(), is("aTokEn")); - assertThat(identity.getProfileData(), is(notNullValue())); - assertThat(identity.getValues(), is(notNullValue())); - assertThat(identity.getValues(), hasEntry("access_token_secret", "s3cr3t")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/ProfileDataTest.java b/src/test/java/com/auth0/json/mgmt/users/ProfileDataTest.java deleted file mode 100644 index fae21fabf..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/ProfileDataTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.collection.IsMapContaining.hasEntry; - -public class ProfileDataTest extends JsonTest { - - private static final String json = "{\"email\":\"me@auth0.com\",\"email_verified\":true,\"name\":\"John\", \"username\":\"usr\", \"given_name\":\"John\", \"family_name\":\"Walker\", \"phone_number\":\"1234567890\", \"phone_verified\":true, \"description\":\"My description\"}"; - - @Test - public void shouldDeserialize() throws Exception { - ProfileData data = fromJSON(json, ProfileData.class); - - assertThat(data, is(notNullValue())); - assertThat(data.getEmail(), is("me@auth0.com")); - assertThat(data.isEmailVerified(), is(true)); - assertThat(data.getName(), is("John")); - assertThat(data.getUsername(), is("usr")); - assertThat(data.getGivenName(), is("John")); - assertThat(data.getFamilyName(), is("Walker")); - assertThat(data.getPhoneNumber(), is("1234567890")); - assertThat(data.isPhoneVerified(), is(true)); - assertThat(data.getValues(), is(notNullValue())); - assertThat(data.getValues(), hasEntry("description", "My description")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/RecoveryCodeTest.java b/src/test/java/com/auth0/json/mgmt/users/RecoveryCodeTest.java deleted file mode 100644 index 9533baf59..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/RecoveryCodeTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class RecoveryCodeTest extends JsonTest { - - private static final String json = "{\"recovery_code\":\"supersecretCODE\"}"; - - @Test - public void shouldDeserialize() throws Exception { - RecoveryCode code = fromJSON(json, RecoveryCode.class); - - assertThat(code, is(notNullValue())); - assertThat(code.getCode(), is("supersecretCODE")); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/UserTest.java b/src/test/java/com/auth0/json/mgmt/users/UserTest.java deleted file mode 100644 index 0d0cc3dae..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/UserTest.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.hamcrest.collection.IsMapContaining.hasEntry; - -public class UserTest extends JsonTest { - - private static final String json = "{\"user_id\":\"user|123\",\"connection\":\"auth0\",\"client_id\":\"client123\",\"password\":\"pwd\",\"verify_password\":true,\"username\":\"usr\",\"email\":\"me@auth0.com\",\"email_verified\":true,\"verify_email\":true,\"phone_number\":\"1234567890\",\"phone_verified\":true,\"verify_phone_number\":true,\"picture\":\"https://pic.ture/12\",\"name\":\"John\",\"nickname\":\"Johny\",\"given_name\":\"John\",\"family_name\":\"Walker\",\"app_metadata\":{},\"user_metadata\":{},\"blocked\":true,\"context\":\"extra information\"}"; - private static final String readOnlyJson = "{\"user_id\":\"user|123\",\"last_ip\":\"10.0.0.1\",\"last_login\":\"2016-02-23T19:57:29.532Z\",\"last_password_reset\":\"2016-02-23T19:57:29Z\",\"logins_count\":10,\"created_at\":\"2016-02-23T19:57:29.532Z\",\"updated_at\":\"2016-02-23T19:57:29.532Z\",\"identities\":[]}"; - - @Test - public void shouldHaveEmptyValuesByDefault() { - User user = new User(); - assertThat(user.getValues(), is(notNullValue())); - - User user2 = new User("my-connection"); - assertThat(user2.getConnection(), is("my-connection")); - assertThat(user2.getValues(), is(notNullValue())); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldSerialize() throws Exception { - User user = new User("auth0"); - user.setId("123456789"); - user.setPassword("pwd"); - user.setVerifyPassword(true); - user.setUsername("usr"); - user.setEmail("me@auth0.com"); - user.setClientId("client123"); - user.setVerifyEmail(true); - user.setEmailVerified(true); - user.setPhoneNumber("1234567890"); - user.setVerifyPhoneNumber(true); - user.setPhoneVerified(true); - user.setPicture("https://pic.ture/12"); - user.setName("John"); - user.setNickname("Johny"); - user.setGivenName("John"); - user.setFamilyName("Walker"); - user.setUserMetadata(Collections.emptyMap()); - user.setAppMetadata(Collections.emptyMap()); - user.setBlocked(true); - - String serialized = toJSON(user); - assertThat(serialized, is(notNullValue())); - - assertThat(serialized, JsonMatcher.hasEntry("connection", "auth0")); - assertThat(serialized, JsonMatcher.hasEntry("user_id", "123456789")); - assertThat(serialized, JsonMatcher.hasEntry("password", "pwd")); - assertThat(serialized, JsonMatcher.hasEntry("verify_password", true)); - assertThat(serialized, JsonMatcher.hasEntry("username", "usr")); - assertThat(serialized, JsonMatcher.hasEntry("email", "me@auth0.com")); - assertThat(serialized, JsonMatcher.hasEntry("verify_email", true)); - assertThat(serialized, JsonMatcher.hasEntry("email_verified", true)); - assertThat(serialized, JsonMatcher.hasEntry("client_id", "client123")); - assertThat(serialized, JsonMatcher.hasEntry("phone_number", "1234567890")); - assertThat(serialized, JsonMatcher.hasEntry("verify_phone_number", true)); - assertThat(serialized, JsonMatcher.hasEntry("phone_verified", true)); - assertThat(serialized, JsonMatcher.hasEntry("picture", "https://pic.ture/12")); - assertThat(serialized, JsonMatcher.hasEntry("name", "John")); - assertThat(serialized, JsonMatcher.hasEntry("nickname", "Johny")); - assertThat(serialized, JsonMatcher.hasEntry("given_name", "John")); - assertThat(serialized, JsonMatcher.hasEntry("family_name", "Walker")); - assertThat(serialized, JsonMatcher.hasEntry("user_metadata", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("app_metadata", notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("blocked", true)); - } - - @Test - public void shouldDeserialize() throws Exception { - User user = fromJSON(json, User.class); - - assertThat(user, is(notNullValue())); - assertThat(user.getId(), is("user|123")); - assertThat(user.getConnection(), is("auth0")); - assertThat(user.getPassword(), is(new char[]{'p','w','d'})); - assertThat(user.willVerifyPassword(), is(true)); - assertThat(user.getUsername(), is("usr")); - assertThat(user.getEmail(), is("me@auth0.com")); - assertThat(user.willVerifyEmail(), is(true)); - assertThat(user.getClientId(), is("client123")); - assertThat(user.isEmailVerified(), is(true)); - assertThat(user.getPhoneNumber(), is("1234567890")); - assertThat(user.willVerifyPhoneNumber(), is(true)); - assertThat(user.isPhoneVerified(), is(true)); - assertThat(user.getPicture(), is("https://pic.ture/12")); - assertThat(user.getName(), is("John")); - assertThat(user.getNickname(), is("Johny")); - assertThat(user.getGivenName(), is("John")); - assertThat(user.getFamilyName(), is("Walker")); - assertThat(user.getUserMetadata(), is(notNullValue())); - assertThat(user.getAppMetadata(), is(notNullValue())); - assertThat(user.isBlocked(), is(true)); - assertThat(user.getValues(), is(notNullValue())); - assertThat(user.getValues(), hasEntry("context", "extra information")); - } - - @Test - public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { - User user = fromJSON(readOnlyJson, User.class); - assertThat(user, is(notNullValue())); - - assertThat(user.getId(), is("user|123")); - assertThat(user.getCreatedAt(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(user.getUpdatedAt(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(user.getLastLogin(), is(parseJSONDate("2016-02-23T19:57:29.532Z"))); - assertThat(user.getLastPasswordReset(), is(parseJSONDate("2016-02-23T19:57:29.000Z"))); - assertThat(user.getIdentities(), is(notNullValue())); - assertThat(user.getLastIP(), is("10.0.0.1")); - assertThat(user.getLoginsCount(), is(10)); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldHandleNullPasswordString() { - User user = new User(); - user.setPassword((String) null); - - assertThat(user.getPassword(), is(nullValue())); - } - - @Test - public void shouldHandleNullPasswordCharArray() { - User user = new User(); - user.setPassword((char[]) null); - - assertThat(user.getPassword(), is(nullValue())); - } - - @SuppressWarnings("deprecation") - @Test - public void shouldGetPasswordAsCharArray() { - String password = "secret"; - User user = new User(); - user.setPassword(password); - - assertThat(user.getPassword(), is(password.toCharArray())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/UsersPageTest.java b/src/test/java/com/auth0/json/mgmt/users/UsersPageTest.java deleted file mode 100644 index 6e0095dd4..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/UsersPageTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.auth0.json.mgmt.users; - -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class UsersPageTest extends JsonTest { - private static final String jsonWithTotals = "{\"start\":0,\"length\":10,\"total\":14,\"limit\":50,\"users\":[{\"connection\":\"auth0\",\"client_id\":\"client123\",\"password\":\"pwd\",\"verify_password\":true,\"username\":\"usr\",\"email\":\"me@auth0.com\",\"email_verified\":true,\"verify_email\":true,\"phone_number\":\"1234567890\",\"phone_verified\":true,\"verify_phone_number\":true,\"picture\":\"https://pic.ture/12\",\"name\":\"John\",\"nickname\":\"Johny\",\"given_name\":\"John\",\"family_name\":\"Walker\",\"created_at\":\"2016-02-23T19:57:29.532Z\",\"updated_at\":\"2016-02-23T19:57:29.532Z\",\"identities\":[],\"app_metadata\":{},\"user_metadata\":{},\"last_ip\":\"10.0.0.1\",\"last_login\":\"2016-02-23T19:57:29.532Z\",\"logins_count\":10,\"blocked\":true}]}"; - private static final String jsonWithoutTotals = "[{\"connection\":\"auth0\",\"client_id\":\"client123\",\"password\":\"pwd\",\"verify_password\":true,\"username\":\"usr\",\"email\":\"me@auth0.com\",\"email_verified\":true,\"verify_email\":true,\"phone_number\":\"1234567890\",\"phone_verified\":true,\"verify_phone_number\":true,\"picture\":\"https://pic.ture/12\",\"name\":\"John\",\"nickname\":\"Johny\",\"given_name\":\"John\",\"family_name\":\"Walker\",\"created_at\":\"2016-02-23T19:57:29.532Z\",\"updated_at\":\"2016-02-23T19:57:29.532Z\",\"identities\":[],\"app_metadata\":{},\"user_metadata\":{},\"last_ip\":\"10.0.0.1\",\"last_login\":\"2016-02-23T19:57:29.532Z\",\"logins_count\":10,\"blocked\":true}]"; - private static final String jsonWithCheckpointPageResponse = "{\"users\":[{\"connection\":\"auth0\",\"client_id\":\"client123\",\"password\":\"pwd\",\"verify_password\":true,\"username\":\"usr\",\"email\":\"me@auth0.com\",\"email_verified\":true,\"verify_email\":true,\"phone_number\":\"1234567890\",\"phone_verified\":true,\"verify_phone_number\":true,\"picture\":\"https://pic.ture/12\",\"name\":\"John\",\"nickname\":\"Johny\",\"given_name\":\"John\",\"family_name\":\"Walker\",\"created_at\":\"2016-02-23T19:57:29.532Z\",\"updated_at\":\"2016-02-23T19:57:29.532Z\",\"identities\":[],\"app_metadata\":{},\"user_metadata\":{},\"last_ip\":\"10.0.0.1\",\"last_login\":\"2016-02-23T19:57:29.532Z\",\"logins_count\":10,\"blocked\":true}],\"next\":\"MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw\"}"; - - @Test - public void shouldDeserializeWithoutTotals() throws Exception { - UsersPage page = fromJSON(jsonWithoutTotals, UsersPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - - @Test - public void shouldDeserializeWithTotals() throws Exception { - UsersPage page = fromJSON(jsonWithTotals, UsersPage.class); - - assertThat(page, is(notNullValue())); - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(10)); - assertThat(page.getTotal(), is(14)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getNext(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getItems().size(), is(1)); - } - - @Test - public void shouldDeserializeWithCheckpointResponse() throws Exception { - UsersPage page = fromJSON(jsonWithCheckpointPageResponse, UsersPage.class); - - assertThat(page.getStart(), is(nullValue())); - assertThat(page.getLength(), is(nullValue())); - assertThat(page.getTotal(), is(nullValue())); - assertThat(page.getLimit(), is(nullValue())); - assertThat(page.getItems(), is(notNullValue())); - assertThat(page.getNext(), is("MjAyMS0wMy0yOSAxNjo1MDo09s44NDYxODcrMDAsb3JnX2Y0VXZUbG1iSWd2005zTGw")); - assertThat(page.getItems().size(), is(1)); - } - - @Test - public void shouldBeCreatedWithoutNextField() { - UsersPage page = new UsersPageDeserializer().createPage(0, 5, 20, 50, new ArrayList<>()); - - assertThat(page.getStart(), is(0)); - assertThat(page.getLength(), is(5)); - assertThat(page.getTotal(), is(20)); - assertThat(page.getLimit(), is(50)); - assertThat(page.getItems(), is(notNullValue())); - } -} diff --git a/src/test/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodTest.java b/src/test/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodTest.java deleted file mode 100644 index bbe8c9a8a..000000000 --- a/src/test/java/com/auth0/json/mgmt/users/authenticationmethods/AuthenticationMethodTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.auth0.json.mgmt.users.authenticationmethods; - -import com.auth0.json.JsonMatcher; -import com.auth0.json.JsonTest; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.core.Is.is; - -public class AuthenticationMethodTest extends JsonTest { - - @Test - public void shouldDeserialize() throws Exception { - String orgJson = "{\n" + - " \"id\":\"email|dev_1cIsjj3hICWeOWTb\",\n" + - " \"type\":\"email\",\n" + - " \"confirmed\":true,\n" + - " \"email\":\"****@temp****\",\n" + - " \"name\":\"name\",\n" + - " \"link_id\":\"linkId\",\n" + - " \"phone_number\":\"1231212312\",\n" + - " \"key_id\":\"keyId\",\n" + - " \"public_key\":\"publicKey\",\n" + - " \"created_at\":\"2023-01-19T15:15:16.427Z\",\n" + - " \"enrolled_at\":\"2023-01-19T15:15:16.427Z\",\n" + - " \"last_auth_at\":\"2023-01-19T15:15:16.427Z\",\n" + - " \"last_auth_at\":\"2023-01-19T15:15:16.427Z\",\n" + - " \"totp_secret\":\"totp\",\n" + - " \"preferred_authentication_method\":\"phone\",\n" + - " \"relying_party_identifier\":\"abc\",\n" + - " \"authentication_methods\":[{\"id\": \"id\", \"type\": \"type\"}],\n" + - " \"credential_device_type\": \"single_device\",\n" + - " \"credential_backed_up\": true,\n" + - " \"identity_user_id\": \"identityId\",\n" + - " \"user_agent\": \"userAgent\"" + - " }"; - - - AuthenticationMethod authenticationMethod = fromJSON(orgJson, AuthenticationMethod.class); - assertThat(authenticationMethod, is(notNullValue())); - assertThat(authenticationMethod.getId(), is("email|dev_1cIsjj3hICWeOWTb")); - assertThat(authenticationMethod.getType(), is("email")); - assertThat(authenticationMethod.getName(), is("name")); - assertThat(authenticationMethod.getLinkId(), is("linkId")); - assertThat(authenticationMethod.getPhoneNumber(), is("1231212312")); - assertThat(authenticationMethod.getKeyId(), is("keyId")); - assertThat(authenticationMethod.getPublicKey(), is("publicKey")); - assertThat(authenticationMethod.getTotpSecret(), is("totp")); - assertThat(authenticationMethod.getPreferredAuthenticationMethod(), is("phone")); - assertThat(authenticationMethod.getRelyingPartyIdentifier(), is("abc")); - assertThat(authenticationMethod.getConfirmed(), is(true)); - assertThat(authenticationMethod.getEmail(), is("****@temp****")); - assertThat(authenticationMethod.getCreatedAt(), is(parseJSONDate(("2023-01-19T15:15:16.427Z")))); - assertThat(authenticationMethod.getLastAuthedAt(), is(parseJSONDate(("2023-01-19T15:15:16.427Z")))); - assertThat(authenticationMethod.getEnrolledAt(), is(parseJSONDate(("2023-01-19T15:15:16.427Z")))); - assertThat(authenticationMethod.getAuthenticationMethods(), hasSize(1)); - assertThat(authenticationMethod.getAuthenticationMethods().get(0).getId(), is("id")); - assertThat(authenticationMethod.getAuthenticationMethods().get(0).getType(), is("type")); - assertThat(authenticationMethod.getCredentialDeviceType(), is("single_device")); - assertThat(authenticationMethod.getCredentialBackedUp(), is(true)); - assertThat(authenticationMethod.getIdentityUserId(), is("identityId")); - assertThat(authenticationMethod.getUserAgent(), is("userAgent")); - } - - @Test - public void shouldSerialize() throws Exception { - AuthenticationMethod authenticationMethod = new AuthenticationMethod(); - - authenticationMethod.setType("phone"); - authenticationMethod.setName("abc"); - authenticationMethod.setPhoneNumber("1231212312"); - authenticationMethod.setKeyId("keyid"); - authenticationMethod.setPublicKey("pubkey"); - authenticationMethod.setTotpSecret("totp"); - authenticationMethod.setPreferredAuthenticationMethod("phone"); - authenticationMethod.setRelyingPartyIdentifier("123"); - authenticationMethod.setEmail("temp@temp.com"); - - String serialized = toJSON(authenticationMethod); - assertThat(serialized, is(notNullValue())); - assertThat(serialized, JsonMatcher.hasEntry("type", "phone")); - assertThat(serialized, JsonMatcher.hasEntry("name", "abc")); - assertThat(serialized, JsonMatcher.hasEntry("phone_number", "1231212312")); - assertThat(serialized, JsonMatcher.hasEntry("key_id", "keyid")); - assertThat(serialized, JsonMatcher.hasEntry("public_key", "pubkey")); - assertThat(serialized, JsonMatcher.hasEntry("totp_secret", "totp")); - assertThat(serialized, JsonMatcher.hasEntry("preferred_authentication_method", "phone")); - assertThat(serialized, JsonMatcher.hasEntry("relying_party_identifier", "123")); - assertThat(serialized, JsonMatcher.hasEntry("email", "temp@temp.com")); - } -} - diff --git a/src/test/java/com/auth0/net/BaseRequestTest.java b/src/test/java/com/auth0/net/BaseRequestTest.java deleted file mode 100644 index 4521e8bd9..000000000 --- a/src/test/java/com/auth0/net/BaseRequestTest.java +++ /dev/null @@ -1,507 +0,0 @@ -package com.auth0.net; - -import com.auth0.AssertsUtil; -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.TokenProvider; -import com.auth0.exception.APIException; -import com.auth0.exception.Auth0Exception; -import com.auth0.exception.RateLimitException; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.client.*; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import okhttp3.mockwebserver.RecordedRequest; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -// FIXME: These test require mocking of the final class okhttp3.Response. To do so -// an opt-in incubating Mockito feature is used, for more information see: -// https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#mock-the-unmockable-opt-in-mocking-of-final-classesmethods -// This issue can be tracked to see if/when this feature will become standard for Mockito (perhaps Mockito 4): -// https://github.com/mockito/mockito/issues/1728 -public class BaseRequestTest { - private MockServer server; - private Auth0HttpClient client; - private TokenProvider tokenProvider; - - private TypeReference tokenHolderType; - private TypeReference listType; - private TypeReference voidType; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - client = DefaultHttpClient.newBuilder().withMaxRetries(0).build(); - tokenHolderType = new TypeReference() { - }; - listType = new TypeReference() { - }; - voidType = new TypeReference() { - }; - tokenProvider = new TokenProvider() { - @Override - public String getToken() { - return "xyz"; - } - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.completedFuture("xyz"); - } - }; - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - @Test - public void handlesIOException() throws Exception { - DefaultHttpClient client = mock(DefaultHttpClient.class); - when(client.sendRequest(any())).thenThrow(IOException.class); - - BaseRequest req = new BaseRequest(client, tokenProvider, "", HttpMethod.GET, new TypeReference() { - }) { - @Override - public BaseRequest addHeader(String name, String value) { - return null; - } - - @Override - public BaseRequest addParameter(String name, Object value) { - return null; - } - - @Override - public BaseRequest setBody(Object body) { - return null; - } - - @Override - protected Auth0HttpRequest createRequest(String apiToken) { - return null; - } - - @Override - protected String parseResponseBody(Auth0HttpResponse response) { - return null; - } - }; - - Auth0Exception exception = verifyThrows(Auth0Exception.class, req::execute); - assertThat(exception.getCause(), is(instanceOf(IOException.class))); - } - - @Test - public void asyncHandlesIOExceptionWhenCreatingRequest() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - - BaseRequest req = new BaseRequest(client, tokenProvider, "", HttpMethod.GET, new TypeReference() { - }) { - @Override - public BaseRequest addHeader(String name, String value) { - return null; - } - - @Override - public BaseRequest addParameter(String name, Object value) { - return null; - } - - @Override - public BaseRequest setBody(Object body) { - return null; - } - - @Override - protected Auth0HttpRequest createRequest(String apiToken) throws Auth0Exception { - throw new Auth0Exception("error", new IOException("boom")); - } - - @Override - protected String parseResponseBody(Auth0HttpResponse response) { - return null; - } - }; - - Auth0HttpRequest a0Request = Auth0HttpRequest.newBuilder("https://foo.com", HttpMethod.GET).build(); - CompletableFuture> future = req.executeAsync(); - ExecutionException e = verifyThrows(ExecutionException.class, future::get); - assertThat(e.getCause(), is(instanceOf(IOException.class))); - } - - @Test - public void shouldCreateGETRequest() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, tokenHolderType); - assertThat(request, Matchers.is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), Matchers.is(HttpMethod.GET.toString())); - assertThat(execute, Matchers.is(notNullValue())); - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - assertThat(request, Matchers.is(notNullValue())); - request.addParameter("non_empty", "body"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), Matchers.is(HttpMethod.POST.toString())); - assertThat(execute, Matchers.is(notNullValue())); - } - - @Test - public void shouldAddParameters() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - Map mapValue = mock(Map.class); - request.addParameter("key", "value"); - request.addParameter("map", mapValue); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - Map values = bodyFromRequest(recordedRequest); - assertThat(values, hasEntry("key", "value")); - assertThat(values, hasEntry("map", mapValue)); - } - - @Test - public void shouldAddHeaders() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - request.addParameter("non_empty", "body"); - request.addHeader("Extra-Info", "this is a test"); - request.addHeader("Authorization", "Bearer my_access_token"); - request.addHeader("X-Client-Quota", getTokenQuotaString()); - request.addHeader("X-Organization-Quota", getTokenQuotaString()); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Extra-Info"), Matchers.is("this is a test")); - // auth header will be done on the request handling - assertThat(recordedRequest.getHeader("Authorization"), Matchers.is("Bearer xyz")); - } - - @Test - public void shouldNotOverrideContentTypeHeader() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - request.addParameter("non_empty", "body"); - request.addHeader("Content-Type", "plaintext"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Content-Type"), Matchers.is("application/json")); - } - - @Test - public void shouldThrowOnBodyCreationFailure() throws Exception { - ObjectMapper mapper = mock(ObjectMapper.class); - when(mapper.writeValueAsBytes(any(Object.class))).thenThrow(JsonProcessingException.class); - - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, mapper, voidType); - request.addParameter("name", "value"); - - Auth0Exception e = AssertsUtil.verifyThrows(Auth0Exception.class, - () -> request.execute().getBody(), - "Couldn't create the request body."); - assertThat(e.getCause(), Matchers.instanceOf(JsonProcessingException.class)); - } - - @Test - public void shouldParseSuccessfulResponse() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, tokenHolderType); - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - server.takeRequest(); - - assertThat(response, Matchers.is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), Matchers.is(notNullValue())); - } - - @Test - public void shouldThrowOnParseInvalidSuccessfulResponse() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(AUTH_TOKENS, 200); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(Matchers.instanceOf(JsonMappingException.class))); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 200: Failed to parse the response body.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("Failed to parse the response body.")); - assertThat(authException.getError(), Matchers.is(nullValue())); - assertThat(authException.getStatusCode(), Matchers.is(200)); - } - - @Test - public void shouldParseJSONErrorResponseWithErrorDescription() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(AUTH_ERROR_WITH_ERROR_DESCRIPTION, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: the connection was not found")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("the connection was not found")); - assertThat(authException.getError(), Matchers.is("invalid_request")); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithError() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(AUTH_ERROR_WITH_ERROR, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: missing username for Username-Password-Authentication connection with requires_username enabled")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("missing username for Username-Password-Authentication connection with requires_username enabled")); - assertThat(authException.getError(), Matchers.is("missing username for Username-Password-Authentication connection with requires_username enabled")); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @SuppressWarnings("RedundantCast") - @Test - public void shouldParseJSONErrorResponseWithDescriptionAndExtraProperties() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(AUTH_ERROR_WITH_DESCRIPTION_AND_EXTRA_PROPERTIES, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: Multifactor authentication required")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("Multifactor authentication required")); - assertThat(authException.getError(), Matchers.is("mfa_required")); - assertThat(authException.getValue("mfa_token"), Matchers.is((Object) "Fe26...Ha")); - assertThat(authException.getValue("non_existing_key"), Matchers.is(nullValue())); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithDescription() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(AUTH_ERROR_WITH_DESCRIPTION, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: The user already exists.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("The user already exists.")); - assertThat(authException.getError(), Matchers.is("user_exists")); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithMessage() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.jsonResponse(MGMT_ERROR_WITH_MESSAGE, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: Query validation error: 'String 'invalid_field' does not match pattern. Must be a comma separated list of the following values: allowed_logout_urls,change_password.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("Query validation error: 'String 'invalid_field' does not match pattern. Must be a comma separated list of the following values: allowed_logout_urls,change_password.")); - assertThat(authException.getError(), Matchers.is("invalid_query_string")); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @Test - public void shouldParsePlainTextErrorResponse() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.textResponse(AUTH_ERROR_PLAINTEXT, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(APIException.class))); - assertThat(exception.getCause(), Matchers.is(Matchers.instanceOf(JsonParseException.class))); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 400: A plain-text error response")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), Matchers.is("A plain-text error response")); - assertThat(authException.getError(), Matchers.is(nullValue())); - assertThat(authException.getValue("non_existing_key"), Matchers.is(nullValue())); - assertThat(authException.getStatusCode(), Matchers.is(400)); - } - - @Test - public void shouldParseRateLimitException() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.rateLimitReachedResponse(100, 10, 5, RATE_LIMIT_ERROR); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 429: Global limit has been reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), Matchers.is("Global limit has been reached")); - assertThat(rateLimitException.getError(), Matchers.is("too_many_requests")); - assertThat(rateLimitException.getValue("non_existing_key"), Matchers.is(nullValue())); - assertThat(rateLimitException.getStatusCode(), Matchers.is(429)); - assertThat(rateLimitException.getLimit(), Matchers.is(100L)); - assertThat(rateLimitException.getRemaining(), Matchers.is(10L)); - assertThat(rateLimitException.getReset(), Matchers.is(5L)); - } - - @Test - public void shouldParseRateLimitExceptionWithZeroRemaining() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.rateLimitReachedResponse(100, 0, 5, RATE_LIMIT_ERROR, getTokenQuotaString(), getTokenQuotaString(), 1000); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 429: Global limit has been reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), Matchers.is("Global limit has been reached")); - assertThat(rateLimitException.getError(), Matchers.is("too_many_requests")); - assertThat(rateLimitException.getValue("non_existing_key"), Matchers.is(nullValue())); - assertThat(rateLimitException.getStatusCode(), Matchers.is(429)); - assertThat(rateLimitException.getLimit(), Matchers.is(100L)); - assertThat(rateLimitException.getRemaining(), Matchers.is(0L)); - assertThat(rateLimitException.getReset(), Matchers.is(5L)); - assertThat(rateLimitException.getClientQuotaLimit().getPerDay().getQuota(), Matchers.is(getTokenQuota().getPerDay().getQuota())); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerDay().getQuota(), Matchers.is(getTokenQuota().getPerDay().getQuota())); - } - - @Test - public void shouldDefaultRateLimitsHeadersWhenMissing() throws Exception { - BaseRequest request = new BaseRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, listType); - server.rateLimitReachedResponse(-1, -1, -1); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, Matchers.is(notNullValue())); - assertThat(exception, Matchers.is(Matchers.instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), Matchers.is(nullValue())); - assertThat(exception.getMessage(), Matchers.is("Request failed with status code 429: Rate limit reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), Matchers.is("Rate limit reached")); - assertThat(rateLimitException.getError(), Matchers.is(nullValue())); - assertThat(rateLimitException.getValue("non_existing_key"), Matchers.is(nullValue())); - assertThat(rateLimitException.getStatusCode(), Matchers.is(429)); - assertThat(rateLimitException.getLimit(), Matchers.is(-1L)); - assertThat(rateLimitException.getRemaining(), Matchers.is(-1L)); - assertThat(rateLimitException.getReset(), Matchers.is(-1L)); - assertThat(rateLimitException.getClientQuotaLimit(), Matchers.is(nullValue())); - assertThat(rateLimitException.getOrganizationQuotaLimit(), Matchers.is(nullValue())); - } - - private TokenQuotaBucket getTokenQuota() { - TokenQuotaLimit perHourLimit = new TokenQuotaLimit(100, 80, 3600); - TokenQuotaLimit perDayLimit = new TokenQuotaLimit(100, 90, 86400); - return new TokenQuotaBucket(perHourLimit, perDayLimit); - } - - public String getTokenQuotaString() { - TokenQuotaLimit perHourLimit = new TokenQuotaLimit(100, 80, 3600); - TokenQuotaLimit perDayLimit = new TokenQuotaLimit(100, 90, 86400); - - StringBuilder builder = new StringBuilder(); - - builder.append(String.format("b=per_hour;q=%d;r=%d;t=%d", - perHourLimit.getQuota(), perHourLimit.getRemaining(), perHourLimit.getResetAfter())); - - if (builder.length() > 0) { - builder.append(","); - } - builder.append(String.format("b=per_day;q=%d;r=%d;t=%d", - perDayLimit.getQuota(), perDayLimit.getRemaining(), perDayLimit.getResetAfter())); - - return builder.toString(); - } -} diff --git a/src/test/java/com/auth0/net/EmptyBodyRequestTest.java b/src/test/java/com/auth0/net/EmptyBodyRequestTest.java deleted file mode 100644 index a284bab31..000000000 --- a/src/test/java/com/auth0/net/EmptyBodyRequestTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.SimpleTokenProvider; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.client.MockServer.AUTH_TOKENS; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.mockito.Mockito.mock; - -public class EmptyBodyRequestTest { - - private MockServer server; - private Auth0HttpClient client; - - private TypeReference tokenHolderType; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - client = new DefaultHttpClient.Builder().build(); - tokenHolderType = new TypeReference() { - }; - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - @Test - public void shouldCreateEmptyRequestBody() throws Exception { - EmptyBodyRequest request = new EmptyBodyRequest<>(client, SimpleTokenProvider.create("apiToken"), server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(recordedRequest.getBodySize(), is(0L)); - } - - @Test - public void shouldNotAddParameters() throws Exception { - EmptyBodyRequest request = new EmptyBodyRequest<>(client, SimpleTokenProvider.create("apiToken"), server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - Map mapValue = mock(Map.class); - request.addParameter("key", "value"); - request.addParameter("map", mapValue); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(recordedRequest.getBodySize(), is(0L)); - } -} diff --git a/src/test/java/com/auth0/net/EmptyBodyVoidRequestTest.java b/src/test/java/com/auth0/net/EmptyBodyVoidRequestTest.java deleted file mode 100644 index ba356b36c..000000000 --- a/src/test/java/com/auth0/net/EmptyBodyVoidRequestTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.TokenProvider; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; - -import static com.auth0.client.MockServer.AUTH_TOKENS; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class EmptyBodyVoidRequestTest { - - private Auth0HttpClient client; - private TokenProvider tokenProvider; - private MockServer server; - - @BeforeEach - public void setUp() throws Exception { - client = new DefaultHttpClient.Builder().build(); - server = new MockServer(); - tokenProvider = new TokenProvider() { - @Override - public String getToken() { - return "Bearer abc"; - } - - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.completedFuture("Bearer abc"); - } - }; - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - EmptyBodyVoidRequest request = new EmptyBodyVoidRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, new TypeReference() {}); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - Void execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(execute, is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/net/FormBodyRequestTest.java b/src/test/java/com/auth0/net/FormBodyRequestTest.java deleted file mode 100644 index 0625e439c..000000000 --- a/src/test/java/com/auth0/net/FormBodyRequestTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.TokenProvider; -import com.auth0.json.auth.PushedAuthorizationResponse; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import com.fasterxml.jackson.core.type.TypeReference; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; - -import static com.auth0.client.MockServer.PUSHED_AUTHORIZATION_RESPONSE; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class FormBodyRequestTest { - private MockServer server; - private Auth0HttpClient client; - private TokenProvider tokenProvider; - - private TypeReference pushedAuthorizationResponseTypeReference; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - client = new DefaultHttpClient.Builder().withMaxRetries(0).build(); - pushedAuthorizationResponseTypeReference = new TypeReference() { - }; - tokenProvider = new TokenProvider() { - @Override - public String getToken() { - return "xyz"; - } - - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.completedFuture("xyz"); - } - }; - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - FormBodyRequest request = new FormBodyRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, pushedAuthorizationResponseTypeReference); - assertThat(request, is(notNullValue())); - request.addParameter("audience", "aud"); - request.addParameter("connection", "conn"); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 201); - PushedAuthorizationResponse execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(execute, is(notNullValue())); - } - - @Test - public void shouldNotOverrideContentTypeHeader() throws Exception { - FormBodyRequest request = new FormBodyRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, pushedAuthorizationResponseTypeReference); - request.addHeader("Content-Type", "plaintext"); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 201); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Content-Type"), containsString("application/x-www-form-urlencoded")); - } - - @Test - public void shouldAddHeaders() throws Exception { - FormBodyRequest request = new FormBodyRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, pushedAuthorizationResponseTypeReference); - request.addHeader("Extra-Info", "this is a test"); - request.addHeader("Authorization", "Bearer my_access_token"); - - server.jsonResponse(PUSHED_AUTHORIZATION_RESPONSE, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Extra-Info"), is("this is a test")); - assertThat(recordedRequest.getHeader("Authorization"), is("Bearer xyz")); - } -} diff --git a/src/test/java/com/auth0/net/MultipartRequestTest.java b/src/test/java/com/auth0/net/MultipartRequestTest.java deleted file mode 100644 index 848a8df8b..000000000 --- a/src/test/java/com/auth0/net/MultipartRequestTest.java +++ /dev/null @@ -1,458 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.TokenProvider; -import com.auth0.exception.APIException; -import com.auth0.exception.Auth0Exception; -import com.auth0.exception.RateLimitException; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.Auth0MultipartRequestBody; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import com.auth0.net.client.multipart.FilePart; -import com.auth0.net.client.multipart.KeyValuePart; -import com.auth0.net.client.multipart.RecordedMultipartRequest; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import okhttp3.mockwebserver.RecordedRequest; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import static com.auth0.AssertsUtil.verifyThrows; -import static com.auth0.client.MockServer.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class MultipartRequestTest { - private MockServer server; - private Auth0HttpClient client; - private TokenProvider tokenProvider; - - private TypeReference tokenHolderType; - private TypeReference listType; - private TypeReference voidType; - - @BeforeEach - public void setUp() throws Exception { - server = new MockServer(); - client = new DefaultHttpClient.Builder().withMaxRetries(0).build(); - tokenHolderType = new TypeReference() { - }; - listType = new TypeReference() { - }; - voidType = new TypeReference() { - }; - tokenProvider = new TokenProvider() { - @Override - public String getToken() { - return "xyz"; - } - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.completedFuture("xyz"); - } - }; - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - @Test - public void shouldNotSupportGETMethod() { - verifyThrows(IllegalArgumentException.class, - () -> new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET, tokenHolderType), - "Multipart/form-data requests do not support the GET method."); - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - assertThat(request, is(notNullValue())); - request.addPart("non_empty", "body"); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(execute, is(notNullValue())); - } - - @Test - public void shouldAddMultipleParts() throws Exception { - Auth0MultipartRequestBody.Builder bodyBuilder = Auth0MultipartRequestBody.newBuilder(); - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, new ObjectMapper(), tokenHolderType); - - File fileValue = new File(MULTIPART_SAMPLE); - request.addPart("keyName", "keyValue"); - request.addPart("jsonFile", fileValue, "text/json"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - RecordedMultipartRequest recordedMultipartRequest = new RecordedMultipartRequest(recordedRequest); - assertThat(recordedMultipartRequest.getPartsCount(), is(2)); - - KeyValuePart formParam = recordedMultipartRequest.getKeyValuePart("keyName"); - assertThat(formParam, is(notNullValue())); - assertThat(formParam.getValue(), is("keyValue")); - - FilePart jsonFile = recordedMultipartRequest.getFilePart("jsonFile"); - assertThat(jsonFile, is(notNullValue())); - String utf8Contents = new String(Files.readAllBytes(fileValue.toPath())); - assertThat(jsonFile.getContentType(), is("text/json")); - assertThat(jsonFile.getFilename(), is("multipart_sample.json")); - assertThat(jsonFile.getValue(), is(utf8Contents)); - } - - @Test - public void shouldNotOverrideContentTypeHeader() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, new ObjectMapper(), tokenHolderType); - request.addPart("non_empty", "body"); - request.addHeader("Content-Type", "plaintext"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Content-Type"), containsString("multipart/form-data;")); - } - - @Test - public void shouldAddHeaders() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - request.addPart("non_empty", "body"); - request.addHeader("Extra-Info", "this is a test"); - request.addHeader("Authorization", "Bearer my_access_token"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - assertThat(recordedRequest.getHeader("Extra-Info"), is("this is a test")); - // auth header will be done on the request handling - assertThat(recordedRequest.getHeader("Authorization"), is("Bearer xyz")); - } - - @Test - public void shouldThrowOnBodyCreationFailure() { - Exception exception = null; - try { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, voidType); - request.execute(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(Auth0Exception.class))); - assertThat(exception.getMessage(), is("Couldn't create the request body.")); - assertThat(exception.getCause(), is(instanceOf(IOException.class))); - assertThat(exception.getCause().getMessage(), is("Cannot create multipart/form-data request body with zero parts.")); - } - - @Test - public void shouldParseSuccessfulResponse() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, tokenHolderType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - server.takeRequest(); - - assertThat(response, is(notNullValue())); - assertThat(response.getAccessToken(), not(emptyOrNullString())); - assertThat(response.getIdToken(), not(emptyOrNullString())); - assertThat(response.getRefreshToken(), not(emptyOrNullString())); - assertThat(response.getTokenType(), not(emptyOrNullString())); - assertThat(response.getExpiresIn(), is(notNullValue())); - } - - @Test - public void shouldThrowOnParseInvalidSuccessfulResponse() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_TOKENS, 200); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(instanceOf(JsonMappingException.class))); - assertThat(exception.getMessage(), is("Request failed with status code 200: Failed to parse the response body.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("Failed to parse the response body.")); - assertThat(authException.getError(), is(nullValue())); - assertThat(authException.getStatusCode(), is(200)); - } - - @Test - public void shouldParseJSONErrorResponseWithErrorDescription() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_ERROR_WITH_ERROR_DESCRIPTION, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 400: the connection was not found")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("the connection was not found")); - assertThat(authException.getError(), is("invalid_request")); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithError() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_ERROR_WITH_ERROR, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 400: missing username for Username-Password-Authentication connection with requires_username enabled")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("missing username for Username-Password-Authentication connection with requires_username enabled")); - assertThat(authException.getError(), is("missing username for Username-Password-Authentication connection with requires_username enabled")); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithDescriptionAndExtraProperties() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_ERROR_WITH_DESCRIPTION_AND_EXTRA_PROPERTIES, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 400: Multifactor authentication required")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("Multifactor authentication required")); - assertThat(authException.getError(), is("mfa_required")); - assertThat(authException.getValue("mfa_token"), is("Fe26...Ha")); - assertThat(authException.getValue("non_existing_key"), is(nullValue())); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithDescription() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(AUTH_ERROR_WITH_DESCRIPTION, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 400: The user already exists.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("The user already exists.")); - assertThat(authException.getError(), is("user_exists")); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParseJSONErrorResponseWithMessage() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.jsonResponse(MGMT_ERROR_WITH_MESSAGE, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 400: Query validation error: 'String 'invalid_field' does not match pattern. Must be a comma separated list of the following values: allowed_logout_urls,change_password.")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("Query validation error: 'String 'invalid_field' does not match pattern. Must be a comma separated list of the following values: allowed_logout_urls,change_password.")); - assertThat(authException.getError(), is("invalid_query_string")); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParsePlainTextErrorResponse() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.textResponse(AUTH_ERROR_PLAINTEXT, 400); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(APIException.class))); - assertThat(exception.getCause(), is(instanceOf(JsonParseException.class))); - assertThat(exception.getMessage(), is("Request failed with status code 400: A plain-text error response")); - APIException authException = (APIException) exception; - assertThat(authException.getDescription(), is("A plain-text error response")); - assertThat(authException.getError(), is(nullValue())); - assertThat(authException.getValue("non_existing_key"), is(nullValue())); - assertThat(authException.getStatusCode(), is(400)); - } - - @Test - public void shouldParseRateLimitsHeaders() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.rateLimitReachedResponse(100, 10, 5); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 429: Rate limit reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), is("Rate limit reached")); - assertThat(rateLimitException.getError(), is(nullValue())); - assertThat(rateLimitException.getValue("non_existing_key"), is(nullValue())); - assertThat(rateLimitException.getStatusCode(), is(429)); - assertThat(rateLimitException.getLimit(), is(100L)); - assertThat(rateLimitException.getRemaining(), is(10L)); - assertThat(rateLimitException.getReset(), is(5L)); - } - - @Test - public void shouldParseRateLimitsWithAllHeaders() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.rateLimitReachedResponse(100, 10, 5, getTokenQuotaString(), getTokenQuotaString(), 1000); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 429: Rate limit reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), is("Rate limit reached")); - assertThat(rateLimitException.getError(), is(nullValue())); - assertThat(rateLimitException.getValue("non_existing_key"), is(nullValue())); - assertThat(rateLimitException.getStatusCode(), is(429)); - assertThat(rateLimitException.getLimit(), is(100L)); - assertThat(rateLimitException.getRemaining(), is(10L)); - assertThat(rateLimitException.getReset(), is(5L)); - assertThat(rateLimitException.getRetryAfter(), is(1000L)); - assertThat(rateLimitException.getClientQuotaLimit(), is(notNullValue())); - assertThat(rateLimitException.getClientQuotaLimit().getPerHour(), is(notNullValue())); - assertThat(rateLimitException.getClientQuotaLimit().getPerDay(), is(notNullValue())); - assertThat(rateLimitException.getClientQuotaLimit().getPerHour().getQuota(), is(100)); - assertThat(rateLimitException.getClientQuotaLimit().getPerHour().getRemaining(), is(80)); - assertThat(rateLimitException.getClientQuotaLimit().getPerHour().getResetAfter(), is(3600)); - assertThat(rateLimitException.getClientQuotaLimit().getPerDay().getQuota(), is(100)); - assertThat(rateLimitException.getClientQuotaLimit().getPerDay().getRemaining(), is(90)); - assertThat(rateLimitException.getClientQuotaLimit().getPerDay().getResetAfter(), is(86400)); - assertThat(rateLimitException.getOrganizationQuotaLimit(), is(notNullValue())); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerHour(), is(notNullValue())); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerDay(), is(notNullValue())); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerHour().getQuota(), is(100)); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerHour().getRemaining(), is(80)); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerHour().getResetAfter(), is(3600)); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerDay().getQuota(), is(100)); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerDay().getRemaining(), is(90)); - assertThat(rateLimitException.getOrganizationQuotaLimit().getPerDay().getResetAfter(), is(86400)); - } - - @Test - public void shouldDefaultRateLimitsHeadersWhenMissing() throws Exception { - MultipartRequest request = new MultipartRequest<>(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST, listType); - request.addPart("non_empty", "body"); - server.rateLimitReachedResponse(-1, -1, -1); - Exception exception = null; - try { - request.execute().getBody(); - server.takeRequest(); - } catch (Exception e) { - exception = e; - } - assertThat(exception, is(notNullValue())); - assertThat(exception, is(instanceOf(RateLimitException.class))); - assertThat(exception.getCause(), is(nullValue())); - assertThat(exception.getMessage(), is("Request failed with status code 429: Rate limit reached")); - RateLimitException rateLimitException = (RateLimitException) exception; - assertThat(rateLimitException.getDescription(), is("Rate limit reached")); - assertThat(rateLimitException.getError(), is(nullValue())); - assertThat(rateLimitException.getValue("non_existing_key"), is(nullValue())); - assertThat(rateLimitException.getStatusCode(), is(429)); - assertThat(rateLimitException.getLimit(), is(-1L)); - assertThat(rateLimitException.getRemaining(), is(-1L)); - assertThat(rateLimitException.getReset(), is(-1L)); - assertThat(rateLimitException.getClientQuotaLimit(), Matchers.is(nullValue())); - assertThat(rateLimitException.getOrganizationQuotaLimit(), Matchers.is(nullValue())); - } - - public String getTokenQuotaString() { - TokenQuotaLimit perHourLimit = new TokenQuotaLimit(100, 80, 3600); - TokenQuotaLimit perDayLimit = new TokenQuotaLimit(100, 90, 86400); - - StringBuilder builder = new StringBuilder(); - - if (perHourLimit != null) { - builder.append(String.format("b=per_hour;q=%d;r=%d;t=%d", - perHourLimit.getQuota(), perHourLimit.getRemaining(), perHourLimit.getResetAfter())); - } - - if (perDayLimit != null) { - if (builder.length() > 0) { - builder.append(","); - } - builder.append(String.format("b=per_day;q=%d;r=%d;t=%d", - perDayLimit.getQuota(), perDayLimit.getRemaining(), perDayLimit.getResetAfter())); - } - - return builder.toString(); - } -} diff --git a/src/test/java/com/auth0/net/RateLimitInterceptorTest.java b/src/test/java/com/auth0/net/RateLimitInterceptorTest.java deleted file mode 100644 index f05ea72be..000000000 --- a/src/test/java/com/auth0/net/RateLimitInterceptorTest.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.auth0.net; - -import com.auth0.exception.Auth0Exception; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import okhttp3.mockwebserver.SocketPolicy; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.greaterThan; - -public class RateLimitInterceptorTest { - - MockWebServer server = new MockWebServer(); - - @BeforeEach - public void setUp() throws Exception { - server.start(); - } - - @AfterEach - public void tearDown() throws Exception { - server.shutdown(); - } - - @Test - public void shouldRetryRateLimitResponses() throws Exception { - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new RateLimitInterceptor(3)) - .build(); - - server.enqueue(new MockResponse().setResponseCode(429)); - server.enqueue(new MockResponse().setResponseCode(429)); - server.enqueue(new MockResponse().setResponseCode(429)); - server.enqueue(new MockResponse().setResponseCode(200)); - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - Response resp = client.newCall(request).execute(); - - server.takeRequest(); - server.takeRequest(); - server.takeRequest(); - RecordedRequest finalRequest = server.takeRequest(); - - assertThat(resp.code(), is(200)); - - // verify that a total of 4 requests were made (zero index; 3 failures and one successful retry) - assertThat(finalRequest.getSequenceNumber(), is(3)); - } - - @Test - public void shouldNotRetryIfMaxRetriesIsZero() throws Exception { - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new RateLimitInterceptor(0)) - .build(); - - server.enqueue(new MockResponse().setResponseCode(429)); - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - Response resp = client.newCall(request).execute(); - assertThat(resp.code(), is(429)); - - // verify that only one request was made (no retries) - assertThat(server.takeRequest().getSequenceNumber(), is(0)); - } - - @Test - public void shouldReturnResponseWhenMaxRetriesHit() throws Exception { - int maxRetries = 3; - - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new RateLimitInterceptor(maxRetries)) - .build(); - - MockResponse mockResponse = new MockResponse().setResponseCode(429); - - for (int i = 0; i < maxRetries + 1; i++) { - server.enqueue(mockResponse); - } - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - Response response = client.newCall(request).execute(); - - int index = 0; - for (int i = 0; i < maxRetries + 1; i++) { - index = server.takeRequest().getSequenceNumber(); - } - - assertThat(response.code(), is(429)); - - // Verify that a total of four requests were made (original plus three retries) - assertThat(index, is(3)); - } - - @Test - public void shouldNotRetryNonRateLimitErrors() throws Exception { - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new RateLimitInterceptor(3)) - .build(); - - server.enqueue(new MockResponse().setResponseCode(500)); - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - Response response = client.newCall(request).execute(); - - assertThat(response.code(), is(500)); - - // verify only one request was made (not retried) - assertThat(server.takeRequest().getSequenceNumber(), is(0)); - } - - @Test - public void shouldBackOffOnRetries() throws Exception { - int maxRetries = 10; - List retryTimings = new ArrayList<>(); - - RateLimitInterceptor interceptor = new RateLimitInterceptor(maxRetries, c -> { - // keep a sequential list of the elapsed time since last execution request (retry delay) - retryTimings.add(c.getElapsedAttemptTime().toMillis()); - }); - - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(interceptor) - .build(); - - MockResponse mockResponse = new MockResponse().setResponseCode(429); - - for (int i = 0; i < maxRetries + 1; i++) { - server.enqueue(mockResponse); - } - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - client.newCall(request).execute(); - - // Verify that the last retry attempt is at least 3x greater than the first - assertThat(retryTimings.get(maxRetries - 1), greaterThan(retryTimings.get(0) * 3L)); - - // Verify that the final retry is close to the maximum delay of 1000ms, within variance from jitter - assertThat(retryTimings.get(maxRetries - 1).doubleValue(), closeTo(1000, 220)); - - // Basic checks that retry retryTimings are increasing as retry count increases - // Different retry attempts are compared to account for backoff growth as well as random jitter - assertThat(retryTimings.get(2), greaterThan(retryTimings.get(0))); - assertThat(retryTimings.get(5), greaterThan(retryTimings.get(2))); - } - - @Test - public void shouldThrowAuth0Exception() { - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(new RateLimitInterceptor(3)) - .readTimeout(Duration.ofSeconds(1)) - .build(); - - server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.NO_RESPONSE)); - - okhttp3.Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - - Auth0Exception e = verifyThrows(Auth0Exception.class, - () -> client.newCall(request).execute(), - "Failed to execute request"); - } -} diff --git a/src/test/java/com/auth0/net/SignUpRequestTest.java b/src/test/java/com/auth0/net/SignUpRequestTest.java deleted file mode 100644 index 754b6edc2..000000000 --- a/src/test/java/com/auth0/net/SignUpRequestTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.json.auth.CreatedUser; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static com.auth0.client.MockServer.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class SignUpRequestTest { - - private Auth0HttpClient client; - private MockServer server; - - @BeforeEach - public void setUp() throws Exception { - client = new DefaultHttpClient.Builder().build(); - server = new MockServer(); - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - SignUpRequest request = new SignUpRequest(client, server.getBaseUrl()); - assertThat(request, is(notNullValue())); - request.addParameter("non_empty", "body"); - - server.jsonResponse(AUTH_SIGN_UP, 200); - CreatedUser execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(execute, is(notNullValue())); - } - - @Test - public void shouldSetSignUpCustomFields() throws Exception { - SignUpRequest request = new SignUpRequest(client, server.getBaseUrl()); - assertThat(request, is(notNullValue())); - Map customFields = new HashMap<>(); - customFields.put("name", "john"); - customFields.put("age", "25"); - request.setCustomFields(customFields); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - - Map values = bodyFromRequest(recordedRequest); - assertThat(values, is(notNullValue())); - assertThat(values, hasKey("user_metadata")); - Map fields = (Map) values.get("user_metadata"); - assertThat(fields, hasEntry("name", "john")); - assertThat(fields, hasEntry("age", "25")); - } - - -} diff --git a/src/test/java/com/auth0/net/TelemetryInterceptorTest.java b/src/test/java/com/auth0/net/TelemetryInterceptorTest.java deleted file mode 100644 index 8fd139457..000000000 --- a/src/test/java/com/auth0/net/TelemetryInterceptorTest.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.auth0.net; - -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class TelemetryInterceptorTest { - private Telemetry telemetry; - - @BeforeEach - public void setUp() { - telemetry = mock(Telemetry.class); - when(telemetry.getValue()).thenReturn("ClientInfo"); - } - - @Test - public void shouldBeEnabledByDefault() { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - assertThat(interceptor.isEnabled(), is(true)); - } - - @Test - public void shouldDisable() { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - interceptor.setEnabled(false); - assertThat(interceptor.isEnabled(), is(false)); - } - - @Test - public void shouldEnable() { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - interceptor.setEnabled(true); - assertThat(interceptor.isEnabled(), is(true)); - } - - @Test - public void shouldGetTelemetry() { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - assertThat(interceptor.getTelemetry(), is(telemetry)); - } - - @Test - public void shouldAllowToModifyTelemetryOnceSet() throws Exception { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - Telemetry updatedTelemetry = mock(Telemetry.class); - when(updatedTelemetry.getValue()).thenReturn("UpdatedClientInfo"); - interceptor.setTelemetry(updatedTelemetry); - - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(interceptor) - .build(); - - MockWebServer server = new MockWebServer(); - server.start(); - server.enqueue(new MockResponse()); - - Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - client.newCall(request).execute(); - - RecordedRequest finalRequest = server.takeRequest(); - assertThat(finalRequest.getHeader("Auth0-Client"), is("UpdatedClientInfo")); - - server.shutdown(); - } - - @Test - public void shouldAddTelemetryHeaderIfEnabled() throws Exception { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - interceptor.setEnabled(true); - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(interceptor) - .build(); - - MockWebServer server = new MockWebServer(); - server.start(); - server.enqueue(new MockResponse()); - - Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - client.newCall(request).execute(); - - RecordedRequest finalRequest = server.takeRequest(); - assertThat(finalRequest.getHeader("Auth0-Client"), is("ClientInfo")); - - server.shutdown(); - } - - @Test - public void shouldNotAddTelemetryHeaderIfDisabled() throws Exception { - TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); - interceptor.setEnabled(false); - OkHttpClient client = new OkHttpClient.Builder() - .addInterceptor(interceptor) - .build(); - - MockWebServer server = new MockWebServer(); - server.start(); - server.enqueue(new MockResponse()); - - Request request = new Request.Builder() - .get() - .url(server.url("/")) - .build(); - client.newCall(request).execute(); - - RecordedRequest finalRequest = server.takeRequest(); - assertThat(finalRequest.getHeader("Auth0-Client"), is(nullValue())); - - server.shutdown(); - } - - -} diff --git a/src/test/java/com/auth0/net/TelemetryTest.java b/src/test/java/com/auth0/net/TelemetryTest.java deleted file mode 100644 index 70f986232..000000000 --- a/src/test/java/com/auth0/net/TelemetryTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.auth0.net; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TelemetryTest { - - @BeforeAll - public static void setup() { - //Set so that Telemetry object doesn't use different Java versions while testing which will create different Base64 encoded value - System.setProperty("java.specification.version", "1.8"); - } - - @Test - public void shouldReturnBasicTelemetryBase64Value() throws Exception { - Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); - String value = telemetry.getValue(); - assertThat(value, is(notNullValue())); - assertThat(value, is("eyJuYW1lIjoiYXV0aDAtamF2YSIsImVudiI6eyJqYXZhIjoiMS44In0sInZlcnNpb24iOiIxLjAuMCJ9")); - - String completeString = new String(Base64.getUrlDecoder().decode(value), StandardCharsets.UTF_8); - TypeReference> mapType = new TypeReference>() { - }; - Map complete = new ObjectMapper().readValue(completeString, mapType); - assertThat((String) complete.get("name"), is("auth0-java")); - assertThat((String) complete.get("version"), is("1.0.0")); - Map completeEnv = (Map) complete.get("env"); - assertThat((String) completeEnv.get("auth0-java"), is(nullValue())); - assertThat((String) completeEnv.get("java"), is("1.8")); - } - - @Test - public void shouldReturnCompleteTelemetryBase64Value() throws Exception { - Telemetry telemetry = new Telemetry("lock", "1.0.0", "2.1.3"); - String value = telemetry.getValue(); - assertThat(value, is(notNullValue())); - assertThat(value, is("eyJuYW1lIjoibG9jayIsImVudiI6eyJqYXZhIjoiMS44IiwiYXV0aDAtamF2YSI6IjIuMS4zIn0sInZlcnNpb24iOiIxLjAuMCJ9")); - - String completeString = new String(Base64.getUrlDecoder().decode(value), StandardCharsets.UTF_8); - TypeReference> mapType = new TypeReference>() { - }; - Map complete = new ObjectMapper().readValue(completeString, mapType); - assertThat((String) complete.get("name"), is("lock")); - assertThat((String) complete.get("version"), is("1.0.0")); - Map completeEnv = (Map) complete.get("env"); - assertThat((String) completeEnv.get("auth0-java"), is("2.1.3")); - assertThat((String) completeEnv.get("java"), is("1.8")); - } - - @Test - public void shouldAcceptNullVersionAlwaysIncludeJavaVersion() { - Telemetry telemetry = new Telemetry("auth0-java", null); - assertThat(telemetry.getValue(), is(notNullValue())); - assertThat(telemetry.getEnvironment(), is(notNullValue())); - } - - @Test - public void shouldNotAcceptNullName() { - Telemetry telemetry = new Telemetry(null, null); - assertThat(telemetry.getValue(), is(nullValue())); - assertThat(telemetry.getEnvironment(), is(notNullValue())); - } - - @Test - public void shouldGetName() { - Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); - assertThat(telemetry.getName(), is("auth0-java")); - } - - @Test - public void shouldGetVersion() { - Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); - assertThat(telemetry.getVersion(), is("1.0.0")); - } - - @Test - public void shouldNotIncludeLibraryVersionIfNotProvided() { - Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); - assertThat(telemetry.getLibraryVersion(), is(nullValue())); - assertThat(telemetry.getEnvironment().containsKey("auth0-java"), is(false)); - } - - @Test - public void shouldGetLibraryVersion() { - Telemetry telemetry = new Telemetry("auth0-java", "1.0.0", "2.1.3"); - assertThat(telemetry.getLibraryVersion(), is("2.1.3")); - assertThat(telemetry.getEnvironment().get("auth0-java"), is("2.1.3")); - } - -} diff --git a/src/test/java/com/auth0/net/TokenRequestTest.java b/src/test/java/com/auth0/net/TokenRequestTest.java deleted file mode 100644 index a85c52d29..000000000 --- a/src/test/java/com/auth0/net/TokenRequestTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.Map; - -import static com.auth0.client.MockServer.AUTH_TOKENS; -import static com.auth0.client.MockServer.bodyFromRequest; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class TokenRequestTest { - - private Auth0HttpClient client; - private MockServer server; - - @BeforeEach - public void setUp() throws Exception { - client = new DefaultHttpClient.Builder().build(); - server = new MockServer(); - } - - @AfterEach - public void tearDown() throws Exception { - server.stop(); - } - - @Test - public void shouldCreateRequest() throws Exception { - TokenRequest request = new TokenRequest(client, server.getBaseUrl()); - request.addParameter("non_empty", "body"); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - TokenHolder response = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(response, is(notNullValue())); - } - - @Test - public void shouldSetAudience() throws Exception { - TokenRequest request = new TokenRequest(client, server.getBaseUrl()); - assertThat(request, is(notNullValue())); - request.setAudience("https://myapi.auth0.com/users"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - Map values = bodyFromRequest(recordedRequest); - assertThat(values, hasEntry("audience", "https://myapi.auth0.com/users")); - } - - @Test - public void shouldSetScope() throws Exception { - TokenRequest request = new TokenRequest(client, server.getBaseUrl()); - assertThat(request, is(notNullValue())); - request.setScope("email profile photos"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - Map values = bodyFromRequest(recordedRequest); - assertThat(values, hasEntry("scope", "email profile photos")); - } - - @Test - public void shouldSetRealm() throws Exception { - TokenRequest request = new TokenRequest(client, server.getBaseUrl()); - assertThat(request, is(notNullValue())); - request.setRealm("dbconnection"); - - server.jsonResponse(AUTH_TOKENS, 200); - request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - Map values = bodyFromRequest(recordedRequest); - assertThat(values, hasEntry("realm", "dbconnection")); - } - -} diff --git a/src/test/java/com/auth0/net/VoidRequestTest.java b/src/test/java/com/auth0/net/VoidRequestTest.java deleted file mode 100644 index 34743b527..000000000 --- a/src/test/java/com/auth0/net/VoidRequestTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.auth0.net; - -import com.auth0.client.MockServer; -import com.auth0.client.mgmt.TokenProvider; -import com.auth0.net.client.Auth0HttpClient; -import com.auth0.net.client.DefaultHttpClient; -import com.auth0.net.client.HttpMethod; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; - -import static com.auth0.client.MockServer.AUTH_TOKENS; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - -public class VoidRequestTest { - private Auth0HttpClient client; - private TokenProvider tokenProvider; - private MockServer server; - - @BeforeEach - public void setUp() throws Exception { - client = new DefaultHttpClient.Builder().build(); - server = new MockServer(); - tokenProvider = new TokenProvider() { - @Override - public String getToken() { - return "Bearer xyz"; - } - - @Override - public CompletableFuture getTokenAsync() { - return CompletableFuture.completedFuture("Bearer xyz"); - } - }; - } - - @Test - public void shouldCreateGETRequest() throws Exception { - VoidRequest request = new VoidRequest(client, tokenProvider, server.getBaseUrl(), HttpMethod.GET); - assertThat(request, is(notNullValue())); - - server.jsonResponse(AUTH_TOKENS, 200); - Void execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.GET.toString())); - assertThat(execute, is(nullValue())); - } - - @Test - public void shouldCreatePOSTRequest() throws Exception { - VoidRequest request = new VoidRequest(client, tokenProvider, server.getBaseUrl(), HttpMethod.POST); - assertThat(request, is(notNullValue())); - request.addParameter("non_empty", "body"); - - server.jsonResponse(AUTH_TOKENS, 200); - Void execute = request.execute().getBody(); - RecordedRequest recordedRequest = server.takeRequest(); - assertThat(recordedRequest.getMethod(), is(HttpMethod.POST.toString())); - assertThat(execute, is(nullValue())); - } -} diff --git a/src/test/java/com/auth0/net/client/Auth0HttpRequestTest.java b/src/test/java/com/auth0/net/client/Auth0HttpRequestTest.java deleted file mode 100644 index 5feae933e..000000000 --- a/src/test/java/com/auth0/net/client/Auth0HttpRequestTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.auth0.net.client; - -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class Auth0HttpRequestTest { - - @Test - public void headersAreDefensive() { - Map headers = new HashMap<>(); - headers.put("name", "value"); - - Auth0HttpRequest request = Auth0HttpRequest.newBuilder("url", HttpMethod.POST) - .withHeaders(headers) - .build(); - - headers.put("name", "UPDATED"); - - assertThat(request.getHeaders().get("name"), is("value")); - } -} diff --git a/src/test/java/com/auth0/net/client/Auth0HttpResponseTest.java b/src/test/java/com/auth0/net/client/Auth0HttpResponseTest.java deleted file mode 100644 index fa922f781..000000000 --- a/src/test/java/com/auth0/net/client/Auth0HttpResponseTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.auth0.net.client; - -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class Auth0HttpResponseTest { - - @Test - public void headersAreDefensive() { - Map headers = new HashMap<>(); - headers.put("name", "value"); - - Auth0HttpResponse response = Auth0HttpResponse.newBuilder() - .withHeaders(headers) - .build(); - - headers.put("name", "UPDATED"); - - assertThat(response.getHeaders().get("name"), is("value")); - } -} diff --git a/src/test/java/com/auth0/net/client/DefaultHttpClientTest.java b/src/test/java/com/auth0/net/client/DefaultHttpClientTest.java deleted file mode 100644 index a9f1e7e7a..000000000 --- a/src/test/java/com/auth0/net/client/DefaultHttpClientTest.java +++ /dev/null @@ -1,944 +0,0 @@ -package com.auth0.net.client; - -import com.auth0.client.LoggingOptions; -import com.auth0.client.ProxyOptions; -import com.auth0.net.RateLimitInterceptor; -import com.auth0.net.TelemetryInterceptor; -import okhttp3.*; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import okhttp3.mockwebserver.SocketPolicy; -import okio.Buffer; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -import java.io.IOException; -import java.net.Proxy; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.isA; -import static org.hamcrest.Matchers.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; - -public class DefaultHttpClientTest { - - private MockWebServer server; - - @BeforeEach - public void setUp() throws Exception { - server = new MockWebServer(); - server.start(); - } - - @AfterEach - public void tearDown() throws Exception { - server.shutdown(); - } - - @Test - public void makesGetRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .withHeaders(Collections.singletonMap("foo", "bar")) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(200) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("GET")); - - assertThat(response.getCode(), is(200)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getBody(), is(responseBody)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - @Test - public void makesAsyncGetRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .withHeaders(Collections.singletonMap("foo", "bar")) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(200) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("GET")); - - assertThat(response.get().getCode(), is(200)); - assertThat(response.get().isSuccessful(), is(true)); - assertThat(response.get().getBody(), is(responseBody)); - assertThat(response.get().getHeader("fiz"), is("bang")); - } - - - @Test - public void makesPostRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.POST) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(201) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("POST")); - - assertThat(response.getCode(), is(201)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getBody(), is(responseBody)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - @Test - public void makesAsyncPostRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.POST) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(201) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("POST")); - - assertThat(response.get().getCode(), is(201)); - assertThat(response.get().isSuccessful(), is(true)); - assertThat(response.get().getBody(), is(responseBody)); - assertThat(response.get().getHeader("fiz"), is("bang")); - } - - @Test - public void makesPatchRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.PATCH) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(204) - .setHeader("fiz", "bang"); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("PATCH")); - - assertThat(response.getCode(), is(204)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - @Test - public void makesAsyncPatchRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.PATCH) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(204) - .setHeader("fiz", "bang"); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("PATCH")); - - assertThat(response.get().getCode(), is(204)); - assertThat(response.get().isSuccessful(), is(true)); - assertThat(response.get().getHeader("fiz"), is("bang")); - } - - @Test - public void makesPutRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.PUT) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(204) - .setHeader("fiz", "bang"); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("PUT")); - - assertThat(response.getCode(), is(204)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - @Test - public void makesAsyncPutRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.PUT) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(HttpRequestBody.create( - "application/json", - "{\"id\":\"123\", \"name\":\"timmy\"}".getBytes(StandardCharsets.UTF_8))) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(204) - .setHeader("fiz", "bang"); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("PUT")); - - assertThat(response.get().getCode(), is(204)); - assertThat(response.get().isSuccessful(), is(true)); - assertThat(response.get().getHeader("fiz"), is("bang")); - } - - @Test - public void makesDeleteRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.DELETE) - .withHeaders(Collections.singletonMap("foo", "bar")) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(202) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("DELETE")); - - assertThat(response.getCode(), is(202)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getBody(), is(responseBody)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - @Test - public void makesAsyncDeleteRequest() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.DELETE) - .withHeaders(Collections.singletonMap("foo", "bar")) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(202) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("DELETE")); - - assertThat(response.get().getCode(), is(202)); - assertThat(response.get().isSuccessful(), is(true)); - assertThat(response.get().getBody(), is(responseBody)); - assertThat(response.get().getHeader("fiz"), is("bang")); - } - - @Test - public void handlesAPIError() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(404) - .setBody("User not found"); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getMethod(), is("GET")); - - assertThat(response.getCode(), is(404)); - assertThat(response.isSuccessful(), is(false)); - assertThat(response.getBody(), is("User not found")); - } - - @Test - public void handlesAPIErrorAsync() throws Exception { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - MockResponse mockResponse = new MockResponse() - .setResponseCode(404) - .setBody("User not found"); - - server.enqueue(mockResponse); - - CompletableFuture response = client.sendRequestAsync(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getMethod(), is("GET")); - - assertThat(response.get().getCode(), is(404)); - assertThat(response.get().isSuccessful(), is(false)); - assertThat(response.get().getBody(), is("User not found")); - } - - @Test - public void throwsIOException() { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - // force IOException to be thrown by OkHttp when trying to parse response body - MockResponse mockResponse = new MockResponse() - .setResponseCode(200) - .setBody(new Buffer().write(new byte[2056])) - .setSocketPolicy(SocketPolicy.DISCONNECT_DURING_RESPONSE_BODY); - - server.enqueue(mockResponse); - - verifyThrows(IOException.class, () -> client.sendRequest(request)); - } - - @Test - public void throwsIOExceptionAsync() { - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.GET) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - // force IOException to be thrown by OkHttp when trying to parse response body - MockResponse mockResponse = new MockResponse() - .setResponseCode(200) - .setBody(new Buffer().write(new byte[2056])) - .setSocketPolicy(SocketPolicy.DISCONNECT_DURING_RESPONSE_BODY); - - server.enqueue(mockResponse); - - CompletableFuture future = client.sendRequestAsync(request); - ExecutionException e = verifyThrows(ExecutionException.class, future::get); - assertThat(e.getCause(), is(instanceOf(IOException.class))); - } - - @Test - public void asyncHandlesNetworkError() { - OkHttpClient okClient = Mockito.mock(OkHttpClient.class); - okhttp3.Response response = Mockito.mock(okhttp3.Response.class); - Call call = Mockito.mock(Call.class); - - doReturn(call).when(okClient).newCall(any()); - - doAnswer(invocation -> { - ((Callback) invocation.getArgument(0)).onFailure(call, new IOException("Error!")); - return null; - }).when(call).enqueue(any()); - - DefaultHttpClient client = new DefaultHttpClient(okClient); - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/").toString(), HttpMethod.POST) - .withBody(HttpRequestBody.create("application/json", "{}".getBytes())) - .build(); - - CompletableFuture future = client.sendRequestAsync(request); - ExecutionException e = verifyThrows(ExecutionException.class, future::get); - assertThat(e.getCause(), is(instanceOf(IOException.class))); - } - - @Test - public void alwaysCloseResponseOnSuccessfulRequest() throws IOException { - okhttp3.Response response = Mockito.mock(okhttp3.Response.class); - - Call call = Mockito.mock(Call.class); - when(call.execute()).thenReturn(response); - - Headers headers = Mockito.mock(Headers.class); - when(response.headers()).thenReturn(headers); - - OkHttpClient client = Mockito.mock(OkHttpClient.class); - when(client.newCall(any())).thenReturn(call); - - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/").toString(), HttpMethod.POST) - .withBody(HttpRequestBody.create("application/json", "{}".getBytes())) - .build(); - - DefaultHttpClient auth0Client = new DefaultHttpClient(client); - auth0Client.sendRequest(request); - - verify(response, times(1)).close(); - } - - @Test - public void alwaysCloseResponseOnSuccessfulRequestAsync() throws Exception { - OkHttpClient okClient = Mockito.mock(OkHttpClient.class); - okhttp3.Response response = Mockito.mock(okhttp3.Response.class); - Call call = Mockito.mock(Call.class); - - doReturn(call).when(okClient).newCall(any()); - - doAnswer(invocation -> { - ((Callback) invocation.getArgument(0)).onResponse(call, response); - return null; - }).when(call).enqueue(any(Callback.class)); - - Headers headers = Mockito.mock(Headers.class); - when(response.headers()).thenReturn(headers); - - DefaultHttpClient client = new DefaultHttpClient(okClient); - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/").toString(), HttpMethod.POST) - .withBody(HttpRequestBody.create("application/json", "{}".getBytes())) - .build(); - - client.sendRequestAsync(request).get(); - verify(response, times(1)).close(); - } - - @Test - public void closesResponseOnAPIError() throws Exception { - okhttp3.Response response = Mockito.mock(okhttp3.Response.class); - - Call call = Mockito.mock(Call.class); - when(call.execute()).thenReturn(response); - - Headers headers = Mockito.mock(Headers.class); - when(response.headers()).thenReturn(headers); - - OkHttpClient okClient = Mockito.mock(OkHttpClient.class); - when(okClient.newCall(any())).thenReturn(call); - - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/").toString(), HttpMethod.POST) - .withBody(HttpRequestBody.create("application/json", "{}".getBytes())) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(okClient); - MockResponse mockResponse = new MockResponse() - .setResponseCode(500) - .setBody("server error"); - - server.enqueue(mockResponse); - - Auth0HttpResponse aoResponse = client.sendRequest(request); - verify(response, times(1)).close(); - } - - @Test - public void closesResponseOnAPIErrorAsync() throws Exception { - OkHttpClient okClient = Mockito.mock(OkHttpClient.class); - okhttp3.Response response = Mockito.mock(okhttp3.Response.class); - Call call = Mockito.mock(Call.class); - - doReturn(call).when(okClient).newCall(any()); - - doAnswer(invocation -> { - ((Callback) invocation.getArgument(0)).onResponse(call, response); - return null; - }).when(call).enqueue(any(Callback.class)); - - Headers headers = Mockito.mock(Headers.class); - when(response.headers()).thenReturn(headers); - - DefaultHttpClient client = new DefaultHttpClient(okClient); - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/").toString(), HttpMethod.POST) - .withBody(HttpRequestBody.create("application/json", "{}".getBytes())) - .build(); - - MockResponse mockResponse = new MockResponse() - .setResponseCode(500) - .setBody("server error"); - - server.enqueue(mockResponse); - client.sendRequestAsync(request).get(); - verify(response, times(1)).close(); - } - - @Test - public void makesFormBodyPostRequest() throws Exception { - Map params = new HashMap<>(); - params.put("key", "value"); - params.put("key2", 5); - HttpRequestBody body = HttpRequestBody.create("application/x-www-form-urlencoded", new Auth0FormRequestBody(params)); - Auth0HttpRequest request = Auth0HttpRequest.newBuilder(server.url("/users/2").toString(), HttpMethod.POST) - .withHeaders(Collections.singletonMap("foo", "bar")) - .withBody(body) - .build(); - - DefaultHttpClient client = new DefaultHttpClient(new OkHttpClient()); - String responseBody = "{\"id\":\"123\", \"name\":\"timmy\"}"; - MockResponse mockResponse = new MockResponse() - .setResponseCode(200) - .setHeader("fiz", "bang") - .setBody(responseBody); - - server.enqueue(mockResponse); - - Auth0HttpResponse response = client.sendRequest(request); - RecordedRequest madeRequest = server.takeRequest(); - - assertThat(madeRequest.getPath(), is("/users/2")); - assertThat(madeRequest.getHeader("foo"), is("bar")); - assertThat(madeRequest.getMethod(), is("POST")); - - assertThat(response.getCode(), is(200)); - assertThat(response.isSuccessful(), is(true)); - assertThat(response.getBody(), is(responseBody)); - assertThat(response.getHeader("fiz"), is("bang")); - } - - ////////////////////////////////////////////////////////// - // HTTP CLIENT CONFIGURATION TESTS - ////////////////////////////////////////////////////////// - - @Test - public void shouldUseDefaultTimeoutIfNotSpecified() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().connectTimeoutMillis(), is(10 * 1000)); - assertThat(client.getOkClient().readTimeoutMillis(), is(10 * 1000)); - } - - @Test - public void shouldUseZeroIfNegativeTimeoutConfigured() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withConnectTimeout(-1) - .withReadTimeout(-1) - .build(); - - assertThat(client.getOkClient().connectTimeoutMillis(), is(0)); - assertThat(client.getOkClient().readTimeoutMillis(), is(0)); - - } - - @Test - public void shouldSetTimeoutsIfConfigured() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withConnectTimeout(20) - .withReadTimeout(30) - .build(); - - assertThat(client.getOkClient().connectTimeoutMillis(), is(20 * 1000)); - assertThat(client.getOkClient().readTimeoutMillis(), is(30 * 1000)); - } - - - @Test - public void shouldNotUseProxyByDefault() throws Exception { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().proxy(), is(nullValue())); - Authenticator authenticator = client.getOkClient().proxyAuthenticator(); - assertThat(authenticator, is(notNullValue())); - - Route route = Mockito.mock(Route.class); - okhttp3.Request nonAuthenticatedRequest = new okhttp3.Request.Builder() - .url("https://test.com/app") - .addHeader("some-header", "some-value") - .build(); - okhttp3.Response nonAuthenticatedResponse = new okhttp3.Response.Builder() - .protocol(Protocol.HTTP_2) - .code(200) - .message("OK") - .request(nonAuthenticatedRequest) - .build(); - - okhttp3.Request processedRequest = authenticator.authenticate(route, nonAuthenticatedResponse); - assertThat(processedRequest, is(nullValue())); - } - - @Test - public void shouldUseProxy() throws Exception { - Proxy proxy = Mockito.mock(Proxy.class); - ProxyOptions proxyOptions = new ProxyOptions(proxy); - - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withProxy(proxyOptions) - .build(); - - assertThat(client.getOkClient().proxy(), is(proxy)); - Authenticator authenticator = client.getOkClient().proxyAuthenticator(); - assertThat(authenticator, is(notNullValue())); - - Route route = Mockito.mock(Route.class); - okhttp3.Request nonAuthenticatedRequest = new okhttp3.Request.Builder() - .url("https://test.com/app") - .addHeader("some-header", "some-value") - .build(); - okhttp3.Response nonAuthenticatedResponse = new okhttp3.Response.Builder() - .protocol(Protocol.HTTP_2) - .code(200) - .message("OK") - .request(nonAuthenticatedRequest) - .build(); - - okhttp3.Request processedRequest = authenticator.authenticate(route, nonAuthenticatedResponse); - - assertThat(processedRequest, is(nullValue())); - } - - @Test - public void shouldUseProxyWithAuthentication() throws Exception { - Proxy proxy = Mockito.mock(Proxy.class); - ProxyOptions proxyOptions = new ProxyOptions(proxy); - proxyOptions.setBasicAuthentication("johndoe", "psswd".toCharArray()); - assertThat(proxyOptions.getBasicAuthentication(), is("Basic am9obmRvZTpwc3N3ZA==")); - - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withProxy(proxyOptions) - .build(); - - assertThat(client.getOkClient().proxy(), is(proxy)); - Authenticator authenticator = client.getOkClient().proxyAuthenticator(); - assertThat(authenticator, is(notNullValue())); - - Route route = Mockito.mock(Route.class); - okhttp3.Request nonAuthenticatedRequest = new okhttp3.Request.Builder() - .url("https://test.com/app") - .addHeader("some-header", "some-value") - .build(); - okhttp3.Response nonAuthenticatedResponse = new okhttp3.Response.Builder() - .protocol(Protocol.HTTP_2) - .code(200) - .message("OK") - .request(nonAuthenticatedRequest) - .build(); - - okhttp3.Request processedRequest = authenticator.authenticate(route, nonAuthenticatedResponse); - - assertThat(processedRequest, is(notNullValue())); - assertThat(processedRequest.url(), is(HttpUrl.parse("https://test.com/app"))); - assertThat(processedRequest.header("Proxy-Authorization"), is(proxyOptions.getBasicAuthentication())); - assertThat(processedRequest.header("some-header"), is("some-value")); - } - - @Test - public void proxyShouldNotProcessAlreadyAuthenticatedRequest() throws Exception { - Proxy proxy = Mockito.mock(Proxy.class); - ProxyOptions proxyOptions = new ProxyOptions(proxy); - proxyOptions.setBasicAuthentication("johndoe", "psswd".toCharArray()); - assertThat(proxyOptions.getBasicAuthentication(), is("Basic am9obmRvZTpwc3N3ZA==")); - - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withProxy(proxyOptions) - .build(); - - assertThat(client.getOkClient().proxy(), is(proxy)); - Authenticator authenticator = client.getOkClient().proxyAuthenticator(); - assertThat(authenticator, is(notNullValue())); - - Route route = Mockito.mock(Route.class); - okhttp3.Request alreadyAuthenticatedRequest = new okhttp3.Request.Builder() - .url("https://test.com/app") - .addHeader("some-header", "some-value") - .header("Proxy-Authorization", "pre-existing-value") - .build(); - okhttp3.Response alreadyAuthenticatedResponse = new okhttp3.Response.Builder() - .protocol(Protocol.HTTP_2) - .code(200) - .message("OK") - .request(alreadyAuthenticatedRequest) - .build(); - - okhttp3.Request processedRequest = authenticator.authenticate(route, alreadyAuthenticatedResponse); - assertThat(processedRequest, is(nullValue())); - } - - @Test - public void shouldAddAndEnableTelemetryInterceptor() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof TelemetryInterceptor) { - TelemetryInterceptor telemetry = (TelemetryInterceptor) i; - assertThat(telemetry.isEnabled(), is(true)); - } - } - } - - @Test - public void shouldDisableTelemetryInterceptor() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .telemetryEnabled(false) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof TelemetryInterceptor) { - TelemetryInterceptor telemetry = (TelemetryInterceptor) i; - assertThat(telemetry.isEnabled(), is(false)); - } - } - } - - @Test - public void shouldAddAndDisableLoggingInterceptor() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof HttpLoggingInterceptor) { - HttpLoggingInterceptor logging = (HttpLoggingInterceptor) i; - assertThat(logging.getLevel(), is(HttpLoggingInterceptor.Level.NONE)); - } - } - } - - @Test - public void shouldConfigureNoneLoggingFromOptions() { - LoggingOptions loggingOptions = new LoggingOptions(LoggingOptions.LogLevel.NONE); - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withLogging(loggingOptions) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof HttpLoggingInterceptor) { - HttpLoggingInterceptor logging = (HttpLoggingInterceptor) i; - assertThat(logging.getLevel(), is(HttpLoggingInterceptor.Level.NONE)); - } - } - } - - @Test - public void shouldConfigureBasicLoggingFromOptions() { - LoggingOptions loggingOptions = new LoggingOptions(LoggingOptions.LogLevel.BASIC); - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withLogging(loggingOptions) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof HttpLoggingInterceptor) { - HttpLoggingInterceptor logging = (HttpLoggingInterceptor) i; - assertThat(logging.getLevel(), is(HttpLoggingInterceptor.Level.BASIC)); - } - } - } - - @Test - public void shouldConfigureHeaderLoggingFromOptions() { - LoggingOptions loggingOptions = new LoggingOptions(LoggingOptions.LogLevel.HEADERS); - Set headersToRedact = new HashSet<>(); - headersToRedact.add("Authorization"); - headersToRedact.add("Cookie"); - loggingOptions.setHeadersToRedact(headersToRedact); - - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withLogging(loggingOptions) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof HttpLoggingInterceptor) { - HttpLoggingInterceptor logging = (HttpLoggingInterceptor) i; - assertThat(logging.getLevel(), is(HttpLoggingInterceptor.Level.HEADERS)); - } - } - } - - @Test - public void shouldConfigureBodyLoggingFromOptions() { - LoggingOptions loggingOptions = new LoggingOptions(LoggingOptions.LogLevel.BODY); - Set headersToRedact = new HashSet<>(); - headersToRedact.add("Authorization"); - headersToRedact.add("Cookie"); - loggingOptions.setHeadersToRedact(headersToRedact); - - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withLogging(loggingOptions) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof HttpLoggingInterceptor) { - HttpLoggingInterceptor logging = (HttpLoggingInterceptor) i; - assertThat(logging.getLevel(), is(HttpLoggingInterceptor.Level.BODY)); - } - } - } - - @Test - public void shouldUseDefaultMaxRetriesIfNotConfigured() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(RateLimitInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof RateLimitInterceptor) { - RateLimitInterceptor rateLimitInterceptor = (RateLimitInterceptor) i; - assertThat(rateLimitInterceptor.getMaxRetries(), is(3)); - } - } - } - - @Test - public void shouldUseCustomMaxRetriesIfConfigured() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withMaxRetries(5) - .build(); - - assertThat(client.getOkClient().interceptors(), hasItem(isA(RateLimitInterceptor.class))); - - for (Interceptor i : client.getOkClient().interceptors()) { - if (i instanceof RateLimitInterceptor) { - RateLimitInterceptor rateLimitInterceptor = (RateLimitInterceptor) i; - assertThat(rateLimitInterceptor.getMaxRetries(), is(5)); - } - } - } - - @Test - public void shouldThrowOnNegativeMaxRetriesConfiguration() { - IllegalArgumentException iae = verifyThrows(IllegalArgumentException.class, - () -> DefaultHttpClient.newBuilder().withMaxRetries(-1).build(), - "Retries must be between zero and ten."); - } - - @Test - public void shouldThrowOnTooManyMaxRetriesConfiguration() { - IllegalArgumentException iae = verifyThrows(IllegalArgumentException.class, - () -> DefaultHttpClient.newBuilder().withMaxRetries(11).build(), - "Retries must be between zero and ten."); - } - - @Test - public void shouldUseDefaultMaxRequests() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().dispatcher().getMaxRequests(), is(64)); - } - - @Test - public void shouldUseConfiguredMaxRequests() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withMaxRequests(10) - .build(); - - assertThat(client.getOkClient().dispatcher().getMaxRequests(), is(10)); - } - - @Test - public void shouldThrowOnInValidMaxRequestsConfiguration() { - IllegalArgumentException iae = verifyThrows(IllegalArgumentException.class, - () -> DefaultHttpClient.newBuilder().withMaxRequests(0).build(), - "maxRequests must be one or greater."); - } - - @Test - public void shouldUseDefaultMaxRequestsPerHost() { - DefaultHttpClient client = DefaultHttpClient.newBuilder().build(); - assertThat(client.getOkClient().dispatcher().getMaxRequestsPerHost(), is(5)); - } - - @Test - public void shouldUseConfiguredMaxRequestsPerHost() { - DefaultHttpClient client = DefaultHttpClient.newBuilder() - .withMaxRequestsPerHost(10) - .build(); - assertThat(client.getOkClient().dispatcher().getMaxRequestsPerHost(), is(10)); - } - - @Test - public void shouldThrowOnInValidMaxRequestsPerHostConfiguration() { - IllegalArgumentException iae = verifyThrows(IllegalArgumentException.class, - () -> DefaultHttpClient.newBuilder().withMaxRequestsPerHost(0).build(), - "maxRequestsPerHost must be one or greater."); - } - -} diff --git a/src/test/java/com/auth0/net/client/multipart/FilePart.java b/src/test/java/com/auth0/net/client/multipart/FilePart.java deleted file mode 100644 index 8e593ed7b..000000000 --- a/src/test/java/com/auth0/net/client/multipart/FilePart.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.auth0.net.client.multipart; - -public class FilePart extends KeyValuePart { - - private final String filename; - private final String contentType; - - public FilePart(String key, String value, String filename, String contentType) { - super(key, value); - this.filename = filename; - this.contentType = contentType; - } - - public String getFilename() { - return filename; - } - - public String getContentType() { - return contentType; - } -} diff --git a/src/test/java/com/auth0/net/client/multipart/KeyValuePart.java b/src/test/java/com/auth0/net/client/multipart/KeyValuePart.java deleted file mode 100644 index 067576f97..000000000 --- a/src/test/java/com/auth0/net/client/multipart/KeyValuePart.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.auth0.net.client.multipart; - -public class KeyValuePart { - - private final String key; - private final String value; - - public KeyValuePart(String key, String value) { - this.key = key; - this.value = value; - } - - public String getKey() { - return key; - } - - public String getValue() { - return value; - } -} diff --git a/src/test/java/com/auth0/net/client/multipart/RecordedMultipartRequest.java b/src/test/java/com/auth0/net/client/multipart/RecordedMultipartRequest.java deleted file mode 100644 index ce83605ad..000000000 --- a/src/test/java/com/auth0/net/client/multipart/RecordedMultipartRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.auth0.net.client.multipart; - -import okhttp3.mockwebserver.RecordedRequest; -import okio.Buffer; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -public class RecordedMultipartRequest { - - private final Map parts = new HashMap<>(); - private String boundary; - - public RecordedMultipartRequest(RecordedRequest request) throws IOException { - parseBody(request.getBody()); - } - - public KeyValuePart getKeyValuePart(String name) { - return parts.get(name); - } - - public FilePart getFilePart(String name) { - return (FilePart) parts.get(name); - } - - public int getPartsCount() { - return parts.size(); - } - - public String getBoundary() { - return boundary; - } - - private void parseBody(Buffer body) throws IOException { - BufferedReader br = new BufferedReader(new InputStreamReader(body.inputStream())); - //Obtain the boundary - String separator = br.readLine(); - String eof = separator + "--"; - boundary = separator.replaceFirst("--", ""); - - String strLine; - while (!eof.equals(strLine = br.readLine())) { - if (strLine.equals(separator) || strLine.isEmpty()) { - continue; - } - - //Start reading the content description - String[] sections = strLine.split("; "); - - String keyName = null; - String keyValue = null; - String keyFilename = null; - String keyContentType = null; - int keyContentLength = 0; - for (String section : sections) { - String[] secParts = section.split("="); - if ("name".equals(secParts[0])) { - keyName = secParts[1]; - keyName = keyName.substring(1, keyName.length() - 1); - } else if ("filename".equals(secParts[0])) { - keyFilename = secParts[1]; - keyFilename = keyFilename.substring(1, keyFilename.length() - 1); - } - } - //Try to find type - strLine = br.readLine(); - if (strLine.startsWith("Content-Type: ")) { - keyContentType = strLine.split("Content-Type: ")[1]; - strLine = br.readLine(); - } - //Try to find length - if (strLine.startsWith("Content-Length: ")) { - keyContentLength = Integer.parseInt(strLine.split("Content-Length: ")[1]); - strLine = br.readLine(); - } - //Try to find value - if (strLine.isEmpty()) { - //Start reading the keyValue - char[] valueBuffer = new char[keyContentLength]; - br.read(valueBuffer, 0, keyContentLength); - keyValue = new String(valueBuffer); - if (keyValue.length() != keyContentLength) { - System.out.println("-" + keyValue + "-"); - throw new IllegalStateException("Content-Length value and the found size do not match"); - } - } - - //Write the part - KeyValuePart part; - if (keyFilename != null) { - part = new FilePart(keyName, keyValue, keyFilename, keyContentType); - } else { - part = new KeyValuePart(keyName, keyValue); - } - parts.put(keyName, part); - } - } -} diff --git a/src/test/java/com/auth0/utils/AssertsTest.java b/src/test/java/com/auth0/utils/AssertsTest.java deleted file mode 100644 index f6a1e154c..000000000 --- a/src/test/java/com/auth0/utils/AssertsTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.auth0.utils; - -import org.junit.jupiter.api.Test; - -import static com.auth0.AssertsUtil.verifyThrows; - -public class AssertsTest { - - private static final String URI_NAME = "name"; - - @Test - public void succeedsForHttps() { - Asserts.assertValidUrl("https://me.auth0.com", URI_NAME); - } - - @Test - public void succeedsForHttp() { - Asserts.assertValidUrl("http://me.auth0.com", URI_NAME); - } - - @Test - public void succeedsWithPath() { - Asserts.assertValidUrl("https://me.auth0.com/path", URI_NAME); - } - - @Test - public void succeedWithUnEncodedUrl(){ - Asserts.assertValidUrl("https://me.auth0.com/path should fail", URI_NAME); - } - - @Test - public void succeedsWithQueryParams() { - Asserts.assertValidUrl("https://me.auth0.com?query=params&moreQuery=params", URI_NAME); - } - - @Test - public void succeedsWithCustomDomain() { - Asserts.assertValidUrl("https://a.custom.domain", URI_NAME); - } - - @Test - public void succeedsWithCustomAppScheme() { - Asserts.assertValidUrl("custom.app.scheme://custom.domain.com/path/callback", URI_NAME); - Asserts.assertValidUrl("demo://custom.domain.com/path/callback", URI_NAME); - Asserts.assertValidUrl("com.custom_app.scheme://custom.domain.com/path/callback", URI_NAME); - } - - @Test - public void succeedsWithCustomAppSchemeWithQueryParams() { - Asserts.assertValidUrl("custom.app.scheme://custom.domain.com/path/callback?query=params&moreQuery=params", URI_NAME); - } - - @Test - public void throwsIllegalArgumentExceptionWhenValueIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> Asserts.assertValidUrl(null, URI_NAME), - String.format("'%s' must be a valid URL!", URI_NAME)); - } - - @Test - public void throwsIllegalArgumentExceptionWhenValueIsInvalid() { - verifyThrows(IllegalArgumentException.class, - () -> Asserts.assertValidUrl("not.a.domain", URI_NAME), - String.format("'%s' must be a valid URL!", URI_NAME)); - } - - @Test - public void throwsIllegalArgumentExceptionWhenValueIsCustomSchemeAndInvalid() { - verifyThrows(IllegalArgumentException.class, - () -> Asserts.assertValidUrl("demo://host:%39%39/", URI_NAME), - String.format("'%s' must be a valid URL!", URI_NAME)); - } -} diff --git a/src/test/java/com/auth0/utils/HttpResponseHeadersUtilsTest.java b/src/test/java/com/auth0/utils/HttpResponseHeadersUtilsTest.java deleted file mode 100644 index 77ddc8918..000000000 --- a/src/test/java/com/auth0/utils/HttpResponseHeadersUtilsTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.auth0.utils; - -import com.auth0.net.TokenQuotaBucket; -import com.auth0.net.TokenQuotaLimit; -import org.junit.jupiter.api.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.assertNull; - -public class HttpResponseHeadersUtilsTest { - - @Test - public void testGetClientQuotaLimitWithValidHeader() { - Map headers = new HashMap<>(); - headers.put("auth0-client-quota-limit", "per_hour;q=100;r=50;t=3600,per_day;q=1000;r=500;t=86400"); - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.getClientQuotaLimit(headers); - - assertNotNull(quotaBucket); - assertNotNull(quotaBucket.getPerHour()); - assertEquals(100, quotaBucket.getPerHour().getQuota()); - assertEquals(50, quotaBucket.getPerHour().getRemaining()); - assertEquals(3600, quotaBucket.getPerHour().getResetAfter()); - - assertNotNull(quotaBucket.getPerDay()); - assertEquals(1000, quotaBucket.getPerDay().getQuota()); - assertEquals(500, quotaBucket.getPerDay().getRemaining()); - assertEquals(86400, quotaBucket.getPerDay().getResetAfter()); - } - - @Test - public void testGetClientQuotaLimitWithMissingHeader() { - Map headers = new HashMap<>(); - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.getClientQuotaLimit(headers); - - assertNull(quotaBucket); - } - - @Test - public void testGetClientQuotaLimitWithOneBucketHeader() { - Map headers = new HashMap<>(); - headers.put("auth0-client-quota-limit", "per_hour;q=200;r=100;t=3600"); - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.getClientQuotaLimit(headers); - - assertNotNull(quotaBucket); - assertNotNull(quotaBucket.getPerHour()); - assertEquals(200, quotaBucket.getPerHour().getQuota()); - assertEquals(100, quotaBucket.getPerHour().getRemaining()); - assertEquals(3600, quotaBucket.getPerHour().getResetAfter()); - - assertNull(quotaBucket.getPerDay()); - } - - @Test - public void testGetOrganizationQuotaLimitWithValidHeader() { - Map headers = new HashMap<>(); - headers.put("auth0-organization-quota-limit", "per_hour;q=200;r=100;t=3600"); - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.getOrganizationQuotaLimit(headers); - - assertNotNull(quotaBucket); - assertNotNull(quotaBucket.getPerHour()); - assertEquals(200, quotaBucket.getPerHour().getQuota()); - assertEquals(100, quotaBucket.getPerHour().getRemaining()); - assertEquals(3600, quotaBucket.getPerHour().getResetAfter()); - - assertNull(quotaBucket.getPerDay()); - } - - @Test - public void testGetOrganizationQuotaLimitWithMissingHeader() { - Map headers = new HashMap<>(); - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.getOrganizationQuotaLimit(headers); - - assertNull(quotaBucket); - } - - @Test - public void testParseQuotaWithValidInput() { - String quotaHeader = "per_hour;q=300;r=150;t=3600,per_day;q=3000;r=1500;t=86400"; - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.parseQuota(quotaHeader); - - assertNotNull(quotaBucket); - assertNotNull(quotaBucket.getPerHour()); - assertEquals(300, quotaBucket.getPerHour().getQuota()); - assertEquals(150, quotaBucket.getPerHour().getRemaining()); - assertEquals(3600, quotaBucket.getPerHour().getResetAfter()); - - assertNotNull(quotaBucket.getPerDay()); - assertEquals(3000, quotaBucket.getPerDay().getQuota()); - assertEquals(1500, quotaBucket.getPerDay().getRemaining()); - assertEquals(86400, quotaBucket.getPerDay().getResetAfter()); - } - - @Test - public void testParseQuotaWithInvalidInput() { - String quotaHeader = "invalid_format"; - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.parseQuota(quotaHeader); - - assertNull(quotaBucket); - } - - @Test - public void testParseQuotaWithEmptyInput() { - String quotaHeader = ""; - - TokenQuotaBucket quotaBucket = HttpResponseHeadersUtils.parseQuota(quotaHeader); - - assertNull(quotaBucket); - } -} diff --git a/src/test/java/com/auth0/utils/tokens/IdTokenVerifierTest.java b/src/test/java/com/auth0/utils/tokens/IdTokenVerifierTest.java deleted file mode 100644 index 1d4f69052..000000000 --- a/src/test/java/com/auth0/utils/tokens/IdTokenVerifierTest.java +++ /dev/null @@ -1,664 +0,0 @@ -package com.auth0.utils.tokens; - -import com.auth0.AssertsUtil; -import com.auth0.exception.IdTokenValidationException; -import com.auth0.jwt.JWT; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.interfaces.DecodedJWT; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.Calendar; -import java.util.Date; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class IdTokenVerifierTest { - - private final static String DOMAIN = "tokens-test.auth0.com"; - private final static String AUDIENCE = "tokens-test-123"; - - // Default clock time of September 2, 2019 5:00:00 AM GMT - private final static Date DEFAULT_CLOCK = new Date(1567400400000L); - private final static Integer DEFAULT_CLOCK_SKEW = 60; - - private SignatureVerifier signatureVerifier; - - @BeforeEach - public void setUp() { - signatureVerifier = mock(SignatureVerifier.class); - } - - @Test - public void failsToCreateOptionsWhenIssuerIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> IdTokenVerifier.init(null, "audience", signatureVerifier)); - } - - @Test - public void failsToCreateOptionsWhenAudienceIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> IdTokenVerifier.init("issuer", null, signatureVerifier)); - } - - @Test - public void failsToCreateOptionsWhenVerifierIsNull() { - verifyThrows(IllegalArgumentException.class, - () -> IdTokenVerifier.init("issuer", "audience", null)); - } - - @Test - public void failsWhenIDTokenMissing() { - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> IdTokenVerifier.init("issuer", "audience", signatureVerifier) - .build() - .verify(null), - "ID token is required but missing"); - } - - @Test - public void failsWhenIDTokenEmpty() { - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> IdTokenVerifier.init("issuer", "audience", signatureVerifier) - .build() - .verify(""), - "ID token is required but missing"); - } - - @Test - public void failsWhenTokenCannotBeDecoded() { - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> IdTokenVerifier.init(DOMAIN, AUDIENCE, SignatureVerifier.forHS256("secret")) - .build() - .verify("boom"), - "ID token could not be decoded"); - } - - @Test - public void failsWhenSignatureIsInvalid() { - String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjEyMzQiLCJpc3MiOiJodHRwczovL21lLmF1dGgwLmNvbS8iLCJhdWQiOiJkYU9nbkdzUlloa3d1NjIxdmYiLCJzdWIiOiJhdXRoMHx1c2VyMTIzIn0.a7ayNmFTxS2D-EIoUikoJ6dck7I8veWyxnje_mYD3qY"; - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> IdTokenVerifier.init(DOMAIN, AUDIENCE, SignatureVerifier.forHS256("asdlk59ckvkr")) - .build() - .verify(token), - "Invalid ID token signature"); - } - - @Test - public void failsWhenIssuerMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.B4PGlucyy-fJ4v5NNK2hntvjAf5m8dJf84WttwVnzV0ZlfPbYUSJm7Vc1ys7iMqXAQzAl2I8bDf2qhtLjaLpDKAH9JUvowUpCL7Bgjd7AEc1Te_IUwwxlpCupgseOEL2nrY8enP6On7BO7BBpngmVwnD1DvuA4lNoaaFyWUopha5Dxd5jw64wMqP4lz13C6Kqs8mINZkkw-NgE8DvWszaXeyPaowy-QpfXmPBnw75YLZlGcjr-WQsWQV7rUezq4Tl_11uPivR-fNcEWdG1mAtsnQnB_zJJKaHYlE0g4fey_6H9FKmCvcNkpBGo9ylbitb7jIuExbFEvEd2r_4wKl0g"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Issuer (iss) claim must be a string present in the ID token"); - } - - @Test - public void failsWhenIssuerInvalid() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzb21ldGhpbmctZWxzZSIsInN1YiI6ImF1dGgwfDEyMzQ1Njc4OSIsImF1ZCI6WyJ0b2tlbnMtdGVzdC0xMjMiLCJleHRlcm5hbC10ZXN0LTEyMyJdLCJleHAiOjE1Njc0ODY4MDAsImlhdCI6MTU2NzMxNDAwMCwibm9uY2UiOiJhNTl2azU5MiIsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU2NzMxNDAwMH0.lHFHyg1ei3hK2vB7X1xB9nqksAEnxtv2KKpE_Gih6RezTruF9uZu1PAZTEwxhfj2UrQxwLqCb-t6wyVnxVpCsymSCq9JIiCVgg_cYV38siMs38N9y26BrVeyifj_VOP9Om_vI_hHjOzhi8WmysK2KKAQnn0skKAkq8epY4axCX3NkRaEIMhhTaITYia3GbJ5Qki8WDD9UVucUVOhgSZBV5p1dL39FKgc9k1MOVZJG-zAd_r5GsUIRk-xUwNX0WYwCR9sC2G-FjJTvlFph_4vksponoUWJ-LPTLM0RwGgmEUPhhnIG23UjsNwpnElY4gWfIL0hsO98-5DpGjn8Ejr0w"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - String.format("Issuer (iss) claim mismatch in the ID token, expected \"%s\", found \"%s\"", - "https://" + DOMAIN + "/", "something-else")); - } - - @Test - public void failsWhenSubMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.fDR9NSbbt75w9nzhL-eBfGjOp16HP2vfnO6m_Oav0xrmmgyYsBZSLOPd2C0O46bp6_2hKjeOUhnwYwjocsdXI4hvfQkyACERtneCkwHwSZPZK-1h6vgGF7b_7ILUywEcgo7F6e1qgFTM93Prqk63cCP53KgOBPyx02y0rqkhUOApCWRVBFrfP92tXvFN7E2phmpf9G68PPjwnEvvQtYOGjvFkaWSja7MKT98f7OxgbenBI_mAZy9LmOqUl3SKJOBe5Fibs1snI0l4nzrgQ1GNxVwyfHOdyq-srdGe8rlFx5kdhWh313EOzWxxGTg4RhGY7Tiz1QWago0VQ5yOt0w8A"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Subject (sub) claim must be a string present in the ID token"); - } - - @Test - public void failsWhenAudienceMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJleHAiOjE1Njc0ODY4MDAsImlhdCI6MTU2NzMxNDAwMCwibm9uY2UiOiJhNTl2azU5MiIsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU2NzMxNDAwMH0.XM-IM9CIZ2cJpZZaKooMSmNgvwHPTse6kcIOPATgewRZxrDdCEjtPHmzmSuyDGy84vSR__DJS_kM2jWWwbkjB_PahXes210dpUqitRW3is9xV0-k0LkVwxmhHCM-e9sClbTbcs4zLv6WWFRq4UEU5DU6HhuHLQeeH0eO2Nv_tkvu-JdpmoepHPjW3ecMs0lhzXRT6_2o-ErTPdYt4W6yqpBG57HRIMzs9F72AWcPC6vhLY0IhMqXaq68Ma3jnEPIXUmv52bll0PuQVBqKd-eDH_jD0ZHFUCkwbfWPrkhJz5Q5qLzSzUjnrWKA3KgP4_Z1KfHY2-nQA2ynMgNFSn_eA"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Audience (aud) claim must be a string or array of strings present in the ID token"); - } - - @Test - public void failsWhenAudienceDoesNotContainClientId() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOiJleHRlcm5hbC10ZXN0LTEyMyIsImV4cCI6MTU2NzQ4NjgwMCwiaWF0IjoxNTY3MzE0MDAwLCJub25jZSI6ImE1OXZrNTkyIiwiYXpwIjoidG9rZW5zLXRlc3QtMTIzIiwiYXV0aF90aW1lIjoxNTY3MzE0MDAwfQ.SxeNIhm8reywgtSSkZ6jCpbZ8KyC09couFjpcrJFktAYKmJZnGQkv0gQLNUuGejORvysznOlhfO2nkF10yT6pKBiye9xZ8TstWQBorDKHL-74n6ZAxjPg1F0vHNokZq0zpPkwV-gKIFY6aPw3vyZTxzR6CMyoJdwc19A0RXPzPt6T7csQeqX0lzGEqqeIbU4VI5XM5RG1VvN82CgTlOQXlFZrKhyJx_xwslyWWDzx7tpPNid1wusvfznTGxoWO2wUBCyW6EhmyHp2euFi1gdJqHQVbrydutPtQ-FGQEwyWACNN8kBWqQ7UEbqimg6C0NTGrRkkKkJ79DmiW7aULHZQ"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - String.format("Audience (aud) claim mismatch in the ID token; expected \"%s\" but found \"%s\"", AUDIENCE, "[external-test-123]")); - } - - @Test - public void failsWhenExpClaimMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiaWF0IjoxNTY3MzE0MDAwLCJub25jZSI6ImE1OXZrNTkyIiwiYXpwIjoidG9rZW5zLXRlc3QtMTIzIiwiYXV0aF90aW1lIjoxNTY3MzE0MDAwfQ.b6saYAZCnCSzpVO0nrAUKVSC1n3GoqUfwrjOXG5gVxda0oFohpYJe68QwzsTmS4fOm7JtbN1FqjVRN6S4i-BnH-XGnciGOMFF4EfaOzsgo7DCrrLrjfx6rmqW8UPYalbfJTQL8mXYnLOxzMGP3DEXNlk-41GSZoFujwTAIqYjrV_Y3MUGYmzcVxdL_h2psLm_p07knMLCm7Cuo8znzKrU4PtuaLflvzorg57S4BD79oLv4uv0_dmhwPUgJDvqWeicR5Qry4aX2L5BT6V-nBWAcu3qVZDymSKcjtTebxszxY1siyA7BQe88ZmgP1bW1KXtMk_fOGsgWHFdu_AH77yow"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Expiration Time (exp) claim must be a number present in the ID token"); - } - - @Test - public void failsWhenExpClaimInvalidOutsideDefaultLeeway() { - Integer actualExpTime = 1567314000; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((DEFAULT_CLOCK_SKEW + 1) * 1000)); - - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3MzE0MDAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.uDn-4wtiigGddUw2kis_QyfDE3w75rWvu9NolMgD3b7l4_fedhQOk-z_mYID588ZXpnpLRKKiD5I2IFsXl7Qcc10rx1LIZxNqdzyc3VrgFf677x7fFZ4guR2WalH-zdJEluruMRdCIFQczIjXnGKPHGQ8gPH1LRozv43dl-bO2viX6MU4pTgNq3GIsU4ureyHrx1o9JSqF4b_RzuYvVWVVX7ABC2csMJP_ocVbEIQjUBhp1V7VcQY-Zgq0prk_HvY13g8FxK4KvSza637ZWAfonn599SKuy22PeMJqDfd64SbunWrt-mKBz9PHeAo9t4LJPLsAqSd3IQ2aJTsnqJRA"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .withClock(clock) - .build() - .verify(token), - String.format("Expiration Time (exp) claim error in the ID token; current time (%d) is after expiration time (%d)", - clock.getTime() / 1000, actualExpTime + DEFAULT_CLOCK_SKEW)); - } - - @Test - public void succeedsWhenExpClaimInPastButWithinDefaultLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3MzE0MDAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.uDn-4wtiigGddUw2kis_QyfDE3w75rWvu9NolMgD3b7l4_fedhQOk-z_mYID588ZXpnpLRKKiD5I2IFsXl7Qcc10rx1LIZxNqdzyc3VrgFf677x7fFZ4guR2WalH-zdJEluruMRdCIFQczIjXnGKPHGQ8gPH1LRozv43dl-bO2viX6MU4pTgNq3GIsU4ureyHrx1o9JSqF4b_RzuYvVWVVX7ABC2csMJP_ocVbEIQjUBhp1V7VcQY-Zgq0prk_HvY13g8FxK4KvSza637ZWAfonn599SKuy22PeMJqDfd64SbunWrt-mKBz9PHeAo9t4LJPLsAqSd3IQ2aJTsnqJRA"; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((DEFAULT_CLOCK_SKEW - 1) * 1000)); - - configureVerifier(token) - .withClock(clock) - .build() - .verify(token); - } - - @Test - public void failsWhenExpClaimInvalidOutsideCustomLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3MzE0MDAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.uDn-4wtiigGddUw2kis_QyfDE3w75rWvu9NolMgD3b7l4_fedhQOk-z_mYID588ZXpnpLRKKiD5I2IFsXl7Qcc10rx1LIZxNqdzyc3VrgFf677x7fFZ4guR2WalH-zdJEluruMRdCIFQczIjXnGKPHGQ8gPH1LRozv43dl-bO2viX6MU4pTgNq3GIsU4ureyHrx1o9JSqF4b_RzuYvVWVVX7ABC2csMJP_ocVbEIQjUBhp1V7VcQY-Zgq0prk_HvY13g8FxK4KvSza637ZWAfonn599SKuy22PeMJqDfd64SbunWrt-mKBz9PHeAo9t4LJPLsAqSd3IQ2aJTsnqJRA"; - int leeway = 120; - - Date actualExp = JWT.decode(token).getExpiresAt(); - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((leeway + 1) * 1000)); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .withClock(clock) - .withLeeway(leeway) - .build() - .verify(token), - String.format("Expiration Time (exp) claim error in the ID token; current time (%d) is after expiration time (%d)", - clock.getTime() / 1000, ((actualExp.getTime() / 1000) + leeway))); - } - - @Test - public void succeedsWhenExpClaimInPastButWithinCustomLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3MzE0MDAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.uDn-4wtiigGddUw2kis_QyfDE3w75rWvu9NolMgD3b7l4_fedhQOk-z_mYID588ZXpnpLRKKiD5I2IFsXl7Qcc10rx1LIZxNqdzyc3VrgFf677x7fFZ4guR2WalH-zdJEluruMRdCIFQczIjXnGKPHGQ8gPH1LRozv43dl-bO2viX6MU4pTgNq3GIsU4ureyHrx1o9JSqF4b_RzuYvVWVVX7ABC2csMJP_ocVbEIQjUBhp1V7VcQY-Zgq0prk_HvY13g8FxK4KvSza637ZWAfonn599SKuy22PeMJqDfd64SbunWrt-mKBz9PHeAo9t4LJPLsAqSd3IQ2aJTsnqJRA"; - Integer leeway = 120; - - // set clock to September 1, 2019 5:00:00 AM GMTExpiration Time (exp) claim error in the ID token; current time - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((leeway - 1) * 1000)); - - configureVerifier(token) - .withLeeway(leeway) - .withClock(clock) - .build() - .verify(token); - } - - @Test - public void failsWhenIatClaimMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJub25jZSI6ImE1OXZrNTkyIiwiYXpwIjoidG9rZW5zLXRlc3QtMTIzIiwiYXV0aF90aW1lIjoxNTY3MzE0MDAwfQ.SJDgK8W9Y8stMtE9LG2OzHzXzbIDCXg8lRhKyOim4rRXbkg3k0on7gCzN-sy2d5z5TQ-lQzbY3V4z-so3ltVDUYd_8RjmUiKgNK_95UsxfTDM2BlBEQ6USMVl3ojC5jcTBhg5MF16ZBEn94IjIGC9Uks9GPseM-JrtUPx4Uj5VvsBtmeKxLc3rSGt7rYC4JU65Oa-O5pFYRSCbNzRFNHRlmnb5b2uPHxoVLjrJAT0FhlXcsNgfz65MlbXBgAyz7xjCEhw_tTpvptaCwPTeG0mgBYlGQ7Sl3xHJzgG4jLbA7Pvvfcx0MpBPHUZxADh1FFQnf2nHB0ppddiDfOq2mHNA"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Issued At (iat) claim must be a number present in the ID token"); - } - - @Test - public void failsWhenNonceConfiguredButNoNonceClaimSent() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU2NzMxNDAwMH0.ZRYK4s72pKXJUSadByPp_MNyuaACmPCyj9RaIfxuTTLXE45YJ0toLK6XjjDv_861E_fRmEKMthnJAmHcKXiDWGb73l3iDtD7clockBOo3KJO2cwkM1uYNpG1kbNkg6WDvgGlVsC7buxr8dbL8fI2e0g53Jl48lE9Ohi5Z_7iRmRoVAx5HE60UDfEqFeAKZyu5VsAahp9q3PwhLfaJVDobtAzWP0LcRA3x8FOA0ZdBBNpvRmeBRugU2GQTSDLSMtGzgi5xXUwXly7pr5bX-lIYICU1Q9R5n-8uYlEaFuiaYTqzxY0fmSzzGeFkwrj7b0yTQ2OwAFVT3MWCSbvjKsy-JWQ"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token, "nonce"), - "Nonce (nonce) claim must be a string present in the ID token"); - } - - @Test - public void failsWhenNonceIsInvalid() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiMDAwOTk5IiwiYXpwIjoidG9rZW5zLXRlc3QtMTIzIiwiYXV0aF90aW1lIjoxNTY3MzE0MDAwfQ.n4jIX01mNucMs92F8IZtKJeCvgUYPwrrOsaZX91fnzVkDC5tAqi4HLRGHjtUJe1PwmIijJk63FskeuApVPfxfAbITL1KBVDHiin2RVeDSAl5lhSnsSYW-k5MfzXx11MJxhS_VD5zvOgbWmuRYUHlc1zh48YyJZQE-OaEFvxGyyEM7Zhgzfz4D5_kjd2qV890WsXGs_GadyzxATfP59XENnPzMo3VLXyBC4cQ0e7rzBIqquBKo9-MT6rhy_qSwMrZJhyzSzE5gTtMd2Od9YgPUtLznBt34rBD1uJaSs_a4s1Ox3h4jTCm85xWFabGx3kz7xkD33nCiMKQ_FSy1d-toQ"; - - String expectedNonce = "nonce"; - String actualNonce = "000999"; - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token, expectedNonce), - String.format("Nonce (nonce) claim mismatch in the ID token; expected \"%s\", found \"%s\"", expectedNonce, actualNonce)); - } - - @Test - public void failsWhenAudClaimHasMultipleItemsButAzpMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOjQyLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.SliF71jOX9JsGeUPCySf3ucY_tGr3uh183cbcUN9ze3qRiOAc5bi7vdsBtODtlVJgsx0Elt0JrISTJ8SoNkpA4SxrjFpxSsfzPBwQtJrlg7pqflgBH7g6zKGVGRs2Z0jxZaCvXQvRuUZRZwFIncZ2zTFIDI3X5xLeJAGRGWaInOvLLlumGzWzfNLUG_G5uHZQW6sRgyIw9qrdqEWXO6sGjOBG9Au6jIo2IH0I53-UujAnNHWeJRPsM5xw2bHPteIde1xn4N0w26BlZ4GEQifVQDFw3ukah35SQ-ENMMS58Siu-sysF5F3oxdwVaMidyYgrD2VUN_iXIaMPwA2i0M5Q"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - "Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"); - } - - @Test - public void failsWhenAudClaimHasMultipleItemsButAzpInvalid() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJleHRlcm5hbC10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU2NzMxNDAwMH0.GLuChuSum2S6h79rfRbJrJfe_7Fw_D6RHXj9zrAhixoNLMyBosO2GBPsOgoaLTDMonJzCyqskjan-w-SJ5nw7fUmDkWfPVjXcS0x5pt72j0dgfLMu6eOFIA9jWHWN4hsN3XKJktZ9202AohI8fXO5BYQ-jMi0HWQaiUj3f6wITHEN6fTydLo_t24hriExkO1670AgzM22BVTfb-JJlrs32t6ffY77zrF5ahIg_h4ROgrcf_3LejF7ZnubHbpJ-wX-byxW9YXT5tN_JjD5EP6jC37s9iL8ArGEZtBzHVfCO0kqlaH-9PVZXgz8SjMSJ8iA2fXXN0L35ySdzida3hhzw"; - String actualAzp = "external-test-123"; - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token), - String.format("Authorized Party (azp) claim mismatch in the ID token; expected \"%s\", found \"%s\"", AUDIENCE, actualAzp)); - } - - @Test - public void failsWhenMaxAgeSentButAuthTimeClaimMissing() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMifQ.Gb36qNHgQgac1fXh9AHX7ZMroymT0j4TjNol3ZirbIOyxuHV4OxCbGcoAAxC8Zt_dIc3DH9SX3QUIwTkE3DsFxS-VJ58R2d9RbXJl5p8pO1sJNFjo59njLKbiBxVil4z8PUsw77c_4f2QtKn6LHzhGqL9CS84LUCgNPPBsBHYyNRJDwIauPrrLyOsZAS3dWlZiUDBFurSYe0Y-O6d8zF_uKOcTD8A2E3SQQlZJQ12T94IprQ9V0tbbWI8VSGQ23JghR62QwZC-rBOF9pQMcLLCNRLFTTF9sXqZuS9XRv7PZ6rRjaonHDWn8WqGjSleWSycPsvwvjjSUVR8Z3iDBZig"; - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .build() - .verify(token, null, 200), - "Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"); - } - - @Test - public void failsWhenMaxSentButAuthTimeInvalidWithinLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.AbSYZ_Tu0-ZelCRPuu9jOd9y1M19yIlk8bjSQDVVgAekRZLdRA_T_gi_JeWyFysKZVpRcHC1YJhTH4YH8CCMRTwviq3woIsLmdUecjydyZkHcUlhHXj2DbC15cyELalPNe3T9eZ4ySwk9qRJSOkjBAgXAT0a7M6rwri6QHnL0WxTLX4us4rGu8Ui3kuf1WaZH9DNoeWYs1N3xUclockTkRKaqXnuKjnwSVmsuwxFSlnIPJOiMUUZksiaBq_OUvOkB-dEG7OFiDX9XWj1m62yBHkvZHun8LBr9VW3mt1IrcBdbbtzjWwfn6ioK2c4dbtPFhuYohXsmRDaSekP63Dmlw3A"; - - int actualAuthTime = 1567314000; - int maxAge = 120; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((maxAge + (DEFAULT_CLOCK_SKEW + 1)) * 1000)); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .withClock(clock) - .build() - .verify(token, null, maxAge), - String.format("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (%d) is after last auth at (%d)", - clock.getTime() / 1000, actualAuthTime + maxAge + DEFAULT_CLOCK_SKEW)); - } - - @Test - public void succeedsWhenMaxSentAndAuthTimeWithinLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.AbSYZ_Tu0-ZelCRPuu9jOd9y1M19yIlk8bjSQDVVgAekRZLdRA_T_gi_JeWyFysKZVpRcHC1YJhTH4YH8CCMRTwviq3woIsLmdUecjydyZkHcUlhHXj2DbC15cyELalPNe3T9eZ4ySwk9qRJSOkjBAgXAT0a7M6rwri6QHnL0WxTLX4us4rGu8Ui3kuf1WaZH9DNoeWYs1N3xUclockTkRKaqXnuKjnwSVmsuwxFSlnIPJOiMUUZksiaBq_OUvOkB-dEG7OFiDX9XWj1m62yBHkvZHun8LBr9VW3mt1IrcBdbbtzjWwfn6ioK2c4dbtPFhuYohXsmRDaSekP63Dmlw3A"; - - Integer maxAge = 120; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((maxAge + (DEFAULT_CLOCK_SKEW - 1)) * 1000)); - - configureVerifier(token) - .withClock(clock) - .build() - .verify(token, null, maxAge); - } - - @Test - public void failsWhenMaxSentButAuthTimeInvalidWithCustomLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.AbSYZ_Tu0-ZelCRPuu9jOd9y1M19yIlk8bjSQDVVgAekRZLdRA_T_gi_JeWyFysKZVpRcHC1YJhTH4YH8CCMRTwviq3woIsLmdUecjydyZkHcUlhHXj2DbC15cyELalPNe3T9eZ4ySwk9qRJSOkjBAgXAT0a7M6rwri6QHnL0WxTLX4us4rGu8Ui3kuf1WaZH9DNoeWYs1N3xUclockTkRKaqXnuKjnwSVmsuwxFSlnIPJOiMUUZksiaBq_OUvOkB-dEG7OFiDX9XWj1m62yBHkvZHun8LBr9VW3mt1IrcBdbbtzjWwfn6ioK2c4dbtPFhuYohXsmRDaSekP63Dmlw3A"; - - int actualAuthTime = 1567314000; - Integer maxAge = 120; - Integer customLeeway = 120; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((maxAge + customLeeway + 1) * 1000)); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(token) - .withClock(clock) - .withLeeway(customLeeway) - .build() - .verify(token, null, maxAge), - String.format("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (%d) is after last auth at (%d)", - clock.getTime() / 1000, actualAuthTime + maxAge + customLeeway)); - } - - @Test - public void succeedsWhenMaxSentAndAuthTimeWithCustomLeeway() { - String token = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC0xMjMiXSwiZXhwIjoxNTY3NDg2ODAwLCJpYXQiOjE1NjczMTQwMDAsIm5vbmNlIjoiYTU5dms1OTIiLCJhenAiOiJ0b2tlbnMtdGVzdC0xMjMiLCJhdXRoX3RpbWUiOjE1NjczMTQwMDB9.AbSYZ_Tu0-ZelCRPuu9jOd9y1M19yIlk8bjSQDVVgAekRZLdRA_T_gi_JeWyFysKZVpRcHC1YJhTH4YH8CCMRTwviq3woIsLmdUecjydyZkHcUlhHXj2DbC15cyELalPNe3T9eZ4ySwk9qRJSOkjBAgXAT0a7M6rwri6QHnL0WxTLX4us4rGu8Ui3kuf1WaZH9DNoeWYs1N3xUclockTkRKaqXnuKjnwSVmsuwxFSlnIPJOiMUUZksiaBq_OUvOkB-dEG7OFiDX9XWj1m62yBHkvZHun8LBr9VW3mt1IrcBdbbtzjWwfn6ioK2c4dbtPFhuYohXsmRDaSekP63Dmlw3A"; - - Integer maxAge = 120; - Integer customLeeway = 120; - - // set clock to September 1, 2019 5:00:00 AM GMT - Date clock = new Date(1567314000000L); - clock.setTime(clock.getTime() + ((maxAge + customLeeway - 1) * 1000)); - - configureVerifier(token) - .withClock(clock) - .withLeeway(customLeeway) - .build() - .verify(token, null, maxAge); - } - - @Test - public void succeedsWithValidTokenUsingDefaultClock() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("nonce", "nonce") - .sign(Algorithm.HMAC256("secret")); - - DecodedJWT decodedJWT = JWT.decode(token); - SignatureVerifier verifier = mock(SignatureVerifier.class); - when(verifier.verifySignature(token)).thenReturn(decodedJWT); - - IdTokenVerifier.init("https://" + DOMAIN + "/", AUDIENCE, verifier) - .build() - .verify(token, "nonce"); - } - - @Test - public void succeedsWithValidTokenUsingDefaultClockAndHttpDomain() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("http://" + DOMAIN + "/") - .withClaim("nonce", "nonce") - .sign(Algorithm.HMAC256("secret")); - - DecodedJWT decodedJWT = JWT.decode(token); - SignatureVerifier verifier = mock(SignatureVerifier.class); - when(verifier.verifySignature(token)).thenReturn(decodedJWT); - - IdTokenVerifier.init("http://" + DOMAIN + "/", AUDIENCE, verifier) - .build() - .verify(token, "nonce"); - } - - @Test - public void succeedsWithValidTokenUsingDefaultClockAndHttpsDomain() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("nonce", "nonce") - .sign(Algorithm.HMAC256("secret")); - - DecodedJWT decodedJWT = JWT.decode(token); - SignatureVerifier verifier = mock(SignatureVerifier.class); - when(verifier.verifySignature(token)).thenReturn(decodedJWT); - - IdTokenVerifier.init("https://" + DOMAIN + "/", AUDIENCE, verifier) - .build() - .verify(token, "nonce"); - } - - @Test - public void succeedsWhenOrganizationNamdMatchesExpected() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_name", "my org") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - configureVerifier(jwt) - .withOrganization("my org") - .build() - .verify(jwt); - } - - @Test - public void failsWhenOrganizationNameDoesNotMatchExpected() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_name", "my org") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(jwt) - .withOrganization("your org") - .build() - .verify(jwt), - "Organization (org_name) claim mismatch in the ID token; expected \"your org\" but found \"my org\""); - } - - @Test - public void failsWhenOrganizationNameExpectedButClaimIsNotString() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_name", 42) - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, () -> { - configureVerifier(jwt) - .withOrganization("my org") - .build() - .verify(jwt); - }, - "Organization name (org_name) claim must be a string present in the ID token"); - } - - @Test - public void succeedsWhenOrganizationNameNotSpecifiedButIsPresent() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_name", "my org") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - configureVerifier(jwt) - .build() - .verify(jwt); - } - - @Test - public void succeedsWhenOrganizationIdMatchesExpected() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_id", "org_123") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - configureVerifier(jwt) - .withOrganization("org_123") - .build() - .verify(jwt); - } - - @Test - public void failsWhenOrganizationIdDoesNotMatchExpected() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_id", "org_123") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(jwt) - .withOrganization("org_abc") - .build() - .verify(jwt), - "Organization (org_id) claim mismatch in the ID token; expected \"org_abc\" but found \"org_123\""); - } - - @Test - public void failsWhenOrganizationIdDoesNotMatchExpected_caseSensitive() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_id", "oRg_123") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(jwt) - .withOrganization("org_123") - .build() - .verify(jwt), - "Organization (org_id) claim mismatch in the ID token; expected \"org_123\" but found \"oRg_123\""); - } - - @Test - public void failsWhenOrganizationIdExpectedButNotPresent() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, - () -> configureVerifier(jwt) - .withOrganization("org_123") - .build() - .verify(jwt), - "Organization Id (org_id) claim must be a string present in the ID token"); - } - - @Test - public void succeedsWhenOrganizationNameDoesNotMatchExpected_caseInsensitive() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_name", "my org") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - configureVerifier(jwt) - .withOrganization("My org") - .build() - .verify(jwt); - } - - @Test - public void failsWhenOrganizationIdExpectedButClaimIsNotString() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_id", 42) - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - AssertsUtil.verifyThrows(IdTokenValidationException.class, () -> { - configureVerifier(jwt) - .withOrganization("org_123") - .build() - .verify(jwt); - }, - "Organization Id (org_id) claim must be a string present in the ID token"); - } - - @Test - public void succeedsWhenOrganizationIdNotSpecifiedButIsPresent() { - String token = JWT.create() - .withSubject("auth0|sdk458fks") - .withAudience(AUDIENCE) - .withIssuedAt(getYesterday()) - .withExpiresAt(getTomorrow()) - .withIssuer("https://" + DOMAIN + "/") - .withClaim("org_id", "org_123") - .sign(Algorithm.HMAC256("secret")); - - String jwt = JWT.decode(token).getToken(); - - configureVerifier(jwt) - .build() - .verify(jwt); - } - - private IdTokenVerifier.Builder configureVerifier(String token) { - DecodedJWT decodedJWT = JWT.decode(token); - SignatureVerifier verifier = mock(SignatureVerifier.class); - when(verifier.verifySignature(token)).thenReturn(decodedJWT); - - return IdTokenVerifier.init("https://" + DOMAIN + "/", AUDIENCE, verifier) - .withClock(DEFAULT_CLOCK); - } - - private Date getYesterday() { - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.DATE, -1); - - return cal.getTime(); - } - - private Date getTomorrow() { - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.DATE, 1); - - return cal.getTime(); - } -} diff --git a/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java b/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java deleted file mode 100644 index 443a99ddd..000000000 --- a/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.auth0.utils.tokens; - -import com.auth0.exception.IdTokenValidationException; -import com.auth0.exception.PublicKeyProviderException; -import com.auth0.jwt.exceptions.AlgorithmMismatchException; -import com.auth0.jwt.interfaces.DecodedJWT; -import org.junit.jupiter.api.Test; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyFactory; -import java.security.PublicKey; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; -import java.util.Base64; -import java.util.Scanner; - -import static com.auth0.AssertsUtil.verifyThrows; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -public class SignatureVerifierTest { - - private static final String EXPIRED_HS_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjEyMzQiLCJpc3MiOiJodHRwczovL21lLmF1dGgwLmNvbS8iLCJhdWQiOiJkYU9nbkdzUlloa3d1NjIxdmYiLCJzdWIiOiJhdXRoMHx1c2VyMTIzIiwiZXhwIjo5NzE3ODkzMTd9.5_VOXBmOVMSi8OGgonyfyiJSq3A03PwOEuZlPD-Gxik"; - private static final String NONE_JWT = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJub25jZSI6IjEyMzQiLCJpc3MiOiJodHRwczovL21lLmF1dGgwLmNvbS8iLCJhdWQiOiJkYU9nbkdzUlloa3d1NjIxdmYiLCJzdWIiOiJhdXRoMHx1c2VyMTIzIn0."; - private static final String HS_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjEyMzQiLCJpc3MiOiJodHRwczovL21lLmF1dGgwLmNvbS8iLCJhdWQiOiJkYU9nbkdzUlloa3d1NjIxdmYiLCJzdWIiOiJhdXRoMHx1c2VyMTIzIn0.a7ayNmFTxS2D-EIoUikoJ6dck7I8veWyxnje_mYD3qY"; - private static final String RS_JWT = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFiYzEyMyJ9.eyJub25jZSI6IjEyMzQiLCJpc3MiOiJodHRwczovL21lLmF1dGgwLmNvbS8iLCJhdWQiOiJkYU9nbkdzUlloa3d1NjIxdmYiLCJzdWIiOiJhdXRoMHx1c2VyMTIzIn0.PkPWdoZNfXz8EB0SBPH83lNSOhyhdhdqYIgIwgY2nHozUnFOaUjVewlAXxP_3LBGibQ_ng4s5fEEOCJjaKBy04McryvOuL6nqb1dPQseeyxuv2zQitfrs-7kEtfeS3umywM-tV6guw9_W3nmIgaXOiYiF4WJM23ItbdCmvwdXLaf9-xHkQbRY_zEwEFbprFttKUXFbkPt6XjZ3zZwZbNZn64bx2PBiSJ2KMZAE3Lghmci-RXdhi7hXpmN30Tzze1ZsjvVeRRKNzShByKK9ZGZPmQ5yggJOXFy32ehjGkYwFMCqgMQomcGbcYhsd97huKHMHl3HOE5GDYjIq9o9oKRA"; - private static final String RS_PUBLIC_KEY = "src/test/resources/keys/public-rsa.pem"; - private static final String RS_PUBLIC_KEY_BAD = "src/test/resources/keys/bad-public-rsa.pem"; - - @Test - public void failsWhenAlgorithmIsNotExpected() { - verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier.forHS256("secret") - .verifySignature(NONE_JWT), - "Signature algorithm of \"none\" is not supported. Expected the ID token to be signed with \"HS256\""); - } - - @Test - public void failsWhenTokenCannotBeDecoded() { - verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier.forHS256("secret") - .verifySignature("boom"), - "ID token could not be decoded"); - } - - @Test - public void failsWhenAlgorithmRS256IsNotExpected() { - verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier.forHS256("secret") - .verifySignature(RS_JWT), - "Signature algorithm of \"RS256\" is not supported. Expected the ID token to be signed with \"HS256\""); - } - - @Test - public void failsWhenAlgorithmHS256IsNotExpected() { - IdTokenValidationException e = verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier.forHS256("secret") - .verifySignature(RS_JWT), - "Signature algorithm of \"RS256\" is not supported. Expected the ID token to be signed with \"HS256\""); - assertThat(e.getCause(), instanceOf(AlgorithmMismatchException.class)); - } - - @Test - public void succeedsWithValidSignatureHS256Token() { - SignatureVerifier verifier = SignatureVerifier.forHS256("secret"); - DecodedJWT decodedJWT = verifier.verifySignature(HS_JWT); - - assertThat(decodedJWT, notNullValue()); - } - - @Test - public void succeedsAndIgnoresExpiredTokenException() { - SignatureVerifier verifier = SignatureVerifier.forHS256("secret"); - DecodedJWT decodedJWT = verifier.verifySignature(EXPIRED_HS_JWT); - - assertThat(decodedJWT, notNullValue()); - } - - @Test - public void failsWithInvalidSignatureHS256Token() { - verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier.forHS256("badsecret") - .verifySignature(HS_JWT), - "Invalid ID token signature"); - } - - @Test - public void succeedsWithValidSignatureRS256Token() { - SignatureVerifier verifier = SignatureVerifier.forRS256(getRSProvider(RS_PUBLIC_KEY)); - DecodedJWT decodedJWT = verifier.verifySignature(RS_JWT); - - assertThat(decodedJWT, notNullValue()); - } - - @Test - public void failsWithInvalidSignatureRS256Token() { - verifyThrows(IdTokenValidationException.class, - () -> SignatureVerifier - .forRS256(getRSProvider(RS_PUBLIC_KEY_BAD)) - .verifySignature(RS_JWT), - "Invalid ID token signature"); - } - - @Test - public void failsWhenErrorGettingPublicKey() { - verifyThrows(IdTokenValidationException.class, - () -> { - SignatureVerifier.forRS256(new PublicKeyProvider() { - @Override - public RSAPublicKey getPublicKeyById(String keyId) throws PublicKeyProviderException { - throw new PublicKeyProviderException("error"); - } - }).verifySignature(RS_JWT); - }, - "Could not find a public key for Key ID (kid) \"abc123\""); - } - - @Test - public void failsWithNullVerifier() { - verifyThrows(IllegalArgumentException.class, - NullVerifier::new, - "'algorithm' cannot be null!"); - } - - private PublicKeyProvider getRSProvider(String rsaPath) { - return new PublicKeyProvider() { - @Override - public RSAPublicKey getPublicKeyById(String keyId) throws PublicKeyProviderException { - try { - return readPublicKeyFromFile(rsaPath); - } catch (IOException ioe) { - throw new PublicKeyProviderException("Error reading public key", ioe); - } - } - }; - } - - private static RSAPublicKey readPublicKeyFromFile(final String path) throws IOException { - Scanner scanner = null; - BufferedReader reader = null; - try { - scanner = new Scanner(Paths.get(path)); - if (scanner.hasNextLine() && scanner.nextLine().startsWith("-----BEGIN CERTIFICATE-----")) { - FileInputStream fs = new FileInputStream(path); - CertificateFactory fact = CertificateFactory.getInstance("X.509"); - X509Certificate cer = (X509Certificate) fact.generateCertificate(fs); - PublicKey key = cer.getPublicKey(); - fs.close(); - return (RSAPublicKey) key; - } else { - reader = new BufferedReader(new FileReader(path)); - StringBuilder pemContent = new StringBuilder(); - String line; - while ((line = reader.readLine()) != null) { - if (!line.startsWith("-----BEGIN") && !line.startsWith("-----END")) { - pemContent.append(line); - } - } - byte[] keyBytes = Base64.getDecoder().decode(pemContent.toString()); - KeyFactory kf = KeyFactory.getInstance("RSA"); - EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); - return (RSAPublicKey) kf.generatePublic(keySpec); - } - } catch (Exception e) { - throw new IOException("Couldn't parse the RSA Public Key / Certificate file.", e); - } finally { - if (scanner != null) { - scanner.close(); - } - if (reader != null) { - reader.close(); - } - } - } - - private static class NullVerifier extends SignatureVerifier { - NullVerifier() { - super(null); - } - } -} diff --git a/src/test/resources/mgmt/action.json b/src/test/resources/action.json similarity index 100% rename from src/test/resources/mgmt/action.json rename to src/test/resources/action.json diff --git a/src/test/resources/mgmt/action_execution.json b/src/test/resources/action_execution.json similarity index 100% rename from src/test/resources/mgmt/action_execution.json rename to src/test/resources/action_execution.json diff --git a/src/test/resources/mgmt/action_trigger_bindings.json b/src/test/resources/action_trigger_bindings.json similarity index 100% rename from src/test/resources/mgmt/action_trigger_bindings.json rename to src/test/resources/action_trigger_bindings.json diff --git a/src/test/resources/mgmt/action_triggers.json b/src/test/resources/action_triggers.json similarity index 100% rename from src/test/resources/mgmt/action_triggers.json rename to src/test/resources/action_triggers.json diff --git a/src/test/resources/mgmt/action_version.json b/src/test/resources/action_version.json similarity index 100% rename from src/test/resources/mgmt/action_version.json rename to src/test/resources/action_version.json diff --git a/src/test/resources/mgmt/action_versions_list.json b/src/test/resources/action_versions_list.json similarity index 100% rename from src/test/resources/mgmt/action_versions_list.json rename to src/test/resources/action_versions_list.json diff --git a/src/test/resources/mgmt/actions_list.json b/src/test/resources/actions_list.json similarity index 100% rename from src/test/resources/mgmt/actions_list.json rename to src/test/resources/actions_list.json diff --git a/src/test/resources/mgmt/active_users_count.json b/src/test/resources/active_users_count.json similarity index 100% rename from src/test/resources/mgmt/active_users_count.json rename to src/test/resources/active_users_count.json diff --git a/src/test/resources/auth/add_oob_authenticator_response.json b/src/test/resources/auth/add_oob_authenticator_response.json deleted file mode 100644 index df463c1c2..000000000 --- a/src/test/resources/auth/add_oob_authenticator_response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "oob_code": "Fe26.2**da6....", - "binding_method":"prompt", - "authenticator_type":"oob", - "oob_channel":"sms", - "recovery_codes":["ABCDEFGDRFK75ABYR7PH8TJA"], - "barcode_uri":"otpauth://..." -} diff --git a/src/test/resources/auth/add_otp_authenticator_response.json b/src/test/resources/auth/add_otp_authenticator_response.json deleted file mode 100644 index f4c71fc7f..000000000 --- a/src/test/resources/auth/add_otp_authenticator_response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "secret": "ABCDEFGMK5CE6WTZKRTTQRKUJVFXOVRF", - "barcode_uri":"otpauth://...", - "authenticator_type":"otp", - "recovery_codes":["ABCDEFGDRFK75ABYR7PH8TJA"] -} diff --git a/src/test/resources/auth/back_channel_authorize_response.json b/src/test/resources/auth/back_channel_authorize_response.json deleted file mode 100644 index bc0649f08..000000000 --- a/src/test/resources/auth/back_channel_authorize_response.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "auth_req_id": "red_id_1", - "expires_in": 300, - "interval": 5 -} diff --git a/src/test/resources/auth/back_channel_login_status_response.json b/src/test/resources/auth/back_channel_login_status_response.json deleted file mode 100644 index bc1676e2c..000000000 --- a/src/test/resources/auth/back_channel_login_status_response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "access_token": "eyJhbGciOiJkaXIi.....", - "id_token": "eyJhbGciOiJSUzI1NiIs.....", - "expires_in": 86400, - "scope": "openid" -} diff --git a/src/test/resources/auth/error_plaintext.json b/src/test/resources/auth/error_plaintext.json deleted file mode 100644 index 084a6ed4c..000000000 --- a/src/test/resources/auth/error_plaintext.json +++ /dev/null @@ -1 +0,0 @@ -A plain-text error response \ No newline at end of file diff --git a/src/test/resources/auth/error_with_description.json b/src/test/resources/auth/error_with_description.json deleted file mode 100644 index bd84129e6..000000000 --- a/src/test/resources/auth/error_with_description.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "BadRequestError", - "code": "user_exists", - "description": "The user already exists.", - "statusCode": 400 -} \ No newline at end of file diff --git a/src/test/resources/auth/error_with_description_and_extra_properties.json b/src/test/resources/auth/error_with_description_and_extra_properties.json deleted file mode 100644 index a1799ae15..000000000 --- a/src/test/resources/auth/error_with_description_and_extra_properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "error": "mfa_required", - "error_description": "Multifactor authentication required", - "mfa_token": "Fe26...Ha" -} \ No newline at end of file diff --git a/src/test/resources/auth/error_with_error.json b/src/test/resources/auth/error_with_error.json deleted file mode 100644 index ecadf352f..000000000 --- a/src/test/resources/auth/error_with_error.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "missing username for Username-Password-Authentication connection with requires_username enabled" -} \ No newline at end of file diff --git a/src/test/resources/auth/error_with_error_description.json b/src/test/resources/auth/error_with_error_description.json deleted file mode 100644 index 1ca27286f..000000000 --- a/src/test/resources/auth/error_with_error_description.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "error": "invalid_request", - "error_description": "the connection was not found" -} \ No newline at end of file diff --git a/src/test/resources/auth/list_authenticators_response.json b/src/test/resources/auth/list_authenticators_response.json deleted file mode 100644 index 27800f194..000000000 --- a/src/test/resources/auth/list_authenticators_response.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id":"recovery-code|dev_DsvzGfZw2Fg5N3rI", - "authenticator_type":"recovery-code", - "active":true - }, - { - "id":"sms|dev_gB342kcL2K22S4yB", - "authenticator_type":"oob", - "oob_channel":"sms", - "name":"+X XXXX1234", - "active":true - }, - { - "id":"sms|dev_gB342kcL2K22S4yB", - "authenticator_type":"oob", - "oob_channel":"sms", - "name":"+X XXXX1234", - "active":false - }, - { - "id":"totp|dev_LJaKaN5O3tjRFOw2", - "authenticator_type":"otp", - "active":true - } -] diff --git a/src/test/resources/auth/mfa_challenge_request_response.json b/src/test/resources/auth/mfa_challenge_request_response.json deleted file mode 100644 index 469fc18e0..000000000 --- a/src/test/resources/auth/mfa_challenge_request_response.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "challenge_type":"oob", - "binding_method":"prompt", - "oob_code": "abcde...dasg" -} diff --git a/src/test/resources/auth/password_strength_error_none.json b/src/test/resources/auth/password_strength_error_none.json deleted file mode 100644 index 4f6e8b883..000000000 --- a/src/test/resources/auth/password_strength_error_none.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "code": "invalid_password", - "description": { - "rules": [ - { - "code": "lengthAtLeast", - "format": [ - 10 - ], - "message": "At least %d characters in length", - "verified": false - }, - { - "code": "containsAtLeast", - "format": [ - 3, - 4 - ], - "items": [ - { - "code": "lowerCase", - "message": "lower case letters (a-z)", - "verified": false - }, - { - "code": "upperCase", - "message": "upper case letters (A-Z)", - "verified": false - }, - { - "code": "numbers", - "message": "numbers (i.e. 0-9)", - "verified": false - }, - { - "code": "specialCharacters", - "message": "special characters (e.g. !@#$%^&*)", - "verified": false - } - ], - "message": "Contain at least %d of the following %d types of characters:", - "verified": false - }, - { - "code": "shouldContain", - "items": [ - { - "code": "lowerCase", - "message": "lower case letters (a-z)", - "verified": false - }, - { - "code": "upperCase", - "message": "upper case letters (A-Z)", - "verified": false - }, - { - "code": "numbers", - "message": "numbers (i.e. 0-9)", - "verified": false - }, - { - "code": "specialCharacters", - "message": "special characters (e.g. !@#$%^&*)", - "verified": false - } - ], - "message": "Should contain:", - "verified": false - }, - { - "code": "identicalChars", - "format": [ - 2, - "aaa" - ], - "message": "No more than %d identical characters in a row (e.g., \"%s\" not allowed)", - "verified": false - } - ], - "verified": false - }, - "name": "PasswordStrengthError", - "statusCode": 400 -} \ No newline at end of file diff --git a/src/test/resources/auth/password_strength_error_some.json b/src/test/resources/auth/password_strength_error_some.json deleted file mode 100644 index 90aea75bb..000000000 --- a/src/test/resources/auth/password_strength_error_some.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "code": "invalid_password", - "description": { - "rules": [ - { - "code": "lengthAtLeast", - "format": [ - 10 - ], - "message": "At least %d characters in length", - "verified": true - }, - { - "code": "containsAtLeast", - "format": [ - 3, - 4 - ], - "items": [ - { - "code": "lowerCase", - "message": "lower case letters (a-z)", - "verified": true - }, - { - "code": "upperCase", - "message": "upper case letters (A-Z)", - "verified": true - }, - { - "code": "numbers", - "message": "numbers (i.e. 0-9)", - "verified": true - }, - { - "code": "specialCharacters", - "message": "special characters (e.g. !@#$%^&*)", - "verified": false - } - ], - "message": "Contain at least %d of the following %d types of characters:", - "verified": true - }, - { - "code": "shouldContain", - "items": [ - { - "code": "lowerCase", - "message": "lower case letters (a-z)", - "verified": false - }, - { - "code": "upperCase", - "message": "upper case letters (A-Z)", - "verified": false - }, - { - "code": "numbers", - "message": "numbers (i.e. 0-9)", - "verified": false - }, - { - "code": "specialCharacters", - "message": "special characters (e.g. !@#$%^&*)", - "verified": false - } - ], - "message": "Should contain:", - "verified": false - }, - { - "code": "identicalChars", - "format": [ - 2, - "aaa" - ], - "message": "No more than %d identical characters in a row (e.g., \"%s\" not allowed)", - "verified": true - } - ], - "verified": false - }, - "name": "PasswordStrengthError", - "statusCode": 400 -} \ No newline at end of file diff --git a/src/test/resources/auth/passwordless_email.json b/src/test/resources/auth/passwordless_email.json deleted file mode 100644 index 56b5940a0..000000000 --- a/src/test/resources/auth/passwordless_email.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "_id": "5f85do7a2c673038a807254c", - "email": "user@domain.com", - "email_verified": false -} \ No newline at end of file diff --git a/src/test/resources/auth/passwordless_sms.json b/src/test/resources/auth/passwordless_sms.json deleted file mode 100644 index f305a8d1e..000000000 --- a/src/test/resources/auth/passwordless_sms.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "_id": "5f85d99a2c673038a8111f5f", - "phone_number": "+16511234567", - "phone_verified": false, - "request_language": null -} diff --git a/src/test/resources/auth/pushed_authorization_response.json b/src/test/resources/auth/pushed_authorization_response.json deleted file mode 100644 index ca1a5b744..000000000 --- a/src/test/resources/auth/pushed_authorization_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "request_uri": "urn:example:bwc4JK-ESC0w8acc191e-Y1LTC2", - "expires_in": 90 -} diff --git a/src/test/resources/auth/reset_password.json b/src/test/resources/auth/reset_password.json deleted file mode 100644 index 2b84a8cb8..000000000 --- a/src/test/resources/auth/reset_password.json +++ /dev/null @@ -1 +0,0 @@ -We've just sent you an email to reset your password. \ No newline at end of file diff --git a/src/test/resources/auth/rsa_private_key.pem b/src/test/resources/auth/rsa_private_key.pem deleted file mode 100644 index 1427e0d51..000000000 --- a/src/test/resources/auth/rsa_private_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4ZtdaIrd1BPIJ -tfnF0TjIK5inQAXZ3XlCrUlJdP+XHwIRxdv1FsN12XyMYO/6ymLmo9ryoQeIrsXB -XYqlET3zfAY+diwCb0HEsVvhisthwMU4gZQu6TYW2s9LnXZB5rVtcBK69hcSlA2k -ZudMZWxZcj0L7KMfO2rIvaHw/qaVOE9j0T257Z8Kp2CLF9MUgX0ObhIsdumFRLaL -DvDUmBPr2zuh/34j2XmWwn1yjN/WvGtdfhXW79Ki1S40HcWnygHgLV8sESFKUxxQ -mKvPUTwDOIwLFL5WtE8Mz7N++kgmDcmWMCHc8kcOIu73Ta/3D4imW7VbKgHZo9+K -3ESFE3RjAgMBAAECggEBAJTEIyjMqUT24G2FKiS1TiHvShBkTlQdoR5xvpZMlYbN -tVWxUmrAGqCQ/TIjYnfpnzCDMLhdwT48Ab6mQJw69MfiXwc1PvwX1e9hRscGul36 -ryGPKIVQEBsQG/zc4/L2tZe8ut+qeaK7XuYrPp8bk/X1e9qK5m7j+JpKosNSLgJj -NIbYsBkG2Mlq671irKYj2hVZeaBQmWmZxK4fw0Istz2WfN5nUKUeJhTwpR+JLUg4 -ELYYoB7EO0Cej9UBG30hbgu4RyXA+VbptJ+H042K5QJROUbtnLWuuWosZ5ATldwO -u03dIXL0SH0ao5NcWBzxU4F2sBXZRGP2x/jiSLHcqoECgYEA4qD7mXQpu1b8XO8U -6abpKloJCatSAHzjgdR2eRDRx5PMvloipfwqA77pnbjTUFajqWQgOXsDTCjcdQui -wf5XAaWu+TeAVTytLQbSiTsBhrnoqVrr3RoyDQmdnwHT8aCMouOgcC5thP9vQ8Us -rVdjvRRbnJpg3BeSNimH+u9AHgsCgYEA0EzcbOltCWPHRAY7B3Ge/AKBjBQr86Kv -TdpTlxePBDVIlH+BM6oct2gaSZZoHbqPjbq5v7yf0fKVcXE4bSVgqfDJ/sZQu9Lp -PTeV7wkk0OsAMKk7QukEpPno5q6tOTNnFecpUhVLLlqbfqkB2baYYwLJR3IRzboJ -FQbLY93E8gkCgYB+zlC5VlQbbNqcLXJoImqItgQkkuW5PCgYdwcrSov2ve5r/Acz -FNt1aRdSlx4176R3nXyibQA1Vw+ztiUFowiP9WLoM3PtPZwwe4bGHmwGNHPIfwVG -m+exf9XgKKespYbLhc45tuC08DATnXoYK7O1EnUINSFJRS8cezSI5eHcbQKBgQDC -PgqHXZ2aVftqCc1eAaxaIRQhRmY+CgUjumaczRFGwVFveP9I6Gdi+Kca3DE3F9Pq -PKgejo0SwP5vDT+rOGHN14bmGJUMsX9i4MTmZUZ5s8s3lXh3ysfT+GAhTd6nKrIE -kM3Nh6HWFhROptfc6BNusRh1kX/cspDplK5x8EpJ0QKBgQDWFg6S2je0KtbV5PYe -RultUEe2C0jYMDQx+JYxbPmtcopvZQrFEur3WKVuLy5UAy7EBvwMnZwIG7OOohJb -vkSpADK6VPn9lbqq7O8cTedEHttm6otmLt8ZyEl3hZMaL3hbuRj6ysjmoFKx6CrX -rK0/Ikt5ybqUzKCMJZg2VKGTxg== ------END PRIVATE KEY----- diff --git a/src/test/resources/auth/rsa_public_key.pem b/src/test/resources/auth/rsa_public_key.pem deleted file mode 100644 index e8d628859..000000000 --- a/src/test/resources/auth/rsa_public_key.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuGbXWiK3dQTyCbX5xdE4 -yCuYp0AF2d15Qq1JSXT/lx8CEcXb9RbDddl8jGDv+spi5qPa8qEHiK7FwV2KpRE9 -83wGPnYsAm9BxLFb4YrLYcDFOIGULuk2FtrPS512Qea1bXASuvYXEpQNpGbnTGVs -WXI9C+yjHztqyL2h8P6mlThPY9E9ue2fCqdgixfTFIF9Dm4SLHbphUS2iw7w1JgT -69s7of9+I9l5lsJ9cozf1rxrXX4V1u/SotUuNB3Fp8oB4C1fLBEhSlMcUJirz1E8 -AziMCxS+VrRPDM+zfvpIJg3JljAh3PJHDiLu902v9w+Iplu1WyoB2aPfitxEhRN0 -YwIDAQAB ------END PUBLIC KEY----- diff --git a/src/test/resources/auth/sign_up.json b/src/test/resources/auth/sign_up.json deleted file mode 100644 index 3a49c99d5..000000000 --- a/src/test/resources/auth/sign_up.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "_id": "58457fe6b27", - "email_verified": false, - "email": "me@auth0.com" -} \ No newline at end of file diff --git a/src/test/resources/auth/sign_up_username.json b/src/test/resources/auth/sign_up_username.json deleted file mode 100644 index 83315e25e..000000000 --- a/src/test/resources/auth/sign_up_username.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_id": "58457fe6b27", - "email_verified": false, - "email": "me@auth0.com", - "username": "me", - "phone_number": "1234567890" -} diff --git a/src/test/resources/auth/tokens.json b/src/test/resources/auth/tokens.json deleted file mode 100644 index 3f1ed5abe..000000000 --- a/src/test/resources/auth/tokens.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id_token": "eyJ0eXAiOiJKV1Qi...", - "access_token": "A9CvPwFojaBI...", - "refresh_token": "GEbRxBN...edjnXbL", - "token_type": "bearer", - "expires_in": 86000 -} \ No newline at end of file diff --git a/src/test/resources/auth/user_info.json b/src/test/resources/auth/user_info.json deleted file mode 100644 index 0ac347ed5..000000000 --- a/src/test/resources/auth/user_info.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "email_verified": false, - "email": "test.account@userinfo.com", - "clientID": "q2hnj2iu...", - "updated_at": "2016-12-05T15:15:40.545Z", - "name": "test.account@userinfo.com", - "picture": "https://s.gravatar.com/avatar/dummy.png", - "user_id": "auth0|58454...", - "nickname": "test.account", - "identities": [ - { - "user_id": "58454...", - "provider": "auth0", - "connection": "Username-Password-Authentication", - "isSocial": false - } - ], - "created_at": "2016-12-05T11:16:59.640Z", - "sub": "auth0|58454..." -} \ No newline at end of file diff --git a/src/test/resources/mgmt/authenticator_method_by_id.json b/src/test/resources/authenticator_method_by_id.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_by_id.json rename to src/test/resources/authenticator_method_by_id.json diff --git a/src/test/resources/mgmt/authenticator_method_create.json b/src/test/resources/authenticator_method_create.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_create.json rename to src/test/resources/authenticator_method_create.json diff --git a/src/test/resources/mgmt/authenticator_method_list.json b/src/test/resources/authenticator_method_list.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_list.json rename to src/test/resources/authenticator_method_list.json diff --git a/src/test/resources/mgmt/authenticator_method_paged_list.json b/src/test/resources/authenticator_method_paged_list.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_paged_list.json rename to src/test/resources/authenticator_method_paged_list.json diff --git a/src/test/resources/mgmt/authenticator_method_update.json b/src/test/resources/authenticator_method_update.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_update.json rename to src/test/resources/authenticator_method_update.json diff --git a/src/test/resources/mgmt/authenticator_method_update_by_id.json b/src/test/resources/authenticator_method_update_by_id.json similarity index 100% rename from src/test/resources/mgmt/authenticator_method_update_by_id.json rename to src/test/resources/authenticator_method_update_by_id.json diff --git a/src/test/resources/mgmt/blacklisted_tokens_list.json b/src/test/resources/blacklisted_tokens_list.json similarity index 100% rename from src/test/resources/mgmt/blacklisted_tokens_list.json rename to src/test/resources/blacklisted_tokens_list.json diff --git a/src/test/resources/mgmt/branding_login_template.json b/src/test/resources/branding_login_template.json similarity index 100% rename from src/test/resources/mgmt/branding_login_template.json rename to src/test/resources/branding_login_template.json diff --git a/src/test/resources/mgmt/branding_settings.json b/src/test/resources/branding_settings.json similarity index 100% rename from src/test/resources/mgmt/branding_settings.json rename to src/test/resources/branding_settings.json diff --git a/src/test/resources/mgmt/breached_password_settings.json b/src/test/resources/breached_password_settings.json similarity index 100% rename from src/test/resources/mgmt/breached_password_settings.json rename to src/test/resources/breached_password_settings.json diff --git a/src/test/resources/mgmt/brute_force_configuration.json b/src/test/resources/brute_force_configuration.json similarity index 100% rename from src/test/resources/mgmt/brute_force_configuration.json rename to src/test/resources/brute_force_configuration.json diff --git a/src/test/resources/mgmt/client.json b/src/test/resources/client.json similarity index 100% rename from src/test/resources/mgmt/client.json rename to src/test/resources/client.json diff --git a/src/test/resources/mgmt/client_credential.json b/src/test/resources/client_credential.json similarity index 100% rename from src/test/resources/mgmt/client_credential.json rename to src/test/resources/client_credential.json diff --git a/src/test/resources/mgmt/client_credential_list.json b/src/test/resources/client_credential_list.json similarity index 100% rename from src/test/resources/mgmt/client_credential_list.json rename to src/test/resources/client_credential_list.json diff --git a/src/test/resources/mgmt/client_grant.json b/src/test/resources/client_grant.json similarity index 100% rename from src/test/resources/mgmt/client_grant.json rename to src/test/resources/client_grant.json diff --git a/src/test/resources/mgmt/client_grants_list.json b/src/test/resources/client_grants_list.json similarity index 100% rename from src/test/resources/mgmt/client_grants_list.json rename to src/test/resources/client_grants_list.json diff --git a/src/test/resources/mgmt/client_grants_paged_list.json b/src/test/resources/client_grants_paged_list.json similarity index 100% rename from src/test/resources/mgmt/client_grants_paged_list.json rename to src/test/resources/client_grants_paged_list.json diff --git a/src/test/resources/mgmt/clients_list.json b/src/test/resources/clients_list.json similarity index 100% rename from src/test/resources/mgmt/clients_list.json rename to src/test/resources/clients_list.json diff --git a/src/test/resources/mgmt/clients_paged_list.json b/src/test/resources/clients_paged_list.json similarity index 100% rename from src/test/resources/mgmt/clients_paged_list.json rename to src/test/resources/clients_paged_list.json diff --git a/src/test/resources/mgmt/connection.json b/src/test/resources/connection.json similarity index 100% rename from src/test/resources/mgmt/connection.json rename to src/test/resources/connection.json diff --git a/src/test/resources/mgmt/connection_key.json b/src/test/resources/connection_key.json similarity index 100% rename from src/test/resources/mgmt/connection_key.json rename to src/test/resources/connection_key.json diff --git a/src/test/resources/mgmt/connection_scim_configuration.json b/src/test/resources/connection_scim_configuration.json similarity index 100% rename from src/test/resources/mgmt/connection_scim_configuration.json rename to src/test/resources/connection_scim_configuration.json diff --git a/src/test/resources/mgmt/connection_scim_token.json b/src/test/resources/connection_scim_token.json similarity index 100% rename from src/test/resources/mgmt/connection_scim_token.json rename to src/test/resources/connection_scim_token.json diff --git a/src/test/resources/mgmt/connection_scim_tokens.json b/src/test/resources/connection_scim_tokens.json similarity index 100% rename from src/test/resources/mgmt/connection_scim_tokens.json rename to src/test/resources/connection_scim_tokens.json diff --git a/src/test/resources/mgmt/connections_list.json b/src/test/resources/connections_list.json similarity index 100% rename from src/test/resources/mgmt/connections_list.json rename to src/test/resources/connections_list.json diff --git a/src/test/resources/mgmt/connections_paged_list.json b/src/test/resources/connections_paged_list.json similarity index 100% rename from src/test/resources/mgmt/connections_paged_list.json rename to src/test/resources/connections_paged_list.json diff --git a/src/test/resources/mgmt/custom_text_prompt.json b/src/test/resources/custom_text_prompt.json similarity index 100% rename from src/test/resources/mgmt/custom_text_prompt.json rename to src/test/resources/custom_text_prompt.json diff --git a/src/test/resources/mgmt/daily_stats_list.json b/src/test/resources/daily_stats_list.json similarity index 100% rename from src/test/resources/mgmt/daily_stats_list.json rename to src/test/resources/daily_stats_list.json diff --git a/src/test/resources/mgmt/default_connection_scim_configuration.json b/src/test/resources/default_connection_scim_configuration.json similarity index 100% rename from src/test/resources/mgmt/default_connection_scim_configuration.json rename to src/test/resources/default_connection_scim_configuration.json diff --git a/src/test/resources/mgmt/device_credentials.json b/src/test/resources/device_credentials.json similarity index 100% rename from src/test/resources/mgmt/device_credentials.json rename to src/test/resources/device_credentials.json diff --git a/src/test/resources/mgmt/device_credentials_list.json b/src/test/resources/device_credentials_list.json similarity index 100% rename from src/test/resources/mgmt/device_credentials_list.json rename to src/test/resources/device_credentials_list.json diff --git a/src/test/resources/mgmt/email_provider.json b/src/test/resources/email_provider.json similarity index 100% rename from src/test/resources/mgmt/email_provider.json rename to src/test/resources/email_provider.json diff --git a/src/test/resources/mgmt/email_template.json b/src/test/resources/email_template.json similarity index 100% rename from src/test/resources/mgmt/email_template.json rename to src/test/resources/email_template.json diff --git a/src/test/resources/mgmt/email_verification_ticket.json b/src/test/resources/email_verification_ticket.json similarity index 100% rename from src/test/resources/mgmt/email_verification_ticket.json rename to src/test/resources/email_verification_ticket.json diff --git a/src/test/resources/mgmt/empty_list.json b/src/test/resources/empty_list.json similarity index 100% rename from src/test/resources/mgmt/empty_list.json rename to src/test/resources/empty_list.json diff --git a/src/test/resources/mgmt/enabled_clients_for_connection.json b/src/test/resources/enabled_clients_for_connection.json similarity index 100% rename from src/test/resources/mgmt/enabled_clients_for_connection.json rename to src/test/resources/enabled_clients_for_connection.json diff --git a/src/test/resources/mgmt/encryption_key.json b/src/test/resources/encryption_key.json similarity index 100% rename from src/test/resources/mgmt/encryption_key.json rename to src/test/resources/encryption_key.json diff --git a/src/test/resources/mgmt/encryption_keys_list.json b/src/test/resources/encryption_keys_list.json similarity index 100% rename from src/test/resources/mgmt/encryption_keys_list.json rename to src/test/resources/encryption_keys_list.json diff --git a/src/test/resources/mgmt/error_with_message.json b/src/test/resources/error_with_message.json similarity index 100% rename from src/test/resources/mgmt/error_with_message.json rename to src/test/resources/error_with_message.json diff --git a/src/test/resources/mgmt/event_log.json b/src/test/resources/event_log.json similarity index 100% rename from src/test/resources/mgmt/event_log.json rename to src/test/resources/event_log.json diff --git a/src/test/resources/mgmt/event_logs_list.json b/src/test/resources/event_logs_list.json similarity index 100% rename from src/test/resources/mgmt/event_logs_list.json rename to src/test/resources/event_logs_list.json diff --git a/src/test/resources/mgmt/event_logs_paged_list.json b/src/test/resources/event_logs_paged_list.json similarity index 100% rename from src/test/resources/mgmt/event_logs_paged_list.json rename to src/test/resources/event_logs_paged_list.json diff --git a/src/test/resources/mgmt/grants_list.json b/src/test/resources/grants_list.json similarity index 100% rename from src/test/resources/mgmt/grants_list.json rename to src/test/resources/grants_list.json diff --git a/src/test/resources/mgmt/grants_paged_list.json b/src/test/resources/grants_paged_list.json similarity index 100% rename from src/test/resources/mgmt/grants_paged_list.json rename to src/test/resources/grants_paged_list.json diff --git a/src/test/resources/mgmt/guardian_authentication_policies_list.json b/src/test/resources/guardian_authentication_policies_list.json similarity index 100% rename from src/test/resources/mgmt/guardian_authentication_policies_list.json rename to src/test/resources/guardian_authentication_policies_list.json diff --git a/src/test/resources/mgmt/guardian_enrollment.json b/src/test/resources/guardian_enrollment.json similarity index 100% rename from src/test/resources/mgmt/guardian_enrollment.json rename to src/test/resources/guardian_enrollment.json diff --git a/src/test/resources/mgmt/guardian_enrollment_ticket.json b/src/test/resources/guardian_enrollment_ticket.json similarity index 100% rename from src/test/resources/mgmt/guardian_enrollment_ticket.json rename to src/test/resources/guardian_enrollment_ticket.json diff --git a/src/test/resources/mgmt/guardian_enrollments_list.json b/src/test/resources/guardian_enrollments_list.json similarity index 100% rename from src/test/resources/mgmt/guardian_enrollments_list.json rename to src/test/resources/guardian_enrollments_list.json diff --git a/src/test/resources/mgmt/guardian_factor.json b/src/test/resources/guardian_factor.json similarity index 100% rename from src/test/resources/mgmt/guardian_factor.json rename to src/test/resources/guardian_factor.json diff --git a/src/test/resources/mgmt/guardian_factors_list.json b/src/test/resources/guardian_factors_list.json similarity index 100% rename from src/test/resources/mgmt/guardian_factors_list.json rename to src/test/resources/guardian_factors_list.json diff --git a/src/test/resources/mgmt/guardian_sns_factor_provider.json b/src/test/resources/guardian_sns_factor_provider.json similarity index 100% rename from src/test/resources/mgmt/guardian_sns_factor_provider.json rename to src/test/resources/guardian_sns_factor_provider.json diff --git a/src/test/resources/mgmt/guardian_sns_factor_provider_empty.json b/src/test/resources/guardian_sns_factor_provider_empty.json similarity index 100% rename from src/test/resources/mgmt/guardian_sns_factor_provider_empty.json rename to src/test/resources/guardian_sns_factor_provider_empty.json diff --git a/src/test/resources/mgmt/guardian_templates.json b/src/test/resources/guardian_templates.json similarity index 100% rename from src/test/resources/mgmt/guardian_templates.json rename to src/test/resources/guardian_templates.json diff --git a/src/test/resources/mgmt/guardian_twilio_factor_provider_empty.json b/src/test/resources/guardian_twilio_factor_provider_empty.json similarity index 100% rename from src/test/resources/mgmt/guardian_twilio_factor_provider_empty.json rename to src/test/resources/guardian_twilio_factor_provider_empty.json diff --git a/src/test/resources/mgmt/guardian_twilio_factor_provider_with_from.json b/src/test/resources/guardian_twilio_factor_provider_with_from.json similarity index 100% rename from src/test/resources/mgmt/guardian_twilio_factor_provider_with_from.json rename to src/test/resources/guardian_twilio_factor_provider_with_from.json diff --git a/src/test/resources/mgmt/guardian_twilio_factor_provider_with_messaging_service_sid.json b/src/test/resources/guardian_twilio_factor_provider_with_messaging_service_sid.json similarity index 100% rename from src/test/resources/mgmt/guardian_twilio_factor_provider_with_messaging_service_sid.json rename to src/test/resources/guardian_twilio_factor_provider_with_messaging_service_sid.json diff --git a/src/test/resources/mgmt/identities_list.json b/src/test/resources/identities_list.json similarity index 100% rename from src/test/resources/mgmt/identities_list.json rename to src/test/resources/identities_list.json diff --git a/src/test/resources/mgmt/invitation.json b/src/test/resources/invitation.json similarity index 100% rename from src/test/resources/mgmt/invitation.json rename to src/test/resources/invitation.json diff --git a/src/test/resources/mgmt/invitations_list.json b/src/test/resources/invitations_list.json similarity index 100% rename from src/test/resources/mgmt/invitations_list.json rename to src/test/resources/invitations_list.json diff --git a/src/test/resources/mgmt/invitations_paged_list.json b/src/test/resources/invitations_paged_list.json similarity index 100% rename from src/test/resources/mgmt/invitations_paged_list.json rename to src/test/resources/invitations_paged_list.json diff --git a/src/test/resources/mgmt/job.json b/src/test/resources/job.json similarity index 100% rename from src/test/resources/mgmt/job.json rename to src/test/resources/job.json diff --git a/src/test/resources/mgmt/job_error_details.json b/src/test/resources/job_error_details.json similarity index 100% rename from src/test/resources/mgmt/job_error_details.json rename to src/test/resources/job_error_details.json diff --git a/src/test/resources/mgmt/job_post_users_exports.json b/src/test/resources/job_post_users_exports.json similarity index 100% rename from src/test/resources/mgmt/job_post_users_exports.json rename to src/test/resources/job_post_users_exports.json diff --git a/src/test/resources/mgmt/job_post_users_imports.json b/src/test/resources/job_post_users_imports.json similarity index 100% rename from src/test/resources/mgmt/job_post_users_imports.json rename to src/test/resources/job_post_users_imports.json diff --git a/src/test/resources/mgmt/job_post_users_imports_input.json b/src/test/resources/job_post_users_imports_input.json similarity index 100% rename from src/test/resources/mgmt/job_post_users_imports_input.json rename to src/test/resources/job_post_users_imports_input.json diff --git a/src/test/resources/mgmt/job_post_verification_email.json b/src/test/resources/job_post_verification_email.json similarity index 100% rename from src/test/resources/mgmt/job_post_verification_email.json rename to src/test/resources/job_post_verification_email.json diff --git a/src/test/resources/mgmt/key.json b/src/test/resources/key.json similarity index 100% rename from src/test/resources/mgmt/key.json rename to src/test/resources/key.json diff --git a/src/test/resources/mgmt/key_list.json b/src/test/resources/key_list.json similarity index 100% rename from src/test/resources/mgmt/key_list.json rename to src/test/resources/key_list.json diff --git a/src/test/resources/mgmt/key_revoke.json b/src/test/resources/key_revoke.json similarity index 100% rename from src/test/resources/mgmt/key_revoke.json rename to src/test/resources/key_revoke.json diff --git a/src/test/resources/mgmt/key_rotate.json b/src/test/resources/key_rotate.json similarity index 100% rename from src/test/resources/mgmt/key_rotate.json rename to src/test/resources/key_rotate.json diff --git a/src/test/resources/keys/bad-public-rsa.pem b/src/test/resources/keys/bad-public-rsa.pem deleted file mode 100644 index 75643169d..000000000 --- a/src/test/resources/keys/bad-public-rsa.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzELuTuakDmN69DZoZfEO -tYLLHnwcAJGlk9qKU3F+VWyadLuOVZ9cApJpZkpi+zPFOTnmVK9NyVgN9mA4lyDj -G4SDB8NdzMuIidsoSWUqiu05z8bqAFO9SH284hDJ+eVuT6a0nru6mFczr64AZXNz -YyL1nyjih0bujcZPKLvNp0g7NvCmxgpGOth9IF5goMsLFgA3SuCLpMzRB4+czIqR -E6XRyfojo0xX1dNzYxohM7ai1WD3Maq3GwcKV+r1H3Jp8p0yGya5hc1XPDhkidD5 -46mVrdja13IwhVoy0QloeKhEd6cV1Gbd9BWbU4Q13BXb8JJ+AQjXr0cgn0l3wYvb -hQIDAQAc ------END PUBLIC KEY----- \ No newline at end of file diff --git a/src/test/resources/keys/public-rsa.pem b/src/test/resources/keys/public-rsa.pem deleted file mode 100644 index 97f02bfff..000000000 --- a/src/test/resources/keys/public-rsa.pem +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzELuTuakDmN69DZoZfEO -tYLLHnwcAJGlk9qKU3F+VWyadLuOVZ9cApJpZkpi+zPFOTnmVK9NyVgN9mA4lyDj -G4SDB8NdzMuIidsoSWUqiu05z8bqAFO9SH284hDJ+eVuT6a0nru6mFczr64AZXNz -YyL1nyjih0bujcZPKLvNp0g7NvCmxgpGOth9IF5goMsLFgA3SuCLpMzRB4+czIqR -E6XRyfojo0xX1dNzYxohM7ai1WD3Maq3GwcKV+r1H3Jp8p0yGya5hc1XPDhkidD5 -46mVrdja13IwhVoy0QloeKhEd6cV1Gbd9BWbU4Q13BXb8JJ+AQjXr0cgn0l3wYvb -hQIDAQAB ------END PUBLIC KEY----- \ No newline at end of file diff --git a/src/test/resources/mgmt/log_stream.json b/src/test/resources/log_stream.json similarity index 100% rename from src/test/resources/mgmt/log_stream.json rename to src/test/resources/log_stream.json diff --git a/src/test/resources/mgmt/log_streams_list.json b/src/test/resources/log_streams_list.json similarity index 100% rename from src/test/resources/mgmt/log_streams_list.json rename to src/test/resources/log_streams_list.json diff --git a/src/test/resources/mgmt/user_attribute_profile.json b/src/test/resources/mgmt/user_attribute_profile.json deleted file mode 100644 index fb73013ec..000000000 --- a/src/test/resources/mgmt/user_attribute_profile.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "uap_1234567890", - "name": "This is just a test", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName" - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "UserName" - }, - "saml_mapping":["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"], - "scim_mapping":"displayName", - "auth0_mapping": "testUser", - "profile_required": false, - "strategy_overrides": { - "oidc": { - "scim_mapping":"name.givenName" - } - } - } - } -} diff --git a/src/test/resources/mgmt/user_attribute_profile_template.json b/src/test/resources/mgmt/user_attribute_profile_template.json deleted file mode 100644 index 0034bbfa6..000000000 --- a/src/test/resources/mgmt/user_attribute_profile_template.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "auth0-generic", - "display_name": "A standard user attribute profile template", - "template": { - "name": "This is just a test", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName" - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "UserName" - }, - "saml_mapping":["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"], - "scim_mapping":"displayName", - "auth0_mapping": "testUser", - "profile_required": false, - "strategy_overrides": { - "oidc": { - "scim_mapping":"name.givenName" - } - } - } - } - } -} diff --git a/src/test/resources/mgmt/user_attribute_profile_templates_list.json b/src/test/resources/mgmt/user_attribute_profile_templates_list.json deleted file mode 100644 index a21ae3d3d..000000000 --- a/src/test/resources/mgmt/user_attribute_profile_templates_list.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "user_attribute_profile_templates": [ - { - "id": "auth0-generic", - "display_name": "Auth0 Generic User Attribute Profile Template", - "template": { - "name": "This is just a test", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName" - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "UserName" - }, - "saml_mapping": [ - "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" - ], - "scim_mapping": "displayName", - "auth0_mapping": "testUser", - "profile_required": false, - "strategy_overrides": { - "oidc": { - "scim_mapping": "name.givenName" - } - } - } - } - } - } - ] -} diff --git a/src/test/resources/mgmt/user_attribute_profiles_list.json b/src/test/resources/mgmt/user_attribute_profiles_list.json deleted file mode 100644 index 6eb4f57d6..000000000 --- a/src/test/resources/mgmt/user_attribute_profiles_list.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "user_attribute_profiles": [ - { - "id": "uap_1234567890", - "name": "This is just a test", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName" - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "UserName" - }, - "saml_mapping":["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"], - "scim_mapping":"displayName", - "auth0_mapping": "testUser", - "profile_required": false, - "strategy_overrides": { - "oidc": { - "scim_mapping":"name.givenName" - } - } - } - } - }, - { - "id": "uap_123456789012345", - "name": "Updated Test Organization", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName" - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "Display Name" - }, - "auth0_mapping": "testUser", - "profile_required": false - } - } - }, - { - "id": "uap_1234", - "name": "This is another test", - "user_id": { - "oidc_mapping": "sub", - "saml_mapping": [ - "urn:oid:0.9.10.10.100.1.1" - ], - "scim_mapping": "userName", - "strategy_overrides": { - "google-apps": { - "oidc_mapping": "email" - } - } - }, - "user_attributes": { - "username": { - "label": "test User", - "description": "This is just a test", - "oidc_mapping": { - "mapping": "preferred_username", - "display_name": "Display Name" - }, - "auth0_mapping": "testUser", - "profile_required": false, - "strategy_overrides": { - "okta": { - "oidc_mapping": { - "mapping": "${context.userinfo.groups}", - "display_name": "groups" - } - } - } - } - } - } - ], - "next": "Fe26.2*API2_1758785444*34b68e78fd693520c028d0ea61ae32653a36ca05d3da972107bb12a581eea9bb*" - -} diff --git a/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index ca6ee9cea..000000000 --- a/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline \ No newline at end of file diff --git a/src/test/resources/mgmt/multipart_sample.json b/src/test/resources/multipart_sample.json similarity index 100% rename from src/test/resources/mgmt/multipart_sample.json rename to src/test/resources/multipart_sample.json diff --git a/src/test/resources/mgmt/network_acls.json b/src/test/resources/network_acls.json similarity index 100% rename from src/test/resources/mgmt/network_acls.json rename to src/test/resources/network_acls.json diff --git a/src/test/resources/mgmt/network_acls_list.json b/src/test/resources/network_acls_list.json similarity index 100% rename from src/test/resources/mgmt/network_acls_list.json rename to src/test/resources/network_acls_list.json diff --git a/src/test/resources/mgmt/organization.json b/src/test/resources/organization.json similarity index 100% rename from src/test/resources/mgmt/organization.json rename to src/test/resources/organization.json diff --git a/src/test/resources/mgmt/organization_client_grant.json b/src/test/resources/organization_client_grant.json similarity index 100% rename from src/test/resources/mgmt/organization_client_grant.json rename to src/test/resources/organization_client_grant.json diff --git a/src/test/resources/mgmt/organization_client_grants.json b/src/test/resources/organization_client_grants.json similarity index 100% rename from src/test/resources/mgmt/organization_client_grants.json rename to src/test/resources/organization_client_grants.json diff --git a/src/test/resources/mgmt/organization_client_grants_paged_list.json b/src/test/resources/organization_client_grants_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organization_client_grants_paged_list.json rename to src/test/resources/organization_client_grants_paged_list.json diff --git a/src/test/resources/mgmt/organization_connection.json b/src/test/resources/organization_connection.json similarity index 100% rename from src/test/resources/mgmt/organization_connection.json rename to src/test/resources/organization_connection.json diff --git a/src/test/resources/mgmt/organization_connections_list.json b/src/test/resources/organization_connections_list.json similarity index 100% rename from src/test/resources/mgmt/organization_connections_list.json rename to src/test/resources/organization_connections_list.json diff --git a/src/test/resources/mgmt/organization_connections_paged_list.json b/src/test/resources/organization_connections_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organization_connections_paged_list.json rename to src/test/resources/organization_connections_paged_list.json diff --git a/src/test/resources/mgmt/organization_member_roles_list.json b/src/test/resources/organization_member_roles_list.json similarity index 100% rename from src/test/resources/mgmt/organization_member_roles_list.json rename to src/test/resources/organization_member_roles_list.json diff --git a/src/test/resources/mgmt/organization_member_roles_paged_list.json b/src/test/resources/organization_member_roles_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organization_member_roles_paged_list.json rename to src/test/resources/organization_member_roles_paged_list.json diff --git a/src/test/resources/mgmt/organization_members_checkpoint_paged_list.json b/src/test/resources/organization_members_checkpoint_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organization_members_checkpoint_paged_list.json rename to src/test/resources/organization_members_checkpoint_paged_list.json diff --git a/src/test/resources/mgmt/organization_members_list.json b/src/test/resources/organization_members_list.json similarity index 100% rename from src/test/resources/mgmt/organization_members_list.json rename to src/test/resources/organization_members_list.json diff --git a/src/test/resources/mgmt/organization_members_paged_list.json b/src/test/resources/organization_members_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organization_members_paged_list.json rename to src/test/resources/organization_members_paged_list.json diff --git a/src/test/resources/mgmt/organizations_checkpoint_paged_list.json b/src/test/resources/organizations_checkpoint_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organizations_checkpoint_paged_list.json rename to src/test/resources/organizations_checkpoint_paged_list.json diff --git a/src/test/resources/mgmt/organizations_list.json b/src/test/resources/organizations_list.json similarity index 100% rename from src/test/resources/mgmt/organizations_list.json rename to src/test/resources/organizations_list.json diff --git a/src/test/resources/mgmt/organizations_paged_list.json b/src/test/resources/organizations_paged_list.json similarity index 100% rename from src/test/resources/mgmt/organizations_paged_list.json rename to src/test/resources/organizations_paged_list.json diff --git a/src/test/resources/mgmt/partials_prompt.json b/src/test/resources/partials_prompt.json similarity index 100% rename from src/test/resources/mgmt/partials_prompt.json rename to src/test/resources/partials_prompt.json diff --git a/src/test/resources/mgmt/password_change_ticket.json b/src/test/resources/password_change_ticket.json similarity index 100% rename from src/test/resources/mgmt/password_change_ticket.json rename to src/test/resources/password_change_ticket.json diff --git a/src/test/resources/mgmt/prompt.json b/src/test/resources/prompt.json similarity index 100% rename from src/test/resources/mgmt/prompt.json rename to src/test/resources/prompt.json diff --git a/src/test/resources/mgmt/rate_limit_error.json b/src/test/resources/rate_limit_error.json similarity index 100% rename from src/test/resources/mgmt/rate_limit_error.json rename to src/test/resources/rate_limit_error.json diff --git a/src/test/resources/mgmt/recovery_code.json b/src/test/resources/recovery_code.json similarity index 100% rename from src/test/resources/mgmt/recovery_code.json rename to src/test/resources/recovery_code.json diff --git a/src/test/resources/mgmt/refresh_token.json b/src/test/resources/refresh_token.json similarity index 100% rename from src/test/resources/mgmt/refresh_token.json rename to src/test/resources/refresh_token.json diff --git a/src/test/resources/mgmt/resource_server.json b/src/test/resources/resource_server.json similarity index 100% rename from src/test/resources/mgmt/resource_server.json rename to src/test/resources/resource_server.json diff --git a/src/test/resources/mgmt/resource_servers_list.json b/src/test/resources/resource_servers_list.json similarity index 100% rename from src/test/resources/mgmt/resource_servers_list.json rename to src/test/resources/resource_servers_list.json diff --git a/src/test/resources/mgmt/resource_servers_paged_list.json b/src/test/resources/resource_servers_paged_list.json similarity index 100% rename from src/test/resources/mgmt/resource_servers_paged_list.json rename to src/test/resources/resource_servers_paged_list.json diff --git a/src/test/resources/mgmt/role.json b/src/test/resources/role.json similarity index 100% rename from src/test/resources/mgmt/role.json rename to src/test/resources/role.json diff --git a/src/test/resources/mgmt/role_permissions_list.json b/src/test/resources/role_permissions_list.json similarity index 100% rename from src/test/resources/mgmt/role_permissions_list.json rename to src/test/resources/role_permissions_list.json diff --git a/src/test/resources/mgmt/role_permissions_paged_list.json b/src/test/resources/role_permissions_paged_list.json similarity index 100% rename from src/test/resources/mgmt/role_permissions_paged_list.json rename to src/test/resources/role_permissions_paged_list.json diff --git a/src/test/resources/mgmt/role_users_checkpoint_paged_list.json b/src/test/resources/role_users_checkpoint_paged_list.json similarity index 100% rename from src/test/resources/mgmt/role_users_checkpoint_paged_list.json rename to src/test/resources/role_users_checkpoint_paged_list.json diff --git a/src/test/resources/mgmt/role_users_list.json b/src/test/resources/role_users_list.json similarity index 100% rename from src/test/resources/mgmt/role_users_list.json rename to src/test/resources/role_users_list.json diff --git a/src/test/resources/mgmt/role_users_paged_list.json b/src/test/resources/role_users_paged_list.json similarity index 100% rename from src/test/resources/mgmt/role_users_paged_list.json rename to src/test/resources/role_users_paged_list.json diff --git a/src/test/resources/mgmt/roles_list.json b/src/test/resources/roles_list.json similarity index 100% rename from src/test/resources/mgmt/roles_list.json rename to src/test/resources/roles_list.json diff --git a/src/test/resources/mgmt/roles_paged_list.json b/src/test/resources/roles_paged_list.json similarity index 100% rename from src/test/resources/mgmt/roles_paged_list.json rename to src/test/resources/roles_paged_list.json diff --git a/src/test/resources/mgmt/rotate_key.json b/src/test/resources/rotate_key.json similarity index 100% rename from src/test/resources/mgmt/rotate_key.json rename to src/test/resources/rotate_key.json diff --git a/src/test/resources/mgmt/rule.json b/src/test/resources/rule.json similarity index 100% rename from src/test/resources/mgmt/rule.json rename to src/test/resources/rule.json diff --git a/src/test/resources/mgmt/rules_config.json b/src/test/resources/rules_config.json similarity index 100% rename from src/test/resources/mgmt/rules_config.json rename to src/test/resources/rules_config.json diff --git a/src/test/resources/mgmt/rules_configs_list.json b/src/test/resources/rules_configs_list.json similarity index 100% rename from src/test/resources/mgmt/rules_configs_list.json rename to src/test/resources/rules_configs_list.json diff --git a/src/test/resources/mgmt/rules_list.json b/src/test/resources/rules_list.json similarity index 100% rename from src/test/resources/mgmt/rules_list.json rename to src/test/resources/rules_list.json diff --git a/src/test/resources/mgmt/rules_paged_list.json b/src/test/resources/rules_paged_list.json similarity index 100% rename from src/test/resources/mgmt/rules_paged_list.json rename to src/test/resources/rules_paged_list.json diff --git a/src/test/resources/mgmt/scope.json b/src/test/resources/scope.json similarity index 100% rename from src/test/resources/mgmt/scope.json rename to src/test/resources/scope.json diff --git a/src/test/resources/mgmt/self_service_profile.json b/src/test/resources/self_service_profile.json similarity index 100% rename from src/test/resources/mgmt/self_service_profile.json rename to src/test/resources/self_service_profile.json diff --git a/src/test/resources/mgmt/self_service_profile_custom_text.json b/src/test/resources/self_service_profile_custom_text.json similarity index 100% rename from src/test/resources/mgmt/self_service_profile_custom_text.json rename to src/test/resources/self_service_profile_custom_text.json diff --git a/src/test/resources/mgmt/self_service_profile_response.json b/src/test/resources/self_service_profile_response.json similarity index 100% rename from src/test/resources/mgmt/self_service_profile_response.json rename to src/test/resources/self_service_profile_response.json diff --git a/src/test/resources/mgmt/self_service_profile_sso_ticket.json b/src/test/resources/self_service_profile_sso_ticket.json similarity index 100% rename from src/test/resources/mgmt/self_service_profile_sso_ticket.json rename to src/test/resources/self_service_profile_sso_ticket.json diff --git a/src/test/resources/mgmt/self_service_profile_sso_ticket_request.json b/src/test/resources/self_service_profile_sso_ticket_request.json similarity index 100% rename from src/test/resources/mgmt/self_service_profile_sso_ticket_request.json rename to src/test/resources/self_service_profile_sso_ticket_request.json diff --git a/src/test/resources/mgmt/self_service_profiles_list.json b/src/test/resources/self_service_profiles_list.json similarity index 100% rename from src/test/resources/mgmt/self_service_profiles_list.json rename to src/test/resources/self_service_profiles_list.json diff --git a/src/test/resources/mgmt/session.json b/src/test/resources/session.json similarity index 100% rename from src/test/resources/mgmt/session.json rename to src/test/resources/session.json diff --git a/src/test/resources/mgmt/suspicious_ip_throttling_configuration.json b/src/test/resources/suspicious_ip_throttling_configuration.json similarity index 100% rename from src/test/resources/mgmt/suspicious_ip_throttling_configuration.json rename to src/test/resources/suspicious_ip_throttling_configuration.json diff --git a/src/test/resources/mgmt/tenant.json b/src/test/resources/tenant.json similarity index 100% rename from src/test/resources/mgmt/tenant.json rename to src/test/resources/tenant.json diff --git a/src/test/resources/mgmt/user.json b/src/test/resources/user.json similarity index 100% rename from src/test/resources/mgmt/user.json rename to src/test/resources/user.json diff --git a/src/test/resources/mgmt/user_blocks.json b/src/test/resources/user_blocks.json similarity index 100% rename from src/test/resources/mgmt/user_blocks.json rename to src/test/resources/user_blocks.json diff --git a/src/test/resources/mgmt/user_permissions_paged_list.json b/src/test/resources/user_permissions_paged_list.json similarity index 100% rename from src/test/resources/mgmt/user_permissions_paged_list.json rename to src/test/resources/user_permissions_paged_list.json diff --git a/src/test/resources/mgmt/user_refresh_tokens.json b/src/test/resources/user_refresh_tokens.json similarity index 100% rename from src/test/resources/mgmt/user_refresh_tokens.json rename to src/test/resources/user_refresh_tokens.json diff --git a/src/test/resources/mgmt/user_roles_paged_list.json b/src/test/resources/user_roles_paged_list.json similarity index 100% rename from src/test/resources/mgmt/user_roles_paged_list.json rename to src/test/resources/user_roles_paged_list.json diff --git a/src/test/resources/mgmt/user_sessions.json b/src/test/resources/user_sessions.json similarity index 100% rename from src/test/resources/mgmt/user_sessions.json rename to src/test/resources/user_sessions.json diff --git a/src/test/resources/mgmt/users_list.json b/src/test/resources/users_list.json similarity index 100% rename from src/test/resources/mgmt/users_list.json rename to src/test/resources/users_list.json diff --git a/src/test/resources/mgmt/users_paged_list.json b/src/test/resources/users_paged_list.json similarity index 100% rename from src/test/resources/mgmt/users_paged_list.json rename to src/test/resources/users_paged_list.json diff --git a/v3_MIGRATION_GUIDE.md b/v3_MIGRATION_GUIDE.md new file mode 100644 index 000000000..738f515f5 --- /dev/null +++ b/v3_MIGRATION_GUIDE.md @@ -0,0 +1,369 @@ +# V3 Migration Guide + +A guide to migrating the Auth0 Java SDK from `v2` to `v3`. + +- [Overall changes](#overall-changes) + - [Java versions](#java-versions) + - [Authentication API](#authentication-api) + - [Management API](#management-api) +- [Specific changes to the Management API](#specific-changes-to-the-management-api) + - [Client initialization](#client-initialization) + - [Sub-client organization](#sub-client-organization) + - [Request and response patterns](#request-and-response-patterns) + - [Pagination](#pagination) + - [Exception handling](#exception-handling) + - [Accessing raw HTTP responses](#accessing-raw-http-responses) + - [Request-level configuration](#request-level-configuration) + - [Type changes](#type-changes) + +## Overall changes + +### Java versions + +Both v2 and v3 require Java 8 or above. + +### Authentication API + +This major version change does not affect the Authentication API. The `AuthAPI` class has been ported directly from v2 to v3. Any code written for the Authentication API in the v2 version should work in the v3 version. + +```java +// Works in both v2 and v3 +AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); +``` + +### Management API + +V3 introduces significant improvements to the Management API SDK by migrating to [Fern](https://github.com/fern-api/fern) as the code generation tool. This provides: + +- Better resource grouping with sub-client organization +- Type-safe request and response objects using builder patterns +- Automatic pagination with `SyncPagingIterable` +- Simplified access to HTTP response metadata via `withRawResponse()` +- Consistent method naming (`list`, `create`, `get`, `update`, `delete`) + +## Specific changes to the Management API + +### Client initialization + +The Management API client initialization has changed from `ManagementAPI` to `ManagementApi`, and uses a different builder pattern. + +**v2:** +```java +import com.auth0.client.mgmt.ManagementAPI; + +// Using domain and token +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build(); + +// Using TokenProvider +TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}"); +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", tokenProvider).build(); +``` + +**v3:** +1st Approach : Standard Token-Based +```java +import com.auth0.client.mgmt.ManagementApi; + +ManagementApi client = ManagementApi + .builder() + .url("https://{YOUR_DOMAIN}/api/v2") + .token("{YOUR_API_TOKEN}") + .build(); +``` + +or + +2nd Approach : OAuth client credentials flow + +```java +OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier( +"{CLIENT_ID}", +"{CLIENT_SECRET}", +"https://{YOUR_DOMAIN}", +"{YOUR_AUDIENCE}" +); + +ClientOptions clientOptions = ClientOptions.builder() +.environment(Environment.custom("https://{YOUR_AUDIENCE}")) +.addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) +.build(); + +ManagementApi client = new ManagementApi(clientOptions); + +``` + +#### Builder options comparison + +| Option | v2 | v3 | +|--------|----|----| +| Domain/URL | `newBuilder(domain, token)` | `.url("https://domain/api/v2")` | +| Token | Constructor parameter | `.token(token)` | +| Timeout | Via `HttpOptions` | `.timeout(seconds)` | +| Max retries | Via `HttpOptions` | `.maxRetries(count)` | +| Custom HTTP client | `.withHttpClient(Auth0HttpClient)` | `.httpClient(OkHttpClient)` | +| Custom headers | Not directly supported | `.addHeader(name, value)` | + +### Sub-client organization + +V3 introduces a hierarchical sub-client structure. Operations on related resources are now accessed through nested clients instead of methods on a flat entity class. + +**v2:** +```java +// All user operations on UsersEntity +Request userRequest = mgmt.users().get("user_id", new UserFilter()); +Request> permissionsRequest = mgmt.users().getPermissions("user_id", new PermissionsFilter()); +Request> rolesRequest = mgmt.users().getRoles("user_id", new RolesFilter()); +Request logsRequest = mgmt.users().getLogEvents("user_id", new LogEventFilter()); +``` + +**v3:** +```java +// Operations organized into sub-clients +GetUserResponseContent user = client.users().get("user_id"); +SyncPagingIterable permissions = client.users().permissions().list("user_id"); +SyncPagingIterable roles = client.users().roles().list("user_id"); +SyncPagingIterable logs = client.users().logs().list("user_id"); +``` + +#### Common sub-client mappings + +| v2 Method | v3 Sub-client | +|-----------|---------------| +| `mgmt.users().getPermissions()` | `client.users().permissions().list()` | +| `mgmt.users().getRoles()` | `client.users().roles().list()` | +| `mgmt.users().getLogEvents()` | `client.users().logs().list()` | +| `mgmt.users().getOrganizations()` | `client.users().organizations().list()` | +| `mgmt.users().link()` | `client.users().identities().link()` | +| `mgmt.users().unlink()` | `client.users().identities().delete()` | +| `mgmt.users().deleteMultifactorProvider()` | `client.users().multifactor().deleteProvider()` | +| `mgmt.organizations().getMembers()` | `client.organizations().members().list()` | +| `mgmt.organizations().getInvitations()` | `client.organizations().invitations().list()` | +| `mgmt.organizations().getEnabledConnections()` | `client.organizations().enabledConnections().list()` | +| `mgmt.actions().getVersions()` | `client.actions().versions().list()` | +| `mgmt.actions().getTriggerBindings()` | `client.actions().triggers().bindings().list()` | +| `mgmt.guardian().getFactors()` | `client.guardian().factors().list()` | +| `mgmt.branding().getUniversalLoginTemplate()` | `client.branding().templates().getUniversalLogin()` | +| `mgmt.connections().getScimConfiguration()` | `client.connections().scimConfiguration().get()` | + +### Request and response patterns + +V3 uses type-safe request content objects with builders instead of domain objects or filter parameters. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.net.Request; + +// Creating a user +User user = new User("Username-Password-Authentication"); +user.setEmail("test@example.com"); +user.setPassword("password123".toCharArray()); + +Request request = mgmt.users().create(user); +User createdUser = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; + +// Creating a user +CreateUserResponseContent user = client.users().create( + CreateUserRequestContent + .builder() + .connection("Username-Password-Authentication") + .email("test@example.com") + .password("password123") + .build() +); +``` + +#### Key differences + +| Aspect | v2 | v3 | +|--------|----|----| +| Request building | Domain objects with setters | Builder pattern with `*RequestContent` types | +| Response type | `Request` requiring `.execute().getBody()` | Direct return of response object | +| Filtering | Filter classes (e.g., `UserFilter`) | `*RequestParameters` builder classes | +| Execution | Explicit `.execute()` call | Implicit execution on method call | + +### Pagination + +V3 introduces `SyncPagingIterable` for automatic pagination, replacing the manual `Request` pattern. + +**v2:** +```java +import com.auth0.json.mgmt.users.UsersPage; +import com.auth0.client.mgmt.filter.UserFilter; + +Request request = mgmt.users().list(new UserFilter().withPage(0, 50)); +UsersPage page = request.execute().getBody(); + +for (User user : page.getItems()) { + System.out.println(user.getEmail()); +} + +// Manual pagination +while (page.getNext() != null) { + request = mgmt.users().list(new UserFilter().withPage(page.getNext(), 50)); + page = request.execute().getBody(); + for (User user : page.getItems()) { + System.out.println(user.getEmail()); + } +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; + +// Automatic iteration through all pages +SyncPagingIterable users = client.users().list( + ListUsersRequestParameters + .builder() + .perPage(50) + .build() +); + +for (UserResponseSchema user : users) { + System.out.println(user.getEmail()); +} + +// Or manual page control +List pageItems = users.getItems(); +while (users.hasNext()) { + pageItems = users.nextPage().getItems(); + // process page +} +``` + +### Exception handling + +V3 uses a unified `ManagementApiException` class instead of the v2 exception hierarchy. + +**v2:** +```java +import com.auth0.exception.Auth0Exception; +import com.auth0.exception.APIException; +import com.auth0.exception.RateLimitException; + +try { + User user = mgmt.users().get("user_id", null).execute().getBody(); +} catch (RateLimitException e) { + // Rate limited + long retryAfter = e.getLimit(); +} catch (APIException e) { + int statusCode = e.getStatusCode(); + String error = e.getError(); + String description = e.getDescription(); +} catch (Auth0Exception e) { + // Network or other errors +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiException; + +try { + GetUserResponseContent user = client.users().get("user_id"); +} catch (ManagementApiException e) { + int statusCode = e.statusCode(); + Object body = e.body(); + Map> headers = e.headers(); + String message = e.getMessage(); +} +``` + +### Accessing raw HTTP responses + +V3 provides access to full HTTP response metadata via `withRawResponse()`. + +**v2:** +```java +// Response wrapper provided status code +Response response = mgmt.users().get("user_id", null).execute(); +int statusCode = response.getStatusCode(); +User user = response.getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; + +// Use withRawResponse() to access headers and metadata +ManagementApiHttpResponse response = client.users() + .withRawResponse() + .get("user_id"); + +GetUserResponseContent user = response.body(); +Map> headers = response.headers(); +``` + +### Request-level configuration + +V3 allows per-request configuration through `RequestOptions`. + +**v2:** +```java +// Most configuration was at client level only +// Request-level headers required creating a new request manually +Request request = mgmt.users().get("user_id", null); +request.addHeader("X-Custom-Header", "value"); +User user = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.RequestOptions; + +GetUserResponseContent user = client.users().get( + "user_id", + GetUserRequestParameters.builder().build(), + RequestOptions.builder() + .timeout(10) + .maxRetries(1) + .addHeader("X-Custom-Header", "value") + .build() +); +``` + +### Type changes + +V3 uses generated type classes located in `com.auth0.client.mgmt.types` instead of the hand-written POJOs in `com.auth0.json.mgmt`. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.json.mgmt.roles.Role; +import com.auth0.json.mgmt.organizations.Organization; +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.Organization; +``` + +Type naming conventions in v3: +- Request body types: `*RequestContent` (e.g., `CreateUserRequestContent`) +- Response types: `*ResponseContent` or `*ResponseSchema` (e.g., `GetUserResponseContent`, `UserResponseSchema`) +- Query parameters: `*RequestParameters` (e.g., `ListUsersRequestParameters`) + +All types use immutable builders: + +```java +// v3 type construction +CreateUserRequestContent request = CreateUserRequestContent + .builder() + .email("test@example.com") + .connection("Username-Password-Authentication") + .password("secure-password") + .build(); +``` From ddcbe6aa72d6633556af25888a981f321da43713 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 27 Nov 2025 10:59:41 +0530 Subject: [PATCH 02/13] Removed API diff task --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2c0dec13a..0e0358be8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,8 +19,8 @@ jobs: - name: Set up Gradle uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 - - name: Test and Assemble and ApiDiff with Gradle - run: ./gradlew assemble apiDiff check jacocoTestReport --continue --console=plain + - name: Test and Assemble with Gradle + run: ./gradlew assemble check --continue --console=plain - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: From 0f12db2a7e74bb0cc138b8e9f73497860a87d198 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 18 Dec 2025 13:33:48 +0530 Subject: [PATCH 03/13] Added latest changes from fern SDK --- .fernignore | 17 +- sample-app/src/main/java/sample/App.java | 185 ++ .../java/com/auth0/client/auth/AuthAPI.java | 17 +- .../client/mgmt/AsyncClientGrantsClient.java | 6 +- .../mgmt/AsyncConnectionProfilesClient.java | 156 ++ .../client/mgmt/AsyncConnectionsClient.java | 8 + .../client/mgmt/AsyncCustomDomainsClient.java | 13 +- .../client/mgmt/AsyncEventStreamsClient.java | 16 - .../auth0/client/mgmt/AsyncFlowsClient.java | 8 + .../auth0/client/mgmt/AsyncManagementApi.java | 22 + .../client/mgmt/AsyncOrganizationsClient.java | 8 + .../client/mgmt/AsyncRawActionsClient.java | 30 +- .../mgmt/AsyncRawClientGrantsClient.java | 36 +- .../client/mgmt/AsyncRawClientsClient.java | 63 +- .../AsyncRawConnectionProfilesClient.java | 687 +++++ .../mgmt/AsyncRawConnectionsClient.java | 32 +- .../mgmt/AsyncRawCustomDomainsClient.java | 48 +- .../mgmt/AsyncRawDeviceCredentialsClient.java | 33 +- .../mgmt/AsyncRawEventStreamsClient.java | 99 +- .../client/mgmt/AsyncRawFlowsClient.java | 13 +- .../client/mgmt/AsyncRawFormsClient.java | 8 +- .../client/mgmt/AsyncRawHooksClient.java | 28 +- .../auth0/client/mgmt/AsyncRawLogsClient.java | 28 +- .../mgmt/AsyncRawNetworkAclsClient.java | 8 +- .../mgmt/AsyncRawOrganizationsClient.java | 12 +- .../mgmt/AsyncRawResourceServersClient.java | 18 +- .../client/mgmt/AsyncRawRolesClient.java | 13 +- .../client/mgmt/AsyncRawRulesClient.java | 33 +- .../AsyncRawSelfServiceProfilesClient.java | 8 +- .../client/mgmt/AsyncRawSessionsClient.java | 107 + .../client/mgmt/AsyncRawStatsClient.java | 9 +- .../AsyncRawTokenExchangeProfilesClient.java | 19 +- .../AsyncRawUserAttributeProfilesClient.java | 688 +++++ .../client/mgmt/AsyncRawUserBlocksClient.java | 18 +- .../client/mgmt/AsyncRawUserGrantsClient.java | 23 +- .../client/mgmt/AsyncRawUsersClient.java | 62 +- .../client/mgmt/AsyncSessionsClient.java | 24 + .../AsyncTokenExchangeProfilesClient.java | 12 + .../AsyncUserAttributeProfilesClient.java | 156 ++ .../auth0/client/mgmt/AsyncUsersClient.java | 16 + .../auth0/client/mgmt/ClientGrantsClient.java | 6 +- .../client/mgmt/ConnectionProfilesClient.java | 150 + .../auth0/client/mgmt/ConnectionsClient.java | 8 + .../client/mgmt/CustomDomainsClient.java | 12 +- .../auth0/client/mgmt/EventStreamsClient.java | 15 - .../com/auth0/client/mgmt/FlowsClient.java | 8 + .../com/auth0/client/mgmt/ManagementApi.java | 22 + .../client/mgmt/ManagementApiBuilder.java | 155 +- .../client/mgmt/OrganizationsClient.java | 8 + .../auth0/client/mgmt/RawActionsClient.java | 30 +- .../client/mgmt/RawClientGrantsClient.java | 36 +- .../auth0/client/mgmt/RawClientsClient.java | 63 +- .../mgmt/RawConnectionProfilesClient.java | 522 ++++ .../client/mgmt/RawConnectionsClient.java | 32 +- .../client/mgmt/RawCustomDomainsClient.java | 47 +- .../mgmt/RawDeviceCredentialsClient.java | 33 +- .../client/mgmt/RawEventStreamsClient.java | 75 +- .../com/auth0/client/mgmt/RawFlowsClient.java | 13 +- .../com/auth0/client/mgmt/RawFormsClient.java | 8 +- .../com/auth0/client/mgmt/RawHooksClient.java | 28 +- .../com/auth0/client/mgmt/RawLogsClient.java | 28 +- .../client/mgmt/RawNetworkAclsClient.java | 8 +- .../client/mgmt/RawOrganizationsClient.java | 12 +- .../client/mgmt/RawResourceServersClient.java | 18 +- .../com/auth0/client/mgmt/RawRolesClient.java | 13 +- .../com/auth0/client/mgmt/RawRulesClient.java | 33 +- .../mgmt/RawSelfServiceProfilesClient.java | 8 +- .../auth0/client/mgmt/RawSessionsClient.java | 83 + .../com/auth0/client/mgmt/RawStatsClient.java | 9 +- .../mgmt/RawTokenExchangeProfilesClient.java | 19 +- .../mgmt/RawUserAttributeProfilesClient.java | 523 ++++ .../client/mgmt/RawUserBlocksClient.java | 18 +- .../client/mgmt/RawUserGrantsClient.java | 23 +- .../com/auth0/client/mgmt/RawUsersClient.java | 62 +- .../com/auth0/client/mgmt/SessionsClient.java | 24 + .../mgmt/TokenExchangeProfilesClient.java | 12 + .../mgmt/UserAttributeProfilesClient.java | 151 + .../com/auth0/client/mgmt/UsersClient.java | 16 + .../mgmt/actions/AsyncRawVersionsClient.java | 5 +- .../mgmt/actions/RawVersionsClient.java | 5 +- .../triggers/AsyncRawBindingsClient.java | 5 +- .../actions/triggers/RawBindingsClient.java | 5 +- ...ctionTriggerBindingsRequestParameters.java | 23 +- .../UpdateActionBindingsRequestContent.java | 6 +- .../ListActionVersionsRequestParameters.java | 23 +- .../AsyncAttackProtectionClient.java | 14 + .../AsyncBotDetectionClient.java | 66 + .../attackprotection/AsyncCaptchaClient.java | 66 + .../AsyncRawBotDetectionClient.java | 228 ++ .../AsyncRawCaptchaClient.java | 222 ++ .../AttackProtectionClient.java | 14 + .../attackprotection/BotDetectionClient.java | 64 + .../mgmt/attackprotection/CaptchaClient.java | 64 + .../RawBotDetectionClient.java | 177 ++ .../attackprotection/RawCaptchaClient.java | 173 ++ ...AttackProtectionCaptchaRequestContent.java | 291 ++ ...ateBotDetectionSettingsRequestContent.java | 243 ++ ...sswordDetectionSettingsRequestContent.java | 6 +- ...pdateBruteForceSettingsRequestContent.java | 6 +- ...eBruteForceSettingsRequestContentMode.java | 6 +- ...orceSettingsRequestContentShieldsItem.java | 6 +- ...ousIpThrottlingSettingsRequestContent.java | 6 +- .../branding/AsyncRawTemplatesClient.java | 50 +- .../mgmt/branding/AsyncTemplatesClient.java | 50 +- .../mgmt/branding/RawTemplatesClient.java | 50 +- .../client/mgmt/branding/TemplatesClient.java | 50 +- .../phone/AsyncRawProvidersClient.java | 5 +- .../phone/AsyncRawTemplatesClient.java | 5 +- .../branding/phone/RawProvidersClient.java | 5 +- .../branding/phone/RawTemplatesClient.java | 5 +- ...teBrandingPhoneProviderRequestContent.java | 22 +- ...tePhoneProviderSendTestRequestContent.java | 16 +- .../CreatePhoneTemplateRequestContent.java | 6 +- ...emplateTestNotificationRequestContent.java | 16 +- ...andingPhoneProvidersRequestParameters.java | 6 +- .../ListPhoneTemplatesRequestParameters.java | 6 +- ...teBrandingPhoneProviderRequestContent.java | 6 +- .../UpdatePhoneTemplateRequestContent.java | 6 +- .../CreateBrandingThemeRequestContent.java | 24 +- .../UpdateBrandingThemeRequestContent.java | 24 +- .../AsyncRawOrganizationsClient.java | 7 +- .../clientgrants/RawOrganizationsClient.java | 7 +- ...ntGrantOrganizationsRequestParameters.java | 6 +- .../clients/AsyncRawConnectionsClient.java | 17 +- .../mgmt/clients/RawConnectionsClient.java | 17 +- .../clients/types/ConnectionsGetRequest.java | 6 +- .../PatchClientCredentialRequestContent.java | 6 +- .../PostClientCredentialRequestContent.java | 36 +- .../AsyncDirectoryProvisioningClient.java | 136 + .../connections/AsyncRawClientsClient.java | 7 +- .../AsyncRawDirectoryProvisioningClient.java | 541 ++++ .../DirectoryProvisioningClient.java | 135 + .../mgmt/connections/RawClientsClient.java | 7 +- .../RawDirectoryProvisioningClient.java | 415 +++ .../AsyncRawSynchronizationsClient.java | 136 + .../AsyncSynchronizationsClient.java | 42 + .../RawSynchronizationsClient.java | 105 + .../SynchronizationsClient.java | 40 + .../types/CreateScimTokenRequestContent.java | 6 +- ...ConnectionUsersByEmailQueryParameters.java | 12 +- ...ectionEnabledClientsRequestParameters.java | 6 +- ...UpdateScimConfigurationRequestContent.java | 18 +- .../client/mgmt/core/QueryStringMapper.java | 9 - .../mgmt/emails/AsyncRawProviderClient.java | 10 +- .../client/mgmt/emails/RawProviderClient.java | 10 +- .../CreateEmailProviderRequestContent.java | 30 +- .../GetEmailProviderRequestParameters.java | 6 +- .../UpdateEmailProviderRequestContent.java | 6 +- .../client/mgmt/errors/BadRequestError.java | 2 +- .../client/mgmt/errors/ConflictError.java | 2 +- .../mgmt/errors/ContentTooLargeError.java | 2 +- .../client/mgmt/errors/ForbiddenError.java | 2 +- .../mgmt/errors/InternalServerError.java | 2 +- .../client/mgmt/errors/NotFoundError.java | 2 +- .../mgmt/errors/PaymentRequiredError.java | 2 +- .../mgmt/errors/ServiceUnavailableError.java | 2 +- .../mgmt/errors/TooManyRequestsError.java | 2 +- .../client/mgmt/errors/UnauthorizedError.java | 2 +- .../AsyncRawDeliveriesClient.java | 27 +- .../eventstreams/RawDeliveriesClient.java | 27 +- ...teEventStreamRedeliveryRequestContent.java | 6 +- ...ventStreamDeliveriesRequestParameters.java | 6 +- .../mgmt/flows/AsyncRawExecutionsClient.java | 7 +- .../mgmt/flows/RawExecutionsClient.java | 7 +- .../flows/types/ExecutionsGetRequest.java | 6 +- .../flows/types/ExecutionsListRequest.java | 6 +- .../flows/vault/AsyncConnectionsClient.java | 88 + .../vault/AsyncRawConnectionsClient.java | 497 ++++ .../mgmt/flows/vault/AsyncVaultClient.java | 23 + .../mgmt/flows/vault/ConnectionsClient.java | 85 + .../flows/vault/RawConnectionsClient.java | 370 +++ .../client/mgmt/flows/vault/VaultClient.java | 23 + ...lowsVaultConnectionsRequestParameters.java | 228 ++ ...ateFlowsVaultConnectionRequestContent.java | 128 + ...ardianFactorDuoSettingsRequestContent.java | 6 +- ...ardianFactorDuoSettingsRequestContent.java | 6 +- ...FactorPhoneMessageTypesRequestContent.java | 6 +- ...ianFactorPhoneTemplatesRequestContent.java | 14 +- ...rdianFactorSmsTemplatesRequestContent.java | 14 +- ...ianFactorsProviderPhoneRequestContent.java | 12 +- ...torsProviderPhoneTwilioRequestContent.java | 6 +- ...roviderPushNotificationRequestContent.java | 12 +- ...iderPushNotificationSnsRequestContent.java | 6 +- ...rdianFactorsProviderSmsRequestContent.java | 12 +- ...actorsProviderSmsTwilioRequestContent.java | 6 +- ...iderPushNotificationSnsRequestContent.java | 6 +- ...uardianEnrollmentTicketRequestContent.java | 32 +- .../SetGuardianFactorRequestContent.java | 12 +- .../mgmt/hooks/AsyncRawSecretsClient.java | 16 +- .../client/mgmt/hooks/AsyncSecretsClient.java | 12 +- .../client/mgmt/hooks/RawSecretsClient.java | 14 +- .../client/mgmt/hooks/SecretsClient.java | 12 +- .../CreateExportUsersRequestContent.java | 6 +- .../CreateImportUsersRequestContent.java | 24 +- ...CreateVerificationEmailRequestContent.java | 24 +- .../mgmt/jobs/types/ErrorsGetResponse.java | 8 +- .../mgmt/keys/AsyncRawEncryptionClient.java | 8 +- .../client/mgmt/keys/RawEncryptionClient.java | 8 +- .../CreateEncryptionKeyRequestContent.java | 12 +- .../ImportEncryptionKeyRequestContent.java | 12 +- .../ListEncryptionKeysRequestParameters.java | 25 +- .../SetCustomSigningKeysRequestContent.java | 6 +- .../AsyncDiscoveryDomainsClient.java | 131 + .../AsyncRawClientGrantsClient.java | 18 +- .../AsyncRawDiscoveryDomainsClient.java | 551 ++++ .../AsyncRawEnabledConnectionsClient.java | 8 +- .../AsyncRawInvitationsClient.java | 33 +- .../organizations/AsyncRawMembersClient.java | 17 +- .../organizations/DiscoveryDomainsClient.java | 129 + .../organizations/RawClientGrantsClient.java | 18 +- .../RawDiscoveryDomainsClient.java | 424 +++ .../RawEnabledConnectionsClient.java | 8 +- .../organizations/RawInvitationsClient.java | 33 +- .../mgmt/organizations/RawMembersClient.java | 17 +- .../members/AsyncRawRolesClient.java | 8 +- .../organizations/members/RawRolesClient.java | 8 +- ...OrganizationMemberRolesRequestContent.java | 6 +- ...OrganizationMemberRolesRequestContent.java | 6 +- ...anizationMemberRolesRequestParameters.java | 25 +- ...dOrganizationConnectionRequestContent.java | 24 +- ...OrganizationClientGrantRequestContent.java | 12 +- ...nizationDiscoveryDomainRequestContent.java | 148 + ...eOrganizationInvitationRequestContent.java | 40 +- ...reateOrganizationMemberRequestContent.java | 6 +- ...leteOrganizationMembersRequestContent.java | 6 +- ...ganizationInvitationRequestParameters.java | 6 +- ...nizationClientGrantsRequestParameters.java | 17 +- ...anizationConnectionsRequestParameters.java | 25 +- ...tionDiscoveryDomainsRequestParameters.java | 185 ++ ...anizationInvitationsRequestParameters.java | 37 +- ...tOrganizationMembersRequestParameters.java | 6 +- ...eOrganizationConnectionRequestContent.java | 6 +- ...nizationDiscoveryDomainRequestContent.java | 98 + .../mgmt/prompts/AsyncRawRenderingClient.java | 209 +- .../mgmt/prompts/AsyncRenderingClient.java | 95 +- .../mgmt/prompts/RawRenderingClient.java | 184 +- .../client/mgmt/prompts/RenderingClient.java | 95 +- .../types/BulkUpdateAculRequestContent.java | 107 + .../types/ListAculsRequestParameters.java | 17 +- .../types/UpdateAculRequestContent.java | 153 +- .../AsyncRawSettingsClient.java | 221 ++ .../AsyncRiskAssessmentsClient.java | 23 + .../riskassessments/AsyncSettingsClient.java | 69 + .../riskassessments/RawSettingsClient.java | 170 ++ .../RiskAssessmentsClient.java | 23 + .../mgmt/riskassessments/SettingsClient.java | 67 + .../settings/AsyncNewDeviceClient.java | 59 + .../settings/AsyncRawNewDeviceClient.java | 222 ++ .../settings/NewDeviceClient.java | 58 + .../settings/RawNewDeviceClient.java | 171 ++ ...smentsSettingsNewDeviceRequestContent.java | 114 + ...RiskAssessmentsSettingsRequestContent.java | 113 + .../mgmt/roles/AsyncRawPermissionsClient.java | 8 +- .../mgmt/roles/AsyncRawUsersClient.java | 7 +- .../mgmt/roles/RawPermissionsClient.java | 8 +- .../client/mgmt/roles/RawUsersClient.java | 7 +- .../AddRolePermissionsRequestContent.java | 6 +- .../types/AssignRoleUsersRequestContent.java | 6 +- .../DeleteRolePermissionsRequestContent.java | 6 +- .../ListRolePermissionsRequestParameters.java | 17 +- .../types/ListRoleUsersRequestParameters.java | 6 +- .../AsyncCustomTextClient.java | 12 +- .../AsyncRawCustomTextClient.java | 20 +- .../selfserviceprofiles/CustomTextClient.java | 10 +- .../RawCustomTextClient.java | 16 +- ...ServiceProfileSsoTicketRequestContent.java | 6 +- .../mgmt/tenants/AsyncRawSettingsClient.java | 10 +- .../mgmt/tenants/RawSettingsClient.java | 10 +- .../GetTenantSettingsRequestParameters.java | 6 +- .../UpdateTenantSettingsRequestContent.java | 112 +- ...tingsRequestContentEnabledLocalesItem.java | 6 +- .../com/auth0/client/mgmt/types/Action.java | 10 +- .../auth0/client/mgmt/types/ActionBase.java | 6 +- .../client/mgmt/types/ActionBinding.java | 6 +- .../client/mgmt/types/ActionBindingRef.java | 6 +- .../mgmt/types/ActionBindingRefTypeEnum.java | 6 +- .../mgmt/types/ActionBindingTypeEnum.java | 6 +- .../mgmt/types/ActionBindingWithRef.java | 20 +- .../mgmt/types/ActionBuildStatusEnum.java | 6 +- .../mgmt/types/ActionDeployedVersion.java | 14 +- .../auth0/client/mgmt/types/ActionError.java | 6 +- .../mgmt/types/ActionExecutionResult.java | 6 +- .../mgmt/types/ActionExecutionStatusEnum.java | 6 +- .../mgmt/types/ActionSecretRequest.java | 6 +- .../mgmt/types/ActionSecretResponse.java | 6 +- .../client/mgmt/types/ActionTrigger.java | 36 +- .../types/ActionTriggerCompatibleTrigger.java | 14 +- .../client/mgmt/types/ActionVersion.java | 14 +- .../types/ActionVersionBuildStatusEnum.java | 6 +- .../mgmt/types/ActionVersionDependency.java | 6 +- .../client/mgmt/types/AculClientFilter.java | 135 +- .../mgmt/types/AculClientFilterById.java | 113 + .../types/AculClientFilterByMetadata.java | 105 + .../client/mgmt/types/AculConfigsItem.java | 440 +++ .../types/AculContextConfigurationItem.java | 96 + .../client/mgmt/types/AculContextEnum.java | 246 ++ .../client/mgmt/types/AculDomainFilter.java | 135 +- .../mgmt/types/AculDomainFilterById.java | 113 + .../types/AculDomainFilterByMetadata.java | 105 + .../auth0/client/mgmt/types/AculFilters.java | 6 +- .../auth0/client/mgmt/types/AculHeadTag.java | 26 +- .../client/mgmt/types/AculMatchTypeEnum.java | 6 +- .../mgmt/types/AculOrganizationFilter.java | 135 +- .../types/AculOrganizationFilterById.java | 113 + .../AculOrganizationFilterByMetadata.java | 105 + .../mgmt/types/AculRenderingModeEnum.java | 6 +- .../mgmt/types/AculResponseContent.java | 134 +- ...OrganizationConnectionResponseContent.java | 6 +- ...rganizationClientGrantResponseContent.java | 6 +- ...syncApprovalNotificationsChannelsEnum.java | 86 + ...rotectionCaptchaArkoseResponseContent.java | 195 ++ ...ProtectionCaptchaAuthChallengeRequest.java | 113 + ...onCaptchaAuthChallengeResponseContent.java | 103 + ...CaptchaFriendlyCaptchaResponseContent.java | 103 + ...tectionCaptchaHcaptchaResponseContent.java | 103 + .../AttackProtectionCaptchaProviderId.java | 141 + ...chaRecaptchaEnterpriseResponseContent.java | 132 + ...tionCaptchaRecaptchaV2ResponseContent.java | 103 + .../AttackProtectionUpdateCaptchaArkose.java | 283 ++ ...rotectionUpdateCaptchaFriendlyCaptcha.java | 148 + ...AttackProtectionUpdateCaptchaHcaptcha.java | 148 + ...ctionUpdateCaptchaRecaptchaEnterprise.java | 182 ++ ...ackProtectionUpdateCaptchaRecaptchaV2.java | 148 + .../types/AuthenticationMethodTypeEnum.java | 6 +- .../mgmt/types/AuthenticationTypeEnum.java | 6 +- ...ectionChallengePolicyPasswordFlowEnum.java | 97 + ...nChallengePolicyPasswordResetFlowEnum.java | 97 + ...onChallengePolicyPasswordlessFlowEnum.java | 97 + .../mgmt/types/BotDetectionLevelEnum.java | 94 + .../client/mgmt/types/BrandingColors.java | 6 +- .../auth0/client/mgmt/types/BrandingFont.java | 6 +- .../mgmt/types/BrandingPageBackground.java | 8 +- .../mgmt/types/BrandingThemeBorders.java | 28 +- .../BrandingThemeBordersButtonsStyleEnum.java | 6 +- .../BrandingThemeBordersInputsStyleEnum.java | 6 +- .../mgmt/types/BrandingThemeColors.java | 58 +- ...dingThemeColorsCaptchaWidgetThemeEnum.java | 6 +- .../mgmt/types/BrandingThemeFontBodyText.java | 14 +- .../types/BrandingThemeFontButtonsText.java | 14 +- .../types/BrandingThemeFontInputLabels.java | 14 +- .../mgmt/types/BrandingThemeFontLinks.java | 14 +- .../BrandingThemeFontLinksStyleEnum.java | 6 +- .../mgmt/types/BrandingThemeFontSubtitle.java | 14 +- .../mgmt/types/BrandingThemeFontTitle.java | 14 +- .../client/mgmt/types/BrandingThemeFonts.java | 28 +- .../types/BrandingThemePageBackground.java | 16 +- ...dingThemePageBackgroundPageLayoutEnum.java | 6 +- .../mgmt/types/BrandingThemeWidget.java | 20 +- ...ingThemeWidgetHeaderTextAlignmentEnum.java | 6 +- .../BrandingThemeWidgetLogoPositionEnum.java | 6 +- ...ingThemeWidgetSocialButtonsLayoutEnum.java | 6 +- ...tectionAdminNotificationFrequencyEnum.java | 6 +- .../BreachedPasswordDetectionMethodEnum.java | 6 +- ...DetectionPreChangePasswordShieldsEnum.java | 6 +- ...sswordDetectionPreChangePasswordStage.java | 6 +- ...tectionPreUserRegistrationShieldsEnum.java | 6 +- ...wordDetectionPreUserRegistrationStage.java | 6 +- .../BreachedPasswordDetectionShieldsEnum.java | 6 +- .../types/BreachedPasswordDetectionStage.java | 6 +- .../types/BulkUpdateAculResponseContent.java | 106 + .../types/ChangePasswordTicketIdentity.java | 181 ++ .../ChangePasswordTicketRequestContent.java | 36 +- .../ChangePasswordTicketResponseContent.java | 12 +- .../com/auth0/client/mgmt/types/Client.java | 251 +- .../client/mgmt/types/ClientAddonAws.java | 6 +- .../mgmt/types/ClientAddonAzureBlob.java | 6 +- .../client/mgmt/types/ClientAddonAzureSb.java | 6 +- .../mgmt/types/ClientAddonEchoSign.java | 6 +- .../client/mgmt/types/ClientAddonEgnyte.java | 6 +- .../mgmt/types/ClientAddonFirebase.java | 6 +- .../client/mgmt/types/ClientAddonLayer.java | 24 +- .../client/mgmt/types/ClientAddonMscrm.java | 12 +- .../mgmt/types/ClientAddonNewRelic.java | 6 +- .../client/mgmt/types/ClientAddonOag.java | 4 +- .../mgmt/types/ClientAddonOffice365.java | 6 +- .../client/mgmt/types/ClientAddonRms.java | 12 +- .../mgmt/types/ClientAddonSalesforce.java | 6 +- .../mgmt/types/ClientAddonSalesforceApi.java | 6 +- .../ClientAddonSalesforceSandboxApi.java | 6 +- .../client/mgmt/types/ClientAddonSaml.java | 6 +- .../client/mgmt/types/ClientAddonSapapi.java | 6 +- .../client/mgmt/types/ClientAddonSentry.java | 6 +- .../mgmt/types/ClientAddonSharePoint.java | 6 +- .../ClientAddonSharePointExternalUrl.java | 8 +- .../client/mgmt/types/ClientAddonSlack.java | 12 +- .../mgmt/types/ClientAddonSpringCm.java | 6 +- .../mgmt/types/ClientAddonSsoIntegration.java | 6 +- .../client/mgmt/types/ClientAddonWams.java | 6 +- .../client/mgmt/types/ClientAddonZendesk.java | 6 +- .../client/mgmt/types/ClientAddonZoom.java | 6 +- .../auth0/client/mgmt/types/ClientAddons.java | 6 +- .../client/mgmt/types/ClientAppTypeEnum.java | 6 +- .../types/ClientAuthenticationMethod.java | 6 +- ...ticationMethodSelfSignedTlsClientAuth.java | 6 +- ...ientAuthenticationMethodTlsClientAuth.java | 6 +- .../mgmt/types/ClientComplianceLevelEnum.java | 6 +- .../ClientCreateAuthenticationMethod.java | 6 +- .../client/mgmt/types/ClientCredential.java | 6 +- .../types/ClientCredentialAlgorithmEnum.java | 6 +- .../mgmt/types/ClientCredentialTypeEnum.java | 6 +- .../mgmt/types/ClientDefaultOrganization.java | 18 +- .../mgmt/types/ClientEncryptionKey.java | 6 +- ...entGrantOrganizationNullableUsageEnum.java | 6 +- .../ClientGrantOrganizationUsageEnum.java | 6 +- .../types/ClientGrantResponseContent.java | 68 +- .../types/ClientGrantSubjectTypeEnum.java | 84 + .../mgmt/types/ClientJwtConfiguration.java | 6 +- .../auth0/client/mgmt/types/ClientMobile.java | 6 +- .../mgmt/types/ClientMobileAndroid.java | 6 +- .../client/mgmt/types/ClientMobileiOs.java | 6 +- ...ClientOidcBackchannelLogoutInitiators.java | 6 +- ...ntOidcBackchannelLogoutInitiatorsEnum.java | 6 +- ...dcBackchannelLogoutInitiatorsModeEnum.java | 6 +- ...tOidcBackchannelLogoutSessionMetadata.java | 103 + .../ClientOidcBackchannelLogoutSettings.java | 80 +- .../ClientOrganizationDiscoveryEnum.java | 86 + ...ClientOrganizationRequireBehaviorEnum.java | 6 +- ...tOrganizationRequireBehaviorPatchEnum.java | 6 +- .../types/ClientOrganizationUsageEnum.java | 6 +- .../ClientOrganizationUsagePatchEnum.java | 6 +- .../ClientRefreshTokenConfiguration.java | 34 +- ...nsferAllowedAuthenticationMethodsEnum.java | 6 +- .../ClientSessionTransferConfiguration.java | 90 +- ...lientSessionTransferDeviceBindingEnum.java | 6 +- ...ntSignedRequestObjectWithCredentialId.java | 6 +- ...lientSignedRequestObjectWithPublicKey.java | 6 +- .../client/mgmt/types/ClientSigningKey.java | 6 +- .../ClientTokenEndpointAuthMethodEnum.java | 6 +- ...ientTokenEndpointAuthMethodOrNullEnum.java | 6 +- .../ClientTokenExchangeConfiguration.java | 103 + ...lientTokenExchangeConfigurationOrNull.java | 104 + .../client/mgmt/types/ConnectedAccount.java | 393 +++ .../types/ConnectionAttributeIdentifier.java | 6 +- .../types/ConnectionAttributeMapOidc.java | 145 + .../types/ConnectionAttributeMapOkta.java | 145 + .../mgmt/types/ConnectionAttributes.java | 6 +- .../ConnectionAuthenticationMethods.java | 6 +- .../ConnectionAuthenticationPurpose.java | 101 + .../client/mgmt/types/ConnectionCommon.java | 292 ++ .../ConnectionConnectedAccountsPurpose.java | 133 + .../types/ConnectionConnectionSettings.java | 96 + .../ConnectionConnectionSettingsPkceEnum.java | 108 + .../mgmt/types/ConnectionCustomScripts.java | 6 +- .../mgmt/types/ConnectionEnabledClient.java | 12 +- ...ctionFederatedConnectionsAccessTokens.java | 103 + .../client/mgmt/types/ConnectionForList.java | 75 +- .../mgmt/types/ConnectionForOrganization.java | 24 +- .../ConnectionGatewayAuthentication.java | 24 +- ...onnectionIdTokenSignedResponseAlgEnum.java | 108 + .../ConnectionIdentifierPrecedenceEnum.java | 6 +- .../ConnectionIdentityApiEnumAzureAd.java | 87 + .../types/ConnectionIdentityProviderEnum.java | 6 +- .../client/mgmt/types/ConnectionKey.java | 50 +- .../mgmt/types/ConnectionKeyUseEnum.java | 6 +- .../types/ConnectionMappingModeEnumOidc.java | 86 + .../types/ConnectionMappingModeEnumOkta.java | 86 + .../client/mgmt/types/ConnectionMfa.java | 132 + .../mgmt/types/ConnectionOptionsApple.java | 574 ++++ .../mgmt/types/ConnectionOptionsAuth0.java | 905 ++++++ .../mgmt/types/ConnectionOptionsAzureAd.java | 2175 ++++++++++++++ .../mgmt/types/ConnectionOptionsCommon.java | 98 + .../types/ConnectionOptionsCommonOidc.java | 1002 +++++++ .../types/ConnectionOptionsGoogleOAuth2.java | 2494 +++++++++++++++++ .../mgmt/types/ConnectionOptionsOAuth2.java | 574 ++++ .../types/ConnectionOptionsOAuth2Common.java | 250 ++ .../mgmt/types/ConnectionOptionsOidc.java | 1131 ++++++++ .../types/ConnectionOptionsOidcMetadata.java | 1290 +++++++++ .../mgmt/types/ConnectionOptionsOkta.java | 1131 ++++++++ ...ConnectionPasskeyAuthenticationMethod.java | 6 +- .../ConnectionPasskeyChallengeUiEnum.java | 6 +- .../mgmt/types/ConnectionPasskeyOptions.java | 6 +- ...onnectionPasswordAuthenticationMethod.java | 6 +- .../ConnectionPasswordComplexityOptions.java | 6 +- .../ConnectionPasswordDictionaryOptions.java | 16 +- .../ConnectionPasswordHistoryOptions.java | 16 +- ...nnectionPasswordNoPersonalInfoOptions.java | 12 +- .../types/ConnectionPasswordPolicyEnum.java | 6 +- .../client/mgmt/types/ConnectionProfile.java | 257 ++ .../mgmt/types/ConnectionProfileConfig.java | 59 + .../types/ConnectionProfileOrganization.java | 123 + ...ganizationAssignMembershipOnLoginEnum.java | 98 + ...onProfileOrganizationShowAsButtonEnum.java | 97 + .../ConnectionProfileStrategyOverride.java | 121 + .../ConnectionProfileStrategyOverrides.java | 268 ++ ...fileStrategyOverridesConnectionConfig.java | 59 + .../mgmt/types/ConnectionProfileTemplate.java | 231 ++ .../types/ConnectionProfileTemplateItem.java | 155 + .../types/ConnectionPropertiesOptions.java | 108 +- .../mgmt/types/ConnectionResponseCommon.java | 347 +++ .../types/ConnectionResponseContentAd.java | 378 +++ .../types/ConnectionResponseContentAdfs.java | 378 +++ .../ConnectionResponseContentAmazon.java | 378 +++ .../types/ConnectionResponseContentAol.java | 378 +++ .../types/ConnectionResponseContentApple.java | 378 +++ .../types/ConnectionResponseContentAuth0.java | 378 +++ .../ConnectionResponseContentAuth0Oidc.java | 379 +++ .../ConnectionResponseContentAzureAd.java | 456 +++ .../types/ConnectionResponseContentBaidu.java | 378 +++ .../ConnectionResponseContentBitbucket.java | 379 +++ .../types/ConnectionResponseContentBitly.java | 378 +++ .../types/ConnectionResponseContentBox.java | 378 +++ .../ConnectionResponseContentCustom.java | 378 +++ .../ConnectionResponseContentDaccount.java | 378 +++ .../ConnectionResponseContentDropbox.java | 378 +++ .../ConnectionResponseContentDwolla.java | 378 +++ .../types/ConnectionResponseContentEmail.java | 378 +++ .../ConnectionResponseContentEvernote.java | 378 +++ ...nectionResponseContentEvernoteSandbox.java | 379 +++ .../types/ConnectionResponseContentExact.java | 378 +++ .../ConnectionResponseContentFacebook.java | 378 +++ .../ConnectionResponseContentFitbit.java | 378 +++ .../ConnectionResponseContentFlickr.java | 378 +++ .../ConnectionResponseContentGitHub.java | 378 +++ .../ConnectionResponseContentGoogleApps.java | 379 +++ ...ConnectionResponseContentGoogleOAuth2.java | 379 +++ .../ConnectionResponseContentInstagram.java | 379 +++ .../types/ConnectionResponseContentIp.java | 378 +++ .../types/ConnectionResponseContentLine.java | 378 +++ .../ConnectionResponseContentLinkedin.java | 378 +++ .../ConnectionResponseContentMiicard.java | 378 +++ .../ConnectionResponseContentOAuth1.java | 378 +++ .../ConnectionResponseContentOAuth2.java | 378 +++ .../ConnectionResponseContentOffice365.java | 379 +++ .../types/ConnectionResponseContentOidc.java | 378 +++ .../types/ConnectionResponseContentOkta.java | 378 +++ .../ConnectionResponseContentPaypal.java | 378 +++ ...onnectionResponseContentPaypalSandbox.java | 379 +++ ...ConnectionResponseContentPingFederate.java | 379 +++ ...nnectionResponseContentPlanningCenter.java | 379 +++ .../ConnectionResponseContentRenren.java | 378 +++ .../ConnectionResponseContentSalesforce.java | 379 +++ ...ionResponseContentSalesforceCommunity.java | 379 +++ ...ctionResponseContentSalesforceSandbox.java | 379 +++ .../types/ConnectionResponseContentSaml.java | 378 +++ .../ConnectionResponseContentSharepoint.java | 379 +++ .../types/ConnectionResponseContentShop.java | 378 +++ .../ConnectionResponseContentShopify.java | 378 +++ .../types/ConnectionResponseContentSms.java | 378 +++ .../ConnectionResponseContentSoundcloud.java | 379 +++ .../ConnectionResponseContentTheCity.java | 378 +++ ...nnectionResponseContentTheCitySandbox.java | 379 +++ ...tionResponseContentThirtySevenSignals.java | 379 +++ .../ConnectionResponseContentTwitter.java | 378 +++ .../ConnectionResponseContentUntappd.java | 378 +++ .../ConnectionResponseContentVkontakte.java | 379 +++ .../types/ConnectionResponseContentWeibo.java | 378 +++ .../ConnectionResponseContentWindowsLive.java | 379 +++ .../ConnectionResponseContentWordpress.java | 379 +++ .../types/ConnectionResponseContentYahoo.java | 378 +++ .../ConnectionResponseContentYammer.java | 378 +++ .../ConnectionResponseContentYandex.java | 378 +++ .../mgmt/types/ConnectionScopeOAuth2.java | 97 + .../mgmt/types/ConnectionScriptsOAuth2.java | 132 + .../ConnectionSetUserRootAttributesEnum.java | 6 +- ...houldTrustEmailVerifiedConnectionEnum.java | 88 + .../mgmt/types/ConnectionStrategyEnum.java | 6 +- ...ConnectionTokenEndpointAuthMethodEnum.java | 86 + ...ectionTokenEndpointAuthSigningAlgEnum.java | 108 + .../mgmt/types/ConnectionTypeEnumOidc.java | 86 + ...onnectionUpstreamAdditionalProperties.java | 97 + ...utes.java => ConnectionUpstreamAlias.java} | 52 +- .../types/ConnectionUpstreamAliasEnum.java | 193 ++ .../mgmt/types/ConnectionUpstreamValue.java | 95 + .../ConnectionUseridAttributeEnumAzureAd.java | 86 + .../ConnectionUsernameValidationOptions.java | 14 +- .../types/ConnectionValidationOptions.java | 6 +- .../ConnectionWaadProtocolEnumAzureAd.java | 86 + .../types/CreateActionRequestContent.java | 46 +- .../types/CreateActionResponseContent.java | 10 +- ...eBrandingPhoneProviderResponseContent.java | 40 +- .../CreateBrandingThemeResponseContent.java | 24 +- .../CreateClientGrantRequestContent.java | 140 +- .../CreateClientGrantResponseContent.java | 68 +- .../types/CreateClientRequestContent.java | 473 +++- .../types/CreateClientResponseContent.java | 251 +- .../mgmt/types/CreateConnectionCommon.java | 319 +++ ...CreateConnectionProfileRequestContent.java | 271 ++ ...reateConnectionProfileResponseContent.java | 258 ++ .../types/CreateConnectionRequestContent.java | 127 +- .../CreateConnectionRequestContentAd.java | 350 +++ .../CreateConnectionRequestContentAdfs.java | 351 +++ .../CreateConnectionRequestContentAmazon.java | 351 +++ .../CreateConnectionRequestContentAol.java | 350 +++ .../CreateConnectionRequestContentApple.java | 351 +++ .../CreateConnectionRequestContentAuth0.java | 351 +++ ...eateConnectionRequestContentAuth0Oidc.java | 351 +++ ...CreateConnectionRequestContentAzureAd.java | 403 +++ .../CreateConnectionRequestContentBaidu.java | 351 +++ ...eateConnectionRequestContentBitbucket.java | 351 +++ .../CreateConnectionRequestContentBitly.java | 351 +++ .../CreateConnectionRequestContentBox.java | 350 +++ .../CreateConnectionRequestContentCustom.java | 351 +++ ...reateConnectionRequestContentDaccount.java | 351 +++ ...CreateConnectionRequestContentDropbox.java | 351 +++ .../CreateConnectionRequestContentDwolla.java | 351 +++ .../CreateConnectionRequestContentEmail.java | 351 +++ ...reateConnectionRequestContentEvernote.java | 351 +++ ...nnectionRequestContentEvernoteSandbox.java | 351 +++ .../CreateConnectionRequestContentExact.java | 351 +++ ...reateConnectionRequestContentFacebook.java | 351 +++ .../CreateConnectionRequestContentFitbit.java | 351 +++ .../CreateConnectionRequestContentFlickr.java | 351 +++ .../CreateConnectionRequestContentGitHub.java | 351 +++ ...ateConnectionRequestContentGoogleApps.java | 351 +++ ...eConnectionRequestContentGoogleOAuth2.java | 351 +++ ...eateConnectionRequestContentInstagram.java | 351 +++ .../CreateConnectionRequestContentIp.java | 350 +++ .../CreateConnectionRequestContentLine.java | 351 +++ ...reateConnectionRequestContentLinkedin.java | 351 +++ ...CreateConnectionRequestContentMiicard.java | 351 +++ .../CreateConnectionRequestContentOAuth1.java | 351 +++ .../CreateConnectionRequestContentOAuth2.java | 351 +++ ...eateConnectionRequestContentOffice365.java | 351 +++ .../CreateConnectionRequestContentOidc.java | 351 +++ .../CreateConnectionRequestContentOkta.java | 351 +++ .../CreateConnectionRequestContentPaypal.java | 351 +++ ...ConnectionRequestContentPaypalSandbox.java | 351 +++ ...eConnectionRequestContentPingFederate.java | 351 +++ ...onnectionRequestContentPlanningCenter.java | 351 +++ .../CreateConnectionRequestContentRenren.java | 351 +++ ...ateConnectionRequestContentSalesforce.java | 351 +++ ...tionRequestContentSalesforceCommunity.java | 352 +++ ...ectionRequestContentSalesforceSandbox.java | 352 +++ .../CreateConnectionRequestContentSaml.java | 351 +++ ...ateConnectionRequestContentSharepoint.java | 351 +++ .../CreateConnectionRequestContentShop.java | 351 +++ ...CreateConnectionRequestContentShopify.java | 351 +++ .../CreateConnectionRequestContentSms.java | 350 +++ ...ateConnectionRequestContentSoundcloud.java | 351 +++ ...CreateConnectionRequestContentTheCity.java | 351 +++ ...onnectionRequestContentTheCitySandbox.java | 351 +++ ...ctionRequestContentThirtySevenSignals.java | 352 +++ ...CreateConnectionRequestContentTwitter.java | 351 +++ ...CreateConnectionRequestContentUntappd.java | 351 +++ ...eateConnectionRequestContentVkontakte.java | 351 +++ .../CreateConnectionRequestContentWeibo.java | 351 +++ ...teConnectionRequestContentWindowsLive.java | 351 +++ ...eateConnectionRequestContentWordpress.java | 351 +++ .../CreateConnectionRequestContentYahoo.java | 351 +++ .../CreateConnectionRequestContentYammer.java | 351 +++ .../CreateConnectionRequestContentYandex.java | 351 +++ .../CreateConnectionResponseContent.java | 75 +- .../CreateCustomDomainRequestContent.java | 78 +- .../CreateCustomDomainResponseContent.java | 138 +- ...teDirectoryProvisioningRequestContent.java | 135 + ...eDirectoryProvisioningResponseContent.java | 513 ++++ ...rectorySynchronizationResponseContent.java | 184 ++ .../CreateEmailProviderResponseContent.java | 6 +- .../CreateEmailTemplateRequestContent.java | 72 +- .../CreateEmailTemplateResponseContent.java | 72 +- ...ptionKeyPublicWrappingResponseContent.java | 14 +- .../CreateEncryptionKeyResponseContent.java | 26 +- .../mgmt/types/CreateEncryptionKeyType.java | 6 +- ...CreateEventStreamActionRequestContent.java | 24 +- ...eEventStreamEventBridgeRequestContent.java | 24 +- ...eEventStreamRedeliveryResponseContent.java | 6 +- .../CreateEventStreamResponseContent.java | 8 +- ...ateEventStreamTestEventRequestContent.java | 16 +- ...teEventStreamTestEventResponseContent.java | 28 +- ...reateEventStreamWebHookRequestContent.java | 24 +- .../mgmt/types/CreateExportUsersFields.java | 16 +- .../CreateExportUsersResponseContent.java | 36 +- .../mgmt/types/CreateFlowRequestContent.java | 16 +- .../mgmt/types/CreateFlowResponseContent.java | 26 +- ...ateFlowsVaultConnectionActivecampaign.java | 100 + ...wsVaultConnectionActivecampaignApiKey.java | 162 ++ ...ConnectionActivecampaignUninitialized.java | 137 + .../CreateFlowsVaultConnectionAirtable.java | 99 + ...ateFlowsVaultConnectionAirtableApiKey.java | 159 ++ ...sVaultConnectionAirtableUninitialized.java | 137 + .../CreateFlowsVaultConnectionAuth0.java | 97 + ...eateFlowsVaultConnectionAuth0OauthApp.java | 162 ++ ...lowsVaultConnectionAuth0Uninitialized.java | 137 + .../CreateFlowsVaultConnectionBigquery.java | 98 + ...CreateFlowsVaultConnectionBigqueryJwt.java | 162 ++ ...sVaultConnectionBigqueryUninitialized.java | 137 + .../CreateFlowsVaultConnectionClearbit.java | 99 + ...ateFlowsVaultConnectionClearbitApiKey.java | 162 ++ ...sVaultConnectionClearbitUninitialized.java | 137 + .../CreateFlowsVaultConnectionDocusign.java | 99 + ...FlowsVaultConnectionDocusignOauthCode.java | 162 ++ ...sVaultConnectionDocusignUninitialized.java | 137 + ...reateFlowsVaultConnectionGoogleSheets.java | 99 + ...sVaultConnectionGoogleSheetsOauthCode.java | 162 ++ ...ltConnectionGoogleSheetsUninitialized.java | 137 + .../types/CreateFlowsVaultConnectionHttp.java | 97 + .../CreateFlowsVaultConnectionHttpBearer.java | 162 ++ ...FlowsVaultConnectionHttpUninitialized.java | 137 + .../CreateFlowsVaultConnectionHubspot.java | 110 + ...eateFlowsVaultConnectionHubspotApiKey.java | 159 ++ ...eFlowsVaultConnectionHubspotOauthCode.java | 162 ++ ...wsVaultConnectionHubspotUninitialized.java | 137 + .../types/CreateFlowsVaultConnectionJwt.java | 97 + .../CreateFlowsVaultConnectionJwtJwt.java | 158 ++ ...eFlowsVaultConnectionJwtUninitialized.java | 137 + .../CreateFlowsVaultConnectionMailchimp.java | 112 + ...teFlowsVaultConnectionMailchimpApiKey.java | 162 ++ ...lowsVaultConnectionMailchimpOauthCode.java | 162 ++ ...VaultConnectionMailchimpUninitialized.java | 137 + .../CreateFlowsVaultConnectionMailjet.java | 97 + ...eateFlowsVaultConnectionMailjetApiKey.java | 162 ++ ...wsVaultConnectionMailjetUninitialized.java | 137 + .../CreateFlowsVaultConnectionPipedrive.java | 112 + ...lowsVaultConnectionPipedriveOauthCode.java | 162 ++ ...ateFlowsVaultConnectionPipedriveToken.java | 159 ++ ...VaultConnectionPipedriveUninitialized.java | 137 + ...ateFlowsVaultConnectionRequestContent.java | 326 +++ ...teFlowsVaultConnectionResponseContent.java | 476 ++++ .../CreateFlowsVaultConnectionSalesforce.java | 99 + ...owsVaultConnectionSalesforceOauthCode.java | 162 ++ ...aultConnectionSalesforceUninitialized.java | 137 + .../CreateFlowsVaultConnectionSendgrid.java | 99 + ...ateFlowsVaultConnectionSendgridApiKey.java | 159 ++ ...sVaultConnectionSendgridUninitialized.java | 137 + .../CreateFlowsVaultConnectionSlack.java | 110 + ...ateFlowsVaultConnectionSlackOauthCode.java | 162 ++ ...lowsVaultConnectionSlackUninitialized.java | 137 + ...reateFlowsVaultConnectionSlackWebhook.java | 162 ++ .../CreateFlowsVaultConnectionStripe.java | 110 + ...eateFlowsVaultConnectionStripeKeyPair.java | 162 ++ ...teFlowsVaultConnectionStripeOauthCode.java | 162 ++ ...owsVaultConnectionStripeUninitialized.java | 137 + .../CreateFlowsVaultConnectionTelegram.java | 98 + ...eateFlowsVaultConnectionTelegramToken.java | 159 ++ ...sVaultConnectionTelegramUninitialized.java | 137 + .../CreateFlowsVaultConnectionTwilio.java | 97 + ...reateFlowsVaultConnectionTwilioApiKey.java | 162 ++ ...owsVaultConnectionTwilioUninitialized.java | 137 + .../CreateFlowsVaultConnectionWhatsapp.java | 98 + ...eateFlowsVaultConnectionWhatsappToken.java | 159 ++ ...sVaultConnectionWhatsappUninitialized.java | 137 + .../CreateFlowsVaultConnectionZapier.java | 97 + ...owsVaultConnectionZapierUninitialized.java | 137 + ...eateFlowsVaultConnectionZapierWebhook.java | 162 ++ .../mgmt/types/CreateFormRequestContent.java | 56 +- .../mgmt/types/CreateFormResponseContent.java | 70 +- ...ardianEnrollmentTicketResponseContent.java | 6 +- .../mgmt/types/CreateHookRequestContent.java | 40 +- .../mgmt/types/CreateHookResponseContent.java | 18 +- .../CreateImportUsersResponseContent.java | 24 +- .../CreateLogStreamDatadogRequestBody.java | 34 +- ...CreateLogStreamEventBridgeRequestBody.java | 34 +- .../CreateLogStreamEventGridRequestBody.java | 34 +- .../types/CreateLogStreamHttpRequestBody.java | 34 +- .../CreateLogStreamMixpanelRequestBody.java | 34 +- .../types/CreateLogStreamRequestContent.java | 8 +- .../types/CreateLogStreamResponseContent.java | 8 +- .../CreateLogStreamSegmentRequestBody.java | 34 +- .../CreateLogStreamSplunkRequestBody.java | 34 +- .../types/CreateLogStreamSumoRequestBody.java | 34 +- .../types/CreateNetworkAclRequestContent.java | 18 +- ...izationDiscoveryDomainResponseContent.java | 247 ++ ...OrganizationInvitationResponseContent.java | 6 +- .../CreateOrganizationRequestContent.java | 49 +- .../CreateOrganizationResponseContent.java | 19 +- ...ePhoneProviderSendTestResponseContent.java | 6 +- .../CreatePhoneTemplateResponseContent.java | 30 +- ...mplateTestNotificationResponseContent.java | 12 +- ...blicKeyDeviceCredentialRequestContent.java | 22 +- ...licKeyDeviceCredentialResponseContent.java | 12 +- .../CreateResourceServerRequestContent.java | 113 +- .../CreateResourceServerResponseContent.java | 69 +- .../mgmt/types/CreateRoleRequestContent.java | 16 +- .../mgmt/types/CreateRoleResponseContent.java | 6 +- .../mgmt/types/CreateRuleRequestContent.java | 22 +- .../mgmt/types/CreateRuleResponseContent.java | 6 +- ...CreateScimConfigurationRequestContent.java | 6 +- ...reateScimConfigurationResponseContent.java | 6 +- .../types/CreateScimTokenResponseContent.java | 6 +- ...reateSelfServiceProfileRequestContent.java | 89 +- ...eateSelfServiceProfileResponseContent.java | 42 +- ...erviceProfileSsoTicketResponseContent.java | 6 +- ...ateTokenExchangeProfileRequestContent.java | 18 +- ...teTokenExchangeProfileResponseContent.java | 6 +- .../client/mgmt/types/CreateTokenQuota.java | 12 +- ...ateUserAttributeProfileRequestContent.java | 183 ++ ...teUserAttributeProfileResponseContent.java | 174 ++ ...erAuthenticationMethodResponseContent.java | 101 +- .../mgmt/types/CreateUserRequestContent.java | 76 +- .../mgmt/types/CreateUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- ...reateVerificationEmailResponseContent.java | 20 +- .../CreatedAuthenticationMethodTypeEnum.java | 6 +- ...eatedUserAuthenticationMethodTypeEnum.java | 6 +- .../auth0/client/mgmt/types/CredentialId.java | 12 +- .../auth0/client/mgmt/types/CustomDomain.java | 138 +- .../CustomDomainCustomClientIpHeaderEnum.java | 6 +- .../CustomDomainProvisioningTypeEnum.java | 6 +- .../types/CustomDomainStatusFilterEnum.java | 95 + .../mgmt/types/CustomDomainTypeEnum.java | 6 +- .../types/CustomProviderConfiguration.java | 6 +- .../mgmt/types/CustomProviderCredentials.java | 4 +- .../CustomProviderDeliveryMethodEnum.java | 6 +- .../types/CustomSigningKeyAlgorithmEnum.java | 6 +- .../mgmt/types/CustomSigningKeyCurveEnum.java | 6 +- .../mgmt/types/CustomSigningKeyJwk.java | 64 +- .../mgmt/types/CustomSigningKeyTypeEnum.java | 6 +- .../auth0/client/mgmt/types/DailyStats.java | 6 +- .../client/mgmt/types/DefaultTokenQuota.java | 6 +- .../types/DeleteActionRequestParameters.java | 6 +- ...erBlocksByIdentifierRequestParameters.java | 12 +- ...eteUserGrantByUserIdRequestParameters.java | 12 +- ...DeleteUserIdentityResponseContentItem.java | 36 +- .../types/DeployActionResponseContent.java | 14 +- .../DeployActionVersionRequestBodyParams.java | 6 +- .../DeployActionVersionResponseContent.java | 14 +- .../client/mgmt/types/DeviceCredential.java | 6 +- .../mgmt/types/DeviceCredentialTypeEnum.java | 6 +- .../DirectoryProvisioningMappingItem.java | 146 + .../client/mgmt/types/DomainCertificate.java | 181 ++ .../types/DomainCertificateAuthorityEnum.java | 86 + .../types/DomainCertificateStatusEnum.java | 108 + .../client/mgmt/types/DomainVerification.java | 99 +- .../mgmt/types/DomainVerificationMethod.java | 18 +- .../DomainVerificationMethodNameEnum.java | 6 +- .../types/DomainVerificationStatusEnum.java | 96 + .../client/mgmt/types/EmailAttribute.java | 41 +- .../mgmt/types/EmailProviderCredentials.java | 6 +- .../types/EmailProviderCredentialsSchema.java | 8 +- ...lProviderCredentialsSchemaAccessKeyId.java | 6 +- .../EmailProviderCredentialsSchemaApiKey.java | 6 +- ...mailProviderCredentialsSchemaClientId.java | 6 +- ...iderCredentialsSchemaConnectionString.java | 6 +- ...mailProviderCredentialsSchemaSmtpHost.java | 6 +- .../EmailProviderCredentialsSchemaThree.java | 6 +- .../EmailProviderCredentialsSchemaZero.java | 12 +- .../mgmt/types/EmailProviderNameEnum.java | 6 +- .../mgmt/types/EmailTemplateNameEnum.java | 6 +- .../mgmt/types/EnabledFeaturesEnum.java | 84 + .../client/mgmt/types/EncryptionKey.java | 26 +- .../client/mgmt/types/EncryptionKeyState.java | 6 +- .../client/mgmt/types/EncryptionKeyType.java | 6 +- .../types/EventStreamActionConfiguration.java | 12 +- .../types/EventStreamActionDestination.java | 14 +- .../EventStreamActionResponseContent.java | 6 +- .../mgmt/types/EventStreamBucketInterval.java | 112 - .../mgmt/types/EventStreamCloudEvent.java | 6 +- .../mgmt/types/EventStreamDelivery.java | 28 +- .../types/EventStreamDeliveryAttempt.java | 18 +- .../EventStreamDeliveryEventTypeEnum.java | 61 +- .../types/EventStreamDestinationPatch.java | 8 +- .../EventStreamEventBridgeAwsRegionEnum.java | 265 +- .../EventStreamEventBridgeConfiguration.java | 18 +- .../EventStreamEventBridgeDestination.java | 14 +- ...EventStreamEventBridgeResponseContent.java | 6 +- .../mgmt/types/EventStreamEventTypeEnum.java | 61 +- .../client/mgmt/types/EventStreamMetric.java | 244 -- .../types/EventStreamResponseContent.java | 8 +- .../mgmt/types/EventStreamStatusEnum.java | 6 +- .../mgmt/types/EventStreamSubscription.java | 6 +- .../types/EventStreamTestEventTypeEnum.java | 61 +- ...entStreamWebhookAuthorizationResponse.java | 8 +- .../types/EventStreamWebhookBasicAuth.java | 14 +- .../types/EventStreamWebhookBearerAuth.java | 12 +- .../EventStreamWebhookConfiguration.java | 14 +- .../types/EventStreamWebhookDestination.java | 14 +- .../EventStreamWebhookResponseContent.java | 6 +- .../client/mgmt/types/EventStreamWindow.java | 175 -- .../mgmt/types/EventStreamsCreateRequest.java | 8 +- .../types/EventStreamsGetStatsRequest.java | 195 -- .../mgmt/types/ExpressConfiguration.java | 444 +++ .../types/ExpressConfigurationOrNull.java | 444 +++ ...ExtensibilityEmailProviderCredentials.java | 4 +- .../types/FederatedConnectionTokenSet.java | 6 +- .../auth0/client/mgmt/types/FlowAction.java | 8 +- .../mgmt/types/FlowActionActivecampaign.java | 8 +- .../FlowActionActivecampaignListContacts.java | 26 +- ...ctionActivecampaignListContactsParams.java | 14 +- ...FlowActionActivecampaignUpsertContact.java | 26 +- ...tionActivecampaignUpsertContactParams.java | 30 +- .../client/mgmt/types/FlowActionAirtable.java | 8 +- .../types/FlowActionAirtableCreateRecord.java | 26 +- .../FlowActionAirtableCreateRecordParams.java | 20 +- .../types/FlowActionAirtableListRecords.java | 26 +- .../FlowActionAirtableListRecordsParams.java | 24 +- .../types/FlowActionAirtableUpdateRecord.java | 26 +- .../FlowActionAirtableUpdateRecordParams.java | 22 +- .../client/mgmt/types/FlowActionAuth0.java | 20 +- .../mgmt/types/FlowActionAuth0CreateUser.java | 26 +- .../FlowActionAuth0CreateUserParams.java | 18 +- .../mgmt/types/FlowActionAuth0GetUser.java | 26 +- .../types/FlowActionAuth0GetUserParams.java | 14 +- .../mgmt/types/FlowActionAuth0SendEmail.java | 230 ++ .../types/FlowActionAuth0SendEmailParams.java | 214 ++ .../FlowActionAuth0SendEmailParamsFrom.java | 134 + .../types/FlowActionAuth0SendRequest.java | 26 +- .../FlowActionAuth0SendRequestParams.java | 51 +- ...lowActionAuth0SendRequestParamsMethod.java | 6 +- ...owActionAuth0SendRequestParamsPayload.java | 8 +- ...uth0SendRequestParamsQueryParamsValue.java | 96 + .../mgmt/types/FlowActionAuth0UpdateUser.java | 26 +- .../FlowActionAuth0UpdateUserParams.java | 20 +- .../types/FlowActionBigqueryInsertRows.java | 26 +- .../FlowActionBigqueryInsertRowsParams.java | 20 +- .../client/mgmt/types/FlowActionClearbit.java | 8 +- .../types/FlowActionClearbitFindCompany.java | 26 +- .../FlowActionClearbitFindCompanyParams.java | 14 +- .../types/FlowActionClearbitFindPerson.java | 26 +- .../FlowActionClearbitFindPersonParams.java | 14 +- .../types/FlowActionEmailVerifyEmail.java | 26 +- .../FlowActionEmailVerifyEmailParams.java | 16 +- ...FlowActionEmailVerifyEmailParamsRules.java | 6 +- .../client/mgmt/types/FlowActionFlow.java | 8 +- .../types/FlowActionFlowBooleanCondition.java | 26 +- .../FlowActionFlowBooleanConditionParams.java | 6 +- .../mgmt/types/FlowActionFlowDelayFlow.java | 26 +- .../types/FlowActionFlowDelayFlowParams.java | 16 +- .../FlowActionFlowDelayFlowParamsNumber.java | 8 +- .../FlowActionFlowDelayFlowParamsUnits.java | 6 +- .../mgmt/types/FlowActionFlowDoNothing.java | 28 +- .../types/FlowActionFlowDoNothingParams.java | 4 +- .../types/FlowActionFlowErrorMessage.java | 26 +- .../FlowActionFlowErrorMessageParams.java | 12 +- .../mgmt/types/FlowActionFlowMapValue.java | 26 +- .../types/FlowActionFlowMapValueParams.java | 20 +- .../FlowActionFlowMapValueParamsFallback.java | 8 +- .../FlowActionFlowMapValueParamsInput.java | 8 +- .../mgmt/types/FlowActionFlowReturnJson.java | 26 +- .../types/FlowActionFlowReturnJsonParams.java | 12 +- ...FlowActionFlowReturnJsonParamsPayload.java | 8 +- .../mgmt/types/FlowActionFlowStoreVars.java | 26 +- .../types/FlowActionFlowStoreVarsParams.java | 6 +- .../types/FlowActionGoogleSheetsAddRow.java | 26 +- .../FlowActionGoogleSheetsAddRowParams.java | 22 +- ...ActionGoogleSheetsAddRowParamsSheetId.java | 8 +- .../mgmt/types/FlowActionHttpSendRequest.java | 26 +- .../FlowActionHttpSendRequestParams.java | 61 +- ...wActionHttpSendRequestParamsBasicAuth.java | 6 +- ...ctionHttpSendRequestParamsContentType.java | 6 +- ...FlowActionHttpSendRequestParamsMethod.java | 6 +- ...lowActionHttpSendRequestParamsPayload.java | 8 +- ...HttpSendRequestParamsQueryParamsValue.java | 96 + .../client/mgmt/types/FlowActionHubspot.java | 8 +- .../types/FlowActionHubspotEnrollContact.java | 26 +- .../FlowActionHubspotEnrollContactParams.java | 16 +- ...nHubspotEnrollContactParamsWorkflowId.java | 8 +- .../types/FlowActionHubspotGetContact.java | 26 +- .../FlowActionHubspotGetContactParams.java | 14 +- .../types/FlowActionHubspotUpsertContact.java | 26 +- .../FlowActionHubspotUpsertContactParams.java | 18 +- ...ionHubspotUpsertContactParamsProperty.java | 12 +- .../client/mgmt/types/FlowActionJson.java | 8 +- .../mgmt/types/FlowActionJsonCreateJson.java | 26 +- .../types/FlowActionJsonCreateJsonParams.java | 6 +- .../mgmt/types/FlowActionJsonParseJson.java | 26 +- .../types/FlowActionJsonParseJsonParams.java | 12 +- .../types/FlowActionJsonSerializeJson.java | 26 +- .../FlowActionJsonSerializeJsonParams.java | 12 +- ...owActionJsonSerializeJsonParamsObject.java | 8 +- .../client/mgmt/types/FlowActionJwt.java | 8 +- .../mgmt/types/FlowActionJwtDecodeJwt.java | 26 +- .../types/FlowActionJwtDecodeJwtParams.java | 12 +- .../mgmt/types/FlowActionJwtSignJwt.java | 26 +- .../types/FlowActionJwtSignJwtParams.java | 32 +- .../mgmt/types/FlowActionJwtVerifyJwt.java | 26 +- .../types/FlowActionJwtVerifyJwtParams.java | 22 +- .../FlowActionMailchimpUpsertMember.java | 26 +- ...FlowActionMailchimpUpsertMemberParams.java | 16 +- ...tionMailchimpUpsertMemberParamsMember.java | 18 +- .../types/FlowActionMailjetSendEmail.java | 26 +- .../FlowActionMailjetSendEmailParams.java | 8 +- ...owActionMailjetSendEmailParamsContent.java | 12 +- ...ctionMailjetSendEmailParamsTemplateId.java | 16 +- .../client/mgmt/types/FlowActionOtp.java | 8 +- .../mgmt/types/FlowActionOtpGenerateCode.java | 26 +- .../FlowActionOtpGenerateCodeParams.java | 14 +- .../mgmt/types/FlowActionOtpVerifyCode.java | 26 +- .../types/FlowActionOtpVerifyCodeParams.java | 14 +- .../FlowActionOtpVerifyCodeParamsCode.java | 8 +- .../mgmt/types/FlowActionPipedrive.java | 8 +- .../types/FlowActionPipedriveAddDeal.java | 26 +- .../FlowActionPipedriveAddDealParams.java | 38 +- ...nPipedriveAddDealParamsOrganizationId.java | 8 +- ...wActionPipedriveAddDealParamsPersonId.java | 8 +- ...owActionPipedriveAddDealParamsStageId.java | 8 +- ...lowActionPipedriveAddDealParamsUserId.java | 8 +- .../FlowActionPipedriveAddOrganization.java | 26 +- ...wActionPipedriveAddOrganizationParams.java | 22 +- ...PipedriveAddOrganizationParamsOwnerId.java | 8 +- .../types/FlowActionPipedriveAddPerson.java | 26 +- .../FlowActionPipedriveAddPersonParams.java | 34 +- ...ipedriveAddPersonParamsOrganizationId.java | 8 +- ...ActionPipedriveAddPersonParamsOwnerId.java | 8 +- .../mgmt/types/FlowActionSalesforce.java | 8 +- .../types/FlowActionSalesforceCreateLead.java | 26 +- .../FlowActionSalesforceCreateLeadParams.java | 32 +- .../types/FlowActionSalesforceGetLead.java | 26 +- .../FlowActionSalesforceGetLeadParams.java | 14 +- .../FlowActionSalesforceSearchLeads.java | 26 +- ...FlowActionSalesforceSearchLeadsParams.java | 22 +- ...alesforceSearchLeadsParamsSearchField.java | 6 +- .../types/FlowActionSalesforceUpdateLead.java | 26 +- .../FlowActionSalesforceUpdateLeadParams.java | 18 +- .../types/FlowActionSendgridSendEmail.java | 26 +- .../FlowActionSendgridSendEmailParams.java | 20 +- ...owActionSendgridSendEmailParamsPerson.java | 16 +- .../types/FlowActionSlackPostMessage.java | 26 +- .../FlowActionSlackPostMessageParams.java | 20 +- ...ctionSlackPostMessageParamsAttachment.java | 6 +- ...SlackPostMessageParamsAttachmentColor.java | 6 +- ...SlackPostMessageParamsAttachmentField.java | 20 +- .../client/mgmt/types/FlowActionStripe.java | 8 +- .../mgmt/types/FlowActionStripeAddTaxId.java | 26 +- .../types/FlowActionStripeAddTaxIdParams.java | 18 +- .../mgmt/types/FlowActionStripeAddress.java | 6 +- .../types/FlowActionStripeCreateCustomer.java | 26 +- .../FlowActionStripeCreateCustomerParams.java | 60 +- .../FlowActionStripeCreatePortalSession.java | 26 +- ...ActionStripeCreatePortalSessionParams.java | 18 +- .../types/FlowActionStripeDeleteTaxId.java | 26 +- .../FlowActionStripeDeleteTaxIdParams.java | 16 +- .../types/FlowActionStripeFindCustomers.java | 26 +- .../FlowActionStripeFindCustomersParams.java | 14 +- .../types/FlowActionStripeGetCustomer.java | 26 +- .../FlowActionStripeGetCustomerParams.java | 14 +- .../mgmt/types/FlowActionStripeTaxId.java | 14 +- .../types/FlowActionStripeUpdateCustomer.java | 26 +- .../FlowActionStripeUpdateCustomerParams.java | 58 +- .../types/FlowActionTelegramSendMessage.java | 26 +- .../FlowActionTelegramSendMessageParams.java | 16 +- .../client/mgmt/types/FlowActionTwilio.java | 8 +- .../mgmt/types/FlowActionTwilioMakeCall.java | 26 +- .../types/FlowActionTwilioMakeCallParams.java | 18 +- .../mgmt/types/FlowActionTwilioSendSms.java | 26 +- .../types/FlowActionTwilioSendSmsParams.java | 18 +- .../types/FlowActionWhatsappSendMessage.java | 26 +- .../FlowActionWhatsappSendMessageParams.java | 20 +- ...ctionWhatsappSendMessageParamsPayload.java | 8 +- ...owActionWhatsappSendMessageParamsType.java | 6 +- .../client/mgmt/types/FlowActionXml.java | 8 +- .../mgmt/types/FlowActionXmlParseXml.java | 26 +- .../types/FlowActionXmlParseXmlParams.java | 12 +- .../mgmt/types/FlowActionXmlSerializeXml.java | 26 +- .../FlowActionXmlSerializeXmlParams.java | 12 +- ...FlowActionXmlSerializeXmlParamsObject.java | 8 +- .../types/FlowActionZapierTriggerWebhook.java | 26 +- .../FlowActionZapierTriggerWebhookParams.java | 16 +- ...ctionZapierTriggerWebhookParamsMethod.java | 6 +- .../mgmt/types/FlowExecutionSummary.java | 32 +- .../auth0/client/mgmt/types/FlowSummary.java | 22 +- .../client/mgmt/types/FlowsListRequest.java | 17 +- .../types/FlowsVaultConnectioSetupApiKey.java | 124 + ...sVaultConnectioSetupApiKeyWithBaseUrl.java | 148 + ...wsVaultConnectioSetupBigqueryOauthJwt.java | 171 ++ .../FlowsVaultConnectioSetupHttpBearer.java | 125 + .../types/FlowsVaultConnectioSetupJwt.java | 125 + ...wsVaultConnectioSetupJwtAlgorithmEnum.java | 196 ++ ...FlowsVaultConnectioSetupMailjetApiKey.java | 148 + .../FlowsVaultConnectioSetupOauthApp.java | 209 ++ .../FlowsVaultConnectioSetupOauthCode.java | 118 + .../FlowsVaultConnectioSetupSecretApiKey.java | 126 + ...FlowsVaultConnectioSetupStripeKeyPair.java | 148 + .../types/FlowsVaultConnectioSetupToken.java | 124 + .../FlowsVaultConnectioSetupTwilioApiKey.java | 148 + .../FlowsVaultConnectioSetupWebhook.java | 124 + .../types/FlowsVaultConnectionSummary.java | 430 +++ .../auth0/client/mgmt/types/FormBlock.java | 8 +- .../client/mgmt/types/FormBlockDivider.java | 20 +- .../mgmt/types/FormBlockDividerConfig.java | 6 +- .../client/mgmt/types/FormBlockHtml.java | 20 +- .../mgmt/types/FormBlockHtmlConfig.java | 6 +- .../client/mgmt/types/FormBlockImage.java | 20 +- .../mgmt/types/FormBlockImageConfig.java | 20 +- .../FormBlockImageConfigPositionEnum.java | 6 +- .../mgmt/types/FormBlockJumpButton.java | 18 +- .../mgmt/types/FormBlockJumpButtonConfig.java | 18 +- .../types/FormBlockJumpButtonConfigStyle.java | 6 +- .../mgmt/types/FormBlockNextButton.java | 18 +- .../mgmt/types/FormBlockNextButtonConfig.java | 12 +- .../mgmt/types/FormBlockPreviousButton.java | 18 +- .../types/FormBlockPreviousButtonConfig.java | 12 +- .../mgmt/types/FormBlockResendButton.java | 18 +- .../types/FormBlockResendButtonConfig.java | 30 +- ...ckResendButtonConfigTextAlignmentEnum.java | 6 +- .../client/mgmt/types/FormBlockRichText.java | 20 +- .../mgmt/types/FormBlockRichTextConfig.java | 6 +- .../client/mgmt/types/FormComponent.java | 8 +- .../client/mgmt/types/FormEndingNode.java | 6 +- .../mgmt/types/FormEndingNodeAfterSubmit.java | 6 +- .../mgmt/types/FormEndingNodeRedirection.java | 16 +- .../auth0/client/mgmt/types/FormField.java | 8 +- .../client/mgmt/types/FormFieldBoolean.java | 34 +- .../mgmt/types/FormFieldBooleanConfig.java | 6 +- .../types/FormFieldBooleanConfigOptions.java | 6 +- .../client/mgmt/types/FormFieldCards.java | 36 +- .../mgmt/types/FormFieldCardsConfig.java | 6 +- .../types/FormFieldCardsConfigOption.java | 16 +- .../client/mgmt/types/FormFieldChoice.java | 36 +- .../mgmt/types/FormFieldChoiceConfig.java | 6 +- .../FormFieldChoiceConfigAllowOther.java | 6 +- .../types/FormFieldChoiceConfigOption.java | 14 +- .../client/mgmt/types/FormFieldCustom.java | 34 +- .../mgmt/types/FormFieldCustomConfig.java | 42 +- .../client/mgmt/types/FormFieldDate.java | 34 +- .../mgmt/types/FormFieldDateConfig.java | 6 +- .../types/FormFieldDateConfigFormatEnum.java | 6 +- .../client/mgmt/types/FormFieldDropdown.java | 36 +- .../mgmt/types/FormFieldDropdownConfig.java | 6 +- .../types/FormFieldDropdownConfigOption.java | 14 +- .../client/mgmt/types/FormFieldEmail.java | 36 +- .../mgmt/types/FormFieldEmailConfig.java | 6 +- .../client/mgmt/types/FormFieldFile.java | 36 +- .../mgmt/types/FormFieldFileConfig.java | 6 +- .../FormFieldFileConfigCategoryEnum.java | 6 +- .../types/FormFieldFileConfigStorage.java | 12 +- .../FormFieldFileConfigStorageTypeEnum.java | 6 +- .../client/mgmt/types/FormFieldLegal.java | 36 +- .../mgmt/types/FormFieldLegalConfig.java | 6 +- .../client/mgmt/types/FormFieldNumber.java | 36 +- .../mgmt/types/FormFieldNumberConfig.java | 6 +- .../client/mgmt/types/FormFieldPassword.java | 34 +- .../mgmt/types/FormFieldPasswordConfig.java | 6 +- .../FormFieldPasswordConfigHashEnum.java | 6 +- .../client/mgmt/types/FormFieldPayment.java | 34 +- .../mgmt/types/FormFieldPaymentConfig.java | 26 +- .../types/FormFieldPaymentConfigCharge.java | 8 +- .../FormFieldPaymentConfigChargeOneOff.java | 14 +- ...PaymentConfigChargeOneOffCurrencyEnum.java | 6 +- ...mFieldPaymentConfigChargeOneOffOneOff.java | 14 +- ...PaymentConfigChargeOneOffOneOffAmount.java | 8 +- ...mFieldPaymentConfigChargeSubscription.java | 18 +- .../FormFieldPaymentConfigCredentials.java | 14 +- ...FormFieldPaymentConfigFieldProperties.java | 6 +- .../types/FormFieldPaymentConfigFields.java | 6 +- .../client/mgmt/types/FormFieldSocial.java | 36 +- .../mgmt/types/FormFieldSocialConfig.java | 4 +- .../auth0/client/mgmt/types/FormFieldTel.java | 36 +- .../client/mgmt/types/FormFieldTelConfig.java | 6 +- .../mgmt/types/FormFieldTelConfigStrings.java | 6 +- .../client/mgmt/types/FormFieldText.java | 36 +- .../mgmt/types/FormFieldTextConfig.java | 6 +- .../auth0/client/mgmt/types/FormFieldUrl.java | 36 +- .../client/mgmt/types/FormFieldUrlConfig.java | 6 +- .../com/auth0/client/mgmt/types/FormFlow.java | 24 +- .../client/mgmt/types/FormFlowConfig.java | 16 +- .../client/mgmt/types/FormHiddenField.java | 16 +- .../client/mgmt/types/FormLanguages.java | 6 +- .../auth0/client/mgmt/types/FormMessages.java | 30 +- .../com/auth0/client/mgmt/types/FormNode.java | 8 +- .../mgmt/types/FormNodeCoordinates.java | 14 +- .../client/mgmt/types/FormNodePointer.java | 8 +- .../auth0/client/mgmt/types/FormRouter.java | 26 +- .../client/mgmt/types/FormRouterConfig.java | 6 +- .../client/mgmt/types/FormRouterRule.java | 20 +- .../client/mgmt/types/FormStartNode.java | 6 +- .../com/auth0/client/mgmt/types/FormStep.java | 26 +- .../client/mgmt/types/FormStepConfig.java | 6 +- .../auth0/client/mgmt/types/FormStyle.java | 6 +- .../auth0/client/mgmt/types/FormSummary.java | 26 +- .../auth0/client/mgmt/types/FormWidget.java | 8 +- .../FormWidgetAuth0VerifiableCredentials.java | 34 +- ...idgetAuth0VerifiableCredentialsConfig.java | 26 +- .../mgmt/types/FormWidgetGMapsAddress.java | 34 +- .../types/FormWidgetGMapsAddressConfig.java | 12 +- .../mgmt/types/FormWidgetRecaptcha.java | 34 +- .../mgmt/types/FormWidgetRecaptchaConfig.java | 14 +- .../FormsRequestParametersHydrateEnum.java | 6 +- .../GetActionExecutionResponseContent.java | 6 +- .../mgmt/types/GetActionResponseContent.java | 10 +- .../GetActionVersionResponseContent.java | 14 +- .../mgmt/types/GetAculResponseContent.java | 124 +- ...ttackProtectionCaptchaResponseContent.java | 287 ++ ...etBotDetectionSettingsResponseContent.java | 275 ++ ...etBrandingDefaultThemeResponseContent.java | 24 +- ...tBrandingPhoneProviderResponseContent.java | 40 +- .../types/GetBrandingResponseContent.java | 6 +- .../GetBrandingThemeResponseContent.java | 24 +- ...swordDetectionSettingsResponseContent.java | 6 +- .../GetBruteForceSettingsResponseContent.java | 6 +- ...BruteForceSettingsResponseContentMode.java | 6 +- ...rceSettingsResponseContentShieldsItem.java | 6 +- .../GetClientCredentialResponseContent.java | 6 +- .../types/GetClientRequestParameters.java | 6 +- .../mgmt/types/GetClientResponseContent.java | 251 +- ...nnectionEnabledClientsResponseContent.java | 6 +- .../GetConnectionProfileResponseContent.java | 258 ++ ...nectionProfileTemplateResponseContent.java | 156 ++ .../types/GetConnectionRequestParameters.java | 6 +- .../types/GetConnectionResponseContent.java | 75 +- .../types/GetCustomDomainResponseContent.java | 138 +- .../GetCustomSigningKeysResponseContent.java | 6 +- .../types/GetDailyStatsRequestParameters.java | 6 +- ...isioningDefaultMappingResponseContent.java | 104 + ...tDirectoryProvisioningResponseContent.java | 513 ++++ .../GetEmailProviderResponseContent.java | 6 +- .../GetEmailTemplateResponseContent.java | 6 +- .../GetEncryptionKeyResponseContent.java | 26 +- ...tStreamDeliveryHistoryResponseContent.java | 28 +- .../types/GetEventStreamResponseContent.java | 8 +- .../GetEventStreamStatsResponseContent.java | 299 -- .../GetFlowExecutionResponseContent.java | 36 +- .../mgmt/types/GetFlowRequestParameters.java | 6 +- .../GetFlowRequestParametersHydrateEnum.java | 6 +- .../mgmt/types/GetFlowResponseContent.java | 26 +- ...etFlowsVaultConnectionResponseContent.java | 476 ++++ .../mgmt/types/GetFormRequestParameters.java | 6 +- .../mgmt/types/GetFormResponseContent.java | 70 +- .../GetGuardianEnrollmentResponseContent.java | 36 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...actorPhoneMessageTypesResponseContent.java | 6 +- ...anFactorPhoneTemplatesResponseContent.java | 14 +- ...dianFactorSmsTemplatesResponseContent.java | 14 +- ...ianFactorsProviderApnsResponseContent.java | 6 +- ...anFactorsProviderPhoneResponseContent.java | 6 +- ...orsProviderPhoneTwilioResponseContent.java | 6 +- ...oviderPushNotificationResponseContent.java | 6 +- ...dianFactorsProviderSmsResponseContent.java | 6 +- ...ctorsProviderSmsTwilioResponseContent.java | 6 +- ...dianFactorsProviderSnsResponseContent.java | 6 +- .../mgmt/types/GetHookRequestParameters.java | 6 +- .../mgmt/types/GetHookResponseContent.java | 18 +- .../types/GetJobErrorResponseContent.java | 6 +- .../GetJobGenericErrorResponseContent.java | 28 +- .../mgmt/types/GetJobImportUserError.java | 6 +- .../mgmt/types/GetJobResponseContent.java | 44 +- .../mgmt/types/GetLogResponseContent.java | 6 +- .../types/GetLogStreamResponseContent.java | 8 +- .../types/GetNetworkAclsResponseContent.java | 6 +- .../GetOrganizationByNameResponseContent.java | 19 +- ...OrganizationConnectionResponseContent.java | 6 +- ...izationDiscoveryDomainResponseContent.java | 247 ++ ...OrganizationInvitationResponseContent.java | 6 +- .../types/GetOrganizationResponseContent.java | 19 +- .../GetPhoneTemplateResponseContent.java | 30 +- .../types/GetRefreshTokenResponseContent.java | 6 +- .../GetResourceServerRequestParameters.java | 6 +- .../GetResourceServerResponseContent.java | 69 +- ...mentsSettingsNewDeviceResponseContent.java | 114 + ...iskAssessmentsSettingsResponseContent.java | 113 + .../mgmt/types/GetRoleResponseContent.java | 6 +- .../mgmt/types/GetRuleRequestParameters.java | 6 +- .../mgmt/types/GetRuleResponseContent.java | 6 +- ...gurationDefaultMappingResponseContent.java | 6 +- .../GetScimConfigurationResponseContent.java | 6 +- .../GetSelfServiceProfileResponseContent.java | 42 +- .../mgmt/types/GetSessionResponseContent.java | 69 +- .../types/GetSettingsResponseContent.java | 6 +- .../types/GetSigningKeysResponseContent.java | 50 +- ...GetSupplementalSignalsResponseContent.java | 6 +- ...usIpThrottlingSettingsResponseContent.java | 6 +- .../GetTenantSettingsResponseContent.java | 111 +- ...etTokenExchangeProfileResponseContent.java | 6 +- .../mgmt/types/GetUniversalLoginTemplate.java | 6 +- ...UniversalLoginTemplateResponseContent.java | 8 +- ...etUserAttributeProfileResponseContent.java | 173 ++ ...tributeProfileTemplateResponseContent.java | 156 ++ ...erAuthenticationMethodResponseContent.java | 170 +- .../mgmt/types/GetUserRequestParameters.java | 6 +- .../mgmt/types/GetUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- .../com/auth0/client/mgmt/types/Group.java | 429 +++ .../types/GuardianEnrollmentFactorEnum.java | 6 +- .../mgmt/types/GuardianEnrollmentStatus.java | 6 +- .../client/mgmt/types/GuardianFactor.java | 20 +- .../mgmt/types/GuardianFactorNameEnum.java | 6 +- ...rdianFactorPhoneFactorMessageTypeEnum.java | 6 +- ...viderPushNotificationProviderDataEnum.java | 6 +- ...uardianFactorsProviderSmsProviderEnum.java | 6 +- .../com/auth0/client/mgmt/types/Hook.java | 18 +- .../client/mgmt/types/HookTriggerIdEnum.java | 6 +- .../client/mgmt/types/HttpCustomHeader.java | 6 +- .../client/mgmt/types/IConnectionCommon.java | 27 + .../mgmt/types/IConnectionOptionsCommon.java | 11 + .../types/IConnectionOptionsCommonOidc.java | 51 + .../mgmt/types/IConnectionResponseCommon.java | 10 + .../mgmt/types/ICreateConnectionCommon.java | 10 + .../com/auth0/client/mgmt/types/IGroup.java | 28 + .../com/auth0/client/mgmt/types/Identity.java | 71 +- .../mgmt/types/IdentityProviderEnum.java | 6 +- .../ImportEncryptionKeyResponseContent.java | 26 +- .../auth0/client/mgmt/types/Integration.java | 6 +- .../types/IntegrationFeatureTypeEnum.java | 6 +- .../client/mgmt/types/IntegrationRelease.java | 6 +- .../mgmt/types/IntegrationRequiredParam.java | 6 +- .../types/IntegrationRequiredParamOption.java | 6 +- .../IntegrationRequiredParamTypeEnum.java | 6 +- .../client/mgmt/types/IntegrationSemVer.java | 6 +- .../client/mgmt/types/JobFileFormatEnum.java | 6 +- .../mgmt/types/LinkedClientConfiguration.java | 113 + ...ctionBindingsPaginatedResponseContent.java | 6 +- .../ListActionTriggersResponseContent.java | 6 +- ...ctionVersionsPaginatedResponseContent.java | 6 +- .../ListActionsPaginatedResponseContent.java | 6 +- .../types/ListActionsRequestParameters.java | 17 +- ...stAculsOffsetPaginatedResponseContent.java | 6 +- ...BrandingPhoneProvidersResponseContent.java | 6 +- .../ListClientConnectionsResponseContent.java | 6 +- ...OrganizationsPaginatedResponseContent.java | 6 +- ...stClientGrantPaginatedResponseContent.java | 6 +- .../ListClientGrantsRequestParameters.java | 73 +- ...ClientsOffsetPaginatedResponseContent.java | 6 +- .../types/ListClientsRequestParameters.java | 17 +- ...istConnectionProfileRequestParameters.java | 185 ++ ...nectionProfileTemplateResponseContent.java | 100 + ...ctionProfilesPaginatedResponseContent.java | 128 + ...onsCheckpointPaginatedResponseContent.java | 6 +- .../types/ListConnectionsQueryParameters.java | 6 +- .../ListCustomDomainsRequestParameters.java | 429 +++ ...entialsOffsetPaginatedResponseContent.java | 6 +- ...istDeviceCredentialsRequestParameters.java | 45 +- ...tionKeyOffsetPaginatedResponseContent.java | 6 +- .../ListEventStreamsRequestParameters.java | 6 +- ...lowExecutionsPaginatedResponseContent.java | 6 +- ...stFlowsOffsetPaginatedResponseContent.java | 6 +- ...ectionsOffsetPaginatedResponseContent.java | 172 ++ ...stFormsOffsetPaginatedResponseContent.java | 6 +- .../types/ListFormsRequestParameters.java | 17 +- ...stHooksOffsetPaginatedResponseContent.java | 6 +- .../types/ListHooksRequestParameters.java | 37 +- ...ListLogOffsetPaginatedResponseContent.java | 6 +- .../mgmt/types/ListLogsRequestParameters.java | 105 +- ...orkAclsOffsetPaginatedResponseContent.java | 6 +- .../ListNetworkAclsRequestParameters.java | 25 +- ...tGrantsOffsetPaginatedResponseContent.java | 6 +- ...ectionsOffsetPaginatedResponseContent.java | 6 +- ...zationDiscoveryDomainsResponseContent.java | 133 + ...tationsOffsetPaginatedResponseContent.java | 6 +- ...erRolesOffsetPaginatedResponseContent.java | 6 +- ...zationMembersPaginatedResponseContent.java | 6 +- ...OrganizationsPaginatedResponseContent.java | 6 +- .../ListOrganizationsRequestParameters.java | 6 +- .../ListPhoneTemplatesResponseContent.java | 6 +- ...RefreshTokensPaginatedResponseContent.java | 6 +- ...eServerOffsetPaginatedResponseContent.java | 6 +- .../ListResourceServerRequestParameters.java | 17 +- ...issionsOffsetPaginatedResponseContent.java | 6 +- ...ListRoleUsersPaginatedResponseContent.java | 6 +- ...stRolesOffsetPaginatedResponseContent.java | 6 +- .../types/ListRolesRequestParameters.java | 17 +- ...stRulesOffsetPaginatedResponseContent.java | 6 +- .../types/ListRulesRequestParameters.java | 37 +- ...rviceProfilesPaginatedResponseContent.java | 6 +- ...tSelfServiceProfilesRequestParameters.java | 25 +- ...stTokenExchangeProfileResponseContent.java | 6 +- ...UserAttributeProfileRequestParameters.java | 185 ++ ...tributeProfileTemplateResponseContent.java | 102 + ...ibuteProfilesPaginatedResponseContent.java | 129 + ...MethodsOffsetPaginatedResponseContent.java | 6 +- ...erBlocksByIdentifierRequestParameters.java | 20 +- ...UserBlocksByIdentifierResponseContent.java | 6 +- .../ListUserBlocksRequestParameters.java | 6 +- .../types/ListUserBlocksResponseContent.java | 6 +- ...tUserConnectedAccountsResponseContent.java | 137 + ...rGrantsOffsetPaginatedResponseContent.java | 6 +- .../ListUserGrantsRequestParameters.java | 17 +- ...zationsOffsetPaginatedResponseContent.java | 6 +- ...issionsOffsetPaginatedResponseContent.java | 6 +- ...erRolesOffsetPaginatedResponseContent.java | 6 +- ...tUserSessionsPaginatedResponseContent.java | 6 +- .../ListUsersByEmailRequestParameters.java | 28 +- ...stUsersOffsetPaginatedResponseContent.java | 6 +- .../types/ListUsersRequestParameters.java | 54 +- ...tialTemplatesPaginatedResponseContent.java | 6 +- .../java/com/auth0/client/mgmt/types/Log.java | 6 +- .../com/auth0/client/mgmt/types/LogDate.java | 8 +- .../client/mgmt/types/LogLocationInfo.java | 6 +- .../client/mgmt/types/LogSecurityContext.java | 6 +- .../types/LogStreamDatadogRegionEnum.java | 6 +- .../types/LogStreamDatadogResponseSchema.java | 6 +- .../mgmt/types/LogStreamDatadogSink.java | 14 +- .../LogStreamEventBridgeResponseSchema.java | 6 +- .../mgmt/types/LogStreamEventBridgeSink.java | 18 +- .../LogStreamEventBridgeSinkRegionEnum.java | 247 +- .../types/LogStreamEventGridRegionEnum.java | 6 +- .../LogStreamEventGridResponseSchema.java | 6 +- .../mgmt/types/LogStreamEventGridSink.java | 20 +- .../client/mgmt/types/LogStreamFilter.java | 6 +- .../types/LogStreamFilterGroupNameEnum.java | 6 +- .../types/LogStreamHttpContentFormatEnum.java | 6 +- .../types/LogStreamHttpResponseSchema.java | 6 +- .../client/mgmt/types/LogStreamHttpSink.java | 28 +- .../types/LogStreamMixpanelRegionEnum.java | 6 +- .../LogStreamMixpanelResponseSchema.java | 6 +- .../mgmt/types/LogStreamMixpanelSink.java | 18 +- .../types/LogStreamMixpanelSinkPatch.java | 20 +- .../client/mgmt/types/LogStreamPiiConfig.java | 6 +- .../mgmt/types/LogStreamPiiLogFieldsEnum.java | 6 +- .../mgmt/types/LogStreamPiiMethodEnum.java | 6 +- .../mgmt/types/LogStreamResponseSchema.java | 8 +- .../types/LogStreamSegmentResponseSchema.java | 6 +- .../mgmt/types/LogStreamSegmentSink.java | 6 +- .../types/LogStreamSegmentSinkWriteKey.java | 12 +- .../client/mgmt/types/LogStreamSinkPatch.java | 8 +- .../types/LogStreamSplunkResponseSchema.java | 6 +- .../mgmt/types/LogStreamSplunkSink.java | 18 +- .../mgmt/types/LogStreamStatusEnum.java | 6 +- .../types/LogStreamSumoResponseSchema.java | 6 +- .../client/mgmt/types/LogStreamSumoSink.java | 12 +- .../mgmt/types/MdlPresentationProperties.java | 6 +- .../mgmt/types/MdlPresentationRequest.java | 12 +- .../MdlPresentationRequestProperties.java | 12 +- .../client/mgmt/types/MfaPolicyEnum.java | 6 +- .../client/mgmt/types/NativeSocialLogin.java | 6 +- .../mgmt/types/NativeSocialLoginApple.java | 6 +- .../mgmt/types/NativeSocialLoginFacebook.java | 6 +- .../mgmt/types/NativeSocialLoginGoogle.java | 6 +- .../client/mgmt/types/NetworkAclAction.java | 6 +- .../client/mgmt/types/NetworkAclMatch.java | 6 +- .../client/mgmt/types/NetworkAclRule.java | 22 +- .../mgmt/types/NetworkAclRuleScopeEnum.java | 17 +- .../types/NetworkAclsResponseContent.java | 6 +- .../auth0/client/mgmt/types/OauthScope.java | 135 +- .../auth0/client/mgmt/types/Organization.java | 19 +- .../types/OrganizationAccessLevelEnum.java | 105 - .../mgmt/types/OrganizationBranding.java | 6 +- .../types/OrganizationBrandingColors.java | 14 +- .../mgmt/types/OrganizationClientGrant.java | 6 +- .../mgmt/types/OrganizationConnection.java | 100 +- .../OrganizationConnectionInformation.java | 6 +- .../types/OrganizationDiscoveryDomain.java | 246 ++ .../OrganizationDiscoveryDomainStatus.java | 86 + .../types/OrganizationEnabledConnection.java | 6 +- .../mgmt/types/OrganizationInvitation.java | 6 +- .../types/OrganizationInvitationInvitee.java | 12 +- .../types/OrganizationInvitationInviter.java | 12 +- .../client/mgmt/types/OrganizationMember.java | 6 +- .../mgmt/types/OrganizationMemberRole.java | 6 +- .../mgmt/types/OrganizationUsageEnum.java | 6 +- .../client/mgmt/types/PartialGroupsEnum.java | 6 +- .../types/PartialPhoneTemplateContent.java | 6 +- .../PatchClientCredentialResponseContent.java | 6 +- ...tchSupplementalSignalsResponseContent.java | 6 +- .../mgmt/types/PermissionRequestPayload.java | 14 +- .../types/PermissionsResponsePayload.java | 6 +- .../client/mgmt/types/PhoneAttribute.java | 6 +- .../types/PhoneProviderConfiguration.java | 8 +- .../mgmt/types/PhoneProviderCredentials.java | 8 +- .../PhoneProviderDeliveryMethodEnum.java | 6 +- .../mgmt/types/PhoneProviderNameEnum.java | 6 +- .../mgmt/types/PhoneProviderSchemaMasked.java | 40 +- .../client/mgmt/types/PhoneTemplate.java | 30 +- .../client/mgmt/types/PhoneTemplateBody.java | 6 +- .../mgmt/types/PhoneTemplateContent.java | 6 +- .../PhoneTemplateNotificationTypeEnum.java | 6 +- .../PostClientCredentialResponseContent.java | 6 +- .../PreferredAuthenticationMethodEnum.java | 6 +- .../client/mgmt/types/PrivateKeyJwt.java | 6 +- .../mgmt/types/PromptGroupNameEnum.java | 17 +- .../client/mgmt/types/PromptLanguageEnum.java | 6 +- .../mgmt/types/PublicKeyCredential.java | 30 +- .../PublicKeyCredentialAlgorithmEnum.java | 6 +- .../client/mgmt/types/RefreshTokenDate.java | 8 +- .../client/mgmt/types/RefreshTokenDevice.java | 6 +- .../types/RefreshTokenExpirationTypeEnum.java | 6 +- .../types/RefreshTokenResourceServer.java | 6 +- .../types/RefreshTokenResponseContent.java | 6 +- .../types/RefreshTokenRotationTypeEnum.java | 6 +- ...erateUsersRecoveryCodeResponseContent.java | 6 +- .../ResetPhoneTemplateResponseContent.java | 30 +- .../client/mgmt/types/ResourceServer.java | 69 +- .../ResourceServerProofOfPossession.java | 14 +- ...eServerProofOfPossessionMechanismEnum.java | 6 +- .../mgmt/types/ResourceServerScope.java | 16 +- ...esourceServerSubjectTypeAuthorization.java | 121 + ...eServerSubjectTypeAuthorizationClient.java | 98 + ...jectTypeAuthorizationClientPolicyEnum.java | 87 + ...rceServerSubjectTypeAuthorizationUser.java | 98 + ...ubjectTypeAuthorizationUserPolicyEnum.java | 98 + ...esourceServerTokenDialectResponseEnum.java | 6 +- .../ResourceServerTokenDialectSchemaEnum.java | 6 +- .../types/ResourceServerTokenEncryption.java | 14 +- ...rceServerTokenEncryptionAlgorithmEnum.java | 6 +- .../ResourceServerTokenEncryptionKey.java | 22 +- .../types/RevokeUserAccessRequestContent.java | 6 +- .../RevokedSigningKeysResponseContent.java | 14 +- .../com/auth0/client/mgmt/types/Role.java | 6 +- .../com/auth0/client/mgmt/types/RoleUser.java | 6 +- .../RotateClientSecretResponseContent.java | 251 +- .../RotateConnectionKeysRequestContent.java | 6 +- .../RotateConnectionKeysSigningAlgEnum.java | 6 +- .../RotateConnectionsKeysResponseContent.java | 38 +- .../RotateSigningKeysResponseContent.java | 14 +- .../com/auth0/client/mgmt/types/Rule.java | 6 +- .../auth0/client/mgmt/types/RulesConfig.java | 6 +- .../client/mgmt/types/ScimMappingItem.java | 6 +- .../client/mgmt/types/ScimTokenItem.java | 6 +- .../mgmt/types/ScreenGroupNameEnum.java | 61 +- .../mgmt/types/SearchEngineVersionsEnum.java | 6 +- .../client/mgmt/types/SelfServiceProfile.java | 42 +- ...SelfServiceProfileAllowedStrategyEnum.java | 6 +- .../SelfServiceProfileBrandingColors.java | 12 +- .../SelfServiceProfileBrandingProperties.java | 6 +- ...rviceProfileSsoTicketConnectionConfig.java | 52 +- ...viceProfileSsoTicketConnectionOptions.java | 6 +- ...ceProfileSsoTicketDomainAliasesConfig.java | 12 +- ...rofileSsoTicketDomainVerificationEnum.java | 6 +- ...ceProfileSsoTicketEnabledOrganization.java | 20 +- ...ProfileSsoTicketGoogleWorkspaceConfig.java | 114 + ...oTicketIdpInitiatedClientProtocolEnum.java | 6 +- ...ceProfileSsoTicketIdpInitiatedOptions.java | 6 +- ...iceProfileSsoTicketProvisioningConfig.java | 57 +- ...ProfileSsoTicketProvisioningScopeEnum.java | 6 +- .../SelfServiceProfileUserAttribute.java | 16 +- .../types/SessionAuthenticationSignal.java | 6 +- .../types/SessionAuthenticationSignals.java | 6 +- .../mgmt/types/SessionClientMetadata.java | 6 +- .../mgmt/types/SessionCookieMetadata.java | 6 +- .../types/SessionCookieMetadataModeEnum.java | 6 +- .../mgmt/types/SessionCookieModeEnum.java | 6 +- .../mgmt/types/SessionCookieSchema.java | 12 +- .../auth0/client/mgmt/types/SessionDate.java | 8 +- .../mgmt/types/SessionDeviceMetadata.java | 6 +- .../mgmt/types/SessionResponseContent.java | 69 +- .../SetCustomSigningKeysResponseContent.java | 6 +- .../types/SetEmailTemplateRequestContent.java | 72 +- .../SetEmailTemplateResponseContent.java | 72 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...actorPhoneMessageTypesResponseContent.java | 6 +- ...anFactorPhoneTemplatesResponseContent.java | 14 +- .../SetGuardianFactorResponseContent.java | 12 +- ...dianFactorSmsTemplatesResponseContent.java | 14 +- ...anFactorsProviderPhoneResponseContent.java | 6 +- ...orsProviderPhoneTwilioResponseContent.java | 6 +- ...derPushNotificationApnsRequestContent.java | 6 +- ...erPushNotificationApnsResponseContent.java | 6 +- ...iderPushNotificationFcmRequestContent.java | 6 +- ...erPushNotificationFcmv1RequestContent.java | 6 +- ...oviderPushNotificationResponseContent.java | 6 +- ...derPushNotificationSnsResponseContent.java | 6 +- ...dianFactorsProviderSmsResponseContent.java | 6 +- ...ctorsProviderSmsTwilioResponseContent.java | 6 +- .../types/SetNetworkAclRequestContent.java | 18 +- .../types/SetNetworkAclsResponseContent.java | 6 +- .../types/SetRulesConfigRequestContent.java | 12 +- .../types/SetRulesConfigResponseContent.java | 14 +- ...erAuthenticationMethodResponseContent.java | 101 +- .../types/SetUserAuthenticationMethods.java | 32 +- .../mgmt/types/SigningAlgorithmEnum.java | 6 +- .../auth0/client/mgmt/types/SigningKeys.java | 50 +- .../client/mgmt/types/SigningKeysDate.java | 8 +- .../auth0/client/mgmt/types/SignupSchema.java | 6 +- .../client/mgmt/types/SignupStatusEnum.java | 6 +- .../client/mgmt/types/SignupVerification.java | 6 +- .../client/mgmt/types/SignupVerified.java | 6 +- .../client/mgmt/types/SupportedLocales.java | 6 +- .../SuspiciousIpThrottlingPreLoginStage.java | 6 +- ...sIpThrottlingPreUserRegistrationStage.java | 6 +- .../SuspiciousIpThrottlingShieldsEnum.java | 6 +- .../types/SuspiciousIpThrottlingStage.java | 6 +- .../mgmt/types/TenantOidcLogoutSettings.java | 6 +- .../mgmt/types/TenantSettingsDeviceFlow.java | 6 +- .../TenantSettingsDeviceFlowCharset.java | 6 +- .../mgmt/types/TenantSettingsErrorPage.java | 6 +- .../mgmt/types/TenantSettingsFlags.java | 6 +- .../types/TenantSettingsGuardianPage.java | 6 +- .../client/mgmt/types/TenantSettingsMtls.java | 6 +- .../types/TenantSettingsPasswordPage.java | 6 +- ...enantSettingsResourceParameterProfile.java | 86 + .../mgmt/types/TenantSettingsSessions.java | 6 +- .../mgmt/types/TestActionRequestContent.java | 6 +- .../mgmt/types/TestActionResponseContent.java | 6 +- .../TestCustomDomainResponseContent.java | 16 +- .../TokenExchangeProfileResponseContent.java | 6 +- .../TokenExchangeProfilesListRequest.java | 6 +- .../auth0/client/mgmt/types/TokenQuota.java | 12 +- .../types/TokenQuotaClientCredentials.java | 6 +- .../mgmt/types/TokenQuotaConfiguration.java | 12 +- .../types/TwilioProviderConfiguration.java | 26 +- .../mgmt/types/TwilioProviderCredentials.java | 12 +- .../TwilioProviderDeliveryMethodEnum.java | 6 +- .../types/UniversalLoginExperienceEnum.java | 6 +- .../UpdateActionBindingsResponseContent.java | 6 +- .../types/UpdateActionRequestContent.java | 10 +- .../types/UpdateActionResponseContent.java | 10 +- .../mgmt/types/UpdateAculResponseContent.java | 134 +- ...ttackProtectionCaptchaResponseContent.java | 287 ++ ...teBotDetectionSettingsResponseContent.java | 239 ++ .../mgmt/types/UpdateBrandingColors.java | 6 +- .../client/mgmt/types/UpdateBrandingFont.java | 6 +- .../types/UpdateBrandingPageBackground.java | 8 +- ...eBrandingPhoneProviderResponseContent.java | 40 +- .../types/UpdateBrandingRequestContent.java | 6 +- .../types/UpdateBrandingResponseContent.java | 6 +- .../UpdateBrandingThemeResponseContent.java | 24 +- ...swordDetectionSettingsResponseContent.java | 6 +- ...dateBruteForceSettingsResponseContent.java | 6 +- ...BruteForceSettingsResponseContentMode.java | 6 +- ...rceSettingsResponseContentShieldsItem.java | 6 +- .../UpdateClientGrantRequestContent.java | 43 +- .../UpdateClientGrantResponseContent.java | 68 +- .../types/UpdateClientRequestContent.java | 298 +- .../types/UpdateClientResponseContent.java | 251 +- .../mgmt/types/UpdateConnectionOptions.java | 108 +- ...UpdateConnectionProfileRequestContent.java | 232 ++ ...pdateConnectionProfileResponseContent.java | 258 ++ .../types/UpdateConnectionRequestContent.java | 74 +- .../UpdateConnectionResponseContent.java | 75 +- .../UpdateCustomDomainRequestContent.java | 38 +- .../UpdateCustomDomainResponseContent.java | 138 +- ...teDirectoryProvisioningRequestContent.java | 135 + ...eDirectoryProvisioningResponseContent.java | 513 ++++ .../UpdateEmailProviderResponseContent.java | 6 +- .../UpdateEmailTemplateRequestContent.java | 6 +- .../UpdateEmailTemplateResponseContent.java | 6 +- ...edClientConnectionsRequestContentItem.java | 14 +- .../UpdateEventStreamRequestContent.java | 6 +- .../UpdateEventStreamResponseContent.java | 8 +- .../mgmt/types/UpdateFlowRequestContent.java | 6 +- .../mgmt/types/UpdateFlowResponseContent.java | 26 +- ...teFlowsVaultConnectionResponseContent.java | 476 ++++ .../UpdateFlowsVaultConnectionSetup.java | 230 ++ .../mgmt/types/UpdateFormRequestContent.java | 22 +- .../mgmt/types/UpdateFormResponseContent.java | 70 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...derPushNotificationSnsResponseContent.java | 6 +- .../mgmt/types/UpdateHookRequestContent.java | 18 +- .../mgmt/types/UpdateHookResponseContent.java | 18 +- .../types/UpdateLogStreamRequestContent.java | 6 +- .../types/UpdateLogStreamResponseContent.java | 8 +- .../types/UpdateNetworkAclRequestContent.java | 6 +- .../UpdateNetworkAclResponseContent.java | 6 +- ...OrganizationConnectionResponseContent.java | 6 +- ...izationDiscoveryDomainResponseContent.java | 247 ++ .../UpdateOrganizationRequestContent.java | 18 +- .../UpdateOrganizationResponseContent.java | 19 +- .../UpdatePhoneTemplateResponseContent.java | 30 +- .../UpdateResourceServerRequestContent.java | 37 +- .../UpdateResourceServerResponseContent.java | 69 +- ...mentsSettingsNewDeviceResponseContent.java | 114 + ...iskAssessmentsSettingsResponseContent.java | 113 + .../mgmt/types/UpdateRoleRequestContent.java | 6 +- .../mgmt/types/UpdateRoleResponseContent.java | 6 +- .../mgmt/types/UpdateRuleRequestContent.java | 6 +- .../mgmt/types/UpdateRuleResponseContent.java | 6 +- ...pdateScimConfigurationResponseContent.java | 6 +- ...pdateSelfServiceProfileRequestContent.java | 84 +- ...dateSelfServiceProfileResponseContent.java | 42 +- .../types/UpdateSessionRequestContent.java | 129 + .../types/UpdateSessionResponseContent.java | 464 +++ .../types/UpdateSettingsRequestContent.java | 6 +- .../types/UpdateSettingsResponseContent.java | 6 +- ...dateSupplementalSignalsRequestContent.java | 12 +- ...usIpThrottlingSettingsResponseContent.java | 6 +- .../UpdateTenantSettingsResponseContent.java | 111 +- ...ateTokenExchangeProfileRequestContent.java | 6 +- .../client/mgmt/types/UpdateTokenQuota.java | 12 +- ...eUniversalLoginTemplateRequestContent.java | 8 +- ...alLoginTemplateRequestContentTemplate.java | 12 +- ...ateUserAttributeProfileRequestContent.java | 171 ++ ...teUserAttributeProfileResponseContent.java | 174 ++ ...erAuthenticationMethodResponseContent.java | 101 +- .../mgmt/types/UpdateUserRequestContent.java | 6 +- .../mgmt/types/UpdateUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- .../mgmt/types/UserAttributeProfile.java | 172 ++ .../UserAttributeProfileOidcMapping.java | 157 ++ ...UserAttributeProfileStrategyOverrides.java | 268 ++ ...ributeProfileStrategyOverridesMapping.java | 154 + ...tributeProfileStrategyOverridesUserId.java | 268 ++ ...ProfileStrategyOverridesUserIdMapping.java | 154 + .../types/UserAttributeProfileTemplate.java | 146 + .../UserAttributeProfileTemplateItem.java | 155 + ...fileUserAttributeAdditionalProperties.java | 375 +++ .../types/UserAttributeProfileUserId.java | 177 ++ ...fileUserIdOidcStrategyOverrideMapping.java | 97 + .../mgmt/types/UserAuthenticationMethod.java | 170 +- .../UserAuthenticationMethodProperties.java | 6 +- ...serAuthenticationMethodPropertiesEnum.java | 6 +- .../mgmt/types/UserBlockIdentifier.java | 6 +- .../client/mgmt/types/UserDateSchema.java | 8 +- .../types/UserEnrollmentAuthMethodEnum.java | 6 +- .../mgmt/types/UserEnrollmentStatusEnum.java | 6 +- .../auth0/client/mgmt/types/UserGrant.java | 6 +- .../mgmt/types/UserGroupsResponseSchema.java | 461 +++ .../types/{UserIdEnum.java => UserId.java} | 32 +- .../auth0/client/mgmt/types/UserIdentity.java | 48 +- .../mgmt/types/UserIdentityProviderEnum.java | 6 +- .../client/mgmt/types/UserIdentitySchema.java | 6 +- ...ListLogOffsetPaginatedResponseContent.java | 6 +- .../types/UserMultifactorProviderEnum.java | 6 +- .../mgmt/types/UserPermissionSchema.java | 6 +- .../client/mgmt/types/UserProfileData.java | 6 +- .../client/mgmt/types/UserResponseSchema.java | 6 +- .../mgmt/types/UsernameAllowedTypes.java | 6 +- .../client/mgmt/types/UsernameAttribute.java | 6 +- .../client/mgmt/types/UsernameValidation.java | 6 +- .../client/mgmt/types/UsersEnrollment.java | 6 +- .../VerifiableCredentialTemplateResponse.java | 6 +- .../mgmt/types/VerificationMethodEnum.java | 6 +- .../VerifyCustomDomainResponseContent.java | 142 +- .../VerifyEmailTicketRequestContent.java | 36 +- .../VerifyEmailTicketResponseContent.java | 12 +- .../users/AsyncConnectedAccountsClient.java | 52 + .../AsyncRawAuthenticationMethodsClient.java | 8 +- .../AsyncRawConnectedAccountsClient.java | 157 ++ .../client/mgmt/users/AsyncRawLogsClient.java | 13 +- .../users/AsyncRawOrganizationsClient.java | 8 +- .../mgmt/users/AsyncRawPermissionsClient.java | 8 +- .../users/AsyncRawRefreshTokenClient.java | 7 +- .../users/AsyncRawRiskAssessmentsClient.java | 128 + .../mgmt/users/AsyncRawRolesClient.java | 8 +- .../mgmt/users/AsyncRawSessionsClient.java | 7 +- .../users/AsyncRiskAssessmentsClient.java | 42 + .../mgmt/users/ConnectedAccountsClient.java | 50 + .../users/RawAuthenticationMethodsClient.java | 8 +- .../users/RawConnectedAccountsClient.java | 124 + .../client/mgmt/users/RawLogsClient.java | 13 +- .../mgmt/users/RawOrganizationsClient.java | 8 +- .../mgmt/users/RawPermissionsClient.java | 8 +- .../mgmt/users/RawRefreshTokenClient.java | 7 +- .../mgmt/users/RawRiskAssessmentsClient.java | 103 + .../client/mgmt/users/RawRolesClient.java | 8 +- .../client/mgmt/users/RawSessionsClient.java | 7 +- .../mgmt/users/RiskAssessmentsClient.java | 40 + .../types/AssignUserRolesRequestContent.java | 6 +- .../types/ClearAssessorsRequestContent.java | 175 ++ ...serAuthenticationMethodRequestContent.java | 52 +- .../CreateUserPermissionsRequestContent.java | 6 +- .../DeleteUserPermissionsRequestContent.java | 6 +- .../types/DeleteUserRolesRequestContent.java | 6 +- ...serConnectedAccountsRequestParameters.java | 185 ++ .../types/LinkUserIdentityRequestContent.java | 20 +- .../ListRefreshTokensRequestParameters.java | 6 +- ...uthenticationMethodsRequestParameters.java | 25 +- .../types/ListUserLogsRequestParameters.java | 29 +- ...istUserOrganizationsRequestParameters.java | 25 +- .../ListUserPermissionsRequestParameters.java | 17 +- .../types/ListUserRolesRequestParameters.java | 17 +- .../ListUserSessionsRequestParameters.java | 6 +- ...serAuthenticationMethodRequestContent.java | 6 +- .../verification/AsyncRawTemplatesClient.java | 7 +- .../verification/RawTemplatesClient.java | 7 +- ...iableCredentialTemplateRequestContent.java | 24 +- ...eCredentialTemplatesRequestParameters.java | 6 +- ...iableCredentialTemplateRequestContent.java | 6 +- src/main/java/com/auth0/net/BaseRequest.java | 6 +- .../auth0/net/client/DefaultHttpClient.java | 4 +- .../mgmt/ActionsExecutionsWireTest.java | 29 +- .../mgmt/ActionsTriggersBindingsWireTest.java | 34 +- .../client/mgmt/ActionsTriggersWireTest.java | 29 +- .../client/mgmt/ActionsVersionsWireTest.java | 33 +- .../auth0/client/mgmt/ActionsWireTest.java | 46 +- .../client/mgmt/AnomalyBlocksWireTest.java | 29 +- .../AttackProtectionBotDetectionWireTest.java | 212 ++ ...tionBreachedPasswordDetectionWireTest.java | 29 +- ...rotectionBruteForceProtectionWireTest.java | 29 +- .../mgmt/AttackProtectionCaptchaWireTest.java | 248 ++ ...tectionSuspiciousIpThrottlingWireTest.java | 29 +- .../mgmt/BrandingPhoneProvidersWireTest.java | 32 +- .../mgmt/BrandingPhoneTemplatesWireTest.java | 32 +- .../mgmt/BrandingTemplatesWireTest.java | 29 +- .../client/mgmt/BrandingThemesWireTest.java | 29 +- .../auth0/client/mgmt/BrandingWireTest.java | 29 +- .../ClientGrantsOrganizationsWireTest.java | 36 +- .../client/mgmt/ClientGrantsWireTest.java | 72 +- .../mgmt/ClientsConnectionsWireTest.java | 40 +- .../mgmt/ClientsCredentialsWireTest.java | 29 +- .../auth0/client/mgmt/ClientsWireTest.java | 222 +- .../mgmt/ConnectionProfilesWireTest.java | 588 ++++ .../mgmt/ConnectionsClientsWireTest.java | 34 +- ...yProvisioningSynchronizationsWireTest.java | 117 + ...nectionsDirectoryProvisioningWireTest.java | 326 +++ .../client/mgmt/ConnectionsKeysWireTest.java | 29 +- ...ctionsScimConfigurationTokensWireTest.java | 29 +- .../ConnectionsScimConfigurationWireTest.java | 29 +- .../client/mgmt/ConnectionsUsersWireTest.java | 29 +- .../client/mgmt/ConnectionsWireTest.java | 73 +- .../client/mgmt/CustomDomainsWireTest.java | 136 +- .../mgmt/DeviceCredentialsWireTest.java | 46 +- .../mgmt/DynamicTokenManagementTest.java | 20 - .../client/mgmt/EmailTemplatesWireTest.java | 29 +- .../client/mgmt/EmailsProviderWireTest.java | 34 +- .../mgmt/EventStreamsDeliveriesWireTest.java | 42 +- .../EventStreamsRedeliveriesWireTest.java | 29 +- .../client/mgmt/EventStreamsWireTest.java | 113 +- .../client/mgmt/FlowsExecutionsWireTest.java | 35 +- .../mgmt/FlowsVaultConnectionsWireTest.java | 369 +++ .../com/auth0/client/mgmt/FlowsWireTest.java | 38 +- .../com/auth0/client/mgmt/FormsWireTest.java | 60 +- .../mgmt/GuardianEnrollmentsWireTest.java | 29 +- .../GuardianFactorsDuoSettingsWireTest.java | 29 +- .../mgmt/GuardianFactorsPhoneWireTest.java | 29 +- ...ardianFactorsPushNotificationWireTest.java | 31 +- .../mgmt/GuardianFactorsSmsWireTest.java | 29 +- .../client/mgmt/GuardianFactorsWireTest.java | 29 +- .../client/mgmt/GuardianPoliciesWireTest.java | 29 +- .../client/mgmt/HooksSecretsWireTest.java | 37 +- .../com/auth0/client/mgmt/HooksWireTest.java | 48 +- .../auth0/client/mgmt/JobsErrorsWireTest.java | 29 +- .../client/mgmt/JobsUsersExportsWireTest.java | 29 +- .../mgmt/JobsVerificationEmailWireTest.java | 29 +- .../com/auth0/client/mgmt/JobsWireTest.java | 29 +- .../mgmt/KeysCustomSigningWireTest.java | 29 +- .../client/mgmt/KeysEncryptionWireTest.java | 36 +- .../client/mgmt/KeysSigningWireTest.java | 29 +- .../auth0/client/mgmt/LogStreamsWireTest.java | 29 +- .../com/auth0/client/mgmt/LogsWireTest.java | 44 +- .../client/mgmt/ManagementApiBuilderTest.java | 141 + .../client/mgmt/NetworkAclsWireTest.java | 36 +- .../client/mgmt/OAuthTokenSupplierTest.java | 43 - .../OrganizationsClientGrantsWireTest.java | 40 +- ...OrganizationsDiscoveryDomainsWireTest.java | 339 +++ ...ganizationsEnabledConnectionsWireTest.java | 38 +- .../OrganizationsInvitationsWireTest.java | 46 +- .../OrganizationsMembersRolesWireTest.java | 36 +- .../mgmt/OrganizationsMembersWireTest.java | 38 +- .../client/mgmt/OrganizationsWireTest.java | 38 +- .../mgmt/PromptsCustomTextWireTest.java | 31 +- .../client/mgmt/PromptsPartialsWireTest.java | 31 +- .../client/mgmt/PromptsRenderingWireTest.java | 202 +- .../auth0/client/mgmt/PromptsWireTest.java | 29 +- .../client/mgmt/RefreshTokensWireTest.java | 29 +- .../client/mgmt/ResourceServersWireTest.java | 81 +- ...kAssessmentsSettingsNewDeviceWireTest.java | 187 ++ .../mgmt/RiskAssessmentsSettingsWireTest.java | 186 ++ .../client/mgmt/RolesPermissionsWireTest.java | 36 +- .../auth0/client/mgmt/RolesUsersWireTest.java | 34 +- .../com/auth0/client/mgmt/RolesWireTest.java | 38 +- .../client/mgmt/RulesConfigsWireTest.java | 29 +- .../com/auth0/client/mgmt/RulesWireTest.java | 46 +- ...SelfServiceProfilesCustomTextWireTest.java | 37 +- .../SelfServiceProfilesSsoTicketWireTest.java | 29 +- .../mgmt/SelfServiceProfilesWireTest.java | 53 +- .../auth0/client/mgmt/SessionsWireTest.java | 147 +- .../com/auth0/client/mgmt/StatsWireTest.java | 34 +- .../com/auth0/client/mgmt/StreamTest.java | 4 +- .../mgmt/SupplementalSignalsWireTest.java | 29 +- .../client/mgmt/TenantsSettingsWireTest.java | 46 +- .../auth0/client/mgmt/TicketsWireTest.java | 29 +- .../mgmt/TokenExchangeProfilesWireTest.java | 34 +- .../mgmt/UserAttributeProfilesWireTest.java | 536 ++++ .../auth0/client/mgmt/UserBlocksWireTest.java | 34 +- .../auth0/client/mgmt/UserGrantsWireTest.java | 42 +- .../UsersAuthenticationMethodsWireTest.java | 53 +- .../mgmt/UsersAuthenticatorsWireTest.java | 29 +- .../mgmt/UsersConnectedAccountsWireTest.java | 92 + .../client/mgmt/UsersEnrollmentsWireTest.java | 29 +- ...FederatedConnectionsTokensetsWireTest.java | 29 +- .../client/mgmt/UsersIdentitiesWireTest.java | 29 +- .../auth0/client/mgmt/UsersLogsWireTest.java | 38 +- .../client/mgmt/UsersMultifactorWireTest.java | 29 +- .../mgmt/UsersOrganizationsWireTest.java | 38 +- .../client/mgmt/UsersPermissionsWireTest.java | 36 +- .../mgmt/UsersRefreshTokenWireTest.java | 34 +- .../mgmt/UsersRiskAssessmentsWireTest.java | 116 + .../auth0/client/mgmt/UsersRolesWireTest.java | 36 +- .../client/mgmt/UsersSessionsWireTest.java | 36 +- .../com/auth0/client/mgmt/UsersWireTest.java | 58 +- ...dentialsVerificationTemplatesWireTest.java | 34 +- 1839 files changed, 130101 insertions(+), 12736 deletions(-) create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncConnectionProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawConnectionProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/ConnectionProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawConnectionProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBotDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncCaptchaClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBotDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawCaptchaClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/BotDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/CaptchaClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/RawBotDetectionClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/RawCaptchaClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncDirectoryProvisioningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/AsyncRawDirectoryProvisioningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/DirectoryProvisioningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/RawDirectoryProvisioningClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncRawSynchronizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncSynchronizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/RawSynchronizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/SynchronizationsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/AsyncConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/AsyncRawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/AsyncVaultClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/ConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/RawConnectionsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/VaultClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/AsyncRawDiscoveryDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/DiscoveryDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/AsyncSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/RawSettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/RiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/SettingsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncNewDeviceClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncRawNewDeviceClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/settings/NewDeviceClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/settings/RawNewDeviceClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculContextEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java rename src/main/java/com/auth0/client/mgmt/types/{AculHeadTagAttributes.java => ConnectionUpstreamAlias.java} (54%) create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0OauthApp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpBearer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeKeyPair.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramToken.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappToken.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierUninitialized.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/EventStreamsGetStatsRequest.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ExpressConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsQueryParamsValue.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsQueryParamsValue.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/GetEventStreamStatsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUserAttributeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetUserAttributeProfileTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/Group.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IConnectionCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IConnectionResponseCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ICreateConnectionCommon.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/IGroup.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java delete mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUserAttributeProfileRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateUserAttributeProfileResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileOidcMapping.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplateItem.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java rename src/main/java/com/auth0/client/mgmt/types/{UserIdEnum.java => UserId.java} (74%) create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncConnectedAccountsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawConnectedAccountsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRawRiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/AsyncRiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/ConnectedAccountsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawConnectedAccountsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RawRiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/RiskAssessmentsClient.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java create mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionBotDetectionWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/AttackProtectionCaptchaWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionProfilesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningSynchronizationsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/FlowsVaultConnectionsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsNewDeviceWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UserAttributeProfilesWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersConnectedAccountsWireTest.java create mode 100644 src/test/java/com/auth0/client/mgmt/UsersRiskAssessmentsWireTest.java diff --git a/.fernignore b/.fernignore index 7a0eb63b9..55d7a36bb 100644 --- a/.fernignore +++ b/.fernignore @@ -55,22 +55,13 @@ src/main/java/com/auth0/client/mgmt/core/ClientOptions.java src/main/java/com/auth0/client/mgmt/core/OAuthTokenSupplier.java src/main/java/com/auth0/client/mgmt/core/OAuthTokenException.java +# Custom builder with domain-based initialization +src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java + # Custom tests src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java - -# TEMPORARY: Wire tests with changes from generation -src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java -src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java -src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java -src/test/java/com/auth0/client/mgmt/StreamTest.java - -# TEMPORARY: Fixed query string mapper -src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java - -# TEMPORARY: Fixed to handle array response when include_totals is not set -src/main/java/com/auth0/client/mgmt/RawClientsClient.java -src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java +src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java # Configuration files from auth0-real .codecov.yml diff --git a/sample-app/src/main/java/sample/App.java b/sample-app/src/main/java/sample/App.java index a2948490d..cc897d04f 100644 --- a/sample-app/src/main/java/sample/App.java +++ b/sample-app/src/main/java/sample/App.java @@ -4,7 +4,192 @@ package sample; +import com.auth0.client.auth.AuthAPI; +import com.auth0.client.mgmt.ManagementApi; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Environment; +import com.auth0.client.mgmt.core.OAuthTokenSupplier; +import com.auth0.json.auth.TokenHolder; +import com.auth0.net.TokenRequest; + +import java.io.IOException; + public final class App { + private static String domain = "dev-tanya.us.auth0.com"; + private static String clientId = "PY6HuuGyYjDktVGOrf47DIaXwUy8uVYP"; + private static String clientSecret = "s7IGAq1eSDtoXOcA_9WW4mQRKVkzysG7CKC3hAUoQXT6irCMlhTK4hvPBGduXQn0"; + private static String audience = "https://dev-tanya.us.auth0.com/api/v2/"; + + public static void main(String[] args) throws IOException { + + // import com.auth0.client.mgmt.AsyncManagementApi + + AuthAPI auth = AuthAPI.newBuilder(domain, clientId, clientSecret).build(); + + TokenRequest tokenRequest = auth.requestToken(audience); + TokenHolder holder = tokenRequest.execute().getBody(); + String accessToken = holder.getAccessToken(); + System.out.println("Access Token: " + accessToken); + + try { + + +// AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); + +// String accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Il9ZeURNSUlqVENoWDI2cHFyZlBIaCJ9.eyJpc3MiOiJodHRwczovL2Rldi10YW55YS51cy5hdXRoMC5jb20vIiwic3ViIjoiUFk2SHV1R3lZakRrdFZHT3JmNDdESWFYd1V5OHVWWVBAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGV2LXRhbnlhLnVzLmF1dGgwLmNvbS9hcGkvdjIvIiwiaWF0IjoxNzYzNzM2MzA2LCJleHAiOjE3NjM4MjI3MDYsInNjb3BlIjoicmVhZDpjbGllbnRfZ3JhbnRzIGNyZWF0ZTpjbGllbnRfZ3JhbnRzIGRlbGV0ZTpjbGllbnRfZ3JhbnRzIHVwZGF0ZTpjbGllbnRfZ3JhbnRzIHJlYWQ6dXNlcnMgdXBkYXRlOnVzZXJzIGRlbGV0ZTp1c2VycyBjcmVhdGU6dXNlcnMgcmVhZDp1c2Vyc19hcHBfbWV0YWRhdGEgdXBkYXRlOnVzZXJzX2FwcF9tZXRhZGF0YSBkZWxldGU6dXNlcnNfYXBwX21ldGFkYXRhIGNyZWF0ZTp1c2Vyc19hcHBfbWV0YWRhdGEgcmVhZDp1c2VyX2N1c3RvbV9ibG9ja3MgY3JlYXRlOnVzZXJfY3VzdG9tX2Jsb2NrcyBkZWxldGU6dXNlcl9jdXN0b21fYmxvY2tzIGNyZWF0ZTp1c2VyX3RpY2tldHMgcmVhZDpjbGllbnRzIHVwZGF0ZTpjbGllbnRzIGRlbGV0ZTpjbGllbnRzIGNyZWF0ZTpjbGllbnRzIHJlYWQ6Y2xpZW50X2tleXMgdXBkYXRlOmNsaWVudF9rZXlzIGRlbGV0ZTpjbGllbnRfa2V5cyBjcmVhdGU6Y2xpZW50X2tleXMgcmVhZDpjbGllbnRfY3JlZGVudGlhbHMgdXBkYXRlOmNsaWVudF9jcmVkZW50aWFscyBkZWxldGU6Y2xpZW50X2NyZWRlbnRpYWxzIGNyZWF0ZTpjbGllbnRfY3JlZGVudGlhbHMgcmVhZDpjb25uZWN0aW9ucyB1cGRhdGU6Y29ubmVjdGlvbnMgZGVsZXRlOmNvbm5lY3Rpb25zIGNyZWF0ZTpjb25uZWN0aW9ucyByZWFkOnJlc291cmNlX3NlcnZlcnMgdXBkYXRlOnJlc291cmNlX3NlcnZlcnMgZGVsZXRlOnJlc291cmNlX3NlcnZlcnMgY3JlYXRlOnJlc291cmNlX3NlcnZlcnMgcmVhZDpkZXZpY2VfY3JlZGVudGlhbHMgdXBkYXRlOmRldmljZV9jcmVkZW50aWFscyBkZWxldGU6ZGV2aWNlX2NyZWRlbnRpYWxzIGNyZWF0ZTpkZXZpY2VfY3JlZGVudGlhbHMgcmVhZDpydWxlcyB1cGRhdGU6cnVsZXMgZGVsZXRlOnJ1bGVzIGNyZWF0ZTpydWxlcyByZWFkOnJ1bGVzX2NvbmZpZ3MgdXBkYXRlOnJ1bGVzX2NvbmZpZ3MgZGVsZXRlOnJ1bGVzX2NvbmZpZ3MgcmVhZDpob29rcyB1cGRhdGU6aG9va3MgZGVsZXRlOmhvb2tzIGNyZWF0ZTpob29rcyByZWFkOmFjdGlvbnMgdXBkYXRlOmFjdGlvbnMgZGVsZXRlOmFjdGlvbnMgY3JlYXRlOmFjdGlvbnMgcmVhZDplbWFpbF9wcm92aWRlciB1cGRhdGU6ZW1haWxfcHJvdmlkZXIgZGVsZXRlOmVtYWlsX3Byb3ZpZGVyIGNyZWF0ZTplbWFpbF9wcm92aWRlciBibGFja2xpc3Q6dG9rZW5zIHJlYWQ6c3RhdHMgcmVhZDppbnNpZ2h0cyByZWFkOnRlbmFudF9zZXR0aW5ncyB1cGRhdGU6dGVuYW50X3NldHRpbmdzIHJlYWQ6bG9ncyByZWFkOmxvZ3NfdXNlcnMgcmVhZDpzaGllbGRzIGNyZWF0ZTpzaGllbGRzIHVwZGF0ZTpzaGllbGRzIGRlbGV0ZTpzaGllbGRzIHJlYWQ6YW5vbWFseV9ibG9ja3MgZGVsZXRlOmFub21hbHlfYmxvY2tzIHVwZGF0ZTp0cmlnZ2VycyByZWFkOnRyaWdnZXJzIHJlYWQ6Z3JhbnRzIGRlbGV0ZTpncmFudHMgcmVhZDpndWFyZGlhbl9mYWN0b3JzIHVwZGF0ZTpndWFyZGlhbl9mYWN0b3JzIHJlYWQ6Z3VhcmRpYW5fZW5yb2xsbWVudHMgZGVsZXRlOmd1YXJkaWFuX2Vucm9sbG1lbnRzIGNyZWF0ZTpndWFyZGlhbl9lbnJvbGxtZW50X3RpY2tldHMgcmVhZDp1c2VyX2lkcF90b2tlbnMgY3JlYXRlOnBhc3N3b3Jkc19jaGVja2luZ19qb2IgZGVsZXRlOnBhc3N3b3Jkc19jaGVja2luZ19qb2IgcmVhZDpjdXN0b21fZG9tYWlucyBkZWxldGU6Y3VzdG9tX2RvbWFpbnMgY3JlYXRlOmN1c3RvbV9kb21haW5zIHVwZGF0ZTpjdXN0b21fZG9tYWlucyByZWFkOmVtYWlsX3RlbXBsYXRlcyBjcmVhdGU6ZW1haWxfdGVtcGxhdGVzIHVwZGF0ZTplbWFpbF90ZW1wbGF0ZXMgcmVhZDptZmFfcG9saWNpZXMgdXBkYXRlOm1mYV9wb2xpY2llcyByZWFkOnJvbGVzIGNyZWF0ZTpyb2xlcyBkZWxldGU6cm9sZXMgdXBkYXRlOnJvbGVzIHJlYWQ6cHJvbXB0cyB1cGRhdGU6cHJvbXB0cyByZWFkOmJyYW5kaW5nIHVwZGF0ZTpicmFuZGluZyBkZWxldGU6YnJhbmRpbmcgcmVhZDpsb2dfc3RyZWFtcyBjcmVhdGU6bG9nX3N0cmVhbXMgZGVsZXRlOmxvZ19zdHJlYW1zIHVwZGF0ZTpsb2dfc3RyZWFtcyBjcmVhdGU6c2lnbmluZ19rZXlzIHJlYWQ6c2lnbmluZ19rZXlzIHVwZGF0ZTpzaWduaW5nX2tleXMgcmVhZDpsaW1pdHMgdXBkYXRlOmxpbWl0cyBjcmVhdGU6cm9sZV9tZW1iZXJzIHJlYWQ6cm9sZV9tZW1iZXJzIGRlbGV0ZTpyb2xlX21lbWJlcnMgcmVhZDplbnRpdGxlbWVudHMgcmVhZDphdHRhY2tfcHJvdGVjdGlvbiB1cGRhdGU6YXR0YWNrX3Byb3RlY3Rpb24gcmVhZDpvcmdhbml6YXRpb25zX3N1bW1hcnkgY3JlYXRlOmF1dGhlbnRpY2F0aW9uX21ldGhvZHMgcmVhZDphdXRoZW50aWNhdGlvbl9tZXRob2RzIHVwZGF0ZTphdXRoZW50aWNhdGlvbl9tZXRob2RzIGRlbGV0ZTphdXRoZW50aWNhdGlvbl9tZXRob2RzIHJlYWQ6b3JnYW5pemF0aW9ucyB1cGRhdGU6b3JnYW5pemF0aW9ucyBjcmVhdGU6b3JnYW5pemF0aW9ucyBkZWxldGU6b3JnYW5pemF0aW9ucyByZWFkOm9yZ2FuaXphdGlvbl9kaXNjb3ZlcnlfZG9tYWlucyB1cGRhdGU6b3JnYW5pemF0aW9uX2Rpc2NvdmVyeV9kb21haW5zIGNyZWF0ZTpvcmdhbml6YXRpb25fZGlzY292ZXJ5X2RvbWFpbnMgZGVsZXRlOm9yZ2FuaXphdGlvbl9kaXNjb3ZlcnlfZG9tYWlucyBjcmVhdGU6b3JnYW5pemF0aW9uX21lbWJlcnMgcmVhZDpvcmdhbml6YXRpb25fbWVtYmVycyBkZWxldGU6b3JnYW5pemF0aW9uX21lbWJlcnMgY3JlYXRlOm9yZ2FuaXphdGlvbl9jb25uZWN0aW9ucyByZWFkOm9yZ2FuaXphdGlvbl9jb25uZWN0aW9ucyB1cGRhdGU6b3JnYW5pemF0aW9uX2Nvbm5lY3Rpb25zIGRlbGV0ZTpvcmdhbml6YXRpb25fY29ubmVjdGlvbnMgY3JlYXRlOm9yZ2FuaXphdGlvbl9tZW1iZXJfcm9sZXMgcmVhZDpvcmdhbml6YXRpb25fbWVtYmVyX3JvbGVzIGRlbGV0ZTpvcmdhbml6YXRpb25fbWVtYmVyX3JvbGVzIGNyZWF0ZTpvcmdhbml6YXRpb25faW52aXRhdGlvbnMgcmVhZDpvcmdhbml6YXRpb25faW52aXRhdGlvbnMgZGVsZXRlOm9yZ2FuaXphdGlvbl9pbnZpdGF0aW9ucyByZWFkOnNjaW1fY29uZmlnIGNyZWF0ZTpzY2ltX2NvbmZpZyB1cGRhdGU6c2NpbV9jb25maWcgZGVsZXRlOnNjaW1fY29uZmlnIGNyZWF0ZTpzY2ltX3Rva2VuIHJlYWQ6c2NpbV90b2tlbiBkZWxldGU6c2NpbV90b2tlbiBkZWxldGU6cGhvbmVfcHJvdmlkZXJzIGNyZWF0ZTpwaG9uZV9wcm92aWRlcnMgcmVhZDpwaG9uZV9wcm92aWRlcnMgdXBkYXRlOnBob25lX3Byb3ZpZGVycyBkZWxldGU6cGhvbmVfdGVtcGxhdGVzIGNyZWF0ZTpwaG9uZV90ZW1wbGF0ZXMgcmVhZDpwaG9uZV90ZW1wbGF0ZXMgdXBkYXRlOnBob25lX3RlbXBsYXRlcyBjcmVhdGU6ZW5jcnlwdGlvbl9rZXlzIHJlYWQ6ZW5jcnlwdGlvbl9rZXlzIHVwZGF0ZTplbmNyeXB0aW9uX2tleXMgZGVsZXRlOmVuY3J5cHRpb25fa2V5cyByZWFkOnNlc3Npb25zIHVwZGF0ZTpzZXNzaW9ucyBkZWxldGU6c2Vzc2lvbnMgcmVhZDpyZWZyZXNoX3Rva2VucyB1cGRhdGU6cmVmcmVzaF90b2tlbnMgZGVsZXRlOnJlZnJlc2hfdG9rZW5zIGNyZWF0ZTpzZWxmX3NlcnZpY2VfcHJvZmlsZXMgcmVhZDpzZWxmX3NlcnZpY2VfcHJvZmlsZXMgdXBkYXRlOnNlbGZfc2VydmljZV9wcm9maWxlcyBkZWxldGU6c2VsZl9zZXJ2aWNlX3Byb2ZpbGVzIGNyZWF0ZTpzc29fYWNjZXNzX3RpY2tldHMgZGVsZXRlOnNzb19hY2Nlc3NfdGlja2V0cyByZWFkOmZvcm1zIHVwZGF0ZTpmb3JtcyBkZWxldGU6Zm9ybXMgY3JlYXRlOmZvcm1zIHJlYWQ6Zmxvd3MgdXBkYXRlOmZsb3dzIGRlbGV0ZTpmbG93cyBjcmVhdGU6Zmxvd3MgcmVhZDpmbG93c192YXVsdCByZWFkOmZsb3dzX3ZhdWx0X2Nvbm5lY3Rpb25zIHVwZGF0ZTpmbG93c192YXVsdF9jb25uZWN0aW9ucyBkZWxldGU6Zmxvd3NfdmF1bHRfY29ubmVjdGlvbnMgY3JlYXRlOmZsb3dzX3ZhdWx0X2Nvbm5lY3Rpb25zIHJlYWQ6Zmxvd3NfZXhlY3V0aW9ucyBkZWxldGU6Zmxvd3NfZXhlY3V0aW9ucyByZWFkOmNvbm5lY3Rpb25zX29wdGlvbnMgdXBkYXRlOmNvbm5lY3Rpb25zX29wdGlvbnMgcmVhZDpzZWxmX3NlcnZpY2VfcHJvZmlsZV9jdXN0b21fdGV4dHMgdXBkYXRlOnNlbGZfc2VydmljZV9wcm9maWxlX2N1c3RvbV90ZXh0cyBjcmVhdGU6bmV0d29ya19hY2xzIHVwZGF0ZTpuZXR3b3JrX2FjbHMgcmVhZDpuZXR3b3JrX2FjbHMgZGVsZXRlOm5ldHdvcmtfYWNscyBkZWxldGU6dmRjc190ZW1wbGF0ZXMgcmVhZDp2ZGNzX3RlbXBsYXRlcyBjcmVhdGU6dmRjc190ZW1wbGF0ZXMgdXBkYXRlOnZkY3NfdGVtcGxhdGVzIGNyZWF0ZTpjdXN0b21fc2lnbmluZ19rZXlzIHJlYWQ6Y3VzdG9tX3NpZ25pbmdfa2V5cyB1cGRhdGU6Y3VzdG9tX3NpZ25pbmdfa2V5cyBkZWxldGU6Y3VzdG9tX3NpZ25pbmdfa2V5cyByZWFkOmZlZGVyYXRlZF9jb25uZWN0aW9uc190b2tlbnMgZGVsZXRlOmZlZGVyYXRlZF9jb25uZWN0aW9uc190b2tlbnMgY3JlYXRlOnVzZXJfYXR0cmlidXRlX3Byb2ZpbGVzIHJlYWQ6dXNlcl9hdHRyaWJ1dGVfcHJvZmlsZXMgdXBkYXRlOnVzZXJfYXR0cmlidXRlX3Byb2ZpbGVzIGRlbGV0ZTp1c2VyX2F0dHJpYnV0ZV9wcm9maWxlcyByZWFkOmV2ZW50X3N0cmVhbXMgY3JlYXRlOmV2ZW50X3N0cmVhbXMgZGVsZXRlOmV2ZW50X3N0cmVhbXMgdXBkYXRlOmV2ZW50X3N0cmVhbXMgcmVhZDpldmVudF9kZWxpdmVyaWVzIHVwZGF0ZTpldmVudF9kZWxpdmVyaWVzIGNyZWF0ZTpjb25uZWN0aW9uX3Byb2ZpbGVzIHJlYWQ6Y29ubmVjdGlvbl9wcm9maWxlcyB1cGRhdGU6Y29ubmVjdGlvbl9wcm9maWxlcyBkZWxldGU6Y29ubmVjdGlvbl9wcm9maWxlcyByZWFkOm9yZ2FuaXphdGlvbl9jbGllbnRfZ3JhbnRzIGNyZWF0ZTpvcmdhbml6YXRpb25fY2xpZW50X2dyYW50cyBkZWxldGU6b3JnYW5pemF0aW9uX2NsaWVudF9ncmFudHMgcmVhZDpzZWN1cml0eV9tZXRyaWNzIHJlYWQ6Y29ubmVjdGlvbnNfa2V5cyB1cGRhdGU6Y29ubmVjdGlvbnNfa2V5cyBjcmVhdGU6Y29ubmVjdGlvbnNfa2V5cyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsImF6cCI6IlBZNkh1dUd5WWpEa3RWR09yZjQ3RElhWHdVeTh1VllQIn0.g86ev9tdiBka5FfY9suyKF1Q94bk2EbE72tpJjMDXklAroivAnwXTKcTHmK1Mi8EhENVU02nxZwXUPCLYYIBlMb9vHtqdfUXLkb1idVL0Tas-TQN51i5xHvFWkE68Ji91YuFOdEQ7hYFWVvJasM8N2ZdoeOJefOwRWSS8BrWGfrRQ3kbJZxzUQ-w-_WvBkk06c7gP9zFb4vOxQrEyGlwzpkx9dcVkOhSk3cKhO84S-3awJA2ZOBl1ZrqG6T0-eZZZekD5SM-UqFX-cFtsASXzeqi2ziuqyNNv14kn_eV56B65W7u-BR6pkqTxa7PZKsXoIdV4fXLub48CJp6SwZNXA"; + +// ManagementApi client = ManagementApi +// .builder() +// .url(audience) +// .token(accessToken) +// .build(); + + OAuthTokenSupplier supplier = new OAuthTokenSupplier( + clientId, clientSecret, "https://dev-tanya.us.auth0.com", audience); + + ManagementApi client = new ManagementApi(ClientOptions.builder() + .environment(Environment.custom("https://dev-tanya.us.auth0.com" + "/api/v2")) + .addHeader("Authorization", () -> "Bearer " + supplier.get()) + .build()); + +// + +// CreateActionResponseContent resp = client.actions().create( +// CreateActionRequestContent +// .builder() +// .name("name") +// .supportedTriggers( +// new ArrayList( +// Arrays.asList( +// ActionTrigger +// .builder() +// .id("id") +// .build() +// ) +// ) +// ) +// .build() +// ); + +// client.users().list(); + +// UpdateUserRequestContent updateUserRequestContent1 = UpdateUserRequestContent.builder() +// .givenName(OptionalNullable.of("John")) // Set a value +// .familyName(OptionalNullable.of("Sinha")) // Explicitly send null +// .nickname(OptionalNullable.absent()) // Exclude the field from the request +// .build(); +// +// +// UpdateUserResponseContent resp1 = client.users().update("auth0|68cb986ea95fb4c16522b85d", updateUserRequestContent1); +// System.out.println("resp1 " + resp1.toString()); +//// +////// +// UpdateUserRequestContent updateUserRequestContent = UpdateUserRequestContent.builder() +// .givenName(OptionalNullable.of("John")) // Set a value +// .familyName(OptionalNullable.ofNullable(null)) // Explicitly send null +// .nickname(OptionalNullable.absent()) // Exclude the field from the request +// .build(); +// +// +// UpdateUserResponseContent resp = client.users().update("auth0|68cb986ea95fb4c16522b85d", updateUserRequestContent); +// System.out.println("resp " + resp.toString()); +// +// UpdateBrandingRequestContent update = UpdateBrandingRequestContent.builder() +// .logoUrl("https://example.com/logo.ico") +// .faviconUrl(Optional.ofNullable(null)).build(); +// UpdateBrandingResponseContent resp2 = client.branding().update(update); +// System.out.println("resp2 " + resp2.toString()); +// +// ExecutorService executor = Executors.newFixedThreadPool(10); +// +// for (int i = 0; i < 102; i++) { // Simulate 50 requests +// executor.submit(() -> { +// try { +// GetClientResponseContent get = client.clients().get("K6T6DHgl2AyzKHfgQ8A3Nqhdw15iuGdC"); +// System.out.println("get " + get.toString()); +// } catch (Exception e) { +// System.out.println("Caught exception: " + e); +// } +// }); +// } + +// GetClientResponseContent get = client.clients().get("K6T6DHgl2AyzKHfgQ8A3Nqhdw15iuGdC"); +// System.out.println("get " + get.toString()); +// +// SyncPagingIterable list = client.clients().list(ListClientsRequestParameters.builder().page(0).perPage(1).includeTotals(true).build()); +// for( Client c : list){ +// System.out.println("Client: " + c.toString()); +// } +// +// SyncPagingIterable logs = client.logs().list(); +// for (Log log : logs) { +// System.out.println("log " + log.toString()); +// } +// System.out.println("Logs fetched successfully."+logs.getItems().size()); +//// +// System.out.println("Creating connection..."); +// +// CreateConnectionRequestContent createConnection = +// CreateConnectionRequestContent +// .builder() +// .name("my-connection-1234-1234-1234-1234-123-99") +// .strategy(ConnectionIdentityProviderEnum.valueOf("auth0")) +// .build(); +// +// CreateConnectionResponseContent createClientResp = client.connections().create(createConnection); +// System.out.println("createClientResp " + createClientResp.toString()); +// +// List enabledClients = new ArrayList<>(); +// enabledClients.add("PY6HuuGyYjDktVGOrf47DIaXwUy8uVYP"); +// +// UpdateConnectionResponseContent updateConnectionResponseContent = client.connections().update("con_UwaU8C6gvIl2XJL3", +// UpdateConnectionRequestContent +// .builder() +// .enabledClients(enabledClients) +// .build() +// ); +// System.out.println("updateConnectionResponseContent " + updateConnectionResponseContent.toString()); + +// SyncPagingIterable listConnection = client.connections().list(); +// System.out.println("Connections fetched successfully."+listConnection.getItems().size()); +// +// GetConnectionResponseContent getConnectionResponseContent = client.connections().get("con_UwaU8C6gvIl2XJL3"); +// System.out.println("getConnectionResponseContent " + getConnectionResponseContent.toString()); + + // + // + // client.connections().delete(String.valueOf(createClientResp.getId())); + +// ManagementApiHttpResponse response = client.connections() +// .withRawResponse() +// .delete("con_UwaU8C6gvIl2XJL3"); +// System.out.println("Delete connection response status code: " + response.body()); + + + +// client.users().list(null, RequestOptions.withClientCredentials( +// "https://dev-tanya.us.auth0.com", clientId, clientSecret)); + +// double get = client.stats().getActiveUsersCount(); +// System.out.println("Active Users Count: " + get); + +// List eventStreamResponseContents = client.eventStreams().list(); +// SyncPagingIterable getKeys = client.keys().encryption().list( +// ListEncryptionKeysRequestParameters +// .builder() +// .perPage(25) +// .build() +// ); +// System.out.println("Encryption Keys Count: " + getKeys.getItems().size()); + +// client.users().create() + + } + catch (Exception ex){ + System.out.println(ex); + System.out.println(ex.getStackTrace()); + } + } } diff --git a/src/main/java/com/auth0/client/auth/AuthAPI.java b/src/main/java/com/auth0/client/auth/AuthAPI.java index 7dcc74016..c09e32464 100644 --- a/src/main/java/com/auth0/client/auth/AuthAPI.java +++ b/src/main/java/com/auth0/client/auth/AuthAPI.java @@ -115,8 +115,8 @@ public AuthAPI(String domain, String clientId, String clientSecret) { * @param clientSecret the applications client secret. * @return a Builder for further configuration. */ - public static AuthAPI.Builder newBuilder(String domain, String clientId, String clientSecret) { - return new AuthAPI.Builder(domain, clientId).withClientSecret(clientSecret); + public static Builder newBuilder(String domain, String clientId, String clientSecret) { + return new Builder(domain, clientId).withClientSecret(clientSecret); } /** @@ -128,9 +128,8 @@ public static AuthAPI.Builder newBuilder(String domain, String clientId, String * @param clientAssertionSigner the {@code ClientAssertionSigner} used to create the signed client assertion. * @return a Builder for further configuration. */ - public static AuthAPI.Builder newBuilder( - String domain, String clientId, ClientAssertionSigner clientAssertionSigner) { - return new AuthAPI.Builder(domain, clientId).withClientAssertionSigner(clientAssertionSigner); + public static Builder newBuilder(String domain, String clientId, ClientAssertionSigner clientAssertionSigner) { + return new Builder(domain, clientId).withClientAssertionSigner(clientAssertionSigner); } /** @@ -140,8 +139,8 @@ public static AuthAPI.Builder newBuilder( * @param clientId the application's client ID. * @return a Builder for further configuration. */ - public static AuthAPI.Builder newBuilder(String domain, String clientId) { - return new AuthAPI.Builder(domain, clientId); + public static Builder newBuilder(String domain, String clientId) { + return new Builder(domain, clientId); } private AuthAPI( @@ -891,8 +890,8 @@ public TokenRequest login(String emailOrUsername, char[] password, String realm) * * @see Using Passwordless APIs * @see Passwordless Authenticate User API docs - * @see com.auth0.client.auth.AuthAPI#startPasswordlessEmailFlow(String, PasswordlessEmailType) - * @see com.auth0.client.auth.AuthAPI#startPasswordlessSmsFlow(String) + * @see AuthAPI#startPasswordlessEmailFlow(String, PasswordlessEmailType) + * @see AuthAPI#startPasswordlessSmsFlow(String) */ public TokenRequest exchangePasswordlessOtp(String emailOrPhone, String realm, char[] otp) { Asserts.assertNotNull(emailOrPhone, "emailOrPhone"); diff --git a/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java index 6595e1ca1..927a79490 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncClientGrantsClient.java @@ -38,14 +38,14 @@ public AsyncRawClientGrantsClient withRawResponse() { } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public CompletableFuture> list( ListClientGrantsRequestParameters request) { @@ -53,7 +53,7 @@ public CompletableFuture> list( } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public CompletableFuture> list( ListClientGrantsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncConnectionProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncConnectionProfilesClient.java new file mode 100644 index 000000000..f1f1a294e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncConnectionProfilesClient.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionProfile; +import com.auth0.client.mgmt.types.CreateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfileRequestParameters; +import com.auth0.client.mgmt.types.ListConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncConnectionProfilesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectionProfilesClient rawClient; + + public AsyncConnectionProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectionProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectionProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list( + ListConnectionProfileRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list( + ListConnectionProfileRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a Connection Profile. + */ + public CompletableFuture create( + CreateConnectionProfileRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a Connection Profile. + */ + public CompletableFuture create( + CreateConnectionProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public CompletableFuture listTemplates() { + return this.rawClient.listTemplates().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public CompletableFuture listTemplates( + RequestOptions requestOptions) { + return this.rawClient.listTemplates(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a Connection Profile Template. + */ + public CompletableFuture getTemplate(String id) { + return this.rawClient.getTemplate(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a Connection Profile Template. + */ + public CompletableFuture getTemplate( + String id, RequestOptions requestOptions) { + return this.rawClient.getTemplate(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture update( + String id, UpdateConnectionProfileRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture update( + String id, UpdateConnectionProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java index 29b197c35..bc7008558 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.connections.AsyncClientsClient; +import com.auth0.client.mgmt.connections.AsyncDirectoryProvisioningClient; import com.auth0.client.mgmt.connections.AsyncKeysClient; import com.auth0.client.mgmt.connections.AsyncScimConfigurationClient; import com.auth0.client.mgmt.connections.AsyncUsersClient; @@ -29,6 +30,8 @@ public class AsyncConnectionsClient { protected final Supplier clientsClient; + protected final Supplier directoryProvisioningClient; + protected final Supplier keysClient; protected final Supplier scimConfigurationClient; @@ -39,6 +42,7 @@ public AsyncConnectionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawConnectionsClient(clientOptions); this.clientsClient = Suppliers.memoize(() -> new AsyncClientsClient(clientOptions)); + this.directoryProvisioningClient = Suppliers.memoize(() -> new AsyncDirectoryProvisioningClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions)); this.scimConfigurationClient = Suppliers.memoize(() -> new AsyncScimConfigurationClient(clientOptions)); this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); @@ -207,6 +211,10 @@ public AsyncClientsClient clients() { return this.clientsClient.get(); } + public AsyncDirectoryProvisioningClient directoryProvisioning() { + return this.directoryProvisioningClient.get(); + } + public AsyncKeysClient keys() { return this.keysClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java index 09953ce2d..9ebe7679c 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java @@ -9,6 +9,7 @@ import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; import com.auth0.client.mgmt.types.CustomDomain; import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.ListCustomDomainsRequestParameters; import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; @@ -43,8 +44,16 @@ public CompletableFuture> list() { /** * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ - public CompletableFuture> list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + public CompletableFuture> list(ListCustomDomainsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture> list( + ListCustomDomainsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java index 4f48bd803..0c9eb6027 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java @@ -13,9 +13,7 @@ import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; -import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; -import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; @@ -98,20 +96,6 @@ public CompletableFuture update( return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture getStats(String id) { - return this.rawClient.getStats(id).thenApply(response -> response.body()); - } - - public CompletableFuture getStats( - String id, EventStreamsGetStatsRequest request) { - return this.rawClient.getStats(id, request).thenApply(response -> response.body()); - } - - public CompletableFuture getStats( - String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { - return this.rawClient.getStats(id, request, requestOptions).thenApply(response -> response.body()); - } - public CompletableFuture test( String id, CreateEventStreamTestEventRequestContent request) { return this.rawClient.test(id, request).thenApply(response -> response.body()); diff --git a/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java index df28e6c56..dd92d859d 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncFlowsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.flows.AsyncExecutionsClient; +import com.auth0.client.mgmt.flows.vault.AsyncVaultClient; import com.auth0.client.mgmt.types.CreateFlowRequestContent; import com.auth0.client.mgmt.types.CreateFlowResponseContent; import com.auth0.client.mgmt.types.FlowSummary; @@ -26,10 +27,13 @@ public class AsyncFlowsClient { protected final Supplier executionsClient; + protected final Supplier vaultClient; + public AsyncFlowsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawFlowsClient(clientOptions); this.executionsClient = Suppliers.memoize(() -> new AsyncExecutionsClient(clientOptions)); + this.vaultClient = Suppliers.memoize(() -> new AsyncVaultClient(clientOptions)); } /** @@ -98,4 +102,8 @@ public CompletableFuture update( public AsyncExecutionsClient executions() { return this.executionsClient.get(); } + + public AsyncVaultClient vault() { + return this.vaultClient.get(); + } } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java index 1bc137f5c..69d2802d6 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java @@ -10,6 +10,7 @@ import com.auth0.client.mgmt.emails.AsyncEmailsClient; import com.auth0.client.mgmt.guardian.AsyncGuardianClient; import com.auth0.client.mgmt.keys.AsyncKeysClient; +import com.auth0.client.mgmt.riskassessments.AsyncRiskAssessmentsClient; import com.auth0.client.mgmt.tenants.AsyncTenantsClient; import com.auth0.client.mgmt.verifiablecredentials.AsyncVerifiableCredentialsClient; import java.util.function.Supplier; @@ -25,6 +26,8 @@ public class AsyncManagementApi { protected final Supplier clientsClient; + protected final Supplier connectionProfilesClient; + protected final Supplier connectionsClient; protected final Supplier customDomainsClient; @@ -77,6 +80,8 @@ public class AsyncManagementApi { protected final Supplier tokenExchangeProfilesClient; + protected final Supplier userAttributeProfilesClient; + protected final Supplier userBlocksClient; protected final Supplier usersClient; @@ -91,6 +96,8 @@ public class AsyncManagementApi { protected final Supplier keysClient; + protected final Supplier riskAssessmentsClient; + protected final Supplier tenantsClient; protected final Supplier verifiableCredentialsClient; @@ -101,6 +108,7 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.brandingClient = Suppliers.memoize(() -> new AsyncBrandingClient(clientOptions)); this.clientGrantsClient = Suppliers.memoize(() -> new AsyncClientGrantsClient(clientOptions)); this.clientsClient = Suppliers.memoize(() -> new AsyncClientsClient(clientOptions)); + this.connectionProfilesClient = Suppliers.memoize(() -> new AsyncConnectionProfilesClient(clientOptions)); this.connectionsClient = Suppliers.memoize(() -> new AsyncConnectionsClient(clientOptions)); this.customDomainsClient = Suppliers.memoize(() -> new AsyncCustomDomainsClient(clientOptions)); this.deviceCredentialsClient = Suppliers.memoize(() -> new AsyncDeviceCredentialsClient(clientOptions)); @@ -127,6 +135,7 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.supplementalSignalsClient = Suppliers.memoize(() -> new AsyncSupplementalSignalsClient(clientOptions)); this.ticketsClient = Suppliers.memoize(() -> new AsyncTicketsClient(clientOptions)); this.tokenExchangeProfilesClient = Suppliers.memoize(() -> new AsyncTokenExchangeProfilesClient(clientOptions)); + this.userAttributeProfilesClient = Suppliers.memoize(() -> new AsyncUserAttributeProfilesClient(clientOptions)); this.userBlocksClient = Suppliers.memoize(() -> new AsyncUserBlocksClient(clientOptions)); this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); this.anomalyClient = Suppliers.memoize(() -> new AsyncAnomalyClient(clientOptions)); @@ -134,6 +143,7 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.emailsClient = Suppliers.memoize(() -> new AsyncEmailsClient(clientOptions)); this.guardianClient = Suppliers.memoize(() -> new AsyncGuardianClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions)); + this.riskAssessmentsClient = Suppliers.memoize(() -> new AsyncRiskAssessmentsClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new AsyncTenantsClient(clientOptions)); this.verifiableCredentialsClient = Suppliers.memoize(() -> new AsyncVerifiableCredentialsClient(clientOptions)); } @@ -154,6 +164,10 @@ public AsyncClientsClient clients() { return this.clientsClient.get(); } + public AsyncConnectionProfilesClient connectionProfiles() { + return this.connectionProfilesClient.get(); + } + public AsyncConnectionsClient connections() { return this.connectionsClient.get(); } @@ -258,6 +272,10 @@ public AsyncTokenExchangeProfilesClient tokenExchangeProfiles() { return this.tokenExchangeProfilesClient.get(); } + public AsyncUserAttributeProfilesClient userAttributeProfiles() { + return this.userAttributeProfilesClient.get(); + } + public AsyncUserBlocksClient userBlocks() { return this.userBlocksClient.get(); } @@ -286,6 +304,10 @@ public AsyncKeysClient keys() { return this.keysClient.get(); } + public AsyncRiskAssessmentsClient riskAssessments() { + return this.riskAssessmentsClient.get(); + } + public AsyncTenantsClient tenants() { return this.tenantsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java index 605d3cab8..0fcc037a6 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.AsyncClientGrantsClient; +import com.auth0.client.mgmt.organizations.AsyncDiscoveryDomainsClient; import com.auth0.client.mgmt.organizations.AsyncEnabledConnectionsClient; import com.auth0.client.mgmt.organizations.AsyncInvitationsClient; import com.auth0.client.mgmt.organizations.AsyncMembersClient; @@ -29,6 +30,8 @@ public class AsyncOrganizationsClient { protected final Supplier clientGrantsClient; + protected final Supplier discoveryDomainsClient; + protected final Supplier enabledConnectionsClient; protected final Supplier invitationsClient; @@ -39,6 +42,7 @@ public AsyncOrganizationsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawOrganizationsClient(clientOptions); this.clientGrantsClient = Suppliers.memoize(() -> new AsyncClientGrantsClient(clientOptions)); + this.discoveryDomainsClient = Suppliers.memoize(() -> new AsyncDiscoveryDomainsClient(clientOptions)); this.enabledConnectionsClient = Suppliers.memoize(() -> new AsyncEnabledConnectionsClient(clientOptions)); this.invitationsClient = Suppliers.memoize(() -> new AsyncInvitationsClient(clientOptions)); this.membersClient = Suppliers.memoize(() -> new AsyncMembersClient(clientOptions)); @@ -199,6 +203,10 @@ public AsyncClientGrantsClient clientGrants() { return this.clientGrantsClient.get(); } + public AsyncDiscoveryDomainsClient discoveryDomains() { + return this.discoveryDomainsClient.get(); + } + public AsyncEnabledConnectionsClient enabledConnections() { return this.enabledConnectionsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java index 38e4ae7e0..0e97f91a2 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawActionsClient.java @@ -76,12 +76,25 @@ public CompletableFuture>> HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("actions/actions"); - QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "actionName", request.getActionName(), false); - QueryStringMapper.addQueryParameter(httpUrl, "deployed", request.getDeployed(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "installed", request.getInstalled(), false); + if (!request.getTriggerId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "triggerId", request.getTriggerId().orElse(null), false); + } + if (!request.getActionName().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "actionName", request.getActionName().orElse(null), false); + } + if (!request.getDeployed().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "deployed", request.getDeployed().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getInstalled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "installed", request.getInstalled().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -366,7 +379,10 @@ public CompletableFuture> delete( .newBuilder() .addPathSegments("actions/actions") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "force", request.getForce(), false); + if (!request.getForce().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "force", request.getForce().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("DELETE", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java index 37ce81a4b..0d0236c26 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawClientGrantsClient.java @@ -51,14 +51,14 @@ public AsyncRawClientGrantsClient(ClientOptions clientOptions) { } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public CompletableFuture>> list() { return list(ListClientGrantsRequestParameters.builder().build()); } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public CompletableFuture>> list( ListClientGrantsRequestParameters request) { @@ -66,19 +66,37 @@ public CompletableFuture>> list( ListClientGrantsRequestParameters request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("client-grants"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter( - httpUrl, "allow_any_organization", request.getAllowAnyOrganization(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getAudience().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "audience", request.getAudience().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + if (!request.getAllowAnyOrganization().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "allow_any_organization", + request.getAllowAnyOrganization().orElse(null), + false); + } + if (!request.getSubjectType().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "subject_type", request.getSubjectType().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java index c9830f723..ebdd4995f 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawClientsClient.java @@ -29,8 +29,6 @@ import com.auth0.client.mgmt.types.UpdateClientRequestContent; import com.auth0.client.mgmt.types.UpdateClientResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -170,15 +168,34 @@ public CompletableFuture>> HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("clients"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "is_global", request.getIsGlobal(), false); - QueryStringMapper.addQueryParameter(httpUrl, "is_first_party", request.getIsFirstParty(), false); - QueryStringMapper.addQueryParameter(httpUrl, "app_type", request.getAppType(), false); - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getIsGlobal().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_global", request.getIsGlobal().orElse(null), false); + } + if (!request.getIsFirstParty().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_first_party", request.getIsFirstParty().orElse(null), false); + } + if (!request.getAppType().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "app_type", request.getAppType().orElse(null), false); + } + if (!request.getQ().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -196,18 +213,8 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - JsonNode node = ObjectMappers.JSON_MAPPER.readTree(responseBodyString); - ListClientsOffsetPaginatedResponseContent parsedResponse; - if (node.isArray()) { - List clients = - ObjectMappers.JSON_MAPPER.convertValue(node, new TypeReference>() {}); - parsedResponse = ListClientsOffsetPaginatedResponseContent.builder() - .clients(clients) - .build(); - } else { - parsedResponse = ObjectMappers.JSON_MAPPER.convertValue( - node, ListClientsOffsetPaginatedResponseContent.class); - } + ListClientsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientsOffsetPaginatedResponseContent.class); int newPageNumber = request.getPage() .map((Integer page) -> page + 1) .orElse(1); @@ -508,8 +515,14 @@ public CompletableFuture> ge .newBuilder() .addPathSegments("clients") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionProfilesClient.java new file mode 100644 index 000000000..1f2a5f77d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionProfilesClient.java @@ -0,0 +1,687 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionProfile; +import com.auth0.client.mgmt.types.CreateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfileRequestParameters; +import com.auth0.client.mgmt.types.ListConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConnectionProfilesClient { + protected final ClientOptions clientOptions; + + public AsyncRawConnectionProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list() { + return list(ListConnectionProfileRequestParameters.builder().build()); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list( + ListConnectionProfileRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list( + ListConnectionProfileRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListConnectionProfilesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionProfilesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListConnectionProfileRequestParameters nextRequest = + ListConnectionProfileRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getConnectionProfiles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a Connection Profile. + */ + public CompletableFuture> create( + CreateConnectionProfileRequestContent request) { + return create(request, null); + } + + /** + * Create a Connection Profile. + */ + public CompletableFuture> create( + CreateConnectionProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateConnectionProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public CompletableFuture> listTemplates() { + return listTemplates(null); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public CompletableFuture> listTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionProfileTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a Connection Profile Template. + */ + public CompletableFuture> getTemplate( + String id) { + return getTemplate(id, null); + } + + /** + * Retrieve a Connection Profile Template. + */ + public CompletableFuture> getTemplate( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionProfileTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateConnectionProfileRequestContent.builder().build()); + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture> update( + String id, UpdateConnectionProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific Connection Profile. + */ + public CompletableFuture> update( + String id, UpdateConnectionProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateConnectionProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java index 32ddd2f50..5801a60fc 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java @@ -114,11 +114,23 @@ public CompletableFuture .newBuilder() .addPathSegments("connections") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java index 0855f2a83..1a28637a7 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java @@ -9,6 +9,7 @@ import com.auth0.client.mgmt.core.ManagementException; import com.auth0.client.mgmt.core.MediaTypes; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.errors.BadRequestError; import com.auth0.client.mgmt.errors.ConflictError; @@ -20,6 +21,7 @@ import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; import com.auth0.client.mgmt.types.CustomDomain; import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.ListCustomDomainsRequestParameters; import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; @@ -51,23 +53,51 @@ public AsyncRawCustomDomainsClient(ClientOptions clientOptions) { * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ public CompletableFuture>> list() { - return list(null); + return list(ListCustomDomainsRequestParameters.builder().build()); } /** * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ - public CompletableFuture>> list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public CompletableFuture>> list( + ListCustomDomainsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public CompletableFuture>> list( + ListCustomDomainsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("custom-domains") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + .addPathSegments("custom-domains"); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + if (!request.getQ().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java index 7cb2d0ee6..d5b06e3db 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawDeviceCredentialsClient.java @@ -69,14 +69,31 @@ public CompletableFuture> getStats(String id) { - return getStats(id, EventStreamsGetStatsRequest.builder().build()); - } - - public CompletableFuture> getStats( - String id, EventStreamsGetStatsRequest request) { - return getStats(id, request, null); - } - - public CompletableFuture> getStats( - String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("event-streams") - .addPathSegment(id) - .addPathSegments("stats"); - QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = - new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - future.complete(new ManagementApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, GetEventStreamStatsResponseContent.class), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (IOException e) { - future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); - } - }); - return future; - } - public CompletableFuture> test( String id, CreateEventStreamTestEventRequestContent request) { return test(id, request, null); diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java index 8536b5af1..4fa428f1a 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawFlowsClient.java @@ -64,10 +64,15 @@ public CompletableFuture>> li HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "enabled", request.getEnabled().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getTriggerId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "triggerId", request.getTriggerId().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -288,7 +299,10 @@ public CompletableFuture> get( .newBuilder() .addPathSegments("hooks") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java index bf9d0bbde..c0ac5efc2 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java @@ -126,13 +126,27 @@ public CompletableFuture>> lis HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("logs"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getSearch().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "search", request.getSearch().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java index df1c5621c..f5d815ae3 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawNetworkAclsClient.java @@ -75,9 +75,11 @@ public CompletableFuture>> li HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "name_filter", request.getNameFilter(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getNameFilter().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name_filter", request.getNameFilter().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java index bcbe783b3..f450b876a 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRulesClient.java @@ -74,12 +74,23 @@ public CompletableFuture>> li HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("rules"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "enabled", request.getEnabled().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -290,8 +301,14 @@ public CompletableFuture> get( .newBuilder() .addPathSegments("rules") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java index 301e66a21..5dc12e7a7 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawSelfServiceProfilesClient.java @@ -74,9 +74,11 @@ public CompletableFuture> update(String id) { + return update(id, UpdateSessionRequestContent.builder().build()); + } + + /** + * Update session information. + */ + public CompletableFuture> update( + String id, UpdateSessionRequestContent request) { + return update(id, request, null); + } + + /** + * Update session information. + */ + public CompletableFuture> update( + String id, UpdateSessionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateSessionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + /** * Revokes a session by ID and all associated refresh tokens. */ diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java index d5e39b46c..77b5c4689 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawStatsClient.java @@ -135,8 +135,13 @@ public CompletableFuture>> getDaily( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("stats/daily"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + if (!request.getTo().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java index df2565f7c..8845ae309 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawTokenExchangeProfilesClient.java @@ -52,6 +52,7 @@ public AsyncRawTokenExchangeProfilesClient(ClientOptions clientOptions) { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -66,6 +67,7 @@ public AsyncRawTokenExchangeProfilesClient(ClientOptions clientOptions) { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -80,6 +82,7 @@ public CompletableFutureBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -92,8 +95,11 @@ public CompletableFutureBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> create( CreateTokenExchangeProfileRequestContent request) { @@ -188,6 +195,7 @@ public CompletableFutureBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> create( CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { @@ -277,6 +285,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> get(String id) { return get(id, null); @@ -284,6 +293,7 @@ public CompletableFutureBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> get( String id, RequestOptions requestOptions) { @@ -366,6 +376,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> delete(String id) { return delete(id, null); @@ -373,6 +384,7 @@ public CompletableFuture> delete(String id) { /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -440,6 +452,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> update(String id) { return update(id, UpdateTokenExchangeProfileRequestContent.builder().build()); @@ -447,6 +460,7 @@ public CompletableFuture> update(String id) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> update( String id, UpdateTokenExchangeProfileRequestContent request) { @@ -455,6 +469,7 @@ public CompletableFuture> update( /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture> update( String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java new file mode 100644 index 000000000..f4124c5fd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java @@ -0,0 +1,688 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfileRequestParameters; +import com.auth0.client.mgmt.types.ListUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.UserAttributeProfile; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUserAttributeProfilesClient { + protected final ClientOptions clientOptions; + + public AsyncRawUserAttributeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list() { + return list(ListUserAttributeProfileRequestParameters.builder().build()); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list( + ListUserAttributeProfileRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture>> list( + ListUserAttributeProfileRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserAttributeProfilesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserAttributeProfilesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListUserAttributeProfileRequestParameters nextRequest = + ListUserAttributeProfileRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getUserAttributeProfiles().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture> create( + CreateUserAttributeProfileRequestContent request) { + return create(request, null); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture> create( + CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateUserAttributeProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public CompletableFuture> + listTemplates() { + return listTemplates(null); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public CompletableFuture> listTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserAttributeProfileTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public CompletableFuture> getTemplate( + String id) { + return getTemplate(id, null); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public CompletableFuture> getTemplate( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAttributeProfileTemplateResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAttributeProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateUserAttributeProfileRequestContent.builder().build()); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture> update( + String id, UpdateUserAttributeProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture> update( + String id, UpdateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateUserAttributeProfileResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java index de09e52d8..f760785b9 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUserBlocksClient.java @@ -57,8 +57,13 @@ public CompletableFuture HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("grants"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getUserId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_id", request.getUserId().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + if (!request.getAudience().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "audience", request.getAudience().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java index 37e631f1e..6f69d800f 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java @@ -112,16 +112,38 @@ public CompletableFuture>> li HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("users-by-email"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) @@ -423,8 +451,14 @@ public CompletableFuture> get( .newBuilder() .addPathSegments("users") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java index 249462cbf..1d1859b8c 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncSessionsClient.java @@ -6,6 +6,8 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.auth0.client.mgmt.types.UpdateSessionRequestContent; +import com.auth0.client.mgmt.types.UpdateSessionResponseContent; import java.util.concurrent.CompletableFuture; public class AsyncSessionsClient { @@ -53,6 +55,28 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); } + /** + * Update session information. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update session information. + */ + public CompletableFuture update(String id, UpdateSessionRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update session information. + */ + public CompletableFuture update( + String id, UpdateSessionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + /** * Revokes a session by ID and all associated refresh tokens. */ diff --git a/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java index 197d72827..2780fe869 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncTokenExchangeProfilesClient.java @@ -33,6 +33,7 @@ public AsyncRawTokenExchangeProfilesClient withRawResponse() { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -46,6 +47,7 @@ public CompletableFuture /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -60,6 +62,7 @@ public CompletableFuture /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -74,6 +77,7 @@ public CompletableFuture /** * Create a new Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture create( CreateTokenExchangeProfileRequestContent request) { @@ -82,6 +86,7 @@ public CompletableFuture create( /** * Create a new Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture create( CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { @@ -90,6 +95,7 @@ public CompletableFuture create( /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture get(String id) { return this.rawClient.get(id).thenApply(response -> response.body()); @@ -97,6 +103,7 @@ public CompletableFuture get(String id) /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); @@ -104,6 +111,7 @@ public CompletableFuture get(String id, /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture delete(String id) { return this.rawClient.delete(id).thenApply(response -> response.body()); @@ -111,6 +119,7 @@ public CompletableFuture delete(String id) { /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture delete(String id, RequestOptions requestOptions) { return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); @@ -118,6 +127,7 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture update(String id) { return this.rawClient.update(id).thenApply(response -> response.body()); @@ -125,6 +135,7 @@ public CompletableFuture update(String id) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture update(String id, UpdateTokenExchangeProfileRequestContent request) { return this.rawClient.update(id, request).thenApply(response -> response.body()); @@ -132,6 +143,7 @@ public CompletableFuture update(String id, UpdateTokenExchangeProfileReque /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CompletableFuture update( String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java new file mode 100644 index 000000000..2400c905a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfileRequestParameters; +import com.auth0.client.mgmt.types.ListUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.UserAttributeProfile; +import java.util.concurrent.CompletableFuture; + +public class AsyncUserAttributeProfilesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUserAttributeProfilesClient rawClient; + + public AsyncUserAttributeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUserAttributeProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUserAttributeProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list( + ListUserAttributeProfileRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public CompletableFuture> list( + ListUserAttributeProfileRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture create( + CreateUserAttributeProfileRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture create( + CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public CompletableFuture listTemplates() { + return this.rawClient.listTemplates().thenApply(response -> response.body()); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public CompletableFuture listTemplates( + RequestOptions requestOptions) { + return this.rawClient.listTemplates(requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public CompletableFuture getTemplate(String id) { + return this.rawClient.getTemplate(id).thenApply(response -> response.body()); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public CompletableFuture getTemplate( + String id, RequestOptions requestOptions) { + return this.rawClient.getTemplate(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture update( + String id, UpdateUserAttributeProfileRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public CompletableFuture update( + String id, UpdateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java index 3aa9a841b..ca21d2976 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java @@ -20,6 +20,7 @@ import com.auth0.client.mgmt.types.UserResponseSchema; import com.auth0.client.mgmt.users.AsyncAuthenticationMethodsClient; import com.auth0.client.mgmt.users.AsyncAuthenticatorsClient; +import com.auth0.client.mgmt.users.AsyncConnectedAccountsClient; import com.auth0.client.mgmt.users.AsyncEnrollmentsClient; import com.auth0.client.mgmt.users.AsyncFederatedConnectionsTokensetsClient; import com.auth0.client.mgmt.users.AsyncIdentitiesClient; @@ -28,6 +29,7 @@ import com.auth0.client.mgmt.users.AsyncOrganizationsClient; import com.auth0.client.mgmt.users.AsyncPermissionsClient; import com.auth0.client.mgmt.users.AsyncRefreshTokenClient; +import com.auth0.client.mgmt.users.AsyncRiskAssessmentsClient; import com.auth0.client.mgmt.users.AsyncRolesClient; import com.auth0.client.mgmt.users.AsyncSessionsClient; import java.util.List; @@ -43,6 +45,8 @@ public class AsyncUsersClient { protected final Supplier authenticatorsClient; + protected final Supplier connectedAccountsClient; + protected final Supplier enrollmentsClient; protected final Supplier federatedConnectionsTokensetsClient; @@ -57,6 +61,8 @@ public class AsyncUsersClient { protected final Supplier permissionsClient; + protected final Supplier riskAssessmentsClient; + protected final Supplier rolesClient; protected final Supplier refreshTokenClient; @@ -68,6 +74,7 @@ public AsyncUsersClient(ClientOptions clientOptions) { this.rawClient = new AsyncRawUsersClient(clientOptions); this.authenticationMethodsClient = Suppliers.memoize(() -> new AsyncAuthenticationMethodsClient(clientOptions)); this.authenticatorsClient = Suppliers.memoize(() -> new AsyncAuthenticatorsClient(clientOptions)); + this.connectedAccountsClient = Suppliers.memoize(() -> new AsyncConnectedAccountsClient(clientOptions)); this.enrollmentsClient = Suppliers.memoize(() -> new AsyncEnrollmentsClient(clientOptions)); this.federatedConnectionsTokensetsClient = Suppliers.memoize(() -> new AsyncFederatedConnectionsTokensetsClient(clientOptions)); @@ -76,6 +83,7 @@ public AsyncUsersClient(ClientOptions clientOptions) { this.multifactorClient = Suppliers.memoize(() -> new AsyncMultifactorClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); this.permissionsClient = Suppliers.memoize(() -> new AsyncPermissionsClient(clientOptions)); + this.riskAssessmentsClient = Suppliers.memoize(() -> new AsyncRiskAssessmentsClient(clientOptions)); this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); this.refreshTokenClient = Suppliers.memoize(() -> new AsyncRefreshTokenClient(clientOptions)); this.sessionsClient = Suppliers.memoize(() -> new AsyncSessionsClient(clientOptions)); @@ -462,6 +470,10 @@ public AsyncAuthenticatorsClient authenticators() { return this.authenticatorsClient.get(); } + public AsyncConnectedAccountsClient connectedAccounts() { + return this.connectedAccountsClient.get(); + } + public AsyncEnrollmentsClient enrollments() { return this.enrollmentsClient.get(); } @@ -490,6 +502,10 @@ public AsyncPermissionsClient permissions() { return this.permissionsClient.get(); } + public AsyncRiskAssessmentsClient riskAssessments() { + return this.riskAssessmentsClient.get(); + } + public AsyncRolesClient roles() { return this.rolesClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java index dbc5aa1ed..88397cb94 100644 --- a/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/ClientGrantsClient.java @@ -37,21 +37,21 @@ public RawClientGrantsClient withRawResponse() { } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public SyncPagingIterable list() { return this.rawClient.list().body(); } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public SyncPagingIterable list(ListClientGrantsRequestParameters request) { return this.rawClient.list(request).body(); } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public SyncPagingIterable list( ListClientGrantsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/ConnectionProfilesClient.java b/src/main/java/com/auth0/client/mgmt/ConnectionProfilesClient.java new file mode 100644 index 000000000..54e4be959 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/ConnectionProfilesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionProfile; +import com.auth0.client.mgmt.types.CreateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfileRequestParameters; +import com.auth0.client.mgmt.types.ListConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileResponseContent; + +public class ConnectionProfilesClient { + protected final ClientOptions clientOptions; + + private final RawConnectionProfilesClient rawClient; + + public ConnectionProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectionProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectionProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list(ListConnectionProfileRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list( + ListConnectionProfileRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Create a Connection Profile. + */ + public CreateConnectionProfileResponseContent create(CreateConnectionProfileRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a Connection Profile. + */ + public CreateConnectionProfileResponseContent create( + CreateConnectionProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public ListConnectionProfileTemplateResponseContent listTemplates() { + return this.rawClient.listTemplates().body(); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public ListConnectionProfileTemplateResponseContent listTemplates(RequestOptions requestOptions) { + return this.rawClient.listTemplates(requestOptions).body(); + } + + /** + * Retrieve a Connection Profile Template. + */ + public GetConnectionProfileTemplateResponseContent getTemplate(String id) { + return this.rawClient.getTemplate(id).body(); + } + + /** + * Retrieve a Connection Profile Template. + */ + public GetConnectionProfileTemplateResponseContent getTemplate(String id, RequestOptions requestOptions) { + return this.rawClient.getTemplate(id, requestOptions).body(); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public GetConnectionProfileResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public GetConnectionProfileResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update the details of a specific Connection Profile. + */ + public UpdateConnectionProfileResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update the details of a specific Connection Profile. + */ + public UpdateConnectionProfileResponseContent update(String id, UpdateConnectionProfileRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update the details of a specific Connection Profile. + */ + public UpdateConnectionProfileResponseContent update( + String id, UpdateConnectionProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java index e6117738f..ead8fd00d 100644 --- a/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.connections.ClientsClient; +import com.auth0.client.mgmt.connections.DirectoryProvisioningClient; import com.auth0.client.mgmt.connections.KeysClient; import com.auth0.client.mgmt.connections.ScimConfigurationClient; import com.auth0.client.mgmt.connections.UsersClient; @@ -28,6 +29,8 @@ public class ConnectionsClient { protected final Supplier clientsClient; + protected final Supplier directoryProvisioningClient; + protected final Supplier keysClient; protected final Supplier scimConfigurationClient; @@ -38,6 +41,7 @@ public ConnectionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawConnectionsClient(clientOptions); this.clientsClient = Suppliers.memoize(() -> new ClientsClient(clientOptions)); + this.directoryProvisioningClient = Suppliers.memoize(() -> new DirectoryProvisioningClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new KeysClient(clientOptions)); this.scimConfigurationClient = Suppliers.memoize(() -> new ScimConfigurationClient(clientOptions)); this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); @@ -205,6 +209,10 @@ public ClientsClient clients() { return this.clientsClient.get(); } + public DirectoryProvisioningClient directoryProvisioning() { + return this.directoryProvisioningClient.get(); + } + public KeysClient keys() { return this.keysClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java index 5eed00085..c91dcdba1 100644 --- a/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java @@ -9,6 +9,7 @@ import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; import com.auth0.client.mgmt.types.CustomDomain; import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.ListCustomDomainsRequestParameters; import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; @@ -42,8 +43,15 @@ public List list() { /** * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ - public List list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).body(); + public List list(ListCustomDomainsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public List list(ListCustomDomainsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); } /** diff --git a/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java index 1c36c3491..826c1ca44 100644 --- a/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java @@ -13,9 +13,7 @@ import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; -import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; -import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; @@ -95,19 +93,6 @@ public UpdateEventStreamResponseContent update( return this.rawClient.update(id, request, requestOptions).body(); } - public GetEventStreamStatsResponseContent getStats(String id) { - return this.rawClient.getStats(id).body(); - } - - public GetEventStreamStatsResponseContent getStats(String id, EventStreamsGetStatsRequest request) { - return this.rawClient.getStats(id, request).body(); - } - - public GetEventStreamStatsResponseContent getStats( - String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { - return this.rawClient.getStats(id, request, requestOptions).body(); - } - public CreateEventStreamTestEventResponseContent test(String id, CreateEventStreamTestEventRequestContent request) { return this.rawClient.test(id, request).body(); } diff --git a/src/main/java/com/auth0/client/mgmt/FlowsClient.java b/src/main/java/com/auth0/client/mgmt/FlowsClient.java index 4b2fa3778..ab989e107 100644 --- a/src/main/java/com/auth0/client/mgmt/FlowsClient.java +++ b/src/main/java/com/auth0/client/mgmt/FlowsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.flows.ExecutionsClient; +import com.auth0.client.mgmt.flows.vault.VaultClient; import com.auth0.client.mgmt.types.CreateFlowRequestContent; import com.auth0.client.mgmt.types.CreateFlowResponseContent; import com.auth0.client.mgmt.types.FlowSummary; @@ -25,10 +26,13 @@ public class FlowsClient { protected final Supplier executionsClient; + protected final Supplier vaultClient; + public FlowsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawFlowsClient(clientOptions); this.executionsClient = Suppliers.memoize(() -> new ExecutionsClient(clientOptions)); + this.vaultClient = Suppliers.memoize(() -> new VaultClient(clientOptions)); } /** @@ -94,4 +98,8 @@ public UpdateFlowResponseContent update( public ExecutionsClient executions() { return this.executionsClient.get(); } + + public VaultClient vault() { + return this.vaultClient.get(); + } } diff --git a/src/main/java/com/auth0/client/mgmt/ManagementApi.java b/src/main/java/com/auth0/client/mgmt/ManagementApi.java index fdad4667b..6ffb86aa4 100644 --- a/src/main/java/com/auth0/client/mgmt/ManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/ManagementApi.java @@ -10,6 +10,7 @@ import com.auth0.client.mgmt.emails.EmailsClient; import com.auth0.client.mgmt.guardian.GuardianClient; import com.auth0.client.mgmt.keys.KeysClient; +import com.auth0.client.mgmt.riskassessments.RiskAssessmentsClient; import com.auth0.client.mgmt.tenants.TenantsClient; import com.auth0.client.mgmt.verifiablecredentials.VerifiableCredentialsClient; import java.util.function.Supplier; @@ -25,6 +26,8 @@ public class ManagementApi { protected final Supplier clientsClient; + protected final Supplier connectionProfilesClient; + protected final Supplier connectionsClient; protected final Supplier customDomainsClient; @@ -77,6 +80,8 @@ public class ManagementApi { protected final Supplier tokenExchangeProfilesClient; + protected final Supplier userAttributeProfilesClient; + protected final Supplier userBlocksClient; protected final Supplier usersClient; @@ -91,6 +96,8 @@ public class ManagementApi { protected final Supplier keysClient; + protected final Supplier riskAssessmentsClient; + protected final Supplier tenantsClient; protected final Supplier verifiableCredentialsClient; @@ -101,6 +108,7 @@ public ManagementApi(ClientOptions clientOptions) { this.brandingClient = Suppliers.memoize(() -> new BrandingClient(clientOptions)); this.clientGrantsClient = Suppliers.memoize(() -> new ClientGrantsClient(clientOptions)); this.clientsClient = Suppliers.memoize(() -> new ClientsClient(clientOptions)); + this.connectionProfilesClient = Suppliers.memoize(() -> new ConnectionProfilesClient(clientOptions)); this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions)); this.customDomainsClient = Suppliers.memoize(() -> new CustomDomainsClient(clientOptions)); this.deviceCredentialsClient = Suppliers.memoize(() -> new DeviceCredentialsClient(clientOptions)); @@ -127,6 +135,7 @@ public ManagementApi(ClientOptions clientOptions) { this.supplementalSignalsClient = Suppliers.memoize(() -> new SupplementalSignalsClient(clientOptions)); this.ticketsClient = Suppliers.memoize(() -> new TicketsClient(clientOptions)); this.tokenExchangeProfilesClient = Suppliers.memoize(() -> new TokenExchangeProfilesClient(clientOptions)); + this.userAttributeProfilesClient = Suppliers.memoize(() -> new UserAttributeProfilesClient(clientOptions)); this.userBlocksClient = Suppliers.memoize(() -> new UserBlocksClient(clientOptions)); this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); this.anomalyClient = Suppliers.memoize(() -> new AnomalyClient(clientOptions)); @@ -134,6 +143,7 @@ public ManagementApi(ClientOptions clientOptions) { this.emailsClient = Suppliers.memoize(() -> new EmailsClient(clientOptions)); this.guardianClient = Suppliers.memoize(() -> new GuardianClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new KeysClient(clientOptions)); + this.riskAssessmentsClient = Suppliers.memoize(() -> new RiskAssessmentsClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new TenantsClient(clientOptions)); this.verifiableCredentialsClient = Suppliers.memoize(() -> new VerifiableCredentialsClient(clientOptions)); } @@ -154,6 +164,10 @@ public ClientsClient clients() { return this.clientsClient.get(); } + public ConnectionProfilesClient connectionProfiles() { + return this.connectionProfilesClient.get(); + } + public ConnectionsClient connections() { return this.connectionsClient.get(); } @@ -258,6 +272,10 @@ public TokenExchangeProfilesClient tokenExchangeProfiles() { return this.tokenExchangeProfilesClient.get(); } + public UserAttributeProfilesClient userAttributeProfiles() { + return this.userAttributeProfilesClient.get(); + } + public UserBlocksClient userBlocks() { return this.userBlocksClient.get(); } @@ -286,6 +304,10 @@ public KeysClient keys() { return this.keysClient.get(); } + public RiskAssessmentsClient riskAssessments() { + return this.riskAssessmentsClient.get(); + } + public TenantsClient tenants() { return this.tenantsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java b/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java index 59a059857..8e2c6099f 100644 --- a/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java +++ b/src/main/java/com/auth0/client/mgmt/ManagementApiBuilder.java @@ -5,9 +5,11 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.Environment; +import com.auth0.client.mgmt.core.OAuthTokenSupplier; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.function.Supplier; import okhttp3.OkHttpClient; public class ManagementApiBuilder { @@ -23,6 +25,12 @@ public class ManagementApiBuilder { private OkHttpClient httpClient; + // Domain-based initialization fields + private String domain = null; + private String clientId = null; + private String clientSecret = null; + private String audience = null; + /** * Sets token */ @@ -41,6 +49,64 @@ public ManagementApiBuilder url(String url) { return this; } + /** + * Sets the Auth0 domain for the client. + * This will automatically construct the Management API URL as https://{domain}/api/v2 + * + *

Example: + *

{@code
+     * ManagementApi client = ManagementApi.builder()
+     *     .domain("your-tenant.auth0.com")
+     *     .clientCredentials("clientId", "clientSecret")
+     *     .build();
+     * }
+ * + * @param domain The Auth0 domain (e.g., "your-tenant.auth0.com") + * @return This builder for method chaining + */ + public ManagementApiBuilder domain(String domain) { + this.domain = domain; + return this; + } + + /** + * Sets OAuth client credentials for automatic token management. + * When using client credentials, the SDK will automatically fetch and cache + * access tokens, refreshing them before expiry. + * + *

This is the recommended authentication method for server-to-server + * applications using the client credentials grant. + * + *

Example: + *

{@code
+     * ManagementApi client = ManagementApi.builder()
+     *     .domain("your-tenant.auth0.com")
+     *     .clientCredentials("your-client-id", "your-client-secret")
+     *     .build();
+     * }
+ * + * @param clientId The OAuth client ID + * @param clientSecret The OAuth client secret + * @return This builder for method chaining + */ + public ManagementApiBuilder clientCredentials(String clientId, String clientSecret) { + this.clientId = clientId; + this.clientSecret = clientSecret; + return this; + } + + /** + * Sets a custom audience for the OAuth token request. + * If not specified, defaults to https://{domain}/api/v2/ + * + * @param audience The API audience for the token request + * @return This builder for method chaining + */ + public ManagementApiBuilder audience(String audience) { + this.audience = audience; + return this; + } + /** * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ @@ -94,31 +160,58 @@ protected ClientOptions buildClientOptions() { /** * Sets the environment configuration for the client. - * Override this method to modify URLs or add environment-specific logic. + * When domain is set, constructs the URL as https://{domain}/api/v2 + * Otherwise uses the environment or url() configuration. * * @param builder The ClientOptions.Builder to configure */ protected void setEnvironment(ClientOptions.Builder builder) { - builder.environment(this.environment); + if (this.domain != null) { + String url = "https://" + this.domain + "/api/v2"; + builder.environment(Environment.custom(url)); + } else { + builder.environment(this.environment); + } } /** - * Override this method to customize authentication. - * This method is called during client options construction to set up authentication headers. + * Returns the base URL for OAuth token requests. + * This is used internally by setAuthentication() to configure the OAuthTokenSupplier. * - * @param builder The ClientOptions.Builder to configure + * @return The base URL (e.g., "https://your-tenant.auth0.com") + */ + protected String getBaseUrl() { + if (this.domain != null) { + return "https://" + this.domain; + } + // Extract base URL from environment URL by removing /api/v2 suffix + String envUrl = this.environment.getUrl(); + if (envUrl.endsWith("/api/v2")) { + return envUrl.substring(0, envUrl.length() - 7); + } + return envUrl; + } + + /** + * Sets up authentication for the client. + * Supports both static token authentication and OAuth client credentials. * - * Example: - *
{@code
-     * @Override
-     * protected void setAuthentication(ClientOptions.Builder builder) {
-     *     super.setAuthentication(builder); // Keep existing auth
-     *     builder.addHeader("X-API-Key", this.apiKey);
-     * }
-     * }
+ *

When client credentials are configured, creates an OAuthTokenSupplier that + * automatically fetches and caches access tokens, refreshing them before expiry. + * + * @param builder The ClientOptions.Builder to configure */ protected void setAuthentication(ClientOptions.Builder builder) { - if (this.token != null) { + if (this.clientId != null && this.clientSecret != null) { + // OAuth client credentials flow with automatic token management + String baseUrl = getBaseUrl(); + String aud = this.audience != null ? this.audience : baseUrl + "/api/v2/"; + + OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier(this.clientId, this.clientSecret, baseUrl, aud); + + builder.addHeader("Authorization", (Supplier) () -> "Bearer " + tokenSupplier.get()); + } else if (this.token != null) { + // Static token authentication builder.addHeader("Authorization", "Bearer " + this.token); } } @@ -195,10 +288,40 @@ protected void setAdditional(ClientOptions.Builder builder) {} */ protected void validateConfiguration() {} + /** + * Builds the ManagementApi client with the configured options. + * + *

Requires either: + *

    + *
  • A static token via {@link #token(String)}, OR
  • + *
  • OAuth client credentials via {@link #clientCredentials(String, String)}
  • + *
+ * + *

The API URL can be configured via: + *

    + *
  • {@link #domain(String)} - recommended, automatically constructs the URL
  • + *
  • {@link #url(String)} - full URL specification
  • + *
  • {@link #environment(Environment)} - environment-based configuration
  • + *
+ * + * @return A configured ManagementApi client instance + * @throws RuntimeException if authentication is not configured + */ public ManagementApi build() { - if (token == null) { - throw new RuntimeException("Please provide token"); + // Validate authentication: require either token OR clientCredentials + boolean hasToken = this.token != null; + boolean hasClientCredentials = this.clientId != null && this.clientSecret != null; + + if (!hasToken && !hasClientCredentials) { + throw new RuntimeException( + "Please provide authentication: either token() or clientCredentials(clientId, clientSecret)"); } + + // Validate that if clientId is provided, clientSecret is also provided + if (this.clientId != null && this.clientSecret == null) { + throw new RuntimeException("clientSecret is required when using clientCredentials"); + } + validateConfiguration(); return new ManagementApi(buildClientOptions()); } diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java index a7fa6e91b..f03292852 100644 --- a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.ClientGrantsClient; +import com.auth0.client.mgmt.organizations.DiscoveryDomainsClient; import com.auth0.client.mgmt.organizations.EnabledConnectionsClient; import com.auth0.client.mgmt.organizations.InvitationsClient; import com.auth0.client.mgmt.organizations.MembersClient; @@ -28,6 +29,8 @@ public class OrganizationsClient { protected final Supplier clientGrantsClient; + protected final Supplier discoveryDomainsClient; + protected final Supplier enabledConnectionsClient; protected final Supplier invitationsClient; @@ -38,6 +41,7 @@ public OrganizationsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawOrganizationsClient(clientOptions); this.clientGrantsClient = Suppliers.memoize(() -> new ClientGrantsClient(clientOptions)); + this.discoveryDomainsClient = Suppliers.memoize(() -> new DiscoveryDomainsClient(clientOptions)); this.enabledConnectionsClient = Suppliers.memoize(() -> new EnabledConnectionsClient(clientOptions)); this.invitationsClient = Suppliers.memoize(() -> new InvitationsClient(clientOptions)); this.membersClient = Suppliers.memoize(() -> new MembersClient(clientOptions)); @@ -196,6 +200,10 @@ public ClientGrantsClient clientGrants() { return this.clientGrantsClient.get(); } + public DiscoveryDomainsClient discoveryDomains() { + return this.discoveryDomainsClient.get(); + } + public EnabledConnectionsClient enabledConnections() { return this.enabledConnectionsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/RawActionsClient.java b/src/main/java/com/auth0/client/mgmt/RawActionsClient.java index eaed26c01..98e3a8f4b 100644 --- a/src/main/java/com/auth0/client/mgmt/RawActionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawActionsClient.java @@ -70,12 +70,25 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("actions/actions"); - QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "actionName", request.getActionName(), false); - QueryStringMapper.addQueryParameter(httpUrl, "deployed", request.getDeployed(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "installed", request.getInstalled(), false); + if (!request.getTriggerId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "triggerId", request.getTriggerId().orElse(null), false); + } + if (!request.getActionName().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "actionName", request.getActionName().orElse(null), false); + } + if (!request.getDeployed().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "deployed", request.getDeployed().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getInstalled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "installed", request.getInstalled().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -285,7 +298,10 @@ public ManagementApiHttpResponse delete( .newBuilder() .addPathSegments("actions/actions") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "force", request.getForce(), false); + if (!request.getForce().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "force", request.getForce().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("DELETE", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java index 4c902ffb8..0911c9ce9 100644 --- a/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawClientGrantsClient.java @@ -46,14 +46,14 @@ public RawClientGrantsClient(ClientOptions clientOptions) { } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public ManagementApiHttpResponse> list() { return list(ListClientGrantsRequestParameters.builder().build()); } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public ManagementApiHttpResponse> list( ListClientGrantsRequestParameters request) { @@ -61,19 +61,37 @@ public ManagementApiHttpResponse> } /** - * Retrieve a list of <a href="https://auth0.com/docs/api-auth/grant/client-credentials">client grants</a>, including the scopes associated with the application/API pair. + * Retrieve a list of <a href="https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants">client grants</a>, including the scopes associated with the application/API pair. */ public ManagementApiHttpResponse> list( ListClientGrantsRequestParameters request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("client-grants"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter( - httpUrl, "allow_any_organization", request.getAllowAnyOrganization(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getAudience().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "audience", request.getAudience().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + if (!request.getAllowAnyOrganization().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "allow_any_organization", + request.getAllowAnyOrganization().orElse(null), + false); + } + if (!request.getSubjectType().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "subject_type", request.getSubjectType().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawClientsClient.java b/src/main/java/com/auth0/client/mgmt/RawClientsClient.java index 7d65da57f..1e6536e43 100644 --- a/src/main/java/com/auth0/client/mgmt/RawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawClientsClient.java @@ -29,8 +29,6 @@ import com.auth0.client.mgmt.types.UpdateClientRequestContent; import com.auth0.client.mgmt.types.UpdateClientResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -164,15 +162,34 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("clients"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "is_global", request.getIsGlobal(), false); - QueryStringMapper.addQueryParameter(httpUrl, "is_first_party", request.getIsFirstParty(), false); - QueryStringMapper.addQueryParameter(httpUrl, "app_type", request.getAppType(), false); - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getIsGlobal().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_global", request.getIsGlobal().orElse(null), false); + } + if (!request.getIsFirstParty().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_first_party", request.getIsFirstParty().orElse(null), false); + } + if (!request.getAppType().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "app_type", request.getAppType().orElse(null), false); + } + if (!request.getQ().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -187,18 +204,8 @@ public ManagementApiHttpResponse> list( ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - JsonNode node = ObjectMappers.JSON_MAPPER.readTree(responseBodyString); - ListClientsOffsetPaginatedResponseContent parsedResponse; - if (node.isArray()) { - List clients = - ObjectMappers.JSON_MAPPER.convertValue(node, new TypeReference>() {}); - parsedResponse = ListClientsOffsetPaginatedResponseContent.builder() - .clients(clients) - .build(); - } else { - parsedResponse = ObjectMappers.JSON_MAPPER.convertValue( - node, ListClientsOffsetPaginatedResponseContent.class); - } + ListClientsOffsetPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListClientsOffsetPaginatedResponseContent.class); int newPageNumber = request.getPage().map((Integer page) -> page + 1).orElse(1); ListClientsRequestParameters nextRequest = ListClientsRequestParameters.builder() @@ -448,8 +455,14 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("clients") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawConnectionProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawConnectionProfilesClient.java new file mode 100644 index 000000000..649d5b42c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawConnectionProfilesClient.java @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectionProfile; +import com.auth0.client.mgmt.types.CreateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfileRequestParameters; +import com.auth0.client.mgmt.types.ListConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectionProfilesClient { + protected final ClientOptions clientOptions; + + public RawConnectionProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list() { + return list(ListConnectionProfileRequestParameters.builder().build()); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list( + ListConnectionProfileRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list( + ListConnectionProfileRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListConnectionProfilesPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionProfilesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListConnectionProfileRequestParameters nextRequest = ListConnectionProfileRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getConnectionProfiles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a Connection Profile. + */ + public ManagementApiHttpResponse create( + CreateConnectionProfileRequestContent request) { + return create(request, null); + } + + /** + * Create a Connection Profile. + */ + public ManagementApiHttpResponse create( + CreateConnectionProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateConnectionProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public ManagementApiHttpResponse listTemplates() { + return listTemplates(null); + } + + /** + * Retrieve a list of Connection Profile Templates. + */ + public ManagementApiHttpResponse listTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListConnectionProfileTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a Connection Profile Template. + */ + public ManagementApiHttpResponse getTemplate(String id) { + return getTemplate(id, null); + } + + /** + * Retrieve a Connection Profile Template. + */ + public ManagementApiHttpResponse getTemplate( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionProfileTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single Connection Profile specified by ID. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetConnectionProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a single Connection Profile specified by ID. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the details of a specific Connection Profile. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateConnectionProfileRequestContent.builder().build()); + } + + /** + * Update the details of a specific Connection Profile. + */ + public ManagementApiHttpResponse update( + String id, UpdateConnectionProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific Connection Profile. + */ + public ManagementApiHttpResponse update( + String id, UpdateConnectionProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connection-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateConnectionProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java index 19eb96d41..67750ac80 100644 --- a/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java @@ -109,11 +109,23 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("connections"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "name", request.getName(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getName().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } if (request.getStrategy().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "strategy", request.getStrategy().get(), true); @@ -268,8 +280,14 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("connections") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java index 16d134937..5a6a00cfb 100644 --- a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java @@ -9,6 +9,7 @@ import com.auth0.client.mgmt.core.ManagementException; import com.auth0.client.mgmt.core.MediaTypes; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.errors.BadRequestError; import com.auth0.client.mgmt.errors.ConflictError; @@ -20,6 +21,7 @@ import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; import com.auth0.client.mgmt.types.CustomDomain; import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.ListCustomDomainsRequestParameters; import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; @@ -47,23 +49,50 @@ public RawCustomDomainsClient(ClientOptions clientOptions) { * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ public ManagementApiHttpResponse> list() { - return list(null); + return list(ListCustomDomainsRequestParameters.builder().build()); } /** * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. */ - public ManagementApiHttpResponse> list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + public ManagementApiHttpResponse> list(ListCustomDomainsRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve details on <a href="https://auth0.com/docs/custom-domains">custom domains</a>. + */ + public ManagementApiHttpResponse> list( + ListCustomDomainsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("custom-domains") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + .addPathSegments("custom-domains"); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + if (!request.getQ().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); diff --git a/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java b/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java index 91afb578e..7412f575f 100644 --- a/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawDeviceCredentialsClient.java @@ -64,14 +64,31 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("device-credentials"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "type", request.getType(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + if (!request.getUserId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_id", request.getUserId().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + if (!request.getType().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java index 2c3524b0e..e370decf4 100644 --- a/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java @@ -22,9 +22,7 @@ import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; -import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; -import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; @@ -60,8 +58,11 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("event-streams"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -346,72 +347,6 @@ public ManagementApiHttpResponse update( } } - public ManagementApiHttpResponse getStats(String id) { - return getStats(id, EventStreamsGetStatsRequest.builder().build()); - } - - public ManagementApiHttpResponse getStats( - String id, EventStreamsGetStatsRequest request) { - return getStats(id, request, null); - } - - public ManagementApiHttpResponse getStats( - String id, EventStreamsGetStatsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("event-streams") - .addPathSegment(id) - .addPathSegments("stats"); - QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - return new ManagementApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, GetEventStreamStatsResponseContent.class), - response); - } - try { - switch (response.code()) { - case 400: - throw new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 401: - throw new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 429: - throw new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - throw new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response); - } catch (IOException e) { - throw new ManagementException("Network error executing HTTP request", e); - } - } - public ManagementApiHttpResponse test( String id, CreateEventStreamTestEventRequestContent request) { return test(id, request, null); diff --git a/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java b/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java index d51337ba9..184118e1c 100644 --- a/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawFlowsClient.java @@ -58,10 +58,15 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("flows"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "synchronous", request.getSynchronous(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getSynchronous().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "synchronous", request.getSynchronous().orElse(null), false); + } if (request.getHydrate().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "hydrate", request.getHydrate().get(), true); diff --git a/src/main/java/com/auth0/client/mgmt/RawFormsClient.java b/src/main/java/com/auth0/client/mgmt/RawFormsClient.java index 2ffeb21c5..dbcca1501 100644 --- a/src/main/java/com/auth0/client/mgmt/RawFormsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawFormsClient.java @@ -58,9 +58,11 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("forms"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); if (request.getHydrate().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "hydrate", request.getHydrate().get(), true); diff --git a/src/main/java/com/auth0/client/mgmt/RawHooksClient.java b/src/main/java/com/auth0/client/mgmt/RawHooksClient.java index d987bd366..316459bd5 100644 --- a/src/main/java/com/auth0/client/mgmt/RawHooksClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawHooksClient.java @@ -68,12 +68,23 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "triggerId", request.getTriggerId(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "enabled", request.getEnabled().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getTriggerId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "triggerId", request.getTriggerId().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -226,7 +237,10 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("hooks") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawLogsClient.java b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java index e3c6a5b18..8b6c77553 100644 --- a/src/main/java/com/auth0/client/mgmt/RawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java @@ -120,13 +120,27 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("logs"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getSearch().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "search", request.getSearch().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java b/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java index 002706c58..9748e193f 100644 --- a/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawNetworkAclsClient.java @@ -70,9 +70,11 @@ public ManagementApiHttpResponse> HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("network-acls"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java index f743210c4..c7c7df5f7 100644 --- a/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java @@ -109,9 +109,15 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("organizations"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java index c8904a599..847c201ef 100644 --- a/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java @@ -69,10 +69,15 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("resource-servers"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } if (request.getIdentifiers().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "identifiers", request.getIdentifiers().get(), true); @@ -230,7 +235,10 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("resource-servers") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java index 1c4371205..6845e898f 100644 --- a/src/main/java/com/auth0/client/mgmt/RawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java @@ -69,10 +69,15 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "name_filter", request.getNameFilter(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getNameFilter().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name_filter", request.getNameFilter().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawRulesClient.java b/src/main/java/com/auth0/client/mgmt/RawRulesClient.java index ccc35606b..c58b81dd4 100644 --- a/src/main/java/com/auth0/client/mgmt/RawRulesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawRulesClient.java @@ -68,12 +68,23 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("rules"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "enabled", request.getEnabled(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "enabled", request.getEnabled().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -228,8 +239,14 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("rules") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java index 2437a132d..3e0b71886 100644 --- a/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawSelfServiceProfilesClient.java @@ -69,9 +69,11 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("self-service-profiles"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java index 6f5a6badd..97bfdaf04 100644 --- a/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawSessionsClient.java @@ -7,6 +7,7 @@ import com.auth0.client.mgmt.core.ManagementApiException; import com.auth0.client.mgmt.core.ManagementApiHttpResponse; import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.errors.BadRequestError; @@ -15,6 +16,8 @@ import com.auth0.client.mgmt.errors.TooManyRequestsError; import com.auth0.client.mgmt.errors.UnauthorizedError; import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.auth0.client.mgmt.types.UpdateSessionRequestContent; +import com.auth0.client.mgmt.types.UpdateSessionResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import okhttp3.Headers; @@ -150,6 +153,86 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO } } + /** + * Update session information. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateSessionRequestContent.builder().build()); + } + + /** + * Update session information. + */ + public ManagementApiHttpResponse update( + String id, UpdateSessionRequestContent request) { + return update(id, request, null); + } + + /** + * Update session information. + */ + public ManagementApiHttpResponse update( + String id, UpdateSessionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("sessions") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, UpdateSessionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + /** * Revokes a session by ID and all associated refresh tokens. */ diff --git a/src/main/java/com/auth0/client/mgmt/RawStatsClient.java b/src/main/java/com/auth0/client/mgmt/RawStatsClient.java index 527b79764..e4e0df9bd 100644 --- a/src/main/java/com/auth0/client/mgmt/RawStatsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawStatsClient.java @@ -111,8 +111,13 @@ public ManagementApiHttpResponse> getDaily( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("stats/daily"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + if (!request.getTo().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java index 560994601..0c5c0a709 100644 --- a/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawTokenExchangeProfilesClient.java @@ -47,6 +47,7 @@ public RawTokenExchangeProfilesClient(ClientOptions clientOptions) { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -60,6 +61,7 @@ public ManagementApiHttpResponseBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -74,6 +76,7 @@ public ManagementApiHttpResponseBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -86,8 +89,11 @@ public ManagementApiHttpResponseBy using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse create( CreateTokenExchangeProfileRequestContent request) { @@ -154,6 +161,7 @@ public ManagementApiHttpResponse crea /** * Create a new Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse create( CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { @@ -219,6 +227,7 @@ public ManagementApiHttpResponse crea /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse get(String id) { return get(id, null); @@ -226,6 +235,7 @@ public ManagementApiHttpResponse get(Str /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse get( String id, RequestOptions requestOptions) { @@ -284,6 +294,7 @@ public ManagementApiHttpResponse get( /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse delete(String id) { return delete(id, null); @@ -291,6 +302,7 @@ public ManagementApiHttpResponse delete(String id) { /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -339,6 +351,7 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse update(String id) { return update(id, UpdateTokenExchangeProfileRequestContent.builder().build()); @@ -346,6 +359,7 @@ public ManagementApiHttpResponse update(String id) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse update(String id, UpdateTokenExchangeProfileRequestContent request) { return update(id, request, null); @@ -353,6 +367,7 @@ public ManagementApiHttpResponse update(String id, UpdateTokenExchangeProf /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public ManagementApiHttpResponse update( String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java new file mode 100644 index 000000000..5af63d14d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java @@ -0,0 +1,523 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfileRequestParameters; +import com.auth0.client.mgmt.types.ListUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfilesPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.UserAttributeProfile; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUserAttributeProfilesClient { + protected final ClientOptions clientOptions; + + public RawUserAttributeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list() { + return list(ListUserAttributeProfileRequestParameters.builder().build()); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list( + ListUserAttributeProfileRequestParameters request) { + return list(request, null); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public ManagementApiHttpResponse> list( + ListUserAttributeProfileRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserAttributeProfilesPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserAttributeProfilesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListUserAttributeProfileRequestParameters nextRequest = + ListUserAttributeProfileRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getUserAttributeProfiles().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse create( + CreateUserAttributeProfileRequestContent request) { + return create(request, null); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse create( + CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateUserAttributeProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public ManagementApiHttpResponse listTemplates() { + return listTemplates(null); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public ManagementApiHttpResponse listTemplates( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles/templates") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserAttributeProfileTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public ManagementApiHttpResponse getTemplate(String id) { + return getTemplate(id, null); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public ManagementApiHttpResponse getTemplate( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles/templates") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAttributeProfileTemplateResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetUserAttributeProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateUserAttributeProfileRequestContent.builder().build()); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public ManagementApiHttpResponse update( + String id, UpdateUserAttributeProfileRequestContent request) { + return update(id, request, null); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public ManagementApiHttpResponse update( + String id, UpdateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user-attribute-profiles") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateUserAttributeProfileResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java b/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java index 1f08c7554..eb1e604e1 100644 --- a/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawUserBlocksClient.java @@ -53,8 +53,13 @@ public ManagementApiHttpResponse list .newBuilder() .addPathSegments("user-blocks"); QueryStringMapper.addQueryParameter(httpUrl, "identifier", request.getIdentifier(), false); - QueryStringMapper.addQueryParameter( - httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + if (!request.getConsiderBruteForceEnablement().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "consider_brute_force_enablement", + request.getConsiderBruteForceEnablement().orElse(null), + false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -184,8 +189,13 @@ public ManagementApiHttpResponse list( .newBuilder() .addPathSegments("user-blocks") .addPathSegment(id); - QueryStringMapper.addQueryParameter( - httpUrl, "consider_brute_force_enablement", request.getConsiderBruteForceEnablement(), false); + if (!request.getConsiderBruteForceEnablement().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "consider_brute_force_enablement", + request.getConsiderBruteForceEnablement().orElse(null), + false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java b/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java index 3bc16af29..d42d2ad39 100644 --- a/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawUserGrantsClient.java @@ -58,12 +58,23 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("grants"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getUserId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_id", request.getUserId().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + if (!request.getAudience().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "audience", request.getAudience().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java index 972898d33..02f76f6c1 100644 --- a/src/main/java/com/auth0/client/mgmt/RawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java @@ -106,16 +106,38 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("users"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); - QueryStringMapper.addQueryParameter(httpUrl, "connection", request.getConnection(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ(), false); - QueryStringMapper.addQueryParameter(httpUrl, "search_engine", request.getSearchEngine(), false); - QueryStringMapper.addQueryParameter(httpUrl, "primary_order", request.getPrimaryOrder(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + if (!request.getConnection().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "connection", request.getConnection().orElse(null), false); + } + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + if (!request.getQ().isAbsent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); + } + if (!request.getSearchEngine().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "search_engine", request.getSearchEngine().orElse(null), false); + } + if (!request.getPrimaryOrder().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "primary_order", request.getPrimaryOrder().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -267,8 +289,14 @@ public ManagementApiHttpResponse> listUsersByEmail( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("users-by-email"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } QueryStringMapper.addQueryParameter(httpUrl, "email", request.getEmail(), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) @@ -338,8 +366,14 @@ public ManagementApiHttpResponse get( .newBuilder() .addPathSegments("users") .addPathSegment(id); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/SessionsClient.java b/src/main/java/com/auth0/client/mgmt/SessionsClient.java index 9816fc79f..873e5995e 100644 --- a/src/main/java/com/auth0/client/mgmt/SessionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/SessionsClient.java @@ -6,6 +6,8 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.auth0.client.mgmt.types.UpdateSessionRequestContent; +import com.auth0.client.mgmt.types.UpdateSessionResponseContent; public class SessionsClient { protected final ClientOptions clientOptions; @@ -52,6 +54,28 @@ public void delete(String id, RequestOptions requestOptions) { this.rawClient.delete(id, requestOptions).body(); } + /** + * Update session information. + */ + public UpdateSessionResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update session information. + */ + public UpdateSessionResponseContent update(String id, UpdateSessionRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update session information. + */ + public UpdateSessionResponseContent update( + String id, UpdateSessionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + /** * Revokes a session by ID and all associated refresh tokens. */ diff --git a/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java index b57d91f23..6b8acbe71 100644 --- a/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/TokenExchangeProfilesClient.java @@ -32,6 +32,7 @@ public RawTokenExchangeProfilesClient withRawResponse() { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -45,6 +46,7 @@ public SyncPagingIterable list() { /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -58,6 +60,7 @@ public SyncPagingIterable list(TokenExchang /** * Retrieve a list of all Token Exchange Profiles available in your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*

This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:

*

<ul> * <li><code>from</code>: Optional id from which to start selection.</li> @@ -72,6 +75,7 @@ public SyncPagingIterable list( /** * Create a new Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CreateTokenExchangeProfileResponseContent create(CreateTokenExchangeProfileRequestContent request) { return this.rawClient.create(request).body(); @@ -79,6 +83,7 @@ public CreateTokenExchangeProfileResponseContent create(CreateTokenExchangeProfi /** * Create a new Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public CreateTokenExchangeProfileResponseContent create( CreateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { @@ -87,6 +92,7 @@ public CreateTokenExchangeProfileResponseContent create( /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public GetTokenExchangeProfileResponseContent get(String id) { return this.rawClient.get(id).body(); @@ -94,6 +100,7 @@ public GetTokenExchangeProfileResponseContent get(String id) { /** * Retrieve details about a single Token Exchange Profile specified by ID. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public GetTokenExchangeProfileResponseContent get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).body(); @@ -101,6 +108,7 @@ public GetTokenExchangeProfileResponseContent get(String id, RequestOptions requ /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public void delete(String id) { this.rawClient.delete(id).body(); @@ -108,6 +116,7 @@ public void delete(String id) { /** * Delete a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public void delete(String id, RequestOptions requestOptions) { this.rawClient.delete(id, requestOptions).body(); @@ -115,6 +124,7 @@ public void delete(String id, RequestOptions requestOptions) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public void update(String id) { this.rawClient.update(id).body(); @@ -122,6 +132,7 @@ public void update(String id) { /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public void update(String id, UpdateTokenExchangeProfileRequestContent request) { this.rawClient.update(id, request).body(); @@ -129,6 +140,7 @@ public void update(String id, UpdateTokenExchangeProfileRequestContent request) /** * Update a Token Exchange Profile within your tenant. + *

By using this feature, you agree to the applicable Free Trial terms in <a href="https://www.okta.com/legal/">Okta's Master Subscription Agreement</a>. It is your responsibility to securely validate the user's subject_token. See <a href="https://auth0.com/docs/authenticate/custom-token-exchange">User Guide</a> for more details.

*/ public void update(String id, UpdateTokenExchangeProfileRequestContent request, RequestOptions requestOptions) { this.rawClient.update(id, request, requestOptions).body(); diff --git a/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java new file mode 100644 index 000000000..854cbbd44 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfileRequestParameters; +import com.auth0.client.mgmt.types.ListUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.UserAttributeProfile; + +public class UserAttributeProfilesClient { + protected final ClientOptions clientOptions; + + private final RawUserAttributeProfilesClient rawClient; + + public UserAttributeProfilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUserAttributeProfilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUserAttributeProfilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list(ListUserAttributeProfileRequestParameters request) { + return this.rawClient.list(request).body(); + } + + /** + * Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. + */ + public SyncPagingIterable list( + ListUserAttributeProfileRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CreateUserAttributeProfileResponseContent create(CreateUserAttributeProfileRequestContent request) { + return this.rawClient.create(request).body(); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public CreateUserAttributeProfileResponseContent create( + CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public ListUserAttributeProfileTemplateResponseContent listTemplates() { + return this.rawClient.listTemplates().body(); + } + + /** + * Retrieve a list of User Attribute Profile Templates. + */ + public ListUserAttributeProfileTemplateResponseContent listTemplates(RequestOptions requestOptions) { + return this.rawClient.listTemplates(requestOptions).body(); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public GetUserAttributeProfileTemplateResponseContent getTemplate(String id) { + return this.rawClient.getTemplate(id).body(); + } + + /** + * Retrieve a User Attribute Profile Template. + */ + public GetUserAttributeProfileTemplateResponseContent getTemplate(String id, RequestOptions requestOptions) { + return this.rawClient.getTemplate(id, requestOptions).body(); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public GetUserAttributeProfileResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve details about a single User Attribute Profile specified by ID. + */ + public GetUserAttributeProfileResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete a single User Attribute Profile specified by ID. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public UpdateUserAttributeProfileResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public UpdateUserAttributeProfileResponseContent update( + String id, UpdateUserAttributeProfileRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update the details of a specific User attribute profile, such as name, user_id and user_attributes. + */ + public UpdateUserAttributeProfileResponseContent update( + String id, UpdateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/UsersClient.java b/src/main/java/com/auth0/client/mgmt/UsersClient.java index 996207b2a..f8151f803 100644 --- a/src/main/java/com/auth0/client/mgmt/UsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/UsersClient.java @@ -20,6 +20,7 @@ import com.auth0.client.mgmt.types.UserResponseSchema; import com.auth0.client.mgmt.users.AuthenticationMethodsClient; import com.auth0.client.mgmt.users.AuthenticatorsClient; +import com.auth0.client.mgmt.users.ConnectedAccountsClient; import com.auth0.client.mgmt.users.EnrollmentsClient; import com.auth0.client.mgmt.users.FederatedConnectionsTokensetsClient; import com.auth0.client.mgmt.users.IdentitiesClient; @@ -28,6 +29,7 @@ import com.auth0.client.mgmt.users.OrganizationsClient; import com.auth0.client.mgmt.users.PermissionsClient; import com.auth0.client.mgmt.users.RefreshTokenClient; +import com.auth0.client.mgmt.users.RiskAssessmentsClient; import com.auth0.client.mgmt.users.RolesClient; import com.auth0.client.mgmt.users.SessionsClient; import java.util.List; @@ -42,6 +44,8 @@ public class UsersClient { protected final Supplier authenticatorsClient; + protected final Supplier connectedAccountsClient; + protected final Supplier enrollmentsClient; protected final Supplier federatedConnectionsTokensetsClient; @@ -56,6 +60,8 @@ public class UsersClient { protected final Supplier permissionsClient; + protected final Supplier riskAssessmentsClient; + protected final Supplier rolesClient; protected final Supplier refreshTokenClient; @@ -67,6 +73,7 @@ public UsersClient(ClientOptions clientOptions) { this.rawClient = new RawUsersClient(clientOptions); this.authenticationMethodsClient = Suppliers.memoize(() -> new AuthenticationMethodsClient(clientOptions)); this.authenticatorsClient = Suppliers.memoize(() -> new AuthenticatorsClient(clientOptions)); + this.connectedAccountsClient = Suppliers.memoize(() -> new ConnectedAccountsClient(clientOptions)); this.enrollmentsClient = Suppliers.memoize(() -> new EnrollmentsClient(clientOptions)); this.federatedConnectionsTokensetsClient = Suppliers.memoize(() -> new FederatedConnectionsTokensetsClient(clientOptions)); @@ -75,6 +82,7 @@ public UsersClient(ClientOptions clientOptions) { this.multifactorClient = Suppliers.memoize(() -> new MultifactorClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); this.permissionsClient = Suppliers.memoize(() -> new PermissionsClient(clientOptions)); + this.riskAssessmentsClient = Suppliers.memoize(() -> new RiskAssessmentsClient(clientOptions)); this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); this.refreshTokenClient = Suppliers.memoize(() -> new RefreshTokenClient(clientOptions)); this.sessionsClient = Suppliers.memoize(() -> new SessionsClient(clientOptions)); @@ -457,6 +465,10 @@ public AuthenticatorsClient authenticators() { return this.authenticatorsClient.get(); } + public ConnectedAccountsClient connectedAccounts() { + return this.connectedAccountsClient.get(); + } + public EnrollmentsClient enrollments() { return this.enrollmentsClient.get(); } @@ -485,6 +497,10 @@ public PermissionsClient permissions() { return this.permissionsClient.get(); } + public RiskAssessmentsClient riskAssessments() { + return this.riskAssessmentsClient.get(); + } + public RolesClient roles() { return this.rolesClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java index c2da1d670..11e8bf2f3 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/actions/AsyncRawVersionsClient.java @@ -73,8 +73,9 @@ public CompletableFuture> list( .addPathSegments("actions/actions") .addPathSegment(actionId) .addPathSegments("versions"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java index 560a6e952..8e82915d3 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/AsyncRawBindingsClient.java @@ -71,8 +71,9 @@ public CompletableFuture> list( .addPathSegments("actions/triggers") .addPathSegment(triggerId) .addPathSegments("bindings"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java index da6c71732..840914c53 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.actions.triggers.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListActionTriggerBindingsRequestParameters.Builder.class) @@ -44,9 +44,6 @@ private ListActionTriggerBindingsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -59,13 +56,7 @@ public OptionalNullable getPerPage() { return perPage; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionTriggerBindingsRequestParameters @@ -81,12 +72,12 @@ private boolean equalTo(ListActionTriggerBindingsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +107,7 @@ public Builder from(ListActionTriggerBindingsRequestParameters other) { *

Use this field to request a specific page of the list results.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -135,7 +126,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -169,7 +160,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java index c65556ba6..999c480b2 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java @@ -40,7 +40,7 @@ public Optional> getBindings() { return bindings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionBindingsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(UpdateActionBindingsRequestContent other) { return bindings.equals(other.bindings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bindings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java index fe08671be..f6a2c8aa8 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.actions.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListActionVersionsRequestParameters.Builder.class) @@ -44,9 +44,6 @@ private ListActionVersionsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -59,13 +56,7 @@ public OptionalNullable getPerPage() { return perPage; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionVersionsRequestParameters @@ -81,12 +72,12 @@ private boolean equalTo(ListActionVersionsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +107,7 @@ public Builder from(ListActionVersionsRequestParameters other) { *

Use this field to request a specific page of the list results.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -135,7 +126,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -169,7 +160,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java index df5acd946..cbe0ff373 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncAttackProtectionClient.java @@ -10,21 +10,31 @@ public class AsyncAttackProtectionClient { protected final ClientOptions clientOptions; + protected final Supplier botDetectionClient; + protected final Supplier breachedPasswordDetectionClient; protected final Supplier bruteForceProtectionClient; + protected final Supplier captchaClient; + protected final Supplier suspiciousIpThrottlingClient; public AsyncAttackProtectionClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; + this.botDetectionClient = Suppliers.memoize(() -> new AsyncBotDetectionClient(clientOptions)); this.breachedPasswordDetectionClient = Suppliers.memoize(() -> new AsyncBreachedPasswordDetectionClient(clientOptions)); this.bruteForceProtectionClient = Suppliers.memoize(() -> new AsyncBruteForceProtectionClient(clientOptions)); + this.captchaClient = Suppliers.memoize(() -> new AsyncCaptchaClient(clientOptions)); this.suspiciousIpThrottlingClient = Suppliers.memoize(() -> new AsyncSuspiciousIpThrottlingClient(clientOptions)); } + public AsyncBotDetectionClient botDetection() { + return this.botDetectionClient.get(); + } + public AsyncBreachedPasswordDetectionClient breachedPasswordDetection() { return this.breachedPasswordDetectionClient.get(); } @@ -33,6 +43,10 @@ public AsyncBruteForceProtectionClient bruteForceProtection() { return this.bruteForceProtectionClient.get(); } + public AsyncCaptchaClient captcha() { + return this.captchaClient.get(); + } + public AsyncSuspiciousIpThrottlingClient suspiciousIpThrottling() { return this.suspiciousIpThrottlingClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBotDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBotDetectionClient.java new file mode 100644 index 000000000..523b9ff77 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncBotDetectionClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBotDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBotDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBotDetectionSettingsResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncBotDetectionClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBotDetectionClient rawClient; + + public AsyncBotDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBotDetectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBotDetectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBotDetectionSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture update( + UpdateBotDetectionSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncCaptchaClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncCaptchaClient.java new file mode 100644 index 000000000..64ccef632 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncCaptchaClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateAttackProtectionCaptchaRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetAttackProtectionCaptchaResponseContent; +import com.auth0.client.mgmt.types.UpdateAttackProtectionCaptchaResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncCaptchaClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCaptchaClient rawClient; + + public AsyncCaptchaClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCaptchaClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCaptchaClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture update() { + return this.rawClient.update().thenApply(response -> response.body()); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture update( + UpdateAttackProtectionCaptchaRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture update( + UpdateAttackProtectionCaptchaRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBotDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBotDetectionClient.java new file mode 100644 index 000000000..c8d7f6f83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawBotDetectionClient.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBotDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBotDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBotDetectionSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBotDetectionClient { + protected final ClientOptions clientOptions; + + public AsyncRawBotDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/bot-detection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBotDetectionSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture> update() { + return update(UpdateBotDetectionSettingsRequestContent.builder().build()); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBotDetectionSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public CompletableFuture> update( + UpdateBotDetectionSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/bot-detection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBotDetectionSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawCaptchaClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawCaptchaClient.java new file mode 100644 index 000000000..d0f1cd3e6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AsyncRawCaptchaClient.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateAttackProtectionCaptchaRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetAttackProtectionCaptchaResponseContent; +import com.auth0.client.mgmt.types.UpdateAttackProtectionCaptchaResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCaptchaClient { + protected final ClientOptions clientOptions; + + public AsyncRawCaptchaClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/captcha") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetAttackProtectionCaptchaResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture> update() { + return update(UpdateAttackProtectionCaptchaRequestContent.builder().build()); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture> update( + UpdateAttackProtectionCaptchaRequestContent request) { + return update(request, null); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public CompletableFuture> update( + UpdateAttackProtectionCaptchaRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/captcha") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateAttackProtectionCaptchaResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java index 5d4a81c20..d791fe54c 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/AttackProtectionClient.java @@ -10,20 +10,30 @@ public class AttackProtectionClient { protected final ClientOptions clientOptions; + protected final Supplier botDetectionClient; + protected final Supplier breachedPasswordDetectionClient; protected final Supplier bruteForceProtectionClient; + protected final Supplier captchaClient; + protected final Supplier suspiciousIpThrottlingClient; public AttackProtectionClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; + this.botDetectionClient = Suppliers.memoize(() -> new BotDetectionClient(clientOptions)); this.breachedPasswordDetectionClient = Suppliers.memoize(() -> new BreachedPasswordDetectionClient(clientOptions)); this.bruteForceProtectionClient = Suppliers.memoize(() -> new BruteForceProtectionClient(clientOptions)); + this.captchaClient = Suppliers.memoize(() -> new CaptchaClient(clientOptions)); this.suspiciousIpThrottlingClient = Suppliers.memoize(() -> new SuspiciousIpThrottlingClient(clientOptions)); } + public BotDetectionClient botDetection() { + return this.botDetectionClient.get(); + } + public BreachedPasswordDetectionClient breachedPasswordDetection() { return this.breachedPasswordDetectionClient.get(); } @@ -32,6 +42,10 @@ public BruteForceProtectionClient bruteForceProtection() { return this.bruteForceProtectionClient.get(); } + public CaptchaClient captcha() { + return this.captchaClient.get(); + } + public SuspiciousIpThrottlingClient suspiciousIpThrottling() { return this.suspiciousIpThrottlingClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/BotDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/BotDetectionClient.java new file mode 100644 index 000000000..471691e24 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/BotDetectionClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBotDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetBotDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBotDetectionSettingsResponseContent; + +public class BotDetectionClient { + protected final ClientOptions clientOptions; + + private final RawBotDetectionClient rawClient; + + public BotDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBotDetectionClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBotDetectionClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public GetBotDetectionSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public GetBotDetectionSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public UpdateBotDetectionSettingsResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public UpdateBotDetectionSettingsResponseContent update(UpdateBotDetectionSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public UpdateBotDetectionSettingsResponseContent update( + UpdateBotDetectionSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/CaptchaClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/CaptchaClient.java new file mode 100644 index 000000000..8e11badfc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/CaptchaClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateAttackProtectionCaptchaRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.GetAttackProtectionCaptchaResponseContent; +import com.auth0.client.mgmt.types.UpdateAttackProtectionCaptchaResponseContent; + +public class CaptchaClient { + protected final ClientOptions clientOptions; + + private final RawCaptchaClient rawClient; + + public CaptchaClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCaptchaClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCaptchaClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public GetAttackProtectionCaptchaResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public GetAttackProtectionCaptchaResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public UpdateAttackProtectionCaptchaResponseContent update() { + return this.rawClient.update().body(); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public UpdateAttackProtectionCaptchaResponseContent update(UpdateAttackProtectionCaptchaRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public UpdateAttackProtectionCaptchaResponseContent update( + UpdateAttackProtectionCaptchaRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/RawBotDetectionClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBotDetectionClient.java new file mode 100644 index 000000000..8ba3bfe69 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/RawBotDetectionClient.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBotDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetBotDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBotDetectionSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBotDetectionClient { + protected final ClientOptions clientOptions; + + public RawBotDetectionClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Get the Bot Detection configuration of your tenant. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/bot-detection") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBotDetectionSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update() { + return update(UpdateBotDetectionSettingsRequestContent.builder().build()); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBotDetectionSettingsRequestContent request) { + return update(request, null); + } + + /** + * Update the Bot Detection configuration of your tenant. + */ + public ManagementApiHttpResponse update( + UpdateBotDetectionSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/bot-detection") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateBotDetectionSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/RawCaptchaClient.java b/src/main/java/com/auth0/client/mgmt/attackprotection/RawCaptchaClient.java new file mode 100644 index 000000000..e88cc0bd8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/RawCaptchaClient.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection; + +import com.auth0.client.mgmt.attackprotection.types.UpdateAttackProtectionCaptchaRequestContent; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.GetAttackProtectionCaptchaResponseContent; +import com.auth0.client.mgmt.types.UpdateAttackProtectionCaptchaResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCaptchaClient { + protected final ClientOptions clientOptions; + + public RawCaptchaClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Get the CAPTCHA configuration for your client. + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/captcha") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetAttackProtectionCaptchaResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public ManagementApiHttpResponse update() { + return update(UpdateAttackProtectionCaptchaRequestContent.builder().build()); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public ManagementApiHttpResponse update( + UpdateAttackProtectionCaptchaRequestContent request) { + return update(request, null); + } + + /** + * Update existing CAPTCHA configuration for your client. + */ + public ManagementApiHttpResponse update( + UpdateAttackProtectionCaptchaRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("attack-protection/captcha") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateAttackProtectionCaptchaResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java new file mode 100644 index 000000000..dd651f63f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java @@ -0,0 +1,291 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.AttackProtectionCaptchaAuthChallengeRequest; +import com.auth0.client.mgmt.types.AttackProtectionCaptchaProviderId; +import com.auth0.client.mgmt.types.AttackProtectionUpdateCaptchaArkose; +import com.auth0.client.mgmt.types.AttackProtectionUpdateCaptchaFriendlyCaptcha; +import com.auth0.client.mgmt.types.AttackProtectionUpdateCaptchaHcaptcha; +import com.auth0.client.mgmt.types.AttackProtectionUpdateCaptchaRecaptchaEnterprise; +import com.auth0.client.mgmt.types.AttackProtectionUpdateCaptchaRecaptchaV2; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAttackProtectionCaptchaRequestContent.Builder.class) +public final class UpdateAttackProtectionCaptchaRequestContent { + private final Optional activeProviderId; + + private final Optional arkose; + + private final Optional authChallenge; + + private final Optional hcaptcha; + + private final Optional friendlyCaptcha; + + private final Optional recaptchaEnterprise; + + private final Optional recaptchaV2; + + private final Optional> simpleCaptcha; + + private final Map additionalProperties; + + private UpdateAttackProtectionCaptchaRequestContent( + Optional activeProviderId, + Optional arkose, + Optional authChallenge, + Optional hcaptcha, + Optional friendlyCaptcha, + Optional recaptchaEnterprise, + Optional recaptchaV2, + Optional> simpleCaptcha, + Map additionalProperties) { + this.activeProviderId = activeProviderId; + this.arkose = arkose; + this.authChallenge = authChallenge; + this.hcaptcha = hcaptcha; + this.friendlyCaptcha = friendlyCaptcha; + this.recaptchaEnterprise = recaptchaEnterprise; + this.recaptchaV2 = recaptchaV2; + this.simpleCaptcha = simpleCaptcha; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active_provider_id") + public Optional getActiveProviderId() { + return activeProviderId; + } + + @JsonProperty("arkose") + public Optional getArkose() { + return arkose; + } + + @JsonProperty("auth_challenge") + public Optional getAuthChallenge() { + return authChallenge; + } + + @JsonProperty("hcaptcha") + public Optional getHcaptcha() { + return hcaptcha; + } + + @JsonProperty("friendly_captcha") + public Optional getFriendlyCaptcha() { + return friendlyCaptcha; + } + + @JsonProperty("recaptcha_enterprise") + public Optional getRecaptchaEnterprise() { + return recaptchaEnterprise; + } + + @JsonProperty("recaptcha_v2") + public Optional getRecaptchaV2() { + return recaptchaV2; + } + + @JsonProperty("simple_captcha") + public Optional> getSimpleCaptcha() { + return simpleCaptcha; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAttackProtectionCaptchaRequestContent + && equalTo((UpdateAttackProtectionCaptchaRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAttackProtectionCaptchaRequestContent other) { + return activeProviderId.equals(other.activeProviderId) + && arkose.equals(other.arkose) + && authChallenge.equals(other.authChallenge) + && hcaptcha.equals(other.hcaptcha) + && friendlyCaptcha.equals(other.friendlyCaptcha) + && recaptchaEnterprise.equals(other.recaptchaEnterprise) + && recaptchaV2.equals(other.recaptchaV2) + && simpleCaptcha.equals(other.simpleCaptcha); + } + + @Override + public int hashCode() { + return Objects.hash( + this.activeProviderId, + this.arkose, + this.authChallenge, + this.hcaptcha, + this.friendlyCaptcha, + this.recaptchaEnterprise, + this.recaptchaV2, + this.simpleCaptcha); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional activeProviderId = Optional.empty(); + + private Optional arkose = Optional.empty(); + + private Optional authChallenge = Optional.empty(); + + private Optional hcaptcha = Optional.empty(); + + private Optional friendlyCaptcha = Optional.empty(); + + private Optional recaptchaEnterprise = Optional.empty(); + + private Optional recaptchaV2 = Optional.empty(); + + private Optional> simpleCaptcha = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateAttackProtectionCaptchaRequestContent other) { + activeProviderId(other.getActiveProviderId()); + arkose(other.getArkose()); + authChallenge(other.getAuthChallenge()); + hcaptcha(other.getHcaptcha()); + friendlyCaptcha(other.getFriendlyCaptcha()); + recaptchaEnterprise(other.getRecaptchaEnterprise()); + recaptchaV2(other.getRecaptchaV2()); + simpleCaptcha(other.getSimpleCaptcha()); + return this; + } + + @JsonSetter(value = "active_provider_id", nulls = Nulls.SKIP) + public Builder activeProviderId(Optional activeProviderId) { + this.activeProviderId = activeProviderId; + return this; + } + + public Builder activeProviderId(AttackProtectionCaptchaProviderId activeProviderId) { + this.activeProviderId = Optional.ofNullable(activeProviderId); + return this; + } + + @JsonSetter(value = "arkose", nulls = Nulls.SKIP) + public Builder arkose(Optional arkose) { + this.arkose = arkose; + return this; + } + + public Builder arkose(AttackProtectionUpdateCaptchaArkose arkose) { + this.arkose = Optional.ofNullable(arkose); + return this; + } + + @JsonSetter(value = "auth_challenge", nulls = Nulls.SKIP) + public Builder authChallenge(Optional authChallenge) { + this.authChallenge = authChallenge; + return this; + } + + public Builder authChallenge(AttackProtectionCaptchaAuthChallengeRequest authChallenge) { + this.authChallenge = Optional.ofNullable(authChallenge); + return this; + } + + @JsonSetter(value = "hcaptcha", nulls = Nulls.SKIP) + public Builder hcaptcha(Optional hcaptcha) { + this.hcaptcha = hcaptcha; + return this; + } + + public Builder hcaptcha(AttackProtectionUpdateCaptchaHcaptcha hcaptcha) { + this.hcaptcha = Optional.ofNullable(hcaptcha); + return this; + } + + @JsonSetter(value = "friendly_captcha", nulls = Nulls.SKIP) + public Builder friendlyCaptcha(Optional friendlyCaptcha) { + this.friendlyCaptcha = friendlyCaptcha; + return this; + } + + public Builder friendlyCaptcha(AttackProtectionUpdateCaptchaFriendlyCaptcha friendlyCaptcha) { + this.friendlyCaptcha = Optional.ofNullable(friendlyCaptcha); + return this; + } + + @JsonSetter(value = "recaptcha_enterprise", nulls = Nulls.SKIP) + public Builder recaptchaEnterprise( + Optional recaptchaEnterprise) { + this.recaptchaEnterprise = recaptchaEnterprise; + return this; + } + + public Builder recaptchaEnterprise(AttackProtectionUpdateCaptchaRecaptchaEnterprise recaptchaEnterprise) { + this.recaptchaEnterprise = Optional.ofNullable(recaptchaEnterprise); + return this; + } + + @JsonSetter(value = "recaptcha_v2", nulls = Nulls.SKIP) + public Builder recaptchaV2(Optional recaptchaV2) { + this.recaptchaV2 = recaptchaV2; + return this; + } + + public Builder recaptchaV2(AttackProtectionUpdateCaptchaRecaptchaV2 recaptchaV2) { + this.recaptchaV2 = Optional.ofNullable(recaptchaV2); + return this; + } + + @JsonSetter(value = "simple_captcha", nulls = Nulls.SKIP) + public Builder simpleCaptcha(Optional> simpleCaptcha) { + this.simpleCaptcha = simpleCaptcha; + return this; + } + + public Builder simpleCaptcha(Map simpleCaptcha) { + this.simpleCaptcha = Optional.ofNullable(simpleCaptcha); + return this; + } + + public UpdateAttackProtectionCaptchaRequestContent build() { + return new UpdateAttackProtectionCaptchaRequestContent( + activeProviderId, + arkose, + authChallenge, + hcaptcha, + friendlyCaptcha, + recaptchaEnterprise, + recaptchaV2, + simpleCaptcha, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java new file mode 100644 index 000000000..cb595dff0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.attackprotection.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.BotDetectionChallengePolicyPasswordFlowEnum; +import com.auth0.client.mgmt.types.BotDetectionChallengePolicyPasswordResetFlowEnum; +import com.auth0.client.mgmt.types.BotDetectionChallengePolicyPasswordlessFlowEnum; +import com.auth0.client.mgmt.types.BotDetectionLevelEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBotDetectionSettingsRequestContent.Builder.class) +public final class UpdateBotDetectionSettingsRequestContent { + private final Optional botDetectionLevel; + + private final Optional challengePasswordPolicy; + + private final Optional challengePasswordlessPolicy; + + private final Optional challengePasswordResetPolicy; + + private final Optional> allowlist; + + private final Optional monitoringModeEnabled; + + private final Map additionalProperties; + + private UpdateBotDetectionSettingsRequestContent( + Optional botDetectionLevel, + Optional challengePasswordPolicy, + Optional challengePasswordlessPolicy, + Optional challengePasswordResetPolicy, + Optional> allowlist, + Optional monitoringModeEnabled, + Map additionalProperties) { + this.botDetectionLevel = botDetectionLevel; + this.challengePasswordPolicy = challengePasswordPolicy; + this.challengePasswordlessPolicy = challengePasswordlessPolicy; + this.challengePasswordResetPolicy = challengePasswordResetPolicy; + this.allowlist = allowlist; + this.monitoringModeEnabled = monitoringModeEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("bot_detection_level") + public Optional getBotDetectionLevel() { + return botDetectionLevel; + } + + @JsonProperty("challenge_password_policy") + public Optional getChallengePasswordPolicy() { + return challengePasswordPolicy; + } + + @JsonProperty("challenge_passwordless_policy") + public Optional getChallengePasswordlessPolicy() { + return challengePasswordlessPolicy; + } + + @JsonProperty("challenge_password_reset_policy") + public Optional getChallengePasswordResetPolicy() { + return challengePasswordResetPolicy; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @JsonProperty("monitoring_mode_enabled") + public Optional getMonitoringModeEnabled() { + return monitoringModeEnabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBotDetectionSettingsRequestContent + && equalTo((UpdateBotDetectionSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBotDetectionSettingsRequestContent other) { + return botDetectionLevel.equals(other.botDetectionLevel) + && challengePasswordPolicy.equals(other.challengePasswordPolicy) + && challengePasswordlessPolicy.equals(other.challengePasswordlessPolicy) + && challengePasswordResetPolicy.equals(other.challengePasswordResetPolicy) + && allowlist.equals(other.allowlist) + && monitoringModeEnabled.equals(other.monitoringModeEnabled); + } + + @Override + public int hashCode() { + return Objects.hash( + this.botDetectionLevel, + this.challengePasswordPolicy, + this.challengePasswordlessPolicy, + this.challengePasswordResetPolicy, + this.allowlist, + this.monitoringModeEnabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional botDetectionLevel = Optional.empty(); + + private Optional challengePasswordPolicy = Optional.empty(); + + private Optional challengePasswordlessPolicy = + Optional.empty(); + + private Optional challengePasswordResetPolicy = + Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional monitoringModeEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBotDetectionSettingsRequestContent other) { + botDetectionLevel(other.getBotDetectionLevel()); + challengePasswordPolicy(other.getChallengePasswordPolicy()); + challengePasswordlessPolicy(other.getChallengePasswordlessPolicy()); + challengePasswordResetPolicy(other.getChallengePasswordResetPolicy()); + allowlist(other.getAllowlist()); + monitoringModeEnabled(other.getMonitoringModeEnabled()); + return this; + } + + @JsonSetter(value = "bot_detection_level", nulls = Nulls.SKIP) + public Builder botDetectionLevel(Optional botDetectionLevel) { + this.botDetectionLevel = botDetectionLevel; + return this; + } + + public Builder botDetectionLevel(BotDetectionLevelEnum botDetectionLevel) { + this.botDetectionLevel = Optional.ofNullable(botDetectionLevel); + return this; + } + + @JsonSetter(value = "challenge_password_policy", nulls = Nulls.SKIP) + public Builder challengePasswordPolicy( + Optional challengePasswordPolicy) { + this.challengePasswordPolicy = challengePasswordPolicy; + return this; + } + + public Builder challengePasswordPolicy(BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy) { + this.challengePasswordPolicy = Optional.ofNullable(challengePasswordPolicy); + return this; + } + + @JsonSetter(value = "challenge_passwordless_policy", nulls = Nulls.SKIP) + public Builder challengePasswordlessPolicy( + Optional challengePasswordlessPolicy) { + this.challengePasswordlessPolicy = challengePasswordlessPolicy; + return this; + } + + public Builder challengePasswordlessPolicy( + BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy) { + this.challengePasswordlessPolicy = Optional.ofNullable(challengePasswordlessPolicy); + return this; + } + + @JsonSetter(value = "challenge_password_reset_policy", nulls = Nulls.SKIP) + public Builder challengePasswordResetPolicy( + Optional challengePasswordResetPolicy) { + this.challengePasswordResetPolicy = challengePasswordResetPolicy; + return this; + } + + public Builder challengePasswordResetPolicy( + BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy) { + this.challengePasswordResetPolicy = Optional.ofNullable(challengePasswordResetPolicy); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + @JsonSetter(value = "monitoring_mode_enabled", nulls = Nulls.SKIP) + public Builder monitoringModeEnabled(Optional monitoringModeEnabled) { + this.monitoringModeEnabled = monitoringModeEnabled; + return this; + } + + public Builder monitoringModeEnabled(Boolean monitoringModeEnabled) { + this.monitoringModeEnabled = Optional.ofNullable(monitoringModeEnabled); + return this; + } + + public UpdateBotDetectionSettingsRequestContent build() { + return new UpdateBotDetectionSettingsRequestContent( + botDetectionLevel, + challengePasswordPolicy, + challengePasswordlessPolicy, + challengePasswordResetPolicy, + allowlist, + monitoringModeEnabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java index ddd475caa..3b9e2df71 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java @@ -88,7 +88,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBreachedPasswordDetectionSettingsRequestContent @@ -108,12 +108,12 @@ private boolean equalTo(UpdateBreachedPasswordDetectionSettingsRequestContent ot && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java index 4607f414e..5b04bd941 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBruteForceSettingsRequestContent @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBruteForceSettingsRequestContent other) { && maxAttempts.equals(other.maxAttempts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java index 556a5e295..6a4a06ec1 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsRequestContentMode && this.string.equals(((UpdateBruteForceSettingsRequestContentMode) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java index 4d77f09f9..0a264ed97 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsRequestContentShieldsItem && this.string.equals(((UpdateBruteForceSettingsRequestContentShieldsItem) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java index de916780f..a4eb81344 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java @@ -73,7 +73,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSuspiciousIpThrottlingSettingsRequestContent @@ -92,12 +92,12 @@ private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsRequestContent other && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java index 2de627f9c..b7a4f943d 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java @@ -124,27 +124,26 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public CompletableFuture> updateUniversalLogin( @@ -154,27 +153,26 @@ public CompletableFuture> updateUniversalLogin( /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public CompletableFuture> updateUniversalLogin( diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java index 0f5f5ef94..a23523d44 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java @@ -37,27 +37,26 @@ public CompletableFuture getUniversalL /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public CompletableFuture updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { @@ -66,27 +65,26 @@ public CompletableFuture updateUniversalLogin(UpdateUniversalLoginTemplate /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public CompletableFuture updateUniversalLogin( diff --git a/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java index d97ce2a77..85a5a3f0f 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java @@ -96,27 +96,26 @@ public ManagementApiHttpResponse getUn /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public ManagementApiHttpResponse updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { @@ -125,27 +124,26 @@ public ManagementApiHttpResponse updateUniversalLogin(UpdateUniversalLogin /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public ManagementApiHttpResponse updateUniversalLogin( diff --git a/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java index fcfd5cb76..06ec08d52 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java @@ -35,27 +35,26 @@ public GetUniversalLoginTemplateResponseContent getUniversalLogin(RequestOptions /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public void updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { @@ -64,27 +63,26 @@ public void updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent requ /** * Update the Universal Login branding template. - *

<p>When <code>content-type</code> header is set to <code>application/json</code>, the expected body must be JSON:</p> + *

<p>When <code>content-type</code> header is set to <code>application/json</code>:</p> * <pre> * { - * "template": "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" + * "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;" * } * </pre>

*

<p> - * When <code>content-type</code> header is set to <code>text/html</code>, the expected body must be the HTML template: + * When <code>content-type</code> header is set to <code>text/html</code>: * </p> * <pre> * &lt!DOCTYPE html&gt; - * &lt;code&gt; - * &lt;html&gt; - * &lt;head&gt; - * {%- auth0:head -%} - * &lt;/head&gt; - * &lt;body&gt; - * {%- auth0:widget -%} - * &lt;/body&gt; - * &lt;/html&gt; - * &lt;/code&gt; + * {% assign resolved_dir = dir | default: "auto" %} + * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt; + * &lt;head&gt; + * {%- auth0:head -%} + * &lt;/head&gt; + * &lt;body class="_widget-auto-layout"&gt; + * {%- auth0:widget -%} + * &lt;/body&gt; + * &lt;/html&gt; * </pre>

*/ public void updateUniversalLogin( diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java index d05a88591..ea8a53c5e 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/AsyncRawProvidersClient.java @@ -70,7 +70,10 @@ public CompletableFuture list HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("branding/phone/providers"); - QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + if (!request.getDisabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "disabled", request.getDisabled().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java index e6d18b9e3..eeada4900 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/RawTemplatesClient.java @@ -58,7 +58,10 @@ public ManagementApiHttpResponse list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("branding/phone/templates"); - QueryStringMapper.addQueryParameter(httpUrl, "disabled", request.getDisabled(), false); + if (!request.getDisabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "disabled", request.getDisabled().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java index 070e85106..32ee7c1c4 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java @@ -70,7 +70,7 @@ public PhoneProviderCredentials getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingPhoneProviderRequestContent @@ -89,12 +89,12 @@ private boolean equalTo(CreateBrandingPhoneProviderRequestContent other) { && credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.disabled, this.configuration, this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements NameStage, CredentialsStage, _Final private Builder() {} - @java.lang.Override + @Override public Builder from(CreateBrandingPhoneProviderRequestContent other) { name(other.getName()); disabled(other.getDisabled()); @@ -152,27 +152,27 @@ public Builder from(CreateBrandingPhoneProviderRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public CredentialsStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull PhoneProviderCredentials credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -183,7 +183,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -192,14 +192,14 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @java.lang.Override + @Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public CreateBrandingPhoneProviderRequestContent build() { return new CreateBrandingPhoneProviderRequestContent( name, disabled, configuration, credentials, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java index ebbbd5cce..e90c79a8e 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java @@ -50,7 +50,7 @@ public Optional getDeliveryMethod() { return deliveryMethod; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneProviderSendTestRequestContent @@ -66,12 +66,12 @@ private boolean equalTo(CreatePhoneProviderSendTestRequestContent other) { return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.to, this.deliveryMethod); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements ToStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePhoneProviderSendTestRequestContent other) { to(other.getTo()); deliveryMethod(other.getDeliveryMethod()); @@ -120,27 +120,27 @@ public Builder from(CreatePhoneProviderSendTestRequestContent other) { *

The recipient phone number to receive a given notification.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("to") public _FinalStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { this.deliveryMethod = Optional.ofNullable(deliveryMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) public _FinalStage deliveryMethod(Optional deliveryMethod) { this.deliveryMethod = deliveryMethod; return this; } - @java.lang.Override + @Override public CreatePhoneProviderSendTestRequestContent build() { return new CreatePhoneProviderSendTestRequestContent(to, deliveryMethod, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java index 2d9f5467d..fa8e60076 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java @@ -59,7 +59,7 @@ public Optional getContent() { return content; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateRequestContent && equalTo((CreatePhoneTemplateRequestContent) other); @@ -74,12 +74,12 @@ private boolean equalTo(CreatePhoneTemplateRequestContent other) { return type.equals(other.type) && disabled.equals(other.disabled) && content.equals(other.content); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.disabled, this.content); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java index 7cb0e906b..4e4140e5a 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java @@ -50,7 +50,7 @@ public Optional getDeliveryMethod() { return deliveryMethod; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateTestNotificationRequestContent @@ -66,12 +66,12 @@ private boolean equalTo(CreatePhoneTemplateTestNotificationRequestContent other) return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.to, this.deliveryMethod); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements ToStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePhoneTemplateTestNotificationRequestContent other) { to(other.getTo()); deliveryMethod(other.getDeliveryMethod()); @@ -120,27 +120,27 @@ public Builder from(CreatePhoneTemplateTestNotificationRequestContent other) { *

Destination of the testing phone notification

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("to") public _FinalStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { this.deliveryMethod = Optional.ofNullable(deliveryMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) public _FinalStage deliveryMethod(Optional deliveryMethod) { this.deliveryMethod = deliveryMethod; return this; } - @java.lang.Override + @Override public CreatePhoneTemplateTestNotificationRequestContent build() { return new CreatePhoneTemplateTestNotificationRequestContent(to, deliveryMethod, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java index 4546bbb2e..f02128464 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListBrandingPhoneProvidersRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(ListBrandingPhoneProvidersRequestParameters other) { return disabled.equals(other.disabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java index a2186347a..57f2e752a 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListPhoneTemplatesRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(ListPhoneTemplatesRequestParameters other) { return disabled.equals(other.disabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java index bf8583d48..0e3f5e282 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java @@ -69,7 +69,7 @@ public Optional getConfiguration() { return configuration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPhoneProviderRequestContent @@ -88,12 +88,12 @@ private boolean equalTo(UpdateBrandingPhoneProviderRequestContent other) { && configuration.equals(other.configuration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.disabled, this.credentials, this.configuration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java index 3e19fd8f5..5631f8109 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java @@ -49,7 +49,7 @@ public Optional getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdatePhoneTemplateRequestContent && equalTo((UpdatePhoneTemplateRequestContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(UpdatePhoneTemplateRequestContent other) { return content.equals(other.content) && disabled.equals(other.disabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.content, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java index ccf342554..5c372dfd0 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java @@ -90,7 +90,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingThemeRequestContent && equalTo((CreateBrandingThemeRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(CreateBrandingThemeRequestContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -177,7 +177,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateBrandingThemeRequestContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -188,35 +188,35 @@ public Builder from(CreateBrandingThemeRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public FontsStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); @@ -227,7 +227,7 @@ public _FinalStage widget(@NotNull BrandingThemeWidget widget) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -236,14 +236,14 @@ public _FinalStage displayName(String displayName) { /** *

Display Name

*/ - @java.lang.Override + @Override @JsonSetter(value = "displayName", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public CreateBrandingThemeRequestContent build() { return new CreateBrandingThemeRequestContent( borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java index 385409f0b..cc5988336 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java @@ -90,7 +90,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingThemeRequestContent && equalTo((UpdateBrandingThemeRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBrandingThemeRequestContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -177,7 +177,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateBrandingThemeRequestContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -188,35 +188,35 @@ public Builder from(UpdateBrandingThemeRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public FontsStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); @@ -227,7 +227,7 @@ public _FinalStage widget(@NotNull BrandingThemeWidget widget) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -236,14 +236,14 @@ public _FinalStage displayName(String displayName) { /** *

Display Name

*/ - @java.lang.Override + @Override @JsonSetter(value = "displayName", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public UpdateBrandingThemeRequestContent build() { return new UpdateBrandingThemeRequestContent( borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java index ff0490f09..e5bc9afa3 100644 --- a/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/AsyncRawOrganizationsClient.java @@ -58,8 +58,11 @@ public CompletableFuture> list( .addPathSegments("client-grants") .addPathSegment(id) .addPathSegments("organizations"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java index 265a509fe..f503203b1 100644 --- a/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantOrganizationsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListClientGrantOrganizationsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java index b11a0f861..6c1227144 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/clients/AsyncRawConnectionsClient.java @@ -91,10 +91,19 @@ public CompletableFuture> get( .addPathSegments("clients") .addPathSegment(id) .addPathSegments("connections"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } if (request.getStrategy().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "strategy", request.getStrategy().get(), true); diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java index 59a09f896..0181c8950 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java @@ -134,7 +134,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionsGetRequest && equalTo((ConnectionsGetRequest) other); @@ -153,12 +153,12 @@ private boolean equalTo(ConnectionsGetRequest other) { && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.strategy, this.from, this.take, this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java index 170fe0ac7..747ebf26e 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java @@ -52,7 +52,7 @@ private OptionalNullable _getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchClientCredentialRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(PatchClientCredentialRequestContent other) { return expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java index 42aea8adf..b425164b4 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java @@ -109,7 +109,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PostClientCredentialRequestContent @@ -131,7 +131,7 @@ private boolean equalTo(PostClientCredentialRequestContent other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.credentialType, @@ -143,7 +143,7 @@ public int hashCode() { this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -222,7 +222,7 @@ public static final class Builder implements CredentialTypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(PostClientCredentialRequestContent other) { credentialType(other.getCredentialType()); name(other.getName()); @@ -234,7 +234,7 @@ public Builder from(PostClientCredentialRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("credential_type") public _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialType) { this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); @@ -245,7 +245,7 @@ public _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialTy *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage expiresAt(OffsetDateTime expiresAt) { this.expiresAt = Optional.ofNullable(expiresAt); return this; @@ -254,7 +254,7 @@ public _FinalStage expiresAt(OffsetDateTime expiresAt) { /** *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public _FinalStage expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; @@ -265,7 +265,7 @@ public _FinalStage expiresAt(Optional expiresAt) { *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); return this; @@ -274,20 +274,20 @@ public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { /** *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { this.parseExpiryFromCert = parseExpiryFromCert; return this; } - @java.lang.Override + @Override public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -298,7 +298,7 @@ public _FinalStage alg(Optional alg) { *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pem(String pem) { this.pem = Optional.ofNullable(pem); return this; @@ -307,7 +307,7 @@ public _FinalStage pem(String pem) { /** *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

*/ - @java.lang.Override + @Override @JsonSetter(value = "pem", nulls = Nulls.SKIP) public _FinalStage pem(Optional pem) { this.pem = pem; @@ -318,7 +318,7 @@ public _FinalStage pem(Optional pem) { *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; @@ -327,7 +327,7 @@ public _FinalStage subjectDn(String subjectDn) { /** *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; @@ -338,7 +338,7 @@ public _FinalStage subjectDn(Optional subjectDn) { *

Friendly name for a credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -347,14 +347,14 @@ public _FinalStage name(String name) { /** *

Friendly name for a credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public PostClientCredentialRequestContent build() { return new PostClientCredentialRequestContent( credentialType, name, subjectDn, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncDirectoryProvisioningClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncDirectoryProvisioningClient.java new file mode 100644 index 000000000..081890a0d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncDirectoryProvisioningClient.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.directoryprovisioning.AsyncSynchronizationsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncDirectoryProvisioningClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDirectoryProvisioningClient rawClient; + + protected final Supplier synchronizationsClient; + + public AsyncDirectoryProvisioningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDirectoryProvisioningClient(clientOptions); + this.synchronizationsClient = Suppliers.memoize(() -> new AsyncSynchronizationsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDirectoryProvisioningClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture create( + String id, OptionalNullable request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture create( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture update( + String id, OptionalNullable request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture update( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public CompletableFuture getDefaultMapping(String id) { + return this.rawClient.getDefaultMapping(id).thenApply(response -> response.body()); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public CompletableFuture getDefaultMapping( + String id, RequestOptions requestOptions) { + return this.rawClient.getDefaultMapping(id, requestOptions).thenApply(response -> response.body()); + } + + public AsyncSynchronizationsClient synchronizations() { + return this.synchronizationsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java index fd45f1733..ff1ba7f53 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java @@ -73,8 +73,11 @@ public CompletableFuture> get(String id) { + return get(id, null); + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetDirectoryProvisioningResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture> create(String id) { + return create(id, OptionalNullable.absent()); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture> create( + String id, OptionalNullable request) { + return create(id, request, null); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CompletableFuture> create( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateDirectoryProvisioningResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture> update(String id) { + return update(id, OptionalNullable.absent()); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture> update( + String id, OptionalNullable request) { + return update(id, request, null); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public CompletableFuture> update( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateDirectoryProvisioningResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public CompletableFuture> + getDefaultMapping(String id) { + return getDefaultMapping(id, null); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public CompletableFuture> + getDefaultMapping(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .addPathSegments("default-mapping") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + GetDirectoryProvisioningDefaultMappingResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/DirectoryProvisioningClient.java b/src/main/java/com/auth0/client/mgmt/connections/DirectoryProvisioningClient.java new file mode 100644 index 000000000..84eba9b0d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/DirectoryProvisioningClient.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.connections.directoryprovisioning.SynchronizationsClient; +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningResponseContent; +import java.util.function.Supplier; + +public class DirectoryProvisioningClient { + protected final ClientOptions clientOptions; + + private final RawDirectoryProvisioningClient rawClient; + + protected final Supplier synchronizationsClient; + + public DirectoryProvisioningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDirectoryProvisioningClient(clientOptions); + this.synchronizationsClient = Suppliers.memoize(() -> new SynchronizationsClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDirectoryProvisioningClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public GetDirectoryProvisioningResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public GetDirectoryProvisioningResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CreateDirectoryProvisioningResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CreateDirectoryProvisioningResponseContent create( + String id, OptionalNullable request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public CreateDirectoryProvisioningResponseContent create( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public UpdateDirectoryProvisioningResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public UpdateDirectoryProvisioningResponseContent update( + String id, OptionalNullable request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public UpdateDirectoryProvisioningResponseContent update( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public GetDirectoryProvisioningDefaultMappingResponseContent getDefaultMapping(String id) { + return this.rawClient.getDefaultMapping(id).body(); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public GetDirectoryProvisioningDefaultMappingResponseContent getDefaultMapping( + String id, RequestOptions requestOptions) { + return this.rawClient.getDefaultMapping(id, requestOptions).body(); + } + + public SynchronizationsClient synchronizations() { + return this.synchronizationsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java index d47362dc2..f9426f034 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java @@ -68,8 +68,11 @@ public ManagementApiHttpResponse> ge .addPathSegments("connections") .addPathSegment(id) .addPathSegments("clients"); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawDirectoryProvisioningClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawDirectoryProvisioningClient.java new file mode 100644 index 000000000..60df8df96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/RawDirectoryProvisioningClient.java @@ -0,0 +1,415 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningRequestContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDirectoryProvisioningClient { + protected final ClientOptions clientOptions; + + public RawDirectoryProvisioningClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + /** + * Retrieve the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetDirectoryProvisioningResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public ManagementApiHttpResponse create(String id) { + return create(id, OptionalNullable.absent()); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public ManagementApiHttpResponse create( + String id, OptionalNullable request) { + return create(id, request, null); + } + + /** + * Create a directory provisioning configuration for a connection. + */ + public ManagementApiHttpResponse create( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateDirectoryProvisioningResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + /** + * Delete the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, OptionalNullable.absent()); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse update( + String id, OptionalNullable request) { + return update(id, request, null); + } + + /** + * Update the directory provisioning configuration of a connection. + */ + public ManagementApiHttpResponse update( + String id, + OptionalNullable request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .build(); + RequestBody body; + try { + body = RequestBody.create("", null); + if (request.isPresent()) { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateDirectoryProvisioningResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public ManagementApiHttpResponse getDefaultMapping( + String id) { + return getDefaultMapping(id, null); + } + + /** + * Retrieve the directory provisioning default attribute mapping of a connection. + */ + public ManagementApiHttpResponse getDefaultMapping( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .addPathSegments("default-mapping") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetDirectoryProvisioningDefaultMappingResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncRawSynchronizationsClient.java b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncRawSynchronizationsClient.java new file mode 100644 index 000000000..4e26fd082 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncRawSynchronizationsClient.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.directoryprovisioning; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateDirectorySynchronizationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSynchronizationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSynchronizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CompletableFuture> create( + String id) { + return create(id, null); + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CompletableFuture> create( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .addPathSegments("synchronizations") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateDirectorySynchronizationResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncSynchronizationsClient.java b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncSynchronizationsClient.java new file mode 100644 index 000000000..19b5540e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/AsyncSynchronizationsClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.directoryprovisioning; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateDirectorySynchronizationResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncSynchronizationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSynchronizationsClient rawClient; + + public AsyncSynchronizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSynchronizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSynchronizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CompletableFuture create(String id) { + return this.rawClient.create(id).thenApply(response -> response.body()); + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CompletableFuture create( + String id, RequestOptions requestOptions) { + return this.rawClient.create(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/RawSynchronizationsClient.java b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/RawSynchronizationsClient.java new file mode 100644 index 000000000..9348ab59d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/RawSynchronizationsClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.directoryprovisioning; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.CreateDirectorySynchronizationResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSynchronizationsClient { + protected final ClientOptions clientOptions; + + public RawSynchronizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Request an on-demand synchronization of the directory. + */ + public ManagementApiHttpResponse create(String id) { + return create(id, null); + } + + /** + * Request an on-demand synchronization of the directory. + */ + public ManagementApiHttpResponse create( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connections") + .addPathSegment(id) + .addPathSegments("directory-provisioning") + .addPathSegments("synchronizations") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateDirectorySynchronizationResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/SynchronizationsClient.java b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/SynchronizationsClient.java new file mode 100644 index 000000000..004640d01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/connections/directoryprovisioning/SynchronizationsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.connections.directoryprovisioning; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.types.CreateDirectorySynchronizationResponseContent; + +public class SynchronizationsClient { + protected final ClientOptions clientOptions; + + private final RawSynchronizationsClient rawClient; + + public SynchronizationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSynchronizationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSynchronizationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CreateDirectorySynchronizationResponseContent create(String id) { + return this.rawClient.create(id).body(); + } + + /** + * Request an on-demand synchronization of the directory. + */ + public CreateDirectorySynchronizationResponseContent create(String id, RequestOptions requestOptions) { + return this.rawClient.create(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java index dadd47f4f..5261693ea 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java @@ -65,7 +65,7 @@ private OptionalNullable _getTokenLifetime() { return tokenLifetime; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimTokenRequestContent && equalTo((CreateScimTokenRequestContent) other); @@ -80,12 +80,12 @@ private boolean equalTo(CreateScimTokenRequestContent other) { return scopes.equals(other.scopes) && tokenLifetime.equals(other.tokenLifetime); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.scopes, this.tokenLifetime); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java index b211900f5..115dc5514 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java @@ -36,7 +36,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteConnectionUsersByEmailQueryParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteConnectionUsersByEmailQueryParameters other) { return email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeleteConnectionUsersByEmailQueryParameters other) { email(other.getEmail()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteConnectionUsersByEmailQueryParameters other) { *

The email of the user to delete

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public DeleteConnectionUsersByEmailQueryParameters build() { return new DeleteConnectionUsersByEmailQueryParameters(email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java index 5a8350257..3d9f1180d 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionEnabledClientsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(GetConnectionEnabledClientsRequestParameters other) { return take.equals(other.take) && from.equals(other.from); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.take, this.from); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java index cea97bfcb..c83d2517c 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java @@ -52,7 +52,7 @@ public List getMapping() { return mapping; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateScimConfigurationRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(UpdateScimConfigurationRequestContent other) { return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userIdAttribute, this.mapping); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements UserIdAttributeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateScimConfigurationRequestContent other) { userIdAttribute(other.getUserIdAttribute()); mapping(other.getMapping()); @@ -127,7 +127,7 @@ public Builder from(UpdateScimConfigurationRequestContent other) { *

User ID attribute for generating unique user ids

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id_attribute") public _FinalStage userIdAttribute(@NotNull String userIdAttribute) { this.userIdAttribute = Objects.requireNonNull(userIdAttribute, "userIdAttribute must not be null"); @@ -138,7 +138,7 @@ public _FinalStage userIdAttribute(@NotNull String userIdAttribute) { *

The mapping between auth0 and SCIM

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllMapping(List mapping) { if (mapping != null) { this.mapping.addAll(mapping); @@ -150,7 +150,7 @@ public _FinalStage addAllMapping(List mapping) { *

The mapping between auth0 and SCIM

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addMapping(ScimMappingItem mapping) { this.mapping.add(mapping); return this; @@ -159,7 +159,7 @@ public _FinalStage addMapping(ScimMappingItem mapping) { /** *

The mapping between auth0 and SCIM

*/ - @java.lang.Override + @Override @JsonSetter(value = "mapping", nulls = Nulls.SKIP) public _FinalStage mapping(List mapping) { this.mapping.clear(); @@ -169,7 +169,7 @@ public _FinalStage mapping(List mapping) { return this; } - @java.lang.Override + @Override public UpdateScimConfigurationRequestContent build() { return new UpdateScimConfigurationRequestContent(userIdAttribute, mapping, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java b/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java index 82c608579..f85b1b1a1 100644 --- a/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java +++ b/src/main/java/com/auth0/client/mgmt/core/QueryStringMapper.java @@ -20,15 +20,6 @@ public class QueryStringMapper { private static final ObjectMapper MAPPER = ObjectMappers.JSON_MAPPER; public static void addQueryParameter(HttpUrl.Builder httpUrl, String key, Object value, boolean arraysAsRepeats) { - - if (value instanceof OptionalNullable) { - OptionalNullable opt = (OptionalNullable) value; - if (!opt.isPresent()) { - return; - } - value = opt.get(); - } - JsonNode valueNode = MAPPER.valueToTree(value); List> flat; diff --git a/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java b/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java index 516865c90..0bd147838 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java +++ b/src/main/java/com/auth0/client/mgmt/emails/AsyncRawProviderClient.java @@ -67,8 +67,14 @@ public CompletableFuture get( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("emails/provider"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java index 556c5738a..b84d24ace 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java @@ -94,7 +94,7 @@ private OptionalNullable> _getSettings() { return settings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailProviderRequestContent && equalTo((CreateEmailProviderRequestContent) other); @@ -113,12 +113,12 @@ private boolean equalTo(CreateEmailProviderRequestContent other) { && settings.equals(other.settings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -180,7 +180,7 @@ public static final class Builder implements NameStage, CredentialsStage, _Final private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEmailProviderRequestContent other) { name(other.getName()); enabled(other.getEnabled()); @@ -190,21 +190,21 @@ public Builder from(CreateEmailProviderRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public CredentialsStage name(@NotNull EmailProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull EmailProviderCredentialsSchema credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings) { if (settings.isNull()) { this.settings = OptionalNullable.ofNull(); @@ -216,7 +216,7 @@ public _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings) { if (settings.isPresent()) { this.settings = OptionalNullable.of(settings.get()); @@ -226,13 +226,13 @@ public _FinalStage settings(Optional> settings) { return this; } - @java.lang.Override + @Override public _FinalStage settings(Map settings) { this.settings = OptionalNullable.of(settings); return this; } - @java.lang.Override + @Override @JsonSetter(value = "settings", nulls = Nulls.SKIP) public _FinalStage settings(@Nullable OptionalNullable> settings) { this.settings = settings; @@ -243,7 +243,7 @@ public _FinalStage settings(@Nullable OptionalNullable> sett *

Email address to use as "from" when no other address specified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage defaultFromAddress(String defaultFromAddress) { this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); return this; @@ -252,7 +252,7 @@ public _FinalStage defaultFromAddress(String defaultFromAddress) { /** *

Email address to use as "from" when no other address specified.

*/ - @java.lang.Override + @Override @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) public _FinalStage defaultFromAddress(Optional defaultFromAddress) { this.defaultFromAddress = defaultFromAddress; @@ -263,7 +263,7 @@ public _FinalStage defaultFromAddress(Optional defaultFromAddress) { *

Whether the provider is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -272,14 +272,14 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the provider is enabled (true) or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; return this; } - @java.lang.Override + @Override public CreateEmailProviderRequestContent build() { return new CreateEmailProviderRequestContent( name, enabled, defaultFromAddress, credentials, settings, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java index df18ed7be..8117f7c2e 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailProviderRequestParameters && equalTo((GetEmailProviderRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetEmailProviderRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java index 54dd8275c..427b16eb1 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java @@ -93,7 +93,7 @@ private OptionalNullable> _getSettings() { return settings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailProviderRequestContent && equalTo((UpdateEmailProviderRequestContent) other); @@ -112,12 +112,12 @@ private boolean equalTo(UpdateEmailProviderRequestContent other) { && settings.equals(other.settings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java index 5998d5628..93b4583d5 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java @@ -25,7 +25,7 @@ public BadRequestError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java index 53940ac20..0c92fc961 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java @@ -25,7 +25,7 @@ public ConflictError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java index 0b56d4a30..b7d5b0519 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java @@ -25,7 +25,7 @@ public ContentTooLargeError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java index 6648b7af1..880f958af 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java @@ -25,7 +25,7 @@ public ForbiddenError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java index bbe615ac0..be37ce56d 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java @@ -25,7 +25,7 @@ public InternalServerError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java index e3b072d83..3154190f7 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java @@ -25,7 +25,7 @@ public NotFoundError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java index 7cef21310..74cfc9f52 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java @@ -25,7 +25,7 @@ public PaymentRequiredError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java index 30f466141..24ef41c4c 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java @@ -25,7 +25,7 @@ public ServiceUnavailableError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java index cae04a023..4c5a49112 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java @@ -25,7 +25,7 @@ public TooManyRequestsError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java index a766ae2d4..0e5ebe618 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java @@ -25,7 +25,7 @@ public UnauthorizedError(Object body, Response rawResponse) { /** * @return the body */ - @java.lang.Override + @Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java index f9f72e797..23a0e8c2b 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/AsyncRawDeliveriesClient.java @@ -56,12 +56,27 @@ public CompletableFuture>> l .addPathSegments("event-streams") .addPathSegment(id) .addPathSegments("deliveries"); - QueryStringMapper.addQueryParameter(httpUrl, "statuses", request.getStatuses(), false); - QueryStringMapper.addQueryParameter(httpUrl, "event_types", request.getEventTypes(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getStatuses().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "statuses", request.getStatuses().orElse(null), false); + } + if (!request.getEventTypes().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_types", request.getEventTypes().orElse(null), false); + } + if (!request.getDateFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "date_from", request.getDateFrom().orElse(null), false); + } + if (!request.getDateTo().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "date_to", request.getDateTo().orElse(null), false); + } + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java b/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java index 9f2e82ef4..4137ff1fc 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/RawDeliveriesClient.java @@ -52,12 +52,27 @@ public ManagementApiHttpResponse> list( .addPathSegments("event-streams") .addPathSegment(id) .addPathSegments("deliveries"); - QueryStringMapper.addQueryParameter(httpUrl, "statuses", request.getStatuses(), false); - QueryStringMapper.addQueryParameter(httpUrl, "event_types", request.getEventTypes(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_from", request.getDateFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "date_to", request.getDateTo(), false); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getStatuses().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "statuses", request.getStatuses().orElse(null), false); + } + if (!request.getEventTypes().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_types", request.getEventTypes().orElse(null), false); + } + if (!request.getDateFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "date_from", request.getDateFrom().orElse(null), false); + } + if (!request.getDateTo().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "date_to", request.getDateTo().orElse(null), false); + } + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java index a076ccb1c..6e8961905 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java @@ -78,7 +78,7 @@ public Optional> getEventTypes() { return eventTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamRedeliveryRequestContent @@ -97,12 +97,12 @@ private boolean equalTo(CreateEventStreamRedeliveryRequestContent other) { && eventTypes.equals(other.eventTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java index 02389dd4a..ad03adb22 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java @@ -153,7 +153,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEventStreamDeliveriesRequestParameters @@ -174,12 +174,12 @@ private boolean equalTo(ListEventStreamDeliveriesRequestParameters other) { && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.statuses, this.eventTypes, this.dateFrom, this.dateTo, this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java index 4a08f8698..0f71ad61c 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/flows/AsyncRawExecutionsClient.java @@ -60,8 +60,11 @@ public CompletableFuture> list( .addPathSegments("flows") .addPathSegment(flowId) .addPathSegments("executions"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java index 63b190892..496b5618a 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java @@ -51,7 +51,7 @@ private Optional> _getHydrate() { return hydrate; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExecutionsGetRequest && equalTo((ExecutionsGetRequest) other); @@ -66,12 +66,12 @@ private boolean equalTo(ExecutionsGetRequest other) { return hydrate.equals(other.hydrate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hydrate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java index ffe193ed8..5e7a1ec59 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExecutionsListRequest && equalTo((ExecutionsListRequest) other); @@ -78,12 +78,12 @@ private boolean equalTo(ExecutionsListRequest other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncConnectionsClient.java new file mode 100644 index 000000000..4ae8157cd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncConnectionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.vault.types.ListFlowsVaultConnectionsRequestParameters; +import com.auth0.client.mgmt.flows.vault.types.UpdateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.FlowsVaultConnectionSummary; +import com.auth0.client.mgmt.types.GetFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncConnectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectionsClient rawClient; + + public AsyncConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectionsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture> list( + ListFlowsVaultConnectionsRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + ListFlowsVaultConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreateFlowsVaultConnectionRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateFlowsVaultConnectionRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, UpdateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncRawConnectionsClient.java new file mode 100644 index 000000000..69afed7dc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncRawConnectionsClient.java @@ -0,0 +1,497 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.flows.vault.types.ListFlowsVaultConnectionsRequestParameters; +import com.auth0.client.mgmt.flows.vault.types.UpdateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.FlowsVaultConnectionSummary; +import com.auth0.client.mgmt.types.GetFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.ListFlowsVaultConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConnectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list() { + return list(ListFlowsVaultConnectionsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + ListFlowsVaultConnectionsRequestParameters request) { + return list(request, null); + } + + public CompletableFuture>> list( + ListFlowsVaultConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowsVaultConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListFlowsVaultConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListFlowsVaultConnectionsRequestParameters nextRequest = + ListFlowsVaultConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getConnections().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + CreateFlowsVaultConnectionRequestContent request) { + return create(request, null); + } + + public CompletableFuture> create( + CreateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateFlowsVaultConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, null); + } + + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetFlowsVaultConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update(String id) { + return update(id, UpdateFlowsVaultConnectionRequestContent.builder().build()); + } + + public CompletableFuture> update( + String id, UpdateFlowsVaultConnectionRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, UpdateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateFlowsVaultConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncVaultClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncVaultClient.java new file mode 100644 index 000000000..a7d7074a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/AsyncVaultClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncVaultClient { + protected final ClientOptions clientOptions; + + protected final Supplier connectionsClient; + + public AsyncVaultClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.connectionsClient = Suppliers.memoize(() -> new AsyncConnectionsClient(clientOptions)); + } + + public AsyncConnectionsClient connections() { + return this.connectionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/ConnectionsClient.java new file mode 100644 index 000000000..dc3020290 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/ConnectionsClient.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.vault.types.ListFlowsVaultConnectionsRequestParameters; +import com.auth0.client.mgmt.flows.vault.types.UpdateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.FlowsVaultConnectionSummary; +import com.auth0.client.mgmt.types.GetFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionResponseContent; + +public class ConnectionsClient { + protected final ClientOptions clientOptions; + + private final RawConnectionsClient rawClient; + + public ConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectionsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + public SyncPagingIterable list(ListFlowsVaultConnectionsRequestParameters request) { + return this.rawClient.list(request).body(); + } + + public SyncPagingIterable list( + ListFlowsVaultConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreateFlowsVaultConnectionResponseContent create(CreateFlowsVaultConnectionRequestContent request) { + return this.rawClient.create(request).body(); + } + + public CreateFlowsVaultConnectionResponseContent create( + CreateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetFlowsVaultConnectionResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetFlowsVaultConnectionResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdateFlowsVaultConnectionResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + public UpdateFlowsVaultConnectionResponseContent update( + String id, UpdateFlowsVaultConnectionRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdateFlowsVaultConnectionResponseContent update( + String id, UpdateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/RawConnectionsClient.java new file mode 100644 index 000000000..60280b9e8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/RawConnectionsClient.java @@ -0,0 +1,370 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.flows.vault.types.ListFlowsVaultConnectionsRequestParameters; +import com.auth0.client.mgmt.flows.vault.types.UpdateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.FlowsVaultConnectionSummary; +import com.auth0.client.mgmt.types.GetFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.ListFlowsVaultConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectionsClient { + protected final ClientOptions clientOptions; + + public RawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list() { + return list(ListFlowsVaultConnectionsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list( + ListFlowsVaultConnectionsRequestParameters request) { + return list(request, null); + } + + public ManagementApiHttpResponse> list( + ListFlowsVaultConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListFlowsVaultConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListFlowsVaultConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListFlowsVaultConnectionsRequestParameters nextRequest = + ListFlowsVaultConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getConnections().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + CreateFlowsVaultConnectionRequestContent request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + CreateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateFlowsVaultConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + public ManagementApiHttpResponse get( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetFlowsVaultConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateFlowsVaultConnectionRequestContent.builder().build()); + } + + public ManagementApiHttpResponse update( + String id, UpdateFlowsVaultConnectionRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, UpdateFlowsVaultConnectionRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("flows/vault/connections") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateFlowsVaultConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/VaultClient.java b/src/main/java/com/auth0/client/mgmt/flows/vault/VaultClient.java new file mode 100644 index 000000000..8211fe9a6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/VaultClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class VaultClient { + protected final ClientOptions clientOptions; + + protected final Supplier connectionsClient; + + public VaultClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions)); + } + + public ConnectionsClient connections() { + return this.connectionsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java new file mode 100644 index 000000000..71a3effdf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFlowsVaultConnectionsRequestParameters.Builder.class) +public final class ListFlowsVaultConnectionsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final Map additionalProperties; + + private ListFlowsVaultConnectionsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFlowsVaultConnectionsRequestParameters + && equalTo((ListFlowsVaultConnectionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFlowsVaultConnectionsRequestParameters other) { + return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); + } + + @Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFlowsVaultConnectionsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + public ListFlowsVaultConnectionsRequestParameters build() { + return new ListFlowsVaultConnectionsRequestParameters(page, perPage, includeTotals, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java new file mode 100644 index 000000000..590d8dc49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.flows.vault.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionSetup; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFlowsVaultConnectionRequestContent.Builder.class) +public final class UpdateFlowsVaultConnectionRequestContent { + private final Optional name; + + private final Optional setup; + + private final Map additionalProperties; + + private UpdateFlowsVaultConnectionRequestContent( + Optional name, + Optional setup, + Map additionalProperties) { + this.name = name; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("setup") + public Optional getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFlowsVaultConnectionRequestContent + && equalTo((UpdateFlowsVaultConnectionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFlowsVaultConnectionRequestContent other) { + return name.equals(other.name) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional setup = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateFlowsVaultConnectionRequestContent other) { + name(other.getName()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "setup", nulls = Nulls.SKIP) + public Builder setup(Optional setup) { + this.setup = setup; + return this; + } + + public Builder setup(UpdateFlowsVaultConnectionSetup setup) { + this.setup = Optional.ofNullable(setup); + return this; + } + + public UpdateFlowsVaultConnectionRequestContent build() { + return new UpdateFlowsVaultConnectionRequestContent(name, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java index b830c8788..f2a8db1f7 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorDuoSettingsRequestContent @@ -70,12 +70,12 @@ private boolean equalTo(SetGuardianFactorDuoSettingsRequestContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java index aac1ee029..41d7e71f9 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorDuoSettingsRequestContent @@ -70,12 +70,12 @@ private boolean equalTo(UpdateGuardianFactorDuoSettingsRequestContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java index 09209a2db..b0069117f 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java @@ -40,7 +40,7 @@ public List getMessageTypes() { return messageTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneMessageTypesRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(SetGuardianFactorPhoneMessageTypesRequestContent other) return messageTypes.equals(other.messageTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.messageTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java index 8dd8996bf..9914eff36 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneTemplatesRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorPhoneTemplatesRequestContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorPhoneTemplatesRequestContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorPhoneTemplatesRequestContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public SetGuardianFactorPhoneTemplatesRequestContent build() { return new SetGuardianFactorPhoneTemplatesRequestContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java index f11acb96f..20ebde63a 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorSmsTemplatesRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorSmsTemplatesRequestContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorSmsTemplatesRequestContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorSmsTemplatesRequestContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public SetGuardianFactorSmsTemplatesRequestContent build() { return new SetGuardianFactorSmsTemplatesRequestContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java index db7494815..9ad21da78 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java @@ -35,7 +35,7 @@ public GuardianFactorsProviderSmsProviderEnum getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneRequestContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,20 +84,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorsProviderPhoneRequestContent other) { provider(other.getProvider()); return this; } - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @java.lang.Override + @Override public SetGuardianFactorsProviderPhoneRequestContent build() { return new SetGuardianFactorsProviderPhoneRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java index fd52ad20f..e5094691e 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneTwilioRequestContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioRequestContent othe && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java index 2c04c266d..1921eb0df 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java @@ -36,7 +36,7 @@ public GuardianFactorsProviderPushNotificationProviderDataEnum getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationRequestContent @@ -52,12 +52,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationRequestContent return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -85,20 +85,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorsProviderPushNotificationRequestContent other) { provider(other.getProvider()); return this; } - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderPushNotificationProviderDataEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @java.lang.Override + @Override public SetGuardianFactorsProviderPushNotificationRequestContent build() { return new SetGuardianFactorsProviderPushNotificationRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java index badfad30f..935c79180 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationSnsRequestContent @@ -145,7 +145,7 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsRequestCont && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java index 7d041b21f..348c1edb8 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java @@ -35,7 +35,7 @@ public GuardianFactorsProviderSmsProviderEnum getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsRequestContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,20 +84,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorsProviderSmsRequestContent other) { provider(other.getProvider()); return this; } - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @java.lang.Override + @Override public SetGuardianFactorsProviderSmsRequestContent build() { return new SetGuardianFactorsProviderSmsRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java index df428ac9b..e87479d56 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsTwilioRequestContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsTwilioRequestContent other) && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java index 1b2f29eed..82f9bbbe4 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsRequestContent @@ -145,7 +145,7 @@ private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsRequestC && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java index 680a9edde..e4df2c0a7 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java @@ -98,7 +98,7 @@ public Optional getAllowMultipleEnrollments() { return allowMultipleEnrollments; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateGuardianEnrollmentTicketRequestContent @@ -119,13 +119,13 @@ private boolean equalTo(CreateGuardianEnrollmentTicketRequestContent other) { && allowMultipleEnrollments.equals(other.allowMultipleEnrollments); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.userId, this.email, this.sendMail, this.emailLocale, this.factor, this.allowMultipleEnrollments); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateGuardianEnrollmentTicketRequestContent other) { userId(other.getUserId()); email(other.getEmail()); @@ -214,7 +214,7 @@ public Builder from(CreateGuardianEnrollmentTicketRequestContent other) { *

user_id for the enrollment ticket

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -225,7 +225,7 @@ public _FinalStage userId(@NotNull String userId) { *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments) { this.allowMultipleEnrollments = Optional.ofNullable(allowMultipleEnrollments); return this; @@ -234,20 +234,20 @@ public _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments) { /** *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "allow_multiple_enrollments", nulls = Nulls.SKIP) public _FinalStage allowMultipleEnrollments(Optional allowMultipleEnrollments) { this.allowMultipleEnrollments = allowMultipleEnrollments; return this; } - @java.lang.Override + @Override public _FinalStage factor(GuardianEnrollmentFactorEnum factor) { this.factor = Optional.ofNullable(factor); return this; } - @java.lang.Override + @Override @JsonSetter(value = "factor", nulls = Nulls.SKIP) public _FinalStage factor(Optional factor) { this.factor = factor; @@ -258,7 +258,7 @@ public _FinalStage factor(Optional factor) { *

Optional. Specify the locale of the enrollment email. Used with send_email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage emailLocale(String emailLocale) { this.emailLocale = Optional.ofNullable(emailLocale); return this; @@ -267,7 +267,7 @@ public _FinalStage emailLocale(String emailLocale) { /** *

Optional. Specify the locale of the enrollment email. Used with send_email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email_locale", nulls = Nulls.SKIP) public _FinalStage emailLocale(Optional emailLocale) { this.emailLocale = emailLocale; @@ -278,7 +278,7 @@ public _FinalStage emailLocale(Optional emailLocale) { *

Send an email to the user to start the enrollment

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage sendMail(Boolean sendMail) { this.sendMail = Optional.ofNullable(sendMail); return this; @@ -287,7 +287,7 @@ public _FinalStage sendMail(Boolean sendMail) { /** *

Send an email to the user to start the enrollment

*/ - @java.lang.Override + @Override @JsonSetter(value = "send_mail", nulls = Nulls.SKIP) public _FinalStage sendMail(Optional sendMail) { this.sendMail = sendMail; @@ -298,7 +298,7 @@ public _FinalStage sendMail(Optional sendMail) { *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -307,14 +307,14 @@ public _FinalStage email(String email) { /** *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public CreateGuardianEnrollmentTicketRequestContent build() { return new CreateGuardianEnrollmentTicketRequestContent( userId, email, sendMail, emailLocale, factor, allowMultipleEnrollments, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java index 1f50447d3..c4b43415b 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorRequestContent && equalTo((SetGuardianFactorRequestContent) other); @@ -50,12 +50,12 @@ private boolean equalTo(SetGuardianFactorRequestContent other) { return enabled == other.enabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -86,7 +86,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorRequestContent other) { enabled(other.getEnabled()); return this; @@ -97,14 +97,14 @@ public Builder from(SetGuardianFactorRequestContent other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @java.lang.Override + @Override public SetGuardianFactorRequestContent build() { return new SetGuardianFactorRequestContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java index 6583f6ba5..29879ba8e 100644 --- a/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java +++ b/src/main/java/com/auth0/client/mgmt/hooks/AsyncRawSecretsClient.java @@ -43,14 +43,14 @@ public AsyncRawSecretsClient(ClientOptions clientOptions) { /** * Retrieve a hook's secrets by the ID of the hook. */ - public CompletableFuture>> get(String id) { + public CompletableFuture>> get(String id) { return get(id, null); } /** * Retrieve a hook's secrets by the ID of the hook. */ - public CompletableFuture>> get( + public CompletableFuture>> get( String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -68,7 +68,7 @@ public CompletableFuture>> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -77,7 +77,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } @@ -132,7 +132,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public CompletableFuture> create(String id, Map request) { + public CompletableFuture> create(String id, Map request) { return create(id, request, null); } @@ -140,7 +140,7 @@ public CompletableFuture> create(String id, Map< * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ public CompletableFuture> create( - String id, Map request, RequestOptions requestOptions) { + String id, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks") @@ -315,7 +315,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public CompletableFuture> update(String id, Map request) { + public CompletableFuture> update(String id, Map request) { return update(id, request, null); } @@ -323,7 +323,7 @@ public CompletableFuture> update(String id, Map< * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ public CompletableFuture> update( - String id, Map request, RequestOptions requestOptions) { + String id, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks") diff --git a/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java index fd5c1611a..c2e2cd657 100644 --- a/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java +++ b/src/main/java/com/auth0/client/mgmt/hooks/AsyncSecretsClient.java @@ -29,28 +29,28 @@ public AsyncRawSecretsClient withRawResponse() { /** * Retrieve a hook's secrets by the ID of the hook. */ - public CompletableFuture> get(String id) { + public CompletableFuture> get(String id) { return this.rawClient.get(id).thenApply(response -> response.body()); } /** * Retrieve a hook's secrets by the ID of the hook. */ - public CompletableFuture> get(String id, RequestOptions requestOptions) { + public CompletableFuture> get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); } /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public CompletableFuture create(String id, Map request) { + public CompletableFuture create(String id, Map request) { return this.rawClient.create(id, request).thenApply(response -> response.body()); } /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public CompletableFuture create(String id, Map request, RequestOptions requestOptions) { + public CompletableFuture create(String id, Map request, RequestOptions requestOptions) { return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); } @@ -71,14 +71,14 @@ public CompletableFuture delete(String id, List request, RequestOp /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public CompletableFuture update(String id, Map request) { + public CompletableFuture update(String id, Map request) { return this.rawClient.update(id, request).thenApply(response -> response.body()); } /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public CompletableFuture update(String id, Map request, RequestOptions requestOptions) { + public CompletableFuture update(String id, Map request, RequestOptions requestOptions) { return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java index 3ea5342f2..aa30296e0 100644 --- a/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java +++ b/src/main/java/com/auth0/client/mgmt/hooks/RawSecretsClient.java @@ -39,14 +39,14 @@ public RawSecretsClient(ClientOptions clientOptions) { /** * Retrieve a hook's secrets by the ID of the hook. */ - public ManagementApiHttpResponse> get(String id) { + public ManagementApiHttpResponse> get(String id) { return get(id, null); } /** * Retrieve a hook's secrets by the ID of the hook. */ - public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { + public ManagementApiHttpResponse> get(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks") @@ -69,7 +69,7 @@ public ManagementApiHttpResponse> get(String id, RequestOpti if (response.isSuccessful()) { return new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } try { @@ -104,7 +104,7 @@ public ManagementApiHttpResponse> get(String id, RequestOpti /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public ManagementApiHttpResponse create(String id, Map request) { + public ManagementApiHttpResponse create(String id, Map request) { return create(id, request, null); } @@ -112,7 +112,7 @@ public ManagementApiHttpResponse create(String id, Map req * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ public ManagementApiHttpResponse create( - String id, Map request, RequestOptions requestOptions) { + String id, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks") @@ -242,7 +242,7 @@ public ManagementApiHttpResponse delete(String id, List request, R /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public ManagementApiHttpResponse update(String id, Map request) { + public ManagementApiHttpResponse update(String id, Map request) { return update(id, request, null); } @@ -250,7 +250,7 @@ public ManagementApiHttpResponse update(String id, Map req * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ public ManagementApiHttpResponse update( - String id, Map request, RequestOptions requestOptions) { + String id, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hooks") diff --git a/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java b/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java index a35e20289..9b73a4f1f 100644 --- a/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java +++ b/src/main/java/com/auth0/client/mgmt/hooks/SecretsClient.java @@ -28,28 +28,28 @@ public RawSecretsClient withRawResponse() { /** * Retrieve a hook's secrets by the ID of the hook. */ - public Map get(String id) { + public Map get(String id) { return this.rawClient.get(id).body(); } /** * Retrieve a hook's secrets by the ID of the hook. */ - public Map get(String id, RequestOptions requestOptions) { + public Map get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).body(); } /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public void create(String id, Map request) { + public void create(String id, Map request) { this.rawClient.create(id, request).body(); } /** * Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. */ - public void create(String id, Map request, RequestOptions requestOptions) { + public void create(String id, Map request, RequestOptions requestOptions) { this.rawClient.create(id, request, requestOptions).body(); } @@ -70,14 +70,14 @@ public void delete(String id, List request, RequestOptions requestOption /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public void update(String id, Map request) { + public void update(String id, Map request) { this.rawClient.update(id, request).body(); } /** * Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. */ - public void update(String id, Map request, RequestOptions requestOptions) { + public void update(String id, Map request, RequestOptions requestOptions) { this.rawClient.update(id, request, requestOptions).body(); } } diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java index 363375c59..c9d8d8026 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java @@ -75,7 +75,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersRequestContent && equalTo((CreateExportUsersRequestContent) other); @@ -93,12 +93,12 @@ private boolean equalTo(CreateExportUsersRequestContent other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.format, this.limit, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java index ef399ab4b..d1dc1b427 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java @@ -76,7 +76,7 @@ public Optional getSendCompletionEmail() { return sendCompletionEmail; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateImportUsersRequestContent && equalTo((CreateImportUsersRequestContent) other); @@ -94,12 +94,12 @@ private boolean equalTo(CreateImportUsersRequestContent other) { && sendCompletionEmail.equals(other.sendCompletionEmail); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.upsert, this.externalId, this.sendCompletionEmail); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateImportUsersRequestContent other) { connectionId(other.getConnectionId()); upsert(other.getUpsert()); @@ -171,7 +171,7 @@ public Builder from(CreateImportUsersRequestContent other) { *

connection_id of the connection to which users will be imported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -182,7 +182,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage sendCompletionEmail(Boolean sendCompletionEmail) { this.sendCompletionEmail = Optional.ofNullable(sendCompletionEmail); return this; @@ -191,7 +191,7 @@ public _FinalStage sendCompletionEmail(Boolean sendCompletionEmail) { /** *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "send_completion_email", nulls = Nulls.SKIP) public _FinalStage sendCompletionEmail(Optional sendCompletionEmail) { this.sendCompletionEmail = sendCompletionEmail; @@ -202,7 +202,7 @@ public _FinalStage sendCompletionEmail(Optional sendCompletionEmail) { *

Customer-defined ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage externalId(String externalId) { this.externalId = Optional.ofNullable(externalId); return this; @@ -211,7 +211,7 @@ public _FinalStage externalId(String externalId) { /** *

Customer-defined ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "external_id", nulls = Nulls.SKIP) public _FinalStage externalId(Optional externalId) { this.externalId = externalId; @@ -222,7 +222,7 @@ public _FinalStage externalId(Optional externalId) { *

Whether to update users if they already exist (true) or to ignore them (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage upsert(Boolean upsert) { this.upsert = Optional.ofNullable(upsert); return this; @@ -231,14 +231,14 @@ public _FinalStage upsert(Boolean upsert) { /** *

Whether to update users if they already exist (true) or to ignore them (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "upsert", nulls = Nulls.SKIP) public _FinalStage upsert(Optional upsert) { this.upsert = upsert; return this; } - @java.lang.Override + @Override public CreateImportUsersRequestContent build() { return new CreateImportUsersRequestContent( connectionId, upsert, externalId, sendCompletionEmail, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java index 2aefa6c31..b89827758 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java @@ -74,7 +74,7 @@ public Optional getOrganizationId() { return organizationId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerificationEmailRequestContent @@ -93,12 +93,12 @@ private boolean equalTo(CreateVerificationEmailRequestContent other) { && organizationId.equals(other.organizationId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userId, this.clientId, this.identity, this.organizationId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,7 +153,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateVerificationEmailRequestContent other) { userId(other.getUserId()); clientId(other.getClientId()); @@ -167,7 +167,7 @@ public Builder from(CreateVerificationEmailRequestContent other) { *

user_id of the user to send the verification email to.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -178,7 +178,7 @@ public _FinalStage userId(@NotNull String userId) { *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage organizationId(String organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; @@ -187,20 +187,20 @@ public _FinalStage organizationId(String organizationId) { /** *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

*/ - @java.lang.Override + @Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @java.lang.Override + @Override public _FinalStage identity(Identity identity) { this.identity = Optional.ofNullable(identity); return this; } - @java.lang.Override + @Override @JsonSetter(value = "identity", nulls = Nulls.SKIP) public _FinalStage identity(Optional identity) { this.identity = identity; @@ -211,7 +211,7 @@ public _FinalStage identity(Optional identity) { *

client_id of the client (application). If no value provided, the global Client ID will be used.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -220,14 +220,14 @@ public _FinalStage clientId(String clientId) { /** *

client_id of the client (application). If no value provided, the global Client ID will be used.

*/ - @java.lang.Override + @Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; return this; } - @java.lang.Override + @Override public CreateVerificationEmailRequestContent build() { return new CreateVerificationEmailRequestContent( userId, clientId, identity, organizationId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java index 234a856c7..747c5efc3 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ErrorsGetResponse && equalTo((ErrorsGetResponse) other); @@ -53,12 +53,12 @@ private boolean equalTo(ErrorsGetResponse other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -82,7 +82,7 @@ static final class Deserializer extends StdDeserializer { super(ErrorsGetResponse.class); } - @java.lang.Override + @Override public ErrorsGetResponse deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java index c0babe613..1d6508d0b 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java +++ b/src/main/java/com/auth0/client/mgmt/keys/AsyncRawEncryptionClient.java @@ -74,9 +74,11 @@ public CompletableFuture> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("keys/encryption"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java index 980fad36a..afa78b51e 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java @@ -34,7 +34,7 @@ public CreateEncryptionKeyType getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyRequestContent && equalTo((CreateEncryptionKeyRequestContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateEncryptionKeyRequestContent other) { return type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEncryptionKeyRequestContent other) { type(other.getType()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CreateEncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public CreateEncryptionKeyRequestContent build() { return new CreateEncryptionKeyRequestContent(type, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java index d87c5b36d..e3a786ad6 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java @@ -36,7 +36,7 @@ public String getWrappedKey() { return wrappedKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ImportEncryptionKeyRequestContent && equalTo((ImportEncryptionKeyRequestContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ImportEncryptionKeyRequestContent other) { return wrappedKey.equals(other.wrappedKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.wrappedKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements WrappedKeyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ImportEncryptionKeyRequestContent other) { wrappedKey(other.getWrappedKey()); return this; @@ -98,14 +98,14 @@ public Builder from(ImportEncryptionKeyRequestContent other) { *

Base64 encoded ciphertext of key material wrapped by public wrapping key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("wrapped_key") public _FinalStage wrappedKey(@NotNull String wrappedKey) { this.wrappedKey = Objects.requireNonNull(wrappedKey, "wrappedKey must not be null"); return this; } - @java.lang.Override + @Override public ImportEncryptionKeyRequestContent build() { return new ImportEncryptionKeyRequestContent(wrappedKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java index 17f70c33b..fbb8e2150 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.keys.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListEncryptionKeysRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListEncryptionKeysRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEncryptionKeysRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListEncryptionKeysRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListEncryptionKeysRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java index 78249d6b9..ef02104fe 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java @@ -40,7 +40,7 @@ public List getKeys() { return keys; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetCustomSigningKeysRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(SetCustomSigningKeysRequestContent other) { return keys.equals(other.keys); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.keys); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java new file mode 100644 index 000000000..c991d6998 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; +import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncDiscoveryDomainsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDiscoveryDomainsClient rawClient; + + public AsyncDiscoveryDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDiscoveryDomainsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDiscoveryDomainsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public CompletableFuture> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public CompletableFuture> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture create( + String id, CreateOrganizationDiscoveryDomainRequestContent request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture create( + String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public CompletableFuture get(String id, String discoveryDomainId) { + return this.rawClient.get(id, discoveryDomainId).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public CompletableFuture get( + String id, String discoveryDomainId, RequestOptions requestOptions) { + return this.rawClient.get(id, discoveryDomainId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public CompletableFuture delete(String id, String discoveryDomainId) { + return this.rawClient.delete(id, discoveryDomainId).thenApply(response -> response.body()); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public CompletableFuture delete(String id, String discoveryDomainId, RequestOptions requestOptions) { + return this.rawClient.delete(id, discoveryDomainId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture update( + String id, String discoveryDomainId) { + return this.rawClient.update(id, discoveryDomainId).thenApply(response -> response.body()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture update( + String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { + return this.rawClient.update(id, discoveryDomainId, request).thenApply(response -> response.body()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture update( + String id, + String discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(id, discoveryDomainId, request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java index 2a214fd54..ff1f03932 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawClientGrantsClient.java @@ -63,11 +63,19 @@ public CompletableFuture>> list( + String id) { + return list( + id, ListOrganizationDiscoveryDomainsRequestParameters.builder().build()); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public CompletableFuture>> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public CompletableFuture>> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationDiscoveryDomainsResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationDiscoveryDomainsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationDiscoveryDomainsRequestParameters nextRequest = + ListOrganizationDiscoveryDomainsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getDomains(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture> create( + String id, CreateOrganizationDiscoveryDomainRequestContent request) { + return create(id, request, null); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture> create( + String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationDiscoveryDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public CompletableFuture> get( + String id, String discoveryDomainId) { + return get(id, discoveryDomainId, null); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public CompletableFuture> get( + String id, String discoveryDomainId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationDiscoveryDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public CompletableFuture> delete(String id, String discoveryDomainId) { + return delete(id, discoveryDomainId, null); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public CompletableFuture> delete( + String id, String discoveryDomainId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture> update( + String id, String discoveryDomainId) { + return update( + id, + discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent.builder().build()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture> update( + String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { + return update(id, discoveryDomainId, request, null); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CompletableFuture> update( + String id, + String discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationDiscoveryDomainResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java index 122846215..638ce747b 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawEnabledConnectionsClient.java @@ -73,9 +73,11 @@ public CompletableFuture list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public SyncPagingIterable list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public SyncPagingIterable list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CreateOrganizationDiscoveryDomainResponseContent create( + String id, CreateOrganizationDiscoveryDomainRequestContent request) { + return this.rawClient.create(id, request).body(); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public CreateOrganizationDiscoveryDomainResponseContent create( + String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public GetOrganizationDiscoveryDomainResponseContent get(String id, String discoveryDomainId) { + return this.rawClient.get(id, discoveryDomainId).body(); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public GetOrganizationDiscoveryDomainResponseContent get( + String id, String discoveryDomainId, RequestOptions requestOptions) { + return this.rawClient.get(id, discoveryDomainId, requestOptions).body(); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public void delete(String id, String discoveryDomainId) { + this.rawClient.delete(id, discoveryDomainId).body(); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public void delete(String id, String discoveryDomainId, RequestOptions requestOptions) { + this.rawClient.delete(id, discoveryDomainId, requestOptions).body(); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public UpdateOrganizationDiscoveryDomainResponseContent update(String id, String discoveryDomainId) { + return this.rawClient.update(id, discoveryDomainId).body(); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public UpdateOrganizationDiscoveryDomainResponseContent update( + String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { + return this.rawClient.update(id, discoveryDomainId, request).body(); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public UpdateOrganizationDiscoveryDomainResponseContent update( + String id, + String discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent request, + RequestOptions requestOptions) { + return this.rawClient + .update(id, discoveryDomainId, request, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java index dad55df57..74a99a44f 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawClientGrantsClient.java @@ -58,11 +58,19 @@ public ManagementApiHttpResponse> li .addPathSegments("organizations") .addPathSegment(id) .addPathSegments("client-grants"); - QueryStringMapper.addQueryParameter(httpUrl, "audience", request.getAudience(), false); - QueryStringMapper.addQueryParameter(httpUrl, "client_id", request.getClientId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + if (!request.getAudience().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "audience", request.getAudience().orElse(null), false); + } + if (!request.getClientId().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "client_id", request.getClientId().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); if (request.getGrantIds().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "grant_ids", request.getGrantIds().get(), true); diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java new file mode 100644 index 000000000..9c2445251 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java @@ -0,0 +1,424 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationDiscoveryDomainsResponseContent; +import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; +import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDiscoveryDomainsClient { + protected final ClientOptions clientOptions; + + public RawDiscoveryDomainsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public ManagementApiHttpResponse> list(String id) { + return list( + id, ListOrganizationDiscoveryDomainsRequestParameters.builder().build()); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve list of all organization discovery domains associated with the specified organization. + */ + public ManagementApiHttpResponse> list( + String id, ListOrganizationDiscoveryDomainsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationDiscoveryDomainsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationDiscoveryDomainsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListOrganizationDiscoveryDomainsRequestParameters nextRequest = + ListOrganizationDiscoveryDomainsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getDomains(); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public ManagementApiHttpResponse create( + String id, CreateOrganizationDiscoveryDomainRequestContent request) { + return create(id, request, null); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public ManagementApiHttpResponse create( + String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationDiscoveryDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public ManagementApiHttpResponse get( + String id, String discoveryDomainId) { + return get(id, discoveryDomainId, null); + } + + /** + * Retrieve details about a single organization discovery domain specified by ID. + */ + public ManagementApiHttpResponse get( + String id, String discoveryDomainId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationDiscoveryDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public ManagementApiHttpResponse delete(String id, String discoveryDomainId) { + return delete(id, discoveryDomainId, null); + } + + /** + * Remove a discovery domain from an organization. This action cannot be undone. + */ + public ManagementApiHttpResponse delete(String id, String discoveryDomainId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public ManagementApiHttpResponse update( + String id, String discoveryDomainId) { + return update( + id, + discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent.builder().build()); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public ManagementApiHttpResponse update( + String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { + return update(id, discoveryDomainId, request, null); + } + + /** + * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + */ + public ManagementApiHttpResponse update( + String id, + String discoveryDomainId, + UpdateOrganizationDiscoveryDomainRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains") + .addPathSegment(discoveryDomainId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationDiscoveryDomainResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java index 174c23e7a..a4a34f453 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawEnabledConnectionsClient.java @@ -68,9 +68,11 @@ public ManagementApiHttpResponse> lis .addPathSegments("organizations") .addPathSegment(id) .addPathSegments("enabled_connections"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java index 5646108f9..5d1989446 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawInvitationsClient.java @@ -68,12 +68,23 @@ public ManagementApiHttpResponse> lis .addPathSegments("organizations") .addPathSegment(id) .addPathSegments("invitations"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -233,8 +244,14 @@ public ManagementApiHttpResponse get( .addPathSegment(id) .addPathSegments("invitations") .addPathSegment(invitationId); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java index cfba23170..9cdd816cd 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawMembersClient.java @@ -117,10 +117,19 @@ public ManagementApiHttpResponse> list( .addPathSegments("organizations") .addPathSegment(id) .addPathSegments("members"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java index 9396f1acb..83a6c6bcf 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/AsyncRawRolesClient.java @@ -82,9 +82,11 @@ public CompletableFuture>> li .addPathSegments("members") .addPathSegment(userId) .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java index 69394c79e..f1624d5e2 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/RawRolesClient.java @@ -77,9 +77,11 @@ public ManagementApiHttpResponse> list( .addPathSegments("members") .addPathSegment(userId) .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java index 69687c67c..0bc1d20d2 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignOrganizationMemberRolesRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(AssignOrganizationMemberRolesRequestContent other) { return roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java index cdf4036f7..e3cd70d4c 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteOrganizationMemberRolesRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(DeleteOrganizationMemberRolesRequestContent other) { return roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java index 62ab7f2a5..f5a231402 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.organizations.members.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListOrganizationMemberRolesRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListOrganizationMemberRolesRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMemberRolesRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListOrganizationMemberRolesRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListOrganizationMemberRolesRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java index 01aa3b991..c03409e61 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java @@ -76,7 +76,7 @@ public Optional getShowAsButton() { return showAsButton; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddOrganizationConnectionRequestContent @@ -95,12 +95,12 @@ private boolean equalTo(AddOrganizationConnectionRequestContent other) { && showAsButton.equals(other.showAsButton); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -158,7 +158,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(AddOrganizationConnectionRequestContent other) { connectionId(other.getConnectionId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -172,7 +172,7 @@ public Builder from(AddOrganizationConnectionRequestContent other) { *

Single connection ID to add to the organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -183,7 +183,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -192,7 +192,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -203,7 +203,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); return this; @@ -212,7 +212,7 @@ public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { /** *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

*/ - @java.lang.Override + @Override @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) public _FinalStage isSignupEnabled(Optional isSignupEnabled) { this.isSignupEnabled = isSignupEnabled; @@ -223,7 +223,7 @@ public _FinalStage isSignupEnabled(Optional isSignupEnabled) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -232,14 +232,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @java.lang.Override + @Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @java.lang.Override + @Override public AddOrganizationConnectionRequestContent build() { return new AddOrganizationConnectionRequestContent( connectionId, assignMembershipOnLogin, isSignupEnabled, showAsButton, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java index 2a3717228..5849ca265 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java @@ -36,7 +36,7 @@ public String getGrantId() { return grantId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssociateOrganizationClientGrantRequestContent @@ -52,12 +52,12 @@ private boolean equalTo(AssociateOrganizationClientGrantRequestContent other) { return grantId.equals(other.grantId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.grantId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements GrantIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(AssociateOrganizationClientGrantRequestContent other) { grantId(other.getGrantId()); return this; @@ -99,14 +99,14 @@ public Builder from(AssociateOrganizationClientGrantRequestContent other) { *

A Client Grant ID to add to the organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("grant_id") public _FinalStage grantId(@NotNull String grantId) { this.grantId = Objects.requireNonNull(grantId, "grantId must not be null"); return this; } - @java.lang.Override + @Override public AssociateOrganizationClientGrantRequestContent build() { return new AssociateOrganizationClientGrantRequestContent(grantId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java new file mode 100644 index 000000000..d897a4d72 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.OrganizationDiscoveryDomainStatus; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationDiscoveryDomainRequestContent.Builder.class) +public final class CreateOrganizationDiscoveryDomainRequestContent { + private final String domain; + + private final Optional status; + + private final Map additionalProperties; + + private CreateOrganizationDiscoveryDomainRequestContent( + String domain, + Optional status, + Map additionalProperties) { + this.domain = domain; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationDiscoveryDomainRequestContent + && equalTo((CreateOrganizationDiscoveryDomainRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationDiscoveryDomainRequestContent other) { + return domain.equals(other.domain) && status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash(this.domain, this.status); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DomainStage builder() { + return new Builder(); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + _FinalStage domain(@NotNull String domain); + + Builder from(CreateOrganizationDiscoveryDomainRequestContent other); + } + + public interface _FinalStage { + CreateOrganizationDiscoveryDomainRequestContent build(); + + _FinalStage status(Optional status); + + _FinalStage status(OrganizationDiscoveryDomainStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DomainStage, _FinalStage { + private String domain; + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateOrganizationDiscoveryDomainRequestContent other) { + domain(other.getDomain()); + status(other.getStatus()); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("domain") + public _FinalStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + public _FinalStage status(OrganizationDiscoveryDomainStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public CreateOrganizationDiscoveryDomainRequestContent build() { + return new CreateOrganizationDiscoveryDomainRequestContent(domain, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java index e1fc23bc4..5319ec585 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java @@ -127,7 +127,7 @@ public Optional getSendInvitationEmail() { return sendInvitationEmail; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationInvitationRequestContent @@ -151,7 +151,7 @@ private boolean equalTo(CreateOrganizationInvitationRequestContent other) { && sendInvitationEmail.equals(other.sendInvitationEmail); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.inviter, @@ -165,7 +165,7 @@ public int hashCode() { this.sendInvitationEmail); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -256,7 +256,7 @@ public static final class Builder implements InviterStage, InviteeStage, ClientI private Builder() {} - @java.lang.Override + @Override public Builder from(CreateOrganizationInvitationRequestContent other) { inviter(other.getInviter()); invitee(other.getInvitee()); @@ -270,14 +270,14 @@ public Builder from(CreateOrganizationInvitationRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("inviter") public InviteeStage inviter(@NotNull OrganizationInvitationInviter inviter) { this.inviter = Objects.requireNonNull(inviter, "inviter must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("invitee") public ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee) { this.invitee = Objects.requireNonNull(invitee, "invitee must not be null"); @@ -289,7 +289,7 @@ public ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee) { *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -300,7 +300,7 @@ public _FinalStage clientId(@NotNull String clientId) { *

Whether the user will receive an invitation email (true) or no email (false), true by default

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage sendInvitationEmail(Boolean sendInvitationEmail) { this.sendInvitationEmail = Optional.ofNullable(sendInvitationEmail); return this; @@ -309,7 +309,7 @@ public _FinalStage sendInvitationEmail(Boolean sendInvitationEmail) { /** *

Whether the user will receive an invitation email (true) or no email (false), true by default

*/ - @java.lang.Override + @Override @JsonSetter(value = "send_invitation_email", nulls = Nulls.SKIP) public _FinalStage sendInvitationEmail(Optional sendInvitationEmail) { this.sendInvitationEmail = sendInvitationEmail; @@ -320,7 +320,7 @@ public _FinalStage sendInvitationEmail(Optional sendInvitationEmail) { *

List of roles IDs to associated with the user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage roles(List roles) { this.roles = Optional.ofNullable(roles); return this; @@ -329,7 +329,7 @@ public _FinalStage roles(List roles) { /** *

List of roles IDs to associated with the user.

*/ - @java.lang.Override + @Override @JsonSetter(value = "roles", nulls = Nulls.SKIP) public _FinalStage roles(Optional> roles) { this.roles = roles; @@ -340,7 +340,7 @@ public _FinalStage roles(Optional> roles) { *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage ttlSec(Integer ttlSec) { this.ttlSec = Optional.ofNullable(ttlSec); return this; @@ -349,33 +349,33 @@ public _FinalStage ttlSec(Integer ttlSec) { /** *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

*/ - @java.lang.Override + @Override @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) public _FinalStage ttlSec(Optional ttlSec) { this.ttlSec = ttlSec; return this; } - @java.lang.Override + @Override public _FinalStage userMetadata(Map userMetadata) { this.userMetadata = Optional.ofNullable(userMetadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) public _FinalStage userMetadata(Optional> userMetadata) { this.userMetadata = userMetadata; return this; } - @java.lang.Override + @Override public _FinalStage appMetadata(Map appMetadata) { this.appMetadata = Optional.ofNullable(appMetadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) public _FinalStage appMetadata(Optional> appMetadata) { this.appMetadata = appMetadata; @@ -386,7 +386,7 @@ public _FinalStage appMetadata(Optional> appMetadata) { *

The id of the connection to force invitee to authenticate with.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -395,14 +395,14 @@ public _FinalStage connectionId(String connectionId) { /** *

The id of the connection to force invitee to authenticate with.

*/ - @java.lang.Override + @Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @java.lang.Override + @Override public CreateOrganizationInvitationRequestContent build() { return new CreateOrganizationInvitationRequestContent( inviter, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java index 2fc0bfa7f..ce1ae41b5 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java @@ -38,7 +38,7 @@ public List getMembers() { return members; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationMemberRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(CreateOrganizationMemberRequestContent other) { return members.equals(other.members); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.members); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java index 107e0da29..bc8b9e1c7 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java @@ -38,7 +38,7 @@ public List getMembers() { return members; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteOrganizationMembersRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(DeleteOrganizationMembersRequestContent other) { return members.equals(other.members); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.members); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java index 3fa65613f..503129048 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationInvitationRequestParameters @@ -90,12 +90,12 @@ private boolean equalTo(GetOrganizationInvitationRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java index 38d7edf5b..27766b3d7 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java @@ -98,9 +98,6 @@ public OptionalNullable getClientId() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -140,13 +137,7 @@ private OptionalNullable _getClientId() { return clientId; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationClientGrantsRequestParameters @@ -167,12 +158,12 @@ private boolean equalTo(ListOrganizationClientGrantsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.grantIds, this.audience, this.clientId, this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -312,7 +303,7 @@ public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java index 76a4e4ca7..7e128605f 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.organizations.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListOrganizationConnectionsRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListOrganizationConnectionsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationConnectionsRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListOrganizationConnectionsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListOrganizationConnectionsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java new file mode 100644 index 000000000..5d1f93ce0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationDiscoveryDomainsRequestParameters.Builder.class) +public final class ListOrganizationDiscoveryDomainsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListOrganizationDiscoveryDomainsRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationDiscoveryDomainsRequestParameters + && equalTo((ListOrganizationDiscoveryDomainsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationDiscoveryDomainsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationDiscoveryDomainsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListOrganizationDiscoveryDomainsRequestParameters build() { + return new ListOrganizationDiscoveryDomainsRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java index e216f160a..449c314dd 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.organizations.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListOrganizationInvitationsRequestParameters.Builder.class) @@ -60,9 +60,6 @@ private ListOrganizationInvitationsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -120,12 +117,6 @@ public OptionalNullable getSort() { return sort; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("fields") private OptionalNullable _getFields() { @@ -144,7 +135,7 @@ private OptionalNullable _getSort() { return sort; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationInvitationsRequestParameters @@ -165,12 +156,12 @@ private boolean equalTo(ListOrganizationInvitationsRequestParameters other) { && sort.equals(other.sort); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.fields, this.includeFields, this.sort); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -212,7 +203,7 @@ public Builder from(ListOrganizationInvitationsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -231,7 +222,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -265,7 +256,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -299,7 +290,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -314,7 +305,7 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -333,7 +324,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -348,7 +339,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@Nullable OptionalNullable includeFields) { + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -367,7 +358,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + public Builder includeFields(Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { @@ -382,7 +373,7 @@ public Builder includeFields(com.auth0.client.mgmt.core.Nullable includ *

Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1.

*/ @JsonSetter(value = "sort", nulls = Nulls.SKIP) - public Builder sort(@Nullable OptionalNullable sort) { + public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { this.sort = sort; return this; } @@ -401,7 +392,7 @@ public Builder sort(Optional sort) { return this; } - public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + public Builder sort(Nullable sort) { if (sort.isNull()) { this.sort = OptionalNullable.ofNull(); } else if (sort.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java index 4c9a985ac..10bc81a5e 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java @@ -109,7 +109,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMembersRequestParameters @@ -128,12 +128,12 @@ private boolean equalTo(ListOrganizationMembersRequestParameters other) { && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take, this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java index ee5ef19d8..83a72dcfc 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java @@ -63,7 +63,7 @@ public Optional getShowAsButton() { return showAsButton; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationConnectionRequestContent @@ -81,12 +81,12 @@ private boolean equalTo(UpdateOrganizationConnectionRequestContent other) { && showAsButton.equals(other.showAsButton); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java new file mode 100644 index 000000000..18a6ae38b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.OrganizationDiscoveryDomainStatus; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationDiscoveryDomainRequestContent.Builder.class) +public final class UpdateOrganizationDiscoveryDomainRequestContent { + private final Optional status; + + private final Map additionalProperties; + + private UpdateOrganizationDiscoveryDomainRequestContent( + Optional status, Map additionalProperties) { + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationDiscoveryDomainRequestContent + && equalTo((UpdateOrganizationDiscoveryDomainRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationDiscoveryDomainRequestContent other) { + return status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash(this.status); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationDiscoveryDomainRequestContent other) { + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OrganizationDiscoveryDomainStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public UpdateOrganizationDiscoveryDomainRequestContent build() { + return new UpdateOrganizationDiscoveryDomainRequestContent(status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java index ac1436180..b7fe4984f 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java @@ -18,9 +18,11 @@ import com.auth0.client.mgmt.errors.PaymentRequiredError; import com.auth0.client.mgmt.errors.TooManyRequestsError; import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.prompts.types.BulkUpdateAculRequestContent; import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.BulkUpdateAculResponseContent; import com.auth0.client.mgmt.types.GetAculResponseContent; import com.auth0.client.mgmt.types.ListAculsOffsetPaginatedResponseContent; import com.auth0.client.mgmt.types.PromptGroupNameEnum; @@ -73,14 +75,31 @@ public CompletableFuture> bulkUpdate( + BulkUpdateAculRequestContent request) { + return bulkUpdate(request, null); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public CompletableFuture> bulkUpdate( + BulkUpdateAculRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts/rendering") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, BulkUpdateAculResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + /** * Get render settings for a screen. */ @@ -269,32 +384,6 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture> update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { @@ -303,32 +392,6 @@ public CompletableFuture> u /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture> update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -337,32 +400,6 @@ public CompletableFuture> u /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture> update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java index 49059fe9f..f45ce6126 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java @@ -6,9 +6,11 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.BulkUpdateAculRequestContent; import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.BulkUpdateAculResponseContent; import com.auth0.client.mgmt.types.GetAculResponseContent; import com.auth0.client.mgmt.types.PromptGroupNameEnum; import com.auth0.client.mgmt.types.ScreenGroupNameEnum; @@ -54,6 +56,21 @@ public CompletableFuture> list( return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public CompletableFuture bulkUpdate(BulkUpdateAculRequestContent request) { + return this.rawClient.bulkUpdate(request).thenApply(response -> response.body()); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public CompletableFuture bulkUpdate( + BulkUpdateAculRequestContent request, RequestOptions requestOptions) { + return this.rawClient.bulkUpdate(request, requestOptions).thenApply(response -> response.body()); + } + /** * Get render settings for a screen. */ @@ -71,32 +88,6 @@ public CompletableFuture get( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { return this.rawClient.update(prompt, screen).thenApply(response -> response.body()); @@ -104,32 +95,6 @@ public CompletableFuture update(PromptGroupNameEnum p /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -138,32 +103,6 @@ public CompletableFuture update( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public CompletableFuture update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java index 6e9f7dc88..61017d727 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java @@ -18,9 +18,11 @@ import com.auth0.client.mgmt.errors.PaymentRequiredError; import com.auth0.client.mgmt.errors.TooManyRequestsError; import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.prompts.types.BulkUpdateAculRequestContent; import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.BulkUpdateAculResponseContent; import com.auth0.client.mgmt.types.GetAculResponseContent; import com.auth0.client.mgmt.types.ListAculsOffsetPaginatedResponseContent; import com.auth0.client.mgmt.types.PromptGroupNameEnum; @@ -67,14 +69,31 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("prompts/rendering"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); - QueryStringMapper.addQueryParameter(httpUrl, "prompt", request.getPrompt(), false); - QueryStringMapper.addQueryParameter(httpUrl, "screen", request.getScreen(), false); - QueryStringMapper.addQueryParameter(httpUrl, "rendering_mode", request.getRenderingMode(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getPrompt().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "prompt", request.getPrompt().orElse(null), false); + } + if (!request.getScreen().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "screen", request.getScreen().orElse(null), false); + } + if (!request.getRenderingMode().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "rendering_mode", request.getRenderingMode().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -133,6 +152,77 @@ public ManagementApiHttpResponse> list( } } + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public ManagementApiHttpResponse bulkUpdate(BulkUpdateAculRequestContent request) { + return bulkUpdate(request, null); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public ManagementApiHttpResponse bulkUpdate( + BulkUpdateAculRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("prompts/rendering") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BulkUpdateAculResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + /** * Get render settings for a screen. */ @@ -206,32 +296,6 @@ public ManagementApiHttpResponse get( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { @@ -240,32 +304,6 @@ public ManagementApiHttpResponse update( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -274,32 +312,6 @@ public ManagementApiHttpResponse update( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java index b5e4718de..76e1b93d2 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java @@ -6,9 +6,11 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.BulkUpdateAculRequestContent; import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.BulkUpdateAculResponseContent; import com.auth0.client.mgmt.types.GetAculResponseContent; import com.auth0.client.mgmt.types.PromptGroupNameEnum; import com.auth0.client.mgmt.types.ScreenGroupNameEnum; @@ -53,6 +55,21 @@ public SyncPagingIterable list( return this.rawClient.list(request, requestOptions).body(); } + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public BulkUpdateAculResponseContent bulkUpdate(BulkUpdateAculRequestContent request) { + return this.rawClient.bulkUpdate(request).body(); + } + + /** + * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. + */ + public BulkUpdateAculResponseContent bulkUpdate( + BulkUpdateAculRequestContent request, RequestOptions requestOptions) { + return this.rawClient.bulkUpdate(request, requestOptions).body(); + } + /** * Get render settings for a screen. */ @@ -70,32 +87,6 @@ public GetAculResponseContent get( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public UpdateAculResponseContent update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { return this.rawClient.update(prompt, screen).body(); @@ -103,32 +94,6 @@ public UpdateAculResponseContent update(PromptGroupNameEnum prompt, ScreenGroupN /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public UpdateAculResponseContent update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -137,32 +102,6 @@ public UpdateAculResponseContent update( /** * Learn more about <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>configuring render settings</a> for advanced customization. - *

<p> - * Example <code>head_tags</code> array. See our <a href='https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens'>documentation</a> on using Liquid variables within head tags. - * </p> - * <pre>{ - * "head_tags": [ - * { - * "tag": "script", - * "attributes": { - * "defer": true, - * "src": "URL_TO_ASSET", - * "async": true, - * "integrity": [ - * "ASSET_SHA" - * ] - * } - * }, - * { - * "tag": "link", - * "attributes": { - * "href": "URL_TO_ASSET", - * "rel": "stylesheet" - * } - * } - * ] - * } - * </pre>

*/ public UpdateAculResponseContent update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java b/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java new file mode 100644 index 000000000..2accf0331 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.prompts.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.AculConfigsItem; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BulkUpdateAculRequestContent.Builder.class) +public final class BulkUpdateAculRequestContent { + private final List configs; + + private final Map additionalProperties; + + private BulkUpdateAculRequestContent(List configs, Map additionalProperties) { + this.configs = configs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("configs") + public List getConfigs() { + return configs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BulkUpdateAculRequestContent && equalTo((BulkUpdateAculRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BulkUpdateAculRequestContent other) { + return configs.equals(other.configs); + } + + @Override + public int hashCode() { + return Objects.hash(this.configs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List configs = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BulkUpdateAculRequestContent other) { + configs(other.getConfigs()); + return this; + } + + @JsonSetter(value = "configs", nulls = Nulls.SKIP) + public Builder configs(List configs) { + this.configs.clear(); + if (configs != null) { + this.configs.addAll(configs); + } + return this; + } + + public Builder addConfigs(AculConfigsItem configs) { + this.configs.add(configs); + return this; + } + + public Builder addAllConfigs(List configs) { + if (configs != null) { + this.configs.addAll(configs); + } + return this; + } + + public BulkUpdateAculRequestContent build() { + return new BulkUpdateAculRequestContent(configs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java index 051ffc54c..c981f005a 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java @@ -93,9 +93,6 @@ public OptionalNullable getIncludeFields() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -165,12 +162,6 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("prompt") private OptionalNullable _getPrompt() { @@ -189,7 +180,7 @@ private OptionalNullable _getRenderingMode() { return renderingMode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListAculsRequestParameters && equalTo((ListAculsRequestParameters) other); @@ -211,7 +202,7 @@ private boolean equalTo(ListAculsRequestParameters other) { && renderingMode.equals(other.renderingMode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.fields, @@ -224,7 +215,7 @@ public int hashCode() { this.renderingMode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -340,7 +331,7 @@ public Builder includeFields(com.auth0.client.mgmt.core.Nullable includ *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java index 20ba571c9..828708fe4 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java @@ -6,6 +6,7 @@ import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.AculContextConfigurationItem; import com.auth0.client.mgmt.types.AculFilters; import com.auth0.client.mgmt.types.AculHeadTag; import com.auth0.client.mgmt.types.AculRenderingModeEnum; @@ -29,32 +30,32 @@ public final class UpdateAculRequestContent { private final Optional renderingMode; - private final Optional> contextConfiguration; + private final Optional> contextConfiguration; private final OptionalNullable defaultHeadTagsDisabled; + private final OptionalNullable usePageTemplate; + private final Optional> headTags; private final OptionalNullable filters; - private final OptionalNullable usePageTemplate; - private final Map additionalProperties; private UpdateAculRequestContent( Optional renderingMode, - Optional> contextConfiguration, + Optional> contextConfiguration, OptionalNullable defaultHeadTagsDisabled, + OptionalNullable usePageTemplate, Optional> headTags, OptionalNullable filters, - OptionalNullable usePageTemplate, Map additionalProperties) { this.renderingMode = renderingMode; this.contextConfiguration = contextConfiguration; this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.usePageTemplate = usePageTemplate; this.headTags = headTags; this.filters = filters; - this.usePageTemplate = usePageTemplate; this.additionalProperties = additionalProperties; } @@ -63,11 +64,8 @@ public Optional getRenderingMode() { return renderingMode; } - /** - * @return Context values to make available - */ @JsonProperty("context_configuration") - public Optional> getContextConfiguration() { + public Optional> getContextConfiguration() { return contextConfiguration; } @@ -83,6 +81,18 @@ public OptionalNullable getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + /** * @return An array of head tags */ @@ -100,37 +110,25 @@ public OptionalNullable getFilters() { return filters; } - /** - * @return Use page template with ACUL - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_page_template") - public OptionalNullable getUsePageTemplate() { - if (usePageTemplate == null) { - return OptionalNullable.absent(); - } - return usePageTemplate; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("default_head_tags_disabled") private OptionalNullable _getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("filters") - private OptionalNullable _getFilters() { - return filters; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("use_page_template") private OptionalNullable _getUsePageTemplate() { return usePageTemplate; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAculRequestContent && equalTo((UpdateAculRequestContent) other); @@ -145,23 +143,23 @@ private boolean equalTo(UpdateAculRequestContent other) { return renderingMode.equals(other.renderingMode) && contextConfiguration.equals(other.contextConfiguration) && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && usePageTemplate.equals(other.usePageTemplate) && headTags.equals(other.headTags) - && filters.equals(other.filters) - && usePageTemplate.equals(other.usePageTemplate); + && filters.equals(other.filters); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.renderingMode, this.contextConfiguration, this.defaultHeadTagsDisabled, + this.usePageTemplate, this.headTags, - this.filters, - this.usePageTemplate); + this.filters); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -174,16 +172,16 @@ public static Builder builder() { public static final class Builder { private Optional renderingMode = Optional.empty(); - private Optional> contextConfiguration = Optional.empty(); + private Optional> contextConfiguration = Optional.empty(); private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + private Optional> headTags = Optional.empty(); private OptionalNullable filters = OptionalNullable.absent(); - private OptionalNullable usePageTemplate = OptionalNullable.absent(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,9 +191,9 @@ public Builder from(UpdateAculRequestContent other) { renderingMode(other.getRenderingMode()); contextConfiguration(other.getContextConfiguration()); defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + usePageTemplate(other.getUsePageTemplate()); headTags(other.getHeadTags()); filters(other.getFilters()); - usePageTemplate(other.getUsePageTemplate()); return this; } @@ -210,16 +208,13 @@ public Builder renderingMode(AculRenderingModeEnum renderingMode) { return this; } - /** - *

Context values to make available

- */ @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) - public Builder contextConfiguration(Optional> contextConfiguration) { + public Builder contextConfiguration(Optional> contextConfiguration) { this.contextConfiguration = contextConfiguration; return this; } - public Builder contextConfiguration(List contextConfiguration) { + public Builder contextConfiguration(List contextConfiguration) { this.contextConfiguration = Optional.ofNullable(contextConfiguration); return this; } @@ -258,6 +253,40 @@ public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.NullableUse page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + /** *

An array of head tags

*/ @@ -303,48 +332,14 @@ public Builder filters(com.auth0.client.mgmt.core.Nullable filters) return this; } - /** - *

Use page template with ACUL

- */ - @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) - public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { - this.usePageTemplate = usePageTemplate; - return this; - } - - public Builder usePageTemplate(Boolean usePageTemplate) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate); - return this; - } - - public Builder usePageTemplate(Optional usePageTemplate) { - if (usePageTemplate.isPresent()) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } else { - this.usePageTemplate = OptionalNullable.absent(); - } - return this; - } - - public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { - if (usePageTemplate.isNull()) { - this.usePageTemplate = OptionalNullable.ofNull(); - } else if (usePageTemplate.isEmpty()) { - this.usePageTemplate = OptionalNullable.absent(); - } else { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } - return this; - } - public UpdateAculRequestContent build() { return new UpdateAculRequestContent( renderingMode, contextConfiguration, defaultHeadTagsDisabled, + usePageTemplate, headTags, filters, - usePageTemplate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRawSettingsClient.java new file mode 100644 index 000000000..797e4d1d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRawSettingsClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.riskassessments.types.UpdateRiskAssessmentsSettingsRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSettingsClient { + protected final ClientOptions clientOptions; + + public AsyncRawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the tenant settings for risk assessments + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Gets the tenant settings for risk assessments + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetRiskAssessmentsSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates the tenant settings for risk assessments + */ + public CompletableFuture> update( + UpdateRiskAssessmentsSettingsRequestContent request) { + return update(request, null); + } + + /** + * Updates the tenant settings for risk assessments + */ + public CompletableFuture> update( + UpdateRiskAssessmentsSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRiskAssessmentsSettingsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRiskAssessmentsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRiskAssessmentsClient.java new file mode 100644 index 000000000..de56f77e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncRiskAssessmentsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncRiskAssessmentsClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public AsyncRiskAssessmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new AsyncSettingsClient(clientOptions)); + } + + public AsyncSettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncSettingsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncSettingsClient.java new file mode 100644 index 000000000..44d88da20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/AsyncSettingsClient.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.riskassessments.settings.AsyncNewDeviceClient; +import com.auth0.client.mgmt.riskassessments.types.UpdateRiskAssessmentsSettingsRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncSettingsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSettingsClient rawClient; + + protected final Supplier newDeviceClient; + + public AsyncSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSettingsClient(clientOptions); + this.newDeviceClient = Suppliers.memoize(() -> new AsyncNewDeviceClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the tenant settings for risk assessments + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Gets the tenant settings for risk assessments + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates the tenant settings for risk assessments + */ + public CompletableFuture update( + UpdateRiskAssessmentsSettingsRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Updates the tenant settings for risk assessments + */ + public CompletableFuture update( + UpdateRiskAssessmentsSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } + + public AsyncNewDeviceClient newDevice() { + return this.newDeviceClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/RawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/RawSettingsClient.java new file mode 100644 index 000000000..93b37248c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/RawSettingsClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.riskassessments.types.UpdateRiskAssessmentsSettingsRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSettingsClient { + protected final ClientOptions clientOptions; + + public RawSettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the tenant settings for risk assessments + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Gets the tenant settings for risk assessments + */ + public ManagementApiHttpResponse get(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetRiskAssessmentsSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Updates the tenant settings for risk assessments + */ + public ManagementApiHttpResponse update( + UpdateRiskAssessmentsSettingsRequestContent request) { + return update(request, null); + } + + /** + * Updates the tenant settings for risk assessments + */ + public ManagementApiHttpResponse update( + UpdateRiskAssessmentsSettingsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRiskAssessmentsSettingsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/RiskAssessmentsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/RiskAssessmentsClient.java new file mode 100644 index 000000000..74ad58fb2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/RiskAssessmentsClient.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.Suppliers; +import java.util.function.Supplier; + +public class RiskAssessmentsClient { + protected final ClientOptions clientOptions; + + protected final Supplier settingsClient; + + public RiskAssessmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.settingsClient = Suppliers.memoize(() -> new SettingsClient(clientOptions)); + } + + public SettingsClient settings() { + return this.settingsClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/SettingsClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/SettingsClient.java new file mode 100644 index 000000000..be5bd1855 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/SettingsClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.riskassessments.settings.NewDeviceClient; +import com.auth0.client.mgmt.riskassessments.types.UpdateRiskAssessmentsSettingsRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsResponseContent; +import java.util.function.Supplier; + +public class SettingsClient { + protected final ClientOptions clientOptions; + + private final RawSettingsClient rawClient; + + protected final Supplier newDeviceClient; + + public SettingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSettingsClient(clientOptions); + this.newDeviceClient = Suppliers.memoize(() -> new NewDeviceClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSettingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the tenant settings for risk assessments + */ + public GetRiskAssessmentsSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Gets the tenant settings for risk assessments + */ + public GetRiskAssessmentsSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Updates the tenant settings for risk assessments + */ + public UpdateRiskAssessmentsSettingsResponseContent update(UpdateRiskAssessmentsSettingsRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Updates the tenant settings for risk assessments + */ + public UpdateRiskAssessmentsSettingsResponseContent update( + UpdateRiskAssessmentsSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } + + public NewDeviceClient newDevice() { + return this.newDeviceClient.get(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncNewDeviceClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncNewDeviceClient.java new file mode 100644 index 000000000..ef55537f0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncNewDeviceClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.settings; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.riskassessments.settings.types.UpdateRiskAssessmentsSettingsNewDeviceRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsNewDeviceResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsNewDeviceResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncNewDeviceClient { + protected final ClientOptions clientOptions; + + private final AsyncRawNewDeviceClient rawClient; + + public AsyncNewDeviceClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawNewDeviceClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawNewDeviceClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public CompletableFuture get() { + return this.rawClient.get().thenApply(response -> response.body()); + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public CompletableFuture get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public CompletableFuture update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request) { + return this.rawClient.update(request).thenApply(response -> response.body()); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public CompletableFuture update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncRawNewDeviceClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncRawNewDeviceClient.java new file mode 100644 index 000000000..0d031ad39 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/AsyncRawNewDeviceClient.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.settings; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.riskassessments.settings.types.UpdateRiskAssessmentsSettingsNewDeviceRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsNewDeviceResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsNewDeviceResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawNewDeviceClient { + protected final ClientOptions clientOptions; + + public AsyncRawNewDeviceClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public CompletableFuture> get() { + return get(null); + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public CompletableFuture> get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings/new-device") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetRiskAssessmentsSettingsNewDeviceResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public CompletableFuture> update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request) { + return update(request, null); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public CompletableFuture> update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings/new-device") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateRiskAssessmentsSettingsNewDeviceResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/NewDeviceClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/NewDeviceClient.java new file mode 100644 index 000000000..15a94842a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/NewDeviceClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.settings; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.riskassessments.settings.types.UpdateRiskAssessmentsSettingsNewDeviceRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsNewDeviceResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsNewDeviceResponseContent; + +public class NewDeviceClient { + protected final ClientOptions clientOptions; + + private final RawNewDeviceClient rawClient; + + public NewDeviceClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawNewDeviceClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawNewDeviceClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public GetRiskAssessmentsSettingsNewDeviceResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public GetRiskAssessmentsSettingsNewDeviceResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public UpdateRiskAssessmentsSettingsNewDeviceResponseContent update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request) { + return this.rawClient.update(request).body(); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public UpdateRiskAssessmentsSettingsNewDeviceResponseContent update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/RawNewDeviceClient.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/RawNewDeviceClient.java new file mode 100644 index 000000000..424ea00c1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/RawNewDeviceClient.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.settings; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.riskassessments.settings.types.UpdateRiskAssessmentsSettingsNewDeviceRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsNewDeviceResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsNewDeviceResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawNewDeviceClient { + protected final ClientOptions clientOptions; + + public RawNewDeviceClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public ManagementApiHttpResponse get() { + return get(null); + } + + /** + * Gets the risk assessment settings for the new device assessor + */ + public ManagementApiHttpResponse get( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings/new-device") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetRiskAssessmentsSettingsNewDeviceResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public ManagementApiHttpResponse update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request) { + return update(request, null); + } + + /** + * Updates the risk assessment settings for the new device assessor + */ + public ManagementApiHttpResponse update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("risk-assessments/settings/new-device") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRiskAssessmentsSettingsNewDeviceResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java new file mode 100644 index 000000000..e0bab180b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.settings.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRiskAssessmentsSettingsNewDeviceRequestContent.Builder.class) +public final class UpdateRiskAssessmentsSettingsNewDeviceRequestContent { + private final int rememberFor; + + private final Map additionalProperties; + + private UpdateRiskAssessmentsSettingsNewDeviceRequestContent( + int rememberFor, Map additionalProperties) { + this.rememberFor = rememberFor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Length of time to remember devices for, in days. + */ + @JsonProperty("remember_for") + public int getRememberFor() { + return rememberFor; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRiskAssessmentsSettingsNewDeviceRequestContent + && equalTo((UpdateRiskAssessmentsSettingsNewDeviceRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRiskAssessmentsSettingsNewDeviceRequestContent other) { + return rememberFor == other.rememberFor; + } + + @Override + public int hashCode() { + return Objects.hash(this.rememberFor); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RememberForStage builder() { + return new Builder(); + } + + public interface RememberForStage { + /** + *

Length of time to remember devices for, in days.

+ */ + _FinalStage rememberFor(int rememberFor); + + Builder from(UpdateRiskAssessmentsSettingsNewDeviceRequestContent other); + } + + public interface _FinalStage { + UpdateRiskAssessmentsSettingsNewDeviceRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RememberForStage, _FinalStage { + private int rememberFor; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateRiskAssessmentsSettingsNewDeviceRequestContent other) { + rememberFor(other.getRememberFor()); + return this; + } + + /** + *

Length of time to remember devices for, in days.

+ *

Length of time to remember devices for, in days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("remember_for") + public _FinalStage rememberFor(int rememberFor) { + this.rememberFor = rememberFor; + return this; + } + + @Override + public UpdateRiskAssessmentsSettingsNewDeviceRequestContent build() { + return new UpdateRiskAssessmentsSettingsNewDeviceRequestContent(rememberFor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java new file mode 100644 index 000000000..0fb1df93b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.riskassessments.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRiskAssessmentsSettingsRequestContent.Builder.class) +public final class UpdateRiskAssessmentsSettingsRequestContent { + private final boolean enabled; + + private final Map additionalProperties; + + private UpdateRiskAssessmentsSettingsRequestContent(boolean enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not risk assessment is enabled. + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRiskAssessmentsSettingsRequestContent + && equalTo((UpdateRiskAssessmentsSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRiskAssessmentsSettingsRequestContent other) { + return enabled == other.enabled; + } + + @Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether or not risk assessment is enabled.

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(UpdateRiskAssessmentsSettingsRequestContent other); + } + + public interface _FinalStage { + UpdateRiskAssessmentsSettingsRequestContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateRiskAssessmentsSettingsRequestContent other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Whether or not risk assessment is enabled.

+ *

Whether or not risk assessment is enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @Override + public UpdateRiskAssessmentsSettingsRequestContent build() { + return new UpdateRiskAssessmentsSettingsRequestContent(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java index 1dbf41ab4..f3c28c499 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawPermissionsClient.java @@ -72,9 +72,11 @@ public CompletableFuture> .addPathSegments("roles") .addPathSegment(id) .addPathSegments("users"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java index 09454934a..575516b6f 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/RawPermissionsClient.java @@ -66,9 +66,11 @@ public ManagementApiHttpResponse> .addPathSegments("roles") .addPathSegment(id) .addPathSegments("permissions"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java index 36228295c..df0d01767 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java @@ -105,8 +105,11 @@ public ManagementApiHttpResponse> list( .addPathSegments("roles") .addPathSegment(id) .addPathSegments("users"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java index f8856de96..60574163a 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddRolePermissionsRequestContent && equalTo((AddRolePermissionsRequestContent) other); @@ -55,12 +55,12 @@ private boolean equalTo(AddRolePermissionsRequestContent other) { return permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java index c91daef11..fb266f581 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java @@ -38,7 +38,7 @@ public List getUsers() { return users; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignRoleUsersRequestContent && equalTo((AssignRoleUsersRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(AssignRoleUsersRequestContent other) { return users.equals(other.users); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.users); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java index c611cacf3..eb8611f55 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteRolePermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(DeleteRolePermissionsRequestContent other) { return permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java index e6d4a73b9..205c094aa 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java @@ -57,9 +57,6 @@ public OptionalNullable getPerPage() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolePermissionsRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListRolePermissionsRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +157,7 @@ public Builder perPage(Nullable perPage) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java index 15b28d60a..69ec9e291 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRoleUsersRequestParameters && equalTo((ListRoleUsersRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListRoleUsersRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java index 0addf816c..82001bd31 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncCustomTextClient.java @@ -28,14 +28,14 @@ public AsyncRawCustomTextClient withRawResponse() { /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture> list(String id, String language, String page) { + public CompletableFuture> list(String id, String language, String page) { return this.rawClient.list(id, language, page).thenApply(response -> response.body()); } /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture> list( + public CompletableFuture> list( String id, String language, String page, RequestOptions requestOptions) { return this.rawClient.list(id, language, page, requestOptions).thenApply(response -> response.body()); } @@ -43,16 +43,16 @@ public CompletableFuture> list( /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture> set( - String id, String language, String page, Map request) { + public CompletableFuture> set( + String id, String language, String page, Map request) { return this.rawClient.set(id, language, page, request).thenApply(response -> response.body()); } /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture> set( - String id, String language, String page, Map request, RequestOptions requestOptions) { + public CompletableFuture> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { return this.rawClient.set(id, language, page, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java index 3d317a9a9..5b58f0317 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/AsyncRawCustomTextClient.java @@ -40,7 +40,7 @@ public AsyncRawCustomTextClient(ClientOptions clientOptions) { /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture>> list( + public CompletableFuture>> list( String id, String language, String page) { return list(id, language, page, null); } @@ -48,7 +48,7 @@ public CompletableFuture>> list( /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture>> list( + public CompletableFuture>> list( String id, String language, String page, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -68,7 +68,7 @@ public CompletableFuture>> list( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -77,7 +77,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } @@ -127,16 +127,16 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture>> set( - String id, String language, String page, Map request) { + public CompletableFuture>> set( + String id, String language, String page, Map request) { return set(id, language, page, request, null); } /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public CompletableFuture>> set( - String id, String language, String page, Map request, RequestOptions requestOptions) { + public CompletableFuture>> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("self-service-profiles") @@ -163,7 +163,7 @@ public CompletableFuture>> set( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -172,7 +172,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java index b7530e865..4f96b303f 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/CustomTextClient.java @@ -27,29 +27,29 @@ public RawCustomTextClient withRawResponse() { /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public Map list(String id, String language, String page) { + public Map list(String id, String language, String page) { return this.rawClient.list(id, language, page).body(); } /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public Map list(String id, String language, String page, RequestOptions requestOptions) { + public Map list(String id, String language, String page, RequestOptions requestOptions) { return this.rawClient.list(id, language, page, requestOptions).body(); } /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public Map set(String id, String language, String page, Map request) { + public Map set(String id, String language, String page, Map request) { return this.rawClient.set(id, language, page, request).body(); } /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public Map set( - String id, String language, String page, Map request, RequestOptions requestOptions) { + public Map set( + String id, String language, String page, Map request, RequestOptions requestOptions) { return this.rawClient.set(id, language, page, request, requestOptions).body(); } } diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java index 3ea0e6f01..eb56278de 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/RawCustomTextClient.java @@ -36,14 +36,14 @@ public RawCustomTextClient(ClientOptions clientOptions) { /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public ManagementApiHttpResponse> list(String id, String language, String page) { + public ManagementApiHttpResponse> list(String id, String language, String page) { return list(id, language, page, null); } /** * Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public ManagementApiHttpResponse> list( + public ManagementApiHttpResponse> list( String id, String language, String page, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -69,7 +69,7 @@ public ManagementApiHttpResponse> list( if (response.isSuccessful()) { return new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } try { @@ -101,16 +101,16 @@ public ManagementApiHttpResponse> list( /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public ManagementApiHttpResponse> set( - String id, String language, String page, Map request) { + public ManagementApiHttpResponse> set( + String id, String language, String page, Map request) { return set(id, language, page, request, null); } /** * Updates text customizations for a given self-service profile, language and Self Service SSO Flow page. */ - public ManagementApiHttpResponse> set( - String id, String language, String page, Map request, RequestOptions requestOptions) { + public ManagementApiHttpResponse> set( + String id, String language, String page, Map request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("self-service-profiles") @@ -143,7 +143,7 @@ public ManagementApiHttpResponse> set( if (response.isSuccessful()) { return new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } try { diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java index 78a4a9579..c9c015a96 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java @@ -107,7 +107,7 @@ public Optional getProvisioningCo return provisioningConfig; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileSsoTicketRequestContent @@ -129,7 +129,7 @@ private boolean equalTo(CreateSelfServiceProfileSsoTicketRequestContent other) { && provisioningConfig.equals(other.provisioningConfig); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -141,7 +141,7 @@ public int hashCode() { this.provisioningConfig); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java b/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java index a4b4f314a..8a7430677 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/AsyncRawSettingsClient.java @@ -63,8 +63,14 @@ public CompletableFuture get( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("tenants/settings"); - QueryStringMapper.addQueryParameter(httpUrl, "fields", request.getFields(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_fields", request.getIncludeFields(), false); + if (!request.getFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "fields", request.getFields().orElse(null), false); + } + if (!request.getIncludeFields().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_fields", request.getIncludeFields().orElse(null), false); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java index d4967a56a..6bb310001 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTenantSettingsRequestParameters @@ -90,12 +90,12 @@ private boolean equalTo(GetTenantSettingsRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java index af4c04cfd..6448a794b 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java @@ -15,6 +15,7 @@ import com.auth0.client.mgmt.types.TenantSettingsGuardianPage; import com.auth0.client.mgmt.types.TenantSettingsMtls; import com.auth0.client.mgmt.types.TenantSettingsPasswordPage; +import com.auth0.client.mgmt.types.TenantSettingsResourceParameterProfile; import com.auth0.client.mgmt.types.TenantSettingsSessions; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -94,6 +95,10 @@ public final class UpdateTenantSettingsRequestContent { private final OptionalNullable authorizationResponseIssParameterSupported; + private final OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional resourceParameterProfile; + private final Map additionalProperties; private UpdateTenantSettingsRequestContent( @@ -127,6 +132,8 @@ private UpdateTenantSettingsRequestContent( OptionalNullable mtls, OptionalNullable pushedAuthorizationRequestsSupported, OptionalNullable authorizationResponseIssParameterSupported, + OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, + Optional resourceParameterProfile, Map additionalProperties) { this.changePassword = changePassword; this.deviceFlow = deviceFlow; @@ -158,6 +165,8 @@ private UpdateTenantSettingsRequestContent( this.mtls = mtls; this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.resourceParameterProfile = resourceParameterProfile; this.additionalProperties = additionalProperties; } @@ -419,6 +428,25 @@ public OptionalNullable getAuthorizationResponseIssParameterSupported() return authorizationResponseIssParameterSupported; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public OptionalNullable getSkipNonVerifiableCallbackUriConfirmationPrompt() { + if (skipNonVerifiableCallbackUriConfirmationPrompt == null) { + return OptionalNullable.absent(); + } + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("resource_parameter_profile") + public Optional getResourceParameterProfile() { + return resourceParameterProfile; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -491,7 +519,13 @@ private OptionalNullable _getAuthorizationResponseIssParameterSupported return authorizationResponseIssParameterSupported; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTenantSettingsRequestContent @@ -533,10 +567,13 @@ private boolean equalTo(UpdateTenantSettingsRequestContent other) { && acrValuesSupported.equals(other.acrValuesSupported) && mtls.equals(other.mtls) && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) - && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && resourceParameterProfile.equals(other.resourceParameterProfile); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.changePassword, @@ -568,10 +605,12 @@ public int hashCode() { this.acrValuesSupported, this.mtls, this.pushedAuthorizationRequestsSupported, - this.authorizationResponseIssParameterSupported); + this.authorizationResponseIssParameterSupported, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.resourceParameterProfile); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -642,6 +681,10 @@ public static final class Builder { private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + private OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + + private Optional resourceParameterProfile = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -678,6 +721,8 @@ public Builder from(UpdateTenantSettingsRequestContent other) { mtls(other.getMtls()); pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + resourceParameterProfile(other.getResourceParameterProfile()); return this; } @@ -1331,6 +1376,61 @@ public Builder authorizationResponseIssParameterSupported( return this; } + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + @Nullable OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isPresent()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + com.auth0.client.mgmt.core.Nullable skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isNull()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.ofNull(); + } else if (skipNonVerifiableCallbackUriConfirmationPrompt.isEmpty()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } + return this; + } + + @JsonSetter(value = "resource_parameter_profile", nulls = Nulls.SKIP) + public Builder resourceParameterProfile( + Optional resourceParameterProfile) { + this.resourceParameterProfile = resourceParameterProfile; + return this; + } + + public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile resourceParameterProfile) { + this.resourceParameterProfile = Optional.ofNullable(resourceParameterProfile); + return this; + } + public UpdateTenantSettingsRequestContent build() { return new UpdateTenantSettingsRequestContent( changePassword, @@ -1363,6 +1463,8 @@ public UpdateTenantSettingsRequestContent build() { mtls, pushedAuthorizationRequestsSupported, authorizationResponseIssParameterSupported, + skipNonVerifiableCallbackUriConfirmationPrompt, + resourceParameterProfile, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java index e224ebbda..eb4851d11 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java @@ -263,20 +263,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateTenantSettingsRequestContentEnabledLocalesItem && this.string.equals(((UpdateTenantSettingsRequestContentEnabledLocalesItem) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Action.java b/src/main/java/com/auth0/client/mgmt/types/Action.java index 139750fcd..75eae00db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Action.java +++ b/src/main/java/com/auth0/client/mgmt/types/Action.java @@ -158,7 +158,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -212,7 +212,7 @@ public Optional getDeploy() { return deploy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Action && equalTo((Action) other); @@ -242,7 +242,7 @@ private boolean equalTo(Action other) { && deploy.equals(other.deploy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -263,7 +263,7 @@ public int hashCode() { this.deploy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -444,7 +444,7 @@ public Builder dependencies(List dependencies) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBase.java b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java index 5a4f5c3e4..6f3e165ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBase.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java @@ -101,7 +101,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBase && equalTo((ActionBase) other); @@ -121,13 +121,13 @@ private boolean equalTo(ActionBase other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.supportedTriggers, this.allChangesDeployed, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java index 54cde00d1..17f6b9165 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java @@ -94,7 +94,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBinding && equalTo((ActionBinding) other); @@ -114,12 +114,12 @@ private boolean equalTo(ActionBinding other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.triggerId, this.displayName, this.action, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java index 3be4a031d..ab75f3129 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java @@ -46,7 +46,7 @@ public Optional getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBindingRef && equalTo((ActionBindingRef) other); @@ -61,12 +61,12 @@ private boolean equalTo(ActionBindingRef other) { return type.equals(other.type) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java index 85c0fc20b..e1731a719 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBindingRefTypeEnum && this.string.equals(((ActionBindingRefTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java index f1495c76a..abcceca18 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBindingTypeEnum && this.string.equals(((ActionBindingTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java index 530a28018..f617ad746 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java @@ -62,7 +62,7 @@ public Optional> getSecrets() { return secrets; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBindingWithRef && equalTo((ActionBindingWithRef) other); @@ -77,12 +77,12 @@ private boolean equalTo(ActionBindingWithRef other) { return ref.equals(other.ref) && displayName.equals(other.displayName) && secrets.equals(other.secrets); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ref, this.displayName, this.secrets); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder implements RefStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ActionBindingWithRef other) { ref(other.getRef()); displayName(other.getDisplayName()); @@ -136,7 +136,7 @@ public Builder from(ActionBindingWithRef other) { return this; } - @java.lang.Override + @Override @JsonSetter("ref") public _FinalStage ref(@NotNull ActionBindingRef ref) { this.ref = Objects.requireNonNull(ref, "ref must not be null"); @@ -147,7 +147,7 @@ public _FinalStage ref(@NotNull ActionBindingRef ref) { *

The list of secrets that are included in an action or a version of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage secrets(List secrets) { this.secrets = Optional.ofNullable(secrets); return this; @@ -156,7 +156,7 @@ public _FinalStage secrets(List secrets) { /** *

The list of secrets that are included in an action or a version of an action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "secrets", nulls = Nulls.SKIP) public _FinalStage secrets(Optional> secrets) { this.secrets = secrets; @@ -167,7 +167,7 @@ public _FinalStage secrets(Optional> secrets) { *

The name of the binding.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -176,14 +176,14 @@ public _FinalStage displayName(String displayName) { /** *

The name of the binding.

*/ - @java.lang.Override + @Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public ActionBindingWithRef build() { return new ActionBindingWithRef(ref, displayName, secrets, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java index 6370c3f4b..1c7c416fd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBuildStatusEnum && this.string.equals(((ActionBuildStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java index a64202a33..16ecae966 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java @@ -122,7 +122,7 @@ public Optional> getDependencies() { } /** - * @return Indicates if this speciic version is the currently one deployed. + * @return Indicates if this specific version is the currently one deployed. */ @JsonProperty("deployed") public Optional getDeployed() { @@ -130,7 +130,7 @@ public Optional getDeployed() { } /** - * @return The Node runtime. For example: node12 + * @return The Node runtime. For example: node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -203,7 +203,7 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionDeployedVersion && equalTo((ActionDeployedVersion) other); @@ -232,7 +232,7 @@ private boolean equalTo(ActionDeployedVersion other) { && supportedTriggers.equals(other.supportedTriggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -252,7 +252,7 @@ public int hashCode() { this.supportedTriggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -374,7 +374,7 @@ public Builder dependencies(List dependencies) { } /** - *

Indicates if this speciic version is the currently one deployed.

+ *

Indicates if this specific version is the currently one deployed.

*/ @JsonSetter(value = "deployed", nulls = Nulls.SKIP) public Builder deployed(Optional deployed) { @@ -388,7 +388,7 @@ public Builder deployed(Boolean deployed) { } /** - *

The Node runtime. For example: node12

+ *

The Node runtime. For example: node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionError.java b/src/main/java/com/auth0/client/mgmt/types/ActionError.java index 490a8520c..7397dadab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionError.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionError.java @@ -51,7 +51,7 @@ public Optional getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionError && equalTo((ActionError) other); @@ -66,12 +66,12 @@ private boolean equalTo(ActionError other) { return id.equals(other.id) && msg.equals(other.msg) && url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.msg, this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java index a7e149c1a..cd14fd66f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java @@ -73,7 +73,7 @@ public Optional getEndedAt() { return endedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionExecutionResult && equalTo((ActionExecutionResult) other); @@ -91,12 +91,12 @@ private boolean equalTo(ActionExecutionResult other) { && endedAt.equals(other.endedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.actionName, this.error, this.startedAt, this.endedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java index 180a710c3..b2e6672a1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionExecutionStatusEnum && this.string.equals(((ActionExecutionStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java index 0e2f8be7c..0f8943c68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java @@ -49,7 +49,7 @@ public Optional getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionSecretRequest && equalTo((ActionSecretRequest) other); @@ -64,12 +64,12 @@ private boolean equalTo(ActionSecretRequest other) { return name.equals(other.name) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java index a90411457..af4cb10c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java @@ -50,7 +50,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionSecretResponse && equalTo((ActionSecretResponse) other); @@ -65,12 +65,12 @@ private boolean equalTo(ActionSecretResponse other) { return name.equals(other.name) && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java index f904a3396..9b25b0e14 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java @@ -107,7 +107,7 @@ public Optional getBindingPolicy() { return bindingPolicy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionTrigger && equalTo((ActionTrigger) other); @@ -128,7 +128,7 @@ private boolean equalTo(ActionTrigger other) { && bindingPolicy.equals(other.bindingPolicy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -140,7 +140,7 @@ public int hashCode() { this.bindingPolicy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -219,7 +219,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ActionTrigger other) { id(other.getId()); version(other.getVersion()); @@ -231,20 +231,20 @@ public Builder from(ActionTrigger other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage bindingPolicy(ActionBindingTypeEnum bindingPolicy) { this.bindingPolicy = Optional.ofNullable(bindingPolicy); return this; } - @java.lang.Override + @Override @JsonSetter(value = "binding_policy", nulls = Nulls.SKIP) public _FinalStage bindingPolicy(Optional bindingPolicy) { this.bindingPolicy = bindingPolicy; @@ -255,7 +255,7 @@ public _FinalStage bindingPolicy(Optional bindingPolicy) *

compatible_triggers informs which other trigger supports the same event and api.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage compatibleTriggers(List compatibleTriggers) { this.compatibleTriggers = Optional.ofNullable(compatibleTriggers); return this; @@ -264,7 +264,7 @@ public _FinalStage compatibleTriggers(List compa /** *

compatible_triggers informs which other trigger supports the same event and api.

*/ - @java.lang.Override + @Override @JsonSetter(value = "compatible_triggers", nulls = Nulls.SKIP) public _FinalStage compatibleTriggers(Optional> compatibleTriggers) { this.compatibleTriggers = compatibleTriggers; @@ -275,7 +275,7 @@ public _FinalStage compatibleTriggers(OptionalRuntime that will be used when none is specified when creating an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage defaultRuntime(String defaultRuntime) { this.defaultRuntime = Optional.ofNullable(defaultRuntime); return this; @@ -284,7 +284,7 @@ public _FinalStage defaultRuntime(String defaultRuntime) { /** *

Runtime that will be used when none is specified when creating an action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "default_runtime", nulls = Nulls.SKIP) public _FinalStage defaultRuntime(Optional defaultRuntime) { this.defaultRuntime = defaultRuntime; @@ -295,7 +295,7 @@ public _FinalStage defaultRuntime(Optional defaultRuntime) { *

runtimes supported by this trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage runtimes(List runtimes) { this.runtimes = Optional.ofNullable(runtimes); return this; @@ -304,7 +304,7 @@ public _FinalStage runtimes(List runtimes) { /** *

runtimes supported by this trigger.

*/ - @java.lang.Override + @Override @JsonSetter(value = "runtimes", nulls = Nulls.SKIP) public _FinalStage runtimes(Optional> runtimes) { this.runtimes = runtimes; @@ -315,7 +315,7 @@ public _FinalStage runtimes(Optional> runtimes) { *

status points to the trigger status.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage status(String status) { this.status = Optional.ofNullable(status); return this; @@ -324,7 +324,7 @@ public _FinalStage status(String status) { /** *

status points to the trigger status.

*/ - @java.lang.Override + @Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -335,7 +335,7 @@ public _FinalStage status(Optional status) { *

The version of a trigger. v1, v2, etc.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage version(String version) { this.version = Optional.ofNullable(version); return this; @@ -344,14 +344,14 @@ public _FinalStage version(String version) { /** *

The version of a trigger. v1, v2, etc.

*/ - @java.lang.Override + @Override @JsonSetter(value = "version", nulls = Nulls.SKIP) public _FinalStage version(Optional version) { this.version = version; return this; } - @java.lang.Override + @Override public ActionTrigger build() { return new ActionTrigger( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java index bb8740e73..74ff12072 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java @@ -44,7 +44,7 @@ public String getVersion() { return version; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionTriggerCompatibleTrigger && equalTo((ActionTriggerCompatibleTrigger) other); @@ -59,12 +59,12 @@ private boolean equalTo(ActionTriggerCompatibleTrigger other) { return id.equals(other.id) && version.equals(other.version); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.version); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,14 +101,14 @@ public static final class Builder implements IdStage, VersionStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(ActionTriggerCompatibleTrigger other) { id(other.getId()); version(other.getVersion()); return this; } - @java.lang.Override + @Override @JsonSetter("id") public VersionStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -120,14 +120,14 @@ public VersionStage id(@NotNull String id) { *

The version of a trigger. v1, v2, etc.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("version") public _FinalStage version(@NotNull String version) { this.version = Objects.requireNonNull(version, "version must not be null"); return this; } - @java.lang.Override + @Override public ActionTriggerCompatibleTrigger build() { return new ActionTriggerCompatibleTrigger(id, version, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java index e0b68281d..d53849f2a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java @@ -122,7 +122,7 @@ public Optional> getDependencies() { } /** - * @return Indicates if this speciic version is the currently one deployed. + * @return Indicates if this specific version is the currently one deployed. */ @JsonProperty("deployed") public Optional getDeployed() { @@ -130,7 +130,7 @@ public Optional getDeployed() { } /** - * @return The Node runtime. For example: node12 + * @return The Node runtime. For example: node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -203,7 +203,7 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionVersion && equalTo((ActionVersion) other); @@ -232,7 +232,7 @@ private boolean equalTo(ActionVersion other) { && supportedTriggers.equals(other.supportedTriggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -252,7 +252,7 @@ public int hashCode() { this.supportedTriggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -374,7 +374,7 @@ public Builder dependencies(List dependencies) { } /** - *

Indicates if this speciic version is the currently one deployed.

+ *

Indicates if this specific version is the currently one deployed.

*/ @JsonSetter(value = "deployed", nulls = Nulls.SKIP) public Builder deployed(Optional deployed) { @@ -388,7 +388,7 @@ public Builder deployed(Boolean deployed) { } /** - *

The Node runtime. For example: node12

+ *

The Node runtime. For example: node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java index 6a9f5c51e..685c66a3f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java @@ -36,20 +36,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionVersionBuildStatusEnum && this.string.equals(((ActionVersionBuildStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java index d61c7e1bf..6535cf651 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java @@ -63,7 +63,7 @@ public Optional getRegistryUrl() { return registryUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionVersionDependency && equalTo((ActionVersionDependency) other); @@ -78,12 +78,12 @@ private boolean equalTo(ActionVersionDependency other) { return name.equals(other.name) && version.equals(other.version) && registryUrl.equals(other.registryUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.version, this.registryUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java index cf82c6e3b..1cebd987d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java @@ -4,121 +4,92 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AculClientFilter.Builder.class) +@JsonDeserialize(using = AculClientFilter.Deserializer.class) public final class AculClientFilter { - private final Optional id; + private final Object value; - private final Optional> metadata; + private final int type; - private final Map additionalProperties; - - private AculClientFilter( - Optional id, Optional> metadata, Map additionalProperties) { - this.id = id; - this.metadata = metadata; - this.additionalProperties = additionalProperties; + private AculClientFilter(Object value, int type) { + this.value = value; + this.type = type; } - /** - * @return Client ID - */ - @JsonProperty("id") - public Optional getId() { - return id; + @JsonValue + public Object get() { + return this.value; } - @JsonProperty("metadata") - public Optional> getMetadata() { - return metadata; + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AculClientFilterById) this.value); + } else if (this.type == 1) { + return visitor.visit((AculClientFilterByMetadata) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculClientFilter && equalTo((AculClientFilter) other); } - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - private boolean equalTo(AculClientFilter other) { - return id.equals(other.id) && metadata.equals(other.metadata); + return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.id, this.metadata); + return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { - return ObjectMappers.stringify(this); + return this.value.toString(); } - public static Builder builder() { - return new Builder(); + public static AculClientFilter of(AculClientFilterById value) { + return new AculClientFilter(value, 0); } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional> metadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AculClientFilter other) { - id(other.getId()); - metadata(other.getMetadata()); - return this; - } + public static AculClientFilter of(AculClientFilterByMetadata value) { + return new AculClientFilter(value, 1); + } - /** - *

Client ID

- */ - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } + public interface Visitor { + T visit(AculClientFilterById value); - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { - this.metadata = metadata; - return this; - } + T visit(AculClientFilterByMetadata value); + } - public Builder metadata(Map metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AculClientFilter.class); } - public AculClientFilter build() { - return new AculClientFilter(id, metadata, additionalProperties); + @Override + public AculClientFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculClientFilterById.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculClientFilterByMetadata.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java new file mode 100644 index 000000000..938969fc7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculClientFilterById.Builder.class) +public final class AculClientFilterById { + private final String id; + + private final Map additionalProperties; + + private AculClientFilterById(String id, Map additionalProperties) { + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return Client ID + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculClientFilterById && equalTo((AculClientFilterById) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculClientFilterById other) { + return id.equals(other.id); + } + + @Override + public int hashCode() { + return Objects.hash(this.id); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Client ID

+ */ + _FinalStage id(@NotNull String id); + + Builder from(AculClientFilterById other); + } + + public interface _FinalStage { + AculClientFilterById build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AculClientFilterById other) { + id(other.getId()); + return this; + } + + /** + *

Client ID

+ *

Client ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @Override + public AculClientFilterById build() { + return new AculClientFilterById(id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java new file mode 100644 index 000000000..17332ab3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculClientFilterByMetadata.Builder.class) +public final class AculClientFilterByMetadata { + private final Map metadata; + + private final Map additionalProperties; + + private AculClientFilterByMetadata(Map metadata, Map additionalProperties) { + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("metadata") + public Map getMetadata() { + return metadata; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculClientFilterByMetadata && equalTo((AculClientFilterByMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculClientFilterByMetadata other) { + return metadata.equals(other.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(this.metadata); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map metadata = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculClientFilterByMetadata other) { + metadata(other.getMetadata()); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Map metadata) { + this.metadata.clear(); + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder putAllMetadata(Map metadata) { + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder metadata(String key, Object value) { + this.metadata.put(key, value); + return this; + } + + public AculClientFilterByMetadata build() { + return new AculClientFilterByMetadata(metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java b/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java new file mode 100644 index 000000000..b6a637884 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java @@ -0,0 +1,440 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculConfigsItem.Builder.class) +public final class AculConfigsItem { + private final PromptGroupNameEnum prompt; + + private final ScreenGroupNameEnum screen; + + private final Optional renderingMode; + + private final Optional> contextConfiguration; + + private final OptionalNullable defaultHeadTagsDisabled; + + private final OptionalNullable usePageTemplate; + + private final Optional> headTags; + + private final OptionalNullable filters; + + private final Map additionalProperties; + + private AculConfigsItem( + PromptGroupNameEnum prompt, + ScreenGroupNameEnum screen, + Optional renderingMode, + Optional> contextConfiguration, + OptionalNullable defaultHeadTagsDisabled, + OptionalNullable usePageTemplate, + Optional> headTags, + OptionalNullable filters, + Map additionalProperties) { + this.prompt = prompt; + this.screen = screen; + this.renderingMode = renderingMode; + this.contextConfiguration = contextConfiguration; + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.usePageTemplate = usePageTemplate; + this.headTags = headTags; + this.filters = filters; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("prompt") + public PromptGroupNameEnum getPrompt() { + return prompt; + } + + @JsonProperty("screen") + public ScreenGroupNameEnum getScreen() { + return screen; + } + + @JsonProperty("rendering_mode") + public Optional getRenderingMode() { + return renderingMode; + } + + @JsonProperty("context_configuration") + public Optional> getContextConfiguration() { + return contextConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + public OptionalNullable getDefaultHeadTagsDisabled() { + if (defaultHeadTagsDisabled == null) { + return OptionalNullable.absent(); + } + return defaultHeadTagsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + + @JsonProperty("head_tags") + public Optional> getHeadTags() { + return headTags; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + public OptionalNullable getFilters() { + if (filters == null) { + return OptionalNullable.absent(); + } + return filters; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_head_tags_disabled") + private OptionalNullable _getDefaultHeadTagsDisabled() { + return defaultHeadTagsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + private OptionalNullable _getUsePageTemplate() { + return usePageTemplate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculConfigsItem && equalTo((AculConfigsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculConfigsItem other) { + return prompt.equals(other.prompt) + && screen.equals(other.screen) + && renderingMode.equals(other.renderingMode) + && contextConfiguration.equals(other.contextConfiguration) + && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && usePageTemplate.equals(other.usePageTemplate) + && headTags.equals(other.headTags) + && filters.equals(other.filters); + } + + @Override + public int hashCode() { + return Objects.hash( + this.prompt, + this.screen, + this.renderingMode, + this.contextConfiguration, + this.defaultHeadTagsDisabled, + this.usePageTemplate, + this.headTags, + this.filters); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PromptStage builder() { + return new Builder(); + } + + public interface PromptStage { + ScreenStage prompt(@NotNull PromptGroupNameEnum prompt); + + Builder from(AculConfigsItem other); + } + + public interface ScreenStage { + _FinalStage screen(@NotNull ScreenGroupNameEnum screen); + } + + public interface _FinalStage { + AculConfigsItem build(); + + _FinalStage renderingMode(Optional renderingMode); + + _FinalStage renderingMode(AculRenderingModeEnum renderingMode); + + _FinalStage contextConfiguration(Optional> contextConfiguration); + + _FinalStage contextConfiguration(List contextConfiguration); + + _FinalStage defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled); + + _FinalStage defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled); + + _FinalStage defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled); + + _FinalStage defaultHeadTagsDisabled(com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled); + + _FinalStage usePageTemplate(@Nullable OptionalNullable usePageTemplate); + + _FinalStage usePageTemplate(Boolean usePageTemplate); + + _FinalStage usePageTemplate(Optional usePageTemplate); + + _FinalStage usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate); + + _FinalStage headTags(Optional> headTags); + + _FinalStage headTags(List headTags); + + _FinalStage filters(@Nullable OptionalNullable filters); + + _FinalStage filters(AculFilters filters); + + _FinalStage filters(Optional filters); + + _FinalStage filters(com.auth0.client.mgmt.core.Nullable filters); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PromptStage, ScreenStage, _FinalStage { + private PromptGroupNameEnum prompt; + + private ScreenGroupNameEnum screen; + + private OptionalNullable filters = OptionalNullable.absent(); + + private Optional> headTags = Optional.empty(); + + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + + private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + + private Optional> contextConfiguration = Optional.empty(); + + private Optional renderingMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AculConfigsItem other) { + prompt(other.getPrompt()); + screen(other.getScreen()); + renderingMode(other.getRenderingMode()); + contextConfiguration(other.getContextConfiguration()); + defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + usePageTemplate(other.getUsePageTemplate()); + headTags(other.getHeadTags()); + filters(other.getFilters()); + return this; + } + + @Override + @JsonSetter("prompt") + public ScreenStage prompt(@NotNull PromptGroupNameEnum prompt) { + this.prompt = Objects.requireNonNull(prompt, "prompt must not be null"); + return this; + } + + @Override + @JsonSetter("screen") + public _FinalStage screen(@NotNull ScreenGroupNameEnum screen) { + this.screen = Objects.requireNonNull(screen, "screen must not be null"); + return this; + } + + @Override + public _FinalStage filters(com.auth0.client.mgmt.core.Nullable filters) { + if (filters.isNull()) { + this.filters = OptionalNullable.ofNull(); + } else if (filters.isEmpty()) { + this.filters = OptionalNullable.absent(); + } else { + this.filters = OptionalNullable.of(filters.get()); + } + return this; + } + + @Override + public _FinalStage filters(Optional filters) { + if (filters.isPresent()) { + this.filters = OptionalNullable.of(filters.get()); + } else { + this.filters = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage filters(AculFilters filters) { + this.filters = OptionalNullable.of(filters); + return this; + } + + @Override + @JsonSetter(value = "filters", nulls = Nulls.SKIP) + public _FinalStage filters(@Nullable OptionalNullable filters) { + this.filters = filters; + return this; + } + + @Override + public _FinalStage headTags(List headTags) { + this.headTags = Optional.ofNullable(headTags); + return this; + } + + @Override + @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) + public _FinalStage headTags(Optional> headTags) { + this.headTags = headTags; + return this; + } + + @Override + public _FinalStage usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + + @Override + public _FinalStage usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + @Override + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public _FinalStage usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + @Override + public _FinalStage defaultHeadTagsDisabled( + com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isNull()) { + this.defaultHeadTagsDisabled = OptionalNullable.ofNull(); + } else if (defaultHeadTagsDisabled.isEmpty()) { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } + return this; + } + + @Override + public _FinalStage defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { + if (defaultHeadTagsDisabled.isPresent()) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); + } else { + this.defaultHeadTagsDisabled = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled); + return this; + } + + @Override + @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) + public _FinalStage defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled) { + this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + return this; + } + + @Override + public _FinalStage contextConfiguration(List contextConfiguration) { + this.contextConfiguration = Optional.ofNullable(contextConfiguration); + return this; + } + + @Override + @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) + public _FinalStage contextConfiguration(Optional> contextConfiguration) { + this.contextConfiguration = contextConfiguration; + return this; + } + + @Override + public _FinalStage renderingMode(AculRenderingModeEnum renderingMode) { + this.renderingMode = Optional.ofNullable(renderingMode); + return this; + } + + @Override + @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) + public _FinalStage renderingMode(Optional renderingMode) { + this.renderingMode = renderingMode; + return this; + } + + @Override + public AculConfigsItem build() { + return new AculConfigsItem( + prompt, + screen, + renderingMode, + contextConfiguration, + defaultHeadTagsDisabled, + usePageTemplate, + headTags, + filters, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java b/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java new file mode 100644 index 000000000..da92a3ef7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AculContextConfigurationItem.Deserializer.class) +public final class AculContextConfigurationItem { + private final Object value; + + private final int type; + + private AculContextConfigurationItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AculContextEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculContextConfigurationItem && equalTo((AculContextConfigurationItem) other); + } + + private boolean equalTo(AculContextConfigurationItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AculContextConfigurationItem of(AculContextEnum value) { + return new AculContextConfigurationItem(value, 0); + } + + public static AculContextConfigurationItem of(String value) { + return new AculContextConfigurationItem(value, 1); + } + + public interface Visitor { + T visit(AculContextEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AculContextConfigurationItem.class); + } + + @Override + public AculContextConfigurationItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculContextEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculContextEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculContextEnum.java new file mode 100644 index 000000000..fb3f26635 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculContextEnum.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AculContextEnum { + public static final AculContextEnum TENANT_FRIENDLY_NAME = + new AculContextEnum(Value.TENANT_FRIENDLY_NAME, "tenant.friendly_name"); + + public static final AculContextEnum UNTRUSTED_DATA_AUTHORIZATION_PARAMS_SCREEN_HINT = new AculContextEnum( + Value.UNTRUSTED_DATA_AUTHORIZATION_PARAMS_SCREEN_HINT, "untrusted_data.authorization_params.screen_hint"); + + public static final AculContextEnum ORGANIZATION_BRANDING = + new AculContextEnum(Value.ORGANIZATION_BRANDING, "organization.branding"); + + public static final AculContextEnum CLIENT_DESCRIPTION = + new AculContextEnum(Value.CLIENT_DESCRIPTION, "client.description"); + + public static final AculContextEnum SCREEN_TEXTS = new AculContextEnum(Value.SCREEN_TEXTS, "screen.texts"); + + public static final AculContextEnum BRANDING_SETTINGS = + new AculContextEnum(Value.BRANDING_SETTINGS, "branding.settings"); + + public static final AculContextEnum TRANSACTION_CUSTOM_DOMAIN_DOMAIN = + new AculContextEnum(Value.TRANSACTION_CUSTOM_DOMAIN_DOMAIN, "transaction.custom_domain.domain"); + + public static final AculContextEnum UNTRUSTED_DATA_SUBMITTED_FORM_DATA = + new AculContextEnum(Value.UNTRUSTED_DATA_SUBMITTED_FORM_DATA, "untrusted_data.submitted_form_data"); + + public static final AculContextEnum CLIENT_LOGO_URI = new AculContextEnum(Value.CLIENT_LOGO_URI, "client.logo_uri"); + + public static final AculContextEnum TENANT_ENABLED_LOCALES = + new AculContextEnum(Value.TENANT_ENABLED_LOCALES, "tenant.enabled_locales"); + + public static final AculContextEnum ORGANIZATION_DISPLAY_NAME = + new AculContextEnum(Value.ORGANIZATION_DISPLAY_NAME, "organization.display_name"); + + public static final AculContextEnum UNTRUSTED_DATA_AUTHORIZATION_PARAMS_LOGIN_HINT = new AculContextEnum( + Value.UNTRUSTED_DATA_AUTHORIZATION_PARAMS_LOGIN_HINT, "untrusted_data.authorization_params.login_hint"); + + public static final AculContextEnum USER_ORGANIZATIONS = + new AculContextEnum(Value.USER_ORGANIZATIONS, "user.organizations"); + + public static final AculContextEnum BRANDING_THEMES_DEFAULT = + new AculContextEnum(Value.BRANDING_THEMES_DEFAULT, "branding.themes.default"); + + public static final AculContextEnum TENANT_NAME = new AculContextEnum(Value.TENANT_NAME, "tenant.name"); + + public static final AculContextEnum UNTRUSTED_DATA_AUTHORIZATION_PARAMS_UI_LOCALES = new AculContextEnum( + Value.UNTRUSTED_DATA_AUTHORIZATION_PARAMS_UI_LOCALES, "untrusted_data.authorization_params.ui_locales"); + + public static final AculContextEnum TENANT_LOGO_URL = new AculContextEnum(Value.TENANT_LOGO_URL, "tenant.logo_url"); + + private final Value value; + + private final String string; + + AculContextEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AculContextEnum && this.string.equals(((AculContextEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TENANT_FRIENDLY_NAME: + return visitor.visitTenantFriendlyName(); + case UNTRUSTED_DATA_AUTHORIZATION_PARAMS_SCREEN_HINT: + return visitor.visitUntrustedDataAuthorizationParamsScreenHint(); + case ORGANIZATION_BRANDING: + return visitor.visitOrganizationBranding(); + case CLIENT_DESCRIPTION: + return visitor.visitClientDescription(); + case SCREEN_TEXTS: + return visitor.visitScreenTexts(); + case BRANDING_SETTINGS: + return visitor.visitBrandingSettings(); + case TRANSACTION_CUSTOM_DOMAIN_DOMAIN: + return visitor.visitTransactionCustomDomainDomain(); + case UNTRUSTED_DATA_SUBMITTED_FORM_DATA: + return visitor.visitUntrustedDataSubmittedFormData(); + case CLIENT_LOGO_URI: + return visitor.visitClientLogoUri(); + case TENANT_ENABLED_LOCALES: + return visitor.visitTenantEnabledLocales(); + case ORGANIZATION_DISPLAY_NAME: + return visitor.visitOrganizationDisplayName(); + case UNTRUSTED_DATA_AUTHORIZATION_PARAMS_LOGIN_HINT: + return visitor.visitUntrustedDataAuthorizationParamsLoginHint(); + case USER_ORGANIZATIONS: + return visitor.visitUserOrganizations(); + case BRANDING_THEMES_DEFAULT: + return visitor.visitBrandingThemesDefault(); + case TENANT_NAME: + return visitor.visitTenantName(); + case UNTRUSTED_DATA_AUTHORIZATION_PARAMS_UI_LOCALES: + return visitor.visitUntrustedDataAuthorizationParamsUiLocales(); + case TENANT_LOGO_URL: + return visitor.visitTenantLogoUrl(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AculContextEnum valueOf(String value) { + switch (value) { + case "tenant.friendly_name": + return TENANT_FRIENDLY_NAME; + case "untrusted_data.authorization_params.screen_hint": + return UNTRUSTED_DATA_AUTHORIZATION_PARAMS_SCREEN_HINT; + case "organization.branding": + return ORGANIZATION_BRANDING; + case "client.description": + return CLIENT_DESCRIPTION; + case "screen.texts": + return SCREEN_TEXTS; + case "branding.settings": + return BRANDING_SETTINGS; + case "transaction.custom_domain.domain": + return TRANSACTION_CUSTOM_DOMAIN_DOMAIN; + case "untrusted_data.submitted_form_data": + return UNTRUSTED_DATA_SUBMITTED_FORM_DATA; + case "client.logo_uri": + return CLIENT_LOGO_URI; + case "tenant.enabled_locales": + return TENANT_ENABLED_LOCALES; + case "organization.display_name": + return ORGANIZATION_DISPLAY_NAME; + case "untrusted_data.authorization_params.login_hint": + return UNTRUSTED_DATA_AUTHORIZATION_PARAMS_LOGIN_HINT; + case "user.organizations": + return USER_ORGANIZATIONS; + case "branding.themes.default": + return BRANDING_THEMES_DEFAULT; + case "tenant.name": + return TENANT_NAME; + case "untrusted_data.authorization_params.ui_locales": + return UNTRUSTED_DATA_AUTHORIZATION_PARAMS_UI_LOCALES; + case "tenant.logo_url": + return TENANT_LOGO_URL; + default: + return new AculContextEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + BRANDING_SETTINGS, + + BRANDING_THEMES_DEFAULT, + + CLIENT_LOGO_URI, + + CLIENT_DESCRIPTION, + + ORGANIZATION_DISPLAY_NAME, + + ORGANIZATION_BRANDING, + + SCREEN_TEXTS, + + TENANT_NAME, + + TENANT_FRIENDLY_NAME, + + TENANT_LOGO_URL, + + TENANT_ENABLED_LOCALES, + + UNTRUSTED_DATA_SUBMITTED_FORM_DATA, + + UNTRUSTED_DATA_AUTHORIZATION_PARAMS_LOGIN_HINT, + + UNTRUSTED_DATA_AUTHORIZATION_PARAMS_SCREEN_HINT, + + UNTRUSTED_DATA_AUTHORIZATION_PARAMS_UI_LOCALES, + + USER_ORGANIZATIONS, + + TRANSACTION_CUSTOM_DOMAIN_DOMAIN, + + UNKNOWN + } + + public interface Visitor { + T visitBrandingSettings(); + + T visitBrandingThemesDefault(); + + T visitClientLogoUri(); + + T visitClientDescription(); + + T visitOrganizationDisplayName(); + + T visitOrganizationBranding(); + + T visitScreenTexts(); + + T visitTenantName(); + + T visitTenantFriendlyName(); + + T visitTenantLogoUrl(); + + T visitTenantEnabledLocales(); + + T visitUntrustedDataSubmittedFormData(); + + T visitUntrustedDataAuthorizationParamsLoginHint(); + + T visitUntrustedDataAuthorizationParamsScreenHint(); + + T visitUntrustedDataAuthorizationParamsUiLocales(); + + T visitUserOrganizations(); + + T visitTransactionCustomDomainDomain(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java index 22ca393c9..70c5c494d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilter.java @@ -4,121 +4,92 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AculDomainFilter.Builder.class) +@JsonDeserialize(using = AculDomainFilter.Deserializer.class) public final class AculDomainFilter { - private final Optional id; + private final Object value; - private final Optional> metadata; + private final int type; - private final Map additionalProperties; - - private AculDomainFilter( - Optional id, Optional> metadata, Map additionalProperties) { - this.id = id; - this.metadata = metadata; - this.additionalProperties = additionalProperties; + private AculDomainFilter(Object value, int type) { + this.value = value; + this.type = type; } - /** - * @return Domain ID - */ - @JsonProperty("id") - public Optional getId() { - return id; + @JsonValue + public Object get() { + return this.value; } - @JsonProperty("metadata") - public Optional> getMetadata() { - return metadata; + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AculDomainFilterById) this.value); + } else if (this.type == 1) { + return visitor.visit((AculDomainFilterByMetadata) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculDomainFilter && equalTo((AculDomainFilter) other); } - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - private boolean equalTo(AculDomainFilter other) { - return id.equals(other.id) && metadata.equals(other.metadata); + return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.id, this.metadata); + return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { - return ObjectMappers.stringify(this); + return this.value.toString(); } - public static Builder builder() { - return new Builder(); + public static AculDomainFilter of(AculDomainFilterById value) { + return new AculDomainFilter(value, 0); } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional> metadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AculDomainFilter other) { - id(other.getId()); - metadata(other.getMetadata()); - return this; - } + public static AculDomainFilter of(AculDomainFilterByMetadata value) { + return new AculDomainFilter(value, 1); + } - /** - *

Domain ID

- */ - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } + public interface Visitor { + T visit(AculDomainFilterById value); - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { - this.metadata = metadata; - return this; - } + T visit(AculDomainFilterByMetadata value); + } - public Builder metadata(Map metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AculDomainFilter.class); } - public AculDomainFilter build() { - return new AculDomainFilter(id, metadata, additionalProperties); + @Override + public AculDomainFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculDomainFilterById.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculDomainFilterByMetadata.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java new file mode 100644 index 000000000..a8a4b256d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculDomainFilterById.Builder.class) +public final class AculDomainFilterById { + private final String id; + + private final Map additionalProperties; + + private AculDomainFilterById(String id, Map additionalProperties) { + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return Domain ID + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculDomainFilterById && equalTo((AculDomainFilterById) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculDomainFilterById other) { + return id.equals(other.id); + } + + @Override + public int hashCode() { + return Objects.hash(this.id); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Domain ID

+ */ + _FinalStage id(@NotNull String id); + + Builder from(AculDomainFilterById other); + } + + public interface _FinalStage { + AculDomainFilterById build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AculDomainFilterById other) { + id(other.getId()); + return this; + } + + /** + *

Domain ID

+ *

Domain ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @Override + public AculDomainFilterById build() { + return new AculDomainFilterById(id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java new file mode 100644 index 000000000..da5713108 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculDomainFilterByMetadata.Builder.class) +public final class AculDomainFilterByMetadata { + private final Map metadata; + + private final Map additionalProperties; + + private AculDomainFilterByMetadata(Map metadata, Map additionalProperties) { + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("metadata") + public Map getMetadata() { + return metadata; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculDomainFilterByMetadata && equalTo((AculDomainFilterByMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculDomainFilterByMetadata other) { + return metadata.equals(other.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(this.metadata); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map metadata = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculDomainFilterByMetadata other) { + metadata(other.getMetadata()); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Map metadata) { + this.metadata.clear(); + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder putAllMetadata(Map metadata) { + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder metadata(String key, Object value) { + this.metadata.put(key, value); + return this; + } + + public AculDomainFilterByMetadata build() { + return new AculDomainFilterByMetadata(metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculFilters.java b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java index 17818338d..3498dd672 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculFilters.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java @@ -73,7 +73,7 @@ public Optional> getDomains() { return domains; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculFilters && equalTo((AculFilters) other); @@ -91,12 +91,12 @@ private boolean equalTo(AculFilters other) { && domains.equals(other.domains); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.matchType, this.clients, this.organizations, this.domains); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java index 222e3e8fe..d2fd1c82e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java @@ -22,7 +22,7 @@ public final class AculHeadTag { private final Optional tag; - private final Optional attributes; + private final Optional> attributes; private final Optional content; @@ -30,7 +30,7 @@ public final class AculHeadTag { private AculHeadTag( Optional tag, - Optional attributes, + Optional> attributes, Optional content, Map additionalProperties) { this.tag = tag; @@ -48,20 +48,16 @@ public Optional getTag() { } @JsonProperty("attributes") - public Optional getAttributes() { + public Optional> getAttributes() { return attributes; } - /** - * @return Text/content within the opening and closing tags of the element. - * See <a href="https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens">documentation</a> on using context variables - */ @JsonProperty("content") public Optional getContent() { return content; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculHeadTag && equalTo((AculHeadTag) other); @@ -76,12 +72,12 @@ private boolean equalTo(AculHeadTag other) { return tag.equals(other.tag) && attributes.equals(other.attributes) && content.equals(other.content); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tag, this.attributes, this.content); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,7 +90,7 @@ public static Builder builder() { public static final class Builder { private Optional tag = Optional.empty(); - private Optional attributes = Optional.empty(); + private Optional> attributes = Optional.empty(); private Optional content = Optional.empty(); @@ -125,20 +121,16 @@ public Builder tag(String tag) { } @JsonSetter(value = "attributes", nulls = Nulls.SKIP) - public Builder attributes(Optional attributes) { + public Builder attributes(Optional> attributes) { this.attributes = attributes; return this; } - public Builder attributes(AculHeadTagAttributes attributes) { + public Builder attributes(Map attributes) { this.attributes = Optional.ofNullable(attributes); return this; } - /** - *

Text/content within the opening and closing tags of the element. - * See <a href="https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens">documentation</a> on using context variables

- */ @JsonSetter(value = "content", nulls = Nulls.SKIP) public Builder content(Optional content) { this.content = content; diff --git a/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java index 2166f0615..444e413b9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof AculMatchTypeEnum && this.string.equals(((AculMatchTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java index bba8502f3..c6e795a06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java @@ -4,121 +4,92 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AculOrganizationFilter.Builder.class) +@JsonDeserialize(using = AculOrganizationFilter.Deserializer.class) public final class AculOrganizationFilter { - private final Optional id; + private final Object value; - private final Optional> metadata; + private final int type; - private final Map additionalProperties; - - private AculOrganizationFilter( - Optional id, Optional> metadata, Map additionalProperties) { - this.id = id; - this.metadata = metadata; - this.additionalProperties = additionalProperties; + private AculOrganizationFilter(Object value, int type) { + this.value = value; + this.type = type; } - /** - * @return Organization ID - */ - @JsonProperty("id") - public Optional getId() { - return id; + @JsonValue + public Object get() { + return this.value; } - @JsonProperty("metadata") - public Optional> getMetadata() { - return metadata; + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AculOrganizationFilterById) this.value); + } else if (this.type == 1) { + return visitor.visit((AculOrganizationFilterByMetadata) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculOrganizationFilter && equalTo((AculOrganizationFilter) other); } - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - private boolean equalTo(AculOrganizationFilter other) { - return id.equals(other.id) && metadata.equals(other.metadata); + return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.id, this.metadata); + return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { - return ObjectMappers.stringify(this); + return this.value.toString(); } - public static Builder builder() { - return new Builder(); + public static AculOrganizationFilter of(AculOrganizationFilterById value) { + return new AculOrganizationFilter(value, 0); } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional> metadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AculOrganizationFilter other) { - id(other.getId()); - metadata(other.getMetadata()); - return this; - } + public static AculOrganizationFilter of(AculOrganizationFilterByMetadata value) { + return new AculOrganizationFilter(value, 1); + } - /** - *

Organization ID

- */ - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } + public interface Visitor { + T visit(AculOrganizationFilterById value); - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { - this.metadata = metadata; - return this; - } + T visit(AculOrganizationFilterByMetadata value); + } - public Builder metadata(Map metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AculOrganizationFilter.class); } - public AculOrganizationFilter build() { - return new AculOrganizationFilter(id, metadata, additionalProperties); + @Override + public AculOrganizationFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculOrganizationFilterById.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AculOrganizationFilterByMetadata.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java new file mode 100644 index 000000000..9344a5ceb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculOrganizationFilterById.Builder.class) +public final class AculOrganizationFilterById { + private final String id; + + private final Map additionalProperties; + + private AculOrganizationFilterById(String id, Map additionalProperties) { + this.id = id; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization ID + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculOrganizationFilterById && equalTo((AculOrganizationFilterById) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculOrganizationFilterById other) { + return id.equals(other.id); + } + + @Override + public int hashCode() { + return Objects.hash(this.id); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization ID

+ */ + _FinalStage id(@NotNull String id); + + Builder from(AculOrganizationFilterById other); + } + + public interface _FinalStage { + AculOrganizationFilterById build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AculOrganizationFilterById other) { + id(other.getId()); + return this; + } + + /** + *

Organization ID

+ *

Organization ID

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @Override + public AculOrganizationFilterById build() { + return new AculOrganizationFilterById(id, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java new file mode 100644 index 000000000..3117b771e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AculOrganizationFilterByMetadata.Builder.class) +public final class AculOrganizationFilterByMetadata { + private final Map metadata; + + private final Map additionalProperties; + + private AculOrganizationFilterByMetadata(Map metadata, Map additionalProperties) { + this.metadata = metadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("metadata") + public Map getMetadata() { + return metadata; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AculOrganizationFilterByMetadata && equalTo((AculOrganizationFilterByMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AculOrganizationFilterByMetadata other) { + return metadata.equals(other.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(this.metadata); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map metadata = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AculOrganizationFilterByMetadata other) { + metadata(other.getMetadata()); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Map metadata) { + this.metadata.clear(); + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder putAllMetadata(Map metadata) { + if (metadata != null) { + this.metadata.putAll(metadata); + } + return this; + } + + public Builder metadata(String key, Object value) { + this.metadata.put(key, value); + return this; + } + + public AculOrganizationFilterByMetadata build() { + return new AculOrganizationFilterByMetadata(metadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java index 4bd2304b5..6d9f14e1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof AculRenderingModeEnum && this.string.equals(((AculRenderingModeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java index 308c819b2..909b97eaf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java @@ -30,28 +30,28 @@ public final class AculResponseContent { private final OptionalNullable defaultHeadTagsDisabled; + private final OptionalNullable usePageTemplate; + private final Optional> headTags; private final OptionalNullable filters; - private final OptionalNullable usePageTemplate; - private final Map additionalProperties; private AculResponseContent( Optional renderingMode, Optional> contextConfiguration, OptionalNullable defaultHeadTagsDisabled, + OptionalNullable usePageTemplate, Optional> headTags, OptionalNullable filters, - OptionalNullable usePageTemplate, Map additionalProperties) { this.renderingMode = renderingMode; this.contextConfiguration = contextConfiguration; this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.usePageTemplate = usePageTemplate; this.headTags = headTags; this.filters = filters; - this.usePageTemplate = usePageTemplate; this.additionalProperties = additionalProperties; } @@ -80,6 +80,18 @@ public OptionalNullable getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + /** * @return An array of head tags */ @@ -97,37 +109,25 @@ public OptionalNullable getFilters() { return filters; } - /** - * @return Use page template with ACUL - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_page_template") - public OptionalNullable getUsePageTemplate() { - if (usePageTemplate == null) { - return OptionalNullable.absent(); - } - return usePageTemplate; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("default_head_tags_disabled") private OptionalNullable _getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("filters") - private OptionalNullable _getFilters() { - return filters; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("use_page_template") private OptionalNullable _getUsePageTemplate() { return usePageTemplate; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculResponseContent && equalTo((AculResponseContent) other); @@ -142,23 +142,23 @@ private boolean equalTo(AculResponseContent other) { return renderingMode.equals(other.renderingMode) && contextConfiguration.equals(other.contextConfiguration) && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && usePageTemplate.equals(other.usePageTemplate) && headTags.equals(other.headTags) - && filters.equals(other.filters) - && usePageTemplate.equals(other.usePageTemplate); + && filters.equals(other.filters); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.renderingMode, this.contextConfiguration, this.defaultHeadTagsDisabled, + this.usePageTemplate, this.headTags, - this.filters, - this.usePageTemplate); + this.filters); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -175,12 +175,12 @@ public static final class Builder { private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + private Optional> headTags = Optional.empty(); private OptionalNullable filters = OptionalNullable.absent(); - private OptionalNullable usePageTemplate = OptionalNullable.absent(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -190,9 +190,9 @@ public Builder from(AculResponseContent other) { renderingMode(other.getRenderingMode()); contextConfiguration(other.getContextConfiguration()); defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + usePageTemplate(other.getUsePageTemplate()); headTags(other.getHeadTags()); filters(other.getFilters()); - usePageTemplate(other.getUsePageTemplate()); return this; } @@ -255,6 +255,40 @@ public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.NullableUse page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + /** *

An array of head tags

*/ @@ -300,48 +334,14 @@ public Builder filters(com.auth0.client.mgmt.core.Nullable filters) return this; } - /** - *

Use page template with ACUL

- */ - @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) - public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { - this.usePageTemplate = usePageTemplate; - return this; - } - - public Builder usePageTemplate(Boolean usePageTemplate) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate); - return this; - } - - public Builder usePageTemplate(Optional usePageTemplate) { - if (usePageTemplate.isPresent()) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } else { - this.usePageTemplate = OptionalNullable.absent(); - } - return this; - } - - public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { - if (usePageTemplate.isNull()) { - this.usePageTemplate = OptionalNullable.ofNull(); - } else if (usePageTemplate.isEmpty()) { - this.usePageTemplate = OptionalNullable.absent(); - } else { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } - return this; - } - public AculResponseContent build() { return new AculResponseContent( renderingMode, contextConfiguration, defaultHeadTagsDisabled, + usePageTemplate, headTags, filters, - usePageTemplate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java index b8d28eec8..397d165f4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(AddOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java index 170d20fbb..3baba26fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java @@ -97,7 +97,7 @@ public Optional getAllowAnyOrganization() { return allowAnyOrganization; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssociateOrganizationClientGrantResponseContent @@ -118,13 +118,13 @@ private boolean equalTo(AssociateOrganizationClientGrantResponseContent other) { && allowAnyOrganization.equals(other.allowAnyOrganization); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java b/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java new file mode 100644 index 000000000..2482ba388 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AsyncApprovalNotificationsChannelsEnum { + public static final AsyncApprovalNotificationsChannelsEnum EMAIL = + new AsyncApprovalNotificationsChannelsEnum(Value.EMAIL, "email"); + + public static final AsyncApprovalNotificationsChannelsEnum GUARDIAN_PUSH = + new AsyncApprovalNotificationsChannelsEnum(Value.GUARDIAN_PUSH, "guardian-push"); + + private final Value value; + + private final String string; + + AsyncApprovalNotificationsChannelsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AsyncApprovalNotificationsChannelsEnum + && this.string.equals(((AsyncApprovalNotificationsChannelsEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case GUARDIAN_PUSH: + return visitor.visitGuardianPush(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AsyncApprovalNotificationsChannelsEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "guardian-push": + return GUARDIAN_PUSH; + default: + return new AsyncApprovalNotificationsChannelsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + GUARDIAN_PUSH, + + EMAIL, + + UNKNOWN + } + + public interface Visitor { + T visitGuardianPush(); + + T visitEmail(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java new file mode 100644 index 000000000..bf1cb69b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaArkoseResponseContent.Builder.class) +public final class AttackProtectionCaptchaArkoseResponseContent { + private final Optional siteKey; + + private final Optional failOpen; + + private final Optional clientSubdomain; + + private final Optional verifySubdomain; + + private final Map additionalProperties; + + private AttackProtectionCaptchaArkoseResponseContent( + Optional siteKey, + Optional failOpen, + Optional clientSubdomain, + Optional verifySubdomain, + Map additionalProperties) { + this.siteKey = siteKey; + this.failOpen = failOpen; + this.clientSubdomain = clientSubdomain; + this.verifySubdomain = verifySubdomain; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the Arkose captcha provider. + */ + @JsonProperty("site_key") + public Optional getSiteKey() { + return siteKey; + } + + /** + * @return Whether the captcha should fail open. + */ + @JsonProperty("fail_open") + public Optional getFailOpen() { + return failOpen; + } + + /** + * @return The subdomain used for client requests to the Arkose captcha provider. + */ + @JsonProperty("client_subdomain") + public Optional getClientSubdomain() { + return clientSubdomain; + } + + /** + * @return The subdomain used for server-side verification requests to the Arkose captcha provider. + */ + @JsonProperty("verify_subdomain") + public Optional getVerifySubdomain() { + return verifySubdomain; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaArkoseResponseContent + && equalTo((AttackProtectionCaptchaArkoseResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaArkoseResponseContent other) { + return siteKey.equals(other.siteKey) + && failOpen.equals(other.failOpen) + && clientSubdomain.equals(other.clientSubdomain) + && verifySubdomain.equals(other.verifySubdomain); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.failOpen, this.clientSubdomain, this.verifySubdomain); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional siteKey = Optional.empty(); + + private Optional failOpen = Optional.empty(); + + private Optional clientSubdomain = Optional.empty(); + + private Optional verifySubdomain = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaArkoseResponseContent other) { + siteKey(other.getSiteKey()); + failOpen(other.getFailOpen()); + clientSubdomain(other.getClientSubdomain()); + verifySubdomain(other.getVerifySubdomain()); + return this; + } + + /** + *

The site key for the Arkose captcha provider.

+ */ + @JsonSetter(value = "site_key", nulls = Nulls.SKIP) + public Builder siteKey(Optional siteKey) { + this.siteKey = siteKey; + return this; + } + + public Builder siteKey(String siteKey) { + this.siteKey = Optional.ofNullable(siteKey); + return this; + } + + /** + *

Whether the captcha should fail open.

+ */ + @JsonSetter(value = "fail_open", nulls = Nulls.SKIP) + public Builder failOpen(Optional failOpen) { + this.failOpen = failOpen; + return this; + } + + public Builder failOpen(Boolean failOpen) { + this.failOpen = Optional.ofNullable(failOpen); + return this; + } + + /** + *

The subdomain used for client requests to the Arkose captcha provider.

+ */ + @JsonSetter(value = "client_subdomain", nulls = Nulls.SKIP) + public Builder clientSubdomain(Optional clientSubdomain) { + this.clientSubdomain = clientSubdomain; + return this; + } + + public Builder clientSubdomain(String clientSubdomain) { + this.clientSubdomain = Optional.ofNullable(clientSubdomain); + return this; + } + + /** + *

The subdomain used for server-side verification requests to the Arkose captcha provider.

+ */ + @JsonSetter(value = "verify_subdomain", nulls = Nulls.SKIP) + public Builder verifySubdomain(Optional verifySubdomain) { + this.verifySubdomain = verifySubdomain; + return this; + } + + public Builder verifySubdomain(String verifySubdomain) { + this.verifySubdomain = Optional.ofNullable(verifySubdomain); + return this; + } + + public AttackProtectionCaptchaArkoseResponseContent build() { + return new AttackProtectionCaptchaArkoseResponseContent( + siteKey, failOpen, clientSubdomain, verifySubdomain, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java new file mode 100644 index 000000000..aac4e1307 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaAuthChallengeRequest.Builder.class) +public final class AttackProtectionCaptchaAuthChallengeRequest { + private final boolean failOpen; + + private final Map additionalProperties; + + private AttackProtectionCaptchaAuthChallengeRequest(boolean failOpen, Map additionalProperties) { + this.failOpen = failOpen; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the auth challenge should fail open. + */ + @JsonProperty("fail_open") + public boolean getFailOpen() { + return failOpen; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaAuthChallengeRequest + && equalTo((AttackProtectionCaptchaAuthChallengeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaAuthChallengeRequest other) { + return failOpen == other.failOpen; + } + + @Override + public int hashCode() { + return Objects.hash(this.failOpen); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FailOpenStage builder() { + return new Builder(); + } + + public interface FailOpenStage { + /** + *

Whether the auth challenge should fail open.

+ */ + _FinalStage failOpen(boolean failOpen); + + Builder from(AttackProtectionCaptchaAuthChallengeRequest other); + } + + public interface _FinalStage { + AttackProtectionCaptchaAuthChallengeRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FailOpenStage, _FinalStage { + private boolean failOpen; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionCaptchaAuthChallengeRequest other) { + failOpen(other.getFailOpen()); + return this; + } + + /** + *

Whether the auth challenge should fail open.

+ *

Whether the auth challenge should fail open.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("fail_open") + public _FinalStage failOpen(boolean failOpen) { + this.failOpen = failOpen; + return this; + } + + @Override + public AttackProtectionCaptchaAuthChallengeRequest build() { + return new AttackProtectionCaptchaAuthChallengeRequest(failOpen, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java new file mode 100644 index 000000000..2bf45bcb3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaAuthChallengeResponseContent.Builder.class) +public final class AttackProtectionCaptchaAuthChallengeResponseContent { + private final Optional failOpen; + + private final Map additionalProperties; + + private AttackProtectionCaptchaAuthChallengeResponseContent( + Optional failOpen, Map additionalProperties) { + this.failOpen = failOpen; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the auth challenge should fail open. + */ + @JsonProperty("fail_open") + public Optional getFailOpen() { + return failOpen; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaAuthChallengeResponseContent + && equalTo((AttackProtectionCaptchaAuthChallengeResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaAuthChallengeResponseContent other) { + return failOpen.equals(other.failOpen); + } + + @Override + public int hashCode() { + return Objects.hash(this.failOpen); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional failOpen = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaAuthChallengeResponseContent other) { + failOpen(other.getFailOpen()); + return this; + } + + /** + *

Whether the auth challenge should fail open.

+ */ + @JsonSetter(value = "fail_open", nulls = Nulls.SKIP) + public Builder failOpen(Optional failOpen) { + this.failOpen = failOpen; + return this; + } + + public Builder failOpen(Boolean failOpen) { + this.failOpen = Optional.ofNullable(failOpen); + return this; + } + + public AttackProtectionCaptchaAuthChallengeResponseContent build() { + return new AttackProtectionCaptchaAuthChallengeResponseContent(failOpen, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java new file mode 100644 index 000000000..d25a5a77e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaFriendlyCaptchaResponseContent.Builder.class) +public final class AttackProtectionCaptchaFriendlyCaptchaResponseContent { + private final Optional siteKey; + + private final Map additionalProperties; + + private AttackProtectionCaptchaFriendlyCaptchaResponseContent( + Optional siteKey, Map additionalProperties) { + this.siteKey = siteKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the Friendly Captcha provider. + */ + @JsonProperty("site_key") + public Optional getSiteKey() { + return siteKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaFriendlyCaptchaResponseContent + && equalTo((AttackProtectionCaptchaFriendlyCaptchaResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaFriendlyCaptchaResponseContent other) { + return siteKey.equals(other.siteKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional siteKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaFriendlyCaptchaResponseContent other) { + siteKey(other.getSiteKey()); + return this; + } + + /** + *

The site key for the Friendly Captcha provider.

+ */ + @JsonSetter(value = "site_key", nulls = Nulls.SKIP) + public Builder siteKey(Optional siteKey) { + this.siteKey = siteKey; + return this; + } + + public Builder siteKey(String siteKey) { + this.siteKey = Optional.ofNullable(siteKey); + return this; + } + + public AttackProtectionCaptchaFriendlyCaptchaResponseContent build() { + return new AttackProtectionCaptchaFriendlyCaptchaResponseContent(siteKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java new file mode 100644 index 000000000..579a75ca2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaHcaptchaResponseContent.Builder.class) +public final class AttackProtectionCaptchaHcaptchaResponseContent { + private final Optional siteKey; + + private final Map additionalProperties; + + private AttackProtectionCaptchaHcaptchaResponseContent( + Optional siteKey, Map additionalProperties) { + this.siteKey = siteKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the hCaptcha provider. + */ + @JsonProperty("site_key") + public Optional getSiteKey() { + return siteKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaHcaptchaResponseContent + && equalTo((AttackProtectionCaptchaHcaptchaResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaHcaptchaResponseContent other) { + return siteKey.equals(other.siteKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional siteKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaHcaptchaResponseContent other) { + siteKey(other.getSiteKey()); + return this; + } + + /** + *

The site key for the hCaptcha provider.

+ */ + @JsonSetter(value = "site_key", nulls = Nulls.SKIP) + public Builder siteKey(Optional siteKey) { + this.siteKey = siteKey; + return this; + } + + public Builder siteKey(String siteKey) { + this.siteKey = Optional.ofNullable(siteKey); + return this; + } + + public AttackProtectionCaptchaHcaptchaResponseContent build() { + return new AttackProtectionCaptchaHcaptchaResponseContent(siteKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java new file mode 100644 index 000000000..3ec0a22eb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AttackProtectionCaptchaProviderId { + public static final AttackProtectionCaptchaProviderId RECAPTCHA_V2 = + new AttackProtectionCaptchaProviderId(Value.RECAPTCHA_V2, "recaptcha_v2"); + + public static final AttackProtectionCaptchaProviderId AUTH_CHALLENGE = + new AttackProtectionCaptchaProviderId(Value.AUTH_CHALLENGE, "auth_challenge"); + + public static final AttackProtectionCaptchaProviderId FRIENDLY_CAPTCHA = + new AttackProtectionCaptchaProviderId(Value.FRIENDLY_CAPTCHA, "friendly_captcha"); + + public static final AttackProtectionCaptchaProviderId ARKOSE = + new AttackProtectionCaptchaProviderId(Value.ARKOSE, "arkose"); + + public static final AttackProtectionCaptchaProviderId HCAPTCHA = + new AttackProtectionCaptchaProviderId(Value.HCAPTCHA, "hcaptcha"); + + public static final AttackProtectionCaptchaProviderId SIMPLE_CAPTCHA = + new AttackProtectionCaptchaProviderId(Value.SIMPLE_CAPTCHA, "simple_captcha"); + + public static final AttackProtectionCaptchaProviderId RECAPTCHA_ENTERPRISE = + new AttackProtectionCaptchaProviderId(Value.RECAPTCHA_ENTERPRISE, "recaptcha_enterprise"); + + private final Value value; + + private final String string; + + AttackProtectionCaptchaProviderId(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AttackProtectionCaptchaProviderId + && this.string.equals(((AttackProtectionCaptchaProviderId) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RECAPTCHA_V2: + return visitor.visitRecaptchaV2(); + case AUTH_CHALLENGE: + return visitor.visitAuthChallenge(); + case FRIENDLY_CAPTCHA: + return visitor.visitFriendlyCaptcha(); + case ARKOSE: + return visitor.visitArkose(); + case HCAPTCHA: + return visitor.visitHcaptcha(); + case SIMPLE_CAPTCHA: + return visitor.visitSimpleCaptcha(); + case RECAPTCHA_ENTERPRISE: + return visitor.visitRecaptchaEnterprise(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttackProtectionCaptchaProviderId valueOf(String value) { + switch (value) { + case "recaptcha_v2": + return RECAPTCHA_V2; + case "auth_challenge": + return AUTH_CHALLENGE; + case "friendly_captcha": + return FRIENDLY_CAPTCHA; + case "arkose": + return ARKOSE; + case "hcaptcha": + return HCAPTCHA; + case "simple_captcha": + return SIMPLE_CAPTCHA; + case "recaptcha_enterprise": + return RECAPTCHA_ENTERPRISE; + default: + return new AttackProtectionCaptchaProviderId(Value.UNKNOWN, value); + } + } + + public enum Value { + ARKOSE, + + AUTH_CHALLENGE, + + FRIENDLY_CAPTCHA, + + HCAPTCHA, + + RECAPTCHA_V2, + + RECAPTCHA_ENTERPRISE, + + SIMPLE_CAPTCHA, + + UNKNOWN + } + + public interface Visitor { + T visitArkose(); + + T visitAuthChallenge(); + + T visitFriendlyCaptcha(); + + T visitHcaptcha(); + + T visitRecaptchaV2(); + + T visitRecaptchaEnterprise(); + + T visitSimpleCaptcha(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java new file mode 100644 index 000000000..1f17bee41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.Builder.class) +public final class AttackProtectionCaptchaRecaptchaEnterpriseResponseContent { + private final Optional siteKey; + + private final Optional projectId; + + private final Map additionalProperties; + + private AttackProtectionCaptchaRecaptchaEnterpriseResponseContent( + Optional siteKey, Optional projectId, Map additionalProperties) { + this.siteKey = siteKey; + this.projectId = projectId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the reCAPTCHA Enterprise provider. + */ + @JsonProperty("site_key") + public Optional getSiteKey() { + return siteKey; + } + + /** + * @return The project ID for the reCAPTCHA Enterprise provider. + */ + @JsonProperty("project_id") + public Optional getProjectId() { + return projectId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaRecaptchaEnterpriseResponseContent + && equalTo((AttackProtectionCaptchaRecaptchaEnterpriseResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaRecaptchaEnterpriseResponseContent other) { + return siteKey.equals(other.siteKey) && projectId.equals(other.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.projectId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional siteKey = Optional.empty(); + + private Optional projectId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaRecaptchaEnterpriseResponseContent other) { + siteKey(other.getSiteKey()); + projectId(other.getProjectId()); + return this; + } + + /** + *

The site key for the reCAPTCHA Enterprise provider.

+ */ + @JsonSetter(value = "site_key", nulls = Nulls.SKIP) + public Builder siteKey(Optional siteKey) { + this.siteKey = siteKey; + return this; + } + + public Builder siteKey(String siteKey) { + this.siteKey = Optional.ofNullable(siteKey); + return this; + } + + /** + *

The project ID for the reCAPTCHA Enterprise provider.

+ */ + @JsonSetter(value = "project_id", nulls = Nulls.SKIP) + public Builder projectId(Optional projectId) { + this.projectId = projectId; + return this; + } + + public Builder projectId(String projectId) { + this.projectId = Optional.ofNullable(projectId); + return this; + } + + public AttackProtectionCaptchaRecaptchaEnterpriseResponseContent build() { + return new AttackProtectionCaptchaRecaptchaEnterpriseResponseContent( + siteKey, projectId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java new file mode 100644 index 000000000..9ac37663c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionCaptchaRecaptchaV2ResponseContent.Builder.class) +public final class AttackProtectionCaptchaRecaptchaV2ResponseContent { + private final Optional siteKey; + + private final Map additionalProperties; + + private AttackProtectionCaptchaRecaptchaV2ResponseContent( + Optional siteKey, Map additionalProperties) { + this.siteKey = siteKey; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the reCAPTCHA v2 provider. + */ + @JsonProperty("site_key") + public Optional getSiteKey() { + return siteKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionCaptchaRecaptchaV2ResponseContent + && equalTo((AttackProtectionCaptchaRecaptchaV2ResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionCaptchaRecaptchaV2ResponseContent other) { + return siteKey.equals(other.siteKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional siteKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttackProtectionCaptchaRecaptchaV2ResponseContent other) { + siteKey(other.getSiteKey()); + return this; + } + + /** + *

The site key for the reCAPTCHA v2 provider.

+ */ + @JsonSetter(value = "site_key", nulls = Nulls.SKIP) + public Builder siteKey(Optional siteKey) { + this.siteKey = siteKey; + return this; + } + + public Builder siteKey(String siteKey) { + this.siteKey = Optional.ofNullable(siteKey); + return this; + } + + public AttackProtectionCaptchaRecaptchaV2ResponseContent build() { + return new AttackProtectionCaptchaRecaptchaV2ResponseContent(siteKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java new file mode 100644 index 000000000..ba7fb17ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionUpdateCaptchaArkose.Builder.class) +public final class AttackProtectionUpdateCaptchaArkose { + private final String siteKey; + + private final String secret; + + private final Optional clientSubdomain; + + private final Optional verifySubdomain; + + private final Optional failOpen; + + private final Map additionalProperties; + + private AttackProtectionUpdateCaptchaArkose( + String siteKey, + String secret, + Optional clientSubdomain, + Optional verifySubdomain, + Optional failOpen, + Map additionalProperties) { + this.siteKey = siteKey; + this.secret = secret; + this.clientSubdomain = clientSubdomain; + this.verifySubdomain = verifySubdomain; + this.failOpen = failOpen; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the Arkose captcha provider. + */ + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + /** + * @return The secret key for the Arkose captcha provider. + */ + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + /** + * @return The subdomain used for client requests to the Arkose captcha provider. + */ + @JsonProperty("client_subdomain") + public Optional getClientSubdomain() { + return clientSubdomain; + } + + /** + * @return The subdomain used for server-side verification requests to the Arkose captcha provider. + */ + @JsonProperty("verify_subdomain") + public Optional getVerifySubdomain() { + return verifySubdomain; + } + + /** + * @return Whether the captcha should fail open. + */ + @JsonProperty("fail_open") + public Optional getFailOpen() { + return failOpen; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionUpdateCaptchaArkose + && equalTo((AttackProtectionUpdateCaptchaArkose) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionUpdateCaptchaArkose other) { + return siteKey.equals(other.siteKey) + && secret.equals(other.secret) + && clientSubdomain.equals(other.clientSubdomain) + && verifySubdomain.equals(other.verifySubdomain) + && failOpen.equals(other.failOpen); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.secret, this.clientSubdomain, this.verifySubdomain, this.failOpen); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + /** + *

The site key for the Arkose captcha provider.

+ */ + SecretStage siteKey(@NotNull String siteKey); + + Builder from(AttackProtectionUpdateCaptchaArkose other); + } + + public interface SecretStage { + /** + *

The secret key for the Arkose captcha provider.

+ */ + _FinalStage secret(@NotNull String secret); + } + + public interface _FinalStage { + AttackProtectionUpdateCaptchaArkose build(); + + /** + *

The subdomain used for client requests to the Arkose captcha provider.

+ */ + _FinalStage clientSubdomain(Optional clientSubdomain); + + _FinalStage clientSubdomain(String clientSubdomain); + + /** + *

The subdomain used for server-side verification requests to the Arkose captcha provider.

+ */ + _FinalStage verifySubdomain(Optional verifySubdomain); + + _FinalStage verifySubdomain(String verifySubdomain); + + /** + *

Whether the captcha should fail open.

+ */ + _FinalStage failOpen(Optional failOpen); + + _FinalStage failOpen(Boolean failOpen); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, SecretStage, _FinalStage { + private String siteKey; + + private String secret; + + private Optional failOpen = Optional.empty(); + + private Optional verifySubdomain = Optional.empty(); + + private Optional clientSubdomain = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionUpdateCaptchaArkose other) { + siteKey(other.getSiteKey()); + secret(other.getSecret()); + clientSubdomain(other.getClientSubdomain()); + verifySubdomain(other.getVerifySubdomain()); + failOpen(other.getFailOpen()); + return this; + } + + /** + *

The site key for the Arkose captcha provider.

+ *

The site key for the Arkose captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("site_key") + public SecretStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + /** + *

The secret key for the Arkose captcha provider.

+ *

The secret key for the Arkose captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("secret") + public _FinalStage secret(@NotNull String secret) { + this.secret = Objects.requireNonNull(secret, "secret must not be null"); + return this; + } + + /** + *

Whether the captcha should fail open.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage failOpen(Boolean failOpen) { + this.failOpen = Optional.ofNullable(failOpen); + return this; + } + + /** + *

Whether the captcha should fail open.

+ */ + @Override + @JsonSetter(value = "fail_open", nulls = Nulls.SKIP) + public _FinalStage failOpen(Optional failOpen) { + this.failOpen = failOpen; + return this; + } + + /** + *

The subdomain used for server-side verification requests to the Arkose captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage verifySubdomain(String verifySubdomain) { + this.verifySubdomain = Optional.ofNullable(verifySubdomain); + return this; + } + + /** + *

The subdomain used for server-side verification requests to the Arkose captcha provider.

+ */ + @Override + @JsonSetter(value = "verify_subdomain", nulls = Nulls.SKIP) + public _FinalStage verifySubdomain(Optional verifySubdomain) { + this.verifySubdomain = verifySubdomain; + return this; + } + + /** + *

The subdomain used for client requests to the Arkose captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage clientSubdomain(String clientSubdomain) { + this.clientSubdomain = Optional.ofNullable(clientSubdomain); + return this; + } + + /** + *

The subdomain used for client requests to the Arkose captcha provider.

+ */ + @Override + @JsonSetter(value = "client_subdomain", nulls = Nulls.SKIP) + public _FinalStage clientSubdomain(Optional clientSubdomain) { + this.clientSubdomain = clientSubdomain; + return this; + } + + @Override + public AttackProtectionUpdateCaptchaArkose build() { + return new AttackProtectionUpdateCaptchaArkose( + siteKey, secret, clientSubdomain, verifySubdomain, failOpen, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java new file mode 100644 index 000000000..53572db51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionUpdateCaptchaFriendlyCaptcha.Builder.class) +public final class AttackProtectionUpdateCaptchaFriendlyCaptcha { + private final String siteKey; + + private final String secret; + + private final Map additionalProperties; + + private AttackProtectionUpdateCaptchaFriendlyCaptcha( + String siteKey, String secret, Map additionalProperties) { + this.siteKey = siteKey; + this.secret = secret; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the Friendly Captcha provider. + */ + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + /** + * @return The secret key for the Friendly Captcha provider. + */ + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionUpdateCaptchaFriendlyCaptcha + && equalTo((AttackProtectionUpdateCaptchaFriendlyCaptcha) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionUpdateCaptchaFriendlyCaptcha other) { + return siteKey.equals(other.siteKey) && secret.equals(other.secret); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.secret); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + /** + *

The site key for the Friendly Captcha provider.

+ */ + SecretStage siteKey(@NotNull String siteKey); + + Builder from(AttackProtectionUpdateCaptchaFriendlyCaptcha other); + } + + public interface SecretStage { + /** + *

The secret key for the Friendly Captcha provider.

+ */ + _FinalStage secret(@NotNull String secret); + } + + public interface _FinalStage { + AttackProtectionUpdateCaptchaFriendlyCaptcha build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, SecretStage, _FinalStage { + private String siteKey; + + private String secret; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionUpdateCaptchaFriendlyCaptcha other) { + siteKey(other.getSiteKey()); + secret(other.getSecret()); + return this; + } + + /** + *

The site key for the Friendly Captcha provider.

+ *

The site key for the Friendly Captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("site_key") + public SecretStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + /** + *

The secret key for the Friendly Captcha provider.

+ *

The secret key for the Friendly Captcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("secret") + public _FinalStage secret(@NotNull String secret) { + this.secret = Objects.requireNonNull(secret, "secret must not be null"); + return this; + } + + @Override + public AttackProtectionUpdateCaptchaFriendlyCaptcha build() { + return new AttackProtectionUpdateCaptchaFriendlyCaptcha(siteKey, secret, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java new file mode 100644 index 000000000..d91378e20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionUpdateCaptchaHcaptcha.Builder.class) +public final class AttackProtectionUpdateCaptchaHcaptcha { + private final String siteKey; + + private final String secret; + + private final Map additionalProperties; + + private AttackProtectionUpdateCaptchaHcaptcha( + String siteKey, String secret, Map additionalProperties) { + this.siteKey = siteKey; + this.secret = secret; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the hCaptcha provider. + */ + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + /** + * @return The secret key for the hCaptcha provider. + */ + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionUpdateCaptchaHcaptcha + && equalTo((AttackProtectionUpdateCaptchaHcaptcha) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionUpdateCaptchaHcaptcha other) { + return siteKey.equals(other.siteKey) && secret.equals(other.secret); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.secret); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + /** + *

The site key for the hCaptcha provider.

+ */ + SecretStage siteKey(@NotNull String siteKey); + + Builder from(AttackProtectionUpdateCaptchaHcaptcha other); + } + + public interface SecretStage { + /** + *

The secret key for the hCaptcha provider.

+ */ + _FinalStage secret(@NotNull String secret); + } + + public interface _FinalStage { + AttackProtectionUpdateCaptchaHcaptcha build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, SecretStage, _FinalStage { + private String siteKey; + + private String secret; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionUpdateCaptchaHcaptcha other) { + siteKey(other.getSiteKey()); + secret(other.getSecret()); + return this; + } + + /** + *

The site key for the hCaptcha provider.

+ *

The site key for the hCaptcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("site_key") + public SecretStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + /** + *

The secret key for the hCaptcha provider.

+ *

The secret key for the hCaptcha provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("secret") + public _FinalStage secret(@NotNull String secret) { + this.secret = Objects.requireNonNull(secret, "secret must not be null"); + return this; + } + + @Override + public AttackProtectionUpdateCaptchaHcaptcha build() { + return new AttackProtectionUpdateCaptchaHcaptcha(siteKey, secret, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java new file mode 100644 index 000000000..8533345a2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionUpdateCaptchaRecaptchaEnterprise.Builder.class) +public final class AttackProtectionUpdateCaptchaRecaptchaEnterprise { + private final String siteKey; + + private final String apiKey; + + private final String projectId; + + private final Map additionalProperties; + + private AttackProtectionUpdateCaptchaRecaptchaEnterprise( + String siteKey, String apiKey, String projectId, Map additionalProperties) { + this.siteKey = siteKey; + this.apiKey = apiKey; + this.projectId = projectId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the reCAPTCHA Enterprise provider. + */ + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + /** + * @return The API key for the reCAPTCHA Enterprise provider. + */ + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + /** + * @return The project ID for the reCAPTCHA Enterprise provider. + */ + @JsonProperty("project_id") + public String getProjectId() { + return projectId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionUpdateCaptchaRecaptchaEnterprise + && equalTo((AttackProtectionUpdateCaptchaRecaptchaEnterprise) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionUpdateCaptchaRecaptchaEnterprise other) { + return siteKey.equals(other.siteKey) && apiKey.equals(other.apiKey) && projectId.equals(other.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.apiKey, this.projectId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + /** + *

The site key for the reCAPTCHA Enterprise provider.

+ */ + ApiKeyStage siteKey(@NotNull String siteKey); + + Builder from(AttackProtectionUpdateCaptchaRecaptchaEnterprise other); + } + + public interface ApiKeyStage { + /** + *

The API key for the reCAPTCHA Enterprise provider.

+ */ + ProjectIdStage apiKey(@NotNull String apiKey); + } + + public interface ProjectIdStage { + /** + *

The project ID for the reCAPTCHA Enterprise provider.

+ */ + _FinalStage projectId(@NotNull String projectId); + } + + public interface _FinalStage { + AttackProtectionUpdateCaptchaRecaptchaEnterprise build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, ApiKeyStage, ProjectIdStage, _FinalStage { + private String siteKey; + + private String apiKey; + + private String projectId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionUpdateCaptchaRecaptchaEnterprise other) { + siteKey(other.getSiteKey()); + apiKey(other.getApiKey()); + projectId(other.getProjectId()); + return this; + } + + /** + *

The site key for the reCAPTCHA Enterprise provider.

+ *

The site key for the reCAPTCHA Enterprise provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("site_key") + public ApiKeyStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + /** + *

The API key for the reCAPTCHA Enterprise provider.

+ *

The API key for the reCAPTCHA Enterprise provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("api_key") + public ProjectIdStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + /** + *

The project ID for the reCAPTCHA Enterprise provider.

+ *

The project ID for the reCAPTCHA Enterprise provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("project_id") + public _FinalStage projectId(@NotNull String projectId) { + this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); + return this; + } + + @Override + public AttackProtectionUpdateCaptchaRecaptchaEnterprise build() { + return new AttackProtectionUpdateCaptchaRecaptchaEnterprise( + siteKey, apiKey, projectId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java new file mode 100644 index 000000000..475a20b8c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttackProtectionUpdateCaptchaRecaptchaV2.Builder.class) +public final class AttackProtectionUpdateCaptchaRecaptchaV2 { + private final String siteKey; + + private final String secret; + + private final Map additionalProperties; + + private AttackProtectionUpdateCaptchaRecaptchaV2( + String siteKey, String secret, Map additionalProperties) { + this.siteKey = siteKey; + this.secret = secret; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site key for the reCAPTCHA v2 provider. + */ + @JsonProperty("site_key") + public String getSiteKey() { + return siteKey; + } + + /** + * @return The secret key for the reCAPTCHA v2 provider. + */ + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttackProtectionUpdateCaptchaRecaptchaV2 + && equalTo((AttackProtectionUpdateCaptchaRecaptchaV2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttackProtectionUpdateCaptchaRecaptchaV2 other) { + return siteKey.equals(other.siteKey) && secret.equals(other.secret); + } + + @Override + public int hashCode() { + return Objects.hash(this.siteKey, this.secret); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SiteKeyStage builder() { + return new Builder(); + } + + public interface SiteKeyStage { + /** + *

The site key for the reCAPTCHA v2 provider.

+ */ + SecretStage siteKey(@NotNull String siteKey); + + Builder from(AttackProtectionUpdateCaptchaRecaptchaV2 other); + } + + public interface SecretStage { + /** + *

The secret key for the reCAPTCHA v2 provider.

+ */ + _FinalStage secret(@NotNull String secret); + } + + public interface _FinalStage { + AttackProtectionUpdateCaptchaRecaptchaV2 build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SiteKeyStage, SecretStage, _FinalStage { + private String siteKey; + + private String secret; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttackProtectionUpdateCaptchaRecaptchaV2 other) { + siteKey(other.getSiteKey()); + secret(other.getSecret()); + return this; + } + + /** + *

The site key for the reCAPTCHA v2 provider.

+ *

The site key for the reCAPTCHA v2 provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("site_key") + public SecretStage siteKey(@NotNull String siteKey) { + this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); + return this; + } + + /** + *

The secret key for the reCAPTCHA v2 provider.

+ *

The secret key for the reCAPTCHA v2 provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("secret") + public _FinalStage secret(@NotNull String secret) { + this.secret = Objects.requireNonNull(secret, "secret must not be null"); + return this; + } + + @Override + public AttackProtectionUpdateCaptchaRecaptchaV2 build() { + return new AttackProtectionUpdateCaptchaRecaptchaV2(siteKey, secret, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java index 57756fa60..86fe4e1ea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java @@ -49,20 +49,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof AuthenticationMethodTypeEnum && this.string.equals(((AuthenticationMethodTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java index 432c4403f..337947d34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof AuthenticationTypeEnum && this.string.equals(((AuthenticationTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java new file mode 100644 index 000000000..2030a069f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BotDetectionChallengePolicyPasswordFlowEnum { + public static final BotDetectionChallengePolicyPasswordFlowEnum NEVER = + new BotDetectionChallengePolicyPasswordFlowEnum(Value.NEVER, "never"); + + public static final BotDetectionChallengePolicyPasswordFlowEnum WHEN_RISKY = + new BotDetectionChallengePolicyPasswordFlowEnum(Value.WHEN_RISKY, "when_risky"); + + public static final BotDetectionChallengePolicyPasswordFlowEnum ALWAYS = + new BotDetectionChallengePolicyPasswordFlowEnum(Value.ALWAYS, "always"); + + private final Value value; + + private final String string; + + BotDetectionChallengePolicyPasswordFlowEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BotDetectionChallengePolicyPasswordFlowEnum + && this.string.equals(((BotDetectionChallengePolicyPasswordFlowEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NEVER: + return visitor.visitNever(); + case WHEN_RISKY: + return visitor.visitWhenRisky(); + case ALWAYS: + return visitor.visitAlways(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BotDetectionChallengePolicyPasswordFlowEnum valueOf(String value) { + switch (value) { + case "never": + return NEVER; + case "when_risky": + return WHEN_RISKY; + case "always": + return ALWAYS; + default: + return new BotDetectionChallengePolicyPasswordFlowEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NEVER, + + WHEN_RISKY, + + ALWAYS, + + UNKNOWN + } + + public interface Visitor { + T visitNever(); + + T visitWhenRisky(); + + T visitAlways(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java new file mode 100644 index 000000000..464d1fc6f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BotDetectionChallengePolicyPasswordResetFlowEnum { + public static final BotDetectionChallengePolicyPasswordResetFlowEnum NEVER = + new BotDetectionChallengePolicyPasswordResetFlowEnum(Value.NEVER, "never"); + + public static final BotDetectionChallengePolicyPasswordResetFlowEnum WHEN_RISKY = + new BotDetectionChallengePolicyPasswordResetFlowEnum(Value.WHEN_RISKY, "when_risky"); + + public static final BotDetectionChallengePolicyPasswordResetFlowEnum ALWAYS = + new BotDetectionChallengePolicyPasswordResetFlowEnum(Value.ALWAYS, "always"); + + private final Value value; + + private final String string; + + BotDetectionChallengePolicyPasswordResetFlowEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BotDetectionChallengePolicyPasswordResetFlowEnum + && this.string.equals(((BotDetectionChallengePolicyPasswordResetFlowEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NEVER: + return visitor.visitNever(); + case WHEN_RISKY: + return visitor.visitWhenRisky(); + case ALWAYS: + return visitor.visitAlways(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BotDetectionChallengePolicyPasswordResetFlowEnum valueOf(String value) { + switch (value) { + case "never": + return NEVER; + case "when_risky": + return WHEN_RISKY; + case "always": + return ALWAYS; + default: + return new BotDetectionChallengePolicyPasswordResetFlowEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NEVER, + + WHEN_RISKY, + + ALWAYS, + + UNKNOWN + } + + public interface Visitor { + T visitNever(); + + T visitWhenRisky(); + + T visitAlways(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java new file mode 100644 index 000000000..627ec5168 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BotDetectionChallengePolicyPasswordlessFlowEnum { + public static final BotDetectionChallengePolicyPasswordlessFlowEnum NEVER = + new BotDetectionChallengePolicyPasswordlessFlowEnum(Value.NEVER, "never"); + + public static final BotDetectionChallengePolicyPasswordlessFlowEnum WHEN_RISKY = + new BotDetectionChallengePolicyPasswordlessFlowEnum(Value.WHEN_RISKY, "when_risky"); + + public static final BotDetectionChallengePolicyPasswordlessFlowEnum ALWAYS = + new BotDetectionChallengePolicyPasswordlessFlowEnum(Value.ALWAYS, "always"); + + private final Value value; + + private final String string; + + BotDetectionChallengePolicyPasswordlessFlowEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BotDetectionChallengePolicyPasswordlessFlowEnum + && this.string.equals(((BotDetectionChallengePolicyPasswordlessFlowEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case NEVER: + return visitor.visitNever(); + case WHEN_RISKY: + return visitor.visitWhenRisky(); + case ALWAYS: + return visitor.visitAlways(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BotDetectionChallengePolicyPasswordlessFlowEnum valueOf(String value) { + switch (value) { + case "never": + return NEVER; + case "when_risky": + return WHEN_RISKY; + case "always": + return ALWAYS; + default: + return new BotDetectionChallengePolicyPasswordlessFlowEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NEVER, + + WHEN_RISKY, + + ALWAYS, + + UNKNOWN + } + + public interface Visitor { + T visitNever(); + + T visitWhenRisky(); + + T visitAlways(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java new file mode 100644 index 000000000..0db7551bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BotDetectionLevelEnum { + public static final BotDetectionLevelEnum MEDIUM = new BotDetectionLevelEnum(Value.MEDIUM, "medium"); + + public static final BotDetectionLevelEnum LOW = new BotDetectionLevelEnum(Value.LOW, "low"); + + public static final BotDetectionLevelEnum HIGH = new BotDetectionLevelEnum(Value.HIGH, "high"); + + private final Value value; + + private final String string; + + BotDetectionLevelEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BotDetectionLevelEnum + && this.string.equals(((BotDetectionLevelEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MEDIUM: + return visitor.visitMedium(); + case LOW: + return visitor.visitLow(); + case HIGH: + return visitor.visitHigh(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BotDetectionLevelEnum valueOf(String value) { + switch (value) { + case "medium": + return MEDIUM; + case "low": + return LOW; + case "high": + return HIGH; + default: + return new BotDetectionLevelEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LOW, + + MEDIUM, + + HIGH, + + UNKNOWN + } + + public interface Visitor { + T visitLow(); + + T visitMedium(); + + T visitHigh(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java index b8c8027b1..9425f4bcb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java @@ -48,7 +48,7 @@ public Optional getPageBackground() { return pageBackground; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingColors && equalTo((BrandingColors) other); @@ -63,12 +63,12 @@ private boolean equalTo(BrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java index 4aae99c01..ac35045d9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java @@ -37,7 +37,7 @@ public Optional getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingFont && equalTo((BrandingFont) other); @@ -52,12 +52,12 @@ private boolean equalTo(BrandingFont other) { return url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java index d8e3bf912..cbc9c2974 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingPageBackground && equalTo((BrandingPageBackground) other); @@ -53,12 +53,12 @@ private boolean equalTo(BrandingPageBackground other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -83,7 +83,7 @@ static final class Deserializer extends StdDeserializer super(BrandingPageBackground.class); } - @java.lang.Override + @Override public BrandingPageBackground deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java index ef00067ff..741a07bb9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java @@ -128,7 +128,7 @@ public double getWidgetCornerRadius() { return widgetCornerRadius; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeBorders && equalTo((BrandingThemeBorders) other); @@ -151,7 +151,7 @@ private boolean equalTo(BrandingThemeBorders other) { && widgetCornerRadius == other.widgetCornerRadius; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.buttonBorderRadius, @@ -165,7 +165,7 @@ public int hashCode() { this.widgetCornerRadius); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -272,7 +272,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeBorders other) { buttonBorderRadius(other.getButtonBorderRadius()); buttonBorderWeight(other.getButtonBorderWeight()); @@ -291,7 +291,7 @@ public Builder from(BrandingThemeBorders other) { *

Button border radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("button_border_radius") public ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius) { this.buttonBorderRadius = buttonBorderRadius; @@ -303,14 +303,14 @@ public ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius) { *

Button border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("button_border_weight") public ButtonsStyleStage buttonBorderWeight(double buttonBorderWeight) { this.buttonBorderWeight = buttonBorderWeight; return this; } - @java.lang.Override + @Override @JsonSetter("buttons_style") public InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsStyleEnum buttonsStyle) { this.buttonsStyle = Objects.requireNonNull(buttonsStyle, "buttonsStyle must not be null"); @@ -322,7 +322,7 @@ public InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsS *

Input border radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_border_radius") public InputBorderWeightStage inputBorderRadius(double inputBorderRadius) { this.inputBorderRadius = inputBorderRadius; @@ -334,14 +334,14 @@ public InputBorderWeightStage inputBorderRadius(double inputBorderRadius) { *

Input border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_border_weight") public InputsStyleStage inputBorderWeight(double inputBorderWeight) { this.inputBorderWeight = inputBorderWeight; return this; } - @java.lang.Override + @Override @JsonSetter("inputs_style") public ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyleEnum inputsStyle) { this.inputsStyle = Objects.requireNonNull(inputsStyle, "inputsStyle must not be null"); @@ -353,7 +353,7 @@ public ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyl *

Show widget shadow

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("show_widget_shadow") public WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow) { this.showWidgetShadow = showWidgetShadow; @@ -365,7 +365,7 @@ public WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow) { *

Widget border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("widget_border_weight") public WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight) { this.widgetBorderWeight = widgetBorderWeight; @@ -377,14 +377,14 @@ public WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight) { *

Widget corner radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("widget_corner_radius") public _FinalStage widgetCornerRadius(double widgetCornerRadius) { this.widgetCornerRadius = widgetCornerRadius; return this; } - @java.lang.Override + @Override public BrandingThemeBorders build() { return new BrandingThemeBorders( buttonBorderRadius, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java index 0b79c632a..7792ecdfe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeBordersButtonsStyleEnum && this.string.equals(((BrandingThemeBordersButtonsStyleEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java index f100e8fe6..fcfe9b1b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeBordersInputsStyleEnum && this.string.equals(((BrandingThemeBordersInputsStyleEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java index 141a2ce34..2e3ca6ff9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java @@ -265,7 +265,7 @@ public String getWidgetBorder() { return widgetBorder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeColors && equalTo((BrandingThemeColors) other); @@ -299,7 +299,7 @@ private boolean equalTo(BrandingThemeColors other) { && widgetBorder.equals(other.widgetBorder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.baseFocusColor, @@ -324,7 +324,7 @@ public int hashCode() { this.widgetBorder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -540,7 +540,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeColors other) { baseFocusColor(other.getBaseFocusColor()); baseHoverColor(other.getBaseHoverColor()); @@ -570,7 +570,7 @@ public Builder from(BrandingThemeColors other) { *

Body text

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("body_text") public ErrorStage bodyText(@NotNull String bodyText) { this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); @@ -582,7 +582,7 @@ public ErrorStage bodyText(@NotNull String bodyText) { *

Error

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("error") public HeaderStage error(@NotNull String error) { this.error = Objects.requireNonNull(error, "error must not be null"); @@ -594,7 +594,7 @@ public HeaderStage error(@NotNull String error) { *

Header

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("header") public IconsStage header(@NotNull String header) { this.header = Objects.requireNonNull(header, "header must not be null"); @@ -606,7 +606,7 @@ public IconsStage header(@NotNull String header) { *

Icons

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("icons") public InputBackgroundStage icons(@NotNull String icons) { this.icons = Objects.requireNonNull(icons, "icons must not be null"); @@ -618,7 +618,7 @@ public InputBackgroundStage icons(@NotNull String icons) { *

Input background

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_background") public InputBorderStage inputBackground(@NotNull String inputBackground) { this.inputBackground = Objects.requireNonNull(inputBackground, "inputBackground must not be null"); @@ -630,7 +630,7 @@ public InputBorderStage inputBackground(@NotNull String inputBackground) { *

Input border

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_border") public InputFilledTextStage inputBorder(@NotNull String inputBorder) { this.inputBorder = Objects.requireNonNull(inputBorder, "inputBorder must not be null"); @@ -642,7 +642,7 @@ public InputFilledTextStage inputBorder(@NotNull String inputBorder) { *

Input filled text

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_filled_text") public InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledText) { this.inputFilledText = Objects.requireNonNull(inputFilledText, "inputFilledText must not be null"); @@ -654,7 +654,7 @@ public InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledT *

Input labels & placeholders

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("input_labels_placeholders") public LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String inputLabelsPlaceholders) { this.inputLabelsPlaceholders = @@ -667,7 +667,7 @@ public LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String input *

Links & focused components

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("links_focused_components") public PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedComponents) { this.linksFocusedComponents = @@ -680,7 +680,7 @@ public PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedCom *

Primary button

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary_button") public PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton) { this.primaryButton = Objects.requireNonNull(primaryButton, "primaryButton must not be null"); @@ -692,7 +692,7 @@ public PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton) { *

Primary button label

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary_button_label") public SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButtonLabel) { this.primaryButtonLabel = Objects.requireNonNull(primaryButtonLabel, "primaryButtonLabel must not be null"); @@ -704,7 +704,7 @@ public SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButt *

Secondary button border

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("secondary_button_border") public SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondaryButtonBorder) { this.secondaryButtonBorder = @@ -717,7 +717,7 @@ public SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondary *

Secondary button label

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("secondary_button_label") public SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel) { this.secondaryButtonLabel = @@ -730,7 +730,7 @@ public SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel) { *

Success

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("success") public WidgetBackgroundStage success(@NotNull String success) { this.success = Objects.requireNonNull(success, "success must not be null"); @@ -742,7 +742,7 @@ public WidgetBackgroundStage success(@NotNull String success) { *

Widget background

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("widget_background") public WidgetBorderStage widgetBackground(@NotNull String widgetBackground) { this.widgetBackground = Objects.requireNonNull(widgetBackground, "widgetBackground must not be null"); @@ -754,7 +754,7 @@ public WidgetBorderStage widgetBackground(@NotNull String widgetBackground) { *

Widget border

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("widget_border") public _FinalStage widgetBorder(@NotNull String widgetBorder) { this.widgetBorder = Objects.requireNonNull(widgetBorder, "widgetBorder must not be null"); @@ -765,7 +765,7 @@ public _FinalStage widgetBorder(@NotNull String widgetBorder) { *

Read only background

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage readOnlyBackground(String readOnlyBackground) { this.readOnlyBackground = Optional.ofNullable(readOnlyBackground); return this; @@ -774,20 +774,20 @@ public _FinalStage readOnlyBackground(String readOnlyBackground) { /** *

Read only background

*/ - @java.lang.Override + @Override @JsonSetter(value = "read_only_background", nulls = Nulls.SKIP) public _FinalStage readOnlyBackground(Optional readOnlyBackground) { this.readOnlyBackground = readOnlyBackground; return this; } - @java.lang.Override + @Override public _FinalStage captchaWidgetTheme(BrandingThemeColorsCaptchaWidgetThemeEnum captchaWidgetTheme) { this.captchaWidgetTheme = Optional.ofNullable(captchaWidgetTheme); return this; } - @java.lang.Override + @Override @JsonSetter(value = "captcha_widget_theme", nulls = Nulls.SKIP) public _FinalStage captchaWidgetTheme(Optional captchaWidgetTheme) { this.captchaWidgetTheme = captchaWidgetTheme; @@ -798,7 +798,7 @@ public _FinalStage captchaWidgetTheme(OptionalBase Hover Color

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage baseHoverColor(String baseHoverColor) { this.baseHoverColor = Optional.ofNullable(baseHoverColor); return this; @@ -807,7 +807,7 @@ public _FinalStage baseHoverColor(String baseHoverColor) { /** *

Base Hover Color

*/ - @java.lang.Override + @Override @JsonSetter(value = "base_hover_color", nulls = Nulls.SKIP) public _FinalStage baseHoverColor(Optional baseHoverColor) { this.baseHoverColor = baseHoverColor; @@ -818,7 +818,7 @@ public _FinalStage baseHoverColor(Optional baseHoverColor) { *

Base Focus Color

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage baseFocusColor(String baseFocusColor) { this.baseFocusColor = Optional.ofNullable(baseFocusColor); return this; @@ -827,14 +827,14 @@ public _FinalStage baseFocusColor(String baseFocusColor) { /** *

Base Focus Color

*/ - @java.lang.Override + @Override @JsonSetter(value = "base_focus_color", nulls = Nulls.SKIP) public _FinalStage baseFocusColor(Optional baseFocusColor) { this.baseFocusColor = baseFocusColor; return this; } - @java.lang.Override + @Override public BrandingThemeColors build() { return new BrandingThemeColors( baseFocusColor, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java index 2fe77ddab..346db2e63 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeColorsCaptchaWidgetThemeEnum && this.string.equals(((BrandingThemeColorsCaptchaWidgetThemeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java index 8f8c99d0d..bd8e8f842 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontBodyText && equalTo((BrandingThemeFontBodyText) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontBodyText other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontBodyText other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontBodyText other) { *

Body text bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Body text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontBodyText build() { return new BrandingThemeFontBodyText(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java index 71b1c2355..8e013332b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontButtonsText && equalTo((BrandingThemeFontButtonsText) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontButtonsText other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontButtonsText other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontButtonsText other) { *

Buttons text bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Buttons text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontButtonsText build() { return new BrandingThemeFontButtonsText(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java index b29399903..79ebfcef5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontInputLabels && equalTo((BrandingThemeFontInputLabels) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontInputLabels other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontInputLabels other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontInputLabels other) { *

Input Labels bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Input Labels size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontInputLabels build() { return new BrandingThemeFontInputLabels(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java index 2d0535c8f..26d17262a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontLinks && equalTo((BrandingThemeFontLinks) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontLinks other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontLinks other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontLinks other) { *

Links bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Links size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontLinks build() { return new BrandingThemeFontLinks(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java index ff7178577..60a270d53 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeFontLinksStyleEnum && this.string.equals(((BrandingThemeFontLinksStyleEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java index a665fc7d0..5022d48ce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontSubtitle && equalTo((BrandingThemeFontSubtitle) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontSubtitle other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontSubtitle other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontSubtitle other) { *

Subtitle bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Subtitle size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontSubtitle build() { return new BrandingThemeFontSubtitle(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java index 3e39a7c76..5eeba410b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontTitle && equalTo((BrandingThemeFontTitle) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontTitle other) { return bold == other.bold && size == other.size; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFontTitle other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontTitle other) { *

Title bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Title size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @java.lang.Override + @Override public BrandingThemeFontTitle build() { return new BrandingThemeFontTitle(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java index 675546673..d4c6ade06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java @@ -113,7 +113,7 @@ public BrandingThemeFontTitle getTitle() { return title; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFonts && equalTo((BrandingThemeFonts) other); @@ -136,7 +136,7 @@ private boolean equalTo(BrandingThemeFonts other) { && title.equals(other.title); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.bodyText, @@ -150,7 +150,7 @@ public int hashCode() { this.title); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -242,7 +242,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeFonts other) { bodyText(other.getBodyText()); buttonsText(other.getButtonsText()); @@ -256,14 +256,14 @@ public Builder from(BrandingThemeFonts other) { return this; } - @java.lang.Override + @Override @JsonSetter("body_text") public ButtonsTextStage bodyText(@NotNull BrandingThemeFontBodyText bodyText) { this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("buttons_text") public FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsText) { this.buttonsText = Objects.requireNonNull(buttonsText, "buttonsText must not be null"); @@ -275,28 +275,28 @@ public FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsTex *

Font URL

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("font_url") public InputLabelsStage fontUrl(@NotNull String fontUrl) { this.fontUrl = Objects.requireNonNull(fontUrl, "fontUrl must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("input_labels") public LinksStage inputLabels(@NotNull BrandingThemeFontInputLabels inputLabels) { this.inputLabels = Objects.requireNonNull(inputLabels, "inputLabels must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("links") public LinksStyleStage links(@NotNull BrandingThemeFontLinks links) { this.links = Objects.requireNonNull(links, "links must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("links_style") public ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnum linksStyle) { this.linksStyle = Objects.requireNonNull(linksStyle, "linksStyle must not be null"); @@ -308,28 +308,28 @@ public ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnu *

Reference text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("reference_text_size") public SubtitleStage referenceTextSize(double referenceTextSize) { this.referenceTextSize = referenceTextSize; return this; } - @java.lang.Override + @Override @JsonSetter("subtitle") public TitleStage subtitle(@NotNull BrandingThemeFontSubtitle subtitle) { this.subtitle = Objects.requireNonNull(subtitle, "subtitle must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("title") public _FinalStage title(@NotNull BrandingThemeFontTitle title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @java.lang.Override + @Override public BrandingThemeFonts build() { return new BrandingThemeFonts( bodyText, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java index d3f95c3c6..1b776fede 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java @@ -59,7 +59,7 @@ public BrandingThemePageBackgroundPageLayoutEnum getPageLayout() { return pageLayout; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemePageBackground && equalTo((BrandingThemePageBackground) other); @@ -76,12 +76,12 @@ private boolean equalTo(BrandingThemePageBackground other) { && pageLayout.equals(other.pageLayout); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.backgroundColor, this.backgroundImageUrl, this.pageLayout); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemePageBackground other) { backgroundColor(other.getBackgroundColor()); backgroundImageUrl(other.getBackgroundImageUrl()); @@ -141,7 +141,7 @@ public Builder from(BrandingThemePageBackground other) { *

Background color

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("background_color") public BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor) { this.backgroundColor = Objects.requireNonNull(backgroundColor, "backgroundColor must not be null"); @@ -153,21 +153,21 @@ public BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor) *

Background image url

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("background_image_url") public PageLayoutStage backgroundImageUrl(@NotNull String backgroundImageUrl) { this.backgroundImageUrl = Objects.requireNonNull(backgroundImageUrl, "backgroundImageUrl must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_layout") public _FinalStage pageLayout(@NotNull BrandingThemePageBackgroundPageLayoutEnum pageLayout) { this.pageLayout = Objects.requireNonNull(pageLayout, "pageLayout must not be null"); return this; } - @java.lang.Override + @Override public BrandingThemePageBackground build() { return new BrandingThemePageBackground( backgroundColor, backgroundImageUrl, pageLayout, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java index ac0e87288..a9a23587c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemePageBackgroundPageLayoutEnum && this.string.equals(((BrandingThemePageBackgroundPageLayoutEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java index 199927eab..5119563ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java @@ -77,7 +77,7 @@ public BrandingThemeWidgetSocialButtonsLayoutEnum getSocialButtonsLayout() { return socialButtonsLayout; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeWidget && equalTo((BrandingThemeWidget) other); @@ -96,13 +96,13 @@ private boolean equalTo(BrandingThemeWidget other) { && socialButtonsLayout.equals(other.socialButtonsLayout); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.headerTextAlignment, this.logoHeight, this.logoPosition, this.logoUrl, this.socialButtonsLayout); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +166,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(BrandingThemeWidget other) { headerTextAlignment(other.getHeaderTextAlignment()); logoHeight(other.getLogoHeight()); @@ -176,7 +176,7 @@ public Builder from(BrandingThemeWidget other) { return this; } - @java.lang.Override + @Override @JsonSetter("header_text_alignment") public LogoHeightStage headerTextAlignment( @NotNull BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment) { @@ -190,14 +190,14 @@ public LogoHeightStage headerTextAlignment( *

Logo height

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("logo_height") public LogoPositionStage logoHeight(double logoHeight) { this.logoHeight = logoHeight; return this; } - @java.lang.Override + @Override @JsonSetter("logo_position") public LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum logoPosition) { this.logoPosition = Objects.requireNonNull(logoPosition, "logoPosition must not be null"); @@ -209,14 +209,14 @@ public LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum lo *

Logo url

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("logo_url") public SocialButtonsLayoutStage logoUrl(@NotNull String logoUrl) { this.logoUrl = Objects.requireNonNull(logoUrl, "logoUrl must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("social_buttons_layout") public _FinalStage socialButtonsLayout( @NotNull BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout) { @@ -225,7 +225,7 @@ public _FinalStage socialButtonsLayout( return this; } - @java.lang.Override + @Override public BrandingThemeWidget build() { return new BrandingThemeWidget( headerTextAlignment, logoHeight, logoPosition, logoUrl, socialButtonsLayout, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java index 10afdefac..92dbe2900 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetHeaderTextAlignmentEnum && this.string.equals(((BrandingThemeWidgetHeaderTextAlignmentEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java index bb576015f..9f01327eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetLogoPositionEnum && this.string.equals(((BrandingThemeWidgetLogoPositionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java index 376714c06..6a5e33959 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetSocialButtonsLayoutEnum && this.string.equals(((BrandingThemeWidgetSocialButtonsLayoutEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java index 2ad53e7c4..10011b149 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java @@ -32,13 +32,13 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionAdminNotificationFrequencyEnum @@ -46,7 +46,7 @@ public boolean equals(Object other) { ((BreachedPasswordDetectionAdminNotificationFrequencyEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java index ba87e9cc5..79e99b1cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionMethodEnum && this.string.equals(((BreachedPasswordDetectionMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java index cdb88a9fa..678c81595 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionPreChangePasswordShieldsEnum && this.string.equals(((BreachedPasswordDetectionPreChangePasswordShieldsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java index e53ada446..84b1e505f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java @@ -41,7 +41,7 @@ public Optional> get return shields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionPreChangePasswordStage @@ -57,12 +57,12 @@ private boolean equalTo(BreachedPasswordDetectionPreChangePasswordStage other) { return shields.equals(other.shields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.shields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java index 8cf2aa464..aa5e8a639 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java @@ -26,13 +26,13 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionPreUserRegistrationShieldsEnum @@ -40,7 +40,7 @@ public boolean equals(Object other) { ((BreachedPasswordDetectionPreUserRegistrationShieldsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java index 27b56006d..465fe7092 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java @@ -41,7 +41,7 @@ public Optional> g return shields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionPreUserRegistrationStage @@ -57,12 +57,12 @@ private boolean equalTo(BreachedPasswordDetectionPreUserRegistrationStage other) return shields.equals(other.shields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.shields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java index 4b24df30e..be53e071c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionShieldsEnum && this.string.equals(((BreachedPasswordDetectionShieldsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java index c8fae44dc..6d317b671 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java @@ -45,7 +45,7 @@ public Optional getPreChangePas return preChangePassword; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionStage && equalTo((BreachedPasswordDetectionStage) other); @@ -61,12 +61,12 @@ private boolean equalTo(BreachedPasswordDetectionStage other) { && preChangePassword.equals(other.preChangePassword); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.preUserRegistration, this.preChangePassword); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java new file mode 100644 index 000000000..6b9f08b36 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BulkUpdateAculResponseContent.Builder.class) +public final class BulkUpdateAculResponseContent { + private final List configs; + + private final Map additionalProperties; + + private BulkUpdateAculResponseContent(List configs, Map additionalProperties) { + this.configs = configs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("configs") + public List getConfigs() { + return configs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BulkUpdateAculResponseContent && equalTo((BulkUpdateAculResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BulkUpdateAculResponseContent other) { + return configs.equals(other.configs); + } + + @Override + public int hashCode() { + return Objects.hash(this.configs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List configs = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BulkUpdateAculResponseContent other) { + configs(other.getConfigs()); + return this; + } + + @JsonSetter(value = "configs", nulls = Nulls.SKIP) + public Builder configs(List configs) { + this.configs.clear(); + if (configs != null) { + this.configs.addAll(configs); + } + return this; + } + + public Builder addConfigs(AculConfigsItem configs) { + this.configs.add(configs); + return this; + } + + public Builder addAllConfigs(List configs) { + if (configs != null) { + this.configs.addAll(configs); + } + return this; + } + + public BulkUpdateAculResponseContent build() { + return new BulkUpdateAculResponseContent(configs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java new file mode 100644 index 000000000..595decfa7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ChangePasswordTicketIdentity.Builder.class) +public final class ChangePasswordTicketIdentity { + private final String userId; + + private final String provider; + + private final Optional connectionId; + + private final Map additionalProperties; + + private ChangePasswordTicketIdentity( + String userId, String provider, Optional connectionId, Map additionalProperties) { + this.userId = userId; + this.provider = provider; + this.connectionId = connectionId; + this.additionalProperties = additionalProperties; + } + + /** + * @return user_id of the identity. + */ + @JsonProperty("user_id") + public String getUserId() { + return userId; + } + + @JsonProperty("provider") + public String getProvider() { + return provider; + } + + /** + * @return connection_id of the identity. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ChangePasswordTicketIdentity && equalTo((ChangePasswordTicketIdentity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ChangePasswordTicketIdentity other) { + return userId.equals(other.userId) + && provider.equals(other.provider) + && connectionId.equals(other.connectionId); + } + + @Override + public int hashCode() { + return Objects.hash(this.userId, this.provider, this.connectionId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdStage builder() { + return new Builder(); + } + + public interface UserIdStage { + /** + *

user_id of the identity.

+ */ + ProviderStage userId(@NotNull String userId); + + Builder from(ChangePasswordTicketIdentity other); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull String provider); + } + + public interface _FinalStage { + ChangePasswordTicketIdentity build(); + + /** + *

connection_id of the identity.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdStage, ProviderStage, _FinalStage { + private String userId; + + private String provider; + + private Optional connectionId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ChangePasswordTicketIdentity other) { + userId(other.getUserId()); + provider(other.getProvider()); + connectionId(other.getConnectionId()); + return this; + } + + /** + *

user_id of the identity.

+ *

user_id of the identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("user_id") + public ProviderStage userId(@NotNull String userId) { + this.userId = Objects.requireNonNull(userId, "userId must not be null"); + return this; + } + + @Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull String provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + /** + *

connection_id of the identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

connection_id of the identity.

+ */ + @Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + @Override + public ChangePasswordTicketIdentity build() { + return new ChangePasswordTicketIdentity(userId, provider, connectionId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java index a59f02344..6db02d187 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java @@ -38,6 +38,8 @@ public final class ChangePasswordTicketRequestContent { private final Optional includeEmailInRedirect; + private final Optional identity; + private final Map additionalProperties; private ChangePasswordTicketRequestContent( @@ -50,6 +52,7 @@ private ChangePasswordTicketRequestContent( Optional ttlSec, Optional markEmailAsVerified, Optional includeEmailInRedirect, + Optional identity, Map additionalProperties) { this.resultUrl = resultUrl; this.userId = userId; @@ -60,6 +63,7 @@ private ChangePasswordTicketRequestContent( this.ttlSec = ttlSec; this.markEmailAsVerified = markEmailAsVerified; this.includeEmailInRedirect = includeEmailInRedirect; + this.identity = identity; this.additionalProperties = additionalProperties; } @@ -135,7 +139,12 @@ public Optional getIncludeEmailInRedirect() { return includeEmailInRedirect; } - @java.lang.Override + @JsonProperty("identity") + public Optional getIdentity() { + return identity; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ChangePasswordTicketRequestContent @@ -156,10 +165,11 @@ private boolean equalTo(ChangePasswordTicketRequestContent other) { && email.equals(other.email) && ttlSec.equals(other.ttlSec) && markEmailAsVerified.equals(other.markEmailAsVerified) - && includeEmailInRedirect.equals(other.includeEmailInRedirect); + && includeEmailInRedirect.equals(other.includeEmailInRedirect) + && identity.equals(other.identity); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.resultUrl, @@ -170,10 +180,11 @@ public int hashCode() { this.email, this.ttlSec, this.markEmailAsVerified, - this.includeEmailInRedirect); + this.includeEmailInRedirect, + this.identity); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -202,6 +213,8 @@ public static final class Builder { private Optional includeEmailInRedirect = Optional.empty(); + private Optional identity = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -217,6 +230,7 @@ public Builder from(ChangePasswordTicketRequestContent other) { ttlSec(other.getTtlSec()); markEmailAsVerified(other.getMarkEmailAsVerified()); includeEmailInRedirect(other.getIncludeEmailInRedirect()); + identity(other.getIdentity()); return this; } @@ -346,6 +360,17 @@ public Builder includeEmailInRedirect(Boolean includeEmailInRedirect) { return this; } + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public Builder identity(Optional identity) { + this.identity = identity; + return this; + } + + public Builder identity(ChangePasswordTicketIdentity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + public ChangePasswordTicketRequestContent build() { return new ChangePasswordTicketRequestContent( resultUrl, @@ -357,6 +382,7 @@ public ChangePasswordTicketRequestContent build() { ttlSec, markEmailAsVerified, includeEmailInRedirect, + identity, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java index c9075bfd5..5fca0c4d8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java @@ -36,7 +36,7 @@ public String getTicket() { return ticket; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ChangePasswordTicketResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(ChangePasswordTicketResponseContent other) { return ticket.equals(other.ticket); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ticket); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements TicketStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ChangePasswordTicketResponseContent other) { ticket(other.getTicket()); return this; @@ -99,14 +99,14 @@ public Builder from(ChangePasswordTicketResponseContent other) { *

URL representing the ticket.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("ticket") public _FinalStage ticket(@NotNull String ticket) { this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); return this; } - @java.lang.Override + @Override public ChangePasswordTicketResponseContent build() { return new ChangePasswordTicketResponseContent(ticket, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Client.java b/src/main/java/com/auth0/client/mgmt/types/Client.java index b4f63d8d1..81b3ffa5f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Client.java +++ b/src/main/java/com/auth0/client/mgmt/types/Client.java @@ -36,7 +36,7 @@ public final class Client { private final Optional clientSecret; - private final Optional appType; + private final Optional appType; private final Optional logoUri; @@ -88,6 +88,8 @@ public final class Client { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional> clientMetadata; private final Optional mobile; @@ -102,6 +104,8 @@ public final class Client { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -112,10 +116,20 @@ public final class Client { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; + private final Optional expressConfiguration; + + private final Optional resourceServerIdentifier; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private Client( @@ -125,7 +139,7 @@ private Client( Optional description, Optional global, Optional clientSecret, - Optional appType, + Optional appType, Optional logoUri, Optional isFirstParty, Optional oidcConformant, @@ -151,6 +165,7 @@ private Client( Optional formTemplate, Optional addons, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional> clientMetadata, Optional mobile, Optional initiateLoginUri, @@ -158,13 +173,19 @@ private Client( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, + Optional expressConfiguration, + Optional resourceServerIdentifier, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.clientId = clientId; this.tenant = tenant; @@ -198,6 +219,7 @@ private Client( this.formTemplate = formTemplate; this.addons = addons; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.clientMetadata = clientMetadata; this.mobile = mobile; this.initiateLoginUri = initiateLoginUri; @@ -205,13 +227,19 @@ private Client( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; + this.expressConfiguration = expressConfiguration; + this.resourceServerIdentifier = resourceServerIdentifier; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -263,11 +291,8 @@ public Optional getClientSecret() { return clientSecret; } - /** - * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. - */ @JsonProperty("app_type") - public Optional getAppType() { + public Optional getAppType() { return appType; } @@ -358,7 +383,7 @@ public Optional getOidcLogout() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -458,6 +483,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("client_metadata") public Optional> getClientMetadata() { return clientMetadata; @@ -504,6 +537,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -543,6 +584,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -560,6 +616,24 @@ public Optional getTokenQuota() { return tokenQuota; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -602,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Client && equalTo((Client) other); @@ -646,6 +720,7 @@ private boolean equalTo(Client other) { && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && clientMetadata.equals(other.clientMetadata) && mobile.equals(other.mobile) && initiateLoginUri.equals(other.initiateLoginUri) @@ -653,16 +728,23 @@ private boolean equalTo(Client other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) - && tokenQuota.equals(other.tokenQuota); + && tokenQuota.equals(other.tokenQuota) + && expressConfiguration.equals(other.expressConfiguration) + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientId, @@ -697,6 +779,7 @@ public int hashCode() { this.formTemplate, this.addons, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.clientMetadata, this.mobile, this.initiateLoginUri, @@ -704,16 +787,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, - this.tokenQuota); + this.tokenQuota, + this.expressConfiguration, + this.resourceServerIdentifier, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -736,7 +825,7 @@ public static final class Builder { private Optional clientSecret = Optional.empty(); - private Optional appType = Optional.empty(); + private Optional appType = Optional.empty(); private Optional logoUri = Optional.empty(); @@ -788,6 +877,8 @@ public static final class Builder { private Optional tokenEndpointAuthMethod = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional> clientMetadata = Optional.empty(); private Optional mobile = Optional.empty(); @@ -802,6 +893,8 @@ public static final class Builder { private Optional organizationRequireBehavior = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -812,10 +905,21 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + + private Optional tokenExchange = Optional.empty(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); private Optional tokenQuota = Optional.empty(); + private Optional expressConfiguration = Optional.empty(); + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -854,6 +958,7 @@ public Builder from(Client other) { formTemplate(other.getFormTemplate()); addons(other.getAddons()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); clientMetadata(other.getClientMetadata()); mobile(other.getMobile()); initiateLoginUri(other.getInitiateLoginUri()); @@ -861,13 +966,19 @@ public Builder from(Client other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); + expressConfiguration(other.getExpressConfiguration()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -955,16 +1066,13 @@ public Builder clientSecret(String clientSecret) { return this; } - /** - *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

- */ @JsonSetter(value = "app_type", nulls = Nulls.SKIP) - public Builder appType(Optional appType) { + public Builder appType(Optional appType) { this.appType = appType; return this; } - public Builder appType(String appType) { + public Builder appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } @@ -1139,7 +1247,7 @@ public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1339,6 +1447,20 @@ public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEn return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public Builder clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; @@ -1461,6 +1583,22 @@ public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1564,6 +1702,36 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1609,6 +1777,44 @@ public Builder tokenQuota(TokenQuota tokenQuota) { return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public Client build() { return new Client( clientId, @@ -1643,6 +1849,7 @@ public Client build() { formTemplate, addons, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, clientMetadata, mobile, initiateLoginUri, @@ -1650,13 +1857,19 @@ public Client build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, + expressConfiguration, + resourceServerIdentifier, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java index 828f875ff..762d6a49e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java @@ -63,7 +63,7 @@ public Optional getLifetimeInSeconds() { return lifetimeInSeconds; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAws && equalTo((ClientAddonAws) other); @@ -80,12 +80,12 @@ private boolean equalTo(ClientAddonAws other) { && lifetimeInSeconds.equals(other.lifetimeInSeconds); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.principal, this.role, this.lifetimeInSeconds); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java index c194cdf5d..d8169515c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java @@ -183,7 +183,7 @@ public Optional getContainerList() { return containerList; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAzureBlob && equalTo((ClientAddonAzureBlob) other); @@ -210,7 +210,7 @@ private boolean equalTo(ClientAddonAzureBlob other) { && containerList.equals(other.containerList); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.accountName, @@ -228,7 +228,7 @@ public int hashCode() { this.containerList); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java index c1cc286e7..223f6e04e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java @@ -87,7 +87,7 @@ public Optional getExpiration() { return expiration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAzureSb && equalTo((ClientAddonAzureSb) other); @@ -106,12 +106,12 @@ private boolean equalTo(ClientAddonAzureSb other) { && expiration.equals(other.expiration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.namespace, this.sasKeyName, this.sasKey, this.entityPath, this.expiration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java index d014bbe1d..807c1f8f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java @@ -37,7 +37,7 @@ public Optional getDomain() { return domain; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonEchoSign && equalTo((ClientAddonEchoSign) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonEchoSign other) { return domain.equals(other.domain); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.domain); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java index 9388bb1b4..ff1845230 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java @@ -37,7 +37,7 @@ public Optional getDomain() { return domain; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonEgnyte && equalTo((ClientAddonEgnyte) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonEgnyte other) { return domain.equals(other.domain); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.domain); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java index 12fa19d6b..82db1ae24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java @@ -87,7 +87,7 @@ public Optional getLifetimeInSeconds() { return lifetimeInSeconds; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonFirebase && equalTo((ClientAddonFirebase) other); @@ -106,12 +106,12 @@ private boolean equalTo(ClientAddonFirebase other) { && lifetimeInSeconds.equals(other.lifetimeInSeconds); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.secret, this.privateKeyId, this.privateKey, this.clientEmail, this.lifetimeInSeconds); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java index afd68b398..9e0f08bc7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java @@ -88,7 +88,7 @@ public Optional getExpiration() { return expiration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonLayer && equalTo((ClientAddonLayer) other); @@ -107,12 +107,12 @@ private boolean equalTo(ClientAddonLayer other) { && expiration.equals(other.expiration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.providerId, this.keyId, this.privateKey, this.principal, this.expiration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements ProviderIdStage, KeyIdStage, Privat private Builder() {} - @java.lang.Override + @Override public Builder from(ClientAddonLayer other) { providerId(other.getProviderId()); keyId(other.getKeyId()); @@ -194,7 +194,7 @@ public Builder from(ClientAddonLayer other) { *

Provider ID of your Layer account

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("providerId") public KeyIdStage providerId(@NotNull String providerId) { this.providerId = Objects.requireNonNull(providerId, "providerId must not be null"); @@ -206,7 +206,7 @@ public KeyIdStage providerId(@NotNull String providerId) { *

Authentication Key identifier used to sign the Layer token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("keyId") public PrivateKeyStage keyId(@NotNull String keyId) { this.keyId = Objects.requireNonNull(keyId, "keyId must not be null"); @@ -218,7 +218,7 @@ public PrivateKeyStage keyId(@NotNull String keyId) { *

Private key for signing the Layer token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("privateKey") public _FinalStage privateKey(@NotNull String privateKey) { this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); @@ -229,7 +229,7 @@ public _FinalStage privateKey(@NotNull String privateKey) { *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage expiration(Integer expiration) { this.expiration = Optional.ofNullable(expiration); return this; @@ -238,7 +238,7 @@ public _FinalStage expiration(Integer expiration) { /** *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

*/ - @java.lang.Override + @Override @JsonSetter(value = "expiration", nulls = Nulls.SKIP) public _FinalStage expiration(Optional expiration) { this.expiration = expiration; @@ -249,7 +249,7 @@ public _FinalStage expiration(Optional expiration) { *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage principal(String principal) { this.principal = Optional.ofNullable(principal); return this; @@ -258,14 +258,14 @@ public _FinalStage principal(String principal) { /** *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

*/ - @java.lang.Override + @Override @JsonSetter(value = "principal", nulls = Nulls.SKIP) public _FinalStage principal(Optional principal) { this.principal = principal; return this; } - @java.lang.Override + @Override public ClientAddonLayer build() { return new ClientAddonLayer(providerId, keyId, privateKey, principal, expiration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java index b611cd19e..154b16009 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java @@ -36,7 +36,7 @@ public String getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonMscrm && equalTo((ClientAddonMscrm) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonMscrm other) { return url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ClientAddonMscrm other) { url(other.getUrl()); return this; @@ -98,14 +98,14 @@ public Builder from(ClientAddonMscrm other) { *

Microsoft Dynamics CRM application URL.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @java.lang.Override + @Override public ClientAddonMscrm build() { return new ClientAddonMscrm(url, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java index 0d939500d..73272fbc4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java @@ -37,7 +37,7 @@ public Optional getAccount() { return account; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonNewRelic && equalTo((ClientAddonNewRelic) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonNewRelic other) { return account.equals(other.account); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.account); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java index 5e4fdd6e2..5e59dc08b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java @@ -21,7 +21,7 @@ private ClientAddonOag(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonOag; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java index e88081415..111663b7a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java @@ -49,7 +49,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonOffice365 && equalTo((ClientAddonOffice365) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonOffice365 other) { return domain.equals(other.domain) && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.domain, this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java index 64ed5c72a..559ffc048 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java @@ -36,7 +36,7 @@ public String getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonRms && equalTo((ClientAddonRms) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonRms other) { return url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ClientAddonRms other) { url(other.getUrl()); return this; @@ -98,14 +98,14 @@ public Builder from(ClientAddonRms other) { *

URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @java.lang.Override + @Override public ClientAddonRms build() { return new ClientAddonRms(url, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java index 466a4b580..163ee48a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java @@ -37,7 +37,7 @@ public Optional getEntityId() { return entityId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforce && equalTo((ClientAddonSalesforce) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonSalesforce other) { return entityId.equals(other.entityId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.entityId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java index ad2557fff..23031b2e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java @@ -75,7 +75,7 @@ public Optional getCommunityUrlSection() { return communityUrlSection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforceApi && equalTo((ClientAddonSalesforceApi) other); @@ -93,12 +93,12 @@ private boolean equalTo(ClientAddonSalesforceApi other) { && communityUrlSection.equals(other.communityUrlSection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java index 1f331b506..bb1118283 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java @@ -75,7 +75,7 @@ public Optional getCommunityUrlSection() { return communityUrlSection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforceSandboxApi && equalTo((ClientAddonSalesforceSandboxApi) other); @@ -93,12 +93,12 @@ private boolean equalTo(ClientAddonSalesforceSandboxApi other) { && communityUrlSection.equals(other.communityUrlSection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java index 819d7512f..1169eff4d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java @@ -172,7 +172,7 @@ public Optional getAuthnContextClassRef() { return authnContextClassRef; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSaml && equalTo((ClientAddonSaml) other); @@ -202,7 +202,7 @@ private boolean equalTo(ClientAddonSaml other) { && authnContextClassRef.equals(other.authnContextClassRef); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.mappings, @@ -223,7 +223,7 @@ public int hashCode() { this.authnContextClassRef); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java index 22970031e..60fe3ca05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java @@ -99,7 +99,7 @@ public Optional getNameIdentifierFormat() { return nameIdentifierFormat; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSapapi && equalTo((ClientAddonSapapi) other); @@ -119,7 +119,7 @@ private boolean equalTo(ClientAddonSapapi other) { && nameIdentifierFormat.equals(other.nameIdentifierFormat); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientid, @@ -130,7 +130,7 @@ public int hashCode() { this.nameIdentifierFormat); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java index 074a04fe4..e1cce7083 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java @@ -49,7 +49,7 @@ public Optional getBaseUrl() { return baseUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSentry && equalTo((ClientAddonSentry) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonSentry other) { return orgSlug.equals(other.orgSlug) && baseUrl.equals(other.baseUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.orgSlug, this.baseUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java index 721234415..afb4929dd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java @@ -48,7 +48,7 @@ public Optional getExternalUrl() { return externalUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSharePoint && equalTo((ClientAddonSharePoint) other); @@ -63,12 +63,12 @@ private boolean equalTo(ClientAddonSharePoint other) { return url.equals(other.url) && externalUrl.equals(other.externalUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.url, this.externalUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java index 10ef211d9..5d989d7af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSharePointExternalUrl && equalTo((ClientAddonSharePointExternalUrl) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonSharePointExternalUrl other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializerSlack team name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("team") public _FinalStage team(@NotNull String team) { this.team = Objects.requireNonNull(team, "team must not be null"); return this; } - @java.lang.Override + @Override public ClientAddonSlack build() { return new ClientAddonSlack(team, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java index 006352f1a..02ecf2719 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java @@ -37,7 +37,7 @@ public Optional getAcsurl() { return acsurl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSpringCm && equalTo((ClientAddonSpringCm) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonSpringCm other) { return acsurl.equals(other.acsurl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.acsurl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java index 41c6a40e5..cda17e961 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java @@ -49,7 +49,7 @@ public Optional getVersion() { return version; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSsoIntegration && equalTo((ClientAddonSsoIntegration) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonSsoIntegration other) { return name.equals(other.name) && version.equals(other.version); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.version); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java index f42f26c3c..cbc395a4a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java @@ -37,7 +37,7 @@ public Optional getMasterkey() { return masterkey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonWams && equalTo((ClientAddonWams) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonWams other) { return masterkey.equals(other.masterkey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.masterkey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java index 820a210e3..990970b92 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java @@ -37,7 +37,7 @@ public Optional getAccountName() { return accountName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonZendesk && equalTo((ClientAddonZendesk) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonZendesk other) { return accountName.equals(other.accountName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.accountName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java index b7227fb21..3bf8cfbd3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java @@ -37,7 +37,7 @@ public Optional getAccount() { return account; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonZoom && equalTo((ClientAddonZoom) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonZoom other) { return account.equals(other.account); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.account); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java index ef0a3f3cb..ce36cf7a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java @@ -310,7 +310,7 @@ private OptionalNullable _getOag() { return oag; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddons && equalTo((ClientAddons) other); @@ -354,7 +354,7 @@ private boolean equalTo(ClientAddons other) { && oag.equals(other.oag); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.aws, @@ -389,7 +389,7 @@ public int hashCode() { this.oag); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java index 7a4ebeb98..c1033e91a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java @@ -74,19 +74,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientAppTypeEnum && this.string.equals(((ClientAppTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java index 05ccd5fb2..79f103af5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java @@ -54,7 +54,7 @@ public Optional getSelfSigned return selfSignedTlsClientAuth; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethod && equalTo((ClientAuthenticationMethod) other); @@ -71,12 +71,12 @@ private boolean equalTo(ClientAuthenticationMethod other) { && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java index 458d19414..a444731b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java @@ -39,7 +39,7 @@ public List getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethodSelfSignedTlsClientAuth @@ -55,12 +55,12 @@ private boolean equalTo(ClientAuthenticationMethodSelfSignedTlsClientAuth other) return credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java index bdaff2ec0..8b899649f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java @@ -39,7 +39,7 @@ public List getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethodTlsClientAuth @@ -55,12 +55,12 @@ private boolean equalTo(ClientAuthenticationMethodTlsClientAuth other) { return credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java index 92861c601..f463de39d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientComplianceLevelEnum && this.string.equals(((ClientComplianceLevelEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java index c8b4ccada..5ee297583 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java @@ -54,7 +54,7 @@ public Optional getSelfSigned return selfSignedTlsClientAuth; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientCreateAuthenticationMethod && equalTo((ClientCreateAuthenticationMethod) other); @@ -71,12 +71,12 @@ private boolean equalTo(ClientCreateAuthenticationMethod other) { && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java index 342b3fcfe..666913f75 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientCredential && equalTo((ClientCredential) other); @@ -166,7 +166,7 @@ private boolean equalTo(ClientCredential other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -181,7 +181,7 @@ public int hashCode() { this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java index 93630fa34..df2e43d2f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientCredentialAlgorithmEnum && this.string.equals(((ClientCredentialAlgorithmEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java index ab30a486b..c31cea3a3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientCredentialTypeEnum && this.string.equals(((ClientCredentialTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java index 326ed6259..83ff64bdf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java @@ -51,7 +51,7 @@ public List getFlows() { return flows; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientDefaultOrganization && equalTo((ClientDefaultOrganization) other); @@ -66,12 +66,12 @@ private boolean equalTo(ClientDefaultOrganization other) { return organizationId.equals(other.organizationId) && flows.equals(other.flows); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.organizationId, this.flows); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -113,7 +113,7 @@ public static final class Builder implements OrganizationIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ClientDefaultOrganization other) { organizationId(other.getOrganizationId()); flows(other.getFlows()); @@ -125,7 +125,7 @@ public Builder from(ClientDefaultOrganization other) { *

The default Organization ID to be used

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("organization_id") public _FinalStage organizationId(@NotNull String organizationId) { this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); @@ -136,7 +136,7 @@ public _FinalStage organizationId(@NotNull String organizationId) { *

The default Organization usage

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllFlows(List flows) { if (flows != null) { this.flows.addAll(flows); @@ -148,7 +148,7 @@ public _FinalStage addAllFlows(List flows) { *

The default Organization usage

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addFlows(String flows) { this.flows.add(flows); return this; @@ -157,7 +157,7 @@ public _FinalStage addFlows(String flows) { /** *

The default Organization usage

*/ - @java.lang.Override + @Override @JsonSetter(value = "flows", nulls = Nulls.SKIP) public _FinalStage flows(List flows) { this.flows.clear(); @@ -167,7 +167,7 @@ public _FinalStage flows(List flows) { return this; } - @java.lang.Override + @Override public ClientDefaultOrganization build() { return new ClientDefaultOrganization(organizationId, flows, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java index e50045c53..df177fbb3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java @@ -63,7 +63,7 @@ public Optional getSubject() { return subject; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientEncryptionKey && equalTo((ClientEncryptionKey) other); @@ -78,12 +78,12 @@ private boolean equalTo(ClientEncryptionKey other) { return pub.equals(other.pub) && cert.equals(other.cert) && subject.equals(other.subject); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.pub, this.cert, this.subject); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java index fc5c9c0ca..ea62ec267 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientGrantOrganizationNullableUsageEnum && this.string.equals(((ClientGrantOrganizationNullableUsageEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java index c8b268c8d..0ef92981b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientGrantOrganizationUsageEnum && this.string.equals(((ClientGrantOrganizationUsageEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java index 3e891efcc..6e272fdd6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java @@ -35,6 +35,10 @@ public final class ClientGrantResponseContent { private final Optional isSystem; + private final Optional subjectType; + + private final Optional> authorizationDetailsTypes; + private final Map additionalProperties; private ClientGrantResponseContent( @@ -45,6 +49,8 @@ private ClientGrantResponseContent( Optional organizationUsage, Optional allowAnyOrganization, Optional isSystem, + Optional subjectType, + Optional> authorizationDetailsTypes, Map additionalProperties) { this.id = id; this.clientId = clientId; @@ -53,6 +59,8 @@ private ClientGrantResponseContent( this.organizationUsage = organizationUsage; this.allowAnyOrganization = allowAnyOrganization; this.isSystem = isSystem; + this.subjectType = subjectType; + this.authorizationDetailsTypes = authorizationDetailsTypes; this.additionalProperties = additionalProperties; } @@ -109,7 +117,20 @@ public Optional getIsSystem() { return isSystem; } - @java.lang.Override + @JsonProperty("subject_type") + public Optional getSubjectType() { + return subjectType; + } + + /** + * @return Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonProperty("authorization_details_types") + public Optional> getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientGrantResponseContent && equalTo((ClientGrantResponseContent) other); @@ -127,10 +148,12 @@ private boolean equalTo(ClientGrantResponseContent other) { && scope.equals(other.scope) && organizationUsage.equals(other.organizationUsage) && allowAnyOrganization.equals(other.allowAnyOrganization) - && isSystem.equals(other.isSystem); + && isSystem.equals(other.isSystem) + && subjectType.equals(other.subjectType) + && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -139,10 +162,12 @@ public int hashCode() { this.scope, this.organizationUsage, this.allowAnyOrganization, - this.isSystem); + this.isSystem, + this.subjectType, + this.authorizationDetailsTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,6 +192,10 @@ public static final class Builder { private Optional isSystem = Optional.empty(); + private Optional subjectType = Optional.empty(); + + private Optional> authorizationDetailsTypes = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -180,6 +209,8 @@ public Builder from(ClientGrantResponseContent other) { organizationUsage(other.getOrganizationUsage()); allowAnyOrganization(other.getAllowAnyOrganization()); isSystem(other.getIsSystem()); + subjectType(other.getSubjectType()); + authorizationDetailsTypes(other.getAuthorizationDetailsTypes()); return this; } @@ -278,6 +309,31 @@ public Builder isSystem(Boolean isSystem) { return this; } + @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) + public Builder subjectType(Optional subjectType) { + this.subjectType = subjectType; + return this; + } + + public Builder subjectType(ClientGrantSubjectTypeEnum subjectType) { + this.subjectType = Optional.ofNullable(subjectType); + return this; + } + + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) + public Builder authorizationDetailsTypes(Optional> authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + public Builder authorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); + return this; + } + public ClientGrantResponseContent build() { return new ClientGrantResponseContent( id, @@ -287,6 +343,8 @@ public ClientGrantResponseContent build() { organizationUsage, allowAnyOrganization, isSystem, + subjectType, + authorizationDetailsTypes, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java new file mode 100644 index 000000000..427b71dfe --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientGrantSubjectTypeEnum { + public static final ClientGrantSubjectTypeEnum USER = new ClientGrantSubjectTypeEnum(Value.USER, "user"); + + public static final ClientGrantSubjectTypeEnum CLIENT = new ClientGrantSubjectTypeEnum(Value.CLIENT, "client"); + + private final Value value; + + private final String string; + + ClientGrantSubjectTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientGrantSubjectTypeEnum + && this.string.equals(((ClientGrantSubjectTypeEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case USER: + return visitor.visitUser(); + case CLIENT: + return visitor.visitClient(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientGrantSubjectTypeEnum valueOf(String value) { + switch (value) { + case "user": + return USER; + case "client": + return CLIENT; + default: + return new ClientGrantSubjectTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CLIENT, + + USER, + + UNKNOWN + } + + public interface Visitor { + T visitClient(); + + T visitUser(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java index 8659fa47a..d7ba75a44 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java @@ -69,7 +69,7 @@ public Optional getAlg() { return alg; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientJwtConfiguration && equalTo((ClientJwtConfiguration) other); @@ -87,12 +87,12 @@ private boolean equalTo(ClientJwtConfiguration other) { && alg.equals(other.alg); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.lifetimeInSeconds, this.secretEncoded, this.scopes, this.alg); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java index a62211571..689f0d3c5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java @@ -45,7 +45,7 @@ public Optional getIos() { return ios; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobile && equalTo((ClientMobile) other); @@ -60,12 +60,12 @@ private boolean equalTo(ClientMobile other) { return android.equals(other.android) && ios.equals(other.ios); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.android, this.ios); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java index 94c21d350..9f780db92 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java @@ -52,7 +52,7 @@ public Optional> getSha256CertFingerprints() { return sha256CertFingerprints; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobileAndroid && equalTo((ClientMobileAndroid) other); @@ -68,12 +68,12 @@ private boolean equalTo(ClientMobileAndroid other) { && sha256CertFingerprints.equals(other.sha256CertFingerprints); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.appPackageName, this.sha256CertFingerprints); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java index f8de2b1f8..eefa95b61 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java @@ -49,7 +49,7 @@ public Optional getAppBundleIdentifier() { return appBundleIdentifier; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobileiOs && equalTo((ClientMobileiOs) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientMobileiOs other) { return teamId.equals(other.teamId) && appBundleIdentifier.equals(other.appBundleIdentifier); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.teamId, this.appBundleIdentifier); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java index 1b2dcd6dc..7045fc33a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java @@ -46,7 +46,7 @@ public Optional> getSelectedInit return selectedInitiators; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientOidcBackchannelLogoutInitiators @@ -62,12 +62,12 @@ private boolean equalTo(ClientOidcBackchannelLogoutInitiators other) { return mode.equals(other.mode) && selectedInitiators.equals(other.selectedInitiators); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.mode, this.selectedInitiators); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java index 06bdb72fb..8d8be4b51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java @@ -47,20 +47,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOidcBackchannelLogoutInitiatorsEnum && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java index 37f9ae572..0455a51a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOidcBackchannelLogoutInitiatorsModeEnum && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsModeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java new file mode 100644 index 000000000..ef092acb9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientOidcBackchannelLogoutSessionMetadata.Builder.class) +public final class ClientOidcBackchannelLogoutSessionMetadata { + private final Optional include; + + private final Map additionalProperties; + + private ClientOidcBackchannelLogoutSessionMetadata( + Optional include, Map additionalProperties) { + this.include = include; + this.additionalProperties = additionalProperties; + } + + /** + * @return The include property determines whether session metadata is included in the logout token. + */ + @JsonProperty("include") + public Optional getInclude() { + return include; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientOidcBackchannelLogoutSessionMetadata + && equalTo((ClientOidcBackchannelLogoutSessionMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientOidcBackchannelLogoutSessionMetadata other) { + return include.equals(other.include); + } + + @Override + public int hashCode() { + return Objects.hash(this.include); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional include = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientOidcBackchannelLogoutSessionMetadata other) { + include(other.getInclude()); + return this; + } + + /** + *

The include property determines whether session metadata is included in the logout token.

+ */ + @JsonSetter(value = "include", nulls = Nulls.SKIP) + public Builder include(Optional include) { + this.include = include; + return this; + } + + public Builder include(Boolean include) { + this.include = Optional.ofNullable(include); + return this; + } + + public ClientOidcBackchannelLogoutSessionMetadata build() { + return new ClientOidcBackchannelLogoutSessionMetadata(include, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java index 6795bed38..78e9acfcc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java @@ -3,7 +3,9 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -17,6 +19,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ClientOidcBackchannelLogoutSettings.Builder.class) @@ -25,14 +28,18 @@ public final class ClientOidcBackchannelLogoutSettings { private final Optional backchannelLogoutInitiators; + private final OptionalNullable backchannelLogoutSessionMetadata; + private final Map additionalProperties; private ClientOidcBackchannelLogoutSettings( Optional> backchannelLogoutUrls, Optional backchannelLogoutInitiators, + OptionalNullable backchannelLogoutSessionMetadata, Map additionalProperties) { this.backchannelLogoutUrls = backchannelLogoutUrls; this.backchannelLogoutInitiators = backchannelLogoutInitiators; + this.backchannelLogoutSessionMetadata = backchannelLogoutSessionMetadata; this.additionalProperties = additionalProperties; } @@ -49,7 +56,22 @@ public Optional getBackchannelLogoutIniti return backchannelLogoutInitiators; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("backchannel_logout_session_metadata") + public OptionalNullable getBackchannelLogoutSessionMetadata() { + if (backchannelLogoutSessionMetadata == null) { + return OptionalNullable.absent(); + } + return backchannelLogoutSessionMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("backchannel_logout_session_metadata") + private OptionalNullable _getBackchannelLogoutSessionMetadata() { + return backchannelLogoutSessionMetadata; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientOidcBackchannelLogoutSettings @@ -63,15 +85,17 @@ public Map getAdditionalProperties() { private boolean equalTo(ClientOidcBackchannelLogoutSettings other) { return backchannelLogoutUrls.equals(other.backchannelLogoutUrls) - && backchannelLogoutInitiators.equals(other.backchannelLogoutInitiators); + && backchannelLogoutInitiators.equals(other.backchannelLogoutInitiators) + && backchannelLogoutSessionMetadata.equals(other.backchannelLogoutSessionMetadata); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.backchannelLogoutUrls, this.backchannelLogoutInitiators); + return Objects.hash( + this.backchannelLogoutUrls, this.backchannelLogoutInitiators, this.backchannelLogoutSessionMetadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -86,6 +110,9 @@ public static final class Builder { private Optional backchannelLogoutInitiators = Optional.empty(); + private OptionalNullable backchannelLogoutSessionMetadata = + OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -94,6 +121,7 @@ private Builder() {} public Builder from(ClientOidcBackchannelLogoutSettings other) { backchannelLogoutUrls(other.getBackchannelLogoutUrls()); backchannelLogoutInitiators(other.getBackchannelLogoutInitiators()); + backchannelLogoutSessionMetadata(other.getBackchannelLogoutSessionMetadata()); return this; } @@ -123,9 +151,49 @@ public Builder backchannelLogoutInitiators(ClientOidcBackchannelLogoutInitiators return this; } + @JsonSetter(value = "backchannel_logout_session_metadata", nulls = Nulls.SKIP) + public Builder backchannelLogoutSessionMetadata( + @Nullable + OptionalNullable backchannelLogoutSessionMetadata) { + this.backchannelLogoutSessionMetadata = backchannelLogoutSessionMetadata; + return this; + } + + public Builder backchannelLogoutSessionMetadata( + ClientOidcBackchannelLogoutSessionMetadata backchannelLogoutSessionMetadata) { + this.backchannelLogoutSessionMetadata = OptionalNullable.of(backchannelLogoutSessionMetadata); + return this; + } + + public Builder backchannelLogoutSessionMetadata( + Optional backchannelLogoutSessionMetadata) { + if (backchannelLogoutSessionMetadata.isPresent()) { + this.backchannelLogoutSessionMetadata = OptionalNullable.of(backchannelLogoutSessionMetadata.get()); + } else { + this.backchannelLogoutSessionMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder backchannelLogoutSessionMetadata( + com.auth0.client.mgmt.core.Nullable + backchannelLogoutSessionMetadata) { + if (backchannelLogoutSessionMetadata.isNull()) { + this.backchannelLogoutSessionMetadata = OptionalNullable.ofNull(); + } else if (backchannelLogoutSessionMetadata.isEmpty()) { + this.backchannelLogoutSessionMetadata = OptionalNullable.absent(); + } else { + this.backchannelLogoutSessionMetadata = OptionalNullable.of(backchannelLogoutSessionMetadata.get()); + } + return this; + } + public ClientOidcBackchannelLogoutSettings build() { return new ClientOidcBackchannelLogoutSettings( - backchannelLogoutUrls, backchannelLogoutInitiators, additionalProperties); + backchannelLogoutUrls, + backchannelLogoutInitiators, + backchannelLogoutSessionMetadata, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java new file mode 100644 index 000000000..f3c1b7d50 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ClientOrganizationDiscoveryEnum { + public static final ClientOrganizationDiscoveryEnum EMAIL = + new ClientOrganizationDiscoveryEnum(Value.EMAIL, "email"); + + public static final ClientOrganizationDiscoveryEnum ORGANIZATION_NAME = + new ClientOrganizationDiscoveryEnum(Value.ORGANIZATION_NAME, "organization_name"); + + private final Value value; + + private final String string; + + ClientOrganizationDiscoveryEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ClientOrganizationDiscoveryEnum + && this.string.equals(((ClientOrganizationDiscoveryEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case ORGANIZATION_NAME: + return visitor.visitOrganizationName(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ClientOrganizationDiscoveryEnum valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "organization_name": + return ORGANIZATION_NAME; + default: + return new ClientOrganizationDiscoveryEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EMAIL, + + ORGANIZATION_NAME, + + UNKNOWN + } + + public interface Visitor { + T visitEmail(); + + T visitOrganizationName(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java index 6d1316e7a..a546123c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationRequireBehaviorEnum && this.string.equals(((ClientOrganizationRequireBehaviorEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java index da61ba589..7391d15fd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationRequireBehaviorPatchEnum && this.string.equals(((ClientOrganizationRequireBehaviorPatchEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java index 9acde5a7b..eeddfcf4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationUsageEnum && this.string.equals(((ClientOrganizationUsageEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java index 912b7a224..07dfc44ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationUsagePatchEnum && this.string.equals(((ClientOrganizationUsagePatchEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java index 6b58c59c6..5b73dff9c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java @@ -106,7 +106,7 @@ public Optional getInfiniteIdleTokenLifetime() { return infiniteIdleTokenLifetime; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientRefreshTokenConfiguration && equalTo((ClientRefreshTokenConfiguration) other); @@ -127,7 +127,7 @@ private boolean equalTo(ClientRefreshTokenConfiguration other) { && infiniteIdleTokenLifetime.equals(other.infiniteIdleTokenLifetime); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.rotationType, @@ -139,7 +139,7 @@ public int hashCode() { this.infiniteIdleTokenLifetime); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -218,7 +218,7 @@ public static final class Builder implements RotationTypeStage, ExpirationTypeSt private Builder() {} - @java.lang.Override + @Override public Builder from(ClientRefreshTokenConfiguration other) { rotationType(other.getRotationType()); expirationType(other.getExpirationType()); @@ -230,14 +230,14 @@ public Builder from(ClientRefreshTokenConfiguration other) { return this; } - @java.lang.Override + @Override @JsonSetter("rotation_type") public ExpirationTypeStage rotationType(@NotNull RefreshTokenRotationTypeEnum rotationType) { this.rotationType = Objects.requireNonNull(rotationType, "rotationType must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("expiration_type") public _FinalStage expirationType(@NotNull RefreshTokenExpirationTypeEnum expirationType) { this.expirationType = Objects.requireNonNull(expirationType, "expirationType must not be null"); @@ -248,7 +248,7 @@ public _FinalStage expirationType(@NotNull RefreshTokenExpirationTypeEnum expira *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) { this.infiniteIdleTokenLifetime = Optional.ofNullable(infiniteIdleTokenLifetime); return this; @@ -257,7 +257,7 @@ public _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) /** *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

*/ - @java.lang.Override + @Override @JsonSetter(value = "infinite_idle_token_lifetime", nulls = Nulls.SKIP) public _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleTokenLifetime) { this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; @@ -268,7 +268,7 @@ public _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleToken *

Period (in seconds) for which refresh tokens will remain valid without use

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage idleTokenLifetime(Integer idleTokenLifetime) { this.idleTokenLifetime = Optional.ofNullable(idleTokenLifetime); return this; @@ -277,7 +277,7 @@ public _FinalStage idleTokenLifetime(Integer idleTokenLifetime) { /** *

Period (in seconds) for which refresh tokens will remain valid without use

*/ - @java.lang.Override + @Override @JsonSetter(value = "idle_token_lifetime", nulls = Nulls.SKIP) public _FinalStage idleTokenLifetime(Optional idleTokenLifetime) { this.idleTokenLifetime = idleTokenLifetime; @@ -288,7 +288,7 @@ public _FinalStage idleTokenLifetime(Optional idleTokenLifetime) { *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime) { this.infiniteTokenLifetime = Optional.ofNullable(infiniteTokenLifetime); return this; @@ -297,7 +297,7 @@ public _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime) { /** *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

*/ - @java.lang.Override + @Override @JsonSetter(value = "infinite_token_lifetime", nulls = Nulls.SKIP) public _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime) { this.infiniteTokenLifetime = infiniteTokenLifetime; @@ -308,7 +308,7 @@ public _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime *

Period (in seconds) for which refresh tokens will remain valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tokenLifetime(Integer tokenLifetime) { this.tokenLifetime = Optional.ofNullable(tokenLifetime); return this; @@ -317,7 +317,7 @@ public _FinalStage tokenLifetime(Integer tokenLifetime) { /** *

Period (in seconds) for which refresh tokens will remain valid

*/ - @java.lang.Override + @Override @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) public _FinalStage tokenLifetime(Optional tokenLifetime) { this.tokenLifetime = tokenLifetime; @@ -328,7 +328,7 @@ public _FinalStage tokenLifetime(Optional tokenLifetime) { *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage leeway(Integer leeway) { this.leeway = Optional.ofNullable(leeway); return this; @@ -337,14 +337,14 @@ public _FinalStage leeway(Integer leeway) { /** *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

*/ - @java.lang.Override + @Override @JsonSetter(value = "leeway", nulls = Nulls.SKIP) public _FinalStage leeway(Optional leeway) { this.leeway = leeway; return this; } - @java.lang.Override + @Override public ClientRefreshTokenConfiguration build() { return new ClientRefreshTokenConfiguration( rotationType, diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java index edb3e0e5d..4df1d8801 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientSessionTransferAllowedAuthenticationMethodsEnum && this.string.equals(((ClientSessionTransferAllowedAuthenticationMethodsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java index 8dcdd20f3..abaf658b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java @@ -23,6 +23,8 @@ public final class ClientSessionTransferConfiguration { private final Optional canCreateSessionTransferToken; + private final Optional enforceCascadeRevocation; + private final Optional> allowedAuthenticationMethods; private final Optional enforceDeviceBinding; @@ -31,29 +33,27 @@ public final class ClientSessionTransferConfiguration { private final Optional enforceOnlineRefreshTokens; - private final Optional enforceCascadeRevocation; - private final Map additionalProperties; private ClientSessionTransferConfiguration( Optional canCreateSessionTransferToken, + Optional enforceCascadeRevocation, Optional> allowedAuthenticationMethods, Optional enforceDeviceBinding, Optional allowRefreshToken, Optional enforceOnlineRefreshTokens, - Optional enforceCascadeRevocation, Map additionalProperties) { this.canCreateSessionTransferToken = canCreateSessionTransferToken; + this.enforceCascadeRevocation = enforceCascadeRevocation; this.allowedAuthenticationMethods = allowedAuthenticationMethods; this.enforceDeviceBinding = enforceDeviceBinding; this.allowRefreshToken = allowRefreshToken; this.enforceOnlineRefreshTokens = enforceOnlineRefreshTokens; - this.enforceCascadeRevocation = enforceCascadeRevocation; this.additionalProperties = additionalProperties; } /** - * @return Indicates whether an app can issue a session_token through Token Exchange. If set to 'false', the app will not be able to issue a session_token. + * @return Indicates whether an app can issue a Session Transfer Token through Token Exchange. If set to 'false', the app will not be able to issue a Session Transfer Token. Usually configured in the native application. */ @JsonProperty("can_create_session_transfer_token") public Optional getCanCreateSessionTransferToken() { @@ -61,7 +61,15 @@ public Optional getCanCreateSessionTransferToken() { } /** - * @return Indicates whether an app can create a session from a session_token received via indicated methods. + * @return Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities. Usually configured in the native application. + */ + @JsonProperty("enforce_cascade_revocation") + public Optional getEnforceCascadeRevocation() { + return enforceCascadeRevocation; + } + + /** + * @return Indicates whether an app can create a session from a Session Transfer Token received via indicated methods. Can include cookie and/or query. Usually configured in the web application. */ @JsonProperty("allowed_authentication_methods") public Optional> getAllowedAuthenticationMethods() { @@ -74,7 +82,7 @@ public Optional getEnforceDeviceBinding( } /** - * @return Indicates whether Refresh Tokens are allowed to be issued when authenticating with a session_transfer_token. + * @return Indicates whether Refresh Tokens are allowed to be issued when authenticating with a Session Transfer Token. Usually configured in the web application. */ @JsonProperty("allow_refresh_token") public Optional getAllowRefreshToken() { @@ -82,22 +90,14 @@ public Optional getAllowRefreshToken() { } /** - * @return Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are. + * @return Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are. Usually configured in the web application. */ @JsonProperty("enforce_online_refresh_tokens") public Optional getEnforceOnlineRefreshTokens() { return enforceOnlineRefreshTokens; } - /** - * @return Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities. - */ - @JsonProperty("enforce_cascade_revocation") - public Optional getEnforceCascadeRevocation() { - return enforceCascadeRevocation; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionTransferConfiguration @@ -111,25 +111,25 @@ public Map getAdditionalProperties() { private boolean equalTo(ClientSessionTransferConfiguration other) { return canCreateSessionTransferToken.equals(other.canCreateSessionTransferToken) + && enforceCascadeRevocation.equals(other.enforceCascadeRevocation) && allowedAuthenticationMethods.equals(other.allowedAuthenticationMethods) && enforceDeviceBinding.equals(other.enforceDeviceBinding) && allowRefreshToken.equals(other.allowRefreshToken) - && enforceOnlineRefreshTokens.equals(other.enforceOnlineRefreshTokens) - && enforceCascadeRevocation.equals(other.enforceCascadeRevocation); + && enforceOnlineRefreshTokens.equals(other.enforceOnlineRefreshTokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.canCreateSessionTransferToken, + this.enforceCascadeRevocation, this.allowedAuthenticationMethods, this.enforceDeviceBinding, this.allowRefreshToken, - this.enforceOnlineRefreshTokens, - this.enforceCascadeRevocation); + this.enforceOnlineRefreshTokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -142,6 +142,8 @@ public static Builder builder() { public static final class Builder { private Optional canCreateSessionTransferToken = Optional.empty(); + private Optional enforceCascadeRevocation = Optional.empty(); + private Optional> allowedAuthenticationMethods = Optional.empty(); @@ -151,8 +153,6 @@ public static final class Builder { private Optional enforceOnlineRefreshTokens = Optional.empty(); - private Optional enforceCascadeRevocation = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -160,16 +160,16 @@ private Builder() {} public Builder from(ClientSessionTransferConfiguration other) { canCreateSessionTransferToken(other.getCanCreateSessionTransferToken()); + enforceCascadeRevocation(other.getEnforceCascadeRevocation()); allowedAuthenticationMethods(other.getAllowedAuthenticationMethods()); enforceDeviceBinding(other.getEnforceDeviceBinding()); allowRefreshToken(other.getAllowRefreshToken()); enforceOnlineRefreshTokens(other.getEnforceOnlineRefreshTokens()); - enforceCascadeRevocation(other.getEnforceCascadeRevocation()); return this; } /** - *

Indicates whether an app can issue a session_token through Token Exchange. If set to 'false', the app will not be able to issue a session_token.

+ *

Indicates whether an app can issue a Session Transfer Token through Token Exchange. If set to 'false', the app will not be able to issue a Session Transfer Token. Usually configured in the native application.

*/ @JsonSetter(value = "can_create_session_transfer_token", nulls = Nulls.SKIP) public Builder canCreateSessionTransferToken(Optional canCreateSessionTransferToken) { @@ -183,7 +183,21 @@ public Builder canCreateSessionTransferToken(Boolean canCreateSessionTransferTok } /** - *

Indicates whether an app can create a session from a session_token received via indicated methods.

+ *

Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities. Usually configured in the native application.

+ */ + @JsonSetter(value = "enforce_cascade_revocation", nulls = Nulls.SKIP) + public Builder enforceCascadeRevocation(Optional enforceCascadeRevocation) { + this.enforceCascadeRevocation = enforceCascadeRevocation; + return this; + } + + public Builder enforceCascadeRevocation(Boolean enforceCascadeRevocation) { + this.enforceCascadeRevocation = Optional.ofNullable(enforceCascadeRevocation); + return this; + } + + /** + *

Indicates whether an app can create a session from a Session Transfer Token received via indicated methods. Can include cookie and/or query. Usually configured in the web application.

*/ @JsonSetter(value = "allowed_authentication_methods", nulls = Nulls.SKIP) public Builder allowedAuthenticationMethods( @@ -210,7 +224,7 @@ public Builder enforceDeviceBinding(ClientSessionTransferDeviceBindingEnum enfor } /** - *

Indicates whether Refresh Tokens are allowed to be issued when authenticating with a session_transfer_token.

+ *

Indicates whether Refresh Tokens are allowed to be issued when authenticating with a Session Transfer Token. Usually configured in the web application.

*/ @JsonSetter(value = "allow_refresh_token", nulls = Nulls.SKIP) public Builder allowRefreshToken(Optional allowRefreshToken) { @@ -224,7 +238,7 @@ public Builder allowRefreshToken(Boolean allowRefreshToken) { } /** - *

Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are.

+ *

Indicates whether Refresh Tokens created during a native-to-web session are tied to that session's lifetime. This determines if such refresh tokens should be automatically revoked when their corresponding sessions are. Usually configured in the web application.

*/ @JsonSetter(value = "enforce_online_refresh_tokens", nulls = Nulls.SKIP) public Builder enforceOnlineRefreshTokens(Optional enforceOnlineRefreshTokens) { @@ -237,28 +251,14 @@ public Builder enforceOnlineRefreshTokens(Boolean enforceOnlineRefreshTokens) { return this; } - /** - *

Indicates whether revoking the parent Refresh Token that initiated a Native to Web flow and was used to issue a Session Transfer Token should trigger a cascade revocation affecting its dependent child entities.

- */ - @JsonSetter(value = "enforce_cascade_revocation", nulls = Nulls.SKIP) - public Builder enforceCascadeRevocation(Optional enforceCascadeRevocation) { - this.enforceCascadeRevocation = enforceCascadeRevocation; - return this; - } - - public Builder enforceCascadeRevocation(Boolean enforceCascadeRevocation) { - this.enforceCascadeRevocation = Optional.ofNullable(enforceCascadeRevocation); - return this; - } - public ClientSessionTransferConfiguration build() { return new ClientSessionTransferConfiguration( canCreateSessionTransferToken, + enforceCascadeRevocation, allowedAuthenticationMethods, enforceDeviceBinding, allowRefreshToken, enforceOnlineRefreshTokens, - enforceCascadeRevocation, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java index bb2238bb7..a8fde3854 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientSessionTransferDeviceBindingEnum && this.string.equals(((ClientSessionTransferDeviceBindingEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java index 4a7ed6e2b..3c400251e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java @@ -49,7 +49,7 @@ public Optional> getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSignedRequestObjectWithCredentialId @@ -65,12 +65,12 @@ private boolean equalTo(ClientSignedRequestObjectWithCredentialId other) { return required.equals(other.required) && credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.required, this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java index d95362a49..7ccd3d3ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java @@ -49,7 +49,7 @@ public Optional> getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSignedRequestObjectWithPublicKey @@ -65,12 +65,12 @@ private boolean equalTo(ClientSignedRequestObjectWithPublicKey other) { return required.equals(other.required) && credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.required, this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java index 7b78cfcfc..620bd32c6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java @@ -63,7 +63,7 @@ public Optional getSubject() { return subject; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSigningKey && equalTo((ClientSigningKey) other); @@ -78,12 +78,12 @@ private boolean equalTo(ClientSigningKey other) { return pkcs7.equals(other.pkcs7) && cert.equals(other.cert) && subject.equals(other.subject); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.pkcs7, this.cert, this.subject); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java index 7b1d0adb1..584e75225 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientTokenEndpointAuthMethodEnum && this.string.equals(((ClientTokenEndpointAuthMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java index 22e9d1ba4..d41443bb9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientTokenEndpointAuthMethodOrNullEnum && this.string.equals(((ClientTokenEndpointAuthMethodOrNullEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java new file mode 100644 index 000000000..c467f0c1e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientTokenExchangeConfiguration.Builder.class) +public final class ClientTokenExchangeConfiguration { + private final Optional> allowAnyProfileOfType; + + private final Map additionalProperties; + + private ClientTokenExchangeConfiguration( + Optional> allowAnyProfileOfType, Map additionalProperties) { + this.allowAnyProfileOfType = allowAnyProfileOfType; + this.additionalProperties = additionalProperties; + } + + /** + * @return List the enabled token exchange types for this client. + */ + @JsonProperty("allow_any_profile_of_type") + public Optional> getAllowAnyProfileOfType() { + return allowAnyProfileOfType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientTokenExchangeConfiguration && equalTo((ClientTokenExchangeConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientTokenExchangeConfiguration other) { + return allowAnyProfileOfType.equals(other.allowAnyProfileOfType); + } + + @Override + public int hashCode() { + return Objects.hash(this.allowAnyProfileOfType); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> allowAnyProfileOfType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientTokenExchangeConfiguration other) { + allowAnyProfileOfType(other.getAllowAnyProfileOfType()); + return this; + } + + /** + *

List the enabled token exchange types for this client.

+ */ + @JsonSetter(value = "allow_any_profile_of_type", nulls = Nulls.SKIP) + public Builder allowAnyProfileOfType(Optional> allowAnyProfileOfType) { + this.allowAnyProfileOfType = allowAnyProfileOfType; + return this; + } + + public Builder allowAnyProfileOfType(List allowAnyProfileOfType) { + this.allowAnyProfileOfType = Optional.ofNullable(allowAnyProfileOfType); + return this; + } + + public ClientTokenExchangeConfiguration build() { + return new ClientTokenExchangeConfiguration(allowAnyProfileOfType, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java new file mode 100644 index 000000000..efbebeb36 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientTokenExchangeConfigurationOrNull.Builder.class) +public final class ClientTokenExchangeConfigurationOrNull { + private final Optional> allowAnyProfileOfType; + + private final Map additionalProperties; + + private ClientTokenExchangeConfigurationOrNull( + Optional> allowAnyProfileOfType, Map additionalProperties) { + this.allowAnyProfileOfType = allowAnyProfileOfType; + this.additionalProperties = additionalProperties; + } + + /** + * @return List the enabled token exchange types for this client. + */ + @JsonProperty("allow_any_profile_of_type") + public Optional> getAllowAnyProfileOfType() { + return allowAnyProfileOfType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientTokenExchangeConfigurationOrNull + && equalTo((ClientTokenExchangeConfigurationOrNull) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientTokenExchangeConfigurationOrNull other) { + return allowAnyProfileOfType.equals(other.allowAnyProfileOfType); + } + + @Override + public int hashCode() { + return Objects.hash(this.allowAnyProfileOfType); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> allowAnyProfileOfType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientTokenExchangeConfigurationOrNull other) { + allowAnyProfileOfType(other.getAllowAnyProfileOfType()); + return this; + } + + /** + *

List the enabled token exchange types for this client.

+ */ + @JsonSetter(value = "allow_any_profile_of_type", nulls = Nulls.SKIP) + public Builder allowAnyProfileOfType(Optional> allowAnyProfileOfType) { + this.allowAnyProfileOfType = allowAnyProfileOfType; + return this; + } + + public Builder allowAnyProfileOfType(List allowAnyProfileOfType) { + this.allowAnyProfileOfType = Optional.ofNullable(allowAnyProfileOfType); + return this; + } + + public ClientTokenExchangeConfigurationOrNull build() { + return new ClientTokenExchangeConfigurationOrNull(allowAnyProfileOfType, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java b/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java new file mode 100644 index 000000000..8722013ce --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectedAccount.Builder.class) +public final class ConnectedAccount { + private final String id; + + private final String connection; + + private final String connectionId; + + private final String strategy; + + private final String accessType; + + private final Optional> scopes; + + private final OffsetDateTime createdAt; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private ConnectedAccount( + String id, + String connection, + String connectionId, + String strategy, + String accessType, + Optional> scopes, + OffsetDateTime createdAt, + Optional expiresAt, + Map additionalProperties) { + this.id = id; + this.connection = connection; + this.connectionId = connectionId; + this.strategy = strategy; + this.accessType = accessType; + this.scopes = scopes; + this.createdAt = createdAt; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique identifier for the connected account. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The name of the connection associated with the account. + */ + @JsonProperty("connection") + public String getConnection() { + return connection; + } + + /** + * @return The unique identifier of the connection associated with the account. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return The authentication strategy used by the connection. + */ + @JsonProperty("strategy") + public String getStrategy() { + return strategy; + } + + @JsonProperty("access_type") + public String getAccessType() { + return accessType; + } + + /** + * @return The scopes granted for this connected account. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + /** + * @return ISO 8601 timestamp when the connected account was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return ISO 8601 timestamp when the connected account expires. + */ + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccount && equalTo((ConnectedAccount) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectedAccount other) { + return id.equals(other.id) + && connection.equals(other.connection) + && connectionId.equals(other.connectionId) + && strategy.equals(other.strategy) + && accessType.equals(other.accessType) + && scopes.equals(other.scopes) + && createdAt.equals(other.createdAt) + && expiresAt.equals(other.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.connection, + this.connectionId, + this.strategy, + this.accessType, + this.scopes, + this.createdAt, + this.expiresAt); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The unique identifier for the connected account.

+ */ + ConnectionStage id(@NotNull String id); + + Builder from(ConnectedAccount other); + } + + public interface ConnectionStage { + /** + *

The name of the connection associated with the account.

+ */ + ConnectionIdStage connection(@NotNull String connection); + } + + public interface ConnectionIdStage { + /** + *

The unique identifier of the connection associated with the account.

+ */ + StrategyStage connectionId(@NotNull String connectionId); + } + + public interface StrategyStage { + /** + *

The authentication strategy used by the connection.

+ */ + AccessTypeStage strategy(@NotNull String strategy); + } + + public interface AccessTypeStage { + CreatedAtStage accessType(@NotNull String accessType); + } + + public interface CreatedAtStage { + /** + *

ISO 8601 timestamp when the connected account was created.

+ */ + _FinalStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface _FinalStage { + ConnectedAccount build(); + + /** + *

The scopes granted for this connected account.

+ */ + _FinalStage scopes(Optional> scopes); + + _FinalStage scopes(List scopes); + + /** + *

ISO 8601 timestamp when the connected account expires.

+ */ + _FinalStage expiresAt(Optional expiresAt); + + _FinalStage expiresAt(OffsetDateTime expiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + ConnectionStage, + ConnectionIdStage, + StrategyStage, + AccessTypeStage, + CreatedAtStage, + _FinalStage { + private String id; + + private String connection; + + private String connectionId; + + private String strategy; + + private String accessType; + + private OffsetDateTime createdAt; + + private Optional expiresAt = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectedAccount other) { + id(other.getId()); + connection(other.getConnection()); + connectionId(other.getConnectionId()); + strategy(other.getStrategy()); + accessType(other.getAccessType()); + scopes(other.getScopes()); + createdAt(other.getCreatedAt()); + expiresAt(other.getExpiresAt()); + return this; + } + + /** + *

The unique identifier for the connected account.

+ *

The unique identifier for the connected account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public ConnectionStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The name of the connection associated with the account.

+ *

The name of the connection associated with the account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection") + public ConnectionIdStage connection(@NotNull String connection) { + this.connection = Objects.requireNonNull(connection, "connection must not be null"); + return this; + } + + /** + *

The unique identifier of the connection associated with the account.

+ *

The unique identifier of the connection associated with the account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_id") + public StrategyStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

The authentication strategy used by the connection.

+ *

The authentication strategy used by the connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("strategy") + public AccessTypeStage strategy(@NotNull String strategy) { + this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); + return this; + } + + @Override + @JsonSetter("access_type") + public CreatedAtStage accessType(@NotNull String accessType) { + this.accessType = Objects.requireNonNull(accessType, "accessType must not be null"); + return this; + } + + /** + *

ISO 8601 timestamp when the connected account was created.

+ *

ISO 8601 timestamp when the connected account was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

ISO 8601 timestamp when the connected account expires.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + *

ISO 8601 timestamp when the connected account expires.

+ */ + @Override + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public _FinalStage expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + *

The scopes granted for this connected account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + *

The scopes granted for this connected account.

+ */ + @Override + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public _FinalStage scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + @Override + public ConnectedAccount build() { + return new ConnectedAccount( + id, + connection, + connectionId, + strategy, + accessType, + scopes, + createdAt, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java index e424b5a32..263a96f25 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java @@ -37,7 +37,7 @@ public Optional getActive() { return active; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributeIdentifier && equalTo((ConnectionAttributeIdentifier) other); @@ -52,12 +52,12 @@ private boolean equalTo(ConnectionAttributeIdentifier other) { return active.equals(other.active); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.active); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java new file mode 100644 index 000000000..d29aee217 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAttributeMapOidc.Builder.class) +public final class ConnectionAttributeMapOidc { + private final Optional> attributes; + + private final Optional mappingMode; + + private final Optional userinfoScope; + + private final Map additionalProperties; + + private ConnectionAttributeMapOidc( + Optional> attributes, + Optional mappingMode, + Optional userinfoScope, + Map additionalProperties) { + this.attributes = attributes; + this.mappingMode = mappingMode; + this.userinfoScope = userinfoScope; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("attributes") + public Optional> getAttributes() { + return attributes; + } + + @JsonProperty("mapping_mode") + public Optional getMappingMode() { + return mappingMode; + } + + @JsonProperty("userinfo_scope") + public Optional getUserinfoScope() { + return userinfoScope; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAttributeMapOidc && equalTo((ConnectionAttributeMapOidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAttributeMapOidc other) { + return attributes.equals(other.attributes) + && mappingMode.equals(other.mappingMode) + && userinfoScope.equals(other.userinfoScope); + } + + @Override + public int hashCode() { + return Objects.hash(this.attributes, this.mappingMode, this.userinfoScope); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> attributes = Optional.empty(); + + private Optional mappingMode = Optional.empty(); + + private Optional userinfoScope = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionAttributeMapOidc other) { + attributes(other.getAttributes()); + mappingMode(other.getMappingMode()); + userinfoScope(other.getUserinfoScope()); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional> attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(Map attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + @JsonSetter(value = "mapping_mode", nulls = Nulls.SKIP) + public Builder mappingMode(Optional mappingMode) { + this.mappingMode = mappingMode; + return this; + } + + public Builder mappingMode(ConnectionMappingModeEnumOidc mappingMode) { + this.mappingMode = Optional.ofNullable(mappingMode); + return this; + } + + @JsonSetter(value = "userinfo_scope", nulls = Nulls.SKIP) + public Builder userinfoScope(Optional userinfoScope) { + this.userinfoScope = userinfoScope; + return this; + } + + public Builder userinfoScope(String userinfoScope) { + this.userinfoScope = Optional.ofNullable(userinfoScope); + return this; + } + + public ConnectionAttributeMapOidc build() { + return new ConnectionAttributeMapOidc(attributes, mappingMode, userinfoScope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java new file mode 100644 index 000000000..99bc2a88c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAttributeMapOkta.Builder.class) +public final class ConnectionAttributeMapOkta { + private final Optional> attributes; + + private final Optional mappingMode; + + private final Optional userinfoScope; + + private final Map additionalProperties; + + private ConnectionAttributeMapOkta( + Optional> attributes, + Optional mappingMode, + Optional userinfoScope, + Map additionalProperties) { + this.attributes = attributes; + this.mappingMode = mappingMode; + this.userinfoScope = userinfoScope; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("attributes") + public Optional> getAttributes() { + return attributes; + } + + @JsonProperty("mapping_mode") + public Optional getMappingMode() { + return mappingMode; + } + + @JsonProperty("userinfo_scope") + public Optional getUserinfoScope() { + return userinfoScope; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAttributeMapOkta && equalTo((ConnectionAttributeMapOkta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAttributeMapOkta other) { + return attributes.equals(other.attributes) + && mappingMode.equals(other.mappingMode) + && userinfoScope.equals(other.userinfoScope); + } + + @Override + public int hashCode() { + return Objects.hash(this.attributes, this.mappingMode, this.userinfoScope); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> attributes = Optional.empty(); + + private Optional mappingMode = Optional.empty(); + + private Optional userinfoScope = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionAttributeMapOkta other) { + attributes(other.getAttributes()); + mappingMode(other.getMappingMode()); + userinfoScope(other.getUserinfoScope()); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional> attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(Map attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + @JsonSetter(value = "mapping_mode", nulls = Nulls.SKIP) + public Builder mappingMode(Optional mappingMode) { + this.mappingMode = mappingMode; + return this; + } + + public Builder mappingMode(ConnectionMappingModeEnumOkta mappingMode) { + this.mappingMode = Optional.ofNullable(mappingMode); + return this; + } + + @JsonSetter(value = "userinfo_scope", nulls = Nulls.SKIP) + public Builder userinfoScope(Optional userinfoScope) { + this.userinfoScope = userinfoScope; + return this; + } + + public Builder userinfoScope(String userinfoScope) { + this.userinfoScope = Optional.ofNullable(userinfoScope); + return this; + } + + public ConnectionAttributeMapOkta build() { + return new ConnectionAttributeMapOkta(attributes, mappingMode, userinfoScope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java index 7d4ac34b4..5302bee0b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java @@ -54,7 +54,7 @@ public Optional getUsername() { return username; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributes && equalTo((ConnectionAttributes) other); @@ -69,12 +69,12 @@ private boolean equalTo(ConnectionAttributes other) { return email.equals(other.email) && phoneNumber.equals(other.phoneNumber) && username.equals(other.username); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.email, this.phoneNumber, this.username); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java index bb46df26b..19b982725 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java @@ -45,7 +45,7 @@ public Optional getPasskey() { return passkey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAuthenticationMethods && equalTo((ConnectionAuthenticationMethods) other); @@ -60,12 +60,12 @@ private boolean equalTo(ConnectionAuthenticationMethods other) { return password.equals(other.password) && passkey.equals(other.passkey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.password, this.passkey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java new file mode 100644 index 000000000..7a80e9328 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionAuthenticationPurpose.Builder.class) +public final class ConnectionAuthenticationPurpose { + private final boolean active; + + private final Map additionalProperties; + + private ConnectionAuthenticationPurpose(boolean active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active") + public boolean getActive() { + return active; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionAuthenticationPurpose && equalTo((ConnectionAuthenticationPurpose) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionAuthenticationPurpose other) { + return active == other.active; + } + + @Override + public int hashCode() { + return Objects.hash(this.active); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActiveStage builder() { + return new Builder(); + } + + public interface ActiveStage { + _FinalStage active(boolean active); + + Builder from(ConnectionAuthenticationPurpose other); + } + + public interface _FinalStage { + ConnectionAuthenticationPurpose build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActiveStage, _FinalStage { + private boolean active; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionAuthenticationPurpose other) { + active(other.getActive()); + return this; + } + + @Override + @JsonSetter("active") + public _FinalStage active(boolean active) { + this.active = active; + return this; + } + + @Override + public ConnectionAuthenticationPurpose build() { + return new ConnectionAuthenticationPurpose(active, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java new file mode 100644 index 000000000..8ff9bcdb8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java @@ -0,0 +1,292 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionCommon.Builder.class) +public final class ConnectionCommon implements IConnectionCommon { + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private ConnectionCommon( + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Map additionalProperties) { + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionCommon && equalTo((ConnectionCommon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionCommon other) { + return authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton); + } + + @Override + public int hashCode() { + return Objects.hash( + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionCommon other) { + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + public ConnectionCommon build() { + return new ConnectionCommon( + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java new file mode 100644 index 000000000..e0d9b692b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionConnectedAccountsPurpose.Builder.class) +public final class ConnectionConnectedAccountsPurpose { + private final boolean active; + + private final Optional crossAppAccess; + + private final Map additionalProperties; + + private ConnectionConnectedAccountsPurpose( + boolean active, Optional crossAppAccess, Map additionalProperties) { + this.active = active; + this.crossAppAccess = crossAppAccess; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active") + public boolean getActive() { + return active; + } + + @JsonProperty("cross_app_access") + public Optional getCrossAppAccess() { + return crossAppAccess; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionConnectedAccountsPurpose + && equalTo((ConnectionConnectedAccountsPurpose) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionConnectedAccountsPurpose other) { + return active == other.active && crossAppAccess.equals(other.crossAppAccess); + } + + @Override + public int hashCode() { + return Objects.hash(this.active, this.crossAppAccess); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActiveStage builder() { + return new Builder(); + } + + public interface ActiveStage { + _FinalStage active(boolean active); + + Builder from(ConnectionConnectedAccountsPurpose other); + } + + public interface _FinalStage { + ConnectionConnectedAccountsPurpose build(); + + _FinalStage crossAppAccess(Optional crossAppAccess); + + _FinalStage crossAppAccess(Boolean crossAppAccess); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActiveStage, _FinalStage { + private boolean active; + + private Optional crossAppAccess = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionConnectedAccountsPurpose other) { + active(other.getActive()); + crossAppAccess(other.getCrossAppAccess()); + return this; + } + + @Override + @JsonSetter("active") + public _FinalStage active(boolean active) { + this.active = active; + return this; + } + + @Override + public _FinalStage crossAppAccess(Boolean crossAppAccess) { + this.crossAppAccess = Optional.ofNullable(crossAppAccess); + return this; + } + + @Override + @JsonSetter(value = "cross_app_access", nulls = Nulls.SKIP) + public _FinalStage crossAppAccess(Optional crossAppAccess) { + this.crossAppAccess = crossAppAccess; + return this; + } + + @Override + public ConnectionConnectedAccountsPurpose build() { + return new ConnectionConnectedAccountsPurpose(active, crossAppAccess, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java new file mode 100644 index 000000000..af92221e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionConnectionSettings.Builder.class) +public final class ConnectionConnectionSettings { + private final Optional pkce; + + private final Map additionalProperties; + + private ConnectionConnectionSettings( + Optional pkce, Map additionalProperties) { + this.pkce = pkce; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pkce") + public Optional getPkce() { + return pkce; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionConnectionSettings && equalTo((ConnectionConnectionSettings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionConnectionSettings other) { + return pkce.equals(other.pkce); + } + + @Override + public int hashCode() { + return Objects.hash(this.pkce); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pkce = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionConnectionSettings other) { + pkce(other.getPkce()); + return this; + } + + @JsonSetter(value = "pkce", nulls = Nulls.SKIP) + public Builder pkce(Optional pkce) { + this.pkce = pkce; + return this; + } + + public Builder pkce(ConnectionConnectionSettingsPkceEnum pkce) { + this.pkce = Optional.ofNullable(pkce); + return this; + } + + public ConnectionConnectionSettings build() { + return new ConnectionConnectionSettings(pkce, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java new file mode 100644 index 000000000..a9cc73c0d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionConnectionSettingsPkceEnum { + public static final ConnectionConnectionSettingsPkceEnum AUTO = + new ConnectionConnectionSettingsPkceEnum(Value.AUTO, "auto"); + + public static final ConnectionConnectionSettingsPkceEnum S256 = + new ConnectionConnectionSettingsPkceEnum(Value.S256, "S256"); + + public static final ConnectionConnectionSettingsPkceEnum DISABLED = + new ConnectionConnectionSettingsPkceEnum(Value.DISABLED, "disabled"); + + public static final ConnectionConnectionSettingsPkceEnum PLAIN = + new ConnectionConnectionSettingsPkceEnum(Value.PLAIN, "plain"); + + private final Value value; + + private final String string; + + ConnectionConnectionSettingsPkceEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionConnectionSettingsPkceEnum + && this.string.equals(((ConnectionConnectionSettingsPkceEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case S256: + return visitor.visitS256(); + case DISABLED: + return visitor.visitDisabled(); + case PLAIN: + return visitor.visitPlain(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionConnectionSettingsPkceEnum valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "S256": + return S256; + case "disabled": + return DISABLED; + case "plain": + return PLAIN; + default: + return new ConnectionConnectionSettingsPkceEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + S256, + + PLAIN, + + DISABLED, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitS256(); + + T visitPlain(); + + T visitDisabled(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java index db2a3e6c5..76c0dfe46 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java @@ -108,7 +108,7 @@ public Optional getChangePhoneNumber() { return changePhoneNumber; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionCustomScripts && equalTo((ConnectionCustomScripts) other); @@ -131,7 +131,7 @@ private boolean equalTo(ConnectionCustomScripts other) { && changePhoneNumber.equals(other.changePhoneNumber); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.login, @@ -145,7 +145,7 @@ public int hashCode() { this.changePhoneNumber); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java index a2c363c11..c55104929 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java @@ -36,7 +36,7 @@ public String getClientId() { return clientId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionEnabledClient && equalTo((ConnectionEnabledClient) other); @@ -51,12 +51,12 @@ private boolean equalTo(ConnectionEnabledClient other) { return clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionEnabledClient other) { clientId(other.getClientId()); return this; @@ -98,14 +98,14 @@ public Builder from(ConnectionEnabledClient other) { *

The client id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @java.lang.Override + @Override public ConnectionEnabledClient build() { return new ConnectionEnabledClient(clientId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java new file mode 100644 index 000000000..0e879a5a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionFederatedConnectionsAccessTokens.Builder.class) +public final class ConnectionFederatedConnectionsAccessTokens { + private final Optional active; + + private final Map additionalProperties; + + private ConnectionFederatedConnectionsAccessTokens( + Optional active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + /** + * @return Enables refresh tokens and access tokens collection for federated connections + */ + @JsonProperty("active") + public Optional getActive() { + return active; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionFederatedConnectionsAccessTokens + && equalTo((ConnectionFederatedConnectionsAccessTokens) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionFederatedConnectionsAccessTokens other) { + return active.equals(other.active); + } + + @Override + public int hashCode() { + return Objects.hash(this.active); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional active = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionFederatedConnectionsAccessTokens other) { + active(other.getActive()); + return this; + } + + /** + *

Enables refresh tokens and access tokens collection for federated connections

+ */ + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + public ConnectionFederatedConnectionsAccessTokens build() { + return new ConnectionFederatedConnectionsAccessTokens(active, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java index a1a2c6f79..29ec965f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -37,7 +38,11 @@ public final class ConnectionForList { private final Optional showAsButton; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -50,7 +55,9 @@ private ConnectionForList( Optional> realms, Optional isDomainConnection, Optional showAsButton, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.name = name; this.displayName = displayName; @@ -61,6 +68,8 @@ private ConnectionForList( this.isDomainConnection = isDomainConnection; this.showAsButton = showAsButton; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -126,11 +135,21 @@ public Optional getShowAsButton() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } - @java.lang.Override + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionForList && equalTo((ConnectionForList) other); @@ -150,10 +169,12 @@ private boolean equalTo(ConnectionForList other) { && realms.equals(other.realms) && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -164,10 +185,12 @@ public int hashCode() { this.realms, this.isDomainConnection, this.showAsButton, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -194,7 +217,11 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -211,6 +238,8 @@ public Builder from(ConnectionForList other) { isDomainConnection(other.getIsDomainConnection()); showAsButton(other.getShowAsButton()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -324,16 +353,38 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + public ConnectionForList build() { return new ConnectionForList( name, @@ -345,6 +396,8 @@ public ConnectionForList build() { isDomainConnection, showAsButton, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java index 918f3e7ab..f9cf20c1f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java @@ -76,7 +76,7 @@ public Optional getIsSignupEnabled() { return isSignupEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionForOrganization && equalTo((ConnectionForOrganization) other); @@ -94,12 +94,12 @@ private boolean equalTo(ConnectionForOrganization other) { && isSignupEnabled.equals(other.isSignupEnabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.showAsButton, this.isSignupEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionForOrganization other) { connectionId(other.getConnectionId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -171,7 +171,7 @@ public Builder from(ConnectionForOrganization other) { *

ID of the connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -182,7 +182,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); return this; @@ -191,7 +191,7 @@ public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { /** *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

*/ - @java.lang.Override + @Override @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) public _FinalStage isSignupEnabled(Optional isSignupEnabled) { this.isSignupEnabled = isSignupEnabled; @@ -202,7 +202,7 @@ public _FinalStage isSignupEnabled(Optional isSignupEnabled) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -211,7 +211,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -222,7 +222,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -231,14 +231,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @java.lang.Override + @Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @java.lang.Override + @Override public ConnectionForOrganization build() { return new ConnectionForOrganization( connectionId, assignMembershipOnLogin, showAsButton, isSignupEnabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java index cdde507d1..7fb71d54c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java @@ -88,7 +88,7 @@ public Optional getSecretBase64Encoded() { return secretBase64Encoded; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionGatewayAuthentication && equalTo((ConnectionGatewayAuthentication) other); @@ -107,12 +107,12 @@ private boolean equalTo(ConnectionGatewayAuthentication other) { && secretBase64Encoded.equals(other.secretBase64Encoded); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.method, this.subject, this.audience, this.secret, this.secretBase64Encoded); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements MethodStage, AudienceStage, SecretS private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionGatewayAuthentication other) { method(other.getMethod()); subject(other.getSubject()); @@ -194,7 +194,7 @@ public Builder from(ConnectionGatewayAuthentication other) { *

The Authorization header type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("method") public AudienceStage method(@NotNull String method) { this.method = Objects.requireNonNull(method, "method must not be null"); @@ -206,7 +206,7 @@ public AudienceStage method(@NotNull String method) { *

The audience to be added to the JWT payload.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("audience") public SecretStage audience(@NotNull String audience) { this.audience = Objects.requireNonNull(audience, "audience must not be null"); @@ -218,7 +218,7 @@ public SecretStage audience(@NotNull String audience) { *

The secret to be used for signing tokens.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); @@ -229,7 +229,7 @@ public _FinalStage secret(@NotNull String secret) { *

Set to true if the provided secret is base64 encoded.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage secretBase64Encoded(Boolean secretBase64Encoded) { this.secretBase64Encoded = Optional.ofNullable(secretBase64Encoded); return this; @@ -238,7 +238,7 @@ public _FinalStage secretBase64Encoded(Boolean secretBase64Encoded) { /** *

Set to true if the provided secret is base64 encoded.

*/ - @java.lang.Override + @Override @JsonSetter(value = "secret_base64_encoded", nulls = Nulls.SKIP) public _FinalStage secretBase64Encoded(Optional secretBase64Encoded) { this.secretBase64Encoded = secretBase64Encoded; @@ -249,7 +249,7 @@ public _FinalStage secretBase64Encoded(Optional secretBase64Encoded) { *

The subject to be added to the JWT payload.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = Optional.ofNullable(subject); return this; @@ -258,14 +258,14 @@ public _FinalStage subject(String subject) { /** *

The subject to be added to the JWT payload.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(Optional subject) { this.subject = subject; return this; } - @java.lang.Override + @Override public ConnectionGatewayAuthentication build() { return new ConnectionGatewayAuthentication( method, subject, audience, secret, secretBase64Encoded, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java new file mode 100644 index 000000000..c69223dc8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionIdTokenSignedResponseAlgEnum { + public static final ConnectionIdTokenSignedResponseAlgEnum RS512 = + new ConnectionIdTokenSignedResponseAlgEnum(Value.RS512, "RS512"); + + public static final ConnectionIdTokenSignedResponseAlgEnum PS256 = + new ConnectionIdTokenSignedResponseAlgEnum(Value.PS256, "PS256"); + + public static final ConnectionIdTokenSignedResponseAlgEnum ES256 = + new ConnectionIdTokenSignedResponseAlgEnum(Value.ES256, "ES256"); + + public static final ConnectionIdTokenSignedResponseAlgEnum RS256 = + new ConnectionIdTokenSignedResponseAlgEnum(Value.RS256, "RS256"); + + private final Value value; + + private final String string; + + ConnectionIdTokenSignedResponseAlgEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionIdTokenSignedResponseAlgEnum + && this.string.equals(((ConnectionIdTokenSignedResponseAlgEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case PS256: + return visitor.visitPs256(); + case ES256: + return visitor.visitEs256(); + case RS256: + return visitor.visitRs256(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionIdTokenSignedResponseAlgEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "PS256": + return PS256; + case "ES256": + return ES256; + case "RS256": + return RS256; + default: + return new ConnectionIdTokenSignedResponseAlgEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RS256, + + RS512, + + PS256, + + ES256, + + UNKNOWN + } + + public interface Visitor { + T visitRs256(); + + T visitRs512(); + + T visitPs256(); + + T visitEs256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java index a84b60bf2..12de108cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdentifierPrecedenceEnum && this.string.equals(((ConnectionIdentifierPrecedenceEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java new file mode 100644 index 000000000..03bb87319 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionIdentityApiEnumAzureAd { + public static final ConnectionIdentityApiEnumAzureAd AZURE_ACTIVE_DIRECTORY_V10 = + new ConnectionIdentityApiEnumAzureAd(Value.AZURE_ACTIVE_DIRECTORY_V10, "azure-active-directory-v1.0"); + + public static final ConnectionIdentityApiEnumAzureAd MICROSOFT_IDENTITY_PLATFORM_V20 = + new ConnectionIdentityApiEnumAzureAd( + Value.MICROSOFT_IDENTITY_PLATFORM_V20, "microsoft-identity-platform-v2.0"); + + private final Value value; + + private final String string; + + ConnectionIdentityApiEnumAzureAd(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionIdentityApiEnumAzureAd + && this.string.equals(((ConnectionIdentityApiEnumAzureAd) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AZURE_ACTIVE_DIRECTORY_V10: + return visitor.visitAzureActiveDirectoryV10(); + case MICROSOFT_IDENTITY_PLATFORM_V20: + return visitor.visitMicrosoftIdentityPlatformV20(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionIdentityApiEnumAzureAd valueOf(String value) { + switch (value) { + case "azure-active-directory-v1.0": + return AZURE_ACTIVE_DIRECTORY_V10; + case "microsoft-identity-platform-v2.0": + return MICROSOFT_IDENTITY_PLATFORM_V20; + default: + return new ConnectionIdentityApiEnumAzureAd(Value.UNKNOWN, value); + } + } + + public enum Value { + MICROSOFT_IDENTITY_PLATFORM_V20, + + AZURE_ACTIVE_DIRECTORY_V10, + + UNKNOWN + } + + public interface Visitor { + T visitMicrosoftIdentityPlatformV20(); + + T visitAzureActiveDirectoryV10(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java index cefd9fdc0..269a2f5ea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java @@ -186,20 +186,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdentityProviderEnum && this.string.equals(((ConnectionIdentityProviderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java index 5a806f424..8c1b20651 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java @@ -166,7 +166,7 @@ public Optional getSubjectDn() { return subjectDn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionKey && equalTo((ConnectionKey) other); @@ -192,7 +192,7 @@ private boolean equalTo(ConnectionKey other) { && subjectDn.equals(other.subjectDn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, @@ -209,7 +209,7 @@ public int hashCode() { this.subjectDn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -333,7 +333,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionKey other) { kid(other.getKid()); cert(other.getCert()); @@ -355,7 +355,7 @@ public Builder from(ConnectionKey other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -367,7 +367,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -379,7 +379,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -391,33 +391,33 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; } - @java.lang.Override + @Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; return this; } - @java.lang.Override + @Override public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { this.keyUse = Optional.ofNullable(keyUse); return this; } - @java.lang.Override + @Override @JsonSetter(value = "key_use", nulls = Nulls.SKIP) public _FinalStage keyUse(Optional keyUse) { this.keyUse = keyUse; @@ -428,7 +428,7 @@ public _FinalStage keyUse(Optional keyUse) { *

Signing key algorithm

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage algorithm(String algorithm) { this.algorithm = Optional.ofNullable(algorithm); return this; @@ -437,7 +437,7 @@ public _FinalStage algorithm(String algorithm) { /** *

Signing key algorithm

*/ - @java.lang.Override + @Override @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) public _FinalStage algorithm(Optional algorithm) { this.algorithm = algorithm; @@ -448,7 +448,7 @@ public _FinalStage algorithm(Optional algorithm) { *

The date and time when the key became the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage currentSince(String currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; @@ -457,7 +457,7 @@ public _FinalStage currentSince(String currentSince) { /** *

The date and time when the key became the current key

*/ - @java.lang.Override + @Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -468,7 +468,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -477,7 +477,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @java.lang.Override + @Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -488,7 +488,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -497,7 +497,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @java.lang.Override + @Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -508,7 +508,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -517,7 +517,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @java.lang.Override + @Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -528,7 +528,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pkcs(String pkcs) { this.pkcs = Optional.ofNullable(pkcs); return this; @@ -537,14 +537,14 @@ public _FinalStage pkcs(String pkcs) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) public _FinalStage pkcs(Optional pkcs) { this.pkcs = pkcs; return this; } - @java.lang.Override + @Override public ConnectionKey build() { return new ConnectionKey( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java index 25c229547..b02382b43 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionKeyUseEnum && this.string.equals(((ConnectionKeyUseEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java new file mode 100644 index 000000000..6e78f5700 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionMappingModeEnumOidc { + public static final ConnectionMappingModeEnumOidc USE_MAP = + new ConnectionMappingModeEnumOidc(Value.USE_MAP, "use_map"); + + public static final ConnectionMappingModeEnumOidc BIND_ALL = + new ConnectionMappingModeEnumOidc(Value.BIND_ALL, "bind_all"); + + private final Value value; + + private final String string; + + ConnectionMappingModeEnumOidc(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionMappingModeEnumOidc + && this.string.equals(((ConnectionMappingModeEnumOidc) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case USE_MAP: + return visitor.visitUseMap(); + case BIND_ALL: + return visitor.visitBindAll(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionMappingModeEnumOidc valueOf(String value) { + switch (value) { + case "use_map": + return USE_MAP; + case "bind_all": + return BIND_ALL; + default: + return new ConnectionMappingModeEnumOidc(Value.UNKNOWN, value); + } + } + + public enum Value { + BIND_ALL, + + USE_MAP, + + UNKNOWN + } + + public interface Visitor { + T visitBindAll(); + + T visitUseMap(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java new file mode 100644 index 000000000..593052b3a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionMappingModeEnumOkta { + public static final ConnectionMappingModeEnumOkta USE_MAP = + new ConnectionMappingModeEnumOkta(Value.USE_MAP, "use_map"); + + public static final ConnectionMappingModeEnumOkta BASIC_PROFILE = + new ConnectionMappingModeEnumOkta(Value.BASIC_PROFILE, "basic_profile"); + + private final Value value; + + private final String string; + + ConnectionMappingModeEnumOkta(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionMappingModeEnumOkta + && this.string.equals(((ConnectionMappingModeEnumOkta) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case USE_MAP: + return visitor.visitUseMap(); + case BASIC_PROFILE: + return visitor.visitBasicProfile(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionMappingModeEnumOkta valueOf(String value) { + switch (value) { + case "use_map": + return USE_MAP; + case "basic_profile": + return BASIC_PROFILE; + default: + return new ConnectionMappingModeEnumOkta(Value.UNKNOWN, value); + } + } + + public enum Value { + BASIC_PROFILE, + + USE_MAP, + + UNKNOWN + } + + public interface Visitor { + T visitBasicProfile(); + + T visitUseMap(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java new file mode 100644 index 000000000..e5a55ab76 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionMfa.Builder.class) +public final class ConnectionMfa { + private final Optional active; + + private final Optional returnEnrollSettings; + + private final Map additionalProperties; + + private ConnectionMfa( + Optional active, + Optional returnEnrollSettings, + Map additionalProperties) { + this.active = active; + this.returnEnrollSettings = returnEnrollSettings; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates whether MFA is active for this connection + */ + @JsonProperty("active") + public Optional getActive() { + return active; + } + + /** + * @return Indicates whether to return MFA enrollment settings + */ + @JsonProperty("return_enroll_settings") + public Optional getReturnEnrollSettings() { + return returnEnrollSettings; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionMfa && equalTo((ConnectionMfa) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionMfa other) { + return active.equals(other.active) && returnEnrollSettings.equals(other.returnEnrollSettings); + } + + @Override + public int hashCode() { + return Objects.hash(this.active, this.returnEnrollSettings); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional active = Optional.empty(); + + private Optional returnEnrollSettings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionMfa other) { + active(other.getActive()); + returnEnrollSettings(other.getReturnEnrollSettings()); + return this; + } + + /** + *

Indicates whether MFA is active for this connection

+ */ + @JsonSetter(value = "active", nulls = Nulls.SKIP) + public Builder active(Optional active) { + this.active = active; + return this; + } + + public Builder active(Boolean active) { + this.active = Optional.ofNullable(active); + return this; + } + + /** + *

Indicates whether to return MFA enrollment settings

+ */ + @JsonSetter(value = "return_enroll_settings", nulls = Nulls.SKIP) + public Builder returnEnrollSettings(Optional returnEnrollSettings) { + this.returnEnrollSettings = returnEnrollSettings; + return this; + } + + public Builder returnEnrollSettings(Boolean returnEnrollSettings) { + this.returnEnrollSettings = Optional.ofNullable(returnEnrollSettings); + return this; + } + + public ConnectionMfa build() { + return new ConnectionMfa(active, returnEnrollSettings, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java new file mode 100644 index 000000000..6c06eddd8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java @@ -0,0 +1,574 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsApple.Builder.class) +public final class ConnectionOptionsApple implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final OptionalNullable appSecret; + + private final OptionalNullable clientId; + + private final Optional email; + + private final Optional> freeformScopes; + + private final OptionalNullable kid; + + private final Optional name; + + private final Optional scope; + + private final Optional setUserRootAttributes; + + private final OptionalNullable teamId; + + private final OptionalNullable>> + upstreamParams; + + private final Map additionalProperties; + + private ConnectionOptionsApple( + Optional> nonPersistentAttrs, + OptionalNullable appSecret, + OptionalNullable clientId, + Optional email, + Optional> freeformScopes, + OptionalNullable kid, + Optional name, + Optional scope, + Optional setUserRootAttributes, + OptionalNullable teamId, + OptionalNullable>> upstreamParams, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.appSecret = appSecret; + this.clientId = clientId; + this.email = email; + this.freeformScopes = freeformScopes; + this.kid = kid; + this.name = name; + this.scope = scope; + this.setUserRootAttributes = setUserRootAttributes; + this.teamId = teamId; + this.upstreamParams = upstreamParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + /** + * @return Apple App Secret (must be a PEM) + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("app_secret") + public OptionalNullable getAppSecret() { + if (appSecret == null) { + return OptionalNullable.absent(); + } + return appSecret; + } + + /** + * @return Apple Services ID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + /** + * @return User has the option to obfuscate the email with Apple's relay service + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Array of freeform scopes + */ + @JsonProperty("freeform_scopes") + public Optional> getFreeformScopes() { + return freeformScopes; + } + + /** + * @return Apple Key ID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("kid") + public OptionalNullable getKid() { + if (kid == null) { + return OptionalNullable.absent(); + } + return kid; + } + + /** + * @return Whether to request name from Apple + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Space separated list of scopes + */ + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + /** + * @return Apple Team ID + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("team_id") + public OptionalNullable getTeamId() { + if (teamId == null) { + return OptionalNullable.absent(); + } + return teamId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("app_secret") + private OptionalNullable _getAppSecret() { + return appSecret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("kid") + private OptionalNullable _getKid() { + return kid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("team_id") + private OptionalNullable _getTeamId() { + return teamId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsApple && equalTo((ConnectionOptionsApple) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsApple other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && appSecret.equals(other.appSecret) + && clientId.equals(other.clientId) + && email.equals(other.email) + && freeformScopes.equals(other.freeformScopes) + && kid.equals(other.kid) + && name.equals(other.name) + && scope.equals(other.scope) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && teamId.equals(other.teamId) + && upstreamParams.equals(other.upstreamParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.appSecret, + this.clientId, + this.email, + this.freeformScopes, + this.kid, + this.name, + this.scope, + this.setUserRootAttributes, + this.teamId, + this.upstreamParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private OptionalNullable appSecret = OptionalNullable.absent(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private Optional email = Optional.empty(); + + private Optional> freeformScopes = Optional.empty(); + + private OptionalNullable kid = OptionalNullable.absent(); + + private Optional name = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private OptionalNullable teamId = OptionalNullable.absent(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsApple other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + appSecret(other.getAppSecret()); + clientId(other.getClientId()); + email(other.getEmail()); + freeformScopes(other.getFreeformScopes()); + kid(other.getKid()); + name(other.getName()); + scope(other.getScope()); + setUserRootAttributes(other.getSetUserRootAttributes()); + teamId(other.getTeamId()); + upstreamParams(other.getUpstreamParams()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + /** + *

Apple App Secret (must be a PEM)

+ */ + @JsonSetter(value = "app_secret", nulls = Nulls.SKIP) + public Builder appSecret(@Nullable OptionalNullable appSecret) { + this.appSecret = appSecret; + return this; + } + + public Builder appSecret(String appSecret) { + this.appSecret = OptionalNullable.of(appSecret); + return this; + } + + public Builder appSecret(Optional appSecret) { + if (appSecret.isPresent()) { + this.appSecret = OptionalNullable.of(appSecret.get()); + } else { + this.appSecret = OptionalNullable.absent(); + } + return this; + } + + public Builder appSecret(com.auth0.client.mgmt.core.Nullable appSecret) { + if (appSecret.isNull()) { + this.appSecret = OptionalNullable.ofNull(); + } else if (appSecret.isEmpty()) { + this.appSecret = OptionalNullable.absent(); + } else { + this.appSecret = OptionalNullable.of(appSecret.get()); + } + return this; + } + + /** + *

Apple Services ID

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + /** + *

User has the option to obfuscate the email with Apple's relay service

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(Boolean email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Array of freeform scopes

+ */ + @JsonSetter(value = "freeform_scopes", nulls = Nulls.SKIP) + public Builder freeformScopes(Optional> freeformScopes) { + this.freeformScopes = freeformScopes; + return this; + } + + public Builder freeformScopes(List freeformScopes) { + this.freeformScopes = Optional.ofNullable(freeformScopes); + return this; + } + + /** + *

Apple Key ID

+ */ + @JsonSetter(value = "kid", nulls = Nulls.SKIP) + public Builder kid(@Nullable OptionalNullable kid) { + this.kid = kid; + return this; + } + + public Builder kid(String kid) { + this.kid = OptionalNullable.of(kid); + return this; + } + + public Builder kid(Optional kid) { + if (kid.isPresent()) { + this.kid = OptionalNullable.of(kid.get()); + } else { + this.kid = OptionalNullable.absent(); + } + return this; + } + + public Builder kid(com.auth0.client.mgmt.core.Nullable kid) { + if (kid.isNull()) { + this.kid = OptionalNullable.ofNull(); + } else if (kid.isEmpty()) { + this.kid = OptionalNullable.absent(); + } else { + this.kid = OptionalNullable.of(kid.get()); + } + return this; + } + + /** + *

Whether to request name from Apple

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(Boolean name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Space separated list of scopes

+ */ + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + /** + *

Apple Team ID

+ */ + @JsonSetter(value = "team_id", nulls = Nulls.SKIP) + public Builder teamId(@Nullable OptionalNullable teamId) { + this.teamId = teamId; + return this; + } + + public Builder teamId(String teamId) { + this.teamId = OptionalNullable.of(teamId); + return this; + } + + public Builder teamId(Optional teamId) { + if (teamId.isPresent()) { + this.teamId = OptionalNullable.of(teamId.get()); + } else { + this.teamId = OptionalNullable.absent(); + } + return this; + } + + public Builder teamId(com.auth0.client.mgmt.core.Nullable teamId) { + if (teamId.isNull()) { + this.teamId = OptionalNullable.ofNull(); + } else if (teamId.isEmpty()) { + this.teamId = OptionalNullable.absent(); + } else { + this.teamId = OptionalNullable.of(teamId.get()); + } + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + public ConnectionOptionsApple build() { + return new ConnectionOptionsApple( + nonPersistentAttrs, + appSecret, + clientId, + email, + freeformScopes, + kid, + name, + scope, + setUserRootAttributes, + teamId, + upstreamParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java new file mode 100644 index 000000000..a80e98806 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java @@ -0,0 +1,905 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsAuth0.Builder.class) +public final class ConnectionOptionsAuth0 implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional attributes; + + private final OptionalNullable authenticationMethods; + + private final Optional bruteForceProtection; + + private final Optional> configuration; + + private final Optional customScripts; + + private final Optional disableSelfServiceChangePassword; + + private final Optional disableSignup; + + private final Optional enableScriptContext; + + private final Optional enabledDatabaseCustomization; + + private final Optional importMode; + + private final Optional mfa; + + private final OptionalNullable passkeyOptions; + + private final OptionalNullable passwordPolicy; + + private final OptionalNullable passwordComplexityOptions; + + private final OptionalNullable passwordDictionary; + + private final OptionalNullable passwordHistory; + + private final OptionalNullable passwordNoPersonalInfo; + + private final Optional> precedence; + + private final Optional realmFallback; + + private final Optional requiresUsername; + + private final OptionalNullable validation; + + private final Map additionalProperties; + + private ConnectionOptionsAuth0( + Optional> nonPersistentAttrs, + Optional attributes, + OptionalNullable authenticationMethods, + Optional bruteForceProtection, + Optional> configuration, + Optional customScripts, + Optional disableSelfServiceChangePassword, + Optional disableSignup, + Optional enableScriptContext, + Optional enabledDatabaseCustomization, + Optional importMode, + Optional mfa, + OptionalNullable passkeyOptions, + OptionalNullable passwordPolicy, + OptionalNullable passwordComplexityOptions, + OptionalNullable passwordDictionary, + OptionalNullable passwordHistory, + OptionalNullable passwordNoPersonalInfo, + Optional> precedence, + Optional realmFallback, + Optional requiresUsername, + OptionalNullable validation, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.attributes = attributes; + this.authenticationMethods = authenticationMethods; + this.bruteForceProtection = bruteForceProtection; + this.configuration = configuration; + this.customScripts = customScripts; + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + this.disableSignup = disableSignup; + this.enableScriptContext = enableScriptContext; + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + this.importMode = importMode; + this.mfa = mfa; + this.passkeyOptions = passkeyOptions; + this.passwordPolicy = passwordPolicy; + this.passwordComplexityOptions = passwordComplexityOptions; + this.passwordDictionary = passwordDictionary; + this.passwordHistory = passwordHistory; + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + this.precedence = precedence; + this.realmFallback = realmFallback; + this.requiresUsername = requiresUsername; + this.validation = validation; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("attributes") + public Optional getAttributes() { + return attributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + public OptionalNullable getAuthenticationMethods() { + if (authenticationMethods == null) { + return OptionalNullable.absent(); + } + return authenticationMethods; + } + + @JsonProperty("brute_force_protection") + public Optional getBruteForceProtection() { + return bruteForceProtection; + } + + @JsonProperty("configuration") + public Optional> getConfiguration() { + return configuration; + } + + @JsonProperty("customScripts") + public Optional getCustomScripts() { + return customScripts; + } + + @JsonProperty("disable_self_service_change_password") + public Optional getDisableSelfServiceChangePassword() { + return disableSelfServiceChangePassword; + } + + @JsonProperty("disable_signup") + public Optional getDisableSignup() { + return disableSignup; + } + + @JsonProperty("enable_script_context") + public Optional getEnableScriptContext() { + return enableScriptContext; + } + + @JsonProperty("enabledDatabaseCustomization") + public Optional getEnabledDatabaseCustomization() { + return enabledDatabaseCustomization; + } + + @JsonProperty("import_mode") + public Optional getImportMode() { + return importMode; + } + + @JsonProperty("mfa") + public Optional getMfa() { + return mfa; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + public OptionalNullable getPasskeyOptions() { + if (passkeyOptions == null) { + return OptionalNullable.absent(); + } + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + public OptionalNullable getPasswordPolicy() { + if (passwordPolicy == null) { + return OptionalNullable.absent(); + } + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + public OptionalNullable getPasswordComplexityOptions() { + if (passwordComplexityOptions == null) { + return OptionalNullable.absent(); + } + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + public OptionalNullable getPasswordDictionary() { + if (passwordDictionary == null) { + return OptionalNullable.absent(); + } + return passwordDictionary; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + public OptionalNullable getPasswordHistory() { + if (passwordHistory == null) { + return OptionalNullable.absent(); + } + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + public OptionalNullable getPasswordNoPersonalInfo() { + if (passwordNoPersonalInfo == null) { + return OptionalNullable.absent(); + } + return passwordNoPersonalInfo; + } + + @JsonProperty("precedence") + public Optional> getPrecedence() { + return precedence; + } + + @JsonProperty("realm_fallback") + public Optional getRealmFallback() { + return realmFallback; + } + + @JsonProperty("requires_username") + public Optional getRequiresUsername() { + return requiresUsername; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + public OptionalNullable getValidation() { + if (validation == null) { + return OptionalNullable.absent(); + } + return validation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authentication_methods") + private OptionalNullable _getAuthenticationMethods() { + return authenticationMethods; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passkey_options") + private OptionalNullable _getPasskeyOptions() { + return passkeyOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("passwordPolicy") + private OptionalNullable _getPasswordPolicy() { + return passwordPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_complexity_options") + private OptionalNullable _getPasswordComplexityOptions() { + return passwordComplexityOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_dictionary") + private OptionalNullable _getPasswordDictionary() { + return passwordDictionary; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_history") + private OptionalNullable _getPasswordHistory() { + return passwordHistory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password_no_personal_info") + private OptionalNullable _getPasswordNoPersonalInfo() { + return passwordNoPersonalInfo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("validation") + private OptionalNullable _getValidation() { + return validation; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsAuth0 && equalTo((ConnectionOptionsAuth0) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsAuth0 other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && attributes.equals(other.attributes) + && authenticationMethods.equals(other.authenticationMethods) + && bruteForceProtection.equals(other.bruteForceProtection) + && configuration.equals(other.configuration) + && customScripts.equals(other.customScripts) + && disableSelfServiceChangePassword.equals(other.disableSelfServiceChangePassword) + && disableSignup.equals(other.disableSignup) + && enableScriptContext.equals(other.enableScriptContext) + && enabledDatabaseCustomization.equals(other.enabledDatabaseCustomization) + && importMode.equals(other.importMode) + && mfa.equals(other.mfa) + && passkeyOptions.equals(other.passkeyOptions) + && passwordPolicy.equals(other.passwordPolicy) + && passwordComplexityOptions.equals(other.passwordComplexityOptions) + && passwordDictionary.equals(other.passwordDictionary) + && passwordHistory.equals(other.passwordHistory) + && passwordNoPersonalInfo.equals(other.passwordNoPersonalInfo) + && precedence.equals(other.precedence) + && realmFallback.equals(other.realmFallback) + && requiresUsername.equals(other.requiresUsername) + && validation.equals(other.validation); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.attributes, + this.authenticationMethods, + this.bruteForceProtection, + this.configuration, + this.customScripts, + this.disableSelfServiceChangePassword, + this.disableSignup, + this.enableScriptContext, + this.enabledDatabaseCustomization, + this.importMode, + this.mfa, + this.passkeyOptions, + this.passwordPolicy, + this.passwordComplexityOptions, + this.passwordDictionary, + this.passwordHistory, + this.passwordNoPersonalInfo, + this.precedence, + this.realmFallback, + this.requiresUsername, + this.validation); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional attributes = Optional.empty(); + + private OptionalNullable authenticationMethods = OptionalNullable.absent(); + + private Optional bruteForceProtection = Optional.empty(); + + private Optional> configuration = Optional.empty(); + + private Optional customScripts = Optional.empty(); + + private Optional disableSelfServiceChangePassword = Optional.empty(); + + private Optional disableSignup = Optional.empty(); + + private Optional enableScriptContext = Optional.empty(); + + private Optional enabledDatabaseCustomization = Optional.empty(); + + private Optional importMode = Optional.empty(); + + private Optional mfa = Optional.empty(); + + private OptionalNullable passkeyOptions = OptionalNullable.absent(); + + private OptionalNullable passwordPolicy = OptionalNullable.absent(); + + private OptionalNullable passwordComplexityOptions = + OptionalNullable.absent(); + + private OptionalNullable passwordDictionary = OptionalNullable.absent(); + + private OptionalNullable passwordHistory = OptionalNullable.absent(); + + private OptionalNullable passwordNoPersonalInfo = + OptionalNullable.absent(); + + private Optional> precedence = Optional.empty(); + + private Optional realmFallback = Optional.empty(); + + private Optional requiresUsername = Optional.empty(); + + private OptionalNullable validation = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsAuth0 other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + attributes(other.getAttributes()); + authenticationMethods(other.getAuthenticationMethods()); + bruteForceProtection(other.getBruteForceProtection()); + configuration(other.getConfiguration()); + customScripts(other.getCustomScripts()); + disableSelfServiceChangePassword(other.getDisableSelfServiceChangePassword()); + disableSignup(other.getDisableSignup()); + enableScriptContext(other.getEnableScriptContext()); + enabledDatabaseCustomization(other.getEnabledDatabaseCustomization()); + importMode(other.getImportMode()); + mfa(other.getMfa()); + passkeyOptions(other.getPasskeyOptions()); + passwordPolicy(other.getPasswordPolicy()); + passwordComplexityOptions(other.getPasswordComplexityOptions()); + passwordDictionary(other.getPasswordDictionary()); + passwordHistory(other.getPasswordHistory()); + passwordNoPersonalInfo(other.getPasswordNoPersonalInfo()); + precedence(other.getPrecedence()); + realmFallback(other.getRealmFallback()); + requiresUsername(other.getRequiresUsername()); + validation(other.getValidation()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @JsonSetter(value = "attributes", nulls = Nulls.SKIP) + public Builder attributes(Optional attributes) { + this.attributes = attributes; + return this; + } + + public Builder attributes(ConnectionAttributes attributes) { + this.attributes = Optional.ofNullable(attributes); + return this; + } + + @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) + public Builder authenticationMethods( + @Nullable OptionalNullable authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + public Builder authenticationMethods(ConnectionAuthenticationMethods authenticationMethods) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods); + return this; + } + + public Builder authenticationMethods(Optional authenticationMethods) { + if (authenticationMethods.isPresent()) { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } else { + this.authenticationMethods = OptionalNullable.absent(); + } + return this; + } + + public Builder authenticationMethods( + com.auth0.client.mgmt.core.Nullable authenticationMethods) { + if (authenticationMethods.isNull()) { + this.authenticationMethods = OptionalNullable.ofNull(); + } else if (authenticationMethods.isEmpty()) { + this.authenticationMethods = OptionalNullable.absent(); + } else { + this.authenticationMethods = OptionalNullable.of(authenticationMethods.get()); + } + return this; + } + + @JsonSetter(value = "brute_force_protection", nulls = Nulls.SKIP) + public Builder bruteForceProtection(Optional bruteForceProtection) { + this.bruteForceProtection = bruteForceProtection; + return this; + } + + public Builder bruteForceProtection(Boolean bruteForceProtection) { + this.bruteForceProtection = Optional.ofNullable(bruteForceProtection); + return this; + } + + @JsonSetter(value = "configuration", nulls = Nulls.SKIP) + public Builder configuration(Optional> configuration) { + this.configuration = configuration; + return this; + } + + public Builder configuration(Map configuration) { + this.configuration = Optional.ofNullable(configuration); + return this; + } + + @JsonSetter(value = "customScripts", nulls = Nulls.SKIP) + public Builder customScripts(Optional customScripts) { + this.customScripts = customScripts; + return this; + } + + public Builder customScripts(ConnectionCustomScripts customScripts) { + this.customScripts = Optional.ofNullable(customScripts); + return this; + } + + @JsonSetter(value = "disable_self_service_change_password", nulls = Nulls.SKIP) + public Builder disableSelfServiceChangePassword(Optional disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = disableSelfServiceChangePassword; + return this; + } + + public Builder disableSelfServiceChangePassword(Boolean disableSelfServiceChangePassword) { + this.disableSelfServiceChangePassword = Optional.ofNullable(disableSelfServiceChangePassword); + return this; + } + + @JsonSetter(value = "disable_signup", nulls = Nulls.SKIP) + public Builder disableSignup(Optional disableSignup) { + this.disableSignup = disableSignup; + return this; + } + + public Builder disableSignup(Boolean disableSignup) { + this.disableSignup = Optional.ofNullable(disableSignup); + return this; + } + + @JsonSetter(value = "enable_script_context", nulls = Nulls.SKIP) + public Builder enableScriptContext(Optional enableScriptContext) { + this.enableScriptContext = enableScriptContext; + return this; + } + + public Builder enableScriptContext(Boolean enableScriptContext) { + this.enableScriptContext = Optional.ofNullable(enableScriptContext); + return this; + } + + @JsonSetter(value = "enabledDatabaseCustomization", nulls = Nulls.SKIP) + public Builder enabledDatabaseCustomization(Optional enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = enabledDatabaseCustomization; + return this; + } + + public Builder enabledDatabaseCustomization(Boolean enabledDatabaseCustomization) { + this.enabledDatabaseCustomization = Optional.ofNullable(enabledDatabaseCustomization); + return this; + } + + @JsonSetter(value = "import_mode", nulls = Nulls.SKIP) + public Builder importMode(Optional importMode) { + this.importMode = importMode; + return this; + } + + public Builder importMode(Boolean importMode) { + this.importMode = Optional.ofNullable(importMode); + return this; + } + + @JsonSetter(value = "mfa", nulls = Nulls.SKIP) + public Builder mfa(Optional mfa) { + this.mfa = mfa; + return this; + } + + public Builder mfa(ConnectionMfa mfa) { + this.mfa = Optional.ofNullable(mfa); + return this; + } + + @JsonSetter(value = "passkey_options", nulls = Nulls.SKIP) + public Builder passkeyOptions(@Nullable OptionalNullable passkeyOptions) { + this.passkeyOptions = passkeyOptions; + return this; + } + + public Builder passkeyOptions(ConnectionPasskeyOptions passkeyOptions) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions); + return this; + } + + public Builder passkeyOptions(Optional passkeyOptions) { + if (passkeyOptions.isPresent()) { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } else { + this.passkeyOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passkeyOptions(com.auth0.client.mgmt.core.Nullable passkeyOptions) { + if (passkeyOptions.isNull()) { + this.passkeyOptions = OptionalNullable.ofNull(); + } else if (passkeyOptions.isEmpty()) { + this.passkeyOptions = OptionalNullable.absent(); + } else { + this.passkeyOptions = OptionalNullable.of(passkeyOptions.get()); + } + return this; + } + + @JsonSetter(value = "passwordPolicy", nulls = Nulls.SKIP) + public Builder passwordPolicy(@Nullable OptionalNullable passwordPolicy) { + this.passwordPolicy = passwordPolicy; + return this; + } + + public Builder passwordPolicy(ConnectionPasswordPolicyEnum passwordPolicy) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy); + return this; + } + + public Builder passwordPolicy(Optional passwordPolicy) { + if (passwordPolicy.isPresent()) { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } else { + this.passwordPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordPolicy( + com.auth0.client.mgmt.core.Nullable passwordPolicy) { + if (passwordPolicy.isNull()) { + this.passwordPolicy = OptionalNullable.ofNull(); + } else if (passwordPolicy.isEmpty()) { + this.passwordPolicy = OptionalNullable.absent(); + } else { + this.passwordPolicy = OptionalNullable.of(passwordPolicy.get()); + } + return this; + } + + @JsonSetter(value = "password_complexity_options", nulls = Nulls.SKIP) + public Builder passwordComplexityOptions( + @Nullable OptionalNullable passwordComplexityOptions) { + this.passwordComplexityOptions = passwordComplexityOptions; + return this; + } + + public Builder passwordComplexityOptions(ConnectionPasswordComplexityOptions passwordComplexityOptions) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions); + return this; + } + + public Builder passwordComplexityOptions( + Optional passwordComplexityOptions) { + if (passwordComplexityOptions.isPresent()) { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } else { + this.passwordComplexityOptions = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordComplexityOptions( + com.auth0.client.mgmt.core.Nullable passwordComplexityOptions) { + if (passwordComplexityOptions.isNull()) { + this.passwordComplexityOptions = OptionalNullable.ofNull(); + } else if (passwordComplexityOptions.isEmpty()) { + this.passwordComplexityOptions = OptionalNullable.absent(); + } else { + this.passwordComplexityOptions = OptionalNullable.of(passwordComplexityOptions.get()); + } + return this; + } + + @JsonSetter(value = "password_dictionary", nulls = Nulls.SKIP) + public Builder passwordDictionary( + @Nullable OptionalNullable passwordDictionary) { + this.passwordDictionary = passwordDictionary; + return this; + } + + public Builder passwordDictionary(ConnectionPasswordDictionaryOptions passwordDictionary) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary); + return this; + } + + public Builder passwordDictionary(Optional passwordDictionary) { + if (passwordDictionary.isPresent()) { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } else { + this.passwordDictionary = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordDictionary( + com.auth0.client.mgmt.core.Nullable passwordDictionary) { + if (passwordDictionary.isNull()) { + this.passwordDictionary = OptionalNullable.ofNull(); + } else if (passwordDictionary.isEmpty()) { + this.passwordDictionary = OptionalNullable.absent(); + } else { + this.passwordDictionary = OptionalNullable.of(passwordDictionary.get()); + } + return this; + } + + @JsonSetter(value = "password_history", nulls = Nulls.SKIP) + public Builder passwordHistory(@Nullable OptionalNullable passwordHistory) { + this.passwordHistory = passwordHistory; + return this; + } + + public Builder passwordHistory(ConnectionPasswordHistoryOptions passwordHistory) { + this.passwordHistory = OptionalNullable.of(passwordHistory); + return this; + } + + public Builder passwordHistory(Optional passwordHistory) { + if (passwordHistory.isPresent()) { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } else { + this.passwordHistory = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordHistory( + com.auth0.client.mgmt.core.Nullable passwordHistory) { + if (passwordHistory.isNull()) { + this.passwordHistory = OptionalNullable.ofNull(); + } else if (passwordHistory.isEmpty()) { + this.passwordHistory = OptionalNullable.absent(); + } else { + this.passwordHistory = OptionalNullable.of(passwordHistory.get()); + } + return this; + } + + @JsonSetter(value = "password_no_personal_info", nulls = Nulls.SKIP) + public Builder passwordNoPersonalInfo( + @Nullable OptionalNullable passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = passwordNoPersonalInfo; + return this; + } + + public Builder passwordNoPersonalInfo(ConnectionPasswordNoPersonalInfoOptions passwordNoPersonalInfo) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo); + return this; + } + + public Builder passwordNoPersonalInfo( + Optional passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isPresent()) { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } else { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } + return this; + } + + public Builder passwordNoPersonalInfo( + com.auth0.client.mgmt.core.Nullable passwordNoPersonalInfo) { + if (passwordNoPersonalInfo.isNull()) { + this.passwordNoPersonalInfo = OptionalNullable.ofNull(); + } else if (passwordNoPersonalInfo.isEmpty()) { + this.passwordNoPersonalInfo = OptionalNullable.absent(); + } else { + this.passwordNoPersonalInfo = OptionalNullable.of(passwordNoPersonalInfo.get()); + } + return this; + } + + @JsonSetter(value = "precedence", nulls = Nulls.SKIP) + public Builder precedence(Optional> precedence) { + this.precedence = precedence; + return this; + } + + public Builder precedence(List precedence) { + this.precedence = Optional.ofNullable(precedence); + return this; + } + + @JsonSetter(value = "realm_fallback", nulls = Nulls.SKIP) + public Builder realmFallback(Optional realmFallback) { + this.realmFallback = realmFallback; + return this; + } + + public Builder realmFallback(Boolean realmFallback) { + this.realmFallback = Optional.ofNullable(realmFallback); + return this; + } + + @JsonSetter(value = "requires_username", nulls = Nulls.SKIP) + public Builder requiresUsername(Optional requiresUsername) { + this.requiresUsername = requiresUsername; + return this; + } + + public Builder requiresUsername(Boolean requiresUsername) { + this.requiresUsername = Optional.ofNullable(requiresUsername); + return this; + } + + @JsonSetter(value = "validation", nulls = Nulls.SKIP) + public Builder validation(@Nullable OptionalNullable validation) { + this.validation = validation; + return this; + } + + public Builder validation(ConnectionValidationOptions validation) { + this.validation = OptionalNullable.of(validation); + return this; + } + + public Builder validation(Optional validation) { + if (validation.isPresent()) { + this.validation = OptionalNullable.of(validation.get()); + } else { + this.validation = OptionalNullable.absent(); + } + return this; + } + + public Builder validation(com.auth0.client.mgmt.core.Nullable validation) { + if (validation.isNull()) { + this.validation = OptionalNullable.ofNull(); + } else if (validation.isEmpty()) { + this.validation = OptionalNullable.absent(); + } else { + this.validation = OptionalNullable.of(validation.get()); + } + return this; + } + + public ConnectionOptionsAuth0 build() { + return new ConnectionOptionsAuth0( + nonPersistentAttrs, + attributes, + authenticationMethods, + bruteForceProtection, + configuration, + customScripts, + disableSelfServiceChangePassword, + disableSignup, + enableScriptContext, + enabledDatabaseCustomization, + importMode, + mfa, + passkeyOptions, + passwordPolicy, + passwordComplexityOptions, + passwordDictionary, + passwordHistory, + passwordNoPersonalInfo, + precedence, + realmFallback, + requiresUsername, + validation, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java new file mode 100644 index 000000000..e89da7ecd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java @@ -0,0 +1,2175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsAzureAd.Builder.class) +public final class ConnectionOptionsAzureAd implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional apiEnableUsers; + + private final Optional appDomain; + + private final Optional appId; + + private final Optional basicProfile; + + private final Optional clientId; + + private final Optional clientSecret; + + private final Optional> domainAliases; + + private final Optional extAccessToken; + + private final Optional extAccountEnabled; + + private final Optional extAdmin; + + private final Optional extAgreedTerms; + + private final Optional extAssignedLicenses; + + private final Optional extAssignedPlans; + + private final Optional extAzureId; + + private final Optional extCity; + + private final Optional extCountry; + + private final Optional extDepartment; + + private final Optional extDirSyncEnabled; + + private final Optional extEmail; + + private final Optional extExpiresIn; + + private final Optional extFamilyName; + + private final Optional extFax; + + private final Optional extGivenName; + + private final Optional extGroupIds; + + private final Optional extGroups; + + private final Optional extIsSuspended; + + private final Optional extJobTitle; + + private final Optional extLastSync; + + private final Optional extMobile; + + private final Optional extName; + + private final Optional extNestedGroups; + + private final Optional extNickname; + + private final Optional extOid; + + private final Optional extPhone; + + private final Optional extPhysicalDeliveryOfficeName; + + private final Optional extPostalCode; + + private final Optional extPreferredLanguage; + + private final Optional extProfile; + + private final Optional extProvisionedPlans; + + private final Optional extProvisioningErrors; + + private final Optional extProxyAddresses; + + private final Optional extPuid; + + private final Optional extRefreshToken; + + private final Optional extRoles; + + private final Optional extState; + + private final Optional extStreet; + + private final Optional extTelephoneNumber; + + private final Optional extTenantid; + + private final Optional extUpn; + + private final Optional extUsageLocation; + + private final Optional extUserId; + + private final OptionalNullable federatedConnectionsAccessTokens; + + private final Optional granted; + + private final Optional iconUrl; + + private final Optional identityApi; + + private final Optional maxGroupsToRetrieve; + + private final Optional> scope; + + private final Optional setUserRootAttributes; + + private final Optional shouldTrustEmailVerifiedConnection; + + private final Optional tenantDomain; + + private final Optional tenantId; + + private final Optional> thumbprints; + + private final OptionalNullable>> + upstreamParams; + + private final Optional useWsfed; + + private final Optional useCommonEndpoint; + + private final Optional useridAttribute; + + private final Optional waadProtocol; + + private final Map additionalProperties; + + private ConnectionOptionsAzureAd( + Optional> nonPersistentAttrs, + Optional apiEnableUsers, + Optional appDomain, + Optional appId, + Optional basicProfile, + Optional clientId, + Optional clientSecret, + Optional> domainAliases, + Optional extAccessToken, + Optional extAccountEnabled, + Optional extAdmin, + Optional extAgreedTerms, + Optional extAssignedLicenses, + Optional extAssignedPlans, + Optional extAzureId, + Optional extCity, + Optional extCountry, + Optional extDepartment, + Optional extDirSyncEnabled, + Optional extEmail, + Optional extExpiresIn, + Optional extFamilyName, + Optional extFax, + Optional extGivenName, + Optional extGroupIds, + Optional extGroups, + Optional extIsSuspended, + Optional extJobTitle, + Optional extLastSync, + Optional extMobile, + Optional extName, + Optional extNestedGroups, + Optional extNickname, + Optional extOid, + Optional extPhone, + Optional extPhysicalDeliveryOfficeName, + Optional extPostalCode, + Optional extPreferredLanguage, + Optional extProfile, + Optional extProvisionedPlans, + Optional extProvisioningErrors, + Optional extProxyAddresses, + Optional extPuid, + Optional extRefreshToken, + Optional extRoles, + Optional extState, + Optional extStreet, + Optional extTelephoneNumber, + Optional extTenantid, + Optional extUpn, + Optional extUsageLocation, + Optional extUserId, + OptionalNullable federatedConnectionsAccessTokens, + Optional granted, + Optional iconUrl, + Optional identityApi, + Optional maxGroupsToRetrieve, + Optional> scope, + Optional setUserRootAttributes, + Optional shouldTrustEmailVerifiedConnection, + Optional tenantDomain, + Optional tenantId, + Optional> thumbprints, + OptionalNullable>> upstreamParams, + Optional useWsfed, + Optional useCommonEndpoint, + Optional useridAttribute, + Optional waadProtocol, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.apiEnableUsers = apiEnableUsers; + this.appDomain = appDomain; + this.appId = appId; + this.basicProfile = basicProfile; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.domainAliases = domainAliases; + this.extAccessToken = extAccessToken; + this.extAccountEnabled = extAccountEnabled; + this.extAdmin = extAdmin; + this.extAgreedTerms = extAgreedTerms; + this.extAssignedLicenses = extAssignedLicenses; + this.extAssignedPlans = extAssignedPlans; + this.extAzureId = extAzureId; + this.extCity = extCity; + this.extCountry = extCountry; + this.extDepartment = extDepartment; + this.extDirSyncEnabled = extDirSyncEnabled; + this.extEmail = extEmail; + this.extExpiresIn = extExpiresIn; + this.extFamilyName = extFamilyName; + this.extFax = extFax; + this.extGivenName = extGivenName; + this.extGroupIds = extGroupIds; + this.extGroups = extGroups; + this.extIsSuspended = extIsSuspended; + this.extJobTitle = extJobTitle; + this.extLastSync = extLastSync; + this.extMobile = extMobile; + this.extName = extName; + this.extNestedGroups = extNestedGroups; + this.extNickname = extNickname; + this.extOid = extOid; + this.extPhone = extPhone; + this.extPhysicalDeliveryOfficeName = extPhysicalDeliveryOfficeName; + this.extPostalCode = extPostalCode; + this.extPreferredLanguage = extPreferredLanguage; + this.extProfile = extProfile; + this.extProvisionedPlans = extProvisionedPlans; + this.extProvisioningErrors = extProvisioningErrors; + this.extProxyAddresses = extProxyAddresses; + this.extPuid = extPuid; + this.extRefreshToken = extRefreshToken; + this.extRoles = extRoles; + this.extState = extState; + this.extStreet = extStreet; + this.extTelephoneNumber = extTelephoneNumber; + this.extTenantid = extTenantid; + this.extUpn = extUpn; + this.extUsageLocation = extUsageLocation; + this.extUserId = extUserId; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + this.granted = granted; + this.iconUrl = iconUrl; + this.identityApi = identityApi; + this.maxGroupsToRetrieve = maxGroupsToRetrieve; + this.scope = scope; + this.setUserRootAttributes = setUserRootAttributes; + this.shouldTrustEmailVerifiedConnection = shouldTrustEmailVerifiedConnection; + this.tenantDomain = tenantDomain; + this.tenantId = tenantId; + this.thumbprints = thumbprints; + this.upstreamParams = upstreamParams; + this.useWsfed = useWsfed; + this.useCommonEndpoint = useCommonEndpoint; + this.useridAttribute = useridAttribute; + this.waadProtocol = waadProtocol; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + /** + * @return Enable users API + */ + @JsonProperty("api_enable_users") + public Optional getApiEnableUsers() { + return apiEnableUsers; + } + + @JsonProperty("app_domain") + public Optional getAppDomain() { + return appDomain; + } + + /** + * @return The Application ID URI (App ID URI) for the Azure AD application. Required when using Azure AD v1 with the Resource Owner Password flow. Used to identify the resource being requested in OAuth token requests. + */ + @JsonProperty("app_id") + public Optional getAppId() { + return appId; + } + + /** + * @return Includes basic user profile information from Azure AD (name, email, given_name, family_name). Always enabled and required - represents the minimum profile data retrieved during authentication. + */ + @JsonProperty("basic_profile") + public Optional getBasicProfile() { + return basicProfile; + } + + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("domain_aliases") + public Optional> getDomainAliases() { + return domainAliases; + } + + /** + * @return When false, prevents storing the user's Azure AD access token in the Auth0 user profile. When true (default), the access token is persisted for API access. + */ + @JsonProperty("ext_access_token") + public Optional getExtAccessToken() { + return extAccessToken; + } + + /** + * @return When false, prevents storing whether the user's Azure AD account is enabled. When true (default), the account enabled status is persisted in the user profile. + */ + @JsonProperty("ext_account_enabled") + public Optional getExtAccountEnabled() { + return extAccountEnabled; + } + + @JsonProperty("ext_admin") + public Optional getExtAdmin() { + return extAdmin; + } + + @JsonProperty("ext_agreed_terms") + public Optional getExtAgreedTerms() { + return extAgreedTerms; + } + + /** + * @return When false, prevents storing the list of Microsoft 365/Office 365 licenses assigned to the user. When true (default), license information is persisted in the user profile. + */ + @JsonProperty("ext_assigned_licenses") + public Optional getExtAssignedLicenses() { + return extAssignedLicenses; + } + + @JsonProperty("ext_assigned_plans") + public Optional getExtAssignedPlans() { + return extAssignedPlans; + } + + /** + * @return When false, prevents storing the user's Azure ID identifier. When true (default), the Azure ID is persisted. Note: 'oid' (Object ID) is the recommended unique identifier for single-tenant connections. + */ + @JsonProperty("ext_azure_id") + public Optional getExtAzureId() { + return extAzureId; + } + + /** + * @return When false, prevents storing the user's city from Azure AD. When true (default), city information is persisted in the user profile. + */ + @JsonProperty("ext_city") + public Optional getExtCity() { + return extCity; + } + + /** + * @return When false, prevents storing the user's country from Azure AD. When true (default), country information is persisted in the user profile. + */ + @JsonProperty("ext_country") + public Optional getExtCountry() { + return extCountry; + } + + /** + * @return When false, prevents storing the user's department from Azure AD. When true (default), department information is persisted in the user profile. + */ + @JsonProperty("ext_department") + public Optional getExtDepartment() { + return extDepartment; + } + + /** + * @return When false, prevents storing whether directory synchronization is enabled for the user. When true (default), directory sync status is persisted in the user profile. + */ + @JsonProperty("ext_dir_sync_enabled") + public Optional getExtDirSyncEnabled() { + return extDirSyncEnabled; + } + + /** + * @return When false, prevents storing the user's email address from Azure AD. When true (default), email is persisted in the user profile. + */ + @JsonProperty("ext_email") + public Optional getExtEmail() { + return extEmail; + } + + /** + * @return When false, prevents storing the token expiration time (in seconds). When true (default), expiration information is persisted in the user profile. + */ + @JsonProperty("ext_expires_in") + public Optional getExtExpiresIn() { + return extExpiresIn; + } + + /** + * @return When false, prevents storing the user's family name (last name) from Azure AD. When true (default), family name is persisted in the user profile. + */ + @JsonProperty("ext_family_name") + public Optional getExtFamilyName() { + return extFamilyName; + } + + /** + * @return When false, prevents storing the user's fax number from Azure AD. When true (default), fax information is persisted in the user profile. + */ + @JsonProperty("ext_fax") + public Optional getExtFax() { + return extFax; + } + + /** + * @return When false, prevents storing the user's given name (first name) from Azure AD. When true (default), given name is persisted in the user profile. + */ + @JsonProperty("ext_given_name") + public Optional getExtGivenName() { + return extGivenName; + } + + /** + * @return When false, prevents storing the list of Azure AD group IDs the user is a member of. When true (default), group membership IDs are persisted. See ext_groups for retrieving group details. + */ + @JsonProperty("ext_group_ids") + public Optional getExtGroupIds() { + return extGroupIds; + } + + @JsonProperty("ext_groups") + public Optional getExtGroups() { + return extGroups; + } + + @JsonProperty("ext_is_suspended") + public Optional getExtIsSuspended() { + return extIsSuspended; + } + + /** + * @return When false, prevents storing the user's job title from Azure AD. When true (default), job title information is persisted in the user profile. + */ + @JsonProperty("ext_job_title") + public Optional getExtJobTitle() { + return extJobTitle; + } + + /** + * @return When false, prevents storing the timestamp of the last directory synchronization. When true (default), the last sync date is persisted in the user profile. + */ + @JsonProperty("ext_last_sync") + public Optional getExtLastSync() { + return extLastSync; + } + + /** + * @return When false, prevents storing the user's mobile phone number from Azure AD. When true (default), mobile number is persisted in the user profile. + */ + @JsonProperty("ext_mobile") + public Optional getExtMobile() { + return extMobile; + } + + /** + * @return When false, prevents storing the user's full name from Azure AD. When true (default), full name is persisted in the user profile. + */ + @JsonProperty("ext_name") + public Optional getExtName() { + return extName; + } + + /** + * @return When true, stores all groups the user is member of, including transitive group memberships (groups within groups). When false (default), only direct group memberships are included. + */ + @JsonProperty("ext_nested_groups") + public Optional getExtNestedGroups() { + return extNestedGroups; + } + + /** + * @return When false, prevents storing the user's nickname or display name from Azure AD. When true (default), nickname is persisted in the user profile. + */ + @JsonProperty("ext_nickname") + public Optional getExtNickname() { + return extNickname; + } + + /** + * @return When false, prevents storing the user's Object ID (oid) from Azure AD. When true (default), the oid is persisted. Note: 'oid' is the recommended unique identifier for single-tenant connections and required for SCIM. + */ + @JsonProperty("ext_oid") + public Optional getExtOid() { + return extOid; + } + + /** + * @return When false, prevents storing the user's phone number from Azure AD. When true (default), phone number is persisted in the user profile. + */ + @JsonProperty("ext_phone") + public Optional getExtPhone() { + return extPhone; + } + + /** + * @return When false, prevents storing the user's office location from Azure AD. When true (default), office location is persisted in the user profile. + */ + @JsonProperty("ext_physical_delivery_office_name") + public Optional getExtPhysicalDeliveryOfficeName() { + return extPhysicalDeliveryOfficeName; + } + + /** + * @return When false, prevents storing the user's postal code from Azure AD. When true (default), postal code is persisted in the user profile. + */ + @JsonProperty("ext_postal_code") + public Optional getExtPostalCode() { + return extPostalCode; + } + + /** + * @return When false, prevents storing the user's preferred language from Azure AD. When true (default), language preference is persisted in the user profile. + */ + @JsonProperty("ext_preferred_language") + public Optional getExtPreferredLanguage() { + return extPreferredLanguage; + } + + @JsonProperty("ext_profile") + public Optional getExtProfile() { + return extProfile; + } + + /** + * @return When false, prevents storing the list of service plans provisioned to the user. When true (default), provisioned plans are persisted in the user profile. + */ + @JsonProperty("ext_provisioned_plans") + public Optional getExtProvisionedPlans() { + return extProvisionedPlans; + } + + /** + * @return When false, prevents storing provisioning errors that occurred during synchronization. When true (default), error information is persisted. Useful for troubleshooting sync issues. + */ + @JsonProperty("ext_provisioning_errors") + public Optional getExtProvisioningErrors() { + return extProvisioningErrors; + } + + /** + * @return When false, prevents storing all proxy email addresses (email aliases) for the user. When true (default), proxy addresses are persisted in the user profile. + */ + @JsonProperty("ext_proxy_addresses") + public Optional getExtProxyAddresses() { + return extProxyAddresses; + } + + /** + * @return When false, prevents storing the user's Passport User ID (puid). When true (default), puid is persisted in the user profile. Legacy attribute. + */ + @JsonProperty("ext_puid") + public Optional getExtPuid() { + return extPuid; + } + + /** + * @return When false, prevents storing the Azure AD refresh token. When true (default), the refresh token is persisted for offline access. Required for token refresh in long-lived applications. + */ + @JsonProperty("ext_refresh_token") + public Optional getExtRefreshToken() { + return extRefreshToken; + } + + /** + * @return When false, prevents storing Azure AD application roles assigned to the user. When true (default), role information is persisted. Useful for RBAC in applications. + */ + @JsonProperty("ext_roles") + public Optional getExtRoles() { + return extRoles; + } + + /** + * @return When false, prevents storing the user's state (province/region) from Azure AD. When true (default), state information is persisted in the user profile. + */ + @JsonProperty("ext_state") + public Optional getExtState() { + return extState; + } + + /** + * @return When false, prevents storing the user's street address from Azure AD. When true (default), street address is persisted in the user profile. + */ + @JsonProperty("ext_street") + public Optional getExtStreet() { + return extStreet; + } + + /** + * @return When false, prevents storing the user's telephone number from Azure AD. When true (default), telephone number is persisted in the user profile. + */ + @JsonProperty("ext_telephoneNumber") + public Optional getExtTelephoneNumber() { + return extTelephoneNumber; + } + + /** + * @return When false, prevents storing the user's Azure AD tenant ID. When true (default), tenant ID is persisted. Useful for identifying which Azure AD organization the user belongs to. + */ + @JsonProperty("ext_tenantid") + public Optional getExtTenantid() { + return extTenantid; + } + + /** + * @return When false, prevents storing the user's User Principal Name (UPN) from Azure AD. When true (default), UPN is persisted. UPN is the user's logon name (e.g., user@contoso.com). + */ + @JsonProperty("ext_upn") + public Optional getExtUpn() { + return extUpn; + } + + /** + * @return When false, prevents storing the user's usage location for license assignment. When true (default), usage location is persisted in the user profile. + */ + @JsonProperty("ext_usage_location") + public Optional getExtUsageLocation() { + return extUsageLocation; + } + + /** + * @return When false, prevents storing an alternative user ID. When true (default), this user ID is persisted in the user profile. + */ + @JsonProperty("ext_user_id") + public Optional getExtUserId() { + return extUserId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + + /** + * @return Indicates whether admin consent has been granted for the required Azure AD permissions. Read-only status field managed by Auth0 during the OAuth authorization flow. + */ + @JsonProperty("granted") + public Optional getGranted() { + return granted; + } + + @JsonProperty("icon_url") + public Optional getIconUrl() { + return iconUrl; + } + + @JsonProperty("identity_api") + public Optional getIdentityApi() { + return identityApi; + } + + @JsonProperty("max_groups_to_retrieve") + public Optional getMaxGroupsToRetrieve() { + return maxGroupsToRetrieve; + } + + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonProperty("should_trust_email_verified_connection") + public Optional getShouldTrustEmailVerifiedConnection() { + return shouldTrustEmailVerifiedConnection; + } + + @JsonProperty("tenant_domain") + public Optional getTenantDomain() { + return tenantDomain; + } + + @JsonProperty("tenantId") + public Optional getTenantId() { + return tenantId; + } + + @JsonProperty("thumbprints") + public Optional> getThumbprints() { + return thumbprints; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + return upstreamParams; + } + + /** + * @return Indicates WS-Federation protocol usage. When true, uses WS-Federation; when false, uses OpenID Connect. + */ + @JsonProperty("use_wsfed") + public Optional getUseWsfed() { + return useWsfed; + } + + @JsonProperty("useCommonEndpoint") + public Optional getUseCommonEndpoint() { + return useCommonEndpoint; + } + + @JsonProperty("userid_attribute") + public Optional getUseridAttribute() { + return useridAttribute; + } + + @JsonProperty("waad_protocol") + public Optional getWaadProtocol() { + return waadProtocol; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsAzureAd && equalTo((ConnectionOptionsAzureAd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsAzureAd other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && apiEnableUsers.equals(other.apiEnableUsers) + && appDomain.equals(other.appDomain) + && appId.equals(other.appId) + && basicProfile.equals(other.basicProfile) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && domainAliases.equals(other.domainAliases) + && extAccessToken.equals(other.extAccessToken) + && extAccountEnabled.equals(other.extAccountEnabled) + && extAdmin.equals(other.extAdmin) + && extAgreedTerms.equals(other.extAgreedTerms) + && extAssignedLicenses.equals(other.extAssignedLicenses) + && extAssignedPlans.equals(other.extAssignedPlans) + && extAzureId.equals(other.extAzureId) + && extCity.equals(other.extCity) + && extCountry.equals(other.extCountry) + && extDepartment.equals(other.extDepartment) + && extDirSyncEnabled.equals(other.extDirSyncEnabled) + && extEmail.equals(other.extEmail) + && extExpiresIn.equals(other.extExpiresIn) + && extFamilyName.equals(other.extFamilyName) + && extFax.equals(other.extFax) + && extGivenName.equals(other.extGivenName) + && extGroupIds.equals(other.extGroupIds) + && extGroups.equals(other.extGroups) + && extIsSuspended.equals(other.extIsSuspended) + && extJobTitle.equals(other.extJobTitle) + && extLastSync.equals(other.extLastSync) + && extMobile.equals(other.extMobile) + && extName.equals(other.extName) + && extNestedGroups.equals(other.extNestedGroups) + && extNickname.equals(other.extNickname) + && extOid.equals(other.extOid) + && extPhone.equals(other.extPhone) + && extPhysicalDeliveryOfficeName.equals(other.extPhysicalDeliveryOfficeName) + && extPostalCode.equals(other.extPostalCode) + && extPreferredLanguage.equals(other.extPreferredLanguage) + && extProfile.equals(other.extProfile) + && extProvisionedPlans.equals(other.extProvisionedPlans) + && extProvisioningErrors.equals(other.extProvisioningErrors) + && extProxyAddresses.equals(other.extProxyAddresses) + && extPuid.equals(other.extPuid) + && extRefreshToken.equals(other.extRefreshToken) + && extRoles.equals(other.extRoles) + && extState.equals(other.extState) + && extStreet.equals(other.extStreet) + && extTelephoneNumber.equals(other.extTelephoneNumber) + && extTenantid.equals(other.extTenantid) + && extUpn.equals(other.extUpn) + && extUsageLocation.equals(other.extUsageLocation) + && extUserId.equals(other.extUserId) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) + && granted.equals(other.granted) + && iconUrl.equals(other.iconUrl) + && identityApi.equals(other.identityApi) + && maxGroupsToRetrieve.equals(other.maxGroupsToRetrieve) + && scope.equals(other.scope) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && shouldTrustEmailVerifiedConnection.equals(other.shouldTrustEmailVerifiedConnection) + && tenantDomain.equals(other.tenantDomain) + && tenantId.equals(other.tenantId) + && thumbprints.equals(other.thumbprints) + && upstreamParams.equals(other.upstreamParams) + && useWsfed.equals(other.useWsfed) + && useCommonEndpoint.equals(other.useCommonEndpoint) + && useridAttribute.equals(other.useridAttribute) + && waadProtocol.equals(other.waadProtocol); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.apiEnableUsers, + this.appDomain, + this.appId, + this.basicProfile, + this.clientId, + this.clientSecret, + this.domainAliases, + this.extAccessToken, + this.extAccountEnabled, + this.extAdmin, + this.extAgreedTerms, + this.extAssignedLicenses, + this.extAssignedPlans, + this.extAzureId, + this.extCity, + this.extCountry, + this.extDepartment, + this.extDirSyncEnabled, + this.extEmail, + this.extExpiresIn, + this.extFamilyName, + this.extFax, + this.extGivenName, + this.extGroupIds, + this.extGroups, + this.extIsSuspended, + this.extJobTitle, + this.extLastSync, + this.extMobile, + this.extName, + this.extNestedGroups, + this.extNickname, + this.extOid, + this.extPhone, + this.extPhysicalDeliveryOfficeName, + this.extPostalCode, + this.extPreferredLanguage, + this.extProfile, + this.extProvisionedPlans, + this.extProvisioningErrors, + this.extProxyAddresses, + this.extPuid, + this.extRefreshToken, + this.extRoles, + this.extState, + this.extStreet, + this.extTelephoneNumber, + this.extTenantid, + this.extUpn, + this.extUsageLocation, + this.extUserId, + this.federatedConnectionsAccessTokens, + this.granted, + this.iconUrl, + this.identityApi, + this.maxGroupsToRetrieve, + this.scope, + this.setUserRootAttributes, + this.shouldTrustEmailVerifiedConnection, + this.tenantDomain, + this.tenantId, + this.thumbprints, + this.upstreamParams, + this.useWsfed, + this.useCommonEndpoint, + this.useridAttribute, + this.waadProtocol); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional apiEnableUsers = Optional.empty(); + + private Optional appDomain = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional basicProfile = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private Optional extAccessToken = Optional.empty(); + + private Optional extAccountEnabled = Optional.empty(); + + private Optional extAdmin = Optional.empty(); + + private Optional extAgreedTerms = Optional.empty(); + + private Optional extAssignedLicenses = Optional.empty(); + + private Optional extAssignedPlans = Optional.empty(); + + private Optional extAzureId = Optional.empty(); + + private Optional extCity = Optional.empty(); + + private Optional extCountry = Optional.empty(); + + private Optional extDepartment = Optional.empty(); + + private Optional extDirSyncEnabled = Optional.empty(); + + private Optional extEmail = Optional.empty(); + + private Optional extExpiresIn = Optional.empty(); + + private Optional extFamilyName = Optional.empty(); + + private Optional extFax = Optional.empty(); + + private Optional extGivenName = Optional.empty(); + + private Optional extGroupIds = Optional.empty(); + + private Optional extGroups = Optional.empty(); + + private Optional extIsSuspended = Optional.empty(); + + private Optional extJobTitle = Optional.empty(); + + private Optional extLastSync = Optional.empty(); + + private Optional extMobile = Optional.empty(); + + private Optional extName = Optional.empty(); + + private Optional extNestedGroups = Optional.empty(); + + private Optional extNickname = Optional.empty(); + + private Optional extOid = Optional.empty(); + + private Optional extPhone = Optional.empty(); + + private Optional extPhysicalDeliveryOfficeName = Optional.empty(); + + private Optional extPostalCode = Optional.empty(); + + private Optional extPreferredLanguage = Optional.empty(); + + private Optional extProfile = Optional.empty(); + + private Optional extProvisionedPlans = Optional.empty(); + + private Optional extProvisioningErrors = Optional.empty(); + + private Optional extProxyAddresses = Optional.empty(); + + private Optional extPuid = Optional.empty(); + + private Optional extRefreshToken = Optional.empty(); + + private Optional extRoles = Optional.empty(); + + private Optional extState = Optional.empty(); + + private Optional extStreet = Optional.empty(); + + private Optional extTelephoneNumber = Optional.empty(); + + private Optional extTenantid = Optional.empty(); + + private Optional extUpn = Optional.empty(); + + private Optional extUsageLocation = Optional.empty(); + + private Optional extUserId = Optional.empty(); + + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + + private Optional granted = Optional.empty(); + + private Optional iconUrl = Optional.empty(); + + private Optional identityApi = Optional.empty(); + + private Optional maxGroupsToRetrieve = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional shouldTrustEmailVerifiedConnection = + Optional.empty(); + + private Optional tenantDomain = Optional.empty(); + + private Optional tenantId = Optional.empty(); + + private Optional> thumbprints = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional useWsfed = Optional.empty(); + + private Optional useCommonEndpoint = Optional.empty(); + + private Optional useridAttribute = Optional.empty(); + + private Optional waadProtocol = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsAzureAd other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + apiEnableUsers(other.getApiEnableUsers()); + appDomain(other.getAppDomain()); + appId(other.getAppId()); + basicProfile(other.getBasicProfile()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + domainAliases(other.getDomainAliases()); + extAccessToken(other.getExtAccessToken()); + extAccountEnabled(other.getExtAccountEnabled()); + extAdmin(other.getExtAdmin()); + extAgreedTerms(other.getExtAgreedTerms()); + extAssignedLicenses(other.getExtAssignedLicenses()); + extAssignedPlans(other.getExtAssignedPlans()); + extAzureId(other.getExtAzureId()); + extCity(other.getExtCity()); + extCountry(other.getExtCountry()); + extDepartment(other.getExtDepartment()); + extDirSyncEnabled(other.getExtDirSyncEnabled()); + extEmail(other.getExtEmail()); + extExpiresIn(other.getExtExpiresIn()); + extFamilyName(other.getExtFamilyName()); + extFax(other.getExtFax()); + extGivenName(other.getExtGivenName()); + extGroupIds(other.getExtGroupIds()); + extGroups(other.getExtGroups()); + extIsSuspended(other.getExtIsSuspended()); + extJobTitle(other.getExtJobTitle()); + extLastSync(other.getExtLastSync()); + extMobile(other.getExtMobile()); + extName(other.getExtName()); + extNestedGroups(other.getExtNestedGroups()); + extNickname(other.getExtNickname()); + extOid(other.getExtOid()); + extPhone(other.getExtPhone()); + extPhysicalDeliveryOfficeName(other.getExtPhysicalDeliveryOfficeName()); + extPostalCode(other.getExtPostalCode()); + extPreferredLanguage(other.getExtPreferredLanguage()); + extProfile(other.getExtProfile()); + extProvisionedPlans(other.getExtProvisionedPlans()); + extProvisioningErrors(other.getExtProvisioningErrors()); + extProxyAddresses(other.getExtProxyAddresses()); + extPuid(other.getExtPuid()); + extRefreshToken(other.getExtRefreshToken()); + extRoles(other.getExtRoles()); + extState(other.getExtState()); + extStreet(other.getExtStreet()); + extTelephoneNumber(other.getExtTelephoneNumber()); + extTenantid(other.getExtTenantid()); + extUpn(other.getExtUpn()); + extUsageLocation(other.getExtUsageLocation()); + extUserId(other.getExtUserId()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); + granted(other.getGranted()); + iconUrl(other.getIconUrl()); + identityApi(other.getIdentityApi()); + maxGroupsToRetrieve(other.getMaxGroupsToRetrieve()); + scope(other.getScope()); + setUserRootAttributes(other.getSetUserRootAttributes()); + shouldTrustEmailVerifiedConnection(other.getShouldTrustEmailVerifiedConnection()); + tenantDomain(other.getTenantDomain()); + tenantId(other.getTenantId()); + thumbprints(other.getThumbprints()); + upstreamParams(other.getUpstreamParams()); + useWsfed(other.getUseWsfed()); + useCommonEndpoint(other.getUseCommonEndpoint()); + useridAttribute(other.getUseridAttribute()); + waadProtocol(other.getWaadProtocol()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + /** + *

Enable users API

+ */ + @JsonSetter(value = "api_enable_users", nulls = Nulls.SKIP) + public Builder apiEnableUsers(Optional apiEnableUsers) { + this.apiEnableUsers = apiEnableUsers; + return this; + } + + public Builder apiEnableUsers(Boolean apiEnableUsers) { + this.apiEnableUsers = Optional.ofNullable(apiEnableUsers); + return this; + } + + @JsonSetter(value = "app_domain", nulls = Nulls.SKIP) + public Builder appDomain(Optional appDomain) { + this.appDomain = appDomain; + return this; + } + + public Builder appDomain(String appDomain) { + this.appDomain = Optional.ofNullable(appDomain); + return this; + } + + /** + *

The Application ID URI (App ID URI) for the Azure AD application. Required when using Azure AD v1 with the Resource Owner Password flow. Used to identify the resource being requested in OAuth token requests.

+ */ + @JsonSetter(value = "app_id", nulls = Nulls.SKIP) + public Builder appId(Optional appId) { + this.appId = appId; + return this; + } + + public Builder appId(String appId) { + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + *

Includes basic user profile information from Azure AD (name, email, given_name, family_name). Always enabled and required - represents the minimum profile data retrieved during authentication.

+ */ + @JsonSetter(value = "basic_profile", nulls = Nulls.SKIP) + public Builder basicProfile(Optional basicProfile) { + this.basicProfile = basicProfile; + return this; + } + + public Builder basicProfile(Boolean basicProfile) { + this.basicProfile = Optional.ofNullable(basicProfile); + return this; + } + + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public Builder domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + public Builder domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + /** + *

When false, prevents storing the user's Azure AD access token in the Auth0 user profile. When true (default), the access token is persisted for API access.

+ */ + @JsonSetter(value = "ext_access_token", nulls = Nulls.SKIP) + public Builder extAccessToken(Optional extAccessToken) { + this.extAccessToken = extAccessToken; + return this; + } + + public Builder extAccessToken(Boolean extAccessToken) { + this.extAccessToken = Optional.ofNullable(extAccessToken); + return this; + } + + /** + *

When false, prevents storing whether the user's Azure AD account is enabled. When true (default), the account enabled status is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_account_enabled", nulls = Nulls.SKIP) + public Builder extAccountEnabled(Optional extAccountEnabled) { + this.extAccountEnabled = extAccountEnabled; + return this; + } + + public Builder extAccountEnabled(Boolean extAccountEnabled) { + this.extAccountEnabled = Optional.ofNullable(extAccountEnabled); + return this; + } + + @JsonSetter(value = "ext_admin", nulls = Nulls.SKIP) + public Builder extAdmin(Optional extAdmin) { + this.extAdmin = extAdmin; + return this; + } + + public Builder extAdmin(Boolean extAdmin) { + this.extAdmin = Optional.ofNullable(extAdmin); + return this; + } + + @JsonSetter(value = "ext_agreed_terms", nulls = Nulls.SKIP) + public Builder extAgreedTerms(Optional extAgreedTerms) { + this.extAgreedTerms = extAgreedTerms; + return this; + } + + public Builder extAgreedTerms(Boolean extAgreedTerms) { + this.extAgreedTerms = Optional.ofNullable(extAgreedTerms); + return this; + } + + /** + *

When false, prevents storing the list of Microsoft 365/Office 365 licenses assigned to the user. When true (default), license information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_assigned_licenses", nulls = Nulls.SKIP) + public Builder extAssignedLicenses(Optional extAssignedLicenses) { + this.extAssignedLicenses = extAssignedLicenses; + return this; + } + + public Builder extAssignedLicenses(Boolean extAssignedLicenses) { + this.extAssignedLicenses = Optional.ofNullable(extAssignedLicenses); + return this; + } + + @JsonSetter(value = "ext_assigned_plans", nulls = Nulls.SKIP) + public Builder extAssignedPlans(Optional extAssignedPlans) { + this.extAssignedPlans = extAssignedPlans; + return this; + } + + public Builder extAssignedPlans(Boolean extAssignedPlans) { + this.extAssignedPlans = Optional.ofNullable(extAssignedPlans); + return this; + } + + /** + *

When false, prevents storing the user's Azure ID identifier. When true (default), the Azure ID is persisted. Note: 'oid' (Object ID) is the recommended unique identifier for single-tenant connections.

+ */ + @JsonSetter(value = "ext_azure_id", nulls = Nulls.SKIP) + public Builder extAzureId(Optional extAzureId) { + this.extAzureId = extAzureId; + return this; + } + + public Builder extAzureId(Boolean extAzureId) { + this.extAzureId = Optional.ofNullable(extAzureId); + return this; + } + + /** + *

When false, prevents storing the user's city from Azure AD. When true (default), city information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_city", nulls = Nulls.SKIP) + public Builder extCity(Optional extCity) { + this.extCity = extCity; + return this; + } + + public Builder extCity(Boolean extCity) { + this.extCity = Optional.ofNullable(extCity); + return this; + } + + /** + *

When false, prevents storing the user's country from Azure AD. When true (default), country information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_country", nulls = Nulls.SKIP) + public Builder extCountry(Optional extCountry) { + this.extCountry = extCountry; + return this; + } + + public Builder extCountry(Boolean extCountry) { + this.extCountry = Optional.ofNullable(extCountry); + return this; + } + + /** + *

When false, prevents storing the user's department from Azure AD. When true (default), department information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_department", nulls = Nulls.SKIP) + public Builder extDepartment(Optional extDepartment) { + this.extDepartment = extDepartment; + return this; + } + + public Builder extDepartment(Boolean extDepartment) { + this.extDepartment = Optional.ofNullable(extDepartment); + return this; + } + + /** + *

When false, prevents storing whether directory synchronization is enabled for the user. When true (default), directory sync status is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_dir_sync_enabled", nulls = Nulls.SKIP) + public Builder extDirSyncEnabled(Optional extDirSyncEnabled) { + this.extDirSyncEnabled = extDirSyncEnabled; + return this; + } + + public Builder extDirSyncEnabled(Boolean extDirSyncEnabled) { + this.extDirSyncEnabled = Optional.ofNullable(extDirSyncEnabled); + return this; + } + + /** + *

When false, prevents storing the user's email address from Azure AD. When true (default), email is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_email", nulls = Nulls.SKIP) + public Builder extEmail(Optional extEmail) { + this.extEmail = extEmail; + return this; + } + + public Builder extEmail(Boolean extEmail) { + this.extEmail = Optional.ofNullable(extEmail); + return this; + } + + /** + *

When false, prevents storing the token expiration time (in seconds). When true (default), expiration information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_expires_in", nulls = Nulls.SKIP) + public Builder extExpiresIn(Optional extExpiresIn) { + this.extExpiresIn = extExpiresIn; + return this; + } + + public Builder extExpiresIn(Boolean extExpiresIn) { + this.extExpiresIn = Optional.ofNullable(extExpiresIn); + return this; + } + + /** + *

When false, prevents storing the user's family name (last name) from Azure AD. When true (default), family name is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_family_name", nulls = Nulls.SKIP) + public Builder extFamilyName(Optional extFamilyName) { + this.extFamilyName = extFamilyName; + return this; + } + + public Builder extFamilyName(Boolean extFamilyName) { + this.extFamilyName = Optional.ofNullable(extFamilyName); + return this; + } + + /** + *

When false, prevents storing the user's fax number from Azure AD. When true (default), fax information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_fax", nulls = Nulls.SKIP) + public Builder extFax(Optional extFax) { + this.extFax = extFax; + return this; + } + + public Builder extFax(Boolean extFax) { + this.extFax = Optional.ofNullable(extFax); + return this; + } + + /** + *

When false, prevents storing the user's given name (first name) from Azure AD. When true (default), given name is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_given_name", nulls = Nulls.SKIP) + public Builder extGivenName(Optional extGivenName) { + this.extGivenName = extGivenName; + return this; + } + + public Builder extGivenName(Boolean extGivenName) { + this.extGivenName = Optional.ofNullable(extGivenName); + return this; + } + + /** + *

When false, prevents storing the list of Azure AD group IDs the user is a member of. When true (default), group membership IDs are persisted. See ext_groups for retrieving group details.

+ */ + @JsonSetter(value = "ext_group_ids", nulls = Nulls.SKIP) + public Builder extGroupIds(Optional extGroupIds) { + this.extGroupIds = extGroupIds; + return this; + } + + public Builder extGroupIds(Boolean extGroupIds) { + this.extGroupIds = Optional.ofNullable(extGroupIds); + return this; + } + + @JsonSetter(value = "ext_groups", nulls = Nulls.SKIP) + public Builder extGroups(Optional extGroups) { + this.extGroups = extGroups; + return this; + } + + public Builder extGroups(Boolean extGroups) { + this.extGroups = Optional.ofNullable(extGroups); + return this; + } + + @JsonSetter(value = "ext_is_suspended", nulls = Nulls.SKIP) + public Builder extIsSuspended(Optional extIsSuspended) { + this.extIsSuspended = extIsSuspended; + return this; + } + + public Builder extIsSuspended(Boolean extIsSuspended) { + this.extIsSuspended = Optional.ofNullable(extIsSuspended); + return this; + } + + /** + *

When false, prevents storing the user's job title from Azure AD. When true (default), job title information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_job_title", nulls = Nulls.SKIP) + public Builder extJobTitle(Optional extJobTitle) { + this.extJobTitle = extJobTitle; + return this; + } + + public Builder extJobTitle(Boolean extJobTitle) { + this.extJobTitle = Optional.ofNullable(extJobTitle); + return this; + } + + /** + *

When false, prevents storing the timestamp of the last directory synchronization. When true (default), the last sync date is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_last_sync", nulls = Nulls.SKIP) + public Builder extLastSync(Optional extLastSync) { + this.extLastSync = extLastSync; + return this; + } + + public Builder extLastSync(Boolean extLastSync) { + this.extLastSync = Optional.ofNullable(extLastSync); + return this; + } + + /** + *

When false, prevents storing the user's mobile phone number from Azure AD. When true (default), mobile number is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_mobile", nulls = Nulls.SKIP) + public Builder extMobile(Optional extMobile) { + this.extMobile = extMobile; + return this; + } + + public Builder extMobile(Boolean extMobile) { + this.extMobile = Optional.ofNullable(extMobile); + return this; + } + + /** + *

When false, prevents storing the user's full name from Azure AD. When true (default), full name is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_name", nulls = Nulls.SKIP) + public Builder extName(Optional extName) { + this.extName = extName; + return this; + } + + public Builder extName(Boolean extName) { + this.extName = Optional.ofNullable(extName); + return this; + } + + /** + *

When true, stores all groups the user is member of, including transitive group memberships (groups within groups). When false (default), only direct group memberships are included.

+ */ + @JsonSetter(value = "ext_nested_groups", nulls = Nulls.SKIP) + public Builder extNestedGroups(Optional extNestedGroups) { + this.extNestedGroups = extNestedGroups; + return this; + } + + public Builder extNestedGroups(Boolean extNestedGroups) { + this.extNestedGroups = Optional.ofNullable(extNestedGroups); + return this; + } + + /** + *

When false, prevents storing the user's nickname or display name from Azure AD. When true (default), nickname is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_nickname", nulls = Nulls.SKIP) + public Builder extNickname(Optional extNickname) { + this.extNickname = extNickname; + return this; + } + + public Builder extNickname(Boolean extNickname) { + this.extNickname = Optional.ofNullable(extNickname); + return this; + } + + /** + *

When false, prevents storing the user's Object ID (oid) from Azure AD. When true (default), the oid is persisted. Note: 'oid' is the recommended unique identifier for single-tenant connections and required for SCIM.

+ */ + @JsonSetter(value = "ext_oid", nulls = Nulls.SKIP) + public Builder extOid(Optional extOid) { + this.extOid = extOid; + return this; + } + + public Builder extOid(Boolean extOid) { + this.extOid = Optional.ofNullable(extOid); + return this; + } + + /** + *

When false, prevents storing the user's phone number from Azure AD. When true (default), phone number is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_phone", nulls = Nulls.SKIP) + public Builder extPhone(Optional extPhone) { + this.extPhone = extPhone; + return this; + } + + public Builder extPhone(Boolean extPhone) { + this.extPhone = Optional.ofNullable(extPhone); + return this; + } + + /** + *

When false, prevents storing the user's office location from Azure AD. When true (default), office location is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_physical_delivery_office_name", nulls = Nulls.SKIP) + public Builder extPhysicalDeliveryOfficeName(Optional extPhysicalDeliveryOfficeName) { + this.extPhysicalDeliveryOfficeName = extPhysicalDeliveryOfficeName; + return this; + } + + public Builder extPhysicalDeliveryOfficeName(Boolean extPhysicalDeliveryOfficeName) { + this.extPhysicalDeliveryOfficeName = Optional.ofNullable(extPhysicalDeliveryOfficeName); + return this; + } + + /** + *

When false, prevents storing the user's postal code from Azure AD. When true (default), postal code is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_postal_code", nulls = Nulls.SKIP) + public Builder extPostalCode(Optional extPostalCode) { + this.extPostalCode = extPostalCode; + return this; + } + + public Builder extPostalCode(Boolean extPostalCode) { + this.extPostalCode = Optional.ofNullable(extPostalCode); + return this; + } + + /** + *

When false, prevents storing the user's preferred language from Azure AD. When true (default), language preference is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_preferred_language", nulls = Nulls.SKIP) + public Builder extPreferredLanguage(Optional extPreferredLanguage) { + this.extPreferredLanguage = extPreferredLanguage; + return this; + } + + public Builder extPreferredLanguage(Boolean extPreferredLanguage) { + this.extPreferredLanguage = Optional.ofNullable(extPreferredLanguage); + return this; + } + + @JsonSetter(value = "ext_profile", nulls = Nulls.SKIP) + public Builder extProfile(Optional extProfile) { + this.extProfile = extProfile; + return this; + } + + public Builder extProfile(Boolean extProfile) { + this.extProfile = Optional.ofNullable(extProfile); + return this; + } + + /** + *

When false, prevents storing the list of service plans provisioned to the user. When true (default), provisioned plans are persisted in the user profile.

+ */ + @JsonSetter(value = "ext_provisioned_plans", nulls = Nulls.SKIP) + public Builder extProvisionedPlans(Optional extProvisionedPlans) { + this.extProvisionedPlans = extProvisionedPlans; + return this; + } + + public Builder extProvisionedPlans(Boolean extProvisionedPlans) { + this.extProvisionedPlans = Optional.ofNullable(extProvisionedPlans); + return this; + } + + /** + *

When false, prevents storing provisioning errors that occurred during synchronization. When true (default), error information is persisted. Useful for troubleshooting sync issues.

+ */ + @JsonSetter(value = "ext_provisioning_errors", nulls = Nulls.SKIP) + public Builder extProvisioningErrors(Optional extProvisioningErrors) { + this.extProvisioningErrors = extProvisioningErrors; + return this; + } + + public Builder extProvisioningErrors(Boolean extProvisioningErrors) { + this.extProvisioningErrors = Optional.ofNullable(extProvisioningErrors); + return this; + } + + /** + *

When false, prevents storing all proxy email addresses (email aliases) for the user. When true (default), proxy addresses are persisted in the user profile.

+ */ + @JsonSetter(value = "ext_proxy_addresses", nulls = Nulls.SKIP) + public Builder extProxyAddresses(Optional extProxyAddresses) { + this.extProxyAddresses = extProxyAddresses; + return this; + } + + public Builder extProxyAddresses(Boolean extProxyAddresses) { + this.extProxyAddresses = Optional.ofNullable(extProxyAddresses); + return this; + } + + /** + *

When false, prevents storing the user's Passport User ID (puid). When true (default), puid is persisted in the user profile. Legacy attribute.

+ */ + @JsonSetter(value = "ext_puid", nulls = Nulls.SKIP) + public Builder extPuid(Optional extPuid) { + this.extPuid = extPuid; + return this; + } + + public Builder extPuid(Boolean extPuid) { + this.extPuid = Optional.ofNullable(extPuid); + return this; + } + + /** + *

When false, prevents storing the Azure AD refresh token. When true (default), the refresh token is persisted for offline access. Required for token refresh in long-lived applications.

+ */ + @JsonSetter(value = "ext_refresh_token", nulls = Nulls.SKIP) + public Builder extRefreshToken(Optional extRefreshToken) { + this.extRefreshToken = extRefreshToken; + return this; + } + + public Builder extRefreshToken(Boolean extRefreshToken) { + this.extRefreshToken = Optional.ofNullable(extRefreshToken); + return this; + } + + /** + *

When false, prevents storing Azure AD application roles assigned to the user. When true (default), role information is persisted. Useful for RBAC in applications.

+ */ + @JsonSetter(value = "ext_roles", nulls = Nulls.SKIP) + public Builder extRoles(Optional extRoles) { + this.extRoles = extRoles; + return this; + } + + public Builder extRoles(Boolean extRoles) { + this.extRoles = Optional.ofNullable(extRoles); + return this; + } + + /** + *

When false, prevents storing the user's state (province/region) from Azure AD. When true (default), state information is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_state", nulls = Nulls.SKIP) + public Builder extState(Optional extState) { + this.extState = extState; + return this; + } + + public Builder extState(Boolean extState) { + this.extState = Optional.ofNullable(extState); + return this; + } + + /** + *

When false, prevents storing the user's street address from Azure AD. When true (default), street address is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_street", nulls = Nulls.SKIP) + public Builder extStreet(Optional extStreet) { + this.extStreet = extStreet; + return this; + } + + public Builder extStreet(Boolean extStreet) { + this.extStreet = Optional.ofNullable(extStreet); + return this; + } + + /** + *

When false, prevents storing the user's telephone number from Azure AD. When true (default), telephone number is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_telephoneNumber", nulls = Nulls.SKIP) + public Builder extTelephoneNumber(Optional extTelephoneNumber) { + this.extTelephoneNumber = extTelephoneNumber; + return this; + } + + public Builder extTelephoneNumber(Boolean extTelephoneNumber) { + this.extTelephoneNumber = Optional.ofNullable(extTelephoneNumber); + return this; + } + + /** + *

When false, prevents storing the user's Azure AD tenant ID. When true (default), tenant ID is persisted. Useful for identifying which Azure AD organization the user belongs to.

+ */ + @JsonSetter(value = "ext_tenantid", nulls = Nulls.SKIP) + public Builder extTenantid(Optional extTenantid) { + this.extTenantid = extTenantid; + return this; + } + + public Builder extTenantid(Boolean extTenantid) { + this.extTenantid = Optional.ofNullable(extTenantid); + return this; + } + + /** + *

When false, prevents storing the user's User Principal Name (UPN) from Azure AD. When true (default), UPN is persisted. UPN is the user's logon name (e.g., user@contoso.com).

+ */ + @JsonSetter(value = "ext_upn", nulls = Nulls.SKIP) + public Builder extUpn(Optional extUpn) { + this.extUpn = extUpn; + return this; + } + + public Builder extUpn(Boolean extUpn) { + this.extUpn = Optional.ofNullable(extUpn); + return this; + } + + /** + *

When false, prevents storing the user's usage location for license assignment. When true (default), usage location is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_usage_location", nulls = Nulls.SKIP) + public Builder extUsageLocation(Optional extUsageLocation) { + this.extUsageLocation = extUsageLocation; + return this; + } + + public Builder extUsageLocation(Boolean extUsageLocation) { + this.extUsageLocation = Optional.ofNullable(extUsageLocation); + return this; + } + + /** + *

When false, prevents storing an alternative user ID. When true (default), this user ID is persisted in the user profile.

+ */ + @JsonSetter(value = "ext_user_id", nulls = Nulls.SKIP) + public Builder extUserId(Optional extUserId) { + this.extUserId = extUserId; + return this; + } + + public Builder extUserId(Boolean extUserId) { + this.extUserId = Optional.ofNullable(extUserId); + return this; + } + + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public Builder federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + public Builder federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + public Builder federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + public Builder federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + + /** + *

Indicates whether admin consent has been granted for the required Azure AD permissions. Read-only status field managed by Auth0 during the OAuth authorization flow.

+ */ + @JsonSetter(value = "granted", nulls = Nulls.SKIP) + public Builder granted(Optional granted) { + this.granted = granted; + return this; + } + + public Builder granted(Boolean granted) { + this.granted = Optional.ofNullable(granted); + return this; + } + + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public Builder iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + public Builder iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @JsonSetter(value = "identity_api", nulls = Nulls.SKIP) + public Builder identityApi(Optional identityApi) { + this.identityApi = identityApi; + return this; + } + + public Builder identityApi(ConnectionIdentityApiEnumAzureAd identityApi) { + this.identityApi = Optional.ofNullable(identityApi); + return this; + } + + @JsonSetter(value = "max_groups_to_retrieve", nulls = Nulls.SKIP) + public Builder maxGroupsToRetrieve(Optional maxGroupsToRetrieve) { + this.maxGroupsToRetrieve = maxGroupsToRetrieve; + return this; + } + + public Builder maxGroupsToRetrieve(String maxGroupsToRetrieve) { + this.maxGroupsToRetrieve = Optional.ofNullable(maxGroupsToRetrieve); + return this; + } + + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @JsonSetter(value = "should_trust_email_verified_connection", nulls = Nulls.SKIP) + public Builder shouldTrustEmailVerifiedConnection( + Optional shouldTrustEmailVerifiedConnection) { + this.shouldTrustEmailVerifiedConnection = shouldTrustEmailVerifiedConnection; + return this; + } + + public Builder shouldTrustEmailVerifiedConnection( + ConnectionShouldTrustEmailVerifiedConnectionEnum shouldTrustEmailVerifiedConnection) { + this.shouldTrustEmailVerifiedConnection = Optional.ofNullable(shouldTrustEmailVerifiedConnection); + return this; + } + + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public Builder tenantDomain(Optional tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + public Builder tenantDomain(String tenantDomain) { + this.tenantDomain = Optional.ofNullable(tenantDomain); + return this; + } + + @JsonSetter(value = "tenantId", nulls = Nulls.SKIP) + public Builder tenantId(Optional tenantId) { + this.tenantId = tenantId; + return this; + } + + public Builder tenantId(String tenantId) { + this.tenantId = Optional.ofNullable(tenantId); + return this; + } + + @JsonSetter(value = "thumbprints", nulls = Nulls.SKIP) + public Builder thumbprints(Optional> thumbprints) { + this.thumbprints = thumbprints; + return this; + } + + public Builder thumbprints(List thumbprints) { + this.thumbprints = Optional.ofNullable(thumbprints); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + /** + *

Indicates WS-Federation protocol usage. When true, uses WS-Federation; when false, uses OpenID Connect.

+ */ + @JsonSetter(value = "use_wsfed", nulls = Nulls.SKIP) + public Builder useWsfed(Optional useWsfed) { + this.useWsfed = useWsfed; + return this; + } + + public Builder useWsfed(Boolean useWsfed) { + this.useWsfed = Optional.ofNullable(useWsfed); + return this; + } + + @JsonSetter(value = "useCommonEndpoint", nulls = Nulls.SKIP) + public Builder useCommonEndpoint(Optional useCommonEndpoint) { + this.useCommonEndpoint = useCommonEndpoint; + return this; + } + + public Builder useCommonEndpoint(Boolean useCommonEndpoint) { + this.useCommonEndpoint = Optional.ofNullable(useCommonEndpoint); + return this; + } + + @JsonSetter(value = "userid_attribute", nulls = Nulls.SKIP) + public Builder useridAttribute(Optional useridAttribute) { + this.useridAttribute = useridAttribute; + return this; + } + + public Builder useridAttribute(ConnectionUseridAttributeEnumAzureAd useridAttribute) { + this.useridAttribute = Optional.ofNullable(useridAttribute); + return this; + } + + @JsonSetter(value = "waad_protocol", nulls = Nulls.SKIP) + public Builder waadProtocol(Optional waadProtocol) { + this.waadProtocol = waadProtocol; + return this; + } + + public Builder waadProtocol(ConnectionWaadProtocolEnumAzureAd waadProtocol) { + this.waadProtocol = Optional.ofNullable(waadProtocol); + return this; + } + + public ConnectionOptionsAzureAd build() { + return new ConnectionOptionsAzureAd( + nonPersistentAttrs, + apiEnableUsers, + appDomain, + appId, + basicProfile, + clientId, + clientSecret, + domainAliases, + extAccessToken, + extAccountEnabled, + extAdmin, + extAgreedTerms, + extAssignedLicenses, + extAssignedPlans, + extAzureId, + extCity, + extCountry, + extDepartment, + extDirSyncEnabled, + extEmail, + extExpiresIn, + extFamilyName, + extFax, + extGivenName, + extGroupIds, + extGroups, + extIsSuspended, + extJobTitle, + extLastSync, + extMobile, + extName, + extNestedGroups, + extNickname, + extOid, + extPhone, + extPhysicalDeliveryOfficeName, + extPostalCode, + extPreferredLanguage, + extProfile, + extProvisionedPlans, + extProvisioningErrors, + extProxyAddresses, + extPuid, + extRefreshToken, + extRoles, + extState, + extStreet, + extTelephoneNumber, + extTenantid, + extUpn, + extUsageLocation, + extUserId, + federatedConnectionsAccessTokens, + granted, + iconUrl, + identityApi, + maxGroupsToRetrieve, + scope, + setUserRootAttributes, + shouldTrustEmailVerifiedConnection, + tenantDomain, + tenantId, + thumbprints, + upstreamParams, + useWsfed, + useCommonEndpoint, + useridAttribute, + waadProtocol, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java new file mode 100644 index 000000000..d8c34ab4a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsCommon.Builder.class) +public final class ConnectionOptionsCommon implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Map additionalProperties; + + private ConnectionOptionsCommon( + Optional> nonPersistentAttrs, Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsCommon && equalTo((ConnectionOptionsCommon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsCommon other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs); + } + + @Override + public int hashCode() { + return Objects.hash(this.nonPersistentAttrs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsCommon other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + public ConnectionOptionsCommon build() { + return new ConnectionOptionsCommon(nonPersistentAttrs, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java new file mode 100644 index 000000000..66647a3c2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java @@ -0,0 +1,1002 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsCommonOidc.Builder.class) +public final class ConnectionOptionsCommonOidc implements IConnectionOptionsCommonOidc { + private final Optional authorizationEndpoint; + + private final String clientId; + + private final Optional clientSecret; + + private final Optional connectionSettings; + + private final OptionalNullable federatedConnectionsAccessTokens; + + private final Optional> domainAliases; + + private final Optional iconUrl; + + private final OptionalNullable> idTokenSignedResponseAlgs; + + private final Optional issuer; + + private final Optional jwksUri; + + private final Optional oidcMetadata; + + private final Optional scope; + + private final Optional sendBackChannelNonce; + + private final Optional setUserRootAttributes; + + private final OptionalNullable tenantDomain; + + private final Optional tokenEndpoint; + + private final OptionalNullable tokenEndpointAuthMethod; + + private final OptionalNullable tokenEndpointAuthSigningAlg; + + private final OptionalNullable>> + upstreamParams; + + private final Optional userinfoEndpoint; + + private final Map additionalProperties; + + private ConnectionOptionsCommonOidc( + Optional authorizationEndpoint, + String clientId, + Optional clientSecret, + Optional connectionSettings, + OptionalNullable federatedConnectionsAccessTokens, + Optional> domainAliases, + Optional iconUrl, + OptionalNullable> idTokenSignedResponseAlgs, + Optional issuer, + Optional jwksUri, + Optional oidcMetadata, + Optional scope, + Optional sendBackChannelNonce, + Optional setUserRootAttributes, + OptionalNullable tenantDomain, + Optional tokenEndpoint, + OptionalNullable tokenEndpointAuthMethod, + OptionalNullable tokenEndpointAuthSigningAlg, + OptionalNullable>> upstreamParams, + Optional userinfoEndpoint, + Map additionalProperties) { + this.authorizationEndpoint = authorizationEndpoint; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.connectionSettings = connectionSettings; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + this.domainAliases = domainAliases; + this.iconUrl = iconUrl; + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + this.issuer = issuer; + this.jwksUri = jwksUri; + this.oidcMetadata = oidcMetadata; + this.scope = scope; + this.sendBackChannelNonce = sendBackChannelNonce; + this.setUserRootAttributes = setUserRootAttributes; + this.tenantDomain = tenantDomain; + this.tokenEndpoint = tokenEndpoint; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + this.upstreamParams = upstreamParams; + this.userinfoEndpoint = userinfoEndpoint; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("authorization_endpoint") + @Override + public Optional getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + @JsonProperty("client_id") + @Override + public String getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + @Override + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("connection_settings") + @Override + public Optional getConnectionSettings() { + return connectionSettings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + @Override + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + + @JsonProperty("domain_aliases") + @Override + public Optional> getDomainAliases() { + return domainAliases; + } + + @JsonProperty("icon_url") + @Override + public Optional getIconUrl() { + return iconUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + @Override + public OptionalNullable> getIdTokenSignedResponseAlgs() { + if (idTokenSignedResponseAlgs == null) { + return OptionalNullable.absent(); + } + return idTokenSignedResponseAlgs; + } + + @JsonProperty("issuer") + @Override + public Optional getIssuer() { + return issuer; + } + + @JsonProperty("jwks_uri") + @Override + public Optional getJwksUri() { + return jwksUri; + } + + @JsonProperty("oidc_metadata") + @Override + public Optional getOidcMetadata() { + return oidcMetadata; + } + + @JsonProperty("scope") + @Override + public Optional getScope() { + return scope; + } + + @JsonProperty("send_back_channel_nonce") + @Override + public Optional getSendBackChannelNonce() { + return sendBackChannelNonce; + } + + @JsonProperty("set_user_root_attributes") + @Override + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + @Override + public OptionalNullable getTenantDomain() { + if (tenantDomain == null) { + return OptionalNullable.absent(); + } + return tenantDomain; + } + + @JsonProperty("token_endpoint") + @Override + public Optional getTokenEndpoint() { + return tokenEndpoint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + @Override + public OptionalNullable getTokenEndpointAuthMethod() { + if (tokenEndpointAuthMethod == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + @Override + public OptionalNullable getTokenEndpointAuthSigningAlg() { + if (tokenEndpointAuthSigningAlg == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthSigningAlg; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + @Override + public OptionalNullable>> getUpstreamParams() { + return upstreamParams; + } + + @JsonProperty("userinfo_endpoint") + @Override + public Optional getUserinfoEndpoint() { + return userinfoEndpoint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + private OptionalNullable> _getIdTokenSignedResponseAlgs() { + return idTokenSignedResponseAlgs; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + private OptionalNullable _getTenantDomain() { + return tenantDomain; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + private OptionalNullable _getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + private OptionalNullable _getTokenEndpointAuthSigningAlg() { + return tokenEndpointAuthSigningAlg; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsCommonOidc && equalTo((ConnectionOptionsCommonOidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsCommonOidc other) { + return authorizationEndpoint.equals(other.authorizationEndpoint) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && connectionSettings.equals(other.connectionSettings) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) + && domainAliases.equals(other.domainAliases) + && iconUrl.equals(other.iconUrl) + && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) + && issuer.equals(other.issuer) + && jwksUri.equals(other.jwksUri) + && oidcMetadata.equals(other.oidcMetadata) + && scope.equals(other.scope) + && sendBackChannelNonce.equals(other.sendBackChannelNonce) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && tenantDomain.equals(other.tenantDomain) + && tokenEndpoint.equals(other.tokenEndpoint) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && tokenEndpointAuthSigningAlg.equals(other.tokenEndpointAuthSigningAlg) + && upstreamParams.equals(other.upstreamParams) + && userinfoEndpoint.equals(other.userinfoEndpoint); + } + + @Override + public int hashCode() { + return Objects.hash( + this.authorizationEndpoint, + this.clientId, + this.clientSecret, + this.connectionSettings, + this.federatedConnectionsAccessTokens, + this.domainAliases, + this.iconUrl, + this.idTokenSignedResponseAlgs, + this.issuer, + this.jwksUri, + this.oidcMetadata, + this.scope, + this.sendBackChannelNonce, + this.setUserRootAttributes, + this.tenantDomain, + this.tokenEndpoint, + this.tokenEndpointAuthMethod, + this.tokenEndpointAuthSigningAlg, + this.upstreamParams, + this.userinfoEndpoint); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + _FinalStage clientId(@NotNull String clientId); + + Builder from(ConnectionOptionsCommonOidc other); + } + + public interface _FinalStage { + ConnectionOptionsCommonOidc build(); + + _FinalStage authorizationEndpoint(Optional authorizationEndpoint); + + _FinalStage authorizationEndpoint(String authorizationEndpoint); + + _FinalStage clientSecret(Optional clientSecret); + + _FinalStage clientSecret(String clientSecret); + + _FinalStage connectionSettings(Optional connectionSettings); + + _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings); + + _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens); + + _FinalStage domainAliases(Optional> domainAliases); + + _FinalStage domainAliases(List domainAliases); + + _FinalStage iconUrl(Optional iconUrl); + + _FinalStage iconUrl(String iconUrl); + + _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs(List idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs); + + _FinalStage issuer(Optional issuer); + + _FinalStage issuer(String issuer); + + _FinalStage jwksUri(Optional jwksUri); + + _FinalStage jwksUri(String jwksUri); + + _FinalStage oidcMetadata(Optional oidcMetadata); + + _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata); + + _FinalStage scope(Optional scope); + + _FinalStage scope(String scope); + + _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce); + + _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce); + + _FinalStage setUserRootAttributes(Optional setUserRootAttributes); + + _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); + + _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); + + _FinalStage tenantDomain(String tenantDomain); + + _FinalStage tenantDomain(Optional tenantDomain); + + _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + + _FinalStage tokenEndpoint(Optional tokenEndpoint); + + _FinalStage tokenEndpoint(String tokenEndpoint); + + _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg(ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg); + + _FinalStage upstreamParams( + OptionalNullable>> upstreamParams); + + _FinalStage upstreamParams( + Map> upstreamParams); + + _FinalStage upstreamParams( + Optional>> upstreamParams); + + _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams); + + _FinalStage userinfoEndpoint(Optional userinfoEndpoint); + + _FinalStage userinfoEndpoint(String userinfoEndpoint); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + private Optional userinfoEndpoint = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthSigningAlg = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthMethod = + OptionalNullable.absent(); + + private Optional tokenEndpoint = Optional.empty(); + + private OptionalNullable tenantDomain = OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional sendBackChannelNonce = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional oidcMetadata = Optional.empty(); + + private Optional jwksUri = Optional.empty(); + + private Optional issuer = Optional.empty(); + + private OptionalNullable> idTokenSignedResponseAlgs = + OptionalNullable.absent(); + + private Optional iconUrl = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + + private Optional connectionSettings = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional authorizationEndpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionOptionsCommonOidc other) { + authorizationEndpoint(other.getAuthorizationEndpoint()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + connectionSettings(other.getConnectionSettings()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); + domainAliases(other.getDomainAliases()); + iconUrl(other.getIconUrl()); + idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); + issuer(other.getIssuer()); + jwksUri(other.getJwksUri()); + oidcMetadata(other.getOidcMetadata()); + scope(other.getScope()); + sendBackChannelNonce(other.getSendBackChannelNonce()); + setUserRootAttributes(other.getSetUserRootAttributes()); + tenantDomain(other.getTenantDomain()); + tokenEndpoint(other.getTokenEndpoint()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + tokenEndpointAuthSigningAlg(other.getTokenEndpointAuthSigningAlg()); + upstreamParams(other.getUpstreamParams()); + userinfoEndpoint(other.getUserinfoEndpoint()); + return this; + } + + @Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @Override + public _FinalStage userinfoEndpoint(String userinfoEndpoint) { + this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); + return this; + } + + @Override + @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) + public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + return this; + } + + @Override + public _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + @Override + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public _FinalStage upstreamParams( + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isNull()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthSigningAlg.isEmpty()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isPresent()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isNull()) { + this.tokenEndpointAuthMethod = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthMethod.isEmpty()) { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + Optional tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isPresent()) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + @Override + public _FinalStage tokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) + public _FinalStage tokenEndpoint(Optional tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + @Override + public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { + if (tenantDomain.isNull()) { + this.tenantDomain = OptionalNullable.ofNull(); + } else if (tenantDomain.isEmpty()) { + this.tenantDomain = OptionalNullable.absent(); + } else { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } + return this; + } + + @Override + public _FinalStage tenantDomain(Optional tenantDomain) { + if (tenantDomain.isPresent()) { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } else { + this.tenantDomain = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tenantDomain(String tenantDomain) { + this.tenantDomain = OptionalNullable.of(tenantDomain); + return this; + } + + @Override + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + @Override + public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @Override + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + @Override + public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { + this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); + return this; + } + + @Override + @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) + public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { + this.sendBackChannelNonce = sendBackChannelNonce; + return this; + } + + @Override + public _FinalStage scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(Optional scope) { + this.scope = scope; + return this; + } + + @Override + public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { + this.oidcMetadata = Optional.ofNullable(oidcMetadata); + return this; + } + + @Override + @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) + public _FinalStage oidcMetadata(Optional oidcMetadata) { + this.oidcMetadata = oidcMetadata; + return this; + } + + @Override + public _FinalStage jwksUri(String jwksUri) { + this.jwksUri = Optional.ofNullable(jwksUri); + return this; + } + + @Override + @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) + public _FinalStage jwksUri(Optional jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + @Override + public _FinalStage issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @Override + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public _FinalStage issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isNull()) { + this.idTokenSignedResponseAlgs = OptionalNullable.ofNull(); + } else if (idTokenSignedResponseAlgs.isEmpty()) { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isPresent()) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + List idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); + return this; + } + + @Override + @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) + public _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + return this; + } + + @Override + public _FinalStage iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @Override + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public _FinalStage iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + @Override + public _FinalStage domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @Override + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public _FinalStage domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + @Override + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + @Override + public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { + this.connectionSettings = Optional.ofNullable(connectionSettings); + return this; + } + + @Override + @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) + public _FinalStage connectionSettings(Optional connectionSettings) { + this.connectionSettings = connectionSettings; + return this; + } + + @Override + public _FinalStage clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @Override + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public _FinalStage clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + @Override + public _FinalStage authorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); + return this; + } + + @Override + @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) + public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + @Override + public ConnectionOptionsCommonOidc build() { + return new ConnectionOptionsCommonOidc( + authorizationEndpoint, + clientId, + clientSecret, + connectionSettings, + federatedConnectionsAccessTokens, + domainAliases, + iconUrl, + idTokenSignedResponseAlgs, + issuer, + jwksUri, + oidcMetadata, + scope, + sendBackChannelNonce, + setUserRootAttributes, + tenantDomain, + tokenEndpoint, + tokenEndpointAuthMethod, + tokenEndpointAuthSigningAlg, + upstreamParams, + userinfoEndpoint, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java new file mode 100644 index 000000000..4edda5763 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java @@ -0,0 +1,2494 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsGoogleOAuth2.Builder.class) +public final class ConnectionOptionsGoogleOAuth2 implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional adsenseManagement; + + private final Optional> allowedAudiences; + + private final Optional analytics; + + private final Optional blogger; + + private final Optional calendar; + + private final Optional calendarAddonsExecute; + + private final Optional calendarEvents; + + private final Optional calendarEventsReadonly; + + private final Optional calendarSettingsReadonly; + + private final Optional chromeWebStore; + + private final OptionalNullable clientId; + + private final OptionalNullable clientSecret; + + private final Optional contacts; + + private final Optional contactsNew; + + private final Optional contactsOtherReadonly; + + private final Optional contactsReadonly; + + private final Optional contentApiForShopping; + + private final Optional coordinate; + + private final Optional coordinateReadonly; + + private final Optional directoryReadonly; + + private final Optional documentList; + + private final Optional drive; + + private final Optional driveActivity; + + private final Optional driveActivityReadonly; + + private final Optional driveAppdata; + + private final Optional driveAppsReadonly; + + private final Optional driveFile; + + private final Optional driveMetadata; + + private final Optional driveMetadataReadonly; + + private final Optional drivePhotosReadonly; + + private final Optional driveReadonly; + + private final Optional driveScripts; + + private final Optional email; + + private final Optional> freeformScopes; + + private final Optional gmail; + + private final Optional gmailCompose; + + private final Optional gmailInsert; + + private final Optional gmailLabels; + + private final Optional gmailMetadata; + + private final Optional gmailModify; + + private final Optional gmailNew; + + private final Optional gmailReadonly; + + private final Optional gmailSend; + + private final Optional gmailSettingsBasic; + + private final Optional gmailSettingsSharing; + + private final Optional googleAffiliateNetwork; + + private final Optional googleBooks; + + private final Optional googleCloudStorage; + + private final Optional googleDrive; + + private final Optional googleDriveFiles; + + private final Optional googlePlus; + + private final Optional iconUrl; + + private final Optional latitudeBest; + + private final Optional latitudeCity; + + private final Optional moderator; + + private final Optional offlineAccess; + + private final Optional orkut; + + private final Optional picasaWeb; + + private final Optional profile; + + private final Optional> scope; + + private final Optional setUserRootAttributes; + + private final Optional sites; + + private final Optional tasks; + + private final Optional tasksReadonly; + + private final OptionalNullable>> + upstreamParams; + + private final Optional urlShortener; + + private final Optional webmasterTools; + + private final Optional youtube; + + private final Optional youtubeChannelmembershipsCreator; + + private final Optional youtubeNew; + + private final Optional youtubeReadonly; + + private final Optional youtubeUpload; + + private final Optional youtubepartner; + + private final Map additionalProperties; + + private ConnectionOptionsGoogleOAuth2( + Optional> nonPersistentAttrs, + Optional adsenseManagement, + Optional> allowedAudiences, + Optional analytics, + Optional blogger, + Optional calendar, + Optional calendarAddonsExecute, + Optional calendarEvents, + Optional calendarEventsReadonly, + Optional calendarSettingsReadonly, + Optional chromeWebStore, + OptionalNullable clientId, + OptionalNullable clientSecret, + Optional contacts, + Optional contactsNew, + Optional contactsOtherReadonly, + Optional contactsReadonly, + Optional contentApiForShopping, + Optional coordinate, + Optional coordinateReadonly, + Optional directoryReadonly, + Optional documentList, + Optional drive, + Optional driveActivity, + Optional driveActivityReadonly, + Optional driveAppdata, + Optional driveAppsReadonly, + Optional driveFile, + Optional driveMetadata, + Optional driveMetadataReadonly, + Optional drivePhotosReadonly, + Optional driveReadonly, + Optional driveScripts, + Optional email, + Optional> freeformScopes, + Optional gmail, + Optional gmailCompose, + Optional gmailInsert, + Optional gmailLabels, + Optional gmailMetadata, + Optional gmailModify, + Optional gmailNew, + Optional gmailReadonly, + Optional gmailSend, + Optional gmailSettingsBasic, + Optional gmailSettingsSharing, + Optional googleAffiliateNetwork, + Optional googleBooks, + Optional googleCloudStorage, + Optional googleDrive, + Optional googleDriveFiles, + Optional googlePlus, + Optional iconUrl, + Optional latitudeBest, + Optional latitudeCity, + Optional moderator, + Optional offlineAccess, + Optional orkut, + Optional picasaWeb, + Optional profile, + Optional> scope, + Optional setUserRootAttributes, + Optional sites, + Optional tasks, + Optional tasksReadonly, + OptionalNullable>> upstreamParams, + Optional urlShortener, + Optional webmasterTools, + Optional youtube, + Optional youtubeChannelmembershipsCreator, + Optional youtubeNew, + Optional youtubeReadonly, + Optional youtubeUpload, + Optional youtubepartner, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.adsenseManagement = adsenseManagement; + this.allowedAudiences = allowedAudiences; + this.analytics = analytics; + this.blogger = blogger; + this.calendar = calendar; + this.calendarAddonsExecute = calendarAddonsExecute; + this.calendarEvents = calendarEvents; + this.calendarEventsReadonly = calendarEventsReadonly; + this.calendarSettingsReadonly = calendarSettingsReadonly; + this.chromeWebStore = chromeWebStore; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.contacts = contacts; + this.contactsNew = contactsNew; + this.contactsOtherReadonly = contactsOtherReadonly; + this.contactsReadonly = contactsReadonly; + this.contentApiForShopping = contentApiForShopping; + this.coordinate = coordinate; + this.coordinateReadonly = coordinateReadonly; + this.directoryReadonly = directoryReadonly; + this.documentList = documentList; + this.drive = drive; + this.driveActivity = driveActivity; + this.driveActivityReadonly = driveActivityReadonly; + this.driveAppdata = driveAppdata; + this.driveAppsReadonly = driveAppsReadonly; + this.driveFile = driveFile; + this.driveMetadata = driveMetadata; + this.driveMetadataReadonly = driveMetadataReadonly; + this.drivePhotosReadonly = drivePhotosReadonly; + this.driveReadonly = driveReadonly; + this.driveScripts = driveScripts; + this.email = email; + this.freeformScopes = freeformScopes; + this.gmail = gmail; + this.gmailCompose = gmailCompose; + this.gmailInsert = gmailInsert; + this.gmailLabels = gmailLabels; + this.gmailMetadata = gmailMetadata; + this.gmailModify = gmailModify; + this.gmailNew = gmailNew; + this.gmailReadonly = gmailReadonly; + this.gmailSend = gmailSend; + this.gmailSettingsBasic = gmailSettingsBasic; + this.gmailSettingsSharing = gmailSettingsSharing; + this.googleAffiliateNetwork = googleAffiliateNetwork; + this.googleBooks = googleBooks; + this.googleCloudStorage = googleCloudStorage; + this.googleDrive = googleDrive; + this.googleDriveFiles = googleDriveFiles; + this.googlePlus = googlePlus; + this.iconUrl = iconUrl; + this.latitudeBest = latitudeBest; + this.latitudeCity = latitudeCity; + this.moderator = moderator; + this.offlineAccess = offlineAccess; + this.orkut = orkut; + this.picasaWeb = picasaWeb; + this.profile = profile; + this.scope = scope; + this.setUserRootAttributes = setUserRootAttributes; + this.sites = sites; + this.tasks = tasks; + this.tasksReadonly = tasksReadonly; + this.upstreamParams = upstreamParams; + this.urlShortener = urlShortener; + this.webmasterTools = webmasterTools; + this.youtube = youtube; + this.youtubeChannelmembershipsCreator = youtubeChannelmembershipsCreator; + this.youtubeNew = youtubeNew; + this.youtubeReadonly = youtubeReadonly; + this.youtubeUpload = youtubeUpload; + this.youtubepartner = youtubepartner; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + /** + * @return View and manage user's ad applications, ad units, and channels in AdSense + */ + @JsonProperty("adsense_management") + public Optional getAdsenseManagement() { + return adsenseManagement; + } + + @JsonProperty("allowed_audiences") + public Optional> getAllowedAudiences() { + return allowedAudiences; + } + + /** + * @return View user's configuration information and reports + */ + @JsonProperty("analytics") + public Optional getAnalytics() { + return analytics; + } + + /** + * @return View and manage user's posts and blogs on Blogger and Blogger comments + */ + @JsonProperty("blogger") + public Optional getBlogger() { + return blogger; + } + + /** + * @return See, edit, share, and permanently delete all the calendars you can access using Google Calendar + */ + @JsonProperty("calendar") + public Optional getCalendar() { + return calendar; + } + + /** + * @return Run as a Calendar add-on + */ + @JsonProperty("calendar_addons_execute") + public Optional getCalendarAddonsExecute() { + return calendarAddonsExecute; + } + + /** + * @return View and edit events on all your calendars + */ + @JsonProperty("calendar_events") + public Optional getCalendarEvents() { + return calendarEvents; + } + + /** + * @return View events on all your calendars + */ + @JsonProperty("calendar_events_readonly") + public Optional getCalendarEventsReadonly() { + return calendarEventsReadonly; + } + + /** + * @return View your Calendar settings + */ + @JsonProperty("calendar_settings_readonly") + public Optional getCalendarSettingsReadonly() { + return calendarSettingsReadonly; + } + + /** + * @return Read access to user's chrome web store + */ + @JsonProperty("chrome_web_store") + public Optional getChromeWebStore() { + return chromeWebStore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + public OptionalNullable getClientId() { + if (clientId == null) { + return OptionalNullable.absent(); + } + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_secret") + public OptionalNullable getClientSecret() { + if (clientSecret == null) { + return OptionalNullable.absent(); + } + return clientSecret; + } + + /** + * @return Full access to the authenticated user's contacts + */ + @JsonProperty("contacts") + public Optional getContacts() { + return contacts; + } + + /** + * @return Full access to the authenticated user's contacts + */ + @JsonProperty("contacts_new") + public Optional getContactsNew() { + return contactsNew; + } + + /** + * @return Read-only access to the authenticated user's 'Other contacts' + */ + @JsonProperty("contacts_other_readonly") + public Optional getContactsOtherReadonly() { + return contactsOtherReadonly; + } + + /** + * @return Read-only access to the authenticated user's contacts + */ + @JsonProperty("contacts_readonly") + public Optional getContactsReadonly() { + return contactsReadonly; + } + + /** + * @return View and manage user's products, feeds, and subaccounts + */ + @JsonProperty("content_api_for_shopping") + public Optional getContentApiForShopping() { + return contentApiForShopping; + } + + /** + * @return Grants read and write access to the Coordinate API + */ + @JsonProperty("coordinate") + public Optional getCoordinate() { + return coordinate; + } + + /** + * @return Grants read access to the Coordinate API + */ + @JsonProperty("coordinate_readonly") + public Optional getCoordinateReadonly() { + return coordinateReadonly; + } + + /** + * @return Read-only access to the authenticated user's corporate directory (if applicable) + */ + @JsonProperty("directory_readonly") + public Optional getDirectoryReadonly() { + return directoryReadonly; + } + + /** + * @return Access to Google Docs document list feed + */ + @JsonProperty("document_list") + public Optional getDocumentList() { + return documentList; + } + + /** + * @return Full access to all files and folders in the user's Google Drive + */ + @JsonProperty("drive") + public Optional getDrive() { + return drive; + } + + /** + * @return View and add to the activity record of files in your Drive + */ + @JsonProperty("drive_activity") + public Optional getDriveActivity() { + return driveActivity; + } + + /** + * @return View the activity record of files in your Drive + */ + @JsonProperty("drive_activity_readonly") + public Optional getDriveActivityReadonly() { + return driveActivityReadonly; + } + + /** + * @return Access to the application's configuration data in the user's Google Drive + */ + @JsonProperty("drive_appdata") + public Optional getDriveAppdata() { + return driveAppdata; + } + + /** + * @return View apps authorized to access your Drive + */ + @JsonProperty("drive_apps_readonly") + public Optional getDriveAppsReadonly() { + return driveAppsReadonly; + } + + /** + * @return Access to files created or opened by the app + */ + @JsonProperty("drive_file") + public Optional getDriveFile() { + return driveFile; + } + + /** + * @return Access to file metadata, including listing files and folders + */ + @JsonProperty("drive_metadata") + public Optional getDriveMetadata() { + return driveMetadata; + } + + /** + * @return Read-only access to file metadata + */ + @JsonProperty("drive_metadata_readonly") + public Optional getDriveMetadataReadonly() { + return driveMetadataReadonly; + } + + /** + * @return Read-only access to the user's Google Photos + */ + @JsonProperty("drive_photos_readonly") + public Optional getDrivePhotosReadonly() { + return drivePhotosReadonly; + } + + /** + * @return Read-only access to all files and folders in the user's Google Drive + */ + @JsonProperty("drive_readonly") + public Optional getDriveReadonly() { + return driveReadonly; + } + + /** + * @return Modify the behavior of Google Apps Scripts + */ + @JsonProperty("drive_scripts") + public Optional getDriveScripts() { + return driveScripts; + } + + /** + * @return Email and verified email flag + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("freeform_scopes") + public Optional> getFreeformScopes() { + return freeformScopes; + } + + /** + * @return Full access to the account's mailboxes, including permanent deletion of threads and messages + */ + @JsonProperty("gmail") + public Optional getGmail() { + return gmail; + } + + /** + * @return Read all resources and their metadata—no write operations + */ + @JsonProperty("gmail_compose") + public Optional getGmailCompose() { + return gmailCompose; + } + + /** + * @return Insert and import messages only + */ + @JsonProperty("gmail_insert") + public Optional getGmailInsert() { + return gmailInsert; + } + + /** + * @return Create, read, update, and delete labels only + */ + @JsonProperty("gmail_labels") + public Optional getGmailLabels() { + return gmailLabels; + } + + /** + * @return Read resources metadata including labels, history records, and email message headers, but not the message body or attachments + */ + @JsonProperty("gmail_metadata") + public Optional getGmailMetadata() { + return gmailMetadata; + } + + /** + * @return All read/write operations except immediate, permanent deletion of threads and messages, bypassing Trash + */ + @JsonProperty("gmail_modify") + public Optional getGmailModify() { + return gmailModify; + } + + /** + * @return Full access to the account's mailboxes, including permanent deletion of threads and messages + */ + @JsonProperty("gmail_new") + public Optional getGmailNew() { + return gmailNew; + } + + /** + * @return Read all resources and their metadata—no write operations + */ + @JsonProperty("gmail_readonly") + public Optional getGmailReadonly() { + return gmailReadonly; + } + + /** + * @return Send messages only. No read or modify privileges on mailbox + */ + @JsonProperty("gmail_send") + public Optional getGmailSend() { + return gmailSend; + } + + /** + * @return Manage basic mail settings + */ + @JsonProperty("gmail_settings_basic") + public Optional getGmailSettingsBasic() { + return gmailSettingsBasic; + } + + /** + * @return Manage sensitive mail settings, including forwarding rules and aliases. Note: Operations guarded by this scope are restricted to administrative use only + */ + @JsonProperty("gmail_settings_sharing") + public Optional getGmailSettingsSharing() { + return gmailSettingsSharing; + } + + /** + * @return View and manage user's publisher data in the Google Affiliate Network + */ + @JsonProperty("google_affiliate_network") + public Optional getGoogleAffiliateNetwork() { + return googleAffiliateNetwork; + } + + /** + * @return View and manage user's books and library in Google Books + */ + @JsonProperty("google_books") + public Optional getGoogleBooks() { + return googleBooks; + } + + /** + * @return View and manage user's data stored in Google Cloud Storage + */ + @JsonProperty("google_cloud_storage") + public Optional getGoogleCloudStorage() { + return googleCloudStorage; + } + + /** + * @return Full access to all files and folders in the user's Google Drive + */ + @JsonProperty("google_drive") + public Optional getGoogleDrive() { + return googleDrive; + } + + /** + * @return Access to files created or opened by the app + */ + @JsonProperty("google_drive_files") + public Optional getGoogleDriveFiles() { + return googleDriveFiles; + } + + /** + * @return Associate user with its public Google profile + */ + @JsonProperty("google_plus") + public Optional getGooglePlus() { + return googlePlus; + } + + @JsonProperty("icon_url") + public Optional getIconUrl() { + return iconUrl; + } + + /** + * @return View and manage user's best-available current location and location history in Google Latitude + */ + @JsonProperty("latitude_best") + public Optional getLatitudeBest() { + return latitudeBest; + } + + /** + * @return View and manage user's city-level current location and location history in Google Latitude + */ + @JsonProperty("latitude_city") + public Optional getLatitudeCity() { + return latitudeCity; + } + + /** + * @return View and manage user's votes, topics, and submissions + */ + @JsonProperty("moderator") + public Optional getModerator() { + return moderator; + } + + /** + * @return Request a refresh token when the user authorizes your application + */ + @JsonProperty("offline_access") + public Optional getOfflineAccess() { + return offlineAccess; + } + + /** + * @return View and manage user's friends, applications and profile and status + */ + @JsonProperty("orkut") + public Optional getOrkut() { + return orkut; + } + + /** + * @return View and manage user's Google photos, videos, photo and video tags and comments + */ + @JsonProperty("picasa_web") + public Optional getPicasaWeb() { + return picasaWeb; + } + + /** + * @return Name, public profile URL, photo, country, language, and timezone + */ + @JsonProperty("profile") + public Optional getProfile() { + return profile; + } + + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + /** + * @return View and manage user's sites on Google Sites + */ + @JsonProperty("sites") + public Optional getSites() { + return sites; + } + + /** + * @return Full access to create, edit, organize, and delete all your tasks + */ + @JsonProperty("tasks") + public Optional getTasks() { + return tasks; + } + + /** + * @return Read-only access to view your tasks and task lists + */ + @JsonProperty("tasks_readonly") + public Optional getTasksReadonly() { + return tasksReadonly; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + /** + * @return View, manage and view statistics user's short URLs + */ + @JsonProperty("url_shortener") + public Optional getUrlShortener() { + return urlShortener; + } + + /** + * @return View and manage user's sites and messages, view keywords + */ + @JsonProperty("webmaster_tools") + public Optional getWebmasterTools() { + return webmasterTools; + } + + /** + * @return Manage your YouTube account + */ + @JsonProperty("youtube") + public Optional getYoutube() { + return youtube; + } + + /** + * @return See a list of your current active channel members, their current level, and when they became a member + */ + @JsonProperty("youtube_channelmemberships_creator") + public Optional getYoutubeChannelmembershipsCreator() { + return youtubeChannelmembershipsCreator; + } + + /** + * @return Manage your YouTube account + */ + @JsonProperty("youtube_new") + public Optional getYoutubeNew() { + return youtubeNew; + } + + /** + * @return View your YouTube account + */ + @JsonProperty("youtube_readonly") + public Optional getYoutubeReadonly() { + return youtubeReadonly; + } + + /** + * @return Manage your YouTube videos + */ + @JsonProperty("youtube_upload") + public Optional getYoutubeUpload() { + return youtubeUpload; + } + + /** + * @return View and manage your assets and associated content on YouTube + */ + @JsonProperty("youtubepartner") + public Optional getYoutubepartner() { + return youtubepartner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_id") + private OptionalNullable _getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("client_secret") + private OptionalNullable _getClientSecret() { + return clientSecret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsGoogleOAuth2 && equalTo((ConnectionOptionsGoogleOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsGoogleOAuth2 other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && adsenseManagement.equals(other.adsenseManagement) + && allowedAudiences.equals(other.allowedAudiences) + && analytics.equals(other.analytics) + && blogger.equals(other.blogger) + && calendar.equals(other.calendar) + && calendarAddonsExecute.equals(other.calendarAddonsExecute) + && calendarEvents.equals(other.calendarEvents) + && calendarEventsReadonly.equals(other.calendarEventsReadonly) + && calendarSettingsReadonly.equals(other.calendarSettingsReadonly) + && chromeWebStore.equals(other.chromeWebStore) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && contacts.equals(other.contacts) + && contactsNew.equals(other.contactsNew) + && contactsOtherReadonly.equals(other.contactsOtherReadonly) + && contactsReadonly.equals(other.contactsReadonly) + && contentApiForShopping.equals(other.contentApiForShopping) + && coordinate.equals(other.coordinate) + && coordinateReadonly.equals(other.coordinateReadonly) + && directoryReadonly.equals(other.directoryReadonly) + && documentList.equals(other.documentList) + && drive.equals(other.drive) + && driveActivity.equals(other.driveActivity) + && driveActivityReadonly.equals(other.driveActivityReadonly) + && driveAppdata.equals(other.driveAppdata) + && driveAppsReadonly.equals(other.driveAppsReadonly) + && driveFile.equals(other.driveFile) + && driveMetadata.equals(other.driveMetadata) + && driveMetadataReadonly.equals(other.driveMetadataReadonly) + && drivePhotosReadonly.equals(other.drivePhotosReadonly) + && driveReadonly.equals(other.driveReadonly) + && driveScripts.equals(other.driveScripts) + && email.equals(other.email) + && freeformScopes.equals(other.freeformScopes) + && gmail.equals(other.gmail) + && gmailCompose.equals(other.gmailCompose) + && gmailInsert.equals(other.gmailInsert) + && gmailLabels.equals(other.gmailLabels) + && gmailMetadata.equals(other.gmailMetadata) + && gmailModify.equals(other.gmailModify) + && gmailNew.equals(other.gmailNew) + && gmailReadonly.equals(other.gmailReadonly) + && gmailSend.equals(other.gmailSend) + && gmailSettingsBasic.equals(other.gmailSettingsBasic) + && gmailSettingsSharing.equals(other.gmailSettingsSharing) + && googleAffiliateNetwork.equals(other.googleAffiliateNetwork) + && googleBooks.equals(other.googleBooks) + && googleCloudStorage.equals(other.googleCloudStorage) + && googleDrive.equals(other.googleDrive) + && googleDriveFiles.equals(other.googleDriveFiles) + && googlePlus.equals(other.googlePlus) + && iconUrl.equals(other.iconUrl) + && latitudeBest.equals(other.latitudeBest) + && latitudeCity.equals(other.latitudeCity) + && moderator.equals(other.moderator) + && offlineAccess.equals(other.offlineAccess) + && orkut.equals(other.orkut) + && picasaWeb.equals(other.picasaWeb) + && profile.equals(other.profile) + && scope.equals(other.scope) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && sites.equals(other.sites) + && tasks.equals(other.tasks) + && tasksReadonly.equals(other.tasksReadonly) + && upstreamParams.equals(other.upstreamParams) + && urlShortener.equals(other.urlShortener) + && webmasterTools.equals(other.webmasterTools) + && youtube.equals(other.youtube) + && youtubeChannelmembershipsCreator.equals(other.youtubeChannelmembershipsCreator) + && youtubeNew.equals(other.youtubeNew) + && youtubeReadonly.equals(other.youtubeReadonly) + && youtubeUpload.equals(other.youtubeUpload) + && youtubepartner.equals(other.youtubepartner); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.adsenseManagement, + this.allowedAudiences, + this.analytics, + this.blogger, + this.calendar, + this.calendarAddonsExecute, + this.calendarEvents, + this.calendarEventsReadonly, + this.calendarSettingsReadonly, + this.chromeWebStore, + this.clientId, + this.clientSecret, + this.contacts, + this.contactsNew, + this.contactsOtherReadonly, + this.contactsReadonly, + this.contentApiForShopping, + this.coordinate, + this.coordinateReadonly, + this.directoryReadonly, + this.documentList, + this.drive, + this.driveActivity, + this.driveActivityReadonly, + this.driveAppdata, + this.driveAppsReadonly, + this.driveFile, + this.driveMetadata, + this.driveMetadataReadonly, + this.drivePhotosReadonly, + this.driveReadonly, + this.driveScripts, + this.email, + this.freeformScopes, + this.gmail, + this.gmailCompose, + this.gmailInsert, + this.gmailLabels, + this.gmailMetadata, + this.gmailModify, + this.gmailNew, + this.gmailReadonly, + this.gmailSend, + this.gmailSettingsBasic, + this.gmailSettingsSharing, + this.googleAffiliateNetwork, + this.googleBooks, + this.googleCloudStorage, + this.googleDrive, + this.googleDriveFiles, + this.googlePlus, + this.iconUrl, + this.latitudeBest, + this.latitudeCity, + this.moderator, + this.offlineAccess, + this.orkut, + this.picasaWeb, + this.profile, + this.scope, + this.setUserRootAttributes, + this.sites, + this.tasks, + this.tasksReadonly, + this.upstreamParams, + this.urlShortener, + this.webmasterTools, + this.youtube, + this.youtubeChannelmembershipsCreator, + this.youtubeNew, + this.youtubeReadonly, + this.youtubeUpload, + this.youtubepartner); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional adsenseManagement = Optional.empty(); + + private Optional> allowedAudiences = Optional.empty(); + + private Optional analytics = Optional.empty(); + + private Optional blogger = Optional.empty(); + + private Optional calendar = Optional.empty(); + + private Optional calendarAddonsExecute = Optional.empty(); + + private Optional calendarEvents = Optional.empty(); + + private Optional calendarEventsReadonly = Optional.empty(); + + private Optional calendarSettingsReadonly = Optional.empty(); + + private Optional chromeWebStore = Optional.empty(); + + private OptionalNullable clientId = OptionalNullable.absent(); + + private OptionalNullable clientSecret = OptionalNullable.absent(); + + private Optional contacts = Optional.empty(); + + private Optional contactsNew = Optional.empty(); + + private Optional contactsOtherReadonly = Optional.empty(); + + private Optional contactsReadonly = Optional.empty(); + + private Optional contentApiForShopping = Optional.empty(); + + private Optional coordinate = Optional.empty(); + + private Optional coordinateReadonly = Optional.empty(); + + private Optional directoryReadonly = Optional.empty(); + + private Optional documentList = Optional.empty(); + + private Optional drive = Optional.empty(); + + private Optional driveActivity = Optional.empty(); + + private Optional driveActivityReadonly = Optional.empty(); + + private Optional driveAppdata = Optional.empty(); + + private Optional driveAppsReadonly = Optional.empty(); + + private Optional driveFile = Optional.empty(); + + private Optional driveMetadata = Optional.empty(); + + private Optional driveMetadataReadonly = Optional.empty(); + + private Optional drivePhotosReadonly = Optional.empty(); + + private Optional driveReadonly = Optional.empty(); + + private Optional driveScripts = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional> freeformScopes = Optional.empty(); + + private Optional gmail = Optional.empty(); + + private Optional gmailCompose = Optional.empty(); + + private Optional gmailInsert = Optional.empty(); + + private Optional gmailLabels = Optional.empty(); + + private Optional gmailMetadata = Optional.empty(); + + private Optional gmailModify = Optional.empty(); + + private Optional gmailNew = Optional.empty(); + + private Optional gmailReadonly = Optional.empty(); + + private Optional gmailSend = Optional.empty(); + + private Optional gmailSettingsBasic = Optional.empty(); + + private Optional gmailSettingsSharing = Optional.empty(); + + private Optional googleAffiliateNetwork = Optional.empty(); + + private Optional googleBooks = Optional.empty(); + + private Optional googleCloudStorage = Optional.empty(); + + private Optional googleDrive = Optional.empty(); + + private Optional googleDriveFiles = Optional.empty(); + + private Optional googlePlus = Optional.empty(); + + private Optional iconUrl = Optional.empty(); + + private Optional latitudeBest = Optional.empty(); + + private Optional latitudeCity = Optional.empty(); + + private Optional moderator = Optional.empty(); + + private Optional offlineAccess = Optional.empty(); + + private Optional orkut = Optional.empty(); + + private Optional picasaWeb = Optional.empty(); + + private Optional profile = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional sites = Optional.empty(); + + private Optional tasks = Optional.empty(); + + private Optional tasksReadonly = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional urlShortener = Optional.empty(); + + private Optional webmasterTools = Optional.empty(); + + private Optional youtube = Optional.empty(); + + private Optional youtubeChannelmembershipsCreator = Optional.empty(); + + private Optional youtubeNew = Optional.empty(); + + private Optional youtubeReadonly = Optional.empty(); + + private Optional youtubeUpload = Optional.empty(); + + private Optional youtubepartner = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsGoogleOAuth2 other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + adsenseManagement(other.getAdsenseManagement()); + allowedAudiences(other.getAllowedAudiences()); + analytics(other.getAnalytics()); + blogger(other.getBlogger()); + calendar(other.getCalendar()); + calendarAddonsExecute(other.getCalendarAddonsExecute()); + calendarEvents(other.getCalendarEvents()); + calendarEventsReadonly(other.getCalendarEventsReadonly()); + calendarSettingsReadonly(other.getCalendarSettingsReadonly()); + chromeWebStore(other.getChromeWebStore()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + contacts(other.getContacts()); + contactsNew(other.getContactsNew()); + contactsOtherReadonly(other.getContactsOtherReadonly()); + contactsReadonly(other.getContactsReadonly()); + contentApiForShopping(other.getContentApiForShopping()); + coordinate(other.getCoordinate()); + coordinateReadonly(other.getCoordinateReadonly()); + directoryReadonly(other.getDirectoryReadonly()); + documentList(other.getDocumentList()); + drive(other.getDrive()); + driveActivity(other.getDriveActivity()); + driveActivityReadonly(other.getDriveActivityReadonly()); + driveAppdata(other.getDriveAppdata()); + driveAppsReadonly(other.getDriveAppsReadonly()); + driveFile(other.getDriveFile()); + driveMetadata(other.getDriveMetadata()); + driveMetadataReadonly(other.getDriveMetadataReadonly()); + drivePhotosReadonly(other.getDrivePhotosReadonly()); + driveReadonly(other.getDriveReadonly()); + driveScripts(other.getDriveScripts()); + email(other.getEmail()); + freeformScopes(other.getFreeformScopes()); + gmail(other.getGmail()); + gmailCompose(other.getGmailCompose()); + gmailInsert(other.getGmailInsert()); + gmailLabels(other.getGmailLabels()); + gmailMetadata(other.getGmailMetadata()); + gmailModify(other.getGmailModify()); + gmailNew(other.getGmailNew()); + gmailReadonly(other.getGmailReadonly()); + gmailSend(other.getGmailSend()); + gmailSettingsBasic(other.getGmailSettingsBasic()); + gmailSettingsSharing(other.getGmailSettingsSharing()); + googleAffiliateNetwork(other.getGoogleAffiliateNetwork()); + googleBooks(other.getGoogleBooks()); + googleCloudStorage(other.getGoogleCloudStorage()); + googleDrive(other.getGoogleDrive()); + googleDriveFiles(other.getGoogleDriveFiles()); + googlePlus(other.getGooglePlus()); + iconUrl(other.getIconUrl()); + latitudeBest(other.getLatitudeBest()); + latitudeCity(other.getLatitudeCity()); + moderator(other.getModerator()); + offlineAccess(other.getOfflineAccess()); + orkut(other.getOrkut()); + picasaWeb(other.getPicasaWeb()); + profile(other.getProfile()); + scope(other.getScope()); + setUserRootAttributes(other.getSetUserRootAttributes()); + sites(other.getSites()); + tasks(other.getTasks()); + tasksReadonly(other.getTasksReadonly()); + upstreamParams(other.getUpstreamParams()); + urlShortener(other.getUrlShortener()); + webmasterTools(other.getWebmasterTools()); + youtube(other.getYoutube()); + youtubeChannelmembershipsCreator(other.getYoutubeChannelmembershipsCreator()); + youtubeNew(other.getYoutubeNew()); + youtubeReadonly(other.getYoutubeReadonly()); + youtubeUpload(other.getYoutubeUpload()); + youtubepartner(other.getYoutubepartner()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + /** + *

View and manage user's ad applications, ad units, and channels in AdSense

+ */ + @JsonSetter(value = "adsense_management", nulls = Nulls.SKIP) + public Builder adsenseManagement(Optional adsenseManagement) { + this.adsenseManagement = adsenseManagement; + return this; + } + + public Builder adsenseManagement(Boolean adsenseManagement) { + this.adsenseManagement = Optional.ofNullable(adsenseManagement); + return this; + } + + @JsonSetter(value = "allowed_audiences", nulls = Nulls.SKIP) + public Builder allowedAudiences(Optional> allowedAudiences) { + this.allowedAudiences = allowedAudiences; + return this; + } + + public Builder allowedAudiences(List allowedAudiences) { + this.allowedAudiences = Optional.ofNullable(allowedAudiences); + return this; + } + + /** + *

View user's configuration information and reports

+ */ + @JsonSetter(value = "analytics", nulls = Nulls.SKIP) + public Builder analytics(Optional analytics) { + this.analytics = analytics; + return this; + } + + public Builder analytics(Boolean analytics) { + this.analytics = Optional.ofNullable(analytics); + return this; + } + + /** + *

View and manage user's posts and blogs on Blogger and Blogger comments

+ */ + @JsonSetter(value = "blogger", nulls = Nulls.SKIP) + public Builder blogger(Optional blogger) { + this.blogger = blogger; + return this; + } + + public Builder blogger(Boolean blogger) { + this.blogger = Optional.ofNullable(blogger); + return this; + } + + /** + *

See, edit, share, and permanently delete all the calendars you can access using Google Calendar

+ */ + @JsonSetter(value = "calendar", nulls = Nulls.SKIP) + public Builder calendar(Optional calendar) { + this.calendar = calendar; + return this; + } + + public Builder calendar(Boolean calendar) { + this.calendar = Optional.ofNullable(calendar); + return this; + } + + /** + *

Run as a Calendar add-on

+ */ + @JsonSetter(value = "calendar_addons_execute", nulls = Nulls.SKIP) + public Builder calendarAddonsExecute(Optional calendarAddonsExecute) { + this.calendarAddonsExecute = calendarAddonsExecute; + return this; + } + + public Builder calendarAddonsExecute(Boolean calendarAddonsExecute) { + this.calendarAddonsExecute = Optional.ofNullable(calendarAddonsExecute); + return this; + } + + /** + *

View and edit events on all your calendars

+ */ + @JsonSetter(value = "calendar_events", nulls = Nulls.SKIP) + public Builder calendarEvents(Optional calendarEvents) { + this.calendarEvents = calendarEvents; + return this; + } + + public Builder calendarEvents(Boolean calendarEvents) { + this.calendarEvents = Optional.ofNullable(calendarEvents); + return this; + } + + /** + *

View events on all your calendars

+ */ + @JsonSetter(value = "calendar_events_readonly", nulls = Nulls.SKIP) + public Builder calendarEventsReadonly(Optional calendarEventsReadonly) { + this.calendarEventsReadonly = calendarEventsReadonly; + return this; + } + + public Builder calendarEventsReadonly(Boolean calendarEventsReadonly) { + this.calendarEventsReadonly = Optional.ofNullable(calendarEventsReadonly); + return this; + } + + /** + *

View your Calendar settings

+ */ + @JsonSetter(value = "calendar_settings_readonly", nulls = Nulls.SKIP) + public Builder calendarSettingsReadonly(Optional calendarSettingsReadonly) { + this.calendarSettingsReadonly = calendarSettingsReadonly; + return this; + } + + public Builder calendarSettingsReadonly(Boolean calendarSettingsReadonly) { + this.calendarSettingsReadonly = Optional.ofNullable(calendarSettingsReadonly); + return this; + } + + /** + *

Read access to user's chrome web store

+ */ + @JsonSetter(value = "chrome_web_store", nulls = Nulls.SKIP) + public Builder chromeWebStore(Optional chromeWebStore) { + this.chromeWebStore = chromeWebStore; + return this; + } + + public Builder chromeWebStore(Boolean chromeWebStore) { + this.chromeWebStore = Optional.ofNullable(chromeWebStore); + return this; + } + + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(@Nullable OptionalNullable clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = OptionalNullable.of(clientId); + return this; + } + + public Builder clientId(Optional clientId) { + if (clientId.isPresent()) { + this.clientId = OptionalNullable.of(clientId.get()); + } else { + this.clientId = OptionalNullable.absent(); + } + return this; + } + + public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + if (clientId.isNull()) { + this.clientId = OptionalNullable.ofNull(); + } else if (clientId.isEmpty()) { + this.clientId = OptionalNullable.absent(); + } else { + this.clientId = OptionalNullable.of(clientId.get()); + } + return this; + } + + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(@Nullable OptionalNullable clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = OptionalNullable.of(clientSecret); + return this; + } + + public Builder clientSecret(Optional clientSecret) { + if (clientSecret.isPresent()) { + this.clientSecret = OptionalNullable.of(clientSecret.get()); + } else { + this.clientSecret = OptionalNullable.absent(); + } + return this; + } + + public Builder clientSecret(com.auth0.client.mgmt.core.Nullable clientSecret) { + if (clientSecret.isNull()) { + this.clientSecret = OptionalNullable.ofNull(); + } else if (clientSecret.isEmpty()) { + this.clientSecret = OptionalNullable.absent(); + } else { + this.clientSecret = OptionalNullable.of(clientSecret.get()); + } + return this; + } + + /** + *

Full access to the authenticated user's contacts

+ */ + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) + public Builder contacts(Optional contacts) { + this.contacts = contacts; + return this; + } + + public Builder contacts(Boolean contacts) { + this.contacts = Optional.ofNullable(contacts); + return this; + } + + /** + *

Full access to the authenticated user's contacts

+ */ + @JsonSetter(value = "contacts_new", nulls = Nulls.SKIP) + public Builder contactsNew(Optional contactsNew) { + this.contactsNew = contactsNew; + return this; + } + + public Builder contactsNew(Boolean contactsNew) { + this.contactsNew = Optional.ofNullable(contactsNew); + return this; + } + + /** + *

Read-only access to the authenticated user's 'Other contacts'

+ */ + @JsonSetter(value = "contacts_other_readonly", nulls = Nulls.SKIP) + public Builder contactsOtherReadonly(Optional contactsOtherReadonly) { + this.contactsOtherReadonly = contactsOtherReadonly; + return this; + } + + public Builder contactsOtherReadonly(Boolean contactsOtherReadonly) { + this.contactsOtherReadonly = Optional.ofNullable(contactsOtherReadonly); + return this; + } + + /** + *

Read-only access to the authenticated user's contacts

+ */ + @JsonSetter(value = "contacts_readonly", nulls = Nulls.SKIP) + public Builder contactsReadonly(Optional contactsReadonly) { + this.contactsReadonly = contactsReadonly; + return this; + } + + public Builder contactsReadonly(Boolean contactsReadonly) { + this.contactsReadonly = Optional.ofNullable(contactsReadonly); + return this; + } + + /** + *

View and manage user's products, feeds, and subaccounts

+ */ + @JsonSetter(value = "content_api_for_shopping", nulls = Nulls.SKIP) + public Builder contentApiForShopping(Optional contentApiForShopping) { + this.contentApiForShopping = contentApiForShopping; + return this; + } + + public Builder contentApiForShopping(Boolean contentApiForShopping) { + this.contentApiForShopping = Optional.ofNullable(contentApiForShopping); + return this; + } + + /** + *

Grants read and write access to the Coordinate API

+ */ + @JsonSetter(value = "coordinate", nulls = Nulls.SKIP) + public Builder coordinate(Optional coordinate) { + this.coordinate = coordinate; + return this; + } + + public Builder coordinate(Boolean coordinate) { + this.coordinate = Optional.ofNullable(coordinate); + return this; + } + + /** + *

Grants read access to the Coordinate API

+ */ + @JsonSetter(value = "coordinate_readonly", nulls = Nulls.SKIP) + public Builder coordinateReadonly(Optional coordinateReadonly) { + this.coordinateReadonly = coordinateReadonly; + return this; + } + + public Builder coordinateReadonly(Boolean coordinateReadonly) { + this.coordinateReadonly = Optional.ofNullable(coordinateReadonly); + return this; + } + + /** + *

Read-only access to the authenticated user's corporate directory (if applicable)

+ */ + @JsonSetter(value = "directory_readonly", nulls = Nulls.SKIP) + public Builder directoryReadonly(Optional directoryReadonly) { + this.directoryReadonly = directoryReadonly; + return this; + } + + public Builder directoryReadonly(Boolean directoryReadonly) { + this.directoryReadonly = Optional.ofNullable(directoryReadonly); + return this; + } + + /** + *

Access to Google Docs document list feed

+ */ + @JsonSetter(value = "document_list", nulls = Nulls.SKIP) + public Builder documentList(Optional documentList) { + this.documentList = documentList; + return this; + } + + public Builder documentList(Boolean documentList) { + this.documentList = Optional.ofNullable(documentList); + return this; + } + + /** + *

Full access to all files and folders in the user's Google Drive

+ */ + @JsonSetter(value = "drive", nulls = Nulls.SKIP) + public Builder drive(Optional drive) { + this.drive = drive; + return this; + } + + public Builder drive(Boolean drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + /** + *

View and add to the activity record of files in your Drive

+ */ + @JsonSetter(value = "drive_activity", nulls = Nulls.SKIP) + public Builder driveActivity(Optional driveActivity) { + this.driveActivity = driveActivity; + return this; + } + + public Builder driveActivity(Boolean driveActivity) { + this.driveActivity = Optional.ofNullable(driveActivity); + return this; + } + + /** + *

View the activity record of files in your Drive

+ */ + @JsonSetter(value = "drive_activity_readonly", nulls = Nulls.SKIP) + public Builder driveActivityReadonly(Optional driveActivityReadonly) { + this.driveActivityReadonly = driveActivityReadonly; + return this; + } + + public Builder driveActivityReadonly(Boolean driveActivityReadonly) { + this.driveActivityReadonly = Optional.ofNullable(driveActivityReadonly); + return this; + } + + /** + *

Access to the application's configuration data in the user's Google Drive

+ */ + @JsonSetter(value = "drive_appdata", nulls = Nulls.SKIP) + public Builder driveAppdata(Optional driveAppdata) { + this.driveAppdata = driveAppdata; + return this; + } + + public Builder driveAppdata(Boolean driveAppdata) { + this.driveAppdata = Optional.ofNullable(driveAppdata); + return this; + } + + /** + *

View apps authorized to access your Drive

+ */ + @JsonSetter(value = "drive_apps_readonly", nulls = Nulls.SKIP) + public Builder driveAppsReadonly(Optional driveAppsReadonly) { + this.driveAppsReadonly = driveAppsReadonly; + return this; + } + + public Builder driveAppsReadonly(Boolean driveAppsReadonly) { + this.driveAppsReadonly = Optional.ofNullable(driveAppsReadonly); + return this; + } + + /** + *

Access to files created or opened by the app

+ */ + @JsonSetter(value = "drive_file", nulls = Nulls.SKIP) + public Builder driveFile(Optional driveFile) { + this.driveFile = driveFile; + return this; + } + + public Builder driveFile(Boolean driveFile) { + this.driveFile = Optional.ofNullable(driveFile); + return this; + } + + /** + *

Access to file metadata, including listing files and folders

+ */ + @JsonSetter(value = "drive_metadata", nulls = Nulls.SKIP) + public Builder driveMetadata(Optional driveMetadata) { + this.driveMetadata = driveMetadata; + return this; + } + + public Builder driveMetadata(Boolean driveMetadata) { + this.driveMetadata = Optional.ofNullable(driveMetadata); + return this; + } + + /** + *

Read-only access to file metadata

+ */ + @JsonSetter(value = "drive_metadata_readonly", nulls = Nulls.SKIP) + public Builder driveMetadataReadonly(Optional driveMetadataReadonly) { + this.driveMetadataReadonly = driveMetadataReadonly; + return this; + } + + public Builder driveMetadataReadonly(Boolean driveMetadataReadonly) { + this.driveMetadataReadonly = Optional.ofNullable(driveMetadataReadonly); + return this; + } + + /** + *

Read-only access to the user's Google Photos

+ */ + @JsonSetter(value = "drive_photos_readonly", nulls = Nulls.SKIP) + public Builder drivePhotosReadonly(Optional drivePhotosReadonly) { + this.drivePhotosReadonly = drivePhotosReadonly; + return this; + } + + public Builder drivePhotosReadonly(Boolean drivePhotosReadonly) { + this.drivePhotosReadonly = Optional.ofNullable(drivePhotosReadonly); + return this; + } + + /** + *

Read-only access to all files and folders in the user's Google Drive

+ */ + @JsonSetter(value = "drive_readonly", nulls = Nulls.SKIP) + public Builder driveReadonly(Optional driveReadonly) { + this.driveReadonly = driveReadonly; + return this; + } + + public Builder driveReadonly(Boolean driveReadonly) { + this.driveReadonly = Optional.ofNullable(driveReadonly); + return this; + } + + /** + *

Modify the behavior of Google Apps Scripts

+ */ + @JsonSetter(value = "drive_scripts", nulls = Nulls.SKIP) + public Builder driveScripts(Optional driveScripts) { + this.driveScripts = driveScripts; + return this; + } + + public Builder driveScripts(Boolean driveScripts) { + this.driveScripts = Optional.ofNullable(driveScripts); + return this; + } + + /** + *

Email and verified email flag

+ */ + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(Boolean email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "freeform_scopes", nulls = Nulls.SKIP) + public Builder freeformScopes(Optional> freeformScopes) { + this.freeformScopes = freeformScopes; + return this; + } + + public Builder freeformScopes(List freeformScopes) { + this.freeformScopes = Optional.ofNullable(freeformScopes); + return this; + } + + /** + *

Full access to the account's mailboxes, including permanent deletion of threads and messages

+ */ + @JsonSetter(value = "gmail", nulls = Nulls.SKIP) + public Builder gmail(Optional gmail) { + this.gmail = gmail; + return this; + } + + public Builder gmail(Boolean gmail) { + this.gmail = Optional.ofNullable(gmail); + return this; + } + + /** + *

Read all resources and their metadata—no write operations

+ */ + @JsonSetter(value = "gmail_compose", nulls = Nulls.SKIP) + public Builder gmailCompose(Optional gmailCompose) { + this.gmailCompose = gmailCompose; + return this; + } + + public Builder gmailCompose(Boolean gmailCompose) { + this.gmailCompose = Optional.ofNullable(gmailCompose); + return this; + } + + /** + *

Insert and import messages only

+ */ + @JsonSetter(value = "gmail_insert", nulls = Nulls.SKIP) + public Builder gmailInsert(Optional gmailInsert) { + this.gmailInsert = gmailInsert; + return this; + } + + public Builder gmailInsert(Boolean gmailInsert) { + this.gmailInsert = Optional.ofNullable(gmailInsert); + return this; + } + + /** + *

Create, read, update, and delete labels only

+ */ + @JsonSetter(value = "gmail_labels", nulls = Nulls.SKIP) + public Builder gmailLabels(Optional gmailLabels) { + this.gmailLabels = gmailLabels; + return this; + } + + public Builder gmailLabels(Boolean gmailLabels) { + this.gmailLabels = Optional.ofNullable(gmailLabels); + return this; + } + + /** + *

Read resources metadata including labels, history records, and email message headers, but not the message body or attachments

+ */ + @JsonSetter(value = "gmail_metadata", nulls = Nulls.SKIP) + public Builder gmailMetadata(Optional gmailMetadata) { + this.gmailMetadata = gmailMetadata; + return this; + } + + public Builder gmailMetadata(Boolean gmailMetadata) { + this.gmailMetadata = Optional.ofNullable(gmailMetadata); + return this; + } + + /** + *

All read/write operations except immediate, permanent deletion of threads and messages, bypassing Trash

+ */ + @JsonSetter(value = "gmail_modify", nulls = Nulls.SKIP) + public Builder gmailModify(Optional gmailModify) { + this.gmailModify = gmailModify; + return this; + } + + public Builder gmailModify(Boolean gmailModify) { + this.gmailModify = Optional.ofNullable(gmailModify); + return this; + } + + /** + *

Full access to the account's mailboxes, including permanent deletion of threads and messages

+ */ + @JsonSetter(value = "gmail_new", nulls = Nulls.SKIP) + public Builder gmailNew(Optional gmailNew) { + this.gmailNew = gmailNew; + return this; + } + + public Builder gmailNew(Boolean gmailNew) { + this.gmailNew = Optional.ofNullable(gmailNew); + return this; + } + + /** + *

Read all resources and their metadata—no write operations

+ */ + @JsonSetter(value = "gmail_readonly", nulls = Nulls.SKIP) + public Builder gmailReadonly(Optional gmailReadonly) { + this.gmailReadonly = gmailReadonly; + return this; + } + + public Builder gmailReadonly(Boolean gmailReadonly) { + this.gmailReadonly = Optional.ofNullable(gmailReadonly); + return this; + } + + /** + *

Send messages only. No read or modify privileges on mailbox

+ */ + @JsonSetter(value = "gmail_send", nulls = Nulls.SKIP) + public Builder gmailSend(Optional gmailSend) { + this.gmailSend = gmailSend; + return this; + } + + public Builder gmailSend(Boolean gmailSend) { + this.gmailSend = Optional.ofNullable(gmailSend); + return this; + } + + /** + *

Manage basic mail settings

+ */ + @JsonSetter(value = "gmail_settings_basic", nulls = Nulls.SKIP) + public Builder gmailSettingsBasic(Optional gmailSettingsBasic) { + this.gmailSettingsBasic = gmailSettingsBasic; + return this; + } + + public Builder gmailSettingsBasic(Boolean gmailSettingsBasic) { + this.gmailSettingsBasic = Optional.ofNullable(gmailSettingsBasic); + return this; + } + + /** + *

Manage sensitive mail settings, including forwarding rules and aliases. Note: Operations guarded by this scope are restricted to administrative use only

+ */ + @JsonSetter(value = "gmail_settings_sharing", nulls = Nulls.SKIP) + public Builder gmailSettingsSharing(Optional gmailSettingsSharing) { + this.gmailSettingsSharing = gmailSettingsSharing; + return this; + } + + public Builder gmailSettingsSharing(Boolean gmailSettingsSharing) { + this.gmailSettingsSharing = Optional.ofNullable(gmailSettingsSharing); + return this; + } + + /** + *

View and manage user's publisher data in the Google Affiliate Network

+ */ + @JsonSetter(value = "google_affiliate_network", nulls = Nulls.SKIP) + public Builder googleAffiliateNetwork(Optional googleAffiliateNetwork) { + this.googleAffiliateNetwork = googleAffiliateNetwork; + return this; + } + + public Builder googleAffiliateNetwork(Boolean googleAffiliateNetwork) { + this.googleAffiliateNetwork = Optional.ofNullable(googleAffiliateNetwork); + return this; + } + + /** + *

View and manage user's books and library in Google Books

+ */ + @JsonSetter(value = "google_books", nulls = Nulls.SKIP) + public Builder googleBooks(Optional googleBooks) { + this.googleBooks = googleBooks; + return this; + } + + public Builder googleBooks(Boolean googleBooks) { + this.googleBooks = Optional.ofNullable(googleBooks); + return this; + } + + /** + *

View and manage user's data stored in Google Cloud Storage

+ */ + @JsonSetter(value = "google_cloud_storage", nulls = Nulls.SKIP) + public Builder googleCloudStorage(Optional googleCloudStorage) { + this.googleCloudStorage = googleCloudStorage; + return this; + } + + public Builder googleCloudStorage(Boolean googleCloudStorage) { + this.googleCloudStorage = Optional.ofNullable(googleCloudStorage); + return this; + } + + /** + *

Full access to all files and folders in the user's Google Drive

+ */ + @JsonSetter(value = "google_drive", nulls = Nulls.SKIP) + public Builder googleDrive(Optional googleDrive) { + this.googleDrive = googleDrive; + return this; + } + + public Builder googleDrive(Boolean googleDrive) { + this.googleDrive = Optional.ofNullable(googleDrive); + return this; + } + + /** + *

Access to files created or opened by the app

+ */ + @JsonSetter(value = "google_drive_files", nulls = Nulls.SKIP) + public Builder googleDriveFiles(Optional googleDriveFiles) { + this.googleDriveFiles = googleDriveFiles; + return this; + } + + public Builder googleDriveFiles(Boolean googleDriveFiles) { + this.googleDriveFiles = Optional.ofNullable(googleDriveFiles); + return this; + } + + /** + *

Associate user with its public Google profile

+ */ + @JsonSetter(value = "google_plus", nulls = Nulls.SKIP) + public Builder googlePlus(Optional googlePlus) { + this.googlePlus = googlePlus; + return this; + } + + public Builder googlePlus(Boolean googlePlus) { + this.googlePlus = Optional.ofNullable(googlePlus); + return this; + } + + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public Builder iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + public Builder iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + /** + *

View and manage user's best-available current location and location history in Google Latitude

+ */ + @JsonSetter(value = "latitude_best", nulls = Nulls.SKIP) + public Builder latitudeBest(Optional latitudeBest) { + this.latitudeBest = latitudeBest; + return this; + } + + public Builder latitudeBest(Boolean latitudeBest) { + this.latitudeBest = Optional.ofNullable(latitudeBest); + return this; + } + + /** + *

View and manage user's city-level current location and location history in Google Latitude

+ */ + @JsonSetter(value = "latitude_city", nulls = Nulls.SKIP) + public Builder latitudeCity(Optional latitudeCity) { + this.latitudeCity = latitudeCity; + return this; + } + + public Builder latitudeCity(Boolean latitudeCity) { + this.latitudeCity = Optional.ofNullable(latitudeCity); + return this; + } + + /** + *

View and manage user's votes, topics, and submissions

+ */ + @JsonSetter(value = "moderator", nulls = Nulls.SKIP) + public Builder moderator(Optional moderator) { + this.moderator = moderator; + return this; + } + + public Builder moderator(Boolean moderator) { + this.moderator = Optional.ofNullable(moderator); + return this; + } + + /** + *

Request a refresh token when the user authorizes your application

+ */ + @JsonSetter(value = "offline_access", nulls = Nulls.SKIP) + public Builder offlineAccess(Optional offlineAccess) { + this.offlineAccess = offlineAccess; + return this; + } + + public Builder offlineAccess(Boolean offlineAccess) { + this.offlineAccess = Optional.ofNullable(offlineAccess); + return this; + } + + /** + *

View and manage user's friends, applications and profile and status

+ */ + @JsonSetter(value = "orkut", nulls = Nulls.SKIP) + public Builder orkut(Optional orkut) { + this.orkut = orkut; + return this; + } + + public Builder orkut(Boolean orkut) { + this.orkut = Optional.ofNullable(orkut); + return this; + } + + /** + *

View and manage user's Google photos, videos, photo and video tags and comments

+ */ + @JsonSetter(value = "picasa_web", nulls = Nulls.SKIP) + public Builder picasaWeb(Optional picasaWeb) { + this.picasaWeb = picasaWeb; + return this; + } + + public Builder picasaWeb(Boolean picasaWeb) { + this.picasaWeb = Optional.ofNullable(picasaWeb); + return this; + } + + /** + *

Name, public profile URL, photo, country, language, and timezone

+ */ + @JsonSetter(value = "profile", nulls = Nulls.SKIP) + public Builder profile(Optional profile) { + this.profile = profile; + return this; + } + + public Builder profile(Boolean profile) { + this.profile = Optional.ofNullable(profile); + return this; + } + + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional> scope) { + this.scope = scope; + return this; + } + + public Builder scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + /** + *

View and manage user's sites on Google Sites

+ */ + @JsonSetter(value = "sites", nulls = Nulls.SKIP) + public Builder sites(Optional sites) { + this.sites = sites; + return this; + } + + public Builder sites(Boolean sites) { + this.sites = Optional.ofNullable(sites); + return this; + } + + /** + *

Full access to create, edit, organize, and delete all your tasks

+ */ + @JsonSetter(value = "tasks", nulls = Nulls.SKIP) + public Builder tasks(Optional tasks) { + this.tasks = tasks; + return this; + } + + public Builder tasks(Boolean tasks) { + this.tasks = Optional.ofNullable(tasks); + return this; + } + + /** + *

Read-only access to view your tasks and task lists

+ */ + @JsonSetter(value = "tasks_readonly", nulls = Nulls.SKIP) + public Builder tasksReadonly(Optional tasksReadonly) { + this.tasksReadonly = tasksReadonly; + return this; + } + + public Builder tasksReadonly(Boolean tasksReadonly) { + this.tasksReadonly = Optional.ofNullable(tasksReadonly); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + /** + *

View, manage and view statistics user's short URLs

+ */ + @JsonSetter(value = "url_shortener", nulls = Nulls.SKIP) + public Builder urlShortener(Optional urlShortener) { + this.urlShortener = urlShortener; + return this; + } + + public Builder urlShortener(Boolean urlShortener) { + this.urlShortener = Optional.ofNullable(urlShortener); + return this; + } + + /** + *

View and manage user's sites and messages, view keywords

+ */ + @JsonSetter(value = "webmaster_tools", nulls = Nulls.SKIP) + public Builder webmasterTools(Optional webmasterTools) { + this.webmasterTools = webmasterTools; + return this; + } + + public Builder webmasterTools(Boolean webmasterTools) { + this.webmasterTools = Optional.ofNullable(webmasterTools); + return this; + } + + /** + *

Manage your YouTube account

+ */ + @JsonSetter(value = "youtube", nulls = Nulls.SKIP) + public Builder youtube(Optional youtube) { + this.youtube = youtube; + return this; + } + + public Builder youtube(Boolean youtube) { + this.youtube = Optional.ofNullable(youtube); + return this; + } + + /** + *

See a list of your current active channel members, their current level, and when they became a member

+ */ + @JsonSetter(value = "youtube_channelmemberships_creator", nulls = Nulls.SKIP) + public Builder youtubeChannelmembershipsCreator(Optional youtubeChannelmembershipsCreator) { + this.youtubeChannelmembershipsCreator = youtubeChannelmembershipsCreator; + return this; + } + + public Builder youtubeChannelmembershipsCreator(Boolean youtubeChannelmembershipsCreator) { + this.youtubeChannelmembershipsCreator = Optional.ofNullable(youtubeChannelmembershipsCreator); + return this; + } + + /** + *

Manage your YouTube account

+ */ + @JsonSetter(value = "youtube_new", nulls = Nulls.SKIP) + public Builder youtubeNew(Optional youtubeNew) { + this.youtubeNew = youtubeNew; + return this; + } + + public Builder youtubeNew(Boolean youtubeNew) { + this.youtubeNew = Optional.ofNullable(youtubeNew); + return this; + } + + /** + *

View your YouTube account

+ */ + @JsonSetter(value = "youtube_readonly", nulls = Nulls.SKIP) + public Builder youtubeReadonly(Optional youtubeReadonly) { + this.youtubeReadonly = youtubeReadonly; + return this; + } + + public Builder youtubeReadonly(Boolean youtubeReadonly) { + this.youtubeReadonly = Optional.ofNullable(youtubeReadonly); + return this; + } + + /** + *

Manage your YouTube videos

+ */ + @JsonSetter(value = "youtube_upload", nulls = Nulls.SKIP) + public Builder youtubeUpload(Optional youtubeUpload) { + this.youtubeUpload = youtubeUpload; + return this; + } + + public Builder youtubeUpload(Boolean youtubeUpload) { + this.youtubeUpload = Optional.ofNullable(youtubeUpload); + return this; + } + + /** + *

View and manage your assets and associated content on YouTube

+ */ + @JsonSetter(value = "youtubepartner", nulls = Nulls.SKIP) + public Builder youtubepartner(Optional youtubepartner) { + this.youtubepartner = youtubepartner; + return this; + } + + public Builder youtubepartner(Boolean youtubepartner) { + this.youtubepartner = Optional.ofNullable(youtubepartner); + return this; + } + + public ConnectionOptionsGoogleOAuth2 build() { + return new ConnectionOptionsGoogleOAuth2( + nonPersistentAttrs, + adsenseManagement, + allowedAudiences, + analytics, + blogger, + calendar, + calendarAddonsExecute, + calendarEvents, + calendarEventsReadonly, + calendarSettingsReadonly, + chromeWebStore, + clientId, + clientSecret, + contacts, + contactsNew, + contactsOtherReadonly, + contactsReadonly, + contentApiForShopping, + coordinate, + coordinateReadonly, + directoryReadonly, + documentList, + drive, + driveActivity, + driveActivityReadonly, + driveAppdata, + driveAppsReadonly, + driveFile, + driveMetadata, + driveMetadataReadonly, + drivePhotosReadonly, + driveReadonly, + driveScripts, + email, + freeformScopes, + gmail, + gmailCompose, + gmailInsert, + gmailLabels, + gmailMetadata, + gmailModify, + gmailNew, + gmailReadonly, + gmailSend, + gmailSettingsBasic, + gmailSettingsSharing, + googleAffiliateNetwork, + googleBooks, + googleCloudStorage, + googleDrive, + googleDriveFiles, + googlePlus, + iconUrl, + latitudeBest, + latitudeCity, + moderator, + offlineAccess, + orkut, + picasaWeb, + profile, + scope, + setUserRootAttributes, + sites, + tasks, + tasksReadonly, + upstreamParams, + urlShortener, + webmasterTools, + youtube, + youtubeChannelmembershipsCreator, + youtubeNew, + youtubeReadonly, + youtubeUpload, + youtubepartner, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java new file mode 100644 index 000000000..77b1c1856 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java @@ -0,0 +1,574 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsOAuth2.Builder.class) +public final class ConnectionOptionsOAuth2 implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional> authParams; + + private final Optional> authParamsMap; + + private final Optional authorizationUrl; + + private final Optional clientId; + + private final Optional clientSecret; + + private final Optional> customHeaders; + + private final Optional> fieldsMap; + + private final Optional iconUrl; + + private final Optional logoutUrl; + + private final Optional pkceEnabled; + + private final Optional scope; + + private final Optional scripts; + + private final Optional setUserRootAttributes; + + private final Optional tokenUrl; + + private final OptionalNullable>> + upstreamParams; + + private final Optional useOauthSpecScope; + + private final Map additionalProperties; + + private ConnectionOptionsOAuth2( + Optional> nonPersistentAttrs, + Optional> authParams, + Optional> authParamsMap, + Optional authorizationUrl, + Optional clientId, + Optional clientSecret, + Optional> customHeaders, + Optional> fieldsMap, + Optional iconUrl, + Optional logoutUrl, + Optional pkceEnabled, + Optional scope, + Optional scripts, + Optional setUserRootAttributes, + Optional tokenUrl, + OptionalNullable>> upstreamParams, + Optional useOauthSpecScope, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.authParams = authParams; + this.authParamsMap = authParamsMap; + this.authorizationUrl = authorizationUrl; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.customHeaders = customHeaders; + this.fieldsMap = fieldsMap; + this.iconUrl = iconUrl; + this.logoutUrl = logoutUrl; + this.pkceEnabled = pkceEnabled; + this.scope = scope; + this.scripts = scripts; + this.setUserRootAttributes = setUserRootAttributes; + this.tokenUrl = tokenUrl; + this.upstreamParams = upstreamParams; + this.useOauthSpecScope = useOauthSpecScope; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("authParams") + public Optional> getAuthParams() { + return authParams; + } + + @JsonProperty("authParamsMap") + public Optional> getAuthParamsMap() { + return authParamsMap; + } + + @JsonProperty("authorizationURL") + public Optional getAuthorizationUrl() { + return authorizationUrl; + } + + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("customHeaders") + public Optional> getCustomHeaders() { + return customHeaders; + } + + @JsonProperty("fieldsMap") + public Optional> getFieldsMap() { + return fieldsMap; + } + + @JsonProperty("icon_url") + public Optional getIconUrl() { + return iconUrl; + } + + @JsonProperty("logoutUrl") + public Optional getLogoutUrl() { + return logoutUrl; + } + + /** + * @return When true, enables Proof Key for Code Exchange (PKCE) for the authorization code flow. PKCE provides additional security by preventing authorization code interception attacks. + */ + @JsonProperty("pkce_enabled") + public Optional getPkceEnabled() { + return pkceEnabled; + } + + @JsonProperty("scope") + public Optional getScope() { + return scope; + } + + @JsonProperty("scripts") + public Optional getScripts() { + return scripts; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonProperty("tokenURL") + public Optional getTokenUrl() { + return tokenUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + /** + * @return When true, uses space-delimited scopes (per OAuth 2.0 spec) instead of comma-delimited when calling the identity provider's authorization endpoint. Only relevant when using the connection_scope parameter. See https://auth0.com/docs/authenticate/identity-providers/adding-scopes-for-an-external-idp#pass-scopes-to-authorize-endpoint + */ + @JsonProperty("useOauthSpecScope") + public Optional getUseOauthSpecScope() { + return useOauthSpecScope; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsOAuth2 && equalTo((ConnectionOptionsOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsOAuth2 other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && authParams.equals(other.authParams) + && authParamsMap.equals(other.authParamsMap) + && authorizationUrl.equals(other.authorizationUrl) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && customHeaders.equals(other.customHeaders) + && fieldsMap.equals(other.fieldsMap) + && iconUrl.equals(other.iconUrl) + && logoutUrl.equals(other.logoutUrl) + && pkceEnabled.equals(other.pkceEnabled) + && scope.equals(other.scope) + && scripts.equals(other.scripts) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && tokenUrl.equals(other.tokenUrl) + && upstreamParams.equals(other.upstreamParams) + && useOauthSpecScope.equals(other.useOauthSpecScope); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.authParams, + this.authParamsMap, + this.authorizationUrl, + this.clientId, + this.clientSecret, + this.customHeaders, + this.fieldsMap, + this.iconUrl, + this.logoutUrl, + this.pkceEnabled, + this.scope, + this.scripts, + this.setUserRootAttributes, + this.tokenUrl, + this.upstreamParams, + this.useOauthSpecScope); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional> authParams = Optional.empty(); + + private Optional> authParamsMap = Optional.empty(); + + private Optional authorizationUrl = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional> customHeaders = Optional.empty(); + + private Optional> fieldsMap = Optional.empty(); + + private Optional iconUrl = Optional.empty(); + + private Optional logoutUrl = Optional.empty(); + + private Optional pkceEnabled = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional scripts = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional tokenUrl = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional useOauthSpecScope = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsOAuth2 other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + authParams(other.getAuthParams()); + authParamsMap(other.getAuthParamsMap()); + authorizationUrl(other.getAuthorizationUrl()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + customHeaders(other.getCustomHeaders()); + fieldsMap(other.getFieldsMap()); + iconUrl(other.getIconUrl()); + logoutUrl(other.getLogoutUrl()); + pkceEnabled(other.getPkceEnabled()); + scope(other.getScope()); + scripts(other.getScripts()); + setUserRootAttributes(other.getSetUserRootAttributes()); + tokenUrl(other.getTokenUrl()); + upstreamParams(other.getUpstreamParams()); + useOauthSpecScope(other.getUseOauthSpecScope()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @JsonSetter(value = "authParams", nulls = Nulls.SKIP) + public Builder authParams(Optional> authParams) { + this.authParams = authParams; + return this; + } + + public Builder authParams(Map authParams) { + this.authParams = Optional.ofNullable(authParams); + return this; + } + + @JsonSetter(value = "authParamsMap", nulls = Nulls.SKIP) + public Builder authParamsMap(Optional> authParamsMap) { + this.authParamsMap = authParamsMap; + return this; + } + + public Builder authParamsMap(Map authParamsMap) { + this.authParamsMap = Optional.ofNullable(authParamsMap); + return this; + } + + @JsonSetter(value = "authorizationURL", nulls = Nulls.SKIP) + public Builder authorizationUrl(Optional authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + public Builder authorizationUrl(String authorizationUrl) { + this.authorizationUrl = Optional.ofNullable(authorizationUrl); + return this; + } + + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @JsonSetter(value = "customHeaders", nulls = Nulls.SKIP) + public Builder customHeaders(Optional> customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public Builder customHeaders(Map customHeaders) { + this.customHeaders = Optional.ofNullable(customHeaders); + return this; + } + + @JsonSetter(value = "fieldsMap", nulls = Nulls.SKIP) + public Builder fieldsMap(Optional> fieldsMap) { + this.fieldsMap = fieldsMap; + return this; + } + + public Builder fieldsMap(Map fieldsMap) { + this.fieldsMap = Optional.ofNullable(fieldsMap); + return this; + } + + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public Builder iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + public Builder iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @JsonSetter(value = "logoutUrl", nulls = Nulls.SKIP) + public Builder logoutUrl(Optional logoutUrl) { + this.logoutUrl = logoutUrl; + return this; + } + + public Builder logoutUrl(String logoutUrl) { + this.logoutUrl = Optional.ofNullable(logoutUrl); + return this; + } + + /** + *

When true, enables Proof Key for Code Exchange (PKCE) for the authorization code flow. PKCE provides additional security by preventing authorization code interception attacks.

+ */ + @JsonSetter(value = "pkce_enabled", nulls = Nulls.SKIP) + public Builder pkceEnabled(Optional pkceEnabled) { + this.pkceEnabled = pkceEnabled; + return this; + } + + public Builder pkceEnabled(Boolean pkceEnabled) { + this.pkceEnabled = Optional.ofNullable(pkceEnabled); + return this; + } + + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public Builder scope(Optional scope) { + this.scope = scope; + return this; + } + + public Builder scope(ConnectionScopeOAuth2 scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @JsonSetter(value = "scripts", nulls = Nulls.SKIP) + public Builder scripts(Optional scripts) { + this.scripts = scripts; + return this; + } + + public Builder scripts(ConnectionScriptsOAuth2 scripts) { + this.scripts = Optional.ofNullable(scripts); + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @JsonSetter(value = "tokenURL", nulls = Nulls.SKIP) + public Builder tokenUrl(Optional tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = Optional.ofNullable(tokenUrl); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + /** + *

When true, uses space-delimited scopes (per OAuth 2.0 spec) instead of comma-delimited when calling the identity provider's authorization endpoint. Only relevant when using the connection_scope parameter. See https://auth0.com/docs/authenticate/identity-providers/adding-scopes-for-an-external-idp#pass-scopes-to-authorize-endpoint

+ */ + @JsonSetter(value = "useOauthSpecScope", nulls = Nulls.SKIP) + public Builder useOauthSpecScope(Optional useOauthSpecScope) { + this.useOauthSpecScope = useOauthSpecScope; + return this; + } + + public Builder useOauthSpecScope(Boolean useOauthSpecScope) { + this.useOauthSpecScope = Optional.ofNullable(useOauthSpecScope); + return this; + } + + public ConnectionOptionsOAuth2 build() { + return new ConnectionOptionsOAuth2( + nonPersistentAttrs, + authParams, + authParamsMap, + authorizationUrl, + clientId, + clientSecret, + customHeaders, + fieldsMap, + iconUrl, + logoutUrl, + pkceEnabled, + scope, + scripts, + setUserRootAttributes, + tokenUrl, + upstreamParams, + useOauthSpecScope, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java new file mode 100644 index 000000000..7a217d051 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsOAuth2Common.Builder.class) +public final class ConnectionOptionsOAuth2Common implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional clientId; + + private final Optional clientSecret; + + private final OptionalNullable>> + upstreamParams; + + private final Optional setUserRootAttributes; + + private final Map additionalProperties; + + private ConnectionOptionsOAuth2Common( + Optional> nonPersistentAttrs, + Optional clientId, + Optional clientSecret, + OptionalNullable>> upstreamParams, + Optional setUserRootAttributes, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.upstreamParams = upstreamParams; + this.setUserRootAttributes = setUserRootAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsOAuth2Common && equalTo((ConnectionOptionsOAuth2Common) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsOAuth2Common other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && upstreamParams.equals(other.upstreamParams) + && setUserRootAttributes.equals(other.setUserRootAttributes); + } + + @Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.clientId, + this.clientSecret, + this.upstreamParams, + this.setUserRootAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsOAuth2Common other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + upstreamParams(other.getUpstreamParams()); + setUserRootAttributes(other.getSetUserRootAttributes()); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + public ConnectionOptionsOAuth2Common build() { + return new ConnectionOptionsOAuth2Common( + nonPersistentAttrs, + clientId, + clientSecret, + upstreamParams, + setUserRootAttributes, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java new file mode 100644 index 000000000..7c0673667 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java @@ -0,0 +1,1131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsOidc.Builder.class) +public final class ConnectionOptionsOidc implements IConnectionOptionsCommonOidc, IConnectionOptionsCommon { + private final Optional authorizationEndpoint; + + private final String clientId; + + private final Optional clientSecret; + + private final Optional connectionSettings; + + private final OptionalNullable federatedConnectionsAccessTokens; + + private final Optional> domainAliases; + + private final Optional iconUrl; + + private final OptionalNullable> idTokenSignedResponseAlgs; + + private final Optional issuer; + + private final Optional jwksUri; + + private final Optional oidcMetadata; + + private final Optional scope; + + private final Optional sendBackChannelNonce; + + private final Optional setUserRootAttributes; + + private final OptionalNullable tenantDomain; + + private final Optional tokenEndpoint; + + private final OptionalNullable tokenEndpointAuthMethod; + + private final OptionalNullable tokenEndpointAuthSigningAlg; + + private final OptionalNullable>> + upstreamParams; + + private final Optional userinfoEndpoint; + + private final Optional> nonPersistentAttrs; + + private final Optional attributeMap; + + private final Optional discoveryUrl; + + private final Optional type; + + private final Map additionalProperties; + + private ConnectionOptionsOidc( + Optional authorizationEndpoint, + String clientId, + Optional clientSecret, + Optional connectionSettings, + OptionalNullable federatedConnectionsAccessTokens, + Optional> domainAliases, + Optional iconUrl, + OptionalNullable> idTokenSignedResponseAlgs, + Optional issuer, + Optional jwksUri, + Optional oidcMetadata, + Optional scope, + Optional sendBackChannelNonce, + Optional setUserRootAttributes, + OptionalNullable tenantDomain, + Optional tokenEndpoint, + OptionalNullable tokenEndpointAuthMethod, + OptionalNullable tokenEndpointAuthSigningAlg, + OptionalNullable>> upstreamParams, + Optional userinfoEndpoint, + Optional> nonPersistentAttrs, + Optional attributeMap, + Optional discoveryUrl, + Optional type, + Map additionalProperties) { + this.authorizationEndpoint = authorizationEndpoint; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.connectionSettings = connectionSettings; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + this.domainAliases = domainAliases; + this.iconUrl = iconUrl; + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + this.issuer = issuer; + this.jwksUri = jwksUri; + this.oidcMetadata = oidcMetadata; + this.scope = scope; + this.sendBackChannelNonce = sendBackChannelNonce; + this.setUserRootAttributes = setUserRootAttributes; + this.tenantDomain = tenantDomain; + this.tokenEndpoint = tokenEndpoint; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + this.upstreamParams = upstreamParams; + this.userinfoEndpoint = userinfoEndpoint; + this.nonPersistentAttrs = nonPersistentAttrs; + this.attributeMap = attributeMap; + this.discoveryUrl = discoveryUrl; + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("authorization_endpoint") + @Override + public Optional getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + @JsonProperty("client_id") + @Override + public String getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + @Override + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("connection_settings") + @Override + public Optional getConnectionSettings() { + return connectionSettings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + @Override + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + + @JsonProperty("domain_aliases") + @Override + public Optional> getDomainAliases() { + return domainAliases; + } + + @JsonProperty("icon_url") + @Override + public Optional getIconUrl() { + return iconUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + @Override + public OptionalNullable> getIdTokenSignedResponseAlgs() { + if (idTokenSignedResponseAlgs == null) { + return OptionalNullable.absent(); + } + return idTokenSignedResponseAlgs; + } + + @JsonProperty("issuer") + @Override + public Optional getIssuer() { + return issuer; + } + + @JsonProperty("jwks_uri") + @Override + public Optional getJwksUri() { + return jwksUri; + } + + @JsonProperty("oidc_metadata") + @Override + public Optional getOidcMetadata() { + return oidcMetadata; + } + + @JsonProperty("scope") + @Override + public Optional getScope() { + return scope; + } + + @JsonProperty("send_back_channel_nonce") + @Override + public Optional getSendBackChannelNonce() { + return sendBackChannelNonce; + } + + @JsonProperty("set_user_root_attributes") + @Override + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + @Override + public OptionalNullable getTenantDomain() { + if (tenantDomain == null) { + return OptionalNullable.absent(); + } + return tenantDomain; + } + + @JsonProperty("token_endpoint") + @Override + public Optional getTokenEndpoint() { + return tokenEndpoint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + @Override + public OptionalNullable getTokenEndpointAuthMethod() { + if (tokenEndpointAuthMethod == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + @Override + public OptionalNullable getTokenEndpointAuthSigningAlg() { + if (tokenEndpointAuthSigningAlg == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthSigningAlg; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + @Override + public OptionalNullable>> getUpstreamParams() { + return upstreamParams; + } + + @JsonProperty("userinfo_endpoint") + @Override + public Optional getUserinfoEndpoint() { + return userinfoEndpoint; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("attribute_map") + public Optional getAttributeMap() { + return attributeMap; + } + + @JsonProperty("discovery_url") + public Optional getDiscoveryUrl() { + return discoveryUrl; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + private OptionalNullable> _getIdTokenSignedResponseAlgs() { + return idTokenSignedResponseAlgs; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + private OptionalNullable _getTenantDomain() { + return tenantDomain; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + private OptionalNullable _getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + private OptionalNullable _getTokenEndpointAuthSigningAlg() { + return tokenEndpointAuthSigningAlg; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsOidc && equalTo((ConnectionOptionsOidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsOidc other) { + return authorizationEndpoint.equals(other.authorizationEndpoint) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && connectionSettings.equals(other.connectionSettings) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) + && domainAliases.equals(other.domainAliases) + && iconUrl.equals(other.iconUrl) + && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) + && issuer.equals(other.issuer) + && jwksUri.equals(other.jwksUri) + && oidcMetadata.equals(other.oidcMetadata) + && scope.equals(other.scope) + && sendBackChannelNonce.equals(other.sendBackChannelNonce) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && tenantDomain.equals(other.tenantDomain) + && tokenEndpoint.equals(other.tokenEndpoint) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && tokenEndpointAuthSigningAlg.equals(other.tokenEndpointAuthSigningAlg) + && upstreamParams.equals(other.upstreamParams) + && userinfoEndpoint.equals(other.userinfoEndpoint) + && nonPersistentAttrs.equals(other.nonPersistentAttrs) + && attributeMap.equals(other.attributeMap) + && discoveryUrl.equals(other.discoveryUrl) + && type.equals(other.type); + } + + @Override + public int hashCode() { + return Objects.hash( + this.authorizationEndpoint, + this.clientId, + this.clientSecret, + this.connectionSettings, + this.federatedConnectionsAccessTokens, + this.domainAliases, + this.iconUrl, + this.idTokenSignedResponseAlgs, + this.issuer, + this.jwksUri, + this.oidcMetadata, + this.scope, + this.sendBackChannelNonce, + this.setUserRootAttributes, + this.tenantDomain, + this.tokenEndpoint, + this.tokenEndpointAuthMethod, + this.tokenEndpointAuthSigningAlg, + this.upstreamParams, + this.userinfoEndpoint, + this.nonPersistentAttrs, + this.attributeMap, + this.discoveryUrl, + this.type); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + _FinalStage clientId(@NotNull String clientId); + + Builder from(ConnectionOptionsOidc other); + } + + public interface _FinalStage { + ConnectionOptionsOidc build(); + + _FinalStage authorizationEndpoint(Optional authorizationEndpoint); + + _FinalStage authorizationEndpoint(String authorizationEndpoint); + + _FinalStage clientSecret(Optional clientSecret); + + _FinalStage clientSecret(String clientSecret); + + _FinalStage connectionSettings(Optional connectionSettings); + + _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings); + + _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens); + + _FinalStage domainAliases(Optional> domainAliases); + + _FinalStage domainAliases(List domainAliases); + + _FinalStage iconUrl(Optional iconUrl); + + _FinalStage iconUrl(String iconUrl); + + _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs(List idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs); + + _FinalStage issuer(Optional issuer); + + _FinalStage issuer(String issuer); + + _FinalStage jwksUri(Optional jwksUri); + + _FinalStage jwksUri(String jwksUri); + + _FinalStage oidcMetadata(Optional oidcMetadata); + + _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata); + + _FinalStage scope(Optional scope); + + _FinalStage scope(String scope); + + _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce); + + _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce); + + _FinalStage setUserRootAttributes(Optional setUserRootAttributes); + + _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); + + _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); + + _FinalStage tenantDomain(String tenantDomain); + + _FinalStage tenantDomain(Optional tenantDomain); + + _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + + _FinalStage tokenEndpoint(Optional tokenEndpoint); + + _FinalStage tokenEndpoint(String tokenEndpoint); + + _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg(ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg); + + _FinalStage upstreamParams( + OptionalNullable>> upstreamParams); + + _FinalStage upstreamParams( + Map> upstreamParams); + + _FinalStage upstreamParams( + Optional>> upstreamParams); + + _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams); + + _FinalStage userinfoEndpoint(Optional userinfoEndpoint); + + _FinalStage userinfoEndpoint(String userinfoEndpoint); + + _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs); + + _FinalStage nonPersistentAttrs(List nonPersistentAttrs); + + _FinalStage attributeMap(Optional attributeMap); + + _FinalStage attributeMap(ConnectionAttributeMapOidc attributeMap); + + _FinalStage discoveryUrl(Optional discoveryUrl); + + _FinalStage discoveryUrl(String discoveryUrl); + + _FinalStage type(Optional type); + + _FinalStage type(ConnectionTypeEnumOidc type); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + private Optional type = Optional.empty(); + + private Optional discoveryUrl = Optional.empty(); + + private Optional attributeMap = Optional.empty(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional userinfoEndpoint = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthSigningAlg = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthMethod = + OptionalNullable.absent(); + + private Optional tokenEndpoint = Optional.empty(); + + private OptionalNullable tenantDomain = OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional sendBackChannelNonce = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional oidcMetadata = Optional.empty(); + + private Optional jwksUri = Optional.empty(); + + private Optional issuer = Optional.empty(); + + private OptionalNullable> idTokenSignedResponseAlgs = + OptionalNullable.absent(); + + private Optional iconUrl = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + + private Optional connectionSettings = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional authorizationEndpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionOptionsOidc other) { + authorizationEndpoint(other.getAuthorizationEndpoint()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + connectionSettings(other.getConnectionSettings()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); + domainAliases(other.getDomainAliases()); + iconUrl(other.getIconUrl()); + idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); + issuer(other.getIssuer()); + jwksUri(other.getJwksUri()); + oidcMetadata(other.getOidcMetadata()); + scope(other.getScope()); + sendBackChannelNonce(other.getSendBackChannelNonce()); + setUserRootAttributes(other.getSetUserRootAttributes()); + tenantDomain(other.getTenantDomain()); + tokenEndpoint(other.getTokenEndpoint()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + tokenEndpointAuthSigningAlg(other.getTokenEndpointAuthSigningAlg()); + upstreamParams(other.getUpstreamParams()); + userinfoEndpoint(other.getUserinfoEndpoint()); + nonPersistentAttrs(other.getNonPersistentAttrs()); + attributeMap(other.getAttributeMap()); + discoveryUrl(other.getDiscoveryUrl()); + type(other.getType()); + return this; + } + + @Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @Override + public _FinalStage type(ConnectionTypeEnumOidc type) { + this.type = Optional.ofNullable(type); + return this; + } + + @Override + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public _FinalStage type(Optional type) { + this.type = type; + return this; + } + + @Override + public _FinalStage discoveryUrl(String discoveryUrl) { + this.discoveryUrl = Optional.ofNullable(discoveryUrl); + return this; + } + + @Override + @JsonSetter(value = "discovery_url", nulls = Nulls.SKIP) + public _FinalStage discoveryUrl(Optional discoveryUrl) { + this.discoveryUrl = discoveryUrl; + return this; + } + + @Override + public _FinalStage attributeMap(ConnectionAttributeMapOidc attributeMap) { + this.attributeMap = Optional.ofNullable(attributeMap); + return this; + } + + @Override + @JsonSetter(value = "attribute_map", nulls = Nulls.SKIP) + public _FinalStage attributeMap(Optional attributeMap) { + this.attributeMap = attributeMap; + return this; + } + + @Override + public _FinalStage nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @Override + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + @Override + public _FinalStage userinfoEndpoint(String userinfoEndpoint) { + this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); + return this; + } + + @Override + @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) + public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + return this; + } + + @Override + public _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + @Override + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public _FinalStage upstreamParams( + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isNull()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthSigningAlg.isEmpty()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isPresent()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isNull()) { + this.tokenEndpointAuthMethod = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthMethod.isEmpty()) { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + Optional tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isPresent()) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + @Override + public _FinalStage tokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) + public _FinalStage tokenEndpoint(Optional tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + @Override + public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { + if (tenantDomain.isNull()) { + this.tenantDomain = OptionalNullable.ofNull(); + } else if (tenantDomain.isEmpty()) { + this.tenantDomain = OptionalNullable.absent(); + } else { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } + return this; + } + + @Override + public _FinalStage tenantDomain(Optional tenantDomain) { + if (tenantDomain.isPresent()) { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } else { + this.tenantDomain = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tenantDomain(String tenantDomain) { + this.tenantDomain = OptionalNullable.of(tenantDomain); + return this; + } + + @Override + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + @Override + public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @Override + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + @Override + public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { + this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); + return this; + } + + @Override + @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) + public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { + this.sendBackChannelNonce = sendBackChannelNonce; + return this; + } + + @Override + public _FinalStage scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(Optional scope) { + this.scope = scope; + return this; + } + + @Override + public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { + this.oidcMetadata = Optional.ofNullable(oidcMetadata); + return this; + } + + @Override + @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) + public _FinalStage oidcMetadata(Optional oidcMetadata) { + this.oidcMetadata = oidcMetadata; + return this; + } + + @Override + public _FinalStage jwksUri(String jwksUri) { + this.jwksUri = Optional.ofNullable(jwksUri); + return this; + } + + @Override + @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) + public _FinalStage jwksUri(Optional jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + @Override + public _FinalStage issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @Override + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public _FinalStage issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isNull()) { + this.idTokenSignedResponseAlgs = OptionalNullable.ofNull(); + } else if (idTokenSignedResponseAlgs.isEmpty()) { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isPresent()) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + List idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); + return this; + } + + @Override + @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) + public _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + return this; + } + + @Override + public _FinalStage iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @Override + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public _FinalStage iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + @Override + public _FinalStage domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @Override + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public _FinalStage domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + @Override + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + @Override + public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { + this.connectionSettings = Optional.ofNullable(connectionSettings); + return this; + } + + @Override + @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) + public _FinalStage connectionSettings(Optional connectionSettings) { + this.connectionSettings = connectionSettings; + return this; + } + + @Override + public _FinalStage clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @Override + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public _FinalStage clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + @Override + public _FinalStage authorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); + return this; + } + + @Override + @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) + public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + @Override + public ConnectionOptionsOidc build() { + return new ConnectionOptionsOidc( + authorizationEndpoint, + clientId, + clientSecret, + connectionSettings, + federatedConnectionsAccessTokens, + domainAliases, + iconUrl, + idTokenSignedResponseAlgs, + issuer, + jwksUri, + oidcMetadata, + scope, + sendBackChannelNonce, + setUserRootAttributes, + tenantDomain, + tokenEndpoint, + tokenEndpointAuthMethod, + tokenEndpointAuthSigningAlg, + upstreamParams, + userinfoEndpoint, + nonPersistentAttrs, + attributeMap, + discoveryUrl, + type, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java new file mode 100644 index 000000000..3fdfc0be8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java @@ -0,0 +1,1290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsOidcMetadata.Builder.class) +public final class ConnectionOptionsOidcMetadata { + private final Optional> acrValuesSupported; + + private final String authorizationEndpoint; + + private final Optional> claimTypesSupported; + + private final Optional> claimsLocalesSupported; + + private final Optional claimsParameterSupported; + + private final Optional> claimsSupported; + + private final Optional> displayValuesSupported; + + private final Optional endSessionEndpoint; + + private final Optional> grantTypesSupported; + + private final Optional> idTokenEncryptionAlgValuesSupported; + + private final Optional> idTokenEncryptionEncValuesSupported; + + private final List idTokenSigningAlgValuesSupported; + + private final String issuer; + + private final String jwksUri; + + private final Optional opPolicyUri; + + private final Optional opTosUri; + + private final Optional registrationEndpoint; + + private final Optional> requestObjectEncryptionAlgValuesSupported; + + private final Optional> requestObjectEncryptionEncValuesSupported; + + private final Optional> requestObjectSigningAlgValuesSupported; + + private final Optional requestParameterSupported; + + private final Optional requestUriParameterSupported; + + private final Optional requireRequestUriRegistration; + + private final Optional> responseModesSupported; + + private final Optional> responseTypesSupported; + + private final OptionalNullable> scopesSupported; + + private final Optional serviceDocumentation; + + private final Optional> subjectTypesSupported; + + private final Optional tokenEndpoint; + + private final Optional> tokenEndpointAuthMethodsSupported; + + private final Optional> tokenEndpointAuthSigningAlgValuesSupported; + + private final Optional> uiLocalesSupported; + + private final Optional> userinfoEncryptionAlgValuesSupported; + + private final Optional> userinfoEncryptionEncValuesSupported; + + private final Optional userinfoEndpoint; + + private final Optional> userinfoSigningAlgValuesSupported; + + private final Map additionalProperties; + + private ConnectionOptionsOidcMetadata( + Optional> acrValuesSupported, + String authorizationEndpoint, + Optional> claimTypesSupported, + Optional> claimsLocalesSupported, + Optional claimsParameterSupported, + Optional> claimsSupported, + Optional> displayValuesSupported, + Optional endSessionEndpoint, + Optional> grantTypesSupported, + Optional> idTokenEncryptionAlgValuesSupported, + Optional> idTokenEncryptionEncValuesSupported, + List idTokenSigningAlgValuesSupported, + String issuer, + String jwksUri, + Optional opPolicyUri, + Optional opTosUri, + Optional registrationEndpoint, + Optional> requestObjectEncryptionAlgValuesSupported, + Optional> requestObjectEncryptionEncValuesSupported, + Optional> requestObjectSigningAlgValuesSupported, + Optional requestParameterSupported, + Optional requestUriParameterSupported, + Optional requireRequestUriRegistration, + Optional> responseModesSupported, + Optional> responseTypesSupported, + OptionalNullable> scopesSupported, + Optional serviceDocumentation, + Optional> subjectTypesSupported, + Optional tokenEndpoint, + Optional> tokenEndpointAuthMethodsSupported, + Optional> tokenEndpointAuthSigningAlgValuesSupported, + Optional> uiLocalesSupported, + Optional> userinfoEncryptionAlgValuesSupported, + Optional> userinfoEncryptionEncValuesSupported, + Optional userinfoEndpoint, + Optional> userinfoSigningAlgValuesSupported, + Map additionalProperties) { + this.acrValuesSupported = acrValuesSupported; + this.authorizationEndpoint = authorizationEndpoint; + this.claimTypesSupported = claimTypesSupported; + this.claimsLocalesSupported = claimsLocalesSupported; + this.claimsParameterSupported = claimsParameterSupported; + this.claimsSupported = claimsSupported; + this.displayValuesSupported = displayValuesSupported; + this.endSessionEndpoint = endSessionEndpoint; + this.grantTypesSupported = grantTypesSupported; + this.idTokenEncryptionAlgValuesSupported = idTokenEncryptionAlgValuesSupported; + this.idTokenEncryptionEncValuesSupported = idTokenEncryptionEncValuesSupported; + this.idTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported; + this.issuer = issuer; + this.jwksUri = jwksUri; + this.opPolicyUri = opPolicyUri; + this.opTosUri = opTosUri; + this.registrationEndpoint = registrationEndpoint; + this.requestObjectEncryptionAlgValuesSupported = requestObjectEncryptionAlgValuesSupported; + this.requestObjectEncryptionEncValuesSupported = requestObjectEncryptionEncValuesSupported; + this.requestObjectSigningAlgValuesSupported = requestObjectSigningAlgValuesSupported; + this.requestParameterSupported = requestParameterSupported; + this.requestUriParameterSupported = requestUriParameterSupported; + this.requireRequestUriRegistration = requireRequestUriRegistration; + this.responseModesSupported = responseModesSupported; + this.responseTypesSupported = responseTypesSupported; + this.scopesSupported = scopesSupported; + this.serviceDocumentation = serviceDocumentation; + this.subjectTypesSupported = subjectTypesSupported; + this.tokenEndpoint = tokenEndpoint; + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; + this.uiLocalesSupported = uiLocalesSupported; + this.userinfoEncryptionAlgValuesSupported = userinfoEncryptionAlgValuesSupported; + this.userinfoEncryptionEncValuesSupported = userinfoEncryptionEncValuesSupported; + this.userinfoEndpoint = userinfoEndpoint; + this.userinfoSigningAlgValuesSupported = userinfoSigningAlgValuesSupported; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acr_values_supported") + public Optional> getAcrValuesSupported() { + return acrValuesSupported; + } + + @JsonProperty("authorization_endpoint") + public String getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + @JsonProperty("claim_types_supported") + public Optional> getClaimTypesSupported() { + return claimTypesSupported; + } + + @JsonProperty("claims_locales_supported") + public Optional> getClaimsLocalesSupported() { + return claimsLocalesSupported; + } + + @JsonProperty("claims_parameter_supported") + public Optional getClaimsParameterSupported() { + return claimsParameterSupported; + } + + @JsonProperty("claims_supported") + public Optional> getClaimsSupported() { + return claimsSupported; + } + + @JsonProperty("display_values_supported") + public Optional> getDisplayValuesSupported() { + return displayValuesSupported; + } + + @JsonProperty("end_session_endpoint") + public Optional getEndSessionEndpoint() { + return endSessionEndpoint; + } + + @JsonProperty("grant_types_supported") + public Optional> getGrantTypesSupported() { + return grantTypesSupported; + } + + @JsonProperty("id_token_encryption_alg_values_supported") + public Optional> getIdTokenEncryptionAlgValuesSupported() { + return idTokenEncryptionAlgValuesSupported; + } + + @JsonProperty("id_token_encryption_enc_values_supported") + public Optional> getIdTokenEncryptionEncValuesSupported() { + return idTokenEncryptionEncValuesSupported; + } + + @JsonProperty("id_token_signing_alg_values_supported") + public List getIdTokenSigningAlgValuesSupported() { + return idTokenSigningAlgValuesSupported; + } + + @JsonProperty("issuer") + public String getIssuer() { + return issuer; + } + + @JsonProperty("jwks_uri") + public String getJwksUri() { + return jwksUri; + } + + @JsonProperty("op_policy_uri") + public Optional getOpPolicyUri() { + return opPolicyUri; + } + + @JsonProperty("op_tos_uri") + public Optional getOpTosUri() { + return opTosUri; + } + + @JsonProperty("registration_endpoint") + public Optional getRegistrationEndpoint() { + return registrationEndpoint; + } + + @JsonProperty("request_object_encryption_alg_values_supported") + public Optional> getRequestObjectEncryptionAlgValuesSupported() { + return requestObjectEncryptionAlgValuesSupported; + } + + @JsonProperty("request_object_encryption_enc_values_supported") + public Optional> getRequestObjectEncryptionEncValuesSupported() { + return requestObjectEncryptionEncValuesSupported; + } + + @JsonProperty("request_object_signing_alg_values_supported") + public Optional> getRequestObjectSigningAlgValuesSupported() { + return requestObjectSigningAlgValuesSupported; + } + + @JsonProperty("request_parameter_supported") + public Optional getRequestParameterSupported() { + return requestParameterSupported; + } + + @JsonProperty("request_uri_parameter_supported") + public Optional getRequestUriParameterSupported() { + return requestUriParameterSupported; + } + + @JsonProperty("require_request_uri_registration") + public Optional getRequireRequestUriRegistration() { + return requireRequestUriRegistration; + } + + @JsonProperty("response_modes_supported") + public Optional> getResponseModesSupported() { + return responseModesSupported; + } + + @JsonProperty("response_types_supported") + public Optional> getResponseTypesSupported() { + return responseTypesSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("scopes_supported") + public OptionalNullable> getScopesSupported() { + if (scopesSupported == null) { + return OptionalNullable.absent(); + } + return scopesSupported; + } + + @JsonProperty("service_documentation") + public Optional getServiceDocumentation() { + return serviceDocumentation; + } + + @JsonProperty("subject_types_supported") + public Optional> getSubjectTypesSupported() { + return subjectTypesSupported; + } + + @JsonProperty("token_endpoint") + public Optional getTokenEndpoint() { + return tokenEndpoint; + } + + @JsonProperty("token_endpoint_auth_methods_supported") + public Optional> getTokenEndpointAuthMethodsSupported() { + return tokenEndpointAuthMethodsSupported; + } + + @JsonProperty("token_endpoint_auth_signing_alg_values_supported") + public Optional> getTokenEndpointAuthSigningAlgValuesSupported() { + return tokenEndpointAuthSigningAlgValuesSupported; + } + + @JsonProperty("ui_locales_supported") + public Optional> getUiLocalesSupported() { + return uiLocalesSupported; + } + + @JsonProperty("userinfo_encryption_alg_values_supported") + public Optional> getUserinfoEncryptionAlgValuesSupported() { + return userinfoEncryptionAlgValuesSupported; + } + + @JsonProperty("userinfo_encryption_enc_values_supported") + public Optional> getUserinfoEncryptionEncValuesSupported() { + return userinfoEncryptionEncValuesSupported; + } + + @JsonProperty("userinfo_endpoint") + public Optional getUserinfoEndpoint() { + return userinfoEndpoint; + } + + @JsonProperty("userinfo_signing_alg_values_supported") + public Optional> getUserinfoSigningAlgValuesSupported() { + return userinfoSigningAlgValuesSupported; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("scopes_supported") + private OptionalNullable> _getScopesSupported() { + return scopesSupported; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsOidcMetadata && equalTo((ConnectionOptionsOidcMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsOidcMetadata other) { + return acrValuesSupported.equals(other.acrValuesSupported) + && authorizationEndpoint.equals(other.authorizationEndpoint) + && claimTypesSupported.equals(other.claimTypesSupported) + && claimsLocalesSupported.equals(other.claimsLocalesSupported) + && claimsParameterSupported.equals(other.claimsParameterSupported) + && claimsSupported.equals(other.claimsSupported) + && displayValuesSupported.equals(other.displayValuesSupported) + && endSessionEndpoint.equals(other.endSessionEndpoint) + && grantTypesSupported.equals(other.grantTypesSupported) + && idTokenEncryptionAlgValuesSupported.equals(other.idTokenEncryptionAlgValuesSupported) + && idTokenEncryptionEncValuesSupported.equals(other.idTokenEncryptionEncValuesSupported) + && idTokenSigningAlgValuesSupported.equals(other.idTokenSigningAlgValuesSupported) + && issuer.equals(other.issuer) + && jwksUri.equals(other.jwksUri) + && opPolicyUri.equals(other.opPolicyUri) + && opTosUri.equals(other.opTosUri) + && registrationEndpoint.equals(other.registrationEndpoint) + && requestObjectEncryptionAlgValuesSupported.equals(other.requestObjectEncryptionAlgValuesSupported) + && requestObjectEncryptionEncValuesSupported.equals(other.requestObjectEncryptionEncValuesSupported) + && requestObjectSigningAlgValuesSupported.equals(other.requestObjectSigningAlgValuesSupported) + && requestParameterSupported.equals(other.requestParameterSupported) + && requestUriParameterSupported.equals(other.requestUriParameterSupported) + && requireRequestUriRegistration.equals(other.requireRequestUriRegistration) + && responseModesSupported.equals(other.responseModesSupported) + && responseTypesSupported.equals(other.responseTypesSupported) + && scopesSupported.equals(other.scopesSupported) + && serviceDocumentation.equals(other.serviceDocumentation) + && subjectTypesSupported.equals(other.subjectTypesSupported) + && tokenEndpoint.equals(other.tokenEndpoint) + && tokenEndpointAuthMethodsSupported.equals(other.tokenEndpointAuthMethodsSupported) + && tokenEndpointAuthSigningAlgValuesSupported.equals(other.tokenEndpointAuthSigningAlgValuesSupported) + && uiLocalesSupported.equals(other.uiLocalesSupported) + && userinfoEncryptionAlgValuesSupported.equals(other.userinfoEncryptionAlgValuesSupported) + && userinfoEncryptionEncValuesSupported.equals(other.userinfoEncryptionEncValuesSupported) + && userinfoEndpoint.equals(other.userinfoEndpoint) + && userinfoSigningAlgValuesSupported.equals(other.userinfoSigningAlgValuesSupported); + } + + @Override + public int hashCode() { + return Objects.hash( + this.acrValuesSupported, + this.authorizationEndpoint, + this.claimTypesSupported, + this.claimsLocalesSupported, + this.claimsParameterSupported, + this.claimsSupported, + this.displayValuesSupported, + this.endSessionEndpoint, + this.grantTypesSupported, + this.idTokenEncryptionAlgValuesSupported, + this.idTokenEncryptionEncValuesSupported, + this.idTokenSigningAlgValuesSupported, + this.issuer, + this.jwksUri, + this.opPolicyUri, + this.opTosUri, + this.registrationEndpoint, + this.requestObjectEncryptionAlgValuesSupported, + this.requestObjectEncryptionEncValuesSupported, + this.requestObjectSigningAlgValuesSupported, + this.requestParameterSupported, + this.requestUriParameterSupported, + this.requireRequestUriRegistration, + this.responseModesSupported, + this.responseTypesSupported, + this.scopesSupported, + this.serviceDocumentation, + this.subjectTypesSupported, + this.tokenEndpoint, + this.tokenEndpointAuthMethodsSupported, + this.tokenEndpointAuthSigningAlgValuesSupported, + this.uiLocalesSupported, + this.userinfoEncryptionAlgValuesSupported, + this.userinfoEncryptionEncValuesSupported, + this.userinfoEndpoint, + this.userinfoSigningAlgValuesSupported); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AuthorizationEndpointStage builder() { + return new Builder(); + } + + public interface AuthorizationEndpointStage { + IssuerStage authorizationEndpoint(@NotNull String authorizationEndpoint); + + Builder from(ConnectionOptionsOidcMetadata other); + } + + public interface IssuerStage { + JwksUriStage issuer(@NotNull String issuer); + } + + public interface JwksUriStage { + _FinalStage jwksUri(@NotNull String jwksUri); + } + + public interface _FinalStage { + ConnectionOptionsOidcMetadata build(); + + _FinalStage acrValuesSupported(Optional> acrValuesSupported); + + _FinalStage acrValuesSupported(List acrValuesSupported); + + _FinalStage claimTypesSupported(Optional> claimTypesSupported); + + _FinalStage claimTypesSupported(List claimTypesSupported); + + _FinalStage claimsLocalesSupported(Optional> claimsLocalesSupported); + + _FinalStage claimsLocalesSupported(List claimsLocalesSupported); + + _FinalStage claimsParameterSupported(Optional claimsParameterSupported); + + _FinalStage claimsParameterSupported(Boolean claimsParameterSupported); + + _FinalStage claimsSupported(Optional> claimsSupported); + + _FinalStage claimsSupported(List claimsSupported); + + _FinalStage displayValuesSupported(Optional> displayValuesSupported); + + _FinalStage displayValuesSupported(List displayValuesSupported); + + _FinalStage endSessionEndpoint(Optional endSessionEndpoint); + + _FinalStage endSessionEndpoint(String endSessionEndpoint); + + _FinalStage grantTypesSupported(Optional> grantTypesSupported); + + _FinalStage grantTypesSupported(List grantTypesSupported); + + _FinalStage idTokenEncryptionAlgValuesSupported(Optional> idTokenEncryptionAlgValuesSupported); + + _FinalStage idTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported); + + _FinalStage idTokenEncryptionEncValuesSupported(Optional> idTokenEncryptionEncValuesSupported); + + _FinalStage idTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported); + + _FinalStage idTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported); + + _FinalStage addIdTokenSigningAlgValuesSupported(String idTokenSigningAlgValuesSupported); + + _FinalStage addAllIdTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported); + + _FinalStage opPolicyUri(Optional opPolicyUri); + + _FinalStage opPolicyUri(String opPolicyUri); + + _FinalStage opTosUri(Optional opTosUri); + + _FinalStage opTosUri(String opTosUri); + + _FinalStage registrationEndpoint(Optional registrationEndpoint); + + _FinalStage registrationEndpoint(String registrationEndpoint); + + _FinalStage requestObjectEncryptionAlgValuesSupported( + Optional> requestObjectEncryptionAlgValuesSupported); + + _FinalStage requestObjectEncryptionAlgValuesSupported(List requestObjectEncryptionAlgValuesSupported); + + _FinalStage requestObjectEncryptionEncValuesSupported( + Optional> requestObjectEncryptionEncValuesSupported); + + _FinalStage requestObjectEncryptionEncValuesSupported(List requestObjectEncryptionEncValuesSupported); + + _FinalStage requestObjectSigningAlgValuesSupported( + Optional> requestObjectSigningAlgValuesSupported); + + _FinalStage requestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported); + + _FinalStage requestParameterSupported(Optional requestParameterSupported); + + _FinalStage requestParameterSupported(Boolean requestParameterSupported); + + _FinalStage requestUriParameterSupported(Optional requestUriParameterSupported); + + _FinalStage requestUriParameterSupported(Boolean requestUriParameterSupported); + + _FinalStage requireRequestUriRegistration(Optional requireRequestUriRegistration); + + _FinalStage requireRequestUriRegistration(Boolean requireRequestUriRegistration); + + _FinalStage responseModesSupported(Optional> responseModesSupported); + + _FinalStage responseModesSupported(List responseModesSupported); + + _FinalStage responseTypesSupported(Optional> responseTypesSupported); + + _FinalStage responseTypesSupported(List responseTypesSupported); + + _FinalStage scopesSupported(@Nullable OptionalNullable> scopesSupported); + + _FinalStage scopesSupported(List scopesSupported); + + _FinalStage scopesSupported(Optional> scopesSupported); + + _FinalStage scopesSupported(com.auth0.client.mgmt.core.Nullable> scopesSupported); + + _FinalStage serviceDocumentation(Optional serviceDocumentation); + + _FinalStage serviceDocumentation(String serviceDocumentation); + + _FinalStage subjectTypesSupported(Optional> subjectTypesSupported); + + _FinalStage subjectTypesSupported(List subjectTypesSupported); + + _FinalStage tokenEndpoint(Optional tokenEndpoint); + + _FinalStage tokenEndpoint(String tokenEndpoint); + + _FinalStage tokenEndpointAuthMethodsSupported(Optional> tokenEndpointAuthMethodsSupported); + + _FinalStage tokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported); + + _FinalStage tokenEndpointAuthSigningAlgValuesSupported( + Optional> tokenEndpointAuthSigningAlgValuesSupported); + + _FinalStage tokenEndpointAuthSigningAlgValuesSupported(List tokenEndpointAuthSigningAlgValuesSupported); + + _FinalStage uiLocalesSupported(Optional> uiLocalesSupported); + + _FinalStage uiLocalesSupported(List uiLocalesSupported); + + _FinalStage userinfoEncryptionAlgValuesSupported(Optional> userinfoEncryptionAlgValuesSupported); + + _FinalStage userinfoEncryptionAlgValuesSupported(List userinfoEncryptionAlgValuesSupported); + + _FinalStage userinfoEncryptionEncValuesSupported(Optional> userinfoEncryptionEncValuesSupported); + + _FinalStage userinfoEncryptionEncValuesSupported(List userinfoEncryptionEncValuesSupported); + + _FinalStage userinfoEndpoint(Optional userinfoEndpoint); + + _FinalStage userinfoEndpoint(String userinfoEndpoint); + + _FinalStage userinfoSigningAlgValuesSupported(Optional> userinfoSigningAlgValuesSupported); + + _FinalStage userinfoSigningAlgValuesSupported(List userinfoSigningAlgValuesSupported); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AuthorizationEndpointStage, IssuerStage, JwksUriStage, _FinalStage { + private String authorizationEndpoint; + + private String issuer; + + private String jwksUri; + + private Optional> userinfoSigningAlgValuesSupported = Optional.empty(); + + private Optional userinfoEndpoint = Optional.empty(); + + private Optional> userinfoEncryptionEncValuesSupported = Optional.empty(); + + private Optional> userinfoEncryptionAlgValuesSupported = Optional.empty(); + + private Optional> uiLocalesSupported = Optional.empty(); + + private Optional> tokenEndpointAuthSigningAlgValuesSupported = Optional.empty(); + + private Optional> tokenEndpointAuthMethodsSupported = Optional.empty(); + + private Optional tokenEndpoint = Optional.empty(); + + private Optional> subjectTypesSupported = Optional.empty(); + + private Optional serviceDocumentation = Optional.empty(); + + private OptionalNullable> scopesSupported = OptionalNullable.absent(); + + private Optional> responseTypesSupported = Optional.empty(); + + private Optional> responseModesSupported = Optional.empty(); + + private Optional requireRequestUriRegistration = Optional.empty(); + + private Optional requestUriParameterSupported = Optional.empty(); + + private Optional requestParameterSupported = Optional.empty(); + + private Optional> requestObjectSigningAlgValuesSupported = Optional.empty(); + + private Optional> requestObjectEncryptionEncValuesSupported = Optional.empty(); + + private Optional> requestObjectEncryptionAlgValuesSupported = Optional.empty(); + + private Optional registrationEndpoint = Optional.empty(); + + private Optional opTosUri = Optional.empty(); + + private Optional opPolicyUri = Optional.empty(); + + private List idTokenSigningAlgValuesSupported = new ArrayList<>(); + + private Optional> idTokenEncryptionEncValuesSupported = Optional.empty(); + + private Optional> idTokenEncryptionAlgValuesSupported = Optional.empty(); + + private Optional> grantTypesSupported = Optional.empty(); + + private Optional endSessionEndpoint = Optional.empty(); + + private Optional> displayValuesSupported = Optional.empty(); + + private Optional> claimsSupported = Optional.empty(); + + private Optional claimsParameterSupported = Optional.empty(); + + private Optional> claimsLocalesSupported = Optional.empty(); + + private Optional> claimTypesSupported = Optional.empty(); + + private Optional> acrValuesSupported = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionOptionsOidcMetadata other) { + acrValuesSupported(other.getAcrValuesSupported()); + authorizationEndpoint(other.getAuthorizationEndpoint()); + claimTypesSupported(other.getClaimTypesSupported()); + claimsLocalesSupported(other.getClaimsLocalesSupported()); + claimsParameterSupported(other.getClaimsParameterSupported()); + claimsSupported(other.getClaimsSupported()); + displayValuesSupported(other.getDisplayValuesSupported()); + endSessionEndpoint(other.getEndSessionEndpoint()); + grantTypesSupported(other.getGrantTypesSupported()); + idTokenEncryptionAlgValuesSupported(other.getIdTokenEncryptionAlgValuesSupported()); + idTokenEncryptionEncValuesSupported(other.getIdTokenEncryptionEncValuesSupported()); + idTokenSigningAlgValuesSupported(other.getIdTokenSigningAlgValuesSupported()); + issuer(other.getIssuer()); + jwksUri(other.getJwksUri()); + opPolicyUri(other.getOpPolicyUri()); + opTosUri(other.getOpTosUri()); + registrationEndpoint(other.getRegistrationEndpoint()); + requestObjectEncryptionAlgValuesSupported(other.getRequestObjectEncryptionAlgValuesSupported()); + requestObjectEncryptionEncValuesSupported(other.getRequestObjectEncryptionEncValuesSupported()); + requestObjectSigningAlgValuesSupported(other.getRequestObjectSigningAlgValuesSupported()); + requestParameterSupported(other.getRequestParameterSupported()); + requestUriParameterSupported(other.getRequestUriParameterSupported()); + requireRequestUriRegistration(other.getRequireRequestUriRegistration()); + responseModesSupported(other.getResponseModesSupported()); + responseTypesSupported(other.getResponseTypesSupported()); + scopesSupported(other.getScopesSupported()); + serviceDocumentation(other.getServiceDocumentation()); + subjectTypesSupported(other.getSubjectTypesSupported()); + tokenEndpoint(other.getTokenEndpoint()); + tokenEndpointAuthMethodsSupported(other.getTokenEndpointAuthMethodsSupported()); + tokenEndpointAuthSigningAlgValuesSupported(other.getTokenEndpointAuthSigningAlgValuesSupported()); + uiLocalesSupported(other.getUiLocalesSupported()); + userinfoEncryptionAlgValuesSupported(other.getUserinfoEncryptionAlgValuesSupported()); + userinfoEncryptionEncValuesSupported(other.getUserinfoEncryptionEncValuesSupported()); + userinfoEndpoint(other.getUserinfoEndpoint()); + userinfoSigningAlgValuesSupported(other.getUserinfoSigningAlgValuesSupported()); + return this; + } + + @Override + @JsonSetter("authorization_endpoint") + public IssuerStage authorizationEndpoint(@NotNull String authorizationEndpoint) { + this.authorizationEndpoint = + Objects.requireNonNull(authorizationEndpoint, "authorizationEndpoint must not be null"); + return this; + } + + @Override + @JsonSetter("issuer") + public JwksUriStage issuer(@NotNull String issuer) { + this.issuer = Objects.requireNonNull(issuer, "issuer must not be null"); + return this; + } + + @Override + @JsonSetter("jwks_uri") + public _FinalStage jwksUri(@NotNull String jwksUri) { + this.jwksUri = Objects.requireNonNull(jwksUri, "jwksUri must not be null"); + return this; + } + + @Override + public _FinalStage userinfoSigningAlgValuesSupported(List userinfoSigningAlgValuesSupported) { + this.userinfoSigningAlgValuesSupported = Optional.ofNullable(userinfoSigningAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "userinfo_signing_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage userinfoSigningAlgValuesSupported(Optional> userinfoSigningAlgValuesSupported) { + this.userinfoSigningAlgValuesSupported = userinfoSigningAlgValuesSupported; + return this; + } + + @Override + public _FinalStage userinfoEndpoint(String userinfoEndpoint) { + this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); + return this; + } + + @Override + @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) + public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + return this; + } + + @Override + public _FinalStage userinfoEncryptionEncValuesSupported(List userinfoEncryptionEncValuesSupported) { + this.userinfoEncryptionEncValuesSupported = Optional.ofNullable(userinfoEncryptionEncValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "userinfo_encryption_enc_values_supported", nulls = Nulls.SKIP) + public _FinalStage userinfoEncryptionEncValuesSupported( + Optional> userinfoEncryptionEncValuesSupported) { + this.userinfoEncryptionEncValuesSupported = userinfoEncryptionEncValuesSupported; + return this; + } + + @Override + public _FinalStage userinfoEncryptionAlgValuesSupported(List userinfoEncryptionAlgValuesSupported) { + this.userinfoEncryptionAlgValuesSupported = Optional.ofNullable(userinfoEncryptionAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "userinfo_encryption_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage userinfoEncryptionAlgValuesSupported( + Optional> userinfoEncryptionAlgValuesSupported) { + this.userinfoEncryptionAlgValuesSupported = userinfoEncryptionAlgValuesSupported; + return this; + } + + @Override + public _FinalStage uiLocalesSupported(List uiLocalesSupported) { + this.uiLocalesSupported = Optional.ofNullable(uiLocalesSupported); + return this; + } + + @Override + @JsonSetter(value = "ui_locales_supported", nulls = Nulls.SKIP) + public _FinalStage uiLocalesSupported(Optional> uiLocalesSupported) { + this.uiLocalesSupported = uiLocalesSupported; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( + List tokenEndpointAuthSigningAlgValuesSupported) { + this.tokenEndpointAuthSigningAlgValuesSupported = + Optional.ofNullable(tokenEndpointAuthSigningAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_signing_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( + Optional> tokenEndpointAuthSigningAlgValuesSupported) { + this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = Optional.ofNullable(tokenEndpointAuthMethodsSupported); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_methods_supported", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthMethodsSupported(Optional> tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + return this; + } + + @Override + public _FinalStage tokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) + public _FinalStage tokenEndpoint(Optional tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + @Override + public _FinalStage subjectTypesSupported(List subjectTypesSupported) { + this.subjectTypesSupported = Optional.ofNullable(subjectTypesSupported); + return this; + } + + @Override + @JsonSetter(value = "subject_types_supported", nulls = Nulls.SKIP) + public _FinalStage subjectTypesSupported(Optional> subjectTypesSupported) { + this.subjectTypesSupported = subjectTypesSupported; + return this; + } + + @Override + public _FinalStage serviceDocumentation(String serviceDocumentation) { + this.serviceDocumentation = Optional.ofNullable(serviceDocumentation); + return this; + } + + @Override + @JsonSetter(value = "service_documentation", nulls = Nulls.SKIP) + public _FinalStage serviceDocumentation(Optional serviceDocumentation) { + this.serviceDocumentation = serviceDocumentation; + return this; + } + + @Override + public _FinalStage scopesSupported(com.auth0.client.mgmt.core.Nullable> scopesSupported) { + if (scopesSupported.isNull()) { + this.scopesSupported = OptionalNullable.ofNull(); + } else if (scopesSupported.isEmpty()) { + this.scopesSupported = OptionalNullable.absent(); + } else { + this.scopesSupported = OptionalNullable.of(scopesSupported.get()); + } + return this; + } + + @Override + public _FinalStage scopesSupported(Optional> scopesSupported) { + if (scopesSupported.isPresent()) { + this.scopesSupported = OptionalNullable.of(scopesSupported.get()); + } else { + this.scopesSupported = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage scopesSupported(List scopesSupported) { + this.scopesSupported = OptionalNullable.of(scopesSupported); + return this; + } + + @Override + @JsonSetter(value = "scopes_supported", nulls = Nulls.SKIP) + public _FinalStage scopesSupported(@Nullable OptionalNullable> scopesSupported) { + this.scopesSupported = scopesSupported; + return this; + } + + @Override + public _FinalStage responseTypesSupported(List responseTypesSupported) { + this.responseTypesSupported = Optional.ofNullable(responseTypesSupported); + return this; + } + + @Override + @JsonSetter(value = "response_types_supported", nulls = Nulls.SKIP) + public _FinalStage responseTypesSupported(Optional> responseTypesSupported) { + this.responseTypesSupported = responseTypesSupported; + return this; + } + + @Override + public _FinalStage responseModesSupported(List responseModesSupported) { + this.responseModesSupported = Optional.ofNullable(responseModesSupported); + return this; + } + + @Override + @JsonSetter(value = "response_modes_supported", nulls = Nulls.SKIP) + public _FinalStage responseModesSupported(Optional> responseModesSupported) { + this.responseModesSupported = responseModesSupported; + return this; + } + + @Override + public _FinalStage requireRequestUriRegistration(Boolean requireRequestUriRegistration) { + this.requireRequestUriRegistration = Optional.ofNullable(requireRequestUriRegistration); + return this; + } + + @Override + @JsonSetter(value = "require_request_uri_registration", nulls = Nulls.SKIP) + public _FinalStage requireRequestUriRegistration(Optional requireRequestUriRegistration) { + this.requireRequestUriRegistration = requireRequestUriRegistration; + return this; + } + + @Override + public _FinalStage requestUriParameterSupported(Boolean requestUriParameterSupported) { + this.requestUriParameterSupported = Optional.ofNullable(requestUriParameterSupported); + return this; + } + + @Override + @JsonSetter(value = "request_uri_parameter_supported", nulls = Nulls.SKIP) + public _FinalStage requestUriParameterSupported(Optional requestUriParameterSupported) { + this.requestUriParameterSupported = requestUriParameterSupported; + return this; + } + + @Override + public _FinalStage requestParameterSupported(Boolean requestParameterSupported) { + this.requestParameterSupported = Optional.ofNullable(requestParameterSupported); + return this; + } + + @Override + @JsonSetter(value = "request_parameter_supported", nulls = Nulls.SKIP) + public _FinalStage requestParameterSupported(Optional requestParameterSupported) { + this.requestParameterSupported = requestParameterSupported; + return this; + } + + @Override + public _FinalStage requestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported) { + this.requestObjectSigningAlgValuesSupported = Optional.ofNullable(requestObjectSigningAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "request_object_signing_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage requestObjectSigningAlgValuesSupported( + Optional> requestObjectSigningAlgValuesSupported) { + this.requestObjectSigningAlgValuesSupported = requestObjectSigningAlgValuesSupported; + return this; + } + + @Override + public _FinalStage requestObjectEncryptionEncValuesSupported( + List requestObjectEncryptionEncValuesSupported) { + this.requestObjectEncryptionEncValuesSupported = + Optional.ofNullable(requestObjectEncryptionEncValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "request_object_encryption_enc_values_supported", nulls = Nulls.SKIP) + public _FinalStage requestObjectEncryptionEncValuesSupported( + Optional> requestObjectEncryptionEncValuesSupported) { + this.requestObjectEncryptionEncValuesSupported = requestObjectEncryptionEncValuesSupported; + return this; + } + + @Override + public _FinalStage requestObjectEncryptionAlgValuesSupported( + List requestObjectEncryptionAlgValuesSupported) { + this.requestObjectEncryptionAlgValuesSupported = + Optional.ofNullable(requestObjectEncryptionAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "request_object_encryption_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage requestObjectEncryptionAlgValuesSupported( + Optional> requestObjectEncryptionAlgValuesSupported) { + this.requestObjectEncryptionAlgValuesSupported = requestObjectEncryptionAlgValuesSupported; + return this; + } + + @Override + public _FinalStage registrationEndpoint(String registrationEndpoint) { + this.registrationEndpoint = Optional.ofNullable(registrationEndpoint); + return this; + } + + @Override + @JsonSetter(value = "registration_endpoint", nulls = Nulls.SKIP) + public _FinalStage registrationEndpoint(Optional registrationEndpoint) { + this.registrationEndpoint = registrationEndpoint; + return this; + } + + @Override + public _FinalStage opTosUri(String opTosUri) { + this.opTosUri = Optional.ofNullable(opTosUri); + return this; + } + + @Override + @JsonSetter(value = "op_tos_uri", nulls = Nulls.SKIP) + public _FinalStage opTosUri(Optional opTosUri) { + this.opTosUri = opTosUri; + return this; + } + + @Override + public _FinalStage opPolicyUri(String opPolicyUri) { + this.opPolicyUri = Optional.ofNullable(opPolicyUri); + return this; + } + + @Override + @JsonSetter(value = "op_policy_uri", nulls = Nulls.SKIP) + public _FinalStage opPolicyUri(Optional opPolicyUri) { + this.opPolicyUri = opPolicyUri; + return this; + } + + @Override + public _FinalStage addAllIdTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { + if (idTokenSigningAlgValuesSupported != null) { + this.idTokenSigningAlgValuesSupported.addAll(idTokenSigningAlgValuesSupported); + } + return this; + } + + @Override + public _FinalStage addIdTokenSigningAlgValuesSupported(String idTokenSigningAlgValuesSupported) { + this.idTokenSigningAlgValuesSupported.add(idTokenSigningAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "id_token_signing_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage idTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { + this.idTokenSigningAlgValuesSupported.clear(); + if (idTokenSigningAlgValuesSupported != null) { + this.idTokenSigningAlgValuesSupported.addAll(idTokenSigningAlgValuesSupported); + } + return this; + } + + @Override + public _FinalStage idTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported) { + this.idTokenEncryptionEncValuesSupported = Optional.ofNullable(idTokenEncryptionEncValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "id_token_encryption_enc_values_supported", nulls = Nulls.SKIP) + public _FinalStage idTokenEncryptionEncValuesSupported( + Optional> idTokenEncryptionEncValuesSupported) { + this.idTokenEncryptionEncValuesSupported = idTokenEncryptionEncValuesSupported; + return this; + } + + @Override + public _FinalStage idTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported) { + this.idTokenEncryptionAlgValuesSupported = Optional.ofNullable(idTokenEncryptionAlgValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "id_token_encryption_alg_values_supported", nulls = Nulls.SKIP) + public _FinalStage idTokenEncryptionAlgValuesSupported( + Optional> idTokenEncryptionAlgValuesSupported) { + this.idTokenEncryptionAlgValuesSupported = idTokenEncryptionAlgValuesSupported; + return this; + } + + @Override + public _FinalStage grantTypesSupported(List grantTypesSupported) { + this.grantTypesSupported = Optional.ofNullable(grantTypesSupported); + return this; + } + + @Override + @JsonSetter(value = "grant_types_supported", nulls = Nulls.SKIP) + public _FinalStage grantTypesSupported(Optional> grantTypesSupported) { + this.grantTypesSupported = grantTypesSupported; + return this; + } + + @Override + public _FinalStage endSessionEndpoint(String endSessionEndpoint) { + this.endSessionEndpoint = Optional.ofNullable(endSessionEndpoint); + return this; + } + + @Override + @JsonSetter(value = "end_session_endpoint", nulls = Nulls.SKIP) + public _FinalStage endSessionEndpoint(Optional endSessionEndpoint) { + this.endSessionEndpoint = endSessionEndpoint; + return this; + } + + @Override + public _FinalStage displayValuesSupported(List displayValuesSupported) { + this.displayValuesSupported = Optional.ofNullable(displayValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "display_values_supported", nulls = Nulls.SKIP) + public _FinalStage displayValuesSupported(Optional> displayValuesSupported) { + this.displayValuesSupported = displayValuesSupported; + return this; + } + + @Override + public _FinalStage claimsSupported(List claimsSupported) { + this.claimsSupported = Optional.ofNullable(claimsSupported); + return this; + } + + @Override + @JsonSetter(value = "claims_supported", nulls = Nulls.SKIP) + public _FinalStage claimsSupported(Optional> claimsSupported) { + this.claimsSupported = claimsSupported; + return this; + } + + @Override + public _FinalStage claimsParameterSupported(Boolean claimsParameterSupported) { + this.claimsParameterSupported = Optional.ofNullable(claimsParameterSupported); + return this; + } + + @Override + @JsonSetter(value = "claims_parameter_supported", nulls = Nulls.SKIP) + public _FinalStage claimsParameterSupported(Optional claimsParameterSupported) { + this.claimsParameterSupported = claimsParameterSupported; + return this; + } + + @Override + public _FinalStage claimsLocalesSupported(List claimsLocalesSupported) { + this.claimsLocalesSupported = Optional.ofNullable(claimsLocalesSupported); + return this; + } + + @Override + @JsonSetter(value = "claims_locales_supported", nulls = Nulls.SKIP) + public _FinalStage claimsLocalesSupported(Optional> claimsLocalesSupported) { + this.claimsLocalesSupported = claimsLocalesSupported; + return this; + } + + @Override + public _FinalStage claimTypesSupported(List claimTypesSupported) { + this.claimTypesSupported = Optional.ofNullable(claimTypesSupported); + return this; + } + + @Override + @JsonSetter(value = "claim_types_supported", nulls = Nulls.SKIP) + public _FinalStage claimTypesSupported(Optional> claimTypesSupported) { + this.claimTypesSupported = claimTypesSupported; + return this; + } + + @Override + public _FinalStage acrValuesSupported(List acrValuesSupported) { + this.acrValuesSupported = Optional.ofNullable(acrValuesSupported); + return this; + } + + @Override + @JsonSetter(value = "acr_values_supported", nulls = Nulls.SKIP) + public _FinalStage acrValuesSupported(Optional> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + return this; + } + + @Override + public ConnectionOptionsOidcMetadata build() { + return new ConnectionOptionsOidcMetadata( + acrValuesSupported, + authorizationEndpoint, + claimTypesSupported, + claimsLocalesSupported, + claimsParameterSupported, + claimsSupported, + displayValuesSupported, + endSessionEndpoint, + grantTypesSupported, + idTokenEncryptionAlgValuesSupported, + idTokenEncryptionEncValuesSupported, + idTokenSigningAlgValuesSupported, + issuer, + jwksUri, + opPolicyUri, + opTosUri, + registrationEndpoint, + requestObjectEncryptionAlgValuesSupported, + requestObjectEncryptionEncValuesSupported, + requestObjectSigningAlgValuesSupported, + requestParameterSupported, + requestUriParameterSupported, + requireRequestUriRegistration, + responseModesSupported, + responseTypesSupported, + scopesSupported, + serviceDocumentation, + subjectTypesSupported, + tokenEndpoint, + tokenEndpointAuthMethodsSupported, + tokenEndpointAuthSigningAlgValuesSupported, + uiLocalesSupported, + userinfoEncryptionAlgValuesSupported, + userinfoEncryptionEncValuesSupported, + userinfoEndpoint, + userinfoSigningAlgValuesSupported, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java new file mode 100644 index 000000000..a54f2f5ea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java @@ -0,0 +1,1131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsOkta.Builder.class) +public final class ConnectionOptionsOkta implements IConnectionOptionsCommonOidc, IConnectionOptionsCommon { + private final Optional authorizationEndpoint; + + private final String clientId; + + private final Optional clientSecret; + + private final Optional connectionSettings; + + private final OptionalNullable federatedConnectionsAccessTokens; + + private final Optional> domainAliases; + + private final Optional iconUrl; + + private final OptionalNullable> idTokenSignedResponseAlgs; + + private final Optional issuer; + + private final Optional jwksUri; + + private final Optional oidcMetadata; + + private final Optional scope; + + private final Optional sendBackChannelNonce; + + private final Optional setUserRootAttributes; + + private final OptionalNullable tenantDomain; + + private final Optional tokenEndpoint; + + private final OptionalNullable tokenEndpointAuthMethod; + + private final OptionalNullable tokenEndpointAuthSigningAlg; + + private final OptionalNullable>> + upstreamParams; + + private final Optional userinfoEndpoint; + + private final Optional> nonPersistentAttrs; + + private final Optional attributeMap; + + private final Optional domain; + + private final Optional type; + + private final Map additionalProperties; + + private ConnectionOptionsOkta( + Optional authorizationEndpoint, + String clientId, + Optional clientSecret, + Optional connectionSettings, + OptionalNullable federatedConnectionsAccessTokens, + Optional> domainAliases, + Optional iconUrl, + OptionalNullable> idTokenSignedResponseAlgs, + Optional issuer, + Optional jwksUri, + Optional oidcMetadata, + Optional scope, + Optional sendBackChannelNonce, + Optional setUserRootAttributes, + OptionalNullable tenantDomain, + Optional tokenEndpoint, + OptionalNullable tokenEndpointAuthMethod, + OptionalNullable tokenEndpointAuthSigningAlg, + OptionalNullable>> upstreamParams, + Optional userinfoEndpoint, + Optional> nonPersistentAttrs, + Optional attributeMap, + Optional domain, + Optional type, + Map additionalProperties) { + this.authorizationEndpoint = authorizationEndpoint; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.connectionSettings = connectionSettings; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + this.domainAliases = domainAliases; + this.iconUrl = iconUrl; + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + this.issuer = issuer; + this.jwksUri = jwksUri; + this.oidcMetadata = oidcMetadata; + this.scope = scope; + this.sendBackChannelNonce = sendBackChannelNonce; + this.setUserRootAttributes = setUserRootAttributes; + this.tenantDomain = tenantDomain; + this.tokenEndpoint = tokenEndpoint; + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + this.upstreamParams = upstreamParams; + this.userinfoEndpoint = userinfoEndpoint; + this.nonPersistentAttrs = nonPersistentAttrs; + this.attributeMap = attributeMap; + this.domain = domain; + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("authorization_endpoint") + @Override + public Optional getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + @JsonProperty("client_id") + @Override + public String getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + @Override + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("connection_settings") + @Override + public Optional getConnectionSettings() { + return connectionSettings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + @Override + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + + @JsonProperty("domain_aliases") + @Override + public Optional> getDomainAliases() { + return domainAliases; + } + + @JsonProperty("icon_url") + @Override + public Optional getIconUrl() { + return iconUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + @Override + public OptionalNullable> getIdTokenSignedResponseAlgs() { + if (idTokenSignedResponseAlgs == null) { + return OptionalNullable.absent(); + } + return idTokenSignedResponseAlgs; + } + + @JsonProperty("issuer") + @Override + public Optional getIssuer() { + return issuer; + } + + @JsonProperty("jwks_uri") + @Override + public Optional getJwksUri() { + return jwksUri; + } + + @JsonProperty("oidc_metadata") + @Override + public Optional getOidcMetadata() { + return oidcMetadata; + } + + @JsonProperty("scope") + @Override + public Optional getScope() { + return scope; + } + + @JsonProperty("send_back_channel_nonce") + @Override + public Optional getSendBackChannelNonce() { + return sendBackChannelNonce; + } + + @JsonProperty("set_user_root_attributes") + @Override + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + @Override + public OptionalNullable getTenantDomain() { + if (tenantDomain == null) { + return OptionalNullable.absent(); + } + return tenantDomain; + } + + @JsonProperty("token_endpoint") + @Override + public Optional getTokenEndpoint() { + return tokenEndpoint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + @Override + public OptionalNullable getTokenEndpointAuthMethod() { + if (tokenEndpointAuthMethod == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + @Override + public OptionalNullable getTokenEndpointAuthSigningAlg() { + if (tokenEndpointAuthSigningAlg == null) { + return OptionalNullable.absent(); + } + return tokenEndpointAuthSigningAlg; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + @Override + public OptionalNullable>> getUpstreamParams() { + return upstreamParams; + } + + @JsonProperty("userinfo_endpoint") + @Override + public Optional getUserinfoEndpoint() { + return userinfoEndpoint; + } + + @JsonProperty("non_persistent_attrs") + @Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("attribute_map") + public Optional getAttributeMap() { + return attributeMap; + } + + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id_token_signed_response_algs") + private OptionalNullable> _getIdTokenSignedResponseAlgs() { + return idTokenSignedResponseAlgs; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_domain") + private OptionalNullable _getTenantDomain() { + return tenantDomain; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_method") + private OptionalNullable _getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_endpoint_auth_signing_alg") + private OptionalNullable _getTokenEndpointAuthSigningAlg() { + return tokenEndpointAuthSigningAlg; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsOkta && equalTo((ConnectionOptionsOkta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsOkta other) { + return authorizationEndpoint.equals(other.authorizationEndpoint) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && connectionSettings.equals(other.connectionSettings) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) + && domainAliases.equals(other.domainAliases) + && iconUrl.equals(other.iconUrl) + && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) + && issuer.equals(other.issuer) + && jwksUri.equals(other.jwksUri) + && oidcMetadata.equals(other.oidcMetadata) + && scope.equals(other.scope) + && sendBackChannelNonce.equals(other.sendBackChannelNonce) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && tenantDomain.equals(other.tenantDomain) + && tokenEndpoint.equals(other.tokenEndpoint) + && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && tokenEndpointAuthSigningAlg.equals(other.tokenEndpointAuthSigningAlg) + && upstreamParams.equals(other.upstreamParams) + && userinfoEndpoint.equals(other.userinfoEndpoint) + && nonPersistentAttrs.equals(other.nonPersistentAttrs) + && attributeMap.equals(other.attributeMap) + && domain.equals(other.domain) + && type.equals(other.type); + } + + @Override + public int hashCode() { + return Objects.hash( + this.authorizationEndpoint, + this.clientId, + this.clientSecret, + this.connectionSettings, + this.federatedConnectionsAccessTokens, + this.domainAliases, + this.iconUrl, + this.idTokenSignedResponseAlgs, + this.issuer, + this.jwksUri, + this.oidcMetadata, + this.scope, + this.sendBackChannelNonce, + this.setUserRootAttributes, + this.tenantDomain, + this.tokenEndpoint, + this.tokenEndpointAuthMethod, + this.tokenEndpointAuthSigningAlg, + this.upstreamParams, + this.userinfoEndpoint, + this.nonPersistentAttrs, + this.attributeMap, + this.domain, + this.type); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + _FinalStage clientId(@NotNull String clientId); + + Builder from(ConnectionOptionsOkta other); + } + + public interface _FinalStage { + ConnectionOptionsOkta build(); + + _FinalStage authorizationEndpoint(Optional authorizationEndpoint); + + _FinalStage authorizationEndpoint(String authorizationEndpoint); + + _FinalStage clientSecret(Optional clientSecret); + + _FinalStage clientSecret(String clientSecret); + + _FinalStage connectionSettings(Optional connectionSettings); + + _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings); + + _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens); + + _FinalStage domainAliases(Optional> domainAliases); + + _FinalStage domainAliases(List domainAliases); + + _FinalStage iconUrl(Optional iconUrl); + + _FinalStage iconUrl(String iconUrl); + + _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs(List idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs); + + _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs); + + _FinalStage issuer(Optional issuer); + + _FinalStage issuer(String issuer); + + _FinalStage jwksUri(Optional jwksUri); + + _FinalStage jwksUri(String jwksUri); + + _FinalStage oidcMetadata(Optional oidcMetadata); + + _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata); + + _FinalStage scope(Optional scope); + + _FinalStage scope(String scope); + + _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce); + + _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce); + + _FinalStage setUserRootAttributes(Optional setUserRootAttributes); + + _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); + + _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); + + _FinalStage tenantDomain(String tenantDomain); + + _FinalStage tenantDomain(Optional tenantDomain); + + _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + + _FinalStage tokenEndpoint(Optional tokenEndpoint); + + _FinalStage tokenEndpoint(String tokenEndpoint); + + _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod(Optional tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod); + + _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg(ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg); + + _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg); + + _FinalStage upstreamParams( + OptionalNullable>> upstreamParams); + + _FinalStage upstreamParams( + Map> upstreamParams); + + _FinalStage upstreamParams( + Optional>> upstreamParams); + + _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams); + + _FinalStage userinfoEndpoint(Optional userinfoEndpoint); + + _FinalStage userinfoEndpoint(String userinfoEndpoint); + + _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs); + + _FinalStage nonPersistentAttrs(List nonPersistentAttrs); + + _FinalStage attributeMap(Optional attributeMap); + + _FinalStage attributeMap(ConnectionAttributeMapOkta attributeMap); + + _FinalStage domain(Optional domain); + + _FinalStage domain(String domain); + + _FinalStage type(Optional type); + + _FinalStage type(String type); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + private Optional type = Optional.empty(); + + private Optional domain = Optional.empty(); + + private Optional attributeMap = Optional.empty(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional userinfoEndpoint = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthSigningAlg = + OptionalNullable.absent(); + + private OptionalNullable tokenEndpointAuthMethod = + OptionalNullable.absent(); + + private Optional tokenEndpoint = Optional.empty(); + + private OptionalNullable tenantDomain = OptionalNullable.absent(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional sendBackChannelNonce = Optional.empty(); + + private Optional scope = Optional.empty(); + + private Optional oidcMetadata = Optional.empty(); + + private Optional jwksUri = Optional.empty(); + + private Optional issuer = Optional.empty(); + + private OptionalNullable> idTokenSignedResponseAlgs = + OptionalNullable.absent(); + + private Optional iconUrl = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + + private Optional connectionSettings = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional authorizationEndpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ConnectionOptionsOkta other) { + authorizationEndpoint(other.getAuthorizationEndpoint()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + connectionSettings(other.getConnectionSettings()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); + domainAliases(other.getDomainAliases()); + iconUrl(other.getIconUrl()); + idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); + issuer(other.getIssuer()); + jwksUri(other.getJwksUri()); + oidcMetadata(other.getOidcMetadata()); + scope(other.getScope()); + sendBackChannelNonce(other.getSendBackChannelNonce()); + setUserRootAttributes(other.getSetUserRootAttributes()); + tenantDomain(other.getTenantDomain()); + tokenEndpoint(other.getTokenEndpoint()); + tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + tokenEndpointAuthSigningAlg(other.getTokenEndpointAuthSigningAlg()); + upstreamParams(other.getUpstreamParams()); + userinfoEndpoint(other.getUserinfoEndpoint()); + nonPersistentAttrs(other.getNonPersistentAttrs()); + attributeMap(other.getAttributeMap()); + domain(other.getDomain()); + type(other.getType()); + return this; + } + + @Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @Override + public _FinalStage type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @Override + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public _FinalStage type(Optional type) { + this.type = type; + return this; + } + + @Override + public _FinalStage domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + @Override + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public _FinalStage domain(Optional domain) { + this.domain = domain; + return this; + } + + @Override + public _FinalStage attributeMap(ConnectionAttributeMapOkta attributeMap) { + this.attributeMap = Optional.ofNullable(attributeMap); + return this; + } + + @Override + @JsonSetter(value = "attribute_map", nulls = Nulls.SKIP) + public _FinalStage attributeMap(Optional attributeMap) { + this.attributeMap = attributeMap; + return this; + } + + @Override + public _FinalStage nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @Override + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + @Override + public _FinalStage userinfoEndpoint(String userinfoEndpoint) { + this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); + return this; + } + + @Override + @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) + public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + return this; + } + + @Override + public _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + @Override + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public _FinalStage upstreamParams( + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + com.auth0.client.mgmt.core.Nullable + tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isNull()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthSigningAlg.isEmpty()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + Optional tokenEndpointAuthSigningAlg) { + if (tokenEndpointAuthSigningAlg.isPresent()) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg.get()); + } else { + this.tokenEndpointAuthSigningAlg = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthSigningAlg( + ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthSigningAlg( + @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { + this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isNull()) { + this.tokenEndpointAuthMethod = OptionalNullable.ofNull(); + } else if (tokenEndpointAuthMethod.isEmpty()) { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod( + Optional tokenEndpointAuthMethod) { + if (tokenEndpointAuthMethod.isPresent()) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod.get()); + } else { + this.tokenEndpointAuthMethod = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) + public _FinalStage tokenEndpointAuthMethod( + @Nullable OptionalNullable tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + @Override + public _FinalStage tokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); + return this; + } + + @Override + @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) + public _FinalStage tokenEndpoint(Optional tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + @Override + public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { + if (tenantDomain.isNull()) { + this.tenantDomain = OptionalNullable.ofNull(); + } else if (tenantDomain.isEmpty()) { + this.tenantDomain = OptionalNullable.absent(); + } else { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } + return this; + } + + @Override + public _FinalStage tenantDomain(Optional tenantDomain) { + if (tenantDomain.isPresent()) { + this.tenantDomain = OptionalNullable.of(tenantDomain.get()); + } else { + this.tenantDomain = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage tenantDomain(String tenantDomain) { + this.tenantDomain = OptionalNullable.of(tenantDomain); + return this; + } + + @Override + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + @Override + public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @Override + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + @Override + public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { + this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); + return this; + } + + @Override + @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) + public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { + this.sendBackChannelNonce = sendBackChannelNonce; + return this; + } + + @Override + public _FinalStage scope(String scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(Optional scope) { + this.scope = scope; + return this; + } + + @Override + public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { + this.oidcMetadata = Optional.ofNullable(oidcMetadata); + return this; + } + + @Override + @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) + public _FinalStage oidcMetadata(Optional oidcMetadata) { + this.oidcMetadata = oidcMetadata; + return this; + } + + @Override + public _FinalStage jwksUri(String jwksUri) { + this.jwksUri = Optional.ofNullable(jwksUri); + return this; + } + + @Override + @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) + public _FinalStage jwksUri(Optional jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + @Override + public _FinalStage issuer(String issuer) { + this.issuer = Optional.ofNullable(issuer); + return this; + } + + @Override + @JsonSetter(value = "issuer", nulls = Nulls.SKIP) + public _FinalStage issuer(Optional issuer) { + this.issuer = issuer; + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + com.auth0.client.mgmt.core.Nullable> + idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isNull()) { + this.idTokenSignedResponseAlgs = OptionalNullable.ofNull(); + } else if (idTokenSignedResponseAlgs.isEmpty()) { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + Optional> idTokenSignedResponseAlgs) { + if (idTokenSignedResponseAlgs.isPresent()) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs.get()); + } else { + this.idTokenSignedResponseAlgs = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage idTokenSignedResponseAlgs( + List idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); + return this; + } + + @Override + @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) + public _FinalStage idTokenSignedResponseAlgs( + @Nullable OptionalNullable> idTokenSignedResponseAlgs) { + this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + return this; + } + + @Override + public _FinalStage iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @Override + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public _FinalStage iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + @Override + public _FinalStage domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @Override + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public _FinalStage domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + @Override + public _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + @Override + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + @Override + public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { + this.connectionSettings = Optional.ofNullable(connectionSettings); + return this; + } + + @Override + @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) + public _FinalStage connectionSettings(Optional connectionSettings) { + this.connectionSettings = connectionSettings; + return this; + } + + @Override + public _FinalStage clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @Override + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public _FinalStage clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + @Override + public _FinalStage authorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); + return this; + } + + @Override + @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) + public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + @Override + public ConnectionOptionsOkta build() { + return new ConnectionOptionsOkta( + authorizationEndpoint, + clientId, + clientSecret, + connectionSettings, + federatedConnectionsAccessTokens, + domainAliases, + iconUrl, + idTokenSignedResponseAlgs, + issuer, + jwksUri, + oidcMetadata, + scope, + sendBackChannelNonce, + setUserRootAttributes, + tenantDomain, + tokenEndpoint, + tokenEndpointAuthMethod, + tokenEndpointAuthSigningAlg, + upstreamParams, + userinfoEndpoint, + nonPersistentAttrs, + attributeMap, + domain, + type, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java index 21fd81bb8..017cebfa4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasskeyAuthenticationMethod @@ -53,12 +53,12 @@ private boolean equalTo(ConnectionPasskeyAuthenticationMethod other) { return enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java index 231afea06..1391da2ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionPasskeyChallengeUiEnum && this.string.equals(((ConnectionPasskeyChallengeUiEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java index 11308fbe0..eae4787ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java @@ -60,7 +60,7 @@ public Optional getLocalEnrollmentEnabled() { return localEnrollmentEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasskeyOptions && equalTo((ConnectionPasskeyOptions) other); @@ -77,12 +77,12 @@ private boolean equalTo(ConnectionPasskeyOptions other) { && localEnrollmentEnabled.equals(other.localEnrollmentEnabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.challengeUi, this.progressiveEnrollmentEnabled, this.localEnrollmentEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java index 086e23295..69e8872c3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java @@ -38,7 +38,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordAuthenticationMethod @@ -54,12 +54,12 @@ private boolean equalTo(ConnectionPasswordAuthenticationMethod other) { return enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java index f2734810c..222ab5f6b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java @@ -37,7 +37,7 @@ public Optional getMinLength() { return minLength; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordComplexityOptions @@ -53,12 +53,12 @@ private boolean equalTo(ConnectionPasswordComplexityOptions other) { return minLength.equals(other.minLength); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.minLength); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java index 1abe74805..ab1670482 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java @@ -47,7 +47,7 @@ public Optional> getDictionary() { return dictionary; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordDictionaryOptions @@ -63,12 +63,12 @@ private boolean equalTo(ConnectionPasswordDictionaryOptions other) { return enable == other.enable && dictionary.equals(other.dictionary); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enable, this.dictionary); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -105,14 +105,14 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionPasswordDictionaryOptions other) { enable(other.getEnable()); dictionary(other.getDictionary()); return this; } - @java.lang.Override + @Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; @@ -123,7 +123,7 @@ public _FinalStage enable(boolean enable) { *

Custom Password Dictionary. An array of up to 200 entries.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage dictionary(List dictionary) { this.dictionary = Optional.ofNullable(dictionary); return this; @@ -132,14 +132,14 @@ public _FinalStage dictionary(List dictionary) { /** *

Custom Password Dictionary. An array of up to 200 entries.

*/ - @java.lang.Override + @Override @JsonSetter(value = "dictionary", nulls = Nulls.SKIP) public _FinalStage dictionary(Optional> dictionary) { this.dictionary = dictionary; return this; } - @java.lang.Override + @Override public ConnectionPasswordDictionaryOptions build() { return new ConnectionPasswordDictionaryOptions(enable, dictionary, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java index a5ea8bb03..b8dc0f6f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java @@ -43,7 +43,7 @@ public Optional getSize() { return size; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordHistoryOptions && equalTo((ConnectionPasswordHistoryOptions) other); @@ -58,12 +58,12 @@ private boolean equalTo(ConnectionPasswordHistoryOptions other) { return enable == other.enable && size.equals(other.size); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enable, this.size); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,34 +97,34 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionPasswordHistoryOptions other) { enable(other.getEnable()); size(other.getSize()); return this; } - @java.lang.Override + @Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; return this; } - @java.lang.Override + @Override public _FinalStage size(Integer size) { this.size = Optional.ofNullable(size); return this; } - @java.lang.Override + @Override @JsonSetter(value = "size", nulls = Nulls.SKIP) public _FinalStage size(Optional size) { this.size = size; return this; } - @java.lang.Override + @Override public ConnectionPasswordHistoryOptions build() { return new ConnectionPasswordHistoryOptions(enable, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java index ea52d475b..67a0a7f4a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java @@ -32,7 +32,7 @@ public boolean getEnable() { return enable; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordNoPersonalInfoOptions @@ -48,12 +48,12 @@ private boolean equalTo(ConnectionPasswordNoPersonalInfoOptions other) { return enable == other.enable; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enable); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionPasswordNoPersonalInfoOptions other) { enable(other.getEnable()); return this; } - @java.lang.Override + @Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; return this; } - @java.lang.Override + @Override public ConnectionPasswordNoPersonalInfoOptions build() { return new ConnectionPasswordNoPersonalInfoOptions(enable, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java index c9d9a7fbf..3496bc1c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java @@ -31,20 +31,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionPasswordPolicyEnum && this.string.equals(((ConnectionPasswordPolicyEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java new file mode 100644 index 000000000..4c7fc3e69 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java @@ -0,0 +1,257 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfile.Builder.class) +public final class ConnectionProfile { + private final Optional id; + + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private ConnectionProfile( + Optional id, + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.id = id; + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfile && equalTo((ConnectionProfile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfile other) { + return id.equals(other.id) + && name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfile other) { + id(other.getId()); + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public ConnectionProfile build() { + return new ConnectionProfile( + id, + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java new file mode 100644 index 000000000..f307bd117 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileConfig.Builder.class) +public final class ConnectionProfileConfig { + private final Map additionalProperties; + + private ConnectionProfileConfig(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileConfig; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileConfig other) { + return this; + } + + public ConnectionProfileConfig build() { + return new ConnectionProfileConfig(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java new file mode 100644 index 000000000..27d77d7e6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileOrganization.Builder.class) +public final class ConnectionProfileOrganization { + private final Optional showAsButton; + + private final Optional assignMembershipOnLogin; + + private final Map additionalProperties; + + private ConnectionProfileOrganization( + Optional showAsButton, + Optional assignMembershipOnLogin, + Map additionalProperties) { + this.showAsButton = showAsButton; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileOrganization && equalTo((ConnectionProfileOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfileOrganization other) { + return showAsButton.equals(other.showAsButton) && assignMembershipOnLogin.equals(other.assignMembershipOnLogin); + } + + @Override + public int hashCode() { + return Objects.hash(this.showAsButton, this.assignMembershipOnLogin); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileOrganization other) { + showAsButton(other.getShowAsButton()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(ConnectionProfileOrganizationShowAsButtonEnum showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin( + Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin( + ConnectionProfileOrganizationAssignMembershipOnLoginEnum assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + public ConnectionProfileOrganization build() { + return new ConnectionProfileOrganization(showAsButton, assignMembershipOnLogin, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java new file mode 100644 index 000000000..26d536b58 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionProfileOrganizationAssignMembershipOnLoginEnum { + public static final ConnectionProfileOrganizationAssignMembershipOnLoginEnum REQUIRED = + new ConnectionProfileOrganizationAssignMembershipOnLoginEnum(Value.REQUIRED, "required"); + + public static final ConnectionProfileOrganizationAssignMembershipOnLoginEnum NONE = + new ConnectionProfileOrganizationAssignMembershipOnLoginEnum(Value.NONE, "none"); + + public static final ConnectionProfileOrganizationAssignMembershipOnLoginEnum OPTIONAL = + new ConnectionProfileOrganizationAssignMembershipOnLoginEnum(Value.OPTIONAL, "optional"); + + private final Value value; + + private final String string; + + ConnectionProfileOrganizationAssignMembershipOnLoginEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionProfileOrganizationAssignMembershipOnLoginEnum + && this.string.equals( + ((ConnectionProfileOrganizationAssignMembershipOnLoginEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REQUIRED: + return visitor.visitRequired(); + case NONE: + return visitor.visitNone(); + case OPTIONAL: + return visitor.visitOptional(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionProfileOrganizationAssignMembershipOnLoginEnum valueOf(String value) { + switch (value) { + case "required": + return REQUIRED; + case "none": + return NONE; + case "optional": + return OPTIONAL; + default: + return new ConnectionProfileOrganizationAssignMembershipOnLoginEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + OPTIONAL, + + REQUIRED, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitOptional(); + + T visitRequired(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java new file mode 100644 index 000000000..326ced6d2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionProfileOrganizationShowAsButtonEnum { + public static final ConnectionProfileOrganizationShowAsButtonEnum REQUIRED = + new ConnectionProfileOrganizationShowAsButtonEnum(Value.REQUIRED, "required"); + + public static final ConnectionProfileOrganizationShowAsButtonEnum NONE = + new ConnectionProfileOrganizationShowAsButtonEnum(Value.NONE, "none"); + + public static final ConnectionProfileOrganizationShowAsButtonEnum OPTIONAL = + new ConnectionProfileOrganizationShowAsButtonEnum(Value.OPTIONAL, "optional"); + + private final Value value; + + private final String string; + + ConnectionProfileOrganizationShowAsButtonEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionProfileOrganizationShowAsButtonEnum + && this.string.equals(((ConnectionProfileOrganizationShowAsButtonEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REQUIRED: + return visitor.visitRequired(); + case NONE: + return visitor.visitNone(); + case OPTIONAL: + return visitor.visitOptional(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionProfileOrganizationShowAsButtonEnum valueOf(String value) { + switch (value) { + case "required": + return REQUIRED; + case "none": + return NONE; + case "optional": + return OPTIONAL; + default: + return new ConnectionProfileOrganizationShowAsButtonEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + OPTIONAL, + + REQUIRED, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitOptional(); + + T visitRequired(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java new file mode 100644 index 000000000..34d2f94e1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileStrategyOverride.Builder.class) +public final class ConnectionProfileStrategyOverride { + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Map additionalProperties; + + private ConnectionProfileStrategyOverride( + Optional> enabledFeatures, + Optional connectionConfig, + Map additionalProperties) { + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileStrategyOverride && equalTo((ConnectionProfileStrategyOverride) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfileStrategyOverride other) { + return enabledFeatures.equals(other.enabledFeatures) && connectionConfig.equals(other.connectionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFeatures, this.connectionConfig); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileStrategyOverride other) { + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileStrategyOverridesConnectionConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + public ConnectionProfileStrategyOverride build() { + return new ConnectionProfileStrategyOverride(enabledFeatures, connectionConfig, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java new file mode 100644 index 000000000..e35579cd0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileStrategyOverrides.Builder.class) +public final class ConnectionProfileStrategyOverrides { + private final Optional pingfederate; + + private final Optional ad; + + private final Optional adfs; + + private final Optional waad; + + private final Optional googleApps; + + private final Optional okta; + + private final Optional oidc; + + private final Optional samlp; + + private final Map additionalProperties; + + private ConnectionProfileStrategyOverrides( + Optional pingfederate, + Optional ad, + Optional adfs, + Optional waad, + Optional googleApps, + Optional okta, + Optional oidc, + Optional samlp, + Map additionalProperties) { + this.pingfederate = pingfederate; + this.ad = ad; + this.adfs = adfs; + this.waad = waad; + this.googleApps = googleApps; + this.okta = okta; + this.oidc = oidc; + this.samlp = samlp; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pingfederate") + public Optional getPingfederate() { + return pingfederate; + } + + @JsonProperty("ad") + public Optional getAd() { + return ad; + } + + @JsonProperty("adfs") + public Optional getAdfs() { + return adfs; + } + + @JsonProperty("waad") + public Optional getWaad() { + return waad; + } + + @JsonProperty("google-apps") + public Optional getGoogleApps() { + return googleApps; + } + + @JsonProperty("okta") + public Optional getOkta() { + return okta; + } + + @JsonProperty("oidc") + public Optional getOidc() { + return oidc; + } + + @JsonProperty("samlp") + public Optional getSamlp() { + return samlp; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileStrategyOverrides + && equalTo((ConnectionProfileStrategyOverrides) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfileStrategyOverrides other) { + return pingfederate.equals(other.pingfederate) + && ad.equals(other.ad) + && adfs.equals(other.adfs) + && waad.equals(other.waad) + && googleApps.equals(other.googleApps) + && okta.equals(other.okta) + && oidc.equals(other.oidc) + && samlp.equals(other.samlp); + } + + @Override + public int hashCode() { + return Objects.hash( + this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pingfederate = Optional.empty(); + + private Optional ad = Optional.empty(); + + private Optional adfs = Optional.empty(); + + private Optional waad = Optional.empty(); + + private Optional googleApps = Optional.empty(); + + private Optional okta = Optional.empty(); + + private Optional oidc = Optional.empty(); + + private Optional samlp = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileStrategyOverrides other) { + pingfederate(other.getPingfederate()); + ad(other.getAd()); + adfs(other.getAdfs()); + waad(other.getWaad()); + googleApps(other.getGoogleApps()); + okta(other.getOkta()); + oidc(other.getOidc()); + samlp(other.getSamlp()); + return this; + } + + @JsonSetter(value = "pingfederate", nulls = Nulls.SKIP) + public Builder pingfederate(Optional pingfederate) { + this.pingfederate = pingfederate; + return this; + } + + public Builder pingfederate(ConnectionProfileStrategyOverride pingfederate) { + this.pingfederate = Optional.ofNullable(pingfederate); + return this; + } + + @JsonSetter(value = "ad", nulls = Nulls.SKIP) + public Builder ad(Optional ad) { + this.ad = ad; + return this; + } + + public Builder ad(ConnectionProfileStrategyOverride ad) { + this.ad = Optional.ofNullable(ad); + return this; + } + + @JsonSetter(value = "adfs", nulls = Nulls.SKIP) + public Builder adfs(Optional adfs) { + this.adfs = adfs; + return this; + } + + public Builder adfs(ConnectionProfileStrategyOverride adfs) { + this.adfs = Optional.ofNullable(adfs); + return this; + } + + @JsonSetter(value = "waad", nulls = Nulls.SKIP) + public Builder waad(Optional waad) { + this.waad = waad; + return this; + } + + public Builder waad(ConnectionProfileStrategyOverride waad) { + this.waad = Optional.ofNullable(waad); + return this; + } + + @JsonSetter(value = "google-apps", nulls = Nulls.SKIP) + public Builder googleApps(Optional googleApps) { + this.googleApps = googleApps; + return this; + } + + public Builder googleApps(ConnectionProfileStrategyOverride googleApps) { + this.googleApps = Optional.ofNullable(googleApps); + return this; + } + + @JsonSetter(value = "okta", nulls = Nulls.SKIP) + public Builder okta(Optional okta) { + this.okta = okta; + return this; + } + + public Builder okta(ConnectionProfileStrategyOverride okta) { + this.okta = Optional.ofNullable(okta); + return this; + } + + @JsonSetter(value = "oidc", nulls = Nulls.SKIP) + public Builder oidc(Optional oidc) { + this.oidc = oidc; + return this; + } + + public Builder oidc(ConnectionProfileStrategyOverride oidc) { + this.oidc = Optional.ofNullable(oidc); + return this; + } + + @JsonSetter(value = "samlp", nulls = Nulls.SKIP) + public Builder samlp(Optional samlp) { + this.samlp = samlp; + return this; + } + + public Builder samlp(ConnectionProfileStrategyOverride samlp) { + this.samlp = Optional.ofNullable(samlp); + return this; + } + + public ConnectionProfileStrategyOverrides build() { + return new ConnectionProfileStrategyOverrides( + pingfederate, ad, adfs, waad, googleApps, okta, oidc, samlp, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java new file mode 100644 index 000000000..a11d96022 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileStrategyOverridesConnectionConfig.Builder.class) +public final class ConnectionProfileStrategyOverridesConnectionConfig { + private final Map additionalProperties; + + private ConnectionProfileStrategyOverridesConnectionConfig(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileStrategyOverridesConnectionConfig; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileStrategyOverridesConnectionConfig other) { + return this; + } + + public ConnectionProfileStrategyOverridesConnectionConfig build() { + return new ConnectionProfileStrategyOverridesConnectionConfig(additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java new file mode 100644 index 000000000..a9185cb14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileTemplate.Builder.class) +public final class ConnectionProfileTemplate { + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private ConnectionProfileTemplate( + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileTemplate && equalTo((ConnectionProfileTemplate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfileTemplate other) { + return name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileTemplate other) { + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public ConnectionProfileTemplate build() { + return new ConnectionProfileTemplate( + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java new file mode 100644 index 000000000..2a7f0038c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionProfileTemplateItem.Builder.class) +public final class ConnectionProfileTemplateItem { + private final Optional id; + + private final Optional displayName; + + private final Optional template; + + private final Map additionalProperties; + + private ConnectionProfileTemplateItem( + Optional id, + Optional displayName, + Optional template, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.template = template; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The user-friendly name of the template displayed in the UI. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionProfileTemplateItem && equalTo((ConnectionProfileTemplateItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionProfileTemplateItem other) { + return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.displayName, this.template); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional template = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionProfileTemplateItem other) { + id(other.getId()); + displayName(other.getDisplayName()); + template(other.getTemplate()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The user-friendly name of the template displayed in the UI.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(ConnectionProfileTemplate template) { + this.template = Optional.ofNullable(template); + return this; + } + + public ConnectionProfileTemplateItem build() { + return new ConnectionProfileTemplateItem(id, displayName, template, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java index d8c113473..8de3fc11b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java @@ -72,12 +72,15 @@ public final class ConnectionPropertiesOptions { private final Optional disableSelfServiceChangePassword; - private final OptionalNullable> upstreamParams; + private final OptionalNullable>> + upstreamParams; private final Optional setUserRootAttributes; private final OptionalNullable gatewayAuthentication; + private final OptionalNullable federatedConnectionsAccessTokens; + private final Map additionalProperties; private ConnectionPropertiesOptions( @@ -105,9 +108,10 @@ private ConnectionPropertiesOptions( Optional extAssignedPlans, Optional extProfile, Optional disableSelfServiceChangePassword, - OptionalNullable> upstreamParams, + OptionalNullable>> upstreamParams, Optional setUserRootAttributes, OptionalNullable gatewayAuthentication, + OptionalNullable federatedConnectionsAccessTokens, Map additionalProperties) { this.validation = validation; this.nonPersistentAttrs = nonPersistentAttrs; @@ -136,6 +140,7 @@ private ConnectionPropertiesOptions( this.upstreamParams = upstreamParams; this.setUserRootAttributes = setUserRootAttributes; this.gatewayAuthentication = gatewayAuthentication; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; this.additionalProperties = additionalProperties; } @@ -169,6 +174,9 @@ public Optional getAttributes() { return attributes; } + /** + * @return Set to true to inject context into custom DB scripts (warning: cannot be disabled once enabled) + */ @JsonProperty("enable_script_context") public Optional getEnableScriptContext() { return enableScriptContext; @@ -305,7 +313,7 @@ public Optional getDisableSelfServiceChangePassword() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - public OptionalNullable> getUpstreamParams() { + public OptionalNullable>> getUpstreamParams() { if (upstreamParams == null) { return OptionalNullable.absent(); } @@ -326,6 +334,15 @@ public OptionalNullable getGatewayAuthenticatio return gatewayAuthentication; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("validation") private OptionalNullable _getValidation() { @@ -376,7 +393,8 @@ private OptionalNullable _getPasswordDictio @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - private OptionalNullable> _getUpstreamParams() { + private OptionalNullable>> + _getUpstreamParams() { return upstreamParams; } @@ -386,7 +404,13 @@ private OptionalNullable _getGatewayAuthenticat return gatewayAuthentication; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPropertiesOptions && equalTo((ConnectionPropertiesOptions) other); @@ -424,10 +448,11 @@ private boolean equalTo(ConnectionPropertiesOptions other) { && disableSelfServiceChangePassword.equals(other.disableSelfServiceChangePassword) && upstreamParams.equals(other.upstreamParams) && setUserRootAttributes.equals(other.setUserRootAttributes) - && gatewayAuthentication.equals(other.gatewayAuthentication); + && gatewayAuthentication.equals(other.gatewayAuthentication) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.validation, @@ -456,10 +481,11 @@ public int hashCode() { this.disableSelfServiceChangePassword, this.upstreamParams, this.setUserRootAttributes, - this.gatewayAuthentication); + this.gatewayAuthentication, + this.federatedConnectionsAccessTokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -520,12 +546,16 @@ public static final class Builder { private Optional disableSelfServiceChangePassword = Optional.empty(); - private OptionalNullable> upstreamParams = OptionalNullable.absent(); + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); private Optional setUserRootAttributes = Optional.empty(); private OptionalNullable gatewayAuthentication = OptionalNullable.absent(); + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -559,6 +589,7 @@ public Builder from(ConnectionPropertiesOptions other) { upstreamParams(other.getUpstreamParams()); setUserRootAttributes(other.getSetUserRootAttributes()); gatewayAuthentication(other.getGatewayAuthentication()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); return this; } @@ -632,6 +663,9 @@ public Builder attributes(ConnectionAttributes attributes) { return this; } + /** + *

Set to true to inject context into custom DB scripts (warning: cannot be disabled once enabled)

+ */ @JsonSetter(value = "enable_script_context", nulls = Nulls.SKIP) public Builder enableScriptContext(Optional enableScriptContext) { this.enableScriptContext = enableScriptContext; @@ -1011,17 +1045,22 @@ public Builder disableSelfServiceChangePassword(Boolean disableSelfServiceChange } @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) - public Builder upstreamParams(@Nullable OptionalNullable> upstreamParams) { + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } - public Builder upstreamParams(Map upstreamParams) { + public Builder upstreamParams( + Map> upstreamParams) { this.upstreamParams = OptionalNullable.of(upstreamParams); return this; } - public Builder upstreamParams(Optional> upstreamParams) { + public Builder upstreamParams( + Optional>> upstreamParams) { if (upstreamParams.isPresent()) { this.upstreamParams = OptionalNullable.of(upstreamParams.get()); } else { @@ -1030,7 +1069,10 @@ public Builder upstreamParams(Optional> upstreamParams) { return this; } - public Builder upstreamParams(com.auth0.client.mgmt.core.Nullable> upstreamParams) { + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { if (upstreamParams.isNull()) { this.upstreamParams = OptionalNullable.ofNull(); } else if (upstreamParams.isEmpty()) { @@ -1085,6 +1127,43 @@ public Builder gatewayAuthentication( return this; } + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public Builder federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + public Builder federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + public Builder federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + public Builder federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + public ConnectionPropertiesOptions build() { return new ConnectionPropertiesOptions( validation, @@ -1114,6 +1193,7 @@ public ConnectionPropertiesOptions build() { upstreamParams, setUserRootAttributes, gatewayAuthentication, + federatedConnectionsAccessTokens, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java new file mode 100644 index 000000000..91770e367 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java @@ -0,0 +1,347 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseCommon.Builder.class) +public final class ConnectionResponseCommon + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private ConnectionResponseCommon( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseCommon && equalTo((ConnectionResponseCommon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseCommon other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseCommon other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + public ConnectionResponseCommon build() { + return new ConnectionResponseCommon( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java new file mode 100644 index 000000000..fed4d3811 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAd.Builder.class) +public final class ConnectionResponseContentAd + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentAd( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "ad"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAd && equalTo((ConnectionResponseContentAd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAd other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAd other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAd build() { + return new ConnectionResponseContentAd( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java new file mode 100644 index 000000000..80ee443e9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAdfs.Builder.class) +public final class ConnectionResponseContentAdfs + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentAdfs( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "adfs"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAdfs && equalTo((ConnectionResponseContentAdfs) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAdfs other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAdfs other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAdfs build() { + return new ConnectionResponseContentAdfs( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java new file mode 100644 index 000000000..7c456af22 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAmazon.Builder.class) +public final class ConnectionResponseContentAmazon + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentAmazon( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "amazon"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAmazon && equalTo((ConnectionResponseContentAmazon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAmazon other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAmazon other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAmazon build() { + return new ConnectionResponseContentAmazon( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java new file mode 100644 index 000000000..3ff30de6d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAol.Builder.class) +public final class ConnectionResponseContentAol + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentAol( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "aol"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAol && equalTo((ConnectionResponseContentAol) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAol other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAol other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAol build() { + return new ConnectionResponseContentAol( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java new file mode 100644 index 000000000..281e433e9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentApple.Builder.class) +public final class ConnectionResponseContentApple + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentApple( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "apple"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentApple && equalTo((ConnectionResponseContentApple) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentApple other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentApple other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsApple options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentApple build() { + return new ConnectionResponseContentApple( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java new file mode 100644 index 000000000..ae19dd82b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAuth0.Builder.class) +public final class ConnectionResponseContentAuth0 + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentAuth0( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "auth0"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAuth0 && equalTo((ConnectionResponseContentAuth0) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAuth0 other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAuth0 other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsAuth0 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAuth0 build() { + return new ConnectionResponseContentAuth0( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java new file mode 100644 index 000000000..6977057f2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAuth0Oidc.Builder.class) +public final class ConnectionResponseContentAuth0Oidc + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentAuth0Oidc( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "auth0-oidc"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAuth0Oidc + && equalTo((ConnectionResponseContentAuth0Oidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAuth0Oidc other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAuth0Oidc other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentAuth0Oidc build() { + return new ConnectionResponseContentAuth0Oidc( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java new file mode 100644 index 000000000..4db0fad96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java @@ -0,0 +1,456 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentAzureAd.Builder.class) +public final class ConnectionResponseContentAzureAd + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Optional provisioningTicket; + + private final Optional provisioningTicketUrl; + + private final Optional strategyVersion; + + private final Map additionalProperties; + + private ConnectionResponseContentAzureAd( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Optional provisioningTicket, + Optional provisioningTicketUrl, + Optional strategyVersion, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.provisioningTicket = provisioningTicket; + this.provisioningTicketUrl = provisioningTicketUrl; + this.strategyVersion = strategyVersion; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "waad"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @JsonProperty("provisioning_ticket") + public Optional getProvisioningTicket() { + return provisioningTicket; + } + + @JsonProperty("provisioning_ticket_url") + public Optional getProvisioningTicketUrl() { + return provisioningTicketUrl; + } + + @JsonProperty("strategy_version") + public Optional getStrategyVersion() { + return strategyVersion; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentAzureAd && equalTo((ConnectionResponseContentAzureAd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentAzureAd other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options) + && provisioningTicket.equals(other.provisioningTicket) + && provisioningTicketUrl.equals(other.provisioningTicketUrl) + && strategyVersion.equals(other.strategyVersion); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options, + this.provisioningTicket, + this.provisioningTicketUrl, + this.strategyVersion); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + private Optional provisioningTicket = Optional.empty(); + + private Optional provisioningTicketUrl = Optional.empty(); + + private Optional strategyVersion = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentAzureAd other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + provisioningTicket(other.getProvisioningTicket()); + provisioningTicketUrl(other.getProvisioningTicketUrl()); + strategyVersion(other.getStrategyVersion()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsAzureAd options) { + this.options = Optional.ofNullable(options); + return this; + } + + @JsonSetter(value = "provisioning_ticket", nulls = Nulls.SKIP) + public Builder provisioningTicket(Optional provisioningTicket) { + this.provisioningTicket = provisioningTicket; + return this; + } + + public Builder provisioningTicket(String provisioningTicket) { + this.provisioningTicket = Optional.ofNullable(provisioningTicket); + return this; + } + + @JsonSetter(value = "provisioning_ticket_url", nulls = Nulls.SKIP) + public Builder provisioningTicketUrl(Optional provisioningTicketUrl) { + this.provisioningTicketUrl = provisioningTicketUrl; + return this; + } + + public Builder provisioningTicketUrl(String provisioningTicketUrl) { + this.provisioningTicketUrl = Optional.ofNullable(provisioningTicketUrl); + return this; + } + + @JsonSetter(value = "strategy_version", nulls = Nulls.SKIP) + public Builder strategyVersion(Optional strategyVersion) { + this.strategyVersion = strategyVersion; + return this; + } + + public Builder strategyVersion(Integer strategyVersion) { + this.strategyVersion = Optional.ofNullable(strategyVersion); + return this; + } + + public ConnectionResponseContentAzureAd build() { + return new ConnectionResponseContentAzureAd( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + provisioningTicket, + provisioningTicketUrl, + strategyVersion, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java new file mode 100644 index 000000000..015f4b1ee --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentBaidu.Builder.class) +public final class ConnectionResponseContentBaidu + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentBaidu( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "baidu"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentBaidu && equalTo((ConnectionResponseContentBaidu) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentBaidu other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentBaidu other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentBaidu build() { + return new ConnectionResponseContentBaidu( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java new file mode 100644 index 000000000..5710fdb7a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentBitbucket.Builder.class) +public final class ConnectionResponseContentBitbucket + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentBitbucket( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "bitbucket"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentBitbucket + && equalTo((ConnectionResponseContentBitbucket) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentBitbucket other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentBitbucket other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentBitbucket build() { + return new ConnectionResponseContentBitbucket( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java new file mode 100644 index 000000000..93e69f6ba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentBitly.Builder.class) +public final class ConnectionResponseContentBitly + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentBitly( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "bitly"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentBitly && equalTo((ConnectionResponseContentBitly) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentBitly other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentBitly other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentBitly build() { + return new ConnectionResponseContentBitly( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java new file mode 100644 index 000000000..ba9a38bff --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentBox.Builder.class) +public final class ConnectionResponseContentBox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentBox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "box"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentBox && equalTo((ConnectionResponseContentBox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentBox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentBox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentBox build() { + return new ConnectionResponseContentBox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java new file mode 100644 index 000000000..e54d9197c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentCustom.Builder.class) +public final class ConnectionResponseContentCustom + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentCustom( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "custom"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentCustom && equalTo((ConnectionResponseContentCustom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentCustom other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentCustom other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentCustom build() { + return new ConnectionResponseContentCustom( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java new file mode 100644 index 000000000..887bbaca0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentDaccount.Builder.class) +public final class ConnectionResponseContentDaccount + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentDaccount( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "daccount"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentDaccount && equalTo((ConnectionResponseContentDaccount) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentDaccount other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentDaccount other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentDaccount build() { + return new ConnectionResponseContentDaccount( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java new file mode 100644 index 000000000..68e80917f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentDropbox.Builder.class) +public final class ConnectionResponseContentDropbox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentDropbox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "dropbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentDropbox && equalTo((ConnectionResponseContentDropbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentDropbox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentDropbox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentDropbox build() { + return new ConnectionResponseContentDropbox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java new file mode 100644 index 000000000..e6e7cba23 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentDwolla.Builder.class) +public final class ConnectionResponseContentDwolla + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentDwolla( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "dwolla"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentDwolla && equalTo((ConnectionResponseContentDwolla) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentDwolla other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentDwolla other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentDwolla build() { + return new ConnectionResponseContentDwolla( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java new file mode 100644 index 000000000..1657107d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentEmail.Builder.class) +public final class ConnectionResponseContentEmail + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentEmail( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "email"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentEmail && equalTo((ConnectionResponseContentEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentEmail other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentEmail other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentEmail build() { + return new ConnectionResponseContentEmail( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java new file mode 100644 index 000000000..550882ec6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentEvernote.Builder.class) +public final class ConnectionResponseContentEvernote + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentEvernote( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "evernote"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentEvernote && equalTo((ConnectionResponseContentEvernote) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentEvernote other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentEvernote other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentEvernote build() { + return new ConnectionResponseContentEvernote( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java new file mode 100644 index 000000000..8f133ae37 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentEvernoteSandbox.Builder.class) +public final class ConnectionResponseContentEvernoteSandbox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentEvernoteSandbox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "evernote-sandbox"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentEvernoteSandbox + && equalTo((ConnectionResponseContentEvernoteSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentEvernoteSandbox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentEvernoteSandbox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentEvernoteSandbox build() { + return new ConnectionResponseContentEvernoteSandbox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java new file mode 100644 index 000000000..320bc20f5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentExact.Builder.class) +public final class ConnectionResponseContentExact + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentExact( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "exact"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentExact && equalTo((ConnectionResponseContentExact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentExact other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentExact other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentExact build() { + return new ConnectionResponseContentExact( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java new file mode 100644 index 000000000..42042168f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentFacebook.Builder.class) +public final class ConnectionResponseContentFacebook + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentFacebook( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "facebook"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentFacebook && equalTo((ConnectionResponseContentFacebook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentFacebook other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentFacebook other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentFacebook build() { + return new ConnectionResponseContentFacebook( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java new file mode 100644 index 000000000..295b8de55 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentFitbit.Builder.class) +public final class ConnectionResponseContentFitbit + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentFitbit( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "fitbit"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentFitbit && equalTo((ConnectionResponseContentFitbit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentFitbit other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentFitbit other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentFitbit build() { + return new ConnectionResponseContentFitbit( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java new file mode 100644 index 000000000..57f9d35aa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentFlickr.Builder.class) +public final class ConnectionResponseContentFlickr + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentFlickr( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "flickr"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentFlickr && equalTo((ConnectionResponseContentFlickr) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentFlickr other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentFlickr other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentFlickr build() { + return new ConnectionResponseContentFlickr( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java new file mode 100644 index 000000000..716f44409 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentGitHub.Builder.class) +public final class ConnectionResponseContentGitHub + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentGitHub( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "github"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentGitHub && equalTo((ConnectionResponseContentGitHub) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentGitHub other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentGitHub other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentGitHub build() { + return new ConnectionResponseContentGitHub( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java new file mode 100644 index 000000000..e039d4f28 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentGoogleApps.Builder.class) +public final class ConnectionResponseContentGoogleApps + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentGoogleApps( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "google-apps"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentGoogleApps + && equalTo((ConnectionResponseContentGoogleApps) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentGoogleApps other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentGoogleApps other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentGoogleApps build() { + return new ConnectionResponseContentGoogleApps( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java new file mode 100644 index 000000000..dfdeae063 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentGoogleOAuth2.Builder.class) +public final class ConnectionResponseContentGoogleOAuth2 + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentGoogleOAuth2( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "google-oauth2"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentGoogleOAuth2 + && equalTo((ConnectionResponseContentGoogleOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentGoogleOAuth2 other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentGoogleOAuth2 other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsGoogleOAuth2 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentGoogleOAuth2 build() { + return new ConnectionResponseContentGoogleOAuth2( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java new file mode 100644 index 000000000..4625f9932 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentInstagram.Builder.class) +public final class ConnectionResponseContentInstagram + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentInstagram( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "instagram"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentInstagram + && equalTo((ConnectionResponseContentInstagram) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentInstagram other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentInstagram other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentInstagram build() { + return new ConnectionResponseContentInstagram( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java new file mode 100644 index 000000000..b9a45d58c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentIp.Builder.class) +public final class ConnectionResponseContentIp + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentIp( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "ip"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentIp && equalTo((ConnectionResponseContentIp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentIp other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentIp other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentIp build() { + return new ConnectionResponseContentIp( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java new file mode 100644 index 000000000..8c1da6375 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentLine.Builder.class) +public final class ConnectionResponseContentLine + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentLine( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "line"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentLine && equalTo((ConnectionResponseContentLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentLine other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentLine other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentLine build() { + return new ConnectionResponseContentLine( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java new file mode 100644 index 000000000..1bb22367c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentLinkedin.Builder.class) +public final class ConnectionResponseContentLinkedin + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentLinkedin( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "linkedin"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentLinkedin && equalTo((ConnectionResponseContentLinkedin) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentLinkedin other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentLinkedin other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentLinkedin build() { + return new ConnectionResponseContentLinkedin( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java new file mode 100644 index 000000000..d5947f0d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentMiicard.Builder.class) +public final class ConnectionResponseContentMiicard + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentMiicard( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "miicard"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentMiicard && equalTo((ConnectionResponseContentMiicard) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentMiicard other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentMiicard other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentMiicard build() { + return new ConnectionResponseContentMiicard( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java new file mode 100644 index 000000000..2971a0271 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentOAuth1.Builder.class) +public final class ConnectionResponseContentOAuth1 + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentOAuth1( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oauth1"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentOAuth1 && equalTo((ConnectionResponseContentOAuth1) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentOAuth1 other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentOAuth1 other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentOAuth1 build() { + return new ConnectionResponseContentOAuth1( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java new file mode 100644 index 000000000..5217258c4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentOAuth2.Builder.class) +public final class ConnectionResponseContentOAuth2 + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentOAuth2( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oauth2"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentOAuth2 && equalTo((ConnectionResponseContentOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentOAuth2 other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentOAuth2 other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentOAuth2 build() { + return new ConnectionResponseContentOAuth2( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java new file mode 100644 index 000000000..c262eb876 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentOffice365.Builder.class) +public final class ConnectionResponseContentOffice365 + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentOffice365( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "office365"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentOffice365 + && equalTo((ConnectionResponseContentOffice365) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentOffice365 other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentOffice365 other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentOffice365 build() { + return new ConnectionResponseContentOffice365( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java new file mode 100644 index 000000000..14eeb3c97 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentOidc.Builder.class) +public final class ConnectionResponseContentOidc + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentOidc( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oidc"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentOidc && equalTo((ConnectionResponseContentOidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentOidc other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentOidc other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOidc options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentOidc build() { + return new ConnectionResponseContentOidc( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java new file mode 100644 index 000000000..70184fa72 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentOkta.Builder.class) +public final class ConnectionResponseContentOkta + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentOkta( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "okta"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentOkta && equalTo((ConnectionResponseContentOkta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentOkta other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentOkta other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOkta options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentOkta build() { + return new ConnectionResponseContentOkta( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java new file mode 100644 index 000000000..ef4990f19 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentPaypal.Builder.class) +public final class ConnectionResponseContentPaypal + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentPaypal( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "paypal"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentPaypal && equalTo((ConnectionResponseContentPaypal) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentPaypal other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentPaypal other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentPaypal build() { + return new ConnectionResponseContentPaypal( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java new file mode 100644 index 000000000..bd9d66254 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentPaypalSandbox.Builder.class) +public final class ConnectionResponseContentPaypalSandbox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentPaypalSandbox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "paypal-sandbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentPaypalSandbox + && equalTo((ConnectionResponseContentPaypalSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentPaypalSandbox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentPaypalSandbox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentPaypalSandbox build() { + return new ConnectionResponseContentPaypalSandbox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java new file mode 100644 index 000000000..4d645a95f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentPingFederate.Builder.class) +public final class ConnectionResponseContentPingFederate + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentPingFederate( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "pingfederate"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentPingFederate + && equalTo((ConnectionResponseContentPingFederate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentPingFederate other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentPingFederate other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentPingFederate build() { + return new ConnectionResponseContentPingFederate( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java new file mode 100644 index 000000000..887a349f1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentPlanningCenter.Builder.class) +public final class ConnectionResponseContentPlanningCenter + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentPlanningCenter( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "planningcenter"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentPlanningCenter + && equalTo((ConnectionResponseContentPlanningCenter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentPlanningCenter other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentPlanningCenter other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentPlanningCenter build() { + return new ConnectionResponseContentPlanningCenter( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java new file mode 100644 index 000000000..be4bf8a8b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentRenren.Builder.class) +public final class ConnectionResponseContentRenren + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentRenren( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "renren"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentRenren && equalTo((ConnectionResponseContentRenren) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentRenren other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentRenren other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentRenren build() { + return new ConnectionResponseContentRenren( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java new file mode 100644 index 000000000..7ed3ea57f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSalesforce.Builder.class) +public final class ConnectionResponseContentSalesforce + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentSalesforce( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSalesforce + && equalTo((ConnectionResponseContentSalesforce) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSalesforce other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSalesforce other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSalesforce build() { + return new ConnectionResponseContentSalesforce( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java new file mode 100644 index 000000000..940dcb2d2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSalesforceCommunity.Builder.class) +public final class ConnectionResponseContentSalesforceCommunity + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentSalesforceCommunity( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce-community"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSalesforceCommunity + && equalTo((ConnectionResponseContentSalesforceCommunity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSalesforceCommunity other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSalesforceCommunity other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSalesforceCommunity build() { + return new ConnectionResponseContentSalesforceCommunity( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java new file mode 100644 index 000000000..bd94c2626 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSalesforceSandbox.Builder.class) +public final class ConnectionResponseContentSalesforceSandbox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentSalesforceSandbox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce-sandbox"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSalesforceSandbox + && equalTo((ConnectionResponseContentSalesforceSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSalesforceSandbox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSalesforceSandbox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSalesforceSandbox build() { + return new ConnectionResponseContentSalesforceSandbox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java new file mode 100644 index 000000000..bcd8bf3a0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSaml.Builder.class) +public final class ConnectionResponseContentSaml + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentSaml( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "samlp"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSaml && equalTo((ConnectionResponseContentSaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSaml other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSaml other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSaml build() { + return new ConnectionResponseContentSaml( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java new file mode 100644 index 000000000..eb6896da3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSharepoint.Builder.class) +public final class ConnectionResponseContentSharepoint + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentSharepoint( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "sharepoint"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSharepoint + && equalTo((ConnectionResponseContentSharepoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSharepoint other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSharepoint other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSharepoint build() { + return new ConnectionResponseContentSharepoint( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java new file mode 100644 index 000000000..32b2370bd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentShop.Builder.class) +public final class ConnectionResponseContentShop + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentShop( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "shop"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentShop && equalTo((ConnectionResponseContentShop) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentShop other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentShop other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentShop build() { + return new ConnectionResponseContentShop( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java new file mode 100644 index 000000000..07783a5a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentShopify.Builder.class) +public final class ConnectionResponseContentShopify + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentShopify( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "shopify"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentShopify && equalTo((ConnectionResponseContentShopify) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentShopify other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentShopify other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentShopify build() { + return new ConnectionResponseContentShopify( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java new file mode 100644 index 000000000..885d93fa2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSms.Builder.class) +public final class ConnectionResponseContentSms + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentSms( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "sms"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSms && equalTo((ConnectionResponseContentSms) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSms other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSms other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSms build() { + return new ConnectionResponseContentSms( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java new file mode 100644 index 000000000..a9e73d177 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentSoundcloud.Builder.class) +public final class ConnectionResponseContentSoundcloud + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentSoundcloud( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "soundcloud"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentSoundcloud + && equalTo((ConnectionResponseContentSoundcloud) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentSoundcloud other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentSoundcloud other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentSoundcloud build() { + return new ConnectionResponseContentSoundcloud( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java new file mode 100644 index 000000000..e1430b8a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentTheCity.Builder.class) +public final class ConnectionResponseContentTheCity + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentTheCity( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thecity"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentTheCity && equalTo((ConnectionResponseContentTheCity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentTheCity other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentTheCity other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentTheCity build() { + return new ConnectionResponseContentTheCity( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java new file mode 100644 index 000000000..38b81e6a6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentTheCitySandbox.Builder.class) +public final class ConnectionResponseContentTheCitySandbox + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentTheCitySandbox( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thecity-sandbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentTheCitySandbox + && equalTo((ConnectionResponseContentTheCitySandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentTheCitySandbox other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentTheCitySandbox other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentTheCitySandbox build() { + return new ConnectionResponseContentTheCitySandbox( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java new file mode 100644 index 000000000..fce027ffb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentThirtySevenSignals.Builder.class) +public final class ConnectionResponseContentThirtySevenSignals + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentThirtySevenSignals( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thirtysevensignals"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentThirtySevenSignals + && equalTo((ConnectionResponseContentThirtySevenSignals) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentThirtySevenSignals other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentThirtySevenSignals other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentThirtySevenSignals build() { + return new ConnectionResponseContentThirtySevenSignals( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java new file mode 100644 index 000000000..0ff53e3f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentTwitter.Builder.class) +public final class ConnectionResponseContentTwitter + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentTwitter( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "twitter"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentTwitter && equalTo((ConnectionResponseContentTwitter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentTwitter other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentTwitter other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentTwitter build() { + return new ConnectionResponseContentTwitter( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java new file mode 100644 index 000000000..df8cfcce8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentUntappd.Builder.class) +public final class ConnectionResponseContentUntappd + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentUntappd( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "untappd"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentUntappd && equalTo((ConnectionResponseContentUntappd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentUntappd other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentUntappd other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentUntappd build() { + return new ConnectionResponseContentUntappd( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java new file mode 100644 index 000000000..2e2bb8a5a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentVkontakte.Builder.class) +public final class ConnectionResponseContentVkontakte + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentVkontakte( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "vkontakte"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentVkontakte + && equalTo((ConnectionResponseContentVkontakte) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentVkontakte other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentVkontakte other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentVkontakte build() { + return new ConnectionResponseContentVkontakte( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java new file mode 100644 index 000000000..0c47404a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentWeibo.Builder.class) +public final class ConnectionResponseContentWeibo + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentWeibo( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "weibo"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentWeibo && equalTo((ConnectionResponseContentWeibo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentWeibo other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentWeibo other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentWeibo build() { + return new ConnectionResponseContentWeibo( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java new file mode 100644 index 000000000..7f432801d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentWindowsLive.Builder.class) +public final class ConnectionResponseContentWindowsLive + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private ConnectionResponseContentWindowsLive( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "windowslive"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentWindowsLive + && equalTo((ConnectionResponseContentWindowsLive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentWindowsLive other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentWindowsLive other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentWindowsLive build() { + return new ConnectionResponseContentWindowsLive( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java new file mode 100644 index 000000000..7191dffb5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentWordpress.Builder.class) +public final class ConnectionResponseContentWordpress + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentWordpress( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "wordpress"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentWordpress + && equalTo((ConnectionResponseContentWordpress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentWordpress other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentWordpress other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentWordpress build() { + return new ConnectionResponseContentWordpress( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java new file mode 100644 index 000000000..a0171c42f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentYahoo.Builder.class) +public final class ConnectionResponseContentYahoo + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentYahoo( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yahoo"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentYahoo && equalTo((ConnectionResponseContentYahoo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentYahoo other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentYahoo other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentYahoo build() { + return new ConnectionResponseContentYahoo( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java new file mode 100644 index 000000000..de11ecf0a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentYammer.Builder.class) +public final class ConnectionResponseContentYammer + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentYammer( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yammer"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentYammer && equalTo((ConnectionResponseContentYammer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentYammer other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentYammer other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentYammer build() { + return new ConnectionResponseContentYammer( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java new file mode 100644 index 000000000..4959ab33d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionResponseContentYandex.Builder.class) +public final class ConnectionResponseContentYandex + implements IConnectionResponseCommon, ICreateConnectionCommon, IConnectionCommon { + private final Optional id; + + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private ConnectionResponseContentYandex( + Optional id, + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.id = id; + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yandex"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionResponseContentYandex && equalTo((ConnectionResponseContentYandex) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionResponseContentYandex other) { + return id.equals(other.id) + && name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionResponseContentYandex other) { + id(other.getId()); + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public ConnectionResponseContentYandex build() { + return new ConnectionResponseContentYandex( + id, + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java new file mode 100644 index 000000000..a23875ce9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = ConnectionScopeOAuth2.Deserializer.class) +public final class ConnectionScopeOAuth2 { + private final Object value; + + private final int type; + + private ConnectionScopeOAuth2(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionScopeOAuth2 && equalTo((ConnectionScopeOAuth2) other); + } + + private boolean equalTo(ConnectionScopeOAuth2 other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ConnectionScopeOAuth2 of(String value) { + return new ConnectionScopeOAuth2(value, 0); + } + + public static ConnectionScopeOAuth2 of(List value) { + return new ConnectionScopeOAuth2(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectionScopeOAuth2.class); + } + + @Override + public ConnectionScopeOAuth2 deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java new file mode 100644 index 000000000..00c638227 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionScriptsOAuth2.Builder.class) +public final class ConnectionScriptsOAuth2 { + private final Optional fetchUserProfile; + + private final Optional getLogoutUrl; + + private final Map additionalProperties; + + private ConnectionScriptsOAuth2( + Optional fetchUserProfile, + Optional getLogoutUrl, + Map additionalProperties) { + this.fetchUserProfile = fetchUserProfile; + this.getLogoutUrl = getLogoutUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return Custom JavaScript function to retrieve and transform user profile data from the identity provider. Called with the access token and token exchange response. Must return a user profile object. Executed in a sandboxed environment. If not provided, an empty profile object is used. + */ + @JsonProperty("fetchUserProfile") + public Optional getFetchUserProfile() { + return fetchUserProfile; + } + + /** + * @return Custom JavaScript function to dynamically construct the logout URL for the identity provider. Called with the request query parameters and must invoke a callback with the logout URL. Only used if 'logoutUrl' is not configured. Executed in a sandboxed environment. + */ + @JsonProperty("getLogoutUrl") + public Optional getGetLogoutUrl() { + return getLogoutUrl; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionScriptsOAuth2 && equalTo((ConnectionScriptsOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionScriptsOAuth2 other) { + return fetchUserProfile.equals(other.fetchUserProfile) && getLogoutUrl.equals(other.getLogoutUrl); + } + + @Override + public int hashCode() { + return Objects.hash(this.fetchUserProfile, this.getLogoutUrl); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional fetchUserProfile = Optional.empty(); + + private Optional getLogoutUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionScriptsOAuth2 other) { + fetchUserProfile(other.getFetchUserProfile()); + getLogoutUrl(other.getGetLogoutUrl()); + return this; + } + + /** + *

Custom JavaScript function to retrieve and transform user profile data from the identity provider. Called with the access token and token exchange response. Must return a user profile object. Executed in a sandboxed environment. If not provided, an empty profile object is used.

+ */ + @JsonSetter(value = "fetchUserProfile", nulls = Nulls.SKIP) + public Builder fetchUserProfile(Optional fetchUserProfile) { + this.fetchUserProfile = fetchUserProfile; + return this; + } + + public Builder fetchUserProfile(String fetchUserProfile) { + this.fetchUserProfile = Optional.ofNullable(fetchUserProfile); + return this; + } + + /** + *

Custom JavaScript function to dynamically construct the logout URL for the identity provider. Called with the request query parameters and must invoke a callback with the logout URL. Only used if 'logoutUrl' is not configured. Executed in a sandboxed environment.

+ */ + @JsonSetter(value = "getLogoutUrl", nulls = Nulls.SKIP) + public Builder getLogoutUrl(Optional getLogoutUrl) { + this.getLogoutUrl = getLogoutUrl; + return this; + } + + public Builder getLogoutUrl(String getLogoutUrl) { + this.getLogoutUrl = Optional.ofNullable(getLogoutUrl); + return this; + } + + public ConnectionScriptsOAuth2 build() { + return new ConnectionScriptsOAuth2(fetchUserProfile, getLogoutUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java index 71cb22fa1..729688b04 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionSetUserRootAttributesEnum && this.string.equals(((ConnectionSetUserRootAttributesEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java new file mode 100644 index 000000000..6a5ec0743 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionShouldTrustEmailVerifiedConnectionEnum { + public static final ConnectionShouldTrustEmailVerifiedConnectionEnum ALWAYS_SET_EMAILS_AS_VERIFIED = + new ConnectionShouldTrustEmailVerifiedConnectionEnum( + Value.ALWAYS_SET_EMAILS_AS_VERIFIED, "always_set_emails_as_verified"); + + public static final ConnectionShouldTrustEmailVerifiedConnectionEnum NEVER_SET_EMAILS_AS_VERIFIED = + new ConnectionShouldTrustEmailVerifiedConnectionEnum( + Value.NEVER_SET_EMAILS_AS_VERIFIED, "never_set_emails_as_verified"); + + private final Value value; + + private final String string; + + ConnectionShouldTrustEmailVerifiedConnectionEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionShouldTrustEmailVerifiedConnectionEnum + && this.string.equals(((ConnectionShouldTrustEmailVerifiedConnectionEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALWAYS_SET_EMAILS_AS_VERIFIED: + return visitor.visitAlwaysSetEmailsAsVerified(); + case NEVER_SET_EMAILS_AS_VERIFIED: + return visitor.visitNeverSetEmailsAsVerified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionShouldTrustEmailVerifiedConnectionEnum valueOf(String value) { + switch (value) { + case "always_set_emails_as_verified": + return ALWAYS_SET_EMAILS_AS_VERIFIED; + case "never_set_emails_as_verified": + return NEVER_SET_EMAILS_AS_VERIFIED; + default: + return new ConnectionShouldTrustEmailVerifiedConnectionEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NEVER_SET_EMAILS_AS_VERIFIED, + + ALWAYS_SET_EMAILS_AS_VERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitNeverSetEmailsAsVerified(); + + T visitAlwaysSetEmailsAsVerified(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java index a69407be8..03ca770aa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java @@ -158,20 +158,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionStrategyEnum && this.string.equals(((ConnectionStrategyEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java new file mode 100644 index 000000000..928a8db9b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionTokenEndpointAuthMethodEnum { + public static final ConnectionTokenEndpointAuthMethodEnum PRIVATE_KEY_JWT = + new ConnectionTokenEndpointAuthMethodEnum(Value.PRIVATE_KEY_JWT, "private_key_jwt"); + + public static final ConnectionTokenEndpointAuthMethodEnum CLIENT_SECRET_POST = + new ConnectionTokenEndpointAuthMethodEnum(Value.CLIENT_SECRET_POST, "client_secret_post"); + + private final Value value; + + private final String string; + + ConnectionTokenEndpointAuthMethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionTokenEndpointAuthMethodEnum + && this.string.equals(((ConnectionTokenEndpointAuthMethodEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PRIVATE_KEY_JWT: + return visitor.visitPrivateKeyJwt(); + case CLIENT_SECRET_POST: + return visitor.visitClientSecretPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionTokenEndpointAuthMethodEnum valueOf(String value) { + switch (value) { + case "private_key_jwt": + return PRIVATE_KEY_JWT; + case "client_secret_post": + return CLIENT_SECRET_POST; + default: + return new ConnectionTokenEndpointAuthMethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CLIENT_SECRET_POST, + + PRIVATE_KEY_JWT, + + UNKNOWN + } + + public interface Visitor { + T visitClientSecretPost(); + + T visitPrivateKeyJwt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java new file mode 100644 index 000000000..818c87bde --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionTokenEndpointAuthSigningAlgEnum { + public static final ConnectionTokenEndpointAuthSigningAlgEnum RS512 = + new ConnectionTokenEndpointAuthSigningAlgEnum(Value.RS512, "RS512"); + + public static final ConnectionTokenEndpointAuthSigningAlgEnum ES256 = + new ConnectionTokenEndpointAuthSigningAlgEnum(Value.ES256, "ES256"); + + public static final ConnectionTokenEndpointAuthSigningAlgEnum PS256 = + new ConnectionTokenEndpointAuthSigningAlgEnum(Value.PS256, "PS256"); + + public static final ConnectionTokenEndpointAuthSigningAlgEnum RS256 = + new ConnectionTokenEndpointAuthSigningAlgEnum(Value.RS256, "RS256"); + + private final Value value; + + private final String string; + + ConnectionTokenEndpointAuthSigningAlgEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionTokenEndpointAuthSigningAlgEnum + && this.string.equals(((ConnectionTokenEndpointAuthSigningAlgEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case ES256: + return visitor.visitEs256(); + case PS256: + return visitor.visitPs256(); + case RS256: + return visitor.visitRs256(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionTokenEndpointAuthSigningAlgEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "ES256": + return ES256; + case "PS256": + return PS256; + case "RS256": + return RS256; + default: + return new ConnectionTokenEndpointAuthSigningAlgEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ES256, + + PS256, + + RS256, + + RS512, + + UNKNOWN + } + + public interface Visitor { + T visitEs256(); + + T visitPs256(); + + T visitRs256(); + + T visitRs512(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java new file mode 100644 index 000000000..f1f15d96e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionTypeEnumOidc { + public static final ConnectionTypeEnumOidc FRONT_CHANNEL = + new ConnectionTypeEnumOidc(Value.FRONT_CHANNEL, "front_channel"); + + public static final ConnectionTypeEnumOidc BACK_CHANNEL = + new ConnectionTypeEnumOidc(Value.BACK_CHANNEL, "back_channel"); + + private final Value value; + + private final String string; + + ConnectionTypeEnumOidc(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionTypeEnumOidc + && this.string.equals(((ConnectionTypeEnumOidc) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FRONT_CHANNEL: + return visitor.visitFrontChannel(); + case BACK_CHANNEL: + return visitor.visitBackChannel(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionTypeEnumOidc valueOf(String value) { + switch (value) { + case "front_channel": + return FRONT_CHANNEL; + case "back_channel": + return BACK_CHANNEL; + default: + return new ConnectionTypeEnumOidc(Value.UNKNOWN, value); + } + } + + public enum Value { + BACK_CHANNEL, + + FRONT_CHANNEL, + + UNKNOWN + } + + public interface Visitor { + T visitBackChannel(); + + T visitFrontChannel(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java new file mode 100644 index 000000000..2cad0155a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConnectionUpstreamAdditionalProperties.Deserializer.class) +public final class ConnectionUpstreamAdditionalProperties { + private final Object value; + + private final int type; + + private ConnectionUpstreamAdditionalProperties(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ConnectionUpstreamAlias) this.value); + } else if (this.type == 1) { + return visitor.visit((ConnectionUpstreamValue) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionUpstreamAdditionalProperties + && equalTo((ConnectionUpstreamAdditionalProperties) other); + } + + private boolean equalTo(ConnectionUpstreamAdditionalProperties other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ConnectionUpstreamAdditionalProperties of(ConnectionUpstreamAlias value) { + return new ConnectionUpstreamAdditionalProperties(value, 0); + } + + public static ConnectionUpstreamAdditionalProperties of(ConnectionUpstreamValue value) { + return new ConnectionUpstreamAdditionalProperties(value, 1); + } + + public interface Visitor { + T visit(ConnectionUpstreamAlias value); + + T visit(ConnectionUpstreamValue value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectionUpstreamAdditionalProperties.class); + } + + @Override + public ConnectionUpstreamAdditionalProperties deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ConnectionUpstreamAlias.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ConnectionUpstreamValue.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAlias.java similarity index 54% rename from src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java rename to src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAlias.java index 6981db849..2e81c13ec 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculHeadTagAttributes.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAlias.java @@ -13,32 +13,32 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AculHeadTagAttributes.Builder.class) -public final class AculHeadTagAttributes { - private final Optional> integrity; +@JsonDeserialize(builder = ConnectionUpstreamAlias.Builder.class) +public final class ConnectionUpstreamAlias { + private final Optional alias; private final Map additionalProperties; - private AculHeadTagAttributes(Optional> integrity, Map additionalProperties) { - this.integrity = integrity; + private ConnectionUpstreamAlias( + Optional alias, Map additionalProperties) { + this.alias = alias; this.additionalProperties = additionalProperties; } - @JsonProperty("integrity") - public Optional> getIntegrity() { - return integrity; + @JsonProperty("alias") + public Optional getAlias() { + return alias; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AculHeadTagAttributes && equalTo((AculHeadTagAttributes) other); + return other instanceof ConnectionUpstreamAlias && equalTo((ConnectionUpstreamAlias) other); } @JsonAnyGetter @@ -46,16 +46,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AculHeadTagAttributes other) { - return integrity.equals(other.integrity); + private boolean equalTo(ConnectionUpstreamAlias other) { + return alias.equals(other.alias); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.integrity); + return Objects.hash(this.alias); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -66,31 +66,31 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> integrity = Optional.empty(); + private Optional alias = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(AculHeadTagAttributes other) { - integrity(other.getIntegrity()); + public Builder from(ConnectionUpstreamAlias other) { + alias(other.getAlias()); return this; } - @JsonSetter(value = "integrity", nulls = Nulls.SKIP) - public Builder integrity(Optional> integrity) { - this.integrity = integrity; + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public Builder alias(Optional alias) { + this.alias = alias; return this; } - public Builder integrity(List integrity) { - this.integrity = Optional.ofNullable(integrity); + public Builder alias(ConnectionUpstreamAliasEnum alias) { + this.alias = Optional.ofNullable(alias); return this; } - public AculHeadTagAttributes build() { - return new AculHeadTagAttributes(integrity, additionalProperties); + public ConnectionUpstreamAlias build() { + return new ConnectionUpstreamAlias(alias, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java new file mode 100644 index 000000000..2bffb6b2c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionUpstreamAliasEnum { + public static final ConnectionUpstreamAliasEnum ACR_VALUES = + new ConnectionUpstreamAliasEnum(Value.ACR_VALUES, "acr_values"); + + public static final ConnectionUpstreamAliasEnum AUDIENCE = + new ConnectionUpstreamAliasEnum(Value.AUDIENCE, "audience"); + + public static final ConnectionUpstreamAliasEnum LOGIN_HINT = + new ConnectionUpstreamAliasEnum(Value.LOGIN_HINT, "login_hint"); + + public static final ConnectionUpstreamAliasEnum RESPONSE_TYPE = + new ConnectionUpstreamAliasEnum(Value.RESPONSE_TYPE, "response_type"); + + public static final ConnectionUpstreamAliasEnum CLIENT_ID = + new ConnectionUpstreamAliasEnum(Value.CLIENT_ID, "client_id"); + + public static final ConnectionUpstreamAliasEnum UI_LOCALES = + new ConnectionUpstreamAliasEnum(Value.UI_LOCALES, "ui_locales"); + + public static final ConnectionUpstreamAliasEnum ID_TOKEN_HINT = + new ConnectionUpstreamAliasEnum(Value.ID_TOKEN_HINT, "id_token_hint"); + + public static final ConnectionUpstreamAliasEnum DISPLAY = new ConnectionUpstreamAliasEnum(Value.DISPLAY, "display"); + + public static final ConnectionUpstreamAliasEnum PROMPT = new ConnectionUpstreamAliasEnum(Value.PROMPT, "prompt"); + + public static final ConnectionUpstreamAliasEnum MAX_AGE = new ConnectionUpstreamAliasEnum(Value.MAX_AGE, "max_age"); + + public static final ConnectionUpstreamAliasEnum RESOURCE = + new ConnectionUpstreamAliasEnum(Value.RESOURCE, "resource"); + + public static final ConnectionUpstreamAliasEnum RESPONSE_MODE = + new ConnectionUpstreamAliasEnum(Value.RESPONSE_MODE, "response_mode"); + + private final Value value; + + private final String string; + + ConnectionUpstreamAliasEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionUpstreamAliasEnum + && this.string.equals(((ConnectionUpstreamAliasEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACR_VALUES: + return visitor.visitAcrValues(); + case AUDIENCE: + return visitor.visitAudience(); + case LOGIN_HINT: + return visitor.visitLoginHint(); + case RESPONSE_TYPE: + return visitor.visitResponseType(); + case CLIENT_ID: + return visitor.visitClientId(); + case UI_LOCALES: + return visitor.visitUiLocales(); + case ID_TOKEN_HINT: + return visitor.visitIdTokenHint(); + case DISPLAY: + return visitor.visitDisplay(); + case PROMPT: + return visitor.visitPrompt(); + case MAX_AGE: + return visitor.visitMaxAge(); + case RESOURCE: + return visitor.visitResource(); + case RESPONSE_MODE: + return visitor.visitResponseMode(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionUpstreamAliasEnum valueOf(String value) { + switch (value) { + case "acr_values": + return ACR_VALUES; + case "audience": + return AUDIENCE; + case "login_hint": + return LOGIN_HINT; + case "response_type": + return RESPONSE_TYPE; + case "client_id": + return CLIENT_ID; + case "ui_locales": + return UI_LOCALES; + case "id_token_hint": + return ID_TOKEN_HINT; + case "display": + return DISPLAY; + case "prompt": + return PROMPT; + case "max_age": + return MAX_AGE; + case "resource": + return RESOURCE; + case "response_mode": + return RESPONSE_MODE; + default: + return new ConnectionUpstreamAliasEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ACR_VALUES, + + AUDIENCE, + + CLIENT_ID, + + DISPLAY, + + ID_TOKEN_HINT, + + LOGIN_HINT, + + MAX_AGE, + + PROMPT, + + RESOURCE, + + RESPONSE_MODE, + + RESPONSE_TYPE, + + UI_LOCALES, + + UNKNOWN + } + + public interface Visitor { + T visitAcrValues(); + + T visitAudience(); + + T visitClientId(); + + T visitDisplay(); + + T visitIdTokenHint(); + + T visitLoginHint(); + + T visitMaxAge(); + + T visitPrompt(); + + T visitResource(); + + T visitResponseMode(); + + T visitResponseType(); + + T visitUiLocales(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java new file mode 100644 index 000000000..2386642f2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionUpstreamValue.Builder.class) +public final class ConnectionUpstreamValue { + private final Optional value; + + private final Map additionalProperties; + + private ConnectionUpstreamValue(Optional value, Map additionalProperties) { + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionUpstreamValue && equalTo((ConnectionUpstreamValue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionUpstreamValue other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionUpstreamValue other) { + value(other.getValue()); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + public ConnectionUpstreamValue build() { + return new ConnectionUpstreamValue(value, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java new file mode 100644 index 000000000..6dae9bf66 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionUseridAttributeEnumAzureAd { + public static final ConnectionUseridAttributeEnumAzureAd SUB = + new ConnectionUseridAttributeEnumAzureAd(Value.SUB, "sub"); + + public static final ConnectionUseridAttributeEnumAzureAd OID = + new ConnectionUseridAttributeEnumAzureAd(Value.OID, "oid"); + + private final Value value; + + private final String string; + + ConnectionUseridAttributeEnumAzureAd(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionUseridAttributeEnumAzureAd + && this.string.equals(((ConnectionUseridAttributeEnumAzureAd) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SUB: + return visitor.visitSub(); + case OID: + return visitor.visitOid(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionUseridAttributeEnumAzureAd valueOf(String value) { + switch (value) { + case "sub": + return SUB; + case "oid": + return OID; + default: + return new ConnectionUseridAttributeEnumAzureAd(Value.UNKNOWN, value); + } + } + + public enum Value { + OID, + + SUB, + + UNKNOWN + } + + public interface Visitor { + T visitOid(); + + T visitSub(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java index 07586413b..002678a66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java @@ -40,7 +40,7 @@ public int getMax() { return max; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionUsernameValidationOptions @@ -56,12 +56,12 @@ private boolean equalTo(ConnectionUsernameValidationOptions other) { return min == other.min && max == other.max; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.min, this.max); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements MinStage, MaxStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ConnectionUsernameValidationOptions other) { min(other.getMin()); max(other.getMax()); return this; } - @java.lang.Override + @Override @JsonSetter("min") public MaxStage min(int min) { this.min = min; return this; } - @java.lang.Override + @Override @JsonSetter("max") public _FinalStage max(int max) { this.max = max; return this; } - @java.lang.Override + @Override public ConnectionUsernameValidationOptions build() { return new ConnectionUsernameValidationOptions(min, max, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java index e95610f27..5bc9f5bf9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java @@ -48,7 +48,7 @@ private OptionalNullable _getUsername() { return username; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionValidationOptions && equalTo((ConnectionValidationOptions) other); @@ -63,12 +63,12 @@ private boolean equalTo(ConnectionValidationOptions other) { return username.equals(other.username); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.username); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java new file mode 100644 index 000000000..257e908be --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionWaadProtocolEnumAzureAd { + public static final ConnectionWaadProtocolEnumAzureAd OPENID_CONNECT = + new ConnectionWaadProtocolEnumAzureAd(Value.OPENID_CONNECT, "openid-connect"); + + public static final ConnectionWaadProtocolEnumAzureAd WS_FEDERATION = + new ConnectionWaadProtocolEnumAzureAd(Value.WS_FEDERATION, "ws-federation"); + + private final Value value; + + private final String string; + + ConnectionWaadProtocolEnumAzureAd(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionWaadProtocolEnumAzureAd + && this.string.equals(((ConnectionWaadProtocolEnumAzureAd) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OPENID_CONNECT: + return visitor.visitOpenidConnect(); + case WS_FEDERATION: + return visitor.visitWsFederation(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionWaadProtocolEnumAzureAd valueOf(String value) { + switch (value) { + case "openid-connect": + return OPENID_CONNECT; + case "ws-federation": + return WS_FEDERATION; + default: + return new ConnectionWaadProtocolEnumAzureAd(Value.UNKNOWN, value); + } + } + + public enum Value { + WS_FEDERATION, + + OPENID_CONNECT, + + UNKNOWN + } + + public interface Visitor { + T visitWsFederation(); + + T visitOpenidConnect(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java index 4fe6d97ce..8051e8c49 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java @@ -91,7 +91,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -114,7 +114,7 @@ public Optional getDeploy() { return deploy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateActionRequestContent && equalTo((CreateActionRequestContent) other); @@ -135,7 +135,7 @@ private boolean equalTo(CreateActionRequestContent other) { && deploy.equals(other.deploy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -147,7 +147,7 @@ public int hashCode() { this.deploy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -192,7 +192,7 @@ public interface _FinalStage { _FinalStage dependencies(List dependencies); /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ _FinalStage runtime(Optional runtime); @@ -234,7 +234,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateActionRequestContent other) { name(other.getName()); supportedTriggers(other.getSupportedTriggers()); @@ -251,7 +251,7 @@ public Builder from(CreateActionRequestContent other) { *

The name of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -262,7 +262,7 @@ public _FinalStage name(@NotNull String name) { *

True if the action should be deployed after creation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage deploy(Boolean deploy) { this.deploy = Optional.ofNullable(deploy); return this; @@ -271,7 +271,7 @@ public _FinalStage deploy(Boolean deploy) { /** *

True if the action should be deployed after creation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "deploy", nulls = Nulls.SKIP) public _FinalStage deploy(Optional deploy) { this.deploy = deploy; @@ -282,7 +282,7 @@ public _FinalStage deploy(Optional deploy) { *

The list of secrets that are included in an action or a version of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage secrets(List secrets) { this.secrets = Optional.ofNullable(secrets); return this; @@ -291,7 +291,7 @@ public _FinalStage secrets(List secrets) { /** *

The list of secrets that are included in an action or a version of an action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "secrets", nulls = Nulls.SKIP) public _FinalStage secrets(Optional> secrets) { this.secrets = secrets; @@ -299,19 +299,19 @@ public _FinalStage secrets(Optional> secrets) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage runtime(String runtime) { this.runtime = Optional.ofNullable(runtime); return this; } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ - @java.lang.Override + @Override @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public _FinalStage runtime(Optional runtime) { this.runtime = runtime; @@ -322,7 +322,7 @@ public _FinalStage runtime(Optional runtime) { *

The list of third party npm modules, and their versions, that this action depends on.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage dependencies(List dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; @@ -331,7 +331,7 @@ public _FinalStage dependencies(List dependencies) { /** *

The list of third party npm modules, and their versions, that this action depends on.

*/ - @java.lang.Override + @Override @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) public _FinalStage dependencies(Optional> dependencies) { this.dependencies = dependencies; @@ -342,7 +342,7 @@ public _FinalStage dependencies(Optional> dependen *

The source code of the action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage code(String code) { this.code = Optional.ofNullable(code); return this; @@ -351,7 +351,7 @@ public _FinalStage code(String code) { /** *

The source code of the action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; @@ -362,7 +362,7 @@ public _FinalStage code(Optional code) { *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllSupportedTriggers(List supportedTriggers) { if (supportedTriggers != null) { this.supportedTriggers.addAll(supportedTriggers); @@ -374,7 +374,7 @@ public _FinalStage addAllSupportedTriggers(List supportedTriggers *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers) { this.supportedTriggers.add(supportedTriggers); return this; @@ -383,7 +383,7 @@ public _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers) { /** *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

*/ - @java.lang.Override + @Override @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) public _FinalStage supportedTriggers(List supportedTriggers) { this.supportedTriggers.clear(); @@ -393,7 +393,7 @@ public _FinalStage supportedTriggers(List supportedTriggers) { return this; } - @java.lang.Override + @Override public CreateActionRequestContent build() { return new CreateActionRequestContent( name, supportedTriggers, code, dependencies, runtime, secrets, deploy, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java index 81fa44501..193acf5de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java @@ -158,7 +158,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -212,7 +212,7 @@ public Optional getDeploy() { return deploy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateActionResponseContent && equalTo((CreateActionResponseContent) other); @@ -242,7 +242,7 @@ private boolean equalTo(CreateActionResponseContent other) { && deploy.equals(other.deploy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -263,7 +263,7 @@ public int hashCode() { this.deploy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -444,7 +444,7 @@ public Builder dependencies(List dependencies) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java index 43f197694..f9411878a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java @@ -113,7 +113,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(CreateBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(CreateBrandingPhoneProviderResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @java.lang.Override + @Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public CreateBrandingPhoneProviderResponseContent build() { return new CreateBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java index 10eca3e8f..944a3a289 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(CreateBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(CreateBrandingThemeResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @java.lang.Override + @Override public CreateBrandingThemeResponseContent build() { return new CreateBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java index e80e17856..6935baedf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,11 @@ public final class CreateClientGrantRequestContent { private final Optional allowAnyOrganization; - private final List scope; + private final Optional> scope; + + private final Optional subjectType; + + private final Optional> authorizationDetailsTypes; private final Map additionalProperties; @@ -40,13 +43,17 @@ private CreateClientGrantRequestContent( String audience, Optional organizationUsage, Optional allowAnyOrganization, - List scope, + Optional> scope, + Optional subjectType, + Optional> authorizationDetailsTypes, Map additionalProperties) { this.clientId = clientId; this.audience = audience; this.organizationUsage = organizationUsage; this.allowAnyOrganization = allowAnyOrganization; this.scope = scope; + this.subjectType = subjectType; + this.authorizationDetailsTypes = authorizationDetailsTypes; this.additionalProperties = additionalProperties; } @@ -83,11 +90,24 @@ public Optional getAllowAnyOrganization() { * @return Scopes allowed for this client grant. */ @JsonProperty("scope") - public List getScope() { + public Optional> getScope() { return scope; } - @java.lang.Override + @JsonProperty("subject_type") + public Optional getSubjectType() { + return subjectType; + } + + /** + * @return Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonProperty("authorization_details_types") + public Optional> getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientGrantRequestContent && equalTo((CreateClientGrantRequestContent) other); @@ -103,16 +123,24 @@ private boolean equalTo(CreateClientGrantRequestContent other) { && audience.equals(other.audience) && organizationUsage.equals(other.organizationUsage) && allowAnyOrganization.equals(other.allowAnyOrganization) - && scope.equals(other.scope); + && scope.equals(other.scope) + && subjectType.equals(other.subjectType) + && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( - this.clientId, this.audience, this.organizationUsage, this.allowAnyOrganization, this.scope); + this.clientId, + this.audience, + this.organizationUsage, + this.allowAnyOrganization, + this.scope, + this.subjectType, + this.authorizationDetailsTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -154,11 +182,20 @@ public interface _FinalStage { /** *

Scopes allowed for this client grant.

*/ + _FinalStage scope(Optional> scope); + _FinalStage scope(List scope); - _FinalStage addScope(String scope); + _FinalStage subjectType(Optional subjectType); + + _FinalStage subjectType(ClientGrantSubjectTypeEnum subjectType); - _FinalStage addAllScope(List scope); + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + _FinalStage authorizationDetailsTypes(Optional> authorizationDetailsTypes); + + _FinalStage authorizationDetailsTypes(List authorizationDetailsTypes); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -167,7 +204,11 @@ public static final class Builder implements ClientIdStage, AudienceStage, _Fina private String audience; - private List scope = new ArrayList<>(); + private Optional> authorizationDetailsTypes = Optional.empty(); + + private Optional subjectType = Optional.empty(); + + private Optional> scope = Optional.empty(); private Optional allowAnyOrganization = Optional.empty(); @@ -178,13 +219,15 @@ public static final class Builder implements ClientIdStage, AudienceStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(CreateClientGrantRequestContent other) { clientId(other.getClientId()); audience(other.getAudience()); organizationUsage(other.getOrganizationUsage()); allowAnyOrganization(other.getAllowAnyOrganization()); scope(other.getScope()); + subjectType(other.getSubjectType()); + authorizationDetailsTypes(other.getAuthorizationDetailsTypes()); return this; } @@ -193,7 +236,7 @@ public Builder from(CreateClientGrantRequestContent other) { *

ID of the client.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("client_id") public AudienceStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -205,7 +248,7 @@ public AudienceStage clientId(@NotNull String clientId) { *

The audience (API identifier) of this client grant

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("audience") public _FinalStage audience(@NotNull String audience) { this.audience = Objects.requireNonNull(audience, "audience must not be null"); @@ -213,14 +256,35 @@ public _FinalStage audience(@NotNull String audience) { } /** - *

Scopes allowed for this client grant.

+ *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage addAllScope(List scope) { - if (scope != null) { - this.scope.addAll(scope); - } + @Override + public _FinalStage authorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); + return this; + } + + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @Override + @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) + public _FinalStage authorizationDetailsTypes(Optional> authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + @Override + public _FinalStage subjectType(ClientGrantSubjectTypeEnum subjectType) { + this.subjectType = Optional.ofNullable(subjectType); + return this; + } + + @Override + @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) + public _FinalStage subjectType(Optional subjectType) { + this.subjectType = subjectType; return this; } @@ -228,22 +292,19 @@ public _FinalStage addAllScope(List scope) { *

Scopes allowed for this client grant.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage addScope(String scope) { - this.scope.add(scope); + @Override + public _FinalStage scope(List scope) { + this.scope = Optional.ofNullable(scope); return this; } /** *

Scopes allowed for this client grant.

*/ - @java.lang.Override + @Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) - public _FinalStage scope(List scope) { - this.scope.clear(); - if (scope != null) { - this.scope.addAll(scope); - } + public _FinalStage scope(Optional> scope) { + this.scope = scope; return this; } @@ -251,7 +312,7 @@ public _FinalStage scope(List scope) { *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowAnyOrganization(Boolean allowAnyOrganization) { this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); return this; @@ -260,30 +321,37 @@ public _FinalStage allowAnyOrganization(Boolean allowAnyOrganization) { /** *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

*/ - @java.lang.Override + @Override @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) public _FinalStage allowAnyOrganization(Optional allowAnyOrganization) { this.allowAnyOrganization = allowAnyOrganization; return this; } - @java.lang.Override + @Override public _FinalStage organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { this.organizationUsage = Optional.ofNullable(organizationUsage); return this; } - @java.lang.Override + @Override @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) public _FinalStage organizationUsage(Optional organizationUsage) { this.organizationUsage = organizationUsage; return this; } - @java.lang.Override + @Override public CreateClientGrantRequestContent build() { return new CreateClientGrantRequestContent( - clientId, audience, organizationUsage, allowAnyOrganization, scope, additionalProperties); + clientId, + audience, + organizationUsage, + allowAnyOrganization, + scope, + subjectType, + authorizationDetailsTypes, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java index cf1445b38..6b370905a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java @@ -35,6 +35,10 @@ public final class CreateClientGrantResponseContent { private final Optional isSystem; + private final Optional subjectType; + + private final Optional> authorizationDetailsTypes; + private final Map additionalProperties; private CreateClientGrantResponseContent( @@ -45,6 +49,8 @@ private CreateClientGrantResponseContent( Optional organizationUsage, Optional allowAnyOrganization, Optional isSystem, + Optional subjectType, + Optional> authorizationDetailsTypes, Map additionalProperties) { this.id = id; this.clientId = clientId; @@ -53,6 +59,8 @@ private CreateClientGrantResponseContent( this.organizationUsage = organizationUsage; this.allowAnyOrganization = allowAnyOrganization; this.isSystem = isSystem; + this.subjectType = subjectType; + this.authorizationDetailsTypes = authorizationDetailsTypes; this.additionalProperties = additionalProperties; } @@ -109,7 +117,20 @@ public Optional getIsSystem() { return isSystem; } - @java.lang.Override + @JsonProperty("subject_type") + public Optional getSubjectType() { + return subjectType; + } + + /** + * @return Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonProperty("authorization_details_types") + public Optional> getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientGrantResponseContent && equalTo((CreateClientGrantResponseContent) other); @@ -127,10 +148,12 @@ private boolean equalTo(CreateClientGrantResponseContent other) { && scope.equals(other.scope) && organizationUsage.equals(other.organizationUsage) && allowAnyOrganization.equals(other.allowAnyOrganization) - && isSystem.equals(other.isSystem); + && isSystem.equals(other.isSystem) + && subjectType.equals(other.subjectType) + && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -139,10 +162,12 @@ public int hashCode() { this.scope, this.organizationUsage, this.allowAnyOrganization, - this.isSystem); + this.isSystem, + this.subjectType, + this.authorizationDetailsTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,6 +192,10 @@ public static final class Builder { private Optional isSystem = Optional.empty(); + private Optional subjectType = Optional.empty(); + + private Optional> authorizationDetailsTypes = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -180,6 +209,8 @@ public Builder from(CreateClientGrantResponseContent other) { organizationUsage(other.getOrganizationUsage()); allowAnyOrganization(other.getAllowAnyOrganization()); isSystem(other.getIsSystem()); + subjectType(other.getSubjectType()); + authorizationDetailsTypes(other.getAuthorizationDetailsTypes()); return this; } @@ -278,6 +309,31 @@ public Builder isSystem(Boolean isSystem) { return this; } + @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) + public Builder subjectType(Optional subjectType) { + this.subjectType = subjectType; + return this; + } + + public Builder subjectType(ClientGrantSubjectTypeEnum subjectType) { + this.subjectType = Optional.ofNullable(subjectType); + return this; + } + + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) + public Builder authorizationDetailsTypes(Optional> authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + public Builder authorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); + return this; + } + public CreateClientGrantResponseContent build() { return new CreateClientGrantResponseContent( id, @@ -287,6 +343,8 @@ public CreateClientGrantResponseContent build() { organizationUsage, allowAnyOrganization, isSystem, + subjectType, + authorizationDetailsTypes, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java index a9bfe0069..d95c54911 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java @@ -53,6 +53,8 @@ public final class CreateClientRequestContent { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional appType; private final Optional isFirstParty; @@ -97,6 +99,8 @@ public final class CreateClientRequestContent { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final Optional clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -107,12 +111,20 @@ public final class CreateClientRequestContent { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; private final Optional resourceServerIdentifier; + private final Optional expressConfiguration; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private CreateClientRequestContent( @@ -130,6 +142,7 @@ private CreateClientRequestContent( Optional> allowedLogoutUrls, Optional> grantTypes, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional appType, Optional isFirstParty, Optional oidcConformant, @@ -152,14 +165,19 @@ private CreateClientRequestContent( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, Optional clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, Optional resourceServerIdentifier, + Optional expressConfiguration, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.name = name; this.description = description; @@ -175,6 +193,7 @@ private CreateClientRequestContent( this.allowedLogoutUrls = allowedLogoutUrls; this.grantTypes = grantTypes; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.appType = appType; this.isFirstParty = isFirstParty; this.oidcConformant = oidcConformant; @@ -197,14 +216,19 @@ private CreateClientRequestContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; this.resourceServerIdentifier = resourceServerIdentifier; + this.expressConfiguration = expressConfiguration; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -300,7 +324,7 @@ public Optional> getAllowedLogoutUrls() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -312,6 +336,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("app_type") public Optional getAppType() { return appType; @@ -467,6 +499,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonProperty("client_authentication_methods") public Optional getClientAuthenticationMethods() { return clientAuthenticationMethods; @@ -502,6 +542,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -527,6 +582,16 @@ public Optional getResourceServerIdentifier() { return resourceServerIdentifier; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -563,7 +628,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientRequestContent && equalTo((CreateClientRequestContent) other); @@ -589,6 +654,7 @@ private boolean equalTo(CreateClientRequestContent other) { && allowedLogoutUrls.equals(other.allowedLogoutUrls) && grantTypes.equals(other.grantTypes) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && appType.equals(other.appType) && isFirstParty.equals(other.isFirstParty) && oidcConformant.equals(other.oidcConformant) @@ -611,17 +677,23 @@ private boolean equalTo(CreateClientRequestContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) && tokenQuota.equals(other.tokenQuota) - && resourceServerIdentifier.equals(other.resourceServerIdentifier); + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && expressConfiguration.equals(other.expressConfiguration) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -638,6 +710,7 @@ public int hashCode() { this.allowedLogoutUrls, this.grantTypes, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.appType, this.isFirstParty, this.oidcConformant, @@ -660,17 +733,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, this.tokenQuota, - this.resourceServerIdentifier); + this.resourceServerIdentifier, + this.expressConfiguration, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -765,7 +843,7 @@ _FinalStage sessionTransfer( _FinalStage allowedLogoutUrls(List allowedLogoutUrls); /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ _FinalStage grantTypes(Optional> grantTypes); @@ -775,6 +853,13 @@ _FinalStage sessionTransfer( _FinalStage tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod); + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + _FinalStage isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted); + + _FinalStage isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted); + _FinalStage appType(Optional appType); _FinalStage appType(ClientAppTypeEnum appType); @@ -910,6 +995,14 @@ _FinalStage organizationRequireBehavior( _FinalStage organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum organizationRequireBehavior); + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + _FinalStage organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods); + + _FinalStage organizationDiscoveryMethods(List organizationDiscoveryMethods); + _FinalStage clientAuthenticationMethods(Optional clientAuthenticationMethods); _FinalStage clientAuthenticationMethods(ClientCreateAuthenticationMethod clientAuthenticationMethods); @@ -940,6 +1033,21 @@ _FinalStage organizationRequireBehavior( _FinalStage complianceLevel(com.auth0.client.mgmt.core.Nullable complianceLevel); + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt); + + _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt); + + _FinalStage tokenExchange(Optional tokenExchange); + + _FinalStage tokenExchange(ClientTokenExchangeConfiguration tokenExchange); + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -961,18 +1069,37 @@ _FinalStage organizationRequireBehavior( _FinalStage resourceServerIdentifier(Optional resourceServerIdentifier); _FinalStage resourceServerIdentifier(String resourceServerIdentifier); + + _FinalStage expressConfiguration(Optional expressConfiguration); + + _FinalStage expressConfiguration(ExpressConfiguration expressConfiguration); + + _FinalStage asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels); + + _FinalStage asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements NameStage, _FinalStage { private String name; + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + + private Optional expressConfiguration = Optional.empty(); + private Optional resourceServerIdentifier = Optional.empty(); private Optional tokenQuota = Optional.empty(); private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + private Optional tokenExchange = Optional.empty(); + + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + private OptionalNullable complianceLevel = OptionalNullable.absent(); private Optional signedRequestObject = Optional.empty(); @@ -983,6 +1110,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional clientAuthenticationMethods = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private Optional organizationRequireBehavior = Optional.empty(); private Optional organizationUsage = Optional.empty(); @@ -1027,6 +1156,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional appType = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional tokenEndpointAuthMethod = Optional.empty(); private Optional> grantTypes = Optional.empty(); @@ -1058,7 +1189,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateClientRequestContent other) { name(other.getName()); description(other.getDescription()); @@ -1074,6 +1205,7 @@ public Builder from(CreateClientRequestContent other) { allowedLogoutUrls(other.getAllowedLogoutUrls()); grantTypes(other.getGrantTypes()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); appType(other.getAppType()); isFirstParty(other.getIsFirstParty()); oidcConformant(other.getOidcConformant()); @@ -1096,14 +1228,19 @@ public Builder from(CreateClientRequestContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); resourceServerIdentifier(other.getResourceServerIdentifier()); + expressConfiguration(other.getExpressConfiguration()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -1112,18 +1249,46 @@ public Builder from(CreateClientRequestContent other) { *

Name of this client (min length: 1 character, does not allow < or >).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } + @Override + public _FinalStage asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + + @Override + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public _FinalStage asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + @Override + public _FinalStage expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + @Override + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public _FinalStage expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + /** *

The identifier of the resource server that this client is linked to.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resourceServerIdentifier(String resourceServerIdentifier) { this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); return this; @@ -1132,20 +1297,20 @@ public _FinalStage resourceServerIdentifier(String resourceServerIdentifier) { /** *

The identifier of the resource server that this client is linked to.

*/ - @java.lang.Override + @Override @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) public _FinalStage resourceServerIdentifier(Optional resourceServerIdentifier) { this.resourceServerIdentifier = resourceServerIdentifier; return this; } - @java.lang.Override + @Override public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { this.tokenQuota = Optional.ofNullable(tokenQuota); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) public _FinalStage tokenQuota(Optional tokenQuota) { this.tokenQuota = tokenQuota; @@ -1156,7 +1321,7 @@ public _FinalStage tokenQuota(Optional tokenQuota) { *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { if (parRequestExpiry.isNull()) { this.parRequestExpiry = OptionalNullable.ofNull(); @@ -1172,7 +1337,7 @@ public _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage parRequestExpiry(Optional parRequestExpiry) { if (parRequestExpiry.isPresent()) { this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); @@ -1186,7 +1351,7 @@ public _FinalStage parRequestExpiry(Optional parRequestExpiry) { *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage parRequestExpiry(Integer parRequestExpiry) { this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); return this; @@ -1195,14 +1360,54 @@ public _FinalStage parRequestExpiry(Integer parRequestExpiry) { /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ - @java.lang.Override + @Override @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) public _FinalStage parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { this.parRequestExpiry = parRequestExpiry; return this; } - @java.lang.Override + @Override + public _FinalStage tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + + @Override + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public _FinalStage tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @Override + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + @Override public _FinalStage complianceLevel( com.auth0.client.mgmt.core.Nullable complianceLevel) { if (complianceLevel.isNull()) { @@ -1215,7 +1420,7 @@ public _FinalStage complianceLevel( return this; } - @java.lang.Override + @Override public _FinalStage complianceLevel(Optional complianceLevel) { if (complianceLevel.isPresent()) { this.complianceLevel = OptionalNullable.of(complianceLevel.get()); @@ -1225,26 +1430,26 @@ public _FinalStage complianceLevel(Optional complianc return this; } - @java.lang.Override + @Override public _FinalStage complianceLevel(ClientComplianceLevelEnum complianceLevel) { this.complianceLevel = OptionalNullable.of(complianceLevel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) public _FinalStage complianceLevel(@Nullable OptionalNullable complianceLevel) { this.complianceLevel = complianceLevel; return this; } - @java.lang.Override + @Override public _FinalStage signedRequestObject(ClientSignedRequestObjectWithPublicKey signedRequestObject) { this.signedRequestObject = Optional.ofNullable(signedRequestObject); return this; } - @java.lang.Override + @Override @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) public _FinalStage signedRequestObject(Optional signedRequestObject) { this.signedRequestObject = signedRequestObject; @@ -1255,7 +1460,7 @@ public _FinalStage signedRequestObject(OptionalMakes the use of Proof-of-Possession mandatory for this client

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage requireProofOfPossession(Boolean requireProofOfPossession) { this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); return this; @@ -1264,7 +1469,7 @@ public _FinalStage requireProofOfPossession(Boolean requireProofOfPossession) { /** *

Makes the use of Proof-of-Possession mandatory for this client

*/ - @java.lang.Override + @Override @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) public _FinalStage requireProofOfPossession(Optional requireProofOfPossession) { this.requireProofOfPossession = requireProofOfPossession; @@ -1275,7 +1480,7 @@ public _FinalStage requireProofOfPossession(Optional requireProofOfPoss *

Makes the use of Pushed Authorization Requests mandatory for this client

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); return this; @@ -1284,20 +1489,20 @@ public _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAutho /** *

Makes the use of Pushed Authorization Requests mandatory for this client

*/ - @java.lang.Override + @Override @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) public _FinalStage requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; return this; } - @java.lang.Override + @Override public _FinalStage clientAuthenticationMethods(ClientCreateAuthenticationMethod clientAuthenticationMethods) { this.clientAuthenticationMethods = Optional.ofNullable(clientAuthenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public _FinalStage clientAuthenticationMethods( Optional clientAuthenticationMethods) { @@ -1305,14 +1510,36 @@ public _FinalStage clientAuthenticationMethods( return this; } - @java.lang.Override + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @Override + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public _FinalStage organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + @Override public _FinalStage organizationRequireBehavior( ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); return this; } - @java.lang.Override + @Override @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) public _FinalStage organizationRequireBehavior( Optional organizationRequireBehavior) { @@ -1320,20 +1547,20 @@ public _FinalStage organizationRequireBehavior( return this; } - @java.lang.Override + @Override public _FinalStage organizationUsage(ClientOrganizationUsageEnum organizationUsage) { this.organizationUsage = Optional.ofNullable(organizationUsage); return this; } - @java.lang.Override + @Override @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) public _FinalStage organizationUsage(Optional organizationUsage) { this.organizationUsage = organizationUsage; return this; } - @java.lang.Override + @Override public _FinalStage defaultOrganization( com.auth0.client.mgmt.core.Nullable defaultOrganization) { if (defaultOrganization.isNull()) { @@ -1346,7 +1573,7 @@ public _FinalStage defaultOrganization( return this; } - @java.lang.Override + @Override public _FinalStage defaultOrganization(Optional defaultOrganization) { if (defaultOrganization.isPresent()) { this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); @@ -1356,13 +1583,13 @@ public _FinalStage defaultOrganization(Optional defau return this; } - @java.lang.Override + @Override public _FinalStage defaultOrganization(ClientDefaultOrganization defaultOrganization) { this.defaultOrganization = OptionalNullable.of(defaultOrganization); return this; } - @java.lang.Override + @Override @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) public _FinalStage defaultOrganization( @Nullable OptionalNullable defaultOrganization) { @@ -1370,7 +1597,7 @@ public _FinalStage defaultOrganization( return this; } - @java.lang.Override + @Override public _FinalStage refreshToken( com.auth0.client.mgmt.core.Nullable refreshToken) { if (refreshToken.isNull()) { @@ -1383,7 +1610,7 @@ public _FinalStage refreshToken( return this; } - @java.lang.Override + @Override public _FinalStage refreshToken(Optional refreshToken) { if (refreshToken.isPresent()) { this.refreshToken = OptionalNullable.of(refreshToken.get()); @@ -1393,26 +1620,26 @@ public _FinalStage refreshToken(Optional refres return this; } - @java.lang.Override + @Override public _FinalStage refreshToken(ClientRefreshTokenConfiguration refreshToken) { this.refreshToken = OptionalNullable.of(refreshToken); return this; } - @java.lang.Override + @Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(@Nullable OptionalNullable refreshToken) { this.refreshToken = refreshToken; return this; } - @java.lang.Override + @Override public _FinalStage nativeSocialLogin(NativeSocialLogin nativeSocialLogin) { this.nativeSocialLogin = Optional.ofNullable(nativeSocialLogin); return this; } - @java.lang.Override + @Override @JsonSetter(value = "native_social_login", nulls = Nulls.SKIP) public _FinalStage nativeSocialLogin(Optional nativeSocialLogin) { this.nativeSocialLogin = nativeSocialLogin; @@ -1423,7 +1650,7 @@ public _FinalStage nativeSocialLogin(Optional nativeSocialLog *

Initiate login uri, must be https

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage initiateLoginUri(String initiateLoginUri) { this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); return this; @@ -1432,46 +1659,46 @@ public _FinalStage initiateLoginUri(String initiateLoginUri) { /** *

Initiate login uri, must be https

*/ - @java.lang.Override + @Override @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) public _FinalStage initiateLoginUri(Optional initiateLoginUri) { this.initiateLoginUri = initiateLoginUri; return this; } - @java.lang.Override + @Override public _FinalStage mobile(ClientMobile mobile) { this.mobile = Optional.ofNullable(mobile); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mobile", nulls = Nulls.SKIP) public _FinalStage mobile(Optional mobile) { this.mobile = mobile; return this; } - @java.lang.Override + @Override public _FinalStage clientMetadata(Map clientMetadata) { this.clientMetadata = Optional.ofNullable(clientMetadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public _FinalStage clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; return this; } - @java.lang.Override + @Override public _FinalStage addons(ClientAddons addons) { this.addons = Optional.ofNullable(addons); return this; } - @java.lang.Override + @Override @JsonSetter(value = "addons", nulls = Nulls.SKIP) public _FinalStage addons(Optional addons) { this.addons = addons; @@ -1482,7 +1709,7 @@ public _FinalStage addons(Optional addons) { *

HTML form template to be used for WS-Federation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage formTemplate(String formTemplate) { this.formTemplate = Optional.ofNullable(formTemplate); return this; @@ -1491,7 +1718,7 @@ public _FinalStage formTemplate(String formTemplate) { /** *

HTML form template to be used for WS-Federation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "form_template", nulls = Nulls.SKIP) public _FinalStage formTemplate(Optional formTemplate) { this.formTemplate = formTemplate; @@ -1502,7 +1729,7 @@ public _FinalStage formTemplate(Optional formTemplate) { *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customLoginPagePreview(String customLoginPagePreview) { this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); return this; @@ -1511,7 +1738,7 @@ public _FinalStage customLoginPagePreview(String customLoginPagePreview) { /** *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) public _FinalStage customLoginPagePreview(Optional customLoginPagePreview) { this.customLoginPagePreview = customLoginPagePreview; @@ -1522,7 +1749,7 @@ public _FinalStage customLoginPagePreview(Optional customLoginPagePrevie *

The content (HTML, CSS, JS) of the custom login page.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customLoginPage(String customLoginPage) { this.customLoginPage = Optional.ofNullable(customLoginPage); return this; @@ -1531,7 +1758,7 @@ public _FinalStage customLoginPage(String customLoginPage) { /** *

The content (HTML, CSS, JS) of the custom login page.

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) public _FinalStage customLoginPage(Optional customLoginPage) { this.customLoginPage = customLoginPage; @@ -1542,7 +1769,7 @@ public _FinalStage customLoginPage(Optional customLoginPage) { *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customLoginPageOn(Boolean customLoginPageOn) { this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); return this; @@ -1551,7 +1778,7 @@ public _FinalStage customLoginPageOn(Boolean customLoginPageOn) { /** *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) public _FinalStage customLoginPageOn(Optional customLoginPageOn) { this.customLoginPageOn = customLoginPageOn; @@ -1562,7 +1789,7 @@ public _FinalStage customLoginPageOn(Optional customLoginPageOn) { *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage ssoDisabled(Boolean ssoDisabled) { this.ssoDisabled = Optional.ofNullable(ssoDisabled); return this; @@ -1571,7 +1798,7 @@ public _FinalStage ssoDisabled(Boolean ssoDisabled) { /** *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

*/ - @java.lang.Override + @Override @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) public _FinalStage ssoDisabled(Optional ssoDisabled) { this.ssoDisabled = ssoDisabled; @@ -1582,7 +1809,7 @@ public _FinalStage ssoDisabled(Optional ssoDisabled) { *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage crossOriginLoc(String crossOriginLoc) { this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); return this; @@ -1591,7 +1818,7 @@ public _FinalStage crossOriginLoc(String crossOriginLoc) { /** *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

*/ - @java.lang.Override + @Override @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) public _FinalStage crossOriginLoc(Optional crossOriginLoc) { this.crossOriginLoc = crossOriginLoc; @@ -1602,7 +1829,7 @@ public _FinalStage crossOriginLoc(Optional crossOriginLoc) { *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication) { this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); return this; @@ -1611,7 +1838,7 @@ public _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication) /** *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) public _FinalStage crossOriginAuthentication(Optional crossOriginAuthentication) { this.crossOriginAuthentication = crossOriginAuthentication; @@ -1622,7 +1849,7 @@ public _FinalStage crossOriginAuthentication(Optional crossOriginAuthen *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage sso(Boolean sso) { this.sso = Optional.ofNullable(sso); return this; @@ -1631,14 +1858,14 @@ public _FinalStage sso(Boolean sso) { /** *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "sso", nulls = Nulls.SKIP) public _FinalStage sso(Optional sso) { this.sso = sso; return this; } - @java.lang.Override + @Override public _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { if (encryptionKey.isNull()) { this.encryptionKey = OptionalNullable.ofNull(); @@ -1650,7 +1877,7 @@ public _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { if (encryptionKey.isPresent()) { this.encryptionKey = OptionalNullable.of(encryptionKey.get()); @@ -1660,26 +1887,26 @@ public _FinalStage encryptionKey(Optional encryptionKey) { return this; } - @java.lang.Override + @Override public _FinalStage encryptionKey(ClientEncryptionKey encryptionKey) { this.encryptionKey = OptionalNullable.of(encryptionKey); return this; } - @java.lang.Override + @Override @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) public _FinalStage encryptionKey(@Nullable OptionalNullable encryptionKey) { this.encryptionKey = encryptionKey; return this; } - @java.lang.Override + @Override public _FinalStage jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) public _FinalStage jwtConfiguration(Optional jwtConfiguration) { this.jwtConfiguration = jwtConfiguration; @@ -1690,7 +1917,7 @@ public _FinalStage jwtConfiguration(Optional jwtConfigur *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage oidcConformant(Boolean oidcConformant) { this.oidcConformant = Optional.ofNullable(oidcConformant); return this; @@ -1699,7 +1926,7 @@ public _FinalStage oidcConformant(Boolean oidcConformant) { /** *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) public _FinalStage oidcConformant(Optional oidcConformant) { this.oidcConformant = oidcConformant; @@ -1710,7 +1937,7 @@ public _FinalStage oidcConformant(Optional oidcConformant) { *

Whether this client a first party client or not

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isFirstParty(Boolean isFirstParty) { this.isFirstParty = Optional.ofNullable(isFirstParty); return this; @@ -1719,33 +1946,53 @@ public _FinalStage isFirstParty(Boolean isFirstParty) { /** *

Whether this client a first party client or not

*/ - @java.lang.Override + @Override @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) public _FinalStage isFirstParty(Optional isFirstParty) { this.isFirstParty = isFirstParty; return this; } - @java.lang.Override + @Override public _FinalStage appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "app_type", nulls = Nulls.SKIP) public _FinalStage appType(Optional appType) { this.appType = appType; return this; } - @java.lang.Override + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @Override + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public _FinalStage isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + @Override public _FinalStage tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethod( Optional tokenEndpointAuthMethod) { @@ -1754,19 +2001,19 @@ public _FinalStage tokenEndpointAuthMethod( } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage grantTypes(List grantTypes) { this.grantTypes = Optional.ofNullable(grantTypes); return this; } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ - @java.lang.Override + @Override @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public _FinalStage grantTypes(Optional> grantTypes) { this.grantTypes = grantTypes; @@ -1777,7 +2024,7 @@ public _FinalStage grantTypes(Optional> grantTypes) { *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowedLogoutUrls(List allowedLogoutUrls) { this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); return this; @@ -1786,7 +2033,7 @@ public _FinalStage allowedLogoutUrls(List allowedLogoutUrls) { /** *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

*/ - @java.lang.Override + @Override @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) public _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls) { this.allowedLogoutUrls = allowedLogoutUrls; @@ -1797,7 +2044,7 @@ public _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls) { *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowedClients(List allowedClients) { this.allowedClients = Optional.ofNullable(allowedClients); return this; @@ -1806,7 +2053,7 @@ public _FinalStage allowedClients(List allowedClients) { /** *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

*/ - @java.lang.Override + @Override @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) public _FinalStage allowedClients(Optional> allowedClients) { this.allowedClients = allowedClients; @@ -1817,7 +2064,7 @@ public _FinalStage allowedClients(Optional> allowedClients) { *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage clientAliases(List clientAliases) { this.clientAliases = Optional.ofNullable(clientAliases); return this; @@ -1826,7 +2073,7 @@ public _FinalStage clientAliases(List clientAliases) { /** *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

*/ - @java.lang.Override + @Override @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) public _FinalStage clientAliases(Optional> clientAliases) { this.clientAliases = clientAliases; @@ -1837,7 +2084,7 @@ public _FinalStage clientAliases(Optional> clientAliases) { *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage webOrigins(List webOrigins) { this.webOrigins = Optional.ofNullable(webOrigins); return this; @@ -1846,7 +2093,7 @@ public _FinalStage webOrigins(List webOrigins) { /** *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

*/ - @java.lang.Override + @Override @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) public _FinalStage webOrigins(Optional> webOrigins) { this.webOrigins = webOrigins; @@ -1857,7 +2104,7 @@ public _FinalStage webOrigins(Optional> webOrigins) { *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowedOrigins(List allowedOrigins) { this.allowedOrigins = Optional.ofNullable(allowedOrigins); return this; @@ -1866,14 +2113,14 @@ public _FinalStage allowedOrigins(List allowedOrigins) { /** *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

*/ - @java.lang.Override + @Override @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) public _FinalStage allowedOrigins(Optional> allowedOrigins) { this.allowedOrigins = allowedOrigins; return this; } - @java.lang.Override + @Override public _FinalStage sessionTransfer( com.auth0.client.mgmt.core.Nullable sessionTransfer) { if (sessionTransfer.isNull()) { @@ -1886,7 +2133,7 @@ public _FinalStage sessionTransfer( return this; } - @java.lang.Override + @Override public _FinalStage sessionTransfer(Optional sessionTransfer) { if (sessionTransfer.isPresent()) { this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); @@ -1896,13 +2143,13 @@ public _FinalStage sessionTransfer(Optional return this; } - @java.lang.Override + @Override public _FinalStage sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { this.sessionTransfer = OptionalNullable.of(sessionTransfer); return this; } - @java.lang.Override + @Override @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) public _FinalStage sessionTransfer( @Nullable OptionalNullable sessionTransfer) { @@ -1910,26 +2157,26 @@ public _FinalStage sessionTransfer( return this; } - @java.lang.Override + @Override public _FinalStage oidcBackchannelLogout(ClientOidcBackchannelLogoutSettings oidcBackchannelLogout) { this.oidcBackchannelLogout = Optional.ofNullable(oidcBackchannelLogout); return this; } - @java.lang.Override + @Override @JsonSetter(value = "oidc_backchannel_logout", nulls = Nulls.SKIP) public _FinalStage oidcBackchannelLogout(Optional oidcBackchannelLogout) { this.oidcBackchannelLogout = oidcBackchannelLogout; return this; } - @java.lang.Override + @Override public _FinalStage oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { this.oidcLogout = Optional.ofNullable(oidcLogout); return this; } - @java.lang.Override + @Override @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) public _FinalStage oidcLogout(Optional oidcLogout) { this.oidcLogout = oidcLogout; @@ -1940,7 +2187,7 @@ public _FinalStage oidcLogout(Optional oidc *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage callbacks(List callbacks) { this.callbacks = Optional.ofNullable(callbacks); return this; @@ -1949,7 +2196,7 @@ public _FinalStage callbacks(List callbacks) { /** *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

*/ - @java.lang.Override + @Override @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) public _FinalStage callbacks(Optional> callbacks) { this.callbacks = callbacks; @@ -1960,7 +2207,7 @@ public _FinalStage callbacks(Optional> callbacks) { *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage logoUri(String logoUri) { this.logoUri = Optional.ofNullable(logoUri); return this; @@ -1969,7 +2216,7 @@ public _FinalStage logoUri(String logoUri) { /** *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

*/ - @java.lang.Override + @Override @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) public _FinalStage logoUri(Optional logoUri) { this.logoUri = logoUri; @@ -1980,7 +2227,7 @@ public _FinalStage logoUri(Optional logoUri) { *

Free text description of this client (max length: 140 characters).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -1989,14 +2236,14 @@ public _FinalStage description(String description) { /** *

Free text description of this client (max length: 140 characters).

*/ - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public CreateClientRequestContent build() { return new CreateClientRequestContent( name, @@ -2013,6 +2260,7 @@ public CreateClientRequestContent build() { allowedLogoutUrls, grantTypes, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, appType, isFirstParty, oidcConformant, @@ -2035,14 +2283,19 @@ public CreateClientRequestContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, resourceServerIdentifier, + expressConfiguration, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java index 3a29b128b..61900ae0f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java @@ -36,7 +36,7 @@ public final class CreateClientResponseContent { private final Optional clientSecret; - private final Optional appType; + private final Optional appType; private final Optional logoUri; @@ -88,6 +88,8 @@ public final class CreateClientResponseContent { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional> clientMetadata; private final Optional mobile; @@ -102,6 +104,8 @@ public final class CreateClientResponseContent { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -112,10 +116,20 @@ public final class CreateClientResponseContent { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; + private final Optional expressConfiguration; + + private final Optional resourceServerIdentifier; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private CreateClientResponseContent( @@ -125,7 +139,7 @@ private CreateClientResponseContent( Optional description, Optional global, Optional clientSecret, - Optional appType, + Optional appType, Optional logoUri, Optional isFirstParty, Optional oidcConformant, @@ -151,6 +165,7 @@ private CreateClientResponseContent( Optional formTemplate, Optional addons, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional> clientMetadata, Optional mobile, Optional initiateLoginUri, @@ -158,13 +173,19 @@ private CreateClientResponseContent( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, + Optional expressConfiguration, + Optional resourceServerIdentifier, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.clientId = clientId; this.tenant = tenant; @@ -198,6 +219,7 @@ private CreateClientResponseContent( this.formTemplate = formTemplate; this.addons = addons; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.clientMetadata = clientMetadata; this.mobile = mobile; this.initiateLoginUri = initiateLoginUri; @@ -205,13 +227,19 @@ private CreateClientResponseContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; + this.expressConfiguration = expressConfiguration; + this.resourceServerIdentifier = resourceServerIdentifier; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -263,11 +291,8 @@ public Optional getClientSecret() { return clientSecret; } - /** - * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. - */ @JsonProperty("app_type") - public Optional getAppType() { + public Optional getAppType() { return appType; } @@ -358,7 +383,7 @@ public Optional getOidcLogout() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -458,6 +483,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("client_metadata") public Optional> getClientMetadata() { return clientMetadata; @@ -504,6 +537,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -543,6 +584,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -560,6 +616,24 @@ public Optional getTokenQuota() { return tokenQuota; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -602,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientResponseContent && equalTo((CreateClientResponseContent) other); @@ -646,6 +720,7 @@ private boolean equalTo(CreateClientResponseContent other) { && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && clientMetadata.equals(other.clientMetadata) && mobile.equals(other.mobile) && initiateLoginUri.equals(other.initiateLoginUri) @@ -653,16 +728,23 @@ private boolean equalTo(CreateClientResponseContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) - && tokenQuota.equals(other.tokenQuota); + && tokenQuota.equals(other.tokenQuota) + && expressConfiguration.equals(other.expressConfiguration) + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientId, @@ -697,6 +779,7 @@ public int hashCode() { this.formTemplate, this.addons, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.clientMetadata, this.mobile, this.initiateLoginUri, @@ -704,16 +787,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, - this.tokenQuota); + this.tokenQuota, + this.expressConfiguration, + this.resourceServerIdentifier, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -736,7 +825,7 @@ public static final class Builder { private Optional clientSecret = Optional.empty(); - private Optional appType = Optional.empty(); + private Optional appType = Optional.empty(); private Optional logoUri = Optional.empty(); @@ -788,6 +877,8 @@ public static final class Builder { private Optional tokenEndpointAuthMethod = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional> clientMetadata = Optional.empty(); private Optional mobile = Optional.empty(); @@ -802,6 +893,8 @@ public static final class Builder { private Optional organizationRequireBehavior = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -812,10 +905,21 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + + private Optional tokenExchange = Optional.empty(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); private Optional tokenQuota = Optional.empty(); + private Optional expressConfiguration = Optional.empty(); + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -854,6 +958,7 @@ public Builder from(CreateClientResponseContent other) { formTemplate(other.getFormTemplate()); addons(other.getAddons()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); clientMetadata(other.getClientMetadata()); mobile(other.getMobile()); initiateLoginUri(other.getInitiateLoginUri()); @@ -861,13 +966,19 @@ public Builder from(CreateClientResponseContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); + expressConfiguration(other.getExpressConfiguration()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -955,16 +1066,13 @@ public Builder clientSecret(String clientSecret) { return this; } - /** - *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

- */ @JsonSetter(value = "app_type", nulls = Nulls.SKIP) - public Builder appType(Optional appType) { + public Builder appType(Optional appType) { this.appType = appType; return this; } - public Builder appType(String appType) { + public Builder appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } @@ -1139,7 +1247,7 @@ public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1339,6 +1447,20 @@ public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEn return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public Builder clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; @@ -1461,6 +1583,22 @@ public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1564,6 +1702,36 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1609,6 +1777,44 @@ public Builder tokenQuota(TokenQuota tokenQuota) { return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public CreateClientResponseContent build() { return new CreateClientResponseContent( clientId, @@ -1643,6 +1849,7 @@ public CreateClientResponseContent build() { formTemplate, addons, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, clientMetadata, mobile, initiateLoginUri, @@ -1650,13 +1857,19 @@ public CreateClientResponseContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, + expressConfiguration, + resourceServerIdentifier, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java new file mode 100644 index 000000000..9526f7b70 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionCommon.Builder.class) +public final class CreateConnectionCommon implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Map additionalProperties; + + private CreateConnectionCommon( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionCommon && equalTo((CreateConnectionCommon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionCommon other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionCommon other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + public CreateConnectionCommon build() { + return new CreateConnectionCommon( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java new file mode 100644 index 000000000..1b774409c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionProfileRequestContent.Builder.class) +public final class CreateConnectionProfileRequestContent { + private final String name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private CreateConnectionProfileRequestContent( + String name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionProfileRequestContent + && equalTo((CreateConnectionProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionProfileRequestContent other) { + return name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(CreateConnectionProfileRequestContent other); + } + + public interface _FinalStage { + CreateConnectionProfileRequestContent build(); + + _FinalStage organization(Optional organization); + + _FinalStage organization(ConnectionProfileOrganization organization); + + _FinalStage connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate); + + _FinalStage connectionNamePrefixTemplate(String connectionNamePrefixTemplate); + + _FinalStage enabledFeatures(Optional> enabledFeatures); + + _FinalStage enabledFeatures(List enabledFeatures); + + _FinalStage connectionConfig(Optional connectionConfig); + + _FinalStage connectionConfig(ConnectionProfileConfig connectionConfig); + + _FinalStage strategyOverrides(Optional strategyOverrides); + + _FinalStage strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional strategyOverrides = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional organization = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateConnectionProfileRequestContent other) { + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + public _FinalStage strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + @Override + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public _FinalStage strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + @Override + public _FinalStage connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @Override + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public _FinalStage connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + @Override + public _FinalStage enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @Override + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public _FinalStage enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + @Override + public _FinalStage connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @Override + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public _FinalStage connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + @Override + public _FinalStage organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @Override + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public _FinalStage organization(Optional organization) { + this.organization = organization; + return this; + } + + @Override + public CreateConnectionProfileRequestContent build() { + return new CreateConnectionProfileRequestContent( + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java new file mode 100644 index 000000000..22695f969 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java @@ -0,0 +1,258 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionProfileResponseContent.Builder.class) +public final class CreateConnectionProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private CreateConnectionProfileResponseContent( + Optional id, + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.id = id; + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionProfileResponseContent + && equalTo((CreateConnectionProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public CreateConnectionProfileResponseContent build() { + return new CreateConnectionProfileResponseContent( + id, + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java index 26348d2ce..e40dac446 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -38,7 +39,11 @@ public final class CreateConnectionRequestContent { private final Optional> realms; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -51,7 +56,9 @@ private CreateConnectionRequestContent( Optional isDomainConnection, Optional showAsButton, Optional> realms, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.name = name; this.displayName = displayName; @@ -62,6 +69,8 @@ private CreateConnectionRequestContent( this.showAsButton = showAsButton; this.realms = realms; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -124,11 +133,21 @@ public Optional> getRealms() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } - @java.lang.Override + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContent && equalTo((CreateConnectionRequestContent) other); @@ -148,10 +167,12 @@ private boolean equalTo(CreateConnectionRequestContent other) { && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) && realms.equals(other.realms) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -162,10 +183,12 @@ public int hashCode() { this.isDomainConnection, this.showAsButton, this.realms, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -229,9 +252,17 @@ public interface _FinalStage { _FinalStage realms(List realms); - _FinalStage metadata(Optional> metadata); + _FinalStage metadata(Optional>> metadata); - _FinalStage metadata(Map metadata); + _FinalStage metadata(Map> metadata); + + _FinalStage authentication(Optional authentication); + + _FinalStage authentication(ConnectionAuthenticationPurpose authentication); + + _FinalStage connectedAccounts(Optional connectedAccounts); + + _FinalStage connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -240,7 +271,11 @@ public static final class Builder implements NameStage, StrategyStage, _FinalSta private ConnectionIdentityProviderEnum strategy; - private Optional> metadata = Optional.empty(); + private Optional connectedAccounts = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional>> metadata = Optional.empty(); private Optional> realms = Optional.empty(); @@ -259,7 +294,7 @@ public static final class Builder implements NameStage, StrategyStage, _FinalSta private Builder() {} - @java.lang.Override + @Override public Builder from(CreateConnectionRequestContent other) { name(other.getName()); displayName(other.getDisplayName()); @@ -270,6 +305,8 @@ public Builder from(CreateConnectionRequestContent other) { showAsButton(other.getShowAsButton()); realms(other.getRealms()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -278,29 +315,55 @@ public Builder from(CreateConnectionRequestContent other) { *

The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public StrategyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("strategy") public _FinalStage strategy(@NotNull ConnectionIdentityProviderEnum strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); return this; } - @java.lang.Override - public _FinalStage metadata(Map metadata) { + @Override + public _FinalStage connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @Override + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public _FinalStage connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + @Override + public _FinalStage authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @Override + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public _FinalStage authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + @Override + public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional> metadata) { + public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; return this; } @@ -309,7 +372,7 @@ public _FinalStage metadata(Optional> metadata) { *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage realms(List realms) { this.realms = Optional.ofNullable(realms); return this; @@ -318,7 +381,7 @@ public _FinalStage realms(List realms) { /** *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

*/ - @java.lang.Override + @Override @JsonSetter(value = "realms", nulls = Nulls.SKIP) public _FinalStage realms(Optional> realms) { this.realms = realms; @@ -329,7 +392,7 @@ public _FinalStage realms(Optional> realms) { *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -338,7 +401,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

*/ - @java.lang.Override + @Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -349,7 +412,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isDomainConnection(Boolean isDomainConnection) { this.isDomainConnection = Optional.ofNullable(isDomainConnection); return this; @@ -358,7 +421,7 @@ public _FinalStage isDomainConnection(Boolean isDomainConnection) { /** *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

*/ - @java.lang.Override + @Override @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) public _FinalStage isDomainConnection(Optional isDomainConnection) { this.isDomainConnection = isDomainConnection; @@ -369,7 +432,7 @@ public _FinalStage isDomainConnection(Optional isDomainConnection) { *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabledClients(List enabledClients) { this.enabledClients = Optional.ofNullable(enabledClients); return this; @@ -378,20 +441,20 @@ public _FinalStage enabledClients(List enabledClients) { /** *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) public _FinalStage enabledClients(Optional> enabledClients) { this.enabledClients = enabledClients; return this; } - @java.lang.Override + @Override public _FinalStage options(ConnectionPropertiesOptions options) { this.options = Optional.ofNullable(options); return this; } - @java.lang.Override + @Override @JsonSetter(value = "options", nulls = Nulls.SKIP) public _FinalStage options(Optional options) { this.options = options; @@ -402,7 +465,7 @@ public _FinalStage options(Optional options) { *

Connection name used in the new universal login experience

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -411,14 +474,14 @@ public _FinalStage displayName(String displayName) { /** *

Connection name used in the new universal login experience

*/ - @java.lang.Override + @Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public CreateConnectionRequestContent build() { return new CreateConnectionRequestContent( name, @@ -430,6 +493,8 @@ public CreateConnectionRequestContent build() { showAsButton, realms, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java new file mode 100644 index 000000000..a8b3bf381 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAd.Builder.class) +public final class CreateConnectionRequestContentAd implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAd( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "ad"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAd && equalTo((CreateConnectionRequestContentAd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAd other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAd other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAd build() { + return new CreateConnectionRequestContentAd( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java new file mode 100644 index 000000000..ec2853823 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAdfs.Builder.class) +public final class CreateConnectionRequestContentAdfs implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAdfs( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "adfs"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAdfs + && equalTo((CreateConnectionRequestContentAdfs) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAdfs other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAdfs other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAdfs build() { + return new CreateConnectionRequestContentAdfs( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java new file mode 100644 index 000000000..46a7132d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAmazon.Builder.class) +public final class CreateConnectionRequestContentAmazon implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAmazon( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "amazon"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAmazon + && equalTo((CreateConnectionRequestContentAmazon) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAmazon other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAmazon other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAmazon build() { + return new CreateConnectionRequestContentAmazon( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java new file mode 100644 index 000000000..4fb0dff68 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAol.Builder.class) +public final class CreateConnectionRequestContentAol implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAol( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "aol"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAol && equalTo((CreateConnectionRequestContentAol) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAol other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAol other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAol build() { + return new CreateConnectionRequestContentAol( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java new file mode 100644 index 000000000..e80a7c088 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentApple.Builder.class) +public final class CreateConnectionRequestContentApple implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentApple( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "apple"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentApple + && equalTo((CreateConnectionRequestContentApple) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentApple other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentApple other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsApple options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentApple build() { + return new CreateConnectionRequestContentApple( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java new file mode 100644 index 000000000..bd19cfe55 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAuth0.Builder.class) +public final class CreateConnectionRequestContentAuth0 implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAuth0( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "auth0"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAuth0 + && equalTo((CreateConnectionRequestContentAuth0) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAuth0 other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAuth0 other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsAuth0 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAuth0 build() { + return new CreateConnectionRequestContentAuth0( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java new file mode 100644 index 000000000..0a4c0b79d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAuth0Oidc.Builder.class) +public final class CreateConnectionRequestContentAuth0Oidc implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAuth0Oidc( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "auth0-oidc"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAuth0Oidc + && equalTo((CreateConnectionRequestContentAuth0Oidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAuth0Oidc other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAuth0Oidc other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentAuth0Oidc build() { + return new CreateConnectionRequestContentAuth0Oidc( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java new file mode 100644 index 000000000..88d6c51e5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java @@ -0,0 +1,403 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentAzureAd.Builder.class) +public final class CreateConnectionRequestContentAzureAd implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Optional provisioningTicket; + + private final Optional provisioningTicketUrl; + + private final Map additionalProperties; + + private CreateConnectionRequestContentAzureAd( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Optional provisioningTicket, + Optional provisioningTicketUrl, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.provisioningTicket = provisioningTicket; + this.provisioningTicketUrl = provisioningTicketUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "waad"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @JsonProperty("provisioning_ticket") + public Optional getProvisioningTicket() { + return provisioningTicket; + } + + @JsonProperty("provisioning_ticket_url") + public Optional getProvisioningTicketUrl() { + return provisioningTicketUrl; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentAzureAd + && equalTo((CreateConnectionRequestContentAzureAd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentAzureAd other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options) + && provisioningTicket.equals(other.provisioningTicket) + && provisioningTicketUrl.equals(other.provisioningTicketUrl); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options, + this.provisioningTicket, + this.provisioningTicketUrl); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + private Optional provisioningTicket = Optional.empty(); + + private Optional provisioningTicketUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentAzureAd other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + provisioningTicket(other.getProvisioningTicket()); + provisioningTicketUrl(other.getProvisioningTicketUrl()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsAzureAd options) { + this.options = Optional.ofNullable(options); + return this; + } + + @JsonSetter(value = "provisioning_ticket", nulls = Nulls.SKIP) + public Builder provisioningTicket(Optional provisioningTicket) { + this.provisioningTicket = provisioningTicket; + return this; + } + + public Builder provisioningTicket(String provisioningTicket) { + this.provisioningTicket = Optional.ofNullable(provisioningTicket); + return this; + } + + @JsonSetter(value = "provisioning_ticket_url", nulls = Nulls.SKIP) + public Builder provisioningTicketUrl(Optional provisioningTicketUrl) { + this.provisioningTicketUrl = provisioningTicketUrl; + return this; + } + + public Builder provisioningTicketUrl(String provisioningTicketUrl) { + this.provisioningTicketUrl = Optional.ofNullable(provisioningTicketUrl); + return this; + } + + public CreateConnectionRequestContentAzureAd build() { + return new CreateConnectionRequestContentAzureAd( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + provisioningTicket, + provisioningTicketUrl, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java new file mode 100644 index 000000000..b5342e314 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentBaidu.Builder.class) +public final class CreateConnectionRequestContentBaidu implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentBaidu( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "baidu"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentBaidu + && equalTo((CreateConnectionRequestContentBaidu) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentBaidu other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentBaidu other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentBaidu build() { + return new CreateConnectionRequestContentBaidu( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java new file mode 100644 index 000000000..8342c510d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentBitbucket.Builder.class) +public final class CreateConnectionRequestContentBitbucket implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentBitbucket( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "bitbucket"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentBitbucket + && equalTo((CreateConnectionRequestContentBitbucket) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentBitbucket other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentBitbucket other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentBitbucket build() { + return new CreateConnectionRequestContentBitbucket( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java new file mode 100644 index 000000000..aa6999788 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentBitly.Builder.class) +public final class CreateConnectionRequestContentBitly implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentBitly( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "bitly"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentBitly + && equalTo((CreateConnectionRequestContentBitly) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentBitly other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentBitly other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentBitly build() { + return new CreateConnectionRequestContentBitly( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java new file mode 100644 index 000000000..5e278f880 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentBox.Builder.class) +public final class CreateConnectionRequestContentBox implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentBox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "box"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentBox && equalTo((CreateConnectionRequestContentBox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentBox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentBox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentBox build() { + return new CreateConnectionRequestContentBox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java new file mode 100644 index 000000000..48f4b05cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentCustom.Builder.class) +public final class CreateConnectionRequestContentCustom implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentCustom( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "custom"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentCustom + && equalTo((CreateConnectionRequestContentCustom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentCustom other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentCustom other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentCustom build() { + return new CreateConnectionRequestContentCustom( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java new file mode 100644 index 000000000..f03a24dac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentDaccount.Builder.class) +public final class CreateConnectionRequestContentDaccount implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentDaccount( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "daccount"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentDaccount + && equalTo((CreateConnectionRequestContentDaccount) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentDaccount other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentDaccount other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentDaccount build() { + return new CreateConnectionRequestContentDaccount( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java new file mode 100644 index 000000000..57e0a11c3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentDropbox.Builder.class) +public final class CreateConnectionRequestContentDropbox implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentDropbox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "dropbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentDropbox + && equalTo((CreateConnectionRequestContentDropbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentDropbox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentDropbox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentDropbox build() { + return new CreateConnectionRequestContentDropbox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java new file mode 100644 index 000000000..293370a0f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentDwolla.Builder.class) +public final class CreateConnectionRequestContentDwolla implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentDwolla( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "dwolla"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentDwolla + && equalTo((CreateConnectionRequestContentDwolla) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentDwolla other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentDwolla other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentDwolla build() { + return new CreateConnectionRequestContentDwolla( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java new file mode 100644 index 000000000..5e1f40ae1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentEmail.Builder.class) +public final class CreateConnectionRequestContentEmail implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentEmail( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "email"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentEmail + && equalTo((CreateConnectionRequestContentEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentEmail other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentEmail other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentEmail build() { + return new CreateConnectionRequestContentEmail( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java new file mode 100644 index 000000000..669e1d59d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentEvernote.Builder.class) +public final class CreateConnectionRequestContentEvernote implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentEvernote( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "evernote"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentEvernote + && equalTo((CreateConnectionRequestContentEvernote) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentEvernote other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentEvernote other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentEvernote build() { + return new CreateConnectionRequestContentEvernote( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java new file mode 100644 index 000000000..5383c9005 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentEvernoteSandbox.Builder.class) +public final class CreateConnectionRequestContentEvernoteSandbox implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentEvernoteSandbox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "evernote-sandbox"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentEvernoteSandbox + && equalTo((CreateConnectionRequestContentEvernoteSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentEvernoteSandbox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentEvernoteSandbox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentEvernoteSandbox build() { + return new CreateConnectionRequestContentEvernoteSandbox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java new file mode 100644 index 000000000..3abe3835a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentExact.Builder.class) +public final class CreateConnectionRequestContentExact implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentExact( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "exact"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentExact + && equalTo((CreateConnectionRequestContentExact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentExact other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentExact other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentExact build() { + return new CreateConnectionRequestContentExact( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java new file mode 100644 index 000000000..d375b3836 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentFacebook.Builder.class) +public final class CreateConnectionRequestContentFacebook implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentFacebook( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "facebook"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentFacebook + && equalTo((CreateConnectionRequestContentFacebook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentFacebook other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentFacebook other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentFacebook build() { + return new CreateConnectionRequestContentFacebook( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java new file mode 100644 index 000000000..fb82479d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentFitbit.Builder.class) +public final class CreateConnectionRequestContentFitbit implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentFitbit( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "fitbit"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentFitbit + && equalTo((CreateConnectionRequestContentFitbit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentFitbit other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentFitbit other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentFitbit build() { + return new CreateConnectionRequestContentFitbit( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java new file mode 100644 index 000000000..327108b97 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentFlickr.Builder.class) +public final class CreateConnectionRequestContentFlickr implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentFlickr( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "flickr"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentFlickr + && equalTo((CreateConnectionRequestContentFlickr) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentFlickr other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentFlickr other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentFlickr build() { + return new CreateConnectionRequestContentFlickr( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java new file mode 100644 index 000000000..2602a3803 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentGitHub.Builder.class) +public final class CreateConnectionRequestContentGitHub implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentGitHub( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "github"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentGitHub + && equalTo((CreateConnectionRequestContentGitHub) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentGitHub other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentGitHub other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentGitHub build() { + return new CreateConnectionRequestContentGitHub( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java new file mode 100644 index 000000000..9aca2832d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentGoogleApps.Builder.class) +public final class CreateConnectionRequestContentGoogleApps implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentGoogleApps( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "google-apps"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentGoogleApps + && equalTo((CreateConnectionRequestContentGoogleApps) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentGoogleApps other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentGoogleApps other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentGoogleApps build() { + return new CreateConnectionRequestContentGoogleApps( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java new file mode 100644 index 000000000..e2f71ab05 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentGoogleOAuth2.Builder.class) +public final class CreateConnectionRequestContentGoogleOAuth2 implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentGoogleOAuth2( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "google-oauth2"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentGoogleOAuth2 + && equalTo((CreateConnectionRequestContentGoogleOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentGoogleOAuth2 other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentGoogleOAuth2 other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsGoogleOAuth2 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentGoogleOAuth2 build() { + return new CreateConnectionRequestContentGoogleOAuth2( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java new file mode 100644 index 000000000..45b4c43b3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentInstagram.Builder.class) +public final class CreateConnectionRequestContentInstagram implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentInstagram( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "instagram"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentInstagram + && equalTo((CreateConnectionRequestContentInstagram) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentInstagram other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentInstagram other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentInstagram build() { + return new CreateConnectionRequestContentInstagram( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java new file mode 100644 index 000000000..b9247d0bc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentIp.Builder.class) +public final class CreateConnectionRequestContentIp implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentIp( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "ip"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentIp && equalTo((CreateConnectionRequestContentIp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentIp other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentIp other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentIp build() { + return new CreateConnectionRequestContentIp( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java new file mode 100644 index 000000000..20c080a80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentLine.Builder.class) +public final class CreateConnectionRequestContentLine implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentLine( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "line"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentLine + && equalTo((CreateConnectionRequestContentLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentLine other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentLine other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentLine build() { + return new CreateConnectionRequestContentLine( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java new file mode 100644 index 000000000..96e918334 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentLinkedin.Builder.class) +public final class CreateConnectionRequestContentLinkedin implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentLinkedin( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "linkedin"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentLinkedin + && equalTo((CreateConnectionRequestContentLinkedin) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentLinkedin other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentLinkedin other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentLinkedin build() { + return new CreateConnectionRequestContentLinkedin( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java new file mode 100644 index 000000000..83e471fbd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentMiicard.Builder.class) +public final class CreateConnectionRequestContentMiicard implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentMiicard( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "miicard"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentMiicard + && equalTo((CreateConnectionRequestContentMiicard) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentMiicard other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentMiicard other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentMiicard build() { + return new CreateConnectionRequestContentMiicard( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java new file mode 100644 index 000000000..a543cb6d5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentOAuth1.Builder.class) +public final class CreateConnectionRequestContentOAuth1 implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentOAuth1( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oauth1"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentOAuth1 + && equalTo((CreateConnectionRequestContentOAuth1) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentOAuth1 other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentOAuth1 other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentOAuth1 build() { + return new CreateConnectionRequestContentOAuth1( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java new file mode 100644 index 000000000..78aeafb55 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentOAuth2.Builder.class) +public final class CreateConnectionRequestContentOAuth2 implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentOAuth2( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oauth2"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentOAuth2 + && equalTo((CreateConnectionRequestContentOAuth2) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentOAuth2 other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentOAuth2 other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2 options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentOAuth2 build() { + return new CreateConnectionRequestContentOAuth2( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java new file mode 100644 index 000000000..93c99a6bb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentOffice365.Builder.class) +public final class CreateConnectionRequestContentOffice365 implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentOffice365( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "office365"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentOffice365 + && equalTo((CreateConnectionRequestContentOffice365) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentOffice365 other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentOffice365 other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentOffice365 build() { + return new CreateConnectionRequestContentOffice365( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java new file mode 100644 index 000000000..5a8bb61b8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentOidc.Builder.class) +public final class CreateConnectionRequestContentOidc implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentOidc( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "oidc"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentOidc + && equalTo((CreateConnectionRequestContentOidc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentOidc other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentOidc other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOidc options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentOidc build() { + return new CreateConnectionRequestContentOidc( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java new file mode 100644 index 000000000..d9642aaed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentOkta.Builder.class) +public final class CreateConnectionRequestContentOkta implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentOkta( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "okta"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentOkta + && equalTo((CreateConnectionRequestContentOkta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentOkta other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentOkta other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOkta options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentOkta build() { + return new CreateConnectionRequestContentOkta( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java new file mode 100644 index 000000000..951b91a9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentPaypal.Builder.class) +public final class CreateConnectionRequestContentPaypal implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentPaypal( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "paypal"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentPaypal + && equalTo((CreateConnectionRequestContentPaypal) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentPaypal other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentPaypal other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentPaypal build() { + return new CreateConnectionRequestContentPaypal( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java new file mode 100644 index 000000000..3f45a914a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentPaypalSandbox.Builder.class) +public final class CreateConnectionRequestContentPaypalSandbox implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentPaypalSandbox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "paypal-sandbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentPaypalSandbox + && equalTo((CreateConnectionRequestContentPaypalSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentPaypalSandbox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentPaypalSandbox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentPaypalSandbox build() { + return new CreateConnectionRequestContentPaypalSandbox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java new file mode 100644 index 000000000..2f9808e78 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentPingFederate.Builder.class) +public final class CreateConnectionRequestContentPingFederate implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentPingFederate( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "pingfederate"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentPingFederate + && equalTo((CreateConnectionRequestContentPingFederate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentPingFederate other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentPingFederate other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentPingFederate build() { + return new CreateConnectionRequestContentPingFederate( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java new file mode 100644 index 000000000..d06385d2a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentPlanningCenter.Builder.class) +public final class CreateConnectionRequestContentPlanningCenter implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentPlanningCenter( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "planningcenter"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentPlanningCenter + && equalTo((CreateConnectionRequestContentPlanningCenter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentPlanningCenter other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentPlanningCenter other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentPlanningCenter build() { + return new CreateConnectionRequestContentPlanningCenter( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java new file mode 100644 index 000000000..cc75b61b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentRenren.Builder.class) +public final class CreateConnectionRequestContentRenren implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentRenren( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "renren"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentRenren + && equalTo((CreateConnectionRequestContentRenren) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentRenren other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentRenren other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentRenren build() { + return new CreateConnectionRequestContentRenren( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java new file mode 100644 index 000000000..f6cb13b27 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSalesforce.Builder.class) +public final class CreateConnectionRequestContentSalesforce implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSalesforce( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSalesforce + && equalTo((CreateConnectionRequestContentSalesforce) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSalesforce other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSalesforce other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSalesforce build() { + return new CreateConnectionRequestContentSalesforce( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java new file mode 100644 index 000000000..b834ceac2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSalesforceCommunity.Builder.class) +public final class CreateConnectionRequestContentSalesforceCommunity + implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSalesforceCommunity( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce-community"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSalesforceCommunity + && equalTo((CreateConnectionRequestContentSalesforceCommunity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSalesforceCommunity other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSalesforceCommunity other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSalesforceCommunity build() { + return new CreateConnectionRequestContentSalesforceCommunity( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java new file mode 100644 index 000000000..04112bf89 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSalesforceSandbox.Builder.class) +public final class CreateConnectionRequestContentSalesforceSandbox + implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSalesforceSandbox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "salesforce-sandbox"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSalesforceSandbox + && equalTo((CreateConnectionRequestContentSalesforceSandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSalesforceSandbox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSalesforceSandbox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSalesforceSandbox build() { + return new CreateConnectionRequestContentSalesforceSandbox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java new file mode 100644 index 000000000..0f8bb36cc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSaml.Builder.class) +public final class CreateConnectionRequestContentSaml implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSaml( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "samlp"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSaml + && equalTo((CreateConnectionRequestContentSaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSaml other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSaml other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSaml build() { + return new CreateConnectionRequestContentSaml( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java new file mode 100644 index 000000000..ec38b3d66 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSharepoint.Builder.class) +public final class CreateConnectionRequestContentSharepoint implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSharepoint( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "sharepoint"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSharepoint + && equalTo((CreateConnectionRequestContentSharepoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSharepoint other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSharepoint other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSharepoint build() { + return new CreateConnectionRequestContentSharepoint( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java new file mode 100644 index 000000000..56a067934 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentShop.Builder.class) +public final class CreateConnectionRequestContentShop implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentShop( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "shop"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentShop + && equalTo((CreateConnectionRequestContentShop) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentShop other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentShop other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentShop build() { + return new CreateConnectionRequestContentShop( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java new file mode 100644 index 000000000..f4848c4d3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentShopify.Builder.class) +public final class CreateConnectionRequestContentShopify implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentShopify( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "shopify"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentShopify + && equalTo((CreateConnectionRequestContentShopify) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentShopify other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentShopify other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentShopify build() { + return new CreateConnectionRequestContentShopify( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java new file mode 100644 index 000000000..972992b64 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSms.Builder.class) +public final class CreateConnectionRequestContentSms implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSms( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "sms"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSms && equalTo((CreateConnectionRequestContentSms) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSms other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSms other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSms build() { + return new CreateConnectionRequestContentSms( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java new file mode 100644 index 000000000..9227cd8b6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentSoundcloud.Builder.class) +public final class CreateConnectionRequestContentSoundcloud implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentSoundcloud( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "soundcloud"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentSoundcloud + && equalTo((CreateConnectionRequestContentSoundcloud) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentSoundcloud other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentSoundcloud other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentSoundcloud build() { + return new CreateConnectionRequestContentSoundcloud( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java new file mode 100644 index 000000000..47c1d785f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentTheCity.Builder.class) +public final class CreateConnectionRequestContentTheCity implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentTheCity( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thecity"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentTheCity + && equalTo((CreateConnectionRequestContentTheCity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentTheCity other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentTheCity other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentTheCity build() { + return new CreateConnectionRequestContentTheCity( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java new file mode 100644 index 000000000..fa41667b1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentTheCitySandbox.Builder.class) +public final class CreateConnectionRequestContentTheCitySandbox implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentTheCitySandbox( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thecity-sandbox"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentTheCitySandbox + && equalTo((CreateConnectionRequestContentTheCitySandbox) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentTheCitySandbox other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentTheCitySandbox other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentTheCitySandbox build() { + return new CreateConnectionRequestContentTheCitySandbox( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java new file mode 100644 index 000000000..8f1d93e4c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentThirtySevenSignals.Builder.class) +public final class CreateConnectionRequestContentThirtySevenSignals + implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentThirtySevenSignals( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "thirtysevensignals"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentThirtySevenSignals + && equalTo((CreateConnectionRequestContentThirtySevenSignals) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentThirtySevenSignals other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentThirtySevenSignals other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentThirtySevenSignals build() { + return new CreateConnectionRequestContentThirtySevenSignals( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java new file mode 100644 index 000000000..f7809d4e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentTwitter.Builder.class) +public final class CreateConnectionRequestContentTwitter implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentTwitter( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "twitter"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentTwitter + && equalTo((CreateConnectionRequestContentTwitter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentTwitter other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentTwitter other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentTwitter build() { + return new CreateConnectionRequestContentTwitter( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java new file mode 100644 index 000000000..ce2951893 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentUntappd.Builder.class) +public final class CreateConnectionRequestContentUntappd implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentUntappd( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "untappd"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentUntappd + && equalTo((CreateConnectionRequestContentUntappd) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentUntappd other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentUntappd other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentUntappd build() { + return new CreateConnectionRequestContentUntappd( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java new file mode 100644 index 000000000..97d2fd292 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentVkontakte.Builder.class) +public final class CreateConnectionRequestContentVkontakte implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentVkontakte( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "vkontakte"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentVkontakte + && equalTo((CreateConnectionRequestContentVkontakte) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentVkontakte other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentVkontakte other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentVkontakte build() { + return new CreateConnectionRequestContentVkontakte( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java new file mode 100644 index 000000000..948d0d466 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentWeibo.Builder.class) +public final class CreateConnectionRequestContentWeibo implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentWeibo( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "weibo"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentWeibo + && equalTo((CreateConnectionRequestContentWeibo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentWeibo other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentWeibo other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentWeibo build() { + return new CreateConnectionRequestContentWeibo( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java new file mode 100644 index 000000000..f621d77e3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentWindowsLive.Builder.class) +public final class CreateConnectionRequestContentWindowsLive implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional> options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentWindowsLive( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional> options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "windowslive"; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentWindowsLive + && equalTo((CreateConnectionRequestContentWindowsLive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentWindowsLive other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional> options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentWindowsLive other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(Map options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentWindowsLive build() { + return new CreateConnectionRequestContentWindowsLive( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java new file mode 100644 index 000000000..c750e9380 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentWordpress.Builder.class) +public final class CreateConnectionRequestContentWordpress implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentWordpress( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "wordpress"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentWordpress + && equalTo((CreateConnectionRequestContentWordpress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentWordpress other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentWordpress other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentWordpress build() { + return new CreateConnectionRequestContentWordpress( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java new file mode 100644 index 000000000..d732e2582 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentYahoo.Builder.class) +public final class CreateConnectionRequestContentYahoo implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentYahoo( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yahoo"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentYahoo + && equalTo((CreateConnectionRequestContentYahoo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentYahoo other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentYahoo other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentYahoo build() { + return new CreateConnectionRequestContentYahoo( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java new file mode 100644 index 000000000..b929bc68e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentYammer.Builder.class) +public final class CreateConnectionRequestContentYammer implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentYammer( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yammer"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentYammer + && equalTo((CreateConnectionRequestContentYammer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentYammer other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentYammer other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentYammer build() { + return new CreateConnectionRequestContentYammer( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java new file mode 100644 index 000000000..2ce3af07f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateConnectionRequestContentYandex.Builder.class) +public final class CreateConnectionRequestContentYandex implements ICreateConnectionCommon, IConnectionCommon { + private final Optional name; + + private final Optional authentication; + + private final Optional connectedAccounts; + + private final Optional displayName; + + private final Optional> enabledClients; + + private final Optional isDomainConnection; + + private final Optional>> metadata; + + private final Optional> realms; + + private final Optional showAsButton; + + private final Optional options; + + private final Map additionalProperties; + + private CreateConnectionRequestContentYandex( + Optional name, + Optional authentication, + Optional connectedAccounts, + Optional displayName, + Optional> enabledClients, + Optional isDomainConnection, + Optional>> metadata, + Optional> realms, + Optional showAsButton, + Optional options, + Map additionalProperties) { + this.name = name; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; + this.displayName = displayName; + this.enabledClients = enabledClients; + this.isDomainConnection = isDomainConnection; + this.metadata = metadata; + this.realms = realms; + this.showAsButton = showAsButton; + this.options = options; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + @JsonProperty("authentication") + @Override + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + @Override + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @JsonProperty("display_name") + @Override + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("enabled_clients") + @Override + public Optional> getEnabledClients() { + return enabledClients; + } + + @JsonProperty("is_domain_connection") + @Override + public Optional getIsDomainConnection() { + return isDomainConnection; + } + + @JsonProperty("metadata") + @Override + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("realms") + @Override + public Optional> getRealms() { + return realms; + } + + @JsonProperty("show_as_button") + @Override + public Optional getShowAsButton() { + return showAsButton; + } + + @JsonProperty("strategy") + public String getStrategy() { + return "yandex"; + } + + @JsonProperty("options") + public Optional getOptions() { + return options; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateConnectionRequestContentYandex + && equalTo((CreateConnectionRequestContentYandex) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateConnectionRequestContentYandex other) { + return name.equals(other.name) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts) + && displayName.equals(other.displayName) + && enabledClients.equals(other.enabledClients) + && isDomainConnection.equals(other.isDomainConnection) + && metadata.equals(other.metadata) + && realms.equals(other.realms) + && showAsButton.equals(other.showAsButton) + && options.equals(other.options); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.authentication, + this.connectedAccounts, + this.displayName, + this.enabledClients, + this.isDomainConnection, + this.metadata, + this.realms, + this.showAsButton, + this.options); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional> enabledClients = Optional.empty(); + + private Optional isDomainConnection = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional> realms = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional options = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateConnectionRequestContentYandex other) { + name(other.getName()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); + displayName(other.getDisplayName()); + enabledClients(other.getEnabledClients()); + isDomainConnection(other.getIsDomainConnection()); + metadata(other.getMetadata()); + realms(other.getRealms()); + showAsButton(other.getShowAsButton()); + options(other.getOptions()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) + public Builder enabledClients(Optional> enabledClients) { + this.enabledClients = enabledClients; + return this; + } + + public Builder enabledClients(List enabledClients) { + this.enabledClients = Optional.ofNullable(enabledClients); + return this; + } + + @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) + public Builder isDomainConnection(Optional isDomainConnection) { + this.isDomainConnection = isDomainConnection; + return this; + } + + public Builder isDomainConnection(Boolean isDomainConnection) { + this.isDomainConnection = Optional.ofNullable(isDomainConnection); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "realms", nulls = Nulls.SKIP) + public Builder realms(Optional> realms) { + this.realms = realms; + return this; + } + + public Builder realms(List realms) { + this.realms = Optional.ofNullable(realms); + return this; + } + + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional options) { + this.options = options; + return this; + } + + public Builder options(ConnectionOptionsOAuth2Common options) { + this.options = Optional.ofNullable(options); + return this; + } + + public CreateConnectionRequestContentYandex build() { + return new CreateConnectionRequestContentYandex( + name, + authentication, + connectedAccounts, + displayName, + enabledClients, + isDomainConnection, + metadata, + realms, + showAsButton, + options, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java index 027081345..77971d50f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -39,7 +40,11 @@ public final class CreateConnectionResponseContent { private final Optional showAsButton; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -53,7 +58,9 @@ private CreateConnectionResponseContent( Optional> enabledClients, Optional isDomainConnection, Optional showAsButton, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.name = name; this.displayName = displayName; @@ -65,6 +72,8 @@ private CreateConnectionResponseContent( this.isDomainConnection = isDomainConnection; this.showAsButton = showAsButton; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -138,11 +147,21 @@ public Optional getShowAsButton() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } - @java.lang.Override + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionResponseContent && equalTo((CreateConnectionResponseContent) other); @@ -163,10 +182,12 @@ private boolean equalTo(CreateConnectionResponseContent other) { && enabledClients.equals(other.enabledClients) && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -178,10 +199,12 @@ public int hashCode() { this.enabledClients, this.isDomainConnection, this.showAsButton, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -210,7 +233,11 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -228,6 +255,8 @@ public Builder from(CreateConnectionResponseContent other) { isDomainConnection(other.getIsDomainConnection()); showAsButton(other.getShowAsButton()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -355,16 +384,38 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + public CreateConnectionResponseContent build() { return new CreateConnectionResponseContent( name, @@ -377,6 +428,8 @@ public CreateConnectionResponseContent build() { isDomainConnection, showAsButton, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java index 36e4c4047..6cb542cf3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java @@ -34,6 +34,8 @@ public final class CreateCustomDomainRequestContent { private final OptionalNullable customClientIpHeader; + private final Optional>> domainMetadata; + private final Map additionalProperties; private CreateCustomDomainRequestContent( @@ -42,12 +44,14 @@ private CreateCustomDomainRequestContent( Optional verificationMethod, Optional tlsPolicy, OptionalNullable customClientIpHeader, + Optional>> domainMetadata, Map additionalProperties) { this.domain = domain; this.type = type; this.verificationMethod = verificationMethod; this.tlsPolicy = tlsPolicy; this.customClientIpHeader = customClientIpHeader; + this.domainMetadata = domainMetadata; this.additionalProperties = additionalProperties; } @@ -80,7 +84,12 @@ public OptionalNullable getCustomClientIpH return customClientIpHeader; } - @java.lang.Override + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateCustomDomainRequestContent && equalTo((CreateCustomDomainRequestContent) other); @@ -96,15 +105,22 @@ private boolean equalTo(CreateCustomDomainRequestContent other) { && type.equals(other.type) && verificationMethod.equals(other.verificationMethod) && tlsPolicy.equals(other.tlsPolicy) - && customClientIpHeader.equals(other.customClientIpHeader); + && customClientIpHeader.equals(other.customClientIpHeader) + && domainMetadata.equals(other.domainMetadata); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.domain, this.type, this.verificationMethod, this.tlsPolicy, this.customClientIpHeader); + return Objects.hash( + this.domain, + this.type, + this.verificationMethod, + this.tlsPolicy, + this.customClientIpHeader, + this.domainMetadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -144,6 +160,10 @@ public interface _FinalStage { _FinalStage customClientIpHeader(Optional customClientIpHeader); _FinalStage customClientIpHeader(Nullable customClientIpHeader); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -152,6 +172,8 @@ public static final class Builder implements DomainStage, TypeStage, _FinalStage private CustomDomainProvisioningTypeEnum type; + private Optional>> domainMetadata = Optional.empty(); + private OptionalNullable customClientIpHeader = OptionalNullable.absent(); private Optional tlsPolicy = Optional.empty(); @@ -163,13 +185,14 @@ public static final class Builder implements DomainStage, TypeStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(CreateCustomDomainRequestContent other) { domain(other.getDomain()); type(other.getType()); verificationMethod(other.getVerificationMethod()); tlsPolicy(other.getTlsPolicy()); customClientIpHeader(other.getCustomClientIpHeader()); + domainMetadata(other.getDomainMetadata()); return this; } @@ -178,21 +201,34 @@ public Builder from(CreateCustomDomainRequestContent other) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public TypeStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainProvisioningTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + + @Override public _FinalStage customClientIpHeader(Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -204,7 +240,7 @@ public _FinalStage customClientIpHeader(Nullable customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -214,13 +250,13 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { @@ -228,36 +264,42 @@ public _FinalStage customClientIpHeader( return this; } - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; return this; } - @java.lang.Override + @Override public _FinalStage verificationMethod(String verificationMethod) { this.verificationMethod = Optional.ofNullable(verificationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "verification_method", nulls = Nulls.SKIP) public _FinalStage verificationMethod(Optional verificationMethod) { this.verificationMethod = verificationMethod; return this; } - @java.lang.Override + @Override public CreateCustomDomainRequestContent build() { return new CreateCustomDomainRequestContent( - domain, type, verificationMethod, tlsPolicy, customClientIpHeader, additionalProperties); + domain, + type, + verificationMethod, + tlsPolicy, + customClientIpHeader, + domainMetadata, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java index ec3c41056..489c07f27 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java @@ -30,6 +30,8 @@ public final class CreateCustomDomainResponseContent { private final boolean primary; + private final CustomDomainStatusFilterEnum status; + private final CustomDomainTypeEnum type; private final DomainVerification verification; @@ -38,24 +40,34 @@ public final class CreateCustomDomainResponseContent { private final Optional tlsPolicy; + private final Optional>> domainMetadata; + + private final Optional certificate; + private final Map additionalProperties; private CreateCustomDomainResponseContent( String customDomainId, String domain, boolean primary, + CustomDomainStatusFilterEnum status, CustomDomainTypeEnum type, DomainVerification verification, OptionalNullable customClientIpHeader, Optional tlsPolicy, + Optional>> domainMetadata, + Optional certificate, Map additionalProperties) { this.customDomainId = customDomainId; this.domain = domain; this.primary = primary; + this.status = status; this.type = type; this.verification = verification; this.customClientIpHeader = customClientIpHeader; this.tlsPolicy = tlsPolicy; + this.domainMetadata = domainMetadata; + this.certificate = certificate; this.additionalProperties = additionalProperties; } @@ -83,6 +95,11 @@ public boolean getPrimary() { return primary; } + @JsonProperty("status") + public CustomDomainStatusFilterEnum getStatus() { + return status; + } + @JsonProperty("type") public CustomDomainTypeEnum getType() { return type; @@ -113,13 +130,23 @@ public Optional getTlsPolicy() { return tlsPolicy; } + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @JsonProperty("certificate") + public Optional getCertificate() { + return certificate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("custom_client_ip_header") private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateCustomDomainResponseContent && equalTo((CreateCustomDomainResponseContent) other); @@ -134,25 +161,31 @@ private boolean equalTo(CreateCustomDomainResponseContent other) { return customDomainId.equals(other.customDomainId) && domain.equals(other.domain) && primary == other.primary + && status.equals(other.status) && type.equals(other.type) && verification.equals(other.verification) && customClientIpHeader.equals(other.customClientIpHeader) - && tlsPolicy.equals(other.tlsPolicy); + && tlsPolicy.equals(other.tlsPolicy) + && domainMetadata.equals(other.domainMetadata) + && certificate.equals(other.certificate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.customDomainId, this.domain, this.primary, + this.status, this.type, this.verification, this.customClientIpHeader, - this.tlsPolicy); + this.tlsPolicy, + this.domainMetadata, + this.certificate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -181,7 +214,11 @@ public interface PrimaryStage { /** *

Whether this is a primary domain (true) or not (false).

*/ - TypeStage primary(boolean primary); + StatusStage primary(boolean primary); + } + + public interface StatusStage { + TypeStage status(@NotNull CustomDomainStatusFilterEnum status); } public interface TypeStage { @@ -212,21 +249,41 @@ public interface _FinalStage { _FinalStage tlsPolicy(Optional tlsPolicy); _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); + + _FinalStage certificate(Optional certificate); + + _FinalStage certificate(DomainCertificate certificate); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, VerificationStage, _FinalStage { + implements CustomDomainIdStage, + DomainStage, + PrimaryStage, + StatusStage, + TypeStage, + VerificationStage, + _FinalStage { private String customDomainId; private String domain; private boolean primary; + private CustomDomainStatusFilterEnum status; + private CustomDomainTypeEnum type; private DomainVerification verification; + private Optional certificate = Optional.empty(); + + private Optional>> domainMetadata = Optional.empty(); + private Optional tlsPolicy = Optional.empty(); private OptionalNullable customClientIpHeader = OptionalNullable.absent(); @@ -236,15 +293,18 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); primary(other.getPrimary()); + status(other.getStatus()); type(other.getType()); verification(other.getVerification()); customClientIpHeader(other.getCustomClientIpHeader()); tlsPolicy(other.getTlsPolicy()); + domainMetadata(other.getDomainMetadata()); + certificate(other.getCertificate()); return this; } @@ -253,7 +313,7 @@ public Builder from(CreateCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -265,7 +325,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -277,32 +337,65 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") - public TypeStage primary(boolean primary) { + public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @java.lang.Override + @Override + @JsonSetter("status") + public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override @JsonSetter("type") public VerificationStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("verification") public _FinalStage verification(@NotNull DomainVerification verification) { this.verification = Objects.requireNonNull(verification, "verification must not be null"); return this; } + @Override + public _FinalStage certificate(DomainCertificate certificate) { + this.certificate = Optional.ofNullable(certificate); + return this; + } + + @Override + @JsonSetter(value = "certificate", nulls = Nulls.SKIP) + public _FinalStage certificate(Optional certificate) { + this.certificate = certificate; + return this; + } + + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + /** *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -311,7 +404,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -322,7 +415,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -338,7 +431,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -352,7 +445,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -361,23 +454,26 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @java.lang.Override + @Override public CreateCustomDomainResponseContent build() { return new CreateCustomDomainResponseContent( customDomainId, domain, primary, + status, type, verification, customClientIpHeader, tlsPolicy, + domainMetadata, + certificate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java new file mode 100644 index 000000000..244bec3de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateDirectoryProvisioningRequestContent.Builder.class) +public final class CreateDirectoryProvisioningRequestContent { + private final Optional> mapping; + + private final Optional synchronizeAutomatically; + + private final Map additionalProperties; + + private CreateDirectoryProvisioningRequestContent( + Optional> mapping, + Optional synchronizeAutomatically, + Map additionalProperties) { + this.mapping = mapping; + this.synchronizeAutomatically = synchronizeAutomatically; + this.additionalProperties = additionalProperties; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + /** + * @return Whether periodic automatic synchronization is enabled + */ + @JsonProperty("synchronize_automatically") + public Optional getSynchronizeAutomatically() { + return synchronizeAutomatically; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateDirectoryProvisioningRequestContent + && equalTo((CreateDirectoryProvisioningRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateDirectoryProvisioningRequestContent other) { + return mapping.equals(other.mapping) && synchronizeAutomatically.equals(other.synchronizeAutomatically); + } + + @Override + public int hashCode() { + return Objects.hash(this.mapping, this.synchronizeAutomatically); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> mapping = Optional.empty(); + + private Optional synchronizeAutomatically = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateDirectoryProvisioningRequestContent other) { + mapping(other.getMapping()); + synchronizeAutomatically(other.getSynchronizeAutomatically()); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + /** + *

Whether periodic automatic synchronization is enabled

+ */ + @JsonSetter(value = "synchronize_automatically", nulls = Nulls.SKIP) + public Builder synchronizeAutomatically(Optional synchronizeAutomatically) { + this.synchronizeAutomatically = synchronizeAutomatically; + return this; + } + + public Builder synchronizeAutomatically(Boolean synchronizeAutomatically) { + this.synchronizeAutomatically = Optional.ofNullable(synchronizeAutomatically); + return this; + } + + public CreateDirectoryProvisioningRequestContent build() { + return new CreateDirectoryProvisioningRequestContent( + mapping, synchronizeAutomatically, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java new file mode 100644 index 000000000..1fc4bf64b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java @@ -0,0 +1,513 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateDirectoryProvisioningResponseContent.Builder.class) +public final class CreateDirectoryProvisioningResponseContent { + private final String connectionId; + + private final String connectionName; + + private final String strategy; + + private final List mapping; + + private final boolean synchronizeAutomatically; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional lastSynchronizationAt; + + private final Optional lastSynchronizationStatus; + + private final Optional lastSynchronizationError; + + private final Map additionalProperties; + + private CreateDirectoryProvisioningResponseContent( + String connectionId, + String connectionName, + String strategy, + List mapping, + boolean synchronizeAutomatically, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional lastSynchronizationAt, + Optional lastSynchronizationStatus, + Optional lastSynchronizationError, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.mapping = mapping; + this.synchronizeAutomatically = synchronizeAutomatically; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.lastSynchronizationAt = lastSynchronizationAt; + this.lastSynchronizationStatus = lastSynchronizationStatus; + this.lastSynchronizationError = lastSynchronizationError; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return The connection's name + */ + @JsonProperty("connection_name") + public String getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public String getStrategy() { + return strategy; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public List getMapping() { + return mapping; + } + + /** + * @return Whether periodic automatic synchronization is enabled + */ + @JsonProperty("synchronize_automatically") + public boolean getSynchronizeAutomatically() { + return synchronizeAutomatically; + } + + /** + * @return The timestamp at which the directory provisioning configuration was created + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp at which the directory provisioning configuration was last updated + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The timestamp at which the connection was last synchronized + */ + @JsonProperty("last_synchronization_at") + public Optional getLastSynchronizationAt() { + return lastSynchronizationAt; + } + + /** + * @return The status of the last synchronization + */ + @JsonProperty("last_synchronization_status") + public Optional getLastSynchronizationStatus() { + return lastSynchronizationStatus; + } + + /** + * @return The error message of the last synchronization, if any + */ + @JsonProperty("last_synchronization_error") + public Optional getLastSynchronizationError() { + return lastSynchronizationError; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateDirectoryProvisioningResponseContent + && equalTo((CreateDirectoryProvisioningResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateDirectoryProvisioningResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && mapping.equals(other.mapping) + && synchronizeAutomatically == other.synchronizeAutomatically + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && lastSynchronizationAt.equals(other.lastSynchronizationAt) + && lastSynchronizationStatus.equals(other.lastSynchronizationStatus) + && lastSynchronizationError.equals(other.lastSynchronizationError); + } + + @Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.mapping, + this.synchronizeAutomatically, + this.createdAt, + this.updatedAt, + this.lastSynchronizationAt, + this.lastSynchronizationStatus, + this.lastSynchronizationError); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

The connection's identifier

+ */ + ConnectionNameStage connectionId(@NotNull String connectionId); + + Builder from(CreateDirectoryProvisioningResponseContent other); + } + + public interface ConnectionNameStage { + /** + *

The connection's name

+ */ + StrategyStage connectionName(@NotNull String connectionName); + } + + public interface StrategyStage { + /** + *

The connection's strategy

+ */ + SynchronizeAutomaticallyStage strategy(@NotNull String strategy); + } + + public interface SynchronizeAutomaticallyStage { + /** + *

Whether periodic automatic synchronization is enabled

+ */ + CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically); + } + + public interface CreatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was created

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ */ + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + CreateDirectoryProvisioningResponseContent build(); + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + _FinalStage mapping(List mapping); + + _FinalStage addMapping(DirectoryProvisioningMappingItem mapping); + + _FinalStage addAllMapping(List mapping); + + /** + *

The timestamp at which the connection was last synchronized

+ */ + _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt); + + _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt); + + /** + *

The status of the last synchronization

+ */ + _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus); + + _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus); + + /** + *

The error message of the last synchronization, if any

+ */ + _FinalStage lastSynchronizationError(Optional lastSynchronizationError); + + _FinalStage lastSynchronizationError(String lastSynchronizationError); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, + ConnectionNameStage, + StrategyStage, + SynchronizeAutomaticallyStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private String connectionId; + + private String connectionName; + + private String strategy; + + private boolean synchronizeAutomatically; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional lastSynchronizationError = Optional.empty(); + + private Optional lastSynchronizationStatus = Optional.empty(); + + private Optional lastSynchronizationAt = Optional.empty(); + + private List mapping = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateDirectoryProvisioningResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + mapping(other.getMapping()); + synchronizeAutomatically(other.getSynchronizeAutomatically()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + lastSynchronizationAt(other.getLastSynchronizationAt()); + lastSynchronizationStatus(other.getLastSynchronizationStatus()); + lastSynchronizationError(other.getLastSynchronizationError()); + return this; + } + + /** + *

The connection's identifier

+ *

The connection's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_id") + public ConnectionNameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

The connection's name

+ *

The connection's name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_name") + public StrategyStage connectionName(@NotNull String connectionName) { + this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); + return this; + } + + /** + *

The connection's strategy

+ *

The connection's strategy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("strategy") + public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { + this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); + return this; + } + + /** + *

Whether periodic automatic synchronization is enabled

+ *

Whether periodic automatic synchronization is enabled

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("synchronize_automatically") + public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { + this.synchronizeAutomatically = synchronizeAutomatically; + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was created

+ *

The timestamp at which the directory provisioning configuration was created

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ *

The timestamp at which the directory provisioning configuration was last updated

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationError(String lastSynchronizationError) { + this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ */ + @Override + @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { + this.lastSynchronizationError = lastSynchronizationError; + return this; + } + + /** + *

The status of the last synchronization

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { + this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); + return this; + } + + /** + *

The status of the last synchronization

+ */ + @Override + @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { + this.lastSynchronizationStatus = lastSynchronizationStatus; + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { + this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ */ + @Override + @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { + this.lastSynchronizationAt = lastSynchronizationAt; + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addAllMapping(List mapping) { + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { + this.mapping.add(mapping); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @Override + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public _FinalStage mapping(List mapping) { + this.mapping.clear(); + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + @Override + public CreateDirectoryProvisioningResponseContent build() { + return new CreateDirectoryProvisioningResponseContent( + connectionId, + connectionName, + strategy, + mapping, + synchronizeAutomatically, + createdAt, + updatedAt, + lastSynchronizationAt, + lastSynchronizationStatus, + lastSynchronizationError, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java new file mode 100644 index 000000000..70dd7fcd5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateDirectorySynchronizationResponseContent.Builder.class) +public final class CreateDirectorySynchronizationResponseContent { + private final String connectionId; + + private final String synchronizationId; + + private final String status; + + private final Map additionalProperties; + + private CreateDirectorySynchronizationResponseContent( + String connectionId, String synchronizationId, String status, Map additionalProperties) { + this.connectionId = connectionId; + this.synchronizationId = synchronizationId; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return The synchronization's identifier + */ + @JsonProperty("synchronization_id") + public String getSynchronizationId() { + return synchronizationId; + } + + /** + * @return The synchronization status + */ + @JsonProperty("status") + public String getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateDirectorySynchronizationResponseContent + && equalTo((CreateDirectorySynchronizationResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateDirectorySynchronizationResponseContent other) { + return connectionId.equals(other.connectionId) + && synchronizationId.equals(other.synchronizationId) + && status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash(this.connectionId, this.synchronizationId, this.status); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

The connection's identifier

+ */ + SynchronizationIdStage connectionId(@NotNull String connectionId); + + Builder from(CreateDirectorySynchronizationResponseContent other); + } + + public interface SynchronizationIdStage { + /** + *

The synchronization's identifier

+ */ + StatusStage synchronizationId(@NotNull String synchronizationId); + } + + public interface StatusStage { + /** + *

The synchronization status

+ */ + _FinalStage status(@NotNull String status); + } + + public interface _FinalStage { + CreateDirectorySynchronizationResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, SynchronizationIdStage, StatusStage, _FinalStage { + private String connectionId; + + private String synchronizationId; + + private String status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateDirectorySynchronizationResponseContent other) { + connectionId(other.getConnectionId()); + synchronizationId(other.getSynchronizationId()); + status(other.getStatus()); + return this; + } + + /** + *

The connection's identifier

+ *

The connection's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_id") + public SynchronizationIdStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

The synchronization's identifier

+ *

The synchronization's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("synchronization_id") + public StatusStage synchronizationId(@NotNull String synchronizationId) { + this.synchronizationId = Objects.requireNonNull(synchronizationId, "synchronizationId must not be null"); + return this; + } + + /** + *

The synchronization status

+ *

The synchronization status

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("status") + public _FinalStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override + public CreateDirectorySynchronizationResponseContent build() { + return new CreateDirectorySynchronizationResponseContent( + connectionId, synchronizationId, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java index 25db1c9d6..f7d192a95 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailProviderResponseContent @@ -101,12 +101,12 @@ private boolean equalTo(CreateEmailProviderResponseContent other) { && settings.equals(other.settings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java index 646bb455c..98886103b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailTemplateRequestContent && equalTo((CreateEmailTemplateRequestContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(CreateEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEmailTemplateRequestContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(CreateEmailTemplateRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @java.lang.Override + @Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @java.lang.Override + @Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @java.lang.Override + @Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @java.lang.Override + @Override public CreateEmailTemplateRequestContent build() { return new CreateEmailTemplateRequestContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java index 3eac25b69..bcbba1ace 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailTemplateResponseContent @@ -230,7 +230,7 @@ private boolean equalTo(CreateEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -244,7 +244,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -372,7 +372,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEmailTemplateResponseContent other) { template(other.getTemplate()); body(other.getBody()); @@ -386,7 +386,7 @@ public Builder from(CreateEmailTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -397,7 +397,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -413,7 +413,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -427,7 +427,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -436,7 +436,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -447,7 +447,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -456,7 +456,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -467,7 +467,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -483,7 +483,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -497,7 +497,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -506,7 +506,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @java.lang.Override + @Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -517,7 +517,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -533,7 +533,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -547,7 +547,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -556,7 +556,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @java.lang.Override + @Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -567,7 +567,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -583,7 +583,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -597,7 +597,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -606,7 +606,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -617,7 +617,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -633,7 +633,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -647,7 +647,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -656,7 +656,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -667,7 +667,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -683,7 +683,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -697,7 +697,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -706,7 +706,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -717,7 +717,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -733,7 +733,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -747,7 +747,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -756,14 +756,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @java.lang.Override + @Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @java.lang.Override + @Override public CreateEmailTemplateResponseContent build() { return new CreateEmailTemplateResponseContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java index 51f55216c..b8f0cc0a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java @@ -45,7 +45,7 @@ public String getAlgorithm() { return algorithm; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyPublicWrappingResponseContent @@ -61,12 +61,12 @@ private boolean equalTo(CreateEncryptionKeyPublicWrappingResponseContent other) return publicKey.equals(other.publicKey) && algorithm.equals(other.algorithm); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.publicKey, this.algorithm); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements PublicKeyStage, AlgorithmStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEncryptionKeyPublicWrappingResponseContent other) { publicKey(other.getPublicKey()); algorithm(other.getAlgorithm()); @@ -115,21 +115,21 @@ public Builder from(CreateEncryptionKeyPublicWrappingResponseContent other) { *

Public wrapping key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("public_key") public AlgorithmStage publicKey(@NotNull String publicKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("algorithm") public _FinalStage algorithm(@NotNull String algorithm) { this.algorithm = Objects.requireNonNull(algorithm, "algorithm must not be null"); return this; } - @java.lang.Override + @Override public CreateEncryptionKeyPublicWrappingResponseContent build() { return new CreateEncryptionKeyPublicWrappingResponseContent(publicKey, algorithm, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java index 6b43e7290..2abaa3b7a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(CreateEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -215,7 +215,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -232,21 +232,21 @@ public Builder from(CreateEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -258,7 +258,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -270,7 +270,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -282,7 +282,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -293,7 +293,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -302,14 +302,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @java.lang.Override + @Override public CreateEncryptionKeyResponseContent build() { return new CreateEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java index 8391b512d..7373d5678 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CreateEncryptionKeyType && this.string.equals(((CreateEncryptionKeyType) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java index b415797bf..e2b055cca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamActionRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamActionRequestContent other) { && status.equals(other.status); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEventStreamActionRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamActionRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamActionDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @java.lang.Override + @Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateEventStreamActionRequestContent build() { return new CreateEventStreamActionRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java index 08b37a544..9ab74165e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamEventBridgeRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamEventBridgeRequestContent other) { && status.equals(other.status); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEventStreamEventBridgeRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamEventBridgeRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamEventBridgeDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @java.lang.Override + @Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateEventStreamEventBridgeRequestContent build() { return new CreateEventStreamEventBridgeRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java index 3885fbcfc..b2cdcfbed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java @@ -77,7 +77,7 @@ public Optional> getEventTypes() { return eventTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamRedeliveryResponseContent @@ -96,12 +96,12 @@ private boolean equalTo(CreateEventStreamRedeliveryResponseContent other) { && eventTypes.equals(other.eventTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java index e8a0edb1b..9d34573db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamResponseContent && equalTo((CreateEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(CreateEventStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer> getData() { return data; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamTestEventRequestContent @@ -62,12 +62,12 @@ private boolean equalTo(CreateEventStreamTestEventRequestContent other) { return eventType.equals(other.eventType) && data.equals(other.data); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.eventType, this.data); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,34 +101,34 @@ public static final class Builder implements EventTypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEventStreamTestEventRequestContent other) { eventType(other.getEventType()); data(other.getData()); return this; } - @java.lang.Override + @Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamTestEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage data(Map data) { this.data = Optional.ofNullable(data); return this; } - @java.lang.Override + @Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional> data) { this.data = data; return this; } - @java.lang.Override + @Override public CreateEventStreamTestEventRequestContent build() { return new CreateEventStreamTestEventRequestContent(eventType, data, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java index bfdea88f1..8eef953be 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamTestEventResponseContent @@ -114,12 +114,12 @@ private boolean equalTo(CreateEventStreamTestEventResponseContent other) { && event.equals(other.event); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEventStreamTestEventResponseContent other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -204,7 +204,7 @@ public Builder from(CreateEventStreamTestEventResponseContent other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -216,34 +216,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @java.lang.Override + @Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -254,7 +254,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -266,7 +266,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -275,7 +275,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @java.lang.Override + @Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -285,7 +285,7 @@ public _FinalStage attempts(List attempts) { return this; } - @java.lang.Override + @Override public CreateEventStreamTestEventResponseContent build() { return new CreateEventStreamTestEventResponseContent( id, eventStreamId, status, eventType, attempts, event, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java index c0ef573bb..4919689b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamWebHookRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamWebHookRequestContent other) { && status.equals(other.status); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateEventStreamWebHookRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamWebHookRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamWebhookDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @java.lang.Override + @Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateEventStreamWebHookRequestContent build() { return new CreateEventStreamWebHookRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java index 48ebd22df..e86814dbd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java @@ -49,7 +49,7 @@ public Optional getExportAs() { return exportAs; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersFields && equalTo((CreateExportUsersFields) other); @@ -64,12 +64,12 @@ private boolean equalTo(CreateExportUsersFields other) { return name.equals(other.name) && exportAs.equals(other.exportAs); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.exportAs); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateExportUsersFields other) { name(other.getName()); exportAs(other.getExportAs()); @@ -121,7 +121,7 @@ public Builder from(CreateExportUsersFields other) { *

Name of the field in the profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -132,7 +132,7 @@ public _FinalStage name(@NotNull String name) { *

Title of the column in the exported CSV.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage exportAs(String exportAs) { this.exportAs = Optional.ofNullable(exportAs); return this; @@ -141,14 +141,14 @@ public _FinalStage exportAs(String exportAs) { /** *

Title of the column in the exported CSV.

*/ - @java.lang.Override + @Override @JsonSetter(value = "export_as", nulls = Nulls.SKIP) public _FinalStage exportAs(Optional exportAs) { this.exportAs = exportAs; return this; } - @java.lang.Override + @Override public CreateExportUsersFields build() { return new CreateExportUsersFields(name, exportAs, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java index ab3539c98..e68372ade 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java @@ -122,7 +122,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersResponseContent && equalTo((CreateExportUsersResponseContent) other); @@ -144,7 +144,7 @@ private boolean equalTo(CreateExportUsersResponseContent other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.status, @@ -157,7 +157,7 @@ public int hashCode() { this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -248,7 +248,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(CreateExportUsersResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -266,7 +266,7 @@ public Builder from(CreateExportUsersResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -278,7 +278,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -290,7 +290,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -301,7 +301,7 @@ public _FinalStage id(@NotNull String id) { *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage fields(List fields) { this.fields = Optional.ofNullable(fields); return this; @@ -310,7 +310,7 @@ public _FinalStage fields(List fields) { /** *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

*/ - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; @@ -321,7 +321,7 @@ public _FinalStage fields(Optional> fields) { *

Limit the number of records.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage limit(Integer limit) { this.limit = Optional.ofNullable(limit); return this; @@ -330,20 +330,20 @@ public _FinalStage limit(Integer limit) { /** *

Limit the number of records.

*/ - @java.lang.Override + @Override @JsonSetter(value = "limit", nulls = Nulls.SKIP) public _FinalStage limit(Optional limit) { this.limit = limit; return this; } - @java.lang.Override + @Override public _FinalStage format(JobFileFormatEnum format) { this.format = Optional.ofNullable(format); return this; } - @java.lang.Override + @Override @JsonSetter(value = "format", nulls = Nulls.SKIP) public _FinalStage format(Optional format) { this.format = format; @@ -354,7 +354,7 @@ public _FinalStage format(Optional format) { *

connection_id of the connection from which users will be exported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -363,7 +363,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection from which users will be exported.

*/ - @java.lang.Override + @Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -374,7 +374,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -383,14 +383,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public CreateExportUsersResponseContent build() { return new CreateExportUsersResponseContent( status, type, createdAt, id, connectionId, format, limit, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java index 929af5f34..ab6ceab85 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java @@ -45,7 +45,7 @@ public Optional> getActions() { return actions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowRequestContent && equalTo((CreateFlowRequestContent) other); @@ -60,12 +60,12 @@ private boolean equalTo(CreateFlowRequestContent other) { return name.equals(other.name) && actions.equals(other.actions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.actions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,34 +99,34 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateFlowRequestContent other) { name(other.getName()); actions(other.getActions()); return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @java.lang.Override + @Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @java.lang.Override + @Override public CreateFlowRequestContent build() { return new CreateFlowRequestContent(name, actions, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java index eabb8c199..0096b6034 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowResponseContent && equalTo((CreateFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(CreateFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(CreateFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(CreateFlowResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @java.lang.Override + @Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @java.lang.Override + @Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @java.lang.Override + @Override public CreateFlowResponseContent build() { return new CreateFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java new file mode 100644 index 000000000..705eea9ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionActivecampaign.Deserializer.class) +public final class CreateFlowsVaultConnectionActivecampaign { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionActivecampaign(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionActivecampaignApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionActivecampaignUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionActivecampaign + && equalTo((CreateFlowsVaultConnectionActivecampaign) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionActivecampaign other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionActivecampaign of(CreateFlowsVaultConnectionActivecampaignApiKey value) { + return new CreateFlowsVaultConnectionActivecampaign(value, 0); + } + + public static CreateFlowsVaultConnectionActivecampaign of( + CreateFlowsVaultConnectionActivecampaignUninitialized value) { + return new CreateFlowsVaultConnectionActivecampaign(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionActivecampaignApiKey value); + + T visit(CreateFlowsVaultConnectionActivecampaignUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionActivecampaign.class); + } + + @Override + public CreateFlowsVaultConnectionActivecampaign deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionActivecampaignApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionActivecampaignUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignApiKey.java new file mode 100644 index 000000000..7eb52e56f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignApiKey.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionActivecampaignApiKey.Builder.class) +public final class CreateFlowsVaultConnectionActivecampaignApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupApiKeyWithBaseUrl setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionActivecampaignApiKey( + String name, + String appId, + FlowsVaultConnectioSetupApiKeyWithBaseUrl setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupApiKeyWithBaseUrl getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionActivecampaignApiKey + && equalTo((CreateFlowsVaultConnectionActivecampaignApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionActivecampaignApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionActivecampaignApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKeyWithBaseUrl setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionActivecampaignApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupApiKeyWithBaseUrl setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionActivecampaignApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKeyWithBaseUrl setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionActivecampaignApiKey build() { + return new CreateFlowsVaultConnectionActivecampaignApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java new file mode 100644 index 000000000..672f8b572 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionActivecampaignUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionActivecampaignUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionActivecampaignUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionActivecampaignUninitialized + && equalTo((CreateFlowsVaultConnectionActivecampaignUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionActivecampaignUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionActivecampaignUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionActivecampaignUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionActivecampaignUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionActivecampaignUninitialized build() { + return new CreateFlowsVaultConnectionActivecampaignUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java new file mode 100644 index 000000000..c2afa5fc7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionAirtable.Deserializer.class) +public final class CreateFlowsVaultConnectionAirtable { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionAirtable(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionAirtableApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionAirtableUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAirtable + && equalTo((CreateFlowsVaultConnectionAirtable) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionAirtable other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionAirtable of(CreateFlowsVaultConnectionAirtableApiKey value) { + return new CreateFlowsVaultConnectionAirtable(value, 0); + } + + public static CreateFlowsVaultConnectionAirtable of(CreateFlowsVaultConnectionAirtableUninitialized value) { + return new CreateFlowsVaultConnectionAirtable(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionAirtableApiKey value); + + T visit(CreateFlowsVaultConnectionAirtableUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionAirtable.class); + } + + @Override + public CreateFlowsVaultConnectionAirtable deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionAirtableApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionAirtableUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableApiKey.java new file mode 100644 index 000000000..51e33f2f0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableApiKey.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionAirtableApiKey.Builder.class) +public final class CreateFlowsVaultConnectionAirtableApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionAirtableApiKey( + String name, String appId, FlowsVaultConnectioSetupApiKey setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAirtableApiKey + && equalTo((CreateFlowsVaultConnectionAirtableApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionAirtableApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionAirtableApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionAirtableApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionAirtableApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionAirtableApiKey build() { + return new CreateFlowsVaultConnectionAirtableApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java new file mode 100644 index 000000000..658fb5d20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionAirtableUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionAirtableUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionAirtableUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAirtableUninitialized + && equalTo((CreateFlowsVaultConnectionAirtableUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionAirtableUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionAirtableUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionAirtableUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionAirtableUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionAirtableUninitialized build() { + return new CreateFlowsVaultConnectionAirtableUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java new file mode 100644 index 000000000..ec92b749a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionAuth0.Deserializer.class) +public final class CreateFlowsVaultConnectionAuth0 { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionAuth0(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionAuth0OauthApp) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionAuth0Uninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAuth0 && equalTo((CreateFlowsVaultConnectionAuth0) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionAuth0 other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionAuth0 of(CreateFlowsVaultConnectionAuth0OauthApp value) { + return new CreateFlowsVaultConnectionAuth0(value, 0); + } + + public static CreateFlowsVaultConnectionAuth0 of(CreateFlowsVaultConnectionAuth0Uninitialized value) { + return new CreateFlowsVaultConnectionAuth0(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionAuth0OauthApp value); + + T visit(CreateFlowsVaultConnectionAuth0Uninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionAuth0.class); + } + + @Override + public CreateFlowsVaultConnectionAuth0 deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionAuth0OauthApp.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionAuth0Uninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0OauthApp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0OauthApp.java new file mode 100644 index 000000000..00b0ef60f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0OauthApp.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionAuth0OauthApp.Builder.class) +public final class CreateFlowsVaultConnectionAuth0OauthApp { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthApp setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionAuth0OauthApp( + String name, + String appId, + FlowsVaultConnectioSetupOauthApp setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthApp getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAuth0OauthApp + && equalTo((CreateFlowsVaultConnectionAuth0OauthApp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionAuth0OauthApp other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionAuth0OauthApp other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthApp setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionAuth0OauthApp build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthApp setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionAuth0OauthApp other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthApp setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionAuth0OauthApp build() { + return new CreateFlowsVaultConnectionAuth0OauthApp(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java new file mode 100644 index 000000000..8cdca415e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionAuth0Uninitialized.Builder.class) +public final class CreateFlowsVaultConnectionAuth0Uninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionAuth0Uninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionAuth0Uninitialized + && equalTo((CreateFlowsVaultConnectionAuth0Uninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionAuth0Uninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionAuth0Uninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionAuth0Uninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionAuth0Uninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionAuth0Uninitialized build() { + return new CreateFlowsVaultConnectionAuth0Uninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java new file mode 100644 index 000000000..378f20c62 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionBigquery.Deserializer.class) +public final class CreateFlowsVaultConnectionBigquery { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionBigquery(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionBigqueryJwt) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionBigqueryUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionBigquery + && equalTo((CreateFlowsVaultConnectionBigquery) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionBigquery other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionBigquery of(CreateFlowsVaultConnectionBigqueryJwt value) { + return new CreateFlowsVaultConnectionBigquery(value, 0); + } + + public static CreateFlowsVaultConnectionBigquery of(CreateFlowsVaultConnectionBigqueryUninitialized value) { + return new CreateFlowsVaultConnectionBigquery(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionBigqueryJwt value); + + T visit(CreateFlowsVaultConnectionBigqueryUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionBigquery.class); + } + + @Override + public CreateFlowsVaultConnectionBigquery deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionBigqueryJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionBigqueryUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryJwt.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryJwt.java new file mode 100644 index 000000000..921eb07eb --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryJwt.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionBigqueryJwt.Builder.class) +public final class CreateFlowsVaultConnectionBigqueryJwt { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupBigqueryOauthJwt setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionBigqueryJwt( + String name, + String appId, + FlowsVaultConnectioSetupBigqueryOauthJwt setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupBigqueryOauthJwt getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionBigqueryJwt + && equalTo((CreateFlowsVaultConnectionBigqueryJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionBigqueryJwt other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionBigqueryJwt other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupBigqueryOauthJwt setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionBigqueryJwt build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupBigqueryOauthJwt setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionBigqueryJwt other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupBigqueryOauthJwt setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionBigqueryJwt build() { + return new CreateFlowsVaultConnectionBigqueryJwt(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java new file mode 100644 index 000000000..5b2b2ef9f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionBigqueryUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionBigqueryUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionBigqueryUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionBigqueryUninitialized + && equalTo((CreateFlowsVaultConnectionBigqueryUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionBigqueryUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionBigqueryUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionBigqueryUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionBigqueryUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionBigqueryUninitialized build() { + return new CreateFlowsVaultConnectionBigqueryUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java new file mode 100644 index 000000000..62164b93b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionClearbit.Deserializer.class) +public final class CreateFlowsVaultConnectionClearbit { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionClearbit(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionClearbitApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionClearbitUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionClearbit + && equalTo((CreateFlowsVaultConnectionClearbit) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionClearbit other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionClearbit of(CreateFlowsVaultConnectionClearbitApiKey value) { + return new CreateFlowsVaultConnectionClearbit(value, 0); + } + + public static CreateFlowsVaultConnectionClearbit of(CreateFlowsVaultConnectionClearbitUninitialized value) { + return new CreateFlowsVaultConnectionClearbit(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionClearbitApiKey value); + + T visit(CreateFlowsVaultConnectionClearbitUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionClearbit.class); + } + + @Override + public CreateFlowsVaultConnectionClearbit deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionClearbitApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionClearbitUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitApiKey.java new file mode 100644 index 000000000..1729e9e27 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitApiKey.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionClearbitApiKey.Builder.class) +public final class CreateFlowsVaultConnectionClearbitApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupSecretApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionClearbitApiKey( + String name, + String appId, + FlowsVaultConnectioSetupSecretApiKey setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupSecretApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionClearbitApiKey + && equalTo((CreateFlowsVaultConnectionClearbitApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionClearbitApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionClearbitApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionClearbitApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupSecretApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionClearbitApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionClearbitApiKey build() { + return new CreateFlowsVaultConnectionClearbitApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java new file mode 100644 index 000000000..a465292d8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionClearbitUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionClearbitUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionClearbitUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionClearbitUninitialized + && equalTo((CreateFlowsVaultConnectionClearbitUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionClearbitUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionClearbitUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionClearbitUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionClearbitUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionClearbitUninitialized build() { + return new CreateFlowsVaultConnectionClearbitUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java new file mode 100644 index 000000000..39e1551ef --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionDocusign.Deserializer.class) +public final class CreateFlowsVaultConnectionDocusign { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionDocusign(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionDocusignOauthCode) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionDocusignUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionDocusign + && equalTo((CreateFlowsVaultConnectionDocusign) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionDocusign other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionDocusign of(CreateFlowsVaultConnectionDocusignOauthCode value) { + return new CreateFlowsVaultConnectionDocusign(value, 0); + } + + public static CreateFlowsVaultConnectionDocusign of(CreateFlowsVaultConnectionDocusignUninitialized value) { + return new CreateFlowsVaultConnectionDocusign(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionDocusignOauthCode value); + + T visit(CreateFlowsVaultConnectionDocusignUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionDocusign.class); + } + + @Override + public CreateFlowsVaultConnectionDocusign deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionDocusignOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionDocusignUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignOauthCode.java new file mode 100644 index 000000000..529f0414e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionDocusignOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionDocusignOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionDocusignOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionDocusignOauthCode + && equalTo((CreateFlowsVaultConnectionDocusignOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionDocusignOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionDocusignOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionDocusignOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionDocusignOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionDocusignOauthCode build() { + return new CreateFlowsVaultConnectionDocusignOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java new file mode 100644 index 000000000..f6d7bc9d4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionDocusignUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionDocusignUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionDocusignUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionDocusignUninitialized + && equalTo((CreateFlowsVaultConnectionDocusignUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionDocusignUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionDocusignUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionDocusignUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionDocusignUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionDocusignUninitialized build() { + return new CreateFlowsVaultConnectionDocusignUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java new file mode 100644 index 000000000..25cb0efb3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionGoogleSheets.Deserializer.class) +public final class CreateFlowsVaultConnectionGoogleSheets { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionGoogleSheets(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionGoogleSheetsOauthCode) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionGoogleSheetsUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionGoogleSheets + && equalTo((CreateFlowsVaultConnectionGoogleSheets) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionGoogleSheets other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionGoogleSheets of(CreateFlowsVaultConnectionGoogleSheetsOauthCode value) { + return new CreateFlowsVaultConnectionGoogleSheets(value, 0); + } + + public static CreateFlowsVaultConnectionGoogleSheets of(CreateFlowsVaultConnectionGoogleSheetsUninitialized value) { + return new CreateFlowsVaultConnectionGoogleSheets(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionGoogleSheetsOauthCode value); + + T visit(CreateFlowsVaultConnectionGoogleSheetsUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionGoogleSheets.class); + } + + @Override + public CreateFlowsVaultConnectionGoogleSheets deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionGoogleSheetsOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionGoogleSheetsUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsOauthCode.java new file mode 100644 index 000000000..6a2e6b19b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionGoogleSheetsOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionGoogleSheetsOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionGoogleSheetsOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionGoogleSheetsOauthCode + && equalTo((CreateFlowsVaultConnectionGoogleSheetsOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionGoogleSheetsOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionGoogleSheetsOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionGoogleSheetsOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionGoogleSheetsOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionGoogleSheetsOauthCode build() { + return new CreateFlowsVaultConnectionGoogleSheetsOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java new file mode 100644 index 000000000..b6ae25c83 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionGoogleSheetsUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionGoogleSheetsUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionGoogleSheetsUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionGoogleSheetsUninitialized + && equalTo((CreateFlowsVaultConnectionGoogleSheetsUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionGoogleSheetsUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionGoogleSheetsUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionGoogleSheetsUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionGoogleSheetsUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionGoogleSheetsUninitialized build() { + return new CreateFlowsVaultConnectionGoogleSheetsUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java new file mode 100644 index 000000000..90170a27b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionHttp.Deserializer.class) +public final class CreateFlowsVaultConnectionHttp { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionHttp(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionHttpBearer) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionHttpUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHttp && equalTo((CreateFlowsVaultConnectionHttp) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionHttp other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionHttp of(CreateFlowsVaultConnectionHttpBearer value) { + return new CreateFlowsVaultConnectionHttp(value, 0); + } + + public static CreateFlowsVaultConnectionHttp of(CreateFlowsVaultConnectionHttpUninitialized value) { + return new CreateFlowsVaultConnectionHttp(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionHttpBearer value); + + T visit(CreateFlowsVaultConnectionHttpUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionHttp.class); + } + + @Override + public CreateFlowsVaultConnectionHttp deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionHttpBearer.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionHttpUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpBearer.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpBearer.java new file mode 100644 index 000000000..e06e23e01 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpBearer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionHttpBearer.Builder.class) +public final class CreateFlowsVaultConnectionHttpBearer { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupHttpBearer setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionHttpBearer( + String name, + String appId, + FlowsVaultConnectioSetupHttpBearer setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupHttpBearer getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHttpBearer + && equalTo((CreateFlowsVaultConnectionHttpBearer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionHttpBearer other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionHttpBearer other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupHttpBearer setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionHttpBearer build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupHttpBearer setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionHttpBearer other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupHttpBearer setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionHttpBearer build() { + return new CreateFlowsVaultConnectionHttpBearer(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java new file mode 100644 index 000000000..aef42dad1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionHttpUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionHttpUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionHttpUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHttpUninitialized + && equalTo((CreateFlowsVaultConnectionHttpUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionHttpUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionHttpUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionHttpUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionHttpUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionHttpUninitialized build() { + return new CreateFlowsVaultConnectionHttpUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java new file mode 100644 index 000000000..d044778d1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionHubspot.Deserializer.class) +public final class CreateFlowsVaultConnectionHubspot { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionHubspot(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionHubspotApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionHubspotOauthCode) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionHubspotUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHubspot && equalTo((CreateFlowsVaultConnectionHubspot) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionHubspot other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionHubspot of(CreateFlowsVaultConnectionHubspotApiKey value) { + return new CreateFlowsVaultConnectionHubspot(value, 0); + } + + public static CreateFlowsVaultConnectionHubspot of(CreateFlowsVaultConnectionHubspotOauthCode value) { + return new CreateFlowsVaultConnectionHubspot(value, 1); + } + + public static CreateFlowsVaultConnectionHubspot of(CreateFlowsVaultConnectionHubspotUninitialized value) { + return new CreateFlowsVaultConnectionHubspot(value, 2); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionHubspotApiKey value); + + T visit(CreateFlowsVaultConnectionHubspotOauthCode value); + + T visit(CreateFlowsVaultConnectionHubspotUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionHubspot.class); + } + + @Override + public CreateFlowsVaultConnectionHubspot deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionHubspotApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionHubspotOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionHubspotUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotApiKey.java new file mode 100644 index 000000000..30335fbca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotApiKey.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionHubspotApiKey.Builder.class) +public final class CreateFlowsVaultConnectionHubspotApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionHubspotApiKey( + String name, String appId, FlowsVaultConnectioSetupApiKey setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHubspotApiKey + && equalTo((CreateFlowsVaultConnectionHubspotApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionHubspotApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionHubspotApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionHubspotApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionHubspotApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionHubspotApiKey build() { + return new CreateFlowsVaultConnectionHubspotApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java new file mode 100644 index 000000000..ba26dbcca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionHubspotOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionHubspotOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionHubspotOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHubspotOauthCode + && equalTo((CreateFlowsVaultConnectionHubspotOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionHubspotOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionHubspotOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionHubspotOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionHubspotOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionHubspotOauthCode build() { + return new CreateFlowsVaultConnectionHubspotOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java new file mode 100644 index 000000000..b9358e41b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionHubspotUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionHubspotUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionHubspotUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionHubspotUninitialized + && equalTo((CreateFlowsVaultConnectionHubspotUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionHubspotUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionHubspotUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionHubspotUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionHubspotUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionHubspotUninitialized build() { + return new CreateFlowsVaultConnectionHubspotUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java new file mode 100644 index 000000000..37fdb64d9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionJwt.Deserializer.class) +public final class CreateFlowsVaultConnectionJwt { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionJwt(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionJwtJwt) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionJwtUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionJwt && equalTo((CreateFlowsVaultConnectionJwt) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionJwt other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionJwt of(CreateFlowsVaultConnectionJwtJwt value) { + return new CreateFlowsVaultConnectionJwt(value, 0); + } + + public static CreateFlowsVaultConnectionJwt of(CreateFlowsVaultConnectionJwtUninitialized value) { + return new CreateFlowsVaultConnectionJwt(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionJwtJwt value); + + T visit(CreateFlowsVaultConnectionJwtUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionJwt.class); + } + + @Override + public CreateFlowsVaultConnectionJwt deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionJwtJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionJwtUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtJwt.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtJwt.java new file mode 100644 index 000000000..767a34880 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtJwt.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionJwtJwt.Builder.class) +public final class CreateFlowsVaultConnectionJwtJwt { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupJwt setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionJwtJwt( + String name, String appId, FlowsVaultConnectioSetupJwt setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupJwt getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionJwtJwt && equalTo((CreateFlowsVaultConnectionJwtJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionJwtJwt other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionJwtJwt other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupJwt setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionJwtJwt build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupJwt setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionJwtJwt other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupJwt setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionJwtJwt build() { + return new CreateFlowsVaultConnectionJwtJwt(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java new file mode 100644 index 000000000..f89ebab80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionJwtUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionJwtUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionJwtUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionJwtUninitialized + && equalTo((CreateFlowsVaultConnectionJwtUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionJwtUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionJwtUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionJwtUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionJwtUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionJwtUninitialized build() { + return new CreateFlowsVaultConnectionJwtUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java new file mode 100644 index 000000000..4e65b5a51 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionMailchimp.Deserializer.class) +public final class CreateFlowsVaultConnectionMailchimp { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionMailchimp(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionMailchimpApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionMailchimpOauthCode) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionMailchimpUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailchimp + && equalTo((CreateFlowsVaultConnectionMailchimp) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionMailchimp other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionMailchimp of(CreateFlowsVaultConnectionMailchimpApiKey value) { + return new CreateFlowsVaultConnectionMailchimp(value, 0); + } + + public static CreateFlowsVaultConnectionMailchimp of(CreateFlowsVaultConnectionMailchimpOauthCode value) { + return new CreateFlowsVaultConnectionMailchimp(value, 1); + } + + public static CreateFlowsVaultConnectionMailchimp of(CreateFlowsVaultConnectionMailchimpUninitialized value) { + return new CreateFlowsVaultConnectionMailchimp(value, 2); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionMailchimpApiKey value); + + T visit(CreateFlowsVaultConnectionMailchimpOauthCode value); + + T visit(CreateFlowsVaultConnectionMailchimpUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionMailchimp.class); + } + + @Override + public CreateFlowsVaultConnectionMailchimp deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionMailchimpApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionMailchimpOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionMailchimpUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpApiKey.java new file mode 100644 index 000000000..7d045791f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpApiKey.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionMailchimpApiKey.Builder.class) +public final class CreateFlowsVaultConnectionMailchimpApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupSecretApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionMailchimpApiKey( + String name, + String appId, + FlowsVaultConnectioSetupSecretApiKey setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupSecretApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailchimpApiKey + && equalTo((CreateFlowsVaultConnectionMailchimpApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionMailchimpApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionMailchimpApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionMailchimpApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupSecretApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionMailchimpApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionMailchimpApiKey build() { + return new CreateFlowsVaultConnectionMailchimpApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java new file mode 100644 index 000000000..07fd1ea71 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionMailchimpOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionMailchimpOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionMailchimpOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailchimpOauthCode + && equalTo((CreateFlowsVaultConnectionMailchimpOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionMailchimpOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionMailchimpOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionMailchimpOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionMailchimpOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionMailchimpOauthCode build() { + return new CreateFlowsVaultConnectionMailchimpOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java new file mode 100644 index 000000000..108683c49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionMailchimpUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionMailchimpUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionMailchimpUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailchimpUninitialized + && equalTo((CreateFlowsVaultConnectionMailchimpUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionMailchimpUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionMailchimpUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionMailchimpUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionMailchimpUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionMailchimpUninitialized build() { + return new CreateFlowsVaultConnectionMailchimpUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java new file mode 100644 index 000000000..5aff8e46a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionMailjet.Deserializer.class) +public final class CreateFlowsVaultConnectionMailjet { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionMailjet(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionMailjetApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionMailjetUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailjet && equalTo((CreateFlowsVaultConnectionMailjet) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionMailjet other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionMailjet of(CreateFlowsVaultConnectionMailjetApiKey value) { + return new CreateFlowsVaultConnectionMailjet(value, 0); + } + + public static CreateFlowsVaultConnectionMailjet of(CreateFlowsVaultConnectionMailjetUninitialized value) { + return new CreateFlowsVaultConnectionMailjet(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionMailjetApiKey value); + + T visit(CreateFlowsVaultConnectionMailjetUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionMailjet.class); + } + + @Override + public CreateFlowsVaultConnectionMailjet deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionMailjetApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionMailjetUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetApiKey.java new file mode 100644 index 000000000..dd59aed6c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetApiKey.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionMailjetApiKey.Builder.class) +public final class CreateFlowsVaultConnectionMailjetApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupMailjetApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionMailjetApiKey( + String name, + String appId, + FlowsVaultConnectioSetupMailjetApiKey setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupMailjetApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailjetApiKey + && equalTo((CreateFlowsVaultConnectionMailjetApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionMailjetApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionMailjetApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupMailjetApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionMailjetApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupMailjetApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionMailjetApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupMailjetApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionMailjetApiKey build() { + return new CreateFlowsVaultConnectionMailjetApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java new file mode 100644 index 000000000..8f9e03fdc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionMailjetUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionMailjetUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionMailjetUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionMailjetUninitialized + && equalTo((CreateFlowsVaultConnectionMailjetUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionMailjetUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionMailjetUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionMailjetUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionMailjetUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionMailjetUninitialized build() { + return new CreateFlowsVaultConnectionMailjetUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java new file mode 100644 index 000000000..a775d69a1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionPipedrive.Deserializer.class) +public final class CreateFlowsVaultConnectionPipedrive { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionPipedrive(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionPipedriveToken) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionPipedriveOauthCode) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionPipedriveUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionPipedrive + && equalTo((CreateFlowsVaultConnectionPipedrive) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionPipedrive other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionPipedrive of(CreateFlowsVaultConnectionPipedriveToken value) { + return new CreateFlowsVaultConnectionPipedrive(value, 0); + } + + public static CreateFlowsVaultConnectionPipedrive of(CreateFlowsVaultConnectionPipedriveOauthCode value) { + return new CreateFlowsVaultConnectionPipedrive(value, 1); + } + + public static CreateFlowsVaultConnectionPipedrive of(CreateFlowsVaultConnectionPipedriveUninitialized value) { + return new CreateFlowsVaultConnectionPipedrive(value, 2); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionPipedriveToken value); + + T visit(CreateFlowsVaultConnectionPipedriveOauthCode value); + + T visit(CreateFlowsVaultConnectionPipedriveUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionPipedrive.class); + } + + @Override + public CreateFlowsVaultConnectionPipedrive deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionPipedriveToken.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionPipedriveOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionPipedriveUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveOauthCode.java new file mode 100644 index 000000000..61b2e50db --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionPipedriveOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionPipedriveOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionPipedriveOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionPipedriveOauthCode + && equalTo((CreateFlowsVaultConnectionPipedriveOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionPipedriveOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionPipedriveOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionPipedriveOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionPipedriveOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionPipedriveOauthCode build() { + return new CreateFlowsVaultConnectionPipedriveOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java new file mode 100644 index 000000000..ba63a4db3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionPipedriveToken.Builder.class) +public final class CreateFlowsVaultConnectionPipedriveToken { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupToken setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionPipedriveToken( + String name, String appId, FlowsVaultConnectioSetupToken setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupToken getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionPipedriveToken + && equalTo((CreateFlowsVaultConnectionPipedriveToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionPipedriveToken other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionPipedriveToken other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionPipedriveToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupToken setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionPipedriveToken other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionPipedriveToken build() { + return new CreateFlowsVaultConnectionPipedriveToken(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java new file mode 100644 index 000000000..fdd36b969 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionPipedriveUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionPipedriveUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionPipedriveUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionPipedriveUninitialized + && equalTo((CreateFlowsVaultConnectionPipedriveUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionPipedriveUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionPipedriveUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionPipedriveUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionPipedriveUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionPipedriveUninitialized build() { + return new CreateFlowsVaultConnectionPipedriveUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java new file mode 100644 index 000000000..fceaa4c19 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java @@ -0,0 +1,326 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionRequestContent.Deserializer.class) +public final class CreateFlowsVaultConnectionRequestContent { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionRequestContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionActivecampaign) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionAirtable) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionAuth0) this.value); + } else if (this.type == 3) { + return visitor.visit((CreateFlowsVaultConnectionBigquery) this.value); + } else if (this.type == 4) { + return visitor.visit((CreateFlowsVaultConnectionClearbit) this.value); + } else if (this.type == 5) { + return visitor.visit((CreateFlowsVaultConnectionDocusign) this.value); + } else if (this.type == 6) { + return visitor.visit((CreateFlowsVaultConnectionGoogleSheets) this.value); + } else if (this.type == 7) { + return visitor.visit((CreateFlowsVaultConnectionHttp) this.value); + } else if (this.type == 8) { + return visitor.visit((CreateFlowsVaultConnectionHubspot) this.value); + } else if (this.type == 9) { + return visitor.visit((CreateFlowsVaultConnectionJwt) this.value); + } else if (this.type == 10) { + return visitor.visit((CreateFlowsVaultConnectionMailchimp) this.value); + } else if (this.type == 11) { + return visitor.visit((CreateFlowsVaultConnectionMailjet) this.value); + } else if (this.type == 12) { + return visitor.visit((CreateFlowsVaultConnectionPipedrive) this.value); + } else if (this.type == 13) { + return visitor.visit((CreateFlowsVaultConnectionSalesforce) this.value); + } else if (this.type == 14) { + return visitor.visit((CreateFlowsVaultConnectionSendgrid) this.value); + } else if (this.type == 15) { + return visitor.visit((CreateFlowsVaultConnectionSlack) this.value); + } else if (this.type == 16) { + return visitor.visit((CreateFlowsVaultConnectionStripe) this.value); + } else if (this.type == 17) { + return visitor.visit((CreateFlowsVaultConnectionTelegram) this.value); + } else if (this.type == 18) { + return visitor.visit((CreateFlowsVaultConnectionTwilio) this.value); + } else if (this.type == 19) { + return visitor.visit((CreateFlowsVaultConnectionWhatsapp) this.value); + } else if (this.type == 20) { + return visitor.visit((CreateFlowsVaultConnectionZapier) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionRequestContent + && equalTo((CreateFlowsVaultConnectionRequestContent) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionRequestContent other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionActivecampaign value) { + return new CreateFlowsVaultConnectionRequestContent(value, 0); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionAirtable value) { + return new CreateFlowsVaultConnectionRequestContent(value, 1); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionAuth0 value) { + return new CreateFlowsVaultConnectionRequestContent(value, 2); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionBigquery value) { + return new CreateFlowsVaultConnectionRequestContent(value, 3); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionClearbit value) { + return new CreateFlowsVaultConnectionRequestContent(value, 4); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionDocusign value) { + return new CreateFlowsVaultConnectionRequestContent(value, 5); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionGoogleSheets value) { + return new CreateFlowsVaultConnectionRequestContent(value, 6); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionHttp value) { + return new CreateFlowsVaultConnectionRequestContent(value, 7); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionHubspot value) { + return new CreateFlowsVaultConnectionRequestContent(value, 8); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionJwt value) { + return new CreateFlowsVaultConnectionRequestContent(value, 9); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionMailchimp value) { + return new CreateFlowsVaultConnectionRequestContent(value, 10); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionMailjet value) { + return new CreateFlowsVaultConnectionRequestContent(value, 11); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionPipedrive value) { + return new CreateFlowsVaultConnectionRequestContent(value, 12); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionSalesforce value) { + return new CreateFlowsVaultConnectionRequestContent(value, 13); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionSendgrid value) { + return new CreateFlowsVaultConnectionRequestContent(value, 14); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionSlack value) { + return new CreateFlowsVaultConnectionRequestContent(value, 15); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionStripe value) { + return new CreateFlowsVaultConnectionRequestContent(value, 16); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionTelegram value) { + return new CreateFlowsVaultConnectionRequestContent(value, 17); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionTwilio value) { + return new CreateFlowsVaultConnectionRequestContent(value, 18); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionWhatsapp value) { + return new CreateFlowsVaultConnectionRequestContent(value, 19); + } + + public static CreateFlowsVaultConnectionRequestContent of(CreateFlowsVaultConnectionZapier value) { + return new CreateFlowsVaultConnectionRequestContent(value, 20); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionActivecampaign value); + + T visit(CreateFlowsVaultConnectionAirtable value); + + T visit(CreateFlowsVaultConnectionAuth0 value); + + T visit(CreateFlowsVaultConnectionBigquery value); + + T visit(CreateFlowsVaultConnectionClearbit value); + + T visit(CreateFlowsVaultConnectionDocusign value); + + T visit(CreateFlowsVaultConnectionGoogleSheets value); + + T visit(CreateFlowsVaultConnectionHttp value); + + T visit(CreateFlowsVaultConnectionHubspot value); + + T visit(CreateFlowsVaultConnectionJwt value); + + T visit(CreateFlowsVaultConnectionMailchimp value); + + T visit(CreateFlowsVaultConnectionMailjet value); + + T visit(CreateFlowsVaultConnectionPipedrive value); + + T visit(CreateFlowsVaultConnectionSalesforce value); + + T visit(CreateFlowsVaultConnectionSendgrid value); + + T visit(CreateFlowsVaultConnectionSlack value); + + T visit(CreateFlowsVaultConnectionStripe value); + + T visit(CreateFlowsVaultConnectionTelegram value); + + T visit(CreateFlowsVaultConnectionTwilio value); + + T visit(CreateFlowsVaultConnectionWhatsapp value); + + T visit(CreateFlowsVaultConnectionZapier value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionRequestContent.class); + } + + @Override + public CreateFlowsVaultConnectionRequestContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionActivecampaign.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionAirtable.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionAuth0.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionBigquery.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionClearbit.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionDocusign.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionGoogleSheets.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionHttp.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionHubspot.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionMailchimp.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionMailjet.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionPipedrive.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSalesforce.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSendgrid.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSlack.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionStripe.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionTelegram.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionTwilio.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionWhatsapp.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionZapier.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionResponseContent.java new file mode 100644 index 000000000..b2993f347 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionResponseContent.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionResponseContent.Builder.class) +public final class CreateFlowsVaultConnectionResponseContent { + private final String id; + + private final String appId; + + private final Optional environment; + + private final String name; + + private final Optional accountName; + + private final boolean ready; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional refreshedAt; + + private final String fingerprint; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionResponseContent( + String id, + String appId, + Optional environment, + String name, + Optional accountName, + boolean ready, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional refreshedAt, + String fingerprint, + Map additionalProperties) { + this.id = id; + this.appId = appId; + this.environment = environment; + this.name = name; + this.accountName = accountName; + this.ready = ready; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.refreshedAt = refreshedAt; + this.fingerprint = fingerprint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Flows Vault Connection app identifier. + */ + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + /** + * @return Flows Vault Connection environment. + */ + @JsonProperty("environment") + public Optional getEnvironment() { + return environment; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Flows Vault Connection custom account name. + */ + @JsonProperty("account_name") + public Optional getAccountName() { + return accountName; + } + + /** + * @return Whether the Flows Vault Connection is configured. + */ + @JsonProperty("ready") + public boolean getReady() { + return ready; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + */ + @JsonProperty("refreshed_at") + public Optional getRefreshedAt() { + return refreshedAt; + } + + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionResponseContent + && equalTo((CreateFlowsVaultConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionResponseContent other) { + return id.equals(other.id) + && appId.equals(other.appId) + && environment.equals(other.environment) + && name.equals(other.name) + && accountName.equals(other.accountName) + && ready == other.ready + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && refreshedAt.equals(other.refreshedAt) + && fingerprint.equals(other.fingerprint); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.appId, + this.environment, + this.name, + this.accountName, + this.ready, + this.createdAt, + this.updatedAt, + this.refreshedAt, + this.fingerprint); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flows Vault Connection identifier.

+ */ + AppIdStage id(@NotNull String id); + + Builder from(CreateFlowsVaultConnectionResponseContent other); + } + + public interface AppIdStage { + /** + *

Flows Vault Connection app identifier.

+ */ + NameStage appId(@NotNull String appId); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + ReadyStage name(@NotNull String name); + } + + public interface ReadyStage { + /** + *

Whether the Flows Vault Connection is configured.

+ */ + CreatedAtStage ready(boolean ready); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ */ + FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface FingerprintStage { + _FinalStage fingerprint(@NotNull String fingerprint); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionResponseContent build(); + + /** + *

Flows Vault Connection environment.

+ */ + _FinalStage environment(Optional environment); + + _FinalStage environment(String environment); + + /** + *

Flows Vault Connection custom account name.

+ */ + _FinalStage accountName(Optional accountName); + + _FinalStage accountName(String accountName); + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + _FinalStage refreshedAt(Optional refreshedAt); + + _FinalStage refreshedAt(OffsetDateTime refreshedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + AppIdStage, + NameStage, + ReadyStage, + CreatedAtStage, + UpdatedAtStage, + FingerprintStage, + _FinalStage { + private String id; + + private String appId; + + private String name; + + private boolean ready; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String fingerprint; + + private Optional refreshedAt = Optional.empty(); + + private Optional accountName = Optional.empty(); + + private Optional environment = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionResponseContent other) { + id(other.getId()); + appId(other.getAppId()); + environment(other.getEnvironment()); + name(other.getName()); + accountName(other.getAccountName()); + ready(other.getReady()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + refreshedAt(other.getRefreshedAt()); + fingerprint(other.getFingerprint()); + return this; + } + + /** + *

Flows Vault Connection identifier.

+ *

Flows Vault Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public AppIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Flows Vault Connection app identifier.

+ *

Flows Vault Connection app identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("app_id") + public NameStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public ReadyStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Whether the Flows Vault Connection is configured.

+ *

Whether the Flows Vault Connection is configured.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("ready") + public CreatedAtStage ready(boolean ready) { + this.ready = ready; + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @Override + @JsonSetter("fingerprint") + public _FinalStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { + this.refreshedAt = Optional.ofNullable(refreshedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + @Override + @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) + public _FinalStage refreshedAt(Optional refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ */ + @Override + @JsonSetter(value = "account_name", nulls = Nulls.SKIP) + public _FinalStage accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + /** + *

Flows Vault Connection environment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage environment(String environment) { + this.environment = Optional.ofNullable(environment); + return this; + } + + /** + *

Flows Vault Connection environment.

+ */ + @Override + @JsonSetter(value = "environment", nulls = Nulls.SKIP) + public _FinalStage environment(Optional environment) { + this.environment = environment; + return this; + } + + @Override + public CreateFlowsVaultConnectionResponseContent build() { + return new CreateFlowsVaultConnectionResponseContent( + id, + appId, + environment, + name, + accountName, + ready, + createdAt, + updatedAt, + refreshedAt, + fingerprint, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java new file mode 100644 index 000000000..d2467a776 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionSalesforce.Deserializer.class) +public final class CreateFlowsVaultConnectionSalesforce { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionSalesforce(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionSalesforceOauthCode) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionSalesforceUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSalesforce + && equalTo((CreateFlowsVaultConnectionSalesforce) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionSalesforce other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionSalesforce of(CreateFlowsVaultConnectionSalesforceOauthCode value) { + return new CreateFlowsVaultConnectionSalesforce(value, 0); + } + + public static CreateFlowsVaultConnectionSalesforce of(CreateFlowsVaultConnectionSalesforceUninitialized value) { + return new CreateFlowsVaultConnectionSalesforce(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionSalesforceOauthCode value); + + T visit(CreateFlowsVaultConnectionSalesforceUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionSalesforce.class); + } + + @Override + public CreateFlowsVaultConnectionSalesforce deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionSalesforceOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionSalesforceUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceOauthCode.java new file mode 100644 index 000000000..1a77b4465 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSalesforceOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionSalesforceOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSalesforceOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSalesforceOauthCode + && equalTo((CreateFlowsVaultConnectionSalesforceOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSalesforceOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSalesforceOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSalesforceOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSalesforceOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSalesforceOauthCode build() { + return new CreateFlowsVaultConnectionSalesforceOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java new file mode 100644 index 000000000..8ec7b7051 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSalesforceUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionSalesforceUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSalesforceUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSalesforceUninitialized + && equalTo((CreateFlowsVaultConnectionSalesforceUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSalesforceUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSalesforceUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSalesforceUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSalesforceUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSalesforceUninitialized build() { + return new CreateFlowsVaultConnectionSalesforceUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java new file mode 100644 index 000000000..18bc27a46 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionSendgrid.Deserializer.class) +public final class CreateFlowsVaultConnectionSendgrid { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionSendgrid(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionSendgridApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionSendgridUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSendgrid + && equalTo((CreateFlowsVaultConnectionSendgrid) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionSendgrid other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionSendgrid of(CreateFlowsVaultConnectionSendgridApiKey value) { + return new CreateFlowsVaultConnectionSendgrid(value, 0); + } + + public static CreateFlowsVaultConnectionSendgrid of(CreateFlowsVaultConnectionSendgridUninitialized value) { + return new CreateFlowsVaultConnectionSendgrid(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionSendgridApiKey value); + + T visit(CreateFlowsVaultConnectionSendgridUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionSendgrid.class); + } + + @Override + public CreateFlowsVaultConnectionSendgrid deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSendgridApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionSendgridUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridApiKey.java new file mode 100644 index 000000000..66af20d30 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridApiKey.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSendgridApiKey.Builder.class) +public final class CreateFlowsVaultConnectionSendgridApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSendgridApiKey( + String name, String appId, FlowsVaultConnectioSetupApiKey setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSendgridApiKey + && equalTo((CreateFlowsVaultConnectionSendgridApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSendgridApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSendgridApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSendgridApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSendgridApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSendgridApiKey build() { + return new CreateFlowsVaultConnectionSendgridApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java new file mode 100644 index 000000000..163824ebd --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSendgridUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionSendgridUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSendgridUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSendgridUninitialized + && equalTo((CreateFlowsVaultConnectionSendgridUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSendgridUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSendgridUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSendgridUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSendgridUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSendgridUninitialized build() { + return new CreateFlowsVaultConnectionSendgridUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java new file mode 100644 index 000000000..558bb8335 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionSlack.Deserializer.class) +public final class CreateFlowsVaultConnectionSlack { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionSlack(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionSlackWebhook) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionSlackOauthCode) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionSlackUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSlack && equalTo((CreateFlowsVaultConnectionSlack) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionSlack other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionSlack of(CreateFlowsVaultConnectionSlackWebhook value) { + return new CreateFlowsVaultConnectionSlack(value, 0); + } + + public static CreateFlowsVaultConnectionSlack of(CreateFlowsVaultConnectionSlackOauthCode value) { + return new CreateFlowsVaultConnectionSlack(value, 1); + } + + public static CreateFlowsVaultConnectionSlack of(CreateFlowsVaultConnectionSlackUninitialized value) { + return new CreateFlowsVaultConnectionSlack(value, 2); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionSlackWebhook value); + + T visit(CreateFlowsVaultConnectionSlackOauthCode value); + + T visit(CreateFlowsVaultConnectionSlackUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionSlack.class); + } + + @Override + public CreateFlowsVaultConnectionSlack deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSlackWebhook.class)); + } catch (RuntimeException e) { + } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionSlackOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionSlackUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackOauthCode.java new file mode 100644 index 000000000..1725357cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSlackOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionSlackOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSlackOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSlackOauthCode + && equalTo((CreateFlowsVaultConnectionSlackOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSlackOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSlackOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSlackOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSlackOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSlackOauthCode build() { + return new CreateFlowsVaultConnectionSlackOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java new file mode 100644 index 000000000..af5056c40 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSlackUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionSlackUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSlackUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSlackUninitialized + && equalTo((CreateFlowsVaultConnectionSlackUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSlackUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSlackUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSlackUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSlackUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSlackUninitialized build() { + return new CreateFlowsVaultConnectionSlackUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java new file mode 100644 index 000000000..08dc1d930 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionSlackWebhook.Builder.class) +public final class CreateFlowsVaultConnectionSlackWebhook { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupWebhook setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionSlackWebhook( + String name, + String appId, + FlowsVaultConnectioSetupWebhook setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupWebhook getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionSlackWebhook + && equalTo((CreateFlowsVaultConnectionSlackWebhook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionSlackWebhook other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionSlackWebhook other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionSlackWebhook build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupWebhook setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionSlackWebhook other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionSlackWebhook build() { + return new CreateFlowsVaultConnectionSlackWebhook(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java new file mode 100644 index 000000000..372b42ac4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionStripe.Deserializer.class) +public final class CreateFlowsVaultConnectionStripe { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionStripe(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionStripeKeyPair) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionStripeOauthCode) this.value); + } else if (this.type == 2) { + return visitor.visit((CreateFlowsVaultConnectionStripeUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionStripe && equalTo((CreateFlowsVaultConnectionStripe) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionStripe other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionStripe of(CreateFlowsVaultConnectionStripeKeyPair value) { + return new CreateFlowsVaultConnectionStripe(value, 0); + } + + public static CreateFlowsVaultConnectionStripe of(CreateFlowsVaultConnectionStripeOauthCode value) { + return new CreateFlowsVaultConnectionStripe(value, 1); + } + + public static CreateFlowsVaultConnectionStripe of(CreateFlowsVaultConnectionStripeUninitialized value) { + return new CreateFlowsVaultConnectionStripe(value, 2); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionStripeKeyPair value); + + T visit(CreateFlowsVaultConnectionStripeOauthCode value); + + T visit(CreateFlowsVaultConnectionStripeUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionStripe.class); + } + + @Override + public CreateFlowsVaultConnectionStripe deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionStripeKeyPair.class)); + } catch (RuntimeException e) { + } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionStripeOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionStripeUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeKeyPair.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeKeyPair.java new file mode 100644 index 000000000..3654b0461 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeKeyPair.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionStripeKeyPair.Builder.class) +public final class CreateFlowsVaultConnectionStripeKeyPair { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupStripeKeyPair setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionStripeKeyPair( + String name, + String appId, + FlowsVaultConnectioSetupStripeKeyPair setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupStripeKeyPair getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionStripeKeyPair + && equalTo((CreateFlowsVaultConnectionStripeKeyPair) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionStripeKeyPair other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionStripeKeyPair other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupStripeKeyPair setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionStripeKeyPair build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupStripeKeyPair setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionStripeKeyPair other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupStripeKeyPair setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionStripeKeyPair build() { + return new CreateFlowsVaultConnectionStripeKeyPair(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java new file mode 100644 index 000000000..e45246ad5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionStripeOauthCode.Builder.class) +public final class CreateFlowsVaultConnectionStripeOauthCode { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupOauthCode setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionStripeOauthCode( + String name, + String appId, + FlowsVaultConnectioSetupOauthCode setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupOauthCode getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionStripeOauthCode + && equalTo((CreateFlowsVaultConnectionStripeOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionStripeOauthCode other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionStripeOauthCode other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionStripeOauthCode build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupOauthCode setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionStripeOauthCode other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionStripeOauthCode build() { + return new CreateFlowsVaultConnectionStripeOauthCode(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java new file mode 100644 index 000000000..775db4e31 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionStripeUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionStripeUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionStripeUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionStripeUninitialized + && equalTo((CreateFlowsVaultConnectionStripeUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionStripeUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionStripeUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionStripeUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionStripeUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionStripeUninitialized build() { + return new CreateFlowsVaultConnectionStripeUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java new file mode 100644 index 000000000..481eafd09 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionTelegram.Deserializer.class) +public final class CreateFlowsVaultConnectionTelegram { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionTelegram(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionTelegramToken) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionTelegramUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTelegram + && equalTo((CreateFlowsVaultConnectionTelegram) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionTelegram other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionTelegram of(CreateFlowsVaultConnectionTelegramToken value) { + return new CreateFlowsVaultConnectionTelegram(value, 0); + } + + public static CreateFlowsVaultConnectionTelegram of(CreateFlowsVaultConnectionTelegramUninitialized value) { + return new CreateFlowsVaultConnectionTelegram(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionTelegramToken value); + + T visit(CreateFlowsVaultConnectionTelegramUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionTelegram.class); + } + + @Override + public CreateFlowsVaultConnectionTelegram deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionTelegramToken.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionTelegramUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramToken.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramToken.java new file mode 100644 index 000000000..44f6ffe78 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramToken.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionTelegramToken.Builder.class) +public final class CreateFlowsVaultConnectionTelegramToken { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupToken setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionTelegramToken( + String name, String appId, FlowsVaultConnectioSetupToken setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupToken getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTelegramToken + && equalTo((CreateFlowsVaultConnectionTelegramToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionTelegramToken other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionTelegramToken other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionTelegramToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupToken setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionTelegramToken other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionTelegramToken build() { + return new CreateFlowsVaultConnectionTelegramToken(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java new file mode 100644 index 000000000..b381fd573 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionTelegramUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionTelegramUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionTelegramUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTelegramUninitialized + && equalTo((CreateFlowsVaultConnectionTelegramUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionTelegramUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionTelegramUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionTelegramUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionTelegramUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionTelegramUninitialized build() { + return new CreateFlowsVaultConnectionTelegramUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java new file mode 100644 index 000000000..f1108224b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionTwilio.Deserializer.class) +public final class CreateFlowsVaultConnectionTwilio { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionTwilio(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionTwilioApiKey) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionTwilioUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTwilio && equalTo((CreateFlowsVaultConnectionTwilio) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionTwilio other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionTwilio of(CreateFlowsVaultConnectionTwilioApiKey value) { + return new CreateFlowsVaultConnectionTwilio(value, 0); + } + + public static CreateFlowsVaultConnectionTwilio of(CreateFlowsVaultConnectionTwilioUninitialized value) { + return new CreateFlowsVaultConnectionTwilio(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionTwilioApiKey value); + + T visit(CreateFlowsVaultConnectionTwilioUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionTwilio.class); + } + + @Override + public CreateFlowsVaultConnectionTwilio deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionTwilioApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionTwilioUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioApiKey.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioApiKey.java new file mode 100644 index 000000000..77a40e973 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioApiKey.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionTwilioApiKey.Builder.class) +public final class CreateFlowsVaultConnectionTwilioApiKey { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupTwilioApiKey setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionTwilioApiKey( + String name, + String appId, + FlowsVaultConnectioSetupTwilioApiKey setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupTwilioApiKey getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTwilioApiKey + && equalTo((CreateFlowsVaultConnectionTwilioApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionTwilioApiKey other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionTwilioApiKey other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupTwilioApiKey setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionTwilioApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupTwilioApiKey setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionTwilioApiKey other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupTwilioApiKey setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionTwilioApiKey build() { + return new CreateFlowsVaultConnectionTwilioApiKey(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java new file mode 100644 index 000000000..f4fe65745 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionTwilioUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionTwilioUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionTwilioUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionTwilioUninitialized + && equalTo((CreateFlowsVaultConnectionTwilioUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionTwilioUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionTwilioUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionTwilioUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionTwilioUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionTwilioUninitialized build() { + return new CreateFlowsVaultConnectionTwilioUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java new file mode 100644 index 000000000..96f9abe9c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionWhatsapp.Deserializer.class) +public final class CreateFlowsVaultConnectionWhatsapp { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionWhatsapp(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionWhatsappToken) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionWhatsappUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionWhatsapp + && equalTo((CreateFlowsVaultConnectionWhatsapp) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionWhatsapp other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionWhatsapp of(CreateFlowsVaultConnectionWhatsappToken value) { + return new CreateFlowsVaultConnectionWhatsapp(value, 0); + } + + public static CreateFlowsVaultConnectionWhatsapp of(CreateFlowsVaultConnectionWhatsappUninitialized value) { + return new CreateFlowsVaultConnectionWhatsapp(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionWhatsappToken value); + + T visit(CreateFlowsVaultConnectionWhatsappUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionWhatsapp.class); + } + + @Override + public CreateFlowsVaultConnectionWhatsapp deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionWhatsappToken.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionWhatsappUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappToken.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappToken.java new file mode 100644 index 000000000..055c9a197 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappToken.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionWhatsappToken.Builder.class) +public final class CreateFlowsVaultConnectionWhatsappToken { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupToken setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionWhatsappToken( + String name, String appId, FlowsVaultConnectioSetupToken setup, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupToken getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionWhatsappToken + && equalTo((CreateFlowsVaultConnectionWhatsappToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionWhatsappToken other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionWhatsappToken other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionWhatsappToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupToken setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionWhatsappToken other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionWhatsappToken build() { + return new CreateFlowsVaultConnectionWhatsappToken(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java new file mode 100644 index 000000000..f08df51af --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionWhatsappUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionWhatsappUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionWhatsappUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionWhatsappUninitialized + && equalTo((CreateFlowsVaultConnectionWhatsappUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionWhatsappUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionWhatsappUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionWhatsappUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionWhatsappUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionWhatsappUninitialized build() { + return new CreateFlowsVaultConnectionWhatsappUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java new file mode 100644 index 000000000..b6c9a39b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreateFlowsVaultConnectionZapier.Deserializer.class) +public final class CreateFlowsVaultConnectionZapier { + private final Object value; + + private final int type; + + private CreateFlowsVaultConnectionZapier(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CreateFlowsVaultConnectionZapierWebhook) this.value); + } else if (this.type == 1) { + return visitor.visit((CreateFlowsVaultConnectionZapierUninitialized) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionZapier && equalTo((CreateFlowsVaultConnectionZapier) other); + } + + private boolean equalTo(CreateFlowsVaultConnectionZapier other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreateFlowsVaultConnectionZapier of(CreateFlowsVaultConnectionZapierWebhook value) { + return new CreateFlowsVaultConnectionZapier(value, 0); + } + + public static CreateFlowsVaultConnectionZapier of(CreateFlowsVaultConnectionZapierUninitialized value) { + return new CreateFlowsVaultConnectionZapier(value, 1); + } + + public interface Visitor { + T visit(CreateFlowsVaultConnectionZapierWebhook value); + + T visit(CreateFlowsVaultConnectionZapierUninitialized value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateFlowsVaultConnectionZapier.class); + } + + @Override + public CreateFlowsVaultConnectionZapier deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreateFlowsVaultConnectionZapierWebhook.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, CreateFlowsVaultConnectionZapierUninitialized.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierUninitialized.java new file mode 100644 index 000000000..2c8b5edb1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierUninitialized.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionZapierUninitialized.Builder.class) +public final class CreateFlowsVaultConnectionZapierUninitialized { + private final String name; + + private final String appId; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionZapierUninitialized( + String name, String appId, Map additionalProperties) { + this.name = name; + this.appId = appId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionZapierUninitialized + && equalTo((CreateFlowsVaultConnectionZapierUninitialized) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionZapierUninitialized other) { + return name.equals(other.name) && appId.equals(other.appId); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionZapierUninitialized other); + } + + public interface AppIdStage { + _FinalStage appId(@NotNull String appId); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionZapierUninitialized build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, _FinalStage { + private String name; + + private String appId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionZapierUninitialized other) { + name(other.getName()); + appId(other.getAppId()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public _FinalStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionZapierUninitialized build() { + return new CreateFlowsVaultConnectionZapierUninitialized(name, appId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java new file mode 100644 index 000000000..93c67785a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFlowsVaultConnectionZapierWebhook.Builder.class) +public final class CreateFlowsVaultConnectionZapierWebhook { + private final String name; + + private final String appId; + + private final FlowsVaultConnectioSetupWebhook setup; + + private final Map additionalProperties; + + private CreateFlowsVaultConnectionZapierWebhook( + String name, + String appId, + FlowsVaultConnectioSetupWebhook setup, + Map additionalProperties) { + this.name = name; + this.appId = appId; + this.setup = setup; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + @JsonProperty("setup") + public FlowsVaultConnectioSetupWebhook getSetup() { + return setup; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFlowsVaultConnectionZapierWebhook + && equalTo((CreateFlowsVaultConnectionZapierWebhook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFlowsVaultConnectionZapierWebhook other) { + return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.appId, this.setup); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + AppIdStage name(@NotNull String name); + + Builder from(CreateFlowsVaultConnectionZapierWebhook other); + } + + public interface AppIdStage { + SetupStage appId(@NotNull String appId); + } + + public interface SetupStage { + _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup); + } + + public interface _FinalStage { + CreateFlowsVaultConnectionZapierWebhook build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, AppIdStage, SetupStage, _FinalStage { + private String name; + + private String appId; + + private FlowsVaultConnectioSetupWebhook setup; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateFlowsVaultConnectionZapierWebhook other) { + name(other.getName()); + appId(other.getAppId()); + setup(other.getSetup()); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public AppIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + @JsonSetter("app_id") + public SetupStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + @Override + @JsonSetter("setup") + public _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup) { + this.setup = Objects.requireNonNull(setup, "setup must not be null"); + return this; + } + + @Override + public CreateFlowsVaultConnectionZapierWebhook build() { + return new CreateFlowsVaultConnectionZapierWebhook(name, appId, setup, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java index e608526f1..cfd6f975d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java @@ -28,7 +28,7 @@ public final class CreateFormRequestContent { private final Optional languages; - private final Optional> translations; + private final Optional>> translations; private final Optional> nodes; @@ -44,7 +44,7 @@ private CreateFormRequestContent( String name, Optional messages, Optional languages, - Optional> translations, + Optional>> translations, Optional> nodes, Optional start, Optional ending, @@ -77,7 +77,7 @@ public Optional getLanguages() { } @JsonProperty("translations") - public Optional> getTranslations() { + public Optional>> getTranslations() { return translations; } @@ -101,7 +101,7 @@ public Optional getStyle() { return style; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFormRequestContent && equalTo((CreateFormRequestContent) other); @@ -123,7 +123,7 @@ private boolean equalTo(CreateFormRequestContent other) { && style.equals(other.style); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -136,7 +136,7 @@ public int hashCode() { this.style); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -162,9 +162,9 @@ public interface _FinalStage { _FinalStage languages(FormLanguages languages); - _FinalStage translations(Optional> translations); + _FinalStage translations(Optional>> translations); - _FinalStage translations(Map translations); + _FinalStage translations(Map> translations); _FinalStage nodes(Optional> nodes); @@ -195,7 +195,7 @@ public static final class Builder implements NameStage, _FinalStage { private Optional> nodes = Optional.empty(); - private Optional> translations = Optional.empty(); + private Optional>> translations = Optional.empty(); private Optional languages = Optional.empty(); @@ -206,7 +206,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateFormRequestContent other) { name(other.getName()); messages(other.getMessages()); @@ -219,105 +219,105 @@ public Builder from(CreateFormRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @java.lang.Override + @Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @java.lang.Override + @Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @java.lang.Override + @Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @java.lang.Override + @Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @java.lang.Override + @Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @java.lang.Override + @Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @java.lang.Override - public _FinalStage translations(Map translations) { + @Override + public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) - public _FinalStage translations(Optional> translations) { + public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @java.lang.Override + @Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @java.lang.Override + @Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @java.lang.Override + @Override public CreateFormRequestContent build() { return new CreateFormRequestContent( name, messages, languages, translations, nodes, start, ending, style, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java index 70b36ca87..85baae859 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java @@ -31,7 +31,7 @@ public final class CreateFormResponseContent { private final Optional languages; - private final Optional> translations; + private final Optional>> translations; private final Optional> nodes; @@ -56,7 +56,7 @@ private CreateFormResponseContent( String name, Optional messages, Optional languages, - Optional> translations, + Optional>> translations, Optional> nodes, Optional start, Optional ending, @@ -103,7 +103,7 @@ public Optional getLanguages() { } @JsonProperty("translations") - public Optional> getTranslations() { + public Optional>> getTranslations() { return translations; } @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFormResponseContent && equalTo((CreateFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(CreateFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -230,9 +230,9 @@ public interface _FinalStage { _FinalStage languages(FormLanguages languages); - _FinalStage translations(Optional> translations); + _FinalStage translations(Optional>> translations); - _FinalStage translations(Map translations); + _FinalStage translations(Map> translations); _FinalStage nodes(Optional> nodes); @@ -281,7 +281,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Optional> nodes = Optional.empty(); - private Optional> translations = Optional.empty(); + private Optional>> translations = Optional.empty(); private Optional languages = Optional.empty(); @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(CreateFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(CreateFormResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @java.lang.Override + @Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @java.lang.Override + @Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @java.lang.Override + @Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @java.lang.Override + @Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @java.lang.Override + @Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @java.lang.Override + @Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @java.lang.Override + @Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @java.lang.Override + @Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @java.lang.Override - public _FinalStage translations(Map translations) { + @Override + public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) - public _FinalStage translations(Optional> translations) { + public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @java.lang.Override + @Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @java.lang.Override + @Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @java.lang.Override + @Override public CreateFormResponseContent build() { return new CreateFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java index 709085672..8e555eb58 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java @@ -49,7 +49,7 @@ public Optional getTicketUrl() { return ticketUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateGuardianEnrollmentTicketResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(CreateGuardianEnrollmentTicketResponseContent other) { return ticketId.equals(other.ticketId) && ticketUrl.equals(other.ticketUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ticketId, this.ticketUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java index 5bcabe8a0..e559b1856 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java @@ -27,7 +27,7 @@ public final class CreateHookRequestContent { private final Optional enabled; - private final Optional> dependencies; + private final Optional> dependencies; private final HookTriggerIdEnum triggerId; @@ -37,7 +37,7 @@ private CreateHookRequestContent( String name, String script, Optional enabled, - Optional> dependencies, + Optional> dependencies, HookTriggerIdEnum triggerId, Map additionalProperties) { this.name = name; @@ -73,7 +73,7 @@ public Optional getEnabled() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } @@ -82,7 +82,7 @@ public HookTriggerIdEnum getTriggerId() { return triggerId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateHookRequestContent && equalTo((CreateHookRequestContent) other); @@ -101,12 +101,12 @@ private boolean equalTo(CreateHookRequestContent other) { && triggerId.equals(other.triggerId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.script, this.enabled, this.dependencies, this.triggerId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -145,9 +145,9 @@ public interface _FinalStage { _FinalStage enabled(Boolean enabled); - _FinalStage dependencies(Optional> dependencies); + _FinalStage dependencies(Optional> dependencies); - _FinalStage dependencies(Map dependencies); + _FinalStage dependencies(Map dependencies); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -158,7 +158,7 @@ public static final class Builder implements NameStage, ScriptStage, TriggerIdSt private HookTriggerIdEnum triggerId; - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); private Optional enabled = Optional.empty(); @@ -167,7 +167,7 @@ public static final class Builder implements NameStage, ScriptStage, TriggerIdSt private Builder() {} - @java.lang.Override + @Override public Builder from(CreateHookRequestContent other) { name(other.getName()); script(other.getScript()); @@ -182,7 +182,7 @@ public Builder from(CreateHookRequestContent other) { *

Name of this hook.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public ScriptStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -194,29 +194,29 @@ public ScriptStage name(@NotNull String name) { *

Code to be executed when this hook runs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("script") public TriggerIdStage script(@NotNull String script) { this.script = Objects.requireNonNull(script, "script must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("triggerId") public _FinalStage triggerId(@NotNull HookTriggerIdEnum triggerId) { this.triggerId = Objects.requireNonNull(triggerId, "triggerId must not be null"); return this; } - @java.lang.Override - public _FinalStage dependencies(Map dependencies) { + @Override + public _FinalStage dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } - @java.lang.Override + @Override @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public _FinalStage dependencies(Optional> dependencies) { + public _FinalStage dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } @@ -225,7 +225,7 @@ public _FinalStage dependencies(Optional> dependencies) { *

Whether this hook will be executed (true) or ignored (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -234,14 +234,14 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether this hook will be executed (true) or ignored (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; return this; } - @java.lang.Override + @Override public CreateHookRequestContent build() { return new CreateHookRequestContent(name, script, enabled, dependencies, triggerId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java index 43c85c54d..2eaeb3137 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java @@ -30,7 +30,7 @@ public final class CreateHookResponseContent { private final Optional script; - private final Optional> dependencies; + private final Optional> dependencies; private final Map additionalProperties; @@ -40,7 +40,7 @@ private CreateHookResponseContent( Optional name, Optional enabled, Optional script, - Optional> dependencies, + Optional> dependencies, Map additionalProperties) { this.triggerId = triggerId; this.id = id; @@ -92,11 +92,11 @@ public Optional getScript() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateHookResponseContent && equalTo((CreateHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(CreateHookResponseContent other) { && dependencies.equals(other.dependencies); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -142,7 +142,7 @@ public static final class Builder { private Optional script = Optional.empty(); - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -230,12 +230,12 @@ public Builder script(String script) { } @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional> dependencies) { + public Builder dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } - public Builder dependencies(Map dependencies) { + public Builder dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java index f74fce543..151b35943 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java @@ -100,7 +100,7 @@ public Optional getExternalId() { return externalId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateImportUsersResponseContent && equalTo((CreateImportUsersResponseContent) other); @@ -120,12 +120,12 @@ private boolean equalTo(CreateImportUsersResponseContent other) { && externalId.equals(other.externalId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.externalId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -202,7 +202,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateImportUsersResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -218,7 +218,7 @@ public Builder from(CreateImportUsersResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -230,7 +230,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("type") public CreatedAtStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -242,7 +242,7 @@ public CreatedAtStage type(@NotNull String type) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public IdStage createdAt(@NotNull String createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -254,7 +254,7 @@ public IdStage createdAt(@NotNull String createdAt) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public ConnectionIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -266,7 +266,7 @@ public ConnectionIdStage id(@NotNull String id) { *

connection_id of the connection to which users will be imported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -277,7 +277,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Customer-defined ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage externalId(String externalId) { this.externalId = Optional.ofNullable(externalId); return this; @@ -286,14 +286,14 @@ public _FinalStage externalId(String externalId) { /** *

Customer-defined ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "external_id", nulls = Nulls.SKIP) public _FinalStage externalId(Optional externalId) { this.externalId = externalId; return this; } - @java.lang.Override + @Override public CreateImportUsersResponseContent build() { return new CreateImportUsersResponseContent( status, type, createdAt, id, connectionId, externalId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java index 5beac4614..85b1857cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamDatadogRequestBody && equalTo((CreateLogStreamDatadogRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamDatadogRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamDatadogRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamDatadogRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamDatadogSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamDatadogSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamDatadogRequestBody build() { return new CreateLogStreamDatadogRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java index e291a4bd1..041e86e81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamEventBridgeRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamEventBridgeRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamEventBridgeRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamEventBridgeRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamEventBridgeSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamEventBridgeSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamEventBridgeRequestBody build() { return new CreateLogStreamEventBridgeRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java index d71fc53eb..ce09a7301 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamEventGridRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamEventGridRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamEventGridRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamEventGridRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamEventGridSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamEventGridSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamEventGridRequestBody build() { return new CreateLogStreamEventGridRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java index 55eb0e982..2de4abd99 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamHttpRequestBody && equalTo((CreateLogStreamHttpRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamHttpRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamHttpRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamHttpRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamHttpSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamHttpSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamHttpRequestBody build() { return new CreateLogStreamHttpRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java index 03713fb22..fa688a5d3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamMixpanelRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamMixpanelRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamMixpanelRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamMixpanelRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamMixpanelSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamMixpanelSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamMixpanelRequestBody build() { return new CreateLogStreamMixpanelRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java index 00e507c5d..6839422e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamRequestContent && equalTo((CreateLogStreamRequestContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(CreateLogStreamRequestContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamResponseContent && equalTo((CreateLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(CreateLogStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSegmentRequestBody && equalTo((CreateLogStreamSegmentRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSegmentRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamSegmentRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSegmentRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamSegmentRequestBody build() { return new CreateLogStreamSegmentRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java index e43f99ad0..132068841 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSplunkRequestBody && equalTo((CreateLogStreamSplunkRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSplunkRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamSplunkRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSplunkRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSplunkSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSplunkSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamSplunkRequestBody build() { return new CreateLogStreamSplunkRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java index a6bcc06a3..10d74d864 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSumoRequestBody && equalTo((CreateLogStreamSumoRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSumoRequestBody other) { && startFrom.equals(other.startFrom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateLogStreamSumoRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSumoRequestBody other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSumoSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSumoSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @java.lang.Override + @Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @java.lang.Override + @Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @java.lang.Override + @Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @java.lang.Override + @Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @java.lang.Override + @Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateLogStreamSumoRequestBody build() { return new CreateLogStreamSumoRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java index 992ec4de3..af2fbcdac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java @@ -68,7 +68,7 @@ public NetworkAclRule getRule() { return rule; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateNetworkAclRequestContent && equalTo((CreateNetworkAclRequestContent) other); @@ -86,12 +86,12 @@ private boolean equalTo(CreateNetworkAclRequestContent other) { && rule.equals(other.rule); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements DescriptionStage, ActiveStage, Prio private Builder() {} - @java.lang.Override + @Override public Builder from(CreateNetworkAclRequestContent other) { description(other.getDescription()); active(other.getActive()); @@ -152,7 +152,7 @@ public Builder from(CreateNetworkAclRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("description") public ActiveStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -164,7 +164,7 @@ public ActiveStage description(@NotNull String description) { *

Indicates whether or not this access control list is actively being used

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("active") public PriorityStage active(boolean active) { this.active = active; @@ -176,21 +176,21 @@ public PriorityStage active(boolean active) { *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("priority") public RuleStage priority(double priority) { this.priority = priority; return this; } - @java.lang.Override + @Override @JsonSetter("rule") public _FinalStage rule(@NotNull NetworkAclRule rule) { this.rule = Objects.requireNonNull(rule, "rule must not be null"); return this; } - @java.lang.Override + @Override public CreateNetworkAclRequestContent build() { return new CreateNetworkAclRequestContent(description, active, priority, rule, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java new file mode 100644 index 000000000..b24af3292 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationDiscoveryDomainResponseContent.Builder.class) +public final class CreateOrganizationDiscoveryDomainResponseContent { + private final String id; + + private final String domain; + + private final OrganizationDiscoveryDomainStatus status; + + private final String verificationTxt; + + private final String verificationHost; + + private final Map additionalProperties; + + private CreateOrganizationDiscoveryDomainResponseContent( + String id, + String domain, + OrganizationDiscoveryDomainStatus status, + String verificationTxt, + String verificationHost, + Map additionalProperties) { + this.id = id; + this.domain = domain; + this.status = status; + this.verificationTxt = verificationTxt; + this.verificationHost = verificationHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization discovery domain identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public OrganizationDiscoveryDomainStatus getStatus() { + return status; + } + + /** + * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. + */ + @JsonProperty("verification_txt") + public String getVerificationTxt() { + return verificationTxt; + } + + /** + * @return The full domain where the TXT record should be added. + */ + @JsonProperty("verification_host") + public String getVerificationHost() { + return verificationHost; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationDiscoveryDomainResponseContent + && equalTo((CreateOrganizationDiscoveryDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationDiscoveryDomainResponseContent other) { + return id.equals(other.id) + && domain.equals(other.domain) + && status.equals(other.status) + && verificationTxt.equals(other.verificationTxt) + && verificationHost.equals(other.verificationHost); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization discovery domain identifier.

+ */ + DomainStage id(@NotNull String id); + + Builder from(CreateOrganizationDiscoveryDomainResponseContent other); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + StatusStage domain(@NotNull String domain); + } + + public interface StatusStage { + VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status); + } + + public interface VerificationTxtStage { + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ */ + VerificationHostStage verificationTxt(@NotNull String verificationTxt); + } + + public interface VerificationHostStage { + /** + *

The full domain where the TXT record should be added.

+ */ + _FinalStage verificationHost(@NotNull String verificationHost); + } + + public interface _FinalStage { + CreateOrganizationDiscoveryDomainResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, DomainStage, StatusStage, VerificationTxtStage, VerificationHostStage, _FinalStage { + private String id; + + private String domain; + + private OrganizationDiscoveryDomainStatus status; + + private String verificationTxt; + + private String verificationHost; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateOrganizationDiscoveryDomainResponseContent other) { + id(other.getId()); + domain(other.getDomain()); + status(other.getStatus()); + verificationTxt(other.getVerificationTxt()); + verificationHost(other.getVerificationHost()); + return this; + } + + /** + *

Organization discovery domain identifier.

+ *

Organization discovery domain identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public DomainStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("domain") + public StatusStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + @JsonSetter("status") + public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_txt") + public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { + this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); + return this; + } + + /** + *

The full domain where the TXT record should be added.

+ *

The full domain where the TXT record should be added.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_host") + public _FinalStage verificationHost(@NotNull String verificationHost) { + this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); + return this; + } + + @Override + public CreateOrganizationDiscoveryDomainResponseContent build() { + return new CreateOrganizationDiscoveryDomainResponseContent( + id, domain, status, verificationTxt, verificationHost, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java index 1c4ca998c..78982b342 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationInvitationResponseContent @@ -201,7 +201,7 @@ private boolean equalTo(CreateOrganizationInvitationResponseContent other) { && ticketId.equals(other.ticketId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -219,7 +219,7 @@ public int hashCode() { this.ticketId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java index a3cef4032..99386e5a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -28,7 +29,7 @@ public final class CreateOrganizationRequestContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional> enabledConnections; @@ -40,7 +41,7 @@ private CreateOrganizationRequestContent( String name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional> enabledConnections, Optional tokenQuota, Map additionalProperties) { @@ -75,7 +76,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -92,7 +93,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationRequestContent && equalTo((CreateOrganizationRequestContent) other); @@ -112,13 +113,13 @@ private boolean equalTo(CreateOrganizationRequestContent other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.displayName, this.branding, this.metadata, this.enabledConnections, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,9 +151,9 @@ public interface _FinalStage { _FinalStage branding(OrganizationBranding branding); - _FinalStage metadata(Optional> metadata); + _FinalStage metadata(Optional>> metadata); - _FinalStage metadata(Map metadata); + _FinalStage metadata(Map> metadata); /** *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

@@ -174,7 +175,7 @@ public static final class Builder implements NameStage, _FinalStage { private Optional> enabledConnections = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional branding = Optional.empty(); @@ -185,7 +186,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateOrganizationRequestContent other) { name(other.getName()); displayName(other.getDisplayName()); @@ -201,20 +202,20 @@ public Builder from(CreateOrganizationRequestContent other) { *

The name of this organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { this.tokenQuota = Optional.ofNullable(tokenQuota); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) public _FinalStage tokenQuota(Optional tokenQuota) { this.tokenQuota = tokenQuota; @@ -225,7 +226,7 @@ public _FinalStage tokenQuota(Optional tokenQuota) { *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabledConnections(List enabledConnections) { this.enabledConnections = Optional.ofNullable(enabledConnections); return this; @@ -234,33 +235,33 @@ public _FinalStage enabledConnections(List enabledCon /** *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled_connections", nulls = Nulls.SKIP) public _FinalStage enabledConnections(Optional> enabledConnections) { this.enabledConnections = enabledConnections; return this; } - @java.lang.Override - public _FinalStage metadata(Map metadata) { + @Override + public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional> metadata) { + public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; return this; } - @java.lang.Override + @Override public _FinalStage branding(OrganizationBranding branding) { this.branding = Optional.ofNullable(branding); return this; } - @java.lang.Override + @Override @JsonSetter(value = "branding", nulls = Nulls.SKIP) public _FinalStage branding(Optional branding) { this.branding = branding; @@ -271,7 +272,7 @@ public _FinalStage branding(Optional branding) { *

Friendly name of this organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -280,14 +281,14 @@ public _FinalStage displayName(String displayName) { /** *

Friendly name of this organization.

*/ - @java.lang.Override + @Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public CreateOrganizationRequestContent build() { return new CreateOrganizationRequestContent( name, displayName, branding, metadata, enabledConnections, tokenQuota, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java index f12b9994c..2c0099f1d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,7 +30,7 @@ public final class CreateOrganizationResponseContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional tokenQuota; @@ -42,7 +43,7 @@ private CreateOrganizationResponseContent( Optional name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional tokenQuota, Optional> enabledConnections, Map additionalProperties) { @@ -86,7 +87,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -100,7 +101,7 @@ public Optional> getEnabledConnections() { return enabledConnections; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationResponseContent && equalTo((CreateOrganizationResponseContent) other); @@ -121,7 +122,7 @@ private boolean equalTo(CreateOrganizationResponseContent other) { && enabledConnections.equals(other.enabledConnections); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -133,7 +134,7 @@ public int hashCode() { this.enabledConnections); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -152,7 +153,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional tokenQuota = Optional.empty(); @@ -228,12 +229,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java index 0f46dfd8e..84bc00bc0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java @@ -49,7 +49,7 @@ public Optional getMessage() { return message; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneProviderSendTestResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(CreatePhoneProviderSendTestResponseContent other) { return code.equals(other.code) && message.equals(other.message); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.code, this.message); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java index ae6277c28..eaf966dd8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateResponseContent @@ -116,13 +116,13 @@ private boolean equalTo(CreatePhoneTemplateResponseContent other) { && disabled == other.disabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -201,21 +201,21 @@ public Builder from(CreatePhoneTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -227,53 +227,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @java.lang.Override + @Override public CreatePhoneTemplateResponseContent build() { return new CreatePhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java index 217c9314f..560117ee5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java @@ -34,7 +34,7 @@ public String getMessage() { return message; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateTestNotificationResponseContent @@ -50,12 +50,12 @@ private boolean equalTo(CreatePhoneTemplateTestNotificationResponseContent other return message.equals(other.message); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.message); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -83,20 +83,20 @@ public static final class Builder implements MessageStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePhoneTemplateTestNotificationResponseContent other) { message(other.getMessage()); return this; } - @java.lang.Override + @Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @java.lang.Override + @Override public CreatePhoneTemplateTestNotificationResponseContent build() { return new CreatePhoneTemplateTestNotificationResponseContent(message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java index 5d223913e..53bc7698c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java @@ -85,7 +85,7 @@ public Optional getClientId() { return clientId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePublicKeyDeviceCredentialRequestContent @@ -105,12 +105,12 @@ private boolean equalTo(CreatePublicKeyDeviceCredentialRequestContent other) { && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.deviceName, this.type, this.value, this.deviceId, this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -174,7 +174,7 @@ public static final class Builder implements DeviceNameStage, TypeStage, ValueSt private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePublicKeyDeviceCredentialRequestContent other) { deviceName(other.getDeviceName()); type(other.getType()); @@ -189,14 +189,14 @@ public Builder from(CreatePublicKeyDeviceCredentialRequestContent other) { *

Name for this device easily recognized by owner.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("device_name") public TypeStage deviceName(@NotNull String deviceName) { this.deviceName = Objects.requireNonNull(deviceName, "deviceName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -208,7 +208,7 @@ public ValueStage type(@NotNull String type) { *

Base64 encoded string containing the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("value") public DeviceIdStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); @@ -220,7 +220,7 @@ public DeviceIdStage value(@NotNull String value) { *

Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("device_id") public _FinalStage deviceId(@NotNull String deviceId) { this.deviceId = Objects.requireNonNull(deviceId, "deviceId must not be null"); @@ -231,7 +231,7 @@ public _FinalStage deviceId(@NotNull String deviceId) { *

client_id of the client (application) this credential is for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -240,14 +240,14 @@ public _FinalStage clientId(String clientId) { /** *

client_id of the client (application) this credential is for.

*/ - @java.lang.Override + @Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; return this; } - @java.lang.Override + @Override public CreatePublicKeyDeviceCredentialRequestContent build() { return new CreatePublicKeyDeviceCredentialRequestContent( deviceName, type, value, deviceId, clientId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java index 7287d4940..bb32c74a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePublicKeyDeviceCredentialResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(CreatePublicKeyDeviceCredentialResponseContent other) { return id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreatePublicKeyDeviceCredentialResponseContent other) { id(other.getId()); return this; @@ -99,14 +99,14 @@ public Builder from(CreatePublicKeyDeviceCredentialResponseContent other) { *

The credential's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public CreatePublicKeyDeviceCredentialResponseContent build() { return new CreatePublicKeyDeviceCredentialResponseContent(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java index ab49444c2..107e6465a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java @@ -53,6 +53,8 @@ public final class CreateResourceServerRequestContent { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + private final Map additionalProperties; private CreateResourceServerRequestContent( @@ -70,6 +72,7 @@ private CreateResourceServerRequestContent( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, Map additionalProperties) { this.name = name; this.identifier = identifier; @@ -85,6 +88,7 @@ private CreateResourceServerRequestContent( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; this.additionalProperties = additionalProperties; } @@ -194,6 +198,11 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -212,7 +221,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateResourceServerRequestContent @@ -238,10 +247,11 @@ private boolean equalTo(CreateResourceServerRequestContent other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -257,10 +267,11 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -367,12 +378,18 @@ _FinalStage skipConsentForVerifiableFirstPartyClients( _FinalStage proofOfPossession( com.auth0.client.mgmt.core.Nullable proofOfPossession); + + _FinalStage subjectTypeAuthorization(Optional subjectTypeAuthorization); + + _FinalStage subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdentifierStage, _FinalStage { private String identifier; + private Optional subjectTypeAuthorization = Optional.empty(); + private OptionalNullable proofOfPossession = OptionalNullable.absent(); private Optional> authorizationDetails = Optional.empty(); @@ -404,7 +421,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateResourceServerRequestContent other) { name(other.getName()); identifier(other.getIdentifier()); @@ -420,6 +437,7 @@ public Builder from(CreateResourceServerRequestContent other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); return this; } @@ -428,14 +446,28 @@ public Builder from(CreateResourceServerRequestContent other) { *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } - @java.lang.Override + @Override + public _FinalStage subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + @Override + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public _FinalStage subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + @Override public _FinalStage proofOfPossession( com.auth0.client.mgmt.core.Nullable proofOfPossession) { if (proofOfPossession.isNull()) { @@ -448,7 +480,7 @@ public _FinalStage proofOfPossession( return this; } - @java.lang.Override + @Override public _FinalStage proofOfPossession(Optional proofOfPossession) { if (proofOfPossession.isPresent()) { this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); @@ -458,13 +490,13 @@ public _FinalStage proofOfPossession(Optional p return this; } - @java.lang.Override + @Override public _FinalStage proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { this.proofOfPossession = OptionalNullable.of(proofOfPossession); return this; } - @java.lang.Override + @Override @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) public _FinalStage proofOfPossession( @Nullable OptionalNullable proofOfPossession) { @@ -472,20 +504,20 @@ public _FinalStage proofOfPossession( return this; } - @java.lang.Override + @Override public _FinalStage authorizationDetails(List authorizationDetails) { this.authorizationDetails = Optional.ofNullable(authorizationDetails); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) public _FinalStage authorizationDetails(Optional> authorizationDetails) { this.authorizationDetails = authorizationDetails; return this; } - @java.lang.Override + @Override public _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { if (consentPolicy.isNull()) { this.consentPolicy = OptionalNullable.ofNull(); @@ -497,7 +529,7 @@ public _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable con return this; } - @java.lang.Override + @Override public _FinalStage consentPolicy(Optional consentPolicy) { if (consentPolicy.isPresent()) { this.consentPolicy = OptionalNullable.of(consentPolicy.get()); @@ -507,20 +539,20 @@ public _FinalStage consentPolicy(Optional consentPolicy) { return this; } - @java.lang.Override + @Override public _FinalStage consentPolicy(String consentPolicy) { this.consentPolicy = OptionalNullable.of(consentPolicy); return this; } - @java.lang.Override + @Override @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) public _FinalStage consentPolicy(@Nullable OptionalNullable consentPolicy) { this.consentPolicy = consentPolicy; return this; } - @java.lang.Override + @Override public _FinalStage tokenEncryption( com.auth0.client.mgmt.core.Nullable tokenEncryption) { if (tokenEncryption.isNull()) { @@ -533,7 +565,7 @@ public _FinalStage tokenEncryption( return this; } - @java.lang.Override + @Override public _FinalStage tokenEncryption(Optional tokenEncryption) { if (tokenEncryption.isPresent()) { this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); @@ -543,13 +575,13 @@ public _FinalStage tokenEncryption(Optional token return this; } - @java.lang.Override + @Override public _FinalStage tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { this.tokenEncryption = OptionalNullable.of(tokenEncryption); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) public _FinalStage tokenEncryption(@Nullable OptionalNullable tokenEncryption) { this.tokenEncryption = tokenEncryption; @@ -560,7 +592,7 @@ public _FinalStage tokenEncryption(@Nullable OptionalNullableWhether to enforce authorization policies (true) or to ignore them (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enforcePolicies(Boolean enforcePolicies) { this.enforcePolicies = Optional.ofNullable(enforcePolicies); return this; @@ -569,7 +601,7 @@ public _FinalStage enforcePolicies(Boolean enforcePolicies) { /** *

Whether to enforce authorization policies (true) or to ignore them (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) public _FinalStage enforcePolicies(Optional enforcePolicies) { this.enforcePolicies = enforcePolicies; @@ -580,7 +612,7 @@ public _FinalStage enforcePolicies(Optional enforcePolicies) { *

Whether to skip user consent for applications flagged as first party (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage skipConsentForVerifiableFirstPartyClients( Boolean skipConsentForVerifiableFirstPartyClients) { this.skipConsentForVerifiableFirstPartyClients = @@ -591,7 +623,7 @@ public _FinalStage skipConsentForVerifiableFirstPartyClients( /** *

Whether to skip user consent for applications flagged as first party (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) public _FinalStage skipConsentForVerifiableFirstPartyClients( Optional skipConsentForVerifiableFirstPartyClients) { @@ -599,13 +631,13 @@ public _FinalStage skipConsentForVerifiableFirstPartyClients( return this; } - @java.lang.Override + @Override public _FinalStage tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect) { this.tokenDialect = Optional.ofNullable(tokenDialect); return this; } - @java.lang.Override + @Override @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public _FinalStage tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -616,7 +648,7 @@ public _FinalStage tokenDialect(Optional t *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tokenLifetime(Integer tokenLifetime) { this.tokenLifetime = Optional.ofNullable(tokenLifetime); return this; @@ -625,7 +657,7 @@ public _FinalStage tokenLifetime(Integer tokenLifetime) { /** *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

*/ - @java.lang.Override + @Override @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) public _FinalStage tokenLifetime(Optional tokenLifetime) { this.tokenLifetime = tokenLifetime; @@ -636,7 +668,7 @@ public _FinalStage tokenLifetime(Optional tokenLifetime) { *

Whether refresh tokens can be issued for this API (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowOfflineAccess(Boolean allowOfflineAccess) { this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); return this; @@ -645,7 +677,7 @@ public _FinalStage allowOfflineAccess(Boolean allowOfflineAccess) { /** *

Whether refresh tokens can be issued for this API (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) public _FinalStage allowOfflineAccess(Optional allowOfflineAccess) { this.allowOfflineAccess = allowOfflineAccess; @@ -656,7 +688,7 @@ public _FinalStage allowOfflineAccess(Optional allowOfflineAccess) { *

Secret used to sign tokens when using symmetric algorithms (HS256).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage signingSecret(String signingSecret) { this.signingSecret = Optional.ofNullable(signingSecret); return this; @@ -665,20 +697,20 @@ public _FinalStage signingSecret(String signingSecret) { /** *

Secret used to sign tokens when using symmetric algorithms (HS256).

*/ - @java.lang.Override + @Override @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) public _FinalStage signingSecret(Optional signingSecret) { this.signingSecret = signingSecret; return this; } - @java.lang.Override + @Override public _FinalStage signingAlg(SigningAlgorithmEnum signingAlg) { this.signingAlg = Optional.ofNullable(signingAlg); return this; } - @java.lang.Override + @Override @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) public _FinalStage signingAlg(Optional signingAlg) { this.signingAlg = signingAlg; @@ -689,7 +721,7 @@ public _FinalStage signingAlg(Optional signingAlg) { *

List of permissions (scopes) that this API uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage scopes(List scopes) { this.scopes = Optional.ofNullable(scopes); return this; @@ -698,7 +730,7 @@ public _FinalStage scopes(List scopes) { /** *

List of permissions (scopes) that this API uses.

*/ - @java.lang.Override + @Override @JsonSetter(value = "scopes", nulls = Nulls.SKIP) public _FinalStage scopes(Optional> scopes) { this.scopes = scopes; @@ -709,7 +741,7 @@ public _FinalStage scopes(Optional> scopes) { *

Friendly name for this resource server. Can not contain < or > characters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -718,14 +750,14 @@ public _FinalStage name(String name) { /** *

Friendly name for this resource server. Can not contain < or > characters.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateResourceServerRequestContent build() { return new CreateResourceServerRequestContent( name, @@ -742,6 +774,7 @@ public CreateResourceServerRequestContent build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java index 95db4b863..6ebcf1935 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java @@ -58,6 +58,10 @@ public final class CreateResourceServerResponseContent { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + + private final Optional clientId; + private final Map additionalProperties; private CreateResourceServerResponseContent( @@ -78,6 +82,8 @@ private CreateResourceServerResponseContent( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, + Optional clientId, Map additionalProperties) { this.id = id; this.name = name; @@ -96,6 +102,8 @@ private CreateResourceServerResponseContent( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; + this.clientId = clientId; this.additionalProperties = additionalProperties; } @@ -229,6 +237,19 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + + /** + * @return The client ID of the client that this resource server is linked to + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -247,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateResourceServerResponseContent @@ -276,10 +297,12 @@ private boolean equalTo(CreateResourceServerResponseContent other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization) + && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -298,10 +321,12 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization, + this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -346,6 +371,10 @@ public static final class Builder { private OptionalNullable proofOfPossession = OptionalNullable.absent(); + private Optional subjectTypeAuthorization = Optional.empty(); + + private Optional clientId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -369,6 +398,8 @@ public Builder from(CreateResourceServerResponseContent other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); + clientId(other.getClientId()); return this; } @@ -657,6 +688,32 @@ public Builder proofOfPossession( return this; } + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + /** + *

The client ID of the client that this resource server is linked to

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + public CreateResourceServerResponseContent build() { return new CreateResourceServerResponseContent( id, @@ -676,6 +733,8 @@ public CreateResourceServerResponseContent build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, + clientId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java index 3af2f35e5..e63898680 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java @@ -50,7 +50,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRoleRequestContent && equalTo((CreateRoleRequestContent) other); @@ -65,12 +65,12 @@ private boolean equalTo(CreateRoleRequestContent other) { return name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateRoleRequestContent other) { name(other.getName()); description(other.getDescription()); @@ -122,7 +122,7 @@ public Builder from(CreateRoleRequestContent other) { *

Name of the role.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -133,7 +133,7 @@ public _FinalStage name(@NotNull String name) { *

Description of the role.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -142,14 +142,14 @@ public _FinalStage description(String description) { /** *

Description of the role.

*/ - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public CreateRoleRequestContent build() { return new CreateRoleRequestContent(name, description, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java index 63cb8d6cf..da7da3fd4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRoleResponseContent && equalTo((CreateRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(CreateRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java index 7726d91f6..3c7d920c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java @@ -76,7 +76,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRuleRequestContent && equalTo((CreateRuleRequestContent) other); @@ -94,12 +94,12 @@ private boolean equalTo(CreateRuleRequestContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.script, this.order, this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements NameStage, ScriptStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(CreateRuleRequestContent other) { name(other.getName()); script(other.getScript()); @@ -171,7 +171,7 @@ public Builder from(CreateRuleRequestContent other) { *

Name of this rule.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public ScriptStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -183,7 +183,7 @@ public ScriptStage name(@NotNull String name) { *

Code to be executed when this rule runs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("script") public _FinalStage script(@NotNull String script) { this.script = Objects.requireNonNull(script, "script must not be null"); @@ -194,7 +194,7 @@ public _FinalStage script(@NotNull String script) { *

Whether the rule is enabled (true), or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -203,7 +203,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the rule is enabled (true), or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; @@ -214,7 +214,7 @@ public _FinalStage enabled(Optional enabled) { *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage order(Double order) { this.order = Optional.ofNullable(order); return this; @@ -223,14 +223,14 @@ public _FinalStage order(Double order) { /** *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

*/ - @java.lang.Override + @Override @JsonSetter(value = "order", nulls = Nulls.SKIP) public _FinalStage order(Optional order) { this.order = order; return this; } - @java.lang.Override + @Override public CreateRuleRequestContent build() { return new CreateRuleRequestContent(name, script, order, enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java index 5b3dc4157..bbb0541af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRuleResponseContent && equalTo((CreateRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(CreateRuleResponseContent other) { && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java index bc9639641..3d189dcc8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java @@ -52,7 +52,7 @@ public Optional> getMapping() { return mapping; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimConfigurationRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(CreateScimConfigurationRequestContent other) { return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userIdAttribute, this.mapping); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java index d9e4761b9..ba6430022 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(CreateScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java index 8eaff6e57..3a0cbb914 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java @@ -88,7 +88,7 @@ public Optional getValidUntil() { return validUntil; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimTokenResponseContent && equalTo((CreateScimTokenResponseContent) other); @@ -107,12 +107,12 @@ private boolean equalTo(CreateScimTokenResponseContent other) { && validUntil.equals(other.validUntil); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tokenId, this.token, this.scopes, this.createdAt, this.validUntil); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java index 208a9659a..8d2163cc7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java @@ -32,6 +32,8 @@ public final class CreateSelfServiceProfileRequestContent { private final Optional> userAttributes; + private final Optional userAttributeProfileId; + private final Map additionalProperties; private CreateSelfServiceProfileRequestContent( @@ -40,12 +42,14 @@ private CreateSelfServiceProfileRequestContent( Optional branding, Optional> allowedStrategies, Optional> userAttributes, + Optional userAttributeProfileId, Map additionalProperties) { this.name = name; this.description = description; this.branding = branding; this.allowedStrategies = allowedStrategies; this.userAttributes = userAttributes; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -86,7 +90,15 @@ public Optional> getUserAttributes() { return userAttributes; } - @java.lang.Override + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonProperty("user_attribute_profile_id") + public Optional getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileRequestContent @@ -103,15 +115,22 @@ private boolean equalTo(CreateSelfServiceProfileRequestContent other) { && description.equals(other.description) && branding.equals(other.branding) && allowedStrategies.equals(other.allowedStrategies) - && userAttributes.equals(other.userAttributes); + && userAttributes.equals(other.userAttributes) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.name, this.description, this.branding, this.allowedStrategies, this.userAttributes); + return Objects.hash( + this.name, + this.description, + this.branding, + this.allowedStrategies, + this.userAttributes, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -156,12 +175,21 @@ public interface _FinalStage { _FinalStage userAttributes(Optional> userAttributes); _FinalStage userAttributes(List userAttributes); + + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + _FinalStage userAttributeProfileId(Optional userAttributeProfileId); + + _FinalStage userAttributeProfileId(String userAttributeProfileId); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements NameStage, _FinalStage { private String name; + private Optional userAttributeProfileId = Optional.empty(); + private Optional> userAttributes = Optional.empty(); private Optional> allowedStrategies = Optional.empty(); @@ -175,13 +203,14 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateSelfServiceProfileRequestContent other) { name(other.getName()); description(other.getDescription()); branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); userAttributes(other.getUserAttributes()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -190,18 +219,38 @@ public Builder from(CreateSelfServiceProfileRequestContent other) { *

The name of the self-service Profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); + return this; + } + + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @Override + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public _FinalStage userAttributeProfileId(Optional userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + /** *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage userAttributes(List userAttributes) { this.userAttributes = Optional.ofNullable(userAttributes); return this; @@ -210,7 +259,7 @@ public _FinalStage userAttributes(List userAttr /** *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

*/ - @java.lang.Override + @Override @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) public _FinalStage userAttributes(Optional> userAttributes) { this.userAttributes = userAttributes; @@ -221,7 +270,7 @@ public _FinalStage userAttributes(Optional *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage allowedStrategies(List allowedStrategies) { this.allowedStrategies = Optional.ofNullable(allowedStrategies); return this; @@ -230,20 +279,20 @@ public _FinalStage allowedStrategies(List /** *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

*/ - @java.lang.Override + @Override @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) public _FinalStage allowedStrategies(Optional> allowedStrategies) { this.allowedStrategies = allowedStrategies; return this; } - @java.lang.Override + @Override public _FinalStage branding(SelfServiceProfileBrandingProperties branding) { this.branding = Optional.ofNullable(branding); return this; } - @java.lang.Override + @Override @JsonSetter(value = "branding", nulls = Nulls.SKIP) public _FinalStage branding(Optional branding) { this.branding = branding; @@ -254,7 +303,7 @@ public _FinalStage branding(Optional brand *

The description of the self-service Profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -263,17 +312,23 @@ public _FinalStage description(String description) { /** *

The description of the self-service Profile.

*/ - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public CreateSelfServiceProfileRequestContent build() { return new CreateSelfServiceProfileRequestContent( - name, description, branding, allowedStrategies, userAttributes, additionalProperties); + name, + description, + branding, + allowedStrategies, + userAttributes, + userAttributeProfileId, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java index 427743b99..770c44224 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java @@ -38,6 +38,8 @@ public final class CreateSelfServiceProfileResponseContent { private final Optional> allowedStrategies; + private final Optional userAttributeProfileId; + private final Map additionalProperties; private CreateSelfServiceProfileResponseContent( @@ -49,6 +51,7 @@ private CreateSelfServiceProfileResponseContent( Optional updatedAt, Optional branding, Optional> allowedStrategies, + Optional userAttributeProfileId, Map additionalProperties) { this.id = id; this.name = name; @@ -58,6 +61,7 @@ private CreateSelfServiceProfileResponseContent( this.updatedAt = updatedAt; this.branding = branding; this.allowedStrategies = allowedStrategies; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -122,7 +126,15 @@ public Optional> getAllowedStrategie return allowedStrategies; } - @java.lang.Override + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonProperty("user_attribute_profile_id") + public Optional getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileResponseContent @@ -142,10 +154,11 @@ private boolean equalTo(CreateSelfServiceProfileResponseContent other) { && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && branding.equals(other.branding) - && allowedStrategies.equals(other.allowedStrategies); + && allowedStrategies.equals(other.allowedStrategies) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -155,10 +168,11 @@ public int hashCode() { this.createdAt, this.updatedAt, this.branding, - this.allowedStrategies); + this.allowedStrategies, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -185,6 +199,8 @@ public static final class Builder { private Optional> allowedStrategies = Optional.empty(); + private Optional userAttributeProfileId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -199,6 +215,7 @@ public Builder from(CreateSelfServiceProfileResponseContent other) { updatedAt(other.getUpdatedAt()); branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -311,6 +328,20 @@ public Builder allowedStrategies(List all return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public Builder userAttributeProfileId(Optional userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + + public Builder userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); + return this; + } + public CreateSelfServiceProfileResponseContent build() { return new CreateSelfServiceProfileResponseContent( id, @@ -321,6 +352,7 @@ public CreateSelfServiceProfileResponseContent build() { updatedAt, branding, allowedStrategies, + userAttributeProfileId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java index 3258ba8b2..6dca7f4d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java @@ -38,7 +38,7 @@ public Optional getTicket() { return ticket; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileSsoTicketResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(CreateSelfServiceProfileSsoTicketResponseContent other) return ticket.equals(other.ticket); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ticket); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java index cecd7729b..84adfdb18 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java @@ -71,7 +71,7 @@ public String getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenExchangeProfileRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateTokenExchangeProfileRequestContent other) { && type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subjectTokenType, this.actionId, this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -151,7 +151,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CreateTokenExchangeProfileRequestContent other) { name(other.getName()); subjectTokenType(other.getSubjectTokenType()); @@ -165,7 +165,7 @@ public Builder from(CreateTokenExchangeProfileRequestContent other) { *

Friendly name of this profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public SubjectTokenTypeStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -177,7 +177,7 @@ public SubjectTokenTypeStage name(@NotNull String name) { *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("subject_token_type") public ActionIdStage subjectTokenType(@NotNull String subjectTokenType) { this.subjectTokenType = Objects.requireNonNull(subjectTokenType, "subjectTokenType must not be null"); @@ -189,21 +189,21 @@ public ActionIdStage subjectTokenType(@NotNull String subjectTokenType) { *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("action_id") public TypeStage actionId(@NotNull String actionId) { this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public CreateTokenExchangeProfileRequestContent build() { return new CreateTokenExchangeProfileRequestContent( name, subjectTokenType, actionId, type, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java index 5f3fd2c6c..98321f853 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(CreateTokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java index 6e97155ff..bf37407d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenQuota && equalTo((CreateTokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(CreateTokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(CreateTokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @java.lang.Override + @Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @java.lang.Override + @Override public CreateTokenQuota build() { return new CreateTokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java new file mode 100644 index 000000000..464cd31e4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserAttributeProfileRequestContent.Builder.class) +public final class CreateUserAttributeProfileRequestContent { + private final String name; + + private final Optional userId; + + private final Map userAttributes; + + private final Map additionalProperties; + + private CreateUserAttributeProfileRequestContent( + String name, + Optional userId, + Map userAttributes, + Map additionalProperties) { + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Map getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserAttributeProfileRequestContent + && equalTo((CreateUserAttributeProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserAttributeProfileRequestContent other) { + return name.equals(other.name) && userId.equals(other.userId) && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(CreateUserAttributeProfileRequestContent other); + } + + public interface _FinalStage { + CreateUserAttributeProfileRequestContent build(); + + _FinalStage userId(Optional userId); + + _FinalStage userId(UserAttributeProfileUserId userId); + + _FinalStage userAttributes(Map userAttributes); + + _FinalStage putAllUserAttributes( + Map userAttributes); + + _FinalStage userAttributes(String key, UserAttributeProfileUserAttributeAdditionalProperties value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Map userAttributes = + new LinkedHashMap<>(); + + private Optional userId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreateUserAttributeProfileRequestContent other) { + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @Override + public _FinalStage userAttributes(String key, UserAttributeProfileUserAttributeAdditionalProperties value) { + this.userAttributes.put(key, value); + return this; + } + + @Override + public _FinalStage putAllUserAttributes( + Map userAttributes) { + if (userAttributes != null) { + this.userAttributes.putAll(userAttributes); + } + return this; + } + + @Override + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public _FinalStage userAttributes( + Map userAttributes) { + this.userAttributes.clear(); + if (userAttributes != null) { + this.userAttributes.putAll(userAttributes); + } + return this; + } + + @Override + public _FinalStage userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @Override + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public _FinalStage userId(Optional userId) { + this.userId = userId; + return this; + } + + @Override + public CreateUserAttributeProfileRequestContent build() { + return new CreateUserAttributeProfileRequestContent(name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java new file mode 100644 index 000000000..85eef4b0a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateUserAttributeProfileResponseContent.Builder.class) +public final class CreateUserAttributeProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private CreateUserAttributeProfileResponseContent( + Optional id, + Optional name, + Optional userId, + Optional> userAttributes, + Map additionalProperties) { + this.id = id; + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateUserAttributeProfileResponseContent + && equalTo((CreateUserAttributeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateUserAttributeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && userId.equals(other.userId) + && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateUserAttributeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public CreateUserAttributeProfileResponseContent build() { + return new CreateUserAttributeProfileResponseContent( + id, name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java index 70d53ec80..e5e358a51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAuthenticationMethodResponseContent.java @@ -43,6 +43,8 @@ public final class CreateUserAuthenticationMethodResponseContent { private final Optional publicKey; + private final Optional aaguid; + private final Optional relyingPartyIdentifier; private final Optional createdAt; @@ -60,6 +62,7 @@ private CreateUserAuthenticationMethodResponseContent( Optional preferredAuthenticationMethod, Optional keyId, Optional publicKey, + Optional aaguid, Optional relyingPartyIdentifier, Optional createdAt, Map additionalProperties) { @@ -73,6 +76,7 @@ private CreateUserAuthenticationMethodResponseContent( this.preferredAuthenticationMethod = preferredAuthenticationMethod; this.keyId = keyId; this.publicKey = publicKey; + this.aaguid = aaguid; this.relyingPartyIdentifier = relyingPartyIdentifier; this.createdAt = createdAt; this.additionalProperties = additionalProperties; @@ -149,6 +153,14 @@ public Optional getPublicKey() { return publicKey; } + /** + * @return Applies to passkeys only. Authenticator Attestation Globally Unique Identifier. + */ + @JsonProperty("aaguid") + public Optional getAaguid() { + return aaguid; + } + /** * @return Applies to webauthn authenticators only. The relying party identifier. */ @@ -165,7 +177,7 @@ public Optional getCreatedAt() { return createdAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserAuthenticationMethodResponseContent @@ -188,11 +200,12 @@ private boolean equalTo(CreateUserAuthenticationMethodResponseContent other) { && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) && keyId.equals(other.keyId) && publicKey.equals(other.publicKey) + && aaguid.equals(other.aaguid) && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) && createdAt.equals(other.createdAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -205,11 +218,12 @@ public int hashCode() { this.preferredAuthenticationMethod, this.keyId, this.publicKey, + this.aaguid, this.relyingPartyIdentifier, this.createdAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -285,6 +299,13 @@ _FinalStage preferredAuthenticationMethod( _FinalStage publicKey(String publicKey); + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ */ + _FinalStage aaguid(Optional aaguid); + + _FinalStage aaguid(String aaguid); + /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ @@ -308,6 +329,8 @@ public static final class Builder implements TypeStage, _FinalStage { private Optional relyingPartyIdentifier = Optional.empty(); + private Optional aaguid = Optional.empty(); + private Optional publicKey = Optional.empty(); private Optional keyId = Optional.empty(); @@ -331,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -343,12 +366,13 @@ public Builder from(CreateUserAuthenticationMethodResponseContent other) { preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); keyId(other.getKeyId()); publicKey(other.getPublicKey()); + aaguid(other.getAaguid()); relyingPartyIdentifier(other.getRelyingPartyIdentifier()); createdAt(other.getCreatedAt()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -359,7 +383,7 @@ public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -368,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -379,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authenticators only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -388,18 +412,38 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ - @java.lang.Override + @Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; return this; } + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage aaguid(String aaguid) { + this.aaguid = Optional.ofNullable(aaguid); + return this; + } + + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ */ + @Override + @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) + public _FinalStage aaguid(Optional aaguid) { + this.aaguid = aaguid; + return this; + } + /** *

Applies to webauthn authenticators only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -408,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authenticators only. The public key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -419,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authenticators only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -428,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authenticators only. The id of the credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -450,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -468,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -477,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -488,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -497,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -508,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -517,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @java.lang.Override + @Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -528,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -537,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -548,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -557,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public CreateUserAuthenticationMethodResponseContent build() { return new CreateUserAuthenticationMethodResponseContent( id, @@ -577,6 +621,7 @@ public CreateUserAuthenticationMethodResponseContent build() { preferredAuthenticationMethod, keyId, publicKey, + aaguid, relyingPartyIdentifier, createdAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java index fa39b1afa..490777f95 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java @@ -226,7 +226,7 @@ public Optional getUsername() { return username; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserRequestContent && equalTo((CreateUserRequestContent) other); @@ -257,7 +257,7 @@ private boolean equalTo(CreateUserRequestContent other) { && username.equals(other.username); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.email, @@ -279,7 +279,7 @@ public int hashCode() { this.username); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -448,7 +448,7 @@ public static final class Builder implements ConnectionStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateUserRequestContent other) { email(other.getEmail()); phoneNumber(other.getPhoneNumber()); @@ -475,7 +475,7 @@ public Builder from(CreateUserRequestContent other) { *

Name of the connection this user should be created in.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection") public _FinalStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -486,7 +486,7 @@ public _FinalStage connection(@NotNull String connection) { *

The user's username. Only valid if the connection requires a username.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage username(String username) { this.username = Optional.ofNullable(username); return this; @@ -495,7 +495,7 @@ public _FinalStage username(String username) { /** *

The user's username. Only valid if the connection requires a username.

*/ - @java.lang.Override + @Override @JsonSetter(value = "username", nulls = Nulls.SKIP) public _FinalStage username(Optional username) { this.username = username; @@ -506,7 +506,7 @@ public _FinalStage username(Optional username) { *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage verifyEmail(Boolean verifyEmail) { this.verifyEmail = Optional.ofNullable(verifyEmail); return this; @@ -515,7 +515,7 @@ public _FinalStage verifyEmail(Boolean verifyEmail) { /** *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

*/ - @java.lang.Override + @Override @JsonSetter(value = "verify_email", nulls = Nulls.SKIP) public _FinalStage verifyEmail(Optional verifyEmail) { this.verifyEmail = verifyEmail; @@ -526,7 +526,7 @@ public _FinalStage verifyEmail(Optional verifyEmail) { *

Initial password for this user. Only valid for auth0 connection strategy.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage password(String password) { this.password = Optional.ofNullable(password); return this; @@ -535,7 +535,7 @@ public _FinalStage password(String password) { /** *

Initial password for this user. Only valid for auth0 connection strategy.

*/ - @java.lang.Override + @Override @JsonSetter(value = "password", nulls = Nulls.SKIP) public _FinalStage password(Optional password) { this.password = password; @@ -546,7 +546,7 @@ public _FinalStage password(Optional password) { *

The external user's id provided by the identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage userId(String userId) { this.userId = Optional.ofNullable(userId); return this; @@ -555,7 +555,7 @@ public _FinalStage userId(String userId) { /** *

The external user's id provided by the identity provider.

*/ - @java.lang.Override + @Override @JsonSetter(value = "user_id", nulls = Nulls.SKIP) public _FinalStage userId(Optional userId) { this.userId = userId; @@ -566,7 +566,7 @@ public _FinalStage userId(Optional userId) { *

A URI pointing to the user's picture.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage picture(String picture) { this.picture = Optional.ofNullable(picture); return this; @@ -575,7 +575,7 @@ public _FinalStage picture(String picture) { /** *

A URI pointing to the user's picture.

*/ - @java.lang.Override + @Override @JsonSetter(value = "picture", nulls = Nulls.SKIP) public _FinalStage picture(Optional picture) { this.picture = picture; @@ -586,7 +586,7 @@ public _FinalStage picture(Optional picture) { *

The user's nickname.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage nickname(String nickname) { this.nickname = Optional.ofNullable(nickname); return this; @@ -595,7 +595,7 @@ public _FinalStage nickname(String nickname) { /** *

The user's nickname.

*/ - @java.lang.Override + @Override @JsonSetter(value = "nickname", nulls = Nulls.SKIP) public _FinalStage nickname(Optional nickname) { this.nickname = nickname; @@ -606,7 +606,7 @@ public _FinalStage nickname(Optional nickname) { *

The user's full name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -615,7 +615,7 @@ public _FinalStage name(String name) { /** *

The user's full name.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -626,7 +626,7 @@ public _FinalStage name(Optional name) { *

The user's family name(s).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage familyName(String familyName) { this.familyName = Optional.ofNullable(familyName); return this; @@ -635,7 +635,7 @@ public _FinalStage familyName(String familyName) { /** *

The user's family name(s).

*/ - @java.lang.Override + @Override @JsonSetter(value = "family_name", nulls = Nulls.SKIP) public _FinalStage familyName(Optional familyName) { this.familyName = familyName; @@ -646,7 +646,7 @@ public _FinalStage familyName(Optional familyName) { *

The user's given name(s).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage givenName(String givenName) { this.givenName = Optional.ofNullable(givenName); return this; @@ -655,20 +655,20 @@ public _FinalStage givenName(String givenName) { /** *

The user's given name(s).

*/ - @java.lang.Override + @Override @JsonSetter(value = "given_name", nulls = Nulls.SKIP) public _FinalStage givenName(Optional givenName) { this.givenName = givenName; return this; } - @java.lang.Override + @Override public _FinalStage appMetadata(Map appMetadata) { this.appMetadata = Optional.ofNullable(appMetadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) public _FinalStage appMetadata(Optional> appMetadata) { this.appMetadata = appMetadata; @@ -679,7 +679,7 @@ public _FinalStage appMetadata(Optional> appMetadata) { *

Whether this phone number has been verified (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneVerified(Boolean phoneVerified) { this.phoneVerified = Optional.ofNullable(phoneVerified); return this; @@ -688,7 +688,7 @@ public _FinalStage phoneVerified(Boolean phoneVerified) { /** *

Whether this phone number has been verified (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) public _FinalStage phoneVerified(Optional phoneVerified) { this.phoneVerified = phoneVerified; @@ -699,7 +699,7 @@ public _FinalStage phoneVerified(Optional phoneVerified) { *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage emailVerified(Boolean emailVerified) { this.emailVerified = Optional.ofNullable(emailVerified); return this; @@ -708,7 +708,7 @@ public _FinalStage emailVerified(Boolean emailVerified) { /** *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

*/ - @java.lang.Override + @Override @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) public _FinalStage emailVerified(Optional emailVerified) { this.emailVerified = emailVerified; @@ -719,7 +719,7 @@ public _FinalStage emailVerified(Optional emailVerified) { *

Whether this user was blocked by an administrator (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage blocked(Boolean blocked) { this.blocked = Optional.ofNullable(blocked); return this; @@ -728,20 +728,20 @@ public _FinalStage blocked(Boolean blocked) { /** *

Whether this user was blocked by an administrator (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "blocked", nulls = Nulls.SKIP) public _FinalStage blocked(Optional blocked) { this.blocked = blocked; return this; } - @java.lang.Override + @Override public _FinalStage userMetadata(Map userMetadata) { this.userMetadata = Optional.ofNullable(userMetadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) public _FinalStage userMetadata(Optional> userMetadata) { this.userMetadata = userMetadata; @@ -752,7 +752,7 @@ public _FinalStage userMetadata(Optional> userMetadata) { *

The user's phone number (following the E.164 recommendation).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -761,7 +761,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

The user's phone number (following the E.164 recommendation).

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -772,7 +772,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The user's email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -781,14 +781,14 @@ public _FinalStage email(String email) { /** *

The user's email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public CreateUserRequestContent build() { return new CreateUserRequestContent( email, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java index ce01f5312..89807cd58 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserResponseContent && equalTo((CreateUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(CreateUserResponseContent other) { && familyName.equals(other.familyName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java index 5457f0768..16ea4192f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(CreateVerifiableCredentialTemplateResponseContent other) && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java index 423b6f53f..c2581f31d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java @@ -76,7 +76,7 @@ public String getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerificationEmailResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(CreateVerificationEmailResponseContent other) { && id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -158,7 +158,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(CreateVerificationEmailResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -172,7 +172,7 @@ public Builder from(CreateVerificationEmailResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -184,7 +184,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -196,7 +196,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -207,7 +207,7 @@ public _FinalStage id(@NotNull String id) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -216,14 +216,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public CreateVerificationEmailResponseContent build() { return new CreateVerificationEmailResponseContent(status, type, createdAt, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java index 06f30e70d..b60152459 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CreatedAuthenticationMethodTypeEnum && this.string.equals(((CreatedAuthenticationMethodTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java index 2cb6a0feb..25106c508 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CreatedUserAuthenticationMethodTypeEnum && this.string.equals(((CreatedUserAuthenticationMethodTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CredentialId.java b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java index f50986cde..763c54889 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CredentialId.java +++ b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CredentialId && equalTo((CredentialId) other); @@ -51,12 +51,12 @@ private boolean equalTo(CredentialId other) { return id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CredentialId other) { id(other.getId()); return this; @@ -98,14 +98,14 @@ public Builder from(CredentialId other) { *

Credential ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public CredentialId build() { return new CredentialId(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java index 3f1bd28c9..ecf6fc1a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java @@ -30,6 +30,8 @@ public final class CustomDomain { private final boolean primary; + private final CustomDomainStatusFilterEnum status; + private final CustomDomainTypeEnum type; private final Optional originDomainName; @@ -40,26 +42,36 @@ public final class CustomDomain { private final Optional tlsPolicy; + private final Optional>> domainMetadata; + + private final Optional certificate; + private final Map additionalProperties; private CustomDomain( String customDomainId, String domain, boolean primary, + CustomDomainStatusFilterEnum status, CustomDomainTypeEnum type, Optional originDomainName, Optional verification, OptionalNullable customClientIpHeader, Optional tlsPolicy, + Optional>> domainMetadata, + Optional certificate, Map additionalProperties) { this.customDomainId = customDomainId; this.domain = domain; this.primary = primary; + this.status = status; this.type = type; this.originDomainName = originDomainName; this.verification = verification; this.customClientIpHeader = customClientIpHeader; this.tlsPolicy = tlsPolicy; + this.domainMetadata = domainMetadata; + this.certificate = certificate; this.additionalProperties = additionalProperties; } @@ -87,6 +99,11 @@ public boolean getPrimary() { return primary; } + @JsonProperty("status") + public CustomDomainStatusFilterEnum getStatus() { + return status; + } + @JsonProperty("type") public CustomDomainTypeEnum getType() { return type; @@ -125,13 +142,23 @@ public Optional getTlsPolicy() { return tlsPolicy; } + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @JsonProperty("certificate") + public Optional getCertificate() { + return certificate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("custom_client_ip_header") private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomDomain && equalTo((CustomDomain) other); @@ -146,27 +173,33 @@ private boolean equalTo(CustomDomain other) { return customDomainId.equals(other.customDomainId) && domain.equals(other.domain) && primary == other.primary + && status.equals(other.status) && type.equals(other.type) && originDomainName.equals(other.originDomainName) && verification.equals(other.verification) && customClientIpHeader.equals(other.customClientIpHeader) - && tlsPolicy.equals(other.tlsPolicy); + && tlsPolicy.equals(other.tlsPolicy) + && domainMetadata.equals(other.domainMetadata) + && certificate.equals(other.certificate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.customDomainId, this.domain, this.primary, + this.status, this.type, this.originDomainName, this.verification, this.customClientIpHeader, - this.tlsPolicy); + this.tlsPolicy, + this.domainMetadata, + this.certificate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -195,7 +228,11 @@ public interface PrimaryStage { /** *

Whether this is a primary domain (true) or not (false).

*/ - TypeStage primary(boolean primary); + StatusStage primary(boolean primary); + } + + public interface StatusStage { + TypeStage status(@NotNull CustomDomainStatusFilterEnum status); } public interface TypeStage { @@ -233,19 +270,33 @@ public interface _FinalStage { _FinalStage tlsPolicy(Optional tlsPolicy); _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); + + _FinalStage certificate(Optional certificate); + + _FinalStage certificate(DomainCertificate certificate); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + implements CustomDomainIdStage, DomainStage, PrimaryStage, StatusStage, TypeStage, _FinalStage { private String customDomainId; private String domain; private boolean primary; + private CustomDomainStatusFilterEnum status; + private CustomDomainTypeEnum type; + private Optional certificate = Optional.empty(); + + private Optional>> domainMetadata = Optional.empty(); + private Optional tlsPolicy = Optional.empty(); private OptionalNullable customClientIpHeader = OptionalNullable.absent(); @@ -259,16 +310,19 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(CustomDomain other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); primary(other.getPrimary()); + status(other.getStatus()); type(other.getType()); originDomainName(other.getOriginDomainName()); verification(other.getVerification()); customClientIpHeader(other.getCustomClientIpHeader()); tlsPolicy(other.getTlsPolicy()); + domainMetadata(other.getDomainMetadata()); + certificate(other.getCertificate()); return this; } @@ -277,7 +331,7 @@ public Builder from(CustomDomain other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -289,7 +343,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -301,25 +355,58 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") - public TypeStage primary(boolean primary) { + public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @java.lang.Override + @Override + @JsonSetter("status") + public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } + @Override + public _FinalStage certificate(DomainCertificate certificate) { + this.certificate = Optional.ofNullable(certificate); + return this; + } + + @Override + @JsonSetter(value = "certificate", nulls = Nulls.SKIP) + public _FinalStage certificate(Optional certificate) { + this.certificate = certificate; + return this; + } + + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + /** *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -328,7 +415,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -339,7 +426,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -355,7 +442,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -369,7 +456,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -378,20 +465,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @java.lang.Override + @Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @java.lang.Override + @Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -402,7 +489,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -411,24 +498,27 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; return this; } - @java.lang.Override + @Override public CustomDomain build() { return new CustomDomain( customDomainId, domain, primary, + status, type, originDomainName, verification, customClientIpHeader, tlsPolicy, + domainMetadata, + certificate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java index 0325fd72d..69701bb14 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainCustomClientIpHeaderEnum && this.string.equals(((CustomDomainCustomClientIpHeaderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java index 10ea63a75..7ccaa9c63 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainProvisioningTypeEnum && this.string.equals(((CustomDomainProvisioningTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java new file mode 100644 index 000000000..bd2c7412e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CustomDomainStatusFilterEnum { + public static final CustomDomainStatusFilterEnum FAILED = new CustomDomainStatusFilterEnum(Value.FAILED, "failed"); + + public static final CustomDomainStatusFilterEnum READY = new CustomDomainStatusFilterEnum(Value.READY, "ready"); + + public static final CustomDomainStatusFilterEnum PENDING_VERIFICATION = + new CustomDomainStatusFilterEnum(Value.PENDING_VERIFICATION, "pending_verification"); + + private final Value value; + + private final String string; + + CustomDomainStatusFilterEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CustomDomainStatusFilterEnum + && this.string.equals(((CustomDomainStatusFilterEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case READY: + return visitor.visitReady(); + case PENDING_VERIFICATION: + return visitor.visitPendingVerification(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomDomainStatusFilterEnum valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "ready": + return READY; + case "pending_verification": + return PENDING_VERIFICATION; + default: + return new CustomDomainStatusFilterEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING_VERIFICATION, + + READY, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPendingVerification(); + + T visitReady(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java index 1300052c1..916a88bd7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainTypeEnum && this.string.equals(((CustomDomainTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java index bdf32df78..20e149a28 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java @@ -36,7 +36,7 @@ public List getDeliveryMethods() { return deliveryMethods; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomProviderConfiguration && equalTo((CustomProviderConfiguration) other); @@ -51,12 +51,12 @@ private boolean equalTo(CustomProviderConfiguration other) { return deliveryMethods.equals(other.deliveryMethods); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.deliveryMethods); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java index 5a718e799..aa50a92e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java @@ -21,7 +21,7 @@ private CustomProviderCredentials(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomProviderCredentials; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java index 50271acca..d7fc7b838 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomProviderDeliveryMethodEnum && this.string.equals(((CustomProviderDeliveryMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java index e9709e539..de31ee4c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java @@ -38,20 +38,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyAlgorithmEnum && this.string.equals(((CustomSigningKeyAlgorithmEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java index bfb12f6d9..2c456cae8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyCurveEnum && this.string.equals(((CustomSigningKeyCurveEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java index 324e03784..f712d461c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java @@ -185,7 +185,7 @@ public Optional getX5TS256() { return x5TS256; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomSigningKeyJwk && equalTo((CustomSigningKeyJwk) other); @@ -213,7 +213,7 @@ private boolean equalTo(CustomSigningKeyJwk other) { && x5TS256.equals(other.x5TS256); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kty, @@ -232,7 +232,7 @@ public int hashCode() { this.x5TS256); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -368,7 +368,7 @@ public static final class Builder implements KtyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CustomSigningKeyJwk other) { kty(other.getKty()); kid(other.getKid()); @@ -387,7 +387,7 @@ public Builder from(CustomSigningKeyJwk other) { return this; } - @java.lang.Override + @Override @JsonSetter("kty") public _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty) { this.kty = Objects.requireNonNull(kty, "kty must not be null"); @@ -398,7 +398,7 @@ public _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty) { *

X.509 certificate SHA-256 thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage x5TS256(String x5TS256) { this.x5TS256 = Optional.ofNullable(x5TS256); return this; @@ -407,7 +407,7 @@ public _FinalStage x5TS256(String x5TS256) { /** *

X.509 certificate SHA-256 thumbprint

*/ - @java.lang.Override + @Override @JsonSetter(value = "x5t#S256", nulls = Nulls.SKIP) public _FinalStage x5TS256(Optional x5TS256) { this.x5TS256 = x5TS256; @@ -418,7 +418,7 @@ public _FinalStage x5TS256(Optional x5TS256) { *

X.509 certificate SHA-1 thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage x5T(String x5T) { this.x5T = Optional.ofNullable(x5T); return this; @@ -427,7 +427,7 @@ public _FinalStage x5T(String x5T) { /** *

X.509 certificate SHA-1 thumbprint

*/ - @java.lang.Override + @Override @JsonSetter(value = "x5t", nulls = Nulls.SKIP) public _FinalStage x5T(Optional x5T) { this.x5T = x5T; @@ -438,7 +438,7 @@ public _FinalStage x5T(Optional x5T) { *

X.509 certificate chain

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage x5C(List x5C) { this.x5C = Optional.ofNullable(x5C); return this; @@ -447,7 +447,7 @@ public _FinalStage x5C(List x5C) { /** *

X.509 certificate chain

*/ - @java.lang.Override + @Override @JsonSetter(value = "x5c", nulls = Nulls.SKIP) public _FinalStage x5C(Optional> x5C) { this.x5C = x5C; @@ -458,7 +458,7 @@ public _FinalStage x5C(Optional> x5C) { *

X.509 URL

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage x5U(String x5U) { this.x5U = Optional.ofNullable(x5U); return this; @@ -467,7 +467,7 @@ public _FinalStage x5U(String x5U) { /** *

X.509 URL

*/ - @java.lang.Override + @Override @JsonSetter(value = "x5u", nulls = Nulls.SKIP) public _FinalStage x5U(Optional x5U) { this.x5U = x5U; @@ -478,7 +478,7 @@ public _FinalStage x5U(Optional x5U) { *

Y coordinate

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage y(String y) { this.y = Optional.ofNullable(y); return this; @@ -487,7 +487,7 @@ public _FinalStage y(String y) { /** *

Y coordinate

*/ - @java.lang.Override + @Override @JsonSetter(value = "y", nulls = Nulls.SKIP) public _FinalStage y(Optional y) { this.y = y; @@ -498,7 +498,7 @@ public _FinalStage y(Optional y) { *

X coordinate

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage x(String x) { this.x = Optional.ofNullable(x); return this; @@ -507,20 +507,20 @@ public _FinalStage x(String x) { /** *

X coordinate

*/ - @java.lang.Override + @Override @JsonSetter(value = "x", nulls = Nulls.SKIP) public _FinalStage x(Optional x) { this.x = x; return this; } - @java.lang.Override + @Override public _FinalStage crv(CustomSigningKeyCurveEnum crv) { this.crv = Optional.ofNullable(crv); return this; } - @java.lang.Override + @Override @JsonSetter(value = "crv", nulls = Nulls.SKIP) public _FinalStage crv(Optional crv) { this.crv = crv; @@ -531,7 +531,7 @@ public _FinalStage crv(Optional crv) { *

Key exponent

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage e(String e) { this.e = Optional.ofNullable(e); return this; @@ -540,7 +540,7 @@ public _FinalStage e(String e) { /** *

Key exponent

*/ - @java.lang.Override + @Override @JsonSetter(value = "e", nulls = Nulls.SKIP) public _FinalStage e(Optional e) { this.e = e; @@ -551,7 +551,7 @@ public _FinalStage e(Optional e) { *

Key modulus

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage n(String n) { this.n = Optional.ofNullable(n); return this; @@ -560,20 +560,20 @@ public _FinalStage n(String n) { /** *

Key modulus

*/ - @java.lang.Override + @Override @JsonSetter(value = "n", nulls = Nulls.SKIP) public _FinalStage n(Optional n) { this.n = n; return this; } - @java.lang.Override + @Override public _FinalStage alg(CustomSigningKeyAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -584,7 +584,7 @@ public _FinalStage alg(Optional alg) { *

Key operations

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyOps(List keyOps) { this.keyOps = Optional.ofNullable(keyOps); return this; @@ -593,20 +593,20 @@ public _FinalStage keyOps(List keyOps) { /** *

Key operations

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_ops", nulls = Nulls.SKIP) public _FinalStage keyOps(Optional> keyOps) { this.keyOps = keyOps; return this; } - @java.lang.Override + @Override public _FinalStage use(String use) { this.use = Optional.ofNullable(use); return this; } - @java.lang.Override + @Override @JsonSetter(value = "use", nulls = Nulls.SKIP) public _FinalStage use(Optional use) { this.use = use; @@ -617,7 +617,7 @@ public _FinalStage use(Optional use) { *

Key identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage kid(String kid) { this.kid = Optional.ofNullable(kid); return this; @@ -626,14 +626,14 @@ public _FinalStage kid(String kid) { /** *

Key identifier

*/ - @java.lang.Override + @Override @JsonSetter(value = "kid", nulls = Nulls.SKIP) public _FinalStage kid(Optional kid) { this.kid = kid; return this; } - @java.lang.Override + @Override public CustomSigningKeyJwk build() { return new CustomSigningKeyJwk( kty, kid, use, keyOps, alg, n, e, crv, x, y, x5U, x5C, x5T, x5TS256, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java index c5436f6bf..43188b8bf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyTypeEnum && this.string.equals(((CustomSigningKeyTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DailyStats.java b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java index 9a9419276..98ee23bdb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DailyStats.java +++ b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java @@ -99,7 +99,7 @@ public Optional getCreatedAt() { return createdAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DailyStats && equalTo((DailyStats) other); @@ -119,12 +119,12 @@ private boolean equalTo(DailyStats other) { && createdAt.equals(other.createdAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.date, this.logins, this.signups, this.leakedPasswords, this.updatedAt, this.createdAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java index 588640ef6..0cf0f3727 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java @@ -45,7 +45,7 @@ public Optional getOrganizations() { return organizations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DefaultTokenQuota && equalTo((DefaultTokenQuota) other); @@ -60,12 +60,12 @@ private boolean equalTo(DefaultTokenQuota other) { return clients.equals(other.clients) && organizations.equals(other.organizations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clients, this.organizations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java index 5f1777c0f..c4e1c02a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java @@ -50,7 +50,7 @@ private OptionalNullable _getForce() { return force; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteActionRequestParameters && equalTo((DeleteActionRequestParameters) other); @@ -65,12 +65,12 @@ private boolean equalTo(DeleteActionRequestParameters other) { return force.equals(other.force); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.force); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java index 3a5d3b645..e7297f86a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java @@ -36,7 +36,7 @@ public String getIdentifier() { return identifier; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserBlocksByIdentifierRequestParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteUserBlocksByIdentifierRequestParameters other) { return identifier.equals(other.identifier); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifier); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeleteUserBlocksByIdentifierRequestParameters other) { identifier(other.getIdentifier()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteUserBlocksByIdentifierRequestParameters other) { *

Should be any of a username, phone number, or email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } - @java.lang.Override + @Override public DeleteUserBlocksByIdentifierRequestParameters build() { return new DeleteUserBlocksByIdentifierRequestParameters(identifier, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java index 4f2c23fe2..9fb537545 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java @@ -36,7 +36,7 @@ public String getUserId() { return userId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserGrantByUserIdRequestParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteUserGrantByUserIdRequestParameters other) { return userId.equals(other.userId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(DeleteUserGrantByUserIdRequestParameters other) { userId(other.getUserId()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteUserGrantByUserIdRequestParameters other) { *

user_id of the grant to delete.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @java.lang.Override + @Override public DeleteUserGrantByUserIdRequestParameters build() { return new DeleteUserGrantByUserIdRequestParameters(userId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java index becb6c2ed..860507195 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java @@ -121,7 +121,7 @@ public Optional getProfileData() { return profileData; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserIdentityResponseContentItem @@ -144,7 +144,7 @@ private boolean equalTo(DeleteUserIdentityResponseContentItem other) { && profileData.equals(other.profileData); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connection, @@ -157,7 +157,7 @@ public int hashCode() { this.profileData); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -248,7 +248,7 @@ public static final class Builder implements ConnectionStage, UserIdStage, Provi private Builder() {} - @java.lang.Override + @Override public Builder from(DeleteUserIdentityResponseContentItem other) { connection(other.getConnection()); userId(other.getUserId()); @@ -266,7 +266,7 @@ public Builder from(DeleteUserIdentityResponseContentItem other) { *

The name of the connection for the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection") public UserIdStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -278,7 +278,7 @@ public UserIdStage connection(@NotNull String connection) { *

The unique identifier for the user for the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public ProviderStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -290,20 +290,20 @@ public ProviderStage userId(@NotNull String userId) { *

The type of identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull String provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage profileData(UserProfileData profileData) { this.profileData = Optional.ofNullable(profileData); return this; } - @java.lang.Override + @Override @JsonSetter(value = "profileData", nulls = Nulls.SKIP) public _FinalStage profileData(Optional profileData) { this.profileData = profileData; @@ -314,7 +314,7 @@ public _FinalStage profileData(Optional profileData) { *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage refreshToken(String refreshToken) { this.refreshToken = Optional.ofNullable(refreshToken); return this; @@ -323,7 +323,7 @@ public _FinalStage refreshToken(String refreshToken) { /** *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

*/ - @java.lang.Override + @Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(Optional refreshToken) { this.refreshToken = refreshToken; @@ -334,7 +334,7 @@ public _FinalStage refreshToken(Optional refreshToken) { *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage accessTokenSecret(String accessTokenSecret) { this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); return this; @@ -343,7 +343,7 @@ public _FinalStage accessTokenSecret(String accessTokenSecret) { /** *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

*/ - @java.lang.Override + @Override @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) public _FinalStage accessTokenSecret(Optional accessTokenSecret) { this.accessTokenSecret = accessTokenSecret; @@ -354,7 +354,7 @@ public _FinalStage accessTokenSecret(Optional accessTokenSecret) { *

IDP access token returned only if scope read:user_idp_tokens is defined

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage accessToken(String accessToken) { this.accessToken = Optional.ofNullable(accessToken); return this; @@ -363,7 +363,7 @@ public _FinalStage accessToken(String accessToken) { /** *

IDP access token returned only if scope read:user_idp_tokens is defined

*/ - @java.lang.Override + @Override @JsonSetter(value = "access_token", nulls = Nulls.SKIP) public _FinalStage accessToken(Optional accessToken) { this.accessToken = accessToken; @@ -374,7 +374,7 @@ public _FinalStage accessToken(Optional accessToken) { *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isSocial(Boolean isSocial) { this.isSocial = Optional.ofNullable(isSocial); return this; @@ -383,14 +383,14 @@ public _FinalStage isSocial(Boolean isSocial) { /** *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

*/ - @java.lang.Override + @Override @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) public _FinalStage isSocial(Optional isSocial) { this.isSocial = isSocial; return this; } - @java.lang.Override + @Override public DeleteUserIdentityResponseContentItem build() { return new DeleteUserIdentityResponseContentItem( connection, diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java index e1e24fac8..b191bbe37 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java @@ -122,7 +122,7 @@ public Optional> getDependencies() { } /** - * @return Indicates if this speciic version is the currently one deployed. + * @return Indicates if this specific version is the currently one deployed. */ @JsonProperty("deployed") public Optional getDeployed() { @@ -130,7 +130,7 @@ public Optional getDeployed() { } /** - * @return The Node runtime. For example: node12 + * @return The Node runtime. For example: node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -203,7 +203,7 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionResponseContent && equalTo((DeployActionResponseContent) other); @@ -232,7 +232,7 @@ private boolean equalTo(DeployActionResponseContent other) { && supportedTriggers.equals(other.supportedTriggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -252,7 +252,7 @@ public int hashCode() { this.supportedTriggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -374,7 +374,7 @@ public Builder dependencies(List dependencies) { } /** - *

Indicates if this speciic version is the currently one deployed.

+ *

Indicates if this specific version is the currently one deployed.

*/ @JsonSetter(value = "deployed", nulls = Nulls.SKIP) public Builder deployed(Optional deployed) { @@ -388,7 +388,7 @@ public Builder deployed(Boolean deployed) { } /** - *

The Node runtime. For example: node12

+ *

The Node runtime. For example: node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java index 13bba7690..ea01b34be 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java @@ -38,7 +38,7 @@ public Optional getUpdateDraft() { return updateDraft; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionVersionRequestBodyParams @@ -54,12 +54,12 @@ private boolean equalTo(DeployActionVersionRequestBodyParams other) { return updateDraft.equals(other.updateDraft); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.updateDraft); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java index dd38f3580..5223460a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java @@ -122,7 +122,7 @@ public Optional> getDependencies() { } /** - * @return Indicates if this speciic version is the currently one deployed. + * @return Indicates if this specific version is the currently one deployed. */ @JsonProperty("deployed") public Optional getDeployed() { @@ -130,7 +130,7 @@ public Optional getDeployed() { } /** - * @return The Node runtime. For example: node12 + * @return The Node runtime. For example: node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -203,7 +203,7 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionVersionResponseContent @@ -233,7 +233,7 @@ private boolean equalTo(DeployActionVersionResponseContent other) { && supportedTriggers.equals(other.supportedTriggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -253,7 +253,7 @@ public int hashCode() { this.supportedTriggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -375,7 +375,7 @@ public Builder dependencies(List dependencies) { } /** - *

Indicates if this speciic version is the currently one deployed.

+ *

Indicates if this specific version is the currently one deployed.

*/ @JsonSetter(value = "deployed", nulls = Nulls.SKIP) public Builder deployed(Optional deployed) { @@ -389,7 +389,7 @@ public Builder deployed(Boolean deployed) { } /** - *

The Node runtime. For example: node12

+ *

The Node runtime. For example: node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java index 43b299cd1..5189a0f6e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java @@ -96,7 +96,7 @@ public Optional getClientId() { return clientId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeviceCredential && equalTo((DeviceCredential) other); @@ -116,12 +116,12 @@ private boolean equalTo(DeviceCredential other) { && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.deviceName, this.deviceId, this.type, this.userId, this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java index 10fe7a1ae..621027f62 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof DeviceCredentialTypeEnum && this.string.equals(((DeviceCredentialTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java new file mode 100644 index 000000000..0187f548f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DirectoryProvisioningMappingItem.Builder.class) +public final class DirectoryProvisioningMappingItem { + private final String auth0; + + private final String idp; + + private final Map additionalProperties; + + private DirectoryProvisioningMappingItem(String auth0, String idp, Map additionalProperties) { + this.auth0 = auth0; + this.idp = idp; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field location in the Auth0 schema + */ + @JsonProperty("auth0") + public String getAuth0() { + return auth0; + } + + /** + * @return The field location in the IDP schema + */ + @JsonProperty("idp") + public String getIdp() { + return idp; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DirectoryProvisioningMappingItem && equalTo((DirectoryProvisioningMappingItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DirectoryProvisioningMappingItem other) { + return auth0.equals(other.auth0) && idp.equals(other.idp); + } + + @Override + public int hashCode() { + return Objects.hash(this.auth0, this.idp); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Auth0Stage builder() { + return new Builder(); + } + + public interface Auth0Stage { + /** + *

The field location in the Auth0 schema

+ */ + IdpStage auth0(@NotNull String auth0); + + Builder from(DirectoryProvisioningMappingItem other); + } + + public interface IdpStage { + /** + *

The field location in the IDP schema

+ */ + _FinalStage idp(@NotNull String idp); + } + + public interface _FinalStage { + DirectoryProvisioningMappingItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements Auth0Stage, IdpStage, _FinalStage { + private String auth0; + + private String idp; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(DirectoryProvisioningMappingItem other) { + auth0(other.getAuth0()); + idp(other.getIdp()); + return this; + } + + /** + *

The field location in the Auth0 schema

+ *

The field location in the Auth0 schema

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("auth0") + public IdpStage auth0(@NotNull String auth0) { + this.auth0 = Objects.requireNonNull(auth0, "auth0 must not be null"); + return this; + } + + /** + *

The field location in the IDP schema

+ *

The field location in the IDP schema

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("idp") + public _FinalStage idp(@NotNull String idp) { + this.idp = Objects.requireNonNull(idp, "idp must not be null"); + return this; + } + + @Override + public DirectoryProvisioningMappingItem build() { + return new DirectoryProvisioningMappingItem(auth0, idp, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java new file mode 100644 index 000000000..688750fac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DomainCertificate.Builder.class) +public final class DomainCertificate { + private final Optional status; + + private final Optional errorMsg; + + private final Optional certificateAuthority; + + private final Optional renewsBefore; + + private final Map additionalProperties; + + private DomainCertificate( + Optional status, + Optional errorMsg, + Optional certificateAuthority, + Optional renewsBefore, + Map additionalProperties) { + this.status = status; + this.errorMsg = errorMsg; + this.certificateAuthority = certificateAuthority; + this.renewsBefore = renewsBefore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return A user-friendly error message will be presented if the certificate status is provisioning_failed or renewing_failed. + */ + @JsonProperty("error_msg") + public Optional getErrorMsg() { + return errorMsg; + } + + @JsonProperty("certificate_authority") + public Optional getCertificateAuthority() { + return certificateAuthority; + } + + /** + * @return The certificate will be renewed prior to this date. + */ + @JsonProperty("renews_before") + public Optional getRenewsBefore() { + return renewsBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DomainCertificate && equalTo((DomainCertificate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DomainCertificate other) { + return status.equals(other.status) + && errorMsg.equals(other.errorMsg) + && certificateAuthority.equals(other.certificateAuthority) + && renewsBefore.equals(other.renewsBefore); + } + + @Override + public int hashCode() { + return Objects.hash(this.status, this.errorMsg, this.certificateAuthority, this.renewsBefore); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional status = Optional.empty(); + + private Optional errorMsg = Optional.empty(); + + private Optional certificateAuthority = Optional.empty(); + + private Optional renewsBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DomainCertificate other) { + status(other.getStatus()); + errorMsg(other.getErrorMsg()); + certificateAuthority(other.getCertificateAuthority()); + renewsBefore(other.getRenewsBefore()); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(DomainCertificateStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

A user-friendly error message will be presented if the certificate status is provisioning_failed or renewing_failed.

+ */ + @JsonSetter(value = "error_msg", nulls = Nulls.SKIP) + public Builder errorMsg(Optional errorMsg) { + this.errorMsg = errorMsg; + return this; + } + + public Builder errorMsg(String errorMsg) { + this.errorMsg = Optional.ofNullable(errorMsg); + return this; + } + + @JsonSetter(value = "certificate_authority", nulls = Nulls.SKIP) + public Builder certificateAuthority(Optional certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + public Builder certificateAuthority(DomainCertificateAuthorityEnum certificateAuthority) { + this.certificateAuthority = Optional.ofNullable(certificateAuthority); + return this; + } + + /** + *

The certificate will be renewed prior to this date.

+ */ + @JsonSetter(value = "renews_before", nulls = Nulls.SKIP) + public Builder renewsBefore(Optional renewsBefore) { + this.renewsBefore = renewsBefore; + return this; + } + + public Builder renewsBefore(String renewsBefore) { + this.renewsBefore = Optional.ofNullable(renewsBefore); + return this; + } + + public DomainCertificate build() { + return new DomainCertificate(status, errorMsg, certificateAuthority, renewsBefore, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java new file mode 100644 index 000000000..edec82da4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DomainCertificateAuthorityEnum { + public static final DomainCertificateAuthorityEnum LETSENCRYPT = + new DomainCertificateAuthorityEnum(Value.LETSENCRYPT, "letsencrypt"); + + public static final DomainCertificateAuthorityEnum GOOGLETRUST = + new DomainCertificateAuthorityEnum(Value.GOOGLETRUST, "googletrust"); + + private final Value value; + + private final String string; + + DomainCertificateAuthorityEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DomainCertificateAuthorityEnum + && this.string.equals(((DomainCertificateAuthorityEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LETSENCRYPT: + return visitor.visitLetsencrypt(); + case GOOGLETRUST: + return visitor.visitGoogletrust(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DomainCertificateAuthorityEnum valueOf(String value) { + switch (value) { + case "letsencrypt": + return LETSENCRYPT; + case "googletrust": + return GOOGLETRUST; + default: + return new DomainCertificateAuthorityEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + LETSENCRYPT, + + GOOGLETRUST, + + UNKNOWN + } + + public interface Visitor { + T visitLetsencrypt(); + + T visitGoogletrust(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java new file mode 100644 index 000000000..eafe644aa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DomainCertificateStatusEnum { + public static final DomainCertificateStatusEnum PROVISIONING_FAILED = + new DomainCertificateStatusEnum(Value.PROVISIONING_FAILED, "provisioning_failed"); + + public static final DomainCertificateStatusEnum PROVISIONING = + new DomainCertificateStatusEnum(Value.PROVISIONING, "provisioning"); + + public static final DomainCertificateStatusEnum RENEWING_FAILED = + new DomainCertificateStatusEnum(Value.RENEWING_FAILED, "renewing_failed"); + + public static final DomainCertificateStatusEnum PROVISIONED = + new DomainCertificateStatusEnum(Value.PROVISIONED, "provisioned"); + + private final Value value; + + private final String string; + + DomainCertificateStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DomainCertificateStatusEnum + && this.string.equals(((DomainCertificateStatusEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PROVISIONING_FAILED: + return visitor.visitProvisioningFailed(); + case PROVISIONING: + return visitor.visitProvisioning(); + case RENEWING_FAILED: + return visitor.visitRenewingFailed(); + case PROVISIONED: + return visitor.visitProvisioned(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DomainCertificateStatusEnum valueOf(String value) { + switch (value) { + case "provisioning_failed": + return PROVISIONING_FAILED; + case "provisioning": + return PROVISIONING; + case "renewing_failed": + return RENEWING_FAILED; + case "provisioned": + return PROVISIONED; + default: + return new DomainCertificateStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PROVISIONING, + + PROVISIONING_FAILED, + + PROVISIONED, + + RENEWING_FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitProvisioning(); + + T visitProvisioningFailed(); + + T visitProvisioned(); + + T visitRenewingFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java index e11b88b77..19427089e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java @@ -23,11 +23,24 @@ public final class DomainVerification { private final Optional> methods; + private final Optional status; + + private final Optional errorMsg; + + private final Optional lastVerifiedAt; + private final Map additionalProperties; private DomainVerification( - Optional> methods, Map additionalProperties) { + Optional> methods, + Optional status, + Optional errorMsg, + Optional lastVerifiedAt, + Map additionalProperties) { this.methods = methods; + this.status = status; + this.errorMsg = errorMsg; + this.lastVerifiedAt = lastVerifiedAt; this.additionalProperties = additionalProperties; } @@ -39,7 +52,28 @@ public Optional> getMethods() { return methods; } - @java.lang.Override + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The user0-friendly error message in case of failed verification. This field is relevant only for Custom Domains with Auth0-Managed Certificates. + */ + @JsonProperty("error_msg") + public Optional getErrorMsg() { + return errorMsg; + } + + /** + * @return The date and time when the custom domain was last verified. This field is relevant only for Custom Domains with Auth0-Managed Certificates. + */ + @JsonProperty("last_verified_at") + public Optional getLastVerifiedAt() { + return lastVerifiedAt; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DomainVerification && equalTo((DomainVerification) other); @@ -51,15 +85,18 @@ public Map getAdditionalProperties() { } private boolean equalTo(DomainVerification other) { - return methods.equals(other.methods); + return methods.equals(other.methods) + && status.equals(other.status) + && errorMsg.equals(other.errorMsg) + && lastVerifiedAt.equals(other.lastVerifiedAt); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.methods); + return Objects.hash(this.methods, this.status, this.errorMsg, this.lastVerifiedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -72,6 +109,12 @@ public static Builder builder() { public static final class Builder { private Optional> methods = Optional.empty(); + private Optional status = Optional.empty(); + + private Optional errorMsg = Optional.empty(); + + private Optional lastVerifiedAt = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -79,6 +122,9 @@ private Builder() {} public Builder from(DomainVerification other) { methods(other.getMethods()); + status(other.getStatus()); + errorMsg(other.getErrorMsg()); + lastVerifiedAt(other.getLastVerifiedAt()); return this; } @@ -96,8 +142,47 @@ public Builder methods(List methods) { return this; } + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(DomainVerificationStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

The user0-friendly error message in case of failed verification. This field is relevant only for Custom Domains with Auth0-Managed Certificates.

+ */ + @JsonSetter(value = "error_msg", nulls = Nulls.SKIP) + public Builder errorMsg(Optional errorMsg) { + this.errorMsg = errorMsg; + return this; + } + + public Builder errorMsg(String errorMsg) { + this.errorMsg = Optional.ofNullable(errorMsg); + return this; + } + + /** + *

The date and time when the custom domain was last verified. This field is relevant only for Custom Domains with Auth0-Managed Certificates.

+ */ + @JsonSetter(value = "last_verified_at", nulls = Nulls.SKIP) + public Builder lastVerifiedAt(Optional lastVerifiedAt) { + this.lastVerifiedAt = lastVerifiedAt; + return this; + } + + public Builder lastVerifiedAt(String lastVerifiedAt) { + this.lastVerifiedAt = Optional.ofNullable(lastVerifiedAt); + return this; + } + public DomainVerification build() { - return new DomainVerification(methods, additionalProperties); + return new DomainVerification(methods, status, errorMsg, lastVerifiedAt, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java index d34982711..fa78c5b1f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java @@ -61,7 +61,7 @@ public Optional getDomain() { return domain; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DomainVerificationMethod && equalTo((DomainVerificationMethod) other); @@ -76,12 +76,12 @@ private boolean equalTo(DomainVerificationMethod other) { return name.equals(other.name) && record.equals(other.record) && domain.equals(other.domain); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.record, this.domain); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements NameStage, RecordStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(DomainVerificationMethod other) { name(other.getName()); record(other.getRecord()); @@ -135,7 +135,7 @@ public Builder from(DomainVerificationMethod other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public RecordStage name(@NotNull DomainVerificationMethodNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -147,7 +147,7 @@ public RecordStage name(@NotNull DomainVerificationMethodNameEnum name) { *

Value used to verify the domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("record") public _FinalStage record(@NotNull String record) { this.record = Objects.requireNonNull(record, "record must not be null"); @@ -158,7 +158,7 @@ public _FinalStage record(@NotNull String record) { *

The name of the txt record for verification

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage domain(String domain) { this.domain = Optional.ofNullable(domain); return this; @@ -167,14 +167,14 @@ public _FinalStage domain(String domain) { /** *

The name of the txt record for verification

*/ - @java.lang.Override + @Override @JsonSetter(value = "domain", nulls = Nulls.SKIP) public _FinalStage domain(Optional domain) { this.domain = domain; return this; } - @java.lang.Override + @Override public DomainVerificationMethod build() { return new DomainVerificationMethod(name, record, domain, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java index f41d37983..6c499d74a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof DomainVerificationMethodNameEnum && this.string.equals(((DomainVerificationMethodNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java new file mode 100644 index 000000000..18c5ac3c0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DomainVerificationStatusEnum { + public static final DomainVerificationStatusEnum FAILED = new DomainVerificationStatusEnum(Value.FAILED, "failed"); + + public static final DomainVerificationStatusEnum PENDING = + new DomainVerificationStatusEnum(Value.PENDING, "pending"); + + public static final DomainVerificationStatusEnum VERIFIED = + new DomainVerificationStatusEnum(Value.VERIFIED, "verified"); + + private final Value value; + + private final String string; + + DomainVerificationStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DomainVerificationStatusEnum + && this.string.equals(((DomainVerificationStatusEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case VERIFIED: + return visitor.visitVerified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DomainVerificationStatusEnum valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "verified": + return VERIFIED; + default: + return new DomainVerificationStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + VERIFIED, + + PENDING, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitVerified(); + + T visitPending(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java index 5a0df3b96..2f9073c5e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java @@ -22,6 +22,8 @@ public final class EmailAttribute { private final Optional identifier; + private final Optional unique; + private final Optional profileRequired; private final Optional verificationMethod; @@ -32,11 +34,13 @@ public final class EmailAttribute { private EmailAttribute( Optional identifier, + Optional unique, Optional profileRequired, Optional verificationMethod, Optional signup, Map additionalProperties) { this.identifier = identifier; + this.unique = unique; this.profileRequired = profileRequired; this.verificationMethod = verificationMethod; this.signup = signup; @@ -48,6 +52,14 @@ public Optional getIdentifier() { return identifier; } + /** + * @return Determines if the attribute is unique in a given connection + */ + @JsonProperty("unique") + public Optional getUnique() { + return unique; + } + /** * @return Determines if property should be required for users */ @@ -66,7 +78,7 @@ public Optional getSignup() { return signup; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailAttribute && equalTo((EmailAttribute) other); @@ -79,17 +91,18 @@ public Map getAdditionalProperties() { private boolean equalTo(EmailAttribute other) { return identifier.equals(other.identifier) + && unique.equals(other.unique) && profileRequired.equals(other.profileRequired) && verificationMethod.equals(other.verificationMethod) && signup.equals(other.signup); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.identifier, this.profileRequired, this.verificationMethod, this.signup); + return Objects.hash(this.identifier, this.unique, this.profileRequired, this.verificationMethod, this.signup); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -102,6 +115,8 @@ public static Builder builder() { public static final class Builder { private Optional identifier = Optional.empty(); + private Optional unique = Optional.empty(); + private Optional profileRequired = Optional.empty(); private Optional verificationMethod = Optional.empty(); @@ -115,6 +130,7 @@ private Builder() {} public Builder from(EmailAttribute other) { identifier(other.getIdentifier()); + unique(other.getUnique()); profileRequired(other.getProfileRequired()); verificationMethod(other.getVerificationMethod()); signup(other.getSignup()); @@ -132,6 +148,20 @@ public Builder identifier(ConnectionAttributeIdentifier identifier) { return this; } + /** + *

Determines if the attribute is unique in a given connection

+ */ + @JsonSetter(value = "unique", nulls = Nulls.SKIP) + public Builder unique(Optional unique) { + this.unique = unique; + return this; + } + + public Builder unique(Boolean unique) { + this.unique = Optional.ofNullable(unique); + return this; + } + /** *

Determines if property should be required for users

*/ @@ -169,7 +199,8 @@ public Builder signup(SignupVerified signup) { } public EmailAttribute build() { - return new EmailAttribute(identifier, profileRequired, verificationMethod, signup, additionalProperties); + return new EmailAttribute( + identifier, unique, profileRequired, verificationMethod, signup, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java index 2de5fba4f..ffa2c19fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java @@ -87,7 +87,7 @@ public Optional getSmtpUser() { return smtpUser; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentials && equalTo((EmailProviderCredentials) other); @@ -106,12 +106,12 @@ private boolean equalTo(EmailProviderCredentials other) { && smtpUser.equals(other.smtpUser); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apiUser, this.region, this.smtpHost, this.smtpPort, this.smtpUser); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java index 2ab98a41f..dbbff238e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchema && equalTo((EmailProviderCredentialsSchema) other); @@ -61,12 +61,12 @@ private boolean equalTo(EmailProviderCredentialsSchema other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getRegion() { return region; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaAccessKeyId @@ -81,12 +81,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaAccessKeyId other) { && region.equals(other.region); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.accessKeyId, this.secretAccessKey, this.region); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java index ffd466404..37ad82baa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java @@ -60,7 +60,7 @@ public Optional getRegion() { return region; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaApiKey @@ -76,12 +76,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaApiKey other) { return apiKey.equals(other.apiKey) && domain.equals(other.domain) && region.equals(other.region); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apiKey, this.domain, this.region); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java index afd69f78a..7d0d3edaf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java @@ -63,7 +63,7 @@ public Optional getClientSecret() { return clientSecret; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaClientId @@ -81,12 +81,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaClientId other) { && clientSecret.equals(other.clientSecret); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tenantId, this.clientId, this.clientSecret); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java index 92c4c9bfe..08f82a8d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java @@ -38,7 +38,7 @@ public Optional getConnectionString() { return connectionString; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaConnectionString @@ -54,12 +54,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaConnectionString other) { return connectionString.equals(other.connectionString); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionString); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java index e32a7d5c8..cd67dd7b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java @@ -72,7 +72,7 @@ public Optional getSmtpPass() { return smtpPass; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaSmtpHost @@ -91,12 +91,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaSmtpHost other) { && smtpPass.equals(other.smtpPass); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.smtpHost, this.smtpPort, this.smtpUser, this.smtpPass); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java index 6bb0d8525..ece99afba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java @@ -46,7 +46,7 @@ public Optional getRegion() { return region; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaThree @@ -62,12 +62,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaThree other) { return apiKey.equals(other.apiKey) && region.equals(other.region); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apiKey, this.region); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java index 330800496..edf2cbe86 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java @@ -36,7 +36,7 @@ public String getApiKey() { return apiKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaZero @@ -52,12 +52,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaZero other) { return apiKey.equals(other.apiKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apiKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements ApiKeyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(EmailProviderCredentialsSchemaZero other) { apiKey(other.getApiKey()); return this; @@ -99,14 +99,14 @@ public Builder from(EmailProviderCredentialsSchemaZero other) { *

API Key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @java.lang.Override + @Override public EmailProviderCredentialsSchemaZero build() { return new EmailProviderCredentialsSchemaZero(apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java index 3adaf39e7..447f5c46a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java @@ -38,20 +38,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EmailProviderNameEnum && this.string.equals(((EmailProviderNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java index cde3175c9..26b788895 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java @@ -58,20 +58,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EmailTemplateNameEnum && this.string.equals(((EmailTemplateNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java b/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java new file mode 100644 index 000000000..469b23b9a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EnabledFeaturesEnum { + public static final EnabledFeaturesEnum SCIM = new EnabledFeaturesEnum(Value.SCIM, "scim"); + + public static final EnabledFeaturesEnum UNIVERSAL_LOGOUT = + new EnabledFeaturesEnum(Value.UNIVERSAL_LOGOUT, "universal_logout"); + + private final Value value; + + private final String string; + + EnabledFeaturesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EnabledFeaturesEnum && this.string.equals(((EnabledFeaturesEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCIM: + return visitor.visitScim(); + case UNIVERSAL_LOGOUT: + return visitor.visitUniversalLogout(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EnabledFeaturesEnum valueOf(String value) { + switch (value) { + case "scim": + return SCIM; + case "universal_logout": + return UNIVERSAL_LOGOUT; + default: + return new EnabledFeaturesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SCIM, + + UNIVERSAL_LOGOUT, + + UNKNOWN + } + + public interface Visitor { + T visitScim(); + + T visitUniversalLogout(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java index 98b0a4c6e..3e597f294 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EncryptionKey && equalTo((EncryptionKey) other); @@ -128,13 +128,13 @@ private boolean equalTo(EncryptionKey other) { && publicKey.equals(other.publicKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -214,7 +214,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(EncryptionKey other) { kid(other.getKid()); type(other.getType()); @@ -231,21 +231,21 @@ public Builder from(EncryptionKey other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -257,7 +257,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -269,7 +269,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -281,7 +281,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -292,7 +292,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -301,14 +301,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @java.lang.Override + @Override public EncryptionKey build() { return new EncryptionKey( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java index 50b5ab6a8..44d4c43f9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java @@ -29,19 +29,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EncryptionKeyState && this.string.equals(((EncryptionKeyState) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java index 6eaa7164b..658d47cac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java @@ -32,19 +32,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EncryptionKeyType && this.string.equals(((EncryptionKeyType) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java index daaeb1ecb..88dd55414 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java @@ -36,7 +36,7 @@ public String getActionId() { return actionId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionConfiguration && equalTo((EventStreamActionConfiguration) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamActionConfiguration other) { return actionId.equals(other.actionId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.actionId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ActionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamActionConfiguration other) { actionId(other.getActionId()); return this; @@ -98,14 +98,14 @@ public Builder from(EventStreamActionConfiguration other) { *

Action ID for the action destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("action_id") public _FinalStage actionId(@NotNull String actionId) { this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); return this; } - @java.lang.Override + @Override public EventStreamActionConfiguration build() { return new EventStreamActionConfiguration(actionId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java index 9e8f5e045..c75f54d9d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java @@ -42,7 +42,7 @@ public EventStreamActionConfiguration getConfiguration() { return configuration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionDestination && equalTo((EventStreamActionDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamActionDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamActionDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamActionConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @java.lang.Override + @Override public EventStreamActionDestination build() { return new EventStreamActionDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java index a79e68339..d464f692d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionResponseContent && equalTo((EventStreamActionResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(EventStreamActionResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java deleted file mode 100644 index 74c7e1bd1..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamBucketInterval.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EventStreamBucketInterval.Builder.class) -public final class EventStreamBucketInterval { - private final int scaleFactor; - - private final Map additionalProperties; - - private EventStreamBucketInterval(int scaleFactor, Map additionalProperties) { - this.scaleFactor = scaleFactor; - this.additionalProperties = additionalProperties; - } - - /** - * @return Time interval in seconds for each bucket. - */ - @JsonProperty("scale_factor") - public int getScaleFactor() { - return scaleFactor; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EventStreamBucketInterval && equalTo((EventStreamBucketInterval) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EventStreamBucketInterval other) { - return scaleFactor == other.scaleFactor; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.scaleFactor); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ScaleFactorStage builder() { - return new Builder(); - } - - public interface ScaleFactorStage { - /** - *

Time interval in seconds for each bucket.

- */ - _FinalStage scaleFactor(int scaleFactor); - - Builder from(EventStreamBucketInterval other); - } - - public interface _FinalStage { - EventStreamBucketInterval build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ScaleFactorStage, _FinalStage { - private int scaleFactor; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EventStreamBucketInterval other) { - scaleFactor(other.getScaleFactor()); - return this; - } - - /** - *

Time interval in seconds for each bucket.

- *

Time interval in seconds for each bucket.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("scale_factor") - public _FinalStage scaleFactor(int scaleFactor) { - this.scaleFactor = scaleFactor; - return this; - } - - @java.lang.Override - public EventStreamBucketInterval build() { - return new EventStreamBucketInterval(scaleFactor, additionalProperties); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java index 1bc25e7b7..5aedd4f60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java @@ -100,7 +100,7 @@ public Optional getData() { return data; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamCloudEvent && equalTo((EventStreamCloudEvent) other); @@ -120,12 +120,12 @@ private boolean equalTo(EventStreamCloudEvent other) { && data.equals(other.data); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.source, this.specversion, this.type, this.time, this.data); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java index a776201db..29861a79f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDelivery && equalTo((EventStreamDelivery) other); @@ -113,12 +113,12 @@ private boolean equalTo(EventStreamDelivery other) { && event.equals(other.event); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -187,7 +187,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamDelivery other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -203,7 +203,7 @@ public Builder from(EventStreamDelivery other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -215,34 +215,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @java.lang.Override + @Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -253,7 +253,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -265,7 +265,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -274,7 +274,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @java.lang.Override + @Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -284,7 +284,7 @@ public _FinalStage attempts(List attempts) { return this; } - @java.lang.Override + @Override public EventStreamDelivery build() { return new EventStreamDelivery(id, eventStreamId, status, eventType, attempts, event, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java index 9b421de2c..651766025 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java @@ -62,7 +62,7 @@ public Optional getErrorMessage() { return errorMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDeliveryAttempt && equalTo((EventStreamDeliveryAttempt) other); @@ -79,12 +79,12 @@ private boolean equalTo(EventStreamDeliveryAttempt other) { && errorMessage.equals(other.errorMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status, this.timestamp, this.errorMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -130,7 +130,7 @@ public static final class Builder implements StatusStage, TimestampStage, _Final private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamDeliveryAttempt other) { status(other.getStatus()); timestamp(other.getTimestamp()); @@ -138,7 +138,7 @@ public Builder from(EventStreamDeliveryAttempt other) { return this; } - @java.lang.Override + @Override @JsonSetter("status") public TimestampStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -150,7 +150,7 @@ public TimestampStage status(@NotNull String status) { *

Timestamp of delivery attempt

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("timestamp") public _FinalStage timestamp(@NotNull OffsetDateTime timestamp) { this.timestamp = Objects.requireNonNull(timestamp, "timestamp must not be null"); @@ -161,7 +161,7 @@ public _FinalStage timestamp(@NotNull OffsetDateTime timestamp) { *

Delivery error message, if applicable

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage errorMessage(String errorMessage) { this.errorMessage = Optional.ofNullable(errorMessage); return this; @@ -170,14 +170,14 @@ public _FinalStage errorMessage(String errorMessage) { /** *

Delivery error message, if applicable

*/ - @java.lang.Override + @Override @JsonSetter(value = "error_message", nulls = Nulls.SKIP) public _FinalStage errorMessage(Optional errorMessage) { this.errorMessage = errorMessage; return this; } - @java.lang.Override + @Override public EventStreamDeliveryAttempt build() { return new EventStreamDeliveryAttempt(status, timestamp, errorMessage, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java index bdbd999c3..aef337ea9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class EventStreamDeliveryEventTypeEnum { + public static final EventStreamDeliveryEventTypeEnum GROUP_DELETED = + new EventStreamDeliveryEventTypeEnum(Value.GROUP_DELETED, "group.deleted"); + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_CONNECTION_ADDED = new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); @@ -29,6 +32,15 @@ public final class EventStreamDeliveryEventTypeEnum { public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_UPDATED = new EventStreamDeliveryEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + public static final EventStreamDeliveryEventTypeEnum GROUP_MEMBER_ADDED = + new EventStreamDeliveryEventTypeEnum(Value.GROUP_MEMBER_ADDED, "group.member.added"); + + public static final EventStreamDeliveryEventTypeEnum GROUP_CREATED = + new EventStreamDeliveryEventTypeEnum(Value.GROUP_CREATED, "group.created"); + + public static final EventStreamDeliveryEventTypeEnum GROUP_UPDATED = + new EventStreamDeliveryEventTypeEnum(Value.GROUP_UPDATED, "group.updated"); + public static final EventStreamDeliveryEventTypeEnum USER_CREATED = new EventStreamDeliveryEventTypeEnum(Value.USER_CREATED, "user.created"); @@ -36,6 +48,9 @@ public final class EventStreamDeliveryEventTypeEnum { new EventStreamDeliveryEventTypeEnum( Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + public static final EventStreamDeliveryEventTypeEnum GROUP_MEMBER_DELETED = + new EventStreamDeliveryEventTypeEnum(Value.GROUP_MEMBER_DELETED, "group.member.deleted"); + public static final EventStreamDeliveryEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = new EventStreamDeliveryEventTypeEnum( Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); @@ -63,26 +78,28 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamDeliveryEventTypeEnum && this.string.equals(((EventStreamDeliveryEventTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } public T visit(Visitor visitor) { switch (value) { + case GROUP_DELETED: + return visitor.visitGroupDeleted(); case ORGANIZATION_CONNECTION_ADDED: return visitor.visitOrganizationConnectionAdded(); case USER_DELETED: @@ -97,10 +114,18 @@ public T visit(Visitor visitor) { return visitor.visitOrganizationMemberDeleted(); case ORGANIZATION_UPDATED: return visitor.visitOrganizationUpdated(); + case GROUP_MEMBER_ADDED: + return visitor.visitGroupMemberAdded(); + case GROUP_CREATED: + return visitor.visitGroupCreated(); + case GROUP_UPDATED: + return visitor.visitGroupUpdated(); case USER_CREATED: return visitor.visitUserCreated(); case ORGANIZATION_CONNECTION_REMOVED: return visitor.visitOrganizationConnectionRemoved(); + case GROUP_MEMBER_DELETED: + return visitor.visitGroupMemberDeleted(); case ORGANIZATION_MEMBER_ROLE_ASSIGNED: return visitor.visitOrganizationMemberRoleAssigned(); case ORGANIZATION_DELETED: @@ -118,6 +143,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static EventStreamDeliveryEventTypeEnum valueOf(String value) { switch (value) { + case "group.deleted": + return GROUP_DELETED; case "organization.connection.added": return ORGANIZATION_CONNECTION_ADDED; case "user.deleted": @@ -132,10 +159,18 @@ public static EventStreamDeliveryEventTypeEnum valueOf(String value) { return ORGANIZATION_MEMBER_DELETED; case "organization.updated": return ORGANIZATION_UPDATED; + case "group.member.added": + return GROUP_MEMBER_ADDED; + case "group.created": + return GROUP_CREATED; + case "group.updated": + return GROUP_UPDATED; case "user.created": return USER_CREATED; case "organization.connection.removed": return ORGANIZATION_CONNECTION_REMOVED; + case "group.member.deleted": + return GROUP_MEMBER_DELETED; case "organization.member.role.assigned": return ORGANIZATION_MEMBER_ROLE_ASSIGNED; case "organization.deleted": @@ -176,6 +211,16 @@ public enum Value { ORGANIZATION_CONNECTION_REMOVED, + GROUP_CREATED, + + GROUP_UPDATED, + + GROUP_DELETED, + + GROUP_MEMBER_ADDED, + + GROUP_MEMBER_DELETED, + UNKNOWN } @@ -206,6 +251,16 @@ public interface Visitor { T visitOrganizationConnectionRemoved(); + T visitGroupCreated(); + + T visitGroupUpdated(); + + T visitGroupDeleted(); + + T visitGroupMemberAdded(); + + T visitGroupMemberDeleted(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java index f764532ca..37fa33660 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDestinationPatch && equalTo((EventStreamDestinationPatch) other); @@ -49,12 +49,12 @@ private boolean equalTo(EventStreamDestinationPatch other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { switch (value) { + case EU_SOUTH1: + return visitor.visitEuSouth1(); case AP_NORTHEAST2: return visitor.visitApNortheast2(); - case CN_NORTHWEST1: - return visitor.visitCnNorthwest1(); case AP_SOUTHEAST1: return visitor.visitApSoutheast1(); - case ME_SOUTH1: - return visitor.visitMeSouth1(); + case EU_SOUTH2: + return visitor.visitEuSouth2(); case AP_NORTHEAST3: return visitor.visitApNortheast3(); - case US_EAST1: - return visitor.visitUsEast1(); - case SA_EAST1: - return visitor.visitSaEast1(); case AP_NORTHEAST1: return visitor.visitApNortheast1(); - case US_GOV_EAST1: - return visitor.visitUsGovEast1(); - case US_EAST2: - return visitor.visitUsEast2(); - case CN_NORTH1: - return visitor.visitCnNorth1(); case AP_SOUTH1: return visitor.visitApSouth1(); case CA_CENTRAL1: return visitor.visitCaCentral1(); case EU_NORTH1: return visitor.visitEuNorth1(); - case AP_EAST1: - return visitor.visitApEast1(); + case AP_SOUTH2: + return visitor.visitApSouth2(); case US_GOV_WEST1: return visitor.visitUsGovWest1(); + case CA_WEST1: + return visitor.visitCaWest1(); + case ME_SOUTH1: + return visitor.visitMeSouth1(); + case MX_CENTRAL1: + return visitor.visitMxCentral1(); + case US_EAST1: + return visitor.visitUsEast1(); + case SA_EAST1: + return visitor.visitSaEast1(); + case AP_EAST2: + return visitor.visitApEast2(); + case US_GOV_EAST1: + return visitor.visitUsGovEast1(); + case US_EAST2: + return visitor.visitUsEast2(); + case AP_SOUTHEAST5: + return visitor.visitApSoutheast5(); + case AP_EAST1: + return visitor.visitApEast1(); + case ME_CENTRAL1: + return visitor.visitMeCentral1(); + case AP_SOUTHEAST7: + return visitor.visitApSoutheast7(); + case AP_SOUTHEAST6: + return visitor.visitApSoutheast6(); case US_WEST2: return visitor.visitUsWest2(); case EU_WEST3: return visitor.visitEuWest3(); + case AF_SOUTH1: + return visitor.visitAfSouth1(); case EU_WEST2: return visitor.visitEuWest2(); case AP_SOUTHEAST2: return visitor.visitApSoutheast2(); + case AP_SOUTHEAST4: + return visitor.visitApSoutheast4(); case EU_CENTRAL1: return visitor.visitEuCentral1(); + case IL_CENTRAL1: + return visitor.visitIlCentral1(); case US_WEST1: return visitor.visitUsWest1(); + case AP_SOUTHEAST3: + return visitor.visitApSoutheast3(); + case EU_CENTRAL2: + return visitor.visitEuCentral2(); case EU_WEST1: return visitor.visitEuWest1(); case UNKNOWN: @@ -164,50 +229,76 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static EventStreamEventBridgeAwsRegionEnum valueOf(String value) { switch (value) { + case "eu-south-1": + return EU_SOUTH1; case "ap-northeast-2": return AP_NORTHEAST2; - case "cn-northwest-1": - return CN_NORTHWEST1; case "ap-southeast-1": return AP_SOUTHEAST1; - case "me-south-1": - return ME_SOUTH1; + case "eu-south-2": + return EU_SOUTH2; case "ap-northeast-3": return AP_NORTHEAST3; - case "us-east-1": - return US_EAST1; - case "sa-east-1": - return SA_EAST1; case "ap-northeast-1": return AP_NORTHEAST1; - case "us-gov-east-1": - return US_GOV_EAST1; - case "us-east-2": - return US_EAST2; - case "cn-north-1": - return CN_NORTH1; case "ap-south-1": return AP_SOUTH1; case "ca-central-1": return CA_CENTRAL1; case "eu-north-1": return EU_NORTH1; - case "ap-east-1": - return AP_EAST1; + case "ap-south-2": + return AP_SOUTH2; case "us-gov-west-1": return US_GOV_WEST1; + case "ca-west-1": + return CA_WEST1; + case "me-south-1": + return ME_SOUTH1; + case "mx-central-1": + return MX_CENTRAL1; + case "us-east-1": + return US_EAST1; + case "sa-east-1": + return SA_EAST1; + case "ap-east-2": + return AP_EAST2; + case "us-gov-east-1": + return US_GOV_EAST1; + case "us-east-2": + return US_EAST2; + case "ap-southeast-5": + return AP_SOUTHEAST5; + case "ap-east-1": + return AP_EAST1; + case "me-central-1": + return ME_CENTRAL1; + case "ap-southeast-7": + return AP_SOUTHEAST7; + case "ap-southeast-6": + return AP_SOUTHEAST6; case "us-west-2": return US_WEST2; case "eu-west-3": return EU_WEST3; + case "af-south-1": + return AF_SOUTH1; case "eu-west-2": return EU_WEST2; case "ap-southeast-2": return AP_SOUTHEAST2; + case "ap-southeast-4": + return AP_SOUTHEAST4; case "eu-central-1": return EU_CENTRAL1; + case "il-central-1": + return IL_CENTRAL1; case "us-west-1": return US_WEST1; + case "ap-southeast-3": + return AP_SOUTHEAST3; + case "eu-central-2": + return EU_CENTRAL2; case "eu-west-1": return EU_WEST1; default: @@ -216,8 +307,12 @@ public static EventStreamEventBridgeAwsRegionEnum valueOf(String value) { } public enum Value { + AF_SOUTH1, + AP_EAST1, + AP_EAST2, + AP_NORTHEAST1, AP_NORTHEAST2, @@ -226,28 +321,50 @@ public enum Value { AP_SOUTH1, + AP_SOUTH2, + AP_SOUTHEAST1, AP_SOUTHEAST2, - CA_CENTRAL1, + AP_SOUTHEAST3, - CN_NORTH1, + AP_SOUTHEAST4, - CN_NORTHWEST1, + AP_SOUTHEAST5, + + AP_SOUTHEAST6, + + AP_SOUTHEAST7, + + CA_CENTRAL1, + + CA_WEST1, EU_CENTRAL1, + EU_CENTRAL2, + EU_NORTH1, + EU_SOUTH1, + + EU_SOUTH2, + EU_WEST1, EU_WEST2, EU_WEST3, + IL_CENTRAL1, + + ME_CENTRAL1, + ME_SOUTH1, + MX_CENTRAL1, + SA_EAST1, US_GOV_EAST1, @@ -266,8 +383,12 @@ public enum Value { } public interface Visitor { + T visitAfSouth1(); + T visitApEast1(); + T visitApEast2(); + T visitApNortheast1(); T visitApNortheast2(); @@ -276,28 +397,50 @@ public interface Visitor { T visitApSouth1(); + T visitApSouth2(); + T visitApSoutheast1(); T visitApSoutheast2(); - T visitCaCentral1(); + T visitApSoutheast3(); - T visitCnNorth1(); + T visitApSoutheast4(); - T visitCnNorthwest1(); + T visitApSoutheast5(); + + T visitApSoutheast6(); + + T visitApSoutheast7(); + + T visitCaCentral1(); + + T visitCaWest1(); T visitEuCentral1(); + T visitEuCentral2(); + T visitEuNorth1(); + T visitEuSouth1(); + + T visitEuSouth2(); + T visitEuWest1(); T visitEuWest2(); T visitEuWest3(); + T visitIlCentral1(); + + T visitMeCentral1(); + T visitMeSouth1(); + T visitMxCentral1(); + T visitSaEast1(); T visitUsGovEast1(); diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java index 5605c44ae..45eb27887 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeConfiguration.java @@ -61,7 +61,7 @@ public Optional getAwsPartnerEventSource() { return awsPartnerEventSource; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeConfiguration @@ -79,12 +79,12 @@ private boolean equalTo(EventStreamEventBridgeConfiguration other) { && awsPartnerEventSource.equals(other.awsPartnerEventSource); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -130,7 +130,7 @@ public static final class Builder implements AwsAccountIdStage, AwsRegionStage, private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamEventBridgeConfiguration other) { awsAccountId(other.getAwsAccountId()); awsRegion(other.getAwsRegion()); @@ -143,14 +143,14 @@ public Builder from(EventStreamEventBridgeConfiguration other) { *

AWS Account ID for EventBridge destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("aws_account_id") public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("aws_region") public _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsRegion) { this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); @@ -161,7 +161,7 @@ public _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsReg *

AWS Partner Event Source for EventBridge destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); return this; @@ -170,14 +170,14 @@ public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { /** *

AWS Partner Event Source for EventBridge destination.

*/ - @java.lang.Override + @Override @JsonSetter(value = "aws_partner_event_source", nulls = Nulls.SKIP) public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { this.awsPartnerEventSource = awsPartnerEventSource; return this; } - @java.lang.Override + @Override public EventStreamEventBridgeConfiguration build() { return new EventStreamEventBridgeConfiguration( awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java index bba2fc35c..46cc475a1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java @@ -42,7 +42,7 @@ public EventStreamEventBridgeConfiguration getConfiguration() { return configuration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeDestination && equalTo((EventStreamEventBridgeDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamEventBridgeDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamEventBridgeDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamEventBridgeConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @java.lang.Override + @Override public EventStreamEventBridgeDestination build() { return new EventStreamEventBridgeDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java index 9735a2d13..463834258 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(EventStreamEventBridgeResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java index 065cc8f06..5b990071d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class EventStreamEventTypeEnum { + public static final EventStreamEventTypeEnum GROUP_DELETED = + new EventStreamEventTypeEnum(Value.GROUP_DELETED, "group.deleted"); + public static final EventStreamEventTypeEnum ORGANIZATION_CONNECTION_ADDED = new EventStreamEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); @@ -28,12 +31,24 @@ public final class EventStreamEventTypeEnum { public static final EventStreamEventTypeEnum ORGANIZATION_UPDATED = new EventStreamEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + public static final EventStreamEventTypeEnum GROUP_MEMBER_ADDED = + new EventStreamEventTypeEnum(Value.GROUP_MEMBER_ADDED, "group.member.added"); + + public static final EventStreamEventTypeEnum GROUP_CREATED = + new EventStreamEventTypeEnum(Value.GROUP_CREATED, "group.created"); + + public static final EventStreamEventTypeEnum GROUP_UPDATED = + new EventStreamEventTypeEnum(Value.GROUP_UPDATED, "group.updated"); + public static final EventStreamEventTypeEnum USER_CREATED = new EventStreamEventTypeEnum(Value.USER_CREATED, "user.created"); public static final EventStreamEventTypeEnum ORGANIZATION_CONNECTION_REMOVED = new EventStreamEventTypeEnum(Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + public static final EventStreamEventTypeEnum GROUP_MEMBER_DELETED = + new EventStreamEventTypeEnum(Value.GROUP_MEMBER_DELETED, "group.member.deleted"); + public static final EventStreamEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = new EventStreamEventTypeEnum(Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); @@ -59,26 +74,28 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamEventTypeEnum && this.string.equals(((EventStreamEventTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } public T visit(Visitor visitor) { switch (value) { + case GROUP_DELETED: + return visitor.visitGroupDeleted(); case ORGANIZATION_CONNECTION_ADDED: return visitor.visitOrganizationConnectionAdded(); case USER_DELETED: @@ -93,10 +110,18 @@ public T visit(Visitor visitor) { return visitor.visitOrganizationMemberDeleted(); case ORGANIZATION_UPDATED: return visitor.visitOrganizationUpdated(); + case GROUP_MEMBER_ADDED: + return visitor.visitGroupMemberAdded(); + case GROUP_CREATED: + return visitor.visitGroupCreated(); + case GROUP_UPDATED: + return visitor.visitGroupUpdated(); case USER_CREATED: return visitor.visitUserCreated(); case ORGANIZATION_CONNECTION_REMOVED: return visitor.visitOrganizationConnectionRemoved(); + case GROUP_MEMBER_DELETED: + return visitor.visitGroupMemberDeleted(); case ORGANIZATION_MEMBER_ROLE_ASSIGNED: return visitor.visitOrganizationMemberRoleAssigned(); case ORGANIZATION_DELETED: @@ -114,6 +139,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static EventStreamEventTypeEnum valueOf(String value) { switch (value) { + case "group.deleted": + return GROUP_DELETED; case "organization.connection.added": return ORGANIZATION_CONNECTION_ADDED; case "user.deleted": @@ -128,10 +155,18 @@ public static EventStreamEventTypeEnum valueOf(String value) { return ORGANIZATION_MEMBER_DELETED; case "organization.updated": return ORGANIZATION_UPDATED; + case "group.member.added": + return GROUP_MEMBER_ADDED; + case "group.created": + return GROUP_CREATED; + case "group.updated": + return GROUP_UPDATED; case "user.created": return USER_CREATED; case "organization.connection.removed": return ORGANIZATION_CONNECTION_REMOVED; + case "group.member.deleted": + return GROUP_MEMBER_DELETED; case "organization.member.role.assigned": return ORGANIZATION_MEMBER_ROLE_ASSIGNED; case "organization.deleted": @@ -172,6 +207,16 @@ public enum Value { ORGANIZATION_CONNECTION_REMOVED, + GROUP_CREATED, + + GROUP_UPDATED, + + GROUP_DELETED, + + GROUP_MEMBER_ADDED, + + GROUP_MEMBER_DELETED, + UNKNOWN } @@ -202,6 +247,16 @@ public interface Visitor { T visitOrganizationConnectionRemoved(); + T visitGroupCreated(); + + T visitGroupUpdated(); + + T visitGroupDeleted(); + + T visitGroupMemberAdded(); + + T visitGroupMemberDeleted(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java deleted file mode 100644 index 05fefa352..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamMetric.java +++ /dev/null @@ -1,244 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EventStreamMetric.Builder.class) -public final class EventStreamMetric { - private final String name; - - private final double windowTotal; - - private final String type; - - private final List data; - - private final Map additionalProperties; - - private EventStreamMetric( - String name, double windowTotal, String type, List data, Map additionalProperties) { - this.name = name; - this.windowTotal = windowTotal; - this.type = type; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return Name of the metric. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Total count for the entire window. - */ - @JsonProperty("window_total") - public double getWindowTotal() { - return windowTotal; - } - - /** - * @return Type of metric. - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * @return Array of metric values for each bucket. - */ - @JsonProperty("data") - public List getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EventStreamMetric && equalTo((EventStreamMetric) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EventStreamMetric other) { - return name.equals(other.name) - && windowTotal == other.windowTotal - && type.equals(other.type) - && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.windowTotal, this.type, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - /** - *

Name of the metric.

- */ - WindowTotalStage name(@NotNull String name); - - Builder from(EventStreamMetric other); - } - - public interface WindowTotalStage { - /** - *

Total count for the entire window.

- */ - TypeStage windowTotal(double windowTotal); - } - - public interface TypeStage { - /** - *

Type of metric.

- */ - _FinalStage type(@NotNull String type); - } - - public interface _FinalStage { - EventStreamMetric build(); - - /** - *

Array of metric values for each bucket.

- */ - _FinalStage data(List data); - - _FinalStage addData(Double data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, WindowTotalStage, TypeStage, _FinalStage { - private String name; - - private double windowTotal; - - private String type; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EventStreamMetric other) { - name(other.getName()); - windowTotal(other.getWindowTotal()); - type(other.getType()); - data(other.getData()); - return this; - } - - /** - *

Name of the metric.

- *

Name of the metric.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public WindowTotalStage name(@NotNull String name) { - this.name = Objects.requireNonNull(name, "name must not be null"); - return this; - } - - /** - *

Total count for the entire window.

- *

Total count for the entire window.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("window_total") - public TypeStage windowTotal(double windowTotal) { - this.windowTotal = windowTotal; - return this; - } - - /** - *

Type of metric.

- *

Type of metric.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("type") - public _FinalStage type(@NotNull String type) { - this.type = Objects.requireNonNull(type, "type must not be null"); - return this; - } - - /** - *

Array of metric values for each bucket.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllData(List data) { - if (data != null) { - this.data.addAll(data); - } - return this; - } - - /** - *

Array of metric values for each bucket.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addData(Double data) { - this.data.add(data); - return this; - } - - /** - *

Array of metric values for each bucket.

- */ - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - if (data != null) { - this.data.addAll(data); - } - return this; - } - - @java.lang.Override - public EventStreamMetric build() { - return new EventStreamMetric(name, windowTotal, type, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java index 65879e17e..4e86cc124 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamResponseContent && equalTo((EventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer getEventType() { return eventType; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamSubscription && equalTo((EventStreamSubscription) other); @@ -49,12 +49,12 @@ private boolean equalTo(EventStreamSubscription other) { return eventType.equals(other.eventType); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.eventType); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java index 78fd65ccf..c4f8b8b59 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class EventStreamTestEventTypeEnum { + public static final EventStreamTestEventTypeEnum GROUP_DELETED = + new EventStreamTestEventTypeEnum(Value.GROUP_DELETED, "group.deleted"); + public static final EventStreamTestEventTypeEnum ORGANIZATION_CONNECTION_ADDED = new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CONNECTION_ADDED, "organization.connection.added"); @@ -28,12 +31,24 @@ public final class EventStreamTestEventTypeEnum { public static final EventStreamTestEventTypeEnum ORGANIZATION_UPDATED = new EventStreamTestEventTypeEnum(Value.ORGANIZATION_UPDATED, "organization.updated"); + public static final EventStreamTestEventTypeEnum GROUP_MEMBER_ADDED = + new EventStreamTestEventTypeEnum(Value.GROUP_MEMBER_ADDED, "group.member.added"); + + public static final EventStreamTestEventTypeEnum GROUP_CREATED = + new EventStreamTestEventTypeEnum(Value.GROUP_CREATED, "group.created"); + + public static final EventStreamTestEventTypeEnum GROUP_UPDATED = + new EventStreamTestEventTypeEnum(Value.GROUP_UPDATED, "group.updated"); + public static final EventStreamTestEventTypeEnum USER_CREATED = new EventStreamTestEventTypeEnum(Value.USER_CREATED, "user.created"); public static final EventStreamTestEventTypeEnum ORGANIZATION_CONNECTION_REMOVED = new EventStreamTestEventTypeEnum(Value.ORGANIZATION_CONNECTION_REMOVED, "organization.connection.removed"); + public static final EventStreamTestEventTypeEnum GROUP_MEMBER_DELETED = + new EventStreamTestEventTypeEnum(Value.GROUP_MEMBER_DELETED, "group.member.deleted"); + public static final EventStreamTestEventTypeEnum ORGANIZATION_MEMBER_ROLE_ASSIGNED = new EventStreamTestEventTypeEnum( Value.ORGANIZATION_MEMBER_ROLE_ASSIGNED, "organization.member.role.assigned"); @@ -61,26 +76,28 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamTestEventTypeEnum && this.string.equals(((EventStreamTestEventTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } public T visit(Visitor visitor) { switch (value) { + case GROUP_DELETED: + return visitor.visitGroupDeleted(); case ORGANIZATION_CONNECTION_ADDED: return visitor.visitOrganizationConnectionAdded(); case USER_DELETED: @@ -95,10 +112,18 @@ public T visit(Visitor visitor) { return visitor.visitOrganizationMemberDeleted(); case ORGANIZATION_UPDATED: return visitor.visitOrganizationUpdated(); + case GROUP_MEMBER_ADDED: + return visitor.visitGroupMemberAdded(); + case GROUP_CREATED: + return visitor.visitGroupCreated(); + case GROUP_UPDATED: + return visitor.visitGroupUpdated(); case USER_CREATED: return visitor.visitUserCreated(); case ORGANIZATION_CONNECTION_REMOVED: return visitor.visitOrganizationConnectionRemoved(); + case GROUP_MEMBER_DELETED: + return visitor.visitGroupMemberDeleted(); case ORGANIZATION_MEMBER_ROLE_ASSIGNED: return visitor.visitOrganizationMemberRoleAssigned(); case ORGANIZATION_DELETED: @@ -116,6 +141,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static EventStreamTestEventTypeEnum valueOf(String value) { switch (value) { + case "group.deleted": + return GROUP_DELETED; case "organization.connection.added": return ORGANIZATION_CONNECTION_ADDED; case "user.deleted": @@ -130,10 +157,18 @@ public static EventStreamTestEventTypeEnum valueOf(String value) { return ORGANIZATION_MEMBER_DELETED; case "organization.updated": return ORGANIZATION_UPDATED; + case "group.member.added": + return GROUP_MEMBER_ADDED; + case "group.created": + return GROUP_CREATED; + case "group.updated": + return GROUP_UPDATED; case "user.created": return USER_CREATED; case "organization.connection.removed": return ORGANIZATION_CONNECTION_REMOVED; + case "group.member.deleted": + return GROUP_MEMBER_DELETED; case "organization.member.role.assigned": return ORGANIZATION_MEMBER_ROLE_ASSIGNED; case "organization.deleted": @@ -174,6 +209,16 @@ public enum Value { ORGANIZATION_CONNECTION_REMOVED, + GROUP_CREATED, + + GROUP_UPDATED, + + GROUP_DELETED, + + GROUP_MEMBER_ADDED, + + GROUP_MEMBER_DELETED, + UNKNOWN } @@ -204,6 +249,16 @@ public interface Visitor { T visitOrganizationConnectionRemoved(); + T visitGroupCreated(); + + T visitGroupUpdated(); + + T visitGroupDeleted(); + + T visitGroupMemberAdded(); + + T visitGroupMemberDeleted(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java index 67ba0e358..cecf32dfb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookAuthorizationResponse @@ -50,12 +50,12 @@ private boolean equalTo(EventStreamWebhookAuthorizationResponse other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerUsername

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("username") public _FinalStage username(@NotNull String username) { this.username = Objects.requireNonNull(username, "username must not be null"); return this; } - @java.lang.Override + @Override public EventStreamWebhookBasicAuth build() { return new EventStreamWebhookBasicAuth(method, username, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java index 59ae34454..175b11ed8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java @@ -33,7 +33,7 @@ public String getMethod() { return method; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookBearerAuth && equalTo((EventStreamWebhookBearerAuth) other); @@ -48,12 +48,12 @@ private boolean equalTo(EventStreamWebhookBearerAuth other) { return method.equals(other.method); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.method); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements MethodStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamWebhookBearerAuth other) { method(other.getMethod()); return this; } - @java.lang.Override + @Override @JsonSetter("method") public _FinalStage method(@NotNull String method) { this.method = Objects.requireNonNull(method, "method must not be null"); return this; } - @java.lang.Override + @Override public EventStreamWebhookBearerAuth build() { return new EventStreamWebhookBearerAuth(method, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java index a3dafb72d..51d2f08d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java @@ -47,7 +47,7 @@ public EventStreamWebhookAuthorizationResponse getWebhookAuthorization() { return webhookAuthorization; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookConfiguration && equalTo((EventStreamWebhookConfiguration) other); @@ -62,12 +62,12 @@ private boolean equalTo(EventStreamWebhookConfiguration other) { return webhookEndpoint.equals(other.webhookEndpoint) && webhookAuthorization.equals(other.webhookAuthorization); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.webhookEndpoint, this.webhookAuthorization); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -104,7 +104,7 @@ public static final class Builder implements WebhookEndpointStage, WebhookAuthor private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamWebhookConfiguration other) { webhookEndpoint(other.getWebhookEndpoint()); webhookAuthorization(other.getWebhookAuthorization()); @@ -116,14 +116,14 @@ public Builder from(EventStreamWebhookConfiguration other) { *

Target HTTP endpoint URL.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("webhook_endpoint") public WebhookAuthorizationStage webhookEndpoint(@NotNull String webhookEndpoint) { this.webhookEndpoint = Objects.requireNonNull(webhookEndpoint, "webhookEndpoint must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("webhook_authorization") public _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorizationResponse webhookAuthorization) { this.webhookAuthorization = @@ -131,7 +131,7 @@ public _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorization return this; } - @java.lang.Override + @Override public EventStreamWebhookConfiguration build() { return new EventStreamWebhookConfiguration(webhookEndpoint, webhookAuthorization, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java index 85e8bb0ba..6a97aa1b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java @@ -42,7 +42,7 @@ public EventStreamWebhookConfiguration getConfiguration() { return configuration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookDestination && equalTo((EventStreamWebhookDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamWebhookDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(EventStreamWebhookDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamWebhookConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @java.lang.Override + @Override public EventStreamWebhookDestination build() { return new EventStreamWebhookDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java index f21a19b20..b9be764fd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookResponseContent && equalTo((EventStreamWebhookResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(EventStreamWebhookResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java deleted file mode 100644 index f816d58e0..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWindow.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EventStreamWindow.Builder.class) -public final class EventStreamWindow { - private final OffsetDateTime dateFrom; - - private final OffsetDateTime dateTo; - - private final EventStreamBucketInterval bucketInterval; - - private final Map additionalProperties; - - private EventStreamWindow( - OffsetDateTime dateFrom, - OffsetDateTime dateTo, - EventStreamBucketInterval bucketInterval, - Map additionalProperties) { - this.dateFrom = dateFrom; - this.dateTo = dateTo; - this.bucketInterval = bucketInterval; - this.additionalProperties = additionalProperties; - } - - /** - * @return Start date of the time window. - */ - @JsonProperty("date_from") - public OffsetDateTime getDateFrom() { - return dateFrom; - } - - /** - * @return End date of the time window. - */ - @JsonProperty("date_to") - public OffsetDateTime getDateTo() { - return dateTo; - } - - @JsonProperty("bucket_interval") - public EventStreamBucketInterval getBucketInterval() { - return bucketInterval; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EventStreamWindow && equalTo((EventStreamWindow) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EventStreamWindow other) { - return dateFrom.equals(other.dateFrom) - && dateTo.equals(other.dateTo) - && bucketInterval.equals(other.bucketInterval); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.dateFrom, this.dateTo, this.bucketInterval); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DateFromStage builder() { - return new Builder(); - } - - public interface DateFromStage { - /** - *

Start date of the time window.

- */ - DateToStage dateFrom(@NotNull OffsetDateTime dateFrom); - - Builder from(EventStreamWindow other); - } - - public interface DateToStage { - /** - *

End date of the time window.

- */ - BucketIntervalStage dateTo(@NotNull OffsetDateTime dateTo); - } - - public interface BucketIntervalStage { - _FinalStage bucketInterval(@NotNull EventStreamBucketInterval bucketInterval); - } - - public interface _FinalStage { - EventStreamWindow build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DateFromStage, DateToStage, BucketIntervalStage, _FinalStage { - private OffsetDateTime dateFrom; - - private OffsetDateTime dateTo; - - private EventStreamBucketInterval bucketInterval; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EventStreamWindow other) { - dateFrom(other.getDateFrom()); - dateTo(other.getDateTo()); - bucketInterval(other.getBucketInterval()); - return this; - } - - /** - *

Start date of the time window.

- *

Start date of the time window.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("date_from") - public DateToStage dateFrom(@NotNull OffsetDateTime dateFrom) { - this.dateFrom = Objects.requireNonNull(dateFrom, "dateFrom must not be null"); - return this; - } - - /** - *

End date of the time window.

- *

End date of the time window.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("date_to") - public BucketIntervalStage dateTo(@NotNull OffsetDateTime dateTo) { - this.dateTo = Objects.requireNonNull(dateTo, "dateTo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bucket_interval") - public _FinalStage bucketInterval(@NotNull EventStreamBucketInterval bucketInterval) { - this.bucketInterval = Objects.requireNonNull(bucketInterval, "bucketInterval must not be null"); - return this; - } - - @java.lang.Override - public EventStreamWindow build() { - return new EventStreamWindow(dateFrom, dateTo, bucketInterval, additionalProperties); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java index 3af8d30e1..e929818b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamsCreateRequest && equalTo((EventStreamsCreateRequest) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamsCreateRequest other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer dateFrom; - - private final OptionalNullable dateTo; - - private final Map additionalProperties; - - private EventStreamsGetStatsRequest( - OptionalNullable dateFrom, - OptionalNullable dateTo, - Map additionalProperties) { - this.dateFrom = dateFrom; - this.dateTo = dateTo; - this.additionalProperties = additionalProperties; - } - - /** - * @return The RFC3339 start date for the stats query. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("date_from") - public OptionalNullable getDateFrom() { - if (dateFrom == null) { - return OptionalNullable.absent(); - } - return dateFrom; - } - - /** - * @return The RFC3339 end date for the stats query. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("date_to") - public OptionalNullable getDateTo() { - if (dateTo == null) { - return OptionalNullable.absent(); - } - return dateTo; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("date_from") - private OptionalNullable _getDateFrom() { - return dateFrom; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("date_to") - private OptionalNullable _getDateTo() { - return dateTo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EventStreamsGetStatsRequest && equalTo((EventStreamsGetStatsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EventStreamsGetStatsRequest other) { - return dateFrom.equals(other.dateFrom) && dateTo.equals(other.dateTo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.dateFrom, this.dateTo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private OptionalNullable dateFrom = OptionalNullable.absent(); - - private OptionalNullable dateTo = OptionalNullable.absent(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EventStreamsGetStatsRequest other) { - dateFrom(other.getDateFrom()); - dateTo(other.getDateTo()); - return this; - } - - /** - *

The RFC3339 start date for the stats query.

- */ - @JsonSetter(value = "date_from", nulls = Nulls.SKIP) - public Builder dateFrom(@Nullable OptionalNullable dateFrom) { - this.dateFrom = dateFrom; - return this; - } - - public Builder dateFrom(String dateFrom) { - this.dateFrom = OptionalNullable.of(dateFrom); - return this; - } - - public Builder dateFrom(Optional dateFrom) { - if (dateFrom.isPresent()) { - this.dateFrom = OptionalNullable.of(dateFrom.get()); - } else { - this.dateFrom = OptionalNullable.absent(); - } - return this; - } - - public Builder dateFrom(com.auth0.client.mgmt.core.Nullable dateFrom) { - if (dateFrom.isNull()) { - this.dateFrom = OptionalNullable.ofNull(); - } else if (dateFrom.isEmpty()) { - this.dateFrom = OptionalNullable.absent(); - } else { - this.dateFrom = OptionalNullable.of(dateFrom.get()); - } - return this; - } - - /** - *

The RFC3339 end date for the stats query.

- */ - @JsonSetter(value = "date_to", nulls = Nulls.SKIP) - public Builder dateTo(@Nullable OptionalNullable dateTo) { - this.dateTo = dateTo; - return this; - } - - public Builder dateTo(String dateTo) { - this.dateTo = OptionalNullable.of(dateTo); - return this; - } - - public Builder dateTo(Optional dateTo) { - if (dateTo.isPresent()) { - this.dateTo = OptionalNullable.of(dateTo.get()); - } else { - this.dateTo = OptionalNullable.absent(); - } - return this; - } - - public Builder dateTo(com.auth0.client.mgmt.core.Nullable dateTo) { - if (dateTo.isNull()) { - this.dateTo = OptionalNullable.ofNull(); - } else if (dateTo.isEmpty()) { - this.dateTo = OptionalNullable.absent(); - } else { - this.dateTo = OptionalNullable.of(dateTo.get()); - } - return this; - } - - public EventStreamsGetStatsRequest build() { - return new EventStreamsGetStatsRequest(dateFrom, dateTo, additionalProperties); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/ExpressConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ExpressConfiguration.java new file mode 100644 index 000000000..2a0c478ae --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ExpressConfiguration.java @@ -0,0 +1,444 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpressConfiguration.Builder.class) +public final class ExpressConfiguration { + private final String initiateLoginUriTemplate; + + private final String userAttributeProfileId; + + private final String connectionProfileId; + + private final boolean enableClient; + + private final boolean enableOrganization; + + private final Optional> linkedClients; + + private final String oktaOinClientId; + + private final String adminLoginDomain; + + private final Optional oinSubmissionId; + + private final Map additionalProperties; + + private ExpressConfiguration( + String initiateLoginUriTemplate, + String userAttributeProfileId, + String connectionProfileId, + boolean enableClient, + boolean enableOrganization, + Optional> linkedClients, + String oktaOinClientId, + String adminLoginDomain, + Optional oinSubmissionId, + Map additionalProperties) { + this.initiateLoginUriTemplate = initiateLoginUriTemplate; + this.userAttributeProfileId = userAttributeProfileId; + this.connectionProfileId = connectionProfileId; + this.enableClient = enableClient; + this.enableOrganization = enableOrganization; + this.linkedClients = linkedClients; + this.oktaOinClientId = oktaOinClientId; + this.adminLoginDomain = adminLoginDomain; + this.oinSubmissionId = oinSubmissionId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name. + */ + @JsonProperty("initiate_login_uri_template") + public String getInitiateLoginUriTemplate() { + return initiateLoginUriTemplate; + } + + /** + * @return The ID of the user attribute profile to use for this application. + */ + @JsonProperty("user_attribute_profile_id") + public String getUserAttributeProfileId() { + return userAttributeProfileId; + } + + /** + * @return The ID of the connection profile to use for this application. + */ + @JsonProperty("connection_profile_id") + public String getConnectionProfileId() { + return connectionProfileId; + } + + /** + * @return When true, all connections made via express configuration will be enabled for this application. + */ + @JsonProperty("enable_client") + public boolean getEnableClient() { + return enableClient; + } + + /** + * @return When true, all connections made via express configuration will have the associated organization enabled. + */ + @JsonProperty("enable_organization") + public boolean getEnableOrganization() { + return enableOrganization; + } + + /** + * @return List of client IDs that are linked to this express configuration (e.g. web or mobile clients). + */ + @JsonProperty("linked_clients") + public Optional> getLinkedClients() { + return linkedClients; + } + + /** + * @return This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application. + */ + @JsonProperty("okta_oin_client_id") + public String getOktaOinClientId() { + return oktaOinClientId; + } + + /** + * @return This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain. + */ + @JsonProperty("admin_login_domain") + public String getAdminLoginDomain() { + return adminLoginDomain; + } + + /** + * @return The identifier of the published application in the OKTA OIN. + */ + @JsonProperty("oin_submission_id") + public Optional getOinSubmissionId() { + return oinSubmissionId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpressConfiguration && equalTo((ExpressConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpressConfiguration other) { + return initiateLoginUriTemplate.equals(other.initiateLoginUriTemplate) + && userAttributeProfileId.equals(other.userAttributeProfileId) + && connectionProfileId.equals(other.connectionProfileId) + && enableClient == other.enableClient + && enableOrganization == other.enableOrganization + && linkedClients.equals(other.linkedClients) + && oktaOinClientId.equals(other.oktaOinClientId) + && adminLoginDomain.equals(other.adminLoginDomain) + && oinSubmissionId.equals(other.oinSubmissionId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.initiateLoginUriTemplate, + this.userAttributeProfileId, + this.connectionProfileId, + this.enableClient, + this.enableOrganization, + this.linkedClients, + this.oktaOinClientId, + this.adminLoginDomain, + this.oinSubmissionId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static InitiateLoginUriTemplateStage builder() { + return new Builder(); + } + + public interface InitiateLoginUriTemplateStage { + /** + *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ */ + UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate); + + Builder from(ExpressConfiguration other); + } + + public interface UserAttributeProfileIdStage { + /** + *

The ID of the user attribute profile to use for this application.

+ */ + ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId); + } + + public interface ConnectionProfileIdStage { + /** + *

The ID of the connection profile to use for this application.

+ */ + EnableClientStage connectionProfileId(@NotNull String connectionProfileId); + } + + public interface EnableClientStage { + /** + *

When true, all connections made via express configuration will be enabled for this application.

+ */ + EnableOrganizationStage enableClient(boolean enableClient); + } + + public interface EnableOrganizationStage { + /** + *

When true, all connections made via express configuration will have the associated organization enabled.

+ */ + OktaOinClientIdStage enableOrganization(boolean enableOrganization); + } + + public interface OktaOinClientIdStage { + /** + *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ */ + AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId); + } + + public interface AdminLoginDomainStage { + /** + *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ */ + _FinalStage adminLoginDomain(@NotNull String adminLoginDomain); + } + + public interface _FinalStage { + ExpressConfiguration build(); + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ */ + _FinalStage linkedClients(Optional> linkedClients); + + _FinalStage linkedClients(List linkedClients); + + /** + *

The identifier of the published application in the OKTA OIN.

+ */ + _FinalStage oinSubmissionId(Optional oinSubmissionId); + + _FinalStage oinSubmissionId(String oinSubmissionId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements InitiateLoginUriTemplateStage, + UserAttributeProfileIdStage, + ConnectionProfileIdStage, + EnableClientStage, + EnableOrganizationStage, + OktaOinClientIdStage, + AdminLoginDomainStage, + _FinalStage { + private String initiateLoginUriTemplate; + + private String userAttributeProfileId; + + private String connectionProfileId; + + private boolean enableClient; + + private boolean enableOrganization; + + private String oktaOinClientId; + + private String adminLoginDomain; + + private Optional oinSubmissionId = Optional.empty(); + + private Optional> linkedClients = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ExpressConfiguration other) { + initiateLoginUriTemplate(other.getInitiateLoginUriTemplate()); + userAttributeProfileId(other.getUserAttributeProfileId()); + connectionProfileId(other.getConnectionProfileId()); + enableClient(other.getEnableClient()); + enableOrganization(other.getEnableOrganization()); + linkedClients(other.getLinkedClients()); + oktaOinClientId(other.getOktaOinClientId()); + adminLoginDomain(other.getAdminLoginDomain()); + oinSubmissionId(other.getOinSubmissionId()); + return this; + } + + /** + *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("initiate_login_uri_template") + public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate) { + this.initiateLoginUriTemplate = + Objects.requireNonNull(initiateLoginUriTemplate, "initiateLoginUriTemplate must not be null"); + return this; + } + + /** + *

The ID of the user attribute profile to use for this application.

+ *

The ID of the user attribute profile to use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("user_attribute_profile_id") + public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId) { + this.userAttributeProfileId = + Objects.requireNonNull(userAttributeProfileId, "userAttributeProfileId must not be null"); + return this; + } + + /** + *

The ID of the connection profile to use for this application.

+ *

The ID of the connection profile to use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_profile_id") + public EnableClientStage connectionProfileId(@NotNull String connectionProfileId) { + this.connectionProfileId = + Objects.requireNonNull(connectionProfileId, "connectionProfileId must not be null"); + return this; + } + + /** + *

When true, all connections made via express configuration will be enabled for this application.

+ *

When true, all connections made via express configuration will be enabled for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enable_client") + public EnableOrganizationStage enableClient(boolean enableClient) { + this.enableClient = enableClient; + return this; + } + + /** + *

When true, all connections made via express configuration will have the associated organization enabled.

+ *

When true, all connections made via express configuration will have the associated organization enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enable_organization") + public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { + this.enableOrganization = enableOrganization; + return this; + } + + /** + *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("okta_oin_client_id") + public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { + this.oktaOinClientId = Objects.requireNonNull(oktaOinClientId, "oktaOinClientId must not be null"); + return this; + } + + /** + *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("admin_login_domain") + public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { + this.adminLoginDomain = Objects.requireNonNull(adminLoginDomain, "adminLoginDomain must not be null"); + return this; + } + + /** + *

The identifier of the published application in the OKTA OIN.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage oinSubmissionId(String oinSubmissionId) { + this.oinSubmissionId = Optional.ofNullable(oinSubmissionId); + return this; + } + + /** + *

The identifier of the published application in the OKTA OIN.

+ */ + @Override + @JsonSetter(value = "oin_submission_id", nulls = Nulls.SKIP) + public _FinalStage oinSubmissionId(Optional oinSubmissionId) { + this.oinSubmissionId = oinSubmissionId; + return this; + } + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage linkedClients(List linkedClients) { + this.linkedClients = Optional.ofNullable(linkedClients); + return this; + } + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ */ + @Override + @JsonSetter(value = "linked_clients", nulls = Nulls.SKIP) + public _FinalStage linkedClients(Optional> linkedClients) { + this.linkedClients = linkedClients; + return this; + } + + @Override + public ExpressConfiguration build() { + return new ExpressConfiguration( + initiateLoginUriTemplate, + userAttributeProfileId, + connectionProfileId, + enableClient, + enableOrganization, + linkedClients, + oktaOinClientId, + adminLoginDomain, + oinSubmissionId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java b/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java new file mode 100644 index 000000000..8a132de13 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java @@ -0,0 +1,444 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpressConfigurationOrNull.Builder.class) +public final class ExpressConfigurationOrNull { + private final String initiateLoginUriTemplate; + + private final String userAttributeProfileId; + + private final String connectionProfileId; + + private final boolean enableClient; + + private final boolean enableOrganization; + + private final Optional> linkedClients; + + private final String oktaOinClientId; + + private final String adminLoginDomain; + + private final Optional oinSubmissionId; + + private final Map additionalProperties; + + private ExpressConfigurationOrNull( + String initiateLoginUriTemplate, + String userAttributeProfileId, + String connectionProfileId, + boolean enableClient, + boolean enableOrganization, + Optional> linkedClients, + String oktaOinClientId, + String adminLoginDomain, + Optional oinSubmissionId, + Map additionalProperties) { + this.initiateLoginUriTemplate = initiateLoginUriTemplate; + this.userAttributeProfileId = userAttributeProfileId; + this.connectionProfileId = connectionProfileId; + this.enableClient = enableClient; + this.enableOrganization = enableOrganization; + this.linkedClients = linkedClients; + this.oktaOinClientId = oktaOinClientId; + this.adminLoginDomain = adminLoginDomain; + this.oinSubmissionId = oinSubmissionId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name. + */ + @JsonProperty("initiate_login_uri_template") + public String getInitiateLoginUriTemplate() { + return initiateLoginUriTemplate; + } + + /** + * @return The ID of the user attribute profile to use for this application. + */ + @JsonProperty("user_attribute_profile_id") + public String getUserAttributeProfileId() { + return userAttributeProfileId; + } + + /** + * @return The ID of the connection profile to use for this application. + */ + @JsonProperty("connection_profile_id") + public String getConnectionProfileId() { + return connectionProfileId; + } + + /** + * @return When true, all connections made via express configuration will be enabled for this application. + */ + @JsonProperty("enable_client") + public boolean getEnableClient() { + return enableClient; + } + + /** + * @return When true, all connections made via express configuration will have the associated organization enabled. + */ + @JsonProperty("enable_organization") + public boolean getEnableOrganization() { + return enableOrganization; + } + + /** + * @return List of client IDs that are linked to this express configuration (e.g. web or mobile clients). + */ + @JsonProperty("linked_clients") + public Optional> getLinkedClients() { + return linkedClients; + } + + /** + * @return This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application. + */ + @JsonProperty("okta_oin_client_id") + public String getOktaOinClientId() { + return oktaOinClientId; + } + + /** + * @return This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain. + */ + @JsonProperty("admin_login_domain") + public String getAdminLoginDomain() { + return adminLoginDomain; + } + + /** + * @return The identifier of the published application in the OKTA OIN. + */ + @JsonProperty("oin_submission_id") + public Optional getOinSubmissionId() { + return oinSubmissionId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpressConfigurationOrNull && equalTo((ExpressConfigurationOrNull) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpressConfigurationOrNull other) { + return initiateLoginUriTemplate.equals(other.initiateLoginUriTemplate) + && userAttributeProfileId.equals(other.userAttributeProfileId) + && connectionProfileId.equals(other.connectionProfileId) + && enableClient == other.enableClient + && enableOrganization == other.enableOrganization + && linkedClients.equals(other.linkedClients) + && oktaOinClientId.equals(other.oktaOinClientId) + && adminLoginDomain.equals(other.adminLoginDomain) + && oinSubmissionId.equals(other.oinSubmissionId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.initiateLoginUriTemplate, + this.userAttributeProfileId, + this.connectionProfileId, + this.enableClient, + this.enableOrganization, + this.linkedClients, + this.oktaOinClientId, + this.adminLoginDomain, + this.oinSubmissionId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static InitiateLoginUriTemplateStage builder() { + return new Builder(); + } + + public interface InitiateLoginUriTemplateStage { + /** + *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ */ + UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate); + + Builder from(ExpressConfigurationOrNull other); + } + + public interface UserAttributeProfileIdStage { + /** + *

The ID of the user attribute profile to use for this application.

+ */ + ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId); + } + + public interface ConnectionProfileIdStage { + /** + *

The ID of the connection profile to use for this application.

+ */ + EnableClientStage connectionProfileId(@NotNull String connectionProfileId); + } + + public interface EnableClientStage { + /** + *

When true, all connections made via express configuration will be enabled for this application.

+ */ + EnableOrganizationStage enableClient(boolean enableClient); + } + + public interface EnableOrganizationStage { + /** + *

When true, all connections made via express configuration will have the associated organization enabled.

+ */ + OktaOinClientIdStage enableOrganization(boolean enableOrganization); + } + + public interface OktaOinClientIdStage { + /** + *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ */ + AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId); + } + + public interface AdminLoginDomainStage { + /** + *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ */ + _FinalStage adminLoginDomain(@NotNull String adminLoginDomain); + } + + public interface _FinalStage { + ExpressConfigurationOrNull build(); + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ */ + _FinalStage linkedClients(Optional> linkedClients); + + _FinalStage linkedClients(List linkedClients); + + /** + *

The identifier of the published application in the OKTA OIN.

+ */ + _FinalStage oinSubmissionId(Optional oinSubmissionId); + + _FinalStage oinSubmissionId(String oinSubmissionId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements InitiateLoginUriTemplateStage, + UserAttributeProfileIdStage, + ConnectionProfileIdStage, + EnableClientStage, + EnableOrganizationStage, + OktaOinClientIdStage, + AdminLoginDomainStage, + _FinalStage { + private String initiateLoginUriTemplate; + + private String userAttributeProfileId; + + private String connectionProfileId; + + private boolean enableClient; + + private boolean enableOrganization; + + private String oktaOinClientId; + + private String adminLoginDomain; + + private Optional oinSubmissionId = Optional.empty(); + + private Optional> linkedClients = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ExpressConfigurationOrNull other) { + initiateLoginUriTemplate(other.getInitiateLoginUriTemplate()); + userAttributeProfileId(other.getUserAttributeProfileId()); + connectionProfileId(other.getConnectionProfileId()); + enableClient(other.getEnableClient()); + enableOrganization(other.getEnableOrganization()); + linkedClients(other.getLinkedClients()); + oktaOinClientId(other.getOktaOinClientId()); + adminLoginDomain(other.getAdminLoginDomain()); + oinSubmissionId(other.getOinSubmissionId()); + return this; + } + + /** + *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("initiate_login_uri_template") + public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate) { + this.initiateLoginUriTemplate = + Objects.requireNonNull(initiateLoginUriTemplate, "initiateLoginUriTemplate must not be null"); + return this; + } + + /** + *

The ID of the user attribute profile to use for this application.

+ *

The ID of the user attribute profile to use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("user_attribute_profile_id") + public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId) { + this.userAttributeProfileId = + Objects.requireNonNull(userAttributeProfileId, "userAttributeProfileId must not be null"); + return this; + } + + /** + *

The ID of the connection profile to use for this application.

+ *

The ID of the connection profile to use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_profile_id") + public EnableClientStage connectionProfileId(@NotNull String connectionProfileId) { + this.connectionProfileId = + Objects.requireNonNull(connectionProfileId, "connectionProfileId must not be null"); + return this; + } + + /** + *

When true, all connections made via express configuration will be enabled for this application.

+ *

When true, all connections made via express configuration will be enabled for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enable_client") + public EnableOrganizationStage enableClient(boolean enableClient) { + this.enableClient = enableClient; + return this; + } + + /** + *

When true, all connections made via express configuration will have the associated organization enabled.

+ *

When true, all connections made via express configuration will have the associated organization enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enable_organization") + public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { + this.enableOrganization = enableOrganization; + return this; + } + + /** + *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("okta_oin_client_id") + public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { + this.oktaOinClientId = Objects.requireNonNull(oktaOinClientId, "oktaOinClientId must not be null"); + return this; + } + + /** + *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("admin_login_domain") + public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { + this.adminLoginDomain = Objects.requireNonNull(adminLoginDomain, "adminLoginDomain must not be null"); + return this; + } + + /** + *

The identifier of the published application in the OKTA OIN.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage oinSubmissionId(String oinSubmissionId) { + this.oinSubmissionId = Optional.ofNullable(oinSubmissionId); + return this; + } + + /** + *

The identifier of the published application in the OKTA OIN.

+ */ + @Override + @JsonSetter(value = "oin_submission_id", nulls = Nulls.SKIP) + public _FinalStage oinSubmissionId(Optional oinSubmissionId) { + this.oinSubmissionId = oinSubmissionId; + return this; + } + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage linkedClients(List linkedClients) { + this.linkedClients = Optional.ofNullable(linkedClients); + return this; + } + + /** + *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

+ */ + @Override + @JsonSetter(value = "linked_clients", nulls = Nulls.SKIP) + public _FinalStage linkedClients(Optional> linkedClients) { + this.linkedClients = linkedClients; + return this; + } + + @Override + public ExpressConfigurationOrNull build() { + return new ExpressConfigurationOrNull( + initiateLoginUriTemplate, + userAttributeProfileId, + connectionProfileId, + enableClient, + enableOrganization, + linkedClients, + oktaOinClientId, + adminLoginDomain, + oinSubmissionId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java index 6997e2fa5..cb48ace18 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java @@ -21,7 +21,7 @@ private ExtensibilityEmailProviderCredentials(Map additionalProp this.additionalProperties = additionalProperties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExtensibilityEmailProviderCredentials; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java index a80969430..e18329ae4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java +++ b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java @@ -82,7 +82,7 @@ public Optional getLastUsedAt() { return lastUsedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FederatedConnectionTokenSet && equalTo((FederatedConnectionTokenSet) other); @@ -102,12 +102,12 @@ private boolean equalTo(FederatedConnectionTokenSet other) { && lastUsedAt.equals(other.lastUsedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.connection, this.scope, this.expiresAt, this.issuedAt, this.lastUsedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowAction.java b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java index 35d21213e..5afa83ae4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowAction.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java @@ -85,7 +85,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowAction && equalTo((FlowAction) other); @@ -95,12 +95,12 @@ private boolean equalTo(FlowAction other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -262,7 +262,7 @@ static final class Deserializer extends StdDeserializer { super(FlowAction.class); } - @java.lang.Override + @Override public FlowAction deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java index 06a370898..ea1832a54 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaign && equalTo((FlowActionActivecampaign) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionActivecampaign other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionActivecampaignListContacts build() { return new FlowActionActivecampaignListContacts( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java index 92b6b2466..51495cc4c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignListContactsParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionActivecampaignListContactsParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionActivecampaignListContactsParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public FlowActionActivecampaignListContactsParams build() { return new FlowActionActivecampaignListContactsParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java index cbc6d5089..627178d15 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java @@ -83,7 +83,7 @@ public FlowActionActivecampaignUpsertContactParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignUpsertContact @@ -103,12 +103,12 @@ private boolean equalTo(FlowActionActivecampaignUpsertContact other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionActivecampaignUpsertContact other) { id(other.getId()); alias(other.getAlias()); @@ -170,60 +170,60 @@ public Builder from(FlowActionActivecampaignUpsertContact other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionActivecampaignUpsertContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionActivecampaignUpsertContact build() { return new FlowActionActivecampaignUpsertContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java index 756f1d32e..2bc0a91d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java @@ -82,7 +82,7 @@ public Optional> getCustomFields() { return customFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignUpsertContactParams @@ -103,13 +103,13 @@ private boolean equalTo(FlowActionActivecampaignUpsertContactParams other) { && customFields.equals(other.customFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, this.email, this.firstName, this.lastName, this.phone, this.customFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionActivecampaignUpsertContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -178,73 +178,73 @@ public Builder from(FlowActionActivecampaignUpsertContactParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage customFields(Map customFields) { this.customFields = Optional.ofNullable(customFields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "custom_fields", nulls = Nulls.SKIP) public _FinalStage customFields(Optional> customFields) { this.customFields = customFields; return this; } - @java.lang.Override + @Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @java.lang.Override + @Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @java.lang.Override + @Override public _FinalStage lastName(String lastName) { this.lastName = Optional.ofNullable(lastName); return this; } - @java.lang.Override + @Override @JsonSetter(value = "last_name", nulls = Nulls.SKIP) public _FinalStage lastName(Optional lastName) { this.lastName = lastName; return this; } - @java.lang.Override + @Override public _FinalStage firstName(String firstName) { this.firstName = Optional.ofNullable(firstName); return this; } - @java.lang.Override + @Override @JsonSetter(value = "first_name", nulls = Nulls.SKIP) public _FinalStage firstName(Optional firstName) { this.firstName = firstName; return this; } - @java.lang.Override + @Override public FlowActionActivecampaignUpsertContactParams build() { return new FlowActionActivecampaignUpsertContactParams( connectionId, email, firstName, lastName, phone, customFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java index c7d701ea4..f25a27bde 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtable && equalTo((FlowActionAirtable) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionAirtable other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionAirtable.class); } - @java.lang.Override + @Override public FlowActionAirtable deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java index 7bbf26861..426e881b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java @@ -83,7 +83,7 @@ public FlowActionAirtableCreateRecordParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableCreateRecord && equalTo((FlowActionAirtableCreateRecord) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableCreateRecord other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableCreateRecord other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableCreateRecord other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableCreateRecordParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAirtableCreateRecord build() { return new FlowActionAirtableCreateRecord( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java index 1b77ec248..6dae34843 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java @@ -64,7 +64,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableCreateRecordParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionAirtableCreateRecordParams other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, BaseIdStage, Tab private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableCreateRecordParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -143,41 +143,41 @@ public Builder from(FlowActionAirtableCreateRecordParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("table_name") public _FinalStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public FlowActionAirtableCreateRecordParams build() { return new FlowActionAirtableCreateRecordParams( connectionId, baseId, tableName, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java index 22c909c64..dfdde8e5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java @@ -83,7 +83,7 @@ public FlowActionAirtableListRecordsParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableListRecords && equalTo((FlowActionAirtableListRecords) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableListRecords other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableListRecords other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableListRecords other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableListRecordsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAirtableListRecords build() { return new FlowActionAirtableListRecords(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java index cf5310d9f..a82ef5131 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java @@ -73,7 +73,7 @@ public Optional getView() { return view; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableListRecordsParams @@ -93,12 +93,12 @@ private boolean equalTo(FlowActionAirtableListRecordsParams other) { && view.equals(other.view); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.query, this.view); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,7 +150,7 @@ public static final class Builder implements ConnectionIdStage, BaseIdStage, Tab private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableListRecordsParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -160,54 +160,54 @@ public Builder from(FlowActionAirtableListRecordsParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("table_name") public _FinalStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage view(String view) { this.view = Optional.ofNullable(view); return this; } - @java.lang.Override + @Override @JsonSetter(value = "view", nulls = Nulls.SKIP) public _FinalStage view(Optional view) { this.view = view; return this; } - @java.lang.Override + @Override public _FinalStage query(String query) { this.query = Optional.ofNullable(query); return this; } - @java.lang.Override + @Override @JsonSetter(value = "query", nulls = Nulls.SKIP) public _FinalStage query(Optional query) { this.query = query; return this; } - @java.lang.Override + @Override public FlowActionAirtableListRecordsParams build() { return new FlowActionAirtableListRecordsParams( connectionId, baseId, tableName, query, view, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java index 5552a1253..4c280f1aa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java @@ -83,7 +83,7 @@ public FlowActionAirtableUpdateRecordParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableUpdateRecord && equalTo((FlowActionAirtableUpdateRecord) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableUpdateRecord other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableUpdateRecord other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableUpdateRecord other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableUpdateRecordParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAirtableUpdateRecord build() { return new FlowActionAirtableUpdateRecord( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java index cc9e72e32..0665ceb3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java @@ -73,7 +73,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableUpdateRecordParams @@ -93,12 +93,12 @@ private boolean equalTo(FlowActionAirtableUpdateRecordParams other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.recordId, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -151,7 +151,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAirtableUpdateRecordParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -161,48 +161,48 @@ public Builder from(FlowActionAirtableUpdateRecordParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("table_name") public RecordIdStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("record_id") public _FinalStage recordId(@NotNull String recordId) { this.recordId = Objects.requireNonNull(recordId, "recordId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public FlowActionAirtableUpdateRecordParams build() { return new FlowActionAirtableUpdateRecordParams( connectionId, baseId, tableName, recordId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java index ac26ddf3a..b8c5ae864 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java @@ -39,11 +39,13 @@ public T visit(Visitor visitor) { return visitor.visit((FlowActionAuth0UpdateUser) this.value); } else if (this.type == 3) { return visitor.visit((FlowActionAuth0SendRequest) this.value); + } else if (this.type == 4) { + return visitor.visit((FlowActionAuth0SendEmail) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0 && equalTo((FlowActionAuth0) other); @@ -53,12 +55,12 @@ private boolean equalTo(FlowActionAuth0 other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,6 +81,10 @@ public static FlowActionAuth0 of(FlowActionAuth0SendRequest value) { return new FlowActionAuth0(value, 3); } + public static FlowActionAuth0 of(FlowActionAuth0SendEmail value) { + return new FlowActionAuth0(value, 4); + } + public interface Visitor { T visit(FlowActionAuth0CreateUser value); @@ -87,6 +93,8 @@ public interface Visitor { T visit(FlowActionAuth0UpdateUser value); T visit(FlowActionAuth0SendRequest value); + + T visit(FlowActionAuth0SendEmail value); } static final class Deserializer extends StdDeserializer { @@ -94,7 +102,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionAuth0.class); } - @java.lang.Override + @Override public FlowActionAuth0 deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { @@ -113,6 +121,10 @@ public FlowActionAuth0 deserialize(JsonParser p, DeserializationContext context) return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0SendRequest.class)); } catch (RuntimeException e) { } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowActionAuth0SendEmail.class)); + } catch (RuntimeException e) { + } throw new JsonParseException(p, "Failed to deserialize"); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java index 3b812faf4..fd7a95dce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java @@ -83,7 +83,7 @@ public FlowActionAuth0CreateUserParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0CreateUser && equalTo((FlowActionAuth0CreateUser) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0CreateUser other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0CreateUser other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0CreateUser other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0CreateUserParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAuth0CreateUser build() { return new FlowActionAuth0CreateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java index adee48f44..f48057ee0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java @@ -44,7 +44,7 @@ public Map getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0CreateUserParams && equalTo((FlowActionAuth0CreateUserParams) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionAuth0CreateUserParams other) { return connectionId.equals(other.connectionId) && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,27 +100,27 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0CreateUserParams other) { connectionId(other.getConnectionId()); payload(other.getPayload()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage payload(String key, Object value) { this.payload.put(key, value); return this; } - @java.lang.Override + @Override public _FinalStage putAllPayload(Map payload) { if (payload != null) { this.payload.putAll(payload); @@ -128,7 +128,7 @@ public _FinalStage putAllPayload(Map payload) { return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Map payload) { this.payload.clear(); @@ -138,7 +138,7 @@ public _FinalStage payload(Map payload) { return this; } - @java.lang.Override + @Override public FlowActionAuth0CreateUserParams build() { return new FlowActionAuth0CreateUserParams(connectionId, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java index cb3818a12..a3a4abbf8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java @@ -83,7 +83,7 @@ public FlowActionAuth0GetUserParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0GetUser && equalTo((FlowActionAuth0GetUser) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0GetUser other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0GetUser other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0GetUser other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0GetUserParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAuth0GetUser build() { return new FlowActionAuth0GetUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java index 6daecbc64..0722bd5e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java @@ -41,7 +41,7 @@ public String getUserId() { return userId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0GetUserParams && equalTo((FlowActionAuth0GetUserParams) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionAuth0GetUserParams other) { return connectionId.equals(other.connectionId) && userId.equals(other.userId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.userId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ConnectionIdStage, UserIdStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0GetUserParams other) { connectionId(other.getConnectionId()); userId(other.getUserId()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public UserIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @java.lang.Override + @Override public FlowActionAuth0GetUserParams build() { return new FlowActionAuth0GetUserParams(connectionId, userId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java new file mode 100644 index 000000000..ee6ea13ba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0SendEmail.Builder.class) +public final class FlowActionAuth0SendEmail { + private final String id; + + private final Optional alias; + + private final Optional allowFailure; + + private final Optional maskOutput; + + private final FlowActionAuth0SendEmailParams params; + + private final Map additionalProperties; + + private FlowActionAuth0SendEmail( + String id, + Optional alias, + Optional allowFailure, + Optional maskOutput, + FlowActionAuth0SendEmailParams params, + Map additionalProperties) { + this.id = id; + this.alias = alias; + this.allowFailure = allowFailure; + this.maskOutput = maskOutput; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("alias") + public Optional getAlias() { + return alias; + } + + @JsonProperty("type") + public String getType() { + return "AUTH0"; + } + + @JsonProperty("action") + public String getAction() { + return "SEND_EMAIL"; + } + + @JsonProperty("allow_failure") + public Optional getAllowFailure() { + return allowFailure; + } + + @JsonProperty("mask_output") + public Optional getMaskOutput() { + return maskOutput; + } + + @JsonProperty("params") + public FlowActionAuth0SendEmailParams getParams() { + return params; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendEmail && equalTo((FlowActionAuth0SendEmail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0SendEmail other) { + return id.equals(other.id) + && alias.equals(other.alias) + && allowFailure.equals(other.allowFailure) + && maskOutput.equals(other.maskOutput) + && params.equals(other.params); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + ParamsStage id(@NotNull String id); + + Builder from(FlowActionAuth0SendEmail other); + } + + public interface ParamsStage { + _FinalStage params(@NotNull FlowActionAuth0SendEmailParams params); + } + + public interface _FinalStage { + FlowActionAuth0SendEmail build(); + + _FinalStage alias(Optional alias); + + _FinalStage alias(String alias); + + _FinalStage allowFailure(Optional allowFailure); + + _FinalStage allowFailure(Boolean allowFailure); + + _FinalStage maskOutput(Optional maskOutput); + + _FinalStage maskOutput(Boolean maskOutput); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, ParamsStage, _FinalStage { + private String id; + + private FlowActionAuth0SendEmailParams params; + + private Optional maskOutput = Optional.empty(); + + private Optional allowFailure = Optional.empty(); + + private Optional alias = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowActionAuth0SendEmail other) { + id(other.getId()); + alias(other.getAlias()); + allowFailure(other.getAllowFailure()); + maskOutput(other.getMaskOutput()); + params(other.getParams()); + return this; + } + + @Override + @JsonSetter("id") + public ParamsStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @Override + @JsonSetter("params") + public _FinalStage params(@NotNull FlowActionAuth0SendEmailParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @Override + public _FinalStage maskOutput(Boolean maskOutput) { + this.maskOutput = Optional.ofNullable(maskOutput); + return this; + } + + @Override + @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) + public _FinalStage maskOutput(Optional maskOutput) { + this.maskOutput = maskOutput; + return this; + } + + @Override + public _FinalStage allowFailure(Boolean allowFailure) { + this.allowFailure = Optional.ofNullable(allowFailure); + return this; + } + + @Override + @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) + public _FinalStage allowFailure(Optional allowFailure) { + this.allowFailure = allowFailure; + return this; + } + + @Override + public _FinalStage alias(String alias) { + this.alias = Optional.ofNullable(alias); + return this; + } + + @Override + @JsonSetter(value = "alias", nulls = Nulls.SKIP) + public _FinalStage alias(Optional alias) { + this.alias = alias; + return this; + } + + @Override + public FlowActionAuth0SendEmail build() { + return new FlowActionAuth0SendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java new file mode 100644 index 000000000..491149107 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java @@ -0,0 +1,214 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0SendEmailParams.Builder.class) +public final class FlowActionAuth0SendEmailParams { + private final Optional from; + + private final String to; + + private final String subject; + + private final String body; + + private final Optional> customVars; + + private final Map additionalProperties; + + private FlowActionAuth0SendEmailParams( + Optional from, + String to, + String subject, + String body, + Optional> customVars, + Map additionalProperties) { + this.from = from; + this.to = to; + this.subject = subject; + this.body = body; + this.customVars = customVars; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("from") + public Optional getFrom() { + return from; + } + + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("subject") + public String getSubject() { + return subject; + } + + @JsonProperty("body") + public String getBody() { + return body; + } + + @JsonProperty("custom_vars") + public Optional> getCustomVars() { + return customVars; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendEmailParams && equalTo((FlowActionAuth0SendEmailParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0SendEmailParams other) { + return from.equals(other.from) + && to.equals(other.to) + && subject.equals(other.subject) + && body.equals(other.body) + && customVars.equals(other.customVars); + } + + @Override + public int hashCode() { + return Objects.hash(this.from, this.to, this.subject, this.body, this.customVars); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ToStage builder() { + return new Builder(); + } + + public interface ToStage { + SubjectStage to(@NotNull String to); + + Builder from(FlowActionAuth0SendEmailParams other); + } + + public interface SubjectStage { + BodyStage subject(@NotNull String subject); + } + + public interface BodyStage { + _FinalStage body(@NotNull String body); + } + + public interface _FinalStage { + FlowActionAuth0SendEmailParams build(); + + _FinalStage from(Optional from); + + _FinalStage from(FlowActionAuth0SendEmailParamsFrom from); + + _FinalStage customVars(Optional> customVars); + + _FinalStage customVars(Map customVars); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ToStage, SubjectStage, BodyStage, _FinalStage { + private String to; + + private String subject; + + private String body; + + private Optional> customVars = Optional.empty(); + + private Optional from = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowActionAuth0SendEmailParams other) { + from(other.getFrom()); + to(other.getTo()); + subject(other.getSubject()); + body(other.getBody()); + customVars(other.getCustomVars()); + return this; + } + + @Override + @JsonSetter("to") + public SubjectStage to(@NotNull String to) { + this.to = Objects.requireNonNull(to, "to must not be null"); + return this; + } + + @Override + @JsonSetter("subject") + public BodyStage subject(@NotNull String subject) { + this.subject = Objects.requireNonNull(subject, "subject must not be null"); + return this; + } + + @Override + @JsonSetter("body") + public _FinalStage body(@NotNull String body) { + this.body = Objects.requireNonNull(body, "body must not be null"); + return this; + } + + @Override + public _FinalStage customVars(Map customVars) { + this.customVars = Optional.ofNullable(customVars); + return this; + } + + @Override + @JsonSetter(value = "custom_vars", nulls = Nulls.SKIP) + public _FinalStage customVars(Optional> customVars) { + this.customVars = customVars; + return this; + } + + @Override + public _FinalStage from(FlowActionAuth0SendEmailParamsFrom from) { + this.from = Optional.ofNullable(from); + return this; + } + + @Override + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public _FinalStage from(Optional from) { + this.from = from; + return this; + } + + @Override + public FlowActionAuth0SendEmailParams build() { + return new FlowActionAuth0SendEmailParams(from, to, subject, body, customVars, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java new file mode 100644 index 000000000..af55a6509 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowActionAuth0SendEmailParamsFrom.Builder.class) +public final class FlowActionAuth0SendEmailParamsFrom { + private final Optional name; + + private final String email; + + private final Map additionalProperties; + + private FlowActionAuth0SendEmailParamsFrom( + Optional name, String email, Map additionalProperties) { + this.name = name; + this.email = email; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("email") + public String getEmail() { + return email; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendEmailParamsFrom + && equalTo((FlowActionAuth0SendEmailParamsFrom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowActionAuth0SendEmailParamsFrom other) { + return name.equals(other.name) && email.equals(other.email); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.email); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EmailStage builder() { + return new Builder(); + } + + public interface EmailStage { + _FinalStage email(@NotNull String email); + + Builder from(FlowActionAuth0SendEmailParamsFrom other); + } + + public interface _FinalStage { + FlowActionAuth0SendEmailParamsFrom build(); + + _FinalStage name(Optional name); + + _FinalStage name(String name); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EmailStage, _FinalStage { + private String email; + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowActionAuth0SendEmailParamsFrom other) { + name(other.getName()); + email(other.getEmail()); + return this; + } + + @Override + @JsonSetter("email") + public _FinalStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + @Override + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + + @Override + public FlowActionAuth0SendEmailParamsFrom build() { + return new FlowActionAuth0SendEmailParamsFrom(name, email, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java index 661c1e180..7e25d6c4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java @@ -83,7 +83,7 @@ public FlowActionAuth0SendRequestParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequest && equalTo((FlowActionAuth0SendRequest) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0SendRequest other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0SendRequest other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0SendRequest other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0SendRequestParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAuth0SendRequest build() { return new FlowActionAuth0SendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java index b0e7f15e3..fb691f00e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,7 +30,7 @@ public final class FlowActionAuth0SendRequestParams { private final Optional> headers; - private final Optional> params; + private final Optional>> params; private final Optional payload; @@ -40,7 +41,7 @@ private FlowActionAuth0SendRequestParams( String pathname, Optional method, Optional> headers, - Optional> params, + Optional>> params, Optional payload, Map additionalProperties) { this.connectionId = connectionId; @@ -73,7 +74,7 @@ public Optional> getHeaders() { } @JsonProperty("params") - public Optional> getParams() { + public Optional>> getParams() { return params; } @@ -82,7 +83,7 @@ public Optional getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequestParams && equalTo((FlowActionAuth0SendRequestParams) other); @@ -102,12 +103,12 @@ private boolean equalTo(FlowActionAuth0SendRequestParams other) { && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.pathname, this.method, this.headers, this.params, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -137,9 +138,10 @@ public interface _FinalStage { _FinalStage headers(Map headers); - _FinalStage params(Optional> params); + _FinalStage params( + Optional>> params); - _FinalStage params(Map params); + _FinalStage params(Map> params); _FinalStage payload(Optional payload); @@ -154,7 +156,8 @@ public static final class Builder implements ConnectionIdStage, PathnameStage, _ private Optional payload = Optional.empty(); - private Optional> params = Optional.empty(); + private Optional>> params = + Optional.empty(); private Optional> headers = Optional.empty(); @@ -165,7 +168,7 @@ public static final class Builder implements ConnectionIdStage, PathnameStage, _ private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0SendRequestParams other) { connectionId(other.getConnectionId()); pathname(other.getPathname()); @@ -176,73 +179,75 @@ public Builder from(FlowActionAuth0SendRequestParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public PathnameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("pathname") public _FinalStage pathname(@NotNull String pathname) { this.pathname = Objects.requireNonNull(pathname, "pathname must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage payload(FlowActionAuth0SendRequestParamsPayload payload) { this.payload = Optional.ofNullable(payload); return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional payload) { this.payload = payload; return this; } - @java.lang.Override - public _FinalStage params(Map params) { + @Override + public _FinalStage params( + Map> params) { this.params = Optional.ofNullable(params); return this; } - @java.lang.Override + @Override @JsonSetter(value = "params", nulls = Nulls.SKIP) - public _FinalStage params(Optional> params) { + public _FinalStage params( + Optional>> params) { this.params = params; return this; } - @java.lang.Override + @Override public _FinalStage headers(Map headers) { this.headers = Optional.ofNullable(headers); return this; } - @java.lang.Override + @Override @JsonSetter(value = "headers", nulls = Nulls.SKIP) public _FinalStage headers(Optional> headers) { this.headers = headers; return this; } - @java.lang.Override + @Override public _FinalStage method(FlowActionAuth0SendRequestParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @java.lang.Override + @Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @java.lang.Override + @Override public FlowActionAuth0SendRequestParams build() { return new FlowActionAuth0SendRequestParams( connectionId, pathname, method, headers, params, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java index 56bd83eb8..fedfaa075 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionAuth0SendRequestParamsMethod && this.string.equals(((FlowActionAuth0SendRequestParamsMethod) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java index c88b6c5ac..b32042d92 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java @@ -44,7 +44,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequestParamsPayload @@ -55,12 +55,12 @@ private boolean equalTo(FlowActionAuth0SendRequestParamsPayload other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -90,7 +90,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((double) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionAuth0SendRequestParamsQueryParamsValue + && equalTo((FlowActionAuth0SendRequestParamsQueryParamsValue) other); + } + + private boolean equalTo(FlowActionAuth0SendRequestParamsQueryParamsValue other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionAuth0SendRequestParamsQueryParamsValue of(double value) { + return new FlowActionAuth0SendRequestParamsQueryParamsValue(value, 0); + } + + public static FlowActionAuth0SendRequestParamsQueryParamsValue of(String value) { + return new FlowActionAuth0SendRequestParamsQueryParamsValue(value, 1); + } + + public interface Visitor { + T visit(double value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionAuth0SendRequestParamsQueryParamsValue.class); + } + + @Override + public FlowActionAuth0SendRequestParamsQueryParamsValue deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Double) { + return of((Double) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java index de7e23136..1c6604e40 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUser.java @@ -83,7 +83,7 @@ public FlowActionAuth0UpdateUserParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0UpdateUser && equalTo((FlowActionAuth0UpdateUser) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0UpdateUser other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0UpdateUser other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0UpdateUser other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0UpdateUserParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionAuth0UpdateUser build() { return new FlowActionAuth0UpdateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java index 3d81255d1..cd3be1054 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java @@ -52,7 +52,7 @@ public Map getChanges() { return changes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0UpdateUserParams && equalTo((FlowActionAuth0UpdateUserParams) other); @@ -67,12 +67,12 @@ private boolean equalTo(FlowActionAuth0UpdateUserParams other) { return connectionId.equals(other.connectionId) && userId.equals(other.userId) && changes.equals(other.changes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.userId, this.changes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -114,7 +114,7 @@ public static final class Builder implements ConnectionIdStage, UserIdStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionAuth0UpdateUserParams other) { connectionId(other.getConnectionId()); userId(other.getUserId()); @@ -122,27 +122,27 @@ public Builder from(FlowActionAuth0UpdateUserParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public UserIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage changes(String key, Object value) { this.changes.put(key, value); return this; } - @java.lang.Override + @Override public _FinalStage putAllChanges(Map changes) { if (changes != null) { this.changes.putAll(changes); @@ -150,7 +150,7 @@ public _FinalStage putAllChanges(Map changes) { return this; } - @java.lang.Override + @Override @JsonSetter(value = "changes", nulls = Nulls.SKIP) public _FinalStage changes(Map changes) { this.changes.clear(); @@ -160,7 +160,7 @@ public _FinalStage changes(Map changes) { return this; } - @java.lang.Override + @Override public FlowActionAuth0UpdateUserParams build() { return new FlowActionAuth0UpdateUserParams(connectionId, userId, changes, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java index 2a291b96a..eb570b822 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java @@ -83,7 +83,7 @@ public FlowActionBigqueryInsertRowsParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionBigqueryInsertRows && equalTo((FlowActionBigqueryInsertRows) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionBigqueryInsertRows other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionBigqueryInsertRows other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionBigqueryInsertRows other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionBigqueryInsertRowsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionBigqueryInsertRows build() { return new FlowActionBigqueryInsertRows(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java index 1dd56cd7f..53530434d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java @@ -64,7 +64,7 @@ public Optional> getData() { return data; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionBigqueryInsertRowsParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionBigqueryInsertRowsParams other) { && data.equals(other.data); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.datasetId, this.tableId, this.data); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, DatasetIdStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionBigqueryInsertRowsParams other) { connectionId(other.getConnectionId()); datasetId(other.getDatasetId()); @@ -143,41 +143,41 @@ public Builder from(FlowActionBigqueryInsertRowsParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public DatasetIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("dataset_id") public TableIdStage datasetId(@NotNull String datasetId) { this.datasetId = Objects.requireNonNull(datasetId, "datasetId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("table_id") public _FinalStage tableId(@NotNull String tableId) { this.tableId = Objects.requireNonNull(tableId, "tableId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage data(Map data) { this.data = Optional.ofNullable(data); return this; } - @java.lang.Override + @Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional> data) { this.data = data; return this; } - @java.lang.Override + @Override public FlowActionBigqueryInsertRowsParams build() { return new FlowActionBigqueryInsertRowsParams(connectionId, datasetId, tableId, data, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java index 1cc990a3e..38f94bb79 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbit && equalTo((FlowActionClearbit) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionClearbit other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionClearbit.class); } - @java.lang.Override + @Override public FlowActionClearbit deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java index 32dbae7f7..dce2f7fe7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java @@ -83,7 +83,7 @@ public FlowActionClearbitFindCompanyParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindCompany && equalTo((FlowActionClearbitFindCompany) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionClearbitFindCompany other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionClearbitFindCompany other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionClearbitFindCompany other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionClearbitFindCompanyParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionClearbitFindCompany build() { return new FlowActionClearbitFindCompany(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java index de83605e4..04fe85fe7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java @@ -42,7 +42,7 @@ public String getDomain() { return domain; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindCompanyParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionClearbitFindCompanyParams other) { return connectionId.equals(other.connectionId) && domain.equals(other.domain); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.domain); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, DomainStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionClearbitFindCompanyParams other) { connectionId(other.getConnectionId()); domain(other.getDomain()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public DomainStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("domain") public _FinalStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @java.lang.Override + @Override public FlowActionClearbitFindCompanyParams build() { return new FlowActionClearbitFindCompanyParams(connectionId, domain, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java index ed02098c2..b3ec8a351 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java @@ -83,7 +83,7 @@ public FlowActionClearbitFindPersonParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindPerson && equalTo((FlowActionClearbitFindPerson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionClearbitFindPerson other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionClearbitFindPerson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionClearbitFindPerson other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionClearbitFindPersonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionClearbitFindPerson build() { return new FlowActionClearbitFindPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java index 8c4cb50f3..9b0a4a962 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindPersonParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionClearbitFindPersonParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionClearbitFindPersonParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public FlowActionClearbitFindPersonParams build() { return new FlowActionClearbitFindPersonParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java index d4c2ebbc1..c40e27a91 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java @@ -83,7 +83,7 @@ public FlowActionEmailVerifyEmailParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmail && equalTo((FlowActionEmailVerifyEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionEmailVerifyEmail other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionEmailVerifyEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionEmailVerifyEmail other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionEmailVerifyEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionEmailVerifyEmail build() { return new FlowActionEmailVerifyEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java index 8a1714450..8dfcd7400 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java @@ -46,7 +46,7 @@ public Optional getRules() { return rules; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmailParams && equalTo((FlowActionEmailVerifyEmailParams) other); @@ -61,12 +61,12 @@ private boolean equalTo(FlowActionEmailVerifyEmailParams other) { return email.equals(other.email) && rules.equals(other.rules); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.email, this.rules); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,34 +100,34 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionEmailVerifyEmailParams other) { email(other.getEmail()); rules(other.getRules()); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage rules(FlowActionEmailVerifyEmailParamsRules rules) { this.rules = Optional.ofNullable(rules); return this; } - @java.lang.Override + @Override @JsonSetter(value = "rules", nulls = Nulls.SKIP) public _FinalStage rules(Optional rules) { this.rules = rules; return this; } - @java.lang.Override + @Override public FlowActionEmailVerifyEmailParams build() { return new FlowActionEmailVerifyEmailParams(email, rules, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java index 77655741d..5f4da51b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java @@ -82,7 +82,7 @@ public Optional> getAllowlist() { return allowlist; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmailParamsRules @@ -103,7 +103,7 @@ private boolean equalTo(FlowActionEmailVerifyEmailParamsRules other) { && allowlist.equals(other.allowlist); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.requireMxRecord, @@ -114,7 +114,7 @@ public int hashCode() { this.allowlist); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java index 1b493a483..375ac010d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java @@ -49,7 +49,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlow && equalTo((FlowActionFlow) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionFlow other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -118,7 +118,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionFlow.class); } - @java.lang.Override + @Override public FlowActionFlow deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java index d89b71bf6..0f10dab51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java @@ -83,7 +83,7 @@ public FlowActionFlowBooleanConditionParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowBooleanCondition && equalTo((FlowActionFlowBooleanCondition) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowBooleanCondition other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowBooleanCondition other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowBooleanCondition other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowBooleanConditionParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowBooleanCondition build() { return new FlowActionFlowBooleanCondition( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java index 43db6943a..94a29b570 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java @@ -46,7 +46,7 @@ public Optional> getElse() { return else_; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowBooleanConditionParams @@ -62,12 +62,12 @@ private boolean equalTo(FlowActionFlowBooleanConditionParams other) { return then.equals(other.then) && else_.equals(other.else_); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.then, this.else_); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java index 412f9030a..853fb42e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java @@ -83,7 +83,7 @@ public FlowActionFlowDelayFlowParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlow && equalTo((FlowActionFlowDelayFlow) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowDelayFlow other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowDelayFlow other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowDelayFlow other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowDelayFlowParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowDelayFlow build() { return new FlowActionFlowDelayFlow(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java index ba1cb36c2..d4813f514 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java @@ -46,7 +46,7 @@ public Optional getUnits() { return units; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlowParams && equalTo((FlowActionFlowDelayFlowParams) other); @@ -61,12 +61,12 @@ private boolean equalTo(FlowActionFlowDelayFlowParams other) { return number.equals(other.number) && units.equals(other.units); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.number, this.units); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,34 +100,34 @@ public static final class Builder implements NumberStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowDelayFlowParams other) { number(other.getNumber()); units(other.getUnits()); return this; } - @java.lang.Override + @Override @JsonSetter("number") public _FinalStage number(@NotNull FlowActionFlowDelayFlowParamsNumber number) { this.number = Objects.requireNonNull(number, "number must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage units(FlowActionFlowDelayFlowParamsUnits units) { this.units = Optional.ofNullable(units); return this; } - @java.lang.Override + @Override @JsonSetter(value = "units", nulls = Nulls.SKIP) public _FinalStage units(Optional units) { this.units = units; return this; } - @java.lang.Override + @Override public FlowActionFlowDelayFlowParams build() { return new FlowActionFlowDelayFlowParams(number, units, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java index b552f5158..5ff39d7df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlowParamsNumber @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionFlowDelayFlowParamsNumber other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDoNothing && equalTo((FlowActionFlowDoNothing) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowDoNothing other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowDoNothing other) { id(other.getId()); alias(other.getAlias()); @@ -169,66 +169,66 @@ public Builder from(FlowActionFlowDoNothing other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage params(FlowActionFlowDoNothingParams params) { this.params = Optional.ofNullable(params); return this; } - @java.lang.Override + @Override @JsonSetter(value = "params", nulls = Nulls.SKIP) public _FinalStage params(Optional params) { this.params = params; return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowDoNothing build() { return new FlowActionFlowDoNothing(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java index 35a08cb41..492b2495d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java @@ -21,7 +21,7 @@ private FlowActionFlowDoNothingParams(Map additionalProperties) this.additionalProperties = additionalProperties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDoNothingParams; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java index 21366736d..ddd6f57d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java @@ -83,7 +83,7 @@ public FlowActionFlowErrorMessageParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowErrorMessage && equalTo((FlowActionFlowErrorMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowErrorMessage other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowErrorMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowErrorMessage other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowErrorMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowErrorMessage build() { return new FlowActionFlowErrorMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java index 0628fae3e..30abc34d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java @@ -33,7 +33,7 @@ public String getMessage() { return message; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowErrorMessageParams && equalTo((FlowActionFlowErrorMessageParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionFlowErrorMessageParams other) { return message.equals(other.message); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.message); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements MessageStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowErrorMessageParams other) { message(other.getMessage()); return this; } - @java.lang.Override + @Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @java.lang.Override + @Override public FlowActionFlowErrorMessageParams build() { return new FlowActionFlowErrorMessageParams(message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java index 1f179c174..7cdb82ac8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java @@ -83,7 +83,7 @@ public FlowActionFlowMapValueParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValue && equalTo((FlowActionFlowMapValue) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowMapValue other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowMapValue other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowMapValue other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowMapValueParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowMapValue build() { return new FlowActionFlowMapValue(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java index 850feaf73..a1fb7d4d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java @@ -55,7 +55,7 @@ public Optional getFallback() { return fallback; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParams && equalTo((FlowActionFlowMapValueParams) other); @@ -70,12 +70,12 @@ private boolean equalTo(FlowActionFlowMapValueParams other) { return input.equals(other.input) && cases.equals(other.cases) && fallback.equals(other.fallback); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.input, this.cases, this.fallback); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements InputStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowMapValueParams other) { input(other.getInput()); cases(other.getCases()); @@ -123,40 +123,40 @@ public Builder from(FlowActionFlowMapValueParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("input") public _FinalStage input(@NotNull FlowActionFlowMapValueParamsInput input) { this.input = Objects.requireNonNull(input, "input must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fallback(FlowActionFlowMapValueParamsFallback fallback) { this.fallback = Optional.ofNullable(fallback); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fallback", nulls = Nulls.SKIP) public _FinalStage fallback(Optional fallback) { this.fallback = fallback; return this; } - @java.lang.Override + @Override public _FinalStage cases(Map cases) { this.cases = Optional.ofNullable(cases); return this; } - @java.lang.Override + @Override @JsonSetter(value = "cases", nulls = Nulls.SKIP) public _FinalStage cases(Optional> cases) { this.cases = cases; return this; } - @java.lang.Override + @Override public FlowActionFlowMapValueParams build() { return new FlowActionFlowMapValueParams(input, cases, fallback, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java index 48a01b9d9..83124005e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java @@ -46,7 +46,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParamsFallback @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionFlowMapValueParamsFallback other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -98,7 +98,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParamsInput && equalTo((FlowActionFlowMapValueParamsInput) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowMapValueParamsInput other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowReturnJson build() { return new FlowActionFlowReturnJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java index c80f080fe..06ef61ff9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java @@ -34,7 +34,7 @@ public FlowActionFlowReturnJsonParamsPayload getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowReturnJsonParams && equalTo((FlowActionFlowReturnJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowReturnJsonParams other) { return payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements PayloadStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionFlowReturnJsonParams other) { payload(other.getPayload()); return this; } - @java.lang.Override + @Override @JsonSetter("payload") public _FinalStage payload(@NotNull FlowActionFlowReturnJsonParamsPayload payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @java.lang.Override + @Override public FlowActionFlowReturnJsonParams build() { return new FlowActionFlowReturnJsonParams(payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java index 098c68e40..4519d3ced 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowReturnJsonParamsPayload @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionFlowReturnJsonParamsPayload other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionFlowStoreVars build() { return new FlowActionFlowStoreVars(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java index 41ccaa29f..253e70304 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java @@ -34,7 +34,7 @@ public Map getVars() { return vars; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowStoreVarsParams && equalTo((FlowActionFlowStoreVarsParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowStoreVarsParams other) { return vars.equals(other.vars); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.vars); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java index 1f2612825..dd785e332 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java @@ -83,7 +83,7 @@ public FlowActionGoogleSheetsAddRowParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRow && equalTo((FlowActionGoogleSheetsAddRow) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRow other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionGoogleSheetsAddRow other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionGoogleSheetsAddRow other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionGoogleSheetsAddRowParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionGoogleSheetsAddRow build() { return new FlowActionGoogleSheetsAddRow(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java index 38924b194..bd73a8107 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java @@ -66,7 +66,7 @@ public Optional>> getValues() { return values; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRowParams @@ -85,12 +85,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRowParams other) { && values.equals(other.values); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.spreadsheetId, this.sheetId, this.values); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -136,7 +136,7 @@ public static final class Builder implements ConnectionIdStage, SpreadsheetIdSta private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionGoogleSheetsAddRowParams other) { connectionId(other.getConnectionId()); spreadsheetId(other.getSpreadsheetId()); @@ -145,47 +145,47 @@ public Builder from(FlowActionGoogleSheetsAddRowParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public SpreadsheetIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("spreadsheet_id") public _FinalStage spreadsheetId(@NotNull String spreadsheetId) { this.spreadsheetId = Objects.requireNonNull(spreadsheetId, "spreadsheetId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage values(List> values) { this.values = Optional.ofNullable(values); return this; } - @java.lang.Override + @Override @JsonSetter(value = "values", nulls = Nulls.SKIP) public _FinalStage values(Optional>> values) { this.values = values; return this; } - @java.lang.Override + @Override public _FinalStage sheetId(FlowActionGoogleSheetsAddRowParamsSheetId sheetId) { this.sheetId = Optional.ofNullable(sheetId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sheet_id", nulls = Nulls.SKIP) public _FinalStage sheetId(Optional sheetId) { this.sheetId = sheetId; return this; } - @java.lang.Override + @Override public FlowActionGoogleSheetsAddRowParams build() { return new FlowActionGoogleSheetsAddRowParams( connectionId, spreadsheetId, sheetId, values, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java index f7e4f5065..9b34d492a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRowParamsSheetId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRowParamsSheetId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionHttpSendRequest build() { return new FlowActionHttpSendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java index 34b03b5e3..10b80a9ed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -31,7 +32,7 @@ public final class FlowActionHttpSendRequestParams { private final Optional basic; - private final Optional> params; + private final Optional>> params; private final Optional payload; @@ -45,7 +46,7 @@ private FlowActionHttpSendRequestParams( Optional method, Optional> headers, Optional basic, - Optional> params, + Optional>> params, Optional payload, Optional contentType, Map additionalProperties) { @@ -86,7 +87,7 @@ public Optional getBasic() { } @JsonProperty("params") - public Optional> getParams() { + public Optional>> getParams() { return params; } @@ -100,7 +101,7 @@ public Optional getContentType() { return contentType; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParams && equalTo((FlowActionHttpSendRequestParams) other); @@ -122,7 +123,7 @@ private boolean equalTo(FlowActionHttpSendRequestParams other) { && contentType.equals(other.contentType); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -135,7 +136,7 @@ public int hashCode() { this.contentType); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -169,9 +170,10 @@ public interface _FinalStage { _FinalStage basic(FlowActionHttpSendRequestParamsBasicAuth basic); - _FinalStage params(Optional> params); + _FinalStage params( + Optional>> params); - _FinalStage params(Map params); + _FinalStage params(Map> params); _FinalStage payload(Optional payload); @@ -190,7 +192,8 @@ public static final class Builder implements UrlStage, _FinalStage { private Optional payload = Optional.empty(); - private Optional> params = Optional.empty(); + private Optional>> params = + Optional.empty(); private Optional basic = Optional.empty(); @@ -205,7 +208,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHttpSendRequestParams other) { connectionId(other.getConnectionId()); url(other.getUrl()); @@ -218,105 +221,107 @@ public Builder from(FlowActionHttpSendRequestParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage contentType(FlowActionHttpSendRequestParamsContentType contentType) { this.contentType = Optional.ofNullable(contentType); return this; } - @java.lang.Override + @Override @JsonSetter(value = "content_type", nulls = Nulls.SKIP) public _FinalStage contentType(Optional contentType) { this.contentType = contentType; return this; } - @java.lang.Override + @Override public _FinalStage payload(FlowActionHttpSendRequestParamsPayload payload) { this.payload = Optional.ofNullable(payload); return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional payload) { this.payload = payload; return this; } - @java.lang.Override - public _FinalStage params(Map params) { + @Override + public _FinalStage params( + Map> params) { this.params = Optional.ofNullable(params); return this; } - @java.lang.Override + @Override @JsonSetter(value = "params", nulls = Nulls.SKIP) - public _FinalStage params(Optional> params) { + public _FinalStage params( + Optional>> params) { this.params = params; return this; } - @java.lang.Override + @Override public _FinalStage basic(FlowActionHttpSendRequestParamsBasicAuth basic) { this.basic = Optional.ofNullable(basic); return this; } - @java.lang.Override + @Override @JsonSetter(value = "basic", nulls = Nulls.SKIP) public _FinalStage basic(Optional basic) { this.basic = basic; return this; } - @java.lang.Override + @Override public _FinalStage headers(Map headers) { this.headers = Optional.ofNullable(headers); return this; } - @java.lang.Override + @Override @JsonSetter(value = "headers", nulls = Nulls.SKIP) public _FinalStage headers(Optional> headers) { this.headers = headers; return this; } - @java.lang.Override + @Override public _FinalStage method(FlowActionHttpSendRequestParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @java.lang.Override + @Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @java.lang.Override + @Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @java.lang.Override + @Override public FlowActionHttpSendRequestParams build() { return new FlowActionHttpSendRequestParams( connectionId, url, method, headers, basic, params, payload, contentType, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java index fae9be90b..3b21b6f26 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java @@ -43,7 +43,7 @@ public Optional getPassword() { return password; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParamsBasicAuth @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionHttpSendRequestParamsBasicAuth other) { return username.equals(other.username) && password.equals(other.password); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.username, this.password); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java index f612ad7a8..636aa34a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionHttpSendRequestParamsContentType && this.string.equals(((FlowActionHttpSendRequestParamsContentType) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java index 63fda3fa3..677641a7b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionHttpSendRequestParamsMethod && this.string.equals(((FlowActionHttpSendRequestParamsMethod) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java index 1e96478b4..48436a45a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java @@ -44,7 +44,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParamsPayload @@ -55,12 +55,12 @@ private boolean equalTo(FlowActionHttpSendRequestParamsPayload other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -90,7 +90,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((double) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowActionHttpSendRequestParamsQueryParamsValue + && equalTo((FlowActionHttpSendRequestParamsQueryParamsValue) other); + } + + private boolean equalTo(FlowActionHttpSendRequestParamsQueryParamsValue other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FlowActionHttpSendRequestParamsQueryParamsValue of(double value) { + return new FlowActionHttpSendRequestParamsQueryParamsValue(value, 0); + } + + public static FlowActionHttpSendRequestParamsQueryParamsValue of(String value) { + return new FlowActionHttpSendRequestParamsQueryParamsValue(value, 1); + } + + public interface Visitor { + T visit(double value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FlowActionHttpSendRequestParamsQueryParamsValue.class); + } + + @Override + public FlowActionHttpSendRequestParamsQueryParamsValue deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Double) { + return of((Double) value); + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java index 769407858..4490422bc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspot.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspot && equalTo((FlowActionHubspot) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionHubspot other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionHubspot.class); } - @java.lang.Override + @Override public FlowActionHubspot deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java index b688e5d73..1d24ee26a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java @@ -83,7 +83,7 @@ public FlowActionHubspotEnrollContactParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContact && equalTo((FlowActionHubspotEnrollContact) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionHubspotEnrollContact other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotEnrollContact other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionHubspotEnrollContact other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionHubspotEnrollContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionHubspotEnrollContact build() { return new FlowActionHubspotEnrollContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java index aa2769440..f987cf3bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java @@ -53,7 +53,7 @@ public FlowActionHubspotEnrollContactParamsWorkflowId getWorkflowId() { return workflowId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContactParams @@ -71,12 +71,12 @@ private boolean equalTo(FlowActionHubspotEnrollContactParams other) { && workflowId.equals(other.workflowId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email, this.workflowId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +116,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, Work private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotEnrollContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -124,28 +124,28 @@ public Builder from(FlowActionHubspotEnrollContactParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public WorkflowIdStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("workflow_id") public _FinalStage workflowId(@NotNull FlowActionHubspotEnrollContactParamsWorkflowId workflowId) { this.workflowId = Objects.requireNonNull(workflowId, "workflowId must not be null"); return this; } - @java.lang.Override + @Override public FlowActionHubspotEnrollContactParams build() { return new FlowActionHubspotEnrollContactParams(connectionId, email, workflowId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java index bcd188307..061437406 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContactParamsWorkflowId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionHubspotEnrollContactParamsWorkflowId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionHubspotGetContact build() { return new FlowActionHubspotGetContact(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java index 40b575938..501f598ed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotGetContactParams && equalTo((FlowActionHubspotGetContactParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionHubspotGetContactParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotGetContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public FlowActionHubspotGetContactParams build() { return new FlowActionHubspotGetContactParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java index 2b51e4da8..72c0a2bfd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java @@ -83,7 +83,7 @@ public FlowActionHubspotUpsertContactParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContact && equalTo((FlowActionHubspotUpsertContact) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionHubspotUpsertContact other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotUpsertContact other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionHubspotUpsertContact other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionHubspotUpsertContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionHubspotUpsertContact build() { return new FlowActionHubspotUpsertContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java index 8546cd868..da3626093 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java @@ -56,7 +56,7 @@ public Optional> getPropertie return properties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContactParams @@ -74,12 +74,12 @@ private boolean equalTo(FlowActionHubspotUpsertContactParams other) { && properties.equals(other.properties); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email, this.properties); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -119,7 +119,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotUpsertContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -127,34 +127,34 @@ public Builder from(FlowActionHubspotUpsertContactParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage properties(List properties) { this.properties = Optional.ofNullable(properties); return this; } - @java.lang.Override + @Override @JsonSetter(value = "properties", nulls = Nulls.SKIP) public _FinalStage properties(Optional> properties) { this.properties = properties; return this; } - @java.lang.Override + @Override public FlowActionHubspotUpsertContactParams build() { return new FlowActionHubspotUpsertContactParams(connectionId, email, properties, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java index bb07959cb..2633142e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java @@ -33,7 +33,7 @@ public String getProperty() { return property; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContactParamsProperty @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionHubspotUpsertContactParamsProperty other) { return property.equals(other.property); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.property); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements PropertyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionHubspotUpsertContactParamsProperty other) { property(other.getProperty()); return this; } - @java.lang.Override + @Override @JsonSetter("property") public _FinalStage property(@NotNull String property) { this.property = Objects.requireNonNull(property, "property must not be null"); return this; } - @java.lang.Override + @Override public FlowActionHubspotUpsertContactParamsProperty build() { return new FlowActionHubspotUpsertContactParamsProperty(property, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java index 5d6e9ce3a..e22ee0ba7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJson && equalTo((FlowActionJson) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionJson other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionJson.class); } - @java.lang.Override + @Override public FlowActionJson deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java index 0f8951b2f..c99272af5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java @@ -83,7 +83,7 @@ public FlowActionJsonCreateJsonParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonCreateJson && equalTo((FlowActionJsonCreateJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonCreateJson other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJsonCreateJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonCreateJson other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonCreateJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJsonCreateJson build() { return new FlowActionJsonCreateJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java index 0bd6dd71b..2617bc981 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java @@ -34,7 +34,7 @@ public Map getObject() { return object; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonCreateJsonParams && equalTo((FlowActionJsonCreateJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionJsonCreateJsonParams other) { return object.equals(other.object); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.object); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java index aee15d7f1..e421566a9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java @@ -83,7 +83,7 @@ public FlowActionJsonParseJsonParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonParseJson && equalTo((FlowActionJsonParseJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonParseJson other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJsonParseJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonParseJson other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonParseJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJsonParseJson build() { return new FlowActionJsonParseJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java index 6f743bdff..b20384d9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java @@ -33,7 +33,7 @@ public String getJson() { return json; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonParseJsonParams && equalTo((FlowActionJsonParseJsonParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionJsonParseJsonParams other) { return json.equals(other.json); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.json); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements JsonStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJsonParseJsonParams other) { json(other.getJson()); return this; } - @java.lang.Override + @Override @JsonSetter("json") public _FinalStage json(@NotNull String json) { this.json = Objects.requireNonNull(json, "json must not be null"); return this; } - @java.lang.Override + @Override public FlowActionJsonParseJsonParams build() { return new FlowActionJsonParseJsonParams(json, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java index bf71ecfe0..d1eba8bfb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java @@ -83,7 +83,7 @@ public FlowActionJsonSerializeJsonParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJson && equalTo((FlowActionJsonSerializeJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonSerializeJson other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJsonSerializeJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonSerializeJson other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonSerializeJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJsonSerializeJson build() { return new FlowActionJsonSerializeJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java index 2bea64bc7..89d3e7f68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java @@ -34,7 +34,7 @@ public FlowActionJsonSerializeJsonParamsObject getObject() { return object; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJsonParams && equalTo((FlowActionJsonSerializeJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionJsonSerializeJsonParams other) { return object.equals(other.object); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.object); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ObjectStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJsonSerializeJsonParams other) { object(other.getObject()); return this; } - @java.lang.Override + @Override @JsonSetter("object") public _FinalStage object(@NotNull FlowActionJsonSerializeJsonParamsObject object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } - @java.lang.Override + @Override public FlowActionJsonSerializeJsonParams build() { return new FlowActionJsonSerializeJsonParams(object, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java index 9c541d00d..2b01d91e9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJsonParamsObject @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionJsonSerializeJsonParamsObject other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwt && equalTo((FlowActionJwt) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionJwt other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionJwt.class); } - @java.lang.Override + @Override public FlowActionJwt deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java index 38f602e1a..01a8cf2d3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtDecodeJwtParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtDecodeJwt && equalTo((FlowActionJwtDecodeJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtDecodeJwt other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtDecodeJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtDecodeJwt other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtDecodeJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJwtDecodeJwt build() { return new FlowActionJwtDecodeJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java index 22f6e8c87..a15d852b8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java @@ -33,7 +33,7 @@ public String getToken() { return token; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtDecodeJwtParams && equalTo((FlowActionJwtDecodeJwtParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionJwtDecodeJwtParams other) { return token.equals(other.token); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.token); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TokenStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtDecodeJwtParams other) { token(other.getToken()); return this; } - @java.lang.Override + @Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @java.lang.Override + @Override public FlowActionJwtDecodeJwtParams build() { return new FlowActionJwtDecodeJwtParams(token, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java index 632957aa5..9bec36b0e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtSignJwtParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtSignJwt && equalTo((FlowActionJwtSignJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtSignJwt other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtSignJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtSignJwt other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtSignJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJwtSignJwt build() { return new FlowActionJwtSignJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java index 5ad501846..8c054f8d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java @@ -82,7 +82,7 @@ public Optional getExpiresIn() { return expiresIn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtSignJwtParams && equalTo((FlowActionJwtSignJwtParams) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtSignJwtParams other) { && expiresIn.equals(other.expiresIn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.payload, this.subject, this.issuer, this.audience, this.expiresIn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -165,7 +165,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtSignJwtParams other) { connectionId(other.getConnectionId()); payload(other.getPayload()); @@ -176,79 +176,79 @@ public Builder from(FlowActionJwtSignJwtParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage expiresIn(String expiresIn) { this.expiresIn = Optional.ofNullable(expiresIn); return this; } - @java.lang.Override + @Override @JsonSetter(value = "expires_in", nulls = Nulls.SKIP) public _FinalStage expiresIn(Optional expiresIn) { this.expiresIn = expiresIn; return this; } - @java.lang.Override + @Override public _FinalStage audience(String audience) { this.audience = Optional.ofNullable(audience); return this; } - @java.lang.Override + @Override @JsonSetter(value = "audience", nulls = Nulls.SKIP) public _FinalStage audience(Optional audience) { this.audience = audience; return this; } - @java.lang.Override + @Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @java.lang.Override + @Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = Optional.ofNullable(subject); return this; } - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(Optional subject) { this.subject = subject; return this; } - @java.lang.Override + @Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @java.lang.Override + @Override public FlowActionJwtSignJwtParams build() { return new FlowActionJwtSignJwtParams( connectionId, payload, subject, issuer, audience, expiresIn, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java index 85e31f3db..a7e7c5270 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtVerifyJwtParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtVerifyJwt && equalTo((FlowActionJwtVerifyJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtVerifyJwt other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtVerifyJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtVerifyJwt other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtVerifyJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionJwtVerifyJwt build() { return new FlowActionJwtVerifyJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java index 07475c20d..0e5766a0c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java @@ -64,7 +64,7 @@ public Optional getIssuer() { return issuer; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtVerifyJwtParams && equalTo((FlowActionJwtVerifyJwtParams) other); @@ -82,12 +82,12 @@ private boolean equalTo(FlowActionJwtVerifyJwtParams other) { && issuer.equals(other.issuer); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.token, this.audience, this.issuer); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements ConnectionIdStage, TokenStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionJwtVerifyJwtParams other) { connectionId(other.getConnectionId()); token(other.getToken()); @@ -142,47 +142,47 @@ public Builder from(FlowActionJwtVerifyJwtParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public TokenStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @java.lang.Override + @Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @java.lang.Override + @Override public _FinalStage audience(String audience) { this.audience = Optional.ofNullable(audience); return this; } - @java.lang.Override + @Override @JsonSetter(value = "audience", nulls = Nulls.SKIP) public _FinalStage audience(Optional audience) { this.audience = audience; return this; } - @java.lang.Override + @Override public FlowActionJwtVerifyJwtParams build() { return new FlowActionJwtVerifyJwtParams(connectionId, token, audience, issuer, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java index bce1f293c..64d1e8e13 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java @@ -83,7 +83,7 @@ public FlowActionMailchimpUpsertMemberParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMember && equalTo((FlowActionMailchimpUpsertMember) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMember other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionMailchimpUpsertMember other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionMailchimpUpsertMember other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionMailchimpUpsertMemberParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionMailchimpUpsertMember build() { return new FlowActionMailchimpUpsertMember( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java index c4bc155d1..a65a69234 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java @@ -53,7 +53,7 @@ public FlowActionMailchimpUpsertMemberParamsMember getMember() { return member; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMemberParams @@ -69,12 +69,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMemberParams other) { return connectionId.equals(other.connectionId) && listId.equals(other.listId) && member.equals(other.member); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.listId, this.member); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -114,7 +114,7 @@ public static final class Builder implements ConnectionIdStage, ListIdStage, Mem private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionMailchimpUpsertMemberParams other) { connectionId(other.getConnectionId()); listId(other.getListId()); @@ -122,28 +122,28 @@ public Builder from(FlowActionMailchimpUpsertMemberParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public ListIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("list_id") public MemberStage listId(@NotNull String listId) { this.listId = Objects.requireNonNull(listId, "listId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("member") public _FinalStage member(@NotNull FlowActionMailchimpUpsertMemberParamsMember member) { this.member = Objects.requireNonNull(member, "member must not be null"); return this; } - @java.lang.Override + @Override public FlowActionMailchimpUpsertMemberParams build() { return new FlowActionMailchimpUpsertMemberParams(connectionId, listId, member, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java index e69b9a8de..0e7958dcd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java @@ -55,7 +55,7 @@ public Optional> getMergeFields() { return mergeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMemberParamsMember @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMemberParamsMember other) { && mergeFields.equals(other.mergeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.emailAddress, this.statusIfNew, this.mergeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements EmailAddressStage, StatusIfNewStage private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionMailchimpUpsertMemberParamsMember other) { emailAddress(other.getEmailAddress()); statusIfNew(other.getStatusIfNew()); @@ -126,34 +126,34 @@ public Builder from(FlowActionMailchimpUpsertMemberParamsMember other) { return this; } - @java.lang.Override + @Override @JsonSetter("email_address") public StatusIfNewStage emailAddress(@NotNull String emailAddress) { this.emailAddress = Objects.requireNonNull(emailAddress, "emailAddress must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("status_if_new") public _FinalStage statusIfNew(@NotNull String statusIfNew) { this.statusIfNew = Objects.requireNonNull(statusIfNew, "statusIfNew must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage mergeFields(Map mergeFields) { this.mergeFields = Optional.ofNullable(mergeFields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "merge_fields", nulls = Nulls.SKIP) public _FinalStage mergeFields(Optional> mergeFields) { this.mergeFields = mergeFields; return this; } - @java.lang.Override + @Override public FlowActionMailchimpUpsertMemberParamsMember build() { return new FlowActionMailchimpUpsertMemberParamsMember( emailAddress, statusIfNew, mergeFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java index 9c0a997bd..fc83af473 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java @@ -83,7 +83,7 @@ public FlowActionMailjetSendEmailParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmail && equalTo((FlowActionMailjetSendEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionMailjetSendEmail other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionMailjetSendEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionMailjetSendEmail other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionMailjetSendEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionMailjetSendEmail build() { return new FlowActionMailjetSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java index 405efb196..050c95af5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmailParams && equalTo((FlowActionMailjetSendEmailParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionMailjetSendEmailParams other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer> getVariables() { return variables; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmailParamsTemplateId @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionMailjetSendEmailParamsTemplateId other) { return templateId == other.templateId && variables.equals(other.variables); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.templateId, this.variables); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements TemplateIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionMailjetSendEmailParamsTemplateId other) { templateId(other.getTemplateId()); variables(other.getVariables()); return this; } - @java.lang.Override + @Override @JsonSetter("template_id") public _FinalStage templateId(int templateId) { this.templateId = templateId; return this; } - @java.lang.Override + @Override public _FinalStage variables(Map variables) { this.variables = Optional.ofNullable(variables); return this; } - @java.lang.Override + @Override @JsonSetter(value = "variables", nulls = Nulls.SKIP) public _FinalStage variables(Optional> variables) { this.variables = variables; return this; } - @java.lang.Override + @Override public FlowActionMailjetSendEmailParamsTemplateId build() { return new FlowActionMailjetSendEmailParamsTemplateId(templateId, variables, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java index 11e628e90..16621e91f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtp && equalTo((FlowActionOtp) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionOtp other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionOtp.class); } - @java.lang.Override + @Override public FlowActionOtp deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java index f147bd7cc..c6809d0b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java @@ -83,7 +83,7 @@ public FlowActionOtpGenerateCodeParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpGenerateCode && equalTo((FlowActionOtpGenerateCode) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionOtpGenerateCode other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionOtpGenerateCode other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionOtpGenerateCode other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionOtpGenerateCodeParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionOtpGenerateCode build() { return new FlowActionOtpGenerateCode(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java index dde8d51e0..f9accf1d3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java @@ -41,7 +41,7 @@ public int getLength() { return length; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpGenerateCodeParams && equalTo((FlowActionOtpGenerateCodeParams) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionOtpGenerateCodeParams other) { return reference.equals(other.reference) && length == other.length; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.reference, this.length); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ReferenceStage, LengthStage, _Final private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionOtpGenerateCodeParams other) { reference(other.getReference()); length(other.getLength()); return this; } - @java.lang.Override + @Override @JsonSetter("reference") public LengthStage reference(@NotNull String reference) { this.reference = Objects.requireNonNull(reference, "reference must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("length") public _FinalStage length(int length) { this.length = length; return this; } - @java.lang.Override + @Override public FlowActionOtpGenerateCodeParams build() { return new FlowActionOtpGenerateCodeParams(reference, length, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java index 5582a1ccd..72d77a600 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java @@ -83,7 +83,7 @@ public FlowActionOtpVerifyCodeParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCode && equalTo((FlowActionOtpVerifyCode) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionOtpVerifyCode other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionOtpVerifyCode other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionOtpVerifyCode other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionOtpVerifyCodeParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionOtpVerifyCode build() { return new FlowActionOtpVerifyCode(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java index c1640f8df..d10a1beb7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java @@ -42,7 +42,7 @@ public FlowActionOtpVerifyCodeParamsCode getCode() { return code; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCodeParams && equalTo((FlowActionOtpVerifyCodeParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionOtpVerifyCodeParams other) { return reference.equals(other.reference) && code.equals(other.code); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.reference, this.code); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ReferenceStage, CodeStage, _FinalSt private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionOtpVerifyCodeParams other) { reference(other.getReference()); code(other.getCode()); return this; } - @java.lang.Override + @Override @JsonSetter("reference") public CodeStage reference(@NotNull String reference) { this.reference = Objects.requireNonNull(reference, "reference must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("code") public _FinalStage code(@NotNull FlowActionOtpVerifyCodeParamsCode code) { this.code = Objects.requireNonNull(code, "code must not be null"); return this; } - @java.lang.Override + @Override public FlowActionOtpVerifyCodeParams build() { return new FlowActionOtpVerifyCodeParams(reference, code, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java index 2f215ddef..b4403f823 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCodeParamsCode && equalTo((FlowActionOtpVerifyCodeParamsCode) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionOtpVerifyCodeParamsCode other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedrive && equalTo((FlowActionPipedrive) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionPipedrive other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionPipedrive.class); } - @java.lang.Override + @Override public FlowActionPipedrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java index 9d561c2e5..ff572dae7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java @@ -83,7 +83,7 @@ public FlowActionPipedriveAddDealParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDeal && equalTo((FlowActionPipedriveAddDeal) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionPipedriveAddDeal other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionPipedriveAddDeal other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionPipedriveAddDeal other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionPipedriveAddDealParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddDeal build() { return new FlowActionPipedriveAddDeal(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java index 86d44f911..242e92dce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java @@ -100,7 +100,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParams && equalTo((FlowActionPipedriveAddDealParams) other); @@ -122,7 +122,7 @@ private boolean equalTo(FlowActionPipedriveAddDealParams other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -135,7 +135,7 @@ public int hashCode() { this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -205,7 +205,7 @@ public static final class Builder implements ConnectionIdStage, TitleStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionPipedriveAddDealParams other) { connectionId(other.getConnectionId()); title(other.getTitle()); @@ -218,99 +218,99 @@ public Builder from(FlowActionPipedriveAddDealParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public TitleStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("title") public _FinalStage title(@NotNull String title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public _FinalStage stageId(FlowActionPipedriveAddDealParamsStageId stageId) { this.stageId = Optional.ofNullable(stageId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "stage_id", nulls = Nulls.SKIP) public _FinalStage stageId(Optional stageId) { this.stageId = stageId; return this; } - @java.lang.Override + @Override public _FinalStage organizationId(FlowActionPipedriveAddDealParamsOrganizationId organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @java.lang.Override + @Override public _FinalStage personId(FlowActionPipedriveAddDealParamsPersonId personId) { this.personId = Optional.ofNullable(personId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "person_id", nulls = Nulls.SKIP) public _FinalStage personId(Optional personId) { this.personId = personId; return this; } - @java.lang.Override + @Override public _FinalStage userId(FlowActionPipedriveAddDealParamsUserId userId) { this.userId = Optional.ofNullable(userId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "user_id", nulls = Nulls.SKIP) public _FinalStage userId(Optional userId) { this.userId = userId; return this; } - @java.lang.Override + @Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @java.lang.Override + @Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddDealParams build() { return new FlowActionPipedriveAddDealParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java index a54e34bdd..f6d6e820a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsOrganizationId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsOrganizationId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsPersonId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsPersonId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsStageId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsStageId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsUserId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsUserId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddOrganization build() { return new FlowActionPipedriveAddOrganization( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java index cd4e79869..61177fb66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java @@ -64,7 +64,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddOrganizationParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionPipedriveAddOrganizationParams other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.name, this.ownerId, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, NameStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionPipedriveAddOrganizationParams other) { connectionId(other.getConnectionId()); name(other.getName()); @@ -143,47 +143,47 @@ public Builder from(FlowActionPipedriveAddOrganizationParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public NameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public _FinalStage ownerId(FlowActionPipedriveAddOrganizationParamsOwnerId ownerId) { this.ownerId = Optional.ofNullable(ownerId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) public _FinalStage ownerId(Optional ownerId) { this.ownerId = ownerId; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddOrganizationParams build() { return new FlowActionPipedriveAddOrganizationParams( connectionId, name, ownerId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java index b194e4aef..db3360f8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddOrganizationParamsOwnerId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddOrganizationParamsOwnerId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddPerson build() { return new FlowActionPipedriveAddPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java index 27226c9ca..5e2488775 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java @@ -91,7 +91,7 @@ public Optional> getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParams @@ -113,13 +113,13 @@ private boolean equalTo(FlowActionPipedriveAddPersonParams other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, this.name, this.email, this.phone, this.ownerId, this.organizationId, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -183,7 +183,7 @@ public static final class Builder implements ConnectionIdStage, NameStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionPipedriveAddPersonParams other) { connectionId(other.getConnectionId()); name(other.getName()); @@ -195,86 +195,86 @@ public Builder from(FlowActionPipedriveAddPersonParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public NameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public _FinalStage organizationId(FlowActionPipedriveAddPersonParamsOrganizationId organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @java.lang.Override + @Override public _FinalStage ownerId(FlowActionPipedriveAddPersonParamsOwnerId ownerId) { this.ownerId = Optional.ofNullable(ownerId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) public _FinalStage ownerId(Optional ownerId) { this.ownerId = ownerId; return this; } - @java.lang.Override + @Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @java.lang.Override + @Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public FlowActionPipedriveAddPersonParams build() { return new FlowActionPipedriveAddPersonParams( connectionId, name, email, phone, ownerId, organizationId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java index 2a6aae3b7..9c9723da0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParamsOrganizationId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddPersonParamsOrganizationId other) return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParamsOwnerId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddPersonParamsOwnerId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforce && equalTo((FlowActionSalesforce) other); @@ -53,12 +53,12 @@ private boolean equalTo(FlowActionSalesforce other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -94,7 +94,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionSalesforce.class); } - @java.lang.Override + @Override public FlowActionSalesforce deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java index 72fa7df7a..d8dac2a6a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceCreateLeadParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceCreateLead && equalTo((FlowActionSalesforceCreateLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceCreateLead other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceCreateLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceCreateLead other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceCreateLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSalesforceCreateLead build() { return new FlowActionSalesforceCreateLead( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java index 65a1ab1e4..a96ba12f4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java @@ -91,7 +91,7 @@ public Optional> getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceCreateLeadParams @@ -113,13 +113,13 @@ private boolean equalTo(FlowActionSalesforceCreateLeadParams other) { && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, this.firstName, this.lastName, this.company, this.email, this.phone, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -183,7 +183,7 @@ public static final class Builder implements ConnectionIdStage, LastNameStage, C private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceCreateLeadParams other) { connectionId(other.getConnectionId()); firstName(other.getFirstName()); @@ -195,80 +195,80 @@ public Builder from(FlowActionSalesforceCreateLeadParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public LastNameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("last_name") public CompanyStage lastName(@NotNull String lastName) { this.lastName = Objects.requireNonNull(lastName, "lastName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("company") public _FinalStage company(@NotNull String company) { this.company = Objects.requireNonNull(company, "company must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @java.lang.Override + @Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @java.lang.Override + @Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public _FinalStage firstName(String firstName) { this.firstName = Optional.ofNullable(firstName); return this; } - @java.lang.Override + @Override @JsonSetter(value = "first_name", nulls = Nulls.SKIP) public _FinalStage firstName(Optional firstName) { this.firstName = firstName; return this; } - @java.lang.Override + @Override public FlowActionSalesforceCreateLeadParams build() { return new FlowActionSalesforceCreateLeadParams( connectionId, firstName, lastName, company, email, phone, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java index c2d1c8a14..76dc21f1c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceGetLeadParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceGetLead && equalTo((FlowActionSalesforceGetLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceGetLead other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceGetLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceGetLead other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceGetLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSalesforceGetLead build() { return new FlowActionSalesforceGetLead(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java index e6cd077ff..19e0caa4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java @@ -42,7 +42,7 @@ public String getLeadId() { return leadId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceGetLeadParams && equalTo((FlowActionSalesforceGetLeadParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionSalesforceGetLeadParams other) { return connectionId.equals(other.connectionId) && leadId.equals(other.leadId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.leadId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, LeadIdStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceGetLeadParams other) { connectionId(other.getConnectionId()); leadId(other.getLeadId()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public LeadIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("lead_id") public _FinalStage leadId(@NotNull String leadId) { this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); return this; } - @java.lang.Override + @Override public FlowActionSalesforceGetLeadParams build() { return new FlowActionSalesforceGetLeadParams(connectionId, leadId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java index 76a9ea2b5..ac6cb456d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java @@ -83,7 +83,7 @@ public FlowActionSalesforceSearchLeadsParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceSearchLeads && equalTo((FlowActionSalesforceSearchLeads) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceSearchLeads other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceSearchLeads other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceSearchLeads other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceSearchLeadsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSalesforceSearchLeads build() { return new FlowActionSalesforceSearchLeads( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java index aedef7c4f..66f311f4a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java @@ -65,7 +65,7 @@ public List getLeadFields() { return leadFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceSearchLeadsParams @@ -84,12 +84,12 @@ private boolean equalTo(FlowActionSalesforceSearchLeadsParams other) { && leadFields.equals(other.leadFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.searchField, this.searchValue, this.leadFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -137,7 +137,7 @@ public static final class Builder implements ConnectionIdStage, SearchFieldStage private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceSearchLeadsParams other) { connectionId(other.getConnectionId()); searchField(other.getSearchField()); @@ -146,28 +146,28 @@ public Builder from(FlowActionSalesforceSearchLeadsParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public SearchFieldStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("search_field") public SearchValueStage searchField(@NotNull FlowActionSalesforceSearchLeadsParamsSearchField searchField) { this.searchField = Objects.requireNonNull(searchField, "searchField must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("search_value") public _FinalStage searchValue(@NotNull String searchValue) { this.searchValue = Objects.requireNonNull(searchValue, "searchValue must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage addAllLeadFields(List leadFields) { if (leadFields != null) { this.leadFields.addAll(leadFields); @@ -175,13 +175,13 @@ public _FinalStage addAllLeadFields(List leadFields) { return this; } - @java.lang.Override + @Override public _FinalStage addLeadFields(String leadFields) { this.leadFields.add(leadFields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "lead_fields", nulls = Nulls.SKIP) public _FinalStage leadFields(List leadFields) { this.leadFields.clear(); @@ -191,7 +191,7 @@ public _FinalStage leadFields(List leadFields) { return this; } - @java.lang.Override + @Override public FlowActionSalesforceSearchLeadsParams build() { return new FlowActionSalesforceSearchLeadsParams( connectionId, searchField, searchValue, leadFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java index e0a4c7c75..ae94d7d48 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionSalesforceSearchLeadsParamsSearchField && this.string.equals(((FlowActionSalesforceSearchLeadsParamsSearchField) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java index e1a6bca9a..da08ade4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceUpdateLeadParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceUpdateLead && equalTo((FlowActionSalesforceUpdateLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceUpdateLead other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceUpdateLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceUpdateLead other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceUpdateLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSalesforceUpdateLead build() { return new FlowActionSalesforceUpdateLead( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java index 1cbcaf10a..ba9b61460 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java @@ -55,7 +55,7 @@ public Optional> getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceUpdateLeadParams @@ -71,12 +71,12 @@ private boolean equalTo(FlowActionSalesforceUpdateLeadParams other) { return connectionId.equals(other.connectionId) && leadId.equals(other.leadId) && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.leadId, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +116,7 @@ public static final class Builder implements ConnectionIdStage, LeadIdStage, _Fi private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSalesforceUpdateLeadParams other) { connectionId(other.getConnectionId()); leadId(other.getLeadId()); @@ -124,34 +124,34 @@ public Builder from(FlowActionSalesforceUpdateLeadParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public LeadIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("lead_id") public _FinalStage leadId(@NotNull String leadId) { this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @java.lang.Override + @Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @java.lang.Override + @Override public FlowActionSalesforceUpdateLeadParams build() { return new FlowActionSalesforceUpdateLeadParams(connectionId, leadId, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java index 742b08315..90d4bb5b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java @@ -83,7 +83,7 @@ public FlowActionSendgridSendEmailParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmail && equalTo((FlowActionSendgridSendEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSendgridSendEmail other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSendgridSendEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSendgridSendEmail other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSendgridSendEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSendgridSendEmail build() { return new FlowActionSendgridSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java index 6fed0ff60..8e34bc8d8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java @@ -56,7 +56,7 @@ public List getPersonalizations() { return personalizations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmailParams && equalTo((FlowActionSendgridSendEmailParams) other); @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionSendgridSendEmailParams other) { && personalizations.equals(other.personalizations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.personalizations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSendgridSendEmailParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -128,21 +128,21 @@ public Builder from(FlowActionSendgridSendEmailParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("from") public _FinalStage from(@NotNull FlowActionSendgridSendEmailParamsPerson from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage addAllPersonalizations(List personalizations) { if (personalizations != null) { this.personalizations.addAll(personalizations); @@ -150,13 +150,13 @@ public _FinalStage addAllPersonalizations(List personalizations) { return this; } - @java.lang.Override + @Override public _FinalStage addPersonalizations(Object personalizations) { this.personalizations.add(personalizations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "personalizations", nulls = Nulls.SKIP) public _FinalStage personalizations(List personalizations) { this.personalizations.clear(); @@ -166,7 +166,7 @@ public _FinalStage personalizations(List personalizations) { return this; } - @java.lang.Override + @Override public FlowActionSendgridSendEmailParams build() { return new FlowActionSendgridSendEmailParams(connectionId, from, personalizations, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java index 17c898bcd..20535cbb1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java @@ -44,7 +44,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmailParamsPerson @@ -60,12 +60,12 @@ private boolean equalTo(FlowActionSendgridSendEmailParamsPerson other) { return name.equals(other.name) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,34 +99,34 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSendgridSendEmailParamsPerson other) { name(other.getName()); email(other.getEmail()); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public FlowActionSendgridSendEmailParamsPerson build() { return new FlowActionSendgridSendEmailParamsPerson(name, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java index ef3240398..b0772e875 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java @@ -83,7 +83,7 @@ public FlowActionSlackPostMessageParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessage && equalTo((FlowActionSlackPostMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSlackPostMessage other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSlackPostMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSlackPostMessage other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSlackPostMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionSlackPostMessage build() { return new FlowActionSlackPostMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java index 06aa70c05..421741cfb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java @@ -56,7 +56,7 @@ public Optional> getAttachments return attachments; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParams && equalTo((FlowActionSlackPostMessageParams) other); @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionSlackPostMessageParams other) { && attachments.equals(other.attachments); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.text, this.attachments); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSlackPostMessageParams other) { connectionId(other.getConnectionId()); text(other.getText()); @@ -126,40 +126,40 @@ public Builder from(FlowActionSlackPostMessageParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage attachments(List attachments) { this.attachments = Optional.ofNullable(attachments); return this; } - @java.lang.Override + @Override @JsonSetter(value = "attachments", nulls = Nulls.SKIP) public _FinalStage attachments(Optional> attachments) { this.attachments = attachments; return this; } - @java.lang.Override + @Override public _FinalStage text(String text) { this.text = Optional.ofNullable(text); return this; } - @java.lang.Override + @Override @JsonSetter(value = "text", nulls = Nulls.SKIP) public _FinalStage text(Optional text) { this.text = text; return this; } - @java.lang.Override + @Override public FlowActionSlackPostMessageParams build() { return new FlowActionSlackPostMessageParams(connectionId, text, attachments, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java index ab9ae9bad..ba6b1db31 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java @@ -64,7 +64,7 @@ public Optional> getFields return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParamsAttachment @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionSlackPostMessageParamsAttachment other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.color, this.pretext, this.text, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java index 842a7764b..a6d66b3dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionSlackPostMessageParamsAttachmentColor && this.string.equals(((FlowActionSlackPostMessageParamsAttachmentColor) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java index 51cacf5ef..213fb5ab9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java @@ -52,7 +52,7 @@ public Optional getShort() { return short_; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParamsAttachmentField @@ -68,12 +68,12 @@ private boolean equalTo(FlowActionSlackPostMessageParamsAttachmentField other) { return title.equals(other.title) && value.equals(other.value) && short_.equals(other.short_); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.title, this.value, this.short_); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -113,7 +113,7 @@ public static final class Builder implements TitleStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionSlackPostMessageParamsAttachmentField other) { title(other.getTitle()); value(other.getValue()); @@ -121,40 +121,40 @@ public Builder from(FlowActionSlackPostMessageParamsAttachmentField other) { return this; } - @java.lang.Override + @Override @JsonSetter("title") public _FinalStage title(@NotNull String title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage short_(Boolean short_) { this.short_ = Optional.ofNullable(short_); return this; } - @java.lang.Override + @Override @JsonSetter(value = "short", nulls = Nulls.SKIP) public _FinalStage short_(Optional short_) { this.short_ = short_; return this; } - @java.lang.Override + @Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @java.lang.Override + @Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @java.lang.Override + @Override public FlowActionSlackPostMessageParamsAttachmentField build() { return new FlowActionSlackPostMessageParamsAttachmentField(title, value, short_, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java index 6496bccf0..ca67a0aa2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java @@ -49,7 +49,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripe && equalTo((FlowActionStripe) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionStripe other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -118,7 +118,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionStripe.class); } - @java.lang.Override + @Override public FlowActionStripe deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java index f98da2789..05fa311b2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java @@ -83,7 +83,7 @@ public FlowActionStripeAddTaxIdParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddTaxId && equalTo((FlowActionStripeAddTaxId) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeAddTaxId other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeAddTaxId other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeAddTaxId other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeAddTaxIdParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeAddTaxId build() { return new FlowActionStripeAddTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java index dd86ca001..37d410d93 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java @@ -62,7 +62,7 @@ public String getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddTaxIdParams && equalTo((FlowActionStripeAddTaxIdParams) other); @@ -80,12 +80,12 @@ private boolean equalTo(FlowActionStripeAddTaxIdParams other) { && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.type, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +132,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeAddTaxIdParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -141,35 +141,35 @@ public Builder from(FlowActionStripeAddTaxIdParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("customer_id") public TypeStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override public FlowActionStripeAddTaxIdParams build() { return new FlowActionStripeAddTaxIdParams(connectionId, customerId, type, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java index f4eabdc3b..9c413d927 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java @@ -81,7 +81,7 @@ public Optional getCountry() { return country; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddress && equalTo((FlowActionStripeAddress) other); @@ -101,12 +101,12 @@ private boolean equalTo(FlowActionStripeAddress other) { && country.equals(other.country); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.line1, this.line2, this.postalCode, this.city, this.state, this.country); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java index 4249a817e..6161b948e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeCreateCustomerParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreateCustomer && equalTo((FlowActionStripeCreateCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeCreateCustomer other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeCreateCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeCreateCustomer other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeCreateCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeCreateCustomer build() { return new FlowActionStripeCreateCustomer( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java index cf31e6686..5edc54066 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java @@ -37,7 +37,7 @@ public final class FlowActionStripeCreateCustomerParams { private final Optional address; - private final Optional> metadata; + private final Optional> metadata; private final Map additionalProperties; @@ -50,7 +50,7 @@ private FlowActionStripeCreateCustomerParams( Optional phone, Optional taxExempt, Optional address, - Optional> metadata, + Optional> metadata, Map additionalProperties) { this.connectionId = connectionId; this.taxId = taxId; @@ -105,11 +105,11 @@ public Optional getAddress() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional> getMetadata() { return metadata; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreateCustomerParams @@ -133,7 +133,7 @@ private boolean equalTo(FlowActionStripeCreateCustomerParams other) { && metadata.equals(other.metadata); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -147,7 +147,7 @@ public int hashCode() { this.metadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -193,16 +193,16 @@ public interface _FinalStage { _FinalStage address(FlowActionStripeAddress address); - _FinalStage metadata(Optional> metadata); + _FinalStage metadata(Optional> metadata); - _FinalStage metadata(Map metadata); + _FinalStage metadata(Map metadata); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ConnectionIdStage, _FinalStage { private String connectionId; - private Optional> metadata = Optional.empty(); + private Optional> metadata = Optional.empty(); private Optional address = Optional.empty(); @@ -223,7 +223,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeCreateCustomerParams other) { connectionId(other.getConnectionId()); taxId(other.getTaxId()); @@ -237,118 +237,118 @@ public Builder from(FlowActionStripeCreateCustomerParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override - public _FinalStage metadata(Map metadata) { + @Override + public _FinalStage metadata(Map metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional> metadata) { + public _FinalStage metadata(Optional> metadata) { this.metadata = metadata; return this; } - @java.lang.Override + @Override public _FinalStage address(FlowActionStripeAddress address) { this.address = Optional.ofNullable(address); return this; } - @java.lang.Override + @Override @JsonSetter(value = "address", nulls = Nulls.SKIP) public _FinalStage address(Optional address) { this.address = address; return this; } - @java.lang.Override + @Override public _FinalStage taxExempt(String taxExempt) { this.taxExempt = Optional.ofNullable(taxExempt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) public _FinalStage taxExempt(Optional taxExempt) { this.taxExempt = taxExempt; return this; } - @java.lang.Override + @Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @java.lang.Override + @Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; } - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public _FinalStage taxId(FlowActionStripeTaxId taxId) { this.taxId = Optional.ofNullable(taxId); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tax_id", nulls = Nulls.SKIP) public _FinalStage taxId(Optional taxId) { this.taxId = taxId; return this; } - @java.lang.Override + @Override public FlowActionStripeCreateCustomerParams build() { return new FlowActionStripeCreateCustomerParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java index 2ec512cc1..4d8263dc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java @@ -83,7 +83,7 @@ public FlowActionStripeCreatePortalSessionParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreatePortalSession @@ -103,12 +103,12 @@ private boolean equalTo(FlowActionStripeCreatePortalSession other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeCreatePortalSession other) { id(other.getId()); alias(other.getAlias()); @@ -170,60 +170,60 @@ public Builder from(FlowActionStripeCreatePortalSession other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeCreatePortalSessionParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeCreatePortalSession build() { return new FlowActionStripeCreatePortalSession( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java index 77748d777..c1402a9bc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java @@ -55,7 +55,7 @@ public Optional getReturnUrl() { return returnUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreatePortalSessionParams @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionStripeCreatePortalSessionParams other) { && returnUrl.equals(other.returnUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.returnUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements ConnectionIdStage, CustomerIdStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeCreatePortalSessionParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -126,34 +126,34 @@ public Builder from(FlowActionStripeCreatePortalSessionParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("customer_id") public _FinalStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage returnUrl(String returnUrl) { this.returnUrl = Optional.ofNullable(returnUrl); return this; } - @java.lang.Override + @Override @JsonSetter(value = "return_url", nulls = Nulls.SKIP) public _FinalStage returnUrl(Optional returnUrl) { this.returnUrl = returnUrl; return this; } - @java.lang.Override + @Override public FlowActionStripeCreatePortalSessionParams build() { return new FlowActionStripeCreatePortalSessionParams( connectionId, customerId, returnUrl, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java index a7b0ad519..22dfb10b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java @@ -83,7 +83,7 @@ public FlowActionStripeDeleteTaxIdParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeDeleteTaxId && equalTo((FlowActionStripeDeleteTaxId) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeDeleteTaxId other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeDeleteTaxId other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeDeleteTaxId other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeDeleteTaxIdParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeDeleteTaxId build() { return new FlowActionStripeDeleteTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java index f180442cf..db40599d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java @@ -50,7 +50,7 @@ public String getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeDeleteTaxIdParams && equalTo((FlowActionStripeDeleteTaxIdParams) other); @@ -65,12 +65,12 @@ private boolean equalTo(FlowActionStripeDeleteTaxIdParams other) { return connectionId.equals(other.connectionId) && customerId.equals(other.customerId) && id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements ConnectionIdStage, CustomerIdStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeDeleteTaxIdParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -118,28 +118,28 @@ public Builder from(FlowActionStripeDeleteTaxIdParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("customer_id") public IdStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public FlowActionStripeDeleteTaxIdParams build() { return new FlowActionStripeDeleteTaxIdParams(connectionId, customerId, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java index 7012c5db5..77db9b3da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java @@ -83,7 +83,7 @@ public FlowActionStripeFindCustomersParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeFindCustomers && equalTo((FlowActionStripeFindCustomers) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeFindCustomers other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeFindCustomers other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeFindCustomers other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeFindCustomersParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeFindCustomers build() { return new FlowActionStripeFindCustomers(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java index 3d72d5a63..4220b498c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeFindCustomersParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionStripeFindCustomersParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeFindCustomersParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public FlowActionStripeFindCustomersParams build() { return new FlowActionStripeFindCustomersParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java index 2d6edbdf1..3aa2c1341 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeGetCustomerParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeGetCustomer && equalTo((FlowActionStripeGetCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeGetCustomer other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeGetCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeGetCustomer other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeGetCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeGetCustomer build() { return new FlowActionStripeGetCustomer(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java index 0964cf72c..3c479c07c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java @@ -42,7 +42,7 @@ public String getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeGetCustomerParams && equalTo((FlowActionStripeGetCustomerParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionStripeGetCustomerParams other) { return connectionId.equals(other.connectionId) && id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, IdStage, _FinalS private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeGetCustomerParams other) { connectionId(other.getConnectionId()); id(other.getId()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public IdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public FlowActionStripeGetCustomerParams build() { return new FlowActionStripeGetCustomerParams(connectionId, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java index 195ec6824..63b4f3b36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java @@ -41,7 +41,7 @@ public String getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeTaxId && equalTo((FlowActionStripeTaxId) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionStripeTaxId other) { return type.equals(other.type) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements TypeStage, ValueStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeTaxId other) { type(other.getType()); value(other.getValue()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override public FlowActionStripeTaxId build() { return new FlowActionStripeTaxId(type, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java index c05a51589..443c843b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeUpdateCustomerParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeUpdateCustomer && equalTo((FlowActionStripeUpdateCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeUpdateCustomer other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeUpdateCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeUpdateCustomer other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeUpdateCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionStripeUpdateCustomer build() { return new FlowActionStripeUpdateCustomer( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java index 860f52795..1abbb5180 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java @@ -37,7 +37,7 @@ public final class FlowActionStripeUpdateCustomerParams { private final Optional address; - private final Optional> metadata; + private final Optional> metadata; private final Map additionalProperties; @@ -50,7 +50,7 @@ private FlowActionStripeUpdateCustomerParams( Optional phone, Optional taxExempt, Optional address, - Optional> metadata, + Optional> metadata, Map additionalProperties) { this.connectionId = connectionId; this.id = id; @@ -105,11 +105,11 @@ public Optional getAddress() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional> getMetadata() { return metadata; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeUpdateCustomerParams @@ -133,7 +133,7 @@ private boolean equalTo(FlowActionStripeUpdateCustomerParams other) { && metadata.equals(other.metadata); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -147,7 +147,7 @@ public int hashCode() { this.metadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -193,9 +193,9 @@ public interface _FinalStage { _FinalStage address(FlowActionStripeAddress address); - _FinalStage metadata(Optional> metadata); + _FinalStage metadata(Optional> metadata); - _FinalStage metadata(Map metadata); + _FinalStage metadata(Map metadata); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -204,7 +204,7 @@ public static final class Builder implements ConnectionIdStage, IdStage, _FinalS private String id; - private Optional> metadata = Optional.empty(); + private Optional> metadata = Optional.empty(); private Optional address = Optional.empty(); @@ -223,7 +223,7 @@ public static final class Builder implements ConnectionIdStage, IdStage, _FinalS private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionStripeUpdateCustomerParams other) { connectionId(other.getConnectionId()); id(other.getId()); @@ -237,112 +237,112 @@ public Builder from(FlowActionStripeUpdateCustomerParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public IdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override - public _FinalStage metadata(Map metadata) { + @Override + public _FinalStage metadata(Map metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional> metadata) { + public _FinalStage metadata(Optional> metadata) { this.metadata = metadata; return this; } - @java.lang.Override + @Override public _FinalStage address(FlowActionStripeAddress address) { this.address = Optional.ofNullable(address); return this; } - @java.lang.Override + @Override @JsonSetter(value = "address", nulls = Nulls.SKIP) public _FinalStage address(Optional address) { this.address = address; return this; } - @java.lang.Override + @Override public _FinalStage taxExempt(String taxExempt) { this.taxExempt = Optional.ofNullable(taxExempt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) public _FinalStage taxExempt(Optional taxExempt) { this.taxExempt = taxExempt; return this; } - @java.lang.Override + @Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @java.lang.Override + @Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; } - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public FlowActionStripeUpdateCustomerParams build() { return new FlowActionStripeUpdateCustomerParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java index 6d0962853..da164f53d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java @@ -83,7 +83,7 @@ public FlowActionTelegramSendMessageParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTelegramSendMessage && equalTo((FlowActionTelegramSendMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTelegramSendMessage other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTelegramSendMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTelegramSendMessage other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTelegramSendMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionTelegramSendMessage build() { return new FlowActionTelegramSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java index d33f13ad6..ab234a98c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java @@ -50,7 +50,7 @@ public String getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTelegramSendMessageParams @@ -66,12 +66,12 @@ private boolean equalTo(FlowActionTelegramSendMessageParams other) { return connectionId.equals(other.connectionId) && chatId.equals(other.chatId) && text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.chatId, this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements ConnectionIdStage, ChatIdStage, Tex private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTelegramSendMessageParams other) { connectionId(other.getConnectionId()); chatId(other.getChatId()); @@ -119,28 +119,28 @@ public Builder from(FlowActionTelegramSendMessageParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public ChatIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("chat_id") public TextStage chatId(@NotNull String chatId) { this.chatId = Objects.requireNonNull(chatId, "chatId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @java.lang.Override + @Override public FlowActionTelegramSendMessageParams build() { return new FlowActionTelegramSendMessageParams(connectionId, chatId, text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java index 7f91ca908..ada1c8ca1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilio && equalTo((FlowActionTwilio) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionTwilio other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionTwilio.class); } - @java.lang.Override + @Override public FlowActionTwilio deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java index d13fd2629..885c2458a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java @@ -83,7 +83,7 @@ public FlowActionTwilioMakeCallParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioMakeCall && equalTo((FlowActionTwilioMakeCall) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTwilioMakeCall other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTwilioMakeCall other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTwilioMakeCall other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTwilioMakeCallParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionTwilioMakeCall build() { return new FlowActionTwilioMakeCall(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java index 8d4aa1b6c..1897e82af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java @@ -58,7 +58,7 @@ public String getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioMakeCallParams && equalTo((FlowActionTwilioMakeCallParams) other); @@ -76,12 +76,12 @@ private boolean equalTo(FlowActionTwilioMakeCallParams other) { && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.to, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, ToSta private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTwilioMakeCallParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -136,35 +136,35 @@ public Builder from(FlowActionTwilioMakeCallParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("from") public ToStage from(@NotNull String from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("to") public PayloadStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("payload") public _FinalStage payload(@NotNull String payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @java.lang.Override + @Override public FlowActionTwilioMakeCallParams build() { return new FlowActionTwilioMakeCallParams(connectionId, from, to, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java index 2005828de..e41324c2a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java @@ -83,7 +83,7 @@ public FlowActionTwilioSendSmsParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioSendSms && equalTo((FlowActionTwilioSendSms) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTwilioSendSms other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTwilioSendSms other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTwilioSendSms other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTwilioSendSmsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionTwilioSendSms build() { return new FlowActionTwilioSendSms(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java index 0cce55f3c..cb38f8bbc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java @@ -58,7 +58,7 @@ public String getMessage() { return message; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioSendSmsParams && equalTo((FlowActionTwilioSendSmsParams) other); @@ -76,12 +76,12 @@ private boolean equalTo(FlowActionTwilioSendSmsParams other) { && message.equals(other.message); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.to, this.message); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, ToSta private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionTwilioSendSmsParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -136,35 +136,35 @@ public Builder from(FlowActionTwilioSendSmsParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("from") public ToStage from(@NotNull String from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("to") public MessageStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @java.lang.Override + @Override public FlowActionTwilioSendSmsParams build() { return new FlowActionTwilioSendSmsParams(connectionId, from, to, message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java index d0172e7b6..64c0935d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java @@ -83,7 +83,7 @@ public FlowActionWhatsappSendMessageParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessage && equalTo((FlowActionWhatsappSendMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionWhatsappSendMessage other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionWhatsappSendMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionWhatsappSendMessage other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionWhatsappSendMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionWhatsappSendMessage build() { return new FlowActionWhatsappSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java index 18fd44671..9ceb0ea7d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java @@ -71,7 +71,7 @@ public FlowActionWhatsappSendMessageParamsPayload getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessageParams @@ -91,12 +91,12 @@ private boolean equalTo(FlowActionWhatsappSendMessageParams other) { && payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.senderId, this.recipientNumber, this.type, this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionWhatsappSendMessageParams other) { connectionId(other.getConnectionId()); senderId(other.getSenderId()); @@ -159,42 +159,42 @@ public Builder from(FlowActionWhatsappSendMessageParams other) { return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public SenderIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("sender_id") public RecipientNumberStage senderId(@NotNull String senderId) { this.senderId = Objects.requireNonNull(senderId, "senderId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("recipient_number") public TypeStage recipientNumber(@NotNull String recipientNumber) { this.recipientNumber = Objects.requireNonNull(recipientNumber, "recipientNumber must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public PayloadStage type(@NotNull FlowActionWhatsappSendMessageParamsType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("payload") public _FinalStage payload(@NotNull FlowActionWhatsappSendMessageParamsPayload payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @java.lang.Override + @Override public FlowActionWhatsappSendMessageParams build() { return new FlowActionWhatsappSendMessageParams( connectionId, senderId, recipientNumber, type, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java index ad46169cf..9fae01ddb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessageParamsPayload @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionWhatsappSendMessageParamsPayload other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXml && equalTo((FlowActionXml) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionXml other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionXml.class); } - @java.lang.Override + @Override public FlowActionXml deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java index e543c01ac..2bea78b46 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java @@ -83,7 +83,7 @@ public FlowActionXmlParseXmlParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlParseXml && equalTo((FlowActionXmlParseXml) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionXmlParseXml other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionXmlParseXml other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionXmlParseXml other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionXmlParseXmlParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionXmlParseXml build() { return new FlowActionXmlParseXml(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java index 9c97b5312..1cf122ee0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java @@ -33,7 +33,7 @@ public String getXml() { return xml; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlParseXmlParams && equalTo((FlowActionXmlParseXmlParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionXmlParseXmlParams other) { return xml.equals(other.xml); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.xml); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements XmlStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionXmlParseXmlParams other) { xml(other.getXml()); return this; } - @java.lang.Override + @Override @JsonSetter("xml") public _FinalStage xml(@NotNull String xml) { this.xml = Objects.requireNonNull(xml, "xml must not be null"); return this; } - @java.lang.Override + @Override public FlowActionXmlParseXmlParams build() { return new FlowActionXmlParseXmlParams(xml, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java index bbe425904..96313102d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java @@ -83,7 +83,7 @@ public FlowActionXmlSerializeXmlParams getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXml && equalTo((FlowActionXmlSerializeXml) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionXmlSerializeXml other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionXmlSerializeXml other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionXmlSerializeXml other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionXmlSerializeXmlParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionXmlSerializeXml build() { return new FlowActionXmlSerializeXml(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java index f061b36a6..e17310edb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java @@ -34,7 +34,7 @@ public FlowActionXmlSerializeXmlParamsObject getObject() { return object; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXmlParams && equalTo((FlowActionXmlSerializeXmlParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionXmlSerializeXmlParams other) { return object.equals(other.object); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.object); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ObjectStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionXmlSerializeXmlParams other) { object(other.getObject()); return this; } - @java.lang.Override + @Override @JsonSetter("object") public _FinalStage object(@NotNull FlowActionXmlSerializeXmlParamsObject object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } - @java.lang.Override + @Override public FlowActionXmlSerializeXmlParams build() { return new FlowActionXmlSerializeXmlParams(object, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java index abba5fb24..d14362ac5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXmlParamsObject @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionXmlSerializeXmlParamsObject other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @java.lang.Override + @Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @java.lang.Override + @Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FlowActionZapierTriggerWebhook build() { return new FlowActionZapierTriggerWebhook( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java index 1a30886e3..f6c77bd52 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java @@ -46,7 +46,7 @@ public Optional getMethod() { return method; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionZapierTriggerWebhookParams @@ -62,12 +62,12 @@ private boolean equalTo(FlowActionZapierTriggerWebhookParams other) { return connectionId.equals(other.connectionId) && method.equals(other.method); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connectionId, this.method); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,34 +101,34 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FlowActionZapierTriggerWebhookParams other) { connectionId(other.getConnectionId()); method(other.getMethod()); return this; } - @java.lang.Override + @Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage method(FlowActionZapierTriggerWebhookParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @java.lang.Override + @Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @java.lang.Override + @Override public FlowActionZapierTriggerWebhookParams build() { return new FlowActionZapierTriggerWebhookParams(connectionId, method, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java index bd0e8036a..f0c0ec183 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionZapierTriggerWebhookParamsMethod && this.string.equals(((FlowActionZapierTriggerWebhookParamsMethod) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java index 0f85945d1..4c5a03b75 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java @@ -125,7 +125,7 @@ public Optional getEndedAt() { return endedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowExecutionSummary && equalTo((FlowExecutionSummary) other); @@ -147,7 +147,7 @@ private boolean equalTo(FlowExecutionSummary other) { && endedAt.equals(other.endedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -160,7 +160,7 @@ public int hashCode() { this.endedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -255,7 +255,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FlowExecutionSummary other) { id(other.getId()); traceId(other.getTraceId()); @@ -273,7 +273,7 @@ public Builder from(FlowExecutionSummary other) { *

Flow execution identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public TraceIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -285,7 +285,7 @@ public TraceIdStage id(@NotNull String id) { *

Trace id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("trace_id") public StatusStage traceId(@NotNull String traceId) { this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); @@ -297,7 +297,7 @@ public StatusStage traceId(@NotNull String traceId) { *

Execution status

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public CreatedAtStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -309,7 +309,7 @@ public CreatedAtStage status(@NotNull String status) { *

The ISO 8601 formatted date when this flow execution was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -321,7 +321,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this flow execution was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -332,7 +332,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The ISO 8601 formatted date when this flow execution ended.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage endedAt(OffsetDateTime endedAt) { this.endedAt = Optional.ofNullable(endedAt); return this; @@ -341,7 +341,7 @@ public _FinalStage endedAt(OffsetDateTime endedAt) { /** *

The ISO 8601 formatted date when this flow execution ended.

*/ - @java.lang.Override + @Override @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) public _FinalStage endedAt(Optional endedAt) { this.endedAt = endedAt; @@ -352,7 +352,7 @@ public _FinalStage endedAt(Optional endedAt) { *

The ISO 8601 formatted date when this flow execution started.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startedAt(OffsetDateTime startedAt) { this.startedAt = Optional.ofNullable(startedAt); return this; @@ -361,7 +361,7 @@ public _FinalStage startedAt(OffsetDateTime startedAt) { /** *

The ISO 8601 formatted date when this flow execution started.

*/ - @java.lang.Override + @Override @JsonSetter(value = "started_at", nulls = Nulls.SKIP) public _FinalStage startedAt(Optional startedAt) { this.startedAt = startedAt; @@ -372,7 +372,7 @@ public _FinalStage startedAt(Optional startedAt) { *

Journey id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage journeyId(String journeyId) { this.journeyId = Optional.ofNullable(journeyId); return this; @@ -381,14 +381,14 @@ public _FinalStage journeyId(String journeyId) { /** *

Journey id

*/ - @java.lang.Override + @Override @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) public _FinalStage journeyId(Optional journeyId) { this.journeyId = journeyId; return this; } - @java.lang.Override + @Override public FlowExecutionSummary build() { return new FlowExecutionSummary( id, traceId, journeyId, status, createdAt, updatedAt, startedAt, endedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java index ad5d7050b..967264de9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java @@ -74,7 +74,7 @@ public Optional getExecutedAt() { return executedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowSummary && equalTo((FlowSummary) other); @@ -93,12 +93,12 @@ private boolean equalTo(FlowSummary other) { && executedAt.equals(other.executedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.executedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,7 +150,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FlowSummary other) { id(other.getId()); name(other.getName()); @@ -160,48 +160,48 @@ public Builder from(FlowSummary other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @java.lang.Override + @Override public FlowSummary build() { return new FlowSummary(id, name, createdAt, updatedAt, executedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java index 9c7631ed5..f4ae6373c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java @@ -70,9 +70,6 @@ public Optional> getHydrate() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -112,19 +109,13 @@ private Optional> _getHydrate() { return hydrate; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("synchronous") private OptionalNullable _getSynchronous() { return synchronous; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsListRequest && equalTo((FlowsListRequest) other); @@ -143,12 +134,12 @@ private boolean equalTo(FlowsListRequest other) { && synchronous.equals(other.synchronous); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals, this.synchronous); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -217,7 +208,7 @@ public Builder hydrate(String hydrate) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java new file mode 100644 index 000000000..26c5a06c0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupApiKey.Builder.class) +public final class FlowsVaultConnectioSetupApiKey { + private final String type; + + private final String apiKey; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupApiKey(String type, String apiKey, Map additionalProperties) { + this.type = type; + this.apiKey = apiKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupApiKey && equalTo((FlowsVaultConnectioSetupApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupApiKey other) { + return type.equals(other.type) && apiKey.equals(other.apiKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.apiKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ApiKeyStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupApiKey other); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ApiKeyStage, _FinalStage { + private String type; + + private String apiKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupApiKey other) { + type(other.getType()); + apiKey(other.getApiKey()); + return this; + } + + @Override + @JsonSetter("type") + public ApiKeyStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("api_key") + public _FinalStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupApiKey build() { + return new FlowsVaultConnectioSetupApiKey(type, apiKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java new file mode 100644 index 000000000..73138d96d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupApiKeyWithBaseUrl.Builder.class) +public final class FlowsVaultConnectioSetupApiKeyWithBaseUrl { + private final String type; + + private final String apiKey; + + private final String baseUrl; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupApiKeyWithBaseUrl( + String type, String apiKey, String baseUrl, Map additionalProperties) { + this.type = type; + this.apiKey = apiKey; + this.baseUrl = baseUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @JsonProperty("base_url") + public String getBaseUrl() { + return baseUrl; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupApiKeyWithBaseUrl + && equalTo((FlowsVaultConnectioSetupApiKeyWithBaseUrl) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupApiKeyWithBaseUrl other) { + return type.equals(other.type) && apiKey.equals(other.apiKey) && baseUrl.equals(other.baseUrl); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.apiKey, this.baseUrl); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ApiKeyStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupApiKeyWithBaseUrl other); + } + + public interface ApiKeyStage { + BaseUrlStage apiKey(@NotNull String apiKey); + } + + public interface BaseUrlStage { + _FinalStage baseUrl(@NotNull String baseUrl); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupApiKeyWithBaseUrl build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ApiKeyStage, BaseUrlStage, _FinalStage { + private String type; + + private String apiKey; + + private String baseUrl; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupApiKeyWithBaseUrl other) { + type(other.getType()); + apiKey(other.getApiKey()); + baseUrl(other.getBaseUrl()); + return this; + } + + @Override + @JsonSetter("type") + public ApiKeyStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("api_key") + public BaseUrlStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @Override + @JsonSetter("base_url") + public _FinalStage baseUrl(@NotNull String baseUrl) { + this.baseUrl = Objects.requireNonNull(baseUrl, "baseUrl must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupApiKeyWithBaseUrl build() { + return new FlowsVaultConnectioSetupApiKeyWithBaseUrl(type, apiKey, baseUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java new file mode 100644 index 000000000..cb9b9a9b6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupBigqueryOauthJwt.Builder.class) +public final class FlowsVaultConnectioSetupBigqueryOauthJwt { + private final Optional type; + + private final Optional projectId; + + private final Optional privateKey; + + private final Optional clientEmail; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupBigqueryOauthJwt( + Optional type, + Optional projectId, + Optional privateKey, + Optional clientEmail, + Map additionalProperties) { + this.type = type; + this.projectId = projectId; + this.privateKey = privateKey; + this.clientEmail = clientEmail; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("project_id") + public Optional getProjectId() { + return projectId; + } + + @JsonProperty("private_key") + public Optional getPrivateKey() { + return privateKey; + } + + @JsonProperty("client_email") + public Optional getClientEmail() { + return clientEmail; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupBigqueryOauthJwt + && equalTo((FlowsVaultConnectioSetupBigqueryOauthJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupBigqueryOauthJwt other) { + return type.equals(other.type) + && projectId.equals(other.projectId) + && privateKey.equals(other.privateKey) + && clientEmail.equals(other.clientEmail); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.projectId, this.privateKey, this.clientEmail); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional projectId = Optional.empty(); + + private Optional privateKey = Optional.empty(); + + private Optional clientEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowsVaultConnectioSetupBigqueryOauthJwt other) { + type(other.getType()); + projectId(other.getProjectId()); + privateKey(other.getPrivateKey()); + clientEmail(other.getClientEmail()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "project_id", nulls = Nulls.SKIP) + public Builder projectId(Optional projectId) { + this.projectId = projectId; + return this; + } + + public Builder projectId(String projectId) { + this.projectId = Optional.ofNullable(projectId); + return this; + } + + @JsonSetter(value = "private_key", nulls = Nulls.SKIP) + public Builder privateKey(Optional privateKey) { + this.privateKey = privateKey; + return this; + } + + public Builder privateKey(String privateKey) { + this.privateKey = Optional.ofNullable(privateKey); + return this; + } + + @JsonSetter(value = "client_email", nulls = Nulls.SKIP) + public Builder clientEmail(Optional clientEmail) { + this.clientEmail = clientEmail; + return this; + } + + public Builder clientEmail(String clientEmail) { + this.clientEmail = Optional.ofNullable(clientEmail); + return this; + } + + public FlowsVaultConnectioSetupBigqueryOauthJwt build() { + return new FlowsVaultConnectioSetupBigqueryOauthJwt( + type, projectId, privateKey, clientEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java new file mode 100644 index 000000000..3e3d1611b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupHttpBearer.Builder.class) +public final class FlowsVaultConnectioSetupHttpBearer { + private final String type; + + private final String token; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupHttpBearer(String type, String token, Map additionalProperties) { + this.type = type; + this.token = token; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("token") + public String getToken() { + return token; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupHttpBearer + && equalTo((FlowsVaultConnectioSetupHttpBearer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupHttpBearer other) { + return type.equals(other.type) && token.equals(other.token); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.token); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + TokenStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupHttpBearer other); + } + + public interface TokenStage { + _FinalStage token(@NotNull String token); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupHttpBearer build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, TokenStage, _FinalStage { + private String type; + + private String token; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupHttpBearer other) { + type(other.getType()); + token(other.getToken()); + return this; + } + + @Override + @JsonSetter("type") + public TokenStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("token") + public _FinalStage token(@NotNull String token) { + this.token = Objects.requireNonNull(token, "token must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupHttpBearer build() { + return new FlowsVaultConnectioSetupHttpBearer(type, token, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java new file mode 100644 index 000000000..1483bd3df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupJwt.Builder.class) +public final class FlowsVaultConnectioSetupJwt { + private final String type; + + private final FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupJwt( + String type, FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm, Map additionalProperties) { + this.type = type; + this.algorithm = algorithm; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("algorithm") + public FlowsVaultConnectioSetupJwtAlgorithmEnum getAlgorithm() { + return algorithm; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupJwt && equalTo((FlowsVaultConnectioSetupJwt) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupJwt other) { + return type.equals(other.type) && algorithm.equals(other.algorithm); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.algorithm); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + AlgorithmStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupJwt other); + } + + public interface AlgorithmStage { + _FinalStage algorithm(@NotNull FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupJwt build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, AlgorithmStage, _FinalStage { + private String type; + + private FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupJwt other) { + type(other.getType()); + algorithm(other.getAlgorithm()); + return this; + } + + @Override + @JsonSetter("type") + public AlgorithmStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("algorithm") + public _FinalStage algorithm(@NotNull FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm) { + this.algorithm = Objects.requireNonNull(algorithm, "algorithm must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupJwt build() { + return new FlowsVaultConnectioSetupJwt(type, algorithm, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java new file mode 100644 index 000000000..03b078209 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FlowsVaultConnectioSetupJwtAlgorithmEnum { + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum RS512 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.RS512, "RS512"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum ES256 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.ES256, "ES256"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum PS256 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.PS256, "PS256"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum ES384 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.ES384, "ES384"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum PS384 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.PS384, "PS384"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum HS256 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.HS256, "HS256"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum ES512 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.ES512, "ES512"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum HS384 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.HS384, "HS384"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum PS512 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.PS512, "PS512"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum HS512 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.HS512, "HS512"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum RS256 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.RS256, "RS256"); + + public static final FlowsVaultConnectioSetupJwtAlgorithmEnum RS384 = + new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.RS384, "RS384"); + + private final Value value; + + private final String string; + + FlowsVaultConnectioSetupJwtAlgorithmEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FlowsVaultConnectioSetupJwtAlgorithmEnum + && this.string.equals(((FlowsVaultConnectioSetupJwtAlgorithmEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RS512: + return visitor.visitRs512(); + case ES256: + return visitor.visitEs256(); + case PS256: + return visitor.visitPs256(); + case ES384: + return visitor.visitEs384(); + case PS384: + return visitor.visitPs384(); + case HS256: + return visitor.visitHs256(); + case ES512: + return visitor.visitEs512(); + case HS384: + return visitor.visitHs384(); + case PS512: + return visitor.visitPs512(); + case HS512: + return visitor.visitHs512(); + case RS256: + return visitor.visitRs256(); + case RS384: + return visitor.visitRs384(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FlowsVaultConnectioSetupJwtAlgorithmEnum valueOf(String value) { + switch (value) { + case "RS512": + return RS512; + case "ES256": + return ES256; + case "PS256": + return PS256; + case "ES384": + return ES384; + case "PS384": + return PS384; + case "HS256": + return HS256; + case "ES512": + return ES512; + case "HS384": + return HS384; + case "PS512": + return PS512; + case "HS512": + return HS512; + case "RS256": + return RS256; + case "RS384": + return RS384; + default: + return new FlowsVaultConnectioSetupJwtAlgorithmEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HS256, + + HS384, + + HS512, + + RS256, + + RS384, + + RS512, + + ES256, + + ES384, + + ES512, + + PS256, + + PS384, + + PS512, + + UNKNOWN + } + + public interface Visitor { + T visitHs256(); + + T visitHs384(); + + T visitHs512(); + + T visitRs256(); + + T visitRs384(); + + T visitRs512(); + + T visitEs256(); + + T visitEs384(); + + T visitEs512(); + + T visitPs256(); + + T visitPs384(); + + T visitPs512(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java new file mode 100644 index 000000000..9298158b9 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupMailjetApiKey.Builder.class) +public final class FlowsVaultConnectioSetupMailjetApiKey { + private final String type; + + private final String apiKey; + + private final String secretKey; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupMailjetApiKey( + String type, String apiKey, String secretKey, Map additionalProperties) { + this.type = type; + this.apiKey = apiKey; + this.secretKey = secretKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @JsonProperty("secret_key") + public String getSecretKey() { + return secretKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupMailjetApiKey + && equalTo((FlowsVaultConnectioSetupMailjetApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupMailjetApiKey other) { + return type.equals(other.type) && apiKey.equals(other.apiKey) && secretKey.equals(other.secretKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.apiKey, this.secretKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ApiKeyStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupMailjetApiKey other); + } + + public interface ApiKeyStage { + SecretKeyStage apiKey(@NotNull String apiKey); + } + + public interface SecretKeyStage { + _FinalStage secretKey(@NotNull String secretKey); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupMailjetApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ApiKeyStage, SecretKeyStage, _FinalStage { + private String type; + + private String apiKey; + + private String secretKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupMailjetApiKey other) { + type(other.getType()); + apiKey(other.getApiKey()); + secretKey(other.getSecretKey()); + return this; + } + + @Override + @JsonSetter("type") + public ApiKeyStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("api_key") + public SecretKeyStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @Override + @JsonSetter("secret_key") + public _FinalStage secretKey(@NotNull String secretKey) { + this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupMailjetApiKey build() { + return new FlowsVaultConnectioSetupMailjetApiKey(type, apiKey, secretKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java new file mode 100644 index 000000000..4c2237d54 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupOauthApp.Builder.class) +public final class FlowsVaultConnectioSetupOauthApp { + private final String type; + + private final String clientId; + + private final String clientSecret; + + private final String domain; + + private final Optional audience; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupOauthApp( + String type, + String clientId, + String clientSecret, + String domain, + Optional audience, + Map additionalProperties) { + this.type = type; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.domain = domain; + this.audience = audience; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + public String getClientSecret() { + return clientSecret; + } + + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("audience") + public Optional getAudience() { + return audience; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupOauthApp && equalTo((FlowsVaultConnectioSetupOauthApp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupOauthApp other) { + return type.equals(other.type) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && domain.equals(other.domain) + && audience.equals(other.audience); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.clientId, this.clientSecret, this.domain, this.audience); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + ClientIdStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupOauthApp other); + } + + public interface ClientIdStage { + ClientSecretStage clientId(@NotNull String clientId); + } + + public interface ClientSecretStage { + DomainStage clientSecret(@NotNull String clientSecret); + } + + public interface DomainStage { + _FinalStage domain(@NotNull String domain); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupOauthApp build(); + + _FinalStage audience(Optional audience); + + _FinalStage audience(String audience); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ClientIdStage, ClientSecretStage, DomainStage, _FinalStage { + private String type; + + private String clientId; + + private String clientSecret; + + private String domain; + + private Optional audience = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupOauthApp other) { + type(other.getType()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + domain(other.getDomain()); + audience(other.getAudience()); + return this; + } + + @Override + @JsonSetter("type") + public ClientIdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("client_id") + public ClientSecretStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @Override + @JsonSetter("client_secret") + public DomainStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + @Override + @JsonSetter("domain") + public _FinalStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + public _FinalStage audience(String audience) { + this.audience = Optional.ofNullable(audience); + return this; + } + + @Override + @JsonSetter(value = "audience", nulls = Nulls.SKIP) + public _FinalStage audience(Optional audience) { + this.audience = audience; + return this; + } + + @Override + public FlowsVaultConnectioSetupOauthApp build() { + return new FlowsVaultConnectioSetupOauthApp( + type, clientId, clientSecret, domain, audience, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java new file mode 100644 index 000000000..fe2a389ec --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupOauthCode.Builder.class) +public final class FlowsVaultConnectioSetupOauthCode { + private final Optional type; + + private final Optional code; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupOauthCode( + Optional type, Optional code, Map additionalProperties) { + this.type = type; + this.code = code; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("code") + public Optional getCode() { + return code; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupOauthCode && equalTo((FlowsVaultConnectioSetupOauthCode) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupOauthCode other) { + return type.equals(other.type) && code.equals(other.code); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.code); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional code = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FlowsVaultConnectioSetupOauthCode other) { + type(other.getType()); + code(other.getCode()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + public FlowsVaultConnectioSetupOauthCode build() { + return new FlowsVaultConnectioSetupOauthCode(type, code, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java new file mode 100644 index 000000000..6e26d878b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupSecretApiKey.Builder.class) +public final class FlowsVaultConnectioSetupSecretApiKey { + private final String type; + + private final String secretKey; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupSecretApiKey( + String type, String secretKey, Map additionalProperties) { + this.type = type; + this.secretKey = secretKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("secret_key") + public String getSecretKey() { + return secretKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupSecretApiKey + && equalTo((FlowsVaultConnectioSetupSecretApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupSecretApiKey other) { + return type.equals(other.type) && secretKey.equals(other.secretKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.secretKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + SecretKeyStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupSecretApiKey other); + } + + public interface SecretKeyStage { + _FinalStage secretKey(@NotNull String secretKey); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupSecretApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, SecretKeyStage, _FinalStage { + private String type; + + private String secretKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupSecretApiKey other) { + type(other.getType()); + secretKey(other.getSecretKey()); + return this; + } + + @Override + @JsonSetter("type") + public SecretKeyStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("secret_key") + public _FinalStage secretKey(@NotNull String secretKey) { + this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupSecretApiKey build() { + return new FlowsVaultConnectioSetupSecretApiKey(type, secretKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java new file mode 100644 index 000000000..8eb68b044 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupStripeKeyPair.Builder.class) +public final class FlowsVaultConnectioSetupStripeKeyPair { + private final String type; + + private final String privateKey; + + private final String publicKey; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupStripeKeyPair( + String type, String privateKey, String publicKey, Map additionalProperties) { + this.type = type; + this.privateKey = privateKey; + this.publicKey = publicKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("private_key") + public String getPrivateKey() { + return privateKey; + } + + @JsonProperty("public_key") + public String getPublicKey() { + return publicKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupStripeKeyPair + && equalTo((FlowsVaultConnectioSetupStripeKeyPair) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupStripeKeyPair other) { + return type.equals(other.type) && privateKey.equals(other.privateKey) && publicKey.equals(other.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.privateKey, this.publicKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + PrivateKeyStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupStripeKeyPair other); + } + + public interface PrivateKeyStage { + PublicKeyStage privateKey(@NotNull String privateKey); + } + + public interface PublicKeyStage { + _FinalStage publicKey(@NotNull String publicKey); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupStripeKeyPair build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, PrivateKeyStage, PublicKeyStage, _FinalStage { + private String type; + + private String privateKey; + + private String publicKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupStripeKeyPair other) { + type(other.getType()); + privateKey(other.getPrivateKey()); + publicKey(other.getPublicKey()); + return this; + } + + @Override + @JsonSetter("type") + public PrivateKeyStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("private_key") + public PublicKeyStage privateKey(@NotNull String privateKey) { + this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); + return this; + } + + @Override + @JsonSetter("public_key") + public _FinalStage publicKey(@NotNull String publicKey) { + this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupStripeKeyPair build() { + return new FlowsVaultConnectioSetupStripeKeyPair(type, privateKey, publicKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java new file mode 100644 index 000000000..ee2ca6923 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupToken.Builder.class) +public final class FlowsVaultConnectioSetupToken { + private final String type; + + private final String token; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupToken(String type, String token, Map additionalProperties) { + this.type = type; + this.token = token; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("token") + public String getToken() { + return token; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupToken && equalTo((FlowsVaultConnectioSetupToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupToken other) { + return type.equals(other.type) && token.equals(other.token); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.token); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + TokenStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupToken other); + } + + public interface TokenStage { + _FinalStage token(@NotNull String token); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, TokenStage, _FinalStage { + private String type; + + private String token; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupToken other) { + type(other.getType()); + token(other.getToken()); + return this; + } + + @Override + @JsonSetter("type") + public TokenStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("token") + public _FinalStage token(@NotNull String token) { + this.token = Objects.requireNonNull(token, "token must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupToken build() { + return new FlowsVaultConnectioSetupToken(type, token, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java new file mode 100644 index 000000000..821e0a723 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupTwilioApiKey.Builder.class) +public final class FlowsVaultConnectioSetupTwilioApiKey { + private final String type; + + private final String accountId; + + private final String apiKey; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupTwilioApiKey( + String type, String accountId, String apiKey, Map additionalProperties) { + this.type = type; + this.accountId = accountId; + this.apiKey = apiKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("account_id") + public String getAccountId() { + return accountId; + } + + @JsonProperty("api_key") + public String getApiKey() { + return apiKey; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupTwilioApiKey + && equalTo((FlowsVaultConnectioSetupTwilioApiKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupTwilioApiKey other) { + return type.equals(other.type) && accountId.equals(other.accountId) && apiKey.equals(other.apiKey); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.accountId, this.apiKey); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + AccountIdStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupTwilioApiKey other); + } + + public interface AccountIdStage { + ApiKeyStage accountId(@NotNull String accountId); + } + + public interface ApiKeyStage { + _FinalStage apiKey(@NotNull String apiKey); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupTwilioApiKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, AccountIdStage, ApiKeyStage, _FinalStage { + private String type; + + private String accountId; + + private String apiKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupTwilioApiKey other) { + type(other.getType()); + accountId(other.getAccountId()); + apiKey(other.getApiKey()); + return this; + } + + @Override + @JsonSetter("type") + public AccountIdStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("account_id") + public ApiKeyStage accountId(@NotNull String accountId) { + this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); + return this; + } + + @Override + @JsonSetter("api_key") + public _FinalStage apiKey(@NotNull String apiKey) { + this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupTwilioApiKey build() { + return new FlowsVaultConnectioSetupTwilioApiKey(type, accountId, apiKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java new file mode 100644 index 000000000..ef95d5da8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectioSetupWebhook.Builder.class) +public final class FlowsVaultConnectioSetupWebhook { + private final String type; + + private final String url; + + private final Map additionalProperties; + + private FlowsVaultConnectioSetupWebhook(String type, String url, Map additionalProperties) { + this.type = type; + this.url = url; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectioSetupWebhook && equalTo((FlowsVaultConnectioSetupWebhook) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectioSetupWebhook other) { + return type.equals(other.type) && url.equals(other.url); + } + + @Override + public int hashCode() { + return Objects.hash(this.type, this.url); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + UrlStage type(@NotNull String type); + + Builder from(FlowsVaultConnectioSetupWebhook other); + } + + public interface UrlStage { + _FinalStage url(@NotNull String url); + } + + public interface _FinalStage { + FlowsVaultConnectioSetupWebhook build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, UrlStage, _FinalStage { + private String type; + + private String url; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectioSetupWebhook other) { + type(other.getType()); + url(other.getUrl()); + return this; + } + + @Override + @JsonSetter("type") + public UrlStage type(@NotNull String type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @Override + @JsonSetter("url") + public _FinalStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @Override + public FlowsVaultConnectioSetupWebhook build() { + return new FlowsVaultConnectioSetupWebhook(type, url, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java new file mode 100644 index 000000000..a3dfc4c8a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java @@ -0,0 +1,430 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FlowsVaultConnectionSummary.Builder.class) +public final class FlowsVaultConnectionSummary { + private final String id; + + private final String appId; + + private final String name; + + private final Optional accountName; + + private final boolean ready; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional refreshedAt; + + private final String fingerprint; + + private final Map additionalProperties; + + private FlowsVaultConnectionSummary( + String id, + String appId, + String name, + Optional accountName, + boolean ready, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional refreshedAt, + String fingerprint, + Map additionalProperties) { + this.id = id; + this.appId = appId; + this.name = name; + this.accountName = accountName; + this.ready = ready; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.refreshedAt = refreshedAt; + this.fingerprint = fingerprint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Flows Vault Connection app identifier. + */ + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Flows Vault Connection custom account name. + */ + @JsonProperty("account_name") + public Optional getAccountName() { + return accountName; + } + + /** + * @return Whether the Flows Vault Connection is configured. + */ + @JsonProperty("ready") + public boolean getReady() { + return ready; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + */ + @JsonProperty("refreshed_at") + public Optional getRefreshedAt() { + return refreshedAt; + } + + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FlowsVaultConnectionSummary && equalTo((FlowsVaultConnectionSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FlowsVaultConnectionSummary other) { + return id.equals(other.id) + && appId.equals(other.appId) + && name.equals(other.name) + && accountName.equals(other.accountName) + && ready == other.ready + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && refreshedAt.equals(other.refreshedAt) + && fingerprint.equals(other.fingerprint); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.appId, + this.name, + this.accountName, + this.ready, + this.createdAt, + this.updatedAt, + this.refreshedAt, + this.fingerprint); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flows Vault Connection identifier.

+ */ + AppIdStage id(@NotNull String id); + + Builder from(FlowsVaultConnectionSummary other); + } + + public interface AppIdStage { + /** + *

Flows Vault Connection app identifier.

+ */ + NameStage appId(@NotNull String appId); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + ReadyStage name(@NotNull String name); + } + + public interface ReadyStage { + /** + *

Whether the Flows Vault Connection is configured.

+ */ + CreatedAtStage ready(boolean ready); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ */ + FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface FingerprintStage { + _FinalStage fingerprint(@NotNull String fingerprint); + } + + public interface _FinalStage { + FlowsVaultConnectionSummary build(); + + /** + *

Flows Vault Connection custom account name.

+ */ + _FinalStage accountName(Optional accountName); + + _FinalStage accountName(String accountName); + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + _FinalStage refreshedAt(Optional refreshedAt); + + _FinalStage refreshedAt(OffsetDateTime refreshedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + AppIdStage, + NameStage, + ReadyStage, + CreatedAtStage, + UpdatedAtStage, + FingerprintStage, + _FinalStage { + private String id; + + private String appId; + + private String name; + + private boolean ready; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String fingerprint; + + private Optional refreshedAt = Optional.empty(); + + private Optional accountName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FlowsVaultConnectionSummary other) { + id(other.getId()); + appId(other.getAppId()); + name(other.getName()); + accountName(other.getAccountName()); + ready(other.getReady()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + refreshedAt(other.getRefreshedAt()); + fingerprint(other.getFingerprint()); + return this; + } + + /** + *

Flows Vault Connection identifier.

+ *

Flows Vault Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public AppIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Flows Vault Connection app identifier.

+ *

Flows Vault Connection app identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("app_id") + public NameStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public ReadyStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Whether the Flows Vault Connection is configured.

+ *

Whether the Flows Vault Connection is configured.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("ready") + public CreatedAtStage ready(boolean ready) { + this.ready = ready; + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @Override + @JsonSetter("fingerprint") + public _FinalStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { + this.refreshedAt = Optional.ofNullable(refreshedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + @Override + @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) + public _FinalStage refreshedAt(Optional refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ */ + @Override + @JsonSetter(value = "account_name", nulls = Nulls.SKIP) + public _FinalStage accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + @Override + public FlowsVaultConnectionSummary build() { + return new FlowsVaultConnectionSummary( + id, + appId, + name, + accountName, + ready, + createdAt, + updatedAt, + refreshedAt, + fingerprint, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlock.java b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java index e12842dd3..e720f6f06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlock.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlock && equalTo((FormBlock) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormBlock other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer { super(FormBlock.class); } - @java.lang.Override + @Override public FormBlock deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java index a62e0db33..715c9cb36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockDivider && equalTo((FormBlockDivider) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockDivider other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockDivider other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockDivider other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormBlockDividerConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormBlockDivider build() { return new FormBlockDivider(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java index a5183c3a3..0b57540c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java @@ -34,7 +34,7 @@ public Optional getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockDividerConfig && equalTo((FormBlockDividerConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockDividerConfig other) { return text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java index a184d58cc..2220cbaae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockHtml && equalTo((FormBlockHtml) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockHtml other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockHtml other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockHtml other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormBlockHtmlConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormBlockHtml build() { return new FormBlockHtml(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java index 1a3622c5e..d64c12828 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java @@ -34,7 +34,7 @@ public Optional getContent() { return content; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockHtmlConfig && equalTo((FormBlockHtmlConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockHtmlConfig other) { return content.equals(other.content); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.content); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java index e9452fb15..3c35b9b2c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockImage && equalTo((FormBlockImage) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockImage other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockImage other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockImage other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormBlockImageConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormBlockImage build() { return new FormBlockImage(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java index 88372a4b3..96fbabbda 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java @@ -55,7 +55,7 @@ public Optional getHeight() { return height; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockImageConfig && equalTo((FormBlockImageConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormBlockImageConfig other) { return src.equals(other.src) && position.equals(other.position) && height.equals(other.height); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.src, this.position, this.height); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements SrcStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockImageConfig other) { src(other.getSrc()); position(other.getPosition()); @@ -123,40 +123,40 @@ public Builder from(FormBlockImageConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("src") public _FinalStage src(@NotNull String src) { this.src = Objects.requireNonNull(src, "src must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage height(Double height) { this.height = Optional.ofNullable(height); return this; } - @java.lang.Override + @Override @JsonSetter(value = "height", nulls = Nulls.SKIP) public _FinalStage height(Optional height) { this.height = height; return this; } - @java.lang.Override + @Override public _FinalStage position(FormBlockImageConfigPositionEnum position) { this.position = Optional.ofNullable(position); return this; } - @java.lang.Override + @Override @JsonSetter(value = "position", nulls = Nulls.SKIP) public _FinalStage position(Optional position) { this.position = position; return this; } - @java.lang.Override + @Override public FormBlockImageConfig build() { return new FormBlockImageConfig(src, position, height, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java index ecc7f7dd9..5dd05df96 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormBlockImageConfigPositionEnum && this.string.equals(((FormBlockImageConfigPositionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java index 9f7bf1319..de31651b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java @@ -62,7 +62,7 @@ public FormBlockJumpButtonConfig getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButton && equalTo((FormBlockJumpButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockJumpButton other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockJumpButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockJumpButton other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockJumpButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public FormBlockJumpButton build() { return new FormBlockJumpButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java index 9f6282db1..0c7a0ebf4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java @@ -55,7 +55,7 @@ public Optional getStyle() { return style; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButtonConfig && equalTo((FormBlockJumpButtonConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormBlockJumpButtonConfig other) { return text.equals(other.text) && nextNode.equals(other.nextNode) && style.equals(other.style); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text, this.nextNode, this.style); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements TextStage, NextNodeStage, _FinalSta private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockJumpButtonConfig other) { text(other.getText()); nextNode(other.getNextNode()); @@ -123,34 +123,34 @@ public Builder from(FormBlockJumpButtonConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("text") public NextNodeStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("next_node") public _FinalStage nextNode(@NotNull FormNodePointer nextNode) { this.nextNode = Objects.requireNonNull(nextNode, "nextNode must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage style(FormBlockJumpButtonConfigStyle style) { this.style = Optional.ofNullable(style); return this; } - @java.lang.Override + @Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @java.lang.Override + @Override public FormBlockJumpButtonConfig build() { return new FormBlockJumpButtonConfig(text, nextNode, style, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java index ffd730672..210bc2326 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java @@ -34,7 +34,7 @@ public Optional getBackgroundColor() { return backgroundColor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButtonConfigStyle && equalTo((FormBlockJumpButtonConfigStyle) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockJumpButtonConfigStyle other) { return backgroundColor.equals(other.backgroundColor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.backgroundColor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java index e4f72fc7e..23d82860d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java @@ -62,7 +62,7 @@ public FormBlockNextButtonConfig getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockNextButton && equalTo((FormBlockNextButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockNextButton other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockNextButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockNextButton other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockNextButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public FormBlockNextButton build() { return new FormBlockNextButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java index 6d24c23bf..fed6738c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java @@ -33,7 +33,7 @@ public String getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockNextButtonConfig && equalTo((FormBlockNextButtonConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormBlockNextButtonConfig other) { return text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TextStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockNextButtonConfig other) { text(other.getText()); return this; } - @java.lang.Override + @Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @java.lang.Override + @Override public FormBlockNextButtonConfig build() { return new FormBlockNextButtonConfig(text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java index 6e176cfad..48ef90d9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java @@ -62,7 +62,7 @@ public FormBlockPreviousButtonConfig getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockPreviousButton && equalTo((FormBlockPreviousButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockPreviousButton other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockPreviousButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockPreviousButton other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockPreviousButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public FormBlockPreviousButton build() { return new FormBlockPreviousButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java index 60fb63e51..23d1fcfb2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java @@ -33,7 +33,7 @@ public String getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockPreviousButtonConfig && equalTo((FormBlockPreviousButtonConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormBlockPreviousButtonConfig other) { return text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TextStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockPreviousButtonConfig other) { text(other.getText()); return this; } - @java.lang.Override + @Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @java.lang.Override + @Override public FormBlockPreviousButtonConfig build() { return new FormBlockPreviousButtonConfig(text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java index cc5e57605..e3d604c57 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java @@ -62,7 +62,7 @@ public FormBlockResendButtonConfig getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockResendButton && equalTo((FormBlockResendButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockResendButton other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockResendButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockResendButton other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockResendButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public FormBlockResendButton build() { return new FormBlockResendButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java index d899c55c3..8039e03d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java @@ -91,7 +91,7 @@ public Optional getWaitingTime() { return waitingTime; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockResendButtonConfig && equalTo((FormBlockResendButtonConfig) other); @@ -112,7 +112,7 @@ private boolean equalTo(FormBlockResendButtonConfig other) { && waitingTime.equals(other.waitingTime); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.activeText, @@ -124,7 +124,7 @@ public int hashCode() { this.waitingTime); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockResendButtonConfig other) { activeText(other.getActiveText()); buttonText(other.getButtonText()); @@ -201,74 +201,74 @@ public Builder from(FormBlockResendButtonConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("active_text") public ButtonTextStage activeText(@NotNull String activeText) { this.activeText = Objects.requireNonNull(activeText, "activeText must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("button_text") public WaitingTextStage buttonText(@NotNull String buttonText) { this.buttonText = Objects.requireNonNull(buttonText, "buttonText must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("waiting_text") public FlowIdStage waitingText(@NotNull String waitingText) { this.waitingText = Objects.requireNonNull(waitingText, "waitingText must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("flow_id") public _FinalStage flowId(@NotNull String flowId) { this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage waitingTime(Double waitingTime) { this.waitingTime = Optional.ofNullable(waitingTime); return this; } - @java.lang.Override + @Override @JsonSetter(value = "waiting_time", nulls = Nulls.SKIP) public _FinalStage waitingTime(Optional waitingTime) { this.waitingTime = waitingTime; return this; } - @java.lang.Override + @Override public _FinalStage maxAttempts(Double maxAttempts) { this.maxAttempts = Optional.ofNullable(maxAttempts); return this; } - @java.lang.Override + @Override @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) public _FinalStage maxAttempts(Optional maxAttempts) { this.maxAttempts = maxAttempts; return this; } - @java.lang.Override + @Override public _FinalStage textAlignment(FormBlockResendButtonConfigTextAlignmentEnum textAlignment) { this.textAlignment = Optional.ofNullable(textAlignment); return this; } - @java.lang.Override + @Override @JsonSetter(value = "text_alignment", nulls = Nulls.SKIP) public _FinalStage textAlignment(Optional textAlignment) { this.textAlignment = textAlignment; return this; } - @java.lang.Override + @Override public FormBlockResendButtonConfig build() { return new FormBlockResendButtonConfig( activeText, diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java index b98a7331a..21a52f93b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormBlockResendButtonConfigTextAlignmentEnum && this.string.equals(((FormBlockResendButtonConfigTextAlignmentEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java index 630ccddbb..947810c43 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockRichText && equalTo((FormBlockRichText) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockRichText other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormBlockRichText other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockRichText other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormBlockRichTextConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormBlockRichText build() { return new FormBlockRichText(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java index a4986d07b..51975b5f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java @@ -34,7 +34,7 @@ public Optional getContent() { return content; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockRichTextConfig && equalTo((FormBlockRichTextConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockRichTextConfig other) { return content.equals(other.content); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.content); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormComponent.java b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java index 62c7f133a..f8e3779bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormComponent.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormComponent && equalTo((FormComponent) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormComponent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormComponent.class); } - @java.lang.Override + @Override public FormComponent deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java index e6e50def2..ecd56aa3b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java @@ -63,7 +63,7 @@ public Optional getResumeFlow() { return resumeFlow; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNode && equalTo((FormEndingNode) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormEndingNode other) { && resumeFlow.equals(other.resumeFlow); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.redirection, this.afterSubmit, this.coordinates, this.resumeFlow); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java index 9cb34292c..7213b6fa7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java @@ -34,7 +34,7 @@ public Optional getFlowId() { return flowId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNodeAfterSubmit && equalTo((FormEndingNodeAfterSubmit) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormEndingNodeAfterSubmit other) { return flowId.equals(other.flowId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.flowId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java index c7f3601f3..4ba2570e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java @@ -44,7 +44,7 @@ public String getTarget() { return target; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNodeRedirection && equalTo((FormEndingNodeRedirection) other); @@ -59,12 +59,12 @@ private boolean equalTo(FormEndingNodeRedirection other) { return delay.equals(other.delay) && target.equals(other.target); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.delay, this.target); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements TargetStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormEndingNodeRedirection other) { delay(other.getDelay()); target(other.getTarget()); return this; } - @java.lang.Override + @Override @JsonSetter("target") public _FinalStage target(@NotNull String target) { this.target = Objects.requireNonNull(target, "target must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage delay(Integer delay) { this.delay = Optional.ofNullable(delay); return this; } - @java.lang.Override + @Override @JsonSetter(value = "delay", nulls = Nulls.SKIP) public _FinalStage delay(Optional delay) { this.delay = delay; return this; } - @java.lang.Override + @Override public FormEndingNodeRedirection build() { return new FormEndingNodeRedirection(delay, target, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormField.java b/src/main/java/com/auth0/client/mgmt/types/FormField.java index 2efcc642c..307fd8182 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormField.java @@ -67,7 +67,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormField && equalTo((FormField) other); @@ -77,12 +77,12 @@ private boolean equalTo(FormField other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -190,7 +190,7 @@ static final class Deserializer extends StdDeserializer { super(FormField.class); } - @java.lang.Override + @Override public FormField deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java index 35da43ce1..0e3d1b96c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBoolean && equalTo((FormFieldBoolean) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldBoolean other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldBoolean other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldBoolean other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldBooleanConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormFieldBoolean build() { return new FormFieldBoolean( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java index 6901ba78e..3d47d3fc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java @@ -45,7 +45,7 @@ public Optional getOptions() { return options; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBooleanConfig && equalTo((FormFieldBooleanConfig) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldBooleanConfig other) { return defaultValue.equals(other.defaultValue) && options.equals(other.options); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.defaultValue, this.options); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java index 4303222fc..a3829a3d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java @@ -43,7 +43,7 @@ public Optional getFalse() { return false_; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBooleanConfigOptions && equalTo((FormFieldBooleanConfigOptions) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldBooleanConfigOptions other) { return true_.equals(other.true_) && false_.equals(other.false_); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.true_, this.false_); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java index 50dfdcffe..6eecd8505 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCards && equalTo((FormFieldCards) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldCards other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldCards other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldCards other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldCardsConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldCards build() { return new FormFieldCards( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java index a526bc8b9..a6b700c2e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java @@ -55,7 +55,7 @@ public Optional> getOptions() { return options; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCardsConfig && equalTo((FormFieldCardsConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormFieldCardsConfig other) { return hideLabels.equals(other.hideLabels) && multiple.equals(other.multiple) && options.equals(other.options); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hideLabels, this.multiple, this.options); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java index e85a6ccea..dca1baab1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java @@ -50,7 +50,7 @@ public String getImageUrl() { return imageUrl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCardsConfigOption && equalTo((FormFieldCardsConfigOption) other); @@ -65,12 +65,12 @@ private boolean equalTo(FormFieldCardsConfigOption other) { return value.equals(other.value) && label.equals(other.label) && imageUrl.equals(other.imageUrl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.label, this.imageUrl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements ValueStage, LabelStage, ImageUrlSta private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldCardsConfigOption other) { value(other.getValue()); label(other.getLabel()); @@ -118,28 +118,28 @@ public Builder from(FormFieldCardsConfigOption other) { return this; } - @java.lang.Override + @Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("label") public ImageUrlStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("image_url") public _FinalStage imageUrl(@NotNull String imageUrl) { this.imageUrl = Objects.requireNonNull(imageUrl, "imageUrl must not be null"); return this; } - @java.lang.Override + @Override public FormFieldCardsConfigOption build() { return new FormFieldCardsConfigOption(value, label, imageUrl, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java index 57f6f4dfe..e58cae25c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoice && equalTo((FormFieldChoice) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldChoice other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldChoice other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldChoice other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldChoiceConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldChoice build() { return new FormFieldChoice( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java index 181bab370..6437096cd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java @@ -55,7 +55,7 @@ public Optional getAllowOther() { return allowOther; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfig && equalTo((FormFieldChoiceConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormFieldChoiceConfig other) { return multiple.equals(other.multiple) && options.equals(other.options) && allowOther.equals(other.allowOther); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.multiple, this.options, this.allowOther); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java index 49c6d7e81..e47660f54 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java @@ -54,7 +54,7 @@ public Optional getPlaceholder() { return placeholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfigAllowOther && equalTo((FormFieldChoiceConfigAllowOther) other); @@ -69,12 +69,12 @@ private boolean equalTo(FormFieldChoiceConfigAllowOther other) { return enabled.equals(other.enabled) && label.equals(other.label) && placeholder.equals(other.placeholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.label, this.placeholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java index a7b0cf35b..14a58c5a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java @@ -41,7 +41,7 @@ public String getLabel() { return label; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfigOption && equalTo((FormFieldChoiceConfigOption) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormFieldChoiceConfigOption other) { return value.equals(other.value) && label.equals(other.label); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.label); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ValueStage, LabelStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldChoiceConfigOption other) { value(other.getValue()); label(other.getLabel()); return this; } - @java.lang.Override + @Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("label") public _FinalStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @java.lang.Override + @Override public FormFieldChoiceConfigOption build() { return new FormFieldChoiceConfigOption(value, label, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java index 83d7fddd2..ca2b063fd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCustom && equalTo((FormFieldCustom) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldCustom other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldCustom other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldCustom other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldCustomConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormFieldCustom build() { return new FormFieldCustom( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java index 8a789643a..d296c2720 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java @@ -28,7 +28,7 @@ public final class FormFieldCustomConfig { private final Optional css; - private final Optional> params; + private final Optional> params; private final Map additionalProperties; @@ -36,7 +36,7 @@ private FormFieldCustomConfig( Map schema, String code, Optional css, - Optional> params, + Optional> params, Map additionalProperties) { this.schema = schema; this.code = code; @@ -61,11 +61,11 @@ public Optional getCss() { } @JsonProperty("params") - public Optional> getParams() { + public Optional> getParams() { return params; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCustomConfig && equalTo((FormFieldCustomConfig) other); @@ -83,12 +83,12 @@ private boolean equalTo(FormFieldCustomConfig other) { && params.equals(other.params); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.schema, this.code, this.css, this.params); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,16 +116,16 @@ public interface _FinalStage { _FinalStage css(String css); - _FinalStage params(Optional> params); + _FinalStage params(Optional> params); - _FinalStage params(Map params); + _FinalStage params(Map params); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements CodeStage, _FinalStage { private String code; - private Optional> params = Optional.empty(); + private Optional> params = Optional.empty(); private Optional css = Optional.empty(); @@ -136,7 +136,7 @@ public static final class Builder implements CodeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldCustomConfig other) { schema(other.getSchema()); code(other.getCode()); @@ -145,46 +145,46 @@ public Builder from(FormFieldCustomConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("code") public _FinalStage code(@NotNull String code) { this.code = Objects.requireNonNull(code, "code must not be null"); return this; } - @java.lang.Override - public _FinalStage params(Map params) { + @Override + public _FinalStage params(Map params) { this.params = Optional.ofNullable(params); return this; } - @java.lang.Override + @Override @JsonSetter(value = "params", nulls = Nulls.SKIP) - public _FinalStage params(Optional> params) { + public _FinalStage params(Optional> params) { this.params = params; return this; } - @java.lang.Override + @Override public _FinalStage css(String css) { this.css = Optional.ofNullable(css); return this; } - @java.lang.Override + @Override @JsonSetter(value = "css", nulls = Nulls.SKIP) public _FinalStage css(Optional css) { this.css = css; return this; } - @java.lang.Override + @Override public _FinalStage schema(String key, Object value) { this.schema.put(key, value); return this; } - @java.lang.Override + @Override public _FinalStage putAllSchema(Map schema) { if (schema != null) { this.schema.putAll(schema); @@ -192,7 +192,7 @@ public _FinalStage putAllSchema(Map schema) { return this; } - @java.lang.Override + @Override @JsonSetter(value = "schema", nulls = Nulls.SKIP) public _FinalStage schema(Map schema) { this.schema.clear(); @@ -202,7 +202,7 @@ public _FinalStage schema(Map schema) { return this; } - @java.lang.Override + @Override public FormFieldCustomConfig build() { return new FormFieldCustomConfig(schema, code, css, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java index 7484ab2ff..cb28beedb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDate && equalTo((FormFieldDate) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldDate other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldDate other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldDate other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldDateConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormFieldDate build() { return new FormFieldDate( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java index 11f4bdb32..58c1b56d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java @@ -45,7 +45,7 @@ public Optional getDefaultValue() { return defaultValue; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDateConfig && equalTo((FormFieldDateConfig) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldDateConfig other) { return format.equals(other.format) && defaultValue.equals(other.defaultValue); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.format, this.defaultValue); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java index 1bc0f9a37..fd1e837a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldDateConfigFormatEnum && this.string.equals(((FormFieldDateConfigFormatEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java index 674c4b055..e7a15ad36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdown && equalTo((FormFieldDropdown) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldDropdown other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldDropdown other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldDropdown other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldDropdownConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldDropdown build() { return new FormFieldDropdown( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java index 5a1efa85e..9db063c4d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java @@ -55,7 +55,7 @@ public Optional getPlaceholder() { return placeholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdownConfig && equalTo((FormFieldDropdownConfig) other); @@ -72,12 +72,12 @@ private boolean equalTo(FormFieldDropdownConfig other) { && placeholder.equals(other.placeholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.multiple, this.options, this.placeholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java index 49965c866..7518dd1a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java @@ -41,7 +41,7 @@ public String getLabel() { return label; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdownConfigOption && equalTo((FormFieldDropdownConfigOption) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormFieldDropdownConfigOption other) { return value.equals(other.value) && label.equals(other.label); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.label); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ValueStage, LabelStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldDropdownConfigOption other) { value(other.getValue()); label(other.getLabel()); return this; } - @java.lang.Override + @Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("label") public _FinalStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @java.lang.Override + @Override public FormFieldDropdownConfigOption build() { return new FormFieldDropdownConfigOption(value, label, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java index de80038fa..5cae06444 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldEmail && equalTo((FormFieldEmail) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldEmail other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldEmail other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldEmail other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldEmailConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldEmail build() { return new FormFieldEmail( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java index 6cf5817fe..9b39704ed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldEmailConfig && equalTo((FormFieldEmailConfig) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldEmailConfig other) { return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java index ee9d498df..1e82a5c55 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFile && equalTo((FormFieldFile) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldFile other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldFile other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldFile other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldFileConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldFile build() { return new FormFieldFile( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java index 29a77e1e3..106a835dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java @@ -82,7 +82,7 @@ public Optional getMaxFiles() { return maxFiles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFileConfig && equalTo((FormFieldFileConfig) other); @@ -102,12 +102,12 @@ private boolean equalTo(FormFieldFileConfig other) { && maxFiles.equals(other.maxFiles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.multiple, this.storage, this.categories, this.extensions, this.maxSize, this.maxFiles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java index e28d21e68..4191d6130 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldFileConfigCategoryEnum && this.string.equals(((FormFieldFileConfigCategoryEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java index 56854c2b6..c6cebddd7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java @@ -34,7 +34,7 @@ public FormFieldFileConfigStorageTypeEnum getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFileConfigStorage && equalTo((FormFieldFileConfigStorage) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldFileConfigStorage other) { return type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldFileConfigStorage other) { type(other.getType()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull FormFieldFileConfigStorageTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public FormFieldFileConfigStorage build() { return new FormFieldFileConfigStorage(type, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java index 363cb3796..e4171fc08 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldFileConfigStorageTypeEnum && this.string.equals(((FormFieldFileConfigStorageTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java index ff8e09e60..0d9ee8308 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldLegal && equalTo((FormFieldLegal) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldLegal other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldLegal other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldLegal other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldLegalConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldLegal build() { return new FormFieldLegal( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java index 482a6c4d0..df2153eb7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java @@ -34,7 +34,7 @@ public Optional getText() { return text; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldLegalConfig && equalTo((FormFieldLegalConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldLegalConfig other) { return text.equals(other.text); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java index 04e6a4766..b2389b529 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldNumber && equalTo((FormFieldNumber) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldNumber other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldNumber other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldNumber other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldNumberConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldNumber build() { return new FormFieldNumber( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java index 3f25a6c1a..a0f78629d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java @@ -63,7 +63,7 @@ public Optional getMaxValue() { return maxValue; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldNumberConfig && equalTo((FormFieldNumberConfig) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormFieldNumberConfig other) { && maxValue.equals(other.maxValue); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder, this.minValue, this.maxValue); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java index fc1c79169..a0357ae3a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPassword && equalTo((FormFieldPassword) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldPassword other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldPassword other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldPassword other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldPasswordConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormFieldPassword build() { return new FormFieldPassword( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java index 9c0a9a4dc..f9cb29e2a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java @@ -90,7 +90,7 @@ public Optional getStrengthMeter() { return strengthMeter; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPasswordConfig && equalTo((FormFieldPasswordConfig) other); @@ -111,7 +111,7 @@ private boolean equalTo(FormFieldPasswordConfig other) { && strengthMeter.equals(other.strengthMeter); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.hash, @@ -123,7 +123,7 @@ public int hashCode() { this.strengthMeter); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java index b61d4c088..8f0ca1a93 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldPasswordConfigHashEnum && this.string.equals(((FormFieldPasswordConfigHashEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java index 1e6ce138e..cea8fef84 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPayment && equalTo((FormFieldPayment) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldPayment other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldPayment other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldPayment other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldPaymentConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormFieldPayment build() { return new FormFieldPayment( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java index 094177612..064d3cbcb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java @@ -73,7 +73,7 @@ public Optional getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfig && equalTo((FormFieldPaymentConfig) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormFieldPaymentConfig other) { && fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider, this.charge, this.credentials, this.customer, this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements ChargeStage, CredentialsStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldPaymentConfig other) { provider(other.getProvider()); charge(other.getCharge()); @@ -159,60 +159,60 @@ public Builder from(FormFieldPaymentConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("charge") public CredentialsStage charge(@NotNull FormFieldPaymentConfigCharge charge) { this.charge = Objects.requireNonNull(charge, "charge must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull FormFieldPaymentConfigCredentials credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage fields(FormFieldPaymentConfigFields fields) { this.fields = Optional.ofNullable(fields); return this; } - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public _FinalStage customer(Map customer) { this.customer = Optional.ofNullable(customer); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customer", nulls = Nulls.SKIP) public _FinalStage customer(Optional> customer) { this.customer = customer; return this; } - @java.lang.Override + @Override public _FinalStage provider(String provider) { this.provider = Optional.ofNullable(provider); return this; } - @java.lang.Override + @Override @JsonSetter(value = "provider", nulls = Nulls.SKIP) public _FinalStage provider(Optional provider) { this.provider = provider; return this; } - @java.lang.Override + @Override public FormFieldPaymentConfig build() { return new FormFieldPaymentConfig(provider, charge, credentials, customer, fields, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java index f9fbb95ac..40bd2cf95 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigCharge && equalTo((FormFieldPaymentConfigCharge) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldPaymentConfigCharge other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigChargeOneOffOneOffAmount @@ -50,12 +50,12 @@ private boolean equalTo(FormFieldPaymentConfigChargeOneOffOneOffAmount other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getSubscription() { return subscription; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigChargeSubscription @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldPaymentConfigChargeSubscription other) { return type.equals(other.type) && subscription.equals(other.subscription); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.subscription); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,27 +101,27 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldPaymentConfigChargeSubscription other) { type(other.getType()); subscription(other.getSubscription()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage subscription(String key, Object value) { this.subscription.put(key, value); return this; } - @java.lang.Override + @Override public _FinalStage putAllSubscription(Map subscription) { if (subscription != null) { this.subscription.putAll(subscription); @@ -129,7 +129,7 @@ public _FinalStage putAllSubscription(Map subscription) { return this; } - @java.lang.Override + @Override @JsonSetter(value = "subscription", nulls = Nulls.SKIP) public _FinalStage subscription(Map subscription) { this.subscription.clear(); @@ -139,7 +139,7 @@ public _FinalStage subscription(Map subscription) { return this; } - @java.lang.Override + @Override public FormFieldPaymentConfigChargeSubscription build() { return new FormFieldPaymentConfigChargeSubscription(type, subscription, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java index 4bfc3ba15..c614be9ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java @@ -42,7 +42,7 @@ public String getPrivateKey() { return privateKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigCredentials && equalTo((FormFieldPaymentConfigCredentials) other); @@ -57,12 +57,12 @@ private boolean equalTo(FormFieldPaymentConfigCredentials other) { return publicKey.equals(other.publicKey) && privateKey.equals(other.privateKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.publicKey, this.privateKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements PublicKeyStage, PrivateKeyStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldPaymentConfigCredentials other) { publicKey(other.getPublicKey()); privateKey(other.getPrivateKey()); return this; } - @java.lang.Override + @Override @JsonSetter("public_key") public PrivateKeyStage publicKey(@NotNull String publicKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("private_key") public _FinalStage privateKey(@NotNull String privateKey) { this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); return this; } - @java.lang.Override + @Override public FormFieldPaymentConfigCredentials build() { return new FormFieldPaymentConfigCredentials(publicKey, privateKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java index e60ac1a8c..bc37b17b2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigFieldProperties @@ -59,12 +59,12 @@ private boolean equalTo(FormFieldPaymentConfigFieldProperties other) { return label.equals(other.label) && placeholder.equals(other.placeholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.label, this.placeholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java index cf2cae117..dde4d0677 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java @@ -63,7 +63,7 @@ public Optional getTrustmarks() { return trustmarks; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigFields && equalTo((FormFieldPaymentConfigFields) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormFieldPaymentConfigFields other) { && trustmarks.equals(other.trustmarks); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.cardNumber, this.expirationDate, this.securityCode, this.trustmarks); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java index 8c4eb19ad..c420d1516 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldSocial && equalTo((FormFieldSocial) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldSocial other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldSocial other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldSocial other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldSocialConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldSocial build() { return new FormFieldSocial( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java index 8148ad2df..c7e51055b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java @@ -21,7 +21,7 @@ private FormFieldSocialConfig(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldSocialConfig; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java index ea547e5ff..b5b1faa4a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTel && equalTo((FormFieldTel) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldTel other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldTel other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldTel other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldTelConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldTel build() { return new FormFieldTel(id, category, type, config, label, hint, required, sensitive, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java index 850208153..b5059ad61 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java @@ -81,7 +81,7 @@ public Optional getStrings() { return strings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTelConfig && equalTo((FormFieldTelConfig) other); @@ -101,13 +101,13 @@ private boolean equalTo(FormFieldTelConfig other) { && strings.equals(other.strings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.defaultValue, this.placeholder, this.minLength, this.maxLength, this.countryPicker, this.strings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java index b142adc2f..f84fca7b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java @@ -34,7 +34,7 @@ public Optional getFilterPlaceholder() { return filterPlaceholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTelConfigStrings && equalTo((FormFieldTelConfigStrings) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldTelConfigStrings other) { return filterPlaceholder.equals(other.filterPlaceholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.filterPlaceholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java index a8e8d8b42..6e85de3b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldText && equalTo((FormFieldText) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldText other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldText other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldText other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldTextConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldText build() { return new FormFieldText( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java index 18acecdba..5db8d680b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java @@ -72,7 +72,7 @@ public Optional getMaxLength() { return maxLength; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTextConfig && equalTo((FormFieldTextConfig) other); @@ -91,12 +91,12 @@ private boolean equalTo(FormFieldTextConfig other) { && maxLength.equals(other.maxLength); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.multiline, this.defaultValue, this.placeholder, this.minLength, this.maxLength); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java index 3b6775c9f..60f5572e8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldUrl && equalTo((FormFieldUrl) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldUrl other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormFieldUrl other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldUrl other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public _FinalStage config(FormFieldUrlConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public FormFieldUrl build() { return new FormFieldUrl(id, category, type, config, label, hint, required, sensitive, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java index 3ade6fdbd..2dec42fa2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldUrlConfig && equalTo((FormFieldUrlConfig) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldUrlConfig other) { return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlow.java b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java index b2cf724a7..8140f5156 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java @@ -73,7 +73,7 @@ public FormFlowConfig getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFlow && equalTo((FormFlow) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormFlow other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, ConfigStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(FormFlow other) { id(other.getId()); type(other.getType()); @@ -159,54 +159,54 @@ public Builder from(FormFlow other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormFlowConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @java.lang.Override + @Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @java.lang.Override + @Override public FormFlow build() { return new FormFlow(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java index 27e810319..1c4969e17 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java @@ -44,7 +44,7 @@ public Optional getNextNode() { return nextNode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFlowConfig && equalTo((FormFlowConfig) other); @@ -59,12 +59,12 @@ private boolean equalTo(FormFlowConfig other) { return flowId.equals(other.flowId) && nextNode.equals(other.nextNode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.flowId, this.nextNode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements FlowIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormFlowConfig other) { flowId(other.getFlowId()); nextNode(other.getNextNode()); return this; } - @java.lang.Override + @Override @JsonSetter("flow_id") public _FinalStage flowId(@NotNull String flowId) { this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage nextNode(FormNodePointer nextNode) { this.nextNode = Optional.ofNullable(nextNode); return this; } - @java.lang.Override + @Override @JsonSetter(value = "next_node", nulls = Nulls.SKIP) public _FinalStage nextNode(Optional nextNode) { this.nextNode = nextNode; return this; } - @java.lang.Override + @Override public FormFlowConfig build() { return new FormFlowConfig(flowId, nextNode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java index 04a0f3ec3..568d2313e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java @@ -43,7 +43,7 @@ public Optional getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormHiddenField && equalTo((FormHiddenField) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormHiddenField other) { return key.equals(other.key) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.key, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,34 +97,34 @@ public static final class Builder implements KeyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormHiddenField other) { key(other.getKey()); value(other.getValue()); return this; } - @java.lang.Override + @Override @JsonSetter("key") public _FinalStage key(@NotNull String key) { this.key = Objects.requireNonNull(key, "key must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @java.lang.Override + @Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @java.lang.Override + @Override public FormHiddenField build() { return new FormHiddenField(key, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java index 747cf6895..404167ef7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java @@ -43,7 +43,7 @@ public Optional getDefault() { return default_; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormLanguages && equalTo((FormLanguages) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormLanguages other) { return primary.equals(other.primary) && default_.equals(other.default_); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.primary, this.default_); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormMessages.java b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java index 712300574..14b683da8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormMessages.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java @@ -20,15 +20,15 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = FormMessages.Builder.class) public final class FormMessages { - private final Optional> errors; + private final Optional> errors; - private final Optional> custom; + private final Optional> custom; private final Map additionalProperties; private FormMessages( - Optional> errors, - Optional> custom, + Optional> errors, + Optional> custom, Map additionalProperties) { this.errors = errors; this.custom = custom; @@ -36,16 +36,16 @@ private FormMessages( } @JsonProperty("errors") - public Optional> getErrors() { + public Optional> getErrors() { return errors; } @JsonProperty("custom") - public Optional> getCustom() { + public Optional> getCustom() { return custom; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormMessages && equalTo((FormMessages) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormMessages other) { return errors.equals(other.errors) && custom.equals(other.custom); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.errors, this.custom); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -76,9 +76,9 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> errors = Optional.empty(); + private Optional> errors = Optional.empty(); - private Optional> custom = Optional.empty(); + private Optional> custom = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,23 +92,23 @@ public Builder from(FormMessages other) { } @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public Builder errors(Optional> errors) { + public Builder errors(Optional> errors) { this.errors = errors; return this; } - public Builder errors(Map errors) { + public Builder errors(Map errors) { this.errors = Optional.ofNullable(errors); return this; } @JsonSetter(value = "custom", nulls = Nulls.SKIP) - public Builder custom(Optional> custom) { + public Builder custom(Optional> custom) { this.custom = custom; return this; } - public Builder custom(Map custom) { + public Builder custom(Map custom) { this.custom = Optional.ofNullable(custom); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNode.java b/src/main/java/com/auth0/client/mgmt/types/FormNode.java index 7e0be4d13..8ec1d090d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNode.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNode && equalTo((FormNode) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormNode other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormNode.class); } - @java.lang.Override + @Override public FormNode deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java index 3dd9fcf17..0613f9e70 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java @@ -40,7 +40,7 @@ public int getY() { return y; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNodeCoordinates && equalTo((FormNodeCoordinates) other); @@ -55,12 +55,12 @@ private boolean equalTo(FormNodeCoordinates other) { return x == other.x && y == other.y; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.x, this.y); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements XStage, YStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormNodeCoordinates other) { x(other.getX()); y(other.getY()); return this; } - @java.lang.Override + @Override @JsonSetter("x") public YStage x(int x) { this.x = x; return this; } - @java.lang.Override + @Override @JsonSetter("y") public _FinalStage y(int y) { this.y = y; return this; } - @java.lang.Override + @Override public FormNodeCoordinates build() { return new FormNodeCoordinates(x, y, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java index 0486c3a3e..ba8cdd49e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java @@ -40,7 +40,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNodePointer && equalTo((FormNodePointer) other); @@ -50,12 +50,12 @@ private boolean equalTo(FormNodePointer other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer { super(FormNodePointer.class); } - @java.lang.Override + @Override public FormNodePointer deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouter.java b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java index 378da08d7..b5ef1f7dd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouter.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java @@ -73,7 +73,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouter && equalTo((FormRouter) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormRouter other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormRouter other) { id(other.getId()); type(other.getType()); @@ -159,60 +159,60 @@ public Builder from(FormRouter other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormRouterConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @java.lang.Override + @Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @java.lang.Override + @Override public FormRouter build() { return new FormRouter(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java index a6c450ea7..b8e63a32c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java @@ -46,7 +46,7 @@ public Optional getFallback() { return fallback; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouterConfig && equalTo((FormRouterConfig) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormRouterConfig other) { return rules.equals(other.rules) && fallback.equals(other.fallback); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.rules, this.fallback); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java index ea3f83563..da9f26101 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java @@ -55,7 +55,7 @@ public Optional getNextNode() { return nextNode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouterRule && equalTo((FormRouterRule) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormRouterRule other) { return id.equals(other.id) && alias.equals(other.alias) && nextNode.equals(other.nextNode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.alias, this.nextNode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormRouterRule other) { id(other.getId()); alias(other.getAlias()); @@ -123,40 +123,40 @@ public Builder from(FormRouterRule other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage nextNode(FormNodePointer nextNode) { this.nextNode = Optional.ofNullable(nextNode); return this; } - @java.lang.Override + @Override @JsonSetter(value = "next_node", nulls = Nulls.SKIP) public _FinalStage nextNode(Optional nextNode) { this.nextNode = nextNode; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public FormRouterRule build() { return new FormRouterRule(id, alias, nextNode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java index 5777adaad..b0df1203f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java @@ -55,7 +55,7 @@ public Optional getCoordinates() { return coordinates; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStartNode && equalTo((FormStartNode) other); @@ -72,12 +72,12 @@ private boolean equalTo(FormStartNode other) { && coordinates.equals(other.coordinates); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hiddenFields, this.nextNode, this.coordinates); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStep.java b/src/main/java/com/auth0/client/mgmt/types/FormStep.java index d8adc9b71..a0cbd6cb1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStep.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStep.java @@ -73,7 +73,7 @@ public Optional getConfig() { return config; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStep && equalTo((FormStep) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormStep other) { && config.equals(other.config); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormStep other) { id(other.getId()); type(other.getType()); @@ -159,60 +159,60 @@ public Builder from(FormStep other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage config(FormStepConfig config) { this.config = Optional.ofNullable(config); return this; } - @java.lang.Override + @Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @java.lang.Override + @Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @java.lang.Override + @Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @java.lang.Override + @Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @java.lang.Override + @Override public FormStep build() { return new FormStep(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java index 7b61890cf..c0dc5bcac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java @@ -46,7 +46,7 @@ public Optional getNextNode() { return nextNode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStepConfig && equalTo((FormStepConfig) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormStepConfig other) { return components.equals(other.components) && nextNode.equals(other.nextNode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.components, this.nextNode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java index f90d8dbbd..3ab3c11c8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStyle.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java @@ -34,7 +34,7 @@ public Optional getCss() { return css; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStyle && equalTo((FormStyle) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormStyle other) { return css.equals(other.css); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.css); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormSummary.java b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java index e7dca63d4..d499073f8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java @@ -83,7 +83,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormSummary && equalTo((FormSummary) other); @@ -103,12 +103,12 @@ private boolean equalTo(FormSummary other) { && submittedAt.equals(other.submittedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.embeddedAt, this.submittedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +166,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormSummary other) { id(other.getId()); name(other.getName()); @@ -177,61 +177,61 @@ public Builder from(FormSummary other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @java.lang.Override + @Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @java.lang.Override + @Override public FormSummary build() { return new FormSummary(id, name, createdAt, updatedAt, embeddedAt, submittedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidget.java b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java index 7fc550a16..13feebd10 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidget.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidget && equalTo((FormWidget) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormWidget other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormWidget.class); } - @java.lang.Override + @Override public FormWidget deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java index eea18bb7a..7ed510106 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetAuth0VerifiableCredentials @@ -123,13 +123,13 @@ private boolean equalTo(FormWidgetAuth0VerifiableCredentials other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -199,7 +199,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetAuth0VerifiableCredentials other) { id(other.getId()); category(other.getCategory()); @@ -212,87 +212,87 @@ public Builder from(FormWidgetAuth0VerifiableCredentials other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetAuth0VerifiableCredentialsConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormWidgetAuth0VerifiableCredentials build() { return new FormWidgetAuth0VerifiableCredentials( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java index 89fe92e76..b08fadca7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java @@ -82,7 +82,7 @@ public Optional getMaxWait() { return maxWait; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetAuth0VerifiableCredentialsConfig @@ -103,13 +103,13 @@ private boolean equalTo(FormWidgetAuth0VerifiableCredentialsConfig other) { && maxWait.equals(other.maxWait); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.url, this.size, this.alternateText, this.accessToken, this.verificationId, this.maxWait); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -168,7 +168,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetAuth0VerifiableCredentialsConfig other) { url(other.getUrl()); size(other.getSize()); @@ -179,61 +179,61 @@ public Builder from(FormWidgetAuth0VerifiableCredentialsConfig other) { return this; } - @java.lang.Override + @Override @JsonSetter("url") public AlternateTextStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("alternate_text") public AccessTokenStage alternateText(@NotNull String alternateText) { this.alternateText = Objects.requireNonNull(alternateText, "alternateText must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("access_token") public VerificationIdStage accessToken(@NotNull String accessToken) { this.accessToken = Objects.requireNonNull(accessToken, "accessToken must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("verification_id") public _FinalStage verificationId(@NotNull String verificationId) { this.verificationId = Objects.requireNonNull(verificationId, "verificationId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage maxWait(Double maxWait) { this.maxWait = Optional.ofNullable(maxWait); return this; } - @java.lang.Override + @Override @JsonSetter(value = "max_wait", nulls = Nulls.SKIP) public _FinalStage maxWait(Optional maxWait) { this.maxWait = maxWait; return this; } - @java.lang.Override + @Override public _FinalStage size(Double size) { this.size = Optional.ofNullable(size); return this; } - @java.lang.Override + @Override @JsonSetter(value = "size", nulls = Nulls.SKIP) public _FinalStage size(Optional size) { this.size = size; return this; } - @java.lang.Override + @Override public FormWidgetAuth0VerifiableCredentialsConfig build() { return new FormWidgetAuth0VerifiableCredentialsConfig( url, size, alternateText, accessToken, verificationId, maxWait, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java index f532695ae..2ccad8113 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetGMapsAddress && equalTo((FormWidgetGMapsAddress) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormWidgetGMapsAddress other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetGMapsAddress other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormWidgetGMapsAddress other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetGMapsAddressConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormWidgetGMapsAddress build() { return new FormWidgetGMapsAddress( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java index 380619e1e..2d5e91882 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java @@ -33,7 +33,7 @@ public String getApiKey() { return apiKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetGMapsAddressConfig && equalTo((FormWidgetGMapsAddressConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormWidgetGMapsAddressConfig other) { return apiKey.equals(other.apiKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apiKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ApiKeyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetGMapsAddressConfig other) { apiKey(other.getApiKey()); return this; } - @java.lang.Override + @Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @java.lang.Override + @Override public FormWidgetGMapsAddressConfig build() { return new FormWidgetGMapsAddressConfig(apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java index ad4e811a7..0d4e2bae3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetRecaptcha && equalTo((FormWidgetRecaptcha) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormWidgetRecaptcha other) { && sensitive.equals(other.sensitive); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetRecaptcha other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormWidgetRecaptcha other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetRecaptchaConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @java.lang.Override + @Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @java.lang.Override + @Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @java.lang.Override + @Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @java.lang.Override + @Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @java.lang.Override + @Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @java.lang.Override + @Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @java.lang.Override + @Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @java.lang.Override + @Override public FormWidgetRecaptcha build() { return new FormWidgetRecaptcha( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java index eb3212400..6ef6754c6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java @@ -41,7 +41,7 @@ public String getSecretKey() { return secretKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetRecaptchaConfig && equalTo((FormWidgetRecaptchaConfig) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormWidgetRecaptchaConfig other) { return siteKey.equals(other.siteKey) && secretKey.equals(other.secretKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.siteKey, this.secretKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements SiteKeyStage, SecretKeyStage, _Fina private Builder() {} - @java.lang.Override + @Override public Builder from(FormWidgetRecaptchaConfig other) { siteKey(other.getSiteKey()); secretKey(other.getSecretKey()); return this; } - @java.lang.Override + @Override @JsonSetter("site_key") public SecretKeyStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("secret_key") public _FinalStage secretKey(@NotNull String secretKey) { this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); return this; } - @java.lang.Override + @Override public FormWidgetRecaptchaConfig build() { return new FormWidgetRecaptchaConfig(siteKey, secretKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java index b0d8f710c..fe1eff168 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof FormsRequestParametersHydrateEnum && this.string.equals(((FormsRequestParametersHydrateEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java index 676cf76ab..10ae0baba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java @@ -92,7 +92,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionExecutionResponseContent && equalTo((GetActionExecutionResponseContent) other); @@ -112,12 +112,12 @@ private boolean equalTo(GetActionExecutionResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.triggerId, this.status, this.results, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java index 43754419f..94bcf7e38 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java @@ -158,7 +158,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -212,7 +212,7 @@ public Optional getDeploy() { return deploy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionResponseContent && equalTo((GetActionResponseContent) other); @@ -242,7 +242,7 @@ private boolean equalTo(GetActionResponseContent other) { && deploy.equals(other.deploy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -263,7 +263,7 @@ public int hashCode() { this.deploy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -444,7 +444,7 @@ public Builder dependencies(List dependencies) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java index 7afac26dc..ba4202699 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java @@ -122,7 +122,7 @@ public Optional> getDependencies() { } /** - * @return Indicates if this speciic version is the currently one deployed. + * @return Indicates if this specific version is the currently one deployed. */ @JsonProperty("deployed") public Optional getDeployed() { @@ -130,7 +130,7 @@ public Optional getDeployed() { } /** - * @return The Node runtime. For example: node12 + * @return The Node runtime. For example: node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -203,7 +203,7 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionVersionResponseContent && equalTo((GetActionVersionResponseContent) other); @@ -232,7 +232,7 @@ private boolean equalTo(GetActionVersionResponseContent other) { && supportedTriggers.equals(other.supportedTriggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -252,7 +252,7 @@ public int hashCode() { this.supportedTriggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -374,7 +374,7 @@ public Builder dependencies(List dependencies) { } /** - *

Indicates if this speciic version is the currently one deployed.

+ *

Indicates if this specific version is the currently one deployed.

*/ @JsonSetter(value = "deployed", nulls = Nulls.SKIP) public Builder deployed(Optional deployed) { @@ -388,7 +388,7 @@ public Builder deployed(Boolean deployed) { } /** - *

The Node runtime. For example: node12

+ *

The Node runtime. For example: node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java index cbacb856f..928f67f57 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java @@ -36,12 +36,12 @@ public final class GetAculResponseContent { private final Optional defaultHeadTagsDisabled; + private final OptionalNullable usePageTemplate; + private final Optional> headTags; private final OptionalNullable filters; - private final OptionalNullable usePageTemplate; - private final Map additionalProperties; private GetAculResponseContent( @@ -51,9 +51,9 @@ private GetAculResponseContent( Optional renderingMode, Optional> contextConfiguration, Optional defaultHeadTagsDisabled, + OptionalNullable usePageTemplate, Optional> headTags, OptionalNullable filters, - OptionalNullable usePageTemplate, Map additionalProperties) { this.tenant = tenant; this.prompt = prompt; @@ -61,9 +61,9 @@ private GetAculResponseContent( this.renderingMode = renderingMode; this.contextConfiguration = contextConfiguration; this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.usePageTemplate = usePageTemplate; this.headTags = headTags; this.filters = filters; - this.usePageTemplate = usePageTemplate; this.additionalProperties = additionalProperties; } @@ -112,6 +112,18 @@ public Optional getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + /** * @return An array of head tags */ @@ -129,15 +141,9 @@ public OptionalNullable getFilters() { return filters; } - /** - * @return Use page template with ACUL - */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("use_page_template") - public OptionalNullable getUsePageTemplate() { - if (usePageTemplate == null) { - return OptionalNullable.absent(); - } + private OptionalNullable _getUsePageTemplate() { return usePageTemplate; } @@ -147,13 +153,7 @@ private OptionalNullable _getFilters() { return filters; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_page_template") - private OptionalNullable _getUsePageTemplate() { - return usePageTemplate; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetAculResponseContent && equalTo((GetAculResponseContent) other); @@ -171,12 +171,12 @@ private boolean equalTo(GetAculResponseContent other) { && renderingMode.equals(other.renderingMode) && contextConfiguration.equals(other.contextConfiguration) && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && usePageTemplate.equals(other.usePageTemplate) && headTags.equals(other.headTags) - && filters.equals(other.filters) - && usePageTemplate.equals(other.usePageTemplate); + && filters.equals(other.filters); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.tenant, @@ -185,12 +185,12 @@ public int hashCode() { this.renderingMode, this.contextConfiguration, this.defaultHeadTagsDisabled, + this.usePageTemplate, this.headTags, - this.filters, - this.usePageTemplate); + this.filters); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -213,12 +213,12 @@ public static final class Builder { private Optional defaultHeadTagsDisabled = Optional.empty(); + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + private Optional> headTags = Optional.empty(); private OptionalNullable filters = OptionalNullable.absent(); - private OptionalNullable usePageTemplate = OptionalNullable.absent(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -231,9 +231,9 @@ public Builder from(GetAculResponseContent other) { renderingMode(other.getRenderingMode()); contextConfiguration(other.getContextConfiguration()); defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + usePageTemplate(other.getUsePageTemplate()); headTags(other.getHeadTags()); filters(other.getFilters()); - usePageTemplate(other.getUsePageTemplate()); return this; } @@ -318,6 +318,40 @@ public Builder defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { return this; } + /** + *

Use page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + /** *

An array of head tags

*/ @@ -363,40 +397,6 @@ public Builder filters(com.auth0.client.mgmt.core.Nullable filters) return this; } - /** - *

Use page template with ACUL

- */ - @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) - public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { - this.usePageTemplate = usePageTemplate; - return this; - } - - public Builder usePageTemplate(Boolean usePageTemplate) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate); - return this; - } - - public Builder usePageTemplate(Optional usePageTemplate) { - if (usePageTemplate.isPresent()) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } else { - this.usePageTemplate = OptionalNullable.absent(); - } - return this; - } - - public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { - if (usePageTemplate.isNull()) { - this.usePageTemplate = OptionalNullable.ofNull(); - } else if (usePageTemplate.isEmpty()) { - this.usePageTemplate = OptionalNullable.absent(); - } else { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } - return this; - } - public GetAculResponseContent build() { return new GetAculResponseContent( tenant, @@ -405,9 +405,9 @@ public GetAculResponseContent build() { renderingMode, contextConfiguration, defaultHeadTagsDisabled, + usePageTemplate, headTags, filters, - usePageTemplate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java new file mode 100644 index 000000000..f3ab71e57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetAttackProtectionCaptchaResponseContent.Builder.class) +public final class GetAttackProtectionCaptchaResponseContent { + private final Optional activeProviderId; + + private final Optional arkose; + + private final Optional authChallenge; + + private final Optional hcaptcha; + + private final Optional friendlyCaptcha; + + private final Optional recaptchaEnterprise; + + private final Optional recaptchaV2; + + private final Optional> simpleCaptcha; + + private final Map additionalProperties; + + private GetAttackProtectionCaptchaResponseContent( + Optional activeProviderId, + Optional arkose, + Optional authChallenge, + Optional hcaptcha, + Optional friendlyCaptcha, + Optional recaptchaEnterprise, + Optional recaptchaV2, + Optional> simpleCaptcha, + Map additionalProperties) { + this.activeProviderId = activeProviderId; + this.arkose = arkose; + this.authChallenge = authChallenge; + this.hcaptcha = hcaptcha; + this.friendlyCaptcha = friendlyCaptcha; + this.recaptchaEnterprise = recaptchaEnterprise; + this.recaptchaV2 = recaptchaV2; + this.simpleCaptcha = simpleCaptcha; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active_provider_id") + public Optional getActiveProviderId() { + return activeProviderId; + } + + @JsonProperty("arkose") + public Optional getArkose() { + return arkose; + } + + @JsonProperty("auth_challenge") + public Optional getAuthChallenge() { + return authChallenge; + } + + @JsonProperty("hcaptcha") + public Optional getHcaptcha() { + return hcaptcha; + } + + @JsonProperty("friendly_captcha") + public Optional getFriendlyCaptcha() { + return friendlyCaptcha; + } + + @JsonProperty("recaptcha_enterprise") + public Optional getRecaptchaEnterprise() { + return recaptchaEnterprise; + } + + @JsonProperty("recaptcha_v2") + public Optional getRecaptchaV2() { + return recaptchaV2; + } + + @JsonProperty("simple_captcha") + public Optional> getSimpleCaptcha() { + return simpleCaptcha; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetAttackProtectionCaptchaResponseContent + && equalTo((GetAttackProtectionCaptchaResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetAttackProtectionCaptchaResponseContent other) { + return activeProviderId.equals(other.activeProviderId) + && arkose.equals(other.arkose) + && authChallenge.equals(other.authChallenge) + && hcaptcha.equals(other.hcaptcha) + && friendlyCaptcha.equals(other.friendlyCaptcha) + && recaptchaEnterprise.equals(other.recaptchaEnterprise) + && recaptchaV2.equals(other.recaptchaV2) + && simpleCaptcha.equals(other.simpleCaptcha); + } + + @Override + public int hashCode() { + return Objects.hash( + this.activeProviderId, + this.arkose, + this.authChallenge, + this.hcaptcha, + this.friendlyCaptcha, + this.recaptchaEnterprise, + this.recaptchaV2, + this.simpleCaptcha); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional activeProviderId = Optional.empty(); + + private Optional arkose = Optional.empty(); + + private Optional authChallenge = Optional.empty(); + + private Optional hcaptcha = Optional.empty(); + + private Optional friendlyCaptcha = Optional.empty(); + + private Optional recaptchaEnterprise = + Optional.empty(); + + private Optional recaptchaV2 = Optional.empty(); + + private Optional> simpleCaptcha = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetAttackProtectionCaptchaResponseContent other) { + activeProviderId(other.getActiveProviderId()); + arkose(other.getArkose()); + authChallenge(other.getAuthChallenge()); + hcaptcha(other.getHcaptcha()); + friendlyCaptcha(other.getFriendlyCaptcha()); + recaptchaEnterprise(other.getRecaptchaEnterprise()); + recaptchaV2(other.getRecaptchaV2()); + simpleCaptcha(other.getSimpleCaptcha()); + return this; + } + + @JsonSetter(value = "active_provider_id", nulls = Nulls.SKIP) + public Builder activeProviderId(Optional activeProviderId) { + this.activeProviderId = activeProviderId; + return this; + } + + public Builder activeProviderId(String activeProviderId) { + this.activeProviderId = Optional.ofNullable(activeProviderId); + return this; + } + + @JsonSetter(value = "arkose", nulls = Nulls.SKIP) + public Builder arkose(Optional arkose) { + this.arkose = arkose; + return this; + } + + public Builder arkose(AttackProtectionCaptchaArkoseResponseContent arkose) { + this.arkose = Optional.ofNullable(arkose); + return this; + } + + @JsonSetter(value = "auth_challenge", nulls = Nulls.SKIP) + public Builder authChallenge(Optional authChallenge) { + this.authChallenge = authChallenge; + return this; + } + + public Builder authChallenge(AttackProtectionCaptchaAuthChallengeResponseContent authChallenge) { + this.authChallenge = Optional.ofNullable(authChallenge); + return this; + } + + @JsonSetter(value = "hcaptcha", nulls = Nulls.SKIP) + public Builder hcaptcha(Optional hcaptcha) { + this.hcaptcha = hcaptcha; + return this; + } + + public Builder hcaptcha(AttackProtectionCaptchaHcaptchaResponseContent hcaptcha) { + this.hcaptcha = Optional.ofNullable(hcaptcha); + return this; + } + + @JsonSetter(value = "friendly_captcha", nulls = Nulls.SKIP) + public Builder friendlyCaptcha( + Optional friendlyCaptcha) { + this.friendlyCaptcha = friendlyCaptcha; + return this; + } + + public Builder friendlyCaptcha(AttackProtectionCaptchaFriendlyCaptchaResponseContent friendlyCaptcha) { + this.friendlyCaptcha = Optional.ofNullable(friendlyCaptcha); + return this; + } + + @JsonSetter(value = "recaptcha_enterprise", nulls = Nulls.SKIP) + public Builder recaptchaEnterprise( + Optional recaptchaEnterprise) { + this.recaptchaEnterprise = recaptchaEnterprise; + return this; + } + + public Builder recaptchaEnterprise( + AttackProtectionCaptchaRecaptchaEnterpriseResponseContent recaptchaEnterprise) { + this.recaptchaEnterprise = Optional.ofNullable(recaptchaEnterprise); + return this; + } + + @JsonSetter(value = "recaptcha_v2", nulls = Nulls.SKIP) + public Builder recaptchaV2(Optional recaptchaV2) { + this.recaptchaV2 = recaptchaV2; + return this; + } + + public Builder recaptchaV2(AttackProtectionCaptchaRecaptchaV2ResponseContent recaptchaV2) { + this.recaptchaV2 = Optional.ofNullable(recaptchaV2); + return this; + } + + @JsonSetter(value = "simple_captcha", nulls = Nulls.SKIP) + public Builder simpleCaptcha(Optional> simpleCaptcha) { + this.simpleCaptcha = simpleCaptcha; + return this; + } + + public Builder simpleCaptcha(Map simpleCaptcha) { + this.simpleCaptcha = Optional.ofNullable(simpleCaptcha); + return this; + } + + public GetAttackProtectionCaptchaResponseContent build() { + return new GetAttackProtectionCaptchaResponseContent( + activeProviderId, + arkose, + authChallenge, + hcaptcha, + friendlyCaptcha, + recaptchaEnterprise, + recaptchaV2, + simpleCaptcha, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java new file mode 100644 index 000000000..cada4dd7b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBotDetectionSettingsResponseContent.Builder.class) +public final class GetBotDetectionSettingsResponseContent { + private final BotDetectionLevelEnum botDetectionLevel; + + private final BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy; + + private final BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy; + + private final BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy; + + private final List allowlist; + + private final boolean monitoringModeEnabled; + + private final Map additionalProperties; + + private GetBotDetectionSettingsResponseContent( + BotDetectionLevelEnum botDetectionLevel, + BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy, + BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy, + BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy, + List allowlist, + boolean monitoringModeEnabled, + Map additionalProperties) { + this.botDetectionLevel = botDetectionLevel; + this.challengePasswordPolicy = challengePasswordPolicy; + this.challengePasswordlessPolicy = challengePasswordlessPolicy; + this.challengePasswordResetPolicy = challengePasswordResetPolicy; + this.allowlist = allowlist; + this.monitoringModeEnabled = monitoringModeEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("bot_detection_level") + public BotDetectionLevelEnum getBotDetectionLevel() { + return botDetectionLevel; + } + + @JsonProperty("challenge_password_policy") + public BotDetectionChallengePolicyPasswordFlowEnum getChallengePasswordPolicy() { + return challengePasswordPolicy; + } + + @JsonProperty("challenge_passwordless_policy") + public BotDetectionChallengePolicyPasswordlessFlowEnum getChallengePasswordlessPolicy() { + return challengePasswordlessPolicy; + } + + @JsonProperty("challenge_password_reset_policy") + public BotDetectionChallengePolicyPasswordResetFlowEnum getChallengePasswordResetPolicy() { + return challengePasswordResetPolicy; + } + + @JsonProperty("allowlist") + public List getAllowlist() { + return allowlist; + } + + @JsonProperty("monitoring_mode_enabled") + public boolean getMonitoringModeEnabled() { + return monitoringModeEnabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBotDetectionSettingsResponseContent + && equalTo((GetBotDetectionSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBotDetectionSettingsResponseContent other) { + return botDetectionLevel.equals(other.botDetectionLevel) + && challengePasswordPolicy.equals(other.challengePasswordPolicy) + && challengePasswordlessPolicy.equals(other.challengePasswordlessPolicy) + && challengePasswordResetPolicy.equals(other.challengePasswordResetPolicy) + && allowlist.equals(other.allowlist) + && monitoringModeEnabled == other.monitoringModeEnabled; + } + + @Override + public int hashCode() { + return Objects.hash( + this.botDetectionLevel, + this.challengePasswordPolicy, + this.challengePasswordlessPolicy, + this.challengePasswordResetPolicy, + this.allowlist, + this.monitoringModeEnabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BotDetectionLevelStage builder() { + return new Builder(); + } + + public interface BotDetectionLevelStage { + ChallengePasswordPolicyStage botDetectionLevel(@NotNull BotDetectionLevelEnum botDetectionLevel); + + Builder from(GetBotDetectionSettingsResponseContent other); + } + + public interface ChallengePasswordPolicyStage { + ChallengePasswordlessPolicyStage challengePasswordPolicy( + @NotNull BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy); + } + + public interface ChallengePasswordlessPolicyStage { + ChallengePasswordResetPolicyStage challengePasswordlessPolicy( + @NotNull BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy); + } + + public interface ChallengePasswordResetPolicyStage { + MonitoringModeEnabledStage challengePasswordResetPolicy( + @NotNull BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy); + } + + public interface MonitoringModeEnabledStage { + _FinalStage monitoringModeEnabled(boolean monitoringModeEnabled); + } + + public interface _FinalStage { + GetBotDetectionSettingsResponseContent build(); + + _FinalStage allowlist(List allowlist); + + _FinalStage addAllowlist(String allowlist); + + _FinalStage addAllAllowlist(List allowlist); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BotDetectionLevelStage, + ChallengePasswordPolicyStage, + ChallengePasswordlessPolicyStage, + ChallengePasswordResetPolicyStage, + MonitoringModeEnabledStage, + _FinalStage { + private BotDetectionLevelEnum botDetectionLevel; + + private BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy; + + private BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy; + + private BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy; + + private boolean monitoringModeEnabled; + + private List allowlist = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetBotDetectionSettingsResponseContent other) { + botDetectionLevel(other.getBotDetectionLevel()); + challengePasswordPolicy(other.getChallengePasswordPolicy()); + challengePasswordlessPolicy(other.getChallengePasswordlessPolicy()); + challengePasswordResetPolicy(other.getChallengePasswordResetPolicy()); + allowlist(other.getAllowlist()); + monitoringModeEnabled(other.getMonitoringModeEnabled()); + return this; + } + + @Override + @JsonSetter("bot_detection_level") + public ChallengePasswordPolicyStage botDetectionLevel(@NotNull BotDetectionLevelEnum botDetectionLevel) { + this.botDetectionLevel = Objects.requireNonNull(botDetectionLevel, "botDetectionLevel must not be null"); + return this; + } + + @Override + @JsonSetter("challenge_password_policy") + public ChallengePasswordlessPolicyStage challengePasswordPolicy( + @NotNull BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy) { + this.challengePasswordPolicy = + Objects.requireNonNull(challengePasswordPolicy, "challengePasswordPolicy must not be null"); + return this; + } + + @Override + @JsonSetter("challenge_passwordless_policy") + public ChallengePasswordResetPolicyStage challengePasswordlessPolicy( + @NotNull BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy) { + this.challengePasswordlessPolicy = + Objects.requireNonNull(challengePasswordlessPolicy, "challengePasswordlessPolicy must not be null"); + return this; + } + + @Override + @JsonSetter("challenge_password_reset_policy") + public MonitoringModeEnabledStage challengePasswordResetPolicy( + @NotNull BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy) { + this.challengePasswordResetPolicy = Objects.requireNonNull( + challengePasswordResetPolicy, "challengePasswordResetPolicy must not be null"); + return this; + } + + @Override + @JsonSetter("monitoring_mode_enabled") + public _FinalStage monitoringModeEnabled(boolean monitoringModeEnabled) { + this.monitoringModeEnabled = monitoringModeEnabled; + return this; + } + + @Override + public _FinalStage addAllAllowlist(List allowlist) { + if (allowlist != null) { + this.allowlist.addAll(allowlist); + } + return this; + } + + @Override + public _FinalStage addAllowlist(String allowlist) { + this.allowlist.add(allowlist); + return this; + } + + @Override + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public _FinalStage allowlist(List allowlist) { + this.allowlist.clear(); + if (allowlist != null) { + this.allowlist.addAll(allowlist); + } + return this; + } + + @Override + public GetBotDetectionSettingsResponseContent build() { + return new GetBotDetectionSettingsResponseContent( + botDetectionLevel, + challengePasswordPolicy, + challengePasswordlessPolicy, + challengePasswordResetPolicy, + allowlist, + monitoringModeEnabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java index 3309725f6..52bc980ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingDefaultThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(GetBrandingDefaultThemeResponseContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(GetBrandingDefaultThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(GetBrandingDefaultThemeResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @java.lang.Override + @Override public GetBrandingDefaultThemeResponseContent build() { return new GetBrandingDefaultThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java index 08f799854..919550705 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java @@ -113,7 +113,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(GetBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(GetBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(GetBrandingPhoneProviderResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @java.lang.Override + @Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public GetBrandingPhoneProviderResponseContent build() { return new GetBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java index a647a9d18..ea0d3ff9e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java @@ -69,7 +69,7 @@ public Optional getFont() { return font; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingResponseContent && equalTo((GetBrandingResponseContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(GetBrandingResponseContent other) { && font.equals(other.font); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java index 6bf26326d..575a5f242 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingThemeResponseContent && equalTo((GetBrandingThemeResponseContent) other); @@ -116,7 +116,7 @@ private boolean equalTo(GetBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.borders, @@ -128,7 +128,7 @@ public int hashCode() { this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -206,7 +206,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(GetBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -218,14 +218,14 @@ public Builder from(GetBrandingThemeResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -237,21 +237,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -263,21 +263,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @java.lang.Override + @Override public GetBrandingThemeResponseContent build() { return new GetBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java index 125b7d2cb..ad2641d20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java @@ -84,7 +84,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBreachedPasswordDetectionSettingsResponseContent @@ -104,12 +104,12 @@ private boolean equalTo(GetBreachedPasswordDetectionSettingsResponseContent othe && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java index 1efa800b0..e9d3c4245 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBruteForceSettingsResponseContent @@ -110,12 +110,12 @@ private boolean equalTo(GetBruteForceSettingsResponseContent other) { && maxAttempts.equals(other.maxAttempts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java index eac3c1ac2..8f1e54aa6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GetBruteForceSettingsResponseContentMode && this.string.equals(((GetBruteForceSettingsResponseContentMode) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java index 82a015ce8..2a32159c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GetBruteForceSettingsResponseContentShieldsItem && this.string.equals(((GetBruteForceSettingsResponseContentShieldsItem) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java index 413a65ae1..2a61bea60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(GetClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java index de80034af..8eb398a7c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientRequestParameters && equalTo((GetClientRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetClientRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java index 63fa7ef0e..61156ff1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java @@ -36,7 +36,7 @@ public final class GetClientResponseContent { private final Optional clientSecret; - private final Optional appType; + private final Optional appType; private final Optional logoUri; @@ -88,6 +88,8 @@ public final class GetClientResponseContent { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional> clientMetadata; private final Optional mobile; @@ -102,6 +104,8 @@ public final class GetClientResponseContent { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -112,10 +116,20 @@ public final class GetClientResponseContent { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; + private final Optional expressConfiguration; + + private final Optional resourceServerIdentifier; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private GetClientResponseContent( @@ -125,7 +139,7 @@ private GetClientResponseContent( Optional description, Optional global, Optional clientSecret, - Optional appType, + Optional appType, Optional logoUri, Optional isFirstParty, Optional oidcConformant, @@ -151,6 +165,7 @@ private GetClientResponseContent( Optional formTemplate, Optional addons, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional> clientMetadata, Optional mobile, Optional initiateLoginUri, @@ -158,13 +173,19 @@ private GetClientResponseContent( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, + Optional expressConfiguration, + Optional resourceServerIdentifier, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.clientId = clientId; this.tenant = tenant; @@ -198,6 +219,7 @@ private GetClientResponseContent( this.formTemplate = formTemplate; this.addons = addons; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.clientMetadata = clientMetadata; this.mobile = mobile; this.initiateLoginUri = initiateLoginUri; @@ -205,13 +227,19 @@ private GetClientResponseContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; + this.expressConfiguration = expressConfiguration; + this.resourceServerIdentifier = resourceServerIdentifier; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -263,11 +291,8 @@ public Optional getClientSecret() { return clientSecret; } - /** - * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. - */ @JsonProperty("app_type") - public Optional getAppType() { + public Optional getAppType() { return appType; } @@ -358,7 +383,7 @@ public Optional getOidcLogout() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -458,6 +483,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("client_metadata") public Optional> getClientMetadata() { return clientMetadata; @@ -504,6 +537,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -543,6 +584,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -560,6 +616,24 @@ public Optional getTokenQuota() { return tokenQuota; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -602,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientResponseContent && equalTo((GetClientResponseContent) other); @@ -646,6 +720,7 @@ private boolean equalTo(GetClientResponseContent other) { && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && clientMetadata.equals(other.clientMetadata) && mobile.equals(other.mobile) && initiateLoginUri.equals(other.initiateLoginUri) @@ -653,16 +728,23 @@ private boolean equalTo(GetClientResponseContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) - && tokenQuota.equals(other.tokenQuota); + && tokenQuota.equals(other.tokenQuota) + && expressConfiguration.equals(other.expressConfiguration) + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientId, @@ -697,6 +779,7 @@ public int hashCode() { this.formTemplate, this.addons, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.clientMetadata, this.mobile, this.initiateLoginUri, @@ -704,16 +787,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, - this.tokenQuota); + this.tokenQuota, + this.expressConfiguration, + this.resourceServerIdentifier, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -736,7 +825,7 @@ public static final class Builder { private Optional clientSecret = Optional.empty(); - private Optional appType = Optional.empty(); + private Optional appType = Optional.empty(); private Optional logoUri = Optional.empty(); @@ -788,6 +877,8 @@ public static final class Builder { private Optional tokenEndpointAuthMethod = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional> clientMetadata = Optional.empty(); private Optional mobile = Optional.empty(); @@ -802,6 +893,8 @@ public static final class Builder { private Optional organizationRequireBehavior = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -812,10 +905,21 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + + private Optional tokenExchange = Optional.empty(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); private Optional tokenQuota = Optional.empty(); + private Optional expressConfiguration = Optional.empty(); + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -854,6 +958,7 @@ public Builder from(GetClientResponseContent other) { formTemplate(other.getFormTemplate()); addons(other.getAddons()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); clientMetadata(other.getClientMetadata()); mobile(other.getMobile()); initiateLoginUri(other.getInitiateLoginUri()); @@ -861,13 +966,19 @@ public Builder from(GetClientResponseContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); + expressConfiguration(other.getExpressConfiguration()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -955,16 +1066,13 @@ public Builder clientSecret(String clientSecret) { return this; } - /** - *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

- */ @JsonSetter(value = "app_type", nulls = Nulls.SKIP) - public Builder appType(Optional appType) { + public Builder appType(Optional appType) { this.appType = appType; return this; } - public Builder appType(String appType) { + public Builder appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } @@ -1139,7 +1247,7 @@ public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1339,6 +1447,20 @@ public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEn return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public Builder clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; @@ -1461,6 +1583,22 @@ public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1564,6 +1702,36 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1609,6 +1777,44 @@ public Builder tokenQuota(TokenQuota tokenQuota) { return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public GetClientResponseContent build() { return new GetClientResponseContent( clientId, @@ -1643,6 +1849,7 @@ public GetClientResponseContent build() { formTemplate, addons, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, clientMetadata, mobile, initiateLoginUri, @@ -1650,13 +1857,19 @@ public GetClientResponseContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, + expressConfiguration, + resourceServerIdentifier, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java index bb84d0ac9..62dfc042e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java @@ -51,7 +51,7 @@ public Optional getNext() { return next; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionEnabledClientsResponseContent @@ -67,12 +67,12 @@ private boolean equalTo(GetConnectionEnabledClientsResponseContent other) { return clients.equals(other.clients) && next.equals(other.next); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clients, this.next); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java new file mode 100644 index 000000000..75e6f3bf2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java @@ -0,0 +1,258 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionProfileResponseContent.Builder.class) +public final class GetConnectionProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private GetConnectionProfileResponseContent( + Optional id, + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.id = id; + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionProfileResponseContent + && equalTo((GetConnectionProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public GetConnectionProfileResponseContent build() { + return new GetConnectionProfileResponseContent( + id, + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java new file mode 100644 index 000000000..464928d05 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetConnectionProfileTemplateResponseContent.Builder.class) +public final class GetConnectionProfileTemplateResponseContent { + private final Optional id; + + private final Optional displayName; + + private final Optional template; + + private final Map additionalProperties; + + private GetConnectionProfileTemplateResponseContent( + Optional id, + Optional displayName, + Optional template, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.template = template; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The user-friendly name of the template displayed in the UI. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetConnectionProfileTemplateResponseContent + && equalTo((GetConnectionProfileTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetConnectionProfileTemplateResponseContent other) { + return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.displayName, this.template); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional template = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetConnectionProfileTemplateResponseContent other) { + id(other.getId()); + displayName(other.getDisplayName()); + template(other.getTemplate()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The user-friendly name of the template displayed in the UI.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(ConnectionProfileTemplate template) { + this.template = Optional.ofNullable(template); + return this; + } + + public GetConnectionProfileTemplateResponseContent build() { + return new GetConnectionProfileTemplateResponseContent(id, displayName, template, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java index 51b0465ae..712374bb2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionRequestParameters && equalTo((GetConnectionRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetConnectionRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java index 9e85407b5..babad67ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -39,7 +40,11 @@ public final class GetConnectionResponseContent { private final Optional showAsButton; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -53,7 +58,9 @@ private GetConnectionResponseContent( Optional> enabledClients, Optional isDomainConnection, Optional showAsButton, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.name = name; this.displayName = displayName; @@ -65,6 +72,8 @@ private GetConnectionResponseContent( this.isDomainConnection = isDomainConnection; this.showAsButton = showAsButton; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -138,11 +147,21 @@ public Optional getShowAsButton() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } - @java.lang.Override + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionResponseContent && equalTo((GetConnectionResponseContent) other); @@ -163,10 +182,12 @@ private boolean equalTo(GetConnectionResponseContent other) { && enabledClients.equals(other.enabledClients) && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -178,10 +199,12 @@ public int hashCode() { this.enabledClients, this.isDomainConnection, this.showAsButton, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -210,7 +233,11 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -228,6 +255,8 @@ public Builder from(GetConnectionResponseContent other) { isDomainConnection(other.getIsDomainConnection()); showAsButton(other.getShowAsButton()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -355,16 +384,38 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + public GetConnectionResponseContent build() { return new GetConnectionResponseContent( name, @@ -377,6 +428,8 @@ public GetConnectionResponseContent build() { isDomainConnection, showAsButton, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java index 188311f51..d6c23fa9e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java @@ -30,6 +30,8 @@ public final class GetCustomDomainResponseContent { private final boolean primary; + private final CustomDomainStatusFilterEnum status; + private final CustomDomainTypeEnum type; private final Optional originDomainName; @@ -40,26 +42,36 @@ public final class GetCustomDomainResponseContent { private final Optional tlsPolicy; + private final Optional>> domainMetadata; + + private final Optional certificate; + private final Map additionalProperties; private GetCustomDomainResponseContent( String customDomainId, String domain, boolean primary, + CustomDomainStatusFilterEnum status, CustomDomainTypeEnum type, Optional originDomainName, Optional verification, OptionalNullable customClientIpHeader, Optional tlsPolicy, + Optional>> domainMetadata, + Optional certificate, Map additionalProperties) { this.customDomainId = customDomainId; this.domain = domain; this.primary = primary; + this.status = status; this.type = type; this.originDomainName = originDomainName; this.verification = verification; this.customClientIpHeader = customClientIpHeader; this.tlsPolicy = tlsPolicy; + this.domainMetadata = domainMetadata; + this.certificate = certificate; this.additionalProperties = additionalProperties; } @@ -87,6 +99,11 @@ public boolean getPrimary() { return primary; } + @JsonProperty("status") + public CustomDomainStatusFilterEnum getStatus() { + return status; + } + @JsonProperty("type") public CustomDomainTypeEnum getType() { return type; @@ -125,13 +142,23 @@ public Optional getTlsPolicy() { return tlsPolicy; } + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @JsonProperty("certificate") + public Optional getCertificate() { + return certificate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("custom_client_ip_header") private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetCustomDomainResponseContent && equalTo((GetCustomDomainResponseContent) other); @@ -146,27 +173,33 @@ private boolean equalTo(GetCustomDomainResponseContent other) { return customDomainId.equals(other.customDomainId) && domain.equals(other.domain) && primary == other.primary + && status.equals(other.status) && type.equals(other.type) && originDomainName.equals(other.originDomainName) && verification.equals(other.verification) && customClientIpHeader.equals(other.customClientIpHeader) - && tlsPolicy.equals(other.tlsPolicy); + && tlsPolicy.equals(other.tlsPolicy) + && domainMetadata.equals(other.domainMetadata) + && certificate.equals(other.certificate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.customDomainId, this.domain, this.primary, + this.status, this.type, this.originDomainName, this.verification, this.customClientIpHeader, - this.tlsPolicy); + this.tlsPolicy, + this.domainMetadata, + this.certificate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -195,7 +228,11 @@ public interface PrimaryStage { /** *

Whether this is a primary domain (true) or not (false).

*/ - TypeStage primary(boolean primary); + StatusStage primary(boolean primary); + } + + public interface StatusStage { + TypeStage status(@NotNull CustomDomainStatusFilterEnum status); } public interface TypeStage { @@ -233,19 +270,33 @@ public interface _FinalStage { _FinalStage tlsPolicy(Optional tlsPolicy); _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); + + _FinalStage certificate(Optional certificate); + + _FinalStage certificate(DomainCertificate certificate); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + implements CustomDomainIdStage, DomainStage, PrimaryStage, StatusStage, TypeStage, _FinalStage { private String customDomainId; private String domain; private boolean primary; + private CustomDomainStatusFilterEnum status; + private CustomDomainTypeEnum type; + private Optional certificate = Optional.empty(); + + private Optional>> domainMetadata = Optional.empty(); + private Optional tlsPolicy = Optional.empty(); private OptionalNullable customClientIpHeader = OptionalNullable.absent(); @@ -259,16 +310,19 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(GetCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); primary(other.getPrimary()); + status(other.getStatus()); type(other.getType()); originDomainName(other.getOriginDomainName()); verification(other.getVerification()); customClientIpHeader(other.getCustomClientIpHeader()); tlsPolicy(other.getTlsPolicy()); + domainMetadata(other.getDomainMetadata()); + certificate(other.getCertificate()); return this; } @@ -277,7 +331,7 @@ public Builder from(GetCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -289,7 +343,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -301,25 +355,58 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") - public TypeStage primary(boolean primary) { + public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @java.lang.Override + @Override + @JsonSetter("status") + public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } + @Override + public _FinalStage certificate(DomainCertificate certificate) { + this.certificate = Optional.ofNullable(certificate); + return this; + } + + @Override + @JsonSetter(value = "certificate", nulls = Nulls.SKIP) + public _FinalStage certificate(Optional certificate) { + this.certificate = certificate; + return this; + } + + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + /** *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -328,7 +415,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -339,7 +426,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -355,7 +442,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -369,7 +456,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -378,20 +465,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @java.lang.Override + @Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @java.lang.Override + @Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -402,7 +489,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -411,24 +498,27 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; return this; } - @java.lang.Override + @Override public GetCustomDomainResponseContent build() { return new GetCustomDomainResponseContent( customDomainId, domain, primary, + status, type, originDomainName, verification, customClientIpHeader, tlsPolicy, + domainMetadata, + certificate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java index a7392658e..0c21765ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java @@ -39,7 +39,7 @@ public Optional> getKeys() { return keys; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetCustomSigningKeysResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(GetCustomSigningKeysResponseContent other) { return keys.equals(other.keys); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.keys); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java index 5c044597e..b7c98c0bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java @@ -72,7 +72,7 @@ private OptionalNullable _getTo() { return to; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetDailyStatsRequestParameters && equalTo((GetDailyStatsRequestParameters) other); @@ -87,12 +87,12 @@ private boolean equalTo(GetDailyStatsRequestParameters other) { return from.equals(other.from) && to.equals(other.to); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.to); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java new file mode 100644 index 000000000..c3c33d1cf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetDirectoryProvisioningDefaultMappingResponseContent.Builder.class) +public final class GetDirectoryProvisioningDefaultMappingResponseContent { + private final Optional> mapping; + + private final Map additionalProperties; + + private GetDirectoryProvisioningDefaultMappingResponseContent( + Optional> mapping, Map additionalProperties) { + this.mapping = mapping; + this.additionalProperties = additionalProperties; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetDirectoryProvisioningDefaultMappingResponseContent + && equalTo((GetDirectoryProvisioningDefaultMappingResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetDirectoryProvisioningDefaultMappingResponseContent other) { + return mapping.equals(other.mapping); + } + + @Override + public int hashCode() { + return Objects.hash(this.mapping); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> mapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetDirectoryProvisioningDefaultMappingResponseContent other) { + mapping(other.getMapping()); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + public GetDirectoryProvisioningDefaultMappingResponseContent build() { + return new GetDirectoryProvisioningDefaultMappingResponseContent(mapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java new file mode 100644 index 000000000..aaee740cc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java @@ -0,0 +1,513 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetDirectoryProvisioningResponseContent.Builder.class) +public final class GetDirectoryProvisioningResponseContent { + private final String connectionId; + + private final String connectionName; + + private final String strategy; + + private final List mapping; + + private final boolean synchronizeAutomatically; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional lastSynchronizationAt; + + private final Optional lastSynchronizationStatus; + + private final Optional lastSynchronizationError; + + private final Map additionalProperties; + + private GetDirectoryProvisioningResponseContent( + String connectionId, + String connectionName, + String strategy, + List mapping, + boolean synchronizeAutomatically, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional lastSynchronizationAt, + Optional lastSynchronizationStatus, + Optional lastSynchronizationError, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.mapping = mapping; + this.synchronizeAutomatically = synchronizeAutomatically; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.lastSynchronizationAt = lastSynchronizationAt; + this.lastSynchronizationStatus = lastSynchronizationStatus; + this.lastSynchronizationError = lastSynchronizationError; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return The connection's name + */ + @JsonProperty("connection_name") + public String getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public String getStrategy() { + return strategy; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public List getMapping() { + return mapping; + } + + /** + * @return Whether periodic automatic synchronization is enabled + */ + @JsonProperty("synchronize_automatically") + public boolean getSynchronizeAutomatically() { + return synchronizeAutomatically; + } + + /** + * @return The timestamp at which the directory provisioning configuration was created + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp at which the directory provisioning configuration was last updated + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The timestamp at which the connection was last synchronized + */ + @JsonProperty("last_synchronization_at") + public Optional getLastSynchronizationAt() { + return lastSynchronizationAt; + } + + /** + * @return The status of the last synchronization + */ + @JsonProperty("last_synchronization_status") + public Optional getLastSynchronizationStatus() { + return lastSynchronizationStatus; + } + + /** + * @return The error message of the last synchronization, if any + */ + @JsonProperty("last_synchronization_error") + public Optional getLastSynchronizationError() { + return lastSynchronizationError; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetDirectoryProvisioningResponseContent + && equalTo((GetDirectoryProvisioningResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetDirectoryProvisioningResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && mapping.equals(other.mapping) + && synchronizeAutomatically == other.synchronizeAutomatically + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && lastSynchronizationAt.equals(other.lastSynchronizationAt) + && lastSynchronizationStatus.equals(other.lastSynchronizationStatus) + && lastSynchronizationError.equals(other.lastSynchronizationError); + } + + @Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.mapping, + this.synchronizeAutomatically, + this.createdAt, + this.updatedAt, + this.lastSynchronizationAt, + this.lastSynchronizationStatus, + this.lastSynchronizationError); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

The connection's identifier

+ */ + ConnectionNameStage connectionId(@NotNull String connectionId); + + Builder from(GetDirectoryProvisioningResponseContent other); + } + + public interface ConnectionNameStage { + /** + *

The connection's name

+ */ + StrategyStage connectionName(@NotNull String connectionName); + } + + public interface StrategyStage { + /** + *

The connection's strategy

+ */ + SynchronizeAutomaticallyStage strategy(@NotNull String strategy); + } + + public interface SynchronizeAutomaticallyStage { + /** + *

Whether periodic automatic synchronization is enabled

+ */ + CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically); + } + + public interface CreatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was created

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ */ + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + GetDirectoryProvisioningResponseContent build(); + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + _FinalStage mapping(List mapping); + + _FinalStage addMapping(DirectoryProvisioningMappingItem mapping); + + _FinalStage addAllMapping(List mapping); + + /** + *

The timestamp at which the connection was last synchronized

+ */ + _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt); + + _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt); + + /** + *

The status of the last synchronization

+ */ + _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus); + + _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus); + + /** + *

The error message of the last synchronization, if any

+ */ + _FinalStage lastSynchronizationError(Optional lastSynchronizationError); + + _FinalStage lastSynchronizationError(String lastSynchronizationError); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, + ConnectionNameStage, + StrategyStage, + SynchronizeAutomaticallyStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private String connectionId; + + private String connectionName; + + private String strategy; + + private boolean synchronizeAutomatically; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional lastSynchronizationError = Optional.empty(); + + private Optional lastSynchronizationStatus = Optional.empty(); + + private Optional lastSynchronizationAt = Optional.empty(); + + private List mapping = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetDirectoryProvisioningResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + mapping(other.getMapping()); + synchronizeAutomatically(other.getSynchronizeAutomatically()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + lastSynchronizationAt(other.getLastSynchronizationAt()); + lastSynchronizationStatus(other.getLastSynchronizationStatus()); + lastSynchronizationError(other.getLastSynchronizationError()); + return this; + } + + /** + *

The connection's identifier

+ *

The connection's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_id") + public ConnectionNameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

The connection's name

+ *

The connection's name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_name") + public StrategyStage connectionName(@NotNull String connectionName) { + this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); + return this; + } + + /** + *

The connection's strategy

+ *

The connection's strategy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("strategy") + public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { + this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); + return this; + } + + /** + *

Whether periodic automatic synchronization is enabled

+ *

Whether periodic automatic synchronization is enabled

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("synchronize_automatically") + public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { + this.synchronizeAutomatically = synchronizeAutomatically; + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was created

+ *

The timestamp at which the directory provisioning configuration was created

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ *

The timestamp at which the directory provisioning configuration was last updated

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationError(String lastSynchronizationError) { + this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ */ + @Override + @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { + this.lastSynchronizationError = lastSynchronizationError; + return this; + } + + /** + *

The status of the last synchronization

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { + this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); + return this; + } + + /** + *

The status of the last synchronization

+ */ + @Override + @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { + this.lastSynchronizationStatus = lastSynchronizationStatus; + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { + this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ */ + @Override + @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { + this.lastSynchronizationAt = lastSynchronizationAt; + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addAllMapping(List mapping) { + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { + this.mapping.add(mapping); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @Override + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public _FinalStage mapping(List mapping) { + this.mapping.clear(); + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + @Override + public GetDirectoryProvisioningResponseContent build() { + return new GetDirectoryProvisioningResponseContent( + connectionId, + connectionName, + strategy, + mapping, + synchronizeAutomatically, + createdAt, + updatedAt, + lastSynchronizationAt, + lastSynchronizationStatus, + lastSynchronizationError, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java index 33b76c557..27b6d6193 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailProviderResponseContent && equalTo((GetEmailProviderResponseContent) other); @@ -100,12 +100,12 @@ private boolean equalTo(GetEmailProviderResponseContent other) { && settings.equals(other.settings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java index 8907b4e80..124ca00ba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailTemplateResponseContent && equalTo((GetEmailTemplateResponseContent) other); @@ -228,7 +228,7 @@ private boolean equalTo(GetEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -242,7 +242,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java index b56881929..cd8eb0547 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEncryptionKeyResponseContent && equalTo((GetEncryptionKeyResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(GetEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -214,7 +214,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(GetEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -231,21 +231,21 @@ public Builder from(GetEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -257,7 +257,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -269,7 +269,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -281,7 +281,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -292,7 +292,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -301,14 +301,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @java.lang.Override + @Override public GetEncryptionKeyResponseContent build() { return new GetEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java index 84acb36ff..d8e957c06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEventStreamDeliveryHistoryResponseContent @@ -114,12 +114,12 @@ private boolean equalTo(GetEventStreamDeliveryHistoryResponseContent other) { && event.equals(other.event); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @java.lang.Override + @Override public Builder from(GetEventStreamDeliveryHistoryResponseContent other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -204,7 +204,7 @@ public Builder from(GetEventStreamDeliveryHistoryResponseContent other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -216,34 +216,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @java.lang.Override + @Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -254,7 +254,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -266,7 +266,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -275,7 +275,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @java.lang.Override + @Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -285,7 +285,7 @@ public _FinalStage attempts(List attempts) { return this; } - @java.lang.Override + @Override public GetEventStreamDeliveryHistoryResponseContent build() { return new GetEventStreamDeliveryHistoryResponseContent( id, eventStreamId, status, eventType, attempts, event, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java index ca3fd3d8e..d3c2683d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEventStreamResponseContent && equalTo((GetEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(GetEventStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer buckets; - - private final List metrics; - - private final Map additionalProperties; - - private GetEventStreamStatsResponseContent( - String id, - String name, - EventStreamWindow window, - List buckets, - List metrics, - Map additionalProperties) { - this.id = id; - this.name = name; - this.window = window; - this.buckets = buckets; - this.metrics = metrics; - this.additionalProperties = additionalProperties; - } - - /** - * @return Unique identifier for the event stream. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return Name of the event stream. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("window") - public EventStreamWindow getWindow() { - return window; - } - - /** - * @return Array of timestamp strings representing bucket boundaries. - */ - @JsonProperty("buckets") - public List getBuckets() { - return buckets; - } - - /** - * @return Array of metrics for the event stream. - */ - @JsonProperty("metrics") - public List getMetrics() { - return metrics; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetEventStreamStatsResponseContent - && equalTo((GetEventStreamStatsResponseContent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetEventStreamStatsResponseContent other) { - return id.equals(other.id) - && name.equals(other.name) - && window.equals(other.window) - && buckets.equals(other.buckets) - && metrics.equals(other.metrics); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.name, this.window, this.buckets, this.metrics); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

Unique identifier for the event stream.

- */ - NameStage id(@NotNull String id); - - Builder from(GetEventStreamStatsResponseContent other); - } - - public interface NameStage { - /** - *

Name of the event stream.

- */ - WindowStage name(@NotNull String name); - } - - public interface WindowStage { - _FinalStage window(@NotNull EventStreamWindow window); - } - - public interface _FinalStage { - GetEventStreamStatsResponseContent build(); - - /** - *

Array of timestamp strings representing bucket boundaries.

- */ - _FinalStage buckets(List buckets); - - _FinalStage addBuckets(OffsetDateTime buckets); - - _FinalStage addAllBuckets(List buckets); - - /** - *

Array of metrics for the event stream.

- */ - _FinalStage metrics(List metrics); - - _FinalStage addMetrics(EventStreamMetric metrics); - - _FinalStage addAllMetrics(List metrics); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, NameStage, WindowStage, _FinalStage { - private String id; - - private String name; - - private EventStreamWindow window; - - private List metrics = new ArrayList<>(); - - private List buckets = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetEventStreamStatsResponseContent other) { - id(other.getId()); - name(other.getName()); - window(other.getWindow()); - buckets(other.getBuckets()); - metrics(other.getMetrics()); - return this; - } - - /** - *

Unique identifier for the event stream.

- *

Unique identifier for the event stream.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("id") - public NameStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); - return this; - } - - /** - *

Name of the event stream.

- *

Name of the event stream.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public WindowStage name(@NotNull String name) { - this.name = Objects.requireNonNull(name, "name must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("window") - public _FinalStage window(@NotNull EventStreamWindow window) { - this.window = Objects.requireNonNull(window, "window must not be null"); - return this; - } - - /** - *

Array of metrics for the event stream.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllMetrics(List metrics) { - if (metrics != null) { - this.metrics.addAll(metrics); - } - return this; - } - - /** - *

Array of metrics for the event stream.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addMetrics(EventStreamMetric metrics) { - this.metrics.add(metrics); - return this; - } - - /** - *

Array of metrics for the event stream.

- */ - @java.lang.Override - @JsonSetter(value = "metrics", nulls = Nulls.SKIP) - public _FinalStage metrics(List metrics) { - this.metrics.clear(); - if (metrics != null) { - this.metrics.addAll(metrics); - } - return this; - } - - /** - *

Array of timestamp strings representing bucket boundaries.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllBuckets(List buckets) { - if (buckets != null) { - this.buckets.addAll(buckets); - } - return this; - } - - /** - *

Array of timestamp strings representing bucket boundaries.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addBuckets(OffsetDateTime buckets) { - this.buckets.add(buckets); - return this; - } - - /** - *

Array of timestamp strings representing bucket boundaries.

- */ - @java.lang.Override - @JsonSetter(value = "buckets", nulls = Nulls.SKIP) - public _FinalStage buckets(List buckets) { - this.buckets.clear(); - if (buckets != null) { - this.buckets.addAll(buckets); - } - return this; - } - - @java.lang.Override - public GetEventStreamStatsResponseContent build() { - return new GetEventStreamStatsResponseContent(id, name, window, buckets, metrics, additionalProperties); - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java index c30bb03d9..653ebaaae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowExecutionResponseContent.java @@ -134,7 +134,7 @@ public Optional getEndedAt() { return endedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowExecutionResponseContent && equalTo((GetFlowExecutionResponseContent) other); @@ -157,7 +157,7 @@ private boolean equalTo(GetFlowExecutionResponseContent other) { && endedAt.equals(other.endedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.endedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -272,7 +272,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(GetFlowExecutionResponseContent other) { id(other.getId()); traceId(other.getTraceId()); @@ -291,7 +291,7 @@ public Builder from(GetFlowExecutionResponseContent other) { *

Flow execution identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public TraceIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -303,7 +303,7 @@ public TraceIdStage id(@NotNull String id) { *

Trace id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("trace_id") public StatusStage traceId(@NotNull String traceId) { this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); @@ -315,7 +315,7 @@ public StatusStage traceId(@NotNull String traceId) { *

Execution status

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public CreatedAtStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -327,7 +327,7 @@ public CreatedAtStage status(@NotNull String status) { *

The ISO 8601 formatted date when this flow execution was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -339,7 +339,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this flow execution was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -350,7 +350,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The ISO 8601 formatted date when this flow execution ended.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage endedAt(OffsetDateTime endedAt) { this.endedAt = Optional.ofNullable(endedAt); return this; @@ -359,7 +359,7 @@ public _FinalStage endedAt(OffsetDateTime endedAt) { /** *

The ISO 8601 formatted date when this flow execution ended.

*/ - @java.lang.Override + @Override @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) public _FinalStage endedAt(Optional endedAt) { this.endedAt = endedAt; @@ -370,7 +370,7 @@ public _FinalStage endedAt(Optional endedAt) { *

The ISO 8601 formatted date when this flow execution started.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage startedAt(OffsetDateTime startedAt) { this.startedAt = Optional.ofNullable(startedAt); return this; @@ -379,20 +379,20 @@ public _FinalStage startedAt(OffsetDateTime startedAt) { /** *

The ISO 8601 formatted date when this flow execution started.

*/ - @java.lang.Override + @Override @JsonSetter(value = "started_at", nulls = Nulls.SKIP) public _FinalStage startedAt(Optional startedAt) { this.startedAt = startedAt; return this; } - @java.lang.Override + @Override public _FinalStage debug(Map debug) { this.debug = Optional.ofNullable(debug); return this; } - @java.lang.Override + @Override @JsonSetter(value = "debug", nulls = Nulls.SKIP) public _FinalStage debug(Optional> debug) { this.debug = debug; @@ -403,7 +403,7 @@ public _FinalStage debug(Optional> debug) { *

Journey id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage journeyId(String journeyId) { this.journeyId = Optional.ofNullable(journeyId); return this; @@ -412,14 +412,14 @@ public _FinalStage journeyId(String journeyId) { /** *

Journey id

*/ - @java.lang.Override + @Override @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) public _FinalStage journeyId(Optional journeyId) { this.journeyId = journeyId; return this; } - @java.lang.Override + @Override public GetFlowExecutionResponseContent build() { return new GetFlowExecutionResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java index e526c2f07..30c151a44 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java @@ -52,7 +52,7 @@ private Optional> _getHydrate() { return hydrate; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowRequestParameters && equalTo((GetFlowRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(GetFlowRequestParameters other) { return hydrate.equals(other.hydrate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hydrate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java index cbed07c94..e31185548 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GetFlowRequestParametersHydrateEnum && this.string.equals(((GetFlowRequestParametersHydrateEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java index 5f7ca895d..fc305f13d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowResponseContent && equalTo((GetFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(GetFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(GetFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(GetFlowResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @java.lang.Override + @Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @java.lang.Override + @Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @java.lang.Override + @Override public GetFlowResponseContent build() { return new GetFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java new file mode 100644 index 000000000..2a0055289 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetFlowsVaultConnectionResponseContent.Builder.class) +public final class GetFlowsVaultConnectionResponseContent { + private final String id; + + private final String appId; + + private final Optional environment; + + private final String name; + + private final Optional accountName; + + private final boolean ready; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional refreshedAt; + + private final String fingerprint; + + private final Map additionalProperties; + + private GetFlowsVaultConnectionResponseContent( + String id, + String appId, + Optional environment, + String name, + Optional accountName, + boolean ready, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional refreshedAt, + String fingerprint, + Map additionalProperties) { + this.id = id; + this.appId = appId; + this.environment = environment; + this.name = name; + this.accountName = accountName; + this.ready = ready; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.refreshedAt = refreshedAt; + this.fingerprint = fingerprint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Flows Vault Connection app identifier. + */ + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + /** + * @return Flows Vault Connection environment. + */ + @JsonProperty("environment") + public Optional getEnvironment() { + return environment; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Flows Vault Connection custom account name. + */ + @JsonProperty("account_name") + public Optional getAccountName() { + return accountName; + } + + /** + * @return Whether the Flows Vault Connection is configured. + */ + @JsonProperty("ready") + public boolean getReady() { + return ready; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + */ + @JsonProperty("refreshed_at") + public Optional getRefreshedAt() { + return refreshedAt; + } + + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFlowsVaultConnectionResponseContent + && equalTo((GetFlowsVaultConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetFlowsVaultConnectionResponseContent other) { + return id.equals(other.id) + && appId.equals(other.appId) + && environment.equals(other.environment) + && name.equals(other.name) + && accountName.equals(other.accountName) + && ready == other.ready + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && refreshedAt.equals(other.refreshedAt) + && fingerprint.equals(other.fingerprint); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.appId, + this.environment, + this.name, + this.accountName, + this.ready, + this.createdAt, + this.updatedAt, + this.refreshedAt, + this.fingerprint); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flows Vault Connection identifier.

+ */ + AppIdStage id(@NotNull String id); + + Builder from(GetFlowsVaultConnectionResponseContent other); + } + + public interface AppIdStage { + /** + *

Flows Vault Connection app identifier.

+ */ + NameStage appId(@NotNull String appId); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + ReadyStage name(@NotNull String name); + } + + public interface ReadyStage { + /** + *

Whether the Flows Vault Connection is configured.

+ */ + CreatedAtStage ready(boolean ready); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ */ + FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface FingerprintStage { + _FinalStage fingerprint(@NotNull String fingerprint); + } + + public interface _FinalStage { + GetFlowsVaultConnectionResponseContent build(); + + /** + *

Flows Vault Connection environment.

+ */ + _FinalStage environment(Optional environment); + + _FinalStage environment(String environment); + + /** + *

Flows Vault Connection custom account name.

+ */ + _FinalStage accountName(Optional accountName); + + _FinalStage accountName(String accountName); + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + _FinalStage refreshedAt(Optional refreshedAt); + + _FinalStage refreshedAt(OffsetDateTime refreshedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + AppIdStage, + NameStage, + ReadyStage, + CreatedAtStage, + UpdatedAtStage, + FingerprintStage, + _FinalStage { + private String id; + + private String appId; + + private String name; + + private boolean ready; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String fingerprint; + + private Optional refreshedAt = Optional.empty(); + + private Optional accountName = Optional.empty(); + + private Optional environment = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetFlowsVaultConnectionResponseContent other) { + id(other.getId()); + appId(other.getAppId()); + environment(other.getEnvironment()); + name(other.getName()); + accountName(other.getAccountName()); + ready(other.getReady()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + refreshedAt(other.getRefreshedAt()); + fingerprint(other.getFingerprint()); + return this; + } + + /** + *

Flows Vault Connection identifier.

+ *

Flows Vault Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public AppIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Flows Vault Connection app identifier.

+ *

Flows Vault Connection app identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("app_id") + public NameStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public ReadyStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Whether the Flows Vault Connection is configured.

+ *

Whether the Flows Vault Connection is configured.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("ready") + public CreatedAtStage ready(boolean ready) { + this.ready = ready; + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @Override + @JsonSetter("fingerprint") + public _FinalStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { + this.refreshedAt = Optional.ofNullable(refreshedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + @Override + @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) + public _FinalStage refreshedAt(Optional refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ */ + @Override + @JsonSetter(value = "account_name", nulls = Nulls.SKIP) + public _FinalStage accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + /** + *

Flows Vault Connection environment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage environment(String environment) { + this.environment = Optional.ofNullable(environment); + return this; + } + + /** + *

Flows Vault Connection environment.

+ */ + @Override + @JsonSetter(value = "environment", nulls = Nulls.SKIP) + public _FinalStage environment(Optional environment) { + this.environment = environment; + return this; + } + + @Override + public GetFlowsVaultConnectionResponseContent build() { + return new GetFlowsVaultConnectionResponseContent( + id, + appId, + environment, + name, + accountName, + ready, + createdAt, + updatedAt, + refreshedAt, + fingerprint, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java index 0370436da..e8c7090b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java @@ -52,7 +52,7 @@ private Optional> _getHydrate() { return hydrate; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFormRequestParameters && equalTo((GetFormRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(GetFormRequestParameters other) { return hydrate.equals(other.hydrate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hydrate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java index 61007ec41..e23c193bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java @@ -31,7 +31,7 @@ public final class GetFormResponseContent { private final Optional languages; - private final Optional> translations; + private final Optional>> translations; private final Optional> nodes; @@ -56,7 +56,7 @@ private GetFormResponseContent( String name, Optional messages, Optional languages, - Optional> translations, + Optional>> translations, Optional> nodes, Optional start, Optional ending, @@ -103,7 +103,7 @@ public Optional getLanguages() { } @JsonProperty("translations") - public Optional> getTranslations() { + public Optional>> getTranslations() { return translations; } @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFormResponseContent && equalTo((GetFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(GetFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -230,9 +230,9 @@ public interface _FinalStage { _FinalStage languages(FormLanguages languages); - _FinalStage translations(Optional> translations); + _FinalStage translations(Optional>> translations); - _FinalStage translations(Map translations); + _FinalStage translations(Map> translations); _FinalStage nodes(Optional> nodes); @@ -281,7 +281,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Optional> nodes = Optional.empty(); - private Optional> translations = Optional.empty(); + private Optional>> translations = Optional.empty(); private Optional languages = Optional.empty(); @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(GetFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(GetFormResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @java.lang.Override + @Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @java.lang.Override + @Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @java.lang.Override + @Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @java.lang.Override + @Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @java.lang.Override + @Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @java.lang.Override + @Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @java.lang.Override + @Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @java.lang.Override + @Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @java.lang.Override - public _FinalStage translations(Map translations) { + @Override + public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) - public _FinalStage translations(Optional> translations) { + public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @java.lang.Override + @Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @java.lang.Override + @Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @java.lang.Override + @Override public GetFormResponseContent build() { return new GetFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java index bf2dcd0a7..7faa7d93c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java @@ -103,7 +103,7 @@ public Optional getLastAuth() { return lastAuth; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianEnrollmentResponseContent @@ -125,13 +125,13 @@ private boolean equalTo(GetGuardianEnrollmentResponseContent other) { && lastAuth.equals(other.lastAuth); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.status, this.name, this.identifier, this.phoneNumber, this.enrolledAt, this.lastAuth); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(GetGuardianEnrollmentResponseContent other) { id(other.getId()); status(other.getStatus()); @@ -224,33 +224,33 @@ public Builder from(GetGuardianEnrollmentResponseContent other) { *

ID for this enrollment.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage lastAuth(String lastAuth) { this.lastAuth = Optional.ofNullable(lastAuth); return this; } - @java.lang.Override + @Override @JsonSetter(value = "last_auth", nulls = Nulls.SKIP) public _FinalStage lastAuth(Optional lastAuth) { this.lastAuth = lastAuth; return this; } - @java.lang.Override + @Override public _FinalStage enrolledAt(String enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -261,7 +261,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -270,7 +270,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Phone number.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -281,7 +281,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Device identifier. This is usually the phone identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage identifier(String identifier) { this.identifier = Optional.ofNullable(identifier); return this; @@ -290,7 +290,7 @@ public _FinalStage identifier(String identifier) { /** *

Device identifier. This is usually the phone identifier.

*/ - @java.lang.Override + @Override @JsonSetter(value = "identifier", nulls = Nulls.SKIP) public _FinalStage identifier(Optional identifier) { this.identifier = identifier; @@ -301,7 +301,7 @@ public _FinalStage identifier(Optional identifier) { *

Device name (only for push notification).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -310,27 +310,27 @@ public _FinalStage name(String name) { /** *

Device name (only for push notification).

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public _FinalStage status(GuardianEnrollmentStatus status) { this.status = Optional.ofNullable(status); return this; } - @java.lang.Override + @Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; return this; } - @java.lang.Override + @Override public GetGuardianEnrollmentResponseContent build() { return new GetGuardianEnrollmentResponseContent( id, status, name, identifier, phoneNumber, enrolledAt, lastAuth, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java index a400b0fd0..2599967b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(GetGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java index 9cd64efc5..583e5642f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java @@ -40,7 +40,7 @@ public Optional> getMessageTypes( return messageTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorPhoneMessageTypesResponseContent @@ -56,12 +56,12 @@ private boolean equalTo(GetGuardianFactorPhoneMessageTypesResponseContent other) return messageTypes.equals(other.messageTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.messageTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java index 5a1c1ca0a..6d12c8261 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorPhoneTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(GetGuardianFactorPhoneTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(GetGuardianFactorPhoneTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(GetGuardianFactorPhoneTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public GetGuardianFactorPhoneTemplatesResponseContent build() { return new GetGuardianFactorPhoneTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java index e6402e537..f6cac4782 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorSmsTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(GetGuardianFactorSmsTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(GetGuardianFactorSmsTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(GetGuardianFactorSmsTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public GetGuardianFactorSmsTemplatesResponseContent build() { return new GetGuardianFactorSmsTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java index 96f717c2b..65a3e3f6d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java @@ -67,7 +67,7 @@ private OptionalNullable _getBundleId() { return bundleId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderApnsResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(GetGuardianFactorsProviderApnsResponseContent other) { return bundleId.equals(other.bundleId) && sandbox.equals(other.sandbox) && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bundleId, this.sandbox, this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java index 5b13c1cc4..506c629de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPhoneResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(GetGuardianFactorsProviderPhoneResponseContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java index 7d7d0543f..f5964846b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPhoneTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(GetGuardianFactorsProviderPhoneTwilioResponseContent oth && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java index ac65d4e65..b63dbfe6b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java @@ -36,7 +36,7 @@ public Optional getProv return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPushNotificationResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(GetGuardianFactorsProviderPushNotificationResponseConten return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java index 3a720f8c7..3f283abcf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSmsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(GetGuardianFactorsProviderSmsResponseContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java index 49e7e495c..7ce32a7e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSmsTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(GetGuardianFactorsProviderSmsTwilioResponseContent other && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java index 7cc96727d..67b8ad58c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(GetGuardianFactorsProviderSnsResponseContent other) { && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java index 3c3c39176..7784165b8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java @@ -50,7 +50,7 @@ private OptionalNullable _getFields() { return fields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetHookRequestParameters && equalTo((GetHookRequestParameters) other); @@ -65,12 +65,12 @@ private boolean equalTo(GetHookRequestParameters other) { return fields.equals(other.fields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java index 4c5444bd3..40107eff4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java @@ -30,7 +30,7 @@ public final class GetHookResponseContent { private final Optional script; - private final Optional> dependencies; + private final Optional> dependencies; private final Map additionalProperties; @@ -40,7 +40,7 @@ private GetHookResponseContent( Optional name, Optional enabled, Optional script, - Optional> dependencies, + Optional> dependencies, Map additionalProperties) { this.triggerId = triggerId; this.id = id; @@ -92,11 +92,11 @@ public Optional getScript() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetHookResponseContent && equalTo((GetHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(GetHookResponseContent other) { && dependencies.equals(other.dependencies); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -142,7 +142,7 @@ public static final class Builder { private Optional script = Optional.empty(); - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -230,12 +230,12 @@ public Builder script(String script) { } @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional> dependencies) { + public Builder dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } - public Builder dependencies(Map dependencies) { + public Builder dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java index 032a6928c..62dab9e67 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java @@ -49,7 +49,7 @@ public Optional> getErrors() { return errors; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobErrorResponseContent && equalTo((GetJobErrorResponseContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(GetJobErrorResponseContent other) { return user.equals(other.user) && errors.equals(other.errors); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.user, this.errors); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java index 54163273a..55fc48ab0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java @@ -100,7 +100,7 @@ public Optional getStatusDetails() { return statusDetails; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobGenericErrorResponseContent && equalTo((GetJobGenericErrorResponseContent) other); @@ -120,12 +120,12 @@ private boolean equalTo(GetJobGenericErrorResponseContent other) { && statusDetails.equals(other.statusDetails); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.statusDetails); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -201,7 +201,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(GetJobGenericErrorResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -217,7 +217,7 @@ public Builder from(GetJobGenericErrorResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -229,7 +229,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -241,7 +241,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -252,7 +252,7 @@ public _FinalStage id(@NotNull String id) { *

Status details.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage statusDetails(String statusDetails) { this.statusDetails = Optional.ofNullable(statusDetails); return this; @@ -261,7 +261,7 @@ public _FinalStage statusDetails(String statusDetails) { /** *

Status details.

*/ - @java.lang.Override + @Override @JsonSetter(value = "status_details", nulls = Nulls.SKIP) public _FinalStage statusDetails(Optional statusDetails) { this.statusDetails = statusDetails; @@ -272,7 +272,7 @@ public _FinalStage statusDetails(Optional statusDetails) { *

connection_id of the connection this job uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -281,7 +281,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection this job uses.

*/ - @java.lang.Override + @Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -292,7 +292,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -301,14 +301,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public GetJobGenericErrorResponseContent build() { return new GetJobGenericErrorResponseContent( status, type, createdAt, id, connectionId, statusDetails, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java index 679232e11..cd003037b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java @@ -63,7 +63,7 @@ public Optional getPath() { return path; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobImportUserError && equalTo((GetJobImportUserError) other); @@ -78,12 +78,12 @@ private boolean equalTo(GetJobImportUserError other) { return code.equals(other.code) && message.equals(other.message) && path.equals(other.path); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.code, this.message, this.path); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java index 8fe628481..99deea794 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java @@ -145,7 +145,7 @@ public Optional getStatusDetails() { return statusDetails; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobResponseContent && equalTo((GetJobResponseContent) other); @@ -169,7 +169,7 @@ private boolean equalTo(GetJobResponseContent other) { && statusDetails.equals(other.statusDetails); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.status, @@ -184,7 +184,7 @@ public int hashCode() { this.statusDetails); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,7 +293,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(GetJobResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -313,7 +313,7 @@ public Builder from(GetJobResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -325,7 +325,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -337,7 +337,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -348,7 +348,7 @@ public _FinalStage id(@NotNull String id) { *

Status details.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage statusDetails(String statusDetails) { this.statusDetails = Optional.ofNullable(statusDetails); return this; @@ -357,20 +357,20 @@ public _FinalStage statusDetails(String statusDetails) { /** *

Status details.

*/ - @java.lang.Override + @Override @JsonSetter(value = "status_details", nulls = Nulls.SKIP) public _FinalStage statusDetails(Optional statusDetails) { this.statusDetails = statusDetails; return this; } - @java.lang.Override + @Override public _FinalStage format(JobFileFormatEnum format) { this.format = Optional.ofNullable(format); return this; } - @java.lang.Override + @Override @JsonSetter(value = "format", nulls = Nulls.SKIP) public _FinalStage format(Optional format) { this.format = format; @@ -381,7 +381,7 @@ public _FinalStage format(Optional format) { *

Estimated time remaining before job completes.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage timeLeftSeconds(Integer timeLeftSeconds) { this.timeLeftSeconds = Optional.ofNullable(timeLeftSeconds); return this; @@ -390,7 +390,7 @@ public _FinalStage timeLeftSeconds(Integer timeLeftSeconds) { /** *

Estimated time remaining before job completes.

*/ - @java.lang.Override + @Override @JsonSetter(value = "time_left_seconds", nulls = Nulls.SKIP) public _FinalStage timeLeftSeconds(Optional timeLeftSeconds) { this.timeLeftSeconds = timeLeftSeconds; @@ -401,7 +401,7 @@ public _FinalStage timeLeftSeconds(Optional timeLeftSeconds) { *

Completion percentage of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage percentageDone(Integer percentageDone) { this.percentageDone = Optional.ofNullable(percentageDone); return this; @@ -410,7 +410,7 @@ public _FinalStage percentageDone(Integer percentageDone) { /** *

Completion percentage of this job.

*/ - @java.lang.Override + @Override @JsonSetter(value = "percentage_done", nulls = Nulls.SKIP) public _FinalStage percentageDone(Optional percentageDone) { this.percentageDone = percentageDone; @@ -421,7 +421,7 @@ public _FinalStage percentageDone(Optional percentageDone) { *

URL to download the result of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage location(String location) { this.location = Optional.ofNullable(location); return this; @@ -430,7 +430,7 @@ public _FinalStage location(String location) { /** *

URL to download the result of this job.

*/ - @java.lang.Override + @Override @JsonSetter(value = "location", nulls = Nulls.SKIP) public _FinalStage location(Optional location) { this.location = location; @@ -441,7 +441,7 @@ public _FinalStage location(Optional location) { *

connection_id of the connection this job uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -450,7 +450,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection this job uses.

*/ - @java.lang.Override + @Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -461,7 +461,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -470,14 +470,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public GetJobResponseContent build() { return new GetJobResponseContent( status, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java index 4c479c269..a83828501 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java @@ -280,7 +280,7 @@ private OptionalNullable _getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetLogResponseContent && equalTo((GetLogResponseContent) other); @@ -315,7 +315,7 @@ private boolean equalTo(GetLogResponseContent other) { && locationInfo.equals(other.locationInfo); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.date, @@ -341,7 +341,7 @@ public int hashCode() { this.locationInfo); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java index d2995b77f..68b489d05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetLogStreamResponseContent && equalTo((GetLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(GetLogStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetNetworkAclsResponseContent && equalTo((GetNetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(GetNetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java index 15e3a9781..04973447d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -28,7 +29,7 @@ public final class GetOrganizationByNameResponseContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional tokenQuota; @@ -39,7 +40,7 @@ private GetOrganizationByNameResponseContent( Optional name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional tokenQuota, Map additionalProperties) { this.id = id; @@ -81,7 +82,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -90,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationByNameResponseContent @@ -111,12 +112,12 @@ private boolean equalTo(GetOrganizationByNameResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -135,7 +136,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional tokenQuota = Optional.empty(); @@ -208,12 +209,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java index b9aaa3bb2..2120d8424 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(GetOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java new file mode 100644 index 000000000..8b31f2eb2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationDiscoveryDomainResponseContent.Builder.class) +public final class GetOrganizationDiscoveryDomainResponseContent { + private final String id; + + private final String domain; + + private final OrganizationDiscoveryDomainStatus status; + + private final String verificationTxt; + + private final String verificationHost; + + private final Map additionalProperties; + + private GetOrganizationDiscoveryDomainResponseContent( + String id, + String domain, + OrganizationDiscoveryDomainStatus status, + String verificationTxt, + String verificationHost, + Map additionalProperties) { + this.id = id; + this.domain = domain; + this.status = status; + this.verificationTxt = verificationTxt; + this.verificationHost = verificationHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization discovery domain identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public OrganizationDiscoveryDomainStatus getStatus() { + return status; + } + + /** + * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. + */ + @JsonProperty("verification_txt") + public String getVerificationTxt() { + return verificationTxt; + } + + /** + * @return The full domain where the TXT record should be added. + */ + @JsonProperty("verification_host") + public String getVerificationHost() { + return verificationHost; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationDiscoveryDomainResponseContent + && equalTo((GetOrganizationDiscoveryDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationDiscoveryDomainResponseContent other) { + return id.equals(other.id) + && domain.equals(other.domain) + && status.equals(other.status) + && verificationTxt.equals(other.verificationTxt) + && verificationHost.equals(other.verificationHost); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization discovery domain identifier.

+ */ + DomainStage id(@NotNull String id); + + Builder from(GetOrganizationDiscoveryDomainResponseContent other); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + StatusStage domain(@NotNull String domain); + } + + public interface StatusStage { + VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status); + } + + public interface VerificationTxtStage { + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ */ + VerificationHostStage verificationTxt(@NotNull String verificationTxt); + } + + public interface VerificationHostStage { + /** + *

The full domain where the TXT record should be added.

+ */ + _FinalStage verificationHost(@NotNull String verificationHost); + } + + public interface _FinalStage { + GetOrganizationDiscoveryDomainResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, DomainStage, StatusStage, VerificationTxtStage, VerificationHostStage, _FinalStage { + private String id; + + private String domain; + + private OrganizationDiscoveryDomainStatus status; + + private String verificationTxt; + + private String verificationHost; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetOrganizationDiscoveryDomainResponseContent other) { + id(other.getId()); + domain(other.getDomain()); + status(other.getStatus()); + verificationTxt(other.getVerificationTxt()); + verificationHost(other.getVerificationHost()); + return this; + } + + /** + *

Organization discovery domain identifier.

+ *

Organization discovery domain identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public DomainStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("domain") + public StatusStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + @JsonSetter("status") + public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_txt") + public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { + this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); + return this; + } + + /** + *

The full domain where the TXT record should be added.

+ *

The full domain where the TXT record should be added.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_host") + public _FinalStage verificationHost(@NotNull String verificationHost) { + this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); + return this; + } + + @Override + public GetOrganizationDiscoveryDomainResponseContent build() { + return new GetOrganizationDiscoveryDomainResponseContent( + id, domain, status, verificationTxt, verificationHost, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java index 9e33abce2..e698f6425 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationInvitationResponseContent @@ -201,7 +201,7 @@ private boolean equalTo(GetOrganizationInvitationResponseContent other) { && ticketId.equals(other.ticketId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -219,7 +219,7 @@ public int hashCode() { this.ticketId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java index db37d19ba..16227a8a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -28,7 +29,7 @@ public final class GetOrganizationResponseContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional tokenQuota; @@ -39,7 +40,7 @@ private GetOrganizationResponseContent( Optional name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional tokenQuota, Map additionalProperties) { this.id = id; @@ -81,7 +82,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -90,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationResponseContent && equalTo((GetOrganizationResponseContent) other); @@ -110,12 +111,12 @@ private boolean equalTo(GetOrganizationResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +135,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional tokenQuota = Optional.empty(); @@ -207,12 +208,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java index 501d59b70..f3358301b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetPhoneTemplateResponseContent && equalTo((GetPhoneTemplateResponseContent) other); @@ -115,13 +115,13 @@ private boolean equalTo(GetPhoneTemplateResponseContent other) { && disabled == other.disabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @java.lang.Override + @Override public Builder from(GetPhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(GetPhoneTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @java.lang.Override + @Override public GetPhoneTemplateResponseContent build() { return new GetPhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java index 57cbcae57..16988bc0c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java @@ -155,7 +155,7 @@ private OptionalNullable _getSessionId() { return sessionId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRefreshTokenResponseContent && equalTo((GetRefreshTokenResponseContent) other); @@ -180,7 +180,7 @@ private boolean equalTo(GetRefreshTokenResponseContent other) { && lastExchangedAt.equals(other.lastExchangedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -196,7 +196,7 @@ public int hashCode() { this.lastExchangedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java index 3012356f2..0f245311e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetResourceServerRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(GetResourceServerRequestParameters other) { return includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java index 703b5a06f..8a84aae84 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java @@ -58,6 +58,10 @@ public final class GetResourceServerResponseContent { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + + private final Optional clientId; + private final Map additionalProperties; private GetResourceServerResponseContent( @@ -78,6 +82,8 @@ private GetResourceServerResponseContent( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, + Optional clientId, Map additionalProperties) { this.id = id; this.name = name; @@ -96,6 +102,8 @@ private GetResourceServerResponseContent( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; + this.clientId = clientId; this.additionalProperties = additionalProperties; } @@ -229,6 +237,19 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + + /** + * @return The client ID of the client that this resource server is linked to + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -247,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetResourceServerResponseContent && equalTo((GetResourceServerResponseContent) other); @@ -275,10 +296,12 @@ private boolean equalTo(GetResourceServerResponseContent other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization) + && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -297,10 +320,12 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization, + this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -345,6 +370,10 @@ public static final class Builder { private OptionalNullable proofOfPossession = OptionalNullable.absent(); + private Optional subjectTypeAuthorization = Optional.empty(); + + private Optional clientId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -368,6 +397,8 @@ public Builder from(GetResourceServerResponseContent other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); + clientId(other.getClientId()); return this; } @@ -656,6 +687,32 @@ public Builder proofOfPossession( return this; } + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + /** + *

The client ID of the client that this resource server is linked to

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + public GetResourceServerResponseContent build() { return new GetResourceServerResponseContent( id, @@ -675,6 +732,8 @@ public GetResourceServerResponseContent build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, + clientId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java new file mode 100644 index 000000000..804d07d90 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRiskAssessmentsSettingsNewDeviceResponseContent.Builder.class) +public final class GetRiskAssessmentsSettingsNewDeviceResponseContent { + private final int rememberFor; + + private final Map additionalProperties; + + private GetRiskAssessmentsSettingsNewDeviceResponseContent( + int rememberFor, Map additionalProperties) { + this.rememberFor = rememberFor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Length of time to remember devices for, in days. + */ + @JsonProperty("remember_for") + public int getRememberFor() { + return rememberFor; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRiskAssessmentsSettingsNewDeviceResponseContent + && equalTo((GetRiskAssessmentsSettingsNewDeviceResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRiskAssessmentsSettingsNewDeviceResponseContent other) { + return rememberFor == other.rememberFor; + } + + @Override + public int hashCode() { + return Objects.hash(this.rememberFor); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RememberForStage builder() { + return new Builder(); + } + + public interface RememberForStage { + /** + *

Length of time to remember devices for, in days.

+ */ + _FinalStage rememberFor(int rememberFor); + + Builder from(GetRiskAssessmentsSettingsNewDeviceResponseContent other); + } + + public interface _FinalStage { + GetRiskAssessmentsSettingsNewDeviceResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RememberForStage, _FinalStage { + private int rememberFor; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetRiskAssessmentsSettingsNewDeviceResponseContent other) { + rememberFor(other.getRememberFor()); + return this; + } + + /** + *

Length of time to remember devices for, in days.

+ *

Length of time to remember devices for, in days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("remember_for") + public _FinalStage rememberFor(int rememberFor) { + this.rememberFor = rememberFor; + return this; + } + + @Override + public GetRiskAssessmentsSettingsNewDeviceResponseContent build() { + return new GetRiskAssessmentsSettingsNewDeviceResponseContent(rememberFor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java new file mode 100644 index 000000000..89e7b6c45 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRiskAssessmentsSettingsResponseContent.Builder.class) +public final class GetRiskAssessmentsSettingsResponseContent { + private final boolean enabled; + + private final Map additionalProperties; + + private GetRiskAssessmentsSettingsResponseContent(boolean enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not risk assessment is enabled. + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRiskAssessmentsSettingsResponseContent + && equalTo((GetRiskAssessmentsSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRiskAssessmentsSettingsResponseContent other) { + return enabled == other.enabled; + } + + @Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether or not risk assessment is enabled.

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(GetRiskAssessmentsSettingsResponseContent other); + } + + public interface _FinalStage { + GetRiskAssessmentsSettingsResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(GetRiskAssessmentsSettingsResponseContent other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Whether or not risk assessment is enabled.

+ *

Whether or not risk assessment is enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @Override + public GetRiskAssessmentsSettingsResponseContent build() { + return new GetRiskAssessmentsSettingsResponseContent(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java index 4b04ade20..835a09951 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRoleResponseContent && equalTo((GetRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(GetRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java index 0b9e31fa6..68651fb3b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRuleRequestParameters && equalTo((GetRuleRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetRuleRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java index 716fd9d72..2221c8e8a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRuleResponseContent && equalTo((GetRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(GetRuleResponseContent other) { && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java index 856daa884..cacafda90 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java @@ -39,7 +39,7 @@ public Optional> getMapping() { return mapping; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetScimConfigurationDefaultMappingResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(GetScimConfigurationDefaultMappingResponseContent other) return mapping.equals(other.mapping); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.mapping); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java index a3da02aeb..43744aeac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(GetScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java index e36cfd798..7572e9619 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java @@ -38,6 +38,8 @@ public final class GetSelfServiceProfileResponseContent { private final Optional> allowedStrategies; + private final Optional userAttributeProfileId; + private final Map additionalProperties; private GetSelfServiceProfileResponseContent( @@ -49,6 +51,7 @@ private GetSelfServiceProfileResponseContent( Optional updatedAt, Optional branding, Optional> allowedStrategies, + Optional userAttributeProfileId, Map additionalProperties) { this.id = id; this.name = name; @@ -58,6 +61,7 @@ private GetSelfServiceProfileResponseContent( this.updatedAt = updatedAt; this.branding = branding; this.allowedStrategies = allowedStrategies; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -122,7 +126,15 @@ public Optional> getAllowedStrategie return allowedStrategies; } - @java.lang.Override + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonProperty("user_attribute_profile_id") + public Optional getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSelfServiceProfileResponseContent @@ -142,10 +154,11 @@ private boolean equalTo(GetSelfServiceProfileResponseContent other) { && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && branding.equals(other.branding) - && allowedStrategies.equals(other.allowedStrategies); + && allowedStrategies.equals(other.allowedStrategies) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -155,10 +168,11 @@ public int hashCode() { this.createdAt, this.updatedAt, this.branding, - this.allowedStrategies); + this.allowedStrategies, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -185,6 +199,8 @@ public static final class Builder { private Optional> allowedStrategies = Optional.empty(); + private Optional userAttributeProfileId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -199,6 +215,7 @@ public Builder from(GetSelfServiceProfileResponseContent other) { updatedAt(other.getUpdatedAt()); branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -311,6 +328,20 @@ public Builder allowedStrategies(List all return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public Builder userAttributeProfileId(Optional userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + + public Builder userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); + return this; + } + public GetSelfServiceProfileResponseContent build() { return new GetSelfServiceProfileResponseContent( id, @@ -321,6 +352,7 @@ public GetSelfServiceProfileResponseContent build() { updatedAt, branding, allowedStrategies, + userAttributeProfileId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java index 077b05495..36a0b1c0a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java @@ -3,7 +3,9 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -17,6 +19,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = GetSessionResponseContent.Builder.class) @@ -45,6 +48,8 @@ public final class GetSessionResponseContent { private final Optional cookie; + private final OptionalNullable> sessionMetadata; + private final Map additionalProperties; private GetSessionResponseContent( @@ -60,6 +65,7 @@ private GetSessionResponseContent( Optional> clients, Optional authentication, Optional cookie, + OptionalNullable> sessionMetadata, Map additionalProperties) { this.id = id; this.userId = userId; @@ -73,6 +79,7 @@ private GetSessionResponseContent( this.clients = clients; this.authentication = authentication; this.cookie = cookie; + this.sessionMetadata = sessionMetadata; this.additionalProperties = additionalProperties; } @@ -145,7 +152,22 @@ public Optional getCookie() { return cookie; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + public OptionalNullable> getSessionMetadata() { + if (sessionMetadata == null) { + return OptionalNullable.absent(); + } + return sessionMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + private OptionalNullable> _getSessionMetadata() { + return sessionMetadata; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSessionResponseContent && equalTo((GetSessionResponseContent) other); @@ -168,10 +190,11 @@ private boolean equalTo(GetSessionResponseContent other) { && device.equals(other.device) && clients.equals(other.clients) && authentication.equals(other.authentication) - && cookie.equals(other.cookie); + && cookie.equals(other.cookie) + && sessionMetadata.equals(other.sessionMetadata); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -185,10 +208,11 @@ public int hashCode() { this.device, this.clients, this.authentication, - this.cookie); + this.cookie, + this.sessionMetadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -223,6 +247,8 @@ public static final class Builder { private Optional cookie = Optional.empty(); + private OptionalNullable> sessionMetadata = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -241,6 +267,7 @@ public Builder from(GetSessionResponseContent other) { clients(other.getClients()); authentication(other.getAuthentication()); cookie(other.getCookie()); + sessionMetadata(other.getSessionMetadata()); return this; } @@ -385,6 +412,37 @@ public Builder cookie(SessionCookieMetadata cookie) { return this; } + @JsonSetter(value = "session_metadata", nulls = Nulls.SKIP) + public Builder sessionMetadata(@Nullable OptionalNullable> sessionMetadata) { + this.sessionMetadata = sessionMetadata; + return this; + } + + public Builder sessionMetadata(Map sessionMetadata) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata); + return this; + } + + public Builder sessionMetadata(Optional> sessionMetadata) { + if (sessionMetadata.isPresent()) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } else { + this.sessionMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionMetadata(com.auth0.client.mgmt.core.Nullable> sessionMetadata) { + if (sessionMetadata.isNull()) { + this.sessionMetadata = OptionalNullable.ofNull(); + } else if (sessionMetadata.isEmpty()) { + this.sessionMetadata = OptionalNullable.absent(); + } else { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } + return this; + } + public GetSessionResponseContent build() { return new GetSessionResponseContent( id, @@ -399,6 +457,7 @@ public GetSessionResponseContent build() { clients, authentication, cookie, + sessionMetadata, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java index 7a588405f..049c1f0ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java @@ -60,7 +60,7 @@ public Optional getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSettingsResponseContent && equalTo((GetSettingsResponseContent) other); @@ -77,12 +77,12 @@ private boolean equalTo(GetSettingsResponseContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java index c53de182e..3845eb000 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java @@ -163,7 +163,7 @@ public Optional getRevokedAt() { return revokedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSigningKeysResponseContent && equalTo((GetSigningKeysResponseContent) other); @@ -189,7 +189,7 @@ private boolean equalTo(GetSigningKeysResponseContent other) { && revokedAt.equals(other.revokedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, @@ -206,7 +206,7 @@ public int hashCode() { this.revokedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -327,7 +327,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @java.lang.Override + @Override public Builder from(GetSigningKeysResponseContent other) { kid(other.getKid()); cert(other.getCert()); @@ -349,7 +349,7 @@ public Builder from(GetSigningKeysResponseContent other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -361,7 +361,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -373,7 +373,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -385,20 +385,20 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage revokedAt(SigningKeysDate revokedAt) { this.revokedAt = Optional.ofNullable(revokedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) public _FinalStage revokedAt(Optional revokedAt) { this.revokedAt = revokedAt; @@ -409,7 +409,7 @@ public _FinalStage revokedAt(Optional revokedAt) { *

True if the key is revoked

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage revoked(Boolean revoked) { this.revoked = Optional.ofNullable(revoked); return this; @@ -418,33 +418,33 @@ public _FinalStage revoked(Boolean revoked) { /** *

True if the key is revoked

*/ - @java.lang.Override + @Override @JsonSetter(value = "revoked", nulls = Nulls.SKIP) public _FinalStage revoked(Optional revoked) { this.revoked = revoked; return this; } - @java.lang.Override + @Override public _FinalStage currentUntil(SigningKeysDate currentUntil) { this.currentUntil = Optional.ofNullable(currentUntil); return this; } - @java.lang.Override + @Override @JsonSetter(value = "current_until", nulls = Nulls.SKIP) public _FinalStage currentUntil(Optional currentUntil) { this.currentUntil = currentUntil; return this; } - @java.lang.Override + @Override public _FinalStage currentSince(SigningKeysDate currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; } - @java.lang.Override + @Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -455,7 +455,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -464,7 +464,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @java.lang.Override + @Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -475,7 +475,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -484,7 +484,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @java.lang.Override + @Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -495,7 +495,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -504,7 +504,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @java.lang.Override + @Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -515,7 +515,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pkcs7(String pkcs7) { this.pkcs7 = Optional.ofNullable(pkcs7); return this; @@ -524,14 +524,14 @@ public _FinalStage pkcs7(String pkcs7) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) public _FinalStage pkcs7(Optional pkcs7) { this.pkcs7 = pkcs7; return this; } - @java.lang.Override + @Override public GetSigningKeysResponseContent build() { return new GetSigningKeysResponseContent( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java index e8571ce80..cb50f9cd8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java @@ -38,7 +38,7 @@ public Optional getAkamaiEnabled() { return akamaiEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSupplementalSignalsResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(GetSupplementalSignalsResponseContent other) { return akamaiEnabled.equals(other.akamaiEnabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java index a73e05b88..9f0d5b837 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java @@ -71,7 +71,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSuspiciousIpThrottlingSettingsResponseContent @@ -90,12 +90,12 @@ private boolean equalTo(GetSuspiciousIpThrottlingSettingsResponseContent other) && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java index dcb5ae486..144e8081a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java @@ -86,6 +86,10 @@ public final class GetTenantSettingsResponseContent { private final OptionalNullable authorizationResponseIssParameterSupported; + private final OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional resourceParameterProfile; + private final Map additionalProperties; private GetTenantSettingsResponseContent( @@ -120,6 +124,8 @@ private GetTenantSettingsResponseContent( OptionalNullable mtls, Optional pushedAuthorizationRequestsSupported, OptionalNullable authorizationResponseIssParameterSupported, + OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, + Optional resourceParameterProfile, Map additionalProperties) { this.changePassword = changePassword; this.guardianMfaPage = guardianMfaPage; @@ -152,6 +158,8 @@ private GetTenantSettingsResponseContent( this.mtls = mtls; this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.resourceParameterProfile = resourceParameterProfile; this.additionalProperties = additionalProperties; } @@ -409,6 +417,25 @@ public OptionalNullable getAuthorizationResponseIssParameterSupported() return authorizationResponseIssParameterSupported; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public OptionalNullable getSkipNonVerifiableCallbackUriConfirmationPrompt() { + if (skipNonVerifiableCallbackUriConfirmationPrompt == null) { + return OptionalNullable.absent(); + } + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("resource_parameter_profile") + public Optional getResourceParameterProfile() { + return resourceParameterProfile; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -463,7 +490,13 @@ private OptionalNullable _getAuthorizationResponseIssParameterSupported return authorizationResponseIssParameterSupported; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTenantSettingsResponseContent && equalTo((GetTenantSettingsResponseContent) other); @@ -505,10 +538,13 @@ private boolean equalTo(GetTenantSettingsResponseContent other) { && acrValuesSupported.equals(other.acrValuesSupported) && mtls.equals(other.mtls) && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) - && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && resourceParameterProfile.equals(other.resourceParameterProfile); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.changePassword, @@ -541,10 +577,12 @@ public int hashCode() { this.acrValuesSupported, this.mtls, this.pushedAuthorizationRequestsSupported, - this.authorizationResponseIssParameterSupported); + this.authorizationResponseIssParameterSupported, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.resourceParameterProfile); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -617,6 +655,10 @@ public static final class Builder { private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + private OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + + private Optional resourceParameterProfile = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -654,6 +696,8 @@ public Builder from(GetTenantSettingsResponseContent other) { mtls(other.getMtls()); pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + resourceParameterProfile(other.getResourceParameterProfile()); return this; } @@ -1250,6 +1294,61 @@ public Builder authorizationResponseIssParameterSupported( return this; } + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + @Nullable OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isPresent()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + com.auth0.client.mgmt.core.Nullable skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isNull()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.ofNull(); + } else if (skipNonVerifiableCallbackUriConfirmationPrompt.isEmpty()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } + return this; + } + + @JsonSetter(value = "resource_parameter_profile", nulls = Nulls.SKIP) + public Builder resourceParameterProfile( + Optional resourceParameterProfile) { + this.resourceParameterProfile = resourceParameterProfile; + return this; + } + + public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile resourceParameterProfile) { + this.resourceParameterProfile = Optional.ofNullable(resourceParameterProfile); + return this; + } + public GetTenantSettingsResponseContent build() { return new GetTenantSettingsResponseContent( changePassword, @@ -1283,6 +1382,8 @@ public GetTenantSettingsResponseContent build() { mtls, pushedAuthorizationRequestsSupported, authorizationResponseIssParameterSupported, + skipNonVerifiableCallbackUriConfirmationPrompt, + resourceParameterProfile, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java index 1f1fb1119..03cd85285 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(GetTokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java index 1af8321d2..1d127dc1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java @@ -37,7 +37,7 @@ public Optional getBody() { return body; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUniversalLoginTemplate && equalTo((GetUniversalLoginTemplate) other); @@ -52,12 +52,12 @@ private boolean equalTo(GetUniversalLoginTemplate other) { return body.equals(other.body); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.body); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java index aa54a7fad..baf2c9297 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUniversalLoginTemplateResponseContent @@ -50,12 +50,12 @@ private boolean equalTo(GetUniversalLoginTemplateResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer id; + + private final Optional name; + + private final Optional userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private GetUserAttributeProfileResponseContent( + Optional id, + Optional name, + Optional userId, + Optional> userAttributes, + Map additionalProperties) { + this.id = id; + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserAttributeProfileResponseContent + && equalTo((GetUserAttributeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserAttributeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && userId.equals(other.userId) + && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUserAttributeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public GetUserAttributeProfileResponseContent build() { + return new GetUserAttributeProfileResponseContent(id, name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserAttributeProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserAttributeProfileTemplateResponseContent.java new file mode 100644 index 000000000..04b638568 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserAttributeProfileTemplateResponseContent.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUserAttributeProfileTemplateResponseContent.Builder.class) +public final class GetUserAttributeProfileTemplateResponseContent { + private final Optional id; + + private final Optional displayName; + + private final Optional template; + + private final Map additionalProperties; + + private GetUserAttributeProfileTemplateResponseContent( + Optional id, + Optional displayName, + Optional template, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.template = template; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The user-friendly name of the template displayed in the UI. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserAttributeProfileTemplateResponseContent + && equalTo((GetUserAttributeProfileTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserAttributeProfileTemplateResponseContent other) { + return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.displayName, this.template); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional template = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUserAttributeProfileTemplateResponseContent other) { + id(other.getId()); + displayName(other.getDisplayName()); + template(other.getTemplate()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The user-friendly name of the template displayed in the UI.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(UserAttributeProfileTemplate template) { + this.template = Optional.ofNullable(template); + return this; + } + + public GetUserAttributeProfileTemplateResponseContent build() { + return new GetUserAttributeProfileTemplateResponseContent(id, displayName, template, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java index 404e1e46c..8db27c5b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java @@ -59,6 +59,10 @@ public final class GetUserAuthenticationMethodResponseContent { private final Optional userAgent; + private final Optional aaguid; + + private final Optional relyingPartyIdentifier; + private final Map additionalProperties; private GetUserAuthenticationMethodResponseContent( @@ -80,6 +84,8 @@ private GetUserAuthenticationMethodResponseContent( Optional credentialBackedUp, Optional identityUserId, Optional userAgent, + Optional aaguid, + Optional relyingPartyIdentifier, Map additionalProperties) { this.id = id; this.type = type; @@ -99,6 +105,8 @@ private GetUserAuthenticationMethodResponseContent( this.credentialBackedUp = credentialBackedUp; this.identityUserId = identityUserId; this.userAgent = userAgent; + this.aaguid = aaguid; + this.relyingPartyIdentifier = relyingPartyIdentifier; this.additionalProperties = additionalProperties; } @@ -237,7 +245,23 @@ public Optional getUserAgent() { return userAgent; } - @java.lang.Override + /** + * @return Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier. + */ + @JsonProperty("aaguid") + public Optional getAaguid() { + return aaguid; + } + + /** + * @return Applies to webauthn/passkey authentication methods only. The credential's relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserAuthenticationMethodResponseContent @@ -267,10 +291,12 @@ private boolean equalTo(GetUserAuthenticationMethodResponseContent other) { && credentialDeviceType.equals(other.credentialDeviceType) && credentialBackedUp.equals(other.credentialBackedUp) && identityUserId.equals(other.identityUserId) - && userAgent.equals(other.userAgent); + && userAgent.equals(other.userAgent) + && aaguid.equals(other.aaguid) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -290,10 +316,12 @@ public int hashCode() { this.credentialDeviceType, this.credentialBackedUp, this.identityUserId, - this.userAgent); + this.userAgent, + this.aaguid, + this.relyingPartyIdentifier); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -424,6 +452,20 @@ _FinalStage preferredAuthenticationMethod( _FinalStage userAgent(Optional userAgent); _FinalStage userAgent(String userAgent); + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + _FinalStage aaguid(Optional aaguid); + + _FinalStage aaguid(String aaguid); + + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -434,6 +476,10 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private OffsetDateTime createdAt; + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional aaguid = Optional.empty(); + private Optional userAgent = Optional.empty(); private Optional identityUserId = Optional.empty(); @@ -469,7 +515,7 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(GetUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -489,6 +535,8 @@ public Builder from(GetUserAuthenticationMethodResponseContent other) { credentialBackedUp(other.getCredentialBackedUp()); identityUserId(other.getIdentityUserId()); userAgent(other.getUserAgent()); + aaguid(other.getAaguid()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); return this; } @@ -497,14 +545,14 @@ public Builder from(GetUserAuthenticationMethodResponseContent other) { *

The ID of the authentication method (auto generated)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -516,18 +564,58 @@ public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { *

Authenticator creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ */ + @Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage aaguid(String aaguid) { + this.aaguid = Optional.ofNullable(aaguid); + return this; + } + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + @Override + @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) + public _FinalStage aaguid(Optional aaguid) { + this.aaguid = aaguid; + return this; + } + /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage userAgent(String userAgent) { this.userAgent = Optional.ofNullable(userAgent); return this; @@ -536,7 +624,7 @@ public _FinalStage userAgent(String userAgent) { /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

*/ - @java.lang.Override + @Override @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) public _FinalStage userAgent(Optional userAgent) { this.userAgent = userAgent; @@ -547,7 +635,7 @@ public _FinalStage userAgent(Optional userAgent) { *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage identityUserId(String identityUserId) { this.identityUserId = Optional.ofNullable(identityUserId); return this; @@ -556,7 +644,7 @@ public _FinalStage identityUserId(String identityUserId) { /** *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) public _FinalStage identityUserId(Optional identityUserId) { this.identityUserId = identityUserId; @@ -567,7 +655,7 @@ public _FinalStage identityUserId(Optional identityUserId) { *

Applies to passkeys only. Whether the credential was backed up.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); return this; @@ -576,7 +664,7 @@ public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { /** *

Applies to passkeys only. Whether the credential was backed up.

*/ - @java.lang.Override + @Override @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) public _FinalStage credentialBackedUp(Optional credentialBackedUp) { this.credentialBackedUp = credentialBackedUp; @@ -587,7 +675,7 @@ public _FinalStage credentialBackedUp(Optional credentialBackedUp) { *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage credentialDeviceType(String credentialDeviceType) { this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); return this; @@ -596,7 +684,7 @@ public _FinalStage credentialDeviceType(String credentialDeviceType) { /** *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

*/ - @java.lang.Override + @Override @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) public _FinalStage credentialDeviceType(Optional credentialDeviceType) { this.credentialDeviceType = credentialDeviceType; @@ -607,7 +695,7 @@ public _FinalStage credentialDeviceType(Optional credentialDeviceType) { *

Last authentication

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { this.lastAuthAt = Optional.ofNullable(lastAuthAt); return this; @@ -616,7 +704,7 @@ public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { /** *

Last authentication

*/ - @java.lang.Override + @Override @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) public _FinalStage lastAuthAt(Optional lastAuthAt) { this.lastAuthAt = lastAuthAt; @@ -627,7 +715,7 @@ public _FinalStage lastAuthAt(Optional lastAuthAt) { *

Enrollment date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; @@ -636,7 +724,7 @@ public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { /** *

Enrollment date

*/ - @java.lang.Override + @Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -647,7 +735,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -656,7 +744,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -667,7 +755,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The ID of the generated credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -676,7 +764,7 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The ID of the generated credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; @@ -687,7 +775,7 @@ public _FinalStage keyId(Optional keyId) { *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -696,7 +784,7 @@ public _FinalStage email(String email) { /** *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -707,7 +795,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -716,7 +804,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -727,7 +815,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage linkId(String linkId) { this.linkId = Optional.ofNullable(linkId); return this; @@ -736,21 +824,21 @@ public _FinalStage linkId(String linkId) { /** *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

*/ - @java.lang.Override + @Override @JsonSetter(value = "link_id", nulls = Nulls.SKIP) public _FinalStage linkId(Optional linkId) { this.linkId = linkId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -758,13 +846,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -776,7 +864,7 @@ public _FinalStage authenticationMethods( *

A human-readable label to identify the authentication method

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -785,7 +873,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -796,7 +884,7 @@ public _FinalStage name(Optional name) { *

The authentication method status

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage confirmed(Boolean confirmed) { this.confirmed = Optional.ofNullable(confirmed); return this; @@ -805,14 +893,14 @@ public _FinalStage confirmed(Boolean confirmed) { /** *

The authentication method status

*/ - @java.lang.Override + @Override @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) public _FinalStage confirmed(Optional confirmed) { this.confirmed = confirmed; return this; } - @java.lang.Override + @Override public GetUserAuthenticationMethodResponseContent build() { return new GetUserAuthenticationMethodResponseContent( id, @@ -833,6 +921,8 @@ public GetUserAuthenticationMethodResponseContent build() { credentialBackedUp, identityUserId, userAgent, + aaguid, + relyingPartyIdentifier, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java index a95706d17..f2c551c7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserRequestParameters && equalTo((GetUserRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetUserRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java index 497df4221..8d756d7fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserResponseContent && equalTo((GetUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(GetUserResponseContent other) { && familyName.equals(other.familyName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java index ca2fa1069..0df9f5a01 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(GetVerifiableCredentialTemplateResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Group.java b/src/main/java/com/auth0/client/mgmt/types/Group.java new file mode 100644 index 000000000..8449cf208 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/Group.java @@ -0,0 +1,429 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Group.Builder.class) +public final class Group implements IGroup { + private final Optional id; + + private final Optional name; + + private final Optional externalId; + + private final Optional connectionId; + + private final OptionalNullable organizationId; + + private final Optional tenantName; + + private final OptionalNullable description; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private Group( + Optional id, + Optional name, + Optional externalId, + Optional connectionId, + OptionalNullable organizationId, + Optional tenantName, + OptionalNullable description, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.externalId = externalId; + this.connectionId = connectionId; + this.organizationId = organizationId; + this.tenantName = tenantName; + this.description = description; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the group (service-generated). + */ + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + /** + * @return Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters. + */ + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + /** + * @return External identifier for the group, often used for SCIM synchronization. Max length of 256 characters. + */ + @JsonProperty("external_id") + @Override + public Optional getExternalId() { + return externalId; + } + + /** + * @return Identifier for the connection this group belongs to (if a connection group). + */ + @JsonProperty("connection_id") + @Override + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return Identifier for the organization this group belongs to (if an organization group). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_id") + @Override + public OptionalNullable getOrganizationId() { + if (organizationId == null) { + return OptionalNullable.absent(); + } + return organizationId; + } + + /** + * @return Identifier for the tenant this group belongs to. + */ + @JsonProperty("tenant_name") + @Override + public Optional getTenantName() { + return tenantName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + @Override + public OptionalNullable getDescription() { + if (description == null) { + return OptionalNullable.absent(); + } + return description; + } + + /** + * @return Timestamp of when the group was created. + */ + @JsonProperty("created_at") + @Override + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return Timestamp of when the group was last updated. + */ + @JsonProperty("updated_at") + @Override + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_id") + private OptionalNullable _getOrganizationId() { + return organizationId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private OptionalNullable _getDescription() { + return description; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Group && equalTo((Group) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Group other) { + return id.equals(other.id) + && name.equals(other.name) + && externalId.equals(other.externalId) + && connectionId.equals(other.connectionId) + && organizationId.equals(other.organizationId) + && tenantName.equals(other.tenantName) + && description.equals(other.description) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.externalId, + this.connectionId, + this.organizationId, + this.tenantName, + this.description, + this.createdAt, + this.updatedAt); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional externalId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private OptionalNullable organizationId = OptionalNullable.absent(); + + private Optional tenantName = Optional.empty(); + + private OptionalNullable description = OptionalNullable.absent(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Group other) { + id(other.getId()); + name(other.getName()); + externalId(other.getExternalId()); + connectionId(other.getConnectionId()); + organizationId(other.getOrganizationId()); + tenantName(other.getTenantName()); + description(other.getDescription()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

Unique identifier for the group (service-generated).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

External identifier for the group, often used for SCIM synchronization. Max length of 256 characters.

+ */ + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public Builder externalId(Optional externalId) { + this.externalId = externalId; + return this; + } + + public Builder externalId(String externalId) { + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + *

Identifier for the connection this group belongs to (if a connection group).

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

Identifier for the organization this group belongs to (if an organization group).

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(@Nullable OptionalNullable organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = OptionalNullable.of(organizationId); + return this; + } + + public Builder organizationId(Optional organizationId) { + if (organizationId.isPresent()) { + this.organizationId = OptionalNullable.of(organizationId.get()); + } else { + this.organizationId = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationId(com.auth0.client.mgmt.core.Nullable organizationId) { + if (organizationId.isNull()) { + this.organizationId = OptionalNullable.ofNull(); + } else if (organizationId.isEmpty()) { + this.organizationId = OptionalNullable.absent(); + } else { + this.organizationId = OptionalNullable.of(organizationId.get()); + } + return this; + } + + /** + *

Identifier for the tenant this group belongs to.

+ */ + @JsonSetter(value = "tenant_name", nulls = Nulls.SKIP) + public Builder tenantName(Optional tenantName) { + this.tenantName = tenantName; + return this; + } + + public Builder tenantName(String tenantName) { + this.tenantName = Optional.ofNullable(tenantName); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(@Nullable OptionalNullable description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = OptionalNullable.of(description); + return this; + } + + public Builder description(Optional description) { + if (description.isPresent()) { + this.description = OptionalNullable.of(description.get()); + } else { + this.description = OptionalNullable.absent(); + } + return this; + } + + public Builder description(com.auth0.client.mgmt.core.Nullable description) { + if (description.isNull()) { + this.description = OptionalNullable.ofNull(); + } else if (description.isEmpty()) { + this.description = OptionalNullable.absent(); + } else { + this.description = OptionalNullable.of(description.get()); + } + return this; + } + + /** + *

Timestamp of when the group was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Timestamp of when the group was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + public Group build() { + return new Group( + id, + name, + externalId, + connectionId, + organizationId, + tenantName, + description, + createdAt, + updatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java index 03409797d..ec1ea6d58 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianEnrollmentFactorEnum && this.string.equals(((GuardianEnrollmentFactorEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java index 203f74178..031cf5e15 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianEnrollmentStatus && this.string.equals(((GuardianEnrollmentStatus) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java index 8cca5a606..e53787762 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java @@ -60,7 +60,7 @@ public Optional getName() { return name; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GuardianFactor && equalTo((GuardianFactor) other); @@ -75,12 +75,12 @@ private boolean equalTo(GuardianFactor other) { return enabled == other.enabled && trialExpired.equals(other.trialExpired) && name.equals(other.name); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.trialExpired, this.name); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -126,7 +126,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(GuardianFactor other) { enabled(other.getEnabled()); trialExpired(other.getTrialExpired()); @@ -139,20 +139,20 @@ public Builder from(GuardianFactor other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @java.lang.Override + @Override public _FinalStage name(GuardianFactorNameEnum name) { this.name = Optional.ofNullable(name); return this; } - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -163,7 +163,7 @@ public _FinalStage name(Optional name) { *

Whether trial limits have been exceeded.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage trialExpired(Boolean trialExpired) { this.trialExpired = Optional.ofNullable(trialExpired); return this; @@ -172,14 +172,14 @@ public _FinalStage trialExpired(Boolean trialExpired) { /** *

Whether trial limits have been exceeded.

*/ - @java.lang.Override + @Override @JsonSetter(value = "trial_expired", nulls = Nulls.SKIP) public _FinalStage trialExpired(Optional trialExpired) { this.trialExpired = trialExpired; return this; } - @java.lang.Override + @Override public GuardianFactor build() { return new GuardianFactor(enabled, trialExpired, name, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java index 4c9117e5d..56c8300ae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java @@ -40,20 +40,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorNameEnum && this.string.equals(((GuardianFactorNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java index 028a2a4e7..523d25a4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorPhoneFactorMessageTypeEnum && this.string.equals(((GuardianFactorPhoneFactorMessageTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java index a960f2730..64bd2641e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java @@ -29,13 +29,13 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorsProviderPushNotificationProviderDataEnum @@ -43,7 +43,7 @@ public boolean equals(Object other) { ((GuardianFactorsProviderPushNotificationProviderDataEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java index d56e13452..ea488c1ce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorsProviderSmsProviderEnum && this.string.equals(((GuardianFactorsProviderSmsProviderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Hook.java b/src/main/java/com/auth0/client/mgmt/types/Hook.java index 02d25ddc1..e1f2562c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Hook.java +++ b/src/main/java/com/auth0/client/mgmt/types/Hook.java @@ -30,7 +30,7 @@ public final class Hook { private final Optional script; - private final Optional> dependencies; + private final Optional> dependencies; private final Map additionalProperties; @@ -40,7 +40,7 @@ private Hook( Optional name, Optional enabled, Optional script, - Optional> dependencies, + Optional> dependencies, Map additionalProperties) { this.triggerId = triggerId; this.id = id; @@ -92,11 +92,11 @@ public Optional getScript() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Hook && equalTo((Hook) other); @@ -116,12 +116,12 @@ private boolean equalTo(Hook other) { && dependencies.equals(other.dependencies); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -142,7 +142,7 @@ public static final class Builder { private Optional script = Optional.empty(); - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -230,12 +230,12 @@ public Builder script(String script) { } @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional> dependencies) { + public Builder dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } - public Builder dependencies(Map dependencies) { + public Builder dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java index e90d154bd..8da13d02e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java @@ -35,19 +35,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof HookTriggerIdEnum && this.string.equals(((HookTriggerIdEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java index 1764d0864..805311d43 100644 --- a/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java +++ b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java @@ -49,7 +49,7 @@ public Optional getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof HttpCustomHeader && equalTo((HttpCustomHeader) other); @@ -64,12 +64,12 @@ private boolean equalTo(HttpCustomHeader other) { return header.equals(other.header) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.header, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionCommon.java new file mode 100644 index 000000000..967fe0182 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionCommon.java @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.OptionalNullable; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public interface IConnectionCommon { + Optional getAuthentication(); + + Optional getConnectedAccounts(); + + Optional getDisplayName(); + + Optional> getEnabledClients(); + + Optional getIsDomainConnection(); + + Optional>> getMetadata(); + + Optional> getRealms(); + + Optional getShowAsButton(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommon.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommon.java new file mode 100644 index 000000000..cd00a9eca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommon.java @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import java.util.List; +import java.util.Optional; + +public interface IConnectionOptionsCommon { + Optional> getNonPersistentAttrs(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java new file mode 100644 index 000000000..ada2b3caf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.OptionalNullable; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public interface IConnectionOptionsCommonOidc { + Optional getAuthorizationEndpoint(); + + String getClientId(); + + Optional getClientSecret(); + + Optional getConnectionSettings(); + + OptionalNullable getFederatedConnectionsAccessTokens(); + + Optional> getDomainAliases(); + + Optional getIconUrl(); + + OptionalNullable> getIdTokenSignedResponseAlgs(); + + Optional getIssuer(); + + Optional getJwksUri(); + + Optional getOidcMetadata(); + + Optional getScope(); + + Optional getSendBackChannelNonce(); + + Optional getSetUserRootAttributes(); + + OptionalNullable getTenantDomain(); + + Optional getTokenEndpoint(); + + OptionalNullable getTokenEndpointAuthMethod(); + + OptionalNullable getTokenEndpointAuthSigningAlg(); + + OptionalNullable>> getUpstreamParams(); + + Optional getUserinfoEndpoint(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionResponseCommon.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionResponseCommon.java new file mode 100644 index 000000000..5f9179644 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionResponseCommon.java @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import java.util.Optional; + +public interface IConnectionResponseCommon extends ICreateConnectionCommon { + Optional getId(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ICreateConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/ICreateConnectionCommon.java new file mode 100644 index 000000000..4bc587b14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ICreateConnectionCommon.java @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import java.util.Optional; + +public interface ICreateConnectionCommon extends IConnectionCommon { + Optional getName(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IGroup.java b/src/main/java/com/auth0/client/mgmt/types/IGroup.java new file mode 100644 index 000000000..d73bc81f0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/IGroup.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.OptionalNullable; +import java.time.OffsetDateTime; +import java.util.Optional; + +public interface IGroup { + Optional getId(); + + Optional getName(); + + Optional getExternalId(); + + Optional getConnectionId(); + + OptionalNullable getOrganizationId(); + + Optional getTenantName(); + + OptionalNullable getDescription(); + + Optional getCreatedAt(); + + Optional getUpdatedAt(); +} diff --git a/src/main/java/com/auth0/client/mgmt/types/Identity.java b/src/main/java/com/auth0/client/mgmt/types/Identity.java index 3018d23f8..91db44c41 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Identity.java +++ b/src/main/java/com/auth0/client/mgmt/types/Identity.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,11 +25,18 @@ public final class Identity { private final IdentityProviderEnum provider; + private final Optional connectionId; + private final Map additionalProperties; - private Identity(String userId, IdentityProviderEnum provider, Map additionalProperties) { + private Identity( + String userId, + IdentityProviderEnum provider, + Optional connectionId, + Map additionalProperties) { this.userId = userId; this.provider = provider; + this.connectionId = connectionId; this.additionalProperties = additionalProperties; } @@ -44,7 +53,15 @@ public IdentityProviderEnum getProvider() { return provider; } - @java.lang.Override + /** + * @return connection_id of the identity. + */ + @JsonProperty("connection_id") + public Optional getConnectionId() { + return connectionId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Identity && equalTo((Identity) other); @@ -56,15 +73,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(Identity other) { - return userId.equals(other.userId) && provider.equals(other.provider); + return userId.equals(other.userId) + && provider.equals(other.provider) + && connectionId.equals(other.connectionId); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.userId, this.provider); + return Objects.hash(this.userId, this.provider, this.connectionId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,6 +107,13 @@ public interface ProviderStage { public interface _FinalStage { Identity build(); + + /** + *

connection_id of the identity.

+ */ + _FinalStage connectionId(Optional connectionId); + + _FinalStage connectionId(String connectionId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -96,15 +122,18 @@ public static final class Builder implements UserIdStage, ProviderStage, _FinalS private IdentityProviderEnum provider; + private Optional connectionId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override + @Override public Builder from(Identity other) { userId(other.getUserId()); provider(other.getProvider()); + connectionId(other.getConnectionId()); return this; } @@ -113,23 +142,43 @@ public Builder from(Identity other) { *

user_id of the identity to be verified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public ProviderStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull IdentityProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @java.lang.Override + /** + *

connection_id of the identity.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

connection_id of the identity.

+ */ + @Override + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public _FinalStage connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + @Override public Identity build() { - return new Identity(userId, provider, additionalProperties); + return new Identity(userId, provider, connectionId, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java index 38a726017..b63a6b125 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java @@ -153,19 +153,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof IdentityProviderEnum && this.string.equals(((IdentityProviderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java index aab4a35c8..39d921acc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ImportEncryptionKeyResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(ImportEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -215,7 +215,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(ImportEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -232,21 +232,21 @@ public Builder from(ImportEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -258,7 +258,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -270,7 +270,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -282,7 +282,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -293,7 +293,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -302,14 +302,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @java.lang.Override + @Override public ImportEncryptionKeyResponseContent build() { return new ImportEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/Integration.java b/src/main/java/com/auth0/client/mgmt/types/Integration.java index 647537bc9..928702f4b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Integration.java +++ b/src/main/java/com/auth0/client/mgmt/types/Integration.java @@ -190,7 +190,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Integration && equalTo((Integration) other); @@ -219,7 +219,7 @@ private boolean equalTo(Integration other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -239,7 +239,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java index 378ce1601..9e2bb89b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java @@ -37,20 +37,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof IntegrationFeatureTypeEnum && this.string.equals(((IntegrationFeatureTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java index 60f4838a4..3825a796c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java @@ -83,7 +83,7 @@ public Optional> getRequiredConfiguration() { return requiredConfiguration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRelease && equalTo((IntegrationRelease) other); @@ -102,12 +102,12 @@ private boolean equalTo(IntegrationRelease other) { && requiredConfiguration.equals(other.requiredConfiguration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.trigger, this.semver, this.requiredSecrets, this.requiredConfiguration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java index 8a8356603..210082437 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRequiredParam && equalTo((IntegrationRequiredParam) other); @@ -156,7 +156,7 @@ private boolean equalTo(IntegrationRequiredParam other) { && options.equals(other.options); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.type, @@ -170,7 +170,7 @@ public int hashCode() { this.options); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java index 29cd5ccc1..c9e267ddc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java @@ -49,7 +49,7 @@ public Optional getLabel() { return label; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRequiredParamOption && equalTo((IntegrationRequiredParamOption) other); @@ -64,12 +64,12 @@ private boolean equalTo(IntegrationRequiredParamOption other) { return value.equals(other.value) && label.equals(other.label); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.label); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java index 9c421852a..3dc8f6bbf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof IntegrationRequiredParamTypeEnum && this.string.equals(((IntegrationRequiredParamTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java index 62f0972f6..29c48b3ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java @@ -49,7 +49,7 @@ public Optional getMinor() { return minor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationSemVer && equalTo((IntegrationSemVer) other); @@ -64,12 +64,12 @@ private boolean equalTo(IntegrationSemVer other) { return major.equals(other.major) && minor.equals(other.minor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.major, this.minor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java index 5030eb5da..375cca732 100644 --- a/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof JobFileFormatEnum && this.string.equals(((JobFileFormatEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java new file mode 100644 index 000000000..dd08209df --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedClientConfiguration.Builder.class) +public final class LinkedClientConfiguration { + private final String clientId; + + private final Map additionalProperties; + + private LinkedClientConfiguration(String clientId, Map additionalProperties) { + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the linked client. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedClientConfiguration && equalTo((LinkedClientConfiguration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedClientConfiguration other) { + return clientId.equals(other.clientId); + } + + @Override + public int hashCode() { + return Objects.hash(this.clientId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The ID of the linked client.

+ */ + _FinalStage clientId(@NotNull String clientId); + + Builder from(LinkedClientConfiguration other); + } + + public interface _FinalStage { + LinkedClientConfiguration build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(LinkedClientConfiguration other) { + clientId(other.getClientId()); + return this; + } + + /** + *

The ID of the linked client.

+ *

The ID of the linked client.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @Override + public LinkedClientConfiguration build() { + return new LinkedClientConfiguration(clientId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java index 3f2a5dadd..9ef9e7aa6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getBindings() { return bindings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionBindingsPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListActionBindingsPaginatedResponseContent other) { && bindings.equals(other.bindings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.bindings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java index 85b7426c1..22d0a07be 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java @@ -36,7 +36,7 @@ public Optional> getTriggers() { return triggers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionTriggersResponseContent && equalTo((ListActionTriggersResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ListActionTriggersResponseContent other) { return triggers.equals(other.triggers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java index ecc1418e3..f4e8f3e23 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getVersions() { return versions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionVersionsPaginatedResponseContent @@ -92,12 +92,12 @@ private boolean equalTo(ListActionVersionsPaginatedResponseContent other) { && versions.equals(other.versions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.versions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java index bca8a2104..76f590287 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getActions() { return actions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionsPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListActionsPaginatedResponseContent other) { && actions.equals(other.actions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.actions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java index 2bb4d9184..67d30d285 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java @@ -96,9 +96,6 @@ public OptionalNullable getDeployed() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -141,19 +138,13 @@ private OptionalNullable _getDeployed() { return deployed; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("installed") private OptionalNullable _getInstalled() { return installed; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionsRequestParameters && equalTo((ListActionsRequestParameters) other); @@ -173,12 +164,12 @@ private boolean equalTo(ListActionsRequestParameters other) { && installed.equals(other.installed); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggerId, this.actionName, this.deployed, this.page, this.perPage, this.installed); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -322,7 +313,7 @@ public Builder deployed(com.auth0.client.mgmt.core.Nullable deployed) { *

Use this field to request a specific page of the list results.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java index 4d80bc312..d278c0aa2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional getTotal() { return total; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListAculsOffsetPaginatedResponseContent @@ -92,12 +92,12 @@ private boolean equalTo(ListAculsOffsetPaginatedResponseContent other) { && total.equals(other.total); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.configs, this.start, this.limit, this.total); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java index fba219f29..10769ec3c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java @@ -36,7 +36,7 @@ public Optional> getProviders() { return providers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListBrandingPhoneProvidersResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(ListBrandingPhoneProvidersResponseContent other) { return providers.equals(other.providers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.providers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java index e9bb942a4..c93b942cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java @@ -48,7 +48,7 @@ public Optional getNext() { return next; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientConnectionsResponseContent @@ -64,12 +64,12 @@ private boolean equalTo(ListClientConnectionsResponseContent other) { return connections.equals(other.connections) && next.equals(other.next); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.connections, this.next); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java index b356b3512..4c8247e04 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getOrganizations() { return organizations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantOrganizationsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListClientGrantOrganizationsPaginatedResponseContent oth return next.equals(other.next) && organizations.equals(other.organizations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.organizations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java index 4fddd9cf4..cecacdc77 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getClientGrants() { return clientGrants; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListClientGrantPaginatedResponseContent other) { return next.equals(other.next) && clientGrants.equals(other.clientGrants); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.clientGrants); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java index 65e6becac..68110a1d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java @@ -33,6 +33,8 @@ public final class ListClientGrantsRequestParameters { private final OptionalNullable allowAnyOrganization; + private final OptionalNullable subjectType; + private final Map additionalProperties; private ListClientGrantsRequestParameters( @@ -41,12 +43,14 @@ private ListClientGrantsRequestParameters( OptionalNullable audience, OptionalNullable clientId, OptionalNullable allowAnyOrganization, + OptionalNullable subjectType, Map additionalProperties) { this.from = from; this.take = take; this.audience = audience; this.clientId = clientId; this.allowAnyOrganization = allowAnyOrganization; + this.subjectType = subjectType; this.additionalProperties = additionalProperties; } @@ -107,6 +111,18 @@ public OptionalNullable getAllowAnyOrganization() { return allowAnyOrganization; } + /** + * @return The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href="https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject_type") + public OptionalNullable getSubjectType() { + if (subjectType == null) { + return OptionalNullable.absent(); + } + return subjectType; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("from") private OptionalNullable _getFrom() { @@ -131,7 +147,13 @@ private OptionalNullable _getAllowAnyOrganization() { return allowAnyOrganization; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject_type") + private OptionalNullable _getSubjectType() { + return subjectType; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantsRequestParameters && equalTo((ListClientGrantsRequestParameters) other); @@ -147,15 +169,17 @@ private boolean equalTo(ListClientGrantsRequestParameters other) { && take.equals(other.take) && audience.equals(other.audience) && clientId.equals(other.clientId) - && allowAnyOrganization.equals(other.allowAnyOrganization); + && allowAnyOrganization.equals(other.allowAnyOrganization) + && subjectType.equals(other.subjectType); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.from, this.take, this.audience, this.clientId, this.allowAnyOrganization); + return Objects.hash( + this.from, this.take, this.audience, this.clientId, this.allowAnyOrganization, this.subjectType); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -176,6 +200,8 @@ public static final class Builder { private OptionalNullable allowAnyOrganization = OptionalNullable.absent(); + private OptionalNullable subjectType = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -187,6 +213,7 @@ public Builder from(ListClientGrantsRequestParameters other) { audience(other.getAudience()); clientId(other.getClientId()); allowAnyOrganization(other.getAllowAnyOrganization()); + subjectType(other.getSubjectType()); return this; } @@ -360,9 +387,43 @@ public Builder allowAnyOrganization(com.auth0.client.mgmt.core.Nullable return this; } + /** + *

The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href="https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) + public Builder subjectType(@Nullable OptionalNullable subjectType) { + this.subjectType = subjectType; + return this; + } + + public Builder subjectType(ClientGrantSubjectTypeEnum subjectType) { + this.subjectType = OptionalNullable.of(subjectType); + return this; + } + + public Builder subjectType(Optional subjectType) { + if (subjectType.isPresent()) { + this.subjectType = OptionalNullable.of(subjectType.get()); + } else { + this.subjectType = OptionalNullable.absent(); + } + return this; + } + + public Builder subjectType(com.auth0.client.mgmt.core.Nullable subjectType) { + if (subjectType.isNull()) { + this.subjectType = OptionalNullable.ofNull(); + } else if (subjectType.isEmpty()) { + this.subjectType = OptionalNullable.absent(); + } else { + this.subjectType = OptionalNullable.of(subjectType.get()); + } + return this; + } + public ListClientGrantsRequestParameters build() { return new ListClientGrantsRequestParameters( - from, take, audience, clientId, allowAnyOrganization, additionalProperties); + from, take, audience, clientId, allowAnyOrganization, subjectType, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java index b1a490f66..b651a9045 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getClients() { return clients; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListClientsOffsetPaginatedResponseContent other) { && clients.equals(other.clients); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.clients); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java index d3de9d7b8..fca85900f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java @@ -96,9 +96,6 @@ public OptionalNullable getIncludeFields() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -180,12 +177,6 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("is_global") private OptionalNullable _getIsGlobal() { @@ -210,7 +201,7 @@ private OptionalNullable _getQ() { return q; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientsRequestParameters && equalTo((ListClientsRequestParameters) other); @@ -233,7 +224,7 @@ private boolean equalTo(ListClientsRequestParameters other) { && q.equals(other.q); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.fields, @@ -247,7 +238,7 @@ public int hashCode() { this.q); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -366,7 +357,7 @@ public Builder includeFields(com.auth0.client.mgmt.core.Nullable includ *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java new file mode 100644 index 000000000..e0fe42a11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListConnectionProfileRequestParameters.Builder.class) +public final class ListConnectionProfileRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListConnectionProfileRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 5. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListConnectionProfileRequestParameters + && equalTo((ListConnectionProfileRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListConnectionProfileRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListConnectionProfileRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 5.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListConnectionProfileRequestParameters build() { + return new ListConnectionProfileRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java new file mode 100644 index 000000000..4bf5a8a59 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListConnectionProfileTemplateResponseContent.Builder.class) +public final class ListConnectionProfileTemplateResponseContent { + private final Optional> connectionProfileTemplates; + + private final Map additionalProperties; + + private ListConnectionProfileTemplateResponseContent( + Optional> connectionProfileTemplates, + Map additionalProperties) { + this.connectionProfileTemplates = connectionProfileTemplates; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connection_profile_templates") + public Optional> getConnectionProfileTemplates() { + return connectionProfileTemplates; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListConnectionProfileTemplateResponseContent + && equalTo((ListConnectionProfileTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListConnectionProfileTemplateResponseContent other) { + return connectionProfileTemplates.equals(other.connectionProfileTemplates); + } + + @Override + public int hashCode() { + return Objects.hash(this.connectionProfileTemplates); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> connectionProfileTemplates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListConnectionProfileTemplateResponseContent other) { + connectionProfileTemplates(other.getConnectionProfileTemplates()); + return this; + } + + @JsonSetter(value = "connection_profile_templates", nulls = Nulls.SKIP) + public Builder connectionProfileTemplates( + Optional> connectionProfileTemplates) { + this.connectionProfileTemplates = connectionProfileTemplates; + return this; + } + + public Builder connectionProfileTemplates(List connectionProfileTemplates) { + this.connectionProfileTemplates = Optional.ofNullable(connectionProfileTemplates); + return this; + } + + public ListConnectionProfileTemplateResponseContent build() { + return new ListConnectionProfileTemplateResponseContent(connectionProfileTemplates, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java new file mode 100644 index 000000000..851012f43 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListConnectionProfilesPaginatedResponseContent.Builder.class) +public final class ListConnectionProfilesPaginatedResponseContent { + private final Optional next; + + private final Optional> connectionProfiles; + + private final Map additionalProperties; + + private ListConnectionProfilesPaginatedResponseContent( + Optional next, + Optional> connectionProfiles, + Map additionalProperties) { + this.next = next; + this.connectionProfiles = connectionProfiles; + this.additionalProperties = additionalProperties; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("connection_profiles") + public Optional> getConnectionProfiles() { + return connectionProfiles; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListConnectionProfilesPaginatedResponseContent + && equalTo((ListConnectionProfilesPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListConnectionProfilesPaginatedResponseContent other) { + return next.equals(other.next) && connectionProfiles.equals(other.connectionProfiles); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.connectionProfiles); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> connectionProfiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListConnectionProfilesPaginatedResponseContent other) { + next(other.getNext()); + connectionProfiles(other.getConnectionProfiles()); + return this; + } + + /** + *

A cursor to be used as the "from" query parameter for the next page of results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "connection_profiles", nulls = Nulls.SKIP) + public Builder connectionProfiles(Optional> connectionProfiles) { + this.connectionProfiles = connectionProfiles; + return this; + } + + public Builder connectionProfiles(List connectionProfiles) { + this.connectionProfiles = Optional.ofNullable(connectionProfiles); + return this; + } + + public ListConnectionProfilesPaginatedResponseContent build() { + return new ListConnectionProfilesPaginatedResponseContent(next, connectionProfiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java index 7b7e04dcd..1e052bf9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getConnections() { return connections; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionsCheckpointPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListConnectionsCheckpointPaginatedResponseContent other) return next.equals(other.next) && connections.equals(other.connections); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.connections); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java index a4f64a988..4f8748a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java @@ -155,7 +155,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionsQueryParameters && equalTo((ListConnectionsQueryParameters) other); @@ -175,12 +175,12 @@ private boolean equalTo(ListConnectionsQueryParameters other) { && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.strategy, this.from, this.take, this.name, this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java new file mode 100644 index 000000000..e854b6279 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java @@ -0,0 +1,429 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListCustomDomainsRequestParameters.Builder.class) +public final class ListCustomDomainsRequestParameters { + private final OptionalNullable take; + + private final OptionalNullable from; + + private final OptionalNullable q; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable sort; + + private final Map additionalProperties; + + private ListCustomDomainsRequestParameters( + OptionalNullable take, + OptionalNullable from, + OptionalNullable q, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable sort, + Map additionalProperties) { + this.take = take; + this.from = from; + this.q = q; + this.fields = fields; + this.includeFields = includeFields; + this.sort = sort; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Query in <a href ="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene query string syntax</a>. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + /** + * @return Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Whether specified fields are to be included (true) or excluded (false). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Field to sort by. Only <code>domain:1</code> (ascending order by domain) is supported at this time. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListCustomDomainsRequestParameters + && equalTo((ListCustomDomainsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListCustomDomainsRequestParameters other) { + return take.equals(other.take) + && from.equals(other.from) + && q.equals(other.q) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && sort.equals(other.sort); + } + + @Override + public int hashCode() { + return Objects.hash(this.take, this.from, this.q, this.fields, this.includeFields, this.sort); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable q = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListCustomDomainsRequestParameters other) { + take(other.getTake()); + from(other.getFrom()); + q(other.getQ()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + sort(other.getSort()); + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@org.jetbrains.annotations.Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Query in <a href ="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene query string syntax</a>.

+ */ + @JsonSetter(value = "q", nulls = Nulls.SKIP) + public Builder q(@org.jetbrains.annotations.Nullable OptionalNullable q) { + this.q = q; + return this; + } + + public Builder q(String q) { + this.q = OptionalNullable.of(q); + return this; + } + + public Builder q(Optional q) { + if (q.isPresent()) { + this.q = OptionalNullable.of(q.get()); + } else { + this.q = OptionalNullable.absent(); + } + return this; + } + + public Builder q(Nullable q) { + if (q.isNull()) { + this.q = OptionalNullable.ofNull(); + } else if (q.isEmpty()) { + this.q = OptionalNullable.absent(); + } else { + this.q = OptionalNullable.of(q.get()); + } + return this; + } + + /** + *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

+ */ + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { + this.fields = fields; + return this; + } + + public Builder fields(String fields) { + this.fields = OptionalNullable.of(fields); + return this; + } + + public Builder fields(Optional fields) { + if (fields.isPresent()) { + this.fields = OptionalNullable.of(fields.get()); + } else { + this.fields = OptionalNullable.absent(); + } + return this; + } + + public Builder fields(Nullable fields) { + if (fields.isNull()) { + this.fields = OptionalNullable.ofNull(); + } else if (fields.isEmpty()) { + this.fields = OptionalNullable.absent(); + } else { + this.fields = OptionalNullable.of(fields.get()); + } + return this; + } + + /** + *

Whether specified fields are to be included (true) or excluded (false).

+ */ + @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { + this.includeFields = includeFields; + return this; + } + + public Builder includeFields(Boolean includeFields) { + this.includeFields = OptionalNullable.of(includeFields); + return this; + } + + public Builder includeFields(Optional includeFields) { + if (includeFields.isPresent()) { + this.includeFields = OptionalNullable.of(includeFields.get()); + } else { + this.includeFields = OptionalNullable.absent(); + } + return this; + } + + public Builder includeFields(Nullable includeFields) { + if (includeFields.isNull()) { + this.includeFields = OptionalNullable.ofNull(); + } else if (includeFields.isEmpty()) { + this.includeFields = OptionalNullable.absent(); + } else { + this.includeFields = OptionalNullable.of(includeFields.get()); + } + return this; + } + + /** + *

Field to sort by. Only <code>domain:1</code> (ascending order by domain) is supported at this time.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(String sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + public ListCustomDomainsRequestParameters build() { + return new ListCustomDomainsRequestParameters( + take, from, q, fields, includeFields, sort, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java index c97ba3c8d..814e65f18 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getDeviceCredentials() { return deviceCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListDeviceCredentialsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListDeviceCredentialsOffsetPaginatedResponseContent othe && deviceCredentials.equals(other.deviceCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.deviceCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java index 0be96441d..55293598e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListDeviceCredentialsRequestParameters.Builder.class) @@ -68,9 +68,6 @@ private ListDeviceCredentialsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -152,12 +149,6 @@ public OptionalNullable getType() { return type; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("fields") private OptionalNullable _getFields() { @@ -188,7 +179,7 @@ private OptionalNullable _getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListDeviceCredentialsRequestParameters @@ -211,7 +202,7 @@ private boolean equalTo(ListDeviceCredentialsRequestParameters other) { && type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.page, @@ -224,7 +215,7 @@ public int hashCode() { this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -272,7 +263,7 @@ public Builder from(ListDeviceCredentialsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -291,7 +282,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -325,7 +316,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -359,7 +350,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -374,7 +365,7 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -393,7 +384,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -408,7 +399,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Whether specified fields are to be included (true) or excluded (false).

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@Nullable OptionalNullable includeFields) { + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -427,7 +418,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + public Builder includeFields(Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { @@ -442,7 +433,7 @@ public Builder includeFields(com.auth0.client.mgmt.core.Nullable includ *

user_id of the devices to retrieve.

*/ @JsonSetter(value = "user_id", nulls = Nulls.SKIP) - public Builder userId(@Nullable OptionalNullable userId) { + public Builder userId(@org.jetbrains.annotations.Nullable OptionalNullable userId) { this.userId = userId; return this; } @@ -461,7 +452,7 @@ public Builder userId(Optional userId) { return this; } - public Builder userId(com.auth0.client.mgmt.core.Nullable userId) { + public Builder userId(Nullable userId) { if (userId.isNull()) { this.userId = OptionalNullable.ofNull(); } else if (userId.isEmpty()) { @@ -476,7 +467,7 @@ public Builder userId(com.auth0.client.mgmt.core.Nullable userId) { *

client_id of the devices to retrieve.

*/ @JsonSetter(value = "client_id", nulls = Nulls.SKIP) - public Builder clientId(@Nullable OptionalNullable clientId) { + public Builder clientId(@org.jetbrains.annotations.Nullable OptionalNullable clientId) { this.clientId = clientId; return this; } @@ -495,7 +486,7 @@ public Builder clientId(Optional clientId) { return this; } - public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { + public Builder clientId(Nullable clientId) { if (clientId.isNull()) { this.clientId = OptionalNullable.ofNull(); } else if (clientId.isEmpty()) { @@ -510,7 +501,7 @@ public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { *

Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested

*/ @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(@Nullable OptionalNullable type) { + public Builder type(@org.jetbrains.annotations.Nullable OptionalNullable type) { this.type = type; return this; } @@ -529,7 +520,7 @@ public Builder type(Optional type) { return this; } - public Builder type(com.auth0.client.mgmt.core.Nullable type) { + public Builder type(Nullable type) { if (type.isNull()) { this.type = OptionalNullable.ofNull(); } else if (type.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java index 8b4abaab5..c0f6bac12 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getKeys() { return keys; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEncryptionKeyOffsetPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListEncryptionKeyOffsetPaginatedResponseContent other) { && keys.equals(other.keys); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.keys); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java index 0dffe8000..422d07ebe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEventStreamsRequestParameters && equalTo((ListEventStreamsRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListEventStreamsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java index af0d6c733..46df4afaa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getExecutions() { return executions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowExecutionsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListFlowExecutionsPaginatedResponseContent other) { return next.equals(other.next) && executions.equals(other.executions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.executions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java index 94bce6bc6..e7726016c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getFlows() { return flows; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListFlowsOffsetPaginatedResponseContent other) { && flows.equals(other.flows); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.flows); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..92eb9b9de --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFlowsVaultConnectionsOffsetPaginatedResponseContent.Builder.class) +public final class ListFlowsVaultConnectionsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> connections; + + private final Map additionalProperties; + + private ListFlowsVaultConnectionsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> connections, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.connections = connections; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("connections") + public Optional> getConnections() { + return connections; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFlowsVaultConnectionsOffsetPaginatedResponseContent + && equalTo((ListFlowsVaultConnectionsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFlowsVaultConnectionsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && connections.equals(other.connections); + } + + @Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.connections); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> connections = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFlowsVaultConnectionsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + connections(other.getConnections()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "connections", nulls = Nulls.SKIP) + public Builder connections(Optional> connections) { + this.connections = connections; + return this; + } + + public Builder connections(List connections) { + this.connections = Optional.ofNullable(connections); + return this; + } + + public ListFlowsVaultConnectionsOffsetPaginatedResponseContent build() { + return new ListFlowsVaultConnectionsOffsetPaginatedResponseContent( + start, limit, total, connections, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java index 39ce76c65..389c9c227 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getForms() { return forms; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFormsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListFormsOffsetPaginatedResponseContent other) { && forms.equals(other.forms); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.forms); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java index a5b127aba..c0ff375db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java @@ -66,9 +66,6 @@ public Optional> getHydrate() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -96,13 +93,7 @@ private Optional> _getHydrate() { return hydrate; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFormsRequestParameters && equalTo((ListFormsRequestParameters) other); @@ -120,12 +111,12 @@ private boolean equalTo(ListFormsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -191,7 +182,7 @@ public Builder hydrate(FormsRequestParametersHydrateEnum hydrate) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java index 58d7d6974..1766e5e07 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getHooks() { return hooks; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListHooksOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListHooksOffsetPaginatedResponseContent other) { && hooks.equals(other.hooks); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.hooks); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java index fa1bad27e..19e7cf97d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListHooksRequestParameters.Builder.class) @@ -60,9 +60,6 @@ private ListHooksRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -120,12 +117,6 @@ public OptionalNullable getTriggerId() { return triggerId; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("enabled") private OptionalNullable _getEnabled() { @@ -144,7 +135,7 @@ private OptionalNullable _getTriggerId() { return triggerId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListHooksRequestParameters && equalTo((ListHooksRequestParameters) other); @@ -164,12 +155,12 @@ private boolean equalTo(ListHooksRequestParameters other) { && triggerId.equals(other.triggerId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.triggerId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -211,7 +202,7 @@ public Builder from(ListHooksRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -230,7 +221,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -264,7 +255,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -298,7 +289,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -313,7 +304,7 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ *

Optional filter on whether a hook is enabled (true) or disabled (false).

*/ @JsonSetter(value = "enabled", nulls = Nulls.SKIP) - public Builder enabled(@Nullable OptionalNullable enabled) { + public Builder enabled(@org.jetbrains.annotations.Nullable OptionalNullable enabled) { this.enabled = enabled; return this; } @@ -332,7 +323,7 @@ public Builder enabled(Optional enabled) { return this; } - public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + public Builder enabled(Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); } else if (enabled.isEmpty()) { @@ -347,7 +338,7 @@ public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { *

Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -366,7 +357,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -381,7 +372,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Retrieves hooks that match the trigger

*/ @JsonSetter(value = "triggerId", nulls = Nulls.SKIP) - public Builder triggerId(@Nullable OptionalNullable triggerId) { + public Builder triggerId(@org.jetbrains.annotations.Nullable OptionalNullable triggerId) { this.triggerId = triggerId; return this; } @@ -400,7 +391,7 @@ public Builder triggerId(Optional triggerId) { return this; } - public Builder triggerId(com.auth0.client.mgmt.core.Nullable triggerId) { + public Builder triggerId(Nullable triggerId) { if (triggerId.isNull()) { this.triggerId = OptionalNullable.ofNull(); } else if (triggerId.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java index 1acead10e..7166299c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getLogs() { return logs; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListLogOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(ListLogOffsetPaginatedResponseContent other) { && logs.equals(other.logs); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java index bc89f4bc9..f109d2067 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListLogsRequestParameters.Builder.class) @@ -35,7 +35,7 @@ public final class ListLogsRequestParameters { private final OptionalNullable includeTotals; - private final OptionalNullable q; + private final OptionalNullable search; private final Map additionalProperties; @@ -46,7 +46,7 @@ private ListLogsRequestParameters( OptionalNullable fields, OptionalNullable includeFields, OptionalNullable includeTotals, - OptionalNullable q, + OptionalNullable search, Map additionalProperties) { this.page = page; this.perPage = perPage; @@ -54,7 +54,7 @@ private ListLogsRequestParameters( this.fields = fields; this.includeFields = includeFields; this.includeTotals = includeTotals; - this.q = q; + this.search = search; this.additionalProperties = additionalProperties; } @@ -64,9 +64,6 @@ private ListLogsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -125,21 +122,17 @@ public OptionalNullable getIncludeTotals() { } /** - * @return Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>. + * @return Retrieves logs that match the specified search criteria. This parameter can be combined with all the others in the /api/logs endpoint but is specified separately for clarity. + * If no fields are provided a case insensitive 'starts with' search is performed on all of the following fields: client_name, connection, user_name. Otherwise, you can specify multiple fields and specify the search using the %field%:%search%, for example: application:node user:"John@contoso.com". + * Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses. */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("q") - public OptionalNullable getQ() { - if (q == null) { + @JsonProperty("search") + public OptionalNullable getSearch() { + if (search == null) { return OptionalNullable.absent(); } - return q; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; + return search; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @@ -161,12 +154,12 @@ private OptionalNullable _getIncludeFields() { } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("q") - private OptionalNullable _getQ() { - return q; + @JsonProperty("search") + private OptionalNullable _getSearch() { + return search; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListLogsRequestParameters && equalTo((ListLogsRequestParameters) other); @@ -184,16 +177,16 @@ private boolean equalTo(ListLogsRequestParameters other) { && fields.equals(other.fields) && includeFields.equals(other.includeFields) && includeTotals.equals(other.includeTotals) - && q.equals(other.q); + && search.equals(other.search); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( - this.page, this.perPage, this.sort, this.fields, this.includeFields, this.includeTotals, this.q); + this.page, this.perPage, this.sort, this.fields, this.includeFields, this.includeTotals, this.search); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -216,7 +209,7 @@ public static final class Builder { private OptionalNullable includeTotals = OptionalNullable.absent(); - private OptionalNullable q = OptionalNullable.absent(); + private OptionalNullable search = OptionalNullable.absent(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -230,7 +223,7 @@ public Builder from(ListLogsRequestParameters other) { fields(other.getFields()); includeFields(other.getIncludeFields()); includeTotals(other.getIncludeTotals()); - q(other.getQ()); + search(other.getSearch()); return this; } @@ -238,7 +231,7 @@ public Builder from(ListLogsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -257,7 +250,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -291,7 +284,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -306,7 +299,7 @@ public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { *

Field to use for sorting appended with <code>:1</code> for ascending and <code>:-1</code> for descending. e.g. <code>date:-1</code>

*/ @JsonSetter(value = "sort", nulls = Nulls.SKIP) - public Builder sort(@Nullable OptionalNullable sort) { + public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { this.sort = sort; return this; } @@ -325,7 +318,7 @@ public Builder sort(Optional sort) { return this; } - public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + public Builder sort(Nullable sort) { if (sort.isNull()) { this.sort = OptionalNullable.ofNull(); } else if (sort.isEmpty()) { @@ -340,7 +333,7 @@ public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { *

Comma-separated list of fields to include or exclude (based on value provided for <code>include_fields</code>) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -359,7 +352,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -374,7 +367,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Whether specified fields are to be included (<code>true</code>) or excluded (<code>false</code>)

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@Nullable OptionalNullable includeFields) { + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -393,7 +386,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + public Builder includeFields(Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { @@ -427,7 +420,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -439,42 +432,44 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ } /** - *

Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>.

+ *

Retrieves logs that match the specified search criteria. This parameter can be combined with all the others in the /api/logs endpoint but is specified separately for clarity. + * If no fields are provided a case insensitive 'starts with' search is performed on all of the following fields: client_name, connection, user_name. Otherwise, you can specify multiple fields and specify the search using the %field%:%search%, for example: application:node user:"John@contoso.com". + * Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses.

*/ - @JsonSetter(value = "q", nulls = Nulls.SKIP) - public Builder q(@Nullable OptionalNullable q) { - this.q = q; + @JsonSetter(value = "search", nulls = Nulls.SKIP) + public Builder search(@org.jetbrains.annotations.Nullable OptionalNullable search) { + this.search = search; return this; } - public Builder q(String q) { - this.q = OptionalNullable.of(q); + public Builder search(String search) { + this.search = OptionalNullable.of(search); return this; } - public Builder q(Optional q) { - if (q.isPresent()) { - this.q = OptionalNullable.of(q.get()); + public Builder search(Optional search) { + if (search.isPresent()) { + this.search = OptionalNullable.of(search.get()); } else { - this.q = OptionalNullable.absent(); + this.search = OptionalNullable.absent(); } return this; } - public Builder q(com.auth0.client.mgmt.core.Nullable q) { - if (q.isNull()) { - this.q = OptionalNullable.ofNull(); - } else if (q.isEmpty()) { - this.q = OptionalNullable.absent(); + public Builder search(Nullable search) { + if (search.isNull()) { + this.search = OptionalNullable.ofNull(); + } else if (search.isEmpty()) { + this.search = OptionalNullable.absent(); } else { - this.q = OptionalNullable.of(q.get()); + this.search = OptionalNullable.of(search.get()); } return this; } public ListLogsRequestParameters build() { return new ListLogsRequestParameters( - page, perPage, sort, fields, includeFields, includeTotals, q, additionalProperties); + page, perPage, sort, fields, includeFields, includeTotals, search, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java index c6f098161..cabb05ad8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional getTotal() { return total; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListNetworkAclsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListNetworkAclsOffsetPaginatedResponseContent other) { && total.equals(other.total); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.networkAcls, this.start, this.limit, this.total); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java index f2b54281b..7e3f48a79 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListNetworkAclsRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListNetworkAclsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListNetworkAclsRequestParameters && equalTo((ListNetworkAclsRequestParameters) other); @@ -93,12 +84,12 @@ private boolean equalTo(ListNetworkAclsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +122,7 @@ public Builder from(ListNetworkAclsRequestParameters other) { *

Use this field to request a specific page of the list results.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -150,7 +141,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -184,7 +175,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -218,7 +209,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java index 758e7980c..14de196cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getClientGrants() { return clientGrants; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationClientGrantsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationClientGrantsOffsetPaginatedResponseConte && clientGrants.equals(other.clientGrants); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.clientGrants); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java index 29935e032..6c80d4749 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getEnabledConnections() { return enabledConnections; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationConnectionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationConnectionsOffsetPaginatedResponseConten && enabledConnections.equals(other.enabledConnections); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.enabledConnections); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java new file mode 100644 index 000000000..8ee750c8b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationDiscoveryDomainsResponseContent.Builder.class) +public final class ListOrganizationDiscoveryDomainsResponseContent { + private final Optional next; + + private final List domains; + + private final Map additionalProperties; + + private ListOrganizationDiscoveryDomainsResponseContent( + Optional next, + List domains, + Map additionalProperties) { + this.next = next; + this.domains = domains; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("domains") + public List getDomains() { + return domains; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationDiscoveryDomainsResponseContent + && equalTo((ListOrganizationDiscoveryDomainsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationDiscoveryDomainsResponseContent other) { + return next.equals(other.next) && domains.equals(other.domains); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.domains); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private List domains = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationDiscoveryDomainsResponseContent other) { + next(other.getNext()); + domains(other.getDomains()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "domains", nulls = Nulls.SKIP) + public Builder domains(List domains) { + this.domains.clear(); + if (domains != null) { + this.domains.addAll(domains); + } + return this; + } + + public Builder addDomains(OrganizationDiscoveryDomain domains) { + this.domains.add(domains); + return this; + } + + public Builder addAllDomains(List domains) { + if (domains != null) { + this.domains.addAll(domains); + } + return this; + } + + public ListOrganizationDiscoveryDomainsResponseContent build() { + return new ListOrganizationDiscoveryDomainsResponseContent(next, domains, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java index 211d4a4cf..4487ef11b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java @@ -55,7 +55,7 @@ public Optional> getInvitations() { return invitations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationInvitationsOffsetPaginatedResponseContent @@ -71,12 +71,12 @@ private boolean equalTo(ListOrganizationInvitationsOffsetPaginatedResponseConten return start.equals(other.start) && limit.equals(other.limit) && invitations.equals(other.invitations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.invitations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java index d0bc8b685..d0f786a36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMemberRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationMemberRolesOffsetPaginatedResponseConten && roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java index f04ca1ef3..15d657fde 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java @@ -46,7 +46,7 @@ public Optional> getMembers() { return members; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMembersPaginatedResponseContent @@ -62,12 +62,12 @@ private boolean equalTo(ListOrganizationMembersPaginatedResponseContent other) { return next.equals(other.next) && members.equals(other.members); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.members); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java index f299d9278..f242ae0e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java @@ -46,7 +46,7 @@ public Optional> getOrganizations() { return organizations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationsPaginatedResponseContent @@ -62,12 +62,12 @@ private boolean equalTo(ListOrganizationsPaginatedResponseContent other) { return next.equals(other.next) && organizations.equals(other.organizations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.organizations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java index 36cbf3e96..47ac0911b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java @@ -87,7 +87,7 @@ private OptionalNullable _getSort() { return sort; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationsRequestParameters @@ -103,12 +103,12 @@ private boolean equalTo(ListOrganizationsRequestParameters other) { return from.equals(other.from) && take.equals(other.take) && sort.equals(other.sort); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take, this.sort); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java index a01528c7b..fb3680a06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java @@ -36,7 +36,7 @@ public Optional> getTemplates() { return templates; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListPhoneTemplatesResponseContent && equalTo((ListPhoneTemplatesResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ListPhoneTemplatesResponseContent other) { return templates.equals(other.templates); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.templates); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java index 15d627177..15c288983 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional getNext() { return next; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRefreshTokensPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListRefreshTokensPaginatedResponseContent other) { return tokens.equals(other.tokens) && next.equals(other.next); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tokens, this.next); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java index 9d78cdf54..e16e3d473 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getResourceServers() { return resourceServers; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListResourceServerOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListResourceServerOffsetPaginatedResponseContent other) && resourceServers.equals(other.resourceServers); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.resourceServers); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java index 6f6882487..fa83e9330 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java @@ -70,9 +70,6 @@ public Optional> getIdentifiers() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -112,19 +109,13 @@ private Optional> _getIdentifiers() { return identifiers; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("include_fields") private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListResourceServerRequestParameters @@ -144,12 +135,12 @@ private boolean equalTo(ListResourceServerRequestParameters other) { && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifiers, this.page, this.perPage, this.includeTotals, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -218,7 +209,7 @@ public Builder identifiers(String identifiers) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java index bc8acae9b..48161d462 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolePermissionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRolePermissionsOffsetPaginatedResponseContent other) && permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java index a489c2d16..f45aab968 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java @@ -44,7 +44,7 @@ public Optional> getUsers() { return users; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRoleUsersPaginatedResponseContent @@ -60,12 +60,12 @@ private boolean equalTo(ListRoleUsersPaginatedResponseContent other) { return next.equals(other.next) && users.equals(other.users); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.users); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java index 9fbe5e5f1..f10faa80c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRolesOffsetPaginatedResponseContent other) { && roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java index 6ce82c229..16390b233 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java @@ -61,9 +61,6 @@ public OptionalNullable getPerPage() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -88,19 +85,13 @@ public OptionalNullable getNameFilter() { return nameFilter; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("name_filter") private OptionalNullable _getNameFilter() { return nameFilter; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolesRequestParameters && equalTo((ListRolesRequestParameters) other); @@ -118,12 +109,12 @@ private boolean equalTo(ListRolesRequestParameters other) { && nameFilter.equals(other.nameFilter); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals, this.nameFilter); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -193,7 +184,7 @@ public Builder perPage(Nullable perPage) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java index c1a0726c0..6375420db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRules() { return rules; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRulesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRulesOffsetPaginatedResponseContent other) { && rules.equals(other.rules); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.rules); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java index c0693d187..78bc223a0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListRulesRequestParameters.Builder.class) @@ -60,9 +60,6 @@ private ListRulesRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -120,12 +117,6 @@ public OptionalNullable getIncludeFields() { return includeFields; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("enabled") private OptionalNullable _getEnabled() { @@ -144,7 +135,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRulesRequestParameters && equalTo((ListRulesRequestParameters) other); @@ -164,12 +155,12 @@ private boolean equalTo(ListRulesRequestParameters other) { && includeFields.equals(other.includeFields); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.includeFields); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -211,7 +202,7 @@ public Builder from(ListRulesRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -230,7 +221,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -264,7 +255,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -298,7 +289,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -313,7 +304,7 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ *

Optional filter on whether a rule is enabled (true) or disabled (false).

*/ @JsonSetter(value = "enabled", nulls = Nulls.SKIP) - public Builder enabled(@Nullable OptionalNullable enabled) { + public Builder enabled(@org.jetbrains.annotations.Nullable OptionalNullable enabled) { this.enabled = enabled; return this; } @@ -332,7 +323,7 @@ public Builder enabled(Optional enabled) { return this; } - public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { + public Builder enabled(Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); } else if (enabled.isEmpty()) { @@ -347,7 +338,7 @@ public Builder enabled(com.auth0.client.mgmt.core.Nullable enabled) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -366,7 +357,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -381,7 +372,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Whether specified fields are to be included (true) or excluded (false).

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@Nullable OptionalNullable includeFields) { + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -400,7 +391,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + public Builder includeFields(Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java index 54a43729b..462582fcb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getSelfServiceProfiles() { return selfServiceProfiles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListSelfServiceProfilesPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListSelfServiceProfilesPaginatedResponseContent other) { && selfServiceProfiles.equals(other.selfServiceProfiles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.selfServiceProfiles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java index 880fe0faa..768d3b62c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListSelfServiceProfilesRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListSelfServiceProfilesRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListSelfServiceProfilesRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListSelfServiceProfilesRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListSelfServiceProfilesRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java index 6c03ca1f6..df7fe7f72 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java @@ -49,7 +49,7 @@ public Optional> getTokenExchangeProfi return tokenExchangeProfiles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListTokenExchangeProfileResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListTokenExchangeProfileResponseContent other) { return next.equals(other.next) && tokenExchangeProfiles.equals(other.tokenExchangeProfiles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.tokenExchangeProfiles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java new file mode 100644 index 000000000..2df6738b0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserAttributeProfileRequestParameters.Builder.class) +public final class ListUserAttributeProfileRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListUserAttributeProfileRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 5. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserAttributeProfileRequestParameters + && equalTo((ListUserAttributeProfileRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserAttributeProfileRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserAttributeProfileRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 5.

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public ListUserAttributeProfileRequestParameters build() { + return new ListUserAttributeProfileRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java new file mode 100644 index 000000000..4656255ec --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserAttributeProfileTemplateResponseContent.Builder.class) +public final class ListUserAttributeProfileTemplateResponseContent { + private final Optional> userAttributeProfileTemplates; + + private final Map additionalProperties; + + private ListUserAttributeProfileTemplateResponseContent( + Optional> userAttributeProfileTemplates, + Map additionalProperties) { + this.userAttributeProfileTemplates = userAttributeProfileTemplates; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_attribute_profile_templates") + public Optional> getUserAttributeProfileTemplates() { + return userAttributeProfileTemplates; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserAttributeProfileTemplateResponseContent + && equalTo((ListUserAttributeProfileTemplateResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserAttributeProfileTemplateResponseContent other) { + return userAttributeProfileTemplates.equals(other.userAttributeProfileTemplates); + } + + @Override + public int hashCode() { + return Objects.hash(this.userAttributeProfileTemplates); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> userAttributeProfileTemplates = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserAttributeProfileTemplateResponseContent other) { + userAttributeProfileTemplates(other.getUserAttributeProfileTemplates()); + return this; + } + + @JsonSetter(value = "user_attribute_profile_templates", nulls = Nulls.SKIP) + public Builder userAttributeProfileTemplates( + Optional> userAttributeProfileTemplates) { + this.userAttributeProfileTemplates = userAttributeProfileTemplates; + return this; + } + + public Builder userAttributeProfileTemplates( + List userAttributeProfileTemplates) { + this.userAttributeProfileTemplates = Optional.ofNullable(userAttributeProfileTemplates); + return this; + } + + public ListUserAttributeProfileTemplateResponseContent build() { + return new ListUserAttributeProfileTemplateResponseContent( + userAttributeProfileTemplates, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java new file mode 100644 index 000000000..a036b3817 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserAttributeProfilesPaginatedResponseContent.Builder.class) +public final class ListUserAttributeProfilesPaginatedResponseContent { + private final Optional next; + + private final Optional> userAttributeProfiles; + + private final Map additionalProperties; + + private ListUserAttributeProfilesPaginatedResponseContent( + Optional next, + Optional> userAttributeProfiles, + Map additionalProperties) { + this.next = next; + this.userAttributeProfiles = userAttributeProfiles; + this.additionalProperties = additionalProperties; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("user_attribute_profiles") + public Optional> getUserAttributeProfiles() { + return userAttributeProfiles; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserAttributeProfilesPaginatedResponseContent + && equalTo((ListUserAttributeProfilesPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserAttributeProfilesPaginatedResponseContent other) { + return next.equals(other.next) && userAttributeProfiles.equals(other.userAttributeProfiles); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.userAttributeProfiles); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional> userAttributeProfiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserAttributeProfilesPaginatedResponseContent other) { + next(other.getNext()); + userAttributeProfiles(other.getUserAttributeProfiles()); + return this; + } + + /** + *

A cursor to be used as the "from" query parameter for the next page of results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "user_attribute_profiles", nulls = Nulls.SKIP) + public Builder userAttributeProfiles(Optional> userAttributeProfiles) { + this.userAttributeProfiles = userAttributeProfiles; + return this; + } + + public Builder userAttributeProfiles(List userAttributeProfiles) { + this.userAttributeProfiles = Optional.ofNullable(userAttributeProfiles); + return this; + } + + public ListUserAttributeProfilesPaginatedResponseContent build() { + return new ListUserAttributeProfilesPaginatedResponseContent( + next, userAttributeProfiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java index 832aba447..823783b5a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getAuthenticators() { return authenticators; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAuthenticationMethodsOffsetPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListUserAuthenticationMethodsOffsetPaginatedResponseCont && authenticators.equals(other.authenticators); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.authenticators); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java index a99680925..7caeeefe2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java @@ -66,7 +66,7 @@ private OptionalNullable _getConsiderBruteForceEnablement() { return considerBruteForceEnablement; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksByIdentifierRequestParameters @@ -83,12 +83,12 @@ private boolean equalTo(ListUserBlocksByIdentifierRequestParameters other) { && considerBruteForceEnablement.equals(other.considerBruteForceEnablement); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifier, this.considerBruteForceEnablement); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ListUserBlocksByIdentifierRequestParameters other) { identifier(other.getIdentifier()); considerBruteForceEnablement(other.getConsiderBruteForceEnablement()); @@ -146,7 +146,7 @@ public Builder from(ListUserBlocksByIdentifierRequestParameters other) { *

Should be any of a username, phone number, or email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); @@ -158,7 +158,7 @@ public _FinalStage identifier(@NotNull String identifier) { * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage considerBruteForceEnablement( com.auth0.client.mgmt.core.Nullable considerBruteForceEnablement) { if (considerBruteForceEnablement.isNull()) { @@ -176,7 +176,7 @@ public _FinalStage considerBruteForceEnablement( * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage considerBruteForceEnablement(Optional considerBruteForceEnablement) { if (considerBruteForceEnablement.isPresent()) { this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); @@ -191,7 +191,7 @@ public _FinalStage considerBruteForceEnablement(Optional considerBruteF * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnablement) { this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement); return this; @@ -201,7 +201,7 @@ public _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnable *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. * If true and Brute Force Protection is disabled, will return an empty list.

*/ - @java.lang.Override + @Override @JsonSetter(value = "consider_brute_force_enablement", nulls = Nulls.SKIP) public _FinalStage considerBruteForceEnablement( @Nullable OptionalNullable considerBruteForceEnablement) { @@ -209,7 +209,7 @@ public _FinalStage considerBruteForceEnablement( return this; } - @java.lang.Override + @Override public ListUserBlocksByIdentifierRequestParameters build() { return new ListUserBlocksByIdentifierRequestParameters( identifier, considerBruteForceEnablement, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java index 1e92989df..ab2d1ddef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java @@ -39,7 +39,7 @@ public Optional> getBlockedFor() { return blockedFor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksByIdentifierResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(ListUserBlocksByIdentifierResponseContent other) { return blockedFor.equals(other.blockedFor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.blockedFor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java index d7df16883..b758b4bdb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java @@ -52,7 +52,7 @@ private OptionalNullable _getConsiderBruteForceEnablement() { return considerBruteForceEnablement; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksRequestParameters && equalTo((ListUserBlocksRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(ListUserBlocksRequestParameters other) { return considerBruteForceEnablement.equals(other.considerBruteForceEnablement); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.considerBruteForceEnablement); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java index 1ac2c96b1..6be018b03 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java @@ -39,7 +39,7 @@ public Optional> getBlockedFor() { return blockedFor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksResponseContent && equalTo((ListUserBlocksResponseContent) other); @@ -54,12 +54,12 @@ private boolean equalTo(ListUserBlocksResponseContent other) { return blockedFor.equals(other.blockedFor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.blockedFor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java new file mode 100644 index 000000000..0349d438d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListUserConnectedAccountsResponseContent.Builder.class) +public final class ListUserConnectedAccountsResponseContent { + private final List connectedAccounts; + + private final Optional next; + + private final Map additionalProperties; + + private ListUserConnectedAccountsResponseContent( + List connectedAccounts, Optional next, Map additionalProperties) { + this.connectedAccounts = connectedAccounts; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connected_accounts") + public List getConnectedAccounts() { + return connectedAccounts; + } + + /** + * @return The token to retrieve the next page of connected accounts (if there is one) + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListUserConnectedAccountsResponseContent + && equalTo((ListUserConnectedAccountsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListUserConnectedAccountsResponseContent other) { + return connectedAccounts.equals(other.connectedAccounts) && next.equals(other.next); + } + + @Override + public int hashCode() { + return Objects.hash(this.connectedAccounts, this.next); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List connectedAccounts = new ArrayList<>(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListUserConnectedAccountsResponseContent other) { + connectedAccounts(other.getConnectedAccounts()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(List connectedAccounts) { + this.connectedAccounts.clear(); + if (connectedAccounts != null) { + this.connectedAccounts.addAll(connectedAccounts); + } + return this; + } + + public Builder addConnectedAccounts(ConnectedAccount connectedAccounts) { + this.connectedAccounts.add(connectedAccounts); + return this; + } + + public Builder addAllConnectedAccounts(List connectedAccounts) { + if (connectedAccounts != null) { + this.connectedAccounts.addAll(connectedAccounts); + } + return this; + } + + /** + *

The token to retrieve the next page of connected accounts (if there is one)

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public ListUserConnectedAccountsResponseContent build() { + return new ListUserConnectedAccountsResponseContent(connectedAccounts, next, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java index ae55daad1..a0852b328 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getGrants() { return grants; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserGrantsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserGrantsOffsetPaginatedResponseContent other) { && grants.equals(other.grants); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.grants); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java index 432ccf8c1..b01d8afb7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java @@ -69,9 +69,6 @@ public OptionalNullable getPerPage() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -120,12 +117,6 @@ public OptionalNullable getAudience() { return audience; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("user_id") private OptionalNullable _getUserId() { @@ -144,7 +135,7 @@ private OptionalNullable _getAudience() { return audience; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserGrantsRequestParameters && equalTo((ListUserGrantsRequestParameters) other); @@ -164,12 +155,12 @@ private boolean equalTo(ListUserGrantsRequestParameters other) { && audience.equals(other.audience); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals, this.userId, this.clientId, this.audience); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -245,7 +236,7 @@ public Builder perPage(Nullable perPage) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java index 9c9d1d39a..04cc55f8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getOrganizations() { return organizations; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserOrganizationsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserOrganizationsOffsetPaginatedResponseContent othe && organizations.equals(other.organizations); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.organizations); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java index 8cc2bba3e..423d4a14a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserPermissionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserPermissionsOffsetPaginatedResponseContent other) && permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java index 80f924308..d2d01d12e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserRolesOffsetPaginatedResponseContent other) { && roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java index 55c248c5b..2f80733bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional getNext() { return next; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserSessionsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListUserSessionsPaginatedResponseContent other) { return sessions.equals(other.sessions) && next.equals(other.next); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.sessions, this.next); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java index c66fe3a64..d91e9c654 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java @@ -87,7 +87,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersByEmailRequestParameters && equalTo((ListUsersByEmailRequestParameters) other); @@ -102,12 +102,12 @@ private boolean equalTo(ListUsersByEmailRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields) && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.fields, this.includeFields, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -164,7 +164,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ListUsersByEmailRequestParameters other) { fields(other.getFields()); includeFields(other.getIncludeFields()); @@ -177,7 +177,7 @@ public Builder from(ListUsersByEmailRequestParameters other) { *

Email address to search for (case-sensitive).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); @@ -188,7 +188,7 @@ public _FinalStage email(@NotNull String email) { *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); @@ -204,7 +204,7 @@ public _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable in *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeFields(Optional includeFields) { if (includeFields.isPresent()) { this.includeFields = OptionalNullable.of(includeFields.get()); @@ -218,7 +218,7 @@ public _FinalStage includeFields(Optional includeFields) { *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeFields(Boolean includeFields) { this.includeFields = OptionalNullable.of(includeFields); return this; @@ -227,7 +227,7 @@ public _FinalStage includeFields(Boolean includeFields) { /** *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) public _FinalStage includeFields(@Nullable OptionalNullable includeFields) { this.includeFields = includeFields; @@ -238,7 +238,7 @@ public _FinalStage includeFields(@Nullable OptionalNullable includeFiel *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); @@ -254,7 +254,7 @@ public _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage fields(Optional fields) { if (fields.isPresent()) { this.fields = OptionalNullable.of(fields.get()); @@ -268,7 +268,7 @@ public _FinalStage fields(Optional fields) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage fields(String fields) { this.fields = OptionalNullable.of(fields); return this; @@ -277,14 +277,14 @@ public _FinalStage fields(String fields) { /** *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ - @java.lang.Override + @Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(@Nullable OptionalNullable fields) { this.fields = fields; return this; } - @java.lang.Override + @Override public ListUsersByEmailRequestParameters build() { return new ListUsersByEmailRequestParameters(fields, includeFields, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java index 6367d2130..608eaa856 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getUsers() { return users; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(ListUsersOffsetPaginatedResponseContent other) { && users.equals(other.users); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.users); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java index 474ff3d05..8d5537ee6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListUsersRequestParameters.Builder.class) @@ -76,9 +76,6 @@ private ListUsersRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -184,12 +181,6 @@ public OptionalNullable getPrimaryOrder() { return primaryOrder; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("sort") private OptionalNullable _getSort() { @@ -232,7 +223,7 @@ private OptionalNullable _getPrimaryOrder() { return primaryOrder; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersRequestParameters && equalTo((ListUsersRequestParameters) other); @@ -256,7 +247,7 @@ private boolean equalTo(ListUsersRequestParameters other) { && primaryOrder.equals(other.primaryOrder); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.page, @@ -271,7 +262,7 @@ public int hashCode() { this.primaryOrder); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -325,7 +316,7 @@ public Builder from(ListUsersRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -344,7 +335,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -378,7 +369,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -412,7 +403,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { @@ -427,7 +418,7 @@ public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includ *

Field to sort by. Use <code>field:order</code> where order is <code>1</code> for ascending and <code>-1</code> for descending. e.g. <code>created_at:1</code>

*/ @JsonSetter(value = "sort", nulls = Nulls.SKIP) - public Builder sort(@Nullable OptionalNullable sort) { + public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { this.sort = sort; return this; } @@ -446,7 +437,7 @@ public Builder sort(Optional sort) { return this; } - public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + public Builder sort(Nullable sort) { if (sort.isNull()) { this.sort = OptionalNullable.ofNull(); } else if (sort.isEmpty()) { @@ -461,7 +452,7 @@ public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { *

Connection filter. Only applies when using <code>search_engine=v1</code>. To filter by connection with <code>search_engine=v2|v3</code>, use <code>q=identities.connection:"connection_name"</code>

*/ @JsonSetter(value = "connection", nulls = Nulls.SKIP) - public Builder connection(@Nullable OptionalNullable connection) { + public Builder connection(@org.jetbrains.annotations.Nullable OptionalNullable connection) { this.connection = connection; return this; } @@ -480,7 +471,7 @@ public Builder connection(Optional connection) { return this; } - public Builder connection(com.auth0.client.mgmt.core.Nullable connection) { + public Builder connection(Nullable connection) { if (connection.isNull()) { this.connection = OptionalNullable.ofNull(); } else if (connection.isEmpty()) { @@ -495,7 +486,7 @@ public Builder connection(com.auth0.client.mgmt.core.Nullable connection *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@Nullable OptionalNullable fields) { + public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -514,7 +505,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { + public Builder fields(Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -529,7 +520,7 @@ public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { *

Whether specified fields are to be included (true) or excluded (false).

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@Nullable OptionalNullable includeFields) { + public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -548,7 +539,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { + public Builder includeFields(Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { @@ -563,7 +554,7 @@ public Builder includeFields(com.auth0.client.mgmt.core.Nullable includ *

Query in <a target='_new' href ='http://www.lucenetutorial.com/lucene-query-syntax.html'>Lucene query string syntax</a>. Some query types cannot be used on metadata fields, for details see <a href='https://auth0.com/docs/users/search/v3/query-syntax#searchable-fields'>Searchable Fields</a>.

*/ @JsonSetter(value = "q", nulls = Nulls.SKIP) - public Builder q(@Nullable OptionalNullable q) { + public Builder q(@org.jetbrains.annotations.Nullable OptionalNullable q) { this.q = q; return this; } @@ -582,7 +573,7 @@ public Builder q(Optional q) { return this; } - public Builder q(com.auth0.client.mgmt.core.Nullable q) { + public Builder q(Nullable q) { if (q.isNull()) { this.q = OptionalNullable.ofNull(); } else if (q.isEmpty()) { @@ -597,7 +588,8 @@ public Builder q(com.auth0.client.mgmt.core.Nullable q) { *

The version of the search engine

*/ @JsonSetter(value = "search_engine", nulls = Nulls.SKIP) - public Builder searchEngine(@Nullable OptionalNullable searchEngine) { + public Builder searchEngine( + @org.jetbrains.annotations.Nullable OptionalNullable searchEngine) { this.searchEngine = searchEngine; return this; } @@ -616,7 +608,7 @@ public Builder searchEngine(Optional searchEngine) { return this; } - public Builder searchEngine(com.auth0.client.mgmt.core.Nullable searchEngine) { + public Builder searchEngine(Nullable searchEngine) { if (searchEngine.isNull()) { this.searchEngine = OptionalNullable.ofNull(); } else if (searchEngine.isEmpty()) { @@ -631,7 +623,7 @@ public Builder searchEngine(com.auth0.client.mgmt.core.NullableIf true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required.

*/ @JsonSetter(value = "primary_order", nulls = Nulls.SKIP) - public Builder primaryOrder(@Nullable OptionalNullable primaryOrder) { + public Builder primaryOrder(@org.jetbrains.annotations.Nullable OptionalNullable primaryOrder) { this.primaryOrder = primaryOrder; return this; } @@ -650,7 +642,7 @@ public Builder primaryOrder(Optional primaryOrder) { return this; } - public Builder primaryOrder(com.auth0.client.mgmt.core.Nullable primaryOrder) { + public Builder primaryOrder(Nullable primaryOrder) { if (primaryOrder.isNull()) { this.primaryOrder = OptionalNullable.ofNull(); } else if (primaryOrder.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java index 6de2aee25..4f17ab9c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getTemplates() { return templates; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListVerifiableCredentialTemplatesPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListVerifiableCredentialTemplatesPaginatedResponseConten return next.equals(other.next) && templates.equals(other.templates); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.next, this.templates); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Log.java b/src/main/java/com/auth0/client/mgmt/types/Log.java index 27dd1c32b..c7c583c70 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Log.java +++ b/src/main/java/com/auth0/client/mgmt/types/Log.java @@ -280,7 +280,7 @@ private OptionalNullable _getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Log && equalTo((Log) other); @@ -315,7 +315,7 @@ private boolean equalTo(Log other) { && locationInfo.equals(other.locationInfo); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.date, @@ -341,7 +341,7 @@ public int hashCode() { this.locationInfo); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogDate.java b/src/main/java/com/auth0/client/mgmt/types/LogDate.java index 5dca4f02f..55307283b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogDate.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogDate && equalTo((LogDate) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogDate other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(LogDate.class); } - @java.lang.Override + @Override public LogDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java index 135dfbfdd..16c13eeff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java @@ -123,7 +123,7 @@ public Optional getContinentCode() { return continentCode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogLocationInfo && equalTo((LogLocationInfo) other); @@ -145,7 +145,7 @@ private boolean equalTo(LogLocationInfo other) { && continentCode.equals(other.continentCode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.countryCode, @@ -158,7 +158,7 @@ public int hashCode() { this.continentCode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java index d3e305a6b..ccf23b6b2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java @@ -48,7 +48,7 @@ public Optional getJa4() { return ja4; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogSecurityContext && equalTo((LogSecurityContext) other); @@ -63,12 +63,12 @@ private boolean equalTo(LogSecurityContext other) { return ja3.equals(other.ja3) && ja4.equals(other.ja4); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ja3, this.ja4); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java index 73427a011..90c3f0cbc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamDatadogRegionEnum && this.string.equals(((LogStreamDatadogRegionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java index 7655a24c4..72c59837c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamDatadogResponseSchema && equalTo((LogStreamDatadogResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamDatadogResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java index 98ca3b2d4..abda90cfa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java @@ -45,7 +45,7 @@ public LogStreamDatadogRegionEnum getDatadogRegion() { return datadogRegion; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamDatadogSink && equalTo((LogStreamDatadogSink) other); @@ -60,12 +60,12 @@ private boolean equalTo(LogStreamDatadogSink other) { return datadogApiKey.equals(other.datadogApiKey) && datadogRegion.equals(other.datadogRegion); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.datadogApiKey, this.datadogRegion); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -102,7 +102,7 @@ public static final class Builder implements DatadogApiKeyStage, DatadogRegionSt private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamDatadogSink other) { datadogApiKey(other.getDatadogApiKey()); datadogRegion(other.getDatadogRegion()); @@ -114,21 +114,21 @@ public Builder from(LogStreamDatadogSink other) { *

Datadog API Key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("datadogApiKey") public DatadogRegionStage datadogApiKey(@NotNull String datadogApiKey) { this.datadogApiKey = Objects.requireNonNull(datadogApiKey, "datadogApiKey must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("datadogRegion") public _FinalStage datadogRegion(@NotNull LogStreamDatadogRegionEnum datadogRegion) { this.datadogRegion = Objects.requireNonNull(datadogRegion, "datadogRegion must not be null"); return this; } - @java.lang.Override + @Override public LogStreamDatadogSink build() { return new LogStreamDatadogSink(datadogApiKey, datadogRegion, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java index 9389ff557..a7ec758a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventBridgeResponseSchema @@ -135,13 +135,13 @@ private boolean equalTo(LogStreamEventBridgeResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java index 30d1188dc..0d67e55b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java @@ -61,7 +61,7 @@ public Optional getAwsPartnerEventSource() { return awsPartnerEventSource; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventBridgeSink && equalTo((LogStreamEventBridgeSink) other); @@ -78,12 +78,12 @@ private boolean equalTo(LogStreamEventBridgeSink other) { && awsPartnerEventSource.equals(other.awsPartnerEventSource); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -129,7 +129,7 @@ public static final class Builder implements AwsAccountIdStage, AwsRegionStage, private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamEventBridgeSink other) { awsAccountId(other.getAwsAccountId()); awsRegion(other.getAwsRegion()); @@ -142,14 +142,14 @@ public Builder from(LogStreamEventBridgeSink other) { *

AWS account ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("awsAccountId") public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("awsRegion") public _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegion) { this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); @@ -160,7 +160,7 @@ public _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegi *

AWS EventBridge partner event source

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); return this; @@ -169,14 +169,14 @@ public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { /** *

AWS EventBridge partner event source

*/ - @java.lang.Override + @Override @JsonSetter(value = "awsPartnerEventSource", nulls = Nulls.SKIP) public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { this.awsPartnerEventSource = awsPartnerEventSource; return this; } - @java.lang.Override + @Override public LogStreamEventBridgeSink build() { return new LogStreamEventBridgeSink(awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java index 8105f44a2..ee33639e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java @@ -7,26 +7,56 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class LogStreamEventBridgeSinkRegionEnum { + public static final LogStreamEventBridgeSinkRegionEnum EU_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_SOUTH1, "eu-south-1"); + public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST2 = new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST2, "ap-northeast-2"); public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST1 = new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST1, "ap-southeast-1"); - public static final LogStreamEventBridgeSinkRegionEnum ME_SOUTH1 = - new LogStreamEventBridgeSinkRegionEnum(Value.ME_SOUTH1, "me-south-1"); + public static final LogStreamEventBridgeSinkRegionEnum EU_SOUTH2 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_SOUTH2, "eu-south-2"); public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST3 = new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST3, "ap-northeast-3"); + public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST1, "ap-northeast-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTH1, "ap-south-1"); + + public static final LogStreamEventBridgeSinkRegionEnum CA_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.CA_CENTRAL1, "ca-central-1"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_NORTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_NORTH1, "eu-north-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTH2 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTH2, "ap-south-2"); + + public static final LogStreamEventBridgeSinkRegionEnum US_GOV_WEST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.US_GOV_WEST1, "us-gov-west-1"); + + public static final LogStreamEventBridgeSinkRegionEnum CA_WEST1 = + new LogStreamEventBridgeSinkRegionEnum(Value.CA_WEST1, "ca-west-1"); + + public static final LogStreamEventBridgeSinkRegionEnum ME_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.ME_SOUTH1, "me-south-1"); + + public static final LogStreamEventBridgeSinkRegionEnum MX_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.MX_CENTRAL1, "mx-central-1"); + public static final LogStreamEventBridgeSinkRegionEnum US_EAST1 = new LogStreamEventBridgeSinkRegionEnum(Value.US_EAST1, "us-east-1"); public static final LogStreamEventBridgeSinkRegionEnum SA_EAST1 = new LogStreamEventBridgeSinkRegionEnum(Value.SA_EAST1, "sa-east-1"); - public static final LogStreamEventBridgeSinkRegionEnum AP_NORTHEAST1 = - new LogStreamEventBridgeSinkRegionEnum(Value.AP_NORTHEAST1, "ap-northeast-1"); + public static final LogStreamEventBridgeSinkRegionEnum AP_EAST2 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_EAST2, "ap-east-2"); public static final LogStreamEventBridgeSinkRegionEnum US_GOV_EAST1 = new LogStreamEventBridgeSinkRegionEnum(Value.US_GOV_EAST1, "us-gov-east-1"); @@ -34,20 +64,20 @@ public final class LogStreamEventBridgeSinkRegionEnum { public static final LogStreamEventBridgeSinkRegionEnum US_EAST2 = new LogStreamEventBridgeSinkRegionEnum(Value.US_EAST2, "us-east-2"); - public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTH1 = - new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTH1, "ap-south-1"); - - public static final LogStreamEventBridgeSinkRegionEnum CA_CENTRAL1 = - new LogStreamEventBridgeSinkRegionEnum(Value.CA_CENTRAL1, "ca-central-1"); - - public static final LogStreamEventBridgeSinkRegionEnum EU_NORTH1 = - new LogStreamEventBridgeSinkRegionEnum(Value.EU_NORTH1, "eu-north-1"); + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST5 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST5, "ap-southeast-5"); public static final LogStreamEventBridgeSinkRegionEnum AP_EAST1 = new LogStreamEventBridgeSinkRegionEnum(Value.AP_EAST1, "ap-east-1"); - public static final LogStreamEventBridgeSinkRegionEnum US_GOV_WEST1 = - new LogStreamEventBridgeSinkRegionEnum(Value.US_GOV_WEST1, "us-gov-west-1"); + public static final LogStreamEventBridgeSinkRegionEnum ME_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.ME_CENTRAL1, "me-central-1"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST7 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST7, "ap-southeast-7"); + + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST6 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST6, "ap-southeast-6"); public static final LogStreamEventBridgeSinkRegionEnum US_WEST2 = new LogStreamEventBridgeSinkRegionEnum(Value.US_WEST2, "us-west-2"); @@ -55,18 +85,33 @@ public final class LogStreamEventBridgeSinkRegionEnum { public static final LogStreamEventBridgeSinkRegionEnum EU_WEST3 = new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST3, "eu-west-3"); + public static final LogStreamEventBridgeSinkRegionEnum AF_SOUTH1 = + new LogStreamEventBridgeSinkRegionEnum(Value.AF_SOUTH1, "af-south-1"); + public static final LogStreamEventBridgeSinkRegionEnum EU_WEST2 = new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST2, "eu-west-2"); public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST2 = new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST2, "ap-southeast-2"); + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST4 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST4, "ap-southeast-4"); + public static final LogStreamEventBridgeSinkRegionEnum EU_CENTRAL1 = new LogStreamEventBridgeSinkRegionEnum(Value.EU_CENTRAL1, "eu-central-1"); + public static final LogStreamEventBridgeSinkRegionEnum IL_CENTRAL1 = + new LogStreamEventBridgeSinkRegionEnum(Value.IL_CENTRAL1, "il-central-1"); + public static final LogStreamEventBridgeSinkRegionEnum US_WEST1 = new LogStreamEventBridgeSinkRegionEnum(Value.US_WEST1, "us-west-1"); + public static final LogStreamEventBridgeSinkRegionEnum AP_SOUTHEAST3 = + new LogStreamEventBridgeSinkRegionEnum(Value.AP_SOUTHEAST3, "ap-southeast-3"); + + public static final LogStreamEventBridgeSinkRegionEnum EU_CENTRAL2 = + new LogStreamEventBridgeSinkRegionEnum(Value.EU_CENTRAL2, "eu-central-2"); + public static final LogStreamEventBridgeSinkRegionEnum EU_WEST1 = new LogStreamEventBridgeSinkRegionEnum(Value.EU_WEST1, "eu-west-1"); @@ -83,66 +128,96 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamEventBridgeSinkRegionEnum && this.string.equals(((LogStreamEventBridgeSinkRegionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } public T visit(Visitor visitor) { switch (value) { + case EU_SOUTH1: + return visitor.visitEuSouth1(); case AP_NORTHEAST2: return visitor.visitApNortheast2(); case AP_SOUTHEAST1: return visitor.visitApSoutheast1(); - case ME_SOUTH1: - return visitor.visitMeSouth1(); + case EU_SOUTH2: + return visitor.visitEuSouth2(); case AP_NORTHEAST3: return visitor.visitApNortheast3(); - case US_EAST1: - return visitor.visitUsEast1(); - case SA_EAST1: - return visitor.visitSaEast1(); case AP_NORTHEAST1: return visitor.visitApNortheast1(); - case US_GOV_EAST1: - return visitor.visitUsGovEast1(); - case US_EAST2: - return visitor.visitUsEast2(); case AP_SOUTH1: return visitor.visitApSouth1(); case CA_CENTRAL1: return visitor.visitCaCentral1(); case EU_NORTH1: return visitor.visitEuNorth1(); - case AP_EAST1: - return visitor.visitApEast1(); + case AP_SOUTH2: + return visitor.visitApSouth2(); case US_GOV_WEST1: return visitor.visitUsGovWest1(); + case CA_WEST1: + return visitor.visitCaWest1(); + case ME_SOUTH1: + return visitor.visitMeSouth1(); + case MX_CENTRAL1: + return visitor.visitMxCentral1(); + case US_EAST1: + return visitor.visitUsEast1(); + case SA_EAST1: + return visitor.visitSaEast1(); + case AP_EAST2: + return visitor.visitApEast2(); + case US_GOV_EAST1: + return visitor.visitUsGovEast1(); + case US_EAST2: + return visitor.visitUsEast2(); + case AP_SOUTHEAST5: + return visitor.visitApSoutheast5(); + case AP_EAST1: + return visitor.visitApEast1(); + case ME_CENTRAL1: + return visitor.visitMeCentral1(); + case AP_SOUTHEAST7: + return visitor.visitApSoutheast7(); + case AP_SOUTHEAST6: + return visitor.visitApSoutheast6(); case US_WEST2: return visitor.visitUsWest2(); case EU_WEST3: return visitor.visitEuWest3(); + case AF_SOUTH1: + return visitor.visitAfSouth1(); case EU_WEST2: return visitor.visitEuWest2(); case AP_SOUTHEAST2: return visitor.visitApSoutheast2(); + case AP_SOUTHEAST4: + return visitor.visitApSoutheast4(); case EU_CENTRAL1: return visitor.visitEuCentral1(); + case IL_CENTRAL1: + return visitor.visitIlCentral1(); case US_WEST1: return visitor.visitUsWest1(); + case AP_SOUTHEAST3: + return visitor.visitApSoutheast3(); + case EU_CENTRAL2: + return visitor.visitEuCentral2(); case EU_WEST1: return visitor.visitEuWest1(); case UNKNOWN: @@ -154,46 +229,76 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static LogStreamEventBridgeSinkRegionEnum valueOf(String value) { switch (value) { + case "eu-south-1": + return EU_SOUTH1; case "ap-northeast-2": return AP_NORTHEAST2; case "ap-southeast-1": return AP_SOUTHEAST1; - case "me-south-1": - return ME_SOUTH1; + case "eu-south-2": + return EU_SOUTH2; case "ap-northeast-3": return AP_NORTHEAST3; - case "us-east-1": - return US_EAST1; - case "sa-east-1": - return SA_EAST1; case "ap-northeast-1": return AP_NORTHEAST1; - case "us-gov-east-1": - return US_GOV_EAST1; - case "us-east-2": - return US_EAST2; case "ap-south-1": return AP_SOUTH1; case "ca-central-1": return CA_CENTRAL1; case "eu-north-1": return EU_NORTH1; - case "ap-east-1": - return AP_EAST1; + case "ap-south-2": + return AP_SOUTH2; case "us-gov-west-1": return US_GOV_WEST1; + case "ca-west-1": + return CA_WEST1; + case "me-south-1": + return ME_SOUTH1; + case "mx-central-1": + return MX_CENTRAL1; + case "us-east-1": + return US_EAST1; + case "sa-east-1": + return SA_EAST1; + case "ap-east-2": + return AP_EAST2; + case "us-gov-east-1": + return US_GOV_EAST1; + case "us-east-2": + return US_EAST2; + case "ap-southeast-5": + return AP_SOUTHEAST5; + case "ap-east-1": + return AP_EAST1; + case "me-central-1": + return ME_CENTRAL1; + case "ap-southeast-7": + return AP_SOUTHEAST7; + case "ap-southeast-6": + return AP_SOUTHEAST6; case "us-west-2": return US_WEST2; case "eu-west-3": return EU_WEST3; + case "af-south-1": + return AF_SOUTH1; case "eu-west-2": return EU_WEST2; case "ap-southeast-2": return AP_SOUTHEAST2; + case "ap-southeast-4": + return AP_SOUTHEAST4; case "eu-central-1": return EU_CENTRAL1; + case "il-central-1": + return IL_CENTRAL1; case "us-west-1": return US_WEST1; + case "ap-southeast-3": + return AP_SOUTHEAST3; + case "eu-central-2": + return EU_CENTRAL2; case "eu-west-1": return EU_WEST1; default: @@ -202,8 +307,12 @@ public static LogStreamEventBridgeSinkRegionEnum valueOf(String value) { } public enum Value { + AF_SOUTH1, + AP_EAST1, + AP_EAST2, + AP_NORTHEAST1, AP_NORTHEAST2, @@ -212,24 +321,50 @@ public enum Value { AP_SOUTH1, + AP_SOUTH2, + AP_SOUTHEAST1, AP_SOUTHEAST2, + AP_SOUTHEAST3, + + AP_SOUTHEAST4, + + AP_SOUTHEAST5, + + AP_SOUTHEAST6, + + AP_SOUTHEAST7, + CA_CENTRAL1, + CA_WEST1, + EU_CENTRAL1, + EU_CENTRAL2, + EU_NORTH1, + EU_SOUTH1, + + EU_SOUTH2, + EU_WEST1, EU_WEST2, EU_WEST3, + IL_CENTRAL1, + + ME_CENTRAL1, + ME_SOUTH1, + MX_CENTRAL1, + SA_EAST1, US_GOV_EAST1, @@ -248,8 +383,12 @@ public enum Value { } public interface Visitor { + T visitAfSouth1(); + T visitApEast1(); + T visitApEast2(); + T visitApNortheast1(); T visitApNortheast2(); @@ -258,24 +397,50 @@ public interface Visitor { T visitApSouth1(); + T visitApSouth2(); + T visitApSoutheast1(); T visitApSoutheast2(); + T visitApSoutheast3(); + + T visitApSoutheast4(); + + T visitApSoutheast5(); + + T visitApSoutheast6(); + + T visitApSoutheast7(); + T visitCaCentral1(); + T visitCaWest1(); + T visitEuCentral1(); + T visitEuCentral2(); + T visitEuNorth1(); + T visitEuSouth1(); + + T visitEuSouth2(); + T visitEuWest1(); T visitEuWest2(); T visitEuWest3(); + T visitIlCentral1(); + + T visitMeCentral1(); + T visitMeSouth1(); + T visitMxCentral1(); + T visitSaEast1(); T visitUsGovEast1(); diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java index daae8ad22..822ca29fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java @@ -119,20 +119,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamEventGridRegionEnum && this.string.equals(((LogStreamEventGridRegionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java index 88fbbb0ea..fab10c215 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventGridResponseSchema && equalTo((LogStreamEventGridResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamEventGridResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java index f15163dd5..b984ee893 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java @@ -73,7 +73,7 @@ public Optional getAzurePartnerTopic() { return azurePartnerTopic; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventGridSink && equalTo((LogStreamEventGridSink) other); @@ -91,13 +91,13 @@ private boolean equalTo(LogStreamEventGridSink other) { && azurePartnerTopic.equals(other.azurePartnerTopic); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.azureSubscriptionId, this.azureRegion, this.azureResourceGroup, this.azurePartnerTopic); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,7 +153,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamEventGridSink other) { azureSubscriptionId(other.getAzureSubscriptionId()); azureRegion(other.getAzureRegion()); @@ -167,7 +167,7 @@ public Builder from(LogStreamEventGridSink other) { *

Subscription ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("azureSubscriptionId") public AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId) { this.azureSubscriptionId = @@ -175,7 +175,7 @@ public AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId) return this; } - @java.lang.Override + @Override @JsonSetter("azureRegion") public AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum azureRegion) { this.azureRegion = Objects.requireNonNull(azureRegion, "azureRegion must not be null"); @@ -187,7 +187,7 @@ public AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum *

Resource Group

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("azureResourceGroup") public _FinalStage azureResourceGroup(@NotNull String azureResourceGroup) { this.azureResourceGroup = Objects.requireNonNull(azureResourceGroup, "azureResourceGroup must not be null"); @@ -198,7 +198,7 @@ public _FinalStage azureResourceGroup(@NotNull String azureResourceGroup) { *

Partner Topic

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage azurePartnerTopic(String azurePartnerTopic) { this.azurePartnerTopic = Optional.ofNullable(azurePartnerTopic); return this; @@ -207,14 +207,14 @@ public _FinalStage azurePartnerTopic(String azurePartnerTopic) { /** *

Partner Topic

*/ - @java.lang.Override + @Override @JsonSetter(value = "azurePartnerTopic", nulls = Nulls.SKIP) public _FinalStage azurePartnerTopic(Optional azurePartnerTopic) { this.azurePartnerTopic = azurePartnerTopic; return this; } - @java.lang.Override + @Override public LogStreamEventGridSink build() { return new LogStreamEventGridSink( azureSubscriptionId, azureRegion, azureResourceGroup, azurePartnerTopic, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java index 12f7c4c6d..89eaf387a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java @@ -45,7 +45,7 @@ public Optional getName() { return name; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamFilter && equalTo((LogStreamFilter) other); @@ -60,12 +60,12 @@ private boolean equalTo(LogStreamFilter other) { return type.equals(other.type) && name.equals(other.name); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.name); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java index 5690aa6ca..37dc02cc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java @@ -79,20 +79,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamFilterGroupNameEnum && this.string.equals(((LogStreamFilterGroupNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java index ff2a585bb..3553b3f2d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamHttpContentFormatEnum && this.string.equals(((LogStreamHttpContentFormatEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java index 09f1163f7..1f89c0826 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamHttpResponseSchema && equalTo((LogStreamHttpResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamHttpResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java index 73ec671fe..6c58cf2ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java @@ -86,7 +86,7 @@ public Optional> getHttpCustomHeaders() { return httpCustomHeaders; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamHttpSink && equalTo((LogStreamHttpSink) other); @@ -105,7 +105,7 @@ private boolean equalTo(LogStreamHttpSink other) { && httpCustomHeaders.equals(other.httpCustomHeaders); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.httpAuthorization, @@ -115,7 +115,7 @@ public int hashCode() { this.httpCustomHeaders); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements HttpEndpointStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamHttpSink other) { httpAuthorization(other.getHttpAuthorization()); httpContentFormat(other.getHttpContentFormat()); @@ -194,7 +194,7 @@ public Builder from(LogStreamHttpSink other) { *

HTTP endpoint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("httpEndpoint") public _FinalStage httpEndpoint(@NotNull String httpEndpoint) { this.httpEndpoint = Objects.requireNonNull(httpEndpoint, "httpEndpoint must not be null"); @@ -205,7 +205,7 @@ public _FinalStage httpEndpoint(@NotNull String httpEndpoint) { *

custom HTTP headers

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage httpCustomHeaders(List httpCustomHeaders) { this.httpCustomHeaders = Optional.ofNullable(httpCustomHeaders); return this; @@ -214,7 +214,7 @@ public _FinalStage httpCustomHeaders(List httpCustomHeaders) { /** *

custom HTTP headers

*/ - @java.lang.Override + @Override @JsonSetter(value = "httpCustomHeaders", nulls = Nulls.SKIP) public _FinalStage httpCustomHeaders(Optional> httpCustomHeaders) { this.httpCustomHeaders = httpCustomHeaders; @@ -225,7 +225,7 @@ public _FinalStage httpCustomHeaders(Optional> httpCustom *

HTTP Content-Type header

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage httpContentType(String httpContentType) { this.httpContentType = Optional.ofNullable(httpContentType); return this; @@ -234,20 +234,20 @@ public _FinalStage httpContentType(String httpContentType) { /** *

HTTP Content-Type header

*/ - @java.lang.Override + @Override @JsonSetter(value = "httpContentType", nulls = Nulls.SKIP) public _FinalStage httpContentType(Optional httpContentType) { this.httpContentType = httpContentType; return this; } - @java.lang.Override + @Override public _FinalStage httpContentFormat(LogStreamHttpContentFormatEnum httpContentFormat) { this.httpContentFormat = Optional.ofNullable(httpContentFormat); return this; } - @java.lang.Override + @Override @JsonSetter(value = "httpContentFormat", nulls = Nulls.SKIP) public _FinalStage httpContentFormat(Optional httpContentFormat) { this.httpContentFormat = httpContentFormat; @@ -258,7 +258,7 @@ public _FinalStage httpContentFormat(Optional ht *

HTTP Authorization header

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage httpAuthorization(String httpAuthorization) { this.httpAuthorization = Optional.ofNullable(httpAuthorization); return this; @@ -267,14 +267,14 @@ public _FinalStage httpAuthorization(String httpAuthorization) { /** *

HTTP Authorization header

*/ - @java.lang.Override + @Override @JsonSetter(value = "httpAuthorization", nulls = Nulls.SKIP) public _FinalStage httpAuthorization(Optional httpAuthorization) { this.httpAuthorization = httpAuthorization; return this; } - @java.lang.Override + @Override public LogStreamHttpSink build() { return new LogStreamHttpSink( httpAuthorization, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java index ed11aaa74..e600bd742 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamMixpanelRegionEnum && this.string.equals(((LogStreamMixpanelRegionEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java index f45369b57..82c4c0120 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelResponseSchema && equalTo((LogStreamMixpanelResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamMixpanelResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java index 0ca307704..6f481d40e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java @@ -71,7 +71,7 @@ public String getMixpanelServiceAccountPassword() { return mixpanelServiceAccountPassword; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelSink && equalTo((LogStreamMixpanelSink) other); @@ -89,7 +89,7 @@ private boolean equalTo(LogStreamMixpanelSink other) { && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.mixpanelRegion, @@ -98,7 +98,7 @@ public int hashCode() { this.mixpanelServiceAccountPassword); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamMixpanelSink other) { mixpanelRegion(other.getMixpanelRegion()); mixpanelProjectId(other.getMixpanelProjectId()); @@ -168,7 +168,7 @@ public Builder from(LogStreamMixpanelSink other) { return this; } - @java.lang.Override + @Override @JsonSetter("mixpanelRegion") public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); @@ -180,7 +180,7 @@ public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnu *

Mixpanel Project Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("mixpanelProjectId") public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); @@ -192,7 +192,7 @@ public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mix *

Mixpanel Service Account Username

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("mixpanelServiceAccountUsername") public MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( @NotNull String mixpanelServiceAccountUsername) { @@ -206,7 +206,7 @@ public MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( *

Mixpanel Service Account Password

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("mixpanelServiceAccountPassword") public _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = Objects.requireNonNull( @@ -214,7 +214,7 @@ public _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServic return this; } - @java.lang.Override + @Override public LogStreamMixpanelSink build() { return new LogStreamMixpanelSink( mixpanelRegion, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java index c77a29061..91d8a2932 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java @@ -73,7 +73,7 @@ public Optional getMixpanelServiceAccountPassword() { return mixpanelServiceAccountPassword; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelSinkPatch && equalTo((LogStreamMixpanelSinkPatch) other); @@ -91,7 +91,7 @@ private boolean equalTo(LogStreamMixpanelSinkPatch other) { && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.mixpanelRegion, @@ -100,7 +100,7 @@ public int hashCode() { this.mixpanelServiceAccountPassword); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -156,7 +156,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamMixpanelSinkPatch other) { mixpanelRegion(other.getMixpanelRegion()); mixpanelProjectId(other.getMixpanelProjectId()); @@ -165,7 +165,7 @@ public Builder from(LogStreamMixpanelSinkPatch other) { return this; } - @java.lang.Override + @Override @JsonSetter("mixpanelRegion") public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); @@ -177,7 +177,7 @@ public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnu *

Mixpanel Project Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("mixpanelProjectId") public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); @@ -189,7 +189,7 @@ public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mix *

Mixpanel Service Account Username

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("mixpanelServiceAccountUsername") public _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServiceAccountUsername) { this.mixpanelServiceAccountUsername = Objects.requireNonNull( @@ -201,7 +201,7 @@ public _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServic *

Mixpanel Service Account Password

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = Optional.ofNullable(mixpanelServiceAccountPassword); return this; @@ -210,14 +210,14 @@ public _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountP /** *

Mixpanel Service Account Password

*/ - @java.lang.Override + @Override @JsonSetter(value = "mixpanelServiceAccountPassword", nulls = Nulls.SKIP) public _FinalStage mixpanelServiceAccountPassword(Optional mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = mixpanelServiceAccountPassword; return this; } - @java.lang.Override + @Override public LogStreamMixpanelSinkPatch build() { return new LogStreamMixpanelSinkPatch( mixpanelRegion, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java index 3b71477db..792527cb2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java @@ -56,7 +56,7 @@ public Optional getAlgorithm() { return algorithm; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamPiiConfig && equalTo((LogStreamPiiConfig) other); @@ -71,12 +71,12 @@ private boolean equalTo(LogStreamPiiConfig other) { return logFields.equals(other.logFields) && method.equals(other.method) && algorithm.equals(other.algorithm); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.logFields, this.method, this.algorithm); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java index aa094af5b..9c4001a36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamPiiLogFieldsEnum && this.string.equals(((LogStreamPiiLogFieldsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java index d45d816df..68dc17862 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamPiiMethodEnum && this.string.equals(((LogStreamPiiMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java index 0e7be12ef..2829eaa68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamResponseSchema && equalTo((LogStreamResponseSchema) other); @@ -61,12 +61,12 @@ private boolean equalTo(LogStreamResponseSchema other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer super(LogStreamResponseSchema.class); } - @java.lang.Override + @Override public LogStreamResponseSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java index e0a1ec9aa..3c56061f4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentResponseSchema && equalTo((LogStreamSegmentResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSegmentResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java index 26b9a8047..7cc66f423 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java @@ -37,7 +37,7 @@ public Optional getSegmentWriteKey() { return segmentWriteKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentSink && equalTo((LogStreamSegmentSink) other); @@ -52,12 +52,12 @@ private boolean equalTo(LogStreamSegmentSink other) { return segmentWriteKey.equals(other.segmentWriteKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.segmentWriteKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java index b349b869f..de367f52b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java @@ -36,7 +36,7 @@ public String getSegmentWriteKey() { return segmentWriteKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentSinkWriteKey && equalTo((LogStreamSegmentSinkWriteKey) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogStreamSegmentSinkWriteKey other) { return segmentWriteKey.equals(other.segmentWriteKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.segmentWriteKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements SegmentWriteKeyStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamSegmentSinkWriteKey other) { segmentWriteKey(other.getSegmentWriteKey()); return this; @@ -98,14 +98,14 @@ public Builder from(LogStreamSegmentSinkWriteKey other) { *

Segment write key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("segmentWriteKey") public _FinalStage segmentWriteKey(@NotNull String segmentWriteKey) { this.segmentWriteKey = Objects.requireNonNull(segmentWriteKey, "segmentWriteKey must not be null"); return this; } - @java.lang.Override + @Override public LogStreamSegmentSinkWriteKey build() { return new LogStreamSegmentSinkWriteKey(segmentWriteKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java index 594e4516a..fa80644bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java @@ -47,7 +47,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSinkPatch && equalTo((LogStreamSinkPatch) other); @@ -57,12 +57,12 @@ private boolean equalTo(LogStreamSinkPatch other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -110,7 +110,7 @@ static final class Deserializer extends StdDeserializer { super(LogStreamSinkPatch.class); } - @java.lang.Override + @Override public LogStreamSinkPatch deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java index 3d48b6453..cd6bbd8d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSplunkResponseSchema && equalTo((LogStreamSplunkResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSplunkResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java index 46a046528..c9a07bb9e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java @@ -74,7 +74,7 @@ public boolean getSplunkSecure() { return splunkSecure; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSplunkSink && equalTo((LogStreamSplunkSink) other); @@ -92,12 +92,12 @@ private boolean equalTo(LogStreamSplunkSink other) { && splunkSecure == other.splunkSecure; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.splunkDomain, this.splunkPort, this.splunkToken, this.splunkSecure); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -156,7 +156,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamSplunkSink other) { splunkDomain(other.getSplunkDomain()); splunkPort(other.getSplunkPort()); @@ -170,7 +170,7 @@ public Builder from(LogStreamSplunkSink other) { *

Splunk URL Endpoint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("splunkDomain") public SplunkPortStage splunkDomain(@NotNull String splunkDomain) { this.splunkDomain = Objects.requireNonNull(splunkDomain, "splunkDomain must not be null"); @@ -182,7 +182,7 @@ public SplunkPortStage splunkDomain(@NotNull String splunkDomain) { *

Port

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("splunkPort") public SplunkTokenStage splunkPort(@NotNull String splunkPort) { this.splunkPort = Objects.requireNonNull(splunkPort, "splunkPort must not be null"); @@ -194,7 +194,7 @@ public SplunkTokenStage splunkPort(@NotNull String splunkPort) { *

Splunk token

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("splunkToken") public SplunkSecureStage splunkToken(@NotNull String splunkToken) { this.splunkToken = Objects.requireNonNull(splunkToken, "splunkToken must not be null"); @@ -206,14 +206,14 @@ public SplunkSecureStage splunkToken(@NotNull String splunkToken) { *

Verify TLS certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("splunkSecure") public _FinalStage splunkSecure(boolean splunkSecure) { this.splunkSecure = splunkSecure; return this; } - @java.lang.Override + @Override public LogStreamSplunkSink build() { return new LogStreamSplunkSink(splunkDomain, splunkPort, splunkToken, splunkSecure, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java index 4fb5fa90b..5b526f512 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamStatusEnum && this.string.equals(((LogStreamStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java index 3bff6f16c..8b26837f8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSumoResponseSchema && equalTo((LogStreamSumoResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSumoResponseSchema other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java index 5b26ddfea..5a902fddb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java @@ -36,7 +36,7 @@ public String getSumoSourceAddress() { return sumoSourceAddress; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSumoSink && equalTo((LogStreamSumoSink) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogStreamSumoSink other) { return sumoSourceAddress.equals(other.sumoSourceAddress); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.sumoSourceAddress); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements SumoSourceAddressStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(LogStreamSumoSink other) { sumoSourceAddress(other.getSumoSourceAddress()); return this; @@ -98,14 +98,14 @@ public Builder from(LogStreamSumoSink other) { *

HTTP Source Address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("sumoSourceAddress") public _FinalStage sumoSourceAddress(@NotNull String sumoSourceAddress) { this.sumoSourceAddress = Objects.requireNonNull(sumoSourceAddress, "sumoSourceAddress must not be null"); return this; } - @java.lang.Override + @Override public LogStreamSumoSink build() { return new LogStreamSumoSink(sumoSourceAddress, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java index db2e7af83..dc6a99446 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java @@ -279,7 +279,7 @@ public Optional getGivenNameNationalCharacter() { return givenNameNationalCharacter; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationProperties && equalTo((MdlPresentationProperties) other); @@ -314,7 +314,7 @@ private boolean equalTo(MdlPresentationProperties other) { && givenNameNationalCharacter.equals(other.givenNameNationalCharacter); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.familyName, @@ -340,7 +340,7 @@ public int hashCode() { this.givenNameNationalCharacter); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java index e9eb58149..31288e40f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java @@ -34,7 +34,7 @@ public MdlPresentationRequestProperties getOrgIso1801351MDl() { return orgIso1801351MDl; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationRequest && equalTo((MdlPresentationRequest) other); @@ -49,12 +49,12 @@ private boolean equalTo(MdlPresentationRequest other) { return orgIso1801351MDl.equals(other.orgIso1801351MDl); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.orgIso1801351MDl); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements OrgIso1801351MDlStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(MdlPresentationRequest other) { orgIso1801351MDl(other.getOrgIso1801351MDl()); return this; } - @java.lang.Override + @Override @JsonSetter("org.iso.18013.5.1.mDL") public _FinalStage orgIso1801351MDl(@NotNull MdlPresentationRequestProperties orgIso1801351MDl) { this.orgIso1801351MDl = Objects.requireNonNull(orgIso1801351MDl, "orgIso1801351MDl must not be null"); return this; } - @java.lang.Override + @Override public MdlPresentationRequest build() { return new MdlPresentationRequest(orgIso1801351MDl, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java index dde377856..b30f6e61f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java @@ -34,7 +34,7 @@ public MdlPresentationProperties getOrgIso1801351() { return orgIso1801351; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationRequestProperties && equalTo((MdlPresentationRequestProperties) other); @@ -49,12 +49,12 @@ private boolean equalTo(MdlPresentationRequestProperties other) { return orgIso1801351.equals(other.orgIso1801351); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.orgIso1801351); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements OrgIso1801351Stage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(MdlPresentationRequestProperties other) { orgIso1801351(other.getOrgIso1801351()); return this; } - @java.lang.Override + @Override @JsonSetter("org.iso.18013.5.1") public _FinalStage orgIso1801351(@NotNull MdlPresentationProperties orgIso1801351) { this.orgIso1801351 = Objects.requireNonNull(orgIso1801351, "orgIso1801351 must not be null"); return this; } - @java.lang.Override + @Override public MdlPresentationRequestProperties build() { return new MdlPresentationRequestProperties(orgIso1801351, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java index 4acf60e81..95ead1c06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof MfaPolicyEnum && this.string.equals(((MfaPolicyEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java index bef1b4f76..76f7d59fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java @@ -54,7 +54,7 @@ public Optional getGoogle() { return google; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLogin && equalTo((NativeSocialLogin) other); @@ -69,12 +69,12 @@ private boolean equalTo(NativeSocialLogin other) { return apple.equals(other.apple) && facebook.equals(other.facebook) && google.equals(other.google); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.apple, this.facebook, this.google); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java index ba6330302..1746a94a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginApple && equalTo((NativeSocialLoginApple) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginApple other) { return enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java index 0af39c46e..884801af9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginFacebook && equalTo((NativeSocialLoginFacebook) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginFacebook other) { return enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java index be456d506..b303d54d3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginGoogle && equalTo((NativeSocialLoginGoogle) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginGoogle other) { return enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java index 4a59f950e..510c64628 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java @@ -75,7 +75,7 @@ public Optional getRedirectUri() { return redirectUri; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclAction && equalTo((NetworkAclAction) other); @@ -94,12 +94,12 @@ private boolean equalTo(NetworkAclAction other) { && redirectUri.equals(other.redirectUri); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.block, this.allow, this.log, this.redirect, this.redirectUri); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java index d58a63488..cc98e3897 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java @@ -100,7 +100,7 @@ public Optional> getUserAgents() { return userAgents; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclMatch && equalTo((NetworkAclMatch) other); @@ -122,7 +122,7 @@ private boolean equalTo(NetworkAclMatch other) { && userAgents.equals(other.userAgents); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.asns, @@ -135,7 +135,7 @@ public int hashCode() { this.userAgents); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java index 8511f8a3d..7c9e0c6f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java @@ -64,7 +64,7 @@ public NetworkAclRuleScopeEnum getScope() { return scope; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclRule && equalTo((NetworkAclRule) other); @@ -82,12 +82,12 @@ private boolean equalTo(NetworkAclRule other) { && scope.equals(other.scope); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.action, this.match, this.notMatch, this.scope); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements ActionStage, ScopeStage, _FinalStag private Builder() {} - @java.lang.Override + @Override public Builder from(NetworkAclRule other) { action(other.getAction()); match(other.getMatch()); @@ -142,47 +142,47 @@ public Builder from(NetworkAclRule other) { return this; } - @java.lang.Override + @Override @JsonSetter("action") public ScopeStage action(@NotNull NetworkAclAction action) { this.action = Objects.requireNonNull(action, "action must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("scope") public _FinalStage scope(@NotNull NetworkAclRuleScopeEnum scope) { this.scope = Objects.requireNonNull(scope, "scope must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage notMatch(NetworkAclMatch notMatch) { this.notMatch = Optional.ofNullable(notMatch); return this; } - @java.lang.Override + @Override @JsonSetter(value = "not_match", nulls = Nulls.SKIP) public _FinalStage notMatch(Optional notMatch) { this.notMatch = notMatch; return this; } - @java.lang.Override + @Override public _FinalStage match(NetworkAclMatch match) { this.match = Optional.ofNullable(match); return this; } - @java.lang.Override + @Override @JsonSetter(value = "match", nulls = Nulls.SKIP) public _FinalStage match(Optional match) { this.match = match; return this; } - @java.lang.Override + @Override public NetworkAclRule build() { return new NetworkAclRule(action, match, notMatch, scope, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java index 0c899d0d3..6b99de896 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java @@ -15,6 +15,9 @@ public final class NetworkAclRuleScopeEnum { public static final NetworkAclRuleScopeEnum TENANT = new NetworkAclRuleScopeEnum(Value.TENANT, "tenant"); + public static final NetworkAclRuleScopeEnum DYNAMIC_CLIENT_REGISTRATION = + new NetworkAclRuleScopeEnum(Value.DYNAMIC_CLIENT_REGISTRATION, "dynamic_client_registration"); + private final Value value; private final String string; @@ -28,20 +31,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof NetworkAclRuleScopeEnum && this.string.equals(((NetworkAclRuleScopeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } @@ -54,6 +57,8 @@ public T visit(Visitor visitor) { return visitor.visitManagement(); case TENANT: return visitor.visitTenant(); + case DYNAMIC_CLIENT_REGISTRATION: + return visitor.visitDynamicClientRegistration(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -69,6 +74,8 @@ public static NetworkAclRuleScopeEnum valueOf(String value) { return MANAGEMENT; case "tenant": return TENANT; + case "dynamic_client_registration": + return DYNAMIC_CLIENT_REGISTRATION; default: return new NetworkAclRuleScopeEnum(Value.UNKNOWN, value); } @@ -81,6 +88,8 @@ public enum Value { TENANT, + DYNAMIC_CLIENT_REGISTRATION, + UNKNOWN } @@ -91,6 +100,8 @@ public interface Visitor { T visitTenant(); + T visitDynamicClientRegistration(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java index 6ab74dbe1..2b4059986 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclsResponseContent && equalTo((NetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(NetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java index 8d01f9770..bbd30f9c0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java @@ -10,6 +10,9 @@ public final class OauthScope { public static final OauthScope READ_AUTHENTICATION_METHODS = new OauthScope(Value.READ_AUTHENTICATION_METHODS, "read:authentication_methods"); + public static final OauthScope UPDATE_CLIENT_TOKEN_VAULT_PRIVILEGED_ACCESS = new OauthScope( + Value.UPDATE_CLIENT_TOKEN_VAULT_PRIVILEGED_ACCESS, "update:client_token_vault_privileged_access"); + public static final OauthScope UPDATE_USERS_APP_METADATA = new OauthScope(Value.UPDATE_USERS_APP_METADATA, "update:users_app_metadata"); @@ -78,6 +81,8 @@ public final class OauthScope { public static final OauthScope READ_TENANT_FEATURE_FLAGS = new OauthScope(Value.READ_TENANT_FEATURE_FLAGS, "read:tenant_feature_flags"); + public static final OauthScope READ_GROUP_MEMBERS = new OauthScope(Value.READ_GROUP_MEMBERS, "read:group_members"); + public static final OauthScope READ_INSIGHTS = new OauthScope(Value.READ_INSIGHTS, "read:insights"); public static final OauthScope CREATE_SIGNING_KEYS = @@ -132,6 +137,8 @@ public final class OauthScope { public static final OauthScope UPDATE_CONNECTION_PROFILES = new OauthScope(Value.UPDATE_CONNECTION_PROFILES, "update:connection_profiles"); + public static final OauthScope READ_GROUPS = new OauthScope(Value.READ_GROUPS, "read:groups"); + public static final OauthScope DELETE_ACTIONS = new OauthScope(Value.DELETE_ACTIONS, "delete:actions"); public static final OauthScope UPDATE_AUTHENTICATION_METHODS = @@ -143,6 +150,9 @@ public final class OauthScope { public static final OauthScope READ_ATTACK_PROTECTION = new OauthScope(Value.READ_ATTACK_PROTECTION, "read:attack_protection"); + public static final OauthScope READ_ORGANIZATION_DISCOVERY_DOMAINS = + new OauthScope(Value.READ_ORGANIZATION_DISCOVERY_DOMAINS, "read:organization_discovery_domains"); + public static final OauthScope CREATE_CUSTOM_DOMAINS = new OauthScope(Value.CREATE_CUSTOM_DOMAINS, "create:custom_domains"); @@ -210,6 +220,9 @@ public final class OauthScope { public static final OauthScope READ_USER_ATTRIBUTE_PROFILES = new OauthScope(Value.READ_USER_ATTRIBUTE_PROFILES, "read:user_attribute_profiles"); + public static final OauthScope READ_DIRECTORY_PROVISIONINGS = + new OauthScope(Value.READ_DIRECTORY_PROVISIONINGS, "read:directory_provisionings"); + public static final OauthScope UPDATE_TENANT_MEMBERS = new OauthScope(Value.UPDATE_TENANT_MEMBERS, "update:tenant_members"); @@ -288,6 +301,9 @@ public final class OauthScope { public static final OauthScope CREATE_ORGANIZATION_MEMBER_ROLES = new OauthScope(Value.CREATE_ORGANIZATION_MEMBER_ROLES, "create:organization_member_roles"); + public static final OauthScope CREATE_DIRECTORY_PROVISIONINGS = + new OauthScope(Value.CREATE_DIRECTORY_PROVISIONINGS, "create:directory_provisionings"); + public static final OauthScope DELETE_ORGANIZATION_MEMBERS = new OauthScope(Value.DELETE_ORGANIZATION_MEMBERS, "delete:organization_members"); @@ -334,6 +350,9 @@ public final class OauthScope { public static final OauthScope READ_DEVICE_CREDENTIALS = new OauthScope(Value.READ_DEVICE_CREDENTIALS, "read:device_credentials"); + public static final OauthScope DELETE_DIRECTORY_PROVISIONINGS = + new OauthScope(Value.DELETE_DIRECTORY_PROVISIONINGS, "delete:directory_provisionings"); + public static final OauthScope DELETE_TOKEN_EXCHANGE_PROFILES = new OauthScope(Value.DELETE_TOKEN_EXCHANGE_PROFILES, "delete:token_exchange_profiles"); @@ -357,6 +376,9 @@ public final class OauthScope { public static final OauthScope UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS = new OauthScope(Value.UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS, "update:self_service_profile_custom_texts"); + public static final OauthScope DELETE_ORGANIZATION_DISCOVERY_DOMAINS = + new OauthScope(Value.DELETE_ORGANIZATION_DISCOVERY_DOMAINS, "delete:organization_discovery_domains"); + public static final OauthScope UPDATE_CLIENT_GRANTS = new OauthScope(Value.UPDATE_CLIENT_GRANTS, "update:client_grants"); @@ -426,6 +448,10 @@ public final class OauthScope { public static final OauthScope DELETE_CUSTOM_DOMAINS = new OauthScope(Value.DELETE_CUSTOM_DOMAINS, "delete:custom_domains"); + public static final OauthScope READ_EVENTS = new OauthScope(Value.READ_EVENTS, "read:events"); + + public static final OauthScope UPDATE_SESSIONS = new OauthScope(Value.UPDATE_SESSIONS, "update:sessions"); + public static final OauthScope DELETE_CONNECTION_PROFILES = new OauthScope(Value.DELETE_CONNECTION_PROFILES, "delete:connection_profiles"); @@ -466,6 +492,9 @@ public final class OauthScope { public static final OauthScope UPDATE_INTEGRATIONS = new OauthScope(Value.UPDATE_INTEGRATIONS, "update:integrations"); + public static final OauthScope UPDATE_DIRECTORY_PROVISIONINGS = + new OauthScope(Value.UPDATE_DIRECTORY_PROVISIONINGS, "update:directory_provisionings"); + public static final OauthScope DELETE_USER_ATTRIBUTE_PROFILES = new OauthScope(Value.DELETE_USER_ATTRIBUTE_PROFILES, "delete:user_attribute_profiles"); @@ -653,18 +682,18 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof OauthScope && this.string.equals(((OauthScope) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } @@ -673,6 +702,8 @@ public T visit(Visitor visitor) { switch (value) { case READ_AUTHENTICATION_METHODS: return visitor.visitReadAuthenticationMethods(); + case UPDATE_CLIENT_TOKEN_VAULT_PRIVILEGED_ACCESS: + return visitor.visitUpdateClientTokenVaultPrivilegedAccess(); case UPDATE_USERS_APP_METADATA: return visitor.visitUpdateUsersAppMetadata(); case READ_ANOMALY_BLOCKS: @@ -725,6 +756,8 @@ public T visit(Visitor visitor) { return visitor.visitDeleteSelfServiceProfiles(); case READ_TENANT_FEATURE_FLAGS: return visitor.visitReadTenantFeatureFlags(); + case READ_GROUP_MEMBERS: + return visitor.visitReadGroupMembers(); case READ_INSIGHTS: return visitor.visitReadInsights(); case CREATE_SIGNING_KEYS: @@ -765,6 +798,8 @@ public T visit(Visitor visitor) { return visitor.visitUpdateRulesConfigs(); case UPDATE_CONNECTION_PROFILES: return visitor.visitUpdateConnectionProfiles(); + case READ_GROUPS: + return visitor.visitReadGroups(); case DELETE_ACTIONS: return visitor.visitDeleteActions(); case UPDATE_AUTHENTICATION_METHODS: @@ -773,6 +808,8 @@ public T visit(Visitor visitor) { return visitor.visitCreateVdcsTemplates(); case READ_ATTACK_PROTECTION: return visitor.visitReadAttackProtection(); + case READ_ORGANIZATION_DISCOVERY_DOMAINS: + return visitor.visitReadOrganizationDiscoveryDomains(); case CREATE_CUSTOM_DOMAINS: return visitor.visitCreateCustomDomains(); case DELETE_ORGANIZATION_CONNECTIONS: @@ -825,6 +862,8 @@ public T visit(Visitor visitor) { return visitor.visitCreateForms(); case READ_USER_ATTRIBUTE_PROFILES: return visitor.visitReadUserAttributeProfiles(); + case READ_DIRECTORY_PROVISIONINGS: + return visitor.visitReadDirectoryProvisionings(); case UPDATE_TENANT_MEMBERS: return visitor.visitUpdateTenantMembers(); case CREATE_AUTHENTICATION_METHODS: @@ -885,6 +924,8 @@ public T visit(Visitor visitor) { return visitor.visitCreateTestEmailDispatch(); case CREATE_ORGANIZATION_MEMBER_ROLES: return visitor.visitCreateOrganizationMemberRoles(); + case CREATE_DIRECTORY_PROVISIONINGS: + return visitor.visitCreateDirectoryProvisionings(); case DELETE_ORGANIZATION_MEMBERS: return visitor.visitDeleteOrganizationMembers(); case UPDATE_FORMS: @@ -919,6 +960,8 @@ public T visit(Visitor visitor) { return visitor.visitReadRoles(); case READ_DEVICE_CREDENTIALS: return visitor.visitReadDeviceCredentials(); + case DELETE_DIRECTORY_PROVISIONINGS: + return visitor.visitDeleteDirectoryProvisionings(); case DELETE_TOKEN_EXCHANGE_PROFILES: return visitor.visitDeleteTokenExchangeProfiles(); case UPDATE_ORGANIZATION_DISCOVERY_DOMAINS: @@ -935,6 +978,8 @@ public T visit(Visitor visitor) { return visitor.visitDeleteNetworkAcls(); case UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS: return visitor.visitUpdateSelfServiceProfileCustomTexts(); + case DELETE_ORGANIZATION_DISCOVERY_DOMAINS: + return visitor.visitDeleteOrganizationDiscoveryDomains(); case UPDATE_CLIENT_GRANTS: return visitor.visitUpdateClientGrants(); case READ_EMAIL_TEMPLATES: @@ -987,6 +1032,10 @@ public T visit(Visitor visitor) { return visitor.visitCreateScimToken(); case DELETE_CUSTOM_DOMAINS: return visitor.visitDeleteCustomDomains(); + case READ_EVENTS: + return visitor.visitReadEvents(); + case UPDATE_SESSIONS: + return visitor.visitUpdateSessions(); case DELETE_CONNECTION_PROFILES: return visitor.visitDeleteConnectionProfiles(); case UPDATE_CONNECTIONS: @@ -1017,6 +1066,8 @@ public T visit(Visitor visitor) { return visitor.visitCreateFlowsVaultConnections(); case UPDATE_INTEGRATIONS: return visitor.visitUpdateIntegrations(); + case UPDATE_DIRECTORY_PROVISIONINGS: + return visitor.visitUpdateDirectoryProvisionings(); case DELETE_USER_ATTRIBUTE_PROFILES: return visitor.visitDeleteUserAttributeProfiles(); case READ_CLIENT_GRANTS: @@ -1160,6 +1211,8 @@ public static OauthScope valueOf(String value) { switch (value) { case "read:authentication_methods": return READ_AUTHENTICATION_METHODS; + case "update:client_token_vault_privileged_access": + return UPDATE_CLIENT_TOKEN_VAULT_PRIVILEGED_ACCESS; case "update:users_app_metadata": return UPDATE_USERS_APP_METADATA; case "read:anomaly_blocks": @@ -1212,6 +1265,8 @@ public static OauthScope valueOf(String value) { return DELETE_SELF_SERVICE_PROFILES; case "read:tenant_feature_flags": return READ_TENANT_FEATURE_FLAGS; + case "read:group_members": + return READ_GROUP_MEMBERS; case "read:insights": return READ_INSIGHTS; case "create:signing_keys": @@ -1252,6 +1307,8 @@ public static OauthScope valueOf(String value) { return UPDATE_RULES_CONFIGS; case "update:connection_profiles": return UPDATE_CONNECTION_PROFILES; + case "read:groups": + return READ_GROUPS; case "delete:actions": return DELETE_ACTIONS; case "update:authentication_methods": @@ -1260,6 +1317,8 @@ public static OauthScope valueOf(String value) { return CREATE_VDCS_TEMPLATES; case "read:attack_protection": return READ_ATTACK_PROTECTION; + case "read:organization_discovery_domains": + return READ_ORGANIZATION_DISCOVERY_DOMAINS; case "create:custom_domains": return CREATE_CUSTOM_DOMAINS; case "delete:organization_connections": @@ -1312,6 +1371,8 @@ public static OauthScope valueOf(String value) { return CREATE_FORMS; case "read:user_attribute_profiles": return READ_USER_ATTRIBUTE_PROFILES; + case "read:directory_provisionings": + return READ_DIRECTORY_PROVISIONINGS; case "update:tenant_members": return UPDATE_TENANT_MEMBERS; case "create:authentication_methods": @@ -1372,6 +1433,8 @@ public static OauthScope valueOf(String value) { return CREATE_TEST_EMAIL_DISPATCH; case "create:organization_member_roles": return CREATE_ORGANIZATION_MEMBER_ROLES; + case "create:directory_provisionings": + return CREATE_DIRECTORY_PROVISIONINGS; case "delete:organization_members": return DELETE_ORGANIZATION_MEMBERS; case "update:forms": @@ -1406,6 +1469,8 @@ public static OauthScope valueOf(String value) { return READ_ROLES; case "read:device_credentials": return READ_DEVICE_CREDENTIALS; + case "delete:directory_provisionings": + return DELETE_DIRECTORY_PROVISIONINGS; case "delete:token_exchange_profiles": return DELETE_TOKEN_EXCHANGE_PROFILES; case "update:organization_discovery_domains": @@ -1422,6 +1487,8 @@ public static OauthScope valueOf(String value) { return DELETE_NETWORK_ACLS; case "update:self_service_profile_custom_texts": return UPDATE_SELF_SERVICE_PROFILE_CUSTOM_TEXTS; + case "delete:organization_discovery_domains": + return DELETE_ORGANIZATION_DISCOVERY_DOMAINS; case "update:client_grants": return UPDATE_CLIENT_GRANTS; case "read:email_templates": @@ -1474,6 +1541,10 @@ public static OauthScope valueOf(String value) { return CREATE_SCIM_TOKEN; case "delete:custom_domains": return DELETE_CUSTOM_DOMAINS; + case "read:events": + return READ_EVENTS; + case "update:sessions": + return UPDATE_SESSIONS; case "delete:connection_profiles": return DELETE_CONNECTION_PROFILES; case "update:connections": @@ -1504,6 +1575,8 @@ public static OauthScope valueOf(String value) { return CREATE_FLOWS_VAULT_CONNECTIONS; case "update:integrations": return UPDATE_INTEGRATIONS; + case "update:directory_provisionings": + return UPDATE_DIRECTORY_PROVISIONINGS; case "delete:user_attribute_profiles": return DELETE_USER_ATTRIBUTE_PROFILES; case "read:client_grants": @@ -1716,6 +1789,8 @@ public enum Value { UPDATE_CLIENT_KEYS, + UPDATE_CLIENT_TOKEN_VAULT_PRIVILEGED_ACCESS, + DELETE_CLIENTS, READ_CONNECTIONS, @@ -1734,6 +1809,14 @@ public enum Value { DELETE_CONNECTIONS, + READ_DIRECTORY_PROVISIONINGS, + + CREATE_DIRECTORY_PROVISIONINGS, + + UPDATE_DIRECTORY_PROVISIONINGS, + + DELETE_DIRECTORY_PROVISIONINGS, + READ_USERS, READ_CONNECTIONS_KEYS, @@ -1808,6 +1891,8 @@ public enum Value { UPDATE_EVENT_DELIVERIES, + READ_EVENTS, + READ_EXTENSIONS, READ_FLOWS, @@ -1842,6 +1927,10 @@ public enum Value { DELETE_GRANTS, + READ_GROUPS, + + READ_GROUP_MEMBERS, + CREATE_GUARDIAN_ENROLLMENT_TICKETS, READ_GUARDIAN_ENROLLMENTS, @@ -1944,13 +2033,17 @@ public enum Value { READ_ORGANIZATION_CONNECTIONS, + UPDATE_ORGANIZATION_CONNECTIONS, + + DELETE_ORGANIZATION_CONNECTIONS, + + READ_ORGANIZATION_DISCOVERY_DOMAINS, + CREATE_ORGANIZATION_DISCOVERY_DOMAINS, UPDATE_ORGANIZATION_DISCOVERY_DOMAINS, - UPDATE_ORGANIZATION_CONNECTIONS, - - DELETE_ORGANIZATION_CONNECTIONS, + DELETE_ORGANIZATION_DISCOVERY_DOMAINS, READ_ORGANIZATION_INVITATIONS, @@ -2032,6 +2125,8 @@ public enum Value { READ_SESSIONS, + UPDATE_SESSIONS, + DELETE_SESSIONS, DELETE_TENANTS, @@ -2198,6 +2293,8 @@ public interface Visitor { T visitUpdateClientKeys(); + T visitUpdateClientTokenVaultPrivilegedAccess(); + T visitDeleteClients(); T visitReadConnections(); @@ -2216,6 +2313,14 @@ public interface Visitor { T visitDeleteConnections(); + T visitReadDirectoryProvisionings(); + + T visitCreateDirectoryProvisionings(); + + T visitUpdateDirectoryProvisionings(); + + T visitDeleteDirectoryProvisionings(); + T visitReadUsers(); T visitReadConnectionsKeys(); @@ -2290,6 +2395,8 @@ public interface Visitor { T visitUpdateEventDeliveries(); + T visitReadEvents(); + T visitReadExtensions(); T visitReadFlows(); @@ -2324,6 +2431,10 @@ public interface Visitor { T visitDeleteGrants(); + T visitReadGroups(); + + T visitReadGroupMembers(); + T visitCreateGuardianEnrollmentTickets(); T visitReadGuardianEnrollments(); @@ -2426,13 +2537,17 @@ public interface Visitor { T visitReadOrganizationConnections(); + T visitUpdateOrganizationConnections(); + + T visitDeleteOrganizationConnections(); + + T visitReadOrganizationDiscoveryDomains(); + T visitCreateOrganizationDiscoveryDomains(); T visitUpdateOrganizationDiscoveryDomains(); - T visitUpdateOrganizationConnections(); - - T visitDeleteOrganizationConnections(); + T visitDeleteOrganizationDiscoveryDomains(); T visitReadOrganizationInvitations(); @@ -2514,6 +2629,8 @@ public interface Visitor { T visitReadSessions(); + T visitUpdateSessions(); + T visitDeleteSessions(); T visitDeleteTenants(); diff --git a/src/main/java/com/auth0/client/mgmt/types/Organization.java b/src/main/java/com/auth0/client/mgmt/types/Organization.java index 4aebdc347..3412426ce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Organization.java +++ b/src/main/java/com/auth0/client/mgmt/types/Organization.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -28,7 +29,7 @@ public final class Organization { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional tokenQuota; @@ -39,7 +40,7 @@ private Organization( Optional name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional tokenQuota, Map additionalProperties) { this.id = id; @@ -81,7 +82,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -90,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Organization && equalTo((Organization) other); @@ -110,12 +111,12 @@ private boolean equalTo(Organization other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +135,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional tokenQuota = Optional.empty(); @@ -207,12 +208,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java deleted file mode 100644 index 936ba5f11..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public final class OrganizationAccessLevelEnum { - public static final OrganizationAccessLevelEnum READONLY = - new OrganizationAccessLevelEnum(Value.READONLY, "readonly"); - - public static final OrganizationAccessLevelEnum FULL = new OrganizationAccessLevelEnum(Value.FULL, "full"); - - public static final OrganizationAccessLevelEnum LIMITED = new OrganizationAccessLevelEnum(Value.LIMITED, "limited"); - - public static final OrganizationAccessLevelEnum NONE = new OrganizationAccessLevelEnum(Value.NONE, "none"); - - private final Value value; - - private final String string; - - OrganizationAccessLevelEnum(Value value, String string) { - this.value = value; - this.string = string; - } - - public Value getEnumValue() { - return value; - } - - @java.lang.Override - @JsonValue - public String toString() { - return this.string; - } - - @java.lang.Override - public boolean equals(Object other) { - return (this == other) - || (other instanceof OrganizationAccessLevelEnum - && this.string.equals(((OrganizationAccessLevelEnum) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case READONLY: - return visitor.visitReadonly(); - case FULL: - return visitor.visitFull(); - case LIMITED: - return visitor.visitLimited(); - case NONE: - return visitor.visitNone(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static OrganizationAccessLevelEnum valueOf(String value) { - switch (value) { - case "readonly": - return READONLY; - case "full": - return FULL; - case "limited": - return LIMITED; - case "none": - return NONE; - default: - return new OrganizationAccessLevelEnum(Value.UNKNOWN, value); - } - } - - public enum Value { - NONE, - - READONLY, - - LIMITED, - - FULL, - - UNKNOWN - } - - public interface Visitor { - T visitNone(); - - T visitReadonly(); - - T visitLimited(); - - T visitFull(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java index db58bbc39..75830e5a0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java @@ -48,7 +48,7 @@ public Optional getColors() { return colors; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationBranding && equalTo((OrganizationBranding) other); @@ -63,12 +63,12 @@ private boolean equalTo(OrganizationBranding other) { return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.logoUrl, this.colors); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java index f4935915c..cb93c0a3b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java @@ -48,7 +48,7 @@ public String getPageBackground() { return pageBackground; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationBrandingColors && equalTo((OrganizationBrandingColors) other); @@ -63,12 +63,12 @@ private boolean equalTo(OrganizationBrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements PrimaryStage, PageBackgroundStage, private Builder() {} - @java.lang.Override + @Override public Builder from(OrganizationBrandingColors other) { primary(other.getPrimary()); pageBackground(other.getPageBackground()); @@ -120,7 +120,7 @@ public Builder from(OrganizationBrandingColors other) { *

HEX Color for primary elements.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") public PageBackgroundStage primary(@NotNull String primary) { this.primary = Objects.requireNonNull(primary, "primary must not be null"); @@ -132,14 +132,14 @@ public PageBackgroundStage primary(@NotNull String primary) { *

HEX Color for background.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("page_background") public _FinalStage pageBackground(@NotNull String pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @java.lang.Override + @Override public OrganizationBrandingColors build() { return new OrganizationBrandingColors(primary, pageBackground, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java index bb281b935..8f2a8580d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java @@ -97,7 +97,7 @@ public Optional getAllowAnyOrganization() { return allowAnyOrganization; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationClientGrant && equalTo((OrganizationClientGrant) other); @@ -117,13 +117,13 @@ private boolean equalTo(OrganizationClientGrant other) { && allowAnyOrganization.equals(other.allowAnyOrganization); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java index 604ee9f6e..6515b1429 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java @@ -22,8 +22,6 @@ public final class OrganizationConnection { private final Optional connectionId; - private final Optional organizationConnectionName; - private final Optional assignMembershipOnLogin; private final Optional showAsButton; @@ -32,30 +30,20 @@ public final class OrganizationConnection { private final Optional connection; - private final Optional organizationAccessLevel; - - private final Optional isEnabled; - private final Map additionalProperties; private OrganizationConnection( Optional connectionId, - Optional organizationConnectionName, Optional assignMembershipOnLogin, Optional showAsButton, Optional isSignupEnabled, Optional connection, - Optional organizationAccessLevel, - Optional isEnabled, Map additionalProperties) { this.connectionId = connectionId; - this.organizationConnectionName = organizationConnectionName; this.assignMembershipOnLogin = assignMembershipOnLogin; this.showAsButton = showAsButton; this.isSignupEnabled = isSignupEnabled; this.connection = connection; - this.organizationAccessLevel = organizationAccessLevel; - this.isEnabled = isEnabled; this.additionalProperties = additionalProperties; } @@ -67,14 +55,6 @@ public Optional getConnectionId() { return connectionId; } - /** - * @return Name of the connection in the scope of this organization. - */ - @JsonProperty("organization_connection_name") - public Optional getOrganizationConnectionName() { - return organizationConnectionName; - } - /** * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. */ @@ -104,20 +84,7 @@ public Optional getConnection() { return connection; } - @JsonProperty("organization_access_level") - public Optional getOrganizationAccessLevel() { - return organizationAccessLevel; - } - - /** - * @return Whether the connection is enabled for the organization. - */ - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationConnection && equalTo((OrganizationConnection) other); @@ -130,29 +97,23 @@ public Map getAdditionalProperties() { private boolean equalTo(OrganizationConnection other) { return connectionId.equals(other.connectionId) - && organizationConnectionName.equals(other.organizationConnectionName) && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) && showAsButton.equals(other.showAsButton) && isSignupEnabled.equals(other.isSignupEnabled) - && connection.equals(other.connection) - && organizationAccessLevel.equals(other.organizationAccessLevel) - && isEnabled.equals(other.isEnabled); + && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, - this.organizationConnectionName, this.assignMembershipOnLogin, this.showAsButton, this.isSignupEnabled, - this.connection, - this.organizationAccessLevel, - this.isEnabled); + this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -165,8 +126,6 @@ public static Builder builder() { public static final class Builder { private Optional connectionId = Optional.empty(); - private Optional organizationConnectionName = Optional.empty(); - private Optional assignMembershipOnLogin = Optional.empty(); private Optional showAsButton = Optional.empty(); @@ -175,10 +134,6 @@ public static final class Builder { private Optional connection = Optional.empty(); - private Optional organizationAccessLevel = Optional.empty(); - - private Optional isEnabled = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -186,13 +141,10 @@ private Builder() {} public Builder from(OrganizationConnection other) { connectionId(other.getConnectionId()); - organizationConnectionName(other.getOrganizationConnectionName()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); showAsButton(other.getShowAsButton()); isSignupEnabled(other.getIsSignupEnabled()); connection(other.getConnection()); - organizationAccessLevel(other.getOrganizationAccessLevel()); - isEnabled(other.getIsEnabled()); return this; } @@ -210,20 +162,6 @@ public Builder connectionId(String connectionId) { return this; } - /** - *

Name of the connection in the scope of this organization.

- */ - @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) - public Builder organizationConnectionName(Optional organizationConnectionName) { - this.organizationConnectionName = organizationConnectionName; - return this; - } - - public Builder organizationConnectionName(String organizationConnectionName) { - this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); - return this; - } - /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ @@ -277,41 +215,13 @@ public Builder connection(OrganizationConnectionInformation connection) { return this; } - @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) - public Builder organizationAccessLevel(Optional organizationAccessLevel) { - this.organizationAccessLevel = organizationAccessLevel; - return this; - } - - public Builder organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { - this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); - return this; - } - - /** - *

Whether the connection is enabled for the organization.

- */ - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - public OrganizationConnection build() { return new OrganizationConnection( connectionId, - organizationConnectionName, assignMembershipOnLogin, showAsButton, isSignupEnabled, connection, - organizationAccessLevel, - isEnabled, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java index 647c645d6..a6007168f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java @@ -49,7 +49,7 @@ public Optional getStrategy() { return strategy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationConnectionInformation && equalTo((OrganizationConnectionInformation) other); @@ -64,12 +64,12 @@ private boolean equalTo(OrganizationConnectionInformation other) { return name.equals(other.name) && strategy.equals(other.strategy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.strategy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java new file mode 100644 index 000000000..1696f64f0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationDiscoveryDomain.Builder.class) +public final class OrganizationDiscoveryDomain { + private final String id; + + private final String domain; + + private final OrganizationDiscoveryDomainStatus status; + + private final String verificationTxt; + + private final String verificationHost; + + private final Map additionalProperties; + + private OrganizationDiscoveryDomain( + String id, + String domain, + OrganizationDiscoveryDomainStatus status, + String verificationTxt, + String verificationHost, + Map additionalProperties) { + this.id = id; + this.domain = domain; + this.status = status; + this.verificationTxt = verificationTxt; + this.verificationHost = verificationHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization discovery domain identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public OrganizationDiscoveryDomainStatus getStatus() { + return status; + } + + /** + * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. + */ + @JsonProperty("verification_txt") + public String getVerificationTxt() { + return verificationTxt; + } + + /** + * @return The full domain where the TXT record should be added. + */ + @JsonProperty("verification_host") + public String getVerificationHost() { + return verificationHost; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationDiscoveryDomain && equalTo((OrganizationDiscoveryDomain) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationDiscoveryDomain other) { + return id.equals(other.id) + && domain.equals(other.domain) + && status.equals(other.status) + && verificationTxt.equals(other.verificationTxt) + && verificationHost.equals(other.verificationHost); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization discovery domain identifier.

+ */ + DomainStage id(@NotNull String id); + + Builder from(OrganizationDiscoveryDomain other); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + StatusStage domain(@NotNull String domain); + } + + public interface StatusStage { + VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status); + } + + public interface VerificationTxtStage { + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ */ + VerificationHostStage verificationTxt(@NotNull String verificationTxt); + } + + public interface VerificationHostStage { + /** + *

The full domain where the TXT record should be added.

+ */ + _FinalStage verificationHost(@NotNull String verificationHost); + } + + public interface _FinalStage { + OrganizationDiscoveryDomain build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, DomainStage, StatusStage, VerificationTxtStage, VerificationHostStage, _FinalStage { + private String id; + + private String domain; + + private OrganizationDiscoveryDomainStatus status; + + private String verificationTxt; + + private String verificationHost; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(OrganizationDiscoveryDomain other) { + id(other.getId()); + domain(other.getDomain()); + status(other.getStatus()); + verificationTxt(other.getVerificationTxt()); + verificationHost(other.getVerificationHost()); + return this; + } + + /** + *

Organization discovery domain identifier.

+ *

Organization discovery domain identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public DomainStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("domain") + public StatusStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + @JsonSetter("status") + public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_txt") + public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { + this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); + return this; + } + + /** + *

The full domain where the TXT record should be added.

+ *

The full domain where the TXT record should be added.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_host") + public _FinalStage verificationHost(@NotNull String verificationHost) { + this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); + return this; + } + + @Override + public OrganizationDiscoveryDomain build() { + return new OrganizationDiscoveryDomain( + id, domain, status, verificationTxt, verificationHost, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java new file mode 100644 index 000000000..2a4b77b3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationDiscoveryDomainStatus { + public static final OrganizationDiscoveryDomainStatus PENDING = + new OrganizationDiscoveryDomainStatus(Value.PENDING, "pending"); + + public static final OrganizationDiscoveryDomainStatus VERIFIED = + new OrganizationDiscoveryDomainStatus(Value.VERIFIED, "verified"); + + private final Value value; + + private final String string; + + OrganizationDiscoveryDomainStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationDiscoveryDomainStatus + && this.string.equals(((OrganizationDiscoveryDomainStatus) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case VERIFIED: + return visitor.visitVerified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationDiscoveryDomainStatus valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + case "verified": + return VERIFIED; + default: + return new OrganizationDiscoveryDomainStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + VERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitVerified(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java index e9d82484e..e3d52bafa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationEnabledConnection && equalTo((OrganizationEnabledConnection) other); @@ -103,7 +103,7 @@ private boolean equalTo(OrganizationEnabledConnection other) { && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -113,7 +113,7 @@ public int hashCode() { this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java index 4343fb85a..f0587ffe7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitation && equalTo((OrganizationInvitation) other); @@ -200,7 +200,7 @@ private boolean equalTo(OrganizationInvitation other) { && ticketId.equals(other.ticketId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -218,7 +218,7 @@ public int hashCode() { this.ticketId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java index 8431ecd16..a01262fc0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java @@ -36,7 +36,7 @@ public String getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitationInvitee && equalTo((OrganizationInvitationInvitee) other); @@ -51,12 +51,12 @@ private boolean equalTo(OrganizationInvitationInvitee other) { return email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(OrganizationInvitationInvitee other) { email(other.getEmail()); return this; @@ -98,14 +98,14 @@ public Builder from(OrganizationInvitationInvitee other) { *

The invitee's email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @java.lang.Override + @Override public OrganizationInvitationInvitee build() { return new OrganizationInvitationInvitee(email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java index c144190bd..9c65ffea5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java @@ -36,7 +36,7 @@ public String getName() { return name; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitationInviter && equalTo((OrganizationInvitationInviter) other); @@ -51,12 +51,12 @@ private boolean equalTo(OrganizationInvitationInviter other) { return name.equals(other.name); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(OrganizationInvitationInviter other) { name(other.getName()); return this; @@ -98,14 +98,14 @@ public Builder from(OrganizationInvitationInviter other) { *

The inviter's name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public OrganizationInvitationInviter build() { return new OrganizationInvitationInviter(name, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java index 4ffc171d3..53dda8b0d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java @@ -85,7 +85,7 @@ public Optional> getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationMember && equalTo((OrganizationMember) other); @@ -104,12 +104,12 @@ private boolean equalTo(OrganizationMember other) { && roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userId, this.picture, this.name, this.email, this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java index fe271a84f..c96c60aa8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java @@ -49,7 +49,7 @@ public Optional getName() { return name; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationMemberRole && equalTo((OrganizationMemberRole) other); @@ -64,12 +64,12 @@ private boolean equalTo(OrganizationMemberRole other) { return id.equals(other.id) && name.equals(other.name); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java index 6dbe037f1..f4c33ec86 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof OrganizationUsageEnum && this.string.equals(((OrganizationUsageEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java index 0d58290a8..e1e264233 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java @@ -40,19 +40,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PartialGroupsEnum && this.string.equals(((PartialGroupsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java index 2b5d425e0..027de320f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java @@ -46,7 +46,7 @@ public Optional getBody() { return body; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PartialPhoneTemplateContent && equalTo((PartialPhoneTemplateContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(PartialPhoneTemplateContent other) { return from.equals(other.from) && body.equals(other.body); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.body); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java index 2e1b9f47e..1a396de2b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(PatchClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java index 7911c0f9e..4b7171b2f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java @@ -38,7 +38,7 @@ public Optional getAkamaiEnabled() { return akamaiEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchSupplementalSignalsResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(PatchSupplementalSignalsResponseContent other) { return akamaiEnabled.equals(other.akamaiEnabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java index a92f96555..18ca0c1ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java @@ -48,7 +48,7 @@ public String getPermissionName() { return permissionName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PermissionRequestPayload && equalTo((PermissionRequestPayload) other); @@ -64,12 +64,12 @@ private boolean equalTo(PermissionRequestPayload other) { && permissionName.equals(other.permissionName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.resourceServerIdentifier, this.permissionName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ResourceServerIdentifierStage, Perm private Builder() {} - @java.lang.Override + @Override public Builder from(PermissionRequestPayload other) { resourceServerIdentifier(other.getResourceServerIdentifier()); permissionName(other.getPermissionName()); @@ -121,7 +121,7 @@ public Builder from(PermissionRequestPayload other) { *

Resource server (API) identifier that this permission is for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("resource_server_identifier") public PermissionNameStage resourceServerIdentifier(@NotNull String resourceServerIdentifier) { this.resourceServerIdentifier = @@ -134,14 +134,14 @@ public PermissionNameStage resourceServerIdentifier(@NotNull String resourceServ *

Name of this permission.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("permission_name") public _FinalStage permissionName(@NotNull String permissionName) { this.permissionName = Objects.requireNonNull(permissionName, "permissionName must not be null"); return this; } - @java.lang.Override + @Override public PermissionRequestPayload build() { return new PermissionRequestPayload(resourceServerIdentifier, permissionName, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java index 8283fb3c3..ebad92bb5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java @@ -75,7 +75,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PermissionsResponsePayload && equalTo((PermissionsResponsePayload) other); @@ -93,13 +93,13 @@ private boolean equalTo(PermissionsResponsePayload other) { && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java index b89b02963..164ed7a97 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java @@ -57,7 +57,7 @@ public Optional getSignup() { return signup; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneAttribute && equalTo((PhoneAttribute) other); @@ -74,12 +74,12 @@ private boolean equalTo(PhoneAttribute other) { && signup.equals(other.signup); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifier, this.profileRequired, this.signup); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java index 7d13e70b7..10c2614c5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderConfiguration && equalTo((PhoneProviderConfiguration) other); @@ -49,12 +49,12 @@ private boolean equalTo(PhoneProviderConfiguration other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderCredentials && equalTo((PhoneProviderCredentials) other); @@ -49,12 +49,12 @@ private boolean equalTo(PhoneProviderCredentials other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderSchemaMasked && equalTo((PhoneProviderSchemaMasked) other); @@ -135,7 +135,7 @@ private boolean equalTo(PhoneProviderSchemaMasked other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -148,7 +148,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -230,7 +230,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(PhoneProviderSchemaMasked other) { id(other.getId()); tenant(other.getTenant()); @@ -243,7 +243,7 @@ public Builder from(PhoneProviderSchemaMasked other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -254,7 +254,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -263,7 +263,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -274,7 +274,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -283,20 +283,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -307,7 +307,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -316,20 +316,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @java.lang.Override + @Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -340,7 +340,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -349,27 +349,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public PhoneProviderSchemaMasked build() { return new PhoneProviderSchemaMasked( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java index b716bbf5f..767daa358 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplate && equalTo((PhoneTemplate) other); @@ -115,13 +115,13 @@ private boolean equalTo(PhoneTemplate other) { && disabled == other.disabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @java.lang.Override + @Override public Builder from(PhoneTemplate other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(PhoneTemplate other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @java.lang.Override + @Override public PhoneTemplate build() { return new PhoneTemplate(id, channel, customizable, tenant, content, type, disabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java index 32949a808..411bbda39 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java @@ -48,7 +48,7 @@ public Optional getVoice() { return voice; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplateBody && equalTo((PhoneTemplateBody) other); @@ -63,12 +63,12 @@ private boolean equalTo(PhoneTemplateBody other) { return text.equals(other.text) && voice.equals(other.voice); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.text, this.voice); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java index e6f6934fb..ffc19f987 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java @@ -57,7 +57,7 @@ public Optional getBody() { return body; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplateContent && equalTo((PhoneTemplateContent) other); @@ -72,12 +72,12 @@ private boolean equalTo(PhoneTemplateContent other) { return syntax.equals(other.syntax) && from.equals(other.from) && body.equals(other.body); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.syntax, this.from, this.body); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java index 7a64e0b1e..df5a8bfb0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PhoneTemplateNotificationTypeEnum && this.string.equals(((PhoneTemplateNotificationTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java index 17054e06f..d3b29d554 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PostClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(PostClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java index 2ebd01e91..159b7df60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PreferredAuthenticationMethodEnum && this.string.equals(((PreferredAuthenticationMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java index 6e3aef742..3aa8bc731 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java @@ -35,7 +35,7 @@ public List getCredentials() { return credentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PrivateKeyJwt && equalTo((PrivateKeyJwt) other); @@ -50,12 +50,12 @@ private boolean equalTo(PrivateKeyJwt other) { return credentials.equals(other.credentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.credentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java index 968940763..379d1ffa1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java @@ -50,6 +50,9 @@ public final class PromptGroupNameEnum { public static final PromptGroupNameEnum LOGIN_ID = new PromptGroupNameEnum(Value.LOGIN_ID, "login-id"); + public static final PromptGroupNameEnum ASYNC_APPROVAL_FLOW = + new PromptGroupNameEnum(Value.ASYNC_APPROVAL_FLOW, "async-approval-flow"); + public static final PromptGroupNameEnum MFA_OTP = new PromptGroupNameEnum(Value.MFA_OTP, "mfa-otp"); public static final PromptGroupNameEnum STATUS = new PromptGroupNameEnum(Value.STATUS, "status"); @@ -104,19 +107,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PromptGroupNameEnum && this.string.equals(((PromptGroupNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } @@ -159,6 +162,8 @@ public T visit(Visitor visitor) { return visitor.visitOrganizations(); case LOGIN_ID: return visitor.visitLoginId(); + case ASYNC_APPROVAL_FLOW: + return visitor.visitAsyncApprovalFlow(); case MFA_OTP: return visitor.visitMfaOtp(); case STATUS: @@ -238,6 +243,8 @@ public static PromptGroupNameEnum valueOf(String value) { return ORGANIZATIONS; case "login-id": return LOGIN_ID; + case "async-approval-flow": + return ASYNC_APPROVAL_FLOW; case "mfa-otp": return MFA_OTP; case "status": @@ -348,6 +355,8 @@ public enum Value { BRUTE_FORCE_PROTECTION, + ASYNC_APPROVAL_FLOW, + UNKNOWN } @@ -422,6 +431,8 @@ public interface Visitor { T visitBruteForceProtection(); + T visitAsyncApprovalFlow(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java index 355be8241..eb92f5495 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java @@ -182,19 +182,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PromptLanguageEnum && this.string.equals(((PromptLanguageEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java index bc9d81a3e..7e22cfb03 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java @@ -95,7 +95,7 @@ public Optional getExpiresAt() { return expiresAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PublicKeyCredential && equalTo((PublicKeyCredential) other); @@ -115,13 +115,13 @@ private boolean equalTo(PublicKeyCredential other) { && expiresAt.equals(other.expiresAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.credentialType, this.name, this.pem, this.alg, this.parseExpiryFromCert, this.expiresAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -191,7 +191,7 @@ public static final class Builder implements CredentialTypeStage, PemStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(PublicKeyCredential other) { credentialType(other.getCredentialType()); name(other.getName()); @@ -202,7 +202,7 @@ public Builder from(PublicKeyCredential other) { return this; } - @java.lang.Override + @Override @JsonSetter("credential_type") public PemStage credentialType(@NotNull String credentialType) { this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); @@ -214,7 +214,7 @@ public PemStage credentialType(@NotNull String credentialType) { *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("pem") public _FinalStage pem(@NotNull String pem) { this.pem = Objects.requireNonNull(pem, "pem must not be null"); @@ -225,7 +225,7 @@ public _FinalStage pem(@NotNull String pem) { *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage expiresAt(OffsetDateTime expiresAt) { this.expiresAt = Optional.ofNullable(expiresAt); return this; @@ -234,7 +234,7 @@ public _FinalStage expiresAt(OffsetDateTime expiresAt) { /** *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public _FinalStage expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; @@ -245,7 +245,7 @@ public _FinalStage expiresAt(Optional expiresAt) { *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); return this; @@ -254,20 +254,20 @@ public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { /** *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

*/ - @java.lang.Override + @Override @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { this.parseExpiryFromCert = parseExpiryFromCert; return this; } - @java.lang.Override + @Override public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @java.lang.Override + @Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -278,7 +278,7 @@ public _FinalStage alg(Optional alg) { *

Friendly name for a credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -287,14 +287,14 @@ public _FinalStage name(String name) { /** *

Friendly name for a credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public PublicKeyCredential build() { return new PublicKeyCredential( credentialType, name, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java index 01c10d3ed..302f08210 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof PublicKeyCredentialAlgorithmEnum && this.string.equals(((PublicKeyCredentialAlgorithmEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java index 71c44cc4e..999dc8cf1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java @@ -42,7 +42,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenDate && equalTo((RefreshTokenDate) other); @@ -52,12 +52,12 @@ private boolean equalTo(RefreshTokenDate other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer { super(RefreshTokenDate.class); } - @java.lang.Override + @Override public RefreshTokenDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java index cf85639bb..e0b9071a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java @@ -99,7 +99,7 @@ public Optional getLastUserAgent() { return lastUserAgent; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenDevice && equalTo((RefreshTokenDevice) other); @@ -119,13 +119,13 @@ private boolean equalTo(RefreshTokenDevice other) { && lastUserAgent.equals(other.lastUserAgent); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.initialIp, this.initialAsn, this.initialUserAgent, this.lastIp, this.lastAsn, this.lastUserAgent); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java index 423edab00..0dc94c2a5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof RefreshTokenExpirationTypeEnum && this.string.equals(((RefreshTokenExpirationTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java index 424d49153..4f3b6da91 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java @@ -49,7 +49,7 @@ public Optional getScopes() { return scopes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenResourceServer && equalTo((RefreshTokenResourceServer) other); @@ -64,12 +64,12 @@ private boolean equalTo(RefreshTokenResourceServer other) { return audience.equals(other.audience) && scopes.equals(other.scopes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.audience, this.scopes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java index 788f8e096..83d2a98fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java @@ -155,7 +155,7 @@ private OptionalNullable _getSessionId() { return sessionId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenResponseContent && equalTo((RefreshTokenResponseContent) other); @@ -180,7 +180,7 @@ private boolean equalTo(RefreshTokenResponseContent other) { && lastExchangedAt.equals(other.lastExchangedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -196,7 +196,7 @@ public int hashCode() { this.lastExchangedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java index e7ec8768c..ce0c04b76 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof RefreshTokenRotationTypeEnum && this.string.equals(((RefreshTokenRotationTypeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java index e20b46a0e..297de6f8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java @@ -38,7 +38,7 @@ public Optional getRecoveryCode() { return recoveryCode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RegenerateUsersRecoveryCodeResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(RegenerateUsersRecoveryCodeResponseContent other) { return recoveryCode.equals(other.recoveryCode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.recoveryCode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java index 214459bc1..46149c473 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResetPhoneTemplateResponseContent && equalTo((ResetPhoneTemplateResponseContent) other); @@ -115,13 +115,13 @@ private boolean equalTo(ResetPhoneTemplateResponseContent other) { && disabled == other.disabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @java.lang.Override + @Override public Builder from(ResetPhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(ResetPhoneTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @java.lang.Override + @Override public ResetPhoneTemplateResponseContent build() { return new ResetPhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java index d16121b94..2fe03aa96 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java @@ -58,6 +58,10 @@ public final class ResourceServer { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + + private final Optional clientId; + private final Map additionalProperties; private ResourceServer( @@ -78,6 +82,8 @@ private ResourceServer( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, + Optional clientId, Map additionalProperties) { this.id = id; this.name = name; @@ -96,6 +102,8 @@ private ResourceServer( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; + this.clientId = clientId; this.additionalProperties = additionalProperties; } @@ -229,6 +237,19 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + + /** + * @return The client ID of the client that this resource server is linked to + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -247,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServer && equalTo((ResourceServer) other); @@ -275,10 +296,12 @@ private boolean equalTo(ResourceServer other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization) + && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -297,10 +320,12 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization, + this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -345,6 +370,10 @@ public static final class Builder { private OptionalNullable proofOfPossession = OptionalNullable.absent(); + private Optional subjectTypeAuthorization = Optional.empty(); + + private Optional clientId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -368,6 +397,8 @@ public Builder from(ResourceServer other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); + clientId(other.getClientId()); return this; } @@ -656,6 +687,32 @@ public Builder proofOfPossession( return this; } + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + /** + *

The client ID of the client that this resource server is linked to

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + public ResourceServer build() { return new ResourceServer( id, @@ -675,6 +732,8 @@ public ResourceServer build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, + clientId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java index cd6214c52..b33d42099 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java @@ -47,7 +47,7 @@ public boolean getRequired() { return required; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerProofOfPossession && equalTo((ResourceServerProofOfPossession) other); @@ -62,12 +62,12 @@ private boolean equalTo(ResourceServerProofOfPossession other) { return mechanism.equals(other.mechanism) && required == other.required; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.mechanism, this.required); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -104,14 +104,14 @@ public static final class Builder implements MechanismStage, RequiredStage, _Fin private Builder() {} - @java.lang.Override + @Override public Builder from(ResourceServerProofOfPossession other) { mechanism(other.getMechanism()); required(other.getRequired()); return this; } - @java.lang.Override + @Override @JsonSetter("mechanism") public RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanismEnum mechanism) { this.mechanism = Objects.requireNonNull(mechanism, "mechanism must not be null"); @@ -123,14 +123,14 @@ public RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanism *

Whether the use of Proof-of-Possession is required for the resource server

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("required") public _FinalStage required(boolean required) { this.required = required; return this; } - @java.lang.Override + @Override public ResourceServerProofOfPossession build() { return new ResourceServerProofOfPossession(mechanism, required, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java index 365f9920a..9177f4e5b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerProofOfPossessionMechanismEnum && this.string.equals(((ResourceServerProofOfPossessionMechanismEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java index 483429c0e..ec6f1512f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java @@ -49,7 +49,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerScope && equalTo((ResourceServerScope) other); @@ -64,12 +64,12 @@ private boolean equalTo(ResourceServerScope other) { return value.equals(other.value) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ValueStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ResourceServerScope other) { value(other.getValue()); description(other.getDescription()); @@ -121,7 +121,7 @@ public Builder from(ResourceServerScope other) { *

Value of this scope.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); @@ -132,7 +132,7 @@ public _FinalStage value(@NotNull String value) { *

User-friendly description of this scope.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -141,14 +141,14 @@ public _FinalStage description(String description) { /** *

User-friendly description of this scope.

*/ - @java.lang.Override + @Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @java.lang.Override + @Override public ResourceServerScope build() { return new ResourceServerScope(value, description, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java new file mode 100644 index 000000000..8c292356c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerSubjectTypeAuthorization.Builder.class) +public final class ResourceServerSubjectTypeAuthorization { + private final Optional user; + + private final Optional client; + + private final Map additionalProperties; + + private ResourceServerSubjectTypeAuthorization( + Optional user, + Optional client, + Map additionalProperties) { + this.user = user; + this.client = client; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user") + public Optional getUser() { + return user; + } + + @JsonProperty("client") + public Optional getClient() { + return client; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerSubjectTypeAuthorization + && equalTo((ResourceServerSubjectTypeAuthorization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerSubjectTypeAuthorization other) { + return user.equals(other.user) && client.equals(other.client); + } + + @Override + public int hashCode() { + return Objects.hash(this.user, this.client); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional user = Optional.empty(); + + private Optional client = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServerSubjectTypeAuthorization other) { + user(other.getUser()); + client(other.getClient()); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(ResourceServerSubjectTypeAuthorizationUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "client", nulls = Nulls.SKIP) + public Builder client(Optional client) { + this.client = client; + return this; + } + + public Builder client(ResourceServerSubjectTypeAuthorizationClient client) { + this.client = Optional.ofNullable(client); + return this; + } + + public ResourceServerSubjectTypeAuthorization build() { + return new ResourceServerSubjectTypeAuthorization(user, client, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java new file mode 100644 index 000000000..8abba65a4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerSubjectTypeAuthorizationClient.Builder.class) +public final class ResourceServerSubjectTypeAuthorizationClient { + private final Optional policy; + + private final Map additionalProperties; + + private ResourceServerSubjectTypeAuthorizationClient( + Optional policy, + Map additionalProperties) { + this.policy = policy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("policy") + public Optional getPolicy() { + return policy; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerSubjectTypeAuthorizationClient + && equalTo((ResourceServerSubjectTypeAuthorizationClient) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerSubjectTypeAuthorizationClient other) { + return policy.equals(other.policy); + } + + @Override + public int hashCode() { + return Objects.hash(this.policy); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional policy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServerSubjectTypeAuthorizationClient other) { + policy(other.getPolicy()); + return this; + } + + @JsonSetter(value = "policy", nulls = Nulls.SKIP) + public Builder policy(Optional policy) { + this.policy = policy; + return this; + } + + public Builder policy(ResourceServerSubjectTypeAuthorizationClientPolicyEnum policy) { + this.policy = Optional.ofNullable(policy); + return this; + } + + public ResourceServerSubjectTypeAuthorizationClient build() { + return new ResourceServerSubjectTypeAuthorizationClient(policy, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java new file mode 100644 index 000000000..1d274d16e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerSubjectTypeAuthorizationClientPolicyEnum { + public static final ResourceServerSubjectTypeAuthorizationClientPolicyEnum DENY_ALL = + new ResourceServerSubjectTypeAuthorizationClientPolicyEnum(Value.DENY_ALL, "deny_all"); + + public static final ResourceServerSubjectTypeAuthorizationClientPolicyEnum REQUIRE_CLIENT_GRANT = + new ResourceServerSubjectTypeAuthorizationClientPolicyEnum( + Value.REQUIRE_CLIENT_GRANT, "require_client_grant"); + + private final Value value; + + private final String string; + + ResourceServerSubjectTypeAuthorizationClientPolicyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerSubjectTypeAuthorizationClientPolicyEnum + && this.string.equals(((ResourceServerSubjectTypeAuthorizationClientPolicyEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DENY_ALL: + return visitor.visitDenyAll(); + case REQUIRE_CLIENT_GRANT: + return visitor.visitRequireClientGrant(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerSubjectTypeAuthorizationClientPolicyEnum valueOf(String value) { + switch (value) { + case "deny_all": + return DENY_ALL; + case "require_client_grant": + return REQUIRE_CLIENT_GRANT; + default: + return new ResourceServerSubjectTypeAuthorizationClientPolicyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY_ALL, + + REQUIRE_CLIENT_GRANT, + + UNKNOWN + } + + public interface Visitor { + T visitDenyAll(); + + T visitRequireClientGrant(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java new file mode 100644 index 000000000..39176de03 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerSubjectTypeAuthorizationUser.Builder.class) +public final class ResourceServerSubjectTypeAuthorizationUser { + private final Optional policy; + + private final Map additionalProperties; + + private ResourceServerSubjectTypeAuthorizationUser( + Optional policy, + Map additionalProperties) { + this.policy = policy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("policy") + public Optional getPolicy() { + return policy; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerSubjectTypeAuthorizationUser + && equalTo((ResourceServerSubjectTypeAuthorizationUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerSubjectTypeAuthorizationUser other) { + return policy.equals(other.policy); + } + + @Override + public int hashCode() { + return Objects.hash(this.policy); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional policy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServerSubjectTypeAuthorizationUser other) { + policy(other.getPolicy()); + return this; + } + + @JsonSetter(value = "policy", nulls = Nulls.SKIP) + public Builder policy(Optional policy) { + this.policy = policy; + return this; + } + + public Builder policy(ResourceServerSubjectTypeAuthorizationUserPolicyEnum policy) { + this.policy = Optional.ofNullable(policy); + return this; + } + + public ResourceServerSubjectTypeAuthorizationUser build() { + return new ResourceServerSubjectTypeAuthorizationUser(policy, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java new file mode 100644 index 000000000..1331fa5ea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerSubjectTypeAuthorizationUserPolicyEnum { + public static final ResourceServerSubjectTypeAuthorizationUserPolicyEnum DENY_ALL = + new ResourceServerSubjectTypeAuthorizationUserPolicyEnum(Value.DENY_ALL, "deny_all"); + + public static final ResourceServerSubjectTypeAuthorizationUserPolicyEnum REQUIRE_CLIENT_GRANT = + new ResourceServerSubjectTypeAuthorizationUserPolicyEnum( + Value.REQUIRE_CLIENT_GRANT, "require_client_grant"); + + public static final ResourceServerSubjectTypeAuthorizationUserPolicyEnum ALLOW_ALL = + new ResourceServerSubjectTypeAuthorizationUserPolicyEnum(Value.ALLOW_ALL, "allow_all"); + + private final Value value; + + private final String string; + + ResourceServerSubjectTypeAuthorizationUserPolicyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerSubjectTypeAuthorizationUserPolicyEnum + && this.string.equals(((ResourceServerSubjectTypeAuthorizationUserPolicyEnum) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DENY_ALL: + return visitor.visitDenyAll(); + case REQUIRE_CLIENT_GRANT: + return visitor.visitRequireClientGrant(); + case ALLOW_ALL: + return visitor.visitAllowAll(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerSubjectTypeAuthorizationUserPolicyEnum valueOf(String value) { + switch (value) { + case "deny_all": + return DENY_ALL; + case "require_client_grant": + return REQUIRE_CLIENT_GRANT; + case "allow_all": + return ALLOW_ALL; + default: + return new ResourceServerSubjectTypeAuthorizationUserPolicyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ALLOW_ALL, + + DENY_ALL, + + REQUIRE_CLIENT_GRANT, + + UNKNOWN + } + + public interface Visitor { + T visitAllowAll(); + + T visitDenyAll(); + + T visitRequireClientGrant(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java index 41d95ba20..9bdd0142e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenDialectResponseEnum && this.string.equals(((ResourceServerTokenDialectResponseEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java index 8124b2690..888345fee 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenDialectSchemaEnum && this.string.equals(((ResourceServerTokenDialectSchemaEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java index 468eb7521..12d48d13f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java @@ -42,7 +42,7 @@ public ResourceServerTokenEncryptionKey getEncryptionKey() { return encryptionKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerTokenEncryption && equalTo((ResourceServerTokenEncryption) other); @@ -57,12 +57,12 @@ private boolean equalTo(ResourceServerTokenEncryption other) { return format.equals(other.format) && encryptionKey.equals(other.encryptionKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.format, this.encryptionKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements FormatStage, EncryptionKeyStage, _F private Builder() {} - @java.lang.Override + @Override public Builder from(ResourceServerTokenEncryption other) { format(other.getFormat()); encryptionKey(other.getEncryptionKey()); return this; } - @java.lang.Override + @Override @JsonSetter("format") public EncryptionKeyStage format(@NotNull String format) { this.format = Objects.requireNonNull(format, "format must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("encryption_key") public _FinalStage encryptionKey(@NotNull ResourceServerTokenEncryptionKey encryptionKey) { this.encryptionKey = Objects.requireNonNull(encryptionKey, "encryptionKey must not be null"); return this; } - @java.lang.Override + @Override public ResourceServerTokenEncryption build() { return new ResourceServerTokenEncryption(format, encryptionKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java index ad694adff..b4ce05be7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenEncryptionAlgorithmEnum && this.string.equals(((ResourceServerTokenEncryptionAlgorithmEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java index 6715e0f2c..8b11ac30d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java @@ -73,7 +73,7 @@ public String getPem() { return pem; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerTokenEncryptionKey && equalTo((ResourceServerTokenEncryptionKey) other); @@ -88,12 +88,12 @@ private boolean equalTo(ResourceServerTokenEncryptionKey other) { return name.equals(other.name) && alg.equals(other.alg) && kid.equals(other.kid) && pem.equals(other.pem); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.alg, this.kid, this.pem); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -148,7 +148,7 @@ public static final class Builder implements AlgStage, PemStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(ResourceServerTokenEncryptionKey other) { name(other.getName()); alg(other.getAlg()); @@ -157,7 +157,7 @@ public Builder from(ResourceServerTokenEncryptionKey other) { return this; } - @java.lang.Override + @Override @JsonSetter("alg") public PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg) { this.alg = Objects.requireNonNull(alg, "alg must not be null"); @@ -169,7 +169,7 @@ public PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg) { *

PEM-formatted public key. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("pem") public _FinalStage pem(@NotNull String pem) { this.pem = Objects.requireNonNull(pem, "pem must not be null"); @@ -180,7 +180,7 @@ public _FinalStage pem(@NotNull String pem) { *

Key ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage kid(String kid) { this.kid = Optional.ofNullable(kid); return this; @@ -189,7 +189,7 @@ public _FinalStage kid(String kid) { /** *

Key ID.

*/ - @java.lang.Override + @Override @JsonSetter(value = "kid", nulls = Nulls.SKIP) public _FinalStage kid(Optional kid) { this.kid = kid; @@ -200,7 +200,7 @@ public _FinalStage kid(Optional kid) { *

Name of the encryption key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the encryption key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public ResourceServerTokenEncryptionKey build() { return new ResourceServerTokenEncryptionKey(name, alg, kid, pem, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java index 7c0ebc5d8..a3f9ac2b9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java @@ -51,7 +51,7 @@ public Optional getPreserveRefreshTokens() { return preserveRefreshTokens; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RevokeUserAccessRequestContent && equalTo((RevokeUserAccessRequestContent) other); @@ -66,12 +66,12 @@ private boolean equalTo(RevokeUserAccessRequestContent other) { return sessionId.equals(other.sessionId) && preserveRefreshTokens.equals(other.preserveRefreshTokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.sessionId, this.preserveRefreshTokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java index 480903d04..022f7f475 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java @@ -47,7 +47,7 @@ public String getKid() { return kid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RevokedSigningKeysResponseContent && equalTo((RevokedSigningKeysResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(RevokedSigningKeysResponseContent other) { return cert.equals(other.cert) && kid.equals(other.kid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.cert, this.kid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements CertStage, KidStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(RevokedSigningKeysResponseContent other) { cert(other.getCert()); kid(other.getKid()); @@ -119,7 +119,7 @@ public Builder from(RevokedSigningKeysResponseContent other) { *

Revoked key certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public KidStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -131,14 +131,14 @@ public KidStage cert(@NotNull String cert) { *

Revoked key id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public _FinalStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override public RevokedSigningKeysResponseContent build() { return new RevokedSigningKeysResponseContent(cert, kid, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Role.java b/src/main/java/com/auth0/client/mgmt/types/Role.java index 6fb817d6a..949895c1c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Role.java +++ b/src/main/java/com/auth0/client/mgmt/types/Role.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Role && equalTo((Role) other); @@ -78,12 +78,12 @@ private boolean equalTo(Role other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RoleUser.java b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java index 7e84435cc..67e640c69 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RoleUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java @@ -75,7 +75,7 @@ public Optional getEmail() { return email; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RoleUser && equalTo((RoleUser) other); @@ -93,12 +93,12 @@ private boolean equalTo(RoleUser other) { && email.equals(other.email); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.userId, this.picture, this.name, this.email); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java index e987123bf..fc4e0f460 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java @@ -36,7 +36,7 @@ public final class RotateClientSecretResponseContent { private final Optional clientSecret; - private final Optional appType; + private final Optional appType; private final Optional logoUri; @@ -88,6 +88,8 @@ public final class RotateClientSecretResponseContent { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional> clientMetadata; private final Optional mobile; @@ -102,6 +104,8 @@ public final class RotateClientSecretResponseContent { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -112,10 +116,20 @@ public final class RotateClientSecretResponseContent { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; + private final Optional expressConfiguration; + + private final Optional resourceServerIdentifier; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private RotateClientSecretResponseContent( @@ -125,7 +139,7 @@ private RotateClientSecretResponseContent( Optional description, Optional global, Optional clientSecret, - Optional appType, + Optional appType, Optional logoUri, Optional isFirstParty, Optional oidcConformant, @@ -151,6 +165,7 @@ private RotateClientSecretResponseContent( Optional formTemplate, Optional addons, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional> clientMetadata, Optional mobile, Optional initiateLoginUri, @@ -158,13 +173,19 @@ private RotateClientSecretResponseContent( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, + Optional expressConfiguration, + Optional resourceServerIdentifier, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.clientId = clientId; this.tenant = tenant; @@ -198,6 +219,7 @@ private RotateClientSecretResponseContent( this.formTemplate = formTemplate; this.addons = addons; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.clientMetadata = clientMetadata; this.mobile = mobile; this.initiateLoginUri = initiateLoginUri; @@ -205,13 +227,19 @@ private RotateClientSecretResponseContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; + this.expressConfiguration = expressConfiguration; + this.resourceServerIdentifier = resourceServerIdentifier; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -263,11 +291,8 @@ public Optional getClientSecret() { return clientSecret; } - /** - * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. - */ @JsonProperty("app_type") - public Optional getAppType() { + public Optional getAppType() { return appType; } @@ -358,7 +383,7 @@ public Optional getOidcLogout() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -458,6 +483,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("client_metadata") public Optional> getClientMetadata() { return clientMetadata; @@ -504,6 +537,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -543,6 +584,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -560,6 +616,24 @@ public Optional getTokenQuota() { return tokenQuota; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -602,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateClientSecretResponseContent && equalTo((RotateClientSecretResponseContent) other); @@ -646,6 +720,7 @@ private boolean equalTo(RotateClientSecretResponseContent other) { && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && clientMetadata.equals(other.clientMetadata) && mobile.equals(other.mobile) && initiateLoginUri.equals(other.initiateLoginUri) @@ -653,16 +728,23 @@ private boolean equalTo(RotateClientSecretResponseContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) - && tokenQuota.equals(other.tokenQuota); + && tokenQuota.equals(other.tokenQuota) + && expressConfiguration.equals(other.expressConfiguration) + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientId, @@ -697,6 +779,7 @@ public int hashCode() { this.formTemplate, this.addons, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.clientMetadata, this.mobile, this.initiateLoginUri, @@ -704,16 +787,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, - this.tokenQuota); + this.tokenQuota, + this.expressConfiguration, + this.resourceServerIdentifier, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -736,7 +825,7 @@ public static final class Builder { private Optional clientSecret = Optional.empty(); - private Optional appType = Optional.empty(); + private Optional appType = Optional.empty(); private Optional logoUri = Optional.empty(); @@ -788,6 +877,8 @@ public static final class Builder { private Optional tokenEndpointAuthMethod = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional> clientMetadata = Optional.empty(); private Optional mobile = Optional.empty(); @@ -802,6 +893,8 @@ public static final class Builder { private Optional organizationRequireBehavior = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -812,10 +905,21 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + + private Optional tokenExchange = Optional.empty(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); private Optional tokenQuota = Optional.empty(); + private Optional expressConfiguration = Optional.empty(); + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -854,6 +958,7 @@ public Builder from(RotateClientSecretResponseContent other) { formTemplate(other.getFormTemplate()); addons(other.getAddons()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); clientMetadata(other.getClientMetadata()); mobile(other.getMobile()); initiateLoginUri(other.getInitiateLoginUri()); @@ -861,13 +966,19 @@ public Builder from(RotateClientSecretResponseContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); + expressConfiguration(other.getExpressConfiguration()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -955,16 +1066,13 @@ public Builder clientSecret(String clientSecret) { return this; } - /** - *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

- */ @JsonSetter(value = "app_type", nulls = Nulls.SKIP) - public Builder appType(Optional appType) { + public Builder appType(Optional appType) { this.appType = appType; return this; } - public Builder appType(String appType) { + public Builder appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } @@ -1139,7 +1247,7 @@ public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1339,6 +1447,20 @@ public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEn return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public Builder clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; @@ -1461,6 +1583,22 @@ public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1564,6 +1702,36 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1609,6 +1777,44 @@ public Builder tokenQuota(TokenQuota tokenQuota) { return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public RotateClientSecretResponseContent build() { return new RotateClientSecretResponseContent( clientId, @@ -1643,6 +1849,7 @@ public RotateClientSecretResponseContent build() { formTemplate, addons, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, clientMetadata, mobile, initiateLoginUri, @@ -1650,13 +1857,19 @@ public RotateClientSecretResponseContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, + expressConfiguration, + resourceServerIdentifier, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java index 82394286a..3c4ec2ebf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java @@ -35,7 +35,7 @@ public Optional getSigningAlg() { return signingAlg; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateConnectionKeysRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(RotateConnectionKeysRequestContent other) { return signingAlg.equals(other.signingAlg); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.signingAlg); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java index 912cd24f4..052704cce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof RotateConnectionKeysSigningAlgEnum && this.string.equals(((RotateConnectionKeysSigningAlgEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java index ffbdd5bad..88a1a5a89 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java @@ -130,7 +130,7 @@ public Optional getSubjectDn() { return subjectDn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateConnectionsKeysResponseContent @@ -154,7 +154,7 @@ private boolean equalTo(RotateConnectionsKeysResponseContent other) { && subjectDn.equals(other.subjectDn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, @@ -168,7 +168,7 @@ public int hashCode() { this.subjectDn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -265,7 +265,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @java.lang.Override + @Override public Builder from(RotateConnectionsKeysResponseContent other) { kid(other.getKid()); cert(other.getCert()); @@ -284,7 +284,7 @@ public Builder from(RotateConnectionsKeysResponseContent other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -296,7 +296,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -308,7 +308,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -320,33 +320,33 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; } - @java.lang.Override + @Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; return this; } - @java.lang.Override + @Override public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { this.keyUse = Optional.ofNullable(keyUse); return this; } - @java.lang.Override + @Override @JsonSetter(value = "key_use", nulls = Nulls.SKIP) public _FinalStage keyUse(Optional keyUse) { this.keyUse = keyUse; @@ -357,7 +357,7 @@ public _FinalStage keyUse(Optional keyUse) { *

Signing key algorithm

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage algorithm(String algorithm) { this.algorithm = Optional.ofNullable(algorithm); return this; @@ -366,7 +366,7 @@ public _FinalStage algorithm(String algorithm) { /** *

Signing key algorithm

*/ - @java.lang.Override + @Override @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) public _FinalStage algorithm(Optional algorithm) { this.algorithm = algorithm; @@ -377,7 +377,7 @@ public _FinalStage algorithm(Optional algorithm) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -386,7 +386,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @java.lang.Override + @Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -397,7 +397,7 @@ public _FinalStage next(Optional next) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pkcs(String pkcs) { this.pkcs = Optional.ofNullable(pkcs); return this; @@ -406,14 +406,14 @@ public _FinalStage pkcs(String pkcs) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) public _FinalStage pkcs(Optional pkcs) { this.pkcs = pkcs; return this; } - @java.lang.Override + @Override public RotateConnectionsKeysResponseContent build() { return new RotateConnectionsKeysResponseContent( kid, cert, pkcs, next, fingerprint, thumbprint, algorithm, keyUse, subjectDn, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java index 1ab5d2e5f..c4bbf707e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java @@ -47,7 +47,7 @@ public String getKid() { return kid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateSigningKeysResponseContent && equalTo((RotateSigningKeysResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(RotateSigningKeysResponseContent other) { return cert.equals(other.cert) && kid.equals(other.kid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.cert, this.kid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements CertStage, KidStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(RotateSigningKeysResponseContent other) { cert(other.getCert()); kid(other.getKid()); @@ -119,7 +119,7 @@ public Builder from(RotateSigningKeysResponseContent other) { *

Next key certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public KidStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -131,14 +131,14 @@ public KidStage cert(@NotNull String cert) { *

Next key id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public _FinalStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @java.lang.Override + @Override public RotateSigningKeysResponseContent build() { return new RotateSigningKeysResponseContent(cert, kid, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Rule.java b/src/main/java/com/auth0/client/mgmt/types/Rule.java index f2dabb288..ca6643cbd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Rule.java +++ b/src/main/java/com/auth0/client/mgmt/types/Rule.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Rule && equalTo((Rule) other); @@ -119,12 +119,12 @@ private boolean equalTo(Rule other) { && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java index 356148acf..240a16530 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java @@ -37,7 +37,7 @@ public Optional getKey() { return key; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RulesConfig && equalTo((RulesConfig) other); @@ -52,12 +52,12 @@ private boolean equalTo(RulesConfig other) { return key.equals(other.key); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.key); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java index 982709a3e..ee3927c78 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java @@ -48,7 +48,7 @@ public Optional getScim() { return scim; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ScimMappingItem && equalTo((ScimMappingItem) other); @@ -63,12 +63,12 @@ private boolean equalTo(ScimMappingItem other) { return auth0.equals(other.auth0) && scim.equals(other.scim); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.auth0, this.scim); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java index 8bfce20a3..5474d077b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java @@ -88,7 +88,7 @@ public Optional getLastUsedAt() { return lastUsedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ScimTokenItem && equalTo((ScimTokenItem) other); @@ -107,12 +107,12 @@ private boolean equalTo(ScimTokenItem other) { && lastUsedAt.equals(other.lastUsedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.tokenId, this.scopes, this.createdAt, this.validUntil, this.lastUsedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java index 6ee139d8d..3d4fac83d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java @@ -13,6 +13,9 @@ public final class ScreenGroupNameEnum { public static final ScreenGroupNameEnum MFA_VOICE_ENROLLMENT = new ScreenGroupNameEnum(Value.MFA_VOICE_ENROLLMENT, "mfa-voice-enrollment"); + public static final ScreenGroupNameEnum ASYNC_APPROVAL_WRONG_USER = + new ScreenGroupNameEnum(Value.ASYNC_APPROVAL_WRONG_USER, "async-approval-wrong-user"); + public static final ScreenGroupNameEnum SIGNUP = new ScreenGroupNameEnum(Value.SIGNUP, "signup"); public static final ScreenGroupNameEnum MFA_PUSH_WELCOME = @@ -51,6 +54,9 @@ public final class ScreenGroupNameEnum { public static final ScreenGroupNameEnum MFA_PUSH_SUCCESS = new ScreenGroupNameEnum(Value.MFA_PUSH_SUCCESS, "mfa-push-success"); + public static final ScreenGroupNameEnum ASYNC_APPROVAL_ACCEPTED = + new ScreenGroupNameEnum(Value.ASYNC_APPROVAL_ACCEPTED, "async-approval-accepted"); + public static final ScreenGroupNameEnum DEVICE_CODE_ACTIVATION_ALLOWED = new ScreenGroupNameEnum(Value.DEVICE_CODE_ACTIVATION_ALLOWED, "device-code-activation-allowed"); @@ -91,6 +97,9 @@ public final class ScreenGroupNameEnum { public static final ScreenGroupNameEnum ORGANIZATION_SELECTION = new ScreenGroupNameEnum(Value.ORGANIZATION_SELECTION, "organization-selection"); + public static final ScreenGroupNameEnum ASYNC_APPROVAL_ERROR = + new ScreenGroupNameEnum(Value.ASYNC_APPROVAL_ERROR, "async-approval-error"); + public static final ScreenGroupNameEnum RESET_PASSWORD_MFA_PHONE_CHALLENGE = new ScreenGroupNameEnum(Value.RESET_PASSWORD_MFA_PHONE_CHALLENGE, "reset-password-mfa-phone-challenge"); @@ -106,6 +115,9 @@ public final class ScreenGroupNameEnum { public static final ScreenGroupNameEnum RESET_PASSWORD_SUCCESS = new ScreenGroupNameEnum(Value.RESET_PASSWORD_SUCCESS, "reset-password-success"); + public static final ScreenGroupNameEnum ASYNC_APPROVAL_DENIED = + new ScreenGroupNameEnum(Value.ASYNC_APPROVAL_DENIED, "async-approval-denied"); + public static final ScreenGroupNameEnum LOGIN_PASSWORDLESS_SMS_OTP = new ScreenGroupNameEnum(Value.LOGIN_PASSWORDLESS_SMS_OTP, "login-passwordless-sms-otp"); @@ -188,6 +200,9 @@ public final class ScreenGroupNameEnum { public static final ScreenGroupNameEnum MFA_PUSH_LIST = new ScreenGroupNameEnum(Value.MFA_PUSH_LIST, "mfa-push-list"); + public static final ScreenGroupNameEnum PRE_LOGIN_ORGANIZATION_PICKER = + new ScreenGroupNameEnum(Value.PRE_LOGIN_ORGANIZATION_PICKER, "pre-login-organization-picker"); + public static final ScreenGroupNameEnum MFA_PHONE_ENROLLMENT = new ScreenGroupNameEnum(Value.MFA_PHONE_ENROLLMENT, "mfa-phone-enrollment"); @@ -263,19 +278,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof ScreenGroupNameEnum && this.string.equals(((ScreenGroupNameEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } @@ -286,6 +301,8 @@ public T visit(Visitor visitor) { return visitor.visitMfaPhoneChallenge(); case MFA_VOICE_ENROLLMENT: return visitor.visitMfaVoiceEnrollment(); + case ASYNC_APPROVAL_WRONG_USER: + return visitor.visitAsyncApprovalWrongUser(); case SIGNUP: return visitor.visitSignup(); case MFA_PUSH_WELCOME: @@ -312,6 +329,8 @@ public T visit(Visitor visitor) { return visitor.visitResetPasswordMfaVoiceChallenge(); case MFA_PUSH_SUCCESS: return visitor.visitMfaPushSuccess(); + case ASYNC_APPROVAL_ACCEPTED: + return visitor.visitAsyncApprovalAccepted(); case DEVICE_CODE_ACTIVATION_ALLOWED: return visitor.visitDeviceCodeActivationAllowed(); case INTERSTITIAL_CAPTCHA: @@ -340,6 +359,8 @@ public T visit(Visitor visitor) { return visitor.visitResetPasswordMfaRecoveryCodeChallenge(); case ORGANIZATION_SELECTION: return visitor.visitOrganizationSelection(); + case ASYNC_APPROVAL_ERROR: + return visitor.visitAsyncApprovalError(); case RESET_PASSWORD_MFA_PHONE_CHALLENGE: return visitor.visitResetPasswordMfaPhoneChallenge(); case MFA_RECOVERY_CODE_CHALLENGE: @@ -350,6 +371,8 @@ public T visit(Visitor visitor) { return visitor.visitResetPasswordMfaWebauthnPlatformChallenge(); case RESET_PASSWORD_SUCCESS: return visitor.visitResetPasswordSuccess(); + case ASYNC_APPROVAL_DENIED: + return visitor.visitAsyncApprovalDenied(); case LOGIN_PASSWORDLESS_SMS_OTP: return visitor.visitLoginPasswordlessSmsOtp(); case DEVICE_CODE_CONFIRMATION: @@ -408,6 +431,8 @@ public T visit(Visitor visitor) { return visitor.visitMfaEnrollResult(); case MFA_PUSH_LIST: return visitor.visitMfaPushList(); + case PRE_LOGIN_ORGANIZATION_PICKER: + return visitor.visitPreLoginOrganizationPicker(); case MFA_PHONE_ENROLLMENT: return visitor.visitMfaPhoneEnrollment(); case MFA_RECOVERY_CODE_CHALLENGE_NEW_CODE: @@ -463,6 +488,8 @@ public static ScreenGroupNameEnum valueOf(String value) { return MFA_PHONE_CHALLENGE; case "mfa-voice-enrollment": return MFA_VOICE_ENROLLMENT; + case "async-approval-wrong-user": + return ASYNC_APPROVAL_WRONG_USER; case "signup": return SIGNUP; case "mfa-push-welcome": @@ -489,6 +516,8 @@ public static ScreenGroupNameEnum valueOf(String value) { return RESET_PASSWORD_MFA_VOICE_CHALLENGE; case "mfa-push-success": return MFA_PUSH_SUCCESS; + case "async-approval-accepted": + return ASYNC_APPROVAL_ACCEPTED; case "device-code-activation-allowed": return DEVICE_CODE_ACTIVATION_ALLOWED; case "interstitial-captcha": @@ -517,6 +546,8 @@ public static ScreenGroupNameEnum valueOf(String value) { return RESET_PASSWORD_MFA_RECOVERY_CODE_CHALLENGE; case "organization-selection": return ORGANIZATION_SELECTION; + case "async-approval-error": + return ASYNC_APPROVAL_ERROR; case "reset-password-mfa-phone-challenge": return RESET_PASSWORD_MFA_PHONE_CHALLENGE; case "mfa-recovery-code-challenge": @@ -527,6 +558,8 @@ public static ScreenGroupNameEnum valueOf(String value) { return RESET_PASSWORD_MFA_WEBAUTHN_PLATFORM_CHALLENGE; case "reset-password-success": return RESET_PASSWORD_SUCCESS; + case "async-approval-denied": + return ASYNC_APPROVAL_DENIED; case "login-passwordless-sms-otp": return LOGIN_PASSWORDLESS_SMS_OTP; case "device-code-confirmation": @@ -585,6 +618,8 @@ public static ScreenGroupNameEnum valueOf(String value) { return MFA_ENROLL_RESULT; case "mfa-push-list": return MFA_PUSH_LIST; + case "pre-login-organization-picker": + return PRE_LOGIN_ORGANIZATION_PICKER; case "mfa-phone-enrollment": return MFA_PHONE_ENROLLMENT; case "mfa-recovery-code-challenge-new-code": @@ -785,6 +820,8 @@ public enum Value { ORGANIZATION_PICKER, + PRE_LOGIN_ORGANIZATION_PICKER, + ACCEPT_INVITATION, REDEEM_TICKET, @@ -801,6 +838,14 @@ public enum Value { BRUTE_FORCE_PROTECTION_UNBLOCK_FAILURE, + ASYNC_APPROVAL_ERROR, + + ASYNC_APPROVAL_WRONG_USER, + + ASYNC_APPROVAL_ACCEPTED, + + ASYNC_APPROVAL_DENIED, + UNKNOWN } @@ -957,6 +1002,8 @@ public interface Visitor { T visitOrganizationPicker(); + T visitPreLoginOrganizationPicker(); + T visitAcceptInvitation(); T visitRedeemTicket(); @@ -973,6 +1020,14 @@ public interface Visitor { T visitBruteForceProtectionUnblockFailure(); + T visitAsyncApprovalError(); + + T visitAsyncApprovalWrongUser(); + + T visitAsyncApprovalAccepted(); + + T visitAsyncApprovalDenied(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java index 5a1e7fbf1..064659af8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SearchEngineVersionsEnum && this.string.equals(((SearchEngineVersionsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java index 02948da08..7f91ad0fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java @@ -38,6 +38,8 @@ public final class SelfServiceProfile { private final Optional> allowedStrategies; + private final Optional userAttributeProfileId; + private final Map additionalProperties; private SelfServiceProfile( @@ -49,6 +51,7 @@ private SelfServiceProfile( Optional updatedAt, Optional branding, Optional> allowedStrategies, + Optional userAttributeProfileId, Map additionalProperties) { this.id = id; this.name = name; @@ -58,6 +61,7 @@ private SelfServiceProfile( this.updatedAt = updatedAt; this.branding = branding; this.allowedStrategies = allowedStrategies; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -122,7 +126,15 @@ public Optional> getAllowedStrategie return allowedStrategies; } - @java.lang.Override + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonProperty("user_attribute_profile_id") + public Optional getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfile && equalTo((SelfServiceProfile) other); @@ -141,10 +153,11 @@ private boolean equalTo(SelfServiceProfile other) { && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && branding.equals(other.branding) - && allowedStrategies.equals(other.allowedStrategies); + && allowedStrategies.equals(other.allowedStrategies) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -154,10 +167,11 @@ public int hashCode() { this.createdAt, this.updatedAt, this.branding, - this.allowedStrategies); + this.allowedStrategies, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -184,6 +198,8 @@ public static final class Builder { private Optional> allowedStrategies = Optional.empty(); + private Optional userAttributeProfileId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -198,6 +214,7 @@ public Builder from(SelfServiceProfile other) { updatedAt(other.getUpdatedAt()); branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -310,6 +327,20 @@ public Builder allowedStrategies(List all return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public Builder userAttributeProfileId(Optional userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + + public Builder userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); + return this; + } + public SelfServiceProfile build() { return new SelfServiceProfile( id, @@ -320,6 +351,7 @@ public SelfServiceProfile build() { updatedAt, branding, allowedStrategies, + userAttributeProfileId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java index 493df00d2..475f8ad1f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java @@ -44,20 +44,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileAllowedStrategyEnum && this.string.equals(((SelfServiceProfileAllowedStrategyEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java index a7b65cd3c..9200445db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java @@ -33,7 +33,7 @@ public String getPrimary() { return primary; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileBrandingColors && equalTo((SelfServiceProfileBrandingColors) other); @@ -48,12 +48,12 @@ private boolean equalTo(SelfServiceProfileBrandingColors other) { return primary.equals(other.primary); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.primary); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements PrimaryStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SelfServiceProfileBrandingColors other) { primary(other.getPrimary()); return this; } - @java.lang.Override + @Override @JsonSetter("primary") public _FinalStage primary(@NotNull String primary) { this.primary = Objects.requireNonNull(primary, "primary must not be null"); return this; } - @java.lang.Override + @Override public SelfServiceProfileBrandingColors build() { return new SelfServiceProfileBrandingColors(primary, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java index 3ece91ff2..60905bbeb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java @@ -45,7 +45,7 @@ public Optional getColors() { return colors; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileBrandingProperties @@ -61,12 +61,12 @@ private boolean equalTo(SelfServiceProfileBrandingProperties other) { return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.logoUrl, this.colors); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java index 4fe08b160..1669c341c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java @@ -32,7 +32,7 @@ public final class SelfServiceProfileSsoTicketConnectionConfig { private final Optional showAsButton; - private final Optional> metadata; + private final Optional>> metadata; private final OptionalNullable options; @@ -43,7 +43,7 @@ private SelfServiceProfileSsoTicketConnectionConfig( Optional displayName, Optional isDomainConnection, Optional showAsButton, - Optional> metadata, + Optional>> metadata, OptionalNullable options, Map additionalProperties) { this.name = name; @@ -88,7 +88,7 @@ public Optional getShowAsButton() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -107,7 +107,7 @@ private OptionalNullable _getOptio return options; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketConnectionConfig @@ -128,13 +128,13 @@ private boolean equalTo(SelfServiceProfileSsoTicketConnectionConfig other) { && options.equals(other.options); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.displayName, this.isDomainConnection, this.showAsButton, this.metadata, this.options); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -176,9 +176,9 @@ public interface _FinalStage { _FinalStage showAsButton(Boolean showAsButton); - _FinalStage metadata(Optional> metadata); + _FinalStage metadata(Optional>> metadata); - _FinalStage metadata(Map metadata); + _FinalStage metadata(Map> metadata); _FinalStage options(@Nullable OptionalNullable options); @@ -195,7 +195,7 @@ public static final class Builder implements NameStage, _FinalStage { private OptionalNullable options = OptionalNullable.absent(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional showAsButton = Optional.empty(); @@ -208,7 +208,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SelfServiceProfileSsoTicketConnectionConfig other) { name(other.getName()); displayName(other.getDisplayName()); @@ -224,14 +224,14 @@ public Builder from(SelfServiceProfileSsoTicketConnectionConfig other) { *

The name of the connection that will be created as a part of the SSO flow.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage options( com.auth0.client.mgmt.core.Nullable options) { if (options.isNull()) { @@ -244,7 +244,7 @@ public _FinalStage options( return this; } - @java.lang.Override + @Override public _FinalStage options(Optional options) { if (options.isPresent()) { this.options = OptionalNullable.of(options.get()); @@ -254,28 +254,28 @@ public _FinalStage options(Optional options) { this.options = options; return this; } - @java.lang.Override - public _FinalStage metadata(Map metadata) { + @Override + public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @java.lang.Override + @Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional> metadata) { + public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; return this; } @@ -284,7 +284,7 @@ public _FinalStage metadata(Optional> metadata) { *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -293,7 +293,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

*/ - @java.lang.Override + @Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -304,7 +304,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isDomainConnection(Boolean isDomainConnection) { this.isDomainConnection = Optional.ofNullable(isDomainConnection); return this; @@ -313,7 +313,7 @@ public _FinalStage isDomainConnection(Boolean isDomainConnection) { /** *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

*/ - @java.lang.Override + @Override @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) public _FinalStage isDomainConnection(Optional isDomainConnection) { this.isDomainConnection = isDomainConnection; @@ -324,7 +324,7 @@ public _FinalStage isDomainConnection(Optional isDomainConnection) { *

Connection name used in the new universal login experience

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -333,14 +333,14 @@ public _FinalStage displayName(String displayName) { /** *

Connection name used in the new universal login experience

*/ - @java.lang.Override + @Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @java.lang.Override + @Override public SelfServiceProfileSsoTicketConnectionConfig build() { return new SelfServiceProfileSsoTicketConnectionConfig( name, displayName, isDomainConnection, showAsButton, metadata, options, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java index ecd00be80..67c160e5e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java @@ -84,7 +84,7 @@ private OptionalNullable _getIdp return idpinitiated; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketConnectionOptions @@ -102,12 +102,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketConnectionOptions other) { && idpinitiated.equals(other.idpinitiated); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.iconUrl, this.domainAliases, this.idpinitiated); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java index 94a640d7f..d4d653577 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java @@ -35,7 +35,7 @@ public SelfServiceProfileSsoTicketDomainVerificationEnum getDomainVerification() return domainVerification; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketDomainAliasesConfig @@ -51,12 +51,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketDomainAliasesConfig other) { return domainVerification.equals(other.domainVerification); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.domainVerification); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,13 +84,13 @@ public static final class Builder implements DomainVerificationStage, _FinalStag private Builder() {} - @java.lang.Override + @Override public Builder from(SelfServiceProfileSsoTicketDomainAliasesConfig other) { domainVerification(other.getDomainVerification()); return this; } - @java.lang.Override + @Override @JsonSetter("domain_verification") public _FinalStage domainVerification( @NotNull SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification) { @@ -98,7 +98,7 @@ public _FinalStage domainVerification( return this; } - @java.lang.Override + @Override public SelfServiceProfileSsoTicketDomainAliasesConfig build() { return new SelfServiceProfileSsoTicketDomainAliasesConfig(domainVerification, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java index dcb54f647..5661c511c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketDomainVerificationEnum && this.string.equals(((SelfServiceProfileSsoTicketDomainVerificationEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java index b84285960..86efd66d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java @@ -64,7 +64,7 @@ public Optional getShowAsButton() { return showAsButton; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketEnabledOrganization @@ -82,12 +82,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketEnabledOrganization other) { && showAsButton.equals(other.showAsButton); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.organizationId, this.assignMembershipOnLogin, this.showAsButton); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -136,7 +136,7 @@ public static final class Builder implements OrganizationIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SelfServiceProfileSsoTicketEnabledOrganization other) { organizationId(other.getOrganizationId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -149,7 +149,7 @@ public Builder from(SelfServiceProfileSsoTicketEnabledOrganization other) { *

Organization identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("organization_id") public _FinalStage organizationId(@NotNull String organizationId) { this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); @@ -160,7 +160,7 @@ public _FinalStage organizationId(@NotNull String organizationId) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -169,7 +169,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -180,7 +180,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -189,14 +189,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @java.lang.Override + @Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @java.lang.Override + @Override public SelfServiceProfileSsoTicketEnabledOrganization build() { return new SelfServiceProfileSsoTicketEnabledOrganization( organizationId, assignMembershipOnLogin, showAsButton, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java new file mode 100644 index 000000000..7c169abdc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SelfServiceProfileSsoTicketGoogleWorkspaceConfig.Builder.class) +public final class SelfServiceProfileSsoTicketGoogleWorkspaceConfig { + private final boolean syncUsers; + + private final Map additionalProperties; + + private SelfServiceProfileSsoTicketGoogleWorkspaceConfig( + boolean syncUsers, Map additionalProperties) { + this.syncUsers = syncUsers; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to enable Google Workspace Directory Sync for users during the self-service flow. + */ + @JsonProperty("sync_users") + public boolean getSyncUsers() { + return syncUsers; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SelfServiceProfileSsoTicketGoogleWorkspaceConfig + && equalTo((SelfServiceProfileSsoTicketGoogleWorkspaceConfig) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other) { + return syncUsers == other.syncUsers; + } + + @Override + public int hashCode() { + return Objects.hash(this.syncUsers); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SyncUsersStage builder() { + return new Builder(); + } + + public interface SyncUsersStage { + /** + *

Whether to enable Google Workspace Directory Sync for users during the self-service flow.

+ */ + _FinalStage syncUsers(boolean syncUsers); + + Builder from(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other); + } + + public interface _FinalStage { + SelfServiceProfileSsoTicketGoogleWorkspaceConfig build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SyncUsersStage, _FinalStage { + private boolean syncUsers; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other) { + syncUsers(other.getSyncUsers()); + return this; + } + + /** + *

Whether to enable Google Workspace Directory Sync for users during the self-service flow.

+ *

Whether to enable Google Workspace Directory Sync for users during the self-service flow.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("sync_users") + public _FinalStage syncUsers(boolean syncUsers) { + this.syncUsers = syncUsers; + return this; + } + + @Override + public SelfServiceProfileSsoTicketGoogleWorkspaceConfig build() { + return new SelfServiceProfileSsoTicketGoogleWorkspaceConfig(syncUsers, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java index 81075f195..ff76dcfdb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java @@ -29,13 +29,13 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum @@ -43,7 +43,7 @@ public boolean equals(Object other) { ((SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java index dff7baef3..9993d7080 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java @@ -72,7 +72,7 @@ public Optional getClientAuthorizequery() { return clientAuthorizequery; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketIdpInitiatedOptions @@ -91,12 +91,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketIdpInitiatedOptions other) { && clientAuthorizequery.equals(other.clientAuthorizequery); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.clientId, this.clientProtocol, this.clientAuthorizequery); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java index b5d111ee9..cfc89831d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -25,17 +24,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = SelfServiceProfileSsoTicketProvisioningConfig.Builder.class) public final class SelfServiceProfileSsoTicketProvisioningConfig { - private final List scopes; + private final Optional> scopes; + + private final Optional googleWorkspace; private final OptionalNullable tokenLifetime; private final Map additionalProperties; private SelfServiceProfileSsoTicketProvisioningConfig( - List scopes, + Optional> scopes, + Optional googleWorkspace, OptionalNullable tokenLifetime, Map additionalProperties) { this.scopes = scopes; + this.googleWorkspace = googleWorkspace; this.tokenLifetime = tokenLifetime; this.additionalProperties = additionalProperties; } @@ -44,10 +47,15 @@ private SelfServiceProfileSsoTicketProvisioningConfig( * @return The scopes of the SCIM tokens generated during the self-service flow. */ @JsonProperty("scopes") - public List getScopes() { + public Optional> getScopes() { return scopes; } + @JsonProperty("google_workspace") + public Optional getGoogleWorkspace() { + return googleWorkspace; + } + /** * @return Lifetime of the tokens in seconds. Must be greater than 900. If not provided, the tokens don't expire. */ @@ -66,7 +74,7 @@ private OptionalNullable _getTokenLifetime() { return tokenLifetime; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketProvisioningConfig @@ -79,15 +87,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(SelfServiceProfileSsoTicketProvisioningConfig other) { - return scopes.equals(other.scopes) && tokenLifetime.equals(other.tokenLifetime); + return scopes.equals(other.scopes) + && googleWorkspace.equals(other.googleWorkspace) + && tokenLifetime.equals(other.tokenLifetime); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.scopes, this.tokenLifetime); + return Objects.hash(this.scopes, this.googleWorkspace, this.tokenLifetime); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,7 +108,9 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private List scopes = new ArrayList<>(); + private Optional> scopes = Optional.empty(); + + private Optional googleWorkspace = Optional.empty(); private OptionalNullable tokenLifetime = OptionalNullable.absent(); @@ -109,6 +121,7 @@ private Builder() {} public Builder from(SelfServiceProfileSsoTicketProvisioningConfig other) { scopes(other.getScopes()); + googleWorkspace(other.getGoogleWorkspace()); tokenLifetime(other.getTokenLifetime()); return this; } @@ -117,23 +130,24 @@ public Builder from(SelfServiceProfileSsoTicketProvisioningConfig other) { *

The scopes of the SCIM tokens generated during the self-service flow.

*/ @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + public Builder scopes(List scopes) { - this.scopes.clear(); - if (scopes != null) { - this.scopes.addAll(scopes); - } + this.scopes = Optional.ofNullable(scopes); return this; } - public Builder addScopes(SelfServiceProfileSsoTicketProvisioningScopeEnum scopes) { - this.scopes.add(scopes); + @JsonSetter(value = "google_workspace", nulls = Nulls.SKIP) + public Builder googleWorkspace(Optional googleWorkspace) { + this.googleWorkspace = googleWorkspace; return this; } - public Builder addAllScopes(List scopes) { - if (scopes != null) { - this.scopes.addAll(scopes); - } + public Builder googleWorkspace(SelfServiceProfileSsoTicketGoogleWorkspaceConfig googleWorkspace) { + this.googleWorkspace = Optional.ofNullable(googleWorkspace); return this; } @@ -172,7 +186,8 @@ public Builder tokenLifetime(com.auth0.client.mgmt.core.Nullable tokenL } public SelfServiceProfileSsoTicketProvisioningConfig build() { - return new SelfServiceProfileSsoTicketProvisioningConfig(scopes, tokenLifetime, additionalProperties); + return new SelfServiceProfileSsoTicketProvisioningConfig( + scopes, googleWorkspace, tokenLifetime, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java index ec9fada64..dc9cfeaba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketProvisioningScopeEnum && this.string.equals(((SelfServiceProfileSsoTicketProvisioningScopeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java index 0228f1414..5e4f6f3a9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java @@ -59,7 +59,7 @@ public boolean getIsOptional() { return isOptional; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileUserAttribute && equalTo((SelfServiceProfileUserAttribute) other); @@ -74,12 +74,12 @@ private boolean equalTo(SelfServiceProfileUserAttribute other) { return name.equals(other.name) && description.equals(other.description) && isOptional == other.isOptional; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.description, this.isOptional); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder implements NameStage, DescriptionStage, IsOpti private Builder() {} - @java.lang.Override + @Override public Builder from(SelfServiceProfileUserAttribute other) { name(other.getName()); description(other.getDescription()); @@ -141,7 +141,7 @@ public Builder from(SelfServiceProfileUserAttribute other) { *

Identifier of this attribute.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("name") public DescriptionStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -153,7 +153,7 @@ public DescriptionStage name(@NotNull String name) { *

Description of this attribute.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("description") public IsOptionalStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -165,14 +165,14 @@ public IsOptionalStage description(@NotNull String description) { *

Determines if this attribute is required

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("is_optional") public _FinalStage isOptional(boolean isOptional) { this.isOptional = isOptional; return this; } - @java.lang.Override + @Override public SelfServiceProfileUserAttribute build() { return new SelfServiceProfileUserAttribute(name, description, isOptional, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java index 6424915ef..d9bdb3a22 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java @@ -60,7 +60,7 @@ public Optional getType() { return type; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionAuthenticationSignal && equalTo((SessionAuthenticationSignal) other); @@ -75,12 +75,12 @@ private boolean equalTo(SessionAuthenticationSignal other) { return name.equals(other.name) && timestamp.equals(other.timestamp) && type.equals(other.type); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.timestamp, this.type); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java index d12ab5d88..d3ee73821 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java @@ -39,7 +39,7 @@ public Optional> getMethods() { return methods; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionAuthenticationSignals && equalTo((SessionAuthenticationSignals) other); @@ -54,12 +54,12 @@ private boolean equalTo(SessionAuthenticationSignals other) { return methods.equals(other.methods); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.methods); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java index 1d841f73b..b897c7cb0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java @@ -37,7 +37,7 @@ public Optional getClientId() { return clientId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionClientMetadata && equalTo((SessionClientMetadata) other); @@ -52,12 +52,12 @@ private boolean equalTo(SessionClientMetadata other) { return clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java index 459ef0888..9ae07fca1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java @@ -35,7 +35,7 @@ public Optional getMode() { return mode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionCookieMetadata && equalTo((SessionCookieMetadata) other); @@ -50,12 +50,12 @@ private boolean equalTo(SessionCookieMetadata other) { return mode.equals(other.mode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.mode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java index c082d2237..c352592f0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SessionCookieMetadataModeEnum && this.string.equals(((SessionCookieMetadataModeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java index 56933f15e..9ca301cb0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SessionCookieModeEnum && this.string.equals(((SessionCookieModeEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java index 68e8bd009..f8824a3f8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java @@ -33,7 +33,7 @@ public SessionCookieModeEnum getMode() { return mode; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionCookieSchema && equalTo((SessionCookieSchema) other); @@ -48,12 +48,12 @@ private boolean equalTo(SessionCookieSchema other) { return mode.equals(other.mode); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.mode); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ModeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SessionCookieSchema other) { mode(other.getMode()); return this; } - @java.lang.Override + @Override @JsonSetter("mode") public _FinalStage mode(@NotNull SessionCookieModeEnum mode) { this.mode = Objects.requireNonNull(mode, "mode must not be null"); return this; } - @java.lang.Override + @Override public SessionCookieSchema build() { return new SessionCookieSchema(mode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDate.java b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java index 0c78619bd..2e1674a45 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java @@ -42,7 +42,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionDate && equalTo((SessionDate) other); @@ -52,12 +52,12 @@ private boolean equalTo(SessionDate other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer { super(SessionDate.class); } - @java.lang.Override + @Override public SessionDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java index 1da1dccac..7bbee2239 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java @@ -116,7 +116,7 @@ private OptionalNullable _getLastIp() { return lastIp; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionDeviceMetadata && equalTo((SessionDeviceMetadata) other); @@ -136,13 +136,13 @@ private boolean equalTo(SessionDeviceMetadata other) { && lastAsn.equals(other.lastAsn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.initialUserAgent, this.initialIp, this.initialAsn, this.lastUserAgent, this.lastIp, this.lastAsn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java index e59b0dd99..91d0d1231 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java @@ -3,7 +3,9 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -17,6 +19,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = SessionResponseContent.Builder.class) @@ -45,6 +48,8 @@ public final class SessionResponseContent { private final Optional cookie; + private final OptionalNullable> sessionMetadata; + private final Map additionalProperties; private SessionResponseContent( @@ -60,6 +65,7 @@ private SessionResponseContent( Optional> clients, Optional authentication, Optional cookie, + OptionalNullable> sessionMetadata, Map additionalProperties) { this.id = id; this.userId = userId; @@ -73,6 +79,7 @@ private SessionResponseContent( this.clients = clients; this.authentication = authentication; this.cookie = cookie; + this.sessionMetadata = sessionMetadata; this.additionalProperties = additionalProperties; } @@ -145,7 +152,22 @@ public Optional getCookie() { return cookie; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + public OptionalNullable> getSessionMetadata() { + if (sessionMetadata == null) { + return OptionalNullable.absent(); + } + return sessionMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + private OptionalNullable> _getSessionMetadata() { + return sessionMetadata; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionResponseContent && equalTo((SessionResponseContent) other); @@ -168,10 +190,11 @@ private boolean equalTo(SessionResponseContent other) { && device.equals(other.device) && clients.equals(other.clients) && authentication.equals(other.authentication) - && cookie.equals(other.cookie); + && cookie.equals(other.cookie) + && sessionMetadata.equals(other.sessionMetadata); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -185,10 +208,11 @@ public int hashCode() { this.device, this.clients, this.authentication, - this.cookie); + this.cookie, + this.sessionMetadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -223,6 +247,8 @@ public static final class Builder { private Optional cookie = Optional.empty(); + private OptionalNullable> sessionMetadata = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -241,6 +267,7 @@ public Builder from(SessionResponseContent other) { clients(other.getClients()); authentication(other.getAuthentication()); cookie(other.getCookie()); + sessionMetadata(other.getSessionMetadata()); return this; } @@ -385,6 +412,37 @@ public Builder cookie(SessionCookieMetadata cookie) { return this; } + @JsonSetter(value = "session_metadata", nulls = Nulls.SKIP) + public Builder sessionMetadata(@Nullable OptionalNullable> sessionMetadata) { + this.sessionMetadata = sessionMetadata; + return this; + } + + public Builder sessionMetadata(Map sessionMetadata) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata); + return this; + } + + public Builder sessionMetadata(Optional> sessionMetadata) { + if (sessionMetadata.isPresent()) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } else { + this.sessionMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionMetadata(com.auth0.client.mgmt.core.Nullable> sessionMetadata) { + if (sessionMetadata.isNull()) { + this.sessionMetadata = OptionalNullable.ofNull(); + } else if (sessionMetadata.isEmpty()) { + this.sessionMetadata = OptionalNullable.absent(); + } else { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } + return this; + } + public SessionResponseContent build() { return new SessionResponseContent( id, @@ -399,6 +457,7 @@ public SessionResponseContent build() { clients, authentication, cookie, + sessionMetadata, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java index 41989a253..a54a4bc20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java @@ -39,7 +39,7 @@ public Optional> getKeys() { return keys; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetCustomSigningKeysResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(SetCustomSigningKeysResponseContent other) { return keys.equals(other.keys); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.keys); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java index 6932d5194..12f86648b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetEmailTemplateRequestContent && equalTo((SetEmailTemplateRequestContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(SetEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetEmailTemplateRequestContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(SetEmailTemplateRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @java.lang.Override + @Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @java.lang.Override + @Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @java.lang.Override + @Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @java.lang.Override + @Override public SetEmailTemplateRequestContent build() { return new SetEmailTemplateRequestContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java index 12b45012d..6ddb1dd40 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetEmailTemplateResponseContent && equalTo((SetEmailTemplateResponseContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(SetEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetEmailTemplateResponseContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(SetEmailTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @java.lang.Override + @Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @java.lang.Override + @Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @java.lang.Override + @Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @java.lang.Override + @Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @java.lang.Override + @Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @java.lang.Override + @Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @java.lang.Override + @Override public SetEmailTemplateResponseContent build() { return new SetEmailTemplateResponseContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java index b0e6d7cfc..78fce4b25 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(SetGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java index 1d1d7dba3..59e9b644c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java @@ -40,7 +40,7 @@ public Optional> getMessageTypes( return messageTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneMessageTypesResponseContent @@ -56,12 +56,12 @@ private boolean equalTo(SetGuardianFactorPhoneMessageTypesResponseContent other) return messageTypes.equals(other.messageTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.messageTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java index 2fb065313..4aedfa7d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorPhoneTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorPhoneTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorPhoneTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public SetGuardianFactorPhoneTemplatesResponseContent build() { return new SetGuardianFactorPhoneTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java index 7cebe40d1..a0682267b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorResponseContent && equalTo((SetGuardianFactorResponseContent) other); @@ -50,12 +50,12 @@ private boolean equalTo(SetGuardianFactorResponseContent other) { return enabled == other.enabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -86,7 +86,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorResponseContent other) { enabled(other.getEnabled()); return this; @@ -97,14 +97,14 @@ public Builder from(SetGuardianFactorResponseContent other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @java.lang.Override + @Override public SetGuardianFactorResponseContent build() { return new SetGuardianFactorResponseContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java index 7f1280a48..ea47acf88 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorSmsTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorSmsTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @java.lang.Override + @Override public Builder from(SetGuardianFactorSmsTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorSmsTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @java.lang.Override + @Override public SetGuardianFactorSmsTemplatesResponseContent build() { return new SetGuardianFactorSmsTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java index c7ca94056..71322d041 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneResponseContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java index 3e0e6cfa8..c4fc02430 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioResponseContent oth && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java index 07369413a..177fef339 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java @@ -77,7 +77,7 @@ private OptionalNullable _getP12() { return p12; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationApnsRequestContent @@ -93,12 +93,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsRequestCon return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId) && p12.equals(other.p12); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.sandbox, this.bundleId, this.p12); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java index 307f15ec1..50c4587fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java @@ -56,7 +56,7 @@ private OptionalNullable _getBundleId() { return bundleId; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationApnsResponseContent @@ -72,12 +72,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsResponseCo return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.sandbox, this.bundleId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java index a3133b6e0..a0ced329d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java @@ -48,7 +48,7 @@ private OptionalNullable _getServerKey() { return serverKey; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationFcmRequestContent @@ -64,12 +64,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmRequestCont return serverKey.equals(other.serverKey); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.serverKey); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java index 48ab3516e..6ffb83f69 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java @@ -48,7 +48,7 @@ private OptionalNullable _getServerCredentials() { return serverCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationFcmv1RequestContent @@ -64,12 +64,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmv1RequestCo return serverCredentials.equals(other.serverCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.serverCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java index c7713b530..ed6a395a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java @@ -36,7 +36,7 @@ public Optional getProv return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationResponseConten return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java index 0e2aff519..d1c0c9c0e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsResponseCon && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java index 712e9c554..d28fa6eb0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsResponseContent other) { return provider.equals(other.provider); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java index 53076ea2e..3bd955c55 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsTwilioResponseContent other && sid.equals(other.sid); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java index 63eb55efd..ba289d5fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java @@ -68,7 +68,7 @@ public NetworkAclRule getRule() { return rule; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetNetworkAclRequestContent && equalTo((SetNetworkAclRequestContent) other); @@ -86,12 +86,12 @@ private boolean equalTo(SetNetworkAclRequestContent other) { && rule.equals(other.rule); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements DescriptionStage, ActiveStage, Prio private Builder() {} - @java.lang.Override + @Override public Builder from(SetNetworkAclRequestContent other) { description(other.getDescription()); active(other.getActive()); @@ -152,7 +152,7 @@ public Builder from(SetNetworkAclRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("description") public ActiveStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -164,7 +164,7 @@ public ActiveStage description(@NotNull String description) { *

Indicates whether or not this access control list is actively being used

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("active") public PriorityStage active(boolean active) { this.active = active; @@ -176,21 +176,21 @@ public PriorityStage active(boolean active) { *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("priority") public RuleStage priority(double priority) { this.priority = priority; return this; } - @java.lang.Override + @Override @JsonSetter("rule") public _FinalStage rule(@NotNull NetworkAclRule rule) { this.rule = Objects.requireNonNull(rule, "rule must not be null"); return this; } - @java.lang.Override + @Override public SetNetworkAclRequestContent build() { return new SetNetworkAclRequestContent(description, active, priority, rule, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java index 2f9b88e14..b53409c4d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetNetworkAclsResponseContent && equalTo((SetNetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(SetNetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java index fe5071d0f..b5ead757b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java @@ -36,7 +36,7 @@ public String getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetRulesConfigRequestContent && equalTo((SetRulesConfigRequestContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(SetRulesConfigRequestContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ValueStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetRulesConfigRequestContent other) { value(other.getValue()); return this; @@ -98,14 +98,14 @@ public Builder from(SetRulesConfigRequestContent other) { *

Value for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override public SetRulesConfigRequestContent build() { return new SetRulesConfigRequestContent(value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java index 26d5058ad..6e78107da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java @@ -47,7 +47,7 @@ public String getValue() { return value; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetRulesConfigResponseContent && equalTo((SetRulesConfigResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(SetRulesConfigResponseContent other) { return key.equals(other.key) && value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.key, this.value); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements KeyStage, ValueStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetRulesConfigResponseContent other) { key(other.getKey()); value(other.getValue()); @@ -119,7 +119,7 @@ public Builder from(SetRulesConfigResponseContent other) { *

Key for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("key") public ValueStage key(@NotNull String key) { this.key = Objects.requireNonNull(key, "key must not be null"); @@ -131,14 +131,14 @@ public ValueStage key(@NotNull String key) { *

Value for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @java.lang.Override + @Override public SetRulesConfigResponseContent build() { return new SetRulesConfigResponseContent(key, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java index 5bd9d3875..a3d0fec7e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java @@ -43,6 +43,8 @@ public final class SetUserAuthenticationMethodResponseContent { private final Optional publicKey; + private final Optional aaguid; + private final Optional relyingPartyIdentifier; private final Optional createdAt; @@ -60,6 +62,7 @@ private SetUserAuthenticationMethodResponseContent( Optional preferredAuthenticationMethod, Optional keyId, Optional publicKey, + Optional aaguid, Optional relyingPartyIdentifier, Optional createdAt, Map additionalProperties) { @@ -73,6 +76,7 @@ private SetUserAuthenticationMethodResponseContent( this.preferredAuthenticationMethod = preferredAuthenticationMethod; this.keyId = keyId; this.publicKey = publicKey; + this.aaguid = aaguid; this.relyingPartyIdentifier = relyingPartyIdentifier; this.createdAt = createdAt; this.additionalProperties = additionalProperties; @@ -149,6 +153,14 @@ public Optional getPublicKey() { return publicKey; } + /** + * @return Applies to passkeys only. Authenticator Attestation Globally Unique Identifier. + */ + @JsonProperty("aaguid") + public Optional getAaguid() { + return aaguid; + } + /** * @return Applies to webauthn authenticators only. The relying party identifier. */ @@ -165,7 +177,7 @@ public Optional getCreatedAt() { return createdAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetUserAuthenticationMethodResponseContent @@ -188,11 +200,12 @@ private boolean equalTo(SetUserAuthenticationMethodResponseContent other) { && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) && keyId.equals(other.keyId) && publicKey.equals(other.publicKey) + && aaguid.equals(other.aaguid) && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) && createdAt.equals(other.createdAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -205,11 +218,12 @@ public int hashCode() { this.preferredAuthenticationMethod, this.keyId, this.publicKey, + this.aaguid, this.relyingPartyIdentifier, this.createdAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -285,6 +299,13 @@ _FinalStage preferredAuthenticationMethod( _FinalStage publicKey(String publicKey); + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ */ + _FinalStage aaguid(Optional aaguid); + + _FinalStage aaguid(String aaguid); + /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ @@ -308,6 +329,8 @@ public static final class Builder implements TypeStage, _FinalStage { private Optional relyingPartyIdentifier = Optional.empty(); + private Optional aaguid = Optional.empty(); + private Optional publicKey = Optional.empty(); private Optional keyId = Optional.empty(); @@ -331,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -343,12 +366,13 @@ public Builder from(SetUserAuthenticationMethodResponseContent other) { preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); keyId(other.getKeyId()); publicKey(other.getPublicKey()); + aaguid(other.getAaguid()); relyingPartyIdentifier(other.getRelyingPartyIdentifier()); createdAt(other.getCreatedAt()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -359,7 +383,7 @@ public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -368,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -379,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authenticators only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -388,18 +412,38 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ - @java.lang.Override + @Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; return this; } + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage aaguid(String aaguid) { + this.aaguid = Optional.ofNullable(aaguid); + return this; + } + + /** + *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

+ */ + @Override + @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) + public _FinalStage aaguid(Optional aaguid) { + this.aaguid = aaguid; + return this; + } + /** *

Applies to webauthn authenticators only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -408,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authenticators only. The public key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -419,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authenticators only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -428,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authenticators only. The id of the credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -450,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -468,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -477,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -488,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -497,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -508,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -517,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @java.lang.Override + @Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -528,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -537,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -548,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -557,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public SetUserAuthenticationMethodResponseContent build() { return new SetUserAuthenticationMethodResponseContent( id, @@ -577,6 +621,7 @@ public SetUserAuthenticationMethodResponseContent build() { preferredAuthenticationMethod, keyId, publicKey, + aaguid, relyingPartyIdentifier, createdAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java index a070ffc99..8e2f97ead 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java @@ -94,7 +94,7 @@ public Optional getTotpSecret() { return totpSecret; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetUserAuthenticationMethods && equalTo((SetUserAuthenticationMethods) other); @@ -114,7 +114,7 @@ private boolean equalTo(SetUserAuthenticationMethods other) { && totpSecret.equals(other.totpSecret); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.type, @@ -125,7 +125,7 @@ public int hashCode() { this.totpSecret); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -196,7 +196,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(SetUserAuthenticationMethods other) { type(other.getType()); preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); @@ -207,7 +207,7 @@ public Builder from(SetUserAuthenticationMethods other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull AuthenticationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -218,7 +218,7 @@ public _FinalStage type(@NotNull AuthenticationTypeEnum type) { *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -227,7 +227,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -238,7 +238,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -247,7 +247,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -258,7 +258,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -267,7 +267,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -278,7 +278,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

AA human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -287,21 +287,21 @@ public _FinalStage name(String name) { /** *

AA human-readable label to identify the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -309,7 +309,7 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public SetUserAuthenticationMethods build() { return new SetUserAuthenticationMethods( type, preferredAuthenticationMethod, name, phoneNumber, email, totpSecret, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java index 4b9b95a98..816688d5f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java @@ -28,19 +28,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SigningAlgorithmEnum && this.string.equals(((SigningAlgorithmEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java index 657e7445a..b509ceed8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java @@ -163,7 +163,7 @@ public Optional getRevokedAt() { return revokedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SigningKeys && equalTo((SigningKeys) other); @@ -189,7 +189,7 @@ private boolean equalTo(SigningKeys other) { && revokedAt.equals(other.revokedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.kid, @@ -206,7 +206,7 @@ public int hashCode() { this.revokedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -327,7 +327,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @java.lang.Override + @Override public Builder from(SigningKeys other) { kid(other.getKid()); cert(other.getCert()); @@ -349,7 +349,7 @@ public Builder from(SigningKeys other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -361,7 +361,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -373,7 +373,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -385,20 +385,20 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage revokedAt(SigningKeysDate revokedAt) { this.revokedAt = Optional.ofNullable(revokedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) public _FinalStage revokedAt(Optional revokedAt) { this.revokedAt = revokedAt; @@ -409,7 +409,7 @@ public _FinalStage revokedAt(Optional revokedAt) { *

True if the key is revoked

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage revoked(Boolean revoked) { this.revoked = Optional.ofNullable(revoked); return this; @@ -418,33 +418,33 @@ public _FinalStage revoked(Boolean revoked) { /** *

True if the key is revoked

*/ - @java.lang.Override + @Override @JsonSetter(value = "revoked", nulls = Nulls.SKIP) public _FinalStage revoked(Optional revoked) { this.revoked = revoked; return this; } - @java.lang.Override + @Override public _FinalStage currentUntil(SigningKeysDate currentUntil) { this.currentUntil = Optional.ofNullable(currentUntil); return this; } - @java.lang.Override + @Override @JsonSetter(value = "current_until", nulls = Nulls.SKIP) public _FinalStage currentUntil(Optional currentUntil) { this.currentUntil = currentUntil; return this; } - @java.lang.Override + @Override public _FinalStage currentSince(SigningKeysDate currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; } - @java.lang.Override + @Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -455,7 +455,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -464,7 +464,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @java.lang.Override + @Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -475,7 +475,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -484,7 +484,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @java.lang.Override + @Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -495,7 +495,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -504,7 +504,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @java.lang.Override + @Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -515,7 +515,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage pkcs7(String pkcs7) { this.pkcs7 = Optional.ofNullable(pkcs7); return this; @@ -524,14 +524,14 @@ public _FinalStage pkcs7(String pkcs7) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) public _FinalStage pkcs7(Optional pkcs7) { this.pkcs7 = pkcs7; return this; } - @java.lang.Override + @Override public SigningKeys build() { return new SigningKeys( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java index 2e7dab279..8bef1fc2e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SigningKeysDate && equalTo((SigningKeysDate) other); @@ -51,12 +51,12 @@ private boolean equalTo(SigningKeysDate other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(SigningKeysDate.class); } - @java.lang.Override + @Override public SigningKeysDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java index 1046a9079..e79406c1b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java @@ -34,7 +34,7 @@ public Optional getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupSchema && equalTo((SignupSchema) other); @@ -49,12 +49,12 @@ private boolean equalTo(SignupSchema other) { return status.equals(other.status); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java index cb5d82bd1..16b8ee9db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SignupStatusEnum && this.string.equals(((SignupStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java index 8201e8d66..ed894f534 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java @@ -34,7 +34,7 @@ public Optional getActive() { return active; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupVerification && equalTo((SignupVerification) other); @@ -49,12 +49,12 @@ private boolean equalTo(SignupVerification other) { return active.equals(other.active); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.active); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java index b4ea5c8be..fae247f35 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java @@ -45,7 +45,7 @@ public Optional getVerification() { return verification; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupVerified && equalTo((SignupVerified) other); @@ -60,12 +60,12 @@ private boolean equalTo(SignupVerified other) { return status.equals(other.status) && verification.equals(other.verification); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.status, this.verification); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java index 506db0d55..b6977f587 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java +++ b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java @@ -182,19 +182,19 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SupportedLocales && this.string.equals(((SupportedLocales) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java index bdadd4d67..148037cad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java @@ -49,7 +49,7 @@ public Optional getRate() { return rate; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingPreLoginStage @@ -65,12 +65,12 @@ private boolean equalTo(SuspiciousIpThrottlingPreLoginStage other) { return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.maxAttempts, this.rate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java index 255f2881b..2ae758162 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java @@ -49,7 +49,7 @@ public Optional getRate() { return rate; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingPreUserRegistrationStage @@ -65,12 +65,12 @@ private boolean equalTo(SuspiciousIpThrottlingPreUserRegistrationStage other) { return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.maxAttempts, this.rate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java index 00f6b5ade..10e36bfae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof SuspiciousIpThrottlingShieldsEnum && this.string.equals(((SuspiciousIpThrottlingShieldsEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java index 9aeba1e60..40875643a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java @@ -45,7 +45,7 @@ public Optional getPreUserRegist return preUserRegistration; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingStage && equalTo((SuspiciousIpThrottlingStage) other); @@ -60,12 +60,12 @@ private boolean equalTo(SuspiciousIpThrottlingStage other) { return preLogin.equals(other.preLogin) && preUserRegistration.equals(other.preUserRegistration); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.preLogin, this.preUserRegistration); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java index 5439ecd61..edc674df7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java @@ -38,7 +38,7 @@ public Optional getRpLogoutEndSessionEndpointDiscovery() { return rpLogoutEndSessionEndpointDiscovery; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantOidcLogoutSettings && equalTo((TenantOidcLogoutSettings) other); @@ -53,12 +53,12 @@ private boolean equalTo(TenantOidcLogoutSettings other) { return rpLogoutEndSessionEndpointDiscovery.equals(other.rpLogoutEndSessionEndpointDiscovery); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.rpLogoutEndSessionEndpointDiscovery); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java index 2aaf54480..ef8520b0b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java @@ -48,7 +48,7 @@ public Optional getMask() { return mask; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsDeviceFlow && equalTo((TenantSettingsDeviceFlow) other); @@ -63,12 +63,12 @@ private boolean equalTo(TenantSettingsDeviceFlow other) { return charset.equals(other.charset) && mask.equals(other.mask); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.charset, this.mask); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java index deafec3a2..cf9752b21 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof TenantSettingsDeviceFlowCharset && this.string.equals(((TenantSettingsDeviceFlowCharset) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java index 906837dc1..cde1353e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java @@ -63,7 +63,7 @@ public Optional getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsErrorPage && equalTo((TenantSettingsErrorPage) other); @@ -78,12 +78,12 @@ private boolean equalTo(TenantSettingsErrorPage other) { return html.equals(other.html) && showLogLink.equals(other.showLogLink) && url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.html, this.showLogLink, this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java index 29fb8040c..fb6e72db9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java @@ -375,7 +375,7 @@ public Optional getCustomDomainsProvisioning() { return customDomainsProvisioning; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsFlags && equalTo((TenantSettingsFlags) other); @@ -420,7 +420,7 @@ private boolean equalTo(TenantSettingsFlags other) { && customDomainsProvisioning.equals(other.customDomainsProvisioning); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.changePwdFlowV1, @@ -454,7 +454,7 @@ public int hashCode() { this.customDomainsProvisioning); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java index 7b6af4a8c..949b2d4f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java @@ -49,7 +49,7 @@ public Optional getHtml() { return html; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsGuardianPage && equalTo((TenantSettingsGuardianPage) other); @@ -64,12 +64,12 @@ private boolean equalTo(TenantSettingsGuardianPage other) { return enabled.equals(other.enabled) && html.equals(other.html); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.html); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java index 4fce8b382..49e023327 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java @@ -37,7 +37,7 @@ public Optional getEnableEndpointAliases() { return enableEndpointAliases; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsMtls && equalTo((TenantSettingsMtls) other); @@ -52,12 +52,12 @@ private boolean equalTo(TenantSettingsMtls other) { return enableEndpointAliases.equals(other.enableEndpointAliases); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enableEndpointAliases); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java index 3d254ec4b..02b7fdb8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java @@ -49,7 +49,7 @@ public Optional getHtml() { return html; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsPasswordPage && equalTo((TenantSettingsPasswordPage) other); @@ -64,12 +64,12 @@ private boolean equalTo(TenantSettingsPasswordPage other) { return enabled.equals(other.enabled) && html.equals(other.html); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.html); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java new file mode 100644 index 000000000..522b5f701 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TenantSettingsResourceParameterProfile { + public static final TenantSettingsResourceParameterProfile AUDIENCE = + new TenantSettingsResourceParameterProfile(Value.AUDIENCE, "audience"); + + public static final TenantSettingsResourceParameterProfile COMPATIBILITY = + new TenantSettingsResourceParameterProfile(Value.COMPATIBILITY, "compatibility"); + + private final Value value; + + private final String string; + + TenantSettingsResourceParameterProfile(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TenantSettingsResourceParameterProfile + && this.string.equals(((TenantSettingsResourceParameterProfile) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUDIENCE: + return visitor.visitAudience(); + case COMPATIBILITY: + return visitor.visitCompatibility(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TenantSettingsResourceParameterProfile valueOf(String value) { + switch (value) { + case "audience": + return AUDIENCE; + case "compatibility": + return COMPATIBILITY; + default: + return new TenantSettingsResourceParameterProfile(Value.UNKNOWN, value); + } + } + + public enum Value { + AUDIENCE, + + COMPATIBILITY, + + UNKNOWN + } + + public interface Visitor { + T visitAudience(); + + T visitCompatibility(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java index ae2da26d0..b91aa8ae5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java @@ -38,7 +38,7 @@ public Optional getOidcLogoutPromptEnabled() { return oidcLogoutPromptEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsSessions && equalTo((TenantSettingsSessions) other); @@ -53,12 +53,12 @@ private boolean equalTo(TenantSettingsSessions other) { return oidcLogoutPromptEnabled.equals(other.oidcLogoutPromptEnabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.oidcLogoutPromptEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java index b6ffac639..b56b51567 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java @@ -34,7 +34,7 @@ public Map getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestActionRequestContent && equalTo((TestActionRequestContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(TestActionRequestContent other) { return payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java index d7f2a85a8..c81712679 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java @@ -34,7 +34,7 @@ public Optional> getPayload() { return payload; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestActionResponseContent && equalTo((TestActionResponseContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(TestActionResponseContent other) { return payload.equals(other.payload); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.payload); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java index 9393013df..4df4af531 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java @@ -49,7 +49,7 @@ public Optional getMessage() { return message; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestCustomDomainResponseContent && equalTo((TestCustomDomainResponseContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(TestCustomDomainResponseContent other) { return success == other.success && message.equals(other.message); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.success, this.message); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements SuccessStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(TestCustomDomainResponseContent other) { success(other.getSuccess()); message(other.getMessage()); @@ -121,7 +121,7 @@ public Builder from(TestCustomDomainResponseContent other) { *

Result of the operation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("success") public _FinalStage success(boolean success) { this.success = success; @@ -132,7 +132,7 @@ public _FinalStage success(boolean success) { *

Message describing the operation status.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage message(String message) { this.message = Optional.ofNullable(message); return this; @@ -141,14 +141,14 @@ public _FinalStage message(String message) { /** *

Message describing the operation status.

*/ - @java.lang.Override + @Override @JsonSetter(value = "message", nulls = Nulls.SKIP) public _FinalStage message(Optional message) { this.message = message; return this; } - @java.lang.Override + @Override public TestCustomDomainResponseContent build() { return new TestCustomDomainResponseContent(success, message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java index 09dd38ab9..acf594801 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(TokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java index 7d9471003..5925a043c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenExchangeProfilesListRequest && equalTo((TokenExchangeProfilesListRequest) other); @@ -78,12 +78,12 @@ private boolean equalTo(TokenExchangeProfilesListRequest other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java index d7cf28e47..3d61f0be6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuota && equalTo((TokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(TokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(TokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @java.lang.Override + @Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @java.lang.Override + @Override public TokenQuota build() { return new TokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java index 920f2889b..c8685d2f9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java @@ -63,7 +63,7 @@ public Optional getPerHour() { return perHour; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuotaClientCredentials && equalTo((TokenQuotaClientCredentials) other); @@ -78,12 +78,12 @@ private boolean equalTo(TokenQuotaClientCredentials other) { return enforce.equals(other.enforce) && perDay.equals(other.perDay) && perHour.equals(other.perHour); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enforce, this.perDay, this.perHour); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java index d343e5b82..b40f8de9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java @@ -34,7 +34,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuotaConfiguration && equalTo((TokenQuotaConfiguration) other); @@ -49,12 +49,12 @@ private boolean equalTo(TokenQuotaConfiguration other) { return clientCredentials.equals(other.clientCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(TokenQuotaConfiguration other) { clientCredentials(other.getClientCredentials()); return this; } - @java.lang.Override + @Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @java.lang.Override + @Override public TokenQuotaConfiguration build() { return new TokenQuotaConfiguration(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java index 8468c49e4..06533f643 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java @@ -66,7 +66,7 @@ public List getDeliveryMethods() { return deliveryMethods; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TwilioProviderConfiguration && equalTo((TwilioProviderConfiguration) other); @@ -84,12 +84,12 @@ private boolean equalTo(TwilioProviderConfiguration other) { && deliveryMethods.equals(other.deliveryMethods); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.defaultFrom, this.mssid, this.sid, this.deliveryMethods); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -137,7 +137,7 @@ public static final class Builder implements SidStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(TwilioProviderConfiguration other) { defaultFrom(other.getDefaultFrom()); mssid(other.getMssid()); @@ -146,14 +146,14 @@ public Builder from(TwilioProviderConfiguration other) { return this; } - @java.lang.Override + @Override @JsonSetter("sid") public _FinalStage sid(@NotNull String sid) { this.sid = Objects.requireNonNull(sid, "sid must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage addAllDeliveryMethods(List deliveryMethods) { if (deliveryMethods != null) { this.deliveryMethods.addAll(deliveryMethods); @@ -161,13 +161,13 @@ public _FinalStage addAllDeliveryMethods(List return this; } - @java.lang.Override + @Override public _FinalStage addDeliveryMethods(TwilioProviderDeliveryMethodEnum deliveryMethods) { this.deliveryMethods.add(deliveryMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "delivery_methods", nulls = Nulls.SKIP) public _FinalStage deliveryMethods(List deliveryMethods) { this.deliveryMethods.clear(); @@ -177,33 +177,33 @@ public _FinalStage deliveryMethods(List delive return this; } - @java.lang.Override + @Override public _FinalStage mssid(String mssid) { this.mssid = Optional.ofNullable(mssid); return this; } - @java.lang.Override + @Override @JsonSetter(value = "mssid", nulls = Nulls.SKIP) public _FinalStage mssid(Optional mssid) { this.mssid = mssid; return this; } - @java.lang.Override + @Override public _FinalStage defaultFrom(String defaultFrom) { this.defaultFrom = Optional.ofNullable(defaultFrom); return this; } - @java.lang.Override + @Override @JsonSetter(value = "default_from", nulls = Nulls.SKIP) public _FinalStage defaultFrom(Optional defaultFrom) { this.defaultFrom = defaultFrom; return this; } - @java.lang.Override + @Override public TwilioProviderConfiguration build() { return new TwilioProviderConfiguration(defaultFrom, mssid, sid, deliveryMethods, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java index 195d73745..cc249a26e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java @@ -33,7 +33,7 @@ public String getAuthToken() { return authToken; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TwilioProviderCredentials && equalTo((TwilioProviderCredentials) other); @@ -48,12 +48,12 @@ private boolean equalTo(TwilioProviderCredentials other) { return authToken.equals(other.authToken); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.authToken); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements AuthTokenStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(TwilioProviderCredentials other) { authToken(other.getAuthToken()); return this; } - @java.lang.Override + @Override @JsonSetter("auth_token") public _FinalStage authToken(@NotNull String authToken) { this.authToken = Objects.requireNonNull(authToken, "authToken must not be null"); return this; } - @java.lang.Override + @Override public TwilioProviderCredentials build() { return new TwilioProviderCredentials(authToken, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java index dc8c8aae6..81e391983 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof TwilioProviderDeliveryMethodEnum && this.string.equals(((TwilioProviderDeliveryMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java index bd6f45f36..72f617e51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UniversalLoginExperienceEnum && this.string.equals(((UniversalLoginExperienceEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java index d8d2c5e92..6874ed0eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java @@ -36,7 +36,7 @@ public Optional> getBindings() { return bindings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionBindingsResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(UpdateActionBindingsResponseContent other) { return bindings.equals(other.bindings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.bindings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java index 228ad6884..d0e163d10 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java @@ -85,7 +85,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -100,7 +100,7 @@ public Optional> getSecrets() { return secrets; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionRequestContent && equalTo((UpdateActionRequestContent) other); @@ -120,13 +120,13 @@ private boolean equalTo(UpdateActionRequestContent other) { && secrets.equals(other.secrets); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.supportedTriggers, this.code, this.dependencies, this.runtime, this.secrets); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -221,7 +221,7 @@ public Builder dependencies(List dependencies) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java index 63661a0ac..281ed308a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java @@ -158,7 +158,7 @@ public Optional> getDependencies() { } /** - * @return The Node runtime. For example: node12, defaults to node12 + * @return The Node runtime. For example: node22, defaults to node22 */ @JsonProperty("runtime") public Optional getRuntime() { @@ -212,7 +212,7 @@ public Optional getDeploy() { return deploy; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionResponseContent && equalTo((UpdateActionResponseContent) other); @@ -242,7 +242,7 @@ private boolean equalTo(UpdateActionResponseContent other) { && deploy.equals(other.deploy); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -263,7 +263,7 @@ public int hashCode() { this.deploy); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -444,7 +444,7 @@ public Builder dependencies(List dependencies) { } /** - *

The Node runtime. For example: node12, defaults to node12

+ *

The Node runtime. For example: node22, defaults to node22

*/ @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public Builder runtime(Optional runtime) { diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java index ca10bac1c..729ee52fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java @@ -30,28 +30,28 @@ public final class UpdateAculResponseContent { private final OptionalNullable defaultHeadTagsDisabled; + private final OptionalNullable usePageTemplate; + private final Optional> headTags; private final OptionalNullable filters; - private final OptionalNullable usePageTemplate; - private final Map additionalProperties; private UpdateAculResponseContent( Optional renderingMode, Optional> contextConfiguration, OptionalNullable defaultHeadTagsDisabled, + OptionalNullable usePageTemplate, Optional> headTags, OptionalNullable filters, - OptionalNullable usePageTemplate, Map additionalProperties) { this.renderingMode = renderingMode; this.contextConfiguration = contextConfiguration; this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; + this.usePageTemplate = usePageTemplate; this.headTags = headTags; this.filters = filters; - this.usePageTemplate = usePageTemplate; this.additionalProperties = additionalProperties; } @@ -80,6 +80,18 @@ public OptionalNullable getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } + /** + * @return Use page template with ACUL + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("use_page_template") + public OptionalNullable getUsePageTemplate() { + if (usePageTemplate == null) { + return OptionalNullable.absent(); + } + return usePageTemplate; + } + /** * @return An array of head tags */ @@ -97,37 +109,25 @@ public OptionalNullable getFilters() { return filters; } - /** - * @return Use page template with ACUL - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_page_template") - public OptionalNullable getUsePageTemplate() { - if (usePageTemplate == null) { - return OptionalNullable.absent(); - } - return usePageTemplate; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("default_head_tags_disabled") private OptionalNullable _getDefaultHeadTagsDisabled() { return defaultHeadTagsDisabled; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("filters") - private OptionalNullable _getFilters() { - return filters; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("use_page_template") private OptionalNullable _getUsePageTemplate() { return usePageTemplate; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("filters") + private OptionalNullable _getFilters() { + return filters; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAculResponseContent && equalTo((UpdateAculResponseContent) other); @@ -142,23 +142,23 @@ private boolean equalTo(UpdateAculResponseContent other) { return renderingMode.equals(other.renderingMode) && contextConfiguration.equals(other.contextConfiguration) && defaultHeadTagsDisabled.equals(other.defaultHeadTagsDisabled) + && usePageTemplate.equals(other.usePageTemplate) && headTags.equals(other.headTags) - && filters.equals(other.filters) - && usePageTemplate.equals(other.usePageTemplate); + && filters.equals(other.filters); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.renderingMode, this.contextConfiguration, this.defaultHeadTagsDisabled, + this.usePageTemplate, this.headTags, - this.filters, - this.usePageTemplate); + this.filters); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -175,12 +175,12 @@ public static final class Builder { private OptionalNullable defaultHeadTagsDisabled = OptionalNullable.absent(); + private OptionalNullable usePageTemplate = OptionalNullable.absent(); + private Optional> headTags = Optional.empty(); private OptionalNullable filters = OptionalNullable.absent(); - private OptionalNullable usePageTemplate = OptionalNullable.absent(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -190,9 +190,9 @@ public Builder from(UpdateAculResponseContent other) { renderingMode(other.getRenderingMode()); contextConfiguration(other.getContextConfiguration()); defaultHeadTagsDisabled(other.getDefaultHeadTagsDisabled()); + usePageTemplate(other.getUsePageTemplate()); headTags(other.getHeadTags()); filters(other.getFilters()); - usePageTemplate(other.getUsePageTemplate()); return this; } @@ -255,6 +255,40 @@ public Builder defaultHeadTagsDisabled(com.auth0.client.mgmt.core.NullableUse page template with ACUL

+ */ + @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) + public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { + this.usePageTemplate = usePageTemplate; + return this; + } + + public Builder usePageTemplate(Boolean usePageTemplate) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate); + return this; + } + + public Builder usePageTemplate(Optional usePageTemplate) { + if (usePageTemplate.isPresent()) { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } else { + this.usePageTemplate = OptionalNullable.absent(); + } + return this; + } + + public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { + if (usePageTemplate.isNull()) { + this.usePageTemplate = OptionalNullable.ofNull(); + } else if (usePageTemplate.isEmpty()) { + this.usePageTemplate = OptionalNullable.absent(); + } else { + this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); + } + return this; + } + /** *

An array of head tags

*/ @@ -300,48 +334,14 @@ public Builder filters(com.auth0.client.mgmt.core.Nullable filters) return this; } - /** - *

Use page template with ACUL

- */ - @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) - public Builder usePageTemplate(@Nullable OptionalNullable usePageTemplate) { - this.usePageTemplate = usePageTemplate; - return this; - } - - public Builder usePageTemplate(Boolean usePageTemplate) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate); - return this; - } - - public Builder usePageTemplate(Optional usePageTemplate) { - if (usePageTemplate.isPresent()) { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } else { - this.usePageTemplate = OptionalNullable.absent(); - } - return this; - } - - public Builder usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { - if (usePageTemplate.isNull()) { - this.usePageTemplate = OptionalNullable.ofNull(); - } else if (usePageTemplate.isEmpty()) { - this.usePageTemplate = OptionalNullable.absent(); - } else { - this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); - } - return this; - } - public UpdateAculResponseContent build() { return new UpdateAculResponseContent( renderingMode, contextConfiguration, defaultHeadTagsDisabled, + usePageTemplate, headTags, filters, - usePageTemplate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java new file mode 100644 index 000000000..a45c8d652 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAttackProtectionCaptchaResponseContent.Builder.class) +public final class UpdateAttackProtectionCaptchaResponseContent { + private final Optional activeProviderId; + + private final Optional arkose; + + private final Optional authChallenge; + + private final Optional hcaptcha; + + private final Optional friendlyCaptcha; + + private final Optional recaptchaEnterprise; + + private final Optional recaptchaV2; + + private final Optional> simpleCaptcha; + + private final Map additionalProperties; + + private UpdateAttackProtectionCaptchaResponseContent( + Optional activeProviderId, + Optional arkose, + Optional authChallenge, + Optional hcaptcha, + Optional friendlyCaptcha, + Optional recaptchaEnterprise, + Optional recaptchaV2, + Optional> simpleCaptcha, + Map additionalProperties) { + this.activeProviderId = activeProviderId; + this.arkose = arkose; + this.authChallenge = authChallenge; + this.hcaptcha = hcaptcha; + this.friendlyCaptcha = friendlyCaptcha; + this.recaptchaEnterprise = recaptchaEnterprise; + this.recaptchaV2 = recaptchaV2; + this.simpleCaptcha = simpleCaptcha; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("active_provider_id") + public Optional getActiveProviderId() { + return activeProviderId; + } + + @JsonProperty("arkose") + public Optional getArkose() { + return arkose; + } + + @JsonProperty("auth_challenge") + public Optional getAuthChallenge() { + return authChallenge; + } + + @JsonProperty("hcaptcha") + public Optional getHcaptcha() { + return hcaptcha; + } + + @JsonProperty("friendly_captcha") + public Optional getFriendlyCaptcha() { + return friendlyCaptcha; + } + + @JsonProperty("recaptcha_enterprise") + public Optional getRecaptchaEnterprise() { + return recaptchaEnterprise; + } + + @JsonProperty("recaptcha_v2") + public Optional getRecaptchaV2() { + return recaptchaV2; + } + + @JsonProperty("simple_captcha") + public Optional> getSimpleCaptcha() { + return simpleCaptcha; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAttackProtectionCaptchaResponseContent + && equalTo((UpdateAttackProtectionCaptchaResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAttackProtectionCaptchaResponseContent other) { + return activeProviderId.equals(other.activeProviderId) + && arkose.equals(other.arkose) + && authChallenge.equals(other.authChallenge) + && hcaptcha.equals(other.hcaptcha) + && friendlyCaptcha.equals(other.friendlyCaptcha) + && recaptchaEnterprise.equals(other.recaptchaEnterprise) + && recaptchaV2.equals(other.recaptchaV2) + && simpleCaptcha.equals(other.simpleCaptcha); + } + + @Override + public int hashCode() { + return Objects.hash( + this.activeProviderId, + this.arkose, + this.authChallenge, + this.hcaptcha, + this.friendlyCaptcha, + this.recaptchaEnterprise, + this.recaptchaV2, + this.simpleCaptcha); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional activeProviderId = Optional.empty(); + + private Optional arkose = Optional.empty(); + + private Optional authChallenge = Optional.empty(); + + private Optional hcaptcha = Optional.empty(); + + private Optional friendlyCaptcha = Optional.empty(); + + private Optional recaptchaEnterprise = + Optional.empty(); + + private Optional recaptchaV2 = Optional.empty(); + + private Optional> simpleCaptcha = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateAttackProtectionCaptchaResponseContent other) { + activeProviderId(other.getActiveProviderId()); + arkose(other.getArkose()); + authChallenge(other.getAuthChallenge()); + hcaptcha(other.getHcaptcha()); + friendlyCaptcha(other.getFriendlyCaptcha()); + recaptchaEnterprise(other.getRecaptchaEnterprise()); + recaptchaV2(other.getRecaptchaV2()); + simpleCaptcha(other.getSimpleCaptcha()); + return this; + } + + @JsonSetter(value = "active_provider_id", nulls = Nulls.SKIP) + public Builder activeProviderId(Optional activeProviderId) { + this.activeProviderId = activeProviderId; + return this; + } + + public Builder activeProviderId(String activeProviderId) { + this.activeProviderId = Optional.ofNullable(activeProviderId); + return this; + } + + @JsonSetter(value = "arkose", nulls = Nulls.SKIP) + public Builder arkose(Optional arkose) { + this.arkose = arkose; + return this; + } + + public Builder arkose(AttackProtectionCaptchaArkoseResponseContent arkose) { + this.arkose = Optional.ofNullable(arkose); + return this; + } + + @JsonSetter(value = "auth_challenge", nulls = Nulls.SKIP) + public Builder authChallenge(Optional authChallenge) { + this.authChallenge = authChallenge; + return this; + } + + public Builder authChallenge(AttackProtectionCaptchaAuthChallengeResponseContent authChallenge) { + this.authChallenge = Optional.ofNullable(authChallenge); + return this; + } + + @JsonSetter(value = "hcaptcha", nulls = Nulls.SKIP) + public Builder hcaptcha(Optional hcaptcha) { + this.hcaptcha = hcaptcha; + return this; + } + + public Builder hcaptcha(AttackProtectionCaptchaHcaptchaResponseContent hcaptcha) { + this.hcaptcha = Optional.ofNullable(hcaptcha); + return this; + } + + @JsonSetter(value = "friendly_captcha", nulls = Nulls.SKIP) + public Builder friendlyCaptcha( + Optional friendlyCaptcha) { + this.friendlyCaptcha = friendlyCaptcha; + return this; + } + + public Builder friendlyCaptcha(AttackProtectionCaptchaFriendlyCaptchaResponseContent friendlyCaptcha) { + this.friendlyCaptcha = Optional.ofNullable(friendlyCaptcha); + return this; + } + + @JsonSetter(value = "recaptcha_enterprise", nulls = Nulls.SKIP) + public Builder recaptchaEnterprise( + Optional recaptchaEnterprise) { + this.recaptchaEnterprise = recaptchaEnterprise; + return this; + } + + public Builder recaptchaEnterprise( + AttackProtectionCaptchaRecaptchaEnterpriseResponseContent recaptchaEnterprise) { + this.recaptchaEnterprise = Optional.ofNullable(recaptchaEnterprise); + return this; + } + + @JsonSetter(value = "recaptcha_v2", nulls = Nulls.SKIP) + public Builder recaptchaV2(Optional recaptchaV2) { + this.recaptchaV2 = recaptchaV2; + return this; + } + + public Builder recaptchaV2(AttackProtectionCaptchaRecaptchaV2ResponseContent recaptchaV2) { + this.recaptchaV2 = Optional.ofNullable(recaptchaV2); + return this; + } + + @JsonSetter(value = "simple_captcha", nulls = Nulls.SKIP) + public Builder simpleCaptcha(Optional> simpleCaptcha) { + this.simpleCaptcha = simpleCaptcha; + return this; + } + + public Builder simpleCaptcha(Map simpleCaptcha) { + this.simpleCaptcha = Optional.ofNullable(simpleCaptcha); + return this; + } + + public UpdateAttackProtectionCaptchaResponseContent build() { + return new UpdateAttackProtectionCaptchaResponseContent( + activeProviderId, + arkose, + authChallenge, + hcaptcha, + friendlyCaptcha, + recaptchaEnterprise, + recaptchaV2, + simpleCaptcha, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java new file mode 100644 index 000000000..2c1e71b3e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateBotDetectionSettingsResponseContent.Builder.class) +public final class UpdateBotDetectionSettingsResponseContent { + private final Optional botDetectionLevel; + + private final Optional challengePasswordPolicy; + + private final Optional challengePasswordlessPolicy; + + private final Optional challengePasswordResetPolicy; + + private final Optional> allowlist; + + private final Optional monitoringModeEnabled; + + private final Map additionalProperties; + + private UpdateBotDetectionSettingsResponseContent( + Optional botDetectionLevel, + Optional challengePasswordPolicy, + Optional challengePasswordlessPolicy, + Optional challengePasswordResetPolicy, + Optional> allowlist, + Optional monitoringModeEnabled, + Map additionalProperties) { + this.botDetectionLevel = botDetectionLevel; + this.challengePasswordPolicy = challengePasswordPolicy; + this.challengePasswordlessPolicy = challengePasswordlessPolicy; + this.challengePasswordResetPolicy = challengePasswordResetPolicy; + this.allowlist = allowlist; + this.monitoringModeEnabled = monitoringModeEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("bot_detection_level") + public Optional getBotDetectionLevel() { + return botDetectionLevel; + } + + @JsonProperty("challenge_password_policy") + public Optional getChallengePasswordPolicy() { + return challengePasswordPolicy; + } + + @JsonProperty("challenge_passwordless_policy") + public Optional getChallengePasswordlessPolicy() { + return challengePasswordlessPolicy; + } + + @JsonProperty("challenge_password_reset_policy") + public Optional getChallengePasswordResetPolicy() { + return challengePasswordResetPolicy; + } + + @JsonProperty("allowlist") + public Optional> getAllowlist() { + return allowlist; + } + + @JsonProperty("monitoring_mode_enabled") + public Optional getMonitoringModeEnabled() { + return monitoringModeEnabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateBotDetectionSettingsResponseContent + && equalTo((UpdateBotDetectionSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateBotDetectionSettingsResponseContent other) { + return botDetectionLevel.equals(other.botDetectionLevel) + && challengePasswordPolicy.equals(other.challengePasswordPolicy) + && challengePasswordlessPolicy.equals(other.challengePasswordlessPolicy) + && challengePasswordResetPolicy.equals(other.challengePasswordResetPolicy) + && allowlist.equals(other.allowlist) + && monitoringModeEnabled.equals(other.monitoringModeEnabled); + } + + @Override + public int hashCode() { + return Objects.hash( + this.botDetectionLevel, + this.challengePasswordPolicy, + this.challengePasswordlessPolicy, + this.challengePasswordResetPolicy, + this.allowlist, + this.monitoringModeEnabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional botDetectionLevel = Optional.empty(); + + private Optional challengePasswordPolicy = Optional.empty(); + + private Optional challengePasswordlessPolicy = + Optional.empty(); + + private Optional challengePasswordResetPolicy = + Optional.empty(); + + private Optional> allowlist = Optional.empty(); + + private Optional monitoringModeEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateBotDetectionSettingsResponseContent other) { + botDetectionLevel(other.getBotDetectionLevel()); + challengePasswordPolicy(other.getChallengePasswordPolicy()); + challengePasswordlessPolicy(other.getChallengePasswordlessPolicy()); + challengePasswordResetPolicy(other.getChallengePasswordResetPolicy()); + allowlist(other.getAllowlist()); + monitoringModeEnabled(other.getMonitoringModeEnabled()); + return this; + } + + @JsonSetter(value = "bot_detection_level", nulls = Nulls.SKIP) + public Builder botDetectionLevel(Optional botDetectionLevel) { + this.botDetectionLevel = botDetectionLevel; + return this; + } + + public Builder botDetectionLevel(BotDetectionLevelEnum botDetectionLevel) { + this.botDetectionLevel = Optional.ofNullable(botDetectionLevel); + return this; + } + + @JsonSetter(value = "challenge_password_policy", nulls = Nulls.SKIP) + public Builder challengePasswordPolicy( + Optional challengePasswordPolicy) { + this.challengePasswordPolicy = challengePasswordPolicy; + return this; + } + + public Builder challengePasswordPolicy(BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy) { + this.challengePasswordPolicy = Optional.ofNullable(challengePasswordPolicy); + return this; + } + + @JsonSetter(value = "challenge_passwordless_policy", nulls = Nulls.SKIP) + public Builder challengePasswordlessPolicy( + Optional challengePasswordlessPolicy) { + this.challengePasswordlessPolicy = challengePasswordlessPolicy; + return this; + } + + public Builder challengePasswordlessPolicy( + BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy) { + this.challengePasswordlessPolicy = Optional.ofNullable(challengePasswordlessPolicy); + return this; + } + + @JsonSetter(value = "challenge_password_reset_policy", nulls = Nulls.SKIP) + public Builder challengePasswordResetPolicy( + Optional challengePasswordResetPolicy) { + this.challengePasswordResetPolicy = challengePasswordResetPolicy; + return this; + } + + public Builder challengePasswordResetPolicy( + BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy) { + this.challengePasswordResetPolicy = Optional.ofNullable(challengePasswordResetPolicy); + return this; + } + + @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) + public Builder allowlist(Optional> allowlist) { + this.allowlist = allowlist; + return this; + } + + public Builder allowlist(List allowlist) { + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + @JsonSetter(value = "monitoring_mode_enabled", nulls = Nulls.SKIP) + public Builder monitoringModeEnabled(Optional monitoringModeEnabled) { + this.monitoringModeEnabled = monitoringModeEnabled; + return this; + } + + public Builder monitoringModeEnabled(Boolean monitoringModeEnabled) { + this.monitoringModeEnabled = Optional.ofNullable(monitoringModeEnabled); + return this; + } + + public UpdateBotDetectionSettingsResponseContent build() { + return new UpdateBotDetectionSettingsResponseContent( + botDetectionLevel, + challengePasswordPolicy, + challengePasswordlessPolicy, + challengePasswordResetPolicy, + allowlist, + monitoringModeEnabled, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java index a17710ac0..b6b2535cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java @@ -61,7 +61,7 @@ private OptionalNullable _getPrimary() { return primary; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingColors && equalTo((UpdateBrandingColors) other); @@ -76,12 +76,12 @@ private boolean equalTo(UpdateBrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java index 1da496328..41872c844 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java @@ -50,7 +50,7 @@ private OptionalNullable _getUrl() { return url; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingFont && equalTo((UpdateBrandingFont) other); @@ -65,12 +65,12 @@ private boolean equalTo(UpdateBrandingFont other) { return url.equals(other.url); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.url); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java index 849ba5b81..5057d9e05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPageBackground && equalTo((UpdateBrandingPageBackground) other); @@ -53,12 +53,12 @@ private boolean equalTo(UpdateBrandingPageBackground other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -83,7 +83,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(UpdateBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(UpdateBrandingPhoneProviderResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @java.lang.Override + @Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @java.lang.Override + @Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @java.lang.Override + @Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public UpdateBrandingPhoneProviderResponseContent build() { return new UpdateBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java index ad7fd7d62..9f6be984b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java @@ -112,7 +112,7 @@ private OptionalNullable _getFont() { return font; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingRequestContent && equalTo((UpdateBrandingRequestContent) other); @@ -130,12 +130,12 @@ private boolean equalTo(UpdateBrandingRequestContent other) { && font.equals(other.font); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java index f1a68fe24..c4796853f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java @@ -69,7 +69,7 @@ public Optional getFont() { return font; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingResponseContent && equalTo((UpdateBrandingResponseContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(UpdateBrandingResponseContent other) { && font.equals(other.font); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java index fe37d6c34..cb7d39733 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(UpdateBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(UpdateBrandingThemeResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @java.lang.Override + @Override public UpdateBrandingThemeResponseContent build() { return new UpdateBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java index 056a6b7d4..764139125 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java @@ -84,7 +84,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBreachedPasswordDetectionSettingsResponseContent @@ -104,12 +104,12 @@ private boolean equalTo(UpdateBreachedPasswordDetectionSettingsResponseContent o && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java index f8277dcfb..d414938f5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBruteForceSettingsResponseContent @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBruteForceSettingsResponseContent other) { && maxAttempts.equals(other.maxAttempts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java index bc1c4f841..73d7ade5b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsResponseContentMode && this.string.equals(((UpdateBruteForceSettingsResponseContentMode) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java index 3780c4514..cff18ef6c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsResponseContentShieldsItem && this.string.equals(((UpdateBruteForceSettingsResponseContentShieldsItem) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java index e630d129f..4e3da5eed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java @@ -30,16 +30,20 @@ public final class UpdateClientGrantRequestContent { private final OptionalNullable allowAnyOrganization; + private final Optional> authorizationDetailsTypes; + private final Map additionalProperties; private UpdateClientGrantRequestContent( Optional> scope, OptionalNullable organizationUsage, OptionalNullable allowAnyOrganization, + Optional> authorizationDetailsTypes, Map additionalProperties) { this.scope = scope; this.organizationUsage = organizationUsage; this.allowAnyOrganization = allowAnyOrganization; + this.authorizationDetailsTypes = authorizationDetailsTypes; this.additionalProperties = additionalProperties; } @@ -72,6 +76,14 @@ public OptionalNullable getAllowAnyOrganization() { return allowAnyOrganization; } + /** + * @return Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonProperty("authorization_details_types") + public Optional> getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("organization_usage") private OptionalNullable _getOrganizationUsage() { @@ -84,7 +96,7 @@ private OptionalNullable _getAllowAnyOrganization() { return allowAnyOrganization; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientGrantRequestContent && equalTo((UpdateClientGrantRequestContent) other); @@ -98,15 +110,17 @@ public Map getAdditionalProperties() { private boolean equalTo(UpdateClientGrantRequestContent other) { return scope.equals(other.scope) && organizationUsage.equals(other.organizationUsage) - && allowAnyOrganization.equals(other.allowAnyOrganization); + && allowAnyOrganization.equals(other.allowAnyOrganization) + && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.scope, this.organizationUsage, this.allowAnyOrganization); + return Objects.hash( + this.scope, this.organizationUsage, this.allowAnyOrganization, this.authorizationDetailsTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -124,6 +138,8 @@ public static final class Builder { private OptionalNullable allowAnyOrganization = OptionalNullable.absent(); + private Optional> authorizationDetailsTypes = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -133,6 +149,7 @@ public Builder from(UpdateClientGrantRequestContent other) { scope(other.getScope()); organizationUsage(other.getOrganizationUsage()); allowAnyOrganization(other.getAllowAnyOrganization()); + authorizationDetailsTypes(other.getAuthorizationDetailsTypes()); return this; } @@ -217,9 +234,23 @@ public Builder allowAnyOrganization(com.auth0.client.mgmt.core.Nullable return this; } + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) + public Builder authorizationDetailsTypes(Optional> authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + public Builder authorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); + return this; + } + public UpdateClientGrantRequestContent build() { return new UpdateClientGrantRequestContent( - scope, organizationUsage, allowAnyOrganization, additionalProperties); + scope, organizationUsage, allowAnyOrganization, authorizationDetailsTypes, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java index 375538c5f..f52eba4f9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java @@ -35,6 +35,10 @@ public final class UpdateClientGrantResponseContent { private final Optional isSystem; + private final Optional subjectType; + + private final Optional> authorizationDetailsTypes; + private final Map additionalProperties; private UpdateClientGrantResponseContent( @@ -45,6 +49,8 @@ private UpdateClientGrantResponseContent( Optional organizationUsage, Optional allowAnyOrganization, Optional isSystem, + Optional subjectType, + Optional> authorizationDetailsTypes, Map additionalProperties) { this.id = id; this.clientId = clientId; @@ -53,6 +59,8 @@ private UpdateClientGrantResponseContent( this.organizationUsage = organizationUsage; this.allowAnyOrganization = allowAnyOrganization; this.isSystem = isSystem; + this.subjectType = subjectType; + this.authorizationDetailsTypes = authorizationDetailsTypes; this.additionalProperties = additionalProperties; } @@ -109,7 +117,20 @@ public Optional getIsSystem() { return isSystem; } - @java.lang.Override + @JsonProperty("subject_type") + public Optional getSubjectType() { + return subjectType; + } + + /** + * @return Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a> + */ + @JsonProperty("authorization_details_types") + public Optional> getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientGrantResponseContent && equalTo((UpdateClientGrantResponseContent) other); @@ -127,10 +148,12 @@ private boolean equalTo(UpdateClientGrantResponseContent other) { && scope.equals(other.scope) && organizationUsage.equals(other.organizationUsage) && allowAnyOrganization.equals(other.allowAnyOrganization) - && isSystem.equals(other.isSystem); + && isSystem.equals(other.isSystem) + && subjectType.equals(other.subjectType) + && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -139,10 +162,12 @@ public int hashCode() { this.scope, this.organizationUsage, this.allowAnyOrganization, - this.isSystem); + this.isSystem, + this.subjectType, + this.authorizationDetailsTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,6 +192,10 @@ public static final class Builder { private Optional isSystem = Optional.empty(); + private Optional subjectType = Optional.empty(); + + private Optional> authorizationDetailsTypes = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -180,6 +209,8 @@ public Builder from(UpdateClientGrantResponseContent other) { organizationUsage(other.getOrganizationUsage()); allowAnyOrganization(other.getAllowAnyOrganization()); isSystem(other.getIsSystem()); + subjectType(other.getSubjectType()); + authorizationDetailsTypes(other.getAuthorizationDetailsTypes()); return this; } @@ -278,6 +309,31 @@ public Builder isSystem(Boolean isSystem) { return this; } + @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) + public Builder subjectType(Optional subjectType) { + this.subjectType = subjectType; + return this; + } + + public Builder subjectType(ClientGrantSubjectTypeEnum subjectType) { + this.subjectType = Optional.ofNullable(subjectType); + return this; + } + + /** + *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

+ */ + @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) + public Builder authorizationDetailsTypes(Optional> authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + public Builder authorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); + return this; + } + public UpdateClientGrantResponseContent build() { return new UpdateClientGrantResponseContent( id, @@ -287,6 +343,8 @@ public UpdateClientGrantResponseContent build() { organizationUsage, allowAnyOrganization, isSystem, + subjectType, + authorizationDetailsTypes, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java index d7088814c..720edbd56 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java @@ -68,6 +68,8 @@ public final class UpdateClientRequestContent { private final OptionalNullable tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional appType; private final Optional isFirstParty; @@ -100,6 +102,8 @@ public final class UpdateClientRequestContent { private final OptionalNullable organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -110,8 +114,16 @@ public final class UpdateClientRequestContent { private final OptionalNullable complianceLevel; + private final OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt; + + private final OptionalNullable tokenExchange; + private final OptionalNullable parRequestExpiry; + private final OptionalNullable expressConfiguration; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private UpdateClientRequestContent( @@ -137,6 +149,7 @@ private UpdateClientRequestContent( Optional ssoDisabled, Optional customLoginPageOn, OptionalNullable tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional appType, Optional isFirstParty, Optional oidcConformant, @@ -153,12 +166,17 @@ private UpdateClientRequestContent( OptionalNullable defaultOrganization, OptionalNullable organizationUsage, OptionalNullable organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, + OptionalNullable tokenExchange, OptionalNullable parRequestExpiry, + OptionalNullable expressConfiguration, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.name = name; this.description = description; @@ -182,6 +200,7 @@ private UpdateClientRequestContent( this.ssoDisabled = ssoDisabled; this.customLoginPageOn = customLoginPageOn; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.appType = appType; this.isFirstParty = isFirstParty; this.oidcConformant = oidcConformant; @@ -198,12 +217,17 @@ private UpdateClientRequestContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; + this.expressConfiguration = expressConfiguration; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -283,7 +307,7 @@ public Optional> getWebOrigins() { } /** - * @return A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -381,6 +405,14 @@ public OptionalNullable getTokenEndpoin return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("app_type") public Optional getAppType() { return appType; @@ -496,6 +528,14 @@ public OptionalNullable getOrganizat return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -535,6 +575,29 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public OptionalNullable getSkipNonVerifiableCallbackUriConfirmationPrompt() { + if (skipNonVerifiableCallbackUriConfirmationPrompt == null) { + return OptionalNullable.absent(); + } + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_exchange") + public OptionalNullable getTokenExchange() { + if (tokenExchange == null) { + return OptionalNullable.absent(); + } + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -547,6 +610,20 @@ public OptionalNullable getParRequestExpiry() { return parRequestExpiry; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("express_configuration") + public OptionalNullable getExpressConfiguration() { + if (expressConfiguration == null) { + return OptionalNullable.absent(); + } + return expressConfiguration; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -613,13 +690,31 @@ private OptionalNullable _getComplianceLevel() { return complianceLevel; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_exchange") + private OptionalNullable _getTokenExchange() { + return tokenExchange; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("par_request_expiry") private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("express_configuration") + private OptionalNullable _getExpressConfiguration() { + return expressConfiguration; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientRequestContent && equalTo((UpdateClientRequestContent) other); @@ -653,6 +748,7 @@ private boolean equalTo(UpdateClientRequestContent other) { && ssoDisabled.equals(other.ssoDisabled) && customLoginPageOn.equals(other.customLoginPageOn) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && appType.equals(other.appType) && isFirstParty.equals(other.isFirstParty) && oidcConformant.equals(other.oidcConformant) @@ -669,15 +765,21 @@ private boolean equalTo(UpdateClientRequestContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) - && parRequestExpiry.equals(other.parRequestExpiry); + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) + && parRequestExpiry.equals(other.parRequestExpiry) + && expressConfiguration.equals(other.expressConfiguration) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -702,6 +804,7 @@ public int hashCode() { this.ssoDisabled, this.customLoginPageOn, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.appType, this.isFirstParty, this.oidcConformant, @@ -718,15 +821,20 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, - this.parRequestExpiry); + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, + this.parRequestExpiry, + this.expressConfiguration, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -782,6 +890,8 @@ public static final class Builder { private OptionalNullable tokenEndpointAuthMethod = OptionalNullable.absent(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional appType = Optional.empty(); private Optional isFirstParty = Optional.empty(); @@ -815,6 +925,8 @@ public static final class Builder { private OptionalNullable organizationRequireBehavior = OptionalNullable.absent(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -825,8 +937,17 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + + private OptionalNullable tokenExchange = OptionalNullable.absent(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); + private OptionalNullable expressConfiguration = OptionalNullable.absent(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -855,6 +976,7 @@ public Builder from(UpdateClientRequestContent other) { ssoDisabled(other.getSsoDisabled()); customLoginPageOn(other.getCustomLoginPageOn()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); appType(other.getAppType()); isFirstParty(other.getIsFirstParty()); oidcConformant(other.getOidcConformant()); @@ -871,12 +993,17 @@ public Builder from(UpdateClientRequestContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); + expressConfiguration(other.getExpressConfiguration()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -1033,7 +1160,7 @@ public Builder webOrigins(List webOrigins) { } /** - *

A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

A set of grant types that the client is authorized to use. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1254,6 +1381,20 @@ public Builder tokenEndpointAuthMethod( return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "app_type", nulls = Nulls.SKIP) public Builder appType(Optional appType) { this.appType = appType; @@ -1553,6 +1694,22 @@ public Builder organizationRequireBehavior( return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1656,6 +1813,81 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + @Nullable OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isPresent()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + com.auth0.client.mgmt.core.Nullable skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isNull()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.ofNull(); + } else if (skipNonVerifiableCallbackUriConfirmationPrompt.isEmpty()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(@Nullable OptionalNullable tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfigurationOrNull tokenExchange) { + this.tokenExchange = OptionalNullable.of(tokenExchange); + return this; + } + + public Builder tokenExchange(Optional tokenExchange) { + if (tokenExchange.isPresent()) { + this.tokenExchange = OptionalNullable.of(tokenExchange.get()); + } else { + this.tokenExchange = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenExchange( + com.auth0.client.mgmt.core.Nullable tokenExchange) { + if (tokenExchange.isNull()) { + this.tokenExchange = OptionalNullable.ofNull(); + } else if (tokenExchange.isEmpty()) { + this.tokenExchange = OptionalNullable.absent(); + } else { + this.tokenExchange = OptionalNullable.of(tokenExchange.get()); + } + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1690,6 +1922,52 @@ public Builder parRequestExpiry(com.auth0.client.mgmt.core.Nullable par return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration( + @Nullable OptionalNullable expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfigurationOrNull expressConfiguration) { + this.expressConfiguration = OptionalNullable.of(expressConfiguration); + return this; + } + + public Builder expressConfiguration(Optional expressConfiguration) { + if (expressConfiguration.isPresent()) { + this.expressConfiguration = OptionalNullable.of(expressConfiguration.get()); + } else { + this.expressConfiguration = OptionalNullable.absent(); + } + return this; + } + + public Builder expressConfiguration( + com.auth0.client.mgmt.core.Nullable expressConfiguration) { + if (expressConfiguration.isNull()) { + this.expressConfiguration = OptionalNullable.ofNull(); + } else if (expressConfiguration.isEmpty()) { + this.expressConfiguration = OptionalNullable.absent(); + } else { + this.expressConfiguration = OptionalNullable.of(expressConfiguration.get()); + } + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public UpdateClientRequestContent build() { return new UpdateClientRequestContent( name, @@ -1714,6 +1992,7 @@ public UpdateClientRequestContent build() { ssoDisabled, customLoginPageOn, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, appType, isFirstParty, oidcConformant, @@ -1730,12 +2009,17 @@ public UpdateClientRequestContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, + expressConfiguration, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java index e49b55584..42b28add7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java @@ -36,7 +36,7 @@ public final class UpdateClientResponseContent { private final Optional clientSecret; - private final Optional appType; + private final Optional appType; private final Optional logoUri; @@ -88,6 +88,8 @@ public final class UpdateClientResponseContent { private final Optional tokenEndpointAuthMethod; + private final Optional isTokenEndpointIpHeaderTrusted; + private final Optional> clientMetadata; private final Optional mobile; @@ -102,6 +104,8 @@ public final class UpdateClientResponseContent { private final Optional organizationRequireBehavior; + private final Optional> organizationDiscoveryMethods; + private final OptionalNullable clientAuthenticationMethods; private final Optional requirePushedAuthorizationRequests; @@ -112,10 +116,20 @@ public final class UpdateClientResponseContent { private final OptionalNullable complianceLevel; + private final Optional skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional tokenExchange; + private final OptionalNullable parRequestExpiry; private final Optional tokenQuota; + private final Optional expressConfiguration; + + private final Optional resourceServerIdentifier; + + private final Optional> asyncApprovalNotificationChannels; + private final Map additionalProperties; private UpdateClientResponseContent( @@ -125,7 +139,7 @@ private UpdateClientResponseContent( Optional description, Optional global, Optional clientSecret, - Optional appType, + Optional appType, Optional logoUri, Optional isFirstParty, Optional oidcConformant, @@ -151,6 +165,7 @@ private UpdateClientResponseContent( Optional formTemplate, Optional addons, Optional tokenEndpointAuthMethod, + Optional isTokenEndpointIpHeaderTrusted, Optional> clientMetadata, Optional mobile, Optional initiateLoginUri, @@ -158,13 +173,19 @@ private UpdateClientResponseContent( OptionalNullable defaultOrganization, Optional organizationUsage, Optional organizationRequireBehavior, + Optional> organizationDiscoveryMethods, OptionalNullable clientAuthenticationMethods, Optional requirePushedAuthorizationRequests, Optional requireProofOfPossession, Optional signedRequestObject, OptionalNullable complianceLevel, + Optional skipNonVerifiableCallbackUriConfirmationPrompt, + Optional tokenExchange, OptionalNullable parRequestExpiry, Optional tokenQuota, + Optional expressConfiguration, + Optional resourceServerIdentifier, + Optional> asyncApprovalNotificationChannels, Map additionalProperties) { this.clientId = clientId; this.tenant = tenant; @@ -198,6 +219,7 @@ private UpdateClientResponseContent( this.formTemplate = formTemplate; this.addons = addons; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; this.clientMetadata = clientMetadata; this.mobile = mobile; this.initiateLoginUri = initiateLoginUri; @@ -205,13 +227,19 @@ private UpdateClientResponseContent( this.defaultOrganization = defaultOrganization; this.organizationUsage = organizationUsage; this.organizationRequireBehavior = organizationRequireBehavior; + this.organizationDiscoveryMethods = organizationDiscoveryMethods; this.clientAuthenticationMethods = clientAuthenticationMethods; this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; this.requireProofOfPossession = requireProofOfPossession; this.signedRequestObject = signedRequestObject; this.complianceLevel = complianceLevel; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.tokenExchange = tokenExchange; this.parRequestExpiry = parRequestExpiry; this.tokenQuota = tokenQuota; + this.expressConfiguration = expressConfiguration; + this.resourceServerIdentifier = resourceServerIdentifier; + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; this.additionalProperties = additionalProperties; } @@ -263,11 +291,8 @@ public Optional getClientSecret() { return clientSecret; } - /** - * @return Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web. - */ @JsonProperty("app_type") - public Optional getAppType() { + public Optional getAppType() { return appType; } @@ -358,7 +383,7 @@ public Optional getOidcLogout() { } /** - * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code. + * @return List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token. */ @JsonProperty("grant_types") public Optional> getGrantTypes() { @@ -458,6 +483,14 @@ public Optional getTokenEndpointAuthMethod() return tokenEndpointAuthMethod; } + /** + * @return If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint. + */ + @JsonProperty("is_token_endpoint_ip_header_trusted") + public Optional getIsTokenEndpointIpHeaderTrusted() { + return isTokenEndpointIpHeaderTrusted; + } + @JsonProperty("client_metadata") public Optional> getClientMetadata() { return clientMetadata; @@ -504,6 +537,14 @@ public Optional getOrganizationRequireBeh return organizationRequireBehavior; } + /** + * @return Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both. + */ + @JsonProperty("organization_discovery_methods") + public Optional> getOrganizationDiscoveryMethods() { + return organizationDiscoveryMethods; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("client_authentication_methods") public OptionalNullable getClientAuthenticationMethods() { @@ -543,6 +584,21 @@ public OptionalNullable getComplianceLevel() { return complianceLevel; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public Optional getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("token_exchange") + public Optional getTokenExchange() { + return tokenExchange; + } + /** * @return Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ @@ -560,6 +616,24 @@ public Optional getTokenQuota() { return tokenQuota; } + @JsonProperty("express_configuration") + public Optional getExpressConfiguration() { + return expressConfiguration; + } + + /** + * @return The identifier of the resource server that this client is linked to. + */ + @JsonProperty("resource_server_identifier") + public Optional getResourceServerIdentifier() { + return resourceServerIdentifier; + } + + @JsonProperty("async_approval_notification_channels") + public Optional> getAsyncApprovalNotificationChannels() { + return asyncApprovalNotificationChannels; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("session_transfer") private OptionalNullable _getSessionTransfer() { @@ -602,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientResponseContent && equalTo((UpdateClientResponseContent) other); @@ -646,6 +720,7 @@ private boolean equalTo(UpdateClientResponseContent other) { && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) + && isTokenEndpointIpHeaderTrusted.equals(other.isTokenEndpointIpHeaderTrusted) && clientMetadata.equals(other.clientMetadata) && mobile.equals(other.mobile) && initiateLoginUri.equals(other.initiateLoginUri) @@ -653,16 +728,23 @@ private boolean equalTo(UpdateClientResponseContent other) { && defaultOrganization.equals(other.defaultOrganization) && organizationUsage.equals(other.organizationUsage) && organizationRequireBehavior.equals(other.organizationRequireBehavior) + && organizationDiscoveryMethods.equals(other.organizationDiscoveryMethods) && clientAuthenticationMethods.equals(other.clientAuthenticationMethods) && requirePushedAuthorizationRequests.equals(other.requirePushedAuthorizationRequests) && requireProofOfPossession.equals(other.requireProofOfPossession) && signedRequestObject.equals(other.signedRequestObject) && complianceLevel.equals(other.complianceLevel) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && tokenExchange.equals(other.tokenExchange) && parRequestExpiry.equals(other.parRequestExpiry) - && tokenQuota.equals(other.tokenQuota); + && tokenQuota.equals(other.tokenQuota) + && expressConfiguration.equals(other.expressConfiguration) + && resourceServerIdentifier.equals(other.resourceServerIdentifier) + && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.clientId, @@ -697,6 +779,7 @@ public int hashCode() { this.formTemplate, this.addons, this.tokenEndpointAuthMethod, + this.isTokenEndpointIpHeaderTrusted, this.clientMetadata, this.mobile, this.initiateLoginUri, @@ -704,16 +787,22 @@ public int hashCode() { this.defaultOrganization, this.organizationUsage, this.organizationRequireBehavior, + this.organizationDiscoveryMethods, this.clientAuthenticationMethods, this.requirePushedAuthorizationRequests, this.requireProofOfPossession, this.signedRequestObject, this.complianceLevel, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.tokenExchange, this.parRequestExpiry, - this.tokenQuota); + this.tokenQuota, + this.expressConfiguration, + this.resourceServerIdentifier, + this.asyncApprovalNotificationChannels); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -736,7 +825,7 @@ public static final class Builder { private Optional clientSecret = Optional.empty(); - private Optional appType = Optional.empty(); + private Optional appType = Optional.empty(); private Optional logoUri = Optional.empty(); @@ -788,6 +877,8 @@ public static final class Builder { private Optional tokenEndpointAuthMethod = Optional.empty(); + private Optional isTokenEndpointIpHeaderTrusted = Optional.empty(); + private Optional> clientMetadata = Optional.empty(); private Optional mobile = Optional.empty(); @@ -802,6 +893,8 @@ public static final class Builder { private Optional organizationRequireBehavior = Optional.empty(); + private Optional> organizationDiscoveryMethods = Optional.empty(); + private OptionalNullable clientAuthenticationMethods = OptionalNullable.absent(); private Optional requirePushedAuthorizationRequests = Optional.empty(); @@ -812,10 +905,21 @@ public static final class Builder { private OptionalNullable complianceLevel = OptionalNullable.absent(); + private Optional skipNonVerifiableCallbackUriConfirmationPrompt = Optional.empty(); + + private Optional tokenExchange = Optional.empty(); + private OptionalNullable parRequestExpiry = OptionalNullable.absent(); private Optional tokenQuota = Optional.empty(); + private Optional expressConfiguration = Optional.empty(); + + private Optional resourceServerIdentifier = Optional.empty(); + + private Optional> asyncApprovalNotificationChannels = + Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -854,6 +958,7 @@ public Builder from(UpdateClientResponseContent other) { formTemplate(other.getFormTemplate()); addons(other.getAddons()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); + isTokenEndpointIpHeaderTrusted(other.getIsTokenEndpointIpHeaderTrusted()); clientMetadata(other.getClientMetadata()); mobile(other.getMobile()); initiateLoginUri(other.getInitiateLoginUri()); @@ -861,13 +966,19 @@ public Builder from(UpdateClientResponseContent other) { defaultOrganization(other.getDefaultOrganization()); organizationUsage(other.getOrganizationUsage()); organizationRequireBehavior(other.getOrganizationRequireBehavior()); + organizationDiscoveryMethods(other.getOrganizationDiscoveryMethods()); clientAuthenticationMethods(other.getClientAuthenticationMethods()); requirePushedAuthorizationRequests(other.getRequirePushedAuthorizationRequests()); requireProofOfPossession(other.getRequireProofOfPossession()); signedRequestObject(other.getSignedRequestObject()); complianceLevel(other.getComplianceLevel()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + tokenExchange(other.getTokenExchange()); parRequestExpiry(other.getParRequestExpiry()); tokenQuota(other.getTokenQuota()); + expressConfiguration(other.getExpressConfiguration()); + resourceServerIdentifier(other.getResourceServerIdentifier()); + asyncApprovalNotificationChannels(other.getAsyncApprovalNotificationChannels()); return this; } @@ -955,16 +1066,13 @@ public Builder clientSecret(String clientSecret) { return this; } - /** - *

Type of client used to determine which settings are applicable. Can be spa, native, non_interactive, or regular_web.

- */ @JsonSetter(value = "app_type", nulls = Nulls.SKIP) - public Builder appType(Optional appType) { + public Builder appType(Optional appType) { this.appType = appType; return this; } - public Builder appType(String appType) { + public Builder appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } @@ -1139,7 +1247,7 @@ public Builder oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { } /** - *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.

+ *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public Builder grantTypes(Optional> grantTypes) { @@ -1339,6 +1447,20 @@ public Builder tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEn return this; } + /** + *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

+ */ + @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) + public Builder isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; + return this; + } + + public Builder isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { + this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); + return this; + } + @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public Builder clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; @@ -1461,6 +1583,22 @@ public Builder organizationRequireBehavior(ClientOrganizationRequireBehaviorEnum return this; } + /** + *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

+ */ + @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) + public Builder organizationDiscoveryMethods( + Optional> organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = organizationDiscoveryMethods; + return this; + } + + public Builder organizationDiscoveryMethods( + List organizationDiscoveryMethods) { + this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); + return this; + } + @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public Builder clientAuthenticationMethods( @Nullable OptionalNullable clientAuthenticationMethods) { @@ -1564,6 +1702,36 @@ public Builder complianceLevel(com.auth0.client.mgmt.core.NullableControls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + Optional.ofNullable(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) + public Builder tokenExchange(Optional tokenExchange) { + this.tokenExchange = tokenExchange; + return this; + } + + public Builder tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { + this.tokenExchange = Optional.ofNullable(tokenExchange); + return this; + } + /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ @@ -1609,6 +1777,44 @@ public Builder tokenQuota(TokenQuota tokenQuota) { return this; } + @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) + public Builder expressConfiguration(Optional expressConfiguration) { + this.expressConfiguration = expressConfiguration; + return this; + } + + public Builder expressConfiguration(ExpressConfiguration expressConfiguration) { + this.expressConfiguration = Optional.ofNullable(expressConfiguration); + return this; + } + + /** + *

The identifier of the resource server that this client is linked to.

+ */ + @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) + public Builder resourceServerIdentifier(Optional resourceServerIdentifier) { + this.resourceServerIdentifier = resourceServerIdentifier; + return this; + } + + public Builder resourceServerIdentifier(String resourceServerIdentifier) { + this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); + return this; + } + + @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) + public Builder asyncApprovalNotificationChannels( + Optional> asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = asyncApprovalNotificationChannels; + return this; + } + + public Builder asyncApprovalNotificationChannels( + List asyncApprovalNotificationChannels) { + this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); + return this; + } + public UpdateClientResponseContent build() { return new UpdateClientResponseContent( clientId, @@ -1643,6 +1849,7 @@ public UpdateClientResponseContent build() { formTemplate, addons, tokenEndpointAuthMethod, + isTokenEndpointIpHeaderTrusted, clientMetadata, mobile, initiateLoginUri, @@ -1650,13 +1857,19 @@ public UpdateClientResponseContent build() { defaultOrganization, organizationUsage, organizationRequireBehavior, + organizationDiscoveryMethods, clientAuthenticationMethods, requirePushedAuthorizationRequests, requireProofOfPossession, signedRequestObject, complianceLevel, + skipNonVerifiableCallbackUriConfirmationPrompt, + tokenExchange, parRequestExpiry, tokenQuota, + expressConfiguration, + resourceServerIdentifier, + asyncApprovalNotificationChannels, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java index 409777e37..616d25fc8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java @@ -72,12 +72,15 @@ public final class UpdateConnectionOptions { private final Optional disableSelfServiceChangePassword; - private final OptionalNullable> upstreamParams; + private final OptionalNullable>> + upstreamParams; private final Optional setUserRootAttributes; private final OptionalNullable gatewayAuthentication; + private final OptionalNullable federatedConnectionsAccessTokens; + private final Map additionalProperties; private UpdateConnectionOptions( @@ -105,9 +108,10 @@ private UpdateConnectionOptions( Optional extAssignedPlans, Optional extProfile, Optional disableSelfServiceChangePassword, - OptionalNullable> upstreamParams, + OptionalNullable>> upstreamParams, Optional setUserRootAttributes, OptionalNullable gatewayAuthentication, + OptionalNullable federatedConnectionsAccessTokens, Map additionalProperties) { this.validation = validation; this.nonPersistentAttrs = nonPersistentAttrs; @@ -136,6 +140,7 @@ private UpdateConnectionOptions( this.upstreamParams = upstreamParams; this.setUserRootAttributes = setUserRootAttributes; this.gatewayAuthentication = gatewayAuthentication; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; this.additionalProperties = additionalProperties; } @@ -169,6 +174,9 @@ public Optional getAttributes() { return attributes; } + /** + * @return Set to true to inject context into custom DB scripts (warning: cannot be disabled once enabled) + */ @JsonProperty("enable_script_context") public Optional getEnableScriptContext() { return enableScriptContext; @@ -305,7 +313,7 @@ public Optional getDisableSelfServiceChangePassword() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - public OptionalNullable> getUpstreamParams() { + public OptionalNullable>> getUpstreamParams() { if (upstreamParams == null) { return OptionalNullable.absent(); } @@ -326,6 +334,15 @@ public OptionalNullable getGatewayAuthenticatio return gatewayAuthentication; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("validation") private OptionalNullable _getValidation() { @@ -376,7 +393,8 @@ private OptionalNullable _getPasswordDictio @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - private OptionalNullable> _getUpstreamParams() { + private OptionalNullable>> + _getUpstreamParams() { return upstreamParams; } @@ -386,7 +404,13 @@ private OptionalNullable _getGatewayAuthenticat return gatewayAuthentication; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionOptions && equalTo((UpdateConnectionOptions) other); @@ -424,10 +448,11 @@ private boolean equalTo(UpdateConnectionOptions other) { && disableSelfServiceChangePassword.equals(other.disableSelfServiceChangePassword) && upstreamParams.equals(other.upstreamParams) && setUserRootAttributes.equals(other.setUserRootAttributes) - && gatewayAuthentication.equals(other.gatewayAuthentication); + && gatewayAuthentication.equals(other.gatewayAuthentication) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.validation, @@ -456,10 +481,11 @@ public int hashCode() { this.disableSelfServiceChangePassword, this.upstreamParams, this.setUserRootAttributes, - this.gatewayAuthentication); + this.gatewayAuthentication, + this.federatedConnectionsAccessTokens); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -520,12 +546,16 @@ public static final class Builder { private Optional disableSelfServiceChangePassword = Optional.empty(); - private OptionalNullable> upstreamParams = OptionalNullable.absent(); + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); private Optional setUserRootAttributes = Optional.empty(); private OptionalNullable gatewayAuthentication = OptionalNullable.absent(); + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -559,6 +589,7 @@ public Builder from(UpdateConnectionOptions other) { upstreamParams(other.getUpstreamParams()); setUserRootAttributes(other.getSetUserRootAttributes()); gatewayAuthentication(other.getGatewayAuthentication()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); return this; } @@ -632,6 +663,9 @@ public Builder attributes(ConnectionAttributes attributes) { return this; } + /** + *

Set to true to inject context into custom DB scripts (warning: cannot be disabled once enabled)

+ */ @JsonSetter(value = "enable_script_context", nulls = Nulls.SKIP) public Builder enableScriptContext(Optional enableScriptContext) { this.enableScriptContext = enableScriptContext; @@ -1011,17 +1045,22 @@ public Builder disableSelfServiceChangePassword(Boolean disableSelfServiceChange } @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) - public Builder upstreamParams(@Nullable OptionalNullable> upstreamParams) { + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } - public Builder upstreamParams(Map upstreamParams) { + public Builder upstreamParams( + Map> upstreamParams) { this.upstreamParams = OptionalNullable.of(upstreamParams); return this; } - public Builder upstreamParams(Optional> upstreamParams) { + public Builder upstreamParams( + Optional>> upstreamParams) { if (upstreamParams.isPresent()) { this.upstreamParams = OptionalNullable.of(upstreamParams.get()); } else { @@ -1030,7 +1069,10 @@ public Builder upstreamParams(Optional> upstreamParams) { return this; } - public Builder upstreamParams(com.auth0.client.mgmt.core.Nullable> upstreamParams) { + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { if (upstreamParams.isNull()) { this.upstreamParams = OptionalNullable.ofNull(); } else if (upstreamParams.isEmpty()) { @@ -1085,6 +1127,43 @@ public Builder gatewayAuthentication( return this; } + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public Builder federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + public Builder federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + public Builder federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + public Builder federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + public UpdateConnectionOptions build() { return new UpdateConnectionOptions( validation, @@ -1114,6 +1193,7 @@ public UpdateConnectionOptions build() { upstreamParams, setUserRootAttributes, gatewayAuthentication, + federatedConnectionsAccessTokens, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java new file mode 100644 index 000000000..f9a2edb1a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateConnectionProfileRequestContent.Builder.class) +public final class UpdateConnectionProfileRequestContent { + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private UpdateConnectionProfileRequestContent( + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateConnectionProfileRequestContent + && equalTo((UpdateConnectionProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateConnectionProfileRequestContent other) { + return name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateConnectionProfileRequestContent other) { + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public UpdateConnectionProfileRequestContent build() { + return new UpdateConnectionProfileRequestContent( + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java new file mode 100644 index 000000000..6da268a75 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java @@ -0,0 +1,258 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateConnectionProfileResponseContent.Builder.class) +public final class UpdateConnectionProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional organization; + + private final Optional connectionNamePrefixTemplate; + + private final Optional> enabledFeatures; + + private final Optional connectionConfig; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private UpdateConnectionProfileResponseContent( + Optional id, + Optional name, + Optional organization, + Optional connectionNamePrefixTemplate, + Optional> enabledFeatures, + Optional connectionConfig, + Optional strategyOverrides, + Map additionalProperties) { + this.id = id; + this.name = name; + this.organization = organization; + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + this.enabledFeatures = enabledFeatures; + this.connectionConfig = connectionConfig; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("organization") + public Optional getOrganization() { + return organization; + } + + @JsonProperty("connection_name_prefix_template") + public Optional getConnectionNamePrefixTemplate() { + return connectionNamePrefixTemplate; + } + + @JsonProperty("enabled_features") + public Optional> getEnabledFeatures() { + return enabledFeatures; + } + + @JsonProperty("connection_config") + public Optional getConnectionConfig() { + return connectionConfig; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateConnectionProfileResponseContent + && equalTo((UpdateConnectionProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateConnectionProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && organization.equals(other.organization) + && connectionNamePrefixTemplate.equals(other.connectionNamePrefixTemplate) + && enabledFeatures.equals(other.enabledFeatures) + && connectionConfig.equals(other.connectionConfig) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.organization, + this.connectionNamePrefixTemplate, + this.enabledFeatures, + this.connectionConfig, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional connectionNamePrefixTemplate = Optional.empty(); + + private Optional> enabledFeatures = Optional.empty(); + + private Optional connectionConfig = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateConnectionProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + organization(other.getOrganization()); + connectionNamePrefixTemplate(other.getConnectionNamePrefixTemplate()); + enabledFeatures(other.getEnabledFeatures()); + connectionConfig(other.getConnectionConfig()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "organization", nulls = Nulls.SKIP) + public Builder organization(Optional organization) { + this.organization = organization; + return this; + } + + public Builder organization(ConnectionProfileOrganization organization) { + this.organization = Optional.ofNullable(organization); + return this; + } + + @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) + public Builder connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; + return this; + } + + public Builder connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { + this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); + return this; + } + + @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) + public Builder enabledFeatures(Optional> enabledFeatures) { + this.enabledFeatures = enabledFeatures; + return this; + } + + public Builder enabledFeatures(List enabledFeatures) { + this.enabledFeatures = Optional.ofNullable(enabledFeatures); + return this; + } + + @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) + public Builder connectionConfig(Optional connectionConfig) { + this.connectionConfig = connectionConfig; + return this; + } + + public Builder connectionConfig(ConnectionProfileConfig connectionConfig) { + this.connectionConfig = Optional.ofNullable(connectionConfig); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public UpdateConnectionProfileResponseContent build() { + return new UpdateConnectionProfileResponseContent( + id, + name, + organization, + connectionNamePrefixTemplate, + enabledFeatures, + connectionConfig, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java index 0fe404c77..21191ee8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java @@ -36,7 +36,11 @@ public final class UpdateConnectionRequestContent { private final Optional> realms; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -47,7 +51,9 @@ private UpdateConnectionRequestContent( Optional isDomainConnection, Optional showAsButton, Optional> realms, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.displayName = displayName; this.options = options; @@ -56,6 +62,8 @@ private UpdateConnectionRequestContent( this.showAsButton = showAsButton; this.realms = realms; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -109,17 +117,27 @@ public Optional> getRealms() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("options") private OptionalNullable _getOptions() { return options; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionRequestContent && equalTo((UpdateConnectionRequestContent) other); @@ -137,10 +155,12 @@ private boolean equalTo(UpdateConnectionRequestContent other) { && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) && realms.equals(other.realms) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.displayName, @@ -149,10 +169,12 @@ public int hashCode() { this.isDomainConnection, this.showAsButton, this.realms, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -175,7 +197,11 @@ public static final class Builder { private Optional> realms = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -190,6 +216,8 @@ public Builder from(UpdateConnectionRequestContent other) { showAsButton(other.getShowAsButton()); realms(other.getRealms()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -295,16 +323,38 @@ public Builder realms(List realms) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + public UpdateConnectionRequestContent build() { return new UpdateConnectionRequestContent( displayName, @@ -314,6 +364,8 @@ public UpdateConnectionRequestContent build() { showAsButton, realms, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java index c6b7bb368..e51f4f9da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -39,7 +40,11 @@ public final class UpdateConnectionResponseContent { private final Optional showAsButton; - private final Optional> metadata; + private final Optional>> metadata; + + private final Optional authentication; + + private final Optional connectedAccounts; private final Map additionalProperties; @@ -53,7 +58,9 @@ private UpdateConnectionResponseContent( Optional> enabledClients, Optional isDomainConnection, Optional showAsButton, - Optional> metadata, + Optional>> metadata, + Optional authentication, + Optional connectedAccounts, Map additionalProperties) { this.name = name; this.displayName = displayName; @@ -65,6 +72,8 @@ private UpdateConnectionResponseContent( this.isDomainConnection = isDomainConnection; this.showAsButton = showAsButton; this.metadata = metadata; + this.authentication = authentication; + this.connectedAccounts = connectedAccounts; this.additionalProperties = additionalProperties; } @@ -138,11 +147,21 @@ public Optional getShowAsButton() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } - @java.lang.Override + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("connected_accounts") + public Optional getConnectedAccounts() { + return connectedAccounts; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionResponseContent && equalTo((UpdateConnectionResponseContent) other); @@ -163,10 +182,12 @@ private boolean equalTo(UpdateConnectionResponseContent other) { && enabledClients.equals(other.enabledClients) && isDomainConnection.equals(other.isDomainConnection) && showAsButton.equals(other.showAsButton) - && metadata.equals(other.metadata); + && metadata.equals(other.metadata) + && authentication.equals(other.authentication) + && connectedAccounts.equals(other.connectedAccounts); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -178,10 +199,12 @@ public int hashCode() { this.enabledClients, this.isDomainConnection, this.showAsButton, - this.metadata); + this.metadata, + this.authentication, + this.connectedAccounts); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -210,7 +233,11 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional connectedAccounts = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -228,6 +255,8 @@ public Builder from(UpdateConnectionResponseContent other) { isDomainConnection(other.getIsDomainConnection()); showAsButton(other.getShowAsButton()); metadata(other.getMetadata()); + authentication(other.getAuthentication()); + connectedAccounts(other.getConnectedAccounts()); return this; } @@ -355,16 +384,38 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(ConnectionAuthenticationPurpose authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) + public Builder connectedAccounts(Optional connectedAccounts) { + this.connectedAccounts = connectedAccounts; + return this; + } + + public Builder connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { + this.connectedAccounts = Optional.ofNullable(connectedAccounts); + return this; + } + public UpdateConnectionResponseContent build() { return new UpdateConnectionResponseContent( name, @@ -377,6 +428,8 @@ public UpdateConnectionResponseContent build() { isDomainConnection, showAsButton, metadata, + authentication, + connectedAccounts, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java index 91547b142..697877b4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java @@ -27,14 +27,18 @@ public final class UpdateCustomDomainRequestContent { private final OptionalNullable customClientIpHeader; + private final Optional>> domainMetadata; + private final Map additionalProperties; private UpdateCustomDomainRequestContent( Optional tlsPolicy, OptionalNullable customClientIpHeader, + Optional>> domainMetadata, Map additionalProperties) { this.tlsPolicy = tlsPolicy; this.customClientIpHeader = customClientIpHeader; + this.domainMetadata = domainMetadata; this.additionalProperties = additionalProperties; } @@ -49,7 +53,12 @@ public OptionalNullable getCustomClientIpH return customClientIpHeader; } - @java.lang.Override + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateCustomDomainRequestContent && equalTo((UpdateCustomDomainRequestContent) other); @@ -61,15 +70,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateCustomDomainRequestContent other) { - return tlsPolicy.equals(other.tlsPolicy) && customClientIpHeader.equals(other.customClientIpHeader); + return tlsPolicy.equals(other.tlsPolicy) + && customClientIpHeader.equals(other.customClientIpHeader) + && domainMetadata.equals(other.domainMetadata); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.tlsPolicy, this.customClientIpHeader); + return Objects.hash(this.tlsPolicy, this.customClientIpHeader, this.domainMetadata); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,6 +95,8 @@ public static final class Builder { private OptionalNullable customClientIpHeader = OptionalNullable.absent(); + private Optional>> domainMetadata = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -92,6 +105,7 @@ private Builder() {} public Builder from(UpdateCustomDomainRequestContent other) { tlsPolicy(other.getTlsPolicy()); customClientIpHeader(other.getCustomClientIpHeader()); + domainMetadata(other.getDomainMetadata()); return this; } @@ -138,8 +152,20 @@ public Builder customClientIpHeader(Nullable>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + + public Builder domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + public UpdateCustomDomainRequestContent build() { - return new UpdateCustomDomainRequestContent(tlsPolicy, customClientIpHeader, additionalProperties); + return new UpdateCustomDomainRequestContent( + tlsPolicy, customClientIpHeader, domainMetadata, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java index 4e90d7259..08dfedeab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java @@ -30,6 +30,8 @@ public final class UpdateCustomDomainResponseContent { private final boolean primary; + private final CustomDomainStatusFilterEnum status; + private final CustomDomainTypeEnum type; private final DomainVerification verification; @@ -38,24 +40,34 @@ public final class UpdateCustomDomainResponseContent { private final Optional tlsPolicy; + private final Optional>> domainMetadata; + + private final Optional certificate; + private final Map additionalProperties; private UpdateCustomDomainResponseContent( String customDomainId, String domain, boolean primary, + CustomDomainStatusFilterEnum status, CustomDomainTypeEnum type, DomainVerification verification, OptionalNullable customClientIpHeader, Optional tlsPolicy, + Optional>> domainMetadata, + Optional certificate, Map additionalProperties) { this.customDomainId = customDomainId; this.domain = domain; this.primary = primary; + this.status = status; this.type = type; this.verification = verification; this.customClientIpHeader = customClientIpHeader; this.tlsPolicy = tlsPolicy; + this.domainMetadata = domainMetadata; + this.certificate = certificate; this.additionalProperties = additionalProperties; } @@ -83,6 +95,11 @@ public boolean getPrimary() { return primary; } + @JsonProperty("status") + public CustomDomainStatusFilterEnum getStatus() { + return status; + } + @JsonProperty("type") public CustomDomainTypeEnum getType() { return type; @@ -113,13 +130,23 @@ public Optional getTlsPolicy() { return tlsPolicy; } + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @JsonProperty("certificate") + public Optional getCertificate() { + return certificate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("custom_client_ip_header") private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateCustomDomainResponseContent && equalTo((UpdateCustomDomainResponseContent) other); @@ -134,25 +161,31 @@ private boolean equalTo(UpdateCustomDomainResponseContent other) { return customDomainId.equals(other.customDomainId) && domain.equals(other.domain) && primary == other.primary + && status.equals(other.status) && type.equals(other.type) && verification.equals(other.verification) && customClientIpHeader.equals(other.customClientIpHeader) - && tlsPolicy.equals(other.tlsPolicy); + && tlsPolicy.equals(other.tlsPolicy) + && domainMetadata.equals(other.domainMetadata) + && certificate.equals(other.certificate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.customDomainId, this.domain, this.primary, + this.status, this.type, this.verification, this.customClientIpHeader, - this.tlsPolicy); + this.tlsPolicy, + this.domainMetadata, + this.certificate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -181,7 +214,11 @@ public interface PrimaryStage { /** *

Whether this is a primary domain (true) or not (false).

*/ - TypeStage primary(boolean primary); + StatusStage primary(boolean primary); + } + + public interface StatusStage { + TypeStage status(@NotNull CustomDomainStatusFilterEnum status); } public interface TypeStage { @@ -212,21 +249,41 @@ public interface _FinalStage { _FinalStage tlsPolicy(Optional tlsPolicy); _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); + + _FinalStage certificate(Optional certificate); + + _FinalStage certificate(DomainCertificate certificate); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, VerificationStage, _FinalStage { + implements CustomDomainIdStage, + DomainStage, + PrimaryStage, + StatusStage, + TypeStage, + VerificationStage, + _FinalStage { private String customDomainId; private String domain; private boolean primary; + private CustomDomainStatusFilterEnum status; + private CustomDomainTypeEnum type; private DomainVerification verification; + private Optional certificate = Optional.empty(); + + private Optional>> domainMetadata = Optional.empty(); + private Optional tlsPolicy = Optional.empty(); private OptionalNullable customClientIpHeader = OptionalNullable.absent(); @@ -236,15 +293,18 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); primary(other.getPrimary()); + status(other.getStatus()); type(other.getType()); verification(other.getVerification()); customClientIpHeader(other.getCustomClientIpHeader()); tlsPolicy(other.getTlsPolicy()); + domainMetadata(other.getDomainMetadata()); + certificate(other.getCertificate()); return this; } @@ -253,7 +313,7 @@ public Builder from(UpdateCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -265,7 +325,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -277,32 +337,65 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") - public TypeStage primary(boolean primary) { + public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @java.lang.Override + @Override + @JsonSetter("status") + public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override @JsonSetter("type") public VerificationStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("verification") public _FinalStage verification(@NotNull DomainVerification verification) { this.verification = Objects.requireNonNull(verification, "verification must not be null"); return this; } + @Override + public _FinalStage certificate(DomainCertificate certificate) { + this.certificate = Optional.ofNullable(certificate); + return this; + } + + @Override + @JsonSetter(value = "certificate", nulls = Nulls.SKIP) + public _FinalStage certificate(Optional certificate) { + this.certificate = certificate; + return this; + } + + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + /** *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -311,7 +404,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -322,7 +415,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -338,7 +431,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -352,7 +445,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -361,23 +454,26 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @java.lang.Override + @Override public UpdateCustomDomainResponseContent build() { return new UpdateCustomDomainResponseContent( customDomainId, domain, primary, + status, type, verification, customClientIpHeader, tlsPolicy, + domainMetadata, + certificate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java new file mode 100644 index 000000000..233b4c810 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateDirectoryProvisioningRequestContent.Builder.class) +public final class UpdateDirectoryProvisioningRequestContent { + private final Optional> mapping; + + private final Optional synchronizeAutomatically; + + private final Map additionalProperties; + + private UpdateDirectoryProvisioningRequestContent( + Optional> mapping, + Optional synchronizeAutomatically, + Map additionalProperties) { + this.mapping = mapping; + this.synchronizeAutomatically = synchronizeAutomatically; + this.additionalProperties = additionalProperties; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public Optional> getMapping() { + return mapping; + } + + /** + * @return Whether periodic automatic synchronization is enabled + */ + @JsonProperty("synchronize_automatically") + public Optional getSynchronizeAutomatically() { + return synchronizeAutomatically; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateDirectoryProvisioningRequestContent + && equalTo((UpdateDirectoryProvisioningRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateDirectoryProvisioningRequestContent other) { + return mapping.equals(other.mapping) && synchronizeAutomatically.equals(other.synchronizeAutomatically); + } + + @Override + public int hashCode() { + return Objects.hash(this.mapping, this.synchronizeAutomatically); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> mapping = Optional.empty(); + + private Optional synchronizeAutomatically = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateDirectoryProvisioningRequestContent other) { + mapping(other.getMapping()); + synchronizeAutomatically(other.getSynchronizeAutomatically()); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public Builder mapping(Optional> mapping) { + this.mapping = mapping; + return this; + } + + public Builder mapping(List mapping) { + this.mapping = Optional.ofNullable(mapping); + return this; + } + + /** + *

Whether periodic automatic synchronization is enabled

+ */ + @JsonSetter(value = "synchronize_automatically", nulls = Nulls.SKIP) + public Builder synchronizeAutomatically(Optional synchronizeAutomatically) { + this.synchronizeAutomatically = synchronizeAutomatically; + return this; + } + + public Builder synchronizeAutomatically(Boolean synchronizeAutomatically) { + this.synchronizeAutomatically = Optional.ofNullable(synchronizeAutomatically); + return this; + } + + public UpdateDirectoryProvisioningRequestContent build() { + return new UpdateDirectoryProvisioningRequestContent( + mapping, synchronizeAutomatically, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java new file mode 100644 index 000000000..ff8d62236 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java @@ -0,0 +1,513 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateDirectoryProvisioningResponseContent.Builder.class) +public final class UpdateDirectoryProvisioningResponseContent { + private final String connectionId; + + private final String connectionName; + + private final String strategy; + + private final List mapping; + + private final boolean synchronizeAutomatically; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional lastSynchronizationAt; + + private final Optional lastSynchronizationStatus; + + private final Optional lastSynchronizationError; + + private final Map additionalProperties; + + private UpdateDirectoryProvisioningResponseContent( + String connectionId, + String connectionName, + String strategy, + List mapping, + boolean synchronizeAutomatically, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional lastSynchronizationAt, + Optional lastSynchronizationStatus, + Optional lastSynchronizationError, + Map additionalProperties) { + this.connectionId = connectionId; + this.connectionName = connectionName; + this.strategy = strategy; + this.mapping = mapping; + this.synchronizeAutomatically = synchronizeAutomatically; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.lastSynchronizationAt = lastSynchronizationAt; + this.lastSynchronizationStatus = lastSynchronizationStatus; + this.lastSynchronizationError = lastSynchronizationError; + this.additionalProperties = additionalProperties; + } + + /** + * @return The connection's identifier + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + /** + * @return The connection's name + */ + @JsonProperty("connection_name") + public String getConnectionName() { + return connectionName; + } + + /** + * @return The connection's strategy + */ + @JsonProperty("strategy") + public String getStrategy() { + return strategy; + } + + /** + * @return The mapping between Auth0 and IDP user attributes + */ + @JsonProperty("mapping") + public List getMapping() { + return mapping; + } + + /** + * @return Whether periodic automatic synchronization is enabled + */ + @JsonProperty("synchronize_automatically") + public boolean getSynchronizeAutomatically() { + return synchronizeAutomatically; + } + + /** + * @return The timestamp at which the directory provisioning configuration was created + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The timestamp at which the directory provisioning configuration was last updated + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The timestamp at which the connection was last synchronized + */ + @JsonProperty("last_synchronization_at") + public Optional getLastSynchronizationAt() { + return lastSynchronizationAt; + } + + /** + * @return The status of the last synchronization + */ + @JsonProperty("last_synchronization_status") + public Optional getLastSynchronizationStatus() { + return lastSynchronizationStatus; + } + + /** + * @return The error message of the last synchronization, if any + */ + @JsonProperty("last_synchronization_error") + public Optional getLastSynchronizationError() { + return lastSynchronizationError; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateDirectoryProvisioningResponseContent + && equalTo((UpdateDirectoryProvisioningResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateDirectoryProvisioningResponseContent other) { + return connectionId.equals(other.connectionId) + && connectionName.equals(other.connectionName) + && strategy.equals(other.strategy) + && mapping.equals(other.mapping) + && synchronizeAutomatically == other.synchronizeAutomatically + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && lastSynchronizationAt.equals(other.lastSynchronizationAt) + && lastSynchronizationStatus.equals(other.lastSynchronizationStatus) + && lastSynchronizationError.equals(other.lastSynchronizationError); + } + + @Override + public int hashCode() { + return Objects.hash( + this.connectionId, + this.connectionName, + this.strategy, + this.mapping, + this.synchronizeAutomatically, + this.createdAt, + this.updatedAt, + this.lastSynchronizationAt, + this.lastSynchronizationStatus, + this.lastSynchronizationError); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

The connection's identifier

+ */ + ConnectionNameStage connectionId(@NotNull String connectionId); + + Builder from(UpdateDirectoryProvisioningResponseContent other); + } + + public interface ConnectionNameStage { + /** + *

The connection's name

+ */ + StrategyStage connectionName(@NotNull String connectionName); + } + + public interface StrategyStage { + /** + *

The connection's strategy

+ */ + SynchronizeAutomaticallyStage strategy(@NotNull String strategy); + } + + public interface SynchronizeAutomaticallyStage { + /** + *

Whether periodic automatic synchronization is enabled

+ */ + CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically); + } + + public interface CreatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was created

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ */ + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + UpdateDirectoryProvisioningResponseContent build(); + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + _FinalStage mapping(List mapping); + + _FinalStage addMapping(DirectoryProvisioningMappingItem mapping); + + _FinalStage addAllMapping(List mapping); + + /** + *

The timestamp at which the connection was last synchronized

+ */ + _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt); + + _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt); + + /** + *

The status of the last synchronization

+ */ + _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus); + + _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus); + + /** + *

The error message of the last synchronization, if any

+ */ + _FinalStage lastSynchronizationError(Optional lastSynchronizationError); + + _FinalStage lastSynchronizationError(String lastSynchronizationError); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ConnectionIdStage, + ConnectionNameStage, + StrategyStage, + SynchronizeAutomaticallyStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private String connectionId; + + private String connectionName; + + private String strategy; + + private boolean synchronizeAutomatically; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional lastSynchronizationError = Optional.empty(); + + private Optional lastSynchronizationStatus = Optional.empty(); + + private Optional lastSynchronizationAt = Optional.empty(); + + private List mapping = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateDirectoryProvisioningResponseContent other) { + connectionId(other.getConnectionId()); + connectionName(other.getConnectionName()); + strategy(other.getStrategy()); + mapping(other.getMapping()); + synchronizeAutomatically(other.getSynchronizeAutomatically()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + lastSynchronizationAt(other.getLastSynchronizationAt()); + lastSynchronizationStatus(other.getLastSynchronizationStatus()); + lastSynchronizationError(other.getLastSynchronizationError()); + return this; + } + + /** + *

The connection's identifier

+ *

The connection's identifier

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_id") + public ConnectionNameStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

The connection's name

+ *

The connection's name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection_name") + public StrategyStage connectionName(@NotNull String connectionName) { + this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); + return this; + } + + /** + *

The connection's strategy

+ *

The connection's strategy

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("strategy") + public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { + this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); + return this; + } + + /** + *

Whether periodic automatic synchronization is enabled

+ *

Whether periodic automatic synchronization is enabled

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("synchronize_automatically") + public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { + this.synchronizeAutomatically = synchronizeAutomatically; + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was created

+ *

The timestamp at which the directory provisioning configuration was created

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The timestamp at which the directory provisioning configuration was last updated

+ *

The timestamp at which the directory provisioning configuration was last updated

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationError(String lastSynchronizationError) { + this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); + return this; + } + + /** + *

The error message of the last synchronization, if any

+ */ + @Override + @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { + this.lastSynchronizationError = lastSynchronizationError; + return this; + } + + /** + *

The status of the last synchronization

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { + this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); + return this; + } + + /** + *

The status of the last synchronization

+ */ + @Override + @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { + this.lastSynchronizationStatus = lastSynchronizationStatus; + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { + this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); + return this; + } + + /** + *

The timestamp at which the connection was last synchronized

+ */ + @Override + @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) + public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { + this.lastSynchronizationAt = lastSynchronizationAt; + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addAllMapping(List mapping) { + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { + this.mapping.add(mapping); + return this; + } + + /** + *

The mapping between Auth0 and IDP user attributes

+ */ + @Override + @JsonSetter(value = "mapping", nulls = Nulls.SKIP) + public _FinalStage mapping(List mapping) { + this.mapping.clear(); + if (mapping != null) { + this.mapping.addAll(mapping); + } + return this; + } + + @Override + public UpdateDirectoryProvisioningResponseContent build() { + return new UpdateDirectoryProvisioningResponseContent( + connectionId, + connectionName, + strategy, + mapping, + synchronizeAutomatically, + createdAt, + updatedAt, + lastSynchronizationAt, + lastSynchronizationStatus, + lastSynchronizationError, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java index 12a2255f0..8799ea769 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailProviderResponseContent @@ -101,12 +101,12 @@ private boolean equalTo(UpdateEmailProviderResponseContent other) { && settings.equals(other.settings); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java index 24add727f..85025794a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailTemplateRequestContent && equalTo((UpdateEmailTemplateRequestContent) other); @@ -228,7 +228,7 @@ private boolean equalTo(UpdateEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -242,7 +242,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java index c7a2f72b3..4036e6c4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailTemplateResponseContent @@ -229,7 +229,7 @@ private boolean equalTo(UpdateEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java index fb814e981..3583b1e4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java @@ -48,7 +48,7 @@ public boolean getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEnabledClientConnectionsRequestContentItem @@ -64,12 +64,12 @@ private boolean equalTo(UpdateEnabledClientConnectionsRequestContentItem other) return clientId.equals(other.clientId) && status == other.status; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientId, this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ClientIdStage, StatusStage, _FinalS private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateEnabledClientConnectionsRequestContentItem other) { clientId(other.getClientId()); status(other.getStatus()); @@ -121,7 +121,7 @@ public Builder from(UpdateEnabledClientConnectionsRequestContentItem other) { *

The client_id of the client to be the subject to change status

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("client_id") public StatusStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -133,14 +133,14 @@ public StatusStage clientId(@NotNull String clientId) { *

Whether the connection is enabled or not for this client_id

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("status") public _FinalStage status(boolean status) { this.status = status; return this; } - @java.lang.Override + @Override public UpdateEnabledClientConnectionsRequestContentItem build() { return new UpdateEnabledClientConnectionsRequestContentItem(clientId, status, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java index 6f2a670cd..a8e176ddf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java @@ -70,7 +70,7 @@ public Optional getStatus() { return status; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEventStreamRequestContent && equalTo((UpdateEventStreamRequestContent) other); @@ -88,12 +88,12 @@ private boolean equalTo(UpdateEventStreamRequestContent other) { && status.equals(other.status); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java index b2dbd0284..0250b929c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEventStreamResponseContent && equalTo((UpdateEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(UpdateEventStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer> getActions() { return actions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowRequestContent && equalTo((UpdateFlowRequestContent) other); @@ -59,12 +59,12 @@ private boolean equalTo(UpdateFlowRequestContent other) { return name.equals(other.name) && actions.equals(other.actions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.actions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java index dd6e1cb24..b2df9d913 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowResponseContent && equalTo((UpdateFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(UpdateFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(UpdateFlowResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @java.lang.Override + @Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @java.lang.Override + @Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @java.lang.Override + @Override public UpdateFlowResponseContent build() { return new UpdateFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java new file mode 100644 index 000000000..291619823 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateFlowsVaultConnectionResponseContent.Builder.class) +public final class UpdateFlowsVaultConnectionResponseContent { + private final String id; + + private final String appId; + + private final Optional environment; + + private final String name; + + private final Optional accountName; + + private final boolean ready; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Optional refreshedAt; + + private final String fingerprint; + + private final Map additionalProperties; + + private UpdateFlowsVaultConnectionResponseContent( + String id, + String appId, + Optional environment, + String name, + Optional accountName, + boolean ready, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Optional refreshedAt, + String fingerprint, + Map additionalProperties) { + this.id = id; + this.appId = appId; + this.environment = environment; + this.name = name; + this.accountName = accountName; + this.ready = ready; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.refreshedAt = refreshedAt; + this.fingerprint = fingerprint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Flows Vault Connection identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Flows Vault Connection app identifier. + */ + @JsonProperty("app_id") + public String getAppId() { + return appId; + } + + /** + * @return Flows Vault Connection environment. + */ + @JsonProperty("environment") + public Optional getEnvironment() { + return environment; + } + + /** + * @return Flows Vault Connection name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Flows Vault Connection custom account name. + */ + @JsonProperty("account_name") + public Optional getAccountName() { + return accountName; + } + + /** + * @return Whether the Flows Vault Connection is configured. + */ + @JsonProperty("ready") + public boolean getReady() { + return ready; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was updated. + */ + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * @return The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + */ + @JsonProperty("refreshed_at") + public Optional getRefreshedAt() { + return refreshedAt; + } + + @JsonProperty("fingerprint") + public String getFingerprint() { + return fingerprint; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFlowsVaultConnectionResponseContent + && equalTo((UpdateFlowsVaultConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateFlowsVaultConnectionResponseContent other) { + return id.equals(other.id) + && appId.equals(other.appId) + && environment.equals(other.environment) + && name.equals(other.name) + && accountName.equals(other.accountName) + && ready == other.ready + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && refreshedAt.equals(other.refreshedAt) + && fingerprint.equals(other.fingerprint); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.appId, + this.environment, + this.name, + this.accountName, + this.ready, + this.createdAt, + this.updatedAt, + this.refreshedAt, + this.fingerprint); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Flows Vault Connection identifier.

+ */ + AppIdStage id(@NotNull String id); + + Builder from(UpdateFlowsVaultConnectionResponseContent other); + } + + public interface AppIdStage { + /** + *

Flows Vault Connection app identifier.

+ */ + NameStage appId(@NotNull String appId); + } + + public interface NameStage { + /** + *

Flows Vault Connection name.

+ */ + ReadyStage name(@NotNull String name); + } + + public interface ReadyStage { + /** + *

Whether the Flows Vault Connection is configured.

+ */ + CreatedAtStage ready(boolean ready); + } + + public interface CreatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ */ + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ */ + FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface FingerprintStage { + _FinalStage fingerprint(@NotNull String fingerprint); + } + + public interface _FinalStage { + UpdateFlowsVaultConnectionResponseContent build(); + + /** + *

Flows Vault Connection environment.

+ */ + _FinalStage environment(Optional environment); + + _FinalStage environment(String environment); + + /** + *

Flows Vault Connection custom account name.

+ */ + _FinalStage accountName(Optional accountName); + + _FinalStage accountName(String accountName); + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + _FinalStage refreshedAt(Optional refreshedAt); + + _FinalStage refreshedAt(OffsetDateTime refreshedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + AppIdStage, + NameStage, + ReadyStage, + CreatedAtStage, + UpdatedAtStage, + FingerprintStage, + _FinalStage { + private String id; + + private String appId; + + private String name; + + private boolean ready; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private String fingerprint; + + private Optional refreshedAt = Optional.empty(); + + private Optional accountName = Optional.empty(); + + private Optional environment = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateFlowsVaultConnectionResponseContent other) { + id(other.getId()); + appId(other.getAppId()); + environment(other.getEnvironment()); + name(other.getName()); + accountName(other.getAccountName()); + ready(other.getReady()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + refreshedAt(other.getRefreshedAt()); + fingerprint(other.getFingerprint()); + return this; + } + + /** + *

Flows Vault Connection identifier.

+ *

Flows Vault Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public AppIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Flows Vault Connection app identifier.

+ *

Flows Vault Connection app identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("app_id") + public NameStage appId(@NotNull String appId) { + this.appId = Objects.requireNonNull(appId, "appId must not be null"); + return this; + } + + /** + *

Flows Vault Connection name.

+ *

Flows Vault Connection name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("name") + public ReadyStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Whether the Flows Vault Connection is configured.

+ *

Whether the Flows Vault Connection is configured.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("ready") + public CreatedAtStage ready(boolean ready) { + this.ready = ready; + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("updated_at") + public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @Override + @JsonSetter("fingerprint") + public _FinalStage fingerprint(@NotNull String fingerprint) { + this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { + this.refreshedAt = Optional.ofNullable(refreshedAt); + return this; + } + + /** + *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

+ */ + @Override + @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) + public _FinalStage refreshedAt(Optional refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage accountName(String accountName) { + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + *

Flows Vault Connection custom account name.

+ */ + @Override + @JsonSetter(value = "account_name", nulls = Nulls.SKIP) + public _FinalStage accountName(Optional accountName) { + this.accountName = accountName; + return this; + } + + /** + *

Flows Vault Connection environment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage environment(String environment) { + this.environment = Optional.ofNullable(environment); + return this; + } + + /** + *

Flows Vault Connection environment.

+ */ + @Override + @JsonSetter(value = "environment", nulls = Nulls.SKIP) + public _FinalStage environment(Optional environment) { + this.environment = environment; + return this; + } + + @Override + public UpdateFlowsVaultConnectionResponseContent build() { + return new UpdateFlowsVaultConnectionResponseContent( + id, + appId, + environment, + name, + accountName, + ready, + createdAt, + updatedAt, + refreshedAt, + fingerprint, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java new file mode 100644 index 000000000..ee69839d5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UpdateFlowsVaultConnectionSetup.Deserializer.class) +public final class UpdateFlowsVaultConnectionSetup { + private final Object value; + + private final int type; + + private UpdateFlowsVaultConnectionSetup(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((FlowsVaultConnectioSetupApiKeyWithBaseUrl) this.value); + } else if (this.type == 1) { + return visitor.visit((FlowsVaultConnectioSetupApiKey) this.value); + } else if (this.type == 2) { + return visitor.visit((FlowsVaultConnectioSetupOauthApp) this.value); + } else if (this.type == 3) { + return visitor.visit((FlowsVaultConnectioSetupBigqueryOauthJwt) this.value); + } else if (this.type == 4) { + return visitor.visit((FlowsVaultConnectioSetupSecretApiKey) this.value); + } else if (this.type == 5) { + return visitor.visit((FlowsVaultConnectioSetupHttpBearer) this.value); + } else if (this.type == 6) { + return visitor.visit((FlowsVaultConnectioSetupJwt) this.value); + } else if (this.type == 7) { + return visitor.visit((FlowsVaultConnectioSetupMailjetApiKey) this.value); + } else if (this.type == 8) { + return visitor.visit((FlowsVaultConnectioSetupToken) this.value); + } else if (this.type == 9) { + return visitor.visit((FlowsVaultConnectioSetupWebhook) this.value); + } else if (this.type == 10) { + return visitor.visit((FlowsVaultConnectioSetupStripeKeyPair) this.value); + } else if (this.type == 11) { + return visitor.visit((FlowsVaultConnectioSetupOauthCode) this.value); + } else if (this.type == 12) { + return visitor.visit((FlowsVaultConnectioSetupTwilioApiKey) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateFlowsVaultConnectionSetup && equalTo((UpdateFlowsVaultConnectionSetup) other); + } + + private boolean equalTo(UpdateFlowsVaultConnectionSetup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupApiKeyWithBaseUrl value) { + return new UpdateFlowsVaultConnectionSetup(value, 0); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupApiKey value) { + return new UpdateFlowsVaultConnectionSetup(value, 1); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupOauthApp value) { + return new UpdateFlowsVaultConnectionSetup(value, 2); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupBigqueryOauthJwt value) { + return new UpdateFlowsVaultConnectionSetup(value, 3); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupSecretApiKey value) { + return new UpdateFlowsVaultConnectionSetup(value, 4); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupHttpBearer value) { + return new UpdateFlowsVaultConnectionSetup(value, 5); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupJwt value) { + return new UpdateFlowsVaultConnectionSetup(value, 6); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupMailjetApiKey value) { + return new UpdateFlowsVaultConnectionSetup(value, 7); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupToken value) { + return new UpdateFlowsVaultConnectionSetup(value, 8); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupWebhook value) { + return new UpdateFlowsVaultConnectionSetup(value, 9); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupStripeKeyPair value) { + return new UpdateFlowsVaultConnectionSetup(value, 10); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupOauthCode value) { + return new UpdateFlowsVaultConnectionSetup(value, 11); + } + + public static UpdateFlowsVaultConnectionSetup of(FlowsVaultConnectioSetupTwilioApiKey value) { + return new UpdateFlowsVaultConnectionSetup(value, 12); + } + + public interface Visitor { + T visit(FlowsVaultConnectioSetupApiKeyWithBaseUrl value); + + T visit(FlowsVaultConnectioSetupApiKey value); + + T visit(FlowsVaultConnectioSetupOauthApp value); + + T visit(FlowsVaultConnectioSetupBigqueryOauthJwt value); + + T visit(FlowsVaultConnectioSetupSecretApiKey value); + + T visit(FlowsVaultConnectioSetupHttpBearer value); + + T visit(FlowsVaultConnectioSetupJwt value); + + T visit(FlowsVaultConnectioSetupMailjetApiKey value); + + T visit(FlowsVaultConnectioSetupToken value); + + T visit(FlowsVaultConnectioSetupWebhook value); + + T visit(FlowsVaultConnectioSetupStripeKeyPair value); + + T visit(FlowsVaultConnectioSetupOauthCode value); + + T visit(FlowsVaultConnectioSetupTwilioApiKey value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateFlowsVaultConnectionSetup.class); + } + + @Override + public UpdateFlowsVaultConnectionSetup deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupApiKeyWithBaseUrl.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupOauthApp.class)); + } catch (RuntimeException e) { + } + try { + return of( + ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupBigqueryOauthJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupSecretApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupHttpBearer.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupJwt.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupMailjetApiKey.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupToken.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupWebhook.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupStripeKeyPair.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupOauthCode.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlowsVaultConnectioSetupTwilioApiKey.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java index fef7660b5..071d6674a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFormRequestContent.java @@ -30,7 +30,7 @@ public final class UpdateFormRequestContent { private final OptionalNullable languages; - private final OptionalNullable> translations; + private final OptionalNullable>> translations; private final OptionalNullable> nodes; @@ -46,7 +46,7 @@ private UpdateFormRequestContent( Optional name, OptionalNullable messages, OptionalNullable languages, - OptionalNullable> translations, + OptionalNullable>> translations, OptionalNullable> nodes, OptionalNullable start, OptionalNullable ending, @@ -82,7 +82,7 @@ public OptionalNullable getLanguages() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("translations") - public OptionalNullable> getTranslations() { + public OptionalNullable>> getTranslations() { return translations; } @@ -110,7 +110,7 @@ public OptionalNullable getStyle() { return style; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFormRequestContent && equalTo((UpdateFormRequestContent) other); @@ -132,7 +132,7 @@ private boolean equalTo(UpdateFormRequestContent other) { && style.equals(other.style); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -145,7 +145,7 @@ public int hashCode() { this.style); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -162,7 +162,7 @@ public static final class Builder { private OptionalNullable languages = OptionalNullable.absent(); - private OptionalNullable> translations = OptionalNullable.absent(); + private OptionalNullable>> translations = OptionalNullable.absent(); private OptionalNullable> nodes = OptionalNullable.absent(); @@ -263,17 +263,17 @@ public Builder languages(Nullable languages) { } @JsonSetter(value = "translations", nulls = Nulls.SKIP) - public Builder translations(OptionalNullable> translations) { + public Builder translations(OptionalNullable>> translations) { this.translations = translations; return this; } - public Builder translations(Map translations) { + public Builder translations(Map> translations) { this.translations = OptionalNullable.of(translations); return this; } - public Builder translations(Optional> translations) { + public Builder translations(Optional>> translations) { if (translations.isPresent()) { this.translations = OptionalNullable.of(translations.get()); } else { @@ -282,7 +282,7 @@ public Builder translations(Optional> translations) { return this; } - public Builder translations(Nullable> translations) { + public Builder translations(Nullable>> translations) { if (translations.isNull()) { this.translations = OptionalNullable.ofNull(); } else if (translations.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java index b439045f4..035801474 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java @@ -31,7 +31,7 @@ public final class UpdateFormResponseContent { private final Optional languages; - private final Optional> translations; + private final Optional>> translations; private final Optional> nodes; @@ -56,7 +56,7 @@ private UpdateFormResponseContent( String name, Optional messages, Optional languages, - Optional> translations, + Optional>> translations, Optional> nodes, Optional start, Optional ending, @@ -103,7 +103,7 @@ public Optional getLanguages() { } @JsonProperty("translations") - public Optional> getTranslations() { + public Optional>> getTranslations() { return translations; } @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFormResponseContent && equalTo((UpdateFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(UpdateFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -230,9 +230,9 @@ public interface _FinalStage { _FinalStage languages(FormLanguages languages); - _FinalStage translations(Optional> translations); + _FinalStage translations(Optional>> translations); - _FinalStage translations(Map translations); + _FinalStage translations(Map> translations); _FinalStage nodes(Optional> nodes); @@ -281,7 +281,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Optional> nodes = Optional.empty(); - private Optional> translations = Optional.empty(); + private Optional>> translations = Optional.empty(); private Optional languages = Optional.empty(); @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(UpdateFormResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @java.lang.Override + @Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @java.lang.Override + @Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @java.lang.Override + @Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @java.lang.Override + @Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @java.lang.Override + @Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @java.lang.Override + @Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @java.lang.Override + @Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @java.lang.Override + @Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @java.lang.Override + @Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @java.lang.Override + @Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @java.lang.Override - public _FinalStage translations(Map translations) { + @Override + public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @java.lang.Override + @Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) - public _FinalStage translations(Optional> translations) { + public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @java.lang.Override + @Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @java.lang.Override + @Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @java.lang.Override + @Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @java.lang.Override + @Override public UpdateFormResponseContent build() { return new UpdateFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java index 634e09d9d..cdaaa76fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(UpdateGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java index 72a5d6a4f..e4c8bb4ee 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsResponse && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java index 811065047..13ed2114f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java @@ -26,7 +26,7 @@ public final class UpdateHookRequestContent { private final Optional enabled; - private final Optional> dependencies; + private final Optional> dependencies; private final Map additionalProperties; @@ -34,7 +34,7 @@ private UpdateHookRequestContent( Optional name, Optional script, Optional enabled, - Optional> dependencies, + Optional> dependencies, Map additionalProperties) { this.name = name; this.script = script; @@ -68,11 +68,11 @@ public Optional getEnabled() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateHookRequestContent && equalTo((UpdateHookRequestContent) other); @@ -90,12 +90,12 @@ private boolean equalTo(UpdateHookRequestContent other) { && dependencies.equals(other.dependencies); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.script, this.enabled, this.dependencies); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -112,7 +112,7 @@ public static final class Builder { private Optional enabled = Optional.empty(); - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -170,12 +170,12 @@ public Builder enabled(Boolean enabled) { } @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional> dependencies) { + public Builder dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } - public Builder dependencies(Map dependencies) { + public Builder dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java index bbbab3cfa..102a88ef4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java @@ -30,7 +30,7 @@ public final class UpdateHookResponseContent { private final Optional script; - private final Optional> dependencies; + private final Optional> dependencies; private final Map additionalProperties; @@ -40,7 +40,7 @@ private UpdateHookResponseContent( Optional name, Optional enabled, Optional script, - Optional> dependencies, + Optional> dependencies, Map additionalProperties) { this.triggerId = triggerId; this.id = id; @@ -92,11 +92,11 @@ public Optional getScript() { } @JsonProperty("dependencies") - public Optional> getDependencies() { + public Optional> getDependencies() { return dependencies; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateHookResponseContent && equalTo((UpdateHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(UpdateHookResponseContent other) { && dependencies.equals(other.dependencies); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -142,7 +142,7 @@ public static final class Builder { private Optional script = Optional.empty(); - private Optional> dependencies = Optional.empty(); + private Optional> dependencies = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -230,12 +230,12 @@ public Builder script(String script) { } @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) - public Builder dependencies(Optional> dependencies) { + public Builder dependencies(Optional> dependencies) { this.dependencies = dependencies; return this; } - public Builder dependencies(Map dependencies) { + public Builder dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java index f6ea3cb1c..8a701d791 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java @@ -91,7 +91,7 @@ public Optional getSink() { return sink; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateLogStreamRequestContent && equalTo((UpdateLogStreamRequestContent) other); @@ -111,12 +111,12 @@ private boolean equalTo(UpdateLogStreamRequestContent other) { && sink.equals(other.sink); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.status, this.isPriority, this.filters, this.piiConfig, this.sink); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java index 7f02c46ce..25d3534e2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateLogStreamResponseContent && equalTo((UpdateLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(UpdateLogStreamResponseContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getRule() { return rule; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateNetworkAclRequestContent && equalTo((UpdateNetworkAclRequestContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(UpdateNetworkAclRequestContent other) { && rule.equals(other.rule); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java index 9b15c8f06..daf6e9bd9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateNetworkAclResponseContent && equalTo((UpdateNetworkAclResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(UpdateNetworkAclResponseContent other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java index e4707f1de..51e8b8a1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(UpdateOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java new file mode 100644 index 000000000..d4f6b2148 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationDiscoveryDomainResponseContent.Builder.class) +public final class UpdateOrganizationDiscoveryDomainResponseContent { + private final String id; + + private final String domain; + + private final OrganizationDiscoveryDomainStatus status; + + private final String verificationTxt; + + private final String verificationHost; + + private final Map additionalProperties; + + private UpdateOrganizationDiscoveryDomainResponseContent( + String id, + String domain, + OrganizationDiscoveryDomainStatus status, + String verificationTxt, + String verificationHost, + Map additionalProperties) { + this.id = id; + this.domain = domain; + this.status = status; + this.verificationTxt = verificationTxt; + this.verificationHost = verificationHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization discovery domain identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public OrganizationDiscoveryDomainStatus getStatus() { + return status; + } + + /** + * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. + */ + @JsonProperty("verification_txt") + public String getVerificationTxt() { + return verificationTxt; + } + + /** + * @return The full domain where the TXT record should be added. + */ + @JsonProperty("verification_host") + public String getVerificationHost() { + return verificationHost; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationDiscoveryDomainResponseContent + && equalTo((UpdateOrganizationDiscoveryDomainResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationDiscoveryDomainResponseContent other) { + return id.equals(other.id) + && domain.equals(other.domain) + && status.equals(other.status) + && verificationTxt.equals(other.verificationTxt) + && verificationHost.equals(other.verificationHost); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization discovery domain identifier.

+ */ + DomainStage id(@NotNull String id); + + Builder from(UpdateOrganizationDiscoveryDomainResponseContent other); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + StatusStage domain(@NotNull String domain); + } + + public interface StatusStage { + VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status); + } + + public interface VerificationTxtStage { + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ */ + VerificationHostStage verificationTxt(@NotNull String verificationTxt); + } + + public interface VerificationHostStage { + /** + *

The full domain where the TXT record should be added.

+ */ + _FinalStage verificationHost(@NotNull String verificationHost); + } + + public interface _FinalStage { + UpdateOrganizationDiscoveryDomainResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, DomainStage, StatusStage, VerificationTxtStage, VerificationHostStage, _FinalStage { + private String id; + + private String domain; + + private OrganizationDiscoveryDomainStatus status; + + private String verificationTxt; + + private String verificationHost; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateOrganizationDiscoveryDomainResponseContent other) { + id(other.getId()); + domain(other.getDomain()); + status(other.getStatus()); + verificationTxt(other.getVerificationTxt()); + verificationHost(other.getVerificationHost()); + return this; + } + + /** + *

Organization discovery domain identifier.

+ *

Organization discovery domain identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("id") + public DomainStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("domain") + public StatusStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @Override + @JsonSetter("status") + public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_txt") + public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { + this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); + return this; + } + + /** + *

The full domain where the TXT record should be added.

+ *

The full domain where the TXT record should be added.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("verification_host") + public _FinalStage verificationHost(@NotNull String verificationHost) { + this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); + return this; + } + + @Override + public UpdateOrganizationDiscoveryDomainResponseContent build() { + return new UpdateOrganizationDiscoveryDomainResponseContent( + id, domain, status, verificationTxt, verificationHost, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java index 2fc18091d..0075a7d05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java @@ -29,7 +29,7 @@ public final class UpdateOrganizationRequestContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final OptionalNullable tokenQuota; @@ -39,7 +39,7 @@ private UpdateOrganizationRequestContent( Optional displayName, Optional name, Optional branding, - Optional> metadata, + Optional>> metadata, OptionalNullable tokenQuota, Map additionalProperties) { this.displayName = displayName; @@ -72,7 +72,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -91,7 +91,7 @@ private OptionalNullable _getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationRequestContent && equalTo((UpdateOrganizationRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(UpdateOrganizationRequestContent other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.displayName, this.name, this.branding, this.metadata, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +132,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private OptionalNullable tokenQuota = OptionalNullable.absent(); @@ -190,12 +190,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java index 28ff63c41..c4c2d70ea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java @@ -4,6 +4,7 @@ package com.auth0.client.mgmt.types; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -28,7 +29,7 @@ public final class UpdateOrganizationResponseContent { private final Optional branding; - private final Optional> metadata; + private final Optional>> metadata; private final Optional tokenQuota; @@ -39,7 +40,7 @@ private UpdateOrganizationResponseContent( Optional name, Optional displayName, Optional branding, - Optional> metadata, + Optional>> metadata, Optional tokenQuota, Map additionalProperties) { this.id = id; @@ -81,7 +82,7 @@ public Optional getBranding() { } @JsonProperty("metadata") - public Optional> getMetadata() { + public Optional>> getMetadata() { return metadata; } @@ -90,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationResponseContent && equalTo((UpdateOrganizationResponseContent) other); @@ -110,12 +111,12 @@ private boolean equalTo(UpdateOrganizationResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +135,7 @@ public static final class Builder { private Optional branding = Optional.empty(); - private Optional> metadata = Optional.empty(); + private Optional>> metadata = Optional.empty(); private Optional tokenQuota = Optional.empty(); @@ -207,12 +208,12 @@ public Builder branding(OrganizationBranding branding) { } @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional> metadata) { + public Builder metadata(Optional>> metadata) { this.metadata = metadata; return this; } - public Builder metadata(Map metadata) { + public Builder metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java index 9ed20af9c..27b150067 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdatePhoneTemplateResponseContent @@ -116,13 +116,13 @@ private boolean equalTo(UpdatePhoneTemplateResponseContent other) { && disabled == other.disabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @java.lang.Override + @Override public Builder from(UpdatePhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -201,21 +201,21 @@ public Builder from(UpdatePhoneTemplateResponseContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -227,53 +227,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @java.lang.Override + @Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @java.lang.Override + @Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @java.lang.Override + @Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @java.lang.Override + @Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @java.lang.Override + @Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @java.lang.Override + @Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @java.lang.Override + @Override public UpdatePhoneTemplateResponseContent build() { return new UpdatePhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java index 71609de05..8b6490566 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java @@ -50,6 +50,8 @@ public final class UpdateResourceServerRequestContent { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + private final Map additionalProperties; private UpdateResourceServerRequestContent( @@ -66,6 +68,7 @@ private UpdateResourceServerRequestContent( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, Map additionalProperties) { this.name = name; this.scopes = scopes; @@ -80,6 +83,7 @@ private UpdateResourceServerRequestContent( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; this.additionalProperties = additionalProperties; } @@ -181,6 +185,11 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -199,7 +208,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateResourceServerRequestContent @@ -224,10 +233,11 @@ private boolean equalTo(UpdateResourceServerRequestContent other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, @@ -242,10 +252,11 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -282,6 +293,8 @@ public static final class Builder { private OptionalNullable proofOfPossession = OptionalNullable.absent(); + private Optional subjectTypeAuthorization = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -301,6 +314,7 @@ public Builder from(UpdateResourceServerRequestContent other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); return this; } @@ -533,6 +547,18 @@ public Builder proofOfPossession( return this; } + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + public UpdateResourceServerRequestContent build() { return new UpdateResourceServerRequestContent( name, @@ -548,6 +574,7 @@ public UpdateResourceServerRequestContent build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java index 693d2cc46..c00f5310a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java @@ -58,6 +58,10 @@ public final class UpdateResourceServerResponseContent { private final OptionalNullable proofOfPossession; + private final Optional subjectTypeAuthorization; + + private final Optional clientId; + private final Map additionalProperties; private UpdateResourceServerResponseContent( @@ -78,6 +82,8 @@ private UpdateResourceServerResponseContent( OptionalNullable consentPolicy, Optional> authorizationDetails, OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, + Optional clientId, Map additionalProperties) { this.id = id; this.name = name; @@ -96,6 +102,8 @@ private UpdateResourceServerResponseContent( this.consentPolicy = consentPolicy; this.authorizationDetails = authorizationDetails; this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; + this.clientId = clientId; this.additionalProperties = additionalProperties; } @@ -229,6 +237,19 @@ public OptionalNullable getProofOfPossession() return proofOfPossession; } + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + + /** + * @return The client ID of the client that this resource server is linked to + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -247,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateResourceServerResponseContent @@ -276,10 +297,12 @@ private boolean equalTo(UpdateResourceServerResponseContent other) { && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) && authorizationDetails.equals(other.authorizationDetails) - && proofOfPossession.equals(other.proofOfPossession); + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization) + && clientId.equals(other.clientId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -298,10 +321,12 @@ public int hashCode() { this.tokenEncryption, this.consentPolicy, this.authorizationDetails, - this.proofOfPossession); + this.proofOfPossession, + this.subjectTypeAuthorization, + this.clientId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -346,6 +371,10 @@ public static final class Builder { private OptionalNullable proofOfPossession = OptionalNullable.absent(); + private Optional subjectTypeAuthorization = Optional.empty(); + + private Optional clientId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -369,6 +398,8 @@ public Builder from(UpdateResourceServerResponseContent other) { consentPolicy(other.getConsentPolicy()); authorizationDetails(other.getAuthorizationDetails()); proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); + clientId(other.getClientId()); return this; } @@ -657,6 +688,32 @@ public Builder proofOfPossession( return this; } + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + /** + *

The client ID of the client that this resource server is linked to

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + public UpdateResourceServerResponseContent build() { return new UpdateResourceServerResponseContent( id, @@ -676,6 +733,8 @@ public UpdateResourceServerResponseContent build() { consentPolicy, authorizationDetails, proofOfPossession, + subjectTypeAuthorization, + clientId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java new file mode 100644 index 000000000..35dacc902 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRiskAssessmentsSettingsNewDeviceResponseContent.Builder.class) +public final class UpdateRiskAssessmentsSettingsNewDeviceResponseContent { + private final int rememberFor; + + private final Map additionalProperties; + + private UpdateRiskAssessmentsSettingsNewDeviceResponseContent( + int rememberFor, Map additionalProperties) { + this.rememberFor = rememberFor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Length of time to remember devices for, in days. + */ + @JsonProperty("remember_for") + public int getRememberFor() { + return rememberFor; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRiskAssessmentsSettingsNewDeviceResponseContent + && equalTo((UpdateRiskAssessmentsSettingsNewDeviceResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRiskAssessmentsSettingsNewDeviceResponseContent other) { + return rememberFor == other.rememberFor; + } + + @Override + public int hashCode() { + return Objects.hash(this.rememberFor); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RememberForStage builder() { + return new Builder(); + } + + public interface RememberForStage { + /** + *

Length of time to remember devices for, in days.

+ */ + _FinalStage rememberFor(int rememberFor); + + Builder from(UpdateRiskAssessmentsSettingsNewDeviceResponseContent other); + } + + public interface _FinalStage { + UpdateRiskAssessmentsSettingsNewDeviceResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RememberForStage, _FinalStage { + private int rememberFor; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateRiskAssessmentsSettingsNewDeviceResponseContent other) { + rememberFor(other.getRememberFor()); + return this; + } + + /** + *

Length of time to remember devices for, in days.

+ *

Length of time to remember devices for, in days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("remember_for") + public _FinalStage rememberFor(int rememberFor) { + this.rememberFor = rememberFor; + return this; + } + + @Override + public UpdateRiskAssessmentsSettingsNewDeviceResponseContent build() { + return new UpdateRiskAssessmentsSettingsNewDeviceResponseContent(rememberFor, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java new file mode 100644 index 000000000..29e065376 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRiskAssessmentsSettingsResponseContent.Builder.class) +public final class UpdateRiskAssessmentsSettingsResponseContent { + private final boolean enabled; + + private final Map additionalProperties; + + private UpdateRiskAssessmentsSettingsResponseContent(boolean enabled, Map additionalProperties) { + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether or not risk assessment is enabled. + */ + @JsonProperty("enabled") + public boolean getEnabled() { + return enabled; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRiskAssessmentsSettingsResponseContent + && equalTo((UpdateRiskAssessmentsSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRiskAssessmentsSettingsResponseContent other) { + return enabled == other.enabled; + } + + @Override + public int hashCode() { + return Objects.hash(this.enabled); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnabledStage builder() { + return new Builder(); + } + + public interface EnabledStage { + /** + *

Whether or not risk assessment is enabled.

+ */ + _FinalStage enabled(boolean enabled); + + Builder from(UpdateRiskAssessmentsSettingsResponseContent other); + } + + public interface _FinalStage { + UpdateRiskAssessmentsSettingsResponseContent build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnabledStage, _FinalStage { + private boolean enabled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UpdateRiskAssessmentsSettingsResponseContent other) { + enabled(other.getEnabled()); + return this; + } + + /** + *

Whether or not risk assessment is enabled.

+ *

Whether or not risk assessment is enabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("enabled") + public _FinalStage enabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + @Override + public UpdateRiskAssessmentsSettingsResponseContent build() { + return new UpdateRiskAssessmentsSettingsResponseContent(enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java index b2295388d..5d1cd96ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java @@ -49,7 +49,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRoleRequestContent && equalTo((UpdateRoleRequestContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(UpdateRoleRequestContent other) { return name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java index 030113ea9..b63ab59da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRoleResponseContent && equalTo((UpdateRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(UpdateRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java index a2ea28daf..bf910af29 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java @@ -75,7 +75,7 @@ public Optional getEnabled() { return enabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRuleRequestContent && equalTo((UpdateRuleRequestContent) other); @@ -93,12 +93,12 @@ private boolean equalTo(UpdateRuleRequestContent other) { && enabled.equals(other.enabled); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.script, this.name, this.order, this.enabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java index 3705f0238..d02e8365e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRuleResponseContent && equalTo((UpdateRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(UpdateRuleResponseContent other) { && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java index 14fcbb308..04b6a6d0c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(UpdateScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java index 1c06feeb8..756b500df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java @@ -34,6 +34,8 @@ public final class UpdateSelfServiceProfileRequestContent { private final OptionalNullable> userAttributes; + private final OptionalNullable userAttributeProfileId; + private final Map additionalProperties; private UpdateSelfServiceProfileRequestContent( @@ -42,12 +44,14 @@ private UpdateSelfServiceProfileRequestContent( OptionalNullable branding, Optional> allowedStrategies, OptionalNullable> userAttributes, + OptionalNullable userAttributeProfileId, Map additionalProperties) { this.name = name; this.description = description; this.branding = branding; this.allowedStrategies = allowedStrategies; this.userAttributes = userAttributes; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -91,6 +95,18 @@ public OptionalNullable> getUserAttributes return userAttributes; } + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_attribute_profile_id") + public OptionalNullable getUserAttributeProfileId() { + if (userAttributeProfileId == null) { + return OptionalNullable.absent(); + } + return userAttributeProfileId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("description") private OptionalNullable _getDescription() { @@ -103,7 +119,13 @@ private OptionalNullable> _getUserAttribut return userAttributes; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_attribute_profile_id") + private OptionalNullable _getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSelfServiceProfileRequestContent @@ -120,15 +142,22 @@ private boolean equalTo(UpdateSelfServiceProfileRequestContent other) { && description.equals(other.description) && branding.equals(other.branding) && allowedStrategies.equals(other.allowedStrategies) - && userAttributes.equals(other.userAttributes); + && userAttributes.equals(other.userAttributes) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { - return Objects.hash(this.name, this.description, this.branding, this.allowedStrategies, this.userAttributes); + return Objects.hash( + this.name, + this.description, + this.branding, + this.allowedStrategies, + this.userAttributes, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,6 +178,8 @@ public static final class Builder { private OptionalNullable> userAttributes = OptionalNullable.absent(); + private OptionalNullable userAttributeProfileId = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -160,6 +191,7 @@ public Builder from(UpdateSelfServiceProfileRequestContent other) { branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); userAttributes(other.getUserAttributes()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -286,9 +318,49 @@ public Builder userAttributes( return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public Builder userAttributeProfileId(@Nullable OptionalNullable userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + + public Builder userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId); + return this; + } + + public Builder userAttributeProfileId(Optional userAttributeProfileId) { + if (userAttributeProfileId.isPresent()) { + this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId.get()); + } else { + this.userAttributeProfileId = OptionalNullable.absent(); + } + return this; + } + + public Builder userAttributeProfileId(com.auth0.client.mgmt.core.Nullable userAttributeProfileId) { + if (userAttributeProfileId.isNull()) { + this.userAttributeProfileId = OptionalNullable.ofNull(); + } else if (userAttributeProfileId.isEmpty()) { + this.userAttributeProfileId = OptionalNullable.absent(); + } else { + this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId.get()); + } + return this; + } + public UpdateSelfServiceProfileRequestContent build() { return new UpdateSelfServiceProfileRequestContent( - name, description, branding, allowedStrategies, userAttributes, additionalProperties); + name, + description, + branding, + allowedStrategies, + userAttributes, + userAttributeProfileId, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java index f76becbb6..53666d300 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java @@ -38,6 +38,8 @@ public final class UpdateSelfServiceProfileResponseContent { private final Optional> allowedStrategies; + private final Optional userAttributeProfileId; + private final Map additionalProperties; private UpdateSelfServiceProfileResponseContent( @@ -49,6 +51,7 @@ private UpdateSelfServiceProfileResponseContent( Optional updatedAt, Optional branding, Optional> allowedStrategies, + Optional userAttributeProfileId, Map additionalProperties) { this.id = id; this.name = name; @@ -58,6 +61,7 @@ private UpdateSelfServiceProfileResponseContent( this.updatedAt = updatedAt; this.branding = branding; this.allowedStrategies = allowedStrategies; + this.userAttributeProfileId = userAttributeProfileId; this.additionalProperties = additionalProperties; } @@ -122,7 +126,15 @@ public Optional> getAllowedStrategie return allowedStrategies; } - @java.lang.Override + /** + * @return ID of the user-attribute-profile to associate with this self-service profile. + */ + @JsonProperty("user_attribute_profile_id") + public Optional getUserAttributeProfileId() { + return userAttributeProfileId; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSelfServiceProfileResponseContent @@ -142,10 +154,11 @@ private boolean equalTo(UpdateSelfServiceProfileResponseContent other) { && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && branding.equals(other.branding) - && allowedStrategies.equals(other.allowedStrategies); + && allowedStrategies.equals(other.allowedStrategies) + && userAttributeProfileId.equals(other.userAttributeProfileId); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -155,10 +168,11 @@ public int hashCode() { this.createdAt, this.updatedAt, this.branding, - this.allowedStrategies); + this.allowedStrategies, + this.userAttributeProfileId); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -185,6 +199,8 @@ public static final class Builder { private Optional> allowedStrategies = Optional.empty(); + private Optional userAttributeProfileId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -199,6 +215,7 @@ public Builder from(UpdateSelfServiceProfileResponseContent other) { updatedAt(other.getUpdatedAt()); branding(other.getBranding()); allowedStrategies(other.getAllowedStrategies()); + userAttributeProfileId(other.getUserAttributeProfileId()); return this; } @@ -311,6 +328,20 @@ public Builder allowedStrategies(List all return this; } + /** + *

ID of the user-attribute-profile to associate with this self-service profile.

+ */ + @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) + public Builder userAttributeProfileId(Optional userAttributeProfileId) { + this.userAttributeProfileId = userAttributeProfileId; + return this; + } + + public Builder userAttributeProfileId(String userAttributeProfileId) { + this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); + return this; + } + public UpdateSelfServiceProfileResponseContent build() { return new UpdateSelfServiceProfileResponseContent( id, @@ -321,6 +352,7 @@ public UpdateSelfServiceProfileResponseContent build() { updatedAt, branding, allowedStrategies, + userAttributeProfileId, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java new file mode 100644 index 000000000..77f59ef29 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSessionRequestContent.Builder.class) +public final class UpdateSessionRequestContent { + private final OptionalNullable> sessionMetadata; + + private final Map additionalProperties; + + private UpdateSessionRequestContent( + OptionalNullable> sessionMetadata, Map additionalProperties) { + this.sessionMetadata = sessionMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + public OptionalNullable> getSessionMetadata() { + if (sessionMetadata == null) { + return OptionalNullable.absent(); + } + return sessionMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + private OptionalNullable> _getSessionMetadata() { + return sessionMetadata; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSessionRequestContent && equalTo((UpdateSessionRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSessionRequestContent other) { + return sessionMetadata.equals(other.sessionMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(this.sessionMetadata); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable> sessionMetadata = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSessionRequestContent other) { + sessionMetadata(other.getSessionMetadata()); + return this; + } + + @JsonSetter(value = "session_metadata", nulls = Nulls.SKIP) + public Builder sessionMetadata(@Nullable OptionalNullable> sessionMetadata) { + this.sessionMetadata = sessionMetadata; + return this; + } + + public Builder sessionMetadata(Map sessionMetadata) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata); + return this; + } + + public Builder sessionMetadata(Optional> sessionMetadata) { + if (sessionMetadata.isPresent()) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } else { + this.sessionMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionMetadata(com.auth0.client.mgmt.core.Nullable> sessionMetadata) { + if (sessionMetadata.isNull()) { + this.sessionMetadata = OptionalNullable.ofNull(); + } else if (sessionMetadata.isEmpty()) { + this.sessionMetadata = OptionalNullable.absent(); + } else { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } + return this; + } + + public UpdateSessionRequestContent build() { + return new UpdateSessionRequestContent(sessionMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java new file mode 100644 index 000000000..7f24a0cea --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java @@ -0,0 +1,464 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSessionResponseContent.Builder.class) +public final class UpdateSessionResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional authenticatedAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional lastInteractedAt; + + private final Optional device; + + private final Optional> clients; + + private final Optional authentication; + + private final Optional cookie; + + private final OptionalNullable> sessionMetadata; + + private final Map additionalProperties; + + private UpdateSessionResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional updatedAt, + Optional authenticatedAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional lastInteractedAt, + Optional device, + Optional> clients, + Optional authentication, + Optional cookie, + OptionalNullable> sessionMetadata, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.authenticatedAt = authenticatedAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.lastInteractedAt = lastInteractedAt; + this.device = device; + this.clients = clients; + this.authentication = authentication; + this.cookie = cookie; + this.sessionMetadata = sessionMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the session + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @JsonProperty("authenticated_at") + public Optional getAuthenticatedAt() { + return authenticatedAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("last_interacted_at") + public Optional getLastInteractedAt() { + return lastInteractedAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return List of client details for the session + */ + @JsonProperty("clients") + public Optional> getClients() { + return clients; + } + + @JsonProperty("authentication") + public Optional getAuthentication() { + return authentication; + } + + @JsonProperty("cookie") + public Optional getCookie() { + return cookie; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + public OptionalNullable> getSessionMetadata() { + if (sessionMetadata == null) { + return OptionalNullable.absent(); + } + return sessionMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_metadata") + private OptionalNullable> _getSessionMetadata() { + return sessionMetadata; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSessionResponseContent && equalTo((UpdateSessionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSessionResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && authenticatedAt.equals(other.authenticatedAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && lastInteractedAt.equals(other.lastInteractedAt) + && device.equals(other.device) + && clients.equals(other.clients) + && authentication.equals(other.authentication) + && cookie.equals(other.cookie) + && sessionMetadata.equals(other.sessionMetadata); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.updatedAt, + this.authenticatedAt, + this.idleExpiresAt, + this.expiresAt, + this.lastInteractedAt, + this.device, + this.clients, + this.authentication, + this.cookie, + this.sessionMetadata); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional authenticatedAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional lastInteractedAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional> clients = Optional.empty(); + + private Optional authentication = Optional.empty(); + + private Optional cookie = Optional.empty(); + + private OptionalNullable> sessionMetadata = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSessionResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + authenticatedAt(other.getAuthenticatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + lastInteractedAt(other.getLastInteractedAt()); + device(other.getDevice()); + clients(other.getClients()); + authentication(other.getAuthentication()); + cookie(other.getCookie()); + sessionMetadata(other.getSessionMetadata()); + return this; + } + + /** + *

The ID of the session

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(SessionDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(SessionDate updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + @JsonSetter(value = "authenticated_at", nulls = Nulls.SKIP) + public Builder authenticatedAt(Optional authenticatedAt) { + this.authenticatedAt = authenticatedAt; + return this; + } + + public Builder authenticatedAt(SessionDate authenticatedAt) { + this.authenticatedAt = Optional.ofNullable(authenticatedAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(SessionDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(SessionDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "last_interacted_at", nulls = Nulls.SKIP) + public Builder lastInteractedAt(Optional lastInteractedAt) { + this.lastInteractedAt = lastInteractedAt; + return this; + } + + public Builder lastInteractedAt(SessionDate lastInteractedAt) { + this.lastInteractedAt = Optional.ofNullable(lastInteractedAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(SessionDeviceMetadata device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

List of client details for the session

+ */ + @JsonSetter(value = "clients", nulls = Nulls.SKIP) + public Builder clients(Optional> clients) { + this.clients = clients; + return this; + } + + public Builder clients(List clients) { + this.clients = Optional.ofNullable(clients); + return this; + } + + @JsonSetter(value = "authentication", nulls = Nulls.SKIP) + public Builder authentication(Optional authentication) { + this.authentication = authentication; + return this; + } + + public Builder authentication(SessionAuthenticationSignals authentication) { + this.authentication = Optional.ofNullable(authentication); + return this; + } + + @JsonSetter(value = "cookie", nulls = Nulls.SKIP) + public Builder cookie(Optional cookie) { + this.cookie = cookie; + return this; + } + + public Builder cookie(SessionCookieMetadata cookie) { + this.cookie = Optional.ofNullable(cookie); + return this; + } + + @JsonSetter(value = "session_metadata", nulls = Nulls.SKIP) + public Builder sessionMetadata(@Nullable OptionalNullable> sessionMetadata) { + this.sessionMetadata = sessionMetadata; + return this; + } + + public Builder sessionMetadata(Map sessionMetadata) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata); + return this; + } + + public Builder sessionMetadata(Optional> sessionMetadata) { + if (sessionMetadata.isPresent()) { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } else { + this.sessionMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionMetadata(com.auth0.client.mgmt.core.Nullable> sessionMetadata) { + if (sessionMetadata.isNull()) { + this.sessionMetadata = OptionalNullable.ofNull(); + } else if (sessionMetadata.isEmpty()) { + this.sessionMetadata = OptionalNullable.absent(); + } else { + this.sessionMetadata = OptionalNullable.of(sessionMetadata.get()); + } + return this; + } + + public UpdateSessionResponseContent build() { + return new UpdateSessionResponseContent( + id, + userId, + createdAt, + updatedAt, + authenticatedAt, + idleExpiresAt, + expiresAt, + lastInteractedAt, + device, + clients, + authentication, + cookie, + sessionMetadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java index 9dc1449b3..c77ee8333 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java @@ -83,7 +83,7 @@ private OptionalNullable _getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSettingsRequestContent && equalTo((UpdateSettingsRequestContent) other); @@ -100,12 +100,12 @@ private boolean equalTo(UpdateSettingsRequestContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java index 8acc2ed8e..f493ab576 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java @@ -60,7 +60,7 @@ public Optional getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSettingsResponseContent && equalTo((UpdateSettingsResponseContent) other); @@ -77,12 +77,12 @@ private boolean equalTo(UpdateSettingsResponseContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java index a7502a8fc..698325104 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java @@ -35,7 +35,7 @@ public boolean getAkamaiEnabled() { return akamaiEnabled; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSupplementalSignalsRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(UpdateSupplementalSignalsRequestContent other) { return akamaiEnabled == other.akamaiEnabled; } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements AkamaiEnabledStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateSupplementalSignalsRequestContent other) { akamaiEnabled(other.getAkamaiEnabled()); return this; @@ -98,14 +98,14 @@ public Builder from(UpdateSupplementalSignalsRequestContent other) { *

Indicates if incoming Akamai Headers should be processed

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("akamai_enabled") public _FinalStage akamaiEnabled(boolean akamaiEnabled) { this.akamaiEnabled = akamaiEnabled; return this; } - @java.lang.Override + @Override public UpdateSupplementalSignalsRequestContent build() { return new UpdateSupplementalSignalsRequestContent(akamaiEnabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java index 115a9ef00..51de9b2d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java @@ -71,7 +71,7 @@ public Optional getStage() { return stage; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSuspiciousIpThrottlingSettingsResponseContent @@ -90,12 +90,12 @@ private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsResponseContent othe && stage.equals(other.stage); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java index 7a01f31da..5593230ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java @@ -86,6 +86,10 @@ public final class UpdateTenantSettingsResponseContent { private final OptionalNullable authorizationResponseIssParameterSupported; + private final OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt; + + private final Optional resourceParameterProfile; + private final Map additionalProperties; private UpdateTenantSettingsResponseContent( @@ -120,6 +124,8 @@ private UpdateTenantSettingsResponseContent( OptionalNullable mtls, Optional pushedAuthorizationRequestsSupported, OptionalNullable authorizationResponseIssParameterSupported, + OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, + Optional resourceParameterProfile, Map additionalProperties) { this.changePassword = changePassword; this.guardianMfaPage = guardianMfaPage; @@ -152,6 +158,8 @@ private UpdateTenantSettingsResponseContent( this.mtls = mtls; this.pushedAuthorizationRequestsSupported = pushedAuthorizationRequestsSupported; this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + this.resourceParameterProfile = resourceParameterProfile; this.additionalProperties = additionalProperties; } @@ -409,6 +417,25 @@ public OptionalNullable getAuthorizationResponseIssParameterSupported() return authorizationResponseIssParameterSupported; } + /** + * @return Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + public OptionalNullable getSkipNonVerifiableCallbackUriConfirmationPrompt() { + if (skipNonVerifiableCallbackUriConfirmationPrompt == null) { + return OptionalNullable.absent(); + } + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @JsonProperty("resource_parameter_profile") + public Optional getResourceParameterProfile() { + return resourceParameterProfile; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -463,7 +490,13 @@ private OptionalNullable _getAuthorizationResponseIssParameterSupported return authorizationResponseIssParameterSupported; } - @java.lang.Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("skip_non_verifiable_callback_uri_confirmation_prompt") + private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPrompt() { + return skipNonVerifiableCallbackUriConfirmationPrompt; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTenantSettingsResponseContent @@ -506,10 +539,13 @@ private boolean equalTo(UpdateTenantSettingsResponseContent other) { && acrValuesSupported.equals(other.acrValuesSupported) && mtls.equals(other.mtls) && pushedAuthorizationRequestsSupported.equals(other.pushedAuthorizationRequestsSupported) - && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported); + && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) + && skipNonVerifiableCallbackUriConfirmationPrompt.equals( + other.skipNonVerifiableCallbackUriConfirmationPrompt) + && resourceParameterProfile.equals(other.resourceParameterProfile); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.changePassword, @@ -542,10 +578,12 @@ public int hashCode() { this.acrValuesSupported, this.mtls, this.pushedAuthorizationRequestsSupported, - this.authorizationResponseIssParameterSupported); + this.authorizationResponseIssParameterSupported, + this.skipNonVerifiableCallbackUriConfirmationPrompt, + this.resourceParameterProfile); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -618,6 +656,10 @@ public static final class Builder { private OptionalNullable authorizationResponseIssParameterSupported = OptionalNullable.absent(); + private OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + + private Optional resourceParameterProfile = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -655,6 +697,8 @@ public Builder from(UpdateTenantSettingsResponseContent other) { mtls(other.getMtls()); pushedAuthorizationRequestsSupported(other.getPushedAuthorizationRequestsSupported()); authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); + skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); + resourceParameterProfile(other.getResourceParameterProfile()); return this; } @@ -1251,6 +1295,61 @@ public Builder authorizationResponseIssParameterSupported( return this; } + /** + *

Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as myapp://, or localhost). + * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. + * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

+ */ + @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + @Nullable OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt); + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + Optional skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isPresent()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } + return this; + } + + public Builder skipNonVerifiableCallbackUriConfirmationPrompt( + com.auth0.client.mgmt.core.Nullable skipNonVerifiableCallbackUriConfirmationPrompt) { + if (skipNonVerifiableCallbackUriConfirmationPrompt.isNull()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.ofNull(); + } else if (skipNonVerifiableCallbackUriConfirmationPrompt.isEmpty()) { + this.skipNonVerifiableCallbackUriConfirmationPrompt = OptionalNullable.absent(); + } else { + this.skipNonVerifiableCallbackUriConfirmationPrompt = + OptionalNullable.of(skipNonVerifiableCallbackUriConfirmationPrompt.get()); + } + return this; + } + + @JsonSetter(value = "resource_parameter_profile", nulls = Nulls.SKIP) + public Builder resourceParameterProfile( + Optional resourceParameterProfile) { + this.resourceParameterProfile = resourceParameterProfile; + return this; + } + + public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile resourceParameterProfile) { + this.resourceParameterProfile = Optional.ofNullable(resourceParameterProfile); + return this; + } + public UpdateTenantSettingsResponseContent build() { return new UpdateTenantSettingsResponseContent( changePassword, @@ -1284,6 +1383,8 @@ public UpdateTenantSettingsResponseContent build() { mtls, pushedAuthorizationRequestsSupported, authorizationResponseIssParameterSupported, + skipNonVerifiableCallbackUriConfirmationPrompt, + resourceParameterProfile, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java index d4253ec21..48f695546 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java @@ -49,7 +49,7 @@ public Optional getSubjectTokenType() { return subjectTokenType; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTokenExchangeProfileRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(UpdateTokenExchangeProfileRequestContent other) { return name.equals(other.name) && subjectTokenType.equals(other.subjectTokenType); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.subjectTokenType); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java index 809a005a2..8b6fa5259 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTokenQuota && equalTo((UpdateTokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(UpdateTokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateTokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @java.lang.Override + @Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @java.lang.Override + @Override public UpdateTokenQuota build() { return new UpdateTokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java index eca442c22..c0725965b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUniversalLoginTemplateRequestContent @@ -50,12 +50,12 @@ private boolean equalTo(UpdateUniversalLoginTemplateRequestContent other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer name; + + private final OptionalNullable userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private UpdateUserAttributeProfileRequestContent( + Optional name, + OptionalNullable userId, + Optional> userAttributes, + Map additionalProperties) { + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_id") + public OptionalNullable getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserAttributeProfileRequestContent + && equalTo((UpdateUserAttributeProfileRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserAttributeProfileRequestContent other) { + return name.equals(other.name) && userId.equals(other.userId) && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private OptionalNullable userId = OptionalNullable.absent(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateUserAttributeProfileRequestContent other) { + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(OptionalNullable userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = OptionalNullable.of(userId); + return this; + } + + public Builder userId(Optional userId) { + if (userId.isPresent()) { + this.userId = OptionalNullable.of(userId.get()); + } else { + this.userId = OptionalNullable.absent(); + } + return this; + } + + public Builder userId(Nullable userId) { + if (userId.isNull()) { + this.userId = OptionalNullable.ofNull(); + } else if (userId.isEmpty()) { + this.userId = OptionalNullable.absent(); + } else { + this.userId = OptionalNullable.of(userId.get()); + } + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public UpdateUserAttributeProfileRequestContent build() { + return new UpdateUserAttributeProfileRequestContent(name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserAttributeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAttributeProfileResponseContent.java new file mode 100644 index 000000000..9f7488bc5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAttributeProfileResponseContent.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateUserAttributeProfileResponseContent.Builder.class) +public final class UpdateUserAttributeProfileResponseContent { + private final Optional id; + + private final Optional name; + + private final Optional userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private UpdateUserAttributeProfileResponseContent( + Optional id, + Optional name, + Optional userId, + Optional> userAttributes, + Map additionalProperties) { + this.id = id; + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateUserAttributeProfileResponseContent + && equalTo((UpdateUserAttributeProfileResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateUserAttributeProfileResponseContent other) { + return id.equals(other.id) + && name.equals(other.name) + && userId.equals(other.userId) + && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateUserAttributeProfileResponseContent other) { + id(other.getId()); + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public UpdateUserAttributeProfileResponseContent build() { + return new UpdateUserAttributeProfileResponseContent( + id, name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java index bbb6fcfe1..8925b8e9b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserAuthenticationMethodResponseContent.java @@ -43,6 +43,8 @@ public final class UpdateUserAuthenticationMethodResponseContent { private final Optional publicKey; + private final Optional aaguid; + private final Optional relyingPartyIdentifier; private final Optional createdAt; @@ -60,6 +62,7 @@ private UpdateUserAuthenticationMethodResponseContent( Optional preferredAuthenticationMethod, Optional keyId, Optional publicKey, + Optional aaguid, Optional relyingPartyIdentifier, Optional createdAt, Map additionalProperties) { @@ -73,6 +76,7 @@ private UpdateUserAuthenticationMethodResponseContent( this.preferredAuthenticationMethod = preferredAuthenticationMethod; this.keyId = keyId; this.publicKey = publicKey; + this.aaguid = aaguid; this.relyingPartyIdentifier = relyingPartyIdentifier; this.createdAt = createdAt; this.additionalProperties = additionalProperties; @@ -149,6 +153,14 @@ public Optional getPublicKey() { return publicKey; } + /** + * @return Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier. + */ + @JsonProperty("aaguid") + public Optional getAaguid() { + return aaguid; + } + /** * @return Applies to webauthn authentication methods only. The relying party identifier. */ @@ -165,7 +177,7 @@ public Optional getCreatedAt() { return createdAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserAuthenticationMethodResponseContent @@ -188,11 +200,12 @@ private boolean equalTo(UpdateUserAuthenticationMethodResponseContent other) { && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod) && keyId.equals(other.keyId) && publicKey.equals(other.publicKey) + && aaguid.equals(other.aaguid) && relyingPartyIdentifier.equals(other.relyingPartyIdentifier) && createdAt.equals(other.createdAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -205,11 +218,12 @@ public int hashCode() { this.preferredAuthenticationMethod, this.keyId, this.publicKey, + this.aaguid, this.relyingPartyIdentifier, this.createdAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -285,6 +299,13 @@ _FinalStage preferredAuthenticationMethod( _FinalStage publicKey(String publicKey); + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + _FinalStage aaguid(Optional aaguid); + + _FinalStage aaguid(String aaguid); + /** *

Applies to webauthn authentication methods only. The relying party identifier.

*/ @@ -308,6 +329,8 @@ public static final class Builder implements TypeStage, _FinalStage { private Optional relyingPartyIdentifier = Optional.empty(); + private Optional aaguid = Optional.empty(); + private Optional publicKey = Optional.empty(); private Optional keyId = Optional.empty(); @@ -331,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(UpdateUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -343,12 +366,13 @@ public Builder from(UpdateUserAuthenticationMethodResponseContent other) { preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); keyId(other.getKeyId()); publicKey(other.getPublicKey()); + aaguid(other.getAaguid()); relyingPartyIdentifier(other.getRelyingPartyIdentifier()); createdAt(other.getCreatedAt()); return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -359,7 +383,7 @@ public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -368,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @java.lang.Override + @Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -379,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authentication methods only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -388,18 +412,38 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authentication methods only. The relying party identifier.

*/ - @java.lang.Override + @Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; return this; } + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage aaguid(String aaguid) { + this.aaguid = Optional.ofNullable(aaguid); + return this; + } + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + @Override + @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) + public _FinalStage aaguid(Optional aaguid) { + this.aaguid = aaguid; + return this; + } + /** *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -408,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -419,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -428,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The id of the credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -450,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -468,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -477,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -488,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -497,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -508,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -517,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @java.lang.Override + @Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -528,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -537,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -548,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -557,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @java.lang.Override + @Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @java.lang.Override + @Override public UpdateUserAuthenticationMethodResponseContent build() { return new UpdateUserAuthenticationMethodResponseContent( id, @@ -577,6 +621,7 @@ public UpdateUserAuthenticationMethodResponseContent build() { preferredAuthenticationMethod, keyId, publicKey, + aaguid, relyingPartyIdentifier, createdAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java index c6a627803..3df3bdba7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java @@ -330,7 +330,7 @@ private OptionalNullable _getUsername() { return username; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserRequestContent && equalTo((UpdateUserRequestContent) other); @@ -362,7 +362,7 @@ private boolean equalTo(UpdateUserRequestContent other) { && username.equals(other.username); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.blocked, @@ -385,7 +385,7 @@ public int hashCode() { this.username); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java index 8e5b12bc5..a1cba826d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserResponseContent && equalTo((UpdateUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(UpdateUserResponseContent other) { && familyName.equals(other.familyName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java index b89fbb1b7..5d23980b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(UpdateVerifiableCredentialTemplateResponseContent other) && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java new file mode 100644 index 000000000..63c8952ca --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfile.Builder.class) +public final class UserAttributeProfile { + private final Optional id; + + private final Optional name; + + private final Optional userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private UserAttributeProfile( + Optional id, + Optional name, + Optional userId, + Optional> userAttributes, + Map additionalProperties) { + this.id = id; + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfile && equalTo((UserAttributeProfile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfile other) { + return id.equals(other.id) + && name.equals(other.name) + && userId.equals(other.userId) + && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfile other) { + id(other.getId()); + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public UserAttributeProfile build() { + return new UserAttributeProfile(id, name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileOidcMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileOidcMapping.java new file mode 100644 index 000000000..6813eb4b7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileOidcMapping.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileOidcMapping.Builder.class) +public final class UserAttributeProfileOidcMapping { + private final String mapping; + + private final Optional displayName; + + private final Map additionalProperties; + + private UserAttributeProfileOidcMapping( + String mapping, Optional displayName, Map additionalProperties) { + this.mapping = mapping; + this.displayName = displayName; + this.additionalProperties = additionalProperties; + } + + /** + * @return OIDC mapping field + */ + @JsonProperty("mapping") + public String getMapping() { + return mapping; + } + + /** + * @return Display name for the OIDC mapping + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileOidcMapping && equalTo((UserAttributeProfileOidcMapping) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileOidcMapping other) { + return mapping.equals(other.mapping) && displayName.equals(other.displayName); + } + + @Override + public int hashCode() { + return Objects.hash(this.mapping, this.displayName); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MappingStage builder() { + return new Builder(); + } + + public interface MappingStage { + /** + *

OIDC mapping field

+ */ + _FinalStage mapping(@NotNull String mapping); + + Builder from(UserAttributeProfileOidcMapping other); + } + + public interface _FinalStage { + UserAttributeProfileOidcMapping build(); + + /** + *

Display name for the OIDC mapping

+ */ + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MappingStage, _FinalStage { + private String mapping; + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UserAttributeProfileOidcMapping other) { + mapping(other.getMapping()); + displayName(other.getDisplayName()); + return this; + } + + /** + *

OIDC mapping field

+ *

OIDC mapping field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("mapping") + public _FinalStage mapping(@NotNull String mapping) { + this.mapping = Objects.requireNonNull(mapping, "mapping must not be null"); + return this; + } + + /** + *

Display name for the OIDC mapping

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

Display name for the OIDC mapping

+ */ + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public UserAttributeProfileOidcMapping build() { + return new UserAttributeProfileOidcMapping(mapping, displayName, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java new file mode 100644 index 000000000..9126f7398 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileStrategyOverrides.Builder.class) +public final class UserAttributeProfileStrategyOverrides { + private final Optional pingfederate; + + private final Optional ad; + + private final Optional adfs; + + private final Optional waad; + + private final Optional googleApps; + + private final Optional okta; + + private final Optional oidc; + + private final Optional samlp; + + private final Map additionalProperties; + + private UserAttributeProfileStrategyOverrides( + Optional pingfederate, + Optional ad, + Optional adfs, + Optional waad, + Optional googleApps, + Optional okta, + Optional oidc, + Optional samlp, + Map additionalProperties) { + this.pingfederate = pingfederate; + this.ad = ad; + this.adfs = adfs; + this.waad = waad; + this.googleApps = googleApps; + this.okta = okta; + this.oidc = oidc; + this.samlp = samlp; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pingfederate") + public Optional getPingfederate() { + return pingfederate; + } + + @JsonProperty("ad") + public Optional getAd() { + return ad; + } + + @JsonProperty("adfs") + public Optional getAdfs() { + return adfs; + } + + @JsonProperty("waad") + public Optional getWaad() { + return waad; + } + + @JsonProperty("google-apps") + public Optional getGoogleApps() { + return googleApps; + } + + @JsonProperty("okta") + public Optional getOkta() { + return okta; + } + + @JsonProperty("oidc") + public Optional getOidc() { + return oidc; + } + + @JsonProperty("samlp") + public Optional getSamlp() { + return samlp; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileStrategyOverrides + && equalTo((UserAttributeProfileStrategyOverrides) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileStrategyOverrides other) { + return pingfederate.equals(other.pingfederate) + && ad.equals(other.ad) + && adfs.equals(other.adfs) + && waad.equals(other.waad) + && googleApps.equals(other.googleApps) + && okta.equals(other.okta) + && oidc.equals(other.oidc) + && samlp.equals(other.samlp); + } + + @Override + public int hashCode() { + return Objects.hash( + this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pingfederate = Optional.empty(); + + private Optional ad = Optional.empty(); + + private Optional adfs = Optional.empty(); + + private Optional waad = Optional.empty(); + + private Optional googleApps = Optional.empty(); + + private Optional okta = Optional.empty(); + + private Optional oidc = Optional.empty(); + + private Optional samlp = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileStrategyOverrides other) { + pingfederate(other.getPingfederate()); + ad(other.getAd()); + adfs(other.getAdfs()); + waad(other.getWaad()); + googleApps(other.getGoogleApps()); + okta(other.getOkta()); + oidc(other.getOidc()); + samlp(other.getSamlp()); + return this; + } + + @JsonSetter(value = "pingfederate", nulls = Nulls.SKIP) + public Builder pingfederate(Optional pingfederate) { + this.pingfederate = pingfederate; + return this; + } + + public Builder pingfederate(UserAttributeProfileStrategyOverridesMapping pingfederate) { + this.pingfederate = Optional.ofNullable(pingfederate); + return this; + } + + @JsonSetter(value = "ad", nulls = Nulls.SKIP) + public Builder ad(Optional ad) { + this.ad = ad; + return this; + } + + public Builder ad(UserAttributeProfileStrategyOverridesMapping ad) { + this.ad = Optional.ofNullable(ad); + return this; + } + + @JsonSetter(value = "adfs", nulls = Nulls.SKIP) + public Builder adfs(Optional adfs) { + this.adfs = adfs; + return this; + } + + public Builder adfs(UserAttributeProfileStrategyOverridesMapping adfs) { + this.adfs = Optional.ofNullable(adfs); + return this; + } + + @JsonSetter(value = "waad", nulls = Nulls.SKIP) + public Builder waad(Optional waad) { + this.waad = waad; + return this; + } + + public Builder waad(UserAttributeProfileStrategyOverridesMapping waad) { + this.waad = Optional.ofNullable(waad); + return this; + } + + @JsonSetter(value = "google-apps", nulls = Nulls.SKIP) + public Builder googleApps(Optional googleApps) { + this.googleApps = googleApps; + return this; + } + + public Builder googleApps(UserAttributeProfileStrategyOverridesMapping googleApps) { + this.googleApps = Optional.ofNullable(googleApps); + return this; + } + + @JsonSetter(value = "okta", nulls = Nulls.SKIP) + public Builder okta(Optional okta) { + this.okta = okta; + return this; + } + + public Builder okta(UserAttributeProfileStrategyOverridesMapping okta) { + this.okta = Optional.ofNullable(okta); + return this; + } + + @JsonSetter(value = "oidc", nulls = Nulls.SKIP) + public Builder oidc(Optional oidc) { + this.oidc = oidc; + return this; + } + + public Builder oidc(UserAttributeProfileStrategyOverridesMapping oidc) { + this.oidc = Optional.ofNullable(oidc); + return this; + } + + @JsonSetter(value = "samlp", nulls = Nulls.SKIP) + public Builder samlp(Optional samlp) { + this.samlp = samlp; + return this; + } + + public Builder samlp(UserAttributeProfileStrategyOverridesMapping samlp) { + this.samlp = Optional.ofNullable(samlp); + return this; + } + + public UserAttributeProfileStrategyOverrides build() { + return new UserAttributeProfileStrategyOverrides( + pingfederate, ad, adfs, waad, googleApps, okta, oidc, samlp, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java new file mode 100644 index 000000000..80e42eefa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileStrategyOverridesMapping.Builder.class) +public final class UserAttributeProfileStrategyOverridesMapping { + private final Optional oidcMapping; + + private final Optional> samlMapping; + + private final Optional scimMapping; + + private final Map additionalProperties; + + private UserAttributeProfileStrategyOverridesMapping( + Optional oidcMapping, + Optional> samlMapping, + Optional scimMapping, + Map additionalProperties) { + this.oidcMapping = oidcMapping; + this.samlMapping = samlMapping; + this.scimMapping = scimMapping; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("oidc_mapping") + public Optional getOidcMapping() { + return oidcMapping; + } + + @JsonProperty("saml_mapping") + public Optional> getSamlMapping() { + return samlMapping; + } + + /** + * @return SCIM mapping override for this strategy + */ + @JsonProperty("scim_mapping") + public Optional getScimMapping() { + return scimMapping; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileStrategyOverridesMapping + && equalTo((UserAttributeProfileStrategyOverridesMapping) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileStrategyOverridesMapping other) { + return oidcMapping.equals(other.oidcMapping) + && samlMapping.equals(other.samlMapping) + && scimMapping.equals(other.scimMapping); + } + + @Override + public int hashCode() { + return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional oidcMapping = Optional.empty(); + + private Optional> samlMapping = Optional.empty(); + + private Optional scimMapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileStrategyOverridesMapping other) { + oidcMapping(other.getOidcMapping()); + samlMapping(other.getSamlMapping()); + scimMapping(other.getScimMapping()); + return this; + } + + @JsonSetter(value = "oidc_mapping", nulls = Nulls.SKIP) + public Builder oidcMapping(Optional oidcMapping) { + this.oidcMapping = oidcMapping; + return this; + } + + public Builder oidcMapping(UserAttributeProfileOidcMapping oidcMapping) { + this.oidcMapping = Optional.ofNullable(oidcMapping); + return this; + } + + @JsonSetter(value = "saml_mapping", nulls = Nulls.SKIP) + public Builder samlMapping(Optional> samlMapping) { + this.samlMapping = samlMapping; + return this; + } + + public Builder samlMapping(List samlMapping) { + this.samlMapping = Optional.ofNullable(samlMapping); + return this; + } + + /** + *

SCIM mapping override for this strategy

+ */ + @JsonSetter(value = "scim_mapping", nulls = Nulls.SKIP) + public Builder scimMapping(Optional scimMapping) { + this.scimMapping = scimMapping; + return this; + } + + public Builder scimMapping(String scimMapping) { + this.scimMapping = Optional.ofNullable(scimMapping); + return this; + } + + public UserAttributeProfileStrategyOverridesMapping build() { + return new UserAttributeProfileStrategyOverridesMapping( + oidcMapping, samlMapping, scimMapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java new file mode 100644 index 000000000..48dfa688b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileStrategyOverridesUserId.Builder.class) +public final class UserAttributeProfileStrategyOverridesUserId { + private final Optional pingfederate; + + private final Optional ad; + + private final Optional adfs; + + private final Optional waad; + + private final Optional googleApps; + + private final Optional okta; + + private final Optional oidc; + + private final Optional samlp; + + private final Map additionalProperties; + + private UserAttributeProfileStrategyOverridesUserId( + Optional pingfederate, + Optional ad, + Optional adfs, + Optional waad, + Optional googleApps, + Optional okta, + Optional oidc, + Optional samlp, + Map additionalProperties) { + this.pingfederate = pingfederate; + this.ad = ad; + this.adfs = adfs; + this.waad = waad; + this.googleApps = googleApps; + this.okta = okta; + this.oidc = oidc; + this.samlp = samlp; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pingfederate") + public Optional getPingfederate() { + return pingfederate; + } + + @JsonProperty("ad") + public Optional getAd() { + return ad; + } + + @JsonProperty("adfs") + public Optional getAdfs() { + return adfs; + } + + @JsonProperty("waad") + public Optional getWaad() { + return waad; + } + + @JsonProperty("google-apps") + public Optional getGoogleApps() { + return googleApps; + } + + @JsonProperty("okta") + public Optional getOkta() { + return okta; + } + + @JsonProperty("oidc") + public Optional getOidc() { + return oidc; + } + + @JsonProperty("samlp") + public Optional getSamlp() { + return samlp; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileStrategyOverridesUserId + && equalTo((UserAttributeProfileStrategyOverridesUserId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileStrategyOverridesUserId other) { + return pingfederate.equals(other.pingfederate) + && ad.equals(other.ad) + && adfs.equals(other.adfs) + && waad.equals(other.waad) + && googleApps.equals(other.googleApps) + && okta.equals(other.okta) + && oidc.equals(other.oidc) + && samlp.equals(other.samlp); + } + + @Override + public int hashCode() { + return Objects.hash( + this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional pingfederate = Optional.empty(); + + private Optional ad = Optional.empty(); + + private Optional adfs = Optional.empty(); + + private Optional waad = Optional.empty(); + + private Optional googleApps = Optional.empty(); + + private Optional okta = Optional.empty(); + + private Optional oidc = Optional.empty(); + + private Optional samlp = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileStrategyOverridesUserId other) { + pingfederate(other.getPingfederate()); + ad(other.getAd()); + adfs(other.getAdfs()); + waad(other.getWaad()); + googleApps(other.getGoogleApps()); + okta(other.getOkta()); + oidc(other.getOidc()); + samlp(other.getSamlp()); + return this; + } + + @JsonSetter(value = "pingfederate", nulls = Nulls.SKIP) + public Builder pingfederate(Optional pingfederate) { + this.pingfederate = pingfederate; + return this; + } + + public Builder pingfederate(UserAttributeProfileStrategyOverridesUserIdMapping pingfederate) { + this.pingfederate = Optional.ofNullable(pingfederate); + return this; + } + + @JsonSetter(value = "ad", nulls = Nulls.SKIP) + public Builder ad(Optional ad) { + this.ad = ad; + return this; + } + + public Builder ad(UserAttributeProfileStrategyOverridesUserIdMapping ad) { + this.ad = Optional.ofNullable(ad); + return this; + } + + @JsonSetter(value = "adfs", nulls = Nulls.SKIP) + public Builder adfs(Optional adfs) { + this.adfs = adfs; + return this; + } + + public Builder adfs(UserAttributeProfileStrategyOverridesUserIdMapping adfs) { + this.adfs = Optional.ofNullable(adfs); + return this; + } + + @JsonSetter(value = "waad", nulls = Nulls.SKIP) + public Builder waad(Optional waad) { + this.waad = waad; + return this; + } + + public Builder waad(UserAttributeProfileStrategyOverridesUserIdMapping waad) { + this.waad = Optional.ofNullable(waad); + return this; + } + + @JsonSetter(value = "google-apps", nulls = Nulls.SKIP) + public Builder googleApps(Optional googleApps) { + this.googleApps = googleApps; + return this; + } + + public Builder googleApps(UserAttributeProfileStrategyOverridesUserIdMapping googleApps) { + this.googleApps = Optional.ofNullable(googleApps); + return this; + } + + @JsonSetter(value = "okta", nulls = Nulls.SKIP) + public Builder okta(Optional okta) { + this.okta = okta; + return this; + } + + public Builder okta(UserAttributeProfileStrategyOverridesUserIdMapping okta) { + this.okta = Optional.ofNullable(okta); + return this; + } + + @JsonSetter(value = "oidc", nulls = Nulls.SKIP) + public Builder oidc(Optional oidc) { + this.oidc = oidc; + return this; + } + + public Builder oidc(UserAttributeProfileStrategyOverridesUserIdMapping oidc) { + this.oidc = Optional.ofNullable(oidc); + return this; + } + + @JsonSetter(value = "samlp", nulls = Nulls.SKIP) + public Builder samlp(Optional samlp) { + this.samlp = samlp; + return this; + } + + public Builder samlp(UserAttributeProfileStrategyOverridesUserIdMapping samlp) { + this.samlp = Optional.ofNullable(samlp); + return this; + } + + public UserAttributeProfileStrategyOverridesUserId build() { + return new UserAttributeProfileStrategyOverridesUserId( + pingfederate, ad, adfs, waad, googleApps, okta, oidc, samlp, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java new file mode 100644 index 000000000..094adab11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileStrategyOverridesUserIdMapping.Builder.class) +public final class UserAttributeProfileStrategyOverridesUserIdMapping { + private final Optional oidcMapping; + + private final Optional> samlMapping; + + private final Optional scimMapping; + + private final Map additionalProperties; + + private UserAttributeProfileStrategyOverridesUserIdMapping( + Optional oidcMapping, + Optional> samlMapping, + Optional scimMapping, + Map additionalProperties) { + this.oidcMapping = oidcMapping; + this.samlMapping = samlMapping; + this.scimMapping = scimMapping; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("oidc_mapping") + public Optional getOidcMapping() { + return oidcMapping; + } + + @JsonProperty("saml_mapping") + public Optional> getSamlMapping() { + return samlMapping; + } + + /** + * @return SCIM mapping override for this strategy + */ + @JsonProperty("scim_mapping") + public Optional getScimMapping() { + return scimMapping; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileStrategyOverridesUserIdMapping + && equalTo((UserAttributeProfileStrategyOverridesUserIdMapping) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileStrategyOverridesUserIdMapping other) { + return oidcMapping.equals(other.oidcMapping) + && samlMapping.equals(other.samlMapping) + && scimMapping.equals(other.scimMapping); + } + + @Override + public int hashCode() { + return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional oidcMapping = Optional.empty(); + + private Optional> samlMapping = Optional.empty(); + + private Optional scimMapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileStrategyOverridesUserIdMapping other) { + oidcMapping(other.getOidcMapping()); + samlMapping(other.getSamlMapping()); + scimMapping(other.getScimMapping()); + return this; + } + + @JsonSetter(value = "oidc_mapping", nulls = Nulls.SKIP) + public Builder oidcMapping(Optional oidcMapping) { + this.oidcMapping = oidcMapping; + return this; + } + + public Builder oidcMapping(UserAttributeProfileUserIdOidcStrategyOverrideMapping oidcMapping) { + this.oidcMapping = Optional.ofNullable(oidcMapping); + return this; + } + + @JsonSetter(value = "saml_mapping", nulls = Nulls.SKIP) + public Builder samlMapping(Optional> samlMapping) { + this.samlMapping = samlMapping; + return this; + } + + public Builder samlMapping(List samlMapping) { + this.samlMapping = Optional.ofNullable(samlMapping); + return this; + } + + /** + *

SCIM mapping override for this strategy

+ */ + @JsonSetter(value = "scim_mapping", nulls = Nulls.SKIP) + public Builder scimMapping(Optional scimMapping) { + this.scimMapping = scimMapping; + return this; + } + + public Builder scimMapping(String scimMapping) { + this.scimMapping = Optional.ofNullable(scimMapping); + return this; + } + + public UserAttributeProfileStrategyOverridesUserIdMapping build() { + return new UserAttributeProfileStrategyOverridesUserIdMapping( + oidcMapping, samlMapping, scimMapping, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java new file mode 100644 index 000000000..676611321 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileTemplate.Builder.class) +public final class UserAttributeProfileTemplate { + private final Optional name; + + private final Optional userId; + + private final Optional> userAttributes; + + private final Map additionalProperties; + + private UserAttributeProfileTemplate( + Optional name, + Optional userId, + Optional> userAttributes, + Map additionalProperties) { + this.name = name; + this.userId = userId; + this.userAttributes = userAttributes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("user_attributes") + public Optional> getUserAttributes() { + return userAttributes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileTemplate && equalTo((UserAttributeProfileTemplate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileTemplate other) { + return name.equals(other.name) && userId.equals(other.userId) && userAttributes.equals(other.userAttributes); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.userId, this.userAttributes); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional> userAttributes = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileTemplate other) { + name(other.getName()); + userId(other.getUserId()); + userAttributes(other.getUserAttributes()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(UserAttributeProfileUserId userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) + public Builder userAttributes( + Optional> userAttributes) { + this.userAttributes = userAttributes; + return this; + } + + public Builder userAttributes( + Map userAttributes) { + this.userAttributes = Optional.ofNullable(userAttributes); + return this; + } + + public UserAttributeProfileTemplate build() { + return new UserAttributeProfileTemplate(name, userId, userAttributes, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplateItem.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplateItem.java new file mode 100644 index 000000000..02826017d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplateItem.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileTemplateItem.Builder.class) +public final class UserAttributeProfileTemplateItem { + private final Optional id; + + private final Optional displayName; + + private final Optional template; + + private final Map additionalProperties; + + private UserAttributeProfileTemplateItem( + Optional id, + Optional displayName, + Optional template, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.template = template; + this.additionalProperties = additionalProperties; + } + + /** + * @return The id of the template. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The user-friendly name of the template displayed in the UI. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("template") + public Optional getTemplate() { + return template; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileTemplateItem && equalTo((UserAttributeProfileTemplateItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileTemplateItem other) { + return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.displayName, this.template); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional template = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileTemplateItem other) { + id(other.getId()); + displayName(other.getDisplayName()); + template(other.getTemplate()); + return this; + } + + /** + *

The id of the template.

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

The user-friendly name of the template displayed in the UI.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "template", nulls = Nulls.SKIP) + public Builder template(Optional template) { + this.template = template; + return this; + } + + public Builder template(UserAttributeProfileTemplate template) { + this.template = Optional.ofNullable(template); + return this; + } + + public UserAttributeProfileTemplateItem build() { + return new UserAttributeProfileTemplateItem(id, displayName, template, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java new file mode 100644 index 000000000..039f8917e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java @@ -0,0 +1,375 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileUserAttributeAdditionalProperties.Builder.class) +public final class UserAttributeProfileUserAttributeAdditionalProperties { + private final String description; + + private final String label; + + private final boolean profileRequired; + + private final String auth0Mapping; + + private final Optional oidcMapping; + + private final Optional> samlMapping; + + private final Optional scimMapping; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private UserAttributeProfileUserAttributeAdditionalProperties( + String description, + String label, + boolean profileRequired, + String auth0Mapping, + Optional oidcMapping, + Optional> samlMapping, + Optional scimMapping, + Optional strategyOverrides, + Map additionalProperties) { + this.description = description; + this.label = label; + this.profileRequired = profileRequired; + this.auth0Mapping = auth0Mapping; + this.oidcMapping = oidcMapping; + this.samlMapping = samlMapping; + this.scimMapping = scimMapping; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + /** + * @return Description of this attribute + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Display label for this attribute + */ + @JsonProperty("label") + public String getLabel() { + return label; + } + + /** + * @return Whether this attribute is required in the profile + */ + @JsonProperty("profile_required") + public boolean getProfileRequired() { + return profileRequired; + } + + /** + * @return Auth0 mapping for this attribute + */ + @JsonProperty("auth0_mapping") + public String getAuth0Mapping() { + return auth0Mapping; + } + + @JsonProperty("oidc_mapping") + public Optional getOidcMapping() { + return oidcMapping; + } + + @JsonProperty("saml_mapping") + public Optional> getSamlMapping() { + return samlMapping; + } + + /** + * @return SCIM mapping for this attribute + */ + @JsonProperty("scim_mapping") + public Optional getScimMapping() { + return scimMapping; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileUserAttributeAdditionalProperties + && equalTo((UserAttributeProfileUserAttributeAdditionalProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileUserAttributeAdditionalProperties other) { + return description.equals(other.description) + && label.equals(other.label) + && profileRequired == other.profileRequired + && auth0Mapping.equals(other.auth0Mapping) + && oidcMapping.equals(other.oidcMapping) + && samlMapping.equals(other.samlMapping) + && scimMapping.equals(other.scimMapping) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash( + this.description, + this.label, + this.profileRequired, + this.auth0Mapping, + this.oidcMapping, + this.samlMapping, + this.scimMapping, + this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DescriptionStage builder() { + return new Builder(); + } + + public interface DescriptionStage { + /** + *

Description of this attribute

+ */ + LabelStage description(@NotNull String description); + + Builder from(UserAttributeProfileUserAttributeAdditionalProperties other); + } + + public interface LabelStage { + /** + *

Display label for this attribute

+ */ + ProfileRequiredStage label(@NotNull String label); + } + + public interface ProfileRequiredStage { + /** + *

Whether this attribute is required in the profile

+ */ + Auth0MappingStage profileRequired(boolean profileRequired); + } + + public interface Auth0MappingStage { + /** + *

Auth0 mapping for this attribute

+ */ + _FinalStage auth0Mapping(@NotNull String auth0Mapping); + } + + public interface _FinalStage { + UserAttributeProfileUserAttributeAdditionalProperties build(); + + _FinalStage oidcMapping(Optional oidcMapping); + + _FinalStage oidcMapping(UserAttributeProfileOidcMapping oidcMapping); + + _FinalStage samlMapping(Optional> samlMapping); + + _FinalStage samlMapping(List samlMapping); + + /** + *

SCIM mapping for this attribute

+ */ + _FinalStage scimMapping(Optional scimMapping); + + _FinalStage scimMapping(String scimMapping); + + _FinalStage strategyOverrides(Optional strategyOverrides); + + _FinalStage strategyOverrides(UserAttributeProfileStrategyOverrides strategyOverrides); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DescriptionStage, LabelStage, ProfileRequiredStage, Auth0MappingStage, _FinalStage { + private String description; + + private String label; + + private boolean profileRequired; + + private String auth0Mapping; + + private Optional strategyOverrides = Optional.empty(); + + private Optional scimMapping = Optional.empty(); + + private Optional> samlMapping = Optional.empty(); + + private Optional oidcMapping = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(UserAttributeProfileUserAttributeAdditionalProperties other) { + description(other.getDescription()); + label(other.getLabel()); + profileRequired(other.getProfileRequired()); + auth0Mapping(other.getAuth0Mapping()); + oidcMapping(other.getOidcMapping()); + samlMapping(other.getSamlMapping()); + scimMapping(other.getScimMapping()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + /** + *

Description of this attribute

+ *

Description of this attribute

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("description") + public LabelStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Display label for this attribute

+ *

Display label for this attribute

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("label") + public ProfileRequiredStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + /** + *

Whether this attribute is required in the profile

+ *

Whether this attribute is required in the profile

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("profile_required") + public Auth0MappingStage profileRequired(boolean profileRequired) { + this.profileRequired = profileRequired; + return this; + } + + /** + *

Auth0 mapping for this attribute

+ *

Auth0 mapping for this attribute

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("auth0_mapping") + public _FinalStage auth0Mapping(@NotNull String auth0Mapping) { + this.auth0Mapping = Objects.requireNonNull(auth0Mapping, "auth0Mapping must not be null"); + return this; + } + + @Override + public _FinalStage strategyOverrides(UserAttributeProfileStrategyOverrides strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + @Override + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public _FinalStage strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + /** + *

SCIM mapping for this attribute

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage scimMapping(String scimMapping) { + this.scimMapping = Optional.ofNullable(scimMapping); + return this; + } + + /** + *

SCIM mapping for this attribute

+ */ + @Override + @JsonSetter(value = "scim_mapping", nulls = Nulls.SKIP) + public _FinalStage scimMapping(Optional scimMapping) { + this.scimMapping = scimMapping; + return this; + } + + @Override + public _FinalStage samlMapping(List samlMapping) { + this.samlMapping = Optional.ofNullable(samlMapping); + return this; + } + + @Override + @JsonSetter(value = "saml_mapping", nulls = Nulls.SKIP) + public _FinalStage samlMapping(Optional> samlMapping) { + this.samlMapping = samlMapping; + return this; + } + + @Override + public _FinalStage oidcMapping(UserAttributeProfileOidcMapping oidcMapping) { + this.oidcMapping = Optional.ofNullable(oidcMapping); + return this; + } + + @Override + @JsonSetter(value = "oidc_mapping", nulls = Nulls.SKIP) + public _FinalStage oidcMapping(Optional oidcMapping) { + this.oidcMapping = oidcMapping; + return this; + } + + @Override + public UserAttributeProfileUserAttributeAdditionalProperties build() { + return new UserAttributeProfileUserAttributeAdditionalProperties( + description, + label, + profileRequired, + auth0Mapping, + oidcMapping, + samlMapping, + scimMapping, + strategyOverrides, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java new file mode 100644 index 000000000..8c8f39077 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserAttributeProfileUserId.Builder.class) +public final class UserAttributeProfileUserId { + private final Optional oidcMapping; + + private final Optional> samlMapping; + + private final Optional scimMapping; + + private final Optional strategyOverrides; + + private final Map additionalProperties; + + private UserAttributeProfileUserId( + Optional oidcMapping, + Optional> samlMapping, + Optional scimMapping, + Optional strategyOverrides, + Map additionalProperties) { + this.oidcMapping = oidcMapping; + this.samlMapping = samlMapping; + this.scimMapping = scimMapping; + this.strategyOverrides = strategyOverrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("oidc_mapping") + public Optional getOidcMapping() { + return oidcMapping; + } + + @JsonProperty("saml_mapping") + public Optional> getSamlMapping() { + return samlMapping; + } + + /** + * @return SCIM mapping for user ID + */ + @JsonProperty("scim_mapping") + public Optional getScimMapping() { + return scimMapping; + } + + @JsonProperty("strategy_overrides") + public Optional getStrategyOverrides() { + return strategyOverrides; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserAttributeProfileUserId && equalTo((UserAttributeProfileUserId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserAttributeProfileUserId other) { + return oidcMapping.equals(other.oidcMapping) + && samlMapping.equals(other.samlMapping) + && scimMapping.equals(other.scimMapping) + && strategyOverrides.equals(other.strategyOverrides); + } + + @Override + public int hashCode() { + return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping, this.strategyOverrides); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional oidcMapping = Optional.empty(); + + private Optional> samlMapping = Optional.empty(); + + private Optional scimMapping = Optional.empty(); + + private Optional strategyOverrides = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserAttributeProfileUserId other) { + oidcMapping(other.getOidcMapping()); + samlMapping(other.getSamlMapping()); + scimMapping(other.getScimMapping()); + strategyOverrides(other.getStrategyOverrides()); + return this; + } + + @JsonSetter(value = "oidc_mapping", nulls = Nulls.SKIP) + public Builder oidcMapping(Optional oidcMapping) { + this.oidcMapping = oidcMapping; + return this; + } + + public Builder oidcMapping(String oidcMapping) { + this.oidcMapping = Optional.ofNullable(oidcMapping); + return this; + } + + @JsonSetter(value = "saml_mapping", nulls = Nulls.SKIP) + public Builder samlMapping(Optional> samlMapping) { + this.samlMapping = samlMapping; + return this; + } + + public Builder samlMapping(List samlMapping) { + this.samlMapping = Optional.ofNullable(samlMapping); + return this; + } + + /** + *

SCIM mapping for user ID

+ */ + @JsonSetter(value = "scim_mapping", nulls = Nulls.SKIP) + public Builder scimMapping(Optional scimMapping) { + this.scimMapping = scimMapping; + return this; + } + + public Builder scimMapping(String scimMapping) { + this.scimMapping = Optional.ofNullable(scimMapping); + return this; + } + + @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) + public Builder strategyOverrides(Optional strategyOverrides) { + this.strategyOverrides = strategyOverrides; + return this; + } + + public Builder strategyOverrides(UserAttributeProfileStrategyOverridesUserId strategyOverrides) { + this.strategyOverrides = Optional.ofNullable(strategyOverrides); + return this; + } + + public UserAttributeProfileUserId build() { + return new UserAttributeProfileUserId( + oidcMapping, samlMapping, scimMapping, strategyOverrides, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java new file mode 100644 index 000000000..1f35dd770 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UserAttributeProfileUserIdOidcStrategyOverrideMapping { + public static final UserAttributeProfileUserIdOidcStrategyOverrideMapping EMAIL = + new UserAttributeProfileUserIdOidcStrategyOverrideMapping(Value.EMAIL, "email"); + + public static final UserAttributeProfileUserIdOidcStrategyOverrideMapping SUB = + new UserAttributeProfileUserIdOidcStrategyOverrideMapping(Value.SUB, "sub"); + + public static final UserAttributeProfileUserIdOidcStrategyOverrideMapping OID = + new UserAttributeProfileUserIdOidcStrategyOverrideMapping(Value.OID, "oid"); + + private final Value value; + + private final String string; + + UserAttributeProfileUserIdOidcStrategyOverrideMapping(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @Override + @JsonValue + public String toString() { + return this.string; + } + + @Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UserAttributeProfileUserIdOidcStrategyOverrideMapping + && this.string.equals(((UserAttributeProfileUserIdOidcStrategyOverrideMapping) other).string)); + } + + @Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMAIL: + return visitor.visitEmail(); + case SUB: + return visitor.visitSub(); + case OID: + return visitor.visitOid(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UserAttributeProfileUserIdOidcStrategyOverrideMapping valueOf(String value) { + switch (value) { + case "email": + return EMAIL; + case "sub": + return SUB; + case "oid": + return OID; + default: + return new UserAttributeProfileUserIdOidcStrategyOverrideMapping(Value.UNKNOWN, value); + } + } + + public enum Value { + SUB, + + OID, + + EMAIL, + + UNKNOWN + } + + public interface Visitor { + T visitSub(); + + T visitOid(); + + T visitEmail(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java index 5ac0e9415..0d72b090e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java @@ -59,6 +59,10 @@ public final class UserAuthenticationMethod { private final Optional userAgent; + private final Optional aaguid; + + private final Optional relyingPartyIdentifier; + private final Map additionalProperties; private UserAuthenticationMethod( @@ -80,6 +84,8 @@ private UserAuthenticationMethod( Optional credentialBackedUp, Optional identityUserId, Optional userAgent, + Optional aaguid, + Optional relyingPartyIdentifier, Map additionalProperties) { this.id = id; this.type = type; @@ -99,6 +105,8 @@ private UserAuthenticationMethod( this.credentialBackedUp = credentialBackedUp; this.identityUserId = identityUserId; this.userAgent = userAgent; + this.aaguid = aaguid; + this.relyingPartyIdentifier = relyingPartyIdentifier; this.additionalProperties = additionalProperties; } @@ -237,7 +245,23 @@ public Optional getUserAgent() { return userAgent; } - @java.lang.Override + /** + * @return Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier. + */ + @JsonProperty("aaguid") + public Optional getAaguid() { + return aaguid; + } + + /** + * @return Applies to webauthn/passkey authentication methods only. The credential's relying party identifier. + */ + @JsonProperty("relying_party_identifier") + public Optional getRelyingPartyIdentifier() { + return relyingPartyIdentifier; + } + + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAuthenticationMethod && equalTo((UserAuthenticationMethod) other); @@ -266,10 +290,12 @@ private boolean equalTo(UserAuthenticationMethod other) { && credentialDeviceType.equals(other.credentialDeviceType) && credentialBackedUp.equals(other.credentialBackedUp) && identityUserId.equals(other.identityUserId) - && userAgent.equals(other.userAgent); + && userAgent.equals(other.userAgent) + && aaguid.equals(other.aaguid) + && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -289,10 +315,12 @@ public int hashCode() { this.credentialDeviceType, this.credentialBackedUp, this.identityUserId, - this.userAgent); + this.userAgent, + this.aaguid, + this.relyingPartyIdentifier); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -423,6 +451,20 @@ _FinalStage preferredAuthenticationMethod( _FinalStage userAgent(Optional userAgent); _FinalStage userAgent(String userAgent); + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + _FinalStage aaguid(Optional aaguid); + + _FinalStage aaguid(String aaguid); + + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ */ + _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier); + + _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -433,6 +475,10 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private OffsetDateTime createdAt; + private Optional relyingPartyIdentifier = Optional.empty(); + + private Optional aaguid = Optional.empty(); + private Optional userAgent = Optional.empty(); private Optional identityUserId = Optional.empty(); @@ -468,7 +514,7 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private Builder() {} - @java.lang.Override + @Override public Builder from(UserAuthenticationMethod other) { id(other.getId()); type(other.getType()); @@ -488,6 +534,8 @@ public Builder from(UserAuthenticationMethod other) { credentialBackedUp(other.getCredentialBackedUp()); identityUserId(other.getIdentityUserId()); userAgent(other.getUserAgent()); + aaguid(other.getAaguid()); + relyingPartyIdentifier(other.getRelyingPartyIdentifier()); return this; } @@ -496,14 +544,14 @@ public Builder from(UserAuthenticationMethod other) { *

The ID of the authentication method (auto generated)

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("type") public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -515,18 +563,58 @@ public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { *

Authenticator creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("created_at") public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { + this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); + return this; + } + + /** + *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

+ */ + @Override + @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) + public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { + this.relyingPartyIdentifier = relyingPartyIdentifier; + return this; + } + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage aaguid(String aaguid) { + this.aaguid = Optional.ofNullable(aaguid); + return this; + } + + /** + *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

+ */ + @Override + @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) + public _FinalStage aaguid(Optional aaguid) { + this.aaguid = aaguid; + return this; + } + /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage userAgent(String userAgent) { this.userAgent = Optional.ofNullable(userAgent); return this; @@ -535,7 +623,7 @@ public _FinalStage userAgent(String userAgent) { /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

*/ - @java.lang.Override + @Override @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) public _FinalStage userAgent(Optional userAgent) { this.userAgent = userAgent; @@ -546,7 +634,7 @@ public _FinalStage userAgent(Optional userAgent) { *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage identityUserId(String identityUserId) { this.identityUserId = Optional.ofNullable(identityUserId); return this; @@ -555,7 +643,7 @@ public _FinalStage identityUserId(String identityUserId) { /** *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) public _FinalStage identityUserId(Optional identityUserId) { this.identityUserId = identityUserId; @@ -566,7 +654,7 @@ public _FinalStage identityUserId(Optional identityUserId) { *

Applies to passkeys only. Whether the credential was backed up.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); return this; @@ -575,7 +663,7 @@ public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { /** *

Applies to passkeys only. Whether the credential was backed up.

*/ - @java.lang.Override + @Override @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) public _FinalStage credentialBackedUp(Optional credentialBackedUp) { this.credentialBackedUp = credentialBackedUp; @@ -586,7 +674,7 @@ public _FinalStage credentialBackedUp(Optional credentialBackedUp) { *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage credentialDeviceType(String credentialDeviceType) { this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); return this; @@ -595,7 +683,7 @@ public _FinalStage credentialDeviceType(String credentialDeviceType) { /** *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

*/ - @java.lang.Override + @Override @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) public _FinalStage credentialDeviceType(Optional credentialDeviceType) { this.credentialDeviceType = credentialDeviceType; @@ -606,7 +694,7 @@ public _FinalStage credentialDeviceType(Optional credentialDeviceType) { *

Last authentication

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { this.lastAuthAt = Optional.ofNullable(lastAuthAt); return this; @@ -615,7 +703,7 @@ public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { /** *

Last authentication

*/ - @java.lang.Override + @Override @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) public _FinalStage lastAuthAt(Optional lastAuthAt) { this.lastAuthAt = lastAuthAt; @@ -626,7 +714,7 @@ public _FinalStage lastAuthAt(Optional lastAuthAt) { *

Enrollment date

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; @@ -635,7 +723,7 @@ public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { /** *

Enrollment date

*/ - @java.lang.Override + @Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -646,7 +734,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -655,7 +743,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -666,7 +754,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The ID of the generated credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -675,7 +763,7 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The ID of the generated credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; @@ -686,7 +774,7 @@ public _FinalStage keyId(Optional keyId) { *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -695,7 +783,7 @@ public _FinalStage email(String email) { /** *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -706,7 +794,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -715,7 +803,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -726,7 +814,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage linkId(String linkId) { this.linkId = Optional.ofNullable(linkId); return this; @@ -735,21 +823,21 @@ public _FinalStage linkId(String linkId) { /** *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

*/ - @java.lang.Override + @Override @JsonSetter(value = "link_id", nulls = Nulls.SKIP) public _FinalStage linkId(Optional linkId) { this.linkId = linkId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -757,13 +845,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @java.lang.Override + @Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @java.lang.Override + @Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -775,7 +863,7 @@ public _FinalStage authenticationMethods( *

A human-readable label to identify the authentication method

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -784,7 +872,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -795,7 +883,7 @@ public _FinalStage name(Optional name) { *

The authentication method status

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage confirmed(Boolean confirmed) { this.confirmed = Optional.ofNullable(confirmed); return this; @@ -804,14 +892,14 @@ public _FinalStage confirmed(Boolean confirmed) { /** *

The authentication method status

*/ - @java.lang.Override + @Override @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) public _FinalStage confirmed(Optional confirmed) { this.confirmed = confirmed; return this; } - @java.lang.Override + @Override public UserAuthenticationMethod build() { return new UserAuthenticationMethod( id, @@ -832,6 +920,8 @@ public UserAuthenticationMethod build() { credentialBackedUp, identityUserId, userAgent, + aaguid, + relyingPartyIdentifier, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java index 9893bebd1..7b21a0026 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java @@ -45,7 +45,7 @@ public Optional getId() { return id; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAuthenticationMethodProperties @@ -61,12 +61,12 @@ private boolean equalTo(UserAuthenticationMethodProperties other) { return type.equals(other.type) && id.equals(other.id); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.type, this.id); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java index 1ef03fe1a..6a2af871a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UserAuthenticationMethodPropertiesEnum && this.string.equals(((UserAuthenticationMethodPropertiesEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java index 1149c8ddd..d545ac3db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java @@ -63,7 +63,7 @@ public Optional getConnection() { return connection; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserBlockIdentifier && equalTo((UserBlockIdentifier) other); @@ -78,12 +78,12 @@ private boolean equalTo(UserBlockIdentifier other) { return identifier.equals(other.identifier) && ip.equals(other.ip) && connection.equals(other.connection); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifier, this.ip, this.connection); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java index 425e496ae..97caaf9e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserDateSchema && equalTo((UserDateSchema) other); @@ -51,12 +51,12 @@ private boolean equalTo(UserDateSchema other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(UserDateSchema.class); } - @java.lang.Override + @Override public UserDateSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java index 75512a03e..73d8e9a8f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UserEnrollmentAuthMethodEnum && this.string.equals(((UserEnrollmentAuthMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java index a79d4f33e..6cd45c564 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UserEnrollmentStatusEnum && this.string.equals(((UserEnrollmentStatusEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserGrant.java b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java index 4da8da77d..79df0ad0b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserGrant.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java @@ -88,7 +88,7 @@ public Optional> getScope() { return scope; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserGrant && equalTo((UserGrant) other); @@ -107,12 +107,12 @@ private boolean equalTo(UserGrant other) { && scope.equals(other.scope); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.id, this.clientId, this.userId, this.audience, this.scope); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java new file mode 100644 index 000000000..c75545b80 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java @@ -0,0 +1,461 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserGroupsResponseSchema.Builder.class) +public final class UserGroupsResponseSchema implements IGroup { + private final Optional id; + + private final Optional name; + + private final Optional externalId; + + private final Optional connectionId; + + private final OptionalNullable organizationId; + + private final Optional tenantName; + + private final OptionalNullable description; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Optional membershipCreatedAt; + + private final Map additionalProperties; + + private UserGroupsResponseSchema( + Optional id, + Optional name, + Optional externalId, + Optional connectionId, + OptionalNullable organizationId, + Optional tenantName, + OptionalNullable description, + Optional createdAt, + Optional updatedAt, + Optional membershipCreatedAt, + Map additionalProperties) { + this.id = id; + this.name = name; + this.externalId = externalId; + this.connectionId = connectionId; + this.organizationId = organizationId; + this.tenantName = tenantName; + this.description = description; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.membershipCreatedAt = membershipCreatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the group (service-generated). + */ + @JsonProperty("id") + @Override + public Optional getId() { + return id; + } + + /** + * @return Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters. + */ + @JsonProperty("name") + @Override + public Optional getName() { + return name; + } + + /** + * @return External identifier for the group, often used for SCIM synchronization. Max length of 256 characters. + */ + @JsonProperty("external_id") + @Override + public Optional getExternalId() { + return externalId; + } + + /** + * @return Identifier for the connection this group belongs to (if a connection group). + */ + @JsonProperty("connection_id") + @Override + public Optional getConnectionId() { + return connectionId; + } + + /** + * @return Identifier for the organization this group belongs to (if an organization group). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_id") + @Override + public OptionalNullable getOrganizationId() { + if (organizationId == null) { + return OptionalNullable.absent(); + } + return organizationId; + } + + /** + * @return Identifier for the tenant this group belongs to. + */ + @JsonProperty("tenant_name") + @Override + public Optional getTenantName() { + return tenantName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + @Override + public OptionalNullable getDescription() { + if (description == null) { + return OptionalNullable.absent(); + } + return description; + } + + /** + * @return Timestamp of when the group was created. + */ + @JsonProperty("created_at") + @Override + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return Timestamp of when the group was last updated. + */ + @JsonProperty("updated_at") + @Override + public Optional getUpdatedAt() { + return updatedAt; + } + + /** + * @return Timestamp of when the group membership was added. + */ + @JsonProperty("membership_created_at") + public Optional getMembershipCreatedAt() { + return membershipCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_id") + private OptionalNullable _getOrganizationId() { + return organizationId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private OptionalNullable _getDescription() { + return description; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserGroupsResponseSchema && equalTo((UserGroupsResponseSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserGroupsResponseSchema other) { + return id.equals(other.id) + && name.equals(other.name) + && externalId.equals(other.externalId) + && connectionId.equals(other.connectionId) + && organizationId.equals(other.organizationId) + && tenantName.equals(other.tenantName) + && description.equals(other.description) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) + && membershipCreatedAt.equals(other.membershipCreatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.externalId, + this.connectionId, + this.organizationId, + this.tenantName, + this.description, + this.createdAt, + this.updatedAt, + this.membershipCreatedAt); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional externalId = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private OptionalNullable organizationId = OptionalNullable.absent(); + + private Optional tenantName = Optional.empty(); + + private OptionalNullable description = OptionalNullable.absent(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional membershipCreatedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserGroupsResponseSchema other) { + id(other.getId()); + name(other.getName()); + externalId(other.getExternalId()); + connectionId(other.getConnectionId()); + organizationId(other.getOrganizationId()); + tenantName(other.getTenantName()); + description(other.getDescription()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + membershipCreatedAt(other.getMembershipCreatedAt()); + return this; + } + + /** + *

Unique identifier for the group (service-generated).

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

External identifier for the group, often used for SCIM synchronization. Max length of 256 characters.

+ */ + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public Builder externalId(Optional externalId) { + this.externalId = externalId; + return this; + } + + public Builder externalId(String externalId) { + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + *

Identifier for the connection this group belongs to (if a connection group).

+ */ + @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) + public Builder connectionId(Optional connectionId) { + this.connectionId = connectionId; + return this; + } + + public Builder connectionId(String connectionId) { + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + *

Identifier for the organization this group belongs to (if an organization group).

+ */ + @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) + public Builder organizationId(@Nullable OptionalNullable organizationId) { + this.organizationId = organizationId; + return this; + } + + public Builder organizationId(String organizationId) { + this.organizationId = OptionalNullable.of(organizationId); + return this; + } + + public Builder organizationId(Optional organizationId) { + if (organizationId.isPresent()) { + this.organizationId = OptionalNullable.of(organizationId.get()); + } else { + this.organizationId = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationId(com.auth0.client.mgmt.core.Nullable organizationId) { + if (organizationId.isNull()) { + this.organizationId = OptionalNullable.ofNull(); + } else if (organizationId.isEmpty()) { + this.organizationId = OptionalNullable.absent(); + } else { + this.organizationId = OptionalNullable.of(organizationId.get()); + } + return this; + } + + /** + *

Identifier for the tenant this group belongs to.

+ */ + @JsonSetter(value = "tenant_name", nulls = Nulls.SKIP) + public Builder tenantName(Optional tenantName) { + this.tenantName = tenantName; + return this; + } + + public Builder tenantName(String tenantName) { + this.tenantName = Optional.ofNullable(tenantName); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(@Nullable OptionalNullable description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = OptionalNullable.of(description); + return this; + } + + public Builder description(Optional description) { + if (description.isPresent()) { + this.description = OptionalNullable.of(description.get()); + } else { + this.description = OptionalNullable.absent(); + } + return this; + } + + public Builder description(com.auth0.client.mgmt.core.Nullable description) { + if (description.isNull()) { + this.description = OptionalNullable.ofNull(); + } else if (description.isEmpty()) { + this.description = OptionalNullable.absent(); + } else { + this.description = OptionalNullable.of(description.get()); + } + return this; + } + + /** + *

Timestamp of when the group was created.

+ */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

Timestamp of when the group was last updated.

+ */ + @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) + public Builder updatedAt(Optional updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + *

Timestamp of when the group membership was added.

+ */ + @JsonSetter(value = "membership_created_at", nulls = Nulls.SKIP) + public Builder membershipCreatedAt(Optional membershipCreatedAt) { + this.membershipCreatedAt = membershipCreatedAt; + return this; + } + + public Builder membershipCreatedAt(OffsetDateTime membershipCreatedAt) { + this.membershipCreatedAt = Optional.ofNullable(membershipCreatedAt); + return this; + } + + public UserGroupsResponseSchema build() { + return new UserGroupsResponseSchema( + id, + name, + externalId, + connectionId, + organizationId, + tenantName, + description, + createdAt, + updatedAt, + membershipCreatedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserId.java similarity index 74% rename from src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java rename to src/main/java/com/auth0/client/mgmt/types/UserId.java index 6105461b3..02d070dde 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserId.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = UserIdEnum.Deserializer.class) -public final class UserIdEnum { +@JsonDeserialize(using = UserId.Deserializer.class) +public final class UserId { private final Object value; private final int type; - private UserIdEnum(Object value, int type) { + private UserId(Object value, int type) { this.value = value; this.type = type; } @@ -39,32 +39,32 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof UserIdEnum && equalTo((UserIdEnum) other); + return other instanceof UserId && equalTo((UserId) other); } - private boolean equalTo(UserIdEnum other) { + private boolean equalTo(UserId other) { return value.equals(other.value); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.value); } - @java.lang.Override + @Override public String toString() { return this.value.toString(); } - public static UserIdEnum of(String value) { - return new UserIdEnum(value, 0); + public static UserId of(String value) { + return new UserId(value, 0); } - public static UserIdEnum of(int value) { - return new UserIdEnum(value, 1); + public static UserId of(int value) { + return new UserId(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(int value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(UserIdEnum.class); + super(UserId.class); } - @java.lang.Override - public UserIdEnum deserialize(JsonParser p, DeserializationContext context) throws IOException { + @Override + public UserId deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java index f46bdd222..640c6b7ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java @@ -23,7 +23,7 @@ public final class UserIdentity { private final String connection; - private final UserIdEnum userId; + private final UserId userId; private final String provider; @@ -41,7 +41,7 @@ public final class UserIdentity { private UserIdentity( String connection, - UserIdEnum userId, + UserId userId, String provider, Optional profileData, Optional isSocial, @@ -69,7 +69,7 @@ public String getConnection() { } @JsonProperty("user_id") - public UserIdEnum getUserId() { + public UserId getUserId() { return userId; } @@ -118,7 +118,7 @@ public Optional getRefreshToken() { return refreshToken; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserIdentity && equalTo((UserIdentity) other); @@ -140,7 +140,7 @@ private boolean equalTo(UserIdentity other) { && refreshToken.equals(other.refreshToken); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connection, @@ -153,7 +153,7 @@ public int hashCode() { this.refreshToken); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -172,7 +172,7 @@ public interface ConnectionStage { } public interface UserIdStage { - ProviderStage userId(@NotNull UserIdEnum userId); + ProviderStage userId(@NotNull UserId userId); } public interface ProviderStage { @@ -222,7 +222,7 @@ public interface _FinalStage { public static final class Builder implements ConnectionStage, UserIdStage, ProviderStage, _FinalStage { private String connection; - private UserIdEnum userId; + private UserId userId; private String provider; @@ -241,7 +241,7 @@ public static final class Builder implements ConnectionStage, UserIdStage, Provi private Builder() {} - @java.lang.Override + @Override public Builder from(UserIdentity other) { connection(other.getConnection()); userId(other.getUserId()); @@ -259,16 +259,16 @@ public Builder from(UserIdentity other) { *

Connection name of this identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("connection") public UserIdStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); return this; } - @java.lang.Override + @Override @JsonSetter("user_id") - public ProviderStage userId(@NotNull UserIdEnum userId) { + public ProviderStage userId(@NotNull UserId userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } @@ -278,7 +278,7 @@ public ProviderStage userId(@NotNull UserIdEnum userId) { *

Type of identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("provider") public _FinalStage provider(@NotNull String provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); @@ -289,7 +289,7 @@ public _FinalStage provider(@NotNull String provider) { *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage refreshToken(String refreshToken) { this.refreshToken = Optional.ofNullable(refreshToken); return this; @@ -298,7 +298,7 @@ public _FinalStage refreshToken(String refreshToken) { /** *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

*/ - @java.lang.Override + @Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(Optional refreshToken) { this.refreshToken = refreshToken; @@ -309,7 +309,7 @@ public _FinalStage refreshToken(Optional refreshToken) { *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage accessTokenSecret(String accessTokenSecret) { this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); return this; @@ -318,7 +318,7 @@ public _FinalStage accessTokenSecret(String accessTokenSecret) { /** *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

*/ - @java.lang.Override + @Override @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) public _FinalStage accessTokenSecret(Optional accessTokenSecret) { this.accessTokenSecret = accessTokenSecret; @@ -329,7 +329,7 @@ public _FinalStage accessTokenSecret(Optional accessTokenSecret) { *

IDP access token returned if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage accessToken(String accessToken) { this.accessToken = Optional.ofNullable(accessToken); return this; @@ -338,7 +338,7 @@ public _FinalStage accessToken(String accessToken) { /** *

IDP access token returned if scope read:user_idp_tokens is defined.

*/ - @java.lang.Override + @Override @JsonSetter(value = "access_token", nulls = Nulls.SKIP) public _FinalStage accessToken(Optional accessToken) { this.accessToken = accessToken; @@ -349,7 +349,7 @@ public _FinalStage accessToken(Optional accessToken) { *

Whether the identity provider is a social provider (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage isSocial(Boolean isSocial) { this.isSocial = Optional.ofNullable(isSocial); return this; @@ -358,27 +358,27 @@ public _FinalStage isSocial(Boolean isSocial) { /** *

Whether the identity provider is a social provider (true) or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) public _FinalStage isSocial(Optional isSocial) { this.isSocial = isSocial; return this; } - @java.lang.Override + @Override public _FinalStage profileData(UserProfileData profileData) { this.profileData = Optional.ofNullable(profileData); return this; } - @java.lang.Override + @Override @JsonSetter(value = "profileData", nulls = Nulls.SKIP) public _FinalStage profileData(Optional profileData) { this.profileData = profileData; return this; } - @java.lang.Override + @Override public UserIdentity build() { return new UserIdentity( connection, diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java index 79e3e233f..27657e27b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java @@ -159,20 +159,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UserIdentityProviderEnum && this.string.equals(((UserIdentityProviderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java index 794f19544..421d990cd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java @@ -117,7 +117,7 @@ public Optional getProfileData() { return profileData; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserIdentitySchema && equalTo((UserIdentitySchema) other); @@ -139,7 +139,7 @@ private boolean equalTo(UserIdentitySchema other) { && profileData.equals(other.profileData); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.connection, @@ -152,7 +152,7 @@ public int hashCode() { this.profileData); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java index 6cc6f997c..0e9507f30 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getLogs() { return logs; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserListLogOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(UserListLogOffsetPaginatedResponseContent other) { && logs.equals(other.logs); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java index 678d1a9c6..6ccdb672e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof UserMultifactorProviderEnum && this.string.equals(((UserMultifactorProviderEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java index 0bd26cc73..269b63137 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java @@ -75,7 +75,7 @@ public Optional getDescription() { return description; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserPermissionSchema && equalTo((UserPermissionSchema) other); @@ -93,13 +93,13 @@ private boolean equalTo(UserPermissionSchema other) { && description.equals(other.description); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java index e76d8a547..e826c5a1c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java @@ -123,7 +123,7 @@ public Optional getFamilyName() { return familyName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserProfileData && equalTo((UserProfileData) other); @@ -145,7 +145,7 @@ private boolean equalTo(UserProfileData other) { && familyName.equals(other.familyName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.email, @@ -158,7 +158,7 @@ public int hashCode() { this.familyName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java index e177e50d5..9ac8208c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserResponseSchema && equalTo((UserResponseSchema) other); @@ -300,7 +300,7 @@ private boolean equalTo(UserResponseSchema other) { && familyName.equals(other.familyName); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java index fd678fdb8..06806d803 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java @@ -43,7 +43,7 @@ public Optional getPhoneNumber() { return phoneNumber; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameAllowedTypes && equalTo((UsernameAllowedTypes) other); @@ -58,12 +58,12 @@ private boolean equalTo(UsernameAllowedTypes other) { return email.equals(other.email) && phoneNumber.equals(other.phoneNumber); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.email, this.phoneNumber); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java index 81d7ee07d..cd54a4829 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java @@ -66,7 +66,7 @@ public Optional getValidation() { return validation; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameAttribute && equalTo((UsernameAttribute) other); @@ -84,12 +84,12 @@ private boolean equalTo(UsernameAttribute other) { && validation.equals(other.validation); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.identifier, this.profileRequired, this.signup, this.validation); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java index d8070e03b..94c458011 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java @@ -60,7 +60,7 @@ public Optional getAllowedTypes() { return allowedTypes; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameValidation && equalTo((UsernameValidation) other); @@ -77,12 +77,12 @@ private boolean equalTo(UsernameValidation other) { && allowedTypes.equals(other.allowedTypes); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.minLength, this.maxLength, this.allowedTypes); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java index 17c5706ff..ec8535e4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java @@ -130,7 +130,7 @@ public Optional getLastAuth() { return lastAuth; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsersEnrollment && equalTo((UsersEnrollment) other); @@ -153,7 +153,7 @@ private boolean equalTo(UsersEnrollment other) { && lastAuth.equals(other.lastAuth); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -167,7 +167,7 @@ public int hashCode() { this.lastAuth); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java index 068589170..270888a98 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifiableCredentialTemplateResponse @@ -157,7 +157,7 @@ private boolean equalTo(VerifiableCredentialTemplateResponse other) { && updatedAt.equals(other.updatedAt); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java index ce611f898..f033879c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @java.lang.Override + @Override @JsonValue public String toString() { return this.string; } - @java.lang.Override + @Override public boolean equals(Object other) { return (this == other) || (other instanceof VerificationMethodEnum && this.string.equals(((VerificationMethodEnum) other).string)); } - @java.lang.Override + @Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java index fe90c7da3..88d9c2c68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java @@ -30,6 +30,8 @@ public final class VerifyCustomDomainResponseContent { private final boolean primary; + private final CustomDomainStatusFilterEnum status; + private final CustomDomainTypeEnum type; private final Optional cnameApiKey; @@ -42,28 +44,38 @@ public final class VerifyCustomDomainResponseContent { private final Optional tlsPolicy; + private final Optional>> domainMetadata; + + private final Optional certificate; + private final Map additionalProperties; private VerifyCustomDomainResponseContent( String customDomainId, String domain, boolean primary, + CustomDomainStatusFilterEnum status, CustomDomainTypeEnum type, Optional cnameApiKey, Optional originDomainName, Optional verification, OptionalNullable customClientIpHeader, Optional tlsPolicy, + Optional>> domainMetadata, + Optional certificate, Map additionalProperties) { this.customDomainId = customDomainId; this.domain = domain; this.primary = primary; + this.status = status; this.type = type; this.cnameApiKey = cnameApiKey; this.originDomainName = originDomainName; this.verification = verification; this.customClientIpHeader = customClientIpHeader; this.tlsPolicy = tlsPolicy; + this.domainMetadata = domainMetadata; + this.certificate = certificate; this.additionalProperties = additionalProperties; } @@ -91,6 +103,11 @@ public boolean getPrimary() { return primary; } + @JsonProperty("status") + public CustomDomainStatusFilterEnum getStatus() { + return status; + } + @JsonProperty("type") public CustomDomainTypeEnum getType() { return type; @@ -137,13 +154,23 @@ public Optional getTlsPolicy() { return tlsPolicy; } + @JsonProperty("domain_metadata") + public Optional>> getDomainMetadata() { + return domainMetadata; + } + + @JsonProperty("certificate") + public Optional getCertificate() { + return certificate; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("custom_client_ip_header") private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyCustomDomainResponseContent && equalTo((VerifyCustomDomainResponseContent) other); @@ -158,29 +185,35 @@ private boolean equalTo(VerifyCustomDomainResponseContent other) { return customDomainId.equals(other.customDomainId) && domain.equals(other.domain) && primary == other.primary + && status.equals(other.status) && type.equals(other.type) && cnameApiKey.equals(other.cnameApiKey) && originDomainName.equals(other.originDomainName) && verification.equals(other.verification) && customClientIpHeader.equals(other.customClientIpHeader) - && tlsPolicy.equals(other.tlsPolicy); + && tlsPolicy.equals(other.tlsPolicy) + && domainMetadata.equals(other.domainMetadata) + && certificate.equals(other.certificate); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.customDomainId, this.domain, this.primary, + this.status, this.type, this.cnameApiKey, this.originDomainName, this.verification, this.customClientIpHeader, - this.tlsPolicy); + this.tlsPolicy, + this.domainMetadata, + this.certificate); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -209,7 +242,11 @@ public interface PrimaryStage { /** *

Whether this is a primary domain (true) or not (false).

*/ - TypeStage primary(boolean primary); + StatusStage primary(boolean primary); + } + + public interface StatusStage { + TypeStage status(@NotNull CustomDomainStatusFilterEnum status); } public interface TypeStage { @@ -254,19 +291,33 @@ public interface _FinalStage { _FinalStage tlsPolicy(Optional tlsPolicy); _FinalStage tlsPolicy(String tlsPolicy); + + _FinalStage domainMetadata(Optional>> domainMetadata); + + _FinalStage domainMetadata(Map> domainMetadata); + + _FinalStage certificate(Optional certificate); + + _FinalStage certificate(DomainCertificate certificate); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CustomDomainIdStage, DomainStage, PrimaryStage, TypeStage, _FinalStage { + implements CustomDomainIdStage, DomainStage, PrimaryStage, StatusStage, TypeStage, _FinalStage { private String customDomainId; private String domain; private boolean primary; + private CustomDomainStatusFilterEnum status; + private CustomDomainTypeEnum type; + private Optional certificate = Optional.empty(); + + private Optional>> domainMetadata = Optional.empty(); + private Optional tlsPolicy = Optional.empty(); private OptionalNullable customClientIpHeader = OptionalNullable.absent(); @@ -282,17 +333,20 @@ public static final class Builder private Builder() {} - @java.lang.Override + @Override public Builder from(VerifyCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); primary(other.getPrimary()); + status(other.getStatus()); type(other.getType()); cnameApiKey(other.getCnameApiKey()); originDomainName(other.getOriginDomainName()); verification(other.getVerification()); customClientIpHeader(other.getCustomClientIpHeader()); tlsPolicy(other.getTlsPolicy()); + domainMetadata(other.getDomainMetadata()); + certificate(other.getCertificate()); return this; } @@ -301,7 +355,7 @@ public Builder from(VerifyCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -313,7 +367,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -325,25 +379,58 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("primary") - public TypeStage primary(boolean primary) { + public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @java.lang.Override + @Override + @JsonSetter("status") + public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } + @Override + public _FinalStage certificate(DomainCertificate certificate) { + this.certificate = Optional.ofNullable(certificate); + return this; + } + + @Override + @JsonSetter(value = "certificate", nulls = Nulls.SKIP) + public _FinalStage certificate(Optional certificate) { + this.certificate = certificate; + return this; + } + + @Override + public _FinalStage domainMetadata(Map> domainMetadata) { + this.domainMetadata = Optional.ofNullable(domainMetadata); + return this; + } + + @Override + @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) + public _FinalStage domainMetadata(Optional>> domainMetadata) { + this.domainMetadata = domainMetadata; + return this; + } + /** *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -352,7 +439,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @java.lang.Override + @Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -363,7 +450,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -379,7 +466,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -393,7 +480,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -402,20 +489,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @java.lang.Override + @Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @java.lang.Override + @Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @java.lang.Override + @Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -426,7 +513,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -435,7 +522,7 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @java.lang.Override + @Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; @@ -446,7 +533,7 @@ public _FinalStage originDomainName(Optional originDomainName) { *

CNAME API key header.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage cnameApiKey(String cnameApiKey) { this.cnameApiKey = Optional.ofNullable(cnameApiKey); return this; @@ -455,25 +542,28 @@ public _FinalStage cnameApiKey(String cnameApiKey) { /** *

CNAME API key header.

*/ - @java.lang.Override + @Override @JsonSetter(value = "cname_api_key", nulls = Nulls.SKIP) public _FinalStage cnameApiKey(Optional cnameApiKey) { this.cnameApiKey = cnameApiKey; return this; } - @java.lang.Override + @Override public VerifyCustomDomainResponseContent build() { return new VerifyCustomDomainResponseContent( customDomainId, domain, primary, + status, type, cnameApiKey, originDomainName, verification, customClientIpHeader, tlsPolicy, + domainMetadata, + certificate, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java index 940d7b9a6..13491e49a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java @@ -109,7 +109,7 @@ public Optional getIdentity() { return identity; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyEmailTicketRequestContent && equalTo((VerifyEmailTicketRequestContent) other); @@ -130,7 +130,7 @@ private boolean equalTo(VerifyEmailTicketRequestContent other) { && identity.equals(other.identity); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.resultUrl, @@ -142,7 +142,7 @@ public int hashCode() { this.identity); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -224,7 +224,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(VerifyEmailTicketRequestContent other) { resultUrl(other.getResultUrl()); userId(other.getUserId()); @@ -241,20 +241,20 @@ public Builder from(VerifyEmailTicketRequestContent other) { *

user_id of for whom the ticket should be created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @java.lang.Override + @Override public _FinalStage identity(Identity identity) { this.identity = Optional.ofNullable(identity); return this; } - @java.lang.Override + @Override @JsonSetter(value = "identity", nulls = Nulls.SKIP) public _FinalStage identity(Optional identity) { this.identity = identity; @@ -265,7 +265,7 @@ public _FinalStage identity(Optional identity) { *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -274,7 +274,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

*/ - @java.lang.Override + @Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -285,7 +285,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage ttlSec(Integer ttlSec) { this.ttlSec = Optional.ofNullable(ttlSec); return this; @@ -294,7 +294,7 @@ public _FinalStage ttlSec(Integer ttlSec) { /** *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

*/ - @java.lang.Override + @Override @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) public _FinalStage ttlSec(Optional ttlSec) { this.ttlSec = ttlSec; @@ -305,7 +305,7 @@ public _FinalStage ttlSec(Optional ttlSec) { *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage organizationId(String organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; @@ -314,7 +314,7 @@ public _FinalStage organizationId(String organizationId) { /** *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

*/ - @java.lang.Override + @Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; @@ -325,7 +325,7 @@ public _FinalStage organizationId(Optional organizationId) { *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -334,7 +334,7 @@ public _FinalStage clientId(String clientId) { /** *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

*/ - @java.lang.Override + @Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; @@ -345,7 +345,7 @@ public _FinalStage clientId(Optional clientId) { *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = Optional.ofNullable(resultUrl); return this; @@ -354,14 +354,14 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

*/ - @java.lang.Override + @Override @JsonSetter(value = "result_url", nulls = Nulls.SKIP) public _FinalStage resultUrl(Optional resultUrl) { this.resultUrl = resultUrl; return this; } - @java.lang.Override + @Override public VerifyEmailTicketRequestContent build() { return new VerifyEmailTicketRequestContent( resultUrl, diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java index d558bbb5d..404cdf6e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java @@ -36,7 +36,7 @@ public String getTicket() { return ticket; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyEmailTicketResponseContent && equalTo((VerifyEmailTicketResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(VerifyEmailTicketResponseContent other) { return ticket.equals(other.ticket); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.ticket); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements TicketStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(VerifyEmailTicketResponseContent other) { ticket(other.getTicket()); return this; @@ -98,14 +98,14 @@ public Builder from(VerifyEmailTicketResponseContent other) { *

URL representing the ticket.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override @JsonSetter("ticket") public _FinalStage ticket(@NotNull String ticket) { this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); return this; } - @java.lang.Override + @Override public VerifyEmailTicketResponseContent build() { return new VerifyEmailTicketResponseContent(ticket, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncConnectedAccountsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncConnectedAccountsClient.java new file mode 100644 index 000000000..74e2b1285 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncConnectedAccountsClient.java @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectedAccount; +import com.auth0.client.mgmt.users.types.GetUserConnectedAccountsRequestParameters; +import java.util.concurrent.CompletableFuture; + +public class AsyncConnectedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectedAccountsClient rawClient; + + public AsyncConnectedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public CompletableFuture> list( + String id, GetUserConnectedAccountsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public CompletableFuture> list( + String id, GetUserConnectedAccountsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java index c4f9593f3..1c5e60840 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawAuthenticationMethodsClient.java @@ -78,9 +78,11 @@ public CompletableFuture>> list(String id) { + return list(id, GetUserConnectedAccountsRequestParameters.builder().build()); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public CompletableFuture>> list( + String id, GetUserConnectedAccountsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public CompletableFuture>> list( + String id, GetUserConnectedAccountsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("connected-accounts"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserConnectedAccountsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserConnectedAccountsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + GetUserConnectedAccountsRequestParameters nextRequest = + GetUserConnectedAccountsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getConnectedAccounts(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java index da8ded0e2..ed65b39a8 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawLogsClient.java @@ -75,10 +75,15 @@ public CompletableFuture>> lis .addPathSegments("users") .addPathSegment(id) .addPathSegments("logs"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java index 5732dea9c..580e43a79 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawOrganizationsClient.java @@ -65,9 +65,11 @@ public CompletableFuture> clear(String id, ClearAssessorsRequestContent request) { + return clear(id, request, null); + } + + /** + * Clear risk assessment assessors for a specific user + */ + public CompletableFuture> clear( + String id, ClearAssessorsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("risk-assessments") + .addPathSegments("clear") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java index 4999462aa..b4e3c2e09 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java @@ -73,9 +73,11 @@ public CompletableFuture>> li .addPathSegments("users") .addPathSegment(id) .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java index 5dcd3f1d3..b594a1c40 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawSessionsClient.java @@ -69,8 +69,11 @@ public CompletableFuture clear(String id, ClearAssessorsRequestContent request) { + return this.rawClient.clear(id, request).thenApply(response -> response.body()); + } + + /** + * Clear risk assessment assessors for a specific user + */ + public CompletableFuture clear( + String id, ClearAssessorsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.clear(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/ConnectedAccountsClient.java b/src/main/java/com/auth0/client/mgmt/users/ConnectedAccountsClient.java new file mode 100644 index 000000000..71463074d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/ConnectedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectedAccount; +import com.auth0.client.mgmt.users.types.GetUserConnectedAccountsRequestParameters; + +public class ConnectedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawConnectedAccountsClient rawClient; + + public ConnectedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public SyncPagingIterable list(String id, GetUserConnectedAccountsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public SyncPagingIterable list( + String id, GetUserConnectedAccountsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java index bf60f2efe..e61c090f7 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawAuthenticationMethodsClient.java @@ -73,9 +73,11 @@ public ManagementApiHttpResponse> l .addPathSegments("users") .addPathSegment(id) .addPathSegments("authentication-methods"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawConnectedAccountsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawConnectedAccountsClient.java new file mode 100644 index 000000000..b1492cc5f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawConnectedAccountsClient.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.types.ConnectedAccount; +import com.auth0.client.mgmt.types.ListUserConnectedAccountsResponseContent; +import com.auth0.client.mgmt.users.types.GetUserConnectedAccountsRequestParameters; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectedAccountsClient { + protected final ClientOptions clientOptions; + + public RawConnectedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, GetUserConnectedAccountsRequestParameters.builder().build()); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public ManagementApiHttpResponse> list( + String id, GetUserConnectedAccountsRequestParameters request) { + return list(id, request, null); + } + + /** + * Retrieve all connected accounts associated with the user. + */ + public ManagementApiHttpResponse> list( + String id, GetUserConnectedAccountsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("connected-accounts"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListUserConnectedAccountsResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListUserConnectedAccountsResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + GetUserConnectedAccountsRequestParameters nextRequest = + GetUserConnectedAccountsRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getConnectedAccounts(); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java index 915c42d4d..ff8fb9dd1 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawLogsClient.java @@ -69,10 +69,15 @@ public ManagementApiHttpResponse> list( .addPathSegments("users") .addPathSegment(id) .addPathSegments("logs"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "sort", request.getSort(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + if (!request.getSort().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().orElse(null), false); + } + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java index d4b01eb3a..f0c7ce991 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawOrganizationsClient.java @@ -60,9 +60,11 @@ public ManagementApiHttpResponse> list( .addPathSegments("users") .addPathSegment(id) .addPathSegments("organizations"); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java index 7224d2d81..bfcfa7390 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawPermissionsClient.java @@ -66,9 +66,11 @@ public ManagementApiHttpResponse> list( .addPathSegments("users") .addPathSegment(id) .addPathSegments("permissions"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java index 681cc9e5c..8e393c6e6 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawRefreshTokenClient.java @@ -63,8 +63,11 @@ public ManagementApiHttpResponse .addPathSegments("users") .addPathSegment(userId) .addPathSegments("refresh-tokens"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRiskAssessmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRiskAssessmentsClient.java new file mode 100644 index 000000000..a02613d42 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RawRiskAssessmentsClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.users.types.ClearAssessorsRequestContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRiskAssessmentsClient { + protected final ClientOptions clientOptions; + + public RawRiskAssessmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Clear risk assessment assessors for a specific user + */ + public ManagementApiHttpResponse clear(String id, ClearAssessorsRequestContent request) { + return clear(id, request, null); + } + + /** + * Clear risk assessment assessors for a specific user + */ + public ManagementApiHttpResponse clear( + String id, ClearAssessorsRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("users") + .addPathSegment(id) + .addPathSegments("risk-assessments") + .addPathSegments("clear") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java index ba17bdeac..6f9fbd20c 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java @@ -67,9 +67,11 @@ public ManagementApiHttpResponse> list( .addPathSegments("users") .addPathSegment(id) .addPathSegments("roles"); - QueryStringMapper.addQueryParameter(httpUrl, "per_page", request.getPerPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage(), false); - QueryStringMapper.addQueryParameter(httpUrl, "include_totals", request.getIncludeTotals(), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java b/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java index 636f95046..020392ab1 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawSessionsClient.java @@ -63,8 +63,11 @@ public ManagementApiHttpResponse> lis .addPathSegments("users") .addPathSegment(userId) .addPathSegments("sessions"); - QueryStringMapper.addQueryParameter(httpUrl, "from", request.getFrom(), false); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake(), false); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) diff --git a/src/main/java/com/auth0/client/mgmt/users/RiskAssessmentsClient.java b/src/main/java/com/auth0/client/mgmt/users/RiskAssessmentsClient.java new file mode 100644 index 000000000..b23ce0f77 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/RiskAssessmentsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.users.types.ClearAssessorsRequestContent; + +public class RiskAssessmentsClient { + protected final ClientOptions clientOptions; + + private final RawRiskAssessmentsClient rawClient; + + public RiskAssessmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRiskAssessmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRiskAssessmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Clear risk assessment assessors for a specific user + */ + public void clear(String id, ClearAssessorsRequestContent request) { + this.rawClient.clear(id, request).body(); + } + + /** + * Clear risk assessment assessors for a specific user + */ + public void clear(String id, ClearAssessorsRequestContent request, RequestOptions requestOptions) { + this.rawClient.clear(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java index b423d70e4..3312981cf 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignUserRolesRequestContent && equalTo((AssignUserRolesRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(AssignUserRolesRequestContent other) { return roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java new file mode 100644 index 000000000..ad45186bc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClearAssessorsRequestContent.Builder.class) +public final class ClearAssessorsRequestContent { + private final String connection; + + private final List assessors; + + private final Map additionalProperties; + + private ClearAssessorsRequestContent( + String connection, List assessors, Map additionalProperties) { + this.connection = connection; + this.assessors = assessors; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the connection containing the user whose assessors should be cleared. + */ + @JsonProperty("connection") + public String getConnection() { + return connection; + } + + /** + * @return List of assessors to clear. + */ + @JsonProperty("assessors") + public List getAssessors() { + return assessors; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClearAssessorsRequestContent && equalTo((ClearAssessorsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClearAssessorsRequestContent other) { + return connection.equals(other.connection) && assessors.equals(other.assessors); + } + + @Override + public int hashCode() { + return Objects.hash(this.connection, this.assessors); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionStage builder() { + return new Builder(); + } + + public interface ConnectionStage { + /** + *

The name of the connection containing the user whose assessors should be cleared.

+ */ + _FinalStage connection(@NotNull String connection); + + Builder from(ClearAssessorsRequestContent other); + } + + public interface _FinalStage { + ClearAssessorsRequestContent build(); + + /** + *

List of assessors to clear.

+ */ + _FinalStage assessors(List assessors); + + _FinalStage addAssessors(String assessors); + + _FinalStage addAllAssessors(List assessors); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionStage, _FinalStage { + private String connection; + + private List assessors = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ClearAssessorsRequestContent other) { + connection(other.getConnection()); + assessors(other.getAssessors()); + return this; + } + + /** + *

The name of the connection containing the user whose assessors should be cleared.

+ *

The name of the connection containing the user whose assessors should be cleared.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + @JsonSetter("connection") + public _FinalStage connection(@NotNull String connection) { + this.connection = Objects.requireNonNull(connection, "connection must not be null"); + return this; + } + + /** + *

List of assessors to clear.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addAllAssessors(List assessors) { + if (assessors != null) { + this.assessors.addAll(assessors); + } + return this; + } + + /** + *

List of assessors to clear.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage addAssessors(String assessors) { + this.assessors.add(assessors); + return this; + } + + /** + *

List of assessors to clear.

+ */ + @Override + @JsonSetter(value = "assessors", nulls = Nulls.SKIP) + public _FinalStage assessors(List assessors) { + this.assessors.clear(); + if (assessors != null) { + this.assessors.addAll(assessors); + } + return this; + } + + @Override + public ClearAssessorsRequestContent build() { + return new ClearAssessorsRequestContent(connection, assessors, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java index 97914b813..a5e3ccfb0 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java @@ -117,7 +117,7 @@ public Optional getKeyId() { } /** - * @return Applies to webauthn authentication methods only. The public key. + * @return Applies to webauthn authentication methods only. The public key, which is encoded as base64. */ @JsonProperty("public_key") public Optional getPublicKey() { @@ -132,7 +132,7 @@ public Optional getRelyingPartyIdentifier() { return relyingPartyIdentifier; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserAuthenticationMethodRequestContent @@ -156,7 +156,7 @@ private boolean equalTo(CreateUserAuthenticationMethodRequestContent other) { && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.type, @@ -170,7 +170,7 @@ public int hashCode() { this.relyingPartyIdentifier); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -229,7 +229,7 @@ _FinalStage preferredAuthenticationMethod( _FinalStage keyId(String keyId); /** - *

Applies to webauthn authentication methods only. The public key.

+ *

Applies to webauthn authentication methods only. The public key, which is encoded as base64.

*/ _FinalStage publicKey(Optional publicKey); @@ -268,7 +268,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @java.lang.Override + @Override public Builder from(CreateUserAuthenticationMethodRequestContent other) { type(other.getType()); name(other.getName()); @@ -282,7 +282,7 @@ public Builder from(CreateUserAuthenticationMethodRequestContent other) { return this; } - @java.lang.Override + @Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -293,7 +293,7 @@ public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { *

Applies to webauthn authentication methods only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -302,7 +302,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authentication methods only. The relying party identifier.

*/ - @java.lang.Override + @Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -310,19 +310,19 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie } /** - *

Applies to webauthn authentication methods only. The public key.

+ *

Applies to webauthn authentication methods only. The public key, which is encoded as base64.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; } /** - *

Applies to webauthn authentication methods only. The public key.

+ *

Applies to webauthn authentication methods only. The public key, which is encoded as base64.

*/ - @java.lang.Override + @Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -333,7 +333,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -342,21 +342,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The id of the credential.

*/ - @java.lang.Override + @Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @java.lang.Override + @Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @java.lang.Override + @Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -368,7 +368,7 @@ public _FinalStage preferredAuthenticationMethod( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -377,7 +377,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @java.lang.Override + @Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -388,7 +388,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -397,7 +397,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @java.lang.Override + @Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -408,7 +408,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -417,7 +417,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation.

*/ - @java.lang.Override + @Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -428,7 +428,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override + @Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -437,14 +437,14 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @java.lang.Override + @Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @java.lang.Override + @Override public CreateUserAuthenticationMethodRequestContent build() { return new CreateUserAuthenticationMethodRequestContent( type, diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java index a422a33db..ef12ad7c5 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserPermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(CreateUserPermissionsRequestContent other) { return permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java index 2bffd3434..dadbab59a 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserPermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(DeleteUserPermissionsRequestContent other) { return permissions.equals(other.permissions); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.permissions); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java index 09a108eae..158dd392b 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserRolesRequestContent && equalTo((DeleteUserRolesRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(DeleteUserRolesRequestContent other) { return roles.equals(other.roles); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.roles); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java new file mode 100644 index 000000000..d0d0bcd3a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.users.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetUserConnectedAccountsRequestParameters.Builder.class) +public final class GetUserConnectedAccountsRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private GetUserConnectedAccountsRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results to return. Defaults to 10 with a maximum of 20 + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetUserConnectedAccountsRequestParameters + && equalTo((GetUserConnectedAccountsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetUserConnectedAccountsRequestParameters other) { + return from.equals(other.from) && take.equals(other.take); + } + + @Override + public int hashCode() { + return Objects.hash(this.from, this.take); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetUserConnectedAccountsRequestParameters other) { + from(other.getFrom()); + take(other.getTake()); + return this; + } + + /** + *

Optional Id from which to start selection.

+ */ + @JsonSetter(value = "from", nulls = Nulls.SKIP) + public Builder from(@Nullable OptionalNullable from) { + this.from = from; + return this; + } + + public Builder from(String from) { + this.from = OptionalNullable.of(from); + return this; + } + + public Builder from(Optional from) { + if (from.isPresent()) { + this.from = OptionalNullable.of(from.get()); + } else { + this.from = OptionalNullable.absent(); + } + return this; + } + + public Builder from(com.auth0.client.mgmt.core.Nullable from) { + if (from.isNull()) { + this.from = OptionalNullable.ofNull(); + } else if (from.isEmpty()) { + this.from = OptionalNullable.absent(); + } else { + this.from = OptionalNullable.of(from.get()); + } + return this; + } + + /** + *

Number of results to return. Defaults to 10 with a maximum of 20

+ */ + @JsonSetter(value = "take", nulls = Nulls.SKIP) + public Builder take(OptionalNullable take) { + this.take = take; + return this; + } + + public Builder take(Integer take) { + this.take = OptionalNullable.of(take); + return this; + } + + public Builder take(Optional take) { + if (take.isPresent()) { + this.take = OptionalNullable.of(take.get()); + } else { + this.take = OptionalNullable.absent(); + } + return this; + } + + public Builder take(com.auth0.client.mgmt.core.Nullable take) { + if (take.isNull()) { + this.take = OptionalNullable.ofNull(); + } else if (take.isEmpty()) { + this.take = OptionalNullable.absent(); + } else { + this.take = OptionalNullable.of(take.get()); + } + return this; + } + + public GetUserConnectedAccountsRequestParameters build() { + return new GetUserConnectedAccountsRequestParameters(from, take, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java index 5b75173dd..6437f04d6 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java @@ -4,7 +4,7 @@ package com.auth0.client.mgmt.users.types; import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.types.UserIdEnum; +import com.auth0.client.mgmt.types.UserId; import com.auth0.client.mgmt.types.UserIdentityProviderEnum; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -26,7 +26,7 @@ public final class LinkUserIdentityRequestContent { private final Optional connectionId; - private final Optional userId; + private final Optional userId; private final Optional linkWith; @@ -35,7 +35,7 @@ public final class LinkUserIdentityRequestContent { private LinkUserIdentityRequestContent( Optional provider, Optional connectionId, - Optional userId, + Optional userId, Optional linkWith, Map additionalProperties) { this.provider = provider; @@ -59,7 +59,7 @@ public Optional getConnectionId() { } @JsonProperty("user_id") - public Optional getUserId() { + public Optional getUserId() { return userId; } @@ -71,7 +71,7 @@ public Optional getLinkWith() { return linkWith; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LinkUserIdentityRequestContent && equalTo((LinkUserIdentityRequestContent) other); @@ -89,12 +89,12 @@ private boolean equalTo(LinkUserIdentityRequestContent other) { && linkWith.equals(other.linkWith); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.provider, this.connectionId, this.userId, this.linkWith); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder { private Optional connectionId = Optional.empty(); - private Optional userId = Optional.empty(); + private Optional userId = Optional.empty(); private Optional linkWith = Optional.empty(); @@ -152,12 +152,12 @@ public Builder connectionId(String connectionId) { } @JsonSetter(value = "user_id", nulls = Nulls.SKIP) - public Builder userId(Optional userId) { + public Builder userId(Optional userId) { this.userId = userId; return this; } - public Builder userId(UserIdEnum userId) { + public Builder userId(UserId userId) { this.userId = Optional.ofNullable(userId); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java index 1b9177d8b..9cd82609d 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRefreshTokensRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListRefreshTokensRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java index 820d3be3b..b4a33d71c 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.users.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListUserAuthenticationMethodsRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListUserAuthenticationMethodsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAuthenticationMethodsRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListUserAuthenticationMethodsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListUserAuthenticationMethodsRequestParameters other) { *

Page index of the results to return. First page is 0. Default is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java index e7041c4bc..2127624f8 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.users.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListUserLogsRequestParameters.Builder.class) @@ -52,9 +52,6 @@ private ListUserLogsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -88,19 +85,13 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("sort") private OptionalNullable _getSort() { return sort; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserLogsRequestParameters && equalTo((ListUserLogsRequestParameters) other); @@ -118,12 +109,12 @@ private boolean equalTo(ListUserLogsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.sort, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +150,7 @@ public Builder from(ListUserLogsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -178,7 +169,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -212,7 +203,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -227,7 +218,7 @@ public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { *

Field to sort by. Use fieldname:1 for ascending order and fieldname:-1 for descending.

*/ @JsonSetter(value = "sort", nulls = Nulls.SKIP) - public Builder sort(@Nullable OptionalNullable sort) { + public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { this.sort = sort; return this; } @@ -246,7 +237,7 @@ public Builder sort(Optional sort) { return this; } - public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + public Builder sort(Nullable sort) { if (sort.isNull()) { this.sort = OptionalNullable.ofNull(); } else if (sort.isEmpty()) { @@ -280,7 +271,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java index cb1a63315..138355baa 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java @@ -3,6 +3,7 @@ */ package com.auth0.client.mgmt.users.types; +import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -18,7 +19,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListUserOrganizationsRequestParameters.Builder.class) @@ -48,9 +48,6 @@ private ListUserOrganizationsRequestParameters( @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserOrganizationsRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListUserOrganizationsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +123,7 @@ public Builder from(ListUserOrganizationsRequestParameters other) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } @@ -151,7 +142,7 @@ public Builder page(Optional page) { return this; } - public Builder page(com.auth0.client.mgmt.core.Nullable page) { + public Builder page(Nullable page) { if (page.isNull()) { this.page = OptionalNullable.ofNull(); } else if (page.isEmpty()) { @@ -185,7 +176,7 @@ public Builder perPage(Optional perPage) { return this; } - public Builder perPage(com.auth0.client.mgmt.core.Nullable perPage) { + public Builder perPage(Nullable perPage) { if (perPage.isNull()) { this.perPage = OptionalNullable.ofNull(); } else if (perPage.isEmpty()) { @@ -219,7 +210,7 @@ public Builder includeTotals(Optional includeTotals) { return this; } - public Builder includeTotals(com.auth0.client.mgmt.core.Nullable includeTotals) { + public Builder includeTotals(Nullable includeTotals) { if (includeTotals.isNull()) { this.includeTotals = OptionalNullable.ofNull(); } else if (includeTotals.isEmpty()) { diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java index a8e77081e..9eb322941 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java @@ -57,9 +57,6 @@ public OptionalNullable getPerPage() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserPermissionsRequestParameters @@ -94,12 +85,12 @@ private boolean equalTo(ListUserPermissionsRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +157,7 @@ public Builder perPage(Nullable perPage) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java index 0e6a74bea..772bb4b54 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java @@ -57,9 +57,6 @@ public OptionalNullable getPerPage() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("page") public OptionalNullable getPage() { - if (page == null) { - return OptionalNullable.absent(); - } return page; } @@ -72,13 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("page") - private OptionalNullable _getPage() { - return page; - } - - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserRolesRequestParameters && equalTo((ListUserRolesRequestParameters) other); @@ -93,12 +84,12 @@ private boolean equalTo(ListUserRolesRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } @@ -165,7 +156,7 @@ public Builder perPage(Nullable perPage) { *

Page index of the results to return. First page is 0.

*/ @JsonSetter(value = "page", nulls = Nulls.SKIP) - public Builder page(@org.jetbrains.annotations.Nullable OptionalNullable page) { + public Builder page(OptionalNullable page) { this.page = page; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java index 6238eeb0c..1db8761f3 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserSessionsRequestParameters && equalTo((ListUserSessionsRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListUserSessionsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java index 981906ce3..fe9b6b6a3 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java @@ -49,7 +49,7 @@ public Optional getPreferredAuthenticationMet return preferredAuthenticationMethod; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserAuthenticationMethodRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(UpdateUserAuthenticationMethodRequestContent other) { return name.equals(other.name) && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.name, this.preferredAuthenticationMethod); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java index 2f7857d3c..2b7cd34b9 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/AsyncRawTemplatesClient.java @@ -75,8 +75,11 @@ public CompletableFuture customCertificateAuthority) { this.customCertificateAuthority = customCertificateAuthority; return this; } - @java.lang.Override + @Override public CreateVerifiableCredentialTemplateRequestContent build() { return new CreateVerifiableCredentialTemplateRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java index ada4bfbdd..5e6f73518 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListVerifiableCredentialTemplatesRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListVerifiableCredentialTemplatesRequestParameters other return from.equals(other.from) && take.equals(other.take); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash(this.from, this.take); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java index 354237b36..03274a62d 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java @@ -82,7 +82,7 @@ public Optional getVersion() { return version; } - @java.lang.Override + @Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateVerifiableCredentialTemplateRequestContent @@ -103,13 +103,13 @@ private boolean equalTo(UpdateVerifiableCredentialTemplateRequestContent other) && version.equals(other.version); } - @java.lang.Override + @Override public int hashCode() { return Objects.hash( this.name, this.type, this.dialect, this.presentation, this.wellKnownTrustedIssuers, this.version); } - @java.lang.Override + @Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/net/BaseRequest.java b/src/main/java/com/auth0/net/BaseRequest.java index 28852bdff..00510f4be 100644 --- a/src/main/java/com/auth0/net/BaseRequest.java +++ b/src/main/java/com/auth0/net/BaseRequest.java @@ -138,7 +138,7 @@ protected Map getParameters() { * @throws Auth0Exception if the request execution fails. */ @Override - public com.auth0.net.Response execute() throws Auth0Exception { + public Response execute() throws Auth0Exception { String apiToken = null; if (Objects.nonNull(tokenProvider)) { apiToken = tokenProvider.getToken(); @@ -156,8 +156,8 @@ public com.auth0.net.Response execute() throws Auth0Exception { } @Override - public CompletableFuture> executeAsync() { - final CompletableFuture> future = new CompletableFuture<>(); + public CompletableFuture> executeAsync() { + final CompletableFuture> future = new CompletableFuture<>(); if (Objects.nonNull(tokenProvider)) { return tokenProvider.getTokenAsync().thenCompose(token -> { diff --git a/src/main/java/com/auth0/net/client/DefaultHttpClient.java b/src/main/java/com/auth0/net/client/DefaultHttpClient.java index 9e7ddf649..d6bb8d0d1 100644 --- a/src/main/java/com/auth0/net/client/DefaultHttpClient.java +++ b/src/main/java/com/auth0/net/client/DefaultHttpClient.java @@ -32,8 +32,8 @@ public class DefaultHttpClient implements Auth0HttpClient { private final okhttp3.OkHttpClient client; - public static DefaultHttpClient.Builder newBuilder() { - return new DefaultHttpClient.Builder(); + public static Builder newBuilder() { + return new Builder(); } /** diff --git a/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java index 528fb4801..c26ef9a49 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsExecutionsWireTest.java @@ -95,24 +95,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java index 6855a58f7..c669f7abb 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsTriggersBindingsWireTest.java @@ -3,6 +3,7 @@ import com.auth0.client.mgmt.actions.triggers.types.ListActionTriggerBindingsRequestParameters; import com.auth0.client.mgmt.actions.triggers.types.UpdateActionBindingsRequestContent; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.ActionBinding; import com.auth0.client.mgmt.types.UpdateActionBindingsResponseContent; @@ -49,8 +50,8 @@ public void testList() throws Exception { .list( "triggerId", ListActionTriggerBindingsRequestParameters.builder() - .page(1) - .perPage(1) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -155,24 +156,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java index f15c04833..f8761c9a1 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsTriggersWireTest.java @@ -100,24 +100,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java index b71c1cf48..1e979c6fb 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java @@ -49,8 +49,8 @@ public void testList() throws Exception { .list( "actionId", ListActionVersionsRequestParameters.builder() - .page(1) - .perPage(1) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -282,24 +282,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java index c54154878..75fda4da9 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Action; import com.auth0.client.mgmt.types.ActionTrigger; @@ -55,12 +56,12 @@ public void testList() throws Exception { "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"actions\":[{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{}],\"runtime\":\"runtime\",\"secrets\":[{}],\"installed_integration_id\":\"installed_integration_id\",\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}]}")); SyncPagingIterable response = client.actions() .list(ListActionsRequestParameters.builder() - .triggerId("triggerId") - .actionName("actionName") - .deployed(true) - .page(1) - .perPage(1) - .installed(true) + .triggerId(OptionalNullable.of("triggerId")) + .actionName(OptionalNullable.of("actionName")) + .deployed(OptionalNullable.of(true)) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .installed(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -434,7 +435,9 @@ public void testDelete() throws Exception { client.actions() .delete( "id", - DeleteActionRequestParameters.builder().force(true).build()); + DeleteActionRequestParameters.builder() + .force(OptionalNullable.of(true)) + .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("DELETE", request.getMethod()); @@ -818,24 +821,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java b/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java index f89c83520..091e49ac3 100644 --- a/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/AnomalyBlocksWireTest.java @@ -50,24 +50,29 @@ public void testUnblockIp() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionBotDetectionWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionBotDetectionWireTest.java new file mode 100644 index 000000000..ef08312ec --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionBotDetectionWireTest.java @@ -0,0 +1,212 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.attackprotection.types.UpdateBotDetectionSettingsRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetBotDetectionSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateBotDetectionSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AttackProtectionBotDetectionWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"bot_detection_level\":\"low\",\"challenge_password_policy\":\"never\",\"challenge_passwordless_policy\":\"never\",\"challenge_password_reset_policy\":\"never\",\"allowlist\":[\"allowlist\"],\"monitoring_mode_enabled\":true}")); + GetBotDetectionSettingsResponseContent response = + client.attackProtection().botDetection().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"bot_detection_level\": \"low\",\n" + + " \"challenge_password_policy\": \"never\",\n" + + " \"challenge_passwordless_policy\": \"never\",\n" + + " \"challenge_password_reset_policy\": \"never\",\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"monitoring_mode_enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"bot_detection_level\":\"low\",\"challenge_password_policy\":\"never\",\"challenge_passwordless_policy\":\"never\",\"challenge_password_reset_policy\":\"never\",\"allowlist\":[\"allowlist\"],\"monitoring_mode_enabled\":true}")); + UpdateBotDetectionSettingsResponseContent response = client.attackProtection() + .botDetection() + .update(UpdateBotDetectionSettingsRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"bot_detection_level\": \"low\",\n" + + " \"challenge_password_policy\": \"never\",\n" + + " \"challenge_passwordless_policy\": \"never\",\n" + + " \"challenge_password_reset_policy\": \"never\",\n" + + " \"allowlist\": [\n" + + " \"allowlist\"\n" + + " ],\n" + + " \"monitoring_mode_enabled\": true\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java index 0553f71f1..ca93b7b9c 100644 --- a/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionBreachedPasswordDetectionWireTest.java @@ -206,24 +206,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java index 593edc61d..ac8b495d8 100644 --- a/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionBruteForceProtectionWireTest.java @@ -183,24 +183,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionCaptchaWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionCaptchaWireTest.java new file mode 100644 index 000000000..037385971 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionCaptchaWireTest.java @@ -0,0 +1,248 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.attackprotection.types.UpdateAttackProtectionCaptchaRequestContent; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.GetAttackProtectionCaptchaResponseContent; +import com.auth0.client.mgmt.types.UpdateAttackProtectionCaptchaResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class AttackProtectionCaptchaWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"active_provider_id\":\"active_provider_id\",\"arkose\":{\"site_key\":\"site_key\",\"fail_open\":true,\"client_subdomain\":\"client_subdomain\",\"verify_subdomain\":\"verify_subdomain\"},\"auth_challenge\":{\"fail_open\":true},\"hcaptcha\":{\"site_key\":\"site_key\"},\"friendly_captcha\":{\"site_key\":\"site_key\"},\"recaptcha_enterprise\":{\"site_key\":\"site_key\",\"project_id\":\"project_id\"},\"recaptcha_v2\":{\"site_key\":\"site_key\"},\"simple_captcha\":{\"key\":\"value\"}}")); + GetAttackProtectionCaptchaResponseContent response = + client.attackProtection().captcha().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"active_provider_id\": \"active_provider_id\",\n" + + " \"arkose\": {\n" + + " \"site_key\": \"site_key\",\n" + + " \"fail_open\": true,\n" + + " \"client_subdomain\": \"client_subdomain\",\n" + + " \"verify_subdomain\": \"verify_subdomain\"\n" + + " },\n" + + " \"auth_challenge\": {\n" + + " \"fail_open\": true\n" + + " },\n" + + " \"hcaptcha\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"friendly_captcha\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"recaptcha_enterprise\": {\n" + + " \"site_key\": \"site_key\",\n" + + " \"project_id\": \"project_id\"\n" + + " },\n" + + " \"recaptcha_v2\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"simple_captcha\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"active_provider_id\":\"active_provider_id\",\"arkose\":{\"site_key\":\"site_key\",\"fail_open\":true,\"client_subdomain\":\"client_subdomain\",\"verify_subdomain\":\"verify_subdomain\"},\"auth_challenge\":{\"fail_open\":true},\"hcaptcha\":{\"site_key\":\"site_key\"},\"friendly_captcha\":{\"site_key\":\"site_key\"},\"recaptcha_enterprise\":{\"site_key\":\"site_key\",\"project_id\":\"project_id\"},\"recaptcha_v2\":{\"site_key\":\"site_key\"},\"simple_captcha\":{\"key\":\"value\"}}")); + UpdateAttackProtectionCaptchaResponseContent response = client.attackProtection() + .captcha() + .update(UpdateAttackProtectionCaptchaRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"active_provider_id\": \"active_provider_id\",\n" + + " \"arkose\": {\n" + + " \"site_key\": \"site_key\",\n" + + " \"fail_open\": true,\n" + + " \"client_subdomain\": \"client_subdomain\",\n" + + " \"verify_subdomain\": \"verify_subdomain\"\n" + + " },\n" + + " \"auth_challenge\": {\n" + + " \"fail_open\": true\n" + + " },\n" + + " \"hcaptcha\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"friendly_captcha\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"recaptcha_enterprise\": {\n" + + " \"site_key\": \"site_key\",\n" + + " \"project_id\": \"project_id\"\n" + + " },\n" + + " \"recaptcha_v2\": {\n" + + " \"site_key\": \"site_key\"\n" + + " },\n" + + " \"simple_captcha\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java b/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java index ecba14d6f..0c3572915 100644 --- a/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/AttackProtectionSuspiciousIpThrottlingWireTest.java @@ -200,24 +200,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java index e4ed7ef4b..192ab6c2d 100644 --- a/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/BrandingPhoneProvidersWireTest.java @@ -5,6 +5,7 @@ import com.auth0.client.mgmt.branding.phone.types.ListBrandingPhoneProvidersRequestParameters; import com.auth0.client.mgmt.branding.phone.types.UpdateBrandingPhoneProviderRequestContent; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.CreateBrandingPhoneProviderResponseContent; import com.auth0.client.mgmt.types.CreatePhoneProviderSendTestResponseContent; import com.auth0.client.mgmt.types.GetBrandingPhoneProviderResponseContent; @@ -54,7 +55,7 @@ public void testList() throws Exception { .phone() .providers() .list(ListBrandingPhoneProvidersRequestParameters.builder() - .disabled(true) + .disabled(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -473,24 +474,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java index 1fc19fc13..d47bb698f 100644 --- a/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/BrandingPhoneTemplatesWireTest.java @@ -5,6 +5,7 @@ import com.auth0.client.mgmt.branding.phone.types.ListPhoneTemplatesRequestParameters; import com.auth0.client.mgmt.branding.phone.types.UpdatePhoneTemplateRequestContent; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.CreatePhoneTemplateResponseContent; import com.auth0.client.mgmt.types.CreatePhoneTemplateTestNotificationResponseContent; import com.auth0.client.mgmt.types.GetPhoneTemplateResponseContent; @@ -53,7 +54,7 @@ public void testList() throws Exception { .phone() .templates() .list(ListPhoneTemplatesRequestParameters.builder() - .disabled(true) + .disabled(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -549,24 +550,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java index 52128c622..328016220 100644 --- a/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/BrandingTemplatesWireTest.java @@ -125,24 +125,29 @@ public void testDeleteUniversalLogin() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java index 4c161ae67..e77b08b0a 100644 --- a/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/BrandingThemesWireTest.java @@ -916,24 +916,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java b/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java index d6f37c67a..5757c35b8 100644 --- a/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/BrandingWireTest.java @@ -181,24 +181,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java index 6a977a88b..b369e2a8f 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientGrantsOrganizationsWireTest.java @@ -2,6 +2,7 @@ import com.auth0.client.mgmt.clientgrants.types.ListClientGrantOrganizationsRequestParameters; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Organization; import com.fasterxml.jackson.databind.JsonNode; @@ -40,14 +41,14 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"token_quota\":{\"client_credentials\":{}}}]}")); SyncPagingIterable response = client.clientGrants() .organizations() .list( "id", ListClientGrantOrganizationsRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -60,24 +61,29 @@ public void testList() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java index 07f8e07cd..90e52b291 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientGrantsWireTest.java @@ -1,8 +1,10 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.ClientGrantResponseContent; +import com.auth0.client.mgmt.types.ClientGrantSubjectTypeEnum; import com.auth0.client.mgmt.types.CreateClientGrantRequestContent; import com.auth0.client.mgmt.types.CreateClientGrantResponseContent; import com.auth0.client.mgmt.types.ListClientGrantsRequestParameters; @@ -10,7 +12,6 @@ import com.auth0.client.mgmt.types.UpdateClientGrantResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.Arrays; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; @@ -45,14 +46,15 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"next\":\"next\",\"client_grants\":[{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}]}")); + "{\"next\":\"next\",\"client_grants\":[{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true,\"subject_type\":\"client\",\"authorization_details_types\":[\"authorization_details_types\"]}]}")); SyncPagingIterable response = client.clientGrants() .list(ListClientGrantsRequestParameters.builder() - .from("from") - .take(1) - .audience("audience") - .clientId("client_id") - .allowAnyOrganization(true) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .audience(OptionalNullable.of("audience")) + .clientId(OptionalNullable.of("client_id")) + .allowAnyOrganization(OptionalNullable.of(true)) + .subjectType(OptionalNullable.of(ClientGrantSubjectTypeEnum.CLIENT)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -70,26 +72,19 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}")); + "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true,\"subject_type\":\"client\",\"authorization_details_types\":[\"authorization_details_types\"]}")); CreateClientGrantResponseContent response = client.clientGrants() .create(CreateClientGrantRequestContent.builder() .clientId("client_id") .audience("audience") - .scope(Arrays.asList("scope")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("POST", request.getMethod()); // Validate request body String actualRequestBody = request.getBody().readUtf8(); - String expectedRequestBody = "" - + "{\n" - + " \"client_id\": \"client_id\",\n" - + " \"audience\": \"audience\",\n" - + " \"scope\": [\n" - + " \"scope\"\n" - + " ]\n" - + "}"; + String expectedRequestBody = + "" + "{\n" + " \"client_id\": \"client_id\",\n" + " \"audience\": \"audience\"\n" + "}"; JsonNode actualJson = objectMapper.readTree(actualRequestBody); JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); @@ -130,7 +125,11 @@ else if (actualJson.has("kind")) + " ],\n" + " \"organization_usage\": \"deny\",\n" + " \"allow_any_organization\": true,\n" - + " \"is_system\": true\n" + + " \"is_system\": true,\n" + + " \"subject_type\": \"client\",\n" + + " \"authorization_details_types\": [\n" + + " \"authorization_details_types\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -178,7 +177,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true}")); + "{\"id\":\"id\",\"client_id\":\"client_id\",\"audience\":\"audience\",\"scope\":[\"scope\"],\"organization_usage\":\"deny\",\"allow_any_organization\":true,\"is_system\":true,\"subject_type\":\"client\",\"authorization_details_types\":[\"authorization_details_types\"]}")); UpdateClientGrantResponseContent response = client.clientGrants() .update("id", UpdateClientGrantRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -227,7 +226,11 @@ else if (actualJson.has("kind")) + " ],\n" + " \"organization_usage\": \"deny\",\n" + " \"allow_any_organization\": true,\n" - + " \"is_system\": true\n" + + " \"is_system\": true,\n" + + " \"subject_type\": \"client\",\n" + + " \"authorization_details_types\": [\n" + + " \"authorization_details_types\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -261,24 +264,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java index 934776918..50dc2baa5 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientsConnectionsWireTest.java @@ -2,6 +2,7 @@ import com.auth0.client.mgmt.clients.types.ConnectionsGetRequest; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.ConnectionForList; import com.fasterxml.jackson.databind.JsonNode; @@ -40,16 +41,16 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}],\"next\":\"next\"}")); + "{\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"authentication\":{\"active\":true},\"connected_accounts\":{\"active\":true}}],\"next\":\"next\"}")); SyncPagingIterable response = client.clients() .connections() .get( "id", ConnectionsGetRequest.builder() - .from("from") - .take(1) - .fields("fields") - .includeFields(true) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -62,24 +63,29 @@ public void testGet() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java index d1b3bb49e..de0dcec56 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientsCredentialsWireTest.java @@ -357,24 +357,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java index 58ffee042..2649577d9 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Client; import com.auth0.client.mgmt.types.CreateClientRequestContent; @@ -47,18 +48,18 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"clients\":[{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"grant_types\":[\"grant_types\"],\"signing_keys\":[{}],\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\"},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{}}}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"clients\":[{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"grant_types\":[\"grant_types\"],\"signing_keys\":[{}],\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\"},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}]}")); SyncPagingIterable response = client.clients() .list(ListClientsRequestParameters.builder() - .fields("fields") - .includeFields(true) - .page(1) - .perPage(1) - .includeTotals(true) - .isGlobal(true) - .isFirstParty(true) - .appType("app_type") - .q("q") + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .isGlobal(OptionalNullable.of(true)) + .isFirstParty(OptionalNullable.of(true)) + .appType(OptionalNullable.of("app_type")) + .q(OptionalNullable.of("q")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -76,7 +77,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); CreateClientResponseContent response = client.clients() .create(CreateClientRequestContent.builder().name("name").build()); RecordedRequest request = server.takeRequest(); @@ -123,7 +124,7 @@ else if (actualJson.has("kind")) + " \"description\": \"description\",\n" + " \"global\": true,\n" + " \"client_secret\": \"client_secret\",\n" - + " \"app_type\": \"app_type\",\n" + + " \"app_type\": \"native\",\n" + " \"logo_uri\": \"logo_uri\",\n" + " \"is_first_party\": true,\n" + " \"oidc_conformant\": true,\n" @@ -147,13 +148,13 @@ else if (actualJson.has("kind")) + " ],\n" + " \"session_transfer\": {\n" + " \"can_create_session_transfer_token\": true,\n" + + " \"enforce_cascade_revocation\": true,\n" + " \"allowed_authentication_methods\": [\n" + " \"cookie\"\n" + " ],\n" + " \"enforce_device_binding\": \"ip\",\n" + " \"allow_refresh_token\": true,\n" - + " \"enforce_online_refresh_tokens\": true,\n" - + " \"enforce_cascade_revocation\": true\n" + + " \"enforce_online_refresh_tokens\": true\n" + " },\n" + " \"oidc_logout\": {\n" + " \"backchannel_logout_urls\": [\n" @@ -164,6 +165,9 @@ else if (actualJson.has("kind")) + " \"selected_initiators\": [\n" + " \"rp-logout\"\n" + " ]\n" + + " },\n" + + " \"backchannel_logout_session_metadata\": {\n" + + " \"include\": true\n" + " }\n" + " },\n" + " \"grant_types\": [\n" @@ -349,6 +353,7 @@ else if (actualJson.has("kind")) + " }\n" + " },\n" + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"is_token_endpoint_ip_header_trusted\": true,\n" + " \"client_metadata\": {\n" + " \"key\": \"value\"\n" + " },\n" @@ -382,6 +387,9 @@ else if (actualJson.has("kind")) + " },\n" + " \"organization_usage\": \"deny\",\n" + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"organization_discovery_methods\": [\n" + + " \"email\"\n" + + " ],\n" + " \"client_authentication_methods\": {\n" + " \"private_key_jwt\": {\n" + " \"credentials\": [\n" @@ -416,6 +424,12 @@ else if (actualJson.has("kind")) + " ]\n" + " },\n" + " \"compliance_level\": \"none\",\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"token_exchange\": {\n" + + " \"allow_any_profile_of_type\": [\n" + + " \"custom_authentication\"\n" + + " ]\n" + + " },\n" + " \"par_request_expiry\": 1,\n" + " \"token_quota\": {\n" + " \"client_credentials\": {\n" @@ -423,7 +437,26 @@ else if (actualJson.has("kind")) + " \"per_day\": 1,\n" + " \"per_hour\": 1\n" + " }\n" - + " }\n" + + " },\n" + + " \"express_configuration\": {\n" + + " \"initiate_login_uri_template\": \"initiate_login_uri_template\",\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" + + " \"connection_profile_id\": \"connection_profile_id\",\n" + + " \"enable_client\": true,\n" + + " \"enable_organization\": true,\n" + + " \"linked_clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"okta_oin_client_id\": \"okta_oin_client_id\",\n" + + " \"admin_login_domain\": \"admin_login_domain\",\n" + + " \"oin_submission_id\": \"oin_submission_id\"\n" + + " },\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"async_approval_notification_channels\": [\n" + + " \"guardian-push\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -462,13 +495,13 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); GetClientResponseContent response = client.clients() .get( "id", GetClientRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -485,7 +518,7 @@ public void testGet() throws Exception { + " \"description\": \"description\",\n" + " \"global\": true,\n" + " \"client_secret\": \"client_secret\",\n" - + " \"app_type\": \"app_type\",\n" + + " \"app_type\": \"native\",\n" + " \"logo_uri\": \"logo_uri\",\n" + " \"is_first_party\": true,\n" + " \"oidc_conformant\": true,\n" @@ -509,13 +542,13 @@ public void testGet() throws Exception { + " ],\n" + " \"session_transfer\": {\n" + " \"can_create_session_transfer_token\": true,\n" + + " \"enforce_cascade_revocation\": true,\n" + " \"allowed_authentication_methods\": [\n" + " \"cookie\"\n" + " ],\n" + " \"enforce_device_binding\": \"ip\",\n" + " \"allow_refresh_token\": true,\n" - + " \"enforce_online_refresh_tokens\": true,\n" - + " \"enforce_cascade_revocation\": true\n" + + " \"enforce_online_refresh_tokens\": true\n" + " },\n" + " \"oidc_logout\": {\n" + " \"backchannel_logout_urls\": [\n" @@ -526,6 +559,9 @@ public void testGet() throws Exception { + " \"selected_initiators\": [\n" + " \"rp-logout\"\n" + " ]\n" + + " },\n" + + " \"backchannel_logout_session_metadata\": {\n" + + " \"include\": true\n" + " }\n" + " },\n" + " \"grant_types\": [\n" @@ -711,6 +747,7 @@ public void testGet() throws Exception { + " }\n" + " },\n" + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"is_token_endpoint_ip_header_trusted\": true,\n" + " \"client_metadata\": {\n" + " \"key\": \"value\"\n" + " },\n" @@ -744,6 +781,9 @@ public void testGet() throws Exception { + " },\n" + " \"organization_usage\": \"deny\",\n" + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"organization_discovery_methods\": [\n" + + " \"email\"\n" + + " ],\n" + " \"client_authentication_methods\": {\n" + " \"private_key_jwt\": {\n" + " \"credentials\": [\n" @@ -778,6 +818,12 @@ public void testGet() throws Exception { + " ]\n" + " },\n" + " \"compliance_level\": \"none\",\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"token_exchange\": {\n" + + " \"allow_any_profile_of_type\": [\n" + + " \"custom_authentication\"\n" + + " ]\n" + + " },\n" + " \"par_request_expiry\": 1,\n" + " \"token_quota\": {\n" + " \"client_credentials\": {\n" @@ -785,7 +831,26 @@ public void testGet() throws Exception { + " \"per_day\": 1,\n" + " \"per_hour\": 1\n" + " }\n" - + " }\n" + + " },\n" + + " \"express_configuration\": {\n" + + " \"initiate_login_uri_template\": \"initiate_login_uri_template\",\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" + + " \"connection_profile_id\": \"connection_profile_id\",\n" + + " \"enable_client\": true,\n" + + " \"enable_organization\": true,\n" + + " \"linked_clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"okta_oin_client_id\": \"okta_oin_client_id\",\n" + + " \"admin_login_domain\": \"admin_login_domain\",\n" + + " \"oin_submission_id\": \"oin_submission_id\"\n" + + " },\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"async_approval_notification_channels\": [\n" + + " \"guardian-push\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -833,7 +898,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); UpdateClientResponseContent response = client.clients() .update("id", UpdateClientRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -880,7 +945,7 @@ else if (actualJson.has("kind")) + " \"description\": \"description\",\n" + " \"global\": true,\n" + " \"client_secret\": \"client_secret\",\n" - + " \"app_type\": \"app_type\",\n" + + " \"app_type\": \"native\",\n" + " \"logo_uri\": \"logo_uri\",\n" + " \"is_first_party\": true,\n" + " \"oidc_conformant\": true,\n" @@ -904,13 +969,13 @@ else if (actualJson.has("kind")) + " ],\n" + " \"session_transfer\": {\n" + " \"can_create_session_transfer_token\": true,\n" + + " \"enforce_cascade_revocation\": true,\n" + " \"allowed_authentication_methods\": [\n" + " \"cookie\"\n" + " ],\n" + " \"enforce_device_binding\": \"ip\",\n" + " \"allow_refresh_token\": true,\n" - + " \"enforce_online_refresh_tokens\": true,\n" - + " \"enforce_cascade_revocation\": true\n" + + " \"enforce_online_refresh_tokens\": true\n" + " },\n" + " \"oidc_logout\": {\n" + " \"backchannel_logout_urls\": [\n" @@ -921,6 +986,9 @@ else if (actualJson.has("kind")) + " \"selected_initiators\": [\n" + " \"rp-logout\"\n" + " ]\n" + + " },\n" + + " \"backchannel_logout_session_metadata\": {\n" + + " \"include\": true\n" + " }\n" + " },\n" + " \"grant_types\": [\n" @@ -1106,6 +1174,7 @@ else if (actualJson.has("kind")) + " }\n" + " },\n" + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"is_token_endpoint_ip_header_trusted\": true,\n" + " \"client_metadata\": {\n" + " \"key\": \"value\"\n" + " },\n" @@ -1139,6 +1208,9 @@ else if (actualJson.has("kind")) + " },\n" + " \"organization_usage\": \"deny\",\n" + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"organization_discovery_methods\": [\n" + + " \"email\"\n" + + " ],\n" + " \"client_authentication_methods\": {\n" + " \"private_key_jwt\": {\n" + " \"credentials\": [\n" @@ -1173,6 +1245,12 @@ else if (actualJson.has("kind")) + " ]\n" + " },\n" + " \"compliance_level\": \"none\",\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"token_exchange\": {\n" + + " \"allow_any_profile_of_type\": [\n" + + " \"custom_authentication\"\n" + + " ]\n" + + " },\n" + " \"par_request_expiry\": 1,\n" + " \"token_quota\": {\n" + " \"client_credentials\": {\n" @@ -1180,7 +1258,26 @@ else if (actualJson.has("kind")) + " \"per_day\": 1,\n" + " \"per_hour\": 1\n" + " }\n" - + " }\n" + + " },\n" + + " \"express_configuration\": {\n" + + " \"initiate_login_uri_template\": \"initiate_login_uri_template\",\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" + + " \"connection_profile_id\": \"connection_profile_id\",\n" + + " \"enable_client\": true,\n" + + " \"enable_organization\": true,\n" + + " \"linked_clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"okta_oin_client_id\": \"okta_oin_client_id\",\n" + + " \"admin_login_domain\": \"admin_login_domain\",\n" + + " \"oin_submission_id\": \"oin_submission_id\"\n" + + " },\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"async_approval_notification_channels\": [\n" + + " \"guardian-push\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -1219,7 +1316,7 @@ public void testRotateSecret() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"app_type\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true,\"enforce_cascade_revocation\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}}}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); RotateClientSecretResponseContent response = client.clients().rotateSecret("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -1236,7 +1333,7 @@ public void testRotateSecret() throws Exception { + " \"description\": \"description\",\n" + " \"global\": true,\n" + " \"client_secret\": \"client_secret\",\n" - + " \"app_type\": \"app_type\",\n" + + " \"app_type\": \"native\",\n" + " \"logo_uri\": \"logo_uri\",\n" + " \"is_first_party\": true,\n" + " \"oidc_conformant\": true,\n" @@ -1260,13 +1357,13 @@ public void testRotateSecret() throws Exception { + " ],\n" + " \"session_transfer\": {\n" + " \"can_create_session_transfer_token\": true,\n" + + " \"enforce_cascade_revocation\": true,\n" + " \"allowed_authentication_methods\": [\n" + " \"cookie\"\n" + " ],\n" + " \"enforce_device_binding\": \"ip\",\n" + " \"allow_refresh_token\": true,\n" - + " \"enforce_online_refresh_tokens\": true,\n" - + " \"enforce_cascade_revocation\": true\n" + + " \"enforce_online_refresh_tokens\": true\n" + " },\n" + " \"oidc_logout\": {\n" + " \"backchannel_logout_urls\": [\n" @@ -1277,6 +1374,9 @@ public void testRotateSecret() throws Exception { + " \"selected_initiators\": [\n" + " \"rp-logout\"\n" + " ]\n" + + " },\n" + + " \"backchannel_logout_session_metadata\": {\n" + + " \"include\": true\n" + " }\n" + " },\n" + " \"grant_types\": [\n" @@ -1462,6 +1562,7 @@ public void testRotateSecret() throws Exception { + " }\n" + " },\n" + " \"token_endpoint_auth_method\": \"none\",\n" + + " \"is_token_endpoint_ip_header_trusted\": true,\n" + " \"client_metadata\": {\n" + " \"key\": \"value\"\n" + " },\n" @@ -1495,6 +1596,9 @@ public void testRotateSecret() throws Exception { + " },\n" + " \"organization_usage\": \"deny\",\n" + " \"organization_require_behavior\": \"no_prompt\",\n" + + " \"organization_discovery_methods\": [\n" + + " \"email\"\n" + + " ],\n" + " \"client_authentication_methods\": {\n" + " \"private_key_jwt\": {\n" + " \"credentials\": [\n" @@ -1529,6 +1633,12 @@ public void testRotateSecret() throws Exception { + " ]\n" + " },\n" + " \"compliance_level\": \"none\",\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"token_exchange\": {\n" + + " \"allow_any_profile_of_type\": [\n" + + " \"custom_authentication\"\n" + + " ]\n" + + " },\n" + " \"par_request_expiry\": 1,\n" + " \"token_quota\": {\n" + " \"client_credentials\": {\n" @@ -1536,7 +1646,26 @@ public void testRotateSecret() throws Exception { + " \"per_day\": 1,\n" + " \"per_hour\": 1\n" + " }\n" - + " }\n" + + " },\n" + + " \"express_configuration\": {\n" + + " \"initiate_login_uri_template\": \"initiate_login_uri_template\",\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" + + " \"connection_profile_id\": \"connection_profile_id\",\n" + + " \"enable_client\": true,\n" + + " \"enable_organization\": true,\n" + + " \"linked_clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"okta_oin_client_id\": \"okta_oin_client_id\",\n" + + " \"admin_login_domain\": \"admin_login_domain\",\n" + + " \"oin_submission_id\": \"oin_submission_id\"\n" + + " },\n" + + " \"resource_server_identifier\": \"resource_server_identifier\",\n" + + " \"async_approval_notification_channels\": [\n" + + " \"guardian-push\"\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -1570,24 +1699,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionProfilesWireTest.java new file mode 100644 index 000000000..84794e9db --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionProfilesWireTest.java @@ -0,0 +1,588 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectionProfile; +import com.auth0.client.mgmt.types.CreateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.CreateConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileResponseContent; +import com.auth0.client.mgmt.types.GetConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListConnectionProfileRequestParameters; +import com.auth0.client.mgmt.types.ListConnectionProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateConnectionProfileResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionProfilesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"connection_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"connection_name_prefix_template\":\"connection_name_prefix_template\",\"enabled_features\":[\"scim\"]}]}")); + SyncPagingIterable response = client.connectionProfiles() + .list(ListConnectionProfileRequestParameters.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"organization\":{\"show_as_button\":\"none\",\"assign_membership_on_login\":\"none\"},\"connection_name_prefix_template\":\"connection_name_prefix_template\",\"enabled_features\":[\"scim\"],\"strategy_overrides\":{\"pingfederate\":{\"enabled_features\":[\"scim\"]},\"ad\":{\"enabled_features\":[\"scim\"]},\"adfs\":{\"enabled_features\":[\"scim\"]},\"waad\":{\"enabled_features\":[\"scim\"]},\"google-apps\":{\"enabled_features\":[\"scim\"]},\"okta\":{\"enabled_features\":[\"scim\"]},\"oidc\":{\"enabled_features\":[\"scim\"]},\"samlp\":{\"enabled_features\":[\"scim\"]}}}")); + CreateConnectionProfileResponseContent response = client.connectionProfiles() + .create(CreateConnectionProfileRequestContent.builder() + .name("name") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"name\": \"name\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"organization\": {\n" + + " \"show_as_button\": \"none\",\n" + + " \"assign_membership_on_login\": \"none\"\n" + + " },\n" + + " \"connection_name_prefix_template\": \"connection_name_prefix_template\",\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ],\n" + + " \"strategy_overrides\": {\n" + + " \"pingfederate\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"ad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"adfs\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"waad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"google-apps\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"okta\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"oidc\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"samlp\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testListTemplates() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"connection_profile_templates\":[{\"id\":\"id\",\"display_name\":\"display_name\"}]}")); + ListConnectionProfileTemplateResponseContent response = + client.connectionProfiles().listTemplates(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_profile_templates\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"display_name\": \"display_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetTemplate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"display_name\":\"display_name\",\"template\":{\"name\":\"name\",\"organization\":{\"show_as_button\":\"none\",\"assign_membership_on_login\":\"none\"},\"connection_name_prefix_template\":\"connection_name_prefix_template\",\"enabled_features\":[\"scim\"]}}")); + GetConnectionProfileTemplateResponseContent response = + client.connectionProfiles().getTemplate("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"template\": {\n" + + " \"name\": \"name\",\n" + + " \"organization\": {\n" + + " \"show_as_button\": \"none\",\n" + + " \"assign_membership_on_login\": \"none\"\n" + + " },\n" + + " \"connection_name_prefix_template\": \"connection_name_prefix_template\",\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"organization\":{\"show_as_button\":\"none\",\"assign_membership_on_login\":\"none\"},\"connection_name_prefix_template\":\"connection_name_prefix_template\",\"enabled_features\":[\"scim\"],\"strategy_overrides\":{\"pingfederate\":{\"enabled_features\":[\"scim\"]},\"ad\":{\"enabled_features\":[\"scim\"]},\"adfs\":{\"enabled_features\":[\"scim\"]},\"waad\":{\"enabled_features\":[\"scim\"]},\"google-apps\":{\"enabled_features\":[\"scim\"]},\"okta\":{\"enabled_features\":[\"scim\"]},\"oidc\":{\"enabled_features\":[\"scim\"]},\"samlp\":{\"enabled_features\":[\"scim\"]}}}")); + GetConnectionProfileResponseContent response = + client.connectionProfiles().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"organization\": {\n" + + " \"show_as_button\": \"none\",\n" + + " \"assign_membership_on_login\": \"none\"\n" + + " },\n" + + " \"connection_name_prefix_template\": \"connection_name_prefix_template\",\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ],\n" + + " \"strategy_overrides\": {\n" + + " \"pingfederate\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"ad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"adfs\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"waad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"google-apps\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"okta\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"oidc\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"samlp\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connectionProfiles().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"organization\":{\"show_as_button\":\"none\",\"assign_membership_on_login\":\"none\"},\"connection_name_prefix_template\":\"connection_name_prefix_template\",\"enabled_features\":[\"scim\"],\"strategy_overrides\":{\"pingfederate\":{\"enabled_features\":[\"scim\"]},\"ad\":{\"enabled_features\":[\"scim\"]},\"adfs\":{\"enabled_features\":[\"scim\"]},\"waad\":{\"enabled_features\":[\"scim\"]},\"google-apps\":{\"enabled_features\":[\"scim\"]},\"okta\":{\"enabled_features\":[\"scim\"]},\"oidc\":{\"enabled_features\":[\"scim\"]},\"samlp\":{\"enabled_features\":[\"scim\"]}}}")); + UpdateConnectionProfileResponseContent response = client.connectionProfiles() + .update("id", UpdateConnectionProfileRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"organization\": {\n" + + " \"show_as_button\": \"none\",\n" + + " \"assign_membership_on_login\": \"none\"\n" + + " },\n" + + " \"connection_name_prefix_template\": \"connection_name_prefix_template\",\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ],\n" + + " \"strategy_overrides\": {\n" + + " \"pingfederate\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"ad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"adfs\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"waad\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"google-apps\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"okta\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"oidc\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " },\n" + + " \"samlp\": {\n" + + " \"enabled_features\": [\n" + + " \"scim\"\n" + + " ]\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java index 4f43f7159..249f7d76e 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsClientsWireTest.java @@ -2,6 +2,7 @@ import com.auth0.client.mgmt.connections.types.GetConnectionEnabledClientsRequestParameters; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.ConnectionEnabledClient; import com.auth0.client.mgmt.types.UpdateEnabledClientConnectionsRequestContentItem; @@ -46,8 +47,8 @@ public void testGet() throws Exception { .get( "id", GetConnectionEnabledClientsRequestParameters.builder() - .take(1) - .from("from") + .take(OptionalNullable.of(1)) + .from(OptionalNullable.of("from")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -106,24 +107,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningSynchronizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningSynchronizationsWireTest.java new file mode 100644 index 000000000..728122b8b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningSynchronizationsWireTest.java @@ -0,0 +1,117 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.CreateDirectorySynchronizationResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsDirectoryProvisioningSynchronizationsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"synchronization_id\":\"synchronization_id\",\"status\":\"status\"}")); + CreateDirectorySynchronizationResponseContent response = + client.connections().directoryProvisioning().synchronizations().create("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"synchronization_id\": \"synchronization_id\",\n" + + " \"status\": \"status\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java new file mode 100644 index 000000000..b278d170a --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java @@ -0,0 +1,326 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.CreateDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningDefaultMappingResponseContent; +import com.auth0.client.mgmt.types.GetDirectoryProvisioningResponseContent; +import com.auth0.client.mgmt.types.UpdateDirectoryProvisioningResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ConnectionsDirectoryProvisioningWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + GetDirectoryProvisioningResponseContent response = + client.connections().directoryProvisioning().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"idp\": \"idp\"\n" + + " }\n" + + " ],\n" + + " \"synchronize_automatically\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_status\": \"last_synchronization_status\",\n" + + " \"last_synchronization_error\": \"last_synchronization_error\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + CreateDirectoryProvisioningResponseContent response = + client.connections().directoryProvisioning().create("id", OptionalNullable.absent()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"idp\": \"idp\"\n" + + " }\n" + + " ],\n" + + " \"synchronize_automatically\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_status\": \"last_synchronization_status\",\n" + + " \"last_synchronization_error\": \"last_synchronization_error\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.connections().directoryProvisioning().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + UpdateDirectoryProvisioningResponseContent response = + client.connections().directoryProvisioning().update("id", OptionalNullable.absent()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection_name\": \"connection_name\",\n" + + " \"strategy\": \"strategy\",\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"idp\": \"idp\"\n" + + " }\n" + + " ],\n" + + " \"synchronize_automatically\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_synchronization_status\": \"last_synchronization_status\",\n" + + " \"last_synchronization_error\": \"last_synchronization_error\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetDefaultMapping() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}]}")); + GetDirectoryProvisioningDefaultMappingResponseContent response = + client.connections().directoryProvisioning().getDefaultMapping("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"mapping\": [\n" + + " {\n" + + " \"auth0\": \"auth0\",\n" + + " \"idp\": \"idp\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java index 27d4d40f9..0bcb21e88 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsKeysWireTest.java @@ -158,24 +158,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java index 585566390..6b00ca842 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationTokensWireTest.java @@ -192,24 +192,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java index 1bf4b22a4..d71466634 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsScimConfigurationWireTest.java @@ -333,24 +333,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java index 57acdee43..7451bd971 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsUsersWireTest.java @@ -48,24 +48,29 @@ public void testDeleteByEmail() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java index 2b5ae2802..e6bb6919e 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.ConnectionForList; import com.auth0.client.mgmt.types.ConnectionIdentityProviderEnum; @@ -47,14 +48,14 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"next\":\"next\",\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}]}")); + "{\"next\":\"next\",\"connections\":[{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"is_domain_connection\":true,\"show_as_button\":true,\"authentication\":{\"active\":true},\"connected_accounts\":{\"active\":true}}]}")); SyncPagingIterable response = client.connections() .list(ListConnectionsQueryParameters.builder() - .from("from") - .take(1) - .name("name") - .fields("fields") - .includeFields(true) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .name(OptionalNullable.of("name")) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -72,7 +73,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"},\"authentication\":{\"active\":true},\"connected_accounts\":{\"active\":true,\"cross_app_access\":true}}")); CreateConnectionResponseContent response = client.connections() .create(CreateConnectionRequestContent.builder() .name("name") @@ -133,6 +134,13 @@ else if (actualJson.has("kind")) + " \"show_as_button\": true,\n" + " \"metadata\": {\n" + " \"key\": \"value\"\n" + + " },\n" + + " \"authentication\": {\n" + + " \"active\": true\n" + + " },\n" + + " \"connected_accounts\": {\n" + + " \"active\": true,\n" + + " \"cross_app_access\": true\n" + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -172,13 +180,13 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"},\"authentication\":{\"active\":true},\"connected_accounts\":{\"active\":true,\"cross_app_access\":true}}")); GetConnectionResponseContent response = client.connections() .get( "id", GetConnectionRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -206,6 +214,13 @@ public void testGet() throws Exception { + " \"show_as_button\": true,\n" + " \"metadata\": {\n" + " \"key\": \"value\"\n" + + " },\n" + + " \"authentication\": {\n" + + " \"active\": true\n" + + " },\n" + + " \"connected_accounts\": {\n" + + " \"active\": true,\n" + + " \"cross_app_access\": true\n" + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -254,7 +269,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"}}")); + "{\"name\":\"name\",\"display_name\":\"display_name\",\"options\":{\"key\":\"value\"},\"id\":\"id\",\"strategy\":\"strategy\",\"realms\":[\"realms\"],\"enabled_clients\":[\"enabled_clients\"],\"is_domain_connection\":true,\"show_as_button\":true,\"metadata\":{\"key\":\"value\"},\"authentication\":{\"active\":true},\"connected_accounts\":{\"active\":true,\"cross_app_access\":true}}")); UpdateConnectionResponseContent response = client.connections() .update("id", UpdateConnectionRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -312,6 +327,13 @@ else if (actualJson.has("kind")) + " \"show_as_button\": true,\n" + " \"metadata\": {\n" + " \"key\": \"value\"\n" + + " },\n" + + " \"authentication\": {\n" + + " \"active\": true\n" + + " },\n" + + " \"connected_accounts\": {\n" + + " \"active\": true,\n" + + " \"cross_app_access\": true\n" + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -355,24 +377,29 @@ public void testCheckStatus() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java index d4737366f..59fc66f48 100644 --- a/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java @@ -1,11 +1,13 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.CreateCustomDomainRequestContent; import com.auth0.client.mgmt.types.CreateCustomDomainResponseContent; import com.auth0.client.mgmt.types.CustomDomain; import com.auth0.client.mgmt.types.CustomDomainProvisioningTypeEnum; import com.auth0.client.mgmt.types.GetCustomDomainResponseContent; +import com.auth0.client.mgmt.types.ListCustomDomainsRequestParameters; import com.auth0.client.mgmt.types.TestCustomDomainResponseContent; import com.auth0.client.mgmt.types.UpdateCustomDomainRequestContent; import com.auth0.client.mgmt.types.UpdateCustomDomainResponseContent; @@ -47,8 +49,16 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "[{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}]")); - List response = client.customDomains().list(); + "[{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}]")); + List response = client.customDomains() + .list(ListCustomDomainsRequestParameters.builder() + .take(OptionalNullable.of(1)) + .from(OptionalNullable.of("from")) + .q(OptionalNullable.of("q")) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .sort(OptionalNullable.of("sort")) + .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("GET", request.getMethod()); @@ -62,6 +72,7 @@ public void testList() throws Exception { + " \"custom_domain_id\": \"custom_domain_id\",\n" + " \"domain\": \"domain\",\n" + " \"primary\": true,\n" + + " \"status\": \"pending_verification\",\n" + " \"type\": \"auth0_managed_certs\",\n" + " \"origin_domain_name\": \"origin_domain_name\",\n" + " \"verification\": {\n" @@ -70,10 +81,22 @@ public void testList() throws Exception { + " \"name\": \"cname\",\n" + " \"record\": \"record\"\n" + " }\n" - + " ]\n" + + " ],\n" + + " \"status\": \"verified\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"last_verified_at\": \"last_verified_at\"\n" + " },\n" + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" - + " \"tls_policy\": \"tls_policy\"\n" + + " \"tls_policy\": \"tls_policy\",\n" + + " \"domain_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"certificate\": {\n" + + " \"status\": \"provisioning\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"certificate_authority\": \"letsencrypt\",\n" + + " \"renews_before\": \"renews_before\"\n" + + " }\n" + " }\n" + "]"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -113,7 +136,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}")); CreateCustomDomainResponseContent response = client.customDomains() .create(CreateCustomDomainRequestContent.builder() .domain("domain") @@ -161,6 +184,7 @@ else if (actualJson.has("kind")) + " \"custom_domain_id\": \"custom_domain_id\",\n" + " \"domain\": \"domain\",\n" + " \"primary\": true,\n" + + " \"status\": \"pending_verification\",\n" + " \"type\": \"auth0_managed_certs\",\n" + " \"verification\": {\n" + " \"methods\": [\n" @@ -168,10 +192,22 @@ else if (actualJson.has("kind")) + " \"name\": \"cname\",\n" + " \"record\": \"record\"\n" + " }\n" - + " ]\n" + + " ],\n" + + " \"status\": \"verified\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"last_verified_at\": \"last_verified_at\"\n" + " },\n" + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" - + " \"tls_policy\": \"tls_policy\"\n" + + " \"tls_policy\": \"tls_policy\",\n" + + " \"domain_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"certificate\": {\n" + + " \"status\": \"provisioning\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"certificate_authority\": \"letsencrypt\",\n" + + " \"renews_before\": \"renews_before\"\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -210,7 +246,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}")); GetCustomDomainResponseContent response = client.customDomains().get("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -224,6 +260,7 @@ public void testGet() throws Exception { + " \"custom_domain_id\": \"custom_domain_id\",\n" + " \"domain\": \"domain\",\n" + " \"primary\": true,\n" + + " \"status\": \"pending_verification\",\n" + " \"type\": \"auth0_managed_certs\",\n" + " \"origin_domain_name\": \"origin_domain_name\",\n" + " \"verification\": {\n" @@ -232,10 +269,22 @@ public void testGet() throws Exception { + " \"name\": \"cname\",\n" + " \"record\": \"record\"\n" + " }\n" - + " ]\n" + + " ],\n" + + " \"status\": \"verified\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"last_verified_at\": \"last_verified_at\"\n" + " },\n" + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" - + " \"tls_policy\": \"tls_policy\"\n" + + " \"tls_policy\": \"tls_policy\",\n" + + " \"domain_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"certificate\": {\n" + + " \"status\": \"provisioning\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"certificate_authority\": \"letsencrypt\",\n" + + " \"renews_before\": \"renews_before\"\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -283,7 +332,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}")); UpdateCustomDomainResponseContent response = client.customDomains() .update("id", UpdateCustomDomainRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -327,6 +376,7 @@ else if (actualJson.has("kind")) + " \"custom_domain_id\": \"custom_domain_id\",\n" + " \"domain\": \"domain\",\n" + " \"primary\": true,\n" + + " \"status\": \"pending_verification\",\n" + " \"type\": \"auth0_managed_certs\",\n" + " \"verification\": {\n" + " \"methods\": [\n" @@ -334,10 +384,22 @@ else if (actualJson.has("kind")) + " \"name\": \"cname\",\n" + " \"record\": \"record\"\n" + " }\n" - + " ]\n" + + " ],\n" + + " \"status\": \"verified\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"last_verified_at\": \"last_verified_at\"\n" + " },\n" + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" - + " \"tls_policy\": \"tls_policy\"\n" + + " \"tls_policy\": \"tls_policy\",\n" + + " \"domain_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"certificate\": {\n" + + " \"status\": \"provisioning\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"certificate_authority\": \"letsencrypt\",\n" + + " \"renews_before\": \"renews_before\"\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -419,7 +481,7 @@ public void testVerify() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"type\":\"auth0_managed_certs\",\"cname_api_key\":\"cname_api_key\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}]},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\"}")); + "{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"cname_api_key\":\"cname_api_key\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}")); VerifyCustomDomainResponseContent response = client.customDomains().verify("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -433,6 +495,7 @@ public void testVerify() throws Exception { + " \"custom_domain_id\": \"custom_domain_id\",\n" + " \"domain\": \"domain\",\n" + " \"primary\": true,\n" + + " \"status\": \"pending_verification\",\n" + " \"type\": \"auth0_managed_certs\",\n" + " \"cname_api_key\": \"cname_api_key\",\n" + " \"origin_domain_name\": \"origin_domain_name\",\n" @@ -442,10 +505,22 @@ public void testVerify() throws Exception { + " \"name\": \"cname\",\n" + " \"record\": \"record\"\n" + " }\n" - + " ]\n" + + " ],\n" + + " \"status\": \"verified\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"last_verified_at\": \"last_verified_at\"\n" + " },\n" + " \"custom_client_ip_header\": \"custom_client_ip_header\",\n" - + " \"tls_policy\": \"tls_policy\"\n" + + " \"tls_policy\": \"tls_policy\",\n" + + " \"domain_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"certificate\": {\n" + + " \"status\": \"provisioning\",\n" + + " \"error_msg\": \"error_msg\",\n" + + " \"certificate_authority\": \"letsencrypt\",\n" + + " \"renews_before\": \"renews_before\"\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -479,24 +554,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java index 8c710e153..0902ee9e0 100644 --- a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialRequestContent; import com.auth0.client.mgmt.types.CreatePublicKeyDeviceCredentialResponseContent; @@ -46,14 +47,14 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"device_credentials\":[{\"id\":\"id\",\"device_name\":\"device_name\",\"device_id\":\"device_id\",\"type\":\"public_key\",\"user_id\":\"user_id\",\"client_id\":\"client_id\"}]}")); SyncPagingIterable response = client.deviceCredentials() .list(ListDeviceCredentialsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .fields("fields") - .includeFields(true) - .userId("user_id") - .clientId("client_id") - .type(DeviceCredentialTypeEnum.PUBLIC_KEY) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .userId(OptionalNullable.of("user_id")) + .clientId(OptionalNullable.of("client_id")) + .type(OptionalNullable.of(DeviceCredentialTypeEnum.PUBLIC_KEY)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -159,24 +160,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java b/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java index f0dab602d..6e5bfa613 100644 --- a/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java +++ b/src/test/java/com/auth0/client/mgmt/DynamicTokenManagementTest.java @@ -50,8 +50,6 @@ public void testSupplierEvaluatedOnEachRequest() { Map headers3 = options.headers(null); assertEquals("Bearer token-3", headers3.get("Authorization")); assertEquals(3, evaluationCount.get()); - - System.out.println("✅ Supplier is evaluated on each request: " + evaluationCount.get() + " times"); } @Test @@ -68,7 +66,6 @@ synchronized String getToken() { refreshCount++; token = "refreshed-token-" + refreshCount; expiryTime = System.currentTimeMillis() + 1000; // 1 second expiry - System.out.println("Token refreshed: " + token); } return token; } @@ -107,8 +104,6 @@ int getRefreshCount() { Map headers3 = options.headers(null); assertEquals("Bearer refreshed-token-2", headers3.get("Authorization")); assertEquals(2, tokenStore.getRefreshCount()); // Token refreshed - - System.out.println("✅ Token automatically refreshed " + tokenStore.getRefreshCount() + " times"); } @Test @@ -134,8 +129,6 @@ public void testStaticAndDynamicHeadersCoexist() { assertEquals("static-value", headers2.get("X-Static-Header")); assertEquals("dynamic-2", headers2.get("X-Dynamic-Header")); assertEquals("another-static", headers2.get("X-Another-Static")); - - System.out.println("✅ Static and dynamic headers coexist correctly"); } @Test @@ -178,8 +171,6 @@ public void testMultipleDynamicHeaders() { assertEquals("session-updated", headers2.get("X-Session-ID")); String timestamp2 = headers2.get("X-Timestamp"); assertNotEquals(timestamp1, timestamp2); - - System.out.println("✅ Multiple dynamic headers work independently"); } @Test @@ -212,8 +203,6 @@ public void testRequestOptionsOverrideDynamicHeaders() { // Verify dynamic supplier was still called (even though overridden) assertEquals(2, dynamicCounter.get()); - - System.out.println("✅ RequestOptions correctly override dynamic headers"); } @Test @@ -226,7 +215,6 @@ public void testManagementApiUsesDynamicHeaders() throws Exception { .environment(Environment.custom("https://test.auth0.com/api/v2")) .addHeader("Authorization", () -> { int version = tokenVersion.incrementAndGet(); - System.out.println("Token supplier called: version " + version); return "Bearer dynamic-token-v" + version; }) .build(); @@ -245,7 +233,6 @@ public void testManagementApiUsesDynamicHeaders() throws Exception { assertEquals("Bearer dynamic-token-v3", headers3.get("Authorization")); assertEquals(3, tokenVersion.get()); - System.out.println("✅ ManagementApi correctly uses dynamic headers"); } @Test @@ -291,8 +278,6 @@ public void testThreadSafetyOfDynamicHeaders() throws Exception { // Verify counter was incremented correctly assertEquals(threadCount, globalCounter.get()); - - System.out.println("✅ Dynamic headers are thread-safe"); } @Test @@ -325,7 +310,6 @@ public void testSupplierExceptionHandling() { assertEquals("Bearer token-3", headers3.get("Authorization")); assertEquals(3, callCount.get()); - System.out.println("✅ Supplier exceptions are properly propagated"); } @Test @@ -345,7 +329,6 @@ synchronized String getAccessToken() { tokenFetchCount++; accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.mock-m2m-token-" + tokenFetchCount; expiresAt = System.currentTimeMillis() + 86400000; // 24 hours - System.out.println("Fetched new M2M token (fetch #" + tokenFetchCount + ")"); } return accessToken; } @@ -390,9 +373,6 @@ int getTokenFetchCount() { Map headersAfterExpiry = clientOptions.headers(null); assertTrue(headersAfterExpiry.get("Authorization").contains("mock-m2m-token-2")); assertEquals(2, tokenManager.getTokenFetchCount()); - - System.out.println("✅ Auth0 M2M token refresh scenario works correctly"); - } catch (Exception e) { fail("Test failed: " + e.getMessage()); } diff --git a/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java index 3ec5a0a25..591d3e903 100644 --- a/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EmailTemplatesWireTest.java @@ -370,24 +370,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java b/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java index f5cc834a6..15d002af2 100644 --- a/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EmailsProviderWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.emails.types.CreateEmailProviderRequestContent; import com.auth0.client.mgmt.emails.types.GetEmailProviderRequestParameters; import com.auth0.client.mgmt.emails.types.UpdateEmailProviderRequestContent; @@ -50,8 +51,8 @@ public void testGet() throws Exception { GetEmailProviderResponseContent response = client.emails() .provider() .get(GetEmailProviderRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -314,24 +315,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java index 1b8877388..60c22b59a 100644 --- a/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsDeliveriesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.eventstreams.types.ListEventStreamDeliveriesRequestParameters; import com.auth0.client.mgmt.types.EventStreamDelivery; import com.auth0.client.mgmt.types.GetEventStreamDeliveryHistoryResponseContent; @@ -47,12 +48,12 @@ public void testList() throws Exception { .list( "id", ListEventStreamDeliveriesRequestParameters.builder() - .statuses("statuses") - .eventTypes("event_types") - .dateFrom("date_from") - .dateTo("date_to") - .from("from") - .take(1) + .statuses(OptionalNullable.of("statuses")) + .eventTypes(OptionalNullable.of("event_types")) + .dateFrom(OptionalNullable.of("date_from")) + .dateTo(OptionalNullable.of("date_to")) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -185,24 +186,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java index 1401c0f28..0bcaf1813 100644 --- a/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsRedeliveriesWireTest.java @@ -133,24 +133,29 @@ public void testCreateById() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java index f50181459..d725581be 100644 --- a/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; @@ -12,9 +13,7 @@ import com.auth0.client.mgmt.types.EventStreamWebhookConfiguration; import com.auth0.client.mgmt.types.EventStreamWebhookDestination; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; -import com.auth0.client.mgmt.types.EventStreamsGetStatsRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; -import com.auth0.client.mgmt.types.GetEventStreamStatsResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; @@ -58,8 +57,8 @@ public void testList() throws Exception { "[{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]")); List response = client.eventStreams() .list(ListEventStreamsRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -422,83 +421,6 @@ else if (actualResponseNode.has("kind")) } } - @Test - public void testGetStats() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"window\":{\"date_from\":\"2024-01-15T09:30:00Z\",\"date_to\":\"2024-01-15T09:30:00Z\",\"bucket_interval\":{\"scale_factor\":1}},\"buckets\":[\"2024-01-15T09:30:00Z\"],\"metrics\":[{\"name\":\"name\",\"window_total\":1.1,\"type\":\"type\",\"data\":[1.1]}]}")); - GetEventStreamStatsResponseContent response = client.eventStreams() - .getStats( - "id", - EventStreamsGetStatsRequest.builder() - .dateFrom("date_from") - .dateTo("date_to") - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("GET", request.getMethod()); - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"id\": \"id\",\n" - + " \"name\": \"name\",\n" - + " \"window\": {\n" - + " \"date_from\": \"2024-01-15T09:30:00Z\",\n" - + " \"date_to\": \"2024-01-15T09:30:00Z\",\n" - + " \"bucket_interval\": {\n" - + " \"scale_factor\": 1\n" - + " }\n" - + " },\n" - + " \"buckets\": [\n" - + " \"2024-01-15T09:30:00Z\"\n" - + " ],\n" - + " \"metrics\": [\n" - + " {\n" - + " \"name\": \"name\",\n" - + " \"window_total\": 1.1,\n" - + " \"type\": \"type\",\n" - + " \"data\": [\n" - + " 1.1\n" - + " ]\n" - + " }\n" - + " ]\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertTrue( - jsonEquals(expectedResponseNode, actualResponseNode), - "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } - @Test public void testTest() throws Exception { server.enqueue( @@ -602,24 +524,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java b/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java index 187d64e52..8e28d88cc 100644 --- a/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/FlowsExecutionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.flows.types.ExecutionsGetRequest; import com.auth0.client.mgmt.flows.types.ExecutionsListRequest; @@ -47,7 +48,10 @@ public void testList() throws Exception { .executions() .list( "flow_id", - ExecutionsListRequest.builder().from("from").take(1).build()); + ExecutionsListRequest.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("GET", request.getMethod()); @@ -130,24 +134,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/FlowsVaultConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/FlowsVaultConnectionsWireTest.java new file mode 100644 index 000000000..81696be8e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/FlowsVaultConnectionsWireTest.java @@ -0,0 +1,369 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.flows.vault.types.ListFlowsVaultConnectionsRequestParameters; +import com.auth0.client.mgmt.flows.vault.types.UpdateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionActivecampaign; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionActivecampaignApiKey; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionRequestContent; +import com.auth0.client.mgmt.types.CreateFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.FlowsVaultConnectioSetupApiKeyWithBaseUrl; +import com.auth0.client.mgmt.types.FlowsVaultConnectionSummary; +import com.auth0.client.mgmt.types.GetFlowsVaultConnectionResponseContent; +import com.auth0.client.mgmt.types.UpdateFlowsVaultConnectionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class FlowsVaultConnectionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"connections\":[{\"id\":\"id\",\"app_id\":\"app_id\",\"name\":\"name\",\"account_name\":\"account_name\",\"ready\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"refreshed_at\":\"2024-01-15T09:30:00Z\",\"fingerprint\":\"fingerprint\"}]}")); + SyncPagingIterable response = client.flows() + .vault() + .connections() + .list(ListFlowsVaultConnectionsRequestParameters.builder() + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"app_id\":\"app_id\",\"environment\":\"environment\",\"name\":\"name\",\"account_name\":\"account_name\",\"ready\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"refreshed_at\":\"2024-01-15T09:30:00Z\",\"fingerprint\":\"fingerprint\"}")); + CreateFlowsVaultConnectionResponseContent response = client.flows() + .vault() + .connections() + .create(CreateFlowsVaultConnectionRequestContent.of(CreateFlowsVaultConnectionActivecampaign.of( + CreateFlowsVaultConnectionActivecampaignApiKey.builder() + .name("name") + .appId("ACTIVECAMPAIGN") + .setup(FlowsVaultConnectioSetupApiKeyWithBaseUrl.builder() + .type("API_KEY") + .apiKey("api_key") + .baseUrl("base_url") + .build()) + .build()))); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"app_id\": \"ACTIVECAMPAIGN\",\n" + + " \"setup\": {\n" + + " \"type\": \"API_KEY\",\n" + + " \"api_key\": \"api_key\",\n" + + " \"base_url\": \"base_url\"\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"app_id\": \"app_id\",\n" + + " \"environment\": \"environment\",\n" + + " \"name\": \"name\",\n" + + " \"account_name\": \"account_name\",\n" + + " \"ready\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"refreshed_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"fingerprint\": \"fingerprint\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"app_id\":\"app_id\",\"environment\":\"environment\",\"name\":\"name\",\"account_name\":\"account_name\",\"ready\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"refreshed_at\":\"2024-01-15T09:30:00Z\",\"fingerprint\":\"fingerprint\"}")); + GetFlowsVaultConnectionResponseContent response = + client.flows().vault().connections().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"app_id\": \"app_id\",\n" + + " \"environment\": \"environment\",\n" + + " \"name\": \"name\",\n" + + " \"account_name\": \"account_name\",\n" + + " \"ready\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"refreshed_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"fingerprint\": \"fingerprint\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.flows().vault().connections().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"app_id\":\"app_id\",\"environment\":\"environment\",\"name\":\"name\",\"account_name\":\"account_name\",\"ready\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"refreshed_at\":\"2024-01-15T09:30:00Z\",\"fingerprint\":\"fingerprint\"}")); + UpdateFlowsVaultConnectionResponseContent response = client.flows() + .vault() + .connections() + .update("id", UpdateFlowsVaultConnectionRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"app_id\": \"app_id\",\n" + + " \"environment\": \"environment\",\n" + + " \"name\": \"name\",\n" + + " \"account_name\": \"account_name\",\n" + + " \"ready\": true,\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"refreshed_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"fingerprint\": \"fingerprint\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java b/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java index 17bd6646e..2e8e62073 100644 --- a/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/FlowsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateFlowRequestContent; import com.auth0.client.mgmt.types.CreateFlowResponseContent; @@ -49,10 +50,10 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"flows\":[{\"id\":\"id\",\"name\":\"name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"executed_at\":\"executed_at\"}]}")); SyncPagingIterable response = client.flows() .list(FlowsListRequest.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .synchronous(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .synchronous(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -339,24 +340,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/FormsWireTest.java b/src/test/java/com/auth0/client/mgmt/FormsWireTest.java index cf4623501..d7b66d58c 100644 --- a/src/test/java/com/auth0/client/mgmt/FormsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/FormsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateFormRequestContent; import com.auth0.client.mgmt.types.CreateFormResponseContent; @@ -49,9 +50,9 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"forms\":[{\"id\":\"id\",\"name\":\"name\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}]}")); SyncPagingIterable response = client.forms() .list(ListFormsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -69,7 +70,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":{\"key\":\"value\"}},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"$ending\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); CreateFormResponseContent response = client.forms() .create(CreateFormRequestContent.builder().name("name").build()); RecordedRequest request = server.takeRequest(); @@ -125,7 +126,9 @@ else if (actualJson.has("kind")) + " \"default\": \"default\"\n" + " },\n" + " \"translations\": {\n" - + " \"key\": \"value\"\n" + + " \"key\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + " },\n" + " \"nodes\": [\n" + " {\n" @@ -147,7 +150,7 @@ else if (actualJson.has("kind")) + " \"key\": \"key\"\n" + " }\n" + " ],\n" - + " \"next_node\": \"next_node\",\n" + + " \"next_node\": \"$ending\",\n" + " \"coordinates\": {\n" + " \"x\": 1,\n" + " \"y\": 1\n" @@ -212,7 +215,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":{\"key\":\"value\"}},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"$ending\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); GetFormResponseContent response = client.forms().get("id", GetFormRequestParameters.builder().build()); RecordedRequest request = server.takeRequest(); @@ -239,7 +242,9 @@ public void testGet() throws Exception { + " \"default\": \"default\"\n" + " },\n" + " \"translations\": {\n" - + " \"key\": \"value\"\n" + + " \"key\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + " },\n" + " \"nodes\": [\n" + " {\n" @@ -261,7 +266,7 @@ public void testGet() throws Exception { + " \"key\": \"key\"\n" + " }\n" + " ],\n" - + " \"next_node\": \"next_node\",\n" + + " \"next_node\": \"$ending\",\n" + " \"coordinates\": {\n" + " \"x\": 1,\n" + " \"y\": 1\n" @@ -335,7 +340,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":\"value\"},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"next_node\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); + "{\"id\":\"id\",\"name\":\"name\",\"messages\":{\"errors\":{\"key\":\"value\"},\"custom\":{\"key\":\"value\"}},\"languages\":{\"primary\":\"primary\",\"default\":\"default\"},\"translations\":{\"key\":{\"key\":\"value\"}},\"nodes\":[{\"id\":\"id\",\"type\":\"FLOW\",\"coordinates\":{\"x\":1,\"y\":1},\"alias\":\"alias\",\"config\":{\"flow_id\":\"flow_id\"}}],\"start\":{\"hidden_fields\":[{\"key\":\"key\"}],\"next_node\":\"$ending\",\"coordinates\":{\"x\":1,\"y\":1}},\"ending\":{\"redirection\":{\"delay\":1,\"target\":\"target\"},\"after_submit\":{\"flow_id\":\"flow_id\"},\"coordinates\":{\"x\":1,\"y\":1},\"resume_flow\":true},\"style\":{\"css\":\"css\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"embedded_at\":\"embedded_at\",\"submitted_at\":\"submitted_at\"}")); UpdateFormResponseContent response = client.forms().update("id", UpdateFormRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -391,7 +396,9 @@ else if (actualJson.has("kind")) + " \"default\": \"default\"\n" + " },\n" + " \"translations\": {\n" - + " \"key\": \"value\"\n" + + " \"key\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + " },\n" + " \"nodes\": [\n" + " {\n" @@ -413,7 +420,7 @@ else if (actualJson.has("kind")) + " \"key\": \"key\"\n" + " }\n" + " ],\n" - + " \"next_node\": \"next_node\",\n" + + " \"next_node\": \"$ending\",\n" + " \"coordinates\": {\n" + " \"x\": 1,\n" + " \"y\": 1\n" @@ -473,24 +480,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java index 8789b5e4a..7eafe0eba 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianEnrollmentsWireTest.java @@ -180,24 +180,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java index 9da356b51..ab0252d20 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsDuoSettingsWireTest.java @@ -242,24 +242,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java index 8153ff511..277b15a37 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java @@ -571,24 +571,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java index 977591478..30dd24270 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java @@ -677,24 +677,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java index 6f81a6cfe..1ccecc2bd 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsSmsWireTest.java @@ -445,24 +445,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java index ad778920d..f4a996267 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsWireTest.java @@ -165,24 +165,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java index 9e5d44cfd..3f248b3b2 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianPoliciesWireTest.java @@ -150,24 +150,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java index 54861cbbf..5126655cf 100644 --- a/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java @@ -37,7 +37,7 @@ public void teardown() throws Exception { @Test public void testGet() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); - Map response = client.hooks().secrets().get("id"); + Map response = client.hooks().secrets().get("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("GET", request.getMethod()); @@ -80,7 +80,7 @@ else if (actualResponseNode.has("kind")) @Test public void testCreate() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); - client.hooks().secrets().create("id", new HashMap() { + client.hooks().secrets().create("id", new HashMap() { { put("key", "value"); } @@ -160,7 +160,7 @@ else if (actualJson.has("kind")) @Test public void testUpdate() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); - client.hooks().secrets().update("id", new HashMap() { + client.hooks().secrets().update("id", new HashMap() { { put("key", "value"); } @@ -200,24 +200,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/HooksWireTest.java b/src/test/java/com/auth0/client/mgmt/HooksWireTest.java index f632a45c2..a8edd3984 100644 --- a/src/test/java/com/auth0/client/mgmt/HooksWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/HooksWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateHookRequestContent; import com.auth0.client.mgmt.types.CreateHookResponseContent; @@ -50,12 +51,12 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"hooks\":[{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}]}")); SyncPagingIterable response = client.hooks() .list(ListHooksRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .enabled(true) - .fields("fields") - .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .enabled(OptionalNullable.of(true)) + .fields(OptionalNullable.of("fields")) + .triggerId(OptionalNullable.of(HookTriggerIdEnum.CREDENTIALS_EXCHANGE)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -171,7 +172,11 @@ public void testGet() throws Exception { .setBody( "{\"triggerId\":\"triggerId\",\"id\":\"id\",\"name\":\"name\",\"enabled\":true,\"script\":\"script\",\"dependencies\":{\"key\":\"value\"}}")); GetHookResponseContent response = client.hooks() - .get("id", GetHookRequestParameters.builder().fields("fields").build()); + .get( + "id", + GetHookRequestParameters.builder() + .fields(OptionalNullable.of("fields")) + .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("GET", request.getMethod()); @@ -318,24 +323,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java index 8e36f6eeb..8686117d2 100644 --- a/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/JobsErrorsWireTest.java @@ -87,24 +87,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java index 16a0c3b9a..63528b822 100644 --- a/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/JobsUsersExportsWireTest.java @@ -127,24 +127,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java index 2c1d8f500..7d106a661 100644 --- a/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/JobsVerificationEmailWireTest.java @@ -118,24 +118,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/JobsWireTest.java b/src/test/java/com/auth0/client/mgmt/JobsWireTest.java index eea89c9ea..c54d9c823 100644 --- a/src/test/java/com/auth0/client/mgmt/JobsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/JobsWireTest.java @@ -92,24 +92,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java index 51b832e43..5708bc252 100644 --- a/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/KeysCustomSigningWireTest.java @@ -226,24 +226,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java index a01b3887d..f3c8c7715 100644 --- a/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/KeysEncryptionWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.keys.types.CreateEncryptionKeyRequestContent; import com.auth0.client.mgmt.keys.types.ImportEncryptionKeyRequestContent; @@ -51,9 +52,9 @@ public void testList() throws Exception { SyncPagingIterable response = client.keys() .encryption() .list(ListEncryptionKeysRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -370,24 +371,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java b/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java index f2672fb4a..0e9ae009f 100644 --- a/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/KeysSigningWireTest.java @@ -247,24 +247,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java b/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java index b6bd8e951..b0becf79c 100644 --- a/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/LogStreamsWireTest.java @@ -424,24 +424,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/LogsWireTest.java b/src/test/java/com/auth0/client/mgmt/LogsWireTest.java index e454d7222..b05ea9f01 100644 --- a/src/test/java/com/auth0/client/mgmt/LogsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/LogsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.GetLogResponseContent; import com.auth0.client.mgmt.types.ListLogsRequestParameters; @@ -44,13 +45,13 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"logs\":[{\"date\":\"date\",\"type\":\"type\",\"description\":\"description\",\"connection\":\"connection\",\"connection_id\":\"connection_id\",\"client_id\":\"client_id\",\"client_name\":\"client_name\",\"ip\":\"ip\",\"hostname\":\"hostname\",\"user_id\":\"user_id\",\"user_name\":\"user_name\",\"audience\":\"audience\",\"scope\":\"scope\",\"strategy\":\"strategy\",\"strategy_type\":\"strategy_type\",\"log_id\":\"log_id\",\"isMobile\":true,\"details\":{\"key\":\"value\"},\"user_agent\":\"user_agent\"}]}")); SyncPagingIterable response = client.logs() .list(ListLogsRequestParameters.builder() - .page(1) - .perPage(1) - .sort("sort") - .fields("fields") - .includeFields(true) - .includeTotals(true) - .q("q") + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .sort(OptionalNullable.of("sort")) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .includeTotals(OptionalNullable.of(true)) + .search(OptionalNullable.of("search")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -147,24 +148,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java b/src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java new file mode 100644 index 000000000..5f47ad6f9 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java @@ -0,0 +1,141 @@ +package com.auth0.client.mgmt; + +import org.junit.Test; + +/** + * Tests for ManagementApiBuilder domain-based initialization. + * + *

These tests verify the new domain(), clientCredentials(), and audience() methods + * that provide Node SDK parity for Auth0 Management API client initialization. + */ +public class ManagementApiBuilderTest { + + /** + * Test that domain() method is available and returns the builder. + */ + @Test + public void testDomainMethodExists() { + ManagementApiBuilder builder = ManagementApi.builder(); + ManagementApiBuilder result = builder.domain("my-tenant.auth0.com"); + assert result == builder : "domain() should return the same builder instance"; + } + + /** + * Test that clientCredentials() method is available and returns the builder. + */ + @Test + public void testClientCredentialsMethodExists() { + ManagementApiBuilder builder = ManagementApi.builder(); + ManagementApiBuilder result = builder.clientCredentials("client-id", "client-secret"); + assert result == builder : "clientCredentials() should return the same builder instance"; + } + + /** + * Test that audience() method is available and returns the builder. + */ + @Test + public void testAudienceMethodExists() { + ManagementApiBuilder builder = ManagementApi.builder(); + ManagementApiBuilder result = builder.audience("https://custom-api.com/api/v2/"); + assert result == builder : "audience() should return the same builder instance"; + } + + /** + * Test that build() fails when no authentication is provided. + */ + @Test(expected = RuntimeException.class) + public void testBuildFailsWithoutAuth() { + ManagementApi.builder().domain("my-tenant.auth0.com").build(); + } + + /** + * Test that build() fails when only clientId is provided without clientSecret. + */ + @Test(expected = RuntimeException.class) + public void testBuildFailsWithPartialCredentials() { + // This tests an edge case where someone might call clientCredentials incorrectly + ManagementApiBuilder builder = ManagementApi.builder(); + builder.domain("my-tenant.auth0.com"); + // Manually set only clientId to simulate partial configuration + // This should fail during build + builder.build(); + } + + /** + * Test that build() succeeds with token authentication. + */ + @Test + public void testBuildWithToken() { + ManagementApi client = ManagementApi.builder() + .domain("my-tenant.auth0.com") + .token("test-token") + .build(); + assert client != null : "build() should return a ManagementApi instance"; + } + + /** + * Test that build() succeeds with clientCredentials authentication. + * Note: This creates the client but won't actually fetch a token until used. + */ + @Test + public void testBuildWithClientCredentials() { + ManagementApi client = ManagementApi.builder() + .domain("my-tenant.auth0.com") + .clientCredentials("client-id", "client-secret") + .build(); + assert client != null : "build() should return a ManagementApi instance"; + } + + /** + * Test that build() succeeds with clientCredentials and custom audience. + */ + @Test + public void testBuildWithClientCredentialsAndAudience() { + ManagementApi client = ManagementApi.builder() + .domain("my-tenant.auth0.com") + .clientCredentials("client-id", "client-secret") + .audience("https://custom-api.com/api/v2/") + .build(); + assert client != null : "build() should return a ManagementApi instance"; + } + + /** + * Test backwards compatibility: url() + token() still works. + */ + @Test + public void testBackwardsCompatibilityWithUrl() { + ManagementApi client = ManagementApi.builder() + .url("https://my-tenant.auth0.com/api/v2") + .token("test-token") + .build(); + assert client != null : "build() should return a ManagementApi instance"; + } + + /** + * Test that clientCredentials works with url() instead of domain(). + */ + @Test + public void testClientCredentialsWithUrl() { + ManagementApi client = ManagementApi.builder() + .url("https://my-tenant.auth0.com/api/v2") + .clientCredentials("client-id", "client-secret") + .build(); + assert client != null : "build() should return a ManagementApi instance"; + } + + /** + * Test fluent chaining with all options. + */ + @Test + public void testFluentChaining() { + ManagementApi client = ManagementApi.builder() + .domain("my-tenant.auth0.com") + .clientCredentials("client-id", "client-secret") + .audience("https://custom-api.com/api/v2/") + .timeout(30) + .maxRetries(3) + .addHeader("X-Custom-Header", "custom-value") + .build(); + assert client != null : "Fluent chaining should work"; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java b/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java index 7cf3d66f8..a8226a01d 100644 --- a/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/NetworkAclsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateNetworkAclRequestContent; import com.auth0.client.mgmt.types.GetNetworkAclsResponseContent; @@ -52,9 +53,9 @@ public void testList() throws Exception { "{\"network_acls\":[{\"id\":\"id\",\"description\":\"description\",\"active\":true,\"priority\":1.1,\"rule\":{\"action\":{},\"scope\":\"management\"},\"created_at\":\"created_at\",\"updated_at\":\"updated_at\"}],\"start\":1.1,\"limit\":1.1,\"total\":1.1}")); SyncPagingIterable response = client.networkAcls() .list(ListNetworkAclsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -562,24 +563,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java b/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java index 53c8b7c24..626cd06f1 100644 --- a/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java +++ b/src/test/java/com/auth0/client/mgmt/OAuthTokenSupplierTest.java @@ -26,7 +26,6 @@ public void testSpecialCharactersInCredentials() { // Verify object was created successfully assert supplier != null; - System.out.println("✓ OAuthTokenSupplier handles special characters safely"); } /** @@ -41,8 +40,6 @@ public void testMultipleSupplierCreation() { "client-id-" + i, "client-secret-" + i, "https://tenant-" + i + ".auth0.com", null); assert supplier != null; } - - System.out.println("✓ Multiple OAuthTokenSupplier instances created without resource leaks"); } /** @@ -66,7 +63,6 @@ public void testTrailingSlashNormalization() { // Both should work without issues (trailing slash normalized) assert supplier1 != null; assert supplier2 != null; - System.out.println("✓ Base URL trailing slash normalization works"); } /** @@ -82,7 +78,6 @@ public void testRequestOptionsCreation() { assert options.getClientSecret().equals("client-secret"); assert options.getBaseUrl().equals("https://example.auth0.com"); assert options.hasClientCredentials(); - System.out.println("✓ RequestOptions.withClientCredentials() works"); } @Test @@ -92,7 +87,6 @@ public void testRequestOptionsWithAudience() { assert options != null; assert options.getAudience().equals("https://custom-api.com/api/v2/"); - System.out.println("✓ RequestOptions.withClientCredentialsAndAudience() works"); } @Test @@ -108,7 +102,6 @@ public void testRequestOptionsBuilder() { assert options.hasClientCredentials(); assert options.getClientId().equals("client-id"); assert options.getBaseUrl().equals("https://example.auth0.com"); - System.out.println("✓ RequestOptions.builder() pattern works"); } @Test @@ -118,41 +111,5 @@ public void testRequestOptionsWithoutCredentials() { assert options != null; assert !options.hasClientCredentials(); assert options.getClientId() == null; - System.out.println("✓ RequestOptions without credentials works"); - } - - /** - * Run all tests and print summary. - */ - public static void main(String[] args) { - OAuthTokenSupplierTest test = new OAuthTokenSupplierTest(); - - System.out.println("\n=== Running OAuth Per-Request Credentials Tests ===\n"); - - // Run each test - test.testSpecialCharactersInCredentials(); - test.testMultipleSupplierCreation(); - test.testTrailingSlashNormalization(); - test.testRequestOptionsCreation(); - test.testRequestOptionsWithAudience(); - test.testRequestOptionsBuilder(); - test.testRequestOptionsWithoutCredentials(); - - // Test validation - try { - test.testNullBaseUrl(); - System.out.println("✗ testNullBaseUrl should have thrown exception"); - } catch (IllegalArgumentException e) { - System.out.println("✓ Null base URL validation works"); - } - - try { - test.testEmptyBaseUrl(); - System.out.println("✗ testEmptyBaseUrl should have thrown exception"); - } catch (IllegalArgumentException e) { - System.out.println("✓ Empty base URL validation works"); - } - - System.out.println("\n=== All Tests Passed! ===\n"); } } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java index 96deab10b..19a052b17 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsClientGrantsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.types.AssociateOrganizationClientGrantRequestContent; import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters; @@ -48,11 +49,11 @@ public void testList() throws Exception { .list( "id", ListOrganizationClientGrantsRequestParameters.builder() - .audience("audience") - .clientId("client_id") - .page(1) - .perPage(1) - .includeTotals(true) + .audience(OptionalNullable.of("audience")) + .clientId(OptionalNullable.of("client_id")) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -166,24 +167,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java new file mode 100644 index 000000000..fa9a3eb8b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java @@ -0,0 +1,339 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; +import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; +import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsDiscoveryDomainsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"domains\":[{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}]}")); + SyncPagingIterable response = client.organizations() + .discoveryDomains() + .list( + "id", + ListOrganizationDiscoveryDomainsRequestParameters.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + CreateOrganizationDiscoveryDomainResponseContent response = client.organizations() + .discoveryDomains() + .create( + "id", + CreateOrganizationDiscoveryDomainRequestContent.builder() + .domain("domain") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"domain\": \"domain\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"domain\": \"domain\",\n" + + " \"status\": \"pending\",\n" + + " \"verification_txt\": \"verification_txt\",\n" + + " \"verification_host\": \"verification_host\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + GetOrganizationDiscoveryDomainResponseContent response = + client.organizations().discoveryDomains().get("id", "discovery_domain_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"domain\": \"domain\",\n" + + " \"status\": \"pending\",\n" + + " \"verification_txt\": \"verification_txt\",\n" + + " \"verification_host\": \"verification_host\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().discoveryDomains().delete("id", "discovery_domain_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + UpdateOrganizationDiscoveryDomainResponseContent response = client.organizations() + .discoveryDomains() + .update( + "id", + "discovery_domain_id", + UpdateOrganizationDiscoveryDomainRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"domain\": \"domain\",\n" + + " \"status\": \"pending\",\n" + + " \"verification_txt\": \"verification_txt\",\n" + + " \"verification_host\": \"verification_host\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java index 5a94e2c58..a3315a84a 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsEnabledConnectionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent; import com.auth0.client.mgmt.organizations.types.ListOrganizationConnectionsRequestParameters; @@ -45,15 +46,15 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"enabled_connections\":[{\"connection_id\":\"connection_id\",\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"enabled_connections\":[{\"connection_id\":\"connection_id\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true}]}")); SyncPagingIterable response = client.organizations() .enabledConnections() .list( "id", ListOrganizationConnectionsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -316,24 +317,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java index e32781b4c..6facd9615 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsInvitationsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.types.CreateOrganizationInvitationRequestContent; import com.auth0.client.mgmt.organizations.types.GetOrganizationInvitationRequestParameters; @@ -52,12 +53,12 @@ public void testList() throws Exception { .list( "id", ListOrganizationInvitationsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .fields("fields") - .includeFields(true) - .sort("sort") + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .sort(OptionalNullable.of("sort")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -204,8 +205,8 @@ public void testGet() throws Exception { "id", "invitation_id", GetOrganizationInvitationRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -281,24 +282,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java index 4a4d1bb18..2088c6c43 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersRolesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.members.types.AssignOrganizationMemberRolesRequestContent; import com.auth0.client.mgmt.organizations.members.types.DeleteOrganizationMemberRolesRequestContent; @@ -51,9 +52,9 @@ public void testList() throws Exception { "id", "user_id", ListOrganizationMemberRolesRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -158,24 +159,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java index 7f3db2378..6c7f099eb 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsMembersWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.types.CreateOrganizationMemberRequestContent; import com.auth0.client.mgmt.organizations.types.DeleteOrganizationMembersRequestContent; @@ -49,10 +50,10 @@ public void testList() throws Exception { .list( "id", ListOrganizationMembersRequestParameters.builder() - .from("from") - .take(1) - .fields("fields") - .includeFields(true) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -153,24 +154,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java index 5105e1266..dee87ef24 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateOrganizationRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationResponseContent; @@ -46,12 +47,12 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + "{\"next\":\"next\",\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"token_quota\":{\"client_credentials\":{}}}]}")); SyncPagingIterable response = client.organizations() .list(ListOrganizationsRequestParameters.builder() - .from("from") - .take(1) - .sort("sort") + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .sort(OptionalNullable.of("sort")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -417,24 +418,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java index 00f0ecb4a..31424a98e 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java @@ -124,24 +124,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java index b4372bbca..8c6b7d5a5 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java @@ -120,24 +120,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java index 3be7d9d41..c367cced1 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsRenderingWireTest.java @@ -1,17 +1,22 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.prompts.types.BulkUpdateAculRequestContent; import com.auth0.client.mgmt.prompts.types.ListAculsRequestParameters; import com.auth0.client.mgmt.prompts.types.UpdateAculRequestContent; +import com.auth0.client.mgmt.types.AculConfigsItem; import com.auth0.client.mgmt.types.AculRenderingModeEnum; import com.auth0.client.mgmt.types.AculResponseContent; +import com.auth0.client.mgmt.types.BulkUpdateAculResponseContent; import com.auth0.client.mgmt.types.GetAculResponseContent; import com.auth0.client.mgmt.types.PromptGroupNameEnum; import com.auth0.client.mgmt.types.ScreenGroupNameEnum; import com.auth0.client.mgmt.types.UpdateAculResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; @@ -46,18 +51,18 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"configs\":[{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{}],\"use_page_template\":true}],\"start\":1.1,\"limit\":1.1,\"total\":1.1}")); + "{\"configs\":[{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"use_page_template\":true,\"head_tags\":[{}]}],\"start\":1.1,\"limit\":1.1,\"total\":1.1}")); SyncPagingIterable response = client.prompts() .rendering() .list(ListAculsRequestParameters.builder() - .fields("fields") - .includeFields(true) - .page(1) - .perPage(1) - .includeTotals(true) - .prompt("prompt") - .screen("screen") - .renderingMode(AculRenderingModeEnum.ADVANCED) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .prompt(OptionalNullable.of("prompt")) + .screen(OptionalNullable.of("screen")) + .renderingMode(OptionalNullable.of(AculRenderingModeEnum.ADVANCED)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -69,13 +74,121 @@ public void testList() throws Exception { // The SDK correctly parses the response into a SyncPagingIterable } + @Test + public void testBulkUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"configs\":[{\"prompt\":\"login\",\"screen\":\"login\",\"rendering_mode\":\"advanced\",\"context_configuration\":[\"branding.settings\"],\"default_head_tags_disabled\":true,\"use_page_template\":true,\"head_tags\":[{}]}]}")); + BulkUpdateAculResponseContent response = client.prompts() + .rendering() + .bulkUpdate(BulkUpdateAculRequestContent.builder() + .configs(Arrays.asList(AculConfigsItem.builder() + .prompt(PromptGroupNameEnum.LOGIN) + .screen(ScreenGroupNameEnum.LOGIN) + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"configs\": [\n" + + " {\n" + + " \"prompt\": \"login\",\n" + + " \"screen\": \"login\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"configs\": [\n" + + " {\n" + + " \"prompt\": \"login\",\n" + + " \"screen\": \"login\",\n" + + " \"rendering_mode\": \"advanced\",\n" + + " \"context_configuration\": [\n" + + " \"branding.settings\"\n" + + " ],\n" + + " \"default_head_tags_disabled\": true,\n" + + " \"use_page_template\": true,\n" + + " \"head_tags\": [\n" + + " {}\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + @Test public void testGet() throws Exception { server.enqueue( new MockResponse() .setResponseCode(200) .setBody( - "{\"tenant\":\"tenant\",\"prompt\":\"prompt\",\"screen\":\"screen\",\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{\"tag\":\"tag\",\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{}],\"organizations\":[{}],\"domains\":[{}]},\"use_page_template\":true}")); + "{\"tenant\":\"tenant\",\"prompt\":\"prompt\",\"screen\":\"screen\",\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"use_page_template\":true,\"head_tags\":[{\"tag\":\"tag\",\"attributes\":{\"key\":\"value\"},\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{\"id\":\"id\"}],\"organizations\":[{\"id\":\"id\"}],\"domains\":[{\"id\":\"id\"}]}}")); GetAculResponseContent response = client.prompts().rendering().get(PromptGroupNameEnum.LOGIN, ScreenGroupNameEnum.LOGIN); RecordedRequest request = server.takeRequest(); @@ -95,25 +208,34 @@ public void testGet() throws Exception { + " \"context_configuration\"\n" + " ],\n" + " \"default_head_tags_disabled\": true,\n" + + " \"use_page_template\": true,\n" + " \"head_tags\": [\n" + " {\n" + " \"tag\": \"tag\",\n" + + " \"attributes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + " \"content\": \"content\"\n" + " }\n" + " ],\n" + " \"filters\": {\n" + " \"match_type\": \"includes_any\",\n" + " \"clients\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ],\n" + " \"organizations\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ],\n" + " \"domains\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ]\n" - + " },\n" - + " \"use_page_template\": true\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -152,7 +274,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"head_tags\":[{\"tag\":\"tag\",\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{}],\"organizations\":[{}],\"domains\":[{}]},\"use_page_template\":true}")); + "{\"rendering_mode\":\"advanced\",\"context_configuration\":[\"context_configuration\"],\"default_head_tags_disabled\":true,\"use_page_template\":true,\"head_tags\":[{\"tag\":\"tag\",\"attributes\":{\"key\":\"value\"},\"content\":\"content\"}],\"filters\":{\"match_type\":\"includes_any\",\"clients\":[{\"id\":\"id\"}],\"organizations\":[{\"id\":\"id\"}],\"domains\":[{\"id\":\"id\"}]}}")); UpdateAculResponseContent response = client.prompts() .rendering() .update( @@ -202,25 +324,34 @@ else if (actualJson.has("kind")) + " \"context_configuration\"\n" + " ],\n" + " \"default_head_tags_disabled\": true,\n" + + " \"use_page_template\": true,\n" + " \"head_tags\": [\n" + " {\n" + " \"tag\": \"tag\",\n" + + " \"attributes\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + " \"content\": \"content\"\n" + " }\n" + " ],\n" + " \"filters\": {\n" + " \"match_type\": \"includes_any\",\n" + " \"clients\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ],\n" + " \"organizations\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ],\n" + " \"domains\": [\n" - + " {}\n" + + " {\n" + + " \"id\": \"id\"\n" + + " }\n" + " ]\n" - + " },\n" - + " \"use_page_template\": true\n" + + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -254,24 +385,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java index 2d803509a..ba93e3529 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsWireTest.java @@ -169,24 +169,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java index 0d224496d..17e3333ae 100644 --- a/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java @@ -114,24 +114,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java index e0820a626..a9741e53b 100644 --- a/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateResourceServerRequestContent; import com.auth0.client.mgmt.types.CreateResourceServerResponseContent; @@ -46,13 +47,13 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"client_id\":\"client_id\"}]}")); SyncPagingIterable response = client.resourceServers() .list(ListResourceServerRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .includeFields(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -70,7 +71,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"subject_type_authorization\":{\"user\":{\"policy\":\"allow_all\"},\"client\":{\"policy\":\"deny_all\"}},\"client_id\":\"client_id\"}")); CreateResourceServerResponseContent response = client.resourceServers() .create(CreateResourceServerRequestContent.builder() .identifier("identifier") @@ -149,7 +150,16 @@ else if (actualJson.has("kind")) + " \"proof_of_possession\": {\n" + " \"mechanism\": \"mtls\",\n" + " \"required\": true\n" - + " }\n" + + " },\n" + + " \"subject_type_authorization\": {\n" + + " \"user\": {\n" + + " \"policy\": \"allow_all\"\n" + + " },\n" + + " \"client\": {\n" + + " \"policy\": \"deny_all\"\n" + + " }\n" + + " },\n" + + " \"client_id\": \"client_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -188,12 +198,12 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"subject_type_authorization\":{\"user\":{\"policy\":\"allow_all\"},\"client\":{\"policy\":\"deny_all\"}},\"client_id\":\"client_id\"}")); GetResourceServerResponseContent response = client.resourceServers() .get( "id", GetResourceServerRequestParameters.builder() - .includeFields(true) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -240,7 +250,16 @@ public void testGet() throws Exception { + " \"proof_of_possession\": {\n" + " \"mechanism\": \"mtls\",\n" + " \"required\": true\n" - + " }\n" + + " },\n" + + " \"subject_type_authorization\": {\n" + + " \"user\": {\n" + + " \"policy\": \"allow_all\"\n" + + " },\n" + + " \"client\": {\n" + + " \"policy\": \"deny_all\"\n" + + " }\n" + + " },\n" + + " \"client_id\": \"client_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -288,7 +307,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true}}")); + "{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\",\"description\":\"description\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"name\":\"name\",\"alg\":\"RSA-OAEP-256\",\"kid\":\"kid\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"authorization_details\":[{\"key\":\"value\"}],\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"subject_type_authorization\":{\"user\":{\"policy\":\"allow_all\"},\"client\":{\"policy\":\"deny_all\"}},\"client_id\":\"client_id\"}")); UpdateResourceServerResponseContent response = client.resourceServers() .update("id", UpdateResourceServerRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -365,7 +384,16 @@ else if (actualJson.has("kind")) + " \"proof_of_possession\": {\n" + " \"mechanism\": \"mtls\",\n" + " \"required\": true\n" - + " }\n" + + " },\n" + + " \"subject_type_authorization\": {\n" + + " \"user\": {\n" + + " \"policy\": \"allow_all\"\n" + + " },\n" + + " \"client\": {\n" + + " \"policy\": \"deny_all\"\n" + + " }\n" + + " },\n" + + " \"client_id\": \"client_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -399,24 +427,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsNewDeviceWireTest.java b/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsNewDeviceWireTest.java new file mode 100644 index 000000000..d83a6a6ce --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsNewDeviceWireTest.java @@ -0,0 +1,187 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.riskassessments.settings.types.UpdateRiskAssessmentsSettingsNewDeviceRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsNewDeviceResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsNewDeviceResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RiskAssessmentsSettingsNewDeviceWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"remember_for\":1}")); + GetRiskAssessmentsSettingsNewDeviceResponseContent response = + client.riskAssessments().settings().newDevice().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"remember_for\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"remember_for\":1}")); + UpdateRiskAssessmentsSettingsNewDeviceResponseContent response = client.riskAssessments() + .settings() + .newDevice() + .update(UpdateRiskAssessmentsSettingsNewDeviceRequestContent.builder() + .rememberFor(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"remember_for\": 1\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"remember_for\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsWireTest.java new file mode 100644 index 000000000..6893a370f --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RiskAssessmentsSettingsWireTest.java @@ -0,0 +1,186 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.riskassessments.types.UpdateRiskAssessmentsSettingsRequestContent; +import com.auth0.client.mgmt.types.GetRiskAssessmentsSettingsResponseContent; +import com.auth0.client.mgmt.types.UpdateRiskAssessmentsSettingsResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class RiskAssessmentsSettingsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"enabled\":true}")); + GetRiskAssessmentsSettingsResponseContent response = + client.riskAssessments().settings().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"enabled\": true\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdate() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"enabled\":true}")); + UpdateRiskAssessmentsSettingsResponseContent response = client.riskAssessments() + .settings() + .update(UpdateRiskAssessmentsSettingsRequestContent.builder() + .enabled(true) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"enabled\": true\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"enabled\": true\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java index 901f6c077..8071522ee 100644 --- a/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RolesPermissionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.roles.types.AddRolePermissionsRequestContent; import com.auth0.client.mgmt.roles.types.DeleteRolePermissionsRequestContent; @@ -50,9 +51,9 @@ public void testList() throws Exception { .list( "id", ListRolePermissionsRequestParameters.builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage(OptionalNullable.of(1)) + .page(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -175,24 +176,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java index f6b666aaf..e1a5c8d3f 100644 --- a/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RolesUsersWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.roles.types.AssignRoleUsersRequestContent; import com.auth0.client.mgmt.roles.types.ListRoleUsersRequestParameters; @@ -48,8 +49,8 @@ public void testList() throws Exception { .list( "id", ListRoleUsersRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -106,24 +107,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RolesWireTest.java b/src/test/java/com/auth0/client/mgmt/RolesWireTest.java index c81aad723..1d2f1cf62 100644 --- a/src/test/java/com/auth0/client/mgmt/RolesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RolesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateRoleRequestContent; import com.auth0.client.mgmt.types.CreateRoleResponseContent; @@ -48,10 +49,10 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"roles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}]}")); SyncPagingIterable response = client.roles() .list(ListRolesRequestParameters.builder() - .perPage(1) - .page(1) - .includeTotals(true) - .nameFilter("name_filter") + .perPage(OptionalNullable.of(1)) + .page(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .nameFilter(OptionalNullable.of("name_filter")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -283,24 +284,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java b/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java index 304f98d93..8145ca8aa 100644 --- a/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RulesConfigsWireTest.java @@ -163,24 +163,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/RulesWireTest.java b/src/test/java/com/auth0/client/mgmt/RulesWireTest.java index 24f456a99..e0f043078 100644 --- a/src/test/java/com/auth0/client/mgmt/RulesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RulesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateRuleRequestContent; import com.auth0.client.mgmt.types.CreateRuleResponseContent; @@ -49,12 +50,12 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"rules\":[{\"name\":\"name\",\"id\":\"id\",\"enabled\":true,\"script\":\"script\",\"order\":1.1,\"stage\":\"stage\"}]}")); SyncPagingIterable response = client.rules() .list(ListRulesRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .enabled(true) - .fields("fields") - .includeFields(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .enabled(OptionalNullable.of(true)) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -165,8 +166,8 @@ public void testGet() throws Exception { .get( "id", GetRuleRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -310,24 +311,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java index eb901e12f..73a436dfa 100644 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java @@ -36,7 +36,7 @@ public void teardown() throws Exception { @Test public void testList() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); - Map response = client.selfServiceProfiles().customText().list("id", "en", "get-started"); + Map response = client.selfServiceProfiles().customText().list("id", "en", "get-started"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("GET", request.getMethod()); @@ -79,9 +79,9 @@ else if (actualResponseNode.has("kind")) @Test public void testSet() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); - Map response = client.selfServiceProfiles() + Map response = client.selfServiceProfiles() .customText() - .set("id", "en", "get-started", new HashMap() { + .set("id", "en", "get-started", new HashMap() { { put("key", "value"); } @@ -155,24 +155,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java index 0301b35b4..8f4363c3f 100644 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesSsoTicketWireTest.java @@ -120,24 +120,29 @@ public void testRevoke() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java index 2db3fd904..dd6bc4bc1 100644 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateSelfServiceProfileRequestContent; import com.auth0.client.mgmt.types.CreateSelfServiceProfileResponseContent; @@ -45,12 +46,12 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"self_service_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"allowed_strategies\":[\"oidc\"]}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"self_service_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"allowed_strategies\":[\"oidc\"],\"user_attribute_profile_id\":\"user_attribute_profile_id\"}]}")); SyncPagingIterable response = client.selfServiceProfiles() .list(ListSelfServiceProfilesRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -68,7 +69,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"],\"user_attribute_profile_id\":\"user_attribute_profile_id\"}")); CreateSelfServiceProfileResponseContent response = client.selfServiceProfiles() .create(CreateSelfServiceProfileRequestContent.builder() .name("name") @@ -131,7 +132,8 @@ else if (actualJson.has("kind")) + " },\n" + " \"allowed_strategies\": [\n" + " \"oidc\"\n" - + " ]\n" + + " ],\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -170,7 +172,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"],\"user_attribute_profile_id\":\"user_attribute_profile_id\"}")); GetSelfServiceProfileResponseContent response = client.selfServiceProfiles().get("id"); RecordedRequest request = server.takeRequest(); @@ -202,7 +204,8 @@ public void testGet() throws Exception { + " },\n" + " \"allowed_strategies\": [\n" + " \"oidc\"\n" - + " ]\n" + + " ],\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -250,7 +253,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"]}")); + "{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\",\"user_attributes\":[{\"name\":\"name\",\"description\":\"description\",\"is_optional\":true}],\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"branding\":{\"logo_url\":\"logo_url\",\"colors\":{\"primary\":\"primary\"}},\"allowed_strategies\":[\"oidc\"],\"user_attribute_profile_id\":\"user_attribute_profile_id\"}")); UpdateSelfServiceProfileResponseContent response = client.selfServiceProfiles() .update("id", UpdateSelfServiceProfileRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -311,7 +314,8 @@ else if (actualJson.has("kind")) + " },\n" + " \"allowed_strategies\": [\n" + " \"oidc\"\n" - + " ]\n" + + " ],\n" + + " \"user_attribute_profile_id\": \"user_attribute_profile_id\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -345,24 +349,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java b/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java index df8b6028e..4649e2c22 100644 --- a/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SessionsWireTest.java @@ -2,6 +2,8 @@ import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.types.GetSessionResponseContent; +import com.auth0.client.mgmt.types.UpdateSessionRequestContent; +import com.auth0.client.mgmt.types.UpdateSessionResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import okhttp3.mockwebserver.MockResponse; @@ -38,7 +40,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_user_agent\":\"initial_user_agent\",\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"last_user_agent\":\"last_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\"},\"clients\":[{\"client_id\":\"client_id\"}],\"authentication\":{\"methods\":[{}]},\"cookie\":{\"mode\":\"non-persistent\"}}")); + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_user_agent\":\"initial_user_agent\",\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"last_user_agent\":\"last_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\"},\"clients\":[{\"client_id\":\"client_id\"}],\"authentication\":{\"methods\":[{}]},\"cookie\":{\"mode\":\"non-persistent\"},\"session_metadata\":{\"key\":\"value\"}}")); GetSessionResponseContent response = client.sessions().get("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -77,6 +79,9 @@ public void testGet() throws Exception { + " },\n" + " \"cookie\": {\n" + " \"mode\": \"non-persistent\"\n" + + " },\n" + + " \"session_metadata\": {\n" + + " \"key\": \"value\"\n" + " }\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -119,6 +124,117 @@ public void testDelete() throws Exception { Assertions.assertEquals("DELETE", request.getMethod()); } + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_user_agent\":\"initial_user_agent\",\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"last_user_agent\":\"last_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\"},\"clients\":[{\"client_id\":\"client_id\"}],\"authentication\":{\"methods\":[{}]},\"cookie\":{\"mode\":\"non-persistent\"},\"session_metadata\":{\"key\":\"value\"}}")); + UpdateSessionResponseContent response = client.sessions() + .update("id", UpdateSessionRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"authenticated_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"idle_expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"last_interacted_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"device\": {\n" + + " \"initial_user_agent\": \"initial_user_agent\",\n" + + " \"initial_ip\": \"initial_ip\",\n" + + " \"initial_asn\": \"initial_asn\",\n" + + " \"last_user_agent\": \"last_user_agent\",\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_asn\": \"last_asn\"\n" + + " },\n" + + " \"clients\": [\n" + + " {\n" + + " \"client_id\": \"client_id\"\n" + + " }\n" + + " ],\n" + + " \"authentication\": {\n" + + " \"methods\": [\n" + + " {}\n" + + " ]\n" + + " },\n" + + " \"cookie\": {\n" + + " \"mode\": \"non-persistent\"\n" + + " },\n" + + " \"session_metadata\": {\n" + + " \"key\": \"value\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + @Test public void testRevoke() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); @@ -129,24 +245,29 @@ public void testRevoke() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/StatsWireTest.java b/src/test/java/com/auth0/client/mgmt/StatsWireTest.java index 19ceb18aa..369a31683 100644 --- a/src/test/java/com/auth0/client/mgmt/StatsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/StatsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.DailyStats; import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters; import com.fasterxml.jackson.databind.JsonNode; @@ -86,8 +87,8 @@ public void testGetDaily() throws Exception { "[{\"date\":\"date\",\"logins\":1,\"signups\":1,\"leaked_passwords\":1,\"updated_at\":\"updated_at\",\"created_at\":\"created_at\"}]")); List response = client.stats() .getDaily(GetDailyStatsRequestParameters.builder() - .from("from") - .to("to") + .from(OptionalNullable.of("from")) + .to(OptionalNullable.of("to")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -139,24 +140,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/StreamTest.java b/src/test/java/com/auth0/client/mgmt/StreamTest.java index ac0649357..ac3a1fd41 100644 --- a/src/test/java/com/auth0/client/mgmt/StreamTest.java +++ b/src/test/java/com/auth0/client/mgmt/StreamTest.java @@ -77,7 +77,7 @@ public void testStreamResourceManagement() throws IOException { assertFalse(testStream.iterator().hasNext()); } - private static String mapToJson(Map map) { + private static String mapToJson(Map map) { try { return ObjectMappers.JSON_MAPPER.writeValueAsString(map); } catch (Exception e) { @@ -85,7 +85,7 @@ private static String mapToJson(Map map) { } } - private static String mapToSse(Map map) { + private static String mapToSse(Map map) { return "data: " + mapToJson(map); } diff --git a/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java b/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java index 4f61e5e93..925393f5f 100644 --- a/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SupplementalSignalsWireTest.java @@ -154,24 +154,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java index 3202f7778..e347138ef 100644 --- a/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.tenants.types.GetTenantSettingsRequestParameters; import com.auth0.client.mgmt.tenants.types.UpdateTenantSettingsRequestContent; import com.auth0.client.mgmt.types.GetTenantSettingsResponseContent; @@ -41,12 +42,12 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true}")); + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\"}")); GetTenantSettingsResponseContent response = client.tenants() .settings() .get(GetTenantSettingsRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -153,7 +154,9 @@ public void testGet() throws Exception { + " \"enable_endpoint_aliases\": true\n" + " },\n" + " \"pushed_authorization_requests_supported\": true,\n" - + " \"authorization_response_iss_parameter_supported\": true\n" + + " \"authorization_response_iss_parameter_supported\": true,\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"resource_parameter_profile\": \"audience\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -192,7 +195,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true}")); + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\"}")); UpdateTenantSettingsResponseContent response = client.tenants() .settings() .update(UpdateTenantSettingsRequestContent.builder().build()); @@ -330,7 +333,9 @@ else if (actualJson.has("kind")) + " \"enable_endpoint_aliases\": true\n" + " },\n" + " \"pushed_authorization_requests_supported\": true,\n" - + " \"authorization_response_iss_parameter_supported\": true\n" + + " \"authorization_response_iss_parameter_supported\": true,\n" + + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" + + " \"resource_parameter_profile\": \"audience\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -364,24 +369,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java b/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java index e64b13ac4..1d0b1e8e6 100644 --- a/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/TicketsWireTest.java @@ -184,24 +184,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java index 7682f32a0..251e3e7e8 100644 --- a/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/TokenExchangeProfilesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent; import com.auth0.client.mgmt.types.CreateTokenExchangeProfileResponseContent; @@ -47,8 +48,8 @@ public void testList() throws Exception { "{\"next\":\"next\",\"token_exchange_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"subject_token_type\":\"subject_token_type\",\"action_id\":\"action_id\",\"type\":\"custom_authentication\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); SyncPagingIterable response = client.tokenExchangeProfiles() .list(TokenExchangeProfilesListRequest.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -263,24 +264,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesWireTest.java b/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesWireTest.java new file mode 100644 index 000000000..8e8cac459 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UserAttributeProfilesWireTest.java @@ -0,0 +1,536 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.CreateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.GetUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.ListUserAttributeProfileRequestParameters; +import com.auth0.client.mgmt.types.ListUserAttributeProfileTemplateResponseContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileRequestContent; +import com.auth0.client.mgmt.types.UpdateUserAttributeProfileResponseContent; +import com.auth0.client.mgmt.types.UserAttributeProfile; +import com.auth0.client.mgmt.types.UserAttributeProfileUserAttributeAdditionalProperties; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UserAttributeProfilesWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"next\":\"next\",\"user_attribute_profiles\":[{\"id\":\"id\",\"name\":\"name\",\"user_attributes\":{\"key\":{\"description\":\"description\",\"label\":\"label\",\"profile_required\":true,\"auth0_mapping\":\"auth0_mapping\"}}}]}")); + SyncPagingIterable response = client.userAttributeProfiles() + .list(ListUserAttributeProfileRequestParameters.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"user_id\":{\"oidc_mapping\":\"sub\",\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"},\"user_attributes\":{\"key\":{\"description\":\"description\",\"label\":\"label\",\"profile_required\":true,\"auth0_mapping\":\"auth0_mapping\",\"oidc_mapping\":{\"mapping\":\"mapping\"},\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"}}}")); + CreateUserAttributeProfileResponseContent response = client.userAttributeProfiles() + .create(CreateUserAttributeProfileRequestContent.builder() + .name("name") + .userAttributes(new HashMap() { + { + put( + "key", + UserAttributeProfileUserAttributeAdditionalProperties.builder() + .description("description") + .label("label") + .profileRequired(true) + .auth0Mapping("auth0_mapping") + .build()); + } + }) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"name\": \"name\",\n" + + " \"user_attributes\": {\n" + + " \"key\": {\n" + + " \"description\": \"description\",\n" + + " \"label\": \"label\",\n" + + " \"profile_required\": true,\n" + + " \"auth0_mapping\": \"auth0_mapping\"\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"user_id\": {\n" + + " \"oidc_mapping\": \"sub\",\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " },\n" + + " \"user_attributes\": {\n" + + " \"key\": {\n" + + " \"description\": \"description\",\n" + + " \"label\": \"label\",\n" + + " \"profile_required\": true,\n" + + " \"auth0_mapping\": \"auth0_mapping\",\n" + + " \"oidc_mapping\": {\n" + + " \"mapping\": \"mapping\"\n" + + " },\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testListTemplates() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"user_attribute_profile_templates\":[{\"id\":\"id\",\"display_name\":\"display_name\"}]}")); + ListUserAttributeProfileTemplateResponseContent response = + client.userAttributeProfiles().listTemplates(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"user_attribute_profile_templates\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"display_name\": \"display_name\"\n" + + " }\n" + + " ]\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetTemplate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"display_name\":\"display_name\",\"template\":{\"name\":\"name\",\"user_id\":{\"oidc_mapping\":\"sub\",\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"},\"user_attributes\":{\"key\":{\"description\":\"description\",\"label\":\"label\",\"profile_required\":true,\"auth0_mapping\":\"auth0_mapping\"}}}}")); + GetUserAttributeProfileTemplateResponseContent response = + client.userAttributeProfiles().getTemplate("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"display_name\": \"display_name\",\n" + + " \"template\": {\n" + + " \"name\": \"name\",\n" + + " \"user_id\": {\n" + + " \"oidc_mapping\": \"sub\",\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " },\n" + + " \"user_attributes\": {\n" + + " \"key\": {\n" + + " \"description\": \"description\",\n" + + " \"label\": \"label\",\n" + + " \"profile_required\": true,\n" + + " \"auth0_mapping\": \"auth0_mapping\"\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"user_id\":{\"oidc_mapping\":\"sub\",\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"},\"user_attributes\":{\"key\":{\"description\":\"description\",\"label\":\"label\",\"profile_required\":true,\"auth0_mapping\":\"auth0_mapping\",\"oidc_mapping\":{\"mapping\":\"mapping\"},\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"}}}")); + GetUserAttributeProfileResponseContent response = + client.userAttributeProfiles().get("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"user_id\": {\n" + + " \"oidc_mapping\": \"sub\",\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " },\n" + + " \"user_attributes\": {\n" + + " \"key\": {\n" + + " \"description\": \"description\",\n" + + " \"label\": \"label\",\n" + + " \"profile_required\": true,\n" + + " \"auth0_mapping\": \"auth0_mapping\",\n" + + " \"oidc_mapping\": {\n" + + " \"mapping\": \"mapping\"\n" + + " },\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.userAttributeProfiles().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"name\":\"name\",\"user_id\":{\"oidc_mapping\":\"sub\",\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"},\"user_attributes\":{\"key\":{\"description\":\"description\",\"label\":\"label\",\"profile_required\":true,\"auth0_mapping\":\"auth0_mapping\",\"oidc_mapping\":{\"mapping\":\"mapping\"},\"saml_mapping\":[\"saml_mapping\"],\"scim_mapping\":\"scim_mapping\"}}}")); + UpdateUserAttributeProfileResponseContent response = client.userAttributeProfiles() + .update("id", UpdateUserAttributeProfileRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"user_id\": {\n" + + " \"oidc_mapping\": \"sub\",\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " },\n" + + " \"user_attributes\": {\n" + + " \"key\": {\n" + + " \"description\": \"description\",\n" + + " \"label\": \"label\",\n" + + " \"profile_required\": true,\n" + + " \"auth0_mapping\": \"auth0_mapping\",\n" + + " \"oidc_mapping\": {\n" + + " \"mapping\": \"mapping\"\n" + + " },\n" + + " \"saml_mapping\": [\n" + + " \"saml_mapping\"\n" + + " ],\n" + + " \"scim_mapping\": \"scim_mapping\"\n" + + " }\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java b/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java index 65f0291b3..a3092c1df 100644 --- a/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UserBlocksWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.types.DeleteUserBlocksByIdentifierRequestParameters; import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierRequestParameters; import com.auth0.client.mgmt.types.ListUserBlocksByIdentifierResponseContent; @@ -46,7 +47,7 @@ public void testListByIdentifier() throws Exception { ListUserBlocksByIdentifierResponseContent response = client.userBlocks() .listByIdentifier(ListUserBlocksByIdentifierRequestParameters.builder() .identifier("identifier") - .considerBruteForceEnablement(true) + .considerBruteForceEnablement(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -119,7 +120,7 @@ public void testList() throws Exception { .list( "id", ListUserBlocksRequestParameters.builder() - .considerBruteForceEnablement(true) + .considerBruteForceEnablement(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -179,24 +180,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java b/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java index 1605ee4a0..e6c9fd695 100644 --- a/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UserGrantsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.DeleteUserGrantByUserIdRequestParameters; import com.auth0.client.mgmt.types.ListUserGrantsRequestParameters; @@ -44,12 +45,12 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"grants\":[{\"id\":\"id\",\"clientID\":\"clientID\",\"user_id\":\"user_id\",\"audience\":\"audience\",\"scope\":[\"scope\"]}]}")); SyncPagingIterable response = client.userGrants() .list(ListUserGrantsRequestParameters.builder() - .perPage(1) - .page(1) - .includeTotals(true) - .userId("user_id") - .clientId("client_id") - .audience("audience") + .perPage(OptionalNullable.of(1)) + .page(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .userId(OptionalNullable.of("user_id")) + .clientId(OptionalNullable.of("client_id")) + .audience(OptionalNullable.of("audience")) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -83,24 +84,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java index 393321db9..beebfa05c 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersAuthenticationMethodsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.AuthenticationTypeEnum; import com.auth0.client.mgmt.types.CreateUserAuthenticationMethodResponseContent; @@ -51,15 +52,15 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"authenticators\":[{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\"}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"authenticators\":[{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\",\"aaguid\":\"aaguid\",\"relying_party_identifier\":\"relying_party_identifier\"}]}")); SyncPagingIterable response = client.users() .authenticationMethods() .list( "id", ListUserAuthenticationMethodsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -77,7 +78,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); + "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"aaguid\":\"aaguid\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); CreateUserAuthenticationMethodResponseContent response = client.users() .authenticationMethods() .create( @@ -138,6 +139,7 @@ else if (actualJson.has("kind")) + " \"preferred_authentication_method\": \"voice\",\n" + " \"key_id\": \"key_id\",\n" + " \"public_key\": \"public_key\",\n" + + " \"aaguid\": \"aaguid\",\n" + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + "}"; @@ -178,7 +180,7 @@ public void testSet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "[{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}]")); + "[{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"aaguid\":\"aaguid\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}]")); List response = client.users() .authenticationMethods() .set( @@ -237,6 +239,7 @@ else if (actualJson.has("kind")) + " \"preferred_authentication_method\": \"voice\",\n" + " \"key_id\": \"key_id\",\n" + " \"public_key\": \"public_key\",\n" + + " \"aaguid\": \"aaguid\",\n" + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + " }\n" @@ -287,7 +290,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\"}")); + "{\"id\":\"id\",\"type\":\"recovery-code\",\"confirmed\":true,\"name\":\"name\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"link_id\":\"link_id\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"created_at\":\"2024-01-15T09:30:00Z\",\"enrolled_at\":\"2024-01-15T09:30:00Z\",\"last_auth_at\":\"2024-01-15T09:30:00Z\",\"credential_device_type\":\"credential_device_type\",\"credential_backed_up\":true,\"identity_user_id\":\"identity_user_id\",\"user_agent\":\"user_agent\",\"aaguid\":\"aaguid\",\"relying_party_identifier\":\"relying_party_identifier\"}")); GetUserAuthenticationMethodResponseContent response = client.users().authenticationMethods().get("id", "authentication_method_id"); RecordedRequest request = server.takeRequest(); @@ -321,7 +324,9 @@ public void testGet() throws Exception { + " \"credential_device_type\": \"credential_device_type\",\n" + " \"credential_backed_up\": true,\n" + " \"identity_user_id\": \"identity_user_id\",\n" - + " \"user_agent\": \"user_agent\"\n" + + " \"user_agent\": \"user_agent\",\n" + + " \"aaguid\": \"aaguid\",\n" + + " \"relying_party_identifier\": \"relying_party_identifier\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -369,7 +374,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); + "{\"id\":\"id\",\"type\":\"phone\",\"name\":\"name\",\"totp_secret\":\"totp_secret\",\"phone_number\":\"phone_number\",\"email\":\"email\",\"authentication_methods\":[{\"type\":\"totp\",\"id\":\"id\"}],\"preferred_authentication_method\":\"voice\",\"key_id\":\"key_id\",\"public_key\":\"public_key\",\"aaguid\":\"aaguid\",\"relying_party_identifier\":\"relying_party_identifier\",\"created_at\":\"2024-01-15T09:30:00Z\"}")); UpdateUserAuthenticationMethodResponseContent response = client.users() .authenticationMethods() .update( @@ -429,6 +434,7 @@ else if (actualJson.has("kind")) + " \"preferred_authentication_method\": \"voice\",\n" + " \"key_id\": \"key_id\",\n" + " \"public_key\": \"public_key\",\n" + + " \"aaguid\": \"aaguid\",\n" + " \"relying_party_identifier\": \"relying_party_identifier\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\"\n" + "}"; @@ -464,24 +470,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java index 5a063eb5e..21aca011f 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersAuthenticatorsWireTest.java @@ -41,24 +41,29 @@ public void testDeleteAll() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersConnectedAccountsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersConnectedAccountsWireTest.java new file mode 100644 index 000000000..f0db4daf3 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersConnectedAccountsWireTest.java @@ -0,0 +1,92 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.ConnectedAccount; +import com.auth0.client.mgmt.users.types.GetUserConnectedAccountsRequestParameters; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersConnectedAccountsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"connected_accounts\":[{\"id\":\"id\",\"connection\":\"connection\",\"connection_id\":\"connection_id\",\"strategy\":\"strategy\",\"access_type\":\"offline\",\"scopes\":[\"scopes\"],\"created_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.users() + .connectedAccounts() + .list( + "id", + GetUserConnectedAccountsRequestParameters.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java index c6b3e696f..638ae54ce 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersEnrollmentsWireTest.java @@ -94,24 +94,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java index d29ed6db9..26be964bb 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersFederatedConnectionsTokensetsWireTest.java @@ -101,24 +101,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java index 23713fb70..91b03f63b 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersIdentitiesWireTest.java @@ -205,24 +205,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java index b03075770..313971d36 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersLogsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Log; import com.auth0.client.mgmt.users.types.ListUserLogsRequestParameters; @@ -46,10 +47,10 @@ public void testList() throws Exception { .list( "id", ListUserLogsRequestParameters.builder() - .page(1) - .perPage(1) - .sort("sort") - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .sort(OptionalNullable.of("sort")) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -62,24 +63,29 @@ public void testList() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java index 51e941669..4abfafddb 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersMultifactorWireTest.java @@ -51,24 +51,29 @@ public void testDeleteProvider() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java index 820038922..825b41ce5 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersOrganizationsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Organization; import com.auth0.client.mgmt.users.types.ListUserOrganizationsRequestParameters; @@ -40,15 +41,15 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"metadata\":{\"key\":\"value\"},\"token_quota\":{\"client_credentials\":{}}}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"token_quota\":{\"client_credentials\":{}}}]}")); SyncPagingIterable response = client.users() .organizations() .list( "id", ListUserOrganizationsRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -61,24 +62,29 @@ public void testList() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java index 7b716b50a..9e0d464e7 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersPermissionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.PermissionRequestPayload; import com.auth0.client.mgmt.types.UserPermissionSchema; @@ -50,9 +51,9 @@ public void testList() throws Exception { .list( "id", ListUserPermissionsRequestParameters.builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage(OptionalNullable.of(1)) + .page(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -175,24 +176,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java index d354afef9..bcd7462f3 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.RefreshTokenResponseContent; import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters; @@ -46,8 +47,8 @@ public void testList() throws Exception { .list( "user_id", ListRefreshTokensRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -69,24 +70,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersRiskAssessmentsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRiskAssessmentsWireTest.java new file mode 100644 index 000000000..62d1a3bd8 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/UsersRiskAssessmentsWireTest.java @@ -0,0 +1,116 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.users.types.ClearAssessorsRequestContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class UsersRiskAssessmentsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testClear() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.users() + .riskAssessments() + .clear( + "id", + ClearAssessorsRequestContent.builder() + .connection("connection") + .assessors(Arrays.asList("new-device")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"connection\": \"connection\",\n" + + " \"assessors\": [\n" + + " \"new-device\"\n" + + " ]\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java index 48ad71482..2e34e4cd3 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersRolesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.Role; import com.auth0.client.mgmt.users.types.AssignUserRolesRequestContent; @@ -49,9 +50,9 @@ public void testList() throws Exception { .list( "id", ListUserRolesRequestParameters.builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage(OptionalNullable.of(1)) + .page(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -152,24 +153,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java index dea61bec9..9f8ca2a66 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersSessionsWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.SessionResponseContent; import com.auth0.client.mgmt.users.types.ListUserSessionsRequestParameters; @@ -40,14 +41,14 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"sessions\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"clients\":[{}]}],\"next\":\"next\"}")); + "{\"sessions\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"authenticated_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"last_interacted_at\":\"2024-01-15T09:30:00Z\",\"clients\":[{}],\"session_metadata\":{\"key\":\"value\"}}],\"next\":\"next\"}")); SyncPagingIterable response = client.users() .sessions() .list( "user_id", ListUserSessionsRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -69,24 +70,29 @@ public void testDelete() throws Exception { } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/UsersWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java index d3b72b112..7a51dccfe 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateUserRequestContent; import com.auth0.client.mgmt.types.CreateUserResponseContent; @@ -54,16 +55,16 @@ public void testList() throws Exception { "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"users\":[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]}")); SyncPagingIterable response = client.users() .list(ListUsersRequestParameters.builder() - .page(1) - .perPage(1) - .includeTotals(true) - .sort("sort") - .connection("connection") - .fields("fields") - .includeFields(true) - .q("q") - .searchEngine(SearchEngineVersionsEnum.V1) - .primaryOrder(true) + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .sort(OptionalNullable.of("sort")) + .connection(OptionalNullable.of("connection")) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) + .q(OptionalNullable.of("q")) + .searchEngine(OptionalNullable.of(SearchEngineVersionsEnum.V1)) + .primaryOrder(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -203,8 +204,8 @@ public void testListUsersByEmail() throws Exception { List response = client.users() .listUsersByEmail(ListUsersByEmailRequestParameters.builder() .email("email") - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -289,8 +290,8 @@ public void testGet() throws Exception { .get( "id", GetUserRequestParameters.builder() - .fields("fields") - .includeFields(true) + .fields(OptionalNullable.of("fields")) + .includeFields(OptionalNullable.of(true)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -578,24 +579,29 @@ else if (actualJson.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } diff --git a/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java index 43fd024ee..a12778ae8 100644 --- a/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/VerifiableCredentialsVerificationTemplatesWireTest.java @@ -1,6 +1,7 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.types.CreateVerifiableCredentialTemplateResponseContent; import com.auth0.client.mgmt.types.GetVerifiableCredentialTemplateResponseContent; @@ -53,8 +54,8 @@ public void testList() throws Exception { .verification() .templates() .list(ListVerifiableCredentialTemplatesRequestParameters.builder() - .from("from") - .take(1) + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(1)) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -352,24 +353,29 @@ else if (actualResponseNode.has("kind")) } /** - * Compares two JsonNodes with numeric equivalence. + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). */ - private boolean jsonEquals(JsonNode a, JsonNode b) { - if (a.equals(b)) return true; - if (a.isNumber() && b.isNumber()) return Math.abs(a.doubleValue() - b.doubleValue()) < 1e-10; - if (a.isObject() && b.isObject()) { - if (a.size() != b.size()) return false; - java.util.Iterator> iter = a.fields(); + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { java.util.Map.Entry entry = iter.next(); - if (!jsonEquals(entry.getValue(), b.get(entry.getKey()))) return false; + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } return true; } - if (a.isArray() && b.isArray()) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); i++) { - if (!jsonEquals(a.get(i), b.get(i))) return false; + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; } return true; } From b260b3f2c16876c3c58a1b25097822dfac0c2c93 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 18 Dec 2025 14:14:57 +0530 Subject: [PATCH 04/13] Added changelog --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7664dcff5..3bd6358d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## [v3.0.0-beta.0](https://github.com/auth0/auth0-java/tree/v3.0.0-beta.0) (2025-12-18) + +[Full Changelog](https://github.com/auth0/auth0-java/compare/v4.26.0...v3.0.0-beta.0) + +- Complete rewrite of the **Management API client** using Fern code generation +- Update OkHttp to 5.2.1 +- API attributes can set null for patch operations +- Nullability annotations to POJO classes +- Fully compatible **Authentication API client** — no breaking changes + +- [Migration guide](v3_MIGRATION_GUIDE.md) available for upgrading from v2.x + + ## [2.26.0](https://github.com/auth0/auth0-java/tree/2.26.0) (2025-10-24) [Full Changelog](https://github.com/auth0/auth0-java/compare/2.25.0...2.26.0) From 3cf9d258730b7ede05bd6aba9fc039e24d196d25 Mon Sep 17 00:00:00 2001 From: Tanya Sinha Date: Thu, 18 Dec 2025 17:41:50 +0530 Subject: [PATCH 05/13] Update Changelog (#799) --- CHANGELOG.md | 5 +- MIGRATION_GUIDE.md | 469 ++++++++++++++++++++++++++++++------------ README.md | 2 +- v3_MIGRATION_GUIDE.md | 369 --------------------------------- 4 files changed, 344 insertions(+), 501 deletions(-) delete mode 100644 v3_MIGRATION_GUIDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d461108..1944141cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ - Nullability annotations to POJO classes - Fully compatible **Authentication API client** — no breaking changes -- [Migration guide](v3_MIGRATION_GUIDE.md) available for upgrading from v2.x +- [Migration guide](MIGRATION_GUIDE) available for upgrading from v2.x ## [2.27.0](https://github.com/auth0/auth0-java/tree/2.27.0) (2025-12-18) @@ -262,7 +262,6 @@ - ... and more! As a major version release, 2.0.0 does include breaking changes. -Please see the [Migration Guide](MIGRATION_GUIDE.md) for additional details as well as guidance for updating your application. ## [2.0.0 Beta 2](https://github.com/auth0/auth0-java/tree/2.0.0-beta.2) (2023-02-13) [Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0-beta.1...2.0.0-beta.2) @@ -289,8 +288,6 @@ This release introduces several enhancement, including: - Authentication API improvements to not require a client secret - ... and more! -Please see the [Migration Guide](MIGRATION_GUIDE.md) for guidance on updating your application. - ## [1.44.2](https://github.com/auth0/auth0-java/tree/1.44.2) (2023-01-11) [Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.1...1.44.2) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 5327386a6..738f515f5 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -1,154 +1,369 @@ -# Migration Guide +# V3 Migration Guide -## Migrating from v1 to v2 +A guide to migrating the Auth0 Java SDK from `v2` to `v3`. -The version 2 release includes several notable improvements, including: +- [Overall changes](#overall-changes) + - [Java versions](#java-versions) + - [Authentication API](#authentication-api) + - [Management API](#management-api) +- [Specific changes to the Management API](#specific-changes-to-the-management-api) + - [Client initialization](#client-initialization) + - [Sub-client organization](#sub-client-organization) + - [Request and response patterns](#request-and-response-patterns) + - [Pagination](#pagination) + - [Exception handling](#exception-handling) + - [Accessing raw HTTP responses](#accessing-raw-http-responses) + - [Request-level configuration](#request-level-configuration) + - [Type changes](#type-changes) -* Requests can now be configured with additional parameters and headers, without needing to downcast to `CustomRequest`. -* Responses are now wrapped in a new `com.auth0.net.Response` type, which provides information about the HTTP response such as headers and status code. -* The `AuthAPI` and `ManagementAPI` clients can now share the same HTTP client. -* The `AuthAPI` client no longer requires a client secret, enabling support for APIs and scenarios where a secret is not required. +## Overall changes -Version 2 includes breaking changes. Please read this guide to learn how to update your application for v2. +### Java versions -### Configuring `auth0-java` v2 +Both v2 and v3 require Java 8 or above. -To create the API clients, use the new builders, and specify any HTTP-related configurations with the new `DefaultHttpClient`: +### Authentication API + +This major version change does not affect the Authentication API. The `AuthAPI` class has been ported directly from v2 to v3. Any code written for the Authentication API in the v2 version should work in the v3 version. ```java -Auth0HttpClient http = DefaultHttpClient.newBuilder() - .withConnectTimeout(10) - .withReadTimeout(10) - // additional configurations as needed - .build(); +// Works in both v2 and v3 +AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); +``` + +### Management API + +V3 introduces significant improvements to the Management API SDK by migrating to [Fern](https://github.com/fern-api/fern) as the code generation tool. This provides: + +- Better resource grouping with sub-client organization +- Type-safe request and response objects using builder patterns +- Automatic pagination with `SyncPagingIterable` +- Simplified access to HTTP response metadata via `withRawResponse()` +- Consistent method naming (`list`, `create`, `get`, `update`, `delete`) -AuthAPI auth = AuthAPI.newBuilder("{DOMAIN}", "{CLIENT-ID}", "{OPTIONAL-CLIENT-SECRET}") - .withHttpClient(http) - .build(); +## Specific changes to the Management API -ManagementAPI mgmt = ManagementAPI.newBuilder("{DOMAIN}", "{API-TOKEN}") - .withHttpClient(http) - .build(); -``` - -### Response information +### Client initialization -Version 2 returns HTTP response information such as status code and headers in a new `com.auth0.net.Response` type. -Instead of simply returning the parsed JSON response body from requests, all API methods now return a `Response`. -If you have no need for the response information, replace any calls to `execute()` with `execute().getBody()` to get the returned response body as before: +The Management API client initialization has changed from `ManagementAPI` to `ManagementApi`, and uses a different builder pattern. +**v2:** ```java -// Get response info -Response userResponse = api.users().get("{USER-ID}", null); -int code = userResponse.getStatusCode(); -Map headers = userResponse.getHeaders(); +import com.auth0.client.mgmt.ManagementAPI; -// Just get the response body -User user = api.users().get("{USER-ID}", null).execute().getBody(); -``` +// Using domain and token +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build(); -### Request configuration +// Using TokenProvider +TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}"); +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", tokenProvider).build(); +``` -Previously, only requests that returned a `CustomizableRequest` (or its implementation, `CustomRequest`) allowed for a request to be configured with additional parameters or headers. -In v2, the `com.auth0.net.Request` interface defines the new methods: +**v3:** +1st Approach : Standard Token-Based +```java +import com.auth0.client.mgmt.ManagementApi; -- `Request addHeader(String name, String value)` -- `Request addParameter(String name, Object value)` -- `Request setBody(Object body)` +ManagementApi client = ManagementApi + .builder() + .url("https://{YOUR_DOMAIN}/api/v2") + .token("{YOUR_API_TOKEN}") + .build(); +``` -This enables all requests to be configured, without the need to downcast to `CustomizableRequest` or `CustomRequest`. -If you were down-casting to these types, you will need to remove the cast and instead configure the request directly: +or + +2nd Approach : OAuth client credentials flow ```java -Request userRequest = api.users().get("{USER-ID}", null); -userRequest.addHeader("some-header", "some-value"); -Response userResponse = userRequest.execute(); +OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier( +"{CLIENT_ID}", +"{CLIENT_SECRET}", +"https://{YOUR_DOMAIN}", +"{YOUR_AUDIENCE}" +); + +ClientOptions clientOptions = ClientOptions.builder() +.environment(Environment.custom("https://{YOUR_AUDIENCE}")) +.addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) +.build(); + +ManagementApi client = new ManagementApi(clientOptions); + ``` -### Detailed changes +#### Builder options comparison + +| Option | v2 | v3 | +|--------|----|----| +| Domain/URL | `newBuilder(domain, token)` | `.url("https://domain/api/v2")` | +| Token | Constructor parameter | `.token(token)` | +| Timeout | Via `HttpOptions` | `.timeout(seconds)` | +| Max retries | Via `HttpOptions` | `.maxRetries(count)` | +| Custom HTTP client | `.withHttpClient(Auth0HttpClient)` | `.httpClient(OkHttpClient)` | +| Custom headers | Not directly supported | `.addHeader(name, value)` | -The following summarizes details of the changes in version 2, including types and methods removed, added, or deprecated. +### Sub-client organization -#### Removed classes +V3 introduces a hierarchical sub-client structure. Operations on related resources are now accessed through nested clients instead of methods on a flat entity class. + +**v2:** +```java +// All user operations on UsersEntity +Request userRequest = mgmt.users().get("user_id", new UserFilter()); +Request> permissionsRequest = mgmt.users().getPermissions("user_id", new PermissionsFilter()); +Request> rolesRequest = mgmt.users().getRoles("user_id", new RolesFilter()); +Request logsRequest = mgmt.users().getLogEvents("user_id", new LogEventFilter()); +``` + +**v3:** +```java +// Operations organized into sub-clients +GetUserResponseContent user = client.users().get("user_id"); +SyncPagingIterable permissions = client.users().permissions().list("user_id"); +SyncPagingIterable roles = client.users().roles().list("user_id"); +SyncPagingIterable logs = client.users().logs().list("user_id"); +``` + +#### Common sub-client mappings + +| v2 Method | v3 Sub-client | +|-----------|---------------| +| `mgmt.users().getPermissions()` | `client.users().permissions().list()` | +| `mgmt.users().getRoles()` | `client.users().roles().list()` | +| `mgmt.users().getLogEvents()` | `client.users().logs().list()` | +| `mgmt.users().getOrganizations()` | `client.users().organizations().list()` | +| `mgmt.users().link()` | `client.users().identities().link()` | +| `mgmt.users().unlink()` | `client.users().identities().delete()` | +| `mgmt.users().deleteMultifactorProvider()` | `client.users().multifactor().deleteProvider()` | +| `mgmt.organizations().getMembers()` | `client.organizations().members().list()` | +| `mgmt.organizations().getInvitations()` | `client.organizations().invitations().list()` | +| `mgmt.organizations().getEnabledConnections()` | `client.organizations().enabledConnections().list()` | +| `mgmt.actions().getVersions()` | `client.actions().versions().list()` | +| `mgmt.actions().getTriggerBindings()` | `client.actions().triggers().bindings().list()` | +| `mgmt.guardian().getFactors()` | `client.guardian().factors().list()` | +| `mgmt.branding().getUniversalLoginTemplate()` | `client.branding().templates().getUniversalLogin()` | +| `mgmt.connections().getScimConfiguration()` | `client.connections().scimConfiguration().get()` | + +### Request and response patterns + +V3 uses type-safe request content objects with builders instead of domain objects or filter parameters. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.net.Request; + +// Creating a user +User user = new User("Username-Password-Authentication"); +user.setEmail("test@example.com"); +user.setPassword("password123".toCharArray()); + +Request request = mgmt.users().create(user); +User createdUser = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; + +// Creating a user +CreateUserResponseContent user = client.users().create( + CreateUserRequestContent + .builder() + .connection("Username-Password-Authentication") + .email("test@example.com") + .password("password123") + .build() +); +``` + +#### Key differences + +| Aspect | v2 | v3 | +|--------|----|----| +| Request building | Domain objects with setters | Builder pattern with `*RequestContent` types | +| Response type | `Request` requiring `.execute().getBody()` | Direct return of response object | +| Filtering | Filter classes (e.g., `UserFilter`) | `*RequestParameters` builder classes | +| Execution | Explicit `.execute()` call | Implicit execution on method call | + +### Pagination + +V3 introduces `SyncPagingIterable` for automatic pagination, replacing the manual `Request` pattern. + +**v2:** +```java +import com.auth0.json.mgmt.users.UsersPage; +import com.auth0.client.mgmt.filter.UserFilter; + +Request request = mgmt.users().list(new UserFilter().withPage(0, 50)); +UsersPage page = request.execute().getBody(); + +for (User user : page.getItems()) { + System.out.println(user.getEmail()); +} + +// Manual pagination +while (page.getNext() != null) { + request = mgmt.users().list(new UserFilter().withPage(page.getNext(), 50)); + page = request.execute().getBody(); + for (User user : page.getItems()) { + System.out.println(user.getEmail()); + } +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; + +// Automatic iteration through all pages +SyncPagingIterable users = client.users().list( + ListUsersRequestParameters + .builder() + .perPage(50) + .build() +); + +for (UserResponseSchema user : users) { + System.out.println(user.getEmail()); +} + +// Or manual page control +List pageItems = users.getItems(); +while (users.hasNext()) { + pageItems = users.nextPage().getItems(); + // process page +} +``` -- `AuthRequest` has been removed. Use `TokenRequest` instead. -- `CustomizableRequest` and `CustomRequest` have been removed. The `Request` interface now supports request customization directly without the need to downcast. -- `FormDataRequest` has been removed. Use `MultipartRequest` instead. -- `CreateUserRequest` has been removed. Use `SignUpRequest` instead. +### Exception handling -#### Moved classes +V3 uses a unified `ManagementApiException` class instead of the v2 exception hierarchy. -- `com.auth0.json.mgmt.Token` moved to `com.auth0.json.mgmt.blacklists.Token` -- `com.auth0.json.mgmt.ClientGrant` moved to `com.auth0.json.mgmt.clientgrants.ClientGrant` -- `com.auth0.json.mgmt.ClientGrantsPage` moved to `com.auth0.json.mgmt.clientgrants.ClientGrantsPage` -- `com.auth0.json.mgmt.Connection` moved to `com.auth0.json.mgmt.connections.Connection` -- `com.auth0.json.mgmt.ConnectionsPage` moved to `com.auth0.json.mgmt.connections.ConnectionsPage` -- `com.auth0.json.mgmt.DeviceCredentials` moved to `com.auth0.json.mgmt.devicecredentials.DeviceCredentials` -- `com.auth0.json.mgmt.EmailTemplate` moved to `com.auth0.json.mgmt.emailtemplates.EmailTemplate` -- `com.auth0.json.mgmt.Grant` moved to `com.auth0.json.mgmt.grants.Grant` -- `com.auth0.json.mgmt.GrantsPage` moved to `com.auth0.json.mgmt.grants.GrantsPage` -- `com.auth0.json.mgmt.EmailVerificationIdentity` moved to `com.auth0.json.mgmt.tickets.EmailVerificationIdentity` -- `com.auth0.json.mgmt.Key;` moved to `com.auth0.json.mgmt.keys.Key` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` -- `com.auth0.json.mgmt.ResourceServer` moved to `com.auth0.json.mgmt.resourceserver.ResourceServer` -- `com.auth0.json.mgmt.ResourceServersPage` moved to `com.auth0.json.mgmt.resourceserver.ResourceServersPage` -- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` -- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` -- `com.auth0.json.mgmt.Role` moved to `com.auth0.json.mgmt.roles.Role` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` -- `com.auth0.json.mgmt.RulesConfig` moved to `com.auth0.json.mgmt.rules.RulesConfig` -- `com.auth0.json.mgmt.Rule` moved to `com.auth0.json.mgmt.rules.Rule` -- `com.auth0.json.mgmt.RulesPage` moved to `com.auth0.json.mgmt.rules.RulesPage` -- `com.auth0.json.mgmt.DailyStats` moved to `com.auth0.json.mgmt.stats.DailyStats` -- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` -- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` - -#### Removed methods - -- `void com.auth0.client.mgmt.ManagementAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.auth.AuthAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.mgmt.ManagementAPI#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.auth.AuthAP#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `void com.auth0.client.mgmt.ManagementAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `void com.auth0.client.auth.AuthAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `Request> com.auth0.client.mgmt.ClientGrantsEntity#list()` has been removed. Use `Request list(ClientGrantsFilter filter) com.auth0.client.mgmt.ClientGrantsEntity#list(ClientGrantsFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#list(ClientFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list(ConnectionFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#listAll(ConnectionFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.GrantsEntity#list(String userId)` has been removed. Use `Request com.auth0.client.mgmt.GrantsEntity#list(String userId, GrantsFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ResourceServerEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ResourceServersEntity#list(ResourceServersFilter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.RulesEntity#list(RulesFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.RulesEntity#listAll(RulesFilter filter)` instead. -- Deprecated `void com.auth0.json.mgmt.guardian.EnrollmentTicket#setUserId(String id)` has been removed. Use the constructor instead. -- Deprecated `com.auth0.json.mgmt.guardian.SNSFactorProvider` no-arg constructor has been removed. Use the full constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSAccessKeyId(String awsAccessKeyId)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSSecretAccessKey(String awsSecretAccessKey)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSRegion(String awsRegion)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSAPNSPlatformApplicationARN(String apnARN)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSGCMPlatformApplicationARN(String gcmARN)` has been removed. Use the constructor instead. -- Deprecated `com.auth0.json.mgmt.guardian.TwilioFactorProvider` no-arg constructor has been removed. Use the full constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setFrom(String from)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setMessagingServiceSID(String messagingServiceSID)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setAuthToken(String authToken)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setSID(String SID)` has been removed. Use the constructor instead. -- The default implementation of `com.auth0.net.Request#executeAsync()` has been removed; implementations must provide an implementation of `executeAsync`. - -### New classes and methods - -#### Refactored HTTP layer types - -Version 2 introduces a new abstraction, `com.auth0.net.client.Auth0HttpClient`, to handle the core HTTP responsibilities of sending HTTP requests. -An implementation is provided in `DefaultHttpClient`, which supports all the configurations available in the now-deprecated `HttpOptions`. -In addition to these configurations, it is also possible to implement the `Auth0HttpClient` for advanced use-cases where the default implementation or its configurations are not sufficient. -Several new types have been added to support this: - -- `com.auth0.net.client.Auth0HttpClient` has been added to define the HTTP client interface. -- `com.auth0.net.client.DefaultHttpClient` is the default HTTP implementation that should be used in the majority of cases. It supports the same configurations as `HttpOptions`, but can be reused across API clients. It uses `OkHttp` as the networking client internally. -- `com.auth0.net.client.Auth0HttpRequest` is a lightweight representation of an HTTP request to execute. Internal API implementations will form the request. -- `com.auth0.net.client.Auth0HttpResponse` is a lightweight representation of an HTTP response. Internal API implementations will parse the response. -- `com.auth0.net.client.HttpMethod` is an `enum` representing the HTTP methods. - -### New deprecations - -- `com.auth0.client.HttpOptions` has been deprecated, in favor of configuring the `DefaultHttpClient` directly. -- `com.auth0.client.mgmt.ManagementAPI` constructors have been deprecated in favor of `ManagementAPI#newBuilder(String domain, String apiToken)`. -- `com.auth0.client.auth.AuthAPI` constructors have been deprecated in favor of `AuthAPI.newBuilder(String domain, String clientId)` and `AuthAPI.newBuilder(String domain, String clientId, String clientSecret)`. +**v2:** +```java +import com.auth0.exception.Auth0Exception; +import com.auth0.exception.APIException; +import com.auth0.exception.RateLimitException; + +try { + User user = mgmt.users().get("user_id", null).execute().getBody(); +} catch (RateLimitException e) { + // Rate limited + long retryAfter = e.getLimit(); +} catch (APIException e) { + int statusCode = e.getStatusCode(); + String error = e.getError(); + String description = e.getDescription(); +} catch (Auth0Exception e) { + // Network or other errors +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiException; + +try { + GetUserResponseContent user = client.users().get("user_id"); +} catch (ManagementApiException e) { + int statusCode = e.statusCode(); + Object body = e.body(); + Map> headers = e.headers(); + String message = e.getMessage(); +} +``` + +### Accessing raw HTTP responses + +V3 provides access to full HTTP response metadata via `withRawResponse()`. + +**v2:** +```java +// Response wrapper provided status code +Response response = mgmt.users().get("user_id", null).execute(); +int statusCode = response.getStatusCode(); +User user = response.getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; + +// Use withRawResponse() to access headers and metadata +ManagementApiHttpResponse response = client.users() + .withRawResponse() + .get("user_id"); + +GetUserResponseContent user = response.body(); +Map> headers = response.headers(); +``` + +### Request-level configuration + +V3 allows per-request configuration through `RequestOptions`. + +**v2:** +```java +// Most configuration was at client level only +// Request-level headers required creating a new request manually +Request request = mgmt.users().get("user_id", null); +request.addHeader("X-Custom-Header", "value"); +User user = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.RequestOptions; + +GetUserResponseContent user = client.users().get( + "user_id", + GetUserRequestParameters.builder().build(), + RequestOptions.builder() + .timeout(10) + .maxRetries(1) + .addHeader("X-Custom-Header", "value") + .build() +); +``` + +### Type changes + +V3 uses generated type classes located in `com.auth0.client.mgmt.types` instead of the hand-written POJOs in `com.auth0.json.mgmt`. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.json.mgmt.roles.Role; +import com.auth0.json.mgmt.organizations.Organization; +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.Organization; +``` + +Type naming conventions in v3: +- Request body types: `*RequestContent` (e.g., `CreateUserRequestContent`) +- Response types: `*ResponseContent` or `*ResponseSchema` (e.g., `GetUserResponseContent`, `UserResponseSchema`) +- Query parameters: `*RequestParameters` (e.g., `ListUsersRequestParameters`) + +All types use immutable builders: + +```java +// v3 type construction +CreateUserRequestContent request = CreateUserRequestContent + .builder() + .email("test@example.com") + .connection("Username-Password-Authentication") + .password("secure-password") + .build(); +``` diff --git a/README.md b/README.md index 6b4d40370..e2856d505 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Documentation - [Examples](./EXAMPLES.md) - code samples for common auth0-java scenarios. -- [Migration Guide](./v3_MIGRATION_GUIDE.md) - guidance for updating your application to use version 3 of auth0-java. +- [Migration Guide](./MIGRATION_GUIDE) - guidance for updating your application to use version 3 of auth0-java. - [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0. ## Getting Started diff --git a/v3_MIGRATION_GUIDE.md b/v3_MIGRATION_GUIDE.md deleted file mode 100644 index 738f515f5..000000000 --- a/v3_MIGRATION_GUIDE.md +++ /dev/null @@ -1,369 +0,0 @@ -# V3 Migration Guide - -A guide to migrating the Auth0 Java SDK from `v2` to `v3`. - -- [Overall changes](#overall-changes) - - [Java versions](#java-versions) - - [Authentication API](#authentication-api) - - [Management API](#management-api) -- [Specific changes to the Management API](#specific-changes-to-the-management-api) - - [Client initialization](#client-initialization) - - [Sub-client organization](#sub-client-organization) - - [Request and response patterns](#request-and-response-patterns) - - [Pagination](#pagination) - - [Exception handling](#exception-handling) - - [Accessing raw HTTP responses](#accessing-raw-http-responses) - - [Request-level configuration](#request-level-configuration) - - [Type changes](#type-changes) - -## Overall changes - -### Java versions - -Both v2 and v3 require Java 8 or above. - -### Authentication API - -This major version change does not affect the Authentication API. The `AuthAPI` class has been ported directly from v2 to v3. Any code written for the Authentication API in the v2 version should work in the v3 version. - -```java -// Works in both v2 and v3 -AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); -``` - -### Management API - -V3 introduces significant improvements to the Management API SDK by migrating to [Fern](https://github.com/fern-api/fern) as the code generation tool. This provides: - -- Better resource grouping with sub-client organization -- Type-safe request and response objects using builder patterns -- Automatic pagination with `SyncPagingIterable` -- Simplified access to HTTP response metadata via `withRawResponse()` -- Consistent method naming (`list`, `create`, `get`, `update`, `delete`) - -## Specific changes to the Management API - -### Client initialization - -The Management API client initialization has changed from `ManagementAPI` to `ManagementApi`, and uses a different builder pattern. - -**v2:** -```java -import com.auth0.client.mgmt.ManagementAPI; - -// Using domain and token -ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build(); - -// Using TokenProvider -TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}"); -ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", tokenProvider).build(); -``` - -**v3:** -1st Approach : Standard Token-Based -```java -import com.auth0.client.mgmt.ManagementApi; - -ManagementApi client = ManagementApi - .builder() - .url("https://{YOUR_DOMAIN}/api/v2") - .token("{YOUR_API_TOKEN}") - .build(); -``` - -or - -2nd Approach : OAuth client credentials flow - -```java -OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier( -"{CLIENT_ID}", -"{CLIENT_SECRET}", -"https://{YOUR_DOMAIN}", -"{YOUR_AUDIENCE}" -); - -ClientOptions clientOptions = ClientOptions.builder() -.environment(Environment.custom("https://{YOUR_AUDIENCE}")) -.addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) -.build(); - -ManagementApi client = new ManagementApi(clientOptions); - -``` - -#### Builder options comparison - -| Option | v2 | v3 | -|--------|----|----| -| Domain/URL | `newBuilder(domain, token)` | `.url("https://domain/api/v2")` | -| Token | Constructor parameter | `.token(token)` | -| Timeout | Via `HttpOptions` | `.timeout(seconds)` | -| Max retries | Via `HttpOptions` | `.maxRetries(count)` | -| Custom HTTP client | `.withHttpClient(Auth0HttpClient)` | `.httpClient(OkHttpClient)` | -| Custom headers | Not directly supported | `.addHeader(name, value)` | - -### Sub-client organization - -V3 introduces a hierarchical sub-client structure. Operations on related resources are now accessed through nested clients instead of methods on a flat entity class. - -**v2:** -```java -// All user operations on UsersEntity -Request userRequest = mgmt.users().get("user_id", new UserFilter()); -Request> permissionsRequest = mgmt.users().getPermissions("user_id", new PermissionsFilter()); -Request> rolesRequest = mgmt.users().getRoles("user_id", new RolesFilter()); -Request logsRequest = mgmt.users().getLogEvents("user_id", new LogEventFilter()); -``` - -**v3:** -```java -// Operations organized into sub-clients -GetUserResponseContent user = client.users().get("user_id"); -SyncPagingIterable permissions = client.users().permissions().list("user_id"); -SyncPagingIterable roles = client.users().roles().list("user_id"); -SyncPagingIterable logs = client.users().logs().list("user_id"); -``` - -#### Common sub-client mappings - -| v2 Method | v3 Sub-client | -|-----------|---------------| -| `mgmt.users().getPermissions()` | `client.users().permissions().list()` | -| `mgmt.users().getRoles()` | `client.users().roles().list()` | -| `mgmt.users().getLogEvents()` | `client.users().logs().list()` | -| `mgmt.users().getOrganizations()` | `client.users().organizations().list()` | -| `mgmt.users().link()` | `client.users().identities().link()` | -| `mgmt.users().unlink()` | `client.users().identities().delete()` | -| `mgmt.users().deleteMultifactorProvider()` | `client.users().multifactor().deleteProvider()` | -| `mgmt.organizations().getMembers()` | `client.organizations().members().list()` | -| `mgmt.organizations().getInvitations()` | `client.organizations().invitations().list()` | -| `mgmt.organizations().getEnabledConnections()` | `client.organizations().enabledConnections().list()` | -| `mgmt.actions().getVersions()` | `client.actions().versions().list()` | -| `mgmt.actions().getTriggerBindings()` | `client.actions().triggers().bindings().list()` | -| `mgmt.guardian().getFactors()` | `client.guardian().factors().list()` | -| `mgmt.branding().getUniversalLoginTemplate()` | `client.branding().templates().getUniversalLogin()` | -| `mgmt.connections().getScimConfiguration()` | `client.connections().scimConfiguration().get()` | - -### Request and response patterns - -V3 uses type-safe request content objects with builders instead of domain objects or filter parameters. - -**v2:** -```java -import com.auth0.json.mgmt.users.User; -import com.auth0.net.Request; - -// Creating a user -User user = new User("Username-Password-Authentication"); -user.setEmail("test@example.com"); -user.setPassword("password123".toCharArray()); - -Request request = mgmt.users().create(user); -User createdUser = request.execute().getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.types.CreateUserRequestContent; -import com.auth0.client.mgmt.types.CreateUserResponseContent; - -// Creating a user -CreateUserResponseContent user = client.users().create( - CreateUserRequestContent - .builder() - .connection("Username-Password-Authentication") - .email("test@example.com") - .password("password123") - .build() -); -``` - -#### Key differences - -| Aspect | v2 | v3 | -|--------|----|----| -| Request building | Domain objects with setters | Builder pattern with `*RequestContent` types | -| Response type | `Request` requiring `.execute().getBody()` | Direct return of response object | -| Filtering | Filter classes (e.g., `UserFilter`) | `*RequestParameters` builder classes | -| Execution | Explicit `.execute()` call | Implicit execution on method call | - -### Pagination - -V3 introduces `SyncPagingIterable` for automatic pagination, replacing the manual `Request` pattern. - -**v2:** -```java -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.client.mgmt.filter.UserFilter; - -Request request = mgmt.users().list(new UserFilter().withPage(0, 50)); -UsersPage page = request.execute().getBody(); - -for (User user : page.getItems()) { - System.out.println(user.getEmail()); -} - -// Manual pagination -while (page.getNext() != null) { - request = mgmt.users().list(new UserFilter().withPage(page.getNext(), 50)); - page = request.execute().getBody(); - for (User user : page.getItems()) { - System.out.println(user.getEmail()); - } -} -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.SyncPagingIterable; -import com.auth0.client.mgmt.types.UserResponseSchema; -import com.auth0.client.mgmt.types.ListUsersRequestParameters; - -// Automatic iteration through all pages -SyncPagingIterable users = client.users().list( - ListUsersRequestParameters - .builder() - .perPage(50) - .build() -); - -for (UserResponseSchema user : users) { - System.out.println(user.getEmail()); -} - -// Or manual page control -List pageItems = users.getItems(); -while (users.hasNext()) { - pageItems = users.nextPage().getItems(); - // process page -} -``` - -### Exception handling - -V3 uses a unified `ManagementApiException` class instead of the v2 exception hierarchy. - -**v2:** -```java -import com.auth0.exception.Auth0Exception; -import com.auth0.exception.APIException; -import com.auth0.exception.RateLimitException; - -try { - User user = mgmt.users().get("user_id", null).execute().getBody(); -} catch (RateLimitException e) { - // Rate limited - long retryAfter = e.getLimit(); -} catch (APIException e) { - int statusCode = e.getStatusCode(); - String error = e.getError(); - String description = e.getDescription(); -} catch (Auth0Exception e) { - // Network or other errors -} -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.ManagementApiException; - -try { - GetUserResponseContent user = client.users().get("user_id"); -} catch (ManagementApiException e) { - int statusCode = e.statusCode(); - Object body = e.body(); - Map> headers = e.headers(); - String message = e.getMessage(); -} -``` - -### Accessing raw HTTP responses - -V3 provides access to full HTTP response metadata via `withRawResponse()`. - -**v2:** -```java -// Response wrapper provided status code -Response response = mgmt.users().get("user_id", null).execute(); -int statusCode = response.getStatusCode(); -User user = response.getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.ManagementApiHttpResponse; - -// Use withRawResponse() to access headers and metadata -ManagementApiHttpResponse response = client.users() - .withRawResponse() - .get("user_id"); - -GetUserResponseContent user = response.body(); -Map> headers = response.headers(); -``` - -### Request-level configuration - -V3 allows per-request configuration through `RequestOptions`. - -**v2:** -```java -// Most configuration was at client level only -// Request-level headers required creating a new request manually -Request request = mgmt.users().get("user_id", null); -request.addHeader("X-Custom-Header", "value"); -User user = request.execute().getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.RequestOptions; - -GetUserResponseContent user = client.users().get( - "user_id", - GetUserRequestParameters.builder().build(), - RequestOptions.builder() - .timeout(10) - .maxRetries(1) - .addHeader("X-Custom-Header", "value") - .build() -); -``` - -### Type changes - -V3 uses generated type classes located in `com.auth0.client.mgmt.types` instead of the hand-written POJOs in `com.auth0.json.mgmt`. - -**v2:** -```java -import com.auth0.json.mgmt.users.User; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.organizations.Organization; -``` - -**v3:** -```java -import com.auth0.client.mgmt.types.UserResponseSchema; -import com.auth0.client.mgmt.types.CreateUserRequestContent; -import com.auth0.client.mgmt.types.CreateUserResponseContent; -import com.auth0.client.mgmt.types.Role; -import com.auth0.client.mgmt.types.Organization; -``` - -Type naming conventions in v3: -- Request body types: `*RequestContent` (e.g., `CreateUserRequestContent`) -- Response types: `*ResponseContent` or `*ResponseSchema` (e.g., `GetUserResponseContent`, `UserResponseSchema`) -- Query parameters: `*RequestParameters` (e.g., `ListUsersRequestParameters`) - -All types use immutable builders: - -```java -// v3 type construction -CreateUserRequestContent request = CreateUserRequestContent - .builder() - .email("test@example.com") - .connection("Username-Password-Authentication") - .password("secure-password") - .build(); -``` From bff7384fadbf39a528930853c3122dcd936efb8f Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:50:11 +0000 Subject: [PATCH 06/13] SDK regeneration --- .DS_Store | Bin 8196 -> 0 bytes .fern/metadata.json | 16 + .gitignore | 2 +- CHANGELOG.md | 868 - LICENSE | 21 - MIGRATION_GUIDE.md | 369 - reference.md | 13758 ++++++++++------ .../client/mgmt/AsyncEventStreamsClient.java | 9 +- .../mgmt/AsyncRawCustomDomainsClient.java | 5 - .../mgmt/AsyncRawEventStreamsClient.java | 14 +- .../mgmt/AsyncRawRefreshTokensClient.java | 109 + .../client/mgmt/AsyncRefreshTokensClient.java | 25 + .../auth0/client/mgmt/EventStreamsClient.java | 9 +- .../client/mgmt/RawCustomDomainsClient.java | 5 - .../client/mgmt/RawEventStreamsClient.java | 13 +- .../client/mgmt/RawRefreshTokensClient.java | 85 + .../client/mgmt/RefreshTokensClient.java | 24 + ...ctionTriggerBindingsRequestParameters.java | 6 +- .../UpdateActionBindingsRequestContent.java | 6 +- .../ListActionVersionsRequestParameters.java | 6 +- ...AttackProtectionCaptchaRequestContent.java | 6 +- ...ateBotDetectionSettingsRequestContent.java | 6 +- ...sswordDetectionSettingsRequestContent.java | 6 +- ...pdateBruteForceSettingsRequestContent.java | 6 +- ...eBruteForceSettingsRequestContentMode.java | 6 +- ...orceSettingsRequestContentShieldsItem.java | 6 +- ...ousIpThrottlingSettingsRequestContent.java | 6 +- ...teBrandingPhoneProviderRequestContent.java | 22 +- ...tePhoneProviderSendTestRequestContent.java | 16 +- .../CreatePhoneTemplateRequestContent.java | 6 +- ...emplateTestNotificationRequestContent.java | 16 +- ...andingPhoneProvidersRequestParameters.java | 6 +- .../ListPhoneTemplatesRequestParameters.java | 6 +- ...teBrandingPhoneProviderRequestContent.java | 6 +- .../UpdatePhoneTemplateRequestContent.java | 6 +- .../CreateBrandingThemeRequestContent.java | 24 +- .../UpdateBrandingThemeRequestContent.java | 24 +- ...ntGrantOrganizationsRequestParameters.java | 6 +- .../clients/types/ConnectionsGetRequest.java | 6 +- .../PatchClientCredentialRequestContent.java | 6 +- .../PostClientCredentialRequestContent.java | 36 +- .../types/CreateScimTokenRequestContent.java | 6 +- ...ConnectionUsersByEmailQueryParameters.java | 12 +- ...ectionEnabledClientsRequestParameters.java | 6 +- ...UpdateScimConfigurationRequestContent.java | 18 +- .../client/mgmt/core/AsyncCustomPager.java | 4 +- .../auth0/client/mgmt/core/CustomPager.java | 4 +- .../CreateEmailProviderRequestContent.java | 30 +- .../GetEmailProviderRequestParameters.java | 6 +- .../UpdateEmailProviderRequestContent.java | 6 +- .../client/mgmt/errors/BadRequestError.java | 2 +- .../client/mgmt/errors/ConflictError.java | 2 +- .../mgmt/errors/ContentTooLargeError.java | 2 +- .../client/mgmt/errors/ForbiddenError.java | 2 +- .../mgmt/errors/InternalServerError.java | 2 +- .../client/mgmt/errors/NotFoundError.java | 2 +- .../mgmt/errors/PaymentRequiredError.java | 2 +- .../mgmt/errors/ServiceUnavailableError.java | 2 +- .../mgmt/errors/TooManyRequestsError.java | 2 +- .../client/mgmt/errors/UnauthorizedError.java | 2 +- ...teEventStreamRedeliveryRequestContent.java | 6 +- ...ventStreamDeliveriesRequestParameters.java | 6 +- .../flows/types/ExecutionsGetRequest.java | 6 +- .../flows/types/ExecutionsListRequest.java | 6 +- ...lowsVaultConnectionsRequestParameters.java | 6 +- ...ateFlowsVaultConnectionRequestContent.java | 6 +- .../factors/AsyncPushNotificationClient.java | 97 +- .../AsyncRawPushNotificationClient.java | 320 +- .../factors/PushNotificationClient.java | 97 +- .../factors/RawPushNotificationClient.java | 259 +- ...ardianFactorDuoSettingsRequestContent.java | 6 +- ...ardianFactorDuoSettingsRequestContent.java | 6 +- ...FactorPhoneMessageTypesRequestContent.java | 6 +- ...ianFactorPhoneTemplatesRequestContent.java | 14 +- ...rdianFactorSmsTemplatesRequestContent.java | 14 +- ...ianFactorsProviderPhoneRequestContent.java | 12 +- ...torsProviderPhoneTwilioRequestContent.java | 6 +- ...derPushNotificationApnsRequestContent.java | 8 +- ...iderPushNotificationFcmRequestContent.java | 8 +- ...erPushNotificationFcmv1RequestContent.java | 8 +- ...roviderPushNotificationRequestContent.java | 12 +- ...iderPushNotificationSnsRequestContent.java | 6 +- ...rdianFactorsProviderSmsRequestContent.java | 12 +- ...actorsProviderSmsTwilioRequestContent.java | 6 +- ...derPushNotificationApnsRequestContent.java | 208 + ...iderPushNotificationFcmRequestContent.java | 130 + ...erPushNotificationFcmv1RequestContent.java | 131 + ...iderPushNotificationSnsRequestContent.java | 6 +- ...uardianEnrollmentTicketRequestContent.java | 32 +- .../SetGuardianFactorRequestContent.java | 12 +- .../CreateExportUsersRequestContent.java | 6 +- .../CreateImportUsersRequestContent.java | 24 +- ...CreateVerificationEmailRequestContent.java | 24 +- .../mgmt/jobs/types/ErrorsGetResponse.java | 8 +- .../CreateEncryptionKeyRequestContent.java | 12 +- .../ImportEncryptionKeyRequestContent.java | 12 +- .../ListEncryptionKeysRequestParameters.java | 6 +- .../SetCustomSigningKeysRequestContent.java | 6 +- .../AsyncDiscoveryDomainsClient.java | 27 +- .../AsyncRawDiscoveryDomainsClient.java | 103 +- .../organizations/DiscoveryDomainsClient.java | 26 +- .../RawDiscoveryDomainsClient.java | 79 +- ...OrganizationMemberRolesRequestContent.java | 6 +- ...OrganizationMemberRolesRequestContent.java | 6 +- ...anizationMemberRolesRequestParameters.java | 6 +- ...dOrganizationConnectionRequestContent.java | 24 +- ...OrganizationClientGrantRequestContent.java | 12 +- ...nizationDiscoveryDomainRequestContent.java | 67 +- ...eOrganizationInvitationRequestContent.java | 40 +- ...reateOrganizationMemberRequestContent.java | 6 +- ...leteOrganizationMembersRequestContent.java | 6 +- ...ganizationInvitationRequestParameters.java | 6 +- ...nizationClientGrantsRequestParameters.java | 6 +- ...anizationConnectionsRequestParameters.java | 6 +- ...tionDiscoveryDomainsRequestParameters.java | 6 +- ...anizationInvitationsRequestParameters.java | 6 +- ...tOrganizationMembersRequestParameters.java | 6 +- ...eOrganizationConnectionRequestContent.java | 6 +- ...nizationDiscoveryDomainRequestContent.java | 45 +- .../types/BulkUpdateAculRequestContent.java | 6 +- .../types/ListAculsRequestParameters.java | 6 +- .../types/UpdateAculRequestContent.java | 6 +- ...smentsSettingsNewDeviceRequestContent.java | 12 +- ...RiskAssessmentsSettingsRequestContent.java | 12 +- .../AddRolePermissionsRequestContent.java | 6 +- .../types/AssignRoleUsersRequestContent.java | 6 +- .../DeleteRolePermissionsRequestContent.java | 6 +- .../ListRolePermissionsRequestParameters.java | 6 +- .../types/ListRoleUsersRequestParameters.java | 6 +- ...ServiceProfileSsoTicketRequestContent.java | 42 +- .../GetTenantSettingsRequestParameters.java | 6 +- .../UpdateTenantSettingsRequestContent.java | 42 +- ...tingsRequestContentEnabledLocalesItem.java | 6 +- .../com/auth0/client/mgmt/types/Action.java | 42 +- .../auth0/client/mgmt/types/ActionBase.java | 6 +- .../client/mgmt/types/ActionBinding.java | 6 +- .../client/mgmt/types/ActionBindingRef.java | 6 +- .../mgmt/types/ActionBindingRefTypeEnum.java | 6 +- .../mgmt/types/ActionBindingTypeEnum.java | 6 +- .../mgmt/types/ActionBindingWithRef.java | 20 +- .../mgmt/types/ActionBuildStatusEnum.java | 6 +- .../mgmt/types/ActionDeployedVersion.java | 42 +- .../auth0/client/mgmt/types/ActionError.java | 6 +- .../mgmt/types/ActionExecutionResult.java | 6 +- .../mgmt/types/ActionExecutionStatusEnum.java | 6 +- .../mgmt/types/ActionModuleReference.java | 194 + .../mgmt/types/ActionSecretRequest.java | 6 +- .../mgmt/types/ActionSecretResponse.java | 6 +- .../client/mgmt/types/ActionTrigger.java | 36 +- .../types/ActionTriggerCompatibleTrigger.java | 14 +- .../client/mgmt/types/ActionVersion.java | 42 +- .../types/ActionVersionBuildStatusEnum.java | 6 +- .../mgmt/types/ActionVersionDependency.java | 6 +- .../client/mgmt/types/AculClientFilter.java | 8 +- .../mgmt/types/AculClientFilterById.java | 12 +- .../types/AculClientFilterByMetadata.java | 6 +- .../client/mgmt/types/AculConfigsItem.java | 50 +- .../types/AculContextConfigurationItem.java | 8 +- .../client/mgmt/types/AculContextEnum.java | 6 +- .../client/mgmt/types/AculDomainFilter.java | 8 +- .../mgmt/types/AculDomainFilterById.java | 12 +- .../types/AculDomainFilterByMetadata.java | 6 +- .../auth0/client/mgmt/types/AculFilters.java | 6 +- .../auth0/client/mgmt/types/AculHeadTag.java | 6 +- .../client/mgmt/types/AculMatchTypeEnum.java | 6 +- .../mgmt/types/AculOrganizationFilter.java | 8 +- .../types/AculOrganizationFilterById.java | 12 +- .../AculOrganizationFilterByMetadata.java | 6 +- .../mgmt/types/AculRenderingModeEnum.java | 6 +- .../mgmt/types/AculResponseContent.java | 6 +- ...OrganizationConnectionResponseContent.java | 6 +- ...rganizationClientGrantResponseContent.java | 6 +- ...syncApprovalNotificationsChannelsEnum.java | 6 +- ...rotectionCaptchaArkoseResponseContent.java | 6 +- ...ProtectionCaptchaAuthChallengeRequest.java | 12 +- ...onCaptchaAuthChallengeResponseContent.java | 6 +- ...CaptchaFriendlyCaptchaResponseContent.java | 6 +- ...tectionCaptchaHcaptchaResponseContent.java | 6 +- .../AttackProtectionCaptchaProviderId.java | 6 +- ...chaRecaptchaEnterpriseResponseContent.java | 6 +- ...tionCaptchaRecaptchaV2ResponseContent.java | 6 +- .../AttackProtectionUpdateCaptchaArkose.java | 26 +- ...rotectionUpdateCaptchaFriendlyCaptcha.java | 14 +- ...AttackProtectionUpdateCaptchaHcaptcha.java | 14 +- ...ctionUpdateCaptchaRecaptchaEnterprise.java | 16 +- ...ackProtectionUpdateCaptchaRecaptchaV2.java | 14 +- .../types/AuthenticationMethodTypeEnum.java | 6 +- .../mgmt/types/AuthenticationTypeEnum.java | 6 +- ...ectionChallengePolicyPasswordFlowEnum.java | 6 +- ...nChallengePolicyPasswordResetFlowEnum.java | 6 +- ...onChallengePolicyPasswordlessFlowEnum.java | 6 +- .../mgmt/types/BotDetectionLevelEnum.java | 6 +- .../client/mgmt/types/BrandingColors.java | 6 +- .../auth0/client/mgmt/types/BrandingFont.java | 6 +- .../mgmt/types/BrandingPageBackground.java | 8 +- .../mgmt/types/BrandingThemeBorders.java | 28 +- .../BrandingThemeBordersButtonsStyleEnum.java | 6 +- .../BrandingThemeBordersInputsStyleEnum.java | 6 +- .../mgmt/types/BrandingThemeColors.java | 58 +- ...dingThemeColorsCaptchaWidgetThemeEnum.java | 6 +- .../mgmt/types/BrandingThemeFontBodyText.java | 14 +- .../types/BrandingThemeFontButtonsText.java | 14 +- .../types/BrandingThemeFontInputLabels.java | 14 +- .../mgmt/types/BrandingThemeFontLinks.java | 14 +- .../BrandingThemeFontLinksStyleEnum.java | 6 +- .../mgmt/types/BrandingThemeFontSubtitle.java | 14 +- .../mgmt/types/BrandingThemeFontTitle.java | 14 +- .../client/mgmt/types/BrandingThemeFonts.java | 28 +- .../types/BrandingThemePageBackground.java | 16 +- ...dingThemePageBackgroundPageLayoutEnum.java | 6 +- .../mgmt/types/BrandingThemeWidget.java | 20 +- ...ingThemeWidgetHeaderTextAlignmentEnum.java | 6 +- .../BrandingThemeWidgetLogoPositionEnum.java | 6 +- ...ingThemeWidgetSocialButtonsLayoutEnum.java | 6 +- ...tectionAdminNotificationFrequencyEnum.java | 6 +- .../BreachedPasswordDetectionMethodEnum.java | 6 +- ...DetectionPreChangePasswordShieldsEnum.java | 6 +- ...sswordDetectionPreChangePasswordStage.java | 6 +- ...tectionPreUserRegistrationShieldsEnum.java | 6 +- ...wordDetectionPreUserRegistrationStage.java | 6 +- .../BreachedPasswordDetectionShieldsEnum.java | 6 +- .../types/BreachedPasswordDetectionStage.java | 6 +- .../types/BulkUpdateAculResponseContent.java | 6 +- .../types/ChangePasswordTicketIdentity.java | 18 +- .../ChangePasswordTicketRequestContent.java | 6 +- .../ChangePasswordTicketResponseContent.java | 12 +- .../com/auth0/client/mgmt/types/Client.java | 6 +- .../client/mgmt/types/ClientAddonAws.java | 6 +- .../mgmt/types/ClientAddonAzureBlob.java | 6 +- .../client/mgmt/types/ClientAddonAzureSb.java | 6 +- .../mgmt/types/ClientAddonEchoSign.java | 6 +- .../client/mgmt/types/ClientAddonEgnyte.java | 6 +- .../mgmt/types/ClientAddonFirebase.java | 6 +- .../client/mgmt/types/ClientAddonLayer.java | 24 +- .../client/mgmt/types/ClientAddonMscrm.java | 12 +- .../mgmt/types/ClientAddonNewRelic.java | 6 +- .../client/mgmt/types/ClientAddonOag.java | 4 +- .../mgmt/types/ClientAddonOffice365.java | 6 +- .../client/mgmt/types/ClientAddonRms.java | 12 +- .../mgmt/types/ClientAddonSalesforce.java | 6 +- .../mgmt/types/ClientAddonSalesforceApi.java | 6 +- .../ClientAddonSalesforceSandboxApi.java | 6 +- .../client/mgmt/types/ClientAddonSaml.java | 6 +- .../client/mgmt/types/ClientAddonSapapi.java | 6 +- .../client/mgmt/types/ClientAddonSentry.java | 6 +- .../mgmt/types/ClientAddonSharePoint.java | 6 +- .../ClientAddonSharePointExternalUrl.java | 8 +- .../client/mgmt/types/ClientAddonSlack.java | 12 +- .../mgmt/types/ClientAddonSpringCm.java | 6 +- .../mgmt/types/ClientAddonSsoIntegration.java | 6 +- .../client/mgmt/types/ClientAddonWams.java | 6 +- .../client/mgmt/types/ClientAddonZendesk.java | 6 +- .../client/mgmt/types/ClientAddonZoom.java | 6 +- .../auth0/client/mgmt/types/ClientAddons.java | 6 +- .../client/mgmt/types/ClientAppTypeEnum.java | 6 +- .../types/ClientAuthenticationMethod.java | 6 +- ...ticationMethodSelfSignedTlsClientAuth.java | 6 +- ...ientAuthenticationMethodTlsClientAuth.java | 6 +- .../mgmt/types/ClientComplianceLevelEnum.java | 6 +- .../ClientCreateAuthenticationMethod.java | 6 +- .../client/mgmt/types/ClientCredential.java | 6 +- .../types/ClientCredentialAlgorithmEnum.java | 6 +- .../mgmt/types/ClientCredentialTypeEnum.java | 6 +- .../mgmt/types/ClientDefaultOrganization.java | 18 +- .../mgmt/types/ClientEncryptionKey.java | 6 +- ...entGrantOrganizationNullableUsageEnum.java | 6 +- .../ClientGrantOrganizationUsageEnum.java | 6 +- .../types/ClientGrantResponseContent.java | 6 +- .../types/ClientGrantSubjectTypeEnum.java | 6 +- .../mgmt/types/ClientJwtConfiguration.java | 6 +- .../auth0/client/mgmt/types/ClientMobile.java | 6 +- .../mgmt/types/ClientMobileAndroid.java | 6 +- .../client/mgmt/types/ClientMobileiOs.java | 6 +- ...ClientOidcBackchannelLogoutInitiators.java | 6 +- ...ntOidcBackchannelLogoutInitiatorsEnum.java | 6 +- ...dcBackchannelLogoutInitiatorsModeEnum.java | 6 +- ...tOidcBackchannelLogoutSessionMetadata.java | 6 +- .../ClientOidcBackchannelLogoutSettings.java | 6 +- .../ClientOrganizationDiscoveryEnum.java | 6 +- ...ClientOrganizationRequireBehaviorEnum.java | 6 +- ...tOrganizationRequireBehaviorPatchEnum.java | 6 +- .../types/ClientOrganizationUsageEnum.java | 6 +- .../ClientOrganizationUsagePatchEnum.java | 6 +- .../ClientRefreshTokenConfiguration.java | 84 +- .../mgmt/types/ClientRefreshTokenPolicy.java | 174 + ...nsferAllowedAuthenticationMethodsEnum.java | 6 +- .../ClientSessionTransferConfiguration.java | 6 +- ...lientSessionTransferDeviceBindingEnum.java | 6 +- ...ntSignedRequestObjectWithCredentialId.java | 6 +- ...lientSignedRequestObjectWithPublicKey.java | 6 +- .../client/mgmt/types/ClientSigningKey.java | 6 +- .../ClientTokenEndpointAuthMethodEnum.java | 6 +- ...ientTokenEndpointAuthMethodOrNullEnum.java | 6 +- .../ClientTokenExchangeConfiguration.java | 6 +- ...lientTokenExchangeConfigurationOrNull.java | 6 +- .../client/mgmt/types/ConnectedAccount.java | 30 +- .../types/ConnectionAttributeIdentifier.java | 6 +- .../types/ConnectionAttributeMapOidc.java | 6 +- .../types/ConnectionAttributeMapOkta.java | 6 +- .../mgmt/types/ConnectionAttributes.java | 6 +- .../ConnectionAuthenticationMethods.java | 6 +- .../ConnectionAuthenticationPurpose.java | 12 +- .../client/mgmt/types/ConnectionCommon.java | 22 +- .../ConnectionConnectedAccountsPurpose.java | 16 +- .../types/ConnectionConnectionSettings.java | 6 +- .../ConnectionConnectionSettingsPkceEnum.java | 6 +- .../mgmt/types/ConnectionCustomScripts.java | 6 +- .../ConnectionDigestAlgorithmEnumSaml.java | 86 + .../mgmt/types/ConnectionEnabledClient.java | 12 +- ...ctionFederatedConnectionsAccessTokens.java | 6 +- .../types/ConnectionFieldsMapSamlValue.java | 98 + .../client/mgmt/types/ConnectionForList.java | 6 +- .../mgmt/types/ConnectionForOrganization.java | 24 +- .../ConnectionGatewayAuthentication.java | 24 +- ...onnectionIdTokenSignedResponseAlgEnum.java | 6 +- .../ConnectionIdentifierPrecedenceEnum.java | 6 +- .../ConnectionIdentityApiEnumAzureAd.java | 6 +- .../types/ConnectionIdentityProviderEnum.java | 6 +- .../client/mgmt/types/ConnectionKey.java | 50 +- .../mgmt/types/ConnectionKeyUseEnum.java | 6 +- .../types/ConnectionMappingModeEnumOidc.java | 6 +- .../types/ConnectionMappingModeEnumOkta.java | 6 +- .../client/mgmt/types/ConnectionMfa.java | 6 +- .../mgmt/types/ConnectionOptionsApple.java | 8 +- .../mgmt/types/ConnectionOptionsAuth0.java | 8 +- .../mgmt/types/ConnectionOptionsAzureAd.java | 23 +- .../mgmt/types/ConnectionOptionsCommon.java | 8 +- .../types/ConnectionOptionsCommonOidc.java | 217 +- .../types/ConnectionOptionsGoogleApps.java | 1052 ++ .../types/ConnectionOptionsGoogleOAuth2.java | 8 +- ...onsIdpInitiatedClientProtocolEnumSaml.java | 97 + .../ConnectionOptionsIdpinitiatedSaml.java | 188 + .../mgmt/types/ConnectionOptionsOAuth2.java | 8 +- .../types/ConnectionOptionsOAuth2Common.java | 8 +- .../mgmt/types/ConnectionOptionsOidc.java | 235 +- .../types/ConnectionOptionsOidcMetadata.java | 154 +- .../mgmt/types/ConnectionOptionsOkta.java | 235 +- .../mgmt/types/ConnectionOptionsSaml.java | 949 ++ ...ConnectionPasskeyAuthenticationMethod.java | 6 +- .../ConnectionPasskeyChallengeUiEnum.java | 6 +- .../mgmt/types/ConnectionPasskeyOptions.java | 6 +- ...onnectionPasswordAuthenticationMethod.java | 6 +- .../ConnectionPasswordComplexityOptions.java | 6 +- .../ConnectionPasswordDictionaryOptions.java | 16 +- .../ConnectionPasswordHistoryOptions.java | 16 +- ...nnectionPasswordNoPersonalInfoOptions.java | 12 +- .../types/ConnectionPasswordPolicyEnum.java | 6 +- .../client/mgmt/types/ConnectionProfile.java | 6 +- .../mgmt/types/ConnectionProfileConfig.java | 4 +- .../types/ConnectionProfileOrganization.java | 6 +- ...ganizationAssignMembershipOnLoginEnum.java | 6 +- ...onProfileOrganizationShowAsButtonEnum.java | 6 +- .../ConnectionProfileStrategyOverride.java | 6 +- .../ConnectionProfileStrategyOverrides.java | 6 +- ...fileStrategyOverridesConnectionConfig.java | 4 +- .../mgmt/types/ConnectionProfileTemplate.java | 6 +- .../types/ConnectionProfileTemplateItem.java | 6 +- .../types/ConnectionPropertiesOptions.java | 6 +- .../ConnectionProtocolBindingEnumSaml.java | 90 + .../mgmt/types/ConnectionResponseCommon.java | 26 +- .../types/ConnectionResponseContentAd.java | 26 +- .../types/ConnectionResponseContentAdfs.java | 26 +- .../ConnectionResponseContentAmazon.java | 26 +- .../types/ConnectionResponseContentAol.java | 26 +- .../types/ConnectionResponseContentApple.java | 26 +- .../types/ConnectionResponseContentAuth0.java | 26 +- .../ConnectionResponseContentAuth0Oidc.java | 26 +- .../ConnectionResponseContentAzureAd.java | 26 +- .../types/ConnectionResponseContentBaidu.java | 26 +- .../ConnectionResponseContentBitbucket.java | 26 +- .../types/ConnectionResponseContentBitly.java | 26 +- .../types/ConnectionResponseContentBox.java | 26 +- .../ConnectionResponseContentCustom.java | 26 +- .../ConnectionResponseContentDaccount.java | 26 +- .../ConnectionResponseContentDropbox.java | 26 +- .../ConnectionResponseContentDwolla.java | 26 +- .../types/ConnectionResponseContentEmail.java | 26 +- .../ConnectionResponseContentEvernote.java | 26 +- ...nectionResponseContentEvernoteSandbox.java | 26 +- .../types/ConnectionResponseContentExact.java | 26 +- .../ConnectionResponseContentFacebook.java | 26 +- .../ConnectionResponseContentFitbit.java | 26 +- .../ConnectionResponseContentFlickr.java | 26 +- .../ConnectionResponseContentGitHub.java | 26 +- .../ConnectionResponseContentGoogleApps.java | 38 +- ...ConnectionResponseContentGoogleOAuth2.java | 26 +- .../ConnectionResponseContentInstagram.java | 26 +- .../types/ConnectionResponseContentIp.java | 26 +- .../types/ConnectionResponseContentLine.java | 26 +- .../ConnectionResponseContentLinkedin.java | 26 +- .../ConnectionResponseContentMiicard.java | 26 +- .../ConnectionResponseContentOAuth1.java | 26 +- .../ConnectionResponseContentOAuth2.java | 26 +- .../ConnectionResponseContentOffice365.java | 26 +- .../types/ConnectionResponseContentOidc.java | 26 +- .../types/ConnectionResponseContentOkta.java | 26 +- .../ConnectionResponseContentPaypal.java | 26 +- ...onnectionResponseContentPaypalSandbox.java | 26 +- ...ConnectionResponseContentPingFederate.java | 26 +- ...nnectionResponseContentPlanningCenter.java | 26 +- .../ConnectionResponseContentRenren.java | 26 +- .../ConnectionResponseContentSalesforce.java | 26 +- ...ionResponseContentSalesforceCommunity.java | 26 +- ...ctionResponseContentSalesforceSandbox.java | 26 +- .../types/ConnectionResponseContentSaml.java | 38 +- .../ConnectionResponseContentSharepoint.java | 26 +- .../types/ConnectionResponseContentShop.java | 26 +- .../ConnectionResponseContentShopify.java | 26 +- .../types/ConnectionResponseContentSms.java | 26 +- .../ConnectionResponseContentSoundcloud.java | 26 +- .../ConnectionResponseContentTheCity.java | 26 +- ...nnectionResponseContentTheCitySandbox.java | 26 +- ...tionResponseContentThirtySevenSignals.java | 26 +- .../ConnectionResponseContentTwitter.java | 26 +- .../ConnectionResponseContentUntappd.java | 26 +- .../ConnectionResponseContentVkontakte.java | 26 +- .../types/ConnectionResponseContentWeibo.java | 26 +- .../ConnectionResponseContentWindowsLive.java | 26 +- .../ConnectionResponseContentWordpress.java | 26 +- .../types/ConnectionResponseContentYahoo.java | 26 +- .../ConnectionResponseContentYammer.java | 26 +- .../ConnectionResponseContentYandex.java | 26 +- .../mgmt/types/ConnectionScopeOAuth2.java | 8 +- .../mgmt/types/ConnectionScriptsOAuth2.java | 6 +- .../ConnectionSetUserRootAttributesEnum.java | 6 +- ...houldTrustEmailVerifiedConnectionEnum.java | 6 +- .../ConnectionSignatureAlgorithmEnumSaml.java | 86 + .../mgmt/types/ConnectionSigningKeySaml.java | 130 + .../mgmt/types/ConnectionStrategyEnum.java | 6 +- ...ConnectionTokenEndpointAuthMethodEnum.java | 6 +- ...ectionTokenEndpointAuthSigningAlgEnum.java | 6 +- .../mgmt/types/ConnectionTypeEnumOidc.java | 6 +- ...onnectionUpstreamAdditionalProperties.java | 8 +- .../mgmt/types/ConnectionUpstreamAlias.java | 6 +- .../types/ConnectionUpstreamAliasEnum.java | 6 +- .../mgmt/types/ConnectionUpstreamValue.java | 6 +- .../ConnectionUseridAttributeEnumAzureAd.java | 6 +- .../ConnectionUsernameValidationOptions.java | 14 +- .../types/ConnectionValidationOptions.java | 6 +- .../ConnectionWaadProtocolEnumAzureAd.java | 6 +- .../types/CreateActionRequestContent.java | 92 +- .../types/CreateActionResponseContent.java | 42 +- ...eBrandingPhoneProviderResponseContent.java | 40 +- .../CreateBrandingThemeResponseContent.java | 24 +- .../CreateClientGrantRequestContent.java | 34 +- .../CreateClientGrantResponseContent.java | 6 +- .../types/CreateClientRequestContent.java | 232 +- .../types/CreateClientResponseContent.java | 6 +- .../mgmt/types/CreateConnectionCommon.java | 24 +- ...CreateConnectionProfileRequestContent.java | 32 +- ...reateConnectionProfileResponseContent.java | 6 +- .../types/CreateConnectionRequestContent.java | 50 +- .../CreateConnectionRequestContentAd.java | 24 +- .../CreateConnectionRequestContentAdfs.java | 24 +- .../CreateConnectionRequestContentAmazon.java | 24 +- .../CreateConnectionRequestContentAol.java | 24 +- .../CreateConnectionRequestContentApple.java | 24 +- .../CreateConnectionRequestContentAuth0.java | 24 +- ...eateConnectionRequestContentAuth0Oidc.java | 24 +- ...CreateConnectionRequestContentAzureAd.java | 24 +- .../CreateConnectionRequestContentBaidu.java | 24 +- ...eateConnectionRequestContentBitbucket.java | 24 +- .../CreateConnectionRequestContentBitly.java | 24 +- .../CreateConnectionRequestContentBox.java | 24 +- .../CreateConnectionRequestContentCustom.java | 24 +- ...reateConnectionRequestContentDaccount.java | 24 +- ...CreateConnectionRequestContentDropbox.java | 24 +- .../CreateConnectionRequestContentDwolla.java | 24 +- .../CreateConnectionRequestContentEmail.java | 24 +- ...reateConnectionRequestContentEvernote.java | 24 +- ...nnectionRequestContentEvernoteSandbox.java | 24 +- .../CreateConnectionRequestContentExact.java | 24 +- ...reateConnectionRequestContentFacebook.java | 24 +- .../CreateConnectionRequestContentFitbit.java | 24 +- .../CreateConnectionRequestContentFlickr.java | 24 +- .../CreateConnectionRequestContentGitHub.java | 24 +- ...ateConnectionRequestContentGoogleApps.java | 36 +- ...eConnectionRequestContentGoogleOAuth2.java | 24 +- ...eateConnectionRequestContentInstagram.java | 24 +- .../CreateConnectionRequestContentIp.java | 24 +- .../CreateConnectionRequestContentLine.java | 24 +- ...reateConnectionRequestContentLinkedin.java | 24 +- ...CreateConnectionRequestContentMiicard.java | 24 +- .../CreateConnectionRequestContentOAuth1.java | 24 +- .../CreateConnectionRequestContentOAuth2.java | 24 +- ...eateConnectionRequestContentOffice365.java | 24 +- .../CreateConnectionRequestContentOidc.java | 24 +- .../CreateConnectionRequestContentOkta.java | 24 +- .../CreateConnectionRequestContentPaypal.java | 24 +- ...ConnectionRequestContentPaypalSandbox.java | 24 +- ...eConnectionRequestContentPingFederate.java | 24 +- ...onnectionRequestContentPlanningCenter.java | 24 +- .../CreateConnectionRequestContentRenren.java | 24 +- ...ateConnectionRequestContentSalesforce.java | 24 +- ...tionRequestContentSalesforceCommunity.java | 24 +- ...ectionRequestContentSalesforceSandbox.java | 24 +- .../CreateConnectionRequestContentSaml.java | 36 +- ...ateConnectionRequestContentSharepoint.java | 24 +- .../CreateConnectionRequestContentShop.java | 24 +- ...CreateConnectionRequestContentShopify.java | 24 +- .../CreateConnectionRequestContentSms.java | 24 +- ...ateConnectionRequestContentSoundcloud.java | 24 +- ...CreateConnectionRequestContentTheCity.java | 24 +- ...onnectionRequestContentTheCitySandbox.java | 24 +- ...ctionRequestContentThirtySevenSignals.java | 24 +- ...CreateConnectionRequestContentTwitter.java | 24 +- ...CreateConnectionRequestContentUntappd.java | 24 +- ...eateConnectionRequestContentVkontakte.java | 24 +- .../CreateConnectionRequestContentWeibo.java | 24 +- ...teConnectionRequestContentWindowsLive.java | 24 +- ...eateConnectionRequestContentWordpress.java | 24 +- .../CreateConnectionRequestContentYahoo.java | 24 +- .../CreateConnectionRequestContentYammer.java | 24 +- .../CreateConnectionRequestContentYandex.java | 24 +- .../CreateConnectionResponseContent.java | 6 +- .../CreateCustomDomainRequestContent.java | 34 +- .../CreateCustomDomainResponseContent.java | 42 +- ...teDirectoryProvisioningRequestContent.java | 6 +- ...eDirectoryProvisioningResponseContent.java | 40 +- ...rectorySynchronizationResponseContent.java | 16 +- .../CreateEmailProviderResponseContent.java | 6 +- .../CreateEmailTemplateRequestContent.java | 72 +- .../CreateEmailTemplateResponseContent.java | 72 +- ...ptionKeyPublicWrappingResponseContent.java | 14 +- .../CreateEncryptionKeyResponseContent.java | 26 +- .../mgmt/types/CreateEncryptionKeyType.java | 6 +- ...CreateEventStreamActionRequestContent.java | 24 +- ...eEventStreamEventBridgeRequestContent.java | 24 +- ...eEventStreamRedeliveryResponseContent.java | 6 +- .../CreateEventStreamResponseContent.java | 8 +- ...ateEventStreamTestEventRequestContent.java | 16 +- ...teEventStreamTestEventResponseContent.java | 28 +- ...reateEventStreamWebHookRequestContent.java | 24 +- .../mgmt/types/CreateExportUsersFields.java | 16 +- .../CreateExportUsersResponseContent.java | 36 +- .../mgmt/types/CreateFlowRequestContent.java | 16 +- .../mgmt/types/CreateFlowResponseContent.java | 26 +- ...ateFlowsVaultConnectionActivecampaign.java | 8 +- ...wsVaultConnectionActivecampaignApiKey.java | 16 +- ...ConnectionActivecampaignUninitialized.java | 14 +- .../CreateFlowsVaultConnectionAirtable.java | 8 +- ...ateFlowsVaultConnectionAirtableApiKey.java | 16 +- ...sVaultConnectionAirtableUninitialized.java | 14 +- .../CreateFlowsVaultConnectionAuth0.java | 8 +- ...eateFlowsVaultConnectionAuth0OauthApp.java | 16 +- ...lowsVaultConnectionAuth0Uninitialized.java | 14 +- .../CreateFlowsVaultConnectionBigquery.java | 8 +- ...CreateFlowsVaultConnectionBigqueryJwt.java | 16 +- ...sVaultConnectionBigqueryUninitialized.java | 14 +- .../CreateFlowsVaultConnectionClearbit.java | 8 +- ...ateFlowsVaultConnectionClearbitApiKey.java | 16 +- ...sVaultConnectionClearbitUninitialized.java | 14 +- .../CreateFlowsVaultConnectionDocusign.java | 8 +- ...FlowsVaultConnectionDocusignOauthCode.java | 16 +- ...sVaultConnectionDocusignUninitialized.java | 14 +- ...reateFlowsVaultConnectionGoogleSheets.java | 8 +- ...sVaultConnectionGoogleSheetsOauthCode.java | 16 +- ...ltConnectionGoogleSheetsUninitialized.java | 14 +- .../types/CreateFlowsVaultConnectionHttp.java | 8 +- .../CreateFlowsVaultConnectionHttpBearer.java | 16 +- ...FlowsVaultConnectionHttpUninitialized.java | 14 +- .../CreateFlowsVaultConnectionHubspot.java | 8 +- ...eateFlowsVaultConnectionHubspotApiKey.java | 16 +- ...eFlowsVaultConnectionHubspotOauthCode.java | 16 +- ...wsVaultConnectionHubspotUninitialized.java | 14 +- .../types/CreateFlowsVaultConnectionJwt.java | 8 +- .../CreateFlowsVaultConnectionJwtJwt.java | 16 +- ...eFlowsVaultConnectionJwtUninitialized.java | 14 +- .../CreateFlowsVaultConnectionMailchimp.java | 8 +- ...teFlowsVaultConnectionMailchimpApiKey.java | 16 +- ...lowsVaultConnectionMailchimpOauthCode.java | 16 +- ...VaultConnectionMailchimpUninitialized.java | 14 +- .../CreateFlowsVaultConnectionMailjet.java | 8 +- ...eateFlowsVaultConnectionMailjetApiKey.java | 16 +- ...wsVaultConnectionMailjetUninitialized.java | 14 +- .../CreateFlowsVaultConnectionPipedrive.java | 8 +- ...lowsVaultConnectionPipedriveOauthCode.java | 16 +- ...ateFlowsVaultConnectionPipedriveToken.java | 16 +- ...VaultConnectionPipedriveUninitialized.java | 14 +- ...ateFlowsVaultConnectionRequestContent.java | 8 +- ...teFlowsVaultConnectionResponseContent.java | 36 +- .../CreateFlowsVaultConnectionSalesforce.java | 8 +- ...owsVaultConnectionSalesforceOauthCode.java | 16 +- ...aultConnectionSalesforceUninitialized.java | 14 +- .../CreateFlowsVaultConnectionSendgrid.java | 8 +- ...ateFlowsVaultConnectionSendgridApiKey.java | 16 +- ...sVaultConnectionSendgridUninitialized.java | 14 +- .../CreateFlowsVaultConnectionSlack.java | 8 +- ...ateFlowsVaultConnectionSlackOauthCode.java | 16 +- ...lowsVaultConnectionSlackUninitialized.java | 14 +- ...reateFlowsVaultConnectionSlackWebhook.java | 16 +- .../CreateFlowsVaultConnectionStripe.java | 8 +- ...eateFlowsVaultConnectionStripeKeyPair.java | 16 +- ...teFlowsVaultConnectionStripeOauthCode.java | 16 +- ...owsVaultConnectionStripeUninitialized.java | 14 +- .../CreateFlowsVaultConnectionTelegram.java | 8 +- ...eateFlowsVaultConnectionTelegramToken.java | 16 +- ...sVaultConnectionTelegramUninitialized.java | 14 +- .../CreateFlowsVaultConnectionTwilio.java | 8 +- ...reateFlowsVaultConnectionTwilioApiKey.java | 16 +- ...owsVaultConnectionTwilioUninitialized.java | 14 +- .../CreateFlowsVaultConnectionWhatsapp.java | 8 +- ...eateFlowsVaultConnectionWhatsappToken.java | 16 +- ...sVaultConnectionWhatsappUninitialized.java | 14 +- .../CreateFlowsVaultConnectionZapier.java | 8 +- ...owsVaultConnectionZapierUninitialized.java | 14 +- ...eateFlowsVaultConnectionZapierWebhook.java | 16 +- .../mgmt/types/CreateFormRequestContent.java | 40 +- .../mgmt/types/CreateFormResponseContent.java | 54 +- ...ardianEnrollmentTicketResponseContent.java | 6 +- .../mgmt/types/CreateHookRequestContent.java | 24 +- .../mgmt/types/CreateHookResponseContent.java | 6 +- .../CreateImportUsersResponseContent.java | 24 +- .../CreateLogStreamDatadogRequestBody.java | 34 +- ...CreateLogStreamEventBridgeRequestBody.java | 34 +- .../CreateLogStreamEventGridRequestBody.java | 34 +- .../types/CreateLogStreamHttpRequestBody.java | 34 +- .../CreateLogStreamMixpanelRequestBody.java | 34 +- .../types/CreateLogStreamRequestContent.java | 8 +- .../types/CreateLogStreamResponseContent.java | 8 +- .../CreateLogStreamSegmentRequestBody.java | 34 +- .../CreateLogStreamSplunkRequestBody.java | 34 +- .../types/CreateLogStreamSumoRequestBody.java | 34 +- .../types/CreateNetworkAclRequestContent.java | 18 +- ...izationDiscoveryDomainResponseContent.java | 81 +- ...OrganizationInvitationResponseContent.java | 6 +- .../CreateOrganizationRequestContent.java | 32 +- .../CreateOrganizationResponseContent.java | 6 +- ...ePhoneProviderSendTestResponseContent.java | 6 +- .../CreatePhoneTemplateResponseContent.java | 30 +- ...mplateTestNotificationResponseContent.java | 12 +- ...blicKeyDeviceCredentialRequestContent.java | 22 +- ...licKeyDeviceCredentialResponseContent.java | 12 +- .../CreateResourceServerRequestContent.java | 80 +- .../CreateResourceServerResponseContent.java | 6 +- .../mgmt/types/CreateRoleRequestContent.java | 16 +- .../mgmt/types/CreateRoleResponseContent.java | 6 +- .../mgmt/types/CreateRuleRequestContent.java | 22 +- .../mgmt/types/CreateRuleResponseContent.java | 6 +- ...CreateScimConfigurationRequestContent.java | 6 +- ...reateScimConfigurationResponseContent.java | 6 +- .../types/CreateScimTokenResponseContent.java | 6 +- ...reateSelfServiceProfileRequestContent.java | 32 +- ...eateSelfServiceProfileResponseContent.java | 6 +- ...erviceProfileSsoTicketResponseContent.java | 6 +- ...ateTokenExchangeProfileRequestContent.java | 18 +- ...teTokenExchangeProfileResponseContent.java | 6 +- .../client/mgmt/types/CreateTokenQuota.java | 12 +- ...ateUserAttributeProfileRequestContent.java | 22 +- ...teUserAttributeProfileResponseContent.java | 6 +- ...erAuthenticationMethodResponseContent.java | 60 +- .../mgmt/types/CreateUserRequestContent.java | 76 +- .../mgmt/types/CreateUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- ...reateVerificationEmailResponseContent.java | 20 +- .../CreatedAuthenticationMethodTypeEnum.java | 6 +- ...eatedUserAuthenticationMethodTypeEnum.java | 6 +- .../auth0/client/mgmt/types/CredentialId.java | 12 +- .../auth0/client/mgmt/types/CustomDomain.java | 48 +- .../CustomDomainCustomClientIpHeaderEnum.java | 6 +- .../CustomDomainProvisioningTypeEnum.java | 6 +- .../types/CustomDomainStatusFilterEnum.java | 6 +- .../mgmt/types/CustomDomainTypeEnum.java | 6 +- .../types/CustomProviderConfiguration.java | 6 +- .../mgmt/types/CustomProviderCredentials.java | 4 +- .../CustomProviderDeliveryMethodEnum.java | 6 +- .../types/CustomSigningKeyAlgorithmEnum.java | 6 +- .../mgmt/types/CustomSigningKeyCurveEnum.java | 6 +- .../mgmt/types/CustomSigningKeyJwk.java | 64 +- .../mgmt/types/CustomSigningKeyTypeEnum.java | 6 +- .../auth0/client/mgmt/types/DailyStats.java | 6 +- .../client/mgmt/types/DefaultTokenQuota.java | 6 +- .../types/DeleteActionRequestParameters.java | 6 +- ...erBlocksByIdentifierRequestParameters.java | 12 +- ...eteUserGrantByUserIdRequestParameters.java | 12 +- ...DeleteUserIdentityResponseContentItem.java | 36 +- .../types/DeployActionResponseContent.java | 42 +- .../DeployActionVersionRequestBodyParams.java | 6 +- .../DeployActionVersionResponseContent.java | 42 +- .../client/mgmt/types/DeviceCredential.java | 6 +- .../mgmt/types/DeviceCredentialTypeEnum.java | 6 +- .../DirectoryProvisioningMappingItem.java | 14 +- .../client/mgmt/types/DomainCertificate.java | 6 +- .../types/DomainCertificateAuthorityEnum.java | 6 +- .../types/DomainCertificateStatusEnum.java | 6 +- .../client/mgmt/types/DomainVerification.java | 6 +- .../mgmt/types/DomainVerificationMethod.java | 18 +- .../DomainVerificationMethodNameEnum.java | 6 +- .../types/DomainVerificationStatusEnum.java | 6 +- .../client/mgmt/types/EmailAttribute.java | 6 +- .../mgmt/types/EmailProviderCredentials.java | 6 +- .../types/EmailProviderCredentialsSchema.java | 8 +- ...lProviderCredentialsSchemaAccessKeyId.java | 6 +- .../EmailProviderCredentialsSchemaApiKey.java | 6 +- ...mailProviderCredentialsSchemaClientId.java | 6 +- ...iderCredentialsSchemaConnectionString.java | 6 +- ...mailProviderCredentialsSchemaSmtpHost.java | 6 +- .../EmailProviderCredentialsSchemaThree.java | 6 +- .../EmailProviderCredentialsSchemaZero.java | 12 +- .../mgmt/types/EmailProviderNameEnum.java | 6 +- .../mgmt/types/EmailTemplateNameEnum.java | 6 +- .../mgmt/types/EnabledFeaturesEnum.java | 6 +- .../client/mgmt/types/EncryptionKey.java | 26 +- .../client/mgmt/types/EncryptionKeyState.java | 6 +- .../client/mgmt/types/EncryptionKeyType.java | 6 +- .../types/EventStreamActionConfiguration.java | 12 +- .../types/EventStreamActionDestination.java | 14 +- .../EventStreamActionResponseContent.java | 6 +- .../mgmt/types/EventStreamCloudEvent.java | 6 +- .../mgmt/types/EventStreamDelivery.java | 28 +- .../types/EventStreamDeliveryAttempt.java | 18 +- .../EventStreamDeliveryEventTypeEnum.java | 6 +- .../types/EventStreamDestinationPatch.java | 8 +- .../EventStreamEventBridgeAwsRegionEnum.java | 6 +- .../EventStreamEventBridgeConfiguration.java | 18 +- .../EventStreamEventBridgeDestination.java | 14 +- ...EventStreamEventBridgeResponseContent.java | 6 +- .../mgmt/types/EventStreamEventTypeEnum.java | 6 +- .../types/EventStreamResponseContent.java | 8 +- .../mgmt/types/EventStreamStatusEnum.java | 6 +- .../mgmt/types/EventStreamSubscription.java | 6 +- .../types/EventStreamTestEventTypeEnum.java | 6 +- ...entStreamWebhookAuthorizationResponse.java | 8 +- .../types/EventStreamWebhookBasicAuth.java | 14 +- .../types/EventStreamWebhookBearerAuth.java | 12 +- .../EventStreamWebhookConfiguration.java | 14 +- .../types/EventStreamWebhookDestination.java | 14 +- .../EventStreamWebhookResponseContent.java | 6 +- .../mgmt/types/EventStreamsCreateRequest.java | 8 +- .../mgmt/types/ExpressConfiguration.java | 32 +- .../types/ExpressConfigurationOrNull.java | 32 +- ...ExtensibilityEmailProviderCredentials.java | 4 +- .../types/FederatedConnectionTokenSet.java | 6 +- .../auth0/client/mgmt/types/FlowAction.java | 8 +- .../mgmt/types/FlowActionActivecampaign.java | 8 +- .../FlowActionActivecampaignListContacts.java | 26 +- ...ctionActivecampaignListContactsParams.java | 14 +- ...FlowActionActivecampaignUpsertContact.java | 26 +- ...tionActivecampaignUpsertContactParams.java | 30 +- .../client/mgmt/types/FlowActionAirtable.java | 8 +- .../types/FlowActionAirtableCreateRecord.java | 26 +- .../FlowActionAirtableCreateRecordParams.java | 20 +- .../types/FlowActionAirtableListRecords.java | 26 +- .../FlowActionAirtableListRecordsParams.java | 24 +- .../types/FlowActionAirtableUpdateRecord.java | 26 +- .../FlowActionAirtableUpdateRecordParams.java | 22 +- .../client/mgmt/types/FlowActionAuth0.java | 8 +- .../mgmt/types/FlowActionAuth0CreateUser.java | 26 +- .../FlowActionAuth0CreateUserParams.java | 18 +- .../mgmt/types/FlowActionAuth0GetUser.java | 26 +- .../types/FlowActionAuth0GetUserParams.java | 14 +- .../mgmt/types/FlowActionAuth0SendEmail.java | 26 +- .../types/FlowActionAuth0SendEmailParams.java | 24 +- .../FlowActionAuth0SendEmailParamsFrom.java | 16 +- .../types/FlowActionAuth0SendRequest.java | 26 +- .../FlowActionAuth0SendRequestParams.java | 30 +- ...lowActionAuth0SendRequestParamsMethod.java | 6 +- ...owActionAuth0SendRequestParamsPayload.java | 8 +- ...uth0SendRequestParamsQueryParamsValue.java | 8 +- .../mgmt/types/FlowActionAuth0UpdateUser.java | 26 +- .../FlowActionAuth0UpdateUserParams.java | 20 +- .../types/FlowActionBigqueryInsertRows.java | 26 +- .../FlowActionBigqueryInsertRowsParams.java | 20 +- .../client/mgmt/types/FlowActionClearbit.java | 8 +- .../types/FlowActionClearbitFindCompany.java | 26 +- .../FlowActionClearbitFindCompanyParams.java | 14 +- .../types/FlowActionClearbitFindPerson.java | 26 +- .../FlowActionClearbitFindPersonParams.java | 14 +- .../types/FlowActionEmailVerifyEmail.java | 26 +- .../FlowActionEmailVerifyEmailParams.java | 16 +- ...FlowActionEmailVerifyEmailParamsRules.java | 6 +- .../client/mgmt/types/FlowActionFlow.java | 8 +- .../types/FlowActionFlowBooleanCondition.java | 26 +- .../FlowActionFlowBooleanConditionParams.java | 6 +- .../mgmt/types/FlowActionFlowDelayFlow.java | 26 +- .../types/FlowActionFlowDelayFlowParams.java | 16 +- .../FlowActionFlowDelayFlowParamsNumber.java | 8 +- .../FlowActionFlowDelayFlowParamsUnits.java | 6 +- .../mgmt/types/FlowActionFlowDoNothing.java | 28 +- .../types/FlowActionFlowDoNothingParams.java | 4 +- .../types/FlowActionFlowErrorMessage.java | 26 +- .../FlowActionFlowErrorMessageParams.java | 12 +- .../mgmt/types/FlowActionFlowMapValue.java | 26 +- .../types/FlowActionFlowMapValueParams.java | 20 +- .../FlowActionFlowMapValueParamsFallback.java | 8 +- .../FlowActionFlowMapValueParamsInput.java | 8 +- .../mgmt/types/FlowActionFlowReturnJson.java | 26 +- .../types/FlowActionFlowReturnJsonParams.java | 12 +- ...FlowActionFlowReturnJsonParamsPayload.java | 8 +- .../mgmt/types/FlowActionFlowStoreVars.java | 26 +- .../types/FlowActionFlowStoreVarsParams.java | 6 +- .../types/FlowActionGoogleSheetsAddRow.java | 26 +- .../FlowActionGoogleSheetsAddRowParams.java | 22 +- ...ActionGoogleSheetsAddRowParamsSheetId.java | 8 +- .../mgmt/types/FlowActionHttpSendRequest.java | 26 +- .../FlowActionHttpSendRequestParams.java | 40 +- ...wActionHttpSendRequestParamsBasicAuth.java | 6 +- ...ctionHttpSendRequestParamsContentType.java | 6 +- ...FlowActionHttpSendRequestParamsMethod.java | 6 +- ...lowActionHttpSendRequestParamsPayload.java | 8 +- ...HttpSendRequestParamsQueryParamsValue.java | 8 +- .../client/mgmt/types/FlowActionHubspot.java | 8 +- .../types/FlowActionHubspotEnrollContact.java | 26 +- .../FlowActionHubspotEnrollContactParams.java | 16 +- ...nHubspotEnrollContactParamsWorkflowId.java | 8 +- .../types/FlowActionHubspotGetContact.java | 26 +- .../FlowActionHubspotGetContactParams.java | 14 +- .../types/FlowActionHubspotUpsertContact.java | 26 +- .../FlowActionHubspotUpsertContactParams.java | 18 +- ...ionHubspotUpsertContactParamsProperty.java | 12 +- .../client/mgmt/types/FlowActionJson.java | 8 +- .../mgmt/types/FlowActionJsonCreateJson.java | 26 +- .../types/FlowActionJsonCreateJsonParams.java | 6 +- .../mgmt/types/FlowActionJsonParseJson.java | 26 +- .../types/FlowActionJsonParseJsonParams.java | 12 +- .../types/FlowActionJsonSerializeJson.java | 26 +- .../FlowActionJsonSerializeJsonParams.java | 12 +- ...owActionJsonSerializeJsonParamsObject.java | 8 +- .../client/mgmt/types/FlowActionJwt.java | 8 +- .../mgmt/types/FlowActionJwtDecodeJwt.java | 26 +- .../types/FlowActionJwtDecodeJwtParams.java | 12 +- .../mgmt/types/FlowActionJwtSignJwt.java | 26 +- .../types/FlowActionJwtSignJwtParams.java | 32 +- .../mgmt/types/FlowActionJwtVerifyJwt.java | 26 +- .../types/FlowActionJwtVerifyJwtParams.java | 22 +- .../FlowActionMailchimpUpsertMember.java | 26 +- ...FlowActionMailchimpUpsertMemberParams.java | 16 +- ...tionMailchimpUpsertMemberParamsMember.java | 18 +- .../types/FlowActionMailjetSendEmail.java | 26 +- .../FlowActionMailjetSendEmailParams.java | 8 +- ...owActionMailjetSendEmailParamsContent.java | 12 +- ...ctionMailjetSendEmailParamsTemplateId.java | 16 +- .../client/mgmt/types/FlowActionOtp.java | 8 +- .../mgmt/types/FlowActionOtpGenerateCode.java | 26 +- .../FlowActionOtpGenerateCodeParams.java | 14 +- .../mgmt/types/FlowActionOtpVerifyCode.java | 26 +- .../types/FlowActionOtpVerifyCodeParams.java | 14 +- .../FlowActionOtpVerifyCodeParamsCode.java | 8 +- .../mgmt/types/FlowActionPipedrive.java | 8 +- .../types/FlowActionPipedriveAddDeal.java | 26 +- .../FlowActionPipedriveAddDealParams.java | 38 +- ...nPipedriveAddDealParamsOrganizationId.java | 8 +- ...wActionPipedriveAddDealParamsPersonId.java | 8 +- ...owActionPipedriveAddDealParamsStageId.java | 8 +- ...lowActionPipedriveAddDealParamsUserId.java | 8 +- .../FlowActionPipedriveAddOrganization.java | 26 +- ...wActionPipedriveAddOrganizationParams.java | 22 +- ...PipedriveAddOrganizationParamsOwnerId.java | 8 +- .../types/FlowActionPipedriveAddPerson.java | 26 +- .../FlowActionPipedriveAddPersonParams.java | 34 +- ...ipedriveAddPersonParamsOrganizationId.java | 8 +- ...ActionPipedriveAddPersonParamsOwnerId.java | 8 +- .../mgmt/types/FlowActionSalesforce.java | 8 +- .../types/FlowActionSalesforceCreateLead.java | 26 +- .../FlowActionSalesforceCreateLeadParams.java | 32 +- .../types/FlowActionSalesforceGetLead.java | 26 +- .../FlowActionSalesforceGetLeadParams.java | 14 +- .../FlowActionSalesforceSearchLeads.java | 26 +- ...FlowActionSalesforceSearchLeadsParams.java | 22 +- ...alesforceSearchLeadsParamsSearchField.java | 6 +- .../types/FlowActionSalesforceUpdateLead.java | 26 +- .../FlowActionSalesforceUpdateLeadParams.java | 18 +- .../types/FlowActionSendgridSendEmail.java | 26 +- .../FlowActionSendgridSendEmailParams.java | 20 +- ...owActionSendgridSendEmailParamsPerson.java | 16 +- .../types/FlowActionSlackPostMessage.java | 26 +- .../FlowActionSlackPostMessageParams.java | 20 +- ...ctionSlackPostMessageParamsAttachment.java | 6 +- ...SlackPostMessageParamsAttachmentColor.java | 6 +- ...SlackPostMessageParamsAttachmentField.java | 20 +- .../client/mgmt/types/FlowActionStripe.java | 8 +- .../mgmt/types/FlowActionStripeAddTaxId.java | 26 +- .../types/FlowActionStripeAddTaxIdParams.java | 18 +- .../mgmt/types/FlowActionStripeAddress.java | 6 +- .../types/FlowActionStripeCreateCustomer.java | 26 +- .../FlowActionStripeCreateCustomerParams.java | 44 +- .../FlowActionStripeCreatePortalSession.java | 26 +- ...ActionStripeCreatePortalSessionParams.java | 18 +- .../types/FlowActionStripeDeleteTaxId.java | 26 +- .../FlowActionStripeDeleteTaxIdParams.java | 16 +- .../types/FlowActionStripeFindCustomers.java | 26 +- .../FlowActionStripeFindCustomersParams.java | 14 +- .../types/FlowActionStripeGetCustomer.java | 26 +- .../FlowActionStripeGetCustomerParams.java | 14 +- .../mgmt/types/FlowActionStripeTaxId.java | 14 +- .../types/FlowActionStripeUpdateCustomer.java | 26 +- .../FlowActionStripeUpdateCustomerParams.java | 42 +- .../types/FlowActionTelegramSendMessage.java | 26 +- .../FlowActionTelegramSendMessageParams.java | 16 +- .../client/mgmt/types/FlowActionTwilio.java | 8 +- .../mgmt/types/FlowActionTwilioMakeCall.java | 26 +- .../types/FlowActionTwilioMakeCallParams.java | 18 +- .../mgmt/types/FlowActionTwilioSendSms.java | 26 +- .../types/FlowActionTwilioSendSmsParams.java | 18 +- .../types/FlowActionWhatsappSendMessage.java | 26 +- .../FlowActionWhatsappSendMessageParams.java | 20 +- ...ctionWhatsappSendMessageParamsPayload.java | 8 +- ...owActionWhatsappSendMessageParamsType.java | 6 +- .../client/mgmt/types/FlowActionXml.java | 8 +- .../mgmt/types/FlowActionXmlParseXml.java | 26 +- .../types/FlowActionXmlParseXmlParams.java | 12 +- .../mgmt/types/FlowActionXmlSerializeXml.java | 26 +- .../FlowActionXmlSerializeXmlParams.java | 12 +- ...FlowActionXmlSerializeXmlParamsObject.java | 8 +- .../types/FlowActionZapierTriggerWebhook.java | 26 +- .../FlowActionZapierTriggerWebhookParams.java | 16 +- ...ctionZapierTriggerWebhookParamsMethod.java | 6 +- .../mgmt/types/FlowExecutionSummary.java | 32 +- .../auth0/client/mgmt/types/FlowSummary.java | 22 +- .../client/mgmt/types/FlowsListRequest.java | 6 +- .../types/FlowsVaultConnectioSetupApiKey.java | 14 +- ...sVaultConnectioSetupApiKeyWithBaseUrl.java | 16 +- ...wsVaultConnectioSetupBigqueryOauthJwt.java | 6 +- .../FlowsVaultConnectioSetupHttpBearer.java | 14 +- .../types/FlowsVaultConnectioSetupJwt.java | 14 +- ...wsVaultConnectioSetupJwtAlgorithmEnum.java | 6 +- ...FlowsVaultConnectioSetupMailjetApiKey.java | 16 +- .../FlowsVaultConnectioSetupOauthApp.java | 22 +- .../FlowsVaultConnectioSetupOauthCode.java | 6 +- .../FlowsVaultConnectioSetupSecretApiKey.java | 14 +- ...FlowsVaultConnectioSetupStripeKeyPair.java | 16 +- .../types/FlowsVaultConnectioSetupToken.java | 14 +- .../FlowsVaultConnectioSetupTwilioApiKey.java | 16 +- .../FlowsVaultConnectioSetupWebhook.java | 14 +- .../types/FlowsVaultConnectionSummary.java | 32 +- .../auth0/client/mgmt/types/FormBlock.java | 8 +- .../client/mgmt/types/FormBlockDivider.java | 20 +- .../mgmt/types/FormBlockDividerConfig.java | 6 +- .../client/mgmt/types/FormBlockHtml.java | 20 +- .../mgmt/types/FormBlockHtmlConfig.java | 6 +- .../client/mgmt/types/FormBlockImage.java | 20 +- .../mgmt/types/FormBlockImageConfig.java | 20 +- .../FormBlockImageConfigPositionEnum.java | 6 +- .../mgmt/types/FormBlockJumpButton.java | 18 +- .../mgmt/types/FormBlockJumpButtonConfig.java | 18 +- .../types/FormBlockJumpButtonConfigStyle.java | 6 +- .../mgmt/types/FormBlockNextButton.java | 18 +- .../mgmt/types/FormBlockNextButtonConfig.java | 12 +- .../mgmt/types/FormBlockPreviousButton.java | 18 +- .../types/FormBlockPreviousButtonConfig.java | 12 +- .../mgmt/types/FormBlockResendButton.java | 18 +- .../types/FormBlockResendButtonConfig.java | 30 +- ...ckResendButtonConfigTextAlignmentEnum.java | 6 +- .../client/mgmt/types/FormBlockRichText.java | 20 +- .../mgmt/types/FormBlockRichTextConfig.java | 6 +- .../client/mgmt/types/FormComponent.java | 8 +- .../client/mgmt/types/FormEndingNode.java | 6 +- .../mgmt/types/FormEndingNodeAfterSubmit.java | 6 +- .../mgmt/types/FormEndingNodeRedirection.java | 16 +- .../auth0/client/mgmt/types/FormField.java | 8 +- .../client/mgmt/types/FormFieldBoolean.java | 34 +- .../mgmt/types/FormFieldBooleanConfig.java | 6 +- .../types/FormFieldBooleanConfigOptions.java | 6 +- .../client/mgmt/types/FormFieldCards.java | 36 +- .../mgmt/types/FormFieldCardsConfig.java | 6 +- .../types/FormFieldCardsConfigOption.java | 16 +- .../client/mgmt/types/FormFieldChoice.java | 36 +- .../mgmt/types/FormFieldChoiceConfig.java | 6 +- .../FormFieldChoiceConfigAllowOther.java | 6 +- .../types/FormFieldChoiceConfigOption.java | 14 +- .../client/mgmt/types/FormFieldCustom.java | 34 +- .../mgmt/types/FormFieldCustomConfig.java | 26 +- .../client/mgmt/types/FormFieldDate.java | 34 +- .../mgmt/types/FormFieldDateConfig.java | 6 +- .../types/FormFieldDateConfigFormatEnum.java | 6 +- .../client/mgmt/types/FormFieldDropdown.java | 36 +- .../mgmt/types/FormFieldDropdownConfig.java | 6 +- .../types/FormFieldDropdownConfigOption.java | 14 +- .../client/mgmt/types/FormFieldEmail.java | 36 +- .../mgmt/types/FormFieldEmailConfig.java | 6 +- .../client/mgmt/types/FormFieldFile.java | 36 +- .../mgmt/types/FormFieldFileConfig.java | 6 +- .../FormFieldFileConfigCategoryEnum.java | 6 +- .../types/FormFieldFileConfigStorage.java | 12 +- .../FormFieldFileConfigStorageTypeEnum.java | 6 +- .../client/mgmt/types/FormFieldLegal.java | 36 +- .../mgmt/types/FormFieldLegalConfig.java | 6 +- .../client/mgmt/types/FormFieldNumber.java | 36 +- .../mgmt/types/FormFieldNumberConfig.java | 6 +- .../client/mgmt/types/FormFieldPassword.java | 34 +- .../mgmt/types/FormFieldPasswordConfig.java | 6 +- .../FormFieldPasswordConfigHashEnum.java | 6 +- .../client/mgmt/types/FormFieldPayment.java | 34 +- .../mgmt/types/FormFieldPaymentConfig.java | 26 +- .../types/FormFieldPaymentConfigCharge.java | 8 +- .../FormFieldPaymentConfigChargeOneOff.java | 14 +- ...PaymentConfigChargeOneOffCurrencyEnum.java | 6 +- ...mFieldPaymentConfigChargeOneOffOneOff.java | 14 +- ...PaymentConfigChargeOneOffOneOffAmount.java | 8 +- ...mFieldPaymentConfigChargeSubscription.java | 18 +- .../FormFieldPaymentConfigCredentials.java | 14 +- ...FormFieldPaymentConfigFieldProperties.java | 6 +- .../types/FormFieldPaymentConfigFields.java | 6 +- .../client/mgmt/types/FormFieldSocial.java | 36 +- .../mgmt/types/FormFieldSocialConfig.java | 4 +- .../auth0/client/mgmt/types/FormFieldTel.java | 36 +- .../client/mgmt/types/FormFieldTelConfig.java | 6 +- .../mgmt/types/FormFieldTelConfigStrings.java | 6 +- .../client/mgmt/types/FormFieldText.java | 36 +- .../mgmt/types/FormFieldTextConfig.java | 6 +- .../auth0/client/mgmt/types/FormFieldUrl.java | 36 +- .../client/mgmt/types/FormFieldUrlConfig.java | 6 +- .../com/auth0/client/mgmt/types/FormFlow.java | 24 +- .../client/mgmt/types/FormFlowConfig.java | 16 +- .../client/mgmt/types/FormHiddenField.java | 16 +- .../client/mgmt/types/FormLanguages.java | 6 +- .../auth0/client/mgmt/types/FormMessages.java | 6 +- .../com/auth0/client/mgmt/types/FormNode.java | 8 +- .../mgmt/types/FormNodeCoordinates.java | 14 +- .../client/mgmt/types/FormNodePointer.java | 8 +- .../auth0/client/mgmt/types/FormRouter.java | 26 +- .../client/mgmt/types/FormRouterConfig.java | 6 +- .../client/mgmt/types/FormRouterRule.java | 20 +- .../client/mgmt/types/FormStartNode.java | 6 +- .../com/auth0/client/mgmt/types/FormStep.java | 26 +- .../client/mgmt/types/FormStepConfig.java | 6 +- .../auth0/client/mgmt/types/FormStyle.java | 6 +- .../auth0/client/mgmt/types/FormSummary.java | 26 +- .../auth0/client/mgmt/types/FormWidget.java | 8 +- .../FormWidgetAuth0VerifiableCredentials.java | 34 +- ...idgetAuth0VerifiableCredentialsConfig.java | 26 +- .../mgmt/types/FormWidgetGMapsAddress.java | 34 +- .../types/FormWidgetGMapsAddressConfig.java | 12 +- .../mgmt/types/FormWidgetRecaptcha.java | 34 +- .../mgmt/types/FormWidgetRecaptchaConfig.java | 14 +- .../FormsRequestParametersHydrateEnum.java | 6 +- .../GetActionExecutionResponseContent.java | 6 +- .../mgmt/types/GetActionResponseContent.java | 42 +- .../GetActionVersionResponseContent.java | 42 +- .../mgmt/types/GetAculResponseContent.java | 6 +- ...ttackProtectionCaptchaResponseContent.java | 6 +- ...etBotDetectionSettingsResponseContent.java | 26 +- ...etBrandingDefaultThemeResponseContent.java | 24 +- ...tBrandingPhoneProviderResponseContent.java | 40 +- .../types/GetBrandingResponseContent.java | 6 +- .../GetBrandingThemeResponseContent.java | 24 +- ...swordDetectionSettingsResponseContent.java | 6 +- .../GetBruteForceSettingsResponseContent.java | 6 +- ...BruteForceSettingsResponseContentMode.java | 6 +- ...rceSettingsResponseContentShieldsItem.java | 6 +- .../GetClientCredentialResponseContent.java | 6 +- .../types/GetClientRequestParameters.java | 6 +- .../mgmt/types/GetClientResponseContent.java | 6 +- ...nnectionEnabledClientsResponseContent.java | 6 +- .../GetConnectionProfileResponseContent.java | 6 +- ...nectionProfileTemplateResponseContent.java | 6 +- .../types/GetConnectionRequestParameters.java | 6 +- .../types/GetConnectionResponseContent.java | 6 +- .../types/GetCustomDomainResponseContent.java | 48 +- .../GetCustomSigningKeysResponseContent.java | 6 +- .../types/GetDailyStatsRequestParameters.java | 6 +- ...isioningDefaultMappingResponseContent.java | 6 +- ...tDirectoryProvisioningResponseContent.java | 40 +- .../GetEmailProviderResponseContent.java | 6 +- .../GetEmailTemplateResponseContent.java | 6 +- .../GetEncryptionKeyResponseContent.java | 26 +- ...tStreamDeliveryHistoryResponseContent.java | 28 +- .../types/GetEventStreamResponseContent.java | 8 +- .../GetFlowExecutionResponseContent.java | 36 +- .../mgmt/types/GetFlowRequestParameters.java | 6 +- .../GetFlowRequestParametersHydrateEnum.java | 6 +- .../mgmt/types/GetFlowResponseContent.java | 26 +- ...etFlowsVaultConnectionResponseContent.java | 36 +- .../mgmt/types/GetFormRequestParameters.java | 6 +- .../mgmt/types/GetFormResponseContent.java | 54 +- .../GetGuardianEnrollmentResponseContent.java | 36 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...actorPhoneMessageTypesResponseContent.java | 6 +- ...anFactorPhoneTemplatesResponseContent.java | 14 +- ...dianFactorSmsTemplatesResponseContent.java | 14 +- ...ianFactorsProviderApnsResponseContent.java | 6 +- ...anFactorsProviderPhoneResponseContent.java | 6 +- ...orsProviderPhoneTwilioResponseContent.java | 6 +- ...oviderPushNotificationResponseContent.java | 6 +- ...dianFactorsProviderSmsResponseContent.java | 6 +- ...ctorsProviderSmsTwilioResponseContent.java | 6 +- ...dianFactorsProviderSnsResponseContent.java | 6 +- .../mgmt/types/GetHookRequestParameters.java | 6 +- .../mgmt/types/GetHookResponseContent.java | 6 +- .../types/GetJobErrorResponseContent.java | 6 +- .../GetJobGenericErrorResponseContent.java | 28 +- .../mgmt/types/GetJobImportUserError.java | 6 +- .../mgmt/types/GetJobResponseContent.java | 44 +- .../mgmt/types/GetLogResponseContent.java | 6 +- .../types/GetLogStreamResponseContent.java | 8 +- .../types/GetNetworkAclsResponseContent.java | 6 +- .../GetOrganizationByNameResponseContent.java | 6 +- ...OrganizationConnectionResponseContent.java | 6 +- ...nDiscoveryDomainByNameResponseContent.java | 304 + ...izationDiscoveryDomainResponseContent.java | 81 +- ...OrganizationInvitationResponseContent.java | 6 +- .../types/GetOrganizationResponseContent.java | 6 +- .../GetPhoneTemplateResponseContent.java | 30 +- .../types/GetRefreshTokenResponseContent.java | 63 +- .../GetResourceServerRequestParameters.java | 6 +- .../GetResourceServerResponseContent.java | 6 +- ...mentsSettingsNewDeviceResponseContent.java | 12 +- ...iskAssessmentsSettingsResponseContent.java | 12 +- .../mgmt/types/GetRoleResponseContent.java | 6 +- .../mgmt/types/GetRuleRequestParameters.java | 6 +- .../mgmt/types/GetRuleResponseContent.java | 6 +- ...gurationDefaultMappingResponseContent.java | 6 +- .../GetScimConfigurationResponseContent.java | 6 +- .../GetSelfServiceProfileResponseContent.java | 6 +- .../mgmt/types/GetSessionResponseContent.java | 6 +- .../types/GetSettingsResponseContent.java | 6 +- .../types/GetSigningKeysResponseContent.java | 50 +- ...GetSupplementalSignalsResponseContent.java | 6 +- ...usIpThrottlingSettingsResponseContent.java | 6 +- .../GetTenantSettingsResponseContent.java | 42 +- ...etTokenExchangeProfileResponseContent.java | 6 +- .../mgmt/types/GetUniversalLoginTemplate.java | 6 +- ...UniversalLoginTemplateResponseContent.java | 8 +- ...etUserAttributeProfileResponseContent.java | 6 +- ...tributeProfileTemplateResponseContent.java | 6 +- ...erAuthenticationMethodResponseContent.java | 84 +- .../mgmt/types/GetUserRequestParameters.java | 6 +- .../mgmt/types/GetUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- .../com/auth0/client/mgmt/types/Group.java | 24 +- .../types/GuardianEnrollmentFactorEnum.java | 6 +- .../mgmt/types/GuardianEnrollmentStatus.java | 6 +- .../client/mgmt/types/GuardianFactor.java | 20 +- .../mgmt/types/GuardianFactorNameEnum.java | 6 +- ...rdianFactorPhoneFactorMessageTypeEnum.java | 6 +- ...viderPushNotificationProviderDataEnum.java | 6 +- ...uardianFactorsProviderSmsProviderEnum.java | 6 +- .../com/auth0/client/mgmt/types/Hook.java | 6 +- .../client/mgmt/types/HookTriggerIdEnum.java | 6 +- .../client/mgmt/types/HttpCustomHeader.java | 6 +- .../types/IConnectionOptionsCommonOidc.java | 2 +- .../com/auth0/client/mgmt/types/Identity.java | 18 +- .../mgmt/types/IdentityProviderEnum.java | 6 +- .../ImportEncryptionKeyResponseContent.java | 26 +- .../auth0/client/mgmt/types/Integration.java | 6 +- .../types/IntegrationFeatureTypeEnum.java | 6 +- .../client/mgmt/types/IntegrationRelease.java | 6 +- .../mgmt/types/IntegrationRequiredParam.java | 6 +- .../types/IntegrationRequiredParamOption.java | 6 +- .../IntegrationRequiredParamTypeEnum.java | 6 +- .../client/mgmt/types/IntegrationSemVer.java | 6 +- .../client/mgmt/types/JobFileFormatEnum.java | 6 +- .../mgmt/types/LinkedClientConfiguration.java | 12 +- ...ctionBindingsPaginatedResponseContent.java | 6 +- .../ListActionTriggersResponseContent.java | 6 +- ...ctionVersionsPaginatedResponseContent.java | 6 +- .../ListActionsPaginatedResponseContent.java | 6 +- .../types/ListActionsRequestParameters.java | 6 +- ...stAculsOffsetPaginatedResponseContent.java | 6 +- ...BrandingPhoneProvidersResponseContent.java | 6 +- .../ListClientConnectionsResponseContent.java | 6 +- ...OrganizationsPaginatedResponseContent.java | 6 +- ...stClientGrantPaginatedResponseContent.java | 6 +- .../ListClientGrantsRequestParameters.java | 6 +- ...ClientsOffsetPaginatedResponseContent.java | 6 +- .../types/ListClientsRequestParameters.java | 6 +- ...istConnectionProfileRequestParameters.java | 6 +- ...nectionProfileTemplateResponseContent.java | 6 +- ...ctionProfilesPaginatedResponseContent.java | 6 +- ...onsCheckpointPaginatedResponseContent.java | 6 +- .../types/ListConnectionsQueryParameters.java | 6 +- .../ListCustomDomainsRequestParameters.java | 142 +- ...entialsOffsetPaginatedResponseContent.java | 6 +- ...istDeviceCredentialsRequestParameters.java | 6 +- ...tionKeyOffsetPaginatedResponseContent.java | 6 +- .../ListEventStreamsRequestParameters.java | 6 +- .../ListEventStreamsResponseContent.java | 97 + ...lowExecutionsPaginatedResponseContent.java | 6 +- ...stFlowsOffsetPaginatedResponseContent.java | 6 +- ...ectionsOffsetPaginatedResponseContent.java | 6 +- ...stFormsOffsetPaginatedResponseContent.java | 6 +- .../types/ListFormsRequestParameters.java | 6 +- ...stHooksOffsetPaginatedResponseContent.java | 6 +- .../types/ListHooksRequestParameters.java | 6 +- ...ListLogOffsetPaginatedResponseContent.java | 6 +- .../mgmt/types/ListLogsRequestParameters.java | 6 +- ...orkAclsOffsetPaginatedResponseContent.java | 6 +- .../ListNetworkAclsRequestParameters.java | 6 +- ...tGrantsOffsetPaginatedResponseContent.java | 6 +- ...ectionsOffsetPaginatedResponseContent.java | 6 +- ...zationDiscoveryDomainsResponseContent.java | 6 +- ...tationsOffsetPaginatedResponseContent.java | 6 +- ...erRolesOffsetPaginatedResponseContent.java | 6 +- ...zationMembersPaginatedResponseContent.java | 6 +- ...OrganizationsPaginatedResponseContent.java | 6 +- .../ListOrganizationsRequestParameters.java | 6 +- .../ListPhoneTemplatesResponseContent.java | 6 +- ...RefreshTokensPaginatedResponseContent.java | 6 +- ...eServerOffsetPaginatedResponseContent.java | 6 +- .../ListResourceServerRequestParameters.java | 6 +- ...issionsOffsetPaginatedResponseContent.java | 6 +- ...ListRoleUsersPaginatedResponseContent.java | 6 +- ...stRolesOffsetPaginatedResponseContent.java | 6 +- .../types/ListRolesRequestParameters.java | 6 +- ...stRulesOffsetPaginatedResponseContent.java | 6 +- .../types/ListRulesRequestParameters.java | 6 +- ...rviceProfilesPaginatedResponseContent.java | 6 +- ...tSelfServiceProfilesRequestParameters.java | 6 +- ...stTokenExchangeProfileResponseContent.java | 6 +- ...UserAttributeProfileRequestParameters.java | 6 +- ...tributeProfileTemplateResponseContent.java | 6 +- ...ibuteProfilesPaginatedResponseContent.java | 6 +- ...MethodsOffsetPaginatedResponseContent.java | 6 +- ...erBlocksByIdentifierRequestParameters.java | 20 +- ...UserBlocksByIdentifierResponseContent.java | 6 +- .../ListUserBlocksRequestParameters.java | 6 +- .../types/ListUserBlocksResponseContent.java | 6 +- ...tUserConnectedAccountsResponseContent.java | 6 +- ...rGrantsOffsetPaginatedResponseContent.java | 6 +- .../ListUserGrantsRequestParameters.java | 6 +- ...zationsOffsetPaginatedResponseContent.java | 6 +- ...issionsOffsetPaginatedResponseContent.java | 6 +- ...erRolesOffsetPaginatedResponseContent.java | 6 +- ...tUserSessionsPaginatedResponseContent.java | 6 +- .../ListUsersByEmailRequestParameters.java | 28 +- ...stUsersOffsetPaginatedResponseContent.java | 6 +- .../types/ListUsersRequestParameters.java | 6 +- ...tialTemplatesPaginatedResponseContent.java | 6 +- .../java/com/auth0/client/mgmt/types/Log.java | 6 +- .../com/auth0/client/mgmt/types/LogDate.java | 8 +- .../client/mgmt/types/LogLocationInfo.java | 6 +- .../client/mgmt/types/LogSecurityContext.java | 6 +- .../types/LogStreamDatadogRegionEnum.java | 6 +- .../types/LogStreamDatadogResponseSchema.java | 6 +- .../mgmt/types/LogStreamDatadogSink.java | 14 +- .../LogStreamEventBridgeResponseSchema.java | 6 +- .../mgmt/types/LogStreamEventBridgeSink.java | 18 +- .../LogStreamEventBridgeSinkRegionEnum.java | 6 +- .../types/LogStreamEventGridRegionEnum.java | 6 +- .../LogStreamEventGridResponseSchema.java | 6 +- .../mgmt/types/LogStreamEventGridSink.java | 20 +- .../client/mgmt/types/LogStreamFilter.java | 6 +- .../types/LogStreamFilterGroupNameEnum.java | 6 +- .../types/LogStreamHttpContentFormatEnum.java | 6 +- .../types/LogStreamHttpResponseSchema.java | 6 +- .../client/mgmt/types/LogStreamHttpSink.java | 28 +- .../types/LogStreamMixpanelRegionEnum.java | 6 +- .../LogStreamMixpanelResponseSchema.java | 6 +- .../mgmt/types/LogStreamMixpanelSink.java | 18 +- .../types/LogStreamMixpanelSinkPatch.java | 20 +- .../client/mgmt/types/LogStreamPiiConfig.java | 6 +- .../mgmt/types/LogStreamPiiLogFieldsEnum.java | 6 +- .../mgmt/types/LogStreamPiiMethodEnum.java | 6 +- .../mgmt/types/LogStreamResponseSchema.java | 8 +- .../types/LogStreamSegmentResponseSchema.java | 6 +- .../mgmt/types/LogStreamSegmentSink.java | 6 +- .../types/LogStreamSegmentSinkWriteKey.java | 12 +- .../client/mgmt/types/LogStreamSinkPatch.java | 8 +- .../types/LogStreamSplunkResponseSchema.java | 6 +- .../mgmt/types/LogStreamSplunkSink.java | 18 +- .../mgmt/types/LogStreamStatusEnum.java | 6 +- .../types/LogStreamSumoResponseSchema.java | 6 +- .../client/mgmt/types/LogStreamSumoSink.java | 12 +- .../mgmt/types/MdlPresentationProperties.java | 6 +- .../mgmt/types/MdlPresentationRequest.java | 12 +- .../MdlPresentationRequestProperties.java | 12 +- .../client/mgmt/types/MfaPolicyEnum.java | 6 +- .../client/mgmt/types/NativeSocialLogin.java | 6 +- .../mgmt/types/NativeSocialLoginApple.java | 6 +- .../mgmt/types/NativeSocialLoginFacebook.java | 6 +- .../mgmt/types/NativeSocialLoginGoogle.java | 6 +- .../client/mgmt/types/NetworkAclAction.java | 6 +- .../client/mgmt/types/NetworkAclMatch.java | 6 +- .../client/mgmt/types/NetworkAclRule.java | 22 +- .../mgmt/types/NetworkAclRuleScopeEnum.java | 6 +- .../types/NetworkAclsResponseContent.java | 6 +- .../auth0/client/mgmt/types/OauthScope.java | 17 +- .../auth0/client/mgmt/types/Organization.java | 6 +- .../mgmt/types/OrganizationBranding.java | 6 +- .../types/OrganizationBrandingColors.java | 14 +- .../mgmt/types/OrganizationClientGrant.java | 6 +- .../mgmt/types/OrganizationConnection.java | 6 +- .../OrganizationConnectionInformation.java | 6 +- .../types/OrganizationDiscoveryDomain.java | 81 +- .../OrganizationDiscoveryDomainStatus.java | 6 +- .../types/OrganizationEnabledConnection.java | 6 +- .../mgmt/types/OrganizationInvitation.java | 6 +- .../types/OrganizationInvitationInvitee.java | 12 +- .../types/OrganizationInvitationInviter.java | 12 +- .../client/mgmt/types/OrganizationMember.java | 6 +- .../mgmt/types/OrganizationMemberRole.java | 6 +- .../mgmt/types/OrganizationUsageEnum.java | 6 +- .../client/mgmt/types/PartialGroupsEnum.java | 6 +- .../types/PartialPhoneTemplateContent.java | 6 +- .../PatchClientCredentialResponseContent.java | 6 +- ...tchSupplementalSignalsResponseContent.java | 6 +- .../mgmt/types/PermissionRequestPayload.java | 14 +- .../types/PermissionsResponsePayload.java | 6 +- .../client/mgmt/types/PhoneAttribute.java | 6 +- .../types/PhoneProviderConfiguration.java | 8 +- .../mgmt/types/PhoneProviderCredentials.java | 8 +- .../PhoneProviderDeliveryMethodEnum.java | 6 +- .../mgmt/types/PhoneProviderNameEnum.java | 6 +- .../mgmt/types/PhoneProviderSchemaMasked.java | 40 +- .../client/mgmt/types/PhoneTemplate.java | 30 +- .../client/mgmt/types/PhoneTemplateBody.java | 6 +- .../mgmt/types/PhoneTemplateContent.java | 6 +- .../PhoneTemplateNotificationTypeEnum.java | 6 +- .../PostClientCredentialResponseContent.java | 6 +- .../PreferredAuthenticationMethodEnum.java | 6 +- .../client/mgmt/types/PrivateKeyJwt.java | 6 +- .../mgmt/types/PromptGroupNameEnum.java | 6 +- .../client/mgmt/types/PromptLanguageEnum.java | 6 +- .../mgmt/types/PublicKeyCredential.java | 30 +- .../PublicKeyCredentialAlgorithmEnum.java | 6 +- .../client/mgmt/types/RefreshTokenDate.java | 8 +- .../client/mgmt/types/RefreshTokenDevice.java | 6 +- .../types/RefreshTokenExpirationTypeEnum.java | 6 +- .../types/RefreshTokenResourceServer.java | 6 +- .../types/RefreshTokenResponseContent.java | 63 +- .../types/RefreshTokenRotationTypeEnum.java | 6 +- ...erateUsersRecoveryCodeResponseContent.java | 6 +- .../ResetPhoneTemplateResponseContent.java | 30 +- .../client/mgmt/types/ResourceServer.java | 6 +- .../ResourceServerProofOfPossession.java | 14 +- ...eServerProofOfPossessionMechanismEnum.java | 6 +- .../mgmt/types/ResourceServerScope.java | 16 +- ...esourceServerSubjectTypeAuthorization.java | 6 +- ...eServerSubjectTypeAuthorizationClient.java | 6 +- ...jectTypeAuthorizationClientPolicyEnum.java | 6 +- ...rceServerSubjectTypeAuthorizationUser.java | 6 +- ...ubjectTypeAuthorizationUserPolicyEnum.java | 6 +- ...esourceServerTokenDialectResponseEnum.java | 6 +- .../ResourceServerTokenDialectSchemaEnum.java | 6 +- .../types/ResourceServerTokenEncryption.java | 14 +- ...rceServerTokenEncryptionAlgorithmEnum.java | 6 +- .../ResourceServerTokenEncryptionKey.java | 22 +- .../types/RevokeUserAccessRequestContent.java | 6 +- .../RevokedSigningKeysResponseContent.java | 14 +- .../com/auth0/client/mgmt/types/Role.java | 6 +- .../com/auth0/client/mgmt/types/RoleUser.java | 6 +- .../RotateClientSecretResponseContent.java | 6 +- .../RotateConnectionKeysRequestContent.java | 6 +- .../RotateConnectionKeysSigningAlgEnum.java | 6 +- .../RotateConnectionsKeysResponseContent.java | 38 +- .../RotateSigningKeysResponseContent.java | 14 +- .../com/auth0/client/mgmt/types/Rule.java | 6 +- .../auth0/client/mgmt/types/RulesConfig.java | 6 +- .../client/mgmt/types/ScimMappingItem.java | 6 +- .../client/mgmt/types/ScimTokenItem.java | 6 +- .../mgmt/types/ScreenGroupNameEnum.java | 6 +- .../mgmt/types/SearchEngineVersionsEnum.java | 6 +- .../client/mgmt/types/SelfServiceProfile.java | 6 +- ...SelfServiceProfileAllowedStrategyEnum.java | 6 +- .../SelfServiceProfileBrandingColors.java | 12 +- .../SelfServiceProfileBrandingProperties.java | 6 +- ...rviceProfileSsoTicketConnectionConfig.java | 36 +- ...viceProfileSsoTicketConnectionOptions.java | 6 +- ...ceProfileSsoTicketDomainAliasesConfig.java | 12 +- ...rofileSsoTicketDomainVerificationEnum.java | 6 +- ...ceProfileSsoTicketEnabledOrganization.java | 20 +- ...ProfileSsoTicketGoogleWorkspaceConfig.java | 12 +- ...oTicketIdpInitiatedClientProtocolEnum.java | 6 +- ...ceProfileSsoTicketIdpInitiatedOptions.java | 6 +- ...iceProfileSsoTicketProvisioningConfig.java | 6 +- ...ProfileSsoTicketProvisioningScopeEnum.java | 6 +- .../SelfServiceProfileUserAttribute.java | 16 +- .../types/SessionAuthenticationSignal.java | 6 +- .../types/SessionAuthenticationSignals.java | 6 +- .../mgmt/types/SessionClientMetadata.java | 6 +- .../mgmt/types/SessionCookieMetadata.java | 6 +- .../types/SessionCookieMetadataModeEnum.java | 6 +- .../mgmt/types/SessionCookieModeEnum.java | 6 +- .../mgmt/types/SessionCookieSchema.java | 12 +- .../auth0/client/mgmt/types/SessionDate.java | 8 +- .../mgmt/types/SessionDeviceMetadata.java | 6 +- .../mgmt/types/SessionResponseContent.java | 6 +- .../SetCustomSigningKeysResponseContent.java | 6 +- .../types/SetEmailTemplateRequestContent.java | 72 +- .../SetEmailTemplateResponseContent.java | 72 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...actorPhoneMessageTypesResponseContent.java | 6 +- ...anFactorPhoneTemplatesResponseContent.java | 14 +- .../SetGuardianFactorResponseContent.java | 12 +- ...dianFactorSmsTemplatesResponseContent.java | 14 +- ...anFactorsProviderPhoneResponseContent.java | 6 +- ...orsProviderPhoneTwilioResponseContent.java | 6 +- ...erPushNotificationApnsResponseContent.java | 6 +- ...oviderPushNotificationResponseContent.java | 6 +- ...derPushNotificationSnsResponseContent.java | 6 +- ...dianFactorsProviderSmsResponseContent.java | 6 +- ...ctorsProviderSmsTwilioResponseContent.java | 6 +- .../types/SetNetworkAclRequestContent.java | 18 +- .../types/SetNetworkAclsResponseContent.java | 6 +- .../types/SetRulesConfigRequestContent.java | 12 +- .../types/SetRulesConfigResponseContent.java | 14 +- ...erAuthenticationMethodResponseContent.java | 60 +- .../types/SetUserAuthenticationMethods.java | 32 +- .../mgmt/types/SigningAlgorithmEnum.java | 6 +- .../auth0/client/mgmt/types/SigningKeys.java | 50 +- .../client/mgmt/types/SigningKeysDate.java | 8 +- .../auth0/client/mgmt/types/SignupSchema.java | 6 +- .../client/mgmt/types/SignupStatusEnum.java | 6 +- .../client/mgmt/types/SignupVerification.java | 6 +- .../client/mgmt/types/SignupVerified.java | 6 +- .../client/mgmt/types/SupportedLocales.java | 6 +- .../SuspiciousIpThrottlingPreLoginStage.java | 6 +- ...sIpThrottlingPreUserRegistrationStage.java | 6 +- .../SuspiciousIpThrottlingShieldsEnum.java | 6 +- .../types/SuspiciousIpThrottlingStage.java | 6 +- .../mgmt/types/TenantOidcLogoutSettings.java | 6 +- .../mgmt/types/TenantSettingsDeviceFlow.java | 6 +- .../TenantSettingsDeviceFlowCharset.java | 6 +- .../mgmt/types/TenantSettingsErrorPage.java | 6 +- .../mgmt/types/TenantSettingsFlags.java | 6 +- .../types/TenantSettingsGuardianPage.java | 6 +- .../client/mgmt/types/TenantSettingsMtls.java | 6 +- .../types/TenantSettingsPasswordPage.java | 6 +- ...enantSettingsResourceParameterProfile.java | 6 +- .../mgmt/types/TenantSettingsSessions.java | 6 +- .../mgmt/types/TestActionRequestContent.java | 6 +- .../mgmt/types/TestActionResponseContent.java | 6 +- .../TestCustomDomainResponseContent.java | 16 +- .../TokenExchangeProfileResponseContent.java | 6 +- .../TokenExchangeProfilesListRequest.java | 6 +- .../auth0/client/mgmt/types/TokenQuota.java | 12 +- .../types/TokenQuotaClientCredentials.java | 6 +- .../mgmt/types/TokenQuotaConfiguration.java | 12 +- .../types/TwilioProviderConfiguration.java | 26 +- .../mgmt/types/TwilioProviderCredentials.java | 12 +- .../TwilioProviderDeliveryMethodEnum.java | 6 +- .../types/UniversalLoginExperienceEnum.java | 6 +- .../UpdateActionBindingsResponseContent.java | 6 +- .../types/UpdateActionRequestContent.java | 48 +- .../types/UpdateActionResponseContent.java | 42 +- .../mgmt/types/UpdateAculResponseContent.java | 6 +- ...ttackProtectionCaptchaResponseContent.java | 6 +- ...teBotDetectionSettingsResponseContent.java | 6 +- .../mgmt/types/UpdateBrandingColors.java | 6 +- .../client/mgmt/types/UpdateBrandingFont.java | 6 +- .../types/UpdateBrandingPageBackground.java | 8 +- ...eBrandingPhoneProviderResponseContent.java | 40 +- .../types/UpdateBrandingRequestContent.java | 6 +- .../types/UpdateBrandingResponseContent.java | 6 +- .../UpdateBrandingThemeResponseContent.java | 24 +- ...swordDetectionSettingsResponseContent.java | 6 +- ...dateBruteForceSettingsResponseContent.java | 6 +- ...BruteForceSettingsResponseContentMode.java | 6 +- ...rceSettingsResponseContentShieldsItem.java | 6 +- .../UpdateClientGrantRequestContent.java | 6 +- .../UpdateClientGrantResponseContent.java | 6 +- .../types/UpdateClientRequestContent.java | 6 +- .../types/UpdateClientResponseContent.java | 6 +- .../mgmt/types/UpdateConnectionOptions.java | 6 +- ...UpdateConnectionProfileRequestContent.java | 6 +- ...pdateConnectionProfileResponseContent.java | 6 +- .../types/UpdateConnectionRequestContent.java | 6 +- .../UpdateConnectionResponseContent.java | 6 +- .../UpdateCustomDomainRequestContent.java | 6 +- .../UpdateCustomDomainResponseContent.java | 42 +- ...teDirectoryProvisioningRequestContent.java | 6 +- ...eDirectoryProvisioningResponseContent.java | 40 +- .../UpdateEmailProviderResponseContent.java | 6 +- .../UpdateEmailTemplateRequestContent.java | 6 +- .../UpdateEmailTemplateResponseContent.java | 6 +- ...edClientConnectionsRequestContentItem.java | 14 +- .../UpdateEventStreamRequestContent.java | 6 +- .../UpdateEventStreamResponseContent.java | 8 +- .../mgmt/types/UpdateFlowRequestContent.java | 6 +- .../mgmt/types/UpdateFlowResponseContent.java | 26 +- ...teFlowsVaultConnectionResponseContent.java | 36 +- .../UpdateFlowsVaultConnectionSetup.java | 8 +- .../mgmt/types/UpdateFormRequestContent.java | 6 +- .../mgmt/types/UpdateFormResponseContent.java | 54 +- ...rdianFactorDuoSettingsResponseContent.java | 6 +- ...erPushNotificationApnsResponseContent.java | 153 + ...derPushNotificationSnsResponseContent.java | 6 +- .../mgmt/types/UpdateHookRequestContent.java | 6 +- .../mgmt/types/UpdateHookResponseContent.java | 6 +- .../types/UpdateLogStreamRequestContent.java | 6 +- .../types/UpdateLogStreamResponseContent.java | 8 +- .../types/UpdateNetworkAclRequestContent.java | 6 +- .../UpdateNetworkAclResponseContent.java | 6 +- ...OrganizationConnectionResponseContent.java | 6 +- ...izationDiscoveryDomainResponseContent.java | 81 +- .../UpdateOrganizationRequestContent.java | 6 +- .../UpdateOrganizationResponseContent.java | 6 +- .../UpdatePhoneTemplateResponseContent.java | 30 +- .../UpdateRefreshTokenRequestContent.java | 130 + .../UpdateRefreshTokenResponseContent.java | 481 + .../UpdateResourceServerRequestContent.java | 6 +- .../UpdateResourceServerResponseContent.java | 6 +- ...mentsSettingsNewDeviceResponseContent.java | 12 +- ...iskAssessmentsSettingsResponseContent.java | 12 +- .../mgmt/types/UpdateRoleRequestContent.java | 6 +- .../mgmt/types/UpdateRoleResponseContent.java | 6 +- .../mgmt/types/UpdateRuleRequestContent.java | 6 +- .../mgmt/types/UpdateRuleResponseContent.java | 6 +- ...pdateScimConfigurationResponseContent.java | 6 +- ...pdateSelfServiceProfileRequestContent.java | 6 +- ...dateSelfServiceProfileResponseContent.java | 6 +- .../types/UpdateSessionRequestContent.java | 6 +- .../types/UpdateSessionResponseContent.java | 6 +- .../types/UpdateSettingsRequestContent.java | 6 +- .../types/UpdateSettingsResponseContent.java | 6 +- ...dateSupplementalSignalsRequestContent.java | 12 +- ...usIpThrottlingSettingsResponseContent.java | 6 +- .../UpdateTenantSettingsResponseContent.java | 42 +- ...ateTokenExchangeProfileRequestContent.java | 6 +- .../client/mgmt/types/UpdateTokenQuota.java | 12 +- ...eUniversalLoginTemplateRequestContent.java | 8 +- ...alLoginTemplateRequestContentTemplate.java | 12 +- ...ateUserAttributeProfileRequestContent.java | 6 +- ...teUserAttributeProfileResponseContent.java | 6 +- ...erAuthenticationMethodResponseContent.java | 60 +- .../mgmt/types/UpdateUserRequestContent.java | 6 +- .../mgmt/types/UpdateUserResponseContent.java | 6 +- ...ableCredentialTemplateResponseContent.java | 6 +- .../mgmt/types/UserAttributeProfile.java | 6 +- .../UserAttributeProfileOidcMapping.java | 16 +- ...UserAttributeProfileStrategyOverrides.java | 6 +- ...ributeProfileStrategyOverridesMapping.java | 6 +- ...tributeProfileStrategyOverridesUserId.java | 6 +- ...ProfileStrategyOverridesUserIdMapping.java | 6 +- .../types/UserAttributeProfileTemplate.java | 6 +- .../UserAttributeProfileTemplateItem.java | 6 +- ...fileUserAttributeAdditionalProperties.java | 34 +- .../types/UserAttributeProfileUserId.java | 6 +- ...fileUserIdOidcStrategyOverrideMapping.java | 6 +- .../mgmt/types/UserAuthenticationMethod.java | 84 +- .../UserAuthenticationMethodProperties.java | 6 +- ...serAuthenticationMethodPropertiesEnum.java | 6 +- .../mgmt/types/UserBlockIdentifier.java | 6 +- .../client/mgmt/types/UserDateSchema.java | 8 +- .../types/UserEnrollmentAuthMethodEnum.java | 6 +- .../mgmt/types/UserEnrollmentStatusEnum.java | 6 +- .../auth0/client/mgmt/types/UserGrant.java | 6 +- .../mgmt/types/UserGroupsResponseSchema.java | 24 +- .../com/auth0/client/mgmt/types/UserId.java | 8 +- .../auth0/client/mgmt/types/UserIdentity.java | 36 +- .../mgmt/types/UserIdentityProviderEnum.java | 6 +- .../client/mgmt/types/UserIdentitySchema.java | 6 +- ...ListLogOffsetPaginatedResponseContent.java | 6 +- .../types/UserMultifactorProviderEnum.java | 6 +- .../mgmt/types/UserPermissionSchema.java | 6 +- .../client/mgmt/types/UserProfileData.java | 6 +- .../client/mgmt/types/UserResponseSchema.java | 6 +- .../mgmt/types/UsernameAllowedTypes.java | 6 +- .../client/mgmt/types/UsernameAttribute.java | 6 +- .../client/mgmt/types/UsernameValidation.java | 6 +- .../client/mgmt/types/UsersEnrollment.java | 6 +- .../VerifiableCredentialTemplateResponse.java | 6 +- .../mgmt/types/VerificationMethodEnum.java | 6 +- .../VerifyCustomDomainResponseContent.java | 52 +- .../VerifyEmailTicketRequestContent.java | 36 +- .../VerifyEmailTicketResponseContent.java | 12 +- .../types/AssignUserRolesRequestContent.java | 6 +- .../types/ClearAssessorsRequestContent.java | 18 +- ...serAuthenticationMethodRequestContent.java | 44 +- .../CreateUserPermissionsRequestContent.java | 6 +- .../DeleteUserPermissionsRequestContent.java | 6 +- .../types/DeleteUserRolesRequestContent.java | 6 +- ...serConnectedAccountsRequestParameters.java | 6 +- .../types/LinkUserIdentityRequestContent.java | 6 +- .../ListRefreshTokensRequestParameters.java | 6 +- ...uthenticationMethodsRequestParameters.java | 6 +- .../types/ListUserLogsRequestParameters.java | 6 +- ...istUserOrganizationsRequestParameters.java | 6 +- .../ListUserPermissionsRequestParameters.java | 6 +- .../types/ListUserRolesRequestParameters.java | 6 +- .../ListUserSessionsRequestParameters.java | 6 +- ...serAuthenticationMethodRequestContent.java | 6 +- ...iableCredentialTemplateRequestContent.java | 24 +- ...eCredentialTemplatesRequestParameters.java | 6 +- ...iableCredentialTemplateRequestContent.java | 6 +- .../client/mgmt/ActionsVersionsWireTest.java | 22 +- .../auth0/client/mgmt/ActionsWireTest.java | 57 +- .../auth0/client/mgmt/ClientsWireTest.java | 48 +- .../client/mgmt/CustomDomainsWireTest.java | 2 - .../client/mgmt/EventStreamsWireTest.java | 51 +- ...ardianFactorsPushNotificationWireTest.java | 243 +- .../client/mgmt/HooksSecretsWireTest.java | 4 +- ...OrganizationsDiscoveryDomainsWireTest.java | 68 +- .../mgmt/PromptsCustomTextWireTest.java | 4 +- .../client/mgmt/PromptsPartialsWireTest.java | 4 +- .../client/mgmt/RefreshTokensWireTest.java | 112 +- ...SelfServiceProfilesCustomTextWireTest.java | 4 +- .../mgmt/SelfServiceProfilesEntityTest.java | 1 - .../client/mgmt/TenantsSettingsWireTest.java | 10 +- .../mgmt/UsersRefreshTokenWireTest.java | 2 +- 1580 files changed, 26919 insertions(+), 17296 deletions(-) delete mode 100644 .DS_Store create mode 100644 .fern/metadata.json delete mode 100644 CHANGELOG.md delete mode 100644 LICENSE delete mode 100644 MIGRATION_GUIDE.md rename src/main/java/com/auth0/client/mgmt/{ => guardian/factors}/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java (98%) rename src/main/java/com/auth0/client/mgmt/{ => guardian/factors}/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java (97%) rename src/main/java/com/auth0/client/mgmt/{ => guardian/factors}/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java (97%) create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ActionModuleReference.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenPolicy.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionDigestAlgorithmEnumSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionFieldsMapSamlValue.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleApps.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpInitiatedClientProtocolEnumSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpinitiatedSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionProtocolBindingEnumSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionSignatureAlgorithmEnumSaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ConnectionSigningKeySaml.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainByNameResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/ListEventStreamsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenRequestContent.java create mode 100644 src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenResponseContent.java delete mode 100644 src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 636b9669d2f733b03ff65e104e2d901bfd45b22b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM%We}f6g^HWT1dr9Aa#Q@KR^oN2SPg|h*a8&0AdH3BxMnc!fCaz6 zzaa53tl(VR4W1-L>IPA9E!oH8+;i`pV<)a%0A_d6dkky?*kl#FU1zhR$mdd*O3jbl zBO3C79vV2t7#;Ssr~;~hDxeCe0;<5jr~vnDDVrDU`|eY1RRLAtzf?eeA0k%4rpK8> z`_sY39s!8!9JYmho&zi=^4Rn^b7-mb=}r&EQ;k1j7)R&lk(d*k9%l|69mdgNd}QNK zD8@!7FS6z^O^4d50;<5W0&;fWLW&7KAgi3;GxS?o-c7SSrHy>8zOpuc+QOdj_V64} zae!w?u#ZDx0|WG`Jo8|ISEuz`@?PMGtOV_qtWOK9YxA3hrOeEaKiT$*ZkFbGMjPA- zoiOZ(mlZkNKCz?(eH7K?YsU+&H!2=JR;~F`z?VRxdexc{Q(lgg3oH>fWNlEE7R5~{ zZ5v6|+R7PP-=&Z(O8=74U$J*c);m7GW&5ejbUdhjNz@$7mI8&erQyt`;(#^b0p?;oY7s$bOzYL8_JgPyEEW( z!RJ^emvx8YOUh$ADkDSkI!wE;uW({*VzRrQJtR*&9N7hVN^aMWbZAlH1dk}zDS1=N z4YND&+4+2bXFhF@hgm+9B`oiApWG*08kb%!wQpp9o=Zw!;!Ya73lnw!7eTbB0#`_Z zHJ9tQod1)H@BgpR8)>SlfGTiV1Y?D7%odsZo8H*;tyY$|^U@Ol0Z bL-r$@3a9CD=8z*SdJ$k{&_)&bs|x%Am*yA8 diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 000000000..85128beb7 --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,16 @@ +{ + "cliVersion": "3.24.3", + "generatorName": "fernapi/fern-java-sdk", + "generatorVersion": "3.27.0", + "generatorConfig": { + "client-class-name": "ManagementApi", + "base-api-exception-class-name": "ManagementApiException", + "base-exception-class-name": "ManagementException", + "package-prefix": "com.auth0.client.mgmt", + "package-layout": "flat", + "use-default-request-parameter-values": true, + "enable-wire-tests": true, + "collapse-optional-nullable": true, + "use-nullable-annotation": true + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0d7e64f77..d4199abc2 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ generated_testSrc/ generated/ bin -build +build \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 1944141cd..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,868 +0,0 @@ -# Change Log - -## [v3.0.0-beta.0](https://github.com/auth0/auth0-java/tree/v3.0.0-beta.0) (2025-12-18) -[Full Changelog](https://github.com/auth0/auth0-java/compare/v4.26.0...v3.0.0-beta.0) - -> **Warning** This SDK is in beta and is subject to breaking changes. It is not recommended for production use, but your feedback and help in testing is appreciated! - -**Added** -- Complete rewrite of the **Management API client** using Fern code generation -- Update OkHttp to 5.2.1 -- API attributes can set null for patch operations -- Nullability annotations to POJO classes -- Fully compatible **Authentication API client** — no breaking changes - -- [Migration guide](MIGRATION_GUIDE) available for upgrading from v2.x - - -## [2.27.0](https://github.com/auth0/auth0-java/tree/2.27.0) (2025-12-18) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.26.0...2.27.0) - -**Added** -- Feat: Add Google WorkSpace Provisioning Config Support [\#795](https://github.com/auth0/auth0-java/pull/795) ([tanya732](https://github.com/tanya732)) - -**Fixed** -- Fix: updated token_lifetime to Integer [\#797](https://github.com/auth0/auth0-java/pull/797) ([tanya732](https://github.com/tanya732)) - -## [2.26.0](https://github.com/auth0/auth0-java/tree/2.26.0) (2025-10-24) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.25.0...2.26.0) - -**Added** -- Adenix/client is token endpoint id header trusted [\#782](https://github.com/auth0/auth0-java/pull/782) ([tanya732](https://github.com/tanya732)) -- Feat: add constructor to set clientId on Client creation [\#781](https://github.com/auth0/auth0-java/pull/781) ([tanya732](https://github.com/tanya732)) - -## [2.25.0](https://github.com/auth0/auth0-java/tree/2.25.0) (2025-09-30) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.24.0...2.25.0) - -**Added** -- Added UserAttributeProfilePage and Deserializer [\#768](https://github.com/auth0/auth0-java/pull/768) ([tanya732](https://github.com/tanya732)) -- Added checkpoint pagination support for Connection Endpoint [\#767](https://github.com/auth0/auth0-java/pull/767) ([tanya732](https://github.com/tanya732)) -- Sdk 6843 self service provisioning java support [\#765](https://github.com/auth0/auth0-java/pull/765) ([tanya732](https://github.com/tanya732)) -- Support for patch clients credentials [\#760](https://github.com/auth0/auth0-java/pull/760) ([tanya732](https://github.com/tanya732)) - -**Fixed** -- Fix: URL Encodings [\#766](https://github.com/auth0/auth0-java/pull/766) ([tanya732](https://github.com/tanya732)) -- Fix: Updated to requested_expiry params [\#757](https://github.com/auth0/auth0-java/pull/757) ([tanya732](https://github.com/tanya732)) - -## [2.24.0](https://github.com/auth0/auth0-java/tree/2.24.0) (2025-08-22) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.23.0...2.24.0) - -**Added** -- Update Readme and Examples [\#752](https://github.com/auth0/auth0-java/pull/752) ([tanya732](https://github.com/tanya732)) -- Customize management api token provider [\#748](https://github.com/auth0/auth0-java/pull/748) ([tanya732](https://github.com/tanya732)) -- Joaosoumoreira/add method to enroll email mfa [\#744](https://github.com/auth0/auth0-java/pull/744) ([tanya732](https://github.com/tanya732)) - -## [2.23.0](https://github.com/auth0/auth0-java/tree/2.23.0) (2025-08-05) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.22.0...2.23.0) - -**Added** -- Added support for Tenant ACL [\#723](https://github.com/auth0/auth0-java/pull/723) ([tanya732](https://github.com/tanya732)) -- Added organization support for Change Password [\#726](https://github.com/auth0/auth0-java/pull/726) ([tanya732](https://github.com/tanya732)) -- Fix: Resource Server Scopes [\#725](https://github.com/auth0/auth0-java/pull/725) ([tanya732](https://github.com/tanya732)) - -## [2.22.0](https://github.com/auth0/auth0-java/tree/2.22.0) (2025-06-20) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.21.0...2.22.0) - -**Added** -- Added support for connectionKeys Endpoint [\#721](https://github.com/auth0/auth0-java/pull/721) ([tanya732](https://github.com/tanya732)) - -## [2.21.0](https://github.com/auth0/auth0-java/tree/2.21.0) (2025-05-30) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.20.0...2.21.0) - -**Added** -- SDK Limit M2M Java Support [\#708](https://github.com/auth0/auth0-java/pull/708) ([tanya732](https://github.com/tanya732)) -- Added support for GET/PATCH Connection Endpoints [\#718](https://github.com/auth0/auth0-java/pull/718) ([tanya732](https://github.com/tanya732)) -- Added support for EmailTemplate [\#720](https://github.com/auth0/auth0-java/pull/720) ([tanya732](https://github.com/tanya732)) - -**Fixed** -- Updated EnabledConnection [\#719](https://github.com/auth0/auth0-java/pull/719) ([tanya732](https://github.com/tanya732)) - -## [2.20.0](https://github.com/auth0/auth0-java/tree/2.20.0) (2025-05-06) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.19.0...2.20.0) - -**Fixed** -- Fixed POST/PATCH connection endpoints [\#710](https://github.com/auth0/auth0-java/pull/710) ([tanya732](https://github.com/tanya732)) -- Fix log event [\#711](https://github.com/auth0/auth0-java/pull/711) ([tanya732](https://github.com/tanya732)) - -## [2.19.0](https://github.com/auth0/auth0-java/tree/2.19.0) (2025-03-28) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.18.0...2.19.0) - -**Added** -- Added support for SSO-FF [\#702](https://github.com/auth0/auth0-java/pull/702) ([tanya732](https://github.com/tanya732)) -- Check point pagination support for get connection [\#704](https://github.com/auth0/auth0-java/pull/704) ([tanya732](https://github.com/tanya732)) - -## [2.18.0](https://github.com/auth0/auth0-java/tree/2.18.0) (2025-02-19) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.17.0...2.18.0) - -**Added** -- Added missing fields in LogEventClass [\#698](https://github.com/auth0/auth0-java/pull/698) ([tanya732](https://github.com/tanya732)) -- Added support for revoke session endpoint [\#699](https://github.com/auth0/auth0-java/pull/699) ([tanya732](https://github.com/tanya732)) -- Added Connection's SCIM Server Support [\#696](https://github.com/auth0/auth0-java/pull/696) ([tanya732](https://github.com/tanya732)) - -## [2.17.0](https://github.com/auth0/auth0-java/tree/2.17.0) (2025-01-10) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.16.0...2.17.0) - -**Added** -- Update EXAMPLES.md to fix variable usage [\#690](https://github.com/auth0/auth0-java/pull/690) ([tanya732](https://github.com/tanya732)) -- Added Support for Self-Service-Profile [\#683](https://github.com/auth0/auth0-java/pull/683) ([tanya732](https://github.com/tanya732)) -- Added support for Back Channel Login [\#682](https://github.com/auth0/auth0-java/pull/682) ([tanya732](https://github.com/tanya732)) - -## [2.17.0](https://github.com/auth0/auth0-java/tree/2.17.0) (2025-01-08) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.16.0...2.17.0) - -**Added** -- Update EXAMPLES.md to fix variable usage [\#690](https://github.com/auth0/auth0-java/pull/690) ([tanya732](https://github.com/tanya732)) -- Added Support for Self-Service-Profile [\#683](https://github.com/auth0/auth0-java/pull/683) ([tanya732](https://github.com/tanya732)) -- Added support for Back Channel Login [\#682](https://github.com/auth0/auth0-java/pull/682) ([tanya732](https://github.com/tanya732)) - -## [2.16.0](https://github.com/auth0/auth0-java/tree/2.16.0) (2024-12-03) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.15.0...2.16.0) - -**Added** -- Added support for custom prompts [\#680](https://github.com/auth0/auth0-java/pull/680) ([tanya732](https://github.com/tanya732)) -- Added phone number identifier in signup Auth API [\#679](https://github.com/auth0/auth0-java/pull/679) ([tanya732](https://github.com/tanya732)) -- Added is_signup_enabled field to OrganizationConnection [\#677](https://github.com/auth0/auth0-java/pull/677) ([tanya732](https://github.com/tanya732)) - -## [2.15.0](https://github.com/auth0/auth0-java/tree/2.15.0) (2024-10-31) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.14.0...2.15.0) - -**Added** -- Added support for byok [\#673](https://github.com/auth0/auth0-java/pull/673) ([tanya732](https://github.com/tanya732)) - -## [2.14.0](https://github.com/auth0/auth0-java/tree/2.14.0) (2024-10-16) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.13.0...2.14.0) - -**Added** -- SDKs support for Control Your Own Key [\#671](https://github.com/auth0/auth0-java/pull/671) ([tanya732](https://github.com/tanya732)) -- Added client credentials changes [\#670](https://github.com/auth0/auth0-java/pull/670) ([tanya732](https://github.com/tanya732)) -- Added support for HRI phase 2 changes [\#668](https://github.com/auth0/auth0-java/pull/668) ([tanya732](https://github.com/tanya732)) - -## [2.13.0](https://github.com/auth0/auth0-java/tree/2.13.0) (2024-09-11) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.12.0...2.13.0) - -**Added** -- Add sessions and refresh tokens to Users Management API [\#661](https://github.com/auth0/auth0-java/pull/661) ([tanya732](https://github.com/tanya732)) - -## [2.12.0](https://github.com/auth0/auth0-java/tree/2.12.0) (2024-05-29) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.11.0...2.12.0) - -**Added** -- Support delete all authentication methods endpoint [\#645](https://github.com/auth0/auth0-java/pull/645) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.11.0](https://github.com/auth0/auth0-java/tree/2.11.0) (2024-04-29) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.10.1...2.11.0) - -**Added** -- [SDK-4763] - RIch Authorization Request (RAR) [\#637](https://github.com/auth0/auth0-java/pull/637) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-4763] - Add support for HRI Management API changes [\#635](https://github.com/auth0/auth0-java/pull/635) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-4763] - add support for JAR and PAR with JAR to Authentication API [\#636](https://github.com/auth0/auth0-java/pull/636) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-4769] - add show_as_button to Organization Enabled Connections [\#631](https://github.com/auth0/auth0-java/pull/631) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.10.1](https://github.com/auth0/auth0-java/tree/2.10.1) (2024-01-29) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.10.0...2.10.1) - -**Deprecated** -- Organizations API no longer returns enabled_connections [\#604](https://github.com/auth0/auth0-java/pull/604) ([jimmyjames](https://github.com/jimmyjames)) - -# [2.10.0](https://github.com/auth0/auth0-java/tree/2.10.0) (2023-12-15) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.9.0...2.10.0) - -**Added** -- support backchannel logout property on Client [\#587](https://github.com/auth0/auth0-java/pull/587) ([jimmyjames](https://github.com/jimmyjames)) - -# [2.9.0](https://github.com/auth0/auth0-java/tree/2.9.0) (2023-11-21) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.8.0...2.9.0) - -**Added** -- Support organization in client credentials [\#582](https://github.com/auth0/auth0-java/pull/582) ([jimmyjames](https://github.com/jimmyjames)) - -# [2.8.0](https://github.com/auth0/auth0-java/tree/2.8.0) (2023-11-07) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.7.0...2.8.0) - -**Fixed** -- Propagate error messages on rate limit exceptions [\#579](https://github.com/auth0/auth0-java/pull/579) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.7.0](https://github.com/auth0/auth0-java/tree/2.7.0) (2023-10-31) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.6.1...2.7.0) - -**Added** -- Support organization get member roles [\#574](https://github.com/auth0/auth0-java/pull/574) ([jimmyjames](https://github.com/jimmyjames)) -- Add passkey properties to authentication method response [\#575](https://github.com/auth0/auth0-java/pull/575) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.6.1](https://github.com/auth0/auth0-java/tree/2.6.1) (2023-09-22) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.6.0...2.6.1) - -**Security** -- Update Okio to resolve CVE-2023-3635 [\#560](https://github.com/auth0/auth0-java/pull/560) ([evansims](https://github.com/evansims)) - -## [2.6.0](https://github.com/auth0/auth0-java/tree/2.6.0) (2023-09-07) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.5.0...2.6.0) - -**Security** -- Update OkHttp to 4.11.0 [\#558](https://github.com/auth0/auth0-java/pull/558) ([evansims](https://github.com/evansims)) - -**Fixed** -- Align json property 'cross_origin_authentication' with api docs [\#555](https://github.com/auth0/auth0-java/pull/555) ([Jojo134](https://github.com/Jojo134)) - -## [2.5.0](https://github.com/auth0/auth0-java/tree/2.5.0) (2023-07-18) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.4.0...2.5.0) - -**Added** -- Support Organization Name on Authorize URL [\#550](https://github.com/auth0/auth0-java/pull/550) ([vasantteja](https://github.com/vasantteja)) - -**Fixed** -- Fix deleteAuthenticationMethodById [\#552](https://github.com/auth0/auth0-java/pull/552) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.4.0](https://github.com/auth0/auth0-java/tree/2.4.0) (2023-06-15) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.3.0...2.4.0) - -**Added** -- Support delete authenticator endpoint [\#541](https://github.com/auth0/auth0-java/pull/541) ([vasantteja](https://github.com/vasantteja)) -- Support invalidate remembered browsers endpoint [\#543](https://github.com/auth0/auth0-java/pull/543) ([jimmyjames](https://github.com/jimmyjames)) - -**Fixed** -- Export users does not require connection_id [\#537](https://github.com/auth0/auth0-java/pull/537) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.3.0](https://github.com/auth0/auth0-java/tree/2.3.0) (2023-05-11) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.2.0...2.3.0) - -**Added** -- Support Pushed Authorization Requests [\#534](https://github.com/auth0/auth0-java/pull/534) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.2.0](https://github.com/auth0/auth0-java/tree/2.2.0) (2023-05-02) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.1.0...2.2.0) - -**Added** -- Add support for client credential management [\#525](https://github.com/auth0/auth0-java/pull/525) ([jimmyjames](https://github.com/jimmyjames)) - -**Fixed** -- Fix headers to lowercase [\#528](https://github.com/auth0/auth0-java/pull/528) ([alexz75](https://github.com/alexz75)) - - -## [2.1.0](https://github.com/auth0/auth0-java/tree/2.1.0) (2023-03-31) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0...2.1.0) - -**Added** -- Add missing LogEvent fields [\#521](https://github.com/auth0/auth0-java/pull/521) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- authentication_methods is an object, not a string [\#520](https://github.com/auth0/auth0-java/pull/520) ([jimmyjames](https://github.com/jimmyjames)) -- Bump jackson dependency to 2.14.2 [\#522](https://github.com/auth0/auth0-java/pull/522) ([jimmyjames](https://github.com/jimmyjames)) -- Update java-jwt dependency to 4.4.0 [\#523](https://github.com/auth0/auth0-java/pull/523) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.0.0](https://github.com/auth0/auth0-java/tree/2.0.0) (2023-02-23) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.2...2.0.0) - -2.0.0 introduces several enhances, including: -- HTTP response information returned from requests -- Additional HTTP client configurability -- Ability to configure requests such as add additional parameters and headers -- Support for Authentication API MFA-related APIs -- Authentication API improvements to not require a client secret -- ... and more! - -As a major version release, 2.0.0 does include breaking changes. - -## [2.0.0 Beta 2](https://github.com/auth0/auth0-java/tree/2.0.0-beta.2) (2023-02-13) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0-beta.1...2.0.0-beta.2) - -**Changed** -- Update to latest java-jwt version [\#512](https://github.com/auth0/auth0-java/pull/512) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.0.0 Beta 1](https://github.com/auth0/auth0-java/tree/2.0.0-beta.1) (2023-01-26) -[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0-beta.0...2.0.0-beta.1) - -**Added** -- Add support for MFA APIs [\#505](https://github.com/auth0/auth0-java/pull/505) ([poovamraj](https://github.com/poovamraj)) -- Add support MFA Methods API [\#506](https://github.com/auth0/auth0-java/pull/506) ([poovamraj](https://github.com/poovamraj)) -- Support JWT Client Authentication [\#507](https://github.com/auth0/auth0-java/pull/507) ([jimmyjames](https://github.com/jimmyjames)) - -## [2.0.0 Beta 0](https://github.com/auth0/auth0-java/tree/2.0.0-beta.0) (2023-01-12) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.2...2.0.0-beta.0) - -> **Warning** This SDK is in beta and is subject to breaking changes. It is not recommended for production use, but your feedback and help in testing is appreciated! - -This release introduces several enhancement, including: -- HTTP response information returned from requests -- Additional HTTP client configurability -- Authentication API improvements to not require a client secret -- ... and more! - -## [1.44.2](https://github.com/auth0/auth0-java/tree/1.44.2) (2023-01-11) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.1...1.44.2) - -This patch release does not contain any functional changes, but is being released using an updated signing key for verification as part of our commitment to best security practices. -Please review [the README note for additional details.](https://github.com/auth0/auth0-java/blob/master/README.md) - -**Security** -- Bump java-jwt dependency to 3.19.4 [\#498](https://github.com/auth0/auth0-java/pull/498) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.44.1](https://github.com/auth0/auth0-java/tree/1.44.1) (2022-10-25) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.0...1.44.1) - -**Security** -- Bump `java-jwt` to 3.19.3 [\#465](https://github.com/auth0/auth0-java/pull/465) ([jimmyjames](https://github.com/jimmyjames)) -- Bump `com.fasterxml.jackson.core:jackson-databind` to 2.13.4.2 [\#464](https://github.com/auth0/auth0-java/pull/464) ([evansims](https://github.com/evansims)) - -## [1.44.0](https://github.com/auth0/auth0-java/tree/1.44.0) (2022-10-20) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.43.0...1.44.0) - -**Added** -- Integrate ship orb [\#458](https://github.com/auth0/auth0-java/pull/458) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-2558] Add support for tenant session cookie [\#457](https://github.com/auth0/auth0-java/pull/457) ([jimmyjames](https://github.com/jimmyjames)) -- Support stage property on Breached Password Detection [\#456](https://github.com/auth0/auth0-java/pull/456) ([ewanharris](https://github.com/ewanharris)) - -**Changed** -- Update to Gradle 6.9.2 [\#455](https://github.com/auth0/auth0-java/pull/455) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.43.0](https://github.com/auth0/auth0-java/tree/1.43.0) (2022-09-19) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.42.0...1.43.0) - -**Added** -- Add support for deleting all user's authenticators [\#451](https://github.com/auth0/auth0-java/pull/451) ([jimmyjames](https://github.com/jimmyjames)) -- Add session idle lifetime and make session lifetime doubles [\#423](https://github.com/auth0/auth0-java/pull/423) ([pelletier197](https://github.com/pelletier197)) -- #448 Adding field filter option to get client by ID API [\#449](https://github.com/auth0/auth0-java/pull/449) ([bhatmadhavi](https://github.com/bhatmadhavi)) -- Add missing fields in Client model [\#444](https://github.com/auth0/auth0-java/pull/444) ([poovamraj](https://github.com/poovamraj)) -- Add Ship CLI configuration [\#433](https://github.com/auth0/auth0-java/pull/433) ([frederikprijck](https://github.com/frederikprijck)) - -**Changed** -- Update to OSS plugin version 0.17.2 [\#450](https://github.com/auth0/auth0-java/pull/450) ([jimmyjames](https://github.com/jimmyjames)) -- Bump oss-library and auth0/ship [\#441](https://github.com/auth0/auth0-java/pull/441) ([frederikprijck](https://github.com/frederikprijck)) -- Ensure version is defined before plugins are applied [\#439](https://github.com/auth0/auth0-java/pull/439) ([frederikprijck](https://github.com/frederikprijck)) - -**Security** -- Replace Codecov uploader w/ CircleCI Orb [\#446](https://github.com/auth0/auth0-java/pull/446) ([evansims](https://github.com/evansims)) -- Security: Update OkHttp to 4.10.0 [\#438](https://github.com/auth0/auth0-java/pull/438) ([evansims](https://github.com/evansims)) - -## [1.42.0](https://github.com/auth0/auth0-java/tree/1.42.0) (2022-05-20) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.41.0...1.42.0) - -**Added** -- Added support for Key management API [\#431](https://github.com/auth0/auth0-java/pull/431) ([poovamraj](https://github.com/poovamraj)) -- Support for custom scheme URL [\#429](https://github.com/auth0/auth0-java/pull/429) ([poovamraj](https://github.com/poovamraj)) -- Add enabled connections on organization [\#426](https://github.com/auth0/auth0-java/pull/426) ([charliearaya](https://github.com/charliearaya)) - -## [1.41.0](https://github.com/auth0/auth0-java/tree/1.41.0) (2022-04-19) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.2...1.41.0) - -**Fixed** -- Do not cast error values to String [\#421](https://github.com/auth0/auth0-java/pull/421) ([jimmyjames](https://github.com/jimmyjames)) -- Fix double-encoding of log event filter query param [\#420](https://github.com/auth0/auth0-java/pull/420) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.40.2](https://github.com/auth0/auth0-java/tree/1.40.2) (2022-04-07) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.1...1.40.2) - -**Security** -- Update OkHttp to address CVE-2021-0341 [\#417](https://github.com/auth0/auth0-java/pull/417) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.40.1](https://github.com/auth0/auth0-java/tree/1.40.1) (2022-03-30) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.0...1.40.1) - -**Security** -- Bump java-jwt to 3.19.1 [\#415](https://github.com/auth0/auth0-java/pull/415) ([poovamraj](https://github.com/poovamraj)) -- Security: Bump `jackson-databind` to 2.13.2.2 [\#414](https://github.com/auth0/auth0-java/pull/414) ([evansims](https://github.com/evansims)) - -## [1.40.0](https://github.com/auth0/auth0-java/tree/1.40.0) (2022-03-14) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.39.0...1.40.0) - -**Changed** -- Update java-jwt dependency [\#413](https://github.com/auth0/auth0-java/pull/413) ([jimmyjames](https://github.com/jimmyjames)) - -**Security** -- Bump `jackson-databind` dependency to 2.13.2 [\#411](https://github.com/auth0/auth0-java/pull/411) ([evansims](https://github.com/evansims)) - -## [1.39.0](https://github.com/auth0/auth0-java/tree/1.39.0) (2022-02-18) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.38.0...1.39.0) - -**Added** -- [SDK-3116] Add support for Attack Protection APIs [\#405](https://github.com/auth0/auth0-java/pull/405) ([jimmyjames](https://github.com/jimmyjames)) -- Feature/add branding [\#399](https://github.com/auth0/auth0-java/pull/399) ([pelletier197](https://github.com/pelletier197)) - -**Changed** -- Feature/reduce duplication [\#381](https://github.com/auth0/auth0-java/pull/381) ([pelletier197](https://github.com/pelletier197)) - -## [1.38.0](https://github.com/auth0/auth0-java/tree/1.38.0) (2022-02-01) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.37.0...1.38.0) - -**Added** -- Support maxRequests and maxRequestsPerHost client confiugrations [\#402](https://github.com/auth0/auth0-java/pull/402) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.37.0](https://github.com/auth0/auth0-java/tree/1.37.0) (2022-01-20) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.36.1...1.37.0) - -**Added** -- Add support for Connection realms [\#397](https://github.com/auth0/auth0-java/pull/397) ([jimmyjames](https://github.com/jimmyjames)) -- Improve logging [\#392](https://github.com/auth0/auth0-java/pull/392) ([jimmyjames](https://github.com/jimmyjames)) - -**Deprecated** -- Deprecate setLoggingEnabled on API clients [\#396](https://github.com/auth0/auth0-java/pull/396) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.36.1](https://github.com/auth0/auth0-java/tree/1.36.1) (2022-01-14) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.36.0...1.36.1) - -**Security** -- Update jackson dependency [\#394](https://github.com/auth0/auth0-java/pull/394) ([poovamraj](https://github.com/poovamraj)) - -## [1.36.0](https://github.com/auth0/auth0-java/tree/1.36.0) (2022-01-10) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.35.0...1.36.0) - -**Fixed** -- [SDK-2975] Fix withOrganization method visibility on token verifier [\#388](https://github.com/auth0/auth0-java/pull/388) ([jimmyjames](https://github.com/jimmyjames)) -- remove warning for untyped requests [\#385](https://github.com/auth0/auth0-java/pull/385) ([pelletier197](https://github.com/pelletier197)) - -## [1.35.0](https://github.com/auth0/auth0-java/tree/1.35.0) (2021-10-20) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.34.1...1.35.0) - -**Added** -- Added get job error details method to JobEntity [\#383](https://github.com/auth0/auth0-java/pull/383) ([jasonfagerberg-toast](https://github.com/jasonfagerberg-toast)) -- Add MFA Authentication policies to GuardianEntity [\#379](https://github.com/auth0/auth0-java/pull/379) ([pelletier197](https://github.com/pelletier197)) - -**Fixed** -- Fix de/serialization of Invitation roles [\#380](https://github.com/auth0/auth0-java/pull/380) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.34.1](https://github.com/auth0/auth0-java/tree/1.34.1) (2021-09-21) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.34.0...1.34.1) - -**Fixed** -- Add user_name field to LogEvent [\#375](https://github.com/auth0/auth0-java/pull/375) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.34.0](https://github.com/auth0/auth0-java/tree/1.34.0) (2021-08-27) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.33.0...1.34.0) - -**Added** -- Include log_id in the LogEvent entity [\#372](https://github.com/auth0/auth0-java/pull/372) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-2716] Add support for Actions Management APIs [\#369](https://github.com/auth0/auth0-java/pull/369) ([jimmyjames](https://github.com/jimmyjames)) -- [SDK-2686] Add retry on rate limit errors for management API [\#368](https://github.com/auth0/auth0-java/pull/368) ([jimmyjames](https://github.com/jimmyjames)) - -**Fixed** -- Fix to rollback action version endpoint [\#370](https://github.com/auth0/auth0-java/pull/370) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.33.0](https://github.com/auth0/auth0-java/tree/1.33.0) (2021-07-26) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.32.0...1.33.0) - -**Added** -- [SDK-2664] Add support for checkpoint pagination [\#362](https://github.com/auth0/auth0-java/pull/362) ([jimmyjames](https://github.com/jimmyjames)) - -**Deprecated** -- Deprecate unused constructors in Page implementations [\#363](https://github.com/auth0/auth0-java/pull/363) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.32.0](https://github.com/auth0/auth0-java/tree/1.32.0) (2021-07-05) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.31.0...1.32.0) - -**Added** -- [SDK-2622] Add expiresAt to token response [\#357](https://github.com/auth0/auth0-java/pull/357) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- Update OSS release plugin version [\#358](https://github.com/auth0/auth0-java/pull/358) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.31.0](https://github.com/auth0/auth0-java/tree/1.31.0) (2021-05-10) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.30.0...1.31.0) - -**Added** -- [SDK-2550] Add networking client timeout configuration [\#354](https://github.com/auth0/auth0-java/pull/354) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.30.0](https://github.com/auth0/auth0-java/tree/1.30.0) (2021-04-28) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.29.0...1.30.0) - -**Added** -- [SDK-2537] Add missing parameters to Ticket entities [\#352](https://github.com/auth0/auth0-java/pull/352) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.29.0](https://github.com/auth0/auth0-java/tree/1.29.0) (2021-04-09) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.28.1...1.29.0) - -**Added** -- Adds method to get an organization's enabled connection and update JavaDocs [\#344](https://github.com/auth0/auth0-java/pull/344) ([jimmyjames](https://github.com/jimmyjames)) -- Add Organizations Management API Support [SDK-2437] [\#341](https://github.com/auth0/auth0-java/pull/341) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.28.1](https://github.com/auth0/auth0-java/tree/1.28.1) (2021-04-05) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.28.0...1.28.1) - -**Fixed** -- Fix `NoSuchMethodError` when projects have OkHttp 3 dependency [\#342](https://github.com/auth0/auth0-java/pull/342) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.28.0](https://github.com/auth0/auth0-java/tree/1.28.0) (2021-03-25) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.27.0...1.28.0) - -**Added** -- Add support for organizations feature [\#338](https://github.com/auth0/auth0-java/pull/338) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- Update Gradle OSS Plugin [\#339](https://github.com/auth0/auth0-java/pull/339) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.27.0](https://github.com/auth0/auth0-java/tree/1.27.0) (2021-02-05) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.26.0...1.27.0) - -**Added** -- Add support for async requests [\#328](https://github.com/auth0/auth0-java/pull/328) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- Update dependency versions [\#329](https://github.com/auth0/auth0-java/pull/329) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.26.0](https://github.com/auth0/auth0-java/tree/1.26.0) (2020-12-02) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.25.0...1.26.0) - -**Added** -- Add refresh token configuration object to client [\#321](https://github.com/auth0/auth0-java/pull/321) ([JakeUskoski](https://github.com/JakeUskoski)) - -**Fixed** -- Fix OkHttp dependency version [\#325](https://github.com/auth0/auth0-java/pull/325) ([jimmyjames](https://github.com/jimmyjames)) -- Tidy up code [\#317](https://github.com/auth0/auth0-java/pull/317) ([jsalinaspolo](https://github.com/jsalinaspolo)) - -## [1.25.0](https://github.com/auth0/auth0-java/tree/1.25.0) (2020-11-16) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.24.0...1.25.0) - -**Changed** -- Update to OkHttp 4 [\#319](https://github.com/auth0/auth0-java/pull/319) ([jimmyjames](https://github.com/jimmyjames)) -- Use java8 [\#316](https://github.com/auth0/auth0-java/pull/316) ([jsalinaspolo](https://github.com/jsalinaspolo)) - -## [1.24.0](https://github.com/auth0/auth0-java/tree/1.24.0) (2020-11-02) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.23.0...1.24.0) - -**Added** -- Add methods to determine cause of APIException [\#310](https://github.com/auth0/auth0-java/pull/310) ([jimmyjames](https://github.com/jimmyjames)) - -**Breaking Changes** -- Return TokenRequest instead of AuthRequest [\#309](https://github.com/auth0/auth0-java/pull/309) ([jimmyjames](https://github.com/jimmyjames)) - -> Note: We aim to not introduce breaking changes within a release stream. We have taken steps, including running API compatibility checks, to prevent introducing breaking changes in the future. - -**Fixed** -- Add unchecked warnings failures for src [\#311](https://github.com/auth0/auth0-java/pull/311) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.23.0](https://github.com/auth0/auth0-java/tree/1.23.0) (2020-10-22) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.22.1...1.23.0) - -**Added** -- Add support for MFA OTP exchange [\#303](https://github.com/auth0/auth0-java/pull/303) ([jimmyjames](https://github.com/jimmyjames)) -- Passwordless support [\#300](https://github.com/auth0/auth0-java/pull/300) ([jimmyjames](https://github.com/jimmyjames)) -- Add scope to TokenHolder [\#297](https://github.com/auth0/auth0-java/pull/297) ([jimmyjames](https://github.com/jimmyjames)) -- Add inicludeEmailInRedirect field for create email verification ticket endpoint [\#296](https://github.com/auth0/auth0-java/pull/296) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- Update dependencies [\#299](https://github.com/auth0/auth0-java/pull/299) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.22.1](https://github.com/auth0/auth0-java/tree/1.22.1) (2020-10-13) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.22.0...1.22.1) - -**Fixed** -- Use Standard Jackson Date serialization [\#295](https://github.com/auth0/auth0-java/pull/295) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.22.0](https://github.com/auth0/auth0-java/tree/1.22.0) (2020-09-28) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.21.0...1.22.0) - -**Added** -- Add support for identity field for email verification jobs and tickets [\#293](https://github.com/auth0/auth0-java/pull/293) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.21.0](https://github.com/auth0/auth0-java/tree/1.21.0) (2020-08-27) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.20.0...1.21.0) - -**Added** -- Add support for Log Streams [\#284](https://github.com/auth0/auth0-java/pull/284) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.20.0](https://github.com/auth0/auth0-java/tree/1.20.0) (2020-07-27) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.19.0...1.20.0) - -**Added** -- Add missing Linking User Accounts endpoint [\#270](https://github.com/auth0/auth0-java/pull/270) ([cschwalm](https://github.com/cschwalm)) - -**Fixed** -- Fix and document thread-safety [\#272](https://github.com/auth0/auth0-java/pull/272) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.19.0](https://github.com/auth0/auth0-java/tree/1.19.0) (2020-06-05) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.18.0...1.19.0) - -**Added** -- Add display_name property to Connection [\#267](https://github.com/auth0/auth0-java/pull/267) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add support for java Proxy with basic auth [\#266](https://github.com/auth0/auth0-java/pull/266) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.18.0](https://github.com/auth0/auth0-java/tree/1.18.0) (2020-05-29) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.17.0...1.18.0) - -**Added** -- Add ID Token verifier API [\#260](https://github.com/auth0/auth0-java/pull/260) ([jimmyjames](https://github.com/jimmyjames)) -- Add signature verification classes [\#258](https://github.com/auth0/auth0-java/pull/258) ([jimmyjames](https://github.com/jimmyjames)) - -**Changed** -- Update to OkHttp 3.14.9 [\#262](https://github.com/auth0/auth0-java/pull/262) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.17.0](https://github.com/auth0/auth0-java/tree/1.17.0) (2020-05-22) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.16.0...1.17.0) - -**Added** -- Add missing property last_password_reset [\#256](https://github.com/auth0/auth0-java/pull/256) ([mario-moura-silva](https://github.com/mario-moura-silva)) -- Add missing "sources" property to the Permission [\#254](https://github.com/auth0/auth0-java/pull/254) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.16.0](https://github.com/auth0/auth0-java/tree/1.16.0) (2020-04-24) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.15.0...1.16.0) - -**Added** -- Add Job "POST User Imports" endpoint [\#249](https://github.com/auth0/auth0-java/pull/249) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add a new class to handle Multipart requests [\#248](https://github.com/auth0/auth0-java/pull/248) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add Job "GET Status" endpoint [\#247](https://github.com/auth0/auth0-java/pull/247) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add missing "initiate_login_uri" property to Client [\#244](https://github.com/auth0/auth0-java/pull/244) ([lbalmaceda](https://github.com/lbalmaceda)) -- Use char array for passwords [\#242](https://github.com/auth0/auth0-java/pull/242) ([jimmyjames](https://github.com/jimmyjames)) -- Add Job "POST User Exports" endpoint [\#241](https://github.com/auth0/auth0-java/pull/241) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add Rules Configs entity [\#240](https://github.com/auth0/auth0-java/pull/240) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Deprecated** -- deprecated string password APIs [\#243](https://github.com/auth0/auth0-java/pull/243) ([jimmyjames](https://github.com/jimmyjames)) - -**Fixed** -- Make CreatedUser take the id from different properties [\#245](https://github.com/auth0/auth0-java/pull/245) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Security** -- Use char array for passwords [\#242](https://github.com/auth0/auth0-java/pull/242) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.15.0](https://github.com/auth0/auth0-java/tree/1.15.0) (2019-11-12) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.3...1.15.0) - -**Changed** -- Allow to set the client is_first_party property [\#230](https://github.com/auth0/auth0-java/pull/230) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.14.3](https://github.com/auth0/auth0-java/tree/1.14.3) (2019-09-25) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.2...1.14.3) - -**Security** -- Update jackson-databind to address CVE [\#225](https://github.com/auth0/auth0-java/pull/225) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.14.2](https://github.com/auth0/auth0-java/tree/1.14.2) (2019-08-15) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.1...1.14.2) - -**Fixed** -- Find the right JDK version for Telemetry [\#220](https://github.com/auth0/auth0-java/pull/220) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Security** -- Update dependencies [\#222](https://github.com/auth0/auth0-java/pull/222) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.14.1](https://github.com/auth0/auth0-java/tree/1.14.1) (2019-07-03) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.0...1.14.1) - -**Security** -- Update jackson-databind dependency to fix security vulnerability [\#217](https://github.com/auth0/auth0-java/pull/217) ([jimmyjames](https://github.com/jimmyjames)) - -## [1.14.0](https://github.com/auth0/auth0-java/tree/1.14.0) (2019-07-02) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.3...1.14.0) - -**Added** -- Add getter for DeviceCredentials client_id [\#215](https://github.com/auth0/auth0-java/pull/215) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add missing ResourceServer properties [\#214](https://github.com/auth0/auth0-java/pull/214) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.13.3](https://github.com/auth0/auth0-java/tree/1.13.3) (2019-05-22) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.2...1.13.3) - -**Fixed** -- Add missing metadata field to Connection object [\#206](https://github.com/auth0/auth0-java/pull/206) ([AlisonT1230](https://github.com/AlisonT1230)) - -**Security** -- Bump dependencies and solve security issues [\#209](https://github.com/auth0/auth0-java/pull/209) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.13.2](https://github.com/auth0/auth0-java/tree/1.13.2) (2019-05-01) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.1...1.13.2) - -**Fixed** -- Dynamically obtain the project version for telemetry [\#201](https://github.com/auth0/auth0-java/pull/201) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.13.1](https://github.com/auth0/auth0-java/tree/1.13.1) (2019-04-25) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.0...1.13.1) - -**Fixed** -- Fix for issue #198: Core Authorization fails when adding Roles to User [\#199](https://github.com/auth0/auth0-java/pull/199) ([jakbutler](https://github.com/jakbutler)) - -## [1.13.0](https://github.com/auth0/auth0-java/tree/1.13.0) (2019-04-23) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.12.0...1.13.0) - -**Added** -- Add support for Core Authorization's User Roles and Permissions [\#193](https://github.com/auth0/auth0-java/pull/193) ([jakbutler](https://github.com/jakbutler)) - -## [1.12.0](https://github.com/auth0/auth0-java/tree/1.12.0) (2019-04-17) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.11.0...1.12.0) - -**Added** -- Update Telemetry format and allow to customize it [\#195](https://github.com/auth0/auth0-java/pull/195) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Changed** -- Remove default version for search_engine [\#194](https://github.com/auth0/auth0-java/pull/194) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.11.0](https://github.com/auth0/auth0-java/tree/1.11.0) (2019-03-14) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.10.0...1.11.0) - -**Added** -- Add "mark_email_as_verified" property to PasswordChangeTicket [\#189](https://github.com/auth0/auth0-java/pull/189) ([akvamalin](https://github.com/akvamalin)) - -## [1.10.0](https://github.com/auth0/auth0-java/tree/1.10.0) (2019-01-03) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.9.1...1.10.0) - -**Added** -- Add Serializable to the user data. [\#178](https://github.com/auth0/auth0-java/pull/178) ([dfredell](https://github.com/dfredell)) -- Include grant_types in Client [\#166](https://github.com/auth0/auth0-java/pull/166) ([osule](https://github.com/osule)) - -**Fixed** -- Closing response body on RateLimitException [\#175](https://github.com/auth0/auth0-java/pull/175) ([j-m-x](https://github.com/j-m-x)) - -**Security** -- Bump jackson-databind to patch security issues. [\#181](https://github.com/auth0/auth0-java/pull/181) ([gkwang](https://github.com/gkwang)) - -## [1.9.1](https://github.com/auth0/auth0-java/tree/1.9.1) (2018-10-23) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.9.0...1.9.1) - -**Security** -- Use jackson-databind 2.9.7 [\#168](https://github.com/auth0/auth0-java/pull/168) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.9.0](https://github.com/auth0/auth0-java/tree/1.9.0) (2018-09-25) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.8.0...1.9.0) - -**Added** -- Allow to retrieve Rate Limit headers [\#153](https://github.com/auth0/auth0-java/pull/153) ([rvillablanca](https://github.com/rvillablanca)) -- Add web_origins attribute to the Client class [\#148](https://github.com/auth0/auth0-java/pull/148) ([lbalmaceda](https://github.com/lbalmaceda)) -- Application (aka Client) description field support [\#147](https://github.com/auth0/auth0-java/pull/147) ([rrybalkin](https://github.com/rrybalkin)) - -## [1.8.0](https://github.com/auth0/auth0-java/tree/1.8.0) (2018-07-13) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.7.0...1.8.0) - -**Added** -- Allow to update the Management API token [\#141](https://github.com/auth0/auth0-java/pull/141) ([lbalmaceda](https://github.com/lbalmaceda)) -- Allow to set search_engine version for Users API [\#140](https://github.com/auth0/auth0-java/pull/140) ([lbalmaceda](https://github.com/lbalmaceda)) -- Make Connections accept include_totals parameter [\#135](https://github.com/auth0/auth0-java/pull/135) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add pagination support to Client Grants, Grants, Resource Servers and Rules [\#132](https://github.com/auth0/auth0-java/pull/132) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Deprecated** -- Deprecate old list methods that do not support pagination [\#136](https://github.com/auth0/auth0-java/pull/136) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.7.0](https://github.com/auth0/auth0-java/tree/1.7.0) (2018-06-11) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.6.0...1.7.0) - -**Added** -- Support pagination on the Clients entity [\#124](https://github.com/auth0/auth0-java/pull/124) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add Resend verification email functionality [\#120](https://github.com/auth0/auth0-java/pull/120) ([minhlongdo](https://github.com/minhlongdo)) - -**Deprecated** -- Deprecate ClientsEntity#list() method [\#128](https://github.com/auth0/auth0-java/pull/128) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Security** -- Security fix and dependencies update [\#129](https://github.com/auth0/auth0-java/pull/129) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.6.0](https://github.com/auth0/auth0-java/tree/1.6.0) (2018-06-04) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.5.1...1.6.0) - -**Added** -- Expose additional error response properties in the Exception [\#123](https://github.com/auth0/auth0-java/pull/123) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add email-templates endpoints [\#117](https://github.com/auth0/auth0-java/pull/117) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.5.1](https://github.com/auth0/auth0-java/tree/1.5.1) (2018-03-01) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.5.0...1.5.1) - -**Fixed** -- Support password policy error response [\#108](https://github.com/auth0/auth0-java/pull/108) ([lbalmaceda](https://github.com/lbalmaceda)) -- Close ResponseBody buffer after read [\#101](https://github.com/auth0/auth0-java/pull/101) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.5.0](https://github.com/auth0/auth0-java/tree/1.5.0) (2017-12-07) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.4.0...1.5.0) - -**Added** -- Resource server [\#77](https://github.com/auth0/auth0-java/pull/77) ([mfarsikov](https://github.com/mfarsikov)) - -## [1.4.0](https://github.com/auth0/auth0-java/tree/1.4.0) (2017-11-30) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.3.1...1.4.0) - -**Added** -- Add user_id setter [\#93](https://github.com/auth0/auth0-java/pull/93) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add /v2/users-by-email endpoint [\#87](https://github.com/auth0/auth0-java/pull/87) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Breaking changes** -- Include a proper SignUp response [\#92](https://github.com/auth0/auth0-java/pull/92) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.3.1](https://github.com/auth0/auth0-java/tree/1.3.1) (2017-11-01) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.3.0...1.3.1) -**Closed issues** -- NullPointerException, StdDeserializer [\#78](https://github.com/auth0/auth0-java/issues/78) - -**Fixed** -- Upgrade Jackson-databind dependency [\#82](https://github.com/auth0/auth0-java/pull/82) ([LuisSaybe](https://github.com/LuisSaybe)) - -## [1.3.0](https://github.com/auth0/auth0-java/tree/1.3.0) (2017-09-08) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.2.0...1.3.0) - -**Added** -- implemented /api/v2/grants endpoint of auth0 management api [\#74](https://github.com/auth0/auth0-java/pull/74) ([neshanjo](https://github.com/neshanjo)) - -**Changed** -- removed unmotivated throwing of UnsupportedEncodingException [\#75](https://github.com/auth0/auth0-java/pull/75) ([neshanjo](https://github.com/neshanjo)) - -## [1.2.0](https://github.com/auth0/auth0-java/tree/1.2.0) (2017-08-07) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.1.0...1.2.0) -**Closed issues** -- Get AD connection's provisioning_ticket_url property [\#66](https://github.com/auth0/auth0-java/issues/66) - -**Added** -- Add support for provisioning_ticket_url property to Connection POJO [\#67](https://github.com/auth0/auth0-java/pull/67) ([unnamed38](https://github.com/unnamed38)) -- Add public User constructor without parameters [\#59](https://github.com/auth0/auth0-java/pull/59) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Removed** -- Remove invalid Logout URL parameter [\#65](https://github.com/auth0/auth0-java/pull/65) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.1.0](https://github.com/auth0/auth0-java/tree/1.1.0) (2017-05-23) -[Full Changelog](https://github.com/auth0/auth0-java/compare/1.0.0...1.1.0) - -**Added** -- Add getter for User and ProfileData extra properties [\#56](https://github.com/auth0/auth0-java/pull/56) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add renew authentication endpoint [\#51](https://github.com/auth0/auth0-java/pull/51) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add revoke token endpoint [\#50](https://github.com/auth0/auth0-java/pull/50) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add getter for Identity extra properties [\#45](https://github.com/auth0/auth0-java/pull/45) ([lbalmaceda](https://github.com/lbalmaceda)) -- Add response_type and custom parameter setter for AuthorizeUrlBuilder [\#40](https://github.com/auth0/auth0-java/pull/40) ([lbalmaceda](https://github.com/lbalmaceda)) - -**Changed** -- Improve Guardian section [\#39](https://github.com/auth0/auth0-java/pull/39) ([nikolaseu](https://github.com/nikolaseu)) -- Simplify/reduce amount of code [\#36](https://github.com/auth0/auth0-java/pull/36) ([nikolaseu](https://github.com/nikolaseu)) - -**Fixed** -- Fix "q" query parameter encoding [\#55](https://github.com/auth0/auth0-java/pull/55) ([lbalmaceda](https://github.com/lbalmaceda)) -- Close the ResponseBody after its parsed [\#38](https://github.com/auth0/auth0-java/pull/38) ([lbalmaceda](https://github.com/lbalmaceda)) - -## [1.0.0](https://github.com/auth0/auth0-java/tree/1.0.0) (2017-01-30) - -Reworked Auth0 SDK for java by providing better support for non-Android application (for Android please use [Auth0.Android](https://github.com/auth0/Auth0.Android)). - -The changes from v0 includes: - -- OAuth 2.0 endpoints in Authentication API -- Sync calls by default -- Added Management API endpoints -- Better error handling for Auth and Management API erros - -### Auth API - -The implementation is based on the [Authentication API Docs](https://auth0.com/docs/api/authentication). - -Create a new `AuthAPI` instance by providing the client data from the [dashboard](https://manage.auth0.com/#/clients). - -```java -AuthAPI auth = new AuthAPI("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}"); -``` - -### Management API - -The implementation is based on the [Management API Docs](https://auth0.com/docs/api/management/v2). - -Create a new `ManagementAPI` instance by providing the domain from the [client dashboard](https://manage.auth0.com/#/clients) and the API Token. Click [here](https://auth0.com/docs/api/management/v2#!/Introduction/Getting_an_API_token) for more information on how to obtain a valid API Token. - -```java -ManagementAPI mgmt = new ManagementAPI("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}"); -``` - -The Management API is divided into different entities. Each of them have the list, create, update, delete and update methods plus a few more if corresponds. The calls are authenticated using the API Token given in the `ManagementAPI` instance creation and must contain the `scope` required by each entity. See the javadoc for details on which `scope` is expected for each call. - -* **Client Grants:** See [Docs](https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants). Access the methods by calling `mgmt.clientGrants()`. -* **Clients:** See [Docs](https://auth0.com/docs/api/management/v2#!/Clients/get_clients). Access the methods by calling `mgmt.clients()`. -* **Connections:** See [Docs](https://auth0.com/docs/api/management/v2#!/Connections/get_connections). Access the methods by calling `mgmt.connections()`. -* **Device Credentials:** See [Docs](https://auth0.com/docs/api/management/v2#!/Device_Credentials/get_device_credentials). Access the methods by calling `mgmt.deviceCredentials()`. -* **Logs:** See [Docs](https://auth0.com/docs/api/management/v2#!/Logs/get_logs). Access the methods by calling `mgmt.logEvents()`. -* **Rules:** See [Docs](https://auth0.com/docs/api/management/v2#!/Rules/get_rules). Access the methods by calling `mgmt.rules()`. -* **User Blocks:** See [Docs](https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks). Access the methods by calling `mgmt.userBlocks()`. -* **Users:** See [Docs](https://auth0.com/docs/api/management/v2#!/Users/get_users). Access the methods by calling `mgmt.users()`. -* **Blacklists:** See [Docs](https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens). Access the methods by calling `mgmt.blacklists()`. -* **Emails:** See [Docs](https://auth0.com/docs/api/management/v2#!/Emails/get_provider). Access the methods by calling `mgmt.emailProvider()`. -* **Guardian:** See [Docs](https://auth0.com/docs/api/management/v2#!/Guardian/get_factors). Access the methods by calling `mgmt.guardian()`. -* **Stats:** See [Docs](https://auth0.com/docs/api/management/v2#!/Stats/get_active_users). Access the methods by calling `mgmt.stats()`. -* **Tenants:** See [Docs](https://auth0.com/docs/api/management/v2#!/Tenants/get_settings). Access the methods by calling `mgmt.tenants()`. -* **Tickets:** See [Docs](https://auth0.com/docs/api/management/v2#!/Tickets/post_email_verification). Access the methods by calling `mgmt.tickets()`. - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d865b7591..000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Auth0, Inc. (http://auth0.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md deleted file mode 100644 index 738f515f5..000000000 --- a/MIGRATION_GUIDE.md +++ /dev/null @@ -1,369 +0,0 @@ -# V3 Migration Guide - -A guide to migrating the Auth0 Java SDK from `v2` to `v3`. - -- [Overall changes](#overall-changes) - - [Java versions](#java-versions) - - [Authentication API](#authentication-api) - - [Management API](#management-api) -- [Specific changes to the Management API](#specific-changes-to-the-management-api) - - [Client initialization](#client-initialization) - - [Sub-client organization](#sub-client-organization) - - [Request and response patterns](#request-and-response-patterns) - - [Pagination](#pagination) - - [Exception handling](#exception-handling) - - [Accessing raw HTTP responses](#accessing-raw-http-responses) - - [Request-level configuration](#request-level-configuration) - - [Type changes](#type-changes) - -## Overall changes - -### Java versions - -Both v2 and v3 require Java 8 or above. - -### Authentication API - -This major version change does not affect the Authentication API. The `AuthAPI` class has been ported directly from v2 to v3. Any code written for the Authentication API in the v2 version should work in the v3 version. - -```java -// Works in both v2 and v3 -AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); -``` - -### Management API - -V3 introduces significant improvements to the Management API SDK by migrating to [Fern](https://github.com/fern-api/fern) as the code generation tool. This provides: - -- Better resource grouping with sub-client organization -- Type-safe request and response objects using builder patterns -- Automatic pagination with `SyncPagingIterable` -- Simplified access to HTTP response metadata via `withRawResponse()` -- Consistent method naming (`list`, `create`, `get`, `update`, `delete`) - -## Specific changes to the Management API - -### Client initialization - -The Management API client initialization has changed from `ManagementAPI` to `ManagementApi`, and uses a different builder pattern. - -**v2:** -```java -import com.auth0.client.mgmt.ManagementAPI; - -// Using domain and token -ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build(); - -// Using TokenProvider -TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}"); -ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", tokenProvider).build(); -``` - -**v3:** -1st Approach : Standard Token-Based -```java -import com.auth0.client.mgmt.ManagementApi; - -ManagementApi client = ManagementApi - .builder() - .url("https://{YOUR_DOMAIN}/api/v2") - .token("{YOUR_API_TOKEN}") - .build(); -``` - -or - -2nd Approach : OAuth client credentials flow - -```java -OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier( -"{CLIENT_ID}", -"{CLIENT_SECRET}", -"https://{YOUR_DOMAIN}", -"{YOUR_AUDIENCE}" -); - -ClientOptions clientOptions = ClientOptions.builder() -.environment(Environment.custom("https://{YOUR_AUDIENCE}")) -.addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) -.build(); - -ManagementApi client = new ManagementApi(clientOptions); - -``` - -#### Builder options comparison - -| Option | v2 | v3 | -|--------|----|----| -| Domain/URL | `newBuilder(domain, token)` | `.url("https://domain/api/v2")` | -| Token | Constructor parameter | `.token(token)` | -| Timeout | Via `HttpOptions` | `.timeout(seconds)` | -| Max retries | Via `HttpOptions` | `.maxRetries(count)` | -| Custom HTTP client | `.withHttpClient(Auth0HttpClient)` | `.httpClient(OkHttpClient)` | -| Custom headers | Not directly supported | `.addHeader(name, value)` | - -### Sub-client organization - -V3 introduces a hierarchical sub-client structure. Operations on related resources are now accessed through nested clients instead of methods on a flat entity class. - -**v2:** -```java -// All user operations on UsersEntity -Request userRequest = mgmt.users().get("user_id", new UserFilter()); -Request> permissionsRequest = mgmt.users().getPermissions("user_id", new PermissionsFilter()); -Request> rolesRequest = mgmt.users().getRoles("user_id", new RolesFilter()); -Request logsRequest = mgmt.users().getLogEvents("user_id", new LogEventFilter()); -``` - -**v3:** -```java -// Operations organized into sub-clients -GetUserResponseContent user = client.users().get("user_id"); -SyncPagingIterable permissions = client.users().permissions().list("user_id"); -SyncPagingIterable roles = client.users().roles().list("user_id"); -SyncPagingIterable logs = client.users().logs().list("user_id"); -``` - -#### Common sub-client mappings - -| v2 Method | v3 Sub-client | -|-----------|---------------| -| `mgmt.users().getPermissions()` | `client.users().permissions().list()` | -| `mgmt.users().getRoles()` | `client.users().roles().list()` | -| `mgmt.users().getLogEvents()` | `client.users().logs().list()` | -| `mgmt.users().getOrganizations()` | `client.users().organizations().list()` | -| `mgmt.users().link()` | `client.users().identities().link()` | -| `mgmt.users().unlink()` | `client.users().identities().delete()` | -| `mgmt.users().deleteMultifactorProvider()` | `client.users().multifactor().deleteProvider()` | -| `mgmt.organizations().getMembers()` | `client.organizations().members().list()` | -| `mgmt.organizations().getInvitations()` | `client.organizations().invitations().list()` | -| `mgmt.organizations().getEnabledConnections()` | `client.organizations().enabledConnections().list()` | -| `mgmt.actions().getVersions()` | `client.actions().versions().list()` | -| `mgmt.actions().getTriggerBindings()` | `client.actions().triggers().bindings().list()` | -| `mgmt.guardian().getFactors()` | `client.guardian().factors().list()` | -| `mgmt.branding().getUniversalLoginTemplate()` | `client.branding().templates().getUniversalLogin()` | -| `mgmt.connections().getScimConfiguration()` | `client.connections().scimConfiguration().get()` | - -### Request and response patterns - -V3 uses type-safe request content objects with builders instead of domain objects or filter parameters. - -**v2:** -```java -import com.auth0.json.mgmt.users.User; -import com.auth0.net.Request; - -// Creating a user -User user = new User("Username-Password-Authentication"); -user.setEmail("test@example.com"); -user.setPassword("password123".toCharArray()); - -Request request = mgmt.users().create(user); -User createdUser = request.execute().getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.types.CreateUserRequestContent; -import com.auth0.client.mgmt.types.CreateUserResponseContent; - -// Creating a user -CreateUserResponseContent user = client.users().create( - CreateUserRequestContent - .builder() - .connection("Username-Password-Authentication") - .email("test@example.com") - .password("password123") - .build() -); -``` - -#### Key differences - -| Aspect | v2 | v3 | -|--------|----|----| -| Request building | Domain objects with setters | Builder pattern with `*RequestContent` types | -| Response type | `Request` requiring `.execute().getBody()` | Direct return of response object | -| Filtering | Filter classes (e.g., `UserFilter`) | `*RequestParameters` builder classes | -| Execution | Explicit `.execute()` call | Implicit execution on method call | - -### Pagination - -V3 introduces `SyncPagingIterable` for automatic pagination, replacing the manual `Request` pattern. - -**v2:** -```java -import com.auth0.json.mgmt.users.UsersPage; -import com.auth0.client.mgmt.filter.UserFilter; - -Request request = mgmt.users().list(new UserFilter().withPage(0, 50)); -UsersPage page = request.execute().getBody(); - -for (User user : page.getItems()) { - System.out.println(user.getEmail()); -} - -// Manual pagination -while (page.getNext() != null) { - request = mgmt.users().list(new UserFilter().withPage(page.getNext(), 50)); - page = request.execute().getBody(); - for (User user : page.getItems()) { - System.out.println(user.getEmail()); - } -} -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.SyncPagingIterable; -import com.auth0.client.mgmt.types.UserResponseSchema; -import com.auth0.client.mgmt.types.ListUsersRequestParameters; - -// Automatic iteration through all pages -SyncPagingIterable users = client.users().list( - ListUsersRequestParameters - .builder() - .perPage(50) - .build() -); - -for (UserResponseSchema user : users) { - System.out.println(user.getEmail()); -} - -// Or manual page control -List pageItems = users.getItems(); -while (users.hasNext()) { - pageItems = users.nextPage().getItems(); - // process page -} -``` - -### Exception handling - -V3 uses a unified `ManagementApiException` class instead of the v2 exception hierarchy. - -**v2:** -```java -import com.auth0.exception.Auth0Exception; -import com.auth0.exception.APIException; -import com.auth0.exception.RateLimitException; - -try { - User user = mgmt.users().get("user_id", null).execute().getBody(); -} catch (RateLimitException e) { - // Rate limited - long retryAfter = e.getLimit(); -} catch (APIException e) { - int statusCode = e.getStatusCode(); - String error = e.getError(); - String description = e.getDescription(); -} catch (Auth0Exception e) { - // Network or other errors -} -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.ManagementApiException; - -try { - GetUserResponseContent user = client.users().get("user_id"); -} catch (ManagementApiException e) { - int statusCode = e.statusCode(); - Object body = e.body(); - Map> headers = e.headers(); - String message = e.getMessage(); -} -``` - -### Accessing raw HTTP responses - -V3 provides access to full HTTP response metadata via `withRawResponse()`. - -**v2:** -```java -// Response wrapper provided status code -Response response = mgmt.users().get("user_id", null).execute(); -int statusCode = response.getStatusCode(); -User user = response.getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.ManagementApiHttpResponse; - -// Use withRawResponse() to access headers and metadata -ManagementApiHttpResponse response = client.users() - .withRawResponse() - .get("user_id"); - -GetUserResponseContent user = response.body(); -Map> headers = response.headers(); -``` - -### Request-level configuration - -V3 allows per-request configuration through `RequestOptions`. - -**v2:** -```java -// Most configuration was at client level only -// Request-level headers required creating a new request manually -Request request = mgmt.users().get("user_id", null); -request.addHeader("X-Custom-Header", "value"); -User user = request.execute().getBody(); -``` - -**v3:** -```java -import com.auth0.client.mgmt.core.RequestOptions; - -GetUserResponseContent user = client.users().get( - "user_id", - GetUserRequestParameters.builder().build(), - RequestOptions.builder() - .timeout(10) - .maxRetries(1) - .addHeader("X-Custom-Header", "value") - .build() -); -``` - -### Type changes - -V3 uses generated type classes located in `com.auth0.client.mgmt.types` instead of the hand-written POJOs in `com.auth0.json.mgmt`. - -**v2:** -```java -import com.auth0.json.mgmt.users.User; -import com.auth0.json.mgmt.roles.Role; -import com.auth0.json.mgmt.organizations.Organization; -``` - -**v3:** -```java -import com.auth0.client.mgmt.types.UserResponseSchema; -import com.auth0.client.mgmt.types.CreateUserRequestContent; -import com.auth0.client.mgmt.types.CreateUserResponseContent; -import com.auth0.client.mgmt.types.Role; -import com.auth0.client.mgmt.types.Organization; -``` - -Type naming conventions in v3: -- Request body types: `*RequestContent` (e.g., `CreateUserRequestContent`) -- Response types: `*ResponseContent` or `*ResponseSchema` (e.g., `GetUserResponseContent`, `UserResponseSchema`) -- Query parameters: `*RequestParameters` (e.g., `ListUsersRequestParameters`) - -All types use immutable builders: - -```java -// v3 type construction -CreateUserRequestContent request = CreateUserRequestContent - .builder() - .email("test@example.com") - .connection("Username-Password-Authentication") - .password("secure-password") - .build(); -``` diff --git a/reference.md b/reference.md index 1c055ffb1..f3faa4c56 100644 --- a/reference.md +++ b/reference.md @@ -30,12 +30,24 @@ Retrieve all actions. client.actions().list( ListActionsRequestParameters .builder() - .triggerId("triggerId") - .actionName("actionName") - .deployed(true) - .page(1) - .perPage(1) - .installed(true) + .triggerId( + OptionalNullable.of("triggerId") + ) + .actionName( + OptionalNullable.of("actionName") + ) + .deployed( + OptionalNullable.of(true) + ) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .installed( + OptionalNullable.of(true) + ) .build() ); ``` @@ -191,7 +203,7 @@ client.actions().create(

-**runtime:** `Optional` — The Node runtime. For example: `node12`, defaults to `node12` +**runtime:** `Optional` — The Node runtime. For example: `node22`, defaults to `node22`
@@ -207,6 +219,14 @@ client.actions().create(
+**modules:** `Optional>` — The list of action modules and their versions used by this action. + +
+
+ +
+
+ **deploy:** `Optional` — True if the action should be deployed after creation.
@@ -304,7 +324,9 @@ client.actions().delete( "id", DeleteActionRequestParameters .builder() - .force(true) + .force( + OptionalNullable.of(true) + ) .build() ); ``` @@ -428,7 +450,7 @@ client.actions().update(
-**runtime:** `Optional` — The Node runtime. For example: `node12`, defaults to `node12` +**runtime:** `Optional` — The Node runtime. For example: `node22`, defaults to `node22`
@@ -438,6 +460,14 @@ client.actions().update( **secrets:** `Optional>` — The list of secrets that are included in an action or a version of an action. + +
+ +
+
+ +**modules:** `Optional>` — The list of action modules and their versions used by this action. +
@@ -709,7 +739,7 @@ client.branding().update(
-Retrieve a list of client grants, including the scopes associated with the application/API pair. +Retrieve a list of client grants, including the scopes associated with the application/API pair.
@@ -727,11 +757,24 @@ Retrieve a list of ` — Optional filter on allow_any_organization. + + + +
+
+ +**subjectType:** `Optional` — The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta’s Master Subscription Agreement. +
@@ -824,9 +875,6 @@ client.clientGrants().create( .builder() .clientId("client_id") .audience("audience") - .scope( - Arrays.asList("scope") - ) .build() ); ``` @@ -875,7 +923,23 @@ client.clientGrants().create(
-**scope:** `List` — Scopes allowed for this client grant. +**scope:** `Optional>` — Scopes allowed for this client grant. + +
+
+ +
+
+ +**subjectType:** `Optional` + +
+
+ +
+
+ +**authorizationDetailsTypes:** `Optional>` — Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s Master Subscription Agreement.
@@ -1014,6 +1078,14 @@ client.clientGrants().update( **allowAnyOrganization:** `Optional` — Controls allowing any organization to be used with this grant + + + +
+
+ +**authorizationDetailsTypes:** `Optional>` — Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s Master Subscription Agreement. +
@@ -1087,15 +1159,33 @@ For more information, read
-**grantTypes:** `Optional>` — List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, and `urn:ietf:params:oauth:grant-type:device_code`. +**grantTypes:** `Optional>` — List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.
@@ -1360,6 +1450,14 @@ client.clients().create(
+**isTokenEndpointIpHeaderTrusted:** `Optional` — If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint. + +
+
+ +
+
+ **appType:** `Optional`
@@ -1536,6 +1634,14 @@ client.clients().create(
+**organizationDiscoveryMethods:** `Optional>` — Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both. + +
+
+ +
+
+ **clientAuthenticationMethods:** `Optional`
@@ -1576,6 +1682,26 @@ client.clients().create(
+**skipNonVerifiableCallbackUriConfirmationPrompt:** `Optional` + +Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`). +If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. +See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + +
+
+ +
+
+ +**tokenExchange:** `Optional` + +
+
+ +
+
+ **parRequestExpiry:** `Optional` — Specifies how long, in seconds, a Pushed Authorization Request URI remains valid
@@ -1594,6 +1720,22 @@ client.clients().create( **resourceServerIdentifier:** `Optional` — The identifier of the resource server that this client is linked to. + +
+ +
+
+ +**expressConfiguration:** `Optional` + +
+
+ +
+
+ +**asyncApprovalNotificationChannels:** `Optional>` +
@@ -1665,8 +1807,12 @@ client.clients().get( "id", GetClientRequestParameters .builder() - .fields("fields") - .includeFields(true) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -1908,7 +2054,7 @@ client.clients().update(
-**grantTypes:** `Optional>` — A set of grant types that the client is authorized to use. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, and `urn:ietf:params:oauth:grant-type:device_code`. +**grantTypes:** `Optional>` — A set of grant types that the client is authorized to use. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.
@@ -2004,6 +2150,14 @@ client.clients().update(
+**isTokenEndpointIpHeaderTrusted:** `Optional` — If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint. + +
+
+ +
+
+ **appType:** `Optional`
@@ -2132,6 +2286,14 @@ client.clients().update(
+**organizationDiscoveryMethods:** `Optional>` — Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both. + +
+
+ +
+
+ **clientAuthenticationMethods:** `Optional`
@@ -2172,8 +2334,44 @@ client.clients().update(
+**skipNonVerifiableCallbackUriConfirmationPrompt:** `Optional` + +Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`). +If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. +See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + +
+
+ +
+
+ +**tokenExchange:** `Optional` + +
+
+ +
+
+ **parRequestExpiry:** `Optional` — Specifies how long, in seconds, a Pushed Authorization Request URI remains valid +
+
+ +
+
+ +**expressConfiguration:** `Optional` + +
+
+ +
+
+ +**asyncApprovalNotificationChannels:** `Optional>` +
@@ -2242,8 +2440,8 @@ client.clients().rotateSecret("id");
-## Connections -
client.connections.list() -> SyncPagingIterable<ConnectionForList> +## ConnectionProfiles +
client.connectionProfiles.list() -> SyncPagingIterable<ConnectionProfile>
@@ -2255,25 +2453,7 @@ client.clients().rotateSecret("id");
-Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. - -This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
- -Checkpoint pagination must be used if you need to retrieve more than 1000 connections. - -

Checkpoint Pagination

- -To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- -Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination.
@@ -2288,14 +2468,15 @@ To search by checkpoint, use the following parameters:
```java -client.connections().list( - ListConnectionsQueryParameters +client.connectionProfiles().list( + ListConnectionProfileRequestParameters .builder() - .from("from") - .take(1) - .name("name") - .fields("fields") - .includeFields(true) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -2320,39 +2501,7 @@ client.connections().list(
-**take:** `Optional` — Number of results per page. Defaults to 50. - -
-
- -
-
- -**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies - -
-
- -
-
- -**name:** `Optional` — Provide the name of the connection to retrieve - -
-
- -
-
- -**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields - -
-
- -
-
- -**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) +**take:** `Optional` — Number of results per page. Defaults to 5.
@@ -2364,7 +2513,7 @@ client.connections().list(
-
client.connections.create(request) -> CreateConnectionResponseContent +
client.connectionProfiles.create(request) -> CreateConnectionProfileResponseContent
@@ -2376,7 +2525,7 @@ client.connections().list(
-Creates a new connection according to the JSON object received in body.
+Create a Connection Profile.
@@ -2391,11 +2540,10 @@ Creates a new connection according to the JSON object received in body ```java -client.connections().create( - CreateConnectionRequestContent +client.connectionProfiles().create( + CreateConnectionProfileRequestContent .builder() .name("name") - .strategy(ConnectionIdentityProviderEnum.AD) .build() ); ``` @@ -2412,7 +2560,7 @@ client.connections().create(
-**name:** `String` — The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128 +**name:** `String`
@@ -2420,7 +2568,7 @@ client.connections().create(
-**displayName:** `Optional` — Connection name used in the new universal login experience +**organization:** `Optional`
@@ -2428,7 +2576,7 @@ client.connections().create(
-**strategy:** `ConnectionIdentityProviderEnum` +**connectionNamePrefixTemplate:** `Optional`
@@ -2436,7 +2584,7 @@ client.connections().create(
-**options:** `Optional` +**enabledFeatures:** `Optional>`
@@ -2444,7 +2592,7 @@ client.connections().create(
-**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients. +**connectionConfig:** `Optional`
@@ -2452,32 +2600,47 @@ client.connections().create(
-**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) +**strategyOverrides:** `Optional`
+ +
-
-
-**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) -
+
+
client.connectionProfiles.listTemplates() -> ListConnectionProfileTemplateResponseContent
-**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. - +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of Connection Profile Templates.
+
+
+ +#### 🔌 Usage
-**metadata:** `Optional>` - +
+
+ +```java +client.connectionProfiles().listTemplates(); +```
@@ -2488,7 +2651,7 @@ client.connections().create(
-
client.connections.get(id) -> GetConnectionResponseContent +
client.connectionProfiles.getTemplate(id) -> GetConnectionProfileTemplateResponseContent
@@ -2500,7 +2663,7 @@ client.connections().create(
-Retrieve details for a specified connection along with options that can be used for identity provider configuration. +Retrieve a Connection Profile Template.
@@ -2515,14 +2678,7 @@ Retrieve details for a specified
@@ -2537,23 +2693,61 @@ client.connections().get(
-**id:** `String` — The id of the connection to retrieve +**id:** `String` — ID of the connection-profile-template to retrieve.
+ +
+ + + +
+ +
client.connectionProfiles.get(id) -> GetConnectionProfileResponseContent
-**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields - +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Connection Profile specified by ID.
+
+
+ +#### 🔌 Usage
-**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) +
+
+ +```java +client.connectionProfiles().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the connection-profile to retrieve.
@@ -2565,7 +2759,7 @@ client.connections().get(
-
client.connections.delete(id) +
client.connectionProfiles.delete(id)
@@ -2577,7 +2771,7 @@ client.connections().get(
-Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. +Delete a single Connection Profile specified by ID.
@@ -2592,7 +2786,7 @@ Removes a specific
@@ -2607,7 +2801,7 @@ client.connections().delete("id");
-**id:** `String` — The id of the connection to delete +**id:** `String` — ID of the connection-profile to delete.
@@ -2619,7 +2813,7 @@ client.connections().delete("id");
-
client.connections.update(id, request) -> UpdateConnectionResponseContent +
client.connectionProfiles.update(id, request) -> UpdateConnectionProfileResponseContent
@@ -2631,9 +2825,7 @@ client.connections().delete("id");
-Update details for a specific connection, including option properties for identity provider configuration. - -Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. +Update the details of a specific Connection Profile.
@@ -2648,9 +2840,9 @@ Update details for a specific
-**id:** `String` — The id of the connection to update - -
-
- -
-
- -**displayName:** `Optional` — The connection name used in the new universal login experience. If display_name is not included in the request, the field will be overwritten with the name value. +**id:** `String` — ID of the connection profile to update.
@@ -2684,7 +2868,7 @@ client.connections().update(
-**options:** `Optional` +**name:** `Optional`
@@ -2692,7 +2876,7 @@ client.connections().update(
-**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients. +**organization:** `Optional`
@@ -2700,7 +2884,7 @@ client.connections().update(
-**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) +**connectionNamePrefixTemplate:** `Optional`
@@ -2708,7 +2892,7 @@ client.connections().update(
-**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) +**enabledFeatures:** `Optional>`
@@ -2716,7 +2900,7 @@ client.connections().update(
-**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. +**connectionConfig:** `Optional`
@@ -2724,7 +2908,7 @@ client.connections().update(
-**metadata:** `Optional>` +**strategyOverrides:** `Optional`
@@ -2736,7 +2920,8 @@ client.connections().update(
-
client.connections.checkStatus(id) +## Connections +
client.connections.list() -> SyncPagingIterable<ConnectionForList>
@@ -2748,7 +2933,25 @@ client.connections().update(
-Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message +Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + +This endpoint supports two types of pagination: +
    +
  • Offset pagination
  • +
  • Checkpoint pagination
  • +
+ +Checkpoint pagination must be used if you need to retrieve more than 1000 connections. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
@@ -2763,7 +2966,26 @@ Retrieves the status of an ad/ldap connection referenced by its ID.
```java -client.connections().checkStatus("id"); +client.connections().list( + ListConnectionsQueryParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .name( + OptionalNullable.of("name") + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .build() +); ```
@@ -2778,48 +3000,48 @@ client.connections().checkStatus("id");
-**id:** `String` — ID of the connection to check +**from:** `Optional` — Optional Id from which to start selection.
- - +
+
+**take:** `Optional` — Number of results per page. Defaults to 50. +
-
-## CustomDomains -
client.customDomains.list() -> List<CustomDomain>
-#### 📝 Description - -
-
+**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies + +
+
-Retrieve details on custom domains. -
-
+**name:** `Optional` — Provide the name of the connection to retrieve +
-#### 🔌 Usage -
+**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + +
+
+
-```java -client.customDomains().list(); -``` +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) +
@@ -2830,7 +3052,7 @@ client.customDomains().list();
-
client.customDomains.create(request) -> CreateCustomDomainResponseContent +
client.connections.create(request) -> CreateConnectionResponseContent
@@ -2842,20 +3064,7 @@ client.customDomains().list();
-Create a new custom domain. - -Note: The custom domain will need to be verified before it will accept -requests. - -Optional attributes that can be updated: - -- custom_client_ip_header -- tls_policy - - -TLS Policies: - -- recommended - for modern usage this includes TLS 1.2 only +Creates a new connection according to the JSON object received in body.
@@ -2870,11 +3079,11 @@ TLS Policies:
```java -client.customDomains().create( - CreateCustomDomainRequestContent +client.connections().create( + CreateConnectionRequestContent .builder() - .domain("domain") - .type(CustomDomainProvisioningTypeEnum.AUTH0MANAGED_CERTS) + .name("name") + .strategy(ConnectionIdentityProviderEnum.AD) .build() ); ``` @@ -2891,7 +3100,7 @@ client.customDomains().create(
-**domain:** `String` — Domain name. +**name:** `String` — The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128
@@ -2899,7 +3108,7 @@ client.customDomains().create(
-**type:** `CustomDomainProvisioningTypeEnum` +**displayName:** `Optional` — Connection name used in the new universal login experience
@@ -2907,7 +3116,7 @@ client.customDomains().create(
-**verificationMethod:** `Optional` +**strategy:** `ConnectionIdentityProviderEnum`
@@ -2915,7 +3124,7 @@ client.customDomains().create(
-**tlsPolicy:** `Optional` +**options:** `Optional`
@@ -2923,61 +3132,55 @@ client.customDomains().create(
-**customClientIpHeader:** `Optional` +**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.
-
-
+
+
+**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) +
-
-
client.customDomains.get(id) -> GetCustomDomainResponseContent
-#### 📝 Description - -
-
+**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) + +
+
-Retrieve a custom domain configuration and status. -
-
+**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. +
-#### 🔌 Usage - -
-
-
-```java -client.customDomains().get("id"); -``` -
-
+**metadata:** `Optional>>` +
-#### ⚙️ Parameters -
+**authentication:** `Optional` + +
+
+
-**id:** `String` — ID of the custom domain to retrieve. +**connectedAccounts:** `Optional`
@@ -2989,7 +3192,7 @@ client.customDomains().get("id");
-
client.customDomains.delete(id) +
client.connections.get(id) -> GetConnectionResponseContent
@@ -3001,7 +3204,7 @@ client.customDomains().get("id");
-Delete a custom domain and stop serving requests for it. +Retrieve details for a specified connection along with options that can be used for identity provider configuration.
@@ -3016,7 +3219,18 @@ Delete a custom domain and stop serving requests for it.
```java -client.customDomains().delete("id"); +client.connections().get( + "id", + GetConnectionRequestParameters + .builder() + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .build() +); ```
@@ -3031,7 +3245,23 @@ client.customDomains().delete("id");
-**id:** `String` — ID of the custom domain to delete. +**id:** `String` — The id of the connection to retrieve + +
+
+ +
+
+ +**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields + +
+
+ +
+
+ +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true)
@@ -3043,7 +3273,7 @@ client.customDomains().delete("id");
-
client.customDomains.update(id, request) -> UpdateCustomDomainResponseContent +
client.connections.delete(id)
@@ -3055,30 +3285,63 @@ client.customDomains().delete("id");
-Update a custom domain. +Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. +
+
+
+
-These are the attributes that can be updated: +#### 🔌 Usage -- custom_client_ip_header -- tls_policy +
+
-
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to -send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
+
+
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+```java +client.connections().delete("id"); +``` +
+
+
+
+#### ⚙️ Parameters -TLS Policies: +
+
-- recommended - for modern usage this includes TLS 1.2 only +
+
+**id:** `String` — The id of the connection to delete + +
+
+
+
-Some considerations: -- The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. -- The compatible TLS policy is no longer supported. + + +
+ +
client.connections.update(id, request) -> UpdateConnectionResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update details for a specific connection, including option properties for identity provider configuration. + +Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.
@@ -3093,9 +3356,9 @@ Some considerations:
```java -client.customDomains().update( +client.connections().update( "id", - UpdateCustomDomainRequestContent + UpdateConnectionRequestContent .builder() .build() ); @@ -3113,7 +3376,7 @@ client.customDomains().update(
-**id:** `String` — The id of the custom domain to update +**id:** `String` — The id of the connection to update
@@ -3121,7 +3384,7 @@ client.customDomains().update(
-**tlsPolicy:** `Optional` +**displayName:** `Optional` — The connection name used in the new universal login experience. If display_name is not included in the request, the field will be overwritten with the name value.
@@ -3129,61 +3392,63 @@ client.customDomains().update(
-**customClientIpHeader:** `Optional` +**options:** `Optional`
-
-
+
+
+**enabledClients:** `Optional>` — DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients. +
-
-
client.customDomains.test(id) -> TestCustomDomainResponseContent
-#### 📝 Description - -
-
+**isDomainConnection:** `Optional` — true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.) + +
+
-Run the test process on a custom domain. -
-
+**showAsButton:** `Optional` — Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.) +
-#### 🔌 Usage -
+**realms:** `Optional>` — Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. + +
+
+
-```java -client.customDomains().test("id"); -``` -
-
+**metadata:** `Optional>>` + -#### ⚙️ Parameters -
+**authentication:** `Optional` + +
+
+
-**id:** `String` — ID of the custom domain to test. +**connectedAccounts:** `Optional`
@@ -3195,7 +3460,7 @@ client.customDomains().test("id");
-
client.customDomains.verify(id) -> VerifyCustomDomainResponseContent +
client.connections.checkStatus(id)
@@ -3207,14 +3472,7 @@ client.customDomains().test("id");
-Run the verification process on a custom domain. - -Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. - -For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. - -Learn more about verifying custom domains that use Auth0 Managed certificates. -Learn more about verifying custom domains that use Self Managed certificates. +Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message
@@ -3229,7 +3487,7 @@ For self_managed_certs, when the custom domain is verified for the
```java -client.customDomains().verify("id"); +client.connections().checkStatus("id"); ```
@@ -3244,7 +3502,7 @@ client.customDomains().verify("id");
-**id:** `String` — ID of the custom domain to verify. +**id:** `String` — ID of the connection to check
@@ -3256,8 +3514,8 @@ client.customDomains().verify("id");
-## DeviceCredentials -
client.deviceCredentials.list() -> SyncPagingIterable<DeviceCredential> +## CustomDomains +
client.customDomains.list() -> List<CustomDomain>
@@ -3269,7 +3527,7 @@ client.customDomains().verify("id");
-Retrieve device credential information (public_key, refresh_token, or rotating_refresh_token) associated with a specific user. +Retrieve details on custom domains.
@@ -3284,17 +3542,21 @@ Retrieve device credential information (public_key, refresh_t
```java -client.deviceCredentials().list( - ListDeviceCredentialsRequestParameters +client.customDomains().list( + ListCustomDomainsRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .fields("fields") - .includeFields(true) - .userId("user_id") - .clientId("client_id") - .type(DeviceCredentialTypeEnum.PUBLIC_KEY) + .q( + OptionalNullable.of("q") + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .sort( + OptionalNullable.of("sort") + ) .build() ); ``` @@ -3311,23 +3573,7 @@ client.deviceCredentials().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. - -
-
- -
-
- -**perPage:** `Optional` — Number of results per page. There is a maximum of 1000 results allowed from this endpoint. - -
-
- -
-
- -**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**q:** `Optional` — Query in Lucene query string syntax.
@@ -3351,23 +3597,7 @@ client.deviceCredentials().list(
-**userId:** `Optional` — user_id of the devices to retrieve. - -
-
- -
-
- -**clientId:** `Optional` — client_id of the devices to retrieve. - -
-
- -
-
- -**type:** `Optional` — Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. The property will default to `refresh_token` when paging is requested +**sort:** `Optional` — Field to sort by. Only domain:1 (ascending order by domain) is supported at this time.
@@ -3379,7 +3609,7 @@ client.deviceCredentials().list(
-
client.deviceCredentials.createPublicKey(request) -> CreatePublicKeyDeviceCredentialResponseContent +
client.customDomains.create(request) -> CreateCustomDomainResponseContent
@@ -3391,9 +3621,20 @@ client.deviceCredentials().list(
-Create a device credential public key to manage refresh token rotation for a given user_id. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. +Create a new custom domain. -When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read Signing Keys. +Note: The custom domain will need to be verified before it will accept +requests. + +Optional attributes that can be updated: + +- custom_client_ip_header +- tls_policy + + +TLS Policies: + +- recommended - for modern usage this includes TLS 1.2 only
@@ -3408,13 +3649,11 @@ When refresh token rotation is enabled, the endpoint becomes consistent. For mor
```java -client.deviceCredentials().createPublicKey( - CreatePublicKeyDeviceCredentialRequestContent +client.customDomains().create( + CreateCustomDomainRequestContent .builder() - .deviceName("device_name") - .type("public_key") - .value("value") - .deviceId("device_id") + .domain("domain") + .type(CustomDomainProvisioningTypeEnum.AUTH0MANAGED_CERTS) .build() ); ``` @@ -3431,7 +3670,7 @@ client.deviceCredentials().createPublicKey(
-**deviceName:** `String` — Name for this device easily recognized by owner. +**domain:** `String` — Domain name.
@@ -3439,7 +3678,7 @@ client.deviceCredentials().createPublicKey(
-**type:** `String` +**type:** `CustomDomainProvisioningTypeEnum`
@@ -3447,7 +3686,7 @@ client.deviceCredentials().createPublicKey(
-**value:** `String` — Base64 encoded string containing the credential. +**verificationMethod:** `Optional`
@@ -3455,7 +3694,7 @@ client.deviceCredentials().createPublicKey(
-**deviceId:** `String` — Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor. +**tlsPolicy:** `Optional`
@@ -3463,7 +3702,15 @@ client.deviceCredentials().createPublicKey(
-**clientId:** `Optional` — client_id of the client (application) this credential is for. +**customClientIpHeader:** `Optional` + +
+
+ +
+
+ +**domainMetadata:** `Optional>>`
@@ -3475,7 +3722,7 @@ client.deviceCredentials().createPublicKey(
-
client.deviceCredentials.delete(id) +
client.customDomains.get(id) -> GetCustomDomainResponseContent
@@ -3487,7 +3734,7 @@ client.deviceCredentials().createPublicKey(
-Permanently delete a device credential (such as a refresh token or public key) with the given ID. +Retrieve a custom domain configuration and status.
@@ -3502,7 +3749,7 @@ Permanently delete a device credential (such as a refresh token or public key) w
```java -client.deviceCredentials().delete("id"); +client.customDomains().get("id"); ```
@@ -3517,7 +3764,7 @@ client.deviceCredentials().delete("id");
-**id:** `String` — ID of the credential to delete. +**id:** `String` — ID of the custom domain to retrieve.
@@ -3529,8 +3776,7 @@ client.deviceCredentials().delete("id");
-## EmailTemplates -
client.emailTemplates.create(request) -> CreateEmailTemplateResponseContent +
client.customDomains.delete(id)
@@ -3542,7 +3788,7 @@ client.deviceCredentials().delete("id");
-Create an email template. +Delete a custom domain and stop serving requests for it.
@@ -3557,12 +3803,7 @@ Create an email template.
```java -client.emailTemplates().create( - CreateEmailTemplateRequestContent - .builder() - .template(EmailTemplateNameEnum.VERIFY_EMAIL) - .build() -); +client.customDomains().delete("id"); ```
@@ -3577,47 +3818,89 @@ client.emailTemplates().create(
-**template:** `EmailTemplateNameEnum` +**id:** `String` — ID of the custom domain to delete.
- -
-
- -**body:** `Optional` — Body of the email template. -
-
-
-**from:** `Optional` — Senders `from` email address. -
+
+
client.customDomains.update(id, request) -> UpdateCustomDomainResponseContent
-**resultUrl:** `Optional` — URL to redirect the user to after a successful action. - -
-
+#### 📝 Description
-**subject:** `Optional` — Subject line of the email. - -
-
-
-**syntax:** `Optional` — Syntax of the template body. +Update a custom domain. + +These are the attributes that can be updated: + +- custom_client_ip_header +- tls_policy + +
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to +send should be: +
{ "custom_client_ip_header": "cf-connecting-ip" }
+ +
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: +
{ "tls_policy": "recommended" }
+ + +TLS Policies: + +- recommended - for modern usage this includes TLS 1.2 only + + +Some considerations: + +- The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. +- The compatible TLS policy is no longer supported. +
+
+ + + +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.customDomains().update( + "id", + UpdateCustomDomainRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the custom domain to update
@@ -3625,7 +3908,7 @@ client.emailTemplates().create(
-**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. +**tlsPolicy:** `Optional`
@@ -3633,7 +3916,7 @@ client.emailTemplates().create(
-**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. +**customClientIpHeader:** `Optional`
@@ -3641,7 +3924,7 @@ client.emailTemplates().create(
-**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). +**domainMetadata:** `Optional>>`
@@ -3653,7 +3936,7 @@ client.emailTemplates().create(
-
client.emailTemplates.get(templateName) -> GetEmailTemplateResponseContent +
client.customDomains.test(id) -> TestCustomDomainResponseContent
@@ -3665,7 +3948,7 @@ client.emailTemplates().create(
-Retrieve an email template by pre-defined name. These names are `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, and `async_approval`. The names `change_password`, and `password_reset` are also supported for legacy scenarios. +Run the test process on a custom domain.
@@ -3680,7 +3963,7 @@ Retrieve an email template by pre-defined name. These names are `verify_email`,
```java -client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL); +client.customDomains().test("id"); ```
@@ -3695,7 +3978,7 @@ client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL);
-**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). +**id:** `String` — ID of the custom domain to test.
@@ -3707,7 +3990,7 @@ client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL);
-
client.emailTemplates.set(templateName, request) -> SetEmailTemplateResponseContent +
client.customDomains.verify(id) -> VerifyCustomDomainResponseContent
@@ -3719,7 +4002,14 @@ client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL);
-Update an email template. +Run the verification process on a custom domain. + +Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + +For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + +Learn more about verifying custom domains that use Auth0 Managed certificates. +Learn more about verifying custom domains that use Self Managed certificates.
@@ -3734,13 +4024,7 @@ Update an email template.
```java -client.emailTemplates().set( - EmailTemplateNameEnum.VERIFY_EMAIL, - SetEmailTemplateRequestContent - .builder() - .template(EmailTemplateNameEnum.VERIFY_EMAIL) - .build() -); +client.customDomains().verify("id"); ```
@@ -3755,23 +4039,90 @@ client.emailTemplates().set(
-**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). +**id:** `String` — ID of the custom domain to verify.
+ + + + + + +
+## DeviceCredentials +
client.deviceCredentials.list() -> SyncPagingIterable<DeviceCredential>
-**template:** `EmailTemplateNameEnum` - +#### 📝 Description + +
+
+ +
+
+ +Retrieve device credential information (public_key, refresh_token, or rotating_refresh_token) associated with a specific user. +
+
+#### 🔌 Usage +
-**body:** `Optional` — Body of the email template. +
+
+ +```java +client.deviceCredentials().list( + ListDeviceCredentialsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .userId( + OptionalNullable.of("user_id") + ) + .clientId( + OptionalNullable.of("client_id") + ) + .type( + OptionalNullable.of(DeviceCredentialTypeEnum.PUBLIC_KEY) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -3779,7 +4130,7 @@ client.emailTemplates().set(
-**from:** `Optional` — Senders `from` email address. +**perPage:** `Optional` — Number of results per page. There is a maximum of 1000 results allowed from this endpoint.
@@ -3787,7 +4138,7 @@ client.emailTemplates().set(
-**resultUrl:** `Optional` — URL to redirect the user to after a successful action. +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -3795,7 +4146,7 @@ client.emailTemplates().set(
-**subject:** `Optional` — Subject line of the email. +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
@@ -3803,7 +4154,7 @@ client.emailTemplates().set(
-**syntax:** `Optional` — Syntax of the template body. +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false).
@@ -3811,7 +4162,7 @@ client.emailTemplates().set(
-**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. +**userId:** `Optional` — user_id of the devices to retrieve.
@@ -3819,7 +4170,7 @@ client.emailTemplates().set(
-**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. +**clientId:** `Optional` — client_id of the devices to retrieve.
@@ -3827,7 +4178,7 @@ client.emailTemplates().set(
-**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). +**type:** `Optional` — Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. The property will default to `refresh_token` when paging is requested
@@ -3839,7 +4190,7 @@ client.emailTemplates().set(
-
client.emailTemplates.update(templateName, request) -> UpdateEmailTemplateResponseContent +
client.deviceCredentials.createPublicKey(request) -> CreatePublicKeyDeviceCredentialResponseContent
@@ -3851,7 +4202,9 @@ client.emailTemplates().set(
-Modify an email template. +Create a device credential public key to manage refresh token rotation for a given user_id. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests. + +When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read Signing Keys.
@@ -3866,10 +4219,13 @@ Modify an email template.
```java -client.emailTemplates().update( - EmailTemplateNameEnum.VERIFY_EMAIL, - UpdateEmailTemplateRequestContent +client.deviceCredentials().createPublicKey( + CreatePublicKeyDeviceCredentialRequestContent .builder() + .deviceName("device_name") + .type("public_key") + .value("value") + .deviceId("device_id") .build() ); ``` @@ -3886,7 +4242,7 @@ client.emailTemplates().update(
-**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy). +**deviceName:** `String` — Name for this device easily recognized by owner.
@@ -3894,7 +4250,7 @@ client.emailTemplates().update(
-**template:** `Optional` +**type:** `String`
@@ -3902,7 +4258,7 @@ client.emailTemplates().update(
-**body:** `Optional` — Body of the email template. +**value:** `String` — Base64 encoded string containing the credential.
@@ -3910,7 +4266,7 @@ client.emailTemplates().update(
-**from:** `Optional` — Senders `from` email address. +**deviceId:** `String` — Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor.
@@ -3918,47 +4274,61 @@ client.emailTemplates().update(
-**resultUrl:** `Optional` — URL to redirect the user to after a successful action. +**clientId:** `Optional` — client_id of the client (application) this credential is for.
+
+
-
-
-**subject:** `Optional` — Subject line of the email. -
+
+
client.deviceCredentials.delete(id)
-**syntax:** `Optional` — Syntax of the template body. - -
-
+#### 📝 Description
-**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. - +
+
+ +Permanently delete a device credential (such as a refresh token or public key) with the given ID.
+
+
+ +#### 🔌 Usage
-**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. - +
+
+ +```java +client.deviceCredentials().delete("id"); +```
+
+
+ +#### ⚙️ Parameters
-**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false). +
+
+ +**id:** `String` — ID of the credential to delete.
@@ -3970,11 +4340,25 @@ client.emailTemplates().update(
-## EventStreams -
client.eventStreams.list() -> List<EventStreamResponseContent> +## EmailTemplates +
client.emailTemplates.create(request) -> CreateEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+
+Create an email template. +
+
+
+
+ #### 🔌 Usage
@@ -3984,11 +4368,10 @@ client.emailTemplates().update(
```java -client.eventStreams().list( - ListEventStreamsRequestParameters +client.emailTemplates().create( + CreateEmailTemplateRequestContent .builder() - .from("from") - .take(1) + .template(EmailTemplateNameEnum.VERIFY_EMAIL) .build() ); ``` @@ -4005,7 +4388,7 @@ client.eventStreams().list(
-**from:** `Optional` — Optional Id from which to start selection. +**template:** `EmailTemplateNameEnum`
@@ -4013,74 +4396,63 @@ client.eventStreams().list(
-**take:** `Optional` — Number of results per page. Defaults to 50. +**body:** `Optional` — Body of the email template.
-
-
+
+
+**from:** `Optional` — Senders `from` email address. +
-
-
client.eventStreams.create(request) -> CreateEventStreamResponseContent
-#### 🔌 Usage +**resultUrl:** `Optional` — URL to redirect the user to after a successful action. + +
+
+**subject:** `Optional` — Subject line of the email. + +
+
+
-```java -client.eventStreams().create( - EventStreamsCreateRequest.of( - CreateEventStreamWebHookRequestContent - .builder() - .destination( - EventStreamWebhookDestination - .builder() - .type("webhook") - .configuration( - EventStreamWebhookConfiguration - .builder() - .webhookEndpoint("webhook_endpoint") - .webhookAuthorization( - EventStreamWebhookAuthorizationResponse.of( - EventStreamWebhookBasicAuth - .builder() - .method("basic") - .username("username") - .build() - ) - ) - .build() - ) - .build() - ) - .build() - ) -); -``` +**syntax:** `Optional` — Syntax of the template body. +
+ +
+
+ +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for. +
-#### ⚙️ Parameters -
+**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true. + +
+
+
-**request:** `EventStreamsCreateRequest` +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false).
@@ -4092,27 +4464,11 @@ client.eventStreams().create(
-
client.eventStreams.get(id) -> GetEventStreamResponseContent -
-
- -#### 🔌 Usage - -
-
- +
client.emailTemplates.get(templateName) -> GetEmailTemplateResponseContent
-```java -client.eventStreams().get("id"); -``` -
-
-
-
- -#### ⚙️ Parameters +#### 📝 Description
@@ -4120,21 +4476,11 @@ client.eventStreams().get("id");
-**id:** `String` — Unique identifier for the event stream. - -
-
+Retrieve an email template by pre-defined name. These names are `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, and `async_approval`. The names `change_password`, and `password_reset` are also supported for legacy scenarios.
- -
-
- -
client.eventStreams.delete(id) -
-
#### 🔌 Usage @@ -4145,7 +4491,7 @@ client.eventStreams().get("id");
```java -client.eventStreams().delete("id"); +client.emailTemplates().get(EmailTemplateNameEnum.VERIFY_EMAIL); ```
@@ -4160,7 +4506,7 @@ client.eventStreams().delete("id");
-**id:** `String` — Unique identifier for the event stream. +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
@@ -4172,10 +4518,24 @@ client.eventStreams().delete("id");
-
client.eventStreams.update(id, request) -> UpdateEventStreamResponseContent +
client.emailTemplates.set(templateName, request) -> SetEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+
+Update an email template. +
+
+
+
+ #### 🔌 Usage
@@ -4185,10 +4545,11 @@ client.eventStreams().delete("id");
```java -client.eventStreams().update( - "id", - UpdateEventStreamRequestContent +client.emailTemplates().set( + EmailTemplateNameEnum.VERIFY_EMAIL, + SetEmailTemplateRequestContent .builder() + .template(EmailTemplateNameEnum.VERIFY_EMAIL) .build() ); ``` @@ -4205,7 +4566,7 @@ client.eventStreams().update(
-**id:** `String` — Unique identifier for the event stream. +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
@@ -4213,7 +4574,7 @@ client.eventStreams().update(
-**name:** `Optional` — Name of the event stream. +**template:** `EmailTemplateNameEnum`
@@ -4221,7 +4582,7 @@ client.eventStreams().update(
-**subscriptions:** `Optional>` — List of event types subscribed to in this stream. +**body:** `Optional` — Body of the email template.
@@ -4229,7 +4590,7 @@ client.eventStreams().update(
-**destination:** `Optional` +**from:** `Optional` — Senders `from` email address.
@@ -4237,54 +4598,31 @@ client.eventStreams().update(
-**status:** `Optional` +**resultUrl:** `Optional` — URL to redirect the user to after a successful action.
-
-
- - -
-
-
-
client.eventStreams.getStats(id) -> GetEventStreamStatsResponseContent
-#### 🔌 Usage - -
-
+**subject:** `Optional` — Subject line of the email. + +
+
-```java -client.eventStreams().getStats( - "id", - EventStreamsGetStatsRequest - .builder() - .dateFrom("date_from") - .dateTo("date_to") - .build() -); -``` -
-
+**syntax:** `Optional` — Syntax of the template body. +
-#### ⚙️ Parameters -
-
-
- -**id:** `String` — Unique identifier for the event stream. +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for.
@@ -4292,7 +4630,7 @@ client.eventStreams().getStats(
-**dateFrom:** `Optional` — The RFC3339 start date for the stats query. +**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.
@@ -4300,7 +4638,7 @@ client.eventStreams().getStats(
-**dateTo:** `Optional` — The RFC3339 end date for the stats query. +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false).
@@ -4312,10 +4650,24 @@ client.eventStreams().getStats(
-
client.eventStreams.test(id, request) -> CreateEventStreamTestEventResponseContent +
client.emailTemplates.update(templateName, request) -> UpdateEmailTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+
+Modify an email template. +
+
+
+
+ #### 🔌 Usage
@@ -4325,11 +4677,10 @@ client.eventStreams().getStats(
```java -client.eventStreams().test( - "id", - CreateEventStreamTestEventRequestContent +client.emailTemplates().update( + EmailTemplateNameEnum.VERIFY_EMAIL, + UpdateEmailTemplateRequestContent .builder() - .eventType(EventStreamTestEventTypeEnum.USER_CREATED) .build() ); ``` @@ -4346,7 +4697,7 @@ client.eventStreams().test(
-**id:** `String` — Unique identifier for the event stream. +**templateName:** `EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
@@ -4354,7 +4705,7 @@ client.eventStreams().test(
-**eventType:** `EventStreamTestEventTypeEnum` +**template:** `Optional`
@@ -4362,56 +4713,31 @@ client.eventStreams().test(
-**data:** `Optional>` +**body:** `Optional` — Body of the email template.
-
-
- - -
-
-
-## Flows -
client.flows.list() -> SyncPagingIterable<FlowSummary>
-#### 🔌 Usage - -
-
+**from:** `Optional` — Senders `from` email address. + +
+
-```java -client.flows().list( - FlowsListRequest - .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .synchronous(true) - .build() -); -``` -
-
+**resultUrl:** `Optional` — URL to redirect the user to after a successful action. +
-#### ⚙️ Parameters - -
-
-
-**page:** `Optional` — Page index of the results to return. First page is 0. +**subject:** `Optional` — Subject line of the email.
@@ -4419,7 +4745,7 @@ client.flows().list(
-**perPage:** `Optional` — Number of results per page. Defaults to 50. +**syntax:** `Optional` — Syntax of the template body.
@@ -4427,7 +4753,7 @@ client.flows().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**urlLifetimeInSeconds:** `Optional` — Lifetime in seconds that the link within the email will be valid for.
@@ -4435,7 +4761,7 @@ client.flows().list(
-**hydrate:** `Optional` — hydration param +**includeEmailInRedirect:** `Optional` — Whether the `reset_email` and `verify_email` templates should include the user's email address as the `email` parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.
@@ -4443,7 +4769,7 @@ client.flows().list(
-**synchronous:** `Optional` — flag to filter by sync/async flows +**enabled:** `Optional` — Whether the template is enabled (true) or disabled (false).
@@ -4455,7 +4781,8 @@ client.flows().list(
-
client.flows.create(request) -> CreateFlowResponseContent +## EventStreams +
client.eventStreams.list() -> ListEventStreamsResponseContent
@@ -4468,10 +4795,15 @@ client.flows().list(
```java -client.flows().create( - CreateFlowRequestContent +client.eventStreams().list( + ListEventStreamsRequestParameters .builder() - .name("name") + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -4488,7 +4820,7 @@ client.flows().create(
-**name:** `String` +**from:** `Optional` — Optional Id from which to start selection.
@@ -4496,7 +4828,7 @@ client.flows().create(
-**actions:** `Optional>` +**take:** `Optional` — Number of results per page. Defaults to 50.
@@ -4508,7 +4840,7 @@ client.flows().create(
-
client.flows.get(id) -> GetFlowResponseContent +
client.eventStreams.create(request) -> CreateEventStreamResponseContent
@@ -4521,11 +4853,33 @@ client.flows().create(
```java -client.flows().get( - "id", - GetFlowRequestParameters - .builder() - .build() +client.eventStreams().create( + EventStreamsCreateRequest.of( + CreateEventStreamWebHookRequestContent + .builder() + .destination( + EventStreamWebhookDestination + .builder() + .type("webhook") + .configuration( + EventStreamWebhookConfiguration + .builder() + .webhookEndpoint("webhook_endpoint") + .webhookAuthorization( + EventStreamWebhookAuthorizationResponse.of( + EventStreamWebhookBasicAuth + .builder() + .method("basic") + .username("username") + .build() + ) + ) + .build() + ) + .build() + ) + .build() + ) ); ```
@@ -4541,15 +4895,47 @@ client.flows().get(
-**id:** `String` — Flow identifier +**request:** `EventStreamsCreateRequest`
+ +
+ + + + +
+ +
client.eventStreams.get(id) -> GetEventStreamResponseContent +
+
+ +#### 🔌 Usage
-**hydrate:** `Optional` — hydration param +
+
+ +```java +client.eventStreams().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the event stream.
@@ -4561,7 +4947,7 @@ client.flows().get(
-
client.flows.delete(id) +
client.eventStreams.delete(id)
@@ -4574,7 +4960,7 @@ client.flows().get(
```java -client.flows().delete("id"); +client.eventStreams().delete("id"); ```
@@ -4589,7 +4975,7 @@ client.flows().delete("id");
-**id:** `String` — Flow id +**id:** `String` — Unique identifier for the event stream.
@@ -4601,7 +4987,7 @@ client.flows().delete("id");
-
client.flows.update(id, request) -> UpdateFlowResponseContent +
client.eventStreams.update(id, request) -> UpdateEventStreamResponseContent
@@ -4614,9 +5000,9 @@ client.flows().delete("id");
```java -client.flows().update( +client.eventStreams().update( "id", - UpdateFlowRequestContent + UpdateEventStreamRequestContent .builder() .build() ); @@ -4634,7 +5020,7 @@ client.flows().update(
-**id:** `String` — Flow identifier +**id:** `String` — Unique identifier for the event stream.
@@ -4642,7 +5028,7 @@ client.flows().update(
-**name:** `Optional` +**name:** `Optional` — Name of the event stream.
@@ -4650,7 +5036,23 @@ client.flows().update(
-**actions:** `Optional>` +**subscriptions:** `Optional>` — List of event types subscribed to in this stream. + +
+
+ +
+
+ +**destination:** `Optional` + +
+
+ +
+
+ +**status:** `Optional`
@@ -4662,8 +5064,7 @@ client.flows().update(
-## Forms -
client.forms.list() -> SyncPagingIterable<FormSummary> +
client.eventStreams.test(id, request) -> CreateEventStreamTestEventResponseContent
@@ -4676,12 +5077,11 @@ client.flows().update(
```java -client.forms().list( - ListFormsRequestParameters +client.eventStreams().test( + "id", + CreateEventStreamTestEventRequestContent .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .eventType(EventStreamTestEventTypeEnum.USER_CREATED) .build() ); ``` @@ -4698,15 +5098,7 @@ client.forms().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. - -
-
- -
-
- -**perPage:** `Optional` — Number of results per page. Defaults to 50. +**id:** `String` — Unique identifier for the event stream.
@@ -4714,7 +5106,7 @@ client.forms().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**eventType:** `EventStreamTestEventTypeEnum`
@@ -4722,7 +5114,7 @@ client.forms().list(
-**hydrate:** `Optional` — Query parameter to hydrate the response with additional data +**data:** `Optional>`
@@ -4734,7 +5126,8 @@ client.forms().list(
-
client.forms.create(request) -> CreateFormResponseContent +## Flows +
client.flows.list() -> SyncPagingIterable<FlowSummary>
@@ -4747,10 +5140,21 @@ client.forms().list(
```java -client.forms().create( - CreateFormRequestContent +client.flows().list( + FlowsListRequest .builder() - .name("name") + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .synchronous( + OptionalNullable.of(true) + ) .build() ); ``` @@ -4767,7 +5171,7 @@ client.forms().create(
-**name:** `String` +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -4775,7 +5179,7 @@ client.forms().create(
-**messages:** `Optional` +**perPage:** `Optional` — Number of results per page. Defaults to 50.
@@ -4783,7 +5187,7 @@ client.forms().create(
-**languages:** `Optional` +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -4791,7 +5195,7 @@ client.forms().create(
-**translations:** `Optional>` +**hydrate:** `Optional` — hydration param
@@ -4799,23 +5203,52 @@ client.forms().create(
-**nodes:** `Optional>` +**synchronous:** `Optional` — flag to filter by sync/async flows
+
+
+ + + + +
+ +
client.flows.create(request) -> CreateFlowResponseContent +
+
+ +#### 🔌 Usage
-**start:** `Optional` - +
+
+ +```java +client.flows().create( + CreateFlowRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**ending:** `Optional` +
+
+ +**name:** `String`
@@ -4823,7 +5256,7 @@ client.forms().create(
-**style:** `Optional` +**actions:** `Optional>`
@@ -4835,7 +5268,7 @@ client.forms().create(
-
client.forms.get(id) -> GetFormResponseContent +
client.flows.get(id) -> GetFlowResponseContent
@@ -4848,9 +5281,9 @@ client.forms().create(
```java -client.forms().get( +client.flows().get( "id", - GetFormRequestParameters + GetFlowRequestParameters .builder() .build() ); @@ -4868,7 +5301,7 @@ client.forms().get(
-**id:** `String` — The ID of the form to retrieve. +**id:** `String` — Flow identifier
@@ -4876,7 +5309,7 @@ client.forms().get(
-**hydrate:** `Optional` — Query parameter to hydrate the response with additional data +**hydrate:** `Optional` — hydration param
@@ -4888,7 +5321,7 @@ client.forms().get(
-
client.forms.delete(id) +
client.flows.delete(id)
@@ -4901,7 +5334,7 @@ client.forms().get(
```java -client.forms().delete("id"); +client.flows().delete("id"); ```
@@ -4916,7 +5349,7 @@ client.forms().delete("id");
-**id:** `String` — The ID of the form to delete. +**id:** `String` — Flow id
@@ -4928,7 +5361,7 @@ client.forms().delete("id");
-
client.forms.update(id, request) -> UpdateFormResponseContent +
client.flows.update(id, request) -> UpdateFlowResponseContent
@@ -4941,9 +5374,9 @@ client.forms().delete("id");
```java -client.forms().update( +client.flows().update( "id", - UpdateFormRequestContent + UpdateFlowRequestContent .builder() .build() ); @@ -4961,7 +5394,7 @@ client.forms().update(
-**id:** `String` — The ID of the form to update. +**id:** `String` — Flow identifier
@@ -4977,31 +5410,61 @@ client.forms().update(
-**messages:** `Optional` +**actions:** `Optional>`
+
+
-
-
-**languages:** `Optional` -
+
+ +## Forms +
client.forms.list() -> SyncPagingIterable<FormSummary> +
+
+ +#### 🔌 Usage
-**translations:** `Optional>` - +
+
+ +```java +client.forms().list( + ListFormsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**nodes:** `Optional>` +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -5009,7 +5472,7 @@ client.forms().update(
-**start:** `Optional` +**perPage:** `Optional` — Number of results per page. Defaults to 50.
@@ -5017,7 +5480,7 @@ client.forms().update(
-**ending:** `Optional` +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -5025,7 +5488,7 @@ client.forms().update(
-**style:** `Optional` +**hydrate:** `Optional` — Query parameter to hydrate the response with additional data
@@ -5037,12 +5500,11 @@ client.forms().update(
-## UserGrants -
client.userGrants.list() -> SyncPagingIterable<UserGrant> +
client.forms.create(request) -> CreateFormResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -5050,13 +5512,20 @@ client.forms().update(
-Retrieve the grants associated with your account. +```java +client.forms().create( + CreateFormRequestContent + .builder() + .name("name") + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -5064,33 +5533,23 @@ Retrieve the g
-```java -client.userGrants().list( - ListUserGrantsRequestParameters - .builder() - .perPage(1) - .page(1) - .includeTotals(true) - .userId("user_id") - .clientId("client_id") - .audience("audience") - .build() -); -``` -
-
+**name:** `String` +
-#### ⚙️ Parameters -
+**messages:** `Optional` + +
+
+
-**perPage:** `Optional` — Number of results per page. +**languages:** `Optional`
@@ -5098,7 +5557,7 @@ client.userGrants().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. +**translations:** `Optional>>`
@@ -5106,7 +5565,7 @@ client.userGrants().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**nodes:** `Optional>`
@@ -5114,7 +5573,7 @@ client.userGrants().list(
-**userId:** `Optional` — user_id of the grants to retrieve. +**start:** `Optional`
@@ -5122,7 +5581,7 @@ client.userGrants().list(
-**clientId:** `Optional` — client_id of the grants to retrieve. +**ending:** `Optional`
@@ -5130,7 +5589,7 @@ client.userGrants().list(
-**audience:** `Optional` — audience of the grants to retrieve. +**style:** `Optional`
@@ -5142,24 +5601,10 @@ client.userGrants().list(
-
client.userGrants.deleteByUserId() -
-
- -#### 📝 Description - -
-
- +
client.forms.get(id) -> GetFormResponseContent
-Delete a grant associated with your account. -
-
-
-
- #### 🔌 Usage
@@ -5169,10 +5614,10 @@ Delete a grant associated with your account.
```java -client.userGrants().deleteByUserId( - DeleteUserGrantByUserIdRequestParameters +client.forms().get( + "id", + GetFormRequestParameters .builder() - .userId("user_id") .build() ); ``` @@ -5189,7 +5634,15 @@ client.userGrants().deleteByUserId(
-**userId:** `String` — user_id of the grant to delete. +**id:** `String` — The ID of the form to retrieve. + +
+
+ +
+
+ +**hydrate:** `Optional` — Query parameter to hydrate the response with additional data
@@ -5201,24 +5654,10 @@ client.userGrants().deleteByUserId(
-
client.userGrants.delete(id) -
-
- -#### 📝 Description - -
-
- +
client.forms.delete(id)
-Delete a grant associated with your account. -
-
-
-
- #### 🔌 Usage
@@ -5228,7 +5667,7 @@ Delete a grant associated with your account.
```java -client.userGrants().delete("id"); +client.forms().delete("id"); ```
@@ -5243,7 +5682,7 @@ client.userGrants().delete("id");
-**id:** `String` — ID of the grant to delete. +**id:** `String` — The ID of the form to delete.
@@ -5255,12 +5694,11 @@ client.userGrants().delete("id");
-## Hooks -
client.hooks.list() -> SyncPagingIterable<Hook> +
client.forms.update(id, request) -> UpdateFormResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -5268,13 +5706,20 @@ client.userGrants().delete("id");
-Retrieve all hooks. Accepts a list of fields to include or exclude in the result. +```java +client.forms().update( + "id", + UpdateFormRequestContent + .builder() + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -5282,33 +5727,31 @@ Retrieve all hooks. Accepts a list of
-```java -client.hooks().list( - ListHooksRequestParameters - .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .enabled(true) - .fields("fields") - .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) - .build() -); -``` +**id:** `String` — The ID of the form to update. +
+ +
+
+ +**name:** `Optional` +
-#### ⚙️ Parameters -
+**messages:** `Optional` + +
+
+
-**page:** `Optional` — Page index of the results to return. First page is 0. +**languages:** `Optional`
@@ -5316,7 +5759,7 @@ client.hooks().list(
-**perPage:** `Optional` — Number of results per page. +**translations:** `Optional>>`
@@ -5324,7 +5767,7 @@ client.hooks().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**nodes:** `Optional>`
@@ -5332,7 +5775,7 @@ client.hooks().list(
-**enabled:** `Optional` — Optional filter on whether a hook is enabled (true) or disabled (false). +**start:** `Optional`
@@ -5340,7 +5783,7 @@ client.hooks().list(
-**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. +**ending:** `Optional`
@@ -5348,7 +5791,7 @@ client.hooks().list(
-**triggerId:** `Optional` — Retrieves hooks that match the trigger +**style:** `Optional`
@@ -5360,7 +5803,8 @@ client.hooks().list(
-
client.hooks.create(request) -> CreateHookResponseContent +## UserGrants +
client.userGrants.list() -> SyncPagingIterable<UserGrant>
@@ -5372,7 +5816,7 @@ client.hooks().list(
-Create a new hook. +Retrieve the grants associated with your account.
@@ -5387,12 +5831,27 @@ Create a new hook.
```java -client.hooks().create( - CreateHookRequestContent +client.userGrants().list( + ListUserGrantsRequestParameters .builder() - .name("name") - .script("script") - .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .perPage( + OptionalNullable.of(1) + ) + .page( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .userId( + OptionalNullable.of("user_id") + ) + .clientId( + OptionalNullable.of("client_id") + ) + .audience( + OptionalNullable.of("audience") + ) .build() ); ``` @@ -5409,7 +5868,7 @@ client.hooks().create(
-**name:** `String` — Name of this hook. +**perPage:** `Optional` — Number of results per page.
@@ -5417,7 +5876,7 @@ client.hooks().create(
-**script:** `String` — Code to be executed when this hook runs. +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -5425,7 +5884,7 @@ client.hooks().create(
-**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -5433,7 +5892,7 @@ client.hooks().create(
-**dependencies:** `Optional>` +**userId:** `Optional` — user_id of the grants to retrieve.
@@ -5441,7 +5900,15 @@ client.hooks().create(
-**triggerId:** `HookTriggerIdEnum` +**clientId:** `Optional` — client_id of the grants to retrieve. + +
+
+ +
+
+ +**audience:** `Optional` — audience of the grants to retrieve.
@@ -5453,7 +5920,7 @@ client.hooks().create(
-
client.hooks.get(id) -> GetHookResponseContent +
client.userGrants.deleteByUserId()
@@ -5465,7 +5932,7 @@ client.hooks().create(
-Retrieve a hook by its ID. Accepts a list of fields to include in the result. +Delete a grant associated with your account.
@@ -5480,11 +5947,10 @@ Retrieve a hook by its ID. Accepts a
```java -client.hooks().get( - "id", - GetHookRequestParameters +client.userGrants().deleteByUserId( + DeleteUserGrantByUserIdRequestParameters .builder() - .fields("fields") + .userId("user_id") .build() ); ``` @@ -5501,15 +5967,7 @@ client.hooks().get(
-**id:** `String` — ID of the hook to retrieve. - -
-
- -
-
- -**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields. +**userId:** `String` — user_id of the grant to delete.
@@ -5521,7 +5979,7 @@ client.hooks().get(
-
client.hooks.delete(id) +
client.userGrants.delete(id)
@@ -5533,7 +5991,7 @@ client.hooks().get(
-Delete a hook. +Delete a grant associated with your account.
@@ -5548,7 +6006,7 @@ Delete a hook.
```java -client.hooks().delete("id"); +client.userGrants().delete("id"); ```
@@ -5563,7 +6021,7 @@ client.hooks().delete("id");
-**id:** `String` — ID of the hook to delete. +**id:** `String` — ID of the grant to delete.
@@ -5575,7 +6033,8 @@ client.hooks().delete("id");
-
client.hooks.update(id, request) -> UpdateHookResponseContent +## Hooks +
client.hooks.list() -> SyncPagingIterable<Hook>
@@ -5587,7 +6046,7 @@ client.hooks().delete("id");
-Update an existing hook. +Retrieve all hooks. Accepts a list of fields to include or exclude in the result.
@@ -5602,10 +6061,27 @@ Update an existing hook.
```java -client.hooks().update( - "id", - UpdateHookRequestContent +client.hooks().list( + ListHooksRequestParameters .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .enabled( + OptionalNullable.of(true) + ) + .fields( + OptionalNullable.of("fields") + ) + .triggerId( + OptionalNullable.of(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + ) .build() ); ``` @@ -5622,7 +6098,7 @@ client.hooks().update(
-**id:** `String` — ID of the hook to update. +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -5630,7 +6106,7 @@ client.hooks().update(
-**name:** `Optional` — Name of this hook. +**perPage:** `Optional` — Number of results per page.
@@ -5638,7 +6114,7 @@ client.hooks().update(
-**script:** `Optional` — Code to be executed when this hook runs. +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -5646,7 +6122,15 @@ client.hooks().update(
-**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). +**enabled:** `Optional` — Optional filter on whether a hook is enabled (true) or disabled (false). + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.
@@ -5654,7 +6138,7 @@ client.hooks().update(
-**dependencies:** `Optional>` +**triggerId:** `Optional` — Retrieves hooks that match the trigger
@@ -5666,8 +6150,7 @@ client.hooks().update(
-## Jobs -
client.jobs.get(id) -> GetJobResponseContent +
client.hooks.create(request) -> CreateHookResponseContent
@@ -5679,7 +6162,7 @@ client.hooks().update(
-Retrieves a job. Useful to check its status. +Create a new hook.
@@ -5694,7 +6177,14 @@ Retrieves a job. Useful to check its status.
```java -client.jobs().get("id"); +client.hooks().create( + CreateHookRequestContent + .builder() + .name("name") + .script("script") + .triggerId(HookTriggerIdEnum.CREDENTIALS_EXCHANGE) + .build() +); ```
@@ -5709,113 +6199,40 @@ client.jobs().get("id");
-**id:** `String` — ID of the job. +**name:** `String` — Name of this hook.
- - +
+
+**script:** `String` — Code to be executed when this hook runs. +
-
-## LogStreams -
client.logStreams.list() -> List<LogStreamResponseSchema>
-#### 📝 Description - -
-
+**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). + +
+
-Retrieve details on log streams. -
Sample Response
[{
-	"id": "string",
-	"name": "string",
-	"type": "eventbridge",
-	"status": "active|paused|suspended",
-	"sink": {
-		"awsAccountId": "string",
-		"awsRegion": "string",
-		"awsPartnerEventSource": "string"
-	}
-}, {
-	"id": "string",
-	"name": "string",
-	"type": "http",
-	"status": "active|paused|suspended",
-	"sink": {
-		"httpContentFormat": "JSONLINES|JSONARRAY",
-		"httpContentType": "string",
-		"httpEndpoint": "string",
-		"httpAuthorization": "string"
-	}
-},
-{
-	"id": "string",
-	"name": "string",
-	"type": "eventgrid",
-	"status": "active|paused|suspended",
-	"sink": {
-		"azureSubscriptionId": "string",
-		"azureResourceGroup": "string",
-		"azureRegion": "string",
-		"azurePartnerTopic": "string"
-	}
-},
-{
-	"id": "string",
-	"name": "string",
-	"type": "splunk",
-	"status": "active|paused|suspended",
-	"sink": {
-		"splunkDomain": "string",
-		"splunkToken": "string",
-		"splunkPort": "string",
-		"splunkSecure": "boolean"
-	}
-},
-{
-	"id": "string",
-	"name": "string",
-	"type": "sumo",
-	"status": "active|paused|suspended",
-	"sink": {
-		"sumoSourceAddress": "string",
-	}
-},
-{
-	"id": "string",
-	"name": "string",
-	"type": "datadog",
-	"status": "active|paused|suspended",
-	"sink": {
-		"datadogRegion": "string",
-		"datadogApiKey": "string"
-	}
-}]
-
-
+**dependencies:** `Optional>` +
-#### 🔌 Usage - -
-
-
-```java -client.logStreams().list(); -``` +**triggerId:** `HookTriggerIdEnum` +
@@ -5826,7 +6243,7 @@ client.logStreams().list();
-
client.logStreams.create(request) -> CreateLogStreamResponseContent +
client.hooks.get(id) -> GetHookResponseContent
@@ -5838,132 +6255,7 @@ client.logStreams().list();
-Create a log stream. -
Log Stream Types
The type of log stream being created determines the properties required in the sink payload. -
HTTP Stream
For an http Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "http",
-	"sink": {
-		"httpEndpoint": "string",
-		"httpContentType": "string",
-		"httpContentFormat": "JSONLINES|JSONARRAY",
-		"httpAuthorization": "string"
-	}
-}
-Response:
{
-	"id": "string",
-	"name": "string",
-	"type": "http",
-	"status": "active",
-	"sink": {
-		"httpEndpoint": "string",
-		"httpContentType": "string",
-		"httpContentFormat": "JSONLINES|JSONARRAY",
-		"httpAuthorization": "string"
-	}
-}
-
Amazon EventBridge Stream
For an eventbridge Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "eventbridge",
-	"sink": {
-		"awsRegion": "string",
-		"awsAccountId": "string"
-	}
-}
-The response will include an additional field awsPartnerEventSource in the sink:
{
-	"id": "string",
-	"name": "string",
-	"type": "eventbridge",
-	"status": "active",
-	"sink": {
-		"awsAccountId": "string",
-		"awsRegion": "string",
-		"awsPartnerEventSource": "string"
-	}
-}
-
Azure Event Grid Stream
For an Azure Event Grid Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "eventgrid",
-	"sink": {
-		"azureSubscriptionId": "string",
-		"azureResourceGroup": "string",
-		"azureRegion": "string"
-	}
-}
-Response:
{
-	"id": "string",
-	"name": "string",
-	"type": "http",
-	"status": "active",
-	"sink": {
-		"azureSubscriptionId": "string",
-		"azureResourceGroup": "string",
-		"azureRegion": "string",
-		"azurePartnerTopic": "string"
-	}
-}
-
Datadog Stream
For a Datadog Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "datadog",
-	"sink": {
-		"datadogRegion": "string",
-		"datadogApiKey": "string"
-	}
-}
-Response:
{
-	"id": "string",
-	"name": "string",
-	"type": "datadog",
-	"status": "active",
-	"sink": {
-		"datadogRegion": "string",
-		"datadogApiKey": "string"
-	}
-}
-
Splunk Stream
For a Splunk Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "splunk",
-	"sink": {
-		"splunkDomain": "string",
-		"splunkToken": "string",
-		"splunkPort": "string",
-		"splunkSecure": "boolean"
-	}
-}
-Response:
{
-	"id": "string",
-	"name": "string",
-	"type": "splunk",
-	"status": "active",
-	"sink": {
-		"splunkDomain": "string",
-		"splunkToken": "string",
-		"splunkPort": "string",
-		"splunkSecure": "boolean"
-	}
-}
-
Sumo Logic Stream
For a Sumo Logic Stream, the sink properties are listed in the payload below -Request:
{
-	"name": "string",
-	"type": "sumo",
-	"sink": {
-		"sumoSourceAddress": "string",
-	}
-}
-Response:
{
-	"id": "string",
-	"name": "string",
-	"type": "sumo",
-	"status": "active",
-	"sink": {
-		"sumoSourceAddress": "string",
-	}
-}
+Retrieve a hook by its ID. Accepts a list of fields to include in the result.
@@ -5978,19 +6270,14 @@ Response:
{
 
```java -client.logStreams().create( - CreateLogStreamRequestContent.of( - CreateLogStreamHttpRequestBody - .builder() - .type("http") - .sink( - LogStreamHttpSink - .builder() - .httpEndpoint("httpEndpoint") - .build() - ) - .build() - ) +client.hooks().get( + "id", + GetHookRequestParameters + .builder() + .fields( + OptionalNullable.of("fields") + ) + .build() ); ```
@@ -6006,7 +6293,15 @@ client.logStreams().create(
-**request:** `CreateLogStreamRequestContent` +**id:** `String` — ID of the hook to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.
@@ -6018,7 +6313,7 @@ client.logStreams().create(
-
client.logStreams.get(id) -> GetLogStreamResponseContent +
client.hooks.delete(id)
@@ -6030,8 +6325,209 @@ client.logStreams().create(
-Retrieve a log stream configuration and status. -
Sample responses
Amazon EventBridge Log Stream
{
+Delete a hook.
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to delete. + +
+
+
+
+ + + + +
+ +
client.hooks.update(id, request) -> UpdateHookResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing hook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().update( + "id", + UpdateHookRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the hook to update. + +
+
+ +
+
+ +**name:** `Optional` — Name of this hook. + +
+
+ +
+
+ +**script:** `Optional` — Code to be executed when this hook runs. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether this hook will be executed (true) or ignored (false). + +
+
+ +
+
+ +**dependencies:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## Jobs +
client.jobs.get(id) -> GetJobResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a job. Useful to check its status. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.jobs().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the job. + +
+
+
+
+ + +
+
+
+ +## LogStreams +
client.logStreams.list() -> List<LogStreamResponseSchema> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details on log streams. +
Sample Response
[{
 	"id": "string",
 	"name": "string",
 	"type": "eventbridge",
@@ -6041,7 +6537,7 @@ Retrieve a log stream configuration and status.
 		"awsRegion": "string",
 		"awsPartnerEventSource": "string"
 	}
-}
HTTP Log Stream
{
+}, {
 	"id": "string",
 	"name": "string",
 	"type": "http",
@@ -6052,7 +6548,41 @@ Retrieve a log stream configuration and status.
 		"httpEndpoint": "string",
 		"httpAuthorization": "string"
 	}
-}
Datadog Log Stream
{
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "eventgrid",
+	"status": "active|paused|suspended",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string",
+		"azurePartnerTopic": "string"
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active|paused|suspended",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+},
+{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active|paused|suspended",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+},
+{
 	"id": "string",
 	"name": "string",
 	"type": "datadog",
@@ -6061,77 +6591,171 @@ Retrieve a log stream configuration and status.
 		"datadogRegion": "string",
 		"datadogApiKey": "string"
 	}
+}]
+
+
+
+
-}
Mixpanel
- - Request:
{
-	  "name": "string",
-	  "type": "mixpanel",
-	  "sink": {
-		"mixpanelRegion": "string", // "us" | "eu",
-		"mixpanelProjectId": "string",
-		"mixpanelServiceAccountUsername": "string",
-		"mixpanelServiceAccountPassword": "string"
-	  }
-	} 
- - - Response:
{
-		"id": "string",
-		"name": "string",
-		"type": "mixpanel",
-		"status": "active",
-		"sink": {
-		  "mixpanelRegion": "string", // "us" | "eu",
-		  "mixpanelProjectId": "string",
-		  "mixpanelServiceAccountUsername": "string",
-		  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
-		}
-	  } 
+#### 🔌 Usage -
Segment
+
+
- Request:
 {
-	  "name": "string",
-	  "type": "segment",
-	  "sink": {
-		"segmentWriteKey": "string"
-	  }
-	}
- - Response:
{
-	  "id": "string",
-	  "name": "string",
-	  "type": "segment",
-	  "status": "active",
-	  "sink": {
-		"segmentWriteKey": "string"
-	  }
-	} 
- -
Splunk Log Stream
{
+
+
+ +```java +client.logStreams().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.logStreams.create(request) -> CreateLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a log stream. +
Log Stream Types
The type of log stream being created determines the properties required in the sink payload. +
HTTP Stream
For an http Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "http",
+	"sink": {
+		"httpEndpoint": "string",
+		"httpContentType": "string",
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpAuthorization": "string"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active",
+	"sink": {
+		"httpEndpoint": "string",
+		"httpContentType": "string",
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpAuthorization": "string"
+	}
+}
+
Amazon EventBridge Stream
For an eventbridge Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "eventbridge",
+	"sink": {
+		"awsRegion": "string",
+		"awsAccountId": "string"
+	}
+}
+The response will include an additional field awsPartnerEventSource in the sink:
{
+	"id": "string",
+	"name": "string",
+	"type": "eventbridge",
+	"status": "active",
+	"sink": {
+		"awsAccountId": "string",
+		"awsRegion": "string",
+		"awsPartnerEventSource": "string"
+	}
+}
+
Azure Event Grid Stream
For an Azure Event Grid Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "eventgrid",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string"
+	}
+}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active",
+	"sink": {
+		"azureSubscriptionId": "string",
+		"azureResourceGroup": "string",
+		"azureRegion": "string",
+		"azurePartnerTopic": "string"
+	}
+}
+
Datadog Stream
For a Datadog Stream, the sink properties are listed in the payload below +Request:
{
+	"name": "string",
+	"type": "datadog",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+}
+Response:
{
 	"id": "string",
+	"name": "string",
+	"type": "datadog",
+	"status": "active",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+}
+
Splunk Stream
For a Splunk Stream, the sink properties are listed in the payload below +Request:
{
 	"name": "string",
 	"type": "splunk",
-	"status": "active|paused|suspended",
 	"sink": {
 		"splunkDomain": "string",
 		"splunkToken": "string",
 		"splunkPort": "string",
 		"splunkSecure": "boolean"
 	}
-}
Sumo Logic Log Stream
{
+}
+Response:
{
 	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+}
+
Sumo Logic Stream
For a Sumo Logic Stream, the sink properties are listed in the payload below +Request:
{
 	"name": "string",
 	"type": "sumo",
-	"status": "active|paused|suspended",
 	"sink": {
 		"sumoSourceAddress": "string",
 	}
-}
Status
The status of a log stream maybe any of the following: -1. active - Stream is currently enabled. -2. paused - Stream is currently user disabled and will not attempt log delivery. -3. suspended - Stream is currently disabled because of errors and will not attempt log delivery. +}
+Response:
{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+}
@@ -6145,23 +6769,2873 @@ Retrieve a log stream configuration and status.
-```java -client.logStreams().get("id"); -``` -
-
+```java +client.logStreams().create( + CreateLogStreamRequestContent.of( + CreateLogStreamHttpRequestBody + .builder() + .type("http") + .sink( + LogStreamHttpSink + .builder() + .httpEndpoint("httpEndpoint") + .build() + ) + .build() + ) +); +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateLogStreamRequestContent` + +
+
+
+
+ + + + +
+ +
client.logStreams.get(id) -> GetLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a log stream configuration and status. +
Sample responses
Amazon EventBridge Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "eventbridge",
+	"status": "active|paused|suspended",
+	"sink": {
+		"awsAccountId": "string",
+		"awsRegion": "string",
+		"awsPartnerEventSource": "string"
+	}
+}
HTTP Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "http",
+	"status": "active|paused|suspended",
+	"sink": {
+		"httpContentFormat": "JSONLINES|JSONARRAY",
+		"httpContentType": "string",
+		"httpEndpoint": "string",
+		"httpAuthorization": "string"
+	}
+}
Datadog Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "datadog",
+	"status": "active|paused|suspended",
+	"sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+	}
+
+}
Mixpanel
+ + Request:
{
+	  "name": "string",
+	  "type": "mixpanel",
+	  "sink": {
+		"mixpanelRegion": "string", // "us" | "eu",
+		"mixpanelProjectId": "string",
+		"mixpanelServiceAccountUsername": "string",
+		"mixpanelServiceAccountPassword": "string"
+	  }
+	} 
+ + + Response:
{
+		"id": "string",
+		"name": "string",
+		"type": "mixpanel",
+		"status": "active",
+		"sink": {
+		  "mixpanelRegion": "string", // "us" | "eu",
+		  "mixpanelProjectId": "string",
+		  "mixpanelServiceAccountUsername": "string",
+		  "mixpanelServiceAccountPassword": "string" // the following is redacted on return
+		}
+	  } 
+ +
Segment
+ + Request:
 {
+	  "name": "string",
+	  "type": "segment",
+	  "sink": {
+		"segmentWriteKey": "string"
+	  }
+	}
+ + Response:
{
+	  "id": "string",
+	  "name": "string",
+	  "type": "segment",
+	  "status": "active",
+	  "sink": {
+		"segmentWriteKey": "string"
+	  }
+	} 
+ +
Splunk Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "splunk",
+	"status": "active|paused|suspended",
+	"sink": {
+		"splunkDomain": "string",
+		"splunkToken": "string",
+		"splunkPort": "string",
+		"splunkSecure": "boolean"
+	}
+}
Sumo Logic Log Stream
{
+	"id": "string",
+	"name": "string",
+	"type": "sumo",
+	"status": "active|paused|suspended",
+	"sink": {
+		"sumoSourceAddress": "string",
+	}
+}
Status
The status of a log stream maybe any of the following: +1. active - Stream is currently enabled. +2. paused - Stream is currently user disabled and will not attempt log delivery. +3. suspended - Stream is currently disabled because of errors and will not attempt log delivery. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to get + +
+
+
+
+ + +
+
+
+ +
client.logStreams.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a log stream. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to delete + +
+
+
+
+ + +
+
+
+ +
client.logStreams.update(id, request) -> UpdateLogStreamResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a log stream. +

Examples of how to use the PATCH endpoint.

The following fields may be updated in a PATCH operation:
  • name
  • status
  • sink
Note: For log streams of type eventbridge and eventgrid, updating the sink is not permitted. +
Update the status of a log stream
{
+	"status": "active|paused"
+}
+
Update the name of a log stream
{
+	"name": "string"
+}
+
Update the sink properties of a stream of type http
{
+  "sink": {
+    "httpEndpoint": "string",
+    "httpContentType": "string",
+    "httpContentFormat": "JSONARRAY|JSONLINES",
+    "httpAuthorization": "string"
+  }
+}
+
Update the sink properties of a stream of type datadog
{
+  "sink": {
+		"datadogRegion": "string",
+		"datadogApiKey": "string"
+  }
+}
+
Update the sink properties of a stream of type splunk
{
+  "sink": {
+    "splunkDomain": "string",
+    "splunkToken": "string",
+    "splunkPort": "string",
+    "splunkSecure": "boolean"
+  }
+}
+
Update the sink properties of a stream of type sumo
{
+  "sink": {
+    "sumoSourceAddress": "string"
+  }
+}
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logStreams().update( + "id", + UpdateLogStreamRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the log stream to get + +
+
+ +
+
+ +**name:** `Optional` — log stream name + +
+
+ +
+
+ +**status:** `Optional` + +
+
+ +
+
+ +**isPriority:** `Optional` — True for priority log streams, false for non-priority + +
+
+ +
+
+ +**filters:** `Optional>` — Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. + +
+
+ +
+
+ +**piiConfig:** `Optional` + +
+
+ +
+
+ +**sink:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Logs +
client.logs.list() -> SyncPagingIterable<Log> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). + +Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + +For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + +
To set custom search criteria, use the following parameters:
+ +
    +
  • q: Search Criteria using Query String Syntax
  • +
  • page: Page index of the results to return. First page is 0.
  • +
  • per_page: Number of results per page.
  • +
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • +
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • +
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • +
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • +
+ +For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + +Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + +
To search from a checkpoint log ID, use the following parameters:
+
    +
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • +
  • take: Number of entries to retrieve when using the from parameter.
  • +
+ +Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().list( + ListLogsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .sort( + OptionalNullable.of("sort") + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .search( + OptionalNullable.of("search") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Paging is disabled if parameter not sent. Default: 50. Max value: 100 + +
+
+ +
+
+ +**sort:** `Optional` — Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1 + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false) + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results as an array when false (default). Return results inside an object that also contains a total result count when true. + +
+
+ +
+
+ +**search:** `Optional` + +Retrieves logs that match the specified search criteria. This parameter can be combined with all the others in the /api/logs endpoint but is specified separately for clarity. +If no fields are provided a case insensitive 'starts with' search is performed on all of the following fields: client_name, connection, user_name. Otherwise, you can specify multiple fields and specify the search using the %field%:%search%, for example: application:node user:"John@contoso.com". +Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses. + +
+
+
+
+ + +
+
+
+ +
client.logs.get(id) -> GetLogResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve an individual log event. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.logs().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — log_id of the log to retrieve. + +
+
+
+
+ + +
+
+
+ +## NetworkAcls +
client.networkAcls.list() -> SyncPagingIterable<NetworkAclsResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all access control list entries for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().list( + ListNetworkAclsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — The amount of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.create(request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().create( + CreateNetworkAclRequestContent + .builder() + .description("description") + .active(true) + .priority(1.1) + .rule( + NetworkAclRule + .builder() + .action( + NetworkAclAction + .builder() + .build() + ) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**active:** `Boolean` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `NetworkAclRule` + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.get(id) -> GetNetworkAclsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific access control list entry for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the access control list to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.set(id, request) -> SetNetworkAclsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().set( + "id", + SetNetworkAclRequestContent + .builder() + .description("description") + .active(true) + .priority(1.1) + .rule( + NetworkAclRule + .builder() + .action( + NetworkAclAction + .builder() + .build() + ) + .scope(NetworkAclRuleScopeEnum.MANAGEMENT) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to update. + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**active:** `Boolean` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `NetworkAclRule` + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to delete + +
+
+
+
+ + +
+
+
+ +
client.networkAcls.update(id, request) -> UpdateNetworkAclResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update existing access control list for your client. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.networkAcls().update( + "id", + UpdateNetworkAclRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The id of the ACL to update. + +
+
+ +
+
+ +**description:** `Optional` + +
+
+ +
+
+ +**active:** `Optional` — Indicates whether or not this access control list is actively being used + +
+
+ +
+
+ +**priority:** `Optional` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. + +
+
+ +
+
+ +**rule:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Organizations +
client.organizations.list() -> SyncPagingIterable<Organization> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + +This endpoint supports two types of pagination: +
    +
  • Offset pagination
  • +
  • Checkpoint pagination
  • +
+ +Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. + +

Checkpoint Pagination

+ +To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total number of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().list( + ListOrganizationsRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .sort( + OptionalNullable.of("sort") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1. We currently support sorting by the following fields: name, display_name and created_at. + +
+
+
+
+ + +
+
+
+ +
client.organizations.create(request) -> CreateOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review Create Your First Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().create( + CreateOrganizationRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — The name of this organization. + +
+
+ +
+
+ +**displayName:** `Optional` — Friendly name of this organization. + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>>` + +
+
+ +
+
+ +**enabledConnections:** `Optional>` — Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed) + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.organizations.getByName(name) -> GetOrganizationByNameResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Organization specified by name. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().getByName("name"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — name of the organization to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.organizations.get(id) -> GetOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Organization specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the organization to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.organizations.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove an Organization from your tenant. This action cannot be undone. + +Note: Members are automatically disassociated from an Organization when it is deleted. However, this action does not delete these users from your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.update(id, request) -> UpdateOrganizationResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the details of a specific Organization, such as name and display name, branding options, and metadata. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().update( + "id", + UpdateOrganizationRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the organization to update. + +
+
+ +
+
+ +**displayName:** `Optional` — Friendly name of this organization. + +
+
+ +
+
+ +**name:** `Optional` — The name of this organization. + +
+
+ +
+
+ +**branding:** `Optional` + +
+
+ +
+
+ +**metadata:** `Optional>>` + +
+
+ +
+
+ +**tokenQuota:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Prompts +
client.prompts.getSettings() -> GetSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().getSettings(); +``` +
+
+
+
+ + +
+
+
+ +
client.prompts.updateSettings(request) -> UpdateSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().updateSettings( + UpdateSettingsRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**universalLoginExperience:** `Optional` + +
+
+ +
+
+ +**identifierFirst:** `Optional` — Whether identifier first is enabled or not + +
+
+ +
+
+ +**webauthnPlatformFirstFactor:** `Optional` — Use WebAuthn with Device Biometrics as the first authentication factor + +
+
+
+
+ + +
+
+
+ +## RefreshTokens +
client.refreshTokens.get(id) -> GetRefreshTokenResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve refresh token information. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.refreshTokens().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID refresh token to retrieve + +
+
+
+
+ + +
+
+
+ +
client.refreshTokens.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a refresh token by its ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.refreshTokens().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the refresh token to delete. + +
+
+
+
+ + +
+
+
+ +
client.refreshTokens.update(id, request) -> UpdateRefreshTokenResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a refresh token by its ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.refreshTokens().update( + "id", + UpdateRefreshTokenRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the refresh token to update. + +
+
+ +
+
+ +**refreshTokenMetadata:** `Optional>` + +
+
+
+
+ + +
+
+
+ +## ResourceServers +
client.resourceServers.list() -> SyncPagingIterable<ResourceServer> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all APIs associated with your tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().list( + ListResourceServerRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .includeFields( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifiers:** `Optional` — An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../resource-servers?identifiers=id1&identifiers=id2 + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.create(request) -> CreateResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read APIs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().create( + CreateResourceServerRequestContent + .builder() + .identifier("identifier") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. + +
+
+ +
+
+ +**identifier:** `String` — Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + +
+
+ +
+
+ +**scopes:** `Optional>` — List of permissions (scopes) that this API uses. + +
+
+ +
+
+ +**signingAlg:** `Optional` + +
+
+ +
+
+ +**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). + +
+
+ +
+
+ +**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + +
+
+ +
+
+ +**tokenDialect:** `Optional` + +
+
+ +
+
+ +**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). + +
+
+ +
+
+ +**enforcePolicies:** `Optional` — Whether to enforce authorization policies (true) or to ignore them (false). + +
+
+ +
+
+ +**tokenEncryption:** `Optional` + +
+
+ +
+
+ +**consentPolicy:** `Optional` + +
+
+ +
+
+ +**authorizationDetails:** `Optional>` + +
+
+ +
+
+ +**proofOfPossession:** `Optional` + +
+
+ +
+
+ +**subjectTypeAuthorization:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.get(id) -> GetResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve API details with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().get( + "id", + GetResourceServerRequestParameters + .builder() + .includeFields( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or audience of the resource server to retrieve. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an existing API by ID. For more information, read API Settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or the audience of the resource server to delete. + +
+
+
+
+ + +
+
+
+ +
client.resourceServers.update(id, request) -> UpdateResourceServerResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Change an existing API setting by resource server ID. For more information, read API Settings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().update( + "id", + UpdateResourceServerRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID or audience of the resource server to update. + +
+
+ +
+
+ +**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. + +
+
+ +
+
+ +**scopes:** `Optional>` — List of permissions (scopes) that this API uses. + +
+
+ +
+
+ +**signingAlg:** `Optional` + +
+
+ +
+
+ +**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). + +
+
+ +
+
+ +**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). + +
+
+ +
+
+ +**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + +
+
+ +
+
+ +**tokenDialect:** `Optional` + +
+
+ +
+
+ +**enforcePolicies:** `Optional` — Whether authorization policies are enforced (true) or not enforced (false). + +
+
+ +
+
+ +**tokenEncryption:** `Optional` + +
+
+ +
+
+ +**consentPolicy:** `Optional` + +
+
+ +
+
+ +**authorizationDetails:** `Optional>` + +
+
+ +
+
+ +**proofOfPossession:** `Optional` + +
+
+ +
+
+ +**subjectTypeAuthorization:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Roles +
client.roles.list() -> SyncPagingIterable<Role> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed list of user roles created in your tenant. + +Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().list( + ListRolesRequestParameters + .builder() + .perPage( + OptionalNullable.of(1) + ) + .page( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .nameFilter( + OptionalNullable.of("name_filter") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**nameFilter:** `Optional` — Optional filter on name (case-insensitive). + +
+
+
+
+ + +
+
+
+ +
client.roles.create(request) -> CreateRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a user role for Role-Based Access Control. + +Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().create( + CreateRoleRequestContent + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` — Name of the role. + +
+
+ +
+
+ +**description:** `Optional` — Description of the role. + +
+
+
+
+ + +
+
+
+ +
client.roles.get(id) -> GetRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a specific user role specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to retrieve. + +
+
+
+
+ + +
+
+
+ +
client.roles.delete(id) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to delete. + +
+
+
+
+ + +
+
+
+ +
client.roles.update(id, request) -> UpdateRoleResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modify the details of a specific user role specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.roles().update( + "id", + UpdateRoleRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the role to update. + +
+
+ +
+
+ +**name:** `Optional` — Name of this role. + +
+
+ +
+
+ +**description:** `Optional` — Description of this role. + +
+
+
+
+ + +
+
+
+ +## Rules +
client.rules.list() -> SyncPagingIterable<Rule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rules().list( + ListRulesRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .enabled( + OptionalNullable.of(true) + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**enabled:** `Optional` — Optional filter on whether a rule is enabled (true) or disabled (false). +
-#### ⚙️ Parameters -
+**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+
-**id:** `String` — The id of the log stream to get +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false).
@@ -6173,7 +9647,7 @@ client.logStreams().get("id");
-
client.logStreams.delete(id) +
client.rules.create(request) -> CreateRuleResponseContent
@@ -6185,7 +9659,9 @@ client.logStreams().get("id");
-Delete a log stream. +Create a new rule. + +Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted.
@@ -6200,7 +9676,13 @@ Delete a log stream.
```java -client.logStreams().delete("id"); +client.rules().create( + CreateRuleRequestContent + .builder() + .name("name") + .script("script") + .build() +); ```
@@ -6215,7 +9697,31 @@ client.logStreams().delete("id");
-**id:** `String` — The id of the log stream to delete +**name:** `String` — Name of this rule. + +
+
+ +
+
+ +**script:** `String` — Code to be executed when this rule runs. + +
+
+ +
+
+ +**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. + +
+
+ +
+
+ +**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false).
@@ -6227,7 +9733,7 @@ client.logStreams().delete("id");
-
client.logStreams.update(id, request) -> UpdateLogStreamResponseContent +
client.rules.get(id) -> GetRuleResponseContent
@@ -6239,41 +9745,7 @@ client.logStreams().delete("id");
-Update a log stream. -

Examples of how to use the PATCH endpoint.

The following fields may be updated in a PATCH operation:
  • name
  • status
  • sink
Note: For log streams of type eventbridge and eventgrid, updating the sink is not permitted. -
Update the status of a log stream
{
-	"status": "active|paused"
-}
-
Update the name of a log stream
{
-	"name": "string"
-}
-
Update the sink properties of a stream of type http
{
-  "sink": {
-    "httpEndpoint": "string",
-    "httpContentType": "string",
-    "httpContentFormat": "JSONARRAY|JSONLINES",
-    "httpAuthorization": "string"
-  }
-}
-
Update the sink properties of a stream of type datadog
{
-  "sink": {
-		"datadogRegion": "string",
-		"datadogApiKey": "string"
-  }
-}
-
Update the sink properties of a stream of type splunk
{
-  "sink": {
-    "splunkDomain": "string",
-    "splunkToken": "string",
-    "splunkPort": "string",
-    "splunkSecure": "boolean"
-  }
-}
-
Update the sink properties of a stream of type sumo
{
-  "sink": {
-    "sumoSourceAddress": "string"
-  }
-}
+Retrieve rule details. Accepts a list of fields to include or exclude in the result.
@@ -6288,10 +9760,16 @@ Update a log stream.
```java -client.logStreams().update( +client.rules().get( "id", - UpdateLogStreamRequestContent + GetRuleRequestParameters .builder() + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -6308,7 +9786,7 @@ client.logStreams().update(
-**id:** `String` — The id of the log stream to get +**id:** `String` — ID of the rule to retrieve.
@@ -6316,7 +9794,7 @@ client.logStreams().update(
-**name:** `Optional` — log stream name +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
@@ -6324,39 +9802,61 @@ client.logStreams().update(
-**status:** `Optional` +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false).
+
+
-
-
-**isPriority:** `Optional` — True for priority log streams, false for non-priority -
+
+
client.rules.delete(id)
-**filters:** `Optional>` — Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. - +#### 📝 Description + +
+
+ +
+
+ +Delete a rule.
+
+
+ +#### 🔌 Usage
-**piiConfig:** `Optional` - +
+
+ +```java +client.rules().delete("id"); +```
+
+
+ +#### ⚙️ Parameters
-**sink:** `Optional` +
+
+ +**id:** `String` — ID of the rule to delete.
@@ -6368,8 +9868,7 @@ client.logStreams().update(
-## Logs -
client.logs.list() -> SyncPagingIterable<Log> +
client.rules.update(id, request) -> UpdateRuleResponseContent
@@ -6381,35 +9880,7 @@ client.logStreams().update(
-Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - -Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). - -For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. - -
To set custom search criteria, use the following parameters:
- -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
- -For more information on the list of fields that can be used in fields and sort, see Searchable Fields. - -Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. - -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
- -Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. +Update an existing rule.
@@ -6424,16 +9895,10 @@ Auth0
-**page:** `Optional` — Page index of the results to return. First page is 0. - -
-
- -
-
- -**perPage:** `Optional` — Number of results per page. Paging is disabled if parameter not sent. Default: 50. Max value: 100 - -
-
- -
-
- -**sort:** `Optional` — Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1 +**id:** `String` — ID of the rule to retrieve.
@@ -6474,7 +9923,7 @@ client.logs().list(
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +**script:** `Optional` — Code to be executed when this rule runs.
@@ -6482,7 +9931,7 @@ client.logs().list(
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false) +**name:** `Optional` — Name of this rule.
@@ -6490,7 +9939,7 @@ client.logs().list(
-**includeTotals:** `Optional` — Return results as an array when false (default). Return results inside an object that also contains a total result count when true. +**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first.
@@ -6498,7 +9947,7 @@ client.logs().list(
-**q:** `Optional` — Query in Lucene query string syntax. +**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false).
@@ -6510,7 +9959,8 @@ client.logs().list(
-
client.logs.get(id) -> GetLogResponseContent +## RulesConfigs +
client.rulesConfigs.list() -> List<RulesConfig>
@@ -6522,7 +9972,9 @@ client.logs().list(
-Retrieve an individual log event. +Retrieve rules config variable keys. + + Note: For security, config variable values cannot be retrieved outside rule execution.
@@ -6537,35 +9989,19 @@ Retrieve an individual log event.
```java -client.logs().get("id"); +client.rulesConfigs().list(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — log_id of the log to retrieve. - -
-
-
-
-
-## NetworkAcls -
client.networkAcls.list() -> SyncPagingIterable<NetworkAclsResponseContent> +
client.rulesConfigs.set(key, request) -> SetRulesConfigResponseContent
@@ -6577,7 +10013,7 @@ client.logs().get("id");
-Get all access control list entries for your client. +Sets a rules config variable.
@@ -6592,12 +10028,11 @@ Get all access control list entries for your client.
```java -client.networkAcls().list( - ListNetworkAclsRequestParameters +client.rulesConfigs().set( + "key", + SetRulesConfigRequestContent .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .value("value") .build() ); ``` @@ -6609,20 +10044,12 @@ client.networkAcls().list( #### ⚙️ Parameters
-
- -
-
- -**page:** `Optional` — Use this field to request a specific page of the list results. - -
-
+
-**perPage:** `Optional` — The amount of results per page. +**key:** `String` — Key of the rules config variable to set (max length: 127 characters).
@@ -6630,7 +10057,7 @@ client.networkAcls().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**value:** `String` — Value for a rules config variable.
@@ -6642,7 +10069,7 @@ client.networkAcls().list(
-
client.networkAcls.create(request) +
client.rulesConfigs.delete(key)
@@ -6654,7 +10081,7 @@ client.networkAcls().list(
-Create a new access control list for your client. +Delete a rules config variable identified by its key.
@@ -6669,25 +10096,7 @@ Create a new access control list for your client.
```java -client.networkAcls().create( - CreateNetworkAclRequestContent - .builder() - .description("description") - .active(true) - .priority(1.1) - .rule( - NetworkAclRule - .builder() - .action( - NetworkAclAction - .builder() - .build() - ) - .scope(NetworkAclRuleScopeEnum.MANAGEMENT) - .build() - ) - .build() -); +client.rulesConfigs().delete("key"); ```
@@ -6702,31 +10111,7 @@ client.networkAcls().create(
-**description:** `String` - -
-
- -
-
- -**active:** `Boolean` — Indicates whether or not this access control list is actively being used - -
-
- -
-
- -**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. - -
-
- -
-
- -**rule:** `NetworkAclRule` +**key:** `String` — Key of the rules config variable to delete.
@@ -6738,7 +10123,8 @@ client.networkAcls().create(
-
client.networkAcls.get(id) -> GetNetworkAclsResponseContent +## SelfServiceProfiles +
client.selfServiceProfiles.list() -> SyncPagingIterable<SelfServiceProfile>
@@ -6750,7 +10136,7 @@ client.networkAcls().create(
-Get a specific access control list entry for your client. +Retrieves self-service profiles.
@@ -6765,7 +10151,20 @@ Get a specific access control list entry for your client.
```java -client.networkAcls().get("id"); +client.selfServiceProfiles().list( + ListSelfServiceProfilesRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() +); ```
@@ -6780,7 +10179,23 @@ client.networkAcls().get("id");
-**id:** `String` — The id of the access control list to retrieve. +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -6792,7 +10207,7 @@ client.networkAcls().get("id");
-
client.networkAcls.set(id, request) -> SetNetworkAclsResponseContent +
client.selfServiceProfiles.create(request) -> CreateSelfServiceProfileResponseContent
@@ -6804,7 +10219,7 @@ client.networkAcls().get("id");
-Update existing access control list for your client. +Creates a self-service profile.
@@ -6819,24 +10234,10 @@ Update existing access control list for your client.
```java -client.networkAcls().set( - "id", - SetNetworkAclRequestContent +client.selfServiceProfiles().create( + CreateSelfServiceProfileRequestContent .builder() - .description("description") - .active(true) - .priority(1.1) - .rule( - NetworkAclRule - .builder() - .action( - NetworkAclAction - .builder() - .build() - ) - .scope(NetworkAclRuleScopeEnum.MANAGEMENT) - .build() - ) + .name("name") .build() ); ``` @@ -6853,7 +10254,7 @@ client.networkAcls().set(
-**id:** `String` — The id of the ACL to update. +**name:** `String` — The name of the self-service Profile.
@@ -6861,7 +10262,7 @@ client.networkAcls().set(
-**description:** `String` +**description:** `Optional` — The description of the self-service Profile.
@@ -6869,7 +10270,7 @@ client.networkAcls().set(
-**active:** `Boolean` — Indicates whether or not this access control list is actively being used +**branding:** `Optional`
@@ -6877,7 +10278,7 @@ client.networkAcls().set(
-**priority:** `Double` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. +**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`]
@@ -6885,7 +10286,15 @@ client.networkAcls().set(
-**rule:** `NetworkAclRule` +**userAttributes:** `Optional>` — List of attributes to be mapped that will be shown to the user during the SS-SSO flow. + +
+
+ +
+
+ +**userAttributeProfileId:** `Optional` — ID of the user-attribute-profile to associate with this self-service profile.
@@ -6897,7 +10306,7 @@ client.networkAcls().set(
-
client.networkAcls.delete(id) +
client.selfServiceProfiles.get(id) -> GetSelfServiceProfileResponseContent
@@ -6909,7 +10318,7 @@ client.networkAcls().set(
-Delete existing access control list for your client. +Retrieves a self-service profile by Id.
@@ -6924,7 +10333,7 @@ Delete existing access control list for your client.
```java -client.networkAcls().delete("id"); +client.selfServiceProfiles().get("id"); ```
@@ -6939,7 +10348,7 @@ client.networkAcls().delete("id");
-**id:** `String` — The id of the ACL to delete +**id:** `String` — The id of the self-service profile to retrieve
@@ -6951,7 +10360,7 @@ client.networkAcls().delete("id");
-
client.networkAcls.update(id, request) -> UpdateNetworkAclResponseContent +
client.selfServiceProfiles.delete(id)
@@ -6963,7 +10372,7 @@ client.networkAcls().delete("id");
-Update existing access control list for your client. +Deletes a self-service profile by Id.
@@ -6978,12 +10387,7 @@ Update existing access control list for your client.
```java -client.networkAcls().update( - "id", - UpdateNetworkAclRequestContent - .builder() - .build() -); +client.selfServiceProfiles().delete("id"); ```
@@ -6998,39 +10402,7 @@ client.networkAcls().update(
-**id:** `String` — The id of the ACL to update. - -
-
- -
-
- -**description:** `Optional` - -
-
- -
-
- -**active:** `Optional` — Indicates whether or not this access control list is actively being used - -
-
- -
-
- -**priority:** `Optional` — Indicates the order in which the ACL will be evaluated relative to other ACL rules. - -
-
- -
-
- -**rule:** `Optional` +**id:** `String` — The id of the self-service profile to delete
@@ -7042,8 +10414,7 @@ client.networkAcls().update(
-## Organizations -
client.organizations.list() -> SyncPagingIterable<Organization> +
client.selfServiceProfiles.update(id, request) -> UpdateSelfServiceProfileResponseContent
@@ -7055,25 +10426,7 @@ client.networkAcls().update(
-Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. - -This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
- -Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. - -

Checkpoint Pagination

- -To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total number of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- -Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +Updates a self-service profile.
@@ -7088,12 +10441,10 @@ To search by checkpoint, use the following parameters:
```java -client.organizations().list( - ListOrganizationsRequestParameters +client.selfServiceProfiles().update( + "id", + UpdateSelfServiceProfileRequestContent .builder() - .from("from") - .take(1) - .sort("sort") .build() ); ``` @@ -7110,7 +10461,7 @@ client.organizations().list(
-**from:** `Optional` — Optional Id from which to start selection. +**id:** `String` — The id of the self-service profile to update
@@ -7118,7 +10469,7 @@ client.organizations().list(
-**take:** `Optional` — Number of results per page. Defaults to 50. +**name:** `Optional` — The name of the self-service Profile.
@@ -7126,58 +10477,56 @@ client.organizations().list(
-**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1. We currently support sorting by the following fields: name, display_name and created_at. +**description:** `Optional`
-
-
+
+
+**branding:** `Optional` +
-
-
client.organizations.create(request) -> CreateOrganizationResponseContent
-#### 📝 Description +**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`] + +
+
+**userAttributes:** `Optional>` + +
+
+
-Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review Create Your First Organization. +**userAttributeProfileId:** `Optional` — ID of the user-attribute-profile to associate with this self-service profile. +
-#### 🔌 Usage - -
-
- -
-
-```java -client.organizations().create( - CreateOrganizationRequestContent - .builder() - .name("name") - .build() -); -``` -
-
+
+ +## Sessions +
client.sessions.get(id) -> GetSessionResponseContent +
+
-#### ⚙️ Parameters +#### 📝 Description
@@ -7185,47 +10534,37 @@ client.organizations().create(
-**name:** `String` — The name of this organization. - +Retrieve session information.
- -
-
- -**displayName:** `Optional` — Friendly name of this organization. -
+#### 🔌 Usage +
-**branding:** `Optional` - -
-
-
-**metadata:** `Optional>` - +```java +client.sessions().get("id"); +```
+
+
+ +#### ⚙️ Parameters
-**enabledConnections:** `Optional>` — Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed) - -
-
-
-**tokenQuota:** `Optional` +**id:** `String` — ID of session to retrieve
@@ -7237,7 +10576,7 @@ client.organizations().create(
-
client.organizations.getByName(name) -> GetOrganizationByNameResponseContent +
client.sessions.delete(id)
@@ -7249,7 +10588,7 @@ client.organizations().create(
-Retrieve details about a single Organization specified by name. +Delete a session by ID.
@@ -7264,7 +10603,7 @@ Retrieve details about a single Organization specified by name.
```java -client.organizations().getByName("name"); +client.sessions().delete("id"); ```
@@ -7279,7 +10618,7 @@ client.organizations().getByName("name");
-**name:** `String` — name of the organization to retrieve. +**id:** `String` — ID of the session to delete.
@@ -7291,7 +10630,7 @@ client.organizations().getByName("name");
-
client.organizations.get(id) -> GetOrganizationResponseContent +
client.sessions.update(id, request) -> UpdateSessionResponseContent
@@ -7303,7 +10642,7 @@ client.organizations().getByName("name");
-Retrieve details about a single Organization specified by ID. +Update session information.
@@ -7318,7 +10657,12 @@ Retrieve details about a single Organization specified by ID.
```java -client.organizations().get("id"); +client.sessions().update( + "id", + UpdateSessionRequestContent + .builder() + .build() +); ```
@@ -7333,7 +10677,15 @@ client.organizations().get("id");
-**id:** `String` — ID of the organization to retrieve. +**id:** `String` — ID of the session to update. + +
+
+ +
+
+ +**sessionMetadata:** `Optional>`
@@ -7345,7 +10697,7 @@ client.organizations().get("id");
-
client.organizations.delete(id) +
client.sessions.revoke(id)
@@ -7357,9 +10709,7 @@ client.organizations().get("id");
-Remove an Organization from your tenant. This action cannot be undone. - -Note: Members are automatically disassociated from an Organization when it is deleted. However, this action does not delete these users from your tenant. +Revokes a session by ID and all associated refresh tokens.
@@ -7374,7 +10724,7 @@ Remove an Organization from your tenant. This action cannot be undone.
```java -client.organizations().delete("id"); +client.sessions().revoke("id"); ```
@@ -7389,7 +10739,7 @@ client.organizations().delete("id");
-**id:** `String` — Organization identifier. +**id:** `String` — ID of the session to revoke.
@@ -7401,7 +10751,8 @@ client.organizations().delete("id");
-
client.organizations.update(id, request) -> UpdateOrganizationResponseContent +## Stats +
client.stats.getActiveUsersCount() -> Double
@@ -7413,7 +10764,7 @@ client.organizations().delete("id");
-Update the details of a specific Organization, such as name and display name, branding options, and metadata. +Retrieve the number of active users that logged in during the last 30 days.
@@ -7428,59 +10779,71 @@ Update the details of a specific
-#### ⚙️ Parameters + + +
+ +
client.stats.getDaily() -> List<DailyStats>
+#### 📝 Description +
-**id:** `String` — ID of the organization to update. - -
-
-
-**displayName:** `Optional` — Friendly name of this organization. - +Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range.
+
+
+ +#### 🔌 Usage
-**name:** `Optional` — The name of this organization. - -
-
-
-**branding:** `Optional` - +```java +client.stats().getDaily( + GetDailyStatsRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .to( + OptionalNullable.of("to") + ) + .build() +); +```
+ + + +#### ⚙️ Parameters
-**metadata:** `Optional>` +
+
+ +**from:** `Optional` — Optional first day of the date range (inclusive) in YYYYMMDD format.
@@ -7488,7 +10851,7 @@ client.organizations().update(
-**tokenQuota:** `Optional` +**to:** `Optional` — Optional last day of the date range (inclusive) in YYYYMMDD format.
@@ -7500,8 +10863,8 @@ client.organizations().update(
-## Prompts -
client.prompts.getSettings() -> GetSettingsResponseContent +## SupplementalSignals +
client.supplementalSignals.get() -> GetSupplementalSignalsResponseContent
@@ -7513,7 +10876,7 @@ client.organizations().update(
-Retrieve details of the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +Get the supplemental signals configuration for a tenant.
@@ -7528,7 +10891,7 @@ Retrieve details of the Universal Login configuration of your tenant. This inclu
```java -client.prompts().getSettings(); +client.supplementalSignals().get(); ```
@@ -7540,7 +10903,7 @@ client.prompts().getSettings();
-
client.prompts.updateSettings(request) -> UpdateSettingsResponseContent +
client.supplementalSignals.patch(request) -> PatchSupplementalSignalsResponseContent
@@ -7552,7 +10915,7 @@ client.prompts().getSettings();
-Update the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features. +Update the supplemental signals configuration for a tenant.
@@ -7567,9 +10930,10 @@ Update the Universal Login configuration of your tenant. This includes the ```java -client.prompts().updateSettings( - UpdateSettingsRequestContent +client.supplementalSignals().patch( + UpdateSupplementalSignalsRequestContent .builder() + .akamaiEnabled(true) .build() ); ``` @@ -7586,23 +10950,7 @@ client.prompts().updateSettings(
-**universalLoginExperience:** `Optional` - -
-
- -
-
- -**identifierFirst:** `Optional` — Whether identifier first is enabled or not - -
-
- -
-
- -**webauthnPlatformFirstFactor:** `Optional` — Use WebAuthn with Device Biometrics as the first authentication factor +**akamaiEnabled:** `Boolean` — Indicates if incoming Akamai Headers should be processed
@@ -7614,8 +10962,8 @@ client.prompts().updateSettings(
-## RefreshTokens -
client.refreshTokens.get(id) -> GetRefreshTokenResponseContent +## Tickets +
client.tickets.verifyEmail(request) -> VerifyEmailTicketResponseContent
@@ -7627,7 +10975,7 @@ client.prompts().updateSettings(
-Retrieve refresh token information. +Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address.
@@ -7642,7 +10990,12 @@ Retrieve refresh token information.
```java -client.refreshTokens().get("id"); +client.tickets().verifyEmail( + VerifyEmailTicketRequestContent + .builder() + .userId("user_id") + .build() +); ```
@@ -7657,61 +11010,55 @@ client.refreshTokens().get("id");
-**id:** `String` — ID refresh token to retrieve +**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.
- - +
+
+**userId:** `String` — user_id of for whom the ticket should be created. +
-
-
client.refreshTokens.delete(id)
-#### 📝 Description - -
-
+**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. + +
+
-Delete a refresh token by its ID. -
-
+**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. +
-#### 🔌 Usage - -
-
-
-```java -client.refreshTokens().delete("id"); -``` -
-
+**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). +
-#### ⚙️ Parameters -
+**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + +
+
+
-**id:** `String` — ID of the refresh token to delete. +**identity:** `Optional`
@@ -7723,8 +11070,7 @@ client.refreshTokens().delete("id");
-## ResourceServers -
client.resourceServers.list() -> SyncPagingIterable<ResourceServer> +
client.tickets.changePassword(request) -> ChangePasswordTicketResponseContent
@@ -7736,7 +11082,9 @@ client.refreshTokens().delete("id");
-Retrieve details of all APIs associated with your tenant. +Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + +Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.
@@ -7751,13 +11099,9 @@ Retrieve details of all APIs associated with your tenant.
```java -client.resourceServers().list( - ListResourceServerRequestParameters +client.tickets().changePassword( + ChangePasswordTicketRequestContent .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .includeFields(true) .build() ); ``` @@ -7766,15 +11110,55 @@ client.resourceServers().list(
-#### ⚙️ Parameters - +#### ⚙️ Parameters + +
+
+ +
+
+ +**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. + +
+
+ +
+
+ +**userId:** `Optional` — user_id of for whom the ticket should be created. + +
+
+ +
+
+ +**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. + +
+
+ +
+
+ +**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + +
+
+
+**connectionId:** `Optional` — ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. + +
+
+
-**identifiers:** `Optional` — An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../resource-servers?identifiers=id1&identifiers=id2 +**email:** `Optional` — Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id.
@@ -7782,7 +11166,7 @@ client.resourceServers().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. +**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).
@@ -7790,7 +11174,7 @@ client.resourceServers().list(
-**perPage:** `Optional` — Number of results per page. +**markEmailAsVerified:** `Optional` — Whether to set the email_verified attribute to true (true) or whether it should not be updated (false).
@@ -7798,7 +11182,7 @@ client.resourceServers().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).
@@ -7806,7 +11190,7 @@ client.resourceServers().list(
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). +**identity:** `Optional`
@@ -7818,7 +11202,8 @@ client.resourceServers().list(
-
client.resourceServers.create(request) -> CreateResourceServerResponseContent +## TokenExchangeProfiles +
client.tokenExchangeProfiles.list() -> SyncPagingIterable<TokenExchangeProfileResponseContent>
@@ -7830,7 +11215,17 @@ client.resourceServers().list(
-Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read APIs. +Retrieve a list of all Token Exchange Profiles available in your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. + +This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
@@ -7845,10 +11240,15 @@ Create a new API associated with your tenant. Note that all new APIs must be reg
```java -client.resourceServers().create( - CreateResourceServerRequestContent +client.tokenExchangeProfiles().list( + TokenExchangeProfilesListRequest .builder() - .identifier("identifier") + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -7865,7 +11265,7 @@ client.resourceServers().create(
-**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. +**from:** `Optional` — Optional Id from which to start selection.
@@ -7873,79 +11273,71 @@ client.resourceServers().create(
-**identifier:** `String` — Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. +**take:** `Optional` — Number of results per page. Defaults to 50.
- -
-
- -**scopes:** `Optional>` — List of permissions (scopes) that this API uses. -
-
-
-**signingAlg:** `Optional` -
+
+
client.tokenExchangeProfiles.create(request) -> CreateTokenExchangeProfileResponseContent
-**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). - -
-
+#### 📝 Description
-**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). - -
-
-
-**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. - +Create a new Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. +
+
+#### 🔌 Usage +
-**tokenDialect:** `Optional` - -
-
-
-**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). - +```java +client.tokenExchangeProfiles().create( + CreateTokenExchangeProfileRequestContent + .builder() + .name("name") + .subjectTokenType("subject_token_type") + .actionId("action_id") + .type("custom_authentication") + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**enforcePolicies:** `Optional` — Whether to enforce authorization policies (true) or to ignore them (false). - -
-
-
-**tokenEncryption:** `Optional` +**name:** `String` — Friendly name of this profile.
@@ -7953,7 +11345,7 @@ client.resourceServers().create(
-**consentPolicy:** `Optional` +**subjectTokenType:** `String` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.
@@ -7961,7 +11353,7 @@ client.resourceServers().create(
-**authorizationDetails:** `Optional>` +**actionId:** `String` — The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.
@@ -7969,7 +11361,7 @@ client.resourceServers().create(
-**proofOfPossession:** `Optional` +**type:** `String`
@@ -7981,7 +11373,7 @@ client.resourceServers().create(
-
client.resourceServers.get(id) -> GetResourceServerResponseContent +
client.tokenExchangeProfiles.get(id) -> GetTokenExchangeProfileResponseContent
@@ -7993,7 +11385,9 @@ client.resourceServers().create(
-Retrieve API details with the given ID. +Retrieve details about a single Token Exchange Profile specified by ID. + +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
@@ -8008,13 +11402,7 @@ Retrieve API details with the given ID
```java -client.resourceServers().get( - "id", - GetResourceServerRequestParameters - .builder() - .includeFields(true) - .build() -); +client.tokenExchangeProfiles().get("id"); ```
@@ -8029,15 +11417,7 @@ client.resourceServers().get(
-**id:** `String` — ID or audience of the resource server to retrieve. - -
-
- -
-
- -**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). +**id:** `String` — ID of the Token Exchange Profile to retrieve.
@@ -8049,7 +11429,7 @@ client.resourceServers().get(
-
client.resourceServers.delete(id) +
client.tokenExchangeProfiles.delete(id)
@@ -8061,7 +11441,10 @@ client.resourceServers().get(
-Delete an existing API by ID. For more information, read API Settings. +Delete a Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. +
@@ -8076,7 +11459,7 @@ Delete an existing API by ID. For more information, read
@@ -8091,7 +11474,7 @@ client.resourceServers().delete("id");
-**id:** `String` — ID or the audience of the resource server to delete. +**id:** `String` — ID of the Token Exchange Profile to delete.
@@ -8103,7 +11486,7 @@ client.resourceServers().delete("id");
-
client.resourceServers.update(id, request) -> UpdateResourceServerResponseContent +
client.tokenExchangeProfiles.update(id, request)
@@ -8115,7 +11498,10 @@ client.resourceServers().delete("id");
-Change an existing API setting by resource server ID. For more information, read API Settings. +Update a Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. +
@@ -8130,9 +11516,9 @@ Change an existing API setting by resource server ID. For more information, read
```java -client.resourceServers().update( +client.tokenExchangeProfiles().update( "id", - UpdateResourceServerRequestContent + UpdateTokenExchangeProfileRequestContent .builder() .build() ); @@ -8150,7 +11536,7 @@ client.resourceServers().update(
-**id:** `String` — ID or audience of the resource server to update. +**id:** `String` — ID of the Token Exchange Profile to update.
@@ -8158,7 +11544,7 @@ client.resourceServers().update(
-**name:** `Optional` — Friendly name for this resource server. Can not contain `<` or `>` characters. +**name:** `Optional` — Friendly name of this profile.
@@ -8166,87 +11552,72 @@ client.resourceServers().update(
-**scopes:** `Optional>` — List of permissions (scopes) that this API uses. +**subjectTokenType:** `Optional` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.
- -
-
- -**signingAlg:** `Optional` -
-
-
-**signingSecret:** `Optional` — Secret used to sign tokens when using symmetric algorithms (HS256). -
+
+## UserAttributeProfiles +
client.userAttributeProfiles.list() -> SyncPagingIterable<UserAttributeProfile>
-**skipConsentForVerifiableFirstPartyClients:** `Optional` — Whether to skip user consent for applications flagged as first party (true) or not (false). - -
-
+#### 📝 Description
-**allowOfflineAccess:** `Optional` — Whether refresh tokens can be issued for this API (true) or not (false). - -
-
-
-**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. - +Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination.
- -
-
- -**tokenDialect:** `Optional` -
+#### 🔌 Usage +
-**enforcePolicies:** `Optional` — Whether authorization policies are enforced (true) or not enforced (false). - -
-
-
-**tokenEncryption:** `Optional` - +```java +client.userAttributeProfiles().list( + ListUserAttributeProfileRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**consentPolicy:** `Optional` - -
-
-
-**authorizationDetails:** `Optional>` +**from:** `Optional` — Optional Id from which to start selection.
@@ -8254,7 +11625,7 @@ client.resourceServers().update(
-**proofOfPossession:** `Optional` +**take:** `Optional` — Number of results per page. Defaults to 5.
@@ -8266,8 +11637,7 @@ client.resourceServers().update(
-## Roles -
client.roles.list() -> SyncPagingIterable<Role> +
client.userAttributeProfiles.create(request) -> CreateUserAttributeProfileResponseContent
@@ -8279,9 +11649,7 @@ client.resourceServers().update(
-Retrieve detailed list of user roles created in your tenant. - -Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. +Retrieve details about a single User Attribute Profile specified by ID.
@@ -8296,13 +11664,21 @@ Retrieve detailed list of user roles created in your tenant.
```java -client.roles().list( - ListRolesRequestParameters +client.userAttributeProfiles().create( + CreateUserAttributeProfileRequestContent .builder() - .perPage(1) - .page(1) - .includeTotals(true) - .nameFilter("name_filter") + .name("name") + .userAttributes( + new HashMap() {{ + put("key", UserAttributeProfileUserAttributeAdditionalProperties + .builder() + .description("description") + .label("label") + .profileRequired(true) + .auth0Mapping("auth0_mapping") + .build()); + }} + ) .build() ); ``` @@ -8319,7 +11695,7 @@ client.roles().list(
-**perPage:** `Optional` — Number of results per page. Defaults to 50. +**name:** `String`
@@ -8327,24 +11703,55 @@ client.roles().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. +**userId:** `Optional` + +
+
+ +
+
+ +**userAttributes:** `Map`
+
+
+ + + + +
+ +
client.userAttributeProfiles.listTemplates() -> ListUserAttributeProfileTemplateResponseContent +
+
+ +#### 📝 Description + +
+
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). - +Retrieve a list of User Attribute Profile Templates. +
+
+#### 🔌 Usage +
-**nameFilter:** `Optional` — Optional filter on name (case-insensitive). - +
+
+ +```java +client.userAttributeProfiles().listTemplates(); +```
@@ -8355,7 +11762,7 @@ client.roles().list(
-
client.roles.create(request) -> CreateRoleResponseContent +
client.userAttributeProfiles.getTemplate(id) -> GetUserAttributeProfileTemplateResponseContent
@@ -8367,9 +11774,7 @@ client.roles().list(
-Create a user role for Role-Based Access Control. - -Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. +Retrieve a User Attribute Profile Template.
@@ -8384,12 +11789,7 @@ Create a user role for
@@ -8404,15 +11804,7 @@ client.roles().create(
-**name:** `String` — Name of the role. - -
-
- -
-
- -**description:** `Optional` — Description of the role. +**id:** `String` — ID of the user-attribute-profile-template to retrieve.
@@ -8424,7 +11816,7 @@ client.roles().create(
-
client.roles.get(id) -> GetRoleResponseContent +
client.userAttributeProfiles.get(id) -> GetUserAttributeProfileResponseContent
@@ -8436,7 +11828,7 @@ client.roles().create(
-Retrieve details about a specific user role specified by ID. +Retrieve details about a single User Attribute Profile specified by ID.
@@ -8451,7 +11843,7 @@ Retrieve details about a specific
@@ -8466,7 +11858,7 @@ client.roles().get("id");
-**id:** `String` — ID of the role to retrieve. +**id:** `String` — ID of the user-attribute-profile to retrieve.
@@ -8478,7 +11870,7 @@ client.roles().get("id");
-
client.roles.delete(id) +
client.userAttributeProfiles.delete(id)
@@ -8490,7 +11882,7 @@ client.roles().get("id");
-Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. +Delete a single User Attribute Profile specified by ID.
@@ -8505,7 +11897,7 @@ Delete a specific
@@ -8520,7 +11912,7 @@ client.roles().delete("id");
-**id:** `String` — ID of the role to delete. +**id:** `String` — ID of the user-attribute-profile to delete.
@@ -8532,7 +11924,7 @@ client.roles().delete("id");
-
client.roles.update(id, request) -> UpdateRoleResponseContent +
client.userAttributeProfiles.update(id, request) -> UpdateUserAttributeProfileResponseContent
@@ -8544,7 +11936,7 @@ client.roles().delete("id");
-Modify the details of a specific user role specified by ID. +Update the details of a specific User attribute profile, such as name, user_id and user_attributes.
@@ -8559,9 +11951,9 @@ Modify the details of a specific
-**id:** `String` — ID of the role to update. +**id:** `String` — ID of the user attribute profile to update.
@@ -8587,7 +11979,7 @@ client.roles().update(
-**name:** `Optional` — Name of this role. +**name:** `Optional`
@@ -8595,7 +11987,15 @@ client.roles().update(
-**description:** `Optional` — Description of this role. +**userId:** `Optional` + +
+
+ +
+
+ +**userAttributes:** `Optional>`
@@ -8607,8 +12007,8 @@ client.roles().update(
-## Rules -
client.rules.list() -> SyncPagingIterable<Rule> +## UserBlocks +
client.userBlocks.listByIdentifier() -> ListUserBlocksByIdentifierResponseContent
@@ -8620,7 +12020,7 @@ client.roles().update(
-Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. +Retrieve details of all Brute-force Protection blocks for a user with the given identifier (username, phone number, or email).
@@ -8635,15 +12035,13 @@ Retrieve a filtered list of rules. Ac
```java -client.rules().list( - ListRulesRequestParameters +client.userBlocks().listByIdentifier( + ListUserBlocksByIdentifierRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .enabled(true) - .fields("fields") - .includeFields(true) + .identifier("identifier") + .considerBruteForceEnablement( + OptionalNullable.of(true) + ) .build() ); ``` @@ -8660,31 +12058,7 @@ client.rules().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. - -
-
- -
-
- -**perPage:** `Optional` — Number of results per page. - -
-
- -
-
- -**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). - -
-
- -
-
- -**enabled:** `Optional` — Optional filter on whether a rule is enabled (true) or disabled (false). +**identifier:** `String` — Should be any of a username, phone number, or email.
@@ -8692,15 +12066,12 @@ client.rules().list(
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. - -
-
+**considerBruteForceEnablement:** `Optional` -
-
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. +
@@ -8712,7 +12083,7 @@ client.rules().list(
-
client.rules.create(request) -> CreateRuleResponseContent +
client.userBlocks.deleteByIdentifier()
@@ -8724,9 +12095,9 @@ client.rules().list(
-Create a new rule. +Remove all Brute-force Protection blocks for the user with the given identifier (username, phone number, or email). -Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. +Note: This endpoint does not unblock users that were blocked by a tenant administrator.
@@ -8741,11 +12112,10 @@ Note: Changing a rule's stage of execution from the default login_success<
```java -client.rules().create( - CreateRuleRequestContent +client.userBlocks().deleteByIdentifier( + DeleteUserBlocksByIdentifierRequestParameters .builder() - .name("name") - .script("script") + .identifier("identifier") .build() ); ``` @@ -8762,31 +12132,7 @@ client.rules().create(
-**name:** `String` — Name of this rule. - -
-
- -
-
- -**script:** `String` — Code to be executed when this rule runs. - -
-
- -
-
- -**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. - -
-
- -
-
- -**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false). +**identifier:** `String` — Should be any of a username, phone number, or email.
@@ -8798,7 +12144,7 @@ client.rules().create(
-
client.rules.get(id) -> GetRuleResponseContent +
client.userBlocks.list(id) -> ListUserBlocksResponseContent
@@ -8810,7 +12156,7 @@ client.rules().create(
-Retrieve rule details. Accepts a list of fields to include or exclude in the result. +Retrieve details of all Brute-force Protection blocks for the user with the given ID.
@@ -8825,12 +12171,13 @@ Retrieve rule details. Accepts a list
```java -client.rules().get( +client.userBlocks().list( "id", - GetRuleRequestParameters + ListUserBlocksRequestParameters .builder() - .fields("fields") - .includeFields(true) + .considerBruteForceEnablement( + OptionalNullable.of(true) + ) .build() ); ``` @@ -8847,7 +12194,7 @@ client.rules().get(
-**id:** `String` — ID of the rule to retrieve. +**id:** `String` — user_id of the user blocks to retrieve.
@@ -8855,15 +12202,12 @@ client.rules().get(
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. - -
-
+**considerBruteForceEnablement:** `Optional` -
-
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. +
@@ -8875,7 +12219,7 @@ client.rules().get(
-
client.rules.delete(id) +
client.userBlocks.delete(id)
@@ -8887,7 +12231,9 @@ client.rules().get(
-Delete a rule. +Remove all Brute-force Protection blocks for the user with the given ID. + +Note: This endpoint does not unblock users that were blocked by a tenant administrator.
@@ -8902,7 +12248,7 @@ Delete a rule.
```java -client.rules().delete("id"); +client.userBlocks().delete("id"); ```
@@ -8917,7 +12263,7 @@ client.rules().delete("id");
-**id:** `String` — ID of the rule to delete. +**id:** `String` — The user_id of the user to update.
@@ -8929,7 +12275,8 @@ client.rules().delete("id");
-
client.rules.update(id, request) -> UpdateRuleResponseContent +## Users +
client.users.list() -> SyncPagingIterable<UserResponseSchema>
@@ -8941,7 +12288,20 @@ client.rules().delete("id");
-Update an existing rule. +Retrieve details of users. It is possible to: + +- Specify a search criteria for users +- Sort the users to be returned +- Select the fields to be returned +- Specify the number of users to retrieve per page and the page index + +The q query parameter can be used to get users that match the specified criteria using query string syntax. + +Learn more about searching for users. + +Read about best practices when working with the API endpoints for retrieving users. + +Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension.
@@ -8956,10 +12316,39 @@ Update an existing rule.
```java -client.rules().update( - "id", - UpdateRuleRequestContent +client.users().list( + ListUsersRequestParameters .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .sort( + OptionalNullable.of("sort") + ) + .connection( + OptionalNullable.of("connection") + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .q( + OptionalNullable.of("q") + ) + .searchEngine( + OptionalNullable.of(SearchEngineVersionsEnum.V1) + ) + .primaryOrder( + OptionalNullable.of(true) + ) .build() ); ``` @@ -8976,7 +12365,7 @@ client.rules().update(
-**id:** `String` — ID of the rule to retrieve. +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -8984,7 +12373,7 @@ client.rules().update(
-**script:** `Optional` — Code to be executed when this rule runs. +**perPage:** `Optional` — Number of results per page.
@@ -8992,7 +12381,7 @@ client.rules().update(
-**name:** `Optional` — Name of this rule. +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -9000,7 +12389,7 @@ client.rules().update(
-**order:** `Optional` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1
@@ -9008,50 +12397,48 @@ client.rules().update(
-**enabled:** `Optional` — Whether the rule is enabled (true), or disabled (false). +**connection:** `Optional` — Connection filter. Only applies when using search_engine=v1. To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name"
-
-
+
+
+**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +
-
-## RulesConfigs -
client.rulesConfigs.list() -> List<RulesConfig>
-#### 📝 Description - -
-
+**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). + +
+
-Retrieve rules config variable keys. - - Note: For security, config variable values cannot be retrieved outside rule execution. -
-
+**q:** `Optional` — Query in Lucene query string syntax. Some query types cannot be used on metadata fields, for details see Searchable Fields. +
-#### 🔌 Usage -
+**searchEngine:** `Optional` — The version of the search engine + +
+
+
-```java -client.rulesConfigs().list(); -``` +**primaryOrder:** `Optional` — If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. +
@@ -9062,7 +12449,7 @@ client.rulesConfigs().list();
-
client.rulesConfigs.set(key, request) -> SetRulesConfigResponseContent +
client.users.create(request) -> CreateUserResponseContent
@@ -9074,7 +12461,9 @@ client.rulesConfigs().list();
-Sets a rules config variable. +Create a new user for a given database or passwordless connection. + +Note: connection is required but other parameters such as email and password are dependent upon the type of connection.
@@ -9089,11 +12478,10 @@ Sets a rules config variable.
```java -client.rulesConfigs().set( - "key", - SetRulesConfigRequestContent +client.users().create( + CreateUserRequestContent .builder() - .value("value") + .connection("connection") .build() ); ``` @@ -9110,7 +12498,7 @@ client.rulesConfigs().set(
-**key:** `String` — Key of the rules config variable to set (max length: 127 characters). +**email:** `Optional` — The user's email.
@@ -9118,123 +12506,111 @@ client.rulesConfigs().set(
-**value:** `String` — Value for a rules config variable. +**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation).
-
-
+
+
+**userMetadata:** `Optional>` +
-
-
client.rulesConfigs.delete(key)
-#### 📝 Description - -
-
+**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false). + +
+
-Delete a rules config variable identified by its key. -
-
+**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if `email_verified` is false or not specified +
-#### 🔌 Usage -
-
-
- -```java -client.rulesConfigs().delete("key"); -``` -
-
+**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false). +
-#### ⚙️ Parameters -
-
-
- -**key:** `String` — Key of the rules config variable to delete. +**appMetadata:** `Optional>`
-
-
+
+
+**givenName:** `Optional` — The user's given name(s). +
-
-## SelfServiceProfiles -
client.selfServiceProfiles.list() -> SyncPagingIterable<SelfServiceProfile>
-#### 📝 Description +**familyName:** `Optional` — The user's family name(s). + +
+
+**name:** `Optional` — The user's full name. + +
+
+
-Retrieves self-service profiles. -
-
+**nickname:** `Optional` — The user's nickname. + -#### 🔌 Usage -
+**picture:** `Optional` — A URI pointing to the user's picture. + +
+
+
-```java -client.selfServiceProfiles().list( - ListSelfServiceProfilesRequestParameters - .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .build() -); -``` -
-
+**userId:** `Optional` — The external user's id provided by the identity provider. + -#### ⚙️ Parameters -
+**connection:** `String` — Name of the connection this user should be created in. + +
+
+
-**page:** `Optional` — Page index of the results to return. First page is 0. +**password:** `Optional` — Initial password for this user. Only valid for auth0 connection strategy.
@@ -9242,7 +12618,7 @@ client.selfServiceProfiles().list(
-**perPage:** `Optional` — Number of results per page. Defaults to 50. +**verifyEmail:** `Optional` — Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter.
@@ -9250,7 +12626,7 @@ client.selfServiceProfiles().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**username:** `Optional` — The user's username. Only valid if the connection requires a username.
@@ -9262,7 +12638,7 @@ client.selfServiceProfiles().list(
-
client.selfServiceProfiles.create(request) -> CreateSelfServiceProfileResponseContent +
client.users.listUsersByEmail() -> List<UserResponseSchema>
@@ -9274,7 +12650,11 @@ client.selfServiceProfiles().list(
-Creates a self-service profile. +Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. + +For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com. + +Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case.
@@ -9289,10 +12669,16 @@ Creates a self-service profile.
```java -client.selfServiceProfiles().create( - CreateSelfServiceProfileRequestContent +client.users().listUsersByEmail( + ListUsersByEmailRequestParameters .builder() - .name("name") + .email("email") + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -9309,23 +12695,7 @@ client.selfServiceProfiles().create(
-**name:** `String` — The name of the self-service Profile. - -
-
- -
-
- -**description:** `Optional` — The description of the self-service Profile. - -
-
- -
-
- -**branding:** `Optional` +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
@@ -9333,7 +12703,7 @@ client.selfServiceProfiles().create(
-**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`] +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). Defaults to true.
@@ -9341,7 +12711,7 @@ client.selfServiceProfiles().create(
-**userAttributes:** `Optional>` — List of attributes to be mapped that will be shown to the user during the SS-SSO flow. +**email:** `String` — Email address to search for (case-sensitive).
@@ -9353,7 +12723,7 @@ client.selfServiceProfiles().create(
-
client.selfServiceProfiles.get(id) -> GetSelfServiceProfileResponseContent +
client.users.get(id) -> GetUserResponseContent
@@ -9365,7 +12735,7 @@ client.selfServiceProfiles().create(
-Retrieves a self-service profile by Id. +Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint.
@@ -9380,7 +12750,18 @@ Retrieves a self-service profile by Id.
```java -client.selfServiceProfiles().get("id"); +client.users().get( + "id", + GetUserRequestParameters + .builder() + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .build() +); ```
@@ -9395,7 +12776,23 @@ client.selfServiceProfiles().get("id");
-**id:** `String` — The id of the self-service profile to retrieve +**id:** `String` — ID of the user to retrieve. + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false).
@@ -9407,7 +12804,7 @@ client.selfServiceProfiles().get("id");
-
client.selfServiceProfiles.delete(id) +
client.users.delete(id)
@@ -9419,7 +12816,7 @@ client.selfServiceProfiles().get("id");
-Deletes a self-service profile by Id. +Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users.
@@ -9434,7 +12831,7 @@ Deletes a self-service profile by Id.
```java -client.selfServiceProfiles().delete("id"); +client.users().delete("id"); ```
@@ -9449,7 +12846,7 @@ client.selfServiceProfiles().delete("id");
-**id:** `String` — The id of the self-service profile to delete +**id:** `String` — ID of the user to delete.
@@ -9461,7 +12858,7 @@ client.selfServiceProfiles().delete("id");
-
client.selfServiceProfiles.update(id, request) -> UpdateSelfServiceProfileResponseContent +
client.users.update(id, request) -> UpdateUserResponseContent
@@ -9473,7 +12870,76 @@ client.selfServiceProfiles().delete("id");
-Updates a self-service profile. +Update a user. + +These are the attributes that can be updated at the root level: + +
    +
  • app_metadata
  • +
  • blocked
  • +
  • email
  • +
  • email_verified
  • +
  • family_name
  • +
  • given_name
  • +
  • name
  • +
  • nickname
  • +
  • password
  • +
  • phone_number
  • +
  • phone_verified
  • +
  • picture
  • +
  • username
  • +
  • user_metadata
  • +
  • verify_email
  • +
+ +Some considerations: +
    +
  • The properties of the new object will replace the old ones.
  • +
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • +
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • +
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • +
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • +
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • +
  • Supported attributes can be unset by supplying null as the value.
  • +
+ +
Updating a field (non-metadata property)
+To mark the email address of a user as verified, the body to send should be: +
{ "email_verified": true }
+ +
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: +
{ "user_metadata" : { "profileCode": 1479 } }
+ +To add the field addresses the body to send should be: +
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ +The modified object ends up with the following user_metadata property:
{
+  "user_metadata": {
+    "profileCode": 1479,
+    "addresses": { "work_address": "100 Industrial Way" }
+  }
+}
+ +
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: +
{
+  "user_metadata": {
+    "addresses": {
+      "work_address": "100 Industrial Way",
+      "home_address": "742 Evergreen Terrace"
+    }
+  }
+}
+ +The modified object ends up with the following user_metadata property: +
{
+  "user_metadata": {
+    "profileCode": 1479,
+    "addresses": {
+      "work_address": "100 Industrial Way",
+      "home_address": "742 Evergreen Terrace"
+    }
+  }
+}
@@ -9488,9 +12954,9 @@ Updates a self-service profile.
```java -client.selfServiceProfiles().update( +client.users().update( "id", - UpdateSelfServiceProfileRequestContent + UpdateUserRequestContent .builder() .build() ); @@ -9508,7 +12974,7 @@ client.selfServiceProfiles().update(
-**id:** `String` — The id of the self-service profile to update +**id:** `String` — ID of the user to update.
@@ -9516,7 +12982,7 @@ client.selfServiceProfiles().update(
-**name:** `Optional` — The name of the self-service Profile. +**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false).
@@ -9524,7 +12990,7 @@ client.selfServiceProfiles().update(
-**description:** `Optional` +**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). If set to false the user will not receive a verification email unless `verify_email` is set to true.
@@ -9532,7 +12998,7 @@ client.selfServiceProfiles().update(
-**branding:** `Optional` +**email:** `Optional` — Email address of this user.
@@ -9540,7 +13006,7 @@ client.selfServiceProfiles().update(
-**allowedStrategies:** `Optional>` — List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `keycloak-samlp`, `pingfederate`] +**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation).
@@ -9548,62 +13014,111 @@ client.selfServiceProfiles().update(
-**userAttributes:** `Optional>` +**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false).
+ +
+
+ +**userMetadata:** `Optional>` +
+
+
+**appMetadata:** `Optional>` +
-
-## Sessions -
client.sessions.get(id) -> GetSessionResponseContent
-#### 📝 Description +**givenName:** `Optional` — Given name/first name/forename of this user. + +
+
+**familyName:** `Optional` — Family name/last name/surname of this user. + +
+
+
-Retrieve session information. +**name:** `Optional` — Name of this user. +
+ +
+
+ +**nickname:** `Optional` — Preferred nickname or alias of this user. +
-#### 🔌 Usage +
+
+ +**picture:** `Optional` — URL to picture, photo, or avatar of this user. + +
+
+**verifyEmail:** `Optional` — Whether this user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter. + +
+
+
-```java -client.sessions().get("id"); -``` +**verifyPhoneNumber:** `Optional` — Whether this user will receive a text after changing the phone number (true) or no text (false). Only valid when changing phone number for SMS connections. +
+ +
+
+ +**password:** `Optional` — New password for this user. Only valid for database connections. +
-#### ⚙️ Parameters +
+
+ +**connection:** `Optional` — Name of the connection to target for this user update. + +
+
+**clientId:** `Optional` — Auth0 client ID. Only valid when updating email address. + +
+
+
-**id:** `String` — ID of session to retrieve +**username:** `Optional` — The user's username. Only valid if the connection requires a username.
@@ -9615,7 +13130,7 @@ client.sessions().get("id");
-
client.sessions.delete(id) +
client.users.regenerateRecoveryCode(id) -> RegenerateUsersRecoveryCodeResponseContent
@@ -9627,7 +13142,7 @@ client.sessions().get("id");
-Delete a session by ID. +Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate.
@@ -9642,7 +13157,7 @@ Delete a session by ID.
```java -client.sessions().delete("id"); +client.users().regenerateRecoveryCode("id"); ```
@@ -9657,7 +13172,7 @@ client.sessions().delete("id");
-**id:** `String` — ID of the session to delete. +**id:** `String` — ID of the user to regenerate a multi-factor authentication recovery code for.
@@ -9669,7 +13184,7 @@ client.sessions().delete("id");
-
client.sessions.revoke(id) +
client.users.revokeAccess(id, request)
@@ -9681,7 +13196,7 @@ client.sessions().delete("id");
-Revokes a session by ID and all associated refresh tokens. +Revokes selected resources related to a user (sessions, refresh tokens, ...).
@@ -9696,7 +13211,12 @@ Revokes a session by ID and all associated refresh tokens.
```java -client.sessions().revoke("id"); +client.users().revokeAccess( + "id", + RevokeUserAccessRequestContent + .builder() + .build() +); ```
@@ -9711,48 +13231,24 @@ client.sessions().revoke("id");
-**id:** `String` — ID of the session to revoke. +**id:** `String` — ID of the user.
- - - - - - -
- -## Stats -
client.stats.getActiveUsersCount() -> Double -
-
- -#### 📝 Description
-
-
- -Retrieve the number of active users that logged in during the last 30 days. -
-
+**sessionId:** `Optional` — ID of the session to revoke. +
-#### 🔌 Usage - -
-
-
-```java -client.stats().getActiveUsersCount(); -``` +**preserveRefreshTokens:** `Optional` — Whether to preserve the refresh tokens associated with the session. +
@@ -9763,7 +13259,8 @@ client.stats().getActiveUsersCount();
-
client.stats.getDaily() -> List<DailyStats> +## Actions Versions +
client.actions.versions.list(actionId) -> SyncPagingIterable<ActionVersion>
@@ -9775,7 +13272,7 @@ client.stats().getActiveUsersCount();
-Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. +Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created.
@@ -9790,11 +13287,16 @@ Retrieve the number of logins, signups and breached-password detections (subscri
```java -client.stats().getDaily( - GetDailyStatsRequestParameters +client.actions().versions().list( + "actionId", + ListActionVersionsRequestParameters .builder() - .from("from") - .to("to") + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) .build() ); ``` @@ -9811,7 +13313,7 @@ client.stats().getDaily(
-**from:** `Optional` — Optional first day of the date range (inclusive) in YYYYMMDD format. +**actionId:** `String` — The ID of the action.
@@ -9819,48 +13321,16 @@ client.stats().getDaily(
-**to:** `Optional` — Optional last day of the date range (inclusive) in YYYYMMDD format. +**page:** `Optional` — Use this field to request a specific page of the list results.
-
-
- - - - -
- -## SupplementalSignals -
client.supplementalSignals.get() -> GetSupplementalSignalsResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Get the supplemental signals configuration for a tenant. -
-
-
-
- -#### 🔌 Usage - -
-
-```java -client.supplementalSignals().get(); -``` +**perPage:** `Optional` — This field specify the maximum number of results to be returned by the server. 20 by default +
@@ -9871,7 +13341,7 @@ client.supplementalSignals().get();
-
client.supplementalSignals.patch(request) -> PatchSupplementalSignalsResponseContent +
client.actions.versions.get(actionId, id) -> GetActionVersionResponseContent
@@ -9883,7 +13353,7 @@ client.supplementalSignals().get();
-Update the supplemental signals configuration for a tenant. +Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created.
@@ -9898,12 +13368,7 @@ Update the supplemental signals configuration for a tenant.
```java -client.supplementalSignals().patch( - UpdateSupplementalSignalsRequestContent - .builder() - .akamaiEnabled(true) - .build() -); +client.actions().versions().get("actionId", "id"); ```
@@ -9918,7 +13383,15 @@ client.supplementalSignals().patch(
-**akamaiEnabled:** `Boolean` — Indicates if incoming Akamai Headers should be processed +**actionId:** `String` — The ID of the action. + +
+
+ +
+
+ +**id:** `String` — The ID of the action version.
@@ -9930,8 +13403,7 @@ client.supplementalSignals().patch(
-## Tickets -
client.tickets.verifyEmail(request) -> VerifyEmailTicketResponseContent +
client.actions.versions.deploy(actionId, id, request) -> DeployActionVersionResponseContent
@@ -9943,7 +13415,7 @@ client.supplementalSignals().patch(
-Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. +Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately.
@@ -9958,59 +13430,26 @@ Create an email verification ticket for a given user. An email verification tick
```java -client.tickets().verifyEmail( - VerifyEmailTicketRequestContent - .builder() - .userId("user_id") - .build() +client.actions().versions().deploy( + "actionId", + "id", + OptionalNullable.absent() ); ```
- -#### ⚙️ Parameters - -
-
- -
-
- -**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. - -
-
- -
-
- -**userId:** `String` — user_id of for whom the ticket should be created. - -
-
- -
-
- -**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. - -
-
+ +#### ⚙️ Parameters
-**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. - -
-
-
-**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). +**actionId:** `String` — The ID of an action.
@@ -10018,7 +13457,7 @@ client.tickets().verifyEmail(
-**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). +**id:** `String` — The ID of an action version.
@@ -10026,7 +13465,7 @@ client.tickets().verifyEmail(
-**identity:** `Optional` +**request:** `Optional`
@@ -10038,7 +13477,8 @@ client.tickets().verifyEmail(
-
client.tickets.changePassword(request) -> ChangePasswordTicketResponseContent +## Actions Executions +
client.actions.executions.get(id) -> GetActionExecutionResponseContent
@@ -10050,9 +13490,7 @@ client.tickets().verifyEmail(
-Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. - -Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity. +Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation.
@@ -10067,11 +13505,7 @@ Note: This endpoint does not verify the given user’s identity. If you call thi
```java -client.tickets().changePassword( - ChangePasswordTicketRequestContent - .builder() - .build() -); +client.actions().executions().get("id"); ```
@@ -10086,72 +13520,48 @@ client.tickets().changePassword(
-**resultUrl:** `Optional` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. +**id:** `String` — The ID of the execution to retrieve.
- -
-
- -**userId:** `Optional` — user_id of for whom the ticket should be created. -
-
-
-**clientId:** `Optional` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. -
+
+## Actions Triggers +
client.actions.triggers.list() -> ListActionTriggersResponseContent
-**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. - -
-
+#### 📝 Description
-**connectionId:** `Optional` — ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. - -
-
-
-**email:** `Optional` — Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id. - +Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound.
- -
-
- -**ttlSec:** `Optional` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). -
+#### 🔌 Usage +
-**markEmailAsVerified:** `Optional` — Whether to set the email_verified attribute to true (true) or whether it should not be updated (false). - -
-
-
-**includeEmailInRedirect:** `Optional` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). - +```java +client.actions().triggers().list(); +```
@@ -10162,8 +13572,8 @@ client.tickets().changePassword(
-## TokenExchangeProfiles -
client.tokenExchangeProfiles.list() -> SyncPagingIterable<TokenExchangeProfileResponseContent> +## Actions Triggers Bindings +
client.actions.triggers.bindings.list(triggerId) -> SyncPagingIterable<ActionBinding>
@@ -10175,15 +13585,7 @@ client.tickets().changePassword(
-Retrieve a list of all Token Exchange Profiles available in your tenant. - -This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- -Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow.
@@ -10198,11 +13600,16 @@ This endpoint supports Checkpoint pagination. To search by checkpoint, use the f
```java -client.tokenExchangeProfiles().list( - TokenExchangeProfilesListRequest +client.actions().triggers().bindings().list( + "triggerId", + ListActionTriggerBindingsRequestParameters .builder() - .from("from") - .take(1) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) .build() ); ``` @@ -10219,7 +13626,7 @@ client.tokenExchangeProfiles().list(
-**from:** `Optional` — Optional Id from which to start selection. +**triggerId:** `String` — An actions extensibility point.
@@ -10227,7 +13634,15 @@ client.tokenExchangeProfiles().list(
-**take:** `Optional` — Number of results per page. Defaults to 50. +**page:** `Optional` — Use this field to request a specific page of the list results. + +
+
+ +
+
+ +**perPage:** `Optional` — The maximum number of results to be returned in a single request. 20 by default
@@ -10239,7 +13654,7 @@ client.tokenExchangeProfiles().list(
-
client.tokenExchangeProfiles.create(request) -> CreateTokenExchangeProfileResponseContent +
client.actions.triggers.bindings.updateMany(triggerId, request) -> UpdateActionBindingsResponseContent
@@ -10251,7 +13666,7 @@ client.tokenExchangeProfiles().list(
-Create a new Token Exchange Profile within your tenant. +Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed.
@@ -10266,13 +13681,10 @@ Create a new Token Exchange Profile within your tenant.
```java -client.tokenExchangeProfiles().create( - CreateTokenExchangeProfileRequestContent +client.actions().triggers().bindings().updateMany( + "triggerId", + UpdateActionBindingsRequestContent .builder() - .name("name") - .subjectTokenType("subject_token_type") - .actionId("action_id") - .type("custom_authentication") .build() ); ``` @@ -10289,23 +13701,7 @@ client.tokenExchangeProfiles().create(
-**name:** `String` — Friendly name of this profile. - -
-
- -
-
- -**subjectTokenType:** `String` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. - -
-
- -
-
- -**actionId:** `String` — The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. +**triggerId:** `String` — An actions extensibility point.
@@ -10313,7 +13709,7 @@ client.tokenExchangeProfiles().create(
-**type:** `String` +**bindings:** `Optional>` — The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed.
@@ -10325,7 +13721,8 @@ client.tokenExchangeProfiles().create(
-
client.tokenExchangeProfiles.get(id) -> GetTokenExchangeProfileResponseContent +## Anomaly Blocks +
client.anomaly.blocks.checkIp(id)
@@ -10337,7 +13734,7 @@ client.tokenExchangeProfiles().create(
-Retrieve details about a single Token Exchange Profile specified by ID. +Check if the given IP address is blocked via the Suspicious IP Throttling due to multiple suspicious attempts.
@@ -10352,7 +13749,7 @@ Retrieve details about a single Token Exchange Profile specified by ID.
```java -client.tokenExchangeProfiles().get("id"); +client.anomaly().blocks().checkIp("id"); ```
@@ -10367,7 +13764,7 @@ client.tokenExchangeProfiles().get("id");
-**id:** `String` — ID of the Token Exchange Profile to retrieve. +**id:** `String` — IP address to check.
@@ -10379,7 +13776,7 @@ client.tokenExchangeProfiles().get("id");
-
client.tokenExchangeProfiles.delete(id) +
client.anomaly.blocks.unblockIp(id)
@@ -10391,7 +13788,7 @@ client.tokenExchangeProfiles().get("id");
-Delete a Token Exchange Profile within your tenant. +Remove a block imposed by Suspicious IP Throttling for the given IP address.
@@ -10406,7 +13803,7 @@ Delete a Token Exchange Profile within your tenant.
```java -client.tokenExchangeProfiles().delete("id"); +client.anomaly().blocks().unblockIp("id"); ```
@@ -10421,7 +13818,7 @@ client.tokenExchangeProfiles().delete("id");
-**id:** `String` — ID of the Token Exchange Profile to delete. +**id:** `String` — IP address to unblock.
@@ -10433,7 +13830,8 @@ client.tokenExchangeProfiles().delete("id");
-
client.tokenExchangeProfiles.update(id, request) +## AttackProtection BotDetection +
client.attackProtection.botDetection.get() -> GetBotDetectionSettingsResponseContent
@@ -10445,7 +13843,7 @@ client.tokenExchangeProfiles().delete("id");
-Update a Token Exchange Profile within your tenant. +Get the Bot Detection configuration of your tenant.
@@ -10460,56 +13858,19 @@ Update a Token Exchange Profile within your tenant.
```java -client.tokenExchangeProfiles().update( - "id", - UpdateTokenExchangeProfileRequestContent - .builder() - .build() -); +client.attackProtection().botDetection().get(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — ID of the Token Exchange Profile to update. - -
-
- -
-
- -**name:** `Optional` — Friendly name of this profile. - -
-
- -
-
- -**subjectTokenType:** `Optional` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. - -
-
-
-
-
-## UserBlocks -
client.userBlocks.listByIdentifier() -> ListUserBlocksByIdentifierResponseContent +
client.attackProtection.botDetection.update(request) -> UpdateBotDetectionSettingsResponseContent
@@ -10521,7 +13882,7 @@ client.tokenExchangeProfiles().update(
-Retrieve details of all Brute-force Protection blocks for a user with the given identifier (username, phone number, or email). +Update the Bot Detection configuration of your tenant.
@@ -10536,11 +13897,9 @@ Retrieve details of all
-**identifier:** `String` — Should be any of a username, phone number, or email. +**botDetectionLevel:** `Optional`
@@ -10565,44 +13924,56 @@ client.userBlocks().listByIdentifier(
-**considerBruteForceEnablement:** `Optional` - - - If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. - If true and Brute Force Protection is disabled, will return an empty list. - +**challengePasswordPolicy:** `Optional`
- - +
+
+**challengePasswordlessPolicy:** `Optional` +
-
-
client.userBlocks.deleteByIdentifier()
-#### 📝 Description +**challengePasswordResetPolicy:** `Optional` + +
+
+**allowlist:** `Optional>` + +
+
+
-Remove all Brute-force Protection blocks for the user with the given identifier (username, phone number, or email). - -Note: This endpoint does not unblock users that were blocked by a tenant administrator. +**monitoringModeEnabled:** `Optional` +
-#### 🔌 Usage + + + +
+ +## AttackProtection BreachedPasswordDetection +
client.attackProtection.breachedPasswordDetection.get() -> GetBreachedPasswordDetectionSettingsResponseContent +
+
+ +#### 📝 Description
@@ -10610,20 +13981,13 @@ Note: This endpoint does not unblock users that were
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -10631,8 +13995,9 @@ client.userBlocks().deleteByIdentifier(
-**identifier:** `String` — Should be any of a username, phone number, or email. - +```java +client.attackProtection().breachedPasswordDetection().get(); +```
@@ -10643,7 +14008,7 @@ client.userBlocks().deleteByIdentifier(
-
client.userBlocks.list(id) -> ListUserBlocksResponseContent +
client.attackProtection.breachedPasswordDetection.update(request) -> UpdateBreachedPasswordDetectionSettingsResponseContent
@@ -10655,7 +14020,7 @@ client.userBlocks().deleteByIdentifier(
-Retrieve details of all Brute-force Protection blocks for the user with the given ID. +Update details of the Breached Password Detection configuration of your tenant.
@@ -10670,11 +14035,9 @@ Retrieve details of all
-**id:** `String` — user_id of the user blocks to retrieve. +**enabled:** `Optional` — Whether or not breached password detection is active.
@@ -10699,44 +14062,54 @@ client.userBlocks().list(
-**considerBruteForceEnablement:** `Optional` - +**shields:** `Optional>` - If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. - If true and Brute Force Protection is disabled, will return an empty list. - +Action to take when a breached password is detected during a login. + Possible values: block, user_notification, admin_notification.
- - +
+
+ +**adminNotificationFrequency:** `Optional>` +When "admin_notification" is enabled, determines how often email notifications are sent. + Possible values: immediately, daily, weekly, monthly. +
-
-
client.userBlocks.delete(id)
-#### 📝 Description - -
-
+**method:** `Optional` + +
+
-Remove all Brute-force Protection blocks for the user with the given ID. - -Note: This endpoint does not unblock users that were blocked by a tenant administrator. +**stage:** `Optional` +
-#### 🔌 Usage + + + +
+ +## AttackProtection BruteForceProtection +
client.attackProtection.bruteForceProtection.get() -> GetBruteForceSettingsResponseContent +
+
+ +#### 📝 Description
@@ -10744,15 +14117,13 @@ Note: This endpoint does not unblock users that were
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -10760,8 +14131,9 @@ client.userBlocks().delete("id");
-**id:** `String` — The user_id of the user to update. - +```java +client.attackProtection().bruteForceProtection().get(); +```
@@ -10772,8 +14144,7 @@ client.userBlocks().delete("id");
-## Users -
client.users.list() -> SyncPagingIterable<UserResponseSchema> +
client.attackProtection.bruteForceProtection.update(request) -> UpdateBruteForceSettingsResponseContent
@@ -10785,20 +14156,7 @@ client.userBlocks().delete("id");
-Retrieve details of users. It is possible to: - -- Specify a search criteria for users -- Sort the users to be returned -- Select the fields to be returned -- Specify the number of users to retrieve per page and the page index - -The q query parameter can be used to get users that match the specified criteria using query string syntax. - -Learn more about searching for users. - -Read about best practices when working with the API endpoints for retrieving users. - -Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. +Update the Brute-force Protection configuration of your tenant.
@@ -10813,19 +14171,9 @@ Auth0 limits the number of users you can return. If you exceed this threshold, p
```java -client.users().list( - ListUsersRequestParameters +client.attackProtection().bruteForceProtection().update( + UpdateBruteForceSettingsRequestContent .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .sort("sort") - .connection("connection") - .fields("fields") - .includeFields(true) - .q("q") - .searchEngine(SearchEngineVersionsEnum.V1) - .primaryOrder(true) .build() ); ``` @@ -10842,7 +14190,7 @@ client.users().list(
-**page:** `Optional` — Page index of the results to return. First page is 0. +**enabled:** `Optional` — Whether or not brute force attack protections are active.
@@ -10850,7 +14198,10 @@ client.users().list(
-**perPage:** `Optional` — Number of results per page. +**shields:** `Optional>` + +Action to take when a brute force protection threshold is violated. + Possible values: block, user_notification.
@@ -10858,7 +14209,7 @@ client.users().list(
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**allowlist:** `Optional>` — List of trusted IP addresses that will not have attack protection enforced against them.
@@ -10866,7 +14217,10 @@ client.users().list(
-**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1 +**mode:** `Optional` + +Account Lockout: Determines whether or not IP address is used when counting failed attempts. + Possible values: count_per_identifier_and_ip, count_per_identifier.
@@ -10874,48 +14228,48 @@ client.users().list(
-**connection:** `Optional` — Connection filter. Only applies when using search_engine=v1. To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name" +**maxAttempts:** `Optional` — Maximum number of unsuccessful attempts.
+
+
-
-
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. -
+
+## AttackProtection Captcha +
client.attackProtection.captcha.get() -> GetAttackProtectionCaptchaResponseContent
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). - -
-
+#### 📝 Description
-**q:** `Optional` — Query in Lucene query string syntax. Some query types cannot be used on metadata fields, for details see Searchable Fields. - -
-
-
-**searchEngine:** `Optional` — The version of the search engine - +Get the CAPTCHA configuration for your client. +
+
+#### 🔌 Usage +
-**primaryOrder:** `Optional` — If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. - +
+
+ +```java +client.attackProtection().captcha().get(); +```
@@ -10926,7 +14280,7 @@ client.users().list(
-
client.users.create(request) -> CreateUserResponseContent +
client.attackProtection.captcha.update(request) -> UpdateAttackProtectionCaptchaResponseContent
@@ -10938,9 +14292,7 @@ client.users().list(
-Create a new user for a given database or passwordless connection. - -Note: connection is required but other parameters such as email and password are dependent upon the type of connection. +Update existing CAPTCHA configuration for your client.
@@ -10955,10 +14307,9 @@ Note: connection is required but other parameters such as ema
```java -client.users().create( - CreateUserRequestContent +client.attackProtection().captcha().update( + UpdateAttackProtectionCaptchaRequestContent .builder() - .connection("connection") .build() ); ``` @@ -10975,7 +14326,7 @@ client.users().create(
-**email:** `Optional` — The user's email. +**activeProviderId:** `Optional`
@@ -10983,7 +14334,7 @@ client.users().create(
-**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation). +**arkose:** `Optional`
@@ -10991,7 +14342,7 @@ client.users().create(
-**userMetadata:** `Optional>` +**authChallenge:** `Optional`
@@ -10999,7 +14350,7 @@ client.users().create(
-**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false). +**hcaptcha:** `Optional`
@@ -11007,7 +14358,7 @@ client.users().create(
-**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if `email_verified` is false or not specified +**friendlyCaptcha:** `Optional`
@@ -11015,7 +14366,7 @@ client.users().create(
-**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false). +**recaptchaEnterprise:** `Optional`
@@ -11023,7 +14374,7 @@ client.users().create(
-**appMetadata:** `Optional>` +**recaptchaV2:** `Optional`
@@ -11031,80 +14382,48 @@ client.users().create(
-**givenName:** `Optional` — The user's given name(s). +**simpleCaptcha:** `Optional>`
- -
-
- -**familyName:** `Optional` — The user's family name(s). -
-
-
-**name:** `Optional` — The user's full name. -
+
+## AttackProtection SuspiciousIpThrottling +
client.attackProtection.suspiciousIpThrottling.get() -> GetSuspiciousIpThrottlingSettingsResponseContent
-**nickname:** `Optional` — The user's nickname. - -
-
+#### 📝 Description
-**picture:** `Optional` — A URI pointing to the user's picture. - -
-
-
-**userId:** `Optional` — The external user's id provided by the identity provider. - +Retrieve details of the Suspicious IP Throttling configuration of your tenant.
- -
-
- -**connection:** `String` — Name of the connection this user should be created in. -
-
-
- -**password:** `Optional` — Initial password for this user. Only valid for auth0 connection strategy. - -
-
+#### 🔌 Usage
-**verifyEmail:** `Optional` — Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter. - -
-
-
-**username:** `Optional` — The user's username. Only valid if the connection requires a username. - +```java +client.attackProtection().suspiciousIpThrottling().get(); +```
@@ -11115,7 +14434,7 @@ client.users().create(
-
client.users.listUsersByEmail() -> List<UserResponseSchema> +
client.attackProtection.suspiciousIpThrottling.update(request) -> UpdateSuspiciousIpThrottlingSettingsResponseContent
@@ -11127,11 +14446,7 @@ client.users().create(
-Find users by email. If Auth0 is the identity provider (idP), the email address associated with a user is saved in lower case, regardless of how you initially provided it. - -For example, if you register a user as JohnSmith@example.com, Auth0 saves the user's email as johnsmith@example.com. - -Therefore, when using this endpoint, make sure that you are searching for users via email addresses using the correct case. +Update the details of the Suspicious IP Throttling configuration of your tenant.
@@ -11146,12 +14461,9 @@ Therefore, when using this endpoint, make sure that you are searching for users
```java -client.users().listUsersByEmail( - ListUsersByEmailRequestParameters +client.attackProtection().suspiciousIpThrottling().update( + UpdateSuspiciousIpThrottlingSettingsRequestContent .builder() - .email("email") - .fields("fields") - .includeFields(true) .build() ); ``` @@ -11168,7 +14480,7 @@ client.users().listUsersByEmail(
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +**enabled:** `Optional` — Whether or not suspicious IP throttling attack protections are active.
@@ -11176,93 +14488,53 @@ client.users().listUsersByEmail(
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). Defaults to true. - -
-
- -
-
+**shields:** `Optional>` -**email:** `String` — Email address to search for (case-sensitive). +Action to take when a suspicious IP throttling threshold is violated. + Possible values: block, admin_notification. -
-
-
-
- - - - -
- -
client.users.get(id) -> GetUserResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. -
-
-#### 🔌 Usage -
+**allowlist:** `Optional>` + +
+
+
-```java -client.users().get( - "id", - GetUserRequestParameters - .builder() - .fields("fields") - .includeFields(true) - .build() -); -``` +**stage:** `Optional` +
-#### ⚙️ Parameters -
-
+
+
+
+## Branding Templates +
client.branding.templates.getUniversalLogin() -> GetUniversalLoginTemplateResponseContent
-**id:** `String` — ID of the user to retrieve. - -
-
+#### 🔌 Usage
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. - -
-
-
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). - +```java +client.branding().templates().getUniversalLogin(); +```
@@ -11273,7 +14545,7 @@ client.users().get(
-
client.users.delete(id) +
client.branding.templates.updateUniversalLogin(request)
@@ -11285,7 +14557,30 @@ client.users().get(
-Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. +Update the Universal Login branding template. + +

When content-type header is set to application/json:

+
+{
+  "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+}
+
+ +

+ When content-type header is set to text/html: +

+
+<!DOCTYPE html>
+{% assign resolved_dir = dir | default: "auto" %}
+<html lang="{{locale}}" dir="{{resolved_dir}}">
+  <head>
+    {%- auth0:head -%}
+  </head>
+  <body class="_widget-auto-layout">
+    {%- auth0:widget -%}
+  </body>
+</html>
+
@@ -11300,7 +14595,9 @@ Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard inst
```java -client.users().delete("id"); +client.branding().templates().updateUniversalLogin( + UpdateUniversalLoginTemplateRequestContent.of("string") +); ```
@@ -11315,7 +14612,7 @@ client.users().delete("id");
-**id:** `String` — ID of the user to delete. +**request:** `UpdateUniversalLoginTemplateRequestContent`
@@ -11327,11 +14624,11 @@ client.users().delete("id");
-
client.users.update(id, request) -> UpdateUserResponseContent +
client.branding.templates.deleteUniversalLogin()
-#### 📝 Description +#### 🔌 Usage
@@ -11339,76 +14636,33 @@ client.users().delete("id");
-Update a user. - -These are the attributes that can be updated at the root level: - -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+```java +client.branding().templates().deleteUniversalLogin(); +``` +
+
+
+
-Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
-
Updating a field (non-metadata property)
-To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
+
+
+
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+## Branding Themes +
client.branding.themes.create(request) -> CreateBrandingThemeResponseContent +
+
-To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+#### 📝 Description -The modified object ends up with the following user_metadata property:
{
-  "user_metadata": {
-    "profileCode": 1479,
-    "addresses": { "work_address": "100 Industrial Way" }
-  }
-}
+
+
-
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
-  "user_metadata": {
-    "addresses": {
-      "work_address": "100 Industrial Way",
-      "home_address": "742 Evergreen Terrace"
-    }
-  }
-}
+
+
-The modified object ends up with the following user_metadata property: -
{
-  "user_metadata": {
-    "profileCode": 1479,
-    "addresses": {
-      "work_address": "100 Industrial Way",
-      "home_address": "742 Evergreen Terrace"
-    }
-  }
-}
+Create branding theme.
@@ -11423,10 +14677,112 @@ The modified object ends up with the following user_metadata proper
```java -client.users().update( - "id", - UpdateUserRequestContent +client.branding().themes().create( + CreateBrandingThemeRequestContent .builder() + .borders( + BrandingThemeBorders + .builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build() + ) + .colors( + BrandingThemeColors + .builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build() + ) + .fonts( + BrandingThemeFonts + .builder() + .bodyText( + BrandingThemeFontBodyText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .buttonsText( + BrandingThemeFontButtonsText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .fontUrl("font_url") + .inputLabels( + BrandingThemeFontInputLabels + .builder() + .bold(true) + .size(1.1) + .build() + ) + .links( + BrandingThemeFontLinks + .builder() + .bold(true) + .size(1.1) + .build() + ) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle( + BrandingThemeFontSubtitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .title( + BrandingThemeFontTitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .build() + ) + .pageBackground( + BrandingThemePageBackground + .builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build() + ) + .widget( + BrandingThemeWidget + .builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build() + ) .build() ); ``` @@ -11443,7 +14799,7 @@ client.users().update(
-**id:** `String` — ID of the user to update. +**borders:** `BrandingThemeBorders`
@@ -11451,7 +14807,7 @@ client.users().update(
-**blocked:** `Optional` — Whether this user was blocked by an administrator (true) or not (false). +**colors:** `BrandingThemeColors`
@@ -11459,7 +14815,7 @@ client.users().update(
-**emailVerified:** `Optional` — Whether this email address is verified (true) or unverified (false). If set to false the user will not receive a verification email unless `verify_email` is set to true. +**displayName:** `Optional` — Display Name
@@ -11467,7 +14823,7 @@ client.users().update(
-**email:** `Optional` — Email address of this user. +**fonts:** `BrandingThemeFonts`
@@ -11475,7 +14831,7 @@ client.users().update(
-**phoneNumber:** `Optional` — The user's phone number (following the E.164 recommendation). +**pageBackground:** `BrandingThemePageBackground`
@@ -11483,111 +14839,100 @@ client.users().update(
-**phoneVerified:** `Optional` — Whether this phone number has been verified (true) or not (false). +**widget:** `BrandingThemeWidget`
+
+
-
-
-**userMetadata:** `Optional>` -
+
+
client.branding.themes.getDefault() -> GetBrandingDefaultThemeResponseContent
-**appMetadata:** `Optional>` - -
-
+#### 📝 Description
-**givenName:** `Optional` — Given name/first name/forename of this user. - -
-
-
-**familyName:** `Optional` — Family name/last name/surname of this user. - +Retrieve default branding theme. +
+
+#### 🔌 Usage +
-**name:** `Optional` — Name of this user. - -
-
-
-**nickname:** `Optional` — Preferred nickname or alias of this user. - +```java +client.branding().themes().getDefault(); +``` +
+
-
-
-**picture:** `Optional` — URL to picture, photo, or avatar of this user. -
+
+
client.branding.themes.get(themeId) -> GetBrandingThemeResponseContent
-**verifyEmail:** `Optional` — Whether this user will receive a verification email after creation (true) or no email (false). Overrides behavior of `email_verified` parameter. - -
-
+#### 📝 Description
-**verifyPhoneNumber:** `Optional` — Whether this user will receive a text after changing the phone number (true) or no text (false). Only valid when changing phone number for SMS connections. - -
-
-
-**password:** `Optional` — New password for this user. Only valid for database connections. - +Retrieve branding theme.
+ + + +#### 🔌 Usage
-**connection:** `Optional` — Name of the connection to target for this user update. - -
-
-
-**clientId:** `Optional` — Auth0 client ID. Only valid when updating email address. - +```java +client.branding().themes().get("themeId"); +``` +
+
+#### ⚙️ Parameters +
-**username:** `Optional` — The user's username. Only valid if the connection requires a username. +
+
+ +**themeId:** `String` — The ID of the theme
@@ -11599,7 +14944,7 @@ client.users().update(
-
client.users.regenerateRecoveryCode(id) -> RegenerateUsersRecoveryCodeResponseContent +
client.branding.themes.delete(themeId)
@@ -11611,7 +14956,7 @@ client.users().update(
-Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. +Delete branding theme.
@@ -11626,7 +14971,7 @@ Remove an existing multi-factor authentication (MFA)
@@ -11641,7 +14986,7 @@ client.users().regenerateRecoveryCode("id");
-**id:** `String` — ID of the user to regenerate a multi-factor authentication recovery code for. +**themeId:** `String` — The ID of the theme
@@ -11653,7 +14998,7 @@ client.users().regenerateRecoveryCode("id");
-
client.users.revokeAccess(id, request) +
client.branding.themes.update(themeId, request) -> UpdateBrandingThemeResponseContent
@@ -11665,7 +15010,7 @@ client.users().regenerateRecoveryCode("id");
-Revokes selected resources related to a user (sessions, refresh tokens, ...). +Update branding theme.
@@ -11680,10 +15025,113 @@ Revokes selected resources related to a user (sessions, refresh tokens, ...).
```java -client.users().revokeAccess( - "id", - RevokeUserAccessRequestContent +client.branding().themes().update( + "themeId", + UpdateBrandingThemeRequestContent .builder() + .borders( + BrandingThemeBorders + .builder() + .buttonBorderRadius(1.1) + .buttonBorderWeight(1.1) + .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) + .inputBorderRadius(1.1) + .inputBorderWeight(1.1) + .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) + .showWidgetShadow(true) + .widgetBorderWeight(1.1) + .widgetCornerRadius(1.1) + .build() + ) + .colors( + BrandingThemeColors + .builder() + .bodyText("body_text") + .error("error") + .header("header") + .icons("icons") + .inputBackground("input_background") + .inputBorder("input_border") + .inputFilledText("input_filled_text") + .inputLabelsPlaceholders("input_labels_placeholders") + .linksFocusedComponents("links_focused_components") + .primaryButton("primary_button") + .primaryButtonLabel("primary_button_label") + .secondaryButtonBorder("secondary_button_border") + .secondaryButtonLabel("secondary_button_label") + .success("success") + .widgetBackground("widget_background") + .widgetBorder("widget_border") + .build() + ) + .fonts( + BrandingThemeFonts + .builder() + .bodyText( + BrandingThemeFontBodyText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .buttonsText( + BrandingThemeFontButtonsText + .builder() + .bold(true) + .size(1.1) + .build() + ) + .fontUrl("font_url") + .inputLabels( + BrandingThemeFontInputLabels + .builder() + .bold(true) + .size(1.1) + .build() + ) + .links( + BrandingThemeFontLinks + .builder() + .bold(true) + .size(1.1) + .build() + ) + .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) + .referenceTextSize(1.1) + .subtitle( + BrandingThemeFontSubtitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .title( + BrandingThemeFontTitle + .builder() + .bold(true) + .size(1.1) + .build() + ) + .build() + ) + .pageBackground( + BrandingThemePageBackground + .builder() + .backgroundColor("background_color") + .backgroundImageUrl("background_image_url") + .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) + .build() + ) + .widget( + BrandingThemeWidget + .builder() + .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) + .logoHeight(1.1) + .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) + .logoUrl("logo_url") + .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) + .build() + ) .build() ); ``` @@ -11700,15 +15148,7 @@ client.users().revokeAccess(
-**id:** `String` — ID of the user. - -
-
- -
-
- -**sessionId:** `Optional` — ID of the session to revoke. +**themeId:** `String` — The ID of the theme
@@ -11716,69 +15156,31 @@ client.users().revokeAccess(
-**preserveRefreshTokens:** `Optional` — Whether to preserve the refresh tokens associated with the session. +**borders:** `BrandingThemeBorders`
-
-
-
- - - - -
- -## Actions Versions -
client.actions.versions.list(actionId) -> SyncPagingIterable<ActionVersion> -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. -
-
-
-
- -#### 🔌 Usage - -
-
+
-```java -client.actions().versions().list( - "actionId", - ListActionVersionsRequestParameters - .builder() - .page(1) - .perPage(1) - .build() -); -``` -
-
+**colors:** `BrandingThemeColors` +
-#### ⚙️ Parameters -
+**displayName:** `Optional` — Display Name + +
+
+
-**actionId:** `String` — The ID of the action. +**fonts:** `BrandingThemeFonts`
@@ -11786,7 +15188,7 @@ client.actions().versions().list(
-**page:** `Optional` — Use this field to request a specific page of the list results. +**pageBackground:** `BrandingThemePageBackground`
@@ -11794,7 +15196,7 @@ client.actions().versions().list(
-**perPage:** `Optional` — This field specify the maximum number of results to be returned by the server. 20 by default +**widget:** `BrandingThemeWidget`
@@ -11806,7 +15208,8 @@ client.actions().versions().list(
-
client.actions.versions.get(actionId, id) -> GetActionVersionResponseContent +## Branding Phone Providers +
client.branding.phone.providers.list() -> ListBrandingPhoneProvidersResponseContent
@@ -11818,7 +15221,7 @@ client.actions().versions().list(
-Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. +Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified.
@@ -11833,7 +15236,14 @@ Retrieve a specific version of an action. An action version is created whenever
```java -client.actions().versions().get("actionId", "id"); +client.branding().phone().providers().list( + ListBrandingPhoneProvidersRequestParameters + .builder() + .disabled( + OptionalNullable.of(true) + ) + .build() +); ```
@@ -11848,15 +15258,7 @@ client.actions().versions().get("actionId", "id");
-**actionId:** `String` — The ID of the action. - -
-
- -
-
- -**id:** `String` — The ID of the action version. +**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true).
@@ -11868,7 +15270,7 @@ client.actions().versions().get("actionId", "id");
-
client.actions.versions.deploy(actionId, id, request) -> DeployActionVersionResponseContent +
client.branding.phone.providers.create(request) -> CreateBrandingPhoneProviderResponseContent
@@ -11880,7 +15282,8 @@ client.actions().versions().get("actionId", "id");
-Performs the equivalent of a roll-back of an action to an earlier, specified version. Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately. +Create a phone provider. +The credentials object requires different properties depending on the phone provider (which is specified using the name property).
@@ -11895,10 +15298,19 @@ Performs the equivalent of a roll-back of an action to an earlier, specified ver
```java -client.actions().versions().deploy( - "actionId", - "id", - Optional.empty() +client.branding().phone().providers().create( + CreateBrandingPhoneProviderRequestContent + .builder() + .name(PhoneProviderNameEnum.TWILIO) + .credentials( + PhoneProviderCredentials.of( + TwilioProviderCredentials + .builder() + .authToken("auth_token") + .build() + ) + ) + .build() ); ```
@@ -11914,7 +15326,7 @@ client.actions().versions().deploy(
-**actionId:** `String` — The ID of an action. +**name:** `PhoneProviderNameEnum`
@@ -11922,7 +15334,7 @@ client.actions().versions().deploy(
-**id:** `String` — The ID of an action version. +**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true).
@@ -11930,7 +15342,15 @@ client.actions().versions().deploy(
-**request:** `Optional` +**configuration:** `Optional` + +
+
+ +
+
+ +**credentials:** `PhoneProviderCredentials`
@@ -11942,8 +15362,7 @@ client.actions().versions().deploy(
-## Actions Executions -
client.actions.executions.get(id) -> GetActionExecutionResponseContent +
client.branding.phone.providers.get(id) -> GetBrandingPhoneProviderResponseContent
@@ -11955,7 +15374,7 @@ client.actions().versions().deploy(
-Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation. +Retrieve phone provider details. A list of fields to include or exclude may also be specified.
@@ -11970,7 +15389,7 @@ Retrieve information about a specific execution of a trigger. Relevant execution
```java -client.actions().executions().get("id"); +client.branding().phone().providers().get("id"); ```
@@ -11985,7 +15404,7 @@ client.actions().executions().get("id");
-**id:** `String` — The ID of the execution to retrieve. +**id:** `String`
@@ -11997,48 +15416,7 @@ client.actions().executions().get("id");
-## Actions Triggers -
client.actions.triggers.list() -> ListActionTriggersResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.actions().triggers().list(); -``` -
-
-
-
- - -
-
-
- -## Actions Triggers Bindings -
client.actions.triggers.bindings.list(triggerId) -> SyncPagingIterable<ActionBinding> +
client.branding.phone.providers.delete(id)
@@ -12050,7 +15428,7 @@ client.actions().triggers().list();
-Retrieve the actions that are bound to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow. +Delete the configured phone provider.
@@ -12065,14 +15443,7 @@ Retrieve the actions that are bound to a trigger. Once an action is created and
```java -client.actions().triggers().bindings().list( - "triggerId", - ListActionTriggerBindingsRequestParameters - .builder() - .page(1) - .perPage(1) - .build() -); +client.branding().phone().providers().delete("id"); ```
@@ -12087,23 +15458,7 @@ client.actions().triggers().bindings().list(
-**triggerId:** `String` — An actions extensibility point. - -
-
- -
-
- -**page:** `Optional` — Use this field to request a specific page of the list results. - -
-
- -
-
- -**perPage:** `Optional` — The maximum number of results to be returned in a single request. 20 by default +**id:** `String`
@@ -12115,7 +15470,7 @@ client.actions().triggers().bindings().list(
-
client.actions.triggers.bindings.updateMany(triggerId, request) -> UpdateActionBindingsResponseContent +
client.branding.phone.providers.update(id, request) -> UpdateBrandingPhoneProviderResponseContent
@@ -12127,7 +15482,8 @@ client.actions().triggers().bindings().list(
-Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed. +Update a phone provider. +The credentials object requires different properties depending on the phone provider (which is specified using the name property).
@@ -12142,9 +15498,9 @@ Update the actions that are bound (i.e. attached) to a trigger. Once an action i
```java -client.actions().triggers().bindings().updateMany( - "triggerId", - UpdateActionBindingsRequestContent +client.branding().phone().providers().update( + "id", + UpdateBrandingPhoneProviderRequestContent .builder() .build() ); @@ -12162,7 +15518,7 @@ client.actions().triggers().bindings().updateMany(
-**triggerId:** `String` — An actions extensibility point. +**id:** `String`
@@ -12170,62 +15526,31 @@ client.actions().triggers().bindings().updateMany(
-**bindings:** `Optional>` — The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed. +**name:** `Optional`
-
-
- - - - -
- -## Anomaly Blocks -
client.anomaly.blocks.checkIp(id) -
-
- -#### 📝 Description - -
-
-Check if the given IP address is blocked via the Suspicious IP Throttling due to multiple suspicious attempts. -
-
+**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). +
-#### 🔌 Usage - -
-
-
-```java -client.anomaly().blocks().checkIp("id"); -``` -
-
+**credentials:** `Optional` +
-#### ⚙️ Parameters - -
-
-
-**id:** `String` — IP address to check. +**configuration:** `Optional`
@@ -12237,11 +15562,11 @@ client.anomaly().blocks().checkIp("id");
-
client.anomaly.blocks.unblockIp(id) +
client.branding.phone.providers.test(id, request) -> CreatePhoneProviderSendTestResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -12249,13 +15574,21 @@ client.anomaly().blocks().checkIp("id");
-Remove a block imposed by Suspicious IP Throttling for the given IP address. +```java +client.branding().phone().providers().test( + "id", + CreatePhoneProviderSendTestRequestContent + .builder() + .to("to") + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -12263,23 +15596,23 @@ Remove a block imposed by -
+**id:** `String` +
-#### ⚙️ Parameters -
+**to:** `String` — The recipient phone number to receive a given notification. + +
+
+
-**id:** `String` — IP address to unblock. +**deliveryMethod:** `Optional`
@@ -12291,12 +15624,12 @@ client.anomaly().blocks().unblockIp("id");
-## AttackProtection BreachedPasswordDetection -
client.attackProtection.breachedPasswordDetection.get() -> GetBreachedPasswordDetectionSettingsResponseContent +## Branding Phone Templates +
client.branding.phone.templates.list() -> ListPhoneTemplatesResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -12304,13 +15637,22 @@ client.anomaly().blocks().unblockIp("id");
-Retrieve details of the Breached Password Detection configuration of your tenant. +```java +client.branding().phone().templates().list( + ListPhoneTemplatesRequestParameters + .builder() + .disabled( + OptionalNullable.of(true) + ) + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -12318,9 +15660,8 @@ Retrieve details of the Breached Password Detection configuration of your tenant
-```java -client.attackProtection().breachedPasswordDetection().get(); -``` +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). +
@@ -12331,24 +15672,10 @@ client.attackProtection().breachedPasswordDetection().get();
-
client.attackProtection.breachedPasswordDetection.update(request) -> UpdateBreachedPasswordDetectionSettingsResponseContent -
-
- -#### 📝 Description - -
-
- +
client.branding.phone.templates.create(request) -> CreatePhoneTemplateResponseContent
-Update details of the Breached Password Detection configuration of your tenant. -
-
-
-
- #### 🔌 Usage
@@ -12358,8 +15685,8 @@ Update details of the Breached Password Detection configuration of your tenant.
```java -client.attackProtection().breachedPasswordDetection().update( - UpdateBreachedPasswordDetectionSettingsRequestContent +client.branding().phone().templates().create( + CreatePhoneTemplateRequestContent .builder() .build() ); @@ -12377,29 +15704,7 @@ client.attackProtection().breachedPasswordDetection().update(
-**enabled:** `Optional` — Whether or not breached password detection is active. - -
-
- -
-
- -**shields:** `Optional>` - -Action to take when a breached password is detected during a login. - Possible values: block, user_notification, admin_notification. - -
-
- -
-
- -**adminNotificationFrequency:** `Optional>` - -When "admin_notification" is enabled, determines how often email notifications are sent. - Possible values: immediately, daily, weekly, monthly. +**type:** `Optional`
@@ -12407,7 +15712,7 @@ When "admin_notification" is enabled, determines how often email notifications a
-**method:** `Optional` +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true).
@@ -12415,7 +15720,7 @@ When "admin_notification" is enabled, determines how often email notifications a
-**stage:** `Optional` +**content:** `Optional`
@@ -12427,12 +15732,11 @@ When "admin_notification" is enabled, determines how often email notifications a
-## AttackProtection BruteForceProtection -
client.attackProtection.bruteForceProtection.get() -> GetBruteForceSettingsResponseContent +
client.branding.phone.templates.get(id) -> GetPhoneTemplateResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -12440,13 +15744,15 @@ When "admin_notification" is enabled, determines how often email notifications a
-Retrieve details of the Brute-force Protection configuration of your tenant. +```java +client.branding().phone().templates().get("id"); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -12454,9 +15760,8 @@ Retrieve details of the Brute-force Protection configuration of your tenant.
-```java -client.attackProtection().bruteForceProtection().get(); -``` +**id:** `String` +
@@ -12467,11 +15772,11 @@ client.attackProtection().bruteForceProtection().get();
-
client.attackProtection.bruteForceProtection.update(request) -> UpdateBruteForceSettingsResponseContent +
client.branding.phone.templates.delete(id)
-#### 📝 Description +#### 🔌 Usage
@@ -12479,13 +15784,15 @@ client.attackProtection().bruteForceProtection().get();
-Update the Brute-force Protection configuration of your tenant. +```java +client.branding().phone().templates().delete("id"); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -12493,46 +15800,52 @@ Update the Brute-force Protection configuration of your tenant.
-```java -client.attackProtection().bruteForceProtection().update( - UpdateBruteForceSettingsRequestContent - .builder() - .build() -); -``` +**id:** `String` +
-#### ⚙️ Parameters -
-
+
+
+
+
client.branding.phone.templates.update(id, request) -> UpdatePhoneTemplateResponseContent
-**enabled:** `Optional` — Whether or not brute force attack protections are active. - -
-
+#### 🔌 Usage
-**shields:** `Optional>` +
+
-Action to take when a brute force protection threshold is violated. - Possible values: block, user_notification. - +```java +client.branding().phone().templates().update( + "id", + UpdatePhoneTemplateRequestContent + .builder() + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**allowlist:** `Optional>` — List of trusted IP addresses that will not have attack protection enforced against them. +
+
+ +**id:** `String`
@@ -12540,10 +15853,7 @@ Action to take when a brute force protection threshold is violated.
-**mode:** `Optional` - -Account Lockout: Determines whether or not IP address is used when counting failed attempts. - Possible values: count_per_identifier_and_ip, count_per_identifier. +**content:** `Optional`
@@ -12551,7 +15861,7 @@ Account Lockout: Determines whether or not IP address is used when counting fail
-**maxAttempts:** `Optional` — Maximum number of unsuccessful attempts. +**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true).
@@ -12563,12 +15873,11 @@ Account Lockout: Determines whether or not IP address is used when counting fail
-## AttackProtection SuspiciousIpThrottling -
client.attackProtection.suspiciousIpThrottling.get() -> GetSuspiciousIpThrottlingSettingsResponseContent +
client.branding.phone.templates.reset(id, request) -> ResetPhoneTemplateResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -12576,13 +15885,17 @@ Account Lockout: Determines whether or not IP address is used when counting fail
-Retrieve details of the Suspicious IP Throttling configuration of your tenant. +```java +client.branding().phone().templates().reset("id", new +HashMap() {{put("key", "value"); +}}); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -12590,9 +15903,16 @@ Retrieve details of the Suspicious IP Throttling configuration of your tenant.
-```java -client.attackProtection().suspiciousIpThrottling().get(); -``` +**id:** `String` + +
+
+ +
+
+ +**request:** `Object` +
@@ -12603,24 +15923,10 @@ client.attackProtection().suspiciousIpThrottling().get();
-
client.attackProtection.suspiciousIpThrottling.update(request) -> UpdateSuspiciousIpThrottlingSettingsResponseContent -
-
- -#### 📝 Description - -
-
- +
client.branding.phone.templates.test(id, request) -> CreatePhoneTemplateTestNotificationResponseContent
-Update the details of the Suspicious IP Throttling configuration of your tenant. -
-
-
-
- #### 🔌 Usage
@@ -12630,9 +15936,11 @@ Update the details of the Suspicious IP Throttling configuration of your tenant.
```java -client.attackProtection().suspiciousIpThrottling().update( - UpdateSuspiciousIpThrottlingSettingsRequestContent +client.branding().phone().templates().test( + "id", + CreatePhoneTemplateTestNotificationRequestContent .builder() + .to("to") .build() ); ``` @@ -12649,18 +15957,7 @@ client.attackProtection().suspiciousIpThrottling().update(
-**enabled:** `Optional` — Whether or not suspicious IP throttling attack protections are active. - -
-
- -
-
- -**shields:** `Optional>` - -Action to take when a suspicious IP throttling threshold is violated. - Possible values: block, admin_notification. +**id:** `String`
@@ -12668,7 +15965,7 @@ Action to take when a suspicious IP throttling threshold is violated.
-**allowlist:** `Optional>` +**to:** `String` — Destination of the testing phone notification
@@ -12676,7 +15973,7 @@ Action to take when a suspicious IP throttling threshold is violated.
-**stage:** `Optional` +**deliveryMethod:** `Optional`
@@ -12688,8 +15985,8 @@ Action to take when a suspicious IP throttling threshold is violated.
-## Branding Templates -
client.branding.templates.getUniversalLogin() -> GetUniversalLoginTemplateResponseContent +## ClientGrants Organizations +
client.clientGrants.organizations.list(id) -> SyncPagingIterable<Organization>
@@ -12702,19 +15999,62 @@ Action to take when a suspicious IP throttling threshold is violated.
```java -client.branding().templates().getUniversalLogin(); +client.clientGrants().organizations().list( + "id", + ListClientGrantOrganizationsRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() +); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the client grant + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+
-
client.branding.templates.updateUniversalLogin(request) +## Clients Credentials +
client.clients.credentials.list(clientId) -> List<ClientCredential>
@@ -12724,33 +16064,11 @@ client.branding().templates().getUniversalLogin();
-
- -Update the Universal Login branding template. +
-

When content-type header is set to application/json, the expected body must be JSON:

-
-{
-  "template": "<!DOCTYPE html><html><head>{%- auth0:head -%}</head><body>{%- auth0:widget -%}</body></html>"
-}
-
+Get the details of a client credential. -

- When content-type header is set to text/html, the expected body must be the HTML template: -

-
-<!DOCTYPE html>
-<code>
-  <html>
-    <head>
-     {%- auth0:head -%}
-    </head>
-    <body>
-      {%- auth0:widget -%}
-    </body>
-  </html>
-</code>
-
+Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
@@ -12765,9 +16083,7 @@ Update the Universal Login branding template.
```java -client.branding().templates().updateUniversalLogin( - UpdateUniversalLoginTemplateRequestContent.of("string") -); +client.clients().credentials().list("client_id"); ```
@@ -12782,7 +16098,7 @@ client.branding().templates().updateUniversalLogin(
-**request:** `UpdateUniversalLoginTemplateRequestContent` +**clientId:** `String` — ID of the client.
@@ -12794,11 +16110,11 @@ client.branding().templates().updateUniversalLogin(
-
client.branding.templates.deleteUniversalLogin() +
client.clients.credentials.create(clientId, request) -> PostClientCredentialResponseContent
-#### 🔌 Usage +#### 📝 Description
@@ -12806,33 +16122,39 @@ client.branding().templates().updateUniversalLogin(
-```java -client.branding().templates().deleteUniversalLogin(); -``` -
-
-
-
- - -
-
-
- -## Branding Themes -
client.branding.themes.create(request) -> CreateBrandingThemeResponseContent -
-
+Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. -#### 📝 Description +
Public Key
Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests. -
-
+Sample:
{
+  "credential_type": "public_key",
+  "name": "string",
+  "pem": "string",
+  "alg": "RS256",
+  "parse_expiry_from_cert": false,
+  "expires_at": "2022-12-31T23:59:59Z"
+}
+
Certificate (CA-signed & self-signed)
Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN. -
-
+CA-signed Certificate Sample (pem):
{
+  "credential_type": "x509_cert",
+  "name": "string",
+  "pem": "string"
+}
CA-signed Certificate Sample (subject_dn):
{
+  "credential_type": "cert_subject_dn",
+  "name": "string",
+  "subject_dn": "string"
+}
Self-signed Certificate Sample:
{
+  "credential_type": "cert_subject_dn",
+  "name": "string",
+  "pem": "string"
+}
-Create branding theme. +The credential will be created but not yet enabled for use until you set the corresponding properties in the client: +
@@ -12847,112 +16169,11 @@ Create branding theme.
```java -client.branding().themes().create( - CreateBrandingThemeRequestContent +client.clients().credentials().create( + "client_id", + PostClientCredentialRequestContent .builder() - .borders( - BrandingThemeBorders - .builder() - .buttonBorderRadius(1.1) - .buttonBorderWeight(1.1) - .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) - .inputBorderRadius(1.1) - .inputBorderWeight(1.1) - .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) - .showWidgetShadow(true) - .widgetBorderWeight(1.1) - .widgetCornerRadius(1.1) - .build() - ) - .colors( - BrandingThemeColors - .builder() - .bodyText("body_text") - .error("error") - .header("header") - .icons("icons") - .inputBackground("input_background") - .inputBorder("input_border") - .inputFilledText("input_filled_text") - .inputLabelsPlaceholders("input_labels_placeholders") - .linksFocusedComponents("links_focused_components") - .primaryButton("primary_button") - .primaryButtonLabel("primary_button_label") - .secondaryButtonBorder("secondary_button_border") - .secondaryButtonLabel("secondary_button_label") - .success("success") - .widgetBackground("widget_background") - .widgetBorder("widget_border") - .build() - ) - .fonts( - BrandingThemeFonts - .builder() - .bodyText( - BrandingThemeFontBodyText - .builder() - .bold(true) - .size(1.1) - .build() - ) - .buttonsText( - BrandingThemeFontButtonsText - .builder() - .bold(true) - .size(1.1) - .build() - ) - .fontUrl("font_url") - .inputLabels( - BrandingThemeFontInputLabels - .builder() - .bold(true) - .size(1.1) - .build() - ) - .links( - BrandingThemeFontLinks - .builder() - .bold(true) - .size(1.1) - .build() - ) - .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) - .referenceTextSize(1.1) - .subtitle( - BrandingThemeFontSubtitle - .builder() - .bold(true) - .size(1.1) - .build() - ) - .title( - BrandingThemeFontTitle - .builder() - .bold(true) - .size(1.1) - .build() - ) - .build() - ) - .pageBackground( - BrandingThemePageBackground - .builder() - .backgroundColor("background_color") - .backgroundImageUrl("background_image_url") - .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) - .build() - ) - .widget( - BrandingThemeWidget - .builder() - .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) - .logoHeight(1.1) - .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) - .logoUrl("logo_url") - .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) - .build() - ) + .credentialType(ClientCredentialTypeEnum.PUBLIC_KEY) .build() ); ``` @@ -12969,7 +16190,7 @@ client.branding().themes().create(
-**borders:** `BrandingThemeBorders` +**clientId:** `String` — ID of the client.
@@ -12977,7 +16198,7 @@ client.branding().themes().create(
-**colors:** `BrandingThemeColors` +**credentialType:** `ClientCredentialTypeEnum`
@@ -12985,7 +16206,7 @@ client.branding().themes().create(
-**displayName:** `Optional` — Display Name +**name:** `Optional` — Friendly name for a credential.
@@ -12993,7 +16214,7 @@ client.branding().themes().create(
-**fonts:** `BrandingThemeFonts` +**subjectDn:** `Optional` — Subject Distinguished Name. Mutually exclusive with `pem` property. Applies to `cert_subject_dn` credential type.
@@ -13001,7 +16222,7 @@ client.branding().themes().create(
-**pageBackground:** `BrandingThemePageBackground` +**pem:** `Optional` — PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.
@@ -13009,7 +16230,23 @@ client.branding().themes().create(
-**widget:** `BrandingThemeWidget` +**alg:** `Optional` + +
+
+ +
+
+ +**parseExpiryFromCert:** `Optional` — Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to `public_key` credential type. + +
+
+ +
+
+ +**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to `public_key` credential type.
@@ -13021,7 +16258,7 @@ client.branding().themes().create(
-
client.branding.themes.getDefault() -> GetBrandingDefaultThemeResponseContent +
client.clients.credentials.get(clientId, credentialId) -> GetClientCredentialResponseContent
@@ -13033,7 +16270,9 @@ client.branding().themes().create(
-Retrieve default branding theme. +Get the details of a client credential. + +Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
@@ -13048,19 +16287,42 @@ Retrieve default branding theme.
```java -client.branding().themes().getDefault(); +client.clients().credentials().get("client_id", "credential_id"); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential. + +
+
+
+
+
-
client.branding.themes.get(themeId) -> GetBrandingThemeResponseContent +
client.clients.credentials.delete(clientId, credentialId)
@@ -13072,7 +16334,7 @@ client.branding().themes().getDefault();
-Retrieve branding theme. +Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
@@ -13087,7 +16349,7 @@ Retrieve branding theme.
```java -client.branding().themes().get("themeId"); +client.clients().credentials().delete("client_id", "credential_id"); ```
@@ -13102,7 +16364,15 @@ client.branding().themes().get("themeId");
-**themeId:** `String` — The ID of the theme +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential to delete.
@@ -13114,7 +16384,7 @@ client.branding().themes().get("themeId");
-
client.branding.themes.delete(themeId) +
client.clients.credentials.update(clientId, credentialId, request) -> PatchClientCredentialResponseContent
@@ -13126,7 +16396,7 @@ client.branding().themes().get("themeId");
-Delete branding theme. +Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
@@ -13141,7 +16411,13 @@ Delete branding theme.
```java -client.branding().themes().delete("themeId"); +client.clients().credentials().update( + "client_id", + "credential_id", + PatchClientCredentialRequestContent + .builder() + .build() +); ```
@@ -13156,7 +16432,23 @@ client.branding().themes().delete("themeId");
-**themeId:** `String` — The ID of the theme +**clientId:** `String` — ID of the client. + +
+
+ +
+
+ +**credentialId:** `String` — ID of the credential. + +
+
+ +
+
+ +**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential.
@@ -13168,7 +16460,8 @@ client.branding().themes().delete("themeId");
-
client.branding.themes.update(themeId, request) -> UpdateBrandingThemeResponseContent +## Clients Connections +
client.clients.connections.get(id) -> SyncPagingIterable<ConnectionForList>
@@ -13180,7 +16473,15 @@ client.branding().themes().delete("themeId");
-Update branding theme. +Retrieve all connections that are enabled for the specified Application, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. +
    +
  • + This endpoint requires the read:connections scope and any one of read:clients or read:client_summary. +
  • +
  • + Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. +
  • +
@@ -13195,112 +16496,21 @@ Update branding theme.
```java -client.branding().themes().update( - "themeId", - UpdateBrandingThemeRequestContent +client.clients().connections().get( + "id", + ConnectionsGetRequest .builder() - .borders( - BrandingThemeBorders - .builder() - .buttonBorderRadius(1.1) - .buttonBorderWeight(1.1) - .buttonsStyle(BrandingThemeBordersButtonsStyleEnum.PILL) - .inputBorderRadius(1.1) - .inputBorderWeight(1.1) - .inputsStyle(BrandingThemeBordersInputsStyleEnum.PILL) - .showWidgetShadow(true) - .widgetBorderWeight(1.1) - .widgetCornerRadius(1.1) - .build() + .from( + OptionalNullable.of("from") ) - .colors( - BrandingThemeColors - .builder() - .bodyText("body_text") - .error("error") - .header("header") - .icons("icons") - .inputBackground("input_background") - .inputBorder("input_border") - .inputFilledText("input_filled_text") - .inputLabelsPlaceholders("input_labels_placeholders") - .linksFocusedComponents("links_focused_components") - .primaryButton("primary_button") - .primaryButtonLabel("primary_button_label") - .secondaryButtonBorder("secondary_button_border") - .secondaryButtonLabel("secondary_button_label") - .success("success") - .widgetBackground("widget_background") - .widgetBorder("widget_border") - .build() - ) - .fonts( - BrandingThemeFonts - .builder() - .bodyText( - BrandingThemeFontBodyText - .builder() - .bold(true) - .size(1.1) - .build() - ) - .buttonsText( - BrandingThemeFontButtonsText - .builder() - .bold(true) - .size(1.1) - .build() - ) - .fontUrl("font_url") - .inputLabels( - BrandingThemeFontInputLabels - .builder() - .bold(true) - .size(1.1) - .build() - ) - .links( - BrandingThemeFontLinks - .builder() - .bold(true) - .size(1.1) - .build() - ) - .linksStyle(BrandingThemeFontLinksStyleEnum.NORMAL) - .referenceTextSize(1.1) - .subtitle( - BrandingThemeFontSubtitle - .builder() - .bold(true) - .size(1.1) - .build() - ) - .title( - BrandingThemeFontTitle - .builder() - .bold(true) - .size(1.1) - .build() - ) - .build() + .take( + OptionalNullable.of(1) ) - .pageBackground( - BrandingThemePageBackground - .builder() - .backgroundColor("background_color") - .backgroundImageUrl("background_image_url") - .pageLayout(BrandingThemePageBackgroundPageLayoutEnum.CENTER) - .build() + .fields( + OptionalNullable.of("fields") ) - .widget( - BrandingThemeWidget - .builder() - .headerTextAlignment(BrandingThemeWidgetHeaderTextAlignmentEnum.CENTER) - .logoHeight(1.1) - .logoPosition(BrandingThemeWidgetLogoPositionEnum.CENTER) - .logoUrl("logo_url") - .socialButtonsLayout(BrandingThemeWidgetSocialButtonsLayoutEnum.BOTTOM) - .build() + .includeFields( + OptionalNullable.of(true) ) .build() ); @@ -13318,15 +16528,7 @@ client.branding().themes().update(
-**themeId:** `String` — The ID of the theme - -
-
- -
-
- -**borders:** `BrandingThemeBorders` +**id:** `String` — ID of the client for which to retrieve enabled connections.
@@ -13334,7 +16536,7 @@ client.branding().themes().update(
-**colors:** `BrandingThemeColors` +**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies
@@ -13342,7 +16544,7 @@ client.branding().themes().update(
-**displayName:** `Optional` — Display Name +**from:** `Optional` — Optional Id from which to start selection.
@@ -13350,7 +16552,7 @@ client.branding().themes().update(
-**fonts:** `BrandingThemeFonts` +**take:** `Optional` — Number of results per page. Defaults to 50.
@@ -13358,7 +16560,7 @@ client.branding().themes().update(
-**pageBackground:** `BrandingThemePageBackground` +**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields
@@ -13366,7 +16568,7 @@ client.branding().themes().update(
-**widget:** `BrandingThemeWidget` +**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true)
@@ -13378,8 +16580,8 @@ client.branding().themes().update(
-## Branding Phone Providers -
client.branding.phone.providers.list() -> ListBrandingPhoneProvidersResponseContent +## Connections Clients +
client.connections.clients.get(id) -> SyncPagingIterable<ConnectionEnabledClient>
@@ -13391,7 +16593,9 @@ client.branding().themes().update(
-Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified. +Retrieve all clients that have the specified connection enabled. + +Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining.
@@ -13406,10 +16610,16 @@ Retrieve a list of
-**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). +**id:** `String` — The id of the connection for which enabled clients are to be retrieved
- - - - - - -
-
client.branding.phone.providers.create(request) -> CreateBrandingPhoneProviderResponseContent
-#### 📝 Description - -
-
+**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
-Create a phone provider. -The credentials object requires different properties depending on the phone provider (which is specified using the name property). +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ + +
+ +
client.connections.clients.update(id, request) +
+
#### 🔌 Usage @@ -13466,19 +16677,15 @@ The credentials object requires different properties depending on t
```java -client.branding().phone().providers().create( - CreateBrandingPhoneProviderRequestContent - .builder() - .name(PhoneProviderNameEnum.TWILIO) - .credentials( - PhoneProviderCredentials.of( - TwilioProviderCredentials - .builder() - .authToken("auth_token") - .build() - ) - ) - .build() +client.connections().clients().update( + "id", + Arrays.asList( + UpdateEnabledClientConnectionsRequestContentItem + .builder() + .clientId("client_id") + .status(true) + .build() + ) ); ```
@@ -13488,29 +16695,13 @@ client.branding().phone().providers().create( #### ⚙️ Parameters -
-
- -
-
- -**name:** `PhoneProviderNameEnum` - -
-
- -
-
- -**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). - -
-
+
+
-**configuration:** `Optional` +**id:** `String` — The id of the connection to modify
@@ -13518,7 +16709,7 @@ client.branding().phone().providers().create(
-**credentials:** `PhoneProviderCredentials` +**request:** `List`
@@ -13530,7 +16721,8 @@ client.branding().phone().providers().create(
-
client.branding.phone.providers.get(id) -> GetBrandingPhoneProviderResponseContent +## Connections DirectoryProvisioning +
client.connections.directoryProvisioning.get(id) -> GetDirectoryProvisioningResponseContent
@@ -13542,7 +16734,7 @@ client.branding().phone().providers().create(
-Retrieve phone provider details. A list of fields to include or exclude may also be specified. +Retrieve the directory provisioning configuration of a connection.
@@ -13557,7 +16749,7 @@ Retrieve
@@ -13572,7 +16764,7 @@ client.branding().phone().providers().get("id");
-**id:** `String` +**id:** `String` — The id of the connection to retrieve its directory provisioning configuration
@@ -13584,7 +16776,7 @@ client.branding().phone().providers().get("id");
-
client.branding.phone.providers.delete(id) +
client.connections.directoryProvisioning.create(id, request) -> CreateDirectoryProvisioningResponseContent
@@ -13596,7 +16788,7 @@ client.branding().phone().providers().get("id");
-Delete the configured phone provider. +Create a directory provisioning configuration for a connection.
@@ -13611,7 +16803,10 @@ Delete the configured phone provider.
```java -client.branding().phone().providers().delete("id"); +client.connections().directoryProvisioning().create( + "id", + OptionalNullable.absent() +); ```
@@ -13626,7 +16821,15 @@ client.branding().phone().providers().delete("id");
-**id:** `String` +**id:** `String` — The id of the connection to create its directory provisioning configuration + +
+
+ +
+
+ +**request:** `Optional`
@@ -13638,7 +16841,7 @@ client.branding().phone().providers().delete("id");
-
client.branding.phone.providers.update(id, request) -> UpdateBrandingPhoneProviderResponseContent +
client.connections.directoryProvisioning.delete(id)
@@ -13650,8 +16853,7 @@ client.branding().phone().providers().delete("id");
-Update a phone provider. -The credentials object requires different properties depending on the phone provider (which is specified using the name property). +Delete the directory provisioning configuration of a connection.
@@ -13666,12 +16868,7 @@ The credentials object requires different properties depending on t
```java -client.branding().phone().providers().update( - "id", - UpdateBrandingPhoneProviderRequestContent - .builder() - .build() -); +client.connections().directoryProvisioning().delete("id"); ```
@@ -13686,54 +16883,36 @@ client.branding().phone().providers().update(
-**id:** `String` +**id:** `String` — The id of the connection to delete its directory provisioning configuration
+ + -
-
-**name:** `Optional` -
+
+
client.connections.directoryProvisioning.update(id, request) -> UpdateDirectoryProvisioningResponseContent
-**disabled:** `Optional` — Whether the provider is enabled (false) or disabled (true). - -
-
+#### 📝 Description
-**credentials:** `Optional` - -
-
-
-**configuration:** `Optional` - +Update the directory provisioning configuration of a connection.
- - - -
- -
client.branding.phone.providers.test(id, request) -> CreatePhoneProviderSendTestResponseContent -
-
- #### 🔌 Usage
@@ -13743,12 +16922,9 @@ client.branding().phone().providers().update(
```java -client.branding().phone().providers().test( +client.connections().directoryProvisioning().update( "id", - CreatePhoneProviderSendTestRequestContent - .builder() - .to("to") - .build() + OptionalNullable.absent() ); ```
@@ -13764,15 +16940,7 @@ client.branding().phone().providers().test(
-**id:** `String` - -
-
- -
-
- -**to:** `String` — The recipient phone number to receive a given notification. +**id:** `String` — The id of the connection to create its directory provisioning configuration
@@ -13780,7 +16948,7 @@ client.branding().phone().providers().test(
-**deliveryMethod:** `Optional` +**request:** `Optional`
@@ -13792,11 +16960,24 @@ client.branding().phone().providers().test(
-## Branding Phone Templates -
client.branding.phone.templates.list() -> ListPhoneTemplatesResponseContent +
client.connections.directoryProvisioning.getDefaultMapping(id) -> GetDirectoryProvisioningDefaultMappingResponseContent +
+
+ +#### 📝 Description + +
+
+
+Retrieve the directory provisioning default attribute mapping of a connection. +
+
+
+
+ #### 🔌 Usage
@@ -13806,12 +16987,7 @@ client.branding().phone().providers().test(
```java -client.branding().phone().templates().list( - ListPhoneTemplatesRequestParameters - .builder() - .disabled(true) - .build() -); +client.connections().directoryProvisioning().getDefaultMapping("id"); ```
@@ -13826,7 +17002,7 @@ client.branding().phone().templates().list(
-**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). +**id:** `String` — The id of the connection to retrieve its directory provisioning configuration
@@ -13838,11 +17014,12 @@ client.branding().phone().templates().list(
-
client.branding.phone.templates.create(request) -> CreatePhoneTemplateResponseContent +## Connections Keys +
client.connections.keys.get(id) -> List<ConnectionKey>
-#### 🔌 Usage +#### 📝 Description
@@ -13850,19 +17027,13 @@ client.branding().phone().templates().list(
-```java -client.branding().phone().templates().create( - CreatePhoneTemplateRequestContent - .builder() - .build() -); -``` +Gets the connection keys for the Okta or OIDC connection strategy.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -13870,23 +17041,23 @@ client.branding().phone().templates().create(
-**type:** `Optional` - +```java +client.connections().keys().get("id"); +``` +
+
+#### ⚙️ Parameters +
-**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). - -
-
-
-**content:** `Optional` +**id:** `String` — ID of the connection
@@ -13898,11 +17069,11 @@ client.branding().phone().templates().create(
-
client.branding.phone.templates.get(id) -> GetPhoneTemplateResponseContent +
client.connections.keys.rotate(id, request) -> RotateConnectionsKeysResponseContent
-#### 🔌 Usage +#### 📝 Description
@@ -13910,15 +17081,13 @@ client.branding().phone().templates().create(
-```java -client.branding().phone().templates().get("id"); -``` +Rotates the connection keys for the Okta or OIDC connection strategies.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -13926,23 +17095,18 @@ client.branding().phone().templates().get("id");
-**id:** `String` - -
-
+```java +client.connections().keys().rotate( + "id", + OptionalNullable.absent() +); +```
- -
-
- -
client.branding.phone.templates.delete(id) -
-
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -13950,23 +17114,15 @@ client.branding().phone().templates().get("id");
-```java -client.branding().phone().templates().delete("id"); -``` -
-
+**id:** `String` — ID of the connection +
-#### ⚙️ Parameters - -
-
-
-**id:** `String` +**request:** `Optional`
@@ -13978,11 +17134,12 @@ client.branding().phone().templates().delete("id");
-
client.branding.phone.templates.update(id, request) -> UpdatePhoneTemplateResponseContent +## Connections ScimConfiguration +
client.connections.scimConfiguration.get(id) -> GetScimConfigurationResponseContent
-#### 🔌 Usage +#### 📝 Description
@@ -13990,20 +17147,13 @@ client.branding().phone().templates().delete("id");
-```java -client.branding().phone().templates().update( - "id", - UpdatePhoneTemplateRequestContent - .builder() - .build() -); -``` +Retrieves a scim configuration by its connectionId.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -14011,23 +17161,23 @@ client.branding().phone().templates().update(
-**id:** `String` - +```java +client.connections().scimConfiguration().get("id"); +``` +
+
+#### ⚙️ Parameters +
-**content:** `Optional` - -
-
-
-**disabled:** `Optional` — Whether the template is enabled (false) or disabled (true). +**id:** `String` — The id of the connection to retrieve its SCIM configuration
@@ -14039,10 +17189,24 @@ client.branding().phone().templates().update(
-
client.branding.phone.templates.reset(id, request) -> ResetPhoneTemplateResponseContent +
client.connections.scimConfiguration.create(id, request) -> CreateScimConfigurationResponseContent +
+
+ +#### 📝 Description + +
+
+
+Create a scim configuration for a connection. +
+
+
+
+ #### 🔌 Usage
@@ -14052,9 +17216,10 @@ client.branding().phone().templates().update(
```java -client.branding().phone().templates().reset("id", new -HashMap() {{put("key", "value"); -}}); +client.connections().scimConfiguration().create( + "id", + OptionalNullable.absent() +); ```
@@ -14069,7 +17234,7 @@ HashMap() {{put("key", "value");
-**id:** `String` +**id:** `String` — The id of the connection to create its SCIM configuration
@@ -14077,7 +17242,7 @@ HashMap() {{put("key", "value");
-**request:** `Object` +**request:** `Optional`
@@ -14089,11 +17254,11 @@ HashMap() {{put("key", "value");
-
client.branding.phone.templates.test(id, request) -> CreatePhoneTemplateTestNotificationResponseContent +
client.connections.scimConfiguration.delete(id)
-#### 🔌 Usage +#### 📝 Description
@@ -14101,21 +17266,13 @@ HashMap() {{put("key", "value");
-```java -client.branding().phone().templates().test( - "id", - CreatePhoneTemplateTestNotificationRequestContent - .builder() - .to("to") - .build() -); -``` +Deletes a scim configuration by its connectionId.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -14123,23 +17280,23 @@ client.branding().phone().templates().test(
-**id:** `String` - +```java +client.connections().scimConfiguration().delete("id"); +```
- -
-
- -**to:** `String` — Destination of the testing phone notification -
+#### ⚙️ Parameters +
-**deliveryMethod:** `Optional` +
+
+ +**id:** `String` — The id of the connection to delete its SCIM configuration
@@ -14151,11 +17308,24 @@ client.branding().phone().templates().test(
-## ClientGrants Organizations -
client.clientGrants.organizations.list(id) -> SyncPagingIterable<Organization> +
client.connections.scimConfiguration.update(id, request) -> UpdateScimConfigurationResponseContent +
+
+ +#### 📝 Description + +
+
+
+Update a scim configuration by its connectionId. +
+
+
+
+ #### 🔌 Usage
@@ -14165,12 +17335,18 @@ client.branding().phone().templates().test(
```java -client.clientGrants().organizations().list( +client.connections().scimConfiguration().update( "id", - ListClientGrantOrganizationsRequestParameters + UpdateScimConfigurationRequestContent .builder() - .from("from") - .take(1) + .userIdAttribute("user_id_attribute") + .mapping( + Arrays.asList( + ScimMappingItem + .builder() + .build() + ) + ) .build() ); ``` @@ -14187,7 +17363,7 @@ client.clientGrants().organizations().list(
-**id:** `String` — ID of the client grant +**id:** `String` — The id of the connection to update its SCIM configuration
@@ -14195,7 +17371,7 @@ client.clientGrants().organizations().list(
-**from:** `Optional` — Optional Id from which to start selection. +**userIdAttribute:** `String` — User ID attribute for generating unique user ids
@@ -14203,7 +17379,7 @@ client.clientGrants().organizations().list(
-**take:** `Optional` — Number of results per page. Defaults to 50. +**mapping:** `List` — The mapping between auth0 and SCIM
@@ -14215,8 +17391,7 @@ client.clientGrants().organizations().list(
-## Clients Credentials -
client.clients.credentials.list(clientId) -> List<ClientCredential> +
client.connections.scimConfiguration.getDefaultMapping(id) -> GetScimConfigurationDefaultMappingResponseContent
@@ -14228,9 +17403,7 @@ client.clientGrants().organizations().list(
-Get the details of a client credential. - -Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client. +Retrieves a scim configuration's default mapping by its connectionId.
@@ -14245,7 +17418,7 @@ Get the details of a client credential.
```java -client.clients().credentials().list("client_id"); +client.connections().scimConfiguration().getDefaultMapping("id"); ```
@@ -14260,7 +17433,7 @@ client.clients().credentials().list("client_id");
-**clientId:** `String` — ID of the client. +**id:** `String` — The id of the connection to retrieve its default SCIM mapping
@@ -14272,7 +17445,8 @@ client.clients().credentials().list("client_id");
-
client.clients.credentials.create(clientId, request) -> PostClientCredentialResponseContent +## Connections Users +
client.connections.users.deleteByEmail(id)
@@ -14284,39 +17458,7 @@ client.clients().credentials().list("client_id");
-Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests. - -
Public Key
Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests. - -Sample:
{
-  "credential_type": "public_key",
-  "name": "string",
-  "pem": "string",
-  "alg": "RS256",
-  "parse_expiry_from_cert": false,
-  "expires_at": "2022-12-31T23:59:59Z"
-}
-
Certificate (CA-signed & self-signed)
Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN. - -CA-signed Certificate Sample (pem):
{
-  "credential_type": "x509_cert",
-  "name": "string",
-  "pem": "string"
-}
CA-signed Certificate Sample (subject_dn):
{
-  "credential_type": "cert_subject_dn",
-  "name": "string",
-  "subject_dn": "string"
-}
Self-signed Certificate Sample:
{
-  "credential_type": "cert_subject_dn",
-  "name": "string",
-  "pem": "string"
-}
- -The credential will be created but not yet enabled for use until you set the corresponding properties in the client: - +Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported.
@@ -14331,11 +17473,11 @@ The credential will be created but not yet enabled for use until you set the cor
```java -client.clients().credentials().create( - "client_id", - PostClientCredentialRequestContent +client.connections().users().deleteByEmail( + "id", + DeleteConnectionUsersByEmailQueryParameters .builder() - .credentialType(ClientCredentialTypeEnum.PUBLIC_KEY) + .email("email") .build() ); ``` @@ -14352,7 +17494,7 @@ client.clients().credentials().create(
-**clientId:** `String` — ID of the client. +**id:** `String` — The id of the connection (currently only database connections are supported)
@@ -14360,55 +17502,62 @@ client.clients().credentials().create(
-**credentialType:** `ClientCredentialTypeEnum` +**email:** `String` — The email of the user to delete
+
+
-
-
-**name:** `Optional` — Friendly name for a credential. -
+
+## Connections DirectoryProvisioning Synchronizations +
client.connections.directoryProvisioning.synchronizations.create(id) -> CreateDirectorySynchronizationResponseContent
-**subjectDn:** `Optional` — Subject Distinguished Name. Mutually exclusive with `pem` property. Applies to `cert_subject_dn` credential type. - -
-
+#### 📝 Description
-**pem:** `Optional` — PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped. - -
-
-
-**alg:** `Optional` - +Request an on-demand synchronization of the directory.
+ + + +#### 🔌 Usage
-**parseExpiryFromCert:** `Optional` — Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to `public_key` credential type. - +
+
+ +```java +client.connections().directoryProvisioning().synchronizations().create("id"); +``` +
+
+#### ⚙️ Parameters +
-**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to `public_key` credential type. +
+
+ +**id:** `String` — The id of the connection to trigger synchronization for
@@ -14420,7 +17569,8 @@ client.clients().credentials().create(
-
client.clients.credentials.get(clientId, credentialId) -> GetClientCredentialResponseContent +## Connections ScimConfiguration Tokens +
client.connections.scimConfiguration.tokens.get(id) -> List<ScimTokenItem>
@@ -14432,9 +17582,7 @@ client.clients().credentials().create(
-Get the details of a client credential. - -Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client. +Retrieves all scim tokens by its connection id.
@@ -14449,7 +17597,7 @@ Get the details of a client credential.
```java -client.clients().credentials().get("client_id", "credential_id"); +client.connections().scimConfiguration().tokens().get("id"); ```
@@ -14464,15 +17612,7 @@ client.clients().credentials().get("client_id", "credential_id");
-**clientId:** `String` — ID of the client. - -
-
- -
-
- -**credentialId:** `String` — ID of the credential. +**id:** `String` — The id of the connection to retrieve its SCIM configuration
@@ -14484,7 +17624,7 @@ client.clients().credentials().get("client_id", "credential_id");
-
client.clients.credentials.delete(clientId, credentialId) +
client.connections.scimConfiguration.tokens.create(id, request) -> CreateScimTokenResponseContent
@@ -14496,7 +17636,7 @@ client.clients().credentials().get("client_id", "credential_id");
-Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow. +Create a scim token for a scim client.
@@ -14511,7 +17651,12 @@ Delete a client credential you previously created. May be enabled or disabled. F
```java -client.clients().credentials().delete("client_id", "credential_id"); +client.connections().scimConfiguration().tokens().create( + "id", + CreateScimTokenRequestContent + .builder() + .build() +); ```
@@ -14526,7 +17671,7 @@ client.clients().credentials().delete("client_id", "credential_id");
-**clientId:** `String` — ID of the client. +**id:** `String` — The id of the connection to create its SCIM token
@@ -14534,7 +17679,15 @@ client.clients().credentials().delete("client_id", "credential_id");
-**credentialId:** `String` — ID of the credential to delete. +**scopes:** `Optional>` — The scopes of the scim token + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Lifetime of the token in seconds. Must be greater than 900
@@ -14546,7 +17699,7 @@ client.clients().credentials().delete("client_id", "credential_id");
-
client.clients.credentials.update(clientId, credentialId, request) -> PatchClientCredentialResponseContent +
client.connections.scimConfiguration.tokens.delete(id, tokenId)
@@ -14558,7 +17711,7 @@ client.clients().credentials().delete("client_id", "credential_id");
-Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow. +Deletes a scim token by its connection id and tokenId.
@@ -14573,13 +17726,7 @@ Change a client credential you previously created. May be enabled or disabled. F
```java -client.clients().credentials().update( - "client_id", - "credential_id", - PatchClientCredentialRequestContent - .builder() - .build() -); +client.connections().scimConfiguration().tokens().delete("id", "tokenId"); ```
@@ -14594,15 +17741,7 @@ client.clients().credentials().update(
-**clientId:** `String` — ID of the client. - -
-
- -
-
- -**credentialId:** `String` — ID of the credential. +**id:** `String` — The connection id that owns the SCIM token to delete
@@ -14610,7 +17749,7 @@ client.clients().credentials().update(
-**expiresAt:** `Optional` — The ISO 8601 formatted date representing the expiration of the credential. +**tokenId:** `String` — The id of the scim token to delete
@@ -14622,8 +17761,8 @@ client.clients().credentials().update(
-## Clients Connections -
client.clients.connections.get(id) -> SyncPagingIterable<ConnectionForList> +## Emails Provider +
client.emails.provider.get() -> GetEmailProviderResponseContent
@@ -14635,15 +17774,7 @@ client.clients().credentials().update(
-Retrieve all connections that are enabled for the specified Application, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified. -
    -
  • - This endpoint requires the read:connections scope and any one of read:clients or read:client_summary. -
  • -
  • - Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. -
  • -
+Retrieve details of the email provider configuration in your tenant. A list of fields to include or exclude may also be specified.
@@ -14658,63 +17789,32 @@ Retrieve all connections that are enabled for the specified -
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — ID of the client for which to retrieve enabled connections. - -
-
- -
-
- -**strategy:** `Optional` — Provide strategies to only retrieve connections with such strategies - -
-
- -
-
- -**from:** `Optional` — Optional Id from which to start selection. - +
+#### ⚙️ Parameters +
-**take:** `Optional` — Number of results per page. Defaults to 50. - -
-
-
-**fields:** `Optional` — A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields +**fields:** `Optional` — Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve `name` and `enabled`. Additional fields available include `credentials`, `default_from_address`, and `settings`.
@@ -14722,7 +17822,7 @@ client.clients().connections().get(
-**includeFields:** `Optional` — true if the fields specified are to be included in the result, false otherwise (defaults to true) +**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false).
@@ -14734,8 +17834,7 @@ client.clients().connections().get(
-## Connections Clients -
client.connections.clients.get(id) -> SyncPagingIterable<ConnectionEnabledClient> +
client.emails.provider.create(request) -> CreateEmailProviderResponseContent
@@ -14747,9 +17846,48 @@ client.clients().connections().get(
-Retrieve all clients that have the specified connection enabled. - -Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. +Create an email provider. The credentials object +requires different properties depending on the email provider (which is specified using the name property): +
    +
  • mandrill requires api_key
  • +
  • sendgrid requires api_key
  • +
  • + sparkpost requires api_key. Optionally, set region to eu to use + the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in + North America. eu or null are the only valid values for region. +
  • +
  • + mailgun requires api_key and domain. Optionally, set region to + eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or + null are the only valid values for region. +
  • +
  • ses requires accessKeyId, secretAccessKey, and region
  • +
  • + smtp requires smtp_host, smtp_port, smtp_user, and + smtp_pass +
  • +
+Depending on the type of provider it is possible to specify settings object with different configuration +options, which will be used when sending an email: +
    +
  • + smtp provider, settings may contain headers object. +
      +
    • + When using AWS SES SMTP host, you may provide a name of configuration set in + X-SES-Configuration-Set header. Value must be a string. +
    • +
    • + When using Sparkpost host, you may provide value for + X-MSYS_API header. Value must be an object. +
    • +
    +
  • +
  • + for ses provider, settings may contain message object, where you can provide + a name of configuration set in configuration_set_name property. Value must be a string. +
  • +
@@ -14764,12 +17902,18 @@ Retrieve all clients that have the specified
-**id:** `String` — The id of the connection for which enabled clients are to be retrieved +**name:** `EmailProviderNameEnum`
@@ -14794,7 +17938,7 @@ client.connections().clients().get(
-**take:** `Optional` — Number of results per page. Defaults to 50. +**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false).
@@ -14802,7 +17946,23 @@ client.connections().clients().get(
-**from:** `Optional` — Optional Id from which to start selection. +**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. + +
+
+ +
+
+ +**credentials:** `EmailProviderCredentialsSchema` + +
+
+ +
+
+ +**settings:** `Optional>`
@@ -14814,11 +17974,11 @@ client.connections().clients().get(
-
client.connections.clients.update(id, request) +
client.emails.provider.delete()
-#### 🔌 Usage +#### 📝 Description
@@ -14826,41 +17986,23 @@ client.connections().clients().get(
-```java -client.connections().clients().update( - "id", - Arrays.asList( - UpdateEnabledClientConnectionsRequestContentItem - .builder() - .clientId("client_id") - .status(true) - .build() - ) -); -``` +Delete the email provider.
-#### ⚙️ Parameters - -
-
+#### 🔌 Usage
-**id:** `String` — The id of the connection to modify - -
-
-
-**request:** `List` - +```java +client.emails().provider().delete(); +```
@@ -14871,8 +18013,7 @@ client.connections().clients().update(
-## Connections Keys -
client.connections.keys.get(id) -> List<ConnectionKey> +
client.emails.provider.update(request) -> UpdateEmailProviderResponseContent
@@ -14884,7 +18025,46 @@ client.connections().clients().update(
-Gets the connection keys for the Okta or OIDC connection strategy. +Update an email provider. The credentials object +requires different properties depending on the email provider (which is specified using the name property): +
    +
  • mandrill requires api_key
  • +
  • sendgrid requires api_key
  • +
  • + sparkpost requires api_key. Optionally, set region to eu to use + the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in + North America. eu or null are the only valid values for region. +
  • +
  • + mailgun requires api_key and domain. Optionally, set region to + eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or + null are the only valid values for region. +
  • +
  • ses requires accessKeyId, secretAccessKey, and region
  • +
  • + smtp requires smtp_host, smtp_port, smtp_user, and + smtp_pass +
  • +
+Depending on the type of provider it is possible to specify settings object with different configuration +options, which will be used when sending an email: +
    +
  • + smtp provider, settings may contain headers object. +
      +
    • + When using AWS SES SMTP host, you may provide a name of configuration set in + X-SES-Configuration-Set header. Value must be a string. +
    • +
    • + When using Sparkpost host, you may provide value for + X-MSYS_API header. Value must be an object. +
    • +
    + for ses provider, settings may contain message object, where you can provide + a name of configuration set in configuration_set_name property. Value must be a string. +
  • +
@@ -14899,7 +18079,11 @@ Gets the connection keys for the Okta or OIDC connection strategy.
```java -client.connections().keys().get("id"); +client.emails().provider().update( + UpdateEmailProviderRequestContent + .builder() + .build() +); ```
@@ -14914,35 +18098,54 @@ client.connections().keys().get("id");
-**id:** `String` — ID of the connection +**name:** `Optional`
- - +
+
+**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false). +
-
-
client.connections.keys.rotate(id, request) -> RotateConnectionsKeysResponseContent
-#### 📝 Description +**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. + +
+
+**credentials:** `Optional` + +
+
+
-Rotates the connection keys for the Okta or OIDC connection strategies. +**settings:** `Optional>` + +
+
+ + +
+ +## EventStreams Deliveries +
client.eventStreams.deliveries.list(id) -> List<EventStreamDelivery> +
+
#### 🔌 Usage @@ -14953,9 +18156,29 @@ Rotates the connection keys for the Okta or OIDC connection strategies.
```java -client.connections().keys().rotate( +client.eventStreams().deliveries().list( "id", - Optional.empty() + ListEventStreamDeliveriesRequestParameters + .builder() + .statuses( + OptionalNullable.of("statuses") + ) + .eventTypes( + OptionalNullable.of("event_types") + ) + .dateFrom( + OptionalNullable.of("date_from") + ) + .dateTo( + OptionalNullable.of("date_to") + ) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() ); ```
@@ -14971,7 +18194,7 @@ client.connections().keys().rotate(
-**id:** `String` — ID of the connection +**id:** `String` — Unique identifier for the event stream.
@@ -14979,37 +18202,62 @@ client.connections().keys().rotate(
-**request:** `Optional` +**statuses:** `Optional` — Comma-separated list of statuses by which to filter
+ +
+
+ +**eventTypes:** `Optional` — Comma-separated list of event types by which to filter +
+
+
+**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. +
-
-## Connections ScimConfiguration -
client.connections.scimConfiguration.get(id) -> GetScimConfigurationResponseContent
-#### 📝 Description +**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + +
+
+**from:** `Optional` — Optional Id from which to start selection. + +
+
+
-Retrieves a scim configuration by its connectionId. +**take:** `Optional` — Number of results per page. Defaults to 50. +
+ + + +
+ +
client.eventStreams.deliveries.getHistory(id, eventId) -> GetEventStreamDeliveryHistoryResponseContent +
+
+ #### 🔌 Usage
@@ -15019,7 +18267,7 @@ Retrieves a scim configuration by its connectionId.
```java -client.connections().scimConfiguration().get("id"); +client.eventStreams().deliveries().getHistory("id", "event_id"); ```
@@ -15034,7 +18282,15 @@ client.connections().scimConfiguration().get("id");
-**id:** `String` — The id of the connection to retrieve its SCIM configuration +**id:** `String` — Unique identifier for the event stream. + +
+
+ +
+
+ +**eventId:** `String` — Unique identifier for the event
@@ -15046,11 +18302,12 @@ client.connections().scimConfiguration().get("id");
-
client.connections.scimConfiguration.create(id, request) -> CreateScimConfigurationResponseContent +## EventStreams Redeliveries +
client.eventStreams.redeliveries.create(id, request) -> CreateEventStreamRedeliveryResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -15058,13 +18315,20 @@ client.connections().scimConfiguration().get("id");
-Create a scim configuration for a connection. +```java +client.eventStreams().redeliveries().create( + "id", + CreateEventStreamRedeliveryRequestContent + .builder() + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -15072,26 +18336,31 @@ Create a scim configuration for a connection.
-```java -client.connections().scimConfiguration().create( - "id", - Optional.empty() -); -``` +**id:** `String` — Unique identifier for the event stream. +
+ +
+
+ +**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. +
-#### ⚙️ Parameters -
+**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. + +
+
+
-**id:** `String` — The id of the connection to create its SCIM configuration +**statuses:** `Optional>` — Filter by status
@@ -15099,7 +18368,7 @@ client.connections().scimConfiguration().create(
-**request:** `Optional` +**eventTypes:** `Optional>` — Filter by event type
@@ -15111,11 +18380,11 @@ client.connections().scimConfiguration().create(
-
client.connections.scimConfiguration.delete(id) +
client.eventStreams.redeliveries.createById(id, eventId)
-#### 📝 Description +#### 🔌 Usage
@@ -15123,13 +18392,15 @@ client.connections().scimConfiguration().create(
-Deletes a scim configuration by its connectionId. +```java +client.eventStreams().redeliveries().createById("id", "event_id"); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -15137,23 +18408,15 @@ Deletes a scim configuration by its connectionId.
-```java -client.connections().scimConfiguration().delete("id"); -``` -
-
+**id:** `String` — Unique identifier for the event stream. +
-#### ⚙️ Parameters -
-
-
- -**id:** `String` — The id of the connection to delete its SCIM configuration +**eventId:** `String` — Unique identifier for the event
@@ -15165,24 +18428,11 @@ client.connections().scimConfiguration().delete("id");
-
client.connections.scimConfiguration.update(id, request) -> UpdateScimConfigurationResponseContent -
-
- -#### 📝 Description - -
-
- +## Flows Executions +
client.flows.executions.list(flowId) -> SyncPagingIterable<FlowExecutionSummary>
-Update a scim configuration by its connectionId. -
-
-
-
- #### 🔌 Usage
@@ -15192,17 +18442,15 @@ Update a scim configuration by its connectionId.
```java -client.connections().scimConfiguration().update( - "id", - UpdateScimConfigurationRequestContent +client.flows().executions().list( + "flow_id", + ExecutionsListRequest .builder() - .userIdAttribute("user_id_attribute") - .mapping( - Arrays.asList( - ScimMappingItem - .builder() - .build() - ) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) ) .build() ); @@ -15220,7 +18468,7 @@ client.connections().scimConfiguration().update(
-**id:** `String` — The id of the connection to update its SCIM configuration +**flowId:** `String` — Flow id
@@ -15228,7 +18476,7 @@ client.connections().scimConfiguration().update(
-**userIdAttribute:** `String` — User ID attribute for generating unique user ids +**from:** `Optional` — Optional Id from which to start selection.
@@ -15236,7 +18484,7 @@ client.connections().scimConfiguration().update(
-**mapping:** `List` — The mapping between auth0 and SCIM +**take:** `Optional` — Number of results per page. Defaults to 50.
@@ -15248,11 +18496,11 @@ client.connections().scimConfiguration().update(
-
client.connections.scimConfiguration.getDefaultMapping(id) -> GetScimConfigurationDefaultMappingResponseContent +
client.flows.executions.get(flowId, executionId) -> GetFlowExecutionResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -15260,13 +18508,21 @@ client.connections().scimConfiguration().update(
-Retrieves a scim configuration's default mapping by its connectionId. +```java +client.flows().executions().get( + "flow_id", + "execution_id", + ExecutionsGetRequest + .builder() + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -15274,23 +18530,23 @@ Retrieves a scim configuration's default mapping by its connectionId
-```java -client.connections().scimConfiguration().getDefaultMapping("id"); -``` -
-
+**flowId:** `String` — Flow id +
-#### ⚙️ Parameters -
+**executionId:** `String` — Flow execution id + +
+
+
-**id:** `String` — The id of the connection to retrieve its default SCIM mapping +**hydrate:** `Optional` — Hydration param
@@ -15302,25 +18558,10 @@ client.connections().scimConfiguration().getDefaultMapping("id");
-## Connections Users -
client.connections.users.deleteByEmail(id) -
-
- -#### 📝 Description - -
-
- +
client.flows.executions.delete(flowId, executionId)
-Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. -
-
-
-
- #### 🔌 Usage
@@ -15330,13 +18571,7 @@ Deletes a specified connection user by its email (you cannot delete all users fr
```java -client.connections().users().deleteByEmail( - "id", - DeleteConnectionUsersByEmailQueryParameters - .builder() - .email("email") - .build() -); +client.flows().executions().delete("flow_id", "execution_id"); ```
@@ -15351,7 +18586,7 @@ client.connections().users().deleteByEmail(
-**id:** `String` — The id of the connection (currently only database connections are supported) +**flowId:** `String` — Flows id
@@ -15359,7 +18594,7 @@ client.connections().users().deleteByEmail(
-**email:** `String` — The email of the user to delete +**executionId:** `String` — Flow execution identifier
@@ -15371,12 +18606,12 @@ client.connections().users().deleteByEmail(
-## Connections ScimConfiguration Tokens -
client.connections.scimConfiguration.tokens.get(id) -> List<ScimTokenItem> +## Flows Vault Connections +
client.flows.vault.connections.list() -> SyncPagingIterable<FlowsVaultConnectionSummary>
-#### 📝 Description +#### 🔌 Usage
@@ -15384,13 +18619,28 @@ client.connections().users().deleteByEmail(
-Retrieves all scim tokens by its connection id. +```java +client.flows().vault().connections().list( + ListFlowsVaultConnectionsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -15398,23 +18648,23 @@ Retrieves all scim tokens by its connection id.
-```java -client.connections().scimConfiguration().tokens().get("id"); -``` -
-
+**page:** `Optional` — Page index of the results to return. First page is 0. +
-#### ⚙️ Parameters -
+**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
-**id:** `String` — The id of the connection to retrieve its SCIM configuration +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -15426,11 +18676,11 @@ client.connections().scimConfiguration().tokens().get("id");
-
client.connections.scimConfiguration.tokens.create(id, request) -> CreateScimTokenResponseContent +
client.flows.vault.connections.create(request) -> CreateFlowsVaultConnectionResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -15438,13 +18688,33 @@ client.connections().scimConfiguration().tokens().get("id");
-Create a scim token for a scim client. +```java +client.flows().vault().connections().create( + CreateFlowsVaultConnectionRequestContent.of( + CreateFlowsVaultConnectionActivecampaign.of( + CreateFlowsVaultConnectionActivecampaignApiKey + .builder() + .name("name") + .appId("ACTIVECAMPAIGN") + .setup( + FlowsVaultConnectioSetupApiKeyWithBaseUrl + .builder() + .type("API_KEY") + .apiKey("api_key") + .baseUrl("base_url") + .build() + ) + .build() + ) + ) +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -15452,44 +18722,47 @@ Create a scim token for a scim client.
-```java -client.connections().scimConfiguration().tokens().create( - "id", - CreateScimTokenRequestContent - .builder() - .build() -); -``` +**request:** `CreateFlowsVaultConnectionRequestContent` +
-#### ⚙️ Parameters +
+
+
+ +
client.flows.vault.connections.get(id) -> GetFlowsVaultConnectionResponseContent
+#### 🔌 Usage +
-**id:** `String` — The id of the connection to create its SCIM token - -
-
-
-**scopes:** `Optional>` — The scopes of the scim token - +```java +client.flows().vault().connections().get("id"); +```
+
+
+ +#### ⚙️ Parameters
-**tokenLifetime:** `Optional` — Lifetime of the token in seconds. Must be greater than 900 +
+
+ +**id:** `String` — Flows Vault connection ID
@@ -15501,24 +18774,10 @@ client.connections().scimConfiguration().tokens().create(
-
client.connections.scimConfiguration.tokens.delete(id, tokenId) -
-
- -#### 📝 Description - -
-
- +
client.flows.vault.connections.delete(id)
-Deletes a scim token by its connection id and tokenId. -
-
-
-
- #### 🔌 Usage
@@ -15528,7 +18787,7 @@ Deletes a scim token by its connection id and tokenId.
```java -client.connections().scimConfiguration().tokens().delete("id", "tokenId"); +client.flows().vault().connections().delete("id"); ```
@@ -15543,15 +18802,7 @@ client.connections().scimConfiguration().tokens().delete("id", "tokenId");
-**id:** `String` — The connection id that owns the SCIM token to delete - -
-
- -
-
- -**tokenId:** `String` — The id of the scim token to delete +**id:** `String` — Vault connection id
@@ -15563,25 +18814,10 @@ client.connections().scimConfiguration().tokens().delete("id", "tokenId");
-## Emails Provider -
client.emails.provider.get() -> GetEmailProviderResponseContent -
-
- -#### 📝 Description - +
client.flows.vault.connections.update(id, request) -> UpdateFlowsVaultConnectionResponseContent
-
-
- -Retrieve details of the email provider configuration in your tenant. A list of fields to include or exclude may also be specified. -
-
-
-
- #### 🔌 Usage
@@ -15591,11 +18827,10 @@ Retrieve details of the
-**fields:** `Optional` — Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve `name` and `enabled`. Additional fields available include `credentials`, `default_from_address`, and `settings`. +**id:** `String` — Flows Vault connection ID
@@ -15620,7 +18855,15 @@ client.emails().provider().get(
-**includeFields:** `Optional` — Whether specified fields are to be included (true) or excluded (false). +**name:** `Optional` — Flows Vault Connection name. + +
+
+ +
+
+ +**setup:** `Optional`
@@ -15632,7 +18875,8 @@ client.emails().provider().get(
-
client.emails.provider.create(request) -> CreateEmailProviderResponseContent +## Guardian Enrollments +
client.guardian.enrollments.createTicket(request) -> CreateGuardianEnrollmentTicketResponseContent
@@ -15644,48 +18888,10 @@ client.emails().provider().get(
-Create an email provider. The credentials object -requires different properties depending on the email provider (which is specified using the name property): -
    -
  • mandrill requires api_key
  • -
  • sendgrid requires api_key
  • -
  • - sparkpost requires api_key. Optionally, set region to eu to use - the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in - North America. eu or null are the only valid values for region. -
  • -
  • - mailgun requires api_key and domain. Optionally, set region to - eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or - null are the only valid values for region. -
  • -
  • ses requires accessKeyId, secretAccessKey, and region
  • -
  • - smtp requires smtp_host, smtp_port, smtp_user, and - smtp_pass -
  • -
-Depending on the type of provider it is possible to specify settings object with different configuration -options, which will be used when sending an email: -
    -
  • - smtp provider, settings may contain headers object. -
      -
    • - When using AWS SES SMTP host, you may provide a name of configuration set in - X-SES-Configuration-Set header. Value must be a string. -
    • -
    • - When using Sparkpost host, you may provide value for - X-MSYS_API header. Value must be an object. -
    • -
    -
  • -
  • - for ses provider, settings may contain message object, where you can provide - a name of configuration set in configuration_set_name property. Value must be a string. -
  • -
+Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. +Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
+ +Note: Users cannot enroll in Email as a factor through custom enrollment tickets.
@@ -15700,18 +18906,10 @@ options, which will be used when sending an email:
```java -client.emails().provider().create( - CreateEmailProviderRequestContent +client.guardian().enrollments().createTicket( + CreateGuardianEnrollmentTicketRequestContent .builder() - .name(EmailProviderNameEnum.MAILGUN) - .credentials( - EmailProviderCredentialsSchema.of( - EmailProviderCredentialsSchemaZero - .builder() - .apiKey("api_key") - .build() - ) - ) + .userId("user_id") .build() ); ``` @@ -15728,7 +18926,7 @@ client.emails().provider().create(
-**name:** `EmailProviderNameEnum` +**userId:** `String` — user_id for the enrollment ticket
@@ -15736,7 +18934,7 @@ client.emails().provider().create(
-**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false). +**email:** `Optional` — alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address
@@ -15744,7 +18942,7 @@ client.emails().provider().create(
-**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. +**sendMail:** `Optional` — Send an email to the user to start the enrollment
@@ -15752,7 +18950,7 @@ client.emails().provider().create(
-**credentials:** `EmailProviderCredentialsSchema` +**emailLocale:** `Optional` — Optional. Specify the locale of the enrollment email. Used with send_email.
@@ -15760,7 +18958,15 @@ client.emails().provider().create(
-**settings:** `Optional>` +**factor:** `Optional` + +
+
+ +
+
+ +**allowMultipleEnrollments:** `Optional` — Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.
Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.
@@ -15772,7 +18978,7 @@ client.emails().provider().create(
-
client.emails.provider.delete() +
client.guardian.enrollments.get(id) -> GetGuardianEnrollmentResponseContent
@@ -15784,7 +18990,7 @@ client.emails().provider().create(
-Delete the email provider. +Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account.
@@ -15799,19 +19005,34 @@ Delete the email provider.
```java -client.emails().provider().delete(); +client.guardian().enrollments().get("id"); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the enrollment to be retrieve. + +
+
+
+
+
-
client.emails.provider.update(request) -> UpdateEmailProviderResponseContent +
client.guardian.enrollments.delete(id)
@@ -15823,46 +19044,7 @@ client.emails().provider().delete();
-Update an email provider. The credentials object -requires different properties depending on the email provider (which is specified using the name property): -
    -
  • mandrill requires api_key
  • -
  • sendgrid requires api_key
  • -
  • - sparkpost requires api_key. Optionally, set region to eu to use - the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in - North America. eu or null are the only valid values for region. -
  • -
  • - mailgun requires api_key and domain. Optionally, set region to - eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or - null are the only valid values for region. -
  • -
  • ses requires accessKeyId, secretAccessKey, and region
  • -
  • - smtp requires smtp_host, smtp_port, smtp_user, and - smtp_pass -
  • -
-Depending on the type of provider it is possible to specify settings object with different configuration -options, which will be used when sending an email: -
    -
  • - smtp provider, settings may contain headers object. -
      -
    • - When using AWS SES SMTP host, you may provide a name of configuration set in - X-SES-Configuration-Set header. Value must be a string. -
    • -
    • - When using Sparkpost host, you may provide value for - X-MSYS_API header. Value must be an object. -
    • -
    - for ses provider, settings may contain message object, where you can provide - a name of configuration set in configuration_set_name property. Value must be a string. -
  • -
+Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes.
@@ -15877,11 +19059,7 @@ options, which will be used when sending an email:
```java -client.emails().provider().update( - UpdateEmailProviderRequestContent - .builder() - .build() -); +client.guardian().enrollments().delete("id"); ```
@@ -15896,54 +19074,75 @@ client.emails().provider().update(
-**name:** `Optional` +**id:** `String` — ID of the enrollment to be deleted.
+ + -
-
-**enabled:** `Optional` — Whether the provider is enabled (true) or disabled (false). -
+
+## Guardian Factors +
client.guardian.factors.list() -> List<GuardianFactor>
-**defaultFromAddress:** `Optional` — Email address to use as "from" when no other address specified. - -
-
+#### 📝 Description
-**credentials:** `Optional` - +
+
+ +Retrieve details of all multi-factor authentication factors associated with your tenant. +
+
+#### 🔌 Usage +
-**settings:** `Optional>` - +
+
+ +```java +client.guardian().factors().list(); +``` +
+
+ + +
+ +
client.guardian.factors.set(name, request) -> SetGuardianFactorResponseContent +
+
+ +#### 📝 Description + +
+
+
+
+Update the status (i.e., enabled or disabled) of a specific multi-factor authentication factor. +
+
-
- -## EventStreams Deliveries -
client.eventStreams.deliveries.list(id) -> List<EventStreamDelivery> -
-
#### 🔌 Usage @@ -15954,16 +19153,11 @@ client.emails().provider().update(
```java -client.eventStreams().deliveries().list( - "id", - ListEventStreamDeliveriesRequestParameters +client.guardian().factors().set( + GuardianFactorNameEnum.PUSH_NOTIFICATION, + SetGuardianFactorRequestContent .builder() - .statuses("statuses") - .eventTypes("event_types") - .dateFrom("date_from") - .dateTo("date_to") - .from("from") - .take(1) + .enabled(true) .build() ); ``` @@ -15980,7 +19174,7 @@ client.eventStreams().deliveries().list(
-**id:** `String` — Unique identifier for the event stream. +**name:** `GuardianFactorNameEnum` — Factor name. Can be `sms`, `push-notification`, `email`, `duo` `otp` `webauthn-roaming`, `webauthn-platform`, or `recovery-code`.
@@ -15988,61 +19182,44 @@ client.eventStreams().deliveries().list(
-**statuses:** `Optional` — Comma-separated list of statuses by which to filter +**enabled:** `Boolean` — Whether this factor is enabled (true) or disabled (false).
- -
-
- -**eventTypes:** `Optional` — Comma-separated list of event types by which to filter -
-
-
-**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. -
+
+## Guardian Policies +
client.guardian.policies.list() -> List<MfaPolicyEnum>
-**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. - -
-
+#### 📝 Description
-**from:** `Optional` — Optional Id from which to start selection. - -
-
-
-**take:** `Optional` — Number of results per page. Defaults to 50. - -
-
- - +Retrieve the multi-factor authentication (MFA) policies configured for your tenant. +The following policies are supported: +
    +
  • all-applications policy prompts with MFA for all logins.
  • +
  • confidence-score policy prompts with MFA only for low confidence logins.
  • +
+Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + + -
- -
client.eventStreams.deliveries.getHistory(id, eventId) -> GetEventStreamDeliveryHistoryResponseContent -
-
#### 🔌 Usage @@ -16053,45 +19230,43 @@ client.eventStreams().deliveries().list(
```java -client.eventStreams().deliveries().getHistory("id", "event_id"); +client.guardian().policies().list(); ```
-#### ⚙️ Parameters + + +
+ +
client.guardian.policies.set(request) -> List<MfaPolicyEnum>
+#### 📝 Description +
-**id:** `String` — Unique identifier for the event stream. - -
-
-
-**eventId:** `String` — Unique identifier for the event - -
-
-
-
+Set multi-factor authentication (MFA) policies for your tenant. +The following policies are supported: +
    +
  • all-applications policy prompts with MFA for all logins.
  • +
  • confidence-score policy prompts with MFA only for low confidence logins.
  • +
+Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + + -
- -## EventStreams Redeliveries -
client.eventStreams.redeliveries.create(id, request) -> CreateEventStreamRedeliveryResponseContent -
-
#### 🔌 Usage @@ -16102,11 +19277,8 @@ client.eventStreams().deliveries().getHistory("id", "event_id");
```java -client.eventStreams().redeliveries().create( - "id", - CreateEventStreamRedeliveryRequestContent - .builder() - .build() +client.guardian().policies().set( + Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS) ); ```
@@ -16122,53 +19294,36 @@ client.eventStreams().redeliveries().create(
-**id:** `String` — Unique identifier for the event stream. +**request:** `List`
+ +
-
-
-**dateFrom:** `Optional` — An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. -
+
+## Guardian Factors Phone +
client.guardian.factors.phone.getMessageTypes() -> GetGuardianFactorPhoneMessageTypesResponseContent
-**dateTo:** `Optional` — An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. - -
-
+#### 📝 Description
-**statuses:** `Optional>` — Filter by status - -
-
-
-**eventTypes:** `Optional>` — Filter by event type - -
-
+Retrieve list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant. - - -
- -
client.eventStreams.redeliveries.createById(id, eventId) -
-
#### 🔌 Usage @@ -16179,45 +19334,35 @@ client.eventStreams().redeliveries().create(
```java -client.eventStreams().redeliveries().createById("id", "event_id"); +client.guardian().factors().phone().getMessageTypes(); ```
-#### ⚙️ Parameters + + +
+ +
client.guardian.factors.phone.setMessageTypes(request) -> SetGuardianFactorPhoneMessageTypesResponseContent
+#### 📝 Description +
-**id:** `String` — Unique identifier for the event stream. - -
-
-
-**eventId:** `String` — Unique identifier for the event - -
-
+Replace the list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant.
- - -
- -## Flows Executions -
client.flows.executions.list(flowId) -> SyncPagingIterable<FlowExecutionSummary> -
-
#### 🔌 Usage @@ -16228,12 +19373,12 @@ client.eventStreams().redeliveries().createById("id", "event_id");
```java -client.flows().executions().list( - "flow_id", - ExecutionsListRequest +client.guardian().factors().phone().setMessageTypes( + SetGuardianFactorPhoneMessageTypesRequestContent .builder() - .from("from") - .take(1) + .messageTypes( + Arrays.asList(GuardianFactorPhoneFactorMessageTypeEnum.SMS) + ) .build() ); ``` @@ -16250,23 +19395,7 @@ client.flows().executions().list(
-**flowId:** `String` — Flow id - -
-
- -
-
- -**from:** `Optional` — Optional Id from which to start selection. - -
-
- -
-
- -**take:** `Optional` — Number of results per page. Defaults to 50. +**messageTypes:** `List` — The list of phone factors to enable on the tenant. Can include `sms` and `voice`.
@@ -16278,11 +19407,11 @@ client.flows().executions().list(
-
client.flows.executions.get(flowId, executionId) -> GetFlowExecutionResponseContent +
client.guardian.factors.phone.getTwilioProvider() -> GetGuardianFactorsProviderPhoneTwilioResponseContent
-#### 🔌 Usage +#### 📝 Description
@@ -16290,21 +19419,13 @@ client.flows().executions().list(
-```java -client.flows().executions().get( - "flow_id", - "execution_id", - ExecutionsGetRequest - .builder() - .build() -); -``` +Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review Configure SMS and Voice Notifications for MFA.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -16312,39 +19433,58 @@ client.flows().executions().get(
-**flowId:** `String` — Flow id - +```java +client.guardian().factors().phone().getTwilioProvider(); +``` +
+
-
-
-**executionId:** `String` — Flow execution id -
+
+ +
client.guardian.factors.phone.setTwilioProvider(request) -> SetGuardianFactorsProviderPhoneTwilioResponseContent +
+
+ +#### 📝 Description
-**hydrate:** `Optional` — Hydration param - +
+
+ +Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review Configure SMS and Voice Notifications for MFA.
+#### 🔌 Usage -
-
-
+
+
-
client.flows.executions.delete(flowId, executionId)
-#### 🔌 Usage +```java +client.guardian().factors().phone().setTwilioProvider( + SetGuardianFactorsProviderPhoneTwilioRequestContent + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters
@@ -16352,23 +19492,23 @@ client.flows().executions().get(
-```java -client.flows().executions().delete("flow_id", "execution_id"); -``` -
-
+**from:** `Optional` — From number +
-#### ⚙️ Parameters -
+**messagingServiceSid:** `Optional` — Copilot SID + +
+
+
-**flowId:** `String` — Flows id +**authToken:** `Optional` — Twilio Authentication token
@@ -16376,7 +19516,7 @@ client.flows().executions().delete("flow_id", "execution_id");
-**executionId:** `String` — Flow execution identifier +**sid:** `Optional` — Twilio SID
@@ -16388,8 +19528,7 @@ client.flows().executions().delete("flow_id", "execution_id");
-## Guardian Enrollments -
client.guardian.enrollments.createTicket(request) -> CreateGuardianEnrollmentTicketResponseContent +
client.guardian.factors.phone.getSelectedProvider() -> GetGuardianFactorsProviderPhoneResponseContent
@@ -16401,10 +19540,7 @@ client.flows().executions().delete("flow_id", "execution_id");
-Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. -Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- -Note: Users cannot enroll in Email as a factor through custom enrollment tickets. +Retrieve details of the multi-factor authentication phone provider configured for your tenant.
@@ -16419,67 +19555,52 @@ Note: Users cannot enroll in Email as a factor through custom enrollment tickets
```java -client.guardian().enrollments().createTicket( - CreateGuardianEnrollmentTicketRequestContent - .builder() - .userId("user_id") - .build() -); +client.guardian().factors().phone().getSelectedProvider(); ```
-#### ⚙️ Parameters - -
-
- -
-
-**userId:** `String` — user_id for the enrollment ticket -
+
+
client.guardian.factors.phone.setProvider(request) -> SetGuardianFactorsProviderPhoneResponseContent
-**email:** `Optional` — alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address - -
-
+#### 🔌 Usage
-**sendMail:** `Optional` — Send an email to the user to start the enrollment - -
-
-
-**emailLocale:** `Optional` — Optional. Specify the locale of the enrollment email. Used with send_email. - +```java +client.guardian().factors().phone().setProvider( + SetGuardianFactorsProviderPhoneRequestContent + .builder() + .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) + .build() +); +```
+ + + +#### ⚙️ Parameters
-**factor:** `Optional` - -
-
-
-**allowMultipleEnrollments:** `Optional` — Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.
Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages. +**provider:** `GuardianFactorsProviderSmsProviderEnum`
@@ -16491,7 +19612,7 @@ client.guardian().enrollments().createTicket(
-
client.guardian.enrollments.get(id) -> GetGuardianEnrollmentResponseContent +
client.guardian.factors.phone.getTemplates() -> GetGuardianFactorPhoneTemplatesResponseContent
@@ -16503,7 +19624,7 @@ client.guardian().enrollments().createTicket(
-Retrieve details, such as status and type, for a specific multi-factor authentication enrollment registered to a user account. +Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
@@ -16518,34 +19639,19 @@ Retrieve details, such as status and type, for a specific multi-factor authentic
```java -client.guardian().enrollments().get("id"); +client.guardian().factors().phone().getTemplates(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — ID of the enrollment to be retrieve. - -
-
-
-
-
-
client.guardian.enrollments.delete(id) +
client.guardian.factors.phone.setTemplates(request) -> SetGuardianFactorPhoneTemplatesResponseContent
@@ -16557,7 +19663,7 @@ client.guardian().enrollments().get("id");
-Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. +Customize the messages sent to complete phone enrollment and verification (subscription required).
@@ -16572,7 +19678,13 @@ Remove a specific multi-factor authentication (MFA) enrollment from a user's acc
```java -client.guardian().enrollments().delete("id"); +client.guardian().factors().phone().setTemplates( + SetGuardianFactorPhoneTemplatesRequestContent + .builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build() +); ```
@@ -16587,7 +19699,15 @@ client.guardian().enrollments().delete("id");
-**id:** `String` — ID of the enrollment to be deleted. +**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number. + +
+
+ +
+
+ +**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account.
@@ -16599,8 +19719,8 @@ client.guardian().enrollments().delete("id");
-## Guardian Factors -
client.guardian.factors.list() -> List<GuardianFactor> +## Guardian Factors PushNotification +
client.guardian.factors.pushNotification.getApnsProvider() -> GetGuardianFactorsProviderApnsResponseContent
@@ -16612,7 +19732,7 @@ client.guardian().enrollments().delete("id");
-Retrieve details of all multi-factor authentication factors associated with your tenant. +Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant.
@@ -16627,7 +19747,7 @@ Retrieve details of all multi-factor authentication (MFA) policies configured for your tenant. - -The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- -Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +Modify configuration details of the multi-factor authentication APNS provider associated with your tenant.
@@ -16743,23 +19860,18 @@ The following policies are supported:
```java -client.guardian().policies().list(); +client.guardian().factors().pushNotification().updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent + .builder() + .build() +); ```
- - - -
- -
client.guardian.policies.set(request) -> List<MfaPolicyEnum> -
-
- -#### 📝 Description +#### ⚙️ Parameters
@@ -16767,47 +19879,23 @@ client.guardian().policies().list();
-Set multi-factor authentication (MFA) policies for your tenant. - -The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- -Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. -
-
+**sandbox:** `Optional` +
-#### 🔌 Usage - -
-
-
-```java -client.guardian().policies().set( - Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS) -); -``` -
-
+**bundleId:** `Optional` +
-#### ⚙️ Parameters - -
-
-
-**request:** `List` +**p12:** `Optional`
@@ -16819,8 +19907,7 @@ client.guardian().policies().set(
-## Guardian Factors Phone -
client.guardian.factors.phone.getMessageTypes() -> GetGuardianFactorPhoneMessageTypesResponseContent +
client.guardian.factors.pushNotification.setFcmProvider(request) -> Map<String, Object>
@@ -16832,7 +19919,7 @@ client.guardian().policies().set(
-Retrieve list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant. +Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant.
@@ -16847,19 +19934,38 @@ Retrieve list of phone-type MFA factors (i.e., sms and voice) that are enabled for your tenant. +Modify configuration details of the multi-factor authentication FCM provider associated with your tenant.
@@ -16886,12 +19992,9 @@ Replace the list of Configure SMS and Voice Notifications for MFA. +Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. @@ -16947,19 +20050,38 @@ Retrieve configuration details for a Twilio phone provider that has been set up
```java -client.guardian().factors().phone().getTwilioProvider(); +client.guardian().factors().pushNotification().setFcmv1Provider( + SetGuardianFactorsProviderPushNotificationFcmv1RequestContent + .builder() + .build() +); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**serverCredentials:** `Optional` + +
+
+
+
+
-
client.guardian.factors.phone.setTwilioProvider(request) -> SetGuardianFactorsProviderPhoneTwilioResponseContent +
client.guardian.factors.pushNotification.updateFcmv1Provider(request) -> Map<String, Object>
@@ -16971,7 +20093,7 @@ client.guardian().factors().phone().getTwilioProvider();
-Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review Configure SMS and Voice Notifications for MFA. +Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant.
@@ -16986,8 +20108,8 @@ Update the configuration of a Twilio phone provider that has been set up in your
```java -client.guardian().factors().phone().setTwilioProvider( - SetGuardianFactorsProviderPhoneTwilioRequestContent +client.guardian().factors().pushNotification().updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent .builder() .build() ); @@ -17005,31 +20127,7 @@ client.guardian().factors().phone().setTwilioProvider(
-**from:** `Optional` — From number - -
-
- -
-
- -**messagingServiceSid:** `Optional` — Copilot SID - -
-
- -
-
- -**authToken:** `Optional` — Twilio Authentication token - -
-
- -
-
- -**sid:** `Optional` — Twilio SID +**serverCredentials:** `Optional`
@@ -17041,7 +20139,7 @@ client.guardian().factors().phone().setTwilioProvider(
-
client.guardian.factors.phone.getSelectedProvider() -> GetGuardianFactorsProviderPhoneResponseContent +
client.guardian.factors.pushNotification.getSnsProvider() -> GetGuardianFactorsProviderSnsResponseContent
@@ -17053,7 +20151,7 @@ client.guardian().factors().phone().setTwilioProvider(
-Retrieve details of the multi-factor authentication phone provider configured for your tenant. +Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA.
@@ -17068,7 +20166,7 @@ Retrieve details of the multi-factor authentication phone provider configured fo
```java -client.guardian().factors().phone().getSelectedProvider(); +client.guardian().factors().pushNotification().getSnsProvider(); ```
@@ -17080,10 +20178,24 @@ client.guardian().factors().phone().getSelectedProvider();
-
client.guardian.factors.phone.setProvider(request) -> SetGuardianFactorsProviderPhoneResponseContent +
client.guardian.factors.pushNotification.setSnsProvider(request) -> SetGuardianFactorsProviderPushNotificationSnsResponseContent +
+
+ +#### 📝 Description + +
+
+
+Configure the AWS SNS push notification provider configuration (subscription required). +
+
+
+
+ #### 🔌 Usage
@@ -17093,10 +20205,9 @@ client.guardian().factors().phone().getSelectedProvider();
```java -client.guardian().factors().phone().setProvider( - SetGuardianFactorsProviderPhoneRequestContent +client.guardian().factors().pushNotification().setSnsProvider( + SetGuardianFactorsProviderPushNotificationSnsRequestContent .builder() - .provider(GuardianFactorsProviderSmsProviderEnum.AUTH0) .build() ); ``` @@ -17113,47 +20224,40 @@ client.guardian().factors().phone().setProvider(
-**provider:** `GuardianFactorsProviderSmsProviderEnum` +**awsAccessKeyId:** `Optional`
-
-
+
+
+**awsSecretAccessKey:** `Optional` +
-
-
client.guardian.factors.phone.getTemplates() -> GetGuardianFactorPhoneTemplatesResponseContent
-#### 📝 Description - -
-
+**awsRegion:** `Optional` + +
+
-Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant. -
-
+**snsApnsPlatformApplicationArn:** `Optional` +
-#### 🔌 Usage -
-
-
- -```java -client.guardian().factors().phone().getTemplates(); -``` +**snsGcmPlatformApplicationArn:** `Optional` +
@@ -17164,7 +20268,7 @@ client.guardian().factors().phone().getTemplates();
-
client.guardian.factors.phone.setTemplates(request) -> SetGuardianFactorPhoneTemplatesResponseContent +
client.guardian.factors.pushNotification.updateSnsProvider(request) -> UpdateGuardianFactorsProviderPushNotificationSnsResponseContent
@@ -17176,7 +20280,7 @@ client.guardian().factors().phone().getTemplates();
-Customize the messages sent to complete phone enrollment and verification (subscription required). +Configure the AWS SNS push notification provider configuration (subscription required).
@@ -17191,11 +20295,9 @@ Customize the messages sent to complete phone enrollment and verification (subsc
```java -client.guardian().factors().phone().setTemplates( - SetGuardianFactorPhoneTemplatesRequestContent +client.guardian().factors().pushNotification().updateSnsProvider( + UpdateGuardianFactorsProviderPushNotificationSnsRequestContent .builder() - .enrollmentMessage("enrollment_message") - .verificationMessage("verification_message") .build() ); ``` @@ -17212,7 +20314,7 @@ client.guardian().factors().phone().setTemplates(
-**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number. +**awsAccessKeyId:** `Optional`
@@ -17220,7 +20322,31 @@ client.guardian().factors().phone().setTemplates(
-**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account. +**awsSecretAccessKey:** `Optional` + +
+
+ +
+
+ +**awsRegion:** `Optional` + +
+
+ +
+
+ +**snsApnsPlatformApplicationArn:** `Optional` + +
+
+ +
+
+ +**snsGcmPlatformApplicationArn:** `Optional`
@@ -17232,8 +20358,7 @@ client.guardian().factors().phone().setTemplates(
-## Guardian Factors PushNotification -
client.guardian.factors.pushNotification.getApnsProvider() -> GetGuardianFactorsProviderApnsResponseContent +
client.guardian.factors.pushNotification.getSelectedProvider() -> GetGuardianFactorsProviderPushNotificationResponseContent
@@ -17245,7 +20370,7 @@ client.guardian().factors().phone().setTemplates(
-Retrieve configuration details for the multi-factor authentication APNS provider associated with your tenant. +Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA.
@@ -17260,7 +20385,7 @@ Retrieve configuration details for the multi-factor authentication APNS provider
```java -client.guardian().factors().pushNotification().getApnsProvider(); +client.guardian().factors().pushNotification().getSelectedProvider(); ```
@@ -17272,7 +20397,7 @@ client.guardian().factors().pushNotification().getApnsProvider();
-
client.guardian.factors.pushNotification.setApnsProvider(request) -> SetGuardianFactorsProviderPushNotificationApnsResponseContent +
client.guardian.factors.pushNotification.setProvider(request) -> SetGuardianFactorsProviderPushNotificationResponseContent
@@ -17284,7 +20409,7 @@ client.guardian().factors().pushNotification().getApnsProvider();
-Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. +Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA.
@@ -17299,9 +20424,10 @@ Modify configuration details of the multi-factor authentication APNS provider as
```java -client.guardian().factors().pushNotification().setApnsProvider( - SetGuardianFactorsProviderPushNotificationApnsRequestContent +client.guardian().factors().pushNotification().setProvider( + SetGuardianFactorsProviderPushNotificationRequestContent .builder() + .provider(GuardianFactorsProviderPushNotificationProviderDataEnum.GUARDIAN) .build() ); ``` @@ -17318,7 +20444,7 @@ client.guardian().factors().pushNotification().setApnsProvider(
-**request:** `SetGuardianFactorsProviderPushNotificationApnsRequestContent` +**provider:** `GuardianFactorsProviderPushNotificationProviderDataEnum`
@@ -17330,7 +20456,8 @@ client.guardian().factors().pushNotification().setApnsProvider(
-
client.guardian.factors.pushNotification.setFcmProvider(request) -> Map<String, Object> +## Guardian Factors Sms +
client.guardian.factors.sms.getTwilioProvider() -> GetGuardianFactorsProviderSmsTwilioResponseContent
@@ -17342,7 +20469,9 @@ client.guardian().factors().pushNotification().setApnsProvider(
-Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. +Retrieve the Twilio SMS provider configuration (subscription required). + + A new endpoint is available to retrieve the Twilio configuration related to phone factors (phone Twilio configuration). It has the same payload as this one. Please use it instead.
@@ -17357,38 +20486,19 @@ Modify configuration details of the multi-factor authentication FCM provider ass
```java -client.guardian().factors().pushNotification().setFcmProvider( - SetGuardianFactorsProviderPushNotificationFcmRequestContent - .builder() - .build() -); +client.guardian().factors().sms().getTwilioProvider(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**request:** `SetGuardianFactorsProviderPushNotificationFcmRequestContent` - -
-
-
-
-
-
client.guardian.factors.pushNotification.setFcmv1Provider(request) -> Map<String, Object> +
client.guardian.factors.sms.setTwilioProvider(request) -> SetGuardianFactorsProviderSmsTwilioResponseContent
@@ -17400,7 +20510,9 @@ client.guardian().factors().pushNotification().setFcmProvider(
-Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. +This endpoint has been deprecated. To complete this action, use the Update Twilio phone configuration endpoint. + + Previous functionality: Update the Twilio SMS provider configuration.
@@ -17415,8 +20527,8 @@ Modify configuration details of the multi-factor authentication FCMV1 provider a
```java -client.guardian().factors().pushNotification().setFcmv1Provider( - SetGuardianFactorsProviderPushNotificationFcmv1RequestContent +client.guardian().factors().sms().setTwilioProvider( + SetGuardianFactorsProviderSmsTwilioRequestContent .builder() .build() ); @@ -17434,7 +20546,31 @@ client.guardian().factors().pushNotification().setFcmv1Provider(
-**request:** `SetGuardianFactorsProviderPushNotificationFcmv1RequestContent` +**from:** `Optional` — From number + +
+
+ +
+
+ +**messagingServiceSid:** `Optional` — Copilot SID + +
+
+ +
+
+ +**authToken:** `Optional` — Twilio Authentication token + +
+
+ +
+
+ +**sid:** `Optional` — Twilio SID
@@ -17446,7 +20582,7 @@ client.guardian().factors().pushNotification().setFcmv1Provider(
-
client.guardian.factors.pushNotification.getSnsProvider() -> GetGuardianFactorsProviderSnsResponseContent +
client.guardian.factors.sms.getSelectedProvider() -> GetGuardianFactorsProviderSmsResponseContent
@@ -17458,7 +20594,9 @@ client.guardian().factors().pushNotification().setFcmv1Provider(
-Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. +This endpoint has been deprecated. To complete this action, use the Retrieve phone configuration endpoint instead. + + Previous functionality: Retrieve details for the multi-factor authentication SMS provider configured for your tenant.
@@ -17473,7 +20611,7 @@ Retrieve configuration details for an AWS SNS push notification provider that ha
```java -client.guardian().factors().pushNotification().getSnsProvider(); +client.guardian().factors().sms().getSelectedProvider(); ```
@@ -17485,7 +20623,7 @@ client.guardian().factors().pushNotification().getSnsProvider();
-
client.guardian.factors.pushNotification.setSnsProvider(request) -> SetGuardianFactorsProviderPushNotificationSnsResponseContent +
client.guardian.factors.sms.setProvider(request) -> SetGuardianFactorsProviderSmsResponseContent
@@ -17497,7 +20635,9 @@ client.guardian().factors().pushNotification().getSnsProvider();
-Configure the AWS SNS push notification provider configuration (subscription required). +This endpoint has been deprecated. To complete this action, use the Update phone configuration endpoint instead. + + Previous functionality: Update the multi-factor authentication SMS provider configuration in your tenant.
@@ -17512,9 +20652,10 @@ Configure the AWS SNS push notification provider configuration (subscription required). +This endpoint has been deprecated. To complete this action, use the Retrieve enrollment and verification phone templates endpoint instead. + + Previous function: Retrieve details of SMS enrollment and verification templates configured for your tenant.
@@ -17602,50 +20713,69 @@ Configure the Update enrollment and verification phone templates endpoint instead. + + Previous functionality: Customize the messages sent to complete SMS enrollment and verification. + + +#### 🔌 Usage +
-**awsRegion:** `Optional` - +
+
+ +```java +client.guardian().factors().sms().setTemplates( + SetGuardianFactorSmsTemplatesRequestContent + .builder() + .enrollmentMessage("enrollment_message") + .verificationMessage("verification_message") + .build() +); +```
+
+
+ +#### ⚙️ Parameters
-**snsApnsPlatformApplicationArn:** `Optional` +
+
+ +**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number.
@@ -17653,7 +20783,7 @@ client.guardian().factors().pushNotification().updateSnsProvider(
-**snsGcmPlatformApplicationArn:** `Optional` +**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account.
@@ -17665,7 +20795,8 @@ client.guardian().factors().pushNotification().updateSnsProvider(
-
client.guardian.factors.pushNotification.getSelectedProvider() -> GetGuardianFactorsProviderPushNotificationResponseContent +## Guardian Factors Duo Settings +
client.guardian.factors.duo.settings.get() -> GetGuardianFactorDuoSettingsResponseContent
@@ -17677,7 +20808,7 @@ client.guardian().factors().pushNotification().updateSnsProvider(
-Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA. +Retrieves the DUO account and factor configuration.
@@ -17692,7 +20823,7 @@ Modify the push notification provider configured for your tenant. For more infor
```java -client.guardian().factors().pushNotification().getSelectedProvider(); +client.guardian().factors().duo().settings().get(); ```
@@ -17704,7 +20835,7 @@ client.guardian().factors().pushNotification().getSelectedProvider();
-
client.guardian.factors.pushNotification.setProvider(request) -> SetGuardianFactorsProviderPushNotificationResponseContent +
client.guardian.factors.duo.settings.set(request) -> SetGuardianFactorDuoSettingsResponseContent
@@ -17716,7 +20847,7 @@ client.guardian().factors().pushNotification().getSelectedProvider();
-Modify the push notification provider configured for your tenant. For more information, review Configure Push Notifications for MFA. +Set the DUO account configuration and other properties specific to this factor.
@@ -17731,10 +20862,9 @@ Modify the push notification provider configured for your tenant. For more infor
```java -client.guardian().factors().pushNotification().setProvider( - SetGuardianFactorsProviderPushNotificationRequestContent +client.guardian().factors().duo().settings().set( + SetGuardianFactorDuoSettingsRequestContent .builder() - .provider(GuardianFactorsProviderPushNotificationProviderDataEnum.GUARDIAN) .build() ); ``` @@ -17751,7 +20881,23 @@ client.guardian().factors().pushNotification().setProvider(
-**provider:** `GuardianFactorsProviderPushNotificationProviderDataEnum` +**ikey:** `Optional` + +
+
+ +
+
+ +**skey:** `Optional` + +
+
+ +
+
+ +**host:** `Optional`
@@ -17763,12 +20909,11 @@ client.guardian().factors().pushNotification().setProvider(
-## Guardian Factors Sms -
client.guardian.factors.sms.getTwilioProvider() -> GetGuardianFactorsProviderSmsTwilioResponseContent +
client.guardian.factors.duo.settings.update(request) -> UpdateGuardianFactorDuoSettingsResponseContent
-#### 📝 Description +#### 🔌 Usage
@@ -17776,15 +20921,19 @@ client.guardian().factors().pushNotification().setProvider(
-Retrieve the Twilio SMS provider configuration (subscription required). - - A new endpoint is available to retrieve the Twilio configuration related to phone factors (phone Twilio configuration). It has the same payload as this one. Please use it instead. +```java +client.guardian().factors().duo().settings().update( + UpdateGuardianFactorDuoSettingsRequestContent + .builder() + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -17792,9 +20941,24 @@ Retrieve the Update Twilio phone configuration endpoint. - - Previous functionality: Update the Twilio SMS provider configuration. +Retrieve a hook's secrets by the ID of the hook.
@@ -17834,11 +20997,7 @@ This endpoint has been deprecated. To complete this action, use the
@@ -17853,47 +21012,37 @@ client.guardian().factors().sms().setTwilioProvider(
-**from:** `Optional` — From number +**id:** `String` — ID of the hook to retrieve secrets from.
+ + -
-
-**messagingServiceSid:** `Optional` — Copilot SID -
+
+
client.hooks.secrets.create(id, request)
-**authToken:** `Optional` — Twilio Authentication token - -
-
+#### 📝 Description
-**sid:** `Optional` — Twilio SID - -
-
+
+
+ +Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets.
- - -
- -
client.guardian.factors.sms.getSelectedProvider() -> GetGuardianFactorsProviderSmsResponseContent -
-
-#### 📝 Description +#### 🔌 Usage
@@ -17901,15 +21050,20 @@ client.guardian().factors().sms().setTwilioProvider(
-This endpoint has been deprecated. To complete this action, use the Retrieve phone configuration endpoint instead. - - Previous functionality: Retrieve details for the multi-factor authentication SMS provider configured for your tenant. +```java +client.hooks().secrets().create( + "id", + new HashMap() {{ + put("key", "value"); + }} +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -17917,9 +21071,16 @@ This endpoint has been deprecated. To complete this action, use the Update phone configuration endpoint instead. - - Previous functionality: Update the multi-factor authentication SMS provider configuration in your tenant. +Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete.
@@ -17959,11 +21118,9 @@ This endpoint has been deprecated. To complete this action, use the @@ -17979,7 +21136,15 @@ client.guardian().factors().sms().setProvider(
-**provider:** `GuardianFactorsProviderSmsProviderEnum` +**id:** `String` — ID of the hook whose secrets to delete. + +
+
+ +
+
+ +**request:** `List`
@@ -17991,7 +21156,7 @@ client.guardian().factors().sms().setProvider(
-
client.guardian.factors.sms.getTemplates() -> GetGuardianFactorSmsTemplatesResponseContent +
client.hooks.secrets.update(id, request)
@@ -18003,25 +21168,51 @@ client.guardian().factors().sms().setProvider(
-This endpoint has been deprecated. To complete this action, use the Retrieve enrollment and verification phone templates endpoint instead. +Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. +
+
+
+
- Previous function: Retrieve details of SMS enrollment and verification templates configured for your tenant. +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.hooks().secrets().update( + "id", + new HashMap() {{ + put("key", "value"); + }} +); +```
-#### 🔌 Usage +#### ⚙️ Parameters + +
+
+**id:** `String` — ID of the hook whose secrets to update. + +
+
+
-```java -client.guardian().factors().sms().getTemplates(); -``` +**request:** `Map` +
@@ -18032,7 +21223,8 @@ client.guardian().factors().sms().getTemplates();
-
client.guardian.factors.sms.setTemplates(request) -> SetGuardianFactorSmsTemplatesResponseContent +## Jobs UsersExports +
client.jobs.usersExports.create(request) -> CreateExportUsersResponseContent
@@ -18044,9 +21236,7 @@ client.guardian().factors().sms().getTemplates();
-This endpoint has been deprecated. To complete this action, use the Update enrollment and verification phone templates endpoint instead. - - Previous functionality: Customize the messages sent to complete SMS enrollment and verification. +Export all users to a file via a long-running job.
@@ -18061,11 +21251,9 @@ This endpoint has been deprecated. To complete this action, use the
-**enrollmentMessage:** `String` — Message sent to the user when they are invited to enroll with a phone number. +**connectionId:** `Optional` — connection_id of the connection from which users will be exported.
@@ -18090,7 +21278,23 @@ client.guardian().factors().sms().setTemplates(
-**verificationMessage:** `String` — Message sent to the user when they are prompted to verify their account. +**format:** `Optional` + +
+
+ +
+
+ +**limit:** `Optional` — Limit the number of records. + +
+
+ +
+
+ +**fields:** `Optional>` — List of fields to be included in the CSV. Defaults to a predefined set of fields.
@@ -18102,8 +21306,8 @@ client.guardian().factors().sms().setTemplates(
-## Guardian Factors Duo Settings -
client.guardian.factors.duo.settings.get() -> GetGuardianFactorDuoSettingsResponseContent +## Jobs UsersImports +
client.jobs.usersImports.create(request) -> CreateImportUsersResponseContent
@@ -18115,7 +21319,7 @@ client.guardian().factors().sms().setTemplates(
-Retrieves the DUO account and factor configuration. +Import users from a formatted file into a connection via a long-running job. When importing users, with or without upsert, the `email_verified` is set to `false` when the email address is added or updated. Users must verify their email address. To avoid this behavior, set `email_verified` to `true` in the imported data.
@@ -18130,7 +21334,12 @@ Retrieves the DUO account and factor configuration.
```java -client.guardian().factors().duo().settings().get(); +client.jobs().usersImports().create( + CreateImportUsersRequestContent + .builder() + .connectionId("connection_id") + .build() +); ```
@@ -18142,7 +21351,8 @@ client.guardian().factors().duo().settings().get();
-
client.guardian.factors.duo.settings.set(request) -> SetGuardianFactorDuoSettingsResponseContent +## Jobs VerificationEmail +
client.jobs.verificationEmail.create(request) -> CreateVerificationEmailResponseContent
@@ -18154,7 +21364,9 @@ client.guardian().factors().duo().settings().get();
-Set the DUO account configuration and other properties specific to this factor. +Send an email to the specified user that asks them to click a link to verify their email address. + +Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent.
@@ -18169,9 +21381,10 @@ Set the DUO account configuration and other properties specific to this factor.
```java -client.guardian().factors().duo().settings().set( - SetGuardianFactorDuoSettingsRequestContent +client.jobs().verificationEmail().create( + CreateVerificationEmailRequestContent .builder() + .userId("user_id") .build() ); ``` @@ -18188,7 +21401,7 @@ client.guardian().factors().duo().settings().set(
-**ikey:** `Optional` +**userId:** `String` — user_id of the user to send the verification email to.
@@ -18196,7 +21409,7 @@ client.guardian().factors().duo().settings().set(
-**skey:** `Optional` +**clientId:** `Optional` — client_id of the client (application). If no value provided, the global Client ID will be used.
@@ -18204,7 +21417,15 @@ client.guardian().factors().duo().settings().set(
-**host:** `Optional` +**identity:** `Optional` + +
+
+ +
+
+ +**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.
@@ -18216,11 +21437,12 @@ client.guardian().factors().duo().settings().set(
-
client.guardian.factors.duo.settings.update(request) -> UpdateGuardianFactorDuoSettingsResponseContent +## Jobs Errors +
client.jobs.errors.get(id) -> ErrorsGetResponse
-#### 🔌 Usage +#### 📝 Description
@@ -18228,19 +21450,13 @@ client.guardian().factors().duo().settings().set(
-```java -client.guardian().factors().duo().settings().update( - UpdateGuardianFactorDuoSettingsRequestContent - .builder() - .build() -); -``` +Retrieve error details of a failed job.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -18248,23 +21464,23 @@ client.guardian().factors().duo().settings().update(
-**ikey:** `Optional` - +```java +client.jobs().errors().get("id"); +``` +
+
+#### ⚙️ Parameters +
-**skey:** `Optional` - -
-
-
-**host:** `Optional` +**id:** `String` — ID of the job.
@@ -18276,8 +21492,8 @@ client.guardian().factors().duo().settings().update(
-## Hooks Secrets -
client.hooks.secrets.get(id) -> Map<String, Object> +## Keys CustomSigning +
client.keys.customSigning.get() -> GetCustomSigningKeysResponseContent
@@ -18289,7 +21505,7 @@ client.guardian().factors().duo().settings().update(
-Retrieve a hook's secrets by the ID of the hook. +Get entire jwks representation of custom signing keys.
@@ -18304,34 +21520,19 @@ Retrieve a hook's secrets by the ID of the hook.
```java -client.hooks().secrets().get("id"); +client.keys().customSigning().get(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — ID of the hook to retrieve secrets from. - -
-
-
-
-
-
client.hooks.secrets.create(id, request) +
client.keys.customSigning.set(request) -> SetCustomSigningKeysResponseContent
@@ -18343,7 +21544,7 @@ client.hooks().secrets().get("id");
-Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. +Create or replace entire jwks representation of custom signing keys.
@@ -18358,11 +21559,18 @@ Add one or more secrets to an existing hook. Accepts an object of key-value pair
```java -client.hooks().secrets().create( - "id", - new HashMap() {{ - put("key", "value"); - }} +client.keys().customSigning().set( + SetCustomSigningKeysRequestContent + .builder() + .keys( + Arrays.asList( + CustomSigningKeyJwk + .builder() + .kty(CustomSigningKeyTypeEnum.EC) + .build() + ) + ) + .build() ); ```
@@ -18378,15 +21586,7 @@ client.hooks().secrets().create(
-**id:** `String` — The id of the hook to retrieve - -
-
- -
-
- -**request:** `Map` +**keys:** `List` — An array of custom public signing keys.
@@ -18398,7 +21598,7 @@ client.hooks().secrets().create(
-
client.hooks.secrets.delete(id, request) +
client.keys.customSigning.delete()
@@ -18410,7 +21610,7 @@ client.hooks().secrets().create(
-Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. +Delete entire jwks representation of custom signing keys.
@@ -18425,45 +21625,20 @@ Delete one or more existing secrets for a given hook. Accepts an array of secret
```java -client.hooks().secrets().delete( - "id", - Arrays.asList("string") -); +client.keys().customSigning().delete(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — ID of the hook whose secrets to delete. - -
-
- -
-
- -**request:** `List` - -
-
-
-
-
-
client.hooks.secrets.update(id, request) +## Keys Encryption +
client.keys.encryption.list() -> SyncPagingIterable<EncryptionKey>
@@ -18475,7 +21650,7 @@ client.hooks().secrets().delete(
-Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. +Retrieve details of all the encryption keys associated with your tenant.
@@ -18490,11 +21665,19 @@ Update one or more existing secrets for an existing hook. Accepts an object of k
```java -client.hooks().secrets().update( - "id", - new HashMap() {{ - put("key", "value"); - }} +client.keys().encryption().list( + ListEncryptionKeysRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() ); ```
@@ -18510,7 +21693,7 @@ client.hooks().secrets().update(
-**id:** `String` — ID of the hook whose secrets to update. +**page:** `Optional` — Page index of the results to return. First page is 0.
@@ -18518,7 +21701,15 @@ client.hooks().secrets().update(
-**request:** `Map` +**perPage:** `Optional` — Number of results per page. Default value is 50, maximum value is 100. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -18530,8 +21721,7 @@ client.hooks().secrets().update(
-## Jobs UsersExports -
client.jobs.usersExports.create(request) -> CreateExportUsersResponseContent +
client.keys.encryption.create(request) -> CreateEncryptionKeyResponseContent
@@ -18543,33 +21733,13 @@ client.hooks().secrets().update(
-Export all users to a file via a long-running job. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.jobs().usersExports().create( - CreateExportUsersRequestContent - .builder() - .build() -); -``` +Create the new, pre-activated encryption key, without the key material.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -18577,31 +21747,28 @@ client.jobs().usersExports().create(
-**connectionId:** `Optional` — connection_id of the connection from which users will be exported. - +```java +client.keys().encryption().create( + CreateEncryptionKeyRequestContent + .builder() + .type(CreateEncryptionKeyType.CUSTOMER_PROVIDED_ROOT_KEY) + .build() +); +```
- -
-
- -**format:** `Optional` -
+#### ⚙️ Parameters +
-**limit:** `Optional` — Limit the number of records. - -
-
-
-**fields:** `Optional>` — List of fields to be included in the CSV. Defaults to a predefined set of fields. +**type:** `CreateEncryptionKeyType`
@@ -18613,8 +21780,7 @@ client.jobs().usersExports().create(
-## Jobs UsersImports -
client.jobs.usersImports.create(request) -> CreateImportUsersResponseContent +
client.keys.encryption.rekey()
@@ -18626,7 +21792,7 @@ client.jobs().usersExports().create(
-Import users from a formatted file into a connection via a long-running job. When importing users, with or without upsert, the `email_verified` is set to `false` when the email address is added or updated. Users must verify their email address. To avoid this behavior, set `email_verified` to `true` in the imported data. +Perform rekeying operation on the key hierarchy.
@@ -18641,12 +21807,7 @@ Import users from a
@@ -18658,8 +21819,7 @@ client.jobs().usersImports().create(
-## Jobs VerificationEmail -
client.jobs.verificationEmail.create(request) -> CreateVerificationEmailResponseContent +
client.keys.encryption.get(kid) -> GetEncryptionKeyResponseContent
@@ -18671,9 +21831,7 @@ client.jobs().usersImports().create(
-Send an email to the specified user that asks them to click a link to verify their email address. - -Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. +Retrieve details of the encryption key with the given ID.
@@ -18688,12 +21846,7 @@ Note: You must have the `Status` toggle enabled for the verification email templ
```java -client.jobs().verificationEmail().create( - CreateVerificationEmailRequestContent - .builder() - .userId("user_id") - .build() -); +client.keys().encryption().get("kid"); ```
@@ -18708,31 +21861,7 @@ client.jobs().verificationEmail().create(
-**userId:** `String` — user_id of the user to send the verification email to. - -
-
- -
-
- -**clientId:** `Optional` — client_id of the client (application). If no value provided, the global Client ID will be used. - -
-
- -
-
- -**identity:** `Optional` - -
-
- -
-
- -**organizationId:** `Optional` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. +**kid:** `String` — Encryption key ID
@@ -18744,8 +21873,7 @@ client.jobs().verificationEmail().create(
-## Jobs Errors -
client.jobs.errors.get(id) -> ErrorsGetResponse +
client.keys.encryption.import_(kid, request) -> ImportEncryptionKeyResponseContent
@@ -18757,7 +21885,7 @@ client.jobs().verificationEmail().create(
-Retrieve error details of a failed job. +Import wrapped key material and activate encryption key.
@@ -18772,7 +21900,13 @@ Retrieve error details of a failed job.
```java -client.jobs().errors().get("id"); +client.keys().encryption().import_( + "kid", + ImportEncryptionKeyRequestContent + .builder() + .wrappedKey("wrapped_key") + .build() +); ```
@@ -18787,7 +21921,15 @@ client.jobs().errors().get("id");
-**id:** `String` — ID of the job. +**kid:** `String` — Encryption key ID + +
+
+ +
+
+ +**wrappedKey:** `String` — Base64 encoded ciphertext of key material wrapped by public wrapping key.
@@ -18799,8 +21941,7 @@ client.jobs().errors().get("id");
-## Keys CustomSigning -
client.keys.customSigning.get() -> GetCustomSigningKeysResponseContent +
client.keys.encryption.delete(kid)
@@ -18812,7 +21953,7 @@ client.jobs().errors().get("id");
-Get entire jwks representation of custom signing keys. +Delete the custom provided encryption key with the given ID and move back to using native encryption key.
@@ -18827,19 +21968,34 @@ Get entire jwks representation of custom signing keys.
```java -client.keys().customSigning().get(); +client.keys().encryption().delete("kid"); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Encryption key ID + +
+
+
+
+
-
client.keys.customSigning.set(request) -> SetCustomSigningKeysResponseContent +
client.keys.encryption.createPublicWrappingKey(kid) -> CreateEncryptionKeyPublicWrappingResponseContent
@@ -18851,7 +22007,7 @@ client.keys().customSigning().get();
-Create or replace entire jwks representation of custom signing keys. +Create the public wrapping key to wrap your own encryption key material.
@@ -18866,19 +22022,7 @@ Create or replace entire jwks representation of custom signing keys.
```java -client.keys().customSigning().set( - SetCustomSigningKeysRequestContent - .builder() - .keys( - Arrays.asList( - CustomSigningKeyJwk - .builder() - .kty(CustomSigningKeyTypeEnum.EC) - .build() - ) - ) - .build() -); +client.keys().encryption().createPublicWrappingKey("kid"); ```
@@ -18893,7 +22037,7 @@ client.keys().customSigning().set(
-**keys:** `List` — An array of custom public signing keys. +**kid:** `String` — Encryption key ID
@@ -18905,7 +22049,8 @@ client.keys().customSigning().set(
-
client.keys.customSigning.delete() +## Keys Signing +
client.keys.signing.list() -> List<SigningKeys>
@@ -18917,7 +22062,7 @@ client.keys().customSigning().set(
-Delete entire jwks representation of custom signing keys. +Retrieve details of all the application signing keys associated with your tenant.
@@ -18932,7 +22077,7 @@ Delete entire jwks representation of custom signing keys.
```java -client.keys().customSigning().delete(); +client.keys().signing().list(); ```
@@ -18944,8 +22089,7 @@ client.keys().customSigning().delete();
-## Keys Encryption -
client.keys.encryption.list() -> SyncPagingIterable<EncryptionKey> +
client.keys.signing.rotate() -> RotateSigningKeysResponseContent
@@ -18957,7 +22101,7 @@ client.keys().customSigning().delete();
-Retrieve details of all the encryption keys associated with your tenant. +Rotate the application signing key of your tenant.
@@ -18972,57 +22116,19 @@ Retrieve details of all the encryption keys associated with your tenant.
```java -client.keys().encryption().list( - ListEncryptionKeysRequestParameters - .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .build() -); +client.keys().signing().rotate(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**page:** `Optional` — Page index of the results to return. First page is 0. - -
-
- -
-
- -**perPage:** `Optional` — Number of results per page. Default value is 50, maximum value is 100. - -
-
- -
-
- -**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). - -
-
-
-
-
-
client.keys.encryption.create(request) -> CreateEncryptionKeyResponseContent +
client.keys.signing.get(kid) -> GetSigningKeysResponseContent
@@ -19034,7 +22140,7 @@ client.keys().encryption().list(
-Create the new, pre-activated encryption key, without the key material. +Retrieve details of the application signing key with the given ID.
@@ -19049,12 +22155,7 @@ Create the new, pre-activated encryption key, without the key material.
```java -client.keys().encryption().create( - CreateEncryptionKeyRequestContent - .builder() - .type(CreateEncryptionKeyType.CUSTOMER_PROVIDED_ROOT_KEY) - .build() -); +client.keys().signing().get("kid"); ```
@@ -19069,7 +22170,7 @@ client.keys().encryption().create(
-**type:** `CreateEncryptionKeyType` +**kid:** `String` — Key id of the key to retrieve
@@ -19081,7 +22182,7 @@ client.keys().encryption().create(
-
client.keys.encryption.rekey() +
client.keys.signing.revoke(kid) -> RevokedSigningKeysResponseContent
@@ -19093,7 +22194,7 @@ client.keys().encryption().create(
-Perform rekeying operation on the key hierarchy. +Revoke the application signing key with the given ID.
@@ -19108,23 +22209,39 @@ Perform rekeying operation on the key hierarchy.
```java -client.keys().encryption().rekey(); +client.keys().signing().revoke("kid"); ```
+#### ⚙️ Parameters + +
+
+ +
+
+ +**kid:** `String` — Key id of the key to revoke + +
+
+
+
+
-
client.keys.encryption.get(kid) -> GetEncryptionKeyResponseContent +## Organizations ClientGrants +
client.organizations.clientGrants.list(id) -> SyncPagingIterable<OrganizationClientGrant>
-#### 📝 Description +#### 🔌 Usage
@@ -19132,13 +22249,35 @@ client.keys().encryption().rekey();
-Retrieve details of the encryption key with the given ID. +```java +client.organizations().clientGrants().list( + "id", + ListOrganizationClientGrantsRequestParameters + .builder() + .audience( + OptionalNullable.of("audience") + ) + .clientId( + OptionalNullable.of("client_id") + ) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .build() +); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -19146,52 +22285,70 @@ Retrieve details of the encryption key with the given ID.
-```java -client.keys().encryption().get("kid"); -``` -
-
+**id:** `String` — Organization identifier. +
-#### ⚙️ Parameters -
+**audience:** `Optional` — Optional filter on audience of the client grant. + +
+
+
-**kid:** `String` — Encryption key ID +**clientId:** `Optional` — Optional filter on client_id of the client grant.
-
-
+
+
+**grantIds:** `Optional` — Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../client-grants?grant_ids=id1&grant_ids=id2 +
-
-
client.keys.encryption.import_(kid, request) -> ImportEncryptionKeyResponseContent
-#### 📝 Description +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
-Import wrapped key material and activate encryption key. +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +
+ + + +
+ +
client.organizations.clientGrants.create(id, request) -> AssociateOrganizationClientGrantResponseContent +
+
+ #### 🔌 Usage
@@ -19201,11 +22358,11 @@ Import wrapped key material and activate encryption key.
```java -client.keys().encryption().import_( - "kid", - ImportEncryptionKeyRequestContent +client.organizations().clientGrants().create( + "id", + AssociateOrganizationClientGrantRequestContent .builder() - .wrappedKey("wrapped_key") + .grantId("grant_id") .build() ); ``` @@ -19222,7 +22379,7 @@ client.keys().encryption().import_(
-**kid:** `String` — Encryption key ID +**id:** `String` — Organization identifier.
@@ -19230,7 +22387,7 @@ client.keys().encryption().import_(
-**wrappedKey:** `String` — Base64 encoded ciphertext of key material wrapped by public wrapping key. +**grantId:** `String` — A Client Grant ID to add to the organization.
@@ -19242,11 +22399,11 @@ client.keys().encryption().import_(
-
client.keys.encryption.delete(kid) +
client.organizations.clientGrants.delete(id, grantId)
-#### 📝 Description +#### 🔌 Usage
@@ -19254,13 +22411,15 @@ client.keys().encryption().import_(
-Delete the custom provided encryption key with the given ID and move back to using native encryption key. +```java +client.organizations().clientGrants().delete("id", "grant_id"); +```
-#### 🔌 Usage +#### ⚙️ Parameters
@@ -19268,23 +22427,15 @@ Delete the custom provided encryption key with the given ID and move back to usi
-```java -client.keys().encryption().delete("kid"); -``` -
-
+**id:** `String` — Organization identifier. +
-#### ⚙️ Parameters -
-
-
- -**kid:** `String` — Encryption key ID +**grantId:** `String` — The Client Grant ID to remove from the organization
@@ -19296,7 +22447,8 @@ client.keys().encryption().delete("kid");
-
client.keys.encryption.createPublicWrappingKey(kid) -> CreateEncryptionKeyPublicWrappingResponseContent +## Organizations DiscoveryDomains +
client.organizations.discoveryDomains.list(id) -> SyncPagingIterable<OrganizationDiscoveryDomain>
@@ -19308,7 +22460,7 @@ client.keys().encryption().delete("kid");
-Create the public wrapping key to wrap your own encryption key material. +Retrieve list of all organization discovery domains associated with the specified organization.
@@ -19323,7 +22475,18 @@ Create the public wrapping key to wrap your own encryption key material.
```java -client.keys().encryption().createPublicWrappingKey("kid"); +client.organizations().discoveryDomains().list( + "id", + ListOrganizationDiscoveryDomainsRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() +); ```
@@ -19338,7 +22501,23 @@ client.keys().encryption().createPublicWrappingKey("kid");
-**kid:** `String` — Encryption key ID +**id:** `String` — ID of the organization. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50.
@@ -19350,8 +22529,7 @@ client.keys().encryption().createPublicWrappingKey("kid");
-## Keys Signing -
client.keys.signing.list() -> List<SigningKeys> +
client.organizations.discoveryDomains.create(id, request) -> CreateOrganizationDiscoveryDomainResponseContent
@@ -19363,7 +22541,7 @@ client.keys().encryption().createPublicWrappingKey("kid");
-Retrieve details of all the application signing keys associated with your tenant. +Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The status field must be either pending or verified. The use_for_organization_discovery field can be true or false (default: true).
@@ -19378,47 +22556,53 @@ Retrieve details of all the application signing keys associated with your tenant
```java -client.keys().signing().list(); +client.organizations().discoveryDomains().create( + "id", + CreateOrganizationDiscoveryDomainRequestContent + .builder() + .domain("domain") + .build() +); ```
+#### ⚙️ Parameters - - -
- -
client.keys.signing.rotate() -> RotateSigningKeysResponseContent
-#### 📝 Description -
+**id:** `String` — ID of the organization. + +
+
+
-Rotate the application signing key of your tenant. -
-
+**domain:** `String` — The domain name to associate with the organization e.g. acme.com. +
-#### 🔌 Usage -
+**status:** `Optional` + +
+
+
-```java -client.keys().signing().rotate(); -``` +**useForOrganizationDiscovery:** `Optional` — Indicates whether this discovery domain should be used for organization discovery. +
@@ -19429,7 +22613,7 @@ client.keys().signing().rotate();
-
client.keys.signing.get(kid) -> GetSigningKeysResponseContent +
client.organizations.discoveryDomains.getByName(id, discoveryDomain) -> GetOrganizationDiscoveryDomainByNameResponseContent
@@ -19441,7 +22625,8 @@ client.keys().signing().rotate();
-Retrieve details of the application signing key with the given ID. +Retrieve details about a single organization discovery domain specified by domain name. +
@@ -19456,7 +22641,7 @@ Retrieve details of the application signing key with the given ID.
```java -client.keys().signing().get("kid"); +client.organizations().discoveryDomains().getByName("id", "discovery_domain"); ```
@@ -19471,7 +22656,15 @@ client.keys().signing().get("kid");
-**kid:** `String` — Key id of the key to retrieve +**id:** `String` — ID of the organization. + +
+
+ +
+
+ +**discoveryDomain:** `String` — Domain name of the discovery domain.
@@ -19483,7 +22676,7 @@ client.keys().signing().get("kid");
-
client.keys.signing.revoke(kid) -> RevokedSigningKeysResponseContent +
client.organizations.discoveryDomains.get(id, discoveryDomainId) -> GetOrganizationDiscoveryDomainResponseContent
@@ -19495,7 +22688,7 @@ client.keys().signing().get("kid");
-Revoke the application signing key with the given ID. +Retrieve details about a single organization discovery domain specified by ID.
@@ -19510,7 +22703,7 @@ Revoke the application signing key with the given ID.
```java -client.keys().signing().revoke("kid"); +client.organizations().discoveryDomains().get("id", "discovery_domain_id"); ```
@@ -19525,7 +22718,15 @@ client.keys().signing().revoke("kid");
-**kid:** `String` — Key id of the key to revoke +**id:** `String` — ID of the organization. + +
+
+ +
+
+ +**discoveryDomainId:** `String` — ID of the discovery domain.
@@ -19537,12 +22738,11 @@ client.keys().signing().revoke("kid");
-## Organizations ClientGrants -
client.organizations.clientGrants.list(id) -> SyncPagingIterable<OrganizationClientGrant> +
client.organizations.discoveryDomains.delete(id, discoveryDomainId)
-#### 🔌 Usage +#### 📝 Description
@@ -19550,25 +22750,13 @@ client.keys().signing().revoke("kid");
-```java -client.organizations().clientGrants().list( - "id", - ListOrganizationClientGrantsRequestParameters - .builder() - .audience("audience") - .clientId("client_id") - .page(1) - .perPage(1) - .includeTotals(true) - .build() -); -``` +Remove a discovery domain from an organization. This action cannot be undone.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -19576,23 +22764,23 @@ client.organizations().clientGrants().list(
-**id:** `String` — Organization identifier. - +```java +client.organizations().discoveryDomains().delete("id", "discovery_domain_id"); +``` +
+
+#### ⚙️ Parameters +
-**audience:** `Optional` — Optional filter on audience of the client grant. - -
-
-
-**clientId:** `Optional` — Optional filter on client_id of the client grant. +**id:** `String` — ID of the organization.
@@ -19600,45 +22788,35 @@ client.organizations().clientGrants().list(
-**grantIds:** `Optional` — Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../client-grants?grant_ids=id1&grant_ids=id2 +**discoveryDomainId:** `String` — ID of the discovery domain.
+
+
-
-
-**page:** `Optional` — Page index of the results to return. First page is 0. -
+
+
client.organizations.discoveryDomains.update(id, discoveryDomainId, request) -> UpdateOrganizationDiscoveryDomainResponseContent
-**perPage:** `Optional` — Number of results per page. Defaults to 50. - -
-
+#### 📝 Description
-**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). - -
-
+
+
+ +Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The status field must be either pending or verified. The use_for_organization_discovery field can be true or false (default: true).
- - -
- -
client.organizations.clientGrants.create(id, request) -> AssociateOrganizationClientGrantResponseContent -
-
#### 🔌 Usage @@ -19649,11 +22827,11 @@ client.organizations().clientGrants().list(
```java -client.organizations().clientGrants().create( +client.organizations().discoveryDomains().update( "id", - AssociateOrganizationClientGrantRequestContent + "discovery_domain_id", + UpdateOrganizationDiscoveryDomainRequestContent .builder() - .grantId("grant_id") .build() ); ``` @@ -19670,7 +22848,7 @@ client.organizations().clientGrants().create(
-**id:** `String` — Organization identifier. +**id:** `String` — ID of the organization.
@@ -19678,47 +22856,15 @@ client.organizations().clientGrants().create(
-**grantId:** `String` — A Client Grant ID to add to the organization. +**discoveryDomainId:** `String` — ID of the discovery domain to update.
-
-
- - - - -
- -
client.organizations.clientGrants.delete(id, grantId) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.organizations().clientGrants().delete("id", "grant_id"); -``` -
-
-
-
- -#### ⚙️ Parameters
-
-
- -**id:** `String` — Organization identifier. +**status:** `Optional`
@@ -19726,7 +22872,7 @@ client.organizations().clientGrants().delete("id", "grant_id");
-**grantId:** `String` — The Client Grant ID to remove from the organization +**useForOrganizationDiscovery:** `Optional` — Indicates whether this discovery domain should be used for organization discovery.
@@ -19770,9 +22916,15 @@ client.organizations().enabledConnections().list( "id", ListOrganizationConnectionsRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -20169,12 +23321,24 @@ client.organizations().invitations().list( "id", ListOrganizationInvitationsRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) - .fields("fields") - .includeFields(true) - .sort("sort") + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .sort( + OptionalNullable.of("sort") + ) .build() ); ``` @@ -20413,8 +23577,12 @@ client.organizations().invitations().get( "invitation_id", GetOrganizationInvitationRequestParameters .builder() - .fields("fields") - .includeFields(true) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -20568,10 +23736,18 @@ client.organizations().members().list( "id", ListOrganizationMembersRequestParameters .builder() - .from("from") - .take(1) - .fields("fields") - .includeFields(true) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -20795,9 +23971,15 @@ client.organizations().members().roles().list( "user_id", ListOrganizationMemberRolesRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -21051,14 +24233,30 @@ Get render setting configurations for all screens. client.prompts().rendering().list( ListAculsRequestParameters .builder() - .fields("fields") - .includeFields(true) - .page(1) - .perPage(1) - .includeTotals(true) - .prompt("prompt") - .screen("screen") - .renderingMode(AculRenderingModeEnum.ADVANCED) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .prompt( + OptionalNullable.of("prompt") + ) + .screen( + OptionalNullable.of("screen") + ) + .renderingMode( + OptionalNullable.of(AculRenderingModeEnum.ADVANCED) + ) .build() ); ``` @@ -21139,6 +24337,73 @@ client.prompts().rendering().list(
+
+
+
+ +
client.prompts.rendering.bulkUpdate(request) -> BulkUpdateAculResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Learn more about configuring render settings for advanced customization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().rendering().bulkUpdate( + BulkUpdateAculRequestContent + .builder() + .configs( + Arrays.asList( + AculConfigsItem + .builder() + .prompt(PromptGroupNameEnum.LOGIN) + .screen(ScreenGroupNameEnum.LOGIN) + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**configs:** `List` + +
+
+
+
+ +
@@ -21218,33 +24483,6 @@ client.prompts().rendering().get(PromptGroupNameEnum.LOGIN, ScreenGroupNameEnum.
Learn more about configuring render settings for advanced customization. - -

- Example head_tags array. See our documentation on using Liquid variables within head tags. -

-
{
-  "head_tags": [
-    {
-      "tag": "script",
-      "attributes": {
-        "defer": true,
-        "src": "URL_TO_ASSET",
-        "async": true,
-        "integrity": [
-          "ASSET_SHA"
-        ]
-      }
-    },
-    {
-      "tag": "link",
-      "attributes": {
-        "href": "URL_TO_ASSET",
-        "rel": "stylesheet"
-      }
-    }
-  ]
-}
-
@@ -21304,7 +24542,7 @@ client.prompts().rendering().update(
-**contextConfiguration:** `Optional>` — Context values to make available +**contextConfiguration:** `Optional>`
@@ -21320,7 +24558,7 @@ client.prompts().rendering().update(
-**headTags:** `Optional>` — An array of head tags +**usePageTemplate:** `Optional` — Use page template with ACUL
@@ -21328,7 +24566,7 @@ client.prompts().rendering().update(
-**filters:** `Optional` +**headTags:** `Optional>` — An array of head tags
@@ -21336,7 +24574,7 @@ client.prompts().rendering().update(
-**usePageTemplate:** `Optional` — Use page template with ACUL +**filters:** `Optional`
@@ -21487,8 +24725,169 @@ client.prompts().customText().set(
-## Prompts Partials -
client.prompts.partials.get(prompt) -> Map<String, Object> +## Prompts Partials +
client.prompts.partials.get(prompt) -> Map<String, Object> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get template partials for a prompt +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().partials().get(PartialGroupsEnum.LOGIN); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PartialGroupsEnum` — Name of the prompt. + +
+
+
+
+ + +
+
+
+ +
client.prompts.partials.set(prompt, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Set template partials for a prompt +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.prompts().partials().set( + PartialGroupsEnum.LOGIN, + new HashMap() {{ + put("key", "value"); + }} +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**prompt:** `PartialGroupsEnum` — Name of the prompt. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ + +
+
+
+ +## RiskAssessments Settings +
client.riskAssessments.settings.get() -> GetRiskAssessmentsSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the tenant settings for risk assessments +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.riskAssessments().settings().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.riskAssessments.settings.update(request) -> UpdateRiskAssessmentsSettingsResponseContent
@@ -21500,7 +24899,7 @@ client.prompts().customText().set(
-Get template partials for a prompt +Updates the tenant settings for risk assessments
@@ -21515,7 +24914,12 @@ Get template partials for a prompt
```java -client.prompts().partials().get(PartialGroupsEnum.LOGIN); +client.riskAssessments().settings().update( + UpdateRiskAssessmentsSettingsRequestContent + .builder() + .enabled(true) + .build() +); ```
@@ -21530,7 +24934,7 @@ client.prompts().partials().get(PartialGroupsEnum.LOGIN);
-**prompt:** `PartialGroupsEnum` — Name of the prompt. +**enabled:** `Boolean` — Whether or not risk assessment is enabled.
@@ -21542,7 +24946,8 @@ client.prompts().partials().get(PartialGroupsEnum.LOGIN);
-
client.prompts.partials.set(prompt, request) +## RiskAssessments Settings NewDevice +
client.riskAssessments.settings.newDevice.get() -> GetRiskAssessmentsSettingsNewDeviceResponseContent
@@ -21554,7 +24959,7 @@ client.prompts().partials().get(PartialGroupsEnum.LOGIN);
-Set template partials for a prompt +Gets the risk assessment settings for the new device assessor
@@ -21569,19 +24974,23 @@ Set template partials for a prompt
```java -client.prompts().partials().set( - PartialGroupsEnum.LOGIN, - new HashMap() {{ - put("key", "value"); - }} -); +client.riskAssessments().settings().newDevice().get(); ```
-#### ⚙️ Parameters + + + +
+ +
client.riskAssessments.settings.newDevice.update(request) -> UpdateRiskAssessmentsSettingsNewDeviceResponseContent +
+
+ +#### 📝 Description
@@ -21589,15 +24998,42 @@ client.prompts().partials().set(
-**prompt:** `PartialGroupsEnum` — Name of the prompt. - +Updates the risk assessment settings for the new device assessor +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.riskAssessments().settings().newDevice().update( + UpdateRiskAssessmentsSettingsNewDeviceRequestContent + .builder() + .rememberFor(1) + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**request:** `Map` +
+
+ +**rememberFor:** `Integer` — Length of time to remember devices for, in days.
@@ -21641,9 +25077,15 @@ client.roles().permissions().list( "id", ListRolePermissionsRequestParameters .builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage( + OptionalNullable.of(1) + ) + .page( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -21898,8 +25340,12 @@ client.roles().users().list( "id", ListRoleUsersRequestParameters .builder() - .from("from") - .take(1) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -22017,7 +25463,7 @@ client.roles().users().assign(
## SelfServiceProfiles CustomText -
client.selfServiceProfiles.customText.list(id, language, page) -> Map<String, Object> +
client.selfServiceProfiles.customText.list(id, language, page) -> Map<String, String>
@@ -22087,7 +25533,7 @@ client.selfServiceProfiles().customText().list("id", "en", "get-started");
-
client.selfServiceProfiles.customText.set(id, language, page, request) -> Map<String, Object> +
client.selfServiceProfiles.customText.set(id, language, page, request) -> Map<String, String>
@@ -22118,7 +25564,7 @@ client.selfServiceProfiles().customText().set( "id", "en", "get-started", - new HashMap() {{ + new HashMap() {{ put("key", "value"); }} ); @@ -22160,7 +25606,7 @@ client.selfServiceProfiles().customText().set(
-**request:** `Map` +**request:** `Map`
@@ -22278,6 +25724,14 @@ client.selfServiceProfiles().ssoTicket().create( **provisioningConfig:** `Optional` +
+
+ +
+
+ +**useForOrganizationDiscovery:** `Optional` — Indicates whether a verified domain should be used for organization discovery during authentication. +
@@ -22382,8 +25836,12 @@ Retrieve tenant settings. A list of fields to include or exclude may also be spe client.tenants().settings().get( GetTenantSettingsRequestParameters .builder() - .fields("fields") - .includeFields(true) + .fields( + OptionalNullable.of("fields") + ) + .includeFields( + OptionalNullable.of(true) + ) .build() ); ``` @@ -22700,6 +26158,34 @@ client.tenants().settings().update( **authorizationResponseIssParameterSupported:** `Optional` — Supports iss parameter in authorization responses + + + +
+
+ +**skipNonVerifiableCallbackUriConfirmationPrompt:** `Optional` + +Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`). +If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. +See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. + +
+
+ +
+
+ +**resourceParameterProfile:** `Optional` + +
+
+ +
+
+ +**enableAiGuide:** `Optional` — Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant. +
@@ -22742,9 +26228,15 @@ client.users().authenticationMethods().list( "id", ListUserAuthenticationMethodsRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -22909,7 +26401,7 @@ client.users().authenticationMethods().create(
-**publicKey:** `Optional` — Applies to webauthn authentication methods only. The public key. +**publicKey:** `Optional` — Applies to webauthn authentication methods only. The public key, which is encoded as base64.
@@ -23300,6 +26792,88 @@ client.users().authenticators().deleteAll("id"); + + +
+ +## Users ConnectedAccounts +
client.users.connectedAccounts.list(id) -> SyncPagingIterable<ConnectedAccount> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all connected accounts associated with the user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().connectedAccounts().list( + "id", + GetUserConnectedAccountsRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to list connected accounts for. + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results to return. Defaults to 10 with a maximum of 20 + +
+
+
+
+ +
@@ -23561,7 +27135,7 @@ client.users().identities().link(
-**userId:** `Optional` +**userId:** `Optional`
@@ -23691,10 +27265,18 @@ client.users().logs().list( "id", ListUserLogsRequestParameters .builder() - .page(1) - .perPage(1) - .sort("sort") - .includeTotals(true) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .sort( + OptionalNullable.of("sort") + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -23904,9 +27486,15 @@ client.users().organizations().list( "id", ListUserOrganizationsRequestParameters .builder() - .page(1) - .perPage(1) - .includeTotals(true) + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -23991,9 +27579,15 @@ client.users().permissions().list( "id", ListUserPermissionsRequestParameters .builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage( + OptionalNullable.of(1) + ) + .page( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -24194,6 +27788,86 @@ client.users().permissions().delete( + + +
+ +## Users RiskAssessments +
client.users.riskAssessments.clear(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Clear risk assessment assessors for a specific user +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.users().riskAssessments().clear( + "id", + ClearAssessorsRequestContent + .builder() + .connection("connection") + .assessors( + Arrays.asList("new-device") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — ID of the user to clear assessors for. + +
+
+ +
+
+ +**connection:** `String` — The name of the connection containing the user whose assessors should be cleared. + +
+
+ +
+
+ +**assessors:** `List` — List of assessors to clear. + +
+
+
+
+ +
@@ -24232,9 +27906,15 @@ client.users().roles().list( "id", ListUserRolesRequestParameters .builder() - .perPage(1) - .page(1) - .includeTotals(true) + .perPage( + OptionalNullable.of(1) + ) + .page( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) .build() ); ``` @@ -24463,8 +28143,12 @@ client.users().refreshToken().list( "user_id", ListRefreshTokensRequestParameters .builder() - .from("from") - .take(1) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -24595,8 +28279,12 @@ client.users().sessions().list( "user_id", ListUserSessionsRequestParameters .builder() - .from("from") - .take(1) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` @@ -24726,8 +28414,12 @@ List a verifiable credential templates. client.verifiableCredentials().verification().templates().list( ListVerifiableCredentialTemplatesRequestParameters .builder() - .from("from") - .take(1) + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) .build() ); ``` diff --git a/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java index 0c9eb6027..dfe356b8a 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncEventStreamsClient.java @@ -11,13 +11,12 @@ import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; -import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.ListEventStreamsResponseContent; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; -import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; @@ -44,15 +43,15 @@ public AsyncRawEventStreamsClient withRawResponse() { return this.rawClient; } - public CompletableFuture> list() { + public CompletableFuture list() { return this.rawClient.list().thenApply(response -> response.body()); } - public CompletableFuture> list(ListEventStreamsRequestParameters request) { + public CompletableFuture list(ListEventStreamsRequestParameters request) { return this.rawClient.list(request).thenApply(response -> response.body()); } - public CompletableFuture> list( + public CompletableFuture list( ListEventStreamsRequestParameters request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java index 1a28637a7..9d06bddcb 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java @@ -72,11 +72,6 @@ public CompletableFuture>> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("custom-domains"); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); - if (!request.getFrom().isAbsent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "from", request.getFrom().orElse(null), false); - } if (!request.getQ().isAbsent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java index a9474df46..4834f1867 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawEventStreamsClient.java @@ -20,16 +20,14 @@ import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; -import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.ListEventStreamsResponseContent; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import java.io.IOException; -import java.util.List; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -49,16 +47,16 @@ public AsyncRawEventStreamsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture> list() { return list(ListEventStreamsRequestParameters.builder().build()); } - public CompletableFuture>> list( + public CompletableFuture> list( ListEventStreamsRequestParameters request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture> list( ListEventStreamsRequestParameters request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -78,7 +76,7 @@ public CompletableFuture>> future = + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override @@ -88,7 +86,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { future.complete(new ManagementApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + responseBodyString, ListEventStreamsResponseContent.class), response)); return; } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java index 7692e210a..4e823b266 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRefreshTokensClient.java @@ -7,6 +7,7 @@ import com.auth0.client.mgmt.core.ManagementApiException; import com.auth0.client.mgmt.core.ManagementApiHttpResponse; import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.errors.BadRequestError; @@ -15,6 +16,8 @@ import com.auth0.client.mgmt.errors.TooManyRequestsError; import com.auth0.client.mgmt.errors.UnauthorizedError; import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenRequestContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -24,6 +27,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -196,4 +200,109 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { }); return future; } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateRefreshTokenRequestContent.builder().build()); + } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture> update( + String id, UpdateRefreshTokenRequestContent request) { + return update(id, request, null); + } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture> update( + String id, UpdateRefreshTokenRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRefreshTokenResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java index 89c3ee0e4..2ca93bc19 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRefreshTokensClient.java @@ -6,6 +6,8 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenRequestContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenResponseContent; import java.util.concurrent.CompletableFuture; public class AsyncRefreshTokensClient { @@ -52,4 +54,27 @@ public CompletableFuture delete(String id) { public CompletableFuture delete(String id, RequestOptions requestOptions) { return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture update( + String id, UpdateRefreshTokenRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Update a refresh token by its ID. + */ + public CompletableFuture update( + String id, UpdateRefreshTokenRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java index 826c1ca44..04d78524d 100644 --- a/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/EventStreamsClient.java @@ -11,13 +11,12 @@ import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; -import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.ListEventStreamsResponseContent; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; -import java.util.List; import java.util.function.Supplier; public class EventStreamsClient { @@ -43,15 +42,15 @@ public RawEventStreamsClient withRawResponse() { return this.rawClient; } - public List list() { + public ListEventStreamsResponseContent list() { return this.rawClient.list().body(); } - public List list(ListEventStreamsRequestParameters request) { + public ListEventStreamsResponseContent list(ListEventStreamsRequestParameters request) { return this.rawClient.list(request).body(); } - public List list( + public ListEventStreamsResponseContent list( ListEventStreamsRequestParameters request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } diff --git a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java index 5a6a00cfb..145bc8011 100644 --- a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java @@ -67,11 +67,6 @@ public ManagementApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("custom-domains"); - QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); - if (!request.getFrom().isAbsent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "from", request.getFrom().orElse(null), false); - } if (!request.getQ().isAbsent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false); } diff --git a/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java index e370decf4..7a885c42c 100644 --- a/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawEventStreamsClient.java @@ -20,16 +20,14 @@ import com.auth0.client.mgmt.types.CreateEventStreamResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; -import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamsCreateRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.ListEventStreamsResponseContent; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import java.io.IOException; -import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -45,15 +43,15 @@ public RawEventStreamsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public ManagementApiHttpResponse> list() { + public ManagementApiHttpResponse list() { return list(ListEventStreamsRequestParameters.builder().build()); } - public ManagementApiHttpResponse> list(ListEventStreamsRequestParameters request) { + public ManagementApiHttpResponse list(ListEventStreamsRequestParameters request) { return list(request, null); } - public ManagementApiHttpResponse> list( + public ManagementApiHttpResponse list( ListEventStreamsRequestParameters request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -78,8 +76,7 @@ public ManagementApiHttpResponse> list( String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new ManagementApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, new TypeReference>() {}), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListEventStreamsResponseContent.class), response); } try { diff --git a/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java index d9a850f2c..801e513b9 100644 --- a/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawRefreshTokensClient.java @@ -7,6 +7,7 @@ import com.auth0.client.mgmt.core.ManagementApiException; import com.auth0.client.mgmt.core.ManagementApiHttpResponse; import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.errors.BadRequestError; @@ -15,12 +16,15 @@ import com.auth0.client.mgmt.errors.TooManyRequestsError; import com.auth0.client.mgmt.errors.UnauthorizedError; import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenRequestContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -148,4 +152,85 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO throw new ManagementException("Network error executing HTTP request", e); } } + + /** + * Update a refresh token by its ID. + */ + public ManagementApiHttpResponse update(String id) { + return update(id, UpdateRefreshTokenRequestContent.builder().build()); + } + + /** + * Update a refresh token by its ID. + */ + public ManagementApiHttpResponse update( + String id, UpdateRefreshTokenRequestContent request) { + return update(id, request, null); + } + + /** + * Update a refresh token by its ID. + */ + public ManagementApiHttpResponse update( + String id, UpdateRefreshTokenRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("refresh-tokens") + .addPathSegment(id) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateRefreshTokenResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } } diff --git a/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java b/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java index 03c975c3d..e8a17ba7c 100644 --- a/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java +++ b/src/main/java/com/auth0/client/mgmt/RefreshTokensClient.java @@ -6,6 +6,8 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenRequestContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenResponseContent; public class RefreshTokensClient { protected final ClientOptions clientOptions; @@ -51,4 +53,26 @@ public void delete(String id) { public void delete(String id, RequestOptions requestOptions) { this.rawClient.delete(id, requestOptions).body(); } + + /** + * Update a refresh token by its ID. + */ + public UpdateRefreshTokenResponseContent update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Update a refresh token by its ID. + */ + public UpdateRefreshTokenResponseContent update(String id, UpdateRefreshTokenRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Update a refresh token by its ID. + */ + public UpdateRefreshTokenResponseContent update( + String id, UpdateRefreshTokenRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } } diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java index 840914c53..a01a1b304 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/ListActionTriggerBindingsRequestParameters.java @@ -56,7 +56,7 @@ public OptionalNullable getPerPage() { return perPage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionTriggerBindingsRequestParameters @@ -72,12 +72,12 @@ private boolean equalTo(ListActionTriggerBindingsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java index 999c480b2..c65556ba6 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/actions/triggers/types/UpdateActionBindingsRequestContent.java @@ -40,7 +40,7 @@ public Optional> getBindings() { return bindings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionBindingsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(UpdateActionBindingsRequestContent other) { return bindings.equals(other.bindings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bindings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java index f6a2c8aa8..637473e20 100644 --- a/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/actions/types/ListActionVersionsRequestParameters.java @@ -56,7 +56,7 @@ public OptionalNullable getPerPage() { return perPage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionVersionsRequestParameters @@ -72,12 +72,12 @@ private boolean equalTo(ListActionVersionsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java index dd651f63f..ec5231efd 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateAttackProtectionCaptchaRequestContent.java @@ -106,7 +106,7 @@ public Optional> getSimpleCaptcha() { return simpleCaptcha; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAttackProtectionCaptchaRequestContent @@ -129,7 +129,7 @@ private boolean equalTo(UpdateAttackProtectionCaptchaRequestContent other) { && simpleCaptcha.equals(other.simpleCaptcha); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.activeProviderId, @@ -142,7 +142,7 @@ public int hashCode() { this.simpleCaptcha); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java index cb595dff0..ae360f6ae 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBotDetectionSettingsRequestContent.java @@ -86,7 +86,7 @@ public Optional getMonitoringModeEnabled() { return monitoringModeEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBotDetectionSettingsRequestContent @@ -107,7 +107,7 @@ private boolean equalTo(UpdateBotDetectionSettingsRequestContent other) { && monitoringModeEnabled.equals(other.monitoringModeEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.botDetectionLevel, @@ -118,7 +118,7 @@ public int hashCode() { this.monitoringModeEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java index 3b9e2df71..ddd475caa 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBreachedPasswordDetectionSettingsRequestContent.java @@ -88,7 +88,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBreachedPasswordDetectionSettingsRequestContent @@ -108,12 +108,12 @@ private boolean equalTo(UpdateBreachedPasswordDetectionSettingsRequestContent ot && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java index 5b04bd941..4607f414e 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBruteForceSettingsRequestContent @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBruteForceSettingsRequestContent other) { && maxAttempts.equals(other.maxAttempts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java index 6a4a06ec1..556a5e295 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsRequestContentMode && this.string.equals(((UpdateBruteForceSettingsRequestContentMode) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java index 0a264ed97..4d77f09f9 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateBruteForceSettingsRequestContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsRequestContentShieldsItem && this.string.equals(((UpdateBruteForceSettingsRequestContentShieldsItem) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java index a4eb81344..de916780f 100644 --- a/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/attackprotection/types/UpdateSuspiciousIpThrottlingSettingsRequestContent.java @@ -73,7 +73,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSuspiciousIpThrottlingSettingsRequestContent @@ -92,12 +92,12 @@ private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsRequestContent other && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java index 32ee7c1c4..070e85106 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreateBrandingPhoneProviderRequestContent.java @@ -70,7 +70,7 @@ public PhoneProviderCredentials getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingPhoneProviderRequestContent @@ -89,12 +89,12 @@ private boolean equalTo(CreateBrandingPhoneProviderRequestContent other) { && credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.disabled, this.configuration, this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements NameStage, CredentialsStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(CreateBrandingPhoneProviderRequestContent other) { name(other.getName()); disabled(other.getDisabled()); @@ -152,27 +152,27 @@ public Builder from(CreateBrandingPhoneProviderRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public CredentialsStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull PhoneProviderCredentials credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -183,7 +183,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -192,14 +192,14 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @Override + @java.lang.Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public CreateBrandingPhoneProviderRequestContent build() { return new CreateBrandingPhoneProviderRequestContent( name, disabled, configuration, credentials, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java index e90c79a8e..ebbbd5cce 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneProviderSendTestRequestContent.java @@ -50,7 +50,7 @@ public Optional getDeliveryMethod() { return deliveryMethod; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneProviderSendTestRequestContent @@ -66,12 +66,12 @@ private boolean equalTo(CreatePhoneProviderSendTestRequestContent other) { return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.to, this.deliveryMethod); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements ToStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePhoneProviderSendTestRequestContent other) { to(other.getTo()); deliveryMethod(other.getDeliveryMethod()); @@ -120,27 +120,27 @@ public Builder from(CreatePhoneProviderSendTestRequestContent other) { *

The recipient phone number to receive a given notification.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("to") public _FinalStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { this.deliveryMethod = Optional.ofNullable(deliveryMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) public _FinalStage deliveryMethod(Optional deliveryMethod) { this.deliveryMethod = deliveryMethod; return this; } - @Override + @java.lang.Override public CreatePhoneProviderSendTestRequestContent build() { return new CreatePhoneProviderSendTestRequestContent(to, deliveryMethod, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java index fa8e60076..2d9f5467d 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateRequestContent.java @@ -59,7 +59,7 @@ public Optional getContent() { return content; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateRequestContent && equalTo((CreatePhoneTemplateRequestContent) other); @@ -74,12 +74,12 @@ private boolean equalTo(CreatePhoneTemplateRequestContent other) { return type.equals(other.type) && disabled.equals(other.disabled) && content.equals(other.content); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.disabled, this.content); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java index 4e4140e5a..7cb0e906b 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/CreatePhoneTemplateTestNotificationRequestContent.java @@ -50,7 +50,7 @@ public Optional getDeliveryMethod() { return deliveryMethod; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateTestNotificationRequestContent @@ -66,12 +66,12 @@ private boolean equalTo(CreatePhoneTemplateTestNotificationRequestContent other) return to.equals(other.to) && deliveryMethod.equals(other.deliveryMethod); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.to, this.deliveryMethod); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements ToStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePhoneTemplateTestNotificationRequestContent other) { to(other.getTo()); deliveryMethod(other.getDeliveryMethod()); @@ -120,27 +120,27 @@ public Builder from(CreatePhoneTemplateTestNotificationRequestContent other) { *

Destination of the testing phone notification

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("to") public _FinalStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage deliveryMethod(PhoneProviderDeliveryMethodEnum deliveryMethod) { this.deliveryMethod = Optional.ofNullable(deliveryMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "delivery_method", nulls = Nulls.SKIP) public _FinalStage deliveryMethod(Optional deliveryMethod) { this.deliveryMethod = deliveryMethod; return this; } - @Override + @java.lang.Override public CreatePhoneTemplateTestNotificationRequestContent build() { return new CreatePhoneTemplateTestNotificationRequestContent(to, deliveryMethod, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java index f02128464..4546bbb2e 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListBrandingPhoneProvidersRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListBrandingPhoneProvidersRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(ListBrandingPhoneProvidersRequestParameters other) { return disabled.equals(other.disabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java index 57f2e752a..a2186347a 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/ListPhoneTemplatesRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListPhoneTemplatesRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(ListPhoneTemplatesRequestParameters other) { return disabled.equals(other.disabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java index 0e3f5e282..bf8583d48 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdateBrandingPhoneProviderRequestContent.java @@ -69,7 +69,7 @@ public Optional getConfiguration() { return configuration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPhoneProviderRequestContent @@ -88,12 +88,12 @@ private boolean equalTo(UpdateBrandingPhoneProviderRequestContent other) { && configuration.equals(other.configuration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.disabled, this.credentials, this.configuration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java index 5631f8109..3e19fd8f5 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/phone/types/UpdatePhoneTemplateRequestContent.java @@ -49,7 +49,7 @@ public Optional getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdatePhoneTemplateRequestContent && equalTo((UpdatePhoneTemplateRequestContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(UpdatePhoneTemplateRequestContent other) { return content.equals(other.content) && disabled.equals(other.disabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.content, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java index 5c372dfd0..ccf342554 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/types/CreateBrandingThemeRequestContent.java @@ -90,7 +90,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingThemeRequestContent && equalTo((CreateBrandingThemeRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(CreateBrandingThemeRequestContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -177,7 +177,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateBrandingThemeRequestContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -188,35 +188,35 @@ public Builder from(CreateBrandingThemeRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public FontsStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); @@ -227,7 +227,7 @@ public _FinalStage widget(@NotNull BrandingThemeWidget widget) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -236,14 +236,14 @@ public _FinalStage displayName(String displayName) { /** *

Display Name

*/ - @Override + @java.lang.Override @JsonSetter(value = "displayName", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public CreateBrandingThemeRequestContent build() { return new CreateBrandingThemeRequestContent( borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java index cc5988336..385409f0b 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/branding/types/UpdateBrandingThemeRequestContent.java @@ -90,7 +90,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingThemeRequestContent && equalTo((UpdateBrandingThemeRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBrandingThemeRequestContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.borders, this.colors, this.displayName, this.fonts, this.pageBackground, this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -177,7 +177,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateBrandingThemeRequestContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -188,35 +188,35 @@ public Builder from(UpdateBrandingThemeRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public FontsStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public WidgetStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); @@ -227,7 +227,7 @@ public _FinalStage widget(@NotNull BrandingThemeWidget widget) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -236,14 +236,14 @@ public _FinalStage displayName(String displayName) { /** *

Display Name

*/ - @Override + @java.lang.Override @JsonSetter(value = "displayName", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public UpdateBrandingThemeRequestContent build() { return new UpdateBrandingThemeRequestContent( borders, colors, displayName, fonts, pageBackground, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java index f503203b1..265a509fe 100644 --- a/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/clientgrants/types/ListClientGrantOrganizationsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantOrganizationsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListClientGrantOrganizationsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java index 0181c8950..59a09f896 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/ConnectionsGetRequest.java @@ -134,7 +134,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionsGetRequest && equalTo((ConnectionsGetRequest) other); @@ -153,12 +153,12 @@ private boolean equalTo(ConnectionsGetRequest other) { && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.strategy, this.from, this.take, this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java index 747ebf26e..170fe0ac7 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PatchClientCredentialRequestContent.java @@ -52,7 +52,7 @@ private OptionalNullable _getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchClientCredentialRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(PatchClientCredentialRequestContent other) { return expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java index b425164b4..42aea8adf 100644 --- a/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/clients/types/PostClientCredentialRequestContent.java @@ -109,7 +109,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PostClientCredentialRequestContent @@ -131,7 +131,7 @@ private boolean equalTo(PostClientCredentialRequestContent other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.credentialType, @@ -143,7 +143,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -222,7 +222,7 @@ public static final class Builder implements CredentialTypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(PostClientCredentialRequestContent other) { credentialType(other.getCredentialType()); name(other.getName()); @@ -234,7 +234,7 @@ public Builder from(PostClientCredentialRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("credential_type") public _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialType) { this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); @@ -245,7 +245,7 @@ public _FinalStage credentialType(@NotNull ClientCredentialTypeEnum credentialTy *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage expiresAt(OffsetDateTime expiresAt) { this.expiresAt = Optional.ofNullable(expiresAt); return this; @@ -254,7 +254,7 @@ public _FinalStage expiresAt(OffsetDateTime expiresAt) { /** *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

*/ - @Override + @java.lang.Override @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public _FinalStage expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; @@ -265,7 +265,7 @@ public _FinalStage expiresAt(Optional expiresAt) { *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); return this; @@ -274,20 +274,20 @@ public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { /** *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

*/ - @Override + @java.lang.Override @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { this.parseExpiryFromCert = parseExpiryFromCert; return this; } - @Override + @java.lang.Override public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -298,7 +298,7 @@ public _FinalStage alg(Optional alg) { *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage pem(String pem) { this.pem = Optional.ofNullable(pem); return this; @@ -307,7 +307,7 @@ public _FinalStage pem(String pem) { /** *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

*/ - @Override + @java.lang.Override @JsonSetter(value = "pem", nulls = Nulls.SKIP) public _FinalStage pem(Optional pem) { this.pem = pem; @@ -318,7 +318,7 @@ public _FinalStage pem(Optional pem) { *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; @@ -327,7 +327,7 @@ public _FinalStage subjectDn(String subjectDn) { /** *

Subject Distinguished Name. Mutually exclusive with pem property. Applies to cert_subject_dn credential type.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; @@ -338,7 +338,7 @@ public _FinalStage subjectDn(Optional subjectDn) { *

Friendly name for a credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -347,14 +347,14 @@ public _FinalStage name(String name) { /** *

Friendly name for a credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public PostClientCredentialRequestContent build() { return new PostClientCredentialRequestContent( credentialType, name, subjectDn, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java index 5261693ea..dadd47f4f 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/connections/scimconfiguration/types/CreateScimTokenRequestContent.java @@ -65,7 +65,7 @@ private OptionalNullable _getTokenLifetime() { return tokenLifetime; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimTokenRequestContent && equalTo((CreateScimTokenRequestContent) other); @@ -80,12 +80,12 @@ private boolean equalTo(CreateScimTokenRequestContent other) { return scopes.equals(other.scopes) && tokenLifetime.equals(other.tokenLifetime); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.scopes, this.tokenLifetime); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java index 115dc5514..b211900f5 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/DeleteConnectionUsersByEmailQueryParameters.java @@ -36,7 +36,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteConnectionUsersByEmailQueryParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteConnectionUsersByEmailQueryParameters other) { return email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DeleteConnectionUsersByEmailQueryParameters other) { email(other.getEmail()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteConnectionUsersByEmailQueryParameters other) { *

The email of the user to delete

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public DeleteConnectionUsersByEmailQueryParameters build() { return new DeleteConnectionUsersByEmailQueryParameters(email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java index 3d9f1180d..5a8350257 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/GetConnectionEnabledClientsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionEnabledClientsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(GetConnectionEnabledClientsRequestParameters other) { return take.equals(other.take) && from.equals(other.from); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.take, this.from); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java index c83d2517c..cea97bfcb 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/connections/types/UpdateScimConfigurationRequestContent.java @@ -52,7 +52,7 @@ public List getMapping() { return mapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateScimConfigurationRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(UpdateScimConfigurationRequestContent other) { return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userIdAttribute, this.mapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements UserIdAttributeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateScimConfigurationRequestContent other) { userIdAttribute(other.getUserIdAttribute()); mapping(other.getMapping()); @@ -127,7 +127,7 @@ public Builder from(UpdateScimConfigurationRequestContent other) { *

User ID attribute for generating unique user ids

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id_attribute") public _FinalStage userIdAttribute(@NotNull String userIdAttribute) { this.userIdAttribute = Objects.requireNonNull(userIdAttribute, "userIdAttribute must not be null"); @@ -138,7 +138,7 @@ public _FinalStage userIdAttribute(@NotNull String userIdAttribute) { *

The mapping between auth0 and SCIM

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllMapping(List mapping) { if (mapping != null) { this.mapping.addAll(mapping); @@ -150,7 +150,7 @@ public _FinalStage addAllMapping(List mapping) { *

The mapping between auth0 and SCIM

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addMapping(ScimMappingItem mapping) { this.mapping.add(mapping); return this; @@ -159,7 +159,7 @@ public _FinalStage addMapping(ScimMappingItem mapping) { /** *

The mapping between auth0 and SCIM

*/ - @Override + @java.lang.Override @JsonSetter(value = "mapping", nulls = Nulls.SKIP) public _FinalStage mapping(List mapping) { this.mapping.clear(); @@ -169,7 +169,7 @@ public _FinalStage mapping(List mapping) { return this; } - @Override + @java.lang.Override public UpdateScimConfigurationRequestContent build() { return new UpdateScimConfigurationRequestContent(userIdAttribute, mapping, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java b/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java index f6c78663e..f1b9f7c87 100644 --- a/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java +++ b/src/main/java/com/auth0/client/mgmt/core/AsyncCustomPager.java @@ -62,12 +62,12 @@ public class AsyncCustomPager implements BiDirectionalPage { * Create an AsyncCustomPager from an initial response. * * @param initialResponse The first page response from the API - * @param client The async HTTP client to use for subsequent requests + * @param clientOptions The client options containing HTTP client and other configuration * @param requestOptions Request options for authentication, headers, etc. * @return A CompletableFuture containing the new AsyncCustomPager instance */ public static CompletableFuture> createAsync( - Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) { + Object initialResponse, ClientOptions clientOptions, Object requestOptions) { throw new UnsupportedOperationException("AsyncCustomPager must be implemented. " + "Please implement this class in core/AsyncCustomPager.java to define your async pagination logic. " + "This file has been added to .fernignore and will not be overwritten. " diff --git a/src/main/java/com/auth0/client/mgmt/core/CustomPager.java b/src/main/java/com/auth0/client/mgmt/core/CustomPager.java index ce2dc205c..56f1f3333 100644 --- a/src/main/java/com/auth0/client/mgmt/core/CustomPager.java +++ b/src/main/java/com/auth0/client/mgmt/core/CustomPager.java @@ -60,12 +60,12 @@ public class CustomPager implements BiDirectionalPage, Iterable { * Create a CustomPager from an initial response. * * @param initialResponse The first page response from the API - * @param client The HTTP client to use for subsequent requests + * @param clientOptions The client options containing HTTP client and other configuration * @param requestOptions Request options for authentication, headers, etc. * @return A new CustomPager instance * @throws IOException if the request fails */ - public static CustomPager create(Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) + public static CustomPager create(Object initialResponse, ClientOptions clientOptions, Object requestOptions) throws IOException { throw new UnsupportedOperationException("CustomPager must be implemented. " + "Please implement this class in core/CustomPager.java to define your pagination logic. " diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java index b84d24ace..556c5738a 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/CreateEmailProviderRequestContent.java @@ -94,7 +94,7 @@ private OptionalNullable> _getSettings() { return settings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailProviderRequestContent && equalTo((CreateEmailProviderRequestContent) other); @@ -113,12 +113,12 @@ private boolean equalTo(CreateEmailProviderRequestContent other) { && settings.equals(other.settings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -180,7 +180,7 @@ public static final class Builder implements NameStage, CredentialsStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEmailProviderRequestContent other) { name(other.getName()); enabled(other.getEnabled()); @@ -190,21 +190,21 @@ public Builder from(CreateEmailProviderRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public CredentialsStage name(@NotNull EmailProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull EmailProviderCredentialsSchema credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings) { if (settings.isNull()) { this.settings = OptionalNullable.ofNull(); @@ -216,7 +216,7 @@ public _FinalStage settings(com.auth0.client.mgmt.core.Nullable> settings) { if (settings.isPresent()) { this.settings = OptionalNullable.of(settings.get()); @@ -226,13 +226,13 @@ public _FinalStage settings(Optional> settings) { return this; } - @Override + @java.lang.Override public _FinalStage settings(Map settings) { this.settings = OptionalNullable.of(settings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "settings", nulls = Nulls.SKIP) public _FinalStage settings(@Nullable OptionalNullable> settings) { this.settings = settings; @@ -243,7 +243,7 @@ public _FinalStage settings(@Nullable OptionalNullable> sett *

Email address to use as "from" when no other address specified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage defaultFromAddress(String defaultFromAddress) { this.defaultFromAddress = Optional.ofNullable(defaultFromAddress); return this; @@ -252,7 +252,7 @@ public _FinalStage defaultFromAddress(String defaultFromAddress) { /** *

Email address to use as "from" when no other address specified.

*/ - @Override + @java.lang.Override @JsonSetter(value = "default_from_address", nulls = Nulls.SKIP) public _FinalStage defaultFromAddress(Optional defaultFromAddress) { this.defaultFromAddress = defaultFromAddress; @@ -263,7 +263,7 @@ public _FinalStage defaultFromAddress(Optional defaultFromAddress) { *

Whether the provider is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -272,14 +272,14 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the provider is enabled (true) or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public CreateEmailProviderRequestContent build() { return new CreateEmailProviderRequestContent( name, enabled, defaultFromAddress, credentials, settings, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java index 8117f7c2e..df18ed7be 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/GetEmailProviderRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailProviderRequestParameters && equalTo((GetEmailProviderRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetEmailProviderRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java index 427b16eb1..54dd8275c 100644 --- a/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/emails/types/UpdateEmailProviderRequestContent.java @@ -93,7 +93,7 @@ private OptionalNullable> _getSettings() { return settings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailProviderRequestContent && equalTo((UpdateEmailProviderRequestContent) other); @@ -112,12 +112,12 @@ private boolean equalTo(UpdateEmailProviderRequestContent other) { && settings.equals(other.settings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java index 93b4583d5..5998d5628 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/BadRequestError.java @@ -25,7 +25,7 @@ public BadRequestError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java index 0c92fc961..53940ac20 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ConflictError.java @@ -25,7 +25,7 @@ public ConflictError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java index b7d5b0519..0b56d4a30 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ContentTooLargeError.java @@ -25,7 +25,7 @@ public ContentTooLargeError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java index 880f958af..6648b7af1 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ForbiddenError.java @@ -25,7 +25,7 @@ public ForbiddenError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java index be37ce56d..bbe615ac0 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/InternalServerError.java @@ -25,7 +25,7 @@ public InternalServerError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java index 3154190f7..e3b072d83 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/NotFoundError.java @@ -25,7 +25,7 @@ public NotFoundError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java index 74cfc9f52..7cef21310 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/PaymentRequiredError.java @@ -25,7 +25,7 @@ public PaymentRequiredError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java index 24ef41c4c..30f466141 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/ServiceUnavailableError.java @@ -25,7 +25,7 @@ public ServiceUnavailableError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java index 4c5a49112..cae04a023 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/TooManyRequestsError.java @@ -25,7 +25,7 @@ public TooManyRequestsError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java index 0e5ebe618..a766ae2d4 100644 --- a/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java +++ b/src/main/java/com/auth0/client/mgmt/errors/UnauthorizedError.java @@ -25,7 +25,7 @@ public UnauthorizedError(Object body, Response rawResponse) { /** * @return the body */ - @Override + @java.lang.Override public Object body() { return this.body; } diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java index 6e8961905..a076ccb1c 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/CreateEventStreamRedeliveryRequestContent.java @@ -78,7 +78,7 @@ public Optional> getEventTypes() { return eventTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamRedeliveryRequestContent @@ -97,12 +97,12 @@ private boolean equalTo(CreateEventStreamRedeliveryRequestContent other) { && eventTypes.equals(other.eventTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java index ad03adb22..02389dd4a 100644 --- a/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/eventstreams/types/ListEventStreamDeliveriesRequestParameters.java @@ -153,7 +153,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEventStreamDeliveriesRequestParameters @@ -174,12 +174,12 @@ private boolean equalTo(ListEventStreamDeliveriesRequestParameters other) { && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.statuses, this.eventTypes, this.dateFrom, this.dateTo, this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java index 496b5618a..63b190892 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsGetRequest.java @@ -51,7 +51,7 @@ private Optional> _getHydrate() { return hydrate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExecutionsGetRequest && equalTo((ExecutionsGetRequest) other); @@ -66,12 +66,12 @@ private boolean equalTo(ExecutionsGetRequest other) { return hydrate.equals(other.hydrate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hydrate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java index 5e7a1ec59..ffe193ed8 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/flows/types/ExecutionsListRequest.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExecutionsListRequest && equalTo((ExecutionsListRequest) other); @@ -78,12 +78,12 @@ private boolean equalTo(ExecutionsListRequest other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java index 71a3effdf..59dcad827 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/types/ListFlowsVaultConnectionsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowsVaultConnectionsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListFlowsVaultConnectionsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java index 590d8dc49..df611d005 100644 --- a/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/flows/vault/types/UpdateFlowsVaultConnectionRequestContent.java @@ -49,7 +49,7 @@ public Optional getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowsVaultConnectionRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(UpdateFlowsVaultConnectionRequestContent other) { return name.equals(other.name) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java index 350559533..fa448b77b 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPushNotificationClient.java @@ -5,18 +5,22 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationApnsResponseContent; import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -54,14 +58,14 @@ public CompletableFuture getApnsP } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public CompletableFuture setApnsProvider() { return this.rawClient.setApnsProvider().thenApply(response -> response.body()); } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public CompletableFuture setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { @@ -69,7 +73,7 @@ public CompletableFuture setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { @@ -77,14 +81,37 @@ public CompletableFuture updateApnsProvider() { + return this.rawClient.updateApnsProvider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return this.rawClient.updateApnsProvider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateApnsProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture> setFcmProvider() { return this.rawClient.setFcmProvider().thenApply(response -> response.body()); } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { @@ -92,7 +119,7 @@ public CompletableFuture> setFcmProvider( } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { @@ -100,14 +127,37 @@ public CompletableFuture> setFcmProvider( } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> updateFcmProvider() { + return this.rawClient.updateFcmProvider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return this.rawClient.updateFcmProvider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateFcmProvider(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture> setFcmv1Provider() { return this.rawClient.setFcmv1Provider().thenApply(response -> response.body()); } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { @@ -115,13 +165,36 @@ public CompletableFuture> setFcmv1Provider( } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { return this.rawClient.setFcmv1Provider(request, requestOptions).thenApply(response -> response.body()); } + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> updateFcmv1Provider() { + return this.rawClient.updateFcmv1Provider().thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return this.rawClient.updateFcmv1Provider(request).thenApply(response -> response.body()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateFcmv1Provider(request, requestOptions).thenApply(response -> response.body()); + } + /** * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. */ diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java index 92b66930d..9c1ef2b1e 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPushNotificationClient.java @@ -13,18 +13,22 @@ import com.auth0.client.mgmt.errors.BadRequestError; import com.auth0.client.mgmt.errors.ForbiddenError; import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationApnsResponseContent; import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -129,7 +133,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public CompletableFuture> setApnsProvider() { @@ -138,7 +142,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public CompletableFuture> setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { @@ -146,7 +150,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public CompletableFuture> setApnsProvider( @@ -165,7 +169,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("PATCH", body) + .method("PUT", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") @@ -228,7 +232,109 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture< + ManagementApiHttpResponse> + updateApnsProvider() { + return updateApnsProvider(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture< + ManagementApiHttpResponse> + updateApnsProvider(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return updateApnsProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public CompletableFuture< + ManagementApiHttpResponse> + updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> + future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture>> setFcmProvider() { return setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent.builder() @@ -236,7 +342,7 @@ public CompletableFuture>> setFcmP } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture>> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { @@ -244,7 +350,7 @@ public CompletableFuture>> setFcmP } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public CompletableFuture>> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { @@ -259,6 +365,100 @@ public CompletableFuture>> setFcmP } catch (JsonProcessingException e) { throw new ManagementException("Failed to serialize request", e); } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> updateFcmProvider() { + return updateFcmProvider(UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return updateFcmProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public CompletableFuture>> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcm") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) .method("PATCH", body) @@ -322,7 +522,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture>> setFcmv1Provider() { return setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() @@ -330,7 +530,7 @@ public CompletableFuture>> setFcmv } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture>> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { @@ -338,7 +538,7 @@ public CompletableFuture>> setFcmv } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public CompletableFuture>> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { @@ -353,6 +553,100 @@ public CompletableFuture>> setFcmv } catch (JsonProcessingException e) { throw new ManagementException("Failed to serialize request", e); } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> updateFcmv1Provider() { + return updateFcmv1Provider(UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return updateFcmv1Provider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public CompletableFuture>> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcmv1") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) .method("PATCH", body) diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java index a790e49e0..8e3b97126 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/PushNotificationClient.java @@ -5,18 +5,22 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationApnsResponseContent; import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; import java.util.Map; @@ -52,14 +56,14 @@ public GetGuardianFactorsProviderApnsResponseContent getApnsProvider(RequestOpti } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider() { return this.rawClient.setApnsProvider().body(); } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { @@ -67,7 +71,7 @@ public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProv } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { @@ -75,21 +79,44 @@ public SetGuardianFactorsProviderPushNotificationApnsResponseContent setApnsProv } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public UpdateGuardianFactorsProviderPushNotificationApnsResponseContent updateApnsProvider() { + return this.rawClient.updateApnsProvider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public UpdateGuardianFactorsProviderPushNotificationApnsResponseContent updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return this.rawClient.updateApnsProvider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public UpdateGuardianFactorsProviderPushNotificationApnsResponseContent updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateApnsProvider(request, requestOptions).body(); + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public Map setFcmProvider() { return this.rawClient.setFcmProvider().body(); } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public Map setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { return this.rawClient.setFcmProvider(request).body(); } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public Map setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { @@ -97,27 +124,73 @@ public Map setFcmProvider( } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map updateFcmProvider() { + return this.rawClient.updateFcmProvider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return this.rawClient.updateFcmProvider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public Map updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateFcmProvider(request, requestOptions).body(); + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public Map setFcmv1Provider() { return this.rawClient.setFcmv1Provider().body(); } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public Map setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { return this.rawClient.setFcmv1Provider(request).body(); } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public Map setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { return this.rawClient.setFcmv1Provider(request, requestOptions).body(); } + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map updateFcmv1Provider() { + return this.rawClient.updateFcmv1Provider().body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return this.rawClient.updateFcmv1Provider(request).body(); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public Map updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + return this.rawClient.updateFcmv1Provider(request, requestOptions).body(); + } + /** * Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>. */ diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java index baab4c98b..a7eff43a9 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPushNotificationClient.java @@ -13,18 +13,22 @@ import com.auth0.client.mgmt.errors.BadRequestError; import com.auth0.client.mgmt.errors.ForbiddenError; import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationApnsResponseContent; import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -104,7 +108,7 @@ public ManagementApiHttpResponse } /** - * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication APNS provider associated with your tenant. */ public ManagementApiHttpResponse setApnsProvider() { return setApnsProvider(SetGuardianFactorsProviderPushNotificationApnsRequestContent.builder() @@ -112,7 +116,7 @@ public ManagementApiHttpResponse setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request) { @@ -120,7 +124,7 @@ public ManagementApiHttpResponse setApnsProvider( SetGuardianFactorsProviderPushNotificationApnsRequestContent request, RequestOptions requestOptions) { @@ -137,7 +141,7 @@ public ManagementApiHttpResponse + updateApnsProvider() { + return updateApnsProvider(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse + updateApnsProvider(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request) { + return updateApnsProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication APNS provider associated with your tenant. + */ + public ManagementApiHttpResponse + updateApnsProvider( + UpdateGuardianFactorsProviderPushNotificationApnsRequestContent request, + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/apns") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmProvider() { return setFcmProvider(SetGuardianFactorsProviderPushNotificationFcmRequestContent.builder() @@ -188,7 +271,7 @@ public ManagementApiHttpResponse> setFcmProvider() { } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request) { @@ -196,7 +279,7 @@ public ManagementApiHttpResponse> setFcmProvider( } /** - * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCM provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmProvider( SetGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { @@ -211,6 +294,81 @@ public ManagementApiHttpResponse> setFcmProvider( } catch (JsonProcessingException e) { throw new ManagementException("Failed to serialize request", e); } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmProvider() { + return updateFcmProvider(UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request) { + return updateFcmProvider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCM provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmProvider( + UpdateGuardianFactorsProviderPushNotificationFcmRequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcm") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) .method("PATCH", body) @@ -255,7 +413,7 @@ public ManagementApiHttpResponse> setFcmProvider( } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmv1Provider() { return setFcmv1Provider(SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() @@ -263,7 +421,7 @@ public ManagementApiHttpResponse> setFcmv1Provider() { } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { @@ -271,7 +429,7 @@ public ManagementApiHttpResponse> setFcmv1Provider( } /** - * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + * Overwrite all configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. */ public ManagementApiHttpResponse> setFcmv1Provider( SetGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { @@ -286,6 +444,81 @@ public ManagementApiHttpResponse> setFcmv1Provider( } catch (JsonProcessingException e) { throw new ManagementException("Failed to serialize request", e); } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmv1Provider() { + return updateFcmv1Provider(UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request) { + return updateFcmv1Provider(request, null); + } + + /** + * Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant. + */ + public ManagementApiHttpResponse> updateFcmv1Provider( + UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("guardian/factors/push-notification/providers/fcmv1") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) .method("PATCH", body) diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java index f2a8db1f7..b830c8788 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/SetGuardianFactorDuoSettingsRequestContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorDuoSettingsRequestContent @@ -70,12 +70,12 @@ private boolean equalTo(SetGuardianFactorDuoSettingsRequestContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java index 41d7e71f9..aac1ee029 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/duo/types/UpdateGuardianFactorDuoSettingsRequestContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorDuoSettingsRequestContent @@ -70,12 +70,12 @@ private boolean equalTo(UpdateGuardianFactorDuoSettingsRequestContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java index b0069117f..09209a2db 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneMessageTypesRequestContent.java @@ -40,7 +40,7 @@ public List getMessageTypes() { return messageTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneMessageTypesRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(SetGuardianFactorPhoneMessageTypesRequestContent other) return messageTypes.equals(other.messageTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.messageTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java index 9914eff36..8dd8996bf 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorPhoneTemplatesRequestContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneTemplatesRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorPhoneTemplatesRequestContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorPhoneTemplatesRequestContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorPhoneTemplatesRequestContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public SetGuardianFactorPhoneTemplatesRequestContent build() { return new SetGuardianFactorPhoneTemplatesRequestContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java index 20ebde63a..f11acb96f 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorSmsTemplatesRequestContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorSmsTemplatesRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorSmsTemplatesRequestContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorSmsTemplatesRequestContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorSmsTemplatesRequestContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public SetGuardianFactorSmsTemplatesRequestContent build() { return new SetGuardianFactorSmsTemplatesRequestContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java index 9ad21da78..db7494815 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneRequestContent.java @@ -35,7 +35,7 @@ public GuardianFactorsProviderSmsProviderEnum getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneRequestContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,20 +84,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorsProviderPhoneRequestContent other) { provider(other.getProvider()); return this; } - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @Override + @java.lang.Override public SetGuardianFactorsProviderPhoneRequestContent build() { return new SetGuardianFactorsProviderPhoneRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java index e5094691e..fd52ad20f 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPhoneTwilioRequestContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneTwilioRequestContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioRequestContent othe && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java similarity index 98% rename from src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java rename to src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java index 177fef339..bb64d5a9e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationApnsRequestContent.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.auth0.client.mgmt.types; +package com.auth0.client.mgmt.guardian.factors.types; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; @@ -77,7 +77,7 @@ private OptionalNullable _getP12() { return p12; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationApnsRequestContent @@ -93,12 +93,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsRequestCon return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId) && p12.equals(other.p12); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sandbox, this.bundleId, this.p12); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java similarity index 97% rename from src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java rename to src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java index a0ced329d..c1222a5c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmRequestContent.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.auth0.client.mgmt.types; +package com.auth0.client.mgmt.guardian.factors.types; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; @@ -48,7 +48,7 @@ private OptionalNullable _getServerKey() { return serverKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationFcmRequestContent @@ -64,12 +64,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmRequestCont return serverKey.equals(other.serverKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.serverKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java similarity index 97% rename from src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java rename to src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java index 6ffb83f69..00e72f513 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationFcmv1RequestContent.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.auth0.client.mgmt.types; +package com.auth0.client.mgmt.guardian.factors.types; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; @@ -48,7 +48,7 @@ private OptionalNullable _getServerCredentials() { return serverCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationFcmv1RequestContent @@ -64,12 +64,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationFcmv1RequestCo return serverCredentials.equals(other.serverCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.serverCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java index 1921eb0df..2c04c266d 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationRequestContent.java @@ -36,7 +36,7 @@ public GuardianFactorsProviderPushNotificationProviderDataEnum getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationRequestContent @@ -52,12 +52,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationRequestContent return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -85,20 +85,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorsProviderPushNotificationRequestContent other) { provider(other.getProvider()); return this; } - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderPushNotificationProviderDataEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @Override + @java.lang.Override public SetGuardianFactorsProviderPushNotificationRequestContent build() { return new SetGuardianFactorsProviderPushNotificationRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java index 935c79180..badfad30f 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationSnsRequestContent @@ -145,7 +145,7 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsRequestCont && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java index 348c1edb8..7d041b21f 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsRequestContent.java @@ -35,7 +35,7 @@ public GuardianFactorsProviderSmsProviderEnum getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsRequestContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,20 +84,20 @@ public static final class Builder implements ProviderStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorsProviderSmsRequestContent other) { provider(other.getProvider()); return this; } - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull GuardianFactorsProviderSmsProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @Override + @java.lang.Override public SetGuardianFactorsProviderSmsRequestContent build() { return new SetGuardianFactorsProviderSmsRequestContent(provider, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java index e87479d56..df428ac9b 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetGuardianFactorsProviderSmsTwilioRequestContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsTwilioRequestContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsTwilioRequestContent other) && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.java new file mode 100644 index 000000000..64ebbc400 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.java @@ -0,0 +1,208 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationApnsRequestContent { + private final Optional sandbox; + + private final OptionalNullable bundleId; + + private final OptionalNullable p12; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationApnsRequestContent( + Optional sandbox, + OptionalNullable bundleId, + OptionalNullable p12, + Map additionalProperties) { + this.sandbox = sandbox; + this.bundleId = bundleId; + this.p12 = p12; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("sandbox") + public Optional getSandbox() { + return sandbox; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + public OptionalNullable getBundleId() { + if (bundleId == null) { + return OptionalNullable.absent(); + } + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("p12") + public OptionalNullable getP12() { + if (p12 == null) { + return OptionalNullable.absent(); + } + return p12; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + private OptionalNullable _getBundleId() { + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("p12") + private OptionalNullable _getP12() { + return p12; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationApnsRequestContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationApnsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent other) { + return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId) && p12.equals(other.p12); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sandbox, this.bundleId, this.p12); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sandbox = Optional.empty(); + + private OptionalNullable bundleId = OptionalNullable.absent(); + + private OptionalNullable p12 = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent other) { + sandbox(other.getSandbox()); + bundleId(other.getBundleId()); + p12(other.getP12()); + return this; + } + + @JsonSetter(value = "sandbox", nulls = Nulls.SKIP) + public Builder sandbox(Optional sandbox) { + this.sandbox = sandbox; + return this; + } + + public Builder sandbox(Boolean sandbox) { + this.sandbox = Optional.ofNullable(sandbox); + return this; + } + + @JsonSetter(value = "bundle_id", nulls = Nulls.SKIP) + public Builder bundleId(@Nullable OptionalNullable bundleId) { + this.bundleId = bundleId; + return this; + } + + public Builder bundleId(String bundleId) { + this.bundleId = OptionalNullable.of(bundleId); + return this; + } + + public Builder bundleId(Optional bundleId) { + if (bundleId.isPresent()) { + this.bundleId = OptionalNullable.of(bundleId.get()); + } else { + this.bundleId = OptionalNullable.absent(); + } + return this; + } + + public Builder bundleId(com.auth0.client.mgmt.core.Nullable bundleId) { + if (bundleId.isNull()) { + this.bundleId = OptionalNullable.ofNull(); + } else if (bundleId.isEmpty()) { + this.bundleId = OptionalNullable.absent(); + } else { + this.bundleId = OptionalNullable.of(bundleId.get()); + } + return this; + } + + @JsonSetter(value = "p12", nulls = Nulls.SKIP) + public Builder p12(@Nullable OptionalNullable p12) { + this.p12 = p12; + return this; + } + + public Builder p12(String p12) { + this.p12 = OptionalNullable.of(p12); + return this; + } + + public Builder p12(Optional p12) { + if (p12.isPresent()) { + this.p12 = OptionalNullable.of(p12.get()); + } else { + this.p12 = OptionalNullable.absent(); + } + return this; + } + + public Builder p12(com.auth0.client.mgmt.core.Nullable p12) { + if (p12.isNull()) { + this.p12 = OptionalNullable.ofNull(); + } else if (p12.isEmpty()) { + this.p12 = OptionalNullable.absent(); + } else { + this.p12 = OptionalNullable.of(p12.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationApnsRequestContent build() { + return new UpdateGuardianFactorsProviderPushNotificationApnsRequestContent( + sandbox, bundleId, p12, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.java new file mode 100644 index 000000000..26c1b64e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationFcmRequestContent { + private final OptionalNullable serverKey; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationFcmRequestContent( + OptionalNullable serverKey, Map additionalProperties) { + this.serverKey = serverKey; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_key") + public OptionalNullable getServerKey() { + if (serverKey == null) { + return OptionalNullable.absent(); + } + return serverKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_key") + private OptionalNullable _getServerKey() { + return serverKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationFcmRequestContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationFcmRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationFcmRequestContent other) { + return serverKey.equals(other.serverKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.serverKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable serverKey = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationFcmRequestContent other) { + serverKey(other.getServerKey()); + return this; + } + + @JsonSetter(value = "server_key", nulls = Nulls.SKIP) + public Builder serverKey(@Nullable OptionalNullable serverKey) { + this.serverKey = serverKey; + return this; + } + + public Builder serverKey(String serverKey) { + this.serverKey = OptionalNullable.of(serverKey); + return this; + } + + public Builder serverKey(Optional serverKey) { + if (serverKey.isPresent()) { + this.serverKey = OptionalNullable.of(serverKey.get()); + } else { + this.serverKey = OptionalNullable.absent(); + } + return this; + } + + public Builder serverKey(com.auth0.client.mgmt.core.Nullable serverKey) { + if (serverKey.isNull()) { + this.serverKey = OptionalNullable.ofNull(); + } else if (serverKey.isEmpty()) { + this.serverKey = OptionalNullable.absent(); + } else { + this.serverKey = OptionalNullable.of(serverKey.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationFcmRequestContent build() { + return new UpdateGuardianFactorsProviderPushNotificationFcmRequestContent(serverKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.java new file mode 100644 index 000000000..7c62c7240 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.guardian.factors.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent { + private final OptionalNullable serverCredentials; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent( + OptionalNullable serverCredentials, Map additionalProperties) { + this.serverCredentials = serverCredentials; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_credentials") + public OptionalNullable getServerCredentials() { + if (serverCredentials == null) { + return OptionalNullable.absent(); + } + return serverCredentials; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("server_credentials") + private OptionalNullable _getServerCredentials() { + return serverCredentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent other) { + return serverCredentials.equals(other.serverCredentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.serverCredentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable serverCredentials = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent other) { + serverCredentials(other.getServerCredentials()); + return this; + } + + @JsonSetter(value = "server_credentials", nulls = Nulls.SKIP) + public Builder serverCredentials(@Nullable OptionalNullable serverCredentials) { + this.serverCredentials = serverCredentials; + return this; + } + + public Builder serverCredentials(String serverCredentials) { + this.serverCredentials = OptionalNullable.of(serverCredentials); + return this; + } + + public Builder serverCredentials(Optional serverCredentials) { + if (serverCredentials.isPresent()) { + this.serverCredentials = OptionalNullable.of(serverCredentials.get()); + } else { + this.serverCredentials = OptionalNullable.absent(); + } + return this; + } + + public Builder serverCredentials(com.auth0.client.mgmt.core.Nullable serverCredentials) { + if (serverCredentials.isNull()) { + this.serverCredentials = OptionalNullable.ofNull(); + } else if (serverCredentials.isEmpty()) { + this.serverCredentials = OptionalNullable.absent(); + } else { + this.serverCredentials = OptionalNullable.of(serverCredentials.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent build() { + return new UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent( + serverCredentials, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java index 82f9bbbe4..1b2f29eed 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/UpdateGuardianFactorsProviderPushNotificationSnsRequestContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsRequestContent @@ -145,7 +145,7 @@ private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsRequestC && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java index e4df2c0a7..680a9edde 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/CreateGuardianEnrollmentTicketRequestContent.java @@ -98,7 +98,7 @@ public Optional getAllowMultipleEnrollments() { return allowMultipleEnrollments; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateGuardianEnrollmentTicketRequestContent @@ -119,13 +119,13 @@ private boolean equalTo(CreateGuardianEnrollmentTicketRequestContent other) { && allowMultipleEnrollments.equals(other.allowMultipleEnrollments); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.userId, this.email, this.sendMail, this.emailLocale, this.factor, this.allowMultipleEnrollments); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateGuardianEnrollmentTicketRequestContent other) { userId(other.getUserId()); email(other.getEmail()); @@ -214,7 +214,7 @@ public Builder from(CreateGuardianEnrollmentTicketRequestContent other) { *

user_id for the enrollment ticket

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -225,7 +225,7 @@ public _FinalStage userId(@NotNull String userId) { *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments) { this.allowMultipleEnrollments = Optional.ofNullable(allowMultipleEnrollments); return this; @@ -234,20 +234,20 @@ public _FinalStage allowMultipleEnrollments(Boolean allowMultipleEnrollments) { /** *

Optional. Allows a user who has previously enrolled in MFA to enroll with additional factors.<br />Note: Parameter can only be used with Universal Login; it cannot be used with Classic Login or custom MFA pages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "allow_multiple_enrollments", nulls = Nulls.SKIP) public _FinalStage allowMultipleEnrollments(Optional allowMultipleEnrollments) { this.allowMultipleEnrollments = allowMultipleEnrollments; return this; } - @Override + @java.lang.Override public _FinalStage factor(GuardianEnrollmentFactorEnum factor) { this.factor = Optional.ofNullable(factor); return this; } - @Override + @java.lang.Override @JsonSetter(value = "factor", nulls = Nulls.SKIP) public _FinalStage factor(Optional factor) { this.factor = factor; @@ -258,7 +258,7 @@ public _FinalStage factor(Optional factor) { *

Optional. Specify the locale of the enrollment email. Used with send_email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage emailLocale(String emailLocale) { this.emailLocale = Optional.ofNullable(emailLocale); return this; @@ -267,7 +267,7 @@ public _FinalStage emailLocale(String emailLocale) { /** *

Optional. Specify the locale of the enrollment email. Used with send_email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email_locale", nulls = Nulls.SKIP) public _FinalStage emailLocale(Optional emailLocale) { this.emailLocale = emailLocale; @@ -278,7 +278,7 @@ public _FinalStage emailLocale(Optional emailLocale) { *

Send an email to the user to start the enrollment

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage sendMail(Boolean sendMail) { this.sendMail = Optional.ofNullable(sendMail); return this; @@ -287,7 +287,7 @@ public _FinalStage sendMail(Boolean sendMail) { /** *

Send an email to the user to start the enrollment

*/ - @Override + @java.lang.Override @JsonSetter(value = "send_mail", nulls = Nulls.SKIP) public _FinalStage sendMail(Optional sendMail) { this.sendMail = sendMail; @@ -298,7 +298,7 @@ public _FinalStage sendMail(Optional sendMail) { *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -307,14 +307,14 @@ public _FinalStage email(String email) { /** *

alternate email to which the enrollment email will be sent. Optional - by default, the email will be sent to the user's default address

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public CreateGuardianEnrollmentTicketRequestContent build() { return new CreateGuardianEnrollmentTicketRequestContent( userId, email, sendMail, emailLocale, factor, allowMultipleEnrollments, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java index c4b43415b..1f50447d3 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/types/SetGuardianFactorRequestContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorRequestContent && equalTo((SetGuardianFactorRequestContent) other); @@ -50,12 +50,12 @@ private boolean equalTo(SetGuardianFactorRequestContent other) { return enabled == other.enabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -86,7 +86,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorRequestContent other) { enabled(other.getEnabled()); return this; @@ -97,14 +97,14 @@ public Builder from(SetGuardianFactorRequestContent other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public SetGuardianFactorRequestContent build() { return new SetGuardianFactorRequestContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java index c9d8d8026..363375c59 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateExportUsersRequestContent.java @@ -75,7 +75,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersRequestContent && equalTo((CreateExportUsersRequestContent) other); @@ -93,12 +93,12 @@ private boolean equalTo(CreateExportUsersRequestContent other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.format, this.limit, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java index d1dc1b427..ef399ab4b 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateImportUsersRequestContent.java @@ -76,7 +76,7 @@ public Optional getSendCompletionEmail() { return sendCompletionEmail; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateImportUsersRequestContent && equalTo((CreateImportUsersRequestContent) other); @@ -94,12 +94,12 @@ private boolean equalTo(CreateImportUsersRequestContent other) { && sendCompletionEmail.equals(other.sendCompletionEmail); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.upsert, this.externalId, this.sendCompletionEmail); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateImportUsersRequestContent other) { connectionId(other.getConnectionId()); upsert(other.getUpsert()); @@ -171,7 +171,7 @@ public Builder from(CreateImportUsersRequestContent other) { *

connection_id of the connection to which users will be imported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -182,7 +182,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage sendCompletionEmail(Boolean sendCompletionEmail) { this.sendCompletionEmail = Optional.ofNullable(sendCompletionEmail); return this; @@ -191,7 +191,7 @@ public _FinalStage sendCompletionEmail(Boolean sendCompletionEmail) { /** *

Whether to send a completion email to all tenant owners when the job is finished (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "send_completion_email", nulls = Nulls.SKIP) public _FinalStage sendCompletionEmail(Optional sendCompletionEmail) { this.sendCompletionEmail = sendCompletionEmail; @@ -202,7 +202,7 @@ public _FinalStage sendCompletionEmail(Optional sendCompletionEmail) { *

Customer-defined ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage externalId(String externalId) { this.externalId = Optional.ofNullable(externalId); return this; @@ -211,7 +211,7 @@ public _FinalStage externalId(String externalId) { /** *

Customer-defined ID.

*/ - @Override + @java.lang.Override @JsonSetter(value = "external_id", nulls = Nulls.SKIP) public _FinalStage externalId(Optional externalId) { this.externalId = externalId; @@ -222,7 +222,7 @@ public _FinalStage externalId(Optional externalId) { *

Whether to update users if they already exist (true) or to ignore them (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage upsert(Boolean upsert) { this.upsert = Optional.ofNullable(upsert); return this; @@ -231,14 +231,14 @@ public _FinalStage upsert(Boolean upsert) { /** *

Whether to update users if they already exist (true) or to ignore them (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "upsert", nulls = Nulls.SKIP) public _FinalStage upsert(Optional upsert) { this.upsert = upsert; return this; } - @Override + @java.lang.Override public CreateImportUsersRequestContent build() { return new CreateImportUsersRequestContent( connectionId, upsert, externalId, sendCompletionEmail, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java index b89827758..2aefa6c31 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/CreateVerificationEmailRequestContent.java @@ -74,7 +74,7 @@ public Optional getOrganizationId() { return organizationId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerificationEmailRequestContent @@ -93,12 +93,12 @@ private boolean equalTo(CreateVerificationEmailRequestContent other) { && organizationId.equals(other.organizationId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId, this.clientId, this.identity, this.organizationId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,7 +153,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateVerificationEmailRequestContent other) { userId(other.getUserId()); clientId(other.getClientId()); @@ -167,7 +167,7 @@ public Builder from(CreateVerificationEmailRequestContent other) { *

user_id of the user to send the verification email to.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -178,7 +178,7 @@ public _FinalStage userId(@NotNull String userId) { *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage organizationId(String organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; @@ -187,20 +187,20 @@ public _FinalStage organizationId(String organizationId) { /** *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

*/ - @Override + @java.lang.Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @Override + @java.lang.Override public _FinalStage identity(Identity identity) { this.identity = Optional.ofNullable(identity); return this; } - @Override + @java.lang.Override @JsonSetter(value = "identity", nulls = Nulls.SKIP) public _FinalStage identity(Optional identity) { this.identity = identity; @@ -211,7 +211,7 @@ public _FinalStage identity(Optional identity) { *

client_id of the client (application). If no value provided, the global Client ID will be used.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -220,14 +220,14 @@ public _FinalStage clientId(String clientId) { /** *

client_id of the client (application). If no value provided, the global Client ID will be used.

*/ - @Override + @java.lang.Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; return this; } - @Override + @java.lang.Override public CreateVerificationEmailRequestContent build() { return new CreateVerificationEmailRequestContent( userId, clientId, identity, organizationId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java index 747c5efc3..234a856c7 100644 --- a/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java +++ b/src/main/java/com/auth0/client/mgmt/jobs/types/ErrorsGetResponse.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ErrorsGetResponse && equalTo((ErrorsGetResponse) other); @@ -53,12 +53,12 @@ private boolean equalTo(ErrorsGetResponse other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -82,7 +82,7 @@ static final class Deserializer extends StdDeserializer { super(ErrorsGetResponse.class); } - @Override + @java.lang.Override public ErrorsGetResponse deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java index afa78b51e..980fad36a 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/CreateEncryptionKeyRequestContent.java @@ -34,7 +34,7 @@ public CreateEncryptionKeyType getType() { return type; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyRequestContent && equalTo((CreateEncryptionKeyRequestContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateEncryptionKeyRequestContent other) { return type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEncryptionKeyRequestContent other) { type(other.getType()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CreateEncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public CreateEncryptionKeyRequestContent build() { return new CreateEncryptionKeyRequestContent(type, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java index e3a786ad6..d87c5b36d 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ImportEncryptionKeyRequestContent.java @@ -36,7 +36,7 @@ public String getWrappedKey() { return wrappedKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ImportEncryptionKeyRequestContent && equalTo((ImportEncryptionKeyRequestContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ImportEncryptionKeyRequestContent other) { return wrappedKey.equals(other.wrappedKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.wrappedKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements WrappedKeyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ImportEncryptionKeyRequestContent other) { wrappedKey(other.getWrappedKey()); return this; @@ -98,14 +98,14 @@ public Builder from(ImportEncryptionKeyRequestContent other) { *

Base64 encoded ciphertext of key material wrapped by public wrapping key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("wrapped_key") public _FinalStage wrappedKey(@NotNull String wrappedKey) { this.wrappedKey = Objects.requireNonNull(wrappedKey, "wrappedKey must not be null"); return this; } - @Override + @java.lang.Override public ImportEncryptionKeyRequestContent build() { return new ImportEncryptionKeyRequestContent(wrappedKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java index fbb8e2150..1d7cedcba 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/ListEncryptionKeysRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEncryptionKeysRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListEncryptionKeysRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java index ef02104fe..78249d6b9 100644 --- a/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/keys/types/SetCustomSigningKeysRequestContent.java @@ -40,7 +40,7 @@ public List getKeys() { return keys; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetCustomSigningKeysRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(SetCustomSigningKeysRequestContent other) { return keys.equals(other.keys); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.keys); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java index c991d6998..e1e290fd8 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncDiscoveryDomainsClient.java @@ -10,6 +10,7 @@ import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainByNameResponseContent; import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; @@ -56,7 +57,7 @@ public CompletableFuture> list( } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture create( String id, CreateOrganizationDiscoveryDomainRequestContent request) { @@ -64,13 +65,29 @@ public CompletableFuture creat } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture create( String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public CompletableFuture getByName( + String id, String discoveryDomain) { + return this.rawClient.getByName(id, discoveryDomain).thenApply(response -> response.body()); + } + + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public CompletableFuture getByName( + String id, String discoveryDomain, RequestOptions requestOptions) { + return this.rawClient.getByName(id, discoveryDomain, requestOptions).thenApply(response -> response.body()); + } + /** * Retrieve details about a single organization discovery domain specified by ID. */ @@ -101,7 +118,7 @@ public CompletableFuture delete(String id, String discoveryDomainId, Reque } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture update( String id, String discoveryDomainId) { @@ -109,7 +126,7 @@ public CompletableFuture updat } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture update( String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { @@ -117,7 +134,7 @@ public CompletableFuture updat } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture update( String id, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawDiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawDiscoveryDomainsClient.java index 32e7255e8..1368b8808 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawDiscoveryDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawDiscoveryDomainsClient.java @@ -22,6 +22,7 @@ import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainByNameResponseContent; import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; import com.auth0.client.mgmt.types.ListOrganizationDiscoveryDomainsResponseContent; import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; @@ -173,7 +174,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture> create( String id, CreateOrganizationDiscoveryDomainRequestContent request) { @@ -181,7 +182,7 @@ public CompletableFuture> create( String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { @@ -276,6 +277,98 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public CompletableFuture> getByName( + String id, String discoveryDomain) { + return getByName(id, discoveryDomain, null); + } + + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public CompletableFuture> getByName( + String id, String discoveryDomain, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains/name") + .addPathSegment(discoveryDomain) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationDiscoveryDomainByNameResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + /** * Retrieve details about a single organization discovery domain specified by ID. */ @@ -451,7 +544,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CompletableFuture> update( String id, String discoveryDomainId) { @@ -462,7 +555,7 @@ public CompletableFuture> update( String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { @@ -470,7 +563,7 @@ public CompletableFuture> update( String id, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/DiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/DiscoveryDomainsClient.java index 8fedd575c..e4a70a444 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/DiscoveryDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/DiscoveryDomainsClient.java @@ -10,6 +10,7 @@ import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainByNameResponseContent; import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; @@ -55,7 +56,7 @@ public SyncPagingIterable list( } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CreateOrganizationDiscoveryDomainResponseContent create( String id, CreateOrganizationDiscoveryDomainRequestContent request) { @@ -63,13 +64,28 @@ public CreateOrganizationDiscoveryDomainResponseContent create( } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public CreateOrganizationDiscoveryDomainResponseContent create( String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { return this.rawClient.create(id, request, requestOptions).body(); } + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public GetOrganizationDiscoveryDomainByNameResponseContent getByName(String id, String discoveryDomain) { + return this.rawClient.getByName(id, discoveryDomain).body(); + } + + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public GetOrganizationDiscoveryDomainByNameResponseContent getByName( + String id, String discoveryDomain, RequestOptions requestOptions) { + return this.rawClient.getByName(id, discoveryDomain, requestOptions).body(); + } + /** * Retrieve details about a single organization discovery domain specified by ID. */ @@ -100,14 +116,14 @@ public void delete(String id, String discoveryDomainId, RequestOptions requestOp } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public UpdateOrganizationDiscoveryDomainResponseContent update(String id, String discoveryDomainId) { return this.rawClient.update(id, discoveryDomainId).body(); } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public UpdateOrganizationDiscoveryDomainResponseContent update( String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { @@ -115,7 +131,7 @@ public UpdateOrganizationDiscoveryDomainResponseContent update( } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public UpdateOrganizationDiscoveryDomainResponseContent update( String id, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java index 9c2445251..d297084f7 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawDiscoveryDomainsClient.java @@ -22,6 +22,7 @@ import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainByNameResponseContent; import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; import com.auth0.client.mgmt.types.ListOrganizationDiscoveryDomainsResponseContent; import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; @@ -136,7 +137,7 @@ public ManagementApiHttpResponse } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public ManagementApiHttpResponse create( String id, CreateOrganizationDiscoveryDomainRequestContent request) { @@ -144,7 +145,7 @@ public ManagementApiHttpResponse create( String id, CreateOrganizationDiscoveryDomainRequestContent request, RequestOptions requestOptions) { @@ -213,6 +214,74 @@ public ManagementApiHttpResponse getByName( + String id, String discoveryDomain) { + return getByName(id, discoveryDomain, null); + } + + /** + * Retrieve details about a single organization discovery domain specified by domain name. + */ + public ManagementApiHttpResponse getByName( + String id, String discoveryDomain, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("discovery-domains/name") + .addPathSegment(discoveryDomain) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationDiscoveryDomainByNameResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + /** * Retrieve details about a single organization discovery domain specified by ID. */ @@ -342,7 +411,7 @@ public ManagementApiHttpResponse delete(String id, String discoveryDomainI } /** - * Update the verification status for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. + * Update the verification status and/or use_for_organization_discovery for an organization discovery domain. The <code>status</code> field must be either <code>pending</code> or <code>verified</code>. The <code>use_for_organization_discovery</code> field can be <code>true</code> or <code>false</code> (default: <code>true</code>). */ public ManagementApiHttpResponse update( String id, String discoveryDomainId) { @@ -353,7 +422,7 @@ public ManagementApiHttpResponse update( String id, String discoveryDomainId, UpdateOrganizationDiscoveryDomainRequestContent request) { @@ -361,7 +430,7 @@ public ManagementApiHttpResponse update( String id, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java index 0bc1d20d2..69687c67c 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/AssignOrganizationMemberRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignOrganizationMemberRolesRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(AssignOrganizationMemberRolesRequestContent other) { return roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java index e3cd70d4c..cdf4036f7 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/DeleteOrganizationMemberRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteOrganizationMemberRolesRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(DeleteOrganizationMemberRolesRequestContent other) { return roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java index f5a231402..91ca62ef7 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/members/types/ListOrganizationMemberRolesRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMemberRolesRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListOrganizationMemberRolesRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java index c03409e61..01aa3b991 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AddOrganizationConnectionRequestContent.java @@ -76,7 +76,7 @@ public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddOrganizationConnectionRequestContent @@ -95,12 +95,12 @@ private boolean equalTo(AddOrganizationConnectionRequestContent other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -158,7 +158,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AddOrganizationConnectionRequestContent other) { connectionId(other.getConnectionId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -172,7 +172,7 @@ public Builder from(AddOrganizationConnectionRequestContent other) { *

Single connection ID to add to the organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -183,7 +183,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -192,7 +192,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -203,7 +203,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); return this; @@ -212,7 +212,7 @@ public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { /** *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) public _FinalStage isSignupEnabled(Optional isSignupEnabled) { this.isSignupEnabled = isSignupEnabled; @@ -223,7 +223,7 @@ public _FinalStage isSignupEnabled(Optional isSignupEnabled) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -232,14 +232,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @Override + @java.lang.Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @Override + @java.lang.Override public AddOrganizationConnectionRequestContent build() { return new AddOrganizationConnectionRequestContent( connectionId, assignMembershipOnLogin, isSignupEnabled, showAsButton, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java index 5849ca265..2a3717228 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/AssociateOrganizationClientGrantRequestContent.java @@ -36,7 +36,7 @@ public String getGrantId() { return grantId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssociateOrganizationClientGrantRequestContent @@ -52,12 +52,12 @@ private boolean equalTo(AssociateOrganizationClientGrantRequestContent other) { return grantId.equals(other.grantId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.grantId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements GrantIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AssociateOrganizationClientGrantRequestContent other) { grantId(other.getGrantId()); return this; @@ -99,14 +99,14 @@ public Builder from(AssociateOrganizationClientGrantRequestContent other) { *

A Client Grant ID to add to the organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("grant_id") public _FinalStage grantId(@NotNull String grantId) { this.grantId = Objects.requireNonNull(grantId, "grantId must not be null"); return this; } - @Override + @java.lang.Override public AssociateOrganizationClientGrantRequestContent build() { return new AssociateOrganizationClientGrantRequestContent(grantId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java index d897a4d72..c1cd0715f 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationDiscoveryDomainRequestContent.java @@ -26,14 +26,18 @@ public final class CreateOrganizationDiscoveryDomainRequestContent { private final Optional status; + private final Optional useForOrganizationDiscovery; + private final Map additionalProperties; private CreateOrganizationDiscoveryDomainRequestContent( String domain, Optional status, + Optional useForOrganizationDiscovery, Map additionalProperties) { this.domain = domain; this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.additionalProperties = additionalProperties; } @@ -50,7 +54,15 @@ public Optional getStatus() { return status; } - @Override + /** + * @return Indicates whether this discovery domain should be used for organization discovery. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationDiscoveryDomainRequestContent @@ -63,15 +75,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateOrganizationDiscoveryDomainRequestContent other) { - return domain.equals(other.domain) && status.equals(other.status); + return domain.equals(other.domain) + && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.domain, this.status); + return Objects.hash(this.domain, this.status, this.useForOrganizationDiscovery); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,12 +109,21 @@ public interface _FinalStage { _FinalStage status(Optional status); _FinalStage status(OrganizationDiscoveryDomainStatus status); + + /** + *

Indicates whether this discovery domain should be used for organization discovery.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DomainStage, _FinalStage { private String domain; + private Optional useForOrganizationDiscovery = Optional.empty(); + private Optional status = Optional.empty(); @JsonAnySetter @@ -108,10 +131,11 @@ public static final class Builder implements DomainStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateOrganizationDiscoveryDomainRequestContent other) { domain(other.getDomain()); status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); return this; } @@ -120,29 +144,50 @@ public Builder from(CreateOrganizationDiscoveryDomainRequestContent other) { *

The domain name to associate with the organization e.g. acme.com.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public _FinalStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + /** + *

Indicates whether this discovery domain should be used for organization discovery.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this discovery domain should be used for organization discovery.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override public _FinalStage status(OrganizationDiscoveryDomainStatus status) { this.status = Optional.ofNullable(status); return this; } - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; return this; } - @Override + @java.lang.Override public CreateOrganizationDiscoveryDomainRequestContent build() { - return new CreateOrganizationDiscoveryDomainRequestContent(domain, status, additionalProperties); + return new CreateOrganizationDiscoveryDomainRequestContent( + domain, status, useForOrganizationDiscovery, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java index 5319ec585..e1fc23bc4 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationInvitationRequestContent.java @@ -127,7 +127,7 @@ public Optional getSendInvitationEmail() { return sendInvitationEmail; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationInvitationRequestContent @@ -151,7 +151,7 @@ private boolean equalTo(CreateOrganizationInvitationRequestContent other) { && sendInvitationEmail.equals(other.sendInvitationEmail); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.inviter, @@ -165,7 +165,7 @@ public int hashCode() { this.sendInvitationEmail); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -256,7 +256,7 @@ public static final class Builder implements InviterStage, InviteeStage, ClientI private Builder() {} - @Override + @java.lang.Override public Builder from(CreateOrganizationInvitationRequestContent other) { inviter(other.getInviter()); invitee(other.getInvitee()); @@ -270,14 +270,14 @@ public Builder from(CreateOrganizationInvitationRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("inviter") public InviteeStage inviter(@NotNull OrganizationInvitationInviter inviter) { this.inviter = Objects.requireNonNull(inviter, "inviter must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("invitee") public ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee) { this.invitee = Objects.requireNonNull(invitee, "invitee must not be null"); @@ -289,7 +289,7 @@ public ClientIdStage invitee(@NotNull OrganizationInvitationInvitee invitee) { *

Auth0 client ID. Used to resolve the application's login initiation endpoint.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -300,7 +300,7 @@ public _FinalStage clientId(@NotNull String clientId) { *

Whether the user will receive an invitation email (true) or no email (false), true by default

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage sendInvitationEmail(Boolean sendInvitationEmail) { this.sendInvitationEmail = Optional.ofNullable(sendInvitationEmail); return this; @@ -309,7 +309,7 @@ public _FinalStage sendInvitationEmail(Boolean sendInvitationEmail) { /** *

Whether the user will receive an invitation email (true) or no email (false), true by default

*/ - @Override + @java.lang.Override @JsonSetter(value = "send_invitation_email", nulls = Nulls.SKIP) public _FinalStage sendInvitationEmail(Optional sendInvitationEmail) { this.sendInvitationEmail = sendInvitationEmail; @@ -320,7 +320,7 @@ public _FinalStage sendInvitationEmail(Optional sendInvitationEmail) { *

List of roles IDs to associated with the user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage roles(List roles) { this.roles = Optional.ofNullable(roles); return this; @@ -329,7 +329,7 @@ public _FinalStage roles(List roles) { /** *

List of roles IDs to associated with the user.

*/ - @Override + @java.lang.Override @JsonSetter(value = "roles", nulls = Nulls.SKIP) public _FinalStage roles(Optional> roles) { this.roles = roles; @@ -340,7 +340,7 @@ public _FinalStage roles(Optional> roles) { *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage ttlSec(Integer ttlSec) { this.ttlSec = Optional.ofNullable(ttlSec); return this; @@ -349,33 +349,33 @@ public _FinalStage ttlSec(Integer ttlSec) { /** *

Number of seconds for which the invitation is valid before expiration. If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days).

*/ - @Override + @java.lang.Override @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) public _FinalStage ttlSec(Optional ttlSec) { this.ttlSec = ttlSec; return this; } - @Override + @java.lang.Override public _FinalStage userMetadata(Map userMetadata) { this.userMetadata = Optional.ofNullable(userMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) public _FinalStage userMetadata(Optional> userMetadata) { this.userMetadata = userMetadata; return this; } - @Override + @java.lang.Override public _FinalStage appMetadata(Map appMetadata) { this.appMetadata = Optional.ofNullable(appMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) public _FinalStage appMetadata(Optional> appMetadata) { this.appMetadata = appMetadata; @@ -386,7 +386,7 @@ public _FinalStage appMetadata(Optional> appMetadata) { *

The id of the connection to force invitee to authenticate with.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -395,14 +395,14 @@ public _FinalStage connectionId(String connectionId) { /** *

The id of the connection to force invitee to authenticate with.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @Override + @java.lang.Override public CreateOrganizationInvitationRequestContent build() { return new CreateOrganizationInvitationRequestContent( inviter, diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java index ce1ae41b5..2fc0bfa7f 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationMemberRequestContent.java @@ -38,7 +38,7 @@ public List getMembers() { return members; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationMemberRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(CreateOrganizationMemberRequestContent other) { return members.equals(other.members); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.members); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java index bc8b9e1c7..107e0da29 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/DeleteOrganizationMembersRequestContent.java @@ -38,7 +38,7 @@ public List getMembers() { return members; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteOrganizationMembersRequestContent @@ -54,12 +54,12 @@ private boolean equalTo(DeleteOrganizationMembersRequestContent other) { return members.equals(other.members); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.members); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java index 503129048..3fa65613f 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/GetOrganizationInvitationRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationInvitationRequestParameters @@ -90,12 +90,12 @@ private boolean equalTo(GetOrganizationInvitationRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java index 27766b3d7..f7e4ccaef 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationClientGrantsRequestParameters.java @@ -137,7 +137,7 @@ private OptionalNullable _getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationClientGrantsRequestParameters @@ -158,12 +158,12 @@ private boolean equalTo(ListOrganizationClientGrantsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.grantIds, this.audience, this.clientId, this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java index 7e128605f..1f5f6812a 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationConnectionsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationConnectionsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListOrganizationConnectionsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java index 5d1f93ce0..7ebb5edb9 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationDiscoveryDomainsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationDiscoveryDomainsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListOrganizationDiscoveryDomainsRequestParameters other) return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java index 449c314dd..456c405d1 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationInvitationsRequestParameters.java @@ -135,7 +135,7 @@ private OptionalNullable _getSort() { return sort; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationInvitationsRequestParameters @@ -156,12 +156,12 @@ private boolean equalTo(ListOrganizationInvitationsRequestParameters other) { && sort.equals(other.sort); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.fields, this.includeFields, this.sort); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java index 10bc81a5e..4c9a985ac 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationMembersRequestParameters.java @@ -109,7 +109,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMembersRequestParameters @@ -128,12 +128,12 @@ private boolean equalTo(ListOrganizationMembersRequestParameters other) { && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take, this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java index 83a72dcfc..ee5ef19d8 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestContent.java @@ -63,7 +63,7 @@ public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationConnectionRequestContent @@ -81,12 +81,12 @@ private boolean equalTo(UpdateOrganizationConnectionRequestContent other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.assignMembershipOnLogin, this.isSignupEnabled, this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java index 18a6ae38b..b825304ae 100644 --- a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationDiscoveryDomainRequestContent.java @@ -23,11 +23,16 @@ public final class UpdateOrganizationDiscoveryDomainRequestContent { private final Optional status; + private final Optional useForOrganizationDiscovery; + private final Map additionalProperties; private UpdateOrganizationDiscoveryDomainRequestContent( - Optional status, Map additionalProperties) { + Optional status, + Optional useForOrganizationDiscovery, + Map additionalProperties) { this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.additionalProperties = additionalProperties; } @@ -36,7 +41,15 @@ public Optional getStatus() { return status; } - @Override + /** + * @return Indicates whether this discovery domain should be used for organization discovery. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationDiscoveryDomainRequestContent @@ -49,15 +62,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(UpdateOrganizationDiscoveryDomainRequestContent other) { - return status.equals(other.status); + return status.equals(other.status) && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.status); + return Objects.hash(this.status, this.useForOrganizationDiscovery); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -70,6 +83,8 @@ public static Builder builder() { public static final class Builder { private Optional status = Optional.empty(); + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -77,6 +92,7 @@ private Builder() {} public Builder from(UpdateOrganizationDiscoveryDomainRequestContent other) { status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); return this; } @@ -91,8 +107,23 @@ public Builder status(OrganizationDiscoveryDomainStatus status) { return this; } + /** + *

Indicates whether this discovery domain should be used for organization discovery.

+ */ + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public Builder useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + public Builder useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + public UpdateOrganizationDiscoveryDomainRequestContent build() { - return new UpdateOrganizationDiscoveryDomainRequestContent(status, additionalProperties); + return new UpdateOrganizationDiscoveryDomainRequestContent( + status, useForOrganizationDiscovery, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java b/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java index 2accf0331..f23bb371f 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/BulkUpdateAculRequestContent.java @@ -36,7 +36,7 @@ public List getConfigs() { return configs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BulkUpdateAculRequestContent && equalTo((BulkUpdateAculRequestContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(BulkUpdateAculRequestContent other) { return configs.equals(other.configs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.configs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java index c981f005a..3bcc187a2 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/ListAculsRequestParameters.java @@ -180,7 +180,7 @@ private OptionalNullable _getRenderingMode() { return renderingMode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListAculsRequestParameters && equalTo((ListAculsRequestParameters) other); @@ -202,7 +202,7 @@ private boolean equalTo(ListAculsRequestParameters other) { && renderingMode.equals(other.renderingMode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.fields, @@ -215,7 +215,7 @@ public int hashCode() { this.renderingMode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java index 828708fe4..2e69170a3 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/types/UpdateAculRequestContent.java @@ -128,7 +128,7 @@ private OptionalNullable _getFilters() { return filters; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAculRequestContent && equalTo((UpdateAculRequestContent) other); @@ -148,7 +148,7 @@ private boolean equalTo(UpdateAculRequestContent other) { && filters.equals(other.filters); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.renderingMode, @@ -159,7 +159,7 @@ public int hashCode() { this.filters); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java index e0bab180b..36fa76082 100644 --- a/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/settings/types/UpdateRiskAssessmentsSettingsNewDeviceRequestContent.java @@ -36,7 +36,7 @@ public int getRememberFor() { return rememberFor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRiskAssessmentsSettingsNewDeviceRequestContent @@ -52,12 +52,12 @@ private boolean equalTo(UpdateRiskAssessmentsSettingsNewDeviceRequestContent oth return rememberFor == other.rememberFor; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.rememberFor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements RememberForStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateRiskAssessmentsSettingsNewDeviceRequestContent other) { rememberFor(other.getRememberFor()); return this; @@ -99,14 +99,14 @@ public Builder from(UpdateRiskAssessmentsSettingsNewDeviceRequestContent other) *

Length of time to remember devices for, in days.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("remember_for") public _FinalStage rememberFor(int rememberFor) { this.rememberFor = rememberFor; return this; } - @Override + @java.lang.Override public UpdateRiskAssessmentsSettingsNewDeviceRequestContent build() { return new UpdateRiskAssessmentsSettingsNewDeviceRequestContent(rememberFor, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java index 0fb1df93b..4a2aa240f 100644 --- a/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/riskassessments/types/UpdateRiskAssessmentsSettingsRequestContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRiskAssessmentsSettingsRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(UpdateRiskAssessmentsSettingsRequestContent other) { return enabled == other.enabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateRiskAssessmentsSettingsRequestContent other) { enabled(other.getEnabled()); return this; @@ -98,14 +98,14 @@ public Builder from(UpdateRiskAssessmentsSettingsRequestContent other) { *

Whether or not risk assessment is enabled.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public UpdateRiskAssessmentsSettingsRequestContent build() { return new UpdateRiskAssessmentsSettingsRequestContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java index 60574163a..f8856de96 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AddRolePermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddRolePermissionsRequestContent && equalTo((AddRolePermissionsRequestContent) other); @@ -55,12 +55,12 @@ private boolean equalTo(AddRolePermissionsRequestContent other) { return permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java index fb266f581..c91daef11 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/AssignRoleUsersRequestContent.java @@ -38,7 +38,7 @@ public List getUsers() { return users; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignRoleUsersRequestContent && equalTo((AssignRoleUsersRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(AssignRoleUsersRequestContent other) { return users.equals(other.users); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.users); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java index eb8611f55..c611cacf3 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/DeleteRolePermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteRolePermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(DeleteRolePermissionsRequestContent other) { return permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java index 205c094aa..0f0635376 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRolePermissionsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolePermissionsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListRolePermissionsRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java index 69ec9e291..15b28d60a 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/roles/types/ListRoleUsersRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRoleUsersRequestParameters && equalTo((ListRoleUsersRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListRoleUsersRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java index c9c015a96..a948402ca 100644 --- a/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/selfserviceprofiles/types/CreateSelfServiceProfileSsoTicketRequestContent.java @@ -39,6 +39,8 @@ public final class CreateSelfServiceProfileSsoTicketRequestContent { private final Optional provisioningConfig; + private final Optional useForOrganizationDiscovery; + private final Map additionalProperties; private CreateSelfServiceProfileSsoTicketRequestContent( @@ -49,6 +51,7 @@ private CreateSelfServiceProfileSsoTicketRequestContent( Optional ttlSec, Optional domainAliasesConfig, Optional provisioningConfig, + Optional useForOrganizationDiscovery, Map additionalProperties) { this.connectionId = connectionId; this.connectionConfig = connectionConfig; @@ -57,6 +60,7 @@ private CreateSelfServiceProfileSsoTicketRequestContent( this.ttlSec = ttlSec; this.domainAliasesConfig = domainAliasesConfig; this.provisioningConfig = provisioningConfig; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.additionalProperties = additionalProperties; } @@ -107,7 +111,15 @@ public Optional getProvisioningCo return provisioningConfig; } - @Override + /** + * @return Indicates whether a verified domain should be used for organization discovery during authentication. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileSsoTicketRequestContent @@ -126,10 +138,11 @@ private boolean equalTo(CreateSelfServiceProfileSsoTicketRequestContent other) { && enabledOrganizations.equals(other.enabledOrganizations) && ttlSec.equals(other.ttlSec) && domainAliasesConfig.equals(other.domainAliasesConfig) - && provisioningConfig.equals(other.provisioningConfig); + && provisioningConfig.equals(other.provisioningConfig) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -138,10 +151,11 @@ public int hashCode() { this.enabledOrganizations, this.ttlSec, this.domainAliasesConfig, - this.provisioningConfig); + this.provisioningConfig, + this.useForOrganizationDiscovery); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,6 +180,8 @@ public static final class Builder { private Optional provisioningConfig = Optional.empty(); + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -179,6 +195,7 @@ public Builder from(CreateSelfServiceProfileSsoTicketRequestContent other) { ttlSec(other.getTtlSec()); domainAliasesConfig(other.getDomainAliasesConfig()); provisioningConfig(other.getProvisioningConfig()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); return this; } @@ -273,6 +290,20 @@ public Builder provisioningConfig(SelfServiceProfileSsoTicketProvisioningConfig return this; } + /** + *

Indicates whether a verified domain should be used for organization discovery during authentication.

+ */ + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public Builder useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + public Builder useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + public CreateSelfServiceProfileSsoTicketRequestContent build() { return new CreateSelfServiceProfileSsoTicketRequestContent( connectionId, @@ -282,6 +313,7 @@ public CreateSelfServiceProfileSsoTicketRequestContent build() { ttlSec, domainAliasesConfig, provisioningConfig, + useForOrganizationDiscovery, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java index 6bb310001..d4967a56a 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/GetTenantSettingsRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTenantSettingsRequestParameters @@ -90,12 +90,12 @@ private boolean equalTo(GetTenantSettingsRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java index 6448a794b..5a0d49f66 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContent.java @@ -99,6 +99,8 @@ public final class UpdateTenantSettingsRequestContent { private final Optional resourceParameterProfile; + private final Optional enableAiGuide; + private final Map additionalProperties; private UpdateTenantSettingsRequestContent( @@ -134,6 +136,7 @@ private UpdateTenantSettingsRequestContent( OptionalNullable authorizationResponseIssParameterSupported, OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, Optional resourceParameterProfile, + Optional enableAiGuide, Map additionalProperties) { this.changePassword = changePassword; this.deviceFlow = deviceFlow; @@ -167,6 +170,7 @@ private UpdateTenantSettingsRequestContent( this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; this.resourceParameterProfile = resourceParameterProfile; + this.enableAiGuide = enableAiGuide; this.additionalProperties = additionalProperties; } @@ -447,6 +451,14 @@ public Optional getResourceParameterProf return resourceParameterProfile; } + /** + * @return Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant. + */ + @JsonProperty("enable_ai_guide") + public Optional getEnableAiGuide() { + return enableAiGuide; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -525,7 +537,7 @@ private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPr return skipNonVerifiableCallbackUriConfirmationPrompt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTenantSettingsRequestContent @@ -570,10 +582,11 @@ private boolean equalTo(UpdateTenantSettingsRequestContent other) { && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) && skipNonVerifiableCallbackUriConfirmationPrompt.equals( other.skipNonVerifiableCallbackUriConfirmationPrompt) - && resourceParameterProfile.equals(other.resourceParameterProfile); + && resourceParameterProfile.equals(other.resourceParameterProfile) + && enableAiGuide.equals(other.enableAiGuide); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.changePassword, @@ -607,10 +620,11 @@ public int hashCode() { this.pushedAuthorizationRequestsSupported, this.authorizationResponseIssParameterSupported, this.skipNonVerifiableCallbackUriConfirmationPrompt, - this.resourceParameterProfile); + this.resourceParameterProfile, + this.enableAiGuide); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -685,6 +699,8 @@ public static final class Builder { private Optional resourceParameterProfile = Optional.empty(); + private Optional enableAiGuide = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -723,6 +739,7 @@ public Builder from(UpdateTenantSettingsRequestContent other) { authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); resourceParameterProfile(other.getResourceParameterProfile()); + enableAiGuide(other.getEnableAiGuide()); return this; } @@ -1431,6 +1448,20 @@ public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile r return this; } + /** + *

Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant.

+ */ + @JsonSetter(value = "enable_ai_guide", nulls = Nulls.SKIP) + public Builder enableAiGuide(Optional enableAiGuide) { + this.enableAiGuide = enableAiGuide; + return this; + } + + public Builder enableAiGuide(Boolean enableAiGuide) { + this.enableAiGuide = Optional.ofNullable(enableAiGuide); + return this; + } + public UpdateTenantSettingsRequestContent build() { return new UpdateTenantSettingsRequestContent( changePassword, @@ -1465,6 +1496,7 @@ public UpdateTenantSettingsRequestContent build() { authorizationResponseIssParameterSupported, skipNonVerifiableCallbackUriConfirmationPrompt, resourceParameterProfile, + enableAiGuide, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java index eb4851d11..e224ebbda 100644 --- a/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java +++ b/src/main/java/com/auth0/client/mgmt/tenants/types/UpdateTenantSettingsRequestContentEnabledLocalesItem.java @@ -263,20 +263,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateTenantSettingsRequestContentEnabledLocalesItem && this.string.equals(((UpdateTenantSettingsRequestContentEnabledLocalesItem) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Action.java b/src/main/java/com/auth0/client/mgmt/types/Action.java index 75eae00db..0cb6f0fc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Action.java +++ b/src/main/java/com/auth0/client/mgmt/types/Action.java @@ -54,6 +54,8 @@ public final class Action { private final Optional deploy; + private final Optional> modules; + private final Map additionalProperties; private Action( @@ -73,6 +75,7 @@ private Action( Optional status, Optional builtAt, Optional deploy, + Optional> modules, Map additionalProperties) { this.id = id; this.name = name; @@ -90,6 +93,7 @@ private Action( this.status = status; this.builtAt = builtAt; this.deploy = deploy; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -212,7 +216,15 @@ public Optional getDeploy() { return deploy; } - @Override + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Action && equalTo((Action) other); @@ -239,10 +251,11 @@ private boolean equalTo(Action other) { && integration.equals(other.integration) && status.equals(other.status) && builtAt.equals(other.builtAt) - && deploy.equals(other.deploy); + && deploy.equals(other.deploy) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -260,10 +273,11 @@ public int hashCode() { this.integration, this.status, this.builtAt, - this.deploy); + this.deploy, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -306,6 +320,8 @@ public static final class Builder { private Optional deploy = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -328,6 +344,7 @@ public Builder from(Action other) { status(other.getStatus()); builtAt(other.getBuiltAt()); deploy(other.getDeploy()); + modules(other.getModules()); return this; } @@ -546,6 +563,20 @@ public Builder deploy(Boolean deploy) { return this; } + /** + *

The list of action modules and their versions used by this action.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public Action build() { return new Action( id, @@ -564,6 +595,7 @@ public Action build() { status, builtAt, deploy, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBase.java b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java index 6f3e165ac..5a4f5c3e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBase.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBase.java @@ -101,7 +101,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBase && equalTo((ActionBase) other); @@ -121,13 +121,13 @@ private boolean equalTo(ActionBase other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.supportedTriggers, this.allChangesDeployed, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java index 17f6b9165..54cde00d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBinding.java @@ -94,7 +94,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBinding && equalTo((ActionBinding) other); @@ -114,12 +114,12 @@ private boolean equalTo(ActionBinding other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.triggerId, this.displayName, this.action, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java index ab75f3129..3be4a031d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRef.java @@ -46,7 +46,7 @@ public Optional getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBindingRef && equalTo((ActionBindingRef) other); @@ -61,12 +61,12 @@ private boolean equalTo(ActionBindingRef other) { return type.equals(other.type) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java index e1731a719..85c0fc20b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingRefTypeEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBindingRefTypeEnum && this.string.equals(((ActionBindingRefTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java index abcceca18..f1495c76a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBindingTypeEnum && this.string.equals(((ActionBindingTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java index f617ad746..530a28018 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBindingWithRef.java @@ -62,7 +62,7 @@ public Optional> getSecrets() { return secrets; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionBindingWithRef && equalTo((ActionBindingWithRef) other); @@ -77,12 +77,12 @@ private boolean equalTo(ActionBindingWithRef other) { return ref.equals(other.ref) && displayName.equals(other.displayName) && secrets.equals(other.secrets); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ref, this.displayName, this.secrets); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder implements RefStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ActionBindingWithRef other) { ref(other.getRef()); displayName(other.getDisplayName()); @@ -136,7 +136,7 @@ public Builder from(ActionBindingWithRef other) { return this; } - @Override + @java.lang.Override @JsonSetter("ref") public _FinalStage ref(@NotNull ActionBindingRef ref) { this.ref = Objects.requireNonNull(ref, "ref must not be null"); @@ -147,7 +147,7 @@ public _FinalStage ref(@NotNull ActionBindingRef ref) { *

The list of secrets that are included in an action or a version of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage secrets(List secrets) { this.secrets = Optional.ofNullable(secrets); return this; @@ -156,7 +156,7 @@ public _FinalStage secrets(List secrets) { /** *

The list of secrets that are included in an action or a version of an action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "secrets", nulls = Nulls.SKIP) public _FinalStage secrets(Optional> secrets) { this.secrets = secrets; @@ -167,7 +167,7 @@ public _FinalStage secrets(Optional> secrets) { *

The name of the binding.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -176,14 +176,14 @@ public _FinalStage displayName(String displayName) { /** *

The name of the binding.

*/ - @Override + @java.lang.Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public ActionBindingWithRef build() { return new ActionBindingWithRef(ref, displayName, secrets, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java index 1c7c416fd..6370c3f4b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionBuildStatusEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionBuildStatusEnum && this.string.equals(((ActionBuildStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java index 16ecae966..c30564982 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionDeployedVersion.java @@ -52,6 +52,8 @@ public final class ActionDeployedVersion { private final Optional> supportedTriggers; + private final Optional> modules; + private final Map additionalProperties; private ActionDeployedVersion( @@ -70,6 +72,7 @@ private ActionDeployedVersion( Optional createdAt, Optional updatedAt, Optional> supportedTriggers, + Optional> modules, Map additionalProperties) { this.id = id; this.actionId = actionId; @@ -86,6 +89,7 @@ private ActionDeployedVersion( this.createdAt = createdAt; this.updatedAt = updatedAt; this.supportedTriggers = supportedTriggers; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -203,7 +207,15 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @Override + /** + * @return The list of action modules and their versions used by this action version. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionDeployedVersion && equalTo((ActionDeployedVersion) other); @@ -229,10 +241,11 @@ private boolean equalTo(ActionDeployedVersion other) { && builtAt.equals(other.builtAt) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && supportedTriggers.equals(other.supportedTriggers); + && supportedTriggers.equals(other.supportedTriggers) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -249,10 +262,11 @@ public int hashCode() { this.builtAt, this.createdAt, this.updatedAt, - this.supportedTriggers); + this.supportedTriggers, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,6 +307,8 @@ public static final class Builder { private Optional> supportedTriggers = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -314,6 +330,7 @@ public Builder from(ActionDeployedVersion other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); supportedTriggers(other.getSupportedTriggers()); + modules(other.getModules()); return this; } @@ -521,6 +538,20 @@ public Builder supportedTriggers(List supportedTriggers) { return this; } + /** + *

The list of action modules and their versions used by this action version.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public ActionDeployedVersion build() { return new ActionDeployedVersion( id, @@ -538,6 +569,7 @@ public ActionDeployedVersion build() { createdAt, updatedAt, supportedTriggers, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionError.java b/src/main/java/com/auth0/client/mgmt/types/ActionError.java index 7397dadab..490a8520c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionError.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionError.java @@ -51,7 +51,7 @@ public Optional getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionError && equalTo((ActionError) other); @@ -66,12 +66,12 @@ private boolean equalTo(ActionError other) { return id.equals(other.id) && msg.equals(other.msg) && url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.msg, this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java index cd14fd66f..a7e149c1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionResult.java @@ -73,7 +73,7 @@ public Optional getEndedAt() { return endedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionExecutionResult && equalTo((ActionExecutionResult) other); @@ -91,12 +91,12 @@ private boolean equalTo(ActionExecutionResult other) { && endedAt.equals(other.endedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionName, this.error, this.startedAt, this.endedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java index b2e6672a1..180a710c3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionExecutionStatusEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionExecutionStatusEnum && this.string.equals(((ActionExecutionStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionModuleReference.java b/src/main/java/com/auth0/client/mgmt/types/ActionModuleReference.java new file mode 100644 index 000000000..6f12cdfd3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ActionModuleReference.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActionModuleReference.Builder.class) +public final class ActionModuleReference { + private final Optional moduleId; + + private final Optional moduleName; + + private final Optional moduleVersionId; + + private final Optional moduleVersionNumber; + + private final Map additionalProperties; + + private ActionModuleReference( + Optional moduleId, + Optional moduleName, + Optional moduleVersionId, + Optional moduleVersionNumber, + Map additionalProperties) { + this.moduleId = moduleId; + this.moduleName = moduleName; + this.moduleVersionId = moduleVersionId; + this.moduleVersionNumber = moduleVersionNumber; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique ID of the module. + */ + @JsonProperty("module_id") + public Optional getModuleId() { + return moduleId; + } + + /** + * @return The name of the module. + */ + @JsonProperty("module_name") + public Optional getModuleName() { + return moduleName; + } + + /** + * @return The ID of the specific module version. + */ + @JsonProperty("module_version_id") + public Optional getModuleVersionId() { + return moduleVersionId; + } + + /** + * @return The version number of the module. + */ + @JsonProperty("module_version_number") + public Optional getModuleVersionNumber() { + return moduleVersionNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionModuleReference && equalTo((ActionModuleReference) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionModuleReference other) { + return moduleId.equals(other.moduleId) + && moduleName.equals(other.moduleName) + && moduleVersionId.equals(other.moduleVersionId) + && moduleVersionNumber.equals(other.moduleVersionNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.moduleId, this.moduleName, this.moduleVersionId, this.moduleVersionNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional moduleId = Optional.empty(); + + private Optional moduleName = Optional.empty(); + + private Optional moduleVersionId = Optional.empty(); + + private Optional moduleVersionNumber = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionModuleReference other) { + moduleId(other.getModuleId()); + moduleName(other.getModuleName()); + moduleVersionId(other.getModuleVersionId()); + moduleVersionNumber(other.getModuleVersionNumber()); + return this; + } + + /** + *

The unique ID of the module.

+ */ + @JsonSetter(value = "module_id", nulls = Nulls.SKIP) + public Builder moduleId(Optional moduleId) { + this.moduleId = moduleId; + return this; + } + + public Builder moduleId(String moduleId) { + this.moduleId = Optional.ofNullable(moduleId); + return this; + } + + /** + *

The name of the module.

+ */ + @JsonSetter(value = "module_name", nulls = Nulls.SKIP) + public Builder moduleName(Optional moduleName) { + this.moduleName = moduleName; + return this; + } + + public Builder moduleName(String moduleName) { + this.moduleName = Optional.ofNullable(moduleName); + return this; + } + + /** + *

The ID of the specific module version.

+ */ + @JsonSetter(value = "module_version_id", nulls = Nulls.SKIP) + public Builder moduleVersionId(Optional moduleVersionId) { + this.moduleVersionId = moduleVersionId; + return this; + } + + public Builder moduleVersionId(String moduleVersionId) { + this.moduleVersionId = Optional.ofNullable(moduleVersionId); + return this; + } + + /** + *

The version number of the module.

+ */ + @JsonSetter(value = "module_version_number", nulls = Nulls.SKIP) + public Builder moduleVersionNumber(Optional moduleVersionNumber) { + this.moduleVersionNumber = moduleVersionNumber; + return this; + } + + public Builder moduleVersionNumber(Integer moduleVersionNumber) { + this.moduleVersionNumber = Optional.ofNullable(moduleVersionNumber); + return this; + } + + public ActionModuleReference build() { + return new ActionModuleReference( + moduleId, moduleName, moduleVersionId, moduleVersionNumber, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java index 0f8943c68..0e2f8be7c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretRequest.java @@ -49,7 +49,7 @@ public Optional getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionSecretRequest && equalTo((ActionSecretRequest) other); @@ -64,12 +64,12 @@ private boolean equalTo(ActionSecretRequest other) { return name.equals(other.name) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java index af4cb10c7..a90411457 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionSecretResponse.java @@ -50,7 +50,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionSecretResponse && equalTo((ActionSecretResponse) other); @@ -65,12 +65,12 @@ private boolean equalTo(ActionSecretResponse other) { return name.equals(other.name) && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java index 9b25b0e14..f904a3396 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTrigger.java @@ -107,7 +107,7 @@ public Optional getBindingPolicy() { return bindingPolicy; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionTrigger && equalTo((ActionTrigger) other); @@ -128,7 +128,7 @@ private boolean equalTo(ActionTrigger other) { && bindingPolicy.equals(other.bindingPolicy); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -140,7 +140,7 @@ public int hashCode() { this.bindingPolicy); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -219,7 +219,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ActionTrigger other) { id(other.getId()); version(other.getVersion()); @@ -231,20 +231,20 @@ public Builder from(ActionTrigger other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage bindingPolicy(ActionBindingTypeEnum bindingPolicy) { this.bindingPolicy = Optional.ofNullable(bindingPolicy); return this; } - @Override + @java.lang.Override @JsonSetter(value = "binding_policy", nulls = Nulls.SKIP) public _FinalStage bindingPolicy(Optional bindingPolicy) { this.bindingPolicy = bindingPolicy; @@ -255,7 +255,7 @@ public _FinalStage bindingPolicy(Optional bindingPolicy) *

compatible_triggers informs which other trigger supports the same event and api.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage compatibleTriggers(List compatibleTriggers) { this.compatibleTriggers = Optional.ofNullable(compatibleTriggers); return this; @@ -264,7 +264,7 @@ public _FinalStage compatibleTriggers(List compa /** *

compatible_triggers informs which other trigger supports the same event and api.

*/ - @Override + @java.lang.Override @JsonSetter(value = "compatible_triggers", nulls = Nulls.SKIP) public _FinalStage compatibleTriggers(Optional> compatibleTriggers) { this.compatibleTriggers = compatibleTriggers; @@ -275,7 +275,7 @@ public _FinalStage compatibleTriggers(OptionalRuntime that will be used when none is specified when creating an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage defaultRuntime(String defaultRuntime) { this.defaultRuntime = Optional.ofNullable(defaultRuntime); return this; @@ -284,7 +284,7 @@ public _FinalStage defaultRuntime(String defaultRuntime) { /** *

Runtime that will be used when none is specified when creating an action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "default_runtime", nulls = Nulls.SKIP) public _FinalStage defaultRuntime(Optional defaultRuntime) { this.defaultRuntime = defaultRuntime; @@ -295,7 +295,7 @@ public _FinalStage defaultRuntime(Optional defaultRuntime) { *

runtimes supported by this trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage runtimes(List runtimes) { this.runtimes = Optional.ofNullable(runtimes); return this; @@ -304,7 +304,7 @@ public _FinalStage runtimes(List runtimes) { /** *

runtimes supported by this trigger.

*/ - @Override + @java.lang.Override @JsonSetter(value = "runtimes", nulls = Nulls.SKIP) public _FinalStage runtimes(Optional> runtimes) { this.runtimes = runtimes; @@ -315,7 +315,7 @@ public _FinalStage runtimes(Optional> runtimes) { *

status points to the trigger status.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage status(String status) { this.status = Optional.ofNullable(status); return this; @@ -324,7 +324,7 @@ public _FinalStage status(String status) { /** *

status points to the trigger status.

*/ - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -335,7 +335,7 @@ public _FinalStage status(Optional status) { *

The version of a trigger. v1, v2, etc.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage version(String version) { this.version = Optional.ofNullable(version); return this; @@ -344,14 +344,14 @@ public _FinalStage version(String version) { /** *

The version of a trigger. v1, v2, etc.

*/ - @Override + @java.lang.Override @JsonSetter(value = "version", nulls = Nulls.SKIP) public _FinalStage version(Optional version) { this.version = version; return this; } - @Override + @java.lang.Override public ActionTrigger build() { return new ActionTrigger( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java index 74ff12072..bb8740e73 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionTriggerCompatibleTrigger.java @@ -44,7 +44,7 @@ public String getVersion() { return version; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionTriggerCompatibleTrigger && equalTo((ActionTriggerCompatibleTrigger) other); @@ -59,12 +59,12 @@ private boolean equalTo(ActionTriggerCompatibleTrigger other) { return id.equals(other.id) && version.equals(other.version); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.version); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,14 +101,14 @@ public static final class Builder implements IdStage, VersionStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(ActionTriggerCompatibleTrigger other) { id(other.getId()); version(other.getVersion()); return this; } - @Override + @java.lang.Override @JsonSetter("id") public VersionStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -120,14 +120,14 @@ public VersionStage id(@NotNull String id) { *

The version of a trigger. v1, v2, etc.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("version") public _FinalStage version(@NotNull String version) { this.version = Objects.requireNonNull(version, "version must not be null"); return this; } - @Override + @java.lang.Override public ActionTriggerCompatibleTrigger build() { return new ActionTriggerCompatibleTrigger(id, version, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java index d53849f2a..8301f2ec8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersion.java @@ -52,6 +52,8 @@ public final class ActionVersion { private final Optional> supportedTriggers; + private final Optional> modules; + private final Map additionalProperties; private ActionVersion( @@ -70,6 +72,7 @@ private ActionVersion( Optional createdAt, Optional updatedAt, Optional> supportedTriggers, + Optional> modules, Map additionalProperties) { this.id = id; this.actionId = actionId; @@ -86,6 +89,7 @@ private ActionVersion( this.createdAt = createdAt; this.updatedAt = updatedAt; this.supportedTriggers = supportedTriggers; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -203,7 +207,15 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @Override + /** + * @return The list of action modules and their versions used by this action version. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionVersion && equalTo((ActionVersion) other); @@ -229,10 +241,11 @@ private boolean equalTo(ActionVersion other) { && builtAt.equals(other.builtAt) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && supportedTriggers.equals(other.supportedTriggers); + && supportedTriggers.equals(other.supportedTriggers) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -249,10 +262,11 @@ public int hashCode() { this.builtAt, this.createdAt, this.updatedAt, - this.supportedTriggers); + this.supportedTriggers, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,6 +307,8 @@ public static final class Builder { private Optional> supportedTriggers = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -314,6 +330,7 @@ public Builder from(ActionVersion other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); supportedTriggers(other.getSupportedTriggers()); + modules(other.getModules()); return this; } @@ -521,6 +538,20 @@ public Builder supportedTriggers(List supportedTriggers) { return this; } + /** + *

The list of action modules and their versions used by this action version.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public ActionVersion build() { return new ActionVersion( id, @@ -538,6 +569,7 @@ public ActionVersion build() { createdAt, updatedAt, supportedTriggers, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java index 685c66a3f..6a9f5c51e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionBuildStatusEnum.java @@ -36,20 +36,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ActionVersionBuildStatusEnum && this.string.equals(((ActionVersionBuildStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java index 6535cf651..d61c7e1bf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java +++ b/src/main/java/com/auth0/client/mgmt/types/ActionVersionDependency.java @@ -63,7 +63,7 @@ public Optional getRegistryUrl() { return registryUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionVersionDependency && equalTo((ActionVersionDependency) other); @@ -78,12 +78,12 @@ private boolean equalTo(ActionVersionDependency other) { return name.equals(other.name) && version.equals(other.version) && registryUrl.equals(other.registryUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.version, this.registryUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java index 1cebd987d..28d882c43 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilter.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculClientFilter && equalTo((AculClientFilter) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculClientFilter other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(AculClientFilter.class); } - @Override + @java.lang.Override public AculClientFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java index 938969fc7..ba38c87d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterById.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculClientFilterById && equalTo((AculClientFilterById) other); @@ -51,12 +51,12 @@ private boolean equalTo(AculClientFilterById other) { return id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AculClientFilterById other) { id(other.getId()); return this; @@ -98,14 +98,14 @@ public Builder from(AculClientFilterById other) { *

Client ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public AculClientFilterById build() { return new AculClientFilterById(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java index 17332ab3e..cdd5fec22 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculClientFilterByMetadata.java @@ -34,7 +34,7 @@ public Map getMetadata() { return metadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculClientFilterByMetadata && equalTo((AculClientFilterByMetadata) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculClientFilterByMetadata other) { return metadata.equals(other.metadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.metadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java b/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java index b6a637884..682f01c92 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculConfigsItem.java @@ -134,7 +134,7 @@ private OptionalNullable _getFilters() { return filters; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculConfigsItem && equalTo((AculConfigsItem) other); @@ -156,7 +156,7 @@ private boolean equalTo(AculConfigsItem other) { && filters.equals(other.filters); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.prompt, @@ -169,7 +169,7 @@ public int hashCode() { this.filters); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -251,7 +251,7 @@ public static final class Builder implements PromptStage, ScreenStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(AculConfigsItem other) { prompt(other.getPrompt()); screen(other.getScreen()); @@ -264,21 +264,21 @@ public Builder from(AculConfigsItem other) { return this; } - @Override + @java.lang.Override @JsonSetter("prompt") public ScreenStage prompt(@NotNull PromptGroupNameEnum prompt) { this.prompt = Objects.requireNonNull(prompt, "prompt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("screen") public _FinalStage screen(@NotNull ScreenGroupNameEnum screen) { this.screen = Objects.requireNonNull(screen, "screen must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage filters(com.auth0.client.mgmt.core.Nullable filters) { if (filters.isNull()) { this.filters = OptionalNullable.ofNull(); @@ -290,7 +290,7 @@ public _FinalStage filters(com.auth0.client.mgmt.core.Nullable filt return this; } - @Override + @java.lang.Override public _FinalStage filters(Optional filters) { if (filters.isPresent()) { this.filters = OptionalNullable.of(filters.get()); @@ -300,33 +300,33 @@ public _FinalStage filters(Optional filters) { return this; } - @Override + @java.lang.Override public _FinalStage filters(AculFilters filters) { this.filters = OptionalNullable.of(filters); return this; } - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(@Nullable OptionalNullable filters) { this.filters = filters; return this; } - @Override + @java.lang.Override public _FinalStage headTags(List headTags) { this.headTags = Optional.ofNullable(headTags); return this; } - @Override + @java.lang.Override @JsonSetter(value = "head_tags", nulls = Nulls.SKIP) public _FinalStage headTags(Optional> headTags) { this.headTags = headTags; return this; } - @Override + @java.lang.Override public _FinalStage usePageTemplate(com.auth0.client.mgmt.core.Nullable usePageTemplate) { if (usePageTemplate.isNull()) { this.usePageTemplate = OptionalNullable.ofNull(); @@ -338,7 +338,7 @@ public _FinalStage usePageTemplate(com.auth0.client.mgmt.core.Nullable return this; } - @Override + @java.lang.Override public _FinalStage usePageTemplate(Optional usePageTemplate) { if (usePageTemplate.isPresent()) { this.usePageTemplate = OptionalNullable.of(usePageTemplate.get()); @@ -348,20 +348,20 @@ public _FinalStage usePageTemplate(Optional usePageTemplate) { return this; } - @Override + @java.lang.Override public _FinalStage usePageTemplate(Boolean usePageTemplate) { this.usePageTemplate = OptionalNullable.of(usePageTemplate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "use_page_template", nulls = Nulls.SKIP) public _FinalStage usePageTemplate(@Nullable OptionalNullable usePageTemplate) { this.usePageTemplate = usePageTemplate; return this; } - @Override + @java.lang.Override public _FinalStage defaultHeadTagsDisabled( com.auth0.client.mgmt.core.Nullable defaultHeadTagsDisabled) { if (defaultHeadTagsDisabled.isNull()) { @@ -374,7 +374,7 @@ public _FinalStage defaultHeadTagsDisabled( return this; } - @Override + @java.lang.Override public _FinalStage defaultHeadTagsDisabled(Optional defaultHeadTagsDisabled) { if (defaultHeadTagsDisabled.isPresent()) { this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled.get()); @@ -384,46 +384,46 @@ public _FinalStage defaultHeadTagsDisabled(Optional defaultHeadTagsDisa return this; } - @Override + @java.lang.Override public _FinalStage defaultHeadTagsDisabled(Boolean defaultHeadTagsDisabled) { this.defaultHeadTagsDisabled = OptionalNullable.of(defaultHeadTagsDisabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "default_head_tags_disabled", nulls = Nulls.SKIP) public _FinalStage defaultHeadTagsDisabled(@Nullable OptionalNullable defaultHeadTagsDisabled) { this.defaultHeadTagsDisabled = defaultHeadTagsDisabled; return this; } - @Override + @java.lang.Override public _FinalStage contextConfiguration(List contextConfiguration) { this.contextConfiguration = Optional.ofNullable(contextConfiguration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "context_configuration", nulls = Nulls.SKIP) public _FinalStage contextConfiguration(Optional> contextConfiguration) { this.contextConfiguration = contextConfiguration; return this; } - @Override + @java.lang.Override public _FinalStage renderingMode(AculRenderingModeEnum renderingMode) { this.renderingMode = Optional.ofNullable(renderingMode); return this; } - @Override + @java.lang.Override @JsonSetter(value = "rendering_mode", nulls = Nulls.SKIP) public _FinalStage renderingMode(Optional renderingMode) { this.renderingMode = renderingMode; return this; } - @Override + @java.lang.Override public AculConfigsItem build() { return new AculConfigsItem( prompt, diff --git a/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java b/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java index da92a3ef7..c0fa83a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculContextConfigurationItem.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculContextConfigurationItem && equalTo((AculContextConfigurationItem) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculContextConfigurationItem other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculDomainFilter && equalTo((AculDomainFilter) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculDomainFilter other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(AculDomainFilter.class); } - @Override + @java.lang.Override public AculDomainFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java index a8a4b256d..25f840446 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterById.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculDomainFilterById && equalTo((AculDomainFilterById) other); @@ -51,12 +51,12 @@ private boolean equalTo(AculDomainFilterById other) { return id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AculDomainFilterById other) { id(other.getId()); return this; @@ -98,14 +98,14 @@ public Builder from(AculDomainFilterById other) { *

Domain ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public AculDomainFilterById build() { return new AculDomainFilterById(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java index da5713108..dc6d6b579 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculDomainFilterByMetadata.java @@ -34,7 +34,7 @@ public Map getMetadata() { return metadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculDomainFilterByMetadata && equalTo((AculDomainFilterByMetadata) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculDomainFilterByMetadata other) { return metadata.equals(other.metadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.metadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculFilters.java b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java index 3498dd672..17818338d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculFilters.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculFilters.java @@ -73,7 +73,7 @@ public Optional> getDomains() { return domains; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculFilters && equalTo((AculFilters) other); @@ -91,12 +91,12 @@ private boolean equalTo(AculFilters other) { && domains.equals(other.domains); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.matchType, this.clients, this.organizations, this.domains); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java index d2fd1c82e..f7f55a362 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculHeadTag.java @@ -57,7 +57,7 @@ public Optional getContent() { return content; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculHeadTag && equalTo((AculHeadTag) other); @@ -72,12 +72,12 @@ private boolean equalTo(AculHeadTag other) { return tag.equals(other.tag) && attributes.equals(other.attributes) && content.equals(other.content); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tag, this.attributes, this.content); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java index 444e413b9..2166f0615 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculMatchTypeEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AculMatchTypeEnum && this.string.equals(((AculMatchTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java index c6e795a06..141029bd8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilter.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculOrganizationFilter && equalTo((AculOrganizationFilter) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculOrganizationFilter other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer super(AculOrganizationFilter.class); } - @Override + @java.lang.Override public AculOrganizationFilter deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java index 9344a5ceb..8463d0302 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterById.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculOrganizationFilterById && equalTo((AculOrganizationFilterById) other); @@ -51,12 +51,12 @@ private boolean equalTo(AculOrganizationFilterById other) { return id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AculOrganizationFilterById other) { id(other.getId()); return this; @@ -98,14 +98,14 @@ public Builder from(AculOrganizationFilterById other) { *

Organization ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public AculOrganizationFilterById build() { return new AculOrganizationFilterById(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java index 3117b771e..9f03d014e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculOrganizationFilterByMetadata.java @@ -34,7 +34,7 @@ public Map getMetadata() { return metadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculOrganizationFilterByMetadata && equalTo((AculOrganizationFilterByMetadata) other); @@ -49,12 +49,12 @@ private boolean equalTo(AculOrganizationFilterByMetadata other) { return metadata.equals(other.metadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.metadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java index 6d9f14e1e..4bd2304b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculRenderingModeEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AculRenderingModeEnum && this.string.equals(((AculRenderingModeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java index 909b97eaf..1d0c7a89b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AculResponseContent.java @@ -127,7 +127,7 @@ private OptionalNullable _getFilters() { return filters; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AculResponseContent && equalTo((AculResponseContent) other); @@ -147,7 +147,7 @@ private boolean equalTo(AculResponseContent other) { && filters.equals(other.filters); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.renderingMode, @@ -158,7 +158,7 @@ public int hashCode() { this.filters); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java index 397d165f4..b8d28eec8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AddOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AddOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(AddOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java index 3baba26fb..170d20fbb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AssociateOrganizationClientGrantResponseContent.java @@ -97,7 +97,7 @@ public Optional getAllowAnyOrganization() { return allowAnyOrganization; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssociateOrganizationClientGrantResponseContent @@ -118,13 +118,13 @@ private boolean equalTo(AssociateOrganizationClientGrantResponseContent other) { && allowAnyOrganization.equals(other.allowAnyOrganization); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java b/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java index 2482ba388..84d74919d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AsyncApprovalNotificationsChannelsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AsyncApprovalNotificationsChannelsEnum && this.string.equals(((AsyncApprovalNotificationsChannelsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java index bf1cb69b0..e8b8ceee1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaArkoseResponseContent.java @@ -75,7 +75,7 @@ public Optional getVerifySubdomain() { return verifySubdomain; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaArkoseResponseContent @@ -94,12 +94,12 @@ private boolean equalTo(AttackProtectionCaptchaArkoseResponseContent other) { && verifySubdomain.equals(other.verifySubdomain); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.failOpen, this.clientSubdomain, this.verifySubdomain); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java index aac4e1307..040e95363 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeRequest.java @@ -35,7 +35,7 @@ public boolean getFailOpen() { return failOpen; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaAuthChallengeRequest @@ -51,12 +51,12 @@ private boolean equalTo(AttackProtectionCaptchaAuthChallengeRequest other) { return failOpen == other.failOpen; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.failOpen); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements FailOpenStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionCaptchaAuthChallengeRequest other) { failOpen(other.getFailOpen()); return this; @@ -98,14 +98,14 @@ public Builder from(AttackProtectionCaptchaAuthChallengeRequest other) { *

Whether the auth challenge should fail open.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("fail_open") public _FinalStage failOpen(boolean failOpen) { this.failOpen = failOpen; return this; } - @Override + @java.lang.Override public AttackProtectionCaptchaAuthChallengeRequest build() { return new AttackProtectionCaptchaAuthChallengeRequest(failOpen, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java index 2bf45bcb3..cfd7fc991 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaAuthChallengeResponseContent.java @@ -38,7 +38,7 @@ public Optional getFailOpen() { return failOpen; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaAuthChallengeResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(AttackProtectionCaptchaAuthChallengeResponseContent othe return failOpen.equals(other.failOpen); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.failOpen); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java index d25a5a77e..1fe824f41 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaFriendlyCaptchaResponseContent.java @@ -38,7 +38,7 @@ public Optional getSiteKey() { return siteKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaFriendlyCaptchaResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(AttackProtectionCaptchaFriendlyCaptchaResponseContent ot return siteKey.equals(other.siteKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java index 579a75ca2..e77765a21 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaHcaptchaResponseContent.java @@ -38,7 +38,7 @@ public Optional getSiteKey() { return siteKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaHcaptchaResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(AttackProtectionCaptchaHcaptchaResponseContent other) { return siteKey.equals(other.siteKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java index 3ec0a22eb..d794d09e8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaProviderId.java @@ -41,20 +41,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AttackProtectionCaptchaProviderId && this.string.equals(((AttackProtectionCaptchaProviderId) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java index 1f17bee41..0c0c64614 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaEnterpriseResponseContent.java @@ -49,7 +49,7 @@ public Optional getProjectId() { return projectId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaRecaptchaEnterpriseResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(AttackProtectionCaptchaRecaptchaEnterpriseResponseConten return siteKey.equals(other.siteKey) && projectId.equals(other.projectId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.projectId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java index 9ac37663c..6291153df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionCaptchaRecaptchaV2ResponseContent.java @@ -38,7 +38,7 @@ public Optional getSiteKey() { return siteKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionCaptchaRecaptchaV2ResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(AttackProtectionCaptchaRecaptchaV2ResponseContent other) return siteKey.equals(other.siteKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java index ba7fb17ce..5de31a941 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaArkose.java @@ -88,7 +88,7 @@ public Optional getFailOpen() { return failOpen; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionUpdateCaptchaArkose @@ -108,12 +108,12 @@ private boolean equalTo(AttackProtectionUpdateCaptchaArkose other) { && failOpen.equals(other.failOpen); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.secret, this.clientSubdomain, this.verifySubdomain, this.failOpen); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -180,7 +180,7 @@ public static final class Builder implements SiteKeyStage, SecretStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionUpdateCaptchaArkose other) { siteKey(other.getSiteKey()); secret(other.getSecret()); @@ -195,7 +195,7 @@ public Builder from(AttackProtectionUpdateCaptchaArkose other) { *

The site key for the Arkose captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("site_key") public SecretStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); @@ -207,7 +207,7 @@ public SecretStage siteKey(@NotNull String siteKey) { *

The secret key for the Arkose captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); @@ -218,7 +218,7 @@ public _FinalStage secret(@NotNull String secret) { *

Whether the captcha should fail open.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage failOpen(Boolean failOpen) { this.failOpen = Optional.ofNullable(failOpen); return this; @@ -227,7 +227,7 @@ public _FinalStage failOpen(Boolean failOpen) { /** *

Whether the captcha should fail open.

*/ - @Override + @java.lang.Override @JsonSetter(value = "fail_open", nulls = Nulls.SKIP) public _FinalStage failOpen(Optional failOpen) { this.failOpen = failOpen; @@ -238,7 +238,7 @@ public _FinalStage failOpen(Optional failOpen) { *

The subdomain used for server-side verification requests to the Arkose captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage verifySubdomain(String verifySubdomain) { this.verifySubdomain = Optional.ofNullable(verifySubdomain); return this; @@ -247,7 +247,7 @@ public _FinalStage verifySubdomain(String verifySubdomain) { /** *

The subdomain used for server-side verification requests to the Arkose captcha provider.

*/ - @Override + @java.lang.Override @JsonSetter(value = "verify_subdomain", nulls = Nulls.SKIP) public _FinalStage verifySubdomain(Optional verifySubdomain) { this.verifySubdomain = verifySubdomain; @@ -258,7 +258,7 @@ public _FinalStage verifySubdomain(Optional verifySubdomain) { *

The subdomain used for client requests to the Arkose captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage clientSubdomain(String clientSubdomain) { this.clientSubdomain = Optional.ofNullable(clientSubdomain); return this; @@ -267,14 +267,14 @@ public _FinalStage clientSubdomain(String clientSubdomain) { /** *

The subdomain used for client requests to the Arkose captcha provider.

*/ - @Override + @java.lang.Override @JsonSetter(value = "client_subdomain", nulls = Nulls.SKIP) public _FinalStage clientSubdomain(Optional clientSubdomain) { this.clientSubdomain = clientSubdomain; return this; } - @Override + @java.lang.Override public AttackProtectionUpdateCaptchaArkose build() { return new AttackProtectionUpdateCaptchaArkose( siteKey, secret, clientSubdomain, verifySubdomain, failOpen, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java index 53572db51..f3d194749 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaFriendlyCaptcha.java @@ -48,7 +48,7 @@ public String getSecret() { return secret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionUpdateCaptchaFriendlyCaptcha @@ -64,12 +64,12 @@ private boolean equalTo(AttackProtectionUpdateCaptchaFriendlyCaptcha other) { return siteKey.equals(other.siteKey) && secret.equals(other.secret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.secret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements SiteKeyStage, SecretStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionUpdateCaptchaFriendlyCaptcha other) { siteKey(other.getSiteKey()); secret(other.getSecret()); @@ -121,7 +121,7 @@ public Builder from(AttackProtectionUpdateCaptchaFriendlyCaptcha other) { *

The site key for the Friendly Captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("site_key") public SecretStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); @@ -133,14 +133,14 @@ public SecretStage siteKey(@NotNull String siteKey) { *

The secret key for the Friendly Captcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); return this; } - @Override + @java.lang.Override public AttackProtectionUpdateCaptchaFriendlyCaptcha build() { return new AttackProtectionUpdateCaptchaFriendlyCaptcha(siteKey, secret, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java index d91378e20..dbfc6c94a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaHcaptcha.java @@ -48,7 +48,7 @@ public String getSecret() { return secret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionUpdateCaptchaHcaptcha @@ -64,12 +64,12 @@ private boolean equalTo(AttackProtectionUpdateCaptchaHcaptcha other) { return siteKey.equals(other.siteKey) && secret.equals(other.secret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.secret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements SiteKeyStage, SecretStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionUpdateCaptchaHcaptcha other) { siteKey(other.getSiteKey()); secret(other.getSecret()); @@ -121,7 +121,7 @@ public Builder from(AttackProtectionUpdateCaptchaHcaptcha other) { *

The site key for the hCaptcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("site_key") public SecretStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); @@ -133,14 +133,14 @@ public SecretStage siteKey(@NotNull String siteKey) { *

The secret key for the hCaptcha provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); return this; } - @Override + @java.lang.Override public AttackProtectionUpdateCaptchaHcaptcha build() { return new AttackProtectionUpdateCaptchaHcaptcha(siteKey, secret, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java index 8533345a2..b58eb78a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaEnterprise.java @@ -59,7 +59,7 @@ public String getProjectId() { return projectId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionUpdateCaptchaRecaptchaEnterprise @@ -75,12 +75,12 @@ private boolean equalTo(AttackProtectionUpdateCaptchaRecaptchaEnterprise other) return siteKey.equals(other.siteKey) && apiKey.equals(other.apiKey) && projectId.equals(other.projectId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.apiKey, this.projectId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -129,7 +129,7 @@ public static final class Builder implements SiteKeyStage, ApiKeyStage, ProjectI private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionUpdateCaptchaRecaptchaEnterprise other) { siteKey(other.getSiteKey()); apiKey(other.getApiKey()); @@ -142,7 +142,7 @@ public Builder from(AttackProtectionUpdateCaptchaRecaptchaEnterprise other) { *

The site key for the reCAPTCHA Enterprise provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("site_key") public ApiKeyStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); @@ -154,7 +154,7 @@ public ApiKeyStage siteKey(@NotNull String siteKey) { *

The API key for the reCAPTCHA Enterprise provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("api_key") public ProjectIdStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); @@ -166,14 +166,14 @@ public ProjectIdStage apiKey(@NotNull String apiKey) { *

The project ID for the reCAPTCHA Enterprise provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("project_id") public _FinalStage projectId(@NotNull String projectId) { this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); return this; } - @Override + @java.lang.Override public AttackProtectionUpdateCaptchaRecaptchaEnterprise build() { return new AttackProtectionUpdateCaptchaRecaptchaEnterprise( siteKey, apiKey, projectId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java index 475a20b8c..3fcc85181 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java +++ b/src/main/java/com/auth0/client/mgmt/types/AttackProtectionUpdateCaptchaRecaptchaV2.java @@ -48,7 +48,7 @@ public String getSecret() { return secret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AttackProtectionUpdateCaptchaRecaptchaV2 @@ -64,12 +64,12 @@ private boolean equalTo(AttackProtectionUpdateCaptchaRecaptchaV2 other) { return siteKey.equals(other.siteKey) && secret.equals(other.secret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.secret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements SiteKeyStage, SecretStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(AttackProtectionUpdateCaptchaRecaptchaV2 other) { siteKey(other.getSiteKey()); secret(other.getSecret()); @@ -121,7 +121,7 @@ public Builder from(AttackProtectionUpdateCaptchaRecaptchaV2 other) { *

The site key for the reCAPTCHA v2 provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("site_key") public SecretStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); @@ -133,14 +133,14 @@ public SecretStage siteKey(@NotNull String siteKey) { *

The secret key for the reCAPTCHA v2 provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); return this; } - @Override + @java.lang.Override public AttackProtectionUpdateCaptchaRecaptchaV2 build() { return new AttackProtectionUpdateCaptchaRecaptchaV2(siteKey, secret, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java index 86fe4e1ea..57756fa60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationMethodTypeEnum.java @@ -49,20 +49,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AuthenticationMethodTypeEnum && this.string.equals(((AuthenticationMethodTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java index 337947d34..432c4403f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/AuthenticationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof AuthenticationTypeEnum && this.string.equals(((AuthenticationTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java index 2030a069f..c7b28b0f0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordFlowEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BotDetectionChallengePolicyPasswordFlowEnum && this.string.equals(((BotDetectionChallengePolicyPasswordFlowEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java index 464d1fc6f..2adda5d6a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordResetFlowEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BotDetectionChallengePolicyPasswordResetFlowEnum && this.string.equals(((BotDetectionChallengePolicyPasswordResetFlowEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java index 627ec5168..cdb4d2740 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionChallengePolicyPasswordlessFlowEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BotDetectionChallengePolicyPasswordlessFlowEnum && this.string.equals(((BotDetectionChallengePolicyPasswordlessFlowEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java index 0db7551bd..c2da1fff4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BotDetectionLevelEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BotDetectionLevelEnum && this.string.equals(((BotDetectionLevelEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java index 9425f4bcb..b8c8027b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingColors.java @@ -48,7 +48,7 @@ public Optional getPageBackground() { return pageBackground; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingColors && equalTo((BrandingColors) other); @@ -63,12 +63,12 @@ private boolean equalTo(BrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java index ac35045d9..4aae99c01 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingFont.java @@ -37,7 +37,7 @@ public Optional getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingFont && equalTo((BrandingFont) other); @@ -52,12 +52,12 @@ private boolean equalTo(BrandingFont other) { return url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java index cbc9c2974..d8e3bf912 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingPageBackground.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingPageBackground && equalTo((BrandingPageBackground) other); @@ -53,12 +53,12 @@ private boolean equalTo(BrandingPageBackground other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -83,7 +83,7 @@ static final class Deserializer extends StdDeserializer super(BrandingPageBackground.class); } - @Override + @java.lang.Override public BrandingPageBackground deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java index 741a07bb9..ef00067ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBorders.java @@ -128,7 +128,7 @@ public double getWidgetCornerRadius() { return widgetCornerRadius; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeBorders && equalTo((BrandingThemeBorders) other); @@ -151,7 +151,7 @@ private boolean equalTo(BrandingThemeBorders other) { && widgetCornerRadius == other.widgetCornerRadius; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.buttonBorderRadius, @@ -165,7 +165,7 @@ public int hashCode() { this.widgetCornerRadius); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -272,7 +272,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeBorders other) { buttonBorderRadius(other.getButtonBorderRadius()); buttonBorderWeight(other.getButtonBorderWeight()); @@ -291,7 +291,7 @@ public Builder from(BrandingThemeBorders other) { *

Button border radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("button_border_radius") public ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius) { this.buttonBorderRadius = buttonBorderRadius; @@ -303,14 +303,14 @@ public ButtonBorderWeightStage buttonBorderRadius(double buttonBorderRadius) { *

Button border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("button_border_weight") public ButtonsStyleStage buttonBorderWeight(double buttonBorderWeight) { this.buttonBorderWeight = buttonBorderWeight; return this; } - @Override + @java.lang.Override @JsonSetter("buttons_style") public InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsStyleEnum buttonsStyle) { this.buttonsStyle = Objects.requireNonNull(buttonsStyle, "buttonsStyle must not be null"); @@ -322,7 +322,7 @@ public InputBorderRadiusStage buttonsStyle(@NotNull BrandingThemeBordersButtonsS *

Input border radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_border_radius") public InputBorderWeightStage inputBorderRadius(double inputBorderRadius) { this.inputBorderRadius = inputBorderRadius; @@ -334,14 +334,14 @@ public InputBorderWeightStage inputBorderRadius(double inputBorderRadius) { *

Input border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_border_weight") public InputsStyleStage inputBorderWeight(double inputBorderWeight) { this.inputBorderWeight = inputBorderWeight; return this; } - @Override + @java.lang.Override @JsonSetter("inputs_style") public ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyleEnum inputsStyle) { this.inputsStyle = Objects.requireNonNull(inputsStyle, "inputsStyle must not be null"); @@ -353,7 +353,7 @@ public ShowWidgetShadowStage inputsStyle(@NotNull BrandingThemeBordersInputsStyl *

Show widget shadow

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("show_widget_shadow") public WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow) { this.showWidgetShadow = showWidgetShadow; @@ -365,7 +365,7 @@ public WidgetBorderWeightStage showWidgetShadow(boolean showWidgetShadow) { *

Widget border weight

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("widget_border_weight") public WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight) { this.widgetBorderWeight = widgetBorderWeight; @@ -377,14 +377,14 @@ public WidgetCornerRadiusStage widgetBorderWeight(double widgetBorderWeight) { *

Widget corner radius

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("widget_corner_radius") public _FinalStage widgetCornerRadius(double widgetCornerRadius) { this.widgetCornerRadius = widgetCornerRadius; return this; } - @Override + @java.lang.Override public BrandingThemeBorders build() { return new BrandingThemeBorders( buttonBorderRadius, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java index 7792ecdfe..0b79c632a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersButtonsStyleEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeBordersButtonsStyleEnum && this.string.equals(((BrandingThemeBordersButtonsStyleEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java index fcfe9b1b0..f100e8fe6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeBordersInputsStyleEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeBordersInputsStyleEnum && this.string.equals(((BrandingThemeBordersInputsStyleEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java index 2e3ca6ff9..141a2ce34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColors.java @@ -265,7 +265,7 @@ public String getWidgetBorder() { return widgetBorder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeColors && equalTo((BrandingThemeColors) other); @@ -299,7 +299,7 @@ private boolean equalTo(BrandingThemeColors other) { && widgetBorder.equals(other.widgetBorder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.baseFocusColor, @@ -324,7 +324,7 @@ public int hashCode() { this.widgetBorder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -540,7 +540,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeColors other) { baseFocusColor(other.getBaseFocusColor()); baseHoverColor(other.getBaseHoverColor()); @@ -570,7 +570,7 @@ public Builder from(BrandingThemeColors other) { *

Body text

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("body_text") public ErrorStage bodyText(@NotNull String bodyText) { this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); @@ -582,7 +582,7 @@ public ErrorStage bodyText(@NotNull String bodyText) { *

Error

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("error") public HeaderStage error(@NotNull String error) { this.error = Objects.requireNonNull(error, "error must not be null"); @@ -594,7 +594,7 @@ public HeaderStage error(@NotNull String error) { *

Header

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("header") public IconsStage header(@NotNull String header) { this.header = Objects.requireNonNull(header, "header must not be null"); @@ -606,7 +606,7 @@ public IconsStage header(@NotNull String header) { *

Icons

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("icons") public InputBackgroundStage icons(@NotNull String icons) { this.icons = Objects.requireNonNull(icons, "icons must not be null"); @@ -618,7 +618,7 @@ public InputBackgroundStage icons(@NotNull String icons) { *

Input background

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_background") public InputBorderStage inputBackground(@NotNull String inputBackground) { this.inputBackground = Objects.requireNonNull(inputBackground, "inputBackground must not be null"); @@ -630,7 +630,7 @@ public InputBorderStage inputBackground(@NotNull String inputBackground) { *

Input border

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_border") public InputFilledTextStage inputBorder(@NotNull String inputBorder) { this.inputBorder = Objects.requireNonNull(inputBorder, "inputBorder must not be null"); @@ -642,7 +642,7 @@ public InputFilledTextStage inputBorder(@NotNull String inputBorder) { *

Input filled text

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_filled_text") public InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledText) { this.inputFilledText = Objects.requireNonNull(inputFilledText, "inputFilledText must not be null"); @@ -654,7 +654,7 @@ public InputLabelsPlaceholdersStage inputFilledText(@NotNull String inputFilledT *

Input labels & placeholders

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("input_labels_placeholders") public LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String inputLabelsPlaceholders) { this.inputLabelsPlaceholders = @@ -667,7 +667,7 @@ public LinksFocusedComponentsStage inputLabelsPlaceholders(@NotNull String input *

Links & focused components

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("links_focused_components") public PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedComponents) { this.linksFocusedComponents = @@ -680,7 +680,7 @@ public PrimaryButtonStage linksFocusedComponents(@NotNull String linksFocusedCom *

Primary button

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary_button") public PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton) { this.primaryButton = Objects.requireNonNull(primaryButton, "primaryButton must not be null"); @@ -692,7 +692,7 @@ public PrimaryButtonLabelStage primaryButton(@NotNull String primaryButton) { *

Primary button label

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary_button_label") public SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButtonLabel) { this.primaryButtonLabel = Objects.requireNonNull(primaryButtonLabel, "primaryButtonLabel must not be null"); @@ -704,7 +704,7 @@ public SecondaryButtonBorderStage primaryButtonLabel(@NotNull String primaryButt *

Secondary button border

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secondary_button_border") public SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondaryButtonBorder) { this.secondaryButtonBorder = @@ -717,7 +717,7 @@ public SecondaryButtonLabelStage secondaryButtonBorder(@NotNull String secondary *

Secondary button label

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secondary_button_label") public SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel) { this.secondaryButtonLabel = @@ -730,7 +730,7 @@ public SuccessStage secondaryButtonLabel(@NotNull String secondaryButtonLabel) { *

Success

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("success") public WidgetBackgroundStage success(@NotNull String success) { this.success = Objects.requireNonNull(success, "success must not be null"); @@ -742,7 +742,7 @@ public WidgetBackgroundStage success(@NotNull String success) { *

Widget background

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("widget_background") public WidgetBorderStage widgetBackground(@NotNull String widgetBackground) { this.widgetBackground = Objects.requireNonNull(widgetBackground, "widgetBackground must not be null"); @@ -754,7 +754,7 @@ public WidgetBorderStage widgetBackground(@NotNull String widgetBackground) { *

Widget border

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("widget_border") public _FinalStage widgetBorder(@NotNull String widgetBorder) { this.widgetBorder = Objects.requireNonNull(widgetBorder, "widgetBorder must not be null"); @@ -765,7 +765,7 @@ public _FinalStage widgetBorder(@NotNull String widgetBorder) { *

Read only background

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage readOnlyBackground(String readOnlyBackground) { this.readOnlyBackground = Optional.ofNullable(readOnlyBackground); return this; @@ -774,20 +774,20 @@ public _FinalStage readOnlyBackground(String readOnlyBackground) { /** *

Read only background

*/ - @Override + @java.lang.Override @JsonSetter(value = "read_only_background", nulls = Nulls.SKIP) public _FinalStage readOnlyBackground(Optional readOnlyBackground) { this.readOnlyBackground = readOnlyBackground; return this; } - @Override + @java.lang.Override public _FinalStage captchaWidgetTheme(BrandingThemeColorsCaptchaWidgetThemeEnum captchaWidgetTheme) { this.captchaWidgetTheme = Optional.ofNullable(captchaWidgetTheme); return this; } - @Override + @java.lang.Override @JsonSetter(value = "captcha_widget_theme", nulls = Nulls.SKIP) public _FinalStage captchaWidgetTheme(Optional captchaWidgetTheme) { this.captchaWidgetTheme = captchaWidgetTheme; @@ -798,7 +798,7 @@ public _FinalStage captchaWidgetTheme(OptionalBase Hover Color

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage baseHoverColor(String baseHoverColor) { this.baseHoverColor = Optional.ofNullable(baseHoverColor); return this; @@ -807,7 +807,7 @@ public _FinalStage baseHoverColor(String baseHoverColor) { /** *

Base Hover Color

*/ - @Override + @java.lang.Override @JsonSetter(value = "base_hover_color", nulls = Nulls.SKIP) public _FinalStage baseHoverColor(Optional baseHoverColor) { this.baseHoverColor = baseHoverColor; @@ -818,7 +818,7 @@ public _FinalStage baseHoverColor(Optional baseHoverColor) { *

Base Focus Color

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage baseFocusColor(String baseFocusColor) { this.baseFocusColor = Optional.ofNullable(baseFocusColor); return this; @@ -827,14 +827,14 @@ public _FinalStage baseFocusColor(String baseFocusColor) { /** *

Base Focus Color

*/ - @Override + @java.lang.Override @JsonSetter(value = "base_focus_color", nulls = Nulls.SKIP) public _FinalStage baseFocusColor(Optional baseFocusColor) { this.baseFocusColor = baseFocusColor; return this; } - @Override + @java.lang.Override public BrandingThemeColors build() { return new BrandingThemeColors( baseFocusColor, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java index 346db2e63..2fe77ddab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeColorsCaptchaWidgetThemeEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeColorsCaptchaWidgetThemeEnum && this.string.equals(((BrandingThemeColorsCaptchaWidgetThemeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java index bd8e8f842..8f8c99d0d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontBodyText.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontBodyText && equalTo((BrandingThemeFontBodyText) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontBodyText other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontBodyText other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontBodyText other) { *

Body text bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Body text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontBodyText build() { return new BrandingThemeFontBodyText(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java index 8e013332b..71b1c2355 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontButtonsText.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontButtonsText && equalTo((BrandingThemeFontButtonsText) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontButtonsText other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontButtonsText other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontButtonsText other) { *

Buttons text bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Buttons text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontButtonsText build() { return new BrandingThemeFontButtonsText(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java index 79ebfcef5..b29399903 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontInputLabels.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontInputLabels && equalTo((BrandingThemeFontInputLabels) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontInputLabels other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontInputLabels other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontInputLabels other) { *

Input Labels bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Input Labels size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontInputLabels build() { return new BrandingThemeFontInputLabels(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java index 26d17262a..2d0535c8f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinks.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontLinks && equalTo((BrandingThemeFontLinks) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontLinks other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontLinks other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontLinks other) { *

Links bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Links size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontLinks build() { return new BrandingThemeFontLinks(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java index 60a270d53..ff7178577 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontLinksStyleEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeFontLinksStyleEnum && this.string.equals(((BrandingThemeFontLinksStyleEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java index 5022d48ce..a665fc7d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontSubtitle.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontSubtitle && equalTo((BrandingThemeFontSubtitle) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontSubtitle other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontSubtitle other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontSubtitle other) { *

Subtitle bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Subtitle size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontSubtitle build() { return new BrandingThemeFontSubtitle(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java index 5eeba410b..3e39a7c76 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFontTitle.java @@ -46,7 +46,7 @@ public double getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFontTitle && equalTo((BrandingThemeFontTitle) other); @@ -61,12 +61,12 @@ private boolean equalTo(BrandingThemeFontTitle other) { return bold == other.bold && size == other.size; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bold, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -106,7 +106,7 @@ public static final class Builder implements BoldStage, SizeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFontTitle other) { bold(other.getBold()); size(other.getSize()); @@ -118,7 +118,7 @@ public Builder from(BrandingThemeFontTitle other) { *

Title bold

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("bold") public SizeStage bold(boolean bold) { this.bold = bold; @@ -130,14 +130,14 @@ public SizeStage bold(boolean bold) { *

Title size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("size") public _FinalStage size(double size) { this.size = size; return this; } - @Override + @java.lang.Override public BrandingThemeFontTitle build() { return new BrandingThemeFontTitle(bold, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java index d4c6ade06..675546673 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeFonts.java @@ -113,7 +113,7 @@ public BrandingThemeFontTitle getTitle() { return title; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeFonts && equalTo((BrandingThemeFonts) other); @@ -136,7 +136,7 @@ private boolean equalTo(BrandingThemeFonts other) { && title.equals(other.title); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.bodyText, @@ -150,7 +150,7 @@ public int hashCode() { this.title); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -242,7 +242,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeFonts other) { bodyText(other.getBodyText()); buttonsText(other.getButtonsText()); @@ -256,14 +256,14 @@ public Builder from(BrandingThemeFonts other) { return this; } - @Override + @java.lang.Override @JsonSetter("body_text") public ButtonsTextStage bodyText(@NotNull BrandingThemeFontBodyText bodyText) { this.bodyText = Objects.requireNonNull(bodyText, "bodyText must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("buttons_text") public FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsText) { this.buttonsText = Objects.requireNonNull(buttonsText, "buttonsText must not be null"); @@ -275,28 +275,28 @@ public FontUrlStage buttonsText(@NotNull BrandingThemeFontButtonsText buttonsTex *

Font URL

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("font_url") public InputLabelsStage fontUrl(@NotNull String fontUrl) { this.fontUrl = Objects.requireNonNull(fontUrl, "fontUrl must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("input_labels") public LinksStage inputLabels(@NotNull BrandingThemeFontInputLabels inputLabels) { this.inputLabels = Objects.requireNonNull(inputLabels, "inputLabels must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("links") public LinksStyleStage links(@NotNull BrandingThemeFontLinks links) { this.links = Objects.requireNonNull(links, "links must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("links_style") public ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnum linksStyle) { this.linksStyle = Objects.requireNonNull(linksStyle, "linksStyle must not be null"); @@ -308,28 +308,28 @@ public ReferenceTextSizeStage linksStyle(@NotNull BrandingThemeFontLinksStyleEnu *

Reference text size

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("reference_text_size") public SubtitleStage referenceTextSize(double referenceTextSize) { this.referenceTextSize = referenceTextSize; return this; } - @Override + @java.lang.Override @JsonSetter("subtitle") public TitleStage subtitle(@NotNull BrandingThemeFontSubtitle subtitle) { this.subtitle = Objects.requireNonNull(subtitle, "subtitle must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("title") public _FinalStage title(@NotNull BrandingThemeFontTitle title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @Override + @java.lang.Override public BrandingThemeFonts build() { return new BrandingThemeFonts( bodyText, diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java index 1b776fede..d3f95c3c6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackground.java @@ -59,7 +59,7 @@ public BrandingThemePageBackgroundPageLayoutEnum getPageLayout() { return pageLayout; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemePageBackground && equalTo((BrandingThemePageBackground) other); @@ -76,12 +76,12 @@ private boolean equalTo(BrandingThemePageBackground other) { && pageLayout.equals(other.pageLayout); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.backgroundColor, this.backgroundImageUrl, this.pageLayout); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemePageBackground other) { backgroundColor(other.getBackgroundColor()); backgroundImageUrl(other.getBackgroundImageUrl()); @@ -141,7 +141,7 @@ public Builder from(BrandingThemePageBackground other) { *

Background color

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("background_color") public BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor) { this.backgroundColor = Objects.requireNonNull(backgroundColor, "backgroundColor must not be null"); @@ -153,21 +153,21 @@ public BackgroundImageUrlStage backgroundColor(@NotNull String backgroundColor) *

Background image url

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("background_image_url") public PageLayoutStage backgroundImageUrl(@NotNull String backgroundImageUrl) { this.backgroundImageUrl = Objects.requireNonNull(backgroundImageUrl, "backgroundImageUrl must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_layout") public _FinalStage pageLayout(@NotNull BrandingThemePageBackgroundPageLayoutEnum pageLayout) { this.pageLayout = Objects.requireNonNull(pageLayout, "pageLayout must not be null"); return this; } - @Override + @java.lang.Override public BrandingThemePageBackground build() { return new BrandingThemePageBackground( backgroundColor, backgroundImageUrl, pageLayout, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java index a9a23587c..ac0e87288 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemePageBackgroundPageLayoutEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemePageBackgroundPageLayoutEnum && this.string.equals(((BrandingThemePageBackgroundPageLayoutEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java index 5119563ab..199927eab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidget.java @@ -77,7 +77,7 @@ public BrandingThemeWidgetSocialButtonsLayoutEnum getSocialButtonsLayout() { return socialButtonsLayout; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BrandingThemeWidget && equalTo((BrandingThemeWidget) other); @@ -96,13 +96,13 @@ private boolean equalTo(BrandingThemeWidget other) { && socialButtonsLayout.equals(other.socialButtonsLayout); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.headerTextAlignment, this.logoHeight, this.logoPosition, this.logoUrl, this.socialButtonsLayout); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +166,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(BrandingThemeWidget other) { headerTextAlignment(other.getHeaderTextAlignment()); logoHeight(other.getLogoHeight()); @@ -176,7 +176,7 @@ public Builder from(BrandingThemeWidget other) { return this; } - @Override + @java.lang.Override @JsonSetter("header_text_alignment") public LogoHeightStage headerTextAlignment( @NotNull BrandingThemeWidgetHeaderTextAlignmentEnum headerTextAlignment) { @@ -190,14 +190,14 @@ public LogoHeightStage headerTextAlignment( *

Logo height

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("logo_height") public LogoPositionStage logoHeight(double logoHeight) { this.logoHeight = logoHeight; return this; } - @Override + @java.lang.Override @JsonSetter("logo_position") public LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum logoPosition) { this.logoPosition = Objects.requireNonNull(logoPosition, "logoPosition must not be null"); @@ -209,14 +209,14 @@ public LogoUrlStage logoPosition(@NotNull BrandingThemeWidgetLogoPositionEnum lo *

Logo url

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("logo_url") public SocialButtonsLayoutStage logoUrl(@NotNull String logoUrl) { this.logoUrl = Objects.requireNonNull(logoUrl, "logoUrl must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("social_buttons_layout") public _FinalStage socialButtonsLayout( @NotNull BrandingThemeWidgetSocialButtonsLayoutEnum socialButtonsLayout) { @@ -225,7 +225,7 @@ public _FinalStage socialButtonsLayout( return this; } - @Override + @java.lang.Override public BrandingThemeWidget build() { return new BrandingThemeWidget( headerTextAlignment, logoHeight, logoPosition, logoUrl, socialButtonsLayout, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java index 92dbe2900..10afdefac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetHeaderTextAlignmentEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetHeaderTextAlignmentEnum && this.string.equals(((BrandingThemeWidgetHeaderTextAlignmentEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java index 9f01327eb..bb576015f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetLogoPositionEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetLogoPositionEnum && this.string.equals(((BrandingThemeWidgetLogoPositionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java index 6a5e33959..376714c06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BrandingThemeWidgetSocialButtonsLayoutEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BrandingThemeWidgetSocialButtonsLayoutEnum && this.string.equals(((BrandingThemeWidgetSocialButtonsLayoutEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java index 10011b149..2ad53e7c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionAdminNotificationFrequencyEnum.java @@ -32,13 +32,13 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionAdminNotificationFrequencyEnum @@ -46,7 +46,7 @@ public boolean equals(Object other) { ((BreachedPasswordDetectionAdminNotificationFrequencyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java index 79e99b1cc..ba87e9cc5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionMethodEnum && this.string.equals(((BreachedPasswordDetectionMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java index 678c81595..cdb88a9fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordShieldsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionPreChangePasswordShieldsEnum && this.string.equals(((BreachedPasswordDetectionPreChangePasswordShieldsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java index 84b1e505f..e53ada446 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreChangePasswordStage.java @@ -41,7 +41,7 @@ public Optional> get return shields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionPreChangePasswordStage @@ -57,12 +57,12 @@ private boolean equalTo(BreachedPasswordDetectionPreChangePasswordStage other) { return shields.equals(other.shields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.shields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java index aa5e8a639..8cf2aa464 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationShieldsEnum.java @@ -26,13 +26,13 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionPreUserRegistrationShieldsEnum @@ -40,7 +40,7 @@ public boolean equals(Object other) { ((BreachedPasswordDetectionPreUserRegistrationShieldsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java index 465fe7092..27b56006d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionPreUserRegistrationStage.java @@ -41,7 +41,7 @@ public Optional> g return shields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionPreUserRegistrationStage @@ -57,12 +57,12 @@ private boolean equalTo(BreachedPasswordDetectionPreUserRegistrationStage other) return shields.equals(other.shields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.shields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java index be53e071c..4b24df30e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionShieldsEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof BreachedPasswordDetectionShieldsEnum && this.string.equals(((BreachedPasswordDetectionShieldsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java index 6d317b671..c8fae44dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/BreachedPasswordDetectionStage.java @@ -45,7 +45,7 @@ public Optional getPreChangePas return preChangePassword; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BreachedPasswordDetectionStage && equalTo((BreachedPasswordDetectionStage) other); @@ -61,12 +61,12 @@ private boolean equalTo(BreachedPasswordDetectionStage other) { && preChangePassword.equals(other.preChangePassword); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.preUserRegistration, this.preChangePassword); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java index 6b9f08b36..26fc7d811 100644 --- a/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/BulkUpdateAculResponseContent.java @@ -35,7 +35,7 @@ public List getConfigs() { return configs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof BulkUpdateAculResponseContent && equalTo((BulkUpdateAculResponseContent) other); @@ -50,12 +50,12 @@ private boolean equalTo(BulkUpdateAculResponseContent other) { return configs.equals(other.configs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.configs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java index 595decfa7..8c295ae9f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketIdentity.java @@ -58,7 +58,7 @@ public Optional getConnectionId() { return connectionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ChangePasswordTicketIdentity && equalTo((ChangePasswordTicketIdentity) other); @@ -75,12 +75,12 @@ private boolean equalTo(ChangePasswordTicketIdentity other) { && connectionId.equals(other.connectionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId, this.provider, this.connectionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -126,7 +126,7 @@ public static final class Builder implements UserIdStage, ProviderStage, _FinalS private Builder() {} - @Override + @java.lang.Override public Builder from(ChangePasswordTicketIdentity other) { userId(other.getUserId()); provider(other.getProvider()); @@ -139,14 +139,14 @@ public Builder from(ChangePasswordTicketIdentity other) { *

user_id of the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public ProviderStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull String provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); @@ -157,7 +157,7 @@ public _FinalStage provider(@NotNull String provider) { *

connection_id of the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -166,14 +166,14 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the identity.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @Override + @java.lang.Override public ChangePasswordTicketIdentity build() { return new ChangePasswordTicketIdentity(userId, provider, connectionId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java index 6db02d187..bb8767ea5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketRequestContent.java @@ -144,7 +144,7 @@ public Optional getIdentity() { return identity; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ChangePasswordTicketRequestContent @@ -169,7 +169,7 @@ private boolean equalTo(ChangePasswordTicketRequestContent other) { && identity.equals(other.identity); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.resultUrl, @@ -184,7 +184,7 @@ public int hashCode() { this.identity); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java index 5fca0c4d8..c9075bfd5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ChangePasswordTicketResponseContent.java @@ -36,7 +36,7 @@ public String getTicket() { return ticket; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ChangePasswordTicketResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(ChangePasswordTicketResponseContent other) { return ticket.equals(other.ticket); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ticket); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements TicketStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ChangePasswordTicketResponseContent other) { ticket(other.getTicket()); return this; @@ -99,14 +99,14 @@ public Builder from(ChangePasswordTicketResponseContent other) { *

URL representing the ticket.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ticket") public _FinalStage ticket(@NotNull String ticket) { this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); return this; } - @Override + @java.lang.Override public ChangePasswordTicketResponseContent build() { return new ChangePasswordTicketResponseContent(ticket, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Client.java b/src/main/java/com/auth0/client/mgmt/types/Client.java index 81b3ffa5f..4c1bf94ba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Client.java +++ b/src/main/java/com/auth0/client/mgmt/types/Client.java @@ -676,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Client && equalTo((Client) other); @@ -744,7 +744,7 @@ private boolean equalTo(Client other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -802,7 +802,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java index 762d6a49e..828f875ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAws.java @@ -63,7 +63,7 @@ public Optional getLifetimeInSeconds() { return lifetimeInSeconds; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAws && equalTo((ClientAddonAws) other); @@ -80,12 +80,12 @@ private boolean equalTo(ClientAddonAws other) { && lifetimeInSeconds.equals(other.lifetimeInSeconds); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.principal, this.role, this.lifetimeInSeconds); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java index d8169515c..c194cdf5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureBlob.java @@ -183,7 +183,7 @@ public Optional getContainerList() { return containerList; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAzureBlob && equalTo((ClientAddonAzureBlob) other); @@ -210,7 +210,7 @@ private boolean equalTo(ClientAddonAzureBlob other) { && containerList.equals(other.containerList); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.accountName, @@ -228,7 +228,7 @@ public int hashCode() { this.containerList); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java index 223f6e04e..c1cc286e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonAzureSb.java @@ -87,7 +87,7 @@ public Optional getExpiration() { return expiration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonAzureSb && equalTo((ClientAddonAzureSb) other); @@ -106,12 +106,12 @@ private boolean equalTo(ClientAddonAzureSb other) { && expiration.equals(other.expiration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.namespace, this.sasKeyName, this.sasKey, this.entityPath, this.expiration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java index 807c1f8f2..d014bbe1d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEchoSign.java @@ -37,7 +37,7 @@ public Optional getDomain() { return domain; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonEchoSign && equalTo((ClientAddonEchoSign) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonEchoSign other) { return domain.equals(other.domain); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.domain); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java index ff1845230..9388bb1b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonEgnyte.java @@ -37,7 +37,7 @@ public Optional getDomain() { return domain; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonEgnyte && equalTo((ClientAddonEgnyte) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonEgnyte other) { return domain.equals(other.domain); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.domain); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java index 82db1ae24..12fa19d6b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonFirebase.java @@ -87,7 +87,7 @@ public Optional getLifetimeInSeconds() { return lifetimeInSeconds; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonFirebase && equalTo((ClientAddonFirebase) other); @@ -106,12 +106,12 @@ private boolean equalTo(ClientAddonFirebase other) { && lifetimeInSeconds.equals(other.lifetimeInSeconds); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.secret, this.privateKeyId, this.privateKey, this.clientEmail, this.lifetimeInSeconds); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java index 9e0f08bc7..afd68b398 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonLayer.java @@ -88,7 +88,7 @@ public Optional getExpiration() { return expiration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonLayer && equalTo((ClientAddonLayer) other); @@ -107,12 +107,12 @@ private boolean equalTo(ClientAddonLayer other) { && expiration.equals(other.expiration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.providerId, this.keyId, this.privateKey, this.principal, this.expiration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements ProviderIdStage, KeyIdStage, Privat private Builder() {} - @Override + @java.lang.Override public Builder from(ClientAddonLayer other) { providerId(other.getProviderId()); keyId(other.getKeyId()); @@ -194,7 +194,7 @@ public Builder from(ClientAddonLayer other) { *

Provider ID of your Layer account

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("providerId") public KeyIdStage providerId(@NotNull String providerId) { this.providerId = Objects.requireNonNull(providerId, "providerId must not be null"); @@ -206,7 +206,7 @@ public KeyIdStage providerId(@NotNull String providerId) { *

Authentication Key identifier used to sign the Layer token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("keyId") public PrivateKeyStage keyId(@NotNull String keyId) { this.keyId = Objects.requireNonNull(keyId, "keyId must not be null"); @@ -218,7 +218,7 @@ public PrivateKeyStage keyId(@NotNull String keyId) { *

Private key for signing the Layer token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("privateKey") public _FinalStage privateKey(@NotNull String privateKey) { this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); @@ -229,7 +229,7 @@ public _FinalStage privateKey(@NotNull String privateKey) { *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage expiration(Integer expiration) { this.expiration = Optional.ofNullable(expiration); return this; @@ -238,7 +238,7 @@ public _FinalStage expiration(Integer expiration) { /** *

Optional expiration in minutes for the generated token. Defaults to 5 minutes.

*/ - @Override + @java.lang.Override @JsonSetter(value = "expiration", nulls = Nulls.SKIP) public _FinalStage expiration(Optional expiration) { this.expiration = expiration; @@ -249,7 +249,7 @@ public _FinalStage expiration(Optional expiration) { *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage principal(String principal) { this.principal = Optional.ofNullable(principal); return this; @@ -258,14 +258,14 @@ public _FinalStage principal(String principal) { /** *

Name of the property used as the unique user id in Layer. If not specified user_id is used.

*/ - @Override + @java.lang.Override @JsonSetter(value = "principal", nulls = Nulls.SKIP) public _FinalStage principal(Optional principal) { this.principal = principal; return this; } - @Override + @java.lang.Override public ClientAddonLayer build() { return new ClientAddonLayer(providerId, keyId, privateKey, principal, expiration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java index 154b16009..b611cd19e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonMscrm.java @@ -36,7 +36,7 @@ public String getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonMscrm && equalTo((ClientAddonMscrm) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonMscrm other) { return url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientAddonMscrm other) { url(other.getUrl()); return this; @@ -98,14 +98,14 @@ public Builder from(ClientAddonMscrm other) { *

Microsoft Dynamics CRM application URL.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @Override + @java.lang.Override public ClientAddonMscrm build() { return new ClientAddonMscrm(url, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java index 73272fbc4..0d939500d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonNewRelic.java @@ -37,7 +37,7 @@ public Optional getAccount() { return account; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonNewRelic && equalTo((ClientAddonNewRelic) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonNewRelic other) { return account.equals(other.account); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.account); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java index 5e59dc08b..5e4fdd6e2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOag.java @@ -21,7 +21,7 @@ private ClientAddonOag(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonOag; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java index 111663b7a..e88081415 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonOffice365.java @@ -49,7 +49,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonOffice365 && equalTo((ClientAddonOffice365) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonOffice365 other) { return domain.equals(other.domain) && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.domain, this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java index 559ffc048..64ed5c72a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonRms.java @@ -36,7 +36,7 @@ public String getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonRms && equalTo((ClientAddonRms) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonRms other) { return url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientAddonRms other) { url(other.getUrl()); return this; @@ -98,14 +98,14 @@ public Builder from(ClientAddonRms other) { *

URL of your Rights Management Server. It can be internal or external, but users will have to be able to reach it.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @Override + @java.lang.Override public ClientAddonRms build() { return new ClientAddonRms(url, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java index 163ee48a2..466a4b580 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforce.java @@ -37,7 +37,7 @@ public Optional getEntityId() { return entityId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforce && equalTo((ClientAddonSalesforce) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonSalesforce other) { return entityId.equals(other.entityId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.entityId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java index 23031b2e4..ad2557fff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceApi.java @@ -75,7 +75,7 @@ public Optional getCommunityUrlSection() { return communityUrlSection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforceApi && equalTo((ClientAddonSalesforceApi) other); @@ -93,12 +93,12 @@ private boolean equalTo(ClientAddonSalesforceApi other) { && communityUrlSection.equals(other.communityUrlSection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java index bb1118283..1f331b506 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSalesforceSandboxApi.java @@ -75,7 +75,7 @@ public Optional getCommunityUrlSection() { return communityUrlSection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSalesforceSandboxApi && equalTo((ClientAddonSalesforceSandboxApi) other); @@ -93,12 +93,12 @@ private boolean equalTo(ClientAddonSalesforceSandboxApi other) { && communityUrlSection.equals(other.communityUrlSection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientid, this.principal, this.communityName, this.communityUrlSection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java index 1169eff4d..819d7512f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSaml.java @@ -172,7 +172,7 @@ public Optional getAuthnContextClassRef() { return authnContextClassRef; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSaml && equalTo((ClientAddonSaml) other); @@ -202,7 +202,7 @@ private boolean equalTo(ClientAddonSaml other) { && authnContextClassRef.equals(other.authnContextClassRef); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.mappings, @@ -223,7 +223,7 @@ public int hashCode() { this.authnContextClassRef); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java index 60fe3ca05..22970031e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSapapi.java @@ -99,7 +99,7 @@ public Optional getNameIdentifierFormat() { return nameIdentifierFormat; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSapapi && equalTo((ClientAddonSapapi) other); @@ -119,7 +119,7 @@ private boolean equalTo(ClientAddonSapapi other) { && nameIdentifierFormat.equals(other.nameIdentifierFormat); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientid, @@ -130,7 +130,7 @@ public int hashCode() { this.nameIdentifierFormat); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java index e1cce7083..074a04fe4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSentry.java @@ -49,7 +49,7 @@ public Optional getBaseUrl() { return baseUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSentry && equalTo((ClientAddonSentry) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonSentry other) { return orgSlug.equals(other.orgSlug) && baseUrl.equals(other.baseUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.orgSlug, this.baseUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java index afb4929dd..721234415 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePoint.java @@ -48,7 +48,7 @@ public Optional getExternalUrl() { return externalUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSharePoint && equalTo((ClientAddonSharePoint) other); @@ -63,12 +63,12 @@ private boolean equalTo(ClientAddonSharePoint other) { return url.equals(other.url) && externalUrl.equals(other.externalUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url, this.externalUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java index 5d989d7af..10ef211d9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSharePointExternalUrl.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSharePointExternalUrl && equalTo((ClientAddonSharePointExternalUrl) other); @@ -51,12 +51,12 @@ private boolean equalTo(ClientAddonSharePointExternalUrl other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializerSlack team name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("team") public _FinalStage team(@NotNull String team) { this.team = Objects.requireNonNull(team, "team must not be null"); return this; } - @Override + @java.lang.Override public ClientAddonSlack build() { return new ClientAddonSlack(team, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java index 02ecf2719..006352f1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSpringCm.java @@ -37,7 +37,7 @@ public Optional getAcsurl() { return acsurl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSpringCm && equalTo((ClientAddonSpringCm) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonSpringCm other) { return acsurl.equals(other.acsurl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.acsurl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java index cda17e961..41c6a40e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonSsoIntegration.java @@ -49,7 +49,7 @@ public Optional getVersion() { return version; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonSsoIntegration && equalTo((ClientAddonSsoIntegration) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientAddonSsoIntegration other) { return name.equals(other.name) && version.equals(other.version); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.version); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java index cbc395a4a..f42f26c3c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonWams.java @@ -37,7 +37,7 @@ public Optional getMasterkey() { return masterkey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonWams && equalTo((ClientAddonWams) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonWams other) { return masterkey.equals(other.masterkey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.masterkey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java index 990970b92..820a210e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZendesk.java @@ -37,7 +37,7 @@ public Optional getAccountName() { return accountName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonZendesk && equalTo((ClientAddonZendesk) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonZendesk other) { return accountName.equals(other.accountName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accountName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java index 3bf8cfbd3..b7227fb21 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddonZoom.java @@ -37,7 +37,7 @@ public Optional getAccount() { return account; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddonZoom && equalTo((ClientAddonZoom) other); @@ -52,12 +52,12 @@ private boolean equalTo(ClientAddonZoom other) { return account.equals(other.account); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.account); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java index ce36cf7a6..ef0a3f3cb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAddons.java @@ -310,7 +310,7 @@ private OptionalNullable _getOag() { return oag; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAddons && equalTo((ClientAddons) other); @@ -354,7 +354,7 @@ private boolean equalTo(ClientAddons other) { && oag.equals(other.oag); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.aws, @@ -389,7 +389,7 @@ public int hashCode() { this.oag); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java index c1033e91a..7a4ebeb98 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAppTypeEnum.java @@ -74,19 +74,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientAppTypeEnum && this.string.equals(((ClientAppTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java index 79f103af5..05ccd5fb2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethod.java @@ -54,7 +54,7 @@ public Optional getSelfSigned return selfSignedTlsClientAuth; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethod && equalTo((ClientAuthenticationMethod) other); @@ -71,12 +71,12 @@ private boolean equalTo(ClientAuthenticationMethod other) { && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java index a444731b3..458d19414 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodSelfSignedTlsClientAuth.java @@ -39,7 +39,7 @@ public List getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethodSelfSignedTlsClientAuth @@ -55,12 +55,12 @@ private boolean equalTo(ClientAuthenticationMethodSelfSignedTlsClientAuth other) return credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java index 8b899649f..bdaff2ec0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientAuthenticationMethodTlsClientAuth.java @@ -39,7 +39,7 @@ public List getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientAuthenticationMethodTlsClientAuth @@ -55,12 +55,12 @@ private boolean equalTo(ClientAuthenticationMethodTlsClientAuth other) { return credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java index f463de39d..92861c601 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientComplianceLevelEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientComplianceLevelEnum && this.string.equals(((ClientComplianceLevelEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java index 5ee297583..c8b4ccada 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCreateAuthenticationMethod.java @@ -54,7 +54,7 @@ public Optional getSelfSigned return selfSignedTlsClientAuth; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientCreateAuthenticationMethod && equalTo((ClientCreateAuthenticationMethod) other); @@ -71,12 +71,12 @@ private boolean equalTo(ClientCreateAuthenticationMethod other) { && selfSignedTlsClientAuth.equals(other.selfSignedTlsClientAuth); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.privateKeyJwt, this.tlsClientAuth, this.selfSignedTlsClientAuth); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java index 666913f75..342b3fcfe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredential.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientCredential && equalTo((ClientCredential) other); @@ -166,7 +166,7 @@ private boolean equalTo(ClientCredential other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -181,7 +181,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java index df2e43d2f..93630fa34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialAlgorithmEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientCredentialAlgorithmEnum && this.string.equals(((ClientCredentialAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java index c31cea3a3..ab30a486b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientCredentialTypeEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientCredentialTypeEnum && this.string.equals(((ClientCredentialTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java index 83ff64bdf..326ed6259 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientDefaultOrganization.java @@ -51,7 +51,7 @@ public List getFlows() { return flows; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientDefaultOrganization && equalTo((ClientDefaultOrganization) other); @@ -66,12 +66,12 @@ private boolean equalTo(ClientDefaultOrganization other) { return organizationId.equals(other.organizationId) && flows.equals(other.flows); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.organizationId, this.flows); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -113,7 +113,7 @@ public static final class Builder implements OrganizationIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientDefaultOrganization other) { organizationId(other.getOrganizationId()); flows(other.getFlows()); @@ -125,7 +125,7 @@ public Builder from(ClientDefaultOrganization other) { *

The default Organization ID to be used

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("organization_id") public _FinalStage organizationId(@NotNull String organizationId) { this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); @@ -136,7 +136,7 @@ public _FinalStage organizationId(@NotNull String organizationId) { *

The default Organization usage

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllFlows(List flows) { if (flows != null) { this.flows.addAll(flows); @@ -148,7 +148,7 @@ public _FinalStage addAllFlows(List flows) { *

The default Organization usage

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addFlows(String flows) { this.flows.add(flows); return this; @@ -157,7 +157,7 @@ public _FinalStage addFlows(String flows) { /** *

The default Organization usage

*/ - @Override + @java.lang.Override @JsonSetter(value = "flows", nulls = Nulls.SKIP) public _FinalStage flows(List flows) { this.flows.clear(); @@ -167,7 +167,7 @@ public _FinalStage flows(List flows) { return this; } - @Override + @java.lang.Override public ClientDefaultOrganization build() { return new ClientDefaultOrganization(organizationId, flows, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java index df177fbb3..e50045c53 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientEncryptionKey.java @@ -63,7 +63,7 @@ public Optional getSubject() { return subject; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientEncryptionKey && equalTo((ClientEncryptionKey) other); @@ -78,12 +78,12 @@ private boolean equalTo(ClientEncryptionKey other) { return pub.equals(other.pub) && cert.equals(other.cert) && subject.equals(other.subject); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.pub, this.cert, this.subject); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java index ea62ec267..fc5c9c0ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationNullableUsageEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientGrantOrganizationNullableUsageEnum && this.string.equals(((ClientGrantOrganizationNullableUsageEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java index 0ef92981b..c8b268c8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantOrganizationUsageEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientGrantOrganizationUsageEnum && this.string.equals(((ClientGrantOrganizationUsageEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java index 6e272fdd6..7175789ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantResponseContent.java @@ -130,7 +130,7 @@ public Optional> getAuthorizationDetailsTypes() { return authorizationDetailsTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientGrantResponseContent && equalTo((ClientGrantResponseContent) other); @@ -153,7 +153,7 @@ private boolean equalTo(ClientGrantResponseContent other) { && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -167,7 +167,7 @@ public int hashCode() { this.authorizationDetailsTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java index 427b71dfe..7ea37cc47 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientGrantSubjectTypeEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientGrantSubjectTypeEnum && this.string.equals(((ClientGrantSubjectTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java index d7ba75a44..8659fa47a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientJwtConfiguration.java @@ -69,7 +69,7 @@ public Optional getAlg() { return alg; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientJwtConfiguration && equalTo((ClientJwtConfiguration) other); @@ -87,12 +87,12 @@ private boolean equalTo(ClientJwtConfiguration other) { && alg.equals(other.alg); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.lifetimeInSeconds, this.secretEncoded, this.scopes, this.alg); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java index 689f0d3c5..a62211571 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobile.java @@ -45,7 +45,7 @@ public Optional getIos() { return ios; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobile && equalTo((ClientMobile) other); @@ -60,12 +60,12 @@ private boolean equalTo(ClientMobile other) { return android.equals(other.android) && ios.equals(other.ios); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.android, this.ios); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java index 9f780db92..94c21d350 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileAndroid.java @@ -52,7 +52,7 @@ public Optional> getSha256CertFingerprints() { return sha256CertFingerprints; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobileAndroid && equalTo((ClientMobileAndroid) other); @@ -68,12 +68,12 @@ private boolean equalTo(ClientMobileAndroid other) { && sha256CertFingerprints.equals(other.sha256CertFingerprints); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.appPackageName, this.sha256CertFingerprints); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java index eefa95b61..f8de2b1f8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientMobileiOs.java @@ -49,7 +49,7 @@ public Optional getAppBundleIdentifier() { return appBundleIdentifier; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientMobileiOs && equalTo((ClientMobileiOs) other); @@ -64,12 +64,12 @@ private boolean equalTo(ClientMobileiOs other) { return teamId.equals(other.teamId) && appBundleIdentifier.equals(other.appBundleIdentifier); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.teamId, this.appBundleIdentifier); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java index 7045fc33a..1b2dcd6dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiators.java @@ -46,7 +46,7 @@ public Optional> getSelectedInit return selectedInitiators; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientOidcBackchannelLogoutInitiators @@ -62,12 +62,12 @@ private boolean equalTo(ClientOidcBackchannelLogoutInitiators other) { return mode.equals(other.mode) && selectedInitiators.equals(other.selectedInitiators); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mode, this.selectedInitiators); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java index 8d8be4b51..06bdb72fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsEnum.java @@ -47,20 +47,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOidcBackchannelLogoutInitiatorsEnum && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java index 0455a51a2..37f9ae572 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutInitiatorsModeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOidcBackchannelLogoutInitiatorsModeEnum && this.string.equals(((ClientOidcBackchannelLogoutInitiatorsModeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java index ef092acb9..4e15d3014 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSessionMetadata.java @@ -38,7 +38,7 @@ public Optional getInclude() { return include; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientOidcBackchannelLogoutSessionMetadata @@ -54,12 +54,12 @@ private boolean equalTo(ClientOidcBackchannelLogoutSessionMetadata other) { return include.equals(other.include); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.include); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java index 78e9acfcc..634e3fdf9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOidcBackchannelLogoutSettings.java @@ -71,7 +71,7 @@ private OptionalNullable _getBackcha return backchannelLogoutSessionMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientOidcBackchannelLogoutSettings @@ -89,13 +89,13 @@ private boolean equalTo(ClientOidcBackchannelLogoutSettings other) { && backchannelLogoutSessionMetadata.equals(other.backchannelLogoutSessionMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.backchannelLogoutUrls, this.backchannelLogoutInitiators, this.backchannelLogoutSessionMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java index f3c1b7d50..23b1ec9d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationDiscoveryEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationDiscoveryEnum && this.string.equals(((ClientOrganizationDiscoveryEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java index a546123c7..6d1316e7a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationRequireBehaviorEnum && this.string.equals(((ClientOrganizationRequireBehaviorEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java index 7391d15fd..da61ba589 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationRequireBehaviorPatchEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationRequireBehaviorPatchEnum && this.string.equals(((ClientOrganizationRequireBehaviorPatchEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java index eeddfcf4e..9acde5a7b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsageEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationUsageEnum && this.string.equals(((ClientOrganizationUsageEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java index 07dfc44ca..912b7a224 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientOrganizationUsagePatchEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientOrganizationUsagePatchEnum && this.string.equals(((ClientOrganizationUsagePatchEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java index 5b73dff9c..817423d69 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenConfiguration.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -35,6 +36,8 @@ public final class ClientRefreshTokenConfiguration { private final Optional infiniteIdleTokenLifetime; + private final Optional> policies; + private final Map additionalProperties; private ClientRefreshTokenConfiguration( @@ -45,6 +48,7 @@ private ClientRefreshTokenConfiguration( Optional infiniteTokenLifetime, Optional idleTokenLifetime, Optional infiniteIdleTokenLifetime, + Optional> policies, Map additionalProperties) { this.rotationType = rotationType; this.expirationType = expirationType; @@ -53,6 +57,7 @@ private ClientRefreshTokenConfiguration( this.infiniteTokenLifetime = infiniteTokenLifetime; this.idleTokenLifetime = idleTokenLifetime; this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; + this.policies = policies; this.additionalProperties = additionalProperties; } @@ -106,7 +111,15 @@ public Optional getInfiniteIdleTokenLifetime() { return infiniteIdleTokenLifetime; } - @Override + /** + * @return A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers + */ + @JsonProperty("policies") + public Optional> getPolicies() { + return policies; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientRefreshTokenConfiguration && equalTo((ClientRefreshTokenConfiguration) other); @@ -124,10 +137,11 @@ private boolean equalTo(ClientRefreshTokenConfiguration other) { && tokenLifetime.equals(other.tokenLifetime) && infiniteTokenLifetime.equals(other.infiniteTokenLifetime) && idleTokenLifetime.equals(other.idleTokenLifetime) - && infiniteIdleTokenLifetime.equals(other.infiniteIdleTokenLifetime); + && infiniteIdleTokenLifetime.equals(other.infiniteIdleTokenLifetime) + && policies.equals(other.policies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.rotationType, @@ -136,10 +150,11 @@ public int hashCode() { this.tokenLifetime, this.infiniteTokenLifetime, this.idleTokenLifetime, - this.infiniteIdleTokenLifetime); + this.infiniteIdleTokenLifetime, + this.policies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -195,6 +210,13 @@ public interface _FinalStage { _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleTokenLifetime); _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime); + + /** + *

A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers

+ */ + _FinalStage policies(Optional> policies); + + _FinalStage policies(List policies); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -203,6 +225,8 @@ public static final class Builder implements RotationTypeStage, ExpirationTypeSt private RefreshTokenExpirationTypeEnum expirationType; + private Optional> policies = Optional.empty(); + private Optional infiniteIdleTokenLifetime = Optional.empty(); private Optional idleTokenLifetime = Optional.empty(); @@ -218,7 +242,7 @@ public static final class Builder implements RotationTypeStage, ExpirationTypeSt private Builder() {} - @Override + @java.lang.Override public Builder from(ClientRefreshTokenConfiguration other) { rotationType(other.getRotationType()); expirationType(other.getExpirationType()); @@ -227,28 +251,49 @@ public Builder from(ClientRefreshTokenConfiguration other) { infiniteTokenLifetime(other.getInfiniteTokenLifetime()); idleTokenLifetime(other.getIdleTokenLifetime()); infiniteIdleTokenLifetime(other.getInfiniteIdleTokenLifetime()); + policies(other.getPolicies()); return this; } - @Override + @java.lang.Override @JsonSetter("rotation_type") public ExpirationTypeStage rotationType(@NotNull RefreshTokenRotationTypeEnum rotationType) { this.rotationType = Objects.requireNonNull(rotationType, "rotationType must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("expiration_type") public _FinalStage expirationType(@NotNull RefreshTokenExpirationTypeEnum expirationType) { this.expirationType = Objects.requireNonNull(expirationType, "expirationType must not be null"); return this; } + /** + *

A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage policies(List policies) { + this.policies = Optional.ofNullable(policies); + return this; + } + + /** + *

A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers

+ */ + @java.lang.Override + @JsonSetter(value = "policies", nulls = Nulls.SKIP) + public _FinalStage policies(Optional> policies) { + this.policies = policies; + return this; + } + /** *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) { this.infiniteIdleTokenLifetime = Optional.ofNullable(infiniteIdleTokenLifetime); return this; @@ -257,7 +302,7 @@ public _FinalStage infiniteIdleTokenLifetime(Boolean infiniteIdleTokenLifetime) /** *

Prevents tokens from expiring without use when true (takes precedence over idle_token_lifetime values)

*/ - @Override + @java.lang.Override @JsonSetter(value = "infinite_idle_token_lifetime", nulls = Nulls.SKIP) public _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleTokenLifetime) { this.infiniteIdleTokenLifetime = infiniteIdleTokenLifetime; @@ -268,7 +313,7 @@ public _FinalStage infiniteIdleTokenLifetime(Optional infiniteIdleToken *

Period (in seconds) for which refresh tokens will remain valid without use

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage idleTokenLifetime(Integer idleTokenLifetime) { this.idleTokenLifetime = Optional.ofNullable(idleTokenLifetime); return this; @@ -277,7 +322,7 @@ public _FinalStage idleTokenLifetime(Integer idleTokenLifetime) { /** *

Period (in seconds) for which refresh tokens will remain valid without use

*/ - @Override + @java.lang.Override @JsonSetter(value = "idle_token_lifetime", nulls = Nulls.SKIP) public _FinalStage idleTokenLifetime(Optional idleTokenLifetime) { this.idleTokenLifetime = idleTokenLifetime; @@ -288,7 +333,7 @@ public _FinalStage idleTokenLifetime(Optional idleTokenLifetime) { *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime) { this.infiniteTokenLifetime = Optional.ofNullable(infiniteTokenLifetime); return this; @@ -297,7 +342,7 @@ public _FinalStage infiniteTokenLifetime(Boolean infiniteTokenLifetime) { /** *

Prevents tokens from having a set lifetime when true (takes precedence over token_lifetime values)

*/ - @Override + @java.lang.Override @JsonSetter(value = "infinite_token_lifetime", nulls = Nulls.SKIP) public _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime) { this.infiniteTokenLifetime = infiniteTokenLifetime; @@ -308,7 +353,7 @@ public _FinalStage infiniteTokenLifetime(Optional infiniteTokenLifetime *

Period (in seconds) for which refresh tokens will remain valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tokenLifetime(Integer tokenLifetime) { this.tokenLifetime = Optional.ofNullable(tokenLifetime); return this; @@ -317,7 +362,7 @@ public _FinalStage tokenLifetime(Integer tokenLifetime) { /** *

Period (in seconds) for which refresh tokens will remain valid

*/ - @Override + @java.lang.Override @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) public _FinalStage tokenLifetime(Optional tokenLifetime) { this.tokenLifetime = tokenLifetime; @@ -328,7 +373,7 @@ public _FinalStage tokenLifetime(Optional tokenLifetime) { *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage leeway(Integer leeway) { this.leeway = Optional.ofNullable(leeway); return this; @@ -337,14 +382,14 @@ public _FinalStage leeway(Integer leeway) { /** *

Period in seconds where the previous refresh token can be exchanged without triggering breach detection

*/ - @Override + @java.lang.Override @JsonSetter(value = "leeway", nulls = Nulls.SKIP) public _FinalStage leeway(Optional leeway) { this.leeway = leeway; return this; } - @Override + @java.lang.Override public ClientRefreshTokenConfiguration build() { return new ClientRefreshTokenConfiguration( rotationType, @@ -354,6 +399,7 @@ public ClientRefreshTokenConfiguration build() { infiniteTokenLifetime, idleTokenLifetime, infiniteIdleTokenLifetime, + policies, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenPolicy.java b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenPolicy.java new file mode 100644 index 000000000..990636950 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ClientRefreshTokenPolicy.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientRefreshTokenPolicy.Builder.class) +public final class ClientRefreshTokenPolicy { + private final String audience; + + private final List scope; + + private final Map additionalProperties; + + private ClientRefreshTokenPolicy(String audience, List scope, Map additionalProperties) { + this.audience = audience; + this.scope = scope; + this.additionalProperties = additionalProperties; + } + + /** + * @return The identifier of the resource server to which the Multi Resource Refresh Token Policy applies + */ + @JsonProperty("audience") + public String getAudience() { + return audience; + } + + /** + * @return The resource server permissions granted under the Multi Resource Refresh Token Policy, defining the context in which an access token can be used + */ + @JsonProperty("scope") + public List getScope() { + return scope; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientRefreshTokenPolicy && equalTo((ClientRefreshTokenPolicy) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientRefreshTokenPolicy other) { + return audience.equals(other.audience) && scope.equals(other.scope); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.audience, this.scope); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AudienceStage builder() { + return new Builder(); + } + + public interface AudienceStage { + /** + *

The identifier of the resource server to which the Multi Resource Refresh Token Policy applies

+ */ + _FinalStage audience(@NotNull String audience); + + Builder from(ClientRefreshTokenPolicy other); + } + + public interface _FinalStage { + ClientRefreshTokenPolicy build(); + + /** + *

The resource server permissions granted under the Multi Resource Refresh Token Policy, defining the context in which an access token can be used

+ */ + _FinalStage scope(List scope); + + _FinalStage addScope(String scope); + + _FinalStage addAllScope(List scope); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AudienceStage, _FinalStage { + private String audience; + + private List scope = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientRefreshTokenPolicy other) { + audience(other.getAudience()); + scope(other.getScope()); + return this; + } + + /** + *

The identifier of the resource server to which the Multi Resource Refresh Token Policy applies

+ *

The identifier of the resource server to which the Multi Resource Refresh Token Policy applies

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("audience") + public _FinalStage audience(@NotNull String audience) { + this.audience = Objects.requireNonNull(audience, "audience must not be null"); + return this; + } + + /** + *

The resource server permissions granted under the Multi Resource Refresh Token Policy, defining the context in which an access token can be used

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllScope(List scope) { + if (scope != null) { + this.scope.addAll(scope); + } + return this; + } + + /** + *

The resource server permissions granted under the Multi Resource Refresh Token Policy, defining the context in which an access token can be used

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addScope(String scope) { + this.scope.add(scope); + return this; + } + + /** + *

The resource server permissions granted under the Multi Resource Refresh Token Policy, defining the context in which an access token can be used

+ */ + @java.lang.Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(List scope) { + this.scope.clear(); + if (scope != null) { + this.scope.addAll(scope); + } + return this; + } + + @java.lang.Override + public ClientRefreshTokenPolicy build() { + return new ClientRefreshTokenPolicy(audience, scope, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java index 4df1d8801..edb3e0e5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferAllowedAuthenticationMethodsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientSessionTransferAllowedAuthenticationMethodsEnum && this.string.equals(((ClientSessionTransferAllowedAuthenticationMethodsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java index abaf658b1..e341f8f67 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferConfiguration.java @@ -97,7 +97,7 @@ public Optional getEnforceOnlineRefreshTokens() { return enforceOnlineRefreshTokens; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionTransferConfiguration @@ -118,7 +118,7 @@ private boolean equalTo(ClientSessionTransferConfiguration other) { && enforceOnlineRefreshTokens.equals(other.enforceOnlineRefreshTokens); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.canCreateSessionTransferToken, @@ -129,7 +129,7 @@ public int hashCode() { this.enforceOnlineRefreshTokens); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java index a8fde3854..bb2238bb7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSessionTransferDeviceBindingEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientSessionTransferDeviceBindingEnum && this.string.equals(((ClientSessionTransferDeviceBindingEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java index 3c400251e..4a7ed6e2b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithCredentialId.java @@ -49,7 +49,7 @@ public Optional> getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSignedRequestObjectWithCredentialId @@ -65,12 +65,12 @@ private boolean equalTo(ClientSignedRequestObjectWithCredentialId other) { return required.equals(other.required) && credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.required, this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java index 7ccd3d3ab..d95362a49 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSignedRequestObjectWithPublicKey.java @@ -49,7 +49,7 @@ public Optional> getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSignedRequestObjectWithPublicKey @@ -65,12 +65,12 @@ private boolean equalTo(ClientSignedRequestObjectWithPublicKey other) { return required.equals(other.required) && credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.required, this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java index 620bd32c6..7b78cfcfc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientSigningKey.java @@ -63,7 +63,7 @@ public Optional getSubject() { return subject; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSigningKey && equalTo((ClientSigningKey) other); @@ -78,12 +78,12 @@ private boolean equalTo(ClientSigningKey other) { return pkcs7.equals(other.pkcs7) && cert.equals(other.cert) && subject.equals(other.subject); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.pkcs7, this.cert, this.subject); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java index 584e75225..7b1d0adb1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientTokenEndpointAuthMethodEnum && this.string.equals(((ClientTokenEndpointAuthMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java index d41443bb9..22e9d1ba4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenEndpointAuthMethodOrNullEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ClientTokenEndpointAuthMethodOrNullEnum && this.string.equals(((ClientTokenEndpointAuthMethodOrNullEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java index c467f0c1e..ff4f642b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfiguration.java @@ -39,7 +39,7 @@ public Optional> getAllowAnyProfileOfType() { return allowAnyProfileOfType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientTokenExchangeConfiguration && equalTo((ClientTokenExchangeConfiguration) other); @@ -54,12 +54,12 @@ private boolean equalTo(ClientTokenExchangeConfiguration other) { return allowAnyProfileOfType.equals(other.allowAnyProfileOfType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.allowAnyProfileOfType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java index efbebeb36..7d24ab830 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientTokenExchangeConfigurationOrNull.java @@ -39,7 +39,7 @@ public Optional> getAllowAnyProfileOfType() { return allowAnyProfileOfType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientTokenExchangeConfigurationOrNull @@ -55,12 +55,12 @@ private boolean equalTo(ClientTokenExchangeConfigurationOrNull other) { return allowAnyProfileOfType.equals(other.allowAnyProfileOfType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.allowAnyProfileOfType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java b/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java index 8722013ce..c949e5a5f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectedAccount.java @@ -123,7 +123,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccount && equalTo((ConnectedAccount) other); @@ -145,7 +145,7 @@ private boolean equalTo(ConnectedAccount other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -158,7 +158,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -256,7 +256,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectedAccount other) { id(other.getId()); connection(other.getConnection()); @@ -274,7 +274,7 @@ public Builder from(ConnectedAccount other) { *

The unique identifier for the connected account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public ConnectionStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -286,7 +286,7 @@ public ConnectionStage id(@NotNull String id) { *

The name of the connection associated with the account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection") public ConnectionIdStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -298,7 +298,7 @@ public ConnectionIdStage connection(@NotNull String connection) { *

The unique identifier of the connection associated with the account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public StrategyStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -310,14 +310,14 @@ public StrategyStage connectionId(@NotNull String connectionId) { *

The authentication strategy used by the connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("strategy") public AccessTypeStage strategy(@NotNull String strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("access_type") public CreatedAtStage accessType(@NotNull String accessType) { this.accessType = Objects.requireNonNull(accessType, "accessType must not be null"); @@ -329,7 +329,7 @@ public CreatedAtStage accessType(@NotNull String accessType) { *

ISO 8601 timestamp when the connected account was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -340,7 +340,7 @@ public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { *

ISO 8601 timestamp when the connected account expires.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage expiresAt(OffsetDateTime expiresAt) { this.expiresAt = Optional.ofNullable(expiresAt); return this; @@ -349,7 +349,7 @@ public _FinalStage expiresAt(OffsetDateTime expiresAt) { /** *

ISO 8601 timestamp when the connected account expires.

*/ - @Override + @java.lang.Override @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public _FinalStage expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; @@ -360,7 +360,7 @@ public _FinalStage expiresAt(Optional expiresAt) { *

The scopes granted for this connected account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage scopes(List scopes) { this.scopes = Optional.ofNullable(scopes); return this; @@ -369,14 +369,14 @@ public _FinalStage scopes(List scopes) { /** *

The scopes granted for this connected account.

*/ - @Override + @java.lang.Override @JsonSetter(value = "scopes", nulls = Nulls.SKIP) public _FinalStage scopes(Optional> scopes) { this.scopes = scopes; return this; } - @Override + @java.lang.Override public ConnectedAccount build() { return new ConnectedAccount( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java index 263a96f25..e424b5a32 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeIdentifier.java @@ -37,7 +37,7 @@ public Optional getActive() { return active; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributeIdentifier && equalTo((ConnectionAttributeIdentifier) other); @@ -52,12 +52,12 @@ private boolean equalTo(ConnectionAttributeIdentifier other) { return active.equals(other.active); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java index d29aee217..9b0c0d7d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOidc.java @@ -54,7 +54,7 @@ public Optional getUserinfoScope() { return userinfoScope; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributeMapOidc && equalTo((ConnectionAttributeMapOidc) other); @@ -71,12 +71,12 @@ private boolean equalTo(ConnectionAttributeMapOidc other) { && userinfoScope.equals(other.userinfoScope); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.attributes, this.mappingMode, this.userinfoScope); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java index 99bc2a88c..20f165084 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributeMapOkta.java @@ -54,7 +54,7 @@ public Optional getUserinfoScope() { return userinfoScope; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributeMapOkta && equalTo((ConnectionAttributeMapOkta) other); @@ -71,12 +71,12 @@ private boolean equalTo(ConnectionAttributeMapOkta other) { && userinfoScope.equals(other.userinfoScope); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.attributes, this.mappingMode, this.userinfoScope); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java index 5302bee0b..7d4ac34b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAttributes.java @@ -54,7 +54,7 @@ public Optional getUsername() { return username; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAttributes && equalTo((ConnectionAttributes) other); @@ -69,12 +69,12 @@ private boolean equalTo(ConnectionAttributes other) { return email.equals(other.email) && phoneNumber.equals(other.phoneNumber) && username.equals(other.username); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.email, this.phoneNumber, this.username); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java index 19b982725..bb46df26b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationMethods.java @@ -45,7 +45,7 @@ public Optional getPasskey() { return passkey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAuthenticationMethods && equalTo((ConnectionAuthenticationMethods) other); @@ -60,12 +60,12 @@ private boolean equalTo(ConnectionAuthenticationMethods other) { return password.equals(other.password) && passkey.equals(other.passkey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.password, this.passkey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java index 7a80e9328..780caa1f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionAuthenticationPurpose.java @@ -32,7 +32,7 @@ public boolean getActive() { return active; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionAuthenticationPurpose && equalTo((ConnectionAuthenticationPurpose) other); @@ -47,12 +47,12 @@ private boolean equalTo(ConnectionAuthenticationPurpose other) { return active == other.active; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements ActiveStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionAuthenticationPurpose other) { active(other.getActive()); return this; } - @Override + @java.lang.Override @JsonSetter("active") public _FinalStage active(boolean active) { this.active = active; return this; } - @Override + @java.lang.Override public ConnectionAuthenticationPurpose build() { return new ConnectionAuthenticationPurpose(active, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java index 8ff9bcdb8..b9c9b230e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionCommon.java @@ -62,54 +62,54 @@ private ConnectionCommon( } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionCommon && equalTo((ConnectionCommon) other); @@ -131,7 +131,7 @@ private boolean equalTo(ConnectionCommon other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.authentication, @@ -144,7 +144,7 @@ public int hashCode() { this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java index e0d9b692b..40dc2a411 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectedAccountsPurpose.java @@ -43,7 +43,7 @@ public Optional getCrossAppAccess() { return crossAppAccess; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionConnectedAccountsPurpose @@ -59,12 +59,12 @@ private boolean equalTo(ConnectionConnectedAccountsPurpose other) { return active == other.active && crossAppAccess.equals(other.crossAppAccess); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active, this.crossAppAccess); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements ActiveStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionConnectedAccountsPurpose other) { active(other.getActive()); crossAppAccess(other.getCrossAppAccess()); return this; } - @Override + @java.lang.Override @JsonSetter("active") public _FinalStage active(boolean active) { this.active = active; return this; } - @Override + @java.lang.Override public _FinalStage crossAppAccess(Boolean crossAppAccess) { this.crossAppAccess = Optional.ofNullable(crossAppAccess); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cross_app_access", nulls = Nulls.SKIP) public _FinalStage crossAppAccess(Optional crossAppAccess) { this.crossAppAccess = crossAppAccess; return this; } - @Override + @java.lang.Override public ConnectionConnectedAccountsPurpose build() { return new ConnectionConnectedAccountsPurpose(active, crossAppAccess, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java index af92221e3..65743c84c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettings.java @@ -35,7 +35,7 @@ public Optional getPkce() { return pkce; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionConnectionSettings && equalTo((ConnectionConnectionSettings) other); @@ -50,12 +50,12 @@ private boolean equalTo(ConnectionConnectionSettings other) { return pkce.equals(other.pkce); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.pkce); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java index a9cc73c0d..b9fd8ca29 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionConnectionSettingsPkceEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionConnectionSettingsPkceEnum && this.string.equals(((ConnectionConnectionSettingsPkceEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java index 76c0dfe46..db2a3e6c5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionCustomScripts.java @@ -108,7 +108,7 @@ public Optional getChangePhoneNumber() { return changePhoneNumber; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionCustomScripts && equalTo((ConnectionCustomScripts) other); @@ -131,7 +131,7 @@ private boolean equalTo(ConnectionCustomScripts other) { && changePhoneNumber.equals(other.changePhoneNumber); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.login, @@ -145,7 +145,7 @@ public int hashCode() { this.changePhoneNumber); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionDigestAlgorithmEnumSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionDigestAlgorithmEnumSaml.java new file mode 100644 index 000000000..79e032675 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionDigestAlgorithmEnumSaml.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionDigestAlgorithmEnumSaml { + public static final ConnectionDigestAlgorithmEnumSaml SHA256 = + new ConnectionDigestAlgorithmEnumSaml(Value.SHA256, "sha256"); + + public static final ConnectionDigestAlgorithmEnumSaml SHA1 = + new ConnectionDigestAlgorithmEnumSaml(Value.SHA1, "sha1"); + + private final Value value; + + private final String string; + + ConnectionDigestAlgorithmEnumSaml(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionDigestAlgorithmEnumSaml + && this.string.equals(((ConnectionDigestAlgorithmEnumSaml) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SHA256: + return visitor.visitSha256(); + case SHA1: + return visitor.visitSha1(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionDigestAlgorithmEnumSaml valueOf(String value) { + switch (value) { + case "sha256": + return SHA256; + case "sha1": + return SHA1; + default: + return new ConnectionDigestAlgorithmEnumSaml(Value.UNKNOWN, value); + } + } + + public enum Value { + SHA1, + + SHA256, + + UNKNOWN + } + + public interface Visitor { + T visitSha1(); + + T visitSha256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java index c55104929..a2c363c11 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionEnabledClient.java @@ -36,7 +36,7 @@ public String getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionEnabledClient && equalTo((ConnectionEnabledClient) other); @@ -51,12 +51,12 @@ private boolean equalTo(ConnectionEnabledClient other) { return clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionEnabledClient other) { clientId(other.getClientId()); return this; @@ -98,14 +98,14 @@ public Builder from(ConnectionEnabledClient other) { *

The client id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override public ConnectionEnabledClient build() { return new ConnectionEnabledClient(clientId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java index 0e879a5a4..b7d58d326 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionFederatedConnectionsAccessTokens.java @@ -38,7 +38,7 @@ public Optional getActive() { return active; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionFederatedConnectionsAccessTokens @@ -54,12 +54,12 @@ private boolean equalTo(ConnectionFederatedConnectionsAccessTokens other) { return active.equals(other.active); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionFieldsMapSamlValue.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionFieldsMapSamlValue.java new file mode 100644 index 000000000..c9d8f3d8a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionFieldsMapSamlValue.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = ConnectionFieldsMapSamlValue.Deserializer.class) +public final class ConnectionFieldsMapSamlValue { + private final Object value; + + private final int type; + + private ConnectionFieldsMapSamlValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionFieldsMapSamlValue && equalTo((ConnectionFieldsMapSamlValue) other); + } + + private boolean equalTo(ConnectionFieldsMapSamlValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConnectionFieldsMapSamlValue of(String value) { + return new ConnectionFieldsMapSamlValue(value, 0); + } + + public static ConnectionFieldsMapSamlValue of(List value) { + return new ConnectionFieldsMapSamlValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectionFieldsMapSamlValue.class); + } + + @java.lang.Override + public ConnectionFieldsMapSamlValue deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java index 29ec965f2..bd9961eae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForList.java @@ -149,7 +149,7 @@ public Optional getConnectedAccounts() { return connectedAccounts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionForList && equalTo((ConnectionForList) other); @@ -174,7 +174,7 @@ private boolean equalTo(ConnectionForList other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -190,7 +190,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java index f9cf20c1f..918f3e7ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionForOrganization.java @@ -76,7 +76,7 @@ public Optional getIsSignupEnabled() { return isSignupEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionForOrganization && equalTo((ConnectionForOrganization) other); @@ -94,12 +94,12 @@ private boolean equalTo(ConnectionForOrganization other) { && isSignupEnabled.equals(other.isSignupEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.assignMembershipOnLogin, this.showAsButton, this.isSignupEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionForOrganization other) { connectionId(other.getConnectionId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -171,7 +171,7 @@ public Builder from(ConnectionForOrganization other) { *

ID of the connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -182,7 +182,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); return this; @@ -191,7 +191,7 @@ public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { /** *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) public _FinalStage isSignupEnabled(Optional isSignupEnabled) { this.isSignupEnabled = isSignupEnabled; @@ -202,7 +202,7 @@ public _FinalStage isSignupEnabled(Optional isSignupEnabled) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -211,7 +211,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -222,7 +222,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -231,14 +231,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @Override + @java.lang.Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @Override + @java.lang.Override public ConnectionForOrganization build() { return new ConnectionForOrganization( connectionId, assignMembershipOnLogin, showAsButton, isSignupEnabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java index 7fb71d54c..cdde507d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionGatewayAuthentication.java @@ -88,7 +88,7 @@ public Optional getSecretBase64Encoded() { return secretBase64Encoded; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionGatewayAuthentication && equalTo((ConnectionGatewayAuthentication) other); @@ -107,12 +107,12 @@ private boolean equalTo(ConnectionGatewayAuthentication other) { && secretBase64Encoded.equals(other.secretBase64Encoded); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.method, this.subject, this.audience, this.secret, this.secretBase64Encoded); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements MethodStage, AudienceStage, SecretS private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionGatewayAuthentication other) { method(other.getMethod()); subject(other.getSubject()); @@ -194,7 +194,7 @@ public Builder from(ConnectionGatewayAuthentication other) { *

The Authorization header type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("method") public AudienceStage method(@NotNull String method) { this.method = Objects.requireNonNull(method, "method must not be null"); @@ -206,7 +206,7 @@ public AudienceStage method(@NotNull String method) { *

The audience to be added to the JWT payload.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("audience") public SecretStage audience(@NotNull String audience) { this.audience = Objects.requireNonNull(audience, "audience must not be null"); @@ -218,7 +218,7 @@ public SecretStage audience(@NotNull String audience) { *

The secret to be used for signing tokens.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("secret") public _FinalStage secret(@NotNull String secret) { this.secret = Objects.requireNonNull(secret, "secret must not be null"); @@ -229,7 +229,7 @@ public _FinalStage secret(@NotNull String secret) { *

Set to true if the provided secret is base64 encoded.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage secretBase64Encoded(Boolean secretBase64Encoded) { this.secretBase64Encoded = Optional.ofNullable(secretBase64Encoded); return this; @@ -238,7 +238,7 @@ public _FinalStage secretBase64Encoded(Boolean secretBase64Encoded) { /** *

Set to true if the provided secret is base64 encoded.

*/ - @Override + @java.lang.Override @JsonSetter(value = "secret_base64_encoded", nulls = Nulls.SKIP) public _FinalStage secretBase64Encoded(Optional secretBase64Encoded) { this.secretBase64Encoded = secretBase64Encoded; @@ -249,7 +249,7 @@ public _FinalStage secretBase64Encoded(Optional secretBase64Encoded) { *

The subject to be added to the JWT payload.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = Optional.ofNullable(subject); return this; @@ -258,14 +258,14 @@ public _FinalStage subject(String subject) { /** *

The subject to be added to the JWT payload.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(Optional subject) { this.subject = subject; return this; } - @Override + @java.lang.Override public ConnectionGatewayAuthentication build() { return new ConnectionGatewayAuthentication( method, subject, audience, secret, secretBase64Encoded, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java index c69223dc8..2aea939e9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdTokenSignedResponseAlgEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdTokenSignedResponseAlgEnum && this.string.equals(((ConnectionIdTokenSignedResponseAlgEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java index 12de108cf..a84b60bf2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentifierPrecedenceEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdentifierPrecedenceEnum && this.string.equals(((ConnectionIdentifierPrecedenceEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java index 03bb87319..e9e06e00e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityApiEnumAzureAd.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdentityApiEnumAzureAd && this.string.equals(((ConnectionIdentityApiEnumAzureAd) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java index 269a2f5ea..cefd9fdc0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java @@ -186,20 +186,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionIdentityProviderEnum && this.string.equals(((ConnectionIdentityProviderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java index 8c1b20651..5a806f424 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKey.java @@ -166,7 +166,7 @@ public Optional getSubjectDn() { return subjectDn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionKey && equalTo((ConnectionKey) other); @@ -192,7 +192,7 @@ private boolean equalTo(ConnectionKey other) { && subjectDn.equals(other.subjectDn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, @@ -209,7 +209,7 @@ public int hashCode() { this.subjectDn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -333,7 +333,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionKey other) { kid(other.getKid()); cert(other.getCert()); @@ -355,7 +355,7 @@ public Builder from(ConnectionKey other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -367,7 +367,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -379,7 +379,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -391,33 +391,33 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; return this; } - @Override + @java.lang.Override public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { this.keyUse = Optional.ofNullable(keyUse); return this; } - @Override + @java.lang.Override @JsonSetter(value = "key_use", nulls = Nulls.SKIP) public _FinalStage keyUse(Optional keyUse) { this.keyUse = keyUse; @@ -428,7 +428,7 @@ public _FinalStage keyUse(Optional keyUse) { *

Signing key algorithm

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage algorithm(String algorithm) { this.algorithm = Optional.ofNullable(algorithm); return this; @@ -437,7 +437,7 @@ public _FinalStage algorithm(String algorithm) { /** *

Signing key algorithm

*/ - @Override + @java.lang.Override @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) public _FinalStage algorithm(Optional algorithm) { this.algorithm = algorithm; @@ -448,7 +448,7 @@ public _FinalStage algorithm(Optional algorithm) { *

The date and time when the key became the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage currentSince(String currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; @@ -457,7 +457,7 @@ public _FinalStage currentSince(String currentSince) { /** *

The date and time when the key became the current key

*/ - @Override + @java.lang.Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -468,7 +468,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -477,7 +477,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @Override + @java.lang.Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -488,7 +488,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -497,7 +497,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @Override + @java.lang.Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -508,7 +508,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -517,7 +517,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @Override + @java.lang.Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -528,7 +528,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage pkcs(String pkcs) { this.pkcs = Optional.ofNullable(pkcs); return this; @@ -537,14 +537,14 @@ public _FinalStage pkcs(String pkcs) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) public _FinalStage pkcs(Optional pkcs) { this.pkcs = pkcs; return this; } - @Override + @java.lang.Override public ConnectionKey build() { return new ConnectionKey( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java index b02382b43..25c229547 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionKeyUseEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionKeyUseEnum && this.string.equals(((ConnectionKeyUseEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java index 6e78f5700..1ce75c8f4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOidc.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionMappingModeEnumOidc && this.string.equals(((ConnectionMappingModeEnumOidc) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java index 593052b3a..e1323c7e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMappingModeEnumOkta.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionMappingModeEnumOkta && this.string.equals(((ConnectionMappingModeEnumOkta) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java index e5a55ab76..5b3239148 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionMfa.java @@ -51,7 +51,7 @@ public Optional getReturnEnrollSettings() { return returnEnrollSettings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionMfa && equalTo((ConnectionMfa) other); @@ -66,12 +66,12 @@ private boolean equalTo(ConnectionMfa other) { return active.equals(other.active) && returnEnrollSettings.equals(other.returnEnrollSettings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active, this.returnEnrollSettings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java index 6c06eddd8..71f6dd6fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsApple.java @@ -77,7 +77,7 @@ private ConnectionOptionsApple( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -207,7 +207,7 @@ private OptionalNullable _getTeamId() { return upstreamParams; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsApple && equalTo((ConnectionOptionsApple) other); @@ -232,7 +232,7 @@ private boolean equalTo(ConnectionOptionsApple other) { && upstreamParams.equals(other.upstreamParams); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -248,7 +248,7 @@ public int hashCode() { this.upstreamParams); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java index a80e98806..b78eb6e8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAuth0.java @@ -120,7 +120,7 @@ private ConnectionOptionsAuth0( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -310,7 +310,7 @@ private OptionalNullable _getValidation() { return validation; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsAuth0 && equalTo((ConnectionOptionsAuth0) other); @@ -346,7 +346,7 @@ private boolean equalTo(ConnectionOptionsAuth0 other) { && validation.equals(other.validation); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -373,7 +373,7 @@ public int hashCode() { this.validation); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java index e89da7ecd..eaee6daa2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsAzureAd.java @@ -305,7 +305,7 @@ private ConnectionOptionsAzureAd( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -753,6 +753,9 @@ public Optional> getThumbprints() { @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } return upstreamParams; } @@ -785,7 +788,14 @@ private OptionalNullable _getFederat return federatedConnectionsAccessTokens; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsAzureAd && equalTo((ConnectionOptionsAzureAd) other); @@ -867,7 +877,7 @@ private boolean equalTo(ConnectionOptionsAzureAd other) { && waadProtocol.equals(other.waadProtocol); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -940,7 +950,7 @@ public int hashCode() { this.waadProtocol); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -2016,8 +2026,9 @@ public Builder thumbprints(List thumbprints) { @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) public Builder upstreamParams( - OptionalNullable>> - upstreamParams) { + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java index d8c34ab4a..f021d5065 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommon.java @@ -32,12 +32,12 @@ private ConnectionOptionsCommon( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsCommon && equalTo((ConnectionOptionsCommon) other); @@ -52,12 +52,12 @@ private boolean equalTo(ConnectionOptionsCommon other) { return nonPersistentAttrs.equals(other.nonPersistentAttrs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.nonPersistentAttrs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java index 66647a3c2..50b8d828b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java @@ -53,7 +53,7 @@ public final class ConnectionOptionsCommonOidc implements IConnectionOptionsComm private final Optional setUserRootAttributes; - private final OptionalNullable tenantDomain; + private final Optional tenantDomain; private final Optional tokenEndpoint; @@ -83,7 +83,7 @@ private ConnectionOptionsCommonOidc( Optional scope, Optional sendBackChannelNonce, Optional setUserRootAttributes, - OptionalNullable tenantDomain, + Optional tenantDomain, Optional tokenEndpoint, OptionalNullable tokenEndpointAuthMethod, OptionalNullable tokenEndpointAuthSigningAlg, @@ -114,32 +114,32 @@ private ConnectionOptionsCommonOidc( } @JsonProperty("authorization_endpoint") - @Override + @java.lang.Override public Optional getAuthorizationEndpoint() { return authorizationEndpoint; } @JsonProperty("client_id") - @Override + @java.lang.Override public String getClientId() { return clientId; } @JsonProperty("client_secret") - @Override + @java.lang.Override public Optional getClientSecret() { return clientSecret; } @JsonProperty("connection_settings") - @Override + @java.lang.Override public Optional getConnectionSettings() { return connectionSettings; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") - @Override + @java.lang.Override public OptionalNullable getFederatedConnectionsAccessTokens() { if (federatedConnectionsAccessTokens == null) { return OptionalNullable.absent(); @@ -148,20 +148,20 @@ public OptionalNullable getFederated } @JsonProperty("domain_aliases") - @Override + @java.lang.Override public Optional> getDomainAliases() { return domainAliases; } @JsonProperty("icon_url") - @Override + @java.lang.Override public Optional getIconUrl() { return iconUrl; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("id_token_signed_response_algs") - @Override + @java.lang.Override public OptionalNullable> getIdTokenSignedResponseAlgs() { if (idTokenSignedResponseAlgs == null) { return OptionalNullable.absent(); @@ -170,60 +170,56 @@ public OptionalNullable> getIdToken } @JsonProperty("issuer") - @Override + @java.lang.Override public Optional getIssuer() { return issuer; } @JsonProperty("jwks_uri") - @Override + @java.lang.Override public Optional getJwksUri() { return jwksUri; } @JsonProperty("oidc_metadata") - @Override + @java.lang.Override public Optional getOidcMetadata() { return oidcMetadata; } @JsonProperty("scope") - @Override + @java.lang.Override public Optional getScope() { return scope; } @JsonProperty("send_back_channel_nonce") - @Override + @java.lang.Override public Optional getSendBackChannelNonce() { return sendBackChannelNonce; } @JsonProperty("set_user_root_attributes") - @Override + @java.lang.Override public Optional getSetUserRootAttributes() { return setUserRootAttributes; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("tenant_domain") - @Override - public OptionalNullable getTenantDomain() { - if (tenantDomain == null) { - return OptionalNullable.absent(); - } + @java.lang.Override + public Optional getTenantDomain() { return tenantDomain; } @JsonProperty("token_endpoint") - @Override + @java.lang.Override public Optional getTokenEndpoint() { return tokenEndpoint; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthMethod() { if (tokenEndpointAuthMethod == null) { return OptionalNullable.absent(); @@ -233,7 +229,7 @@ public OptionalNullable getTokenEndpointA @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_signing_alg") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthSigningAlg() { if (tokenEndpointAuthSigningAlg == null) { return OptionalNullable.absent(); @@ -243,13 +239,16 @@ public OptionalNullable getTokenEndpo @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - @Override + @java.lang.Override public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } return upstreamParams; } @JsonProperty("userinfo_endpoint") - @Override + @java.lang.Override public Optional getUserinfoEndpoint() { return userinfoEndpoint; } @@ -266,12 +265,6 @@ private OptionalNullable> _getIdTok return idTokenSignedResponseAlgs; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("tenant_domain") - private OptionalNullable _getTenantDomain() { - return tenantDomain; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") private OptionalNullable _getTokenEndpointAuthMethod() { @@ -284,7 +277,14 @@ private OptionalNullable _getTokenEnd return tokenEndpointAuthSigningAlg; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsCommonOidc && equalTo((ConnectionOptionsCommonOidc) other); @@ -318,7 +318,7 @@ private boolean equalTo(ConnectionOptionsCommonOidc other) { && userinfoEndpoint.equals(other.userinfoEndpoint); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.authorizationEndpoint, @@ -343,7 +343,7 @@ public int hashCode() { this.userinfoEndpoint); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -431,13 +431,9 @@ _FinalStage idTokenSignedResponseAlgs( _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); - _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); - - _FinalStage tenantDomain(String tenantDomain); - _FinalStage tenantDomain(Optional tenantDomain); - _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + _FinalStage tenantDomain(String tenantDomain); _FinalStage tokenEndpoint(Optional tokenEndpoint); @@ -466,7 +462,9 @@ _FinalStage tokenEndpointAuthSigningAlg( tokenEndpointAuthSigningAlg); _FinalStage upstreamParams( - OptionalNullable>> upstreamParams); + @Nullable + OptionalNullable>> + upstreamParams); _FinalStage upstreamParams( Map> upstreamParams); @@ -501,7 +499,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Optional tokenEndpoint = Optional.empty(); - private OptionalNullable tenantDomain = OptionalNullable.absent(); + private Optional tenantDomain = Optional.empty(); private Optional setUserRootAttributes = Optional.empty(); @@ -536,7 +534,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionOptionsCommonOidc other) { authorizationEndpoint(other.getAuthorizationEndpoint()); clientId(other.getClientId()); @@ -561,27 +559,27 @@ public Builder from(ConnectionOptionsCommonOidc other) { return this; } - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage userinfoEndpoint(String userinfoEndpoint) { this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { this.userinfoEndpoint = userinfoEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( com.auth0.client.mgmt.core.Nullable< Map>> @@ -596,7 +594,7 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Optional>> upstreamParams) { if (upstreamParams.isPresent()) { @@ -607,23 +605,24 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Map> upstreamParams) { this.upstreamParams = OptionalNullable.of(upstreamParams); return this; } - @Override + @java.lang.Override @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) public _FinalStage upstreamParams( - OptionalNullable>> - upstreamParams) { + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthSigningAlg) { @@ -637,7 +636,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( Optional tokenEndpointAuthSigningAlg) { if (tokenEndpointAuthSigningAlg.isPresent()) { @@ -648,14 +647,14 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthSigningAlg( @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { @@ -663,7 +662,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isNull()) { @@ -676,7 +675,7 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( Optional tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isPresent()) { @@ -687,13 +686,13 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethod( @Nullable OptionalNullable tokenEndpointAuthMethod) { @@ -701,133 +700,111 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) public _FinalStage tokenEndpoint(Optional tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; return this; } - @Override - public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { - if (tenantDomain.isNull()) { - this.tenantDomain = OptionalNullable.ofNull(); - } else if (tenantDomain.isEmpty()) { - this.tenantDomain = OptionalNullable.absent(); - } else { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } - return this; - } - - @Override - public _FinalStage tenantDomain(Optional tenantDomain) { - if (tenantDomain.isPresent()) { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } else { - this.tenantDomain = OptionalNullable.absent(); - } - return this; - } - - @Override + @java.lang.Override public _FinalStage tenantDomain(String tenantDomain) { - this.tenantDomain = OptionalNullable.of(tenantDomain); + this.tenantDomain = Optional.ofNullable(tenantDomain); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) - public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + public _FinalStage tenantDomain(Optional tenantDomain) { this.tenantDomain = tenantDomain; return this; } - @Override + @java.lang.Override public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { this.setUserRootAttributes = setUserRootAttributes; return this; } - @Override + @java.lang.Override public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); return this; } - @Override + @java.lang.Override @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { this.sendBackChannelNonce = sendBackChannelNonce; return this; } - @Override + @java.lang.Override public _FinalStage scope(String scope) { this.scope = Optional.ofNullable(scope); return this; } - @Override + @java.lang.Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) public _FinalStage scope(Optional scope) { this.scope = scope; return this; } - @Override + @java.lang.Override public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { this.oidcMetadata = Optional.ofNullable(oidcMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) public _FinalStage oidcMetadata(Optional oidcMetadata) { this.oidcMetadata = oidcMetadata; return this; } - @Override + @java.lang.Override public _FinalStage jwksUri(String jwksUri) { this.jwksUri = Optional.ofNullable(jwksUri); return this; } - @Override + @java.lang.Override @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) public _FinalStage jwksUri(Optional jwksUri) { this.jwksUri = jwksUri; return this; } - @Override + @java.lang.Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( com.auth0.client.mgmt.core.Nullable> idTokenSignedResponseAlgs) { @@ -841,7 +818,7 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( Optional> idTokenSignedResponseAlgs) { if (idTokenSignedResponseAlgs.isPresent()) { @@ -852,14 +829,14 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( List idTokenSignedResponseAlgs) { this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) public _FinalStage idTokenSignedResponseAlgs( @Nullable OptionalNullable> idTokenSignedResponseAlgs) { @@ -867,33 +844,33 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage iconUrl(String iconUrl) { this.iconUrl = Optional.ofNullable(iconUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) public _FinalStage iconUrl(Optional iconUrl) { this.iconUrl = iconUrl; return this; } - @Override + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) public _FinalStage domainAliases(Optional> domainAliases) { this.domainAliases = domainAliases; return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( com.auth0.client.mgmt.core.Nullable federatedConnectionsAccessTokens) { @@ -907,7 +884,7 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( Optional federatedConnectionsAccessTokens) { if (federatedConnectionsAccessTokens.isPresent()) { @@ -918,14 +895,14 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); return this; } - @Override + @java.lang.Override @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) public _FinalStage federatedConnectionsAccessTokens( @Nullable @@ -934,46 +911,46 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { this.connectionSettings = Optional.ofNullable(connectionSettings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) public _FinalStage connectionSettings(Optional connectionSettings) { this.connectionSettings = connectionSettings; return this; } - @Override + @java.lang.Override public _FinalStage clientSecret(String clientSecret) { this.clientSecret = Optional.ofNullable(clientSecret); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) public _FinalStage clientSecret(Optional clientSecret) { this.clientSecret = clientSecret; return this; } - @Override + @java.lang.Override public _FinalStage authorizationEndpoint(String authorizationEndpoint) { this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { this.authorizationEndpoint = authorizationEndpoint; return this; } - @Override + @java.lang.Override public ConnectionOptionsCommonOidc build() { return new ConnectionOptionsCommonOidc( authorizationEndpoint, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleApps.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleApps.java new file mode 100644 index 000000000..eada7fef5 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleApps.java @@ -0,0 +1,1052 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsGoogleApps.Builder.class) +public final class ConnectionOptionsGoogleApps implements IConnectionOptionsCommon { + private final Optional> nonPersistentAttrs; + + private final Optional adminAccessToken; + + private final Optional adminAccessTokenExpiresin; + + private final Optional adminRefreshToken; + + private final Optional allowSettingLoginScopes; + + private final Optional apiEnableUsers; + + private final String clientId; + + private final Optional clientSecret; + + private final Optional domain; + + private final Optional> domainAliases; + + private final Optional email; + + private final Optional extAgreedTerms; + + private final Optional extGroups; + + private final Optional extGroupsExtended; + + private final Optional extIsAdmin; + + private final Optional extIsSuspended; + + private final OptionalNullable federatedConnectionsAccessTokens; + + private final Optional handleLoginFromSocial; + + private final Optional iconUrl; + + private final Optional mapUserIdToId; + + private final Optional profile; + + private final Optional> scope; + + private final Optional setUserRootAttributes; + + private final Optional tenantDomain; + + private final OptionalNullable>> + upstreamParams; + + private final Map additionalProperties; + + private ConnectionOptionsGoogleApps( + Optional> nonPersistentAttrs, + Optional adminAccessToken, + Optional adminAccessTokenExpiresin, + Optional adminRefreshToken, + Optional allowSettingLoginScopes, + Optional apiEnableUsers, + String clientId, + Optional clientSecret, + Optional domain, + Optional> domainAliases, + Optional email, + Optional extAgreedTerms, + Optional extGroups, + Optional extGroupsExtended, + Optional extIsAdmin, + Optional extIsSuspended, + OptionalNullable federatedConnectionsAccessTokens, + Optional handleLoginFromSocial, + Optional iconUrl, + Optional mapUserIdToId, + Optional profile, + Optional> scope, + Optional setUserRootAttributes, + Optional tenantDomain, + OptionalNullable>> upstreamParams, + Map additionalProperties) { + this.nonPersistentAttrs = nonPersistentAttrs; + this.adminAccessToken = adminAccessToken; + this.adminAccessTokenExpiresin = adminAccessTokenExpiresin; + this.adminRefreshToken = adminRefreshToken; + this.allowSettingLoginScopes = allowSettingLoginScopes; + this.apiEnableUsers = apiEnableUsers; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.domain = domain; + this.domainAliases = domainAliases; + this.email = email; + this.extAgreedTerms = extAgreedTerms; + this.extGroups = extGroups; + this.extGroupsExtended = extGroupsExtended; + this.extIsAdmin = extIsAdmin; + this.extIsSuspended = extIsSuspended; + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + this.handleLoginFromSocial = handleLoginFromSocial; + this.iconUrl = iconUrl; + this.mapUserIdToId = mapUserIdToId; + this.profile = profile; + this.scope = scope; + this.setUserRootAttributes = setUserRootAttributes; + this.tenantDomain = tenantDomain; + this.upstreamParams = upstreamParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("non_persistent_attrs") + @java.lang.Override + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("admin_access_token") + public Optional getAdminAccessToken() { + return adminAccessToken; + } + + @JsonProperty("admin_access_token_expiresin") + public Optional getAdminAccessTokenExpiresin() { + return adminAccessTokenExpiresin; + } + + @JsonProperty("admin_refresh_token") + public Optional getAdminRefreshToken() { + return adminRefreshToken; + } + + /** + * @return When true, allows customization of OAuth scopes requested during user login. Custom scopes are appended to the mandatory email and profile scopes. When false or omitted, only the default email and profile scopes are used. This property is automatically enabled when Token Vault or Connected Accounts features are activated. + */ + @JsonProperty("allow_setting_login_scopes") + public Optional getAllowSettingLoginScopes() { + return allowSettingLoginScopes; + } + + @JsonProperty("api_enable_users") + public Optional getApiEnableUsers() { + return apiEnableUsers; + } + + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + @JsonProperty("domain") + public Optional getDomain() { + return domain; + } + + @JsonProperty("domain_aliases") + public Optional> getDomainAliases() { + return domainAliases; + } + + /** + * @return Whether the OAuth flow requests the email scope. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("ext_agreed_terms") + public Optional getExtAgreedTerms() { + return extAgreedTerms; + } + + @JsonProperty("ext_groups") + public Optional getExtGroups() { + return extGroups; + } + + /** + * @return Controls whether enriched group entries include id, email, name (true) or only the group name (false); can only be set when ext_groups is true. + */ + @JsonProperty("ext_groups_extended") + public Optional getExtGroupsExtended() { + return extGroupsExtended; + } + + @JsonProperty("ext_is_admin") + public Optional getExtIsAdmin() { + return extIsAdmin; + } + + @JsonProperty("ext_is_suspended") + public Optional getExtIsSuspended() { + return extIsSuspended; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + public OptionalNullable getFederatedConnectionsAccessTokens() { + if (federatedConnectionsAccessTokens == null) { + return OptionalNullable.absent(); + } + return federatedConnectionsAccessTokens; + } + + @JsonProperty("handle_login_from_social") + public Optional getHandleLoginFromSocial() { + return handleLoginFromSocial; + } + + @JsonProperty("icon_url") + public Optional getIconUrl() { + return iconUrl; + } + + /** + * @return Determines how Auth0 generates the user_id for Google Workspace users. When false (default), the user's email address is used. When true, Google's stable numeric user ID is used instead, which persists even if the user's email changes. This setting can only be configured when creating the connection and cannot be changed afterward. + */ + @JsonProperty("map_user_id_to_id") + public Optional getMapUserIdToId() { + return mapUserIdToId; + } + + /** + * @return Whether the OAuth flow requests the profile scope. + */ + @JsonProperty("profile") + public Optional getProfile() { + return profile; + } + + @JsonProperty("scope") + public Optional> getScope() { + return scope; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonProperty("tenant_domain") + public Optional getTenantDomain() { + return tenantDomain; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("federated_connections_access_tokens") + private OptionalNullable _getFederatedConnectionsAccessTokens() { + return federatedConnectionsAccessTokens; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsGoogleApps && equalTo((ConnectionOptionsGoogleApps) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsGoogleApps other) { + return nonPersistentAttrs.equals(other.nonPersistentAttrs) + && adminAccessToken.equals(other.adminAccessToken) + && adminAccessTokenExpiresin.equals(other.adminAccessTokenExpiresin) + && adminRefreshToken.equals(other.adminRefreshToken) + && allowSettingLoginScopes.equals(other.allowSettingLoginScopes) + && apiEnableUsers.equals(other.apiEnableUsers) + && clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && domain.equals(other.domain) + && domainAliases.equals(other.domainAliases) + && email.equals(other.email) + && extAgreedTerms.equals(other.extAgreedTerms) + && extGroups.equals(other.extGroups) + && extGroupsExtended.equals(other.extGroupsExtended) + && extIsAdmin.equals(other.extIsAdmin) + && extIsSuspended.equals(other.extIsSuspended) + && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) + && handleLoginFromSocial.equals(other.handleLoginFromSocial) + && iconUrl.equals(other.iconUrl) + && mapUserIdToId.equals(other.mapUserIdToId) + && profile.equals(other.profile) + && scope.equals(other.scope) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && tenantDomain.equals(other.tenantDomain) + && upstreamParams.equals(other.upstreamParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.nonPersistentAttrs, + this.adminAccessToken, + this.adminAccessTokenExpiresin, + this.adminRefreshToken, + this.allowSettingLoginScopes, + this.apiEnableUsers, + this.clientId, + this.clientSecret, + this.domain, + this.domainAliases, + this.email, + this.extAgreedTerms, + this.extGroups, + this.extGroupsExtended, + this.extIsAdmin, + this.extIsSuspended, + this.federatedConnectionsAccessTokens, + this.handleLoginFromSocial, + this.iconUrl, + this.mapUserIdToId, + this.profile, + this.scope, + this.setUserRootAttributes, + this.tenantDomain, + this.upstreamParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + _FinalStage clientId(@NotNull String clientId); + + Builder from(ConnectionOptionsGoogleApps other); + } + + public interface _FinalStage { + ConnectionOptionsGoogleApps build(); + + _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs); + + _FinalStage nonPersistentAttrs(List nonPersistentAttrs); + + _FinalStage adminAccessToken(Optional adminAccessToken); + + _FinalStage adminAccessToken(String adminAccessToken); + + _FinalStage adminAccessTokenExpiresin(Optional adminAccessTokenExpiresin); + + _FinalStage adminAccessTokenExpiresin(OffsetDateTime adminAccessTokenExpiresin); + + _FinalStage adminRefreshToken(Optional adminRefreshToken); + + _FinalStage adminRefreshToken(String adminRefreshToken); + + /** + *

When true, allows customization of OAuth scopes requested during user login. Custom scopes are appended to the mandatory email and profile scopes. When false or omitted, only the default email and profile scopes are used. This property is automatically enabled when Token Vault or Connected Accounts features are activated.

+ */ + _FinalStage allowSettingLoginScopes(Optional allowSettingLoginScopes); + + _FinalStage allowSettingLoginScopes(Boolean allowSettingLoginScopes); + + _FinalStage apiEnableUsers(Optional apiEnableUsers); + + _FinalStage apiEnableUsers(Boolean apiEnableUsers); + + _FinalStage clientSecret(Optional clientSecret); + + _FinalStage clientSecret(String clientSecret); + + _FinalStage domain(Optional domain); + + _FinalStage domain(String domain); + + _FinalStage domainAliases(Optional> domainAliases); + + _FinalStage domainAliases(List domainAliases); + + /** + *

Whether the OAuth flow requests the email scope.

+ */ + _FinalStage email(Optional email); + + _FinalStage email(Boolean email); + + _FinalStage extAgreedTerms(Optional extAgreedTerms); + + _FinalStage extAgreedTerms(Boolean extAgreedTerms); + + _FinalStage extGroups(Optional extGroups); + + _FinalStage extGroups(Boolean extGroups); + + /** + *

Controls whether enriched group entries include id, email, name (true) or only the group name (false); can only be set when ext_groups is true.

+ */ + _FinalStage extGroupsExtended(Optional extGroupsExtended); + + _FinalStage extGroupsExtended(Boolean extGroupsExtended); + + _FinalStage extIsAdmin(Optional extIsAdmin); + + _FinalStage extIsAdmin(Boolean extIsAdmin); + + _FinalStage extIsSuspended(Optional extIsSuspended); + + _FinalStage extIsSuspended(Boolean extIsSuspended); + + _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens); + + _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens); + + _FinalStage handleLoginFromSocial(Optional handleLoginFromSocial); + + _FinalStage handleLoginFromSocial(Boolean handleLoginFromSocial); + + _FinalStage iconUrl(Optional iconUrl); + + _FinalStage iconUrl(String iconUrl); + + /** + *

Determines how Auth0 generates the user_id for Google Workspace users. When false (default), the user's email address is used. When true, Google's stable numeric user ID is used instead, which persists even if the user's email changes. This setting can only be configured when creating the connection and cannot be changed afterward.

+ */ + _FinalStage mapUserIdToId(Optional mapUserIdToId); + + _FinalStage mapUserIdToId(Boolean mapUserIdToId); + + /** + *

Whether the OAuth flow requests the profile scope.

+ */ + _FinalStage profile(Optional profile); + + _FinalStage profile(Boolean profile); + + _FinalStage scope(Optional> scope); + + _FinalStage scope(List scope); + + _FinalStage setUserRootAttributes(Optional setUserRootAttributes); + + _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); + + _FinalStage tenantDomain(Optional tenantDomain); + + _FinalStage tenantDomain(String tenantDomain); + + _FinalStage upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams); + + _FinalStage upstreamParams( + Map> upstreamParams); + + _FinalStage upstreamParams( + Optional>> upstreamParams); + + _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, _FinalStage { + private String clientId; + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional tenantDomain = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional> scope = Optional.empty(); + + private Optional profile = Optional.empty(); + + private Optional mapUserIdToId = Optional.empty(); + + private Optional iconUrl = Optional.empty(); + + private Optional handleLoginFromSocial = Optional.empty(); + + private OptionalNullable federatedConnectionsAccessTokens = + OptionalNullable.absent(); + + private Optional extIsSuspended = Optional.empty(); + + private Optional extIsAdmin = Optional.empty(); + + private Optional extGroupsExtended = Optional.empty(); + + private Optional extGroups = Optional.empty(); + + private Optional extAgreedTerms = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private Optional domain = Optional.empty(); + + private Optional clientSecret = Optional.empty(); + + private Optional apiEnableUsers = Optional.empty(); + + private Optional allowSettingLoginScopes = Optional.empty(); + + private Optional adminRefreshToken = Optional.empty(); + + private Optional adminAccessTokenExpiresin = Optional.empty(); + + private Optional adminAccessToken = Optional.empty(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectionOptionsGoogleApps other) { + nonPersistentAttrs(other.getNonPersistentAttrs()); + adminAccessToken(other.getAdminAccessToken()); + adminAccessTokenExpiresin(other.getAdminAccessTokenExpiresin()); + adminRefreshToken(other.getAdminRefreshToken()); + allowSettingLoginScopes(other.getAllowSettingLoginScopes()); + apiEnableUsers(other.getApiEnableUsers()); + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + domain(other.getDomain()); + domainAliases(other.getDomainAliases()); + email(other.getEmail()); + extAgreedTerms(other.getExtAgreedTerms()); + extGroups(other.getExtGroups()); + extGroupsExtended(other.getExtGroupsExtended()); + extIsAdmin(other.getExtIsAdmin()); + extIsSuspended(other.getExtIsSuspended()); + federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); + handleLoginFromSocial(other.getHandleLoginFromSocial()); + iconUrl(other.getIconUrl()); + mapUserIdToId(other.getMapUserIdToId()); + profile(other.getProfile()); + scope(other.getScope()); + setUserRootAttributes(other.getSetUserRootAttributes()); + tenantDomain(other.getTenantDomain()); + upstreamParams(other.getUpstreamParams()); + return this; + } + + @java.lang.Override + @JsonSetter("client_id") + public _FinalStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + @java.lang.Override + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public _FinalStage upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + @java.lang.Override + public _FinalStage tenantDomain(String tenantDomain) { + this.tenantDomain = Optional.ofNullable(tenantDomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public _FinalStage tenantDomain(Optional tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + @java.lang.Override + public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + @java.lang.Override + public _FinalStage scope(List scope) { + this.scope = Optional.ofNullable(scope); + return this; + } + + @java.lang.Override + @JsonSetter(value = "scope", nulls = Nulls.SKIP) + public _FinalStage scope(Optional> scope) { + this.scope = scope; + return this; + } + + /** + *

Whether the OAuth flow requests the profile scope.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage profile(Boolean profile) { + this.profile = Optional.ofNullable(profile); + return this; + } + + /** + *

Whether the OAuth flow requests the profile scope.

+ */ + @java.lang.Override + @JsonSetter(value = "profile", nulls = Nulls.SKIP) + public _FinalStage profile(Optional profile) { + this.profile = profile; + return this; + } + + /** + *

Determines how Auth0 generates the user_id for Google Workspace users. When false (default), the user's email address is used. When true, Google's stable numeric user ID is used instead, which persists even if the user's email changes. This setting can only be configured when creating the connection and cannot be changed afterward.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage mapUserIdToId(Boolean mapUserIdToId) { + this.mapUserIdToId = Optional.ofNullable(mapUserIdToId); + return this; + } + + /** + *

Determines how Auth0 generates the user_id for Google Workspace users. When false (default), the user's email address is used. When true, Google's stable numeric user ID is used instead, which persists even if the user's email changes. This setting can only be configured when creating the connection and cannot be changed afterward.

+ */ + @java.lang.Override + @JsonSetter(value = "map_user_id_to_id", nulls = Nulls.SKIP) + public _FinalStage mapUserIdToId(Optional mapUserIdToId) { + this.mapUserIdToId = mapUserIdToId; + return this; + } + + @java.lang.Override + public _FinalStage iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public _FinalStage iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + @java.lang.Override + public _FinalStage handleLoginFromSocial(Boolean handleLoginFromSocial) { + this.handleLoginFromSocial = Optional.ofNullable(handleLoginFromSocial); + return this; + } + + @java.lang.Override + @JsonSetter(value = "handle_login_from_social", nulls = Nulls.SKIP) + public _FinalStage handleLoginFromSocial(Optional handleLoginFromSocial) { + this.handleLoginFromSocial = handleLoginFromSocial; + return this; + } + + @java.lang.Override + public _FinalStage federatedConnectionsAccessTokens( + com.auth0.client.mgmt.core.Nullable + federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isNull()) { + this.federatedConnectionsAccessTokens = OptionalNullable.ofNull(); + } else if (federatedConnectionsAccessTokens.isEmpty()) { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage federatedConnectionsAccessTokens( + Optional federatedConnectionsAccessTokens) { + if (federatedConnectionsAccessTokens.isPresent()) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens.get()); + } else { + this.federatedConnectionsAccessTokens = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage federatedConnectionsAccessTokens( + ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); + return this; + } + + @java.lang.Override + @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) + public _FinalStage federatedConnectionsAccessTokens( + @Nullable + OptionalNullable federatedConnectionsAccessTokens) { + this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; + return this; + } + + @java.lang.Override + public _FinalStage extIsSuspended(Boolean extIsSuspended) { + this.extIsSuspended = Optional.ofNullable(extIsSuspended); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ext_is_suspended", nulls = Nulls.SKIP) + public _FinalStage extIsSuspended(Optional extIsSuspended) { + this.extIsSuspended = extIsSuspended; + return this; + } + + @java.lang.Override + public _FinalStage extIsAdmin(Boolean extIsAdmin) { + this.extIsAdmin = Optional.ofNullable(extIsAdmin); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ext_is_admin", nulls = Nulls.SKIP) + public _FinalStage extIsAdmin(Optional extIsAdmin) { + this.extIsAdmin = extIsAdmin; + return this; + } + + /** + *

Controls whether enriched group entries include id, email, name (true) or only the group name (false); can only be set when ext_groups is true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage extGroupsExtended(Boolean extGroupsExtended) { + this.extGroupsExtended = Optional.ofNullable(extGroupsExtended); + return this; + } + + /** + *

Controls whether enriched group entries include id, email, name (true) or only the group name (false); can only be set when ext_groups is true.

+ */ + @java.lang.Override + @JsonSetter(value = "ext_groups_extended", nulls = Nulls.SKIP) + public _FinalStage extGroupsExtended(Optional extGroupsExtended) { + this.extGroupsExtended = extGroupsExtended; + return this; + } + + @java.lang.Override + public _FinalStage extGroups(Boolean extGroups) { + this.extGroups = Optional.ofNullable(extGroups); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ext_groups", nulls = Nulls.SKIP) + public _FinalStage extGroups(Optional extGroups) { + this.extGroups = extGroups; + return this; + } + + @java.lang.Override + public _FinalStage extAgreedTerms(Boolean extAgreedTerms) { + this.extAgreedTerms = Optional.ofNullable(extAgreedTerms); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ext_agreed_terms", nulls = Nulls.SKIP) + public _FinalStage extAgreedTerms(Optional extAgreedTerms) { + this.extAgreedTerms = extAgreedTerms; + return this; + } + + /** + *

Whether the OAuth flow requests the email scope.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage email(Boolean email) { + this.email = Optional.ofNullable(email); + return this; + } + + /** + *

Whether the OAuth flow requests the email scope.

+ */ + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @java.lang.Override + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public _FinalStage domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + @java.lang.Override + public _FinalStage domain(String domain) { + this.domain = Optional.ofNullable(domain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "domain", nulls = Nulls.SKIP) + public _FinalStage domain(Optional domain) { + this.domain = domain; + return this; + } + + @java.lang.Override + public _FinalStage clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + @java.lang.Override + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public _FinalStage clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + @java.lang.Override + public _FinalStage apiEnableUsers(Boolean apiEnableUsers) { + this.apiEnableUsers = Optional.ofNullable(apiEnableUsers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_enable_users", nulls = Nulls.SKIP) + public _FinalStage apiEnableUsers(Optional apiEnableUsers) { + this.apiEnableUsers = apiEnableUsers; + return this; + } + + /** + *

When true, allows customization of OAuth scopes requested during user login. Custom scopes are appended to the mandatory email and profile scopes. When false or omitted, only the default email and profile scopes are used. This property is automatically enabled when Token Vault or Connected Accounts features are activated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allowSettingLoginScopes(Boolean allowSettingLoginScopes) { + this.allowSettingLoginScopes = Optional.ofNullable(allowSettingLoginScopes); + return this; + } + + /** + *

When true, allows customization of OAuth scopes requested during user login. Custom scopes are appended to the mandatory email and profile scopes. When false or omitted, only the default email and profile scopes are used. This property is automatically enabled when Token Vault or Connected Accounts features are activated.

+ */ + @java.lang.Override + @JsonSetter(value = "allow_setting_login_scopes", nulls = Nulls.SKIP) + public _FinalStage allowSettingLoginScopes(Optional allowSettingLoginScopes) { + this.allowSettingLoginScopes = allowSettingLoginScopes; + return this; + } + + @java.lang.Override + public _FinalStage adminRefreshToken(String adminRefreshToken) { + this.adminRefreshToken = Optional.ofNullable(adminRefreshToken); + return this; + } + + @java.lang.Override + @JsonSetter(value = "admin_refresh_token", nulls = Nulls.SKIP) + public _FinalStage adminRefreshToken(Optional adminRefreshToken) { + this.adminRefreshToken = adminRefreshToken; + return this; + } + + @java.lang.Override + public _FinalStage adminAccessTokenExpiresin(OffsetDateTime adminAccessTokenExpiresin) { + this.adminAccessTokenExpiresin = Optional.ofNullable(adminAccessTokenExpiresin); + return this; + } + + @java.lang.Override + @JsonSetter(value = "admin_access_token_expiresin", nulls = Nulls.SKIP) + public _FinalStage adminAccessTokenExpiresin(Optional adminAccessTokenExpiresin) { + this.adminAccessTokenExpiresin = adminAccessTokenExpiresin; + return this; + } + + @java.lang.Override + public _FinalStage adminAccessToken(String adminAccessToken) { + this.adminAccessToken = Optional.ofNullable(adminAccessToken); + return this; + } + + @java.lang.Override + @JsonSetter(value = "admin_access_token", nulls = Nulls.SKIP) + public _FinalStage adminAccessToken(Optional adminAccessToken) { + this.adminAccessToken = adminAccessToken; + return this; + } + + @java.lang.Override + public _FinalStage nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + @java.lang.Override + public ConnectionOptionsGoogleApps build() { + return new ConnectionOptionsGoogleApps( + nonPersistentAttrs, + adminAccessToken, + adminAccessTokenExpiresin, + adminRefreshToken, + allowSettingLoginScopes, + apiEnableUsers, + clientId, + clientSecret, + domain, + domainAliases, + email, + extAgreedTerms, + extGroups, + extGroupsExtended, + extIsAdmin, + extIsSuspended, + federatedConnectionsAccessTokens, + handleLoginFromSocial, + iconUrl, + mapUserIdToId, + profile, + scope, + setUserRootAttributes, + tenantDomain, + upstreamParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java index 4edda5763..81382210f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsGoogleOAuth2.java @@ -329,7 +329,7 @@ private ConnectionOptionsGoogleOAuth2( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -925,7 +925,7 @@ private OptionalNullable _getClientSecret() { return upstreamParams; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsGoogleOAuth2 && equalTo((ConnectionOptionsGoogleOAuth2) other); @@ -1013,7 +1013,7 @@ private boolean equalTo(ConnectionOptionsGoogleOAuth2 other) { && youtubepartner.equals(other.youtubepartner); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -1092,7 +1092,7 @@ public int hashCode() { this.youtubepartner); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpInitiatedClientProtocolEnumSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpInitiatedClientProtocolEnumSaml.java new file mode 100644 index 000000000..2f751a39b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpInitiatedClientProtocolEnumSaml.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionOptionsIdpInitiatedClientProtocolEnumSaml { + public static final ConnectionOptionsIdpInitiatedClientProtocolEnumSaml WSFED = + new ConnectionOptionsIdpInitiatedClientProtocolEnumSaml(Value.WSFED, "wsfed"); + + public static final ConnectionOptionsIdpInitiatedClientProtocolEnumSaml SAMLP = + new ConnectionOptionsIdpInitiatedClientProtocolEnumSaml(Value.SAMLP, "samlp"); + + public static final ConnectionOptionsIdpInitiatedClientProtocolEnumSaml OIDC = + new ConnectionOptionsIdpInitiatedClientProtocolEnumSaml(Value.OIDC, "oidc"); + + private final Value value; + + private final String string; + + ConnectionOptionsIdpInitiatedClientProtocolEnumSaml(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionOptionsIdpInitiatedClientProtocolEnumSaml + && this.string.equals(((ConnectionOptionsIdpInitiatedClientProtocolEnumSaml) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case WSFED: + return visitor.visitWsfed(); + case SAMLP: + return visitor.visitSamlp(); + case OIDC: + return visitor.visitOidc(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionOptionsIdpInitiatedClientProtocolEnumSaml valueOf(String value) { + switch (value) { + case "wsfed": + return WSFED; + case "samlp": + return SAMLP; + case "oidc": + return OIDC; + default: + return new ConnectionOptionsIdpInitiatedClientProtocolEnumSaml(Value.UNKNOWN, value); + } + } + + public enum Value { + OIDC, + + SAMLP, + + WSFED, + + UNKNOWN + } + + public interface Visitor { + T visitOidc(); + + T visitSamlp(); + + T visitWsfed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpinitiatedSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpinitiatedSaml.java new file mode 100644 index 000000000..a3515ba5d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsIdpinitiatedSaml.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsIdpinitiatedSaml.Builder.class) +public final class ConnectionOptionsIdpinitiatedSaml { + private final Optional clientAuthorizequery; + + private final Optional clientId; + + private final Optional clientProtocol; + + private final Optional enabled; + + private final Map additionalProperties; + + private ConnectionOptionsIdpinitiatedSaml( + Optional clientAuthorizequery, + Optional clientId, + Optional clientProtocol, + Optional enabled, + Map additionalProperties) { + this.clientAuthorizequery = clientAuthorizequery; + this.clientId = clientId; + this.clientProtocol = clientProtocol; + this.enabled = enabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return The query string sent to the default application + */ + @JsonProperty("client_authorizequery") + public Optional getClientAuthorizequery() { + return clientAuthorizequery; + } + + /** + * @return The client ID to use for IdP-initiated login requests. + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonProperty("client_protocol") + public Optional getClientProtocol() { + return clientProtocol; + } + + /** + * @return When true, enables IdP-initiated login support for this SAML connection. Allows users to log in directly from the identity provider without first visiting Auth0. + */ + @JsonProperty("enabled") + public Optional getEnabled() { + return enabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsIdpinitiatedSaml && equalTo((ConnectionOptionsIdpinitiatedSaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsIdpinitiatedSaml other) { + return clientAuthorizequery.equals(other.clientAuthorizequery) + && clientId.equals(other.clientId) + && clientProtocol.equals(other.clientProtocol) + && enabled.equals(other.enabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientAuthorizequery, this.clientId, this.clientProtocol, this.enabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientAuthorizequery = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientProtocol = Optional.empty(); + + private Optional enabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsIdpinitiatedSaml other) { + clientAuthorizequery(other.getClientAuthorizequery()); + clientId(other.getClientId()); + clientProtocol(other.getClientProtocol()); + enabled(other.getEnabled()); + return this; + } + + /** + *

The query string sent to the default application

+ */ + @JsonSetter(value = "client_authorizequery", nulls = Nulls.SKIP) + public Builder clientAuthorizequery(Optional clientAuthorizequery) { + this.clientAuthorizequery = clientAuthorizequery; + return this; + } + + public Builder clientAuthorizequery(String clientAuthorizequery) { + this.clientAuthorizequery = Optional.ofNullable(clientAuthorizequery); + return this; + } + + /** + *

The client ID to use for IdP-initiated login requests.

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "client_protocol", nulls = Nulls.SKIP) + public Builder clientProtocol(Optional clientProtocol) { + this.clientProtocol = clientProtocol; + return this; + } + + public Builder clientProtocol(ConnectionOptionsIdpInitiatedClientProtocolEnumSaml clientProtocol) { + this.clientProtocol = Optional.ofNullable(clientProtocol); + return this; + } + + /** + *

When true, enables IdP-initiated login support for this SAML connection. Allows users to log in directly from the identity provider without first visiting Auth0.

+ */ + @JsonSetter(value = "enabled", nulls = Nulls.SKIP) + public Builder enabled(Optional enabled) { + this.enabled = enabled; + return this; + } + + public Builder enabled(Boolean enabled) { + this.enabled = Optional.ofNullable(enabled); + return this; + } + + public ConnectionOptionsIdpinitiatedSaml build() { + return new ConnectionOptionsIdpinitiatedSaml( + clientAuthorizequery, clientId, clientProtocol, enabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java index 77b1c1856..11a71bece 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2.java @@ -101,7 +101,7 @@ private ConnectionOptionsOAuth2( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -203,7 +203,7 @@ public Optional getUseOauthSpecScope() { return upstreamParams; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsOAuth2 && equalTo((ConnectionOptionsOAuth2) other); @@ -234,7 +234,7 @@ private boolean equalTo(ConnectionOptionsOAuth2 other) { && useOauthSpecScope.equals(other.useOauthSpecScope); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -256,7 +256,7 @@ public int hashCode() { this.useOauthSpecScope); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java index 7a217d051..0561d0072 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOAuth2Common.java @@ -53,7 +53,7 @@ private ConnectionOptionsOAuth2Common( } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -89,7 +89,7 @@ public Optional getSetUserRootAttributes() return upstreamParams; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsOAuth2Common && equalTo((ConnectionOptionsOAuth2Common) other); @@ -108,7 +108,7 @@ private boolean equalTo(ConnectionOptionsOAuth2Common other) { && setUserRootAttributes.equals(other.setUserRootAttributes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.nonPersistentAttrs, @@ -118,7 +118,7 @@ public int hashCode() { this.setUserRootAttributes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java index 7c0673667..d2cc00011 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java @@ -53,7 +53,7 @@ public final class ConnectionOptionsOidc implements IConnectionOptionsCommonOidc private final Optional setUserRootAttributes; - private final OptionalNullable tenantDomain; + private final Optional tenantDomain; private final Optional tokenEndpoint; @@ -91,7 +91,7 @@ private ConnectionOptionsOidc( Optional scope, Optional sendBackChannelNonce, Optional setUserRootAttributes, - OptionalNullable tenantDomain, + Optional tenantDomain, Optional tokenEndpoint, OptionalNullable tokenEndpointAuthMethod, OptionalNullable tokenEndpointAuthSigningAlg, @@ -130,32 +130,32 @@ private ConnectionOptionsOidc( } @JsonProperty("authorization_endpoint") - @Override + @java.lang.Override public Optional getAuthorizationEndpoint() { return authorizationEndpoint; } @JsonProperty("client_id") - @Override + @java.lang.Override public String getClientId() { return clientId; } @JsonProperty("client_secret") - @Override + @java.lang.Override public Optional getClientSecret() { return clientSecret; } @JsonProperty("connection_settings") - @Override + @java.lang.Override public Optional getConnectionSettings() { return connectionSettings; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") - @Override + @java.lang.Override public OptionalNullable getFederatedConnectionsAccessTokens() { if (federatedConnectionsAccessTokens == null) { return OptionalNullable.absent(); @@ -164,20 +164,20 @@ public OptionalNullable getFederated } @JsonProperty("domain_aliases") - @Override + @java.lang.Override public Optional> getDomainAliases() { return domainAliases; } @JsonProperty("icon_url") - @Override + @java.lang.Override public Optional getIconUrl() { return iconUrl; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("id_token_signed_response_algs") - @Override + @java.lang.Override public OptionalNullable> getIdTokenSignedResponseAlgs() { if (idTokenSignedResponseAlgs == null) { return OptionalNullable.absent(); @@ -186,60 +186,56 @@ public OptionalNullable> getIdToken } @JsonProperty("issuer") - @Override + @java.lang.Override public Optional getIssuer() { return issuer; } @JsonProperty("jwks_uri") - @Override + @java.lang.Override public Optional getJwksUri() { return jwksUri; } @JsonProperty("oidc_metadata") - @Override + @java.lang.Override public Optional getOidcMetadata() { return oidcMetadata; } @JsonProperty("scope") - @Override + @java.lang.Override public Optional getScope() { return scope; } @JsonProperty("send_back_channel_nonce") - @Override + @java.lang.Override public Optional getSendBackChannelNonce() { return sendBackChannelNonce; } @JsonProperty("set_user_root_attributes") - @Override + @java.lang.Override public Optional getSetUserRootAttributes() { return setUserRootAttributes; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("tenant_domain") - @Override - public OptionalNullable getTenantDomain() { - if (tenantDomain == null) { - return OptionalNullable.absent(); - } + @java.lang.Override + public Optional getTenantDomain() { return tenantDomain; } @JsonProperty("token_endpoint") - @Override + @java.lang.Override public Optional getTokenEndpoint() { return tokenEndpoint; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthMethod() { if (tokenEndpointAuthMethod == null) { return OptionalNullable.absent(); @@ -249,7 +245,7 @@ public OptionalNullable getTokenEndpointA @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_signing_alg") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthSigningAlg() { if (tokenEndpointAuthSigningAlg == null) { return OptionalNullable.absent(); @@ -259,19 +255,22 @@ public OptionalNullable getTokenEndpo @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - @Override + @java.lang.Override public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } return upstreamParams; } @JsonProperty("userinfo_endpoint") - @Override + @java.lang.Override public Optional getUserinfoEndpoint() { return userinfoEndpoint; } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -303,12 +302,6 @@ private OptionalNullable> _getIdTok return idTokenSignedResponseAlgs; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("tenant_domain") - private OptionalNullable _getTenantDomain() { - return tenantDomain; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") private OptionalNullable _getTokenEndpointAuthMethod() { @@ -321,7 +314,14 @@ private OptionalNullable _getTokenEnd return tokenEndpointAuthSigningAlg; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsOidc && equalTo((ConnectionOptionsOidc) other); @@ -359,7 +359,7 @@ private boolean equalTo(ConnectionOptionsOidc other) { && type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.authorizationEndpoint, @@ -388,7 +388,7 @@ public int hashCode() { this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -476,13 +476,9 @@ _FinalStage idTokenSignedResponseAlgs( _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); - _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); - - _FinalStage tenantDomain(String tenantDomain); - _FinalStage tenantDomain(Optional tenantDomain); - _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + _FinalStage tenantDomain(String tenantDomain); _FinalStage tokenEndpoint(Optional tokenEndpoint); @@ -511,7 +507,9 @@ _FinalStage tokenEndpointAuthSigningAlg( tokenEndpointAuthSigningAlg); _FinalStage upstreamParams( - OptionalNullable>> upstreamParams); + @Nullable + OptionalNullable>> + upstreamParams); _FinalStage upstreamParams( Map> upstreamParams); @@ -570,7 +568,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Optional tokenEndpoint = Optional.empty(); - private OptionalNullable tenantDomain = OptionalNullable.absent(); + private Optional tenantDomain = Optional.empty(); private Optional setUserRootAttributes = Optional.empty(); @@ -605,7 +603,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionOptionsOidc other) { authorizationEndpoint(other.getAuthorizationEndpoint()); clientId(other.getClientId()); @@ -634,79 +632,79 @@ public Builder from(ConnectionOptionsOidc other) { return this; } - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage type(ConnectionTypeEnumOidc type) { this.type = Optional.ofNullable(type); return this; } - @Override + @java.lang.Override @JsonSetter(value = "type", nulls = Nulls.SKIP) public _FinalStage type(Optional type) { this.type = type; return this; } - @Override + @java.lang.Override public _FinalStage discoveryUrl(String discoveryUrl) { this.discoveryUrl = Optional.ofNullable(discoveryUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "discovery_url", nulls = Nulls.SKIP) public _FinalStage discoveryUrl(Optional discoveryUrl) { this.discoveryUrl = discoveryUrl; return this; } - @Override + @java.lang.Override public _FinalStage attributeMap(ConnectionAttributeMapOidc attributeMap) { this.attributeMap = Optional.ofNullable(attributeMap); return this; } - @Override + @java.lang.Override @JsonSetter(value = "attribute_map", nulls = Nulls.SKIP) public _FinalStage attributeMap(Optional attributeMap) { this.attributeMap = attributeMap; return this; } - @Override + @java.lang.Override public _FinalStage nonPersistentAttrs(List nonPersistentAttrs) { this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) public _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs) { this.nonPersistentAttrs = nonPersistentAttrs; return this; } - @Override + @java.lang.Override public _FinalStage userinfoEndpoint(String userinfoEndpoint) { this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { this.userinfoEndpoint = userinfoEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( com.auth0.client.mgmt.core.Nullable< Map>> @@ -721,7 +719,7 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Optional>> upstreamParams) { if (upstreamParams.isPresent()) { @@ -732,23 +730,24 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Map> upstreamParams) { this.upstreamParams = OptionalNullable.of(upstreamParams); return this; } - @Override + @java.lang.Override @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) public _FinalStage upstreamParams( - OptionalNullable>> - upstreamParams) { + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthSigningAlg) { @@ -762,7 +761,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( Optional tokenEndpointAuthSigningAlg) { if (tokenEndpointAuthSigningAlg.isPresent()) { @@ -773,14 +772,14 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthSigningAlg( @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { @@ -788,7 +787,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isNull()) { @@ -801,7 +800,7 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( Optional tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isPresent()) { @@ -812,13 +811,13 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethod( @Nullable OptionalNullable tokenEndpointAuthMethod) { @@ -826,133 +825,111 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) public _FinalStage tokenEndpoint(Optional tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; return this; } - @Override - public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { - if (tenantDomain.isNull()) { - this.tenantDomain = OptionalNullable.ofNull(); - } else if (tenantDomain.isEmpty()) { - this.tenantDomain = OptionalNullable.absent(); - } else { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } - return this; - } - - @Override - public _FinalStage tenantDomain(Optional tenantDomain) { - if (tenantDomain.isPresent()) { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } else { - this.tenantDomain = OptionalNullable.absent(); - } - return this; - } - - @Override + @java.lang.Override public _FinalStage tenantDomain(String tenantDomain) { - this.tenantDomain = OptionalNullable.of(tenantDomain); + this.tenantDomain = Optional.ofNullable(tenantDomain); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) - public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + public _FinalStage tenantDomain(Optional tenantDomain) { this.tenantDomain = tenantDomain; return this; } - @Override + @java.lang.Override public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { this.setUserRootAttributes = setUserRootAttributes; return this; } - @Override + @java.lang.Override public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); return this; } - @Override + @java.lang.Override @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { this.sendBackChannelNonce = sendBackChannelNonce; return this; } - @Override + @java.lang.Override public _FinalStage scope(String scope) { this.scope = Optional.ofNullable(scope); return this; } - @Override + @java.lang.Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) public _FinalStage scope(Optional scope) { this.scope = scope; return this; } - @Override + @java.lang.Override public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { this.oidcMetadata = Optional.ofNullable(oidcMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) public _FinalStage oidcMetadata(Optional oidcMetadata) { this.oidcMetadata = oidcMetadata; return this; } - @Override + @java.lang.Override public _FinalStage jwksUri(String jwksUri) { this.jwksUri = Optional.ofNullable(jwksUri); return this; } - @Override + @java.lang.Override @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) public _FinalStage jwksUri(Optional jwksUri) { this.jwksUri = jwksUri; return this; } - @Override + @java.lang.Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( com.auth0.client.mgmt.core.Nullable> idTokenSignedResponseAlgs) { @@ -966,7 +943,7 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( Optional> idTokenSignedResponseAlgs) { if (idTokenSignedResponseAlgs.isPresent()) { @@ -977,14 +954,14 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( List idTokenSignedResponseAlgs) { this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) public _FinalStage idTokenSignedResponseAlgs( @Nullable OptionalNullable> idTokenSignedResponseAlgs) { @@ -992,33 +969,33 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage iconUrl(String iconUrl) { this.iconUrl = Optional.ofNullable(iconUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) public _FinalStage iconUrl(Optional iconUrl) { this.iconUrl = iconUrl; return this; } - @Override + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) public _FinalStage domainAliases(Optional> domainAliases) { this.domainAliases = domainAliases; return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( com.auth0.client.mgmt.core.Nullable federatedConnectionsAccessTokens) { @@ -1032,7 +1009,7 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( Optional federatedConnectionsAccessTokens) { if (federatedConnectionsAccessTokens.isPresent()) { @@ -1043,14 +1020,14 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); return this; } - @Override + @java.lang.Override @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) public _FinalStage federatedConnectionsAccessTokens( @Nullable @@ -1059,46 +1036,46 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { this.connectionSettings = Optional.ofNullable(connectionSettings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) public _FinalStage connectionSettings(Optional connectionSettings) { this.connectionSettings = connectionSettings; return this; } - @Override + @java.lang.Override public _FinalStage clientSecret(String clientSecret) { this.clientSecret = Optional.ofNullable(clientSecret); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) public _FinalStage clientSecret(Optional clientSecret) { this.clientSecret = clientSecret; return this; } - @Override + @java.lang.Override public _FinalStage authorizationEndpoint(String authorizationEndpoint) { this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { this.authorizationEndpoint = authorizationEndpoint; return this; } - @Override + @java.lang.Override public ConnectionOptionsOidc build() { return new ConnectionOptionsOidc( authorizationEndpoint, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java index 3fdfc0be8..dcd3525f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidcMetadata.java @@ -367,7 +367,7 @@ private OptionalNullable> _getScopesSupported() { return scopesSupported; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsOidcMetadata && equalTo((ConnectionOptionsOidcMetadata) other); @@ -417,7 +417,7 @@ private boolean equalTo(ConnectionOptionsOidcMetadata other) { && userinfoSigningAlgValuesSupported.equals(other.userinfoSigningAlgValuesSupported); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.acrValuesSupported, @@ -458,7 +458,7 @@ public int hashCode() { this.userinfoSigningAlgValuesSupported); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -706,7 +706,7 @@ public static final class Builder implements AuthorizationEndpointStage, IssuerS private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionOptionsOidcMetadata other) { acrValuesSupported(other.getAcrValuesSupported()); authorizationEndpoint(other.getAuthorizationEndpoint()); @@ -747,7 +747,7 @@ public Builder from(ConnectionOptionsOidcMetadata other) { return this; } - @Override + @java.lang.Override @JsonSetter("authorization_endpoint") public IssuerStage authorizationEndpoint(@NotNull String authorizationEndpoint) { this.authorizationEndpoint = @@ -755,53 +755,53 @@ public IssuerStage authorizationEndpoint(@NotNull String authorizationEndpoint) return this; } - @Override + @java.lang.Override @JsonSetter("issuer") public JwksUriStage issuer(@NotNull String issuer) { this.issuer = Objects.requireNonNull(issuer, "issuer must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("jwks_uri") public _FinalStage jwksUri(@NotNull String jwksUri) { this.jwksUri = Objects.requireNonNull(jwksUri, "jwksUri must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage userinfoSigningAlgValuesSupported(List userinfoSigningAlgValuesSupported) { this.userinfoSigningAlgValuesSupported = Optional.ofNullable(userinfoSigningAlgValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_signing_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage userinfoSigningAlgValuesSupported(Optional> userinfoSigningAlgValuesSupported) { this.userinfoSigningAlgValuesSupported = userinfoSigningAlgValuesSupported; return this; } - @Override + @java.lang.Override public _FinalStage userinfoEndpoint(String userinfoEndpoint) { this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { this.userinfoEndpoint = userinfoEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage userinfoEncryptionEncValuesSupported(List userinfoEncryptionEncValuesSupported) { this.userinfoEncryptionEncValuesSupported = Optional.ofNullable(userinfoEncryptionEncValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_encryption_enc_values_supported", nulls = Nulls.SKIP) public _FinalStage userinfoEncryptionEncValuesSupported( Optional> userinfoEncryptionEncValuesSupported) { @@ -809,13 +809,13 @@ public _FinalStage userinfoEncryptionEncValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage userinfoEncryptionAlgValuesSupported(List userinfoEncryptionAlgValuesSupported) { this.userinfoEncryptionAlgValuesSupported = Optional.ofNullable(userinfoEncryptionAlgValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_encryption_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage userinfoEncryptionAlgValuesSupported( Optional> userinfoEncryptionAlgValuesSupported) { @@ -823,20 +823,20 @@ public _FinalStage userinfoEncryptionAlgValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage uiLocalesSupported(List uiLocalesSupported) { this.uiLocalesSupported = Optional.ofNullable(uiLocalesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ui_locales_supported", nulls = Nulls.SKIP) public _FinalStage uiLocalesSupported(Optional> uiLocalesSupported) { this.uiLocalesSupported = uiLocalesSupported; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( List tokenEndpointAuthSigningAlgValuesSupported) { this.tokenEndpointAuthSigningAlgValuesSupported = @@ -844,7 +844,7 @@ public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_signing_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( Optional> tokenEndpointAuthSigningAlgValuesSupported) { @@ -852,59 +852,59 @@ public _FinalStage tokenEndpointAuthSigningAlgValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported) { this.tokenEndpointAuthMethodsSupported = Optional.ofNullable(tokenEndpointAuthMethodsSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_methods_supported", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethodsSupported(Optional> tokenEndpointAuthMethodsSupported) { this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) public _FinalStage tokenEndpoint(Optional tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage subjectTypesSupported(List subjectTypesSupported) { this.subjectTypesSupported = Optional.ofNullable(subjectTypesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject_types_supported", nulls = Nulls.SKIP) public _FinalStage subjectTypesSupported(Optional> subjectTypesSupported) { this.subjectTypesSupported = subjectTypesSupported; return this; } - @Override + @java.lang.Override public _FinalStage serviceDocumentation(String serviceDocumentation) { this.serviceDocumentation = Optional.ofNullable(serviceDocumentation); return this; } - @Override + @java.lang.Override @JsonSetter(value = "service_documentation", nulls = Nulls.SKIP) public _FinalStage serviceDocumentation(Optional serviceDocumentation) { this.serviceDocumentation = serviceDocumentation; return this; } - @Override + @java.lang.Override public _FinalStage scopesSupported(com.auth0.client.mgmt.core.Nullable> scopesSupported) { if (scopesSupported.isNull()) { this.scopesSupported = OptionalNullable.ofNull(); @@ -916,7 +916,7 @@ public _FinalStage scopesSupported(com.auth0.client.mgmt.core.Nullable> scopesSupported) { if (scopesSupported.isPresent()) { this.scopesSupported = OptionalNullable.of(scopesSupported.get()); @@ -926,91 +926,91 @@ public _FinalStage scopesSupported(Optional> scopesSupported) { return this; } - @Override + @java.lang.Override public _FinalStage scopesSupported(List scopesSupported) { this.scopesSupported = OptionalNullable.of(scopesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "scopes_supported", nulls = Nulls.SKIP) public _FinalStage scopesSupported(@Nullable OptionalNullable> scopesSupported) { this.scopesSupported = scopesSupported; return this; } - @Override + @java.lang.Override public _FinalStage responseTypesSupported(List responseTypesSupported) { this.responseTypesSupported = Optional.ofNullable(responseTypesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "response_types_supported", nulls = Nulls.SKIP) public _FinalStage responseTypesSupported(Optional> responseTypesSupported) { this.responseTypesSupported = responseTypesSupported; return this; } - @Override + @java.lang.Override public _FinalStage responseModesSupported(List responseModesSupported) { this.responseModesSupported = Optional.ofNullable(responseModesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "response_modes_supported", nulls = Nulls.SKIP) public _FinalStage responseModesSupported(Optional> responseModesSupported) { this.responseModesSupported = responseModesSupported; return this; } - @Override + @java.lang.Override public _FinalStage requireRequestUriRegistration(Boolean requireRequestUriRegistration) { this.requireRequestUriRegistration = Optional.ofNullable(requireRequestUriRegistration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "require_request_uri_registration", nulls = Nulls.SKIP) public _FinalStage requireRequestUriRegistration(Optional requireRequestUriRegistration) { this.requireRequestUriRegistration = requireRequestUriRegistration; return this; } - @Override + @java.lang.Override public _FinalStage requestUriParameterSupported(Boolean requestUriParameterSupported) { this.requestUriParameterSupported = Optional.ofNullable(requestUriParameterSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "request_uri_parameter_supported", nulls = Nulls.SKIP) public _FinalStage requestUriParameterSupported(Optional requestUriParameterSupported) { this.requestUriParameterSupported = requestUriParameterSupported; return this; } - @Override + @java.lang.Override public _FinalStage requestParameterSupported(Boolean requestParameterSupported) { this.requestParameterSupported = Optional.ofNullable(requestParameterSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "request_parameter_supported", nulls = Nulls.SKIP) public _FinalStage requestParameterSupported(Optional requestParameterSupported) { this.requestParameterSupported = requestParameterSupported; return this; } - @Override + @java.lang.Override public _FinalStage requestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported) { this.requestObjectSigningAlgValuesSupported = Optional.ofNullable(requestObjectSigningAlgValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "request_object_signing_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage requestObjectSigningAlgValuesSupported( Optional> requestObjectSigningAlgValuesSupported) { @@ -1018,7 +1018,7 @@ public _FinalStage requestObjectSigningAlgValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage requestObjectEncryptionEncValuesSupported( List requestObjectEncryptionEncValuesSupported) { this.requestObjectEncryptionEncValuesSupported = @@ -1026,7 +1026,7 @@ public _FinalStage requestObjectEncryptionEncValuesSupported( return this; } - @Override + @java.lang.Override @JsonSetter(value = "request_object_encryption_enc_values_supported", nulls = Nulls.SKIP) public _FinalStage requestObjectEncryptionEncValuesSupported( Optional> requestObjectEncryptionEncValuesSupported) { @@ -1034,7 +1034,7 @@ public _FinalStage requestObjectEncryptionEncValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage requestObjectEncryptionAlgValuesSupported( List requestObjectEncryptionAlgValuesSupported) { this.requestObjectEncryptionAlgValuesSupported = @@ -1042,7 +1042,7 @@ public _FinalStage requestObjectEncryptionAlgValuesSupported( return this; } - @Override + @java.lang.Override @JsonSetter(value = "request_object_encryption_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage requestObjectEncryptionAlgValuesSupported( Optional> requestObjectEncryptionAlgValuesSupported) { @@ -1050,46 +1050,46 @@ public _FinalStage requestObjectEncryptionAlgValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage registrationEndpoint(String registrationEndpoint) { this.registrationEndpoint = Optional.ofNullable(registrationEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "registration_endpoint", nulls = Nulls.SKIP) public _FinalStage registrationEndpoint(Optional registrationEndpoint) { this.registrationEndpoint = registrationEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage opTosUri(String opTosUri) { this.opTosUri = Optional.ofNullable(opTosUri); return this; } - @Override + @java.lang.Override @JsonSetter(value = "op_tos_uri", nulls = Nulls.SKIP) public _FinalStage opTosUri(Optional opTosUri) { this.opTosUri = opTosUri; return this; } - @Override + @java.lang.Override public _FinalStage opPolicyUri(String opPolicyUri) { this.opPolicyUri = Optional.ofNullable(opPolicyUri); return this; } - @Override + @java.lang.Override @JsonSetter(value = "op_policy_uri", nulls = Nulls.SKIP) public _FinalStage opPolicyUri(Optional opPolicyUri) { this.opPolicyUri = opPolicyUri; return this; } - @Override + @java.lang.Override public _FinalStage addAllIdTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { if (idTokenSigningAlgValuesSupported != null) { this.idTokenSigningAlgValuesSupported.addAll(idTokenSigningAlgValuesSupported); @@ -1097,13 +1097,13 @@ public _FinalStage addAllIdTokenSigningAlgValuesSupported(List idTokenSi return this; } - @Override + @java.lang.Override public _FinalStage addIdTokenSigningAlgValuesSupported(String idTokenSigningAlgValuesSupported) { this.idTokenSigningAlgValuesSupported.add(idTokenSigningAlgValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_signing_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage idTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { this.idTokenSigningAlgValuesSupported.clear(); @@ -1113,13 +1113,13 @@ public _FinalStage idTokenSigningAlgValuesSupported(List idTokenSigningA return this; } - @Override + @java.lang.Override public _FinalStage idTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported) { this.idTokenEncryptionEncValuesSupported = Optional.ofNullable(idTokenEncryptionEncValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_encryption_enc_values_supported", nulls = Nulls.SKIP) public _FinalStage idTokenEncryptionEncValuesSupported( Optional> idTokenEncryptionEncValuesSupported) { @@ -1127,13 +1127,13 @@ public _FinalStage idTokenEncryptionEncValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage idTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported) { this.idTokenEncryptionAlgValuesSupported = Optional.ofNullable(idTokenEncryptionAlgValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_encryption_alg_values_supported", nulls = Nulls.SKIP) public _FinalStage idTokenEncryptionAlgValuesSupported( Optional> idTokenEncryptionAlgValuesSupported) { @@ -1141,111 +1141,111 @@ public _FinalStage idTokenEncryptionAlgValuesSupported( return this; } - @Override + @java.lang.Override public _FinalStage grantTypesSupported(List grantTypesSupported) { this.grantTypesSupported = Optional.ofNullable(grantTypesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "grant_types_supported", nulls = Nulls.SKIP) public _FinalStage grantTypesSupported(Optional> grantTypesSupported) { this.grantTypesSupported = grantTypesSupported; return this; } - @Override + @java.lang.Override public _FinalStage endSessionEndpoint(String endSessionEndpoint) { this.endSessionEndpoint = Optional.ofNullable(endSessionEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "end_session_endpoint", nulls = Nulls.SKIP) public _FinalStage endSessionEndpoint(Optional endSessionEndpoint) { this.endSessionEndpoint = endSessionEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage displayValuesSupported(List displayValuesSupported) { this.displayValuesSupported = Optional.ofNullable(displayValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "display_values_supported", nulls = Nulls.SKIP) public _FinalStage displayValuesSupported(Optional> displayValuesSupported) { this.displayValuesSupported = displayValuesSupported; return this; } - @Override + @java.lang.Override public _FinalStage claimsSupported(List claimsSupported) { this.claimsSupported = Optional.ofNullable(claimsSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "claims_supported", nulls = Nulls.SKIP) public _FinalStage claimsSupported(Optional> claimsSupported) { this.claimsSupported = claimsSupported; return this; } - @Override + @java.lang.Override public _FinalStage claimsParameterSupported(Boolean claimsParameterSupported) { this.claimsParameterSupported = Optional.ofNullable(claimsParameterSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "claims_parameter_supported", nulls = Nulls.SKIP) public _FinalStage claimsParameterSupported(Optional claimsParameterSupported) { this.claimsParameterSupported = claimsParameterSupported; return this; } - @Override + @java.lang.Override public _FinalStage claimsLocalesSupported(List claimsLocalesSupported) { this.claimsLocalesSupported = Optional.ofNullable(claimsLocalesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "claims_locales_supported", nulls = Nulls.SKIP) public _FinalStage claimsLocalesSupported(Optional> claimsLocalesSupported) { this.claimsLocalesSupported = claimsLocalesSupported; return this; } - @Override + @java.lang.Override public _FinalStage claimTypesSupported(List claimTypesSupported) { this.claimTypesSupported = Optional.ofNullable(claimTypesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "claim_types_supported", nulls = Nulls.SKIP) public _FinalStage claimTypesSupported(Optional> claimTypesSupported) { this.claimTypesSupported = claimTypesSupported; return this; } - @Override + @java.lang.Override public _FinalStage acrValuesSupported(List acrValuesSupported) { this.acrValuesSupported = Optional.ofNullable(acrValuesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "acr_values_supported", nulls = Nulls.SKIP) public _FinalStage acrValuesSupported(Optional> acrValuesSupported) { this.acrValuesSupported = acrValuesSupported; return this; } - @Override + @java.lang.Override public ConnectionOptionsOidcMetadata build() { return new ConnectionOptionsOidcMetadata( acrValuesSupported, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java index a54f2f5ea..9e73459de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java @@ -53,7 +53,7 @@ public final class ConnectionOptionsOkta implements IConnectionOptionsCommonOidc private final Optional setUserRootAttributes; - private final OptionalNullable tenantDomain; + private final Optional tenantDomain; private final Optional tokenEndpoint; @@ -91,7 +91,7 @@ private ConnectionOptionsOkta( Optional scope, Optional sendBackChannelNonce, Optional setUserRootAttributes, - OptionalNullable tenantDomain, + Optional tenantDomain, Optional tokenEndpoint, OptionalNullable tokenEndpointAuthMethod, OptionalNullable tokenEndpointAuthSigningAlg, @@ -130,32 +130,32 @@ private ConnectionOptionsOkta( } @JsonProperty("authorization_endpoint") - @Override + @java.lang.Override public Optional getAuthorizationEndpoint() { return authorizationEndpoint; } @JsonProperty("client_id") - @Override + @java.lang.Override public String getClientId() { return clientId; } @JsonProperty("client_secret") - @Override + @java.lang.Override public Optional getClientSecret() { return clientSecret; } @JsonProperty("connection_settings") - @Override + @java.lang.Override public Optional getConnectionSettings() { return connectionSettings; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") - @Override + @java.lang.Override public OptionalNullable getFederatedConnectionsAccessTokens() { if (federatedConnectionsAccessTokens == null) { return OptionalNullable.absent(); @@ -164,20 +164,20 @@ public OptionalNullable getFederated } @JsonProperty("domain_aliases") - @Override + @java.lang.Override public Optional> getDomainAliases() { return domainAliases; } @JsonProperty("icon_url") - @Override + @java.lang.Override public Optional getIconUrl() { return iconUrl; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("id_token_signed_response_algs") - @Override + @java.lang.Override public OptionalNullable> getIdTokenSignedResponseAlgs() { if (idTokenSignedResponseAlgs == null) { return OptionalNullable.absent(); @@ -186,60 +186,56 @@ public OptionalNullable> getIdToken } @JsonProperty("issuer") - @Override + @java.lang.Override public Optional getIssuer() { return issuer; } @JsonProperty("jwks_uri") - @Override + @java.lang.Override public Optional getJwksUri() { return jwksUri; } @JsonProperty("oidc_metadata") - @Override + @java.lang.Override public Optional getOidcMetadata() { return oidcMetadata; } @JsonProperty("scope") - @Override + @java.lang.Override public Optional getScope() { return scope; } @JsonProperty("send_back_channel_nonce") - @Override + @java.lang.Override public Optional getSendBackChannelNonce() { return sendBackChannelNonce; } @JsonProperty("set_user_root_attributes") - @Override + @java.lang.Override public Optional getSetUserRootAttributes() { return setUserRootAttributes; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("tenant_domain") - @Override - public OptionalNullable getTenantDomain() { - if (tenantDomain == null) { - return OptionalNullable.absent(); - } + @java.lang.Override + public Optional getTenantDomain() { return tenantDomain; } @JsonProperty("token_endpoint") - @Override + @java.lang.Override public Optional getTokenEndpoint() { return tokenEndpoint; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthMethod() { if (tokenEndpointAuthMethod == null) { return OptionalNullable.absent(); @@ -249,7 +245,7 @@ public OptionalNullable getTokenEndpointA @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_signing_alg") - @Override + @java.lang.Override public OptionalNullable getTokenEndpointAuthSigningAlg() { if (tokenEndpointAuthSigningAlg == null) { return OptionalNullable.absent(); @@ -259,19 +255,22 @@ public OptionalNullable getTokenEndpo @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("upstream_params") - @Override + @java.lang.Override public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } return upstreamParams; } @JsonProperty("userinfo_endpoint") - @Override + @java.lang.Override public Optional getUserinfoEndpoint() { return userinfoEndpoint; } @JsonProperty("non_persistent_attrs") - @Override + @java.lang.Override public Optional> getNonPersistentAttrs() { return nonPersistentAttrs; } @@ -303,12 +302,6 @@ private OptionalNullable> _getIdTok return idTokenSignedResponseAlgs; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("tenant_domain") - private OptionalNullable _getTenantDomain() { - return tenantDomain; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") private OptionalNullable _getTokenEndpointAuthMethod() { @@ -321,7 +314,14 @@ private OptionalNullable _getTokenEnd return tokenEndpointAuthSigningAlg; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionOptionsOkta && equalTo((ConnectionOptionsOkta) other); @@ -359,7 +359,7 @@ private boolean equalTo(ConnectionOptionsOkta other) { && type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.authorizationEndpoint, @@ -388,7 +388,7 @@ public int hashCode() { this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -476,13 +476,9 @@ _FinalStage idTokenSignedResponseAlgs( _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes); - _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain); - - _FinalStage tenantDomain(String tenantDomain); - _FinalStage tenantDomain(Optional tenantDomain); - _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain); + _FinalStage tenantDomain(String tenantDomain); _FinalStage tokenEndpoint(Optional tokenEndpoint); @@ -511,7 +507,9 @@ _FinalStage tokenEndpointAuthSigningAlg( tokenEndpointAuthSigningAlg); _FinalStage upstreamParams( - OptionalNullable>> upstreamParams); + @Nullable + OptionalNullable>> + upstreamParams); _FinalStage upstreamParams( Map> upstreamParams); @@ -570,7 +568,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Optional tokenEndpoint = Optional.empty(); - private OptionalNullable tenantDomain = OptionalNullable.absent(); + private Optional tenantDomain = Optional.empty(); private Optional setUserRootAttributes = Optional.empty(); @@ -605,7 +603,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionOptionsOkta other) { authorizationEndpoint(other.getAuthorizationEndpoint()); clientId(other.getClientId()); @@ -634,79 +632,79 @@ public Builder from(ConnectionOptionsOkta other) { return this; } - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage type(String type) { this.type = Optional.ofNullable(type); return this; } - @Override + @java.lang.Override @JsonSetter(value = "type", nulls = Nulls.SKIP) public _FinalStage type(Optional type) { this.type = type; return this; } - @Override + @java.lang.Override public _FinalStage domain(String domain) { this.domain = Optional.ofNullable(domain); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain", nulls = Nulls.SKIP) public _FinalStage domain(Optional domain) { this.domain = domain; return this; } - @Override + @java.lang.Override public _FinalStage attributeMap(ConnectionAttributeMapOkta attributeMap) { this.attributeMap = Optional.ofNullable(attributeMap); return this; } - @Override + @java.lang.Override @JsonSetter(value = "attribute_map", nulls = Nulls.SKIP) public _FinalStage attributeMap(Optional attributeMap) { this.attributeMap = attributeMap; return this; } - @Override + @java.lang.Override public _FinalStage nonPersistentAttrs(List nonPersistentAttrs) { this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) public _FinalStage nonPersistentAttrs(Optional> nonPersistentAttrs) { this.nonPersistentAttrs = nonPersistentAttrs; return this; } - @Override + @java.lang.Override public _FinalStage userinfoEndpoint(String userinfoEndpoint) { this.userinfoEndpoint = Optional.ofNullable(userinfoEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "userinfo_endpoint", nulls = Nulls.SKIP) public _FinalStage userinfoEndpoint(Optional userinfoEndpoint) { this.userinfoEndpoint = userinfoEndpoint; return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( com.auth0.client.mgmt.core.Nullable< Map>> @@ -721,7 +719,7 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Optional>> upstreamParams) { if (upstreamParams.isPresent()) { @@ -732,23 +730,24 @@ public _FinalStage upstreamParams( return this; } - @Override + @java.lang.Override public _FinalStage upstreamParams( Map> upstreamParams) { this.upstreamParams = OptionalNullable.of(upstreamParams); return this; } - @Override + @java.lang.Override @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) public _FinalStage upstreamParams( - OptionalNullable>> - upstreamParams) { + @Nullable + OptionalNullable>> + upstreamParams) { this.upstreamParams = upstreamParams; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthSigningAlg) { @@ -762,7 +761,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( Optional tokenEndpointAuthSigningAlg) { if (tokenEndpointAuthSigningAlg.isPresent()) { @@ -773,14 +772,14 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthSigningAlg( ConnectionTokenEndpointAuthSigningAlgEnum tokenEndpointAuthSigningAlg) { this.tokenEndpointAuthSigningAlg = OptionalNullable.of(tokenEndpointAuthSigningAlg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_signing_alg", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthSigningAlg( @Nullable OptionalNullable tokenEndpointAuthSigningAlg) { @@ -788,7 +787,7 @@ public _FinalStage tokenEndpointAuthSigningAlg( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( com.auth0.client.mgmt.core.Nullable tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isNull()) { @@ -801,7 +800,7 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod( Optional tokenEndpointAuthMethod) { if (tokenEndpointAuthMethod.isPresent()) { @@ -812,13 +811,13 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod(ConnectionTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { this.tokenEndpointAuthMethod = OptionalNullable.of(tokenEndpointAuthMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethod( @Nullable OptionalNullable tokenEndpointAuthMethod) { @@ -826,133 +825,111 @@ public _FinalStage tokenEndpointAuthMethod( return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = Optional.ofNullable(tokenEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint", nulls = Nulls.SKIP) public _FinalStage tokenEndpoint(Optional tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; return this; } - @Override - public _FinalStage tenantDomain(com.auth0.client.mgmt.core.Nullable tenantDomain) { - if (tenantDomain.isNull()) { - this.tenantDomain = OptionalNullable.ofNull(); - } else if (tenantDomain.isEmpty()) { - this.tenantDomain = OptionalNullable.absent(); - } else { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } - return this; - } - - @Override - public _FinalStage tenantDomain(Optional tenantDomain) { - if (tenantDomain.isPresent()) { - this.tenantDomain = OptionalNullable.of(tenantDomain.get()); - } else { - this.tenantDomain = OptionalNullable.absent(); - } - return this; - } - - @Override + @java.lang.Override public _FinalStage tenantDomain(String tenantDomain) { - this.tenantDomain = OptionalNullable.of(tenantDomain); + this.tenantDomain = Optional.ofNullable(tenantDomain); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) - public _FinalStage tenantDomain(@Nullable OptionalNullable tenantDomain) { + public _FinalStage tenantDomain(Optional tenantDomain) { this.tenantDomain = tenantDomain; return this; } - @Override + @java.lang.Override public _FinalStage setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) public _FinalStage setUserRootAttributes(Optional setUserRootAttributes) { this.setUserRootAttributes = setUserRootAttributes; return this; } - @Override + @java.lang.Override public _FinalStage sendBackChannelNonce(Boolean sendBackChannelNonce) { this.sendBackChannelNonce = Optional.ofNullable(sendBackChannelNonce); return this; } - @Override + @java.lang.Override @JsonSetter(value = "send_back_channel_nonce", nulls = Nulls.SKIP) public _FinalStage sendBackChannelNonce(Optional sendBackChannelNonce) { this.sendBackChannelNonce = sendBackChannelNonce; return this; } - @Override + @java.lang.Override public _FinalStage scope(String scope) { this.scope = Optional.ofNullable(scope); return this; } - @Override + @java.lang.Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) public _FinalStage scope(Optional scope) { this.scope = scope; return this; } - @Override + @java.lang.Override public _FinalStage oidcMetadata(ConnectionOptionsOidcMetadata oidcMetadata) { this.oidcMetadata = Optional.ofNullable(oidcMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_metadata", nulls = Nulls.SKIP) public _FinalStage oidcMetadata(Optional oidcMetadata) { this.oidcMetadata = oidcMetadata; return this; } - @Override + @java.lang.Override public _FinalStage jwksUri(String jwksUri) { this.jwksUri = Optional.ofNullable(jwksUri); return this; } - @Override + @java.lang.Override @JsonSetter(value = "jwks_uri", nulls = Nulls.SKIP) public _FinalStage jwksUri(Optional jwksUri) { this.jwksUri = jwksUri; return this; } - @Override + @java.lang.Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( com.auth0.client.mgmt.core.Nullable> idTokenSignedResponseAlgs) { @@ -966,7 +943,7 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( Optional> idTokenSignedResponseAlgs) { if (idTokenSignedResponseAlgs.isPresent()) { @@ -977,14 +954,14 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage idTokenSignedResponseAlgs( List idTokenSignedResponseAlgs) { this.idTokenSignedResponseAlgs = OptionalNullable.of(idTokenSignedResponseAlgs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id_token_signed_response_algs", nulls = Nulls.SKIP) public _FinalStage idTokenSignedResponseAlgs( @Nullable OptionalNullable> idTokenSignedResponseAlgs) { @@ -992,33 +969,33 @@ public _FinalStage idTokenSignedResponseAlgs( return this; } - @Override + @java.lang.Override public _FinalStage iconUrl(String iconUrl) { this.iconUrl = Optional.ofNullable(iconUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) public _FinalStage iconUrl(Optional iconUrl) { this.iconUrl = iconUrl; return this; } - @Override + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) public _FinalStage domainAliases(Optional> domainAliases) { this.domainAliases = domainAliases; return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( com.auth0.client.mgmt.core.Nullable federatedConnectionsAccessTokens) { @@ -1032,7 +1009,7 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( Optional federatedConnectionsAccessTokens) { if (federatedConnectionsAccessTokens.isPresent()) { @@ -1043,14 +1020,14 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage federatedConnectionsAccessTokens( ConnectionFederatedConnectionsAccessTokens federatedConnectionsAccessTokens) { this.federatedConnectionsAccessTokens = OptionalNullable.of(federatedConnectionsAccessTokens); return this; } - @Override + @java.lang.Override @JsonSetter(value = "federated_connections_access_tokens", nulls = Nulls.SKIP) public _FinalStage federatedConnectionsAccessTokens( @Nullable @@ -1059,46 +1036,46 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } - @Override + @java.lang.Override public _FinalStage connectionSettings(ConnectionConnectionSettings connectionSettings) { this.connectionSettings = Optional.ofNullable(connectionSettings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_settings", nulls = Nulls.SKIP) public _FinalStage connectionSettings(Optional connectionSettings) { this.connectionSettings = connectionSettings; return this; } - @Override + @java.lang.Override public _FinalStage clientSecret(String clientSecret) { this.clientSecret = Optional.ofNullable(clientSecret); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) public _FinalStage clientSecret(Optional clientSecret) { this.clientSecret = clientSecret; return this; } - @Override + @java.lang.Override public _FinalStage authorizationEndpoint(String authorizationEndpoint) { this.authorizationEndpoint = Optional.ofNullable(authorizationEndpoint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authorization_endpoint", nulls = Nulls.SKIP) public _FinalStage authorizationEndpoint(Optional authorizationEndpoint) { this.authorizationEndpoint = authorizationEndpoint; return this; } - @Override + @java.lang.Override public ConnectionOptionsOkta build() { return new ConnectionOptionsOkta( authorizationEndpoint, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsSaml.java new file mode 100644 index 000000000..01f44cc52 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsSaml.java @@ -0,0 +1,949 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionOptionsSaml.Builder.class) +public final class ConnectionOptionsSaml { + private final Optional cert; + + private final Optional debug; + + private final Optional decryptionKey; + + private final Optional deflate; + + private final Optional destinationUrl; + + private final Optional digestAlgorithm; + + private final Optional disableSignout; + + private final Optional> domainAliases; + + private final Optional entityId; + + private final Optional> fieldsMap; + + private final Optional globalTokenRevocationJwtIss; + + private final Optional globalTokenRevocationJwtSub; + + private final Optional iconUrl; + + private final Optional idpinitiated; + + private final Optional metadataUrl; + + private final Optional metadataXml; + + private final Optional> nonPersistentAttrs; + + private final Optional protocolBinding; + + private final Optional recipientUrl; + + private final Optional requestTemplate; + + private final Optional setUserRootAttributes; + + private final Optional signInEndpoint; + + private final Optional signOutEndpoint; + + private final Optional signSamlRequest; + + private final Optional signatureAlgorithm; + + private final Optional signingCert; + + private final Optional signingKey; + + private final Optional tenantDomain; + + private final Optional> thumbprints; + + private final OptionalNullable>> + upstreamParams; + + private final Optional userIdAttribute; + + private final Map additionalProperties; + + private ConnectionOptionsSaml( + Optional cert, + Optional debug, + Optional decryptionKey, + Optional deflate, + Optional destinationUrl, + Optional digestAlgorithm, + Optional disableSignout, + Optional> domainAliases, + Optional entityId, + Optional> fieldsMap, + Optional globalTokenRevocationJwtIss, + Optional globalTokenRevocationJwtSub, + Optional iconUrl, + Optional idpinitiated, + Optional metadataUrl, + Optional metadataXml, + Optional> nonPersistentAttrs, + Optional protocolBinding, + Optional recipientUrl, + Optional requestTemplate, + Optional setUserRootAttributes, + Optional signInEndpoint, + Optional signOutEndpoint, + Optional signSamlRequest, + Optional signatureAlgorithm, + Optional signingCert, + Optional signingKey, + Optional tenantDomain, + Optional> thumbprints, + OptionalNullable>> upstreamParams, + Optional userIdAttribute, + Map additionalProperties) { + this.cert = cert; + this.debug = debug; + this.decryptionKey = decryptionKey; + this.deflate = deflate; + this.destinationUrl = destinationUrl; + this.digestAlgorithm = digestAlgorithm; + this.disableSignout = disableSignout; + this.domainAliases = domainAliases; + this.entityId = entityId; + this.fieldsMap = fieldsMap; + this.globalTokenRevocationJwtIss = globalTokenRevocationJwtIss; + this.globalTokenRevocationJwtSub = globalTokenRevocationJwtSub; + this.iconUrl = iconUrl; + this.idpinitiated = idpinitiated; + this.metadataUrl = metadataUrl; + this.metadataXml = metadataXml; + this.nonPersistentAttrs = nonPersistentAttrs; + this.protocolBinding = protocolBinding; + this.recipientUrl = recipientUrl; + this.requestTemplate = requestTemplate; + this.setUserRootAttributes = setUserRootAttributes; + this.signInEndpoint = signInEndpoint; + this.signOutEndpoint = signOutEndpoint; + this.signSamlRequest = signSamlRequest; + this.signatureAlgorithm = signatureAlgorithm; + this.signingCert = signingCert; + this.signingKey = signingKey; + this.tenantDomain = tenantDomain; + this.thumbprints = thumbprints; + this.upstreamParams = upstreamParams; + this.userIdAttribute = userIdAttribute; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("cert") + public Optional getCert() { + return cert; + } + + @JsonProperty("debug") + public Optional getDebug() { + return debug; + } + + @JsonProperty("decryptionKey") + public Optional getDecryptionKey() { + return decryptionKey; + } + + @JsonProperty("deflate") + public Optional getDeflate() { + return deflate; + } + + @JsonProperty("destinationUrl") + public Optional getDestinationUrl() { + return destinationUrl; + } + + @JsonProperty("digestAlgorithm") + public Optional getDigestAlgorithm() { + return digestAlgorithm; + } + + /** + * @return When true, disables sending SAML logout requests (SingleLogoutService) to the identity provider during user sign-out. The user will be logged out of Auth0 but will remain logged into the identity provider. Defaults to false (federated logout enabled). + */ + @JsonProperty("disableSignout") + public Optional getDisableSignout() { + return disableSignout; + } + + @JsonProperty("domain_aliases") + public Optional> getDomainAliases() { + return domainAliases; + } + + @JsonProperty("entityId") + public Optional getEntityId() { + return entityId; + } + + @JsonProperty("fieldsMap") + public Optional> getFieldsMap() { + return fieldsMap; + } + + /** + * @return Expected 'iss' (Issuer) claim value for JWT tokens in Global Token Revocation requests from the identity provider. When configured, Auth0 validates the JWT issuer matches this value before processing token revocation. Must be used together with global_token_revocation_jwt_sub. + */ + @JsonProperty("global_token_revocation_jwt_iss") + public Optional getGlobalTokenRevocationJwtIss() { + return globalTokenRevocationJwtIss; + } + + /** + * @return Expected 'sub' (Subject) claim value for JWT tokens in Global Token Revocation requests from the identity provider. When configured, Auth0 validates the JWT subject matches this value before processing token revocation. Must be used together with global_token_revocation_jwt_iss. + */ + @JsonProperty("global_token_revocation_jwt_sub") + public Optional getGlobalTokenRevocationJwtSub() { + return globalTokenRevocationJwtSub; + } + + @JsonProperty("icon_url") + public Optional getIconUrl() { + return iconUrl; + } + + @JsonProperty("idpinitiated") + public Optional getIdpinitiated() { + return idpinitiated; + } + + @JsonProperty("metadataUrl") + public Optional getMetadataUrl() { + return metadataUrl; + } + + @JsonProperty("metadataXml") + public Optional getMetadataXml() { + return metadataXml; + } + + @JsonProperty("non_persistent_attrs") + public Optional> getNonPersistentAttrs() { + return nonPersistentAttrs; + } + + @JsonProperty("protocolBinding") + public Optional getProtocolBinding() { + return protocolBinding; + } + + @JsonProperty("recipientUrl") + public Optional getRecipientUrl() { + return recipientUrl; + } + + @JsonProperty("requestTemplate") + public Optional getRequestTemplate() { + return requestTemplate; + } + + @JsonProperty("set_user_root_attributes") + public Optional getSetUserRootAttributes() { + return setUserRootAttributes; + } + + @JsonProperty("signInEndpoint") + public Optional getSignInEndpoint() { + return signInEndpoint; + } + + @JsonProperty("signOutEndpoint") + public Optional getSignOutEndpoint() { + return signOutEndpoint; + } + + @JsonProperty("signSAMLRequest") + public Optional getSignSamlRequest() { + return signSamlRequest; + } + + @JsonProperty("signatureAlgorithm") + public Optional getSignatureAlgorithm() { + return signatureAlgorithm; + } + + @JsonProperty("signingCert") + public Optional getSigningCert() { + return signingCert; + } + + @JsonProperty("signing_key") + public Optional getSigningKey() { + return signingKey; + } + + @JsonProperty("tenant_domain") + public Optional getTenantDomain() { + return tenantDomain; + } + + /** + * @return SHA-1 thumbprints (fingerprints) of the identity provider's signing certificates. Automatically computed from signingCert during connection creation. Each thumbprint must be a 40-character hexadecimal string. + */ + @JsonProperty("thumbprints") + public Optional> getThumbprints() { + return thumbprints; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + public OptionalNullable>> getUpstreamParams() { + if (upstreamParams == null) { + return OptionalNullable.absent(); + } + return upstreamParams; + } + + @JsonProperty("user_id_attribute") + public Optional getUserIdAttribute() { + return userIdAttribute; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upstream_params") + private OptionalNullable>> + _getUpstreamParams() { + return upstreamParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionOptionsSaml && equalTo((ConnectionOptionsSaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionOptionsSaml other) { + return cert.equals(other.cert) + && debug.equals(other.debug) + && decryptionKey.equals(other.decryptionKey) + && deflate.equals(other.deflate) + && destinationUrl.equals(other.destinationUrl) + && digestAlgorithm.equals(other.digestAlgorithm) + && disableSignout.equals(other.disableSignout) + && domainAliases.equals(other.domainAliases) + && entityId.equals(other.entityId) + && fieldsMap.equals(other.fieldsMap) + && globalTokenRevocationJwtIss.equals(other.globalTokenRevocationJwtIss) + && globalTokenRevocationJwtSub.equals(other.globalTokenRevocationJwtSub) + && iconUrl.equals(other.iconUrl) + && idpinitiated.equals(other.idpinitiated) + && metadataUrl.equals(other.metadataUrl) + && metadataXml.equals(other.metadataXml) + && nonPersistentAttrs.equals(other.nonPersistentAttrs) + && protocolBinding.equals(other.protocolBinding) + && recipientUrl.equals(other.recipientUrl) + && requestTemplate.equals(other.requestTemplate) + && setUserRootAttributes.equals(other.setUserRootAttributes) + && signInEndpoint.equals(other.signInEndpoint) + && signOutEndpoint.equals(other.signOutEndpoint) + && signSamlRequest.equals(other.signSamlRequest) + && signatureAlgorithm.equals(other.signatureAlgorithm) + && signingCert.equals(other.signingCert) + && signingKey.equals(other.signingKey) + && tenantDomain.equals(other.tenantDomain) + && thumbprints.equals(other.thumbprints) + && upstreamParams.equals(other.upstreamParams) + && userIdAttribute.equals(other.userIdAttribute); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cert, + this.debug, + this.decryptionKey, + this.deflate, + this.destinationUrl, + this.digestAlgorithm, + this.disableSignout, + this.domainAliases, + this.entityId, + this.fieldsMap, + this.globalTokenRevocationJwtIss, + this.globalTokenRevocationJwtSub, + this.iconUrl, + this.idpinitiated, + this.metadataUrl, + this.metadataXml, + this.nonPersistentAttrs, + this.protocolBinding, + this.recipientUrl, + this.requestTemplate, + this.setUserRootAttributes, + this.signInEndpoint, + this.signOutEndpoint, + this.signSamlRequest, + this.signatureAlgorithm, + this.signingCert, + this.signingKey, + this.tenantDomain, + this.thumbprints, + this.upstreamParams, + this.userIdAttribute); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cert = Optional.empty(); + + private Optional debug = Optional.empty(); + + private Optional decryptionKey = Optional.empty(); + + private Optional deflate = Optional.empty(); + + private Optional destinationUrl = Optional.empty(); + + private Optional digestAlgorithm = Optional.empty(); + + private Optional disableSignout = Optional.empty(); + + private Optional> domainAliases = Optional.empty(); + + private Optional entityId = Optional.empty(); + + private Optional> fieldsMap = Optional.empty(); + + private Optional globalTokenRevocationJwtIss = Optional.empty(); + + private Optional globalTokenRevocationJwtSub = Optional.empty(); + + private Optional iconUrl = Optional.empty(); + + private Optional idpinitiated = Optional.empty(); + + private Optional metadataUrl = Optional.empty(); + + private Optional metadataXml = Optional.empty(); + + private Optional> nonPersistentAttrs = Optional.empty(); + + private Optional protocolBinding = Optional.empty(); + + private Optional recipientUrl = Optional.empty(); + + private Optional requestTemplate = Optional.empty(); + + private Optional setUserRootAttributes = Optional.empty(); + + private Optional signInEndpoint = Optional.empty(); + + private Optional signOutEndpoint = Optional.empty(); + + private Optional signSamlRequest = Optional.empty(); + + private Optional signatureAlgorithm = Optional.empty(); + + private Optional signingCert = Optional.empty(); + + private Optional signingKey = Optional.empty(); + + private Optional tenantDomain = Optional.empty(); + + private Optional> thumbprints = Optional.empty(); + + private OptionalNullable>> upstreamParams = + OptionalNullable.absent(); + + private Optional userIdAttribute = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionOptionsSaml other) { + cert(other.getCert()); + debug(other.getDebug()); + decryptionKey(other.getDecryptionKey()); + deflate(other.getDeflate()); + destinationUrl(other.getDestinationUrl()); + digestAlgorithm(other.getDigestAlgorithm()); + disableSignout(other.getDisableSignout()); + domainAliases(other.getDomainAliases()); + entityId(other.getEntityId()); + fieldsMap(other.getFieldsMap()); + globalTokenRevocationJwtIss(other.getGlobalTokenRevocationJwtIss()); + globalTokenRevocationJwtSub(other.getGlobalTokenRevocationJwtSub()); + iconUrl(other.getIconUrl()); + idpinitiated(other.getIdpinitiated()); + metadataUrl(other.getMetadataUrl()); + metadataXml(other.getMetadataXml()); + nonPersistentAttrs(other.getNonPersistentAttrs()); + protocolBinding(other.getProtocolBinding()); + recipientUrl(other.getRecipientUrl()); + requestTemplate(other.getRequestTemplate()); + setUserRootAttributes(other.getSetUserRootAttributes()); + signInEndpoint(other.getSignInEndpoint()); + signOutEndpoint(other.getSignOutEndpoint()); + signSamlRequest(other.getSignSamlRequest()); + signatureAlgorithm(other.getSignatureAlgorithm()); + signingCert(other.getSigningCert()); + signingKey(other.getSigningKey()); + tenantDomain(other.getTenantDomain()); + thumbprints(other.getThumbprints()); + upstreamParams(other.getUpstreamParams()); + userIdAttribute(other.getUserIdAttribute()); + return this; + } + + @JsonSetter(value = "cert", nulls = Nulls.SKIP) + public Builder cert(Optional cert) { + this.cert = cert; + return this; + } + + public Builder cert(String cert) { + this.cert = Optional.ofNullable(cert); + return this; + } + + @JsonSetter(value = "debug", nulls = Nulls.SKIP) + public Builder debug(Optional debug) { + this.debug = debug; + return this; + } + + public Builder debug(Boolean debug) { + this.debug = Optional.ofNullable(debug); + return this; + } + + @JsonSetter(value = "decryptionKey", nulls = Nulls.SKIP) + public Builder decryptionKey(Optional decryptionKey) { + this.decryptionKey = decryptionKey; + return this; + } + + public Builder decryptionKey(String decryptionKey) { + this.decryptionKey = Optional.ofNullable(decryptionKey); + return this; + } + + @JsonSetter(value = "deflate", nulls = Nulls.SKIP) + public Builder deflate(Optional deflate) { + this.deflate = deflate; + return this; + } + + public Builder deflate(Boolean deflate) { + this.deflate = Optional.ofNullable(deflate); + return this; + } + + @JsonSetter(value = "destinationUrl", nulls = Nulls.SKIP) + public Builder destinationUrl(Optional destinationUrl) { + this.destinationUrl = destinationUrl; + return this; + } + + public Builder destinationUrl(String destinationUrl) { + this.destinationUrl = Optional.ofNullable(destinationUrl); + return this; + } + + @JsonSetter(value = "digestAlgorithm", nulls = Nulls.SKIP) + public Builder digestAlgorithm(Optional digestAlgorithm) { + this.digestAlgorithm = digestAlgorithm; + return this; + } + + public Builder digestAlgorithm(ConnectionDigestAlgorithmEnumSaml digestAlgorithm) { + this.digestAlgorithm = Optional.ofNullable(digestAlgorithm); + return this; + } + + /** + *

When true, disables sending SAML logout requests (SingleLogoutService) to the identity provider during user sign-out. The user will be logged out of Auth0 but will remain logged into the identity provider. Defaults to false (federated logout enabled).

+ */ + @JsonSetter(value = "disableSignout", nulls = Nulls.SKIP) + public Builder disableSignout(Optional disableSignout) { + this.disableSignout = disableSignout; + return this; + } + + public Builder disableSignout(Boolean disableSignout) { + this.disableSignout = Optional.ofNullable(disableSignout); + return this; + } + + @JsonSetter(value = "domain_aliases", nulls = Nulls.SKIP) + public Builder domainAliases(Optional> domainAliases) { + this.domainAliases = domainAliases; + return this; + } + + public Builder domainAliases(List domainAliases) { + this.domainAliases = Optional.ofNullable(domainAliases); + return this; + } + + @JsonSetter(value = "entityId", nulls = Nulls.SKIP) + public Builder entityId(Optional entityId) { + this.entityId = entityId; + return this; + } + + public Builder entityId(String entityId) { + this.entityId = Optional.ofNullable(entityId); + return this; + } + + @JsonSetter(value = "fieldsMap", nulls = Nulls.SKIP) + public Builder fieldsMap(Optional> fieldsMap) { + this.fieldsMap = fieldsMap; + return this; + } + + public Builder fieldsMap(Map fieldsMap) { + this.fieldsMap = Optional.ofNullable(fieldsMap); + return this; + } + + /** + *

Expected 'iss' (Issuer) claim value for JWT tokens in Global Token Revocation requests from the identity provider. When configured, Auth0 validates the JWT issuer matches this value before processing token revocation. Must be used together with global_token_revocation_jwt_sub.

+ */ + @JsonSetter(value = "global_token_revocation_jwt_iss", nulls = Nulls.SKIP) + public Builder globalTokenRevocationJwtIss(Optional globalTokenRevocationJwtIss) { + this.globalTokenRevocationJwtIss = globalTokenRevocationJwtIss; + return this; + } + + public Builder globalTokenRevocationJwtIss(String globalTokenRevocationJwtIss) { + this.globalTokenRevocationJwtIss = Optional.ofNullable(globalTokenRevocationJwtIss); + return this; + } + + /** + *

Expected 'sub' (Subject) claim value for JWT tokens in Global Token Revocation requests from the identity provider. When configured, Auth0 validates the JWT subject matches this value before processing token revocation. Must be used together with global_token_revocation_jwt_iss.

+ */ + @JsonSetter(value = "global_token_revocation_jwt_sub", nulls = Nulls.SKIP) + public Builder globalTokenRevocationJwtSub(Optional globalTokenRevocationJwtSub) { + this.globalTokenRevocationJwtSub = globalTokenRevocationJwtSub; + return this; + } + + public Builder globalTokenRevocationJwtSub(String globalTokenRevocationJwtSub) { + this.globalTokenRevocationJwtSub = Optional.ofNullable(globalTokenRevocationJwtSub); + return this; + } + + @JsonSetter(value = "icon_url", nulls = Nulls.SKIP) + public Builder iconUrl(Optional iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + public Builder iconUrl(String iconUrl) { + this.iconUrl = Optional.ofNullable(iconUrl); + return this; + } + + @JsonSetter(value = "idpinitiated", nulls = Nulls.SKIP) + public Builder idpinitiated(Optional idpinitiated) { + this.idpinitiated = idpinitiated; + return this; + } + + public Builder idpinitiated(ConnectionOptionsIdpinitiatedSaml idpinitiated) { + this.idpinitiated = Optional.ofNullable(idpinitiated); + return this; + } + + @JsonSetter(value = "metadataUrl", nulls = Nulls.SKIP) + public Builder metadataUrl(Optional metadataUrl) { + this.metadataUrl = metadataUrl; + return this; + } + + public Builder metadataUrl(String metadataUrl) { + this.metadataUrl = Optional.ofNullable(metadataUrl); + return this; + } + + @JsonSetter(value = "metadataXml", nulls = Nulls.SKIP) + public Builder metadataXml(Optional metadataXml) { + this.metadataXml = metadataXml; + return this; + } + + public Builder metadataXml(String metadataXml) { + this.metadataXml = Optional.ofNullable(metadataXml); + return this; + } + + @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) + public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { + this.nonPersistentAttrs = nonPersistentAttrs; + return this; + } + + public Builder nonPersistentAttrs(List nonPersistentAttrs) { + this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); + return this; + } + + @JsonSetter(value = "protocolBinding", nulls = Nulls.SKIP) + public Builder protocolBinding(Optional protocolBinding) { + this.protocolBinding = protocolBinding; + return this; + } + + public Builder protocolBinding(ConnectionProtocolBindingEnumSaml protocolBinding) { + this.protocolBinding = Optional.ofNullable(protocolBinding); + return this; + } + + @JsonSetter(value = "recipientUrl", nulls = Nulls.SKIP) + public Builder recipientUrl(Optional recipientUrl) { + this.recipientUrl = recipientUrl; + return this; + } + + public Builder recipientUrl(String recipientUrl) { + this.recipientUrl = Optional.ofNullable(recipientUrl); + return this; + } + + @JsonSetter(value = "requestTemplate", nulls = Nulls.SKIP) + public Builder requestTemplate(Optional requestTemplate) { + this.requestTemplate = requestTemplate; + return this; + } + + public Builder requestTemplate(String requestTemplate) { + this.requestTemplate = Optional.ofNullable(requestTemplate); + return this; + } + + @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) + public Builder setUserRootAttributes(Optional setUserRootAttributes) { + this.setUserRootAttributes = setUserRootAttributes; + return this; + } + + public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { + this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); + return this; + } + + @JsonSetter(value = "signInEndpoint", nulls = Nulls.SKIP) + public Builder signInEndpoint(Optional signInEndpoint) { + this.signInEndpoint = signInEndpoint; + return this; + } + + public Builder signInEndpoint(String signInEndpoint) { + this.signInEndpoint = Optional.ofNullable(signInEndpoint); + return this; + } + + @JsonSetter(value = "signOutEndpoint", nulls = Nulls.SKIP) + public Builder signOutEndpoint(Optional signOutEndpoint) { + this.signOutEndpoint = signOutEndpoint; + return this; + } + + public Builder signOutEndpoint(String signOutEndpoint) { + this.signOutEndpoint = Optional.ofNullable(signOutEndpoint); + return this; + } + + @JsonSetter(value = "signSAMLRequest", nulls = Nulls.SKIP) + public Builder signSamlRequest(Optional signSamlRequest) { + this.signSamlRequest = signSamlRequest; + return this; + } + + public Builder signSamlRequest(Boolean signSamlRequest) { + this.signSamlRequest = Optional.ofNullable(signSamlRequest); + return this; + } + + @JsonSetter(value = "signatureAlgorithm", nulls = Nulls.SKIP) + public Builder signatureAlgorithm(Optional signatureAlgorithm) { + this.signatureAlgorithm = signatureAlgorithm; + return this; + } + + public Builder signatureAlgorithm(ConnectionSignatureAlgorithmEnumSaml signatureAlgorithm) { + this.signatureAlgorithm = Optional.ofNullable(signatureAlgorithm); + return this; + } + + @JsonSetter(value = "signingCert", nulls = Nulls.SKIP) + public Builder signingCert(Optional signingCert) { + this.signingCert = signingCert; + return this; + } + + public Builder signingCert(String signingCert) { + this.signingCert = Optional.ofNullable(signingCert); + return this; + } + + @JsonSetter(value = "signing_key", nulls = Nulls.SKIP) + public Builder signingKey(Optional signingKey) { + this.signingKey = signingKey; + return this; + } + + public Builder signingKey(ConnectionSigningKeySaml signingKey) { + this.signingKey = Optional.ofNullable(signingKey); + return this; + } + + @JsonSetter(value = "tenant_domain", nulls = Nulls.SKIP) + public Builder tenantDomain(Optional tenantDomain) { + this.tenantDomain = tenantDomain; + return this; + } + + public Builder tenantDomain(String tenantDomain) { + this.tenantDomain = Optional.ofNullable(tenantDomain); + return this; + } + + /** + *

SHA-1 thumbprints (fingerprints) of the identity provider's signing certificates. Automatically computed from signingCert during connection creation. Each thumbprint must be a 40-character hexadecimal string.

+ */ + @JsonSetter(value = "thumbprints", nulls = Nulls.SKIP) + public Builder thumbprints(Optional> thumbprints) { + this.thumbprints = thumbprints; + return this; + } + + public Builder thumbprints(List thumbprints) { + this.thumbprints = Optional.ofNullable(thumbprints); + return this; + } + + @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) + public Builder upstreamParams( + @Nullable + OptionalNullable>> + upstreamParams) { + this.upstreamParams = upstreamParams; + return this; + } + + public Builder upstreamParams( + Map> upstreamParams) { + this.upstreamParams = OptionalNullable.of(upstreamParams); + return this; + } + + public Builder upstreamParams( + Optional>> upstreamParams) { + if (upstreamParams.isPresent()) { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } else { + this.upstreamParams = OptionalNullable.absent(); + } + return this; + } + + public Builder upstreamParams( + com.auth0.client.mgmt.core.Nullable< + Map>> + upstreamParams) { + if (upstreamParams.isNull()) { + this.upstreamParams = OptionalNullable.ofNull(); + } else if (upstreamParams.isEmpty()) { + this.upstreamParams = OptionalNullable.absent(); + } else { + this.upstreamParams = OptionalNullable.of(upstreamParams.get()); + } + return this; + } + + @JsonSetter(value = "user_id_attribute", nulls = Nulls.SKIP) + public Builder userIdAttribute(Optional userIdAttribute) { + this.userIdAttribute = userIdAttribute; + return this; + } + + public Builder userIdAttribute(String userIdAttribute) { + this.userIdAttribute = Optional.ofNullable(userIdAttribute); + return this; + } + + public ConnectionOptionsSaml build() { + return new ConnectionOptionsSaml( + cert, + debug, + decryptionKey, + deflate, + destinationUrl, + digestAlgorithm, + disableSignout, + domainAliases, + entityId, + fieldsMap, + globalTokenRevocationJwtIss, + globalTokenRevocationJwtSub, + iconUrl, + idpinitiated, + metadataUrl, + metadataXml, + nonPersistentAttrs, + protocolBinding, + recipientUrl, + requestTemplate, + setUserRootAttributes, + signInEndpoint, + signOutEndpoint, + signSamlRequest, + signatureAlgorithm, + signingCert, + signingKey, + tenantDomain, + thumbprints, + upstreamParams, + userIdAttribute, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java index 017cebfa4..21fd81bb8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyAuthenticationMethod.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasskeyAuthenticationMethod @@ -53,12 +53,12 @@ private boolean equalTo(ConnectionPasskeyAuthenticationMethod other) { return enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java index 1391da2ef..231afea06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyChallengeUiEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionPasskeyChallengeUiEnum && this.string.equals(((ConnectionPasskeyChallengeUiEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java index eae4787ff..11308fbe0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasskeyOptions.java @@ -60,7 +60,7 @@ public Optional getLocalEnrollmentEnabled() { return localEnrollmentEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasskeyOptions && equalTo((ConnectionPasskeyOptions) other); @@ -77,12 +77,12 @@ private boolean equalTo(ConnectionPasskeyOptions other) { && localEnrollmentEnabled.equals(other.localEnrollmentEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.challengeUi, this.progressiveEnrollmentEnabled, this.localEnrollmentEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java index 69e8872c3..086e23295 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordAuthenticationMethod.java @@ -38,7 +38,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordAuthenticationMethod @@ -54,12 +54,12 @@ private boolean equalTo(ConnectionPasswordAuthenticationMethod other) { return enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java index 222ab5f6b..f2734810c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordComplexityOptions.java @@ -37,7 +37,7 @@ public Optional getMinLength() { return minLength; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordComplexityOptions @@ -53,12 +53,12 @@ private boolean equalTo(ConnectionPasswordComplexityOptions other) { return minLength.equals(other.minLength); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.minLength); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java index ab1670482..1abe74805 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordDictionaryOptions.java @@ -47,7 +47,7 @@ public Optional> getDictionary() { return dictionary; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordDictionaryOptions @@ -63,12 +63,12 @@ private boolean equalTo(ConnectionPasswordDictionaryOptions other) { return enable == other.enable && dictionary.equals(other.dictionary); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enable, this.dictionary); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -105,14 +105,14 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionPasswordDictionaryOptions other) { enable(other.getEnable()); dictionary(other.getDictionary()); return this; } - @Override + @java.lang.Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; @@ -123,7 +123,7 @@ public _FinalStage enable(boolean enable) { *

Custom Password Dictionary. An array of up to 200 entries.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage dictionary(List dictionary) { this.dictionary = Optional.ofNullable(dictionary); return this; @@ -132,14 +132,14 @@ public _FinalStage dictionary(List dictionary) { /** *

Custom Password Dictionary. An array of up to 200 entries.

*/ - @Override + @java.lang.Override @JsonSetter(value = "dictionary", nulls = Nulls.SKIP) public _FinalStage dictionary(Optional> dictionary) { this.dictionary = dictionary; return this; } - @Override + @java.lang.Override public ConnectionPasswordDictionaryOptions build() { return new ConnectionPasswordDictionaryOptions(enable, dictionary, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java index b8dc0f6f6..a5ea8bb03 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordHistoryOptions.java @@ -43,7 +43,7 @@ public Optional getSize() { return size; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordHistoryOptions && equalTo((ConnectionPasswordHistoryOptions) other); @@ -58,12 +58,12 @@ private boolean equalTo(ConnectionPasswordHistoryOptions other) { return enable == other.enable && size.equals(other.size); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enable, this.size); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,34 +97,34 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionPasswordHistoryOptions other) { enable(other.getEnable()); size(other.getSize()); return this; } - @Override + @java.lang.Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; return this; } - @Override + @java.lang.Override public _FinalStage size(Integer size) { this.size = Optional.ofNullable(size); return this; } - @Override + @java.lang.Override @JsonSetter(value = "size", nulls = Nulls.SKIP) public _FinalStage size(Optional size) { this.size = size; return this; } - @Override + @java.lang.Override public ConnectionPasswordHistoryOptions build() { return new ConnectionPasswordHistoryOptions(enable, size, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java index 67a0a7f4a..ea52d475b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordNoPersonalInfoOptions.java @@ -32,7 +32,7 @@ public boolean getEnable() { return enable; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPasswordNoPersonalInfoOptions @@ -48,12 +48,12 @@ private boolean equalTo(ConnectionPasswordNoPersonalInfoOptions other) { return enable == other.enable; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enable); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements EnableStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionPasswordNoPersonalInfoOptions other) { enable(other.getEnable()); return this; } - @Override + @java.lang.Override @JsonSetter("enable") public _FinalStage enable(boolean enable) { this.enable = enable; return this; } - @Override + @java.lang.Override public ConnectionPasswordNoPersonalInfoOptions build() { return new ConnectionPasswordNoPersonalInfoOptions(enable, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java index 3496bc1c7..c9d9a7fbf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPasswordPolicyEnum.java @@ -31,20 +31,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionPasswordPolicyEnum && this.string.equals(((ConnectionPasswordPolicyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java index 4c7fc3e69..0185bb7ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfile.java @@ -91,7 +91,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfile && equalTo((ConnectionProfile) other); @@ -112,7 +112,7 @@ private boolean equalTo(ConnectionProfile other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -124,7 +124,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java index f307bd117..68d2ff0e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileConfig.java @@ -21,7 +21,7 @@ private ConnectionProfileConfig(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileConfig; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java index 27d77d7e6..1a3018acb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganization.java @@ -45,7 +45,7 @@ public Optional getAss return assignMembershipOnLogin; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileOrganization && equalTo((ConnectionProfileOrganization) other); @@ -60,12 +60,12 @@ private boolean equalTo(ConnectionProfileOrganization other) { return showAsButton.equals(other.showAsButton) && assignMembershipOnLogin.equals(other.assignMembershipOnLogin); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.showAsButton, this.assignMembershipOnLogin); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java index 26d536b58..f6c9714dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationAssignMembershipOnLoginEnum.java @@ -29,13 +29,13 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionProfileOrganizationAssignMembershipOnLoginEnum @@ -43,7 +43,7 @@ public boolean equals(Object other) { ((ConnectionProfileOrganizationAssignMembershipOnLoginEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java index 326ced6d2..0eabb579d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileOrganizationShowAsButtonEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionProfileOrganizationShowAsButtonEnum && this.string.equals(((ConnectionProfileOrganizationShowAsButtonEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java index 34d2f94e1..0cc11dd51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverride.java @@ -46,7 +46,7 @@ public Optional getConnectio return connectionConfig; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileStrategyOverride && equalTo((ConnectionProfileStrategyOverride) other); @@ -61,12 +61,12 @@ private boolean equalTo(ConnectionProfileStrategyOverride other) { return enabledFeatures.equals(other.enabledFeatures) && connectionConfig.equals(other.connectionConfig); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabledFeatures, this.connectionConfig); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java index e35579cd0..8dea364b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverrides.java @@ -99,7 +99,7 @@ public Optional getSamlp() { return samlp; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileStrategyOverrides @@ -122,13 +122,13 @@ private boolean equalTo(ConnectionProfileStrategyOverrides other) { && samlp.equals(other.samlp); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java index a11d96022..9bd05af6c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileStrategyOverridesConnectionConfig.java @@ -21,7 +21,7 @@ private ConnectionProfileStrategyOverridesConnectionConfig(Map a this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileStrategyOverridesConnectionConfig; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java index a9185cb14..473f874b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplate.java @@ -82,7 +82,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileTemplate && equalTo((ConnectionProfileTemplate) other); @@ -102,7 +102,7 @@ private boolean equalTo(ConnectionProfileTemplate other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -113,7 +113,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java index 2a7f0038c..26b89761c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProfileTemplateItem.java @@ -60,7 +60,7 @@ public Optional getTemplate() { return template; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionProfileTemplateItem && equalTo((ConnectionProfileTemplateItem) other); @@ -75,12 +75,12 @@ private boolean equalTo(ConnectionProfileTemplateItem other) { return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.displayName, this.template); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java index 8de3fc11b..e0951ed4a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java @@ -410,7 +410,7 @@ private OptionalNullable _getFederat return federatedConnectionsAccessTokens; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionPropertiesOptions && equalTo((ConnectionPropertiesOptions) other); @@ -452,7 +452,7 @@ private boolean equalTo(ConnectionPropertiesOptions other) { && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.validation, @@ -485,7 +485,7 @@ public int hashCode() { this.federatedConnectionsAccessTokens); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionProtocolBindingEnumSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionProtocolBindingEnumSaml.java new file mode 100644 index 000000000..6556f8a4b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionProtocolBindingEnumSaml.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionProtocolBindingEnumSaml { + public static final ConnectionProtocolBindingEnumSaml URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_REDIRECT = + new ConnectionProtocolBindingEnumSaml( + Value.URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_REDIRECT, + "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"); + + public static final ConnectionProtocolBindingEnumSaml URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_POST = + new ConnectionProtocolBindingEnumSaml( + Value.URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_POST, + "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"); + + private final Value value; + + private final String string; + + ConnectionProtocolBindingEnumSaml(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionProtocolBindingEnumSaml + && this.string.equals(((ConnectionProtocolBindingEnumSaml) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_REDIRECT: + return visitor.visitUrnOasisNamesTcSaml20BindingsHttpRedirect(); + case URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_POST: + return visitor.visitUrnOasisNamesTcSaml20BindingsHttpPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionProtocolBindingEnumSaml valueOf(String value) { + switch (value) { + case "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect": + return URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_REDIRECT; + case "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST": + return URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_POST; + default: + return new ConnectionProtocolBindingEnumSaml(Value.UNKNOWN, value); + } + } + + public enum Value { + URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_POST, + + URN_OASIS_NAMES_TC_SAML20BINDINGS_HTTP_REDIRECT, + + UNKNOWN + } + + public interface Visitor { + T visitUrnOasisNamesTcSaml20BindingsHttpPost(); + + T visitUrnOasisNamesTcSaml20BindingsHttpRedirect(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java index 91770e367..97a21b378 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseCommon.java @@ -71,66 +71,66 @@ private ConnectionResponseCommon( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseCommon && equalTo((ConnectionResponseCommon) other); @@ -154,7 +154,7 @@ private boolean equalTo(ConnectionResponseCommon other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -169,7 +169,7 @@ public int hashCode() { this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java index fed4d3811..5787bb9df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAd.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAd( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAd && equalTo((ConnectionResponseContentAd) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentAd other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java index 80ee443e9..5b45bce97 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAdfs.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAdfs( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAdfs && equalTo((ConnectionResponseContentAdfs) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentAdfs other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java index 7c456af22..b61c5612c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAmazon.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAmazon( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAmazon && equalTo((ConnectionResponseContentAmazon) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentAmazon other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java index 3ff30de6d..7d30d17ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAol.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAol( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAol && equalTo((ConnectionResponseContentAol) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentAol other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java index 281e433e9..abc08776e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentApple.java @@ -75,61 +75,61 @@ private ConnectionResponseContentApple( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentApple && equalTo((ConnectionResponseContentApple) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentApple other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java index ae19dd82b..b172d2467 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAuth0( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAuth0 && equalTo((ConnectionResponseContentAuth0) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentAuth0 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java index 6977057f2..2ce983145 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAuth0Oidc.java @@ -75,61 +75,61 @@ private ConnectionResponseContentAuth0Oidc( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAuth0Oidc @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentAuth0Oidc other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java index 4db0fad96..fc32d0e8c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentAzureAd.java @@ -87,61 +87,61 @@ private ConnectionResponseContentAzureAd( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -171,7 +171,7 @@ public Optional getStrategyVersion() { return strategyVersion; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentAzureAd && equalTo((ConnectionResponseContentAzureAd) other); @@ -199,7 +199,7 @@ private boolean equalTo(ConnectionResponseContentAzureAd other) { && strategyVersion.equals(other.strategyVersion); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -218,7 +218,7 @@ public int hashCode() { this.strategyVersion); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java index 015f4b1ee..3d79db815 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBaidu.java @@ -75,61 +75,61 @@ private ConnectionResponseContentBaidu( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentBaidu && equalTo((ConnectionResponseContentBaidu) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentBaidu other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java index 5710fdb7a..edc0095d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitbucket.java @@ -75,61 +75,61 @@ private ConnectionResponseContentBitbucket( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentBitbucket @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentBitbucket other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java index 93e69f6ba..2b91fbe91 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBitly.java @@ -75,61 +75,61 @@ private ConnectionResponseContentBitly( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentBitly && equalTo((ConnectionResponseContentBitly) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentBitly other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java index ba9a38bff..0f5606417 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentBox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentBox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentBox && equalTo((ConnectionResponseContentBox) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentBox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java index e54d9197c..bd99aa343 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentCustom.java @@ -75,61 +75,61 @@ private ConnectionResponseContentCustom( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentCustom && equalTo((ConnectionResponseContentCustom) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentCustom other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java index 887bbaca0..f0cfd0e0b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDaccount.java @@ -75,61 +75,61 @@ private ConnectionResponseContentDaccount( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentDaccount && equalTo((ConnectionResponseContentDaccount) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentDaccount other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java index 68e80917f..59660dd16 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDropbox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentDropbox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentDropbox && equalTo((ConnectionResponseContentDropbox) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentDropbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java index e6e7cba23..6793b5cd5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentDwolla.java @@ -75,61 +75,61 @@ private ConnectionResponseContentDwolla( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentDwolla && equalTo((ConnectionResponseContentDwolla) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentDwolla other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java index 1657107d4..f74e21c23 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEmail.java @@ -75,61 +75,61 @@ private ConnectionResponseContentEmail( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentEmail && equalTo((ConnectionResponseContentEmail) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentEmail other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java index 550882ec6..c24cb3a73 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernote.java @@ -75,61 +75,61 @@ private ConnectionResponseContentEvernote( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentEvernote && equalTo((ConnectionResponseContentEvernote) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentEvernote other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java index 8f133ae37..721b7da40 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentEvernoteSandbox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentEvernoteSandbox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentEvernoteSandbox @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentEvernoteSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java index 320bc20f5..cbeba76ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentExact.java @@ -75,61 +75,61 @@ private ConnectionResponseContentExact( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentExact && equalTo((ConnectionResponseContentExact) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentExact other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java index 42042168f..625b2d388 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFacebook.java @@ -75,61 +75,61 @@ private ConnectionResponseContentFacebook( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentFacebook && equalTo((ConnectionResponseContentFacebook) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentFacebook other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java index 295b8de55..4a5afcfac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFitbit.java @@ -75,61 +75,61 @@ private ConnectionResponseContentFitbit( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentFitbit && equalTo((ConnectionResponseContentFitbit) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentFitbit other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java index 57f9d35aa..5f07a2e1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java @@ -75,61 +75,61 @@ private ConnectionResponseContentFlickr( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentFlickr && equalTo((ConnectionResponseContentFlickr) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentFlickr other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java index 716f44409..584b6efa0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGitHub.java @@ -75,61 +75,61 @@ private ConnectionResponseContentGitHub( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentGitHub && equalTo((ConnectionResponseContentGitHub) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentGitHub other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java index e039d4f28..f92b4eb34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleApps.java @@ -43,7 +43,7 @@ public final class ConnectionResponseContentGoogleApps private final Optional showAsButton; - private final Optional> options; + private final Optional options; private final Map additionalProperties; @@ -58,7 +58,7 @@ private ConnectionResponseContentGoogleApps( Optional>> metadata, Optional> realms, Optional showAsButton, - Optional> options, + Optional options, Map additionalProperties) { this.id = id; this.name = name; @@ -75,61 +75,61 @@ private ConnectionResponseContentGoogleApps( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -140,11 +140,11 @@ public String getStrategy() { } @JsonProperty("options") - public Optional> getOptions() { + public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentGoogleApps @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentGoogleApps other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -217,7 +217,7 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> options = Optional.empty(); + private Optional options = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -350,12 +350,12 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional> options) { + public Builder options(Optional options) { this.options = options; return this; } - public Builder options(Map options) { + public Builder options(ConnectionOptionsGoogleApps options) { this.options = Optional.ofNullable(options); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java index dfdeae063..25f745441 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentGoogleOAuth2.java @@ -75,61 +75,61 @@ private ConnectionResponseContentGoogleOAuth2( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentGoogleOAuth2 @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentGoogleOAuth2 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java index 4625f9932..c8bbfb85d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentInstagram.java @@ -75,61 +75,61 @@ private ConnectionResponseContentInstagram( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentInstagram @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentInstagram other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java index b9a45d58c..a8cb11a20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentIp.java @@ -75,61 +75,61 @@ private ConnectionResponseContentIp( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentIp && equalTo((ConnectionResponseContentIp) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentIp other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java index 8c1da6375..e543b966a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLine.java @@ -75,61 +75,61 @@ private ConnectionResponseContentLine( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentLine && equalTo((ConnectionResponseContentLine) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentLine other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java index 1bb22367c..7951ef664 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentLinkedin.java @@ -75,61 +75,61 @@ private ConnectionResponseContentLinkedin( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentLinkedin && equalTo((ConnectionResponseContentLinkedin) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentLinkedin other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java index d5947f0d3..bcc66a27d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentMiicard.java @@ -75,61 +75,61 @@ private ConnectionResponseContentMiicard( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentMiicard && equalTo((ConnectionResponseContentMiicard) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentMiicard other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java index 2971a0271..c21029d7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth1.java @@ -75,61 +75,61 @@ private ConnectionResponseContentOAuth1( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentOAuth1 && equalTo((ConnectionResponseContentOAuth1) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentOAuth1 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java index 5217258c4..f967f3d6d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOAuth2.java @@ -75,61 +75,61 @@ private ConnectionResponseContentOAuth2( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentOAuth2 && equalTo((ConnectionResponseContentOAuth2) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentOAuth2 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java index c262eb876..9bb7923a3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOffice365.java @@ -75,61 +75,61 @@ private ConnectionResponseContentOffice365( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentOffice365 @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentOffice365 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java index 14eeb3c97..ffe99c2e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOidc.java @@ -75,61 +75,61 @@ private ConnectionResponseContentOidc( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentOidc && equalTo((ConnectionResponseContentOidc) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentOidc other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java index 70184fa72..586814ebd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentOkta.java @@ -75,61 +75,61 @@ private ConnectionResponseContentOkta( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentOkta && equalTo((ConnectionResponseContentOkta) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentOkta other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java index ef4990f19..3ee802ea9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypal.java @@ -75,61 +75,61 @@ private ConnectionResponseContentPaypal( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentPaypal && equalTo((ConnectionResponseContentPaypal) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentPaypal other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java index bd9d66254..6f94bccee 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPaypalSandbox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentPaypalSandbox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentPaypalSandbox @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentPaypalSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java index 4d645a95f..2c54365d5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPingFederate.java @@ -75,61 +75,61 @@ private ConnectionResponseContentPingFederate( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentPingFederate @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentPingFederate other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java index 887a349f1..b0547f916 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentPlanningCenter.java @@ -75,61 +75,61 @@ private ConnectionResponseContentPlanningCenter( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentPlanningCenter @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentPlanningCenter other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java index be4bf8a8b..8f7131d9f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentRenren.java @@ -75,61 +75,61 @@ private ConnectionResponseContentRenren( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentRenren && equalTo((ConnectionResponseContentRenren) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentRenren other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java index 7ed3ea57f..1385608eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforce.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSalesforce( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSalesforce @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentSalesforce other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java index 940dcb2d2..ef0b67f34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceCommunity.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSalesforceCommunity( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSalesforceCommunity @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentSalesforceCommunity other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java index bd94c2626..1f2c871e9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSalesforceSandbox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSalesforceSandbox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSalesforceSandbox @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentSalesforceSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java index bcd8bf3a0..7222b88b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSaml.java @@ -43,7 +43,7 @@ public final class ConnectionResponseContentSaml private final Optional showAsButton; - private final Optional> options; + private final Optional options; private final Map additionalProperties; @@ -58,7 +58,7 @@ private ConnectionResponseContentSaml( Optional>> metadata, Optional> realms, Optional showAsButton, - Optional> options, + Optional options, Map additionalProperties) { this.id = id; this.name = name; @@ -75,61 +75,61 @@ private ConnectionResponseContentSaml( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -140,11 +140,11 @@ public String getStrategy() { } @JsonProperty("options") - public Optional> getOptions() { + public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSaml && equalTo((ConnectionResponseContentSaml) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentSaml other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -216,7 +216,7 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> options = Optional.empty(); + private Optional options = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -349,12 +349,12 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional> options) { + public Builder options(Optional options) { this.options = options; return this; } - public Builder options(Map options) { + public Builder options(ConnectionOptionsSaml options) { this.options = Optional.ofNullable(options); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java index eb6896da3..47b45a949 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSharepoint.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSharepoint( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSharepoint @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentSharepoint other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java index 32b2370bd..74c3cb4d8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShop.java @@ -75,61 +75,61 @@ private ConnectionResponseContentShop( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentShop && equalTo((ConnectionResponseContentShop) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentShop other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java index 07783a5a4..516828676 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentShopify.java @@ -75,61 +75,61 @@ private ConnectionResponseContentShopify( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentShopify && equalTo((ConnectionResponseContentShopify) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentShopify other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java index 885d93fa2..1bb885eca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSms.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSms( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSms && equalTo((ConnectionResponseContentSms) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentSms other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java index a9e73d177..16a37e7ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentSoundcloud.java @@ -75,61 +75,61 @@ private ConnectionResponseContentSoundcloud( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentSoundcloud @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentSoundcloud other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java index e1430b8a4..f5d1c34af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCity.java @@ -75,61 +75,61 @@ private ConnectionResponseContentTheCity( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentTheCity && equalTo((ConnectionResponseContentTheCity) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentTheCity other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java index 38b81e6a6..b5c7d0a74 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTheCitySandbox.java @@ -75,61 +75,61 @@ private ConnectionResponseContentTheCitySandbox( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentTheCitySandbox @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentTheCitySandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java index fce027ffb..045fe7ed1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentThirtySevenSignals.java @@ -75,61 +75,61 @@ private ConnectionResponseContentThirtySevenSignals( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentThirtySevenSignals @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentThirtySevenSignals other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java index 0ff53e3f3..8e384122f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentTwitter.java @@ -75,61 +75,61 @@ private ConnectionResponseContentTwitter( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentTwitter && equalTo((ConnectionResponseContentTwitter) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentTwitter other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java index df8cfcce8..9ceff3f77 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentUntappd.java @@ -75,61 +75,61 @@ private ConnectionResponseContentUntappd( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentUntappd && equalTo((ConnectionResponseContentUntappd) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentUntappd other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java index 2e2bb8a5a..35ffd6cbd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentVkontakte.java @@ -75,61 +75,61 @@ private ConnectionResponseContentVkontakte( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentVkontakte @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentVkontakte other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java index 0c47404a4..149c58aae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWeibo.java @@ -75,61 +75,61 @@ private ConnectionResponseContentWeibo( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentWeibo && equalTo((ConnectionResponseContentWeibo) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentWeibo other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java index 7f432801d..a838fde01 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWindowsLive.java @@ -75,61 +75,61 @@ private ConnectionResponseContentWindowsLive( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentWindowsLive @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentWindowsLive other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java index 7191dffb5..3da2d8bfc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentWordpress.java @@ -75,61 +75,61 @@ private ConnectionResponseContentWordpress( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentWordpress @@ -170,7 +170,7 @@ private boolean equalTo(ConnectionResponseContentWordpress other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java index a0171c42f..0ca1e1f81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYahoo.java @@ -75,61 +75,61 @@ private ConnectionResponseContentYahoo( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentYahoo && equalTo((ConnectionResponseContentYahoo) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentYahoo other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java index de11ecf0a..1421aa33f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYammer.java @@ -75,61 +75,61 @@ private ConnectionResponseContentYammer( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentYammer && equalTo((ConnectionResponseContentYammer) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentYammer other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java index 4959ab33d..7baa64cae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentYandex.java @@ -75,61 +75,61 @@ private ConnectionResponseContentYandex( } @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -144,7 +144,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionResponseContentYandex && equalTo((ConnectionResponseContentYandex) other); @@ -169,7 +169,7 @@ private boolean equalTo(ConnectionResponseContentYandex other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -185,7 +185,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java index a23875ce9..22d0680ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionScopeOAuth2.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionScopeOAuth2 && equalTo((ConnectionScopeOAuth2) other); @@ -51,12 +51,12 @@ private boolean equalTo(ConnectionScopeOAuth2 other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(ConnectionScopeOAuth2.class); } - @Override + @java.lang.Override public ConnectionScopeOAuth2 deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java index 00c638227..417044e5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionScriptsOAuth2.java @@ -51,7 +51,7 @@ public Optional getGetLogoutUrl() { return getLogoutUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionScriptsOAuth2 && equalTo((ConnectionScriptsOAuth2) other); @@ -66,12 +66,12 @@ private boolean equalTo(ConnectionScriptsOAuth2 other) { return fetchUserProfile.equals(other.fetchUserProfile) && getLogoutUrl.equals(other.getLogoutUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fetchUserProfile, this.getLogoutUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java index 729688b04..71cb22fa1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionSetUserRootAttributesEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionSetUserRootAttributesEnum && this.string.equals(((ConnectionSetUserRootAttributesEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java index 6a5ec0743..4c926026a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionShouldTrustEmailVerifiedConnectionEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionShouldTrustEmailVerifiedConnectionEnum && this.string.equals(((ConnectionShouldTrustEmailVerifiedConnectionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionSignatureAlgorithmEnumSaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionSignatureAlgorithmEnumSaml.java new file mode 100644 index 000000000..c7b590f14 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionSignatureAlgorithmEnumSaml.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConnectionSignatureAlgorithmEnumSaml { + public static final ConnectionSignatureAlgorithmEnumSaml RSA_SHA1 = + new ConnectionSignatureAlgorithmEnumSaml(Value.RSA_SHA1, "rsa-sha1"); + + public static final ConnectionSignatureAlgorithmEnumSaml RSA_SHA256 = + new ConnectionSignatureAlgorithmEnumSaml(Value.RSA_SHA256, "rsa-sha256"); + + private final Value value; + + private final String string; + + ConnectionSignatureAlgorithmEnumSaml(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConnectionSignatureAlgorithmEnumSaml + && this.string.equals(((ConnectionSignatureAlgorithmEnumSaml) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RSA_SHA1: + return visitor.visitRsaSha1(); + case RSA_SHA256: + return visitor.visitRsaSha256(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConnectionSignatureAlgorithmEnumSaml valueOf(String value) { + switch (value) { + case "rsa-sha1": + return RSA_SHA1; + case "rsa-sha256": + return RSA_SHA256; + default: + return new ConnectionSignatureAlgorithmEnumSaml(Value.UNKNOWN, value); + } + } + + public enum Value { + RSA_SHA1, + + RSA_SHA256, + + UNKNOWN + } + + public interface Visitor { + T visitRsaSha1(); + + T visitRsaSha256(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionSigningKeySaml.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionSigningKeySaml.java new file mode 100644 index 000000000..e7a208f70 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionSigningKeySaml.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConnectionSigningKeySaml.Builder.class) +public final class ConnectionSigningKeySaml { + private final Optional cert; + + private final Optional key; + + private final Map additionalProperties; + + private ConnectionSigningKeySaml( + Optional cert, Optional key, Map additionalProperties) { + this.cert = cert; + this.key = key; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded X.509 certificate in PEM format used by Auth0 to sign SAML requests and logout messages. + */ + @JsonProperty("cert") + public Optional getCert() { + return cert; + } + + /** + * @return Private key in PEM format used by Auth0 to sign SAML requests and logout messages. + */ + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectionSigningKeySaml && equalTo((ConnectionSigningKeySaml) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectionSigningKeySaml other) { + return cert.equals(other.cert) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cert, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cert = Optional.empty(); + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectionSigningKeySaml other) { + cert(other.getCert()); + key(other.getKey()); + return this; + } + + /** + *

Base64-encoded X.509 certificate in PEM format used by Auth0 to sign SAML requests and logout messages.

+ */ + @JsonSetter(value = "cert", nulls = Nulls.SKIP) + public Builder cert(Optional cert) { + this.cert = cert; + return this; + } + + public Builder cert(String cert) { + this.cert = Optional.ofNullable(cert); + return this; + } + + /** + *

Private key in PEM format used by Auth0 to sign SAML requests and logout messages.

+ */ + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public Builder key(Optional key) { + this.key = key; + return this; + } + + public Builder key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + public ConnectionSigningKeySaml build() { + return new ConnectionSigningKeySaml(cert, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java index 03ca770aa..a69407be8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java @@ -158,20 +158,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionStrategyEnum && this.string.equals(((ConnectionStrategyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java index 928a8db9b..4a9b37b16 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionTokenEndpointAuthMethodEnum && this.string.equals(((ConnectionTokenEndpointAuthMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java index 818c87bde..eb8565203 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTokenEndpointAuthSigningAlgEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionTokenEndpointAuthSigningAlgEnum && this.string.equals(((ConnectionTokenEndpointAuthSigningAlgEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java index f1f15d96e..0c2352588 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionTypeEnumOidc.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionTypeEnumOidc && this.string.equals(((ConnectionTypeEnumOidc) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java index 2cad0155a..9d239a0fd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAdditionalProperties.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionUpstreamAdditionalProperties @@ -50,12 +50,12 @@ private boolean equalTo(ConnectionUpstreamAdditionalProperties other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getAlias() { return alias; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionUpstreamAlias && equalTo((ConnectionUpstreamAlias) other); @@ -50,12 +50,12 @@ private boolean equalTo(ConnectionUpstreamAlias other) { return alias.equals(other.alias); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.alias); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java index 2bffb6b2c..0b0c55d13 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamAliasEnum.java @@ -53,20 +53,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionUpstreamAliasEnum && this.string.equals(((ConnectionUpstreamAliasEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java index 2386642f2..61954ddb6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUpstreamValue.java @@ -34,7 +34,7 @@ public Optional getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionUpstreamValue && equalTo((ConnectionUpstreamValue) other); @@ -49,12 +49,12 @@ private boolean equalTo(ConnectionUpstreamValue other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java index 6dae9bf66..6c871a228 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUseridAttributeEnumAzureAd.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionUseridAttributeEnumAzureAd && this.string.equals(((ConnectionUseridAttributeEnumAzureAd) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java index 002678a66..07586413b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionUsernameValidationOptions.java @@ -40,7 +40,7 @@ public int getMax() { return max; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionUsernameValidationOptions @@ -56,12 +56,12 @@ private boolean equalTo(ConnectionUsernameValidationOptions other) { return min == other.min && max == other.max; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.min, this.max); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements MinStage, MaxStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectionUsernameValidationOptions other) { min(other.getMin()); max(other.getMax()); return this; } - @Override + @java.lang.Override @JsonSetter("min") public MaxStage min(int min) { this.min = min; return this; } - @Override + @java.lang.Override @JsonSetter("max") public _FinalStage max(int max) { this.max = max; return this; } - @Override + @java.lang.Override public ConnectionUsernameValidationOptions build() { return new ConnectionUsernameValidationOptions(min, max, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java index 5bc9f5bf9..e95610f27 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionValidationOptions.java @@ -48,7 +48,7 @@ private OptionalNullable _getUsername() { return username; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectionValidationOptions && equalTo((ConnectionValidationOptions) other); @@ -63,12 +63,12 @@ private boolean equalTo(ConnectionValidationOptions other) { return username.equals(other.username); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.username); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java index 257e908be..e154b74eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionWaadProtocolEnumAzureAd.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ConnectionWaadProtocolEnumAzureAd && this.string.equals(((ConnectionWaadProtocolEnumAzureAd) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java index 8051e8c49..3a2f144cb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionRequestContent.java @@ -35,6 +35,8 @@ public final class CreateActionRequestContent { private final Optional> secrets; + private final Optional> modules; + private final Optional deploy; private final Map additionalProperties; @@ -46,6 +48,7 @@ private CreateActionRequestContent( Optional> dependencies, Optional runtime, Optional> secrets, + Optional> modules, Optional deploy, Map additionalProperties) { this.name = name; @@ -54,6 +57,7 @@ private CreateActionRequestContent( this.dependencies = dependencies; this.runtime = runtime; this.secrets = secrets; + this.modules = modules; this.deploy = deploy; this.additionalProperties = additionalProperties; } @@ -106,6 +110,14 @@ public Optional> getSecrets() { return secrets; } + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + /** * @return True if the action should be deployed after creation. */ @@ -114,7 +126,7 @@ public Optional getDeploy() { return deploy; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateActionRequestContent && equalTo((CreateActionRequestContent) other); @@ -132,10 +144,11 @@ private boolean equalTo(CreateActionRequestContent other) { && dependencies.equals(other.dependencies) && runtime.equals(other.runtime) && secrets.equals(other.secrets) + && modules.equals(other.modules) && deploy.equals(other.deploy); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -144,10 +157,11 @@ public int hashCode() { this.dependencies, this.runtime, this.secrets, + this.modules, this.deploy); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -205,6 +219,13 @@ public interface _FinalStage { _FinalStage secrets(List secrets); + /** + *

The list of action modules and their versions used by this action.

+ */ + _FinalStage modules(Optional> modules); + + _FinalStage modules(List modules); + /** *

True if the action should be deployed after creation.

*/ @@ -219,6 +240,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional deploy = Optional.empty(); + private Optional> modules = Optional.empty(); + private Optional> secrets = Optional.empty(); private Optional runtime = Optional.empty(); @@ -234,7 +257,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateActionRequestContent other) { name(other.getName()); supportedTriggers(other.getSupportedTriggers()); @@ -242,6 +265,7 @@ public Builder from(CreateActionRequestContent other) { dependencies(other.getDependencies()); runtime(other.getRuntime()); secrets(other.getSecrets()); + modules(other.getModules()); deploy(other.getDeploy()); return this; } @@ -251,7 +275,7 @@ public Builder from(CreateActionRequestContent other) { *

The name of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -262,7 +286,7 @@ public _FinalStage name(@NotNull String name) { *

True if the action should be deployed after creation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage deploy(Boolean deploy) { this.deploy = Optional.ofNullable(deploy); return this; @@ -271,18 +295,38 @@ public _FinalStage deploy(Boolean deploy) { /** *

True if the action should be deployed after creation.

*/ - @Override + @java.lang.Override @JsonSetter(value = "deploy", nulls = Nulls.SKIP) public _FinalStage deploy(Optional deploy) { this.deploy = deploy; return this; } + /** + *

The list of action modules and their versions used by this action.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + + /** + *

The list of action modules and their versions used by this action.

+ */ + @java.lang.Override + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public _FinalStage modules(Optional> modules) { + this.modules = modules; + return this; + } + /** *

The list of secrets that are included in an action or a version of an action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage secrets(List secrets) { this.secrets = Optional.ofNullable(secrets); return this; @@ -291,7 +335,7 @@ public _FinalStage secrets(List secrets) { /** *

The list of secrets that are included in an action or a version of an action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "secrets", nulls = Nulls.SKIP) public _FinalStage secrets(Optional> secrets) { this.secrets = secrets; @@ -302,7 +346,7 @@ public _FinalStage secrets(Optional> secrets) { *

The Node runtime. For example: node22, defaults to node22

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage runtime(String runtime) { this.runtime = Optional.ofNullable(runtime); return this; @@ -311,7 +355,7 @@ public _FinalStage runtime(String runtime) { /** *

The Node runtime. For example: node22, defaults to node22

*/ - @Override + @java.lang.Override @JsonSetter(value = "runtime", nulls = Nulls.SKIP) public _FinalStage runtime(Optional runtime) { this.runtime = runtime; @@ -322,7 +366,7 @@ public _FinalStage runtime(Optional runtime) { *

The list of third party npm modules, and their versions, that this action depends on.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage dependencies(List dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; @@ -331,7 +375,7 @@ public _FinalStage dependencies(List dependencies) { /** *

The list of third party npm modules, and their versions, that this action depends on.

*/ - @Override + @java.lang.Override @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) public _FinalStage dependencies(Optional> dependencies) { this.dependencies = dependencies; @@ -342,7 +386,7 @@ public _FinalStage dependencies(Optional> dependen *

The source code of the action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage code(String code) { this.code = Optional.ofNullable(code); return this; @@ -351,7 +395,7 @@ public _FinalStage code(String code) { /** *

The source code of the action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; @@ -362,7 +406,7 @@ public _FinalStage code(Optional code) { *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllSupportedTriggers(List supportedTriggers) { if (supportedTriggers != null) { this.supportedTriggers.addAll(supportedTriggers); @@ -374,7 +418,7 @@ public _FinalStage addAllSupportedTriggers(List supportedTriggers *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers) { this.supportedTriggers.add(supportedTriggers); return this; @@ -383,7 +427,7 @@ public _FinalStage addSupportedTriggers(ActionTrigger supportedTriggers) { /** *

The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.

*/ - @Override + @java.lang.Override @JsonSetter(value = "supported_triggers", nulls = Nulls.SKIP) public _FinalStage supportedTriggers(List supportedTriggers) { this.supportedTriggers.clear(); @@ -393,10 +437,18 @@ public _FinalStage supportedTriggers(List supportedTriggers) { return this; } - @Override + @java.lang.Override public CreateActionRequestContent build() { return new CreateActionRequestContent( - name, supportedTriggers, code, dependencies, runtime, secrets, deploy, additionalProperties); + name, + supportedTriggers, + code, + dependencies, + runtime, + secrets, + modules, + deploy, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java index 193acf5de..288a82079 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateActionResponseContent.java @@ -54,6 +54,8 @@ public final class CreateActionResponseContent { private final Optional deploy; + private final Optional> modules; + private final Map additionalProperties; private CreateActionResponseContent( @@ -73,6 +75,7 @@ private CreateActionResponseContent( Optional status, Optional builtAt, Optional deploy, + Optional> modules, Map additionalProperties) { this.id = id; this.name = name; @@ -90,6 +93,7 @@ private CreateActionResponseContent( this.status = status; this.builtAt = builtAt; this.deploy = deploy; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -212,7 +216,15 @@ public Optional getDeploy() { return deploy; } - @Override + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateActionResponseContent && equalTo((CreateActionResponseContent) other); @@ -239,10 +251,11 @@ private boolean equalTo(CreateActionResponseContent other) { && integration.equals(other.integration) && status.equals(other.status) && builtAt.equals(other.builtAt) - && deploy.equals(other.deploy); + && deploy.equals(other.deploy) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -260,10 +273,11 @@ public int hashCode() { this.integration, this.status, this.builtAt, - this.deploy); + this.deploy, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -306,6 +320,8 @@ public static final class Builder { private Optional deploy = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -328,6 +344,7 @@ public Builder from(CreateActionResponseContent other) { status(other.getStatus()); builtAt(other.getBuiltAt()); deploy(other.getDeploy()); + modules(other.getModules()); return this; } @@ -546,6 +563,20 @@ public Builder deploy(Boolean deploy) { return this; } + /** + *

The list of action modules and their versions used by this action.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public CreateActionResponseContent build() { return new CreateActionResponseContent( id, @@ -564,6 +595,7 @@ public CreateActionResponseContent build() { status, builtAt, deploy, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java index f9411878a..43f197694 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingPhoneProviderResponseContent.java @@ -113,7 +113,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(CreateBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(CreateBrandingPhoneProviderResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @Override + @java.lang.Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public CreateBrandingPhoneProviderResponseContent build() { return new CreateBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java index 944a3a289..10eca3e8f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateBrandingThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(CreateBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(CreateBrandingThemeResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @Override + @java.lang.Override public CreateBrandingThemeResponseContent build() { return new CreateBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java index 6935baedf..c927c5654 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantRequestContent.java @@ -107,7 +107,7 @@ public Optional> getAuthorizationDetailsTypes() { return authorizationDetailsTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientGrantRequestContent && equalTo((CreateClientGrantRequestContent) other); @@ -128,7 +128,7 @@ private boolean equalTo(CreateClientGrantRequestContent other) { && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -140,7 +140,7 @@ public int hashCode() { this.authorizationDetailsTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -219,7 +219,7 @@ public static final class Builder implements ClientIdStage, AudienceStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(CreateClientGrantRequestContent other) { clientId(other.getClientId()); audience(other.getAudience()); @@ -236,7 +236,7 @@ public Builder from(CreateClientGrantRequestContent other) { *

ID of the client.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("client_id") public AudienceStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -248,7 +248,7 @@ public AudienceStage clientId(@NotNull String clientId) { *

The audience (API identifier) of this client grant

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("audience") public _FinalStage audience(@NotNull String audience) { this.audience = Objects.requireNonNull(audience, "audience must not be null"); @@ -259,7 +259,7 @@ public _FinalStage audience(@NotNull String audience) { *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage authorizationDetailsTypes(List authorizationDetailsTypes) { this.authorizationDetailsTypes = Optional.ofNullable(authorizationDetailsTypes); return this; @@ -268,20 +268,20 @@ public _FinalStage authorizationDetailsTypes(List authorizationDetailsTy /** *

Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta’s <a href= "https://www.okta.com/legal/"> Master Subscription Agreement.</a>

*/ - @Override + @java.lang.Override @JsonSetter(value = "authorization_details_types", nulls = Nulls.SKIP) public _FinalStage authorizationDetailsTypes(Optional> authorizationDetailsTypes) { this.authorizationDetailsTypes = authorizationDetailsTypes; return this; } - @Override + @java.lang.Override public _FinalStage subjectType(ClientGrantSubjectTypeEnum subjectType) { this.subjectType = Optional.ofNullable(subjectType); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject_type", nulls = Nulls.SKIP) public _FinalStage subjectType(Optional subjectType) { this.subjectType = subjectType; @@ -292,7 +292,7 @@ public _FinalStage subjectType(Optional subjectType) *

Scopes allowed for this client grant.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage scope(List scope) { this.scope = Optional.ofNullable(scope); return this; @@ -301,7 +301,7 @@ public _FinalStage scope(List scope) { /** *

Scopes allowed for this client grant.

*/ - @Override + @java.lang.Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) public _FinalStage scope(Optional> scope) { this.scope = scope; @@ -312,7 +312,7 @@ public _FinalStage scope(Optional> scope) { *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowAnyOrganization(Boolean allowAnyOrganization) { this.allowAnyOrganization = Optional.ofNullable(allowAnyOrganization); return this; @@ -321,27 +321,27 @@ public _FinalStage allowAnyOrganization(Boolean allowAnyOrganization) { /** *

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.

*/ - @Override + @java.lang.Override @JsonSetter(value = "allow_any_organization", nulls = Nulls.SKIP) public _FinalStage allowAnyOrganization(Optional allowAnyOrganization) { this.allowAnyOrganization = allowAnyOrganization; return this; } - @Override + @java.lang.Override public _FinalStage organizationUsage(ClientGrantOrganizationUsageEnum organizationUsage) { this.organizationUsage = Optional.ofNullable(organizationUsage); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) public _FinalStage organizationUsage(Optional organizationUsage) { this.organizationUsage = organizationUsage; return this; } - @Override + @java.lang.Override public CreateClientGrantRequestContent build() { return new CreateClientGrantRequestContent( clientId, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java index 6b370905a..f6e045740 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientGrantResponseContent.java @@ -130,7 +130,7 @@ public Optional> getAuthorizationDetailsTypes() { return authorizationDetailsTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientGrantResponseContent && equalTo((CreateClientGrantResponseContent) other); @@ -153,7 +153,7 @@ private boolean equalTo(CreateClientGrantResponseContent other) { && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -167,7 +167,7 @@ public int hashCode() { this.authorizationDetailsTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java index d95c54911..989e3151c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java @@ -628,7 +628,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientRequestContent && equalTo((CreateClientRequestContent) other); @@ -693,7 +693,7 @@ private boolean equalTo(CreateClientRequestContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -748,7 +748,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -1189,7 +1189,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateClientRequestContent other) { name(other.getName()); description(other.getDescription()); @@ -1249,21 +1249,21 @@ public Builder from(CreateClientRequestContent other) { *

Name of this client (min length: 1 character, does not allow < or >).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage asyncApprovalNotificationChannels( List asyncApprovalNotificationChannels) { this.asyncApprovalNotificationChannels = Optional.ofNullable(asyncApprovalNotificationChannels); return this; } - @Override + @java.lang.Override @JsonSetter(value = "async_approval_notification_channels", nulls = Nulls.SKIP) public _FinalStage asyncApprovalNotificationChannels( Optional> asyncApprovalNotificationChannels) { @@ -1271,13 +1271,13 @@ public _FinalStage asyncApprovalNotificationChannels( return this; } - @Override + @java.lang.Override public _FinalStage expressConfiguration(ExpressConfiguration expressConfiguration) { this.expressConfiguration = Optional.ofNullable(expressConfiguration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "express_configuration", nulls = Nulls.SKIP) public _FinalStage expressConfiguration(Optional expressConfiguration) { this.expressConfiguration = expressConfiguration; @@ -1288,7 +1288,7 @@ public _FinalStage expressConfiguration(Optional expressCo *

The identifier of the resource server that this client is linked to.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resourceServerIdentifier(String resourceServerIdentifier) { this.resourceServerIdentifier = Optional.ofNullable(resourceServerIdentifier); return this; @@ -1297,20 +1297,20 @@ public _FinalStage resourceServerIdentifier(String resourceServerIdentifier) { /** *

The identifier of the resource server that this client is linked to.

*/ - @Override + @java.lang.Override @JsonSetter(value = "resource_server_identifier", nulls = Nulls.SKIP) public _FinalStage resourceServerIdentifier(Optional resourceServerIdentifier) { this.resourceServerIdentifier = resourceServerIdentifier; return this; } - @Override + @java.lang.Override public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { this.tokenQuota = Optional.ofNullable(tokenQuota); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) public _FinalStage tokenQuota(Optional tokenQuota) { this.tokenQuota = tokenQuota; @@ -1321,7 +1321,7 @@ public _FinalStage tokenQuota(Optional tokenQuota) { *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable parRequestExpiry) { if (parRequestExpiry.isNull()) { this.parRequestExpiry = OptionalNullable.ofNull(); @@ -1337,7 +1337,7 @@ public _FinalStage parRequestExpiry(com.auth0.client.mgmt.core.Nullable *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage parRequestExpiry(Optional parRequestExpiry) { if (parRequestExpiry.isPresent()) { this.parRequestExpiry = OptionalNullable.of(parRequestExpiry.get()); @@ -1351,7 +1351,7 @@ public _FinalStage parRequestExpiry(Optional parRequestExpiry) { *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage parRequestExpiry(Integer parRequestExpiry) { this.parRequestExpiry = OptionalNullable.of(parRequestExpiry); return this; @@ -1360,20 +1360,20 @@ public _FinalStage parRequestExpiry(Integer parRequestExpiry) { /** *

Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

*/ - @Override + @java.lang.Override @JsonSetter(value = "par_request_expiry", nulls = Nulls.SKIP) public _FinalStage parRequestExpiry(@Nullable OptionalNullable parRequestExpiry) { this.parRequestExpiry = parRequestExpiry; return this; } - @Override + @java.lang.Override public _FinalStage tokenExchange(ClientTokenExchangeConfiguration tokenExchange) { this.tokenExchange = Optional.ofNullable(tokenExchange); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_exchange", nulls = Nulls.SKIP) public _FinalStage tokenExchange(Optional tokenExchange) { this.tokenExchange = tokenExchange; @@ -1386,7 +1386,7 @@ public _FinalStage tokenExchange(Optional toke * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( Boolean skipNonVerifiableCallbackUriConfirmationPrompt) { this.skipNonVerifiableCallbackUriConfirmationPrompt = @@ -1399,7 +1399,7 @@ public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( * If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps. * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

*/ - @Override + @java.lang.Override @JsonSetter(value = "skip_non_verifiable_callback_uri_confirmation_prompt", nulls = Nulls.SKIP) public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( Optional skipNonVerifiableCallbackUriConfirmationPrompt) { @@ -1407,7 +1407,7 @@ public _FinalStage skipNonVerifiableCallbackUriConfirmationPrompt( return this; } - @Override + @java.lang.Override public _FinalStage complianceLevel( com.auth0.client.mgmt.core.Nullable complianceLevel) { if (complianceLevel.isNull()) { @@ -1420,7 +1420,7 @@ public _FinalStage complianceLevel( return this; } - @Override + @java.lang.Override public _FinalStage complianceLevel(Optional complianceLevel) { if (complianceLevel.isPresent()) { this.complianceLevel = OptionalNullable.of(complianceLevel.get()); @@ -1430,26 +1430,26 @@ public _FinalStage complianceLevel(Optional complianc return this; } - @Override + @java.lang.Override public _FinalStage complianceLevel(ClientComplianceLevelEnum complianceLevel) { this.complianceLevel = OptionalNullable.of(complianceLevel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "compliance_level", nulls = Nulls.SKIP) public _FinalStage complianceLevel(@Nullable OptionalNullable complianceLevel) { this.complianceLevel = complianceLevel; return this; } - @Override + @java.lang.Override public _FinalStage signedRequestObject(ClientSignedRequestObjectWithPublicKey signedRequestObject) { this.signedRequestObject = Optional.ofNullable(signedRequestObject); return this; } - @Override + @java.lang.Override @JsonSetter(value = "signed_request_object", nulls = Nulls.SKIP) public _FinalStage signedRequestObject(Optional signedRequestObject) { this.signedRequestObject = signedRequestObject; @@ -1460,7 +1460,7 @@ public _FinalStage signedRequestObject(OptionalMakes the use of Proof-of-Possession mandatory for this client

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage requireProofOfPossession(Boolean requireProofOfPossession) { this.requireProofOfPossession = Optional.ofNullable(requireProofOfPossession); return this; @@ -1469,7 +1469,7 @@ public _FinalStage requireProofOfPossession(Boolean requireProofOfPossession) { /** *

Makes the use of Proof-of-Possession mandatory for this client

*/ - @Override + @java.lang.Override @JsonSetter(value = "require_proof_of_possession", nulls = Nulls.SKIP) public _FinalStage requireProofOfPossession(Optional requireProofOfPossession) { this.requireProofOfPossession = requireProofOfPossession; @@ -1480,7 +1480,7 @@ public _FinalStage requireProofOfPossession(Optional requireProofOfPoss *

Makes the use of Pushed Authorization Requests mandatory for this client

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAuthorizationRequests) { this.requirePushedAuthorizationRequests = Optional.ofNullable(requirePushedAuthorizationRequests); return this; @@ -1489,20 +1489,20 @@ public _FinalStage requirePushedAuthorizationRequests(Boolean requirePushedAutho /** *

Makes the use of Pushed Authorization Requests mandatory for this client

*/ - @Override + @java.lang.Override @JsonSetter(value = "require_pushed_authorization_requests", nulls = Nulls.SKIP) public _FinalStage requirePushedAuthorizationRequests(Optional requirePushedAuthorizationRequests) { this.requirePushedAuthorizationRequests = requirePushedAuthorizationRequests; return this; } - @Override + @java.lang.Override public _FinalStage clientAuthenticationMethods(ClientCreateAuthenticationMethod clientAuthenticationMethods) { this.clientAuthenticationMethods = Optional.ofNullable(clientAuthenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_authentication_methods", nulls = Nulls.SKIP) public _FinalStage clientAuthenticationMethods( Optional clientAuthenticationMethods) { @@ -1514,7 +1514,7 @@ public _FinalStage clientAuthenticationMethods( *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage organizationDiscoveryMethods( List organizationDiscoveryMethods) { this.organizationDiscoveryMethods = Optional.ofNullable(organizationDiscoveryMethods); @@ -1524,7 +1524,7 @@ public _FinalStage organizationDiscoveryMethods( /** *

Defines the available methods for organization discovery during the pre_login_prompt. Users can discover their organization either by email, organization_name or both.

*/ - @Override + @java.lang.Override @JsonSetter(value = "organization_discovery_methods", nulls = Nulls.SKIP) public _FinalStage organizationDiscoveryMethods( Optional> organizationDiscoveryMethods) { @@ -1532,14 +1532,14 @@ public _FinalStage organizationDiscoveryMethods( return this; } - @Override + @java.lang.Override public _FinalStage organizationRequireBehavior( ClientOrganizationRequireBehaviorEnum organizationRequireBehavior) { this.organizationRequireBehavior = Optional.ofNullable(organizationRequireBehavior); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization_require_behavior", nulls = Nulls.SKIP) public _FinalStage organizationRequireBehavior( Optional organizationRequireBehavior) { @@ -1547,20 +1547,20 @@ public _FinalStage organizationRequireBehavior( return this; } - @Override + @java.lang.Override public _FinalStage organizationUsage(ClientOrganizationUsageEnum organizationUsage) { this.organizationUsage = Optional.ofNullable(organizationUsage); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization_usage", nulls = Nulls.SKIP) public _FinalStage organizationUsage(Optional organizationUsage) { this.organizationUsage = organizationUsage; return this; } - @Override + @java.lang.Override public _FinalStage defaultOrganization( com.auth0.client.mgmt.core.Nullable defaultOrganization) { if (defaultOrganization.isNull()) { @@ -1573,7 +1573,7 @@ public _FinalStage defaultOrganization( return this; } - @Override + @java.lang.Override public _FinalStage defaultOrganization(Optional defaultOrganization) { if (defaultOrganization.isPresent()) { this.defaultOrganization = OptionalNullable.of(defaultOrganization.get()); @@ -1583,13 +1583,13 @@ public _FinalStage defaultOrganization(Optional defau return this; } - @Override + @java.lang.Override public _FinalStage defaultOrganization(ClientDefaultOrganization defaultOrganization) { this.defaultOrganization = OptionalNullable.of(defaultOrganization); return this; } - @Override + @java.lang.Override @JsonSetter(value = "default_organization", nulls = Nulls.SKIP) public _FinalStage defaultOrganization( @Nullable OptionalNullable defaultOrganization) { @@ -1597,7 +1597,7 @@ public _FinalStage defaultOrganization( return this; } - @Override + @java.lang.Override public _FinalStage refreshToken( com.auth0.client.mgmt.core.Nullable refreshToken) { if (refreshToken.isNull()) { @@ -1610,7 +1610,7 @@ public _FinalStage refreshToken( return this; } - @Override + @java.lang.Override public _FinalStage refreshToken(Optional refreshToken) { if (refreshToken.isPresent()) { this.refreshToken = OptionalNullable.of(refreshToken.get()); @@ -1620,26 +1620,26 @@ public _FinalStage refreshToken(Optional refres return this; } - @Override + @java.lang.Override public _FinalStage refreshToken(ClientRefreshTokenConfiguration refreshToken) { this.refreshToken = OptionalNullable.of(refreshToken); return this; } - @Override + @java.lang.Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(@Nullable OptionalNullable refreshToken) { this.refreshToken = refreshToken; return this; } - @Override + @java.lang.Override public _FinalStage nativeSocialLogin(NativeSocialLogin nativeSocialLogin) { this.nativeSocialLogin = Optional.ofNullable(nativeSocialLogin); return this; } - @Override + @java.lang.Override @JsonSetter(value = "native_social_login", nulls = Nulls.SKIP) public _FinalStage nativeSocialLogin(Optional nativeSocialLogin) { this.nativeSocialLogin = nativeSocialLogin; @@ -1650,7 +1650,7 @@ public _FinalStage nativeSocialLogin(Optional nativeSocialLog *

Initiate login uri, must be https

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage initiateLoginUri(String initiateLoginUri) { this.initiateLoginUri = Optional.ofNullable(initiateLoginUri); return this; @@ -1659,46 +1659,46 @@ public _FinalStage initiateLoginUri(String initiateLoginUri) { /** *

Initiate login uri, must be https

*/ - @Override + @java.lang.Override @JsonSetter(value = "initiate_login_uri", nulls = Nulls.SKIP) public _FinalStage initiateLoginUri(Optional initiateLoginUri) { this.initiateLoginUri = initiateLoginUri; return this; } - @Override + @java.lang.Override public _FinalStage mobile(ClientMobile mobile) { this.mobile = Optional.ofNullable(mobile); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mobile", nulls = Nulls.SKIP) public _FinalStage mobile(Optional mobile) { this.mobile = mobile; return this; } - @Override + @java.lang.Override public _FinalStage clientMetadata(Map clientMetadata) { this.clientMetadata = Optional.ofNullable(clientMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_metadata", nulls = Nulls.SKIP) public _FinalStage clientMetadata(Optional> clientMetadata) { this.clientMetadata = clientMetadata; return this; } - @Override + @java.lang.Override public _FinalStage addons(ClientAddons addons) { this.addons = Optional.ofNullable(addons); return this; } - @Override + @java.lang.Override @JsonSetter(value = "addons", nulls = Nulls.SKIP) public _FinalStage addons(Optional addons) { this.addons = addons; @@ -1709,7 +1709,7 @@ public _FinalStage addons(Optional addons) { *

HTML form template to be used for WS-Federation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage formTemplate(String formTemplate) { this.formTemplate = Optional.ofNullable(formTemplate); return this; @@ -1718,7 +1718,7 @@ public _FinalStage formTemplate(String formTemplate) { /** *

HTML form template to be used for WS-Federation.

*/ - @Override + @java.lang.Override @JsonSetter(value = "form_template", nulls = Nulls.SKIP) public _FinalStage formTemplate(Optional formTemplate) { this.formTemplate = formTemplate; @@ -1729,7 +1729,7 @@ public _FinalStage formTemplate(Optional formTemplate) { *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customLoginPagePreview(String customLoginPagePreview) { this.customLoginPagePreview = Optional.ofNullable(customLoginPagePreview); return this; @@ -1738,7 +1738,7 @@ public _FinalStage customLoginPagePreview(String customLoginPagePreview) { /** *

The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_login_page_preview", nulls = Nulls.SKIP) public _FinalStage customLoginPagePreview(Optional customLoginPagePreview) { this.customLoginPagePreview = customLoginPagePreview; @@ -1749,7 +1749,7 @@ public _FinalStage customLoginPagePreview(Optional customLoginPagePrevie *

The content (HTML, CSS, JS) of the custom login page.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customLoginPage(String customLoginPage) { this.customLoginPage = Optional.ofNullable(customLoginPage); return this; @@ -1758,7 +1758,7 @@ public _FinalStage customLoginPage(String customLoginPage) { /** *

The content (HTML, CSS, JS) of the custom login page.

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_login_page", nulls = Nulls.SKIP) public _FinalStage customLoginPage(Optional customLoginPage) { this.customLoginPage = customLoginPage; @@ -1769,7 +1769,7 @@ public _FinalStage customLoginPage(Optional customLoginPage) { *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customLoginPageOn(Boolean customLoginPageOn) { this.customLoginPageOn = Optional.ofNullable(customLoginPageOn); return this; @@ -1778,7 +1778,7 @@ public _FinalStage customLoginPageOn(Boolean customLoginPageOn) { /** *

<code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_login_page_on", nulls = Nulls.SKIP) public _FinalStage customLoginPageOn(Optional customLoginPageOn) { this.customLoginPageOn = customLoginPageOn; @@ -1789,7 +1789,7 @@ public _FinalStage customLoginPageOn(Optional customLoginPageOn) { *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage ssoDisabled(Boolean ssoDisabled) { this.ssoDisabled = Optional.ofNullable(ssoDisabled); return this; @@ -1798,7 +1798,7 @@ public _FinalStage ssoDisabled(Boolean ssoDisabled) { /** *

<code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

*/ - @Override + @java.lang.Override @JsonSetter(value = "sso_disabled", nulls = Nulls.SKIP) public _FinalStage ssoDisabled(Optional ssoDisabled) { this.ssoDisabled = ssoDisabled; @@ -1809,7 +1809,7 @@ public _FinalStage ssoDisabled(Optional ssoDisabled) { *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage crossOriginLoc(String crossOriginLoc) { this.crossOriginLoc = Optional.ofNullable(crossOriginLoc); return this; @@ -1818,7 +1818,7 @@ public _FinalStage crossOriginLoc(String crossOriginLoc) { /** *

URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

*/ - @Override + @java.lang.Override @JsonSetter(value = "cross_origin_loc", nulls = Nulls.SKIP) public _FinalStage crossOriginLoc(Optional crossOriginLoc) { this.crossOriginLoc = crossOriginLoc; @@ -1829,7 +1829,7 @@ public _FinalStage crossOriginLoc(Optional crossOriginLoc) { *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication) { this.crossOriginAuthentication = Optional.ofNullable(crossOriginAuthentication); return this; @@ -1838,7 +1838,7 @@ public _FinalStage crossOriginAuthentication(Boolean crossOriginAuthentication) /** *

Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "cross_origin_authentication", nulls = Nulls.SKIP) public _FinalStage crossOriginAuthentication(Optional crossOriginAuthentication) { this.crossOriginAuthentication = crossOriginAuthentication; @@ -1849,7 +1849,7 @@ public _FinalStage crossOriginAuthentication(Optional crossOriginAuthen *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage sso(Boolean sso) { this.sso = Optional.ofNullable(sso); return this; @@ -1858,14 +1858,14 @@ public _FinalStage sso(Boolean sso) { /** *

Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "sso", nulls = Nulls.SKIP) public _FinalStage sso(Optional sso) { this.sso = sso; return this; } - @Override + @java.lang.Override public _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { if (encryptionKey.isNull()) { this.encryptionKey = OptionalNullable.ofNull(); @@ -1877,7 +1877,7 @@ public _FinalStage encryptionKey(com.auth0.client.mgmt.core.Nullable encryptionKey) { if (encryptionKey.isPresent()) { this.encryptionKey = OptionalNullable.of(encryptionKey.get()); @@ -1887,26 +1887,26 @@ public _FinalStage encryptionKey(Optional encryptionKey) { return this; } - @Override + @java.lang.Override public _FinalStage encryptionKey(ClientEncryptionKey encryptionKey) { this.encryptionKey = OptionalNullable.of(encryptionKey); return this; } - @Override + @java.lang.Override @JsonSetter(value = "encryption_key", nulls = Nulls.SKIP) public _FinalStage encryptionKey(@Nullable OptionalNullable encryptionKey) { this.encryptionKey = encryptionKey; return this; } - @Override + @java.lang.Override public _FinalStage jwtConfiguration(ClientJwtConfiguration jwtConfiguration) { this.jwtConfiguration = Optional.ofNullable(jwtConfiguration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "jwt_configuration", nulls = Nulls.SKIP) public _FinalStage jwtConfiguration(Optional jwtConfiguration) { this.jwtConfiguration = jwtConfiguration; @@ -1917,7 +1917,7 @@ public _FinalStage jwtConfiguration(Optional jwtConfigur *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage oidcConformant(Boolean oidcConformant) { this.oidcConformant = Optional.ofNullable(oidcConformant); return this; @@ -1926,7 +1926,7 @@ public _FinalStage oidcConformant(Boolean oidcConformant) { /** *

Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "oidc_conformant", nulls = Nulls.SKIP) public _FinalStage oidcConformant(Optional oidcConformant) { this.oidcConformant = oidcConformant; @@ -1937,7 +1937,7 @@ public _FinalStage oidcConformant(Optional oidcConformant) { *

Whether this client a first party client or not

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isFirstParty(Boolean isFirstParty) { this.isFirstParty = Optional.ofNullable(isFirstParty); return this; @@ -1946,20 +1946,20 @@ public _FinalStage isFirstParty(Boolean isFirstParty) { /** *

Whether this client a first party client or not

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_first_party", nulls = Nulls.SKIP) public _FinalStage isFirstParty(Optional isFirstParty) { this.isFirstParty = isFirstParty; return this; } - @Override + @java.lang.Override public _FinalStage appType(ClientAppTypeEnum appType) { this.appType = Optional.ofNullable(appType); return this; } - @Override + @java.lang.Override @JsonSetter(value = "app_type", nulls = Nulls.SKIP) public _FinalStage appType(Optional appType) { this.appType = appType; @@ -1970,7 +1970,7 @@ public _FinalStage appType(Optional appType) { *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeaderTrusted) { this.isTokenEndpointIpHeaderTrusted = Optional.ofNullable(isTokenEndpointIpHeaderTrusted); return this; @@ -1979,20 +1979,20 @@ public _FinalStage isTokenEndpointIpHeaderTrusted(Boolean isTokenEndpointIpHeade /** *

If true, trust that the IP specified in the auth0-forwarded-for header is the end-user's IP for brute-force-protection on token endpoint.

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_token_endpoint_ip_header_trusted", nulls = Nulls.SKIP) public _FinalStage isTokenEndpointIpHeaderTrusted(Optional isTokenEndpointIpHeaderTrusted) { this.isTokenEndpointIpHeaderTrusted = isTokenEndpointIpHeaderTrusted; return this; } - @Override + @java.lang.Override public _FinalStage tokenEndpointAuthMethod(ClientTokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { this.tokenEndpointAuthMethod = Optional.ofNullable(tokenEndpointAuthMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public _FinalStage tokenEndpointAuthMethod( Optional tokenEndpointAuthMethod) { @@ -2004,7 +2004,7 @@ public _FinalStage tokenEndpointAuthMethod( *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage grantTypes(List grantTypes) { this.grantTypes = Optional.ofNullable(grantTypes); return this; @@ -2013,7 +2013,7 @@ public _FinalStage grantTypes(List grantTypes) { /** *

List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, urn:ietf:params:oauth:grant-type:device_code, and urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token.

*/ - @Override + @java.lang.Override @JsonSetter(value = "grant_types", nulls = Nulls.SKIP) public _FinalStage grantTypes(Optional> grantTypes) { this.grantTypes = grantTypes; @@ -2024,7 +2024,7 @@ public _FinalStage grantTypes(Optional> grantTypes) { *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowedLogoutUrls(List allowedLogoutUrls) { this.allowedLogoutUrls = Optional.ofNullable(allowedLogoutUrls); return this; @@ -2033,7 +2033,7 @@ public _FinalStage allowedLogoutUrls(List allowedLogoutUrls) { /** *

Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

*/ - @Override + @java.lang.Override @JsonSetter(value = "allowed_logout_urls", nulls = Nulls.SKIP) public _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls) { this.allowedLogoutUrls = allowedLogoutUrls; @@ -2044,7 +2044,7 @@ public _FinalStage allowedLogoutUrls(Optional> allowedLogoutUrls) { *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowedClients(List allowedClients) { this.allowedClients = Optional.ofNullable(allowedClients); return this; @@ -2053,7 +2053,7 @@ public _FinalStage allowedClients(List allowedClients) { /** *

List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

*/ - @Override + @java.lang.Override @JsonSetter(value = "allowed_clients", nulls = Nulls.SKIP) public _FinalStage allowedClients(Optional> allowedClients) { this.allowedClients = allowedClients; @@ -2064,7 +2064,7 @@ public _FinalStage allowedClients(Optional> allowedClients) { *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage clientAliases(List clientAliases) { this.clientAliases = Optional.ofNullable(clientAliases); return this; @@ -2073,7 +2073,7 @@ public _FinalStage clientAliases(List clientAliases) { /** *

List of audiences/realms for SAML protocol. Used by the wsfed addon.

*/ - @Override + @java.lang.Override @JsonSetter(value = "client_aliases", nulls = Nulls.SKIP) public _FinalStage clientAliases(Optional> clientAliases) { this.clientAliases = clientAliases; @@ -2084,7 +2084,7 @@ public _FinalStage clientAliases(Optional> clientAliases) { *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage webOrigins(List webOrigins) { this.webOrigins = Optional.ofNullable(webOrigins); return this; @@ -2093,7 +2093,7 @@ public _FinalStage webOrigins(List webOrigins) { /** *

Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

*/ - @Override + @java.lang.Override @JsonSetter(value = "web_origins", nulls = Nulls.SKIP) public _FinalStage webOrigins(Optional> webOrigins) { this.webOrigins = webOrigins; @@ -2104,7 +2104,7 @@ public _FinalStage webOrigins(Optional> webOrigins) { *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowedOrigins(List allowedOrigins) { this.allowedOrigins = Optional.ofNullable(allowedOrigins); return this; @@ -2113,14 +2113,14 @@ public _FinalStage allowedOrigins(List allowedOrigins) { /** *

Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

*/ - @Override + @java.lang.Override @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) public _FinalStage allowedOrigins(Optional> allowedOrigins) { this.allowedOrigins = allowedOrigins; return this; } - @Override + @java.lang.Override public _FinalStage sessionTransfer( com.auth0.client.mgmt.core.Nullable sessionTransfer) { if (sessionTransfer.isNull()) { @@ -2133,7 +2133,7 @@ public _FinalStage sessionTransfer( return this; } - @Override + @java.lang.Override public _FinalStage sessionTransfer(Optional sessionTransfer) { if (sessionTransfer.isPresent()) { this.sessionTransfer = OptionalNullable.of(sessionTransfer.get()); @@ -2143,13 +2143,13 @@ public _FinalStage sessionTransfer(Optional return this; } - @Override + @java.lang.Override public _FinalStage sessionTransfer(ClientSessionTransferConfiguration sessionTransfer) { this.sessionTransfer = OptionalNullable.of(sessionTransfer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "session_transfer", nulls = Nulls.SKIP) public _FinalStage sessionTransfer( @Nullable OptionalNullable sessionTransfer) { @@ -2157,26 +2157,26 @@ public _FinalStage sessionTransfer( return this; } - @Override + @java.lang.Override public _FinalStage oidcBackchannelLogout(ClientOidcBackchannelLogoutSettings oidcBackchannelLogout) { this.oidcBackchannelLogout = Optional.ofNullable(oidcBackchannelLogout); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_backchannel_logout", nulls = Nulls.SKIP) public _FinalStage oidcBackchannelLogout(Optional oidcBackchannelLogout) { this.oidcBackchannelLogout = oidcBackchannelLogout; return this; } - @Override + @java.lang.Override public _FinalStage oidcLogout(ClientOidcBackchannelLogoutSettings oidcLogout) { this.oidcLogout = Optional.ofNullable(oidcLogout); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_logout", nulls = Nulls.SKIP) public _FinalStage oidcLogout(Optional oidcLogout) { this.oidcLogout = oidcLogout; @@ -2187,7 +2187,7 @@ public _FinalStage oidcLogout(Optional oidc *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage callbacks(List callbacks) { this.callbacks = Optional.ofNullable(callbacks); return this; @@ -2196,7 +2196,7 @@ public _FinalStage callbacks(List callbacks) { /** *

Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

*/ - @Override + @java.lang.Override @JsonSetter(value = "callbacks", nulls = Nulls.SKIP) public _FinalStage callbacks(Optional> callbacks) { this.callbacks = callbacks; @@ -2207,7 +2207,7 @@ public _FinalStage callbacks(Optional> callbacks) { *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage logoUri(String logoUri) { this.logoUri = Optional.ofNullable(logoUri); return this; @@ -2216,7 +2216,7 @@ public _FinalStage logoUri(String logoUri) { /** *

URL of the logo to display for this client. Recommended size is 150x150 pixels.

*/ - @Override + @java.lang.Override @JsonSetter(value = "logo_uri", nulls = Nulls.SKIP) public _FinalStage logoUri(Optional logoUri) { this.logoUri = logoUri; @@ -2227,7 +2227,7 @@ public _FinalStage logoUri(Optional logoUri) { *

Free text description of this client (max length: 140 characters).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -2236,14 +2236,14 @@ public _FinalStage description(String description) { /** *

Free text description of this client (max length: 140 characters).

*/ - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public CreateClientRequestContent build() { return new CreateClientRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java index 61900ae0f..043fc6235 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java @@ -676,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateClientResponseContent && equalTo((CreateClientResponseContent) other); @@ -744,7 +744,7 @@ private boolean equalTo(CreateClientResponseContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -802,7 +802,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java index 9526f7b70..5440e4b06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionCommon.java @@ -66,60 +66,60 @@ private CreateConnectionCommon( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionCommon && equalTo((CreateConnectionCommon) other); @@ -142,7 +142,7 @@ private boolean equalTo(CreateConnectionCommon other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -156,7 +156,7 @@ public int hashCode() { this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java index 1b774409c..186bed14e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileRequestContent.java @@ -83,7 +83,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionProfileRequestContent @@ -104,7 +104,7 @@ private boolean equalTo(CreateConnectionProfileRequestContent other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -115,7 +115,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -173,7 +173,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateConnectionProfileRequestContent other) { name(other.getName()); organization(other.getOrganization()); @@ -184,79 +184,79 @@ public Builder from(CreateConnectionProfileRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage strategyOverrides(ConnectionProfileStrategyOverrides strategyOverrides) { this.strategyOverrides = Optional.ofNullable(strategyOverrides); return this; } - @Override + @java.lang.Override @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) public _FinalStage strategyOverrides(Optional strategyOverrides) { this.strategyOverrides = strategyOverrides; return this; } - @Override + @java.lang.Override public _FinalStage connectionConfig(ConnectionProfileConfig connectionConfig) { this.connectionConfig = Optional.ofNullable(connectionConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_config", nulls = Nulls.SKIP) public _FinalStage connectionConfig(Optional connectionConfig) { this.connectionConfig = connectionConfig; return this; } - @Override + @java.lang.Override public _FinalStage enabledFeatures(List enabledFeatures) { this.enabledFeatures = Optional.ofNullable(enabledFeatures); return this; } - @Override + @java.lang.Override @JsonSetter(value = "enabled_features", nulls = Nulls.SKIP) public _FinalStage enabledFeatures(Optional> enabledFeatures) { this.enabledFeatures = enabledFeatures; return this; } - @Override + @java.lang.Override public _FinalStage connectionNamePrefixTemplate(String connectionNamePrefixTemplate) { this.connectionNamePrefixTemplate = Optional.ofNullable(connectionNamePrefixTemplate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_name_prefix_template", nulls = Nulls.SKIP) public _FinalStage connectionNamePrefixTemplate(Optional connectionNamePrefixTemplate) { this.connectionNamePrefixTemplate = connectionNamePrefixTemplate; return this; } - @Override + @java.lang.Override public _FinalStage organization(ConnectionProfileOrganization organization) { this.organization = Optional.ofNullable(organization); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization", nulls = Nulls.SKIP) public _FinalStage organization(Optional organization) { this.organization = organization; return this; } - @Override + @java.lang.Override public CreateConnectionProfileRequestContent build() { return new CreateConnectionProfileRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java index 22695f969..814a7bba4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionProfileResponseContent.java @@ -91,7 +91,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionProfileResponseContent @@ -113,7 +113,7 @@ private boolean equalTo(CreateConnectionProfileResponseContent other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -125,7 +125,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java index e40dac446..153b6ba81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContent.java @@ -147,7 +147,7 @@ public Optional getConnectedAccounts() { return connectedAccounts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContent && equalTo((CreateConnectionRequestContent) other); @@ -172,7 +172,7 @@ private boolean equalTo(CreateConnectionRequestContent other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -188,7 +188,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -294,7 +294,7 @@ public static final class Builder implements NameStage, StrategyStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(CreateConnectionRequestContent other) { name(other.getName()); displayName(other.getDisplayName()); @@ -315,53 +315,53 @@ public Builder from(CreateConnectionRequestContent other) { *

The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public StrategyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("strategy") public _FinalStage strategy(@NotNull ConnectionIdentityProviderEnum strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { this.connectedAccounts = Optional.ofNullable(connectedAccounts); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) public _FinalStage connectedAccounts(Optional connectedAccounts) { this.connectedAccounts = connectedAccounts; return this; } - @Override + @java.lang.Override public _FinalStage authentication(ConnectionAuthenticationPurpose authentication) { this.authentication = Optional.ofNullable(authentication); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication", nulls = Nulls.SKIP) public _FinalStage authentication(Optional authentication) { this.authentication = authentication; return this; } - @Override + @java.lang.Override public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; @@ -372,7 +372,7 @@ public _FinalStage metadata(Optional>> meta *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage realms(List realms) { this.realms = Optional.ofNullable(realms); return this; @@ -381,7 +381,7 @@ public _FinalStage realms(List realms) { /** *

Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.

*/ - @Override + @java.lang.Override @JsonSetter(value = "realms", nulls = Nulls.SKIP) public _FinalStage realms(Optional> realms) { this.realms = realms; @@ -392,7 +392,7 @@ public _FinalStage realms(Optional> realms) { *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -401,7 +401,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

*/ - @Override + @java.lang.Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -412,7 +412,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isDomainConnection(Boolean isDomainConnection) { this.isDomainConnection = Optional.ofNullable(isDomainConnection); return this; @@ -421,7 +421,7 @@ public _FinalStage isDomainConnection(Boolean isDomainConnection) { /** *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) public _FinalStage isDomainConnection(Optional isDomainConnection) { this.isDomainConnection = isDomainConnection; @@ -432,7 +432,7 @@ public _FinalStage isDomainConnection(Optional isDomainConnection) { *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabledClients(List enabledClients) { this.enabledClients = Optional.ofNullable(enabledClients); return this; @@ -441,20 +441,20 @@ public _FinalStage enabledClients(List enabledClients) { /** *

DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) public _FinalStage enabledClients(Optional> enabledClients) { this.enabledClients = enabledClients; return this; } - @Override + @java.lang.Override public _FinalStage options(ConnectionPropertiesOptions options) { this.options = Optional.ofNullable(options); return this; } - @Override + @java.lang.Override @JsonSetter(value = "options", nulls = Nulls.SKIP) public _FinalStage options(Optional options) { this.options = options; @@ -465,7 +465,7 @@ public _FinalStage options(Optional options) { *

Connection name used in the new universal login experience

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -474,14 +474,14 @@ public _FinalStage displayName(String displayName) { /** *

Connection name used in the new universal login experience

*/ - @Override + @java.lang.Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public CreateConnectionRequestContent build() { return new CreateConnectionRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java index a8b3bf381..43e2283c0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAd.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAd( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAd && equalTo((CreateConnectionRequestContentAd) other); @@ -157,7 +157,7 @@ private boolean equalTo(CreateConnectionRequestContentAd other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -172,7 +172,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java index ec2853823..487bf76c0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAdfs.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAdfs( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAdfs @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentAdfs other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java index 46a7132d3..03d407b96 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAmazon.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAmazon( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAmazon @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentAmazon other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java index 4fb0dff68..e9bcef54f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAol.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAol( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAol && equalTo((CreateConnectionRequestContentAol) other); @@ -157,7 +157,7 @@ private boolean equalTo(CreateConnectionRequestContentAol other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -172,7 +172,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java index e80a7c088..aed39b0be 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentApple.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentApple( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentApple @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentApple other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java index bd19cfe55..cc59d1a5b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAuth0( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAuth0 @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentAuth0 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java index 0a4c0b79d..98e306b66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAuth0Oidc.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentAuth0Oidc( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAuth0Oidc @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentAuth0Oidc other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java index 88d6c51e5..13477b4aa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentAzureAd.java @@ -78,55 +78,55 @@ private CreateConnectionRequestContentAzureAd( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -151,7 +151,7 @@ public Optional getProvisioningTicketUrl() { return provisioningTicketUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentAzureAd @@ -178,7 +178,7 @@ private boolean equalTo(CreateConnectionRequestContentAzureAd other) { && provisioningTicketUrl.equals(other.provisioningTicketUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -195,7 +195,7 @@ public int hashCode() { this.provisioningTicketUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java index b5342e314..20c3c7680 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBaidu.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentBaidu( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentBaidu @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentBaidu other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java index 8342c510d..1c5f756db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitbucket.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentBitbucket( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentBitbucket @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentBitbucket other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java index aa6999788..6ed7cf5b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBitly.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentBitly( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentBitly @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentBitly other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java index 5e278f880..241467297 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentBox.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentBox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentBox && equalTo((CreateConnectionRequestContentBox) other); @@ -157,7 +157,7 @@ private boolean equalTo(CreateConnectionRequestContentBox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -172,7 +172,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java index 48f4b05cf..6af318e4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentCustom.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentCustom( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentCustom @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentCustom other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java index f03a24dac..1ebbd5783 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDaccount.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentDaccount( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentDaccount @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentDaccount other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java index 57e0a11c3..b6370d182 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDropbox.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentDropbox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentDropbox @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentDropbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java index 293370a0f..fb57d7d65 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentDwolla.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentDwolla( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentDwolla @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentDwolla other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java index 5e1f40ae1..4a300eaa3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEmail.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentEmail( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentEmail @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentEmail other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java index 669e1d59d..6858b26df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernote.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentEvernote( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentEvernote @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentEvernote other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java index 5383c9005..b6db61ca7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentEvernoteSandbox.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentEvernoteSandbox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentEvernoteSandbox @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentEvernoteSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java index 3abe3835a..76c11a985 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentExact.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentExact( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentExact @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentExact other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java index d375b3836..bde35c9b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFacebook.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentFacebook( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentFacebook @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentFacebook other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java index fb82479d9..7c482fd50 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFitbit.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentFitbit( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentFitbit @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentFitbit other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java index 327108b97..9a387de0f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentFlickr( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentFlickr @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentFlickr other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java index 2602a3803..a6519e93e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGitHub.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentGitHub( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentGitHub @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentGitHub other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java index 9aca2832d..72209079f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleApps.java @@ -40,7 +40,7 @@ public final class CreateConnectionRequestContentGoogleApps implements ICreateCo private final Optional showAsButton; - private final Optional> options; + private final Optional options; private final Map additionalProperties; @@ -54,7 +54,7 @@ private CreateConnectionRequestContentGoogleApps( Optional>> metadata, Optional> realms, Optional showAsButton, - Optional> options, + Optional options, Map additionalProperties) { this.name = name; this.authentication = authentication; @@ -70,55 +70,55 @@ private CreateConnectionRequestContentGoogleApps( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -129,11 +129,11 @@ public String getStrategy() { } @JsonProperty("options") - public Optional> getOptions() { + public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentGoogleApps @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentGoogleApps other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -202,7 +202,7 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> options = Optional.empty(); + private Optional options = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -323,12 +323,12 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional> options) { + public Builder options(Optional options) { this.options = options; return this; } - public Builder options(Map options) { + public Builder options(ConnectionOptionsGoogleApps options) { this.options = Optional.ofNullable(options); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java index e2f71ab05..ea5c79eb4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentGoogleOAuth2.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentGoogleOAuth2( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentGoogleOAuth2 @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentGoogleOAuth2 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java index 45b4c43b3..cc82c81a5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentInstagram.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentInstagram( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentInstagram @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentInstagram other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java index b9247d0bc..d9ae30d00 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentIp.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentIp( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentIp && equalTo((CreateConnectionRequestContentIp) other); @@ -157,7 +157,7 @@ private boolean equalTo(CreateConnectionRequestContentIp other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -172,7 +172,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java index 20c080a80..2352b7594 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLine.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentLine( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentLine @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentLine other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java index 96e918334..7076b98c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentLinkedin.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentLinkedin( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentLinkedin @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentLinkedin other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java index 83e471fbd..b0994ce48 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentMiicard.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentMiicard( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentMiicard @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentMiicard other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java index a543cb6d5..79e699b45 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth1.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentOAuth1( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentOAuth1 @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentOAuth1 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java index 78aeafb55..4086cef47 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOAuth2.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentOAuth2( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentOAuth2 @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentOAuth2 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java index 93c99a6bb..7f4a28e7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOffice365.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentOffice365( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentOffice365 @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentOffice365 other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java index 5a8bb61b8..24f82cc5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOidc.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentOidc( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentOidc @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentOidc other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java index d9642aaed..d670c48b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentOkta.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentOkta( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentOkta @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentOkta other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java index 951b91a9f..21d5ccc6c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypal.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentPaypal( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentPaypal @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentPaypal other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java index 3f45a914a..f83e54fa2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPaypalSandbox.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentPaypalSandbox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentPaypalSandbox @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentPaypalSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java index 2f9808e78..f2b9685d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPingFederate.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentPingFederate( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentPingFederate @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentPingFederate other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java index d06385d2a..82cdb4d46 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentPlanningCenter.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentPlanningCenter( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentPlanningCenter @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentPlanningCenter other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java index cc75b61b0..2532e535c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentRenren.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentRenren( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentRenren @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentRenren other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java index f6cb13b27..3985f7cd3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforce.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentSalesforce( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSalesforce @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentSalesforce other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java index b834ceac2..151fa475e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceCommunity.java @@ -71,55 +71,55 @@ private CreateConnectionRequestContentSalesforceCommunity( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -134,7 +134,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSalesforceCommunity @@ -159,7 +159,7 @@ private boolean equalTo(CreateConnectionRequestContentSalesforceCommunity other) && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -174,7 +174,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java index 04112bf89..707533d17 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSalesforceSandbox.java @@ -71,55 +71,55 @@ private CreateConnectionRequestContentSalesforceSandbox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -134,7 +134,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSalesforceSandbox @@ -159,7 +159,7 @@ private boolean equalTo(CreateConnectionRequestContentSalesforceSandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -174,7 +174,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java index 0f8bb36cc..0fe9dbd37 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSaml.java @@ -40,7 +40,7 @@ public final class CreateConnectionRequestContentSaml implements ICreateConnecti private final Optional showAsButton; - private final Optional> options; + private final Optional options; private final Map additionalProperties; @@ -54,7 +54,7 @@ private CreateConnectionRequestContentSaml( Optional>> metadata, Optional> realms, Optional showAsButton, - Optional> options, + Optional options, Map additionalProperties) { this.name = name; this.authentication = authentication; @@ -70,55 +70,55 @@ private CreateConnectionRequestContentSaml( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -129,11 +129,11 @@ public String getStrategy() { } @JsonProperty("options") - public Optional> getOptions() { + public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSaml @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentSaml other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -202,7 +202,7 @@ public static final class Builder { private Optional showAsButton = Optional.empty(); - private Optional> options = Optional.empty(); + private Optional options = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -323,12 +323,12 @@ public Builder showAsButton(Boolean showAsButton) { } @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional> options) { + public Builder options(Optional options) { this.options = options; return this; } - public Builder options(Map options) { + public Builder options(ConnectionOptionsSaml options) { this.options = Optional.ofNullable(options); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java index ec38b3d66..658bf1407 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSharepoint.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentSharepoint( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSharepoint @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentSharepoint other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java index 56a067934..957c4298c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShop.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentShop( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentShop @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentShop other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java index f4848c4d3..6bf0681a5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentShopify.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentShopify( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentShopify @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentShopify other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java index 972992b64..22f7933a1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSms.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentSms( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSms && equalTo((CreateConnectionRequestContentSms) other); @@ -157,7 +157,7 @@ private boolean equalTo(CreateConnectionRequestContentSms other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -172,7 +172,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java index 9227cd8b6..494361d07 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentSoundcloud.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentSoundcloud( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentSoundcloud @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentSoundcloud other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java index 47c1d785f..20149f8e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCity.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentTheCity( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentTheCity @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentTheCity other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java index fa41667b1..f58a258e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTheCitySandbox.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentTheCitySandbox( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentTheCitySandbox @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentTheCitySandbox other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java index 8f1d93e4c..acc8bc566 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentThirtySevenSignals.java @@ -71,55 +71,55 @@ private CreateConnectionRequestContentThirtySevenSignals( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -134,7 +134,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentThirtySevenSignals @@ -159,7 +159,7 @@ private boolean equalTo(CreateConnectionRequestContentThirtySevenSignals other) && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -174,7 +174,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java index f7809d4e3..e725173cd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentTwitter.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentTwitter( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentTwitter @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentTwitter other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java index ce2951893..294dc7f99 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentUntappd.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentUntappd( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentUntappd @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentUntappd other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java index 97d2fd292..15ac0e813 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentVkontakte.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentVkontakte( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentVkontakte @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentVkontakte other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java index 948d0d466..e281424eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWeibo.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentWeibo( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentWeibo @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentWeibo other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java index f621d77e3..61cd2a46f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWindowsLive.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentWindowsLive( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentWindowsLive @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentWindowsLive other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java index c750e9380..5b88e39e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentWordpress.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentWordpress( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentWordpress @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentWordpress other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java index d732e2582..745b53df2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYahoo.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentYahoo( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentYahoo @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentYahoo other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java index b929bc68e..bffb90b31 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYammer.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentYammer( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentYammer @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentYammer other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java index 2ce3af07f..348b89382 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentYandex.java @@ -70,55 +70,55 @@ private CreateConnectionRequestContentYandex( } @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @JsonProperty("authentication") - @Override + @java.lang.Override public Optional getAuthentication() { return authentication; } @JsonProperty("connected_accounts") - @Override + @java.lang.Override public Optional getConnectedAccounts() { return connectedAccounts; } @JsonProperty("display_name") - @Override + @java.lang.Override public Optional getDisplayName() { return displayName; } @JsonProperty("enabled_clients") - @Override + @java.lang.Override public Optional> getEnabledClients() { return enabledClients; } @JsonProperty("is_domain_connection") - @Override + @java.lang.Override public Optional getIsDomainConnection() { return isDomainConnection; } @JsonProperty("metadata") - @Override + @java.lang.Override public Optional>> getMetadata() { return metadata; } @JsonProperty("realms") - @Override + @java.lang.Override public Optional> getRealms() { return realms; } @JsonProperty("show_as_button") - @Override + @java.lang.Override public Optional getShowAsButton() { return showAsButton; } @@ -133,7 +133,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionRequestContentYandex @@ -158,7 +158,7 @@ private boolean equalTo(CreateConnectionRequestContentYandex other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -173,7 +173,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java index 77971d50f..5a82d2dc3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionResponseContent.java @@ -161,7 +161,7 @@ public Optional getConnectedAccounts() { return connectedAccounts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateConnectionResponseContent && equalTo((CreateConnectionResponseContent) other); @@ -187,7 +187,7 @@ private boolean equalTo(CreateConnectionResponseContent other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -204,7 +204,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java index 6cb542cf3..698278e98 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainRequestContent.java @@ -89,7 +89,7 @@ public Optional>> getDomainMetadata() { return domainMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateCustomDomainRequestContent && equalTo((CreateCustomDomainRequestContent) other); @@ -109,7 +109,7 @@ private boolean equalTo(CreateCustomDomainRequestContent other) { && domainMetadata.equals(other.domainMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.domain, @@ -120,7 +120,7 @@ public int hashCode() { this.domainMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -185,7 +185,7 @@ public static final class Builder implements DomainStage, TypeStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateCustomDomainRequestContent other) { domain(other.getDomain()); type(other.getType()); @@ -201,34 +201,34 @@ public Builder from(CreateCustomDomainRequestContent other) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public TypeStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainProvisioningTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; return this; } - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -240,7 +240,7 @@ public _FinalStage customClientIpHeader(Nullable customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -250,13 +250,13 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { @@ -264,33 +264,33 @@ public _FinalStage customClientIpHeader( return this; } - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; return this; } - @Override + @java.lang.Override public _FinalStage verificationMethod(String verificationMethod) { this.verificationMethod = Optional.ofNullable(verificationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "verification_method", nulls = Nulls.SKIP) public _FinalStage verificationMethod(Optional verificationMethod) { this.verificationMethod = verificationMethod; return this; } - @Override + @java.lang.Override public CreateCustomDomainRequestContent build() { return new CreateCustomDomainRequestContent( domain, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java index 489c07f27..7fccf12b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateCustomDomainResponseContent.java @@ -146,7 +146,7 @@ private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateCustomDomainResponseContent && equalTo((CreateCustomDomainResponseContent) other); @@ -170,7 +170,7 @@ private boolean equalTo(CreateCustomDomainResponseContent other) { && certificate.equals(other.certificate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.customDomainId, @@ -185,7 +185,7 @@ public int hashCode() { this.certificate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,7 +293,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); @@ -313,7 +313,7 @@ public Builder from(CreateCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -325,7 +325,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -337,54 +337,54 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public VerificationStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("verification") public _FinalStage verification(@NotNull DomainVerification verification) { this.verification = Objects.requireNonNull(verification, "verification must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage certificate(DomainCertificate certificate) { this.certificate = Optional.ofNullable(certificate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "certificate", nulls = Nulls.SKIP) public _FinalStage certificate(Optional certificate) { this.certificate = certificate; return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; @@ -395,7 +395,7 @@ public _FinalStage domainMetadata(Optional> *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -404,7 +404,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -415,7 +415,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -431,7 +431,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -445,7 +445,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -454,14 +454,14 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @Override + @java.lang.Override public CreateCustomDomainResponseContent build() { return new CreateCustomDomainResponseContent( customDomainId, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java index 244bec3de..33b3d9e05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java @@ -52,7 +52,7 @@ public Optional getSynchronizeAutomatically() { return synchronizeAutomatically; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateDirectoryProvisioningRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(CreateDirectoryProvisioningRequestContent other) { return mapping.equals(other.mapping) && synchronizeAutomatically.equals(other.synchronizeAutomatically); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mapping, this.synchronizeAutomatically); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java index 1fc4bf64b..04a0d2f8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java @@ -151,7 +151,7 @@ public Optional getLastSynchronizationError() { return lastSynchronizationError; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateDirectoryProvisioningResponseContent @@ -176,7 +176,7 @@ private boolean equalTo(CreateDirectoryProvisioningResponseContent other) { && lastSynchronizationError.equals(other.lastSynchronizationError); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -191,7 +191,7 @@ public int hashCode() { this.lastSynchronizationError); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -312,7 +312,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateDirectoryProvisioningResponseContent other) { connectionId(other.getConnectionId()); connectionName(other.getConnectionName()); @@ -332,7 +332,7 @@ public Builder from(CreateDirectoryProvisioningResponseContent other) { *

The connection's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public ConnectionNameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -344,7 +344,7 @@ public ConnectionNameStage connectionId(@NotNull String connectionId) { *

The connection's name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_name") public StrategyStage connectionName(@NotNull String connectionName) { this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); @@ -356,7 +356,7 @@ public StrategyStage connectionName(@NotNull String connectionName) { *

The connection's strategy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("strategy") public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); @@ -368,7 +368,7 @@ public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { *

Whether periodic automatic synchronization is enabled

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("synchronize_automatically") public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { this.synchronizeAutomatically = synchronizeAutomatically; @@ -380,7 +380,7 @@ public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) *

The timestamp at which the directory provisioning configuration was created

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -392,7 +392,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The timestamp at which the directory provisioning configuration was last updated

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -403,7 +403,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The error message of the last synchronization, if any

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationError(String lastSynchronizationError) { this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); return this; @@ -412,7 +412,7 @@ public _FinalStage lastSynchronizationError(String lastSynchronizationError) { /** *

The error message of the last synchronization, if any

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { this.lastSynchronizationError = lastSynchronizationError; @@ -423,7 +423,7 @@ public _FinalStage lastSynchronizationError(Optional lastSynchronization *

The status of the last synchronization

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); return this; @@ -432,7 +432,7 @@ public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { /** *

The status of the last synchronization

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { this.lastSynchronizationStatus = lastSynchronizationStatus; @@ -443,7 +443,7 @@ public _FinalStage lastSynchronizationStatus(Optional lastSynchronizatio *

The timestamp at which the connection was last synchronized

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); return this; @@ -452,7 +452,7 @@ public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { /** *

The timestamp at which the connection was last synchronized

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { this.lastSynchronizationAt = lastSynchronizationAt; @@ -463,7 +463,7 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllMapping(List mapping) { if (mapping != null) { this.mapping.addAll(mapping); @@ -475,7 +475,7 @@ public _FinalStage addAllMapping(List mapping) *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { this.mapping.add(mapping); return this; @@ -484,7 +484,7 @@ public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { /** *

The mapping between Auth0 and IDP user attributes

*/ - @Override + @java.lang.Override @JsonSetter(value = "mapping", nulls = Nulls.SKIP) public _FinalStage mapping(List mapping) { this.mapping.clear(); @@ -494,7 +494,7 @@ public _FinalStage mapping(List mapping) { return this; } - @Override + @java.lang.Override public CreateDirectoryProvisioningResponseContent build() { return new CreateDirectoryProvisioningResponseContent( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java index 70dd7fcd5..1619f8133 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectorySynchronizationResponseContent.java @@ -59,7 +59,7 @@ public String getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateDirectorySynchronizationResponseContent @@ -77,12 +77,12 @@ private boolean equalTo(CreateDirectorySynchronizationResponseContent other) { && status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.synchronizationId, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements ConnectionIdStage, SynchronizationI private Builder() {} - @Override + @java.lang.Override public Builder from(CreateDirectorySynchronizationResponseContent other) { connectionId(other.getConnectionId()); synchronizationId(other.getSynchronizationId()); @@ -144,7 +144,7 @@ public Builder from(CreateDirectorySynchronizationResponseContent other) { *

The connection's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public SynchronizationIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -156,7 +156,7 @@ public SynchronizationIdStage connectionId(@NotNull String connectionId) { *

The synchronization's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("synchronization_id") public StatusStage synchronizationId(@NotNull String synchronizationId) { this.synchronizationId = Objects.requireNonNull(synchronizationId, "synchronizationId must not be null"); @@ -168,14 +168,14 @@ public StatusStage synchronizationId(@NotNull String synchronizationId) { *

The synchronization status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public _FinalStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override public CreateDirectorySynchronizationResponseContent build() { return new CreateDirectorySynchronizationResponseContent( connectionId, synchronizationId, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java index f7d192a95..25db1c9d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailProviderResponseContent @@ -101,12 +101,12 @@ private boolean equalTo(CreateEmailProviderResponseContent other) { && settings.equals(other.settings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java index 98886103b..646bb455c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateRequestContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailTemplateRequestContent && equalTo((CreateEmailTemplateRequestContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(CreateEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEmailTemplateRequestContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(CreateEmailTemplateRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @Override + @java.lang.Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @Override + @java.lang.Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @Override + @java.lang.Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @Override + @java.lang.Override public CreateEmailTemplateRequestContent build() { return new CreateEmailTemplateRequestContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java index bcbba1ace..3eac25b69 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEmailTemplateResponseContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEmailTemplateResponseContent @@ -230,7 +230,7 @@ private boolean equalTo(CreateEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -244,7 +244,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -372,7 +372,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEmailTemplateResponseContent other) { template(other.getTemplate()); body(other.getBody()); @@ -386,7 +386,7 @@ public Builder from(CreateEmailTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -397,7 +397,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -413,7 +413,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -427,7 +427,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -436,7 +436,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -447,7 +447,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -456,7 +456,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -467,7 +467,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -483,7 +483,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -497,7 +497,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -506,7 +506,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @Override + @java.lang.Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -517,7 +517,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -533,7 +533,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -547,7 +547,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -556,7 +556,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @Override + @java.lang.Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -567,7 +567,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -583,7 +583,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -597,7 +597,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -606,7 +606,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -617,7 +617,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -633,7 +633,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -647,7 +647,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -656,7 +656,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -667,7 +667,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -683,7 +683,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -697,7 +697,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -706,7 +706,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -717,7 +717,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -733,7 +733,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -747,7 +747,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -756,14 +756,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @Override + @java.lang.Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @Override + @java.lang.Override public CreateEmailTemplateResponseContent build() { return new CreateEmailTemplateResponseContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java index b8f0cc0a2..51f55216c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyPublicWrappingResponseContent.java @@ -45,7 +45,7 @@ public String getAlgorithm() { return algorithm; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyPublicWrappingResponseContent @@ -61,12 +61,12 @@ private boolean equalTo(CreateEncryptionKeyPublicWrappingResponseContent other) return publicKey.equals(other.publicKey) && algorithm.equals(other.algorithm); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.publicKey, this.algorithm); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements PublicKeyStage, AlgorithmStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEncryptionKeyPublicWrappingResponseContent other) { publicKey(other.getPublicKey()); algorithm(other.getAlgorithm()); @@ -115,21 +115,21 @@ public Builder from(CreateEncryptionKeyPublicWrappingResponseContent other) { *

Public wrapping key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("public_key") public AlgorithmStage publicKey(@NotNull String publicKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("algorithm") public _FinalStage algorithm(@NotNull String algorithm) { this.algorithm = Objects.requireNonNull(algorithm, "algorithm must not be null"); return this; } - @Override + @java.lang.Override public CreateEncryptionKeyPublicWrappingResponseContent build() { return new CreateEncryptionKeyPublicWrappingResponseContent(publicKey, algorithm, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java index 2abaa3b7a..6b43e7290 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEncryptionKeyResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(CreateEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -215,7 +215,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -232,21 +232,21 @@ public Builder from(CreateEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -258,7 +258,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -270,7 +270,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -282,7 +282,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -293,7 +293,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -302,14 +302,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @Override + @java.lang.Override public CreateEncryptionKeyResponseContent build() { return new CreateEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java index 7373d5678..8391b512d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEncryptionKeyType.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CreateEncryptionKeyType && this.string.equals(((CreateEncryptionKeyType) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java index e2b055cca..b415797bf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamActionRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamActionRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamActionRequestContent other) { && status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEventStreamActionRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamActionRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamActionDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateEventStreamActionRequestContent build() { return new CreateEventStreamActionRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java index 9ab74165e..08b37a544 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamEventBridgeRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamEventBridgeRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamEventBridgeRequestContent other) { && status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEventStreamEventBridgeRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamEventBridgeRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamEventBridgeDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateEventStreamEventBridgeRequestContent build() { return new CreateEventStreamEventBridgeRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java index b2cdcfbed..3885fbcfc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamRedeliveryResponseContent.java @@ -77,7 +77,7 @@ public Optional> getEventTypes() { return eventTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamRedeliveryResponseContent @@ -96,12 +96,12 @@ private boolean equalTo(CreateEventStreamRedeliveryResponseContent other) { && eventTypes.equals(other.eventTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.dateFrom, this.dateTo, this.statuses, this.eventTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java index 9d34573db..e8a0edb1b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamResponseContent && equalTo((CreateEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(CreateEventStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer> getData() { return data; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamTestEventRequestContent @@ -62,12 +62,12 @@ private boolean equalTo(CreateEventStreamTestEventRequestContent other) { return eventType.equals(other.eventType) && data.equals(other.data); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.data); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,34 +101,34 @@ public static final class Builder implements EventTypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEventStreamTestEventRequestContent other) { eventType(other.getEventType()); data(other.getData()); return this; } - @Override + @java.lang.Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamTestEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage data(Map data) { this.data = Optional.ofNullable(data); return this; } - @Override + @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional> data) { this.data = data; return this; } - @Override + @java.lang.Override public CreateEventStreamTestEventRequestContent build() { return new CreateEventStreamTestEventRequestContent(eventType, data, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java index 8eef953be..bfdea88f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamTestEventResponseContent.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamTestEventResponseContent @@ -114,12 +114,12 @@ private boolean equalTo(CreateEventStreamTestEventResponseContent other) { && event.equals(other.event); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEventStreamTestEventResponseContent other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -204,7 +204,7 @@ public Builder from(CreateEventStreamTestEventResponseContent other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -216,34 +216,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -254,7 +254,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -266,7 +266,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -275,7 +275,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @Override + @java.lang.Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -285,7 +285,7 @@ public _FinalStage attempts(List attempts) { return this; } - @Override + @java.lang.Override public CreateEventStreamTestEventResponseContent build() { return new CreateEventStreamTestEventResponseContent( id, eventStreamId, status, eventType, attempts, event, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java index 4919689b4..c0ef573bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateEventStreamWebHookRequestContent.java @@ -71,7 +71,7 @@ public Optional getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateEventStreamWebHookRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateEventStreamWebHookRequestContent other) { && status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,7 +147,7 @@ public static final class Builder implements DestinationStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateEventStreamWebHookRequestContent other) { name(other.getName()); subscriptions(other.getSubscriptions()); @@ -156,20 +156,20 @@ public Builder from(CreateEventStreamWebHookRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("destination") public _FinalStage destination(@NotNull EventStreamWebhookDestination destination) { this.destination = Objects.requireNonNull(destination, "destination must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage status(EventStreamStatusEnum status) { this.status = Optional.ofNullable(status); return this; } - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; @@ -180,7 +180,7 @@ public _FinalStage status(Optional status) { *

List of event types subscribed to in this stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subscriptions(List subscriptions) { this.subscriptions = Optional.ofNullable(subscriptions); return this; @@ -189,7 +189,7 @@ public _FinalStage subscriptions(List subscriptions) { /** *

List of event types subscribed to in this stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subscriptions", nulls = Nulls.SKIP) public _FinalStage subscriptions(Optional> subscriptions) { this.subscriptions = subscriptions; @@ -200,7 +200,7 @@ public _FinalStage subscriptions(Optional> subscri *

Name of the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the event stream.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateEventStreamWebHookRequestContent build() { return new CreateEventStreamWebHookRequestContent( name, subscriptions, destination, status, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java index e86814dbd..48ebd22df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersFields.java @@ -49,7 +49,7 @@ public Optional getExportAs() { return exportAs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersFields && equalTo((CreateExportUsersFields) other); @@ -64,12 +64,12 @@ private boolean equalTo(CreateExportUsersFields other) { return name.equals(other.name) && exportAs.equals(other.exportAs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.exportAs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateExportUsersFields other) { name(other.getName()); exportAs(other.getExportAs()); @@ -121,7 +121,7 @@ public Builder from(CreateExportUsersFields other) { *

Name of the field in the profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -132,7 +132,7 @@ public _FinalStage name(@NotNull String name) { *

Title of the column in the exported CSV.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage exportAs(String exportAs) { this.exportAs = Optional.ofNullable(exportAs); return this; @@ -141,14 +141,14 @@ public _FinalStage exportAs(String exportAs) { /** *

Title of the column in the exported CSV.

*/ - @Override + @java.lang.Override @JsonSetter(value = "export_as", nulls = Nulls.SKIP) public _FinalStage exportAs(Optional exportAs) { this.exportAs = exportAs; return this; } - @Override + @java.lang.Override public CreateExportUsersFields build() { return new CreateExportUsersFields(name, exportAs, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java index e68372ade..ab3539c98 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateExportUsersResponseContent.java @@ -122,7 +122,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateExportUsersResponseContent && equalTo((CreateExportUsersResponseContent) other); @@ -144,7 +144,7 @@ private boolean equalTo(CreateExportUsersResponseContent other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.status, @@ -157,7 +157,7 @@ public int hashCode() { this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -248,7 +248,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(CreateExportUsersResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -266,7 +266,7 @@ public Builder from(CreateExportUsersResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -278,7 +278,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -290,7 +290,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -301,7 +301,7 @@ public _FinalStage id(@NotNull String id) { *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage fields(List fields) { this.fields = Optional.ofNullable(fields); return this; @@ -310,7 +310,7 @@ public _FinalStage fields(List fields) { /** *

List of fields to be included in the CSV. Defaults to a predefined set of fields.

*/ - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; @@ -321,7 +321,7 @@ public _FinalStage fields(Optional> fields) { *

Limit the number of records.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage limit(Integer limit) { this.limit = Optional.ofNullable(limit); return this; @@ -330,20 +330,20 @@ public _FinalStage limit(Integer limit) { /** *

Limit the number of records.

*/ - @Override + @java.lang.Override @JsonSetter(value = "limit", nulls = Nulls.SKIP) public _FinalStage limit(Optional limit) { this.limit = limit; return this; } - @Override + @java.lang.Override public _FinalStage format(JobFileFormatEnum format) { this.format = Optional.ofNullable(format); return this; } - @Override + @java.lang.Override @JsonSetter(value = "format", nulls = Nulls.SKIP) public _FinalStage format(Optional format) { this.format = format; @@ -354,7 +354,7 @@ public _FinalStage format(Optional format) { *

connection_id of the connection from which users will be exported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -363,7 +363,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection from which users will be exported.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -374,7 +374,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -383,14 +383,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public CreateExportUsersResponseContent build() { return new CreateExportUsersResponseContent( status, type, createdAt, id, connectionId, format, limit, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java index ab6ceab85..929af5f34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowRequestContent.java @@ -45,7 +45,7 @@ public Optional> getActions() { return actions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowRequestContent && equalTo((CreateFlowRequestContent) other); @@ -60,12 +60,12 @@ private boolean equalTo(CreateFlowRequestContent other) { return name.equals(other.name) && actions.equals(other.actions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.actions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,34 +99,34 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowRequestContent other) { name(other.getName()); actions(other.getActions()); return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @Override + @java.lang.Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @Override + @java.lang.Override public CreateFlowRequestContent build() { return new CreateFlowRequestContent(name, actions, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java index 0096b6034..eabb8c199 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowResponseContent && equalTo((CreateFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(CreateFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(CreateFlowResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @Override + @java.lang.Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @Override + @java.lang.Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @Override + @java.lang.Override public CreateFlowResponseContent build() { return new CreateFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java index 705eea9ac..ce2e7f0ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaign.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionActivecampaign @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionActivecampaign other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKeyWithBaseUrl setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionActivecampaignApiKey build() { return new CreateFlowsVaultConnectionActivecampaignApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java index 672f8b572..70b56ec4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionActivecampaignUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionActivecampaignUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionActivecampaignUninitialized ot return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionActivecampaignUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionActivecampaignUninitialized other) *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionActivecampaignUninitialized build() { return new CreateFlowsVaultConnectionActivecampaignUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java index c2afa5fc7..c168ea6e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtable.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionAirtable @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionAirtable other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionAirtableApiKey build() { return new CreateFlowsVaultConnectionAirtableApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java index 658fb5d20..738f94aaf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAirtableUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionAirtableUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionAirtableUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionAirtableUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionAirtableUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionAirtableUninitialized build() { return new CreateFlowsVaultConnectionAirtableUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java index ec92b749a..4aaa10e63 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionAuth0 && equalTo((CreateFlowsVaultConnectionAuth0) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionAuth0 other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthApp setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionAuth0OauthApp build() { return new CreateFlowsVaultConnectionAuth0OauthApp(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java index 8cdca415e..a33c2a53f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionAuth0Uninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionAuth0Uninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionAuth0Uninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionAuth0Uninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionAuth0Uninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionAuth0Uninitialized build() { return new CreateFlowsVaultConnectionAuth0Uninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java index 378f20c62..41d28befc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigquery.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionBigquery @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionBigquery other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupBigqueryOauthJwt setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionBigqueryJwt build() { return new CreateFlowsVaultConnectionBigqueryJwt(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java index 5b2b2ef9f..79d016ac7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionBigqueryUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionBigqueryUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionBigqueryUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionBigqueryUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionBigqueryUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionBigqueryUninitialized build() { return new CreateFlowsVaultConnectionBigqueryUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java index 62164b93b..0cdf09707 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbit.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionClearbit @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionClearbit other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionClearbitApiKey build() { return new CreateFlowsVaultConnectionClearbitApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java index a465292d8..f41adc4c3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionClearbitUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionClearbitUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionClearbitUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionClearbitUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionClearbitUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionClearbitUninitialized build() { return new CreateFlowsVaultConnectionClearbitUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java index 39e1551ef..d8b9140c8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusign.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionDocusign @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionDocusign other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionDocusignOauthCode build() { return new CreateFlowsVaultConnectionDocusignOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java index f6d7bc9d4..1f5591b59 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionDocusignUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionDocusignUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionDocusignUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionDocusignUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionDocusignUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionDocusignUninitialized build() { return new CreateFlowsVaultConnectionDocusignUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java index 25cb0efb3..81394a333 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheets.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionGoogleSheets @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionGoogleSheets other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionGoogleSheetsOauthCode build() { return new CreateFlowsVaultConnectionGoogleSheetsOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java index b6ae25c83..7e1abc6c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionGoogleSheetsUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionGoogleSheetsUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionGoogleSheetsUninitialized othe return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionGoogleSheetsUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionGoogleSheetsUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionGoogleSheetsUninitialized build() { return new CreateFlowsVaultConnectionGoogleSheetsUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java index 90170a27b..091c5d5a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttp.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionHttp && equalTo((CreateFlowsVaultConnectionHttp) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionHttp other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupHttpBearer setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionHttpBearer build() { return new CreateFlowsVaultConnectionHttpBearer(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java index aef42dad1..44caed090 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHttpUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionHttpUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionHttpUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionHttpUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionHttpUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionHttpUninitialized build() { return new CreateFlowsVaultConnectionHttpUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java index d044778d1..c70dfcdce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspot.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionHubspot && equalTo((CreateFlowsVaultConnectionHubspot) other); @@ -51,12 +51,12 @@ private boolean equalTo(CreateFlowsVaultConnectionHubspot other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionHubspotApiKey build() { return new CreateFlowsVaultConnectionHubspotApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java index ba26dbcca..5718aaba3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotOauthCode.java @@ -56,7 +56,7 @@ public FlowsVaultConnectioSetupOauthCode getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionHubspotOauthCode @@ -72,12 +72,12 @@ private boolean equalTo(CreateFlowsVaultConnectionHubspotOauthCode other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionHubspotOauthCode other) { name(other.getName()); appId(other.getAppId()); @@ -133,28 +133,28 @@ public Builder from(CreateFlowsVaultConnectionHubspotOauthCode other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionHubspotOauthCode build() { return new CreateFlowsVaultConnectionHubspotOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java index b9358e41b..014c0f982 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionHubspotUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionHubspotUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionHubspotUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionHubspotUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionHubspotUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionHubspotUninitialized build() { return new CreateFlowsVaultConnectionHubspotUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java index 37fdb64d9..e1d3316b2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwt.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionJwt && equalTo((CreateFlowsVaultConnectionJwt) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionJwt other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupJwt setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionJwtJwt build() { return new CreateFlowsVaultConnectionJwtJwt(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java index f89ebab80..c8e415639 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionJwtUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionJwtUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionJwtUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionJwtUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionJwtUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionJwtUninitialized build() { return new CreateFlowsVaultConnectionJwtUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java index 4e65b5a51..6d9afed3f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimp.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionMailchimp @@ -52,12 +52,12 @@ private boolean equalTo(CreateFlowsVaultConnectionMailchimp other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -87,7 +87,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupSecretApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionMailchimpApiKey build() { return new CreateFlowsVaultConnectionMailchimpApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java index 07fd1ea71..d44c3e771 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpOauthCode.java @@ -56,7 +56,7 @@ public FlowsVaultConnectioSetupOauthCode getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionMailchimpOauthCode @@ -72,12 +72,12 @@ private boolean equalTo(CreateFlowsVaultConnectionMailchimpOauthCode other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionMailchimpOauthCode other) { name(other.getName()); appId(other.getAppId()); @@ -133,28 +133,28 @@ public Builder from(CreateFlowsVaultConnectionMailchimpOauthCode other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionMailchimpOauthCode build() { return new CreateFlowsVaultConnectionMailchimpOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java index 108683c49..a2327303f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailchimpUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionMailchimpUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionMailchimpUninitialized other) return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionMailchimpUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionMailchimpUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionMailchimpUninitialized build() { return new CreateFlowsVaultConnectionMailchimpUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java index 5aff8e46a..194d1a74b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjet.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionMailjet && equalTo((CreateFlowsVaultConnectionMailjet) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionMailjet other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupMailjetApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionMailjetApiKey build() { return new CreateFlowsVaultConnectionMailjetApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java index 8f9e03fdc..052180dcb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionMailjetUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionMailjetUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionMailjetUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionMailjetUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionMailjetUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionMailjetUninitialized build() { return new CreateFlowsVaultConnectionMailjetUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java index a775d69a1..d8e1fc244 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedrive.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionPipedrive @@ -52,12 +52,12 @@ private boolean equalTo(CreateFlowsVaultConnectionPipedrive other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -87,7 +87,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionPipedriveOauthCode build() { return new CreateFlowsVaultConnectionPipedriveOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java index ba63a4db3..cc0130fae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveToken.java @@ -53,7 +53,7 @@ public FlowsVaultConnectioSetupToken getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionPipedriveToken @@ -69,12 +69,12 @@ private boolean equalTo(CreateFlowsVaultConnectionPipedriveToken other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -117,7 +117,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionPipedriveToken other) { name(other.getName()); appId(other.getAppId()); @@ -130,28 +130,28 @@ public Builder from(CreateFlowsVaultConnectionPipedriveToken other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionPipedriveToken build() { return new CreateFlowsVaultConnectionPipedriveToken(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java index fdd36b969..817550471 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionPipedriveUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionPipedriveUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionPipedriveUninitialized other) return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionPipedriveUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionPipedriveUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionPipedriveUninitialized build() { return new CreateFlowsVaultConnectionPipedriveUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java index fceaa4c19..2a5cf7ef9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionRequestContent.java @@ -77,7 +77,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionRequestContent @@ -88,12 +88,12 @@ private boolean equalTo(CreateFlowsVaultConnectionRequestContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -231,7 +231,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public AppIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -335,7 +335,7 @@ public AppIdStage id(@NotNull String id) { *

Flows Vault Connection app identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("app_id") public NameStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); @@ -347,7 +347,7 @@ public NameStage appId(@NotNull String appId) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ReadyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -359,7 +359,7 @@ public ReadyStage name(@NotNull String name) { *

Whether the Flows Vault Connection is configured.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ready") public CreatedAtStage ready(boolean ready) { this.ready = ready; @@ -371,7 +371,7 @@ public CreatedAtStage ready(boolean ready) { *

The ISO 8601 formatted date when this Flows Vault Connection was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -383,14 +383,14 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fingerprint") public _FinalStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -401,7 +401,7 @@ public _FinalStage fingerprint(@NotNull String fingerprint) { *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { this.refreshedAt = Optional.ofNullable(refreshedAt); return this; @@ -410,7 +410,7 @@ public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { /** *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) public _FinalStage refreshedAt(Optional refreshedAt) { this.refreshedAt = refreshedAt; @@ -421,7 +421,7 @@ public _FinalStage refreshedAt(Optional refreshedAt) { *

Flows Vault Connection custom account name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accountName(String accountName) { this.accountName = Optional.ofNullable(accountName); return this; @@ -430,7 +430,7 @@ public _FinalStage accountName(String accountName) { /** *

Flows Vault Connection custom account name.

*/ - @Override + @java.lang.Override @JsonSetter(value = "account_name", nulls = Nulls.SKIP) public _FinalStage accountName(Optional accountName) { this.accountName = accountName; @@ -441,7 +441,7 @@ public _FinalStage accountName(Optional accountName) { *

Flows Vault Connection environment.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage environment(String environment) { this.environment = Optional.ofNullable(environment); return this; @@ -450,14 +450,14 @@ public _FinalStage environment(String environment) { /** *

Flows Vault Connection environment.

*/ - @Override + @java.lang.Override @JsonSetter(value = "environment", nulls = Nulls.SKIP) public _FinalStage environment(Optional environment) { this.environment = environment; return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionResponseContent build() { return new CreateFlowsVaultConnectionResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java index d2467a776..4d6944097 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforce.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSalesforce @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSalesforce other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSalesforceOauthCode build() { return new CreateFlowsVaultConnectionSalesforceOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java index 8ec7b7051..65cbf2ff5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSalesforceUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSalesforceUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSalesforceUninitialized other) return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionSalesforceUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionSalesforceUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSalesforceUninitialized build() { return new CreateFlowsVaultConnectionSalesforceUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java index 18bc27a46..b43c88c1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgrid.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSendgrid @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSendgrid other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSendgridApiKey build() { return new CreateFlowsVaultConnectionSendgridApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java index 163824ebd..181bc2b1c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSendgridUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSendgridUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSendgridUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionSendgridUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionSendgridUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSendgridUninitialized build() { return new CreateFlowsVaultConnectionSendgridUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java index 558bb8335..dc95884d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlack.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSlack && equalTo((CreateFlowsVaultConnectionSlack) other); @@ -51,12 +51,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSlack other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSlackOauthCode build() { return new CreateFlowsVaultConnectionSlackOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java index af5056c40..1debe6835 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSlackUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSlackUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionSlackUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionSlackUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSlackUninitialized build() { return new CreateFlowsVaultConnectionSlackUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java index 08dc1d930..33bdce562 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionSlackWebhook.java @@ -56,7 +56,7 @@ public FlowsVaultConnectioSetupWebhook getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionSlackWebhook @@ -72,12 +72,12 @@ private boolean equalTo(CreateFlowsVaultConnectionSlackWebhook other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionSlackWebhook other) { name(other.getName()); appId(other.getAppId()); @@ -133,28 +133,28 @@ public Builder from(CreateFlowsVaultConnectionSlackWebhook other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionSlackWebhook build() { return new CreateFlowsVaultConnectionSlackWebhook(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java index 372b42ac4..3ee830644 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripe.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionStripe && equalTo((CreateFlowsVaultConnectionStripe) other); @@ -51,12 +51,12 @@ private boolean equalTo(CreateFlowsVaultConnectionStripe other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupStripeKeyPair setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionStripeKeyPair build() { return new CreateFlowsVaultConnectionStripeKeyPair(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java index e45246ad5..d6f34be77 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeOauthCode.java @@ -56,7 +56,7 @@ public FlowsVaultConnectioSetupOauthCode getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionStripeOauthCode @@ -72,12 +72,12 @@ private boolean equalTo(CreateFlowsVaultConnectionStripeOauthCode other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionStripeOauthCode other) { name(other.getName()); appId(other.getAppId()); @@ -133,28 +133,28 @@ public Builder from(CreateFlowsVaultConnectionStripeOauthCode other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupOauthCode setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionStripeOauthCode build() { return new CreateFlowsVaultConnectionStripeOauthCode(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java index 775db4e31..9b002fb17 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionStripeUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionStripeUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionStripeUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionStripeUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionStripeUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionStripeUninitialized build() { return new CreateFlowsVaultConnectionStripeUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java index 481eafd09..25b120da9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegram.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionTelegram @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionTelegram other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionTelegramToken build() { return new CreateFlowsVaultConnectionTelegramToken(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java index b381fd573..78c863be0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTelegramUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionTelegramUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionTelegramUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionTelegramUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionTelegramUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionTelegramUninitialized build() { return new CreateFlowsVaultConnectionTelegramUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java index f1108224b..30aa978a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilio.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionTwilio && equalTo((CreateFlowsVaultConnectionTwilio) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionTwilio other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupTwilioApiKey setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionTwilioApiKey build() { return new CreateFlowsVaultConnectionTwilioApiKey(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java index f4fe65745..36294b2de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionTwilioUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionTwilioUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionTwilioUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionTwilioUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionTwilioUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionTwilioUninitialized build() { return new CreateFlowsVaultConnectionTwilioUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java index 96f9abe9c..0dad15a03 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsapp.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionWhatsapp @@ -50,12 +50,12 @@ private boolean equalTo(CreateFlowsVaultConnectionWhatsapp other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupToken setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionWhatsappToken build() { return new CreateFlowsVaultConnectionWhatsappToken(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java index f08df51af..04cf82b2d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionWhatsappUninitialized.java @@ -45,7 +45,7 @@ public String getAppId() { return appId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionWhatsappUninitialized @@ -61,12 +61,12 @@ private boolean equalTo(CreateFlowsVaultConnectionWhatsappUninitialized other) { return name.equals(other.name) && appId.equals(other.appId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,7 +103,7 @@ public static final class Builder implements NameStage, AppIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionWhatsappUninitialized other) { name(other.getName()); appId(other.getAppId()); @@ -115,21 +115,21 @@ public Builder from(CreateFlowsVaultConnectionWhatsappUninitialized other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionWhatsappUninitialized build() { return new CreateFlowsVaultConnectionWhatsappUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java index b6c9a39b2..9d713daed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapier.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionZapier && equalTo((CreateFlowsVaultConnectionZapier) other); @@ -49,12 +49,12 @@ private boolean equalTo(CreateFlowsVaultConnectionZapier other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializerFlows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public _FinalStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionZapierUninitialized build() { return new CreateFlowsVaultConnectionZapierUninitialized(name, appId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java index 93c67785a..e1364282c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFlowsVaultConnectionZapierWebhook.java @@ -56,7 +56,7 @@ public FlowsVaultConnectioSetupWebhook getSetup() { return setup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFlowsVaultConnectionZapierWebhook @@ -72,12 +72,12 @@ private boolean equalTo(CreateFlowsVaultConnectionZapierWebhook other) { return name.equals(other.name) && appId.equals(other.appId) && setup.equals(other.setup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.appId, this.setup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements NameStage, AppIdStage, SetupStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFlowsVaultConnectionZapierWebhook other) { name(other.getName()); appId(other.getAppId()); @@ -133,28 +133,28 @@ public Builder from(CreateFlowsVaultConnectionZapierWebhook other) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public AppIdStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("app_id") public SetupStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("setup") public _FinalStage setup(@NotNull FlowsVaultConnectioSetupWebhook setup) { this.setup = Objects.requireNonNull(setup, "setup must not be null"); return this; } - @Override + @java.lang.Override public CreateFlowsVaultConnectionZapierWebhook build() { return new CreateFlowsVaultConnectionZapierWebhook(name, appId, setup, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java index cfd6f975d..facd598a5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormRequestContent.java @@ -101,7 +101,7 @@ public Optional getStyle() { return style; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFormRequestContent && equalTo((CreateFormRequestContent) other); @@ -123,7 +123,7 @@ private boolean equalTo(CreateFormRequestContent other) { && style.equals(other.style); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -136,7 +136,7 @@ public int hashCode() { this.style); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -206,7 +206,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFormRequestContent other) { name(other.getName()); messages(other.getMessages()); @@ -219,105 +219,105 @@ public Builder from(CreateFormRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @Override + @java.lang.Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @Override + @java.lang.Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @Override + @java.lang.Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @Override + @java.lang.Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @Override + @java.lang.Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @Override + @java.lang.Override public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @Override + @java.lang.Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @Override + @java.lang.Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @Override + @java.lang.Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @Override + @java.lang.Override public CreateFormRequestContent build() { return new CreateFormRequestContent( name, messages, languages, translations, nodes, start, ending, style, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java index 85baae859..559f31156 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateFormResponseContent.java @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateFormResponseContent && equalTo((CreateFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(CreateFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(CreateFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(CreateFormResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @Override + @java.lang.Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @Override + @java.lang.Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @Override + @java.lang.Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @Override + @java.lang.Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @Override + @java.lang.Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @Override + @java.lang.Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @Override + @java.lang.Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @Override + @java.lang.Override public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @Override + @java.lang.Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @Override + @java.lang.Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @Override + @java.lang.Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @Override + @java.lang.Override public CreateFormResponseContent build() { return new CreateFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java index 8e555eb58..709085672 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateGuardianEnrollmentTicketResponseContent.java @@ -49,7 +49,7 @@ public Optional getTicketUrl() { return ticketUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateGuardianEnrollmentTicketResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(CreateGuardianEnrollmentTicketResponseContent other) { return ticketId.equals(other.ticketId) && ticketUrl.equals(other.ticketUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ticketId, this.ticketUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java index e559b1856..eec5dddb0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookRequestContent.java @@ -82,7 +82,7 @@ public HookTriggerIdEnum getTriggerId() { return triggerId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateHookRequestContent && equalTo((CreateHookRequestContent) other); @@ -101,12 +101,12 @@ private boolean equalTo(CreateHookRequestContent other) { && triggerId.equals(other.triggerId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.script, this.enabled, this.dependencies, this.triggerId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements NameStage, ScriptStage, TriggerIdSt private Builder() {} - @Override + @java.lang.Override public Builder from(CreateHookRequestContent other) { name(other.getName()); script(other.getScript()); @@ -182,7 +182,7 @@ public Builder from(CreateHookRequestContent other) { *

Name of this hook.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ScriptStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -194,27 +194,27 @@ public ScriptStage name(@NotNull String name) { *

Code to be executed when this hook runs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("script") public TriggerIdStage script(@NotNull String script) { this.script = Objects.requireNonNull(script, "script must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("triggerId") public _FinalStage triggerId(@NotNull HookTriggerIdEnum triggerId) { this.triggerId = Objects.requireNonNull(triggerId, "triggerId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage dependencies(Map dependencies) { this.dependencies = Optional.ofNullable(dependencies); return this; } - @Override + @java.lang.Override @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) public _FinalStage dependencies(Optional> dependencies) { this.dependencies = dependencies; @@ -225,7 +225,7 @@ public _FinalStage dependencies(Optional> dependencies) { *

Whether this hook will be executed (true) or ignored (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -234,14 +234,14 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether this hook will be executed (true) or ignored (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public CreateHookRequestContent build() { return new CreateHookRequestContent(name, script, enabled, dependencies, triggerId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java index 2eaeb3137..b269591d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateHookResponseContent.java @@ -96,7 +96,7 @@ public Optional> getDependencies() { return dependencies; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateHookResponseContent && equalTo((CreateHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(CreateHookResponseContent other) { && dependencies.equals(other.dependencies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java index 151b35943..f74fce543 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateImportUsersResponseContent.java @@ -100,7 +100,7 @@ public Optional getExternalId() { return externalId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateImportUsersResponseContent && equalTo((CreateImportUsersResponseContent) other); @@ -120,12 +120,12 @@ private boolean equalTo(CreateImportUsersResponseContent other) { && externalId.equals(other.externalId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.externalId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -202,7 +202,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateImportUsersResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -218,7 +218,7 @@ public Builder from(CreateImportUsersResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -230,7 +230,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("type") public CreatedAtStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -242,7 +242,7 @@ public CreatedAtStage type(@NotNull String type) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public IdStage createdAt(@NotNull String createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -254,7 +254,7 @@ public IdStage createdAt(@NotNull String createdAt) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public ConnectionIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -266,7 +266,7 @@ public ConnectionIdStage id(@NotNull String id) { *

connection_id of the connection to which users will be imported.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -277,7 +277,7 @@ public _FinalStage connectionId(@NotNull String connectionId) { *

Customer-defined ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage externalId(String externalId) { this.externalId = Optional.ofNullable(externalId); return this; @@ -286,14 +286,14 @@ public _FinalStage externalId(String externalId) { /** *

Customer-defined ID.

*/ - @Override + @java.lang.Override @JsonSetter(value = "external_id", nulls = Nulls.SKIP) public _FinalStage externalId(Optional externalId) { this.externalId = externalId; return this; } - @Override + @java.lang.Override public CreateImportUsersResponseContent build() { return new CreateImportUsersResponseContent( status, type, createdAt, id, connectionId, externalId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java index 85b1857cc..5beac4614 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamDatadogRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamDatadogRequestBody && equalTo((CreateLogStreamDatadogRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamDatadogRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamDatadogRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamDatadogRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamDatadogSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamDatadogSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamDatadogRequestBody build() { return new CreateLogStreamDatadogRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java index 041e86e81..e291a4bd1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventBridgeRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamEventBridgeRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamEventBridgeRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamEventBridgeRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamEventBridgeRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamEventBridgeSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamEventBridgeSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamEventBridgeRequestBody build() { return new CreateLogStreamEventBridgeRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java index ce09a7301..d71fc53eb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamEventGridRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamEventGridRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamEventGridRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamEventGridRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamEventGridRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamEventGridSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamEventGridSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamEventGridRequestBody build() { return new CreateLogStreamEventGridRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java index 2de4abd99..55eb0e982 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamHttpRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamHttpRequestBody && equalTo((CreateLogStreamHttpRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamHttpRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamHttpRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamHttpRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamHttpSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamHttpSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamHttpRequestBody build() { return new CreateLogStreamHttpRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java index fa688a5d3..03713fb22 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamMixpanelRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamMixpanelRequestBody @@ -126,13 +126,13 @@ private boolean equalTo(CreateLogStreamMixpanelRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamMixpanelRequestBody other) { name(other.getName()); type(other.getType()); @@ -220,14 +220,14 @@ public Builder from(CreateLogStreamMixpanelRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamMixpanelSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -238,7 +238,7 @@ public _FinalStage sink(@NotNull LogStreamMixpanelSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -247,20 +247,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -271,7 +271,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -280,7 +280,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -291,7 +291,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -300,7 +300,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -311,7 +311,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -320,14 +320,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamMixpanelRequestBody build() { return new CreateLogStreamMixpanelRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java index 6839422e1..00e507c5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamRequestContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamRequestContent && equalTo((CreateLogStreamRequestContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(CreateLogStreamRequestContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamResponseContent && equalTo((CreateLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(CreateLogStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSegmentRequestBody && equalTo((CreateLogStreamSegmentRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSegmentRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamSegmentRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSegmentRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSegmentSinkWriteKey sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamSegmentRequestBody build() { return new CreateLogStreamSegmentRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java index 132068841..e43f99ad0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSplunkRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSplunkRequestBody && equalTo((CreateLogStreamSplunkRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSplunkRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamSplunkRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSplunkRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSplunkSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSplunkSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamSplunkRequestBody build() { return new CreateLogStreamSplunkRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java index 10d74d864..a6bcc06a3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateLogStreamSumoRequestBody.java @@ -104,7 +104,7 @@ public Optional getStartFrom() { return startFrom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateLogStreamSumoRequestBody && equalTo((CreateLogStreamSumoRequestBody) other); @@ -125,13 +125,13 @@ private boolean equalTo(CreateLogStreamSumoRequestBody other) { && startFrom.equals(other.startFrom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.isPriority, this.filters, this.piiConfig, this.sink, this.startFrom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements TypeStage, SinkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateLogStreamSumoRequestBody other) { name(other.getName()); type(other.getType()); @@ -219,14 +219,14 @@ public Builder from(CreateLogStreamSumoRequestBody other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public SinkStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sink") public _FinalStage sink(@NotNull LogStreamSumoSink sink) { this.sink = Objects.requireNonNull(sink, "sink must not be null"); @@ -237,7 +237,7 @@ public _FinalStage sink(@NotNull LogStreamSumoSink sink) { *

The optional datetime (ISO 8601) to start streaming logs from

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startFrom(String startFrom) { this.startFrom = Optional.ofNullable(startFrom); return this; @@ -246,20 +246,20 @@ public _FinalStage startFrom(String startFrom) { /** *

The optional datetime (ISO 8601) to start streaming logs from

*/ - @Override + @java.lang.Override @JsonSetter(value = "startFrom", nulls = Nulls.SKIP) public _FinalStage startFrom(Optional startFrom) { this.startFrom = startFrom; return this; } - @Override + @java.lang.Override public _FinalStage piiConfig(LogStreamPiiConfig piiConfig) { this.piiConfig = Optional.ofNullable(piiConfig); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pii_config", nulls = Nulls.SKIP) public _FinalStage piiConfig(Optional piiConfig) { this.piiConfig = piiConfig; @@ -270,7 +270,7 @@ public _FinalStage piiConfig(Optional piiConfig) { *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage filters(List filters) { this.filters = Optional.ofNullable(filters); return this; @@ -279,7 +279,7 @@ public _FinalStage filters(List filters) { /** *

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

*/ - @Override + @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) public _FinalStage filters(Optional> filters) { this.filters = filters; @@ -290,7 +290,7 @@ public _FinalStage filters(Optional> filters) { *

True for priority log streams, false for non-priority

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isPriority(Boolean isPriority) { this.isPriority = Optional.ofNullable(isPriority); return this; @@ -299,7 +299,7 @@ public _FinalStage isPriority(Boolean isPriority) { /** *

True for priority log streams, false for non-priority

*/ - @Override + @java.lang.Override @JsonSetter(value = "isPriority", nulls = Nulls.SKIP) public _FinalStage isPriority(Optional isPriority) { this.isPriority = isPriority; @@ -310,7 +310,7 @@ public _FinalStage isPriority(Optional isPriority) { *

log stream name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -319,14 +319,14 @@ public _FinalStage name(String name) { /** *

log stream name

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateLogStreamSumoRequestBody build() { return new CreateLogStreamSumoRequestBody( name, type, isPriority, filters, piiConfig, sink, startFrom, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java index af2fbcdac..992ec4de3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateNetworkAclRequestContent.java @@ -68,7 +68,7 @@ public NetworkAclRule getRule() { return rule; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateNetworkAclRequestContent && equalTo((CreateNetworkAclRequestContent) other); @@ -86,12 +86,12 @@ private boolean equalTo(CreateNetworkAclRequestContent other) { && rule.equals(other.rule); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements DescriptionStage, ActiveStage, Prio private Builder() {} - @Override + @java.lang.Override public Builder from(CreateNetworkAclRequestContent other) { description(other.getDescription()); active(other.getActive()); @@ -152,7 +152,7 @@ public Builder from(CreateNetworkAclRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("description") public ActiveStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -164,7 +164,7 @@ public ActiveStage description(@NotNull String description) { *

Indicates whether or not this access control list is actively being used

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("active") public PriorityStage active(boolean active) { this.active = active; @@ -176,21 +176,21 @@ public PriorityStage active(boolean active) { *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("priority") public RuleStage priority(double priority) { this.priority = priority; return this; } - @Override + @java.lang.Override @JsonSetter("rule") public _FinalStage rule(@NotNull NetworkAclRule rule) { this.rule = Objects.requireNonNull(rule, "rule must not be null"); return this; } - @Override + @java.lang.Override public CreateNetworkAclRequestContent build() { return new CreateNetworkAclRequestContent(description, active, priority, rule, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java index b24af3292..fa5437e41 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationDiscoveryDomainResponseContent.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,6 +27,8 @@ public final class CreateOrganizationDiscoveryDomainResponseContent { private final OrganizationDiscoveryDomainStatus status; + private final Optional useForOrganizationDiscovery; + private final String verificationTxt; private final String verificationHost; @@ -35,12 +39,14 @@ private CreateOrganizationDiscoveryDomainResponseContent( String id, String domain, OrganizationDiscoveryDomainStatus status, + Optional useForOrganizationDiscovery, String verificationTxt, String verificationHost, Map additionalProperties) { this.id = id; this.domain = domain; this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.verificationTxt = verificationTxt; this.verificationHost = verificationHost; this.additionalProperties = additionalProperties; @@ -67,6 +73,14 @@ public OrganizationDiscoveryDomainStatus getStatus() { return status; } + /** + * @return Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + /** * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. */ @@ -83,7 +97,7 @@ public String getVerificationHost() { return verificationHost; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationDiscoveryDomainResponseContent @@ -99,16 +113,23 @@ private boolean equalTo(CreateOrganizationDiscoveryDomainResponseContent other) return id.equals(other.id) && domain.equals(other.domain) && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) && verificationTxt.equals(other.verificationTxt) && verificationHost.equals(other.verificationHost); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + return Objects.hash( + this.id, + this.domain, + this.status, + this.useForOrganizationDiscovery, + this.verificationTxt, + this.verificationHost); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,6 +174,13 @@ public interface VerificationHostStage { public interface _FinalStage { CreateOrganizationDiscoveryDomainResponseContent build(); + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -168,16 +196,19 @@ public static final class Builder private String verificationHost; + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(CreateOrganizationDiscoveryDomainResponseContent other) { id(other.getId()); domain(other.getDomain()); status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); verificationTxt(other.getVerificationTxt()); verificationHost(other.getVerificationHost()); return this; @@ -188,7 +219,7 @@ public Builder from(CreateOrganizationDiscoveryDomainResponseContent other) { *

Organization discovery domain identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public DomainStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -200,14 +231,14 @@ public DomainStage id(@NotNull String id) { *

The domain name to associate with the organization e.g. acme.com.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public StatusStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -219,7 +250,7 @@ public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus st *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_txt") public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); @@ -231,17 +262,43 @@ public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { *

The full domain where the TXT record should be added.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_host") public _FinalStage verificationHost(@NotNull String verificationHost) { this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); return this; } - @Override + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override public CreateOrganizationDiscoveryDomainResponseContent build() { return new CreateOrganizationDiscoveryDomainResponseContent( - id, domain, status, verificationTxt, verificationHost, additionalProperties); + id, + domain, + status, + useForOrganizationDiscovery, + verificationTxt, + verificationHost, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java index 78982b342..1c4ca998c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationInvitationResponseContent.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationInvitationResponseContent @@ -201,7 +201,7 @@ private boolean equalTo(CreateOrganizationInvitationResponseContent other) { && ticketId.equals(other.ticketId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -219,7 +219,7 @@ public int hashCode() { this.ticketId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java index 99386e5a7..21128edeb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationRequestContent.java @@ -93,7 +93,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationRequestContent && equalTo((CreateOrganizationRequestContent) other); @@ -113,13 +113,13 @@ private boolean equalTo(CreateOrganizationRequestContent other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.displayName, this.branding, this.metadata, this.enabledConnections, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -186,7 +186,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateOrganizationRequestContent other) { name(other.getName()); displayName(other.getDisplayName()); @@ -202,20 +202,20 @@ public Builder from(CreateOrganizationRequestContent other) { *

The name of this organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage tokenQuota(CreateTokenQuota tokenQuota) { this.tokenQuota = Optional.ofNullable(tokenQuota); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) public _FinalStage tokenQuota(Optional tokenQuota) { this.tokenQuota = tokenQuota; @@ -226,7 +226,7 @@ public _FinalStage tokenQuota(Optional tokenQuota) { *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabledConnections(List enabledConnections) { this.enabledConnections = Optional.ofNullable(enabledConnections); return this; @@ -235,33 +235,33 @@ public _FinalStage enabledConnections(List enabledCon /** *

Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled_connections", nulls = Nulls.SKIP) public _FinalStage enabledConnections(Optional> enabledConnections) { this.enabledConnections = enabledConnections; return this; } - @Override + @java.lang.Override public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; return this; } - @Override + @java.lang.Override public _FinalStage branding(OrganizationBranding branding) { this.branding = Optional.ofNullable(branding); return this; } - @Override + @java.lang.Override @JsonSetter(value = "branding", nulls = Nulls.SKIP) public _FinalStage branding(Optional branding) { this.branding = branding; @@ -272,7 +272,7 @@ public _FinalStage branding(Optional branding) { *

Friendly name of this organization.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -281,14 +281,14 @@ public _FinalStage displayName(String displayName) { /** *

Friendly name of this organization.

*/ - @Override + @java.lang.Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public CreateOrganizationRequestContent build() { return new CreateOrganizationRequestContent( name, displayName, branding, metadata, enabledConnections, tokenQuota, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java index 2c0099f1d..30aaaa64f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationResponseContent.java @@ -101,7 +101,7 @@ public Optional> getEnabledConnections() { return enabledConnections; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateOrganizationResponseContent && equalTo((CreateOrganizationResponseContent) other); @@ -122,7 +122,7 @@ private boolean equalTo(CreateOrganizationResponseContent other) { && enabledConnections.equals(other.enabledConnections); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -134,7 +134,7 @@ public int hashCode() { this.enabledConnections); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java index 84bc00bc0..0f46dfd8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneProviderSendTestResponseContent.java @@ -49,7 +49,7 @@ public Optional getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneProviderSendTestResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(CreatePhoneProviderSendTestResponseContent other) { return code.equals(other.code) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.code, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java index eaf966dd8..ae6277c28 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateResponseContent @@ -116,13 +116,13 @@ private boolean equalTo(CreatePhoneTemplateResponseContent other) { && disabled == other.disabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -201,21 +201,21 @@ public Builder from(CreatePhoneTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -227,53 +227,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @Override + @java.lang.Override public CreatePhoneTemplateResponseContent build() { return new CreatePhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java index 560117ee5..217c9314f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePhoneTemplateTestNotificationResponseContent.java @@ -34,7 +34,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePhoneTemplateTestNotificationResponseContent @@ -50,12 +50,12 @@ private boolean equalTo(CreatePhoneTemplateTestNotificationResponseContent other return message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -83,20 +83,20 @@ public static final class Builder implements MessageStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePhoneTemplateTestNotificationResponseContent other) { message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @Override + @java.lang.Override public CreatePhoneTemplateTestNotificationResponseContent build() { return new CreatePhoneTemplateTestNotificationResponseContent(message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java index 53bc7698c..5d223913e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialRequestContent.java @@ -85,7 +85,7 @@ public Optional getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePublicKeyDeviceCredentialRequestContent @@ -105,12 +105,12 @@ private boolean equalTo(CreatePublicKeyDeviceCredentialRequestContent other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceName, this.type, this.value, this.deviceId, this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -174,7 +174,7 @@ public static final class Builder implements DeviceNameStage, TypeStage, ValueSt private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePublicKeyDeviceCredentialRequestContent other) { deviceName(other.getDeviceName()); type(other.getType()); @@ -189,14 +189,14 @@ public Builder from(CreatePublicKeyDeviceCredentialRequestContent other) { *

Name for this device easily recognized by owner.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("device_name") public TypeStage deviceName(@NotNull String deviceName) { this.deviceName = Objects.requireNonNull(deviceName, "deviceName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -208,7 +208,7 @@ public ValueStage type(@NotNull String type) { *

Base64 encoded string containing the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("value") public DeviceIdStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); @@ -220,7 +220,7 @@ public DeviceIdStage value(@NotNull String value) { *

Unique identifier for the device. Recommend using <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID">Android_ID</a> on Android and <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor">identifierForVendor</a>.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(@NotNull String deviceId) { this.deviceId = Objects.requireNonNull(deviceId, "deviceId must not be null"); @@ -231,7 +231,7 @@ public _FinalStage deviceId(@NotNull String deviceId) { *

client_id of the client (application) this credential is for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -240,14 +240,14 @@ public _FinalStage clientId(String clientId) { /** *

client_id of the client (application) this credential is for.

*/ - @Override + @java.lang.Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; return this; } - @Override + @java.lang.Override public CreatePublicKeyDeviceCredentialRequestContent build() { return new CreatePublicKeyDeviceCredentialRequestContent( deviceName, type, value, deviceId, clientId, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java index bb32c74a8..7287d4940 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatePublicKeyDeviceCredentialResponseContent.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreatePublicKeyDeviceCredentialResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(CreatePublicKeyDeviceCredentialResponseContent other) { return id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreatePublicKeyDeviceCredentialResponseContent other) { id(other.getId()); return this; @@ -99,14 +99,14 @@ public Builder from(CreatePublicKeyDeviceCredentialResponseContent other) { *

The credential's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public CreatePublicKeyDeviceCredentialResponseContent build() { return new CreatePublicKeyDeviceCredentialResponseContent(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java index 107e6465a..75598a208 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java @@ -221,7 +221,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateResourceServerRequestContent @@ -251,7 +251,7 @@ private boolean equalTo(CreateResourceServerRequestContent other) { && subjectTypeAuthorization.equals(other.subjectTypeAuthorization); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -271,7 +271,7 @@ public int hashCode() { this.subjectTypeAuthorization); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -421,7 +421,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateResourceServerRequestContent other) { name(other.getName()); identifier(other.getIdentifier()); @@ -446,20 +446,20 @@ public Builder from(CreateResourceServerRequestContent other) { *

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) public _FinalStage subjectTypeAuthorization( Optional subjectTypeAuthorization) { @@ -467,7 +467,7 @@ public _FinalStage subjectTypeAuthorization( return this; } - @Override + @java.lang.Override public _FinalStage proofOfPossession( com.auth0.client.mgmt.core.Nullable proofOfPossession) { if (proofOfPossession.isNull()) { @@ -480,7 +480,7 @@ public _FinalStage proofOfPossession( return this; } - @Override + @java.lang.Override public _FinalStage proofOfPossession(Optional proofOfPossession) { if (proofOfPossession.isPresent()) { this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); @@ -490,13 +490,13 @@ public _FinalStage proofOfPossession(Optional p return this; } - @Override + @java.lang.Override public _FinalStage proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { this.proofOfPossession = OptionalNullable.of(proofOfPossession); return this; } - @Override + @java.lang.Override @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) public _FinalStage proofOfPossession( @Nullable OptionalNullable proofOfPossession) { @@ -504,20 +504,20 @@ public _FinalStage proofOfPossession( return this; } - @Override + @java.lang.Override public _FinalStage authorizationDetails(List authorizationDetails) { this.authorizationDetails = Optional.ofNullable(authorizationDetails); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) public _FinalStage authorizationDetails(Optional> authorizationDetails) { this.authorizationDetails = authorizationDetails; return this; } - @Override + @java.lang.Override public _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable consentPolicy) { if (consentPolicy.isNull()) { this.consentPolicy = OptionalNullable.ofNull(); @@ -529,7 +529,7 @@ public _FinalStage consentPolicy(com.auth0.client.mgmt.core.Nullable con return this; } - @Override + @java.lang.Override public _FinalStage consentPolicy(Optional consentPolicy) { if (consentPolicy.isPresent()) { this.consentPolicy = OptionalNullable.of(consentPolicy.get()); @@ -539,20 +539,20 @@ public _FinalStage consentPolicy(Optional consentPolicy) { return this; } - @Override + @java.lang.Override public _FinalStage consentPolicy(String consentPolicy) { this.consentPolicy = OptionalNullable.of(consentPolicy); return this; } - @Override + @java.lang.Override @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) public _FinalStage consentPolicy(@Nullable OptionalNullable consentPolicy) { this.consentPolicy = consentPolicy; return this; } - @Override + @java.lang.Override public _FinalStage tokenEncryption( com.auth0.client.mgmt.core.Nullable tokenEncryption) { if (tokenEncryption.isNull()) { @@ -565,7 +565,7 @@ public _FinalStage tokenEncryption( return this; } - @Override + @java.lang.Override public _FinalStage tokenEncryption(Optional tokenEncryption) { if (tokenEncryption.isPresent()) { this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); @@ -575,13 +575,13 @@ public _FinalStage tokenEncryption(Optional token return this; } - @Override + @java.lang.Override public _FinalStage tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { this.tokenEncryption = OptionalNullable.of(tokenEncryption); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) public _FinalStage tokenEncryption(@Nullable OptionalNullable tokenEncryption) { this.tokenEncryption = tokenEncryption; @@ -592,7 +592,7 @@ public _FinalStage tokenEncryption(@Nullable OptionalNullableWhether to enforce authorization policies (true) or to ignore them (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enforcePolicies(Boolean enforcePolicies) { this.enforcePolicies = Optional.ofNullable(enforcePolicies); return this; @@ -601,7 +601,7 @@ public _FinalStage enforcePolicies(Boolean enforcePolicies) { /** *

Whether to enforce authorization policies (true) or to ignore them (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enforce_policies", nulls = Nulls.SKIP) public _FinalStage enforcePolicies(Optional enforcePolicies) { this.enforcePolicies = enforcePolicies; @@ -612,7 +612,7 @@ public _FinalStage enforcePolicies(Optional enforcePolicies) { *

Whether to skip user consent for applications flagged as first party (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage skipConsentForVerifiableFirstPartyClients( Boolean skipConsentForVerifiableFirstPartyClients) { this.skipConsentForVerifiableFirstPartyClients = @@ -623,7 +623,7 @@ public _FinalStage skipConsentForVerifiableFirstPartyClients( /** *

Whether to skip user consent for applications flagged as first party (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "skip_consent_for_verifiable_first_party_clients", nulls = Nulls.SKIP) public _FinalStage skipConsentForVerifiableFirstPartyClients( Optional skipConsentForVerifiableFirstPartyClients) { @@ -631,13 +631,13 @@ public _FinalStage skipConsentForVerifiableFirstPartyClients( return this; } - @Override + @java.lang.Override public _FinalStage tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect) { this.tokenDialect = Optional.ofNullable(tokenDialect); return this; } - @Override + @java.lang.Override @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public _FinalStage tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -648,7 +648,7 @@ public _FinalStage tokenDialect(Optional t *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tokenLifetime(Integer tokenLifetime) { this.tokenLifetime = Optional.ofNullable(tokenLifetime); return this; @@ -657,7 +657,7 @@ public _FinalStage tokenLifetime(Integer tokenLifetime) { /** *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

*/ - @Override + @java.lang.Override @JsonSetter(value = "token_lifetime", nulls = Nulls.SKIP) public _FinalStage tokenLifetime(Optional tokenLifetime) { this.tokenLifetime = tokenLifetime; @@ -668,7 +668,7 @@ public _FinalStage tokenLifetime(Optional tokenLifetime) { *

Whether refresh tokens can be issued for this API (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowOfflineAccess(Boolean allowOfflineAccess) { this.allowOfflineAccess = Optional.ofNullable(allowOfflineAccess); return this; @@ -677,7 +677,7 @@ public _FinalStage allowOfflineAccess(Boolean allowOfflineAccess) { /** *

Whether refresh tokens can be issued for this API (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "allow_offline_access", nulls = Nulls.SKIP) public _FinalStage allowOfflineAccess(Optional allowOfflineAccess) { this.allowOfflineAccess = allowOfflineAccess; @@ -688,7 +688,7 @@ public _FinalStage allowOfflineAccess(Optional allowOfflineAccess) { *

Secret used to sign tokens when using symmetric algorithms (HS256).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage signingSecret(String signingSecret) { this.signingSecret = Optional.ofNullable(signingSecret); return this; @@ -697,20 +697,20 @@ public _FinalStage signingSecret(String signingSecret) { /** *

Secret used to sign tokens when using symmetric algorithms (HS256).

*/ - @Override + @java.lang.Override @JsonSetter(value = "signing_secret", nulls = Nulls.SKIP) public _FinalStage signingSecret(Optional signingSecret) { this.signingSecret = signingSecret; return this; } - @Override + @java.lang.Override public _FinalStage signingAlg(SigningAlgorithmEnum signingAlg) { this.signingAlg = Optional.ofNullable(signingAlg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) public _FinalStage signingAlg(Optional signingAlg) { this.signingAlg = signingAlg; @@ -721,7 +721,7 @@ public _FinalStage signingAlg(Optional signingAlg) { *

List of permissions (scopes) that this API uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage scopes(List scopes) { this.scopes = Optional.ofNullable(scopes); return this; @@ -730,7 +730,7 @@ public _FinalStage scopes(List scopes) { /** *

List of permissions (scopes) that this API uses.

*/ - @Override + @java.lang.Override @JsonSetter(value = "scopes", nulls = Nulls.SKIP) public _FinalStage scopes(Optional> scopes) { this.scopes = scopes; @@ -741,7 +741,7 @@ public _FinalStage scopes(Optional> scopes) { *

Friendly name for this resource server. Can not contain < or > characters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -750,14 +750,14 @@ public _FinalStage name(String name) { /** *

Friendly name for this resource server. Can not contain < or > characters.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateResourceServerRequestContent build() { return new CreateResourceServerRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java index 6ebcf1935..46cc907c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java @@ -268,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateResourceServerResponseContent @@ -302,7 +302,7 @@ private boolean equalTo(CreateResourceServerResponseContent other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -326,7 +326,7 @@ public int hashCode() { this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java index e63898680..3af2f35e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleRequestContent.java @@ -50,7 +50,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRoleRequestContent && equalTo((CreateRoleRequestContent) other); @@ -65,12 +65,12 @@ private boolean equalTo(CreateRoleRequestContent other) { return name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateRoleRequestContent other) { name(other.getName()); description(other.getDescription()); @@ -122,7 +122,7 @@ public Builder from(CreateRoleRequestContent other) { *

Name of the role.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -133,7 +133,7 @@ public _FinalStage name(@NotNull String name) { *

Description of the role.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -142,14 +142,14 @@ public _FinalStage description(String description) { /** *

Description of the role.

*/ - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public CreateRoleRequestContent build() { return new CreateRoleRequestContent(name, description, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java index da7da3fd4..63cb8d6cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRoleResponseContent && equalTo((CreateRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(CreateRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java index 3c7d920c4..7726d91f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleRequestContent.java @@ -76,7 +76,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRuleRequestContent && equalTo((CreateRuleRequestContent) other); @@ -94,12 +94,12 @@ private boolean equalTo(CreateRuleRequestContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.script, this.order, this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -157,7 +157,7 @@ public static final class Builder implements NameStage, ScriptStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateRuleRequestContent other) { name(other.getName()); script(other.getScript()); @@ -171,7 +171,7 @@ public Builder from(CreateRuleRequestContent other) { *

Name of this rule.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ScriptStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -183,7 +183,7 @@ public ScriptStage name(@NotNull String name) { *

Code to be executed when this rule runs.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("script") public _FinalStage script(@NotNull String script) { this.script = Objects.requireNonNull(script, "script must not be null"); @@ -194,7 +194,7 @@ public _FinalStage script(@NotNull String script) { *

Whether the rule is enabled (true), or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; @@ -203,7 +203,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the rule is enabled (true), or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(Optional enabled) { this.enabled = enabled; @@ -214,7 +214,7 @@ public _FinalStage enabled(Optional enabled) { *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage order(Double order) { this.order = Optional.ofNullable(order); return this; @@ -223,14 +223,14 @@ public _FinalStage order(Double order) { /** *

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

*/ - @Override + @java.lang.Override @JsonSetter(value = "order", nulls = Nulls.SKIP) public _FinalStage order(Optional order) { this.order = order; return this; } - @Override + @java.lang.Override public CreateRuleRequestContent build() { return new CreateRuleRequestContent(name, script, order, enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java index bbb0541af..5b3dc4157 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateRuleResponseContent && equalTo((CreateRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(CreateRuleResponseContent other) { && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java index 3d189dcc8..bc9639641 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationRequestContent.java @@ -52,7 +52,7 @@ public Optional> getMapping() { return mapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimConfigurationRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(CreateScimConfigurationRequestContent other) { return userIdAttribute.equals(other.userIdAttribute) && mapping.equals(other.mapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userIdAttribute, this.mapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java index ba6430022..d9e4761b9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(CreateScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java index 3a0cbb914..8eaff6e57 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateScimTokenResponseContent.java @@ -88,7 +88,7 @@ public Optional getValidUntil() { return validUntil; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateScimTokenResponseContent && equalTo((CreateScimTokenResponseContent) other); @@ -107,12 +107,12 @@ private boolean equalTo(CreateScimTokenResponseContent other) { && validUntil.equals(other.validUntil); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tokenId, this.token, this.scopes, this.createdAt, this.validUntil); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java index 8d2163cc7..565c957f7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileRequestContent.java @@ -98,7 +98,7 @@ public Optional getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileRequestContent @@ -119,7 +119,7 @@ private boolean equalTo(CreateSelfServiceProfileRequestContent other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -130,7 +130,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -203,7 +203,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateSelfServiceProfileRequestContent other) { name(other.getName()); description(other.getDescription()); @@ -219,7 +219,7 @@ public Builder from(CreateSelfServiceProfileRequestContent other) { *

The name of the self-service Profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -230,7 +230,7 @@ public _FinalStage name(@NotNull String name) { *

ID of the user-attribute-profile to associate with this self-service profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage userAttributeProfileId(String userAttributeProfileId) { this.userAttributeProfileId = Optional.ofNullable(userAttributeProfileId); return this; @@ -239,7 +239,7 @@ public _FinalStage userAttributeProfileId(String userAttributeProfileId) { /** *

ID of the user-attribute-profile to associate with this self-service profile.

*/ - @Override + @java.lang.Override @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) public _FinalStage userAttributeProfileId(Optional userAttributeProfileId) { this.userAttributeProfileId = userAttributeProfileId; @@ -250,7 +250,7 @@ public _FinalStage userAttributeProfileId(Optional userAttributeProfileI *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage userAttributes(List userAttributes) { this.userAttributes = Optional.ofNullable(userAttributes); return this; @@ -259,7 +259,7 @@ public _FinalStage userAttributes(List userAttr /** *

List of attributes to be mapped that will be shown to the user during the SS-SSO flow.

*/ - @Override + @java.lang.Override @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) public _FinalStage userAttributes(Optional> userAttributes) { this.userAttributes = userAttributes; @@ -270,7 +270,7 @@ public _FinalStage userAttributes(Optional *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage allowedStrategies(List allowedStrategies) { this.allowedStrategies = Optional.ofNullable(allowedStrategies); return this; @@ -279,20 +279,20 @@ public _FinalStage allowedStrategies(List /** *

List of IdP strategies that will be shown to users during the Self-Service SSO flow. Possible values: [oidc, samlp, waad, google-apps, adfs, okta, keycloak-samlp, pingfederate]

*/ - @Override + @java.lang.Override @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) public _FinalStage allowedStrategies(Optional> allowedStrategies) { this.allowedStrategies = allowedStrategies; return this; } - @Override + @java.lang.Override public _FinalStage branding(SelfServiceProfileBrandingProperties branding) { this.branding = Optional.ofNullable(branding); return this; } - @Override + @java.lang.Override @JsonSetter(value = "branding", nulls = Nulls.SKIP) public _FinalStage branding(Optional branding) { this.branding = branding; @@ -303,7 +303,7 @@ public _FinalStage branding(Optional brand *

The description of the self-service Profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -312,14 +312,14 @@ public _FinalStage description(String description) { /** *

The description of the self-service Profile.

*/ - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public CreateSelfServiceProfileRequestContent build() { return new CreateSelfServiceProfileRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java index 770c44224..970cdd8e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileResponseContent.java @@ -134,7 +134,7 @@ public Optional getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileResponseContent @@ -158,7 +158,7 @@ private boolean equalTo(CreateSelfServiceProfileResponseContent other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -172,7 +172,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java index 6dca7f4d0..3258ba8b2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateSelfServiceProfileSsoTicketResponseContent.java @@ -38,7 +38,7 @@ public Optional getTicket() { return ticket; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateSelfServiceProfileSsoTicketResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(CreateSelfServiceProfileSsoTicketResponseContent other) return ticket.equals(other.ticket); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ticket); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java index 84adfdb18..cecd7729b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileRequestContent.java @@ -71,7 +71,7 @@ public String getType() { return type; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenExchangeProfileRequestContent @@ -90,12 +90,12 @@ private boolean equalTo(CreateTokenExchangeProfileRequestContent other) { && type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subjectTokenType, this.actionId, this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -151,7 +151,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateTokenExchangeProfileRequestContent other) { name(other.getName()); subjectTokenType(other.getSubjectTokenType()); @@ -165,7 +165,7 @@ public Builder from(CreateTokenExchangeProfileRequestContent other) { *

Friendly name of this profile.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public SubjectTokenTypeStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -177,7 +177,7 @@ public SubjectTokenTypeStage name(@NotNull String name) { *

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("subject_token_type") public ActionIdStage subjectTokenType(@NotNull String subjectTokenType) { this.subjectTokenType = Objects.requireNonNull(subjectTokenType, "subjectTokenType must not be null"); @@ -189,21 +189,21 @@ public ActionIdStage subjectTokenType(@NotNull String subjectTokenType) { *

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("action_id") public TypeStage actionId(@NotNull String actionId) { this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public CreateTokenExchangeProfileRequestContent build() { return new CreateTokenExchangeProfileRequestContent( name, subjectTokenType, actionId, type, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java index 98321f853..5f3fd2c6c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(CreateTokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java index bf37407d7..6e97155ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateTokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateTokenQuota && equalTo((CreateTokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(CreateTokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(CreateTokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @Override + @java.lang.Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @Override + @java.lang.Override public CreateTokenQuota build() { return new CreateTokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java index 464cd31e4..8f884ed88 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileRequestContent.java @@ -56,7 +56,7 @@ public Map getUse return userAttributes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserAttributeProfileRequestContent @@ -72,12 +72,12 @@ private boolean equalTo(CreateUserAttributeProfileRequestContent other) { return name.equals(other.name) && userId.equals(other.userId) && userAttributes.equals(other.userAttributes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.userId, this.userAttributes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -121,7 +121,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateUserAttributeProfileRequestContent other) { name(other.getName()); userId(other.getUserId()); @@ -129,20 +129,20 @@ public Builder from(CreateUserAttributeProfileRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage userAttributes(String key, UserAttributeProfileUserAttributeAdditionalProperties value) { this.userAttributes.put(key, value); return this; } - @Override + @java.lang.Override public _FinalStage putAllUserAttributes( Map userAttributes) { if (userAttributes != null) { @@ -151,7 +151,7 @@ public _FinalStage putAllUserAttributes( return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_attributes", nulls = Nulls.SKIP) public _FinalStage userAttributes( Map userAttributes) { @@ -162,20 +162,20 @@ public _FinalStage userAttributes( return this; } - @Override + @java.lang.Override public _FinalStage userId(UserAttributeProfileUserId userId) { this.userId = Optional.ofNullable(userId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_id", nulls = Nulls.SKIP) public _FinalStage userId(Optional userId) { this.userId = userId; return this; } - @Override + @java.lang.Override public CreateUserAttributeProfileRequestContent build() { return new CreateUserAttributeProfileRequestContent(name, userId, userAttributes, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java index 85eef4b0a..2f7a2701e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserAttributeProfileResponseContent.java @@ -63,7 +63,7 @@ public Optional getCreatedAt() { return createdAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserAuthenticationMethodResponseContent @@ -205,7 +205,7 @@ private boolean equalTo(CreateUserAuthenticationMethodResponseContent other) { && createdAt.equals(other.createdAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -223,7 +223,7 @@ public int hashCode() { this.createdAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -354,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -372,7 +372,7 @@ public Builder from(CreateUserAuthenticationMethodResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -383,7 +383,7 @@ public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -392,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -403,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authenticators only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -412,7 +412,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -423,7 +423,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage aaguid(String aaguid) { this.aaguid = Optional.ofNullable(aaguid); return this; @@ -432,7 +432,7 @@ public _FinalStage aaguid(String aaguid) { /** *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) public _FinalStage aaguid(Optional aaguid) { this.aaguid = aaguid; @@ -443,7 +443,7 @@ public _FinalStage aaguid(Optional aaguid) { *

Applies to webauthn authenticators only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -452,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authenticators only. The public key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -463,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authenticators only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -472,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authenticators only. The id of the credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -494,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -512,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -521,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -532,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -541,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -552,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -561,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @Override + @java.lang.Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -572,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -581,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -592,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -601,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public CreateUserAuthenticationMethodResponseContent build() { return new CreateUserAuthenticationMethodResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java index 490777f95..fa39b1afa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserRequestContent.java @@ -226,7 +226,7 @@ public Optional getUsername() { return username; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserRequestContent && equalTo((CreateUserRequestContent) other); @@ -257,7 +257,7 @@ private boolean equalTo(CreateUserRequestContent other) { && username.equals(other.username); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.email, @@ -279,7 +279,7 @@ public int hashCode() { this.username); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -448,7 +448,7 @@ public static final class Builder implements ConnectionStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateUserRequestContent other) { email(other.getEmail()); phoneNumber(other.getPhoneNumber()); @@ -475,7 +475,7 @@ public Builder from(CreateUserRequestContent other) { *

Name of the connection this user should be created in.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection") public _FinalStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -486,7 +486,7 @@ public _FinalStage connection(@NotNull String connection) { *

The user's username. Only valid if the connection requires a username.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage username(String username) { this.username = Optional.ofNullable(username); return this; @@ -495,7 +495,7 @@ public _FinalStage username(String username) { /** *

The user's username. Only valid if the connection requires a username.

*/ - @Override + @java.lang.Override @JsonSetter(value = "username", nulls = Nulls.SKIP) public _FinalStage username(Optional username) { this.username = username; @@ -506,7 +506,7 @@ public _FinalStage username(Optional username) { *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage verifyEmail(Boolean verifyEmail) { this.verifyEmail = Optional.ofNullable(verifyEmail); return this; @@ -515,7 +515,7 @@ public _FinalStage verifyEmail(Boolean verifyEmail) { /** *

Whether the user will receive a verification email after creation (true) or no email (false). Overrides behavior of email_verified parameter.

*/ - @Override + @java.lang.Override @JsonSetter(value = "verify_email", nulls = Nulls.SKIP) public _FinalStage verifyEmail(Optional verifyEmail) { this.verifyEmail = verifyEmail; @@ -526,7 +526,7 @@ public _FinalStage verifyEmail(Optional verifyEmail) { *

Initial password for this user. Only valid for auth0 connection strategy.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage password(String password) { this.password = Optional.ofNullable(password); return this; @@ -535,7 +535,7 @@ public _FinalStage password(String password) { /** *

Initial password for this user. Only valid for auth0 connection strategy.

*/ - @Override + @java.lang.Override @JsonSetter(value = "password", nulls = Nulls.SKIP) public _FinalStage password(Optional password) { this.password = password; @@ -546,7 +546,7 @@ public _FinalStage password(Optional password) { *

The external user's id provided by the identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage userId(String userId) { this.userId = Optional.ofNullable(userId); return this; @@ -555,7 +555,7 @@ public _FinalStage userId(String userId) { /** *

The external user's id provided by the identity provider.

*/ - @Override + @java.lang.Override @JsonSetter(value = "user_id", nulls = Nulls.SKIP) public _FinalStage userId(Optional userId) { this.userId = userId; @@ -566,7 +566,7 @@ public _FinalStage userId(Optional userId) { *

A URI pointing to the user's picture.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage picture(String picture) { this.picture = Optional.ofNullable(picture); return this; @@ -575,7 +575,7 @@ public _FinalStage picture(String picture) { /** *

A URI pointing to the user's picture.

*/ - @Override + @java.lang.Override @JsonSetter(value = "picture", nulls = Nulls.SKIP) public _FinalStage picture(Optional picture) { this.picture = picture; @@ -586,7 +586,7 @@ public _FinalStage picture(Optional picture) { *

The user's nickname.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage nickname(String nickname) { this.nickname = Optional.ofNullable(nickname); return this; @@ -595,7 +595,7 @@ public _FinalStage nickname(String nickname) { /** *

The user's nickname.

*/ - @Override + @java.lang.Override @JsonSetter(value = "nickname", nulls = Nulls.SKIP) public _FinalStage nickname(Optional nickname) { this.nickname = nickname; @@ -606,7 +606,7 @@ public _FinalStage nickname(Optional nickname) { *

The user's full name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -615,7 +615,7 @@ public _FinalStage name(String name) { /** *

The user's full name.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -626,7 +626,7 @@ public _FinalStage name(Optional name) { *

The user's family name(s).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage familyName(String familyName) { this.familyName = Optional.ofNullable(familyName); return this; @@ -635,7 +635,7 @@ public _FinalStage familyName(String familyName) { /** *

The user's family name(s).

*/ - @Override + @java.lang.Override @JsonSetter(value = "family_name", nulls = Nulls.SKIP) public _FinalStage familyName(Optional familyName) { this.familyName = familyName; @@ -646,7 +646,7 @@ public _FinalStage familyName(Optional familyName) { *

The user's given name(s).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage givenName(String givenName) { this.givenName = Optional.ofNullable(givenName); return this; @@ -655,20 +655,20 @@ public _FinalStage givenName(String givenName) { /** *

The user's given name(s).

*/ - @Override + @java.lang.Override @JsonSetter(value = "given_name", nulls = Nulls.SKIP) public _FinalStage givenName(Optional givenName) { this.givenName = givenName; return this; } - @Override + @java.lang.Override public _FinalStage appMetadata(Map appMetadata) { this.appMetadata = Optional.ofNullable(appMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "app_metadata", nulls = Nulls.SKIP) public _FinalStage appMetadata(Optional> appMetadata) { this.appMetadata = appMetadata; @@ -679,7 +679,7 @@ public _FinalStage appMetadata(Optional> appMetadata) { *

Whether this phone number has been verified (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneVerified(Boolean phoneVerified) { this.phoneVerified = Optional.ofNullable(phoneVerified); return this; @@ -688,7 +688,7 @@ public _FinalStage phoneVerified(Boolean phoneVerified) { /** *

Whether this phone number has been verified (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_verified", nulls = Nulls.SKIP) public _FinalStage phoneVerified(Optional phoneVerified) { this.phoneVerified = phoneVerified; @@ -699,7 +699,7 @@ public _FinalStage phoneVerified(Optional phoneVerified) { *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage emailVerified(Boolean emailVerified) { this.emailVerified = Optional.ofNullable(emailVerified); return this; @@ -708,7 +708,7 @@ public _FinalStage emailVerified(Boolean emailVerified) { /** *

Whether this email address is verified (true) or unverified (false). User will receive a verification email after creation if email_verified is false or not specified

*/ - @Override + @java.lang.Override @JsonSetter(value = "email_verified", nulls = Nulls.SKIP) public _FinalStage emailVerified(Optional emailVerified) { this.emailVerified = emailVerified; @@ -719,7 +719,7 @@ public _FinalStage emailVerified(Optional emailVerified) { *

Whether this user was blocked by an administrator (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage blocked(Boolean blocked) { this.blocked = Optional.ofNullable(blocked); return this; @@ -728,20 +728,20 @@ public _FinalStage blocked(Boolean blocked) { /** *

Whether this user was blocked by an administrator (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "blocked", nulls = Nulls.SKIP) public _FinalStage blocked(Optional blocked) { this.blocked = blocked; return this; } - @Override + @java.lang.Override public _FinalStage userMetadata(Map userMetadata) { this.userMetadata = Optional.ofNullable(userMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_metadata", nulls = Nulls.SKIP) public _FinalStage userMetadata(Optional> userMetadata) { this.userMetadata = userMetadata; @@ -752,7 +752,7 @@ public _FinalStage userMetadata(Optional> userMetadata) { *

The user's phone number (following the E.164 recommendation).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -761,7 +761,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

The user's phone number (following the E.164 recommendation).

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -772,7 +772,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The user's email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -781,14 +781,14 @@ public _FinalStage email(String email) { /** *

The user's email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public CreateUserRequestContent build() { return new CreateUserRequestContent( email, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java index 89807cd58..ce01f5312 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserResponseContent && equalTo((CreateUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(CreateUserResponseContent other) { && familyName.equals(other.familyName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java index 16ea4192f..5457f0768 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(CreateVerifiableCredentialTemplateResponseContent other) && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java index c2581f31d..423b6f53f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateVerificationEmailResponseContent.java @@ -76,7 +76,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerificationEmailResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(CreateVerificationEmailResponseContent other) { && id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -158,7 +158,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(CreateVerificationEmailResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -172,7 +172,7 @@ public Builder from(CreateVerificationEmailResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -184,7 +184,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -196,7 +196,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -207,7 +207,7 @@ public _FinalStage id(@NotNull String id) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -216,14 +216,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public CreateVerificationEmailResponseContent build() { return new CreateVerificationEmailResponseContent(status, type, createdAt, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java index b60152459..06f30e70d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedAuthenticationMethodTypeEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CreatedAuthenticationMethodTypeEnum && this.string.equals(((CreatedAuthenticationMethodTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java index 25106c508..2cb6a0feb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreatedUserAuthenticationMethodTypeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CreatedUserAuthenticationMethodTypeEnum && this.string.equals(((CreatedUserAuthenticationMethodTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CredentialId.java b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java index 763c54889..f50986cde 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CredentialId.java +++ b/src/main/java/com/auth0/client/mgmt/types/CredentialId.java @@ -36,7 +36,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CredentialId && equalTo((CredentialId) other); @@ -51,12 +51,12 @@ private boolean equalTo(CredentialId other) { return id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CredentialId other) { id(other.getId()); return this; @@ -98,14 +98,14 @@ public Builder from(CredentialId other) { *

Credential ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public CredentialId build() { return new CredentialId(id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java index ecf6fc1a2..0c10e3c9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomain.java @@ -158,7 +158,7 @@ private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomDomain && equalTo((CustomDomain) other); @@ -183,7 +183,7 @@ private boolean equalTo(CustomDomain other) { && certificate.equals(other.certificate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.customDomainId, @@ -199,7 +199,7 @@ public int hashCode() { this.certificate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -310,7 +310,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CustomDomain other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); @@ -331,7 +331,7 @@ public Builder from(CustomDomain other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -343,7 +343,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -355,47 +355,47 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage certificate(DomainCertificate certificate) { this.certificate = Optional.ofNullable(certificate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "certificate", nulls = Nulls.SKIP) public _FinalStage certificate(Optional certificate) { this.certificate = certificate; return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; @@ -406,7 +406,7 @@ public _FinalStage domainMetadata(Optional> *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -415,7 +415,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -426,7 +426,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -442,7 +442,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -456,7 +456,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -465,20 +465,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @Override + @java.lang.Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @Override + @java.lang.Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -489,7 +489,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -498,14 +498,14 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; return this; } - @Override + @java.lang.Override public CustomDomain build() { return new CustomDomain( customDomainId, diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java index 69701bb14..0325fd72d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainCustomClientIpHeaderEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainCustomClientIpHeaderEnum && this.string.equals(((CustomDomainCustomClientIpHeaderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java index 7ccaa9c63..10ea63a75 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainProvisioningTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainProvisioningTypeEnum && this.string.equals(((CustomDomainProvisioningTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java index bd2c7412e..d2ca162d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainStatusFilterEnum.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainStatusFilterEnum && this.string.equals(((CustomDomainStatusFilterEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java index 916a88bd7..1300052c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomDomainTypeEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomDomainTypeEnum && this.string.equals(((CustomDomainTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java index 20e149a28..bdf32df78 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderConfiguration.java @@ -36,7 +36,7 @@ public List getDeliveryMethods() { return deliveryMethods; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomProviderConfiguration && equalTo((CustomProviderConfiguration) other); @@ -51,12 +51,12 @@ private boolean equalTo(CustomProviderConfiguration other) { return deliveryMethods.equals(other.deliveryMethods); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deliveryMethods); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java index aa50a92e3..5a718e799 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderCredentials.java @@ -21,7 +21,7 @@ private CustomProviderCredentials(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomProviderCredentials; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java index d7fc7b838..50271acca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomProviderDeliveryMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomProviderDeliveryMethodEnum && this.string.equals(((CustomProviderDeliveryMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java index de31ee4c7..e9709e539 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyAlgorithmEnum.java @@ -38,20 +38,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyAlgorithmEnum && this.string.equals(((CustomSigningKeyAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java index 2c456cae8..bfb12f6d9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyCurveEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyCurveEnum && this.string.equals(((CustomSigningKeyCurveEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java index f712d461c..324e03784 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyJwk.java @@ -185,7 +185,7 @@ public Optional getX5TS256() { return x5TS256; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CustomSigningKeyJwk && equalTo((CustomSigningKeyJwk) other); @@ -213,7 +213,7 @@ private boolean equalTo(CustomSigningKeyJwk other) { && x5TS256.equals(other.x5TS256); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kty, @@ -232,7 +232,7 @@ public int hashCode() { this.x5TS256); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -368,7 +368,7 @@ public static final class Builder implements KtyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CustomSigningKeyJwk other) { kty(other.getKty()); kid(other.getKid()); @@ -387,7 +387,7 @@ public Builder from(CustomSigningKeyJwk other) { return this; } - @Override + @java.lang.Override @JsonSetter("kty") public _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty) { this.kty = Objects.requireNonNull(kty, "kty must not be null"); @@ -398,7 +398,7 @@ public _FinalStage kty(@NotNull CustomSigningKeyTypeEnum kty) { *

X.509 certificate SHA-256 thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage x5TS256(String x5TS256) { this.x5TS256 = Optional.ofNullable(x5TS256); return this; @@ -407,7 +407,7 @@ public _FinalStage x5TS256(String x5TS256) { /** *

X.509 certificate SHA-256 thumbprint

*/ - @Override + @java.lang.Override @JsonSetter(value = "x5t#S256", nulls = Nulls.SKIP) public _FinalStage x5TS256(Optional x5TS256) { this.x5TS256 = x5TS256; @@ -418,7 +418,7 @@ public _FinalStage x5TS256(Optional x5TS256) { *

X.509 certificate SHA-1 thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage x5T(String x5T) { this.x5T = Optional.ofNullable(x5T); return this; @@ -427,7 +427,7 @@ public _FinalStage x5T(String x5T) { /** *

X.509 certificate SHA-1 thumbprint

*/ - @Override + @java.lang.Override @JsonSetter(value = "x5t", nulls = Nulls.SKIP) public _FinalStage x5T(Optional x5T) { this.x5T = x5T; @@ -438,7 +438,7 @@ public _FinalStage x5T(Optional x5T) { *

X.509 certificate chain

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage x5C(List x5C) { this.x5C = Optional.ofNullable(x5C); return this; @@ -447,7 +447,7 @@ public _FinalStage x5C(List x5C) { /** *

X.509 certificate chain

*/ - @Override + @java.lang.Override @JsonSetter(value = "x5c", nulls = Nulls.SKIP) public _FinalStage x5C(Optional> x5C) { this.x5C = x5C; @@ -458,7 +458,7 @@ public _FinalStage x5C(Optional> x5C) { *

X.509 URL

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage x5U(String x5U) { this.x5U = Optional.ofNullable(x5U); return this; @@ -467,7 +467,7 @@ public _FinalStage x5U(String x5U) { /** *

X.509 URL

*/ - @Override + @java.lang.Override @JsonSetter(value = "x5u", nulls = Nulls.SKIP) public _FinalStage x5U(Optional x5U) { this.x5U = x5U; @@ -478,7 +478,7 @@ public _FinalStage x5U(Optional x5U) { *

Y coordinate

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage y(String y) { this.y = Optional.ofNullable(y); return this; @@ -487,7 +487,7 @@ public _FinalStage y(String y) { /** *

Y coordinate

*/ - @Override + @java.lang.Override @JsonSetter(value = "y", nulls = Nulls.SKIP) public _FinalStage y(Optional y) { this.y = y; @@ -498,7 +498,7 @@ public _FinalStage y(Optional y) { *

X coordinate

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage x(String x) { this.x = Optional.ofNullable(x); return this; @@ -507,20 +507,20 @@ public _FinalStage x(String x) { /** *

X coordinate

*/ - @Override + @java.lang.Override @JsonSetter(value = "x", nulls = Nulls.SKIP) public _FinalStage x(Optional x) { this.x = x; return this; } - @Override + @java.lang.Override public _FinalStage crv(CustomSigningKeyCurveEnum crv) { this.crv = Optional.ofNullable(crv); return this; } - @Override + @java.lang.Override @JsonSetter(value = "crv", nulls = Nulls.SKIP) public _FinalStage crv(Optional crv) { this.crv = crv; @@ -531,7 +531,7 @@ public _FinalStage crv(Optional crv) { *

Key exponent

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage e(String e) { this.e = Optional.ofNullable(e); return this; @@ -540,7 +540,7 @@ public _FinalStage e(String e) { /** *

Key exponent

*/ - @Override + @java.lang.Override @JsonSetter(value = "e", nulls = Nulls.SKIP) public _FinalStage e(Optional e) { this.e = e; @@ -551,7 +551,7 @@ public _FinalStage e(Optional e) { *

Key modulus

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage n(String n) { this.n = Optional.ofNullable(n); return this; @@ -560,20 +560,20 @@ public _FinalStage n(String n) { /** *

Key modulus

*/ - @Override + @java.lang.Override @JsonSetter(value = "n", nulls = Nulls.SKIP) public _FinalStage n(Optional n) { this.n = n; return this; } - @Override + @java.lang.Override public _FinalStage alg(CustomSigningKeyAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -584,7 +584,7 @@ public _FinalStage alg(Optional alg) { *

Key operations

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyOps(List keyOps) { this.keyOps = Optional.ofNullable(keyOps); return this; @@ -593,20 +593,20 @@ public _FinalStage keyOps(List keyOps) { /** *

Key operations

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_ops", nulls = Nulls.SKIP) public _FinalStage keyOps(Optional> keyOps) { this.keyOps = keyOps; return this; } - @Override + @java.lang.Override public _FinalStage use(String use) { this.use = Optional.ofNullable(use); return this; } - @Override + @java.lang.Override @JsonSetter(value = "use", nulls = Nulls.SKIP) public _FinalStage use(Optional use) { this.use = use; @@ -617,7 +617,7 @@ public _FinalStage use(Optional use) { *

Key identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage kid(String kid) { this.kid = Optional.ofNullable(kid); return this; @@ -626,14 +626,14 @@ public _FinalStage kid(String kid) { /** *

Key identifier

*/ - @Override + @java.lang.Override @JsonSetter(value = "kid", nulls = Nulls.SKIP) public _FinalStage kid(Optional kid) { this.kid = kid; return this; } - @Override + @java.lang.Override public CustomSigningKeyJwk build() { return new CustomSigningKeyJwk( kty, kid, use, keyOps, alg, n, e, crv, x, y, x5U, x5C, x5T, x5TS256, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java index 43188b8bf..c5436f6bf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/CustomSigningKeyTypeEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof CustomSigningKeyTypeEnum && this.string.equals(((CustomSigningKeyTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DailyStats.java b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java index 98ee23bdb..9a9419276 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DailyStats.java +++ b/src/main/java/com/auth0/client/mgmt/types/DailyStats.java @@ -99,7 +99,7 @@ public Optional getCreatedAt() { return createdAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DailyStats && equalTo((DailyStats) other); @@ -119,12 +119,12 @@ private boolean equalTo(DailyStats other) { && createdAt.equals(other.createdAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.date, this.logins, this.signups, this.leakedPasswords, this.updatedAt, this.createdAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java index 0cf0f3727..588640ef6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/DefaultTokenQuota.java @@ -45,7 +45,7 @@ public Optional getOrganizations() { return organizations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DefaultTokenQuota && equalTo((DefaultTokenQuota) other); @@ -60,12 +60,12 @@ private boolean equalTo(DefaultTokenQuota other) { return clients.equals(other.clients) && organizations.equals(other.organizations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clients, this.organizations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java index c4e1c02a2..5f1777c0f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteActionRequestParameters.java @@ -50,7 +50,7 @@ private OptionalNullable _getForce() { return force; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteActionRequestParameters && equalTo((DeleteActionRequestParameters) other); @@ -65,12 +65,12 @@ private boolean equalTo(DeleteActionRequestParameters other) { return force.equals(other.force); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.force); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java index e7297f86a..3a5d3b645 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserBlocksByIdentifierRequestParameters.java @@ -36,7 +36,7 @@ public String getIdentifier() { return identifier; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserBlocksByIdentifierRequestParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteUserBlocksByIdentifierRequestParameters other) { return identifier.equals(other.identifier); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DeleteUserBlocksByIdentifierRequestParameters other) { identifier(other.getIdentifier()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteUserBlocksByIdentifierRequestParameters other) { *

Should be any of a username, phone number, or email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } - @Override + @java.lang.Override public DeleteUserBlocksByIdentifierRequestParameters build() { return new DeleteUserBlocksByIdentifierRequestParameters(identifier, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java index 9fb537545..4f2c23fe2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserGrantByUserIdRequestParameters.java @@ -36,7 +36,7 @@ public String getUserId() { return userId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserGrantByUserIdRequestParameters @@ -52,12 +52,12 @@ private boolean equalTo(DeleteUserGrantByUserIdRequestParameters other) { return userId.equals(other.userId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DeleteUserGrantByUserIdRequestParameters other) { userId(other.getUserId()); return this; @@ -99,14 +99,14 @@ public Builder from(DeleteUserGrantByUserIdRequestParameters other) { *

user_id of the grant to delete.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override public DeleteUserGrantByUserIdRequestParameters build() { return new DeleteUserGrantByUserIdRequestParameters(userId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java index 860507195..becb6c2ed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeleteUserIdentityResponseContentItem.java @@ -121,7 +121,7 @@ public Optional getProfileData() { return profileData; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserIdentityResponseContentItem @@ -144,7 +144,7 @@ private boolean equalTo(DeleteUserIdentityResponseContentItem other) { && profileData.equals(other.profileData); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connection, @@ -157,7 +157,7 @@ public int hashCode() { this.profileData); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -248,7 +248,7 @@ public static final class Builder implements ConnectionStage, UserIdStage, Provi private Builder() {} - @Override + @java.lang.Override public Builder from(DeleteUserIdentityResponseContentItem other) { connection(other.getConnection()); userId(other.getUserId()); @@ -266,7 +266,7 @@ public Builder from(DeleteUserIdentityResponseContentItem other) { *

The name of the connection for the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection") public UserIdStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -278,7 +278,7 @@ public UserIdStage connection(@NotNull String connection) { *

The unique identifier for the user for the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public ProviderStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -290,20 +290,20 @@ public ProviderStage userId(@NotNull String userId) { *

The type of identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull String provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage profileData(UserProfileData profileData) { this.profileData = Optional.ofNullable(profileData); return this; } - @Override + @java.lang.Override @JsonSetter(value = "profileData", nulls = Nulls.SKIP) public _FinalStage profileData(Optional profileData) { this.profileData = profileData; @@ -314,7 +314,7 @@ public _FinalStage profileData(Optional profileData) { *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshToken(String refreshToken) { this.refreshToken = Optional.ofNullable(refreshToken); return this; @@ -323,7 +323,7 @@ public _FinalStage refreshToken(String refreshToken) { /** *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(Optional refreshToken) { this.refreshToken = refreshToken; @@ -334,7 +334,7 @@ public _FinalStage refreshToken(Optional refreshToken) { *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accessTokenSecret(String accessTokenSecret) { this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); return this; @@ -343,7 +343,7 @@ public _FinalStage accessTokenSecret(String accessTokenSecret) { /** *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

*/ - @Override + @java.lang.Override @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) public _FinalStage accessTokenSecret(Optional accessTokenSecret) { this.accessTokenSecret = accessTokenSecret; @@ -354,7 +354,7 @@ public _FinalStage accessTokenSecret(Optional accessTokenSecret) { *

IDP access token returned only if scope read:user_idp_tokens is defined

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accessToken(String accessToken) { this.accessToken = Optional.ofNullable(accessToken); return this; @@ -363,7 +363,7 @@ public _FinalStage accessToken(String accessToken) { /** *

IDP access token returned only if scope read:user_idp_tokens is defined

*/ - @Override + @java.lang.Override @JsonSetter(value = "access_token", nulls = Nulls.SKIP) public _FinalStage accessToken(Optional accessToken) { this.accessToken = accessToken; @@ -374,7 +374,7 @@ public _FinalStage accessToken(Optional accessToken) { *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isSocial(Boolean isSocial) { this.isSocial = Optional.ofNullable(isSocial); return this; @@ -383,14 +383,14 @@ public _FinalStage isSocial(Boolean isSocial) { /** *

<code>true</code> if the identity provider is a social provider, <code>false</code>s otherwise

*/ - @Override + @java.lang.Override @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) public _FinalStage isSocial(Optional isSocial) { this.isSocial = isSocial; return this; } - @Override + @java.lang.Override public DeleteUserIdentityResponseContentItem build() { return new DeleteUserIdentityResponseContentItem( connection, diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java index b191bbe37..5b2c38332 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionResponseContent.java @@ -52,6 +52,8 @@ public final class DeployActionResponseContent { private final Optional> supportedTriggers; + private final Optional> modules; + private final Map additionalProperties; private DeployActionResponseContent( @@ -70,6 +72,7 @@ private DeployActionResponseContent( Optional createdAt, Optional updatedAt, Optional> supportedTriggers, + Optional> modules, Map additionalProperties) { this.id = id; this.actionId = actionId; @@ -86,6 +89,7 @@ private DeployActionResponseContent( this.createdAt = createdAt; this.updatedAt = updatedAt; this.supportedTriggers = supportedTriggers; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -203,7 +207,15 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @Override + /** + * @return The list of action modules and their versions used by this action version. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionResponseContent && equalTo((DeployActionResponseContent) other); @@ -229,10 +241,11 @@ private boolean equalTo(DeployActionResponseContent other) { && builtAt.equals(other.builtAt) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && supportedTriggers.equals(other.supportedTriggers); + && supportedTriggers.equals(other.supportedTriggers) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -249,10 +262,11 @@ public int hashCode() { this.builtAt, this.createdAt, this.updatedAt, - this.supportedTriggers); + this.supportedTriggers, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,6 +307,8 @@ public static final class Builder { private Optional> supportedTriggers = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -314,6 +330,7 @@ public Builder from(DeployActionResponseContent other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); supportedTriggers(other.getSupportedTriggers()); + modules(other.getModules()); return this; } @@ -521,6 +538,20 @@ public Builder supportedTriggers(List supportedTriggers) { return this; } + /** + *

The list of action modules and their versions used by this action version.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public DeployActionResponseContent build() { return new DeployActionResponseContent( id, @@ -538,6 +569,7 @@ public DeployActionResponseContent build() { createdAt, updatedAt, supportedTriggers, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java index ea01b34be..13bba7690 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionRequestBodyParams.java @@ -38,7 +38,7 @@ public Optional getUpdateDraft() { return updateDraft; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionVersionRequestBodyParams @@ -54,12 +54,12 @@ private boolean equalTo(DeployActionVersionRequestBodyParams other) { return updateDraft.equals(other.updateDraft); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.updateDraft); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java index 5223460a8..9dbe98bc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeployActionVersionResponseContent.java @@ -52,6 +52,8 @@ public final class DeployActionVersionResponseContent { private final Optional> supportedTriggers; + private final Optional> modules; + private final Map additionalProperties; private DeployActionVersionResponseContent( @@ -70,6 +72,7 @@ private DeployActionVersionResponseContent( Optional createdAt, Optional updatedAt, Optional> supportedTriggers, + Optional> modules, Map additionalProperties) { this.id = id; this.actionId = actionId; @@ -86,6 +89,7 @@ private DeployActionVersionResponseContent( this.createdAt = createdAt; this.updatedAt = updatedAt; this.supportedTriggers = supportedTriggers; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -203,7 +207,15 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @Override + /** + * @return The list of action modules and their versions used by this action version. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeployActionVersionResponseContent @@ -230,10 +242,11 @@ private boolean equalTo(DeployActionVersionResponseContent other) { && builtAt.equals(other.builtAt) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && supportedTriggers.equals(other.supportedTriggers); + && supportedTriggers.equals(other.supportedTriggers) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -250,10 +263,11 @@ public int hashCode() { this.builtAt, this.createdAt, this.updatedAt, - this.supportedTriggers); + this.supportedTriggers, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -294,6 +308,8 @@ public static final class Builder { private Optional> supportedTriggers = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -315,6 +331,7 @@ public Builder from(DeployActionVersionResponseContent other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); supportedTriggers(other.getSupportedTriggers()); + modules(other.getModules()); return this; } @@ -522,6 +539,20 @@ public Builder supportedTriggers(List supportedTriggers) { return this; } + /** + *

The list of action modules and their versions used by this action version.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public DeployActionVersionResponseContent build() { return new DeployActionVersionResponseContent( id, @@ -539,6 +570,7 @@ public DeployActionVersionResponseContent build() { createdAt, updatedAt, supportedTriggers, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java index 5189a0f6e..43b299cd1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredential.java @@ -96,7 +96,7 @@ public Optional getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeviceCredential && equalTo((DeviceCredential) other); @@ -116,12 +116,12 @@ private boolean equalTo(DeviceCredential other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.deviceName, this.deviceId, this.type, this.userId, this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java index 621027f62..10fe7a1ae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DeviceCredentialTypeEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof DeviceCredentialTypeEnum && this.string.equals(((DeviceCredentialTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java index 0187f548f..b6b111e63 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioningMappingItem.java @@ -47,7 +47,7 @@ public String getIdp() { return idp; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DirectoryProvisioningMappingItem && equalTo((DirectoryProvisioningMappingItem) other); @@ -62,12 +62,12 @@ private boolean equalTo(DirectoryProvisioningMappingItem other) { return auth0.equals(other.auth0) && idp.equals(other.idp); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.auth0, this.idp); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements Auth0Stage, IdpStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DirectoryProvisioningMappingItem other) { auth0(other.getAuth0()); idp(other.getIdp()); @@ -119,7 +119,7 @@ public Builder from(DirectoryProvisioningMappingItem other) { *

The field location in the Auth0 schema

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("auth0") public IdpStage auth0(@NotNull String auth0) { this.auth0 = Objects.requireNonNull(auth0, "auth0 must not be null"); @@ -131,14 +131,14 @@ public IdpStage auth0(@NotNull String auth0) { *

The field location in the IDP schema

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("idp") public _FinalStage idp(@NotNull String idp) { this.idp = Objects.requireNonNull(idp, "idp must not be null"); return this; } - @Override + @java.lang.Override public DirectoryProvisioningMappingItem build() { return new DirectoryProvisioningMappingItem(auth0, idp, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java index 688750fac..48fab1960 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificate.java @@ -69,7 +69,7 @@ public Optional getRenewsBefore() { return renewsBefore; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DomainCertificate && equalTo((DomainCertificate) other); @@ -87,12 +87,12 @@ private boolean equalTo(DomainCertificate other) { && renewsBefore.equals(other.renewsBefore); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.errorMsg, this.certificateAuthority, this.renewsBefore); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java index edec82da4..212b349d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateAuthorityEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof DomainCertificateAuthorityEnum && this.string.equals(((DomainCertificateAuthorityEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java index eafe644aa..abdd960b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainCertificateStatusEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof DomainCertificateStatusEnum && this.string.equals(((DomainCertificateStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java index 19427089e..1ac0f4125 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerification.java @@ -73,7 +73,7 @@ public Optional getLastVerifiedAt() { return lastVerifiedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DomainVerification && equalTo((DomainVerification) other); @@ -91,12 +91,12 @@ private boolean equalTo(DomainVerification other) { && lastVerifiedAt.equals(other.lastVerifiedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.methods, this.status, this.errorMsg, this.lastVerifiedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java index fa78c5b1f..d34982711 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethod.java @@ -61,7 +61,7 @@ public Optional getDomain() { return domain; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DomainVerificationMethod && equalTo((DomainVerificationMethod) other); @@ -76,12 +76,12 @@ private boolean equalTo(DomainVerificationMethod other) { return name.equals(other.name) && record.equals(other.record) && domain.equals(other.domain); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.record, this.domain); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements NameStage, RecordStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(DomainVerificationMethod other) { name(other.getName()); record(other.getRecord()); @@ -135,7 +135,7 @@ public Builder from(DomainVerificationMethod other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public RecordStage name(@NotNull DomainVerificationMethodNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -147,7 +147,7 @@ public RecordStage name(@NotNull DomainVerificationMethodNameEnum name) { *

Value used to verify the domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("record") public _FinalStage record(@NotNull String record) { this.record = Objects.requireNonNull(record, "record must not be null"); @@ -158,7 +158,7 @@ public _FinalStage record(@NotNull String record) { *

The name of the txt record for verification

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage domain(String domain) { this.domain = Optional.ofNullable(domain); return this; @@ -167,14 +167,14 @@ public _FinalStage domain(String domain) { /** *

The name of the txt record for verification

*/ - @Override + @java.lang.Override @JsonSetter(value = "domain", nulls = Nulls.SKIP) public _FinalStage domain(Optional domain) { this.domain = domain; return this; } - @Override + @java.lang.Override public DomainVerificationMethod build() { return new DomainVerificationMethod(name, record, domain, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java index 6c499d74a..f41d37983 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationMethodNameEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof DomainVerificationMethodNameEnum && this.string.equals(((DomainVerificationMethodNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java index 18c5ac3c0..6267aee28 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/DomainVerificationStatusEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof DomainVerificationStatusEnum && this.string.equals(((DomainVerificationStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java index 2f9073c5e..5e65ffcc4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailAttribute.java @@ -78,7 +78,7 @@ public Optional getSignup() { return signup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailAttribute && equalTo((EmailAttribute) other); @@ -97,12 +97,12 @@ private boolean equalTo(EmailAttribute other) { && signup.equals(other.signup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier, this.unique, this.profileRequired, this.verificationMethod, this.signup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java index ffa2c19fa..2de5fba4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentials.java @@ -87,7 +87,7 @@ public Optional getSmtpUser() { return smtpUser; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentials && equalTo((EmailProviderCredentials) other); @@ -106,12 +106,12 @@ private boolean equalTo(EmailProviderCredentials other) { && smtpUser.equals(other.smtpUser); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apiUser, this.region, this.smtpHost, this.smtpPort, this.smtpUser); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java index dbbff238e..2ab98a41f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchema.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchema && equalTo((EmailProviderCredentialsSchema) other); @@ -61,12 +61,12 @@ private boolean equalTo(EmailProviderCredentialsSchema other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getRegion() { return region; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaAccessKeyId @@ -81,12 +81,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaAccessKeyId other) { && region.equals(other.region); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessKeyId, this.secretAccessKey, this.region); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java index 37ad82baa..ffd466404 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaApiKey.java @@ -60,7 +60,7 @@ public Optional getRegion() { return region; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaApiKey @@ -76,12 +76,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaApiKey other) { return apiKey.equals(other.apiKey) && domain.equals(other.domain) && region.equals(other.region); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apiKey, this.domain, this.region); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java index 7d0d3edaf..afd69f78a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaClientId.java @@ -63,7 +63,7 @@ public Optional getClientSecret() { return clientSecret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaClientId @@ -81,12 +81,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaClientId other) { && clientSecret.equals(other.clientSecret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tenantId, this.clientId, this.clientSecret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java index 08f82a8d0..92c4c9bfe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaConnectionString.java @@ -38,7 +38,7 @@ public Optional getConnectionString() { return connectionString; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaConnectionString @@ -54,12 +54,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaConnectionString other) { return connectionString.equals(other.connectionString); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionString); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java index cd67dd7b6..e32a7d5c8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaSmtpHost.java @@ -72,7 +72,7 @@ public Optional getSmtpPass() { return smtpPass; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaSmtpHost @@ -91,12 +91,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaSmtpHost other) { && smtpPass.equals(other.smtpPass); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.smtpHost, this.smtpPort, this.smtpUser, this.smtpPass); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java index ece99afba..6bb0d8525 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaThree.java @@ -46,7 +46,7 @@ public Optional getRegion() { return region; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaThree @@ -62,12 +62,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaThree other) { return apiKey.equals(other.apiKey) && region.equals(other.region); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apiKey, this.region); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java index edf2cbe86..330800496 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderCredentialsSchemaZero.java @@ -36,7 +36,7 @@ public String getApiKey() { return apiKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EmailProviderCredentialsSchemaZero @@ -52,12 +52,12 @@ private boolean equalTo(EmailProviderCredentialsSchemaZero other) { return apiKey.equals(other.apiKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apiKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements ApiKeyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(EmailProviderCredentialsSchemaZero other) { apiKey(other.getApiKey()); return this; @@ -99,14 +99,14 @@ public Builder from(EmailProviderCredentialsSchemaZero other) { *

API Key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override public EmailProviderCredentialsSchemaZero build() { return new EmailProviderCredentialsSchemaZero(apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java index 447f5c46a..3adaf39e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailProviderNameEnum.java @@ -38,20 +38,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EmailProviderNameEnum && this.string.equals(((EmailProviderNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java index 26b788895..cde3175c9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EmailTemplateNameEnum.java @@ -58,20 +58,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EmailTemplateNameEnum && this.string.equals(((EmailTemplateNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java b/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java index 469b23b9a..0c8f0e43f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EnabledFeaturesEnum.java @@ -25,19 +25,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EnabledFeaturesEnum && this.string.equals(((EnabledFeaturesEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java index 3e597f294..98b0a4c6e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKey.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EncryptionKey && equalTo((EncryptionKey) other); @@ -128,13 +128,13 @@ private boolean equalTo(EncryptionKey other) { && publicKey.equals(other.publicKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -214,7 +214,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(EncryptionKey other) { kid(other.getKid()); type(other.getType()); @@ -231,21 +231,21 @@ public Builder from(EncryptionKey other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -257,7 +257,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -269,7 +269,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -281,7 +281,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -292,7 +292,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -301,14 +301,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @Override + @java.lang.Override public EncryptionKey build() { return new EncryptionKey( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java index 44d4c43f9..50b5ab6a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyState.java @@ -29,19 +29,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EncryptionKeyState && this.string.equals(((EncryptionKeyState) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java index 658d47cac..6eaa7164b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java +++ b/src/main/java/com/auth0/client/mgmt/types/EncryptionKeyType.java @@ -32,19 +32,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EncryptionKeyType && this.string.equals(((EncryptionKeyType) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java index 88dd55414..daaeb1ecb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionConfiguration.java @@ -36,7 +36,7 @@ public String getActionId() { return actionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionConfiguration && equalTo((EventStreamActionConfiguration) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamActionConfiguration other) { return actionId.equals(other.actionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ActionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamActionConfiguration other) { actionId(other.getActionId()); return this; @@ -98,14 +98,14 @@ public Builder from(EventStreamActionConfiguration other) { *

Action ID for the action destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("action_id") public _FinalStage actionId(@NotNull String actionId) { this.actionId = Objects.requireNonNull(actionId, "actionId must not be null"); return this; } - @Override + @java.lang.Override public EventStreamActionConfiguration build() { return new EventStreamActionConfiguration(actionId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java index c75f54d9d..9e8f5e045 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionDestination.java @@ -42,7 +42,7 @@ public EventStreamActionConfiguration getConfiguration() { return configuration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionDestination && equalTo((EventStreamActionDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamActionDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamActionDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamActionConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @Override + @java.lang.Override public EventStreamActionDestination build() { return new EventStreamActionDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java index d464f692d..a79e68339 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamActionResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamActionResponseContent && equalTo((EventStreamActionResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(EventStreamActionResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java index 5aedd4f60..1bc25e7b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamCloudEvent.java @@ -100,7 +100,7 @@ public Optional getData() { return data; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamCloudEvent && equalTo((EventStreamCloudEvent) other); @@ -120,12 +120,12 @@ private boolean equalTo(EventStreamCloudEvent other) { && data.equals(other.data); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.source, this.specversion, this.type, this.time, this.data); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java index 29861a79f..a776201db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDelivery.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDelivery && equalTo((EventStreamDelivery) other); @@ -113,12 +113,12 @@ private boolean equalTo(EventStreamDelivery other) { && event.equals(other.event); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -187,7 +187,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamDelivery other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -203,7 +203,7 @@ public Builder from(EventStreamDelivery other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -215,34 +215,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -253,7 +253,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -265,7 +265,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -274,7 +274,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @Override + @java.lang.Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -284,7 +284,7 @@ public _FinalStage attempts(List attempts) { return this; } - @Override + @java.lang.Override public EventStreamDelivery build() { return new EventStreamDelivery(id, eventStreamId, status, eventType, attempts, event, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java index 651766025..9b421de2c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryAttempt.java @@ -62,7 +62,7 @@ public Optional getErrorMessage() { return errorMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDeliveryAttempt && equalTo((EventStreamDeliveryAttempt) other); @@ -79,12 +79,12 @@ private boolean equalTo(EventStreamDeliveryAttempt other) { && errorMessage.equals(other.errorMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.timestamp, this.errorMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -130,7 +130,7 @@ public static final class Builder implements StatusStage, TimestampStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamDeliveryAttempt other) { status(other.getStatus()); timestamp(other.getTimestamp()); @@ -138,7 +138,7 @@ public Builder from(EventStreamDeliveryAttempt other) { return this; } - @Override + @java.lang.Override @JsonSetter("status") public TimestampStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -150,7 +150,7 @@ public TimestampStage status(@NotNull String status) { *

Timestamp of delivery attempt

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("timestamp") public _FinalStage timestamp(@NotNull OffsetDateTime timestamp) { this.timestamp = Objects.requireNonNull(timestamp, "timestamp must not be null"); @@ -161,7 +161,7 @@ public _FinalStage timestamp(@NotNull OffsetDateTime timestamp) { *

Delivery error message, if applicable

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage errorMessage(String errorMessage) { this.errorMessage = Optional.ofNullable(errorMessage); return this; @@ -170,14 +170,14 @@ public _FinalStage errorMessage(String errorMessage) { /** *

Delivery error message, if applicable

*/ - @Override + @java.lang.Override @JsonSetter(value = "error_message", nulls = Nulls.SKIP) public _FinalStage errorMessage(Optional errorMessage) { this.errorMessage = errorMessage; return this; } - @Override + @java.lang.Override public EventStreamDeliveryAttempt build() { return new EventStreamDeliveryAttempt(status, timestamp, errorMessage, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java index aef337ea9..356649e1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDeliveryEventTypeEnum.java @@ -78,20 +78,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamDeliveryEventTypeEnum && this.string.equals(((EventStreamDeliveryEventTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java index 37fa33660..f764532ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamDestinationPatch.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamDestinationPatch && equalTo((EventStreamDestinationPatch) other); @@ -49,12 +49,12 @@ private boolean equalTo(EventStreamDestinationPatch other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer getAwsPartnerEventSource() { return awsPartnerEventSource; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeConfiguration @@ -79,12 +79,12 @@ private boolean equalTo(EventStreamEventBridgeConfiguration other) { && awsPartnerEventSource.equals(other.awsPartnerEventSource); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -130,7 +130,7 @@ public static final class Builder implements AwsAccountIdStage, AwsRegionStage, private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamEventBridgeConfiguration other) { awsAccountId(other.getAwsAccountId()); awsRegion(other.getAwsRegion()); @@ -143,14 +143,14 @@ public Builder from(EventStreamEventBridgeConfiguration other) { *

AWS Account ID for EventBridge destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("aws_account_id") public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("aws_region") public _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsRegion) { this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); @@ -161,7 +161,7 @@ public _FinalStage awsRegion(@NotNull EventStreamEventBridgeAwsRegionEnum awsReg *

AWS Partner Event Source for EventBridge destination.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); return this; @@ -170,14 +170,14 @@ public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { /** *

AWS Partner Event Source for EventBridge destination.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aws_partner_event_source", nulls = Nulls.SKIP) public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { this.awsPartnerEventSource = awsPartnerEventSource; return this; } - @Override + @java.lang.Override public EventStreamEventBridgeConfiguration build() { return new EventStreamEventBridgeConfiguration( awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java index 46cc475a1..bba2fc35c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeDestination.java @@ -42,7 +42,7 @@ public EventStreamEventBridgeConfiguration getConfiguration() { return configuration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeDestination && equalTo((EventStreamEventBridgeDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamEventBridgeDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamEventBridgeDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamEventBridgeConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @Override + @java.lang.Override public EventStreamEventBridgeDestination build() { return new EventStreamEventBridgeDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java index 463834258..9735a2d13 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventBridgeResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamEventBridgeResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(EventStreamEventBridgeResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java index 5b990071d..ec22b82f0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamEventTypeEnum.java @@ -74,20 +74,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamEventTypeEnum && this.string.equals(((EventStreamEventTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java index 4e86cc124..65879e17e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamResponseContent && equalTo((EventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer getEventType() { return eventType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamSubscription && equalTo((EventStreamSubscription) other); @@ -49,12 +49,12 @@ private boolean equalTo(EventStreamSubscription other) { return eventType.equals(other.eventType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.eventType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java index c4f8b8b59..d1ac98504 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamTestEventTypeEnum.java @@ -76,20 +76,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof EventStreamTestEventTypeEnum && this.string.equals(((EventStreamTestEventTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java index cecf32dfb..67ba0e358 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookAuthorizationResponse.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookAuthorizationResponse @@ -50,12 +50,12 @@ private boolean equalTo(EventStreamWebhookAuthorizationResponse other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializerUsername

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("username") public _FinalStage username(@NotNull String username) { this.username = Objects.requireNonNull(username, "username must not be null"); return this; } - @Override + @java.lang.Override public EventStreamWebhookBasicAuth build() { return new EventStreamWebhookBasicAuth(method, username, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java index 175b11ed8..59ae34454 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookBearerAuth.java @@ -33,7 +33,7 @@ public String getMethod() { return method; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookBearerAuth && equalTo((EventStreamWebhookBearerAuth) other); @@ -48,12 +48,12 @@ private boolean equalTo(EventStreamWebhookBearerAuth other) { return method.equals(other.method); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.method); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements MethodStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamWebhookBearerAuth other) { method(other.getMethod()); return this; } - @Override + @java.lang.Override @JsonSetter("method") public _FinalStage method(@NotNull String method) { this.method = Objects.requireNonNull(method, "method must not be null"); return this; } - @Override + @java.lang.Override public EventStreamWebhookBearerAuth build() { return new EventStreamWebhookBearerAuth(method, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java index 51d2f08d0..a3dafb72d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookConfiguration.java @@ -47,7 +47,7 @@ public EventStreamWebhookAuthorizationResponse getWebhookAuthorization() { return webhookAuthorization; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookConfiguration && equalTo((EventStreamWebhookConfiguration) other); @@ -62,12 +62,12 @@ private boolean equalTo(EventStreamWebhookConfiguration other) { return webhookEndpoint.equals(other.webhookEndpoint) && webhookAuthorization.equals(other.webhookAuthorization); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhookEndpoint, this.webhookAuthorization); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -104,7 +104,7 @@ public static final class Builder implements WebhookEndpointStage, WebhookAuthor private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamWebhookConfiguration other) { webhookEndpoint(other.getWebhookEndpoint()); webhookAuthorization(other.getWebhookAuthorization()); @@ -116,14 +116,14 @@ public Builder from(EventStreamWebhookConfiguration other) { *

Target HTTP endpoint URL.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("webhook_endpoint") public WebhookAuthorizationStage webhookEndpoint(@NotNull String webhookEndpoint) { this.webhookEndpoint = Objects.requireNonNull(webhookEndpoint, "webhookEndpoint must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("webhook_authorization") public _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorizationResponse webhookAuthorization) { this.webhookAuthorization = @@ -131,7 +131,7 @@ public _FinalStage webhookAuthorization(@NotNull EventStreamWebhookAuthorization return this; } - @Override + @java.lang.Override public EventStreamWebhookConfiguration build() { return new EventStreamWebhookConfiguration(webhookEndpoint, webhookAuthorization, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java index 6a97aa1b4..85e8bb0ba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookDestination.java @@ -42,7 +42,7 @@ public EventStreamWebhookConfiguration getConfiguration() { return configuration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookDestination && equalTo((EventStreamWebhookDestination) other); @@ -57,12 +57,12 @@ private boolean equalTo(EventStreamWebhookDestination other) { return type.equals(other.type) && configuration.equals(other.configuration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.configuration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, ConfigurationStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(EventStreamWebhookDestination other) { type(other.getType()); configuration(other.getConfiguration()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigurationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("configuration") public _FinalStage configuration(@NotNull EventStreamWebhookConfiguration configuration) { this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); return this; } - @Override + @java.lang.Override public EventStreamWebhookDestination build() { return new EventStreamWebhookDestination(type, configuration, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java index b9be764fd..f21a19b20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamWebhookResponseContent.java @@ -107,7 +107,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamWebhookResponseContent && equalTo((EventStreamWebhookResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(EventStreamWebhookResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subscriptions, this.destination, this.status, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java index e929818b4..3af8d30e1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/EventStreamsCreateRequest.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventStreamsCreateRequest && equalTo((EventStreamsCreateRequest) other); @@ -51,12 +51,12 @@ private boolean equalTo(EventStreamsCreateRequest other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer getOinSubmissionId() { return oinSubmissionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExpressConfiguration && equalTo((ExpressConfiguration) other); @@ -160,7 +160,7 @@ private boolean equalTo(ExpressConfiguration other) { && oinSubmissionId.equals(other.oinSubmissionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.initiateLoginUriTemplate, @@ -174,7 +174,7 @@ public int hashCode() { this.oinSubmissionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -285,7 +285,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ExpressConfiguration other) { initiateLoginUriTemplate(other.getInitiateLoginUriTemplate()); userAttributeProfileId(other.getUserAttributeProfileId()); @@ -304,7 +304,7 @@ public Builder from(ExpressConfiguration other) { *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("initiate_login_uri_template") public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate) { this.initiateLoginUriTemplate = @@ -317,7 +317,7 @@ public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String init *

The ID of the user attribute profile to use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_attribute_profile_id") public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId) { this.userAttributeProfileId = @@ -330,7 +330,7 @@ public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttri *

The ID of the connection profile to use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_profile_id") public EnableClientStage connectionProfileId(@NotNull String connectionProfileId) { this.connectionProfileId = @@ -343,7 +343,7 @@ public EnableClientStage connectionProfileId(@NotNull String connectionProfileId *

When true, all connections made via express configuration will be enabled for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enable_client") public EnableOrganizationStage enableClient(boolean enableClient) { this.enableClient = enableClient; @@ -355,7 +355,7 @@ public EnableOrganizationStage enableClient(boolean enableClient) { *

When true, all connections made via express configuration will have the associated organization enabled.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enable_organization") public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { this.enableOrganization = enableOrganization; @@ -367,7 +367,7 @@ public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("okta_oin_client_id") public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { this.oktaOinClientId = Objects.requireNonNull(oktaOinClientId, "oktaOinClientId must not be null"); @@ -379,7 +379,7 @@ public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("admin_login_domain") public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { this.adminLoginDomain = Objects.requireNonNull(adminLoginDomain, "adminLoginDomain must not be null"); @@ -390,7 +390,7 @@ public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { *

The identifier of the published application in the OKTA OIN.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage oinSubmissionId(String oinSubmissionId) { this.oinSubmissionId = Optional.ofNullable(oinSubmissionId); return this; @@ -399,7 +399,7 @@ public _FinalStage oinSubmissionId(String oinSubmissionId) { /** *

The identifier of the published application in the OKTA OIN.

*/ - @Override + @java.lang.Override @JsonSetter(value = "oin_submission_id", nulls = Nulls.SKIP) public _FinalStage oinSubmissionId(Optional oinSubmissionId) { this.oinSubmissionId = oinSubmissionId; @@ -410,7 +410,7 @@ public _FinalStage oinSubmissionId(Optional oinSubmissionId) { *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage linkedClients(List linkedClients) { this.linkedClients = Optional.ofNullable(linkedClients); return this; @@ -419,14 +419,14 @@ public _FinalStage linkedClients(List linkedClients) /** *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

*/ - @Override + @java.lang.Override @JsonSetter(value = "linked_clients", nulls = Nulls.SKIP) public _FinalStage linkedClients(Optional> linkedClients) { this.linkedClients = linkedClients; return this; } - @Override + @java.lang.Override public ExpressConfiguration build() { return new ExpressConfiguration( initiateLoginUriTemplate, diff --git a/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java b/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java index 8a132de13..24fcd7f9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java +++ b/src/main/java/com/auth0/client/mgmt/types/ExpressConfigurationOrNull.java @@ -137,7 +137,7 @@ public Optional getOinSubmissionId() { return oinSubmissionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExpressConfigurationOrNull && equalTo((ExpressConfigurationOrNull) other); @@ -160,7 +160,7 @@ private boolean equalTo(ExpressConfigurationOrNull other) { && oinSubmissionId.equals(other.oinSubmissionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.initiateLoginUriTemplate, @@ -174,7 +174,7 @@ public int hashCode() { this.oinSubmissionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -285,7 +285,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ExpressConfigurationOrNull other) { initiateLoginUriTemplate(other.getInitiateLoginUriTemplate()); userAttributeProfileId(other.getUserAttributeProfileId()); @@ -304,7 +304,7 @@ public Builder from(ExpressConfigurationOrNull other) { *

The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("initiate_login_uri_template") public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String initiateLoginUriTemplate) { this.initiateLoginUriTemplate = @@ -317,7 +317,7 @@ public UserAttributeProfileIdStage initiateLoginUriTemplate(@NotNull String init *

The ID of the user attribute profile to use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_attribute_profile_id") public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttributeProfileId) { this.userAttributeProfileId = @@ -330,7 +330,7 @@ public ConnectionProfileIdStage userAttributeProfileId(@NotNull String userAttri *

The ID of the connection profile to use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_profile_id") public EnableClientStage connectionProfileId(@NotNull String connectionProfileId) { this.connectionProfileId = @@ -343,7 +343,7 @@ public EnableClientStage connectionProfileId(@NotNull String connectionProfileId *

When true, all connections made via express configuration will be enabled for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enable_client") public EnableOrganizationStage enableClient(boolean enableClient) { this.enableClient = enableClient; @@ -355,7 +355,7 @@ public EnableOrganizationStage enableClient(boolean enableClient) { *

When true, all connections made via express configuration will have the associated organization enabled.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enable_organization") public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { this.enableOrganization = enableOrganization; @@ -367,7 +367,7 @@ public OktaOinClientIdStage enableOrganization(boolean enableOrganization) { *

This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("okta_oin_client_id") public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { this.oktaOinClientId = Objects.requireNonNull(oktaOinClientId, "oktaOinClientId must not be null"); @@ -379,7 +379,7 @@ public AdminLoginDomainStage oktaOinClientId(@NotNull String oktaOinClientId) { *

This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("admin_login_domain") public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { this.adminLoginDomain = Objects.requireNonNull(adminLoginDomain, "adminLoginDomain must not be null"); @@ -390,7 +390,7 @@ public _FinalStage adminLoginDomain(@NotNull String adminLoginDomain) { *

The identifier of the published application in the OKTA OIN.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage oinSubmissionId(String oinSubmissionId) { this.oinSubmissionId = Optional.ofNullable(oinSubmissionId); return this; @@ -399,7 +399,7 @@ public _FinalStage oinSubmissionId(String oinSubmissionId) { /** *

The identifier of the published application in the OKTA OIN.

*/ - @Override + @java.lang.Override @JsonSetter(value = "oin_submission_id", nulls = Nulls.SKIP) public _FinalStage oinSubmissionId(Optional oinSubmissionId) { this.oinSubmissionId = oinSubmissionId; @@ -410,7 +410,7 @@ public _FinalStage oinSubmissionId(Optional oinSubmissionId) { *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage linkedClients(List linkedClients) { this.linkedClients = Optional.ofNullable(linkedClients); return this; @@ -419,14 +419,14 @@ public _FinalStage linkedClients(List linkedClients) /** *

List of client IDs that are linked to this express configuration (e.g. web or mobile clients).

*/ - @Override + @java.lang.Override @JsonSetter(value = "linked_clients", nulls = Nulls.SKIP) public _FinalStage linkedClients(Optional> linkedClients) { this.linkedClients = linkedClients; return this; } - @Override + @java.lang.Override public ExpressConfigurationOrNull build() { return new ExpressConfigurationOrNull( initiateLoginUriTemplate, diff --git a/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java index cb48ace18..6997e2fa5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/ExtensibilityEmailProviderCredentials.java @@ -21,7 +21,7 @@ private ExtensibilityEmailProviderCredentials(Map additionalProp this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExtensibilityEmailProviderCredentials; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java index e18329ae4..a80969430 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java +++ b/src/main/java/com/auth0/client/mgmt/types/FederatedConnectionTokenSet.java @@ -82,7 +82,7 @@ public Optional getLastUsedAt() { return lastUsedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FederatedConnectionTokenSet && equalTo((FederatedConnectionTokenSet) other); @@ -102,12 +102,12 @@ private boolean equalTo(FederatedConnectionTokenSet other) { && lastUsedAt.equals(other.lastUsedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.connection, this.scope, this.expiresAt, this.issuedAt, this.lastUsedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowAction.java b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java index 5afa83ae4..35d21213e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowAction.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowAction.java @@ -85,7 +85,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowAction && equalTo((FlowAction) other); @@ -95,12 +95,12 @@ private boolean equalTo(FlowAction other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -262,7 +262,7 @@ static final class Deserializer extends StdDeserializer { super(FlowAction.class); } - @Override + @java.lang.Override public FlowAction deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java index ea1832a54..06a370898 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaign.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaign && equalTo((FlowActionActivecampaign) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionActivecampaign other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionActivecampaignListContacts build() { return new FlowActionActivecampaignListContacts( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java index 51495cc4c..92b6b2466 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignListContactsParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignListContactsParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionActivecampaignListContactsParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionActivecampaignListContactsParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public FlowActionActivecampaignListContactsParams build() { return new FlowActionActivecampaignListContactsParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java index 627178d15..cbc6d5089 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContact.java @@ -83,7 +83,7 @@ public FlowActionActivecampaignUpsertContactParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignUpsertContact @@ -103,12 +103,12 @@ private boolean equalTo(FlowActionActivecampaignUpsertContact other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionActivecampaignUpsertContact other) { id(other.getId()); alias(other.getAlias()); @@ -170,60 +170,60 @@ public Builder from(FlowActionActivecampaignUpsertContact other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionActivecampaignUpsertContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionActivecampaignUpsertContact build() { return new FlowActionActivecampaignUpsertContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java index 2bc0a91d7..756f1d32e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionActivecampaignUpsertContactParams.java @@ -82,7 +82,7 @@ public Optional> getCustomFields() { return customFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionActivecampaignUpsertContactParams @@ -103,13 +103,13 @@ private boolean equalTo(FlowActionActivecampaignUpsertContactParams other) { && customFields.equals(other.customFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, this.email, this.firstName, this.lastName, this.phone, this.customFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionActivecampaignUpsertContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -178,73 +178,73 @@ public Builder from(FlowActionActivecampaignUpsertContactParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage customFields(Map customFields) { this.customFields = Optional.ofNullable(customFields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "custom_fields", nulls = Nulls.SKIP) public _FinalStage customFields(Optional> customFields) { this.customFields = customFields; return this; } - @Override + @java.lang.Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @Override + @java.lang.Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @Override + @java.lang.Override public _FinalStage lastName(String lastName) { this.lastName = Optional.ofNullable(lastName); return this; } - @Override + @java.lang.Override @JsonSetter(value = "last_name", nulls = Nulls.SKIP) public _FinalStage lastName(Optional lastName) { this.lastName = lastName; return this; } - @Override + @java.lang.Override public _FinalStage firstName(String firstName) { this.firstName = Optional.ofNullable(firstName); return this; } - @Override + @java.lang.Override @JsonSetter(value = "first_name", nulls = Nulls.SKIP) public _FinalStage firstName(Optional firstName) { this.firstName = firstName; return this; } - @Override + @java.lang.Override public FlowActionActivecampaignUpsertContactParams build() { return new FlowActionActivecampaignUpsertContactParams( connectionId, email, firstName, lastName, phone, customFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java index f25a27bde..c7d701ea4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtable.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtable && equalTo((FlowActionAirtable) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionAirtable other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionAirtable.class); } - @Override + @java.lang.Override public FlowActionAirtable deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java index 426e881b5..7bbf26861 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecord.java @@ -83,7 +83,7 @@ public FlowActionAirtableCreateRecordParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableCreateRecord && equalTo((FlowActionAirtableCreateRecord) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableCreateRecord other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableCreateRecord other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableCreateRecord other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableCreateRecordParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAirtableCreateRecord build() { return new FlowActionAirtableCreateRecord( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java index 6dae34843..1b77ec248 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableCreateRecordParams.java @@ -64,7 +64,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableCreateRecordParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionAirtableCreateRecordParams other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, BaseIdStage, Tab private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableCreateRecordParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -143,41 +143,41 @@ public Builder from(FlowActionAirtableCreateRecordParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("table_name") public _FinalStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public FlowActionAirtableCreateRecordParams build() { return new FlowActionAirtableCreateRecordParams( connectionId, baseId, tableName, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java index dfdde8e5d..22c909c64 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecords.java @@ -83,7 +83,7 @@ public FlowActionAirtableListRecordsParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableListRecords && equalTo((FlowActionAirtableListRecords) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableListRecords other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableListRecords other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableListRecords other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableListRecordsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAirtableListRecords build() { return new FlowActionAirtableListRecords(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java index a82ef5131..cf5310d9f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableListRecordsParams.java @@ -73,7 +73,7 @@ public Optional getView() { return view; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableListRecordsParams @@ -93,12 +93,12 @@ private boolean equalTo(FlowActionAirtableListRecordsParams other) { && view.equals(other.view); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.query, this.view); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,7 +150,7 @@ public static final class Builder implements ConnectionIdStage, BaseIdStage, Tab private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableListRecordsParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -160,54 +160,54 @@ public Builder from(FlowActionAirtableListRecordsParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("table_name") public _FinalStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage view(String view) { this.view = Optional.ofNullable(view); return this; } - @Override + @java.lang.Override @JsonSetter(value = "view", nulls = Nulls.SKIP) public _FinalStage view(Optional view) { this.view = view; return this; } - @Override + @java.lang.Override public _FinalStage query(String query) { this.query = Optional.ofNullable(query); return this; } - @Override + @java.lang.Override @JsonSetter(value = "query", nulls = Nulls.SKIP) public _FinalStage query(Optional query) { this.query = query; return this; } - @Override + @java.lang.Override public FlowActionAirtableListRecordsParams build() { return new FlowActionAirtableListRecordsParams( connectionId, baseId, tableName, query, view, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java index 4c280f1aa..5552a1253 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecord.java @@ -83,7 +83,7 @@ public FlowActionAirtableUpdateRecordParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableUpdateRecord && equalTo((FlowActionAirtableUpdateRecord) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAirtableUpdateRecord other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableUpdateRecord other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAirtableUpdateRecord other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAirtableUpdateRecordParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAirtableUpdateRecord build() { return new FlowActionAirtableUpdateRecord( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java index 0665ceb3e..cc9e72e32 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAirtableUpdateRecordParams.java @@ -73,7 +73,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAirtableUpdateRecordParams @@ -93,12 +93,12 @@ private boolean equalTo(FlowActionAirtableUpdateRecordParams other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.baseId, this.tableName, this.recordId, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -151,7 +151,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAirtableUpdateRecordParams other) { connectionId(other.getConnectionId()); baseId(other.getBaseId()); @@ -161,48 +161,48 @@ public Builder from(FlowActionAirtableUpdateRecordParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public BaseIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("base_id") public TableNameStage baseId(@NotNull String baseId) { this.baseId = Objects.requireNonNull(baseId, "baseId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("table_name") public RecordIdStage tableName(@NotNull String tableName) { this.tableName = Objects.requireNonNull(tableName, "tableName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("record_id") public _FinalStage recordId(@NotNull String recordId) { this.recordId = Objects.requireNonNull(recordId, "recordId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public FlowActionAirtableUpdateRecordParams build() { return new FlowActionAirtableUpdateRecordParams( connectionId, baseId, tableName, recordId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java index b8c5ae864..a5f1bf852 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0.java @@ -45,7 +45,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0 && equalTo((FlowActionAuth0) other); @@ -55,12 +55,12 @@ private boolean equalTo(FlowActionAuth0 other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -102,7 +102,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionAuth0.class); } - @Override + @java.lang.Override public FlowActionAuth0 deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java index fd7a95dce..3b812faf4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUser.java @@ -83,7 +83,7 @@ public FlowActionAuth0CreateUserParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0CreateUser && equalTo((FlowActionAuth0CreateUser) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0CreateUser other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0CreateUser other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0CreateUser other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0CreateUserParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAuth0CreateUser build() { return new FlowActionAuth0CreateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java index f48057ee0..adee48f44 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0CreateUserParams.java @@ -44,7 +44,7 @@ public Map getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0CreateUserParams && equalTo((FlowActionAuth0CreateUserParams) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionAuth0CreateUserParams other) { return connectionId.equals(other.connectionId) && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,27 +100,27 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0CreateUserParams other) { connectionId(other.getConnectionId()); payload(other.getPayload()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage payload(String key, Object value) { this.payload.put(key, value); return this; } - @Override + @java.lang.Override public _FinalStage putAllPayload(Map payload) { if (payload != null) { this.payload.putAll(payload); @@ -128,7 +128,7 @@ public _FinalStage putAllPayload(Map payload) { return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Map payload) { this.payload.clear(); @@ -138,7 +138,7 @@ public _FinalStage payload(Map payload) { return this; } - @Override + @java.lang.Override public FlowActionAuth0CreateUserParams build() { return new FlowActionAuth0CreateUserParams(connectionId, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java index a3a4abbf8..cb3818a12 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUser.java @@ -83,7 +83,7 @@ public FlowActionAuth0GetUserParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0GetUser && equalTo((FlowActionAuth0GetUser) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0GetUser other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0GetUser other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0GetUser other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0GetUserParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAuth0GetUser build() { return new FlowActionAuth0GetUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java index 0722bd5e1..6daecbc64 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0GetUserParams.java @@ -41,7 +41,7 @@ public String getUserId() { return userId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0GetUserParams && equalTo((FlowActionAuth0GetUserParams) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionAuth0GetUserParams other) { return connectionId.equals(other.connectionId) && userId.equals(other.userId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.userId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ConnectionIdStage, UserIdStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0GetUserParams other) { connectionId(other.getConnectionId()); userId(other.getUserId()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public UserIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override public FlowActionAuth0GetUserParams build() { return new FlowActionAuth0GetUserParams(connectionId, userId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java index ee6ea13ba..9a0d6aa3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmail.java @@ -83,7 +83,7 @@ public FlowActionAuth0SendEmailParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendEmail && equalTo((FlowActionAuth0SendEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0SendEmail other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0SendEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0SendEmail other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0SendEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAuth0SendEmail build() { return new FlowActionAuth0SendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java index 491149107..e5271bfc8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParams.java @@ -73,7 +73,7 @@ public Optional> getCustomVars() { return customVars; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendEmailParams && equalTo((FlowActionAuth0SendEmailParams) other); @@ -92,12 +92,12 @@ private boolean equalTo(FlowActionAuth0SendEmailParams other) { && customVars.equals(other.customVars); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.to, this.subject, this.body, this.customVars); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements ToStage, SubjectStage, BodyStage, _ private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0SendEmailParams other) { from(other.getFrom()); to(other.getTo()); @@ -159,54 +159,54 @@ public Builder from(FlowActionAuth0SendEmailParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("to") public SubjectStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("subject") public BodyStage subject(@NotNull String subject) { this.subject = Objects.requireNonNull(subject, "subject must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("body") public _FinalStage body(@NotNull String body) { this.body = Objects.requireNonNull(body, "body must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage customVars(Map customVars) { this.customVars = Optional.ofNullable(customVars); return this; } - @Override + @java.lang.Override @JsonSetter(value = "custom_vars", nulls = Nulls.SKIP) public _FinalStage customVars(Optional> customVars) { this.customVars = customVars; return this; } - @Override + @java.lang.Override public _FinalStage from(FlowActionAuth0SendEmailParamsFrom from) { this.from = Optional.ofNullable(from); return this; } - @Override + @java.lang.Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(Optional from) { this.from = from; return this; } - @Override + @java.lang.Override public FlowActionAuth0SendEmailParams build() { return new FlowActionAuth0SendEmailParams(from, to, subject, body, customVars, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java index af55a6509..e887fad68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendEmailParamsFrom.java @@ -44,7 +44,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendEmailParamsFrom @@ -60,12 +60,12 @@ private boolean equalTo(FlowActionAuth0SendEmailParamsFrom other) { return name.equals(other.name) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,34 +99,34 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0SendEmailParamsFrom other) { name(other.getName()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public FlowActionAuth0SendEmailParamsFrom build() { return new FlowActionAuth0SendEmailParamsFrom(name, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java index 7e25d6c4e..661c1e180 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequest.java @@ -83,7 +83,7 @@ public FlowActionAuth0SendRequestParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequest && equalTo((FlowActionAuth0SendRequest) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionAuth0SendRequest other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0SendRequest other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionAuth0SendRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionAuth0SendRequestParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAuth0SendRequest build() { return new FlowActionAuth0SendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java index fb691f00e..a8f5fd9a9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParams.java @@ -83,7 +83,7 @@ public Optional getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequestParams && equalTo((FlowActionAuth0SendRequestParams) other); @@ -103,12 +103,12 @@ private boolean equalTo(FlowActionAuth0SendRequestParams other) { && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.pathname, this.method, this.headers, this.params, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -168,7 +168,7 @@ public static final class Builder implements ConnectionIdStage, PathnameStage, _ private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0SendRequestParams other) { connectionId(other.getConnectionId()); pathname(other.getPathname()); @@ -179,41 +179,41 @@ public Builder from(FlowActionAuth0SendRequestParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public PathnameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("pathname") public _FinalStage pathname(@NotNull String pathname) { this.pathname = Objects.requireNonNull(pathname, "pathname must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage payload(FlowActionAuth0SendRequestParamsPayload payload) { this.payload = Optional.ofNullable(payload); return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional payload) { this.payload = payload; return this; } - @Override + @java.lang.Override public _FinalStage params( Map> params) { this.params = Optional.ofNullable(params); return this; } - @Override + @java.lang.Override @JsonSetter(value = "params", nulls = Nulls.SKIP) public _FinalStage params( Optional>> params) { @@ -221,33 +221,33 @@ public _FinalStage params( return this; } - @Override + @java.lang.Override public _FinalStage headers(Map headers) { this.headers = Optional.ofNullable(headers); return this; } - @Override + @java.lang.Override @JsonSetter(value = "headers", nulls = Nulls.SKIP) public _FinalStage headers(Optional> headers) { this.headers = headers; return this; } - @Override + @java.lang.Override public _FinalStage method(FlowActionAuth0SendRequestParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @Override + @java.lang.Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @Override + @java.lang.Override public FlowActionAuth0SendRequestParams build() { return new FlowActionAuth0SendRequestParams( connectionId, pathname, method, headers, params, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java index fedfaa075..56bd83eb8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsMethod.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionAuth0SendRequestParamsMethod && this.string.equals(((FlowActionAuth0SendRequestParamsMethod) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java index b32042d92..c88b6c5ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0SendRequestParamsPayload.java @@ -44,7 +44,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequestParamsPayload @@ -55,12 +55,12 @@ private boolean equalTo(FlowActionAuth0SendRequestParamsPayload other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -90,7 +90,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0SendRequestParamsQueryParamsValue @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionAuth0SendRequestParamsQueryParamsValue other) return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionAuth0UpdateUser build() { return new FlowActionAuth0UpdateUser(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java index cd3be1054..3d81255d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionAuth0UpdateUserParams.java @@ -52,7 +52,7 @@ public Map getChanges() { return changes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionAuth0UpdateUserParams && equalTo((FlowActionAuth0UpdateUserParams) other); @@ -67,12 +67,12 @@ private boolean equalTo(FlowActionAuth0UpdateUserParams other) { return connectionId.equals(other.connectionId) && userId.equals(other.userId) && changes.equals(other.changes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.userId, this.changes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -114,7 +114,7 @@ public static final class Builder implements ConnectionIdStage, UserIdStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionAuth0UpdateUserParams other) { connectionId(other.getConnectionId()); userId(other.getUserId()); @@ -122,27 +122,27 @@ public Builder from(FlowActionAuth0UpdateUserParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public UserIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage changes(String key, Object value) { this.changes.put(key, value); return this; } - @Override + @java.lang.Override public _FinalStage putAllChanges(Map changes) { if (changes != null) { this.changes.putAll(changes); @@ -150,7 +150,7 @@ public _FinalStage putAllChanges(Map changes) { return this; } - @Override + @java.lang.Override @JsonSetter(value = "changes", nulls = Nulls.SKIP) public _FinalStage changes(Map changes) { this.changes.clear(); @@ -160,7 +160,7 @@ public _FinalStage changes(Map changes) { return this; } - @Override + @java.lang.Override public FlowActionAuth0UpdateUserParams build() { return new FlowActionAuth0UpdateUserParams(connectionId, userId, changes, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java index eb570b822..2a291b96a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRows.java @@ -83,7 +83,7 @@ public FlowActionBigqueryInsertRowsParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionBigqueryInsertRows && equalTo((FlowActionBigqueryInsertRows) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionBigqueryInsertRows other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionBigqueryInsertRows other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionBigqueryInsertRows other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionBigqueryInsertRowsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionBigqueryInsertRows build() { return new FlowActionBigqueryInsertRows(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java index 53530434d..1dd56cd7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionBigqueryInsertRowsParams.java @@ -64,7 +64,7 @@ public Optional> getData() { return data; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionBigqueryInsertRowsParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionBigqueryInsertRowsParams other) { && data.equals(other.data); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.datasetId, this.tableId, this.data); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, DatasetIdStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionBigqueryInsertRowsParams other) { connectionId(other.getConnectionId()); datasetId(other.getDatasetId()); @@ -143,41 +143,41 @@ public Builder from(FlowActionBigqueryInsertRowsParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public DatasetIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("dataset_id") public TableIdStage datasetId(@NotNull String datasetId) { this.datasetId = Objects.requireNonNull(datasetId, "datasetId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("table_id") public _FinalStage tableId(@NotNull String tableId) { this.tableId = Objects.requireNonNull(tableId, "tableId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage data(Map data) { this.data = Optional.ofNullable(data); return this; } - @Override + @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional> data) { this.data = data; return this; } - @Override + @java.lang.Override public FlowActionBigqueryInsertRowsParams build() { return new FlowActionBigqueryInsertRowsParams(connectionId, datasetId, tableId, data, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java index 38f94bb79..1cc990a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbit.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbit && equalTo((FlowActionClearbit) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionClearbit other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionClearbit.class); } - @Override + @java.lang.Override public FlowActionClearbit deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java index dce2f7fe7..32dbae7f7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompany.java @@ -83,7 +83,7 @@ public FlowActionClearbitFindCompanyParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindCompany && equalTo((FlowActionClearbitFindCompany) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionClearbitFindCompany other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionClearbitFindCompany other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionClearbitFindCompany other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionClearbitFindCompanyParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionClearbitFindCompany build() { return new FlowActionClearbitFindCompany(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java index 04fe85fe7..de83605e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindCompanyParams.java @@ -42,7 +42,7 @@ public String getDomain() { return domain; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindCompanyParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionClearbitFindCompanyParams other) { return connectionId.equals(other.connectionId) && domain.equals(other.domain); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.domain); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, DomainStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionClearbitFindCompanyParams other) { connectionId(other.getConnectionId()); domain(other.getDomain()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public DomainStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("domain") public _FinalStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override public FlowActionClearbitFindCompanyParams build() { return new FlowActionClearbitFindCompanyParams(connectionId, domain, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java index b3ec8a351..ed02098c2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPerson.java @@ -83,7 +83,7 @@ public FlowActionClearbitFindPersonParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindPerson && equalTo((FlowActionClearbitFindPerson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionClearbitFindPerson other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionClearbitFindPerson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionClearbitFindPerson other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionClearbitFindPersonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionClearbitFindPerson build() { return new FlowActionClearbitFindPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java index 9b0a4a962..8c4cb50f3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionClearbitFindPersonParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionClearbitFindPersonParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionClearbitFindPersonParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionClearbitFindPersonParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public FlowActionClearbitFindPersonParams build() { return new FlowActionClearbitFindPersonParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java index c40e27a91..d4c2ebbc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmail.java @@ -83,7 +83,7 @@ public FlowActionEmailVerifyEmailParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmail && equalTo((FlowActionEmailVerifyEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionEmailVerifyEmail other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionEmailVerifyEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionEmailVerifyEmail other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionEmailVerifyEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionEmailVerifyEmail build() { return new FlowActionEmailVerifyEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java index 8dfcd7400..8a1714450 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParams.java @@ -46,7 +46,7 @@ public Optional getRules() { return rules; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmailParams && equalTo((FlowActionEmailVerifyEmailParams) other); @@ -61,12 +61,12 @@ private boolean equalTo(FlowActionEmailVerifyEmailParams other) { return email.equals(other.email) && rules.equals(other.rules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.email, this.rules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,34 +100,34 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionEmailVerifyEmailParams other) { email(other.getEmail()); rules(other.getRules()); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage rules(FlowActionEmailVerifyEmailParamsRules rules) { this.rules = Optional.ofNullable(rules); return this; } - @Override + @java.lang.Override @JsonSetter(value = "rules", nulls = Nulls.SKIP) public _FinalStage rules(Optional rules) { this.rules = rules; return this; } - @Override + @java.lang.Override public FlowActionEmailVerifyEmailParams build() { return new FlowActionEmailVerifyEmailParams(email, rules, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java index 5f4da51b1..77655741d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionEmailVerifyEmailParamsRules.java @@ -82,7 +82,7 @@ public Optional> getAllowlist() { return allowlist; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionEmailVerifyEmailParamsRules @@ -103,7 +103,7 @@ private boolean equalTo(FlowActionEmailVerifyEmailParamsRules other) { && allowlist.equals(other.allowlist); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.requireMxRecord, @@ -114,7 +114,7 @@ public int hashCode() { this.allowlist); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java index 375ac010d..1b493a483 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlow.java @@ -49,7 +49,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlow && equalTo((FlowActionFlow) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionFlow other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -118,7 +118,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionFlow.class); } - @Override + @java.lang.Override public FlowActionFlow deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java index 0f10dab51..d89b71bf6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanCondition.java @@ -83,7 +83,7 @@ public FlowActionFlowBooleanConditionParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowBooleanCondition && equalTo((FlowActionFlowBooleanCondition) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowBooleanCondition other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowBooleanCondition other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowBooleanCondition other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowBooleanConditionParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowBooleanCondition build() { return new FlowActionFlowBooleanCondition( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java index 94a29b570..43db6943a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowBooleanConditionParams.java @@ -46,7 +46,7 @@ public Optional> getElse() { return else_; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowBooleanConditionParams @@ -62,12 +62,12 @@ private boolean equalTo(FlowActionFlowBooleanConditionParams other) { return then.equals(other.then) && else_.equals(other.else_); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.then, this.else_); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java index 853fb42e1..412f9030a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlow.java @@ -83,7 +83,7 @@ public FlowActionFlowDelayFlowParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlow && equalTo((FlowActionFlowDelayFlow) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowDelayFlow other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowDelayFlow other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowDelayFlow other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowDelayFlowParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowDelayFlow build() { return new FlowActionFlowDelayFlow(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java index d4813f514..ba1cb36c2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParams.java @@ -46,7 +46,7 @@ public Optional getUnits() { return units; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlowParams && equalTo((FlowActionFlowDelayFlowParams) other); @@ -61,12 +61,12 @@ private boolean equalTo(FlowActionFlowDelayFlowParams other) { return number.equals(other.number) && units.equals(other.units); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.number, this.units); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,34 +100,34 @@ public static final class Builder implements NumberStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowDelayFlowParams other) { number(other.getNumber()); units(other.getUnits()); return this; } - @Override + @java.lang.Override @JsonSetter("number") public _FinalStage number(@NotNull FlowActionFlowDelayFlowParamsNumber number) { this.number = Objects.requireNonNull(number, "number must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage units(FlowActionFlowDelayFlowParamsUnits units) { this.units = Optional.ofNullable(units); return this; } - @Override + @java.lang.Override @JsonSetter(value = "units", nulls = Nulls.SKIP) public _FinalStage units(Optional units) { this.units = units; return this; } - @Override + @java.lang.Override public FlowActionFlowDelayFlowParams build() { return new FlowActionFlowDelayFlowParams(number, units, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java index 5ff39d7df..b552f5158 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDelayFlowParamsNumber.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDelayFlowParamsNumber @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionFlowDelayFlowParamsNumber other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDoNothing && equalTo((FlowActionFlowDoNothing) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowDoNothing other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowDoNothing other) { id(other.getId()); alias(other.getAlias()); @@ -169,66 +169,66 @@ public Builder from(FlowActionFlowDoNothing other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage params(FlowActionFlowDoNothingParams params) { this.params = Optional.ofNullable(params); return this; } - @Override + @java.lang.Override @JsonSetter(value = "params", nulls = Nulls.SKIP) public _FinalStage params(Optional params) { this.params = params; return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowDoNothing build() { return new FlowActionFlowDoNothing(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java index 492b2495d..35a08cb41 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowDoNothingParams.java @@ -21,7 +21,7 @@ private FlowActionFlowDoNothingParams(Map additionalProperties) this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowDoNothingParams; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java index ddd6f57d1..21366736d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessage.java @@ -83,7 +83,7 @@ public FlowActionFlowErrorMessageParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowErrorMessage && equalTo((FlowActionFlowErrorMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowErrorMessage other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowErrorMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowErrorMessage other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowErrorMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowErrorMessage build() { return new FlowActionFlowErrorMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java index 30abc34d4..0628fae3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowErrorMessageParams.java @@ -33,7 +33,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowErrorMessageParams && equalTo((FlowActionFlowErrorMessageParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionFlowErrorMessageParams other) { return message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements MessageStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowErrorMessageParams other) { message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @Override + @java.lang.Override public FlowActionFlowErrorMessageParams build() { return new FlowActionFlowErrorMessageParams(message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java index 7cdb82ac8..1f179c174 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValue.java @@ -83,7 +83,7 @@ public FlowActionFlowMapValueParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValue && equalTo((FlowActionFlowMapValue) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionFlowMapValue other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowMapValue other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionFlowMapValue other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionFlowMapValueParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowMapValue build() { return new FlowActionFlowMapValue(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java index a1fb7d4d7..850feaf73 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParams.java @@ -55,7 +55,7 @@ public Optional getFallback() { return fallback; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParams && equalTo((FlowActionFlowMapValueParams) other); @@ -70,12 +70,12 @@ private boolean equalTo(FlowActionFlowMapValueParams other) { return input.equals(other.input) && cases.equals(other.cases) && fallback.equals(other.fallback); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.input, this.cases, this.fallback); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements InputStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowMapValueParams other) { input(other.getInput()); cases(other.getCases()); @@ -123,40 +123,40 @@ public Builder from(FlowActionFlowMapValueParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("input") public _FinalStage input(@NotNull FlowActionFlowMapValueParamsInput input) { this.input = Objects.requireNonNull(input, "input must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fallback(FlowActionFlowMapValueParamsFallback fallback) { this.fallback = Optional.ofNullable(fallback); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fallback", nulls = Nulls.SKIP) public _FinalStage fallback(Optional fallback) { this.fallback = fallback; return this; } - @Override + @java.lang.Override public _FinalStage cases(Map cases) { this.cases = Optional.ofNullable(cases); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cases", nulls = Nulls.SKIP) public _FinalStage cases(Optional> cases) { this.cases = cases; return this; } - @Override + @java.lang.Override public FlowActionFlowMapValueParams build() { return new FlowActionFlowMapValueParams(input, cases, fallback, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java index 83124005e..48a01b9d9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowMapValueParamsFallback.java @@ -46,7 +46,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParamsFallback @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionFlowMapValueParamsFallback other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -98,7 +98,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowMapValueParamsInput && equalTo((FlowActionFlowMapValueParamsInput) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowMapValueParamsInput other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowReturnJson build() { return new FlowActionFlowReturnJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java index 06ef61ff9..c80f080fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParams.java @@ -34,7 +34,7 @@ public FlowActionFlowReturnJsonParamsPayload getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowReturnJsonParams && equalTo((FlowActionFlowReturnJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowReturnJsonParams other) { return payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements PayloadStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionFlowReturnJsonParams other) { payload(other.getPayload()); return this; } - @Override + @java.lang.Override @JsonSetter("payload") public _FinalStage payload(@NotNull FlowActionFlowReturnJsonParamsPayload payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @Override + @java.lang.Override public FlowActionFlowReturnJsonParams build() { return new FlowActionFlowReturnJsonParams(payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java index 4519d3ced..098c68e40 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowReturnJsonParamsPayload.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowReturnJsonParamsPayload @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionFlowReturnJsonParamsPayload other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionFlowStoreVars build() { return new FlowActionFlowStoreVars(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java index 253e70304..41ccaa29f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionFlowStoreVarsParams.java @@ -34,7 +34,7 @@ public Map getVars() { return vars; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionFlowStoreVarsParams && equalTo((FlowActionFlowStoreVarsParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionFlowStoreVarsParams other) { return vars.equals(other.vars); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.vars); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java index dd785e332..1f2612825 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRow.java @@ -83,7 +83,7 @@ public FlowActionGoogleSheetsAddRowParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRow && equalTo((FlowActionGoogleSheetsAddRow) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRow other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionGoogleSheetsAddRow other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionGoogleSheetsAddRow other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionGoogleSheetsAddRowParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionGoogleSheetsAddRow build() { return new FlowActionGoogleSheetsAddRow(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java index bd73a8107..38924b194 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParams.java @@ -66,7 +66,7 @@ public Optional>> getValues() { return values; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRowParams @@ -85,12 +85,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRowParams other) { && values.equals(other.values); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.spreadsheetId, this.sheetId, this.values); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -136,7 +136,7 @@ public static final class Builder implements ConnectionIdStage, SpreadsheetIdSta private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionGoogleSheetsAddRowParams other) { connectionId(other.getConnectionId()); spreadsheetId(other.getSpreadsheetId()); @@ -145,47 +145,47 @@ public Builder from(FlowActionGoogleSheetsAddRowParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public SpreadsheetIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("spreadsheet_id") public _FinalStage spreadsheetId(@NotNull String spreadsheetId) { this.spreadsheetId = Objects.requireNonNull(spreadsheetId, "spreadsheetId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage values(List> values) { this.values = Optional.ofNullable(values); return this; } - @Override + @java.lang.Override @JsonSetter(value = "values", nulls = Nulls.SKIP) public _FinalStage values(Optional>> values) { this.values = values; return this; } - @Override + @java.lang.Override public _FinalStage sheetId(FlowActionGoogleSheetsAddRowParamsSheetId sheetId) { this.sheetId = Optional.ofNullable(sheetId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sheet_id", nulls = Nulls.SKIP) public _FinalStage sheetId(Optional sheetId) { this.sheetId = sheetId; return this; } - @Override + @java.lang.Override public FlowActionGoogleSheetsAddRowParams build() { return new FlowActionGoogleSheetsAddRowParams( connectionId, spreadsheetId, sheetId, values, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java index 9b34d492a..f7e4f5065 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionGoogleSheetsAddRowParamsSheetId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionGoogleSheetsAddRowParamsSheetId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionGoogleSheetsAddRowParamsSheetId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionHttpSendRequest build() { return new FlowActionHttpSendRequest(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java index 10b80a9ed..b239b21ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParams.java @@ -101,7 +101,7 @@ public Optional getContentType() { return contentType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParams && equalTo((FlowActionHttpSendRequestParams) other); @@ -123,7 +123,7 @@ private boolean equalTo(FlowActionHttpSendRequestParams other) { && contentType.equals(other.contentType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -136,7 +136,7 @@ public int hashCode() { this.contentType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHttpSendRequestParams other) { connectionId(other.getConnectionId()); url(other.getUrl()); @@ -221,47 +221,47 @@ public Builder from(FlowActionHttpSendRequestParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage contentType(FlowActionHttpSendRequestParamsContentType contentType) { this.contentType = Optional.ofNullable(contentType); return this; } - @Override + @java.lang.Override @JsonSetter(value = "content_type", nulls = Nulls.SKIP) public _FinalStage contentType(Optional contentType) { this.contentType = contentType; return this; } - @Override + @java.lang.Override public _FinalStage payload(FlowActionHttpSendRequestParamsPayload payload) { this.payload = Optional.ofNullable(payload); return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional payload) { this.payload = payload; return this; } - @Override + @java.lang.Override public _FinalStage params( Map> params) { this.params = Optional.ofNullable(params); return this; } - @Override + @java.lang.Override @JsonSetter(value = "params", nulls = Nulls.SKIP) public _FinalStage params( Optional>> params) { @@ -269,59 +269,59 @@ public _FinalStage params( return this; } - @Override + @java.lang.Override public _FinalStage basic(FlowActionHttpSendRequestParamsBasicAuth basic) { this.basic = Optional.ofNullable(basic); return this; } - @Override + @java.lang.Override @JsonSetter(value = "basic", nulls = Nulls.SKIP) public _FinalStage basic(Optional basic) { this.basic = basic; return this; } - @Override + @java.lang.Override public _FinalStage headers(Map headers) { this.headers = Optional.ofNullable(headers); return this; } - @Override + @java.lang.Override @JsonSetter(value = "headers", nulls = Nulls.SKIP) public _FinalStage headers(Optional> headers) { this.headers = headers; return this; } - @Override + @java.lang.Override public _FinalStage method(FlowActionHttpSendRequestParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @Override + @java.lang.Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @Override + @java.lang.Override public FlowActionHttpSendRequestParams build() { return new FlowActionHttpSendRequestParams( connectionId, url, method, headers, basic, params, payload, contentType, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java index 3b21b6f26..fae9be90b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsBasicAuth.java @@ -43,7 +43,7 @@ public Optional getPassword() { return password; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParamsBasicAuth @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionHttpSendRequestParamsBasicAuth other) { return username.equals(other.username) && password.equals(other.password); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.username, this.password); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java index 636aa34a8..f612ad7a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsContentType.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionHttpSendRequestParamsContentType && this.string.equals(((FlowActionHttpSendRequestParamsContentType) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java index 677641a7b..63fda3fa3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsMethod.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionHttpSendRequestParamsMethod && this.string.equals(((FlowActionHttpSendRequestParamsMethod) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java index 48436a45a..1e96478b4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHttpSendRequestParamsPayload.java @@ -44,7 +44,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParamsPayload @@ -55,12 +55,12 @@ private boolean equalTo(FlowActionHttpSendRequestParamsPayload other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -90,7 +90,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHttpSendRequestParamsQueryParamsValue @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionHttpSendRequestParamsQueryParamsValue other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspot && equalTo((FlowActionHubspot) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionHubspot other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionHubspot.class); } - @Override + @java.lang.Override public FlowActionHubspot deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java index 1d24ee26a..b688e5d73 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContact.java @@ -83,7 +83,7 @@ public FlowActionHubspotEnrollContactParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContact && equalTo((FlowActionHubspotEnrollContact) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionHubspotEnrollContact other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotEnrollContact other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionHubspotEnrollContact other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionHubspotEnrollContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionHubspotEnrollContact build() { return new FlowActionHubspotEnrollContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java index f987cf3bb..aa2769440 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParams.java @@ -53,7 +53,7 @@ public FlowActionHubspotEnrollContactParamsWorkflowId getWorkflowId() { return workflowId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContactParams @@ -71,12 +71,12 @@ private boolean equalTo(FlowActionHubspotEnrollContactParams other) { && workflowId.equals(other.workflowId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email, this.workflowId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +116,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, Work private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotEnrollContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -124,28 +124,28 @@ public Builder from(FlowActionHubspotEnrollContactParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public WorkflowIdStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("workflow_id") public _FinalStage workflowId(@NotNull FlowActionHubspotEnrollContactParamsWorkflowId workflowId) { this.workflowId = Objects.requireNonNull(workflowId, "workflowId must not be null"); return this; } - @Override + @java.lang.Override public FlowActionHubspotEnrollContactParams build() { return new FlowActionHubspotEnrollContactParams(connectionId, email, workflowId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java index 061437406..bcd188307 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotEnrollContactParamsWorkflowId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotEnrollContactParamsWorkflowId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionHubspotEnrollContactParamsWorkflowId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionHubspotGetContact build() { return new FlowActionHubspotGetContact(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java index 501f598ed..40b575938 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotGetContactParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotGetContactParams && equalTo((FlowActionHubspotGetContactParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionHubspotGetContactParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotGetContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public FlowActionHubspotGetContactParams build() { return new FlowActionHubspotGetContactParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java index 72c0a2bfd..2b51e4da8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContact.java @@ -83,7 +83,7 @@ public FlowActionHubspotUpsertContactParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContact && equalTo((FlowActionHubspotUpsertContact) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionHubspotUpsertContact other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotUpsertContact other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionHubspotUpsertContact other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionHubspotUpsertContactParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionHubspotUpsertContact build() { return new FlowActionHubspotUpsertContact( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java index da3626093..8546cd868 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParams.java @@ -56,7 +56,7 @@ public Optional> getPropertie return properties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContactParams @@ -74,12 +74,12 @@ private boolean equalTo(FlowActionHubspotUpsertContactParams other) { && properties.equals(other.properties); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email, this.properties); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -119,7 +119,7 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotUpsertContactParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); @@ -127,34 +127,34 @@ public Builder from(FlowActionHubspotUpsertContactParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage properties(List properties) { this.properties = Optional.ofNullable(properties); return this; } - @Override + @java.lang.Override @JsonSetter(value = "properties", nulls = Nulls.SKIP) public _FinalStage properties(Optional> properties) { this.properties = properties; return this; } - @Override + @java.lang.Override public FlowActionHubspotUpsertContactParams build() { return new FlowActionHubspotUpsertContactParams(connectionId, email, properties, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java index 2633142e7..bb07959cb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionHubspotUpsertContactParamsProperty.java @@ -33,7 +33,7 @@ public String getProperty() { return property; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionHubspotUpsertContactParamsProperty @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionHubspotUpsertContactParamsProperty other) { return property.equals(other.property); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.property); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements PropertyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionHubspotUpsertContactParamsProperty other) { property(other.getProperty()); return this; } - @Override + @java.lang.Override @JsonSetter("property") public _FinalStage property(@NotNull String property) { this.property = Objects.requireNonNull(property, "property must not be null"); return this; } - @Override + @java.lang.Override public FlowActionHubspotUpsertContactParamsProperty build() { return new FlowActionHubspotUpsertContactParamsProperty(property, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java index e22ee0ba7..5d6e9ce3a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJson.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJson && equalTo((FlowActionJson) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionJson other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionJson.class); } - @Override + @java.lang.Override public FlowActionJson deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java index c99272af5..0f8951b2f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJson.java @@ -83,7 +83,7 @@ public FlowActionJsonCreateJsonParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonCreateJson && equalTo((FlowActionJsonCreateJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonCreateJson other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJsonCreateJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonCreateJson other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonCreateJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJsonCreateJson build() { return new FlowActionJsonCreateJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java index 2617bc981..0bd6dd71b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonCreateJsonParams.java @@ -34,7 +34,7 @@ public Map getObject() { return object; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonCreateJsonParams && equalTo((FlowActionJsonCreateJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionJsonCreateJsonParams other) { return object.equals(other.object); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.object); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java index e421566a9..aee15d7f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJson.java @@ -83,7 +83,7 @@ public FlowActionJsonParseJsonParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonParseJson && equalTo((FlowActionJsonParseJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonParseJson other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJsonParseJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonParseJson other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonParseJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJsonParseJson build() { return new FlowActionJsonParseJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java index b20384d9a..6f743bdff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonParseJsonParams.java @@ -33,7 +33,7 @@ public String getJson() { return json; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonParseJsonParams && equalTo((FlowActionJsonParseJsonParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionJsonParseJsonParams other) { return json.equals(other.json); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.json); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements JsonStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJsonParseJsonParams other) { json(other.getJson()); return this; } - @Override + @java.lang.Override @JsonSetter("json") public _FinalStage json(@NotNull String json) { this.json = Objects.requireNonNull(json, "json must not be null"); return this; } - @Override + @java.lang.Override public FlowActionJsonParseJsonParams build() { return new FlowActionJsonParseJsonParams(json, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java index d1eba8bfb..bf71ecfe0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJson.java @@ -83,7 +83,7 @@ public FlowActionJsonSerializeJsonParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJson && equalTo((FlowActionJsonSerializeJson) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJsonSerializeJson other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJsonSerializeJson other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJsonSerializeJson other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJsonSerializeJsonParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJsonSerializeJson build() { return new FlowActionJsonSerializeJson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java index 89d3e7f68..2bea64bc7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParams.java @@ -34,7 +34,7 @@ public FlowActionJsonSerializeJsonParamsObject getObject() { return object; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJsonParams && equalTo((FlowActionJsonSerializeJsonParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionJsonSerializeJsonParams other) { return object.equals(other.object); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.object); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ObjectStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJsonSerializeJsonParams other) { object(other.getObject()); return this; } - @Override + @java.lang.Override @JsonSetter("object") public _FinalStage object(@NotNull FlowActionJsonSerializeJsonParamsObject object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } - @Override + @java.lang.Override public FlowActionJsonSerializeJsonParams build() { return new FlowActionJsonSerializeJsonParams(object, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java index 2b01d91e9..9c541d00d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJsonSerializeJsonParamsObject.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJsonSerializeJsonParamsObject @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionJsonSerializeJsonParamsObject other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwt && equalTo((FlowActionJwt) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionJwt other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionJwt.class); } - @Override + @java.lang.Override public FlowActionJwt deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java index 01a8cf2d3..38f602e1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtDecodeJwtParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtDecodeJwt && equalTo((FlowActionJwtDecodeJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtDecodeJwt other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtDecodeJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtDecodeJwt other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtDecodeJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJwtDecodeJwt build() { return new FlowActionJwtDecodeJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java index a15d852b8..22f6e8c87 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtDecodeJwtParams.java @@ -33,7 +33,7 @@ public String getToken() { return token; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtDecodeJwtParams && equalTo((FlowActionJwtDecodeJwtParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionJwtDecodeJwtParams other) { return token.equals(other.token); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.token); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TokenStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtDecodeJwtParams other) { token(other.getToken()); return this; } - @Override + @java.lang.Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @Override + @java.lang.Override public FlowActionJwtDecodeJwtParams build() { return new FlowActionJwtDecodeJwtParams(token, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java index 9bec36b0e..632957aa5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtSignJwtParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtSignJwt && equalTo((FlowActionJwtSignJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtSignJwt other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtSignJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtSignJwt other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtSignJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJwtSignJwt build() { return new FlowActionJwtSignJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java index 8c054f8d2..5ad501846 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtSignJwtParams.java @@ -82,7 +82,7 @@ public Optional getExpiresIn() { return expiresIn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtSignJwtParams && equalTo((FlowActionJwtSignJwtParams) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtSignJwtParams other) { && expiresIn.equals(other.expiresIn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.payload, this.subject, this.issuer, this.audience, this.expiresIn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -165,7 +165,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtSignJwtParams other) { connectionId(other.getConnectionId()); payload(other.getPayload()); @@ -176,79 +176,79 @@ public Builder from(FlowActionJwtSignJwtParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage expiresIn(String expiresIn) { this.expiresIn = Optional.ofNullable(expiresIn); return this; } - @Override + @java.lang.Override @JsonSetter(value = "expires_in", nulls = Nulls.SKIP) public _FinalStage expiresIn(Optional expiresIn) { this.expiresIn = expiresIn; return this; } - @Override + @java.lang.Override public _FinalStage audience(String audience) { this.audience = Optional.ofNullable(audience); return this; } - @Override + @java.lang.Override @JsonSetter(value = "audience", nulls = Nulls.SKIP) public _FinalStage audience(Optional audience) { this.audience = audience; return this; } - @Override + @java.lang.Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = Optional.ofNullable(subject); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(Optional subject) { this.subject = subject; return this; } - @Override + @java.lang.Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @Override + @java.lang.Override public FlowActionJwtSignJwtParams build() { return new FlowActionJwtSignJwtParams( connectionId, payload, subject, issuer, audience, expiresIn, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java index a7e7c5270..85e31f3db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwt.java @@ -83,7 +83,7 @@ public FlowActionJwtVerifyJwtParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtVerifyJwt && equalTo((FlowActionJwtVerifyJwt) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionJwtVerifyJwt other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtVerifyJwt other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionJwtVerifyJwt other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionJwtVerifyJwtParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionJwtVerifyJwt build() { return new FlowActionJwtVerifyJwt(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java index 0e5766a0c..07475c20d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionJwtVerifyJwtParams.java @@ -64,7 +64,7 @@ public Optional getIssuer() { return issuer; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionJwtVerifyJwtParams && equalTo((FlowActionJwtVerifyJwtParams) other); @@ -82,12 +82,12 @@ private boolean equalTo(FlowActionJwtVerifyJwtParams other) { && issuer.equals(other.issuer); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.token, this.audience, this.issuer); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements ConnectionIdStage, TokenStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionJwtVerifyJwtParams other) { connectionId(other.getConnectionId()); token(other.getToken()); @@ -142,47 +142,47 @@ public Builder from(FlowActionJwtVerifyJwtParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public TokenStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage issuer(String issuer) { this.issuer = Optional.ofNullable(issuer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "issuer", nulls = Nulls.SKIP) public _FinalStage issuer(Optional issuer) { this.issuer = issuer; return this; } - @Override + @java.lang.Override public _FinalStage audience(String audience) { this.audience = Optional.ofNullable(audience); return this; } - @Override + @java.lang.Override @JsonSetter(value = "audience", nulls = Nulls.SKIP) public _FinalStage audience(Optional audience) { this.audience = audience; return this; } - @Override + @java.lang.Override public FlowActionJwtVerifyJwtParams build() { return new FlowActionJwtVerifyJwtParams(connectionId, token, audience, issuer, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java index 64d1e8e13..bce1f293c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMember.java @@ -83,7 +83,7 @@ public FlowActionMailchimpUpsertMemberParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMember && equalTo((FlowActionMailchimpUpsertMember) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMember other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionMailchimpUpsertMember other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionMailchimpUpsertMember other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionMailchimpUpsertMemberParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionMailchimpUpsertMember build() { return new FlowActionMailchimpUpsertMember( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java index a65a69234..c4bc155d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParams.java @@ -53,7 +53,7 @@ public FlowActionMailchimpUpsertMemberParamsMember getMember() { return member; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMemberParams @@ -69,12 +69,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMemberParams other) { return connectionId.equals(other.connectionId) && listId.equals(other.listId) && member.equals(other.member); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.listId, this.member); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -114,7 +114,7 @@ public static final class Builder implements ConnectionIdStage, ListIdStage, Mem private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionMailchimpUpsertMemberParams other) { connectionId(other.getConnectionId()); listId(other.getListId()); @@ -122,28 +122,28 @@ public Builder from(FlowActionMailchimpUpsertMemberParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public ListIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("list_id") public MemberStage listId(@NotNull String listId) { this.listId = Objects.requireNonNull(listId, "listId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("member") public _FinalStage member(@NotNull FlowActionMailchimpUpsertMemberParamsMember member) { this.member = Objects.requireNonNull(member, "member must not be null"); return this; } - @Override + @java.lang.Override public FlowActionMailchimpUpsertMemberParams build() { return new FlowActionMailchimpUpsertMemberParams(connectionId, listId, member, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java index 0e7958dcd..e69b9a8de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailchimpUpsertMemberParamsMember.java @@ -55,7 +55,7 @@ public Optional> getMergeFields() { return mergeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailchimpUpsertMemberParamsMember @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionMailchimpUpsertMemberParamsMember other) { && mergeFields.equals(other.mergeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.emailAddress, this.statusIfNew, this.mergeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements EmailAddressStage, StatusIfNewStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionMailchimpUpsertMemberParamsMember other) { emailAddress(other.getEmailAddress()); statusIfNew(other.getStatusIfNew()); @@ -126,34 +126,34 @@ public Builder from(FlowActionMailchimpUpsertMemberParamsMember other) { return this; } - @Override + @java.lang.Override @JsonSetter("email_address") public StatusIfNewStage emailAddress(@NotNull String emailAddress) { this.emailAddress = Objects.requireNonNull(emailAddress, "emailAddress must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status_if_new") public _FinalStage statusIfNew(@NotNull String statusIfNew) { this.statusIfNew = Objects.requireNonNull(statusIfNew, "statusIfNew must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage mergeFields(Map mergeFields) { this.mergeFields = Optional.ofNullable(mergeFields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "merge_fields", nulls = Nulls.SKIP) public _FinalStage mergeFields(Optional> mergeFields) { this.mergeFields = mergeFields; return this; } - @Override + @java.lang.Override public FlowActionMailchimpUpsertMemberParamsMember build() { return new FlowActionMailchimpUpsertMemberParamsMember( emailAddress, statusIfNew, mergeFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java index fc83af473..9c0a997bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmail.java @@ -83,7 +83,7 @@ public FlowActionMailjetSendEmailParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmail && equalTo((FlowActionMailjetSendEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionMailjetSendEmail other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionMailjetSendEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionMailjetSendEmail other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionMailjetSendEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionMailjetSendEmail build() { return new FlowActionMailjetSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java index 050c95af5..405efb196 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionMailjetSendEmailParams.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmailParams && equalTo((FlowActionMailjetSendEmailParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionMailjetSendEmailParams other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer> getVariables() { return variables; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionMailjetSendEmailParamsTemplateId @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionMailjetSendEmailParamsTemplateId other) { return templateId == other.templateId && variables.equals(other.variables); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.templateId, this.variables); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements TemplateIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionMailjetSendEmailParamsTemplateId other) { templateId(other.getTemplateId()); variables(other.getVariables()); return this; } - @Override + @java.lang.Override @JsonSetter("template_id") public _FinalStage templateId(int templateId) { this.templateId = templateId; return this; } - @Override + @java.lang.Override public _FinalStage variables(Map variables) { this.variables = Optional.ofNullable(variables); return this; } - @Override + @java.lang.Override @JsonSetter(value = "variables", nulls = Nulls.SKIP) public _FinalStage variables(Optional> variables) { this.variables = variables; return this; } - @Override + @java.lang.Override public FlowActionMailjetSendEmailParamsTemplateId build() { return new FlowActionMailjetSendEmailParamsTemplateId(templateId, variables, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java index 16621e91f..11e628e90 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtp.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtp && equalTo((FlowActionOtp) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionOtp other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionOtp.class); } - @Override + @java.lang.Override public FlowActionOtp deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java index c6809d0b4..f147bd7cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCode.java @@ -83,7 +83,7 @@ public FlowActionOtpGenerateCodeParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpGenerateCode && equalTo((FlowActionOtpGenerateCode) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionOtpGenerateCode other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionOtpGenerateCode other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionOtpGenerateCode other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionOtpGenerateCodeParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionOtpGenerateCode build() { return new FlowActionOtpGenerateCode(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java index f9accf1d3..dde8d51e0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpGenerateCodeParams.java @@ -41,7 +41,7 @@ public int getLength() { return length; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpGenerateCodeParams && equalTo((FlowActionOtpGenerateCodeParams) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionOtpGenerateCodeParams other) { return reference.equals(other.reference) && length == other.length; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.reference, this.length); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ReferenceStage, LengthStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionOtpGenerateCodeParams other) { reference(other.getReference()); length(other.getLength()); return this; } - @Override + @java.lang.Override @JsonSetter("reference") public LengthStage reference(@NotNull String reference) { this.reference = Objects.requireNonNull(reference, "reference must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("length") public _FinalStage length(int length) { this.length = length; return this; } - @Override + @java.lang.Override public FlowActionOtpGenerateCodeParams build() { return new FlowActionOtpGenerateCodeParams(reference, length, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java index 72d77a600..5582a1ccd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCode.java @@ -83,7 +83,7 @@ public FlowActionOtpVerifyCodeParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCode && equalTo((FlowActionOtpVerifyCode) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionOtpVerifyCode other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionOtpVerifyCode other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionOtpVerifyCode other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionOtpVerifyCodeParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionOtpVerifyCode build() { return new FlowActionOtpVerifyCode(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java index d10a1beb7..c1640f8df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParams.java @@ -42,7 +42,7 @@ public FlowActionOtpVerifyCodeParamsCode getCode() { return code; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCodeParams && equalTo((FlowActionOtpVerifyCodeParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionOtpVerifyCodeParams other) { return reference.equals(other.reference) && code.equals(other.code); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.reference, this.code); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ReferenceStage, CodeStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionOtpVerifyCodeParams other) { reference(other.getReference()); code(other.getCode()); return this; } - @Override + @java.lang.Override @JsonSetter("reference") public CodeStage reference(@NotNull String reference) { this.reference = Objects.requireNonNull(reference, "reference must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("code") public _FinalStage code(@NotNull FlowActionOtpVerifyCodeParamsCode code) { this.code = Objects.requireNonNull(code, "code must not be null"); return this; } - @Override + @java.lang.Override public FlowActionOtpVerifyCodeParams build() { return new FlowActionOtpVerifyCodeParams(reference, code, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java index b4403f823..2f215ddef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionOtpVerifyCodeParamsCode.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionOtpVerifyCodeParamsCode && equalTo((FlowActionOtpVerifyCodeParamsCode) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionOtpVerifyCodeParamsCode other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedrive && equalTo((FlowActionPipedrive) other); @@ -51,12 +51,12 @@ private boolean equalTo(FlowActionPipedrive other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionPipedrive.class); } - @Override + @java.lang.Override public FlowActionPipedrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java index ff572dae7..9d561c2e5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDeal.java @@ -83,7 +83,7 @@ public FlowActionPipedriveAddDealParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDeal && equalTo((FlowActionPipedriveAddDeal) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionPipedriveAddDeal other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionPipedriveAddDeal other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionPipedriveAddDeal other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionPipedriveAddDealParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddDeal build() { return new FlowActionPipedriveAddDeal(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java index 242e92dce..86d44f911 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParams.java @@ -100,7 +100,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParams && equalTo((FlowActionPipedriveAddDealParams) other); @@ -122,7 +122,7 @@ private boolean equalTo(FlowActionPipedriveAddDealParams other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -135,7 +135,7 @@ public int hashCode() { this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -205,7 +205,7 @@ public static final class Builder implements ConnectionIdStage, TitleStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionPipedriveAddDealParams other) { connectionId(other.getConnectionId()); title(other.getTitle()); @@ -218,99 +218,99 @@ public Builder from(FlowActionPipedriveAddDealParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public TitleStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("title") public _FinalStage title(@NotNull String title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public _FinalStage stageId(FlowActionPipedriveAddDealParamsStageId stageId) { this.stageId = Optional.ofNullable(stageId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "stage_id", nulls = Nulls.SKIP) public _FinalStage stageId(Optional stageId) { this.stageId = stageId; return this; } - @Override + @java.lang.Override public _FinalStage organizationId(FlowActionPipedriveAddDealParamsOrganizationId organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @Override + @java.lang.Override public _FinalStage personId(FlowActionPipedriveAddDealParamsPersonId personId) { this.personId = Optional.ofNullable(personId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "person_id", nulls = Nulls.SKIP) public _FinalStage personId(Optional personId) { this.personId = personId; return this; } - @Override + @java.lang.Override public _FinalStage userId(FlowActionPipedriveAddDealParamsUserId userId) { this.userId = Optional.ofNullable(userId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_id", nulls = Nulls.SKIP) public _FinalStage userId(Optional userId) { this.userId = userId; return this; } - @Override + @java.lang.Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @Override + @java.lang.Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddDealParams build() { return new FlowActionPipedriveAddDealParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java index f6d6e820a..a54e34bdd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddDealParamsOrganizationId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsOrganizationId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsOrganizationId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsPersonId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsPersonId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsStageId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsStageId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddDealParamsUserId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddDealParamsUserId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddOrganization build() { return new FlowActionPipedriveAddOrganization( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java index 61177fb66..cd4e79869 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParams.java @@ -64,7 +64,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddOrganizationParams @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionPipedriveAddOrganizationParams other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.name, this.ownerId, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements ConnectionIdStage, NameStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionPipedriveAddOrganizationParams other) { connectionId(other.getConnectionId()); name(other.getName()); @@ -143,47 +143,47 @@ public Builder from(FlowActionPipedriveAddOrganizationParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public NameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public _FinalStage ownerId(FlowActionPipedriveAddOrganizationParamsOwnerId ownerId) { this.ownerId = Optional.ofNullable(ownerId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) public _FinalStage ownerId(Optional ownerId) { this.ownerId = ownerId; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddOrganizationParams build() { return new FlowActionPipedriveAddOrganizationParams( connectionId, name, ownerId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java index db3360f8d..b194e4aef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddOrganizationParamsOwnerId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddOrganizationParamsOwnerId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddOrganizationParamsOwnerId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddPerson build() { return new FlowActionPipedriveAddPerson(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java index 5e2488775..27226c9ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParams.java @@ -91,7 +91,7 @@ public Optional> getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParams @@ -113,13 +113,13 @@ private boolean equalTo(FlowActionPipedriveAddPersonParams other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, this.name, this.email, this.phone, this.ownerId, this.organizationId, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -183,7 +183,7 @@ public static final class Builder implements ConnectionIdStage, NameStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionPipedriveAddPersonParams other) { connectionId(other.getConnectionId()); name(other.getName()); @@ -195,86 +195,86 @@ public Builder from(FlowActionPipedriveAddPersonParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public NameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(Map fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional> fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public _FinalStage organizationId(FlowActionPipedriveAddPersonParamsOrganizationId organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } - @Override + @java.lang.Override public _FinalStage ownerId(FlowActionPipedriveAddPersonParamsOwnerId ownerId) { this.ownerId = Optional.ofNullable(ownerId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) public _FinalStage ownerId(Optional ownerId) { this.ownerId = ownerId; return this; } - @Override + @java.lang.Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @Override + @java.lang.Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public FlowActionPipedriveAddPersonParams build() { return new FlowActionPipedriveAddPersonParams( connectionId, name, email, phone, ownerId, organizationId, fields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java index 9c9723da0..2a6aae3b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionPipedriveAddPersonParamsOrganizationId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParamsOrganizationId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddPersonParamsOrganizationId other) return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionPipedriveAddPersonParamsOwnerId @@ -50,12 +50,12 @@ private boolean equalTo(FlowActionPipedriveAddPersonParamsOwnerId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforce && equalTo((FlowActionSalesforce) other); @@ -53,12 +53,12 @@ private boolean equalTo(FlowActionSalesforce other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -94,7 +94,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionSalesforce.class); } - @Override + @java.lang.Override public FlowActionSalesforce deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java index d8dac2a6a..72fa7df7a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceCreateLeadParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceCreateLead && equalTo((FlowActionSalesforceCreateLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceCreateLead other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceCreateLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceCreateLead other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceCreateLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSalesforceCreateLead build() { return new FlowActionSalesforceCreateLead( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java index a96ba12f4..65a1ab1e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceCreateLeadParams.java @@ -91,7 +91,7 @@ public Optional> getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceCreateLeadParams @@ -113,13 +113,13 @@ private boolean equalTo(FlowActionSalesforceCreateLeadParams other) { && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, this.firstName, this.lastName, this.company, this.email, this.phone, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -183,7 +183,7 @@ public static final class Builder implements ConnectionIdStage, LastNameStage, C private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceCreateLeadParams other) { connectionId(other.getConnectionId()); firstName(other.getFirstName()); @@ -195,80 +195,80 @@ public Builder from(FlowActionSalesforceCreateLeadParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public LastNameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("last_name") public CompanyStage lastName(@NotNull String lastName) { this.lastName = Objects.requireNonNull(lastName, "lastName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("company") public _FinalStage company(@NotNull String company) { this.company = Objects.requireNonNull(company, "company must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @Override + @java.lang.Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @Override + @java.lang.Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public _FinalStage firstName(String firstName) { this.firstName = Optional.ofNullable(firstName); return this; } - @Override + @java.lang.Override @JsonSetter(value = "first_name", nulls = Nulls.SKIP) public _FinalStage firstName(Optional firstName) { this.firstName = firstName; return this; } - @Override + @java.lang.Override public FlowActionSalesforceCreateLeadParams build() { return new FlowActionSalesforceCreateLeadParams( connectionId, firstName, lastName, company, email, phone, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java index 76dc21f1c..c2d1c8a14 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceGetLeadParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceGetLead && equalTo((FlowActionSalesforceGetLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceGetLead other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceGetLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceGetLead other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceGetLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSalesforceGetLead build() { return new FlowActionSalesforceGetLead(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java index 19e0caa4f..e6cd077ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceGetLeadParams.java @@ -42,7 +42,7 @@ public String getLeadId() { return leadId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceGetLeadParams && equalTo((FlowActionSalesforceGetLeadParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionSalesforceGetLeadParams other) { return connectionId.equals(other.connectionId) && leadId.equals(other.leadId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.leadId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, LeadIdStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceGetLeadParams other) { connectionId(other.getConnectionId()); leadId(other.getLeadId()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public LeadIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("lead_id") public _FinalStage leadId(@NotNull String leadId) { this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); return this; } - @Override + @java.lang.Override public FlowActionSalesforceGetLeadParams build() { return new FlowActionSalesforceGetLeadParams(connectionId, leadId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java index ac6cb456d..76a9ea2b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeads.java @@ -83,7 +83,7 @@ public FlowActionSalesforceSearchLeadsParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceSearchLeads && equalTo((FlowActionSalesforceSearchLeads) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceSearchLeads other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceSearchLeads other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceSearchLeads other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceSearchLeadsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSalesforceSearchLeads build() { return new FlowActionSalesforceSearchLeads( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java index 66f311f4a..aedef7c4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParams.java @@ -65,7 +65,7 @@ public List getLeadFields() { return leadFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceSearchLeadsParams @@ -84,12 +84,12 @@ private boolean equalTo(FlowActionSalesforceSearchLeadsParams other) { && leadFields.equals(other.leadFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.searchField, this.searchValue, this.leadFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -137,7 +137,7 @@ public static final class Builder implements ConnectionIdStage, SearchFieldStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceSearchLeadsParams other) { connectionId(other.getConnectionId()); searchField(other.getSearchField()); @@ -146,28 +146,28 @@ public Builder from(FlowActionSalesforceSearchLeadsParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public SearchFieldStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("search_field") public SearchValueStage searchField(@NotNull FlowActionSalesforceSearchLeadsParamsSearchField searchField) { this.searchField = Objects.requireNonNull(searchField, "searchField must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("search_value") public _FinalStage searchValue(@NotNull String searchValue) { this.searchValue = Objects.requireNonNull(searchValue, "searchValue must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage addAllLeadFields(List leadFields) { if (leadFields != null) { this.leadFields.addAll(leadFields); @@ -175,13 +175,13 @@ public _FinalStage addAllLeadFields(List leadFields) { return this; } - @Override + @java.lang.Override public _FinalStage addLeadFields(String leadFields) { this.leadFields.add(leadFields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "lead_fields", nulls = Nulls.SKIP) public _FinalStage leadFields(List leadFields) { this.leadFields.clear(); @@ -191,7 +191,7 @@ public _FinalStage leadFields(List leadFields) { return this; } - @Override + @java.lang.Override public FlowActionSalesforceSearchLeadsParams build() { return new FlowActionSalesforceSearchLeadsParams( connectionId, searchField, searchValue, leadFields, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java index ae94d7d48..e0a4c7c75 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceSearchLeadsParamsSearchField.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionSalesforceSearchLeadsParamsSearchField && this.string.equals(((FlowActionSalesforceSearchLeadsParamsSearchField) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java index da08ade4e..e1a6bca9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLead.java @@ -83,7 +83,7 @@ public FlowActionSalesforceUpdateLeadParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceUpdateLead && equalTo((FlowActionSalesforceUpdateLead) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSalesforceUpdateLead other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceUpdateLead other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSalesforceUpdateLead other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSalesforceUpdateLeadParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSalesforceUpdateLead build() { return new FlowActionSalesforceUpdateLead( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java index ba9b61460..1cbcaf10a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSalesforceUpdateLeadParams.java @@ -55,7 +55,7 @@ public Optional> getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSalesforceUpdateLeadParams @@ -71,12 +71,12 @@ private boolean equalTo(FlowActionSalesforceUpdateLeadParams other) { return connectionId.equals(other.connectionId) && leadId.equals(other.leadId) && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.leadId, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +116,7 @@ public static final class Builder implements ConnectionIdStage, LeadIdStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSalesforceUpdateLeadParams other) { connectionId(other.getConnectionId()); leadId(other.getLeadId()); @@ -124,34 +124,34 @@ public Builder from(FlowActionSalesforceUpdateLeadParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public LeadIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("lead_id") public _FinalStage leadId(@NotNull String leadId) { this.leadId = Objects.requireNonNull(leadId, "leadId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage payload(Map payload) { this.payload = Optional.ofNullable(payload); return this; } - @Override + @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional> payload) { this.payload = payload; return this; } - @Override + @java.lang.Override public FlowActionSalesforceUpdateLeadParams build() { return new FlowActionSalesforceUpdateLeadParams(connectionId, leadId, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java index 90d4bb5b0..742b08315 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmail.java @@ -83,7 +83,7 @@ public FlowActionSendgridSendEmailParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmail && equalTo((FlowActionSendgridSendEmail) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSendgridSendEmail other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSendgridSendEmail other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSendgridSendEmail other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSendgridSendEmailParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSendgridSendEmail build() { return new FlowActionSendgridSendEmail(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java index 8e34bc8d8..6fed0ff60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParams.java @@ -56,7 +56,7 @@ public List getPersonalizations() { return personalizations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmailParams && equalTo((FlowActionSendgridSendEmailParams) other); @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionSendgridSendEmailParams other) { && personalizations.equals(other.personalizations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.personalizations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -120,7 +120,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSendgridSendEmailParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -128,21 +128,21 @@ public Builder from(FlowActionSendgridSendEmailParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("from") public _FinalStage from(@NotNull FlowActionSendgridSendEmailParamsPerson from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage addAllPersonalizations(List personalizations) { if (personalizations != null) { this.personalizations.addAll(personalizations); @@ -150,13 +150,13 @@ public _FinalStage addAllPersonalizations(List personalizations) { return this; } - @Override + @java.lang.Override public _FinalStage addPersonalizations(Object personalizations) { this.personalizations.add(personalizations); return this; } - @Override + @java.lang.Override @JsonSetter(value = "personalizations", nulls = Nulls.SKIP) public _FinalStage personalizations(List personalizations) { this.personalizations.clear(); @@ -166,7 +166,7 @@ public _FinalStage personalizations(List personalizations) { return this; } - @Override + @java.lang.Override public FlowActionSendgridSendEmailParams build() { return new FlowActionSendgridSendEmailParams(connectionId, from, personalizations, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java index 20535cbb1..17c898bcd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSendgridSendEmailParamsPerson.java @@ -44,7 +44,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSendgridSendEmailParamsPerson @@ -60,12 +60,12 @@ private boolean equalTo(FlowActionSendgridSendEmailParamsPerson other) { return name.equals(other.name) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,34 +99,34 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSendgridSendEmailParamsPerson other) { name(other.getName()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public FlowActionSendgridSendEmailParamsPerson build() { return new FlowActionSendgridSendEmailParamsPerson(name, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java index b0772e875..ef3240398 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessage.java @@ -83,7 +83,7 @@ public FlowActionSlackPostMessageParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessage && equalTo((FlowActionSlackPostMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionSlackPostMessage other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSlackPostMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionSlackPostMessage other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionSlackPostMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionSlackPostMessage build() { return new FlowActionSlackPostMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java index 421741cfb..06aa70c05 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParams.java @@ -56,7 +56,7 @@ public Optional> getAttachments return attachments; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParams && equalTo((FlowActionSlackPostMessageParams) other); @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionSlackPostMessageParams other) { && attachments.equals(other.attachments); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.text, this.attachments); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSlackPostMessageParams other) { connectionId(other.getConnectionId()); text(other.getText()); @@ -126,40 +126,40 @@ public Builder from(FlowActionSlackPostMessageParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage attachments(List attachments) { this.attachments = Optional.ofNullable(attachments); return this; } - @Override + @java.lang.Override @JsonSetter(value = "attachments", nulls = Nulls.SKIP) public _FinalStage attachments(Optional> attachments) { this.attachments = attachments; return this; } - @Override + @java.lang.Override public _FinalStage text(String text) { this.text = Optional.ofNullable(text); return this; } - @Override + @java.lang.Override @JsonSetter(value = "text", nulls = Nulls.SKIP) public _FinalStage text(Optional text) { this.text = text; return this; } - @Override + @java.lang.Override public FlowActionSlackPostMessageParams build() { return new FlowActionSlackPostMessageParams(connectionId, text, attachments, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java index ba6b1db31..ab9ae9bad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachment.java @@ -64,7 +64,7 @@ public Optional> getFields return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParamsAttachment @@ -83,12 +83,12 @@ private boolean equalTo(FlowActionSlackPostMessageParamsAttachment other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.color, this.pretext, this.text, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java index a6d66b3dc..842a7764b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentColor.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionSlackPostMessageParamsAttachmentColor && this.string.equals(((FlowActionSlackPostMessageParamsAttachmentColor) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java index 213fb5ab9..51cacf5ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionSlackPostMessageParamsAttachmentField.java @@ -52,7 +52,7 @@ public Optional getShort() { return short_; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionSlackPostMessageParamsAttachmentField @@ -68,12 +68,12 @@ private boolean equalTo(FlowActionSlackPostMessageParamsAttachmentField other) { return title.equals(other.title) && value.equals(other.value) && short_.equals(other.short_); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.title, this.value, this.short_); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -113,7 +113,7 @@ public static final class Builder implements TitleStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionSlackPostMessageParamsAttachmentField other) { title(other.getTitle()); value(other.getValue()); @@ -121,40 +121,40 @@ public Builder from(FlowActionSlackPostMessageParamsAttachmentField other) { return this; } - @Override + @java.lang.Override @JsonSetter("title") public _FinalStage title(@NotNull String title) { this.title = Objects.requireNonNull(title, "title must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage short_(Boolean short_) { this.short_ = Optional.ofNullable(short_); return this; } - @Override + @java.lang.Override @JsonSetter(value = "short", nulls = Nulls.SKIP) public _FinalStage short_(Optional short_) { this.short_ = short_; return this; } - @Override + @java.lang.Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @Override + @java.lang.Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @Override + @java.lang.Override public FlowActionSlackPostMessageParamsAttachmentField build() { return new FlowActionSlackPostMessageParamsAttachmentField(title, value, short_, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java index ca67a0aa2..6496bccf0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripe.java @@ -49,7 +49,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripe && equalTo((FlowActionStripe) other); @@ -59,12 +59,12 @@ private boolean equalTo(FlowActionStripe other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -118,7 +118,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionStripe.class); } - @Override + @java.lang.Override public FlowActionStripe deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java index 05fa311b2..f98da2789 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxId.java @@ -83,7 +83,7 @@ public FlowActionStripeAddTaxIdParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddTaxId && equalTo((FlowActionStripeAddTaxId) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeAddTaxId other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeAddTaxId other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeAddTaxId other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeAddTaxIdParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeAddTaxId build() { return new FlowActionStripeAddTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java index 37d410d93..dd86ca001 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddTaxIdParams.java @@ -62,7 +62,7 @@ public String getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddTaxIdParams && equalTo((FlowActionStripeAddTaxIdParams) other); @@ -80,12 +80,12 @@ private boolean equalTo(FlowActionStripeAddTaxIdParams other) { && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.type, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +132,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeAddTaxIdParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -141,35 +141,35 @@ public Builder from(FlowActionStripeAddTaxIdParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("customer_id") public TypeStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override public FlowActionStripeAddTaxIdParams build() { return new FlowActionStripeAddTaxIdParams(connectionId, customerId, type, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java index 9c413d927..f4eabdc3b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeAddress.java @@ -81,7 +81,7 @@ public Optional getCountry() { return country; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeAddress && equalTo((FlowActionStripeAddress) other); @@ -101,12 +101,12 @@ private boolean equalTo(FlowActionStripeAddress other) { && country.equals(other.country); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.line1, this.line2, this.postalCode, this.city, this.state, this.country); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java index 6161b948e..4249a817e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeCreateCustomerParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreateCustomer && equalTo((FlowActionStripeCreateCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeCreateCustomer other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeCreateCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeCreateCustomer other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeCreateCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeCreateCustomer build() { return new FlowActionStripeCreateCustomer( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java index 5edc54066..bf853a780 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreateCustomerParams.java @@ -109,7 +109,7 @@ public Optional> getMetadata() { return metadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreateCustomerParams @@ -133,7 +133,7 @@ private boolean equalTo(FlowActionStripeCreateCustomerParams other) { && metadata.equals(other.metadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -147,7 +147,7 @@ public int hashCode() { this.metadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -223,7 +223,7 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeCreateCustomerParams other) { connectionId(other.getConnectionId()); taxId(other.getTaxId()); @@ -237,118 +237,118 @@ public Builder from(FlowActionStripeCreateCustomerParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage metadata(Map metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional> metadata) { this.metadata = metadata; return this; } - @Override + @java.lang.Override public _FinalStage address(FlowActionStripeAddress address) { this.address = Optional.ofNullable(address); return this; } - @Override + @java.lang.Override @JsonSetter(value = "address", nulls = Nulls.SKIP) public _FinalStage address(Optional address) { this.address = address; return this; } - @Override + @java.lang.Override public _FinalStage taxExempt(String taxExempt) { this.taxExempt = Optional.ofNullable(taxExempt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) public _FinalStage taxExempt(Optional taxExempt) { this.taxExempt = taxExempt; return this; } - @Override + @java.lang.Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @Override + @java.lang.Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; } - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage taxId(FlowActionStripeTaxId taxId) { this.taxId = Optional.ofNullable(taxId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tax_id", nulls = Nulls.SKIP) public _FinalStage taxId(Optional taxId) { this.taxId = taxId; return this; } - @Override + @java.lang.Override public FlowActionStripeCreateCustomerParams build() { return new FlowActionStripeCreateCustomerParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java index 4d8263dc1..2ec512cc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSession.java @@ -83,7 +83,7 @@ public FlowActionStripeCreatePortalSessionParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreatePortalSession @@ -103,12 +103,12 @@ private boolean equalTo(FlowActionStripeCreatePortalSession other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeCreatePortalSession other) { id(other.getId()); alias(other.getAlias()); @@ -170,60 +170,60 @@ public Builder from(FlowActionStripeCreatePortalSession other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeCreatePortalSessionParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeCreatePortalSession build() { return new FlowActionStripeCreatePortalSession( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java index c1402a9bc..77748d777 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeCreatePortalSessionParams.java @@ -55,7 +55,7 @@ public Optional getReturnUrl() { return returnUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeCreatePortalSessionParams @@ -73,12 +73,12 @@ private boolean equalTo(FlowActionStripeCreatePortalSessionParams other) { && returnUrl.equals(other.returnUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.returnUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -118,7 +118,7 @@ public static final class Builder implements ConnectionIdStage, CustomerIdStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeCreatePortalSessionParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -126,34 +126,34 @@ public Builder from(FlowActionStripeCreatePortalSessionParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("customer_id") public _FinalStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage returnUrl(String returnUrl) { this.returnUrl = Optional.ofNullable(returnUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "return_url", nulls = Nulls.SKIP) public _FinalStage returnUrl(Optional returnUrl) { this.returnUrl = returnUrl; return this; } - @Override + @java.lang.Override public FlowActionStripeCreatePortalSessionParams build() { return new FlowActionStripeCreatePortalSessionParams( connectionId, customerId, returnUrl, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java index 22dfb10b7..a7b0ad519 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxId.java @@ -83,7 +83,7 @@ public FlowActionStripeDeleteTaxIdParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeDeleteTaxId && equalTo((FlowActionStripeDeleteTaxId) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeDeleteTaxId other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeDeleteTaxId other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeDeleteTaxId other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeDeleteTaxIdParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeDeleteTaxId build() { return new FlowActionStripeDeleteTaxId(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java index db40599d0..f180442cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeDeleteTaxIdParams.java @@ -50,7 +50,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeDeleteTaxIdParams && equalTo((FlowActionStripeDeleteTaxIdParams) other); @@ -65,12 +65,12 @@ private boolean equalTo(FlowActionStripeDeleteTaxIdParams other) { return connectionId.equals(other.connectionId) && customerId.equals(other.customerId) && id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.customerId, this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements ConnectionIdStage, CustomerIdStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeDeleteTaxIdParams other) { connectionId(other.getConnectionId()); customerId(other.getCustomerId()); @@ -118,28 +118,28 @@ public Builder from(FlowActionStripeDeleteTaxIdParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public CustomerIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("customer_id") public IdStage customerId(@NotNull String customerId) { this.customerId = Objects.requireNonNull(customerId, "customerId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public FlowActionStripeDeleteTaxIdParams build() { return new FlowActionStripeDeleteTaxIdParams(connectionId, customerId, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java index 77db9b3da..7012c5db5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomers.java @@ -83,7 +83,7 @@ public FlowActionStripeFindCustomersParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeFindCustomers && equalTo((FlowActionStripeFindCustomers) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeFindCustomers other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeFindCustomers other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeFindCustomers other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeFindCustomersParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeFindCustomers build() { return new FlowActionStripeFindCustomers(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java index 4220b498c..3d72d5a63 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeFindCustomersParams.java @@ -42,7 +42,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeFindCustomersParams @@ -58,12 +58,12 @@ private boolean equalTo(FlowActionStripeFindCustomersParams other) { return connectionId.equals(other.connectionId) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements ConnectionIdStage, EmailStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeFindCustomersParams other) { connectionId(other.getConnectionId()); email(other.getEmail()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public EmailStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public FlowActionStripeFindCustomersParams build() { return new FlowActionStripeFindCustomersParams(connectionId, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java index 3aa2c1341..2d6edbdf1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeGetCustomerParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeGetCustomer && equalTo((FlowActionStripeGetCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeGetCustomer other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeGetCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeGetCustomer other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeGetCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeGetCustomer build() { return new FlowActionStripeGetCustomer(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java index 3c479c07c..0964cf72c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeGetCustomerParams.java @@ -42,7 +42,7 @@ public String getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeGetCustomerParams && equalTo((FlowActionStripeGetCustomerParams) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowActionStripeGetCustomerParams other) { return connectionId.equals(other.connectionId) && id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements ConnectionIdStage, IdStage, _FinalS private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeGetCustomerParams other) { connectionId(other.getConnectionId()); id(other.getId()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public IdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public FlowActionStripeGetCustomerParams build() { return new FlowActionStripeGetCustomerParams(connectionId, id, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java index 63b4f3b36..195ec6824 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeTaxId.java @@ -41,7 +41,7 @@ public String getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeTaxId && equalTo((FlowActionStripeTaxId) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowActionStripeTaxId other) { return type.equals(other.type) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements TypeStage, ValueStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeTaxId other) { type(other.getType()); value(other.getValue()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ValueStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override public FlowActionStripeTaxId build() { return new FlowActionStripeTaxId(type, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java index 443c843b4..c05a51589 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomer.java @@ -83,7 +83,7 @@ public FlowActionStripeUpdateCustomerParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeUpdateCustomer && equalTo((FlowActionStripeUpdateCustomer) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionStripeUpdateCustomer other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeUpdateCustomer other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionStripeUpdateCustomer other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionStripeUpdateCustomerParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionStripeUpdateCustomer build() { return new FlowActionStripeUpdateCustomer( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java index 1abbb5180..8e48c2502 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionStripeUpdateCustomerParams.java @@ -109,7 +109,7 @@ public Optional> getMetadata() { return metadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionStripeUpdateCustomerParams @@ -133,7 +133,7 @@ private boolean equalTo(FlowActionStripeUpdateCustomerParams other) { && metadata.equals(other.metadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -147,7 +147,7 @@ public int hashCode() { this.metadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -223,7 +223,7 @@ public static final class Builder implements ConnectionIdStage, IdStage, _FinalS private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionStripeUpdateCustomerParams other) { connectionId(other.getConnectionId()); id(other.getId()); @@ -237,112 +237,112 @@ public Builder from(FlowActionStripeUpdateCustomerParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public IdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage metadata(Map metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional> metadata) { this.metadata = metadata; return this; } - @Override + @java.lang.Override public _FinalStage address(FlowActionStripeAddress address) { this.address = Optional.ofNullable(address); return this; } - @Override + @java.lang.Override @JsonSetter(value = "address", nulls = Nulls.SKIP) public _FinalStage address(Optional address) { this.address = address; return this; } - @Override + @java.lang.Override public _FinalStage taxExempt(String taxExempt) { this.taxExempt = Optional.ofNullable(taxExempt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tax_exempt", nulls = Nulls.SKIP) public _FinalStage taxExempt(Optional taxExempt) { this.taxExempt = taxExempt; return this; } - @Override + @java.lang.Override public _FinalStage phone(String phone) { this.phone = Optional.ofNullable(phone); return this; } - @Override + @java.lang.Override @JsonSetter(value = "phone", nulls = Nulls.SKIP) public _FinalStage phone(Optional phone) { this.phone = phone; return this; } - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; } - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; return this; } - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; } - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public FlowActionStripeUpdateCustomerParams build() { return new FlowActionStripeUpdateCustomerParams( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java index da164f53d..6d0962853 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessage.java @@ -83,7 +83,7 @@ public FlowActionTelegramSendMessageParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTelegramSendMessage && equalTo((FlowActionTelegramSendMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTelegramSendMessage other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTelegramSendMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTelegramSendMessage other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTelegramSendMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionTelegramSendMessage build() { return new FlowActionTelegramSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java index ab234a98c..d33f13ad6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTelegramSendMessageParams.java @@ -50,7 +50,7 @@ public String getText() { return text; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTelegramSendMessageParams @@ -66,12 +66,12 @@ private boolean equalTo(FlowActionTelegramSendMessageParams other) { return connectionId.equals(other.connectionId) && chatId.equals(other.chatId) && text.equals(other.text); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.chatId, this.text); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements ConnectionIdStage, ChatIdStage, Tex private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTelegramSendMessageParams other) { connectionId(other.getConnectionId()); chatId(other.getChatId()); @@ -119,28 +119,28 @@ public Builder from(FlowActionTelegramSendMessageParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public ChatIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("chat_id") public TextStage chatId(@NotNull String chatId) { this.chatId = Objects.requireNonNull(chatId, "chatId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @Override + @java.lang.Override public FlowActionTelegramSendMessageParams build() { return new FlowActionTelegramSendMessageParams(connectionId, chatId, text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java index ada1c8ca1..7f91ca908 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilio.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilio && equalTo((FlowActionTwilio) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionTwilio other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionTwilio.class); } - @Override + @java.lang.Override public FlowActionTwilio deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java index 885c2458a..d13fd2629 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCall.java @@ -83,7 +83,7 @@ public FlowActionTwilioMakeCallParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioMakeCall && equalTo((FlowActionTwilioMakeCall) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTwilioMakeCall other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTwilioMakeCall other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTwilioMakeCall other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTwilioMakeCallParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionTwilioMakeCall build() { return new FlowActionTwilioMakeCall(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java index 1897e82af..8d4aa1b6c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioMakeCallParams.java @@ -58,7 +58,7 @@ public String getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioMakeCallParams && equalTo((FlowActionTwilioMakeCallParams) other); @@ -76,12 +76,12 @@ private boolean equalTo(FlowActionTwilioMakeCallParams other) { && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.to, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, ToSta private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTwilioMakeCallParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -136,35 +136,35 @@ public Builder from(FlowActionTwilioMakeCallParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("from") public ToStage from(@NotNull String from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("to") public PayloadStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("payload") public _FinalStage payload(@NotNull String payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @Override + @java.lang.Override public FlowActionTwilioMakeCallParams build() { return new FlowActionTwilioMakeCallParams(connectionId, from, to, payload, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java index e41324c2a..2005828de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSms.java @@ -83,7 +83,7 @@ public FlowActionTwilioSendSmsParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioSendSms && equalTo((FlowActionTwilioSendSms) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionTwilioSendSms other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTwilioSendSms other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionTwilioSendSms other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionTwilioSendSmsParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionTwilioSendSms build() { return new FlowActionTwilioSendSms(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java index cb38f8bbc..0cce55f3c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionTwilioSendSmsParams.java @@ -58,7 +58,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionTwilioSendSmsParams && equalTo((FlowActionTwilioSendSmsParams) other); @@ -76,12 +76,12 @@ private boolean equalTo(FlowActionTwilioSendSmsParams other) { && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.from, this.to, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -127,7 +127,7 @@ public static final class Builder implements ConnectionIdStage, FromStage, ToSta private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionTwilioSendSmsParams other) { connectionId(other.getConnectionId()); from(other.getFrom()); @@ -136,35 +136,35 @@ public Builder from(FlowActionTwilioSendSmsParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public FromStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("from") public ToStage from(@NotNull String from) { this.from = Objects.requireNonNull(from, "from must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("to") public MessageStage to(@NotNull String to) { this.to = Objects.requireNonNull(to, "to must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(@NotNull String message) { this.message = Objects.requireNonNull(message, "message must not be null"); return this; } - @Override + @java.lang.Override public FlowActionTwilioSendSmsParams build() { return new FlowActionTwilioSendSmsParams(connectionId, from, to, message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java index 64c0935d4..d0172e7b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessage.java @@ -83,7 +83,7 @@ public FlowActionWhatsappSendMessageParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessage && equalTo((FlowActionWhatsappSendMessage) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionWhatsappSendMessage other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionWhatsappSendMessage other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionWhatsappSendMessage other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionWhatsappSendMessageParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionWhatsappSendMessage build() { return new FlowActionWhatsappSendMessage(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java index 9ceb0ea7d..18fd44671 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParams.java @@ -71,7 +71,7 @@ public FlowActionWhatsappSendMessageParamsPayload getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessageParams @@ -91,12 +91,12 @@ private boolean equalTo(FlowActionWhatsappSendMessageParams other) { && payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.senderId, this.recipientNumber, this.type, this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionWhatsappSendMessageParams other) { connectionId(other.getConnectionId()); senderId(other.getSenderId()); @@ -159,42 +159,42 @@ public Builder from(FlowActionWhatsappSendMessageParams other) { return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public SenderIdStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("sender_id") public RecipientNumberStage senderId(@NotNull String senderId) { this.senderId = Objects.requireNonNull(senderId, "senderId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("recipient_number") public TypeStage recipientNumber(@NotNull String recipientNumber) { this.recipientNumber = Objects.requireNonNull(recipientNumber, "recipientNumber must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public PayloadStage type(@NotNull FlowActionWhatsappSendMessageParamsType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("payload") public _FinalStage payload(@NotNull FlowActionWhatsappSendMessageParamsPayload payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } - @Override + @java.lang.Override public FlowActionWhatsappSendMessageParams build() { return new FlowActionWhatsappSendMessageParams( connectionId, senderId, recipientNumber, type, payload, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java index 9fae01ddb..ad46169cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionWhatsappSendMessageParamsPayload.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionWhatsappSendMessageParamsPayload @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionWhatsappSendMessageParamsPayload other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXml && equalTo((FlowActionXml) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionXml other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(FlowActionXml.class); } - @Override + @java.lang.Override public FlowActionXml deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java index 2bea78b46..e543c01ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXml.java @@ -83,7 +83,7 @@ public FlowActionXmlParseXmlParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlParseXml && equalTo((FlowActionXmlParseXml) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionXmlParseXml other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionXmlParseXml other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionXmlParseXml other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionXmlParseXmlParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionXmlParseXml build() { return new FlowActionXmlParseXml(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java index 1cf122ee0..9c97b5312 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlParseXmlParams.java @@ -33,7 +33,7 @@ public String getXml() { return xml; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlParseXmlParams && equalTo((FlowActionXmlParseXmlParams) other); @@ -48,12 +48,12 @@ private boolean equalTo(FlowActionXmlParseXmlParams other) { return xml.equals(other.xml); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.xml); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements XmlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionXmlParseXmlParams other) { xml(other.getXml()); return this; } - @Override + @java.lang.Override @JsonSetter("xml") public _FinalStage xml(@NotNull String xml) { this.xml = Objects.requireNonNull(xml, "xml must not be null"); return this; } - @Override + @java.lang.Override public FlowActionXmlParseXmlParams build() { return new FlowActionXmlParseXmlParams(xml, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java index 96313102d..bbe425904 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXml.java @@ -83,7 +83,7 @@ public FlowActionXmlSerializeXmlParams getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXml && equalTo((FlowActionXmlSerializeXml) other); @@ -102,12 +102,12 @@ private boolean equalTo(FlowActionXmlSerializeXml other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.allowFailure, this.maskOutput, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder implements IdStage, ParamsStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionXmlSerializeXml other) { id(other.getId()); alias(other.getAlias()); @@ -169,60 +169,60 @@ public Builder from(FlowActionXmlSerializeXml other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ParamsStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("params") public _FinalStage params(@NotNull FlowActionXmlSerializeXmlParams params) { this.params = Objects.requireNonNull(params, "params must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maskOutput(Boolean maskOutput) { this.maskOutput = Optional.ofNullable(maskOutput); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mask_output", nulls = Nulls.SKIP) public _FinalStage maskOutput(Optional maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionXmlSerializeXml build() { return new FlowActionXmlSerializeXml(id, alias, allowFailure, maskOutput, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java index e17310edb..f061b36a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParams.java @@ -34,7 +34,7 @@ public FlowActionXmlSerializeXmlParamsObject getObject() { return object; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXmlParams && equalTo((FlowActionXmlSerializeXmlParams) other); @@ -49,12 +49,12 @@ private boolean equalTo(FlowActionXmlSerializeXmlParams other) { return object.equals(other.object); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.object); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ObjectStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionXmlSerializeXmlParams other) { object(other.getObject()); return this; } - @Override + @java.lang.Override @JsonSetter("object") public _FinalStage object(@NotNull FlowActionXmlSerializeXmlParamsObject object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } - @Override + @java.lang.Override public FlowActionXmlSerializeXmlParams build() { return new FlowActionXmlSerializeXmlParams(object, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java index d14362ac5..abba5fb24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionXmlSerializeXmlParamsObject.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionXmlSerializeXmlParamsObject @@ -52,12 +52,12 @@ private boolean equalTo(FlowActionXmlSerializeXmlParamsObject other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer maskOutput) { this.maskOutput = maskOutput; return this; } - @Override + @java.lang.Override public _FinalStage allowFailure(Boolean allowFailure) { this.allowFailure = Optional.ofNullable(allowFailure); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allow_failure", nulls = Nulls.SKIP) public _FinalStage allowFailure(Optional allowFailure) { this.allowFailure = allowFailure; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FlowActionZapierTriggerWebhook build() { return new FlowActionZapierTriggerWebhook( id, alias, allowFailure, maskOutput, params, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java index f6c77bd52..1a30886e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParams.java @@ -46,7 +46,7 @@ public Optional getMethod() { return method; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowActionZapierTriggerWebhookParams @@ -62,12 +62,12 @@ private boolean equalTo(FlowActionZapierTriggerWebhookParams other) { return connectionId.equals(other.connectionId) && method.equals(other.method); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionId, this.method); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,34 +101,34 @@ public static final class Builder implements ConnectionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowActionZapierTriggerWebhookParams other) { connectionId(other.getConnectionId()); method(other.getMethod()); return this; } - @Override + @java.lang.Override @JsonSetter("connection_id") public _FinalStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage method(FlowActionZapierTriggerWebhookParamsMethod method) { this.method = Optional.ofNullable(method); return this; } - @Override + @java.lang.Override @JsonSetter(value = "method", nulls = Nulls.SKIP) public _FinalStage method(Optional method) { this.method = method; return this; } - @Override + @java.lang.Override public FlowActionZapierTriggerWebhookParams build() { return new FlowActionZapierTriggerWebhookParams(connectionId, method, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java index f0c0ec183..bd0e8036a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowActionZapierTriggerWebhookParamsMethod.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowActionZapierTriggerWebhookParamsMethod && this.string.equals(((FlowActionZapierTriggerWebhookParamsMethod) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java index 4c5a03b75..0f85945d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowExecutionSummary.java @@ -125,7 +125,7 @@ public Optional getEndedAt() { return endedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowExecutionSummary && equalTo((FlowExecutionSummary) other); @@ -147,7 +147,7 @@ private boolean equalTo(FlowExecutionSummary other) { && endedAt.equals(other.endedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -160,7 +160,7 @@ public int hashCode() { this.endedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -255,7 +255,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FlowExecutionSummary other) { id(other.getId()); traceId(other.getTraceId()); @@ -273,7 +273,7 @@ public Builder from(FlowExecutionSummary other) { *

Flow execution identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public TraceIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -285,7 +285,7 @@ public TraceIdStage id(@NotNull String id) { *

Trace id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("trace_id") public StatusStage traceId(@NotNull String traceId) { this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); @@ -297,7 +297,7 @@ public StatusStage traceId(@NotNull String traceId) { *

Execution status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public CreatedAtStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -309,7 +309,7 @@ public CreatedAtStage status(@NotNull String status) { *

The ISO 8601 formatted date when this flow execution was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -321,7 +321,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this flow execution was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -332,7 +332,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The ISO 8601 formatted date when this flow execution ended.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage endedAt(OffsetDateTime endedAt) { this.endedAt = Optional.ofNullable(endedAt); return this; @@ -341,7 +341,7 @@ public _FinalStage endedAt(OffsetDateTime endedAt) { /** *

The ISO 8601 formatted date when this flow execution ended.

*/ - @Override + @java.lang.Override @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) public _FinalStage endedAt(Optional endedAt) { this.endedAt = endedAt; @@ -352,7 +352,7 @@ public _FinalStage endedAt(Optional endedAt) { *

The ISO 8601 formatted date when this flow execution started.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startedAt(OffsetDateTime startedAt) { this.startedAt = Optional.ofNullable(startedAt); return this; @@ -361,7 +361,7 @@ public _FinalStage startedAt(OffsetDateTime startedAt) { /** *

The ISO 8601 formatted date when this flow execution started.

*/ - @Override + @java.lang.Override @JsonSetter(value = "started_at", nulls = Nulls.SKIP) public _FinalStage startedAt(Optional startedAt) { this.startedAt = startedAt; @@ -372,7 +372,7 @@ public _FinalStage startedAt(Optional startedAt) { *

Journey id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage journeyId(String journeyId) { this.journeyId = Optional.ofNullable(journeyId); return this; @@ -381,14 +381,14 @@ public _FinalStage journeyId(String journeyId) { /** *

Journey id

*/ - @Override + @java.lang.Override @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) public _FinalStage journeyId(Optional journeyId) { this.journeyId = journeyId; return this; } - @Override + @java.lang.Override public FlowExecutionSummary build() { return new FlowExecutionSummary( id, traceId, journeyId, status, createdAt, updatedAt, startedAt, endedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java index 967264de9..ad5d7050b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowSummary.java @@ -74,7 +74,7 @@ public Optional getExecutedAt() { return executedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowSummary && equalTo((FlowSummary) other); @@ -93,12 +93,12 @@ private boolean equalTo(FlowSummary other) { && executedAt.equals(other.executedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.executedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,7 +150,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FlowSummary other) { id(other.getId()); name(other.getName()); @@ -160,48 +160,48 @@ public Builder from(FlowSummary other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @Override + @java.lang.Override public FlowSummary build() { return new FlowSummary(id, name, createdAt, updatedAt, executedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java index f4ae6373c..89bc2da12 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsListRequest.java @@ -115,7 +115,7 @@ private OptionalNullable _getSynchronous() { return synchronous; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsListRequest && equalTo((FlowsListRequest) other); @@ -134,12 +134,12 @@ private boolean equalTo(FlowsListRequest other) { && synchronous.equals(other.synchronous); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals, this.synchronous); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java index 26c5a06c0..ade043778 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKey.java @@ -41,7 +41,7 @@ public String getApiKey() { return apiKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupApiKey && equalTo((FlowsVaultConnectioSetupApiKey) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowsVaultConnectioSetupApiKey other) { return type.equals(other.type) && apiKey.equals(other.apiKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.apiKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements TypeStage, ApiKeyStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupApiKey other) { type(other.getType()); apiKey(other.getApiKey()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ApiKeyStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupApiKey build() { return new FlowsVaultConnectioSetupApiKey(type, apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java index 73138d96d..9a9301573 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupApiKeyWithBaseUrl.java @@ -50,7 +50,7 @@ public String getBaseUrl() { return baseUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupApiKeyWithBaseUrl @@ -66,12 +66,12 @@ private boolean equalTo(FlowsVaultConnectioSetupApiKeyWithBaseUrl other) { return type.equals(other.type) && apiKey.equals(other.apiKey) && baseUrl.equals(other.baseUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.apiKey, this.baseUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements TypeStage, ApiKeyStage, BaseUrlStag private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupApiKeyWithBaseUrl other) { type(other.getType()); apiKey(other.getApiKey()); @@ -119,28 +119,28 @@ public Builder from(FlowsVaultConnectioSetupApiKeyWithBaseUrl other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public ApiKeyStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("api_key") public BaseUrlStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("base_url") public _FinalStage baseUrl(@NotNull String baseUrl) { this.baseUrl = Objects.requireNonNull(baseUrl, "baseUrl must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupApiKeyWithBaseUrl build() { return new FlowsVaultConnectioSetupApiKeyWithBaseUrl(type, apiKey, baseUrl, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java index cb9b9a9b6..eae976858 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupBigqueryOauthJwt.java @@ -63,7 +63,7 @@ public Optional getClientEmail() { return clientEmail; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupBigqueryOauthJwt @@ -82,12 +82,12 @@ private boolean equalTo(FlowsVaultConnectioSetupBigqueryOauthJwt other) { && clientEmail.equals(other.clientEmail); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.projectId, this.privateKey, this.clientEmail); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java index 3e3d1611b..dc40fe4f7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupHttpBearer.java @@ -41,7 +41,7 @@ public String getToken() { return token; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupHttpBearer @@ -57,12 +57,12 @@ private boolean equalTo(FlowsVaultConnectioSetupHttpBearer other) { return type.equals(other.type) && token.equals(other.token); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.token); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, TokenStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupHttpBearer other) { type(other.getType()); token(other.getToken()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public TokenStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupHttpBearer build() { return new FlowsVaultConnectioSetupHttpBearer(type, token, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java index 1483bd3df..691faab66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwt.java @@ -42,7 +42,7 @@ public FlowsVaultConnectioSetupJwtAlgorithmEnum getAlgorithm() { return algorithm; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupJwt && equalTo((FlowsVaultConnectioSetupJwt) other); @@ -57,12 +57,12 @@ private boolean equalTo(FlowsVaultConnectioSetupJwt other) { return type.equals(other.type) && algorithm.equals(other.algorithm); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.algorithm); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements TypeStage, AlgorithmStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupJwt other) { type(other.getType()); algorithm(other.getAlgorithm()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public AlgorithmStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("algorithm") public _FinalStage algorithm(@NotNull FlowsVaultConnectioSetupJwtAlgorithmEnum algorithm) { this.algorithm = Objects.requireNonNull(algorithm, "algorithm must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupJwt build() { return new FlowsVaultConnectioSetupJwt(type, algorithm, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java index 03b078209..5ad6528ba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupJwtAlgorithmEnum.java @@ -56,20 +56,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FlowsVaultConnectioSetupJwtAlgorithmEnum && this.string.equals(((FlowsVaultConnectioSetupJwtAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java index 9298158b9..8c6ad35cd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupMailjetApiKey.java @@ -50,7 +50,7 @@ public String getSecretKey() { return secretKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupMailjetApiKey @@ -66,12 +66,12 @@ private boolean equalTo(FlowsVaultConnectioSetupMailjetApiKey other) { return type.equals(other.type) && apiKey.equals(other.apiKey) && secretKey.equals(other.secretKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.apiKey, this.secretKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements TypeStage, ApiKeyStage, SecretKeySt private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupMailjetApiKey other) { type(other.getType()); apiKey(other.getApiKey()); @@ -119,28 +119,28 @@ public Builder from(FlowsVaultConnectioSetupMailjetApiKey other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public ApiKeyStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("api_key") public SecretKeyStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("secret_key") public _FinalStage secretKey(@NotNull String secretKey) { this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupMailjetApiKey build() { return new FlowsVaultConnectioSetupMailjetApiKey(type, apiKey, secretKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java index 4c2237d54..5f173c6a4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthApp.java @@ -73,7 +73,7 @@ public Optional getAudience() { return audience; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupOauthApp && equalTo((FlowsVaultConnectioSetupOauthApp) other); @@ -92,12 +92,12 @@ private boolean equalTo(FlowsVaultConnectioSetupOauthApp other) { && audience.equals(other.audience); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.clientId, this.clientSecret, this.domain, this.audience); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements TypeStage, ClientIdStage, ClientSec private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupOauthApp other) { type(other.getType()); clientId(other.getClientId()); @@ -159,48 +159,48 @@ public Builder from(FlowsVaultConnectioSetupOauthApp other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public ClientIdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("client_id") public ClientSecretStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("client_secret") public DomainStage clientSecret(@NotNull String clientSecret) { this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("domain") public _FinalStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage audience(String audience) { this.audience = Optional.ofNullable(audience); return this; } - @Override + @java.lang.Override @JsonSetter(value = "audience", nulls = Nulls.SKIP) public _FinalStage audience(Optional audience) { this.audience = audience; return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupOauthApp build() { return new FlowsVaultConnectioSetupOauthApp( type, clientId, clientSecret, domain, audience, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java index fe2a389ec..3213d20e8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupOauthCode.java @@ -43,7 +43,7 @@ public Optional getCode() { return code; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupOauthCode && equalTo((FlowsVaultConnectioSetupOauthCode) other); @@ -58,12 +58,12 @@ private boolean equalTo(FlowsVaultConnectioSetupOauthCode other) { return type.equals(other.type) && code.equals(other.code); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.code); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java index 6e26d878b..5a3c458ec 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupSecretApiKey.java @@ -42,7 +42,7 @@ public String getSecretKey() { return secretKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupSecretApiKey @@ -58,12 +58,12 @@ private boolean equalTo(FlowsVaultConnectioSetupSecretApiKey other) { return type.equals(other.type) && secretKey.equals(other.secretKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.secretKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,28 +97,28 @@ public static final class Builder implements TypeStage, SecretKeyStage, _FinalSt private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupSecretApiKey other) { type(other.getType()); secretKey(other.getSecretKey()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public SecretKeyStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("secret_key") public _FinalStage secretKey(@NotNull String secretKey) { this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupSecretApiKey build() { return new FlowsVaultConnectioSetupSecretApiKey(type, secretKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java index 8eb68b044..e7b6a58b9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupStripeKeyPair.java @@ -50,7 +50,7 @@ public String getPublicKey() { return publicKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupStripeKeyPair @@ -66,12 +66,12 @@ private boolean equalTo(FlowsVaultConnectioSetupStripeKeyPair other) { return type.equals(other.type) && privateKey.equals(other.privateKey) && publicKey.equals(other.publicKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.privateKey, this.publicKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements TypeStage, PrivateKeyStage, PublicK private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupStripeKeyPair other) { type(other.getType()); privateKey(other.getPrivateKey()); @@ -119,28 +119,28 @@ public Builder from(FlowsVaultConnectioSetupStripeKeyPair other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public PrivateKeyStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("private_key") public PublicKeyStage privateKey(@NotNull String privateKey) { this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("public_key") public _FinalStage publicKey(@NotNull String publicKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupStripeKeyPair build() { return new FlowsVaultConnectioSetupStripeKeyPair(type, privateKey, publicKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java index ee2ca6923..48d5617c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupToken.java @@ -41,7 +41,7 @@ public String getToken() { return token; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupToken && equalTo((FlowsVaultConnectioSetupToken) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowsVaultConnectioSetupToken other) { return type.equals(other.type) && token.equals(other.token); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.token); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements TypeStage, TokenStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupToken other) { type(other.getType()); token(other.getToken()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public TokenStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("token") public _FinalStage token(@NotNull String token) { this.token = Objects.requireNonNull(token, "token must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupToken build() { return new FlowsVaultConnectioSetupToken(type, token, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java index 821e0a723..0d668c88c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupTwilioApiKey.java @@ -50,7 +50,7 @@ public String getApiKey() { return apiKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupTwilioApiKey @@ -66,12 +66,12 @@ private boolean equalTo(FlowsVaultConnectioSetupTwilioApiKey other) { return type.equals(other.type) && accountId.equals(other.accountId) && apiKey.equals(other.apiKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.accountId, this.apiKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +111,7 @@ public static final class Builder implements TypeStage, AccountIdStage, ApiKeySt private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupTwilioApiKey other) { type(other.getType()); accountId(other.getAccountId()); @@ -119,28 +119,28 @@ public Builder from(FlowsVaultConnectioSetupTwilioApiKey other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public AccountIdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("account_id") public ApiKeyStage accountId(@NotNull String accountId) { this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupTwilioApiKey build() { return new FlowsVaultConnectioSetupTwilioApiKey(type, accountId, apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java index ef95d5da8..b2be167b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectioSetupWebhook.java @@ -41,7 +41,7 @@ public String getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectioSetupWebhook && equalTo((FlowsVaultConnectioSetupWebhook) other); @@ -56,12 +56,12 @@ private boolean equalTo(FlowsVaultConnectioSetupWebhook other) { return type.equals(other.type) && url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements TypeStage, UrlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectioSetupWebhook other) { type(other.getType()); url(other.getUrl()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public UrlStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @Override + @java.lang.Override public FlowsVaultConnectioSetupWebhook build() { return new FlowsVaultConnectioSetupWebhook(type, url, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java index a3dfc4c8a..5aad48008 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FlowsVaultConnectionSummary.java @@ -134,7 +134,7 @@ public String getFingerprint() { return fingerprint; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FlowsVaultConnectionSummary && equalTo((FlowsVaultConnectionSummary) other); @@ -157,7 +157,7 @@ private boolean equalTo(FlowsVaultConnectionSummary other) { && fingerprint.equals(other.fingerprint); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.fingerprint); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -279,7 +279,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FlowsVaultConnectionSummary other) { id(other.getId()); appId(other.getAppId()); @@ -298,7 +298,7 @@ public Builder from(FlowsVaultConnectionSummary other) { *

Flows Vault Connection identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public AppIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -310,7 +310,7 @@ public AppIdStage id(@NotNull String id) { *

Flows Vault Connection app identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("app_id") public NameStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); @@ -322,7 +322,7 @@ public NameStage appId(@NotNull String appId) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ReadyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -334,7 +334,7 @@ public ReadyStage name(@NotNull String name) { *

Whether the Flows Vault Connection is configured.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ready") public CreatedAtStage ready(boolean ready) { this.ready = ready; @@ -346,7 +346,7 @@ public CreatedAtStage ready(boolean ready) { *

The ISO 8601 formatted date when this Flows Vault Connection was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -358,14 +358,14 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fingerprint") public _FinalStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -376,7 +376,7 @@ public _FinalStage fingerprint(@NotNull String fingerprint) { *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { this.refreshedAt = Optional.ofNullable(refreshedAt); return this; @@ -385,7 +385,7 @@ public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { /** *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) public _FinalStage refreshedAt(Optional refreshedAt) { this.refreshedAt = refreshedAt; @@ -396,7 +396,7 @@ public _FinalStage refreshedAt(Optional refreshedAt) { *

Flows Vault Connection custom account name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accountName(String accountName) { this.accountName = Optional.ofNullable(accountName); return this; @@ -405,14 +405,14 @@ public _FinalStage accountName(String accountName) { /** *

Flows Vault Connection custom account name.

*/ - @Override + @java.lang.Override @JsonSetter(value = "account_name", nulls = Nulls.SKIP) public _FinalStage accountName(Optional accountName) { this.accountName = accountName; return this; } - @Override + @java.lang.Override public FlowsVaultConnectionSummary build() { return new FlowsVaultConnectionSummary( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlock.java b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java index e720f6f06..e12842dd3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlock.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlock.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlock && equalTo((FormBlock) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormBlock other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer { super(FormBlock.class); } - @Override + @java.lang.Override public FormBlock deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java index 715c9cb36..a62e0db33 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDivider.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockDivider && equalTo((FormBlockDivider) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockDivider other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockDivider other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockDivider other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormBlockDividerConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormBlockDivider build() { return new FormBlockDivider(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java index 0b57540c4..a5183c3a3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockDividerConfig.java @@ -34,7 +34,7 @@ public Optional getText() { return text; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockDividerConfig && equalTo((FormBlockDividerConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockDividerConfig other) { return text.equals(other.text); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java index 2220cbaae..a184d58cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtml.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockHtml && equalTo((FormBlockHtml) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockHtml other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockHtml other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockHtml other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormBlockHtmlConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormBlockHtml build() { return new FormBlockHtml(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java index d64c12828..1a3622c5e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockHtmlConfig.java @@ -34,7 +34,7 @@ public Optional getContent() { return content; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockHtmlConfig && equalTo((FormBlockHtmlConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockHtmlConfig other) { return content.equals(other.content); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.content); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java index 3c35b9b2c..e9452fb15 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImage.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockImage && equalTo((FormBlockImage) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockImage other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockImage other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockImage other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormBlockImageConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormBlockImage build() { return new FormBlockImage(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java index 96fbabbda..88372a4b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfig.java @@ -55,7 +55,7 @@ public Optional getHeight() { return height; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockImageConfig && equalTo((FormBlockImageConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormBlockImageConfig other) { return src.equals(other.src) && position.equals(other.position) && height.equals(other.height); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.src, this.position, this.height); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements SrcStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockImageConfig other) { src(other.getSrc()); position(other.getPosition()); @@ -123,40 +123,40 @@ public Builder from(FormBlockImageConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("src") public _FinalStage src(@NotNull String src) { this.src = Objects.requireNonNull(src, "src must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage height(Double height) { this.height = Optional.ofNullable(height); return this; } - @Override + @java.lang.Override @JsonSetter(value = "height", nulls = Nulls.SKIP) public _FinalStage height(Optional height) { this.height = height; return this; } - @Override + @java.lang.Override public _FinalStage position(FormBlockImageConfigPositionEnum position) { this.position = Optional.ofNullable(position); return this; } - @Override + @java.lang.Override @JsonSetter(value = "position", nulls = Nulls.SKIP) public _FinalStage position(Optional position) { this.position = position; return this; } - @Override + @java.lang.Override public FormBlockImageConfig build() { return new FormBlockImageConfig(src, position, height, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java index 5dd05df96..ecc7f7dd9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockImageConfigPositionEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormBlockImageConfigPositionEnum && this.string.equals(((FormBlockImageConfigPositionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java index de31651b4..9f7bf1319 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButton.java @@ -62,7 +62,7 @@ public FormBlockJumpButtonConfig getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButton && equalTo((FormBlockJumpButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockJumpButton other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockJumpButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockJumpButton other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockJumpButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public FormBlockJumpButton build() { return new FormBlockJumpButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java index 0c7a0ebf4..9f6282db1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfig.java @@ -55,7 +55,7 @@ public Optional getStyle() { return style; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButtonConfig && equalTo((FormBlockJumpButtonConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormBlockJumpButtonConfig other) { return text.equals(other.text) && nextNode.equals(other.nextNode) && style.equals(other.style); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text, this.nextNode, this.style); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements TextStage, NextNodeStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockJumpButtonConfig other) { text(other.getText()); nextNode(other.getNextNode()); @@ -123,34 +123,34 @@ public Builder from(FormBlockJumpButtonConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("text") public NextNodeStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("next_node") public _FinalStage nextNode(@NotNull FormNodePointer nextNode) { this.nextNode = Objects.requireNonNull(nextNode, "nextNode must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage style(FormBlockJumpButtonConfigStyle style) { this.style = Optional.ofNullable(style); return this; } - @Override + @java.lang.Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @Override + @java.lang.Override public FormBlockJumpButtonConfig build() { return new FormBlockJumpButtonConfig(text, nextNode, style, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java index 210bc2326..ffd730672 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockJumpButtonConfigStyle.java @@ -34,7 +34,7 @@ public Optional getBackgroundColor() { return backgroundColor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockJumpButtonConfigStyle && equalTo((FormBlockJumpButtonConfigStyle) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockJumpButtonConfigStyle other) { return backgroundColor.equals(other.backgroundColor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.backgroundColor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java index 23d82860d..e4f72fc7e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButton.java @@ -62,7 +62,7 @@ public FormBlockNextButtonConfig getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockNextButton && equalTo((FormBlockNextButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockNextButton other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockNextButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockNextButton other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockNextButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public FormBlockNextButton build() { return new FormBlockNextButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java index fed6738c7..6d24c23bf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockNextButtonConfig.java @@ -33,7 +33,7 @@ public String getText() { return text; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockNextButtonConfig && equalTo((FormBlockNextButtonConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormBlockNextButtonConfig other) { return text.equals(other.text); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TextStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockNextButtonConfig other) { text(other.getText()); return this; } - @Override + @java.lang.Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @Override + @java.lang.Override public FormBlockNextButtonConfig build() { return new FormBlockNextButtonConfig(text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java index 48ef90d9a..6e176cfad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButton.java @@ -62,7 +62,7 @@ public FormBlockPreviousButtonConfig getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockPreviousButton && equalTo((FormBlockPreviousButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockPreviousButton other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockPreviousButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockPreviousButton other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockPreviousButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public FormBlockPreviousButton build() { return new FormBlockPreviousButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java index 23d1fcfb2..60fb63e51 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockPreviousButtonConfig.java @@ -33,7 +33,7 @@ public String getText() { return text; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockPreviousButtonConfig && equalTo((FormBlockPreviousButtonConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormBlockPreviousButtonConfig other) { return text.equals(other.text); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements TextStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockPreviousButtonConfig other) { text(other.getText()); return this; } - @Override + @java.lang.Override @JsonSetter("text") public _FinalStage text(@NotNull String text) { this.text = Objects.requireNonNull(text, "text must not be null"); return this; } - @Override + @java.lang.Override public FormBlockPreviousButtonConfig build() { return new FormBlockPreviousButtonConfig(text, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java index e3d604c57..cc5e57605 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButton.java @@ -62,7 +62,7 @@ public FormBlockResendButtonConfig getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockResendButton && equalTo((FormBlockResendButton) other); @@ -80,12 +80,12 @@ private boolean equalTo(FormBlockResendButton other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -131,7 +131,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockResendButton other) { id(other.getId()); category(other.getCategory()); @@ -140,35 +140,35 @@ public Builder from(FormBlockResendButton other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormBlockResendButtonConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public FormBlockResendButton build() { return new FormBlockResendButton(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java index 8039e03d1..d899c55c3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfig.java @@ -91,7 +91,7 @@ public Optional getWaitingTime() { return waitingTime; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockResendButtonConfig && equalTo((FormBlockResendButtonConfig) other); @@ -112,7 +112,7 @@ private boolean equalTo(FormBlockResendButtonConfig other) { && waitingTime.equals(other.waitingTime); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.activeText, @@ -124,7 +124,7 @@ public int hashCode() { this.waitingTime); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockResendButtonConfig other) { activeText(other.getActiveText()); buttonText(other.getButtonText()); @@ -201,74 +201,74 @@ public Builder from(FormBlockResendButtonConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("active_text") public ButtonTextStage activeText(@NotNull String activeText) { this.activeText = Objects.requireNonNull(activeText, "activeText must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("button_text") public WaitingTextStage buttonText(@NotNull String buttonText) { this.buttonText = Objects.requireNonNull(buttonText, "buttonText must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("waiting_text") public FlowIdStage waitingText(@NotNull String waitingText) { this.waitingText = Objects.requireNonNull(waitingText, "waitingText must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("flow_id") public _FinalStage flowId(@NotNull String flowId) { this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage waitingTime(Double waitingTime) { this.waitingTime = Optional.ofNullable(waitingTime); return this; } - @Override + @java.lang.Override @JsonSetter(value = "waiting_time", nulls = Nulls.SKIP) public _FinalStage waitingTime(Optional waitingTime) { this.waitingTime = waitingTime; return this; } - @Override + @java.lang.Override public _FinalStage maxAttempts(Double maxAttempts) { this.maxAttempts = Optional.ofNullable(maxAttempts); return this; } - @Override + @java.lang.Override @JsonSetter(value = "max_attempts", nulls = Nulls.SKIP) public _FinalStage maxAttempts(Optional maxAttempts) { this.maxAttempts = maxAttempts; return this; } - @Override + @java.lang.Override public _FinalStage textAlignment(FormBlockResendButtonConfigTextAlignmentEnum textAlignment) { this.textAlignment = Optional.ofNullable(textAlignment); return this; } - @Override + @java.lang.Override @JsonSetter(value = "text_alignment", nulls = Nulls.SKIP) public _FinalStage textAlignment(Optional textAlignment) { this.textAlignment = textAlignment; return this; } - @Override + @java.lang.Override public FormBlockResendButtonConfig build() { return new FormBlockResendButtonConfig( activeText, diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java index 21a52f93b..b98a7331a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockResendButtonConfigTextAlignmentEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormBlockResendButtonConfigTextAlignmentEnum && this.string.equals(((FormBlockResendButtonConfigTextAlignmentEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java index 947810c43..630ccddbb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichText.java @@ -64,7 +64,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockRichText && equalTo((FormBlockRichText) other); @@ -82,12 +82,12 @@ private boolean equalTo(FormBlockRichText other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.category, this.type, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormBlockRichText other) { id(other.getId()); category(other.getCategory()); @@ -142,41 +142,41 @@ public Builder from(FormBlockRichText other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormBlockRichTextConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormBlockRichText build() { return new FormBlockRichText(id, category, type, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java index 51975b5f6..a4986d07b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormBlockRichTextConfig.java @@ -34,7 +34,7 @@ public Optional getContent() { return content; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormBlockRichTextConfig && equalTo((FormBlockRichTextConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormBlockRichTextConfig other) { return content.equals(other.content); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.content); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormComponent.java b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java index f8e3779bb..62c7f133a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormComponent.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormComponent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormComponent && equalTo((FormComponent) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormComponent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormComponent.class); } - @Override + @java.lang.Override public FormComponent deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java index ecd56aa3b..e6e50def2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNode.java @@ -63,7 +63,7 @@ public Optional getResumeFlow() { return resumeFlow; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNode && equalTo((FormEndingNode) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormEndingNode other) { && resumeFlow.equals(other.resumeFlow); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.redirection, this.afterSubmit, this.coordinates, this.resumeFlow); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java index 7213b6fa7..9cb34292c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeAfterSubmit.java @@ -34,7 +34,7 @@ public Optional getFlowId() { return flowId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNodeAfterSubmit && equalTo((FormEndingNodeAfterSubmit) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormEndingNodeAfterSubmit other) { return flowId.equals(other.flowId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.flowId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java index 4ba2570e5..c7f3601f3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormEndingNodeRedirection.java @@ -44,7 +44,7 @@ public String getTarget() { return target; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormEndingNodeRedirection && equalTo((FormEndingNodeRedirection) other); @@ -59,12 +59,12 @@ private boolean equalTo(FormEndingNodeRedirection other) { return delay.equals(other.delay) && target.equals(other.target); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.delay, this.target); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements TargetStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormEndingNodeRedirection other) { delay(other.getDelay()); target(other.getTarget()); return this; } - @Override + @java.lang.Override @JsonSetter("target") public _FinalStage target(@NotNull String target) { this.target = Objects.requireNonNull(target, "target must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage delay(Integer delay) { this.delay = Optional.ofNullable(delay); return this; } - @Override + @java.lang.Override @JsonSetter(value = "delay", nulls = Nulls.SKIP) public _FinalStage delay(Optional delay) { this.delay = delay; return this; } - @Override + @java.lang.Override public FormEndingNodeRedirection build() { return new FormEndingNodeRedirection(delay, target, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormField.java b/src/main/java/com/auth0/client/mgmt/types/FormField.java index 307fd8182..2efcc642c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormField.java @@ -67,7 +67,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormField && equalTo((FormField) other); @@ -77,12 +77,12 @@ private boolean equalTo(FormField other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -190,7 +190,7 @@ static final class Deserializer extends StdDeserializer { super(FormField.class); } - @Override + @java.lang.Override public FormField deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java index 0e3d1b96c..35da43ce1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBoolean.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBoolean && equalTo((FormFieldBoolean) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldBoolean other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldBoolean other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldBoolean other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldBooleanConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormFieldBoolean build() { return new FormFieldBoolean( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java index 3d47d3fc6..6901ba78e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfig.java @@ -45,7 +45,7 @@ public Optional getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBooleanConfig && equalTo((FormFieldBooleanConfig) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldBooleanConfig other) { return defaultValue.equals(other.defaultValue) && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.defaultValue, this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java index a3829a3d7..4303222fc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldBooleanConfigOptions.java @@ -43,7 +43,7 @@ public Optional getFalse() { return false_; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldBooleanConfigOptions && equalTo((FormFieldBooleanConfigOptions) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldBooleanConfigOptions other) { return true_.equals(other.true_) && false_.equals(other.false_); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.true_, this.false_); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java index 6eecd8505..50dfdcffe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCards.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCards && equalTo((FormFieldCards) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldCards other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldCards other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldCards other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldCardsConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldCards build() { return new FormFieldCards( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java index a6b700c2e..a526bc8b9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfig.java @@ -55,7 +55,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCardsConfig && equalTo((FormFieldCardsConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormFieldCardsConfig other) { return hideLabels.equals(other.hideLabels) && multiple.equals(other.multiple) && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hideLabels, this.multiple, this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java index dca1baab1..e85a6ccea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCardsConfigOption.java @@ -50,7 +50,7 @@ public String getImageUrl() { return imageUrl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCardsConfigOption && equalTo((FormFieldCardsConfigOption) other); @@ -65,12 +65,12 @@ private boolean equalTo(FormFieldCardsConfigOption other) { return value.equals(other.value) && label.equals(other.label) && imageUrl.equals(other.imageUrl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.label, this.imageUrl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements ValueStage, LabelStage, ImageUrlSta private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldCardsConfigOption other) { value(other.getValue()); label(other.getLabel()); @@ -118,28 +118,28 @@ public Builder from(FormFieldCardsConfigOption other) { return this; } - @Override + @java.lang.Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("label") public ImageUrlStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("image_url") public _FinalStage imageUrl(@NotNull String imageUrl) { this.imageUrl = Objects.requireNonNull(imageUrl, "imageUrl must not be null"); return this; } - @Override + @java.lang.Override public FormFieldCardsConfigOption build() { return new FormFieldCardsConfigOption(value, label, imageUrl, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java index e58cae25c..57f6f4dfe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoice.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoice && equalTo((FormFieldChoice) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldChoice other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldChoice other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldChoice other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldChoiceConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldChoice build() { return new FormFieldChoice( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java index 6437096cd..181bab370 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfig.java @@ -55,7 +55,7 @@ public Optional getAllowOther() { return allowOther; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfig && equalTo((FormFieldChoiceConfig) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormFieldChoiceConfig other) { return multiple.equals(other.multiple) && options.equals(other.options) && allowOther.equals(other.allowOther); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.multiple, this.options, this.allowOther); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java index e47660f54..49c6d7e81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigAllowOther.java @@ -54,7 +54,7 @@ public Optional getPlaceholder() { return placeholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfigAllowOther && equalTo((FormFieldChoiceConfigAllowOther) other); @@ -69,12 +69,12 @@ private boolean equalTo(FormFieldChoiceConfigAllowOther other) { return enabled.equals(other.enabled) && label.equals(other.label) && placeholder.equals(other.placeholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.label, this.placeholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java index 14a58c5a6..a7b0cf35b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldChoiceConfigOption.java @@ -41,7 +41,7 @@ public String getLabel() { return label; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldChoiceConfigOption && equalTo((FormFieldChoiceConfigOption) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormFieldChoiceConfigOption other) { return value.equals(other.value) && label.equals(other.label); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.label); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ValueStage, LabelStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldChoiceConfigOption other) { value(other.getValue()); label(other.getLabel()); return this; } - @Override + @java.lang.Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("label") public _FinalStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @Override + @java.lang.Override public FormFieldChoiceConfigOption build() { return new FormFieldChoiceConfigOption(value, label, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java index ca2b063fd..83d7fddd2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustom.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCustom && equalTo((FormFieldCustom) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldCustom other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldCustom other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldCustom other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldCustomConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormFieldCustom build() { return new FormFieldCustom( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java index d296c2720..721e611c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldCustomConfig.java @@ -65,7 +65,7 @@ public Optional> getParams() { return params; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldCustomConfig && equalTo((FormFieldCustomConfig) other); @@ -83,12 +83,12 @@ private boolean equalTo(FormFieldCustomConfig other) { && params.equals(other.params); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.schema, this.code, this.css, this.params); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -136,7 +136,7 @@ public static final class Builder implements CodeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldCustomConfig other) { schema(other.getSchema()); code(other.getCode()); @@ -145,46 +145,46 @@ public Builder from(FormFieldCustomConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("code") public _FinalStage code(@NotNull String code) { this.code = Objects.requireNonNull(code, "code must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage params(Map params) { this.params = Optional.ofNullable(params); return this; } - @Override + @java.lang.Override @JsonSetter(value = "params", nulls = Nulls.SKIP) public _FinalStage params(Optional> params) { this.params = params; return this; } - @Override + @java.lang.Override public _FinalStage css(String css) { this.css = Optional.ofNullable(css); return this; } - @Override + @java.lang.Override @JsonSetter(value = "css", nulls = Nulls.SKIP) public _FinalStage css(Optional css) { this.css = css; return this; } - @Override + @java.lang.Override public _FinalStage schema(String key, Object value) { this.schema.put(key, value); return this; } - @Override + @java.lang.Override public _FinalStage putAllSchema(Map schema) { if (schema != null) { this.schema.putAll(schema); @@ -192,7 +192,7 @@ public _FinalStage putAllSchema(Map schema) { return this; } - @Override + @java.lang.Override @JsonSetter(value = "schema", nulls = Nulls.SKIP) public _FinalStage schema(Map schema) { this.schema.clear(); @@ -202,7 +202,7 @@ public _FinalStage schema(Map schema) { return this; } - @Override + @java.lang.Override public FormFieldCustomConfig build() { return new FormFieldCustomConfig(schema, code, css, params, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java index cb28beedb..7484ab2ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDate.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDate && equalTo((FormFieldDate) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldDate other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldDate other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldDate other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldDateConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormFieldDate build() { return new FormFieldDate( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java index 58c1b56d6..11f4bdb32 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfig.java @@ -45,7 +45,7 @@ public Optional getDefaultValue() { return defaultValue; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDateConfig && equalTo((FormFieldDateConfig) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldDateConfig other) { return format.equals(other.format) && defaultValue.equals(other.defaultValue); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.format, this.defaultValue); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java index fd1e837a7..1bc0f9a37 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDateConfigFormatEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldDateConfigFormatEnum && this.string.equals(((FormFieldDateConfigFormatEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java index e7a15ad36..674c4b055 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdown.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdown && equalTo((FormFieldDropdown) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldDropdown other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldDropdown other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldDropdown other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldDropdownConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldDropdown build() { return new FormFieldDropdown( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java index 9db063c4d..5a1efa85e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfig.java @@ -55,7 +55,7 @@ public Optional getPlaceholder() { return placeholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdownConfig && equalTo((FormFieldDropdownConfig) other); @@ -72,12 +72,12 @@ private boolean equalTo(FormFieldDropdownConfig other) { && placeholder.equals(other.placeholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.multiple, this.options, this.placeholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java index 7518dd1a7..49965c866 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldDropdownConfigOption.java @@ -41,7 +41,7 @@ public String getLabel() { return label; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldDropdownConfigOption && equalTo((FormFieldDropdownConfigOption) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormFieldDropdownConfigOption other) { return value.equals(other.value) && label.equals(other.label); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.label); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements ValueStage, LabelStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldDropdownConfigOption other) { value(other.getValue()); label(other.getLabel()); return this; } - @Override + @java.lang.Override @JsonSetter("value") public LabelStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("label") public _FinalStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); return this; } - @Override + @java.lang.Override public FormFieldDropdownConfigOption build() { return new FormFieldDropdownConfigOption(value, label, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java index 5cae06444..de80038fa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmail.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldEmail && equalTo((FormFieldEmail) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldEmail other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldEmail other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldEmail other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldEmailConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldEmail build() { return new FormFieldEmail( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java index 9b39704ed..6cf5817fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldEmailConfig.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldEmailConfig && equalTo((FormFieldEmailConfig) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldEmailConfig other) { return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java index 1e82a5c55..ee9d498df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFile.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFile && equalTo((FormFieldFile) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldFile other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldFile other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldFile other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldFileConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldFile build() { return new FormFieldFile( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java index 106a835dc..29a77e1e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfig.java @@ -82,7 +82,7 @@ public Optional getMaxFiles() { return maxFiles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFileConfig && equalTo((FormFieldFileConfig) other); @@ -102,12 +102,12 @@ private boolean equalTo(FormFieldFileConfig other) { && maxFiles.equals(other.maxFiles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.multiple, this.storage, this.categories, this.extensions, this.maxSize, this.maxFiles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java index 4191d6130..e28d21e68 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigCategoryEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldFileConfigCategoryEnum && this.string.equals(((FormFieldFileConfigCategoryEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java index c6cebddd7..56854c2b6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorage.java @@ -34,7 +34,7 @@ public FormFieldFileConfigStorageTypeEnum getType() { return type; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldFileConfigStorage && equalTo((FormFieldFileConfigStorage) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldFileConfigStorage other) { return type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldFileConfigStorage other) { type(other.getType()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull FormFieldFileConfigStorageTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public FormFieldFileConfigStorage build() { return new FormFieldFileConfigStorage(type, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java index e4171fc08..363cb3796 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldFileConfigStorageTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldFileConfigStorageTypeEnum && this.string.equals(((FormFieldFileConfigStorageTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java index 0d9ee8308..ff8e09e60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegal.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldLegal && equalTo((FormFieldLegal) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldLegal other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldLegal other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldLegal other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldLegalConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldLegal build() { return new FormFieldLegal( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java index df2153eb7..482a6c4d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldLegalConfig.java @@ -34,7 +34,7 @@ public Optional getText() { return text; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldLegalConfig && equalTo((FormFieldLegalConfig) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldLegalConfig other) { return text.equals(other.text); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java index b2389b529..04e6a4766 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumber.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldNumber && equalTo((FormFieldNumber) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldNumber other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldNumber other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldNumber other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldNumberConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldNumber build() { return new FormFieldNumber( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java index a0f78629d..3f25a6c1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldNumberConfig.java @@ -63,7 +63,7 @@ public Optional getMaxValue() { return maxValue; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldNumberConfig && equalTo((FormFieldNumberConfig) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormFieldNumberConfig other) { && maxValue.equals(other.maxValue); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder, this.minValue, this.maxValue); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java index a0357ae3a..fc1c79169 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPassword.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPassword && equalTo((FormFieldPassword) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldPassword other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldPassword other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldPassword other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldPasswordConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormFieldPassword build() { return new FormFieldPassword( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java index f9cb29e2a..9c0a9a4dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfig.java @@ -90,7 +90,7 @@ public Optional getStrengthMeter() { return strengthMeter; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPasswordConfig && equalTo((FormFieldPasswordConfig) other); @@ -111,7 +111,7 @@ private boolean equalTo(FormFieldPasswordConfig other) { && strengthMeter.equals(other.strengthMeter); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.hash, @@ -123,7 +123,7 @@ public int hashCode() { this.strengthMeter); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java index 8f0ca1a93..b61d4c088 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPasswordConfigHashEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormFieldPasswordConfigHashEnum && this.string.equals(((FormFieldPasswordConfigHashEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java index cea8fef84..1e6ce138e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPayment.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPayment && equalTo((FormFieldPayment) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldPayment other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldPayment other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormFieldPayment other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFieldPaymentConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormFieldPayment build() { return new FormFieldPayment( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java index 064d3cbcb..094177612 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfig.java @@ -73,7 +73,7 @@ public Optional getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfig && equalTo((FormFieldPaymentConfig) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormFieldPaymentConfig other) { && fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider, this.charge, this.credentials, this.customer, this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements ChargeStage, CredentialsStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldPaymentConfig other) { provider(other.getProvider()); charge(other.getCharge()); @@ -159,60 +159,60 @@ public Builder from(FormFieldPaymentConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("charge") public CredentialsStage charge(@NotNull FormFieldPaymentConfigCharge charge) { this.charge = Objects.requireNonNull(charge, "charge must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("credentials") public _FinalStage credentials(@NotNull FormFieldPaymentConfigCredentials credentials) { this.credentials = Objects.requireNonNull(credentials, "credentials must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage fields(FormFieldPaymentConfigFields fields) { this.fields = Optional.ofNullable(fields); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(Optional fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public _FinalStage customer(Map customer) { this.customer = Optional.ofNullable(customer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customer", nulls = Nulls.SKIP) public _FinalStage customer(Optional> customer) { this.customer = customer; return this; } - @Override + @java.lang.Override public _FinalStage provider(String provider) { this.provider = Optional.ofNullable(provider); return this; } - @Override + @java.lang.Override @JsonSetter(value = "provider", nulls = Nulls.SKIP) public _FinalStage provider(Optional provider) { this.provider = provider; return this; } - @Override + @java.lang.Override public FormFieldPaymentConfig build() { return new FormFieldPaymentConfig(provider, charge, credentials, customer, fields, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java index 40bd2cf95..f9fbb95ac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCharge.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigCharge && equalTo((FormFieldPaymentConfigCharge) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldPaymentConfigCharge other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigChargeOneOffOneOffAmount @@ -50,12 +50,12 @@ private boolean equalTo(FormFieldPaymentConfigChargeOneOffOneOffAmount other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getSubscription() { return subscription; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigChargeSubscription @@ -60,12 +60,12 @@ private boolean equalTo(FormFieldPaymentConfigChargeSubscription other) { return type.equals(other.type) && subscription.equals(other.subscription); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.subscription); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -101,27 +101,27 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldPaymentConfigChargeSubscription other) { type(other.getType()); subscription(other.getSubscription()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage subscription(String key, Object value) { this.subscription.put(key, value); return this; } - @Override + @java.lang.Override public _FinalStage putAllSubscription(Map subscription) { if (subscription != null) { this.subscription.putAll(subscription); @@ -129,7 +129,7 @@ public _FinalStage putAllSubscription(Map subscription) { return this; } - @Override + @java.lang.Override @JsonSetter(value = "subscription", nulls = Nulls.SKIP) public _FinalStage subscription(Map subscription) { this.subscription.clear(); @@ -139,7 +139,7 @@ public _FinalStage subscription(Map subscription) { return this; } - @Override + @java.lang.Override public FormFieldPaymentConfigChargeSubscription build() { return new FormFieldPaymentConfigChargeSubscription(type, subscription, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java index c614be9ab..4bfc3ba15 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigCredentials.java @@ -42,7 +42,7 @@ public String getPrivateKey() { return privateKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigCredentials && equalTo((FormFieldPaymentConfigCredentials) other); @@ -57,12 +57,12 @@ private boolean equalTo(FormFieldPaymentConfigCredentials other) { return publicKey.equals(other.publicKey) && privateKey.equals(other.privateKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.publicKey, this.privateKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements PublicKeyStage, PrivateKeyStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldPaymentConfigCredentials other) { publicKey(other.getPublicKey()); privateKey(other.getPrivateKey()); return this; } - @Override + @java.lang.Override @JsonSetter("public_key") public PrivateKeyStage publicKey(@NotNull String publicKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("private_key") public _FinalStage privateKey(@NotNull String privateKey) { this.privateKey = Objects.requireNonNull(privateKey, "privateKey must not be null"); return this; } - @Override + @java.lang.Override public FormFieldPaymentConfigCredentials build() { return new FormFieldPaymentConfigCredentials(publicKey, privateKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java index bc37b17b2..e60ac1a8c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFieldProperties.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigFieldProperties @@ -59,12 +59,12 @@ private boolean equalTo(FormFieldPaymentConfigFieldProperties other) { return label.equals(other.label) && placeholder.equals(other.placeholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.label, this.placeholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java index dde4d0677..cf2cae117 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldPaymentConfigFields.java @@ -63,7 +63,7 @@ public Optional getTrustmarks() { return trustmarks; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldPaymentConfigFields && equalTo((FormFieldPaymentConfigFields) other); @@ -81,12 +81,12 @@ private boolean equalTo(FormFieldPaymentConfigFields other) { && trustmarks.equals(other.trustmarks); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.cardNumber, this.expirationDate, this.securityCode, this.trustmarks); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java index c420d1516..8c4eb19ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocial.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldSocial && equalTo((FormFieldSocial) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldSocial other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldSocial other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldSocial other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldSocialConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldSocial build() { return new FormFieldSocial( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java index c7e51055b..8148ad2df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldSocialConfig.java @@ -21,7 +21,7 @@ private FormFieldSocialConfig(Map additionalProperties) { this.additionalProperties = additionalProperties; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldSocialConfig; @@ -32,7 +32,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java index b5b1faa4a..ea547e5ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTel.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTel && equalTo((FormFieldTel) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldTel other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldTel other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldTel other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldTelConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldTel build() { return new FormFieldTel(id, category, type, config, label, hint, required, sensitive, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java index b5059ad61..850208153 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfig.java @@ -81,7 +81,7 @@ public Optional getStrings() { return strings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTelConfig && equalTo((FormFieldTelConfig) other); @@ -101,13 +101,13 @@ private boolean equalTo(FormFieldTelConfig other) { && strings.equals(other.strings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.defaultValue, this.placeholder, this.minLength, this.maxLength, this.countryPicker, this.strings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java index f84fca7b3..b142adc2f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTelConfigStrings.java @@ -34,7 +34,7 @@ public Optional getFilterPlaceholder() { return filterPlaceholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTelConfigStrings && equalTo((FormFieldTelConfigStrings) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormFieldTelConfigStrings other) { return filterPlaceholder.equals(other.filterPlaceholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.filterPlaceholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java index 6e85de3b6..a8e8d8b42 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldText.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldText && equalTo((FormFieldText) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldText other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldText other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldText other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldTextConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldText build() { return new FormFieldText( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java index 5db8d680b..18acecdba 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldTextConfig.java @@ -72,7 +72,7 @@ public Optional getMaxLength() { return maxLength; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldTextConfig && equalTo((FormFieldTextConfig) other); @@ -91,12 +91,12 @@ private boolean equalTo(FormFieldTextConfig other) { && maxLength.equals(other.maxLength); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.multiline, this.defaultValue, this.placeholder, this.minLength, this.maxLength); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java index 60f5572e8..3b6775c9f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrl.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldUrl && equalTo((FormFieldUrl) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormFieldUrl other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormFieldUrl other) { id(other.getId()); category(other.getCategory()); @@ -211,93 +211,93 @@ public Builder from(FormFieldUrl other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public _FinalStage config(FormFieldUrlConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public FormFieldUrl build() { return new FormFieldUrl(id, category, type, config, label, hint, required, sensitive, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java index 2dec42fa2..3ade6fdbd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFieldUrlConfig.java @@ -43,7 +43,7 @@ public Optional getPlaceholder() { return placeholder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFieldUrlConfig && equalTo((FormFieldUrlConfig) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormFieldUrlConfig other) { return defaultValue.equals(other.defaultValue) && placeholder.equals(other.placeholder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.defaultValue, this.placeholder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlow.java b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java index 8140f5156..b2cf724a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlow.java @@ -73,7 +73,7 @@ public FormFlowConfig getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFlow && equalTo((FormFlow) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormFlow other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, ConfigStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(FormFlow other) { id(other.getId()); type(other.getType()); @@ -159,54 +159,54 @@ public Builder from(FormFlow other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormFlowConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @Override + @java.lang.Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @Override + @java.lang.Override public FormFlow build() { return new FormFlow(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java index 1c4969e17..27e810319 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormFlowConfig.java @@ -44,7 +44,7 @@ public Optional getNextNode() { return nextNode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormFlowConfig && equalTo((FormFlowConfig) other); @@ -59,12 +59,12 @@ private boolean equalTo(FormFlowConfig other) { return flowId.equals(other.flowId) && nextNode.equals(other.nextNode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.flowId, this.nextNode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements FlowIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormFlowConfig other) { flowId(other.getFlowId()); nextNode(other.getNextNode()); return this; } - @Override + @java.lang.Override @JsonSetter("flow_id") public _FinalStage flowId(@NotNull String flowId) { this.flowId = Objects.requireNonNull(flowId, "flowId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage nextNode(FormNodePointer nextNode) { this.nextNode = Optional.ofNullable(nextNode); return this; } - @Override + @java.lang.Override @JsonSetter(value = "next_node", nulls = Nulls.SKIP) public _FinalStage nextNode(Optional nextNode) { this.nextNode = nextNode; return this; } - @Override + @java.lang.Override public FormFlowConfig build() { return new FormFlowConfig(flowId, nextNode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java index 568d2313e..04a0f3ec3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormHiddenField.java @@ -43,7 +43,7 @@ public Optional getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormHiddenField && equalTo((FormHiddenField) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormHiddenField other) { return key.equals(other.key) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.key, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,34 +97,34 @@ public static final class Builder implements KeyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormHiddenField other) { key(other.getKey()); value(other.getValue()); return this; } - @Override + @java.lang.Override @JsonSetter("key") public _FinalStage key(@NotNull String key) { this.key = Objects.requireNonNull(key, "key must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage value(String value) { this.value = Optional.ofNullable(value); return this; } - @Override + @java.lang.Override @JsonSetter(value = "value", nulls = Nulls.SKIP) public _FinalStage value(Optional value) { this.value = value; return this; } - @Override + @java.lang.Override public FormHiddenField build() { return new FormHiddenField(key, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java index 404167ef7..747cf6895 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormLanguages.java @@ -43,7 +43,7 @@ public Optional getDefault() { return default_; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormLanguages && equalTo((FormLanguages) other); @@ -58,12 +58,12 @@ private boolean equalTo(FormLanguages other) { return primary.equals(other.primary) && default_.equals(other.default_); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.primary, this.default_); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormMessages.java b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java index 14b683da8..5cb40b113 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormMessages.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormMessages.java @@ -45,7 +45,7 @@ public Optional> getCustom() { return custom; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormMessages && equalTo((FormMessages) other); @@ -60,12 +60,12 @@ private boolean equalTo(FormMessages other) { return errors.equals(other.errors) && custom.equals(other.custom); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.errors, this.custom); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNode.java b/src/main/java/com/auth0/client/mgmt/types/FormNode.java index 8ec1d090d..7e0be4d13 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNode.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNode && equalTo((FormNode) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormNode other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormNode.class); } - @Override + @java.lang.Override public FormNode deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java index 0613f9e70..3dd9fcf17 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodeCoordinates.java @@ -40,7 +40,7 @@ public int getY() { return y; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNodeCoordinates && equalTo((FormNodeCoordinates) other); @@ -55,12 +55,12 @@ private boolean equalTo(FormNodeCoordinates other) { return x == other.x && y == other.y; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.x, this.y); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements XStage, YStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormNodeCoordinates other) { x(other.getX()); y(other.getY()); return this; } - @Override + @java.lang.Override @JsonSetter("x") public YStage x(int x) { this.x = x; return this; } - @Override + @java.lang.Override @JsonSetter("y") public _FinalStage y(int y) { this.y = y; return this; } - @Override + @java.lang.Override public FormNodeCoordinates build() { return new FormNodeCoordinates(x, y, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java index ba8cdd49e..0486c3a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormNodePointer.java @@ -40,7 +40,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormNodePointer && equalTo((FormNodePointer) other); @@ -50,12 +50,12 @@ private boolean equalTo(FormNodePointer other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer { super(FormNodePointer.class); } - @Override + @java.lang.Override public FormNodePointer deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouter.java b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java index b5ef1f7dd..378da08d7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouter.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouter.java @@ -73,7 +73,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouter && equalTo((FormRouter) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormRouter other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormRouter other) { id(other.getId()); type(other.getType()); @@ -159,60 +159,60 @@ public Builder from(FormRouter other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormRouterConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @Override + @java.lang.Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @Override + @java.lang.Override public FormRouter build() { return new FormRouter(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java index b8e63a32c..a6c450ea7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterConfig.java @@ -46,7 +46,7 @@ public Optional getFallback() { return fallback; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouterConfig && equalTo((FormRouterConfig) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormRouterConfig other) { return rules.equals(other.rules) && fallback.equals(other.fallback); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.rules, this.fallback); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java index da9f26101..ea3f83563 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormRouterRule.java @@ -55,7 +55,7 @@ public Optional getNextNode() { return nextNode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormRouterRule && equalTo((FormRouterRule) other); @@ -70,12 +70,12 @@ private boolean equalTo(FormRouterRule other) { return id.equals(other.id) && alias.equals(other.alias) && nextNode.equals(other.nextNode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.alias, this.nextNode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -115,7 +115,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormRouterRule other) { id(other.getId()); alias(other.getAlias()); @@ -123,40 +123,40 @@ public Builder from(FormRouterRule other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage nextNode(FormNodePointer nextNode) { this.nextNode = Optional.ofNullable(nextNode); return this; } - @Override + @java.lang.Override @JsonSetter(value = "next_node", nulls = Nulls.SKIP) public _FinalStage nextNode(Optional nextNode) { this.nextNode = nextNode; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public FormRouterRule build() { return new FormRouterRule(id, alias, nextNode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java index b0df1203f..5777adaad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStartNode.java @@ -55,7 +55,7 @@ public Optional getCoordinates() { return coordinates; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStartNode && equalTo((FormStartNode) other); @@ -72,12 +72,12 @@ private boolean equalTo(FormStartNode other) { && coordinates.equals(other.coordinates); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hiddenFields, this.nextNode, this.coordinates); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStep.java b/src/main/java/com/auth0/client/mgmt/types/FormStep.java index a0cbd6cb1..d8adc9b71 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStep.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStep.java @@ -73,7 +73,7 @@ public Optional getConfig() { return config; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStep && equalTo((FormStep) other); @@ -92,12 +92,12 @@ private boolean equalTo(FormStep other) { && config.equals(other.config); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.type, this.coordinates, this.alias, this.config); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,7 +149,7 @@ public static final class Builder implements IdStage, TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormStep other) { id(other.getId()); type(other.getType()); @@ -159,60 +159,60 @@ public Builder from(FormStep other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage config(FormStepConfig config) { this.config = Optional.ofNullable(config); return this; } - @Override + @java.lang.Override @JsonSetter(value = "config", nulls = Nulls.SKIP) public _FinalStage config(Optional config) { this.config = config; return this; } - @Override + @java.lang.Override public _FinalStage alias(String alias) { this.alias = Optional.ofNullable(alias); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alias", nulls = Nulls.SKIP) public _FinalStage alias(Optional alias) { this.alias = alias; return this; } - @Override + @java.lang.Override public _FinalStage coordinates(FormNodeCoordinates coordinates) { this.coordinates = Optional.ofNullable(coordinates); return this; } - @Override + @java.lang.Override @JsonSetter(value = "coordinates", nulls = Nulls.SKIP) public _FinalStage coordinates(Optional coordinates) { this.coordinates = coordinates; return this; } - @Override + @java.lang.Override public FormStep build() { return new FormStep(id, type, coordinates, alias, config, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java index c0dc5bcac..7b61890cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStepConfig.java @@ -46,7 +46,7 @@ public Optional getNextNode() { return nextNode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStepConfig && equalTo((FormStepConfig) other); @@ -61,12 +61,12 @@ private boolean equalTo(FormStepConfig other) { return components.equals(other.components) && nextNode.equals(other.nextNode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.components, this.nextNode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormStyle.java b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java index 3ab3c11c8..f90d8dbbd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormStyle.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormStyle.java @@ -34,7 +34,7 @@ public Optional getCss() { return css; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormStyle && equalTo((FormStyle) other); @@ -49,12 +49,12 @@ private boolean equalTo(FormStyle other) { return css.equals(other.css); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.css); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormSummary.java b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java index d499073f8..e7dca63d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormSummary.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormSummary.java @@ -83,7 +83,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormSummary && equalTo((FormSummary) other); @@ -103,12 +103,12 @@ private boolean equalTo(FormSummary other) { && submittedAt.equals(other.submittedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.createdAt, this.updatedAt, this.embeddedAt, this.submittedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,7 +166,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormSummary other) { id(other.getId()); name(other.getName()); @@ -177,61 +177,61 @@ public Builder from(FormSummary other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @Override + @java.lang.Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @Override + @java.lang.Override public FormSummary build() { return new FormSummary(id, name, createdAt, updatedAt, embeddedAt, submittedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidget.java b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java index 13feebd10..7fc550a16 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidget.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidget.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidget && equalTo((FormWidget) other); @@ -51,12 +51,12 @@ private boolean equalTo(FormWidget other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer { super(FormWidget.class); } - @Override + @java.lang.Override public FormWidget deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java index 7ed510106..eea18bb7a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentials.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetAuth0VerifiableCredentials @@ -123,13 +123,13 @@ private boolean equalTo(FormWidgetAuth0VerifiableCredentials other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -199,7 +199,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetAuth0VerifiableCredentials other) { id(other.getId()); category(other.getCategory()); @@ -212,87 +212,87 @@ public Builder from(FormWidgetAuth0VerifiableCredentials other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetAuth0VerifiableCredentialsConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormWidgetAuth0VerifiableCredentials build() { return new FormWidgetAuth0VerifiableCredentials( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java index b08fadca7..89fe92e76 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetAuth0VerifiableCredentialsConfig.java @@ -82,7 +82,7 @@ public Optional getMaxWait() { return maxWait; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetAuth0VerifiableCredentialsConfig @@ -103,13 +103,13 @@ private boolean equalTo(FormWidgetAuth0VerifiableCredentialsConfig other) { && maxWait.equals(other.maxWait); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.url, this.size, this.alternateText, this.accessToken, this.verificationId, this.maxWait); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -168,7 +168,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetAuth0VerifiableCredentialsConfig other) { url(other.getUrl()); size(other.getSize()); @@ -179,61 +179,61 @@ public Builder from(FormWidgetAuth0VerifiableCredentialsConfig other) { return this; } - @Override + @java.lang.Override @JsonSetter("url") public AlternateTextStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("alternate_text") public AccessTokenStage alternateText(@NotNull String alternateText) { this.alternateText = Objects.requireNonNull(alternateText, "alternateText must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("access_token") public VerificationIdStage accessToken(@NotNull String accessToken) { this.accessToken = Objects.requireNonNull(accessToken, "accessToken must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("verification_id") public _FinalStage verificationId(@NotNull String verificationId) { this.verificationId = Objects.requireNonNull(verificationId, "verificationId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage maxWait(Double maxWait) { this.maxWait = Optional.ofNullable(maxWait); return this; } - @Override + @java.lang.Override @JsonSetter(value = "max_wait", nulls = Nulls.SKIP) public _FinalStage maxWait(Optional maxWait) { this.maxWait = maxWait; return this; } - @Override + @java.lang.Override public _FinalStage size(Double size) { this.size = Optional.ofNullable(size); return this; } - @Override + @java.lang.Override @JsonSetter(value = "size", nulls = Nulls.SKIP) public _FinalStage size(Optional size) { this.size = size; return this; } - @Override + @java.lang.Override public FormWidgetAuth0VerifiableCredentialsConfig build() { return new FormWidgetAuth0VerifiableCredentialsConfig( url, size, alternateText, accessToken, verificationId, maxWait, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java index 2ccad8113..f532695ae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddress.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetGMapsAddress && equalTo((FormWidgetGMapsAddress) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormWidgetGMapsAddress other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetGMapsAddress other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormWidgetGMapsAddress other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetGMapsAddressConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormWidgetGMapsAddress build() { return new FormWidgetGMapsAddress( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java index 2d5e91882..380619e1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetGMapsAddressConfig.java @@ -33,7 +33,7 @@ public String getApiKey() { return apiKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetGMapsAddressConfig && equalTo((FormWidgetGMapsAddressConfig) other); @@ -48,12 +48,12 @@ private boolean equalTo(FormWidgetGMapsAddressConfig other) { return apiKey.equals(other.apiKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apiKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ApiKeyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetGMapsAddressConfig other) { apiKey(other.getApiKey()); return this; } - @Override + @java.lang.Override @JsonSetter("api_key") public _FinalStage apiKey(@NotNull String apiKey) { this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null"); return this; } - @Override + @java.lang.Override public FormWidgetGMapsAddressConfig build() { return new FormWidgetGMapsAddressConfig(apiKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java index 0d4e2bae3..ad4e811a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptcha.java @@ -100,7 +100,7 @@ public Optional getSensitive() { return sensitive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetRecaptcha && equalTo((FormWidgetRecaptcha) other); @@ -122,13 +122,13 @@ private boolean equalTo(FormWidgetRecaptcha other) { && sensitive.equals(other.sensitive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.category, this.type, this.config, this.label, this.hint, this.required, this.sensitive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -198,7 +198,7 @@ public static final class Builder implements IdStage, CategoryStage, TypeStage, private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetRecaptcha other) { id(other.getId()); category(other.getCategory()); @@ -211,87 +211,87 @@ public Builder from(FormWidgetRecaptcha other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public CategoryStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("category") public TypeStage category(@NotNull String category) { this.category = Objects.requireNonNull(category, "category must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull FormWidgetRecaptchaConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage sensitive(Boolean sensitive) { this.sensitive = Optional.ofNullable(sensitive); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sensitive", nulls = Nulls.SKIP) public _FinalStage sensitive(Optional sensitive) { this.sensitive = sensitive; return this; } - @Override + @java.lang.Override public _FinalStage required(Boolean required) { this.required = Optional.ofNullable(required); return this; } - @Override + @java.lang.Override @JsonSetter(value = "required", nulls = Nulls.SKIP) public _FinalStage required(Optional required) { this.required = required; return this; } - @Override + @java.lang.Override public _FinalStage hint(String hint) { this.hint = Optional.ofNullable(hint); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hint", nulls = Nulls.SKIP) public _FinalStage hint(Optional hint) { this.hint = hint; return this; } - @Override + @java.lang.Override public _FinalStage label(String label) { this.label = Optional.ofNullable(label); return this; } - @Override + @java.lang.Override @JsonSetter(value = "label", nulls = Nulls.SKIP) public _FinalStage label(Optional label) { this.label = label; return this; } - @Override + @java.lang.Override public FormWidgetRecaptcha build() { return new FormWidgetRecaptcha( id, category, type, config, label, hint, required, sensitive, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java index 6ef6754c6..eb3212400 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormWidgetRecaptchaConfig.java @@ -41,7 +41,7 @@ public String getSecretKey() { return secretKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FormWidgetRecaptchaConfig && equalTo((FormWidgetRecaptchaConfig) other); @@ -56,12 +56,12 @@ private boolean equalTo(FormWidgetRecaptchaConfig other) { return siteKey.equals(other.siteKey) && secretKey.equals(other.secretKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.siteKey, this.secretKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +95,28 @@ public static final class Builder implements SiteKeyStage, SecretKeyStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(FormWidgetRecaptchaConfig other) { siteKey(other.getSiteKey()); secretKey(other.getSecretKey()); return this; } - @Override + @java.lang.Override @JsonSetter("site_key") public SecretKeyStage siteKey(@NotNull String siteKey) { this.siteKey = Objects.requireNonNull(siteKey, "siteKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("secret_key") public _FinalStage secretKey(@NotNull String secretKey) { this.secretKey = Objects.requireNonNull(secretKey, "secretKey must not be null"); return this; } - @Override + @java.lang.Override public FormWidgetRecaptchaConfig build() { return new FormWidgetRecaptchaConfig(siteKey, secretKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java index fe1eff168..b0d8f710c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/FormsRequestParametersHydrateEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof FormsRequestParametersHydrateEnum && this.string.equals(((FormsRequestParametersHydrateEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java index 10ae0baba..676cf76ab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionExecutionResponseContent.java @@ -92,7 +92,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionExecutionResponseContent && equalTo((GetActionExecutionResponseContent) other); @@ -112,12 +112,12 @@ private boolean equalTo(GetActionExecutionResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.triggerId, this.status, this.results, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java index 94bcf7e38..b2808f546 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionResponseContent.java @@ -54,6 +54,8 @@ public final class GetActionResponseContent { private final Optional deploy; + private final Optional> modules; + private final Map additionalProperties; private GetActionResponseContent( @@ -73,6 +75,7 @@ private GetActionResponseContent( Optional status, Optional builtAt, Optional deploy, + Optional> modules, Map additionalProperties) { this.id = id; this.name = name; @@ -90,6 +93,7 @@ private GetActionResponseContent( this.status = status; this.builtAt = builtAt; this.deploy = deploy; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -212,7 +216,15 @@ public Optional getDeploy() { return deploy; } - @Override + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionResponseContent && equalTo((GetActionResponseContent) other); @@ -239,10 +251,11 @@ private boolean equalTo(GetActionResponseContent other) { && integration.equals(other.integration) && status.equals(other.status) && builtAt.equals(other.builtAt) - && deploy.equals(other.deploy); + && deploy.equals(other.deploy) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -260,10 +273,11 @@ public int hashCode() { this.integration, this.status, this.builtAt, - this.deploy); + this.deploy, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -306,6 +320,8 @@ public static final class Builder { private Optional deploy = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -328,6 +344,7 @@ public Builder from(GetActionResponseContent other) { status(other.getStatus()); builtAt(other.getBuiltAt()); deploy(other.getDeploy()); + modules(other.getModules()); return this; } @@ -546,6 +563,20 @@ public Builder deploy(Boolean deploy) { return this; } + /** + *

The list of action modules and their versions used by this action.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public GetActionResponseContent build() { return new GetActionResponseContent( id, @@ -564,6 +595,7 @@ public GetActionResponseContent build() { status, builtAt, deploy, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java index ba4202699..b734effce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetActionVersionResponseContent.java @@ -52,6 +52,8 @@ public final class GetActionVersionResponseContent { private final Optional> supportedTriggers; + private final Optional> modules; + private final Map additionalProperties; private GetActionVersionResponseContent( @@ -70,6 +72,7 @@ private GetActionVersionResponseContent( Optional createdAt, Optional updatedAt, Optional> supportedTriggers, + Optional> modules, Map additionalProperties) { this.id = id; this.actionId = actionId; @@ -86,6 +89,7 @@ private GetActionVersionResponseContent( this.createdAt = createdAt; this.updatedAt = updatedAt; this.supportedTriggers = supportedTriggers; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -203,7 +207,15 @@ public Optional> getSupportedTriggers() { return supportedTriggers; } - @Override + /** + * @return The list of action modules and their versions used by this action version. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetActionVersionResponseContent && equalTo((GetActionVersionResponseContent) other); @@ -229,10 +241,11 @@ private boolean equalTo(GetActionVersionResponseContent other) { && builtAt.equals(other.builtAt) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) - && supportedTriggers.equals(other.supportedTriggers); + && supportedTriggers.equals(other.supportedTriggers) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -249,10 +262,11 @@ public int hashCode() { this.builtAt, this.createdAt, this.updatedAt, - this.supportedTriggers); + this.supportedTriggers, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,6 +307,8 @@ public static final class Builder { private Optional> supportedTriggers = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -314,6 +330,7 @@ public Builder from(GetActionVersionResponseContent other) { createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); supportedTriggers(other.getSupportedTriggers()); + modules(other.getModules()); return this; } @@ -521,6 +538,20 @@ public Builder supportedTriggers(List supportedTriggers) { return this; } + /** + *

The list of action modules and their versions used by this action version.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public GetActionVersionResponseContent build() { return new GetActionVersionResponseContent( id, @@ -538,6 +569,7 @@ public GetActionVersionResponseContent build() { createdAt, updatedAt, supportedTriggers, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java index 928f67f57..3ae5e784b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetAculResponseContent.java @@ -153,7 +153,7 @@ private OptionalNullable _getFilters() { return filters; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetAculResponseContent && equalTo((GetAculResponseContent) other); @@ -176,7 +176,7 @@ private boolean equalTo(GetAculResponseContent other) { && filters.equals(other.filters); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.tenant, @@ -190,7 +190,7 @@ public int hashCode() { this.filters); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java index f3ab71e57..06ae4b92b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetAttackProtectionCaptchaResponseContent.java @@ -99,7 +99,7 @@ public Optional> getSimpleCaptcha() { return simpleCaptcha; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetAttackProtectionCaptchaResponseContent @@ -122,7 +122,7 @@ private boolean equalTo(GetAttackProtectionCaptchaResponseContent other) { && simpleCaptcha.equals(other.simpleCaptcha); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.activeProviderId, @@ -135,7 +135,7 @@ public int hashCode() { this.simpleCaptcha); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java index cada4dd7b..d5eb50df4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBotDetectionSettingsResponseContent.java @@ -83,7 +83,7 @@ public boolean getMonitoringModeEnabled() { return monitoringModeEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBotDetectionSettingsResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(GetBotDetectionSettingsResponseContent other) { && monitoringModeEnabled == other.monitoringModeEnabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.botDetectionLevel, @@ -115,7 +115,7 @@ public int hashCode() { this.monitoringModeEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -184,7 +184,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetBotDetectionSettingsResponseContent other) { botDetectionLevel(other.getBotDetectionLevel()); challengePasswordPolicy(other.getChallengePasswordPolicy()); @@ -195,14 +195,14 @@ public Builder from(GetBotDetectionSettingsResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("bot_detection_level") public ChallengePasswordPolicyStage botDetectionLevel(@NotNull BotDetectionLevelEnum botDetectionLevel) { this.botDetectionLevel = Objects.requireNonNull(botDetectionLevel, "botDetectionLevel must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("challenge_password_policy") public ChallengePasswordlessPolicyStage challengePasswordPolicy( @NotNull BotDetectionChallengePolicyPasswordFlowEnum challengePasswordPolicy) { @@ -211,7 +211,7 @@ public ChallengePasswordlessPolicyStage challengePasswordPolicy( return this; } - @Override + @java.lang.Override @JsonSetter("challenge_passwordless_policy") public ChallengePasswordResetPolicyStage challengePasswordlessPolicy( @NotNull BotDetectionChallengePolicyPasswordlessFlowEnum challengePasswordlessPolicy) { @@ -220,7 +220,7 @@ public ChallengePasswordResetPolicyStage challengePasswordlessPolicy( return this; } - @Override + @java.lang.Override @JsonSetter("challenge_password_reset_policy") public MonitoringModeEnabledStage challengePasswordResetPolicy( @NotNull BotDetectionChallengePolicyPasswordResetFlowEnum challengePasswordResetPolicy) { @@ -229,14 +229,14 @@ public MonitoringModeEnabledStage challengePasswordResetPolicy( return this; } - @Override + @java.lang.Override @JsonSetter("monitoring_mode_enabled") public _FinalStage monitoringModeEnabled(boolean monitoringModeEnabled) { this.monitoringModeEnabled = monitoringModeEnabled; return this; } - @Override + @java.lang.Override public _FinalStage addAllAllowlist(List allowlist) { if (allowlist != null) { this.allowlist.addAll(allowlist); @@ -244,13 +244,13 @@ public _FinalStage addAllAllowlist(List allowlist) { return this; } - @Override + @java.lang.Override public _FinalStage addAllowlist(String allowlist) { this.allowlist.add(allowlist); return this; } - @Override + @java.lang.Override @JsonSetter(value = "allowlist", nulls = Nulls.SKIP) public _FinalStage allowlist(List allowlist) { this.allowlist.clear(); @@ -260,7 +260,7 @@ public _FinalStage allowlist(List allowlist) { return this; } - @Override + @java.lang.Override public GetBotDetectionSettingsResponseContent build() { return new GetBotDetectionSettingsResponseContent( botDetectionLevel, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java index 52bc980ab..3309725f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingDefaultThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingDefaultThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(GetBrandingDefaultThemeResponseContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetBrandingDefaultThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(GetBrandingDefaultThemeResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @Override + @java.lang.Override public GetBrandingDefaultThemeResponseContent build() { return new GetBrandingDefaultThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java index 919550705..08f799854 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingPhoneProviderResponseContent.java @@ -113,7 +113,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(GetBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(GetBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(GetBrandingPhoneProviderResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @Override + @java.lang.Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public GetBrandingPhoneProviderResponseContent build() { return new GetBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java index ea0d3ff9e..a647a9d18 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingResponseContent.java @@ -69,7 +69,7 @@ public Optional getFont() { return font; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingResponseContent && equalTo((GetBrandingResponseContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(GetBrandingResponseContent other) { && font.equals(other.font); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java index 575a5f242..6bf26326d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBrandingThemeResponseContent && equalTo((GetBrandingThemeResponseContent) other); @@ -116,7 +116,7 @@ private boolean equalTo(GetBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.borders, @@ -128,7 +128,7 @@ public int hashCode() { this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -206,7 +206,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -218,14 +218,14 @@ public Builder from(GetBrandingThemeResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -237,21 +237,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -263,21 +263,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @Override + @java.lang.Override public GetBrandingThemeResponseContent build() { return new GetBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java index ad2641d20..125b7d2cb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBreachedPasswordDetectionSettingsResponseContent.java @@ -84,7 +84,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBreachedPasswordDetectionSettingsResponseContent @@ -104,12 +104,12 @@ private boolean equalTo(GetBreachedPasswordDetectionSettingsResponseContent othe && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java index e9d3c4245..1efa800b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetBruteForceSettingsResponseContent @@ -110,12 +110,12 @@ private boolean equalTo(GetBruteForceSettingsResponseContent other) { && maxAttempts.equals(other.maxAttempts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java index 8f1e54aa6..eac3c1ac2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GetBruteForceSettingsResponseContentMode && this.string.equals(((GetBruteForceSettingsResponseContentMode) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java index 2a32159c1..82a015ce8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetBruteForceSettingsResponseContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GetBruteForceSettingsResponseContentShieldsItem && this.string.equals(((GetBruteForceSettingsResponseContentShieldsItem) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java index 2a61bea60..413a65ae1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(GetClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java index 8eb398a7c..de80034af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientRequestParameters && equalTo((GetClientRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetClientRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java index 61156ff1e..4a2fc277e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java @@ -676,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetClientResponseContent && equalTo((GetClientResponseContent) other); @@ -744,7 +744,7 @@ private boolean equalTo(GetClientResponseContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -802,7 +802,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java index 62dfc042e..bb84d0ac9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionEnabledClientsResponseContent.java @@ -51,7 +51,7 @@ public Optional getNext() { return next; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionEnabledClientsResponseContent @@ -67,12 +67,12 @@ private boolean equalTo(GetConnectionEnabledClientsResponseContent other) { return clients.equals(other.clients) && next.equals(other.next); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clients, this.next); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java index 75e6f3bf2..36042f5e8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileResponseContent.java @@ -91,7 +91,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionProfileResponseContent @@ -113,7 +113,7 @@ private boolean equalTo(GetConnectionProfileResponseContent other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -125,7 +125,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java index 464928d05..dd5a95274 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionProfileTemplateResponseContent.java @@ -60,7 +60,7 @@ public Optional getTemplate() { return template; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionProfileTemplateResponseContent @@ -76,12 +76,12 @@ private boolean equalTo(GetConnectionProfileTemplateResponseContent other) { return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.displayName, this.template); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java index 712374bb2..51b0465ae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionRequestParameters && equalTo((GetConnectionRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetConnectionRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java index babad67ca..d3ca8697b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetConnectionResponseContent.java @@ -161,7 +161,7 @@ public Optional getConnectedAccounts() { return connectedAccounts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetConnectionResponseContent && equalTo((GetConnectionResponseContent) other); @@ -187,7 +187,7 @@ private boolean equalTo(GetConnectionResponseContent other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -204,7 +204,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java index d6c23fa9e..c259db4b5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomDomainResponseContent.java @@ -158,7 +158,7 @@ private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetCustomDomainResponseContent && equalTo((GetCustomDomainResponseContent) other); @@ -183,7 +183,7 @@ private boolean equalTo(GetCustomDomainResponseContent other) { && certificate.equals(other.certificate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.customDomainId, @@ -199,7 +199,7 @@ public int hashCode() { this.certificate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -310,7 +310,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); @@ -331,7 +331,7 @@ public Builder from(GetCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -343,7 +343,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -355,47 +355,47 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage certificate(DomainCertificate certificate) { this.certificate = Optional.ofNullable(certificate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "certificate", nulls = Nulls.SKIP) public _FinalStage certificate(Optional certificate) { this.certificate = certificate; return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; @@ -406,7 +406,7 @@ public _FinalStage domainMetadata(Optional> *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -415,7 +415,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -426,7 +426,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -442,7 +442,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -456,7 +456,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -465,20 +465,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @Override + @java.lang.Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @Override + @java.lang.Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -489,7 +489,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -498,14 +498,14 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; return this; } - @Override + @java.lang.Override public GetCustomDomainResponseContent build() { return new GetCustomDomainResponseContent( customDomainId, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java index 0c21765ca..a7392658e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetCustomSigningKeysResponseContent.java @@ -39,7 +39,7 @@ public Optional> getKeys() { return keys; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetCustomSigningKeysResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(GetCustomSigningKeysResponseContent other) { return keys.equals(other.keys); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.keys); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java index b7c98c0bb..5c044597e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetDailyStatsRequestParameters.java @@ -72,7 +72,7 @@ private OptionalNullable _getTo() { return to; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetDailyStatsRequestParameters && equalTo((GetDailyStatsRequestParameters) other); @@ -87,12 +87,12 @@ private boolean equalTo(GetDailyStatsRequestParameters other) { return from.equals(other.from) && to.equals(other.to); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.to); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java index c3c33d1cf..150848431 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningDefaultMappingResponseContent.java @@ -39,7 +39,7 @@ public Optional> getMapping() { return mapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetDirectoryProvisioningDefaultMappingResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(GetDirectoryProvisioningDefaultMappingResponseContent ot return mapping.equals(other.mapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java index aaee740cc..0fc87627a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java @@ -151,7 +151,7 @@ public Optional getLastSynchronizationError() { return lastSynchronizationError; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetDirectoryProvisioningResponseContent @@ -176,7 +176,7 @@ private boolean equalTo(GetDirectoryProvisioningResponseContent other) { && lastSynchronizationError.equals(other.lastSynchronizationError); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -191,7 +191,7 @@ public int hashCode() { this.lastSynchronizationError); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -312,7 +312,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetDirectoryProvisioningResponseContent other) { connectionId(other.getConnectionId()); connectionName(other.getConnectionName()); @@ -332,7 +332,7 @@ public Builder from(GetDirectoryProvisioningResponseContent other) { *

The connection's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public ConnectionNameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -344,7 +344,7 @@ public ConnectionNameStage connectionId(@NotNull String connectionId) { *

The connection's name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_name") public StrategyStage connectionName(@NotNull String connectionName) { this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); @@ -356,7 +356,7 @@ public StrategyStage connectionName(@NotNull String connectionName) { *

The connection's strategy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("strategy") public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); @@ -368,7 +368,7 @@ public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { *

Whether periodic automatic synchronization is enabled

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("synchronize_automatically") public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { this.synchronizeAutomatically = synchronizeAutomatically; @@ -380,7 +380,7 @@ public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) *

The timestamp at which the directory provisioning configuration was created

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -392,7 +392,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The timestamp at which the directory provisioning configuration was last updated

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -403,7 +403,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The error message of the last synchronization, if any

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationError(String lastSynchronizationError) { this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); return this; @@ -412,7 +412,7 @@ public _FinalStage lastSynchronizationError(String lastSynchronizationError) { /** *

The error message of the last synchronization, if any

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { this.lastSynchronizationError = lastSynchronizationError; @@ -423,7 +423,7 @@ public _FinalStage lastSynchronizationError(Optional lastSynchronization *

The status of the last synchronization

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); return this; @@ -432,7 +432,7 @@ public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { /** *

The status of the last synchronization

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { this.lastSynchronizationStatus = lastSynchronizationStatus; @@ -443,7 +443,7 @@ public _FinalStage lastSynchronizationStatus(Optional lastSynchronizatio *

The timestamp at which the connection was last synchronized

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); return this; @@ -452,7 +452,7 @@ public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { /** *

The timestamp at which the connection was last synchronized

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { this.lastSynchronizationAt = lastSynchronizationAt; @@ -463,7 +463,7 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllMapping(List mapping) { if (mapping != null) { this.mapping.addAll(mapping); @@ -475,7 +475,7 @@ public _FinalStage addAllMapping(List mapping) *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { this.mapping.add(mapping); return this; @@ -484,7 +484,7 @@ public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { /** *

The mapping between Auth0 and IDP user attributes

*/ - @Override + @java.lang.Override @JsonSetter(value = "mapping", nulls = Nulls.SKIP) public _FinalStage mapping(List mapping) { this.mapping.clear(); @@ -494,7 +494,7 @@ public _FinalStage mapping(List mapping) { return this; } - @Override + @java.lang.Override public GetDirectoryProvisioningResponseContent build() { return new GetDirectoryProvisioningResponseContent( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java index 27b6d6193..33b76c557 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailProviderResponseContent && equalTo((GetEmailProviderResponseContent) other); @@ -100,12 +100,12 @@ private boolean equalTo(GetEmailProviderResponseContent other) { && settings.equals(other.settings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java index 124ca00ba..8907b4e80 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailTemplateResponseContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEmailTemplateResponseContent && equalTo((GetEmailTemplateResponseContent) other); @@ -228,7 +228,7 @@ private boolean equalTo(GetEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -242,7 +242,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java index cd8eb0547..b56881929 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEncryptionKeyResponseContent && equalTo((GetEncryptionKeyResponseContent) other); @@ -128,13 +128,13 @@ private boolean equalTo(GetEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -214,7 +214,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -231,21 +231,21 @@ public Builder from(GetEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -257,7 +257,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -269,7 +269,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -281,7 +281,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -292,7 +292,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -301,14 +301,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @Override + @java.lang.Override public GetEncryptionKeyResponseContent build() { return new GetEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java index d8e957c06..84acb36ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamDeliveryHistoryResponseContent.java @@ -93,7 +93,7 @@ public Optional getEvent() { return event; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEventStreamDeliveryHistoryResponseContent @@ -114,12 +114,12 @@ private boolean equalTo(GetEventStreamDeliveryHistoryResponseContent other) { && event.equals(other.event); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.eventStreamId, this.status, this.eventType, this.attempts, this.event); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, EventStreamIdStage, Status private Builder() {} - @Override + @java.lang.Override public Builder from(GetEventStreamDeliveryHistoryResponseContent other) { id(other.getId()); eventStreamId(other.getEventStreamId()); @@ -204,7 +204,7 @@ public Builder from(GetEventStreamDeliveryHistoryResponseContent other) { *

Unique identifier for the delivery

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public EventStreamIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -216,34 +216,34 @@ public EventStreamIdStage id(@NotNull String id) { *

Unique identifier for the event stream.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("event_stream_id") public StatusStage eventStreamId(@NotNull String eventStreamId) { this.eventStreamId = Objects.requireNonNull(eventStreamId, "eventStreamId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public EventTypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("event_type") public _FinalStage eventType(@NotNull EventStreamDeliveryEventTypeEnum eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage event(EventStreamCloudEvent event) { this.event = Optional.ofNullable(event); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; @@ -254,7 +254,7 @@ public _FinalStage event(Optional event) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllAttempts(List attempts) { if (attempts != null) { this.attempts.addAll(attempts); @@ -266,7 +266,7 @@ public _FinalStage addAllAttempts(List attempts) { *

Results of delivery attempts

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { this.attempts.add(attempts); return this; @@ -275,7 +275,7 @@ public _FinalStage addAttempts(EventStreamDeliveryAttempt attempts) { /** *

Results of delivery attempts

*/ - @Override + @java.lang.Override @JsonSetter(value = "attempts", nulls = Nulls.SKIP) public _FinalStage attempts(List attempts) { this.attempts.clear(); @@ -285,7 +285,7 @@ public _FinalStage attempts(List attempts) { return this; } - @Override + @java.lang.Override public GetEventStreamDeliveryHistoryResponseContent build() { return new GetEventStreamDeliveryHistoryResponseContent( id, eventStreamId, status, eventType, attempts, event, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java index d3c2683d2..ca3fd3d8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetEventStreamResponseContent && equalTo((GetEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(GetEventStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer getEndedAt() { return endedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowExecutionResponseContent && equalTo((GetFlowExecutionResponseContent) other); @@ -157,7 +157,7 @@ private boolean equalTo(GetFlowExecutionResponseContent other) { && endedAt.equals(other.endedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.endedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -272,7 +272,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetFlowExecutionResponseContent other) { id(other.getId()); traceId(other.getTraceId()); @@ -291,7 +291,7 @@ public Builder from(GetFlowExecutionResponseContent other) { *

Flow execution identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public TraceIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -303,7 +303,7 @@ public TraceIdStage id(@NotNull String id) { *

Trace id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("trace_id") public StatusStage traceId(@NotNull String traceId) { this.traceId = Objects.requireNonNull(traceId, "traceId must not be null"); @@ -315,7 +315,7 @@ public StatusStage traceId(@NotNull String traceId) { *

Execution status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public CreatedAtStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -327,7 +327,7 @@ public CreatedAtStage status(@NotNull String status) { *

The ISO 8601 formatted date when this flow execution was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -339,7 +339,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this flow execution was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -350,7 +350,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The ISO 8601 formatted date when this flow execution ended.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage endedAt(OffsetDateTime endedAt) { this.endedAt = Optional.ofNullable(endedAt); return this; @@ -359,7 +359,7 @@ public _FinalStage endedAt(OffsetDateTime endedAt) { /** *

The ISO 8601 formatted date when this flow execution ended.

*/ - @Override + @java.lang.Override @JsonSetter(value = "ended_at", nulls = Nulls.SKIP) public _FinalStage endedAt(Optional endedAt) { this.endedAt = endedAt; @@ -370,7 +370,7 @@ public _FinalStage endedAt(Optional endedAt) { *

The ISO 8601 formatted date when this flow execution started.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage startedAt(OffsetDateTime startedAt) { this.startedAt = Optional.ofNullable(startedAt); return this; @@ -379,20 +379,20 @@ public _FinalStage startedAt(OffsetDateTime startedAt) { /** *

The ISO 8601 formatted date when this flow execution started.

*/ - @Override + @java.lang.Override @JsonSetter(value = "started_at", nulls = Nulls.SKIP) public _FinalStage startedAt(Optional startedAt) { this.startedAt = startedAt; return this; } - @Override + @java.lang.Override public _FinalStage debug(Map debug) { this.debug = Optional.ofNullable(debug); return this; } - @Override + @java.lang.Override @JsonSetter(value = "debug", nulls = Nulls.SKIP) public _FinalStage debug(Optional> debug) { this.debug = debug; @@ -403,7 +403,7 @@ public _FinalStage debug(Optional> debug) { *

Journey id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage journeyId(String journeyId) { this.journeyId = Optional.ofNullable(journeyId); return this; @@ -412,14 +412,14 @@ public _FinalStage journeyId(String journeyId) { /** *

Journey id

*/ - @Override + @java.lang.Override @JsonSetter(value = "journey_id", nulls = Nulls.SKIP) public _FinalStage journeyId(Optional journeyId) { this.journeyId = journeyId; return this; } - @Override + @java.lang.Override public GetFlowExecutionResponseContent build() { return new GetFlowExecutionResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java index 30c151a44..e526c2f07 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParameters.java @@ -52,7 +52,7 @@ private Optional> _getHydrate() { return hydrate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowRequestParameters && equalTo((GetFlowRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(GetFlowRequestParameters other) { return hydrate.equals(other.hydrate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hydrate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java index e31185548..cbed07c94 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowRequestParametersHydrateEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GetFlowRequestParametersHydrateEnum && this.string.equals(((GetFlowRequestParametersHydrateEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java index fc305f13d..5f7ca895d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowResponseContent && equalTo((GetFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(GetFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(GetFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(GetFlowResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @Override + @java.lang.Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @Override + @java.lang.Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @Override + @java.lang.Override public GetFlowResponseContent build() { return new GetFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java index 2a0055289..1effc5c7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFlowsVaultConnectionResponseContent.java @@ -146,7 +146,7 @@ public String getFingerprint() { return fingerprint; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFlowsVaultConnectionResponseContent @@ -171,7 +171,7 @@ private boolean equalTo(GetFlowsVaultConnectionResponseContent other) { && fingerprint.equals(other.fingerprint); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.fingerprint); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -303,7 +303,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(GetFlowsVaultConnectionResponseContent other) { id(other.getId()); appId(other.getAppId()); @@ -323,7 +323,7 @@ public Builder from(GetFlowsVaultConnectionResponseContent other) { *

Flows Vault Connection identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public AppIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -335,7 +335,7 @@ public AppIdStage id(@NotNull String id) { *

Flows Vault Connection app identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("app_id") public NameStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); @@ -347,7 +347,7 @@ public NameStage appId(@NotNull String appId) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ReadyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -359,7 +359,7 @@ public ReadyStage name(@NotNull String name) { *

Whether the Flows Vault Connection is configured.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ready") public CreatedAtStage ready(boolean ready) { this.ready = ready; @@ -371,7 +371,7 @@ public CreatedAtStage ready(boolean ready) { *

The ISO 8601 formatted date when this Flows Vault Connection was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -383,14 +383,14 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fingerprint") public _FinalStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -401,7 +401,7 @@ public _FinalStage fingerprint(@NotNull String fingerprint) { *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { this.refreshedAt = Optional.ofNullable(refreshedAt); return this; @@ -410,7 +410,7 @@ public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { /** *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) public _FinalStage refreshedAt(Optional refreshedAt) { this.refreshedAt = refreshedAt; @@ -421,7 +421,7 @@ public _FinalStage refreshedAt(Optional refreshedAt) { *

Flows Vault Connection custom account name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accountName(String accountName) { this.accountName = Optional.ofNullable(accountName); return this; @@ -430,7 +430,7 @@ public _FinalStage accountName(String accountName) { /** *

Flows Vault Connection custom account name.

*/ - @Override + @java.lang.Override @JsonSetter(value = "account_name", nulls = Nulls.SKIP) public _FinalStage accountName(Optional accountName) { this.accountName = accountName; @@ -441,7 +441,7 @@ public _FinalStage accountName(Optional accountName) { *

Flows Vault Connection environment.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage environment(String environment) { this.environment = Optional.ofNullable(environment); return this; @@ -450,14 +450,14 @@ public _FinalStage environment(String environment) { /** *

Flows Vault Connection environment.

*/ - @Override + @java.lang.Override @JsonSetter(value = "environment", nulls = Nulls.SKIP) public _FinalStage environment(Optional environment) { this.environment = environment; return this; } - @Override + @java.lang.Override public GetFlowsVaultConnectionResponseContent build() { return new GetFlowsVaultConnectionResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java index e8c7090b5..0370436da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormRequestParameters.java @@ -52,7 +52,7 @@ private Optional> _getHydrate() { return hydrate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFormRequestParameters && equalTo((GetFormRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(GetFormRequestParameters other) { return hydrate.equals(other.hydrate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hydrate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java index e23c193bd..fda4b7a33 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetFormResponseContent.java @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetFormResponseContent && equalTo((GetFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(GetFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(GetFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(GetFormResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @Override + @java.lang.Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @Override + @java.lang.Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @Override + @java.lang.Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @Override + @java.lang.Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @Override + @java.lang.Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @Override + @java.lang.Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @Override + @java.lang.Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @Override + @java.lang.Override public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @Override + @java.lang.Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @Override + @java.lang.Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @Override + @java.lang.Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @Override + @java.lang.Override public GetFormResponseContent build() { return new GetFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java index 7faa7d93c..bf2dcd0a7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianEnrollmentResponseContent.java @@ -103,7 +103,7 @@ public Optional getLastAuth() { return lastAuth; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianEnrollmentResponseContent @@ -125,13 +125,13 @@ private boolean equalTo(GetGuardianEnrollmentResponseContent other) { && lastAuth.equals(other.lastAuth); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.status, this.name, this.identifier, this.phoneNumber, this.enrolledAt, this.lastAuth); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder implements IdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(GetGuardianEnrollmentResponseContent other) { id(other.getId()); status(other.getStatus()); @@ -224,33 +224,33 @@ public Builder from(GetGuardianEnrollmentResponseContent other) { *

ID for this enrollment.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage lastAuth(String lastAuth) { this.lastAuth = Optional.ofNullable(lastAuth); return this; } - @Override + @java.lang.Override @JsonSetter(value = "last_auth", nulls = Nulls.SKIP) public _FinalStage lastAuth(Optional lastAuth) { this.lastAuth = lastAuth; return this; } - @Override + @java.lang.Override public _FinalStage enrolledAt(String enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -261,7 +261,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -270,7 +270,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Phone number.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -281,7 +281,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Device identifier. This is usually the phone identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage identifier(String identifier) { this.identifier = Optional.ofNullable(identifier); return this; @@ -290,7 +290,7 @@ public _FinalStage identifier(String identifier) { /** *

Device identifier. This is usually the phone identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "identifier", nulls = Nulls.SKIP) public _FinalStage identifier(Optional identifier) { this.identifier = identifier; @@ -301,7 +301,7 @@ public _FinalStage identifier(Optional identifier) { *

Device name (only for push notification).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -310,27 +310,27 @@ public _FinalStage name(String name) { /** *

Device name (only for push notification).

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage status(GuardianEnrollmentStatus status) { this.status = Optional.ofNullable(status); return this; } - @Override + @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; return this; } - @Override + @java.lang.Override public GetGuardianEnrollmentResponseContent build() { return new GetGuardianEnrollmentResponseContent( id, status, name, identifier, phoneNumber, enrolledAt, lastAuth, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java index 2599967b7..a400b0fd0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(GetGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java index 583e5642f..9cd64efc5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneMessageTypesResponseContent.java @@ -40,7 +40,7 @@ public Optional> getMessageTypes( return messageTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorPhoneMessageTypesResponseContent @@ -56,12 +56,12 @@ private boolean equalTo(GetGuardianFactorPhoneMessageTypesResponseContent other) return messageTypes.equals(other.messageTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.messageTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java index 6d12c8261..5a1c1ca0a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorPhoneTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorPhoneTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(GetGuardianFactorPhoneTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(GetGuardianFactorPhoneTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(GetGuardianFactorPhoneTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public GetGuardianFactorPhoneTemplatesResponseContent build() { return new GetGuardianFactorPhoneTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java index f6cac4782..e6402e537 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorSmsTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorSmsTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(GetGuardianFactorSmsTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(GetGuardianFactorSmsTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(GetGuardianFactorSmsTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public GetGuardianFactorSmsTemplatesResponseContent build() { return new GetGuardianFactorSmsTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java index 65a3e3f6d..96f717c2b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderApnsResponseContent.java @@ -67,7 +67,7 @@ private OptionalNullable _getBundleId() { return bundleId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderApnsResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(GetGuardianFactorsProviderApnsResponseContent other) { return bundleId.equals(other.bundleId) && sandbox.equals(other.sandbox) && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bundleId, this.sandbox, this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java index 506c629de..5b13c1cc4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPhoneResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(GetGuardianFactorsProviderPhoneResponseContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java index f5964846b..7d7d0543f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPhoneTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(GetGuardianFactorsProviderPhoneTwilioResponseContent oth && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java index b63dbfe6b..ac65d4e65 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderPushNotificationResponseContent.java @@ -36,7 +36,7 @@ public Optional getProv return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderPushNotificationResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(GetGuardianFactorsProviderPushNotificationResponseConten return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java index 3f283abcf..3a720f8c7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSmsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(GetGuardianFactorsProviderSmsResponseContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java index 7ce32a7e1..49e7e495c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSmsTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(GetGuardianFactorsProviderSmsTwilioResponseContent other && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java index 67b8ad58c..7cc96727d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianFactorsProviderSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetGuardianFactorsProviderSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(GetGuardianFactorsProviderSnsResponseContent other) { && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java index 7784165b8..3c3c39176 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookRequestParameters.java @@ -50,7 +50,7 @@ private OptionalNullable _getFields() { return fields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetHookRequestParameters && equalTo((GetHookRequestParameters) other); @@ -65,12 +65,12 @@ private boolean equalTo(GetHookRequestParameters other) { return fields.equals(other.fields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java index 40107eff4..d7ad3bea4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetHookResponseContent.java @@ -96,7 +96,7 @@ public Optional> getDependencies() { return dependencies; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetHookResponseContent && equalTo((GetHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(GetHookResponseContent other) { && dependencies.equals(other.dependencies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java index 62dab9e67..032a6928c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobErrorResponseContent.java @@ -49,7 +49,7 @@ public Optional> getErrors() { return errors; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobErrorResponseContent && equalTo((GetJobErrorResponseContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(GetJobErrorResponseContent other) { return user.equals(other.user) && errors.equals(other.errors); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.user, this.errors); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java index 55fc48ab0..54163273a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobGenericErrorResponseContent.java @@ -100,7 +100,7 @@ public Optional getStatusDetails() { return statusDetails; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobGenericErrorResponseContent && equalTo((GetJobGenericErrorResponseContent) other); @@ -120,12 +120,12 @@ private boolean equalTo(GetJobGenericErrorResponseContent other) { && statusDetails.equals(other.statusDetails); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.type, this.createdAt, this.id, this.connectionId, this.statusDetails); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -201,7 +201,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(GetJobGenericErrorResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -217,7 +217,7 @@ public Builder from(GetJobGenericErrorResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -229,7 +229,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -241,7 +241,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -252,7 +252,7 @@ public _FinalStage id(@NotNull String id) { *

Status details.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage statusDetails(String statusDetails) { this.statusDetails = Optional.ofNullable(statusDetails); return this; @@ -261,7 +261,7 @@ public _FinalStage statusDetails(String statusDetails) { /** *

Status details.

*/ - @Override + @java.lang.Override @JsonSetter(value = "status_details", nulls = Nulls.SKIP) public _FinalStage statusDetails(Optional statusDetails) { this.statusDetails = statusDetails; @@ -272,7 +272,7 @@ public _FinalStage statusDetails(Optional statusDetails) { *

connection_id of the connection this job uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -281,7 +281,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection this job uses.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -292,7 +292,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -301,14 +301,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public GetJobGenericErrorResponseContent build() { return new GetJobGenericErrorResponseContent( status, type, createdAt, id, connectionId, statusDetails, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java index cd003037b..679232e11 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobImportUserError.java @@ -63,7 +63,7 @@ public Optional getPath() { return path; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobImportUserError && equalTo((GetJobImportUserError) other); @@ -78,12 +78,12 @@ private boolean equalTo(GetJobImportUserError other) { return code.equals(other.code) && message.equals(other.message) && path.equals(other.path); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.code, this.message, this.path); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java index 99deea794..8fe628481 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetJobResponseContent.java @@ -145,7 +145,7 @@ public Optional getStatusDetails() { return statusDetails; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetJobResponseContent && equalTo((GetJobResponseContent) other); @@ -169,7 +169,7 @@ private boolean equalTo(GetJobResponseContent other) { && statusDetails.equals(other.statusDetails); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.status, @@ -184,7 +184,7 @@ public int hashCode() { this.statusDetails); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,7 +293,7 @@ public static final class Builder implements StatusStage, TypeStage, IdStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(GetJobResponseContent other) { status(other.getStatus()); type(other.getType()); @@ -313,7 +313,7 @@ public Builder from(GetJobResponseContent other) { *

Status of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull String status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -325,7 +325,7 @@ public TypeStage status(@NotNull String status) { *

Type of job this is.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("type") public IdStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -337,7 +337,7 @@ public IdStage type(@NotNull String type) { *

ID of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public _FinalStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -348,7 +348,7 @@ public _FinalStage id(@NotNull String id) { *

Status details.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage statusDetails(String statusDetails) { this.statusDetails = Optional.ofNullable(statusDetails); return this; @@ -357,20 +357,20 @@ public _FinalStage statusDetails(String statusDetails) { /** *

Status details.

*/ - @Override + @java.lang.Override @JsonSetter(value = "status_details", nulls = Nulls.SKIP) public _FinalStage statusDetails(Optional statusDetails) { this.statusDetails = statusDetails; return this; } - @Override + @java.lang.Override public _FinalStage format(JobFileFormatEnum format) { this.format = Optional.ofNullable(format); return this; } - @Override + @java.lang.Override @JsonSetter(value = "format", nulls = Nulls.SKIP) public _FinalStage format(Optional format) { this.format = format; @@ -381,7 +381,7 @@ public _FinalStage format(Optional format) { *

Estimated time remaining before job completes.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage timeLeftSeconds(Integer timeLeftSeconds) { this.timeLeftSeconds = Optional.ofNullable(timeLeftSeconds); return this; @@ -390,7 +390,7 @@ public _FinalStage timeLeftSeconds(Integer timeLeftSeconds) { /** *

Estimated time remaining before job completes.

*/ - @Override + @java.lang.Override @JsonSetter(value = "time_left_seconds", nulls = Nulls.SKIP) public _FinalStage timeLeftSeconds(Optional timeLeftSeconds) { this.timeLeftSeconds = timeLeftSeconds; @@ -401,7 +401,7 @@ public _FinalStage timeLeftSeconds(Optional timeLeftSeconds) { *

Completion percentage of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage percentageDone(Integer percentageDone) { this.percentageDone = Optional.ofNullable(percentageDone); return this; @@ -410,7 +410,7 @@ public _FinalStage percentageDone(Integer percentageDone) { /** *

Completion percentage of this job.

*/ - @Override + @java.lang.Override @JsonSetter(value = "percentage_done", nulls = Nulls.SKIP) public _FinalStage percentageDone(Optional percentageDone) { this.percentageDone = percentageDone; @@ -421,7 +421,7 @@ public _FinalStage percentageDone(Optional percentageDone) { *

URL to download the result of this job.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage location(String location) { this.location = Optional.ofNullable(location); return this; @@ -430,7 +430,7 @@ public _FinalStage location(String location) { /** *

URL to download the result of this job.

*/ - @Override + @java.lang.Override @JsonSetter(value = "location", nulls = Nulls.SKIP) public _FinalStage location(Optional location) { this.location = location; @@ -441,7 +441,7 @@ public _FinalStage location(Optional location) { *

connection_id of the connection this job uses.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -450,7 +450,7 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the connection this job uses.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; @@ -461,7 +461,7 @@ public _FinalStage connectionId(Optional connectionId) { *

When this job was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(String createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -470,14 +470,14 @@ public _FinalStage createdAt(String createdAt) { /** *

When this job was created.

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public GetJobResponseContent build() { return new GetJobResponseContent( status, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java index a83828501..4c479c269 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogResponseContent.java @@ -280,7 +280,7 @@ private OptionalNullable _getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetLogResponseContent && equalTo((GetLogResponseContent) other); @@ -315,7 +315,7 @@ private boolean equalTo(GetLogResponseContent other) { && locationInfo.equals(other.locationInfo); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.date, @@ -341,7 +341,7 @@ public int hashCode() { this.locationInfo); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java index 68b489d05..d2995b77f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetLogStreamResponseContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetLogStreamResponseContent && equalTo((GetLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(GetLogStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetNetworkAclsResponseContent && equalTo((GetNetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(GetNetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java index 04973447d..cddbd693e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationByNameResponseContent.java @@ -91,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationByNameResponseContent @@ -112,12 +112,12 @@ private boolean equalTo(GetOrganizationByNameResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java index 2120d8424..b9aaa3bb2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(GetOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainByNameResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainByNameResponseContent.java new file mode 100644 index 000000000..1ef47aecf --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainByNameResponseContent.java @@ -0,0 +1,304 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationDiscoveryDomainByNameResponseContent.Builder.class) +public final class GetOrganizationDiscoveryDomainByNameResponseContent { + private final String id; + + private final String domain; + + private final OrganizationDiscoveryDomainStatus status; + + private final Optional useForOrganizationDiscovery; + + private final String verificationTxt; + + private final String verificationHost; + + private final Map additionalProperties; + + private GetOrganizationDiscoveryDomainByNameResponseContent( + String id, + String domain, + OrganizationDiscoveryDomainStatus status, + Optional useForOrganizationDiscovery, + String verificationTxt, + String verificationHost, + Map additionalProperties) { + this.id = id; + this.domain = domain; + this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + this.verificationTxt = verificationTxt; + this.verificationHost = verificationHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization discovery domain identifier. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The domain name to associate with the organization e.g. acme.com. + */ + @JsonProperty("domain") + public String getDomain() { + return domain; + } + + @JsonProperty("status") + public OrganizationDiscoveryDomainStatus getStatus() { + return status; + } + + /** + * @return Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + + /** + * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. + */ + @JsonProperty("verification_txt") + public String getVerificationTxt() { + return verificationTxt; + } + + /** + * @return The full domain where the TXT record should be added. + */ + @JsonProperty("verification_host") + public String getVerificationHost() { + return verificationHost; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationDiscoveryDomainByNameResponseContent + && equalTo((GetOrganizationDiscoveryDomainByNameResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationDiscoveryDomainByNameResponseContent other) { + return id.equals(other.id) + && domain.equals(other.domain) + && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) + && verificationTxt.equals(other.verificationTxt) + && verificationHost.equals(other.verificationHost); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.domain, + this.status, + this.useForOrganizationDiscovery, + this.verificationTxt, + this.verificationHost); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Organization discovery domain identifier.

+ */ + DomainStage id(@NotNull String id); + + Builder from(GetOrganizationDiscoveryDomainByNameResponseContent other); + } + + public interface DomainStage { + /** + *

The domain name to associate with the organization e.g. acme.com.

+ */ + StatusStage domain(@NotNull String domain); + } + + public interface StatusStage { + VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status); + } + + public interface VerificationTxtStage { + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ */ + VerificationHostStage verificationTxt(@NotNull String verificationTxt); + } + + public interface VerificationHostStage { + /** + *

The full domain where the TXT record should be added.

+ */ + _FinalStage verificationHost(@NotNull String verificationHost); + } + + public interface _FinalStage { + GetOrganizationDiscoveryDomainByNameResponseContent build(); + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, DomainStage, StatusStage, VerificationTxtStage, VerificationHostStage, _FinalStage { + private String id; + + private String domain; + + private OrganizationDiscoveryDomainStatus status; + + private String verificationTxt; + + private String verificationHost; + + private Optional useForOrganizationDiscovery = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetOrganizationDiscoveryDomainByNameResponseContent other) { + id(other.getId()); + domain(other.getDomain()); + status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); + verificationTxt(other.getVerificationTxt()); + verificationHost(other.getVerificationHost()); + return this; + } + + /** + *

Organization discovery domain identifier.

+ *

Organization discovery domain identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public DomainStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The domain name to associate with the organization e.g. acme.com.

+ *

The domain name to associate with the organization e.g. acme.com.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("domain") + public StatusStage domain(@NotNull String domain) { + this.domain = Objects.requireNonNull(domain, "domain must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_txt") + public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { + this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); + return this; + } + + /** + *

The full domain where the TXT record should be added.

+ *

The full domain where the TXT record should be added.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("verification_host") + public _FinalStage verificationHost(@NotNull String verificationHost) { + this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override + public GetOrganizationDiscoveryDomainByNameResponseContent build() { + return new GetOrganizationDiscoveryDomainByNameResponseContent( + id, + domain, + status, + useForOrganizationDiscovery, + verificationTxt, + verificationHost, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java index 8b31f2eb2..097fa9537 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationDiscoveryDomainResponseContent.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,6 +27,8 @@ public final class GetOrganizationDiscoveryDomainResponseContent { private final OrganizationDiscoveryDomainStatus status; + private final Optional useForOrganizationDiscovery; + private final String verificationTxt; private final String verificationHost; @@ -35,12 +39,14 @@ private GetOrganizationDiscoveryDomainResponseContent( String id, String domain, OrganizationDiscoveryDomainStatus status, + Optional useForOrganizationDiscovery, String verificationTxt, String verificationHost, Map additionalProperties) { this.id = id; this.domain = domain; this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.verificationTxt = verificationTxt; this.verificationHost = verificationHost; this.additionalProperties = additionalProperties; @@ -67,6 +73,14 @@ public OrganizationDiscoveryDomainStatus getStatus() { return status; } + /** + * @return Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + /** * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. */ @@ -83,7 +97,7 @@ public String getVerificationHost() { return verificationHost; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationDiscoveryDomainResponseContent @@ -99,16 +113,23 @@ private boolean equalTo(GetOrganizationDiscoveryDomainResponseContent other) { return id.equals(other.id) && domain.equals(other.domain) && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) && verificationTxt.equals(other.verificationTxt) && verificationHost.equals(other.verificationHost); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + return Objects.hash( + this.id, + this.domain, + this.status, + this.useForOrganizationDiscovery, + this.verificationTxt, + this.verificationHost); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,6 +174,13 @@ public interface VerificationHostStage { public interface _FinalStage { GetOrganizationDiscoveryDomainResponseContent build(); + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -168,16 +196,19 @@ public static final class Builder private String verificationHost; + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(GetOrganizationDiscoveryDomainResponseContent other) { id(other.getId()); domain(other.getDomain()); status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); verificationTxt(other.getVerificationTxt()); verificationHost(other.getVerificationHost()); return this; @@ -188,7 +219,7 @@ public Builder from(GetOrganizationDiscoveryDomainResponseContent other) { *

Organization discovery domain identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public DomainStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -200,14 +231,14 @@ public DomainStage id(@NotNull String id) { *

The domain name to associate with the organization e.g. acme.com.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public StatusStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -219,7 +250,7 @@ public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus st *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_txt") public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); @@ -231,17 +262,43 @@ public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { *

The full domain where the TXT record should be added.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_host") public _FinalStage verificationHost(@NotNull String verificationHost) { this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); return this; } - @Override + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override public GetOrganizationDiscoveryDomainResponseContent build() { return new GetOrganizationDiscoveryDomainResponseContent( - id, domain, status, verificationTxt, verificationHost, additionalProperties); + id, + domain, + status, + useForOrganizationDiscovery, + verificationTxt, + verificationHost, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java index e698f6425..9e33abce2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationInvitationResponseContent.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationInvitationResponseContent @@ -201,7 +201,7 @@ private boolean equalTo(GetOrganizationInvitationResponseContent other) { && ticketId.equals(other.ticketId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -219,7 +219,7 @@ public int hashCode() { this.ticketId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java index 16227a8a7..7c383c987 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationResponseContent.java @@ -91,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetOrganizationResponseContent && equalTo((GetOrganizationResponseContent) other); @@ -111,12 +111,12 @@ private boolean equalTo(GetOrganizationResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java index f3358301b..501d59b70 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetPhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetPhoneTemplateResponseContent && equalTo((GetPhoneTemplateResponseContent) other); @@ -115,13 +115,13 @@ private boolean equalTo(GetPhoneTemplateResponseContent other) { && disabled == other.disabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @Override + @java.lang.Override public Builder from(GetPhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(GetPhoneTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @Override + @java.lang.Override public GetPhoneTemplateResponseContent build() { return new GetPhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java index 16988bc0c..91857abc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRefreshTokenResponseContent.java @@ -44,6 +44,8 @@ public final class GetRefreshTokenResponseContent { private final Optional> resourceServers; + private final OptionalNullable> refreshTokenMetadata; + private final Optional lastExchangedAt; private final Map additionalProperties; @@ -59,6 +61,7 @@ private GetRefreshTokenResponseContent( OptionalNullable sessionId, Optional rotating, Optional> resourceServers, + OptionalNullable> refreshTokenMetadata, Optional lastExchangedAt, Map additionalProperties) { this.id = id; @@ -71,6 +74,7 @@ private GetRefreshTokenResponseContent( this.sessionId = sessionId; this.rotating = rotating; this.resourceServers = resourceServers; + this.refreshTokenMetadata = refreshTokenMetadata; this.lastExchangedAt = lastExchangedAt; this.additionalProperties = additionalProperties; } @@ -144,6 +148,15 @@ public Optional> getResourceServers() { return resourceServers; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + public OptionalNullable> getRefreshTokenMetadata() { + if (refreshTokenMetadata == null) { + return OptionalNullable.absent(); + } + return refreshTokenMetadata; + } + @JsonProperty("last_exchanged_at") public Optional getLastExchangedAt() { return lastExchangedAt; @@ -155,7 +168,13 @@ private OptionalNullable _getSessionId() { return sessionId; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + private OptionalNullable> _getRefreshTokenMetadata() { + return refreshTokenMetadata; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRefreshTokenResponseContent && equalTo((GetRefreshTokenResponseContent) other); @@ -177,10 +196,11 @@ private boolean equalTo(GetRefreshTokenResponseContent other) { && sessionId.equals(other.sessionId) && rotating.equals(other.rotating) && resourceServers.equals(other.resourceServers) + && refreshTokenMetadata.equals(other.refreshTokenMetadata) && lastExchangedAt.equals(other.lastExchangedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -193,10 +213,11 @@ public int hashCode() { this.sessionId, this.rotating, this.resourceServers, + this.refreshTokenMetadata, this.lastExchangedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -227,6 +248,8 @@ public static final class Builder { private Optional> resourceServers = Optional.empty(); + private OptionalNullable> refreshTokenMetadata = OptionalNullable.absent(); + private Optional lastExchangedAt = Optional.empty(); @JsonAnySetter @@ -245,6 +268,7 @@ public Builder from(GetRefreshTokenResponseContent other) { sessionId(other.getSessionId()); rotating(other.getRotating()); resourceServers(other.getResourceServers()); + refreshTokenMetadata(other.getRefreshTokenMetadata()); lastExchangedAt(other.getLastExchangedAt()); return this; } @@ -394,6 +418,38 @@ public Builder resourceServers(List resourceServers) return this; } + @JsonSetter(value = "refresh_token_metadata", nulls = Nulls.SKIP) + public Builder refreshTokenMetadata(@Nullable OptionalNullable> refreshTokenMetadata) { + this.refreshTokenMetadata = refreshTokenMetadata; + return this; + } + + public Builder refreshTokenMetadata(Map refreshTokenMetadata) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata); + return this; + } + + public Builder refreshTokenMetadata(Optional> refreshTokenMetadata) { + if (refreshTokenMetadata.isPresent()) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } else { + this.refreshTokenMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshTokenMetadata( + com.auth0.client.mgmt.core.Nullable> refreshTokenMetadata) { + if (refreshTokenMetadata.isNull()) { + this.refreshTokenMetadata = OptionalNullable.ofNull(); + } else if (refreshTokenMetadata.isEmpty()) { + this.refreshTokenMetadata = OptionalNullable.absent(); + } else { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } + return this; + } + @JsonSetter(value = "last_exchanged_at", nulls = Nulls.SKIP) public Builder lastExchangedAt(Optional lastExchangedAt) { this.lastExchangedAt = lastExchangedAt; @@ -417,6 +473,7 @@ public GetRefreshTokenResponseContent build() { sessionId, rotating, resourceServers, + refreshTokenMetadata, lastExchangedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java index 0f245311e..3012356f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerRequestParameters.java @@ -51,7 +51,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetResourceServerRequestParameters @@ -67,12 +67,12 @@ private boolean equalTo(GetResourceServerRequestParameters other) { return includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java index 8a84aae84..17230a689 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java @@ -268,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetResourceServerResponseContent && equalTo((GetResourceServerResponseContent) other); @@ -301,7 +301,7 @@ private boolean equalTo(GetResourceServerResponseContent other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -325,7 +325,7 @@ public int hashCode() { this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java index 804d07d90..e3ac98df6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsNewDeviceResponseContent.java @@ -36,7 +36,7 @@ public int getRememberFor() { return rememberFor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRiskAssessmentsSettingsNewDeviceResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(GetRiskAssessmentsSettingsNewDeviceResponseContent other return rememberFor == other.rememberFor; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.rememberFor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements RememberForStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(GetRiskAssessmentsSettingsNewDeviceResponseContent other) { rememberFor(other.getRememberFor()); return this; @@ -99,14 +99,14 @@ public Builder from(GetRiskAssessmentsSettingsNewDeviceResponseContent other) { *

Length of time to remember devices for, in days.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("remember_for") public _FinalStage rememberFor(int rememberFor) { this.rememberFor = rememberFor; return this; } - @Override + @java.lang.Override public GetRiskAssessmentsSettingsNewDeviceResponseContent build() { return new GetRiskAssessmentsSettingsNewDeviceResponseContent(rememberFor, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java index 89e7b6c45..b670eed95 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRiskAssessmentsSettingsResponseContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRiskAssessmentsSettingsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(GetRiskAssessmentsSettingsResponseContent other) { return enabled == other.enabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(GetRiskAssessmentsSettingsResponseContent other) { enabled(other.getEnabled()); return this; @@ -98,14 +98,14 @@ public Builder from(GetRiskAssessmentsSettingsResponseContent other) { *

Whether or not risk assessment is enabled.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public GetRiskAssessmentsSettingsResponseContent build() { return new GetRiskAssessmentsSettingsResponseContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java index 835a09951..4b04ade20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRoleResponseContent && equalTo((GetRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(GetRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java index 68651fb3b..0b9e31fa6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRuleRequestParameters && equalTo((GetRuleRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetRuleRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java index 2221c8e8a..716fd9d72 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetRuleResponseContent && equalTo((GetRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(GetRuleResponseContent other) { && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java index cacafda90..856daa884 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationDefaultMappingResponseContent.java @@ -39,7 +39,7 @@ public Optional> getMapping() { return mapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetScimConfigurationDefaultMappingResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(GetScimConfigurationDefaultMappingResponseContent other) return mapping.equals(other.mapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java index 43744aeac..a3da02aeb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(GetScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java index 7572e9619..506791b7b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSelfServiceProfileResponseContent.java @@ -134,7 +134,7 @@ public Optional getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSelfServiceProfileResponseContent @@ -158,7 +158,7 @@ private boolean equalTo(GetSelfServiceProfileResponseContent other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -172,7 +172,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java index 36a0b1c0a..3f7ebba29 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSessionResponseContent.java @@ -167,7 +167,7 @@ private OptionalNullable> _getSessionMetadata() { return sessionMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSessionResponseContent && equalTo((GetSessionResponseContent) other); @@ -194,7 +194,7 @@ private boolean equalTo(GetSessionResponseContent other) { && sessionMetadata.equals(other.sessionMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -212,7 +212,7 @@ public int hashCode() { this.sessionMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java index 049c1f0ac..7a588405f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSettingsResponseContent.java @@ -60,7 +60,7 @@ public Optional getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSettingsResponseContent && equalTo((GetSettingsResponseContent) other); @@ -77,12 +77,12 @@ private boolean equalTo(GetSettingsResponseContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java index 3845eb000..c53de182e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSigningKeysResponseContent.java @@ -163,7 +163,7 @@ public Optional getRevokedAt() { return revokedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSigningKeysResponseContent && equalTo((GetSigningKeysResponseContent) other); @@ -189,7 +189,7 @@ private boolean equalTo(GetSigningKeysResponseContent other) { && revokedAt.equals(other.revokedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, @@ -206,7 +206,7 @@ public int hashCode() { this.revokedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -327,7 +327,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @Override + @java.lang.Override public Builder from(GetSigningKeysResponseContent other) { kid(other.getKid()); cert(other.getCert()); @@ -349,7 +349,7 @@ public Builder from(GetSigningKeysResponseContent other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -361,7 +361,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -373,7 +373,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -385,20 +385,20 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage revokedAt(SigningKeysDate revokedAt) { this.revokedAt = Optional.ofNullable(revokedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) public _FinalStage revokedAt(Optional revokedAt) { this.revokedAt = revokedAt; @@ -409,7 +409,7 @@ public _FinalStage revokedAt(Optional revokedAt) { *

True if the key is revoked

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage revoked(Boolean revoked) { this.revoked = Optional.ofNullable(revoked); return this; @@ -418,33 +418,33 @@ public _FinalStage revoked(Boolean revoked) { /** *

True if the key is revoked

*/ - @Override + @java.lang.Override @JsonSetter(value = "revoked", nulls = Nulls.SKIP) public _FinalStage revoked(Optional revoked) { this.revoked = revoked; return this; } - @Override + @java.lang.Override public _FinalStage currentUntil(SigningKeysDate currentUntil) { this.currentUntil = Optional.ofNullable(currentUntil); return this; } - @Override + @java.lang.Override @JsonSetter(value = "current_until", nulls = Nulls.SKIP) public _FinalStage currentUntil(Optional currentUntil) { this.currentUntil = currentUntil; return this; } - @Override + @java.lang.Override public _FinalStage currentSince(SigningKeysDate currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; } - @Override + @java.lang.Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -455,7 +455,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -464,7 +464,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @Override + @java.lang.Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -475,7 +475,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -484,7 +484,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @Override + @java.lang.Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -495,7 +495,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -504,7 +504,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @Override + @java.lang.Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -515,7 +515,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage pkcs7(String pkcs7) { this.pkcs7 = Optional.ofNullable(pkcs7); return this; @@ -524,14 +524,14 @@ public _FinalStage pkcs7(String pkcs7) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) public _FinalStage pkcs7(Optional pkcs7) { this.pkcs7 = pkcs7; return this; } - @Override + @java.lang.Override public GetSigningKeysResponseContent build() { return new GetSigningKeysResponseContent( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java index cb50f9cd8..e8571ce80 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSupplementalSignalsResponseContent.java @@ -38,7 +38,7 @@ public Optional getAkamaiEnabled() { return akamaiEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSupplementalSignalsResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(GetSupplementalSignalsResponseContent other) { return akamaiEnabled.equals(other.akamaiEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java index 9f0d5b837..a73e05b88 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetSuspiciousIpThrottlingSettingsResponseContent.java @@ -71,7 +71,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetSuspiciousIpThrottlingSettingsResponseContent @@ -90,12 +90,12 @@ private boolean equalTo(GetSuspiciousIpThrottlingSettingsResponseContent other) && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java index 144e8081a..abbc2fb94 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetTenantSettingsResponseContent.java @@ -90,6 +90,8 @@ public final class GetTenantSettingsResponseContent { private final Optional resourceParameterProfile; + private final Optional enableAiGuide; + private final Map additionalProperties; private GetTenantSettingsResponseContent( @@ -126,6 +128,7 @@ private GetTenantSettingsResponseContent( OptionalNullable authorizationResponseIssParameterSupported, OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, Optional resourceParameterProfile, + Optional enableAiGuide, Map additionalProperties) { this.changePassword = changePassword; this.guardianMfaPage = guardianMfaPage; @@ -160,6 +163,7 @@ private GetTenantSettingsResponseContent( this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; this.resourceParameterProfile = resourceParameterProfile; + this.enableAiGuide = enableAiGuide; this.additionalProperties = additionalProperties; } @@ -436,6 +440,14 @@ public Optional getResourceParameterProf return resourceParameterProfile; } + /** + * @return Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant. + */ + @JsonProperty("enable_ai_guide") + public Optional getEnableAiGuide() { + return enableAiGuide; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -496,7 +508,7 @@ private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPr return skipNonVerifiableCallbackUriConfirmationPrompt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTenantSettingsResponseContent && equalTo((GetTenantSettingsResponseContent) other); @@ -541,10 +553,11 @@ private boolean equalTo(GetTenantSettingsResponseContent other) { && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) && skipNonVerifiableCallbackUriConfirmationPrompt.equals( other.skipNonVerifiableCallbackUriConfirmationPrompt) - && resourceParameterProfile.equals(other.resourceParameterProfile); + && resourceParameterProfile.equals(other.resourceParameterProfile) + && enableAiGuide.equals(other.enableAiGuide); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.changePassword, @@ -579,10 +592,11 @@ public int hashCode() { this.pushedAuthorizationRequestsSupported, this.authorizationResponseIssParameterSupported, this.skipNonVerifiableCallbackUriConfirmationPrompt, - this.resourceParameterProfile); + this.resourceParameterProfile, + this.enableAiGuide); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -659,6 +673,8 @@ public static final class Builder { private Optional resourceParameterProfile = Optional.empty(); + private Optional enableAiGuide = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -698,6 +714,7 @@ public Builder from(GetTenantSettingsResponseContent other) { authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); resourceParameterProfile(other.getResourceParameterProfile()); + enableAiGuide(other.getEnableAiGuide()); return this; } @@ -1349,6 +1366,20 @@ public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile r return this; } + /** + *

Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant.

+ */ + @JsonSetter(value = "enable_ai_guide", nulls = Nulls.SKIP) + public Builder enableAiGuide(Optional enableAiGuide) { + this.enableAiGuide = enableAiGuide; + return this; + } + + public Builder enableAiGuide(Boolean enableAiGuide) { + this.enableAiGuide = Optional.ofNullable(enableAiGuide); + return this; + } + public GetTenantSettingsResponseContent build() { return new GetTenantSettingsResponseContent( changePassword, @@ -1384,6 +1415,7 @@ public GetTenantSettingsResponseContent build() { authorizationResponseIssParameterSupported, skipNonVerifiableCallbackUriConfirmationPrompt, resourceParameterProfile, + enableAiGuide, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java index 03cd85285..1f1fb1119 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetTokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetTokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(GetTokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java index 1d127dc1e..1af8321d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplate.java @@ -37,7 +37,7 @@ public Optional getBody() { return body; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUniversalLoginTemplate && equalTo((GetUniversalLoginTemplate) other); @@ -52,12 +52,12 @@ private boolean equalTo(GetUniversalLoginTemplate other) { return body.equals(other.body); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.body); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java index baf2c9297..aa54a7fad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUniversalLoginTemplateResponseContent.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUniversalLoginTemplateResponseContent @@ -50,12 +50,12 @@ private boolean equalTo(GetUniversalLoginTemplateResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -79,7 +79,7 @@ static final class Deserializer extends StdDeserializer getTemplate() { return template; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserAttributeProfileTemplateResponseContent @@ -76,12 +76,12 @@ private boolean equalTo(GetUserAttributeProfileTemplateResponseContent other) { return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.displayName, this.template); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java index 8db27c5b1..1b7f4ea83 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserAuthenticationMethodResponseContent.java @@ -261,7 +261,7 @@ public Optional getRelyingPartyIdentifier() { return relyingPartyIdentifier; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserAuthenticationMethodResponseContent @@ -296,7 +296,7 @@ private boolean equalTo(GetUserAuthenticationMethodResponseContent other) { && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -321,7 +321,7 @@ public int hashCode() { this.relyingPartyIdentifier); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -515,7 +515,7 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(GetUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -545,14 +545,14 @@ public Builder from(GetUserAuthenticationMethodResponseContent other) { *

The ID of the authentication method (auto generated)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -564,7 +564,7 @@ public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { *

Authenticator creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -575,7 +575,7 @@ public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -584,7 +584,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -595,7 +595,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage aaguid(String aaguid) { this.aaguid = Optional.ofNullable(aaguid); return this; @@ -604,7 +604,7 @@ public _FinalStage aaguid(String aaguid) { /** *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) public _FinalStage aaguid(Optional aaguid) { this.aaguid = aaguid; @@ -615,7 +615,7 @@ public _FinalStage aaguid(Optional aaguid) { *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage userAgent(String userAgent) { this.userAgent = Optional.ofNullable(userAgent); return this; @@ -624,7 +624,7 @@ public _FinalStage userAgent(String userAgent) { /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

*/ - @Override + @java.lang.Override @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) public _FinalStage userAgent(Optional userAgent) { this.userAgent = userAgent; @@ -635,7 +635,7 @@ public _FinalStage userAgent(Optional userAgent) { *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage identityUserId(String identityUserId) { this.identityUserId = Optional.ofNullable(identityUserId); return this; @@ -644,7 +644,7 @@ public _FinalStage identityUserId(String identityUserId) { /** *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) public _FinalStage identityUserId(Optional identityUserId) { this.identityUserId = identityUserId; @@ -655,7 +655,7 @@ public _FinalStage identityUserId(Optional identityUserId) { *

Applies to passkeys only. Whether the credential was backed up.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); return this; @@ -664,7 +664,7 @@ public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { /** *

Applies to passkeys only. Whether the credential was backed up.

*/ - @Override + @java.lang.Override @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) public _FinalStage credentialBackedUp(Optional credentialBackedUp) { this.credentialBackedUp = credentialBackedUp; @@ -675,7 +675,7 @@ public _FinalStage credentialBackedUp(Optional credentialBackedUp) { *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage credentialDeviceType(String credentialDeviceType) { this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); return this; @@ -684,7 +684,7 @@ public _FinalStage credentialDeviceType(String credentialDeviceType) { /** *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

*/ - @Override + @java.lang.Override @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) public _FinalStage credentialDeviceType(Optional credentialDeviceType) { this.credentialDeviceType = credentialDeviceType; @@ -695,7 +695,7 @@ public _FinalStage credentialDeviceType(Optional credentialDeviceType) { *

Last authentication

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { this.lastAuthAt = Optional.ofNullable(lastAuthAt); return this; @@ -704,7 +704,7 @@ public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { /** *

Last authentication

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) public _FinalStage lastAuthAt(Optional lastAuthAt) { this.lastAuthAt = lastAuthAt; @@ -715,7 +715,7 @@ public _FinalStage lastAuthAt(Optional lastAuthAt) { *

Enrollment date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; @@ -724,7 +724,7 @@ public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { /** *

Enrollment date

*/ - @Override + @java.lang.Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -735,7 +735,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -744,7 +744,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -755,7 +755,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The ID of the generated credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -764,7 +764,7 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The ID of the generated credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; @@ -775,7 +775,7 @@ public _FinalStage keyId(Optional keyId) { *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -784,7 +784,7 @@ public _FinalStage email(String email) { /** *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -795,7 +795,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -804,7 +804,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -815,7 +815,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage linkId(String linkId) { this.linkId = Optional.ofNullable(linkId); return this; @@ -824,21 +824,21 @@ public _FinalStage linkId(String linkId) { /** *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

*/ - @Override + @java.lang.Override @JsonSetter(value = "link_id", nulls = Nulls.SKIP) public _FinalStage linkId(Optional linkId) { this.linkId = linkId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -846,13 +846,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -864,7 +864,7 @@ public _FinalStage authenticationMethods( *

A human-readable label to identify the authentication method

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -873,7 +873,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -884,7 +884,7 @@ public _FinalStage name(Optional name) { *

The authentication method status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage confirmed(Boolean confirmed) { this.confirmed = Optional.ofNullable(confirmed); return this; @@ -893,14 +893,14 @@ public _FinalStage confirmed(Boolean confirmed) { /** *

The authentication method status

*/ - @Override + @java.lang.Override @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) public _FinalStage confirmed(Optional confirmed) { this.confirmed = confirmed; return this; } - @Override + @java.lang.Override public GetUserAuthenticationMethodResponseContent build() { return new GetUserAuthenticationMethodResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java index f2c551c7f..a95706d17 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserRequestParameters.java @@ -74,7 +74,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserRequestParameters && equalTo((GetUserRequestParameters) other); @@ -89,12 +89,12 @@ private boolean equalTo(GetUserRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java index 8d756d7fb..497df4221 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserResponseContent && equalTo((GetUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(GetUserResponseContent other) { && familyName.equals(other.familyName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java index 0df9f5a01..ca2fa1069 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(GetVerifiableCredentialTemplateResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Group.java b/src/main/java/com/auth0/client/mgmt/types/Group.java index 8449cf208..2026f9e55 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Group.java +++ b/src/main/java/com/auth0/client/mgmt/types/Group.java @@ -71,7 +71,7 @@ private Group( * @return Unique identifier for the group (service-generated). */ @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @@ -80,7 +80,7 @@ public Optional getId() { * @return Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters. */ @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @@ -89,7 +89,7 @@ public Optional getName() { * @return External identifier for the group, often used for SCIM synchronization. Max length of 256 characters. */ @JsonProperty("external_id") - @Override + @java.lang.Override public Optional getExternalId() { return externalId; } @@ -98,7 +98,7 @@ public Optional getExternalId() { * @return Identifier for the connection this group belongs to (if a connection group). */ @JsonProperty("connection_id") - @Override + @java.lang.Override public Optional getConnectionId() { return connectionId; } @@ -108,7 +108,7 @@ public Optional getConnectionId() { */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("organization_id") - @Override + @java.lang.Override public OptionalNullable getOrganizationId() { if (organizationId == null) { return OptionalNullable.absent(); @@ -120,14 +120,14 @@ public OptionalNullable getOrganizationId() { * @return Identifier for the tenant this group belongs to. */ @JsonProperty("tenant_name") - @Override + @java.lang.Override public Optional getTenantName() { return tenantName; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("description") - @Override + @java.lang.Override public OptionalNullable getDescription() { if (description == null) { return OptionalNullable.absent(); @@ -139,7 +139,7 @@ public OptionalNullable getDescription() { * @return Timestamp of when the group was created. */ @JsonProperty("created_at") - @Override + @java.lang.Override public Optional getCreatedAt() { return createdAt; } @@ -148,7 +148,7 @@ public Optional getCreatedAt() { * @return Timestamp of when the group was last updated. */ @JsonProperty("updated_at") - @Override + @java.lang.Override public Optional getUpdatedAt() { return updatedAt; } @@ -165,7 +165,7 @@ private OptionalNullable _getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Group && equalTo((Group) other); @@ -188,7 +188,7 @@ private boolean equalTo(Group other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -202,7 +202,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java index ec1ea6d58..03409797d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentFactorEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianEnrollmentFactorEnum && this.string.equals(((GuardianEnrollmentFactorEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java index 031cf5e15..203f74178 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianEnrollmentStatus.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianEnrollmentStatus && this.string.equals(((GuardianEnrollmentStatus) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java index e53787762..8cca5a606 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactor.java @@ -60,7 +60,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GuardianFactor && equalTo((GuardianFactor) other); @@ -75,12 +75,12 @@ private boolean equalTo(GuardianFactor other) { return enabled == other.enabled && trialExpired.equals(other.trialExpired) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.trialExpired, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -126,7 +126,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(GuardianFactor other) { enabled(other.getEnabled()); trialExpired(other.getTrialExpired()); @@ -139,20 +139,20 @@ public Builder from(GuardianFactor other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public _FinalStage name(GuardianFactorNameEnum name) { this.name = Optional.ofNullable(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -163,7 +163,7 @@ public _FinalStage name(Optional name) { *

Whether trial limits have been exceeded.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage trialExpired(Boolean trialExpired) { this.trialExpired = Optional.ofNullable(trialExpired); return this; @@ -172,14 +172,14 @@ public _FinalStage trialExpired(Boolean trialExpired) { /** *

Whether trial limits have been exceeded.

*/ - @Override + @java.lang.Override @JsonSetter(value = "trial_expired", nulls = Nulls.SKIP) public _FinalStage trialExpired(Optional trialExpired) { this.trialExpired = trialExpired; return this; } - @Override + @java.lang.Override public GuardianFactor build() { return new GuardianFactor(enabled, trialExpired, name, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java index 56c8300ae..4c9117e5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorNameEnum.java @@ -40,20 +40,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorNameEnum && this.string.equals(((GuardianFactorNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java index 523d25a4f..028a2a4e7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorPhoneFactorMessageTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorPhoneFactorMessageTypeEnum && this.string.equals(((GuardianFactorPhoneFactorMessageTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java index 64bd2641e..a960f2730 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderPushNotificationProviderDataEnum.java @@ -29,13 +29,13 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorsProviderPushNotificationProviderDataEnum @@ -43,7 +43,7 @@ public boolean equals(Object other) { ((GuardianFactorsProviderPushNotificationProviderDataEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java index ea488c1ce..d56e13452 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/GuardianFactorsProviderSmsProviderEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof GuardianFactorsProviderSmsProviderEnum && this.string.equals(((GuardianFactorsProviderSmsProviderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Hook.java b/src/main/java/com/auth0/client/mgmt/types/Hook.java index e1f2562c7..b29098a24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Hook.java +++ b/src/main/java/com/auth0/client/mgmt/types/Hook.java @@ -96,7 +96,7 @@ public Optional> getDependencies() { return dependencies; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Hook && equalTo((Hook) other); @@ -116,12 +116,12 @@ private boolean equalTo(Hook other) { && dependencies.equals(other.dependencies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java index 8da13d02e..e90d154bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/HookTriggerIdEnum.java @@ -35,19 +35,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof HookTriggerIdEnum && this.string.equals(((HookTriggerIdEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java index 805311d43..1764d0864 100644 --- a/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java +++ b/src/main/java/com/auth0/client/mgmt/types/HttpCustomHeader.java @@ -49,7 +49,7 @@ public Optional getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof HttpCustomHeader && equalTo((HttpCustomHeader) other); @@ -64,12 +64,12 @@ private boolean equalTo(HttpCustomHeader other) { return header.equals(other.header) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.header, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java index ada2b3caf..8ca9481c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java @@ -37,7 +37,7 @@ public interface IConnectionOptionsCommonOidc { Optional getSetUserRootAttributes(); - OptionalNullable getTenantDomain(); + Optional getTenantDomain(); Optional getTokenEndpoint(); diff --git a/src/main/java/com/auth0/client/mgmt/types/Identity.java b/src/main/java/com/auth0/client/mgmt/types/Identity.java index 91db44c41..7be1f5779 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Identity.java +++ b/src/main/java/com/auth0/client/mgmt/types/Identity.java @@ -61,7 +61,7 @@ public Optional getConnectionId() { return connectionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Identity && equalTo((Identity) other); @@ -78,12 +78,12 @@ private boolean equalTo(Identity other) { && connectionId.equals(other.connectionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId, this.provider, this.connectionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -129,7 +129,7 @@ public static final class Builder implements UserIdStage, ProviderStage, _FinalS private Builder() {} - @Override + @java.lang.Override public Builder from(Identity other) { userId(other.getUserId()); provider(other.getProvider()); @@ -142,14 +142,14 @@ public Builder from(Identity other) { *

user_id of the identity to be verified.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public ProviderStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull IdentityProviderEnum provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); @@ -160,7 +160,7 @@ public _FinalStage provider(@NotNull IdentityProviderEnum provider) { *

connection_id of the identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage connectionId(String connectionId) { this.connectionId = Optional.ofNullable(connectionId); return this; @@ -169,14 +169,14 @@ public _FinalStage connectionId(String connectionId) { /** *

connection_id of the identity.

*/ - @Override + @java.lang.Override @JsonSetter(value = "connection_id", nulls = Nulls.SKIP) public _FinalStage connectionId(Optional connectionId) { this.connectionId = connectionId; return this; } - @Override + @java.lang.Override public Identity build() { return new Identity(userId, provider, connectionId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java index b63a6b125..38a726017 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java @@ -153,19 +153,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof IdentityProviderEnum && this.string.equals(((IdentityProviderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java index 39d921acc..aab4a35c8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ImportEncryptionKeyResponseContent.java @@ -107,7 +107,7 @@ public Optional getPublicKey() { return publicKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ImportEncryptionKeyResponseContent @@ -129,13 +129,13 @@ private boolean equalTo(ImportEncryptionKeyResponseContent other) { && publicKey.equals(other.publicKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, this.type, this.state, this.createdAt, this.updatedAt, this.parentKid, this.publicKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -215,7 +215,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ImportEncryptionKeyResponseContent other) { kid(other.getKid()); type(other.getType()); @@ -232,21 +232,21 @@ public Builder from(ImportEncryptionKeyResponseContent other) { *

Key ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public TypeStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public StateStage type(@NotNull EncryptionKeyType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull EncryptionKeyState state) { this.state = Objects.requireNonNull(state, "state must not be null"); @@ -258,7 +258,7 @@ public CreatedAtStage state(@NotNull EncryptionKeyState state) { *

Key creation timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -270,7 +270,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

Key update timestamp

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -282,7 +282,7 @@ public ParentKidStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

ID of parent wrapping key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("parent_kid") public _FinalStage parentKid(@NotNull String parentKid) { this.parentKid = Objects.requireNonNull(parentKid, "parentKid must not be null"); @@ -293,7 +293,7 @@ public _FinalStage parentKid(@NotNull String parentKid) { *

Public key in PEM format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -302,14 +302,14 @@ public _FinalStage publicKey(String publicKey) { /** *

Public key in PEM format

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; return this; } - @Override + @java.lang.Override public ImportEncryptionKeyResponseContent build() { return new ImportEncryptionKeyResponseContent( kid, type, state, createdAt, updatedAt, parentKid, publicKey, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/Integration.java b/src/main/java/com/auth0/client/mgmt/types/Integration.java index 928702f4b..647537bc9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Integration.java +++ b/src/main/java/com/auth0/client/mgmt/types/Integration.java @@ -190,7 +190,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Integration && equalTo((Integration) other); @@ -219,7 +219,7 @@ private boolean equalTo(Integration other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -239,7 +239,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java index 9e2bb89b1..378ce1601 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationFeatureTypeEnum.java @@ -37,20 +37,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof IntegrationFeatureTypeEnum && this.string.equals(((IntegrationFeatureTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java index 3825a796c..60f4838a4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRelease.java @@ -83,7 +83,7 @@ public Optional> getRequiredConfiguration() { return requiredConfiguration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRelease && equalTo((IntegrationRelease) other); @@ -102,12 +102,12 @@ private boolean equalTo(IntegrationRelease other) { && requiredConfiguration.equals(other.requiredConfiguration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.trigger, this.semver, this.requiredSecrets, this.requiredConfiguration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java index 210082437..8a8356603 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParam.java @@ -133,7 +133,7 @@ public Optional> getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRequiredParam && equalTo((IntegrationRequiredParam) other); @@ -156,7 +156,7 @@ private boolean equalTo(IntegrationRequiredParam other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.type, @@ -170,7 +170,7 @@ public int hashCode() { this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java index c9e267ddc..29cd5ccc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamOption.java @@ -49,7 +49,7 @@ public Optional getLabel() { return label; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationRequiredParamOption && equalTo((IntegrationRequiredParamOption) other); @@ -64,12 +64,12 @@ private boolean equalTo(IntegrationRequiredParamOption other) { return value.equals(other.value) && label.equals(other.label); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.label); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java index 3dc8f6bbf..9c421852a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationRequiredParamTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof IntegrationRequiredParamTypeEnum && this.string.equals(((IntegrationRequiredParamTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java index 29c48b3ac..62f0972f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java +++ b/src/main/java/com/auth0/client/mgmt/types/IntegrationSemVer.java @@ -49,7 +49,7 @@ public Optional getMinor() { return minor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof IntegrationSemVer && equalTo((IntegrationSemVer) other); @@ -64,12 +64,12 @@ private boolean equalTo(IntegrationSemVer other) { return major.equals(other.major) && minor.equals(other.minor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.major, this.minor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java index 375cca732..5030eb5da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/JobFileFormatEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof JobFileFormatEnum && this.string.equals(((JobFileFormatEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java index dd08209df..37a8fb6e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/LinkedClientConfiguration.java @@ -36,7 +36,7 @@ public String getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LinkedClientConfiguration && equalTo((LinkedClientConfiguration) other); @@ -51,12 +51,12 @@ private boolean equalTo(LinkedClientConfiguration other) { return clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ClientIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(LinkedClientConfiguration other) { clientId(other.getClientId()); return this; @@ -98,14 +98,14 @@ public Builder from(LinkedClientConfiguration other) { *

The ID of the linked client.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("client_id") public _FinalStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); return this; } - @Override + @java.lang.Override public LinkedClientConfiguration build() { return new LinkedClientConfiguration(clientId, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java index 9ef9e7aa6..3f2a5dadd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionBindingsPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getBindings() { return bindings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionBindingsPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListActionBindingsPaginatedResponseContent other) { && bindings.equals(other.bindings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.bindings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java index 22d0a07be..85b7426c1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionTriggersResponseContent.java @@ -36,7 +36,7 @@ public Optional> getTriggers() { return triggers; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionTriggersResponseContent && equalTo((ListActionTriggersResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ListActionTriggersResponseContent other) { return triggers.equals(other.triggers); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggers); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java index f4e8f3e23..ecc1418e3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionVersionsPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getVersions() { return versions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionVersionsPaginatedResponseContent @@ -92,12 +92,12 @@ private boolean equalTo(ListActionVersionsPaginatedResponseContent other) { && versions.equals(other.versions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.versions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java index 76f590287..bca8a2104 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getActions() { return actions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionsPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListActionsPaginatedResponseContent other) { && actions.equals(other.actions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.total, this.page, this.perPage, this.actions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java index 67d30d285..677299d8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListActionsRequestParameters.java @@ -144,7 +144,7 @@ private OptionalNullable _getInstalled() { return installed; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListActionsRequestParameters && equalTo((ListActionsRequestParameters) other); @@ -164,12 +164,12 @@ private boolean equalTo(ListActionsRequestParameters other) { && installed.equals(other.installed); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggerId, this.actionName, this.deployed, this.page, this.perPage, this.installed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java index d278c0aa2..4d80bc312 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListAculsOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional getTotal() { return total; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListAculsOffsetPaginatedResponseContent @@ -92,12 +92,12 @@ private boolean equalTo(ListAculsOffsetPaginatedResponseContent other) { && total.equals(other.total); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.configs, this.start, this.limit, this.total); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java index 10769ec3c..fba219f29 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListBrandingPhoneProvidersResponseContent.java @@ -36,7 +36,7 @@ public Optional> getProviders() { return providers; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListBrandingPhoneProvidersResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(ListBrandingPhoneProvidersResponseContent other) { return providers.equals(other.providers); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.providers); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java index c93b942cf..e9bb942a4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientConnectionsResponseContent.java @@ -48,7 +48,7 @@ public Optional getNext() { return next; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientConnectionsResponseContent @@ -64,12 +64,12 @@ private boolean equalTo(ListClientConnectionsResponseContent other) { return connections.equals(other.connections) && next.equals(other.next); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connections, this.next); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java index 4c8247e04..b356b3512 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantOrganizationsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getOrganizations() { return organizations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantOrganizationsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListClientGrantOrganizationsPaginatedResponseContent oth return next.equals(other.next) && organizations.equals(other.organizations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.organizations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java index cecacdc77..4fddd9cf4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getClientGrants() { return clientGrants; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListClientGrantPaginatedResponseContent other) { return next.equals(other.next) && clientGrants.equals(other.clientGrants); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.clientGrants); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java index 68110a1d6..56452e953 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientGrantsRequestParameters.java @@ -153,7 +153,7 @@ private OptionalNullable _getSubjectType() { return subjectType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientGrantsRequestParameters && equalTo((ListClientGrantsRequestParameters) other); @@ -173,13 +173,13 @@ private boolean equalTo(ListClientGrantsRequestParameters other) { && subjectType.equals(other.subjectType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.from, this.take, this.audience, this.clientId, this.allowAnyOrganization, this.subjectType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java index b651a9045..b1a490f66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getClients() { return clients; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListClientsOffsetPaginatedResponseContent other) { && clients.equals(other.clients); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.clients); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java index fca85900f..83ef25b3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListClientsRequestParameters.java @@ -201,7 +201,7 @@ private OptionalNullable _getQ() { return q; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListClientsRequestParameters && equalTo((ListClientsRequestParameters) other); @@ -224,7 +224,7 @@ private boolean equalTo(ListClientsRequestParameters other) { && q.equals(other.q); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.fields, @@ -238,7 +238,7 @@ public int hashCode() { this.q); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java index e0fe42a11..05a7d1b71 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionProfileRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListConnectionProfileRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java index 4bf5a8a59..fba212a2b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfileTemplateResponseContent.java @@ -37,7 +37,7 @@ public Optional> getConnectionProfileTemplat return connectionProfileTemplates; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionProfileTemplateResponseContent @@ -53,12 +53,12 @@ private boolean equalTo(ListConnectionProfileTemplateResponseContent other) { return connectionProfileTemplates.equals(other.connectionProfileTemplates); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectionProfileTemplates); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java index 851012f43..d0a16859b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionProfilesPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getConnectionProfiles() { return connectionProfiles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionProfilesPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListConnectionProfilesPaginatedResponseContent other) { return next.equals(other.next) && connectionProfiles.equals(other.connectionProfiles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.connectionProfiles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java index 1e052bf9a..7b7e04dcd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsCheckpointPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getConnections() { return connections; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionsCheckpointPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListConnectionsCheckpointPaginatedResponseContent other) return next.equals(other.next) && connections.equals(other.connections); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.connections); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java index 4f8748a3e..a4f64a988 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListConnectionsQueryParameters.java @@ -155,7 +155,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListConnectionsQueryParameters && equalTo((ListConnectionsQueryParameters) other); @@ -175,12 +175,12 @@ private boolean equalTo(ListConnectionsQueryParameters other) { && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.strategy, this.from, this.take, this.name, this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java index e854b6279..662c4a03e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListCustomDomainsRequestParameters.java @@ -3,7 +3,6 @@ */ package com.auth0.client.mgmt.types; -import com.auth0.client.mgmt.core.Nullable; import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.core.OptionalNullable; @@ -19,14 +18,11 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListCustomDomainsRequestParameters.Builder.class) public final class ListCustomDomainsRequestParameters { - private final OptionalNullable take; - - private final OptionalNullable from; - private final OptionalNullable q; private final OptionalNullable fields; @@ -38,15 +34,11 @@ public final class ListCustomDomainsRequestParameters { private final Map additionalProperties; private ListCustomDomainsRequestParameters( - OptionalNullable take, - OptionalNullable from, OptionalNullable q, OptionalNullable fields, OptionalNullable includeFields, OptionalNullable sort, Map additionalProperties) { - this.take = take; - this.from = from; this.q = q; this.fields = fields; this.includeFields = includeFields; @@ -54,27 +46,6 @@ private ListCustomDomainsRequestParameters( this.additionalProperties = additionalProperties; } - /** - * @return Number of results per page. Defaults to 50. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("take") - public OptionalNullable getTake() { - return take; - } - - /** - * @return Optional Id from which to start selection. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - public OptionalNullable getFrom() { - if (from == null) { - return OptionalNullable.absent(); - } - return from; - } - /** * @return Query in <a href ="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene query string syntax</a>. */ @@ -123,12 +94,6 @@ public OptionalNullable getSort() { return sort; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - private OptionalNullable _getFrom() { - return from; - } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("q") private OptionalNullable _getQ() { @@ -153,7 +118,7 @@ private OptionalNullable _getSort() { return sort; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListCustomDomainsRequestParameters @@ -166,20 +131,18 @@ public Map getAdditionalProperties() { } private boolean equalTo(ListCustomDomainsRequestParameters other) { - return take.equals(other.take) - && from.equals(other.from) - && q.equals(other.q) + return q.equals(other.q) && fields.equals(other.fields) && includeFields.equals(other.includeFields) && sort.equals(other.sort); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.take, this.from, this.q, this.fields, this.includeFields, this.sort); + return Objects.hash(this.q, this.fields, this.includeFields, this.sort); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -190,10 +153,6 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private OptionalNullable take = OptionalNullable.absent(); - - private OptionalNullable from = OptionalNullable.absent(); - private OptionalNullable q = OptionalNullable.absent(); private OptionalNullable fields = OptionalNullable.absent(); @@ -208,8 +167,6 @@ public static final class Builder { private Builder() {} public Builder from(ListCustomDomainsRequestParameters other) { - take(other.getTake()); - from(other.getFrom()); q(other.getQ()); fields(other.getFields()); includeFields(other.getIncludeFields()); @@ -217,79 +174,11 @@ public Builder from(ListCustomDomainsRequestParameters other) { return this; } - /** - *

Number of results per page. Defaults to 50.

- */ - @JsonSetter(value = "take", nulls = Nulls.SKIP) - public Builder take(OptionalNullable take) { - this.take = take; - return this; - } - - public Builder take(Integer take) { - this.take = OptionalNullable.of(take); - return this; - } - - public Builder take(Optional take) { - if (take.isPresent()) { - this.take = OptionalNullable.of(take.get()); - } else { - this.take = OptionalNullable.absent(); - } - return this; - } - - public Builder take(Nullable take) { - if (take.isNull()) { - this.take = OptionalNullable.ofNull(); - } else if (take.isEmpty()) { - this.take = OptionalNullable.absent(); - } else { - this.take = OptionalNullable.of(take.get()); - } - return this; - } - - /** - *

Optional Id from which to start selection.

- */ - @JsonSetter(value = "from", nulls = Nulls.SKIP) - public Builder from(@org.jetbrains.annotations.Nullable OptionalNullable from) { - this.from = from; - return this; - } - - public Builder from(String from) { - this.from = OptionalNullable.of(from); - return this; - } - - public Builder from(Optional from) { - if (from.isPresent()) { - this.from = OptionalNullable.of(from.get()); - } else { - this.from = OptionalNullable.absent(); - } - return this; - } - - public Builder from(Nullable from) { - if (from.isNull()) { - this.from = OptionalNullable.ofNull(); - } else if (from.isEmpty()) { - this.from = OptionalNullable.absent(); - } else { - this.from = OptionalNullable.of(from.get()); - } - return this; - } - /** *

Query in <a href ="http://www.lucenetutorial.com/lucene-query-syntax.html">Lucene query string syntax</a>.

*/ @JsonSetter(value = "q", nulls = Nulls.SKIP) - public Builder q(@org.jetbrains.annotations.Nullable OptionalNullable q) { + public Builder q(@Nullable OptionalNullable q) { this.q = q; return this; } @@ -308,7 +197,7 @@ public Builder q(Optional q) { return this; } - public Builder q(Nullable q) { + public Builder q(com.auth0.client.mgmt.core.Nullable q) { if (q.isNull()) { this.q = OptionalNullable.ofNull(); } else if (q.isEmpty()) { @@ -323,7 +212,7 @@ public Builder q(Nullable q) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ @JsonSetter(value = "fields", nulls = Nulls.SKIP) - public Builder fields(@org.jetbrains.annotations.Nullable OptionalNullable fields) { + public Builder fields(@Nullable OptionalNullable fields) { this.fields = fields; return this; } @@ -342,7 +231,7 @@ public Builder fields(Optional fields) { return this; } - public Builder fields(Nullable fields) { + public Builder fields(com.auth0.client.mgmt.core.Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); } else if (fields.isEmpty()) { @@ -357,7 +246,7 @@ public Builder fields(Nullable fields) { *

Whether specified fields are to be included (true) or excluded (false).

*/ @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) - public Builder includeFields(@org.jetbrains.annotations.Nullable OptionalNullable includeFields) { + public Builder includeFields(@Nullable OptionalNullable includeFields) { this.includeFields = includeFields; return this; } @@ -376,7 +265,7 @@ public Builder includeFields(Optional includeFields) { return this; } - public Builder includeFields(Nullable includeFields) { + public Builder includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); } else if (includeFields.isEmpty()) { @@ -391,7 +280,7 @@ public Builder includeFields(Nullable includeFields) { *

Field to sort by. Only <code>domain:1</code> (ascending order by domain) is supported at this time.

*/ @JsonSetter(value = "sort", nulls = Nulls.SKIP) - public Builder sort(@org.jetbrains.annotations.Nullable OptionalNullable sort) { + public Builder sort(@Nullable OptionalNullable sort) { this.sort = sort; return this; } @@ -410,7 +299,7 @@ public Builder sort(Optional sort) { return this; } - public Builder sort(Nullable sort) { + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { if (sort.isNull()) { this.sort = OptionalNullable.ofNull(); } else if (sort.isEmpty()) { @@ -422,8 +311,7 @@ public Builder sort(Nullable sort) { } public ListCustomDomainsRequestParameters build() { - return new ListCustomDomainsRequestParameters( - take, from, q, fields, includeFields, sort, additionalProperties); + return new ListCustomDomainsRequestParameters(q, fields, includeFields, sort, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java index 814e65f18..c97ba3c8d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getDeviceCredentials() { return deviceCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListDeviceCredentialsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListDeviceCredentialsOffsetPaginatedResponseContent othe && deviceCredentials.equals(other.deviceCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.deviceCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java index 55293598e..4bf65f863 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java @@ -179,7 +179,7 @@ private OptionalNullable _getType() { return type; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListDeviceCredentialsRequestParameters @@ -202,7 +202,7 @@ private boolean equalTo(ListDeviceCredentialsRequestParameters other) { && type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.page, @@ -215,7 +215,7 @@ public int hashCode() { this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java index c0f6bac12..8b4abaab5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListEncryptionKeyOffsetPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getKeys() { return keys; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEncryptionKeyOffsetPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListEncryptionKeyOffsetPaginatedResponseContent other) { && keys.equals(other.keys); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.keys); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java index 422d07ebe..0dffe8000 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListEventStreamsRequestParameters && equalTo((ListEventStreamsRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListEventStreamsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsResponseContent.java new file mode 100644 index 000000000..122e84755 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListEventStreamsResponseContent.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListEventStreamsResponseContent.Builder.class) +public final class ListEventStreamsResponseContent { + private final Optional> eventStreams; + + private final Map additionalProperties; + + private ListEventStreamsResponseContent( + Optional> eventStreams, Map additionalProperties) { + this.eventStreams = eventStreams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("eventStreams") + public Optional> getEventStreams() { + return eventStreams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListEventStreamsResponseContent && equalTo((ListEventStreamsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListEventStreamsResponseContent other) { + return eventStreams.equals(other.eventStreams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.eventStreams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> eventStreams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListEventStreamsResponseContent other) { + eventStreams(other.getEventStreams()); + return this; + } + + @JsonSetter(value = "eventStreams", nulls = Nulls.SKIP) + public Builder eventStreams(Optional> eventStreams) { + this.eventStreams = eventStreams; + return this; + } + + public Builder eventStreams(List eventStreams) { + this.eventStreams = Optional.ofNullable(eventStreams); + return this; + } + + public ListEventStreamsResponseContent build() { + return new ListEventStreamsResponseContent(eventStreams, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java index 46df4afaa..af0d6c733 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowExecutionsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getExecutions() { return executions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowExecutionsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListFlowExecutionsPaginatedResponseContent other) { return next.equals(other.next) && executions.equals(other.executions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.executions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java index e7726016c..94bce6bc6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getFlows() { return flows; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListFlowsOffsetPaginatedResponseContent other) { && flows.equals(other.flows); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.flows); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java index 92eb9b9de..a52a3a21c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFlowsVaultConnectionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getConnections() { return connections; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFlowsVaultConnectionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListFlowsVaultConnectionsOffsetPaginatedResponseContent && connections.equals(other.connections); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.connections); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java index 389c9c227..39ce76c65 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getForms() { return forms; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFormsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListFormsOffsetPaginatedResponseContent other) { && forms.equals(other.forms); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.forms); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java index c0ff375db..8bedcddfc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListFormsRequestParameters.java @@ -93,7 +93,7 @@ private Optional> _getHydrate() { return hydrate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListFormsRequestParameters && equalTo((ListFormsRequestParameters) other); @@ -111,12 +111,12 @@ private boolean equalTo(ListFormsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.hydrate, this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java index 1766e5e07..58d7d6974 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getHooks() { return hooks; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListHooksOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListHooksOffsetPaginatedResponseContent other) { && hooks.equals(other.hooks); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.hooks); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java index 19e7cf97d..4f14df2d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListHooksRequestParameters.java @@ -135,7 +135,7 @@ private OptionalNullable _getTriggerId() { return triggerId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListHooksRequestParameters && equalTo((ListHooksRequestParameters) other); @@ -155,12 +155,12 @@ private boolean equalTo(ListHooksRequestParameters other) { && triggerId.equals(other.triggerId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.triggerId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java index 7166299c7..1acead10e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getLogs() { return logs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListLogOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(ListLogOffsetPaginatedResponseContent other) { && logs.equals(other.logs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java index f109d2067..a6a3d2d09 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListLogsRequestParameters.java @@ -159,7 +159,7 @@ private OptionalNullable _getSearch() { return search; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListLogsRequestParameters && equalTo((ListLogsRequestParameters) other); @@ -180,13 +180,13 @@ private boolean equalTo(ListLogsRequestParameters other) { && search.equals(other.search); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.page, this.perPage, this.sort, this.fields, this.includeFields, this.includeTotals, this.search); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java index cabb05ad8..c6f098161 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional getTotal() { return total; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListNetworkAclsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListNetworkAclsOffsetPaginatedResponseContent other) { && total.equals(other.total); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.networkAcls, this.start, this.limit, this.total); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java index 7e3f48a79..c0384bdc5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListNetworkAclsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListNetworkAclsRequestParameters && equalTo((ListNetworkAclsRequestParameters) other); @@ -84,12 +84,12 @@ private boolean equalTo(ListNetworkAclsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java index 14de196cc..758e7980c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationClientGrantsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getClientGrants() { return clientGrants; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationClientGrantsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationClientGrantsOffsetPaginatedResponseConte && clientGrants.equals(other.clientGrants); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.clientGrants); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java index 6c80d4749..29935e032 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationConnectionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getEnabledConnections() { return enabledConnections; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationConnectionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationConnectionsOffsetPaginatedResponseConten && enabledConnections.equals(other.enabledConnections); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.enabledConnections); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java index 8ee750c8b..1164613b0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationDiscoveryDomainsResponseContent.java @@ -47,7 +47,7 @@ public List getDomains() { return domains; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationDiscoveryDomainsResponseContent @@ -63,12 +63,12 @@ private boolean equalTo(ListOrganizationDiscoveryDomainsResponseContent other) { return next.equals(other.next) && domains.equals(other.domains); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.domains); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java index 4487ef11b..211d4a4cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationInvitationsOffsetPaginatedResponseContent.java @@ -55,7 +55,7 @@ public Optional> getInvitations() { return invitations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationInvitationsOffsetPaginatedResponseContent @@ -71,12 +71,12 @@ private boolean equalTo(ListOrganizationInvitationsOffsetPaginatedResponseConten return start.equals(other.start) && limit.equals(other.limit) && invitations.equals(other.invitations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.invitations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java index d0f786a36..d0bc8b685 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMemberRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMemberRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListOrganizationMemberRolesOffsetPaginatedResponseConten && roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java index 15d657fde..f04ca1ef3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationMembersPaginatedResponseContent.java @@ -46,7 +46,7 @@ public Optional> getMembers() { return members; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationMembersPaginatedResponseContent @@ -62,12 +62,12 @@ private boolean equalTo(ListOrganizationMembersPaginatedResponseContent other) { return next.equals(other.next) && members.equals(other.members); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.members); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java index f242ae0e7..f299d9278 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsPaginatedResponseContent.java @@ -46,7 +46,7 @@ public Optional> getOrganizations() { return organizations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationsPaginatedResponseContent @@ -62,12 +62,12 @@ private boolean equalTo(ListOrganizationsPaginatedResponseContent other) { return next.equals(other.next) && organizations.equals(other.organizations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.organizations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java index 47ac0911b..36cbf3e96 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationsRequestParameters.java @@ -87,7 +87,7 @@ private OptionalNullable _getSort() { return sort; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListOrganizationsRequestParameters @@ -103,12 +103,12 @@ private boolean equalTo(ListOrganizationsRequestParameters other) { return from.equals(other.from) && take.equals(other.take) && sort.equals(other.sort); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take, this.sort); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java index fb3680a06..a01528c7b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListPhoneTemplatesResponseContent.java @@ -36,7 +36,7 @@ public Optional> getTemplates() { return templates; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListPhoneTemplatesResponseContent && equalTo((ListPhoneTemplatesResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(ListPhoneTemplatesResponseContent other) { return templates.equals(other.templates); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.templates); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java index 15c288983..15d627177 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRefreshTokensPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional getNext() { return next; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRefreshTokensPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListRefreshTokensPaginatedResponseContent other) { return tokens.equals(other.tokens) && next.equals(other.next); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tokens, this.next); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java index e16e3d473..9d78cdf54 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getResourceServers() { return resourceServers; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListResourceServerOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListResourceServerOffsetPaginatedResponseContent other) && resourceServers.equals(other.resourceServers); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.resourceServers); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java index fa83e9330..d145eeb9c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListResourceServerRequestParameters.java @@ -115,7 +115,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListResourceServerRequestParameters @@ -135,12 +135,12 @@ private boolean equalTo(ListResourceServerRequestParameters other) { && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifiers, this.page, this.perPage, this.includeTotals, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java index 48161d462..bc8acae9b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolePermissionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolePermissionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRolePermissionsOffsetPaginatedResponseContent other) && permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java index f45aab968..a489c2d16 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRoleUsersPaginatedResponseContent.java @@ -44,7 +44,7 @@ public Optional> getUsers() { return users; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRoleUsersPaginatedResponseContent @@ -60,12 +60,12 @@ private boolean equalTo(ListRoleUsersPaginatedResponseContent other) { return next.equals(other.next) && users.equals(other.users); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.users); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java index f10faa80c..9fbe5e5f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRolesOffsetPaginatedResponseContent other) { && roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java index 16390b233..a96db8291 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRolesRequestParameters.java @@ -91,7 +91,7 @@ private OptionalNullable _getNameFilter() { return nameFilter; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRolesRequestParameters && equalTo((ListRolesRequestParameters) other); @@ -109,12 +109,12 @@ private boolean equalTo(ListRolesRequestParameters other) { && nameFilter.equals(other.nameFilter); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals, this.nameFilter); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java index 6375420db..c1a0726c0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRules() { return rules; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRulesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListRulesOffsetPaginatedResponseContent other) { && rules.equals(other.rules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.rules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java index 78bc223a0..4175ace55 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListRulesRequestParameters.java @@ -135,7 +135,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRulesRequestParameters && equalTo((ListRulesRequestParameters) other); @@ -155,12 +155,12 @@ private boolean equalTo(ListRulesRequestParameters other) { && includeFields.equals(other.includeFields); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals, this.enabled, this.fields, this.includeFields); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java index 462582fcb..54a43729b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getSelfServiceProfiles() { return selfServiceProfiles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListSelfServiceProfilesPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListSelfServiceProfilesPaginatedResponseContent other) { && selfServiceProfiles.equals(other.selfServiceProfiles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.selfServiceProfiles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java index 768d3b62c..0416c385f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListSelfServiceProfilesRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListSelfServiceProfilesRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListSelfServiceProfilesRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java index df7fe7f72..6c03ca1f6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListTokenExchangeProfileResponseContent.java @@ -49,7 +49,7 @@ public Optional> getTokenExchangeProfi return tokenExchangeProfiles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListTokenExchangeProfileResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListTokenExchangeProfileResponseContent other) { return next.equals(other.next) && tokenExchangeProfiles.equals(other.tokenExchangeProfiles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.tokenExchangeProfiles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java index 2df6738b0..38bd827f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAttributeProfileRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListUserAttributeProfileRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java index 4656255ec..065719d3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfileTemplateResponseContent.java @@ -37,7 +37,7 @@ public Optional> getUserAttributeProfileT return userAttributeProfileTemplates; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAttributeProfileTemplateResponseContent @@ -53,12 +53,12 @@ private boolean equalTo(ListUserAttributeProfileTemplateResponseContent other) { return userAttributeProfileTemplates.equals(other.userAttributeProfileTemplates); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userAttributeProfileTemplates); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java index a036b3817..b22b02d43 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAttributeProfilesPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getUserAttributeProfiles() { return userAttributeProfiles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAttributeProfilesPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListUserAttributeProfilesPaginatedResponseContent other) return next.equals(other.next) && userAttributeProfiles.equals(other.userAttributeProfiles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.userAttributeProfiles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java index 823783b5a..832aba447 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserAuthenticationMethodsOffsetPaginatedResponseContent.java @@ -76,7 +76,7 @@ public Optional> getAuthenticators() { return authenticators; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAuthenticationMethodsOffsetPaginatedResponseContent @@ -95,12 +95,12 @@ private boolean equalTo(ListUserAuthenticationMethodsOffsetPaginatedResponseCont && authenticators.equals(other.authenticators); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.authenticators); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java index 7caeeefe2..a99680925 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierRequestParameters.java @@ -66,7 +66,7 @@ private OptionalNullable _getConsiderBruteForceEnablement() { return considerBruteForceEnablement; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksByIdentifierRequestParameters @@ -83,12 +83,12 @@ private boolean equalTo(ListUserBlocksByIdentifierRequestParameters other) { && considerBruteForceEnablement.equals(other.considerBruteForceEnablement); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier, this.considerBruteForceEnablement); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -134,7 +134,7 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ListUserBlocksByIdentifierRequestParameters other) { identifier(other.getIdentifier()); considerBruteForceEnablement(other.getConsiderBruteForceEnablement()); @@ -146,7 +146,7 @@ public Builder from(ListUserBlocksByIdentifierRequestParameters other) { *

Should be any of a username, phone number, or email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("identifier") public _FinalStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); @@ -158,7 +158,7 @@ public _FinalStage identifier(@NotNull String identifier) { * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage considerBruteForceEnablement( com.auth0.client.mgmt.core.Nullable considerBruteForceEnablement) { if (considerBruteForceEnablement.isNull()) { @@ -176,7 +176,7 @@ public _FinalStage considerBruteForceEnablement( * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage considerBruteForceEnablement(Optional considerBruteForceEnablement) { if (considerBruteForceEnablement.isPresent()) { this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement.get()); @@ -191,7 +191,7 @@ public _FinalStage considerBruteForceEnablement(Optional considerBruteF * If true and Brute Force Protection is disabled, will return an empty list.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnablement) { this.considerBruteForceEnablement = OptionalNullable.of(considerBruteForceEnablement); return this; @@ -201,7 +201,7 @@ public _FinalStage considerBruteForceEnablement(Boolean considerBruteForceEnable *

If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. * If true and Brute Force Protection is disabled, will return an empty list.

*/ - @Override + @java.lang.Override @JsonSetter(value = "consider_brute_force_enablement", nulls = Nulls.SKIP) public _FinalStage considerBruteForceEnablement( @Nullable OptionalNullable considerBruteForceEnablement) { @@ -209,7 +209,7 @@ public _FinalStage considerBruteForceEnablement( return this; } - @Override + @java.lang.Override public ListUserBlocksByIdentifierRequestParameters build() { return new ListUserBlocksByIdentifierRequestParameters( identifier, considerBruteForceEnablement, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java index ab2d1ddef..1e92989df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksByIdentifierResponseContent.java @@ -39,7 +39,7 @@ public Optional> getBlockedFor() { return blockedFor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksByIdentifierResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(ListUserBlocksByIdentifierResponseContent other) { return blockedFor.equals(other.blockedFor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.blockedFor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java index b758b4bdb..d7df16883 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksRequestParameters.java @@ -52,7 +52,7 @@ private OptionalNullable _getConsiderBruteForceEnablement() { return considerBruteForceEnablement; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksRequestParameters && equalTo((ListUserBlocksRequestParameters) other); @@ -67,12 +67,12 @@ private boolean equalTo(ListUserBlocksRequestParameters other) { return considerBruteForceEnablement.equals(other.considerBruteForceEnablement); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.considerBruteForceEnablement); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java index 6be018b03..1ac2c96b1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserBlocksResponseContent.java @@ -39,7 +39,7 @@ public Optional> getBlockedFor() { return blockedFor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserBlocksResponseContent && equalTo((ListUserBlocksResponseContent) other); @@ -54,12 +54,12 @@ private boolean equalTo(ListUserBlocksResponseContent other) { return blockedFor.equals(other.blockedFor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.blockedFor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java index 0349d438d..c6c74c3af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserConnectedAccountsResponseContent.java @@ -48,7 +48,7 @@ public Optional getNext() { return next; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserConnectedAccountsResponseContent @@ -64,12 +64,12 @@ private boolean equalTo(ListUserConnectedAccountsResponseContent other) { return connectedAccounts.equals(other.connectedAccounts) && next.equals(other.next); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectedAccounts, this.next); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java index a0852b328..ae55daad1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getGrants() { return grants; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserGrantsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserGrantsOffsetPaginatedResponseContent other) { && grants.equals(other.grants); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.grants); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java index b01d8afb7..9ea2cc9f2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserGrantsRequestParameters.java @@ -135,7 +135,7 @@ private OptionalNullable _getAudience() { return audience; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserGrantsRequestParameters && equalTo((ListUserGrantsRequestParameters) other); @@ -155,12 +155,12 @@ private boolean equalTo(ListUserGrantsRequestParameters other) { && audience.equals(other.audience); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals, this.userId, this.clientId, this.audience); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java index 04cc55f8e..9c9d1d39a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserOrganizationsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getOrganizations() { return organizations; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserOrganizationsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserOrganizationsOffsetPaginatedResponseContent othe && organizations.equals(other.organizations); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.organizations); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java index 423d4a14a..8cc2bba3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserPermissionsOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserPermissionsOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserPermissionsOffsetPaginatedResponseContent other) && permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java index d2d01d12e..80f924308 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserRolesOffsetPaginatedResponseContent.java @@ -64,7 +64,7 @@ public Optional> getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserRolesOffsetPaginatedResponseContent @@ -83,12 +83,12 @@ private boolean equalTo(ListUserRolesOffsetPaginatedResponseContent other) { && roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.total, this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java index 2f80733bd..55c248c5b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUserSessionsPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional getNext() { return next; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserSessionsPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListUserSessionsPaginatedResponseContent other) { return sessions.equals(other.sessions) && next.equals(other.next); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sessions, this.next); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java index d91e9c654..c66fe3a64 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersByEmailRequestParameters.java @@ -87,7 +87,7 @@ private OptionalNullable _getIncludeFields() { return includeFields; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersByEmailRequestParameters && equalTo((ListUsersByEmailRequestParameters) other); @@ -102,12 +102,12 @@ private boolean equalTo(ListUsersByEmailRequestParameters other) { return fields.equals(other.fields) && includeFields.equals(other.includeFields) && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.fields, this.includeFields, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -164,7 +164,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ListUsersByEmailRequestParameters other) { fields(other.getFields()); includeFields(other.getIncludeFields()); @@ -177,7 +177,7 @@ public Builder from(ListUsersByEmailRequestParameters other) { *

Email address to search for (case-sensitive).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); @@ -188,7 +188,7 @@ public _FinalStage email(@NotNull String email) { *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable includeFields) { if (includeFields.isNull()) { this.includeFields = OptionalNullable.ofNull(); @@ -204,7 +204,7 @@ public _FinalStage includeFields(com.auth0.client.mgmt.core.Nullable in *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeFields(Optional includeFields) { if (includeFields.isPresent()) { this.includeFields = OptionalNullable.of(includeFields.get()); @@ -218,7 +218,7 @@ public _FinalStage includeFields(Optional includeFields) { *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeFields(Boolean includeFields) { this.includeFields = OptionalNullable.of(includeFields); return this; @@ -227,7 +227,7 @@ public _FinalStage includeFields(Boolean includeFields) { /** *

Whether specified fields are to be included (true) or excluded (false). Defaults to true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "include_fields", nulls = Nulls.SKIP) public _FinalStage includeFields(@Nullable OptionalNullable includeFields) { this.includeFields = includeFields; @@ -238,7 +238,7 @@ public _FinalStage includeFields(@Nullable OptionalNullable includeFiel *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields) { if (fields.isNull()) { this.fields = OptionalNullable.ofNull(); @@ -254,7 +254,7 @@ public _FinalStage fields(com.auth0.client.mgmt.core.Nullable fields) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage fields(Optional fields) { if (fields.isPresent()) { this.fields = OptionalNullable.of(fields.get()); @@ -268,7 +268,7 @@ public _FinalStage fields(Optional fields) { *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage fields(String fields) { this.fields = OptionalNullable.of(fields); return this; @@ -277,14 +277,14 @@ public _FinalStage fields(String fields) { /** *

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

*/ - @Override + @java.lang.Override @JsonSetter(value = "fields", nulls = Nulls.SKIP) public _FinalStage fields(@Nullable OptionalNullable fields) { this.fields = fields; return this; } - @Override + @java.lang.Override public ListUsersByEmailRequestParameters build() { return new ListUsersByEmailRequestParameters(fields, includeFields, email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java index 608eaa856..6367d2130 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getUsers() { return users; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(ListUsersOffsetPaginatedResponseContent other) { && users.equals(other.users); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.users); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java index 8d5537ee6..b1d3bf064 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListUsersRequestParameters.java @@ -223,7 +223,7 @@ private OptionalNullable _getPrimaryOrder() { return primaryOrder; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUsersRequestParameters && equalTo((ListUsersRequestParameters) other); @@ -247,7 +247,7 @@ private boolean equalTo(ListUsersRequestParameters other) { && primaryOrder.equals(other.primaryOrder); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.page, @@ -262,7 +262,7 @@ public int hashCode() { this.primaryOrder); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java index 4f17ab9c7..6de2aee25 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListVerifiableCredentialTemplatesPaginatedResponseContent.java @@ -49,7 +49,7 @@ public Optional> getTemplates() { return templates; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListVerifiableCredentialTemplatesPaginatedResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(ListVerifiableCredentialTemplatesPaginatedResponseConten return next.equals(other.next) && templates.equals(other.templates); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.next, this.templates); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Log.java b/src/main/java/com/auth0/client/mgmt/types/Log.java index c7c583c70..27dd1c32b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Log.java +++ b/src/main/java/com/auth0/client/mgmt/types/Log.java @@ -280,7 +280,7 @@ private OptionalNullable _getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Log && equalTo((Log) other); @@ -315,7 +315,7 @@ private boolean equalTo(Log other) { && locationInfo.equals(other.locationInfo); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.date, @@ -341,7 +341,7 @@ public int hashCode() { this.locationInfo); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogDate.java b/src/main/java/com/auth0/client/mgmt/types/LogDate.java index 55307283b..5dca4f02f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogDate.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogDate && equalTo((LogDate) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogDate other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(LogDate.class); } - @Override + @java.lang.Override public LogDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java index 16c13eeff..135dfbfdd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogLocationInfo.java @@ -123,7 +123,7 @@ public Optional getContinentCode() { return continentCode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogLocationInfo && equalTo((LogLocationInfo) other); @@ -145,7 +145,7 @@ private boolean equalTo(LogLocationInfo other) { && continentCode.equals(other.continentCode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.countryCode, @@ -158,7 +158,7 @@ public int hashCode() { this.continentCode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java index ccf23b6b2..d3e305a6b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogSecurityContext.java @@ -48,7 +48,7 @@ public Optional getJa4() { return ja4; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogSecurityContext && equalTo((LogSecurityContext) other); @@ -63,12 +63,12 @@ private boolean equalTo(LogSecurityContext other) { return ja3.equals(other.ja3) && ja4.equals(other.ja4); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ja3, this.ja4); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java index 90c3f0cbc..73427a011 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogRegionEnum.java @@ -28,20 +28,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamDatadogRegionEnum && this.string.equals(((LogStreamDatadogRegionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java index 72c59837c..7655a24c4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamDatadogResponseSchema && equalTo((LogStreamDatadogResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamDatadogResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java index abda90cfa..98ca3b2d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamDatadogSink.java @@ -45,7 +45,7 @@ public LogStreamDatadogRegionEnum getDatadogRegion() { return datadogRegion; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamDatadogSink && equalTo((LogStreamDatadogSink) other); @@ -60,12 +60,12 @@ private boolean equalTo(LogStreamDatadogSink other) { return datadogApiKey.equals(other.datadogApiKey) && datadogRegion.equals(other.datadogRegion); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.datadogApiKey, this.datadogRegion); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -102,7 +102,7 @@ public static final class Builder implements DatadogApiKeyStage, DatadogRegionSt private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamDatadogSink other) { datadogApiKey(other.getDatadogApiKey()); datadogRegion(other.getDatadogRegion()); @@ -114,21 +114,21 @@ public Builder from(LogStreamDatadogSink other) { *

Datadog API Key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("datadogApiKey") public DatadogRegionStage datadogApiKey(@NotNull String datadogApiKey) { this.datadogApiKey = Objects.requireNonNull(datadogApiKey, "datadogApiKey must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("datadogRegion") public _FinalStage datadogRegion(@NotNull LogStreamDatadogRegionEnum datadogRegion) { this.datadogRegion = Objects.requireNonNull(datadogRegion, "datadogRegion must not be null"); return this; } - @Override + @java.lang.Override public LogStreamDatadogSink build() { return new LogStreamDatadogSink(datadogApiKey, datadogRegion, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java index a7ec758a8..9389ff557 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventBridgeResponseSchema @@ -135,13 +135,13 @@ private boolean equalTo(LogStreamEventBridgeResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java index 0d67e55b3..30d1188dc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSink.java @@ -61,7 +61,7 @@ public Optional getAwsPartnerEventSource() { return awsPartnerEventSource; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventBridgeSink && equalTo((LogStreamEventBridgeSink) other); @@ -78,12 +78,12 @@ private boolean equalTo(LogStreamEventBridgeSink other) { && awsPartnerEventSource.equals(other.awsPartnerEventSource); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.awsAccountId, this.awsRegion, this.awsPartnerEventSource); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -129,7 +129,7 @@ public static final class Builder implements AwsAccountIdStage, AwsRegionStage, private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamEventBridgeSink other) { awsAccountId(other.getAwsAccountId()); awsRegion(other.getAwsRegion()); @@ -142,14 +142,14 @@ public Builder from(LogStreamEventBridgeSink other) { *

AWS account ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("awsAccountId") public AwsRegionStage awsAccountId(@NotNull String awsAccountId) { this.awsAccountId = Objects.requireNonNull(awsAccountId, "awsAccountId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("awsRegion") public _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegion) { this.awsRegion = Objects.requireNonNull(awsRegion, "awsRegion must not be null"); @@ -160,7 +160,7 @@ public _FinalStage awsRegion(@NotNull LogStreamEventBridgeSinkRegionEnum awsRegi *

AWS EventBridge partner event source

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { this.awsPartnerEventSource = Optional.ofNullable(awsPartnerEventSource); return this; @@ -169,14 +169,14 @@ public _FinalStage awsPartnerEventSource(String awsPartnerEventSource) { /** *

AWS EventBridge partner event source

*/ - @Override + @java.lang.Override @JsonSetter(value = "awsPartnerEventSource", nulls = Nulls.SKIP) public _FinalStage awsPartnerEventSource(Optional awsPartnerEventSource) { this.awsPartnerEventSource = awsPartnerEventSource; return this; } - @Override + @java.lang.Override public LogStreamEventBridgeSink build() { return new LogStreamEventBridgeSink(awsAccountId, awsRegion, awsPartnerEventSource, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java index ee33639e6..c2d83884c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventBridgeSinkRegionEnum.java @@ -128,20 +128,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamEventBridgeSinkRegionEnum && this.string.equals(((LogStreamEventBridgeSinkRegionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java index 822ca29fe..daae8ad22 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridRegionEnum.java @@ -119,20 +119,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamEventGridRegionEnum && this.string.equals(((LogStreamEventGridRegionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java index fab10c215..88fbbb0ea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventGridResponseSchema && equalTo((LogStreamEventGridResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamEventGridResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java index b984ee893..f15163dd5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamEventGridSink.java @@ -73,7 +73,7 @@ public Optional getAzurePartnerTopic() { return azurePartnerTopic; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamEventGridSink && equalTo((LogStreamEventGridSink) other); @@ -91,13 +91,13 @@ private boolean equalTo(LogStreamEventGridSink other) { && azurePartnerTopic.equals(other.azurePartnerTopic); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.azureSubscriptionId, this.azureRegion, this.azureResourceGroup, this.azurePartnerTopic); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,7 +153,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamEventGridSink other) { azureSubscriptionId(other.getAzureSubscriptionId()); azureRegion(other.getAzureRegion()); @@ -167,7 +167,7 @@ public Builder from(LogStreamEventGridSink other) { *

Subscription ID

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("azureSubscriptionId") public AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId) { this.azureSubscriptionId = @@ -175,7 +175,7 @@ public AzureRegionStage azureSubscriptionId(@NotNull String azureSubscriptionId) return this; } - @Override + @java.lang.Override @JsonSetter("azureRegion") public AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum azureRegion) { this.azureRegion = Objects.requireNonNull(azureRegion, "azureRegion must not be null"); @@ -187,7 +187,7 @@ public AzureResourceGroupStage azureRegion(@NotNull LogStreamEventGridRegionEnum *

Resource Group

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("azureResourceGroup") public _FinalStage azureResourceGroup(@NotNull String azureResourceGroup) { this.azureResourceGroup = Objects.requireNonNull(azureResourceGroup, "azureResourceGroup must not be null"); @@ -198,7 +198,7 @@ public _FinalStage azureResourceGroup(@NotNull String azureResourceGroup) { *

Partner Topic

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage azurePartnerTopic(String azurePartnerTopic) { this.azurePartnerTopic = Optional.ofNullable(azurePartnerTopic); return this; @@ -207,14 +207,14 @@ public _FinalStage azurePartnerTopic(String azurePartnerTopic) { /** *

Partner Topic

*/ - @Override + @java.lang.Override @JsonSetter(value = "azurePartnerTopic", nulls = Nulls.SKIP) public _FinalStage azurePartnerTopic(Optional azurePartnerTopic) { this.azurePartnerTopic = azurePartnerTopic; return this; } - @Override + @java.lang.Override public LogStreamEventGridSink build() { return new LogStreamEventGridSink( azureSubscriptionId, azureRegion, azureResourceGroup, azurePartnerTopic, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java index 89eaf387a..12f7c4c6d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilter.java @@ -45,7 +45,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamFilter && equalTo((LogStreamFilter) other); @@ -60,12 +60,12 @@ private boolean equalTo(LogStreamFilter other) { return type.equals(other.type) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java index 37dc02cc6..5690aa6ca 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamFilterGroupNameEnum.java @@ -79,20 +79,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamFilterGroupNameEnum && this.string.equals(((LogStreamFilterGroupNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java index 3553b3f2d..ff2a585bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpContentFormatEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamHttpContentFormatEnum && this.string.equals(((LogStreamHttpContentFormatEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java index 1f89c0826..09f1163f7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamHttpResponseSchema && equalTo((LogStreamHttpResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamHttpResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java index 6c58cf2ab..73ec671fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamHttpSink.java @@ -86,7 +86,7 @@ public Optional> getHttpCustomHeaders() { return httpCustomHeaders; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamHttpSink && equalTo((LogStreamHttpSink) other); @@ -105,7 +105,7 @@ private boolean equalTo(LogStreamHttpSink other) { && httpCustomHeaders.equals(other.httpCustomHeaders); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.httpAuthorization, @@ -115,7 +115,7 @@ public int hashCode() { this.httpCustomHeaders); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder implements HttpEndpointStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamHttpSink other) { httpAuthorization(other.getHttpAuthorization()); httpContentFormat(other.getHttpContentFormat()); @@ -194,7 +194,7 @@ public Builder from(LogStreamHttpSink other) { *

HTTP endpoint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("httpEndpoint") public _FinalStage httpEndpoint(@NotNull String httpEndpoint) { this.httpEndpoint = Objects.requireNonNull(httpEndpoint, "httpEndpoint must not be null"); @@ -205,7 +205,7 @@ public _FinalStage httpEndpoint(@NotNull String httpEndpoint) { *

custom HTTP headers

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage httpCustomHeaders(List httpCustomHeaders) { this.httpCustomHeaders = Optional.ofNullable(httpCustomHeaders); return this; @@ -214,7 +214,7 @@ public _FinalStage httpCustomHeaders(List httpCustomHeaders) { /** *

custom HTTP headers

*/ - @Override + @java.lang.Override @JsonSetter(value = "httpCustomHeaders", nulls = Nulls.SKIP) public _FinalStage httpCustomHeaders(Optional> httpCustomHeaders) { this.httpCustomHeaders = httpCustomHeaders; @@ -225,7 +225,7 @@ public _FinalStage httpCustomHeaders(Optional> httpCustom *

HTTP Content-Type header

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage httpContentType(String httpContentType) { this.httpContentType = Optional.ofNullable(httpContentType); return this; @@ -234,20 +234,20 @@ public _FinalStage httpContentType(String httpContentType) { /** *

HTTP Content-Type header

*/ - @Override + @java.lang.Override @JsonSetter(value = "httpContentType", nulls = Nulls.SKIP) public _FinalStage httpContentType(Optional httpContentType) { this.httpContentType = httpContentType; return this; } - @Override + @java.lang.Override public _FinalStage httpContentFormat(LogStreamHttpContentFormatEnum httpContentFormat) { this.httpContentFormat = Optional.ofNullable(httpContentFormat); return this; } - @Override + @java.lang.Override @JsonSetter(value = "httpContentFormat", nulls = Nulls.SKIP) public _FinalStage httpContentFormat(Optional httpContentFormat) { this.httpContentFormat = httpContentFormat; @@ -258,7 +258,7 @@ public _FinalStage httpContentFormat(Optional ht *

HTTP Authorization header

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage httpAuthorization(String httpAuthorization) { this.httpAuthorization = Optional.ofNullable(httpAuthorization); return this; @@ -267,14 +267,14 @@ public _FinalStage httpAuthorization(String httpAuthorization) { /** *

HTTP Authorization header

*/ - @Override + @java.lang.Override @JsonSetter(value = "httpAuthorization", nulls = Nulls.SKIP) public _FinalStage httpAuthorization(Optional httpAuthorization) { this.httpAuthorization = httpAuthorization; return this; } - @Override + @java.lang.Override public LogStreamHttpSink build() { return new LogStreamHttpSink( httpAuthorization, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java index e600bd742..ed11aaa74 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelRegionEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamMixpanelRegionEnum && this.string.equals(((LogStreamMixpanelRegionEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java index 82c4c0120..f45369b57 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelResponseSchema && equalTo((LogStreamMixpanelResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamMixpanelResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java index 6f481d40e..0ca307704 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSink.java @@ -71,7 +71,7 @@ public String getMixpanelServiceAccountPassword() { return mixpanelServiceAccountPassword; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelSink && equalTo((LogStreamMixpanelSink) other); @@ -89,7 +89,7 @@ private boolean equalTo(LogStreamMixpanelSink other) { && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.mixpanelRegion, @@ -98,7 +98,7 @@ public int hashCode() { this.mixpanelServiceAccountPassword); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -159,7 +159,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamMixpanelSink other) { mixpanelRegion(other.getMixpanelRegion()); mixpanelProjectId(other.getMixpanelProjectId()); @@ -168,7 +168,7 @@ public Builder from(LogStreamMixpanelSink other) { return this; } - @Override + @java.lang.Override @JsonSetter("mixpanelRegion") public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); @@ -180,7 +180,7 @@ public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnu *

Mixpanel Project Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mixpanelProjectId") public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); @@ -192,7 +192,7 @@ public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mix *

Mixpanel Service Account Username

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mixpanelServiceAccountUsername") public MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( @NotNull String mixpanelServiceAccountUsername) { @@ -206,7 +206,7 @@ public MixpanelServiceAccountPasswordStage mixpanelServiceAccountUsername( *

Mixpanel Service Account Password

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mixpanelServiceAccountPassword") public _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = Objects.requireNonNull( @@ -214,7 +214,7 @@ public _FinalStage mixpanelServiceAccountPassword(@NotNull String mixpanelServic return this; } - @Override + @java.lang.Override public LogStreamMixpanelSink build() { return new LogStreamMixpanelSink( mixpanelRegion, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java index 91d8a2932..c77a29061 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamMixpanelSinkPatch.java @@ -73,7 +73,7 @@ public Optional getMixpanelServiceAccountPassword() { return mixpanelServiceAccountPassword; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamMixpanelSinkPatch && equalTo((LogStreamMixpanelSinkPatch) other); @@ -91,7 +91,7 @@ private boolean equalTo(LogStreamMixpanelSinkPatch other) { && mixpanelServiceAccountPassword.equals(other.mixpanelServiceAccountPassword); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.mixpanelRegion, @@ -100,7 +100,7 @@ public int hashCode() { this.mixpanelServiceAccountPassword); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -156,7 +156,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamMixpanelSinkPatch other) { mixpanelRegion(other.getMixpanelRegion()); mixpanelProjectId(other.getMixpanelProjectId()); @@ -165,7 +165,7 @@ public Builder from(LogStreamMixpanelSinkPatch other) { return this; } - @Override + @java.lang.Override @JsonSetter("mixpanelRegion") public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnum mixpanelRegion) { this.mixpanelRegion = Objects.requireNonNull(mixpanelRegion, "mixpanelRegion must not be null"); @@ -177,7 +177,7 @@ public MixpanelProjectIdStage mixpanelRegion(@NotNull LogStreamMixpanelRegionEnu *

Mixpanel Project Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mixpanelProjectId") public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mixpanelProjectId) { this.mixpanelProjectId = Objects.requireNonNull(mixpanelProjectId, "mixpanelProjectId must not be null"); @@ -189,7 +189,7 @@ public MixpanelServiceAccountUsernameStage mixpanelProjectId(@NotNull String mix *

Mixpanel Service Account Username

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mixpanelServiceAccountUsername") public _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServiceAccountUsername) { this.mixpanelServiceAccountUsername = Objects.requireNonNull( @@ -201,7 +201,7 @@ public _FinalStage mixpanelServiceAccountUsername(@NotNull String mixpanelServic *

Mixpanel Service Account Password

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = Optional.ofNullable(mixpanelServiceAccountPassword); return this; @@ -210,14 +210,14 @@ public _FinalStage mixpanelServiceAccountPassword(String mixpanelServiceAccountP /** *

Mixpanel Service Account Password

*/ - @Override + @java.lang.Override @JsonSetter(value = "mixpanelServiceAccountPassword", nulls = Nulls.SKIP) public _FinalStage mixpanelServiceAccountPassword(Optional mixpanelServiceAccountPassword) { this.mixpanelServiceAccountPassword = mixpanelServiceAccountPassword; return this; } - @Override + @java.lang.Override public LogStreamMixpanelSinkPatch build() { return new LogStreamMixpanelSinkPatch( mixpanelRegion, diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java index 792527cb2..3b71477db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiConfig.java @@ -56,7 +56,7 @@ public Optional getAlgorithm() { return algorithm; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamPiiConfig && equalTo((LogStreamPiiConfig) other); @@ -71,12 +71,12 @@ private boolean equalTo(LogStreamPiiConfig other) { return logFields.equals(other.logFields) && method.equals(other.method) && algorithm.equals(other.algorithm); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.logFields, this.method, this.algorithm); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java index 9c4001a36..aa094af5b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiLogFieldsEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamPiiLogFieldsEnum && this.string.equals(((LogStreamPiiLogFieldsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java index 68dc17862..d45d816df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamPiiMethodEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamPiiMethodEnum && this.string.equals(((LogStreamPiiMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java index 2829eaa68..0e7be12ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamResponseSchema.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamResponseSchema && equalTo((LogStreamResponseSchema) other); @@ -61,12 +61,12 @@ private boolean equalTo(LogStreamResponseSchema other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer super(LogStreamResponseSchema.class); } - @Override + @java.lang.Override public LogStreamResponseSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java index 3c56061f4..e0a1ec9aa 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentResponseSchema && equalTo((LogStreamSegmentResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSegmentResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java index 7cc66f423..26b9a8047 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSink.java @@ -37,7 +37,7 @@ public Optional getSegmentWriteKey() { return segmentWriteKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentSink && equalTo((LogStreamSegmentSink) other); @@ -52,12 +52,12 @@ private boolean equalTo(LogStreamSegmentSink other) { return segmentWriteKey.equals(other.segmentWriteKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.segmentWriteKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java index de367f52b..b349b869f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSegmentSinkWriteKey.java @@ -36,7 +36,7 @@ public String getSegmentWriteKey() { return segmentWriteKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSegmentSinkWriteKey && equalTo((LogStreamSegmentSinkWriteKey) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogStreamSegmentSinkWriteKey other) { return segmentWriteKey.equals(other.segmentWriteKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.segmentWriteKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements SegmentWriteKeyStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamSegmentSinkWriteKey other) { segmentWriteKey(other.getSegmentWriteKey()); return this; @@ -98,14 +98,14 @@ public Builder from(LogStreamSegmentSinkWriteKey other) { *

Segment write key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("segmentWriteKey") public _FinalStage segmentWriteKey(@NotNull String segmentWriteKey) { this.segmentWriteKey = Objects.requireNonNull(segmentWriteKey, "segmentWriteKey must not be null"); return this; } - @Override + @java.lang.Override public LogStreamSegmentSinkWriteKey build() { return new LogStreamSegmentSinkWriteKey(segmentWriteKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java index fa80644bd..594e4516a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSinkPatch.java @@ -47,7 +47,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSinkPatch && equalTo((LogStreamSinkPatch) other); @@ -57,12 +57,12 @@ private boolean equalTo(LogStreamSinkPatch other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -110,7 +110,7 @@ static final class Deserializer extends StdDeserializer { super(LogStreamSinkPatch.class); } - @Override + @java.lang.Override public LogStreamSinkPatch deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java index cd6bbd8d1..3d48b6453 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSplunkResponseSchema && equalTo((LogStreamSplunkResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSplunkResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java index c9a07bb9e..46a046528 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSplunkSink.java @@ -74,7 +74,7 @@ public boolean getSplunkSecure() { return splunkSecure; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSplunkSink && equalTo((LogStreamSplunkSink) other); @@ -92,12 +92,12 @@ private boolean equalTo(LogStreamSplunkSink other) { && splunkSecure == other.splunkSecure; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.splunkDomain, this.splunkPort, this.splunkToken, this.splunkSecure); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -156,7 +156,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamSplunkSink other) { splunkDomain(other.getSplunkDomain()); splunkPort(other.getSplunkPort()); @@ -170,7 +170,7 @@ public Builder from(LogStreamSplunkSink other) { *

Splunk URL Endpoint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("splunkDomain") public SplunkPortStage splunkDomain(@NotNull String splunkDomain) { this.splunkDomain = Objects.requireNonNull(splunkDomain, "splunkDomain must not be null"); @@ -182,7 +182,7 @@ public SplunkPortStage splunkDomain(@NotNull String splunkDomain) { *

Port

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("splunkPort") public SplunkTokenStage splunkPort(@NotNull String splunkPort) { this.splunkPort = Objects.requireNonNull(splunkPort, "splunkPort must not be null"); @@ -194,7 +194,7 @@ public SplunkTokenStage splunkPort(@NotNull String splunkPort) { *

Splunk token

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("splunkToken") public SplunkSecureStage splunkToken(@NotNull String splunkToken) { this.splunkToken = Objects.requireNonNull(splunkToken, "splunkToken must not be null"); @@ -206,14 +206,14 @@ public SplunkSecureStage splunkToken(@NotNull String splunkToken) { *

Verify TLS certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("splunkSecure") public _FinalStage splunkSecure(boolean splunkSecure) { this.splunkSecure = splunkSecure; return this; } - @Override + @java.lang.Override public LogStreamSplunkSink build() { return new LogStreamSplunkSink(splunkDomain, splunkPort, splunkToken, splunkSecure, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java index 5b526f512..4fb5fa90b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamStatusEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof LogStreamStatusEnum && this.string.equals(((LogStreamStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java index 8b26837f8..3bff6f16c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoResponseSchema.java @@ -112,7 +112,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSumoResponseSchema && equalTo((LogStreamSumoResponseSchema) other); @@ -134,13 +134,13 @@ private boolean equalTo(LogStreamSumoResponseSchema other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.status, this.type, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java index 5a902fddb..5b26ddfea 100644 --- a/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java +++ b/src/main/java/com/auth0/client/mgmt/types/LogStreamSumoSink.java @@ -36,7 +36,7 @@ public String getSumoSourceAddress() { return sumoSourceAddress; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LogStreamSumoSink && equalTo((LogStreamSumoSink) other); @@ -51,12 +51,12 @@ private boolean equalTo(LogStreamSumoSink other) { return sumoSourceAddress.equals(other.sumoSourceAddress); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sumoSourceAddress); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements SumoSourceAddressStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(LogStreamSumoSink other) { sumoSourceAddress(other.getSumoSourceAddress()); return this; @@ -98,14 +98,14 @@ public Builder from(LogStreamSumoSink other) { *

HTTP Source Address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("sumoSourceAddress") public _FinalStage sumoSourceAddress(@NotNull String sumoSourceAddress) { this.sumoSourceAddress = Objects.requireNonNull(sumoSourceAddress, "sumoSourceAddress must not be null"); return this; } - @Override + @java.lang.Override public LogStreamSumoSink build() { return new LogStreamSumoSink(sumoSourceAddress, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java index dc6a99446..db2e7af83 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationProperties.java @@ -279,7 +279,7 @@ public Optional getGivenNameNationalCharacter() { return givenNameNationalCharacter; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationProperties && equalTo((MdlPresentationProperties) other); @@ -314,7 +314,7 @@ private boolean equalTo(MdlPresentationProperties other) { && givenNameNationalCharacter.equals(other.givenNameNationalCharacter); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.familyName, @@ -340,7 +340,7 @@ public int hashCode() { this.givenNameNationalCharacter); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java index 31288e40f..e9eb58149 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequest.java @@ -34,7 +34,7 @@ public MdlPresentationRequestProperties getOrgIso1801351MDl() { return orgIso1801351MDl; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationRequest && equalTo((MdlPresentationRequest) other); @@ -49,12 +49,12 @@ private boolean equalTo(MdlPresentationRequest other) { return orgIso1801351MDl.equals(other.orgIso1801351MDl); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.orgIso1801351MDl); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements OrgIso1801351MDlStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(MdlPresentationRequest other) { orgIso1801351MDl(other.getOrgIso1801351MDl()); return this; } - @Override + @java.lang.Override @JsonSetter("org.iso.18013.5.1.mDL") public _FinalStage orgIso1801351MDl(@NotNull MdlPresentationRequestProperties orgIso1801351MDl) { this.orgIso1801351MDl = Objects.requireNonNull(orgIso1801351MDl, "orgIso1801351MDl must not be null"); return this; } - @Override + @java.lang.Override public MdlPresentationRequest build() { return new MdlPresentationRequest(orgIso1801351MDl, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java index b30f6e61f..dde377856 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/MdlPresentationRequestProperties.java @@ -34,7 +34,7 @@ public MdlPresentationProperties getOrgIso1801351() { return orgIso1801351; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof MdlPresentationRequestProperties && equalTo((MdlPresentationRequestProperties) other); @@ -49,12 +49,12 @@ private boolean equalTo(MdlPresentationRequestProperties other) { return orgIso1801351.equals(other.orgIso1801351); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.orgIso1801351); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements OrgIso1801351Stage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(MdlPresentationRequestProperties other) { orgIso1801351(other.getOrgIso1801351()); return this; } - @Override + @java.lang.Override @JsonSetter("org.iso.18013.5.1") public _FinalStage orgIso1801351(@NotNull MdlPresentationProperties orgIso1801351) { this.orgIso1801351 = Objects.requireNonNull(orgIso1801351, "orgIso1801351 must not be null"); return this; } - @Override + @java.lang.Override public MdlPresentationRequestProperties build() { return new MdlPresentationRequestProperties(orgIso1801351, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java index 95ead1c06..4acf60e81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/MfaPolicyEnum.java @@ -24,19 +24,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof MfaPolicyEnum && this.string.equals(((MfaPolicyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java index 76f7d59fa..bef1b4f76 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLogin.java @@ -54,7 +54,7 @@ public Optional getGoogle() { return google; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLogin && equalTo((NativeSocialLogin) other); @@ -69,12 +69,12 @@ private boolean equalTo(NativeSocialLogin other) { return apple.equals(other.apple) && facebook.equals(other.facebook) && google.equals(other.google); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.apple, this.facebook, this.google); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java index 1746a94a2..ba6330302 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginApple.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginApple && equalTo((NativeSocialLoginApple) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginApple other) { return enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java index 884801af9..0af39c46e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginFacebook.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginFacebook && equalTo((NativeSocialLoginFacebook) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginFacebook other) { return enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java index b303d54d3..be456d506 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java +++ b/src/main/java/com/auth0/client/mgmt/types/NativeSocialLoginGoogle.java @@ -37,7 +37,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NativeSocialLoginGoogle && equalTo((NativeSocialLoginGoogle) other); @@ -52,12 +52,12 @@ private boolean equalTo(NativeSocialLoginGoogle other) { return enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java index 510c64628..4a59f950e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclAction.java @@ -75,7 +75,7 @@ public Optional getRedirectUri() { return redirectUri; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclAction && equalTo((NetworkAclAction) other); @@ -94,12 +94,12 @@ private boolean equalTo(NetworkAclAction other) { && redirectUri.equals(other.redirectUri); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.block, this.allow, this.log, this.redirect, this.redirectUri); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java index cc98e3897..d58a63488 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclMatch.java @@ -100,7 +100,7 @@ public Optional> getUserAgents() { return userAgents; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclMatch && equalTo((NetworkAclMatch) other); @@ -122,7 +122,7 @@ private boolean equalTo(NetworkAclMatch other) { && userAgents.equals(other.userAgents); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.asns, @@ -135,7 +135,7 @@ public int hashCode() { this.userAgents); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java index 7c9e0c6f2..8511f8a3d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRule.java @@ -64,7 +64,7 @@ public NetworkAclRuleScopeEnum getScope() { return scope; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclRule && equalTo((NetworkAclRule) other); @@ -82,12 +82,12 @@ private boolean equalTo(NetworkAclRule other) { && scope.equals(other.scope); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.action, this.match, this.notMatch, this.scope); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements ActionStage, ScopeStage, _FinalStag private Builder() {} - @Override + @java.lang.Override public Builder from(NetworkAclRule other) { action(other.getAction()); match(other.getMatch()); @@ -142,47 +142,47 @@ public Builder from(NetworkAclRule other) { return this; } - @Override + @java.lang.Override @JsonSetter("action") public ScopeStage action(@NotNull NetworkAclAction action) { this.action = Objects.requireNonNull(action, "action must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("scope") public _FinalStage scope(@NotNull NetworkAclRuleScopeEnum scope) { this.scope = Objects.requireNonNull(scope, "scope must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage notMatch(NetworkAclMatch notMatch) { this.notMatch = Optional.ofNullable(notMatch); return this; } - @Override + @java.lang.Override @JsonSetter(value = "not_match", nulls = Nulls.SKIP) public _FinalStage notMatch(Optional notMatch) { this.notMatch = notMatch; return this; } - @Override + @java.lang.Override public _FinalStage match(NetworkAclMatch match) { this.match = Optional.ofNullable(match); return this; } - @Override + @java.lang.Override @JsonSetter(value = "match", nulls = Nulls.SKIP) public _FinalStage match(Optional match) { this.match = match; return this; } - @Override + @java.lang.Override public NetworkAclRule build() { return new NetworkAclRule(action, match, notMatch, scope, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java index 6b99de896..eb3c7ed21 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclRuleScopeEnum.java @@ -31,20 +31,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof NetworkAclRuleScopeEnum && this.string.equals(((NetworkAclRuleScopeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java index 2b4059986..6ab74dbe1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/NetworkAclsResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NetworkAclsResponseContent && equalTo((NetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(NetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java index bbd30f9c0..0ac8830a1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java @@ -104,6 +104,9 @@ public final class OauthScope { public static final OauthScope CREATE_SELF_SERVICE_PROFILES = new OauthScope(Value.CREATE_SELF_SERVICE_PROFILES, "create:self_service_profiles"); + public static final OauthScope UPDATE_REFRESH_TOKENS = + new OauthScope(Value.UPDATE_REFRESH_TOKENS, "update:refresh_tokens"); + public static final OauthScope READ_USER_IDP_TOKENS = new OauthScope(Value.READ_USER_IDP_TOKENS, "read:user_idp_tokens"); @@ -682,18 +685,18 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof OauthScope && this.string.equals(((OauthScope) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } @@ -774,6 +777,8 @@ public T visit(Visitor visitor) { return visitor.visitReadRulesConfigs(); case CREATE_SELF_SERVICE_PROFILES: return visitor.visitCreateSelfServiceProfiles(); + case UPDATE_REFRESH_TOKENS: + return visitor.visitUpdateRefreshTokens(); case READ_USER_IDP_TOKENS: return visitor.visitReadUserIdpTokens(); case READ_HOOKS: @@ -1283,6 +1288,8 @@ public static OauthScope valueOf(String value) { return READ_RULES_CONFIGS; case "create:self_service_profiles": return CREATE_SELF_SERVICE_PROFILES; + case "update:refresh_tokens": + return UPDATE_REFRESH_TOKENS; case "read:user_idp_tokens": return READ_USER_IDP_TOKENS; case "read:hooks": @@ -2073,6 +2080,8 @@ public enum Value { READ_REFRESH_TOKENS, + UPDATE_REFRESH_TOKENS, + DELETE_REFRESH_TOKENS, CREATE_RESOURCE_SERVERS, @@ -2577,6 +2586,8 @@ public interface Visitor { T visitReadRefreshTokens(); + T visitUpdateRefreshTokens(); + T visitDeleteRefreshTokens(); T visitCreateResourceServers(); diff --git a/src/main/java/com/auth0/client/mgmt/types/Organization.java b/src/main/java/com/auth0/client/mgmt/types/Organization.java index 3412426ce..4234f9c91 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Organization.java +++ b/src/main/java/com/auth0/client/mgmt/types/Organization.java @@ -91,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Organization && equalTo((Organization) other); @@ -111,12 +111,12 @@ private boolean equalTo(Organization other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java index 75830e5a0..db58bbc39 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBranding.java @@ -48,7 +48,7 @@ public Optional getColors() { return colors; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationBranding && equalTo((OrganizationBranding) other); @@ -63,12 +63,12 @@ private boolean equalTo(OrganizationBranding other) { return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.logoUrl, this.colors); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java index cb93c0a3b..f4935915c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationBrandingColors.java @@ -48,7 +48,7 @@ public String getPageBackground() { return pageBackground; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationBrandingColors && equalTo((OrganizationBrandingColors) other); @@ -63,12 +63,12 @@ private boolean equalTo(OrganizationBrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,7 +108,7 @@ public static final class Builder implements PrimaryStage, PageBackgroundStage, private Builder() {} - @Override + @java.lang.Override public Builder from(OrganizationBrandingColors other) { primary(other.getPrimary()); pageBackground(other.getPageBackground()); @@ -120,7 +120,7 @@ public Builder from(OrganizationBrandingColors other) { *

HEX Color for primary elements.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public PageBackgroundStage primary(@NotNull String primary) { this.primary = Objects.requireNonNull(primary, "primary must not be null"); @@ -132,14 +132,14 @@ public PageBackgroundStage primary(@NotNull String primary) { *

HEX Color for background.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("page_background") public _FinalStage pageBackground(@NotNull String pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); return this; } - @Override + @java.lang.Override public OrganizationBrandingColors build() { return new OrganizationBrandingColors(primary, pageBackground, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java index 8f2a8580d..bb281b935 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationClientGrant.java @@ -97,7 +97,7 @@ public Optional getAllowAnyOrganization() { return allowAnyOrganization; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationClientGrant && equalTo((OrganizationClientGrant) other); @@ -117,13 +117,13 @@ private boolean equalTo(OrganizationClientGrant other) { && allowAnyOrganization.equals(other.allowAnyOrganization); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.clientId, this.audience, this.scope, this.organizationUsage, this.allowAnyOrganization); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java index 6515b1429..83b16d23f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnection.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationConnection && equalTo((OrganizationConnection) other); @@ -103,7 +103,7 @@ private boolean equalTo(OrganizationConnection other) { && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -113,7 +113,7 @@ public int hashCode() { this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java index a6007168f..647c645d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationConnectionInformation.java @@ -49,7 +49,7 @@ public Optional getStrategy() { return strategy; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationConnectionInformation && equalTo((OrganizationConnectionInformation) other); @@ -64,12 +64,12 @@ private boolean equalTo(OrganizationConnectionInformation other) { return name.equals(other.name) && strategy.equals(other.strategy); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.strategy); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java index 1696f64f0..e18db7cdd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomain.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,6 +27,8 @@ public final class OrganizationDiscoveryDomain { private final OrganizationDiscoveryDomainStatus status; + private final Optional useForOrganizationDiscovery; + private final String verificationTxt; private final String verificationHost; @@ -35,12 +39,14 @@ private OrganizationDiscoveryDomain( String id, String domain, OrganizationDiscoveryDomainStatus status, + Optional useForOrganizationDiscovery, String verificationTxt, String verificationHost, Map additionalProperties) { this.id = id; this.domain = domain; this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.verificationTxt = verificationTxt; this.verificationHost = verificationHost; this.additionalProperties = additionalProperties; @@ -67,6 +73,14 @@ public OrganizationDiscoveryDomainStatus getStatus() { return status; } + /** + * @return Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + /** * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. */ @@ -83,7 +97,7 @@ public String getVerificationHost() { return verificationHost; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationDiscoveryDomain && equalTo((OrganizationDiscoveryDomain) other); @@ -98,16 +112,23 @@ private boolean equalTo(OrganizationDiscoveryDomain other) { return id.equals(other.id) && domain.equals(other.domain) && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) && verificationTxt.equals(other.verificationTxt) && verificationHost.equals(other.verificationHost); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + return Objects.hash( + this.id, + this.domain, + this.status, + this.useForOrganizationDiscovery, + this.verificationTxt, + this.verificationHost); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -152,6 +173,13 @@ public interface VerificationHostStage { public interface _FinalStage { OrganizationDiscoveryDomain build(); + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -167,16 +195,19 @@ public static final class Builder private String verificationHost; + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(OrganizationDiscoveryDomain other) { id(other.getId()); domain(other.getDomain()); status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); verificationTxt(other.getVerificationTxt()); verificationHost(other.getVerificationHost()); return this; @@ -187,7 +218,7 @@ public Builder from(OrganizationDiscoveryDomain other) { *

Organization discovery domain identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public DomainStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -199,14 +230,14 @@ public DomainStage id(@NotNull String id) { *

The domain name to associate with the organization e.g. acme.com.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public StatusStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -218,7 +249,7 @@ public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus st *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_txt") public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); @@ -230,17 +261,43 @@ public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { *

The full domain where the TXT record should be added.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_host") public _FinalStage verificationHost(@NotNull String verificationHost) { this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); return this; } - @Override + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override public OrganizationDiscoveryDomain build() { return new OrganizationDiscoveryDomain( - id, domain, status, verificationTxt, verificationHost, additionalProperties); + id, + domain, + status, + useForOrganizationDiscovery, + verificationTxt, + verificationHost, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java index 2a4b77b3e..fb19bacd8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationDiscoveryDomainStatus.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof OrganizationDiscoveryDomainStatus && this.string.equals(((OrganizationDiscoveryDomainStatus) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java index e3d52bafa..e9d82484e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationEnabledConnection.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationEnabledConnection && equalTo((OrganizationEnabledConnection) other); @@ -103,7 +103,7 @@ private boolean equalTo(OrganizationEnabledConnection other) { && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -113,7 +113,7 @@ public int hashCode() { this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java index f0587ffe7..4343fb85a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitation.java @@ -173,7 +173,7 @@ public Optional getTicketId() { return ticketId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitation && equalTo((OrganizationInvitation) other); @@ -200,7 +200,7 @@ private boolean equalTo(OrganizationInvitation other) { && ticketId.equals(other.ticketId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -218,7 +218,7 @@ public int hashCode() { this.ticketId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java index a01262fc0..8431ecd16 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInvitee.java @@ -36,7 +36,7 @@ public String getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitationInvitee && equalTo((OrganizationInvitationInvitee) other); @@ -51,12 +51,12 @@ private boolean equalTo(OrganizationInvitationInvitee other) { return email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements EmailStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(OrganizationInvitationInvitee other) { email(other.getEmail()); return this; @@ -98,14 +98,14 @@ public Builder from(OrganizationInvitationInvitee other) { *

The invitee's email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("email") public _FinalStage email(@NotNull String email) { this.email = Objects.requireNonNull(email, "email must not be null"); return this; } - @Override + @java.lang.Override public OrganizationInvitationInvitee build() { return new OrganizationInvitationInvitee(email, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java index 9c65ffea5..c144190bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationInvitationInviter.java @@ -36,7 +36,7 @@ public String getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationInvitationInviter && equalTo((OrganizationInvitationInviter) other); @@ -51,12 +51,12 @@ private boolean equalTo(OrganizationInvitationInviter other) { return name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(OrganizationInvitationInviter other) { name(other.getName()); return this; @@ -98,14 +98,14 @@ public Builder from(OrganizationInvitationInviter other) { *

The inviter's name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public OrganizationInvitationInviter build() { return new OrganizationInvitationInviter(name, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java index 53dda8b0d..4ffc171d3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMember.java @@ -85,7 +85,7 @@ public Optional> getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationMember && equalTo((OrganizationMember) other); @@ -104,12 +104,12 @@ private boolean equalTo(OrganizationMember other) { && roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId, this.picture, this.name, this.email, this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java index c96c60aa8..fe271a84f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationMemberRole.java @@ -49,7 +49,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OrganizationMemberRole && equalTo((OrganizationMemberRole) other); @@ -64,12 +64,12 @@ private boolean equalTo(OrganizationMemberRole other) { return id.equals(other.id) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java index f4c33ec86..6dbe037f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationUsageEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof OrganizationUsageEnum && this.string.equals(((OrganizationUsageEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java index e1e264233..0d58290a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PartialGroupsEnum.java @@ -40,19 +40,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PartialGroupsEnum && this.string.equals(((PartialGroupsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java index 027de320f..2b5d425e0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PartialPhoneTemplateContent.java @@ -46,7 +46,7 @@ public Optional getBody() { return body; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PartialPhoneTemplateContent && equalTo((PartialPhoneTemplateContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(PartialPhoneTemplateContent other) { return from.equals(other.from) && body.equals(other.body); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.body); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java index 1a396de2b..2e1b9f47e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PatchClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(PatchClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java index 4b7171b2f..7911c0f9e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PatchSupplementalSignalsResponseContent.java @@ -38,7 +38,7 @@ public Optional getAkamaiEnabled() { return akamaiEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PatchSupplementalSignalsResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(PatchSupplementalSignalsResponseContent other) { return akamaiEnabled.equals(other.akamaiEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java index 18ca0c1ab..a92f96555 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionRequestPayload.java @@ -48,7 +48,7 @@ public String getPermissionName() { return permissionName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PermissionRequestPayload && equalTo((PermissionRequestPayload) other); @@ -64,12 +64,12 @@ private boolean equalTo(PermissionRequestPayload other) { && permissionName.equals(other.permissionName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.resourceServerIdentifier, this.permissionName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ResourceServerIdentifierStage, Perm private Builder() {} - @Override + @java.lang.Override public Builder from(PermissionRequestPayload other) { resourceServerIdentifier(other.getResourceServerIdentifier()); permissionName(other.getPermissionName()); @@ -121,7 +121,7 @@ public Builder from(PermissionRequestPayload other) { *

Resource server (API) identifier that this permission is for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("resource_server_identifier") public PermissionNameStage resourceServerIdentifier(@NotNull String resourceServerIdentifier) { this.resourceServerIdentifier = @@ -134,14 +134,14 @@ public PermissionNameStage resourceServerIdentifier(@NotNull String resourceServ *

Name of this permission.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("permission_name") public _FinalStage permissionName(@NotNull String permissionName) { this.permissionName = Objects.requireNonNull(permissionName, "permissionName must not be null"); return this; } - @Override + @java.lang.Override public PermissionRequestPayload build() { return new PermissionRequestPayload(resourceServerIdentifier, permissionName, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java index ebad92bb5..8283fb3c3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java +++ b/src/main/java/com/auth0/client/mgmt/types/PermissionsResponsePayload.java @@ -75,7 +75,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PermissionsResponsePayload && equalTo((PermissionsResponsePayload) other); @@ -93,13 +93,13 @@ private boolean equalTo(PermissionsResponsePayload other) { && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java index 164ed7a97..b89b02963 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneAttribute.java @@ -57,7 +57,7 @@ public Optional getSignup() { return signup; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneAttribute && equalTo((PhoneAttribute) other); @@ -74,12 +74,12 @@ private boolean equalTo(PhoneAttribute other) { && signup.equals(other.signup); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier, this.profileRequired, this.signup); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java index 10c2614c5..7d13e70b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneProviderConfiguration.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderConfiguration && equalTo((PhoneProviderConfiguration) other); @@ -49,12 +49,12 @@ private boolean equalTo(PhoneProviderConfiguration other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderCredentials && equalTo((PhoneProviderCredentials) other); @@ -49,12 +49,12 @@ private boolean equalTo(PhoneProviderCredentials other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneProviderSchemaMasked && equalTo((PhoneProviderSchemaMasked) other); @@ -135,7 +135,7 @@ private boolean equalTo(PhoneProviderSchemaMasked other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -148,7 +148,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -230,7 +230,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(PhoneProviderSchemaMasked other) { id(other.getId()); tenant(other.getTenant()); @@ -243,7 +243,7 @@ public Builder from(PhoneProviderSchemaMasked other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -254,7 +254,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -263,7 +263,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -274,7 +274,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -283,20 +283,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -307,7 +307,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -316,20 +316,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @Override + @java.lang.Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -340,7 +340,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -349,27 +349,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public PhoneProviderSchemaMasked build() { return new PhoneProviderSchemaMasked( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java index 767daa358..b716bbf5f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplate.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplate && equalTo((PhoneTemplate) other); @@ -115,13 +115,13 @@ private boolean equalTo(PhoneTemplate other) { && disabled == other.disabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @Override + @java.lang.Override public Builder from(PhoneTemplate other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(PhoneTemplate other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @Override + @java.lang.Override public PhoneTemplate build() { return new PhoneTemplate(id, channel, customizable, tenant, content, type, disabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java index 411bbda39..32949a808 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateBody.java @@ -48,7 +48,7 @@ public Optional getVoice() { return voice; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplateBody && equalTo((PhoneTemplateBody) other); @@ -63,12 +63,12 @@ private boolean equalTo(PhoneTemplateBody other) { return text.equals(other.text) && voice.equals(other.voice); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.text, this.voice); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java index ffc19f987..e6f6934fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateContent.java @@ -57,7 +57,7 @@ public Optional getBody() { return body; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PhoneTemplateContent && equalTo((PhoneTemplateContent) other); @@ -72,12 +72,12 @@ private boolean equalTo(PhoneTemplateContent other) { return syntax.equals(other.syntax) && from.equals(other.from) && body.equals(other.body); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.syntax, this.from, this.body); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java index df5a8bfb0..7a64e0b1e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PhoneTemplateNotificationTypeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PhoneTemplateNotificationTypeEnum && this.string.equals(((PhoneTemplateNotificationTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java index d3b29d554..17054e06f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/PostClientCredentialResponseContent.java @@ -142,7 +142,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PostClientCredentialResponseContent @@ -167,7 +167,7 @@ private boolean equalTo(PostClientCredentialResponseContent other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -182,7 +182,7 @@ public int hashCode() { this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java index 159b7df60..2ebd01e91 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PreferredAuthenticationMethodEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PreferredAuthenticationMethodEnum && this.string.equals(((PreferredAuthenticationMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java index 3aa8bc731..6e3aef742 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java +++ b/src/main/java/com/auth0/client/mgmt/types/PrivateKeyJwt.java @@ -35,7 +35,7 @@ public List getCredentials() { return credentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PrivateKeyJwt && equalTo((PrivateKeyJwt) other); @@ -50,12 +50,12 @@ private boolean equalTo(PrivateKeyJwt other) { return credentials.equals(other.credentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.credentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java index 379d1ffa1..2f838ba30 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PromptGroupNameEnum.java @@ -107,19 +107,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PromptGroupNameEnum && this.string.equals(((PromptGroupNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java index eb92f5495..355be8241 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PromptLanguageEnum.java @@ -182,19 +182,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PromptLanguageEnum && this.string.equals(((PromptLanguageEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java index 7e22cfb03..bc9d81a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredential.java @@ -95,7 +95,7 @@ public Optional getExpiresAt() { return expiresAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PublicKeyCredential && equalTo((PublicKeyCredential) other); @@ -115,13 +115,13 @@ private boolean equalTo(PublicKeyCredential other) { && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.credentialType, this.name, this.pem, this.alg, this.parseExpiryFromCert, this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -191,7 +191,7 @@ public static final class Builder implements CredentialTypeStage, PemStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(PublicKeyCredential other) { credentialType(other.getCredentialType()); name(other.getName()); @@ -202,7 +202,7 @@ public Builder from(PublicKeyCredential other) { return this; } - @Override + @java.lang.Override @JsonSetter("credential_type") public PemStage credentialType(@NotNull String credentialType) { this.credentialType = Objects.requireNonNull(credentialType, "credentialType must not be null"); @@ -214,7 +214,7 @@ public PemStage credentialType(@NotNull String credentialType) { *

PEM-formatted public key (SPKI and PKCS1) or X509 certificate. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("pem") public _FinalStage pem(@NotNull String pem) { this.pem = Objects.requireNonNull(pem, "pem must not be null"); @@ -225,7 +225,7 @@ public _FinalStage pem(@NotNull String pem) { *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage expiresAt(OffsetDateTime expiresAt) { this.expiresAt = Optional.ofNullable(expiresAt); return this; @@ -234,7 +234,7 @@ public _FinalStage expiresAt(OffsetDateTime expiresAt) { /** *

The ISO 8601 formatted date representing the expiration of the credential. If not specified (not recommended), the credential never expires. Applies to public_key credential type.

*/ - @Override + @java.lang.Override @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) public _FinalStage expiresAt(Optional expiresAt) { this.expiresAt = expiresAt; @@ -245,7 +245,7 @@ public _FinalStage expiresAt(Optional expiresAt) { *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { this.parseExpiryFromCert = Optional.ofNullable(parseExpiryFromCert); return this; @@ -254,20 +254,20 @@ public _FinalStage parseExpiryFromCert(Boolean parseExpiryFromCert) { /** *

Parse expiry from x509 certificate. If true, attempts to parse the expiry date from the provided PEM. Applies to public_key credential type.

*/ - @Override + @java.lang.Override @JsonSetter(value = "parse_expiry_from_cert", nulls = Nulls.SKIP) public _FinalStage parseExpiryFromCert(Optional parseExpiryFromCert) { this.parseExpiryFromCert = parseExpiryFromCert; return this; } - @Override + @java.lang.Override public _FinalStage alg(PublicKeyCredentialAlgorithmEnum alg) { this.alg = Optional.ofNullable(alg); return this; } - @Override + @java.lang.Override @JsonSetter(value = "alg", nulls = Nulls.SKIP) public _FinalStage alg(Optional alg) { this.alg = alg; @@ -278,7 +278,7 @@ public _FinalStage alg(Optional alg) { *

Friendly name for a credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -287,14 +287,14 @@ public _FinalStage name(String name) { /** *

Friendly name for a credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public PublicKeyCredential build() { return new PublicKeyCredential( credentialType, name, pem, alg, parseExpiryFromCert, expiresAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java index 302f08210..01c10d3ed 100644 --- a/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/PublicKeyCredentialAlgorithmEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof PublicKeyCredentialAlgorithmEnum && this.string.equals(((PublicKeyCredentialAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java index 999dc8cf1..71c44cc4e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDate.java @@ -42,7 +42,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenDate && equalTo((RefreshTokenDate) other); @@ -52,12 +52,12 @@ private boolean equalTo(RefreshTokenDate other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer { super(RefreshTokenDate.class); } - @Override + @java.lang.Override public RefreshTokenDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java index e0b9071a8..cf85639bb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenDevice.java @@ -99,7 +99,7 @@ public Optional getLastUserAgent() { return lastUserAgent; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenDevice && equalTo((RefreshTokenDevice) other); @@ -119,13 +119,13 @@ private boolean equalTo(RefreshTokenDevice other) { && lastUserAgent.equals(other.lastUserAgent); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.initialIp, this.initialAsn, this.initialUserAgent, this.lastIp, this.lastAsn, this.lastUserAgent); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java index 0dc94c2a5..423edab00 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenExpirationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof RefreshTokenExpirationTypeEnum && this.string.equals(((RefreshTokenExpirationTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java index 4f3b6da91..424d49153 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResourceServer.java @@ -49,7 +49,7 @@ public Optional getScopes() { return scopes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenResourceServer && equalTo((RefreshTokenResourceServer) other); @@ -64,12 +64,12 @@ private boolean equalTo(RefreshTokenResourceServer other) { return audience.equals(other.audience) && scopes.equals(other.scopes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.audience, this.scopes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java index 83d2a98fa..21aa1565c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenResponseContent.java @@ -44,6 +44,8 @@ public final class RefreshTokenResponseContent { private final Optional> resourceServers; + private final OptionalNullable> refreshTokenMetadata; + private final Optional lastExchangedAt; private final Map additionalProperties; @@ -59,6 +61,7 @@ private RefreshTokenResponseContent( OptionalNullable sessionId, Optional rotating, Optional> resourceServers, + OptionalNullable> refreshTokenMetadata, Optional lastExchangedAt, Map additionalProperties) { this.id = id; @@ -71,6 +74,7 @@ private RefreshTokenResponseContent( this.sessionId = sessionId; this.rotating = rotating; this.resourceServers = resourceServers; + this.refreshTokenMetadata = refreshTokenMetadata; this.lastExchangedAt = lastExchangedAt; this.additionalProperties = additionalProperties; } @@ -144,6 +148,15 @@ public Optional> getResourceServers() { return resourceServers; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + public OptionalNullable> getRefreshTokenMetadata() { + if (refreshTokenMetadata == null) { + return OptionalNullable.absent(); + } + return refreshTokenMetadata; + } + @JsonProperty("last_exchanged_at") public Optional getLastExchangedAt() { return lastExchangedAt; @@ -155,7 +168,13 @@ private OptionalNullable _getSessionId() { return sessionId; } - @Override + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + private OptionalNullable> _getRefreshTokenMetadata() { + return refreshTokenMetadata; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RefreshTokenResponseContent && equalTo((RefreshTokenResponseContent) other); @@ -177,10 +196,11 @@ private boolean equalTo(RefreshTokenResponseContent other) { && sessionId.equals(other.sessionId) && rotating.equals(other.rotating) && resourceServers.equals(other.resourceServers) + && refreshTokenMetadata.equals(other.refreshTokenMetadata) && lastExchangedAt.equals(other.lastExchangedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -193,10 +213,11 @@ public int hashCode() { this.sessionId, this.rotating, this.resourceServers, + this.refreshTokenMetadata, this.lastExchangedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -227,6 +248,8 @@ public static final class Builder { private Optional> resourceServers = Optional.empty(); + private OptionalNullable> refreshTokenMetadata = OptionalNullable.absent(); + private Optional lastExchangedAt = Optional.empty(); @JsonAnySetter @@ -245,6 +268,7 @@ public Builder from(RefreshTokenResponseContent other) { sessionId(other.getSessionId()); rotating(other.getRotating()); resourceServers(other.getResourceServers()); + refreshTokenMetadata(other.getRefreshTokenMetadata()); lastExchangedAt(other.getLastExchangedAt()); return this; } @@ -394,6 +418,38 @@ public Builder resourceServers(List resourceServers) return this; } + @JsonSetter(value = "refresh_token_metadata", nulls = Nulls.SKIP) + public Builder refreshTokenMetadata(@Nullable OptionalNullable> refreshTokenMetadata) { + this.refreshTokenMetadata = refreshTokenMetadata; + return this; + } + + public Builder refreshTokenMetadata(Map refreshTokenMetadata) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata); + return this; + } + + public Builder refreshTokenMetadata(Optional> refreshTokenMetadata) { + if (refreshTokenMetadata.isPresent()) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } else { + this.refreshTokenMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshTokenMetadata( + com.auth0.client.mgmt.core.Nullable> refreshTokenMetadata) { + if (refreshTokenMetadata.isNull()) { + this.refreshTokenMetadata = OptionalNullable.ofNull(); + } else if (refreshTokenMetadata.isEmpty()) { + this.refreshTokenMetadata = OptionalNullable.absent(); + } else { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } + return this; + } + @JsonSetter(value = "last_exchanged_at", nulls = Nulls.SKIP) public Builder lastExchangedAt(Optional lastExchangedAt) { this.lastExchangedAt = lastExchangedAt; @@ -417,6 +473,7 @@ public RefreshTokenResponseContent build() { sessionId, rotating, resourceServers, + refreshTokenMetadata, lastExchangedAt, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java index ce0c04b76..e7ec8768c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RefreshTokenRotationTypeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof RefreshTokenRotationTypeEnum && this.string.equals(((RefreshTokenRotationTypeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java index 297de6f8d..e20b46a0e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RegenerateUsersRecoveryCodeResponseContent.java @@ -38,7 +38,7 @@ public Optional getRecoveryCode() { return recoveryCode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RegenerateUsersRecoveryCodeResponseContent @@ -54,12 +54,12 @@ private boolean equalTo(RegenerateUsersRecoveryCodeResponseContent other) { return recoveryCode.equals(other.recoveryCode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.recoveryCode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java index 46149c473..214459bc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResetPhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResetPhoneTemplateResponseContent && equalTo((ResetPhoneTemplateResponseContent) other); @@ -115,13 +115,13 @@ private boolean equalTo(ResetPhoneTemplateResponseContent other) { && disabled == other.disabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -188,7 +188,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @Override + @java.lang.Override public Builder from(ResetPhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -200,21 +200,21 @@ public Builder from(ResetPhoneTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -226,53 +226,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @Override + @java.lang.Override public ResetPhoneTemplateResponseContent build() { return new ResetPhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java index 2fe03aa96..90c19f16d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java @@ -268,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServer && equalTo((ResourceServer) other); @@ -301,7 +301,7 @@ private boolean equalTo(ResourceServer other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -325,7 +325,7 @@ public int hashCode() { this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java index b33d42099..cd6214c52 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossession.java @@ -47,7 +47,7 @@ public boolean getRequired() { return required; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerProofOfPossession && equalTo((ResourceServerProofOfPossession) other); @@ -62,12 +62,12 @@ private boolean equalTo(ResourceServerProofOfPossession other) { return mechanism.equals(other.mechanism) && required == other.required; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mechanism, this.required); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -104,14 +104,14 @@ public static final class Builder implements MechanismStage, RequiredStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(ResourceServerProofOfPossession other) { mechanism(other.getMechanism()); required(other.getRequired()); return this; } - @Override + @java.lang.Override @JsonSetter("mechanism") public RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanismEnum mechanism) { this.mechanism = Objects.requireNonNull(mechanism, "mechanism must not be null"); @@ -123,14 +123,14 @@ public RequiredStage mechanism(@NotNull ResourceServerProofOfPossessionMechanism *

Whether the use of Proof-of-Possession is required for the resource server

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("required") public _FinalStage required(boolean required) { this.required = required; return this; } - @Override + @java.lang.Override public ResourceServerProofOfPossession build() { return new ResourceServerProofOfPossession(mechanism, required, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java index 9177f4e5b..365f9920a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerProofOfPossessionMechanismEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerProofOfPossessionMechanismEnum && this.string.equals(((ResourceServerProofOfPossessionMechanismEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java index ec6f1512f..483429c0e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerScope.java @@ -49,7 +49,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerScope && equalTo((ResourceServerScope) other); @@ -64,12 +64,12 @@ private boolean equalTo(ResourceServerScope other) { return value.equals(other.value) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ValueStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ResourceServerScope other) { value(other.getValue()); description(other.getDescription()); @@ -121,7 +121,7 @@ public Builder from(ResourceServerScope other) { *

Value of this scope.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); @@ -132,7 +132,7 @@ public _FinalStage value(@NotNull String value) { *

User-friendly description of this scope.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; @@ -141,14 +141,14 @@ public _FinalStage description(String description) { /** *

User-friendly description of this scope.

*/ - @Override + @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional description) { this.description = description; return this; } - @Override + @java.lang.Override public ResourceServerScope build() { return new ResourceServerScope(value, description, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java index 8c292356c..4f2b68694 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java @@ -45,7 +45,7 @@ public Optional getClient() { return client; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerSubjectTypeAuthorization @@ -61,12 +61,12 @@ private boolean equalTo(ResourceServerSubjectTypeAuthorization other) { return user.equals(other.user) && client.equals(other.client); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.user, this.client); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java index 8abba65a4..57ce7692c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClient.java @@ -36,7 +36,7 @@ public Optional getPolic return policy; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerSubjectTypeAuthorizationClient @@ -52,12 +52,12 @@ private boolean equalTo(ResourceServerSubjectTypeAuthorizationClient other) { return policy.equals(other.policy); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.policy); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java index 1d274d16e..d0d931326 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationClientPolicyEnum.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerSubjectTypeAuthorizationClientPolicyEnum && this.string.equals(((ResourceServerSubjectTypeAuthorizationClientPolicyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java index 39176de03..ff6983cb3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUser.java @@ -36,7 +36,7 @@ public Optional getPolicy( return policy; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerSubjectTypeAuthorizationUser @@ -52,12 +52,12 @@ private boolean equalTo(ResourceServerSubjectTypeAuthorizationUser other) { return policy.equals(other.policy); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.policy); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java index 1331fa5ea..9f27f109c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationUserPolicyEnum.java @@ -30,20 +30,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerSubjectTypeAuthorizationUserPolicyEnum && this.string.equals(((ResourceServerSubjectTypeAuthorizationUserPolicyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java index 9bdd0142e..41d95ba20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectResponseEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenDialectResponseEnum && this.string.equals(((ResourceServerTokenDialectResponseEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java index 888345fee..8124b2690 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenDialectSchemaEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenDialectSchemaEnum && this.string.equals(((ResourceServerTokenDialectSchemaEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java index 12d48d13f..468eb7521 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryption.java @@ -42,7 +42,7 @@ public ResourceServerTokenEncryptionKey getEncryptionKey() { return encryptionKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerTokenEncryption && equalTo((ResourceServerTokenEncryption) other); @@ -57,12 +57,12 @@ private boolean equalTo(ResourceServerTokenEncryption other) { return format.equals(other.format) && encryptionKey.equals(other.encryptionKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.format, this.encryptionKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +96,28 @@ public static final class Builder implements FormatStage, EncryptionKeyStage, _F private Builder() {} - @Override + @java.lang.Override public Builder from(ResourceServerTokenEncryption other) { format(other.getFormat()); encryptionKey(other.getEncryptionKey()); return this; } - @Override + @java.lang.Override @JsonSetter("format") public EncryptionKeyStage format(@NotNull String format) { this.format = Objects.requireNonNull(format, "format must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("encryption_key") public _FinalStage encryptionKey(@NotNull ResourceServerTokenEncryptionKey encryptionKey) { this.encryptionKey = Objects.requireNonNull(encryptionKey, "encryptionKey must not be null"); return this; } - @Override + @java.lang.Override public ResourceServerTokenEncryption build() { return new ResourceServerTokenEncryption(format, encryptionKey, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java index b4ce05be7..ad694adff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionAlgorithmEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ResourceServerTokenEncryptionAlgorithmEnum && this.string.equals(((ResourceServerTokenEncryptionAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java index 8b11ac30d..6715e0f2c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerTokenEncryptionKey.java @@ -73,7 +73,7 @@ public String getPem() { return pem; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ResourceServerTokenEncryptionKey && equalTo((ResourceServerTokenEncryptionKey) other); @@ -88,12 +88,12 @@ private boolean equalTo(ResourceServerTokenEncryptionKey other) { return name.equals(other.name) && alg.equals(other.alg) && kid.equals(other.kid) && pem.equals(other.pem); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.alg, this.kid, this.pem); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -148,7 +148,7 @@ public static final class Builder implements AlgStage, PemStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ResourceServerTokenEncryptionKey other) { name(other.getName()); alg(other.getAlg()); @@ -157,7 +157,7 @@ public Builder from(ResourceServerTokenEncryptionKey other) { return this; } - @Override + @java.lang.Override @JsonSetter("alg") public PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg) { this.alg = Objects.requireNonNull(alg, "alg must not be null"); @@ -169,7 +169,7 @@ public PemStage alg(@NotNull ResourceServerTokenEncryptionAlgorithmEnum alg) { *

PEM-formatted public key. Must be JSON escaped.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("pem") public _FinalStage pem(@NotNull String pem) { this.pem = Objects.requireNonNull(pem, "pem must not be null"); @@ -180,7 +180,7 @@ public _FinalStage pem(@NotNull String pem) { *

Key ID.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage kid(String kid) { this.kid = Optional.ofNullable(kid); return this; @@ -189,7 +189,7 @@ public _FinalStage kid(String kid) { /** *

Key ID.

*/ - @Override + @java.lang.Override @JsonSetter(value = "kid", nulls = Nulls.SKIP) public _FinalStage kid(Optional kid) { this.kid = kid; @@ -200,7 +200,7 @@ public _FinalStage kid(Optional kid) { *

Name of the encryption key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -209,14 +209,14 @@ public _FinalStage name(String name) { /** *

Name of the encryption key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public ResourceServerTokenEncryptionKey build() { return new ResourceServerTokenEncryptionKey(name, alg, kid, pem, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java index a3f9ac2b9..7c0ebc5d8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RevokeUserAccessRequestContent.java @@ -51,7 +51,7 @@ public Optional getPreserveRefreshTokens() { return preserveRefreshTokens; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RevokeUserAccessRequestContent && equalTo((RevokeUserAccessRequestContent) other); @@ -66,12 +66,12 @@ private boolean equalTo(RevokeUserAccessRequestContent other) { return sessionId.equals(other.sessionId) && preserveRefreshTokens.equals(other.preserveRefreshTokens); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sessionId, this.preserveRefreshTokens); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java index 022f7f475..480903d04 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RevokedSigningKeysResponseContent.java @@ -47,7 +47,7 @@ public String getKid() { return kid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RevokedSigningKeysResponseContent && equalTo((RevokedSigningKeysResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(RevokedSigningKeysResponseContent other) { return cert.equals(other.cert) && kid.equals(other.kid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.cert, this.kid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements CertStage, KidStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(RevokedSigningKeysResponseContent other) { cert(other.getCert()); kid(other.getKid()); @@ -119,7 +119,7 @@ public Builder from(RevokedSigningKeysResponseContent other) { *

Revoked key certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public KidStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -131,14 +131,14 @@ public KidStage cert(@NotNull String cert) { *

Revoked key id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public _FinalStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override public RevokedSigningKeysResponseContent build() { return new RevokedSigningKeysResponseContent(cert, kid, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Role.java b/src/main/java/com/auth0/client/mgmt/types/Role.java index 949895c1c..6fb817d6a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Role.java +++ b/src/main/java/com/auth0/client/mgmt/types/Role.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Role && equalTo((Role) other); @@ -78,12 +78,12 @@ private boolean equalTo(Role other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RoleUser.java b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java index 67e640c69..7e84435cc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RoleUser.java +++ b/src/main/java/com/auth0/client/mgmt/types/RoleUser.java @@ -75,7 +75,7 @@ public Optional getEmail() { return email; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RoleUser && equalTo((RoleUser) other); @@ -93,12 +93,12 @@ private boolean equalTo(RoleUser other) { && email.equals(other.email); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.userId, this.picture, this.name, this.email); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java index fc4e0f460..8f14ada6f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java @@ -676,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateClientSecretResponseContent && equalTo((RotateClientSecretResponseContent) other); @@ -744,7 +744,7 @@ private boolean equalTo(RotateClientSecretResponseContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -802,7 +802,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java index 3c4ec2ebf..82394286a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysRequestContent.java @@ -35,7 +35,7 @@ public Optional getSigningAlg() { return signingAlg; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateConnectionKeysRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(RotateConnectionKeysRequestContent other) { return signingAlg.equals(other.signingAlg); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.signingAlg); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java index 052704cce..912cd24f4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionKeysSigningAlgEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof RotateConnectionKeysSigningAlgEnum && this.string.equals(((RotateConnectionKeysSigningAlgEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java index 88a1a5a89..ffbdd5bad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateConnectionsKeysResponseContent.java @@ -130,7 +130,7 @@ public Optional getSubjectDn() { return subjectDn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateConnectionsKeysResponseContent @@ -154,7 +154,7 @@ private boolean equalTo(RotateConnectionsKeysResponseContent other) { && subjectDn.equals(other.subjectDn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, @@ -168,7 +168,7 @@ public int hashCode() { this.subjectDn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -265,7 +265,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @Override + @java.lang.Override public Builder from(RotateConnectionsKeysResponseContent other) { kid(other.getKid()); cert(other.getCert()); @@ -284,7 +284,7 @@ public Builder from(RotateConnectionsKeysResponseContent other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -296,7 +296,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -308,7 +308,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -320,33 +320,33 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage subjectDn(String subjectDn) { this.subjectDn = Optional.ofNullable(subjectDn); return this; } - @Override + @java.lang.Override @JsonSetter(value = "subject_dn", nulls = Nulls.SKIP) public _FinalStage subjectDn(Optional subjectDn) { this.subjectDn = subjectDn; return this; } - @Override + @java.lang.Override public _FinalStage keyUse(ConnectionKeyUseEnum keyUse) { this.keyUse = Optional.ofNullable(keyUse); return this; } - @Override + @java.lang.Override @JsonSetter(value = "key_use", nulls = Nulls.SKIP) public _FinalStage keyUse(Optional keyUse) { this.keyUse = keyUse; @@ -357,7 +357,7 @@ public _FinalStage keyUse(Optional keyUse) { *

Signing key algorithm

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage algorithm(String algorithm) { this.algorithm = Optional.ofNullable(algorithm); return this; @@ -366,7 +366,7 @@ public _FinalStage algorithm(String algorithm) { /** *

Signing key algorithm

*/ - @Override + @java.lang.Override @JsonSetter(value = "algorithm", nulls = Nulls.SKIP) public _FinalStage algorithm(Optional algorithm) { this.algorithm = algorithm; @@ -377,7 +377,7 @@ public _FinalStage algorithm(Optional algorithm) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -386,7 +386,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @Override + @java.lang.Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -397,7 +397,7 @@ public _FinalStage next(Optional next) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage pkcs(String pkcs) { this.pkcs = Optional.ofNullable(pkcs); return this; @@ -406,14 +406,14 @@ public _FinalStage pkcs(String pkcs) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "pkcs", nulls = Nulls.SKIP) public _FinalStage pkcs(Optional pkcs) { this.pkcs = pkcs; return this; } - @Override + @java.lang.Override public RotateConnectionsKeysResponseContent build() { return new RotateConnectionsKeysResponseContent( kid, cert, pkcs, next, fingerprint, thumbprint, algorithm, keyUse, subjectDn, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java index c4bbf707e..1ab5d2e5f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateSigningKeysResponseContent.java @@ -47,7 +47,7 @@ public String getKid() { return kid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RotateSigningKeysResponseContent && equalTo((RotateSigningKeysResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(RotateSigningKeysResponseContent other) { return cert.equals(other.cert) && kid.equals(other.kid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.cert, this.kid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements CertStage, KidStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(RotateSigningKeysResponseContent other) { cert(other.getCert()); kid(other.getKid()); @@ -119,7 +119,7 @@ public Builder from(RotateSigningKeysResponseContent other) { *

Next key certificate

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public KidStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -131,14 +131,14 @@ public KidStage cert(@NotNull String cert) { *

Next key id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public _FinalStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); return this; } - @Override + @java.lang.Override public RotateSigningKeysResponseContent build() { return new RotateSigningKeysResponseContent(cert, kid, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/Rule.java b/src/main/java/com/auth0/client/mgmt/types/Rule.java index ca6643cbd..f2dabb288 100644 --- a/src/main/java/com/auth0/client/mgmt/types/Rule.java +++ b/src/main/java/com/auth0/client/mgmt/types/Rule.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Rule && equalTo((Rule) other); @@ -119,12 +119,12 @@ private boolean equalTo(Rule other) { && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java index 240a16530..356148acf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/RulesConfig.java @@ -37,7 +37,7 @@ public Optional getKey() { return key; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof RulesConfig && equalTo((RulesConfig) other); @@ -52,12 +52,12 @@ private boolean equalTo(RulesConfig other) { return key.equals(other.key); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.key); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java index ee3927c78..982709a3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScimMappingItem.java @@ -48,7 +48,7 @@ public Optional getScim() { return scim; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ScimMappingItem && equalTo((ScimMappingItem) other); @@ -63,12 +63,12 @@ private boolean equalTo(ScimMappingItem other) { return auth0.equals(other.auth0) && scim.equals(other.scim); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.auth0, this.scim); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java index 5474d077b..8bfce20a3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScimTokenItem.java @@ -88,7 +88,7 @@ public Optional getLastUsedAt() { return lastUsedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ScimTokenItem && equalTo((ScimTokenItem) other); @@ -107,12 +107,12 @@ private boolean equalTo(ScimTokenItem other) { && lastUsedAt.equals(other.lastUsedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tokenId, this.scopes, this.createdAt, this.validUntil, this.lastUsedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java index 3d4fac83d..d050dece5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ScreenGroupNameEnum.java @@ -278,19 +278,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof ScreenGroupNameEnum && this.string.equals(((ScreenGroupNameEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java index 064659af8..5a1e7fbf1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SearchEngineVersionsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SearchEngineVersionsEnum && this.string.equals(((SearchEngineVersionsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java index 7f91ad0fe..94f41df4d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfile.java @@ -134,7 +134,7 @@ public Optional getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfile && equalTo((SelfServiceProfile) other); @@ -157,7 +157,7 @@ private boolean equalTo(SelfServiceProfile other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java index 475f8ad1f..493df00d2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileAllowedStrategyEnum.java @@ -44,20 +44,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileAllowedStrategyEnum && this.string.equals(((SelfServiceProfileAllowedStrategyEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java index 9200445db..a7b65cd3c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingColors.java @@ -33,7 +33,7 @@ public String getPrimary() { return primary; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileBrandingColors && equalTo((SelfServiceProfileBrandingColors) other); @@ -48,12 +48,12 @@ private boolean equalTo(SelfServiceProfileBrandingColors other) { return primary.equals(other.primary); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.primary); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements PrimaryStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileBrandingColors other) { primary(other.getPrimary()); return this; } - @Override + @java.lang.Override @JsonSetter("primary") public _FinalStage primary(@NotNull String primary) { this.primary = Objects.requireNonNull(primary, "primary must not be null"); return this; } - @Override + @java.lang.Override public SelfServiceProfileBrandingColors build() { return new SelfServiceProfileBrandingColors(primary, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java index 60905bbeb..3ece91ff2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileBrandingProperties.java @@ -45,7 +45,7 @@ public Optional getColors() { return colors; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileBrandingProperties @@ -61,12 +61,12 @@ private boolean equalTo(SelfServiceProfileBrandingProperties other) { return logoUrl.equals(other.logoUrl) && colors.equals(other.colors); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.logoUrl, this.colors); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java index 1669c341c..00ce38c87 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionConfig.java @@ -107,7 +107,7 @@ private OptionalNullable _getOptio return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketConnectionConfig @@ -128,13 +128,13 @@ private boolean equalTo(SelfServiceProfileSsoTicketConnectionConfig other) { && options.equals(other.options); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.displayName, this.isDomainConnection, this.showAsButton, this.metadata, this.options); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -208,7 +208,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileSsoTicketConnectionConfig other) { name(other.getName()); displayName(other.getDisplayName()); @@ -224,14 +224,14 @@ public Builder from(SelfServiceProfileSsoTicketConnectionConfig other) { *

The name of the connection that will be created as a part of the SSO flow.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage options( com.auth0.client.mgmt.core.Nullable options) { if (options.isNull()) { @@ -244,7 +244,7 @@ public _FinalStage options( return this; } - @Override + @java.lang.Override public _FinalStage options(Optional options) { if (options.isPresent()) { this.options = OptionalNullable.of(options.get()); @@ -254,26 +254,26 @@ public _FinalStage options(Optional options) { this.options = options; return this; } - @Override + @java.lang.Override public _FinalStage metadata(Map> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional>> metadata) { this.metadata = metadata; @@ -284,7 +284,7 @@ public _FinalStage metadata(Optional>> meta *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -293,7 +293,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)

*/ - @Override + @java.lang.Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -304,7 +304,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isDomainConnection(Boolean isDomainConnection) { this.isDomainConnection = Optional.ofNullable(isDomainConnection); return this; @@ -313,7 +313,7 @@ public _FinalStage isDomainConnection(Boolean isDomainConnection) { /** *

<code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)

*/ - @Override + @java.lang.Override @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) public _FinalStage isDomainConnection(Optional isDomainConnection) { this.isDomainConnection = isDomainConnection; @@ -324,7 +324,7 @@ public _FinalStage isDomainConnection(Optional isDomainConnection) { *

Connection name used in the new universal login experience

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -333,14 +333,14 @@ public _FinalStage displayName(String displayName) { /** *

Connection name used in the new universal login experience

*/ - @Override + @java.lang.Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public SelfServiceProfileSsoTicketConnectionConfig build() { return new SelfServiceProfileSsoTicketConnectionConfig( name, displayName, isDomainConnection, showAsButton, metadata, options, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java index 67c160e5e..ecd00be80 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketConnectionOptions.java @@ -84,7 +84,7 @@ private OptionalNullable _getIdp return idpinitiated; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketConnectionOptions @@ -102,12 +102,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketConnectionOptions other) { && idpinitiated.equals(other.idpinitiated); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.iconUrl, this.domainAliases, this.idpinitiated); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java index d4d653577..94a640d7f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainAliasesConfig.java @@ -35,7 +35,7 @@ public SelfServiceProfileSsoTicketDomainVerificationEnum getDomainVerification() return domainVerification; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketDomainAliasesConfig @@ -51,12 +51,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketDomainAliasesConfig other) { return domainVerification.equals(other.domainVerification); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.domainVerification); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -84,13 +84,13 @@ public static final class Builder implements DomainVerificationStage, _FinalStag private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileSsoTicketDomainAliasesConfig other) { domainVerification(other.getDomainVerification()); return this; } - @Override + @java.lang.Override @JsonSetter("domain_verification") public _FinalStage domainVerification( @NotNull SelfServiceProfileSsoTicketDomainVerificationEnum domainVerification) { @@ -98,7 +98,7 @@ public _FinalStage domainVerification( return this; } - @Override + @java.lang.Override public SelfServiceProfileSsoTicketDomainAliasesConfig build() { return new SelfServiceProfileSsoTicketDomainAliasesConfig(domainVerification, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java index 5661c511c..dcb54f647 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketDomainVerificationEnum.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketDomainVerificationEnum && this.string.equals(((SelfServiceProfileSsoTicketDomainVerificationEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java index 86efd66d2..b84285960 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketEnabledOrganization.java @@ -64,7 +64,7 @@ public Optional getShowAsButton() { return showAsButton; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketEnabledOrganization @@ -82,12 +82,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketEnabledOrganization other) { && showAsButton.equals(other.showAsButton); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.organizationId, this.assignMembershipOnLogin, this.showAsButton); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -136,7 +136,7 @@ public static final class Builder implements OrganizationIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileSsoTicketEnabledOrganization other) { organizationId(other.getOrganizationId()); assignMembershipOnLogin(other.getAssignMembershipOnLogin()); @@ -149,7 +149,7 @@ public Builder from(SelfServiceProfileSsoTicketEnabledOrganization other) { *

Organization identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("organization_id") public _FinalStage organizationId(@NotNull String organizationId) { this.organizationId = Objects.requireNonNull(organizationId, "organizationId must not be null"); @@ -160,7 +160,7 @@ public _FinalStage organizationId(@NotNull String organizationId) { *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage showAsButton(Boolean showAsButton) { this.showAsButton = Optional.ofNullable(showAsButton); return this; @@ -169,7 +169,7 @@ public _FinalStage showAsButton(Boolean showAsButton) { /** *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) public _FinalStage showAsButton(Optional showAsButton) { this.showAsButton = showAsButton; @@ -180,7 +180,7 @@ public _FinalStage showAsButton(Optional showAsButton) { *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); return this; @@ -189,14 +189,14 @@ public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { /** *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

*/ - @Override + @java.lang.Override @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { this.assignMembershipOnLogin = assignMembershipOnLogin; return this; } - @Override + @java.lang.Override public SelfServiceProfileSsoTicketEnabledOrganization build() { return new SelfServiceProfileSsoTicketEnabledOrganization( organizationId, assignMembershipOnLogin, showAsButton, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java index 7c169abdc..a9454e976 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketGoogleWorkspaceConfig.java @@ -36,7 +36,7 @@ public boolean getSyncUsers() { return syncUsers; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketGoogleWorkspaceConfig @@ -52,12 +52,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other) return syncUsers == other.syncUsers; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.syncUsers); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements SyncUsersStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other) { syncUsers(other.getSyncUsers()); return this; @@ -99,14 +99,14 @@ public Builder from(SelfServiceProfileSsoTicketGoogleWorkspaceConfig other) { *

Whether to enable Google Workspace Directory Sync for users during the self-service flow.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("sync_users") public _FinalStage syncUsers(boolean syncUsers) { this.syncUsers = syncUsers; return this; } - @Override + @java.lang.Override public SelfServiceProfileSsoTicketGoogleWorkspaceConfig build() { return new SelfServiceProfileSsoTicketGoogleWorkspaceConfig(syncUsers, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java index ff76dcfdb..81075f195 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum.java @@ -29,13 +29,13 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum @@ -43,7 +43,7 @@ public boolean equals(Object other) { ((SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java index 9993d7080..dff7baef3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketIdpInitiatedOptions.java @@ -72,7 +72,7 @@ public Optional getClientAuthorizequery() { return clientAuthorizequery; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketIdpInitiatedOptions @@ -91,12 +91,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketIdpInitiatedOptions other) { && clientAuthorizequery.equals(other.clientAuthorizequery); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.clientId, this.clientProtocol, this.clientAuthorizequery); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java index cfc89831d..158f23608 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningConfig.java @@ -74,7 +74,7 @@ private OptionalNullable _getTokenLifetime() { return tokenLifetime; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileSsoTicketProvisioningConfig @@ -92,12 +92,12 @@ private boolean equalTo(SelfServiceProfileSsoTicketProvisioningConfig other) { && tokenLifetime.equals(other.tokenLifetime); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.scopes, this.googleWorkspace, this.tokenLifetime); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java index dc9cfeaba..ec9fada64 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileSsoTicketProvisioningScopeEnum.java @@ -35,20 +35,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SelfServiceProfileSsoTicketProvisioningScopeEnum && this.string.equals(((SelfServiceProfileSsoTicketProvisioningScopeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java index 5e4f6f3a9..0228f1414 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/SelfServiceProfileUserAttribute.java @@ -59,7 +59,7 @@ public boolean getIsOptional() { return isOptional; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SelfServiceProfileUserAttribute && equalTo((SelfServiceProfileUserAttribute) other); @@ -74,12 +74,12 @@ private boolean equalTo(SelfServiceProfileUserAttribute other) { return name.equals(other.name) && description.equals(other.description) && isOptional == other.isOptional; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.description, this.isOptional); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -128,7 +128,7 @@ public static final class Builder implements NameStage, DescriptionStage, IsOpti private Builder() {} - @Override + @java.lang.Override public Builder from(SelfServiceProfileUserAttribute other) { name(other.getName()); description(other.getDescription()); @@ -141,7 +141,7 @@ public Builder from(SelfServiceProfileUserAttribute other) { *

Identifier of this attribute.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public DescriptionStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -153,7 +153,7 @@ public DescriptionStage name(@NotNull String name) { *

Description of this attribute.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("description") public IsOptionalStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -165,14 +165,14 @@ public IsOptionalStage description(@NotNull String description) { *

Determines if this attribute is required

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("is_optional") public _FinalStage isOptional(boolean isOptional) { this.isOptional = isOptional; return this; } - @Override + @java.lang.Override public SelfServiceProfileUserAttribute build() { return new SelfServiceProfileUserAttribute(name, description, isOptional, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java index d9bdb3a22..6424915ef 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignal.java @@ -60,7 +60,7 @@ public Optional getType() { return type; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionAuthenticationSignal && equalTo((SessionAuthenticationSignal) other); @@ -75,12 +75,12 @@ private boolean equalTo(SessionAuthenticationSignal other) { return name.equals(other.name) && timestamp.equals(other.timestamp) && type.equals(other.type); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.timestamp, this.type); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java index d3ee73821..d12ab5d88 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionAuthenticationSignals.java @@ -39,7 +39,7 @@ public Optional> getMethods() { return methods; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionAuthenticationSignals && equalTo((SessionAuthenticationSignals) other); @@ -54,12 +54,12 @@ private boolean equalTo(SessionAuthenticationSignals other) { return methods.equals(other.methods); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.methods); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java index b897c7cb0..1d841f73b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionClientMetadata.java @@ -37,7 +37,7 @@ public Optional getClientId() { return clientId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionClientMetadata && equalTo((SessionClientMetadata) other); @@ -52,12 +52,12 @@ private boolean equalTo(SessionClientMetadata other) { return clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java index 9ae07fca1..459ef0888 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadata.java @@ -35,7 +35,7 @@ public Optional getMode() { return mode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionCookieMetadata && equalTo((SessionCookieMetadata) other); @@ -50,12 +50,12 @@ private boolean equalTo(SessionCookieMetadata other) { return mode.equals(other.mode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java index c352592f0..c082d2237 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieMetadataModeEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SessionCookieMetadataModeEnum && this.string.equals(((SessionCookieMetadataModeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java index 9ca301cb0..56933f15e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieModeEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SessionCookieModeEnum && this.string.equals(((SessionCookieModeEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java index f8824a3f8..68e8bd009 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionCookieSchema.java @@ -33,7 +33,7 @@ public SessionCookieModeEnum getMode() { return mode; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionCookieSchema && equalTo((SessionCookieSchema) other); @@ -48,12 +48,12 @@ private boolean equalTo(SessionCookieSchema other) { return mode.equals(other.mode); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ModeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SessionCookieSchema other) { mode(other.getMode()); return this; } - @Override + @java.lang.Override @JsonSetter("mode") public _FinalStage mode(@NotNull SessionCookieModeEnum mode) { this.mode = Objects.requireNonNull(mode, "mode must not be null"); return this; } - @Override + @java.lang.Override public SessionCookieSchema build() { return new SessionCookieSchema(mode, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDate.java b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java index 2e1674a45..0c78619bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDate.java @@ -42,7 +42,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionDate && equalTo((SessionDate) other); @@ -52,12 +52,12 @@ private boolean equalTo(SessionDate other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -81,7 +81,7 @@ static final class Deserializer extends StdDeserializer { super(SessionDate.class); } - @Override + @java.lang.Override public SessionDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java index 7bbee2239..1da1dccac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionDeviceMetadata.java @@ -116,7 +116,7 @@ private OptionalNullable _getLastIp() { return lastIp; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionDeviceMetadata && equalTo((SessionDeviceMetadata) other); @@ -136,13 +136,13 @@ private boolean equalTo(SessionDeviceMetadata other) { && lastAsn.equals(other.lastAsn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.initialUserAgent, this.initialIp, this.initialAsn, this.lastUserAgent, this.lastIp, this.lastAsn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java index 91d0d1231..d9d9ddc12 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SessionResponseContent.java @@ -167,7 +167,7 @@ private OptionalNullable> _getSessionMetadata() { return sessionMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SessionResponseContent && equalTo((SessionResponseContent) other); @@ -194,7 +194,7 @@ private boolean equalTo(SessionResponseContent other) { && sessionMetadata.equals(other.sessionMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -212,7 +212,7 @@ public int hashCode() { this.sessionMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java index a54a4bc20..41989a253 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetCustomSigningKeysResponseContent.java @@ -39,7 +39,7 @@ public Optional> getKeys() { return keys; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetCustomSigningKeysResponseContent @@ -55,12 +55,12 @@ private boolean equalTo(SetCustomSigningKeysResponseContent other) { return keys.equals(other.keys); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.keys); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java index 12f86648b..6932d5194 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateRequestContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetEmailTemplateRequestContent && equalTo((SetEmailTemplateRequestContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(SetEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetEmailTemplateRequestContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(SetEmailTemplateRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @Override + @java.lang.Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @Override + @java.lang.Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @Override + @java.lang.Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @Override + @java.lang.Override public SetEmailTemplateRequestContent build() { return new SetEmailTemplateRequestContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java index 6ddb1dd40..12b45012d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailTemplateResponseContent.java @@ -206,7 +206,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetEmailTemplateResponseContent && equalTo((SetEmailTemplateResponseContent) other); @@ -229,7 +229,7 @@ private boolean equalTo(SetEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -371,7 +371,7 @@ public static final class Builder implements TemplateStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetEmailTemplateResponseContent other) { template(other.getTemplate()); body(other.getBody()); @@ -385,7 +385,7 @@ public Builder from(SetEmailTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("template") public _FinalStage template(@NotNull EmailTemplateNameEnum template) { this.template = Objects.requireNonNull(template, "template must not be null"); @@ -396,7 +396,7 @@ public _FinalStage template(@NotNull EmailTemplateNameEnum template) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) { if (enabled.isNull()) { this.enabled = OptionalNullable.ofNull(); @@ -412,7 +412,7 @@ public _FinalStage enabled(com.auth0.client.mgmt.core.Nullable enabled) *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Optional enabled) { if (enabled.isPresent()) { this.enabled = OptionalNullable.of(enabled.get()); @@ -426,7 +426,7 @@ public _FinalStage enabled(Optional enabled) { *

Whether the template is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enabled(Boolean enabled) { this.enabled = OptionalNullable.of(enabled); return this; @@ -435,7 +435,7 @@ public _FinalStage enabled(Boolean enabled) { /** *

Whether the template is enabled (true) or disabled (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public _FinalStage enabled(@Nullable OptionalNullable enabled) { this.enabled = enabled; @@ -446,7 +446,7 @@ public _FinalStage enabled(@Nullable OptionalNullable enabled) { *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -455,7 +455,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

*/ - @Override + @java.lang.Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -466,7 +466,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.Nullable urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isNull()) { this.urlLifetimeInSeconds = OptionalNullable.ofNull(); @@ -482,7 +482,7 @@ public _FinalStage urlLifetimeInSeconds(com.auth0.client.mgmt.core.NullableLifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { if (urlLifetimeInSeconds.isPresent()) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds.get()); @@ -496,7 +496,7 @@ public _FinalStage urlLifetimeInSeconds(Optional urlLifetimeInSeconds) { *

Lifetime in seconds that the link within the email will be valid for.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { this.urlLifetimeInSeconds = OptionalNullable.of(urlLifetimeInSeconds); return this; @@ -505,7 +505,7 @@ public _FinalStage urlLifetimeInSeconds(Double urlLifetimeInSeconds) { /** *

Lifetime in seconds that the link within the email will be valid for.

*/ - @Override + @java.lang.Override @JsonSetter(value = "urlLifetimeInSeconds", nulls = Nulls.SKIP) public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLifetimeInSeconds) { this.urlLifetimeInSeconds = urlLifetimeInSeconds; @@ -516,7 +516,7 @@ public _FinalStage urlLifetimeInSeconds(@Nullable OptionalNullable urlLi *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { if (syntax.isNull()) { this.syntax = OptionalNullable.ofNull(); @@ -532,7 +532,7 @@ public _FinalStage syntax(com.auth0.client.mgmt.core.Nullable syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(Optional syntax) { if (syntax.isPresent()) { this.syntax = OptionalNullable.of(syntax.get()); @@ -546,7 +546,7 @@ public _FinalStage syntax(Optional syntax) { *

Syntax of the template body.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage syntax(String syntax) { this.syntax = OptionalNullable.of(syntax); return this; @@ -555,7 +555,7 @@ public _FinalStage syntax(String syntax) { /** *

Syntax of the template body.

*/ - @Override + @java.lang.Override @JsonSetter(value = "syntax", nulls = Nulls.SKIP) public _FinalStage syntax(@Nullable OptionalNullable syntax) { this.syntax = syntax; @@ -566,7 +566,7 @@ public _FinalStage syntax(@Nullable OptionalNullable syntax) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) { if (subject.isNull()) { this.subject = OptionalNullable.ofNull(); @@ -582,7 +582,7 @@ public _FinalStage subject(com.auth0.client.mgmt.core.Nullable subject) *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(Optional subject) { if (subject.isPresent()) { this.subject = OptionalNullable.of(subject.get()); @@ -596,7 +596,7 @@ public _FinalStage subject(Optional subject) { *

Subject line of the email.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage subject(String subject) { this.subject = OptionalNullable.of(subject); return this; @@ -605,7 +605,7 @@ public _FinalStage subject(String subject) { /** *

Subject line of the email.

*/ - @Override + @java.lang.Override @JsonSetter(value = "subject", nulls = Nulls.SKIP) public _FinalStage subject(@Nullable OptionalNullable subject) { this.subject = subject; @@ -616,7 +616,7 @@ public _FinalStage subject(@Nullable OptionalNullable subject) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultUrl) { if (resultUrl.isNull()) { this.resultUrl = OptionalNullable.ofNull(); @@ -632,7 +632,7 @@ public _FinalStage resultUrl(com.auth0.client.mgmt.core.Nullable resultU *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(Optional resultUrl) { if (resultUrl.isPresent()) { this.resultUrl = OptionalNullable.of(resultUrl.get()); @@ -646,7 +646,7 @@ public _FinalStage resultUrl(Optional resultUrl) { *

URL to redirect the user to after a successful action.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = OptionalNullable.of(resultUrl); return this; @@ -655,7 +655,7 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL to redirect the user to after a successful action.

*/ - @Override + @java.lang.Override @JsonSetter(value = "resultUrl", nulls = Nulls.SKIP) public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { this.resultUrl = resultUrl; @@ -666,7 +666,7 @@ public _FinalStage resultUrl(@Nullable OptionalNullable resultUrl) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { if (from.isNull()) { this.from = OptionalNullable.ofNull(); @@ -682,7 +682,7 @@ public _FinalStage from(com.auth0.client.mgmt.core.Nullable from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(Optional from) { if (from.isPresent()) { this.from = OptionalNullable.of(from.get()); @@ -696,7 +696,7 @@ public _FinalStage from(Optional from) { *

Senders from email address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage from(String from) { this.from = OptionalNullable.of(from); return this; @@ -705,7 +705,7 @@ public _FinalStage from(String from) { /** *

Senders from email address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "from", nulls = Nulls.SKIP) public _FinalStage from(@Nullable OptionalNullable from) { this.from = from; @@ -716,7 +716,7 @@ public _FinalStage from(@Nullable OptionalNullable from) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { if (body.isNull()) { this.body = OptionalNullable.ofNull(); @@ -732,7 +732,7 @@ public _FinalStage body(com.auth0.client.mgmt.core.Nullable body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(Optional body) { if (body.isPresent()) { this.body = OptionalNullable.of(body.get()); @@ -746,7 +746,7 @@ public _FinalStage body(Optional body) { *

Body of the email template.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage body(String body) { this.body = OptionalNullable.of(body); return this; @@ -755,14 +755,14 @@ public _FinalStage body(String body) { /** *

Body of the email template.

*/ - @Override + @java.lang.Override @JsonSetter(value = "body", nulls = Nulls.SKIP) public _FinalStage body(@Nullable OptionalNullable body) { this.body = body; return this; } - @Override + @java.lang.Override public SetEmailTemplateResponseContent build() { return new SetEmailTemplateResponseContent( template, diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java index 78fce4b25..b0e6d7cfc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(SetGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java index 59e9b644c..1d1d7dba3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneMessageTypesResponseContent.java @@ -40,7 +40,7 @@ public Optional> getMessageTypes( return messageTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneMessageTypesResponseContent @@ -56,12 +56,12 @@ private boolean equalTo(SetGuardianFactorPhoneMessageTypesResponseContent other) return messageTypes.equals(other.messageTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.messageTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java index 4aedfa7d4..2fb065313 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorPhoneTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorPhoneTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorPhoneTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorPhoneTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorPhoneTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public SetGuardianFactorPhoneTemplatesResponseContent build() { return new SetGuardianFactorPhoneTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java index a0682267b..7cebe40d1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorResponseContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorResponseContent && equalTo((SetGuardianFactorResponseContent) other); @@ -50,12 +50,12 @@ private boolean equalTo(SetGuardianFactorResponseContent other) { return enabled == other.enabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -86,7 +86,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorResponseContent other) { enabled(other.getEnabled()); return this; @@ -97,14 +97,14 @@ public Builder from(SetGuardianFactorResponseContent other) { *

Whether this factor is enabled (true) or disabled (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public SetGuardianFactorResponseContent build() { return new SetGuardianFactorResponseContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java index ea47acf88..7f1280a48 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorSmsTemplatesResponseContent.java @@ -48,7 +48,7 @@ public String getVerificationMessage() { return verificationMessage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorSmsTemplatesResponseContent @@ -65,12 +65,12 @@ private boolean equalTo(SetGuardianFactorSmsTemplatesResponseContent other) { && verificationMessage.equals(other.verificationMessage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enrollmentMessage, this.verificationMessage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements EnrollmentMessageStage, Verificatio private Builder() {} - @Override + @java.lang.Override public Builder from(SetGuardianFactorSmsTemplatesResponseContent other) { enrollmentMessage(other.getEnrollmentMessage()); verificationMessage(other.getVerificationMessage()); @@ -122,7 +122,7 @@ public Builder from(SetGuardianFactorSmsTemplatesResponseContent other) { *

Message sent to the user when they are invited to enroll with a phone number.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enrollment_message") public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMessage) { this.enrollmentMessage = Objects.requireNonNull(enrollmentMessage, "enrollmentMessage must not be null"); @@ -134,7 +134,7 @@ public VerificationMessageStage enrollmentMessage(@NotNull String enrollmentMess *

Message sent to the user when they are prompted to verify their account.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_message") public _FinalStage verificationMessage(@NotNull String verificationMessage) { this.verificationMessage = @@ -142,7 +142,7 @@ public _FinalStage verificationMessage(@NotNull String verificationMessage) { return this; } - @Override + @java.lang.Override public SetGuardianFactorSmsTemplatesResponseContent build() { return new SetGuardianFactorSmsTemplatesResponseContent( enrollmentMessage, verificationMessage, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java index 71322d041..c7ca94056 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneResponseContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java index c4fc02430..3e0e6cfa8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPhoneTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPhoneTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderPhoneTwilioResponseContent oth && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java index 50c4587fb..307f15ec1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationApnsResponseContent.java @@ -56,7 +56,7 @@ private OptionalNullable _getBundleId() { return bundleId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationApnsResponseContent @@ -72,12 +72,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationApnsResponseCo return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sandbox, this.bundleId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java index ed6a395a6..c7713b530 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationResponseContent.java @@ -36,7 +36,7 @@ public Optional getProv return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationResponseConten return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java index d1c0c9c0e..0e2aff519 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderPushNotificationSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(SetGuardianFactorsProviderPushNotificationSnsResponseCon && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java index d28fa6eb0..712e9c554 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsResponseContent.java @@ -35,7 +35,7 @@ public Optional getProvider() { return provider; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsResponseContent other) { return provider.equals(other.provider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java index 3bd955c55..53076ea2e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianFactorsProviderSmsTwilioResponseContent.java @@ -118,7 +118,7 @@ private OptionalNullable _getSid() { return sid; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetGuardianFactorsProviderSmsTwilioResponseContent @@ -137,12 +137,12 @@ private boolean equalTo(SetGuardianFactorsProviderSmsTwilioResponseContent other && sid.equals(other.sid); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.messagingServiceSid, this.authToken, this.sid); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java index ba289d5fb..63eb55efd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclRequestContent.java @@ -68,7 +68,7 @@ public NetworkAclRule getRule() { return rule; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetNetworkAclRequestContent && equalTo((SetNetworkAclRequestContent) other); @@ -86,12 +86,12 @@ private boolean equalTo(SetNetworkAclRequestContent other) { && rule.equals(other.rule); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -143,7 +143,7 @@ public static final class Builder implements DescriptionStage, ActiveStage, Prio private Builder() {} - @Override + @java.lang.Override public Builder from(SetNetworkAclRequestContent other) { description(other.getDescription()); active(other.getActive()); @@ -152,7 +152,7 @@ public Builder from(SetNetworkAclRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("description") public ActiveStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -164,7 +164,7 @@ public ActiveStage description(@NotNull String description) { *

Indicates whether or not this access control list is actively being used

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("active") public PriorityStage active(boolean active) { this.active = active; @@ -176,21 +176,21 @@ public PriorityStage active(boolean active) { *

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("priority") public RuleStage priority(double priority) { this.priority = priority; return this; } - @Override + @java.lang.Override @JsonSetter("rule") public _FinalStage rule(@NotNull NetworkAclRule rule) { this.rule = Objects.requireNonNull(rule, "rule must not be null"); return this; } - @Override + @java.lang.Override public SetNetworkAclRequestContent build() { return new SetNetworkAclRequestContent(description, active, priority, rule, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java index b53409c4d..2f9b88e14 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetNetworkAclsResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetNetworkAclsResponseContent && equalTo((SetNetworkAclsResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(SetNetworkAclsResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java index b5ead757b..fe5071d0f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigRequestContent.java @@ -36,7 +36,7 @@ public String getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetRulesConfigRequestContent && equalTo((SetRulesConfigRequestContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(SetRulesConfigRequestContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements ValueStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetRulesConfigRequestContent other) { value(other.getValue()); return this; @@ -98,14 +98,14 @@ public Builder from(SetRulesConfigRequestContent other) { *

Value for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override public SetRulesConfigRequestContent build() { return new SetRulesConfigRequestContent(value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java index 6e78107da..26d5058ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetRulesConfigResponseContent.java @@ -47,7 +47,7 @@ public String getValue() { return value; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetRulesConfigResponseContent && equalTo((SetRulesConfigResponseContent) other); @@ -62,12 +62,12 @@ private boolean equalTo(SetRulesConfigResponseContent other) { return key.equals(other.key) && value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.key, this.value); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -107,7 +107,7 @@ public static final class Builder implements KeyStage, ValueStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetRulesConfigResponseContent other) { key(other.getKey()); value(other.getValue()); @@ -119,7 +119,7 @@ public Builder from(SetRulesConfigResponseContent other) { *

Key for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("key") public ValueStage key(@NotNull String key) { this.key = Objects.requireNonNull(key, "key must not be null"); @@ -131,14 +131,14 @@ public ValueStage key(@NotNull String key) { *

Value for a rules config variable.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("value") public _FinalStage value(@NotNull String value) { this.value = Objects.requireNonNull(value, "value must not be null"); return this; } - @Override + @java.lang.Override public SetRulesConfigResponseContent build() { return new SetRulesConfigResponseContent(key, value, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java index a3d0fec7e..119d70fa8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethodResponseContent.java @@ -177,7 +177,7 @@ public Optional getCreatedAt() { return createdAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetUserAuthenticationMethodResponseContent @@ -205,7 +205,7 @@ private boolean equalTo(SetUserAuthenticationMethodResponseContent other) { && createdAt.equals(other.createdAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -223,7 +223,7 @@ public int hashCode() { this.createdAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -354,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -372,7 +372,7 @@ public Builder from(SetUserAuthenticationMethodResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -383,7 +383,7 @@ public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -392,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -403,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authenticators only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -412,7 +412,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authenticators only. The relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -423,7 +423,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage aaguid(String aaguid) { this.aaguid = Optional.ofNullable(aaguid); return this; @@ -432,7 +432,7 @@ public _FinalStage aaguid(String aaguid) { /** *

Applies to passkeys only. Authenticator Attestation Globally Unique Identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) public _FinalStage aaguid(Optional aaguid) { this.aaguid = aaguid; @@ -443,7 +443,7 @@ public _FinalStage aaguid(Optional aaguid) { *

Applies to webauthn authenticators only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -452,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authenticators only. The public key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -463,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authenticators only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -472,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authenticators only. The id of the credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -494,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -512,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -521,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -532,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -541,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -552,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -561,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @Override + @java.lang.Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -572,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -581,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -592,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -601,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public SetUserAuthenticationMethodResponseContent build() { return new SetUserAuthenticationMethodResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java index 8e2f97ead..a070ffc99 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java +++ b/src/main/java/com/auth0/client/mgmt/types/SetUserAuthenticationMethods.java @@ -94,7 +94,7 @@ public Optional getTotpSecret() { return totpSecret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SetUserAuthenticationMethods && equalTo((SetUserAuthenticationMethods) other); @@ -114,7 +114,7 @@ private boolean equalTo(SetUserAuthenticationMethods other) { && totpSecret.equals(other.totpSecret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.type, @@ -125,7 +125,7 @@ public int hashCode() { this.totpSecret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -196,7 +196,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SetUserAuthenticationMethods other) { type(other.getType()); preferredAuthenticationMethod(other.getPreferredAuthenticationMethod()); @@ -207,7 +207,7 @@ public Builder from(SetUserAuthenticationMethods other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull AuthenticationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -218,7 +218,7 @@ public _FinalStage type(@NotNull AuthenticationTypeEnum type) { *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -227,7 +227,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Applies to totp authentication methods only. The base32 encoded secret for TOTP generation.

*/ - @Override + @java.lang.Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -238,7 +238,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -247,7 +247,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -258,7 +258,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -267,7 +267,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -278,7 +278,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

AA human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -287,21 +287,21 @@ public _FinalStage name(String name) { /** *

AA human-readable label to identify the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -309,7 +309,7 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public SetUserAuthenticationMethods build() { return new SetUserAuthenticationMethods( type, preferredAuthenticationMethod, name, phoneNumber, email, totpSecret, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java index 816688d5f..4b9b95a98 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningAlgorithmEnum.java @@ -28,19 +28,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SigningAlgorithmEnum && this.string.equals(((SigningAlgorithmEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java index b509ceed8..657e7445a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeys.java @@ -163,7 +163,7 @@ public Optional getRevokedAt() { return revokedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SigningKeys && equalTo((SigningKeys) other); @@ -189,7 +189,7 @@ private boolean equalTo(SigningKeys other) { && revokedAt.equals(other.revokedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.kid, @@ -206,7 +206,7 @@ public int hashCode() { this.revokedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -327,7 +327,7 @@ public static final class Builder implements KidStage, CertStage, FingerprintSta private Builder() {} - @Override + @java.lang.Override public Builder from(SigningKeys other) { kid(other.getKid()); cert(other.getCert()); @@ -349,7 +349,7 @@ public Builder from(SigningKeys other) { *

The key id of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("kid") public CertStage kid(@NotNull String kid) { this.kid = Objects.requireNonNull(kid, "kid must not be null"); @@ -361,7 +361,7 @@ public CertStage kid(@NotNull String kid) { *

The public certificate of the signing key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("cert") public FingerprintStage cert(@NotNull String cert) { this.cert = Objects.requireNonNull(cert, "cert must not be null"); @@ -373,7 +373,7 @@ public FingerprintStage cert(@NotNull String cert) { *

The cert fingerprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("fingerprint") public ThumbprintStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -385,20 +385,20 @@ public ThumbprintStage fingerprint(@NotNull String fingerprint) { *

The cert thumbprint

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("thumbprint") public _FinalStage thumbprint(@NotNull String thumbprint) { this.thumbprint = Objects.requireNonNull(thumbprint, "thumbprint must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage revokedAt(SigningKeysDate revokedAt) { this.revokedAt = Optional.ofNullable(revokedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "revoked_at", nulls = Nulls.SKIP) public _FinalStage revokedAt(Optional revokedAt) { this.revokedAt = revokedAt; @@ -409,7 +409,7 @@ public _FinalStage revokedAt(Optional revokedAt) { *

True if the key is revoked

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage revoked(Boolean revoked) { this.revoked = Optional.ofNullable(revoked); return this; @@ -418,33 +418,33 @@ public _FinalStage revoked(Boolean revoked) { /** *

True if the key is revoked

*/ - @Override + @java.lang.Override @JsonSetter(value = "revoked", nulls = Nulls.SKIP) public _FinalStage revoked(Optional revoked) { this.revoked = revoked; return this; } - @Override + @java.lang.Override public _FinalStage currentUntil(SigningKeysDate currentUntil) { this.currentUntil = Optional.ofNullable(currentUntil); return this; } - @Override + @java.lang.Override @JsonSetter(value = "current_until", nulls = Nulls.SKIP) public _FinalStage currentUntil(Optional currentUntil) { this.currentUntil = currentUntil; return this; } - @Override + @java.lang.Override public _FinalStage currentSince(SigningKeysDate currentSince) { this.currentSince = Optional.ofNullable(currentSince); return this; } - @Override + @java.lang.Override @JsonSetter(value = "current_since", nulls = Nulls.SKIP) public _FinalStage currentSince(Optional currentSince) { this.currentSince = currentSince; @@ -455,7 +455,7 @@ public _FinalStage currentSince(Optional currentSince) { *

True if the key is the the previous key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage previous(Boolean previous) { this.previous = Optional.ofNullable(previous); return this; @@ -464,7 +464,7 @@ public _FinalStage previous(Boolean previous) { /** *

True if the key is the the previous key

*/ - @Override + @java.lang.Override @JsonSetter(value = "previous", nulls = Nulls.SKIP) public _FinalStage previous(Optional previous) { this.previous = previous; @@ -475,7 +475,7 @@ public _FinalStage previous(Optional previous) { *

True if the key is the the next key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage next(Boolean next) { this.next = Optional.ofNullable(next); return this; @@ -484,7 +484,7 @@ public _FinalStage next(Boolean next) { /** *

True if the key is the the next key

*/ - @Override + @java.lang.Override @JsonSetter(value = "next", nulls = Nulls.SKIP) public _FinalStage next(Optional next) { this.next = next; @@ -495,7 +495,7 @@ public _FinalStage next(Optional next) { *

True if the key is the the current key

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage current(Boolean current) { this.current = Optional.ofNullable(current); return this; @@ -504,7 +504,7 @@ public _FinalStage current(Boolean current) { /** *

True if the key is the the current key

*/ - @Override + @java.lang.Override @JsonSetter(value = "current", nulls = Nulls.SKIP) public _FinalStage current(Optional current) { this.current = current; @@ -515,7 +515,7 @@ public _FinalStage current(Optional current) { *

The public certificate of the signing key in pkcs7 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage pkcs7(String pkcs7) { this.pkcs7 = Optional.ofNullable(pkcs7); return this; @@ -524,14 +524,14 @@ public _FinalStage pkcs7(String pkcs7) { /** *

The public certificate of the signing key in pkcs7 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "pkcs7", nulls = Nulls.SKIP) public _FinalStage pkcs7(Optional pkcs7) { this.pkcs7 = pkcs7; return this; } - @Override + @java.lang.Override public SigningKeys build() { return new SigningKeys( kid, diff --git a/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java index 8bef1fc2e..2e7dab279 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java +++ b/src/main/java/com/auth0/client/mgmt/types/SigningKeysDate.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SigningKeysDate && equalTo((SigningKeysDate) other); @@ -51,12 +51,12 @@ private boolean equalTo(SigningKeysDate other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(SigningKeysDate.class); } - @Override + @java.lang.Override public SigningKeysDate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java index e79406c1b..1046a9079 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupSchema.java @@ -34,7 +34,7 @@ public Optional getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupSchema && equalTo((SignupSchema) other); @@ -49,12 +49,12 @@ private boolean equalTo(SignupSchema other) { return status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java index 16b8ee9db..cb5d82bd1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupStatusEnum.java @@ -26,19 +26,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SignupStatusEnum && this.string.equals(((SignupStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java index ed894f534..8201e8d66 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerification.java @@ -34,7 +34,7 @@ public Optional getActive() { return active; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupVerification && equalTo((SignupVerification) other); @@ -49,12 +49,12 @@ private boolean equalTo(SignupVerification other) { return active.equals(other.active); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.active); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java index fae247f35..b4ea5c8be 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java +++ b/src/main/java/com/auth0/client/mgmt/types/SignupVerified.java @@ -45,7 +45,7 @@ public Optional getVerification() { return verification; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SignupVerified && equalTo((SignupVerified) other); @@ -60,12 +60,12 @@ private boolean equalTo(SignupVerified other) { return status.equals(other.status) && verification.equals(other.verification); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.status, this.verification); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java index b6977f587..506db0d55 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java +++ b/src/main/java/com/auth0/client/mgmt/types/SupportedLocales.java @@ -182,19 +182,19 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SupportedLocales && this.string.equals(((SupportedLocales) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java index 148037cad..bdadd4d67 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreLoginStage.java @@ -49,7 +49,7 @@ public Optional getRate() { return rate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingPreLoginStage @@ -65,12 +65,12 @@ private boolean equalTo(SuspiciousIpThrottlingPreLoginStage other) { return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.maxAttempts, this.rate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java index 2ae758162..255f2881b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingPreUserRegistrationStage.java @@ -49,7 +49,7 @@ public Optional getRate() { return rate; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingPreUserRegistrationStage @@ -65,12 +65,12 @@ private boolean equalTo(SuspiciousIpThrottlingPreUserRegistrationStage other) { return maxAttempts.equals(other.maxAttempts) && rate.equals(other.rate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.maxAttempts, this.rate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java index 10e36bfae..00f6b5ade 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingShieldsEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof SuspiciousIpThrottlingShieldsEnum && this.string.equals(((SuspiciousIpThrottlingShieldsEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java index 40875643a..9aeba1e60 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java +++ b/src/main/java/com/auth0/client/mgmt/types/SuspiciousIpThrottlingStage.java @@ -45,7 +45,7 @@ public Optional getPreUserRegist return preUserRegistration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SuspiciousIpThrottlingStage && equalTo((SuspiciousIpThrottlingStage) other); @@ -60,12 +60,12 @@ private boolean equalTo(SuspiciousIpThrottlingStage other) { return preLogin.equals(other.preLogin) && preUserRegistration.equals(other.preUserRegistration); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.preLogin, this.preUserRegistration); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java index edc674df7..5439ecd61 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantOidcLogoutSettings.java @@ -38,7 +38,7 @@ public Optional getRpLogoutEndSessionEndpointDiscovery() { return rpLogoutEndSessionEndpointDiscovery; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantOidcLogoutSettings && equalTo((TenantOidcLogoutSettings) other); @@ -53,12 +53,12 @@ private boolean equalTo(TenantOidcLogoutSettings other) { return rpLogoutEndSessionEndpointDiscovery.equals(other.rpLogoutEndSessionEndpointDiscovery); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.rpLogoutEndSessionEndpointDiscovery); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java index ef8520b0b..2aaf54480 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlow.java @@ -48,7 +48,7 @@ public Optional getMask() { return mask; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsDeviceFlow && equalTo((TenantSettingsDeviceFlow) other); @@ -63,12 +63,12 @@ private boolean equalTo(TenantSettingsDeviceFlow other) { return charset.equals(other.charset) && mask.equals(other.mask); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.charset, this.mask); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java index cf9752b21..deafec3a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsDeviceFlowCharset.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof TenantSettingsDeviceFlowCharset && this.string.equals(((TenantSettingsDeviceFlowCharset) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java index cde1353e6..906837dc1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsErrorPage.java @@ -63,7 +63,7 @@ public Optional getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsErrorPage && equalTo((TenantSettingsErrorPage) other); @@ -78,12 +78,12 @@ private boolean equalTo(TenantSettingsErrorPage other) { return html.equals(other.html) && showLogLink.equals(other.showLogLink) && url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.html, this.showLogLink, this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java index fb6e72db9..29fb8040c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsFlags.java @@ -375,7 +375,7 @@ public Optional getCustomDomainsProvisioning() { return customDomainsProvisioning; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsFlags && equalTo((TenantSettingsFlags) other); @@ -420,7 +420,7 @@ private boolean equalTo(TenantSettingsFlags other) { && customDomainsProvisioning.equals(other.customDomainsProvisioning); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.changePwdFlowV1, @@ -454,7 +454,7 @@ public int hashCode() { this.customDomainsProvisioning); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java index 949b2d4f1..7b6af4a8c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsGuardianPage.java @@ -49,7 +49,7 @@ public Optional getHtml() { return html; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsGuardianPage && equalTo((TenantSettingsGuardianPage) other); @@ -64,12 +64,12 @@ private boolean equalTo(TenantSettingsGuardianPage other) { return enabled.equals(other.enabled) && html.equals(other.html); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.html); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java index 49e023327..4fce8b382 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsMtls.java @@ -37,7 +37,7 @@ public Optional getEnableEndpointAliases() { return enableEndpointAliases; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsMtls && equalTo((TenantSettingsMtls) other); @@ -52,12 +52,12 @@ private boolean equalTo(TenantSettingsMtls other) { return enableEndpointAliases.equals(other.enableEndpointAliases); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enableEndpointAliases); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java index 02b7fdb8d..3d254ec4b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsPasswordPage.java @@ -49,7 +49,7 @@ public Optional getHtml() { return html; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsPasswordPage && equalTo((TenantSettingsPasswordPage) other); @@ -64,12 +64,12 @@ private boolean equalTo(TenantSettingsPasswordPage other) { return enabled.equals(other.enabled) && html.equals(other.html); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.html); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java index 522b5f701..302163e9f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsResourceParameterProfile.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof TenantSettingsResourceParameterProfile && this.string.equals(((TenantSettingsResourceParameterProfile) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java index b91aa8ae5..ae2da26d0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java @@ -38,7 +38,7 @@ public Optional getOidcLogoutPromptEnabled() { return oidcLogoutPromptEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TenantSettingsSessions && equalTo((TenantSettingsSessions) other); @@ -53,12 +53,12 @@ private boolean equalTo(TenantSettingsSessions other) { return oidcLogoutPromptEnabled.equals(other.oidcLogoutPromptEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.oidcLogoutPromptEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java index b56b51567..b6ffac639 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionRequestContent.java @@ -34,7 +34,7 @@ public Map getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestActionRequestContent && equalTo((TestActionRequestContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(TestActionRequestContent other) { return payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java index c81712679..d7f2a85a8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestActionResponseContent.java @@ -34,7 +34,7 @@ public Optional> getPayload() { return payload; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestActionResponseContent && equalTo((TestActionResponseContent) other); @@ -49,12 +49,12 @@ private boolean equalTo(TestActionResponseContent other) { return payload.equals(other.payload); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.payload); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java index 4df4af531..9393013df 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TestCustomDomainResponseContent.java @@ -49,7 +49,7 @@ public Optional getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TestCustomDomainResponseContent && equalTo((TestCustomDomainResponseContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(TestCustomDomainResponseContent other) { return success == other.success && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.success, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements SuccessStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(TestCustomDomainResponseContent other) { success(other.getSuccess()); message(other.getMessage()); @@ -121,7 +121,7 @@ public Builder from(TestCustomDomainResponseContent other) { *

Result of the operation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("success") public _FinalStage success(boolean success) { this.success = success; @@ -132,7 +132,7 @@ public _FinalStage success(boolean success) { *

Message describing the operation status.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage message(String message) { this.message = Optional.ofNullable(message); return this; @@ -141,14 +141,14 @@ public _FinalStage message(String message) { /** *

Message describing the operation status.

*/ - @Override + @java.lang.Override @JsonSetter(value = "message", nulls = Nulls.SKIP) public _FinalStage message(Optional message) { this.message = message; return this; } - @Override + @java.lang.Override public TestCustomDomainResponseContent build() { return new TestCustomDomainResponseContent(success, message, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java index acf594801..09dd38ab9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfileResponseContent.java @@ -109,7 +109,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenExchangeProfileResponseContent @@ -131,13 +131,13 @@ private boolean equalTo(TokenExchangeProfileResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.name, this.subjectTokenType, this.actionId, this.type, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java index 5925a043c..7d9471003 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenExchangeProfilesListRequest.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenExchangeProfilesListRequest && equalTo((TokenExchangeProfilesListRequest) other); @@ -78,12 +78,12 @@ private boolean equalTo(TokenExchangeProfilesListRequest other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java index 3d61f0be6..d7cf28e47 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuota && equalTo((TokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(TokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(TokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @Override + @java.lang.Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @Override + @java.lang.Override public TokenQuota build() { return new TokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java index c8685d2f9..920f2889b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaClientCredentials.java @@ -63,7 +63,7 @@ public Optional getPerHour() { return perHour; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuotaClientCredentials && equalTo((TokenQuotaClientCredentials) other); @@ -78,12 +78,12 @@ private boolean equalTo(TokenQuotaClientCredentials other) { return enforce.equals(other.enforce) && perDay.equals(other.perDay) && perHour.equals(other.perHour); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enforce, this.perDay, this.perHour); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java index b40f8de9a..d343e5b82 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/TokenQuotaConfiguration.java @@ -34,7 +34,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TokenQuotaConfiguration && equalTo((TokenQuotaConfiguration) other); @@ -49,12 +49,12 @@ private boolean equalTo(TokenQuotaConfiguration other) { return clientCredentials.equals(other.clientCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(TokenQuotaConfiguration other) { clientCredentials(other.getClientCredentials()); return this; } - @Override + @java.lang.Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @Override + @java.lang.Override public TokenQuotaConfiguration build() { return new TokenQuotaConfiguration(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java index 06533f643..8468c49e4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderConfiguration.java @@ -66,7 +66,7 @@ public List getDeliveryMethods() { return deliveryMethods; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TwilioProviderConfiguration && equalTo((TwilioProviderConfiguration) other); @@ -84,12 +84,12 @@ private boolean equalTo(TwilioProviderConfiguration other) { && deliveryMethods.equals(other.deliveryMethods); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.defaultFrom, this.mssid, this.sid, this.deliveryMethods); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -137,7 +137,7 @@ public static final class Builder implements SidStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(TwilioProviderConfiguration other) { defaultFrom(other.getDefaultFrom()); mssid(other.getMssid()); @@ -146,14 +146,14 @@ public Builder from(TwilioProviderConfiguration other) { return this; } - @Override + @java.lang.Override @JsonSetter("sid") public _FinalStage sid(@NotNull String sid) { this.sid = Objects.requireNonNull(sid, "sid must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage addAllDeliveryMethods(List deliveryMethods) { if (deliveryMethods != null) { this.deliveryMethods.addAll(deliveryMethods); @@ -161,13 +161,13 @@ public _FinalStage addAllDeliveryMethods(List return this; } - @Override + @java.lang.Override public _FinalStage addDeliveryMethods(TwilioProviderDeliveryMethodEnum deliveryMethods) { this.deliveryMethods.add(deliveryMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "delivery_methods", nulls = Nulls.SKIP) public _FinalStage deliveryMethods(List deliveryMethods) { this.deliveryMethods.clear(); @@ -177,33 +177,33 @@ public _FinalStage deliveryMethods(List delive return this; } - @Override + @java.lang.Override public _FinalStage mssid(String mssid) { this.mssid = Optional.ofNullable(mssid); return this; } - @Override + @java.lang.Override @JsonSetter(value = "mssid", nulls = Nulls.SKIP) public _FinalStage mssid(Optional mssid) { this.mssid = mssid; return this; } - @Override + @java.lang.Override public _FinalStage defaultFrom(String defaultFrom) { this.defaultFrom = Optional.ofNullable(defaultFrom); return this; } - @Override + @java.lang.Override @JsonSetter(value = "default_from", nulls = Nulls.SKIP) public _FinalStage defaultFrom(Optional defaultFrom) { this.defaultFrom = defaultFrom; return this; } - @Override + @java.lang.Override public TwilioProviderConfiguration build() { return new TwilioProviderConfiguration(defaultFrom, mssid, sid, deliveryMethods, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java index cc249a26e..195d73745 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderCredentials.java @@ -33,7 +33,7 @@ public String getAuthToken() { return authToken; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TwilioProviderCredentials && equalTo((TwilioProviderCredentials) other); @@ -48,12 +48,12 @@ private boolean equalTo(TwilioProviderCredentials other) { return authToken.equals(other.authToken); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.authToken); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements AuthTokenStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(TwilioProviderCredentials other) { authToken(other.getAuthToken()); return this; } - @Override + @java.lang.Override @JsonSetter("auth_token") public _FinalStage authToken(@NotNull String authToken) { this.authToken = Objects.requireNonNull(authToken, "authToken must not be null"); return this; } - @Override + @java.lang.Override public TwilioProviderCredentials build() { return new TwilioProviderCredentials(authToken, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java index 81e391983..dc8c8aae6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/TwilioProviderDeliveryMethodEnum.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof TwilioProviderDeliveryMethodEnum && this.string.equals(((TwilioProviderDeliveryMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java index 72f617e51..bd6f45f36 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UniversalLoginExperienceEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UniversalLoginExperienceEnum && this.string.equals(((UniversalLoginExperienceEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java index 6874ed0eb..d8d2c5e92 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionBindingsResponseContent.java @@ -36,7 +36,7 @@ public Optional> getBindings() { return bindings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionBindingsResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(UpdateActionBindingsResponseContent other) { return bindings.equals(other.bindings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.bindings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java index d0e163d10..204f78590 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionRequestContent.java @@ -33,6 +33,8 @@ public final class UpdateActionRequestContent { private final Optional> secrets; + private final Optional> modules; + private final Map additionalProperties; private UpdateActionRequestContent( @@ -42,6 +44,7 @@ private UpdateActionRequestContent( Optional> dependencies, Optional runtime, Optional> secrets, + Optional> modules, Map additionalProperties) { this.name = name; this.supportedTriggers = supportedTriggers; @@ -49,6 +52,7 @@ private UpdateActionRequestContent( this.dependencies = dependencies; this.runtime = runtime; this.secrets = secrets; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -100,7 +104,15 @@ public Optional> getSecrets() { return secrets; } - @Override + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionRequestContent && equalTo((UpdateActionRequestContent) other); @@ -117,16 +129,23 @@ private boolean equalTo(UpdateActionRequestContent other) { && code.equals(other.code) && dependencies.equals(other.dependencies) && runtime.equals(other.runtime) - && secrets.equals(other.secrets); + && secrets.equals(other.secrets) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( - this.name, this.supportedTriggers, this.code, this.dependencies, this.runtime, this.secrets); + this.name, + this.supportedTriggers, + this.code, + this.dependencies, + this.runtime, + this.secrets, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -149,6 +168,8 @@ public static final class Builder { private Optional> secrets = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -161,6 +182,7 @@ public Builder from(UpdateActionRequestContent other) { dependencies(other.getDependencies()); runtime(other.getRuntime()); secrets(other.getSecrets()); + modules(other.getModules()); return this; } @@ -248,9 +270,23 @@ public Builder secrets(List secrets) { return this; } + /** + *

The list of action modules and their versions used by this action.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public UpdateActionRequestContent build() { return new UpdateActionRequestContent( - name, supportedTriggers, code, dependencies, runtime, secrets, additionalProperties); + name, supportedTriggers, code, dependencies, runtime, secrets, modules, additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java index 281ed308a..cea3d6c3a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateActionResponseContent.java @@ -54,6 +54,8 @@ public final class UpdateActionResponseContent { private final Optional deploy; + private final Optional> modules; + private final Map additionalProperties; private UpdateActionResponseContent( @@ -73,6 +75,7 @@ private UpdateActionResponseContent( Optional status, Optional builtAt, Optional deploy, + Optional> modules, Map additionalProperties) { this.id = id; this.name = name; @@ -90,6 +93,7 @@ private UpdateActionResponseContent( this.status = status; this.builtAt = builtAt; this.deploy = deploy; + this.modules = modules; this.additionalProperties = additionalProperties; } @@ -212,7 +216,15 @@ public Optional getDeploy() { return deploy; } - @Override + /** + * @return The list of action modules and their versions used by this action. + */ + @JsonProperty("modules") + public Optional> getModules() { + return modules; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateActionResponseContent && equalTo((UpdateActionResponseContent) other); @@ -239,10 +251,11 @@ private boolean equalTo(UpdateActionResponseContent other) { && integration.equals(other.integration) && status.equals(other.status) && builtAt.equals(other.builtAt) - && deploy.equals(other.deploy); + && deploy.equals(other.deploy) + && modules.equals(other.modules); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -260,10 +273,11 @@ public int hashCode() { this.integration, this.status, this.builtAt, - this.deploy); + this.deploy, + this.modules); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -306,6 +320,8 @@ public static final class Builder { private Optional deploy = Optional.empty(); + private Optional> modules = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -328,6 +344,7 @@ public Builder from(UpdateActionResponseContent other) { status(other.getStatus()); builtAt(other.getBuiltAt()); deploy(other.getDeploy()); + modules(other.getModules()); return this; } @@ -546,6 +563,20 @@ public Builder deploy(Boolean deploy) { return this; } + /** + *

The list of action modules and their versions used by this action.

+ */ + @JsonSetter(value = "modules", nulls = Nulls.SKIP) + public Builder modules(Optional> modules) { + this.modules = modules; + return this; + } + + public Builder modules(List modules) { + this.modules = Optional.ofNullable(modules); + return this; + } + public UpdateActionResponseContent build() { return new UpdateActionResponseContent( id, @@ -564,6 +595,7 @@ public UpdateActionResponseContent build() { status, builtAt, deploy, + modules, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java index 729ee52fa..34347e20a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAculResponseContent.java @@ -127,7 +127,7 @@ private OptionalNullable _getFilters() { return filters; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAculResponseContent && equalTo((UpdateAculResponseContent) other); @@ -147,7 +147,7 @@ private boolean equalTo(UpdateAculResponseContent other) { && filters.equals(other.filters); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.renderingMode, @@ -158,7 +158,7 @@ public int hashCode() { this.filters); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java index a45c8d652..564d4a40e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAttackProtectionCaptchaResponseContent.java @@ -99,7 +99,7 @@ public Optional> getSimpleCaptcha() { return simpleCaptcha; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateAttackProtectionCaptchaResponseContent @@ -122,7 +122,7 @@ private boolean equalTo(UpdateAttackProtectionCaptchaResponseContent other) { && simpleCaptcha.equals(other.simpleCaptcha); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.activeProviderId, @@ -135,7 +135,7 @@ public int hashCode() { this.simpleCaptcha); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java index 2c1e71b3e..e1feae1af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBotDetectionSettingsResponseContent.java @@ -82,7 +82,7 @@ public Optional getMonitoringModeEnabled() { return monitoringModeEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBotDetectionSettingsResponseContent @@ -103,7 +103,7 @@ private boolean equalTo(UpdateBotDetectionSettingsResponseContent other) { && monitoringModeEnabled.equals(other.monitoringModeEnabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.botDetectionLevel, @@ -114,7 +114,7 @@ public int hashCode() { this.monitoringModeEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java index b6b2535cf..a17710ac0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingColors.java @@ -61,7 +61,7 @@ private OptionalNullable _getPrimary() { return primary; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingColors && equalTo((UpdateBrandingColors) other); @@ -76,12 +76,12 @@ private boolean equalTo(UpdateBrandingColors other) { return primary.equals(other.primary) && pageBackground.equals(other.pageBackground); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.primary, this.pageBackground); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java index 41872c844..1da496328 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingFont.java @@ -50,7 +50,7 @@ private OptionalNullable _getUrl() { return url; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingFont && equalTo((UpdateBrandingFont) other); @@ -65,12 +65,12 @@ private boolean equalTo(UpdateBrandingFont other) { return url.equals(other.url); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java index 5057d9e05..849ba5b81 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingPageBackground.java @@ -43,7 +43,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPageBackground && equalTo((UpdateBrandingPageBackground) other); @@ -53,12 +53,12 @@ private boolean equalTo(UpdateBrandingPageBackground other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -83,7 +83,7 @@ static final class Deserializer extends StdDeserializer getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingPhoneProviderResponseContent @@ -136,7 +136,7 @@ private boolean equalTo(UpdateBrandingPhoneProviderResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -149,7 +149,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -231,7 +231,7 @@ public static final class Builder implements NameStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateBrandingPhoneProviderResponseContent other) { id(other.getId()); tenant(other.getTenant()); @@ -244,7 +244,7 @@ public Builder from(UpdateBrandingPhoneProviderResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull PhoneProviderNameEnum name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -255,7 +255,7 @@ public _FinalStage name(@NotNull PhoneProviderNameEnum name) { *

The date and time of the last update to the provider in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.ofNullable(updatedAt); return this; @@ -264,7 +264,7 @@ public _FinalStage updatedAt(OffsetDateTime updatedAt) { /** *

The date and time of the last update to the provider in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; @@ -275,7 +275,7 @@ public _FinalStage updatedAt(Optional updatedAt) { *

The provider's creation date and time in ISO 8601 format

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -284,20 +284,20 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

The provider's creation date and time in ISO 8601 format

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public _FinalStage configuration(PhoneProviderConfiguration configuration) { this.configuration = Optional.ofNullable(configuration); return this; } - @Override + @java.lang.Override @JsonSetter(value = "configuration", nulls = Nulls.SKIP) public _FinalStage configuration(Optional configuration) { this.configuration = configuration; @@ -308,7 +308,7 @@ public _FinalStage configuration(Optional configurat *

Whether the provider is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage disabled(Boolean disabled) { this.disabled = Optional.ofNullable(disabled); return this; @@ -317,20 +317,20 @@ public _FinalStage disabled(Boolean disabled) { /** *

Whether the provider is enabled (false) or disabled (true).

*/ - @Override + @java.lang.Override @JsonSetter(value = "disabled", nulls = Nulls.SKIP) public _FinalStage disabled(Optional disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; @@ -341,7 +341,7 @@ public _FinalStage channel(Optional channel) { *

The name of the tenant

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; @@ -350,27 +350,27 @@ public _FinalStage tenant(String tenant) { /** *

The name of the tenant

*/ - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; } - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public UpdateBrandingPhoneProviderResponseContent build() { return new UpdateBrandingPhoneProviderResponseContent( id, tenant, name, channel, disabled, configuration, createdAt, updatedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java index 9f6be984b..ad7fd7d62 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingRequestContent.java @@ -112,7 +112,7 @@ private OptionalNullable _getFont() { return font; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingRequestContent && equalTo((UpdateBrandingRequestContent) other); @@ -130,12 +130,12 @@ private boolean equalTo(UpdateBrandingRequestContent other) { && font.equals(other.font); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java index c4796853f..f1a68fe24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingResponseContent.java @@ -69,7 +69,7 @@ public Optional getFont() { return font; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingResponseContent && equalTo((UpdateBrandingResponseContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(UpdateBrandingResponseContent other) { && font.equals(other.font); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.colors, this.faviconUrl, this.logoUrl, this.font); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java index cb7d39733..fe37d6c34 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBrandingThemeResponseContent.java @@ -95,7 +95,7 @@ public BrandingThemeWidget getWidget() { return widget; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBrandingThemeResponseContent @@ -117,7 +117,7 @@ private boolean equalTo(UpdateBrandingThemeResponseContent other) { && widget.equals(other.widget); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.borders, @@ -129,7 +129,7 @@ public int hashCode() { this.widget); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -207,7 +207,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateBrandingThemeResponseContent other) { borders(other.getBorders()); colors(other.getColors()); @@ -219,14 +219,14 @@ public Builder from(UpdateBrandingThemeResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("borders") public ColorsStage borders(@NotNull BrandingThemeBorders borders) { this.borders = Objects.requireNonNull(borders, "borders must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("colors") public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { this.colors = Objects.requireNonNull(colors, "colors must not be null"); @@ -238,21 +238,21 @@ public DisplayNameStage colors(@NotNull BrandingThemeColors colors) { *

Display Name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("displayName") public FontsStage displayName(@NotNull String displayName) { this.displayName = Objects.requireNonNull(displayName, "displayName must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fonts") public PageBackgroundStage fonts(@NotNull BrandingThemeFonts fonts) { this.fonts = Objects.requireNonNull(fonts, "fonts must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("page_background") public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBackground) { this.pageBackground = Objects.requireNonNull(pageBackground, "pageBackground must not be null"); @@ -264,21 +264,21 @@ public ThemeIdStage pageBackground(@NotNull BrandingThemePageBackground pageBack *

Theme Id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("themeId") public WidgetStage themeId(@NotNull String themeId) { this.themeId = Objects.requireNonNull(themeId, "themeId must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("widget") public _FinalStage widget(@NotNull BrandingThemeWidget widget) { this.widget = Objects.requireNonNull(widget, "widget must not be null"); return this; } - @Override + @java.lang.Override public UpdateBrandingThemeResponseContent build() { return new UpdateBrandingThemeResponseContent( borders, colors, displayName, fonts, pageBackground, themeId, widget, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java index 764139125..056a6b7d4 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBreachedPasswordDetectionSettingsResponseContent.java @@ -84,7 +84,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBreachedPasswordDetectionSettingsResponseContent @@ -104,12 +104,12 @@ private boolean equalTo(UpdateBreachedPasswordDetectionSettingsResponseContent o && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.adminNotificationFrequency, this.method, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java index d414938f5..f8277dcfb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContent.java @@ -90,7 +90,7 @@ public Optional getMaxAttempts() { return maxAttempts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateBruteForceSettingsResponseContent @@ -110,12 +110,12 @@ private boolean equalTo(UpdateBruteForceSettingsResponseContent other) { && maxAttempts.equals(other.maxAttempts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.mode, this.maxAttempts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java index 73d7ade5b..bc1c4f841 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentMode.java @@ -27,20 +27,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsResponseContentMode && this.string.equals(((UpdateBruteForceSettingsResponseContentMode) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java index cff18ef6c..3780c4514 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateBruteForceSettingsResponseContentShieldsItem.java @@ -26,20 +26,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UpdateBruteForceSettingsResponseContentShieldsItem && this.string.equals(((UpdateBruteForceSettingsResponseContentShieldsItem) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java index 4e3da5eed..e09742590 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantRequestContent.java @@ -96,7 +96,7 @@ private OptionalNullable _getAllowAnyOrganization() { return allowAnyOrganization; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientGrantRequestContent && equalTo((UpdateClientGrantRequestContent) other); @@ -114,13 +114,13 @@ private boolean equalTo(UpdateClientGrantRequestContent other) { && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.scope, this.organizationUsage, this.allowAnyOrganization, this.authorizationDetailsTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java index f52eba4f9..ecef2521b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientGrantResponseContent.java @@ -130,7 +130,7 @@ public Optional> getAuthorizationDetailsTypes() { return authorizationDetailsTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientGrantResponseContent && equalTo((UpdateClientGrantResponseContent) other); @@ -153,7 +153,7 @@ private boolean equalTo(UpdateClientGrantResponseContent other) { && authorizationDetailsTypes.equals(other.authorizationDetailsTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -167,7 +167,7 @@ public int hashCode() { this.authorizationDetailsTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java index 720edbd56..92128e56e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java @@ -714,7 +714,7 @@ private OptionalNullable _getExpressConfiguration() return expressConfiguration; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientRequestContent && equalTo((UpdateClientRequestContent) other); @@ -779,7 +779,7 @@ private boolean equalTo(UpdateClientRequestContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -834,7 +834,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java index 42b28add7..fc2fd8130 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java @@ -676,7 +676,7 @@ private OptionalNullable _getParRequestExpiry() { return parRequestExpiry; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateClientResponseContent && equalTo((UpdateClientResponseContent) other); @@ -744,7 +744,7 @@ private boolean equalTo(UpdateClientResponseContent other) { && asyncApprovalNotificationChannels.equals(other.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientId, @@ -802,7 +802,7 @@ public int hashCode() { this.asyncApprovalNotificationChannels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java index 616d25fc8..b59873673 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java @@ -410,7 +410,7 @@ private OptionalNullable _getFederat return federatedConnectionsAccessTokens; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionOptions && equalTo((UpdateConnectionOptions) other); @@ -452,7 +452,7 @@ private boolean equalTo(UpdateConnectionOptions other) { && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.validation, @@ -485,7 +485,7 @@ public int hashCode() { this.federatedConnectionsAccessTokens); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java index f9a2edb1a..3ff10a660 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileRequestContent.java @@ -82,7 +82,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionProfileRequestContent @@ -103,7 +103,7 @@ private boolean equalTo(UpdateConnectionProfileRequestContent other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -114,7 +114,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java index 6da268a75..0093ba01e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionProfileResponseContent.java @@ -91,7 +91,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionProfileResponseContent @@ -113,7 +113,7 @@ private boolean equalTo(UpdateConnectionProfileResponseContent other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -125,7 +125,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java index 21191ee8e..390990348 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContent.java @@ -137,7 +137,7 @@ private OptionalNullable _getOptions() { return options; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionRequestContent && equalTo((UpdateConnectionRequestContent) other); @@ -160,7 +160,7 @@ private boolean equalTo(UpdateConnectionRequestContent other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.displayName, @@ -174,7 +174,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java index e51f4f9da..e9c80cb2b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionResponseContent.java @@ -161,7 +161,7 @@ public Optional getConnectedAccounts() { return connectedAccounts; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateConnectionResponseContent && equalTo((UpdateConnectionResponseContent) other); @@ -187,7 +187,7 @@ private boolean equalTo(UpdateConnectionResponseContent other) { && connectedAccounts.equals(other.connectedAccounts); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -204,7 +204,7 @@ public int hashCode() { this.connectedAccounts); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java index 697877b4f..997485842 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainRequestContent.java @@ -58,7 +58,7 @@ public Optional>> getDomainMetadata() { return domainMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateCustomDomainRequestContent && equalTo((UpdateCustomDomainRequestContent) other); @@ -75,12 +75,12 @@ private boolean equalTo(UpdateCustomDomainRequestContent other) { && domainMetadata.equals(other.domainMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.tlsPolicy, this.customClientIpHeader, this.domainMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java index 08dfedeab..359368288 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateCustomDomainResponseContent.java @@ -146,7 +146,7 @@ private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateCustomDomainResponseContent && equalTo((UpdateCustomDomainResponseContent) other); @@ -170,7 +170,7 @@ private boolean equalTo(UpdateCustomDomainResponseContent other) { && certificate.equals(other.certificate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.customDomainId, @@ -185,7 +185,7 @@ public int hashCode() { this.certificate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -293,7 +293,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); @@ -313,7 +313,7 @@ public Builder from(UpdateCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -325,7 +325,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -337,54 +337,54 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public VerificationStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("verification") public _FinalStage verification(@NotNull DomainVerification verification) { this.verification = Objects.requireNonNull(verification, "verification must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage certificate(DomainCertificate certificate) { this.certificate = Optional.ofNullable(certificate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "certificate", nulls = Nulls.SKIP) public _FinalStage certificate(Optional certificate) { this.certificate = certificate; return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; @@ -395,7 +395,7 @@ public _FinalStage domainMetadata(Optional> *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -404,7 +404,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -415,7 +415,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -431,7 +431,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -445,7 +445,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -454,14 +454,14 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @Override + @java.lang.Override public UpdateCustomDomainResponseContent build() { return new UpdateCustomDomainResponseContent( customDomainId, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java index 233b4c810..cf1426c7e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java @@ -52,7 +52,7 @@ public Optional getSynchronizeAutomatically() { return synchronizeAutomatically; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateDirectoryProvisioningRequestContent @@ -68,12 +68,12 @@ private boolean equalTo(UpdateDirectoryProvisioningRequestContent other) { return mapping.equals(other.mapping) && synchronizeAutomatically.equals(other.synchronizeAutomatically); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mapping, this.synchronizeAutomatically); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java index ff8d62236..199f418fe 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java @@ -151,7 +151,7 @@ public Optional getLastSynchronizationError() { return lastSynchronizationError; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateDirectoryProvisioningResponseContent @@ -176,7 +176,7 @@ private boolean equalTo(UpdateDirectoryProvisioningResponseContent other) { && lastSynchronizationError.equals(other.lastSynchronizationError); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -191,7 +191,7 @@ public int hashCode() { this.lastSynchronizationError); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -312,7 +312,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateDirectoryProvisioningResponseContent other) { connectionId(other.getConnectionId()); connectionName(other.getConnectionName()); @@ -332,7 +332,7 @@ public Builder from(UpdateDirectoryProvisioningResponseContent other) { *

The connection's identifier

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_id") public ConnectionNameStage connectionId(@NotNull String connectionId) { this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); @@ -344,7 +344,7 @@ public ConnectionNameStage connectionId(@NotNull String connectionId) { *

The connection's name

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection_name") public StrategyStage connectionName(@NotNull String connectionName) { this.connectionName = Objects.requireNonNull(connectionName, "connectionName must not be null"); @@ -356,7 +356,7 @@ public StrategyStage connectionName(@NotNull String connectionName) { *

The connection's strategy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("strategy") public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); @@ -368,7 +368,7 @@ public SynchronizeAutomaticallyStage strategy(@NotNull String strategy) { *

Whether periodic automatic synchronization is enabled

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("synchronize_automatically") public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) { this.synchronizeAutomatically = synchronizeAutomatically; @@ -380,7 +380,7 @@ public CreatedAtStage synchronizeAutomatically(boolean synchronizeAutomatically) *

The timestamp at which the directory provisioning configuration was created

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -392,7 +392,7 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The timestamp at which the directory provisioning configuration was last updated

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); @@ -403,7 +403,7 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { *

The error message of the last synchronization, if any

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationError(String lastSynchronizationError) { this.lastSynchronizationError = Optional.ofNullable(lastSynchronizationError); return this; @@ -412,7 +412,7 @@ public _FinalStage lastSynchronizationError(String lastSynchronizationError) { /** *

The error message of the last synchronization, if any

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_error", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationError(Optional lastSynchronizationError) { this.lastSynchronizationError = lastSynchronizationError; @@ -423,7 +423,7 @@ public _FinalStage lastSynchronizationError(Optional lastSynchronization *

The status of the last synchronization

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { this.lastSynchronizationStatus = Optional.ofNullable(lastSynchronizationStatus); return this; @@ -432,7 +432,7 @@ public _FinalStage lastSynchronizationStatus(String lastSynchronizationStatus) { /** *

The status of the last synchronization

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_status", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationStatus(Optional lastSynchronizationStatus) { this.lastSynchronizationStatus = lastSynchronizationStatus; @@ -443,7 +443,7 @@ public _FinalStage lastSynchronizationStatus(Optional lastSynchronizatio *

The timestamp at which the connection was last synchronized

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { this.lastSynchronizationAt = Optional.ofNullable(lastSynchronizationAt); return this; @@ -452,7 +452,7 @@ public _FinalStage lastSynchronizationAt(OffsetDateTime lastSynchronizationAt) { /** *

The timestamp at which the connection was last synchronized

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_synchronization_at", nulls = Nulls.SKIP) public _FinalStage lastSynchronizationAt(Optional lastSynchronizationAt) { this.lastSynchronizationAt = lastSynchronizationAt; @@ -463,7 +463,7 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllMapping(List mapping) { if (mapping != null) { this.mapping.addAll(mapping); @@ -475,7 +475,7 @@ public _FinalStage addAllMapping(List mapping) *

The mapping between Auth0 and IDP user attributes

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { this.mapping.add(mapping); return this; @@ -484,7 +484,7 @@ public _FinalStage addMapping(DirectoryProvisioningMappingItem mapping) { /** *

The mapping between Auth0 and IDP user attributes

*/ - @Override + @java.lang.Override @JsonSetter(value = "mapping", nulls = Nulls.SKIP) public _FinalStage mapping(List mapping) { this.mapping.clear(); @@ -494,7 +494,7 @@ public _FinalStage mapping(List mapping) { return this; } - @Override + @java.lang.Override public UpdateDirectoryProvisioningResponseContent build() { return new UpdateDirectoryProvisioningResponseContent( connectionId, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java index 8799ea769..12a2255f0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailProviderResponseContent.java @@ -81,7 +81,7 @@ public Optional> getSettings() { return settings; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailProviderResponseContent @@ -101,12 +101,12 @@ private boolean equalTo(UpdateEmailProviderResponseContent other) { && settings.equals(other.settings); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.enabled, this.defaultFromAddress, this.credentials, this.settings); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java index 85025794a..24add727f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateRequestContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailTemplateRequestContent && equalTo((UpdateEmailTemplateRequestContent) other); @@ -228,7 +228,7 @@ private boolean equalTo(UpdateEmailTemplateRequestContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -242,7 +242,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java index 4036e6c4e..c7a2f72b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEmailTemplateResponseContent.java @@ -205,7 +205,7 @@ private OptionalNullable _getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEmailTemplateResponseContent @@ -229,7 +229,7 @@ private boolean equalTo(UpdateEmailTemplateResponseContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.template, @@ -243,7 +243,7 @@ public int hashCode() { this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java index 3583b1e4e..fb814e981 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEnabledClientConnectionsRequestContentItem.java @@ -48,7 +48,7 @@ public boolean getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEnabledClientConnectionsRequestContentItem @@ -64,12 +64,12 @@ private boolean equalTo(UpdateEnabledClientConnectionsRequestContentItem other) return clientId.equals(other.clientId) && status == other.status; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientId, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ClientIdStage, StatusStage, _FinalS private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateEnabledClientConnectionsRequestContentItem other) { clientId(other.getClientId()); status(other.getStatus()); @@ -121,7 +121,7 @@ public Builder from(UpdateEnabledClientConnectionsRequestContentItem other) { *

The client_id of the client to be the subject to change status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("client_id") public StatusStage clientId(@NotNull String clientId) { this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); @@ -133,14 +133,14 @@ public StatusStage clientId(@NotNull String clientId) { *

Whether the connection is enabled or not for this client_id

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("status") public _FinalStage status(boolean status) { this.status = status; return this; } - @Override + @java.lang.Override public UpdateEnabledClientConnectionsRequestContentItem build() { return new UpdateEnabledClientConnectionsRequestContentItem(clientId, status, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java index a8e176ddf..6f2a670cd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamRequestContent.java @@ -70,7 +70,7 @@ public Optional getStatus() { return status; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEventStreamRequestContent && equalTo((UpdateEventStreamRequestContent) other); @@ -88,12 +88,12 @@ private boolean equalTo(UpdateEventStreamRequestContent other) { && status.equals(other.status); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subscriptions, this.destination, this.status); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java index 0250b929c..b2dbd0284 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateEventStreamResponseContent.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateEventStreamResponseContent && equalTo((UpdateEventStreamResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(UpdateEventStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -86,7 +86,7 @@ static final class Deserializer extends StdDeserializer> getActions() { return actions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowRequestContent && equalTo((UpdateFlowRequestContent) other); @@ -59,12 +59,12 @@ private boolean equalTo(UpdateFlowRequestContent other) { return name.equals(other.name) && actions.equals(other.actions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.actions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java index b2df9d913..dd6e1cb24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowResponseContent.java @@ -84,7 +84,7 @@ public Optional getExecutedAt() { return executedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowResponseContent && equalTo((UpdateFlowResponseContent) other); @@ -104,12 +104,12 @@ private boolean equalTo(UpdateFlowResponseContent other) { && executedAt.equals(other.executedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.actions, this.createdAt, this.updatedAt, this.executedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -167,7 +167,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateFlowResponseContent other) { id(other.getId()); name(other.getName()); @@ -178,61 +178,61 @@ public Builder from(UpdateFlowResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage executedAt(String executedAt) { this.executedAt = Optional.ofNullable(executedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "executed_at", nulls = Nulls.SKIP) public _FinalStage executedAt(Optional executedAt) { this.executedAt = executedAt; return this; } - @Override + @java.lang.Override public _FinalStage actions(List actions) { this.actions = Optional.ofNullable(actions); return this; } - @Override + @java.lang.Override @JsonSetter(value = "actions", nulls = Nulls.SKIP) public _FinalStage actions(Optional> actions) { this.actions = actions; return this; } - @Override + @java.lang.Override public UpdateFlowResponseContent build() { return new UpdateFlowResponseContent( id, name, actions, createdAt, updatedAt, executedAt, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java index 291619823..3f7d1e2fb 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionResponseContent.java @@ -146,7 +146,7 @@ public String getFingerprint() { return fingerprint; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowsVaultConnectionResponseContent @@ -171,7 +171,7 @@ private boolean equalTo(UpdateFlowsVaultConnectionResponseContent other) { && fingerprint.equals(other.fingerprint); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -186,7 +186,7 @@ public int hashCode() { this.fingerprint); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -303,7 +303,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateFlowsVaultConnectionResponseContent other) { id(other.getId()); appId(other.getAppId()); @@ -323,7 +323,7 @@ public Builder from(UpdateFlowsVaultConnectionResponseContent other) { *

Flows Vault Connection identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public AppIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -335,7 +335,7 @@ public AppIdStage id(@NotNull String id) { *

Flows Vault Connection app identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("app_id") public NameStage appId(@NotNull String appId) { this.appId = Objects.requireNonNull(appId, "appId must not be null"); @@ -347,7 +347,7 @@ public NameStage appId(@NotNull String appId) { *

Flows Vault Connection name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("name") public ReadyStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); @@ -359,7 +359,7 @@ public ReadyStage name(@NotNull String name) { *

Whether the Flows Vault Connection is configured.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ready") public CreatedAtStage ready(boolean ready) { this.ready = ready; @@ -371,7 +371,7 @@ public CreatedAtStage ready(boolean ready) { *

The ISO 8601 formatted date when this Flows Vault Connection was created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -383,14 +383,14 @@ public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { *

The ISO 8601 formatted date when this Flows Vault Connection was updated.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("updated_at") public FingerprintStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("fingerprint") public _FinalStage fingerprint(@NotNull String fingerprint) { this.fingerprint = Objects.requireNonNull(fingerprint, "fingerprint must not be null"); @@ -401,7 +401,7 @@ public _FinalStage fingerprint(@NotNull String fingerprint) { *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { this.refreshedAt = Optional.ofNullable(refreshedAt); return this; @@ -410,7 +410,7 @@ public _FinalStage refreshedAt(OffsetDateTime refreshedAt) { /** *

The ISO 8601 formatted date when this Flows Vault Connection was refreshed.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refreshed_at", nulls = Nulls.SKIP) public _FinalStage refreshedAt(Optional refreshedAt) { this.refreshedAt = refreshedAt; @@ -421,7 +421,7 @@ public _FinalStage refreshedAt(Optional refreshedAt) { *

Flows Vault Connection custom account name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accountName(String accountName) { this.accountName = Optional.ofNullable(accountName); return this; @@ -430,7 +430,7 @@ public _FinalStage accountName(String accountName) { /** *

Flows Vault Connection custom account name.

*/ - @Override + @java.lang.Override @JsonSetter(value = "account_name", nulls = Nulls.SKIP) public _FinalStage accountName(Optional accountName) { this.accountName = accountName; @@ -441,7 +441,7 @@ public _FinalStage accountName(Optional accountName) { *

Flows Vault Connection environment.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage environment(String environment) { this.environment = Optional.ofNullable(environment); return this; @@ -450,14 +450,14 @@ public _FinalStage environment(String environment) { /** *

Flows Vault Connection environment.

*/ - @Override + @java.lang.Override @JsonSetter(value = "environment", nulls = Nulls.SKIP) public _FinalStage environment(Optional environment) { this.environment = environment; return this; } - @Override + @java.lang.Override public UpdateFlowsVaultConnectionResponseContent build() { return new UpdateFlowsVaultConnectionResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java index ee69839d5..103c0f027 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFlowsVaultConnectionSetup.java @@ -61,7 +61,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFlowsVaultConnectionSetup && equalTo((UpdateFlowsVaultConnectionSetup) other); @@ -71,12 +71,12 @@ private boolean equalTo(UpdateFlowsVaultConnectionSetup other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -166,7 +166,7 @@ static final class Deserializer extends StdDeserializer getStyle() { return style; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFormRequestContent && equalTo((UpdateFormRequestContent) other); @@ -132,7 +132,7 @@ private boolean equalTo(UpdateFormRequestContent other) { && style.equals(other.style); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -145,7 +145,7 @@ public int hashCode() { this.style); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java index 035801474..3be8732ad 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateFormResponseContent.java @@ -147,7 +147,7 @@ public Optional getSubmittedAt() { return submittedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateFormResponseContent && equalTo((UpdateFormResponseContent) other); @@ -174,7 +174,7 @@ private boolean equalTo(UpdateFormResponseContent other) { && submittedAt.equals(other.submittedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -192,7 +192,7 @@ public int hashCode() { this.submittedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -292,7 +292,7 @@ public static final class Builder implements IdStage, NameStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateFormResponseContent other) { id(other.getId()); name(other.getName()); @@ -310,152 +310,152 @@ public Builder from(UpdateFormResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("name") public CreatedAtStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage submittedAt(String submittedAt) { this.submittedAt = Optional.ofNullable(submittedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) public _FinalStage submittedAt(Optional submittedAt) { this.submittedAt = submittedAt; return this; } - @Override + @java.lang.Override public _FinalStage embeddedAt(String embeddedAt) { this.embeddedAt = Optional.ofNullable(embeddedAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "embedded_at", nulls = Nulls.SKIP) public _FinalStage embeddedAt(Optional embeddedAt) { this.embeddedAt = embeddedAt; return this; } - @Override + @java.lang.Override public _FinalStage style(FormStyle style) { this.style = Optional.ofNullable(style); return this; } - @Override + @java.lang.Override @JsonSetter(value = "style", nulls = Nulls.SKIP) public _FinalStage style(Optional style) { this.style = style; return this; } - @Override + @java.lang.Override public _FinalStage ending(FormEndingNode ending) { this.ending = Optional.ofNullable(ending); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ending", nulls = Nulls.SKIP) public _FinalStage ending(Optional ending) { this.ending = ending; return this; } - @Override + @java.lang.Override public _FinalStage start(FormStartNode start) { this.start = Optional.ofNullable(start); return this; } - @Override + @java.lang.Override @JsonSetter(value = "start", nulls = Nulls.SKIP) public _FinalStage start(Optional start) { this.start = start; return this; } - @Override + @java.lang.Override public _FinalStage nodes(List nodes) { this.nodes = Optional.ofNullable(nodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "nodes", nulls = Nulls.SKIP) public _FinalStage nodes(Optional> nodes) { this.nodes = nodes; return this; } - @Override + @java.lang.Override public _FinalStage translations(Map> translations) { this.translations = Optional.ofNullable(translations); return this; } - @Override + @java.lang.Override @JsonSetter(value = "translations", nulls = Nulls.SKIP) public _FinalStage translations(Optional>> translations) { this.translations = translations; return this; } - @Override + @java.lang.Override public _FinalStage languages(FormLanguages languages) { this.languages = Optional.ofNullable(languages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "languages", nulls = Nulls.SKIP) public _FinalStage languages(Optional languages) { this.languages = languages; return this; } - @Override + @java.lang.Override public _FinalStage messages(FormMessages messages) { this.messages = Optional.ofNullable(messages); return this; } - @Override + @java.lang.Override @JsonSetter(value = "messages", nulls = Nulls.SKIP) public _FinalStage messages(Optional messages) { this.messages = messages; return this; } - @Override + @java.lang.Override public UpdateFormResponseContent build() { return new UpdateFormResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java index cdaaa76fe..634e09d9d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorDuoSettingsResponseContent.java @@ -54,7 +54,7 @@ public Optional getHost() { return host; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorDuoSettingsResponseContent @@ -70,12 +70,12 @@ private boolean equalTo(UpdateGuardianFactorDuoSettingsResponseContent other) { return ikey.equals(other.ikey) && skey.equals(other.skey) && host.equals(other.host); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ikey, this.skey, this.host); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.java new file mode 100644 index 000000000..0776e5419 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.Builder.class) +public final class UpdateGuardianFactorsProviderPushNotificationApnsResponseContent { + private final Optional sandbox; + + private final OptionalNullable bundleId; + + private final Map additionalProperties; + + private UpdateGuardianFactorsProviderPushNotificationApnsResponseContent( + Optional sandbox, OptionalNullable bundleId, Map additionalProperties) { + this.sandbox = sandbox; + this.bundleId = bundleId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("sandbox") + public Optional getSandbox() { + return sandbox; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + public OptionalNullable getBundleId() { + if (bundleId == null) { + return OptionalNullable.absent(); + } + return bundleId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bundle_id") + private OptionalNullable _getBundleId() { + return bundleId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateGuardianFactorsProviderPushNotificationApnsResponseContent + && equalTo((UpdateGuardianFactorsProviderPushNotificationApnsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationApnsResponseContent other) { + return sandbox.equals(other.sandbox) && bundleId.equals(other.bundleId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.sandbox, this.bundleId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sandbox = Optional.empty(); + + private OptionalNullable bundleId = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateGuardianFactorsProviderPushNotificationApnsResponseContent other) { + sandbox(other.getSandbox()); + bundleId(other.getBundleId()); + return this; + } + + @JsonSetter(value = "sandbox", nulls = Nulls.SKIP) + public Builder sandbox(Optional sandbox) { + this.sandbox = sandbox; + return this; + } + + public Builder sandbox(Boolean sandbox) { + this.sandbox = Optional.ofNullable(sandbox); + return this; + } + + @JsonSetter(value = "bundle_id", nulls = Nulls.SKIP) + public Builder bundleId(@Nullable OptionalNullable bundleId) { + this.bundleId = bundleId; + return this; + } + + public Builder bundleId(String bundleId) { + this.bundleId = OptionalNullable.of(bundleId); + return this; + } + + public Builder bundleId(Optional bundleId) { + if (bundleId.isPresent()) { + this.bundleId = OptionalNullable.of(bundleId.get()); + } else { + this.bundleId = OptionalNullable.absent(); + } + return this; + } + + public Builder bundleId(com.auth0.client.mgmt.core.Nullable bundleId) { + if (bundleId.isNull()) { + this.bundleId = OptionalNullable.ofNull(); + } else if (bundleId.isEmpty()) { + this.bundleId = OptionalNullable.absent(); + } else { + this.bundleId = OptionalNullable.of(bundleId.get()); + } + return this; + } + + public UpdateGuardianFactorsProviderPushNotificationApnsResponseContent build() { + return new UpdateGuardianFactorsProviderPushNotificationApnsResponseContent( + sandbox, bundleId, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java index e4c8bb4ee..72a5d6a4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getSnsGcmPlatformApplicationArn() { return snsGcmPlatformApplicationArn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateGuardianFactorsProviderPushNotificationSnsResponseContent @@ -145,7 +145,7 @@ private boolean equalTo(UpdateGuardianFactorsProviderPushNotificationSnsResponse && snsGcmPlatformApplicationArn.equals(other.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.awsAccessKeyId, @@ -155,7 +155,7 @@ public int hashCode() { this.snsGcmPlatformApplicationArn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java index 13ed2114f..a670143d6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookRequestContent.java @@ -72,7 +72,7 @@ public Optional> getDependencies() { return dependencies; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateHookRequestContent && equalTo((UpdateHookRequestContent) other); @@ -90,12 +90,12 @@ private boolean equalTo(UpdateHookRequestContent other) { && dependencies.equals(other.dependencies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.script, this.enabled, this.dependencies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java index 102a88ef4..a76296cf0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateHookResponseContent.java @@ -96,7 +96,7 @@ public Optional> getDependencies() { return dependencies; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateHookResponseContent && equalTo((UpdateHookResponseContent) other); @@ -116,12 +116,12 @@ private boolean equalTo(UpdateHookResponseContent other) { && dependencies.equals(other.dependencies); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.triggerId, this.id, this.name, this.enabled, this.script, this.dependencies); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java index 8a701d791..f6ea3cb1c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamRequestContent.java @@ -91,7 +91,7 @@ public Optional getSink() { return sink; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateLogStreamRequestContent && equalTo((UpdateLogStreamRequestContent) other); @@ -111,12 +111,12 @@ private boolean equalTo(UpdateLogStreamRequestContent other) { && sink.equals(other.sink); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.status, this.isPriority, this.filters, this.piiConfig, this.sink); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java index 25d3534e2..7f02c46ce 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateLogStreamResponseContent.java @@ -51,7 +51,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateLogStreamResponseContent && equalTo((UpdateLogStreamResponseContent) other); @@ -61,12 +61,12 @@ private boolean equalTo(UpdateLogStreamResponseContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -126,7 +126,7 @@ static final class Deserializer extends StdDeserializer getRule() { return rule; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateNetworkAclRequestContent && equalTo((UpdateNetworkAclRequestContent) other); @@ -87,12 +87,12 @@ private boolean equalTo(UpdateNetworkAclRequestContent other) { && rule.equals(other.rule); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.description, this.active, this.priority, this.rule); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java index daf6e9bd9..9b15c8f06 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateNetworkAclResponseContent.java @@ -96,7 +96,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateNetworkAclResponseContent && equalTo((UpdateNetworkAclResponseContent) other); @@ -117,13 +117,13 @@ private boolean equalTo(UpdateNetworkAclResponseContent other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.description, this.active, this.priority, this.rule, this.createdAt, this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java index 51e8b8a1a..e4707f1de 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationConnectionResponseContent.java @@ -84,7 +84,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationConnectionResponseContent @@ -104,7 +104,7 @@ private boolean equalTo(UpdateOrganizationConnectionResponseContent other) { && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -114,7 +114,7 @@ public int hashCode() { this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java index d4f6b2148..4bc3c985b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationDiscoveryDomainResponseContent.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -25,6 +27,8 @@ public final class UpdateOrganizationDiscoveryDomainResponseContent { private final OrganizationDiscoveryDomainStatus status; + private final Optional useForOrganizationDiscovery; + private final String verificationTxt; private final String verificationHost; @@ -35,12 +39,14 @@ private UpdateOrganizationDiscoveryDomainResponseContent( String id, String domain, OrganizationDiscoveryDomainStatus status, + Optional useForOrganizationDiscovery, String verificationTxt, String verificationHost, Map additionalProperties) { this.id = id; this.domain = domain; this.status = status; + this.useForOrganizationDiscovery = useForOrganizationDiscovery; this.verificationTxt = verificationTxt; this.verificationHost = verificationHost; this.additionalProperties = additionalProperties; @@ -67,6 +73,14 @@ public OrganizationDiscoveryDomainStatus getStatus() { return status; } + /** + * @return Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant. + */ + @JsonProperty("use_for_organization_discovery") + public Optional getUseForOrganizationDiscovery() { + return useForOrganizationDiscovery; + } + /** * @return A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership. */ @@ -83,7 +97,7 @@ public String getVerificationHost() { return verificationHost; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationDiscoveryDomainResponseContent @@ -99,16 +113,23 @@ private boolean equalTo(UpdateOrganizationDiscoveryDomainResponseContent other) return id.equals(other.id) && domain.equals(other.domain) && status.equals(other.status) + && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) && verificationTxt.equals(other.verificationTxt) && verificationHost.equals(other.verificationHost); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.domain, this.status, this.verificationTxt, this.verificationHost); + return Objects.hash( + this.id, + this.domain, + this.status, + this.useForOrganizationDiscovery, + this.verificationTxt, + this.verificationHost); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -153,6 +174,13 @@ public interface VerificationHostStage { public interface _FinalStage { UpdateOrganizationDiscoveryDomainResponseContent build(); + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery); + + _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -168,16 +196,19 @@ public static final class Builder private String verificationHost; + private Optional useForOrganizationDiscovery = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateOrganizationDiscoveryDomainResponseContent other) { id(other.getId()); domain(other.getDomain()); status(other.getStatus()); + useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); verificationTxt(other.getVerificationTxt()); verificationHost(other.getVerificationHost()); return this; @@ -188,7 +219,7 @@ public Builder from(UpdateOrganizationDiscoveryDomainResponseContent other) { *

Organization discovery domain identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public DomainStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); @@ -200,14 +231,14 @@ public DomainStage id(@NotNull String id) { *

The domain name to associate with the organization e.g. acme.com.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public StatusStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("status") public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); @@ -219,7 +250,7 @@ public VerificationTxtStage status(@NotNull OrganizationDiscoveryDomainStatus st *

A unique token generated for the discovery domain. This must be placed in a DNS TXT record at the location specified by the verification_host field to prove domain ownership.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_txt") public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { this.verificationTxt = Objects.requireNonNull(verificationTxt, "verificationTxt must not be null"); @@ -231,17 +262,43 @@ public VerificationHostStage verificationTxt(@NotNull String verificationTxt) { *

The full domain where the TXT record should be added.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("verification_host") public _FinalStage verificationHost(@NotNull String verificationHost) { this.verificationHost = Objects.requireNonNull(verificationHost, "verificationHost must not be null"); return this; } - @Override + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useForOrganizationDiscovery(Boolean useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = Optional.ofNullable(useForOrganizationDiscovery); + return this; + } + + /** + *

Indicates whether this domain should be used for organization discovery. Note: This field is only returned when the ss_org_dove_enabled feature flag is enabled for the tenant.

+ */ + @java.lang.Override + @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) + public _FinalStage useForOrganizationDiscovery(Optional useForOrganizationDiscovery) { + this.useForOrganizationDiscovery = useForOrganizationDiscovery; + return this; + } + + @java.lang.Override public UpdateOrganizationDiscoveryDomainResponseContent build() { return new UpdateOrganizationDiscoveryDomainResponseContent( - id, domain, status, verificationTxt, verificationHost, additionalProperties); + id, + domain, + status, + useForOrganizationDiscovery, + verificationTxt, + verificationHost, + additionalProperties); } } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java index 0075a7d05..fa3df9eab 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationRequestContent.java @@ -91,7 +91,7 @@ private OptionalNullable _getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationRequestContent && equalTo((UpdateOrganizationRequestContent) other); @@ -110,12 +110,12 @@ private boolean equalTo(UpdateOrganizationRequestContent other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.displayName, this.name, this.branding, this.metadata, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java index c4c2d70ea..5603c8958 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationResponseContent.java @@ -91,7 +91,7 @@ public Optional getTokenQuota() { return tokenQuota; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateOrganizationResponseContent && equalTo((UpdateOrganizationResponseContent) other); @@ -111,12 +111,12 @@ private boolean equalTo(UpdateOrganizationResponseContent other) { && tokenQuota.equals(other.tokenQuota); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.displayName, this.branding, this.metadata, this.tokenQuota); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java index 27b150067..9ed20af9c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdatePhoneTemplateResponseContent.java @@ -94,7 +94,7 @@ public boolean getDisabled() { return disabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdatePhoneTemplateResponseContent @@ -116,13 +116,13 @@ private boolean equalTo(UpdatePhoneTemplateResponseContent other) { && disabled == other.disabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.channel, this.customizable, this.tenant, this.content, this.type, this.disabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -189,7 +189,7 @@ public static final class Builder implements IdStage, ContentStage, TypeStage, D private Builder() {} - @Override + @java.lang.Override public Builder from(UpdatePhoneTemplateResponseContent other) { id(other.getId()); channel(other.getChannel()); @@ -201,21 +201,21 @@ public Builder from(UpdatePhoneTemplateResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("id") public ContentStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("content") public TypeStage content(@NotNull PhoneTemplateContent content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -227,53 +227,53 @@ public DisabledStage type(@NotNull PhoneTemplateNotificationTypeEnum type) { *

Whether the template is enabled (false) or disabled (true).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("disabled") public _FinalStage disabled(boolean disabled) { this.disabled = disabled; return this; } - @Override + @java.lang.Override public _FinalStage tenant(String tenant) { this.tenant = Optional.ofNullable(tenant); return this; } - @Override + @java.lang.Override @JsonSetter(value = "tenant", nulls = Nulls.SKIP) public _FinalStage tenant(Optional tenant) { this.tenant = tenant; return this; } - @Override + @java.lang.Override public _FinalStage customizable(Boolean customizable) { this.customizable = Optional.ofNullable(customizable); return this; } - @Override + @java.lang.Override @JsonSetter(value = "customizable", nulls = Nulls.SKIP) public _FinalStage customizable(Optional customizable) { this.customizable = customizable; return this; } - @Override + @java.lang.Override public _FinalStage channel(String channel) { this.channel = Optional.ofNullable(channel); return this; } - @Override + @java.lang.Override @JsonSetter(value = "channel", nulls = Nulls.SKIP) public _FinalStage channel(Optional channel) { this.channel = channel; return this; } - @Override + @java.lang.Override public UpdatePhoneTemplateResponseContent build() { return new UpdatePhoneTemplateResponseContent( id, channel, customizable, tenant, content, type, disabled, additionalProperties); diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenRequestContent.java new file mode 100644 index 000000000..040321c49 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenRequestContent.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRefreshTokenRequestContent.Builder.class) +public final class UpdateRefreshTokenRequestContent { + private final OptionalNullable> refreshTokenMetadata; + + private final Map additionalProperties; + + private UpdateRefreshTokenRequestContent( + OptionalNullable> refreshTokenMetadata, Map additionalProperties) { + this.refreshTokenMetadata = refreshTokenMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + public OptionalNullable> getRefreshTokenMetadata() { + if (refreshTokenMetadata == null) { + return OptionalNullable.absent(); + } + return refreshTokenMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + private OptionalNullable> _getRefreshTokenMetadata() { + return refreshTokenMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRefreshTokenRequestContent && equalTo((UpdateRefreshTokenRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRefreshTokenRequestContent other) { + return refreshTokenMetadata.equals(other.refreshTokenMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.refreshTokenMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable> refreshTokenMetadata = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRefreshTokenRequestContent other) { + refreshTokenMetadata(other.getRefreshTokenMetadata()); + return this; + } + + @JsonSetter(value = "refresh_token_metadata", nulls = Nulls.SKIP) + public Builder refreshTokenMetadata(@Nullable OptionalNullable> refreshTokenMetadata) { + this.refreshTokenMetadata = refreshTokenMetadata; + return this; + } + + public Builder refreshTokenMetadata(Map refreshTokenMetadata) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata); + return this; + } + + public Builder refreshTokenMetadata(Optional> refreshTokenMetadata) { + if (refreshTokenMetadata.isPresent()) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } else { + this.refreshTokenMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshTokenMetadata( + com.auth0.client.mgmt.core.Nullable> refreshTokenMetadata) { + if (refreshTokenMetadata.isNull()) { + this.refreshTokenMetadata = OptionalNullable.ofNull(); + } else if (refreshTokenMetadata.isEmpty()) { + this.refreshTokenMetadata = OptionalNullable.absent(); + } else { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } + return this; + } + + public UpdateRefreshTokenRequestContent build() { + return new UpdateRefreshTokenRequestContent(refreshTokenMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenResponseContent.java new file mode 100644 index 000000000..b89eba526 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRefreshTokenResponseContent.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRefreshTokenResponseContent.Builder.class) +public final class UpdateRefreshTokenResponseContent { + private final Optional id; + + private final Optional userId; + + private final Optional createdAt; + + private final Optional idleExpiresAt; + + private final Optional expiresAt; + + private final Optional device; + + private final Optional clientId; + + private final OptionalNullable sessionId; + + private final Optional rotating; + + private final Optional> resourceServers; + + private final OptionalNullable> refreshTokenMetadata; + + private final Optional lastExchangedAt; + + private final Map additionalProperties; + + private UpdateRefreshTokenResponseContent( + Optional id, + Optional userId, + Optional createdAt, + Optional idleExpiresAt, + Optional expiresAt, + Optional device, + Optional clientId, + OptionalNullable sessionId, + Optional rotating, + Optional> resourceServers, + OptionalNullable> refreshTokenMetadata, + Optional lastExchangedAt, + Map additionalProperties) { + this.id = id; + this.userId = userId; + this.createdAt = createdAt; + this.idleExpiresAt = idleExpiresAt; + this.expiresAt = expiresAt; + this.device = device; + this.clientId = clientId; + this.sessionId = sessionId; + this.rotating = rotating; + this.resourceServers = resourceServers; + this.refreshTokenMetadata = refreshTokenMetadata; + this.lastExchangedAt = lastExchangedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the refresh token + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return ID of the user which can be used when interacting with other APIs. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("idle_expires_at") + public Optional getIdleExpiresAt() { + return idleExpiresAt; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @JsonProperty("device") + public Optional getDevice() { + return device; + } + + /** + * @return ID of the client application granted with this refresh token + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + public OptionalNullable getSessionId() { + if (sessionId == null) { + return OptionalNullable.absent(); + } + return sessionId; + } + + /** + * @return True if the token is a rotating refresh token + */ + @JsonProperty("rotating") + public Optional getRotating() { + return rotating; + } + + /** + * @return A list of the resource server IDs associated to this refresh-token and their granted scopes + */ + @JsonProperty("resource_servers") + public Optional> getResourceServers() { + return resourceServers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + public OptionalNullable> getRefreshTokenMetadata() { + if (refreshTokenMetadata == null) { + return OptionalNullable.absent(); + } + return refreshTokenMetadata; + } + + @JsonProperty("last_exchanged_at") + public Optional getLastExchangedAt() { + return lastExchangedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_id") + private OptionalNullable _getSessionId() { + return sessionId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("refresh_token_metadata") + private OptionalNullable> _getRefreshTokenMetadata() { + return refreshTokenMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRefreshTokenResponseContent && equalTo((UpdateRefreshTokenResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRefreshTokenResponseContent other) { + return id.equals(other.id) + && userId.equals(other.userId) + && createdAt.equals(other.createdAt) + && idleExpiresAt.equals(other.idleExpiresAt) + && expiresAt.equals(other.expiresAt) + && device.equals(other.device) + && clientId.equals(other.clientId) + && sessionId.equals(other.sessionId) + && rotating.equals(other.rotating) + && resourceServers.equals(other.resourceServers) + && refreshTokenMetadata.equals(other.refreshTokenMetadata) + && lastExchangedAt.equals(other.lastExchangedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userId, + this.createdAt, + this.idleExpiresAt, + this.expiresAt, + this.device, + this.clientId, + this.sessionId, + this.rotating, + this.resourceServers, + this.refreshTokenMetadata, + this.lastExchangedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional idleExpiresAt = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + private Optional device = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private OptionalNullable sessionId = OptionalNullable.absent(); + + private Optional rotating = Optional.empty(); + + private Optional> resourceServers = Optional.empty(); + + private OptionalNullable> refreshTokenMetadata = OptionalNullable.absent(); + + private Optional lastExchangedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateRefreshTokenResponseContent other) { + id(other.getId()); + userId(other.getUserId()); + createdAt(other.getCreatedAt()); + idleExpiresAt(other.getIdleExpiresAt()); + expiresAt(other.getExpiresAt()); + device(other.getDevice()); + clientId(other.getClientId()); + sessionId(other.getSessionId()); + rotating(other.getRotating()); + resourceServers(other.getResourceServers()); + refreshTokenMetadata(other.getRefreshTokenMetadata()); + lastExchangedAt(other.getLastExchangedAt()); + return this; + } + + /** + *

The ID of the refresh token

+ */ + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

ID of the user which can be used when interacting with other APIs.

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(RefreshTokenDate createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "idle_expires_at", nulls = Nulls.SKIP) + public Builder idleExpiresAt(Optional idleExpiresAt) { + this.idleExpiresAt = idleExpiresAt; + return this; + } + + public Builder idleExpiresAt(RefreshTokenDate idleExpiresAt) { + this.idleExpiresAt = Optional.ofNullable(idleExpiresAt); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(RefreshTokenDate expiresAt) { + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + @JsonSetter(value = "device", nulls = Nulls.SKIP) + public Builder device(Optional device) { + this.device = device; + return this; + } + + public Builder device(RefreshTokenDevice device) { + this.device = Optional.ofNullable(device); + return this; + } + + /** + *

ID of the client application granted with this refresh token

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + @JsonSetter(value = "session_id", nulls = Nulls.SKIP) + public Builder sessionId(@Nullable OptionalNullable sessionId) { + this.sessionId = sessionId; + return this; + } + + public Builder sessionId(String sessionId) { + this.sessionId = OptionalNullable.of(sessionId); + return this; + } + + public Builder sessionId(Optional sessionId) { + if (sessionId.isPresent()) { + this.sessionId = OptionalNullable.of(sessionId.get()); + } else { + this.sessionId = OptionalNullable.absent(); + } + return this; + } + + public Builder sessionId(com.auth0.client.mgmt.core.Nullable sessionId) { + if (sessionId.isNull()) { + this.sessionId = OptionalNullable.ofNull(); + } else if (sessionId.isEmpty()) { + this.sessionId = OptionalNullable.absent(); + } else { + this.sessionId = OptionalNullable.of(sessionId.get()); + } + return this; + } + + /** + *

True if the token is a rotating refresh token

+ */ + @JsonSetter(value = "rotating", nulls = Nulls.SKIP) + public Builder rotating(Optional rotating) { + this.rotating = rotating; + return this; + } + + public Builder rotating(Boolean rotating) { + this.rotating = Optional.ofNullable(rotating); + return this; + } + + /** + *

A list of the resource server IDs associated to this refresh-token and their granted scopes

+ */ + @JsonSetter(value = "resource_servers", nulls = Nulls.SKIP) + public Builder resourceServers(Optional> resourceServers) { + this.resourceServers = resourceServers; + return this; + } + + public Builder resourceServers(List resourceServers) { + this.resourceServers = Optional.ofNullable(resourceServers); + return this; + } + + @JsonSetter(value = "refresh_token_metadata", nulls = Nulls.SKIP) + public Builder refreshTokenMetadata(@Nullable OptionalNullable> refreshTokenMetadata) { + this.refreshTokenMetadata = refreshTokenMetadata; + return this; + } + + public Builder refreshTokenMetadata(Map refreshTokenMetadata) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata); + return this; + } + + public Builder refreshTokenMetadata(Optional> refreshTokenMetadata) { + if (refreshTokenMetadata.isPresent()) { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } else { + this.refreshTokenMetadata = OptionalNullable.absent(); + } + return this; + } + + public Builder refreshTokenMetadata( + com.auth0.client.mgmt.core.Nullable> refreshTokenMetadata) { + if (refreshTokenMetadata.isNull()) { + this.refreshTokenMetadata = OptionalNullable.ofNull(); + } else if (refreshTokenMetadata.isEmpty()) { + this.refreshTokenMetadata = OptionalNullable.absent(); + } else { + this.refreshTokenMetadata = OptionalNullable.of(refreshTokenMetadata.get()); + } + return this; + } + + @JsonSetter(value = "last_exchanged_at", nulls = Nulls.SKIP) + public Builder lastExchangedAt(Optional lastExchangedAt) { + this.lastExchangedAt = lastExchangedAt; + return this; + } + + public Builder lastExchangedAt(RefreshTokenDate lastExchangedAt) { + this.lastExchangedAt = Optional.ofNullable(lastExchangedAt); + return this; + } + + public UpdateRefreshTokenResponseContent build() { + return new UpdateRefreshTokenResponseContent( + id, + userId, + createdAt, + idleExpiresAt, + expiresAt, + device, + clientId, + sessionId, + rotating, + resourceServers, + refreshTokenMetadata, + lastExchangedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java index 8b6490566..b28305360 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java @@ -208,7 +208,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateResourceServerRequestContent @@ -237,7 +237,7 @@ private boolean equalTo(UpdateResourceServerRequestContent other) { && subjectTypeAuthorization.equals(other.subjectTypeAuthorization); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -256,7 +256,7 @@ public int hashCode() { this.subjectTypeAuthorization); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java index c00f5310a..44d80051b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java @@ -268,7 +268,7 @@ private OptionalNullable _getProofOfPossession( return proofOfPossession; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateResourceServerResponseContent @@ -302,7 +302,7 @@ private boolean equalTo(UpdateResourceServerResponseContent other) { && clientId.equals(other.clientId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -326,7 +326,7 @@ public int hashCode() { this.clientId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java index 35dacc902..7f9d9b68b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsNewDeviceResponseContent.java @@ -36,7 +36,7 @@ public int getRememberFor() { return rememberFor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRiskAssessmentsSettingsNewDeviceResponseContent @@ -52,12 +52,12 @@ private boolean equalTo(UpdateRiskAssessmentsSettingsNewDeviceResponseContent ot return rememberFor == other.rememberFor; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.rememberFor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -88,7 +88,7 @@ public static final class Builder implements RememberForStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateRiskAssessmentsSettingsNewDeviceResponseContent other) { rememberFor(other.getRememberFor()); return this; @@ -99,14 +99,14 @@ public Builder from(UpdateRiskAssessmentsSettingsNewDeviceResponseContent other) *

Length of time to remember devices for, in days.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("remember_for") public _FinalStage rememberFor(int rememberFor) { this.rememberFor = rememberFor; return this; } - @Override + @java.lang.Override public UpdateRiskAssessmentsSettingsNewDeviceResponseContent build() { return new UpdateRiskAssessmentsSettingsNewDeviceResponseContent(rememberFor, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java index 29e065376..74d0413f7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRiskAssessmentsSettingsResponseContent.java @@ -35,7 +35,7 @@ public boolean getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRiskAssessmentsSettingsResponseContent @@ -51,12 +51,12 @@ private boolean equalTo(UpdateRiskAssessmentsSettingsResponseContent other) { return enabled == other.enabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements EnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateRiskAssessmentsSettingsResponseContent other) { enabled(other.getEnabled()); return this; @@ -98,14 +98,14 @@ public Builder from(UpdateRiskAssessmentsSettingsResponseContent other) { *

Whether or not risk assessment is enabled.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("enabled") public _FinalStage enabled(boolean enabled) { this.enabled = enabled; return this; } - @Override + @java.lang.Override public UpdateRiskAssessmentsSettingsResponseContent build() { return new UpdateRiskAssessmentsSettingsResponseContent(enabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java index 5d1cd96ad..b2295388d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleRequestContent.java @@ -49,7 +49,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRoleRequestContent && equalTo((UpdateRoleRequestContent) other); @@ -64,12 +64,12 @@ private boolean equalTo(UpdateRoleRequestContent other) { return name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java index b63ab59da..030113ea9 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRoleResponseContent.java @@ -63,7 +63,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRoleResponseContent && equalTo((UpdateRoleResponseContent) other); @@ -78,12 +78,12 @@ private boolean equalTo(UpdateRoleResponseContent other) { return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.name, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java index bf910af29..a2ea28daf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleRequestContent.java @@ -75,7 +75,7 @@ public Optional getEnabled() { return enabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRuleRequestContent && equalTo((UpdateRuleRequestContent) other); @@ -93,12 +93,12 @@ private boolean equalTo(UpdateRuleRequestContent other) { && enabled.equals(other.enabled); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.script, this.name, this.order, this.enabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java index d02e8365e..3705f0238 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRuleResponseContent.java @@ -99,7 +99,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateRuleResponseContent && equalTo((UpdateRuleResponseContent) other); @@ -119,12 +119,12 @@ private boolean equalTo(UpdateRuleResponseContent other) { && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.id, this.enabled, this.script, this.order, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java index 04b6a6d0c..14fcbb308 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateScimConfigurationResponseContent.java @@ -124,7 +124,7 @@ public Optional getUpdatedOn() { return updatedOn; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateScimConfigurationResponseContent @@ -147,7 +147,7 @@ private boolean equalTo(UpdateScimConfigurationResponseContent other) { && updatedOn.equals(other.updatedOn); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectionId, @@ -160,7 +160,7 @@ public int hashCode() { this.updatedOn); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java index 756b500df..755f4e008 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileRequestContent.java @@ -125,7 +125,7 @@ private OptionalNullable _getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSelfServiceProfileRequestContent @@ -146,7 +146,7 @@ private boolean equalTo(UpdateSelfServiceProfileRequestContent other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -157,7 +157,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java index 53666d300..6253c4689 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSelfServiceProfileResponseContent.java @@ -134,7 +134,7 @@ public Optional getUserAttributeProfileId() { return userAttributeProfileId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSelfServiceProfileResponseContent @@ -158,7 +158,7 @@ private boolean equalTo(UpdateSelfServiceProfileResponseContent other) { && userAttributeProfileId.equals(other.userAttributeProfileId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -172,7 +172,7 @@ public int hashCode() { this.userAttributeProfileId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java index 77f59ef29..43009ff83 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionRequestContent.java @@ -48,7 +48,7 @@ private OptionalNullable> _getSessionMetadata() { return sessionMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSessionRequestContent && equalTo((UpdateSessionRequestContent) other); @@ -63,12 +63,12 @@ private boolean equalTo(UpdateSessionRequestContent other) { return sessionMetadata.equals(other.sessionMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.sessionMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java index 7f24a0cea..74e14d613 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSessionResponseContent.java @@ -167,7 +167,7 @@ private OptionalNullable> _getSessionMetadata() { return sessionMetadata; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSessionResponseContent && equalTo((UpdateSessionResponseContent) other); @@ -194,7 +194,7 @@ private boolean equalTo(UpdateSessionResponseContent other) { && sessionMetadata.equals(other.sessionMetadata); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -212,7 +212,7 @@ public int hashCode() { this.sessionMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java index c77ee8333..9dc1449b3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsRequestContent.java @@ -83,7 +83,7 @@ private OptionalNullable _getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSettingsRequestContent && equalTo((UpdateSettingsRequestContent) other); @@ -100,12 +100,12 @@ private boolean equalTo(UpdateSettingsRequestContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java index f493ab576..8acc2ed8e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSettingsResponseContent.java @@ -60,7 +60,7 @@ public Optional getWebauthnPlatformFirstFactor() { return webauthnPlatformFirstFactor; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSettingsResponseContent && equalTo((UpdateSettingsResponseContent) other); @@ -77,12 +77,12 @@ private boolean equalTo(UpdateSettingsResponseContent other) { && webauthnPlatformFirstFactor.equals(other.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.universalLoginExperience, this.identifierFirst, this.webauthnPlatformFirstFactor); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java index 698325104..a7502a8fc 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSupplementalSignalsRequestContent.java @@ -35,7 +35,7 @@ public boolean getAkamaiEnabled() { return akamaiEnabled; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSupplementalSignalsRequestContent @@ -51,12 +51,12 @@ private boolean equalTo(UpdateSupplementalSignalsRequestContent other) { return akamaiEnabled == other.akamaiEnabled; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.akamaiEnabled); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements AkamaiEnabledStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateSupplementalSignalsRequestContent other) { akamaiEnabled(other.getAkamaiEnabled()); return this; @@ -98,14 +98,14 @@ public Builder from(UpdateSupplementalSignalsRequestContent other) { *

Indicates if incoming Akamai Headers should be processed

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("akamai_enabled") public _FinalStage akamaiEnabled(boolean akamaiEnabled) { this.akamaiEnabled = akamaiEnabled; return this; } - @Override + @java.lang.Override public UpdateSupplementalSignalsRequestContent build() { return new UpdateSupplementalSignalsRequestContent(akamaiEnabled, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java index 51de9b2d7..115a9ef00 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateSuspiciousIpThrottlingSettingsResponseContent.java @@ -71,7 +71,7 @@ public Optional getStage() { return stage; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateSuspiciousIpThrottlingSettingsResponseContent @@ -90,12 +90,12 @@ private boolean equalTo(UpdateSuspiciousIpThrottlingSettingsResponseContent othe && stage.equals(other.stage); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.shields, this.allowlist, this.stage); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java index 5593230ab..f6211fc48 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTenantSettingsResponseContent.java @@ -90,6 +90,8 @@ public final class UpdateTenantSettingsResponseContent { private final Optional resourceParameterProfile; + private final Optional enableAiGuide; + private final Map additionalProperties; private UpdateTenantSettingsResponseContent( @@ -126,6 +128,7 @@ private UpdateTenantSettingsResponseContent( OptionalNullable authorizationResponseIssParameterSupported, OptionalNullable skipNonVerifiableCallbackUriConfirmationPrompt, Optional resourceParameterProfile, + Optional enableAiGuide, Map additionalProperties) { this.changePassword = changePassword; this.guardianMfaPage = guardianMfaPage; @@ -160,6 +163,7 @@ private UpdateTenantSettingsResponseContent( this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported; this.skipNonVerifiableCallbackUriConfirmationPrompt = skipNonVerifiableCallbackUriConfirmationPrompt; this.resourceParameterProfile = resourceParameterProfile; + this.enableAiGuide = enableAiGuide; this.additionalProperties = additionalProperties; } @@ -436,6 +440,14 @@ public Optional getResourceParameterProf return resourceParameterProfile; } + /** + * @return Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant. + */ + @JsonProperty("enable_ai_guide") + public Optional getEnableAiGuide() { + return enableAiGuide; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("change_password") private OptionalNullable _getChangePassword() { @@ -496,7 +508,7 @@ private OptionalNullable _getSkipNonVerifiableCallbackUriConfirmationPr return skipNonVerifiableCallbackUriConfirmationPrompt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTenantSettingsResponseContent @@ -542,10 +554,11 @@ private boolean equalTo(UpdateTenantSettingsResponseContent other) { && authorizationResponseIssParameterSupported.equals(other.authorizationResponseIssParameterSupported) && skipNonVerifiableCallbackUriConfirmationPrompt.equals( other.skipNonVerifiableCallbackUriConfirmationPrompt) - && resourceParameterProfile.equals(other.resourceParameterProfile); + && resourceParameterProfile.equals(other.resourceParameterProfile) + && enableAiGuide.equals(other.enableAiGuide); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.changePassword, @@ -580,10 +593,11 @@ public int hashCode() { this.pushedAuthorizationRequestsSupported, this.authorizationResponseIssParameterSupported, this.skipNonVerifiableCallbackUriConfirmationPrompt, - this.resourceParameterProfile); + this.resourceParameterProfile, + this.enableAiGuide); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -660,6 +674,8 @@ public static final class Builder { private Optional resourceParameterProfile = Optional.empty(); + private Optional enableAiGuide = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -699,6 +715,7 @@ public Builder from(UpdateTenantSettingsResponseContent other) { authorizationResponseIssParameterSupported(other.getAuthorizationResponseIssParameterSupported()); skipNonVerifiableCallbackUriConfirmationPrompt(other.getSkipNonVerifiableCallbackUriConfirmationPrompt()); resourceParameterProfile(other.getResourceParameterProfile()); + enableAiGuide(other.getEnableAiGuide()); return this; } @@ -1350,6 +1367,20 @@ public Builder resourceParameterProfile(TenantSettingsResourceParameterProfile r return this; } + /** + *

Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant.

+ */ + @JsonSetter(value = "enable_ai_guide", nulls = Nulls.SKIP) + public Builder enableAiGuide(Optional enableAiGuide) { + this.enableAiGuide = enableAiGuide; + return this; + } + + public Builder enableAiGuide(Boolean enableAiGuide) { + this.enableAiGuide = Optional.ofNullable(enableAiGuide); + return this; + } + public UpdateTenantSettingsResponseContent build() { return new UpdateTenantSettingsResponseContent( changePassword, @@ -1385,6 +1416,7 @@ public UpdateTenantSettingsResponseContent build() { authorizationResponseIssParameterSupported, skipNonVerifiableCallbackUriConfirmationPrompt, resourceParameterProfile, + enableAiGuide, additionalProperties); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java index 48f695546..d4253ec21 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenExchangeProfileRequestContent.java @@ -49,7 +49,7 @@ public Optional getSubjectTokenType() { return subjectTokenType; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTokenExchangeProfileRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(UpdateTokenExchangeProfileRequestContent other) { return name.equals(other.name) && subjectTokenType.equals(other.subjectTokenType); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.subjectTokenType); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java index 8b6fa5259..809a005a2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateTokenQuota.java @@ -33,7 +33,7 @@ public TokenQuotaClientCredentials getClientCredentials() { return clientCredentials; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateTokenQuota && equalTo((UpdateTokenQuota) other); @@ -48,12 +48,12 @@ private boolean equalTo(UpdateTokenQuota other) { return clientCredentials.equals(other.clientCredentials); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientCredentials); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements ClientCredentialsStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateTokenQuota other) { clientCredentials(other.getClientCredentials()); return this; } - @Override + @java.lang.Override @JsonSetter("client_credentials") public _FinalStage clientCredentials(@NotNull TokenQuotaClientCredentials clientCredentials) { this.clientCredentials = Objects.requireNonNull(clientCredentials, "clientCredentials must not be null"); return this; } - @Override + @java.lang.Override public UpdateTokenQuota build() { return new UpdateTokenQuota(clientCredentials, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java index c0725965b..eca442c22 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUniversalLoginTemplateRequestContent.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUniversalLoginTemplateRequestContent @@ -50,12 +50,12 @@ private boolean equalTo(UpdateUniversalLoginTemplateRequestContent other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer getCreatedAt() { return createdAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserAuthenticationMethodResponseContent @@ -205,7 +205,7 @@ private boolean equalTo(UpdateUserAuthenticationMethodResponseContent other) { && createdAt.equals(other.createdAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -223,7 +223,7 @@ public int hashCode() { this.createdAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -354,7 +354,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UpdateUserAuthenticationMethodResponseContent other) { id(other.getId()); type(other.getType()); @@ -372,7 +372,7 @@ public Builder from(UpdateUserAuthenticationMethodResponseContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -383,7 +383,7 @@ public _FinalStage type(@NotNull CreatedAuthenticationMethodTypeEnum type) { *

Authentication method creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.ofNullable(createdAt); return this; @@ -392,7 +392,7 @@ public _FinalStage createdAt(OffsetDateTime createdAt) { /** *

Authentication method creation date

*/ - @Override + @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -403,7 +403,7 @@ public _FinalStage createdAt(Optional createdAt) { *

Applies to webauthn authentication methods only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -412,7 +412,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authentication methods only. The relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -423,7 +423,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage aaguid(String aaguid) { this.aaguid = Optional.ofNullable(aaguid); return this; @@ -432,7 +432,7 @@ public _FinalStage aaguid(String aaguid) { /** *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) public _FinalStage aaguid(Optional aaguid) { this.aaguid = aaguid; @@ -443,7 +443,7 @@ public _FinalStage aaguid(Optional aaguid) { *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -452,7 +452,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -463,7 +463,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -472,21 +472,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The id of the credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -494,13 +494,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -512,7 +512,7 @@ public _FinalStage authenticationMethods( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -521,7 +521,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -532,7 +532,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -541,7 +541,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -552,7 +552,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -561,7 +561,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation

*/ - @Override + @java.lang.Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -572,7 +572,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -581,7 +581,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -592,7 +592,7 @@ public _FinalStage name(Optional name) { *

The ID of the newly created authentication method (automatically generated by the application)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); return this; @@ -601,14 +601,14 @@ public _FinalStage id(String id) { /** *

The ID of the newly created authentication method (automatically generated by the application)

*/ - @Override + @java.lang.Override @JsonSetter(value = "id", nulls = Nulls.SKIP) public _FinalStage id(Optional id) { this.id = id; return this; } - @Override + @java.lang.Override public UpdateUserAuthenticationMethodResponseContent build() { return new UpdateUserAuthenticationMethodResponseContent( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java index 3df3bdba7..c6a627803 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserRequestContent.java @@ -330,7 +330,7 @@ private OptionalNullable _getUsername() { return username; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserRequestContent && equalTo((UpdateUserRequestContent) other); @@ -362,7 +362,7 @@ private boolean equalTo(UpdateUserRequestContent other) { && username.equals(other.username); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.blocked, @@ -385,7 +385,7 @@ public int hashCode() { this.username); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java index a1cba826d..8e5b12bc5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserResponseContent && equalTo((UpdateUserResponseContent) other); @@ -300,7 +300,7 @@ private boolean equalTo(UpdateUserResponseContent other) { && familyName.equals(other.familyName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java index 5d23980b7..b89fbb1b7 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateVerifiableCredentialTemplateResponseContent.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateVerifiableCredentialTemplateResponseContent @@ -157,7 +157,7 @@ private boolean equalTo(UpdateVerifiableCredentialTemplateResponseContent other) && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java index 63c8952ca..5706a1c67 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfile.java @@ -63,7 +63,7 @@ public Optional getDisplayName() { return displayName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileOidcMapping && equalTo((UserAttributeProfileOidcMapping) other); @@ -65,12 +65,12 @@ private boolean equalTo(UserAttributeProfileOidcMapping other) { return mapping.equals(other.mapping) && displayName.equals(other.displayName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.mapping, this.displayName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements MappingStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UserAttributeProfileOidcMapping other) { mapping(other.getMapping()); displayName(other.getDisplayName()); @@ -122,7 +122,7 @@ public Builder from(UserAttributeProfileOidcMapping other) { *

OIDC mapping field

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("mapping") public _FinalStage mapping(@NotNull String mapping) { this.mapping = Objects.requireNonNull(mapping, "mapping must not be null"); @@ -133,7 +133,7 @@ public _FinalStage mapping(@NotNull String mapping) { *

Display name for the OIDC mapping

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage displayName(String displayName) { this.displayName = Optional.ofNullable(displayName); return this; @@ -142,14 +142,14 @@ public _FinalStage displayName(String displayName) { /** *

Display name for the OIDC mapping

*/ - @Override + @java.lang.Override @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public _FinalStage displayName(Optional displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override public UserAttributeProfileOidcMapping build() { return new UserAttributeProfileOidcMapping(mapping, displayName, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java index 9126f7398..d78a5764b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverrides.java @@ -99,7 +99,7 @@ public Optional getSamlp() { return samlp; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileStrategyOverrides @@ -122,13 +122,13 @@ private boolean equalTo(UserAttributeProfileStrategyOverrides other) { && samlp.equals(other.samlp); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java index 80e42eefa..02e6b06b8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesMapping.java @@ -58,7 +58,7 @@ public Optional getScimMapping() { return scimMapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileStrategyOverridesMapping @@ -76,12 +76,12 @@ private boolean equalTo(UserAttributeProfileStrategyOverridesMapping other) { && scimMapping.equals(other.scimMapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java index 48dfa688b..fca59bd47 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserId.java @@ -99,7 +99,7 @@ public Optional getSamlp() { return samlp; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileStrategyOverridesUserId @@ -122,13 +122,13 @@ private boolean equalTo(UserAttributeProfileStrategyOverridesUserId other) { && samlp.equals(other.samlp); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.pingfederate, this.ad, this.adfs, this.waad, this.googleApps, this.okta, this.oidc, this.samlp); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java index 094adab11..df2c13f3e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileStrategyOverridesUserIdMapping.java @@ -58,7 +58,7 @@ public Optional getScimMapping() { return scimMapping; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileStrategyOverridesUserIdMapping @@ -76,12 +76,12 @@ private boolean equalTo(UserAttributeProfileStrategyOverridesUserIdMapping other && scimMapping.equals(other.scimMapping); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java index 676611321..ae6ceb190 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileTemplate.java @@ -54,7 +54,7 @@ public Optional getTemplate() { return template; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileTemplateItem && equalTo((UserAttributeProfileTemplateItem) other); @@ -75,12 +75,12 @@ private boolean equalTo(UserAttributeProfileTemplateItem other) { return id.equals(other.id) && displayName.equals(other.displayName) && template.equals(other.template); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.displayName, this.template); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java index 039f8917e..4f602575e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserAttributeAdditionalProperties.java @@ -116,7 +116,7 @@ public Optional getStrategyOverrides() { return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileUserAttributeAdditionalProperties @@ -139,7 +139,7 @@ private boolean equalTo(UserAttributeProfileUserAttributeAdditionalProperties ot && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.description, @@ -152,7 +152,7 @@ public int hashCode() { this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -238,7 +238,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(UserAttributeProfileUserAttributeAdditionalProperties other) { description(other.getDescription()); label(other.getLabel()); @@ -256,7 +256,7 @@ public Builder from(UserAttributeProfileUserAttributeAdditionalProperties other) *

Description of this attribute

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("description") public LabelStage description(@NotNull String description) { this.description = Objects.requireNonNull(description, "description must not be null"); @@ -268,7 +268,7 @@ public LabelStage description(@NotNull String description) { *

Display label for this attribute

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("label") public ProfileRequiredStage label(@NotNull String label) { this.label = Objects.requireNonNull(label, "label must not be null"); @@ -280,7 +280,7 @@ public ProfileRequiredStage label(@NotNull String label) { *

Whether this attribute is required in the profile

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("profile_required") public Auth0MappingStage profileRequired(boolean profileRequired) { this.profileRequired = profileRequired; @@ -292,20 +292,20 @@ public Auth0MappingStage profileRequired(boolean profileRequired) { *

Auth0 mapping for this attribute

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("auth0_mapping") public _FinalStage auth0Mapping(@NotNull String auth0Mapping) { this.auth0Mapping = Objects.requireNonNull(auth0Mapping, "auth0Mapping must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage strategyOverrides(UserAttributeProfileStrategyOverrides strategyOverrides) { this.strategyOverrides = Optional.ofNullable(strategyOverrides); return this; } - @Override + @java.lang.Override @JsonSetter(value = "strategy_overrides", nulls = Nulls.SKIP) public _FinalStage strategyOverrides(Optional strategyOverrides) { this.strategyOverrides = strategyOverrides; @@ -316,7 +316,7 @@ public _FinalStage strategyOverrides(OptionalSCIM mapping for this attribute

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage scimMapping(String scimMapping) { this.scimMapping = Optional.ofNullable(scimMapping); return this; @@ -325,40 +325,40 @@ public _FinalStage scimMapping(String scimMapping) { /** *

SCIM mapping for this attribute

*/ - @Override + @java.lang.Override @JsonSetter(value = "scim_mapping", nulls = Nulls.SKIP) public _FinalStage scimMapping(Optional scimMapping) { this.scimMapping = scimMapping; return this; } - @Override + @java.lang.Override public _FinalStage samlMapping(List samlMapping) { this.samlMapping = Optional.ofNullable(samlMapping); return this; } - @Override + @java.lang.Override @JsonSetter(value = "saml_mapping", nulls = Nulls.SKIP) public _FinalStage samlMapping(Optional> samlMapping) { this.samlMapping = samlMapping; return this; } - @Override + @java.lang.Override public _FinalStage oidcMapping(UserAttributeProfileOidcMapping oidcMapping) { this.oidcMapping = Optional.ofNullable(oidcMapping); return this; } - @Override + @java.lang.Override @JsonSetter(value = "oidc_mapping", nulls = Nulls.SKIP) public _FinalStage oidcMapping(Optional oidcMapping) { this.oidcMapping = oidcMapping; return this; } - @Override + @java.lang.Override public UserAttributeProfileUserAttributeAdditionalProperties build() { return new UserAttributeProfileUserAttributeAdditionalProperties( description, diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java index 8c8f39077..cf4f6bae5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserId.java @@ -67,7 +67,7 @@ public Optional getStrategyOverride return strategyOverrides; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAttributeProfileUserId && equalTo((UserAttributeProfileUserId) other); @@ -85,12 +85,12 @@ private boolean equalTo(UserAttributeProfileUserId other) { && strategyOverrides.equals(other.strategyOverrides); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.oidcMapping, this.samlMapping, this.scimMapping, this.strategyOverrides); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java index 1f35dd770..0285a1e01 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAttributeProfileUserIdOidcStrategyOverrideMapping.java @@ -29,20 +29,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserAttributeProfileUserIdOidcStrategyOverrideMapping && this.string.equals(((UserAttributeProfileUserIdOidcStrategyOverrideMapping) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java index 0d72b090e..0029e96da 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethod.java @@ -261,7 +261,7 @@ public Optional getRelyingPartyIdentifier() { return relyingPartyIdentifier; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAuthenticationMethod && equalTo((UserAuthenticationMethod) other); @@ -295,7 +295,7 @@ private boolean equalTo(UserAuthenticationMethod other) { && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -320,7 +320,7 @@ public int hashCode() { this.relyingPartyIdentifier); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -514,7 +514,7 @@ public static final class Builder implements IdStage, TypeStage, CreatedAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(UserAuthenticationMethod other) { id(other.getId()); type(other.getType()); @@ -544,14 +544,14 @@ public Builder from(UserAuthenticationMethod other) { *

The ID of the authentication method (auto generated)

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -563,7 +563,7 @@ public CreatedAtStage type(@NotNull AuthenticationMethodTypeEnum type) { *

Authenticator creation date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("created_at") public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); @@ -574,7 +574,7 @@ public _FinalStage createdAt(@NotNull OffsetDateTime createdAt) { *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -583,7 +583,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -594,7 +594,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage aaguid(String aaguid) { this.aaguid = Optional.ofNullable(aaguid); return this; @@ -603,7 +603,7 @@ public _FinalStage aaguid(String aaguid) { /** *

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "aaguid", nulls = Nulls.SKIP) public _FinalStage aaguid(Optional aaguid) { this.aaguid = aaguid; @@ -614,7 +614,7 @@ public _FinalStage aaguid(Optional aaguid) { *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage userAgent(String userAgent) { this.userAgent = Optional.ofNullable(userAgent); return this; @@ -623,7 +623,7 @@ public _FinalStage userAgent(String userAgent) { /** *

Applies to passkeys only. The user-agent of the browser used to create the passkey.

*/ - @Override + @java.lang.Override @JsonSetter(value = "user_agent", nulls = Nulls.SKIP) public _FinalStage userAgent(Optional userAgent) { this.userAgent = userAgent; @@ -634,7 +634,7 @@ public _FinalStage userAgent(Optional userAgent) { *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage identityUserId(String identityUserId) { this.identityUserId = Optional.ofNullable(identityUserId); return this; @@ -643,7 +643,7 @@ public _FinalStage identityUserId(String identityUserId) { /** *

Applies to passkeys only. The ID of the user identity linked with the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "identity_user_id", nulls = Nulls.SKIP) public _FinalStage identityUserId(Optional identityUserId) { this.identityUserId = identityUserId; @@ -654,7 +654,7 @@ public _FinalStage identityUserId(Optional identityUserId) { *

Applies to passkeys only. Whether the credential was backed up.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { this.credentialBackedUp = Optional.ofNullable(credentialBackedUp); return this; @@ -663,7 +663,7 @@ public _FinalStage credentialBackedUp(Boolean credentialBackedUp) { /** *

Applies to passkeys only. Whether the credential was backed up.

*/ - @Override + @java.lang.Override @JsonSetter(value = "credential_backed_up", nulls = Nulls.SKIP) public _FinalStage credentialBackedUp(Optional credentialBackedUp) { this.credentialBackedUp = credentialBackedUp; @@ -674,7 +674,7 @@ public _FinalStage credentialBackedUp(Optional credentialBackedUp) { *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage credentialDeviceType(String credentialDeviceType) { this.credentialDeviceType = Optional.ofNullable(credentialDeviceType); return this; @@ -683,7 +683,7 @@ public _FinalStage credentialDeviceType(String credentialDeviceType) { /** *

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

*/ - @Override + @java.lang.Override @JsonSetter(value = "credential_device_type", nulls = Nulls.SKIP) public _FinalStage credentialDeviceType(Optional credentialDeviceType) { this.credentialDeviceType = credentialDeviceType; @@ -694,7 +694,7 @@ public _FinalStage credentialDeviceType(Optional credentialDeviceType) { *

Last authentication

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { this.lastAuthAt = Optional.ofNullable(lastAuthAt); return this; @@ -703,7 +703,7 @@ public _FinalStage lastAuthAt(OffsetDateTime lastAuthAt) { /** *

Last authentication

*/ - @Override + @java.lang.Override @JsonSetter(value = "last_auth_at", nulls = Nulls.SKIP) public _FinalStage lastAuthAt(Optional lastAuthAt) { this.lastAuthAt = lastAuthAt; @@ -714,7 +714,7 @@ public _FinalStage lastAuthAt(Optional lastAuthAt) { *

Enrollment date

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { this.enrolledAt = Optional.ofNullable(enrolledAt); return this; @@ -723,7 +723,7 @@ public _FinalStage enrolledAt(OffsetDateTime enrolledAt) { /** *

Enrollment date

*/ - @Override + @java.lang.Override @JsonSetter(value = "enrolled_at", nulls = Nulls.SKIP) public _FinalStage enrolledAt(Optional enrolledAt) { this.enrolledAt = enrolledAt; @@ -734,7 +734,7 @@ public _FinalStage enrolledAt(Optional enrolledAt) { *

Applies to webauthn authentication methods only. The public key.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -743,7 +743,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -754,7 +754,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The ID of the generated credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -763,7 +763,7 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The ID of the generated credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; @@ -774,7 +774,7 @@ public _FinalStage keyId(Optional keyId) { *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -783,7 +783,7 @@ public _FinalStage email(String email) { /** *

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -794,7 +794,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -803,7 +803,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -814,7 +814,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage linkId(String linkId) { this.linkId = Optional.ofNullable(linkId); return this; @@ -823,21 +823,21 @@ public _FinalStage linkId(String linkId) { /** *

The ID of a linked authentication method. Linked authentication methods will be deleted together.

*/ - @Override + @java.lang.Override @JsonSetter(value = "link_id", nulls = Nulls.SKIP) public _FinalStage linkId(Optional linkId) { this.linkId = linkId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -845,13 +845,13 @@ public _FinalStage preferredAuthenticationMethod( return this; } - @Override + @java.lang.Override public _FinalStage authenticationMethods(List authenticationMethods) { this.authenticationMethods = Optional.ofNullable(authenticationMethods); return this; } - @Override + @java.lang.Override @JsonSetter(value = "authentication_methods", nulls = Nulls.SKIP) public _FinalStage authenticationMethods( Optional> authenticationMethods) { @@ -863,7 +863,7 @@ public _FinalStage authenticationMethods( *

A human-readable label to identify the authentication method

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -872,7 +872,7 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; @@ -883,7 +883,7 @@ public _FinalStage name(Optional name) { *

The authentication method status

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage confirmed(Boolean confirmed) { this.confirmed = Optional.ofNullable(confirmed); return this; @@ -892,14 +892,14 @@ public _FinalStage confirmed(Boolean confirmed) { /** *

The authentication method status

*/ - @Override + @java.lang.Override @JsonSetter(value = "confirmed", nulls = Nulls.SKIP) public _FinalStage confirmed(Optional confirmed) { this.confirmed = confirmed; return this; } - @Override + @java.lang.Override public UserAuthenticationMethod build() { return new UserAuthenticationMethod( id, diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java index 7b21a0026..9893bebd1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodProperties.java @@ -45,7 +45,7 @@ public Optional getId() { return id; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserAuthenticationMethodProperties @@ -61,12 +61,12 @@ private boolean equalTo(UserAuthenticationMethodProperties other) { return type.equals(other.type) && id.equals(other.id); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.id); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java index 6a2af871a..1ef03fe1a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserAuthenticationMethodPropertiesEnum.java @@ -32,20 +32,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserAuthenticationMethodPropertiesEnum && this.string.equals(((UserAuthenticationMethodPropertiesEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java index d545ac3db..1149c8ddd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserBlockIdentifier.java @@ -63,7 +63,7 @@ public Optional getConnection() { return connection; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserBlockIdentifier && equalTo((UserBlockIdentifier) other); @@ -78,12 +78,12 @@ private boolean equalTo(UserBlockIdentifier other) { return identifier.equals(other.identifier) && ip.equals(other.ip) && connection.equals(other.connection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier, this.ip, this.connection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java index 97caaf9e4..425e496ae 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserDateSchema.java @@ -41,7 +41,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserDateSchema && equalTo((UserDateSchema) other); @@ -51,12 +51,12 @@ private boolean equalTo(UserDateSchema other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -80,7 +80,7 @@ static final class Deserializer extends StdDeserializer { super(UserDateSchema.class); } - @Override + @java.lang.Override public UserDateSchema deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java index 73d8e9a8f..75512a03e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentAuthMethodEnum.java @@ -34,20 +34,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserEnrollmentAuthMethodEnum && this.string.equals(((UserEnrollmentAuthMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java index 6cd45c564..a79d4f33e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserEnrollmentStatusEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserEnrollmentStatusEnum && this.string.equals(((UserEnrollmentStatusEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserGrant.java b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java index 79df0ad0b..4da8da77d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserGrant.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserGrant.java @@ -88,7 +88,7 @@ public Optional> getScope() { return scope; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserGrant && equalTo((UserGrant) other); @@ -107,12 +107,12 @@ private boolean equalTo(UserGrant other) { && scope.equals(other.scope); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.clientId, this.userId, this.audience, this.scope); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java index c75545b80..e9056c211 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserGroupsResponseSchema.java @@ -75,7 +75,7 @@ private UserGroupsResponseSchema( * @return Unique identifier for the group (service-generated). */ @JsonProperty("id") - @Override + @java.lang.Override public Optional getId() { return id; } @@ -84,7 +84,7 @@ public Optional getId() { * @return Name of the group. Must be unique within its scope (connection, organization, or tenant). Must contain between 1 and 128 printable ASCII characters. */ @JsonProperty("name") - @Override + @java.lang.Override public Optional getName() { return name; } @@ -93,7 +93,7 @@ public Optional getName() { * @return External identifier for the group, often used for SCIM synchronization. Max length of 256 characters. */ @JsonProperty("external_id") - @Override + @java.lang.Override public Optional getExternalId() { return externalId; } @@ -102,7 +102,7 @@ public Optional getExternalId() { * @return Identifier for the connection this group belongs to (if a connection group). */ @JsonProperty("connection_id") - @Override + @java.lang.Override public Optional getConnectionId() { return connectionId; } @@ -112,7 +112,7 @@ public Optional getConnectionId() { */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("organization_id") - @Override + @java.lang.Override public OptionalNullable getOrganizationId() { if (organizationId == null) { return OptionalNullable.absent(); @@ -124,14 +124,14 @@ public OptionalNullable getOrganizationId() { * @return Identifier for the tenant this group belongs to. */ @JsonProperty("tenant_name") - @Override + @java.lang.Override public Optional getTenantName() { return tenantName; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("description") - @Override + @java.lang.Override public OptionalNullable getDescription() { if (description == null) { return OptionalNullable.absent(); @@ -143,7 +143,7 @@ public OptionalNullable getDescription() { * @return Timestamp of when the group was created. */ @JsonProperty("created_at") - @Override + @java.lang.Override public Optional getCreatedAt() { return createdAt; } @@ -152,7 +152,7 @@ public Optional getCreatedAt() { * @return Timestamp of when the group was last updated. */ @JsonProperty("updated_at") - @Override + @java.lang.Override public Optional getUpdatedAt() { return updatedAt; } @@ -177,7 +177,7 @@ private OptionalNullable _getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserGroupsResponseSchema && equalTo((UserGroupsResponseSchema) other); @@ -201,7 +201,7 @@ private boolean equalTo(UserGroupsResponseSchema other) { && membershipCreatedAt.equals(other.membershipCreatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -216,7 +216,7 @@ public int hashCode() { this.membershipCreatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserId.java b/src/main/java/com/auth0/client/mgmt/types/UserId.java index 02d070dde..0348be41b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserId.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserId.java @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserId && equalTo((UserId) other); @@ -49,12 +49,12 @@ private boolean equalTo(UserId other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer { super(UserId.class); } - @Override + @java.lang.Override public UserId deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java index 640c6b7ff..f67dd2aa1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentity.java @@ -118,7 +118,7 @@ public Optional getRefreshToken() { return refreshToken; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserIdentity && equalTo((UserIdentity) other); @@ -140,7 +140,7 @@ private boolean equalTo(UserIdentity other) { && refreshToken.equals(other.refreshToken); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connection, @@ -153,7 +153,7 @@ public int hashCode() { this.refreshToken); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -241,7 +241,7 @@ public static final class Builder implements ConnectionStage, UserIdStage, Provi private Builder() {} - @Override + @java.lang.Override public Builder from(UserIdentity other) { connection(other.getConnection()); userId(other.getUserId()); @@ -259,14 +259,14 @@ public Builder from(UserIdentity other) { *

Connection name of this identity.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection") public UserIdStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("user_id") public ProviderStage userId(@NotNull UserId userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); @@ -278,7 +278,7 @@ public ProviderStage userId(@NotNull UserId userId) { *

Type of identity provider.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("provider") public _FinalStage provider(@NotNull String provider) { this.provider = Objects.requireNonNull(provider, "provider must not be null"); @@ -289,7 +289,7 @@ public _FinalStage provider(@NotNull String provider) { *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage refreshToken(String refreshToken) { this.refreshToken = Optional.ofNullable(refreshToken); return this; @@ -298,7 +298,7 @@ public _FinalStage refreshToken(String refreshToken) { /** *

IDP refresh token returned only if scope read:user_idp_tokens is defined.

*/ - @Override + @java.lang.Override @JsonSetter(value = "refresh_token", nulls = Nulls.SKIP) public _FinalStage refreshToken(Optional refreshToken) { this.refreshToken = refreshToken; @@ -309,7 +309,7 @@ public _FinalStage refreshToken(Optional refreshToken) { *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accessTokenSecret(String accessTokenSecret) { this.accessTokenSecret = Optional.ofNullable(accessTokenSecret); return this; @@ -318,7 +318,7 @@ public _FinalStage accessTokenSecret(String accessTokenSecret) { /** *

IDP access token secret returned only if scope read:user_idp_tokens is defined.

*/ - @Override + @java.lang.Override @JsonSetter(value = "access_token_secret", nulls = Nulls.SKIP) public _FinalStage accessTokenSecret(Optional accessTokenSecret) { this.accessTokenSecret = accessTokenSecret; @@ -329,7 +329,7 @@ public _FinalStage accessTokenSecret(Optional accessTokenSecret) { *

IDP access token returned if scope read:user_idp_tokens is defined.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage accessToken(String accessToken) { this.accessToken = Optional.ofNullable(accessToken); return this; @@ -338,7 +338,7 @@ public _FinalStage accessToken(String accessToken) { /** *

IDP access token returned if scope read:user_idp_tokens is defined.

*/ - @Override + @java.lang.Override @JsonSetter(value = "access_token", nulls = Nulls.SKIP) public _FinalStage accessToken(Optional accessToken) { this.accessToken = accessToken; @@ -349,7 +349,7 @@ public _FinalStage accessToken(Optional accessToken) { *

Whether the identity provider is a social provider (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage isSocial(Boolean isSocial) { this.isSocial = Optional.ofNullable(isSocial); return this; @@ -358,27 +358,27 @@ public _FinalStage isSocial(Boolean isSocial) { /** *

Whether the identity provider is a social provider (true) or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "isSocial", nulls = Nulls.SKIP) public _FinalStage isSocial(Optional isSocial) { this.isSocial = isSocial; return this; } - @Override + @java.lang.Override public _FinalStage profileData(UserProfileData profileData) { this.profileData = Optional.ofNullable(profileData); return this; } - @Override + @java.lang.Override @JsonSetter(value = "profileData", nulls = Nulls.SKIP) public _FinalStage profileData(Optional profileData) { this.profileData = profileData; return this; } - @Override + @java.lang.Override public UserIdentity build() { return new UserIdentity( connection, diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java index 27657e27b..79e3e233f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java @@ -159,20 +159,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserIdentityProviderEnum && this.string.equals(((UserIdentityProviderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java index 421d990cd..794f19544 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentitySchema.java @@ -117,7 +117,7 @@ public Optional getProfileData() { return profileData; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserIdentitySchema && equalTo((UserIdentitySchema) other); @@ -139,7 +139,7 @@ private boolean equalTo(UserIdentitySchema other) { && profileData.equals(other.profileData); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connection, @@ -152,7 +152,7 @@ public int hashCode() { this.profileData); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java index 0e9507f30..6cc6f997c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserListLogOffsetPaginatedResponseContent.java @@ -73,7 +73,7 @@ public Optional> getLogs() { return logs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserListLogOffsetPaginatedResponseContent @@ -93,12 +93,12 @@ private boolean equalTo(UserListLogOffsetPaginatedResponseContent other) { && logs.equals(other.logs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.limit, this.length, this.total, this.logs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java index 6ccdb672e..678d1a9c6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserMultifactorProviderEnum.java @@ -25,20 +25,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof UserMultifactorProviderEnum && this.string.equals(((UserMultifactorProviderEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java index 269b63137..0bd26cc73 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserPermissionSchema.java @@ -75,7 +75,7 @@ public Optional getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserPermissionSchema && equalTo((UserPermissionSchema) other); @@ -93,13 +93,13 @@ private boolean equalTo(UserPermissionSchema other) { && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.resourceServerIdentifier, this.permissionName, this.resourceServerName, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java index e826c5a1c..e76d8a547 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserProfileData.java @@ -123,7 +123,7 @@ public Optional getFamilyName() { return familyName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserProfileData && equalTo((UserProfileData) other); @@ -145,7 +145,7 @@ private boolean equalTo(UserProfileData other) { && familyName.equals(other.familyName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.email, @@ -158,7 +158,7 @@ public int hashCode() { this.familyName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java index 9ac8208c1..e177e50d5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java @@ -265,7 +265,7 @@ public Optional getFamilyName() { return familyName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UserResponseSchema && equalTo((UserResponseSchema) other); @@ -300,7 +300,7 @@ private boolean equalTo(UserResponseSchema other) { && familyName.equals(other.familyName); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.userId, @@ -326,7 +326,7 @@ public int hashCode() { this.familyName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java index 06806d803..fd678fdb8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAllowedTypes.java @@ -43,7 +43,7 @@ public Optional getPhoneNumber() { return phoneNumber; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameAllowedTypes && equalTo((UsernameAllowedTypes) other); @@ -58,12 +58,12 @@ private boolean equalTo(UsernameAllowedTypes other) { return email.equals(other.email) && phoneNumber.equals(other.phoneNumber); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.email, this.phoneNumber); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java index cd54a4829..81d7ee07d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameAttribute.java @@ -66,7 +66,7 @@ public Optional getValidation() { return validation; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameAttribute && equalTo((UsernameAttribute) other); @@ -84,12 +84,12 @@ private boolean equalTo(UsernameAttribute other) { && validation.equals(other.validation); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.identifier, this.profileRequired, this.signup, this.validation); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java index 94c458011..d8070e03b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsernameValidation.java @@ -60,7 +60,7 @@ public Optional getAllowedTypes() { return allowedTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsernameValidation && equalTo((UsernameValidation) other); @@ -77,12 +77,12 @@ private boolean equalTo(UsernameValidation other) { && allowedTypes.equals(other.allowedTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.minLength, this.maxLength, this.allowedTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java index ec8535e4e..17c5706ff 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java +++ b/src/main/java/com/auth0/client/mgmt/types/UsersEnrollment.java @@ -130,7 +130,7 @@ public Optional getLastAuth() { return lastAuth; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UsersEnrollment && equalTo((UsersEnrollment) other); @@ -153,7 +153,7 @@ private boolean equalTo(UsersEnrollment other) { && lastAuth.equals(other.lastAuth); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -167,7 +167,7 @@ public int hashCode() { this.lastAuth); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java index 270888a98..068589170 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifiableCredentialTemplateResponse.java @@ -133,7 +133,7 @@ public Optional getUpdatedAt() { return updatedAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifiableCredentialTemplateResponse @@ -157,7 +157,7 @@ private boolean equalTo(VerifiableCredentialTemplateResponse other) { && updatedAt.equals(other.updatedAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.id, @@ -171,7 +171,7 @@ public int hashCode() { this.updatedAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java index f033879c4..ce611f898 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerificationMethodEnum.java @@ -24,20 +24,20 @@ public Value getEnumValue() { return value; } - @Override + @java.lang.Override @JsonValue public String toString() { return this.string; } - @Override + @java.lang.Override public boolean equals(Object other) { return (this == other) || (other instanceof VerificationMethodEnum && this.string.equals(((VerificationMethodEnum) other).string)); } - @Override + @java.lang.Override public int hashCode() { return this.string.hashCode(); } diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java index 88d9c2c68..fc200d0d5 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyCustomDomainResponseContent.java @@ -170,7 +170,7 @@ private OptionalNullable _getCustomClientIpHeader() { return customClientIpHeader; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyCustomDomainResponseContent && equalTo((VerifyCustomDomainResponseContent) other); @@ -196,7 +196,7 @@ private boolean equalTo(VerifyCustomDomainResponseContent other) { && certificate.equals(other.certificate); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.customDomainId, @@ -213,7 +213,7 @@ public int hashCode() { this.certificate); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -333,7 +333,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(VerifyCustomDomainResponseContent other) { customDomainId(other.getCustomDomainId()); domain(other.getDomain()); @@ -355,7 +355,7 @@ public Builder from(VerifyCustomDomainResponseContent other) { *

ID of the custom domain.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("custom_domain_id") public DomainStage customDomainId(@NotNull String customDomainId) { this.customDomainId = Objects.requireNonNull(customDomainId, "customDomainId must not be null"); @@ -367,7 +367,7 @@ public DomainStage customDomainId(@NotNull String customDomainId) { *

Domain name.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("domain") public PrimaryStage domain(@NotNull String domain) { this.domain = Objects.requireNonNull(domain, "domain must not be null"); @@ -379,47 +379,47 @@ public PrimaryStage domain(@NotNull String domain) { *

Whether this is a primary domain (true) or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("primary") public StatusStage primary(boolean primary) { this.primary = primary; return this; } - @Override + @java.lang.Override @JsonSetter("status") public TypeStage status(@NotNull CustomDomainStatusFilterEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CustomDomainTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage certificate(DomainCertificate certificate) { this.certificate = Optional.ofNullable(certificate); return this; } - @Override + @java.lang.Override @JsonSetter(value = "certificate", nulls = Nulls.SKIP) public _FinalStage certificate(Optional certificate) { this.certificate = certificate; return this; } - @Override + @java.lang.Override public _FinalStage domainMetadata(Map> domainMetadata) { this.domainMetadata = Optional.ofNullable(domainMetadata); return this; } - @Override + @java.lang.Override @JsonSetter(value = "domain_metadata", nulls = Nulls.SKIP) public _FinalStage domainMetadata(Optional>> domainMetadata) { this.domainMetadata = domainMetadata; @@ -430,7 +430,7 @@ public _FinalStage domainMetadata(Optional> *

The TLS version policy

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage tlsPolicy(String tlsPolicy) { this.tlsPolicy = Optional.ofNullable(tlsPolicy); return this; @@ -439,7 +439,7 @@ public _FinalStage tlsPolicy(String tlsPolicy) { /** *

The TLS version policy

*/ - @Override + @java.lang.Override @JsonSetter(value = "tls_policy", nulls = Nulls.SKIP) public _FinalStage tlsPolicy(Optional tlsPolicy) { this.tlsPolicy = tlsPolicy; @@ -450,7 +450,7 @@ public _FinalStage tlsPolicy(Optional tlsPolicy) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.Nullable customClientIpHeader) { if (customClientIpHeader.isNull()) { this.customClientIpHeader = OptionalNullable.ofNull(); @@ -466,7 +466,7 @@ public _FinalStage customClientIpHeader(com.auth0.client.mgmt.core.NullableThe HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(Optional customClientIpHeader) { if (customClientIpHeader.isPresent()) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader.get()); @@ -480,7 +480,7 @@ public _FinalStage customClientIpHeader(Optional customClientIpHeader) { *

The HTTP header to fetch the client's IP address

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage customClientIpHeader(String customClientIpHeader) { this.customClientIpHeader = OptionalNullable.of(customClientIpHeader); return this; @@ -489,20 +489,20 @@ public _FinalStage customClientIpHeader(String customClientIpHeader) { /** *

The HTTP header to fetch the client's IP address

*/ - @Override + @java.lang.Override @JsonSetter(value = "custom_client_ip_header", nulls = Nulls.SKIP) public _FinalStage customClientIpHeader(@Nullable OptionalNullable customClientIpHeader) { this.customClientIpHeader = customClientIpHeader; return this; } - @Override + @java.lang.Override public _FinalStage verification(DomainVerification verification) { this.verification = Optional.ofNullable(verification); return this; } - @Override + @java.lang.Override @JsonSetter(value = "verification", nulls = Nulls.SKIP) public _FinalStage verification(Optional verification) { this.verification = verification; @@ -513,7 +513,7 @@ public _FinalStage verification(Optional verification) { *

Intermediate address.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage originDomainName(String originDomainName) { this.originDomainName = Optional.ofNullable(originDomainName); return this; @@ -522,7 +522,7 @@ public _FinalStage originDomainName(String originDomainName) { /** *

Intermediate address.

*/ - @Override + @java.lang.Override @JsonSetter(value = "origin_domain_name", nulls = Nulls.SKIP) public _FinalStage originDomainName(Optional originDomainName) { this.originDomainName = originDomainName; @@ -533,7 +533,7 @@ public _FinalStage originDomainName(Optional originDomainName) { *

CNAME API key header.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage cnameApiKey(String cnameApiKey) { this.cnameApiKey = Optional.ofNullable(cnameApiKey); return this; @@ -542,14 +542,14 @@ public _FinalStage cnameApiKey(String cnameApiKey) { /** *

CNAME API key header.

*/ - @Override + @java.lang.Override @JsonSetter(value = "cname_api_key", nulls = Nulls.SKIP) public _FinalStage cnameApiKey(Optional cnameApiKey) { this.cnameApiKey = cnameApiKey; return this; } - @Override + @java.lang.Override public VerifyCustomDomainResponseContent build() { return new VerifyCustomDomainResponseContent( customDomainId, diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java index 13491e49a..940d7b9a6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketRequestContent.java @@ -109,7 +109,7 @@ public Optional getIdentity() { return identity; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyEmailTicketRequestContent && equalTo((VerifyEmailTicketRequestContent) other); @@ -130,7 +130,7 @@ private boolean equalTo(VerifyEmailTicketRequestContent other) { && identity.equals(other.identity); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.resultUrl, @@ -142,7 +142,7 @@ public int hashCode() { this.identity); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -224,7 +224,7 @@ public static final class Builder implements UserIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(VerifyEmailTicketRequestContent other) { resultUrl(other.getResultUrl()); userId(other.getUserId()); @@ -241,20 +241,20 @@ public Builder from(VerifyEmailTicketRequestContent other) { *

user_id of for whom the ticket should be created.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("user_id") public _FinalStage userId(@NotNull String userId) { this.userId = Objects.requireNonNull(userId, "userId must not be null"); return this; } - @Override + @java.lang.Override public _FinalStage identity(Identity identity) { this.identity = Optional.ofNullable(identity); return this; } - @Override + @java.lang.Override @JsonSetter(value = "identity", nulls = Nulls.SKIP) public _FinalStage identity(Optional identity) { this.identity = identity; @@ -265,7 +265,7 @@ public _FinalStage identity(Optional identity) { *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { this.includeEmailInRedirect = Optional.ofNullable(includeEmailInRedirect); return this; @@ -274,7 +274,7 @@ public _FinalStage includeEmailInRedirect(Boolean includeEmailInRedirect) { /** *

Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false).

*/ - @Override + @java.lang.Override @JsonSetter(value = "includeEmailInRedirect", nulls = Nulls.SKIP) public _FinalStage includeEmailInRedirect(Optional includeEmailInRedirect) { this.includeEmailInRedirect = includeEmailInRedirect; @@ -285,7 +285,7 @@ public _FinalStage includeEmailInRedirect(Optional includeEmailInRedire *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage ttlSec(Integer ttlSec) { this.ttlSec = Optional.ofNullable(ttlSec); return this; @@ -294,7 +294,7 @@ public _FinalStage ttlSec(Integer ttlSec) { /** *

Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).

*/ - @Override + @java.lang.Override @JsonSetter(value = "ttl_sec", nulls = Nulls.SKIP) public _FinalStage ttlSec(Optional ttlSec) { this.ttlSec = ttlSec; @@ -305,7 +305,7 @@ public _FinalStage ttlSec(Optional ttlSec) { *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage organizationId(String organizationId) { this.organizationId = Optional.ofNullable(organizationId); return this; @@ -314,7 +314,7 @@ public _FinalStage organizationId(String organizationId) { /** *

(Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters.

*/ - @Override + @java.lang.Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; @@ -325,7 +325,7 @@ public _FinalStage organizationId(Optional organizationId) { *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage clientId(String clientId) { this.clientId = Optional.ofNullable(clientId); return this; @@ -334,7 +334,7 @@ public _FinalStage clientId(String clientId) { /** *

ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's <a target='' href='https://auth0.com/docs/authenticate/login/auth0-universal-login/configure-default-login-routes#completing-the-password-reset-flow'>default login route</a> after the ticket is used. client_id is required to use the <a target='' href='https://auth0.com/docs/customize/actions/flows-and-triggers/post-change-password-flow'>Password Reset Post Challenge</a> trigger.

*/ - @Override + @java.lang.Override @JsonSetter(value = "client_id", nulls = Nulls.SKIP) public _FinalStage clientId(Optional clientId) { this.clientId = clientId; @@ -345,7 +345,7 @@ public _FinalStage clientId(Optional clientId) { *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage resultUrl(String resultUrl) { this.resultUrl = Optional.ofNullable(resultUrl); return this; @@ -354,14 +354,14 @@ public _FinalStage resultUrl(String resultUrl) { /** *

URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id.

*/ - @Override + @java.lang.Override @JsonSetter(value = "result_url", nulls = Nulls.SKIP) public _FinalStage resultUrl(Optional resultUrl) { this.resultUrl = resultUrl; return this; } - @Override + @java.lang.Override public VerifyEmailTicketRequestContent build() { return new VerifyEmailTicketRequestContent( resultUrl, diff --git a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java index 404cdf6e7..d558bbb5d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/VerifyEmailTicketResponseContent.java @@ -36,7 +36,7 @@ public String getTicket() { return ticket; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof VerifyEmailTicketResponseContent && equalTo((VerifyEmailTicketResponseContent) other); @@ -51,12 +51,12 @@ private boolean equalTo(VerifyEmailTicketResponseContent other) { return ticket.equals(other.ticket); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ticket); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -87,7 +87,7 @@ public static final class Builder implements TicketStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(VerifyEmailTicketResponseContent other) { ticket(other.getTicket()); return this; @@ -98,14 +98,14 @@ public Builder from(VerifyEmailTicketResponseContent other) { *

URL representing the ticket.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("ticket") public _FinalStage ticket(@NotNull String ticket) { this.ticket = Objects.requireNonNull(ticket, "ticket must not be null"); return this; } - @Override + @java.lang.Override public VerifyEmailTicketResponseContent build() { return new VerifyEmailTicketResponseContent(ticket, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java index 3312981cf..b423d70e4 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/AssignUserRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AssignUserRolesRequestContent && equalTo((AssignUserRolesRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(AssignUserRolesRequestContent other) { return roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java index ad45186bc..2ecd40173 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ClearAssessorsRequestContent.java @@ -51,7 +51,7 @@ public List getAssessors() { return assessors; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClearAssessorsRequestContent && equalTo((ClearAssessorsRequestContent) other); @@ -66,12 +66,12 @@ private boolean equalTo(ClearAssessorsRequestContent other) { return connection.equals(other.connection) && assessors.equals(other.assessors); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connection, this.assessors); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -113,7 +113,7 @@ public static final class Builder implements ConnectionStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClearAssessorsRequestContent other) { connection(other.getConnection()); assessors(other.getAssessors()); @@ -125,7 +125,7 @@ public Builder from(ClearAssessorsRequestContent other) { *

The name of the connection containing the user whose assessors should be cleared.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override @JsonSetter("connection") public _FinalStage connection(@NotNull String connection) { this.connection = Objects.requireNonNull(connection, "connection must not be null"); @@ -136,7 +136,7 @@ public _FinalStage connection(@NotNull String connection) { *

List of assessors to clear.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAllAssessors(List assessors) { if (assessors != null) { this.assessors.addAll(assessors); @@ -148,7 +148,7 @@ public _FinalStage addAllAssessors(List assessors) { *

List of assessors to clear.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage addAssessors(String assessors) { this.assessors.add(assessors); return this; @@ -157,7 +157,7 @@ public _FinalStage addAssessors(String assessors) { /** *

List of assessors to clear.

*/ - @Override + @java.lang.Override @JsonSetter(value = "assessors", nulls = Nulls.SKIP) public _FinalStage assessors(List assessors) { this.assessors.clear(); @@ -167,7 +167,7 @@ public _FinalStage assessors(List assessors) { return this; } - @Override + @java.lang.Override public ClearAssessorsRequestContent build() { return new ClearAssessorsRequestContent(connection, assessors, additionalProperties); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java index a5e3ccfb0..52a0d0ed5 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserAuthenticationMethodRequestContent.java @@ -132,7 +132,7 @@ public Optional getRelyingPartyIdentifier() { return relyingPartyIdentifier; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserAuthenticationMethodRequestContent @@ -156,7 +156,7 @@ private boolean equalTo(CreateUserAuthenticationMethodRequestContent other) { && relyingPartyIdentifier.equals(other.relyingPartyIdentifier); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.type, @@ -170,7 +170,7 @@ public int hashCode() { this.relyingPartyIdentifier); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -268,7 +268,7 @@ public static final class Builder implements TypeStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(CreateUserAuthenticationMethodRequestContent other) { type(other.getType()); name(other.getName()); @@ -282,7 +282,7 @@ public Builder from(CreateUserAuthenticationMethodRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { this.type = Objects.requireNonNull(type, "type must not be null"); @@ -293,7 +293,7 @@ public _FinalStage type(@NotNull CreatedUserAuthenticationMethodTypeEnum type) { *

Applies to webauthn authentication methods only. The relying party identifier.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { this.relyingPartyIdentifier = Optional.ofNullable(relyingPartyIdentifier); return this; @@ -302,7 +302,7 @@ public _FinalStage relyingPartyIdentifier(String relyingPartyIdentifier) { /** *

Applies to webauthn authentication methods only. The relying party identifier.

*/ - @Override + @java.lang.Override @JsonSetter(value = "relying_party_identifier", nulls = Nulls.SKIP) public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifier) { this.relyingPartyIdentifier = relyingPartyIdentifier; @@ -313,7 +313,7 @@ public _FinalStage relyingPartyIdentifier(Optional relyingPartyIdentifie *

Applies to webauthn authentication methods only. The public key, which is encoded as base64.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage publicKey(String publicKey) { this.publicKey = Optional.ofNullable(publicKey); return this; @@ -322,7 +322,7 @@ public _FinalStage publicKey(String publicKey) { /** *

Applies to webauthn authentication methods only. The public key, which is encoded as base64.

*/ - @Override + @java.lang.Override @JsonSetter(value = "public_key", nulls = Nulls.SKIP) public _FinalStage publicKey(Optional publicKey) { this.publicKey = publicKey; @@ -333,7 +333,7 @@ public _FinalStage publicKey(Optional publicKey) { *

Applies to webauthn authentication methods only. The id of the credential.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage keyId(String keyId) { this.keyId = Optional.ofNullable(keyId); return this; @@ -342,21 +342,21 @@ public _FinalStage keyId(String keyId) { /** *

Applies to webauthn authentication methods only. The id of the credential.

*/ - @Override + @java.lang.Override @JsonSetter(value = "key_id", nulls = Nulls.SKIP) public _FinalStage keyId(Optional keyId) { this.keyId = keyId; return this; } - @Override + @java.lang.Override public _FinalStage preferredAuthenticationMethod( PreferredAuthenticationMethodEnum preferredAuthenticationMethod) { this.preferredAuthenticationMethod = Optional.ofNullable(preferredAuthenticationMethod); return this; } - @Override + @java.lang.Override @JsonSetter(value = "preferred_authentication_method", nulls = Nulls.SKIP) public _FinalStage preferredAuthenticationMethod( Optional preferredAuthenticationMethod) { @@ -368,7 +368,7 @@ public _FinalStage preferredAuthenticationMethod( *

Applies to email authentication methods only. The email address used to send verification messages.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage email(String email) { this.email = Optional.ofNullable(email); return this; @@ -377,7 +377,7 @@ public _FinalStage email(String email) { /** *

Applies to email authentication methods only. The email address used to send verification messages.

*/ - @Override + @java.lang.Override @JsonSetter(value = "email", nulls = Nulls.SKIP) public _FinalStage email(Optional email) { this.email = email; @@ -388,7 +388,7 @@ public _FinalStage email(Optional email) { *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage phoneNumber(String phoneNumber) { this.phoneNumber = Optional.ofNullable(phoneNumber); return this; @@ -397,7 +397,7 @@ public _FinalStage phoneNumber(String phoneNumber) { /** *

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

*/ - @Override + @java.lang.Override @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) public _FinalStage phoneNumber(Optional phoneNumber) { this.phoneNumber = phoneNumber; @@ -408,7 +408,7 @@ public _FinalStage phoneNumber(Optional phoneNumber) { *

Base32 encoded secret for TOTP generation.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage totpSecret(String totpSecret) { this.totpSecret = Optional.ofNullable(totpSecret); return this; @@ -417,7 +417,7 @@ public _FinalStage totpSecret(String totpSecret) { /** *

Base32 encoded secret for TOTP generation.

*/ - @Override + @java.lang.Override @JsonSetter(value = "totp_secret", nulls = Nulls.SKIP) public _FinalStage totpSecret(Optional totpSecret) { this.totpSecret = totpSecret; @@ -428,7 +428,7 @@ public _FinalStage totpSecret(Optional totpSecret) { *

A human-readable label to identify the authentication method.

* @return Reference to {@code this} so that method calls can be chained together. */ - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; @@ -437,14 +437,14 @@ public _FinalStage name(String name) { /** *

A human-readable label to identify the authentication method.

*/ - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public CreateUserAuthenticationMethodRequestContent build() { return new CreateUserAuthenticationMethodRequestContent( type, diff --git a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java index ef12ad7c5..a422a33db 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/CreateUserPermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateUserPermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(CreateUserPermissionsRequestContent other) { return permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java index dadbab59a..2bffd3434 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserPermissionsRequestContent.java @@ -40,7 +40,7 @@ public List getPermissions() { return permissions; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserPermissionsRequestContent @@ -56,12 +56,12 @@ private boolean equalTo(DeleteUserPermissionsRequestContent other) { return permissions.equals(other.permissions); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.permissions); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java index 158dd392b..09a108eae 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/DeleteUserRolesRequestContent.java @@ -38,7 +38,7 @@ public List getRoles() { return roles; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeleteUserRolesRequestContent && equalTo((DeleteUserRolesRequestContent) other); @@ -53,12 +53,12 @@ private boolean equalTo(DeleteUserRolesRequestContent other) { return roles.equals(other.roles); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.roles); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java index d0d0bcd3a..e57ece646 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/GetUserConnectedAccountsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof GetUserConnectedAccountsRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(GetUserConnectedAccountsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java index 6437f04d6..0bbdb78b4 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/LinkUserIdentityRequestContent.java @@ -71,7 +71,7 @@ public Optional getLinkWith() { return linkWith; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LinkUserIdentityRequestContent && equalTo((LinkUserIdentityRequestContent) other); @@ -89,12 +89,12 @@ private boolean equalTo(LinkUserIdentityRequestContent other) { && linkWith.equals(other.linkWith); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.provider, this.connectionId, this.userId, this.linkWith); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java index 9cd82609d..1b9177d8b 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListRefreshTokensRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListRefreshTokensRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListRefreshTokensRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java index b4a33d71c..00fc7d1da 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserAuthenticationMethodsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserAuthenticationMethodsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListUserAuthenticationMethodsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java index 2127624f8..fa4a45aef 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserLogsRequestParameters.java @@ -91,7 +91,7 @@ private OptionalNullable _getSort() { return sort; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserLogsRequestParameters && equalTo((ListUserLogsRequestParameters) other); @@ -109,12 +109,12 @@ private boolean equalTo(ListUserLogsRequestParameters other) { && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.sort, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java index 138355baa..31ad9a385 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserOrganizationsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserOrganizationsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListUserOrganizationsRequestParameters other) { return page.equals(other.page) && perPage.equals(other.perPage) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.perPage, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java index 9eb322941..de68b9be7 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserPermissionsRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserPermissionsRequestParameters @@ -85,12 +85,12 @@ private boolean equalTo(ListUserPermissionsRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java index 772bb4b54..4b2114ea6 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserRolesRequestParameters.java @@ -69,7 +69,7 @@ public OptionalNullable getIncludeTotals() { return includeTotals; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserRolesRequestParameters && equalTo((ListUserRolesRequestParameters) other); @@ -84,12 +84,12 @@ private boolean equalTo(ListUserRolesRequestParameters other) { return perPage.equals(other.perPage) && page.equals(other.page) && includeTotals.equals(other.includeTotals); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.perPage, this.page, this.includeTotals); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java index 1db8761f3..6238eeb0c 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/ListUserSessionsRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListUserSessionsRequestParameters && equalTo((ListUserSessionsRequestParameters) other); @@ -78,12 +78,12 @@ private boolean equalTo(ListUserSessionsRequestParameters other) { return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java index fe9b6b6a3..981906ce3 100644 --- a/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/users/types/UpdateUserAuthenticationMethodRequestContent.java @@ -49,7 +49,7 @@ public Optional getPreferredAuthenticationMet return preferredAuthenticationMethod; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateUserAuthenticationMethodRequestContent @@ -65,12 +65,12 @@ private boolean equalTo(UpdateUserAuthenticationMethodRequestContent other) { return name.equals(other.name) && preferredAuthenticationMethod.equals(other.preferredAuthenticationMethod); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.preferredAuthenticationMethod); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java index 655045dea..16c40a488 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/CreateVerifiableCredentialTemplateRequestContent.java @@ -83,7 +83,7 @@ public String getWellKnownTrustedIssuers() { return wellKnownTrustedIssuers; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof CreateVerifiableCredentialTemplateRequestContent @@ -104,7 +104,7 @@ private boolean equalTo(CreateVerifiableCredentialTemplateRequestContent other) && wellKnownTrustedIssuers.equals(other.wellKnownTrustedIssuers); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -115,7 +115,7 @@ public int hashCode() { this.wellKnownTrustedIssuers); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -179,7 +179,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(CreateVerifiableCredentialTemplateRequestContent other) { name(other.getName()); type(other.getType()); @@ -190,35 +190,35 @@ public Builder from(CreateVerifiableCredentialTemplateRequestContent other) { return this; } - @Override + @java.lang.Override @JsonSetter("name") public TypeStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("type") public DialectStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("dialect") public PresentationStage dialect(@NotNull String dialect) { this.dialect = Objects.requireNonNull(dialect, "dialect must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("presentation") public WellKnownTrustedIssuersStage presentation(@NotNull MdlPresentationRequest presentation) { this.presentation = Objects.requireNonNull(presentation, "presentation must not be null"); return this; } - @Override + @java.lang.Override @JsonSetter("well_known_trusted_issuers") public _FinalStage wellKnownTrustedIssuers(@NotNull String wellKnownTrustedIssuers) { this.wellKnownTrustedIssuers = @@ -226,20 +226,20 @@ public _FinalStage wellKnownTrustedIssuers(@NotNull String wellKnownTrustedIssue return this; } - @Override + @java.lang.Override public _FinalStage customCertificateAuthority(String customCertificateAuthority) { this.customCertificateAuthority = Optional.ofNullable(customCertificateAuthority); return this; } - @Override + @java.lang.Override @JsonSetter(value = "custom_certificate_authority", nulls = Nulls.SKIP) public _FinalStage customCertificateAuthority(Optional customCertificateAuthority) { this.customCertificateAuthority = customCertificateAuthority; return this; } - @Override + @java.lang.Override public CreateVerifiableCredentialTemplateRequestContent build() { return new CreateVerifiableCredentialTemplateRequestContent( name, diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java index 5e6f73518..ada4bfbdd 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/ListVerifiableCredentialTemplatesRequestParameters.java @@ -63,7 +63,7 @@ private OptionalNullable _getFrom() { return from; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ListVerifiableCredentialTemplatesRequestParameters @@ -79,12 +79,12 @@ private boolean equalTo(ListVerifiableCredentialTemplatesRequestParameters other return from.equals(other.from) && take.equals(other.take); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.from, this.take); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java index 03274a62d..354237b36 100644 --- a/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/verifiablecredentials/verification/types/UpdateVerifiableCredentialTemplateRequestContent.java @@ -82,7 +82,7 @@ public Optional getVersion() { return version; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UpdateVerifiableCredentialTemplateRequestContent @@ -103,13 +103,13 @@ private boolean equalTo(UpdateVerifiableCredentialTemplateRequestContent other) && version.equals(other.version); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, this.type, this.dialect, this.presentation, this.wellKnownTrustedIssuers, this.version); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java index 1e979c6fb..d64e631bd 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsVersionsWireTest.java @@ -43,7 +43,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"versions\":[{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]}]}")); + "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"versions\":[{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}],\"modules\":[{}]}]}")); SyncPagingIterable response = client.actions() .versions() .list( @@ -68,7 +68,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); GetActionVersionResponseContent response = client.actions().versions().get("actionId", "id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -138,6 +138,14 @@ public void testGet() throws Exception { + " ],\n" + " \"binding_policy\": \"trigger-bound\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -177,7 +185,7 @@ public void testDeploy() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); DeployActionVersionResponseContent response = client.actions().versions().deploy("actionId", "id", OptionalNullable.absent()); RecordedRequest request = server.takeRequest(); @@ -248,6 +256,14 @@ public void testDeploy() throws Exception { + " ],\n" + " \"binding_policy\": \"trigger-bound\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); diff --git a/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java index 75fda4da9..d954f74b0 100644 --- a/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ActionsWireTest.java @@ -53,7 +53,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"actions\":[{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{}],\"runtime\":\"runtime\",\"secrets\":[{}],\"installed_integration_id\":\"installed_integration_id\",\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}]}")); + "{\"total\":1.1,\"page\":1.1,\"per_page\":1.1,\"actions\":[{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{}],\"runtime\":\"runtime\",\"secrets\":[{}],\"installed_integration_id\":\"installed_integration_id\",\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true,\"modules\":[{}]}]}")); SyncPagingIterable response = client.actions() .list(ListActionsRequestParameters.builder() .triggerId(OptionalNullable.of("triggerId")) @@ -79,7 +79,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}],\"modules\":[{}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true,\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); CreateActionResponseContent response = client.actions() .create(CreateActionRequestContent.builder() .name("name") @@ -206,6 +206,9 @@ else if (actualJson.has("kind")) + " {\n" + " \"id\": \"id\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {}\n" + " ]\n" + " },\n" + " \"installed_integration_id\": \"installed_integration_id\",\n" @@ -239,7 +242,15 @@ else if (actualJson.has("kind")) + " },\n" + " \"status\": \"pending\",\n" + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"deploy\": true\n" + + " \"deploy\": true,\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -278,7 +289,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}],\"modules\":[{}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true,\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); GetActionResponseContent response = client.actions().get("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -363,6 +374,9 @@ public void testGet() throws Exception { + " {\n" + " \"id\": \"id\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {}\n" + " ]\n" + " },\n" + " \"installed_integration_id\": \"installed_integration_id\",\n" @@ -396,7 +410,15 @@ public void testGet() throws Exception { + " },\n" + " \"status\": \"pending\",\n" + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"deploy\": true\n" + + " \"deploy\": true,\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -449,7 +471,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true}")); + "{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"deployed_version\":{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\"}],\"modules\":[{}]},\"installed_integration_id\":\"installed_integration_id\",\"integration\":{\"id\":\"id\",\"catalog_id\":\"catalog_id\",\"url_slug\":\"url_slug\",\"partner_id\":\"partner_id\",\"name\":\"name\",\"description\":\"description\",\"short_description\":\"short_description\",\"logo\":\"logo\",\"feature_type\":\"unspecified\",\"terms_of_use_url\":\"terms_of_use_url\",\"privacy_policy_url\":\"privacy_policy_url\",\"public_support_link\":\"public_support_link\",\"current_release\":{\"id\":\"id\",\"trigger\":{\"id\":\"id\"},\"required_secrets\":[{}],\"required_configuration\":[{}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"status\":\"pending\",\"built_at\":\"2024-01-15T09:30:00Z\",\"deploy\":true,\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); UpdateActionResponseContent response = client.actions() .update("id", UpdateActionRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -564,6 +586,9 @@ else if (actualJson.has("kind")) + " {\n" + " \"id\": \"id\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {}\n" + " ]\n" + " },\n" + " \"installed_integration_id\": \"installed_integration_id\",\n" @@ -597,7 +622,15 @@ else if (actualJson.has("kind")) + " },\n" + " \"status\": \"pending\",\n" + " \"built_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"deploy\": true\n" + + " \"deploy\": true,\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -636,7 +669,7 @@ public void testDeploy() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}]}")); + "{\"id\":\"id\",\"action_id\":\"action_id\",\"code\":\"code\",\"dependencies\":[{\"name\":\"name\",\"version\":\"version\",\"registry_url\":\"registry_url\"}],\"deployed\":true,\"runtime\":\"runtime\",\"secrets\":[{\"name\":\"name\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"status\":\"pending\",\"number\":1.1,\"errors\":[{\"id\":\"id\",\"msg\":\"msg\",\"url\":\"url\"}],\"action\":{\"id\":\"id\",\"name\":\"name\",\"supported_triggers\":[{\"id\":\"id\"}],\"all_changes_deployed\":true,\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"},\"built_at\":\"2024-01-15T09:30:00Z\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"supported_triggers\":[{\"id\":\"id\",\"version\":\"version\",\"status\":\"status\",\"runtimes\":[\"runtimes\"],\"default_runtime\":\"default_runtime\",\"compatible_triggers\":[{\"id\":\"id\",\"version\":\"version\"}],\"binding_policy\":\"trigger-bound\"}],\"modules\":[{\"module_id\":\"module_id\",\"module_name\":\"module_name\",\"module_version_id\":\"module_version_id\",\"module_version_number\":1}]}")); DeployActionResponseContent response = client.actions().deploy("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -706,6 +739,14 @@ public void testDeploy() throws Exception { + " ],\n" + " \"binding_policy\": \"trigger-bound\"\n" + " }\n" + + " ],\n" + + " \"modules\": [\n" + + " {\n" + + " \"module_id\": \"module_id\",\n" + + " \"module_name\": \"module_name\",\n" + + " \"module_version_id\": \"module_version_id\",\n" + + " \"module_version_number\": 1\n" + + " }\n" + " ]\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); diff --git a/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java index 2649577d9..b3b32b587 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientsWireTest.java @@ -77,7 +77,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true,\"policies\":[{\"audience\":\"audience\",\"scope\":[\"scope\"]}]},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); CreateClientResponseContent response = client.clients() .create(CreateClientRequestContent.builder().name("name").build()); RecordedRequest request = server.takeRequest(); @@ -377,7 +377,15 @@ else if (actualJson.has("kind")) + " \"token_lifetime\": 1,\n" + " \"infinite_token_lifetime\": true,\n" + " \"idle_token_lifetime\": 1,\n" - + " \"infinite_idle_token_lifetime\": true\n" + + " \"infinite_idle_token_lifetime\": true,\n" + + " \"policies\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ]\n" + + " }\n" + + " ]\n" + " },\n" + " \"default_organization\": {\n" + " \"organization_id\": \"organization_id\",\n" @@ -495,7 +503,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true,\"policies\":[{\"audience\":\"audience\",\"scope\":[\"scope\"]}]},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); GetClientResponseContent response = client.clients() .get( "id", @@ -771,7 +779,15 @@ public void testGet() throws Exception { + " \"token_lifetime\": 1,\n" + " \"infinite_token_lifetime\": true,\n" + " \"idle_token_lifetime\": 1,\n" - + " \"infinite_idle_token_lifetime\": true\n" + + " \"infinite_idle_token_lifetime\": true,\n" + + " \"policies\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ]\n" + + " }\n" + + " ]\n" + " },\n" + " \"default_organization\": {\n" + " \"organization_id\": \"organization_id\",\n" @@ -898,7 +914,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true,\"policies\":[{\"audience\":\"audience\",\"scope\":[\"scope\"]}]},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); UpdateClientResponseContent response = client.clients() .update("id", UpdateClientRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -1198,7 +1214,15 @@ else if (actualJson.has("kind")) + " \"token_lifetime\": 1,\n" + " \"infinite_token_lifetime\": true,\n" + " \"idle_token_lifetime\": 1,\n" - + " \"infinite_idle_token_lifetime\": true\n" + + " \"infinite_idle_token_lifetime\": true,\n" + + " \"policies\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ]\n" + + " }\n" + + " ]\n" + " },\n" + " \"default_organization\": {\n" + " \"organization_id\": \"organization_id\",\n" @@ -1316,7 +1340,7 @@ public void testRotateSecret() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); + "{\"client_id\":\"client_id\",\"tenant\":\"tenant\",\"name\":\"name\",\"description\":\"description\",\"global\":true,\"client_secret\":\"client_secret\",\"app_type\":\"native\",\"logo_uri\":\"logo_uri\",\"is_first_party\":true,\"oidc_conformant\":true,\"callbacks\":[\"callbacks\"],\"allowed_origins\":[\"allowed_origins\"],\"web_origins\":[\"web_origins\"],\"client_aliases\":[\"client_aliases\"],\"allowed_clients\":[\"allowed_clients\"],\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_transfer\":{\"can_create_session_transfer_token\":true,\"enforce_cascade_revocation\":true,\"allowed_authentication_methods\":[\"cookie\"],\"enforce_device_binding\":\"ip\",\"allow_refresh_token\":true,\"enforce_online_refresh_tokens\":true},\"oidc_logout\":{\"backchannel_logout_urls\":[\"backchannel_logout_urls\"],\"backchannel_logout_initiators\":{\"mode\":\"custom\",\"selected_initiators\":[\"rp-logout\"]},\"backchannel_logout_session_metadata\":{\"include\":true}},\"grant_types\":[\"grant_types\"],\"jwt_configuration\":{\"lifetime_in_seconds\":1,\"secret_encoded\":true,\"scopes\":{\"key\":\"value\"},\"alg\":\"HS256\"},\"signing_keys\":[{\"pkcs7\":\"pkcs7\",\"cert\":\"cert\",\"subject\":\"subject\"}],\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\",\"subject\":\"subject\"},\"sso\":true,\"sso_disabled\":true,\"cross_origin_authentication\":true,\"cross_origin_loc\":\"cross_origin_loc\",\"custom_login_page_on\":true,\"custom_login_page\":\"custom_login_page\",\"custom_login_page_preview\":\"custom_login_page_preview\",\"form_template\":\"form_template\",\"addons\":{\"aws\":{\"principal\":\"principal\",\"role\":\"role\",\"lifetime_in_seconds\":1},\"azure_blob\":{\"accountName\":\"accountName\",\"storageAccessKey\":\"storageAccessKey\",\"containerName\":\"containerName\",\"blobName\":\"blobName\",\"expiration\":1,\"signedIdentifier\":\"signedIdentifier\",\"blob_read\":true,\"blob_write\":true,\"blob_delete\":true,\"container_read\":true,\"container_write\":true,\"container_delete\":true,\"container_list\":true},\"azure_sb\":{\"namespace\":\"namespace\",\"sasKeyName\":\"sasKeyName\",\"sasKey\":\"sasKey\",\"entityPath\":\"entityPath\",\"expiration\":1},\"rms\":{\"url\":\"url\"},\"mscrm\":{\"url\":\"url\"},\"slack\":{\"team\":\"team\"},\"sentry\":{\"org_slug\":\"org_slug\",\"base_url\":\"base_url\"},\"box\":{\"key\":\"value\"},\"cloudbees\":{\"key\":\"value\"},\"concur\":{\"key\":\"value\"},\"dropbox\":{\"key\":\"value\"},\"echosign\":{\"domain\":\"domain\"},\"egnyte\":{\"domain\":\"domain\"},\"firebase\":{\"secret\":\"secret\",\"private_key_id\":\"private_key_id\",\"private_key\":\"private_key\",\"client_email\":\"client_email\",\"lifetime_in_seconds\":1},\"newrelic\":{\"account\":\"account\"},\"office365\":{\"domain\":\"domain\",\"connection\":\"connection\"},\"salesforce\":{\"entity_id\":\"entity_id\"},\"salesforce_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"salesforce_sandbox_api\":{\"clientid\":\"clientid\",\"principal\":\"principal\",\"communityName\":\"communityName\",\"community_url_section\":\"community_url_section\"},\"samlp\":{\"mappings\":{\"key\":\"value\"},\"audience\":\"audience\",\"recipient\":\"recipient\",\"createUpnClaim\":true,\"mapUnknownClaimsAsIs\":true,\"passthroughClaimsWithNoMapping\":true,\"mapIdentities\":true,\"signatureAlgorithm\":\"signatureAlgorithm\",\"digestAlgorithm\":\"digestAlgorithm\",\"issuer\":\"issuer\",\"destination\":\"destination\",\"lifetimeInSeconds\":1,\"signResponse\":true,\"nameIdentifierFormat\":\"nameIdentifierFormat\",\"nameIdentifierProbes\":[\"nameIdentifierProbes\"],\"authnContextClassRef\":\"authnContextClassRef\"},\"layer\":{\"providerId\":\"providerId\",\"keyId\":\"keyId\",\"privateKey\":\"privateKey\",\"principal\":\"principal\",\"expiration\":1},\"sap_api\":{\"clientid\":\"clientid\",\"usernameAttribute\":\"usernameAttribute\",\"tokenEndpointUrl\":\"tokenEndpointUrl\",\"scope\":\"scope\",\"servicePassword\":\"servicePassword\",\"nameIdentifierFormat\":\"nameIdentifierFormat\"},\"sharepoint\":{\"url\":\"url\",\"external_url\":[\"external_url\"]},\"springcm\":{\"acsurl\":\"acsurl\"},\"wams\":{\"masterkey\":\"masterkey\"},\"wsfed\":{\"key\":\"value\"},\"zendesk\":{\"accountName\":\"accountName\"},\"zoom\":{\"account\":\"account\"},\"sso_integration\":{\"name\":\"name\",\"version\":\"version\"}},\"token_endpoint_auth_method\":\"none\",\"is_token_endpoint_ip_header_trusted\":true,\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"app_package_name\",\"sha256_cert_fingerprints\":[\"sha256_cert_fingerprints\"]},\"ios\":{\"team_id\":\"team_id\",\"app_bundle_identifier\":\"app_bundle_identifier\"}},\"initiate_login_uri\":\"initiate_login_uri\",\"refresh_token\":{\"rotation_type\":\"rotating\",\"expiration_type\":\"expiring\",\"leeway\":1,\"token_lifetime\":1,\"infinite_token_lifetime\":true,\"idle_token_lifetime\":1,\"infinite_idle_token_lifetime\":true,\"policies\":[{\"audience\":\"audience\",\"scope\":[\"scope\"]}]},\"default_organization\":{\"organization_id\":\"organization_id\",\"flows\":[\"client_credentials\"]},\"organization_usage\":\"deny\",\"organization_require_behavior\":\"no_prompt\",\"organization_discovery_methods\":[\"email\"],\"client_authentication_methods\":{\"private_key_jwt\":{\"credentials\":[{\"id\":\"id\"}]},\"tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]},\"self_signed_tls_client_auth\":{\"credentials\":[{\"id\":\"id\"}]}},\"require_pushed_authorization_requests\":true,\"require_proof_of_possession\":true,\"signed_request_object\":{\"required\":true,\"credentials\":[{\"id\":\"id\"}]},\"compliance_level\":\"none\",\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"token_exchange\":{\"allow_any_profile_of_type\":[\"custom_authentication\"]},\"par_request_expiry\":1,\"token_quota\":{\"client_credentials\":{\"enforce\":true,\"per_day\":1,\"per_hour\":1}},\"express_configuration\":{\"initiate_login_uri_template\":\"initiate_login_uri_template\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"connection_profile_id\":\"connection_profile_id\",\"enable_client\":true,\"enable_organization\":true,\"linked_clients\":[{\"client_id\":\"client_id\"}],\"okta_oin_client_id\":\"okta_oin_client_id\",\"admin_login_domain\":\"admin_login_domain\",\"oin_submission_id\":\"oin_submission_id\"},\"resource_server_identifier\":\"resource_server_identifier\",\"async_approval_notification_channels\":[\"guardian-push\"]}")); RotateClientSecretResponseContent response = client.clients().rotateSecret("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -1586,7 +1610,15 @@ public void testRotateSecret() throws Exception { + " \"token_lifetime\": 1,\n" + " \"infinite_token_lifetime\": true,\n" + " \"idle_token_lifetime\": 1,\n" - + " \"infinite_idle_token_lifetime\": true\n" + + " \"infinite_idle_token_lifetime\": true,\n" + + " \"policies\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scope\": [\n" + + " \"scope\"\n" + + " ]\n" + + " }\n" + + " ]\n" + " },\n" + " \"default_organization\": {\n" + " \"organization_id\": \"organization_id\",\n" diff --git a/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java index 59fc66f48..d9b0cc758 100644 --- a/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/CustomDomainsWireTest.java @@ -52,8 +52,6 @@ public void testList() throws Exception { "[{\"custom_domain_id\":\"custom_domain_id\",\"domain\":\"domain\",\"primary\":true,\"status\":\"pending_verification\",\"type\":\"auth0_managed_certs\",\"origin_domain_name\":\"origin_domain_name\",\"verification\":{\"methods\":[{\"name\":\"cname\",\"record\":\"record\"}],\"status\":\"verified\",\"error_msg\":\"error_msg\",\"last_verified_at\":\"last_verified_at\"},\"custom_client_ip_header\":\"custom_client_ip_header\",\"tls_policy\":\"tls_policy\",\"domain_metadata\":{\"key\":\"value\"},\"certificate\":{\"status\":\"provisioning\",\"error_msg\":\"error_msg\",\"certificate_authority\":\"letsencrypt\",\"renews_before\":\"renews_before\"}}]")); List response = client.customDomains() .list(ListCustomDomainsRequestParameters.builder() - .take(OptionalNullable.of(1)) - .from(OptionalNullable.of("from")) .q(OptionalNullable.of("q")) .fields(OptionalNullable.of("fields")) .includeFields(OptionalNullable.of(true)) diff --git a/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java index d725581be..2a16a94e7 100644 --- a/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/EventStreamsWireTest.java @@ -6,7 +6,6 @@ import com.auth0.client.mgmt.types.CreateEventStreamTestEventRequestContent; import com.auth0.client.mgmt.types.CreateEventStreamTestEventResponseContent; import com.auth0.client.mgmt.types.CreateEventStreamWebHookRequestContent; -import com.auth0.client.mgmt.types.EventStreamResponseContent; import com.auth0.client.mgmt.types.EventStreamTestEventTypeEnum; import com.auth0.client.mgmt.types.EventStreamWebhookAuthorizationResponse; import com.auth0.client.mgmt.types.EventStreamWebhookBasicAuth; @@ -15,11 +14,11 @@ import com.auth0.client.mgmt.types.EventStreamsCreateRequest; import com.auth0.client.mgmt.types.GetEventStreamResponseContent; import com.auth0.client.mgmt.types.ListEventStreamsRequestParameters; +import com.auth0.client.mgmt.types.ListEventStreamsResponseContent; import com.auth0.client.mgmt.types.UpdateEventStreamRequestContent; import com.auth0.client.mgmt.types.UpdateEventStreamResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.List; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; @@ -54,8 +53,8 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "[{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]")); - List response = client.eventStreams() + "{\"eventStreams\":[{\"id\":\"id\",\"name\":\"name\",\"subscriptions\":[{}],\"destination\":{\"type\":\"webhook\",\"configuration\":{\"webhook_endpoint\":\"webhook_endpoint\",\"webhook_authorization\":{\"method\":\"basic\",\"username\":\"username\"}}},\"status\":\"enabled\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); + ListEventStreamsResponseContent response = client.eventStreams() .list(ListEventStreamsRequestParameters.builder() .from(OptionalNullable.of("from")) .take(OptionalNullable.of(1)) @@ -68,28 +67,30 @@ public void testList() throws Exception { Assertions.assertNotNull(response, "Response should not be null"); String actualResponseJson = objectMapper.writeValueAsString(response); String expectedResponseBody = "" - + "[\n" - + " {\n" - + " \"id\": \"id\",\n" - + " \"name\": \"name\",\n" - + " \"subscriptions\": [\n" - + " {}\n" - + " ],\n" - + " \"destination\": {\n" - + " \"type\": \"webhook\",\n" - + " \"configuration\": {\n" - + " \"webhook_endpoint\": \"webhook_endpoint\",\n" - + " \"webhook_authorization\": {\n" - + " \"method\": \"basic\",\n" - + " \"username\": \"username\"\n" + + "{\n" + + " \"eventStreams\": [\n" + + " {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"name\",\n" + + " \"subscriptions\": [\n" + + " {}\n" + + " ],\n" + + " \"destination\": {\n" + + " \"type\": \"webhook\",\n" + + " \"configuration\": {\n" + + " \"webhook_endpoint\": \"webhook_endpoint\",\n" + + " \"webhook_authorization\": {\n" + + " \"method\": \"basic\",\n" + + " \"username\": \"username\"\n" + + " }\n" + " }\n" - + " }\n" - + " },\n" - + " \"status\": \"enabled\",\n" - + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" - + " }\n" - + "]"; + + " },\n" + + " \"status\": \"enabled\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" + + " }\n" + + " ]\n" + + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); Assertions.assertTrue( diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java index 30dd24270..ae863823d 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPushNotificationWireTest.java @@ -1,19 +1,23 @@ package com.auth0.client.mgmt; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationRequestContent; import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPushNotificationSnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationApnsRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmRequestContent; +import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.guardian.factors.types.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderApnsResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.GetGuardianFactorsProviderSnsResponseContent; import com.auth0.client.mgmt.types.GuardianFactorsProviderPushNotificationProviderDataEnum; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsRequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationApnsResponseContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmRequestContent; -import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationResponseContent; import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPushNotificationSnsResponseContent; +import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationApnsResponseContent; import com.auth0.client.mgmt.types.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -108,6 +112,83 @@ public void testSetApnsProvider() throws Exception { .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"sandbox\": true,\n" + " \"bundle_id\": \"bundle_id\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateApnsProvider() throws Exception { + server.enqueue( + new MockResponse().setResponseCode(200).setBody("{\"sandbox\":true,\"bundle_id\":\"bundle_id\"}")); + UpdateGuardianFactorsProviderPushNotificationApnsResponseContent response = client.guardian() + .factors() + .pushNotification() + .updateApnsProvider(UpdateGuardianFactorsProviderPushNotificationApnsRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod()); // Validate request body String actualRequestBody = request.getBody().readUtf8(); @@ -184,6 +265,82 @@ public void testSetFcmProvider() throws Exception { .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateFcmProvider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.guardian() + .factors() + .pushNotification() + .updateFcmProvider(UpdateGuardianFactorsProviderPushNotificationFcmRequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod()); // Validate request body String actualRequestBody = request.getBody().readUtf8(); @@ -260,6 +417,82 @@ public void testSetFcmv1Provider() throws Exception { .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"key\": \"value\"\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testUpdateFcmv1Provider() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"key\":\"value\"}")); + Map response = client.guardian() + .factors() + .pushNotification() + .updateFcmv1Provider(UpdateGuardianFactorsProviderPushNotificationFcmv1RequestContent.builder() + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod()); // Validate request body String actualRequestBody = request.getBody().readUtf8(); @@ -688,9 +921,9 @@ private boolean jsonEquals(JsonNode expected, JsonNode actual) { if (expected.isNumber() && actual.isNumber()) return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - Map.Entry entry = iter.next(); + java.util.Map.Entry entry = iter.next(); JsonNode actualValue = actual.get(entry.getKey()); if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } diff --git a/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java index 5126655cf..e20e59e05 100644 --- a/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/HooksSecretsWireTest.java @@ -211,9 +211,9 @@ private boolean jsonEquals(JsonNode expected, JsonNode actual) { if (expected.isNumber() && actual.isNumber()) return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - Map.Entry entry = iter.next(); + java.util.Map.Entry entry = iter.next(); JsonNode actualValue = actual.get(entry.getKey()); if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java index fa9a3eb8b..895582f10 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsDiscoveryDomainsWireTest.java @@ -7,6 +7,7 @@ import com.auth0.client.mgmt.organizations.types.ListOrganizationDiscoveryDomainsRequestParameters; import com.auth0.client.mgmt.organizations.types.UpdateOrganizationDiscoveryDomainRequestContent; import com.auth0.client.mgmt.types.CreateOrganizationDiscoveryDomainResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainByNameResponseContent; import com.auth0.client.mgmt.types.GetOrganizationDiscoveryDomainResponseContent; import com.auth0.client.mgmt.types.OrganizationDiscoveryDomain; import com.auth0.client.mgmt.types.UpdateOrganizationDiscoveryDomainResponseContent; @@ -46,7 +47,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"next\":\"next\",\"domains\":[{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}]}")); + "{\"next\":\"next\",\"domains\":[{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"use_for_organization_discovery\":true,\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}]}")); SyncPagingIterable response = client.organizations() .discoveryDomains() .list( @@ -71,7 +72,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"use_for_organization_discovery\":true,\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); CreateOrganizationDiscoveryDomainResponseContent response = client.organizations() .discoveryDomains() .create( @@ -120,6 +121,63 @@ else if (actualJson.has("kind")) + " \"id\": \"id\",\n" + " \"domain\": \"domain\",\n" + " \"status\": \"pending\",\n" + + " \"use_for_organization_discovery\": true,\n" + + " \"verification_txt\": \"verification_txt\",\n" + + " \"verification_host\": \"verification_host\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGetByName() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"use_for_organization_discovery\":true,\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + GetOrganizationDiscoveryDomainByNameResponseContent response = + client.organizations().discoveryDomains().getByName("id", "discovery_domain"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"domain\": \"domain\",\n" + + " \"status\": \"pending\",\n" + + " \"use_for_organization_discovery\": true,\n" + " \"verification_txt\": \"verification_txt\",\n" + " \"verification_host\": \"verification_host\"\n" + "}"; @@ -160,7 +218,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"use_for_organization_discovery\":true,\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); GetOrganizationDiscoveryDomainResponseContent response = client.organizations().discoveryDomains().get("id", "discovery_domain_id"); RecordedRequest request = server.takeRequest(); @@ -175,6 +233,7 @@ public void testGet() throws Exception { + " \"id\": \"id\",\n" + " \"domain\": \"domain\",\n" + " \"status\": \"pending\",\n" + + " \"use_for_organization_discovery\": true,\n" + " \"verification_txt\": \"verification_txt\",\n" + " \"verification_host\": \"verification_host\"\n" + "}"; @@ -224,7 +283,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); + "{\"id\":\"id\",\"domain\":\"domain\",\"status\":\"pending\",\"use_for_organization_discovery\":true,\"verification_txt\":\"verification_txt\",\"verification_host\":\"verification_host\"}")); UpdateOrganizationDiscoveryDomainResponseContent response = client.organizations() .discoveryDomains() .update( @@ -273,6 +332,7 @@ else if (actualJson.has("kind")) + " \"id\": \"id\",\n" + " \"domain\": \"domain\",\n" + " \"status\": \"pending\",\n" + + " \"use_for_organization_discovery\": true,\n" + " \"verification_txt\": \"verification_txt\",\n" + " \"verification_host\": \"verification_host\"\n" + "}"; diff --git a/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java index 31424a98e..fe2c30fef 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsCustomTextWireTest.java @@ -135,9 +135,9 @@ private boolean jsonEquals(JsonNode expected, JsonNode actual) { if (expected.isNumber() && actual.isNumber()) return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - Map.Entry entry = iter.next(); + java.util.Map.Entry entry = iter.next(); JsonNode actualValue = actual.get(entry.getKey()); if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } diff --git a/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java index 8c6b7d5a5..ebf84dab8 100644 --- a/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/PromptsPartialsWireTest.java @@ -131,9 +131,9 @@ private boolean jsonEquals(JsonNode expected, JsonNode actual) { if (expected.isNumber() && actual.isNumber()) return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - Map.Entry entry = iter.next(); + java.util.Map.Entry entry = iter.next(); JsonNode actualValue = actual.get(entry.getKey()); if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } diff --git a/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java index 17e3333ae..f77c1163f 100644 --- a/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/RefreshTokensWireTest.java @@ -2,6 +2,8 @@ import com.auth0.client.mgmt.core.ObjectMappers; import com.auth0.client.mgmt.types.GetRefreshTokenResponseContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenRequestContent; +import com.auth0.client.mgmt.types.UpdateRefreshTokenResponseContent; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import okhttp3.mockwebserver.MockResponse; @@ -38,7 +40,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"initial_user_agent\":\"initial_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\",\"last_user_agent\":\"last_user_agent\"},\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{\"audience\":\"audience\",\"scopes\":\"scopes\"}],\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}")); + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"initial_user_agent\":\"initial_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\",\"last_user_agent\":\"last_user_agent\"},\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{\"audience\":\"audience\",\"scopes\":\"scopes\"}],\"refresh_token_metadata\":{\"key\":\"value\"},\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}")); GetRefreshTokenResponseContent response = client.refreshTokens().get("id"); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); @@ -71,6 +73,9 @@ public void testGet() throws Exception { + " \"scopes\": \"scopes\"\n" + " }\n" + " ],\n" + + " \"refresh_token_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + " \"last_exchanged_at\": \"2024-01-15T09:30:00Z\"\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); @@ -113,6 +118,111 @@ public void testDelete() throws Exception { Assertions.assertEquals("DELETE", request.getMethod()); } + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"device\":{\"initial_ip\":\"initial_ip\",\"initial_asn\":\"initial_asn\",\"initial_user_agent\":\"initial_user_agent\",\"last_ip\":\"last_ip\",\"last_asn\":\"last_asn\",\"last_user_agent\":\"last_user_agent\"},\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{\"audience\":\"audience\",\"scopes\":\"scopes\"}],\"refresh_token_metadata\":{\"key\":\"value\"},\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateRefreshTokenResponseContent response = client.refreshTokens() + .update("id", UpdateRefreshTokenRequestContent.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"id\": \"id\",\n" + + " \"user_id\": \"user_id\",\n" + + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"idle_expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"expires_at\": \"2024-01-15T09:30:00Z\",\n" + + " \"device\": {\n" + + " \"initial_ip\": \"initial_ip\",\n" + + " \"initial_asn\": \"initial_asn\",\n" + + " \"initial_user_agent\": \"initial_user_agent\",\n" + + " \"last_ip\": \"last_ip\",\n" + + " \"last_asn\": \"last_asn\",\n" + + " \"last_user_agent\": \"last_user_agent\"\n" + + " },\n" + + " \"client_id\": \"client_id\",\n" + + " \"session_id\": \"session_id\",\n" + + " \"rotating\": true,\n" + + " \"resource_servers\": [\n" + + " {\n" + + " \"audience\": \"audience\",\n" + + " \"scopes\": \"scopes\"\n" + + " }\n" + + " ],\n" + + " \"refresh_token_metadata\": {\n" + + " \"key\": \"value\"\n" + + " },\n" + + " \"last_exchanged_at\": \"2024-01-15T09:30:00Z\"\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + /** * Compares two JsonNodes with numeric equivalence and null safety. * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java index 73a436dfa..80f763af2 100644 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesCustomTextWireTest.java @@ -166,9 +166,9 @@ private boolean jsonEquals(JsonNode expected, JsonNode actual) { if (expected.isNumber() && actual.isNumber()) return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); + java.util.Iterator> iter = expected.fields(); while (iter.hasNext()) { - Map.Entry entry = iter.next(); + java.util.Map.Entry entry = iter.next(); JsonNode actualValue = actual.get(entry.getKey()); if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; } diff --git a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java b/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java deleted file mode 100644 index 8b1378917..000000000 --- a/src/test/java/com/auth0/client/mgmt/SelfServiceProfilesEntityTest.java +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java index e347138ef..31c5e1d2f 100644 --- a/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/TenantsSettingsWireTest.java @@ -42,7 +42,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\"}")); + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\",\"enable_ai_guide\":true}")); GetTenantSettingsResponseContent response = client.tenants() .settings() .get(GetTenantSettingsRequestParameters.builder() @@ -156,7 +156,8 @@ public void testGet() throws Exception { + " \"pushed_authorization_requests_supported\": true,\n" + " \"authorization_response_iss_parameter_supported\": true,\n" + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" - + " \"resource_parameter_profile\": \"audience\"\n" + + " \"resource_parameter_profile\": \"audience\",\n" + + " \"enable_ai_guide\": true\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); @@ -195,7 +196,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\"}")); + "{\"change_password\":{\"enabled\":true,\"html\":\"html\"},\"guardian_mfa_page\":{\"enabled\":true,\"html\":\"html\"},\"default_audience\":\"default_audience\",\"default_directory\":\"default_directory\",\"error_page\":{\"html\":\"html\",\"show_log_link\":true,\"url\":\"url\"},\"device_flow\":{\"charset\":\"base20\",\"mask\":\"mask\"},\"default_token_quota\":{\"clients\":{\"client_credentials\":{}},\"organizations\":{\"client_credentials\":{}}},\"flags\":{\"change_pwd_flow_v1\":true,\"enable_apis_section\":true,\"disable_impersonation\":true,\"enable_client_connections\":true,\"enable_pipeline2\":true,\"allow_legacy_delegation_grant_types\":true,\"allow_legacy_ro_grant_types\":true,\"allow_legacy_tokeninfo_endpoint\":true,\"enable_legacy_profile\":true,\"enable_idtoken_api2\":true,\"enable_public_signup_user_exists_error\":true,\"enable_sso\":true,\"allow_changing_enable_sso\":true,\"disable_clickjack_protection_headers\":true,\"no_disclose_enterprise_connections\":true,\"enforce_client_authentication_on_passwordless_start\":true,\"enable_adfs_waad_email_verification\":true,\"revoke_refresh_token_grant\":true,\"dashboard_log_streams_next\":true,\"dashboard_insights_view\":true,\"disable_fields_map_fix\":true,\"mfa_show_factor_list_on_enrollment\":true,\"remove_alg_from_jwks\":true,\"improved_signup_bot_detection_in_classic\":true,\"genai_trial\":true,\"enable_dynamic_client_registration\":true,\"disable_management_api_sms_obfuscation\":true,\"trust_azure_adfs_email_verified_connection_property\":true,\"custom_domains_provisioning\":true},\"friendly_name\":\"friendly_name\",\"picture_url\":\"picture_url\",\"support_email\":\"support_email\",\"support_url\":\"support_url\",\"allowed_logout_urls\":[\"allowed_logout_urls\"],\"session_lifetime\":1.1,\"idle_session_lifetime\":1.1,\"ephemeral_session_lifetime\":1.1,\"idle_ephemeral_session_lifetime\":1.1,\"sandbox_version\":\"sandbox_version\",\"legacy_sandbox_version\":\"legacy_sandbox_version\",\"sandbox_versions_available\":[\"sandbox_versions_available\"],\"default_redirection_uri\":\"default_redirection_uri\",\"enabled_locales\":[\"am\"],\"session_cookie\":{\"mode\":\"persistent\"},\"sessions\":{\"oidc_logout_prompt_enabled\":true},\"oidc_logout\":{\"rp_logout_end_session_endpoint_discovery\":true},\"allow_organization_name_in_authentication_api\":true,\"customize_mfa_in_postlogin_action\":true,\"acr_values_supported\":[\"acr_values_supported\"],\"mtls\":{\"enable_endpoint_aliases\":true},\"pushed_authorization_requests_supported\":true,\"authorization_response_iss_parameter_supported\":true,\"skip_non_verifiable_callback_uri_confirmation_prompt\":true,\"resource_parameter_profile\":\"audience\",\"enable_ai_guide\":true}")); UpdateTenantSettingsResponseContent response = client.tenants() .settings() .update(UpdateTenantSettingsRequestContent.builder().build()); @@ -335,7 +336,8 @@ else if (actualJson.has("kind")) + " \"pushed_authorization_requests_supported\": true,\n" + " \"authorization_response_iss_parameter_supported\": true,\n" + " \"skip_non_verifiable_callback_uri_confirmation_prompt\": true,\n" - + " \"resource_parameter_profile\": \"audience\"\n" + + " \"resource_parameter_profile\": \"audience\",\n" + + " \"enable_ai_guide\": true\n" + "}"; JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); diff --git a/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java index bcd7462f3..8c32af79f 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersRefreshTokenWireTest.java @@ -41,7 +41,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"tokens\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{}],\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}],\"next\":\"next\"}")); + "{\"tokens\":[{\"id\":\"id\",\"user_id\":\"user_id\",\"created_at\":\"2024-01-15T09:30:00Z\",\"idle_expires_at\":\"2024-01-15T09:30:00Z\",\"expires_at\":\"2024-01-15T09:30:00Z\",\"client_id\":\"client_id\",\"session_id\":\"session_id\",\"rotating\":true,\"resource_servers\":[{}],\"refresh_token_metadata\":{\"key\":\"value\"},\"last_exchanged_at\":\"2024-01-15T09:30:00Z\"}],\"next\":\"next\"}")); SyncPagingIterable response = client.users() .refreshToken() .list( From 25715b9420b8664087690ddc928a6cd4f8c8c215 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 18 Dec 2025 18:56:27 +0530 Subject: [PATCH 07/13] Adding license, changelog and migration_guide files --- .fern/metadata.json | 16 - .fernignore | 3 + CHANGELOG.md | 867 ++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++ MIGRATION_GUIDE.md | 154 ++++++++ 5 files changed, 1045 insertions(+), 16 deletions(-) delete mode 100644 .fern/metadata.json create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 MIGRATION_GUIDE.md diff --git a/.fern/metadata.json b/.fern/metadata.json deleted file mode 100644 index 85128beb7..000000000 --- a/.fern/metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "cliVersion": "3.24.3", - "generatorName": "fernapi/fern-java-sdk", - "generatorVersion": "3.27.0", - "generatorConfig": { - "client-class-name": "ManagementApi", - "base-api-exception-class-name": "ManagementApiException", - "base-exception-class-name": "ManagementException", - "package-prefix": "com.auth0.client.mgmt", - "package-layout": "flat", - "use-default-request-parameter-values": true, - "enable-wire-tests": true, - "collapse-optional-nullable": true, - "use-nullable-annotation": true - } -} \ No newline at end of file diff --git a/.fernignore b/.fernignore index 55d7a36bb..cc2c9949f 100644 --- a/.fernignore +++ b/.fernignore @@ -83,3 +83,6 @@ gradle.properties settings.gradle build.gradle sample-app/ +MIGRATION_GUIDE.md +LICENSE +CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..34229b786 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,867 @@ +# Change Log + +## [v3.0.0-beta.0](https://github.com/auth0/auth0-java/tree/v3.0.0-beta.0) (2025-12-18) +[Full Changelog](https://github.com/auth0/auth0-java/compare/v4.26.0...v3.0.0-beta.0) + +> **Warning** This SDK is in beta and is subject to breaking changes. It is not recommended for production use, but your feedback and help in testing is appreciated! + +**Added** +- Complete rewrite of the **Management API client** using Fern code generation +- Update OkHttp to 5.2.1 +- API attributes can set null for patch operations +- Nullability annotations to POJO classes +- Fully compatible **Authentication API client** — no breaking changes + +- [Migration guide](MIGRATION_GUIDE) available for upgrading from v2.x + + +## [2.27.0](https://github.com/auth0/auth0-java/tree/2.27.0) (2025-12-18) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.26.0...2.27.0) + +**Added** +- Feat: Add Google WorkSpace Provisioning Config Support [\#795](https://github.com/auth0/auth0-java/pull/795) ([tanya732](https://github.com/tanya732)) + +**Fixed** +- Fix: updated token_lifetime to Integer [\#797](https://github.com/auth0/auth0-java/pull/797) ([tanya732](https://github.com/tanya732)) + +## [2.26.0](https://github.com/auth0/auth0-java/tree/2.26.0) (2025-10-24) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.25.0...2.26.0) + +**Added** +- Adenix/client is token endpoint id header trusted [\#782](https://github.com/auth0/auth0-java/pull/782) ([tanya732](https://github.com/tanya732)) +- Feat: add constructor to set clientId on Client creation [\#781](https://github.com/auth0/auth0-java/pull/781) ([tanya732](https://github.com/tanya732)) + +## [2.25.0](https://github.com/auth0/auth0-java/tree/2.25.0) (2025-09-30) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.24.0...2.25.0) + +**Added** +- Added UserAttributeProfilePage and Deserializer [\#768](https://github.com/auth0/auth0-java/pull/768) ([tanya732](https://github.com/tanya732)) +- Added checkpoint pagination support for Connection Endpoint [\#767](https://github.com/auth0/auth0-java/pull/767) ([tanya732](https://github.com/tanya732)) +- Sdk 6843 self service provisioning java support [\#765](https://github.com/auth0/auth0-java/pull/765) ([tanya732](https://github.com/tanya732)) +- Support for patch clients credentials [\#760](https://github.com/auth0/auth0-java/pull/760) ([tanya732](https://github.com/tanya732)) + +**Fixed** +- Fix: URL Encodings [\#766](https://github.com/auth0/auth0-java/pull/766) ([tanya732](https://github.com/tanya732)) +- Fix: Updated to requested_expiry params [\#757](https://github.com/auth0/auth0-java/pull/757) ([tanya732](https://github.com/tanya732)) + +## [2.24.0](https://github.com/auth0/auth0-java/tree/2.24.0) (2025-08-22) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.23.0...2.24.0) + +**Added** +- Update Readme and Examples [\#752](https://github.com/auth0/auth0-java/pull/752) ([tanya732](https://github.com/tanya732)) +- Customize management api token provider [\#748](https://github.com/auth0/auth0-java/pull/748) ([tanya732](https://github.com/tanya732)) +- Joaosoumoreira/add method to enroll email mfa [\#744](https://github.com/auth0/auth0-java/pull/744) ([tanya732](https://github.com/tanya732)) + +## [2.23.0](https://github.com/auth0/auth0-java/tree/2.23.0) (2025-08-05) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.22.0...2.23.0) + +**Added** +- Added support for Tenant ACL [\#723](https://github.com/auth0/auth0-java/pull/723) ([tanya732](https://github.com/tanya732)) +- Added organization support for Change Password [\#726](https://github.com/auth0/auth0-java/pull/726) ([tanya732](https://github.com/tanya732)) +- Fix: Resource Server Scopes [\#725](https://github.com/auth0/auth0-java/pull/725) ([tanya732](https://github.com/tanya732)) + +## [2.22.0](https://github.com/auth0/auth0-java/tree/2.22.0) (2025-06-20) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.21.0...2.22.0) + +**Added** +- Added support for connectionKeys Endpoint [\#721](https://github.com/auth0/auth0-java/pull/721) ([tanya732](https://github.com/tanya732)) + +## [2.21.0](https://github.com/auth0/auth0-java/tree/2.21.0) (2025-05-30) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.20.0...2.21.0) + +**Added** +- SDK Limit M2M Java Support [\#708](https://github.com/auth0/auth0-java/pull/708) ([tanya732](https://github.com/tanya732)) +- Added support for GET/PATCH Connection Endpoints [\#718](https://github.com/auth0/auth0-java/pull/718) ([tanya732](https://github.com/tanya732)) +- Added support for EmailTemplate [\#720](https://github.com/auth0/auth0-java/pull/720) ([tanya732](https://github.com/tanya732)) + +**Fixed** +- Updated EnabledConnection [\#719](https://github.com/auth0/auth0-java/pull/719) ([tanya732](https://github.com/tanya732)) + +## [2.20.0](https://github.com/auth0/auth0-java/tree/2.20.0) (2025-05-06) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.19.0...2.20.0) + +**Fixed** +- Fixed POST/PATCH connection endpoints [\#710](https://github.com/auth0/auth0-java/pull/710) ([tanya732](https://github.com/tanya732)) +- Fix log event [\#711](https://github.com/auth0/auth0-java/pull/711) ([tanya732](https://github.com/tanya732)) + +## [2.19.0](https://github.com/auth0/auth0-java/tree/2.19.0) (2025-03-28) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.18.0...2.19.0) + +**Added** +- Added support for SSO-FF [\#702](https://github.com/auth0/auth0-java/pull/702) ([tanya732](https://github.com/tanya732)) +- Check point pagination support for get connection [\#704](https://github.com/auth0/auth0-java/pull/704) ([tanya732](https://github.com/tanya732)) + +## [2.18.0](https://github.com/auth0/auth0-java/tree/2.18.0) (2025-02-19) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.17.0...2.18.0) + +**Added** +- Added missing fields in LogEventClass [\#698](https://github.com/auth0/auth0-java/pull/698) ([tanya732](https://github.com/tanya732)) +- Added support for revoke session endpoint [\#699](https://github.com/auth0/auth0-java/pull/699) ([tanya732](https://github.com/tanya732)) +- Added Connection's SCIM Server Support [\#696](https://github.com/auth0/auth0-java/pull/696) ([tanya732](https://github.com/tanya732)) + +## [2.17.0](https://github.com/auth0/auth0-java/tree/2.17.0) (2025-01-10) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.16.0...2.17.0) + +**Added** +- Update EXAMPLES.md to fix variable usage [\#690](https://github.com/auth0/auth0-java/pull/690) ([tanya732](https://github.com/tanya732)) +- Added Support for Self-Service-Profile [\#683](https://github.com/auth0/auth0-java/pull/683) ([tanya732](https://github.com/tanya732)) +- Added support for Back Channel Login [\#682](https://github.com/auth0/auth0-java/pull/682) ([tanya732](https://github.com/tanya732)) + +## [2.17.0](https://github.com/auth0/auth0-java/tree/2.17.0) (2025-01-08) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.16.0...2.17.0) + +**Added** +- Update EXAMPLES.md to fix variable usage [\#690](https://github.com/auth0/auth0-java/pull/690) ([tanya732](https://github.com/tanya732)) +- Added Support for Self-Service-Profile [\#683](https://github.com/auth0/auth0-java/pull/683) ([tanya732](https://github.com/tanya732)) +- Added support for Back Channel Login [\#682](https://github.com/auth0/auth0-java/pull/682) ([tanya732](https://github.com/tanya732)) + +## [2.16.0](https://github.com/auth0/auth0-java/tree/2.16.0) (2024-12-03) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.15.0...2.16.0) + +**Added** +- Added support for custom prompts [\#680](https://github.com/auth0/auth0-java/pull/680) ([tanya732](https://github.com/tanya732)) +- Added phone number identifier in signup Auth API [\#679](https://github.com/auth0/auth0-java/pull/679) ([tanya732](https://github.com/tanya732)) +- Added is_signup_enabled field to OrganizationConnection [\#677](https://github.com/auth0/auth0-java/pull/677) ([tanya732](https://github.com/tanya732)) + +## [2.15.0](https://github.com/auth0/auth0-java/tree/2.15.0) (2024-10-31) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.14.0...2.15.0) + +**Added** +- Added support for byok [\#673](https://github.com/auth0/auth0-java/pull/673) ([tanya732](https://github.com/tanya732)) + +## [2.14.0](https://github.com/auth0/auth0-java/tree/2.14.0) (2024-10-16) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.13.0...2.14.0) + +**Added** +- SDKs support for Control Your Own Key [\#671](https://github.com/auth0/auth0-java/pull/671) ([tanya732](https://github.com/tanya732)) +- Added client credentials changes [\#670](https://github.com/auth0/auth0-java/pull/670) ([tanya732](https://github.com/tanya732)) +- Added support for HRI phase 2 changes [\#668](https://github.com/auth0/auth0-java/pull/668) ([tanya732](https://github.com/tanya732)) + +## [2.13.0](https://github.com/auth0/auth0-java/tree/2.13.0) (2024-09-11) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.12.0...2.13.0) + +**Added** +- Add sessions and refresh tokens to Users Management API [\#661](https://github.com/auth0/auth0-java/pull/661) ([tanya732](https://github.com/tanya732)) + +## [2.12.0](https://github.com/auth0/auth0-java/tree/2.12.0) (2024-05-29) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.11.0...2.12.0) + +**Added** +- Support delete all authentication methods endpoint [\#645](https://github.com/auth0/auth0-java/pull/645) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.11.0](https://github.com/auth0/auth0-java/tree/2.11.0) (2024-04-29) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.10.1...2.11.0) + +**Added** +- [SDK-4763] - RIch Authorization Request (RAR) [\#637](https://github.com/auth0/auth0-java/pull/637) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-4763] - Add support for HRI Management API changes [\#635](https://github.com/auth0/auth0-java/pull/635) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-4763] - add support for JAR and PAR with JAR to Authentication API [\#636](https://github.com/auth0/auth0-java/pull/636) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-4769] - add show_as_button to Organization Enabled Connections [\#631](https://github.com/auth0/auth0-java/pull/631) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.10.1](https://github.com/auth0/auth0-java/tree/2.10.1) (2024-01-29) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.10.0...2.10.1) + +**Deprecated** +- Organizations API no longer returns enabled_connections [\#604](https://github.com/auth0/auth0-java/pull/604) ([jimmyjames](https://github.com/jimmyjames)) + +# [2.10.0](https://github.com/auth0/auth0-java/tree/2.10.0) (2023-12-15) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.9.0...2.10.0) + +**Added** +- support backchannel logout property on Client [\#587](https://github.com/auth0/auth0-java/pull/587) ([jimmyjames](https://github.com/jimmyjames)) + +# [2.9.0](https://github.com/auth0/auth0-java/tree/2.9.0) (2023-11-21) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.8.0...2.9.0) + +**Added** +- Support organization in client credentials [\#582](https://github.com/auth0/auth0-java/pull/582) ([jimmyjames](https://github.com/jimmyjames)) + +# [2.8.0](https://github.com/auth0/auth0-java/tree/2.8.0) (2023-11-07) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.7.0...2.8.0) + +**Fixed** +- Propagate error messages on rate limit exceptions [\#579](https://github.com/auth0/auth0-java/pull/579) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.7.0](https://github.com/auth0/auth0-java/tree/2.7.0) (2023-10-31) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.6.1...2.7.0) + +**Added** +- Support organization get member roles [\#574](https://github.com/auth0/auth0-java/pull/574) ([jimmyjames](https://github.com/jimmyjames)) +- Add passkey properties to authentication method response [\#575](https://github.com/auth0/auth0-java/pull/575) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.6.1](https://github.com/auth0/auth0-java/tree/2.6.1) (2023-09-22) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.6.0...2.6.1) + +**Security** +- Update Okio to resolve CVE-2023-3635 [\#560](https://github.com/auth0/auth0-java/pull/560) ([evansims](https://github.com/evansims)) + +## [2.6.0](https://github.com/auth0/auth0-java/tree/2.6.0) (2023-09-07) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.5.0...2.6.0) + +**Security** +- Update OkHttp to 4.11.0 [\#558](https://github.com/auth0/auth0-java/pull/558) ([evansims](https://github.com/evansims)) + +**Fixed** +- Align json property 'cross_origin_authentication' with api docs [\#555](https://github.com/auth0/auth0-java/pull/555) ([Jojo134](https://github.com/Jojo134)) + +## [2.5.0](https://github.com/auth0/auth0-java/tree/2.5.0) (2023-07-18) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.4.0...2.5.0) + +**Added** +- Support Organization Name on Authorize URL [\#550](https://github.com/auth0/auth0-java/pull/550) ([vasantteja](https://github.com/vasantteja)) + +**Fixed** +- Fix deleteAuthenticationMethodById [\#552](https://github.com/auth0/auth0-java/pull/552) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.4.0](https://github.com/auth0/auth0-java/tree/2.4.0) (2023-06-15) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.3.0...2.4.0) + +**Added** +- Support delete authenticator endpoint [\#541](https://github.com/auth0/auth0-java/pull/541) ([vasantteja](https://github.com/vasantteja)) +- Support invalidate remembered browsers endpoint [\#543](https://github.com/auth0/auth0-java/pull/543) ([jimmyjames](https://github.com/jimmyjames)) + +**Fixed** +- Export users does not require connection_id [\#537](https://github.com/auth0/auth0-java/pull/537) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.3.0](https://github.com/auth0/auth0-java/tree/2.3.0) (2023-05-11) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.2.0...2.3.0) + +**Added** +- Support Pushed Authorization Requests [\#534](https://github.com/auth0/auth0-java/pull/534) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.2.0](https://github.com/auth0/auth0-java/tree/2.2.0) (2023-05-02) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.1.0...2.2.0) + +**Added** +- Add support for client credential management [\#525](https://github.com/auth0/auth0-java/pull/525) ([jimmyjames](https://github.com/jimmyjames)) + +**Fixed** +- Fix headers to lowercase [\#528](https://github.com/auth0/auth0-java/pull/528) ([alexz75](https://github.com/alexz75)) + + +## [2.1.0](https://github.com/auth0/auth0-java/tree/2.1.0) (2023-03-31) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0...2.1.0) + +**Added** +- Add missing LogEvent fields [\#521](https://github.com/auth0/auth0-java/pull/521) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- authentication_methods is an object, not a string [\#520](https://github.com/auth0/auth0-java/pull/520) ([jimmyjames](https://github.com/jimmyjames)) +- Bump jackson dependency to 2.14.2 [\#522](https://github.com/auth0/auth0-java/pull/522) ([jimmyjames](https://github.com/jimmyjames)) +- Update java-jwt dependency to 4.4.0 [\#523](https://github.com/auth0/auth0-java/pull/523) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.0.0](https://github.com/auth0/auth0-java/tree/2.0.0) (2023-02-23) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.2...2.0.0) + +2.0.0 introduces several enhances, including: +- HTTP response information returned from requests +- Additional HTTP client configurability +- Ability to configure requests such as add additional parameters and headers +- Support for Authentication API MFA-related APIs +- Authentication API improvements to not require a client secret +- ... and more! + +As a major version release, 2.0.0 does include breaking changes. + +## [2.0.0 Beta 2](https://github.com/auth0/auth0-java/tree/2.0.0-beta.2) (2023-02-13) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0-beta.1...2.0.0-beta.2) + +**Changed** +- Update to latest java-jwt version [\#512](https://github.com/auth0/auth0-java/pull/512) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.0.0 Beta 1](https://github.com/auth0/auth0-java/tree/2.0.0-beta.1) (2023-01-26) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.0.0-beta.0...2.0.0-beta.1) + +**Added** +- Add support for MFA APIs [\#505](https://github.com/auth0/auth0-java/pull/505) ([poovamraj](https://github.com/poovamraj)) +- Add support MFA Methods API [\#506](https://github.com/auth0/auth0-java/pull/506) ([poovamraj](https://github.com/poovamraj)) +- Support JWT Client Authentication [\#507](https://github.com/auth0/auth0-java/pull/507) ([jimmyjames](https://github.com/jimmyjames)) + +## [2.0.0 Beta 0](https://github.com/auth0/auth0-java/tree/2.0.0-beta.0) (2023-01-12) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.2...2.0.0-beta.0) + +> **Warning** This SDK is in beta and is subject to breaking changes. It is not recommended for production use, but your feedback and help in testing is appreciated! + +This release introduces several enhancement, including: +- HTTP response information returned from requests +- Additional HTTP client configurability +- Authentication API improvements to not require a client secret +- ... and more! + +## [1.44.2](https://github.com/auth0/auth0-java/tree/1.44.2) (2023-01-11) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.1...1.44.2) + +This patch release does not contain any functional changes, but is being released using an updated signing key for verification as part of our commitment to best security practices. +Please review [the README note for additional details.](https://github.com/auth0/auth0-java/blob/master/README.md) + +**Security** +- Bump java-jwt dependency to 3.19.4 [\#498](https://github.com/auth0/auth0-java/pull/498) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.44.1](https://github.com/auth0/auth0-java/tree/1.44.1) (2022-10-25) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.44.0...1.44.1) + +**Security** +- Bump `java-jwt` to 3.19.3 [\#465](https://github.com/auth0/auth0-java/pull/465) ([jimmyjames](https://github.com/jimmyjames)) +- Bump `com.fasterxml.jackson.core:jackson-databind` to 2.13.4.2 [\#464](https://github.com/auth0/auth0-java/pull/464) ([evansims](https://github.com/evansims)) + +## [1.44.0](https://github.com/auth0/auth0-java/tree/1.44.0) (2022-10-20) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.43.0...1.44.0) + +**Added** +- Integrate ship orb [\#458](https://github.com/auth0/auth0-java/pull/458) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-2558] Add support for tenant session cookie [\#457](https://github.com/auth0/auth0-java/pull/457) ([jimmyjames](https://github.com/jimmyjames)) +- Support stage property on Breached Password Detection [\#456](https://github.com/auth0/auth0-java/pull/456) ([ewanharris](https://github.com/ewanharris)) + +**Changed** +- Update to Gradle 6.9.2 [\#455](https://github.com/auth0/auth0-java/pull/455) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.43.0](https://github.com/auth0/auth0-java/tree/1.43.0) (2022-09-19) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.42.0...1.43.0) + +**Added** +- Add support for deleting all user's authenticators [\#451](https://github.com/auth0/auth0-java/pull/451) ([jimmyjames](https://github.com/jimmyjames)) +- Add session idle lifetime and make session lifetime doubles [\#423](https://github.com/auth0/auth0-java/pull/423) ([pelletier197](https://github.com/pelletier197)) +- #448 Adding field filter option to get client by ID API [\#449](https://github.com/auth0/auth0-java/pull/449) ([bhatmadhavi](https://github.com/bhatmadhavi)) +- Add missing fields in Client model [\#444](https://github.com/auth0/auth0-java/pull/444) ([poovamraj](https://github.com/poovamraj)) +- Add Ship CLI configuration [\#433](https://github.com/auth0/auth0-java/pull/433) ([frederikprijck](https://github.com/frederikprijck)) + +**Changed** +- Update to OSS plugin version 0.17.2 [\#450](https://github.com/auth0/auth0-java/pull/450) ([jimmyjames](https://github.com/jimmyjames)) +- Bump oss-library and auth0/ship [\#441](https://github.com/auth0/auth0-java/pull/441) ([frederikprijck](https://github.com/frederikprijck)) +- Ensure version is defined before plugins are applied [\#439](https://github.com/auth0/auth0-java/pull/439) ([frederikprijck](https://github.com/frederikprijck)) + +**Security** +- Replace Codecov uploader w/ CircleCI Orb [\#446](https://github.com/auth0/auth0-java/pull/446) ([evansims](https://github.com/evansims)) +- Security: Update OkHttp to 4.10.0 [\#438](https://github.com/auth0/auth0-java/pull/438) ([evansims](https://github.com/evansims)) + +## [1.42.0](https://github.com/auth0/auth0-java/tree/1.42.0) (2022-05-20) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.41.0...1.42.0) + +**Added** +- Added support for Key management API [\#431](https://github.com/auth0/auth0-java/pull/431) ([poovamraj](https://github.com/poovamraj)) +- Support for custom scheme URL [\#429](https://github.com/auth0/auth0-java/pull/429) ([poovamraj](https://github.com/poovamraj)) +- Add enabled connections on organization [\#426](https://github.com/auth0/auth0-java/pull/426) ([charliearaya](https://github.com/charliearaya)) + +## [1.41.0](https://github.com/auth0/auth0-java/tree/1.41.0) (2022-04-19) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.2...1.41.0) + +**Fixed** +- Do not cast error values to String [\#421](https://github.com/auth0/auth0-java/pull/421) ([jimmyjames](https://github.com/jimmyjames)) +- Fix double-encoding of log event filter query param [\#420](https://github.com/auth0/auth0-java/pull/420) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.40.2](https://github.com/auth0/auth0-java/tree/1.40.2) (2022-04-07) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.1...1.40.2) + +**Security** +- Update OkHttp to address CVE-2021-0341 [\#417](https://github.com/auth0/auth0-java/pull/417) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.40.1](https://github.com/auth0/auth0-java/tree/1.40.1) (2022-03-30) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.40.0...1.40.1) + +**Security** +- Bump java-jwt to 3.19.1 [\#415](https://github.com/auth0/auth0-java/pull/415) ([poovamraj](https://github.com/poovamraj)) +- Security: Bump `jackson-databind` to 2.13.2.2 [\#414](https://github.com/auth0/auth0-java/pull/414) ([evansims](https://github.com/evansims)) + +## [1.40.0](https://github.com/auth0/auth0-java/tree/1.40.0) (2022-03-14) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.39.0...1.40.0) + +**Changed** +- Update java-jwt dependency [\#413](https://github.com/auth0/auth0-java/pull/413) ([jimmyjames](https://github.com/jimmyjames)) + +**Security** +- Bump `jackson-databind` dependency to 2.13.2 [\#411](https://github.com/auth0/auth0-java/pull/411) ([evansims](https://github.com/evansims)) + +## [1.39.0](https://github.com/auth0/auth0-java/tree/1.39.0) (2022-02-18) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.38.0...1.39.0) + +**Added** +- [SDK-3116] Add support for Attack Protection APIs [\#405](https://github.com/auth0/auth0-java/pull/405) ([jimmyjames](https://github.com/jimmyjames)) +- Feature/add branding [\#399](https://github.com/auth0/auth0-java/pull/399) ([pelletier197](https://github.com/pelletier197)) + +**Changed** +- Feature/reduce duplication [\#381](https://github.com/auth0/auth0-java/pull/381) ([pelletier197](https://github.com/pelletier197)) + +## [1.38.0](https://github.com/auth0/auth0-java/tree/1.38.0) (2022-02-01) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.37.0...1.38.0) + +**Added** +- Support maxRequests and maxRequestsPerHost client confiugrations [\#402](https://github.com/auth0/auth0-java/pull/402) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.37.0](https://github.com/auth0/auth0-java/tree/1.37.0) (2022-01-20) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.36.1...1.37.0) + +**Added** +- Add support for Connection realms [\#397](https://github.com/auth0/auth0-java/pull/397) ([jimmyjames](https://github.com/jimmyjames)) +- Improve logging [\#392](https://github.com/auth0/auth0-java/pull/392) ([jimmyjames](https://github.com/jimmyjames)) + +**Deprecated** +- Deprecate setLoggingEnabled on API clients [\#396](https://github.com/auth0/auth0-java/pull/396) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.36.1](https://github.com/auth0/auth0-java/tree/1.36.1) (2022-01-14) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.36.0...1.36.1) + +**Security** +- Update jackson dependency [\#394](https://github.com/auth0/auth0-java/pull/394) ([poovamraj](https://github.com/poovamraj)) + +## [1.36.0](https://github.com/auth0/auth0-java/tree/1.36.0) (2022-01-10) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.35.0...1.36.0) + +**Fixed** +- [SDK-2975] Fix withOrganization method visibility on token verifier [\#388](https://github.com/auth0/auth0-java/pull/388) ([jimmyjames](https://github.com/jimmyjames)) +- remove warning for untyped requests [\#385](https://github.com/auth0/auth0-java/pull/385) ([pelletier197](https://github.com/pelletier197)) + +## [1.35.0](https://github.com/auth0/auth0-java/tree/1.35.0) (2021-10-20) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.34.1...1.35.0) + +**Added** +- Added get job error details method to JobEntity [\#383](https://github.com/auth0/auth0-java/pull/383) ([jasonfagerberg-toast](https://github.com/jasonfagerberg-toast)) +- Add MFA Authentication policies to GuardianEntity [\#379](https://github.com/auth0/auth0-java/pull/379) ([pelletier197](https://github.com/pelletier197)) + +**Fixed** +- Fix de/serialization of Invitation roles [\#380](https://github.com/auth0/auth0-java/pull/380) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.34.1](https://github.com/auth0/auth0-java/tree/1.34.1) (2021-09-21) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.34.0...1.34.1) + +**Fixed** +- Add user_name field to LogEvent [\#375](https://github.com/auth0/auth0-java/pull/375) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.34.0](https://github.com/auth0/auth0-java/tree/1.34.0) (2021-08-27) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.33.0...1.34.0) + +**Added** +- Include log_id in the LogEvent entity [\#372](https://github.com/auth0/auth0-java/pull/372) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-2716] Add support for Actions Management APIs [\#369](https://github.com/auth0/auth0-java/pull/369) ([jimmyjames](https://github.com/jimmyjames)) +- [SDK-2686] Add retry on rate limit errors for management API [\#368](https://github.com/auth0/auth0-java/pull/368) ([jimmyjames](https://github.com/jimmyjames)) + +**Fixed** +- Fix to rollback action version endpoint [\#370](https://github.com/auth0/auth0-java/pull/370) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.33.0](https://github.com/auth0/auth0-java/tree/1.33.0) (2021-07-26) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.32.0...1.33.0) + +**Added** +- [SDK-2664] Add support for checkpoint pagination [\#362](https://github.com/auth0/auth0-java/pull/362) ([jimmyjames](https://github.com/jimmyjames)) + +**Deprecated** +- Deprecate unused constructors in Page implementations [\#363](https://github.com/auth0/auth0-java/pull/363) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.32.0](https://github.com/auth0/auth0-java/tree/1.32.0) (2021-07-05) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.31.0...1.32.0) + +**Added** +- [SDK-2622] Add expiresAt to token response [\#357](https://github.com/auth0/auth0-java/pull/357) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- Update OSS release plugin version [\#358](https://github.com/auth0/auth0-java/pull/358) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.31.0](https://github.com/auth0/auth0-java/tree/1.31.0) (2021-05-10) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.30.0...1.31.0) + +**Added** +- [SDK-2550] Add networking client timeout configuration [\#354](https://github.com/auth0/auth0-java/pull/354) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.30.0](https://github.com/auth0/auth0-java/tree/1.30.0) (2021-04-28) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.29.0...1.30.0) + +**Added** +- [SDK-2537] Add missing parameters to Ticket entities [\#352](https://github.com/auth0/auth0-java/pull/352) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.29.0](https://github.com/auth0/auth0-java/tree/1.29.0) (2021-04-09) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.28.1...1.29.0) + +**Added** +- Adds method to get an organization's enabled connection and update JavaDocs [\#344](https://github.com/auth0/auth0-java/pull/344) ([jimmyjames](https://github.com/jimmyjames)) +- Add Organizations Management API Support [SDK-2437] [\#341](https://github.com/auth0/auth0-java/pull/341) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.28.1](https://github.com/auth0/auth0-java/tree/1.28.1) (2021-04-05) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.28.0...1.28.1) + +**Fixed** +- Fix `NoSuchMethodError` when projects have OkHttp 3 dependency [\#342](https://github.com/auth0/auth0-java/pull/342) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.28.0](https://github.com/auth0/auth0-java/tree/1.28.0) (2021-03-25) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.27.0...1.28.0) + +**Added** +- Add support for organizations feature [\#338](https://github.com/auth0/auth0-java/pull/338) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- Update Gradle OSS Plugin [\#339](https://github.com/auth0/auth0-java/pull/339) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.27.0](https://github.com/auth0/auth0-java/tree/1.27.0) (2021-02-05) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.26.0...1.27.0) + +**Added** +- Add support for async requests [\#328](https://github.com/auth0/auth0-java/pull/328) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- Update dependency versions [\#329](https://github.com/auth0/auth0-java/pull/329) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.26.0](https://github.com/auth0/auth0-java/tree/1.26.0) (2020-12-02) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.25.0...1.26.0) + +**Added** +- Add refresh token configuration object to client [\#321](https://github.com/auth0/auth0-java/pull/321) ([JakeUskoski](https://github.com/JakeUskoski)) + +**Fixed** +- Fix OkHttp dependency version [\#325](https://github.com/auth0/auth0-java/pull/325) ([jimmyjames](https://github.com/jimmyjames)) +- Tidy up code [\#317](https://github.com/auth0/auth0-java/pull/317) ([jsalinaspolo](https://github.com/jsalinaspolo)) + +## [1.25.0](https://github.com/auth0/auth0-java/tree/1.25.0) (2020-11-16) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.24.0...1.25.0) + +**Changed** +- Update to OkHttp 4 [\#319](https://github.com/auth0/auth0-java/pull/319) ([jimmyjames](https://github.com/jimmyjames)) +- Use java8 [\#316](https://github.com/auth0/auth0-java/pull/316) ([jsalinaspolo](https://github.com/jsalinaspolo)) + +## [1.24.0](https://github.com/auth0/auth0-java/tree/1.24.0) (2020-11-02) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.23.0...1.24.0) + +**Added** +- Add methods to determine cause of APIException [\#310](https://github.com/auth0/auth0-java/pull/310) ([jimmyjames](https://github.com/jimmyjames)) + +**Breaking Changes** +- Return TokenRequest instead of AuthRequest [\#309](https://github.com/auth0/auth0-java/pull/309) ([jimmyjames](https://github.com/jimmyjames)) + +> Note: We aim to not introduce breaking changes within a release stream. We have taken steps, including running API compatibility checks, to prevent introducing breaking changes in the future. + +**Fixed** +- Add unchecked warnings failures for src [\#311](https://github.com/auth0/auth0-java/pull/311) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.23.0](https://github.com/auth0/auth0-java/tree/1.23.0) (2020-10-22) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.22.1...1.23.0) + +**Added** +- Add support for MFA OTP exchange [\#303](https://github.com/auth0/auth0-java/pull/303) ([jimmyjames](https://github.com/jimmyjames)) +- Passwordless support [\#300](https://github.com/auth0/auth0-java/pull/300) ([jimmyjames](https://github.com/jimmyjames)) +- Add scope to TokenHolder [\#297](https://github.com/auth0/auth0-java/pull/297) ([jimmyjames](https://github.com/jimmyjames)) +- Add inicludeEmailInRedirect field for create email verification ticket endpoint [\#296](https://github.com/auth0/auth0-java/pull/296) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- Update dependencies [\#299](https://github.com/auth0/auth0-java/pull/299) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.22.1](https://github.com/auth0/auth0-java/tree/1.22.1) (2020-10-13) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.22.0...1.22.1) + +**Fixed** +- Use Standard Jackson Date serialization [\#295](https://github.com/auth0/auth0-java/pull/295) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.22.0](https://github.com/auth0/auth0-java/tree/1.22.0) (2020-09-28) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.21.0...1.22.0) + +**Added** +- Add support for identity field for email verification jobs and tickets [\#293](https://github.com/auth0/auth0-java/pull/293) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.21.0](https://github.com/auth0/auth0-java/tree/1.21.0) (2020-08-27) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.20.0...1.21.0) + +**Added** +- Add support for Log Streams [\#284](https://github.com/auth0/auth0-java/pull/284) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.20.0](https://github.com/auth0/auth0-java/tree/1.20.0) (2020-07-27) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.19.0...1.20.0) + +**Added** +- Add missing Linking User Accounts endpoint [\#270](https://github.com/auth0/auth0-java/pull/270) ([cschwalm](https://github.com/cschwalm)) + +**Fixed** +- Fix and document thread-safety [\#272](https://github.com/auth0/auth0-java/pull/272) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.19.0](https://github.com/auth0/auth0-java/tree/1.19.0) (2020-06-05) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.18.0...1.19.0) + +**Added** +- Add display_name property to Connection [\#267](https://github.com/auth0/auth0-java/pull/267) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add support for java Proxy with basic auth [\#266](https://github.com/auth0/auth0-java/pull/266) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.18.0](https://github.com/auth0/auth0-java/tree/1.18.0) (2020-05-29) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.17.0...1.18.0) + +**Added** +- Add ID Token verifier API [\#260](https://github.com/auth0/auth0-java/pull/260) ([jimmyjames](https://github.com/jimmyjames)) +- Add signature verification classes [\#258](https://github.com/auth0/auth0-java/pull/258) ([jimmyjames](https://github.com/jimmyjames)) + +**Changed** +- Update to OkHttp 3.14.9 [\#262](https://github.com/auth0/auth0-java/pull/262) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.17.0](https://github.com/auth0/auth0-java/tree/1.17.0) (2020-05-22) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.16.0...1.17.0) + +**Added** +- Add missing property last_password_reset [\#256](https://github.com/auth0/auth0-java/pull/256) ([mario-moura-silva](https://github.com/mario-moura-silva)) +- Add missing "sources" property to the Permission [\#254](https://github.com/auth0/auth0-java/pull/254) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.16.0](https://github.com/auth0/auth0-java/tree/1.16.0) (2020-04-24) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.15.0...1.16.0) + +**Added** +- Add Job "POST User Imports" endpoint [\#249](https://github.com/auth0/auth0-java/pull/249) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add a new class to handle Multipart requests [\#248](https://github.com/auth0/auth0-java/pull/248) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add Job "GET Status" endpoint [\#247](https://github.com/auth0/auth0-java/pull/247) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add missing "initiate_login_uri" property to Client [\#244](https://github.com/auth0/auth0-java/pull/244) ([lbalmaceda](https://github.com/lbalmaceda)) +- Use char array for passwords [\#242](https://github.com/auth0/auth0-java/pull/242) ([jimmyjames](https://github.com/jimmyjames)) +- Add Job "POST User Exports" endpoint [\#241](https://github.com/auth0/auth0-java/pull/241) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add Rules Configs entity [\#240](https://github.com/auth0/auth0-java/pull/240) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Deprecated** +- deprecated string password APIs [\#243](https://github.com/auth0/auth0-java/pull/243) ([jimmyjames](https://github.com/jimmyjames)) + +**Fixed** +- Make CreatedUser take the id from different properties [\#245](https://github.com/auth0/auth0-java/pull/245) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Security** +- Use char array for passwords [\#242](https://github.com/auth0/auth0-java/pull/242) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.15.0](https://github.com/auth0/auth0-java/tree/1.15.0) (2019-11-12) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.3...1.15.0) + +**Changed** +- Allow to set the client is_first_party property [\#230](https://github.com/auth0/auth0-java/pull/230) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.14.3](https://github.com/auth0/auth0-java/tree/1.14.3) (2019-09-25) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.2...1.14.3) + +**Security** +- Update jackson-databind to address CVE [\#225](https://github.com/auth0/auth0-java/pull/225) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.14.2](https://github.com/auth0/auth0-java/tree/1.14.2) (2019-08-15) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.1...1.14.2) + +**Fixed** +- Find the right JDK version for Telemetry [\#220](https://github.com/auth0/auth0-java/pull/220) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Security** +- Update dependencies [\#222](https://github.com/auth0/auth0-java/pull/222) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.14.1](https://github.com/auth0/auth0-java/tree/1.14.1) (2019-07-03) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.14.0...1.14.1) + +**Security** +- Update jackson-databind dependency to fix security vulnerability [\#217](https://github.com/auth0/auth0-java/pull/217) ([jimmyjames](https://github.com/jimmyjames)) + +## [1.14.0](https://github.com/auth0/auth0-java/tree/1.14.0) (2019-07-02) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.3...1.14.0) + +**Added** +- Add getter for DeviceCredentials client_id [\#215](https://github.com/auth0/auth0-java/pull/215) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add missing ResourceServer properties [\#214](https://github.com/auth0/auth0-java/pull/214) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.13.3](https://github.com/auth0/auth0-java/tree/1.13.3) (2019-05-22) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.2...1.13.3) + +**Fixed** +- Add missing metadata field to Connection object [\#206](https://github.com/auth0/auth0-java/pull/206) ([AlisonT1230](https://github.com/AlisonT1230)) + +**Security** +- Bump dependencies and solve security issues [\#209](https://github.com/auth0/auth0-java/pull/209) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.13.2](https://github.com/auth0/auth0-java/tree/1.13.2) (2019-05-01) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.1...1.13.2) + +**Fixed** +- Dynamically obtain the project version for telemetry [\#201](https://github.com/auth0/auth0-java/pull/201) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.13.1](https://github.com/auth0/auth0-java/tree/1.13.1) (2019-04-25) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.13.0...1.13.1) + +**Fixed** +- Fix for issue #198: Core Authorization fails when adding Roles to User [\#199](https://github.com/auth0/auth0-java/pull/199) ([jakbutler](https://github.com/jakbutler)) + +## [1.13.0](https://github.com/auth0/auth0-java/tree/1.13.0) (2019-04-23) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.12.0...1.13.0) + +**Added** +- Add support for Core Authorization's User Roles and Permissions [\#193](https://github.com/auth0/auth0-java/pull/193) ([jakbutler](https://github.com/jakbutler)) + +## [1.12.0](https://github.com/auth0/auth0-java/tree/1.12.0) (2019-04-17) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.11.0...1.12.0) + +**Added** +- Update Telemetry format and allow to customize it [\#195](https://github.com/auth0/auth0-java/pull/195) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Changed** +- Remove default version for search_engine [\#194](https://github.com/auth0/auth0-java/pull/194) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.11.0](https://github.com/auth0/auth0-java/tree/1.11.0) (2019-03-14) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.10.0...1.11.0) + +**Added** +- Add "mark_email_as_verified" property to PasswordChangeTicket [\#189](https://github.com/auth0/auth0-java/pull/189) ([akvamalin](https://github.com/akvamalin)) + +## [1.10.0](https://github.com/auth0/auth0-java/tree/1.10.0) (2019-01-03) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.9.1...1.10.0) + +**Added** +- Add Serializable to the user data. [\#178](https://github.com/auth0/auth0-java/pull/178) ([dfredell](https://github.com/dfredell)) +- Include grant_types in Client [\#166](https://github.com/auth0/auth0-java/pull/166) ([osule](https://github.com/osule)) + +**Fixed** +- Closing response body on RateLimitException [\#175](https://github.com/auth0/auth0-java/pull/175) ([j-m-x](https://github.com/j-m-x)) + +**Security** +- Bump jackson-databind to patch security issues. [\#181](https://github.com/auth0/auth0-java/pull/181) ([gkwang](https://github.com/gkwang)) + +## [1.9.1](https://github.com/auth0/auth0-java/tree/1.9.1) (2018-10-23) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.9.0...1.9.1) + +**Security** +- Use jackson-databind 2.9.7 [\#168](https://github.com/auth0/auth0-java/pull/168) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.9.0](https://github.com/auth0/auth0-java/tree/1.9.0) (2018-09-25) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.8.0...1.9.0) + +**Added** +- Allow to retrieve Rate Limit headers [\#153](https://github.com/auth0/auth0-java/pull/153) ([rvillablanca](https://github.com/rvillablanca)) +- Add web_origins attribute to the Client class [\#148](https://github.com/auth0/auth0-java/pull/148) ([lbalmaceda](https://github.com/lbalmaceda)) +- Application (aka Client) description field support [\#147](https://github.com/auth0/auth0-java/pull/147) ([rrybalkin](https://github.com/rrybalkin)) + +## [1.8.0](https://github.com/auth0/auth0-java/tree/1.8.0) (2018-07-13) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.7.0...1.8.0) + +**Added** +- Allow to update the Management API token [\#141](https://github.com/auth0/auth0-java/pull/141) ([lbalmaceda](https://github.com/lbalmaceda)) +- Allow to set search_engine version for Users API [\#140](https://github.com/auth0/auth0-java/pull/140) ([lbalmaceda](https://github.com/lbalmaceda)) +- Make Connections accept include_totals parameter [\#135](https://github.com/auth0/auth0-java/pull/135) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add pagination support to Client Grants, Grants, Resource Servers and Rules [\#132](https://github.com/auth0/auth0-java/pull/132) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Deprecated** +- Deprecate old list methods that do not support pagination [\#136](https://github.com/auth0/auth0-java/pull/136) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.7.0](https://github.com/auth0/auth0-java/tree/1.7.0) (2018-06-11) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.6.0...1.7.0) + +**Added** +- Support pagination on the Clients entity [\#124](https://github.com/auth0/auth0-java/pull/124) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add Resend verification email functionality [\#120](https://github.com/auth0/auth0-java/pull/120) ([minhlongdo](https://github.com/minhlongdo)) + +**Deprecated** +- Deprecate ClientsEntity#list() method [\#128](https://github.com/auth0/auth0-java/pull/128) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Security** +- Security fix and dependencies update [\#129](https://github.com/auth0/auth0-java/pull/129) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.6.0](https://github.com/auth0/auth0-java/tree/1.6.0) (2018-06-04) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.5.1...1.6.0) + +**Added** +- Expose additional error response properties in the Exception [\#123](https://github.com/auth0/auth0-java/pull/123) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add email-templates endpoints [\#117](https://github.com/auth0/auth0-java/pull/117) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.5.1](https://github.com/auth0/auth0-java/tree/1.5.1) (2018-03-01) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.5.0...1.5.1) + +**Fixed** +- Support password policy error response [\#108](https://github.com/auth0/auth0-java/pull/108) ([lbalmaceda](https://github.com/lbalmaceda)) +- Close ResponseBody buffer after read [\#101](https://github.com/auth0/auth0-java/pull/101) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.5.0](https://github.com/auth0/auth0-java/tree/1.5.0) (2017-12-07) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.4.0...1.5.0) + +**Added** +- Resource server [\#77](https://github.com/auth0/auth0-java/pull/77) ([mfarsikov](https://github.com/mfarsikov)) + +## [1.4.0](https://github.com/auth0/auth0-java/tree/1.4.0) (2017-11-30) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.3.1...1.4.0) + +**Added** +- Add user_id setter [\#93](https://github.com/auth0/auth0-java/pull/93) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add /v2/users-by-email endpoint [\#87](https://github.com/auth0/auth0-java/pull/87) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Breaking changes** +- Include a proper SignUp response [\#92](https://github.com/auth0/auth0-java/pull/92) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.3.1](https://github.com/auth0/auth0-java/tree/1.3.1) (2017-11-01) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.3.0...1.3.1) +**Closed issues** +- NullPointerException, StdDeserializer [\#78](https://github.com/auth0/auth0-java/issues/78) + +**Fixed** +- Upgrade Jackson-databind dependency [\#82](https://github.com/auth0/auth0-java/pull/82) ([LuisSaybe](https://github.com/LuisSaybe)) + +## [1.3.0](https://github.com/auth0/auth0-java/tree/1.3.0) (2017-09-08) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.2.0...1.3.0) + +**Added** +- implemented /api/v2/grants endpoint of auth0 management api [\#74](https://github.com/auth0/auth0-java/pull/74) ([neshanjo](https://github.com/neshanjo)) + +**Changed** +- removed unmotivated throwing of UnsupportedEncodingException [\#75](https://github.com/auth0/auth0-java/pull/75) ([neshanjo](https://github.com/neshanjo)) + +## [1.2.0](https://github.com/auth0/auth0-java/tree/1.2.0) (2017-08-07) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.1.0...1.2.0) +**Closed issues** +- Get AD connection's provisioning_ticket_url property [\#66](https://github.com/auth0/auth0-java/issues/66) + +**Added** +- Add support for provisioning_ticket_url property to Connection POJO [\#67](https://github.com/auth0/auth0-java/pull/67) ([unnamed38](https://github.com/unnamed38)) +- Add public User constructor without parameters [\#59](https://github.com/auth0/auth0-java/pull/59) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Removed** +- Remove invalid Logout URL parameter [\#65](https://github.com/auth0/auth0-java/pull/65) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.1.0](https://github.com/auth0/auth0-java/tree/1.1.0) (2017-05-23) +[Full Changelog](https://github.com/auth0/auth0-java/compare/1.0.0...1.1.0) + +**Added** +- Add getter for User and ProfileData extra properties [\#56](https://github.com/auth0/auth0-java/pull/56) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add renew authentication endpoint [\#51](https://github.com/auth0/auth0-java/pull/51) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add revoke token endpoint [\#50](https://github.com/auth0/auth0-java/pull/50) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add getter for Identity extra properties [\#45](https://github.com/auth0/auth0-java/pull/45) ([lbalmaceda](https://github.com/lbalmaceda)) +- Add response_type and custom parameter setter for AuthorizeUrlBuilder [\#40](https://github.com/auth0/auth0-java/pull/40) ([lbalmaceda](https://github.com/lbalmaceda)) + +**Changed** +- Improve Guardian section [\#39](https://github.com/auth0/auth0-java/pull/39) ([nikolaseu](https://github.com/nikolaseu)) +- Simplify/reduce amount of code [\#36](https://github.com/auth0/auth0-java/pull/36) ([nikolaseu](https://github.com/nikolaseu)) + +**Fixed** +- Fix "q" query parameter encoding [\#55](https://github.com/auth0/auth0-java/pull/55) ([lbalmaceda](https://github.com/lbalmaceda)) +- Close the ResponseBody after its parsed [\#38](https://github.com/auth0/auth0-java/pull/38) ([lbalmaceda](https://github.com/lbalmaceda)) + +## [1.0.0](https://github.com/auth0/auth0-java/tree/1.0.0) (2017-01-30) + +Reworked Auth0 SDK for java by providing better support for non-Android application (for Android please use [Auth0.Android](https://github.com/auth0/Auth0.Android)). + +The changes from v0 includes: + +- OAuth 2.0 endpoints in Authentication API +- Sync calls by default +- Added Management API endpoints +- Better error handling for Auth and Management API erros + +### Auth API + +The implementation is based on the [Authentication API Docs](https://auth0.com/docs/api/authentication). + +Create a new `AuthAPI` instance by providing the client data from the [dashboard](https://manage.auth0.com/#/clients). + +```java +AuthAPI auth = new AuthAPI("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}"); +``` + +### Management API + +The implementation is based on the [Management API Docs](https://auth0.com/docs/api/management/v2). + +Create a new `ManagementAPI` instance by providing the domain from the [client dashboard](https://manage.auth0.com/#/clients) and the API Token. Click [here](https://auth0.com/docs/api/management/v2#!/Introduction/Getting_an_API_token) for more information on how to obtain a valid API Token. + +```java +ManagementAPI mgmt = new ManagementAPI("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}"); +``` + +The Management API is divided into different entities. Each of them have the list, create, update, delete and update methods plus a few more if corresponds. The calls are authenticated using the API Token given in the `ManagementAPI` instance creation and must contain the `scope` required by each entity. See the javadoc for details on which `scope` is expected for each call. + +* **Client Grants:** See [Docs](https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants). Access the methods by calling `mgmt.clientGrants()`. +* **Clients:** See [Docs](https://auth0.com/docs/api/management/v2#!/Clients/get_clients). Access the methods by calling `mgmt.clients()`. +* **Connections:** See [Docs](https://auth0.com/docs/api/management/v2#!/Connections/get_connections). Access the methods by calling `mgmt.connections()`. +* **Device Credentials:** See [Docs](https://auth0.com/docs/api/management/v2#!/Device_Credentials/get_device_credentials). Access the methods by calling `mgmt.deviceCredentials()`. +* **Logs:** See [Docs](https://auth0.com/docs/api/management/v2#!/Logs/get_logs). Access the methods by calling `mgmt.logEvents()`. +* **Rules:** See [Docs](https://auth0.com/docs/api/management/v2#!/Rules/get_rules). Access the methods by calling `mgmt.rules()`. +* **User Blocks:** See [Docs](https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks). Access the methods by calling `mgmt.userBlocks()`. +* **Users:** See [Docs](https://auth0.com/docs/api/management/v2#!/Users/get_users). Access the methods by calling `mgmt.users()`. +* **Blacklists:** See [Docs](https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens). Access the methods by calling `mgmt.blacklists()`. +* **Emails:** See [Docs](https://auth0.com/docs/api/management/v2#!/Emails/get_provider). Access the methods by calling `mgmt.emailProvider()`. +* **Guardian:** See [Docs](https://auth0.com/docs/api/management/v2#!/Guardian/get_factors). Access the methods by calling `mgmt.guardian()`. +* **Stats:** See [Docs](https://auth0.com/docs/api/management/v2#!/Stats/get_active_users). Access the methods by calling `mgmt.stats()`. +* **Tenants:** See [Docs](https://auth0.com/docs/api/management/v2#!/Tenants/get_settings). Access the methods by calling `mgmt.tenants()`. +* **Tickets:** See [Docs](https://auth0.com/docs/api/management/v2#!/Tickets/post_email_verification). Access the methods by calling `mgmt.tickets()`. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..5e57a4f8a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Auth0, Inc. (http://auth0.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md new file mode 100644 index 000000000..514a34768 --- /dev/null +++ b/MIGRATION_GUIDE.md @@ -0,0 +1,154 @@ +# Migration Guide + +## Migrating from v1 to v2 + +The version 2 release includes several notable improvements, including: + +* Requests can now be configured with additional parameters and headers, without needing to downcast to `CustomRequest`. +* Responses are now wrapped in a new `com.auth0.net.Response` type, which provides information about the HTTP response such as headers and status code. +* The `AuthAPI` and `ManagementAPI` clients can now share the same HTTP client. +* The `AuthAPI` client no longer requires a client secret, enabling support for APIs and scenarios where a secret is not required. + +Version 2 includes breaking changes. Please read this guide to learn how to update your application for v2. + +### Configuring `auth0-java` v2 + +To create the API clients, use the new builders, and specify any HTTP-related configurations with the new `DefaultHttpClient`: + +```java +Auth0HttpClient http = DefaultHttpClient.newBuilder() + .withConnectTimeout(10) + .withReadTimeout(10) + // additional configurations as needed + .build(); + +AuthAPI auth = AuthAPI.newBuilder("{DOMAIN}", "{CLIENT-ID}", "{OPTIONAL-CLIENT-SECRET}") + .withHttpClient(http) + .build(); + +ManagementAPI mgmt = ManagementAPI.newBuilder("{DOMAIN}", "{API-TOKEN}") + .withHttpClient(http) + .build(); +``` + +### Response information + +Version 2 returns HTTP response information such as status code and headers in a new `com.auth0.net.Response` type. +Instead of simply returning the parsed JSON response body from requests, all API methods now return a `Response`. +If you have no need for the response information, replace any calls to `execute()` with `execute().getBody()` to get the returned response body as before: + +```java +// Get response info +Response userResponse = api.users().get("{USER-ID}", null); +int code = userResponse.getStatusCode(); +Map headers = userResponse.getHeaders(); + +// Just get the response body +User user = api.users().get("{USER-ID}", null).execute().getBody(); +``` + +### Request configuration + +Previously, only requests that returned a `CustomizableRequest` (or its implementation, `CustomRequest`) allowed for a request to be configured with additional parameters or headers. +In v2, the `com.auth0.net.Request` interface defines the new methods: + +- `Request addHeader(String name, String value)` +- `Request addParameter(String name, Object value)` +- `Request setBody(Object body)` + +This enables all requests to be configured, without the need to downcast to `CustomizableRequest` or `CustomRequest`. +If you were down-casting to these types, you will need to remove the cast and instead configure the request directly: + +```java +Request userRequest = api.users().get("{USER-ID}", null); +userRequest.addHeader("some-header", "some-value"); +Response userResponse = userRequest.execute(); +``` + +### Detailed changes + +The following summarizes details of the changes in version 2, including types and methods removed, added, or deprecated. + +#### Removed classes + +- `AuthRequest` has been removed. Use `TokenRequest` instead. +- `CustomizableRequest` and `CustomRequest` have been removed. The `Request` interface now supports request customization directly without the need to downcast. +- `FormDataRequest` has been removed. Use `MultipartRequest` instead. +- `CreateUserRequest` has been removed. Use `SignUpRequest` instead. + +#### Moved classes + +- `com.auth0.json.mgmt.Token` moved to `com.auth0.json.mgmt.blacklists.Token` +- `com.auth0.json.mgmt.ClientGrant` moved to `com.auth0.json.mgmt.clientgrants.ClientGrant` +- `com.auth0.json.mgmt.ClientGrantsPage` moved to `com.auth0.json.mgmt.clientgrants.ClientGrantsPage` +- `com.auth0.json.mgmt.Connection` moved to `com.auth0.json.mgmt.connections.Connection` +- `com.auth0.json.mgmt.ConnectionsPage` moved to `com.auth0.json.mgmt.connections.ConnectionsPage` +- `com.auth0.json.mgmt.DeviceCredentials` moved to `com.auth0.json.mgmt.devicecredentials.DeviceCredentials` +- `com.auth0.json.mgmt.EmailTemplate` moved to `com.auth0.json.mgmt.emailtemplates.EmailTemplate` +- `com.auth0.json.mgmt.Grant` moved to `com.auth0.json.mgmt.grants.Grant` +- `com.auth0.json.mgmt.GrantsPage` moved to `com.auth0.json.mgmt.grants.GrantsPage` +- `com.auth0.json.mgmt.EmailVerificationIdentity` moved to `com.auth0.json.mgmt.tickets.EmailVerificationIdentity` +- `com.auth0.json.mgmt.Key;` moved to `com.auth0.json.mgmt.keys.Key` +- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` +- `com.auth0.json.mgmt.ResourceServer` moved to `com.auth0.json.mgmt.resourceserver.ResourceServer` +- `com.auth0.json.mgmt.ResourceServersPage` moved to `com.auth0.json.mgmt.resourceserver.ResourceServersPage` +- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` +- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` +- `com.auth0.json.mgmt.Role` moved to `com.auth0.json.mgmt.roles.Role` +- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` +- `com.auth0.json.mgmt.RulesConfig` moved to `com.auth0.json.mgmt.rules.RulesConfig` +- `com.auth0.json.mgmt.Rule` moved to `com.auth0.json.mgmt.rules.Rule` +- `com.auth0.json.mgmt.RulesPage` moved to `com.auth0.json.mgmt.rules.RulesPage` +- `com.auth0.json.mgmt.DailyStats` moved to `com.auth0.json.mgmt.stats.DailyStats` +- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` +- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` +- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` + +#### Removed methods + +- `void com.auth0.client.mgmt.ManagementAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- `void com.auth0.client.auth.AuthAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- `void com.auth0.client.mgmt.ManagementAPI#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- `void com.auth0.client.auth.AuthAP#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- Deprecated `void com.auth0.client.mgmt.ManagementAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- Deprecated `void com.auth0.client.auth.AuthAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` +- Deprecated `Request> com.auth0.client.mgmt.ClientGrantsEntity#list()` has been removed. Use `Request list(ClientGrantsFilter filter) com.auth0.client.mgmt.ClientGrantsEntity#list(ClientGrantsFilter filter)` instead. +- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#list(ClientFilter filter)` instead. +- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list(ConnectionFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#listAll(ConnectionFilter filter)` instead. +- Deprecated `Request> com.auth0.client.mgmt.GrantsEntity#list(String userId)` has been removed. Use `Request com.auth0.client.mgmt.GrantsEntity#list(String userId, GrantsFilter filter)` instead. +- Deprecated `Request> com.auth0.client.mgmt.ResourceServerEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ResourceServersEntity#list(ResourceServersFilter)` instead. +- Deprecated `Request> com.auth0.client.mgmt.RulesEntity#list(RulesFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.RulesEntity#listAll(RulesFilter filter)` instead. +- Deprecated `void com.auth0.json.mgmt.guardian.EnrollmentTicket#setUserId(String id)` has been removed. Use the constructor instead. +- Deprecated `com.auth0.json.mgmt.guardian.SNSFactorProvider` no-arg constructor has been removed. Use the full constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSAccessKeyId(String awsAccessKeyId)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSSecretAccessKey(String awsSecretAccessKey)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSRegion(String awsRegion)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSAPNSPlatformApplicationARN(String apnARN)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSGCMPlatformApplicationARN(String gcmARN)` has been removed. Use the constructor instead. +- Deprecated `com.auth0.json.mgmt.guardian.TwilioFactorProvider` no-arg constructor has been removed. Use the full constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setFrom(String from)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setMessagingServiceSID(String messagingServiceSID)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setAuthToken(String authToken)` has been removed. Use the constructor instead. +- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setSID(String SID)` has been removed. Use the constructor instead. +- The default implementation of `com.auth0.net.Request#executeAsync()` has been removed; implementations must provide an implementation of `executeAsync`. + +### New classes and methods + +#### Refactored HTTP layer types + +Version 2 introduces a new abstraction, `com.auth0.net.client.Auth0HttpClient`, to handle the core HTTP responsibilities of sending HTTP requests. +An implementation is provided in `DefaultHttpClient`, which supports all the configurations available in the now-deprecated `HttpOptions`. +In addition to these configurations, it is also possible to implement the `Auth0HttpClient` for advanced use-cases where the default implementation or its configurations are not sufficient. +Several new types have been added to support this: + +- `com.auth0.net.client.Auth0HttpClient` has been added to define the HTTP client interface. +- `com.auth0.net.client.DefaultHttpClient` is the default HTTP implementation that should be used in the majority of cases. It supports the same configurations as `HttpOptions`, but can be reused across API clients. It uses `OkHttp` as the networking client internally. +- `com.auth0.net.client.Auth0HttpRequest` is a lightweight representation of an HTTP request to execute. Internal API implementations will form the request. +- `com.auth0.net.client.Auth0HttpResponse` is a lightweight representation of an HTTP response. Internal API implementations will parse the response. +- `com.auth0.net.client.HttpMethod` is an `enum` representing the HTTP methods. + +### New deprecations + +- `com.auth0.client.HttpOptions` has been deprecated, in favor of configuring the `DefaultHttpClient` directly. +- `com.auth0.client.mgmt.ManagementAPI` constructors have been deprecated in favor of `ManagementAPI#newBuilder(String domain, String apiToken)`. +- `com.auth0.client.auth.AuthAPI` constructors have been deprecated in favor of `AuthAPI.newBuilder(String domain, String clientId)` and `AuthAPI.newBuilder(String domain, String clientId, String clientSecret)`. From eb0b76365fa3b137319a6e77f9083f5d7e4323a0 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 18 Dec 2025 19:03:20 +0530 Subject: [PATCH 08/13] Modified migration_guide --- .fernignore | 8 +- MIGRATION_GUIDE.md | 469 +++++++++++++++++++++++++++++++++------------ 2 files changed, 347 insertions(+), 130 deletions(-) diff --git a/.fernignore b/.fernignore index cc2c9949f..b48f3efae 100644 --- a/.fernignore +++ b/.fernignore @@ -6,6 +6,9 @@ README.md # Examples and Migration Guide from auth0-real EXAMPLES.md v3_MIGRATION_GUIDE.md +MIGRATION_GUIDE.md +LICENSE +CHANGELOG.md # Legacy management API from auth0-real src/main/java/com/auth0/client/legacy/ @@ -71,6 +74,7 @@ src/test/java/com/auth0/client/mgmt/ManagementApiBuilderTest.java .snyk .version opslevel.yml +.fern/ # GitHub workflows .github/ @@ -83,6 +87,4 @@ gradle.properties settings.gradle build.gradle sample-app/ -MIGRATION_GUIDE.md -LICENSE -CHANGELOG.md + diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 514a34768..d6c7e9ac0 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -1,154 +1,369 @@ -# Migration Guide +# V3 Migration Guide -## Migrating from v1 to v2 +A guide to migrating the Auth0 Java SDK from `v2` to `v3`. -The version 2 release includes several notable improvements, including: +- [Overall changes](#overall-changes) + - [Java versions](#java-versions) + - [Authentication API](#authentication-api) + - [Management API](#management-api) +- [Specific changes to the Management API](#specific-changes-to-the-management-api) + - [Client initialization](#client-initialization) + - [Sub-client organization](#sub-client-organization) + - [Request and response patterns](#request-and-response-patterns) + - [Pagination](#pagination) + - [Exception handling](#exception-handling) + - [Accessing raw HTTP responses](#accessing-raw-http-responses) + - [Request-level configuration](#request-level-configuration) + - [Type changes](#type-changes) -* Requests can now be configured with additional parameters and headers, without needing to downcast to `CustomRequest`. -* Responses are now wrapped in a new `com.auth0.net.Response` type, which provides information about the HTTP response such as headers and status code. -* The `AuthAPI` and `ManagementAPI` clients can now share the same HTTP client. -* The `AuthAPI` client no longer requires a client secret, enabling support for APIs and scenarios where a secret is not required. +## Overall changes -Version 2 includes breaking changes. Please read this guide to learn how to update your application for v2. +### Java versions -### Configuring `auth0-java` v2 +Both v2 and v3 require Java 8 or above. -To create the API clients, use the new builders, and specify any HTTP-related configurations with the new `DefaultHttpClient`: +### Authentication API + +This major version change does not affect the Authentication API. The `AuthAPI` class has been ported directly from v2 to v3. Any code written for the Authentication API in the v2 version should work in the v3 version. ```java -Auth0HttpClient http = DefaultHttpClient.newBuilder() - .withConnectTimeout(10) - .withReadTimeout(10) - // additional configurations as needed - .build(); +// Works in both v2 and v3 +AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); +``` + +### Management API + +V3 introduces significant improvements to the Management API SDK by migrating to [Fern](https://github.com/fern-api/fern) as the code generation tool. This provides: + +- Better resource grouping with sub-client organization +- Type-safe request and response objects using builder patterns +- Automatic pagination with `SyncPagingIterable` +- Simplified access to HTTP response metadata via `withRawResponse()` +- Consistent method naming (`list`, `create`, `get`, `update`, `delete`) -AuthAPI auth = AuthAPI.newBuilder("{DOMAIN}", "{CLIENT-ID}", "{OPTIONAL-CLIENT-SECRET}") - .withHttpClient(http) - .build(); +## Specific changes to the Management API -ManagementAPI mgmt = ManagementAPI.newBuilder("{DOMAIN}", "{API-TOKEN}") - .withHttpClient(http) - .build(); -``` - -### Response information +### Client initialization -Version 2 returns HTTP response information such as status code and headers in a new `com.auth0.net.Response` type. -Instead of simply returning the parsed JSON response body from requests, all API methods now return a `Response`. -If you have no need for the response information, replace any calls to `execute()` with `execute().getBody()` to get the returned response body as before: +The Management API client initialization has changed from `ManagementAPI` to `ManagementApi`, and uses a different builder pattern. +**v2:** ```java -// Get response info -Response userResponse = api.users().get("{USER-ID}", null); -int code = userResponse.getStatusCode(); -Map headers = userResponse.getHeaders(); +import com.auth0.client.mgmt.ManagementAPI; -// Just get the response body -User user = api.users().get("{USER-ID}", null).execute().getBody(); -``` +// Using domain and token +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build(); -### Request configuration +// Using TokenProvider +TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}"); +ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", tokenProvider).build(); +``` -Previously, only requests that returned a `CustomizableRequest` (or its implementation, `CustomRequest`) allowed for a request to be configured with additional parameters or headers. -In v2, the `com.auth0.net.Request` interface defines the new methods: +**v3:** +1st Approach : Standard Token-Based +```java +import com.auth0.client.mgmt.ManagementApi; -- `Request addHeader(String name, String value)` -- `Request addParameter(String name, Object value)` -- `Request setBody(Object body)` +ManagementApi client = ManagementApi + .builder() + .url("https://{YOUR_DOMAIN}/api/v2") + .token("{YOUR_API_TOKEN}") + .build(); +``` -This enables all requests to be configured, without the need to downcast to `CustomizableRequest` or `CustomRequest`. -If you were down-casting to these types, you will need to remove the cast and instead configure the request directly: +or + +2nd Approach : OAuth client credentials flow ```java -Request userRequest = api.users().get("{USER-ID}", null); -userRequest.addHeader("some-header", "some-value"); -Response userResponse = userRequest.execute(); +OAuthTokenSupplier tokenSupplier = new OAuthTokenSupplier( +"{CLIENT_ID}", +"{CLIENT_SECRET}", +"https://{YOUR_DOMAIN}", +"{YOUR_AUDIENCE}" +); + +ClientOptions clientOptions = ClientOptions.builder() +.environment(Environment.custom("https://{YOUR_AUDIENCE}")) +.addHeader("Authorization", () -> "Bearer " + tokenSupplier.get()) +.build(); + +ManagementApi client = new ManagementApi(clientOptions); + ``` -### Detailed changes +#### Builder options comparison + +| Option | v2 | v3 | +|--------|----|----| +| Domain/URL | `newBuilder(domain, token)` | `.url("https://domain/api/v2")` | +| Token | Constructor parameter | `.token(token)` | +| Timeout | Via `HttpOptions` | `.timeout(seconds)` | +| Max retries | Via `HttpOptions` | `.maxRetries(count)` | +| Custom HTTP client | `.withHttpClient(Auth0HttpClient)` | `.httpClient(OkHttpClient)` | +| Custom headers | Not directly supported | `.addHeader(name, value)` | -The following summarizes details of the changes in version 2, including types and methods removed, added, or deprecated. +### Sub-client organization -#### Removed classes +V3 introduces a hierarchical sub-client structure. Operations on related resources are now accessed through nested clients instead of methods on a flat entity class. + +**v2:** +```java +// All user operations on UsersEntity +Request userRequest = mgmt.users().get("user_id", new UserFilter()); +Request> permissionsRequest = mgmt.users().getPermissions("user_id", new PermissionsFilter()); +Request> rolesRequest = mgmt.users().getRoles("user_id", new RolesFilter()); +Request logsRequest = mgmt.users().getLogEvents("user_id", new LogEventFilter()); +``` + +**v3:** +```java +// Operations organized into sub-clients +GetUserResponseContent user = client.users().get("user_id"); +SyncPagingIterable permissions = client.users().permissions().list("user_id"); +SyncPagingIterable roles = client.users().roles().list("user_id"); +SyncPagingIterable logs = client.users().logs().list("user_id"); +``` + +#### Common sub-client mappings + +| v2 Method | v3 Sub-client | +|-----------|---------------| +| `mgmt.users().getPermissions()` | `client.users().permissions().list()` | +| `mgmt.users().getRoles()` | `client.users().roles().list()` | +| `mgmt.users().getLogEvents()` | `client.users().logs().list()` | +| `mgmt.users().getOrganizations()` | `client.users().organizations().list()` | +| `mgmt.users().link()` | `client.users().identities().link()` | +| `mgmt.users().unlink()` | `client.users().identities().delete()` | +| `mgmt.users().deleteMultifactorProvider()` | `client.users().multifactor().deleteProvider()` | +| `mgmt.organizations().getMembers()` | `client.organizations().members().list()` | +| `mgmt.organizations().getInvitations()` | `client.organizations().invitations().list()` | +| `mgmt.organizations().getEnabledConnections()` | `client.organizations().enabledConnections().list()` | +| `mgmt.actions().getVersions()` | `client.actions().versions().list()` | +| `mgmt.actions().getTriggerBindings()` | `client.actions().triggers().bindings().list()` | +| `mgmt.guardian().getFactors()` | `client.guardian().factors().list()` | +| `mgmt.branding().getUniversalLoginTemplate()` | `client.branding().templates().getUniversalLogin()` | +| `mgmt.connections().getScimConfiguration()` | `client.connections().scimConfiguration().get()` | + +### Request and response patterns + +V3 uses type-safe request content objects with builders instead of domain objects or filter parameters. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.net.Request; + +// Creating a user +User user = new User("Username-Password-Authentication"); +user.setEmail("test@example.com"); +user.setPassword("password123".toCharArray()); + +Request request = mgmt.users().create(user); +User createdUser = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; + +// Creating a user +CreateUserResponseContent user = client.users().create( + CreateUserRequestContent + .builder() + .connection("Username-Password-Authentication") + .email("test@example.com") + .password("password123") + .build() +); +``` + +#### Key differences + +| Aspect | v2 | v3 | +|--------|----|----| +| Request building | Domain objects with setters | Builder pattern with `*RequestContent` types | +| Response type | `Request` requiring `.execute().getBody()` | Direct return of response object | +| Filtering | Filter classes (e.g., `UserFilter`) | `*RequestParameters` builder classes | +| Execution | Explicit `.execute()` call | Implicit execution on method call | + +### Pagination + +V3 introduces `SyncPagingIterable` for automatic pagination, replacing the manual `Request` pattern. + +**v2:** +```java +import com.auth0.json.mgmt.users.UsersPage; +import com.auth0.client.mgmt.filter.UserFilter; + +Request request = mgmt.users().list(new UserFilter().withPage(0, 50)); +UsersPage page = request.execute().getBody(); + +for (User user : page.getItems()) { + System.out.println(user.getEmail()); +} + +// Manual pagination +while (page.getNext() != null) { + request = mgmt.users().list(new UserFilter().withPage(page.getNext(), 50)); + page = request.execute().getBody(); + for (User user : page.getItems()) { + System.out.println(user.getEmail()); + } +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.ListUsersRequestParameters; + +// Automatic iteration through all pages +SyncPagingIterable users = client.users().list( + ListUsersRequestParameters + .builder() + .perPage(50) + .build() +); + +for (UserResponseSchema user : users) { + System.out.println(user.getEmail()); +} + +// Or manual page control +List pageItems = users.getItems(); +while (users.hasNext()) { + pageItems = users.nextPage().getItems(); + // process page +} +``` -- `AuthRequest` has been removed. Use `TokenRequest` instead. -- `CustomizableRequest` and `CustomRequest` have been removed. The `Request` interface now supports request customization directly without the need to downcast. -- `FormDataRequest` has been removed. Use `MultipartRequest` instead. -- `CreateUserRequest` has been removed. Use `SignUpRequest` instead. +### Exception handling -#### Moved classes +V3 uses a unified `ManagementApiException` class instead of the v2 exception hierarchy. -- `com.auth0.json.mgmt.Token` moved to `com.auth0.json.mgmt.blacklists.Token` -- `com.auth0.json.mgmt.ClientGrant` moved to `com.auth0.json.mgmt.clientgrants.ClientGrant` -- `com.auth0.json.mgmt.ClientGrantsPage` moved to `com.auth0.json.mgmt.clientgrants.ClientGrantsPage` -- `com.auth0.json.mgmt.Connection` moved to `com.auth0.json.mgmt.connections.Connection` -- `com.auth0.json.mgmt.ConnectionsPage` moved to `com.auth0.json.mgmt.connections.ConnectionsPage` -- `com.auth0.json.mgmt.DeviceCredentials` moved to `com.auth0.json.mgmt.devicecredentials.DeviceCredentials` -- `com.auth0.json.mgmt.EmailTemplate` moved to `com.auth0.json.mgmt.emailtemplates.EmailTemplate` -- `com.auth0.json.mgmt.Grant` moved to `com.auth0.json.mgmt.grants.Grant` -- `com.auth0.json.mgmt.GrantsPage` moved to `com.auth0.json.mgmt.grants.GrantsPage` -- `com.auth0.json.mgmt.EmailVerificationIdentity` moved to `com.auth0.json.mgmt.tickets.EmailVerificationIdentity` -- `com.auth0.json.mgmt.Key;` moved to `com.auth0.json.mgmt.keys.Key` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` -- `com.auth0.json.mgmt.ResourceServer` moved to `com.auth0.json.mgmt.resourceserver.ResourceServer` -- `com.auth0.json.mgmt.ResourceServersPage` moved to `com.auth0.json.mgmt.resourceserver.ResourceServersPage` -- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` -- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` -- `com.auth0.json.mgmt.Role` moved to `com.auth0.json.mgmt.roles.Role` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` -- `com.auth0.json.mgmt.RulesConfig` moved to `com.auth0.json.mgmt.rules.RulesConfig` -- `com.auth0.json.mgmt.Rule` moved to `com.auth0.json.mgmt.rules.Rule` -- `com.auth0.json.mgmt.RulesPage` moved to `com.auth0.json.mgmt.rules.RulesPage` -- `com.auth0.json.mgmt.DailyStats` moved to `com.auth0.json.mgmt.stats.DailyStats` -- `com.auth0.json.mgmt.Permission` moved to `com.auth0.json.mgmt.permissions.Permission` -- `com.auth0.json.mgmt.PermissionsPage` moved to `com.auth0.json.mgmt.permissions.PermissionsPage` -- `com.auth0.json.mgmt.RolesPage` moved to `com.auth0.json.mgmt.roles.RolesPage` - -#### Removed methods - -- `void com.auth0.client.mgmt.ManagementAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.auth.AuthAPI#doNotSendTelemetry()` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.mgmt.ManagementAPI#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- `void com.auth0.client.auth.AuthAP#setTelemetry(Telemetry telemetry)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `void com.auth0.client.mgmt.ManagementAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `void com.auth0.client.auth.AuthAPI#setLoggingEnabled(boolean enabled)` has been removed. Telemetry configuration can be done using the `DefaultHttpClient#Builder` -- Deprecated `Request> com.auth0.client.mgmt.ClientGrantsEntity#list()` has been removed. Use `Request list(ClientGrantsFilter filter) com.auth0.client.mgmt.ClientGrantsEntity#list(ClientGrantsFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#list(ClientFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ClientsEntity#list(ConnectionFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.ClientsEntity#listAll(ConnectionFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.GrantsEntity#list(String userId)` has been removed. Use `Request com.auth0.client.mgmt.GrantsEntity#list(String userId, GrantsFilter filter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.ResourceServerEntity#list()` has been removed. Use `Request com.auth0.client.mgmt.ResourceServersEntity#list(ResourceServersFilter)` instead. -- Deprecated `Request> com.auth0.client.mgmt.RulesEntity#list(RulesFilter filter)` has been removed. Use `Request com.auth0.client.mgmt.RulesEntity#listAll(RulesFilter filter)` instead. -- Deprecated `void com.auth0.json.mgmt.guardian.EnrollmentTicket#setUserId(String id)` has been removed. Use the constructor instead. -- Deprecated `com.auth0.json.mgmt.guardian.SNSFactorProvider` no-arg constructor has been removed. Use the full constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSAccessKeyId(String awsAccessKeyId)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSSecretAccessKey(String awsSecretAccessKey)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setAWSRegion(String awsRegion)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSAPNSPlatformApplicationARN(String apnARN)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.SNSFactorProvider#setSNSGCMPlatformApplicationARN(String gcmARN)` has been removed. Use the constructor instead. -- Deprecated `com.auth0.json.mgmt.guardian.TwilioFactorProvider` no-arg constructor has been removed. Use the full constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setFrom(String from)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setMessagingServiceSID(String messagingServiceSID)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setAuthToken(String authToken)` has been removed. Use the constructor instead. -- Deprecated `void com.auth0.json.mgmt.guardian.TwilioFactorProvider#setSID(String SID)` has been removed. Use the constructor instead. -- The default implementation of `com.auth0.net.Request#executeAsync()` has been removed; implementations must provide an implementation of `executeAsync`. - -### New classes and methods - -#### Refactored HTTP layer types - -Version 2 introduces a new abstraction, `com.auth0.net.client.Auth0HttpClient`, to handle the core HTTP responsibilities of sending HTTP requests. -An implementation is provided in `DefaultHttpClient`, which supports all the configurations available in the now-deprecated `HttpOptions`. -In addition to these configurations, it is also possible to implement the `Auth0HttpClient` for advanced use-cases where the default implementation or its configurations are not sufficient. -Several new types have been added to support this: - -- `com.auth0.net.client.Auth0HttpClient` has been added to define the HTTP client interface. -- `com.auth0.net.client.DefaultHttpClient` is the default HTTP implementation that should be used in the majority of cases. It supports the same configurations as `HttpOptions`, but can be reused across API clients. It uses `OkHttp` as the networking client internally. -- `com.auth0.net.client.Auth0HttpRequest` is a lightweight representation of an HTTP request to execute. Internal API implementations will form the request. -- `com.auth0.net.client.Auth0HttpResponse` is a lightweight representation of an HTTP response. Internal API implementations will parse the response. -- `com.auth0.net.client.HttpMethod` is an `enum` representing the HTTP methods. - -### New deprecations - -- `com.auth0.client.HttpOptions` has been deprecated, in favor of configuring the `DefaultHttpClient` directly. -- `com.auth0.client.mgmt.ManagementAPI` constructors have been deprecated in favor of `ManagementAPI#newBuilder(String domain, String apiToken)`. -- `com.auth0.client.auth.AuthAPI` constructors have been deprecated in favor of `AuthAPI.newBuilder(String domain, String clientId)` and `AuthAPI.newBuilder(String domain, String clientId, String clientSecret)`. +**v2:** +```java +import com.auth0.exception.Auth0Exception; +import com.auth0.exception.APIException; +import com.auth0.exception.RateLimitException; + +try { + User user = mgmt.users().get("user_id", null).execute().getBody(); +} catch (RateLimitException e) { + // Rate limited + long retryAfter = e.getLimit(); +} catch (APIException e) { + int statusCode = e.getStatusCode(); + String error = e.getError(); + String description = e.getDescription(); +} catch (Auth0Exception e) { + // Network or other errors +} +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiException; + +try { + GetUserResponseContent user = client.users().get("user_id"); +} catch (ManagementApiException e) { + int statusCode = e.statusCode(); + Object body = e.body(); + Map> headers = e.headers(); + String message = e.getMessage(); +} +``` + +### Accessing raw HTTP responses + +V3 provides access to full HTTP response metadata via `withRawResponse()`. + +**v2:** +```java +// Response wrapper provided status code +Response response = mgmt.users().get("user_id", null).execute(); +int statusCode = response.getStatusCode(); +User user = response.getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; + +// Use withRawResponse() to access headers and metadata +ManagementApiHttpResponse response = client.users() + .withRawResponse() + .get("user_id"); + +GetUserResponseContent user = response.body(); +Map> headers = response.headers(); +``` + +### Request-level configuration + +V3 allows per-request configuration through `RequestOptions`. + +**v2:** +```java +// Most configuration was at client level only +// Request-level headers required creating a new request manually +Request request = mgmt.users().get("user_id", null); +request.addHeader("X-Custom-Header", "value"); +User user = request.execute().getBody(); +``` + +**v3:** +```java +import com.auth0.client.mgmt.core.RequestOptions; + +GetUserResponseContent user = client.users().get( + "user_id", + GetUserRequestParameters.builder().build(), + RequestOptions.builder() + .timeout(10) + .maxRetries(1) + .addHeader("X-Custom-Header", "value") + .build() +); +``` + +### Type changes + +V3 uses generated type classes located in `com.auth0.client.mgmt.types` instead of the hand-written POJOs in `com.auth0.json.mgmt`. + +**v2:** +```java +import com.auth0.json.mgmt.users.User; +import com.auth0.json.mgmt.roles.Role; +import com.auth0.json.mgmt.organizations.Organization; +``` + +**v3:** +```java +import com.auth0.client.mgmt.types.UserResponseSchema; +import com.auth0.client.mgmt.types.CreateUserRequestContent; +import com.auth0.client.mgmt.types.CreateUserResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.auth0.client.mgmt.types.Organization; +``` + +Type naming conventions in v3: +- Request body types: `*RequestContent` (e.g., `CreateUserRequestContent`) +- Response types: `*ResponseContent` or `*ResponseSchema` (e.g., `GetUserResponseContent`, `UserResponseSchema`) +- Query parameters: `*RequestParameters` (e.g., `ListUsersRequestParameters`) + +All types use immutable builders: + +```java +// v3 type construction +CreateUserRequestContent request = CreateUserRequestContent + .builder() + .email("test@example.com") + .connection("Username-Password-Authentication") + .password("secure-password") + .build(); +``` From 9fb73695de3290bbf33aba983dc7886f1380b786 Mon Sep 17 00:00:00 2001 From: Tanya Sinha Date: Thu, 18 Dec 2025 19:13:09 +0530 Subject: [PATCH 09/13] Release 3.0.0-beta.0 (#801) --- .version | 2 +- CHANGELOG.md | 4 ++-- README.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.version b/.version index a5f3e61bd..7e9b52499 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.27.0 +3.0.0-beta.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 34229b786..249367a6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log -## [v3.0.0-beta.0](https://github.com/auth0/auth0-java/tree/v3.0.0-beta.0) (2025-12-18) -[Full Changelog](https://github.com/auth0/auth0-java/compare/v4.26.0...v3.0.0-beta.0) +## [3.0.0-beta.0](https://github.com/auth0/auth0-java/tree/3.0.0-beta.0) (2025-12-18) +[Full Changelog](https://github.com/auth0/auth0-java/compare/2.27.0...3.0.0-beta.0) > **Warning** This SDK is in beta and is subject to breaking changes. It is not recommended for production use, but your feedback and help in testing is appreciated! diff --git a/README.md b/README.md index e2856d505..31af5a7e1 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,14 @@ Add the dependency via Maven: com.auth0 auth0 - 2.27.0 + 3.0.0-beta.0 ``` or Gradle: ```gradle -implementation 'com.auth0:auth0:2.27.0' +implementation 'com.auth0:auth0:3.0.0-beta.0' ``` ### Configure the SDK From 1594c501eea1eb4affab4b478e268df9eb2e672a Mon Sep 17 00:00:00 2001 From: Tanya Sinha Date: Thu, 18 Dec 2025 19:28:23 +0530 Subject: [PATCH 10/13] Release 3.0.0-beta.0 (#802) --- .github/workflows/rl-scanner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rl-scanner.yml b/.github/workflows/rl-scanner.yml index 1455774ea..810c5277c 100644 --- a/.github/workflows/rl-scanner.yml +++ b/.github/workflows/rl-scanner.yml @@ -42,8 +42,8 @@ jobs: - name: Set up Gradle uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 - - name: Test and Assemble and ApiDiff with Gradle - run: ./gradlew assemble apiDiff check jacocoTestReport --continue --console=plain + - name: Test and Assemble with Gradle + run: ./gradlew assemble check --continue --console=plain - id: get_version uses: ./.github/actions/get-version From 48adb35bc51b8b3cb9fa050754e66aa1d9a61e5c Mon Sep 17 00:00:00 2001 From: Tanya Sinha Date: Thu, 18 Dec 2025 19:53:56 +0530 Subject: [PATCH 11/13] Release 3.0.0-beta.0 (#803) --- build.gradle | 9 +++------ gradle.properties | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 4585d933f..3bba2a96c 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,9 @@ repositories { } } +group = GROUP + + dependencies { // Core dependencies api 'com.squareup.okhttp3:okhttp:5.2.1' @@ -54,12 +57,6 @@ spotless { } -//java { -// withSourcesJar() -// withJavadocJar() -//} - - test { useJUnitPlatform() testLogging { diff --git a/gradle.properties b/gradle.properties index 69714a96a..9a6dd7708 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ GROUP=com.auth0 POM_ARTIFACT_ID=auth0 -VERSION_NAME=2.12.0 +VERSION_NAME=3.0.0-beta.0 POM_NAME=auth0-java POM_DESCRIPTION=Java client library for the Auth0 platform From 79a4765af2c3102cb55c78e1dce48e1fdd3dcd9d Mon Sep 17 00:00:00 2001 From: Tanya Sinha Date: Thu, 18 Dec 2025 20:18:51 +0530 Subject: [PATCH 12/13] Release 3.0.0-beta.0 (#804) --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index 3bba2a96c..92aeb6f7e 100644 --- a/build.gradle +++ b/build.gradle @@ -12,8 +12,12 @@ repositories { } } +apply from: rootProject.file('gradle/versioning.gradle') + +version = getVersionFromFile() group = GROUP +logger.lifecycle("Using version ${version} for ${name} group $group") dependencies { // Core dependencies From 53b29ce33e5495e12c013defa856b58ac7e0e570 Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 18 Dec 2025 20:45:17 +0530 Subject: [PATCH 13/13] Removed unused code --- sample-app/src/main/java/sample/App.java | 185 ----------------------- 1 file changed, 185 deletions(-) diff --git a/sample-app/src/main/java/sample/App.java b/sample-app/src/main/java/sample/App.java index cc897d04f..a2948490d 100644 --- a/sample-app/src/main/java/sample/App.java +++ b/sample-app/src/main/java/sample/App.java @@ -4,192 +4,7 @@ package sample; -import com.auth0.client.auth.AuthAPI; -import com.auth0.client.mgmt.ManagementApi; -import com.auth0.client.mgmt.core.ClientOptions; -import com.auth0.client.mgmt.core.Environment; -import com.auth0.client.mgmt.core.OAuthTokenSupplier; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.TokenRequest; - -import java.io.IOException; - public final class App { - private static String domain = "dev-tanya.us.auth0.com"; - private static String clientId = "PY6HuuGyYjDktVGOrf47DIaXwUy8uVYP"; - private static String clientSecret = "s7IGAq1eSDtoXOcA_9WW4mQRKVkzysG7CKC3hAUoQXT6irCMlhTK4hvPBGduXQn0"; - private static String audience = "https://dev-tanya.us.auth0.com/api/v2/"; - - public static void main(String[] args) throws IOException { - - // import com.auth0.client.mgmt.AsyncManagementApi - - AuthAPI auth = AuthAPI.newBuilder(domain, clientId, clientSecret).build(); - - TokenRequest tokenRequest = auth.requestToken(audience); - TokenHolder holder = tokenRequest.execute().getBody(); - String accessToken = holder.getAccessToken(); - System.out.println("Access Token: " + accessToken); - - try { - - -// AuthAPI auth = AuthAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}").build(); - -// String accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Il9ZeURNSUlqVENoWDI2cHFyZlBIaCJ9.eyJpc3MiOiJodHRwczovL2Rldi10YW55YS51cy5hdXRoMC5jb20vIiwic3ViIjoiUFk2SHV1R3lZakRrdFZHT3JmNDdESWFYd1V5OHVWWVBAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGV2LXRhbnlhLnVzLmF1dGgwLmNvbS9hcGkvdjIvIiwiaWF0IjoxNzYzNzM2MzA2LCJleHAiOjE3NjM4MjI3MDYsInNjb3BlIjoicmVhZDpjbGllbnRfZ3JhbnRzIGNyZWF0ZTpjbGllbnRfZ3JhbnRzIGRlbGV0ZTpjbGllbnRfZ3JhbnRzIHVwZGF0ZTpjbGllbnRfZ3JhbnRzIHJlYWQ6dXNlcnMgdXBkYXRlOnVzZXJzIGRlbGV0ZTp1c2VycyBjcmVhdGU6dXNlcnMgcmVhZDp1c2Vyc19hcHBfbWV0YWRhdGEgdXBkYXRlOnVzZXJzX2FwcF9tZXRhZGF0YSBkZWxldGU6dXNlcnNfYXBwX21ldGFkYXRhIGNyZWF0ZTp1c2Vyc19hcHBfbWV0YWRhdGEgcmVhZDp1c2VyX2N1c3RvbV9ibG9ja3MgY3JlYXRlOnVzZXJfY3VzdG9tX2Jsb2NrcyBkZWxldGU6dXNlcl9jdXN0b21fYmxvY2tzIGNyZWF0ZTp1c2VyX3RpY2tldHMgcmVhZDpjbGllbnRzIHVwZGF0ZTpjbGllbnRzIGRlbGV0ZTpjbGllbnRzIGNyZWF0ZTpjbGllbnRzIHJlYWQ6Y2xpZW50X2tleXMgdXBkYXRlOmNsaWVudF9rZXlzIGRlbGV0ZTpjbGllbnRfa2V5cyBjcmVhdGU6Y2xpZW50X2tleXMgcmVhZDpjbGllbnRfY3JlZGVudGlhbHMgdXBkYXRlOmNsaWVudF9jcmVkZW50aWFscyBkZWxldGU6Y2xpZW50X2NyZWRlbnRpYWxzIGNyZWF0ZTpjbGllbnRfY3JlZGVudGlhbHMgcmVhZDpjb25uZWN0aW9ucyB1cGRhdGU6Y29ubmVjdGlvbnMgZGVsZXRlOmNvbm5lY3Rpb25zIGNyZWF0ZTpjb25uZWN0aW9ucyByZWFkOnJlc291cmNlX3NlcnZlcnMgdXBkYXRlOnJlc291cmNlX3NlcnZlcnMgZGVsZXRlOnJlc291cmNlX3NlcnZlcnMgY3JlYXRlOnJlc291cmNlX3NlcnZlcnMgcmVhZDpkZXZpY2VfY3JlZGVudGlhbHMgdXBkYXRlOmRldmljZV9jcmVkZW50aWFscyBkZWxldGU6ZGV2aWNlX2NyZWRlbnRpYWxzIGNyZWF0ZTpkZXZpY2VfY3JlZGVudGlhbHMgcmVhZDpydWxlcyB1cGRhdGU6cnVsZXMgZGVsZXRlOnJ1bGVzIGNyZWF0ZTpydWxlcyByZWFkOnJ1bGVzX2NvbmZpZ3MgdXBkYXRlOnJ1bGVzX2NvbmZpZ3MgZGVsZXRlOnJ1bGVzX2NvbmZpZ3MgcmVhZDpob29rcyB1cGRhdGU6aG9va3MgZGVsZXRlOmhvb2tzIGNyZWF0ZTpob29rcyByZWFkOmFjdGlvbnMgdXBkYXRlOmFjdGlvbnMgZGVsZXRlOmFjdGlvbnMgY3JlYXRlOmFjdGlvbnMgcmVhZDplbWFpbF9wcm92aWRlciB1cGRhdGU6ZW1haWxfcHJvdmlkZXIgZGVsZXRlOmVtYWlsX3Byb3ZpZGVyIGNyZWF0ZTplbWFpbF9wcm92aWRlciBibGFja2xpc3Q6dG9rZW5zIHJlYWQ6c3RhdHMgcmVhZDppbnNpZ2h0cyByZWFkOnRlbmFudF9zZXR0aW5ncyB1cGRhdGU6dGVuYW50X3NldHRpbmdzIHJlYWQ6bG9ncyByZWFkOmxvZ3NfdXNlcnMgcmVhZDpzaGllbGRzIGNyZWF0ZTpzaGllbGRzIHVwZGF0ZTpzaGllbGRzIGRlbGV0ZTpzaGllbGRzIHJlYWQ6YW5vbWFseV9ibG9ja3MgZGVsZXRlOmFub21hbHlfYmxvY2tzIHVwZGF0ZTp0cmlnZ2VycyByZWFkOnRyaWdnZXJzIHJlYWQ6Z3JhbnRzIGRlbGV0ZTpncmFudHMgcmVhZDpndWFyZGlhbl9mYWN0b3JzIHVwZGF0ZTpndWFyZGlhbl9mYWN0b3JzIHJlYWQ6Z3VhcmRpYW5fZW5yb2xsbWVudHMgZGVsZXRlOmd1YXJkaWFuX2Vucm9sbG1lbnRzIGNyZWF0ZTpndWFyZGlhbl9lbnJvbGxtZW50X3RpY2tldHMgcmVhZDp1c2VyX2lkcF90b2tlbnMgY3JlYXRlOnBhc3N3b3Jkc19jaGVja2luZ19qb2IgZGVsZXRlOnBhc3N3b3Jkc19jaGVja2luZ19qb2IgcmVhZDpjdXN0b21fZG9tYWlucyBkZWxldGU6Y3VzdG9tX2RvbWFpbnMgY3JlYXRlOmN1c3RvbV9kb21haW5zIHVwZGF0ZTpjdXN0b21fZG9tYWlucyByZWFkOmVtYWlsX3RlbXBsYXRlcyBjcmVhdGU6ZW1haWxfdGVtcGxhdGVzIHVwZGF0ZTplbWFpbF90ZW1wbGF0ZXMgcmVhZDptZmFfcG9saWNpZXMgdXBkYXRlOm1mYV9wb2xpY2llcyByZWFkOnJvbGVzIGNyZWF0ZTpyb2xlcyBkZWxldGU6cm9sZXMgdXBkYXRlOnJvbGVzIHJlYWQ6cHJvbXB0cyB1cGRhdGU6cHJvbXB0cyByZWFkOmJyYW5kaW5nIHVwZGF0ZTpicmFuZGluZyBkZWxldGU6YnJhbmRpbmcgcmVhZDpsb2dfc3RyZWFtcyBjcmVhdGU6bG9nX3N0cmVhbXMgZGVsZXRlOmxvZ19zdHJlYW1zIHVwZGF0ZTpsb2dfc3RyZWFtcyBjcmVhdGU6c2lnbmluZ19rZXlzIHJlYWQ6c2lnbmluZ19rZXlzIHVwZGF0ZTpzaWduaW5nX2tleXMgcmVhZDpsaW1pdHMgdXBkYXRlOmxpbWl0cyBjcmVhdGU6cm9sZV9tZW1iZXJzIHJlYWQ6cm9sZV9tZW1iZXJzIGRlbGV0ZTpyb2xlX21lbWJlcnMgcmVhZDplbnRpdGxlbWVudHMgcmVhZDphdHRhY2tfcHJvdGVjdGlvbiB1cGRhdGU6YXR0YWNrX3Byb3RlY3Rpb24gcmVhZDpvcmdhbml6YXRpb25zX3N1bW1hcnkgY3JlYXRlOmF1dGhlbnRpY2F0aW9uX21ldGhvZHMgcmVhZDphdXRoZW50aWNhdGlvbl9tZXRob2RzIHVwZGF0ZTphdXRoZW50aWNhdGlvbl9tZXRob2RzIGRlbGV0ZTphdXRoZW50aWNhdGlvbl9tZXRob2RzIHJlYWQ6b3JnYW5pemF0aW9ucyB1cGRhdGU6b3JnYW5pemF0aW9ucyBjcmVhdGU6b3JnYW5pemF0aW9ucyBkZWxldGU6b3JnYW5pemF0aW9ucyByZWFkOm9yZ2FuaXphdGlvbl9kaXNjb3ZlcnlfZG9tYWlucyB1cGRhdGU6b3JnYW5pemF0aW9uX2Rpc2NvdmVyeV9kb21haW5zIGNyZWF0ZTpvcmdhbml6YXRpb25fZGlzY292ZXJ5X2RvbWFpbnMgZGVsZXRlOm9yZ2FuaXphdGlvbl9kaXNjb3ZlcnlfZG9tYWlucyBjcmVhdGU6b3JnYW5pemF0aW9uX21lbWJlcnMgcmVhZDpvcmdhbml6YXRpb25fbWVtYmVycyBkZWxldGU6b3JnYW5pemF0aW9uX21lbWJlcnMgY3JlYXRlOm9yZ2FuaXphdGlvbl9jb25uZWN0aW9ucyByZWFkOm9yZ2FuaXphdGlvbl9jb25uZWN0aW9ucyB1cGRhdGU6b3JnYW5pemF0aW9uX2Nvbm5lY3Rpb25zIGRlbGV0ZTpvcmdhbml6YXRpb25fY29ubmVjdGlvbnMgY3JlYXRlOm9yZ2FuaXphdGlvbl9tZW1iZXJfcm9sZXMgcmVhZDpvcmdhbml6YXRpb25fbWVtYmVyX3JvbGVzIGRlbGV0ZTpvcmdhbml6YXRpb25fbWVtYmVyX3JvbGVzIGNyZWF0ZTpvcmdhbml6YXRpb25faW52aXRhdGlvbnMgcmVhZDpvcmdhbml6YXRpb25faW52aXRhdGlvbnMgZGVsZXRlOm9yZ2FuaXphdGlvbl9pbnZpdGF0aW9ucyByZWFkOnNjaW1fY29uZmlnIGNyZWF0ZTpzY2ltX2NvbmZpZyB1cGRhdGU6c2NpbV9jb25maWcgZGVsZXRlOnNjaW1fY29uZmlnIGNyZWF0ZTpzY2ltX3Rva2VuIHJlYWQ6c2NpbV90b2tlbiBkZWxldGU6c2NpbV90b2tlbiBkZWxldGU6cGhvbmVfcHJvdmlkZXJzIGNyZWF0ZTpwaG9uZV9wcm92aWRlcnMgcmVhZDpwaG9uZV9wcm92aWRlcnMgdXBkYXRlOnBob25lX3Byb3ZpZGVycyBkZWxldGU6cGhvbmVfdGVtcGxhdGVzIGNyZWF0ZTpwaG9uZV90ZW1wbGF0ZXMgcmVhZDpwaG9uZV90ZW1wbGF0ZXMgdXBkYXRlOnBob25lX3RlbXBsYXRlcyBjcmVhdGU6ZW5jcnlwdGlvbl9rZXlzIHJlYWQ6ZW5jcnlwdGlvbl9rZXlzIHVwZGF0ZTplbmNyeXB0aW9uX2tleXMgZGVsZXRlOmVuY3J5cHRpb25fa2V5cyByZWFkOnNlc3Npb25zIHVwZGF0ZTpzZXNzaW9ucyBkZWxldGU6c2Vzc2lvbnMgcmVhZDpyZWZyZXNoX3Rva2VucyB1cGRhdGU6cmVmcmVzaF90b2tlbnMgZGVsZXRlOnJlZnJlc2hfdG9rZW5zIGNyZWF0ZTpzZWxmX3NlcnZpY2VfcHJvZmlsZXMgcmVhZDpzZWxmX3NlcnZpY2VfcHJvZmlsZXMgdXBkYXRlOnNlbGZfc2VydmljZV9wcm9maWxlcyBkZWxldGU6c2VsZl9zZXJ2aWNlX3Byb2ZpbGVzIGNyZWF0ZTpzc29fYWNjZXNzX3RpY2tldHMgZGVsZXRlOnNzb19hY2Nlc3NfdGlja2V0cyByZWFkOmZvcm1zIHVwZGF0ZTpmb3JtcyBkZWxldGU6Zm9ybXMgY3JlYXRlOmZvcm1zIHJlYWQ6Zmxvd3MgdXBkYXRlOmZsb3dzIGRlbGV0ZTpmbG93cyBjcmVhdGU6Zmxvd3MgcmVhZDpmbG93c192YXVsdCByZWFkOmZsb3dzX3ZhdWx0X2Nvbm5lY3Rpb25zIHVwZGF0ZTpmbG93c192YXVsdF9jb25uZWN0aW9ucyBkZWxldGU6Zmxvd3NfdmF1bHRfY29ubmVjdGlvbnMgY3JlYXRlOmZsb3dzX3ZhdWx0X2Nvbm5lY3Rpb25zIHJlYWQ6Zmxvd3NfZXhlY3V0aW9ucyBkZWxldGU6Zmxvd3NfZXhlY3V0aW9ucyByZWFkOmNvbm5lY3Rpb25zX29wdGlvbnMgdXBkYXRlOmNvbm5lY3Rpb25zX29wdGlvbnMgcmVhZDpzZWxmX3NlcnZpY2VfcHJvZmlsZV9jdXN0b21fdGV4dHMgdXBkYXRlOnNlbGZfc2VydmljZV9wcm9maWxlX2N1c3RvbV90ZXh0cyBjcmVhdGU6bmV0d29ya19hY2xzIHVwZGF0ZTpuZXR3b3JrX2FjbHMgcmVhZDpuZXR3b3JrX2FjbHMgZGVsZXRlOm5ldHdvcmtfYWNscyBkZWxldGU6dmRjc190ZW1wbGF0ZXMgcmVhZDp2ZGNzX3RlbXBsYXRlcyBjcmVhdGU6dmRjc190ZW1wbGF0ZXMgdXBkYXRlOnZkY3NfdGVtcGxhdGVzIGNyZWF0ZTpjdXN0b21fc2lnbmluZ19rZXlzIHJlYWQ6Y3VzdG9tX3NpZ25pbmdfa2V5cyB1cGRhdGU6Y3VzdG9tX3NpZ25pbmdfa2V5cyBkZWxldGU6Y3VzdG9tX3NpZ25pbmdfa2V5cyByZWFkOmZlZGVyYXRlZF9jb25uZWN0aW9uc190b2tlbnMgZGVsZXRlOmZlZGVyYXRlZF9jb25uZWN0aW9uc190b2tlbnMgY3JlYXRlOnVzZXJfYXR0cmlidXRlX3Byb2ZpbGVzIHJlYWQ6dXNlcl9hdHRyaWJ1dGVfcHJvZmlsZXMgdXBkYXRlOnVzZXJfYXR0cmlidXRlX3Byb2ZpbGVzIGRlbGV0ZTp1c2VyX2F0dHJpYnV0ZV9wcm9maWxlcyByZWFkOmV2ZW50X3N0cmVhbXMgY3JlYXRlOmV2ZW50X3N0cmVhbXMgZGVsZXRlOmV2ZW50X3N0cmVhbXMgdXBkYXRlOmV2ZW50X3N0cmVhbXMgcmVhZDpldmVudF9kZWxpdmVyaWVzIHVwZGF0ZTpldmVudF9kZWxpdmVyaWVzIGNyZWF0ZTpjb25uZWN0aW9uX3Byb2ZpbGVzIHJlYWQ6Y29ubmVjdGlvbl9wcm9maWxlcyB1cGRhdGU6Y29ubmVjdGlvbl9wcm9maWxlcyBkZWxldGU6Y29ubmVjdGlvbl9wcm9maWxlcyByZWFkOm9yZ2FuaXphdGlvbl9jbGllbnRfZ3JhbnRzIGNyZWF0ZTpvcmdhbml6YXRpb25fY2xpZW50X2dyYW50cyBkZWxldGU6b3JnYW5pemF0aW9uX2NsaWVudF9ncmFudHMgcmVhZDpzZWN1cml0eV9tZXRyaWNzIHJlYWQ6Y29ubmVjdGlvbnNfa2V5cyB1cGRhdGU6Y29ubmVjdGlvbnNfa2V5cyBjcmVhdGU6Y29ubmVjdGlvbnNfa2V5cyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsImF6cCI6IlBZNkh1dUd5WWpEa3RWR09yZjQ3RElhWHdVeTh1VllQIn0.g86ev9tdiBka5FfY9suyKF1Q94bk2EbE72tpJjMDXklAroivAnwXTKcTHmK1Mi8EhENVU02nxZwXUPCLYYIBlMb9vHtqdfUXLkb1idVL0Tas-TQN51i5xHvFWkE68Ji91YuFOdEQ7hYFWVvJasM8N2ZdoeOJefOwRWSS8BrWGfrRQ3kbJZxzUQ-w-_WvBkk06c7gP9zFb4vOxQrEyGlwzpkx9dcVkOhSk3cKhO84S-3awJA2ZOBl1ZrqG6T0-eZZZekD5SM-UqFX-cFtsASXzeqi2ziuqyNNv14kn_eV56B65W7u-BR6pkqTxa7PZKsXoIdV4fXLub48CJp6SwZNXA"; - -// ManagementApi client = ManagementApi -// .builder() -// .url(audience) -// .token(accessToken) -// .build(); - - OAuthTokenSupplier supplier = new OAuthTokenSupplier( - clientId, clientSecret, "https://dev-tanya.us.auth0.com", audience); - - ManagementApi client = new ManagementApi(ClientOptions.builder() - .environment(Environment.custom("https://dev-tanya.us.auth0.com" + "/api/v2")) - .addHeader("Authorization", () -> "Bearer " + supplier.get()) - .build()); - -// - -// CreateActionResponseContent resp = client.actions().create( -// CreateActionRequestContent -// .builder() -// .name("name") -// .supportedTriggers( -// new ArrayList( -// Arrays.asList( -// ActionTrigger -// .builder() -// .id("id") -// .build() -// ) -// ) -// ) -// .build() -// ); - -// client.users().list(); - -// UpdateUserRequestContent updateUserRequestContent1 = UpdateUserRequestContent.builder() -// .givenName(OptionalNullable.of("John")) // Set a value -// .familyName(OptionalNullable.of("Sinha")) // Explicitly send null -// .nickname(OptionalNullable.absent()) // Exclude the field from the request -// .build(); -// -// -// UpdateUserResponseContent resp1 = client.users().update("auth0|68cb986ea95fb4c16522b85d", updateUserRequestContent1); -// System.out.println("resp1 " + resp1.toString()); -//// -////// -// UpdateUserRequestContent updateUserRequestContent = UpdateUserRequestContent.builder() -// .givenName(OptionalNullable.of("John")) // Set a value -// .familyName(OptionalNullable.ofNullable(null)) // Explicitly send null -// .nickname(OptionalNullable.absent()) // Exclude the field from the request -// .build(); -// -// -// UpdateUserResponseContent resp = client.users().update("auth0|68cb986ea95fb4c16522b85d", updateUserRequestContent); -// System.out.println("resp " + resp.toString()); -// -// UpdateBrandingRequestContent update = UpdateBrandingRequestContent.builder() -// .logoUrl("https://example.com/logo.ico") -// .faviconUrl(Optional.ofNullable(null)).build(); -// UpdateBrandingResponseContent resp2 = client.branding().update(update); -// System.out.println("resp2 " + resp2.toString()); -// -// ExecutorService executor = Executors.newFixedThreadPool(10); -// -// for (int i = 0; i < 102; i++) { // Simulate 50 requests -// executor.submit(() -> { -// try { -// GetClientResponseContent get = client.clients().get("K6T6DHgl2AyzKHfgQ8A3Nqhdw15iuGdC"); -// System.out.println("get " + get.toString()); -// } catch (Exception e) { -// System.out.println("Caught exception: " + e); -// } -// }); -// } - -// GetClientResponseContent get = client.clients().get("K6T6DHgl2AyzKHfgQ8A3Nqhdw15iuGdC"); -// System.out.println("get " + get.toString()); -// -// SyncPagingIterable list = client.clients().list(ListClientsRequestParameters.builder().page(0).perPage(1).includeTotals(true).build()); -// for( Client c : list){ -// System.out.println("Client: " + c.toString()); -// } -// -// SyncPagingIterable logs = client.logs().list(); -// for (Log log : logs) { -// System.out.println("log " + log.toString()); -// } -// System.out.println("Logs fetched successfully."+logs.getItems().size()); -//// -// System.out.println("Creating connection..."); -// -// CreateConnectionRequestContent createConnection = -// CreateConnectionRequestContent -// .builder() -// .name("my-connection-1234-1234-1234-1234-123-99") -// .strategy(ConnectionIdentityProviderEnum.valueOf("auth0")) -// .build(); -// -// CreateConnectionResponseContent createClientResp = client.connections().create(createConnection); -// System.out.println("createClientResp " + createClientResp.toString()); -// -// List enabledClients = new ArrayList<>(); -// enabledClients.add("PY6HuuGyYjDktVGOrf47DIaXwUy8uVYP"); -// -// UpdateConnectionResponseContent updateConnectionResponseContent = client.connections().update("con_UwaU8C6gvIl2XJL3", -// UpdateConnectionRequestContent -// .builder() -// .enabledClients(enabledClients) -// .build() -// ); -// System.out.println("updateConnectionResponseContent " + updateConnectionResponseContent.toString()); - -// SyncPagingIterable listConnection = client.connections().list(); -// System.out.println("Connections fetched successfully."+listConnection.getItems().size()); -// -// GetConnectionResponseContent getConnectionResponseContent = client.connections().get("con_UwaU8C6gvIl2XJL3"); -// System.out.println("getConnectionResponseContent " + getConnectionResponseContent.toString()); - - // - // - // client.connections().delete(String.valueOf(createClientResp.getId())); - -// ManagementApiHttpResponse response = client.connections() -// .withRawResponse() -// .delete("con_UwaU8C6gvIl2XJL3"); -// System.out.println("Delete connection response status code: " + response.body()); - - - -// client.users().list(null, RequestOptions.withClientCredentials( -// "https://dev-tanya.us.auth0.com", clientId, clientSecret)); - -// double get = client.stats().getActiveUsersCount(); -// System.out.println("Active Users Count: " + get); - -// List eventStreamResponseContents = client.eventStreams().list(); -// SyncPagingIterable getKeys = client.keys().encryption().list( -// ListEncryptionKeysRequestParameters -// .builder() -// .perPage(25) -// .build() -// ); -// System.out.println("Encryption Keys Count: " + getKeys.getItems().size()); - -// client.users().create() - - } - catch (Exception ex){ - System.out.println(ex); - System.out.println(ex.getStackTrace()); - } - } }